@ -698,58 +698,58 @@ isDark?res.Dark:res.Light;return true===isNumericValue?oColor.r<<16&16711680|oCo
getNumFromXml ( vals [ "tint" ] ) ) ; else if ( null != vals [ "rgb" ] ) return new AscCommonExcel . RgbColor ( 16777215 & getNumFromXml ( vals [ "rgb" ] ) ) } return null } function getBoolFromXml ( val ) { return "0" !== val && "false" !== val && "off" !== val } function CUserCacheColor ( nColor ) { this . Light = null ; this . Dark = null ; this . init ( nColor ) } CUserCacheColor . prototype . init = function ( nColor ) { var r = nColor >> 16 & 255 ; var g = nColor >> 8 & 255 ; var b = nColor & 255 ; var Y = Math . max ( 0 , Math . min ( 255 , . 299 * r + . 587 * g + . 114 * b ) ) ; var Cb = Math . max ( 0 , Math . min ( 255 , 128 - . 168736 * r - . 331264 *
g + . 5 * b ) ) ; var Cr = Math . max ( 0 , Math . min ( 255 , 128 + . 5 * r - . 418688 * g - . 081312 * b ) ) ; if ( Y > 63 ) Y = 63 ; var R = Math . max ( 0 , Math . min ( 255 , Y + 1.402 * ( Cr - 128 ) ) ) | 0 ; var G = Math . max ( 0 , Math . min ( 255 , Y - . 34414 * ( Cb - 128 ) - . 71414 * ( Cr - 128 ) ) ) | 0 ; var B = Math . max ( 0 , Math . min ( 255 , Y + 1.772 * ( Cb - 128 ) ) ) | 0 ; this . Light = new CColor ( r , g , b , 255 ) ; this . Dark = new CColor ( R , G , B , 255 ) } ; function loadScript ( url , onSuccess , onError ) { if ( window [ "NATIVE_EDITOR_ENJINE" ] === true || window [ "Native" ] !== undefined ) { onSuccess ( ) ; return } if ( window [ "AscDesktopEditor" ] && window [ "local_load_add" ] ) { var _context =
{ "completeLoad" : function ( ) { return onSuccess ( ) } } ; window [ "local_load_add" ] ( _context , "sdk-all-from-min" , url ) ; var _ret _param = window [ "AscDesktopEditor" ] [ "LoadJS" ] ( url ) ; if ( 2 != _ret _param ) window [ "local_load_remove" ] ( url ) ; if ( _ret _param == 1 ) { setTimeout ( onSuccess , 1 ) ; return } else if ( _ret _param == 2 ) return } var script = document . createElement ( "script" ) ; script . type = "text/javascript" ; script . src = url ; script . onload = onSuccess ; script . onerror = onError ; document . head . appendChild ( script ) } function loadSdk ( sdkName , onSuccess , onError ) { if ( window [ "AscNotLoadAllScript" ] ) onSuccess ( ) ;
else loadScript( "./../../../../sdkjs/" + sdkName + "/sdk-all.js ", onSuccess , onError ) } function getAltGr ( e ) { var ctrlKey = e . metaKey || e . ctrlKey ; var altKey = e . altKey ; return altKey && ( AscBrowser . isMacOs ? ! ctrlKey : ctrlKey ) } function getColorSchemeByName ( sName ) { for ( var i = 0 ; i < AscCommon . g _oUserColorScheme . length ; ++ i ) { var tmp = AscCommon . g _oUserColorScheme [ i ] ; if ( tmp . name === sName ) { var scheme = new AscFormat . ClrScheme , _c ; scheme . name = tmp . name ; _c = tmp . get _dk1 ( ) ; scheme . colors [ 8 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _lt1 ( ) ;
scheme . colors [ 12 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _dk2 ( ) ; scheme . colors [ 9 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _lt2 ( ) ; scheme . colors [ 13 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _accent1 ( ) ; scheme . colors [ 0 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _accent2 ( ) ; scheme . colors [ 1 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _accent3 ( ) ; scheme . colors [ 2 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _accent4 ( ) ; scheme . colors [ 3 ] =
AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _accent5 ( ) ; scheme . colors [ 4 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _accent6 ( ) ; scheme . colors [ 5 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _hlink ( ) ; scheme . colors [ 11 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _folHlink ( ) ; scheme . colors [ 10 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; return scheme } } return null } function getAscColorScheme ( _scheme , theme ) { var elem , _c ; var _rgba = { R : 0 , G : 0 , B : 0 , A : 255 } ; elem = new AscCommon . CAscColorScheme ;
elem . name = _scheme . name ; _scheme . colors [ 8 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 8 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 12 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 12 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 9 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 9 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 13 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 13 ] . RGBA ;
elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 0 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 0 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 1 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 1 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 2 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 2 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 3 ] . Calculate ( theme , null ,
null , null , _rgba ) ; _c = _scheme . colors [ 3 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 4 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 4 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 5 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 5 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 11 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 11 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G ,
_c . B ) ) ; _scheme . colors [ 10 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 10 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; return elem } function isEastAsianScript ( value ) { return 12544 <= value && value <= 12591 || 12704 <= value && value <= 12735 || 19968 <= value && value <= 40938 || 13312 <= value && value <= 19893 || 131072 <= value && value <= 173782 || 173824 <= value && value <= 177972 || 177984 <= value && value <= 178205 || 178208 <= value && value <= 183969 || 183984 <= value && value <= 191456 || 63744 <= value && value <= 64255 || 194560 <= value &&
value <= 195103 || 12032 <= value && value <= 12255 || 11904 <= value && value <= 12031 || 12736 <= value && value <= 12783 || 12272 <= value && value <= 12287 || 4352 <= value && value <= 4607 || 43360 <= value && value <= 43391 || 55216 <= value && value <= 55295 || 12592 <= value && value <= 12687 || 65280 <= value && value <= 65519 || 44032 <= value && value <= 55215 || 12352 <= value && value <= 12447 || 110848 <= value && value <= 110895 || 110592 <= value && value <= 110847 || 12688 <= value && value <= 12703 || 12448 <= value && value <= 12543 || 12784 <= value && value <= 12799 || 42192 <= value && value <= 42239 || 93952 <= value &&
value <= 94111 || 110960 <= value && value <= 111359 || 94208 <= value && value <= 100332 || 100352 <= value && value <= 101119 || 40960 <= value && value <= 42127 || 42128 <= value && value <= 42191 } var g _oIdCounter = new CIdCounter ; window [ "SetDoctRendererParams" ] = function ( _params ) { if ( _params [ "retina" ] === true ) AscBrowser . isRetina = true } ; window . Asc . g _signature _drawer = null ; function CSignatureDrawer ( id , api , w , h ) { window . Asc . g _signature _drawer = this ; this . Api = api ; this . CanvasParent = document . getElementById ( id ) ; this . Canvas = document . createElement ( "canvas" ) ;
this . Canvas . style . position = "absolute" ; this . Canvas . style . left = "0px" ; this . Canvas . style . top = "0px" ; var _width = parseInt ( this . CanvasParent . offsetWidth ) ; var _height = parseInt ( this . CanvasParent . offsetHeight ) ; if ( 0 == _width ) _width = 300 ; if ( 0 == _height ) _height = 80 ; this . Canvas . width = _width ; this . Canvas . height = _height ; this . CanvasParent . appendChild ( this . Canvas ) ; this . Image = "" ; this . ImageHtml = null ; this . Text = "" ; this . Font = "Arial" ; this . Size = 10 ; this . Italic = true ; this . Bold = false ; this . Width = w ; this . Height = h ; this . CanvasReturn = null ;
this . IsAsync = false } CSignatureDrawer . prototype . getCanvas = function ( ) { return this . CanvasReturn == null ? this . Canvas : this . CanvasReturn } ; CSignatureDrawer . prototype . getImages = function ( ) { if ( ! this . isValid ( ) ) return [ "" , "" ] ; this . CanvasReturn = document . createElement ( "canvas" ) ; this . CanvasReturn . width = this . Width * AscCommon . g _dKoef _mm _to _pix ; this . CanvasReturn . height = this . Height * AscCommon . g _dKoef _mm _to _pix ; if ( this . Text != "" ) this . drawText ( ) ; else this . drawImage ( ) ; var _ret = [ ] ; _ret . push ( this . CanvasReturn . toDataURL ( "image/png" ) ) ;
var _ctx = this . CanvasReturn . getContext ( "2d" ) ; _ctx . strokeStyle = "#FF0000" ; _ctx . lineWidth = 2 ; _ctx . moveTo ( 0 , 0 ) ; _ctx . lineTo ( this . CanvasReturn . width , this . CanvasReturn . height ) ; _ctx . moveTo ( 0 , this . CanvasReturn . height ) ; _ctx . lineTo ( this . CanvasReturn . width , 0 ) ; _ctx . stroke ( ) ; _ret . push ( this . CanvasReturn . toDataURL ( "image/png" ) ) ; this . CanvasReturn = null ; return _ret } ; CSignatureDrawer . prototype . setText = function ( text , font , size , isItalic , isBold ) { if ( this . IsAsync ) { this . Text = text ; return } this . Image = "" ; this . ImageHtml = null ; this . Text =
text ; this . Font = font ; this . Size = size ; this . Italic = isItalic ; this . Bold = isBold ; this . IsAsync = true ; AscFonts . FontPickerByCharacter . checkText ( this . Text , this , function ( ) { this . IsAsync = false ; var loader = AscCommon . g _font _loader ; var fontinfo = AscFonts . g _fontApplication . GetFontInfo ( font ) ; var isasync = loader . LoadFont ( fontinfo , function ( ) { window . Asc . g _signature _drawer . Api . sync _EndAction ( Asc . c _oAscAsyncActionType . Information , Asc . c _oAscAsyncAction . LoadFont ) ; window . Asc . g _signature _drawer . drawText ( ) } ) ; if ( false === isasync ) this . drawText ( ) } ) } ;
CSignatureDrawer . prototype . drawText = function ( ) { var _oldTurn = this . Api . isViewMode ; var _oldMarks = this . Api . ShowParaMarks ; this . Api . isViewMode = true ; this . Api . ShowParaMarks = false ; AscFormat . ExecuteNoHistory ( AscCommon . DrawTextByCenter , this , [ ] ) ; this . Api . isViewMode = _oldTurn ; this . Api . ShowParaMarks = _oldMarks } ; CSignatureDrawer . prototype . drawImage = function ( ) { var _canvas = this . getCanvas ( ) ; var w = _canvas . width ; var h = _canvas . height ; var _ctx = _canvas . getContext ( "2d" ) ; _ctx . clearRect ( 0 , 0 , w , h ) ; var im _w = this . ImageHtml . width ;
var im _h = this . ImageHtml . height ; var _x = 0 ; var _y = 0 ; var _w = 0 ; var _h = 0 ; var koef1 = w / h ; var koef2 = im _w / im _h ; if ( koef1 > koef2 ) { _h = h ; _w = koef2 * _h >> 0 ; _y = 0 ; _x = w - _w >> 1 } else { _w = w ; _h = _w / koef2 >> 0 ; _x = 0 ; _y = h - _h >> 1 } _ctx . drawImage ( this . ImageHtml , _x , _y , _w , _h ) } ; CSignatureDrawer . prototype . selectImage = CSignatureDrawer . prototype [ "selectImage" ] = function ( ) { this . Text = "" ; window [ "AscDesktopEditor" ] [ "OpenFilenameDialog" ] ( "images" , false , function ( _file ) { var file = _file ; if ( Array . isArray ( file ) ) file = file [ 0 ] ; if ( file == "" ) return ; var _drawer =
window . Asc . g _signature _drawer ; _drawer . Image = window [ "AscDesktopEditor" ] [ "GetImageBase64" ] ( file ) ; _drawer . ImageHtml = new Image ; _drawer . ImageHtml . onload = function ( ) { window . Asc . g _signature _drawer . drawImage ( ) } ; _drawer . ImageHtml . src = _drawer . Image ; _drawer = null } ) } ; CSignatureDrawer . prototype . isValid = function ( ) { return this . Image != "" || this . Text != "" } ; CSignatureDrawer . prototype . destroy = function ( ) { window . Asc . g _signature _drawer . CanvasParent . removeChild ( this . Canvas ) ; delete window . Asc . g _signature _drawer } ; function CSignatureImage ( ) { this . ImageValidBase64 =
"" ; this . ImageInvalidBase64 = "" ; this . ImageValid = null ; this . ImageInvalid = null ; this . Valid = false ; this . Loading = 0 ; this . Remove = function ( ) { this . ImageValidBase64 = "" ; this . ImageInvalidBase64 = "" ; this . ImageValid = null ; this . ImageInvalid = null ; this . Valid = false ; this . Loading = 0 } ; this . Register = function ( _api , _guid ) { if ( _api . ImageLoader . map _image _index [ _guid ] ) return ; var _obj = { Image : this . Valid ? this . ImageValid : this . ImageInvalid , Status : AscFonts . ImageLoadStatus . Complete , src : _guid } ; _api . ImageLoader . map _image _index [ _guid ] = _obj } ;
this . Unregister = function ( _api , _guid ) { if ( _api . ImageLoader . map _image _index [ _guid ] ) delete _api . ImageLoader . map _image _index [ _guid ] } } AscCommon . EncryptionMessageType = { Encrypt : 0 , Decrypt : 1 } ; function CEncryptionData ( ) { this . _init = false ; this . arrData = [ ] ; this . arrImages = [ ] ; this . handleChangesCallback = null ; this . isChangesHandled = false ; this . cryptoMode = 0 ; this . isChartEditor = false ; this . isExistDecryptedChanges = false ; this . cryptoPrefix = window [ "AscDesktopEditor" ] && window [ "AscDesktopEditor" ] [ "GetEncryptedHeader" ] ? window [ "AscDesktopEditor" ] [ "GetEncryptedHeader" ] ( ) :
"ENCRYPTED;" ; this . cryptoPrefixLen = this . cryptoPrefix . length ; this . editorId = null ; this . nextChangesTimeoutId = - 1 ; this . isPasswordCryptoPresent = false ; this . init = function ( ) { this . _init = true } ; this . isInit = function ( ) { return this . _init } ; this . isNeedCrypt = function ( ) { if ( window . g _asc _plugins ) if ( ! window . g _asc _plugins . isRunnedEncryption ( ) ) return false ; if ( ! window [ "AscDesktopEditor" ] ) return false ; if ( this . isChartEditor ) return false ; if ( 2 == this . cryptoMode ) return true ; if ( 0 === window [ "AscDesktopEditor" ] [ "CryptoMode" ] ) return false ;
return true } ; this . isCryptoImages = function ( ) { return this . isNeedCrypt ( ) && this . isPasswordCryptoPresent } ; this . addCryproImagesFromDialog = function ( callback ) { var _this = this ; window [ "AscDesktopEditor" ] [ "OpenFilenameDialog" ] ( "images" , true , function ( files ) { if ( ! Array . isArray ( files ) ) files = [ files ] ; if ( 0 == files . length ) return ; var _files = [ ] ; var _options = { isImageCrypt : true , callback : callback , ext : [ ] } ; for ( var i = 0 ; i < files . length ; i ++ ) { _files . push ( window [ "AscDesktopEditor" ] [ "GetImageBase64" ] ( files [ i ] , true ) ) ; _options . ext . push ( AscCommon . GetFileExtension ( files [ i ] ) ) } _this . sendChanges ( this ,
_files , AscCommon . EncryptionMessageType . Encrypt , _options ) } ) } ; this . addCryproImagesFromUrls = function ( urls , callback ) { var _editor = window [ "Asc" ] [ "editor" ] ? window [ "Asc" ] [ "editor" ] : window . editor ; _editor . sync _StartAction ( Asc . c _oAscAsyncActionType . BlockInteraction , Asc . c _oAscAsyncAction . LoadImage ) ; var _this = this ; window [ "AscDesktopEditor" ] [ "DownloadFiles" ] ( urls , [ ] , function ( files ) { _editor . sync _EndAction ( Asc . c _oAscAsyncActionType . BlockInteraction , Asc . c _oAscAsyncAction . LoadImage ) ; _editor . sync _StartAction ( Asc . c _oAscAsyncActionType . BlockInteraction ,
Asc . c _oAscAsyncAction . UploadImage ) ; var _files = [ ] ; var _options = { isImageCrypt : true , isUrls : true , callback : callback , ext : [ ] , api : _editor } ; for ( var elem in files ) { _files . push ( window [ "AscDesktopEditor" ] [ "GetImageBase64" ] ( files [ elem ] , true ) ) ; _options . ext . push ( window [ "AscDesktopEditor" ] [ "GetImageFormat" ] ( files [ elem ] ) ) ; window [ "AscDesktopEditor" ] [ "RemoveFile" ] ( files [ elem ] ) } _this . sendChanges ( this , _files , AscCommon . EncryptionMessageType . Encrypt , _options ) } ) } ; this . onDecodeError = function ( ) { var _editor = window [ "Asc" ] [ "editor" ] ?
window [ "Asc" ] [ "editor" ] : window . editor ; _editor . sendEvent ( "asc_onError" , Asc . c _oAscError . ID . DataEncrypted , Asc . c _oAscError . Level . Critical ) } ; this . checkEditorId = function ( ) { if ( null == this . editorId ) { var _editor = window [ "Asc" ] [ "editor" ] ? window [ "Asc" ] [ "editor" ] : window . editor ; this . editorId = _editor . editorId } } ; this . decryptImage = function ( src , img , data ) { this . sendChanges ( this , [ data ] , AscCommon . EncryptionMessageType . Decrypt , { isImageDecrypt : true , src : src , img : img } ) } ; this . nextChanges = function ( ) { this . nextChangesTimeoutId =
setTimeout ( function ( ) { AscCommon . EncryptionWorker . sendChanges ( undefined , undefined ) ; this . nextChangesTimeoutId = - 1 } , 10 ) } ; this . sendChanges = function ( sender , data , type , options ) { if ( ! this . isNeedCrypt ( ) ) { if ( AscCommon . EncryptionMessageType . Encrypt == type ) sender . _send ( data , true ) ; else if ( AscCommon . EncryptionMessageType . Decrypt == type ) { if ( this . isExistEncryptedChanges ( data [ "changes" ] ) ) { this . onDecodeError ( ) ; return } sender . _onSaveChanges ( data , true ) } return } if ( undefined !== type ) this . arrData . push ( { sender : sender , type : type ,
data : data , options : options } ) ; if ( this . arrData . length == 0 ) return ; if ( undefined !== type && ( 1 != this . arrData . length || ! this . isChangesHandled ) ) return ; if ( undefined !== type && - 1 != this . nextChangesTimeoutId ) { clearTimeout ( this . nextChangesTimeoutId ) ; this . nextChangesTimeoutId = - 1 } if ( AscCommon . EncryptionMessageType . Encrypt == this . arrData [ 0 ] . type ) if ( this . arrData [ 0 ] . options && this . arrData [ 0 ] . options . isImageCrypt ) window . g _asc _plugins . sendToEncryption ( { "type" : "encryptData" , "data" : this . arrData [ 0 ] . data } ) ; else window . g _asc _plugins . sendToEncryption ( { "type" : "encryptData" ,
"data" : JSON . parse ( this . arrData [ 0 ] . data [ "changes" ] ) } ) ; else if ( AscCommon . EncryptionMessageType . Decrypt == this . arrData [ 0 ] . type ) if ( this . arrData [ 0 ] . options && this . arrData [ 0 ] . options . isImageDecrypt ) window . g _asc _plugins . sendToEncryption ( { "type" : "decryptData" , "data" : this . arrData [ 0 ] . data } ) ; else window . g _asc _plugins . sendToEncryption ( { "type" : "decryptData" , "data" : this . arrData [ 0 ] . data [ "changes" ] } ) } ; this . receiveChanges = function ( obj ) { var data = obj [ "data" ] ; var check = obj [ "check" ] ; if ( ! check ) { this . onDecodeError ( ) ; return } if ( this . handleChangesCallback ) { this . isExistDecryptedChanges =
true ; this . checkEditorId ( ) ; if ( this . editorId == AscCommon . c _oEditorId . Spreadsheet ) for ( var i = data . length - 1 ; i >= 0 ; i -- ) this . handleChangesCallback . changesBase [ i ] = data [ i ] ; else for ( var i = data . length - 1 ; i >= 0 ; i -- ) this . handleChangesCallback . changesBase [ i ] . m _pData = data [ i ] ; this . isChangesHandled = true ; this . handleChangesCallback . callback . call ( this . handleChangesCallback . sender ) ; this . handleChangesCallback = null ; this . nextChanges ( ) ; return } var obj = this . arrData [ 0 ] ; this . arrData . splice ( 0 , 1 ) ; if ( AscCommon . EncryptionMessageType . Encrypt ==
obj . type ) if ( obj . options && obj . options . isImageCrypt ) { for ( var i = 0 ; i < data . length ; i ++ ) if ( this . cryptoPrefix == data [ i ] . substr ( 0 , this . cryptoPrefixLen ) ) data [ i ] = this . cryptoPrefix + obj . options . ext [ i ] + ";" + data [ i ] . substr ( this . cryptoPrefixLen ) ; if ( ! obj . options . isUrls ) obj . options . callback ( Asc . c _oAscError . ID . No , data ) ; else AscCommon . UploadImageUrls ( data , obj . options . api . documentId , obj . options . api . documentUserId , obj . options . api . CoAuthoringApi . get _jwt ( ) , function ( urls ) { obj . options . api . sync _EndAction ( Asc . c _oAscAsyncActionType . BlockInteraction ,
Asc . c _oAscAsyncAction . UploadImage ) ; obj . options . callback ( urls ) } ) } else { obj . data [ "changes" ] = JSON . stringify ( data ) ; obj . sender . _send ( obj . data , true ) } else if ( AscCommon . EncryptionMessageType . Decrypt == obj . type ) if ( obj . options && obj . options . isImageDecrypt ) { window [ "AscDesktopEditor" ] [ "ResaveFile" ] ( obj . options . src , data [ 0 ] ) ; obj . options . img [ "onload_crypto" ] ( obj . options . src ) } else { this . isExistDecryptedChanges = true ; obj . data [ "changes" ] = data ; obj . sender . _onSaveChanges ( obj . data , true ) } this . nextChanges ( ) } ; this . isExistEncryptedChanges =
function ( _array ) { if ( 0 == _array . length ) return false ; this . checkEditorId ( ) ; var isChangesMode = _array [ 0 ] [ "change" ] ? true : false ; var _prefix = "" ; var _checkPrefixLen = this . cryptoPrefixLen + 1 ; if ( isChangesMode ) { for ( var i = _array . length - 1 ; i >= 0 ; i -- ) if ( _array [ i ] [ "change" ] . length > _checkPrefixLen ) { _prefix = _array [ i ] [ "change" ] . substr ( 0 , _checkPrefixLen ) ; if ( - 1 != _prefix . indexOf ( this . cryptoPrefix ) ) { isCrypted = true ; break } } return isCrypted } var isCrypted = false ; if ( this . editorId == AscCommon . c _oEditorId . Spreadsheet ) for ( var i = _array . length -
1 ; i >= 0 ; i -- ) { if ( _array [ i ] . length > _checkPrefixLen ) { _prefix = _array [ i ] . substr ( 0 , _checkPrefixLen ) ; if ( - 1 != _prefix . indexOf ( this . cryptoPrefix ) ) { isCrypted = true ; break } } } else for ( var i = _array . length - 1 ; i >= 0 ; i -- ) if ( _array [ i ] . m _pData . length > _checkPrefixLen ) { _prefix = _array [ i ] . m _pData . substr ( 0 , _checkPrefixLen ) ; if ( - 1 != _prefix . indexOf ( this . cryptoPrefix ) ) { isCrypted = true ; break } } return isCrypted } ; this . handleChanges = function ( _array , _sender , _callback ) { if ( 0 == _array . length || ! this . isNeedCrypt ( ) ) { if ( this . isExistEncryptedChanges ( _array ) ) { this . onDecodeError ( ) ;
return } this . isChangesHandled = true ; _callback . call ( _sender ) ; return } this . handleChangesCallback = { changesBase : _array , changes : [ ] , sender : _sender , callback : _callback } ; this . checkEditorId ( ) ; if ( this . editorId == AscCommon . c _oEditorId . Spreadsheet ) for ( var i = _array . length - 1 ; i >= 0 ; i -- ) this . handleChangesCallback . changes [ i ] = _array [ i ] ; else for ( var i = _array . length - 1 ; i >= 0 ; i -- ) this . handleChangesCallback . changes [ i ] = _array [ i ] . m _pData ; window . g _asc _plugins . sendToEncryption ( { "type" : "decryptData" , "data" : this . handleChangesCallback . changes } ) } ;
this . asc _setAdvancedOptions = function ( api , idOption , option ) { if ( window . isNativeOpenPassword ) { window [ "AscDesktopEditor" ] [ "NativeViewerOpen" ] ( option . asc _getPassword ( ) ) ; return } if ( window . isCloudCryptoDownloadAs ) return false ; if ( ! this . isNeedCrypt ( ) ) return false ; window . checkPasswordFromPlugin = true ; if ( window [ "Asc" ] . c _oAscAdvancedOptionsID . TXT === idOption ) { var _param = "<m_nCsvTxtEncoding>" + option . asc _getCodePage ( ) + "</m_nCsvTxtEncoding>" ; window [ "AscDesktopEditor" ] [ "SetAdvancedOptions" ] ( _param ) } else if ( window [ "Asc" ] . c _oAscAdvancedOptionsID . CSV ===
idOption ) { var delimiter = option . asc _getDelimiter ( ) ; var delimiterChar = option . asc _getDelimiterChar ( ) ; var _param = "" ; _param += "<m_nCsvTxtEncoding>" + option . asc _getCodePage ( ) + "</m_nCsvTxtEncoding>" ; if ( null != delimiter ) _param += "<m_nCsvDelimiter>" + delimiter + "</m_nCsvDelimiter>" ; if ( null != delimiterChar ) _param += "<m_nCsvDelimiterChar>" + delimiterChar + "</m_nCsvDelimiterChar>" ; window [ "AscDesktopEditor" ] [ "SetAdvancedOptions" ] ( _param ) } else if ( window [ "Asc" ] . c _oAscAdvancedOptionsID . DRM === idOption ) { var _param = "<m_sPassword>" +
AscCommon . CopyPasteCorrectString ( option . asc _getPassword ( ) ) + "</m_sPassword>" ; api . currentPassword = option . asc _getPassword ( ) ; window [ "AscDesktopEditor" ] [ "SetAdvancedOptions" ] ( _param ) } return true } } AscCommon . EncryptionWorker = new CEncryptionData ; function CMouseSmoothWheelCorrector ( t , scrollFunction ) { this . _deltaX = 0 ; this . _deltaY = 0 ; this . _isBreakX = false ; this . _isBreakY = false ; this . _timeoutCorrector = - 1 ; this . _api = t ; this . _scrollFunction = scrollFunction ; this . _normalDelta = 120 ; this . _isNormalDeltaActive = false ; this . setNormalDeltaActive =
function ( value ) { this . _isNormalDeltaActive = true ; this . _normalDelta = value } ; this . isBreakX = function ( ) { return this . _isBreakX } ; this . isBreakY = function ( ) { return this . _isBreakY } ; this . get _DeltaX = function ( wheelDeltaX ) { this . _isBreakX = false ; if ( ! AscCommon . AscBrowser . isMacOs ) return wheelDeltaX ; this . _deltaX += wheelDeltaX ; if ( Math . abs ( this . _deltaX ) >= this . _normalDelta ) return this . _isNormalDeltaActive ? this . _deltaX > 0 ? this . _normalDelta : - this . _normalDelta : this . _deltaX ; this . _isBreakX = true ; return 0 } ; this . get _DeltaY = function ( wheelDeltaY ) { this . _isBreakY =
false ; if ( ! AscCommon . AscBrowser . isMacOs ) return wheelDeltaY ; this . _deltaY += wheelDeltaY ; if ( Math . abs ( this . _deltaY ) >= this . _normalDelta ) return this . _isNormalDeltaActive ? this . _deltaY > 0 ? this . _normalDelta : - this . _normalDelta : this . _deltaY ; this . _isBreakY = true ; return 0 } ; this . checkBreak = function ( ) { if ( - 1 != this . _timeoutCorrector ) { clearTimeout ( this . _timeoutCorrector ) ; this . _timeoutCorrector = - 1 } if ( ( this . _isBreakX || this . _isBreakY ) && this . _scrollFunction ) { var obj = { t : this , x : this . _isBreakX ? this . _deltaX : 0 , y : this . _isBreakY ?
this . _deltaY : 0 } ; this . _timeoutCorrector = setTimeout ( function ( ) { var t = obj . t ; t . _scrollFunction . call ( t . _api , obj . x , obj . y ) ; t . _timeoutCorrector = - 1 ; t . _deltaX = 0 ; t . _deltaY = 0 } , 100 ) } if ( ! this . _isBreakX ) this . _deltaX = 0 ; if ( ! this . _isBreakY ) this . _deltaY = 0 ; this . _isBreakX = false ; this . _isBreakY = false } } AscCommon . CMouseSmoothWheelCorrector = CMouseSmoothWheelCorrector ; function CTranslateManager ( ) { this . mapTranslate = { } } CTranslateManager . prototype . init = function ( map ) { this . mapTranslate = map || { } } ; CTranslateManager . prototype . getValue =
function ( key ) { return this . mapTranslate . hasOwnProperty ( key ) ? this . mapTranslate [ key ] : key } ; if ( ! Array . prototype . fill ) Object . defineProperty ( Array . prototype , "fill" , { value : function ( value ) { if ( this == null ) throw new TypeError ( "this is null or not defined" ) ; var O = Object ( this ) ; var len = O . length >>> 0 ; var start = arguments [ 1 ] ; var relativeStart = start >> 0 ; var k = relativeStart < 0 ? Math . max ( len + relativeStart , 0 ) : Math . min ( relativeStart , len ) ; var end = arguments [ 2 ] ; var relativeEnd = end === undefined ? len : end >> 0 ; var final = relativeEnd <
0 ? Math . max ( len + relativeEnd , 0 ) : Math . min ( relativeEnd , len ) ; while ( k < final ) { O [ k ] = value ; k ++ } return O } } ) ; if ( typeof Int8Array !== "undefined" && ! Int8Array . prototype . fill ) Int8Array . prototype . fill = Array . prototype . fill ; if ( typeof Uint8Array !== "undefined" && ! Uint8Array . prototype . fill ) Uint8Array . prototype . fill = Array . prototype . fill ; if ( typeof Uint8ClampedArray !== "undefined" && ! Uint8ClampedArray . prototype . fill ) Uint8ClampedArray . prototype . fill = Array . prototype . fill ; if ( typeof Int16Array !== "undefined" && ! Int16Array . prototype . fill ) Int16Array . prototype . fill =
Array . prototype . fill ; if ( typeof Uint16Array !== "undefined" && ! Uint16Array . prototype . fill ) Uint16Array . prototype . fill = Array . prototype . fill ; if ( typeof Int32Array !== "undefined" && ! Int32Array . prototype . fill ) Int32Array . prototype . fill = Array . prototype . fill ; if ( typeof Uint32Array !== "undefined" && ! Uint32Array . prototype . fill ) Uint32Array . prototype . fill = Array . prototype . fill ; if ( typeof Float32Array !== "undefined" && ! Float32Array . prototype . fill ) Float32Array . prototype . fill = Array . prototype . fill ; if ( typeof Float64Array !== "undefined" &&
! Float64Array . prototype . fill ) Float64Array . prototype . fill = Array . prototype . fill ; function parseText ( text , options , bTrimSpaces ) { var delimiterChar ; if ( options . asc _getDelimiterChar ( ) ) delimiterChar = options . asc _getDelimiterChar ( ) ; else switch ( options . asc _getDelimiter ( ) ) { case AscCommon . c _oAscCsvDelimiter . None : delimiterChar = undefined ; break ; case AscCommon . c _oAscCsvDelimiter . Tab : delimiterChar = "\t" ; break ; case AscCommon . c _oAscCsvDelimiter . Semicolon : delimiterChar = ";" ; break ; case AscCommon . c _oAscCsvDelimiter . Colon : delimiterChar =
":" ; break ; case AscCommon . c _oAscCsvDelimiter . Comma : delimiterChar = "," ; break ; case AscCommon . c _oAscCsvDelimiter . Space : delimiterChar = " " ; break } var matrix = [ ] ; var rows = text . split ( /\r?\n/ ) ; for ( var i = 0 ; i < rows . length ; ++ i ) { var row = rows [ i ] ; if ( " " === delimiterChar && bTrimSpaces ) { var addSpace = false ; if ( row [ 0 ] === delimiterChar ) addSpace = true ; row = addSpace ? delimiterChar + row . trim ( ) : row . trim ( ) } matrix . push ( row . split ( delimiterChar ) ) } return matrix } function getTimeISO8601 ( dateStr ) { if ( dateStr ) if ( dateStr . endsWith ( "Z" ) ) return Date . parse ( dateStr ) ;
else return Date . parse ( dateStr + "Z" ) ; return NaN } window [ "AscCommon" ] = window [ "AscCommon" ] || { } ; window [ "AscCommon" ] . getSockJs = getSockJs ; window [ "AscCommon" ] . getJSZipUtils = getJSZipUtils ; window [ "AscCommon" ] . getJSZip = getJSZip ; window [ "AscCommon" ] . getBaseUrl = getBaseUrl ; window [ "AscCommon" ] . getEncodingParams = getEncodingParams ; window [ "AscCommon" ] . getEncodingByBOM = getEncodingByBOM ; window [ "AscCommon" ] . saveWithParts = saveWithParts ; window [ "AscCommon" ] . loadFileContent = loadFileContent ; window [ "AscCommon" ] . getImageFromChanges =
getImageFromChanges ; window [ "AscCommon" ] . openFileCommand = openFileCommand ; window [ "AscCommon" ] . sendCommand = sendCommand ; window [ "AscCommon" ] . sendSaveFile = sendSaveFile ; window [ "AscCommon" ] . mapAscServerErrorToAscError = mapAscServerErrorToAscError ; window [ "AscCommon" ] . joinUrls = joinUrls ; window [ "AscCommon" ] . getFullImageSrc2 = getFullImageSrc2 ; window [ "AscCommon" ] . fSortAscending = fSortAscending ; window [ "AscCommon" ] . fSortDescending = fSortDescending ; window [ "AscCommon" ] . isLeadingSurrogateChar = isLeadingSurrogateChar ; window [ "AscCommon" ] . decodeSurrogateChar =
decodeSurrogateChar ; window [ "AscCommon" ] . encodeSurrogateChar = encodeSurrogateChar ; window [ "AscCommon" ] . convertUnicodeToUTF16 = convertUnicodeToUTF16 ; window [ "AscCommon" ] . convertUTF16toUnicode = convertUTF16toUnicode ; window [ "AscCommon" ] . build _local _rx = build _local _rx ; window [ "AscCommon" ] . GetFileName = GetFileName ; window [ "AscCommon" ] . GetFileExtension = GetFileExtension ; window [ "AscCommon" ] . changeFileExtention = changeFileExtention ; window [ "AscCommon" ] . getExtentionByFormat = getExtentionByFormat ; window [ "AscCommon" ] . InitOnMessage =
InitOnMessage ; window [ "AscCommon" ] . ShowImageFileDialog = ShowImageFileDialog ; window [ "AscCommon" ] . InitDragAndDrop = InitDragAndDrop ; window [ "AscCommon" ] . UploadImageFiles = UploadImageFiles ; window [ "AscCommon" ] . UploadImageUrls = UploadImageUrls ; window [ "AscCommon" ] . CanDropFiles = CanDropFiles ; window [ "AscCommon" ] . getUrlType = getUrlType ; window [ "AscCommon" ] . prepareUrl = prepareUrl ; window [ "AscCommon" ] . getUserColorById = getUserColorById ; window [ "AscCommon" ] . isNullOrEmptyString = isNullOrEmptyString ; window [ "AscCommon" ] . unleakString =
unleakString ; window [ "AscCommon" ] . readValAttr = readValAttr ; window [ "AscCommon" ] . getNumFromXml = getNumFromXml ; window [ "AscCommon" ] . getColorFromXml = getColorFromXml ; window [ "AscCommon" ] . getBoolFromXml = getBoolFromXml ; window [ "AscCommon" ] . initStreamFromResponse = initStreamFromResponse ; window [ "AscCommon" ] . checkStreamSignature = checkStreamSignature ; window [ "AscCommon" ] . DocumentUrls = DocumentUrls ; window [ "AscCommon" ] . OpenFileResult = OpenFileResult ; window [ "AscCommon" ] . CLock = CLock ; window [ "AscCommon" ] . CContentChanges = CContentChanges ;
window [ "AscCommon" ] . CContentChangesElement = CContentChangesElement ; window [ "AscCommon" ] . CorrectMMToTwips = CorrectMMToTwips ; window [ "AscCommon" ] . TwipsToMM = TwipsToMM ; window [ "AscCommon" ] . MMToTwips = MMToTwips ; window [ "AscCommon" ] . RomanToInt = RomanToInt ; window [ "AscCommon" ] . LatinNumberingToInt = LatinNumberingToInt ; window [ "AscCommon" ] . IntToNumberFormat = IntToNumberFormat ; window [ "AscCommon" ] . loadSdk = loadSdk ; window [ "AscCommon" ] . loadScript = loadScript ; window [ "AscCommon" ] . getAltGr = getAltGr ; window [ "AscCommon" ] . getColorSchemeByName =
getColorSchemeByName ; window [ "AscCommon" ] . getAscColorScheme = getAscColorScheme ; window [ "AscCommon" ] . isEastAsianScript = isEastAsianScript ; window [ "AscCommon" ] . JSZipWrapper = JSZipWrapper ; window [ "AscCommon" ] . g _oDocumentUrls = g _oDocumentUrls ; window [ "AscCommon" ] . FormulaTablePartInfo = FormulaTablePartInfo ; window [ "AscCommon" ] . cBoolLocal = cBoolLocal ; window [ "AscCommon" ] . cErrorOrigin = cErrorOrigin ; window [ "AscCommon" ] . cErrorLocal = cErrorLocal ; window [ "AscCommon" ] . FormulaSeparators = FormulaSeparators ; window [ "AscCommon" ] . rx _space _g =
rx _space _g ; window [ "AscCommon" ] . rx _space = rx _space ; window [ "AscCommon" ] . rx _defName = rx _defName ; window [ "AscCommon" ] . kCurFormatPainterWord = kCurFormatPainterWord ; window [ "AscCommon" ] . parserHelp = parserHelp ; window [ "AscCommon" ] . g _oIdCounter = g _oIdCounter ; window [ "AscCommon" ] . g _oHtmlCursor = g _oHtmlCursor ; window [ "AscCommon" ] . CSignatureDrawer = window [ "AscCommon" ] [ "CSignatureDrawer" ] = CSignatureDrawer ; var prot = CSignatureDrawer . prototype ; prot [ "getImages" ] = prot . getImages ; prot [ "setText" ] = prot . setText ; prot [ "selectImage" ] =
prot . selectImage ; prot [ "isValid" ] = prot . isValid ; prot [ "destroy" ] = prot . destroy ; window [ "AscCommon" ] . translateManager = new CTranslateManager ; window [ "AscCommon" ] . parseText = parseText ; window [ "AscCommon" ] . getTimeISO8601 = getTimeISO8601 } ) ( window ) ;
else { var urlArgs= window . parent && window . parent . APP && window . parent . APP . urlArgs || "" ; loadScript( "./../../../../sdkjs/" + sdkName + "/sdk-all.js ? "+ urlArgs , onSuccess , onError ) } } function getAltGr ( e ) { var ctrlKey = e . metaKey || e . ctrlKey ; var altKey = e . altKey ; return altKey && ( AscBrowser . isMacOs ? ! ctrlKey : ctrlKey ) } function getColorSchemeByName ( sName ) { for ( var i = 0 ; i < AscCommon . g _oUserColorScheme . length ; ++ i ) { var tmp = AscCommon . g _oUserColorScheme [ i ] ; if ( tmp . name === sName ) { var scheme = new AscFormat . ClrScheme , _c ; scheme . name = tmp . name ;
_c = tmp . get _dk1 ( ) ; scheme . colors [ 8 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _lt1 ( ) ; scheme . colors [ 12 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _dk2 ( ) ; scheme . colors [ 9 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _lt2 ( ) ; scheme . colors [ 13 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _accent1 ( ) ; scheme . colors [ 0 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _accent2 ( ) ; scheme . colors [ 1 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _accent3 ( ) ; scheme . colors [ 2 ] =
AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _accent4 ( ) ; scheme . colors [ 3 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _accent5 ( ) ; scheme . colors [ 4 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _accent6 ( ) ; scheme . colors [ 5 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _hlink ( ) ; scheme . colors [ 11 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; _c = tmp . get _folHlink ( ) ; scheme . colors [ 10 ] = AscFormat . CreateUniColorRGB ( _c . r , _c . g , _c . b ) ; return scheme } } return null } function getAscColorScheme ( _scheme ,
theme ) { var elem , _c ; var _rgba = { R : 0 , G : 0 , B : 0 , A : 255 } ; elem = new AscCommon . CAscColorScheme ; elem . name = _scheme . name ; _scheme . colors [ 8 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 8 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 12 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 12 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 9 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 9 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R ,
_c . G , _c . B ) ) ; _scheme . colors [ 13 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 13 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 0 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 0 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 1 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 1 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 2 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 2 ] . RGBA ;
elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 3 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 3 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 4 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 4 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 5 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 5 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 11 ] . Calculate ( theme ,
null , null , null , _rgba ) ; _c = _scheme . colors [ 11 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; _scheme . colors [ 10 ] . Calculate ( theme , null , null , null , _rgba ) ; _c = _scheme . colors [ 10 ] . RGBA ; elem . colors . push ( new AscCommon . CColor ( _c . R , _c . G , _c . B ) ) ; return elem } function isEastAsianScript ( value ) { return 12544 <= value && value <= 12591 || 12704 <= value && value <= 12735 || 19968 <= value && value <= 40938 || 13312 <= value && value <= 19893 || 131072 <= value && value <= 173782 || 173824 <= value && value <= 177972 || 177984 <= value && value <= 178205 || 178208 <=
value && value <= 183969 || 183984 <= value && value <= 191456 || 63744 <= value && value <= 64255 || 194560 <= value && value <= 195103 || 12032 <= value && value <= 12255 || 11904 <= value && value <= 12031 || 12736 <= value && value <= 12783 || 12272 <= value && value <= 12287 || 4352 <= value && value <= 4607 || 43360 <= value && value <= 43391 || 55216 <= value && value <= 55295 || 12592 <= value && value <= 12687 || 65280 <= value && value <= 65519 || 44032 <= value && value <= 55215 || 12352 <= value && value <= 12447 || 110848 <= value && value <= 110895 || 110592 <= value && value <= 110847 || 12688 <= value && value <= 12703 ||
12448 <= value && value <= 12543 || 12784 <= value && value <= 12799 || 42192 <= value && value <= 42239 || 93952 <= value && value <= 94111 || 110960 <= value && value <= 111359 || 94208 <= value && value <= 100332 || 100352 <= value && value <= 101119 || 40960 <= value && value <= 42127 || 42128 <= value && value <= 42191 } var g _oIdCounter = new CIdCounter ; window [ "SetDoctRendererParams" ] = function ( _params ) { if ( _params [ "retina" ] === true ) AscBrowser . isRetina = true } ; window . Asc . g _signature _drawer = null ; function CSignatureDrawer ( id , api , w , h ) { window . Asc . g _signature _drawer = this ; this . Api =
api ; this . CanvasParent = document . getElementById ( id ) ; this . Canvas = document . createElement ( "canvas" ) ; this . Canvas . style . position = "absolute" ; this . Canvas . style . left = "0px" ; this . Canvas . style . top = "0px" ; var _width = parseInt ( this . CanvasParent . offsetWidth ) ; var _height = parseInt ( this . CanvasParent . offsetHeight ) ; if ( 0 == _width ) _width = 300 ; if ( 0 == _height ) _height = 80 ; this . Canvas . width = _width ; this . Canvas . height = _height ; this . CanvasParent . appendChild ( this . Canvas ) ; this . Image = "" ; this . ImageHtml = null ; this . Text = "" ; this . Font = "Arial" ;
this . Size = 10 ; this . Italic = true ; this . Bold = false ; this . Width = w ; this . Height = h ; this . CanvasReturn = null ; this . IsAsync = false } CSignatureDrawer . prototype . getCanvas = function ( ) { return this . CanvasReturn == null ? this . Canvas : this . CanvasReturn } ; CSignatureDrawer . prototype . getImages = function ( ) { if ( ! this . isValid ( ) ) return [ "" , "" ] ; this . CanvasReturn = document . createElement ( "canvas" ) ; this . CanvasReturn . width = this . Width * AscCommon . g _dKoef _mm _to _pix ; this . CanvasReturn . height = this . Height * AscCommon . g _dKoef _mm _to _pix ; if ( this . Text != "" ) this . drawText ( ) ;
else this . drawImage ( ) ; var _ret = [ ] ; _ret . push ( this . CanvasReturn . toDataURL ( "image/png" ) ) ; var _ctx = this . CanvasReturn . getContext ( "2d" ) ; _ctx . strokeStyle = "#FF0000" ; _ctx . lineWidth = 2 ; _ctx . moveTo ( 0 , 0 ) ; _ctx . lineTo ( this . CanvasReturn . width , this . CanvasReturn . height ) ; _ctx . moveTo ( 0 , this . CanvasReturn . height ) ; _ctx . lineTo ( this . CanvasReturn . width , 0 ) ; _ctx . stroke ( ) ; _ret . push ( this . CanvasReturn . toDataURL ( "image/png" ) ) ; this . CanvasReturn = null ; return _ret } ; CSignatureDrawer . prototype . setText = function ( text , font , size , isItalic ,
isBold ) { if ( this . IsAsync ) { this . Text = text ; return } this . Image = "" ; this . ImageHtml = null ; this . Text = text ; this . Font = font ; this . Size = size ; this . Italic = isItalic ; this . Bold = isBold ; this . IsAsync = true ; AscFonts . FontPickerByCharacter . checkText ( this . Text , this , function ( ) { this . IsAsync = false ; var loader = AscCommon . g _font _loader ; var fontinfo = AscFonts . g _fontApplication . GetFontInfo ( font ) ; var isasync = loader . LoadFont ( fontinfo , function ( ) { window . Asc . g _signature _drawer . Api . sync _EndAction ( Asc . c _oAscAsyncActionType . Information , Asc . c _oAscAsyncAction . LoadFont ) ;
window . Asc . g _signature _drawer . drawText ( ) } ) ; if ( false === isasync ) this . drawText ( ) } ) } ; CSignatureDrawer . prototype . drawText = function ( ) { var _oldTurn = this . Api . isViewMode ; var _oldMarks = this . Api . ShowParaMarks ; this . Api . isViewMode = true ; this . Api . ShowParaMarks = false ; AscFormat . ExecuteNoHistory ( AscCommon . DrawTextByCenter , this , [ ] ) ; this . Api . isViewMode = _oldTurn ; this . Api . ShowParaMarks = _oldMarks } ; CSignatureDrawer . prototype . drawImage = function ( ) { var _canvas = this . getCanvas ( ) ; var w = _canvas . width ; var h = _canvas . height ; var _ctx =
_canvas . getContext ( "2d" ) ; _ctx . clearRect ( 0 , 0 , w , h ) ; var im _w = this . ImageHtml . width ; var im _h = this . ImageHtml . height ; var _x = 0 ; var _y = 0 ; var _w = 0 ; var _h = 0 ; var koef1 = w / h ; var koef2 = im _w / im _h ; if ( koef1 > koef2 ) { _h = h ; _w = koef2 * _h >> 0 ; _y = 0 ; _x = w - _w >> 1 } else { _w = w ; _h = _w / koef2 >> 0 ; _x = 0 ; _y = h - _h >> 1 } _ctx . drawImage ( this . ImageHtml , _x , _y , _w , _h ) } ; CSignatureDrawer . prototype . selectImage = CSignatureDrawer . prototype [ "selectImage" ] = function ( ) { this . Text = "" ; window [ "AscDesktopEditor" ] [ "OpenFilenameDialog" ] ( "images" , false , function ( _file ) { var file =
_file ; if ( Array . isArray ( file ) ) file = file [ 0 ] ; if ( file == "" ) return ; var _drawer = window . Asc . g _signature _drawer ; _drawer . Image = window [ "AscDesktopEditor" ] [ "GetImageBase64" ] ( file ) ; _drawer . ImageHtml = new Image ; _drawer . ImageHtml . onload = function ( ) { window . Asc . g _signature _drawer . drawImage ( ) } ; _drawer . ImageHtml . src = _drawer . Image ; _drawer = null } ) } ; CSignatureDrawer . prototype . isValid = function ( ) { return this . Image != "" || this . Text != "" } ; CSignatureDrawer . prototype . destroy = function ( ) { window . Asc . g _signature _drawer . CanvasParent . removeChild ( this . Canvas ) ;
delete window . Asc . g _signature _drawer } ; function CSignatureImage ( ) { this . ImageValidBase64 = "" ; this . ImageInvalidBase64 = "" ; this . ImageValid = null ; this . ImageInvalid = null ; this . Valid = false ; this . Loading = 0 ; this . Remove = function ( ) { this . ImageValidBase64 = "" ; this . ImageInvalidBase64 = "" ; this . ImageValid = null ; this . ImageInvalid = null ; this . Valid = false ; this . Loading = 0 } ; this . Register = function ( _api , _guid ) { if ( _api . ImageLoader . map _image _index [ _guid ] ) return ; var _obj = { Image : this . Valid ? this . ImageValid : this . ImageInvalid , Status : AscFonts . ImageLoadStatus . Complete ,
src : _guid } ; _api . ImageLoader . map _image _index [ _guid ] = _obj } ; this . Unregister = function ( _api , _guid ) { if ( _api . ImageLoader . map _image _index [ _guid ] ) delete _api . ImageLoader . map _image _index [ _guid ] } } AscCommon . EncryptionMessageType = { Encrypt : 0 , Decrypt : 1 } ; function CEncryptionData ( ) { this . _init = false ; this . arrData = [ ] ; this . arrImages = [ ] ; this . handleChangesCallback = null ; this . isChangesHandled = false ; this . cryptoMode = 0 ; this . isChartEditor = false ; this . isExistDecryptedChanges = false ; this . cryptoPrefix = window [ "AscDesktopEditor" ] &&
window [ "AscDesktopEditor" ] [ "GetEncryptedHeader" ] ? window [ "AscDesktopEditor" ] [ "GetEncryptedHeader" ] ( ) : "ENCRYPTED;" ; this . cryptoPrefixLen = this . cryptoPrefix . length ; this . editorId = null ; this . nextChangesTimeoutId = - 1 ; this . isPasswordCryptoPresent = false ; this . init = function ( ) { this . _init = true } ; this . isInit = function ( ) { return this . _init } ; this . isNeedCrypt = function ( ) { if ( window . g _asc _plugins ) if ( ! window . g _asc _plugins . isRunnedEncryption ( ) ) return false ; if ( ! window [ "AscDesktopEditor" ] ) return false ; if ( this . isChartEditor ) return false ;
if ( 2 == this . cryptoMode ) return true ; if ( 0 === window [ "AscDesktopEditor" ] [ "CryptoMode" ] ) return false ; return true } ; this . isCryptoImages = function ( ) { return this . isNeedCrypt ( ) && this . isPasswordCryptoPresent } ; this . addCryproImagesFromDialog = function ( callback ) { var _this = this ; window [ "AscDesktopEditor" ] [ "OpenFilenameDialog" ] ( "images" , true , function ( files ) { if ( ! Array . isArray ( files ) ) files = [ files ] ; if ( 0 == files . length ) return ; var _files = [ ] ; var _options = { isImageCrypt : true , callback : callback , ext : [ ] } ; for ( var i = 0 ; i < files . length ; i ++ ) { _files . push ( window [ "AscDesktopEditor" ] [ "GetImageBase64" ] ( files [ i ] ,
true ) ) ; _options . ext . push ( AscCommon . GetFileExtension ( files [ i ] ) ) } _this . sendChanges ( this , _files , AscCommon . EncryptionMessageType . Encrypt , _options ) } ) } ; this . addCryproImagesFromUrls = function ( urls , callback ) { var _editor = window [ "Asc" ] [ "editor" ] ? window [ "Asc" ] [ "editor" ] : window . editor ; _editor . sync _StartAction ( Asc . c _oAscAsyncActionType . BlockInteraction , Asc . c _oAscAsyncAction . LoadImage ) ; var _this = this ; window [ "AscDesktopEditor" ] [ "DownloadFiles" ] ( urls , [ ] , function ( files ) { _editor . sync _EndAction ( Asc . c _oAscAsyncActionType . BlockInteraction ,
Asc . c _oAscAsyncAction . LoadImage ) ; _editor . sync _StartAction ( Asc . c _oAscAsyncActionType . BlockInteraction , Asc . c _oAscAsyncAction . UploadImage ) ; var _files = [ ] ; var _options = { isImageCrypt : true , isUrls : true , callback : callback , ext : [ ] , api : _editor } ; for ( var elem in files ) { _files . push ( window [ "AscDesktopEditor" ] [ "GetImageBase64" ] ( files [ elem ] , true ) ) ; _options . ext . push ( window [ "AscDesktopEditor" ] [ "GetImageFormat" ] ( files [ elem ] ) ) ; window [ "AscDesktopEditor" ] [ "RemoveFile" ] ( files [ elem ] ) } _this . sendChanges ( this , _files , AscCommon . EncryptionMessageType . Encrypt ,
_options ) } ) } ; this . onDecodeError = function ( ) { var _editor = window [ "Asc" ] [ "editor" ] ? window [ "Asc" ] [ "editor" ] : window . editor ; _editor . sendEvent ( "asc_onError" , Asc . c _oAscError . ID . DataEncrypted , Asc . c _oAscError . Level . Critical ) } ; this . checkEditorId = function ( ) { if ( null == this . editorId ) { var _editor = window [ "Asc" ] [ "editor" ] ? window [ "Asc" ] [ "editor" ] : window . editor ; this . editorId = _editor . editorId } } ; this . decryptImage = function ( src , img , data ) { this . sendChanges ( this , [ data ] , AscCommon . EncryptionMessageType . Decrypt , { isImageDecrypt : true ,
src : src , img : img } ) } ; this . nextChanges = function ( ) { this . nextChangesTimeoutId = setTimeout ( function ( ) { AscCommon . EncryptionWorker . sendChanges ( undefined , undefined ) ; this . nextChangesTimeoutId = - 1 } , 10 ) } ; this . sendChanges = function ( sender , data , type , options ) { if ( ! this . isNeedCrypt ( ) ) { if ( AscCommon . EncryptionMessageType . Encrypt == type ) sender . _send ( data , true ) ; else if ( AscCommon . EncryptionMessageType . Decrypt == type ) { if ( this . isExistEncryptedChanges ( data [ "changes" ] ) ) { this . onDecodeError ( ) ; return } sender . _onSaveChanges ( data , true ) } return } if ( undefined !==
type ) this . arrData . push ( { sender : sender , type : type , data : data , options : options } ) ; if ( this . arrData . length == 0 ) return ; if ( undefined !== type && ( 1 != this . arrData . length || ! this . isChangesHandled ) ) return ; if ( undefined !== type && - 1 != this . nextChangesTimeoutId ) { clearTimeout ( this . nextChangesTimeoutId ) ; this . nextChangesTimeoutId = - 1 } if ( AscCommon . EncryptionMessageType . Encrypt == this . arrData [ 0 ] . type ) if ( this . arrData [ 0 ] . options && this . arrData [ 0 ] . options . isImageCrypt ) window . g _asc _plugins . sendToEncryption ( { "type" : "encryptData" , "data" : this . arrData [ 0 ] . data } ) ;
else window . g _asc _plugins . sendToEncryption ( { "type" : "encryptData" , "data" : JSON . parse ( this . arrData [ 0 ] . data [ "changes" ] ) } ) ; else if ( AscCommon . EncryptionMessageType . Decrypt == this . arrData [ 0 ] . type ) if ( this . arrData [ 0 ] . options && this . arrData [ 0 ] . options . isImageDecrypt ) window . g _asc _plugins . sendToEncryption ( { "type" : "decryptData" , "data" : this . arrData [ 0 ] . data } ) ; else window . g _asc _plugins . sendToEncryption ( { "type" : "decryptData" , "data" : this . arrData [ 0 ] . data [ "changes" ] } ) } ; this . receiveChanges = function ( obj ) { var data = obj [ "data" ] ;
var check = obj [ "check" ] ; if ( ! check ) { this . onDecodeError ( ) ; return } if ( this . handleChangesCallback ) { this . isExistDecryptedChanges = true ; this . checkEditorId ( ) ; if ( this . editorId == AscCommon . c _oEditorId . Spreadsheet ) for ( var i = data . length - 1 ; i >= 0 ; i -- ) this . handleChangesCallback . changesBase [ i ] = data [ i ] ; else for ( var i = data . length - 1 ; i >= 0 ; i -- ) this . handleChangesCallback . changesBase [ i ] . m _pData = data [ i ] ; this . isChangesHandled = true ; this . handleChangesCallback . callback . call ( this . handleChangesCallback . sender ) ; this . handleChangesCallback =
null ; this . nextChanges ( ) ; return } var obj = this . arrData [ 0 ] ; this . arrData . splice ( 0 , 1 ) ; if ( AscCommon . EncryptionMessageType . Encrypt == obj . type ) if ( obj . options && obj . options . isImageCrypt ) { for ( var i = 0 ; i < data . length ; i ++ ) if ( this . cryptoPrefix == data [ i ] . substr ( 0 , this . cryptoPrefixLen ) ) data [ i ] = this . cryptoPrefix + obj . options . ext [ i ] + ";" + data [ i ] . substr ( this . cryptoPrefixLen ) ; if ( ! obj . options . isUrls ) obj . options . callback ( Asc . c _oAscError . ID . No , data ) ; else AscCommon . UploadImageUrls ( data , obj . options . api . documentId , obj . options . api . documentUserId ,
obj . options . api . CoAuthoringApi . get _jwt ( ) , function ( urls ) { obj . options . api . sync _EndAction ( Asc . c _oAscAsyncActionType . BlockInteraction , Asc . c _oAscAsyncAction . UploadImage ) ; obj . options . callback ( urls ) } ) } else { obj . data [ "changes" ] = JSON . stringify ( data ) ; obj . sender . _send ( obj . data , true ) } else if ( AscCommon . EncryptionMessageType . Decrypt == obj . type ) if ( obj . options && obj . options . isImageDecrypt ) { window [ "AscDesktopEditor" ] [ "ResaveFile" ] ( obj . options . src , data [ 0 ] ) ; obj . options . img [ "onload_crypto" ] ( obj . options . src ) } else { this . isExistDecryptedChanges =
true ; obj . data [ "changes" ] = data ; obj . sender . _onSaveChanges ( obj . data , true ) } this . nextChanges ( ) } ; this . isExistEncryptedChanges = function ( _array ) { if ( 0 == _array . length ) return false ; this . checkEditorId ( ) ; var isChangesMode = _array [ 0 ] [ "change" ] ? true : false ; var _prefix = "" ; var _checkPrefixLen = this . cryptoPrefixLen + 1 ; if ( isChangesMode ) { for ( var i = _array . length - 1 ; i >= 0 ; i -- ) if ( _array [ i ] [ "change" ] . length > _checkPrefixLen ) { _prefix = _array [ i ] [ "change" ] . substr ( 0 , _checkPrefixLen ) ; if ( - 1 != _prefix . indexOf ( this . cryptoPrefix ) ) { isCrypted =
true ; break } } return isCrypted } var isCrypted = false ; if ( this . editorId == AscCommon . c _oEditorId . Spreadsheet ) for ( var i = _array . length - 1 ; i >= 0 ; i -- ) { if ( _array [ i ] . length > _checkPrefixLen ) { _prefix = _array [ i ] . substr ( 0 , _checkPrefixLen ) ; if ( - 1 != _prefix . indexOf ( this . cryptoPrefix ) ) { isCrypted = true ; break } } } else for ( var i = _array . length - 1 ; i >= 0 ; i -- ) if ( _array [ i ] . m _pData . length > _checkPrefixLen ) { _prefix = _array [ i ] . m _pData . substr ( 0 , _checkPrefixLen ) ; if ( - 1 != _prefix . indexOf ( this . cryptoPrefix ) ) { isCrypted = true ; break } } return isCrypted } ;
this . handleChanges = function ( _array , _sender , _callback ) { if ( 0 == _array . length || ! this . isNeedCrypt ( ) ) { if ( this . isExistEncryptedChanges ( _array ) ) { this . onDecodeError ( ) ; return } this . isChangesHandled = true ; _callback . call ( _sender ) ; return } this . handleChangesCallback = { changesBase : _array , changes : [ ] , sender : _sender , callback : _callback } ; this . checkEditorId ( ) ; if ( this . editorId == AscCommon . c _oEditorId . Spreadsheet ) for ( var i = _array . length - 1 ; i >= 0 ; i -- ) this . handleChangesCallback . changes [ i ] = _array [ i ] ; else for ( var i = _array . length -
1 ; i >= 0 ; i -- ) this . handleChangesCallback . changes [ i ] = _array [ i ] . m _pData ; window . g _asc _plugins . sendToEncryption ( { "type" : "decryptData" , "data" : this . handleChangesCallback . changes } ) } ; this . asc _setAdvancedOptions = function ( api , idOption , option ) { if ( window . isNativeOpenPassword ) { window [ "AscDesktopEditor" ] [ "NativeViewerOpen" ] ( option . asc _getPassword ( ) ) ; return } if ( window . isCloudCryptoDownloadAs ) return false ; if ( ! this . isNeedCrypt ( ) ) return false ; window . checkPasswordFromPlugin = true ; if ( window [ "Asc" ] . c _oAscAdvancedOptionsID . TXT ===
idOption ) { var _param = "<m_nCsvTxtEncoding>" + option . asc _getCodePage ( ) + "</m_nCsvTxtEncoding>" ; window [ "AscDesktopEditor" ] [ "SetAdvancedOptions" ] ( _param ) } else if ( window [ "Asc" ] . c _oAscAdvancedOptionsID . CSV === idOption ) { var delimiter = option . asc _getDelimiter ( ) ; var delimiterChar = option . asc _getDelimiterChar ( ) ; var _param = "" ; _param += "<m_nCsvTxtEncoding>" + option . asc _getCodePage ( ) + "</m_nCsvTxtEncoding>" ; if ( null != delimiter ) _param += "<m_nCsvDelimiter>" + delimiter + "</m_nCsvDelimiter>" ; if ( null != delimiterChar ) _param += "<m_nCsvDelimiterChar>" +
delimiterChar + "</m_nCsvDelimiterChar>" ; window [ "AscDesktopEditor" ] [ "SetAdvancedOptions" ] ( _param ) } else if ( window [ "Asc" ] . c _oAscAdvancedOptionsID . DRM === idOption ) { var _param = "<m_sPassword>" + AscCommon . CopyPasteCorrectString ( option . asc _getPassword ( ) ) + "</m_sPassword>" ; api . currentPassword = option . asc _getPassword ( ) ; window [ "AscDesktopEditor" ] [ "SetAdvancedOptions" ] ( _param ) } return true } } AscCommon . EncryptionWorker = new CEncryptionData ; function CMouseSmoothWheelCorrector ( t , scrollFunction ) { this . _deltaX = 0 ; this . _deltaY =
0 ; this . _isBreakX = false ; this . _isBreakY = false ; this . _timeoutCorrector = - 1 ; this . _api = t ; this . _scrollFunction = scrollFunction ; this . _normalDelta = 120 ; this . _isNormalDeltaActive = false ; this . setNormalDeltaActive = function ( value ) { this . _isNormalDeltaActive = true ; this . _normalDelta = value } ; this . isBreakX = function ( ) { return this . _isBreakX } ; this . isBreakY = function ( ) { return this . _isBreakY } ; this . get _DeltaX = function ( wheelDeltaX ) { this . _isBreakX = false ; if ( ! AscCommon . AscBrowser . isMacOs ) return wheelDeltaX ; this . _deltaX += wheelDeltaX ;
if ( Math . abs ( this . _deltaX ) >= this . _normalDelta ) return this . _isNormalDeltaActive ? this . _deltaX > 0 ? this . _normalDelta : - this . _normalDelta : this . _deltaX ; this . _isBreakX = true ; return 0 } ; this . get _DeltaY = function ( wheelDeltaY ) { this . _isBreakY = false ; if ( ! AscCommon . AscBrowser . isMacOs ) return wheelDeltaY ; this . _deltaY += wheelDeltaY ; if ( Math . abs ( this . _deltaY ) >= this . _normalDelta ) return this . _isNormalDeltaActive ? this . _deltaY > 0 ? this . _normalDelta : - this . _normalDelta : this . _deltaY ; this . _isBreakY = true ; return 0 } ; this . checkBreak = function ( ) { if ( - 1 !=
this . _timeoutCorrector ) { clearTimeout ( this . _timeoutCorrector ) ; this . _timeoutCorrector = - 1 } if ( ( this . _isBreakX || this . _isBreakY ) && this . _scrollFunction ) { var obj = { t : this , x : this . _isBreakX ? this . _deltaX : 0 , y : this . _isBreakY ? this . _deltaY : 0 } ; this . _timeoutCorrector = setTimeout ( function ( ) { var t = obj . t ; t . _scrollFunction . call ( t . _api , obj . x , obj . y ) ; t . _timeoutCorrector = - 1 ; t . _deltaX = 0 ; t . _deltaY = 0 } , 100 ) } if ( ! this . _isBreakX ) this . _deltaX = 0 ; if ( ! this . _isBreakY ) this . _deltaY = 0 ; this . _isBreakX = false ; this . _isBreakY = false } } AscCommon . CMouseSmoothWheelCorrector =
CMouseSmoothWheelCorrector ; function CTranslateManager ( ) { this . mapTranslate = { } } CTranslateManager . prototype . init = function ( map ) { this . mapTranslate = map || { } } ; CTranslateManager . prototype . getValue = function ( key ) { return this . mapTranslate . hasOwnProperty ( key ) ? this . mapTranslate [ key ] : key } ; if ( ! Array . prototype . fill ) Object . defineProperty ( Array . prototype , "fill" , { value : function ( value ) { if ( this == null ) throw new TypeError ( "this is null or not defined" ) ; var O = Object ( this ) ; var len = O . length >>> 0 ; var start = arguments [ 1 ] ; var relativeStart =
start >> 0 ; var k = relativeStart < 0 ? Math . max ( len + relativeStart , 0 ) : Math . min ( relativeStart , len ) ; var end = arguments [ 2 ] ; var relativeEnd = end === undefined ? len : end >> 0 ; var final = relativeEnd < 0 ? Math . max ( len + relativeEnd , 0 ) : Math . min ( relativeEnd , len ) ; while ( k < final ) { O [ k ] = value ; k ++ } return O } } ) ; if ( typeof Int8Array !== "undefined" && ! Int8Array . prototype . fill ) Int8Array . prototype . fill = Array . prototype . fill ; if ( typeof Uint8Array !== "undefined" && ! Uint8Array . prototype . fill ) Uint8Array . prototype . fill = Array . prototype . fill ; if ( typeof Uint8ClampedArray !==
"undefined" && ! Uint8ClampedArray . prototype . fill ) Uint8ClampedArray . prototype . fill = Array . prototype . fill ; if ( typeof Int16Array !== "undefined" && ! Int16Array . prototype . fill ) Int16Array . prototype . fill = Array . prototype . fill ; if ( typeof Uint16Array !== "undefined" && ! Uint16Array . prototype . fill ) Uint16Array . prototype . fill = Array . prototype . fill ; if ( typeof Int32Array !== "undefined" && ! Int32Array . prototype . fill ) Int32Array . prototype . fill = Array . prototype . fill ; if ( typeof Uint32Array !== "undefined" && ! Uint32Array . prototype . fill ) Uint32Array . prototype . fill =
Array . prototype . fill ; if ( typeof Float32Array !== "undefined" && ! Float32Array . prototype . fill ) Float32Array . prototype . fill = Array . prototype . fill ; if ( typeof Float64Array !== "undefined" && ! Float64Array . prototype . fill ) Float64Array . prototype . fill = Array . prototype . fill ; function parseText ( text , options , bTrimSpaces ) { var delimiterChar ; if ( options . asc _getDelimiterChar ( ) ) delimiterChar = options . asc _getDelimiterChar ( ) ; else switch ( options . asc _getDelimiter ( ) ) { case AscCommon . c _oAscCsvDelimiter . None : delimiterChar = undefined ; break ;
case AscCommon . c _oAscCsvDelimiter . Tab : delimiterChar = "\t" ; break ; case AscCommon . c _oAscCsvDelimiter . Semicolon : delimiterChar = ";" ; break ; case AscCommon . c _oAscCsvDelimiter . Colon : delimiterChar = ":" ; break ; case AscCommon . c _oAscCsvDelimiter . Comma : delimiterChar = "," ; break ; case AscCommon . c _oAscCsvDelimiter . Space : delimiterChar = " " ; break } var matrix = [ ] ; var rows = text . split ( /\r?\n/ ) ; for ( var i = 0 ; i < rows . length ; ++ i ) { var row = rows [ i ] ; if ( " " === delimiterChar && bTrimSpaces ) { var addSpace = false ; if ( row [ 0 ] === delimiterChar ) addSpace =
true ; row = addSpace ? delimiterChar + row . trim ( ) : row . trim ( ) } matrix . push ( row . split ( delimiterChar ) ) } return matrix } function getTimeISO8601 ( dateStr ) { if ( dateStr ) if ( dateStr . endsWith ( "Z" ) ) return Date . parse ( dateStr ) ; else return Date . parse ( dateStr + "Z" ) ; return NaN } window [ "AscCommon" ] = window [ "AscCommon" ] || { } ; window [ "AscCommon" ] . getSockJs = getSockJs ; window [ "AscCommon" ] . getJSZipUtils = getJSZipUtils ; window [ "AscCommon" ] . getJSZip = getJSZip ; window [ "AscCommon" ] . getBaseUrl = getBaseUrl ; window [ "AscCommon" ] . getEncodingParams = getEncodingParams ;
window [ "AscCommon" ] . getEncodingByBOM = getEncodingByBOM ; window [ "AscCommon" ] . saveWithParts = saveWithParts ; window [ "AscCommon" ] . loadFileContent = loadFileContent ; window [ "AscCommon" ] . getImageFromChanges = getImageFromChanges ; window [ "AscCommon" ] . openFileCommand = openFileCommand ; window [ "AscCommon" ] . sendCommand = sendCommand ; window [ "AscCommon" ] . sendSaveFile = sendSaveFile ; window [ "AscCommon" ] . mapAscServerErrorToAscError = mapAscServerErrorToAscError ; window [ "AscCommon" ] . joinUrls = joinUrls ; window [ "AscCommon" ] . getFullImageSrc2 =
getFullImageSrc2 ; window [ "AscCommon" ] . fSortAscending = fSortAscending ; window [ "AscCommon" ] . fSortDescending = fSortDescending ; window [ "AscCommon" ] . isLeadingSurrogateChar = isLeadingSurrogateChar ; window [ "AscCommon" ] . decodeSurrogateChar = decodeSurrogateChar ; window [ "AscCommon" ] . encodeSurrogateChar = encodeSurrogateChar ; window [ "AscCommon" ] . convertUnicodeToUTF16 = convertUnicodeToUTF16 ; window [ "AscCommon" ] . convertUTF16toUnicode = convertUTF16toUnicode ; window [ "AscCommon" ] . build _local _rx = build _local _rx ; window [ "AscCommon" ] . GetFileName =
GetFileName ; window [ "AscCommon" ] . GetFileExtension = GetFileExtension ; window [ "AscCommon" ] . changeFileExtention = changeFileExtention ; window [ "AscCommon" ] . getExtentionByFormat = getExtentionByFormat ; window [ "AscCommon" ] . InitOnMessage = InitOnMessage ; window [ "AscCommon" ] . ShowImageFileDialog = ShowImageFileDialog ; window [ "AscCommon" ] . InitDragAndDrop = InitDragAndDrop ; window [ "AscCommon" ] . UploadImageFiles = UploadImageFiles ; window [ "AscCommon" ] . UploadImageUrls = UploadImageUrls ; window [ "AscCommon" ] . CanDropFiles = CanDropFiles ; window [ "AscCommon" ] . getUrlType =
getUrlType ; window [ "AscCommon" ] . prepareUrl = prepareUrl ; window [ "AscCommon" ] . getUserColorById = getUserColorById ; window [ "AscCommon" ] . isNullOrEmptyString = isNullOrEmptyString ; window [ "AscCommon" ] . unleakString = unleakString ; window [ "AscCommon" ] . readValAttr = readValAttr ; window [ "AscCommon" ] . getNumFromXml = getNumFromXml ; window [ "AscCommon" ] . getColorFromXml = getColorFromXml ; window [ "AscCommon" ] . getBoolFromXml = getBoolFromXml ; window [ "AscCommon" ] . initStreamFromResponse = initStreamFromResponse ; window [ "AscCommon" ] . checkStreamSignature =
checkStreamSignature ; window [ "AscCommon" ] . DocumentUrls = DocumentUrls ; window [ "AscCommon" ] . OpenFileResult = OpenFileResult ; window [ "AscCommon" ] . CLock = CLock ; window [ "AscCommon" ] . CContentChanges = CContentChanges ; window [ "AscCommon" ] . CContentChangesElement = CContentChangesElement ; window [ "AscCommon" ] . CorrectMMToTwips = CorrectMMToTwips ; window [ "AscCommon" ] . TwipsToMM = TwipsToMM ; window [ "AscCommon" ] . MMToTwips = MMToTwips ; window [ "AscCommon" ] . RomanToInt = RomanToInt ; window [ "AscCommon" ] . LatinNumberingToInt = LatinNumberingToInt ;
window [ "AscCommon" ] . IntToNumberFormat = IntToNumberFormat ; window [ "AscCommon" ] . loadSdk = loadSdk ; window [ "AscCommon" ] . loadScript = loadScript ; window [ "AscCommon" ] . getAltGr = getAltGr ; window [ "AscCommon" ] . getColorSchemeByName = getColorSchemeByName ; window [ "AscCommon" ] . getAscColorScheme = getAscColorScheme ; window [ "AscCommon" ] . isEastAsianScript = isEastAsianScript ; window [ "AscCommon" ] . JSZipWrapper = JSZipWrapper ; window [ "AscCommon" ] . g _oDocumentUrls = g _oDocumentUrls ; window [ "AscCommon" ] . FormulaTablePartInfo = FormulaTablePartInfo ;
window [ "AscCommon" ] . cBoolLocal = cBoolLocal ; window [ "AscCommon" ] . cErrorOrigin = cErrorOrigin ; window [ "AscCommon" ] . cErrorLocal = cErrorLocal ; window [ "AscCommon" ] . FormulaSeparators = FormulaSeparators ; window [ "AscCommon" ] . rx _space _g = rx _space _g ; window [ "AscCommon" ] . rx _space = rx _space ; window [ "AscCommon" ] . rx _defName = rx _defName ; window [ "AscCommon" ] . kCurFormatPainterWord = kCurFormatPainterWord ; window [ "AscCommon" ] . parserHelp = parserHelp ; window [ "AscCommon" ] . g _oIdCounter = g _oIdCounter ; window [ "AscCommon" ] . g _oHtmlCursor = g _oHtmlCursor ;
window [ "AscCommon" ] . CSignatureDrawer = window [ "AscCommon" ] [ "CSignatureDrawer" ] = CSignatureDrawer ; var prot = CSignatureDrawer . prototype ; prot [ "getImages" ] = prot . getImages ; prot [ "setText" ] = prot . setText ; prot [ "selectImage" ] = prot . selectImage ; prot [ "isValid" ] = prot . isValid ; prot [ "destroy" ] = prot . destroy ; window [ "AscCommon" ] . translateManager = new CTranslateManager ; window [ "AscCommon" ] . parseText = parseText ; window [ "AscCommon" ] . getTimeISO8601 = getTimeISO8601 } ) ( window ) ;
window [ "asc_initAdvancedOptions" ] = function ( _code , _file _hash , _docInfo ) { if ( window . isNativeOpenPassword ) return window [ "NativeFileOpen_error" ] ( window . isNativeOpenPassword , _file _hash , _docInfo ) ; var _editor = window [ "Asc" ] [ "editor" ] ? window [ "Asc" ] [ "editor" ] : window . editor ; if ( _code == 90 || _code == 91 ) { if ( window [ "AscDesktopEditor" ] && 0 !== window [ "AscDesktopEditor" ] [ "CryptoMode" ] && ! _editor . isLoadFullApi ) { _editor . asc _initAdvancedOptions _params = [ ] ; _editor . asc _initAdvancedOptions _params . push ( _code ) ; _editor . asc _initAdvancedOptions _params . push ( _file _hash ) ;
_editor . asc _initAdvancedOptions _params . push ( _docInfo ) ; return } if ( AscCommon . EncryptionWorker . isNeedCrypt ( ) && ! window . checkPasswordFromPlugin ) { window . checkPasswordFromPlugin = true ; window . g _asc _plugins . sendToEncryption ( { "type" : "getPasswordByFile" , "hash" : _file _hash , "docinfo" : _docInfo } ) ; return } } window . checkPasswordFromPlugin = false ; _editor . _onNeedParams ( undefined , _code == 90 || _code == 91 ? true : undefined ) } ;
window [ "asc_IsNeedBuildCryptedFile" ] = function ( ) { if ( ! window [ "AscDesktopEditor" ] || ! window [ "AscDesktopEditor" ] [ "CryptoMode" ] ) return false ; var _api = window [ "Asc" ] [ "editor" ] ? window [ "Asc" ] [ "editor" ] : window . editor ; var _returnValue = false ; var _users = null ; if ( _api . CoAuthoringApi && _api . CoAuthoringApi . _CoAuthoringApi && _api . CoAuthoringApi . _CoAuthoringApi . _participants ) _users = _api . CoAuthoringApi . _CoAuthoringApi . _participants ; var _usersCount = 0 ; for ( var _user in _users ) _usersCount ++ ; var isOne = 1 >= _usersCount ? true : false ;
@ -1198,9 +1198,9 @@ prot.asc_getGroupName;prot["asc_getFormulasArray"]=prot.asc_getFormulasArray;pro
window [ "AscFonts" ] . onLoadModule = function ( ) { if ( window [ "AscFonts" ] . isEngineReady ) return ; ++ window [ "AscFonts" ] . curLoadingIndex ; if ( window [ "AscFonts" ] . curLoadingIndex == window [ "AscFonts" ] . maxLoadingIndex ) { if ( window [ "AscFonts" ] . api ) { window [ "AscFonts" ] . isEngineReady = true ; window [ "AscFonts" ] . onSuccess . call ( window [ "AscFonts" ] . api ) } delete window [ "AscFonts" ] . curLoadingIndex ; delete window [ "AscFonts" ] . maxLoadingIndex ; delete window [ "AscFonts" ] . api ; delete window [ "AscFonts" ] . onSuccess ; delete window [ "AscFonts" ] . onError } } ;
window [ "AscFonts" ] . load = function ( api , onSuccess , onError ) { window [ "AscFonts" ] . api = api ; window [ "AscFonts" ] . onSuccess = onSuccess ; window [ "AscFonts" ] . onError = onError ; if ( window [ "NATIVE_EDITOR_ENJINE" ] === true || window [ "IS_NATIVE_EDITOR" ] === true || window [ "Native" ] !== undefined ) { window [ "AscFonts" ] . isEngineReady = true ; window [ "AscFonts" ] . onSuccess . call ( window [ "AscFonts" ] . api ) ; delete window [ "AscFonts" ] . curLoadingIndex ; delete window [ "AscFonts" ] . maxLoadingIndex ; delete window [ "AscFonts" ] . api ; delete window [ "AscFonts" ] . onSuccess ;
delete window [ "AscFonts" ] . onError ; return } var url = "../../../../sdkjs/common/libfont" ; var useWasm = false ; var webAsmObj = window [ "WebAssembly" ] ; if ( typeof webAsmObj === "object" ) if ( typeof webAsmObj [ "Memory" ] === "function" ) if ( typeof webAsmObj [ "instantiateStreaming" ] === "function" || typeof webAsmObj [ "instantiate" ] === "function" ) useWasm = true ; useWasm ? url += "/wasm" : url += "/js" ; if ( ! useWasm ) window [ "AscFonts" ] . onLoadModule ( ) ; var _onSuccess = function ( ) { } ; var _onError = function ( ) { window [ "AscFonts" ] . onError ( ) } ; if ( window [ "AscNotLoadAllScript" ] ) { AscCommon . loadScript ( url +
"/engine.js" , _onSuccess , _onError ) ; AscCommon . loadScript ( url + "/file.js" , _onSuccess , _onError ) ; AscCommon . loadScript ( url + "/manager.js" , _onSuccess , _onError ) } else AscCommon . loadScript ( url + "/fonts.js ", _onSuccess , _onError ) } ; function FontStream ( data , size ) { this . data = data ; this . size = size } window [ "AscFonts" ] . FontStream = FontStream ; window [ "AscFonts" ] . FT _Common = { UintToInt : function ( v ) { return v > 2147483647 ? v - 4294967296 : v } , UShort _To _Short : function ( v ) { return v > 32767 ? v - 65536 : v } , IntToUInt : function ( v ) { return v < 0 ? v + 4294967296 :
v } , Short _To _UShort : function ( v ) { return v < 0 ? v + 65536 : v } , memset : function ( d , v , s ) { for ( var i = 0 ; i < s ; i ++ ) d [ i ] = v } } ; function CPointer ( ) { this . obj = null ; this . data = null ; this . pos = 0 } function FT _Memory ( ) { this . canvas = document . createElement ( "canvas" ) ; this . canvas . width = 1 ; this . canvas . height = 1 ; this . ctx = this . canvas . getContext ( "2d" ) ; this . Alloc = function ( size ) { var p = new CPointer ; p . obj = this . ctx . createImageData ( 1 , parseInt ( ( size + 3 ) / 4 ) ) ; p . data = p . obj . data ; p . pos = 0 ; return p } ; this . AllocHeap = function ( ) { } ; this . CreateStream = function ( size ) { var _size =
parseInt ( ( size + 3 ) / 4 ) ; var obj = this . ctx . createImageData ( 1 , _size ) ; return new FontStream ( obj . data , _size ) } } window [ "AscFonts" ] . FT _Memory = FT _Memory ; window [ "AscFonts" ] . g _memory = new FT _Memory ; function CRasterMemory ( ) { this . width = 0 ; this . height = 0 ; this . pitch = 0 ; this . m _oBuffer = null ; this . CheckSize = function ( w , h ) { if ( this . width < w + 1 || this . height < h + 1 ) { this . width = Math . max ( this . width , w + 1 ) ; this . pitch = 4 * this . width ; this . height = Math . max ( this . height , h + 1 ) ; this . m _oBuffer = null ; this . m _oBuffer = window [ "AscFonts" ] . g _memory . ctx . createImageData ( this . width ,
"/engine.js" , _onSuccess , _onError ) ; AscCommon . loadScript ( url + "/file.js" , _onSuccess , _onError ) ; AscCommon . loadScript ( url + "/manager.js" , _onSuccess , _onError ) } else AscCommon . loadScript ( url + "/fonts.js ? "+ window . CP _urlArgs , _onSuccess , _onError ) } ; function FontStream ( data , size ) { this . data = data ; this . size = size } window [ "AscFonts" ] . FontStream = FontStream ; window [ "AscFonts" ] . FT _Common = { UintToInt : function ( v ) { return v > 2147483647 ? v - 4294967296 : v } , UShort _To _Short : function ( v ) { return v > 32767 ? v - 65536 : v } , IntToUInt : function ( v ) { return v <
0 ? v + 4294967296 : v } , Short _To _UShort : function ( v ) { return v < 0 ? v + 65536 : v } , memset : function ( d , v , s ) { for ( var i = 0 ; i < s ; i ++ ) d [ i ] = v } } ; function CPointer ( ) { this . obj = null ; this . data = null ; this . pos = 0 } function FT _Memory ( ) { this . canvas = document . createElement ( "canvas" ) ; this . canvas . width = 1 ; this . canvas . height = 1 ; this . ctx = this . canvas . getContext ( "2d" ) ; this . Alloc = function ( size ) { var p = new CPointer ; p . obj = this . ctx . createImageData ( 1 , parseInt ( ( size + 3 ) / 4 ) ) ; p . data = p . obj . data ; p . pos = 0 ; return p } ; this . AllocHeap = function ( ) { } ; this . CreateStream =
function ( size ) { var _size = parseInt ( ( size + 3 ) / 4 ) ; var obj = this . ctx . createImageData ( 1 , _size ) ; return new FontStream ( obj . data , _size ) } } window [ "AscFonts" ] . FT _Memory = FT _Memory ; window [ "AscFonts" ] . g _memory = new FT _Memory ; function CRasterMemory ( ) { this . width = 0 ; this . height = 0 ; this . pitch = 0 ; this . m _oBuffer = null ; this . CheckSize = function ( w , h ) { if ( this . width < w + 1 || this . height < h + 1 ) { this . width = Math . max ( this . width , w + 1 ) ; this . pitch = 4 * this . width ; this . height = Math . max ( this . height , h + 1 ) ; this . m _oBuffer = null ; this . m _oBuffer = window [ "AscFonts" ] . g _memory . ctx . createImageData ( this . width ,
this . height ) } } } window [ "AscFonts" ] . raster _memory = new CRasterMemory } ) ( window , undefined ) ; "use strict" ; var c _oAscZoomType = { Current : 0 , FitWidth : 1 , FitPage : 2 } ; var c _oAscAlignType = { LEFT : 0 , CENTER : 1 , RIGHT : 2 , JUSTIFY : 3 , TOP : 4 , MIDDLE : 5 , BOTTOM : 6 } ; var c _oAscWrapStyle2 = { Inline : 0 , Square : 1 , Tight : 2 , Through : 3 , TopAndBottom : 4 , Behind : 5 , InFront : 6 } ; var c _oAscTableSelectionType = { Cell : 0 , Row : 1 , Column : 2 , Table : 3 } ; var c _oAscContextMenuTypes = { Common : 0 , ChangeHdrFtr : 1 } ; var c _oAscMouseMoveLockedObjectType = { Common : 0 , Header : 1 , Footer : 2 } ;
var c _oAscCollaborativeMarksShowType = { None : - 1 , All : 0 , LastChanges : 1 } ; var c _oAscAlignH = { Center : 0 , Inside : 1 , Left : 2 , Outside : 3 , Right : 4 } ; var c _oAscChangeLevel = { BringToFront : 0 , BringForward : 1 , SendToBack : 2 , BringBackward : 3 } ; var c _oAscAlignV = { Bottom : 0 , Center : 1 , Inside : 2 , Outside : 3 , Top : 4 } ; var c _oAscVertAlignJc = { Top : 0 , Center : 1 , Bottom : 2 } ; var c _oAscTableLayout = { AutoFit : 0 , Fixed : 1 } ; var c _oAscAlignShapeType = { ALIGN _LEFT : 0 , ALIGN _RIGHT : 1 , ALIGN _TOP : 2 , ALIGN _BOTTOM : 3 , ALIGN _CENTER : 4 , ALIGN _MIDDLE : 5 } ;
var TABLE _STYLE _WIDTH _PIX = 70 ; var TABLE _STYLE _HEIGHT _PIX = 50 ; var c _oAscSectionBreakType = { NextPage : 0 , OddPage : 1 , EvenPage : 2 , Continuous : 3 , Column : 4 } ; var c _oAscRevisionsChangeType = { Unknown : 0 , TextAdd : 1 , TextRem : 2 , ParaAdd : 3 , ParaRem : 4 , TextPr : 5 , ParaPr : 6 , TablePr : 7 , RowsAdd : 8 , RowsRem : 9 , MoveMark : 254 , MoveMarkRemove : 255 } ; var c _oAscRevisionsObjectType = { Image : 0 , Shape : 1 , Chart : 2 , MathEquation : 3 } ; var c _oSerFormat = { Version : 5 , Signature : "DOCY" } ; var c _oAscFootnotePos = { BeneathText : 0 , DocEnd : 1 , PageBottom : 2 , SectEnd : 3 } ;