Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
yflory 4 years ago
commit a7a0e3e0a8

@ -23,7 +23,7 @@ To update from 3.23.0 to 3.23.1:
0. Read the 3.23.0 release notes carefully and apply all configuration changes if you haven't already done so. 0. Read the 3.23.0 release notes carefully and apply all configuration changes if you haven't already done so.
1. Stop your server 1. Stop your server
2. Get the latest code with `git checkout 3.20.1` 2. Get the latest code with `git checkout 3.23.1`
3. Install the latest dependencies with `bower update` and `npm i` 3. Install the latest dependencies with `bower update` and `npm i`
4. Restart your server 4. Restart your server

@ -104,13 +104,13 @@ module.exports = {
/* /*
* CryptPad contains an administration panel. Its access is restricted to specific * CryptPad contains an administration panel. Its access is restricted to specific
* users using the following list. * users using the following list.
* To give access to the admin panel to a user account, just add their user id, * To give access to the admin panel to a user account, just add their public signing
* which can be found on the settings page for registered users. * key, which can be found on the settings page for registered users.
* Entries should be strings separated by a comma. * Entries should be strings separated by a comma.
*/ */
/* /*
adminKeys: [ adminKeys: [
//"https://my.awesome.website/user/#/1/cryptpad-user1/YZgXQxKR0Rcb6r6CmxHPdAGLVludrAF2lEnkbx1vVOo=", //"[cryptpad-user1@my.awesome.website/YZgXQxKR0Rcb6r6CmxHPdAGLVludrAF2lEnkbx1vVOo=]",
], ],
*/ */

@ -71,6 +71,9 @@ server {
if ($args ~ ver=) { if ($args ~ ver=) {
set $cacheControl max-age=31536000; set $cacheControl max-age=31536000;
} }
if ($uri ~ ^/.*(\/|\.html)$) {
set $cacheControl no-cache;
}
# Will not set any header if it is emptystring # Will not set any header if it is emptystring
add_header Cache-Control $cacheControl; add_header Cache-Control $cacheControl;

@ -378,7 +378,10 @@ var makeWalker = function (n, handleChild, done) {
nThen(function (w) { nThen(function (w) {
// check if the path is a directory... // check if the path is a directory...
Fs.stat(path, w(function (err, stats) { Fs.stat(path, w(function (err, stats) {
if (err) { return next(); } if (err) {
w.abort();
return next();
}
if (!stats.isDirectory()) { if (!stats.isDirectory()) {
w.abort(); w.abort();
return void handleChild(void 0, path, next); return void handleChild(void 0, path, next);

@ -94,25 +94,31 @@ const destroyStream = function (stream) {
}, STREAM_DESTROY_TIMEOUT); }, STREAM_DESTROY_TIMEOUT);
}; };
/* /* createIdleStreamCollector
accept a stream, an id (used as a label) and an optional number of milliseconds
Takes a stream and returns a function to asynchronously close that stream.
Successive calls to the function will be ignored.
If the function is not called for a period of STREAM_CLOSE_TIMEOUT it will
be called automatically unless its `keepAlive` method has been invoked
in the meantime. Used to prevent file descriptor leaks in the case of
abandoned streams while closing streams which are being read very very
slowly.
return a function which ignores all arguments XXX inform the stream consumer when it has been closed prematurely
and first tries to gracefully close a stream by calling back with a TIMEOUT error or something
then destroys it after a period if the close was not successful
if the function is not called within the specified number of milliseconds
then it will be called implicitly with an error to indicate
that it was run because it timed out
*/ */
const ensureStreamCloses = function (stream, id, ms) { const createIdleStreamCollector = function (stream) {
return Util.bake(Util.mkTimeout(Util.once(function (err) { // create a function to close the stream which takes no arguments
destroyStream(stream); // and will do nothing after being called the first time
if (err) { var collector = Util.once(Util.mkAsync(Util.bake(destroyStream, [stream])));
// this can only be a timeout error...
console.log("stream close error:", err, id); // create a second function which will execute the first function after a delay
} // calling this function will reset the delay and thus keep the stream 'alive'
}), ms || STREAM_CLOSE_TIMEOUT), []); collector.keepAlive = Util.throttle(collector, STREAM_CLOSE_TIMEOUT);
collector.keepAlive();
return collector;
}; };
// readMessagesBin asynchronously iterates over the messages in a channel log // readMessagesBin asynchronously iterates over the messages in a channel log
@ -122,25 +128,22 @@ const ensureStreamCloses = function (stream, id, ms) {
// it also allows the handler to abort reading at any time // it also allows the handler to abort reading at any time
const readMessagesBin = (env, id, start, msgHandler, cb) => { const readMessagesBin = (env, id, start, msgHandler, cb) => {
const stream = Fs.createReadStream(mkPath(env, id), { start: start }); const stream = Fs.createReadStream(mkPath(env, id), { start: start });
const finish = ensureStreamCloses(stream, '[readMessagesBin:' + id + ']'); const collector = createIdleStreamCollector(stream);
return void readFileBin(stream, msgHandler, function (err) { const handleMessageAndKeepStreamAlive = Util.both(msgHandler, collector.keepAlive);
cb(err); const done = Util.both(cb, collector);
finish(); return void readFileBin(stream, handleMessageAndKeepStreamAlive, done);
});
}; };
// reads classic metadata from a channel log and aborts // reads classic metadata from a channel log and aborts
// returns undefined if the first message was not an object (not an array) // returns undefined if the first message was not an object (not an array)
var getMetadataAtPath = function (Env, path, _cb) { var getMetadataAtPath = function (Env, path, _cb) {
const stream = Fs.createReadStream(path, { start: 0 }); const stream = Fs.createReadStream(path, { start: 0 });
const finish = ensureStreamCloses(stream, '[getMetadataAtPath:' + path + ']'); const collector = createIdleStreamCollector(stream);
var cb = Util.once(Util.mkAsync(Util.both(_cb, finish)), function () { var cb = Util.once(Util.mkAsync(Util.both(_cb, collector)));
throw new Error("Multiple Callbacks");
});
var i = 0; var i = 0;
return readFileBin(stream, function (msgObj, readMore, abort) { return readFileBin(stream, function (msgObj, readMore, abort) {
collector.keepAlive();
const line = msgObj.buff.toString('utf8'); const line = msgObj.buff.toString('utf8');
if (!line) { if (!line) {
@ -149,7 +152,7 @@ var getMetadataAtPath = function (Env, path, _cb) {
// metadata should always be on the first line or not exist in the channel at all // metadata should always be on the first line or not exist in the channel at all
if (i++ > 0) { if (i++ > 0) {
console.log("aborting"); //console.log("aborting");
abort(); abort();
return void cb(); return void cb();
} }
@ -219,10 +222,11 @@ var clearChannel = function (env, channelId, _cb) {
*/ */
var readMessages = function (path, msgHandler, _cb) { var readMessages = function (path, msgHandler, _cb) {
var stream = Fs.createReadStream(path, { start: 0}); var stream = Fs.createReadStream(path, { start: 0});
const finish = ensureStreamCloses(stream, '[readMessages:' + path + ']'); var collector = createIdleStreamCollector(stream);
var cb = Util.once(Util.mkAsync(Util.both(finish, _cb))); var cb = Util.once(Util.mkAsync(Util.both(_cb, collector)));
return readFileBin(stream, function (msgObj, readMore) { return readFileBin(stream, function (msgObj, readMore) {
collector.keepAlive();
msgHandler(msgObj.buff.toString('utf8')); msgHandler(msgObj.buff.toString('utf8'));
readMore(); readMore();
}, function (err) { }, function (err) {
@ -247,10 +251,11 @@ var getDedicatedMetadata = function (env, channelId, handler, _cb) {
var metadataPath = mkMetadataPath(env, channelId); var metadataPath = mkMetadataPath(env, channelId);
var stream = Fs.createReadStream(metadataPath, {start: 0}); var stream = Fs.createReadStream(metadataPath, {start: 0});
const finish = ensureStreamCloses(stream, '[getDedicatedMetadata:' + metadataPath + ']'); const collector = createIdleStreamCollector(stream);
var cb = Util.both(finish, _cb); var cb = Util.both(_cb, collector);
readFileBin(stream, function (msgObj, readMore) { readFileBin(stream, function (msgObj, readMore) {
collector.keepAlive();
var line = msgObj.buff.toString('utf8'); var line = msgObj.buff.toString('utf8');
try { try {
var parsed = JSON.parse(line); var parsed = JSON.parse(line);
@ -758,11 +763,11 @@ var getChannel = function (env, id, _callback) {
}); });
}); });
}).nThen(function () { }).nThen(function () {
channel.delayClose = Util.throttle(function () { channel.delayClose = Util.throttle(Util.once(function () {
delete env.channels[id]; delete env.channels[id];
destroyStream(channel.writeStream, path); destroyStream(channel.writeStream, path);
//console.log("closing writestream"); //console.log("closing writestream");
}, CHANNEL_WRITE_WINDOW); }), CHANNEL_WRITE_WINDOW);
channel.delayClose(); channel.delayClose();
env.channels[id] = channel; env.channels[id] = channel;
done(void 0, channel); done(void 0, channel);

@ -82,6 +82,13 @@ Workers.initialize = function (Env, config, _cb) {
var drained = true; var drained = true;
var sendCommand = function (msg, _cb, opt) { var sendCommand = function (msg, _cb, opt) {
if (!_cb) {
return void Log.error('WORKER_COMMAND_MISSING_CB', {
msg: msg,
opt: opt,
});
}
opt = opt || {}; opt = opt || {};
var index = getAvailableWorkerIndex(); var index = getAvailableWorkerIndex();
@ -95,7 +102,7 @@ Workers.initialize = function (Env, config, _cb) {
}); });
if (drained) { if (drained) {
drained = false; drained = false;
Log.debug('WORKER_QUEUE_BACKLOG', { Log.error('WORKER_QUEUE_BACKLOG', {
workers: workers.length, workers: workers.length,
}); });
} }
@ -104,12 +111,6 @@ Workers.initialize = function (Env, config, _cb) {
} }
const txid = guid(); const txid = guid();
msg.txid = txid;
msg.pid = PID;
// track which worker is doing which jobs
state.tasks[txid] = msg;
var cb = Util.once(Util.mkAsync(Util.both(_cb, function (err /*, value */) { var cb = Util.once(Util.mkAsync(Util.both(_cb, function (err /*, value */) {
if (err !== 'TIMEOUT') { return; } if (err !== 'TIMEOUT') { return; }
// in the event of a timeout the user will receive an error // in the event of a timeout the user will receive an error
@ -120,6 +121,16 @@ Workers.initialize = function (Env, config, _cb) {
delete state.tasks[txid]; delete state.tasks[txid];
}))); })));
if (!msg) {
return void cb('ESERVERERR');
}
msg.txid = txid;
msg.pid = PID;
// track which worker is doing which jobs
state.tasks[txid] = msg;
// default to timing out affter 180s if no explicit timeout is passed // default to timing out affter 180s if no explicit timeout is passed
var timeout = typeof(opt.timeout) !== 'undefined'? opt.timeout: 180000; var timeout = typeof(opt.timeout) !== 'undefined'? opt.timeout: 180000;
response.expect(txid, cb, timeout); response.expect(txid, cb, timeout);
@ -153,6 +164,13 @@ Workers.initialize = function (Env, config, _cb) {
} }
var nextMsg = queue.shift(); var nextMsg = queue.shift();
if (!nextMsg || !nextMsg.msg) {
return void Log.error('WORKER_QUEUE_EMPTY_MESSAGE', {
item: nextMsg,
});
}
/* `nextMsg` was at the top of the queue. /* `nextMsg` was at the top of the queue.
We know that a job just finished and all of this code We know that a job just finished and all of this code
is synchronous, so calling `sendCommand` should take the worker is synchronous, so calling `sendCommand` should take the worker
@ -200,7 +218,7 @@ Workers.initialize = function (Env, config, _cb) {
const cb = response.expectation(txid); const cb = response.expectation(txid);
if (typeof(cb) !== 'function') { return; } if (typeof(cb) !== 'function') { return; }
const task = state.tasks[txid]; const task = state.tasks[txid];
if (!task && task.msg) { return; } if (!(task && task.msg)) { return; }
response.clear(txid); response.clear(txid);
Log.info('DB_WORKER_RESEND', task.msg); Log.info('DB_WORKER_RESEND', task.msg);
sendCommand(task.msg, cb); sendCommand(task.msg, cb);

@ -53,7 +53,8 @@ define([
var Nacl = window.nacl; var Nacl = window.nacl;
var APP = window.APP = { var APP = window.APP = {
$: $ $: $,
urlArgs: Util.find(ApiConfig, ['requireConf', 'urlArgs'])
}; };
var CHECKPOINT_INTERVAL = 100; var CHECKPOINT_INTERVAL = 100;

@ -700,58 +700,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* 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= 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(); {"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(); 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;
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]= _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_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; 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,
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; 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,
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, _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;
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, 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,
_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&& 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<=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&&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||
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"); 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=
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; 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.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")); 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();
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= 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,
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()})}; 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);
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; 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=
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= _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=
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= _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);
"";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}; 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,
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"](): 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"]&&
"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; 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;
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, 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],
_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, 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.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"]? 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,
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= _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,
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, 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!==
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", 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});
"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= 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"];
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== 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=
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, 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,
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= 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=
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- 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=
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(); 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};
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.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-
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=== 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 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>"+ 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>"+
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= 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=
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= 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;
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? 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._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= 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=
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< 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=
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= 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!==
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"&& "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=
!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= 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;
":";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); 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=
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= 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;
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= 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=
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= 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=
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= 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=
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; 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=
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= 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;
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= 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;
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"]= 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;
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["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); 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)}; _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; 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;
@ -1200,9 +1200,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"].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; 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+ 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: "/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<
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= 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=
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, 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"; this.height)}}}window["AscFonts"].raster_memory=new CRasterMemory})(window,undefined);"use strict";
(function(window,undefined){var CColor=AscCommon.CColor;var c_oAscConfirm={ConfirmReplaceRange:0,ConfirmPutMergeRange:1};var c_oAscMergeOptions={Disabled:-1,None:0,Merge:1,MergeCenter:2,MergeAcross:3};var c_oAscSortOptions={Ascending:1,Descending:2,ByColorFill:3,ByColorFont:4};var c_oAscBorderOptions={Top:0,Right:1,Bottom:2,Left:3,DiagD:4,DiagU:5,InnerV:6,InnerH:7};var c_oAscCleanOptions={All:0,Text:1,Format:2,Formula:4,Comments:5,Hyperlinks:6,Sparklines:7,SparklineGroups:8};var c_oAscDrawDepOptions= (function(window,undefined){var CColor=AscCommon.CColor;var c_oAscConfirm={ConfirmReplaceRange:0,ConfirmPutMergeRange:1};var c_oAscMergeOptions={Disabled:-1,None:0,Merge:1,MergeCenter:2,MergeAcross:3};var c_oAscSortOptions={Ascending:1,Descending:2,ByColorFill:3,ByColorFont:4};var c_oAscBorderOptions={Top:0,Right:1,Bottom:2,Left:3,DiagD:4,DiagU:5,InnerV:6,InnerH:7};var c_oAscCleanOptions={All:0,Text:1,Format:2,Formula:4,Comments:5,Hyperlinks:6,Sparklines:7,SparklineGroups:8};var c_oAscDrawDepOptions=
{Master:0,Slave:1,Clear:2};var c_oAscSelectionDialogType={None:0,FormatTable:1,Chart:2,FormatTableChangeRange:4};var c_oAscScrollType={ScrollVertical:1,ScrollHorizontal:2};var c_oAscHyperlinkType={WebLink:1,RangeLink:2};var c_oAscMouseMoveType={None:0,Hyperlink:1,Comment:2,LockedObject:3,ResizeColumn:4,ResizeRow:5,Filter:6};var c_oAscMouseMoveLockedObjectType={None:-1,Range:0,TableProperties:1,Sheet:2};var c_oAscLockTypeElem={Range:1,Object:2,Sheet:3};var c_oAscLockTypeElemSubType={DeleteColumns:1, {Master:0,Slave:1,Clear:2};var c_oAscSelectionDialogType={None:0,FormatTable:1,Chart:2,FormatTableChangeRange:4};var c_oAscScrollType={ScrollVertical:1,ScrollHorizontal:2};var c_oAscHyperlinkType={WebLink:1,RangeLink:2};var c_oAscMouseMoveType={None:0,Hyperlink:1,Comment:2,LockedObject:3,ResizeColumn:4,ResizeRow:5,Filter:6};var c_oAscMouseMoveLockedObjectType={None:-1,Range:0,TableProperties:1,Sheet:2};var c_oAscLockTypeElem={Range:1,Object:2,Sheet:3};var c_oAscLockTypeElemSubType={DeleteColumns:1,

@ -8065,8 +8065,8 @@ code>>24&63);result.push(128|code>>18&63);result.push(128|code>>12&63);result.pu
5;while(bitCount>=8){var _del=Math.pow(2,bitCount-8);var _res=buffer/_del&255;result.push(_res);bitCount-=8}}this.GetUTF16_fromUTF8(result)};this.CreateIndexByOctetAndMovePosition=function(obj,currentPosition){var j=0;while(j<8){if(currentPosition>=obj.data.length){obj.index[j++]=-1;continue}if(this.IgnoredSymbol(obj.data.charCodeAt(currentPosition))){currentPosition++;continue}obj.index[j]=obj.data[currentPosition];j++;currentPosition++}return currentPosition};this.IgnoredSymbol=function(checkedSymbol){return checkedSymbol>= 5;while(bitCount>=8){var _del=Math.pow(2,bitCount-8);var _res=buffer/_del&255;result.push(_res);bitCount-=8}}this.GetUTF16_fromUTF8(result)};this.CreateIndexByOctetAndMovePosition=function(obj,currentPosition){var j=0;while(j<8){if(currentPosition>=obj.data.length){obj.index[j++]=-1;continue}if(this.IgnoredSymbol(obj.data.charCodeAt(currentPosition))){currentPosition++;continue}obj.index[j]=obj.data[currentPosition];j++;currentPosition++}return currentPosition};this.IgnoredSymbol=function(checkedSymbol){return checkedSymbol>=
128||this.DecodingTable[checkedSymbol]==255}}var bIsLocalFontsUse=false;function _is_support_cors(){if(window["NATIVE_EDITOR_ENJINE"]===true)return false;var xhrSupported=new XMLHttpRequest;return!!xhrSupported&&"withCredentials"in xhrSupported}var bIsSupportOriginalFormatFonts=_is_support_cors();function postLoadScript(scriptName){window.postMessage({type:"FROM_PAGE_LOAD_SCRIPT",text:scriptName},"*")}function CFontFileLoader(id){this.LoadingCounter=0;this.Id=id;this.Status=-1;this.stream_index=-1; 128||this.DecodingTable[checkedSymbol]==255}}var bIsLocalFontsUse=false;function _is_support_cors(){if(window["NATIVE_EDITOR_ENJINE"]===true)return false;var xhrSupported=new XMLHttpRequest;return!!xhrSupported&&"withCredentials"in xhrSupported}var bIsSupportOriginalFormatFonts=_is_support_cors();function postLoadScript(scriptName){window.postMessage({type:"FROM_PAGE_LOAD_SCRIPT",text:scriptName},"*")}function CFontFileLoader(id){this.LoadingCounter=0;this.Id=id;this.Status=-1;this.stream_index=-1;
this.callback=null;this.IsNeedAddJSToFontPath=true;this.CanUseOriginalFormat=true;var oThis=this;this.CheckLoaded=function(){return 0==this.Status||1==this.Status};this._callback_font_load=function(){if(!window[oThis.Id]){oThis.LoadingCounter++;if(oThis.LoadingCounter<oThis.GetMaxLoadingCount()){oThis.Status=-1;return}oThis.Status=2;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;_editor.sendEvent("asc_onError",Asc.c_oAscError.ID.CoAuthoringDisconnect,Asc.c_oAscError.Level.Critical); this.callback=null;this.IsNeedAddJSToFontPath=true;this.CanUseOriginalFormat=true;var oThis=this;this.CheckLoaded=function(){return 0==this.Status||1==this.Status};this._callback_font_load=function(){if(!window[oThis.Id]){oThis.LoadingCounter++;if(oThis.LoadingCounter<oThis.GetMaxLoadingCount()){oThis.Status=-1;return}oThis.Status=2;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;_editor.sendEvent("asc_onError",Asc.c_oAscError.ID.CoAuthoringDisconnect,Asc.c_oAscError.Level.Critical);
return}var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=AscFonts.CreateFontData4(window[oThis.Id]);oThis.SetStreamIndex(__font_data_idx);oThis.Status=0;delete window[oThis.Id];if(null!=oThis.callback)oThis.callback()};this.LoadFontAsync2=function(basePath,_callback){this.callback=_callback;if(-1!=this.Status)return true;if(bIsLocalFontsUse){postLoadScript(this.Id);return}this.Status=2;var xhr=new XMLHttpRequest;xhr.open("GET",basePath+this.Id,true);if(typeof ArrayBuffer!== return}var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=AscFonts.CreateFontData4(window[oThis.Id]);oThis.SetStreamIndex(__font_data_idx);oThis.Status=0;delete window[oThis.Id];if(null!=oThis.callback)oThis.callback()};this.LoadFontAsync2=function(basePath,_callback){this.callback=_callback;if(-1!=this.Status)return true;if(bIsLocalFontsUse){postLoadScript(this.Id);return}this.Status=2;var xhr=new XMLHttpRequest;xhr.open("GET",basePath+this.Id+"?"+window.CP_urlArgs,true);
"undefined"&&!window.opera)xhr.responseType="arraybuffer";if(xhr.overrideMimeType)xhr.overrideMimeType("text/plain; charset=x-user-defined");else xhr.setRequestHeader("Accept-Charset","x-user-defined");xhr.onload=function(){if(this.status!=200){oThis.LoadingCounter++;if(oThis.LoadingCounter<oThis.GetMaxLoadingCount()){oThis.Status=-1;return}oThis.Status=2;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;_editor.sendEvent("asc_onError",Asc.c_oAscError.ID.CoAuthoringDisconnect, if(typeof ArrayBuffer!=="undefined"&&!window.opera)xhr.responseType="arraybuffer";if(xhr.overrideMimeType)xhr.overrideMimeType("text/plain; charset=x-user-defined");else xhr.setRequestHeader("Accept-Charset","x-user-defined");xhr.onload=function(){if(this.status!=200){oThis.LoadingCounter++;if(oThis.LoadingCounter<oThis.GetMaxLoadingCount()){oThis.Status=-1;return}oThis.Status=2;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;_editor.sendEvent("asc_onError",Asc.c_oAscError.ID.CoAuthoringDisconnect,
Asc.c_oAscError.Level.Critical);return}oThis.Status=0;if(typeof ArrayBuffer!=="undefined"&&!window.opera&&this.response){var __font_data_idx=g_fonts_streams.length;var _uintData=new Uint8Array(this.response);g_fonts_streams[__font_data_idx]=new AscFonts.FontStream(_uintData,_uintData.length);oThis.SetStreamIndex(__font_data_idx)}else if(AscCommon.AscBrowser.isIE){var _response=(new VBArray(this["responseBody"])).toArray();var srcLen=_response.length;var stream=new AscFonts.FontStream(AscFonts.allocate(srcLen), Asc.c_oAscError.Level.Critical);return}oThis.Status=0;if(typeof ArrayBuffer!=="undefined"&&!window.opera&&this.response){var __font_data_idx=g_fonts_streams.length;var _uintData=new Uint8Array(this.response);g_fonts_streams[__font_data_idx]=new AscFonts.FontStream(_uintData,_uintData.length);oThis.SetStreamIndex(__font_data_idx)}else if(AscCommon.AscBrowser.isIE){var _response=(new VBArray(this["responseBody"])).toArray();var srcLen=_response.length;var stream=new AscFonts.FontStream(AscFonts.allocate(srcLen),
srcLen);var dstPx=stream.data;var index=0;while(index<srcLen){dstPx[index]=_response[index];index++}var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=stream;oThis.SetStreamIndex(__font_data_idx)}else{var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=AscFonts.CreateFontData3(this.responseText);oThis.SetStreamIndex(__font_data_idx)}var guidOdttf=[160,102,214,32,20,150,71,250,149,105,184,80,176,65,73,72];var _stream=g_fonts_streams[g_fonts_streams.length- srcLen);var dstPx=stream.data;var index=0;while(index<srcLen){dstPx[index]=_response[index];index++}var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=stream;oThis.SetStreamIndex(__font_data_idx)}else{var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=AscFonts.CreateFontData3(this.responseText);oThis.SetStreamIndex(__font_data_idx)}var guidOdttf=[160,102,214,32,20,150,71,250,149,105,184,80,176,65,73,72];var _stream=g_fonts_streams[g_fonts_streams.length-
1];var _data=_stream.data};xhr.send(null)};this.LoadFontNative=function(){if(window["use_native_fonts_only"]===true){this.Status=0;return}var __font_data_idx=g_fonts_streams.length;var _data=window["native"]["GetFontBinary"](this.Id);g_fonts_streams[__font_data_idx]=new AscFonts.FontStream(_data,_data.length);this.SetStreamIndex(__font_data_idx);this.Status=0}}CFontFileLoader.prototype.GetMaxLoadingCount=function(){return 3};CFontFileLoader.prototype.SetStreamIndex=function(index){this.stream_index= 1];var _data=_stream.data};xhr.send(null)};this.LoadFontNative=function(){if(window["use_native_fonts_only"]===true){this.Status=0;return}var __font_data_idx=g_fonts_streams.length;var _data=window["native"]["GetFontBinary"](this.Id);g_fonts_streams[__font_data_idx]=new AscFonts.FontStream(_data,_data.length);this.SetStreamIndex(__font_data_idx);this.Status=0}}CFontFileLoader.prototype.GetMaxLoadingCount=function(){return 3};CFontFileLoader.prototype.SetStreamIndex=function(index){this.stream_index=

@ -23,43 +23,43 @@ TOTAL_STACK+")");if(Module["buffer"])buffer=Module["buffer"];else{if(typeof WebA
continue}var func=callback.func;if(typeof func==="number")if(callback.arg===undefined)Module["dynCall_v"](func);else Module["dynCall_vi"](func,callback.arg);else func(callback.arg===undefined?null:callback.arg)}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[function(){window["AscFonts"].onLoadModule()}];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length)addOnPreRun(Module["preRun"].shift())}callRuntimeCallbacks(__ATPRERUN__)} continue}var func=callback.func;if(typeof func==="number")if(callback.arg===undefined)Module["dynCall_v"](func);else Module["dynCall_vi"](func,callback.arg);else func(callback.arg===undefined?null:callback.arg)}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[function(){window["AscFonts"].onLoadModule()}];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length)addOnPreRun(Module["preRun"].shift())}callRuntimeCallbacks(__ATPRERUN__)}
function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length)addOnPostRun(Module["postRun"].shift())}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies= function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length)addOnPostRun(Module["postRun"].shift())}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=
0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"])Module["monitorRunDependencies"](runDependencies)}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"])Module["monitorRunDependencies"](runDependencies);if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled; 0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"])Module["monitorRunDependencies"](runDependencies)}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"])Module["monitorRunDependencies"](runDependencies);if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;
dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="fonts.wasm";if(!isDataURI(wasmBinaryFile))wasmBinaryFile=locateFile(wasmBinaryFile);function getBinary(){try{if(Module["wasmBinary"])return new Uint8Array(Module["wasmBinary"]);if(Module["readBinary"])return Module["readBinary"](wasmBinaryFile); dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="fonts.wasm?"+window.CP_urlArgs;if(!isDataURI(wasmBinaryFile))wasmBinaryFile=locateFile(wasmBinaryFile);function getBinary(){try{if(Module["wasmBinary"])return new Uint8Array(Module["wasmBinary"]);
else throw"both async and sync fetching of the wasm failed";}catch(err$0){abort(err$0)}}function getBinaryPromise2(){if(!Module["wasmBinary"]&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function")return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"])throw"failed to load wasm binary file at '"+wasmBinaryFile+"'";return response["arrayBuffer"]()}).catch(function(){return getBinary()});return new Promise(function(resolve,reject){resolve(getBinary())})} if(Module["readBinary"])return Module["readBinary"](wasmBinaryFile);else throw"both async and sync fetching of the wasm failed";}catch(err$0){abort(err$0)}}function getBinaryPromise2(){if(!Module["wasmBinary"]&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function")return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"])throw"failed to load wasm binary file at '"+wasmBinaryFile+"'";return response["arrayBuffer"]()}).catch(function(){return getBinary()});
function createWasm(env){var info={"env":env,"global":{"NaN":NaN,Infinity:Infinity},"global.Math":Math,"asm2wasm":asm2wasmImports};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");if(Module["instantiateWasm"])try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}function receiveInstantiatedSource(output){receiveInstance(output["instance"])} return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(env){var info={"env":env,"global":{"NaN":NaN,Infinity:Infinity},"global.Math":Math,"asm2wasm":asm2wasmImports};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");if(Module["instantiateWasm"])try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err("Module.instantiateWasm callback failed with error: "+
function instantiateArrayBuffer(receiver){getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}if(!Module["wasmBinary"]&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function")WebAssembly.instantiateStreaming(fetch(wasmBinaryFile,{credentials:"same-origin"}),info).then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+ e);return false}function receiveInstantiatedSource(output){receiveInstance(output["instance"])}function instantiateArrayBuffer(receiver){getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}if(!Module["wasmBinary"]&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function")WebAssembly.instantiateStreaming(fetch(wasmBinaryFile,
reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)});else instantiateArrayBuffer(receiveInstantiatedSource);return{}}Module["asm"]=function(global,env,providedBuffer){env["memory"]=wasmMemory;env["table"]=wasmTable=new WebAssembly.Table({"initial":814,"maximum":814,"element":"anyfunc"});env["__memory_base"]=1024;env["__table_base"]=0;var exports=createWasm(env);return exports};__ATINIT__.push({func:function(){___emscripten_environ_constructor()}}); {credentials:"same-origin"}),info).then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)});else instantiateArrayBuffer(receiveInstantiatedSource);return{}}Module["asm"]=function(global,env,providedBuffer){env["memory"]=wasmMemory;env["table"]=wasmTable=new WebAssembly.Table({"initial":814,"maximum":814,"element":"anyfunc"});env["__memory_base"]=1024;env["__table_base"]=
var ENV={};function ___buildEnvironment(environ){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]=ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]="C.UTF-8";ENV["_"]=Module["thisProgram"];poolPtr=getMemory(TOTAL_ENV_SIZE);envPtr=getMemory(MAX_ENV_VALUES*4);HEAP32[envPtr>>2]=poolPtr;HEAP32[environ>>2]=envPtr}else{envPtr=HEAP32[environ>>2];poolPtr=HEAP32[envPtr>> 0;var exports=createWasm(env);return exports};__ATINIT__.push({func:function(){___emscripten_environ_constructor()}});var ENV={};function ___buildEnvironment(environ){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]=ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]="C.UTF-8";ENV["_"]=Module["thisProgram"];poolPtr=getMemory(TOTAL_ENV_SIZE);envPtr=getMemory(MAX_ENV_VALUES*
2]}var strings=[];var totalSize=0;for(var key in ENV)if(typeof ENV[key]==="string"){var line=key+"="+ENV[key];strings.push(line);totalSize+=line.length}if(totalSize>TOTAL_ENV_SIZE)throw new Error("Environment size exceeded TOTAL_ENV_SIZE!");var ptrSize=4;for(var i=0;i<strings.length;i++){var line=strings[i];writeAsciiToMemory(line,poolPtr);HEAP32[envPtr+i*ptrSize>>2]=poolPtr;poolPtr+=line.length+1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}function ___lock(){}var SYSCALLS={buffers:[null,[],[]],printChar:function(stream, 4);HEAP32[envPtr>>2]=poolPtr;HEAP32[environ>>2]=envPtr}else{envPtr=HEAP32[environ>>2];poolPtr=HEAP32[envPtr>>2]}var strings=[];var totalSize=0;for(var key in ENV)if(typeof ENV[key]==="string"){var line=key+"="+ENV[key];strings.push(line);totalSize+=line.length}if(totalSize>TOTAL_ENV_SIZE)throw new Error("Environment size exceeded TOTAL_ENV_SIZE!");var ptrSize=4;for(var i=0;i<strings.length;i++){var line=strings[i];writeAsciiToMemory(line,poolPtr);HEAP32[envPtr+i*ptrSize>>2]=poolPtr;poolPtr+=line.length+
curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else buffer.push(curr)},varargs:0,get:function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(){var ret=UTF8ToString(SYSCALLS.get());return ret},get64:function(){var low=SYSCALLS.get(),high=SYSCALLS.get();return low},getZero:function(){SYSCALLS.get()}};function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream= 1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}function ___lock(){}var SYSCALLS={buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else buffer.push(curr)},varargs:0,get:function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(){var ret=UTF8ToString(SYSCALLS.get());return ret},get64:function(){var low=SYSCALLS.get(),high=SYSCALLS.get();
SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(), return low},getZero:function(){SYSCALLS.get()}};function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}
iovcnt=SYSCALLS.get();return SYSCALLS.doReadv(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.get(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAP32[iov+i*8>>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j<len;j++)SYSCALLS.printChar(stream,HEAPU8[ptr+j]);ret+=len}return ret}catch(e){if(typeof FS==="undefined"|| function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doReadv(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.get(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAP32[iov+i*8>>2];var len=HEAP32[iov+(i*8+
!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname, 4)>>2];for(var j=0;j<len;j++)SYSCALLS.printChar(stream,HEAPU8[ptr+j]);ret+=len}return ret}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=
flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}} varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();
function ___unlock(){}function _emscripten_get_heap_size(){return TOTAL_MEMORY}function _longjmp(env,value){_setThrew(env,value||1);throw"longjmp";}function _emscripten_longjmp(env,value){_longjmp(env,value)}function abortOnCannotGrowMemory(requestedSize){abort("OOM")}function emscripten_realloc_buffer(size){var PAGE_MULTIPLE=65536;size=alignUp(size,PAGE_MULTIPLE);var old=Module["buffer"];var oldSize=old.byteLength;try{var result=wasmMemory.grow((size-oldSize)/65536);if(result!==(-1|0))return Module["buffer"]= FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___unlock(){}function _emscripten_get_heap_size(){return TOTAL_MEMORY}function _longjmp(env,value){_setThrew(env,value||1);throw"longjmp";}function _emscripten_longjmp(env,value){_longjmp(env,value)}function abortOnCannotGrowMemory(requestedSize){abort("OOM")}function emscripten_realloc_buffer(size){var PAGE_MULTIPLE=65536;size=alignUp(size,PAGE_MULTIPLE);var old=Module["buffer"];
wasmMemory.buffer;else return null}catch(e){return null}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();var PAGE_MULTIPLE=65536;var LIMIT=2147483648-PAGE_MULTIPLE;if(requestedSize>LIMIT)return false;var MIN_TOTAL_MEMORY=16777216;var newSize=Math.max(oldSize,MIN_TOTAL_MEMORY);while(newSize<requestedSize)if(newSize<=536870912)newSize=alignUp(2*newSize,PAGE_MULTIPLE);else newSize=Math.min(alignUp((3*newSize+2147483648)/4,PAGE_MULTIPLE),LIMIT);var replacement= var oldSize=old.byteLength;try{var result=wasmMemory.grow((size-oldSize)/65536);if(result!==(-1|0))return Module["buffer"]=wasmMemory.buffer;else return null}catch(e){return null}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();var PAGE_MULTIPLE=65536;var LIMIT=2147483648-PAGE_MULTIPLE;if(requestedSize>LIMIT)return false;var MIN_TOTAL_MEMORY=16777216;var newSize=Math.max(oldSize,MIN_TOTAL_MEMORY);while(newSize<requestedSize)if(newSize<=536870912)newSize=alignUp(2*
emscripten_realloc_buffer(newSize);if(!replacement||replacement.byteLength!=newSize)return false;updateGlobalBuffer(replacement);updateGlobalBufferViews();TOTAL_MEMORY=newSize;return true}function _getenv(name){if(name===0)return 0;name=UTF8ToString(name);if(!ENV.hasOwnProperty(name))return 0;if(_getenv.ret)_free(_getenv.ret);_getenv.ret=allocateUTF8(ENV[name]);return _getenv.ret}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest)}function invoke_iii(index, newSize,PAGE_MULTIPLE);else newSize=Math.min(alignUp((3*newSize+2147483648)/4,PAGE_MULTIPLE),LIMIT);var replacement=emscripten_realloc_buffer(newSize);if(!replacement||replacement.byteLength!=newSize)return false;updateGlobalBuffer(replacement);updateGlobalBufferViews();TOTAL_MEMORY=newSize;return true}function _getenv(name){if(name===0)return 0;name=UTF8ToString(name);if(!ENV.hasOwnProperty(name))return 0;if(_getenv.ret)_free(_getenv.ret);_getenv.ret=allocateUTF8(ENV[name]);return _getenv.ret}function _emscripten_memcpy_big(dest,
a1,a2){var sp=stackSave();try{return dynCall_iii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iiii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_iiiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index, src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest)}function invoke_iii(index,a1,a2){var sp=stackSave();try{return dynCall_iii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return dynCall_iiii(index,a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_iiiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);
a1,a2){var sp=stackSave();try{dynCall_vii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{dynCall_viiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}var asmGlobalArg={};var asmLibraryArg={"b":abort,"e":setTempRet0,"d":getTempRet0,"r":invoke_iii,"q":invoke_iiii,"p":invoke_iiiii,"o":invoke_vii,"n":invoke_viiii,"m":___buildEnvironment,"l":___lock, if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{dynCall_vii(index,a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{dynCall_viiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}var asmGlobalArg={};var asmLibraryArg={"b":abort,"e":setTempRet0,"d":getTempRet0,"r":invoke_iii,"q":invoke_iiii,"p":invoke_iiiii,
"k":___setErrNo,"A":___syscall140,"z":___syscall145,"j":___syscall146,"f":___syscall221,"y":___syscall5,"i":___syscall54,"h":___syscall6,"g":___unlock,"x":_emscripten_get_heap_size,"w":_emscripten_longjmp,"v":_emscripten_memcpy_big,"u":_emscripten_resize_heap,"t":_getenv,"c":_longjmp,"s":abortOnCannotGrowMemory,"a":DYNAMICTOP_PTR};var asm=Module["asm"](asmGlobalArg,asmLibraryArg,buffer);Module["asm"]=asm;var _ASC_FT_Free=Module["_ASC_FT_Free"]=function(){return Module["asm"]["B"].apply(null,arguments)}; "o":invoke_vii,"n":invoke_viiii,"m":___buildEnvironment,"l":___lock,"k":___setErrNo,"A":___syscall140,"z":___syscall145,"j":___syscall146,"f":___syscall221,"y":___syscall5,"i":___syscall54,"h":___syscall6,"g":___unlock,"x":_emscripten_get_heap_size,"w":_emscripten_longjmp,"v":_emscripten_memcpy_big,"u":_emscripten_resize_heap,"t":_getenv,"c":_longjmp,"s":abortOnCannotGrowMemory,"a":DYNAMICTOP_PTR};var asm=Module["asm"](asmGlobalArg,asmLibraryArg,buffer);Module["asm"]=asm;var _ASC_FT_Free=Module["_ASC_FT_Free"]=
var _ASC_FT_GetFaceInfo=Module["_ASC_FT_GetFaceInfo"]=function(){return Module["asm"]["C"].apply(null,arguments)};var _ASC_FT_GetFaceMaxAdvanceX=Module["_ASC_FT_GetFaceMaxAdvanceX"]=function(){return Module["asm"]["D"].apply(null,arguments)};var _ASC_FT_GetKerningX=Module["_ASC_FT_GetKerningX"]=function(){return Module["asm"]["E"].apply(null,arguments)};var _ASC_FT_Get_Glyph_Measure_Params=Module["_ASC_FT_Get_Glyph_Measure_Params"]=function(){return Module["asm"]["F"].apply(null,arguments)};var _ASC_FT_Get_Glyph_Render_Buffer= function(){return Module["asm"]["B"].apply(null,arguments)};var _ASC_FT_GetFaceInfo=Module["_ASC_FT_GetFaceInfo"]=function(){return Module["asm"]["C"].apply(null,arguments)};var _ASC_FT_GetFaceMaxAdvanceX=Module["_ASC_FT_GetFaceMaxAdvanceX"]=function(){return Module["asm"]["D"].apply(null,arguments)};var _ASC_FT_GetKerningX=Module["_ASC_FT_GetKerningX"]=function(){return Module["asm"]["E"].apply(null,arguments)};var _ASC_FT_Get_Glyph_Measure_Params=Module["_ASC_FT_Get_Glyph_Measure_Params"]=function(){return Module["asm"]["F"].apply(null,
Module["_ASC_FT_Get_Glyph_Render_Buffer"]=function(){return Module["asm"]["G"].apply(null,arguments)};var _ASC_FT_Get_Glyph_Render_Params=Module["_ASC_FT_Get_Glyph_Render_Params"]=function(){return Module["asm"]["H"].apply(null,arguments)};var _ASC_FT_Glyph_Get_CBox=Module["_ASC_FT_Glyph_Get_CBox"]=function(){return Module["asm"]["I"].apply(null,arguments)};var _ASC_FT_Init=Module["_ASC_FT_Init"]=function(){return Module["asm"]["J"].apply(null,arguments)};var _ASC_FT_Malloc=Module["_ASC_FT_Malloc"]= arguments)};var _ASC_FT_Get_Glyph_Render_Buffer=Module["_ASC_FT_Get_Glyph_Render_Buffer"]=function(){return Module["asm"]["G"].apply(null,arguments)};var _ASC_FT_Get_Glyph_Render_Params=Module["_ASC_FT_Get_Glyph_Render_Params"]=function(){return Module["asm"]["H"].apply(null,arguments)};var _ASC_FT_Glyph_Get_CBox=Module["_ASC_FT_Glyph_Get_CBox"]=function(){return Module["asm"]["I"].apply(null,arguments)};var _ASC_FT_Init=Module["_ASC_FT_Init"]=function(){return Module["asm"]["J"].apply(null,arguments)};
function(){return Module["asm"]["K"].apply(null,arguments)};var _ASC_FT_Open_Face=Module["_ASC_FT_Open_Face"]=function(){return Module["asm"]["L"].apply(null,arguments)};var _ASC_FT_SetCMapForCharCode=Module["_ASC_FT_SetCMapForCharCode"]=function(){return Module["asm"]["M"].apply(null,arguments)};var _ASC_FT_Set_Transform=Module["_ASC_FT_Set_Transform"]=function(){return Module["asm"]["N"].apply(null,arguments)};var _ASC_FT_Set_TrueType_HintProp=Module["_ASC_FT_Set_TrueType_HintProp"]=function(){return Module["asm"]["O"].apply(null, var _ASC_FT_Malloc=Module["_ASC_FT_Malloc"]=function(){return Module["asm"]["K"].apply(null,arguments)};var _ASC_FT_Open_Face=Module["_ASC_FT_Open_Face"]=function(){return Module["asm"]["L"].apply(null,arguments)};var _ASC_FT_SetCMapForCharCode=Module["_ASC_FT_SetCMapForCharCode"]=function(){return Module["asm"]["M"].apply(null,arguments)};var _ASC_FT_Set_Transform=Module["_ASC_FT_Set_Transform"]=function(){return Module["asm"]["N"].apply(null,arguments)};var _ASC_FT_Set_TrueType_HintProp=Module["_ASC_FT_Set_TrueType_HintProp"]=
arguments)};var _FT_Done_Face=Module["_FT_Done_Face"]=function(){return Module["asm"]["P"].apply(null,arguments)};var _FT_Done_FreeType=Module["_FT_Done_FreeType"]=function(){return Module["asm"]["Q"].apply(null,arguments)};var _FT_Get_Glyph=Module["_FT_Get_Glyph"]=function(){return Module["asm"]["R"].apply(null,arguments)};var _FT_Load_Glyph=Module["_FT_Load_Glyph"]=function(){return Module["asm"]["S"].apply(null,arguments)};var _FT_Set_Char_Size=Module["_FT_Set_Char_Size"]=function(){return Module["asm"]["T"].apply(null, function(){return Module["asm"]["O"].apply(null,arguments)};var _FT_Done_Face=Module["_FT_Done_Face"]=function(){return Module["asm"]["P"].apply(null,arguments)};var _FT_Done_FreeType=Module["_FT_Done_FreeType"]=function(){return Module["asm"]["Q"].apply(null,arguments)};var _FT_Get_Glyph=Module["_FT_Get_Glyph"]=function(){return Module["asm"]["R"].apply(null,arguments)};var _FT_Load_Glyph=Module["_FT_Load_Glyph"]=function(){return Module["asm"]["S"].apply(null,arguments)};var _FT_Set_Char_Size=Module["_FT_Set_Char_Size"]=
arguments)};var _FT_Set_Transform=Module["_FT_Set_Transform"]=function(){return Module["asm"]["U"].apply(null,arguments)};var ___emscripten_environ_constructor=Module["___emscripten_environ_constructor"]=function(){return Module["asm"]["V"].apply(null,arguments)};var _free=Module["_free"]=function(){return Module["asm"]["W"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return Module["asm"]["X"].apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return Module["asm"]["Y"].apply(null, function(){return Module["asm"]["T"].apply(null,arguments)};var _FT_Set_Transform=Module["_FT_Set_Transform"]=function(){return Module["asm"]["U"].apply(null,arguments)};var ___emscripten_environ_constructor=Module["___emscripten_environ_constructor"]=function(){return Module["asm"]["V"].apply(null,arguments)};var _free=Module["_free"]=function(){return Module["asm"]["W"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return Module["asm"]["X"].apply(null,arguments)};var _setThrew=
arguments)};var stackRestore=Module["stackRestore"]=function(){return Module["asm"]["da"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return Module["asm"]["ea"].apply(null,arguments)};var dynCall_iii=Module["dynCall_iii"]=function(){return Module["asm"]["Z"].apply(null,arguments)};var dynCall_iiii=Module["dynCall_iiii"]=function(){return Module["asm"]["_"].apply(null,arguments)};var dynCall_iiiii=Module["dynCall_iiiii"]=function(){return Module["asm"]["$"].apply(null,arguments)}; Module["_setThrew"]=function(){return Module["asm"]["Y"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return Module["asm"]["da"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return Module["asm"]["ea"].apply(null,arguments)};var dynCall_iii=Module["dynCall_iii"]=function(){return Module["asm"]["Z"].apply(null,arguments)};var dynCall_iiii=Module["dynCall_iiii"]=function(){return Module["asm"]["_"].apply(null,arguments)};var dynCall_iiiii=Module["dynCall_iiiii"]=
var dynCall_vi=Module["dynCall_vi"]=function(){return Module["asm"]["aa"].apply(null,arguments)};var dynCall_vii=Module["dynCall_vii"]=function(){return Module["asm"]["ba"].apply(null,arguments)};var dynCall_viiii=Module["dynCall_viiii"]=function(){return Module["asm"]["ca"].apply(null,arguments)};Module["asm"]=asm;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor= function(){return Module["asm"]["$"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){return Module["asm"]["aa"].apply(null,arguments)};var dynCall_vii=Module["dynCall_vii"]=function(){return Module["asm"]["ba"].apply(null,arguments)};var dynCall_viiii=Module["dynCall_viiii"]=function(){return Module["asm"]["ca"].apply(null,arguments)};Module["asm"]=asm;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}
ExitStatus;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};function run(args){args=args||Module["arguments"];if(runDependencies>0)return;preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running..."); ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};function run(args){args=args||Module["arguments"];if(runDependencies>0)return;preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();
setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else doRun()}Module["run"]=run;function abort(what){if(Module["onAbort"])Module["onAbort"](what);if(what!==undefined){out(what);err(what);what=JSON.stringify(what)}else what="";ABORT=true;EXITSTATUS=1;throw"abort("+what+"). Build with -s ASSERTIONS=1 for more info.";}Module["abort"]=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length> postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else doRun()}Module["run"]=run;function abort(what){if(Module["onAbort"])Module["onAbort"](what);if(what!==undefined){out(what);err(what);what=JSON.stringify(what)}else what="";ABORT=true;EXITSTATUS=1;throw"abort("+what+"). Build with -s ASSERTIONS=1 for more info.";}Module["abort"]=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=
0)Module["preInit"].pop()()}Module["noExitRuntime"]=true;run();window["AscFonts"]=window["AscFonts"]||{};var AscFonts=window["AscFonts"];AscFonts.CreateLibrary=function(){return Module["_ASC_FT_Init"]()};AscFonts.TT_INTERPRETER_VERSION_35=35;AscFonts.TT_INTERPRETER_VERSION_38=38;AscFonts.TT_INTERPRETER_VERSION_40=40;AscFonts.FT_Set_TrueType_HintProp=function(library,tt_interpreter){return Module["_ASC_FT_Set_TrueType_HintProp"](library,tt_interpreter)};AscFonts.CreateNativeStream=function(_typed_array){var _fontStreamPointer= [Module["preInit"]];while(Module["preInit"].length>0)Module["preInit"].pop()()}Module["noExitRuntime"]=true;run();window["AscFonts"]=window["AscFonts"]||{};var AscFonts=window["AscFonts"];AscFonts.CreateLibrary=function(){return Module["_ASC_FT_Init"]()};AscFonts.TT_INTERPRETER_VERSION_35=35;AscFonts.TT_INTERPRETER_VERSION_38=38;AscFonts.TT_INTERPRETER_VERSION_40=40;AscFonts.FT_Set_TrueType_HintProp=function(library,tt_interpreter){return Module["_ASC_FT_Set_TrueType_HintProp"](library,tt_interpreter)};
Module["_ASC_FT_Malloc"](_typed_array.size);Module["HEAP8"].set(_typed_array.data,_fontStreamPointer);return{asc_marker:true,data:_fontStreamPointer,len:_typed_array.size}};AscFonts.CreateNativeStreamByIndex=function(stream_index){var _stream_pos=AscFonts.g_fonts_streams[stream_index];if(_stream_pos&&true!==_stream_pos.asc_marker){var _native_stream=AscFonts.CreateNativeStream(AscFonts.g_fonts_streams[stream_index]);AscFonts.g_fonts_streams[stream_index]=null;AscFonts.g_fonts_streams[stream_index]= AscFonts.CreateNativeStream=function(_typed_array){var _fontStreamPointer=Module["_ASC_FT_Malloc"](_typed_array.size);Module["HEAP8"].set(_typed_array.data,_fontStreamPointer);return{asc_marker:true,data:_fontStreamPointer,len:_typed_array.size}};AscFonts.CreateNativeStreamByIndex=function(stream_index){var _stream_pos=AscFonts.g_fonts_streams[stream_index];if(_stream_pos&&true!==_stream_pos.asc_marker){var _native_stream=AscFonts.CreateNativeStream(AscFonts.g_fonts_streams[stream_index]);AscFonts.g_fonts_streams[stream_index]=
_native_stream}};function CFaceInfo(){this.units_per_EM=0;this.ascender=0;this.descender=0;this.height=0;this.face_flags=0;this.num_faces=0;this.num_glyphs=0;this.num_charmaps=0;this.style_flags=0;this.face_index=0;this.family_name="";this.style_name="";this.os2_version=0;this.os2_usWeightClass=0;this.os2_fsSelection=0;this.os2_usWinAscent=0;this.os2_usWinDescent=0;this.os2_usDefaultChar=0;this.os2_sTypoAscender=0;this.os2_sTypoDescender=0;this.os2_sTypoLineGap=0;this.os2_ulUnicodeRange1=0;this.os2_ulUnicodeRange2= null;AscFonts.g_fonts_streams[stream_index]=_native_stream}};function CFaceInfo(){this.units_per_EM=0;this.ascender=0;this.descender=0;this.height=0;this.face_flags=0;this.num_faces=0;this.num_glyphs=0;this.num_charmaps=0;this.style_flags=0;this.face_index=0;this.family_name="";this.style_name="";this.os2_version=0;this.os2_usWeightClass=0;this.os2_fsSelection=0;this.os2_usWinAscent=0;this.os2_usWinDescent=0;this.os2_usDefaultChar=0;this.os2_sTypoAscender=0;this.os2_sTypoDescender=0;this.os2_sTypoLineGap=
0;this.os2_ulUnicodeRange3=0;this.os2_ulUnicodeRange4=0;this.os2_ulCodePageRange1=0;this.os2_ulCodePageRange2=0;this.os2_nSymbolic=0;this.header_yMin=0;this.header_yMax=0;this.monochromeSizes=[]}CFaceInfo.prototype.load=function(face){var _bufferPtr=Module["_ASC_FT_GetFaceInfo"](face);if(!_bufferPtr)return;var _len_buffer=Math.min(Module["HEAP8"].length-_bufferPtr>>2,250);var _buffer=new Int32Array(Module["HEAP8"].buffer,_bufferPtr,_len_buffer);var _index=0;this.units_per_EM=Math.abs(_buffer[_index++]); 0;this.os2_ulUnicodeRange1=0;this.os2_ulUnicodeRange2=0;this.os2_ulUnicodeRange3=0;this.os2_ulUnicodeRange4=0;this.os2_ulCodePageRange1=0;this.os2_ulCodePageRange2=0;this.os2_nSymbolic=0;this.header_yMin=0;this.header_yMax=0;this.monochromeSizes=[]}CFaceInfo.prototype.load=function(face){var _bufferPtr=Module["_ASC_FT_GetFaceInfo"](face);if(!_bufferPtr)return;var _len_buffer=Math.min(Module["HEAP8"].length-_bufferPtr>>2,250);var _buffer=new Int32Array(Module["HEAP8"].buffer,_bufferPtr,_len_buffer);
this.ascender=_buffer[_index++];this.descender=_buffer[_index++];this.height=_buffer[_index++];this.face_flags=_buffer[_index++];this.num_faces=_buffer[_index++];this.num_glyphs=_buffer[_index++];this.num_charmaps=_buffer[_index++];this.style_flags=_buffer[_index++];this.face_index=_buffer[_index++];var c=_buffer[_index++];while(c){this.family_name+=String.fromCharCode(c);c=_buffer[_index++]}c=_buffer[_index++];while(c){this.style_name+=String.fromCharCode(c);c=_buffer[_index++]}this.os2_version= var _index=0;this.units_per_EM=Math.abs(_buffer[_index++]);this.ascender=_buffer[_index++];this.descender=_buffer[_index++];this.height=_buffer[_index++];this.face_flags=_buffer[_index++];this.num_faces=_buffer[_index++];this.num_glyphs=_buffer[_index++];this.num_charmaps=_buffer[_index++];this.style_flags=_buffer[_index++];this.face_index=_buffer[_index++];var c=_buffer[_index++];while(c){this.family_name+=String.fromCharCode(c);c=_buffer[_index++]}c=_buffer[_index++];while(c){this.style_name+=String.fromCharCode(c);
_buffer[_index++];this.os2_usWeightClass=_buffer[_index++];this.os2_fsSelection=_buffer[_index++];this.os2_usWinAscent=_buffer[_index++];this.os2_usWinDescent=_buffer[_index++];this.os2_usDefaultChar=_buffer[_index++];this.os2_sTypoAscender=_buffer[_index++];this.os2_sTypoDescender=_buffer[_index++];this.os2_sTypoLineGap=_buffer[_index++];this.os2_ulUnicodeRange1=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulUnicodeRange2=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulUnicodeRange3= c=_buffer[_index++]}this.os2_version=_buffer[_index++];this.os2_usWeightClass=_buffer[_index++];this.os2_fsSelection=_buffer[_index++];this.os2_usWinAscent=_buffer[_index++];this.os2_usWinDescent=_buffer[_index++];this.os2_usDefaultChar=_buffer[_index++];this.os2_sTypoAscender=_buffer[_index++];this.os2_sTypoDescender=_buffer[_index++];this.os2_sTypoLineGap=_buffer[_index++];this.os2_ulUnicodeRange1=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulUnicodeRange2=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);
AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulUnicodeRange4=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulCodePageRange1=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulCodePageRange2=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_nSymbolic=_buffer[_index++];this.header_yMin=_buffer[_index++];this.header_yMax=_buffer[_index++];var fixedSizesCount=_buffer[_index++];for(var i=0;i<fixedSizesCount;i++)this.monochromeSizes.push(_buffer[_index++]);Module["_ASC_FT_Free"](_bufferPtr)}; this.os2_ulUnicodeRange3=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulUnicodeRange4=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulCodePageRange1=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulCodePageRange2=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_nSymbolic=_buffer[_index++];this.header_yMin=_buffer[_index++];this.header_yMax=_buffer[_index++];var fixedSizesCount=_buffer[_index++];for(var i=0;i<fixedSizesCount;i++)this.monochromeSizes.push(_buffer[_index++]);
function CGlyphMetrics(){this.bbox_xMin=0;this.bbox_yMin=0;this.bbox_xMax=0;this.bbox_yMax=0;this.width=0;this.height=0;this.horiAdvance=0;this.horiBearingX=0;this.horiBearingY=0;this.vertAdvance=0;this.vertBearingX=0;this.vertBearingY=0;this.linearHoriAdvance=0;this.linearVertAdvance=0}function CGlyphBitmapImage(){this.left=0;this.top=0;this.width=0;this.rows=0;this.pitch=0;this.mode=0}AscFonts.CFaceInfo=CFaceInfo;AscFonts.CGlyphMetrics=CGlyphMetrics;AscFonts.CGlyphBitmapImage=CGlyphBitmapImage; Module["_ASC_FT_Free"](_bufferPtr)};function CGlyphMetrics(){this.bbox_xMin=0;this.bbox_yMin=0;this.bbox_xMax=0;this.bbox_yMax=0;this.width=0;this.height=0;this.horiAdvance=0;this.horiBearingX=0;this.horiBearingY=0;this.vertAdvance=0;this.vertBearingX=0;this.vertBearingY=0;this.linearHoriAdvance=0;this.linearVertAdvance=0}function CGlyphBitmapImage(){this.left=0;this.top=0;this.width=0;this.rows=0;this.pitch=0;this.mode=0}AscFonts.CFaceInfo=CFaceInfo;AscFonts.CGlyphMetrics=CGlyphMetrics;AscFonts.CGlyphBitmapImage=
AscFonts.FT_Open_Face=function(library,stream,face_index){return Module["_ASC_FT_Open_Face"](library,stream.data,stream.len,face_index)};AscFonts.FT_Glyph_Get_Measure=function(face,vector_worker,painter){var _bufferPtr=Module["_ASC_FT_Get_Glyph_Measure_Params"](face,vector_worker?1:0);if(!_bufferPtr)return null;var _len=15;if(vector_worker)_len=Module["HEAP32"][_bufferPtr>>2];var _buffer=new Int32Array(Module["HEAP8"].buffer,_bufferPtr,4*_len);var _info=new CGlyphMetrics;_info.bbox_xMin=_buffer[1]; CGlyphBitmapImage;AscFonts.FT_Open_Face=function(library,stream,face_index){return Module["_ASC_FT_Open_Face"](library,stream.data,stream.len,face_index)};AscFonts.FT_Glyph_Get_Measure=function(face,vector_worker,painter){var _bufferPtr=Module["_ASC_FT_Get_Glyph_Measure_Params"](face,vector_worker?1:0);if(!_bufferPtr)return null;var _len=15;if(vector_worker)_len=Module["HEAP32"][_bufferPtr>>2];var _buffer=new Int32Array(Module["HEAP8"].buffer,_bufferPtr,4*_len);var _info=new CGlyphMetrics;_info.bbox_xMin=
_info.bbox_yMin=_buffer[2];_info.bbox_xMax=_buffer[3];_info.bbox_yMax=_buffer[4];_info.width=_buffer[5];_info.height=_buffer[6];_info.horiAdvance=_buffer[7];_info.horiBearingX=_buffer[8];_info.horiBearingY=_buffer[9];_info.vertAdvance=_buffer[10];_info.vertBearingX=_buffer[11];_info.vertBearingY=_buffer[12];_info.linearHoriAdvance=_buffer[13];_info.linearVertAdvance=_buffer[14];if(vector_worker){painter.start(vector_worker);var _pos=15;while(_pos<_len)switch(_buffer[_pos++]){case 0:{painter._move_to(_buffer[_pos++], _buffer[1];_info.bbox_yMin=_buffer[2];_info.bbox_xMax=_buffer[3];_info.bbox_yMax=_buffer[4];_info.width=_buffer[5];_info.height=_buffer[6];_info.horiAdvance=_buffer[7];_info.horiBearingX=_buffer[8];_info.horiBearingY=_buffer[9];_info.vertAdvance=_buffer[10];_info.vertBearingX=_buffer[11];_info.vertBearingY=_buffer[12];_info.linearHoriAdvance=_buffer[13];_info.linearVertAdvance=_buffer[14];if(vector_worker){painter.start(vector_worker);var _pos=15;while(_pos<_len)switch(_buffer[_pos++]){case 0:{painter._move_to(_buffer[_pos++],
_buffer[_pos++],vector_worker);break}case 1:{painter._line_to(_buffer[_pos++],_buffer[_pos++],vector_worker);break}case 2:{painter._conic_to(_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],vector_worker);break}case 3:{painter._cubic_to(_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],vector_worker);break}default:break}painter.end(vector_worker)}Module["_ASC_FT_Free"](_bufferPtr);_buffer=null;return _info};AscFonts.FT_Glyph_Get_Raster= _buffer[_pos++],vector_worker);break}case 1:{painter._line_to(_buffer[_pos++],_buffer[_pos++],vector_worker);break}case 2:{painter._conic_to(_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],vector_worker);break}case 3:{painter._cubic_to(_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],vector_worker);break}default:break}painter.end(vector_worker)}Module["_ASC_FT_Free"](_bufferPtr);_buffer=null;return _info};AscFonts.FT_Glyph_Get_Raster=
function(face,render_mode){var _bufferPtr=Module["_ASC_FT_Get_Glyph_Render_Params"](face,render_mode);if(!_bufferPtr)return null;var _buffer=new Int32Array(Module["HEAP8"].buffer,_bufferPtr,24);var _info=new CGlyphBitmapImage;_info.left=_buffer[0];_info.top=_buffer[1];_info.width=_buffer[2];_info.rows=_buffer[3];_info.pitch=_buffer[4];_info.mode=_buffer[5];Module["_ASC_FT_Free"](_bufferPtr);return _info};AscFonts.FT_Load_Glyph=Module["_FT_Load_Glyph"];AscFonts.FT_Set_Transform=Module["_ASC_FT_Set_Transform"]; function(face,render_mode){var _bufferPtr=Module["_ASC_FT_Get_Glyph_Render_Params"](face,render_mode);if(!_bufferPtr)return null;var _buffer=new Int32Array(Module["HEAP8"].buffer,_bufferPtr,24);var _info=new CGlyphBitmapImage;_info.left=_buffer[0];_info.top=_buffer[1];_info.width=_buffer[2];_info.rows=_buffer[3];_info.pitch=_buffer[4];_info.mode=_buffer[5];Module["_ASC_FT_Free"](_bufferPtr);return _info};AscFonts.FT_Load_Glyph=Module["_FT_Load_Glyph"];AscFonts.FT_Set_Transform=Module["_ASC_FT_Set_Transform"];
AscFonts.FT_Set_Char_Size=Module["_FT_Set_Char_Size"];AscFonts.FT_SetCMapForCharCode=Module["_ASC_FT_SetCMapForCharCode"];AscFonts.FT_GetKerningX=Module["_ASC_FT_GetKerningX"];AscFonts.FT_GetFaceMaxAdvanceX=Module["_ASC_FT_GetFaceMaxAdvanceX"];AscFonts.FT_Get_Glyph_Render_Buffer=function(face,rasterInfo,isCopyToRasterMemory){var _bufferPtr=Module["_ASC_FT_Get_Glyph_Render_Buffer"](face);var tmp=new Uint8Array(Module["HEAP8"].buffer,_bufferPtr,rasterInfo.pitch*rasterInfo.rows);if(!isCopyToRasterMemory)return tmp; AscFonts.FT_Set_Char_Size=Module["_FT_Set_Char_Size"];AscFonts.FT_SetCMapForCharCode=Module["_ASC_FT_SetCMapForCharCode"];AscFonts.FT_GetKerningX=Module["_ASC_FT_GetKerningX"];AscFonts.FT_GetFaceMaxAdvanceX=Module["_ASC_FT_GetFaceMaxAdvanceX"];AscFonts.FT_Get_Glyph_Render_Buffer=function(face,rasterInfo,isCopyToRasterMemory){var _bufferPtr=Module["_ASC_FT_Get_Glyph_Render_Buffer"](face);var tmp=new Uint8Array(Module["HEAP8"].buffer,_bufferPtr,rasterInfo.pitch*rasterInfo.rows);if(!isCopyToRasterMemory)return tmp;

@ -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* 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= 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(); {"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(); 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;
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]= _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_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; 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,
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; 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,
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, _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;
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, 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,
_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&& 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<=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&&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||
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"); 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=
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; 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.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")); 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();
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= 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,
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()})}; 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);
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; 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=
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= _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=
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= _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);
"";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}; 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,
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"](): 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"]&&
"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; 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;
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, 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],
_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, 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.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"]? 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,
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= _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,
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, 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!==
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", 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});
"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= 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"];
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== 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=
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, 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,
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= 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=
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- 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=
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(); 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};
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.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-
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=== 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 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>"+ 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>"+
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= 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=
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= 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;
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? 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._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= 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=
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< 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=
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= 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!==
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"&& "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=
!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= 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;
":";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); 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=
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= 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;
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= 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=
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= 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=
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= 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=
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; 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=
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= 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;
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= 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;
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"]= 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;
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["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); 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)}; _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; 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"].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; 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+ 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: "/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<
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= 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=
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, 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_oAscCollaborativeMarksShowType={All:0,LastChanges:1};var c_oAscVertAlignJc={Top:0,Center:1,Bottom:2};var c_oAscAlignType={LEFT:0,CENTER:1,RIGHT:2,JUSTIFY:3,TOP:4,MIDDLE:5,BOTTOM:6};var c_oAscContextMenuTypes={Main:0,Thumbnails:1};var THEME_THUMBNAIL_WIDTH=180;var THEME_THUMBNAIL_HEIGHT=135;var LAYOUT_THUMBNAIL_WIDTH=180; this.height)}}}window["AscFonts"].raster_memory=new CRasterMemory})(window,undefined);"use strict";var c_oAscZoomType={Current:0,FitWidth:1,FitPage:2};var c_oAscCollaborativeMarksShowType={All:0,LastChanges:1};var c_oAscVertAlignJc={Top:0,Center:1,Bottom:2};var c_oAscAlignType={LEFT:0,CENTER:1,RIGHT:2,JUSTIFY:3,TOP:4,MIDDLE:5,BOTTOM:6};var c_oAscContextMenuTypes={Main:0,Thumbnails:1};var THEME_THUMBNAIL_WIDTH=180;var THEME_THUMBNAIL_HEIGHT=135;var LAYOUT_THUMBNAIL_WIDTH=180;
var LAYOUT_THUMBNAIL_HEIGHT=135;var c_oAscTableSelectionType={Cell:0,Row:1,Column:2,Table:3};var c_oAscAlignShapeType={ALIGN_LEFT:0,ALIGN_RIGHT:1,ALIGN_TOP:2,ALIGN_BOTTOM:3,ALIGN_CENTER:4,ALIGN_MIDDLE:5};var c_oAscTableLayout={AutoFit:0,Fixed:1};var c_oAscSlideTransitionTypes={None:0,Fade:1,Push:2,Wipe:3,Split:4,UnCover:5,Cover:6,Clock:7,Zoom:8}; var LAYOUT_THUMBNAIL_HEIGHT=135;var c_oAscTableSelectionType={Cell:0,Row:1,Column:2,Table:3};var c_oAscAlignShapeType={ALIGN_LEFT:0,ALIGN_RIGHT:1,ALIGN_TOP:2,ALIGN_BOTTOM:3,ALIGN_CENTER:4,ALIGN_MIDDLE:5};var c_oAscTableLayout={AutoFit:0,Fixed:1};var c_oAscSlideTransitionTypes={None:0,Fade:1,Push:2,Wipe:3,Split:4,UnCover:5,Cover:6,Clock:7,Zoom:8};
var c_oAscSlideTransitionParams={Fade_Smoothly:0,Fade_Through_Black:1,Param_Left:0,Param_Top:1,Param_Right:2,Param_Bottom:3,Param_TopLeft:4,Param_TopRight:5,Param_BottomLeft:6,Param_BottomRight:7,Split_VerticalIn:8,Split_VerticalOut:9,Split_HorizontalIn:10,Split_HorizontalOut:11,Clock_Clockwise:0,Clock_Counterclockwise:1,Clock_Wedge:2,Zoom_In:0,Zoom_Out:1,Zoom_AndRotate:2};var c_oAscLockTypeElemPresentation={Object:1,Slide:2,Presentation:3};var c_oSerFormat={Version:1,Signature:"PPTY"}; var c_oAscSlideTransitionParams={Fade_Smoothly:0,Fade_Through_Black:1,Param_Left:0,Param_Top:1,Param_Right:2,Param_Bottom:3,Param_TopLeft:4,Param_TopRight:5,Param_BottomLeft:6,Param_BottomRight:7,Split_VerticalIn:8,Split_VerticalOut:9,Split_HorizontalIn:10,Split_HorizontalOut:11,Clock_Clockwise:0,Clock_Counterclockwise:1,Clock_Wedge:2,Zoom_In:0,Zoom_Out:1,Zoom_AndRotate:2};var c_oAscLockTypeElemPresentation={Object:1,Slide:2,Presentation:3};var c_oSerFormat={Version:1,Signature:"PPTY"};

@ -8070,8 +8070,8 @@ code>>24&63);result.push(128|code>>18&63);result.push(128|code>>12&63);result.pu
5;while(bitCount>=8){var _del=Math.pow(2,bitCount-8);var _res=buffer/_del&255;result.push(_res);bitCount-=8}}this.GetUTF16_fromUTF8(result)};this.CreateIndexByOctetAndMovePosition=function(obj,currentPosition){var j=0;while(j<8){if(currentPosition>=obj.data.length){obj.index[j++]=-1;continue}if(this.IgnoredSymbol(obj.data.charCodeAt(currentPosition))){currentPosition++;continue}obj.index[j]=obj.data[currentPosition];j++;currentPosition++}return currentPosition};this.IgnoredSymbol=function(checkedSymbol){return checkedSymbol>= 5;while(bitCount>=8){var _del=Math.pow(2,bitCount-8);var _res=buffer/_del&255;result.push(_res);bitCount-=8}}this.GetUTF16_fromUTF8(result)};this.CreateIndexByOctetAndMovePosition=function(obj,currentPosition){var j=0;while(j<8){if(currentPosition>=obj.data.length){obj.index[j++]=-1;continue}if(this.IgnoredSymbol(obj.data.charCodeAt(currentPosition))){currentPosition++;continue}obj.index[j]=obj.data[currentPosition];j++;currentPosition++}return currentPosition};this.IgnoredSymbol=function(checkedSymbol){return checkedSymbol>=
128||this.DecodingTable[checkedSymbol]==255}}var bIsLocalFontsUse=false;function _is_support_cors(){if(window["NATIVE_EDITOR_ENJINE"]===true)return false;var xhrSupported=new XMLHttpRequest;return!!xhrSupported&&"withCredentials"in xhrSupported}var bIsSupportOriginalFormatFonts=_is_support_cors();function postLoadScript(scriptName){window.postMessage({type:"FROM_PAGE_LOAD_SCRIPT",text:scriptName},"*")}function CFontFileLoader(id){this.LoadingCounter=0;this.Id=id;this.Status=-1;this.stream_index=-1; 128||this.DecodingTable[checkedSymbol]==255}}var bIsLocalFontsUse=false;function _is_support_cors(){if(window["NATIVE_EDITOR_ENJINE"]===true)return false;var xhrSupported=new XMLHttpRequest;return!!xhrSupported&&"withCredentials"in xhrSupported}var bIsSupportOriginalFormatFonts=_is_support_cors();function postLoadScript(scriptName){window.postMessage({type:"FROM_PAGE_LOAD_SCRIPT",text:scriptName},"*")}function CFontFileLoader(id){this.LoadingCounter=0;this.Id=id;this.Status=-1;this.stream_index=-1;
this.callback=null;this.IsNeedAddJSToFontPath=true;this.CanUseOriginalFormat=true;var oThis=this;this.CheckLoaded=function(){return 0==this.Status||1==this.Status};this._callback_font_load=function(){if(!window[oThis.Id]){oThis.LoadingCounter++;if(oThis.LoadingCounter<oThis.GetMaxLoadingCount()){oThis.Status=-1;return}oThis.Status=2;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;_editor.sendEvent("asc_onError",Asc.c_oAscError.ID.CoAuthoringDisconnect,Asc.c_oAscError.Level.Critical); this.callback=null;this.IsNeedAddJSToFontPath=true;this.CanUseOriginalFormat=true;var oThis=this;this.CheckLoaded=function(){return 0==this.Status||1==this.Status};this._callback_font_load=function(){if(!window[oThis.Id]){oThis.LoadingCounter++;if(oThis.LoadingCounter<oThis.GetMaxLoadingCount()){oThis.Status=-1;return}oThis.Status=2;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;_editor.sendEvent("asc_onError",Asc.c_oAscError.ID.CoAuthoringDisconnect,Asc.c_oAscError.Level.Critical);
return}var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=AscFonts.CreateFontData4(window[oThis.Id]);oThis.SetStreamIndex(__font_data_idx);oThis.Status=0;delete window[oThis.Id];if(null!=oThis.callback)oThis.callback()};this.LoadFontAsync2=function(basePath,_callback){this.callback=_callback;if(-1!=this.Status)return true;if(bIsLocalFontsUse){postLoadScript(this.Id);return}this.Status=2;var xhr=new XMLHttpRequest;xhr.open("GET",basePath+this.Id,true);if(typeof ArrayBuffer!== return}var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=AscFonts.CreateFontData4(window[oThis.Id]);oThis.SetStreamIndex(__font_data_idx);oThis.Status=0;delete window[oThis.Id];if(null!=oThis.callback)oThis.callback()};this.LoadFontAsync2=function(basePath,_callback){this.callback=_callback;if(-1!=this.Status)return true;if(bIsLocalFontsUse){postLoadScript(this.Id);return}this.Status=2;var xhr=new XMLHttpRequest;xhr.open("GET",basePath+this.Id+"?"+window.CP_urlArgs,true);
"undefined"&&!window.opera)xhr.responseType="arraybuffer";if(xhr.overrideMimeType)xhr.overrideMimeType("text/plain; charset=x-user-defined");else xhr.setRequestHeader("Accept-Charset","x-user-defined");xhr.onload=function(){if(this.status!=200){oThis.LoadingCounter++;if(oThis.LoadingCounter<oThis.GetMaxLoadingCount()){oThis.Status=-1;return}oThis.Status=2;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;_editor.sendEvent("asc_onError",Asc.c_oAscError.ID.CoAuthoringDisconnect, if(typeof ArrayBuffer!=="undefined"&&!window.opera)xhr.responseType="arraybuffer";if(xhr.overrideMimeType)xhr.overrideMimeType("text/plain; charset=x-user-defined");else xhr.setRequestHeader("Accept-Charset","x-user-defined");xhr.onload=function(){if(this.status!=200){oThis.LoadingCounter++;if(oThis.LoadingCounter<oThis.GetMaxLoadingCount()){oThis.Status=-1;return}oThis.Status=2;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;_editor.sendEvent("asc_onError",Asc.c_oAscError.ID.CoAuthoringDisconnect,
Asc.c_oAscError.Level.Critical);return}oThis.Status=0;if(typeof ArrayBuffer!=="undefined"&&!window.opera&&this.response){var __font_data_idx=g_fonts_streams.length;var _uintData=new Uint8Array(this.response);g_fonts_streams[__font_data_idx]=new AscFonts.FontStream(_uintData,_uintData.length);oThis.SetStreamIndex(__font_data_idx)}else if(AscCommon.AscBrowser.isIE){var _response=(new VBArray(this["responseBody"])).toArray();var srcLen=_response.length;var stream=new AscFonts.FontStream(AscFonts.allocate(srcLen), Asc.c_oAscError.Level.Critical);return}oThis.Status=0;if(typeof ArrayBuffer!=="undefined"&&!window.opera&&this.response){var __font_data_idx=g_fonts_streams.length;var _uintData=new Uint8Array(this.response);g_fonts_streams[__font_data_idx]=new AscFonts.FontStream(_uintData,_uintData.length);oThis.SetStreamIndex(__font_data_idx)}else if(AscCommon.AscBrowser.isIE){var _response=(new VBArray(this["responseBody"])).toArray();var srcLen=_response.length;var stream=new AscFonts.FontStream(AscFonts.allocate(srcLen),
srcLen);var dstPx=stream.data;var index=0;while(index<srcLen){dstPx[index]=_response[index];index++}var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=stream;oThis.SetStreamIndex(__font_data_idx)}else{var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=AscFonts.CreateFontData3(this.responseText);oThis.SetStreamIndex(__font_data_idx)}var guidOdttf=[160,102,214,32,20,150,71,250,149,105,184,80,176,65,73,72];var _stream=g_fonts_streams[g_fonts_streams.length- srcLen);var dstPx=stream.data;var index=0;while(index<srcLen){dstPx[index]=_response[index];index++}var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=stream;oThis.SetStreamIndex(__font_data_idx)}else{var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=AscFonts.CreateFontData3(this.responseText);oThis.SetStreamIndex(__font_data_idx)}var guidOdttf=[160,102,214,32,20,150,71,250,149,105,184,80,176,65,73,72];var _stream=g_fonts_streams[g_fonts_streams.length-
1];var _data=_stream.data};xhr.send(null)};this.LoadFontNative=function(){if(window["use_native_fonts_only"]===true){this.Status=0;return}var __font_data_idx=g_fonts_streams.length;var _data=window["native"]["GetFontBinary"](this.Id);g_fonts_streams[__font_data_idx]=new AscFonts.FontStream(_data,_data.length);this.SetStreamIndex(__font_data_idx);this.Status=0}}CFontFileLoader.prototype.GetMaxLoadingCount=function(){return 3};CFontFileLoader.prototype.SetStreamIndex=function(index){this.stream_index= 1];var _data=_stream.data};xhr.send(null)};this.LoadFontNative=function(){if(window["use_native_fonts_only"]===true){this.Status=0;return}var __font_data_idx=g_fonts_streams.length;var _data=window["native"]["GetFontBinary"](this.Id);g_fonts_streams[__font_data_idx]=new AscFonts.FontStream(_data,_data.length);this.SetStreamIndex(__font_data_idx);this.Status=0}}CFontFileLoader.prototype.GetMaxLoadingCount=function(){return 3};CFontFileLoader.prototype.SetStreamIndex=function(index){this.stream_index=

@ -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* 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= 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(); {"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(); 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;
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]= _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_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; 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,
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; 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,
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, _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;
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, 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,
_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&& 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<=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&&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||
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"); 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=
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; 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.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")); 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();
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= 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,
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()})}; 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);
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; 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=
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= _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=
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= _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);
"";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}; 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,
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"](): 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"]&&
"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; 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;
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, 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],
_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, 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.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"]? 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,
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= _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,
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, 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!==
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", 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});
"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= 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"];
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== 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=
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, 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,
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= 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=
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- 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=
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(); 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};
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.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-
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=== 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 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>"+ 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>"+
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= 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=
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= 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;
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? 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._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= 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=
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< 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=
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= 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!==
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"&& "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=
!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= 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;
":";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); 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=
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= 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;
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= 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=
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= 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=
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= 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=
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; 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=
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= 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;
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= 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;
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"]= 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;
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["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); 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)}; _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; 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"].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; 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+ 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: "/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<
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= 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=
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, 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}; 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 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}; 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};

@ -8039,8 +8039,8 @@ code>>24&63);result.push(128|code>>18&63);result.push(128|code>>12&63);result.pu
5;while(bitCount>=8){var _del=Math.pow(2,bitCount-8);var _res=buffer/_del&255;result.push(_res);bitCount-=8}}this.GetUTF16_fromUTF8(result)};this.CreateIndexByOctetAndMovePosition=function(obj,currentPosition){var j=0;while(j<8){if(currentPosition>=obj.data.length){obj.index[j++]=-1;continue}if(this.IgnoredSymbol(obj.data.charCodeAt(currentPosition))){currentPosition++;continue}obj.index[j]=obj.data[currentPosition];j++;currentPosition++}return currentPosition};this.IgnoredSymbol=function(checkedSymbol){return checkedSymbol>= 5;while(bitCount>=8){var _del=Math.pow(2,bitCount-8);var _res=buffer/_del&255;result.push(_res);bitCount-=8}}this.GetUTF16_fromUTF8(result)};this.CreateIndexByOctetAndMovePosition=function(obj,currentPosition){var j=0;while(j<8){if(currentPosition>=obj.data.length){obj.index[j++]=-1;continue}if(this.IgnoredSymbol(obj.data.charCodeAt(currentPosition))){currentPosition++;continue}obj.index[j]=obj.data[currentPosition];j++;currentPosition++}return currentPosition};this.IgnoredSymbol=function(checkedSymbol){return checkedSymbol>=
128||this.DecodingTable[checkedSymbol]==255}}var bIsLocalFontsUse=false;function _is_support_cors(){if(window["NATIVE_EDITOR_ENJINE"]===true)return false;var xhrSupported=new XMLHttpRequest;return!!xhrSupported&&"withCredentials"in xhrSupported}var bIsSupportOriginalFormatFonts=_is_support_cors();function postLoadScript(scriptName){window.postMessage({type:"FROM_PAGE_LOAD_SCRIPT",text:scriptName},"*")}function CFontFileLoader(id){this.LoadingCounter=0;this.Id=id;this.Status=-1;this.stream_index=-1; 128||this.DecodingTable[checkedSymbol]==255}}var bIsLocalFontsUse=false;function _is_support_cors(){if(window["NATIVE_EDITOR_ENJINE"]===true)return false;var xhrSupported=new XMLHttpRequest;return!!xhrSupported&&"withCredentials"in xhrSupported}var bIsSupportOriginalFormatFonts=_is_support_cors();function postLoadScript(scriptName){window.postMessage({type:"FROM_PAGE_LOAD_SCRIPT",text:scriptName},"*")}function CFontFileLoader(id){this.LoadingCounter=0;this.Id=id;this.Status=-1;this.stream_index=-1;
this.callback=null;this.IsNeedAddJSToFontPath=true;this.CanUseOriginalFormat=true;var oThis=this;this.CheckLoaded=function(){return 0==this.Status||1==this.Status};this._callback_font_load=function(){if(!window[oThis.Id]){oThis.LoadingCounter++;if(oThis.LoadingCounter<oThis.GetMaxLoadingCount()){oThis.Status=-1;return}oThis.Status=2;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;_editor.sendEvent("asc_onError",Asc.c_oAscError.ID.CoAuthoringDisconnect,Asc.c_oAscError.Level.Critical); this.callback=null;this.IsNeedAddJSToFontPath=true;this.CanUseOriginalFormat=true;var oThis=this;this.CheckLoaded=function(){return 0==this.Status||1==this.Status};this._callback_font_load=function(){if(!window[oThis.Id]){oThis.LoadingCounter++;if(oThis.LoadingCounter<oThis.GetMaxLoadingCount()){oThis.Status=-1;return}oThis.Status=2;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;_editor.sendEvent("asc_onError",Asc.c_oAscError.ID.CoAuthoringDisconnect,Asc.c_oAscError.Level.Critical);
return}var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=AscFonts.CreateFontData4(window[oThis.Id]);oThis.SetStreamIndex(__font_data_idx);oThis.Status=0;delete window[oThis.Id];if(null!=oThis.callback)oThis.callback()};this.LoadFontAsync2=function(basePath,_callback){this.callback=_callback;if(-1!=this.Status)return true;if(bIsLocalFontsUse){postLoadScript(this.Id);return}this.Status=2;var xhr=new XMLHttpRequest;xhr.open("GET",basePath+this.Id,true);if(typeof ArrayBuffer!== return}var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=AscFonts.CreateFontData4(window[oThis.Id]);oThis.SetStreamIndex(__font_data_idx);oThis.Status=0;delete window[oThis.Id];if(null!=oThis.callback)oThis.callback()};this.LoadFontAsync2=function(basePath,_callback){this.callback=_callback;if(-1!=this.Status)return true;if(bIsLocalFontsUse){postLoadScript(this.Id);return}this.Status=2;var xhr=new XMLHttpRequest;xhr.open("GET",basePath+this.Id+"?"+window.CP_urlArgs,true);
"undefined"&&!window.opera)xhr.responseType="arraybuffer";if(xhr.overrideMimeType)xhr.overrideMimeType("text/plain; charset=x-user-defined");else xhr.setRequestHeader("Accept-Charset","x-user-defined");xhr.onload=function(){if(this.status!=200){oThis.LoadingCounter++;if(oThis.LoadingCounter<oThis.GetMaxLoadingCount()){oThis.Status=-1;return}oThis.Status=2;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;_editor.sendEvent("asc_onError",Asc.c_oAscError.ID.CoAuthoringDisconnect, if(typeof ArrayBuffer!=="undefined"&&!window.opera)xhr.responseType="arraybuffer";if(xhr.overrideMimeType)xhr.overrideMimeType("text/plain; charset=x-user-defined");else xhr.setRequestHeader("Accept-Charset","x-user-defined");xhr.onload=function(){if(this.status!=200){oThis.LoadingCounter++;if(oThis.LoadingCounter<oThis.GetMaxLoadingCount()){oThis.Status=-1;return}oThis.Status=2;var _editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;_editor.sendEvent("asc_onError",Asc.c_oAscError.ID.CoAuthoringDisconnect,
Asc.c_oAscError.Level.Critical);return}oThis.Status=0;if(typeof ArrayBuffer!=="undefined"&&!window.opera&&this.response){var __font_data_idx=g_fonts_streams.length;var _uintData=new Uint8Array(this.response);g_fonts_streams[__font_data_idx]=new AscFonts.FontStream(_uintData,_uintData.length);oThis.SetStreamIndex(__font_data_idx)}else if(AscCommon.AscBrowser.isIE){var _response=(new VBArray(this["responseBody"])).toArray();var srcLen=_response.length;var stream=new AscFonts.FontStream(AscFonts.allocate(srcLen), Asc.c_oAscError.Level.Critical);return}oThis.Status=0;if(typeof ArrayBuffer!=="undefined"&&!window.opera&&this.response){var __font_data_idx=g_fonts_streams.length;var _uintData=new Uint8Array(this.response);g_fonts_streams[__font_data_idx]=new AscFonts.FontStream(_uintData,_uintData.length);oThis.SetStreamIndex(__font_data_idx)}else if(AscCommon.AscBrowser.isIE){var _response=(new VBArray(this["responseBody"])).toArray();var srcLen=_response.length;var stream=new AscFonts.FontStream(AscFonts.allocate(srcLen),
srcLen);var dstPx=stream.data;var index=0;while(index<srcLen){dstPx[index]=_response[index];index++}var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=stream;oThis.SetStreamIndex(__font_data_idx)}else{var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=AscFonts.CreateFontData3(this.responseText);oThis.SetStreamIndex(__font_data_idx)}var guidOdttf=[160,102,214,32,20,150,71,250,149,105,184,80,176,65,73,72];var _stream=g_fonts_streams[g_fonts_streams.length- srcLen);var dstPx=stream.data;var index=0;while(index<srcLen){dstPx[index]=_response[index];index++}var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=stream;oThis.SetStreamIndex(__font_data_idx)}else{var __font_data_idx=g_fonts_streams.length;g_fonts_streams[__font_data_idx]=AscFonts.CreateFontData3(this.responseText);oThis.SetStreamIndex(__font_data_idx)}var guidOdttf=[160,102,214,32,20,150,71,250,149,105,184,80,176,65,73,72];var _stream=g_fonts_streams[g_fonts_streams.length-
1];var _data=_stream.data};xhr.send(null)};this.LoadFontNative=function(){if(window["use_native_fonts_only"]===true){this.Status=0;return}var __font_data_idx=g_fonts_streams.length;var _data=window["native"]["GetFontBinary"](this.Id);g_fonts_streams[__font_data_idx]=new AscFonts.FontStream(_data,_data.length);this.SetStreamIndex(__font_data_idx);this.Status=0}}CFontFileLoader.prototype.GetMaxLoadingCount=function(){return 3};CFontFileLoader.prototype.SetStreamIndex=function(index){this.stream_index= 1];var _data=_stream.data};xhr.send(null)};this.LoadFontNative=function(){if(window["use_native_fonts_only"]===true){this.Status=0;return}var __font_data_idx=g_fonts_streams.length;var _data=window["native"]["GetFontBinary"](this.Id);g_fonts_streams[__font_data_idx]=new AscFonts.FontStream(_data,_data.length);this.SetStreamIndex(__font_data_idx);this.Status=0}}CFontFileLoader.prototype.GetMaxLoadingCount=function(){return 3};CFontFileLoader.prototype.SetStreamIndex=function(index){this.stream_index=

@ -756,6 +756,10 @@
} }
} }
if (window.APP && window.APP.urlArgs) {
params += "&"+ window.APP.urlArgs;
}
if (config.frameEditorId) if (config.frameEditorId)
params += "&frameEditorId=" + config.frameEditorId; params += "&frameEditorId=" + config.frameEditorId;

File diff suppressed because one or more lines are too long

@ -317,6 +317,12 @@
<div id="viewport"></div> <div id="viewport"></div>
<script data-main="app" src="../../../vendor/requirejs/require.js"></script> <script data-main="app" src="../../../vendor/requirejs/require.js"></script>
<script>
window.CP_urlArgs = (window.parent && window.parent.APP && window.parent.APP.urlArgs) || '';
require.config({
urlArgs: window.CP_urlArgs,
});
</script>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

@ -315,6 +315,12 @@
<div id="viewport"></div> <div id="viewport"></div>
<script data-main="app" src="../../../vendor/requirejs/require.js"></script> <script data-main="app" src="../../../vendor/requirejs/require.js"></script>
<script>
window.CP_urlArgs = (window.parent && window.parent.APP && window.parent.APP.urlArgs) || '';
require.config({
urlArgs: window.CP_urlArgs,
});
</script>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

@ -315,5 +315,12 @@
<div id="viewport"></div> <div id="viewport"></div>
<script data-main="app" src="../../../vendor/requirejs/require.js"></script> <script data-main="app" src="../../../vendor/requirejs/require.js"></script>
<script>
window.CP_urlArgs = (window.parent && window.parent.APP && window.parent.APP.urlArgs) || '';
require.config({
urlArgs: window.CP_urlArgs,
});
</script>
</body> </body>
</html> </html>

@ -1350,8 +1350,6 @@ MessengerUI, Messages) {
} }
}; };
Messages.snaphot_title = "Snapshot"; //XXX
toolbar.setSnapshot = function (bool) { toolbar.setSnapshot = function (bool) {
toolbar.history = bool; toolbar.history = bool;
toolbar.title.toggleClass('cp-toolbar-unsync', bool); toolbar.title.toggleClass('cp-toolbar-unsync', bool);

@ -19,6 +19,16 @@ define(['jquery'], function ($) {
var $a = $('.cke_toolbox_main').find('.cke_button, .cke_combo_button'); var $a = $('.cke_toolbox_main').find('.cke_button, .cke_combo_button');
$a.each(function (i, el) { $a.each(function (i, el) {
var $el = $(el); var $el = $(el);
var $icon = $el.find('span.cke_button_icon');
if ($icon.length) {
try {
var url = $icon[0].style['background-image'];
var bgImg = url.replace(/ !important$/, '');
if (bgImg) {
$icon[0].style.setProperty('background-image', bgImg, 'important');
}
} catch (e) { console.error(e); }
}
$el.on('keydown blur focus click dragstart', function (e) { $el.on('keydown blur focus click dragstart', function (e) {
e.preventDefault(); e.preventDefault();
var attr = $(el).attr('oon'+e.type); var attr = $(el).attr('oon'+e.type);

@ -395,7 +395,7 @@ define([
if (obj.error === "OFFLINE") { return UI.alert(Messages.driveOfflineError); } if (obj.error === "OFFLINE") { return UI.alert(Messages.driveOfflineError); }
if (obj.error) { return void console.error(obj.error); } if (obj.error) { return void console.error(obj.error); }
var list = []; var list = [];
var keys = Object.keys(obj).slice(0,3); var keys = Object.keys(obj).slice(0,MAX_TEAMS_SLOTS);
var slots = '('+Math.min(keys.length, MAX_TEAMS_SLOTS)+'/'+MAX_TEAMS_SLOTS+')'; var slots = '('+Math.min(keys.length, MAX_TEAMS_SLOTS)+'/'+MAX_TEAMS_SLOTS+')';
for (var i = keys.length; i < MAX_TEAMS_SLOTS; i++) { for (var i = keys.length; i < MAX_TEAMS_SLOTS; i++) {
obj[i] = { obj[i] = {

Loading…
Cancel
Save