/*
 Joel Espinosa Longi
 jlongi@im.unam.mx
 https://github.com/jlongi/DescartesJS
 LGPL - http://www.gnu.org/licenses/lgpl.html
 2025-06-04
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(b){var a=0;return function(){return a<b.length?{done:!1,value:b[a++]}:{done:!0}}};$jscomp.arrayIterator=function(b){return{next:$jscomp.arrayIteratorImpl(b)}};$jscomp.makeIterator=function(b){var a="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];return a?a.call(b):$jscomp.arrayIterator(b)};$jscomp.arrayFromIterator=function(b){for(var a,d=[];!(a=b.next()).done;)d.push(a.value);return d};
$jscomp.arrayFromIterable=function(b){return b instanceof Array?b:$jscomp.arrayFromIterator($jscomp.makeIterator(b))};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.objectCreate=$jscomp.ASSUME_ES5||"function"==typeof Object.create?Object.create:function(b){var a=function(){};a.prototype=b;return new a};$jscomp.underscoreProtoCanBeSet=function(){var b={a:!0},a={};try{return a.__proto__=b,a.a}catch(d){}return!1};
$jscomp.setPrototypeOf="function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(b,a){b.__proto__=a;if(b.__proto__!==a)throw new TypeError(b+" is not extensible");return b}:null;
$jscomp.inherits=function(b,a){b.prototype=$jscomp.objectCreate(a.prototype);b.prototype.constructor=b;if($jscomp.setPrototypeOf){var d=$jscomp.setPrototypeOf;d(b,a)}else for(d in a)if("prototype"!=d)if(Object.defineProperties){var h=Object.getOwnPropertyDescriptor(a,d);h&&Object.defineProperty(b,d,h)}else b[d]=a[d];b.superClass_=a.prototype};$jscomp.getGlobal=function(b){return"undefined"!=typeof window&&window===b?b:"undefined"!=typeof global&&null!=global?global:b};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(b,a,d){b!=Array.prototype&&b!=Object.prototype&&(b[a]=d.value)};$jscomp.polyfill=function(b,a,d,h){if(a){d=$jscomp.global;b=b.split(".");for(h=0;h<b.length-1;h++){var p=b[h];p in d||(d[p]={});d=d[p]}b=b[b.length-1];h=d[b];a=a(h);a!=h&&null!=a&&$jscomp.defineProperty(d,b,{configurable:!0,writable:!0,value:a})}};$jscomp.FORCE_POLYFILL_PROMISE=!1;
$jscomp.polyfill("Promise",function(b){function a(){this.batch_=null}function d(a){return a instanceof p?a:new p(function(b,c){b(a)})}if(b&&!$jscomp.FORCE_POLYFILL_PROMISE)return b;a.prototype.asyncExecute=function(a){if(null==this.batch_){this.batch_=[];var b=this;this.asyncExecuteFunction(function(){b.executeBatch_()})}this.batch_.push(a)};var h=$jscomp.global.setTimeout;a.prototype.asyncExecuteFunction=function(a){h(a,0)};a.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var a=
this.batch_;this.batch_=[];for(var b=0;b<a.length;++b){var c=a[b];a[b]=null;try{c()}catch(m){this.asyncThrow_(m)}}}this.batch_=null};a.prototype.asyncThrow_=function(a){this.asyncExecuteFunction(function(){throw a;})};var p=function(a){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var b=this.createResolveAndReject_();try{a(b.resolve,b.reject)}catch(n){b.reject(n)}};p.prototype.createResolveAndReject_=function(){function a(a){return function(m){c||(c=!0,a.call(b,m))}}var b=this,c=!1;
return{resolve:a(this.resolveTo_),reject:a(this.reject_)}};p.prototype.resolveTo_=function(a){if(a===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(a instanceof p)this.settleSameAsPromise_(a);else{a:switch(typeof a){case "object":var b=null!=a;break a;case "function":b=!0;break a;default:b=!1}b?this.resolveToNonPromiseObj_(a):this.fulfill_(a)}};p.prototype.resolveToNonPromiseObj_=function(a){var b=void 0;try{b=a.then}catch(n){this.reject_(n);return}"function"==typeof b?
this.settleSameAsThenable_(b,a):this.fulfill_(a)};p.prototype.reject_=function(a){this.settle_(2,a)};p.prototype.fulfill_=function(a){this.settle_(1,a)};p.prototype.settle_=function(a,b){if(0!=this.state_)throw Error("Cannot settle("+a+", "+b+"): Promise already settled in state"+this.state_);this.state_=a;this.result_=b;this.executeOnSettledCallbacks_()};p.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var a=0;a<this.onSettledCallbacks_.length;++a)c.asyncExecute(this.onSettledCallbacks_[a]);
this.onSettledCallbacks_=null}};var c=new a;p.prototype.settleSameAsPromise_=function(a){var b=this.createResolveAndReject_();a.callWhenSettled_(b.resolve,b.reject)};p.prototype.settleSameAsThenable_=function(a,b){var c=this.createResolveAndReject_();try{a.call(b,c.resolve,c.reject)}catch(m){c.reject(m)}};p.prototype.then=function(a,b){function c(a,b){return"function"==typeof a?function(b){try{m(a(b))}catch(y){g(y)}}:b}var m,g,l=new p(function(a,b){m=a;g=b});this.callWhenSettled_(c(a,m),c(b,g));return l};
p.prototype.catch=function(a){return this.then(void 0,a)};p.prototype.callWhenSettled_=function(a,b){function l(){switch(m.state_){case 1:a(m.result_);break;case 2:b(m.result_);break;default:throw Error("Unexpected state: "+m.state_);}}var m=this;null==this.onSettledCallbacks_?c.asyncExecute(l):this.onSettledCallbacks_.push(l)};p.resolve=d;p.reject=function(a){return new p(function(b,c){c(a)})};p.race=function(a){return new p(function(b,c){for(var m=$jscomp.makeIterator(a),g=m.next();!g.done;g=m.next())d(g.value).callWhenSettled_(b,
c)})};p.all=function(a){var b=$jscomp.makeIterator(a),c=b.next();return c.done?d([]):new p(function(a,g){function m(b){return function(c){l[b]=c;h--;0==h&&a(l)}}var l=[],h=0;do l.push(void 0),h++,d(c.value).callWhenSettled_(m(l.length-1),g),c=b.next();while(!c.done)})};return p},"es6","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};
$jscomp.SymbolClass=function(b,a){this.$jscomp$symbol$id_=b;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:a})};$jscomp.SymbolClass.prototype.toString=function(){return this.$jscomp$symbol$id_};$jscomp.Symbol=function(){function b(d){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX+(d||"")+"_"+a++,d)}var a=0;return b}();
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var b=$jscomp.global.Symbol.iterator;b||(b=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[b]&&$jscomp.defineProperty(Array.prototype,b,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var b=$jscomp.global.Symbol.asyncIterator;b||(b=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("Symbol.asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(b){$jscomp.initSymbolIterator();b={next:b};b[$jscomp.global.Symbol.iterator]=function(){return this};return b};$jscomp.generator={};
$jscomp.generator.ensureIteratorResultIsObject_=function(b){if(!(b instanceof Object))throw new TypeError("Iterator result "+b+" is not an object");};$jscomp.generator.Context=function(){this.isRunning_=!1;this.yieldAllIterator_=null;this.yieldResult=void 0;this.nextAddress=1;this.finallyAddress_=this.catchAddress_=0;this.finallyContexts_=this.abruptCompletion_=null};
$jscomp.generator.Context.prototype.start_=function(){if(this.isRunning_)throw new TypeError("Generator is already running");this.isRunning_=!0};$jscomp.generator.Context.prototype.stop_=function(){this.isRunning_=!1};$jscomp.generator.Context.prototype.jumpToErrorHandler_=function(){this.nextAddress=this.catchAddress_||this.finallyAddress_};$jscomp.generator.Context.prototype.next_=function(b){this.yieldResult=b};
$jscomp.generator.Context.prototype.throw_=function(b){this.abruptCompletion_={exception:b,isException:!0};this.jumpToErrorHandler_()};$jscomp.generator.Context.prototype.return=function(b){this.abruptCompletion_={return:b};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks=function(b){this.abruptCompletion_={jumpTo:b};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.yield=function(b,a){this.nextAddress=a;return{value:b}};
$jscomp.generator.Context.prototype.yieldAll=function(b,a){b=$jscomp.makeIterator(b);var d=b.next();$jscomp.generator.ensureIteratorResultIsObject_(d);if(d.done)this.yieldResult=d.value,this.nextAddress=a;else return this.yieldAllIterator_=b,this.yield(d.value,a)};$jscomp.generator.Context.prototype.jumpTo=function(b){this.nextAddress=b};$jscomp.generator.Context.prototype.jumpToEnd=function(){this.nextAddress=0};
$jscomp.generator.Context.prototype.setCatchFinallyBlocks=function(b,a){this.catchAddress_=b;void 0!=a&&(this.finallyAddress_=a)};$jscomp.generator.Context.prototype.setFinallyBlock=function(b){this.catchAddress_=0;this.finallyAddress_=b||0};$jscomp.generator.Context.prototype.leaveTryBlock=function(b,a){this.nextAddress=b;this.catchAddress_=a||0};
$jscomp.generator.Context.prototype.enterCatchBlock=function(b){this.catchAddress_=b||0;b=this.abruptCompletion_.exception;this.abruptCompletion_=null;return b};$jscomp.generator.Context.prototype.enterFinallyBlock=function(b,a,d){d?this.finallyContexts_[d]=this.abruptCompletion_:this.finallyContexts_=[this.abruptCompletion_];this.catchAddress_=b||0;this.finallyAddress_=a||0};
$jscomp.generator.Context.prototype.leaveFinallyBlock=function(b,a){a=this.finallyContexts_.splice(a||0)[0];if(a=this.abruptCompletion_=this.abruptCompletion_||a){if(a.isException)return this.jumpToErrorHandler_();void 0!=a.jumpTo&&this.finallyAddress_<a.jumpTo?(this.nextAddress=a.jumpTo,this.abruptCompletion_=null):this.nextAddress=this.finallyAddress_}else this.nextAddress=b};$jscomp.generator.Context.prototype.forIn=function(b){return new $jscomp.generator.Context.PropertyIterator(b)};
$jscomp.generator.Context.PropertyIterator=function(b){this.object_=b;this.properties_=[];for(var a in b)this.properties_.push(a);this.properties_.reverse()};$jscomp.generator.Context.PropertyIterator.prototype.getNext=function(){for(;0<this.properties_.length;){var b=this.properties_.pop();if(b in this.object_)return b}return null};$jscomp.generator.Engine_=function(b){this.context_=new $jscomp.generator.Context;this.program_=b};
$jscomp.generator.Engine_.prototype.next_=function(b){this.context_.start_();if(this.context_.yieldAllIterator_)return this.yieldAllStep_(this.context_.yieldAllIterator_.next,b,this.context_.next_);this.context_.next_(b);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.return_=function(b){this.context_.start_();var a=this.context_.yieldAllIterator_;if(a)return this.yieldAllStep_("return"in a?a["return"]:function(a){return{value:a,done:!0}},b,this.context_.return);this.context_.return(b);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.throw_=function(b){this.context_.start_();if(this.context_.yieldAllIterator_)return this.yieldAllStep_(this.context_.yieldAllIterator_["throw"],b,this.context_.next_);this.context_.throw_(b);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.yieldAllStep_=function(b,a,d){try{var h=b.call(this.context_.yieldAllIterator_,a);$jscomp.generator.ensureIteratorResultIsObject_(h);if(!h.done)return this.context_.stop_(),h;var p=h.value}catch(c){return this.context_.yieldAllIterator_=null,this.context_.throw_(c),this.nextStep_()}this.context_.yieldAllIterator_=null;d.call(this.context_,p);return this.nextStep_()};
$jscomp.generator.Engine_.prototype.nextStep_=function(){for(;this.context_.nextAddress;)try{var b=this.program_(this.context_);if(b)return this.context_.stop_(),{value:b.value,done:!1}}catch(a){this.context_.yieldResult=void 0,this.context_.throw_(a)}this.context_.stop_();if(this.context_.abruptCompletion_){b=this.context_.abruptCompletion_;this.context_.abruptCompletion_=null;if(b.isException)throw b.exception;return{value:b.return,done:!0}}return{value:void 0,done:!0}};
$jscomp.generator.Generator_=function(b){this.next=function(a){return b.next_(a)};this.throw=function(a){return b.throw_(a)};this.return=function(a){return b.return_(a)};$jscomp.initSymbolIterator();this[Symbol.iterator]=function(){return this}};$jscomp.generator.createGenerator=function(b,a){a=new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(a));$jscomp.setPrototypeOf&&$jscomp.setPrototypeOf(a,b.prototype);return a};
$jscomp.asyncExecutePromiseGenerator=function(b){function a(a){return b.next(a)}function d(a){return b.throw(a)}return new Promise(function(h,p){function c(b){b.done?h(b.value):Promise.resolve(b.value).then(a,d).then(c,p)}c(b.next())})};$jscomp.asyncExecutePromiseGeneratorFunction=function(b){return $jscomp.asyncExecutePromiseGenerator(b())};$jscomp.asyncExecutePromiseGeneratorProgram=function(b){return $jscomp.asyncExecutePromiseGenerator(new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(b)))};
$jscomp.checkStringArgs=function(b,a,d){if(null==b)throw new TypeError("The 'this' value for String.prototype."+d+" must not be null or undefined");if(a instanceof RegExp)throw new TypeError("First argument to String.prototype."+d+" must not be a regular expression");return b+""};
$jscomp.polyfill("String.prototype.repeat",function(b){return b?b:function(a){var b=$jscomp.checkStringArgs(this,null,"repeat");if(0>a||1342177279<a)throw new RangeError("Invalid count value");a|=0;for(var h="";a;)if(a&1&&(h+=b),a>>>=1)b+=b;return h}},"es6","es3");
$jscomp.polyfill("String.prototype.startsWith",function(b){return b?b:function(a,b){var d=$jscomp.checkStringArgs(this,a,"startsWith");a+="";var p=d.length,c=a.length;b=Math.max(0,Math.min(b|0,d.length));for(var f=0;f<c&&b<p;)if(d[b++]!=a[f++])return!1;return f>=c}},"es6","es3");
$jscomp.polyfill("String.prototype.endsWith",function(b){return b?b:function(a,b){var d=$jscomp.checkStringArgs(this,a,"endsWith");a+="";void 0===b&&(b=d.length);b=Math.max(0,Math.min(b|0,d.length));for(var p=a.length;0<p&&0<b;)if(d[--b]!=a[--p])return!1;return 0>=p}},"es6","es3");$jscomp.stringPadding=function(b,a){b=void 0!==b?String(b):" ";return 0<a&&b?b.repeat(Math.ceil(a/b.length)).substring(0,a):""};
$jscomp.polyfill("String.prototype.padStart",function(b){return b?b:function(a,b){var d=$jscomp.checkStringArgs(this,null,"padStart");return $jscomp.stringPadding(b,a-d.length)+d}},"es8","es3");$jscomp.owns=function(b,a){return Object.prototype.hasOwnProperty.call(b,a)};$jscomp.assign="function"==typeof Object.assign?Object.assign:function(b,a){for(var d=1;d<arguments.length;d++){var h=arguments[d];if(h)for(var p in h)$jscomp.owns(h,p)&&(b[p]=h[p])}return b};
$jscomp.polyfill("Object.assign",function(b){return b||$jscomp.assign},"es6","es3");$jscomp.polyfill("Array.prototype.fill",function(b){return b?b:function(a,b,h){var d=this.length||0;0>b&&(b=Math.max(0,d+b));if(null==h||h>d)h=d;h=Number(h);0>h&&(h=Math.max(0,d+h));for(b=Number(b||0);b<h;b++)this[b]=a;return this}},"es6","es3");$jscomp.findInternal=function(b,a,d){b instanceof String&&(b=String(b));for(var h=b.length,p=0;p<h;p++){var c=b[p];if(a.call(d,c,p,b))return{i:p,v:c}}return{i:-1,v:void 0}};
$jscomp.polyfill("Array.prototype.find",function(b){return b?b:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6","es3");$jscomp.polyfill("Object.is",function(b){return b?b:function(a,b){return a===b?0!==a||1/a===1/b:a!==a&&b!==b}},"es6","es3");
$jscomp.polyfill("Array.prototype.includes",function(b){return b?b:function(a,b){var d=this;d instanceof String&&(d=String(d));var p=d.length;b=b||0;for(0>b&&(b=Math.max(b+p,0));b<p;b++){var c=d[b];if(c===a||Object.is(c,a))return!0}return!1}},"es7","es3");$jscomp.polyfill("String.prototype.includes",function(b){return b?b:function(a,b){return-1!==$jscomp.checkStringArgs(this,a,"includes").indexOf(a,b||0)}},"es6","es3");
$jscomp.polyfill("Array.prototype.flat",function(b){return b?b:function(a){a=void 0===a?1:Number(a);for(var b=[],h=0;h<this.length;h++){var p=this[h];Array.isArray(p)&&0<a?(p=Array.prototype.flat.call(p,a-1),b.push.apply(b,p)):b.push(p)}return b}},"es9","es5");$jscomp.polyfill("Math.trunc",function(b){return b?b:function(a){a=Number(a);if(isNaN(a)||Infinity===a||-Infinity===a||0===a)return a;var b=Math.floor(Math.abs(a));return 0>a?-b:b}},"es6","es3");
$jscomp.polyfill("Math.sign",function(b){return b?b:function(a){a=Number(a);return 0===a||isNaN(a)?a:0<a?1:-1}},"es6","es3");$jscomp.polyfill("Number.isFinite",function(b){return b?b:function(a){return"number"!==typeof a?!1:!isNaN(a)&&Infinity!==a&&-Infinity!==a}},"es6","es3");
var babel=function(b){if(b.loadLib)return b;b.loadLib=!0;b.no=b.ez=b.non=b["n\u00e3o"]=b.falso=b["false"]=b.fals=b.gezurra=b.faux=b.fals="false";b["s\u00ed"]=b.yes=b.bai=b.oui=b.si=b.sim=b.verdadero=b["true"]=b.veritable=b.egia=b.vrai=b.verdadeiro=b.veritable="true";b.negro=b.black=b.negre=b.beltza=b.noir=b.preto=b["#000000"]="#000000";b.maxenta=b.magenta=b["#ff00ff"]="#ff00ff";b.azul=b.blue=b.blau=b.urdina=b.bleu=b["#0000ff"]="#0000ff";b.turquesa=b.cyan=b.turkesa=b.turquoise=b["#00ffff"]="#00ffff";
b.verde=b.green=b.verd=b.berdea=b.vert=b["#00ff00"]="#00ff00";b.amarillo=b.yellow=b.groc=b.horia=b.jaune=b.amarelo=b["#ffff00"]="#ffff00";b.naranja=b.orange=b.taronja=b.laranja=b.laranxa=b["#ffc800"]="#ffc800";b.rojo=b.red=b.vermell=b.gorria=b.rouge=b.vermello=b.vermelho=b["#ff0000"]="#ff0000";b.pink=b.rosa=b.arrosa=b.rose=b["#ffafaf"]="#ffafaf";b.grisObscuro=b.darkGray=b.grisFosc=b["gris iluna"]=b.grisObscur=b.grisEscuro=b.cinzaEscuro=b["#404040"]="#404040";b.gris=b.gray=b.grisa=b.cinza=b["#808080"]=
"#808080";b.grisClaro=b.lightGray=b.grisClar=b["gris argia"]=b.grisClair=b.cinzaClaro=b["#c0c0c0"]="#c0c0c0";b.blanco=b.white=b.blanc=b.zuria=b.branco=b["#ffffff"]="#ffffff";b.escala=b.scale=b.eskala=b["\u00e9chelle"]="scale";b.nombre=b.name=b.nom=b.izena=b.nome="name";b.ikusgai=b["vis\u00edvel"]=b.visible="visible";b.rastro=b.trace=b.rastre=b.arrastoa="trace";b.fondo=b.background=b.fons=b.hondoa=b.fond=b.fundo="background";b["par\u00e1metro"]=b.parameter=b.parametroa=b["par\u00e2metro"]=b["par\u00e0metre"]=
"parameter";b["sucesi\u00f3n"]=b.sequence=b["successi\u00f3"]=b.segida=b.succession=b["seq\u00fc\u00eancia"]="sequence";b["tama\u00f1o"]=b.size=b.neurria=b.taille=b.tamanho=b["grand\u00e0ria"]="size";b.decimales=b.decimals=b.hamartarra=b["d\u00e9cimales"]=b.decimais="decimals";b.red=b.net=b.xarxa=b.sarea=b["r\u00e9seau"]=b.rede=b.malha="net";b.red10=b.net10=b.xarxa10=b.sarea10=b["r\u00e9seau10"]=b.rede10=b.malha10="net10";b.ejes=b.axes=b.eixos=b.ardatzak=b.eixes="axes";b["cr\u00e9ditos"]=b.about=
b["cr\u00e8dits"]=b.kreditoak=b["cr\u00e9dits"]=b.sobre="about";b.config=b.konfig=b["configura\u00e7\u00e3o"]="config";b.inicio=b.init=b.inici=b.hasiera=b.commencement=b["in\u00edcio"]="init";b.limpiar=b.clear=b.neteja=b.ezabatu=b.nettoye=b.limpar="clear";b.incr=b.gehi=b.incremento="incr";b.min=b.inf="min";b.max=b.sup=b["m\u00e1x"]="max";b.relleno=b.fill=b.ple=b.betea=b.plein=b.recheo=b.preencher="fill";b["relleno+"]=b["fill+"]=b["ple+"]=b["betea+"]=b["plein+"]=b["recheo+"]=b["preencher+"]=b.fillP=
"fillP";b["relleno-"]=b["fill-"]=b["ple-"]=b["betea-"]=b["plein-"]=b["recheo-"]=b["preencher-"]=b.fillM="fillM";b.flecha=b.arrow=b.fletxa=b.gezia=b["fl\u00e8che"]=b.frecha=b.seta="arrow";b.punta=b.spear=b.muturra=b.pointe=b.ponta="spear";b["regi\u00f3n"]=b.region=b["regi\u00f3"]=b.eskualde=b["r\u00e9gion"]=b["rexi\u00f3n"]=b["regi\u00e3o"]="region";b.norte=b.north=b.nord=b.ipar="north";b.sur=b.south=b.sud=b.hego=b.sul="south";b.este=b.east=b.est=b.ekialde=b.leste="east";b.oeste=b.west=b.oest=b.hegoalde=
b.ouest="west";b.exterior=b.external=b.kanpoalde=b.externo="external";b["expresi\u00f3n"]=b.expresion=b["expresi\u00f3"]=b.adierazpen=b["express\u00e3o"]="expresion";b.tipo=b.type=b.tipus=b.mota="type";b["posici\u00f3n"]=b.position=b["posici\u00f3"]=b.posizio=b["posi\u00e7\u00e3o"]="position";b["constricci\u00f3n"]=b.constraint=b["constricci\u00f3"]=b.beharte=b.constriction=b["constrici\u00f3n"]=b["restri\u00e7\u00e3o"]="constraint";b.valor=b.value=b.balio=b.valeur="value";b["ecuaci\u00f3n"]=b.equation=
b["equaci\u00f3"]=b.ekuazio=b["\u00e9quation"]=b["equa\u00e7\u00e3o"]="equation";b.curva=b.curve=b.corba=b.kurba=b.courbe="curve";b.texto=b.text=b.testu=b.texte=b.testua="text";b.punto=b.point=b.punt=b.puntu=b.ponto=b.dot="point";b.segmento=b.segment=b.zuzenki="segment";b.arco=b.arc=b.arku="arc";b["pol\u00edgono"]=b.polygon=b["pol\u00edgon"]=b.poligono=b.polygone="polygon";b.imagen=b.image=b.imatge=b.irudi=b.imaxe=b.imagem=b.bg_image=b.irudia=b.imagem_de_fundo=b.irundia="image";b["Versi\u00f3n"]=
b.Version=b["Versi\u00f3"]=b["Vers\u00e3o"]=b.version="version";b.Idioma=b.Language=b.Hizkuntza=b.Langue=b.language="language";b["O.x"]="O.x";b["O.y"]="O.y";b.Botones=b.Buttons=b.Botons=b.Botoiak=b.Boutons=b["Bot\u00f3ns"]=b["Bot\u00f5es"]=b.Botons="Buttons";b["Animaci\u00f3n"]=b.Animation=b["Animaci\u00f3"]=b.Animazio=b["Anima\u00e7\u00e3o"]="Animation";b.constante=b.constant=b.Konstante="constant";b.fuente=b.font=b.iturri=b.source=b.fonte="font";b["num\u00e9rico"]=b.numeric=b["num\u00e8ric"]=b.zenbakizko=
b["num\u00e9rique"]="numeric";b["gr\u00e1fico"]=b.graphic=b["gr\u00e0fic"]=b.grafiko=b.graphique="graphic";b.hacer=b["do"]=b.fer=b.egin=b.faire=b.facer=b.fazer=b.doExpr="doExpr";b.mientras=b["while"]=b.mentre=b.bitartean=b["tandis que"]=b.mentres=b.enquanto=b.whileExpr="whileExpr";b.evaluar=b.evaluate=b.avalua=b.ebaluatu=b["\u00e9valuer"]=b.avaliar="evaluate";b.variable=b.aldagaia=b["vari\u00e1vel"]="variable";b["funci\u00f3n"]=b["function"]=b["funci\u00f3"]=b.funtzio=b.fonction=b["fun\u00e7\u00e3o"]=
"function";b.algoritmo=b.algorithm=b.algorisme=b.algorithme="algorithm";b.vector=b.array=b.bektore=b.vecteur=b.matriz="array";b["dibujar-si"]=b["draw-if"]=b["marraztu-baldin"]=b["dessiner-si"]=b["debuxar-se"]=b["desenhar-se"]=b["dibuixa-si"]=b.drawif="drawif";b.dominio=b.range=b.domini=b["izate-eremua"]=b.domain=b["dom\u00ednio"]="range";b.pausa=b.delay=b.eten="delay";b["eje-x"]=b["x-axis"]=b["eix-x"]=b["x-ardatza"]=b["axe-x"]=b["eixe-x"]=b["eixo-x"]=b.x_axis="x_axis";b["eje-y"]=b["y-axis"]=b["eix-y"]=
b["y-ardatza"]=b["axe-y"]=b["eixe-y"]=b["eixo-y"]=b.y_axis="y_axis";b["n\u00fameros"]=b.numbers=b.nombres=b.zenbakiak="numbers";b["exponencial-si"]=b["exponential-if"]=b["esponentzial-baldin"]=b["exponentiel-si"]=b["exponencial-se"]=b.exponentialif="exponentialif";b.familia=b.family=b["fam\u00edlia"]=b.famille="family";b.intervalo=b.interval=b.tarte=b.intervalle="interval";b.pasos=b.steps=b.passos=b.pausoak=b.pas="steps";b.centro=b.center=b.centre=b.zentro="center";b.radio=b.radius=b.radi=b.erradio=
b.rayon=b.raio="radius";b.fin=b.end=b.fi=b.bukaera=b.fim="end";b["una-sola-vez"]=b["only-once"]=b["una-sola-vegada"]=b["behin-bakarrik"]=b["une-seule-fois"]=b["unha-soa-vez"]=b["apenas-uma-vez"]=b.onlyOnce="onlyOnce";b.siempre=b.always=b.sempre=b.beti=b.toujours="always";b["color-int"]=b["int-colour"]=b["barruko-kolore"]=b["couleur-int"]=b["cor-int"]=b.colorInt="colorInt";b.repetir=b.loop=b.repeteix=b.errepikatu=b["r\u00e9p\u00e9ter"]="loop";b.controles=b.controls=b.kontrolak=b["contr\u00f4les"]=
b.controis="controls";b.animar=b.animate=b.anima=b.animatu=b.animer="animate";b.auto="auto";b.y=b.top="y";b.espacio=b.space=b.espai=b.espazio=b.espace=b.espazo=b["espa\u00e7o"]="space";b.Nu="Nu";b.Nv="Nv";b.alto=b.height=b.alt=b.altu=b.haut=b.altura=b["al\u00e7ada"]=b.hauteur=b.alto="height";b.ancho=b.depth=b.amplada=b.zabalera=b.largeur=b.profundidade=b.amplada=b.width=b.ample=b.large=b.largura="width";b.largo=b.length=b.llargada=b.luzera=b.longueur=b.longo=b.comprimento=b.llargada="length";b.color_reverso=
b.backcolor=b.color_revers=b["atzealde kolorea"]=b.couleur_revers=b.cor_reverso=b.cor_de_fundo="backcolor";b.aristas=b.edges=b.arestes=b.ertzak=b["ar\u00eates"]=b.arestas="edges";b.rotini=b.inirot="inirot";b.posini=b.inipos="inipos";b["tri\u00e1ngulo"]=b.triangle=b.hirukia=b["tri\u00e2ngulo"]="triangle";b.cara=b.face=b.aurpegi="face";b.polireg=b.regpoly=b["pol\u00edgonoRegular"]="polireg";b.superficie=b.surface=b["superf\u00edcie"]=b.azalera="surface";b.cubo=b.cube=b.cub=b.kubo="cube";b["paralelep\u00edpedo"]=
b.box=b["paral\u00b7lelep\u00edpede"]=b.paralelepipedo=b["parall\u00e9l\u00e9pip\u00e8de"]="box";b.cono=b.cone=b.con=b.kono=b["c\u00f4ne"]="cone";b.cilindro=b.cylinder=b.cilindre=b.zilindro=b.cylindre="cylinder";b.esfera=b.sphere=b["sph\u00e8re"]="sphere";b.tetraedro=b.tetrahedron=b.tetraedre=b["t\u00e9tra\u00e8dre"]="tetrahedron";b.octaedro=b.octahedron=b.octaedre=b.oktaedro=b["octa\u00e8dre"]="octahedron";b.dodecaedro=b.dodecahedron=b.dodecaedre=b.dodekaedro=b["dod\u00e9ca\u00e8dre"]="dodecahedron";
b.icosaedro=b.icosahedron=b.icosaedre=b.ikosaedro=b["icosa\u00e8dre"]="icosahedron";b.elipsoide=b.ellipsoid=b["el\u00b7lipsoide"]=b["ellipso\u00efde"]=b["elips\u00f3ide"]="ellipsoid";b.macro=b.makro="macro";b.id="id";b.modelo=b.model=b.eredu=b["mod\u00e8le"]="model";b.color=b.kolore=b.couleur=b.cor=b.colour=b.kolorea="color";b.luz=b.light=b.llum=b.argia=b["lumi\u00e8re"]="light";b.metal=b.metall=b["m\u00e9tal"]="metal";b.alambre=b.wire=b.filferro=b.alanbre=b["fil de fer"]=b.arame="wire";b.cortar=
b.split=b.talla=b.moztu=b.couper=b.dividir="split";b.despliegue=b.render=b.desplegament=b.zabaltze=b["d\u00e8ploiement"]=b.despregamento=b.processar="render";b.orden=b.sort=b.ordre=b.ordena=b.orde=b.ordenar="sort";b.pintor=b.painter=b.margolari=b.peintre="painter";b["trazado de rayos"]=b["ray trace"]=b["tra\u00e7at de raigs"]=b["izpi trazadura"]=b["trace de rayons"]=b["trazado de raios"]=b["tra\u00e7ado de raios"]=b.raytrace="raytrace";b.despl_imagen=b.bg_display=b.despl_imatge=b["irudi desplazamendu"]=
b.despl_image=b.despr_imaxe=b["apresenta\u00e7\u00e3o_de_imagem"]="bg_display";b["arr-izq"]=b.topleft=b["dalt-esq"]=b["goi-ezk"]=b["au-dessus-gau"]=b["arr-esq"]=b["acima-esquerda"]="topleft";b["expand."]=b.stretch=b.hedatu=b["expandir "]="stretch";b.mosaico=b.patch=b.mosaic=b.mosaiko=b["mosa\u00efque"]="patch";b.centrada=b.zentratu=b["centr\u00e9e"]=b.centrado=b.imgcenter="imgcenter";b.archivo=b.file=b.fitxer=b.artxibo=b.fichier=b.arquivo="file";b.filas_norte=b.rows_north=b.files_nord=b["HTML kodea"]=
b.files_nord=b.filas_norte=b.linhas_norte=b.files_nord=b.rowsNorth="rowsNorth";b.filas_sur=b.rows_south=b.files_sud=b.ipar_lerro=b.files_sud=b.filas_sur=b.linhas_sul=b.files_sud=b.rowsSouth="rowsSouth";b.ancho_este=b.width_east=b.ample_est=b.hego_lerro=b.ample_est=b.ancho_leste=b.largura_leste=b.ample_est=b.widthEast="widthEast";b.ancho_oeste=b.width_west=b.ample_oest=b.ekialde_zabalera=b.ample_ouest=b.ancho_oeste=b.largura_oeste=b.ample_oest=b.widthWest="widthWest";b.fijo=b.fixed=b.fix=b.hegoalde_zabalera=
b.fixe=b.fixo="fixed";b["Reiniciar Animaci\u00f3n"]=b["Init Animation"]=b["Reinicia Animaci\u00f3"]=b.finko=b["Recommencer l'Animation"]=b["Reiniciar Anima\u00e7\u00e3o"]=b.initAnimation="initAnimation";b["Explicaci\u00f3n"]=b.Explanation=b.Azalpena=b.Explication=b["Explica\u00e7\u00e3o"]=b["Explicaci\u00f3"]="Explanation";b.tooltip=b.dica="tooltip";b.discreto=b.discrete=b.discret=b.diskretu="discrete";b.interfaz=b.gui=b["interf\u00edcie"]=b.interfaze=b["interface"]="gui";b.pulsador=b.spinner=b.polsador=
b.pultsadore=b.bouton="spinner";b["campo de texto"]=b.textfield=b["camp de text"]=b["testu esarrua"]=b["champ de texte"]="textfield";b["men\u00fa"]=b.choice=b.menu=b.escolha="menu";b.barra=b.scrollbar=b.barre="scrollbar";b.opciones=b.options=b.opcions=b.aukerak=b["opci\u00f3ns"]=b["op\u00e7\u00f5es"]="options";b.interior=b.barruko=b["int\u00e9rieur"]="interior";b["condici\u00f3n"]=b.condition=b["condici\u00f3"]=b.baldintza=b["condi\u00e7\u00e3o"]="condition";b["acci\u00f3n"]=b.action=b["acci\u00f3"]=
b.ekintza=b["a\u00e7\u00e3o"]="action";b.evento=b.event=b.esdeveniment=b.gertaera=b["\u00e9v\u00e9nement"]="event";b["abrir URL"]=b["open URL"]=b["obre URL"]=b["URL zabaldu"]=b["ouvrir URL"]=b.openURL="openURL";b["abrir Escena"]=b["open Scene"]=b["obre Escena"]=b["eszena zabaldu"]=b["ouvrir Escena"]=b["abrir Cena"]=b.openScene="openScene";b["bot\u00f3n"]=b.button=b["bot\u00f3"]=b.botoi=b.bouton=b["bot\u00e3o"]="button";b.mensaje=b.message=b.mezua=b.mensaxe=b.mensagem=b.missatge="message";b.alternar=
b.alternate=b.alterna=b.txandakatu=b.alterner="alternate";b["ejecuci\u00f3n"]=b.execution=b["execuci\u00f3"]=b.gauzatze=b["ex\u00e9cution"]=b["execuci\u00f3n"]=b["execu\u00e7\u00e3o"]="execution";b.calcular=b.calculate=b.calcula=b.kalkulatu=b.calculer="calculate";b.coord_abs=b.abs_coord=b.koor_abs="abs_coord";b.negrita=b.bold=b.negreta=b.lodi=b["caract\u00e8re gras"]=b.negra=b.negrito="bold";b.cursiva=b.italics=b.etzana=b.italique=b["it\u00e1lico"]="italics";b.subrayada=b.underlined=b.subratllat=
b.azpimarratua=b.soulignement=b["subli\u00f1ada"]=b.sublinhado="underlined";b.pos_mensajes=b.msg_pos=b.pos_missatges=b.mezuen_pos=b.pos_messages=b.pos_mensaxes="msg_pos";b.izquierda=b.left=b.esquerra=b.eskerrean=b.gauche=b.esquerda=b.esquerda=b.esquerra=b.x="x";b.derecha=b.right=b.dreta=b.eskuinan=b.droite=b.dereita=b.direita=b.dreta="right";b["sensible_a_los_movimientos_del_rat\u00f3n"]=b.sensitive_to_mouse_movements=b["sensible_als_moviments_del_ratol\u00ed"]=b["xagu mugimenduarekiko sentikorra"]=
b.sensible_aux_mouvements_du_souris=b.sensible_aos_movementos_do_rato=b["sens\u00edvel_aos_movimentos_do_mouse"]="sensitive_to_mouse_movements";b.reproducir=b.play=b.reprodueix=b.erreproduzitu=b.reproduire=b.reproduzir=b.playAudio="playAudio";b["activo-si"]=b["active-if"]=b["actiu-si"]=b["altiboa-baldin"]=b["actif-si"]=b["activo-se"]=b["ativo-se"]=b.activeif="activeif";b.rotfin=b.finrot=b.bukrot=b.endrot="endrot";b.posfin=b.finpos=b.bukpos=b.endpos="endpos";b.editable=b.editagarria=b["edit\u00e1vel"]=
"editable";b.R2="2D";b.R3="3D";b.vectores=b.bektoreak=b.vecteurs=b.vetores=b.vectors="vectors";b["fuente puntos"]=b["font size"]=b["font punts"]=b["puntu iturria"]=b["source points"]=b["fonte puntos"]=b["fonte pontos"]=b.font_size="font_size";b.escenario=b.scenario=b.escenari=b.agertoki=b["sc\u00e8ne"]=b["cen\u00e1rio"]="scenario";b.cID="cID";b.matriz=b.matrix=b.matriu=b.matrice="matrix";b.filas=b.rows=b.files="rows";b.columnas=b.columns=b.colonnes="columns";b.solo_texto=b.only_text=b.seulement_texte=
b["s\u00f3_texto"]=b.tan_sols_texte=b.onlyText="onlyText";b.respuesta=b.answer="answer";b.peso=b.weight=b.pes="weight";b.decimal_symbol=b["signo decimal"]=b["decimal symbol"]="decimal_symbol";b.info="info";b.library="library";b.color_contorn_text=b.color_text_border=b.color_borde_texto=b.muga_testuaren_kolorea=b.couleur_contour_texte=b.cor_borde_texto=b.colore_bordo_testo=b.cor_borda_texto=b.color_contorn_text=b.border="border";b.video=b["vid\u00e9o"]="video";b.audio=b["\u00e0udio"]="audio";b.autoplay=
"autoplay";b.poster="poster";b.opacidad=b.opacity=b["opacit\u00e9"]=b.opacitat=b.opacidade="opacity";b.alinear=b.align=b["ali\u00f1ar"]=b.aligner="align";b.anchor="anchor";b.a_left="left";b.a_center="center";b.a_right="right";b.a_justify="justify";b.a_top_left="top_left";b.a_top_center="top_center";b.a_top_right="top_right";b.a_center_left="center_left";b.a_center_center="center_center";b.a_center_right="center_right";b.a_bottom_left="bottom_left";b.a_bottom_center="bottom_center";b.a_bottom_right=
"bottom_right";b.malla=b.mesh="mesh";b.local=b.Local="local";b.rectangle=b["rect\u00e1ngulo"]="rectangle";b.lineDash="lineDash";b.solid="solid";b.dot="dot";b.dash="dash";b.dash_dot="dash_dot";b.offset_dist="offset_dist";b.offset_angle="offset_angle";b.flat="flat";b.borderColor="borderColor";b.text_align="text_align";b.image_align="image_align";b.checkbox="checkbox";b.torus=b.toro="torus";b.R="R";b.r="r";b.border_radius="border_radius";b.radio_group="radio_group";b.font_family="font_family";b.resizable=
"resizable";b.slider="slider";b.antialias="antialias";b.image_loader="image_loader";b.expand="expand";b.cover=b.cubrir="cover";b.fit=b.escalar="fit";b.code="code";b.doc="doc";b.image_dec="image_dec";b.image_inc="image_inc";b.btn_pos="btn_pos";b.border_width="border_width";b.border_color="border_color";b.v_left="v_left";b.v_right="v_right";b.h_left="h_left";b.h_right="h_right";b.h_left_right="h_left_right";b.label_color="label_color";b.label_text_color="label_text_color";b.shadowColor="shadowColor";
b.shadowBlur="shadowBlur";b.shadowOffsetX="shadowOffsetX";b.shadowOffsetY="shadowOffsetY";b.border_size="border_size";b.clip="clip";b.keyboard="keyboard";b.kblayout="kblayout";b.kbexp="kbexp";b.extra_style="extra_style";return b}(babel||Object.create(null)),descartesJS=function(b){if(b.loadLib)return b;b.addFonts=function(){var a={sansserif:{},serif:{},monospace:{},math:{}};a.sansserif.normal_bold=" ";
a.sansserif.italic_bold=" ";
a.sansserif.italic_normal=" ";
a.sansserif.normal_normal=" ";
a.monospace.normal_bold=" ";
a.monospace.italic_bold=" ";
a.monospace.italic_normal=" ";
a.monospace.normal_normal=" ";
a.serif.normal_bold=" ";
a.serif.italic_bold=" ";
a.serif.italic_normal=" ";
a.serif.normal_normal=" ";
a.math.normal_bold=a.math.italic_bold=" ";
a.math.italic_normal=a.math.normal_normal=" ";
for(var b=[["normal","bold"],["italic","bold"],["italic","normal"],["normal","normal"]],h="",p=$jscomp.makeIterator(["sansserif","monospace","serif","math"]),c=p.next();!c.done;c=p.next()){c=c.value;for(var f=$jscomp.makeIterator(b),l=f.next();!l.done;l=f.next())l=l.value,h+="@font-face{font-family:'DJS_"+c+"';src:url('data:font/woff2;charset=utf-8;base64,"+a[c][l[0]+"_"+l[1]]+"') format('woff2');font-style:"+l[0]+";font-weight:"+l[1]+";} "}return h};return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;b.addSymbolFont=function(){for(var a="",b=$jscomp.makeIterator([["normal","bold"],["italic","bold"],["italic","normal"],["normal","normal"]]),h=b.next();!h.done;h=b.next())h=h.value,a+="@font-face{font-family:'DJS_symbol';src:url('data:font/woff2;charset=utf-8;base64, ') format('woff2');font-style:"+
h[0]+";font-weight:"+h[1]+";} ";return a};return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p={bold:"Bold",italic:"Italic",italics:"Italic","bold+italic":"Italic Bold"};b.serif_font="descartesJS_serif,DJS_symbol,DJS_serif,Times,'Times New Roman','Liberation Serif','Nimbus Roman No9 L Regular',serif";b.sansserif_font="descartesJS_sansserif,DJS_symbol,DJS_sansserif,Helvetica,Arial,'Liberation Sans','Nimbus Sans L',sans-serif";b.monospace_font="descartesJS_monospace,DJS_symbol,DJS_monospace,'Courier New',Courier,'Liberation Mono','Nimbus Mono L',monospace";b.math_font=
"descartesJS_math,DJS_symbol,DJS_math,DJS_serif,Times,'Times New Roman','Liberation Serif','Nimbus Roman No9 L Regular',serif";b.convertFont=function(c){if(""==c)return"";a=c.split(",");d="";d+=b.getFontStyle(a[1])+" ";d+=a[2]+"px ";return d+=b.getFontName(a[0].split(" ")[0])};b.getFontName=function(a){a=a.toLowerCase();h=b.monospace_font;/sansserif|arial|helvetica/.test(a)?h=b.sansserif_font:/serif|times/.test(a)&&(h=b.serif_font);return h};b.getFontStyle=function(a){return p[a.toLowerCase()]||""};
b.getTextWidth=function(a,d){b.ctx.font=d;return Math.round(b.ctx.measureText(a).width)};b.getFieldFontSize=function(a){a=Math.min(50,a);return a=24<=a?Math.floor(a/2+2-a/16):20<=a?12:17<=a?11:15<=a?10:9};return b}(descartesJS||{});
descartesJS=function(b){function a(){var a,b,c,l,d,h,f;Number.prototype.oToFixed=Number.prototype.toFixed;Number.prototype.toFixed=function(m){m=Math.max(0,parseInt(void 0===m?0:m));a=this.toString();-1!==a.indexOf("e")&&(l=a.split("e"),h="-"===l[0][0]?"-":"",d="-"===h?parseFloat(l[0].substring(1)).oToFixed(11):parseFloat(l[0]).oToFixed(11),f=parseInt(l[1]),b=d.indexOf("."),d=d.replace(".",""),0>b+f?(b=0>b?1:b,a=h+"0."+"0".repeat(Math.abs(b+f))+d):a=h+d+"0".repeat(f-d.length+1));b=a.indexOf(".");
-1===b?0<m&&(a+="."+"0".repeat(m)):(c=a.length-b-1,a=c>=m?11>=m?parseFloat(a).oToFixed(m):a.substring(0,b+m+1):a+"0".repeat(m-c));return a}}if(b.loadLib)return b;var d=360/(2*Math.PI),h=2*Math.PI/360,p=Math.floor,c,f,l,n;b.rangeOK=1;b.cssScale=1;b.radToDeg=function(a){return a*d};b.degToRad=function(a){return a*h};b.getFeatures=function(){var c="";try{c=navigator.appVersion.toLowerCase()}catch(g){console.warn("navigator.appVersion is deprecated")}b.hasTouchSupport=window.hasOwnProperty&&window.hasOwnProperty("ontouchstart")||
"ontouchstart"in window||/android/i.test(c);b.isIOS=/iPad|iPhone/i.test(navigator.userAgent);c=b.newHTML("canvas");b.hasCanvas=c.getContext&&c.getContext("2d");b.hasCanvas&&(c.width=c.height=1,b.ctx=b.hasCanvas,b._ratio=2);a()};b.removeNeedlessDecimals=function(a){if("string"==typeof a&&(l=a.indexOf("."),-1!==l)){n=a.substring(l);if(0==parseFloat(n))return a.substring(0,l);for(var b=n.length-1;0<b;b--)if("0"!==n.charAt(b))return a.substring(0,l+b+1)}return a};b.whichBtn=function(a){return a.touches?
"L":0===a.button?"L":1===a.button?"M":"R"};b.createGradient=function(a,b,c){a=void 0===a?0:a;b=void 0===b?100:b;c="linear-gradient("+(void 0===c?0:c)+"deg,";for(var m=2*a,g=a;g<b;g++)a=p(100-g-35),c+="rgba(0,0,0,"+a*a*192/1E4/255+") "+(2*g-m)+"%, ";return c+"rgba(0,0,0,0.1) 100%)"};b.getCursorPosition=function(a,g){c=a.touches?a.touches[0]:a;f=g.getBoundingClientRect();return c?{x:(c.pageX-window.scrollX-f.left)/b.cssScale,y:(c.pageY-window.scrollY-f.top)/b.cssScale}:null};b.splitSeparator=function(a){a=
a.replace(/\\n/g,"\n");for(var b=!1,c,m=[],l=0,d=0,h=a.length;d<h;d++)c=a.charAt(d),"'"===c&&(b=!b),b||";"!==c&&"\n"!==c||(m.push(a.substring(l,d).replace(/\n/g,"\\n")),l=d+1);m.push(a.substring(l).replace(/\n/g,"\\n"));return m};b.preventDefault=function(a){a.stopPropagation();a.preventDefault();return!1};b.convertHTMLEntities=function(a){var c=b.newHTML("textarea");c.innerHTML=a;return c.value};b.newHTML=function(a,b){a=document.createElement(a);for(var c in b)a.setAttribute(c,b[c]);return a};window.requestAnimationFrame=
window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;window.cancelAnimationFrame=window.cancelAnimationFrame||window.mozCancelAnimationFrame;b.setInterval=function(a,b){function c(){Date.now()-g>=b&&(a.call(),g=Date.now());l.value=requestAnimationFrame(c)}if(!requestAnimationFrame)return setInterval(a,b);var g=Date.now(),l={};l.value=requestAnimationFrame(c);return l};b.clearInterval=function(a){a&&(cancelAnimationFrame?
cancelAnimationFrame(a.value):clearInterval(a))};b.setTimeout=function(a,b){function c(){Date.now()-l>=b?a.call():g.value=requestAnimationFrame(c)}if(!requestAnimationFrame)return setTimeout(a,b);var l=Date.now(),g={};g.value=requestAnimationFrame(c);return g};b.clearTimeout=function(a){a&&(cancelAnimationFrame?cancelAnimationFrame(a.value):clearTimeout(a))};b.showAbout=function(){window.open("https://arquimedes.matem.unam.mx/Descartes5/creditos/","cr\u00e9ditos","width=700,height=500,titlebar=0,toolbar=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0")};
return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;b.cacheFiles=Object.create(null);b.openFile=function(a){if(b.cacheFiles[a])return b.cacheFiles[a];var d=null,h=new XMLHttpRequest;h.open("GET",a,!1);try{h.send(null),d=200===h.status||304===h.status?h.responseText:h.responseText||"",d=404===h.status?"":d,d.match(String.fromCharCode(65533))&&(h.open("GET",a,!1),h.overrideMimeType("text/plain;charset=ISO-8859-1"),h.send(null),d=h.responseText)}catch(p){d=null}return d};b.addExternalFileContent=function(a,
d){b.cacheFiles[a]=d};return b}(descartesJS||{});
descartesJS=function(b){function a(a){y=a.indexOf("--radial--");-1!=y&&(a=a.substring(0,y));a=a.replace(/\+/g,"\\+").replace(/\*/g,"\\*");c=a.trim();a={ignoreAccents:!1,ignoreCaps:!1,regExp:null};c[0]==c[c.length-1]&&"'"==c[0]&&(a.ignoreCaps=!0,c=c.substring(1,c.length-1),"`"==c[0]&&"\u00b4"==c[c.length-1]&&(a.ignoreAccents=!0,c=c.substring(1,c.length-1)));"`"==c[0]&&"\u00b4"==c[c.length-1]&&(a.ignoreAccents=!0,c=c.substring(1,c.length-1),c[0]==c[c.length-1]&&"'"==c[0]&&(a.ignoreCaps=!0,c=c.substring(1,
c.length-1)));c.startsWith("\\*")&&!c.endsWith("\\*")?c=c.substring(2)+"$":!c.startsWith("\\*")&&c.endsWith("\\*")?c="^"+c.substring(0,c.length-2):c.startsWith("\\*")||c.endsWith("\\*")?c.startsWith("\\*")&&c.endsWith("\\*")&&(c=c.substring(2,c.length-2)):c="^"+c+"$";a.regExp=c.replace(/\?/g,"[\\S\\s]{1}");return a}function d(a,b){c=(a||"").trim();a={ignoreAccents:!1,ignoreCaps:!1,regExp:null};a.expr=c.split(",");a.expr[0]=a.expr[0].trim();a.expr[0]={type:a.expr[0].charAt(0),expr:b.parser.parse(a.expr[0].substring(1))};
a.expr[1]=a.expr[1].trim();a.expr[1]={type:a.expr[1].charAt(a.expr[1].length-1),expr:b.parser.parse(a.expr[1].slice(0,-1))};return a}function h(a,b,c){b=parseFloat(b);a=$jscomp.makeIterator(a.expr);m=a.next().value;g=a.next().value;q=c.eval(m.expr);e=c.eval(g.expr);r="("==m.type||"["==m.type;x=")"==g.type||"]"==g.type;return r&&b>q&&x&&b<=e?1:0}function p(a){return a.toString().replace(/\u00e1/g,"a").replace(/\u00e9/g,"e").replace(/\u00ed/g,"i").replace(/\u00f3/g,"o").replace(/\u00fa/g,"u").replace(/\u00c1/g,
"A").replace(/\u00c9/g,"E").replace(/\u00cd/g,"I").replace(/\u00d3/g,"O").replace(/\u00da/g,"U").replace(/\u00f1/g,"n").replace(/\u00d1/g,"N")}if(b.loadLib)return b;var c,f,l,n,m,g,q,e,r,x,y;b.buildRegularExpressionsPatterns=function(b,g){b=b||"";"("===b.charAt(0)&&")"===b.charAt(b.length-1)&&-1===b.indexOf(",")&&(b=b.substring(1,b.length-1));b=b.replace(/&squot;/g,"'").replace(/&amp;/g,"&").split("|");for(var m=0,e=b.length;m<e;m++){f=b[m].split("&");l=[];for(var h=0,q=f.length;h<q;h++)c=f[h],-1===
c.indexOf(",")||"("!==c.charAt(0)&&"["!==c.charAt(0)||")"!==c.charAt(c.length-1)&&"]"!==c.charAt(c.length-1)?l.push(a(c)):l.push(d(c,g));b[m]=l}return b};b.escorrecto=function(a,c,g,l){g=g||b.externalEvaluator;l=l||b.buildRegularExpressionsPatterns(a,g);c=p(c);a=0;for(var m=l.length;a<m;a++){f=l[a];n=!0;for(var e=0,d=f.length;e<d;e++)n=f[e].regExp?n&&!!c.match(new RegExp(p(f[e].regExp),"i")):n&&h(f[e],c,g);if(n)return 1}return 0};b.esCorrecto=function(a,g,l,m){l=l||b.externalEvaluator;m=m||b.buildRegularExpressionsPatterns(a,
l);g+="";a=0;for(var e=m.length;a<e;a++){f=m[a];n=!0;for(var d=0,q=f.length;d<q;d++)(c=f[d].regExp)?(f[d].ignoreAccents&&(g=p(g),c=p(c)),f[d].ignoreCaps&&(g=g.toLowerCase(),c=p(c).toLowerCase()),n=n&&!!g.match(c)):n=n=n&&h(f[d],g,l);if(n)return 1}return 0};return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;b.loaderImg=new Image;b.loaderImg.src="data:image/svg+xml;base64,"+btoa("<svg xmlns='http://www.w3.org/2000/svg' width='880' height='840' viewBox='0 0 880 840'><path d='M440 80c-132.5 0-240 107.5-240 240s107.5 240 240 240 240-107.5 240-240S572.5 80 440 80zm-11.1 462.2c-122.7 0-224.4-99.5-224.4-222.2S306.2 97.8 428.9 97.8 651.1 197.3 651.1 320s-99.5 222.2-222.2 222.2zm-11.1-426.6c-112.9 0-208.9 91.5-208.9 204.4s96 204.4 208.9 204.4S622.2 432.9 622.2 320s-91.5-204.4-204.4-204.4zm-11.1 391.1c-103.1 0-193.3-83.6-193.3-186.7s90.2-186.7 193.3-186.7S593.3 216.9 593.3 320s-83.5 186.7-186.6 186.7zm-11.1-355.6c-93.3 0-177.8 75.6-177.8 168.9s84.5 168.9 177.8 168.9S564.4 413.3 564.4 320c0-93.3-75.6-168.9-168.8-168.9zm-11.2 320c-83.5 0-162.2-67.7-162.2-151.1S301 168.9 384.4 168.9 535.6 236.5 535.6 320s-67.7 151.1-151.2 151.1zm-11.1-284.4c-73.6 0-146.7 59.7-146.7 133.3s73 133.3 146.7 133.3S506.7 393.6 506.7 320 447 186.7 373.3 186.7zm-11.1 248.9c-63.8 0-131.1-51.7-131.1-115.6s67.3-115.6 131.1-115.6S477.8 256.2 477.8 320 426 435.6 362.2 435.6zm-11.1-213.4c-54 0-115.6 43.8-115.6 97.8s61.6 97.8 115.6 97.8c54 0 97.8-43.8 97.8-97.8s-43.8-97.8-97.8-97.8zM340 400c-44.2 0-100-35.8-100-80s55.8-80 100-80 80 35.8 80 80-35.8 80-80 80z' fill='#2daae4'/><path d='M115.8 600.7c32.5 0 48.8 24.8 48.8 49.7 0 24.9-16.2 49.6-48.8 49.6H80.2v-99.3zm0 85c23 0 34.6-17.6 34.6-35.2s-11.6-35.4-34.6-35.4H94.5v70.6zm118.2 0V700h-60.6v-99.3h60.5V615h-46v28h45v14.5h-45l-.05 28.2zm42.2.9c10.6 0 22.3-6 22.3-16.2 0-1-.1-2.1-.4-3.4-1.7-7.5-11.9-8.8-21.9-9.8-15.5-1.6-33.7-5-35.2-25.65-.6-6.65 1.1-13.25 5.4-18.85 6.7-8.7 18.6-13.2 30.1-13.2 15.3 0 31.2 8 33.8 26.1l-14.3.7c-2-8.9-11.6-12.8-20.3-12.6-6.7.1-14.1 2.4-18 7.5-2 2.6-2.7 5.8-2.4 9.2.7 10.2 11.9 11.5 22.6 12.5 13.6 1.7 30.5 5.3 34.4 21.2.4 2.1.7 4.5.7 6.5 0 19.2-19 30.2-36.9 30.2-15.3 0-33.9-9.1-35.8-26.8l-.1-2.7 14.5-.3.1 1.8c1 8.9 12.2 13.8 21.4 13.8zm58-71.7c8.7-8.9 20.9-14.8 34.4-14.8 22.7 0 40.6 14.2 46.3 36.6h-14.2c-5.3-14.9-17.5-22.4-32.1-22.4-9.5 0-18.2 4.1-24.4 10.7-6.2 6.5-10.2 15.3-10.2 25.6 0 9.9 4 18.7 10.2 25.3 6.2 6.6 14.9 10.6 24.4 10.6 15.1 0 27.8-8.7 32.9-23.7h14.1c-5.7 22.6-23.9 37.9-47 37.9-13.5 0-25.7-5.7-34.4-14.8-8.5-9.1-14.2-21.6-14.2-35.4 0-14 5.7-26.5 14.2-35.6zm144.6 55.8h-35.6c-3.8 9.1-8.8 21-11.9 29.3h-15.5l39.9-100.7h10.5L506 700h-15.3zm-30.3-13.4h24.7L461 622.2zm96.9-7.7c12.1 0 18-8.7 18-17.3 0-8.5-6-17.2-18-17.2h-22V700h-14.2v-99.4h36.2c21.6 0 32.4 15.9 32.4 31.7 0 14.1-8.7 27.4-25.7 30.4l31.4 37.3h-18.6l-36.2-43.6-.05-6.8zm64.9 50.8v-85.3h-30.1v-14.5h74.4v14.5h-30v85.3zm112.2-14.7V700H662v-99.3h60.5V615h-46v28h45v14.5h-45l-.05 28.2zm42.3.9c10.6 0 22.3-6 22.3-16.2 0-1-.1-2.1-.4-3.4-1.7-7.5-11.9-8.8-21.9-9.8-15.5-1.6-33.7-5-35.2-25.65-.6-6.65 1.1-13.25 5.4-18.85 6.7-8.7 18.6-13.2 30.1-13.2 15.3 0 31.2 8 33.8 26.1l-14.3.7c-2-8.9-11.6-12.8-20.3-12.6-6.7.1-14.1 2.4-18 7.5-2 2.6-2.7 5.8-2.4 9.2.7 10.2 11.9 11.5 22.6 12.5 13.6 1.7 30.5 5.3 34.4 21.2.4 2.1.7 4.5.7 6.5 0 19.2-19 30.2-36.9 30.2-15.3 0-33.9-9.1-35.8-26.8l-.1-2.7 14.5-.3.1 1.8c1 8.9 12.2 13.8 21.4 13.8z' fill='#868686'/></svg>");b.getSvgArrowUp=
function(a,b){return"data:image/svg+xml;base64,"+btoa('<svg xmlns=\'http://www.w3.org/2000/svg\' width="24" height="24" viewBox="0 0 24 24"><path transform="rotate('+(a?90:0)+',12,12)" fill="#'+(void 0===b?"24c":b)+'" d="m19.5 17.5-7.5-12-7.5 12z"/></svg>')};b.getSvgArrowDown=function(a,b){return"data:image/svg+xml;base64,"+btoa('<svg xmlns=\'http://www.w3.org/2000/svg\' width="24" height="24" viewBox="0 0 24 24"><path transform="rotate('+(a?90:0)+',12,12)" d="m19.5 5-7.5 12-7.5-12z" fill="#'+(void 0===
b?"d00018":b)+'"/></svg>')};b.getSvgMenu=function(){return"data:image/svg+xml;base64,"+btoa("<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path d='M6.64 8L12 12.962 17.36 8 19 9.519 12 16 5 9.519z'/></svg>")};b.getSvgCheckbox=function(){return"data:image/svg+xml;base64,"+btoa("<svg xmlns='http://www.w3.org/2000/svg' width='45' height='45' viewBox='0 0 45 45'><path d='M37.095 6.284L15.473 27.905l-7.568-7.567L2.5 25.743l12.973 12.973L42.5 11.69z' fill='#1e272e'/></svg>")};
b.getSvgRadio=function(){return"data:image/svg+xml;base64,"+btoa('<svg xmlns=\'http://www.w3.org/2000/svg\' width="45" height="45" viewBox="0 0 45 45"><circle cx="22.5" cy="22.5" r="15" fill="#1e272e"/></svg>')};return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=Math.floor,d=/[\w-//]*(\.png|\.jpg|\.gif|\.svg|\.webp)/gi,h,p,c,f,l,n,m,g,q,e,r,x,y,u,v,A,w,z,B=function(a,g){this.r=this.g=this.b=0;this.a=1;this.evaluator=g;this.getColor=this.getColorStr;if(!a)this.colorStr="rgba("+this.r+","+this.g+","+this.b+","+this.a+")";else if(/^GradL/.test(a)){a=this.splitComa(a.substring(6,a.length-1));this.x1=this.evaluator.parser.parse(a[0]);this.y1=this.evaluator.parser.parse(a[1]);this.x2=this.evaluator.parser.parse(a[2]);
this.y2=this.evaluator.parser.parse(a[3]);this.stops=[];for(var l=4;l<a.length;l++)""!=a[l]&&(g=a[l].split("|"),this.stops.push({percentage:this.evaluator.parser.parse(g[1]),color:"#"+g[2]}));this.getColor=this.getLinearGradient}else if(/^Pattern/.test(a))this.img_src=a.substring(8,a.length-1),this.img_src.match(d)&&(this.img_src="'"+this.img_src+"'"),this.img_src=this.evaluator.parser.parse(this.img_src),this.getColor=this.getPattern;else if(babel[a])"net"===babel[a]&&(a="rojo"),a=babel[a],this.r=
b.toHex(a.substring(1,3)),this.g=b.toHex(a.substring(3,5)),this.b=b.toHex(a.substring(5,7)),this.colorStr=a;else if(6===a.length)this.r=b.toHex(a.substring(0,2)),this.g=b.toHex(a.substring(2,4)),this.b=b.toHex(a.substring(4,6)),this.colorStr="#"+a;else if(8===a.length)this.r=b.toHex(a.substring(2,4)),this.g=b.toHex(a.substring(4,6)),this.b=b.toHex(a.substring(6,8)),this.a=1-b.toHex(a.substring(0,2))/255,this.colorStr="rgba("+this.r+","+this.g+","+this.b+","+this.a+")";else if("("===a[0]){p=[];c=this.splitComa(a.substring(1,
a.length-1));a=0;for(g=c.length;a<g;a++)n=c[a],f=parseInt(n,16),n!==f.toString(16)&&n!=="0"+f.toString(16)?("["===n.charAt(0)&&"]"===n.charAt(n.length-1)&&(n=n.substring(1,n.length-1)),p.push(this.evaluator.parser.parse(n))):p.push(this.evaluator.parser.parse((f/255).toString()));this.rExpr=p[0];this.gExpr=p[1];this.bExpr=p[2];this.aExpr=p[3];this.getColor=this.getColorExp}};B.prototype.splitComa=function(a){l=[];for(var b=q=g=m=0,c=a.length;b<c;b++)e=a[b],"("===e?m++:")"===e?m--:"["===e?g++:"]"===
e?g--:","===e&&0===m&&0===g&&(l.push(a.substring(q,b)),q=b+1);l.push(a.substring(q));return l};B.prototype.getColorStr=function(){return this.colorStr};B.prototype.getColorExp=function(){h=this.evaluator;this.r=a(255*h.eval(this.rExpr));this.g=a(255*h.eval(this.gExpr));this.b=a(255*h.eval(this.bExpr));this.a=1-h.eval(this.aExpr);return"rgba("+this.r+","+this.g+","+this.b+","+this.a+")"};B.prototype.getLinearGradient=function(){h=this.evaluator;A=b.ctx.createLinearGradient(h.eval(this.x1),h.eval(this.y1),
h.eval(this.x2),h.eval(this.y2));for(var a=0;a<this.stops.length;a++)v=h.eval(this.stops[a].percentage),v=0>v?0:1<v?1:v,A.addColorStop(v,this.stops[a].color);return A};B.prototype.getPattern=function(){z=this.evaluator.parent;if(w=z.getImage(this.evaluator.eval(this.img_src)))try{return b.ctx.createPattern(w,"repeat")}catch(D){}return"ff00ff"};B.prototype.borderColor=function(){return 380>this.r+this.g+this.b?"#ffffff":"#000000"};b.toHex=function(a){return parseInt("0x"+a,16)};b.RGBAToHexColor=function(a){a=
a.substring(5,a.length-1).split(",");r=parseInt(a[0]).toString(16).padStart(2,"0");x=parseInt(a[1]).toString(16).padStart(2,"0");y=parseInt(a[2]).toString(16).padStart(2,"0");u=(255-parseInt(255*parseFloat(a[3]))).toString(16).padStart(2,"0");return new B(u+r+x+y)};b.Color=B;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=function(a){var d=this;this.parent=a;this.container=b.newHTML("div",{class:"DescartesKeyboardContainer"});this.display=b.newHTML("textarea",{class:"DescartesKeyboardDisplay",spellcheck:"false",inputmode:"none"});this.container.appendChild(this.display);this.keyContainer=b.newHTML("div",{style:"position:absolute; padding-bottom:5px;",class:"DescartesKeysContainer"});this.container.appendChild(this.keyContainer);this.additionalKeys=b.newHTML("div",
{style:"position:absolute; padding: 0 5px 5px 0; display:none;",class:"DescartesKeysContainer"});this.container.appendChild(this.additionalKeys);this.newLine=b.newHTML("div",{style:"position:absolute; background-color:white; margin:0; font-family:DJS_sansserif; font-size:17px; font-weight:normal; line-height:38px",class:"new_line_btn"});this.newLine.textContent="\\n";this.newLine.addEventListener("pointerup",function(){d.insert("\n")});this.container.appendChild(this.newLine);this.display.addEventListener("keydown",
function(a){d.keypressed=!0;if(27===a.keyCode)d.close();else if(13===a.keyCode)d.onEnter()});this.key_pressed=this.delete_pressed=!1;var p,c;this.keyContainer.addEventListener("pointerdown",function(a){if(/^(k_op|k_dot|k_a|k_e|k_i|k_o|k_u)$/.test(a.target.id)){a.target.onpointerleave=function(){clearTimeout(p)};var b=a.target.textContent.trim().toLowerCase();p=setTimeout(function(){d.key_pressed=!0;d.showAditionalKeys(b)},600)}else"k_del"==a.target.id&&(a.target.onpointerleave=function(){clearTimeout(c)},
c=setInterval(function(){d.delete_pressed=!0;d.delete()},200))});this.keyContainer.addEventListener("pointerup",function(a){if(a.target!=d.keyContainer&&a.target!=d.container)if(a.preventDefault(),a.stopPropagation(),"k_left"==a.target.id)d.display.selectionStart=d.display.selectionEnd=Math.max(0,d.display.selectionStart-1);else if("k_right"==a.target.id)d.display.selectionStart=d.display.selectionEnd=Math.min(d.display.value.length,d.display.selectionStart+1);else if("k_del"==a.target.id)d.delete_pressed||
d.delete(),clearTimeout(c),d.delete_pressed=!1;else if("k_\u221a"==a.target.id)d.insert("\u221a(");else if("k_space"==a.target.id)d.insert(" ");else if("k_esc"==a.target.id)d.close();else if("k_shift"==a.target.id){a=d.keyContainer.querySelectorAll("div");var b=d.additionalKeys.querySelectorAll("div");d.shift=!d.shift;d.shift?(a.forEach(function(a){1==a.textContent.trim().length&&(a.textContent=a.textContent.toUpperCase());"k_point_comma"==a.getAttribute("id")&&(a.textContent=",")}),b.forEach(function(a){a.textContent=
a.textContent.toUpperCase()})):(a.forEach(function(a){1==a.textContent.trim().length&&(a.textContent=a.textContent.toLowerCase());"k_point_comma"==a.getAttribute("id")&&(a.textContent=".")}),b.forEach(function(a){a.textContent=a.textContent.toLowerCase()}))}else if("k_num_layout"==a.target.id)d["setLayout_"+d.layout_mode.replace("alfa","num")]();else if("k_alfa_layout"==a.target.id)d["setLayout_"+d.layout_mode.replace("num","alfa")]();else if("k_clear"==a.target.id)d.display.value="";else if(/^(k_op|k_dot|k_a|k_e|k_i|k_o|k_u)$/.test(a.target.id))clearTimeout(p),
d.key_pressed||(d.insert(a.target.textContent.trim()),d.additionalKeys.style.display="none"),d.key_pressed=!1;else if("k_return"==a.target.id)d.onEnter();else a=a.target.textContent.trim(),d.insert(a),d.additionalKeys.style.display="none";d.display.focus()});this.keyContainer.addEventListener("mouseup",function(a){a.preventDefault();a.stopPropagation()});var f=!1;this.additionalKeys.addEventListener("pointerdown",function(a){f=!0});this.additionalKeys.addEventListener("pointerup",function(a){f&&(a.target!=
d.keyContainer&&a.target!=d.container&&(a.preventDefault(),a.stopPropagation(),a=a.target.textContent.trim(),d.insert(a)),d.key_pressed=!1,d.additionalKeys.style.display="none");f=!1;d.display.focus()})};a.prototype.insert=function(a){this.display.setRangeText(a);this.display.selectionStart+=a.length;this.display.selectionStart=this.display.selectionEnd;this.display.focus()};a.prototype.delete=function(){this.display.selectionStart==this.display.selectionEnd&&(this.display.selectionStart=Math.max(0,
this.display.selectionStart-1));this.display.setRangeText("")};a.prototype.addKey=function(a,b,p){return"<div "+(b?"id='"+b+"'":"")+" "+(p?"style='"+p+"'":"")+">"+a+"</div>"};a.prototype.addKeys=function(a){var b=this,d="";a.forEach(function(a){d="object"===typeof a?d+b.addKey(a.val,a.id,a.style):d+b.addKey(a)});return d};a.prototype.showAditionalKeys=function(a){var b=[];"."==a?b=",;:-_\u00bf?\u00a1!()".split(""):"+"==a?b=["-","\u00d7","\u00f7","^"]:"a"==a?b=["\u00e1","\u00e0","\u00e4","\u00e2"]:
"e"==a?b=["\u00e9","\u00e8","\u00eb","\u00ea"]:"i"==a?b=["\u00ed","\u00ec","\u00ef","\u00ee"]:"o"==a?b=["\u00f3","\u00f2","\u00f6","\u00f4"]:"u"==a&&(b=["\u00fa","\u00f9","\u00fc","\u00fb"]);this.additionalKeys.innerHTML=this.addKeys(b);this.shift&&(this.additionalKeys.innerHTML=this.additionalKeys.innerHTML.toUpperCase());this.additionalKeys.style.display="flex";this.additionalKeys.style.left=this.keyContainer.style.left;this.additionalKeys.style.top=parseFloat(this.keyContainer.style.top)-50+"px"};
a.prototype.setLayout_14x1=function(){this.keyContainer.innerHTML=this.addKeys([1,2,3,4,5,6,7,8,9,0,{val:this.parent.decimal_symbol},"-",{val:"\u232b",id:"k_del"},{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="635px"};a.prototype.setLayout_7x2=function(){this.keyContainer.innerHTML=this.addKeys([1,2,3,4,5,{val:this.parent.decimal_symbol},{val:"\u232b",id:"k_del"},6,7,8,9,0,"-",{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="320px"};a.prototype.setLayout_10x2=function(){this.keyContainer.innerHTML=
this.addKeys(["(",1,2,3,4,5,"\u00b2","/","\u00d7",{val:"\u232b",id:"k_del"},")",6,7,8,9,0,{val:this.parent.decimal_symbol},"-","+",{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="455px"};a.prototype.setLayout_4x4=function(){this.keyContainer.innerHTML=this.addKeys([7,8,9,{val:"\u232b",id:"k_del"},4,5,6,"+",1,2,3,"-",{val:0,style:"width:85px;"},{val:this.parent.decimal_symbol},{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="185px"};a.prototype.setLayout_5x4=function(){this.keyContainer.innerHTML=
this.addKeys([7,8,9,"\u00b2",{val:"\u232b",id:"k_del"},4,5,6,"/","\u00d7",1,2,3,"\u2212","+",{val:0,style:"width:85px;"},".",{val:"\u21b5",id:"k_return",style:"margin-left:50px;"}]);this.keyContainer.style.width="230px"};a.prototype.setLayout_11x3=function(){this.keyContainer.innerHTML=this.addKeys(["q","w",{val:"e",id:"k_e"},"r","t","y",{val:"u",id:"k_u"},{val:"i",id:"k_i"},{val:"o",id:"k_o"},"p",{val:"\u232b",id:"k_del"},{val:"a",id:"k_a"},"s","d","f","g","h","j","k","l","\u00f1",{val:".",id:"k_dot"},
{val:"\u21c5",id:"k_shift"},"z","x","c","v","b","n","m",{val:"",id:"k_space",style:"width:85px;"},{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="500px";this.shift=!1};a.prototype.setLayout_11x4=function(){this.keyContainer.innerHTML=this.addKeys([1,2,3,4,5,6,7,8,9,0,{val:"\u232b",id:"k_del"},"q","w",{val:"e",id:"k_e"},"r","t","y",{val:"u",id:"k_u"},{val:"i",id:"k_i"},{val:"o",id:"k_o"},"p",{val:"+",id:"k_op"},{val:"a",id:"k_a"},"s","d","f","g","h","j","k","l","\u00f1",{val:".",id:"k_dot"},
{val:"\u21c5",id:"k_shift"},"z","x","c","v","b","n","m",{val:"",id:"k_space",style:"width:85px;"},{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="500px"};a.prototype.setLayout_10x4_alfa=function(){this.keyContainer.innerHTML=this.addKeys(["q","w",{val:"e",id:"k_e"},"r","t","y",{val:"u",id:"k_u"},{val:"i",id:"k_i"},{val:"o",id:"k_o"},"p",{val:"a",id:"k_a"},"s","d","f","g","h","j","k","l","\u00f1",{val:"\u21c5",id:"k_shift",style:"width:62.5px;"},"z","x","c","v","b","n","m",{val:"\u232b",
id:"k_del",style:"width:62.5px;"},{val:"123",id:"k_num_layout",style:"width:85px;"},{val:"",id:"k_space",style:"width:220px;transform:none !important;"},{val:"/",id:"k_slash"},{val:".",id:"k_dot"},{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="455px"};a.prototype.setLayout_10x4_num=function(){this.keyContainer.innerHTML=this.addKeys(["1","2","3","4","5","6","7","8","9","0","@",'"',"$","_","-","+","(",")","/","*","&","|","\u00ba",":",";","\u00a1","!","\u00bf","?",{val:"\u232b",id:"k_del"},
{val:"ABC",id:"k_alfa_layout",style:"width:85px;"},{val:"",id:"k_space",style:"width:220px;transform:none !important;"},{val:",",id:"k_slash"},{val:".",id:"k_dot"},{val:"\u21b5",id:"k_return"}]);this.keyContainer.style.width="455px"};a.prototype.showCustomKB=function(a){var b=a.querySelectorAll("div");a=parseInt(a.getAttribute("cols")||b.length);var d=[],c,f;b=$jscomp.makeIterator(b);for(c=b.next();!c.done;c=b.next()){var l=c.value;c={val:l.textContent};if(f=l.getAttribute("id"))c.id=f;if(f=l.getAttribute("size"))c.style=
"width:"+(40*parseInt(f)+5*(parseInt(f)-1))+"px;transform:none !important;";d.push(c)}this.keyContainer.innerHTML=this.addKeys(d);this.keyContainer.style.width=5+45*a+"px"};a.prototype.setLayout=function(a){this.layout_mode=a;var b=document.getElementById("kb_"+a);b?this.showCustomKB(b):"14x1"==a?this.setLayout_14x1():"7x2"==a?this.setLayout_7x2():"10x2"==a?this.setLayout_10x2():"4x4"==a?this.setLayout_4x4():"5x4"==a?this.setLayout_5x4():"11x3"==a?this.setLayout_11x3():"11x4"==a?this.setLayout_11x4():
"10x4_alfa"==a?this.setLayout_10x4_alfa():"10x4_num"==a?this.setLayout_10x4_num():this.setLayout_14x1()};a.prototype.show=function(a,b,p,c,f,l,n){this.ctr=a;this.var_id=f;this.onlyText=n;this.container.parentNode||this.parent.container.appendChild(this.container);this.container.style.display="block";this.setDisplay(l);this.setLayout(b);this.keyContainer.style.left=p+"px";this.keyContainer.style.top=c+"px";this.additionalKeys.style.display="none"};a.prototype.close=function(){this.container.style.display=
"none";this.parent.deactivateControls();this.parent.update()};a.prototype.setDisplay=function(a){if("custom"==a.type){var d=a.x;var p=a.y;var c=a.w;var f=a.h;var l=a.fs}else p=this.container.getBoundingClientRect(),f=a.getBoundingClientRect(),d=f.left/b.cssScale-p.left/b.cssScale,p=f.top/b.cssScale-p.top/b.cssScale,c=f.width/b.cssScale,f=f.height/b.cssScale,l=a.style.fontSize;"textarea"==a.tagName.toLowerCase()?(this.display.setAttribute("style","left:"+d+"px;top:"+p+"px;width:"+c+"px;height:"+f+
"px;font-size:"+l+";line-height:1.2em;padding:5px;font:"+a.style.font+";"),this.newLine.style.left=d+c-42+"px",this.newLine.style.top=p+f-42+"px",this.newLine.style.display="block"):(this.display.setAttribute("style","left:"+d+"px;top:"+p+"px;width:"+c+"px;height:"+f+"px;font-size:"+l+";line-height:"+f+"px;white-space:nowrap;"),this.newLine.style.display="none");this.display.value=a.value||"";this.display.focus();this.display.selectionStart=this.display.selectionEnd=this.display.value.length};a.prototype.onEnter=
function(){var a=this.display.value;if(!this.onlyText){var b=this.parent.evaluator.parser.parse(a.replace(/\u221a/g,"sqrt"));try{b&&(a=this.parent.evaluator.eval(b))}catch(f){a=0}}if(this.ctr)this.ctr.changeValue(a,!0);else if(this.var_id=(this.var_id+"").trim(),b=this.var_id.indexOf("["),-1==b)this.parent.evaluator.setVariable(this.var_id,a);else{var p=this.var_id.indexOf(","),c=this.var_id.substring(0,b);-1==p?this.parent.evaluator.setVector(c,parseInt(this.var_id.substring(b+1)),a):this.parent.evaluator.setMatrix(c,
parseInt(this.var_id.substring(b+1)),parseInt(this.var_id.substring(p+1)),a)}this.close()};b.Keyboard=a;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=document.head,d=b.newHTML("meta",{name:"viewport",content:"width=device-width,initial-scale=1.0,user-scalable=yes"});a.querySelector("meta[name=viewport]")||a.appendChild(d);d=b.newHTML("meta",{name:"mobile-web-app-capable",content:"yes"});a.appendChild(d);d=b.newHTML("meta",{name:"apple-mobile-web-app-capable",content:"yes"});a.appendChild(d);d=b.newHTML("meta",{name:"apple-mobile-web-app-status-bar-style",content:"black"});a.appendChild(d);(a=
document.getElementById("StyleDescartesApps2"))&&a.remove();a=b.newHTML("style",{rel:"stylesheet",type:"text/css",id:"StyleDescartesApps2"});document.head.insertBefore(a,document.head.firstChild);a.innerHTML="body{-webkit-font-smoothing:antialiased;}\n#descartesJS_north,#descartesJS_south,#descartesJS_east,#descartesJS_west{background:#c0c0c0;position:absolute;z-index:100;}\n.PBL{position:absolute;background-color:#f2f2f2;border:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;color:#2daae4;visibility:hidden;border-radius:100vw;}\n.PBL::-moz-progress-bar{background:#2daae4;border-radius:inherit;}\n.PBL::-webkit-progress-bar{background:#f2f2f2;border-radius:100vw;}\n.PBL::-webkit-progress-value{background:#2daae4;border-radius:inherit;}\n.PBL::-ms-fill{background:#2daae4;border-radius:inherit;}\n.DescartesAppContainer *,.DescartesAppContainer *:before,.DescartesAppContainer *:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;transform:translate3d(0,0,0);}\n.DescartesAppContainer{border:none;overflow:hidden;position:relative;top:0;left:0;}\n.DescartesCatcher{background-color:rgba(0,0,0,0);cursor:pointer;position:absolute;}\n.DescartesLoader{background-color:#fff;overflow:hidden;position:absolute;top:0;left:0;z-index:1000;width:100%;height:100%;display:none;}\n.DescartesLoaderImage{position:absolute;background-repeat:no-repeat;background-position:center;overflow:hidden;top:0;left:0;width:100%;height:100%;}\n.DescartesSpace2DCanvas,.DescartesSpace3DCanvas,.blocker{touch-action:none;position:absolute;overflow:hidden;left:0;top:0;}\n.DescartesSpace2DContainer,.DescartesSpace3DContainer{position:absolute;overflow:hidden;line-height:0;}\n.DescartesCheckboxContainer input[type=checkbox],.DescartesCheckboxContainer input[type=radio]{display: none;}\n.DescartesCheckboxContainer input[type=checkbox]+label::after{position:absolute;left:0px;content:'';padding:0;margin:0;width:100%;height:100%;background:#fff;border:1px solid gray;}\n.DescartesCheckboxContainer input[type=checkbox]:checked+label::after{content:'';background:url("+
b.getSvgCheckbox()+") center center no-repeat;background-size:contain;background-color:#fff;}\n.DescartesCheckboxContainer input[type=radio]+label::after{position:absolute;left:0px;content:'';padding:0;margin:0;width:100%;height:100%;background:#fff;border:1px solid gray;border-radius:50%;}\n.DescartesCheckboxContainer input[type=radio]:checked+label::after{content:'';background:url("+b.getSvgRadio()+") center center no-repeat;background-size:contain;background-color:#fff;}\n.DescartesCheckbox{position:absolute;}\n.TextfieldCover{position:absolute;overflow:hidden;background-color:transparent;cursor:pointer;}\ninput[type=text]{-webkit-appearance:none;}\n.DescartesButton{position:absolute;cursor:pointer;}\n.DescartesButtonContainer,.DescartesSpinnerContainer,.DescartesCheckboxContainer,.DescartesTextFieldContainer,.DescartesMenuContainer{position:absolute;overflow:hidden;}\n.DescartesSpinnerContainer input,.DescartesCheckboxContainer,.DescartesTextFieldContainer input,.DescartesMenuContainer select{border-radius:0;}\n.DescartesSpinnerField,.DescartesTextFieldField,.DescartesMenuField,.DescartesScrollbarField,.DescartesSliderField{font-family:"+
b.sansserif_font+";padding:0 2px;border:solid #666 1px;position:absolute;  outline: none;}\n.DescartesSpinnerField:focus,.DescartesTextFieldField:focus,.DescartesMenuField:focus,.DescartesScrollbarField:focus,.DescartesSliderField:focus{border:2px solid #3f88fb;}\ninput[type=text]:disabled,.DescartesMenuSelect:disabled{background-color:#e3e3e3;cursor:not-allowed;opacity:1;}\n.DescartesSpinnerLabel,.DescartesCheckboxLabel,.DescartesMenuLabel,.DescartesScrollbarLabel,.DescartesSliderLabel,.DescartesTextFieldLabel{font-family:"+
b.sansserif_font+";font-weight:normal;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;position:absolute;left:0;top:0;}\n.DescartesGraphicControl{cursor:pointer;background-color:transparent;touch-action:none;border-style:none;position:absolute;}\n.DescartesTextAreaContainer{position:absolute;overflow:hidden;background:#F7F7F7;border:solid #666 1px;}\n.DescartesTextArea {position:absolute;padding:5px;left:2px;top:2px;background-color:white;text-align:left;border:none;outline:none;resize:none;}\n.DescartesTextArea:focus {outline:3px solid #3f88fb;}\n.DescartesMenuSelect{font-family:"+
b.sansserif_font+";padding-top:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;position:absolute;border:1px solid #7a8a99; background:#fff url('"+b.getSvgMenu()+"') 100%/22px no-repeat;padding:0 22px 0 5px;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;}\n.DescartesMenuSelect::-ms-expand{display:none;}\n.DescartesScrollbarContainer,.DescartesSliderContainer{touch-action:none;background:#eee;overflow:hidden;position:absolute;}\n.DescartesSliderContainer{background:transparent;}\n.DescartesRange{-webkit-appearance:none;appearance:none;background:transparent;cursor: pointer;}\n.DescartesRange::-webkit-slider-runnable-track{background:var(--track_color);height:var(--track_h);border-radius:var(--track_h);}\n.DescartesRange::-moz-range-track{background:var(--track_color);height:var(--track_h);border-radius:var(--track_h);}\n.DescartesRange::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;margin-top:calc(var(--track_h) / 2 - var(--thumb_size) / 2);border-radius:50%;background-color:var(--thumb_color);height:var(--thumb_size);width:var(--thumb_size);}\n.DescartesRange::-moz-range-thumb{border:none;border-radius:50%;background-color:var(--thumb_color);height:var(--thumb_size);width:var(--thumb_size);}\n.DJS_Up,.DJS_Down{cursor:pointer;position:absolute;border-width:1px 0 1px 1px;background-size:cover;background-repeat:none;background-position:center;}\n.DJS_Up[horizontal=false]{background-color:#f0f8ff;background-image:"+
b.createGradient(50,100)+", url('"+b.getSvgArrowUp()+"');}\n.DJS_Up[horizontal=true]{background-color:#f0f8ff;background-image:"+b.createGradient(50,100,90)+", url('"+b.getSvgArrowUp(!0)+"');}\n.DJS_Up[active=false]::after{cursor:not-allowed;content:'';position:absolute;left:0;top:0;width:100%;height:100%;background:rgba(255,255,255,0.3);}\n.DJS_Down[horizontal=false]{background-color:#f0f8ff;background-image:"+b.createGradient(0,50)+", url('"+b.getSvgArrowDown()+"');}\n.DJS_Down[horizontal=true]{background-color:#f0f8ff;background-image:"+
b.createGradient(50,100,-90)+", url('"+b.getSvgArrowDown(!0)+"');}\n.DJS_Down[active=false]::after{cursor:not-allowed;content:'';position:absolute;left:0;top:0;width:100%;height:100%;background:rgba(255,255,255,0.3);}\n.DescartesKeyboardContainer{position:absolute;left:0;top:0;width:100%;height:100%;background-color:rgba(0,0,0,0.1);z-index:1000;}\n.DescartesKeysContainer{display:flex;flex-direction:row;flex-wrap:wrap;background-color:#c0c0c0;border-radius:4px;border:1px solid rgba(0,0,0,0.3);box-shadow:0 0 8px 0 rgba(0,0,0,0.75);box-sizing: content-box;}\n.DescartesKeysContainer > div, .new_line_btn{margin:5px 0 0 5px;display:inline-block;min-width:40px;min-height:40px;max-height:40px;line-height:35px;background-color:#ebeff3;font-family:"+
b.math_font+";font-size:18px;font-weight:bold;color:black;cursor:pointer;text-align:center;border-radius:4px;border:1px solid rgba(0,0,0,0.3);box-shadow:0 1px 2px 0 rgba(0,0,0,0.25);transform-origin:center;user-select:none;}\n.DescartesKeysContainer > div:hover, .new_line_btn:hover{background-color:rgba(0,0,0,0.05);transform:scale(1.1);}\n.DescartesKeysContainer > div:active, .new_line_btn:active{transform:scale(0.95);}\n.DescartesKeyboardDisplay{font-family:"+b.sansserif_font+";padding:0 2px;border:solid #666 1px;text-align:left;background-color:white;position:absolute;overflow:hidden;outline:2px solid black; resize: none;}\n.custom_keyboard{display:none;}\n.DJS_Gradient{position:absolute;display:none;}\n"+
(b.addSymbolFont?b.addSymbolFont():"")+(b.addFonts?b.addFonts():"")+"@media print{body{margin:0;padding:0;}\n.DescartesAppContainer{transform:none !important;left:0 !important;top:0 !important;}\ndiv:has(.DescartesAppContainer){overflow:unset !important;width:100% !important;height:100% !important;}}";return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=Math.sin,d=Math.floor,h=Math.random,p=Math.round,c=Math.abs,f=String.fromCharCode,l,n,m,g,q,e,r,x,y,u,v=function(a){this.key=(void 0===a?0:a).toString()};v.prototype.getKey=function(b){l=[];for(var g=0;256>g;g++)l[g]=f(this.alfanum(d(c(7.5*(a(1*g-b)+a(1.4*g+b)+a(.6*g-b)+a(2.2*g+b))))));return l.join("")};v.prototype.encode=function(a){n=d(31*h());this.key=this.getKey(n);return f(this.alfanum(n))+this.encripta(a)};v.prototype.decode=function(a){n=
this.numalfa(a.charCodeAt(0));this.key=this.getKey(n);return this.desencripta(a.substring(1))};v.prototype.encripta=function(a){return this.bytesToString(this.encriptaAux(this.stringToBytes(a)))};v.prototype.encriptaAux=function(a){if(null==a||null==this.key)return null;e=Array(3*a.length);for(var b=0,c=a.length;b<c;b++)y=256*d(a[b]+128)+p(255*h())+65536*p(255*h()),u=d((y<<this.shift(b))/256),e[3*b]=this.alfanum(u%32),e[3*b+1]=this.alfanum(u/32%32),e[3*b+2]=this.alfanum(u/1024%32);return e};v.prototype.desencripta=
function(a){return this.bytesToString(this.desencriptaAux(this.stringToBytes(a)))};v.prototype.desencriptaAux=function(a){if(null==a||null==this.key)return null;r=Array(a.length/3);for(var b=0,c=r.length;b<c;b++)u=this.numalfa(a[3*b])+32*this.numalfa(a[3*b+1])+1024*this.numalfa(a[3*b+2]),y=d(256*u>>this.shift(b)),x=d(y/256)%256-128,0>x&&(x+=256),r[b]=x;return r};v.prototype.alfanum=function(a){return(10>a?48:87)+d(a)};v.prototype.numalfa=function(a){return a-(58>a?48:87)};v.prototype.stringToBytes=
function(a){g=[];for(var b=0,c=a.length;b<c;b++)g.push(a.charCodeAt(b));return g};v.prototype.bytesToString=function(a){for(var b=0,c=a.length;b<c;b++)a[b]=f(a[b]);return a.join("")};v.prototype.shift=function(a){m=this.key.charCodeAt(a%this.key.length);g=this.numalfa(m);q=d(g/2%8);0==q&&(q=4);return q};v.prototype.parseByte=function(a){a=parseInt(a);a=0>a?0:a;return 255<a?255:a};b.Krypto=v;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d=function(a,d){var c=this;c.parent=a;var f=a.evaluator;a=f.parser;c.delay=a.parse(d.delay?d.delay:"60");c.loop=d.loop?d.loop:!1;c.auto=void 0==d.auto?!0:d.auto;c.controls=d.controls;b.parseExpr(c,d,a);c.animExec=function(){for(var a=$jscomp.makeIterator(c.doExpr),d=a.next();!d.done;d=a.next())f.eval(d.value);c.parent.update();c.playing&&(0<f.eval(c.whileExpr)||c.loop)?c.timer=b.setTimeout(c.animExec,f.eval(c.delay)):(c.stop(),c.pause=!1,c.parent.update())};
c.playing=!1;c.auto&&c.play()};d.prototype.play=function(){a=this;a.playing?(a.pause=!0,a.stop()):(a.pause||a.reinit(),a.playing=!0,a.pause=!1,a.timer=b.setTimeout(a.animExec,Math.max(10,a.parent.evaluator.eval(a.delay))))};d.prototype.stop=function(){this.playing=!1;b.clearTimeout(this.timer)};d.prototype.reinit=function(){for(var a=$jscomp.makeIterator(this.init),b=a.next();!b.done;b=a.next())this.parent.evaluator.eval(b.value)};b.Animation=d;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=function(a,b){this.parent=a;this.param=(void 0===b?"":b).replace(/\\n/g,"\n").replace(/&squot;/g,"'")};a.prototype.execute=function(){alert(this.param)};b.Message=a;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=function(a,h){var d=this;this.parent=a;h=b.splitSeparator(((void 0===h?"":h)||"").replace(/&squot;/g,"'"));this.inst=h.map(function(a){return d.parent.evaluator.parser.parse(a,!0)}).filter(function(a){return a})};a.prototype.execute=function(){for(var a=$jscomp.makeIterator(this.inst),b=a.next();!b.done;b=a.next())this.parent.evaluator.eval(b.value)};b.Calculate=a;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=function(a,b){this.parent=a;this.param=b.trim();this.target="_blank"};a.prototype.execute=function(a){a=void 0===a?"":a;var d=this.param,c=d.match(/^(.*)\s*target=(.*)/);c&&(d=c[1].trim(),this.target=c[2].trim());/^\[.*\]$/.test(d)&&(d=this.parent.evaluator.eval(this.parent.evaluator.parser.parse(d.slice(1,-1))));if(c=d.match(/^javascript:(.*)$/)){d=new b.SimpleText(this.parent,c[1].replace(/&squot;/g,"'"));try{(new Function(d.toString()))()}catch(f){}}else/^(http|www)/.test(d)||
(c=window.__dirname||window.location.href,d=c.substring(0,c.lastIndexOf("/")+1)+d),d.startsWith("www.")&&(d="https://"+d),window.open(d,this.target,a)};var d=function(b,d){return a.call(this,b,d)||this};$jscomp.inherits(d,a);d.prototype.execute=function(){a.prototype.execute.call(this,"width="+this.parent.width+",height="+this.parent.height+",left="+(window.screen.width-this.parent.width)/2+",top="+(window.screen.height-this.parent.height)/2+",location=0,menubar=0,scrollbars=0,status=0,titlebar=0,toolbar=0")};
b.OpenURL=a;b.OpenScene=d;return b}(descartesJS||{});descartesJS=function(b){if(b.loadLib)return b;var a=function(a){this.parent=a};a.prototype.execute=function(){this.parent.editor?this.parent.editor.show():window.open("about:blank","_blank","width=800px,height=600px,location=no,menubar=no,scrollbars=yes").document.write("<xmp style='width:100%;height:100%;'>"+this.parent.applet.outerHTML.replace(/<applet/g,"<ajs").replace(/<\/applet/g,"</ajs")+"</xmp>")};b.Config=a;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=function(a){this.parent=a};a.prototype.execute=function(){this.parent.init()};b.Init=a;return b}(descartesJS||{});descartesJS=function(b){if(b.loadLib)return b;var a=function(a){this.parent=a};a.prototype.execute=function(){this.parent.clear()};b.Clear=a;return b}(descartesJS||{});descartesJS=function(b){if(b.loadLib)return b;var a=function(a){this.parent=a};a.prototype.execute=function(){this.parent.play()};b.Animate=a;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=function(a){this.parent=a};a.prototype.execute=function(){this.parent.reinitAnimation()};b.InitAnimation=a;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=function(a,b){b=void 0===b?"":b;this.parent=a;(a=b.match(/[\w\.\-//]*(\.ogg|\.oga|\.mp3|\.wav)/gi))?this.filename=this.parent.evaluator.parser.parse("'"+a+"'"):(/^\[.*\]$/.test(b)&&(b=b.slice(1,-1)),this.filename=this.parent.evaluator.parser.parse(b))};a.prototype.execute=function(){var a=this.parent.getAudio(this.parent.evaluator.eval(this.filename));a.paused?a.play():(a.pause(),a.currentTime=0)};b.PlayAudio=a;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p=function(b,d){a=this;a.parent=b;a.evaluator=b.evaluator;a.id=a.expresion=a.init=a.privateVars=a.doExpr=a.whileExpr="";a.evaluate="onlyOnce";Object.assign(a,d)};p.prototype.firstRun=function(){};p.prototype.update=function(){};b.splitInstructions=function(a,d){d=d?b.splitSeparator(d):[""];return d.map(function(c,d){b.DEBUG.lineCount=d;return a.parse(c,!0)}).filter(function(a){return a})};b.parseExpr=function(a,d,l){b.DEBUG.pName="inicio";a.init=
b.splitInstructions(l,d.init);b.DEBUG.pName="local";a.privateVars=b.getPrivateVariables(l,d.local);b.DEBUG.pName="hacer";a.doExpr=b.splitInstructions(l,d.doExpr);b.DEBUG.pName="mientras";a.whileExpr=l.parse(d.whileExpr)};b.getPrivateVariables=function(a,b){d=[];b=b?b.split(/;|,/):[""];b=$jscomp.makeIterator(b);for(var c=b.next();!c.done;c=b.next())(h=a.parse(c.value,!0))&&d.push(h);a=0;for(b=d.length;a<b;a++)d[a]="assign"===d[a].type?d[a].childs[0].value:"identifier"===d[a].type?d[a].value:"";return d};
b.Auxiliary=p;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=function(a,h){h=b.Auxiliary.call(this,a,h)||this;var d=h.evaluator;h.expresionString=h.expresion;h.expresion=d.parser.parse(h.expresionString);h.expresion&&d.setVariable(h.id,h.expresion);h.editable&&(h.registerTextField(),a.editableRegionVisible=!0);return h};$jscomp.inherits(a,b.Auxiliary);a.prototype.registerTextField=function(){var a=this,h=a.evaluator,p=b.newHTML("div"),c=b.newHTML("label");c.appendChild(document.createTextNode("___"+a.id+"=___"));
var f=b.newHTML("input");f.value=a.expresionString;f.disabled=!a.editable;p.appendChild(c);p.appendChild(f);f.onkeydown=function(b){13==b.keyCode&&(a.expresion=parser.parse(this.value),h.setVariable(a.id,a.expresion),a.parent.update())};a.parent.editableRegion.textFields.push({container:p,type:"div"})};b.Variable=a;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=function(a,h){a=b.Auxiliary.call(this,a,h)||this;a.expresion=a.evaluator.parser.parse(a.expresion);a.update();return a};$jscomp.inherits(a,b.Auxiliary);a.prototype.update=function(){this.evaluator.setVariable(this.id,this.evaluator.eval(this.expresion))};b.Constant=a;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f=function(c,d){a=d=b.Auxiliary.call(this,c,d)||this;h=c.evaluator.parser;a.size=a.size||h.parse("3");a.expresion=a.expresion.split(";");a.parseFile=h.parse(a.file);a.update();return d};$jscomp.inherits(f,b.Auxiliary);f.prototype.update=function(){a=this;var l=a.expresion,f;d=a.evaluator;h=d.parser;a.oldFile=a.file;if(p=d.eval(a.parseFile))a.file=p;a.file&&(c=(f=document.getElementById(a.file))&&"descartes/vectorFile"==f.type?f.text:b.openFile(a.file),
null!=c&&(c=c.replace(/\r/g,"").split("\n"),c=c.filter(function(a){return""!==a.trim()})),null==c||1==c.length&&""==c[0]?(c=[],a.size=h.parse("0")):(l=c,a.size=null),null===a.size&&(a.size=h.parse(l.length+"")));var m;l=l.map(function(b,c){(m=h.parse(b,!0))&&"assign"!==m.type&&(m=h.parse(a.id+"["+c+"]="+b,!0));return m});f=Array(parseInt(Math.abs(d.eval(a.size)))).fill(0);f._size_=f.length;d.vectors[a.id]=f;d.setVariable(a.id+".long",f._size_);l=$jscomp.makeIterator(l);for(f=l.next();!f.done;f=l.next())d.eval(f.value)};
b.Vector=f;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l=function(l,m){a=m=b.Auxiliary.call(this,l,m)||this;d=l.evaluator;h=d.parser;a.rows=a.rows||h.parse("3");a.columns=a.columns||h.parse("3");a.expresion=b.splitInstructions(h,a.expresion);p=d.eval(a.rows);c=d.eval(a.columns);f=[];f.type="matrix";l=0;for(var g=c;l<g;l++)f[l]=Array(p).fill(0);d.matrices[a.id]=f;a.update();return m};$jscomp.inherits(l,b.Auxiliary);l.prototype.update=function(){a=this;d=a.evaluator;f=d.matrices[a.id];f.rows=
d.eval(a.rows);f.cols=d.eval(a.columns);d.setVariable(a.id+".filas",f.rows);d.setVariable(a.id+".columnas",f.cols);for(var b=$jscomp.makeIterator(this.expresion),c=b.next();!c.done;c=b.next())d.eval(c.value)};b.Matrix=l;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=function(a,h){var d=b.Auxiliary.call(this,a,h)||this;var c=d.evaluator;a=c.parser;h=d.id.indexOf("(");d.name=d.id.substring(0,h);d.params=d.id.substring(h+1,d.id.indexOf(")"));d.domain=d.range?a.parse(d.range):a.parse("1");d.params=""===d.params?[]:d.params.split(",");d.numParams=d.params.length;d.algorithm||(d.init=d.doExpr=d.whileExpr="");b.parseExpr(d,d,a);d.expresion=a.parse(d.expresion);var f;d.functionExec=function(){var a=arguments,h=0;if(d.numParams<=
arguments.length){for(var m=[],g=$jscomp.makeIterator(d.privateVars),q=g.next();!q.done;q=g.next())q=q.value,m.push(c.getVariable(q)),c.setVariable(q,0);var e=[];d.params.forEach(function(b,g){e.push(c.getVariable(b));c.setVariable(b,a[g])});g=$jscomp.makeIterator(d.init);for(q=g.next();!q.done;q=g.next())c.eval(q.value);f=c.getVariable("_NUM_MAX_ITE_ALG_")||1E5;do{g=$jscomp.makeIterator(d.doExpr);for(q=g.next();!q.done;q=g.next())c.eval(q.value);if(++h>f)return console.warn("se ha excedido el l\u00edmite de "+
f+" repeticiones en la funci\u00f3n \u00ab"+d.name+"\u00bb"),0}while(0<c.eval(d.whileExpr));h=c.eval(d.expresion);b.rangeOK=c.eval(d.domain);d.params.forEach(function(a,b){c.setVariable(a,e[b])});d.privateVars.forEach(function(a,b){c.setVariable(a,m[b])});return h}return 0};c.setFunction(d.name,d.functionExec);return d};$jscomp.inherits(a,b.Auxiliary);b.Function=a;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h=function(a,c){a=b.Auxiliary.call(this,a,c)||this;b.parseExpr(a,a,a.evaluator.parser);return a};$jscomp.inherits(h,b.Auxiliary);h.prototype.algorithmExec=function(){var b=0;d=this.evaluator;a=d.getVariable("_NUM_MAX_ITE_ALG_")||1E5;for(var c=$jscomp.makeIterator(this.init),f=c.next();!f.done;f=c.next())d.eval(f.value);do{c=$jscomp.makeIterator(this.doExpr);for(f=c.next();!f.done;f=c.next())d.eval(f.value);if(++b>a)return console.warn("se ha excedido el l\u00edmite de "+
a+" repeticiones en el algoritmo \u00ab"+this.name+"\u00bb"),0}while(0<d.eval(this.whileExpr))};h.prototype.update=function(){this.algorithmExec();"onlyOnce"===this.evaluate&&(this.update=function(){})};b.Algorithm=h;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=function(a,h){var d=b.Auxiliary.call(this,a,h)||this;a=d.evaluator;delete d.evaluate;d.condition=a.parser.parse(d.condition);d.lastEval=!1;d.action=d.parent.lessonParser.parseAction(d);"onlyOnce"==d.execution&&(d.eventExec=function(){0<d.evaluator.eval(d.condition)&&!d.lastEval&&(d.lastEval=!0,d.action.execute())});"alternate"==d.execution&&(d.eventExec=function(){var a=0<d.evaluator.eval(d.condition);a&&!d.lastEval?(d.action.execute(),d.lastEval=
!0):!a&&d.lastEval&&(d.lastEval=!1)});"always"==d.execution&&(d.eventExec=function(){0<d.evaluator.eval(d.condition)&&d.action.execute()});return d};$jscomp.inherits(a,b.Auxiliary);a.prototype.update=function(){this.eventExec()};b.Event=a;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=function(a,h){var d=b.Auxiliary.call(this,a,h)||this;h=h.file;var c=null;h&&(c=(c=document.getElementById(h))&&"descartes/library"===c.type?c.text:b.openFile(h));if(c)for(c=b.convertHTMLEntities(c).replace(/\r/g,"").split("\n"),h=$jscomp.makeIterator(c),c=h.next();!c.done;c=h.next())c=c.value,""!==c.trim()&&a.lessonParser.parseAuxiliar(c);return d};$jscomp.inherits(a,b.Auxiliary);b.Library=a;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l,n,m=function(c,d){a=this;a.parent=c;a.evaluator=c.evaluator;var g=a.evaluator.parser;a.spaceID=a.type=a.trace=a.family=a.text="";a.background=a.visible=a.editable=!1;a.drawif=g.parse("1");a.abs_coord=d&&d.type&&"text"===d.type.toLowerCase();a.color=new b.Color("20303a");a.expresion=g.parse("(0,0)");a.family_interval=g.parse("[0,1]");a.family_steps=g.parse("8");a.font="SansSerif,PLAIN,"+(5<=a.parent.version?"18":"12");a.fixed=!0;a.decimals=
g.parse("2");Object.assign(this,d);a.space=a.getSpace();a.canvas=a.background?a.space.backCanvas:a.space.canvas;a.ctx=a.canvas.getContext("2d");a.trace&&(a.traceCtx=a.space.backCtx);a.font_str=a.font;a.font=b.convertFont(a.font);a.fontSize=a.font.match(/([\d\.]+)px/);a.fontSize=a.fontSize?parseFloat(a.fontSize[1]):10;a.font_style=b.getFontStyle(a.font_str.split(",")[1]);if("boolean"===typeof a.bold||"boolean"===typeof a.italics)a.font_style=(a.italics?"Italic ":"")+(a.bold?"Bold ":"");a.font_family||
(a.font_family=a.font_str.split(",")[0]);a.font_family=b.getFontName(a.font_family);"undefined"===typeof a.font_size&&(a.font_size=c.evaluator.parser.parse(a.fontSize.toString()))};m.prototype.getSpace=function(){var a=this;return this.parent.spaces.find(function(b){return b.id===a.spaceID})||this.parent.spaces[0]};m.prototype.getFamilyValues=function(){a=this;d=a.evaluator;var b=$jscomp.makeIterator(d.eval(a.family_interval)[0]);a.fInf=b.next().value;a.fSup=b.next().value;a.fSteps=Math.round(d.eval(a.family_steps));
a.fSep=0<a.fSteps?(a.fSup-a.fInf)/a.fSteps:0};m.prototype.drawFamilyAux=function(b,c,m){a=this;d=a.evaluator;a.getFamilyValues();h=d.getVariable(a.family);if(0<=a.fSteps)for(var g=0,l=a.fSteps;g<=l;g++)d.setVariable(a.family,a.fInf+g*a.fSep),0<d.eval(a.drawif)&&(a.update(),a.drawAux(b,c,m));d.setVariable("_Text_H_",0);d.setVariable(a.family,h)};m.prototype.draw=function(a,b){""!==this.family?this.drawFamilyAux(this.ctx,a,b):0<this.evaluator.eval(this.drawif)&&(this.update(),this.drawAux(this.ctx,
a,b));this.ctx.setLineDash([])};m.prototype.drawTrace=function(a,b){""!=this.family?this.drawFamilyAux(this.traceCtx,a,b):0<this.evaluator.eval(this.drawif)&&(this.update(),this.drawAux(this.traceCtx,a,b))};m.prototype.rotate=function(a,b,c){l=Math.cos(c);n=Math.sin(c);return{x:a*l-b*n,y:a*n+b*l}};m.prototype.dashStyle=function(){f=this.ctx;f.lineCap="butt";switch(this.lineDash){case "dot":f.setLineDash([f.lineWidth,f.lineWidth]);break;case "dash":f.setLineDash([4*f.lineWidth,3*f.lineWidth]);break;
case "dash_dot":f.setLineDash([4*f.lineWidth,2*f.lineWidth,f.lineWidth,2*f.lineWidth]);break;default:f.lineCap="round",f.setLineDash([])}};m.prototype.drawText=function(a,b,m,l,f,h,n,v,A,w,z){a.textNode=b;if("rtfNode"===b.type)a.fillStyle=a.strokeStyle=f.getColor(),a.textBaseline="alphabetic",a.textNode.pos={x:m,y:l},b.update(a,m,l,A,w,n,z,f.getColor());else for("simpleText"===b.type&&(b=b.toString(A,w).split("\\n")),d=this.evaluator,a.fillStyle=f.getColor(),a.font=h,a.textAlign=n,a.textBaseline=
v,c=1.2*this.fontSize||0,f=0,h=b.length;f<h;f++)p=b[f],this.border&&(a.strokeStyle=this.border.getColor(),a.lineWidth=4,a.lineJoin="round",a.miterLimit=2,a.strokeText(p,m,l+c*f)),a.fillText(p,m,l+c*f)};b.Graphic=m;return b}(descartesJS||{});
descartesJS=function(b){function a(a,c,d){d=void 0===d?"":d;for(var m=$jscomp.makeIterator(a),g=m.next();!g.done;g=m.next())if(g=g.value,"identifier"===g.type&&!(b.reservedIds+d).match("-"+g.value+"-")||"R"===g.value||"G"===g.value||"B"===g.value)g.value=c+"."+g.value;return a}function d(b,c,d,m){c=d.tokenize(c.replace(/&squot;/g,"'"));c=a(c,m);return/^\\expr/.test(b)?"\\expr ":"\\decimals "+d.flatTokens(c)}if(b.loadLib)return b;var h,p=/[\w\.\-//]*(\.png|\.jpg|\.gif|\.svg|\.webp)/gi,c=function(c,
l,n,m){var g;h=g=b.Graphic.call(this,c,l)||this;h.hasExpresion=h.hasExpresion||!1;h.graphics=[];Object.assign(h,l);h.hasExpresion=void 0!==h.expresion;if(!h.hasExpresion)return g;"'"!==String(h.expresion).charAt(0)&&(h.expresion="'"+h.expresion+"'");h.expresion=h.evaluator.parser.parse(h.expresion);l=h.evaluator.eval(h.expresion);if(l)var f=(f=document.getElementById(l))&&"descartes/macro"===f.type?f.text:b.openFile(l);if(f){l=b.convertHTMLEntities(f).replace(/\r/g,"").split("\n");f=[];c=c.lessonParser;
var e=new b.Tokenizer,r;l=$jscomp.makeIterator(l);for(r=l.next();!r.done;r=l.next())if(r=r.value,r.includes("=")){r=c.split(r);for(var x=$jscomp.makeIterator(r),y=x.next();!y.done;y=x.next())if((y=y.value)&&1<r.length&&("id"===babel[y[0]]||"type"===babel[y[0]])){f.push(r);break}}y=0;for(var u=f.length;y<u;y++){r=(l=f[y]||[],l[0])&&"id"===l[0][0];x=!1;for(var v=0,A=l.length;v<A;v++){var w=l[v][0];var z=l[v][1];var B=w.indexOf(".");-1===B||r?B=babel[w]:(B=babel[w.substring(B+1)],l[v][0]=h.name+"."+
w);"type"===B&&"surface"===babel[z]&&(x=!0);if(n.includes("3D")){if(("font"===B||"font_family"===B||("fill"===B||"color"===B||"backcolor"===B||"arrow"===B)&&"("!==l[v][1].charAt(0)||"file"===B&&l[v][1].match(p)||"id"!==B&&void 0!==babel[l[v][1]])&&"width"!==B&&"height"!==B&&"length"!==B)continue}else if(("font"===B||"font_family"===B||("fill"===B||"color"===B||"border"===B||"arrow"===B)&&"("!==l[v][1].charAt(0)||"file"===B&&l[v][1].match(p)||"id"!==B&&void 0!==babel[l[v][1]])&&"radius"!==B)continue;
if(x&&"expresion"===B){for(var D=l[v][1].split(" "),I="",H=0,G=D.length;H<G;H++){for(var F=D[H].replace(/&squot;/g,"'").split(";"),C=0,J=F.length;C<J;C++)w=a(F[C].replace(/\\n/g,";"),h.name,n.includes("3D")?"-x-y-z-u-v-":""),F[C]=e.flatTokens(w);I+=F.join(";")+" "}l[v][1]=I}if("text"===B)if(/\{\\rtf1/.test(z))z=z.replace(/\\expr\s*([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,function(a,b){return d(a,b,e,h.name)}).replace(/\\decimals\s*([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,function(a,
b){return d(a,b,e,h.name)});else{z=c.parseText(z).txtEleMacros;B=0;for(D=z.length;B<D;B++)w=e.tokenize(z[B].replace(/&squot;/g,"'")),w=a(w,h.name),z[B]=e.flatTokens(w).replace(/&squot;/g,"'").replace(/'\+\(/g,"[").replace(/\)\+'/g,"]"),z[B]=z[B].slice(1,-1);z=z.join("")}else{z=z.replace(/&squot;/g,"'").split(";");B=0;for(D=z.length;B<D;B++)w=e.tokenize(z[B].replace(/\\n/g,";")),w=a(w,h.name,n.includes("3D")?"-Euler-":""),z[B]=e.flatTokens(w);z=z.join(";")}l[v][1]=z}}x=0;for(y=f.length;x<y;x++)if(f[x][0]){l=
"";r=!1;u=0;for(v=f[x].length;u<v;u++)"type"===babel[f[x][u][0]]&&m.includes("-"+babel[f[x][u][1]]+"-")&&(r=!0),l+=f[x][u][0]+"='"+f[x][u][1]+"' ";f[x]=l+(r?" space='"+h.spaceID+"'":"");r?h.graphics.push(c[n](f[x],h.abs_coord,h.background,h.inirot)):c.parseAuxiliar(f[x])}}return g};$jscomp.inherits(c,b.Graphic);b.BaseMacro=c;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l,n=function(b,g){this.text=g=g.replace("&#x2013","\u2013").replace(/&squot;/g,"'");this.txtEle=[];this.txtEleMacros=[];this.parent=b;this.evaluator=b.evaluator;this.type="simpleText";a="'";p=h=0;for(c=-1;h<g.length;)f=g.charAt(h),l=g.charAt(h-1),"["===f&&"\\"===l?(this.txtEle.push(g.substring(p,h-1)+"["),this.txtEleMacros.push("'"+g.substring(p,h-1)+"['"),p=h+1):"]"===f&&"\\"===l?(this.txtEle.push(g.substring(p,h-1)+"]"),this.txtEleMacros.push("'"+
g.substring(p,h-1)+"]'"),p=h+1):"["===f&&-1===c?(this.txtEle.push(g.substring(p,h)),this.txtEleMacros.push("'"+g.substring(p,h)+"'"),p=h,c++):"["===f?c++:"]"===f&&0===c?(this.txtEle.push(this.evaluator.parser.parse(g.substring(p,h+1))),this.txtEleMacros.push("["+g.substring(p,h+1)+"]"),p=h+1,c--):("]"==g.charAt(h)&&(c=0>c?c:c-1),a+=g.charAt(h)),h++;this.txtEle.push(g.substring(p,h));this.txtEleMacros.push("'"+g.substring(p,h)+"'")};n.prototype.toString=function(c,g){a="";for(var m=$jscomp.makeIterator(this.txtEle),
l=m.next();!l.done;l=m.next())l=l.value,"string"===typeof l?a+=l:(d=this.evaluator.eval(l)[0][0],""!==d&&("string"===typeof d?a+=d:Infinity==d?a+="Infinity":-Infinity==d?a+="-Infinity":isNaN(d)||"NaN"==d?a+="NaN":(d=parseFloat(d),d=g?d.toFixed(c):b.removeNeedlessDecimals(d.toFixed(c)),a+=d.toString().replace(".",this.parent.decimal_symbol))));return a};b.SimpleText=n;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l,n,m,g,q,e,r,x,y,u,v,A,w,z,B,D,I,H,G,F,C,J,Q,R,O,M,P,E,L=function(a,c){c=b.Graphic.call(this,a,c)||this;c.width=c.width||a.evaluator.parser.parse("1");c.fillP=c.fillP||"";c.fillM=c.fillM||"";c.parseExpression();c.visible=2===c.parent.version&&void 0==c.visible?!0:c.visible;c.visible&&c.registerTextField();e=new b.R2;r=new b.R2;x=new b.R2;y=new b.R2;v=new b.R2;c.cInd=0;return c};$jscomp.inherits(L,b.Graphic);L.prototype.parseExpression=
function(){if("compOperator"===this.expresion.type){var a=this.expresion.childs[0],c=this.expresion.childs[1];"identifier"!=a.type||"y"!=a.value||c.contains("y")?"identifier"!=c.type||"y"!=c.value||a.contains("y")?"identifier"!=a.type||"x"!=a.value||c.contains("x")?"identifier"!=c.type||"x"!=c.value||a.contains("x")||(this.funExpr=c,this.of_y=!0,this.drawAux=this.drawAuxFun):(this.funExpr=c,this.of_y=!0,this.drawAux=this.drawAuxFun):(this.funExpr=a,this.of_y=!1,this.drawAux=this.drawAuxFun):(this.funExpr=
c,this.of_y=!1,this.drawAux=this.drawAuxFun)}this.newt=new b.R2Newton(this.evaluator,this.expresion)};L.prototype.update=function(){};L.prototype.draw=function(){""!=this.family?this.drawFamilyAux(this.ctx,this.fill,this.color):(this.update(),this.drawAux(this.ctx,this.fill,this.color))};L.prototype.drawFamilyAux=function(a,b,c){h=this.evaluator;this.getFamilyValues();d=h.getVariable(this.family);if(0<=this.fSteps)for(var g=0,m=this.fSteps;g<=m;g++)h.setVariable(this.family,this.fInf+g*this.fSep),
this.update(),this.drawAux(a,b,c);h.setVariable(this.family,d)};L.prototype.drawTrace=function(){b.Graphic.prototype.drawTrace.call(this,this.fill,this.trace)};L.prototype.drawAux=function(d,N,L){if(!(0>=this.evaluator.eval(this.drawif))){this.cInd=0;h=this.evaluator;p=this.space;c=h.eval(this.width);d.strokeStyle=this.color.getColor();d.lineWidth=c;f=h.getVariable("x");l=h.getVariable("y");n=p.w+24;m=p.h+24;g=n/9;3>g&&(g=3);q=m/7;3>q&&(q=3);0==this.cInd?(a=[],this.cInd++):this.cInd=(this.cInd+1)%
1E7;e.set(0,0);r.set(0,0);x.set(0,0);P=.25;E=8;this.abs_coord||(P/=p.scale,E/=p.scale);d.beginPath();for(C=parseInt(q/2);C<m;C+=q)for(F=parseInt(g/2);F<n;F+=g){if(this.abs_coord){v.set(F,C);u=this.newt.findZero(v,P);if(null==u)continue;h.setVariable("x",u.x);h.setVariable("y",u.y);y.set(u.x,u.y)}else{v.set(p.getRelativeX(F),p.getRelativeY(C));u=this.newt.findZero(v,P);if(null==u)continue;h.setVariable("x",u.x);h.setVariable("y",u.y);y.set(p.getAbsoluteX(u.x),p.getAbsoluteY(u.y))}A=y.ix();w=y.iy();
if(-12<=A&&A<n+24&&-12<=w&&w<m+24){if(a[A+12+(w+12)*p.w]===this.cInd)continue;a[A+12+(w+12)*p.w]=this.cInd}b.rangeOK&&(d.moveTo(A,w),d.lineTo(A,w));e.x=u.x;e.y=u.y;r.x=u.x;r.y=u.y;z=this.newt.getUnitNormal();if(0!=z.x||0!=z.y)for(z.rotL90(),x.x=z.x,x.y=z.y,D=B=0,I=!1;2>D;)if(I&&(x.x=-z.x,x.y=-z.y,u.x=e.x,u.y=e.y,r.x=u.x,r.y=u.y,this.abs_coord?y.set(u.x,u.y):y.set(p.getAbsoluteX(u.x),p.getAbsoluteY(u.y)),A=y.ix(),w=y.iy(),I=!1,B=0),u.x+=E*x.x,u.y+=E*x.y,u=this.newt.findZero(u,P),null!=u){h.setVariable("x",
u.x);h.setVariable("y",u.y);x.x=u.x-r.x;x.y=u.y-r.y;x.normalize();if(0==x.x&&0==x.y)break;r.x=u.x;r.y=u.y;this.abs_coord?y.set(u.x,u.y):y.set(p.getAbsoluteX(u.x),p.getAbsoluteY(u.y));H=parseInt(y.ix());G=parseInt(y.iy());if(H!=A||G!=w)if(J=A,Q=w,A=H,w=G,-12<=A&&A<n+24&&-12<=w&&w<m+24){B=0;R=a[A+12+(w+12)*p.w];a[A+12+(w+12)*p.w]=this.cInd;for(N=1;8>N;N++)O=J+Math.round((A-J)*N/8),M=Q+Math.round((w-Q)*N/8),0<=O&&O<n&&0<=M&&M<m&&(a[O+12+(M+12)*p.w]=this.cInd);b.rangeOK&&(d.moveTo(J,Q),d.lineTo(A,w));
if(R===this.cInd)break}else I=!0,D++;else 4<++B&&(I=!0,D++)}}d.stroke();h.setVariable("x",f);h.setVariable("y",l)}};L.prototype.X=function(a,b,c){c||(b=this.space.w/2+this.space.Ox+this.space.scale*b);b<-a&&(b=-a);b>this.space.w+a&&(b=this.space.w+a);return b};L.prototype.Y=function(a,b,c){c||(b=this.space.h/2+this.space.Oy-this.space.scale*b);b<-a&&(b=-a);b>this.space.h+a&&(b=this.space.h+a);return b};L.prototype.XX=function(a,b,c){return Math.round(this.X(a,b,c))};L.prototype.YY=function(a,b,c){return Math.round(this.Y(a,
b,c))};L.prototype.extrapolate=function(a,c,g,d,m,l){h=this.evaluator;for(var e=h.getVariable(c),f=l/2,q=0,p,n,r,B,u,x;1E-15<Math.abs(f);){p=h.getVariable(c);n=h.getVariable(c)+f;h.setVariable(c,n);r=!0;try{B=m,m=h.eval(this.funExpr),h.setVariable(g,m),0<h.eval(a)?(u=new b.R2(Math.min(B,m),Math.max(B,m)),x=0,x=0<l?this.Singularity(Math.abs(f),c,d,p,B,n,m,u):this.Singularity(Math.abs(f),c,d,n,m,p,B,u),0<x&&(r=!1)):r=!1}catch(ea){r=!1}r?q+=f:h.setVariable(c,p);f/=2}h.setVariable(c,e);return new b.R2(q/
Math.abs(l),m)};L.prototype.extrapolateOnSingularity=function(a,c,g,d,m,l){h=this.evaluator;d=h.getVariable(c);for(var e=l/2,f=0,q=m,p;1E-15<Math.abs(e);){h.setVariable(c,h.getVariable(c)+e);p=!0;if(0<h.eval(a))try{q=h.eval(this.funExpr),h.setVariable(g,q),0>=h.eval(a)&&(p=!1)}catch(Y){p=!1}else p=!1;p?f+=e:h.setVariable(c,h.getVariable(c)-e);e/=2}if(0==f)for(e=l/2,f=l,q=m;1E-15<Math.abs(e);){h.setVariable(c,h.getVariable(c)-e);g=!0;if(0<h.eval(a))try{q=h.eval(this.funExpr)}catch(Y){g=!1}else g=!1;
g?f+=-e:h.setVariable(c,h.getVariable(c)+e);e/=2}h.setVariable(c,d);return new b.R2(f/Math.abs(l),q)};L.prototype.Singularity=function(a,b,c,g,d,m,l,e){h=this.evaluator;if(isNaN(l)||isNaN(d)||isNaN(e.y)||isNaN(e.x)||g>=m)return 2;var f=h.getVariable(b),q=0;try{if(1E-15>Math.abs(m-g)||1E-12>Math.abs(m-g)&&Math.abs(l-d)>Math.abs(a))return h.setVariable(b,f),1;var p=(g+m)/2;h.setVariable(b,p);var n=NaN;try{n=h.eval(this.funExpr)}catch(ca){return 2}if(isNaN(n))return 5;if(Math.abs(l-d)>a){h.setVariable(b,
g-1E-12);var r=h.eval(this.funExpr);r=(d-r)/1E-12;h.setVariable(b,m+1E-12);var B=(h.eval(this.funExpr)-l)/1E-12;if((10>Math.abs(B)||10>Math.abs(r))&&(0<=B&&0<=r||0>=B&&0>=r)&&4*Math.abs(B)<Math.abs((l-d)/(m-g)))return h.setVariable(b,f),2}if(isNaN(e.x)||isNaN(e.y)||isNaN(n))return 2;if(!(e.x<=n&&n<=e.y)){h.setVariable(b,p);e.x=Math.min(d,n);e.y=Math.max(d,n);var u=this.Singularity(a/2,b,c,g,d,p,n,e);h.setVariable(b,m);e.x=Math.min(l,n);e.y=Math.max(l,n);var x=this.Singularity(a/2,b,c,p,n,m,l,e);q=
Math.max(u,x)}}catch(ca){q=1}h.setVariable(b,f);return q};L.prototype.drawAuxFun=function(a,c,g){h=this.evaluator;f=h.getVariable("x");l=h.getVariable("y");b.rangeOK=1;c="x";var d="y";this.of_y&&(c="y",d="x");var m=this.drawif,e=h.eval(this.width),q=!1,p=new b.R2(this.space.w/2+this.space.Ox,this.space.h/2+this.space.Oy),n=this.of_y?p.ix():p.iy(),r=0,B=0,u=0,x=0,y=1/this.space.scale;p=y*(this.of_y?-this.space.h+p.y:-p.x);var v=0;this.abs_coord&&(p=0,y=1);for(var w,D,G,A,z,C,F,P,M,I=this.of_y?this.space.h+
2:this.space.w+2;u<=I;){w=!0;D=0;h.setVariable(c,p);try{G=h.eval(this.funExpr),isNaN(G)||(h.setVariable(d,G),0<h.eval(this.drawif)&&b.rangeOK?(q?(A=Math.min(v,G),z=Math.max(v,G),C=new b.R2(A,z),D=this.Singularity(y,c,0,p-y,v,p,G,C),0===D?(v<=G?(v=C.x,G=C.y):(G=C.x,v=C.y),F=parseInt(this.of_y?this.XX(e,v,this.abs_coord):this.YY(e,v,this.abs_coord)),r=this.abs_coord?Math.round(G):parseInt(this.of_y?this.XX(e,G,this.abs_coord):this.YY(e,G,this.abs_coord)),this.fillM&&r>n&&(a.lineWidth=1,a.strokeStyle=
this.fillM.getColor(),a.beginPath(),this.of_y?(a.moveTo(n+1,this.space.h-u+.5),a.lineTo(r,this.space.h-u+.5)):(a.moveTo(u+.5,n+1),a.lineTo(u+.5,r)),a.stroke()),this.fillP&&r<n&&(a.lineWidth=1,a.strokeStyle=this.fillP.getColor(),a.beginPath(),this.of_y?(a.moveTo(n-1,this.space.h-u+.5),a.lineTo(r,this.space.h-u+.5)):(a.moveTo(u+.5,n-1),a.lineTo(u+.5,r)),a.stroke()),a.lineWidth=e,a.strokeStyle=g.getColor(),a.beginPath(),this.of_y?(a.moveTo(F+.5,this.space.h-x),a.lineTo(r+.5,this.space.h-u)):(a.moveTo(x+
.5,F),a.lineTo(u+.5,r)),a.stroke()):1===D?(h.setVariable(c,p-y),P=this.extrapolate(m,c,d,0,v,y),r=this.of_y?this.XX(e,P.y,this.abs_coord):this.YY(e,P.y,this.abs_coord),a.lineWidth=e,a.strokeStyle=g.getColor(),a.beginPath(),this.of_y?(a.moveTo(B+.5,this.space.h-x),a.lineTo(r+.5,this.space.h-x+Math.round(P.x))):(a.moveTo(x+.5,B),a.lineTo(x+Math.round(P.x)+.5,r)),h.setVariable(c,p),M=this.extrapolate(m,c,d,0,G,-y),B=this.of_y?this.XX(e,M.y,this.abs_coord):this.YY(e,M.y,this.abs_coord),r=this.of_y?this.XX(e,
G,this.abs_coord):this.YY(e,G,this.abs_coord),a.lineWidth=e,a.strokeStyle=g.getColor(),a.beginPath(),this.of_y?(a.moveTo(B+.5,this.space.h-u),a.lineTo(r+.5,this.space.h-u)):(a.moveTo(u+.5,B),a.lineTo(u+.5,r)),a.stroke()):2===D&&(r=this.of_y?this.XX(e,G,this.abs_coord):this.YY(e,G,this.abs_coord),a.lineWidth=e,a.strokeStyle=g.getColor(),a.beginPath(),this.of_y?(a.moveTo(B+.5,this.space.h-u),a.lineTo(r+.5,this.space.h-u)):(a.moveTo(u+.5,B),a.lineTo(u+.5,r)))):(M=this.extrapolateOnSingularity(m,c,d,
0,G,-y),B=this.of_y?this.XX(e,M.y,this.abs_coord):this.YY(e,M.y,this.abs_coord),r=this.of_y?this.XX(e,G,this.abs_coord):this.YY(e,G,this.abs_coord),a.lineWidth=e,a.strokeStyle=g.getColor(),a.beginPath(),this.of_y?(a.moveTo(B,this.space.h-(u+Math.round(M.x))+.5),a.lineTo(r,this.space.h-u+.5)):(a.moveTo(u+Math.round(M.x),B),a.lineTo(u,r)),a.stroke()),v=G):w=!1)}catch(fa){w=!1}q&&!w&&(h.setVariable(c,p-y),h.setVariable(d,v),P=this.extrapolate(m,c,d,0,v,y),r=parseInt(this.of_y?this.XX(e,P.y,this.abs_coord):
this.YY(e,P.y,this.abs_coord)),0<h.eval(this.drawif)&&b.rangeOK&&(a.lineWidth=e,a.strokeStyle=g.getColor(),a.beginPath(),this.of_y?(a.moveTo(B,this.space.h-(x+Math.round(P.x))+.5),a.lineTo(r,this.space.h-(x+Math.round(P.x))+.5)):(a.moveTo(x+Math.round(P.x)+.5,B),a.lineTo(x+Math.round(P.x)+.5,r)),a.stroke()),h.setVariable(c,p));q=w;p+=y;B=r;x=u++}h.setVariable("x",f);h.setVariable("y",l)};L.prototype.registerTextField=function(){var a=this,c=b.newHTML("input");c.value=a.expresionString;c.disabled=
!a.editable;c.onkeydown=function(b){13==b.keyCode&&(a.expresion=a.evaluator.parser.parse(this.value),a.parseExpression(),a.parent.update())};a.parent.editableRegion.textFields.push(c)};b.Equation=L;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=Math.round,d,h,p,c,f,l,n=function(a,c){c=b.Graphic.call(this,a,c)||this;c.param=c.param||"t";c.parameter_interval=c.parameter_interval||a.evaluator.parser.parse("[0,1]");c.parameter_steps=c.parameter_steps||a.evaluator.parser.parse("8");c.width=c.width||a.evaluator.parser.parse("1");c.fill=c.fill||"";c.visible=2===c.parent.version&&void 0==c.visible?!0:c.visible;c.visible&&c.registerTextField();return c};$jscomp.inherits(n,b.Graphic);n.prototype.update=
function(){d=this.evaluator;var a=$jscomp.makeIterator(d.eval(this.parameter_interval)[0]);this.paraInf=a.next().value;this.paraSup=a.next().value;this.pSteps=d.eval(this.parameter_steps);this.paraSep=0<this.pSteps?Math.abs(this.paraSup-this.paraInf)/this.pSteps:0};n.prototype.draw=function(){b.Graphic.prototype.draw.call(this,this.fill,this.color)};n.prototype.drawTrace=function(){b.Graphic.prototype.drawTrace.call(this,this.fill,this.trace)};n.prototype.drawAux=function(m,g,q){d=this.evaluator;
h=this.space;m.lineWidth=Math.max(1E-6,a(d.eval(this.width)));m.lineCap=m.lineJoin="round";m.strokeStyle=q.getColor();p=d.getVariable(this.param);m.beginPath();d.setVariable(this.param,this.paraInf);c=d.eval(this.expresion)[0];this.X=a(this.abs_coord?c[0]:h.getAbsoluteX(c[0]));this.Y=a(this.abs_coord?c[1]:h.getAbsoluteY(c[1]));this.rotateExp&&(f=b.degToRad(d.eval(this.rotateExp)),l=this.rotate(c[0],c[1],f),this.X=a(this.abs_coord?l.x:h.getAbsoluteX(l.x)),this.Y=a(this.abs_coord?l.y:h.getAbsoluteY(l.y)));
m.moveTo(this.X+.5,this.Y+.5);for(q=1;q<=this.pSteps;q++)d.setVariable(this.param,this.paraInf+q*this.paraSep),c=d.eval(this.expresion)[0],this.rotateExp&&(l=this.rotate(c[0],c[1],f),c[0]=l.x,c[1]=l.y),this.X=a(this.abs_coord?c[0]:h.getAbsoluteX(c[0])),this.Y=a(this.abs_coord?c[1]:h.getAbsoluteY(c[1])),!isNaN(this.X)&&!isNaN(this.Y)&&-1E6<this.X&&1E6>this.X&&-1E6<this.Y&&1E6>this.Y&&m.lineTo(this.X+.5,this.Y+.5);this.fill&&(m.fillStyle=g.getColor(),m.fill("evenodd"));this.dashStyle();m.stroke();m.setLineDash([]);
d.setVariable(this.param,p)};n.prototype.registerTextField=function(){var a=this,c=b.newHTML("input");c.value=a.expresionString;c.disabled=!a.editable;c.onkeydown=function(b){13==b.keyCode&&(a.expresion=a.evaluator.parser.parse(this.value),a.parent.update())};a.parent.editableRegion.textFields.push(c);console.log(a.parent.editableRegion.textFields)};b.Curve=n;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=2*Math.PI,d=Math.round,h,p,c,f,l,n,m,g,q,e=function(a,c){c=b.Graphic.call(this,a,c)||this;c.size=c.size||a.evaluator.parser.parse("2");c.range=c.range||a.evaluator.parser.parse("[1, 100]");c.visible=2===c.parent.version&&void 0==c.visible?!0:c.visible;c.visible&&c.registerTextField();return c};$jscomp.inherits(e,b.Graphic);e.prototype.update=function(){h=this.evaluator;var a=$jscomp.makeIterator(h.eval(this.expresion)[0]);this.X=a.next().value;this.Y=
a.next().value;this.rotateExp&&(c=this.rotate(this.X,this.Y,b.degToRad(h.eval(this.rotateExp))),this.X=c.x,this.Y=c.y);n=h.eval(this.range)[0];this.rangeInf=n[0];this.rangeMax=n[1]};e.prototype.draw=function(){b.Graphic.prototype.draw.call(this,this.color,this.color)};e.prototype.drawTrace=function(){b.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};e.prototype.drawAux=function(c,e){h=this.evaluator;p=this.space;g=m=Math.ceil(h.eval(this.size)-.4);c.fillStyle=e.getColor();c.beginPath();
this.rangeInf>this.rangeMax&&(q=this.rangeInf,this.rangeInf=this.rangeMax,this.rangeMax=q);e=h.getVariable("n");for(var n=this.rangeInf,r=this.rangeMax;n<=r;n++){h.setVariable("n",n);var x=$jscomp.makeIterator(h.eval(this.expresion)[0]);this.X=x.next().value;this.Y=x.next().value;f=d(this.abs_coord?this.X:p.getAbsoluteX(this.X));l=d(this.abs_coord?this.Y:p.getAbsoluteY(this.Y));c.beginPath();c.arc(f,l,m,0,a);c.fill()}c.fill();this.text!=[""]&&(this.fontSize=Math.max(5,h.eval(this.font_size)),this.font=
this.font_style+" "+this.fontSize+"px "+this.font_family,b.Graphic.prototype.drawText.call(this,c,this.text,f+g,l-g,this.color,this.font,"start","alphabetic",h.eval(this.decimals),this.fixed,!0));h.setVariable("n",e)};e.prototype.registerTextField=function(){var a=this,c=b.newHTML("input");c.value=a.expresionString;c.disabled=!a.editable;c.onkeydown=function(b){13==b.keyCode&&(a.expresion=a.evaluator.parser.parse(this.value),a.parent.update())};a.parent.editableRegion.textFields.push(c)};b.Sequence=
e;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=2*Math.PI,d=Math.round,h,p,c,f,l,n,m=function(a,c){c=b.Graphic.call(this,a,c)||this;c.size=c.size||a.evaluator.parser.parse("2");c.text=new b.TextObject(c,c.text);return c};$jscomp.inherits(m,b.Graphic);m.prototype.update=function(){h=this.evaluator;var a=$jscomp.makeIterator(h.eval(this.expresion)[0]);this.X=a.next().value;this.Y=a.next().value;this.rotateExp&&(c=this.rotate(this.X,this.Y,b.degToRad(h.eval(this.rotateExp))),this.X=c.x,this.Y=c.y)};
m.prototype.draw=function(){b.Graphic.prototype.draw.call(this,this.color,this.color)};m.prototype.drawTrace=function(){b.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};m.prototype.drawAux=function(b,c){p=this.space;b.fillStyle=c.getColor();f=d(this.abs_coord?this.X:p.getAbsoluteX(this.X));l=d(this.abs_coord?this.Y:p.getAbsoluteY(this.Y));n=d(this.evaluator.eval(this.size));0<n&&(b.beginPath(),b.arc(f,l,n,0,a),b.fill());this.text.hasContent&&this.text.draw(b,c,f,l)};b.Point=m;return b}(descartesJS||
{});
descartesJS=function(b){if(b.loadLib)return b;var a=Math.round,d=2*Math.PI,h,p,c,f,l,n,m,g,q,e,r,x=function(a,c){c=b.Graphic.call(this,a,c)||this;c.width=c.width||a.evaluator.parser.parse("1");c.size=c.size||a.evaluator.parser.parse("2");c.text=new b.TextObject(c,c.text);return c};$jscomp.inherits(x,b.Graphic);x.prototype.update=function(){h=this.evaluator;c=h.eval(this.expresion);this.points=[];for(var a=0,d=c.length;a<d;a++)this.points[a]={x:c[a][0],y:c[a][1]};if(this.rotateExp)for(f=b.degToRad(h.eval(this.rotateExp)),a=
0,d=this.points.length;a<d;a++)this.points[a]=this.rotate(this.points[a].x,this.points[a].y,f)};x.prototype.draw=function(){b.Graphic.prototype.draw.call(this,this.color,this.color)};x.prototype.drawTrace=function(){b.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};x.prototype.drawAux=function(b,c,f){h=this.evaluator;p=this.space;r=a(h.eval(this.width));b.lineWidth=Math.max(1E-6,r);l=h.eval(this.size);b.fillStyle=c.getColor();b.strokeStyle=f.getColor();b.lineCap="round";n=0==b.lineWidth%
2?0:.5;this.abs_coord?(m=a(this.points[0].x),g=a(this.points[0].y),q=a(this.points[1].x),e=a(this.points[1].y)):(m=a(p.getAbsoluteX(this.points[0].x)),g=a(p.getAbsoluteY(this.points[0].y)),q=a(p.getAbsoluteX(this.points[1].x)),e=a(p.getAbsoluteY(this.points[1].y)));b.beginPath();b.moveTo(m+n,g+n);b.lineTo(q+n,e+n);this.dashStyle();b.stroke();0<l&&(b.beginPath(),b.arc(m,g,l,0,d),b.arc(q,e,l,0,d),b.fill());b.setLineDash([]);this.text.hasContent&&this.text.draw(b,f,parseInt((m+q)/2)-3,parseInt((g+e)/
2)+3)};b.Segment=x;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=Math.floor,d=Math.round,h,p,c,f,l,n,m,g,q,e,r,x,y,u=function(a,c){c=b.Graphic.call(this,a,c)||this;c.width=c.width||a.evaluator.parser.parse("5");c.size=c.size||a.evaluator.parser.parse("2");c.spear=c.spear||a.evaluator.parser.parse("8");c.arrow=c.arrow||new b.Color("ee0022");c.text=new b.TextObject(c,c.text);c.V=new b.Vector2D(0,0);c.points=[];return c};$jscomp.inherits(u,b.Graphic);u.prototype.update=function(){h=this.evaluator;p=h.eval(this.expresion);
for(var a=0,d=p.length;a<d;a++)this.points[a]={x:p[a][0],y:p[a][1]};if(this.rotateExp)for(c=b.degToRad(h.eval(this.rotateExp)),a=0,d=this.points.length;a<d;a++)this.points[a]=this.rotate(this.points[a].x,this.points[a].y,c)};u.prototype.draw=function(){b.Graphic.prototype.draw.call(this,this.arrow,this.color)};u.prototype.drawTrace=function(){b.Graphic.prototype.drawTrace.call(this,this.arrow,this.trace)};u.prototype.drawAux=function(b,c,u){h=this.evaluator;f=this.space;p=this.points;l=Math.max(0,
h.eval(this.width));n=Math.ceil(l/2);m=f.scale;this.V.x=p[1].x-p[0].x;this.V.y=p[1].y-p[0].y;g=this.V.vLength();this.angle=Math.atan2(this.V.y,this.V.x);b.fillStyle=c.getColor();b.strokeStyle=u.getColor();b.lineWidth=2;this.abs_coord?(q=d(p[0].x),e=d(p[0].y),r=d(p[1].x),x=d(p[1].y)):(q=d(f.getAbsoluteX(p[0].x)),e=d(f.getAbsoluteY(p[0].y)),r=d(f.getAbsoluteX(p[1].x)),x=d(f.getAbsoluteY(p[1].y)));y=Math.max(0,h.eval(this.spear));b.save();b.translate(q,e);this.abs_coord?b.rotate(this.angle):(g*=m,b.rotate(-this.angle));
b.beginPath();b.moveTo(-n,a(-n));b.lineTo(a(g-y-l),a(-n));b.lineTo(a(g-2*y),a(-y-n));b.lineTo(a(g),0);b.lineTo(a(g-2*y),a(y+n));b.lineTo(a(g-y-l),a(n));b.lineTo(-n,a(n));b.closePath();b.stroke();b.fill();b.restore();this.text.hasContent&&this.text.draw(b,u,parseInt((q+r)/2)-3,parseInt((e+x)/2)+3)};b.Arrow=u;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=Math.round,d,h,p,c,f,l,n,m,g=function(a,c){c=b.Graphic.call(this,a,c)||this;c.width=c.width||a.evaluator.parser.parse("1");c.fill=c.fill||"";c.points=[];return c};$jscomp.inherits(g,b.Graphic);g.prototype.update=function(){d=this.evaluator;p=d.eval(this.expresion);for(var a=0,g=p.length;a<g;a++)this.points[a]={x:p[a][0],y:p[a][1]};if(this.rotateExp)for(c=b.degToRad(d.eval(this.rotateExp)),a=0,g=this.points.length;a<g;a++)this.points[a]=this.rotate(this.points[a].x,
this.points[a].y,c)};g.prototype.draw=function(){b.Graphic.prototype.draw.call(this,this.fill,this.color)};g.prototype.drawTrace=function(){b.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};g.prototype.drawAux=function(b,c,g){d=this.evaluator;h=this.space;f=a(d.eval(this.width));b.lineWidth=Math.max(1E-6,f);b.strokeStyle=g.getColor();b.lineCap=b.lineJoin="round";l=0<f?.5:0;n=a(this.abs_coord?this.points[0].x:h.getAbsoluteX(this.points[0].x));m=a(this.abs_coord?this.points[0].y:h.getAbsoluteY(this.points[0].y));
b.beginPath();b.moveTo(n+l,m+l);g=1;for(var e=this.points.length;g<e;g++)n=a(this.abs_coord?this.points[g].x:h.getAbsoluteX(this.points[g].x)),m=a(this.abs_coord?this.points[g].y:h.getAbsoluteY(this.points[g].y)),b.lineTo(n+l,m+l);this.fill&&(b.fillStyle=c.getColor(),b.fill());this.dashStyle();b.stroke();b.setLineDash([])};b.Polygon=g;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=Math.round,d=Math.min,h=Math.max,p=Math.abs,c,f,l,n,m,g,q,e,r,x,y,u,v=function(a,c){c=b.Graphic.call(this,a,c)||this;c.width=c.width||a.evaluator.parser.parse("1");c.fill=c.fill||"";c.border_radius=c.border_radius||a.evaluator.parser.parse("0");return c};$jscomp.inherits(v,b.Graphic);v.prototype.update=function(){c=this.evaluator;g=c.eval(this.expresion);this.X=g[0][0];this.Y=g[0][1];this.w=150;this.h=100;this.rotateExp&&(l=this.rotate(g[0][0],g[0][1],
b.degToRad(c.eval(this.rotateExp))),this.X=l.x,this.Y=l.y);4<=g[0].length&&(this.w=g[0][2],this.h=g[0][3]);g[1]&&2==g[1].length&&(this.w=g[1][0],this.h=g[1][1]);this.w=h(0,this.w);this.h=h(0,this.h)};v.prototype.draw=function(){b.Graphic.prototype.draw.call(this,this.fill,this.color)};v.prototype.drawTrace=function(){b.Graphic.prototype.drawTrace.call(this,this.fill,this.trace,"trace")};v.prototype.drawAux=function(b,g,l,B){c=this.evaluator;f=this.space;n=a(c.eval(this.width));b.lineWidth=h(1E-6,
n);b.strokeStyle=l.getColor();b.lineCap="round";b.lineJoin="miter";m=0<n?.5:0;q=a(this.abs_coord?this.X:f.getAbsoluteX(this.X))+m;e=a(this.abs_coord?this.Y:f.getAbsoluteY(this.Y))+m;r=this.abs_coord?this.w:this.w*f.scale;x=this.abs_coord?this.h:-this.h*f.scale;y=d(h(0,c.eval(this.border_radius)),.5*p(r),.5*p(x));u=this.abs_coord?1:-1;b.beginPath();0==y?(b.moveTo(q,e),b.lineTo(q+r,e),b.lineTo(q+r,e+x),b.lineTo(q,e+x)):(b.moveTo(q+y,e),b.lineTo(q+r-y,e),b.arcTo(q+r,e,q+r,e+u*y,y),b.lineTo(q+r,e+x-u*
y),b.arcTo(q+r,e+x,q+r-y,e+x,y),b.lineTo(q+y,e+x),b.arcTo(q,e+x,q,e+x-u*y,y),b.lineTo(q,e+u*y),b.arcTo(q,e,q+y,e,y));b.closePath();this.fill&&(b.fillStyle=g.getColor(),b.fill());this.dashStyle();b.stroke();b.setLineDash([])};b.Rectangle=v;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=Math.PI,d=a/2,h=2*a,p=Math.round,c=Math.min,f=Math.max,l=Math.acos,n=Math.sqrt,m,g,q,e,r,x,y,u,v,A,w,z,B,D,I,H,G,F,C=function(a,c){c=b.Graphic.call(this,a,c)||this;c.width=c.width||a.evaluator.parser.parse("1");c.fill=c.fill||"";c.center=c.center||a.evaluator.parser.parse("(0,0)");c.radius=c.radius||a.evaluator.parser.parse("1");c.init=c.init||"0";c.end=c.end||"90";c.init.startsWith("_(")&&(c.iFlag=!0,c.init=c.init.slice(1));c.end.startsWith("_(")&&
(c.eFlag=!0,c.end=c.end.slice(1));c.initExpr=a.evaluator.parser.parse(c.init);c.endExpr=a.evaluator.parser.parse(c.end);c.text=new b.TextObject(c,c.text);return c};$jscomp.inherits(C,b.Graphic);C.prototype.update=function(){m=this.evaluator;var p=$jscomp.makeIterator(m.eval(this.center)[0]);this.X=p.next().value;this.Y=p.next().value;g=0;this.rotateExp&&(g=b.degToRad(m.eval(this.rotateExp)),q=Math.cos(g),e=Math.sin(g),r=this.X*q-this.Y*e,x=this.X*e+this.Y*q,this.X=r,this.Y=x);var G=m.eval(this.initExpr);
p=m.eval(this.endExpr);/^(\(|\[).*(\)|\])$/i.test(this.initExpr.type)&&/^(\(|\[).*(\)|\])$/i.test(this.endExpr.type)?(G=$jscomp.makeIterator(G[0]),y=G.next().value,u=G.next().value,p=$jscomp.makeIterator(p[0]),v=p.next().value,A=p.next().value,this.vectors?this.abs_coord&&(u=-u,A=-A):(y-=this.X,u=-u+this.Y,v-=this.X,A=-A+this.Y,this.abs_coord||(u=-u,A=-A)),w=0==y?0>u?3*d:d:l(1*y/n(y*y+u*u)),z=0==v?0>A?3*d:d:l(1*v/n(v*v+A*A)),w+=g,z+=g,0<y&&0<u&&this.abs_coord&&(w=h-w),0<y&&0>u&&!this.abs_coord&&(w=
h-w),0>y&&0>u&&!this.abs_coord&&(w=h-w),0>y&&0<u&&this.abs_coord&&(w=h-w),0<v&&0<A&&this.abs_coord&&(z=h-z),0<v&&0>A&&!this.abs_coord&&(z=h-z),0>v&&0>A&&!this.abs_coord&&(z=h-z),0>v&&0<A&&this.abs_coord&&(z=h-z),this.iFlag?(B=w,w=z,z=B):(B=c(w,z),D=f(w,z),w=B,z=D,z-w>a&&this.abs_coord&&(w=D,z=B),z-w<=a&&!this.abs_coord&&(w=D,z=B)),this.iniAng=w,this.endAng=z,this.drawPoints=!0):(this.iniAng=b.degToRad(G)+g,this.endAng=b.degToRad(p)+g,this.drawAngle=!0)};C.prototype.draw=function(){b.Graphic.prototype.draw.call(this,
this.fill,this.color)};C.prototype.drawTrace=function(){b.Graphic.prototype.drawTrace.call(this,this.fill,this.trace)};C.prototype.drawAux=function(a,b,c){m=this.evaluator;I=this.space;F=Math.max(0,m.eval(this.radius));a.lineWidth=Math.max(1E-6,p(m.eval(this.width)));a.lineCap="round";a.strokeStyle=c.getColor();this.abs_coord?(H=p(this.X),G=p(this.Y)):(H=p(I.getAbsoluteX(this.X)),G=p(I.getAbsoluteY(this.Y)),F*=I.scale,this.iniAng=-this.iniAng,this.endAng=-this.endAng);this.drawAngle&&this.iniAng>
this.endAng&&(c=$jscomp.makeIterator([this.endAng,this.iniAng]),this.iniAng=c.next().value,this.endAng=c.next().value);this.fill&&(a.fillStyle=b.getColor(),a.beginPath(),a.moveTo(H,G),a.arc(H,G,F,this.iniAng,this.endAng,void 0),a.fill());a.beginPath();a.arc(H,G,F,this.iniAng,this.endAng,void 0);this.dashStyle();a.stroke();this.text.hasContent&&this.text.draw(a,this.color,H,G)};b.Arc=C;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c=function(a,c){c=b.Graphic.call(this,a,c)||this;c.width=c.width||a.evaluator.parser.parse("0");c.align||(c.align="left");c.anchor||(c.anchor="top_left");c.shadowColor=c.shadowColor?c.shadowColor.getColor():"transparent";c.text=new b.TextObject(c,c.text);return c};$jscomp.inherits(c,b.Graphic);c.prototype.update=function(){a=this.evaluator;var c=$jscomp.makeIterator(a.eval(this.expresion)[0]);this.X=c.next().value;this.Y=c.next().value;this.rotateExp&&
(d=this.rotate(this.X,this.Y,b.degToRad(a.eval(this.rotateExp))),this.X=d.x,this.Y=d.y)};c.prototype.draw=function(){b.Graphic.prototype.draw.call(this,this.color)};c.prototype.drawTrace=function(){b.Graphic.prototype.drawTrace.call(this,this.trace)};c.prototype.drawAux=function(a,b){this.abs_coord?(h=parseInt(this.X),p=parseInt(this.Y)):(h=parseInt(this.space.getAbsoluteX(this.X)),p=parseInt(this.space.getAbsoluteY(this.Y)));this.text.draw(a,b,h,p)};b.Text=c;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=Math.round,d,h,p,c,f,l,n,m,g,q,e,r=function(a,c){e=c=b.Graphic.call(this,a,c)||this;e.file=e.file||"";e.inirot=e.inirot||a.evaluator.parser.parse("0");e.img=new Image;e.scaleX=e.scaleY=1;e.ratio=a.ratio;a=e.expresion.getChildren();e.x_e=a[0];e.y_e=a[1];2<a.length&&(e.centered=!0,e.s_x_e=a[2],e.s_y_e=3<a.length?a[3]:a[2]);e.evaluator.eval(e.clip)&&(e.clip=e.clip.getChildren());e.update();return c};$jscomp.inherits(r,b.Graphic);r.prototype.update=
function(){var a=this;d=a.evaluator;a.X=d.eval(a.x_e);a.Y=d.eval(a.y_e);a.rotateExp&&(h=a.rotate(a.X,a.Y,b.degToRad(d.eval(a.rotateExp))),a.X=h.x,a.Y=h.y);a.centered&&(a.scaleX=d.eval(a.s_x_e),a.scaleY=d.eval(a.s_y_e),0==a.scaleX&&(a.scaleX=1E-5),0==a.scaleY&&(a.scaleY=1E-5));if((p=d.eval(a.file))||""==p)a.img=a.parent.getImage(p),a.img.hasUpdate||(a.img.hasUpdate=!0,a.img.addEventListener("load",function(){a.space.update(!0)}))};r.prototype.draw=function(){b.Graphic.prototype.draw.call(this)};r.prototype.drawTrace=
function(){b.Graphic.prototype.drawTrace.call(this)};r.prototype.drawAux=function(h){e=this;d=e.evaluator;e.img&&e.img.ready&&e.img.complete&&(e.clip?(g=d.eval(e.clip[2]),q=d.eval(e.clip[3])):(g=e.img.width,q=e.img.height,e.img.canvas&&(g=a(g/e.img.ratio),q=a(q/e.img.ratio))),c=e.centered?0:a(g/2),f=e.centered?0:a(q/2),l=a(e.abs_coord?e.X:e.space.getAbsoluteX(e.X)),n=a(e.abs_coord?e.Y:e.space.getAbsoluteY(e.Y)),m=b.degToRad(-d.eval(e.inirot)),h.save(),h.translate(l+c,n+f),h.rotate(m),e.opacity&&(h.globalAlpha=
d.eval(e.opacity)),h.scale(e.scaleX,e.scaleY),e.clip?e.img.canvas?h.drawImage(e.img,d.eval(e.clip[0])*e.img.ratio,d.eval(e.clip[1])*e.img.ratio,g*e.img.ratio,q*e.img.ratio,-g/2,-q/2,g,q):h.drawImage(e.img,d.eval(e.clip[0]),d.eval(e.clip[1]),g,q,-g/2,-q/2,g,q):h.drawImage(e.img,-g/2,-q/2,g,q),h.restore())};b.Image=r;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l,n=document.createElement("canvas").getContext("2d");n.canvas.width=1;n.canvas.height=1;var m=function(a,c){return b.Graphic.call(this,a,c)||this};$jscomp.inherits(m,b.Graphic);m.prototype.update=function(){var a=$jscomp.makeIterator(this.evaluator.eval(this.expresion)[0]);this.X=a.next().value;this.Y=a.next().value};m.prototype.draw=function(){b.Graphic.prototype.draw.call(this,this.color,this.color)};m.prototype.drawTrace=function(){b.Graphic.prototype.drawTrace.call(this,
this.trace,this.trace)};m.prototype.drawAux=function(b,m){m=m.getColor();n.clearRect(0,0,1,1);n.fillStyle=m;n.fillRect(0,0,1,1);m=(new Uint32Array(n.getImageData(0,0,1,1).data.buffer))[0];f=b.getImageData(0,0,this.space.w,this.space.h);l=new Uint32Array(f.data.buffer);a=parseInt(this.abs_coord?this.X:this.space.getAbsoluteX(this.X));d=parseInt(this.abs_coord?this.Y:this.space.getAbsoluteY(this.Y));var g=f.width;p=0>a||0>d||a>=g||d>=f.height?-1:l[a+d*g];if(-1!=p&&m!=p){h=[a,d];for(c=0;0<h.length&&
!(c++,d=h.pop(),a=h.pop(),g=f.width,p==(0>a||0>d||a>=g||d>=f.height?-1:l[a+d*g])&&(l[a+d*f.width]=m,h.push(a-1,d),h.push(a+1,d),h.push(a,d-1),h.push(a,d+1)),c>=this.space.w*this.space.h););b.putImageData(f,0,0)}};b.Fill=m;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d=function(a,d){var c=b.BaseMacro.call(this,a,d,"parseGraphic","-text-image-point-polygon-arc-segment-arrow-macro-curve-equation-sequence-rectangle-fill-")||this;c.inirot=c.inirot||a.evaluator.parser.parse("0");c.inipos=c.inipos||a.evaluator.parser.parse("(0,0)");Object.assign(c,d);return c};$jscomp.inherits(d,b.BaseMacro);d.prototype.update=function(){a=this.evaluator.eval(this.inipos)[0];this.iniPosX=a[0];this.iniPosY=a[1]};d.prototype.drawAux=
function(a){for(var b=0,c=this.graphics.length;b<c;b++)this.graphics[b]&&(a.save(),this.graphics[b].abs_coord?a.translate(this.iniPosX,this.iniPosY):a.translate(this.iniPosX*this.space.scale,-this.iniPosY*this.space.scale),this.graphics[b].draw(),a.restore())};b.Macro=d;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=Math.sqrt,d=Math.sin,h=Math.cos,p=Math.abs,c=function(a,b,c,d){a=void 0===a?0:a;b=void 0===b?0:b;c=void 0===c?0:c;d=void 0===d?1:d;this.D=new Float32Array(4);this.set(a,b,c,d)};c.prototype.set=function(a,b,c,d){this.D[0]=a;this.D[1]=b;this.D[2]=c;this.D[3]=d;return this};c.prototype.norm3D=function(){var b=this.D[0],c=this.D[1],d=this.D[2];return a(b*b+c*c+d*d)};c.prototype.normalize3D=function(a){a=void 0===a?new c:a;var b=this.norm3D();if(0===
b)return a.set(0,0,0,this.w);b=1/b;return a.set(this.D[0]*b,this.D[1]*b,this.D[2]*b,this.w)};c.prototype.dotProduct3D=function(a){return this.D[0]*a.D[0]+this.D[1]*a.D[1]+this.D[2]*a.D[2]};c.prototype.crossProduct3D=function(a,b){b=void 0===b?new c:b;var d=$jscomp.makeIterator(this.D),g=d.next().value,l=d.next().value;d=d.next().value;var e=$jscomp.makeIterator(a.D);a=e.next().value;var f=e.next().value;e=e.next().value;return b.set(l*e-d*f,d*a-g*e,g*f-l*a,b.w)};c.prototype.scalarProd3D=function(a,
b){b=void 0===b?new c:b;return b.set(this.D[0]*a,this.D[1]*a,this.D[2]*a,this.w)};c.prototype.subtract3D=function(a,b){b=void 0===b?new c:b;return b.set(this.D[0]-a.D[0],this.D[1]-a.D[1],this.D[2]-a.D[2],this.w)};c.prototype.add3D=function(a,b){b=void 0===b?new c:b;return b.set(this.D[0]+a.D[0],this.D[1]+a.D[1],this.D[2]+a.D[2],this.w)};c.prototype.equals3D=function(a,b){return p(this.D[0]-a.D[0])<=b&&p(this.D[1]-a.D[1])<=b&&p(this.D[2]-a.D[2])<=b};c.prototype.clone=function(){return new c(this.D[0],
this.D[1],this.D[2],this.D[3])};$jscomp.global.Object.defineProperties(c.prototype,{x:{configurable:!0,enumerable:!0,get:function(){return this.D[0]},set:function(a){this.D[0]=a}},y:{configurable:!0,enumerable:!0,get:function(){return this.D[1]},set:function(a){this.D[1]=a}},z:{configurable:!0,enumerable:!0,get:function(){return this.D[2]},set:function(a){this.D[2]=a}},w:{configurable:!0,enumerable:!0,get:function(){return this.D[3]},set:function(a){this.D[3]=a}}});var f=function(a,b,c,d,f,e,h,p,
y,u,v,A,w,z,B,D){a=void 0===a?0:a;b=void 0===b?0:b;c=void 0===c?0:c;d=void 0===d?0:d;f=void 0===f?0:f;e=void 0===e?0:e;h=void 0===h?0:h;p=void 0===p?0:p;y=void 0===y?0:y;u=void 0===u?0:u;v=void 0===v?0:v;A=void 0===A?0:A;w=void 0===w?0:w;z=void 0===z?0:z;B=void 0===B?0:B;D=void 0===D?0:D;this.D=new Float32Array(16);this.set(a,b,c,d,f,e,h,p,y,u,v,A,w,z,B,D)};f.prototype.set=function(a,b,c,d,f,e,h,p,y,u,v,A,w,z,B,D){var g=this.D;g[0]=a;g[1]=b;g[2]=c;g[3]=d;g[4]=f;g[5]=e;g[6]=h;g[7]=p;g[8]=y;g[9]=u;
g[10]=v;g[11]=A;g[12]=w;g[13]=z;g[14]=B;g[15]=D;return this};f.prototype.setIdentity=function(){var a=this.D;a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=0;a[5]=1;a[6]=0;a[7]=0;a[8]=0;a[9]=0;a[10]=1;a[11]=0;a[12]=0;a[13]=0;a[14]=0;a[15]=1;return this};f.prototype.mulV4=function(a,b){b=void 0===b?new c:b;var d=this.D,g=a.D;a=b.D;var l=g[0],e=g[1],f=g[2];g=g[3];a[0]=l*d[0]+e*d[4]+f*d[8]+g*d[12];a[1]=l*d[1]+e*d[5]+f*d[9]+g*d[13];a[2]=l*d[2]+e*d[6]+f*d[10]+g*d[14];a[3]=l*d[3]+e*d[7]+f*d[11]+g*d[15];return b};f.prototype.translate=
function(a,b){b=void 0===b?(new f).setIdentity():b;var d=this.D,g=b.D;a instanceof c||(a=new c(a.x,a.y,a.z,a.w));var l=a.D[0],e=a.D[1];a=a.D[2];g[0]=d[0];g[1]=d[1];g[2]=d[2];g[3]=d[3];g[4]=d[4];g[5]=d[5];g[6]=d[6];g[7]=d[7];g[8]=d[8];g[9]=d[9];g[10]=d[10];g[11]=d[11];g[12]=d[0]*l+d[4]*e+d[8]*a+d[12];g[13]=d[1]*l+d[5]*e+d[9]*a+d[13];g[14]=d[2]*l+d[6]*e+d[10]*a+d[14];g[15]=d[3]*l+d[7]*e+d[11]*a+d[15];return b};f.prototype.rotateX=function(a,b){b=void 0===b?(new f).setIdentity():b;var c=this.D,g=b.D,
l=d(a);a=h(a);g[0]=c[0];g[1]=c[1];g[2]=c[2];g[3]=c[3];g[4]=c[4]*a+c[8]*l;g[5]=c[5]*a+c[9]*l;g[6]=c[6]*a+c[10]*l;g[7]=c[7]*a+c[11]*l;g[8]=c[4]*-l+c[8]*a;g[9]=c[5]*-l+c[9]*a;g[10]=c[6]*-l+c[10]*a;g[11]=c[7]*-l+c[11]*a;g[12]=c[12];g[13]=c[13];g[14]=c[14];g[15]=c[15];return b};f.prototype.rotateY=function(a,b){b=void 0===b?(new f).setIdentity():b;var c=this.D,g=b.D,l=d(a);a=h(a);g[0]=c[0]*a+c[8]*-l;g[1]=c[1]*a+c[9]*-l;g[2]=c[2]*a+c[10]*-l;g[3]=c[3]*a+c[11]*-l;g[4]=c[4];g[5]=c[5];g[6]=c[6];g[7]=c[7];g[8]=
c[0]*l+c[8]*a;g[9]=c[1]*l+c[9]*a;g[10]=c[2]*l+c[10]*a;g[11]=c[3]*l+c[11]*a;g[12]=c[12];g[13]=c[13];g[14]=c[14];g[15]=c[15];return b};f.prototype.rotateZ=function(a,b){b=void 0===b?(new f).setIdentity():b;var c=this.D,g=b.D,l=d(a);a=h(a);g[0]=c[0]*a+c[4]*l;g[1]=c[1]*a+c[5]*l;g[2]=c[2]*a+c[6]*l;g[3]=c[3]*a+c[7]*l;g[4]=c[0]*-l+c[4]*a;g[5]=c[1]*-l+c[5]*a;g[6]=c[2]*-l+c[6]*a;g[7]=c[3]*-l+c[7]*a;g[8]=c[8];g[9]=c[9];g[10]=c[10];g[11]=c[11];g[12]=c[12];g[13]=c[13];g[14]=c[14];g[15]=c[15];return b};f.prototype.clone=
function(){var a=new f;a.D.set(this.D);return a};b.norm3D=function(a){a instanceof c||(a=new c(a.x,a.y,a.z,a.w));return a.norm3D()};b.normalize3D=function(a){a instanceof c||(a=new c(a.x,a.y,a.z,a.w));return a.normalize3D().clone()};b.dotProduct3D=function(a,b){a instanceof c||(a=new c(a.x,a.y,a.z,a.w));b instanceof c||(b=new c(b.x,b.y,b.z,b.w));return a.dotProduct3D(b)};b.crossProduct3D=function(a,b){a instanceof c||(a=new c(a.x,a.y,a.z,a.w));b instanceof c||(b=new c(b.x,b.y,b.z,b.w));return a.crossProduct3D(b).clone()};
b.scalarProd3D=function(a,b){a instanceof c||(a=new c(a.x,a.y,a.z,a.w));return a.scalarProd3D(b).clone()};b.subtract3D=function(a,b){a instanceof c||(a=new c(a.x,a.y,a.z,a.w));b instanceof c||(b=new c(b.x,b.y,b.z,b.w));return a.subtract3D(b).clone()};b.add3D=function(a,b){a instanceof c||(a=new c(a.x,a.y,a.z,a.w));b instanceof c||(b=new c(b.x,b.y,b.z,b.w));return a.add3D(b).clone()};b.equals3D=function(a,b,d){a instanceof c||(a=new c(a.x,a.y,a.z,a.w));b instanceof c||(b=new c(b.x,b.y,b.z,b.w));return a.equals3D(b,
d)};b.Vec4D=c;b.Mat4=f;return b}(descartesJS||{});
descartesJS=function(b){function a(a){a.textNode=null;0!==parseInt(this.size)&&(a.lineWidth=1,a.fillStyle=this.backColor,a.strokeStyle=this.frontColor,a.beginPath(),a.arc(this.projV[0].x,this.projV[0].y,this.size,0,l),a.fill(),a.stroke())}function d(a,b){a.textNode=null;a.lineCap=a.lineJoin="round";a.lineWidth=.4;a.beginPath();a.moveTo(this.projV[0].x,this.projV[0].y);for(var c=1,d=this.projV.length;c<d;c++)a.lineTo(this.projV[c].x,this.projV[c].y);a.closePath();a.strokeStyle=a.fillStyle;"color"===
this.model?(a.fillStyle=0>this.direction?this.backColor:this.frontColor,a.stroke(),a.fill()):"light"===this.model||"metal"===this.model?(a.fillStyle=b.computeColor(0>this.direction?this.backColor:this.frontColor,this,"metal"===this.model),a.stroke(),a.fill()):"wire"===this.model&&(a.lineWidth=1.25,a.strokeStyle=this.frontColor,a.stroke());this.edges&&"wire"!==this.model&&(a.lineWidth=1,a.strokeStyle=this.edges,a.stroke())}function h(a){a.textNode=null;x=this.evaluator.getVariable(this.family);this.evaluator.setVariable(this.family,
this.fVal);this.fontSize=g(5,this.evaluator.eval(this.font_size));this.font=this.font_style+" "+this.fontSize+"px "+this.font_family;this.drawText(a,this.text,this.projV[0].x,this.projV[0].y,this.frontColor,this.font,"left","alphabetic",this.decimals,this.fixed,!0);this.evaluator.setVariable(this.family,x)}function p(a){a.textNode=null;a.lineCap="butt";a.lineJoin="round";a.lineWidth=this.lineWidth;a.strokeStyle=this.frontColor;a.beginPath();a.moveTo(this.projV[0].x,this.projV[0].y);a.lineTo(this.projV[1].x,
this.projV[1].y);"dot"===this.lineDash?a.setLineDash([a.lineWidth,a.lineWidth]):"dash"===this.lineDash?a.setLineDash([4*a.lineWidth,3*a.lineWidth]):"dash_dot"===this.lineDash?a.setLineDash([4*a.lineWidth,2*a.lineWidth,a.lineWidth,2*a.lineWidth]):(a.lineCap="round",a.setLineDash([]));a.stroke()}function c(a,c,d){return b.normalize3D(b.crossProduct3D(b.subtract3D(a,c),b.subtract3D(a,d)))}if(b.loadLib)return b;var f,l=2*Math.PI,n=Math.abs,m=Math.min,g=Math.max,q,e,r,x,y,u,v,A,w,z=function(b,g){Object.assign(this,
b);f=this;f.space=g;f.projV=[];f.spaceV=[];f.newProjV=[];f.newSpaceV=[];"vertex"===f.type?f.draw=a:"face"===f.type?(f.normal=c(f.V[0],f.V[1],f.V[2]),f.draw=d):"text"===f.type?f.draw=h:"edge"===f.type&&(f.draw=p);f.isText&&(f.computeDepth=function(){this.normal={x:0,y:0,z:0};this.projV=this.V;this.depth=this.V[0].z;this.avg=this.V[0]})};z.prototype.computeDepth=function(a){f=this;f.space=a;f.avg={x:0,y:0,z:0};f.removeDoubles();f.normal={x:0,y:1,z:0};f.direction={x:1,y:0,z:0};for(var d=f.V.length,e=
0;e<d;e++)f.spaceV[e]=a.rotateVertex(f.V[e]),f.avg.x+=f.spaceV[e].x,f.avg.y+=f.spaceV[e].y,f.avg.z+=f.spaceV[e].z;f.avg=b.scalarProd3D(f.avg,1/d);f.avg_proy=a.project(f.avg);f.depth=b.norm3D(b.subtract3D(a.eye,f.avg));2<f.V.length&&(f.normal=c(f.spaceV[0],f.spaceV[1],f.spaceV[2]));d=0;for(e=f.V.length;d<e;d++)f.newSpaceV[d]=f.spaceV[d],f.projV[d]=f.newProjV[d]=a.project(f.spaceV[d]);2<f.V.length&&(f.direction=c(f.projV[0],f.projV[1],f.projV[2]).z);f.minDistToEye=Infinity;f.maxDistToEye=-Infinity;
f.minX=Infinity;f.maxX=-Infinity;f.minY=Infinity;f.maxY=-Infinity;d=0;for(e=f.V.length;d<e;d++)u=b.norm3D(b.subtract3D(f.spaceV[d],a.eye)),f.minDistToEye=m(f.minDistToEye,u),f.maxDistToEye=g(f.maxDistToEye,u);a=0;for(d=f.V.length;a<d;a++)f.minX>f.projV[a].x&&(f.minX=f.projV[a].x),f.maxX<f.projV[a].x&&(f.maxX=f.projV[a].x),f.minY>f.projV[a].y&&(f.minY=f.projV[a].y),f.maxY<f.projV[a].y&&(f.maxY=f.projV[a].y)};z.prototype.removeDoubles=function(){f=this;if("edge"!==f.type){y=[];for(var a=0,b=f.V.length;a<
b;a++)(1E-8<n(f.V[a].x-f.V[(a+1)%b].x)||1E-8<n(f.V[a].y-f.V[(a+1)%b].y)||1E-8<n(f.V[a].z-f.V[(a+1)%b].z)||1E-8<n(f.V[a].w-f.V[(a+1)%b].w))&&y.push(f.V[a]);0===y.length&&y.push(f.V[0]);f.V=y}};z.prototype.drawText=function(a,c,d,g,f,m,l,h,p,n,u){q=this.evaluator;a.textNode=c;m=q.eval(this.offset_dist);l=-b.degToRad(q.eval(this.offset_angle));d+=m*Math.cos(l);g+=m*Math.sin(l);a.textNode.pos={x:d,y:g};c.hasContent&&(c.draw(a,f,d,g,!0),r=this.fromPoint?c.textNodes.metrics.w/2:0,e=this.fromPoint?c.textNodes.metrics.h/
2:0,c.draw(a,f,d-r,g-e))};z.prototype.splitFace=function(a){if(this.intersects(a)){var c=null,d=null,g=0,e=0,f,m=this.V,l=a.V;var h=0;for(f=l.length;h<f;h++){var q=this.intersection(l[h],l[(h+1)%f]);if(null!==q)if(null===c){if(c=q,g=h,2===l.length){d=c;break}}else if(!b.equals3D(q,c,1E-8)){d=q;e=h;break}}if(null!==c&&null!==d){h=this.isInterior(c)||this.isInterior(d);var p=f=null;if(!h&&3<=l.length){var r=0;for(m=m.length;r<m;r++)if(q=a.intersection(this.V[r],this.V[(r+1)%m]),null!==q)if(null===f)f=
q;else if(!b.equals3D(q,f,1E-8)){p=q;break}}if(h||null!==f&&null!==p&&a.isInterior(f)&&a.isInterior(p)){p=!0;m=q=null;if(2===l.length)b.equals3D(c,l[0],1E-8)||b.equals3D(c,l[1],1E-8)?p=!1:(q=[],q[0]=l[0],q[1]=c,m=[],m[0]=c,m[1]=l[1]);else for(q=[],m=[],r=k=f=h=0;r<l.length;r++)r<g?q[h++]=l[r]:r==g?(q[h++]=l[r],q[h++]=c,m[f++]=c):r<e?m[f++]=l[r]:r==e?(m[f++]=l[r],m[f++]=d,q[h++]=d):q[h++]=l[r];if(p){c=[];c[0]=new z({V:q,type:"face",frontColor:a.frontColor,backColor:a.backColor,edges:a.edges,model:a.model},
this.space);c[0].removeDoubles();c[0].normal=a.normal;c[1]=new z({V:m,type:"face",frontColor:a.frontColor,backColor:a.backColor,edges:a.edges,model:a.model},this.space);c[1].removeDoubles();c[1].normal=a.normal;if(2<c[0].V.length)return 2<c[1].V.length?c:[c[0]];if(2<c[1].V.length)return[c[1]]}}}}return[a]};z.prototype.intersects=function(a){return this.intersectsPlane(a)&&a.intersectsPlane(this)};z.prototype.intersectsPlane=function(a){var c=this.V;var d=a.V;if(0<c.length){var g=b.dotProduct3D(d[0],
a.normal);var e=b.dotProduct3D(c[0],a.normal);if(1E-8>n(g-e))return!0;for(var f=1,m=c.length;f<m;f++)if(d=b.dotProduct3D(c[f],a.normal),1E-8>n(g-d)||d>g&&e<g||d<g&&e>g)return!0}return!1};z.prototype.intersection=function(a,c){var d=this.V;if(0<d.length){c=b.subtract3D(c,a);var g=b.dotProduct3D(c,this.normal);if(0!==g&&(d=b.dotProduct3D(b.subtract3D(d[0],a),this.normal)/g,-1E-8<d&&1.00000001>d))return b.add3D(a,b.scalarProd3D(c,d))}return null};z.prototype.isInterior=function(a){var c=this.V;if(0<
c.length)for(var d=0,g=b.subtract3D(c[0],a),e=0,f=c.length;e<f;e++){var m=b.subtract3D(c[(e+1)%f],a),l=b.dotProduct3D(b.crossProduct3D(g,m),this.normal);if(1E-8>n(l)){if(0>b.dotProduct3D(g,m))break}else{if(0>d&&0<l||0<d&&0>l)return!1;g=m;d=l}}return!0};z.prototype.inFrontOf=function(a,b,c){if(this.minDistToEye>=b.maxDistToEye||this.maxX<=b.minX||this.minX>=b.maxX||this.maxY<=b.minY||this.minY>=b.maxY)return!1;for(w=0;3>w;w++)if(v=null,v=0===w?this.intersections(b):1===w?b.verticesContainedIn(this):
this.verticesContainedIn(b),null!=v&&0<v.length){for(var d=$jscomp.makeIterator(v),g=d.next();!g.done;g=d.next())a.push(g.value);d=$jscomp.makeIterator(v);for(g=d.next();!g.done;g=d.next()){g=g.value;A=this.space.rayFromEye(g.x,g.y);try{t=this.distanceToEyeAlong(A)-b.distanceToEyeAlong(A);if(t<=-c)return!0;if(t>=c)return!1}catch(F){}}}return!1};z.prototype.intersections=function(a){for(var c=[],d,g,e,f=new b.R2,m=this.newSpaceV,l=a.newSpaceV,h=this.newProjV,q=a.newProjV,p=0,r=m.length;p<r;p++){a=
m[p];d=m[(p+1)%r];for(var n=0,u=l.length;n<u;n++)g=l[n],e=l[(n+1)%u],a!=g&&a!=e&&d!=g&&d!=e&&(g=f.intersection(h[p],h[(p+1)%r],q[n],q[(n+1)%u]),null!=g&&c.push(g))}return c};z.prototype.distanceToEyeAlong=function(a){a=b.dotProduct3D(this.normal,a);if(1E-6<n(a))return b.dotProduct3D(b.subtract3D(this.avg,this.space.eye),this.normal)/a;throw new Exception("Face is invisible");};z.prototype.verticesContainedIn=function(a){for(var b=[],c=this.newSpaceV,d=this.newProjV,g=0,e=c.length;g<e;g++)!a.isVertex(c[g])&&
a.appearsToContain(d[g])&&b.push(d[g]);return b};z.prototype.appearsToContain=function(a){for(var b=0,c,d=this.newProjV,e=0,f=this.newSpaceV.length;e<f;e++){c=(d[e].x-a.x)*(d[(e+1)%f].y-a.y)-(d[(e+1)%f].x-a.x)*(d[e].y-a.y);if(0!=b)if(1E-8>n(c)){if(1E-8<n(d[e].x-d[(e+1)%f].x))return m(d[e].x,d[(e+1)%f].x)<=a.x+1E-8&&a.x<=g(d[e].x,d[(e+1)%f].x)+1E-8;if(1E-8<n(d[e].y-d[(e+1)%f].y))return m(d[e].y,d[(e+1)%f].y)<=a.y+1E-8&&a.y<=g(d[e].y,d[(e+1)%f].y)+1E-8}else if(0<b&&0>c||0>b&&0<c)return!1;b=c}return!0};
z.prototype.isVertex=function(a){for(var c=$jscomp.makeIterator(this.newSpaceV),d=c.next();!d.done;d=c.next())if(b.equals3D(a,d.value,1E-8))return!0;return!1};b.Primitive3D=z;return b}(descartesJS||{});
descartesJS=function(b){function a(a){for(var b=[],c=0,d,g=a.length,f=a.length-1;-1<f;f--)d=a.charAt(f),0==c?"="==d&&(c=1):1==c?" "!=d&&(c="<"===d||">"===d?0:2):2==c&&" "==d&&(b.unshift(a.substring(f+1,g)),g=f,c=0);b.unshift(a.substring(0,g));return b}if(b.loadLib)return b;var d,h=b.degToRad,p,c,f,l,n,m,g=function(a,c){d=this;d.parent=a;d.evaluator=a.evaluator;var g=a.evaluator.parser;d.spaceID="E0";d.background=!1;d.type="";d.color=new b.Color("eeffaa");d.backcolor=new b.Color("6090a0");d.Nu=d.Nv=
d.evaluator.parser.parse("7");d.drawif=g.parse("1");d.abs_coord=!1;d.family="";d.family_interval=g.parse("[0,1]");d.family_steps=g.parse("8");d.font="SansSerif,PLAIN,18";d.fixed=!0;d.text="";d.decimals=g.parse("2");d.inirot=d.endrot="(0,0,0)";d.inirotEuler=d.endrotEuler=!1;d.inipos=d.endpos=g.parse("(0,0,0)");d.model="color";Object.assign(d,c);void 0==d.expresion&&"macro"!==d.type&&(d.expresion=g.parse("(0,0)"));d.space=d.getSpace();d.canvas=d.background?d.space.backCanvas:d.space.canvas;d.ctx=d.canvas.getContext("2d");
d.font_str=d.font;d.font=b.convertFont(d.font);d.fontSize=d.font.match(/([\d\.]+)px/);d.fontSize=d.fontSize?parseFloat(d.fontSize[1]):10;d.font_style=b.getFontStyle(d.font_str.split(",")[1]);if("boolean"===typeof d.bold||"boolean"===typeof d.italics)d.font_style=(d.italics?"Italic ":"")+(d.bold?"Bold ":"");d.font_family||(d.font_family=d.font_str.split(",")[0]);d.font_family=b.getFontName(d.font_family);"undefined"===typeof d.font_size&&(d.font_size=a.evaluator.parser.parse(d.fontSize.toString()));
d.inirot.includes("Euler")&&(d.inirot=d.inirot.replace("Euler",""),d.inirotEuler=!0);d.endrot.includes("Euler")&&(d.endrot=d.endrot.replace("Euler",""),d.endrotEuler=!0);d.inirot=g.parse(d.inirot);d.endrot=g.parse(d.endrot);d.inirotM=new b.Mat4;d.inirotM_X=new b.Mat4;d.inirotM_Y=new b.Mat4;d.inirotM_Z=new b.Mat4;d.iniposM=new b.Mat4;d.endrotM=new b.Mat4;d.endrotM_X=new b.Mat4;d.endrotM_Y=new b.Mat4;d.endrotM_Z=new b.Mat4;d.endposM=new b.Mat4;m=new b.Mat4};g.prototype.getSpace=function(){var a=this;
return this.parent.spaces.find(function(b){return b.id===a.spaceID})||this.parent.spaces[0]};g.prototype.getFamilyValues=function(){d=this;p=d.evaluator;var a=$jscomp.makeIterator(p.eval(d.family_interval)[0]);d.fInf=a.next().value;d.fSup=a.next().value;d.fSteps=Math.round(p.eval(d.family_steps));d.fSep=0<d.fSteps?(d.fSup-d.fInf)/d.fSteps:0};g.prototype.buildFamilyPrimitives=function(){d=this;p=d.evaluator;d.getFamilyValues();c=p.getVariable(d.family);if(0<=d.fSteps)for(var a=0,b=d.fSteps;a<=b;a++)d.fVal=
d.fInf+a*d.fSep,p.setVariable(d.family,d.fVal),p.eval(d.drawif)&&d.buildPrimitives();p.setVariable(d.family,c)};g.prototype.update=function(){d=this;d.primitives=[];d.evaluator.eval(d.drawif)&&(d.family||d.buildPrimitives());d.family&&d.buildFamilyPrimitives()};g.prototype.updateMVMatrix=function(){d=this;f=d.evaluator.eval(d.inirot)[0];d.inirotEuler?(d.inirotM.setIdentity(),d.inirotM=d.inirotM.rotateZ(h(f[0])),d.inirotM=d.inirotM.rotateX(h(f[1])),d.inirotM=d.inirotM.rotateZ(h(f[2]))):(m.setIdentity(),
m.rotateX(h(f[0]),d.inirotM_X),m.rotateY(h(f[1]),d.inirotM_Y),m.rotateZ(h(f[2]),d.inirotM_Z));f=d.evaluator.eval(d.inipos)[0];d.iniposM=d.iniposM.setIdentity().translate({x:f[0],y:f[1],z:f[2]});f=d.evaluator.eval(d.endrot)[0];d.endrotEuler?(d.endrotM.setIdentity(),d.endrotM=d.endrotM.rotateZ(h(f[0])),d.endrotM=d.endrotM.rotateX(h(f[1])),d.endrotM=d.endrotM.rotateZ(h(f[2]))):(m.setIdentity(),m.rotateX(h(f[0]),d.endrotM_X),m.rotateY(h(f[1]),d.endrotM_Y),m.rotateZ(h(f[2]),d.endrotM_Z));f=d.evaluator.eval(d.endpos)[0];
d.endposM=d.endposM.setIdentity().translate({x:f[0],y:f[1],z:f[2]})};g.prototype.transformVertex=function(a){d=this;l=d.inirotEuler?d.inirotM.mulV4(a):d.inirotM_Z.mulV4(d.inirotM_Y.mulV4(d.inirotM_X.mulV4(a)));l=d.iniposM.mulV4(l);l=d.endrotEuler?d.endrotM.mulV4(l):d.endrotM_Z.mulV4(d.endrotM_Y.mulV4(d.endrotM_X.mulV4(l)));l=d.endposM.mulV4(l);d.macroChildren&&(l=d.applyMacroTransform(l));return l};g.prototype.applyMacroTransform=function(a){d=this;l=d.macro_inirotEuler?d.macro_inirotM.mulV4(a):d.macro_inirotM_Z.mulV4(d.macro_inirotM_Y.mulV4(d.macro_inirotM_X.mulV4(a)));
l=d.macro_iniposM.mulV4(l);l=d.macro_endrotEuler?d.macro_endrotM.mulV4(l):d.macro_endrotM_Z.mulV4(d.macro_endrotM_Y.mulV4(d.macro_endrotM_X.mulV4(l)));return l=d.macro_endposM.mulV4(l)};g.prototype.parseExpression=function(){for(var b=[],c=$jscomp.makeIterator(this.expresion.split(";")),d=c.next();!d.done;d=c.next())d=d.value,""!==d.trim()&&b.push.apply(b,$jscomp.arrayFromIterable(a(d)));c=0;for(d=b.length;c<d;c++)b[c]=this.evaluator.parser.parse(b[c],!0);return b};g.prototype.splitFace=function(a){for(var b=
$jscomp.makeIterator(this.primitives),c=b.next();!c.done;c=b.next())if(c=c.value,n=[],"face"===c.type){for(var d=$jscomp.makeIterator(a.primitives),g=d.next();!g.done;g=d.next())g=g.value,"face"===g.type?n.push.apply(n,$jscomp.arrayFromIterable(c.splitFace(g))):n.push(g);a.primitives=n}};b.Graphic3D=g;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l=function(a,c){return b.Graphic3D.call(this,a,c)||this};$jscomp.inherits(l,b.Graphic3D);l.prototype.buildPrimitives=function(){a=this;d=a.evaluator;a.updateMVMatrix();h=d.eval(a.expresion)[0];p=h[0];c=h[1];f=h[2];a.primitives.push(new b.Primitive3D({V:[a.transformVertex(new b.Vec4D(p,c,f))],type:"vertex",backColor:a.backcolor.getColor(),frontColor:a.color.getColor(),size:d.eval(a.width)}));""!==a.text&&(a.offset_dist=a.offset_dist||d.parser.parse("10"),
a.offset_angle=a.offset_angle||d.parser.parse("270"),a.primitives.push(new b.Primitive3D({V:[a.transformVertex(new b.Vec4D(p,c,f))],type:"text",fromPoint:!0,frontColor:a.color.getColor(),font_size:a.font_size,font_style:a.font_style,font_family:a.font_family,decimals:d.eval(a.decimals),fixed:a.fixed,evaluator:d,text:new b.TextObject(a,a.text),family:a.family,familyValue:a.fVal,offset_dist:a.offset_dist,offset_angle:a.offset_angle},a.space)))};b.Point3D=l;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c=function(a,c){c=b.Graphic3D.call(this,a,c)||this;c.width=c.width||a.evaluator.parser.parse("1");return c};$jscomp.inherits(c,b.Graphic3D);c.prototype.buildPrimitives=function(){a=this;h=a.evaluator;a.updateMVMatrix();d=h.getVariable("u");h.setVariable("u",a.Nu);p=h.eval(a.expresion);a.primitives.push(new b.Primitive3D({V:[a.transformVertex(new b.Vec4D(p[0][0],p[0][1],p[0][2])),a.transformVertex(new b.Vec4D(p[1][0],p[1][1],p[1][2]))],type:"edge",
lineDash:a.lineDash,frontColor:a.color.getColor(),lineWidth:h.eval(a.width)},a.space));h.setVariable("u",d)};b.Segment3D=c;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l,n,m,g,q,e=function(c,d){a=d=b.Graphic3D.call(this,c,d)||this;a.param=a.param||"t";a.parameter_interval=a.parameter_interval||c.evaluator.parser.parse("[0,1]");a.parameter_steps=a.parameter_steps||c.evaluator.parser.parse("8");a.expresion=a.parseExpression();return d};$jscomp.inherits(e,b.Graphic3D);e.prototype.buildPrimitives=function(){a=this;d=a.evaluator;a.updateMVMatrix();c=d.getVariable("x");f=d.getVariable("y");l=d.getVariable("z");
h=d.getVariable("u");p=d.getVariable("v");d.setVariable("u",0);d.setVariable("v",0);n=parseInt(d.eval(a.Nu));m=parseInt(d.eval(a.Nv));g=[];for(var e=0;e<=n;e++){d.setVariable("u",e/n);for(var x=0;x<=m;x++){d.setVariable("v",x/m);for(var y=$jscomp.makeIterator(a.expresion),u=y.next();!u.done;u=y.next())d.eval(u.value);g.push(a.transformVertex(new b.Vec4D(d.getVariable("x"),d.getVariable("y"),d.getVariable("z"))))}}e=a.color.getColor();x=a.backcolor.getColor();y=a.edges?a.edges.getColor():"";for(u=
0;u<n;u++)for(var v=0;v<m;v++)q=[],q.push(g[v+u*m+u]),q.push(g[v+1+u*m+u]),q.push(g[v+2+(u+1)*m+u]),q.push(g[v+1+(u+1)*m+u]),a.primitives.push(new b.Primitive3D({V:q,type:"face",frontColor:e,backColor:x,edges:y,model:a.model},a.space));d.setVariable("x",c);d.setVariable("y",f);d.setVariable("z",l);d.setVariable("u",h);d.setVariable("v",p)};b.Surface3D=e;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c=function(a,c){c=b.Graphic3D.call(this,a,c)||this;c.width=c.width||a.evaluator.parser.parse("1");return c};$jscomp.inherits(c,b.Graphic3D);c.prototype.buildPrimitives=function(){a=this;d=a.evaluator;a.updateMVMatrix();h=d.eval(a.expresion);p=a.color.getColor();for(var c=0,l=h.length-1;c<l;c++)a.primitives.push(new b.Primitive3D({V:[a.transformVertex(new b.Vec4D(h[c][0],h[c][1],h[c][2])),a.transformVertex(new b.Vec4D(h[c+1][0],h[c+1][1],h[c+
1][2]))],type:"edge",frontColor:p,lineWidth:d.eval(a.width)},a.space))};b.Polygon3D=c;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l,n,m=function(c,d){a=d=b.Graphic3D.call(this,c,d)||this;a.width=a.width||c.evaluator.parser.parse("1");a.expresion=a.parseExpression();return d};$jscomp.inherits(m,b.Graphic3D);m.prototype.buildPrimitives=function(){a=this;n=a.evaluator;a.updateMVMatrix();c=n.getVariable("x");f=n.getVariable("y");l=n.getVariable("z");p=n.getVariable("u");n.setVariable("u",0);h=n.eval(a.Nu);d=[];for(var g=0;g<=h;g++){n.setVariable("u",g/h);for(var m=$jscomp.makeIterator(a.expresion),
e=m.next();!e.done;e=m.next())n.eval(e.value);d.push(a.transformVertex(new b.Vec4D(n.getVariable("x"),n.getVariable("y"),n.getVariable("z"))))}g=0;for(m=d.length-1;g<m;g++)a.primitives.push(new b.Primitive3D({V:[d[g],d[g+1]],type:"edge",frontColor:a.color.getColor(),lineWidth:n.eval(a.width)},a.space));a.fill&&2<d.length&&a.primitives.push(new b.Primitive3D({V:d,type:"face",frontColor:a.fill.getColor(),backColor:a.fill.getColor(),edges:"",model:a.model},a.space));n.setVariable("x",c);n.setVariable("y",
f);n.setVariable("z",l);n.setVariable("u",p)};b.Curve3D=m;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p=function(a,d){return b.Graphic3D.call(this,a,d)||this};$jscomp.inherits(p,b.Graphic3D);p.prototype.buildPrimitives=function(){a=this;d=a.evaluator;a.updateMVMatrix();h=d.eval(a.expresion);a.primitives.push(new b.Primitive3D({V:[a.transformVertex(new b.Vec4D(h[0][0],h[0][1],h[0][2])),a.transformVertex(new b.Vec4D(h[2][0],h[2][1],h[2][2])),a.transformVertex(new b.Vec4D(h[1][0],h[1][1],h[1][2]))],type:"face",frontColor:a.color.getColor(),backColor:a.backcolor.getColor(),
edges:a.edges?a.edges.getColor():"",model:a.model},a.space))};b.Triangle3D=p;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c=function(a,c){return b.Graphic3D.call(this,a,c)||this};$jscomp.inherits(c,b.Graphic3D);c.prototype.buildPrimitives=function(){a=this;h=a.evaluator;a.updateMVMatrix();p=h.eval(a.expresion);d=[];for(var c=p.length-1;0<=c;c--)d.push(a.transformVertex(new b.Vec4D(p[c][0],p[c][1],p[c][2])));a.primitives.push(new b.Primitive3D({V:d,type:"face",frontColor:a.color.getColor(),backColor:a.backcolor.getColor(),edges:a.edges?a.edges.getColor():"",model:a.model},
a.space))};b.Face3D=c;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l,n=function(c,d){a=d=b.Graphic3D.call(this,c,d)||this;a.width=a.width||c.evaluator.parser.parse("2");a.length=a.length||c.evaluator.parser.parse("2");return d};$jscomp.inherits(n,b.Graphic3D);n.prototype.buildPrimitives=function(){a=this;l=a.evaluator;a.updateMVMatrix();d=l.eval(a.Nu);h=[a.transformVertex(new b.Vec4D)];p=l.eval(a.width)/2;c=l.eval(a.length)/2;f=2*Math.PI/d;for(var m=0;m<d;m++)h.push(a.transformVertex(new b.Vec4D(p*Math.cos(f*
m),c*Math.sin(f*m),0)));m=a.color.getColor();for(var g=a.backcolor.getColor(),q=a.edges?a.edges.getColor():"",e=0;e<d;e++)a.primitives.push(new b.Primitive3D({V:[h[0],e+2<=d?h[e+2]:h[1],h[e+1]],type:"face",frontColor:m,backColor:g,edges:q,model:a.model},a.space))};b.Polireg3D=n;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p=function(a,d){a=b.Graphic3D.call(this,a,d)||this;a.shadowColor=a.shadowColor?a.shadowColor.getColor():"transparent";return a};$jscomp.inherits(p,b.Graphic3D);p.prototype.buildPrimitives=function(){a=this;d=a.evaluator;h=d.eval(a.expresion)[0];a.primitives.push(new b.Primitive3D({V:[new b.Vec4D(h[0],h[1],0)],type:"text",frontColor:a.color.getColor(),font_size:a.font_size,font_style:a.font_style,font_family:a.font_family,decimals:d.eval(a.decimals),
fixed:a.fixed,displace:0,isText:!0,evaluator:d,text:new b.TextObject(a,a.text),family:a.family,familyValue:a.fVal},a.space))};b.Text3D=p;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c=b.degToRad,f=0,l=function(c,d){var g;a=g=b.BaseMacro.call(this,c,d,"parse3DGraphic","-point-segment-polygon-curve-triangle-face-polireg-surface-text-cube-box-tetrahedron-octahedron-sphere-dodecahedron-icosahedron-ellipsoid-cone-cylinder-torus-mesh-macro-")||this;a.inirot=a.inirot||"(0,0,0)";a.inirotEuler=a.inirotEuler||!1;a.inipos=a.inipos||c.evaluator.parser.parse("(0,0,0)");a.endrot=a.endrot||"(0,0,0)";a.endrotEuler=a.endrotEuler||!1;a.endpos=
a.endpos||c.evaluator.parser.parse("(0,0,0)");a.name=a.name||"_M_"+f++;Object.assign(a,d);"string"===typeof a.inirot&&a.inirot.includes("Euler")&&(a.inirot=a.inirot.replace("Euler",""),a.inirotEuler=!0);"string"===typeof a.endrot&&a.endrot.includes("Euler")&&(a.endrot=a.endrot.replace("Euler",""),a.endrotEuler=!0);a.inirot=a.evaluator.parser.parse(a.inirot);a.endrot=a.evaluator.parser.parse(a.endrot);a.inirotM=new b.Mat4;a.inirotM_X=new b.Mat4;a.inirotM_Y=new b.Mat4;a.inirotM_Z=new b.Mat4;a.iniposM=
new b.Mat4;a.endrotM=new b.Mat4;a.endrotM_X=new b.Mat4;a.endrotM_Y=new b.Mat4;a.endrotM_Z=new b.Mat4;a.endposM=new b.Mat4;h=new b.Mat4;c=$jscomp.makeIterator(a.graphics);for(d=c.next();!d.done;d=c.next())d.value.macroChildren=!0;return g};$jscomp.inherits(l,b.BaseMacro);l.prototype.buildFamilyPrimitives=function(){a=this;d=a.evaluator;a.getFamilyValues();var b=d.getVariable(a.family);if(0<=a.fSteps)for(var c=0,g=a.fSteps;c<=g;c++)a.fVal=a.fInf+c*a.fSep,d.setVariable(a.family,a.fVal),d.eval(a.drawif)&&
a.updateMacro();d.setVariable(a.family,b)};l.prototype.update=function(){a=this;a.primitives=[];a.evaluator.eval(a.drawif)&&(a.family||a.updateMacro());a.family&&a.buildFamilyPrimitives()};l.prototype.updateMacro=function(){a=this;a.updateTransformation();if(a.inipos){var b=a.evaluator.eval(a.inipos)[0];a.iniPosX=b[0];a.iniPosY=b[1]}b=$jscomp.makeIterator(a.graphics);for(var c=b.next();!c.done;c=b.next())c=c.value,c.macro_inirotEuler=a.inirotEuler,c.macro_inirotM=a.inirotM,c.macro_inirotM_X=a.inirotM_X,
c.macro_inirotM_Y=a.inirotM_Y,c.macro_inirotM_Z=a.inirotM_Z,c.macro_iniposM=a.iniposM,c.macro_endrotEuler=a.endrotEuler,c.macro_endrotM=a.endrotM,c.macro_endrotM_X=a.endrotM_X,c.macro_endrotM_Y=a.endrotM_Y,c.macro_endrotM_Z=a.endrotM_Z,c.macro_endposM=a.endposM,c.update();b=0;for(c=a.graphics.length;b<c;b++){var d=a.graphics[b];if(d.split||a.split)for(var f=b+1;f<c;f++){var e=a.graphics[f];(e.split||a.split)&&d.splitFace(e)}a.primitives=a.primitives.concat(d.primitives||[])}};l.prototype.updateTransformation=
function(){a=this;p=a.evaluator.eval(a.inirot)[0];a.inirotEuler?(a.inirotM.setIdentity(),a.inirotM=a.inirotM.rotateZ(c(p[0])),a.inirotM=a.inirotM.rotateX(c(p[1])),a.inirotM=a.inirotM.rotateZ(c(p[2]))):(h.setIdentity(),h.rotateX(c(p[0]),a.inirotM_X),h.rotateY(c(p[1]),a.inirotM_Y),h.rotateZ(c(p[2]),a.inirotM_Z));p=a.evaluator.eval(a.inipos)[0];a.iniposM=a.iniposM.setIdentity().translate({x:p[0],y:p[1],z:p[2]});p=a.evaluator.eval(a.endrot)[0];a.endrotEuler?(a.endrotM.setIdentity(),a.endrotM=a.endrotM.rotateZ(c(p[0])),
a.endrotM=a.endrotM.rotateX(c(p[1])),a.endrotM=a.endrotM.rotateZ(c(p[2]))):(h.setIdentity(),h.rotateX(c(p[0]),a.endrotM_X),h.rotateY(c(p[1]),a.endrotM_Y),h.rotateZ(c(p[2]),a.endrotM_Z));p=a.evaluator.eval(a.endpos)[0];a.endposM=a.endposM.setIdentity().translate({x:p[0],y:p[1],z:p[2]})};l.prototype.drawAux=function(a){};b.Macro3D=l;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d=Math.PI,h=2*d,p=Math.sqrt(3),c=Math.sin,f=Math.cos,l,n,m,g,q,e,r,x,y,u,v,A,w=function(c,d){a=d=b.Graphic3D.call(this,c,d)||this;a.width=a.width||c.evaluator.parser.parse("2");a.height=a.height||c.evaluator.parser.parse("2");a.length=a.length||c.evaluator.parser.parse("2");a.R=a.R||c.evaluator.parser.parse("2");a.r=a.r||c.evaluator.parser.parse("1");l=b.Vec4D;return d};$jscomp.inherits(w,b.Graphic3D);w.prototype.buildPrimitives=function(){a=this;
n=a.evaluator;a.updateMVMatrix();a.buildGeometry(n.eval(a.width),n.eval(a.height),n.eval(a.length),n.eval(a.Nu),n.eval(a.Nv));for(var c=a.color.getColor(),d=a.backcolor.getColor(),g=a.edges?a.edges.getColor():"",e=$jscomp.makeIterator(a.faces),f=e.next();!f.done;f=e.next()){f=f.value;m=[];f=$jscomp.makeIterator(f);for(var l=f.next();!l.done;l=f.next())m.push(a.transformVertex(a.V[l.value]));a.primitives.push(new b.Primitive3D({V:m,type:"face",frontColor:c,backColor:d,edges:g,model:a.model},a.space))}};
w.prototype.changeGeometry=function(a,b,c,d,g){return this.oldW===a&&this.oldH===b&&this.oldL===c&&this.oldNu===d&&this.oldNv===g};w.prototype.updateValues=function(a,b,c,d,g){this.oldW=a;this.oldH=b;this.oldL=c;this.oldNv=g;this.oldNu=d};var z=function(a,b){a=w.call(this,a,b)||this;a.faces=[[2,3,1,0],[1,5,4,0],[5,7,6,4],[6,7,3,2],[4,6,2,0],[3,7,5,1]];return a};$jscomp.inherits(z,w);z.prototype.buildGeometry=function(a,b,c,d,g){a/=2;b/=2;c/=2;this.changeGeometry(a,b,c,d,g)||(this.V=[new l(a,c,b),
new l(a,-c,b),new l(a,c,-b),new l(a,-c,-b),new l(-a,c,b),new l(-a,-c,b),new l(-a,c,-b),new l(-a,-c,-b)],this.updateValues(a,b,c,d,g))};var B=function(a,b){return z.call(this,a,b)||this};$jscomp.inherits(B,z);B.prototype.buildGeometry=function(a,b,c,d,g){b=a/p;z.prototype.buildGeometry.call(this,b,b,b,d,g)};var D=function(a,b){a=w.call(this,a,b)||this;a.faces=[[1,3,2],[0,1,2],[0,2,3],[0,3,1]];return a};$jscomp.inherits(D,w);D.prototype.buildGeometry=function(a,b,c,d,g){a/=2;if(!this.changeGeometry(a,
b,c,d,g)){var e=h/3,f=Math.cos(e),m=Math.sin(e);e=2*a*Math.sqrt(2)/3;var q=-a/3,p=e*f+0*m;f=-e*m+0*f;this.V=[new l(0,0,a),new l(p,f,q),new l(p,-f,q),new l(e,0,q)];this.updateValues(a,b,c,d,g)}};var I=function(a,b){a=w.call(this,a,b)||this;a.faces=[[3,1,0],[2,3,0],[1,4,0],[4,2,0],[1,3,5],[3,2,5],[4,1,5],[2,4,5]];return a};$jscomp.inherits(I,w);I.prototype.buildGeometry=function(a,b,c,d,g){a/=2;this.changeGeometry(a,b,c,d,g)||(this.V=[new l(0,0,a),new l(a,0,0),new l(-a,0,0),new l(0,a,0),new l(0,-a,
0),new l(0,0,-a)],this.updateValues(a,b,c,d,g))};var H=function(a,b){return w.call(this,a,b)||this};$jscomp.inherits(H,w);H.prototype.buildGeometry=function(a,b,e,m,p){a/=2;b/=2;e/=2;if(!this.changeGeometry(a,b,e,m,p)){this.V=[new l(0,0,b)];for(var r=1;r<m;r++){q=r*d/m;for(var n=0;n<p;n++)g=n*h/p,this.V.push(new l(a*c(q)*f(g),e*c(q)*c(g),b*f(q)))}this.V.push(new l(0,0,-b));this.faces=[];for(r=0;r<p;r++)this.faces.push([0,(r+1)%p+1,r%p+1]);for(r=1;r<m-1;r++)for(n=0;n<p;n++)this.faces.push([n+1+(r-
1)*p,(n+1)%p+1+(r-1)*p,(n+1)%p+1+r*p,n+1+r*p]);for(r=0;r<p;r++)this.faces.push([this.V.length-1,this.V.length-1-p+r,this.V.length-1-p+(r+1)%p]);this.updateValues(a,b,e,m,p)}};var G=function(a,b){return H.call(this,a,b)||this};$jscomp.inherits(G,H);G.prototype.buildGeometry=function(a,b,c,d,g){H.prototype.buildGeometry.call(this,a,a,a,d,g)};var F=function(a,b){a=w.call(this,a,b)||this;a.faces=[[0,16,2,10,8],[12,1,17,16,0],[8,4,14,12,0],[2,16,17,3,13],[13,15,6,10,2],[6,18,4,8,10],[3,17,1,9,11],[13,
3,11,7,15],[1,12,14,5,9],[11,9,5,19,7],[5,14,4,18,19],[6,15,7,19,18]];return a};$jscomp.inherits(F,w);F.prototype.buildGeometry=function(a,c,g,e,f){a/=Math.PI;if(!this.changeGeometry(a,c,g,e,f)){x=a/1.6180339887;y=1.6180339887*a;this.V=[new l(a,a,a),new l(a,a,-a),new l(a,-a,a),new l(a,-a,-a),new l(-a,a,a),new l(-a,a,-a),new l(-a,-a,a),new l(-a,-a,-a),new l(0,x,y),new l(0,x,-y),new l(0,-x,y),new l(0,-x,-y),new l(x,y,0),new l(x,-y,0),new l(-x,y,0),new l(-x,-y,0),new l(y,0,x),new l(y,0,-x),new l(-y,
0,x),new l(-y,0,-x)];u=(new b.Mat4).setIdentity().rotateY(-d/6);for(var m=0,h=this.V.length;m<h;m++)this.V[m]=u.mulV4(this.V[m]);this.updateValues(a,c,g,e,f)}};var C=function(a,b){a=w.call(this,a,b)||this;a.faces=[[10,0,2],[0,8,2],[8,5,2],[5,7,2],[7,10,2],[6,0,10],[11,6,10],[7,11,10],[7,3,11],[5,3,7],[9,3,5],[8,9,5],[4,9,8],[0,4,8],[6,4,0],[11,3,1],[6,11,1],[4,6,1],[9,4,1],[3,9,1]];return a};$jscomp.inherits(C,w);C.prototype.buildGeometry=function(a,c,d,g,e){a/=3.8;if(!this.changeGeometry(a,c,d,g,
e)){y=1.6180339887*a;this.V=[new l(0,a,y),new l(0,a,-y),new l(0,-a,y),new l(0,-a,-y),new l(a,y,0),new l(a,-y,0),new l(-a,y,0),new l(-a,-y,0),new l(y,0,a),new l(y,0,-a),new l(-y,0,a),new l(-y,0,-a)];u=(new b.Mat4).setIdentity().rotateY(-1.0285);for(var f=0,m=this.V.length;f<m;f++)this.V[f]=u.mulV4(this.V[f]);this.updateValues(a,c,d,g,e)}};var J=function(a,b){return w.call(this,a,b)||this};$jscomp.inherits(J,w);J.prototype.buildGeometry=function(a,b,d,g,e){a/=2;b/=2;d/=2;if(!this.changeGeometry(a,b,
d,g,e)){this.V=[];for(var m=0;m<e;m++)for(var q=0;q<g;q++)this.V.push(new l(a*(e-m)/e*f(q*h/g),d*(e-m)/e*c(q*h/g),b-2*m*b/e));this.V.push(new l(0,0,-b));this.faces=[];for(m=0;m<e-1;m++)for(q=0;q<g;q++)this.faces.push([q+m*g,(q+1)%g+m*g,(q+1)%g+(m+1)*g,q+(m+1)*g]);for(m=0;m<g;m++)this.faces.push([this.V.length-1,this.V.length-1-g+m,this.V.length-1-g+(m+1)%g]);this.updateValues(a,b,d,g,e)}};var Q=function(a,b){return w.call(this,a,b)||this};$jscomp.inherits(Q,w);Q.prototype.buildGeometry=function(a,
b,d,g,e){a/=2;b/=2;d/=2;if(!this.changeGeometry(a,b,d,g,e)){this.V=[];for(var m=0;m<e+1;m++)for(var q=0;q<g;q++)this.V.push(new l(a*f(q*h/g),d*c(q*h/g),b-2*m*b/e));this.faces=[];for(m=0;m<e;m++)for(q=0;q<g;q++)this.faces.push([q+m*g,(q+1)%g+m*g,(q+1)%g+(m+1)*g,q+(m+1)*g]);this.updateValues(a,b,d,g,e)}};var R=function(a,b){return w.call(this,a,b)||this};$jscomp.inherits(R,w);R.prototype.buildGeometry=function(a,b,d,g,m){a/=2;b/=2;d/=2;e=n.eval(this.R);r=n.eval(this.r);if(!this.changeGeometry(a,b,d,
g,m)){this.V=[];for(var q=0;q<m+1;q++)for(var p=0;p<g;p++)this.V.push(new l(-(e+r*c(h*p/g))*c(h*q/m),(e+r*c(h*p/g))*f(h*q/m),r*f(h*p/g)));this.faces=[];for(q=0;q<m;q++)for(p=0;p<g;p++)this.faces.push([p+q*g,p+(q+1)*g,(p+1)%g+(q+1)*g,(p+1)%g+q*g]);this.updateValues(a,b,d,g,m)}};var O=function(c,d){c=w.call(this,c,d)||this;a.fileData=b.openFile(a.evaluator.eval(a.file)).split(/\r/);return c};$jscomp.inherits(O,w);O.prototype.buildGeometry=function(){this.V=[];this.faces=[];for(var a=0,b=this.fileData.length;a<
b;a++)v=this.fileData[a],v.startsWith("V")?(A=v.slice(2,-1).split(",").map(parseFloat),this.V.push(new l(A[0]||0,A[1]||0,A[2]||0))):v.startsWith("F")&&(A=v.slice(2,-1).split(",").map(parseInt),this.faces.push(A.reverse()))};b.OtherGeometry3D=w;b.Cube3D=B;b.Box3D=z;b.Tetrahedron3D=D;b.Octahedron3D=I;b.Sphere3D=G;b.Ellipsoid3D=H;b.Dodecahedron3D=F;b.Icosahedron3D=C;b.Cone3D=J;b.Cylinder3D=Q;b.Torus3D=R;b.Mesh3D=O;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=Math.max,d=Math.min,h=Math.PI,p=Math.cos,c=Math.sin,f=Math.abs,l=Math.round,n,m,g,q,e,r,x,y,u,v,A,w,z,B,D,I,H,G,F=function(a,b){this.x=void 0===a?0:a;this.y=void 0===b?0:b};F.prototype.set=function(a,b){this.x=void 0===a?0:a;this.y=void 0===b?0:b;return this};F.prototype.copy=function(){return new F(this.x,this.y)};F.prototype.ix=function(){return l(a(d(this.x,32E3),-32E3))};F.prototype.iy=function(){return l(a(d(this.y,32E3),-32E3))};F.prototype.equals=
function(a){return this.x===a.x&&this.y===a.y};F.prototype.norm2=function(){return this.x*this.x+this.y*this.y};F.prototype.norm=function(){return Math.sqrt(this.norm2())};F.prototype.distance=function(a){m=this.copy();m.sub(a);return m.norm()};F.prototype.dot=function(a){return this.x*a.x+this.y*a.y};F.prototype.det=function(a){return this.x*a.y-this.y*a.x};F.prototype.mul=function(a){this.x*=a;this.y*=a};F.prototype.div=function(a){this.x/=a;this.y/=a};F.prototype.add=function(a){this.x+=a.x;this.y+=
a.y};F.prototype.sub=function(a){this.x-=a.x;this.y-=a.y};F.prototype.normalize=function(){n=this.norm();0!=n&&this.div(n)};F.prototype.rotR90=function(){n=this.x;this.x=this.y;this.y=-n};F.prototype.rotL90=function(){n=this.x;this.x=-this.y;this.y=n};F.prototype.rot=function(a){g=this.copy();r=p(a);x=c(a);this.x=g.x*r-g.y*x;this.y=g.x*x+g.y*r};F.prototype.rot2=function(a){this.rot(a*h/180)};F.prototype.intersection=function(b,c,g,m){y=c.x-b.x;u=g.x-m.x;v=g.x-b.x;A=c.y-b.y;w=g.y-m.y;z=g.y-b.y;G=y*
w-u*A;return 1E-6<f(G)?(q=(v*w-z*u)/G,e=(-v*A+z*y)/G,0<=q&&1>=q&&0<=e&&1>=e?new F(b.x+y*q,b.y+A*q):null):(c.x-g.x)*z!=(c.y-g.y)*v?null:b.x!=c.x?(B=d(b.x,c.x),D=a(b.x,c.x),B<=g.x&&g.x<=D?g:B<=m.x&&m.x<=D?m:null):g.x!=m.x?(I=d(g.x,m.x),H=a(g.x,m.x),I<=b.x&&b.x<=H?b:I<=c.x&&c.x<=H?c:null):b.y!=c.y?(B=d(b.y,c.y),D=a(b.y,c.y),B<=g.y&&g.y<=D?g:B<=m.y&&m.y<=D?m:null):g.y!=m.y?(I=d(g.y,m.y),H=a(g.y,m.y),I<=b.y&&b.y<=H?b:I<=c.y&&c.y<=H?c:null):b.x==g.x&&b.y==g.y?b:null};b.R2=F;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l,n,m,g=function(a,d){this.evaluator=a;this.constraint=d;/==|<|>|<=|>=/.test(this.constraint.value)&&(/</.test(this.constraint.value)?this.sign="<":/>/.test(this.constraint.value)?this.sign=">":this.sign="=",this.constraint=this.constraint.equalToMinus(),this.constraint=this.constraint.childs[0]);f=new b.R2(0,0);c=new b.R2(0,0);m=new b.R2(0,0)};g.prototype.getUnitNormal=function(){this.normal.normalize();return m.set(this.normal.x,this.normal.y)};
g.prototype.gradient=function(b){a=this.evaluator;f.x=0;f.y=0;l=a.getVariable("x");n=a.getVariable("y");a.setVariable("x",b.x);a.setVariable("y",b.y);this.f0=a.eval(this.constraint);a.setVariable("x",a.getVariable("x")+1E-6);d=a.eval(this.constraint);f.x=(d-this.f0)/1E-6;f.x=isNaN(f.x)?Infinity:f.x;a.setVariable("x",a.getVariable("x")-1E-6);a.setVariable("y",a.getVariable("y")+1E-6);d=a.eval(this.constraint);f.y=(d-this.f0)/1E-6;f.y=isNaN(f.y)?Infinity:f.y;a.setVariable("x",l);a.setVariable("y",n);
return f};g.prototype.findZero=function(b,d,g){a=this.evaluator;c.x=b.x;c.y=b.y;l=a.getVariable("x");n=a.getVariable("y");a.setVariable("x",b.x);a.setVariable("y",b.y);this.f0=a.eval(this.constraint);if("<"==this.sign&&0>=this.f0||">"==this.sign&&0<=this.f0)return c;a.setVariable("x",l);a.setVariable("y",n);for(var e=0;16>e;e++)if(h=c.x,p=c.y,this.normal=this.gradient(c),0!=this.normal.norm2()&&this.normal.mul(-this.f0/this.normal.norm2()),c.x=h+this.normal.x,c.y=p+this.normal.y,this.normal.norm()<
d)return 0===this.normal.x&&0===this.normal.y&&(this.normal.x=c.x-b.x,this.normal.y=c.y-b.y),c;return g?c:null};b.R2Newton=g;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=function(a,b){this.x=a;this.y=b};a.prototype.vLength=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};a.prototype.dotProduct=function(a){return this.x*a.x+this.y*a.y};a.prototype.angleBetweenVectors=function(a){return Math.acos(this.dotProduct(a)/(this.vLength()*a.vLength()))};a.AXIS_X=new a(1,0);a.AXIS_Y=new a(0,1);b.Vector2D=a;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d=Math.floor,h=Math.round,p,c,f,l,n,m,g,q,e,r,x,y,u,v=function(c,d){a=this;a.parent=c;a.evaluator=c.evaluator;var g=a.parser=c.evaluator.parser;a.id="GraphicControl"!==d.type?"C":"G";a.region="south";a.x=a.y=0;a.w="Video"!==d.type?100:350;a.h="Video"!==d.type?23:120;a.keyboard=!1;a.kblayout="1x16";"GraphicControl"!==d.type&&"Audio"!==d.type&&"Video"!==d.type?"TextArea"!==d.type?a.expresion=g.parse("(0,0,100,23)"):(a.expresion=g.parse("(0,0,300,200)"),
a.w=300,a.h=200):a.expresion=g.parse("(0,0)");a.fixed=a.visible=!0;a.color=new b.Color("Scrollbar"==d.gui?"e0e4e8":"222222");a.colorInt="cc0022";"Scrollbar"==d.gui?a.colorInt="182C61":"GraphicControl"!==d.type&&(a.colorInt="f0f8ff");a.colorInt=new b.Color(a.colorInt);a.font_size=g.parse("0");a.type=a.gui=a.bold=a.italics=a.underlined=a.action=a.param=a.tooltip=a.Explanation=a.msg_pos=a.cID="";a.paramFont=a.tooltipFont=a.ExplanationFont="Monospace 12px";a.drawif=a.activeif=g.parse("1");a.valueExpr=
g.parse("0");a.decimals=g.parse("2");a.min=g.parse("-Infinity");a.max=g.parse("Infinity");a.incr=g.parse("0.1");a.discrete=a.exponentialif=!1;a.zIndex=-1;Object.assign(a,d);/Video|Audio/.test(a.type)&&(a.region="interior");void 0==a.name&&(a.name=2==a.parent.version?a.id:"_nada_");a.name=/_\._|_nada_|_void_/.test(a.name)?"":a.name;d=a.evaluator.eval(a.expresion)[0];a.x=h(d[0]);a.y=h(d[1]);4==d.length&&(a.w=h(d[2]),a.h=h(d[3]));a.actionExec=c.lessonParser.parseAction(a)};v.prototype.init=function(){};
v.prototype.update=function(){};v.prototype.draw=function(){};v.prototype.getContainer=function(){a=this;var b=a.parent.spaces;if("interior"===a.region)for(var c=$jscomp.makeIterator(b),d=c.next();!d.done;d=c.next()){if(d=d.value,d.id===a.spaceID)return d.addCtr(a),a.zIndex=d.zIndex,a.space=d,d.numCtrContainer}else{if("external"===a.region)return a.parent.externalSpace.addCtr(a),a.parent.externalSpace.container;if("scenario"===a.region)return a.cID?(a.expresion=a.evaluator.parser.parse("(0,-1000,"+
a.w+","+a.h+")"),a.parent.stage.stageSpace.addCtr(a),a.zIndex=a.parent.stage.stageSpace.zIndex,a.parent.stage.stageSpace.numCtrContainer):a.parent.externalSpace.container;if(/north|south|east|west/.test(a.region))return a.parent[a.region+"Space"].controls.push(a),a.parent[a.region+"Space"].container}b[0].addCtr(a);a.zIndex=b[0].zIndex;return b[0].numCtrContainer};v.prototype.addControlContainer=function(a){this.getContainer().appendChild(a)};v.prototype.updatePositionAndSize=function(){a=this;f=l=
n=m=!1;g=a.evaluator.eval(a.expresion)[0];q=h(g[0]);f=h(a.x)!==q;a.x=q;q=h(g[1]);l=h(a.y)!==q;a.y=q;4===g.length&&(q=h(g[2]),n=h(a.w)!==q,a.w=q,q=h(g[3]),m=h(a.h)!==q,a.h=q);if(n||m||f||l)a.init(!0,!0),a.draw()};v.prototype.formatValue=function(b){a=this;u=a.parent;e=b+"";r=a.evaluator.eval(a.decimals);x=e.indexOf(".");-1!=x&&(y=e.substring(x+1),y.length>r&&(e=parseFloat(e).toFixed(r)));a.fixed&&(2!==u.version||2===u.version&&!a.exponentialif)&&(e=parseFloat(b).toFixed(r));a.exponentialif&&0!=parseFloat(e)&&
(e=a.fixed&&2!==u.version?parseFloat(e).toExponential(r):parseFloat(e).toExponential(),e=e.toUpperCase().replace("+",""));return e.replace(".",u.decimal_symbol)};v.prototype.updateAndExecAction=function(){u=this.parent;u.updateControls();"init"===this.action&&(this.click=!1);this.actionExec.execute();u.updateControls();"animate"!==this.action&&u.update();u.updateControls()};v.prototype.createGradient=function(a,b){this.linearGradient=this.ctx.createLinearGradient(0,0,0,b);p=b*b;for(a=0;a<b;a++)c=
d(a-35*b*.01),this.linearGradient.addColorStop(a/b,"rgba(0,0,0,"+c*c*192/p/255+")")};b.Control=v;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d=/[\w\.\-//]*(\.gif)/gi,h=/CanvasGradient|CanvasPattern/,p=Math.floor,c=Math.abs,f,l,n,m,g,q,e,r,x,y,u,v,A,w,z,B,D,I,H,G,F,C,J,Q,R,O,M,P,E,L,K,N,V,Z,X,U,S=function(c,d){var g;a=g=b.Control.call(this,c,d)||this;a.imageSrc=d.imageSrc||"";a.image=d.image||new Image;a.imageOver=d.imageOver||new Image;a.imageDown=d.imageDown||new Image;a.flat=d.flat||!1;a.borderColor=d.borderColor||!1;a.text_align=d.text_align||"center_center";a.image_align=d.image_align||
"center_center";a.font_family=b.getFontName(d.font_family||"arial");a.ratio=c.ratio;-1===a.font_size&&(a.noFSize=!0);a.borderColor&&(a.borderColor=new b.Color(a.borderColor));a.text_align=a.text_align.split("_");a.image_align=a.image_align.split("_");a.oName=a.name;/^\[.*\]$/.test(a.name)?a.name=a.parser.parse(a.name.slice(1,-1)):a.name=a.parser.parse("'"+a.name+"'");a.classContainer=a.cssClass?" "+a.cssClass+" ":"";a.extra_style=a.extra_style||"";/^_STYLE_/.test(a.imageSrc.trim())&&(a.imageSrc="vacio.gif",
a.extra_style=a.imageSrc.trim().substring(8));if(a.extra_style){a.customStyle=!0;a.btnStyle=[];a.conStyle=[];a.conStyle.textBorder=3;var e;c=$jscomp.makeIterator(a.extra_style.split("|"));for(d=c.next();!d.done;d=c.next()){d=(e=d.value.trim().match(/(.*)=(.*)/))?e[1].trim():"";e=e?e[2].trim():"";var m=e.match(/rgb/g)?"":"#";"class"===d?a.classContainer=" "+e:"border"===d?(a.btnStyle.push({type:"border-style",value:"solid"}),a.btnStyle.push({type:"border-width",value:e+"px"})):"borderRadius"===d?(a.btnStyle.push({type:"border-radius",
value:e+"px"}),a.conStyle.push({type:"border-radius",value:e+"px"})):"borderColor"===d?a.btnStyle.push({type:"border-color",value:m+e}):/^(overColor|downColor|inactiveColor|inactiveColorBorder|shadowTextColor|shadowBoxColor|shadowInsetBoxColor)$/.test(d)?a.conStyle[d]=m+e:"font"===d?a.conStyle[d]=e.toLowerCase():/^(shadowTextBlur|shadowTextOffsetX|shadowTextOffsetY|shadowBoxBlur|shadowBoxOffsetX|shadowBoxOffsetY|shadowInsetBoxBlur|shadowInsetBoxOffsetX|shadowInsetBoxOffsetY|textBorder|imgSizeW|imgSizeH)$/.test(d)?
a.conStyle[d]=parseFloat(e)||0:"flat"===d&&(a[d]=1==parseInt(e))}}a.imageSrc.startsWith("_COLORES_")&&(c=a.imageSrc.split("_"),a.colorInt=new b.Color(c[2]),a.color=new b.Color(c[3]),a.font_size=a.parser.parse(c[5]),a.imageSrc="");/^\[.*\]$/.test(a.imageSrc)?a.imageSrc=a.parser.parse(a.imageSrc.slice(1,-1)):a.imageSrc=a.parser.parse("'"+a.imageSrc+"'");c=a.evaluator.eval(a.imageSrc).toString().trim();if(""!=c)if(L=c.substr(0,c.lastIndexOf(".")),K=c.substr(c.lastIndexOf(".")),c.match(/vacio.gif$/i))g.imageSrc=
g.parser.parse("'vacio.gif'"),g.image.ready=1,3===g.parent.version&&(g.name=g.parser.parse("")),g.emptyImage={ready:!0},g.parser.parse("'vacio.gif'");else if(g.image=g.parent.getImage(c),L)try{g.imageOver=g.parent.getImage(L+"_over"+K),g.imageDown=g.parent.getImage(L+"_down"+K)}catch(da){}a.container=b.newHTML("div",{class:"DescartesButtonContainer"+a.classContainer,id:a.id,style:"width:"+a.w+"px;height:"+a.h+"px;left:"+a.x+"px;top:"+a.y+"px;z-index:"+a.zIndex+";"});a.btn=b.newHTML("canvas",{width:a.w*
a.ratio,height:a.h*a.ratio,style:"position:absolute;left:0;top:0;width:"+a.w+"px;height:"+a.h+"px;"});a.ctx=a.btn.getContext("2d");a.ctx.imageSmoothingEnabled=!1;a.tooltip&&(a.btn.title=a.tooltip);a.container.appendChild(a.btn);a.addControlContainer(a.container);a.addEvents();a.init();return g};$jscomp.inherits(S,b.Control);S.prototype.init=function(c){a=this;f=a.evaluator;G=a.container;l=a.btn;n=a.ctx;m=f.eval(a.expresion)[0];a.x=m[0];a.y=m[1];4==m.length&&(a.w=parseInt(m[2]),a.h=parseInt(m[3]));
l.width=a.w*a.ratio;l.height=a.h*a.ratio;l.setAttribute("style","position:absolute;left:0;top:0;width:"+a.w+"px;height:"+a.h+"px;box-sizing:border-box;");G.setAttribute("style","width:"+a.w+"px;height:"+a.h+"px;left:"+a.x+"px;top:"+a.y+"px;z-index:"+a.zIndex+";display:block;");if(a.btnStyle)for(var d=$jscomp.makeIterator(a.btnStyle),g=d.next();!g.done;g=d.next())g=g.value,l.style[g.type]=g.value;if(a.conStyle){d=$jscomp.makeIterator(a.conStyle);for(g=d.next();!g.done;g=d.next())g=g.value,G.style[g.type]=
g.value;a.conStyle.shadowBoxColor&&(G.style.boxShadow=(a.conStyle.shadowBoxOffsetX||0)+"px "+(a.conStyle.shadowBoxOffsetY||2)+"px "+(a.conStyle.shadowBoxBlur||2)+"px 1px "+a.conStyle.shadowBoxColor);a.conStyle.shadowInsetBoxColor&&(l.style.boxShadow=(a.conStyle.shadowInsetBoxOffsetX||0)+"px "+(a.conStyle.shadowInsetBoxOffsetY||-2)+"px "+(a.conStyle.shadowInsetBoxBlur||1)+"px 1px "+a.conStyle.shadowInsetBoxColor+" inset")}a.noFSize&&(a.font_size=f.parser.parse(b.getFieldFontSize(this.h)+""));a.fs_evaluated=
f.eval(a.font_size);a.createGradient(a.w,a.h);G.style.display=0<f.eval(a.drawif)?"block":"none";n.lineJoin="round";n.font=a.italics+" "+a.bold+" "+a.fs_evaluated+"px "+a.font_family;a.text_object=new b.TextObject({parent:{decimal_symbol:a.parent.decimal_symbol},evaluator:f,decimals:a.decimals,fixed:!1,align:"left",anchor:"center_center",width:a.parser.parse("0"),font_size:a.font_size,font_family:a.font_family,italics:a.italics,bold:a.bold,border:a.borderColor,border_size:a.conStyle?a.conStyle.textBorder:
void 0,shadowBlur:a.conStyle&&a.conStyle.shadowTextColor?a.conStyle.shadowTextBlur||1:void 0,shadowOffsetX:a.conStyle&&a.conStyle.shadowTextColor?a.conStyle.shadowTextOffsetX||0:void 0,shadowOffsetY:a.conStyle&&a.conStyle.shadowTextColor?a.conStyle.shadowTextOffsetY||2:void 0,shadowColor:a.conStyle&&a.conStyle.shadowTextColor?a.conStyle.shadowTextColor:void 0},a.oName);a.draw(c)};S.prototype.update=function(){a=this;f=a.evaluator;G=a.container;a.activeIfVal=0<f.eval(a.activeif);a.drawIfVal=0<f.eval(a.drawif);
(a.space?a.space.drawIfVal:1)&&a.drawIfVal?(G.style.display="block",a.draw(),G.style.cursor=a.btn.style.cursor=a.activeIfVal?"pointer":"not-allowed",G.setAttribute("active",a.activeIfVal),a.updatePositionAndSize()):(G.style.display="none",a.buttonClick=!1)};S.prototype.draw=function(c){a=this;G=a.container;f=a.evaluator;l=a.btn;n=a.ctx;q=f.eval(a.name);a.text_object.draw(b.ctx,"#000000",0,0);q=a.text_object.textNodes.toStr();e=a.evaluator.eval(a.imageSrc).toString().trim();if(!c&&(F=a.over===a.oldOver,
C=a.buttonClick===a.oldButtonClick,J=a.activeIfVal===a.oldActiveIfValue,Q=a.drawIfVal===a.oldDrawIfValue,R=q===a.oldName,O=e===a.oldImageSrc,M=a.colorInt.getColor()===a.oldBackColor,P=a.color.getColor()===a.oldTextColor,E=a.image.ready===a.oldImageReady,a.oldOver=a.over,a.oldButtonClick=a.buttonClick,a.oldActiveIfValue=a.activeIfVal,a.oldDrawIfValue=a.drawIfVal,a.oldName=q,a.oldImageSrc=e,a.oldBackColor=a.colorInt.getColor(),a.oldTextColor=a.color.getColor(),a.oldImageReady=a.image.ready,F&&C&&J&&
Q&&R&&O&&M&&P&&E))return;n.save();n.setTransform(a.ratio,0,0,a.ratio,0,0);g=a.fs_evaluated;G.setAttribute("data-name",q);e?(r="vacio.gif"===e?this.emptyImage:this.parent.getImage(e),L=e.substr(0,e.lastIndexOf(".")),K=e.substr(e.lastIndexOf(".")),N=L+"_over"+K,V=L+"_down"+K,Z="vacio.gif"===e?this.emptyImage:this.parent.getImage(N),X="vacio.gif"===e?this.emptyImage:this.parent.getImage(V)):r=Z=X=a.emptyImg;n.clearRect(0,0,a.w,a.h);y=u=a.buttonClick?1:0;a.text_object.draw(n,a.color.getColor(),0,0,!0);
v=a.text_object.textNodes.metrics.w;A=a.text_object.textNodes.metrics.h;"center"==a.text_align[1]?I=p(a.w/2+y)-.5:"left"==a.text_align[1]?I=v/2+5+y:"right"==a.text_align[1]&&(I=a.w-v/2+y-5);"center"==a.text_align[0]?H=p(a.h/2+u)-.5:"top"==a.text_align[0]?H=A/2+u+4:"bottom"==a.text_align[0]&&(H=a.h-A/2+u-3);if(r){if(w=a.imgSizeW||r.width,z=a.imgSizeH||r.height,"center"==a.image_align[1]?B=parseInt((a.w-w)/2)+y:"left"==a.image_align[1]?B=y:"right"==a.image_align[1]&&(B=a.w-w+y),"center"==a.image_align[0]?
D=parseInt((a.h-z)/2)+u:"top"==a.image_align[0]?D=u:"bottom"==a.image_align[0]&&(D=a.h-z+u),r&&r.ready)if(r!==a.emptyImg&&r.complete)if(e.match(d))l.style.backgroundRepeat="no-repeat",l.style.backgroundImage="url('"+e+"')",l.style.backgroundPosition=B+"px "+D+"px";else{if("center"!=a.image_align[0]||"center"!=a.image_align[1])(U=a.colorInt.getColor())&&h.test(U.constructor.name)?(n.fillStyle=U,n.fillRect(0,0,a.w,a.h)):G.style.backgroundColor=U;n.drawImage(r,0,0,r.width,r.height,B,D,w,z)}else a.emptyImg&&
a.customStyle&&((U=a.colorInt.getColor())&&h.test(U.constructor.name)?(n.fillStyle=U,n.fillRect(0,0,a.w,a.h)):G.style.backgroundColor=U)}else(U=a.colorInt.getColor())&&h.test(U.constructor.name)?(n.fillStyle=U,n.fillRect(0,0,a.w,a.h)):(G.style.backgroundColor=U,a.flat||(a.buttonClick||(a.drawLine(n,a.w-1,0,a.w-1,a.h,"rgba(0,0,0,0.5)"),a.drawLine(n,0,0,0,a.h,"rgba(0,0,0,0.09)"),a.drawLine(n,1,0,1,a.h,"rgba(0,0,0,0.03)")),n.fillStyle=a.linearGradient,n.fillRect(0,0,a.w,a.h)));a.activeIfVal&&(Z!==a.emptyImg&&
a.over&&Z.ready&&Z.complete?N.match(d)?(l.style.backgroundImage="url('"+N+"')",l.style.backgroundPosition=B+"px "+D+"px"):n.drawImage(Z,B,D):a.customStyle&&a.conStyle.overColor&&a.over&&(G.style.backgroundColor=a.conStyle.overColor));a.activeIfVal?X!==a.emptyImg&&a.buttonClick&&X.ready&&X.complete?V.match(d)?(l.style.backgroundImage="url('"+V+"')",l.style.backgroundPosition=B+"px "+D+"px"):n.drawImage(X,B,D):a.customStyle&&a.conStyle.downColor&&a.buttonClick&&(G.style.backgroundColor=a.conStyle.downColor):
a.buttonClick&&!r&&(n.fillStyle="rgba(0,0,0,0.09)",n.fillRect(0,0,a.w,a.h));n.fillStyle=a.color.getColor();a.customStyle&&a.conStyle.shadowTextColor&&0<a.conStyle.textBorder&&(n.lineWidth=a.conStyle.textBorder,n.strokeStyle=a.conStyle.shadowTextColor);a.borderColor&&(n.lineWidth=parseInt(g/6),n.strokeStyle=a.borderColor.getColor());a.text_object.draw(n,a.color.getColor(),I,H);a.underlined&&(n.strokeStyle=a.color.getColor(),n.lineWidth=p(.1*g)||2,n.lineCap="round",n.beginPath(),n.moveTo(I-v/2+y,H+
p(g/2)+p(g/5)-1.5),n.lineTo(I+v/2+y,H+p(g/2)+p(g/5)-1.5),n.stroke());a.activeIfVal||(a.customStyle&&a.conStyle.inactiveColor?G.style.backgroundColor=a.conStyle.inactiveColor:(n.fillStyle="rgba(240,240,240,0.6)",n.fillRect(0,0,a.w,a.h)));n.restore();a._image_pos_x=B;a._image_pos_y=D};S.prototype.drawLine=function(a,b,c,d,g,e,m){a.lineWidth=void 0===m?1:m;a.strokeStyle=void 0===e?"black":e;x=a.lineWidth%2*.5;a.beginPath();a.moveTo(p(b)+x,p(c)+x);a.lineTo(p(d)+x,p(g)+x);a.stroke()};S.prototype.drawTextBorder=
function(){this.colorInt.getColor();this.color.getColor();return!(.5>(c(this.colorInt.r-this.color.r)+c(this.colorInt.g-this.color.g)+c(this.colorInt.b-this.color.b))/255)};S.prototype.addEvents=function(){function a(c,d,m){b.clearTimeout(e);g.buttonClick&&g.drawIfVal&&g.activeIfVal&&(d.call(g),c=m?c:100,e=b.setTimeout(function(){a(c,d,!1)},c))}function c(c){this.focus();c.preventDefault();c.stopPropagation();document.activeElement!=document.body&&document.activeElement.blur();g.whichBtn=b.whichBtn(c);
"L"==g.whichBtn&&g.activeIfVal&&(g.buttonClick=!0,g.draw(),"calculate"==g.action&&(g.evaluator.setVariable(g.id,g.evaluator.eval(g.valueExpr)),a(1E3,g.updateAndExecAction,!0)),g.btn.removeEventListener("touchend",d),g.btn.addEventListener("touchend",d),g.btn.removeEventListener("mouseup",d),g.btn.addEventListener("mouseup",d))}function d(a){b.newBlobContent=null;this.focus();a.preventDefault();a.stopPropagation();g.activeIfVal||g.buttonClick?(g.buttonClick=!1,g.draw(),"calculate"!=g.action&&(g.evaluator.setVariable(g.id,
g.evaluator.eval(g.valueExpr)),g.updateAndExecAction()),g.btn.removeEventListener("touchend",d),g.btn.removeEventListener("mouseup",d)):g.parent.update()}var g=this,e;this.over=this.buttonClick=!1;this.btn.addEventListener("touchstart",c);this.btn.addEventListener("mousedown",c);this.btn.addEventListener("mouseover",function(a){a.preventDefault();a.stopPropagation();g.over=!0;g.draw()});this.btn.addEventListener("mouseout",function(a){b.newBlobContent=null;a.preventDefault();a.stopPropagation();g.over=
!1;g.buttonClick=!1;g.draw()});document.addEventListener("visibilitychange",function(a){b.newBlobContent=null;g.buttonClick=!1})};b.Button=S;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l,n,m,g,q,e,r,x,y,u=function(c,d){a=d=b.Control.call(this,c,d)||this;a.flat=a.imgDecSrc&&a.imgIncSrc;a.btn_pos=a.btn_pos||"v_left";a.horizontal="h_left"===a.btn_pos||"h_right"===a.btn_pos||"h_left_right"===a.btn_pos;a.label_color=a.label_color||new b.Color("e0e4e8",c.evaluator);a.label_text_color=a.label_text_color||new b.Color("000000",c.evaluator);a.tabindex=++c.tabindex;a.name_str=a.name;a.initial_value=0;try{a.initial_value=a.evaluator.eval(a.parser.parse(a.valueexpresionStringing))}catch(w){console.log(w)}/^\[.*\]$/.test(a.name)?
a.name=a.parser.parse(a.name.slice(1,-1)):a.name=a.parser.parse("'"+a.name+"'");a.container=b.newHTML("div",{class:"DescartesSpinnerContainer",id:a.id});a.divUp=b.newHTML("div",{class:"DJS_Up"});a.divDown=b.newHTML("div",{class:"DJS_Down"});a.field=b.newHTML("input",{type:"text",id:a.id+"_spinner",class:"DescartesSpinnerField",tabindex:a.tabindex});a.label=b.newHTML("canvas",{class:"DescartesSpinnerLabel"});a.label_ctx=a.label.getContext("2d");a.ratio=c.ratio;a.container.appendChild(a.label);a.container.appendChild(a.field);
a.container.appendChild(a.divUp);a.container.appendChild(a.divDown);a.cover=b.newHTML("div",{class:"TextfieldCover"});a.keyboard&&a.visible&&a.container.appendChild(a.cover);a.addControlContainer(a.container);e=a.evaluator.parser.parse("1");a.originalIncr=a.incr;if(0>a.evaluator.eval(a.decimals)||0===a.evaluator.eval(a.incr))c=a.evaluator.eval(a.incr),0<c?a.originalIncr=a.incr=a.evaluator.parser.parse(parseInt(c).toString()):a.incr=e;a.imgDecSrc&&(/^\[.*\]$/.test(a.imgDecSrc)?a.imgDecSrc=a.parser.parse(a.imgDecSrc.slice(1,
-1)):a.imgDecSrc=a.parser.parse("'"+a.imgDecSrc+"'"),a.old_imgDecSrc=a.evaluator.eval(a.imgDecSrc).toString().trim(),a.image_dec=a.parent.getImage(a.old_imgDecSrc));a.imgIncSrc&&(/^\[.*\]$/.test(a.imgIncSrc)?a.imgIncSrc=a.parser.parse(a.imgIncSrc.slice(1,-1)):a.imgIncSrc=a.parser.parse("'"+a.imgIncSrc+"'"),a.old_imgIncSrc=a.evaluator.eval(a.imgIncSrc).toString().trim(),a.image_inc=a.parent.getImage(a.old_imgIncSrc));a.addEvents();a.init();return d};$jscomp.inherits(u,b.Control);u.prototype.init=function(c,
g){a=this;d=a.evaluator;a.label.innerHTML=d.eval(a.name).toString();c=a.label.textContent;g||(a.value=a.validateValue(d.eval(a.valueExpr)));g=a.formatValue(a.value);a.fieldFontSize=0<d.eval(a.font_size)?d.eval(a.font_size):b.getFieldFontSize(a.h);a.text_object=new b.TextObject({parent:{decimal_symbol:a.parent.decimal_symbol},evaluator:d,decimals:a.decimals,fixed:!1,align:"left",anchor:"center_center",width:a.parser.parse("0"),font_size:a.parser.parse(""+a.fieldFontSize),font_family:a.font_family,
italics:a.italics,bold:a.bold},a.name_str);a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),0,0,!0);var e=2!==a.parent.version?"__":"_____",m=b.getTextWidth(g+"_",a.fieldFontSize+"px "+b.sansserif_font);if(a.horizontal){var f=parseInt(a.h),l=parseInt(a.w/2-f);e=a.text_object.textNodes.metrics.w+parseInt(a.fieldFontSize);a.visible||(l=a.w-2*f,m=0);l<e&&(l=e);""==c&&(l=0);a.w-l-f<m&&(l=a.w-f-m);0>l&&(l=0);c=a.w-(l+2*f);a.container.setAttribute("style","width:"+a.w+"px;height:"+a.h+"px;left:"+
a.x+"px;top:"+a.y+"px;z-index:"+a.zIndex+";background-color:transparent;");a.divUp.setAttribute("style","width:"+f+"px;height:"+f+"px;"+("h_left"===a.btn_pos?"left:"+(l+f):"right:0")+"px;top:0;"+(a.flat?"border-width:0;":""));a.divDown.setAttribute("style","width:"+f+"px;height:"+f+"px;left:"+(l+("h_right"===a.btn_pos?c:0))+"px;top:0;"+(a.flat?"border-width:0;":""));a.field.setAttribute("style","font-family:"+b.sansserif_font+";font-size:"+a.fieldFontSize+"px;width:"+c+"px;height:"+a.h+"px;left:"+
(f+l+("h_left"===a.btn_pos?f:"h_right"===a.btn_pos?-f:0))+"px;text-align:center;");a.cover.setAttribute("style","width:"+c+"px;height:"+a.h+"px;left:"+(f+l+("h_left"===a.btn_pos?f:"h_right"===a.btn_pos?-f:0))+"px;text-align:center;");a.field.value=g;a.visible||(a.field.style.display="none");a.label.setAttribute("style","font-size:"+a.fieldFontSize+"px;width:"+l+"px;height:"+a.h+"px;line-height:"+a.h+"px;background-color:"+a.label_color.getColor()+";color:"+a.label_text_color.getColor()+";");a.label.width=
l*a.ratio}else f=2+parseInt(a.h/2),l=parseInt(a.w/2-f/2),e=b.getTextWidth(c+e,a.fieldFontSize+"px "+b.sansserif_font),a.visible||(l=a.w-f,m=0),l<e&&(l=e),""==c&&(l=0),a.w-l-f<m&&(l=a.w-f-m),0>l&&(l=0),c=a.w-(l+f),a.container.setAttribute("style","width:"+a.w+"px;height:"+a.h+"px;left:"+a.x+"px;top:"+a.y+"px;z-index:"+a.zIndex+";background-color:transparent;"),m="width:"+f+"px;left:"+(l+("v_right"===a.btn_pos?c:0))+"px;",a.divUp.setAttribute("style",m+";height:"+(a.h/2+1)+"px;top:0;"+(a.flat?"border-width:0;":
"")),a.divDown.setAttribute("style",m+";height:"+(a.h/2-1)+"px;top:"+(a.h/2+1)+"px;"+(a.flat?"border-width:0;":"")),a.field.setAttribute("style","font-family:"+b.sansserif_font+";font-size:"+a.fieldFontSize+"px;width:"+c+"px;height:"+a.h+"px;left:"+(("v_left"===a.btn_pos?f:0)+l)+"px;"),a.cover.setAttribute("style","width:"+c+"px;height:"+a.h+"px;left:"+(("v_left"===a.btn_pos?f:0)+l)+"px;"),a.field.value=g,a.visible||(a.field.style.display="none"),a.label.setAttribute("style","font-size:"+a.fieldFontSize+
"px;width:"+l+"px;height:"+a.h+"px;line-height:"+a.h+"px;background-color:"+a.label_color.getColor()+";color:"+a.label_text_color.getColor()+";"),a.label.width=l*a.ratio;a.label.height=a.h*a.ratio;a.image_dec&&a.image_dec.ready&&(a.divDown.style["background-image"]="url("+a.image_dec.src+")");a.image_inc&&a.image_inc.ready&&(a.divUp.style["background-image"]="url("+a.image_inc.src+")");a.divUp.setAttribute("horizontal",a.horizontal);a.divDown.setAttribute("horizontal",a.horizontal);d.setVariable(a.id,
a.value)};u.prototype.update=function(){a=this;d=a.evaluator;0>d.eval(a.decimals)?(h=d.eval(a.incr),0<h?a.originalIncr=a.incr=d.parser.parse(parseInt(h).toString()):a.incr=e):a.incr=0!==d.eval(a.originalIncr)?a.originalIncr:e;a.activeIfVal=0<d.eval(a.activeif);a.drawIfVal=0<d.eval(a.drawif);a.field.disabled=!a.activeIfVal;a.divUp.setAttribute("active",!a.field.disabled);a.divDown.setAttribute("active",!a.field.disabled);a.drawIfVal?(a.updateStyle(),a.container.style.display="block"):(a.click=!1,a.container.style.display=
"none");a.image_dec&&(r=a.evaluator.eval(a.imgDecSrc).toString().trim(),a.old_imgDecSrc!==r&&(a.divDown.style["background-image"]="url("+r+")",a.old_imgDecSrc=r));a.image_inc&&(x=a.evaluator.eval(a.imgIncSrc).toString().trim(),a.old_imgIncSrc!==x&&(a.divUp.style["background-image"]="url("+x+")",a.imgIncSrc=x));a.updatePositionAndSize();a.parent.animation.playing&&document.activeElement==a.field||(p=a.field.value,c=a.value,a.value=a.validateValue(d.getVariable(a.id)),a.field.value=a.formatValue(a.value),
a.value==c&&a.field.value!=p&&(a.value=a.validateValue(p),a.field.value=a.formatValue(a.value)),d.setVariable(a.id,a.value));a.label_ctx.setTransform(a.ratio,0,0,a.ratio,0,0);a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),0,0);a.label_ctx.clearRect(0,0,a.label.width,a.label.height);(y=a.label_color.getColor())&&/CanvasGradient|CanvasPattern/.test(y.constructor.name)&&(a.label_ctx.fillStyle=y,a.label_ctx.fillRect(0,0,a.label_ctx.canvas.width,a.label_ctx.canvas.height));a.text_object.textNodes.metrics.w>
a.label.width/a.ratio?(a.text_object.anchor="center_left",a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),5,a.label.height/a.ratio/2)):(a.text_object.anchor="center_center",a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),a.label.width/a.ratio/2,a.label.height/a.ratio/2));a.label_ctx.setTransform(1,0,0,1,0,0)};u.prototype.updateStyle=function(){a=this;a.divUp.style.borderStyle=a.up?"inset":"outset";a.divUp.style.borderColor=a.up?"gray":"#f0f8ff";a.divUp.style.backgroundColor=
a.up?"#bfbfbf":"";a.divUp.style.backgroundColor=a.flat?"transparent":a.divUp.style.backgroundColor;a.divUp.style.backgroundPosition=a.up?"calc(50% + 1px) calc(50% + 1px)":"center";a.divDown.style.borderStyle=a.down?"inset":"outset";a.divDown.style.borderColor=a.down?"gray":"#f0f8ff";a.divDown.style.backgroundColor=a.down?"#bfbfbf":"";a.divDown.style.backgroundColor=a.flat?"transparent":a.divDown.style.backgroundColor;a.divDown.style.backgroundPosition=a.down?"calc(50% + 1px) calc(50% + 1px)":"center"};
u.prototype.validateValue=function(a){d=this.evaluator;isNaN(parseFloat(a))||a.toString().includes("e")&&(a=parseFloat(a).toFixed(20));a=void 0!=a?a.toString():"0";a=a.replace(this.parent.decimal_symbol,".");f=a==parseFloat(a)?parseFloat(a):parseFloat(d.eval(d.parser.parse(a)));isNaN(f)&&(f=0);m=d.eval(this.min);g=d.eval(this.max);""===m&&(m=-Infinity);""===g&&(g=Infinity);f=Math.min(Math.max(f,m),g);this.discrete&&(l=d.eval(this.incr),f=0==l?0:this.initial_value+l*Math.round((f-this.initial_value)/
l));n=d.eval(this.decimals);0>=n&&(n=0);return f=parseFloat(parseFloat(f).toFixed(n))};u.prototype.increase=function(){this.changeValue(parseFloat(this.value)+this.evaluator.eval(this.incr))};u.prototype.decrease=function(){this.changeValue(parseFloat(this.value)-this.evaluator.eval(this.incr))};u.prototype.changeValue=function(a){this.activeIfVal&&(this.value=this.validateValue(a),this.field.value=this.formatValue(this.value),this.evaluator.setVariable(this.id,this.value),this.updateAndExecAction())};
u.prototype.addEvents=function(){function a(c,d,g){b.clearTimeout(l);if(f.up||f.down)d.call(f),c=g?c:10,l=b.setTimeout(function(){a(c,d)},c)}function c(c){c.preventDefault();f.whichBtn=b.whichBtn(c);"L"==f.whichBtn&&f.activeIfVal&&(f.up=!0,a(m,f.increase,!0))}function d(c){c.preventDefault();f.whichBtn=b.whichBtn(c);"L"==f.whichBtn&&f.activeIfVal&&(f.down=!0,a(m,f.decrease,!0))}function g(a){f.up=!1;b.clearTimeout(l);f.updateStyle()}function e(a){f.down=!1;b.clearTimeout(l);f.updateStyle()}q=b.hasTouchSupport;
var f=this,m=q?500:200,l;f.label.addEventListener("touchstart",b.preventDefault);f.label.addEventListener("mousedown",b.preventDefault);f.field.addEventListener("keydown",function(a){13==a.keyCode&&f.changeValue(f.field.value)});f.divUp.addEventListener("touchstart",c);f.divUp.addEventListener("mousedown",c);f.divDown.addEventListener("touchstart",d);f.divDown.addEventListener("mousedown",d);f.divUp.addEventListener("mouseout",function(a){f.up=!1;b.clearTimeout(l);a.preventDefault();f.updateStyle()});
f.divDown.addEventListener("mouseout",function(a){f.down=!1;b.clearTimeout(l);a.preventDefault();f.updateStyle()});f.divUp.addEventListener("touchend",g);window.addEventListener("touchend",g);f.divUp.addEventListener("mouseup",g);window.addEventListener("mouseup",g);f.divDown.addEventListener("touchend",e);window.addEventListener("touchend",e);f.divDown.addEventListener("mouseup",e);window.addEventListener("mouseup",e);document.addEventListener("visibilitychange",function(a){f.up=f.down=!1;b.clearTimeout(l);
f.updateStyle()});f.field.addEventListener("blur",function(a){f.drawIfVal&&f.changeValue(f.field.value,!0)});f.field.addEventListener("click",function(a){this.focus()});f.cover.addEventListener("click",function(a){a=f.evaluator.eval(f.kbexp);f.activeIfVal&&f.parent.keyboard.show(f,f.kblayout,a[0][0]||0,a[0][1]||0,f.id,f.field,f.onlyText)})};b.Spinner=u;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p=function(c,d){var f;a=f=b.Control.call(this,c,d)||this;a.label_color=a.label_color||new b.Color("e0e4e8",c.evaluator);a.label_text_color=a.label_text_color||new b.Color("000000",c.evaluator);a.typeCtr="checkbox";a.pressed=d.pressed||!1;a.radio_group=(d.radio_group||"").trim();""!==a.radio_group&&(a.typeCtr="radio");a.name_str=a.name;/^\[.*\]$/.test(a.name)?a.name=a.parser.parse(a.name.slice(1,-1)):a.name=a.parser.parse("'"+a.name.trim()+"'");
a.tabindex=++c.tabindex;a.containerControl=b.newHTML("div",{class:"DescartesCheckboxContainer",id:a.id});a.checkbox=b.newHTML("input",{type:a.typeCtr,id:a.id+a.typeCtr,class:"DescartesCheckbox",tabindex:a.tabindex});""!==a.radio_group&&a.checkbox.setAttribute("name",a.radio_group);a.checkbox.internalID=a.id;a.label=b.newHTML("canvas",{class:"DescartesCheckboxLabel"});a.label_ctx=a.label.getContext("2d");a.ratio=c.ratio;a.dummyLabel=b.newHTML("label",{"for":a.id+a.typeCtr});a.value=a.evaluator.eval(a.valueExpr);
a.evaluator.setVariable(a.id,a.value);a.containerControl.appendChild(a.label);a.containerControl.appendChild(a.checkbox);a.containerControl.appendChild(a.dummyLabel);a.addControlContainer(a.containerControl);a.addEvents();a.init();return f};$jscomp.inherits(p,b.Control);p.prototype.init=function(c){a=this;d=a.evaluator;a.label.innerHTML=d.eval(a.name).toString();a.labelFontSize=0<d.eval(a.font_size)?d.eval(a.font_size):b.getFieldFontSize(a.h);c=Math.max(a.w-a.h,0);a.text_object=new b.TextObject({parent:{decimal_symbol:a.parent.decimal_symbol},
evaluator:d,decimals:a.decimals,fixed:!1,align:"left",anchor:"center_center",width:a.parser.parse("0"),font_size:a.parser.parse(""+a.labelFontSize),font_family:a.font_family,italics:a.italics,bold:a.bold},a.name_str);a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),0,0,!0);a.containerControl.setAttribute("style","width:"+a.w+"px;height:"+a.h+"px;left:"+a.x+"px;top:"+a.y+"px;z-index:"+a.zIndex+";");"right"==a.position?(a.dummyLabel.setAttribute("style","position:absolute;width:"+a.h+"px;height:"+
a.h+"px;left:"+c+"px;"),a.checkbox.setAttribute("style","width:"+a.h+"px;height:"+a.h+"px;left:"+c+"px;"),a.label.setAttribute("style","font-size:"+a.labelFontSize+"px;width:"+c+"px;height:"+a.h+"px;line-height:"+a.h+"px;background-color:"+a.label_color.getColor()+";color:"+a.label_text_color.getColor()+";")):(a.dummyLabel.setAttribute("style","position:absolute;width:"+a.h+"px;height:"+a.h+"px;left:0;"),a.checkbox.setAttribute("style","width:"+a.h+"px;height:"+a.h+"px;left:0;"),a.label.setAttribute("style",
"font-size:"+a.labelFontSize+"px;width:"+c+"px;height:"+a.h+"px;line-height:"+a.h+"px;background-color:"+a.label_color.getColor()+";color:"+a.label_text_color.getColor()+";left:"+a.h+"px"));a.checkbox.checked=0!=d.getVariable(a.id);a.label.width=c*a.ratio;a.label.height=a.h*a.ratio;a.update()};p.prototype.update=function(){a=this;d=a.evaluator;a.activeIfVal=0<d.eval(a.activeif);a.drawIfVal=0<d.eval(a.drawif);a.checkbox.disabled=!a.activeIfVal;a.containerControl.style.display=a.drawIfVal?"block":"none";
if(!a.parent.animation.playing||document.activeElement!=a.checkbox){var b=0!==d.getVariable(a.id)?1:0;if(""===a.radio_group)a.pressed?(a.value=a.checkbox.checked?1:0,a.pressed=!1):(a.value=b,a.checkbox.checked=0!==a.value),d.setVariable(a.id,a.value);else{a.value=d.getVariable(a.id);d.setVariable(a.radio_group,0);b=document.querySelectorAll("[name="+a.radio_group+"]");var f=-1;if(a.pressed){for(f=b.length-1;0<=f;f--)d.setVariable(b[f].internalID,0),b[f].checked=!1;d.setVariable(a.id,1);a.checkbox.checked=
!0;a.value=1;d.setVariable(a.radio_group,a.id);a.pressed=0}else{for(var l=b.length-1;0<=l;l--)f=0!=d.getVariable(b[l].internalID)?l:f,d.setVariable(b[l].internalID,0),b[l].checked=!1;0<=f&&(d.setVariable(b[f].internalID,1),b[f].checked=!0,d.setVariable(a.radio_group,b[f].internalID));a.value=a.checkbox.checked?1:0}}}a.updatePositionAndSize();a.label_ctx.setTransform(a.ratio,0,0,a.ratio,0,0);a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),0,0);a.label_ctx.clearRect(0,0,a.label.width,a.label.height);
(h=a.label_color.getColor())&&/CanvasGradient|CanvasPattern/.test(h.constructor.name)&&(a.label_ctx.fillStyle=h,a.label_ctx.fillRect(0,0,a.label_ctx.canvas.width,a.label_ctx.canvas.height));a.text_object.textNodes.metrics.w>a.label.width/a.ratio?(a.text_object.anchor="center_left",a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),5,a.label.height/a.ratio/2)):(a.text_object.anchor="center_center",a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),a.label.width/a.ratio/2,a.label.height/
a.ratio/2));a.label_ctx.setTransform(1,0,0,1,0,0)};p.prototype.addEvents=function(){var a=this;a.label.ontouchstart=a.label.onmousedown=a.dummyLabel.onmousedown=b.preventDefault;a.checkbox.addEventListener("click",function(){a.pressed=!0;a.updateAndExecAction()})};b.Checkbox=p;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l,n,m=function(c,d){a=d=b.Control.call(this,c,d)||this;a.label_color=a.label_color||new b.Color("e0e4e8",c.evaluator);a.label_text_color=a.label_text_color||new b.Color("000000",c.evaluator);a.name_str=a.name;/^\[.*\]$/.test(a.name)?a.name=a.parser.parse(a.name.slice(1,-1)):a.name=a.parser.parse("'"+a.name.trim()+"'");void 0===a.valueexpresionStringing&&(a.valueexpresionStringing=a.onlyText?"0":"");a.emptyString=!1;a.ok=0;a.tabindex=++c.tabindex;
if(a.answer)if(/^krypto_/.test(a.answer)&&(a.answer=(new b.Krypto).decode(a.answer.substring(7))),a.answerPattern=a.answer,a.answer=b.buildRegularExpressionsPatterns(a.answer,a.evaluator),a.onlyText){var g=a.answerPattern.indexOf("|");a.firstAnswer=-1==g?a.answerPattern:a.answerPattern.substring(0,g)}else a.firstAnswer=a.parser.parse(a.answerPattern.substring(1,a.answerPattern.indexOf(",")));a.onlyText&&(/^'.*'$/.test(a.valueexpresionStringing)||(a.valueExpr=a.evaluator.parser.parse("'"+a.valueexpresionStringing+
"'")),a.validateValue=function(a){a=a.toString();return"''"==a||"'"==a?"":a&&/^'.*'$/.test(a)?a.slice(1,-1):a},a.formatValue=function(a){return a.toString()});a.containerControl=b.newHTML("div",{class:"DescartesTextFieldContainer",id:a.id});a.field=b.newHTML("input",{type:"text",id:a.id+"TextField",class:"DescartesTextFieldField",tabindex:a.tabindex});a.label=b.newHTML("canvas",{class:"DescartesTextFieldLabel"});a.label_ctx=a.label.getContext("2d");a.ratio=c.ratio;a.containerControl.appendChild(a.label);
a.containerControl.appendChild(a.field);a.cover=b.newHTML("div",{class:"TextfieldCover"});a.keyboard&&a.containerControl.appendChild(a.cover);a.activoStr=a.id+".activo";a.activeStr=a.id+".active";a.addControlContainer(a.containerControl);a.addEvents();a.init();return d};$jscomp.inherits(m,b.Control);m.prototype.init=function(c){a=this;d=a.evaluator;a.label.innerHTML=d.eval(a.name).toString();var g=a.label.textContent;c||(a.value=a.validateValue(d.eval(a.valueExpr)));c=a.formatValue(a.value);a.fieldFontSize=
0<d.eval(a.font_size)?d.eval(a.font_size):b.getFieldFontSize(a.h);a.text_object=new b.TextObject({parent:{decimal_symbol:a.parent.decimal_symbol},evaluator:d,decimals:a.decimals,fixed:!1,align:"left",anchor:"center_center",width:a.parser.parse("0"),font_size:a.parser.parse(""+a.fieldFontSize),font_family:a.font_family,italics:a.italics,bold:a.bold},a.name_str);a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),0,0,!0);var e=b.getTextWidth(c+"_",a.fieldFontSize+"px "+b.sansserif_font),f=
parseInt(a.w/2),m=a.text_object.textNodes.metrics.w+parseInt(a.fieldFontSize);a.visible||(f=a.w,e=0);f<m&&(f=m);""==g&&(f=0);a.w-f<e&&(f=a.w-e);0>f&&(f=0);g=a.w-f;a.containerControl.setAttribute("style","width:"+a.w+"px;height:"+a.h+"px;left:"+a.x+"px;top:"+a.y+"px;z-index:"+a.zIndex+";");a.field.setAttribute("style","font-size:"+a.fieldFontSize+"px;width:"+g+"px;height:"+a.h+"px;left:"+f+"px; font-family:"+("Serif"==a.font_family?b.serif_font:"Monospaced"==a.font_family?b.monospace_font:b.sansserif_font)+
";");a.field.value=c;a.cover.setAttribute("style",";width:"+g+"px;height:"+a.h+"px;left:"+f+"px;");a.label.setAttribute("style","font-size:"+a.fieldFontSize+"px;width:"+f+"px;height:"+a.h+"px;line-height:"+a.h+"px;background-color:"+a.label_color.getColor()+";color:"+a.label_text_color.getColor()+";");a.label.width=f*a.ratio;a.label.height=a.h*a.ratio;a.evaluate&&(a.ok=a.evaluateAnswer());a.evaluator.setVariable(a.id,a.value);a.evaluator.setVariable(a.id+".ok",a.ok);a.oldValue=a.value;a.update()};
m.prototype.update=function(){a=this;d=a.evaluator;a.activeIfVal=0<d.eval(a.activeif);a.drawIfVal=0<d.eval(a.drawif);a.field.disabled=!a.activeIfVal;a.containerControl.style.display=a.drawIfVal?"block":"none";a.parent.animation.playing&&document.activeElement==a.field||(h=a.field.value,p=a.value,a.value=a.validateValue(d.getVariable(a.id)),a.field.value=a.formatValue(a.value),a.value===p&&a.field.value!=h&&(a.value=a.validateValue(h),a.field.value=a.formatValue(a.value)),d.setVariable(a.id,a.value));
a.updatePositionAndSize();a.label_ctx.setTransform(a.ratio,0,0,a.ratio,0,0);a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),0,0);a.label_ctx.clearRect(0,0,a.label.width,a.label.height);(n=a.label_color.getColor())&&/CanvasGradient|CanvasPattern/.test(n.constructor.name)&&(a.label_ctx.fillStyle=n,a.label_ctx.fillRect(0,0,a.label_ctx.canvas.width,a.label_ctx.canvas.height));a.text_object.textNodes.metrics.w>a.label.width/a.ratio?(a.text_object.anchor="center_left",a.text_object.draw(a.label_ctx,
a.label_text_color.getColor(),5,a.label.height/a.ratio/2)):(a.text_object.anchor="center_center",a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),a.label.width/a.ratio/2,a.label.height/a.ratio/2));a.label_ctx.setTransform(1,0,0,1,0,0)};m.prototype.validateValue=function(a){if(""===a||"''"==a)return"";d=this.evaluator;a=a.toString().replace(this.parent.decimal_symbol_regexp,".");c=a==parseFloat(a)?parseFloat(a):parseFloat(d.eval(d.parser.parse(a)));isNaN(c)&&(c=0);f=d.eval(this.min);l=
d.eval(this.max);""===f&&(f=-Infinity);""===l&&(l=Infinity);c<f&&(c=f);c>l&&(c=l);this.discrete&&(a=d.eval(this.incr),c=0===a?0:a*Math.round(c/a));return c=parseFloat(parseFloat(c).toFixed(d.eval(this.decimals)))};m.prototype.formatValue=function(a){return""===a?a:b.Control.prototype.formatValue.call(this,a)};m.prototype.changeValue=function(a){this.activeIfVal&&(this.value=this.validateValue(a),this.field.value=this.formatValue(this.value),this.evaluate&&(this.ok=this.evaluateAnswer()),this.evaluator.setVariable(this.id,
this.value),this.evaluator.setVariable(this.id+".ok",this.ok),this.updateAndExecAction())};m.prototype.evaluateAnswer=function(){return b.esCorrecto(this.answer,this.value,this.evaluator,this.answer)};m.prototype.getFirstAnswer=function(){return this.answer?this.onlyText?this.firstAnswer:this.evaluator.eval(this.firstAnswer):""};m.prototype.deactivate=function(){this.evaluator.setVariable(this.activoStr,0);this.evaluator.setVariable(this.activeStr,0)};m.prototype.addEvents=function(){var a=this;a.label.addEventListener("touchstart",
b.preventDefault);a.label.addEventListener("mousedown",b.preventDefault);a.field.addEventListener("mousedown",function(b){a.parent.deactivateControls();a.evaluator.setVariable(a.activoStr,1);a.evaluator.setVariable(a.activeStr,1);a.parent.update()});a.field.addEventListener("blur",function(b){a.drawIfVal&&a.changeValue(a.field.value,!0)});a.field.addEventListener("keydown",function(b){a.activeIfVal&&13==b.keyCode&&a.changeValue(a.field.value,!0)});a.field.addEventListener("click",function(a){this.focus()});
a.cover.addEventListener("click",function(b){a.parent.deactivateControls();a.evaluator.setVariable(a.activoStr,1);a.evaluator.setVariable(a.activeStr,1);a.parent.update();b=a.evaluator.eval(a.kbexp);a.activeIfVal&&a.parent.keyboard.show(a,a.kblayout,b[0][0]||0,b[0][1]||0,a.id,a.field,a.onlyText)})};b.TextField=m;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d=Math.abs,h,p,c,f,l,n,m,g,q,e,r,x=function(a,c){function d(a){e.options=a.split(",");e.menuOptions=[];e.strVal=[];for(var c=0,d=e.options.length;c<d;c++)a=e.customSplit(e.options[c]),1==a.length?(e.menuOptions.push(a[0]),e.strVal.push(c.toString())):2==a.length&&(e.menuOptions.push(a[0]),""==a[1]?e.strVal.push(c.toString()):e.strVal.push(a[1]));a=0;for(c=e.menuOptions.length;a<c;a++)/^\[.*\]$/.test(e.menuOptions[a])?e.menuOptions[a]=h.parse(e.menuOptions[a].slice(1,
-1)):e.menuOptions[a]=h.parse("'"+e.menuOptions[a]+"'");a=0;for(c=e.strVal.length;a<c;a++)/^\[.*\]$/.test(e.strVal[a])?e.strVal[a]=h.parse(e.strVal[a].slice(1,-1)):e.strVal[a]=h.parse(e.strVal[a]);e.select.innerHTML="";a=$jscomp.makeIterator(e.menuOptions);for(c=a.next();!c.done;c=a.next())d=c.value,c=b.newHTML("option"),c.innerHTML=p.eval(d),e.select.appendChild(c);return 0}var g,e=g=b.Control.call(this,a,c)||this;h=e.parser;p=e.evaluator;e.label_color=e.label_color||new b.Color("e0e4e8",p);e.label_text_color=
e.label_text_color||new b.Color("000000",p);e.options=c.options||"";e.ok=0;e.tabindex=++a.tabindex;e.answer&&(/^krypto_/.test(e.answer)&&(e.answer=(new b.Krypto).decode(e.answer.substring(7))),e.answer=parseInt(e.answer.split(",")[0].replace("[",""))||0);e.name_str=e.name;/^\[.*\]$/.test(e.name)?e.name=e.parser.parse(e.name.slice(1,-1)):e.name=e.parser.parse("'"+e.name+"'");e.evaluator.setFunction(e.id+".setOptions",d);e.containerControl=b.newHTML("div",{class:"DescartesMenuContainer",id:e.id});e.label=
b.newHTML("canvas",{class:"DescartesMenuLabel"});e.label_ctx=e.label.getContext("2d");e.ratio=a.ratio;e.select=b.newHTML("select",{id:e.id+"_menuSelect",class:"DescartesMenuSelect",tabindex:e.tabindex});e.field=b.newHTML("input",{type:"text",id:e.id+"_menuField",class:"DescartesMenuField",tabindex:e.tabindex});d(e.options);e.containerControl.appendChild(e.label);e.containerControl.appendChild(e.select);e.visible&&e.containerControl.appendChild(e.field);e.cover=b.newHTML("div",{class:"TextfieldCover"});
e.keyboard&&e.visible&&e.containerControl.appendChild(e.cover);e.addControlContainer(e.containerControl);e.addEvents();e.init();return g};$jscomp.inherits(x,b.Control);x.prototype.init=function(c){a=this;p=a.evaluator;a.label.innerHTML=p.eval(a.name).toString();var d=a.label.textContent;a.fieldFontSize=0<p.eval(a.font_size)?p.eval(a.font_size):b.getFieldFontSize(a.h);a.text_object=new b.TextObject({parent:{decimal_symbol:a.parent.decimal_symbol},evaluator:p,decimals:a.decimals,fixed:!1,align:"left",
anchor:"center_center",width:a.parser.parse("0"),font_size:a.parser.parse(""+a.fieldFontSize),font_family:a.font_family,italics:a.italics,bold:a.bold},a.name_str);a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),0,0,!0);var g=0,e=0;a.value=c?a.value:p.eval(a.valueExpr);a.idxVal=a.getIndex(a.value);for(var f=0,m=a.menuOptions.length;f<m;f++)c=b.getTextWidth(p.eval(a.menuOptions[f]).toString(),a.fieldFontSize+"px "+b.sansserif_font),c>g&&(g=c,e=f);g+=25;c=b.getTextWidth(a.formatValue(p.eval(a.strVal[e])),
a.fieldFontSize+"px "+b.sansserif_font)+7;e=a.text_object.textNodes.metrics.w+parseInt(a.fieldFontSize);""==d&&(e=0);a.visible||(c=0);for(d=a.w-c-e;d<g&&0<e;)e--,d++;for(;d<g&&0<c;)c--,d++;for(;e+d+c+1<a.w;)d++,c++;g=e;f=g+d;c=a.w-f;m=a.formatValue(p.eval(a.strVal[a.idxVal]));a.containerControl.setAttribute("style","width:"+a.w+"px;height:"+a.h+"px;left:"+a.x+"px;top:"+a.y+"px;z-index:"+a.zIndex+";");a.label.setAttribute("style","font-size:"+a.fieldFontSize+"px;width:"+e+"px;height:"+a.h+"px;line-height:"+
a.h+"px;background-color:"+a.label_color.getColor()+";color:"+a.label_text_color.getColor()+";");a.label.width=e*a.ratio;a.label.height=a.h*a.ratio;a.field.value=m;a.field.setAttribute("style","font-size:"+a.fieldFontSize+"px;width:"+c+"px;height:"+a.h+"px;left:"+f+"px;");a.cover.setAttribute("style","width:"+c+"px;height:"+a.h+"px;left:"+f+"px;");a.select.setAttribute("style","text-align:left;font-size:"+a.fieldFontSize+"px;width:"+d+"px;height:"+a.h+"px;left:"+g+"px;");a.select.selectedIndex=a.idxVal;
p.setVariable(a.id,parseFloat(m.replace(a.parent.decimal_symbol,".")));a.update()};x.prototype.update=function(){a=this;p=a.evaluator;a.activeIfVal=0<p.eval(a.activeif);a.drawIfVal=0<p.eval(a.drawif);a.field.disabled=a.activeIfVal?!1:!0;a.select.disabled=a.activeIfVal?!1:!0;a.drawIfVal?a.containerControl.style.display="block":(a.click=!1,a.containerControl.style.display="none");if(!a.parent.animation.playing||document.activeElement!=a.select){for(var b=0,c=a.menuOptions.length;b<c;b++)a.select.options[b].innerHTML=
(p.eval(a.menuOptions[b])||"").replace(/\\u002C/g,",");a.value=p.getVariable(a.id);isNaN(a.value)&&(a.value=0);a.field.value=a.formatValue(a.value);p.setVariable(a.id,parseFloat(a.value));a.select.selectedIndex=parseFloat(a.getIndex(a.value))}a.ok=a.value==a.answer?1:0;a.evaluator.setVariable(a.id+".ok",a.ok);a.updatePositionAndSize();a.label_ctx.setTransform(a.ratio,0,0,a.ratio,0,0);a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),0,0);a.label_ctx.clearRect(0,0,a.label.width,a.label.height);
(r=a.label_color.getColor())&&/CanvasGradient|CanvasPattern/.test(r.constructor.name)&&(a.label_ctx.fillStyle=r,a.label_ctx.fillRect(0,0,a.label_ctx.canvas.width,a.label_ctx.canvas.height));a.text_object.textNodes.metrics.w>a.label.width/a.ratio?(a.text_object.anchor="center_left",a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),5,a.label.height/a.ratio/2)):(a.text_object.anchor="center_center",a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),a.label.width/a.ratio/2,a.label.height/
a.ratio/2));a.label_ctx.setTransform(1,0,0,1,0,0)};x.prototype.customSplit=function(a){n=!1;m="";g=0;for(q=-1;g<a.length;){e=a.charAt(g);if("["===e&&-1===q){if(n||""!=m)m+="\u00a6";q++}else"["===e?q++:"]"===e&&0===q?(n=!0,q--):"]"==a.charAt(g)&&(q=0>q?q:q-1);m+=a.charAt(g);g++}return m.split("\u00a6")};x.prototype.getIndex=function(a){a=parseFloat(a.toString().replace(this.parent.decimal_symbol,"."));c=-1;f=Infinity;for(var b=0,g=this.strVal.length;b<g;b++)l=d(a-parseFloat(this.evaluator.eval(this.strVal[b]))),
l<=f&&(f=l,c=b);this.evaluator.setVariable(this.id+".txt",this.select.options[this.select.selectedIndex].text);return c};x.prototype.changeValue=function(b,c){a=this;a.activeIfVal&&(c&&(a.idxVal=a.getIndex(b),a.value=a.evaluator.eval(a.strVal[a.idxVal]),a.field.value=a.formatValue(a.idxVal),a.select.selectedIndex=a.idxVal),a.evaluator.setVariable(a.id,a.value),a.updateAndExecAction())};x.prototype.addEvents=function(){var a=this;a.label.addEventListener("touchstart",b.preventDefault);a.label.addEventListener("mousedown",
b.preventDefault);a.select.addEventListener("change",function(b){a.value=a.evaluator.eval(a.strVal[this.selectedIndex]);a.field.value=a.formatValue(a.value);a.evaluator.setVariable(a.id,a.field.value);a.changeValue();b.preventDefault()});a.field.addEventListener("keydown",function(b){13==b.keyCode&&(a.idxVal=a.getIndex(a.field.value),a.value=a.evaluator.eval(a.strVal[a.idxVal]),a.field.value=a.formatValue(a.idxVal),a.select.selectedIndex=a.idxVal,a.changeValue())});a.field.addEventListener("blur",
function(b){a.drawIfVal&&a.changeValue(a.field.value,!0)});a.field.addEventListener("click",function(b){a.field.focus()});a.cover.addEventListener("click",function(b){b=a.evaluator.eval(a.kbexp);a.activeIfVal&&a.parent.keyboard.show(a,a.kblayout,b[0][0]||0,b[0][1]||0,a.id,a.field,a.onlyText)})};b.Menu=x;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d=Math.floor,h,p,c,f,l,n,m,g,q,e,r,x,y,u,v,A,w,z=function(c,d){a=d=b.Control.call(this,c,d)||this;a.label_color=a.label_color||new b.Color("e0e4e8",c.evaluator);a.label_text_color=a.label_text_color||new b.Color("000000",c.evaluator);a.name_str=a.name;/^\[.*\]$/.test(a.name)?a.name=a.parser.parse(a.name.slice(1,-1)):a.name=a.parser.parse("'"+a.name+"'");a.orientation=a.w>=a.h?"h":"v";a.container=b.newHTML("div",{class:"DescartesScrollbarContainer",
id:a.id});a.canvas=b.newHTML("canvas");a.divUp=b.newHTML("div",{class:"DescartesCatcher up"});a.divDown=b.newHTML("div",{class:"DescartesCatcher down"});a.field=b.newHTML("input",{type:"text",id:a.id+"scrollbar",class:"DescartesScrollbarField"});a.handler=b.newHTML("div",{class:"DescartesCatcher manipulator"});a.label=b.newHTML("canvas",{class:"DescartesScrollbarLabel"});a.label_ctx=a.label.getContext("2d");a.ratio=c.ratio;a.container.appendChild(a.canvas);a.container.appendChild(a.label);a.container.appendChild(a.divUp);
a.container.appendChild(a.divDown);a.container.appendChild(a.field);a.container.appendChild(a.handler);a.cover=b.newHTML("div",{class:"TextfieldCover"});a.keyboard&&a.visible&&a.container.appendChild(a.cover);a.addControlContainer(a.container);a.addEvents();a.init();return d};$jscomp.inherits(z,b.Control);z.prototype.init=function(){a=this;h=a.evaluator;0==h.eval(a.decimals)?a.incr=1:a.incr=(h.eval(a.max)-h.eval(a.min))/100;a.value=a.validateValue(h.eval(a.valueExpr));p=a.formatValue(a.value);c=a.evaluator.eval(a.expresion)[0];
a.x=c[0];a.y=c[1];4==c.length&&(a.w=c[2],a.h=c[3]);a.orientation=a.w>=a.h?"h":"v";a.initScroll(p);a.changeScrollPosition();a.prePos=a.pos;h.setVariable(a.id,a.value)};z.prototype.initScroll=function(c){a=this;h=a.evaluator;a.label.innerHTML=h.eval(a.name).toString();A=a.label.textContent;var d="v"===a.orientation?parseInt(19+5*(a.h-100)/100):a.h;a.fieldFontSize=0<h.eval(a.font_size)?h.eval(a.font_size):"v"===a.orientation?d-parseInt(a.h/20)-1:b.getFieldFontSize(d);a.text_object=new b.TextObject({parent:{decimal_symbol:a.parent.decimal_symbol},
evaluator:a.evaluator,decimals:a.decimals,fixed:!1,align:"left",anchor:"center_center",width:a.parser.parse("0"),font_size:a.parser.parse(""+a.fieldFontSize),font_family:a.font_family,italics:a.italics,bold:a.bold},a.name_str);a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),0,0,!0);c=b.getTextWidth(c+"_",a.fieldFontSize+"px "+b.sansserif_font);var g=a.parent.getSpaceById(a.spaceID).h;a.labelHeight=""==A?0:d;a.fieldHeight=""==a.visible?0:d;if("v"===a.orientation)a.canvasWidth=a.w,a.canvasHeight=
a.h-a.labelHeight-a.fieldHeight,18<=a.canvasHeight+a.y-g&&(a.canvasHeight=g),d=a.fieldHeight,c=d+a.canvasHeight,a.canvasX=0,a.canvasY=a.fieldHeight,a.labelWidth=a.w,a.labelY=c,a.upWidth=a.downW=a.w,a.upHeight=a.downH=a.w,a.upX=0,a.upY=a.fieldHeight,a.downX=0,a.downY=c-a.downH,a.fieldWidth=a.w,a.fieldX=0,a.handlerW=a.w,a.handlerH=parseInt((a.canvasHeight-a.upHeight-a.downH-a.labelHeight-a.fieldHeight)/10),a.handlerH=a.canvasHeight-a.upHeight-a.downH-a.labelHeight-a.fieldHeight>2*a.w?a.w:a.handlerH,
a.handlerH=15>a.handlerH?15:a.handlerH,a.limInf=c-a.downH-a.handlerH,a.limSup=d+a.downH;else{d=a.text_object.textNodes.metrics.w+parseInt(a.fieldFontSize);a.labelWidth=d;a.fieldWidth=c;""==A&&(a.labelWidth=0);a.visible||(a.fieldWidth=0);for(d=a.w-a.fieldWidth-a.labelWidth;58>d&&0<a.labelWidth;)a.labelWidth--,d++;for(;58>d&&0<a.fieldWidth;)a.fieldWidth--,d++;c=a.labelWidth;g=c+d;a.fieldWidth=a.w-g;a.canvasWidth=d;a.canvasHeight=a.h;a.canvasX=a.labelWidth;a.canvasY=0;a.fieldX=a.canvasWidth+a.labelWidth;
a.labelHeight=a.h;a.labelY=0;a.upWidth=a.downW=a.h;a.upHeight=a.downH=a.h;a.upX=g-a.downW;a.upY=0;a.downX=a.labelWidth;a.downY=0;a.handlerW=parseInt((a.canvasWidth-a.upWidth-a.downW)/10);a.handlerW=a.canvasWidth-a.upWidth-a.downW>2*a.h?a.h:a.handlerW;a.handlerW=15>a.handlerW?15:a.handlerW;a.handlerH=a.h;a.limInf=c+a.downW;a.limSup=c+a.canvasWidth-a.downW-a.handlerW}a.container.setAttribute("style","width:"+a.w+"px;height:"+a.h+"px;left:"+a.x+"px;top:"+a.y+"px;z-index:"+a.zIndex+";");a.canvas.setAttribute("width",
a.w+"px");a.canvas.setAttribute("height",a.h+"px");a.canvas.setAttribute("style","position:absolute;left:0;top:0;");a.ctx=a.canvas.getContext("2d");a.ctx.imageSmoothingEnabled=!1;a.divUp.setAttribute("style","width:"+a.upWidth+"px;height:"+a.upHeight+"px;left:"+a.upX+"px;top:"+a.upY+"px;");a.divDown.setAttribute("style","width:"+a.downW+"px;height:"+a.downH+"px;left:"+a.downX+"px;top:"+a.downY+"px;");a.handler.setAttribute("style","width:"+a.handlerW+"px;height:"+a.handlerH+"px;left:"+("v"===a.orientation?
0:a.limInf)+"px;top:"+("v"===a.orientation?a.limInf:0)+"px;");a.field.setAttribute("style","font-size:"+a.fieldFontSize+"px;width:"+a.fieldWidth+"px;height:"+a.fieldHeight+"px;left:"+a.fieldX+"px;top:0;");a.cover.setAttribute("style","width:"+a.fieldWidth+"px;height:"+a.fieldHeight+"px;left:"+a.fieldX+"px;top:0;");0===a.fieldHeight&&(a.field.style.display="none");a.label.setAttribute("style","font-size:"+a.fieldFontSize+"px;width:"+a.labelWidth+"px;height:"+a.labelHeight+"px;line-height:"+a.labelHeight+
"px;left:0;top:"+a.labelY+"px;background-color:"+a.label_color.getColor()+";color:"+a.label_text_color.getColor()+";");a.label.width=a.labelWidth*a.ratio;a.label.height=a.labelHeight*a.ratio};z.prototype.update=function(){a=this;h=a.evaluator;0==h.eval(a.decimals)?a.incr=1:a.incr=(h.eval(a.max)-h.eval(a.min))/100;a.activeIfVal=0<h.eval(a.activeif);a.drawIfVal=0<h.eval(a.drawif);a.field.disabled=!a.activeIfVal;a.drawIfVal?(a.container.style.display="block",a.draw()):a.container.style.display="none";
a.updatePositionAndSize();var b=a.validateValue(h.getVariable(a.id));b==a.value||0<Math.abs(b-a.value)&&1E-9>Math.abs(b-a.value)||(a.value=b,a.changeScrollPosition(),a.prePos=a.pos);a.value=b;a.field.value=a.formatValue(a.value);h.setVariable(a.id,a.value);a.label_ctx.setTransform(a.ratio,0,0,a.ratio,0,0);a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),0,0);a.label_ctx.clearRect(0,0,a.label.width,a.label.height);(w=a.label_color.getColor())&&/CanvasGradient|CanvasPattern/.test(w.constructor.name)&&
(a.label_ctx.fillStyle=w,a.label_ctx.fillRect(0,0,a.label_ctx.canvas.width,a.label_ctx.canvas.height));a.text_object.textNodes.metrics.w>a.label.width/a.ratio?(a.text_object.anchor="center_left",a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),5,a.label.height/a.ratio/2)):(a.text_object.anchor="center_center",a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),a.label.width/a.ratio/2,a.label.height/a.ratio/2));a.label_ctx.setTransform(1,0,0,1,0,0)};z.prototype.draw=function(){a=
this;f=a.ctx;n=d(a.w);l=d(a.h);f.fillStyle=a.color.getColor();f.fillRect(0,0,n,l);f.fillStyle="black";f.beginPath();"h"===a.orientation?(f.lineWidth=1,f.strokeStyle="rgba(0,0,0,0.3)",f.strokeRect(parseInt(a.labelWidth)+.5,.5,n-1-parseInt(a.labelWidth),l-1),f.lineWidth=Math.ceil(12*a.upWidth/100)||1,f.strokeStyle=a.colorInt.getColor(),f.moveTo(a.downX+62.215*a.upWidth/100,20*a.downH/100),f.lineTo(a.downX+32.449*a.upWidth/100,a.downH/2),f.lineTo(a.downX+62.215*a.upWidth/100,80*a.downH/100),f.moveTo(a.upX+
32.449*a.upWidth/100,20*a.downH/100),f.lineTo(a.upX+62.215*a.upWidth/100,a.downH/2),f.lineTo(a.upX+32.449*a.upWidth/100,80*a.downH/100),f.stroke(),g=d(a.pos),m=Math.ceil(l/10)||1,f.fillStyle=a.colorInt.getColor(),f.fillRect(g+.5,m,d(a.handlerW),l-2*m)):(f.lineWidth=1,f.strokeStyle="rgba(0,0,0,0.3)",f.strokeRect(.5,.5,n-1,l-parseInt(a.labelHeight)-.5),f.lineWidth=Math.ceil(12*a.upWidth/100)||1,f.strokeStyle=a.colorInt.getColor(),f.moveTo(20*a.upWidth/100,a.h-a.labelHeight-70*a.downH/100),f.lineTo(50*
a.upWidth/100,a.h-a.labelHeight-40.237*a.downH/100),f.lineTo(80*a.upWidth/100,a.h-a.labelHeight-70*a.downH/100),f.moveTo(20*a.upWidth/100,a.upY+70*a.downH/100),f.lineTo(50*a.upWidth/100,a.upY+40.237*a.downH/100),f.lineTo(80*a.upWidth/100,a.upY+70*a.downH/100),f.stroke(),g=d(a.pos),m=Math.ceil(n/10)||1,f.fillStyle=a.colorInt.getColor(),f.fillRect(m,g+.5,n-2*m,d(a.handlerH)));a.activeIfVal||(f.fillStyle="rgba(255,255,255,0.5)",f.fillRect(0,0,f.canvas.width,f.canvas.height))};z.prototype.validateValue=
function(b){a=this;h=a.evaluator;q=b.toString();q=parseFloat(q.replace(a.parent.decimal_symbol,"."));isNaN(q)&&(q=0);a.minimo=h.eval(a.min);q<a.minimo&&(a.value=null,q=a.minimo);a.maximo=h.eval(a.max);q>a.maximo&&(a.value=null,q=a.maximo);e=a.incr;q=0!=e?q*e/e:0;a.fixed&&(q=parseFloat(parseFloat(q).toFixed(h.eval(a.decimals))));return q};z.prototype.increase=function(){this.changeValue(parseFloat(this.value)+this.incr)};z.prototype.decrease=function(){this.changeValue(parseFloat(this.value)-this.incr)};
z.prototype.increase10=function(){a=this;m=(a.evaluator.eval(a.max)-a.evaluator.eval(a.min))/10;"h"==a.orientation?a.clickPos.x>a.prePos&&a.changeValue(parseFloat(a.value)+m):a.clickPos.y<a.prePos&&a.changeValue(parseFloat(a.value)+m)};z.prototype.decrease10=function(){a=this;m=(a.evaluator.eval(a.max)-a.evaluator.eval(a.min))/10;"h"==a.orientation?a.clickPos.x<a.prePos&&a.changeValue(parseFloat(a.value)-m):a.clickPos.y>a.prePos&&a.changeValue(parseFloat(a.value)-m)};z.prototype.changeValue=function(b){a=
this;a.activeIfVal&&(r=a.validateValue(b),r!=a.value&&(a.value=r,a.field.value=a.formatValue(r),a.changeScrollPosition(),a.prePos=a.pos,a.evaluator.setVariable(a.id,a.value)),a.updateAndExecAction())};z.prototype.changeValueMovement=function(){a=this;h=a.evaluator;x=a.limInf;y=a.limSup;u=h.eval(a.min);v=h.eval(a.max);e=a.incr;r=d((a.pos-x)*(v-u)/(y-x)/e)*e+u;r!=a.value&&(a.value=r,a.field.value=a.formatValue(r),h.setVariable(a.id,a.value),a.parent.updateControls(),a.actionExec.execute(),a.parent.update())};
z.prototype.changeScrollPosition=function(){a=this;h=a.evaluator;x=a.limInf;y=a.limSup;u=h.eval(a.min);v=h.eval(a.max);e=a.incr;a.pos=(a.value-u)*(y-x)/(v-u)+x;a.handler.style["h"==a.orientation?"left":"top"]=a.pos+"px"};z.prototype.addEvents=function(){function a(c,d,g,e){b.clearTimeout(u);(n.up||n.down||n.canvasClick)&&1E-7<Math.abs(n.value-e)&&(d.call(n),c=g?c:30,u=b.setTimeout(function(){a(c,d,!1,e)},c))}function c(c){c.preventDefault();n.whichBtn=b.whichBtn(c);"L"==n.whichBtn&&n.activeIfVal&&
(n.clickPos=b.getCursorPosition(c,n.container),n.canvasClick=!0,"h"==n.orientation?n.clickPos.x<n.prePos?a(350,n.decrease10,!0,n.minimo):a(350,n.increase10,!0,n.maximo):n.clickPos.y<n.prePos?a(350,n.increase10,!0,n.maximo):a(350,n.decrease10,!0,n.minimo))}function d(a){n.canvasClick=!1;b.clearTimeout(u)}function g(a){1==n.canvasClick&&(n.clickPos=b.getCursorPosition(a,n.container),a.preventDefault())}function e(a){n.scrollClick=!1;n.prePos=n.pos;window.removeEventListener("mouseup",e,!1);window.removeEventListener("mousemove",
m,!1);a.preventDefault()}function f(a){n.scrollClick=!1;n.prePos=n.pos;window.removeEventListener("touchend",f,!1);window.removeEventListener("touchmove",m,!1);a.preventDefault()}function m(a){var c=b.getCursorPosition(a,n.container);"h"==n.orientation?(n.pos=n.prePos-(n.initPos.x-c.x),n.pos<n.limInf&&(n.pos=n.limInf),n.pos>n.limSup&&(n.pos=n.limSup),n.handler.setAttribute("style","width:"+n.handlerW+"px;height:"+n.h+"px;left:"+n.pos+"px;top:0;")):(n.pos=n.prePos-(n.initPos.y-c.y),n.pos>n.limInf&&
(n.pos=n.limInf),n.pos<n.limSup&&(n.pos=n.limSup),n.handler.setAttribute("style","width:"+n.w+"px;height:"+n.handlerH+"px;left:0;top:"+n.pos+"px;"));n.changeValueMovement();a.preventDefault()}function l(c){c.preventDefault();n.whichBtn=b.whichBtn(c);"L"==n.whichBtn&&n.activeIfVal&&(n.up=!0,a(350,n.increase,!0,n.maximo))}function h(c){c.preventDefault();n.whichBtn=b.whichBtn(c);"L"==n.whichBtn&&n.activeIfVal&&(n.down=!0,a(350,n.decrease,!0,n.minimo))}function q(a){n.down=!1;b.clearTimeout(u);a.preventDefault()}
function p(a){n.up=!1;b.clearTimeout(u);n.draw()}function r(a){n.down=!1;b.clearTimeout(u);n.draw()}var n=this,u;n.field.addEventListener("keydown",function(a){13==a.keyCode&&n.changeValue(n.field.value)});n.field.addEventListener("blur",function(a){n.drawIfVal&&n.changeValue(n.field.value,!0)});n.canvas.addEventListener("touchstart",c);n.canvas.addEventListener("mousedown",c);n.divDown.addEventListener("mouseout",q);window.addEventListener("touchend",d);window.addEventListener("mouseup",d);n.canvas.addEventListener("touchmove",
g);n.canvas.addEventListener("mousemove",g);n.handler.addEventListener("touchstart",function(a){n.activeIfVal&&(n.scrollClick=!0,n.initPos=b.getCursorPosition(a,n.container),window.addEventListener("touchend",f),window.addEventListener("touchmove",m),a.preventDefault())});n.handler.addEventListener("mousedown",function(a){n.activeIfVal&&(n.scrollClick=!0,n.initPos=b.getCursorPosition(a,n.container),window.addEventListener("mouseup",e),window.addEventListener("mousemove",m),a.preventDefault())});n.divUp.addEventListener("touchstart",
l);n.divUp.addEventListener("mousedown",l);n.divDown.addEventListener("touchstart",h);n.divDown.addEventListener("mousedown",h);n.divUp.addEventListener("mouseout",function(a){n.up=!1;b.clearTimeout(u);a.preventDefault()});n.divDown.addEventListener("mouseout",q);window.addEventListener("touchend",p);window.addEventListener("mouseup",p);window.addEventListener("touchend",r);window.addEventListener("mouseup",r);n.cover.addEventListener("click",function(a){a=n.evaluator.eval(n.kbexp);n.activeIfVal&&
n.parent.keyboard.show(n,n.kblayout,a[0][0]||0,a[0][1]||0,n.id,n.field,n.onlyText)})};b.Scrollbar=z;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d=Math.floor,h,p,c,f,l,n,m,g,q,e,r=function(c,d){a=d=b.Control.call(this,c,d)||this;a.label_color=a.label_color||new b.Color("e0e4e8",c.evaluator);a.label_text_color=a.label_text_color||new b.Color("000000",c.evaluator);a.name_str=a.name;/^\[.*\]$/.test(a.name)?a.name=a.parser.parse(a.name.slice(1,-1)):a.name=a.parser.parse("'"+a.name+"'");a.orientation=a.w>=a.h?"h":"v";a.container=b.newHTML("div",{class:"DescartesSliderContainer",id:a.id});a.field=
b.newHTML("input",{type:"text",id:a.id+"slider",class:"DescartesSliderField"});a.sliderCtr=b.newHTML("input",{type:"range",id:a.id+"range",min:0,max:100,step:"any",class:"DescartesRange"});a.label=b.newHTML("canvas",{class:"DescartesSliderLabel"});a.label_ctx=a.label.getContext("2d");a.ratio=c.ratio;a.container.appendChild(a.label);a.container.appendChild(a.field);a.container.appendChild(a.sliderCtr);a.cover=b.newHTML("div",{class:"TextfieldCover"});a.keyboard&&a.visible&&a.container.appendChild(a.cover);
a.addControlContainer(a.container);a.addEvents();a.init();return d};$jscomp.inherits(r,b.Control);r.prototype.init=function(){a=this;h=a.evaluator;a.value=a.validateValue(h.eval(a.valueExpr));p=a.formatValue(a.value);c=a.evaluator.eval(a.expresion)[0];a.x=c[0];a.y=c[1];4==c.length&&(a.w=c[2],a.h=c[3]);a.orientation=a.w>=a.h?"h":"v";a.initSlider(p);a.changeSliderPosition();a.prePos=a.pos;h.setVariable(a.id,a.value)};r.prototype.initSlider=function(c){a=this;h=a.evaluator;a.label.innerHTML=h.eval(a.name).toString();
q=a.label.textContent;var d="v"===a.orientation?parseInt(19+5*(a.h-100)/100):a.h;a.fieldFontSize=0<h.eval(a.font_size)?h.eval(a.font_size):"v"===a.orientation?d-parseInt(a.h/20)-1:b.getFieldFontSize(d);a.text_object=new b.TextObject({parent:{decimal_symbol:a.parent.decimal_symbol},evaluator:h,decimals:a.decimals,fixed:!1,align:"left",anchor:"center_center",width:a.parser.parse("0"),font_size:a.parser.parse(""+a.fieldFontSize),font_family:a.font_family,italics:a.italics,bold:a.bold},a.name_str);a.text_object.draw(a.label_ctx,
a.label_text_color.getColor(),0,0,!0);c=b.getTextWidth(c+"_",a.fieldFontSize+"px "+b.sansserif_font);var g=a.parent.getSpaceById(a.spaceID).h;a.labelHeight=""==q?0:d;a.fieldHeight=""==a.visible?0:d;if("v"===a.orientation)a.canvasWidth=a.w,a.canvasHeight=a.h-a.labelHeight-a.fieldHeight,18<=a.canvasHeight+a.y-g&&(a.canvasHeight=g),d=a.fieldHeight+a.canvasHeight,a.canvasX=0,a.canvasY=a.fieldHeight,a.labelWidth=a.w,a.labelY=d,a.upWidth=a.downW=a.w,a.upHeight=a.downH=a.w,a.fieldWidth=a.w,a.fieldX=0,a.sliderCtr.style=
"position:absolute;left:0;top:"+a.canvasY+"px;width:"+a.canvasHeight+"px;height:"+a.canvasWidth+"px;transform-origin:"+a.canvasWidth/2+"px "+a.canvasWidth/2+"px;transform:rotate(90deg);margin:0;padding:0;--thumb_size:"+a.canvasWidth+"px;--track_h:"+parseInt(a.canvasWidth/3)+"px;";else{d=a.text_object.textNodes.metrics.w+parseInt(a.fieldFontSize);a.labelWidth=d;a.fieldWidth=c;""==q&&(a.labelWidth=0);a.visible||(a.fieldWidth=0);for(d=a.w-a.fieldWidth-a.labelWidth;58>d&&0<a.labelWidth;)a.labelWidth--,
d++;for(;58>d&&0<a.fieldWidth;)a.fieldWidth--,d++;a.fieldWidth=a.w-(a.labelWidth+d);a.canvasWidth=d;a.canvasHeight=a.h;a.canvasX=a.labelWidth;a.canvasY=0;a.fieldX=a.canvasWidth+a.labelWidth;a.labelHeight=a.h;a.labelY=0;a.upWidth=a.downW=a.h;a.upHeight=a.downH=a.h;a.sliderCtr.style="position:absolute;left:"+a.canvasX+"px;top:0;width:"+a.canvasWidth+"px;height:"+a.canvasHeight+"px;margin:0;padding:0;--thumb_size:"+a.canvasHeight+"px;--track_h:"+parseInt(a.canvasHeight/3)+"px;"}a.container.setAttribute("style",
"width:"+a.w+"px;height:"+a.h+"px;left:"+a.x+"px;top:"+a.y+"px;z-index:"+a.zIndex+";");a.field.setAttribute("style","font-size:"+a.fieldFontSize+"px;width:"+a.fieldWidth+"px;height:"+a.fieldHeight+"px;left:"+a.fieldX+"px;top:0;");a.cover.setAttribute("style","width:"+a.fieldWidth+"px;height:"+a.fieldHeight+"px;left:"+a.fieldX+"px;top:0;");0===a.fieldHeight&&(a.field.style.display="none");a.label.setAttribute("style","font-size:"+a.fieldFontSize+"px;width:"+a.labelWidth+"px;height:"+a.labelHeight+
"px;line-height:"+a.labelHeight+"px;left:0;top:"+a.labelY+"px;background-color:"+a.label_color.getColor()+";color:"+a.label_text_color.getColor()+";");a.label.width=a.labelWidth*a.ratio;a.label.height=a.labelHeight*a.ratio};r.prototype.update=function(){a=this;h=a.evaluator;a.activeIfVal=0<h.eval(a.activeif);a.drawIfVal=0<h.eval(a.drawif);a.field.disabled=!a.activeIfVal;a.drawIfVal?(a.container.style.display="block",a.draw()):a.container.style.display="none";a.updatePositionAndSize();var b=a.validateValue(h.getVariable(a.id));
b==a.value||0<Math.abs(b-a.value)&&1E-9>Math.abs(b-a.value)||(a.value=b,a.changeSliderPosition(),a.prePos=a.pos);a.value=b;a.field.value=a.formatValue(a.value);h.setVariable(a.id,a.value);a.label_ctx.setTransform(a.ratio,0,0,a.ratio,0,0);a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),0,0);a.label_ctx.clearRect(0,0,a.label.width,a.label.height);(e=a.label_color.getColor())&&/CanvasGradient|CanvasPattern/.test(e.constructor.name)&&(a.label_ctx.fillStyle=e,a.label_ctx.fillRect(0,0,a.label_ctx.canvas.width,
a.label_ctx.canvas.height));a.text_object.textNodes.metrics.w>a.label.width/a.ratio?(a.text_object.anchor="center_left",a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),5,a.label.height/a.ratio/2)):(a.text_object.anchor="center_center",a.text_object.draw(a.label_ctx,a.label_text_color.getColor(),a.label.width/a.ratio/2,a.label.height/a.ratio/2));a.label_ctx.setTransform(1,0,0,1,0,0)};r.prototype.draw=function(){a=this;a.sliderCtr.style.setProperty("--track_color",a.color.getColor());a.sliderCtr.style.setProperty("--thumb_color",
a.colorInt.getColor());a.sliderCtr.value=a.pos};r.prototype.validateValue=function(b){a=this;h=a.evaluator;f=b.toString();f=parseFloat(f.replace(a.parent.decimal_symbol,"."));isNaN(f)&&(f=0);a.minimo=h.eval(a.min);f<a.minimo&&(a.value=null,f=a.minimo);a.maximo=h.eval(a.max);f>a.maximo&&(a.value=null,f=a.maximo);l=h.eval(a.incr);f=0!=l?f*l/l:0;a.fixed&&(f=parseFloat(parseFloat(f).toFixed(h.eval(a.decimals))));return f};r.prototype.changeValue=function(b){a=this;a.activeIfVal&&(n=a.validateValue(b),
n!=a.value&&(a.value=n,a.field.value=a.formatValue(n),a.changeSliderPosition(),a.prePos=a.pos,a.evaluator.setVariable(a.id,a.value)),a.updateAndExecAction())};r.prototype.changeValueForSliderMovement=function(){a=this;h=a.evaluator;m=h.eval(a.min);g=h.eval(a.max);l=h.eval(a.incr);n=d(a.pos*(g-m)/100/l)*l+m;n!=a.value&&(a.value=n,a.field.value=a.formatValue(n),h.setVariable(a.id,a.value),a.parent.updateControls(),a.actionExec.execute(),a.parent.update())};r.prototype.changeSliderPosition=function(){h=
this.evaluator;m=h.eval(this.min);g=h.eval(this.max);l=h.eval(this.incr);this.pos=100*(this.value-m)/(g-m)};r.prototype.addEvents=function(){var a=this;a.field.addEventListener("keydown",function(b){13==b.keyCode&&a.changeValue(a.field.value)});a.field.addEventListener("blur",function(b){a.drawIfVal&&a.changeValue(a.field.value,!0)});a.cover.addEventListener("click",function(b){b=a.evaluator.eval(a.kbexp);a.activeIfVal&&a.parent.keyboard.show(a,a.kblayout,b[0][0]||0,b[0][1]||0,a.id,a.field,a.onlyText)});
a.sliderCtr.addEventListener("input",function(b){a.pos=b.target.value;a.changeValueForSliderMovement()})};b.Slider=r;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p=function(a,d){var c=b.Control.call(this,a,d)||this;c.controls=d.controls||!0;c.file=d.file||"";c.oldDrawIf=0;a=c.evaluator.eval(c.expresion);d=4==a[0].length;c.w=d?a[0][2]:200;c.h=d?a[0][3]:28;c.audio=c.parent.getAudio(c.file);c.oldFile=c.file;/^\[.*\]$/.test(c.file)&&(c.file=c.evaluator.parser.parse(c.file.slice(1,-1)));c.autoplay&&(c.audio.setAttribute("autoplay","autoplay"),c.audio.play());c.loop&&c.audio.setAttribute("loop","loop");c.controls&&
c.audio.setAttribute("controls","controls");c.audio.setAttribute("style","position:absolute;width:"+c.w+"px;left:"+c.x+"px;top:"+c.y+"px;z-index:"+c.zIndex+";");c.addControlContainer(c.audio);c.evaluator.setFunction(c.id+".play",function(){try{c.audio.play()}catch(n){}return 0});c.evaluator.setFunction(c.id+".pause",function(){try{c.audio.pause()}catch(n){}return 0});c.evaluator.setFunction(c.id+".stop",function(){try{c.audio.pause(),c.audio.currentTime=0}catch(n){}return 0});c.evaluator.setFunction(c.id+
".currentTime",function(a){try{c.audio.currentTime=parseFloat(a)}catch(m){}return 0});c.audio.addEventListener("timeupdate",function(){c.evaluator.setVariable(c.id+".currentTime",c.audio.currentTime);c.evaluator.setVariable(c.id+".playing",c.audio.paused?0:1);c.evaluator.setVariable(c.id+".duration",c.audio.duration)});return c};$jscomp.inherits(p,b.Control);p.prototype.init=function(){this.audio.style.left=this.x+"px";this.audio.style.top=this.y+"px";this.update()};p.prototype.update=function(){a=
this.evaluator;"string"!==typeof this.file&&(d=a.eval(this.file),this.old!==d&&(this.audio.src=this.old=d));h=0<a.eval(this.drawif);this.audio.style.display=h?"block":"none";h||h===this.oldDIF||this.audio.pause();this.oldDIF=h;this.updatePositionAndSize()};b.Audio=p;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p=function(c,f){a=c=b.Control.call(this,c,f)||this;a.controls=f.controls||!0;a.file=f.file||"";a.oldDrawIf=0;d=a.evaluator;f=d.eval(a.expresion)[0];4==f.length?(a.w=f[2],a.h=f[3]):(a.w=null,a.h=null);f=a.file;var l=f.lastIndexOf(".");-1!=l&&(f=a.file.substring(0,l));a.video=b.newHTML("video",{poster:f+".png",style:"position:absolute;overflow:hidden;left:"+a.x+"px;top:"+a.y+"px;outline:none;background:rgba(0,0,0,0);"});a.autoplay&&a.video.setAttribute("autoplay",
"autoplay");a.loop&&a.video.setAttribute("loop","loop");a.controls&&a.video.setAttribute("controls","controls");a.w&&(a.video.setAttribute("width",a.w),a.video.setAttribute("height",a.h));a.video.canPlayType("video/mp4")&&(l=b.newHTML("source",{src:f+".mp4",type:"video/mp4"}),a.video.appendChild(l));a.video.canPlayType("video/ogg")&&(l=b.newHTML("source",{src:f+".ogg",type:"video/ogg"}),a.video.appendChild(l),l=b.newHTML("source",{src:f+".ogv",type:"video/ogg"}),a.video.appendChild(l));a.video.canPlayType("video/webm")&&
(l=b.newHTML("source",{src:f+".webm",type:"video/webm"}),a.video.appendChild(l));a.addControlContainer(a.video);d.setFunction(a.id+".play",function(){try{a.video.play()}catch(n){}return 0});d.setFunction(a.id+".pause",function(){try{a.video.pause()}catch(n){}return 0});d.setFunction(a.id+".stop",function(){try{a.video.pause(),a.video.currentTime=0}catch(n){}return 0});d.setFunction(a.id+".currentTime",function(b){try{a.video.currentTime=parseFloat(b)}catch(m){}return 0});a.video.addEventListener("timeupdate",
function(b){d.setVariable(a.id+".currentTime",a.video.currentTime)});return c};$jscomp.inherits(p,b.Control);p.prototype.init=function(){this.video.style.left=this.x+"px";this.video.style.top=this.y+"px";this.update()};p.prototype.update=function(){a=this;d=a.evaluator;(h=0<d.eval(a.drawif))?a.video.style.display="block":(a.video.style.display="none",h!==a.oldDrawIf&&a.video.pause());a.oldDrawIf=h;a.updatePositionAndSize()};b.Video=p;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c=function(c,d){var f;a=f=b.Control.call(this,c,d)||this;a.font_family=d.font_family||"sansserif";a.style=d.style||",PLAIN,";a.font_size=d.font_size||12;typeof("number"!==a.font_size)&&(a.font_size=a.evaluator.eval(a.font_size));a.font=a.font_family+a.style+a.font_size;a.evaluator.setVariable(a.id+"._scroll_x",0);a.evaluator.setVariable(a.id+"._scroll_y",0);a.region="interior";a.tabindex=++c.tabindex;a.answer&&(/^krypto_/.test(a.answer)&&(a.answer=
(new b.Krypto).decode(a.answer.substring(7))),a.parent.lessonParser.parseText(a.answer));a.containerControl=b.newHTML("div",{class:"DescartesTextAreaContainer",id:a.id,spellcheck:"false"});a.textArea=b.newHTML("textarea",{class:"DescartesTextArea",spellcheck:"false"});a.textAreaAnswer=b.newHTML("div",{class:"DescartesTextArea"});a.showButton=b.newHTML("div",{class:"DJS_Gradient"});a.containerControl.appendChild(a.textArea);a.containerControl.appendChild(a.textAreaAnswer);a.containerControl.appendChild(a.showButton);
a.cover=b.newHTML("div",{class:"TextfieldCover"});a.keyboard&&a.containerControl.appendChild(a.cover);a.addControlContainer(a.containerControl);a.showAnswer=!1;a.text=a.rawText||"";a.evaluator.setVariable(a.id,a.text);var m;a.evaluator.setFunction(a.id+".insertAtCursor",function(b){m=a.textArea.selectionStart+b.length;a.textArea.value=a.textArea.value.substring(0,a.textArea.selectionStart)+b+a.textArea.value.substring(a.textArea.selectionEnd);a.textArea.selectionStart=a.textArea.selectionEnd=m;a.textArea.focus();
return 0});a.evaluator.setFunction(a.id+".update",function(){a.update()});a.evaluator.setFunction(a.id+".scrollTo",function(b){a.textArea.scrollTop=b});a.addEvents();a.init();return f};$jscomp.inherits(c,b.Control);c.prototype.init=function(){a=this;h=a.answer?30:7;d=a.evaluator;var c=a.text.replace(/\\n/g,"\n");a.containerControl.setAttribute("style","width:"+a.w+"px;height:"+a.h+"px;left:"+a.x+"px;top:"+a.y+"px;z-index:"+a.zIndex+";");var l="width:"+(a.w-6)+"px;height:"+(a.h-h)+"px;font:"+b.convertFont(a.font)+
";line-height:"+a.font_size+"px;";a.textArea.setAttribute("style",l);a.textArea.value=c;a.textAreaAnswer.setAttribute("style",l+"display:"+(a.showAnswer?"block":"none")+";");a.textAreaAnswer.innerHTML="<span>"+a.answer+"</span>";a.showButton.setAttribute("style","text-align:center;width:20px;height:16px;position:absolute;bottom:4px;right:4px;cursor:pointer;border:1px outset #c0c0c0;display:"+(a.answer?"block":"none")+";");a.showButton.innerHTML='<span style="position:relative;top:1px;text-align:center;font:11px '+
b.sansserif_font+';">S</span>';a.cover.setAttribute("style","position:absolute;width:"+a.w+"px;height:"+a.h+"px;left:0px;top:0px;");a.update()};c.prototype.update=function(){a=this;d=a.evaluator;a.activeIfVal=0<d.eval(a.activeif);a.drawIfVal=0<d.eval(a.drawif);d.getVariable(a.id)!==a.oldValue&&(a.textArea.value=(d.getVariable(a.id)||"").replace(/\\n/g,"\n"));p=a.textArea.value||"";p="\n"===p.charAt(p.length-1)?p.substring(0,p.length-1):p;p=p.replace(/\n/g,"\\n").replace(/\s/g," ");d.setVariable(a.id,
p);a.oldFieldValue=p;a.oldValue=d.getVariable(a.id);a.activeIfVal?a.textArea.removeAttribute("disabled"):a.textArea.setAttribute("disabled",!0);a.containerControl.style.display=a.drawIfVal?"block":"none";a.textArea.style["overflow-x"]=0<d.getVariable(a.id+"._scroll_x")?"auto":"unset";a.textArea.style["overflow-y"]=0<d.getVariable(a.id+"._scroll_y")?"auto":"unset";a.updatePositionAndSize()};c.prototype.changeValue=function(a){this.textArea.value=a;this.update()};c.prototype.addEvents=function(){var a=
this;a.showButton.addEventListener("mousedown",function(b){b.preventDefault();a.showAnswer=!a.showAnswer;a.textAreaAnswer.style.display=a.showAnswer?"block":"none";a.showButton.childNodes[0].childNodes[0].textContent=a.showAnswer?"T":"S";a.textArea.blur()});a.showButton.onmouseup=a.showButton.onmouseout=function(a){a.preventDefault()};a.textArea.addEventListener("blur",function(){a.cursorInd=window.getSelection().focusOffset});a.textArea.addEventListener("paste",function(a){a.preventDefault();document.execCommand("insertHTML",
!1,a.clipboardData.getData("text/plain").replace(/\n/g,"<br>"))});a.textArea.addEventListener("keydown",function(a){if("PageDown"===a.key||"PageUp"===a.key)a.stopPropagation(),a.preventDefault()});a.cover.addEventListener("pointerdown",function(b){b=a.evaluator.eval(a.kbexp);a.activeIfVal&&a.parent.keyboard.show(a,a.kblayout,b[0][0]||0,b[0][1]||0,a.id,a.textArea,!0)})};b.TextArea=c;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d=2*Math.PI,h,p,c,f,l,n,m,g,q,e,r,x,y=function(c,d){var g=b.Control.call(this,c,d)||this;p=c.evaluator.parser;a=g;a.spaceID=d.spaceID||"";a.text=d.text||"";a.size=d.size||p.parse("4");a.font=d.font||"Serif,PLAIN,12";a.image=new Image;a.image.onload=function(){this.ready=1};a.imageSrc=d.imageSrc||"";/^\[.*\]$/.test(a.imageSrc)?a.imageSrc=a.parser.parse(a.imageSrc.slice(1,-1)):a.imageSrc=a.parser.parse("'"+a.imageSrc+"'");a.font=b.convertFont(a.font);
if(a.constraintExpr){a.constraint=p.parse(a.constraintExpr);"(expr)"==a.constraint.type&&(a.constraint=p.parse(a.constraintExpr.substring(1,a.constraintExpr.length-1)));if("compOperator"==a.constraint.type){d=a.constraint.childs[0];var f=a.constraint.childs[1];"identifier"!=d.type||"y"!=d.value||f.contains("y")?"identifier"!=d.type||"x"!=d.value||f.contains("x")?a.newt=new b.R2Newton(a.evaluator,a.constraint):(a.constVar="y",a.noConstVar="x",a.evalConst=a.evalConstXoY,a.constraint=f):(a.constVar=
"x",a.noConstVar="y",a.evalConst=a.evalConstXoY,a.constraint=f)}else a.constraint=null;e=new b.R2(0,0)}a.container=a.getContainer();a.mouseCatcher=b.newHTML("div",{class:"DescartesGraphicControl",id:a.id,dragged:!0,tabindex:"-1",style:"z-index:"+a.zIndex+";"});a.ctx=a.space.ctx;a.container.appendChild(a.mouseCatcher);a.addEvents();a.xStr=a.id+".x";a.yStr=a.id+".y";a.activoStr=a.id+".activo";a.activeStr=a.id+".active";c=""!==a.space.id&&2!==c.version?a.space.id+".":"";a.mX=c+"mouse_x";a.mY=c+"mouse_y";
a.mClicked=c+"mouse_clicked";a.mClicIzq=c+"clic_izquierdo";a.init();return g};$jscomp.inherits(y,b.Control);y.prototype.init=function(c){a=this;h=a.evaluator;r=b.hasTouchSupport;c||(c=h.eval(a.expresion)[0],a.x=c[0],a.y=c[1],h.setVariable(a.xStr,a.x),h.setVariable(a.yStr,a.y));a.img_src_eval=h.eval(a.imageSrc).toString().trim();""==a.img_src_eval||/vacio.gif$/i.test(a.img_src_eval)?(a.width=2*h.eval(a.size),a.height=2*h.eval(a.size),a._w=r&&48>a.width?48:a.width,a._h=r&&48>a.height?48:a.height,a.mouseCatcher.style.borderRadius=
parseInt(Math.min(a._w,a._h)/2)+"px"):(a.image=a.parent.getImage(a.img_src_eval),a.width=a.image.width,a.height=a.image.height,a._w=Math.max(a.width,32),a._h=Math.max(a.height,32));a.mouseCatcher.style.width=a._w+"px";a.mouseCatcher.style.height=a._h+"px";a.mouseCatcher.style.left=parseInt(a.space.getAbsoluteX(a.x)-a._w/2)+"px";a.mouseCatcher.style.top=parseInt(a.space.getAbsoluteY(a.y)-a._h/2)+"px";h.setVariable(a.activoStr,0);h.setVariable(a.activeStr,0);a.setImage=!1;a.update()};y.prototype.update=
function(){a=this;h=a.evaluator;h.eval(a.imageSrc).toString().trim()!==a.img_src_eval&&a.init(!0);a.activeIfVal=0<h.eval(a.activeif);a.drawIfVal=0<h.eval(a.drawif);a.x=h.getVariable(a.xStr);a.y=h.getVariable(a.yStr);c=a.space.getAbsoluteX(a.x);f=a.space.getAbsoluteY(a.y);a.mouseCatcher.style.display=a.activeIfVal?"block":"none";a.mouseCatcher.style.left=parseInt(c-a._w/2)+"px";a.mouseCatcher.style.top=parseInt(f-a._h/2)+"px";a.constraint&&a.evalConst();a.draw()};y.prototype.draw=function(){a=this;
h=a.evaluator;a.drawIfVal&&(g=a.ctx,q=a.space.backgroundCtx,c=parseInt(a.space.getAbsoluteX(this.x))+.5,f=parseInt(a.space.getAbsoluteY(this.y))+.5,""!=a.text&&a.drawText(c,f),a.image.ready?(l=a.image.width/2,n=a.image.height/2,a.image.complete&&!a.setImage&&g.drawImage(a.image,parseInt(c-l),parseInt(f-n)),a.trace&&(q.save(),q.translate(c,f),q.scale(parseInt(l),parseInt(n)),q.beginPath(),q.arc(0,0,1,0,d),q.restore(),q.lineWidth=1,q.strokeStyle=a.trace.getColor(),q.stroke())):(l=parseInt(a.width/2),
g.beginPath(),g.arc(c,f,l,0,d),g.fillStyle=a.colorInt.getColor(),g.fill(),g.lineWidth=1,g.strokeStyle=a.color.getColor(),g.stroke(),a.active&&(g.strokeStyle=a.colorInt.borderColor(),g.beginPath(),g.arc(c,f,l-2,0,d),g.stroke()),a.trace&&(q.strokeStyle=a.trace.getColor(),q.beginPath(),q.arc(c,f,l,0,d),q.stroke())))};y.prototype.evalConst=function(){e.set(this.x,this.y);m=this.newt.findZero(e,1/this.space.scale,!0);this.x=m.x;this.y=m.y;this.evaluator.setVariable(this.xStr,this.x);this.evaluator.setVariable(this.yStr,
this.y)};y.prototype.evalConstXoY=function(){h=this.evaluator;x=h.getVariable(this.constVar);h.setVariable(this.constVar,this[this.constVar]);this[this.noConstVar]=h.eval(this.constraint);h.setVariable(this.xStr,this.x);h.setVariable(this.yStr,this.y);h.setVariable(this.constVar,x)};y.prototype.drawText=function(b,c){a=this;h=a.evaluator;g=a.ctx;g.fillStyle=a.color.getColor();g.textBaseline="alphabetic";"simpleText"==a.text.type?(g.font=a.font,g.fillText(a.text.toString(h.eval(a.decimals),a.fixed),
parseInt(b+1+a.width/2),parseInt(c-1-a.height/2))):(g.strokeStyle=a.color.getColor(),a.text.draw(g,parseInt(b+1+a.width/2),parseInt(c-1-a.height/2),a.decimals,a.fixed,"start",!0,a.color.getColor()))};y.prototype.getContainer=function(){for(var a=this.parent.spaces,b=$jscomp.makeIterator(a),c=b.next();!c.done;c=b.next())if(c=c.value,c.id==this.spaceID)return c.addCtr(this),this.zIndex=c.zIndex,this.space=c,c.graphicControlContainer;a[0].addCtr(this);this.zIndex=a[0].zIndex;this.space=a[0];return a[0].graphicControlContainer};
y.prototype.deactivate=function(){this.active=!1;this.evaluator.setVariable(this.activoStr,0);this.evaluator.setVariable(this.activeStr,0);this.evaluator.setVariable(this.mClicIzq,0)};y.prototype.addEvents=function(){function a(a){document.body.focus();a.preventDefault();f.whichBtn=b.whichBtn(a);"L"==f.whichBtn&&f.activeIfVal&&(f.parent.deactivateControls(),f.click=f.active=!0,f.evaluator.setVariable(f.activoStr,1),f.evaluator.setVariable(f.activeStr,1),f.evaluator.setVariable(f.mClicked,0),f.evaluator.setVariable(f.mClicIzq,
0),f.posAnte=b.getCursorPosition(a,f.container),f.prePos={x:f.space.getAbsoluteX(f.x),y:f.space.getAbsoluteY(f.y)},f.evaluator.setVariable(f.mX,f.space.getRelativeX(f.posAnte.x)),f.evaluator.setVariable(f.mY,f.space.getRelativeY(f.posAnte.y)),f.parent.update(),window.addEventListener("touchend",c),window.addEventListener("touchmove",d),window.addEventListener("mouseup",c),window.addEventListener("mousemove",d))}function c(a){document.body.focus();a.preventDefault();a.stopPropagation();f.evaluator.setVariable(f.mClicked,
1);f.evaluator.setVariable(f.mClicIzq,1);if(f.activeIfVal||f.active)f.click=!1,window.removeEventListener("mouseup",c),window.removeEventListener("mousemove",d),window.removeEventListener("touchend",c),window.removeEventListener("touchmove",d),e=b.getCursorPosition(a,f.container)||e,f.posX=f.prePos.x-(f.posAnte.x-e.x),f.posY=f.prePos.y-(f.posAnte.y-e.y),f.evaluator.setVariable(f.xStr,f.space.getRelativeX(f.posX)),f.evaluator.setVariable(f.yStr,f.space.getRelativeY(f.posY)),f.evaluator.setVariable(f.mX,
f.space.getRelativeX(e.x)),f.evaluator.setVariable(f.mY,f.space.getRelativeY(e.y)),f.parent.updateControls(),f.parent.update(),f.mouseCatcher.style.left=f.space.getAbsoluteX(f.x)-f._w/2+"px",f.mouseCatcher.style.top=f.space.getAbsoluteY(f.y)-f._h/2+"px";a=f.evaluator.getVariable(f.activeStr);f.parent.deactivateControls();f.parent.updateControls();f.evaluator.setVariable(f.activoStr,a);f.evaluator.setVariable(f.activeStr,a);f.parent.update()}function d(a){a.preventDefault();f.evaluator.setVariable(f.mClicked,
0);f.evaluator.setVariable(f.mClicIzq,0);e=b.getCursorPosition(a,f.container);f.posX=f.prePos.x-(f.posAnte.x-e.x);f.posY=f.prePos.y-(f.posAnte.y-e.y);f.evaluator.setVariable(f.xStr,f.space.getRelativeX(f.posX));f.evaluator.setVariable(f.yStr,f.space.getRelativeY(f.posY));f.evaluator.setVariable(f.mX,f.space.getRelativeX(e.x));f.evaluator.setVariable(f.mY,f.space.getRelativeY(e.y));80<Date.now()-g&&(f.parent.updateControls(),f.parent.update(),g=Date.now())}var g=0,e,f=this;f.click=!1;f.over=!1;f.active=
!1;f.mouseCatcher.addEventListener("touchstart",a);f.mouseCatcher.addEventListener("mousedown",a);f.mouseCatcher.addEventListener("mouseover",function(a){f.over=!0});f.mouseCatcher.addEventListener("mouseout",function(a){f.over=!1;f.click=!1})};b.GraphicControl=y;return b}(descartesJS||{});
descartesJS=function(b,a){function d(a){return a?a[0].toUpperCase()+a.substring(1):""}if(b.loadLib)return b;var h=/[\w-//]*(\.png|\.jpg|\.gif|\.svg|\.webp)/gi,p,c,f,l,n,m,g,q,e,r,x,y,u,v,A,w,z=function(a){this.parent=a;this.parser=a.evaluator.parser;this.RTFparser=new b.RTFParser(a.evaluator)};z.prototype.parseButtonsConfig=function(b){var d={rowsNorth:0,rowsSouth:0,widthEast:125,widthWest:125,height:23};b=this.split(b);for(var g=0,e=b.length;g<e;g++)switch(f=b[g][0],l=b[g][1],c=a[f],c){case "rowsNorth":case "rowsSouth":case "widthEast":case "widthWest":case "height":d[c]=
parseInt(l);break;case "about":case "config":case "init":case "clear":d[c]="true"===a[l];break;default:console.warn("Propiedad de botones no identificada: <"+f+"> valor: <"+l+">")}return d};z.prototype.parseSpace=function(d){n={};d=this.split(d);for(var g=0,e=d.length;g<e;g++)switch(f=d[g][0],l=d[g][1],c=a[f],b.DEBUG.pName=f,b.DEBUG.objectName="Space",c){case "info":break;case "type":if("R2"===l||"R3"===l)l=a[l];n[c]=l;break;case "id":b.DEBUG.idName=l;case "x_axis":case "y_axis":case "cID":case "file":case "border_width":case "border_radius":n[c]=
l;break;case "fixed":case "numbers":case "sensitive_to_mouse_movements":case "3D":case "split":case "resizable":n[c]="true"===a[l];break;case "bg_display":case "render":n[c]=a[l];break;case "border_color":case "net":case "net10":case "axes":case "text":n[c]="";""!=l&&(n[c]="false"===a[l]?"":new b.Color(l,this.parent.evaluator));break;case "O.x":n.OxExpr=l;break;case "O.y":n.OyExpr=l;break;case "image":n.imageSrc=l;break;case "x":case "y":p=l.trim();/%$/.test(p)&&(n[c+"PercentExpr"]=p,p=(this.parent.container.width*
parseFloat(p)/100).toString());n[c+"Expr"]=this.parser.parse(p);break;case "width":case "height":p=l.trim();n[c[0]+"ModExpr"]=p;/%$/.test(p)?(n[c[0]+"Expr"]=p,p=this.parent.container.width*parseFloat(p)/100):(p=parseFloat(l),p!=l&&(p=this.parent.container.width,n["_"+c[0]+"_"]=l.trim()));n[c[0]]=p;break;case "drawif":""!=l&&(n[c]=this.parser.parse(l));break;case "scale":p=parseFloat(l);isNaN(p)&&(p=48);n[c]=p;break;case "background":n[c]=new b.Color(l,this.parent.evaluator);break;default:console.warn("Propiedad del espacio no identificada: <"+
f+"> valor: <"+l+">")}return new b["Space"+n.type](this.parent,n)};z.prototype.parseControl=function(g){m={type:"Numeric",gui:"Spinner"};g=this.split(g);for(var e=0,h=g.length;e<h;e++)switch(f=g[e][0],l=g[e][1],c=a[f],b.DEBUG.pName=f,b.DEBUG.objectName="Control",c){case "info":break;case "type":p=a[l.trim()];"graphic"===p?p="GraphicControl":"text"===p&&(p="TextArea");m[c]=d(p);break;case "gui":p=a[l];"textfield"===p&&(p="TextField");m[c]=d(p);break;case "id":b.DEBUG.idName=l;case "name":case "parameter":case "tooltip":case "tooltipFont":case "Explanation":case "ExplanationFont":case "cID":case "options":case "font":case "font_family":case "file":case "answer":case "cssClass":case "radio_group":case "extra_style":case "kblayout":m[c]=
l;break;case "region":case "position":case "action":case "msg_pos":case "poster":case "text_align":case "image_align":case "btn_pos":m[c]=a[l];break;case "fixed":case "visible":case "discrete":case "onlyText":case "evaluate":case "autoplay":case "loop":case "controls":case "flat":case "keyboard":m[c]="true"===a[l];break;case "color":case "colorInt":case "label_color":case "label_text_color":case "trace":m[c]=new b.Color(l,this.parent.evaluator);break;case "font_size":case "drawif":case "activeif":case "decimals":case "min":case "max":case "size":""!==
l&&(m[c]=this.parser.parse(l));break;case "constraint":m.constraintExpr=l;break;case "image":m.imageSrc=l;break;case "image_dec":m.imgDecSrc=l;break;case "image_inc":m.imgIncSrc=l;break;case "space":m.spaceID=l;break;case "expresion":case "kbexp":m[c]=this.parser.parse(l.replace(")(",","));break;case "borderColor":m[c]="false"===a[l]?"":l;break;case "bold":case "italics":"false"!=a[l]&&(m[c]=c);break;case "underlined":"false"!=a[l]&&(m[c]=!0);break;case "value":var q=l.replace(/&squot;/g,"'").replace(/^\|(.*)\|$/,
"'$1'");m.valueExpr=this.parser.parse(q);m.valueexpresionStringing=q;break;case "incr":0!=l&&(m[c]=this.parser.parse(l));break;case "exponentialif":m[c]=parseFloat(l);break;case "text":m.rawText=l;q=this.parseText(l);for(var n=0,r=q.length;n<r;n++)q[n]=this.parser.parse(q[n],!1);m[c]=q;break;default:q=f.indexOf("."),n=a[f.substring(0,q)],"font"===a[f.substring(q+1)]&&/parameter|Explanation|tooltip/.test(n)?m[n+"Font"]=l:console.warn("Propiedad de control no identificada: <"+f+"> valor: <"+l+">")}return new b["Numeric"===
m.type?m.gui:m.type](this.parent,m)};z.prototype.parseGraphic=function(e,m,q,p){g={rotateExp:p,parameter:"t"};e=this.split(e);p=0;for(var n=e.length;p<n;p++)if(f=e[p][0],l=e[p][1],c=a[f],b.DEBUG.pName=f,b.DEBUG.objectName="Graphic",""!=l)switch(c){case "info":break;case "type":b.DEBUG.idName=l;g[c]=d(a[l]);break;case "align":case "anchor":case "lineDash":g[c]=a[l];break;case "background":case "abs_coord":case "visible":case "editable":case "fixed":case "vectors":case "bold":case "italics":case "underlined":g[c]=
"true"===a[l];break;case "shadowColor":case "color":case "fill":case "fillP":case "fillM":case "arrow":case "trace":g[c]="false"===a[l]?"":new b.Color(l,this.parent.evaluator);break;case "border_size":case "shadowBlur":case "shadowOffsetX":case "shadowOffsetY":case "family":case "parameter":case "font":case "font_family":case "name":case "init":case "end":g[c]=l;break;case "drawif":case "width":case "decimals":case "size":case "spear":case "center":case "radius":case "border_radius":case "opacity":case "inirot":case "inipos":case "range":case "clip":""!==
l&&(g[c]=this.parser.parse(l));break;case "font_size":l=l.trim();/^\[.*\]$/.test(l)&&(l=l.slice(1,-1));""!==l&&(g[c]=this.parser.parse(l));break;case "space":g[c+"ID"]=l;break;case "expresion":""!==l&&("Macro"!==g.type?(g[c]=this.parser.parse(l),g.expresionString=l):g[c]=l);break;case "text":g[c]=l;break;case "file":var r=l.replace(/&squot;/g,"'").trim();/^\[.*\]$/.test(r)&&(r=r.slice(1,-1));r.match(h)&&(r="'"+r+"'");r.startsWith("data:image/")?g[c]=this.parser.parse("'"+r+"'"):g[c]=this.parser.parse(r);
break;case "border":""!=l&&"false"!=a[l]&&(g[c]=new b.Color(l,this.parent.evaluator));break;default:if(void 0!=g.family&&(r=g.family.length+1,f.substring(0,r)===g.family+".")){r=a[f.substring(r)];/interval|steps/.test(r)&&""!=l&&(g["family_"+r]=this.parser.parse(l));break}void 0!=g.parameter&&f.match(g.parameter+".")?(r=f.substring(0,f.indexOf(g.parameter)+g.parameter.length),g.parameter!==r&&(g.parameter=r),r=a[f.substring(g.parameter.length+1)],/interval|steps/.test(r)&&""!=l&&(g["parameter_"+r]=
this.parser.parse(l))):console.warn("Propiedad del gr\u00e1fico no identificada: <"+f+"> valor: <"+l+">")}m&&(g.abs_coord=m);q&&(g.background=q);return new b[g.type](this.parent,g)};z.prototype.parse3DGraphic=function(e,m,h,q){g={rotateExp:q,parameter:"t"};e=this.split(e);m=0;for(h=e.length;m<h;m++)switch(f=e[m][0],l=e[m][1],c=a[f],b.DEBUG.pName=f,b.DEBUG.objectName="Graphic3D",c){case "info":break;case "type":b.DEBUG.idName=l;p=a[l];g[c]=d(p);break;case "model":case "align":case "anchor":case "lineDash":g[c]=
a[l];break;case "shadowColor":case "fill":g[c]="false"===a[l]?"":new b.Color(l,this.parent.evaluator);break;case "background":case "fixed":case "split":case "bold":case "italics":case "underlined":g[c]="true"===a[l];break;case "edges":"false"===a[l]?g[c]="":("true"===a[l]&&(l="808080"),g[c]=new b.Color(l,this.parent.evaluator));break;case "border":""!=l&&"false"!=a[l]&&(g[c]=new b.Color(l,this.parent.evaluator));break;case "color":case "backcolor":g[c]=new b.Color(l,this.parent.evaluator);break;case "drawif":case "width":case "length":case "height":case "R":case "r":case "decimals":case "Nu":case "Nv":case "inipos":case "endpos":case "offset_angle":case "offset_dist":case "font_size":""!=
l&&(g[c]=this.parser.parse(l));break;case "border_size":case "shadowBlur":case "shadowOffsetX":case "shadowOffsetY":case "family":case "parameter":case "font":case "font_family":case "name":case "inirot":case "endrot":g[c]=l;break;case "space":g.spaceID=l;break;case "expresion":"Macro"!=g.type&&"Curve"!=g.type&&"Surface"!=g.type?(g[c]=this.parser.parse(l),g.expresionString=l):g[c]=l.replace(/\\n/g,";");break;case "text":g[c]=l;break;case "file":q=l.replace(/&squot;/g,"'").trim();/^\[.*\]$/.test(q)&&
(q=q.slice(1,-1));/./.test(q)&&(q="'"+q+"'");g[c]=this.parser.parse(q);break;default:if(void 0!=g.family&&(q=g.family.length+1,f.substring(0,q)===g.family+".")){q=a[f.substring(q)];/interval|steps/.test(q)&&""!=l&&(g["family_"+q]=this.parser.parse(l));break}console.warn("Propiedad del gr\u00e1fico 3D no identificada: <"+f+"> valor: <"+l+">")}return new b[g.type+"3D"](this.parent,g)};z.prototype.parseAuxiliar=function(d){q={};d=this.split(d);for(var g=0,e=d.length;g<e;g++)d[g][1]=d[g][1].replace(/&squot;/g,
"'");g=0;for(e=d.length;g<e;g++)switch(f=d[g][0],l=d[g][1],c=a[f],b.DEBUG.pName=f,b.DEBUG.objectName="Auxiliar",c){case "info":case "code":case "doc":break;case "id":b.DEBUG.idName=l;case "file":case "init":case "doExpr":case "whileExpr":case "range":case "local":case "expresion":case "condition":case "parameter":q[c]=l.replace(/&squot;/g,"'");break;case "editable":case "constant":case "array":case "matrix":case "algorithm":case "event":case "sequence":q[c]="true"===a[l];break;case "size":case "rows":case "columns":case "x":case "y":case "width":case "height":q[c]=
this.parser.parse(l);break;case "evaluate":case "execution":case "msg_pos":case "action":case "type":q[c]=a[l];break;default:var m=f.indexOf("."),h=a[f.substring(0,m)];m=a[f.substring(m+1)];"parameter"===h&&"font"===m?q[h+"Font"]=l:console.warn("Propiedad del auxiliar no identificada: <"+f+"> valor: <"+l+">")}q.sequence?q.type="sequence":q.constant?q.type="constant":q.algorithm&&q.evaluate?q.type="algorithm":q.array&&!q.matrix&&")"!=q.id.charAt(q.id.length-1)?q.type="vector":q.matrix&&")"!=q.id.charAt(q.id.length-
1)?q.type="matrix":q.event&&")"!=q.id.charAt(q.id.length-1)?q.type="event":"library"===q.type?q.type="library":")"===q.id.charAt(q.id.length-1)?q.type="function":q.type="variable";b.DEBUG.typeName=q.type;switch(q.type){case "sequence":new b.Function(this.parent,q);break;case "constant":d=new b.Constant(this.parent,q);q.evaluate&&"always"===q.evaluate&&this.parent.auxiliaries.push(d);break;case "algorithm":this.parent.auxiliaries.push(new b.Algorithm(this.parent,q));break;case "vector":d=new b.Vector(this.parent,
q);q.evaluate&&"always"===q.evaluate&&this.parent.auxiliaries.push(d);break;case "matrix":d=new b.Matrix(this.parent,q);q.evaluate&&"always"===q.evaluate&&this.parent.auxiliaries.push(d);break;case "event":this.parent.events.push(new b.Event(this.parent,q));break;case "library":new b.Library(this.parent,q);break;case "variable":new b.Variable(this.parent,q);break;default:new b.Function(this.parent,q)}};z.prototype.parseAction=function(a){return a.action?new (b[d(a.action)])(a.parent,a.parameter):
{execute:function(){}}};z.prototype.parseAnimation=function(d){var g={};d=this.split(d);for(var e=0,m=d.length;e<m;e++)switch(f=d[e][0],l=d[e][1],c=a[f],b.DEBUG.pName=f,b.DEBUG.objectName="Animation",c){case "info":break;case "id":case "delay":case "init":case "doExpr":case "whileExpr":g[c]=l.replace(/&squot;/g,"'");break;case "controls":case "auto":case "loop":case "algorithm":case "evaluate":g[c]="true"===a[l];break;default:console.warn("Propiedad de la animaci\u00f3n no identificada: <"+f+"> valor: <"+
l+">")}return new b.Animation(this.parent,g)};z.prototype.split=function(a){if("string"!==typeof a)return[];e=[];a=(a||"").replace(/\\'/g,"\u2019");r=x=u=0;for(y=v=!1;r<a.length;)" "!==a[r]||y||r++," "===a[r]||y||(y=!0,u=r),"="!==a[r]||"'"!==a[r+1]||v||(v=!0,e[x]=[a.substring(u,r)],u=r+2,r+=2),v&&"'"===a[r]&&(y=v=!1,e[x].push(a.substring(u,r)),x++),"="!==a[r]||"'"===a[r+1]||v||(e[x]=[a.substring(u,r)],u=r+1,r++,A=a.substring(r).indexOf("="),-1===A?A=w=a.length:(A+=r,w=a.substring(r,A).lastIndexOf(" "),
w=-1===w?a.length:w+r),e[x].push(a.substring(u,w)),x++,y=!1,r=w),r++;return e};z.prototype.parseText=function(a){a=void 0===a?"":a;return/^\{\\rtf1/.test(a)?this.RTFparser.parse(a.substring(10)):new b.SimpleText(this.parent,a)};b.LessonParser=z;return b}(descartesJS||{},babel);
descartesJS=function(b){function a(){return parseFloat(this.value)}function d(){return this.value.replace(/\\u0027/g,"'")}function h(a,b){var c=a.variables[this.value];if("object"===typeof c&&void 0==c.length)return c.evaluate(a);void 0==c&&(b||a.matrices[this.value]?c=a.matrices[this.value]:a.vectors[this.value]&&(c=a.vectors[this.value]));return void 0!==c?c:0}function p(a){try{var b=a.getVector(this.value,this.childs[0].childs[0].evaluate(a));return void 0!==b?b:0}catch(ba){return 0}}function c(a){try{var b=
a.getMatrix(this.value,this.childs[0].childs[0].evaluate(a),this.childs[0].childs[1].evaluate(a));return void 0!==b?b:0}catch(ba){return 0}}function f(a){return a.functions[this.value].apply(a,this.childs[0].childs.map(function(b){return b.evaluate(a)}))}function l(a){var c=this.childs[0].evaluate(a,!0);a=this.childs[1].evaluate(a,!0);if("matrix"!==c.type||"matrix"!==a.type)return"number"==typeof c&&"string"==typeof a?c=b.removeNeedlessDecimals(c.toString()):"string"==typeof c&&"number"==typeof a&&
(a=b.removeNeedlessDecimals(a.toString())),c+a;X=c.rows;U=c.cols;S=O(X,U);for(T=0;T<X;T++)for(W=0;W<U;W++)S[W][T]=c[W][T]+a[W][T];return S}function n(a){var b=this.childs[0].evaluate(a,!0);a=this.childs[1].evaluate(a,!0);if("matrix"!==b.type||"matrix"!==a.type)return b-a;X=b.rows;U=b.cols;S=O(X,U);for(T=0;T<X;T++)for(W=0;W<U;W++)S[W][T]=b[W][T]-a[W][T];return S}function m(a){var b=this.childs[0].evaluate(a,!0);a=this.childs[1].evaluate(a,!0);return"matrix"!==b.type||"matrix"!==a.type?b*a:M(b,a)}function g(a){var b=
this.childs[0].evaluate(a,!0);a=this.childs[1].evaluate(a,!0);if("matrix"!==b.type||"matrix"!==a.type)return b/a;var c=O(a.length,a.length),d=E(a);if(0===d)a=0;else{d=1/d;if(1<a.length)for(var g=0,e=a.length;g<e;g++){var f=d;for(var m=0;m<e;m++)c[m][g]=f*E(P(g,m,a)),f=-f;d=-d}else c[0][0]=d;a=c}b=0===a?O(b.rows,b.cols):M(b,a);return b}function q(a){var b=this.childs[0].evaluate(a);a=this.childs[1].evaluate(a);return b-L(b/a)*a}function e(a){var b=this.childs[0].evaluate(a);a=this.childs[1].evaluate(a);
return 0<=a?R(b,a):1/R(b,-a)}function r(a){return+(this.childs[0].evaluate(a)<this.childs[1].evaluate(a))}function x(a){return+(this.childs[0].evaluate(a)<=this.childs[1].evaluate(a))}function y(a){return+(this.childs[0].evaluate(a)>this.childs[1].evaluate(a))}function u(a){return+(this.childs[0].evaluate(a)>=this.childs[1].evaluate(a))}function v(a){var b=this.childs[0].evaluate(a);a=this.childs[1].evaluate(a);return"number"==typeof b&&"number"==typeof a?+(1E-8>Math.abs(b-a)):+(b===a)}function A(a){var b=
this.childs[0].evaluate(a);a=this.childs[1].evaluate(a);return"number"==typeof b&&"number"==typeof a?+!(1E-8>Math.abs(b-a)):+(b!==a)}function w(a){return this.childs[0].evaluate(a)?this.childs[1].evaluate(a)?1:0:0}function z(a){return this.childs[0].evaluate(a)?1:this.childs[1].evaluate(a)?1:0}function B(a){return+!this.childs[0].evaluate(a)}function D(a){return 0<this.childs[0].evaluate(a)?this.childs[1].evaluate(a):this.childs[2]?this.childs[2].evaluate(a):0}function I(a){return this.childs[0].evaluate(a)}
function H(a){return-this.childs[0].evaluate(a)}function G(a,b){return this.childs[0].evaluate(a,b)}function F(a){return 1===this.childs.length&&1===this.childs[0].childs.length&&"(expr)"===this.type?this.childs[0].childs[0].evaluate(a):this.childs.map(function(b){return b.childs.map(function(b){return b.evaluate(a)})})}function C(a){var b=this.childs[0],c=b.childs[0]?b.childs[0].childs:null,d=this.childs[1].evaluate(a);a.setVector(b.value,c[0].evaluate(a),d);return d}function J(a){var b=this.childs[0],
c=b.childs[0]?b.childs[0].childs:null,d=this.childs[1].evaluate(a);a.setMatrix(b.value,c[0].evaluate(a),c[1].evaluate(a),d);return d}function Q(a){var b=this.childs[0],c=this.childs[1].evaluate(a);return c.type?a.matrices[b.value]=c:"object"!==typeof a.variables[b.value]?a.variables[b.value]=c:0}function R(a,b){if(0==b)return 1;if(0>b)return NaN;if(0<=a||L(b)===b)return Math.pow(a,b);if(0>a){var c=1/b,d=L(c);if(d===c&&1===d%2)return-Math.pow(-a,b)}return NaN}function O(a,b){S=[];S.type="matrix";S.rows=
a;S.cols=b;T=0;for(aa=b;T<aa;T++)S[T]=Array(a).fill(0);return S}function M(a,b){X=a.rows;U=a.cols;S=O(X,U);var c;for(T=0;T<X;T++)for(W=0;W<U;W++){for(aa=c=0;aa<U;aa++)c+=a[aa][T]*b[W][aa];S[W][T]=c}return S}function P(a,b,c){for(var d=O(c.length-1,c.length-1),g=0,e=d.length;g<e;g++)for(var f=0;f<e;f++)d[g][f]=g<a?f<b?c[g][f]:c[g][f+1]:g<b?c[g+1][f]:c[g+1][f+1];return d}function E(a){if(1<a.cols){for(var b=0,c=1,d=0,g=a.cols;d<g;d++)b+=c*a[0][d]*E(P(0,d,a)),c=-c;return b}return a[0][0]}if(b.loadLib)return b;
var L=Math.floor,K,N,V,Z,X,U,S,W,T,aa,Y=function(a,b){this.sep="";this.type=a;this.value=b;this.parent=null;this.childs=[]};Y.prototype.getRoot=function(){return null===this.parent?this:this.parent.getRoot()};Y.prototype.addChild=function(a){a.parent=this;this.childs.push(a)};Y.prototype.replaceLastChild=function(a){N=this.childs.length-1;K=this.childs[N];K.parent=null;this.childs[N]=a;a.parent=this;return a};Y.prototype.contains=function(a){return this.value===a?!0:this.childs.some(function(b){return b.contains(a)})};
Y.prototype.equalToMinus=function(){return"compOperator"===this.type?(this.type="operator",this.value="-",Z=new Y("compOperator","=="),Z.addChild(this),Z.addChild(new Y("number","0")),V=this.getRoot(),V.setAllEvalFun(),V):this};Y.prototype.getChildren=function(){if("(expr)"===this.type||"[expr]"===this.type){if(this.childArray)return this.childArray;this.childArray=[];for(var a=$jscomp.makeIterator(this.childs),b=a.next();!b.done;b=a.next())b=b.value,/square_bracket|parentheses/.test(b.type)&&this.childArray.push.apply(this.childArray,
$jscomp.arrayFromIterable(b.childs));return this.childArray}return null};Y.prototype.setAllEvalFun=function(){this.setEvalFun();for(var a=$jscomp.makeIterator(this.childs),b=a.next();!b.done;b=a.next())b.value.setAllEvalFun()};Y.prototype.setEvalFun=function(){if("number"===this.type)this.evaluate=a;else if("string"===this.type)this.evaluate=d;else if("identifier"===this.type&&0===this.childs.length)this.evaluate=h;else if("identifier"===this.type&&"square_bracket"===this.childs[0].type&&1===this.childs[0].childs.length)this.evaluate=
p;else if("identifier"===this.type&&"square_bracket"===this.childs[0].type&&1<this.childs[0].childs.length)this.evaluate=c;else if("identifier"===this.type&&"parentheses"===this.childs[0].type)this.evaluate=f;else if("operator"===this.type)"+"===this.value?this.evaluate=l:"-"===this.value?this.evaluate=n:"*"===this.value?this.evaluate=m:"/"===this.value?this.evaluate=g:"%"===this.value?this.evaluate=q:"^"===this.value&&(this.evaluate=e);else if("compOperator"===this.type)"<"===this.value?this.evaluate=
r:"<="===this.value?this.evaluate=x:">"===this.value?this.evaluate=y:">="===this.value?this.evaluate=u:"=="===this.value?this.evaluate=v:"!="===this.value&&(this.evaluate=A);else if("boolOperator"===this.type)"&"===this.value?this.evaluate=w:"|"===this.value?this.evaluate=z:"!"===this.value&&(this.evaluate=B);else if("conditional"===this.type)this.evaluate=D;else if("sign"===this.type)this.evaluate="sign+"===this.value?I:H;else if("parentheses"===this.type)this.evaluate=G;else if("(expr)"===this.type||
"[expr]"===this.type)this.evaluate=F;else if("assign"===this.type){var b=this.childs[0],T=b.childs[0]?b.childs[0].childs:null;this.evaluate=1===b.childs.length&&"square_bracket"===b.childs[0].type&&1===T.length?C:1===b.childs.length&&"square_bracket"===b.childs[0].type&&2===T.length?J:Q}};b.Node=Y;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l,n,m=/^\s+/,g=/^[a-zA-Z_\u00C0-\u021B\u0391-\u03C9]+[a-zA-Z_0-9\u00C0-\u021B\u0391-\u03C9]*([.]*[0-9a-zA-Z_\u00C0-\u021B\u0391-\u03C9]+[0-9]*)*/,q=/^([0-9]+[.][0-9]+|[.][0-9]+|[0-9]+)/,e=/^(==|!=|<=|<|>=|>|#)/,r=/^(!|~|&&|&|\|\||\|)/,x=/^(=|:=)/,y=/^[\?:]/,u=/^[\+\-\*\/%\^\u2212\u00b7\u00D7\u00F7]/,v=/^(\[|\])/,A=/^(\(|\))/,w=/^,/,z=/^;/,B=/\|/g,D=/\|\*/g,I=/\*\|/g,H=/^\/\//g,G=/:\/\//g,F,C=/rnd|pi|e|Infinity|-Infinity|sqr|sqrt|ra\u00edz|exp|log|log10|abs|ent|sgn|ind|sin|sen|cos|tan|cot|sec|csc|sinh|senh|cosh|tanh|coth|sech|csch|asin|asen|acos|atan|min|max/,
J=function(){};J.prototype.tokenize=function(C){function F(a,b,c){d.push({type:a,value:b});f=f.slice(c);p+=c;n=a}if(a=C){C=C.replace(/\\u(\S+) /g,function(a,b){return 39!==parseInt(b,16)?String.fromCharCode(parseInt(b,16)):a}).replace(/&sup(.+?);/g,"^$1 ").replace(/&squot;/g,"'").replace(/\brnd\b/g,"random()");C.match(/=\|\*/g)&&(C=C.replace(D,"'").replace(I,"'"));C.match(/=\|/g)&&(C=C.replace(B,"'"));var J=C.trim();"|"==J[0]&&"|"==J[J.length-1]&&(C=J.replace(B,"'"))}d=[];h=!1;p=0;f=C;for(n="";C&&
p<C.length;)if(h=p,"'"==f[0]){for(l=1;"'"!=f[l];)if(l<f.length)l++;else return;c=f.substring(1,l);F("string",c,c.length+2)}else{if(c=f.match(H))if(f.match(G))continue;else{p=2*C.length;break}if(c=f.match(m))f=f.slice(c[0].length),p+=c[0].length;else if(c=f.match(u))c[0]=c[0].replace(/\u00F7/g,"/").replace(/\u2212/g,"-").replace(/\u00b7/g,"*").replace(/\u00D7/g,"*"),F("operator",c[0],c[0].length);else if(c=f.match(g))"number"===n&&d.push({type:"operator",value:"*"}),F("identifier",c[0],c[0].length);
else if(c=f.match(q))F("number",c[0],c[0].length);else if(c=f.match(e))J=c[0],"#"==J&&(J="!="),F("compOperator",J,c[0].length);else if(c=f.match(r))J=c[0],"||"==J?J="|":"&&"==J?J="&":"~"==J&&(J="!"),F("boolOperator",J,c[0].length);else if((c=f.match(x))&&!/^==/.test(f))F("assign",c[0],c[0].length);else if(c=f.match(y))F("conditional",c[0],c[0].length);else if(c=f.match(v))F("square_bracket",c[0],c[0].length);else if(c=f.match(A))"("==c&&"number"===n&&d.push({type:"operator",value:"*"}),F("parentheses",
c[0],c[0].length);else if(c=f.match(w))F("separator",c[0],c[0].length);else if(178===f.charCodeAt(0))d.push({type:"operator",value:"^"}),F("number",2,1);else if(179===f.charCodeAt(0))d.push({type:"operator",value:"^"}),F("number",3,1);else if(c=f.match(z))F("final_of_expression",c[0],c[0].length);else if(h==p){b.DEBUG.setError(b.DEBUG.EXPRESSION,a);return}}return d};J.prototype.flatTokens=function(a,b){a=void 0===a?[]:a;b=void 0===b?"":b;F="";a=$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=
a.next())c=c.value,F="string"==c.type?F+("&squot;"+c.value+"&squot;"):"identifier"!=c.type||C.test(c.value)?F+c.value:F+(b+c.value);return F};b.Tokenizer=J;return b}(descartesJS||{});
descartesJS=function(b){function a(a){switch(a){case "=":return 1;case ":=":return 1;case "(":return 2;case "[":return 2;case "?":return 2;case ":":return 3;case "?:":return 3;case "|":return 6;case "&":return 7;case "<":return 5;case "<=":return 5;case ">":return 5;case ">=":return 5;case "==":return 5;case "!=":return 5;case "+":return 6;case "-":return 6;case "/":return 7;case "*":return 7;case "sign-":return 7;case "sign+":return 7;case "!":return 8;case "%":return 8;case "^":return 9;default:return 9}}
function d(a){a=String(a).trim().replace(/^'|'$/g,"");var b=parseFloat(a);return isNaN(b)||String(b)!==a?a:b}function h(a,b,c,d){console.info("Error"+a+": en la expresi\u00f3n \u300a"+b+"\u300b, en el token {valor: "+c+", tipo: "+d+"}")}if(b.loadLib)return b;b.reservedIds="-_-_NUM_MAX_ITE_ALG_-rnd-pi-\u03c0-e-Infinity-isTouch-esT\u00e1ctil-device-dispositivo-screenOrientation-screenWidth-screenHeight-sqr-sqrt-ra\u00edz-exp-log-log10-abs-ent-sgn-ind-sin-sen-cos-tan-cot-sec-csc-sinh-senh-cosh-tanh-coth-sech-csch-asin-asen-acos-atan-atan2-floor-piso-ceil-techo-round-redondeo-trunc-truncamiento-min-max-_Trace_-_Print_-_Num_-isNumber-esN\u00famero-random-aleatorio-_Stop_Audios_-esCorrecto-escorrecto-parent.set-parent.update-parent.exec-toFixed-_NumToStr_-_NumACadena_-charAt-_charAt_-_letraEn_-substring-_substring_-_subcadena_-strLength-_length_-_longitud_-indexOf-_indexOf_-\u00edndiceDe-lastIndexOf-replace-_replace_-_reemplazar_-toLowerCase-toUpperCase-trim-_Load_-_GetValues_-_GetMatrix_-_MatrixToStr_-_StrToMatrix_-_GetVector_-_VectorToStr_-_StrToVector_-_ExecStr_-_ExecBlock_-_Save_-_SaveSpace_-_Open_-_SaveState_-_OpenState_-_AnchoDeCadena_-_strWidth_-R-G-B-_Rojo_-_Red_-_Verde_-_Green_-_Azul_-_Blue_-DJS.typeof-DJS.squote-DJS.comma-DJS.w-DJS.h-";
var p,c,f,l,n,m,g,q,e,r,x=function(a){this.evaluator=a;this.tokenizer=new b.Tokenizer;this.vectors={};this.matrices={};this.variables={};this.functions={};this.definitions={};this.registerDefaultValues();this.registerExternalValues&&this.registerExternalValues()};x.prototype.parse=function(d,u){(p=this.tokenizer.tokenize(d))||(p=[]);c=null;u=!u||!1;for(var x=m=n=l=0,y=p.length;x<y;x++){g=p[x];q=g.value;e=g.type;if("identifier"===e)if(p[x+1]&&"parentheses"===p[x+1].type&&"("===p[x+1].value)this.functions.hasOwnProperty(q)||
(this.functions[q]=function(){return 0});else if(p[x+1]&&"square_bracket"===p[x+1].type&&"["===p[x+1].value)p[x+3]&&"square_bracket"===p[x+3].type&&"]"===p[x+3].value?this.vectors.hasOwnProperty(q)||(this.vectors[q]=[0,0,0]):this.matrices.hasOwnProperty(q)||(this.matrices[q]=[[0,0,0],[0,0,0],[0,0,0]]);else{var w=q.match(/^\w*(\.mouse_x|\.mouse_y|\.mouse_pressed|\.mouse_clicked|\.clic_izquierdo)$/);w&&(this.variables[w[1]+".DJS_NO_FIXED"]=1)}"assign"===e&&u&&":="!=q&&(e="compOperator",q="==");if("assign"===
e)if(f=new b.Node(e,q),null!=c){u=!0;if("identifier"===c.type)c.parent&&c.parent.replaceLastChild(f),f.addChild(c);else if("square_bracket"===c.type)f.addChild(c.parent);else{f.type="compOperator";for(f.value="==";c.parent&&a(c.parent.value)>=a(f.value);)c=c.parent;c.parent&&c.parent.replaceLastChild(f);f.addChild(c)}c=f}else{h(1,d,q,e);break}else if("parentheses"===e&&"("===q||"square_bracket"===e&&"["===q)if(f=new b.Node(e,q),"("===q&&l++,"["===q&&n++,null===c)"("===q&&(new b.Node("(expr)","(expr)")).addChild(f),
"["===q&&(new b.Node("[expr]","[expr]")).addChild(f),c=f;else if("operator"===c.type||"boolOperator"===c.type||"compOperator"===c.type||"conditional"===c.type||"assign"===c.type)c.addChild(f),c=f;else if("sign"===c.type)c.addChild(f),c=f;else if("parentheses"===c.type&&"("===c.value)c.addChild(f),c=f;else if("square_bracket"===c.type&&"["===c.value)c.addChild(f),c=f;else if("parentheses"===c.type&&"()"===c.value)c.parent.addChild(f),c=f;else if("square_bracket"===c.type&&"[]"===c.value)c.parent.addChild(f),
c=f;else if("identifier"===c.type)c.addChild(f),c=f;else{h(2,d,q,e);break}else if("parentheses"===e&&")"===q)if(l--,null===c)h(3,d,q,e);else{for(;c&&c.parent&&("("!=c.value||"("==c.value&&"parentheses"!=c.type);)c=c.parent;if(c&&"("===c.value)c.value="()";else{h(4,d,q,e);break}}else if("square_bracket"===e&&"]"===q)if(n--,null===c)h(5,d,q,e);else{for(;c&&c.parent&&("["!=c.value||"["==c.value&&"square_bracket"!=c.type);)c=c.parent;if(c&&"["===c.value)c.value="[]";else{h(6,d,q,e);break}}else if("number"===
e||"string"===e||"identifier"===e)if(f=new b.Node(e,q),null===c)c=f;else if("operator"===c.type||"compOperator"===c.type||"boolOperator"===c.type||"parentheses"===c.type&&"("===c.value||"square_bracket"===c.type&&"["===c.value||"sign"===c.type||"conditional"===c.type||"assign"===c.type)c.addChild(f),c=f;else break;else if("operator"===e||"compOperator"===e||"boolOperator"===e)if(f=new b.Node(e,q),null===c)if("-"===q||"+"===q)f.type="sign",f.value="sign"+q,c=f;else if("!"===q)c=f;else{h(8,d,q,e);break}else if("operator"===
c.type||"compOperator"===c.type||"boolOperator"===c.type||"assign"===c.type||"conditional"===c.type||"square_bracket"===c.type&&"["===c.value&&("-"===q||"+"===q||"!"===q)||"parentheses"===c.type&&"("===c.value&&("-"===q||"+"===q||"!"===q)){if("-"===q||"+"===q)f.type="sign",f.value="sign"+q;c.addChild(f);c=f}else if("number"===c.type||"parentheses"===c.type&&"()"===c.value||"square_bracket"===c.type&&"[]"===c.value||"string"===c.type||"identifier"===c.type||"conditional"===c.type||"assign"===c.type){for(;c.parent&&
a(c.parent.value)>=a(f.value);)c=c.parent;c.parent&&c.parent.replaceLastChild(f);f.addChild(c);c=f}else{h(9,d,q,e);break}else if("conditional"===e)if(f=new b.Node(e,q),null!=c)if("?"===f.value){for(m++;c.parent&&a(c.parent.value)>a(f.value);)c=c.parent;c.parent&&c.parent.replaceLastChild(f);f.addChild(c);c=f}else{for(m--;c&&c.parent&&("?"!=c.value||"?"==c.value&&"conditional"!=c.type);)c=c.parent;if(c&&"?"===c.value)c.value="?:";else{h(10,d,q,e);break}}else{h(11,d,q,e);break}else if("separator"===
e)if(null!=c)for(;c.parent&&"("!=c.value&&"["!=c.value;)c=c.parent;else{h(12,d,q,e);break}else{h(13,d,q,e);break}}0<l&&b.DEBUG.setError(b.DEBUG.PARENTHESIS_CLOSING,d);0>l&&b.DEBUG.setError(b.DEBUG.PARENTHESIS_OPENING,d);0<n&&b.DEBUG.setError(b.DEBUG.BRACKET_CLOSING,d);0>n&&b.DEBUG.setError(b.DEBUG.BRACKET_OPENING,d);0!=m&&b.DEBUG.setError(b.DEBUG.INCOMPLETE_IF,d);(r=c?c.getRoot():null)&&r.setAllEvalFun();return r};x.prototype.registerDefaultValues=function(){var a=Date.now(),c=this;c.variables._NUM_MAX_ITE_ALG_=
1E5;c.variables.pi=c.variables["\u03c0"]=Math.PI;c.variables.e=Math.E;c.variables.Infinity=Infinity;c.variables["-Infinity"]=-Infinity;c.variables.isTouch=c.variables["esT\u00e1ctil"]=b.hasTouchSupport?1:0;c.variables.device=c.variables.dispositivo=function(){var a=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(a)?"tablet":/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(a)?"mobile":"desktop"}();Object.defineProperties(c.variables,
{screenOrientation:{get:function(){return window.matchMedia("(orientation: landscape)").matches?"landscape":"portrait"}},screenWidth:{get:function(){return window.innerWidth}},screenHeight:{get:function(){return window.innerHeight}}});c.variables["DJS.squote"]="\\u0027";c.variables["DJS.comma"]="\\u002C";var g={};c.functions._Eval_=function(a){a=void 0===a?"":a;if(""==a)return 0;if("number"==typeof a)return"NaN";var b=a.replace(",",".");/,/.test(a)&&parseFloat(b)==b&&(a=b);if(void 0==g[a])if(b=a.match(/:=/g)?
!0:!1,/;/.test(a)){for(var d=!1,e,f=[],m=0,l=0,h=a.length;l<h;l++)e=a[l],"'"===e&&(d=!d),d||";"!==e||(f.push(a.substring(m,l)),m=l+1);f.push(a.substring(m));g[a]=c.parse("("+f.join(")(")+")",b)}else g[a]=c.parse(a,b);a=c.evaluator.eval(g[a]);return void 0!=a?a:"NaN"};c.functions.sqr=function(a){return a*a};c.functions.sqrt=c.functions["ra\u00edz"]=Math.sqrt;c.functions.exp=Math.exp;c.functions.log=Math.log;c.functions.log10=Math.log10?Math.log10:function(a){return Math.log(a)/Math.log(10)};c.functions.abs=
Math.abs;c.functions.ent=function(a){return Math.trunc(parseFloat(a)+1E-16*Math.sign(a))};c.functions.sgn=Math.sign;c.functions.ind=function(a){return a?1:0};c.functions.sin=c.functions.sen=Math.sin;c.functions.cos=Math.cos;c.functions.tan=Math.tan;c.functions.cot=function(a){return 1/Math.tan(a)};c.functions.sec=function(a){return 1/Math.cos(a)};c.functions.csc=function(a){return 1/Math.sin(a)};c.functions.sinh=c.functions.senh=Math.sinh?Math.sinh:function(a){return(Math.exp(a)-Math.exp(-a))/2};
c.functions.cosh=Math.cosh?Math.cosh:function(a){return(Math.exp(a)+Math.exp(-a))/2};c.functions.tanh=Math.tanh?Math.tanh:function(a){return(Math.exp(a)-Math.exp(-a))/(Math.exp(a)+Math.exp(-a))};c.functions.coth=function(a){return 1/c.functions.tanh(a)};c.functions.sech=function(a){return 1/c.functions.cosh(a)};c.functions.csch=function(a){return 1/c.functions.sinh(a)};c.functions.asin=c.functions.asen=Math.asin;c.functions.acos=Math.acos;c.functions.atan=Math.atan;c.functions.atan2=Math.atan2;c.functions.floor=
c.functions.piso=Math.floor;c.functions.ceil=c.functions.techo=Math.ceil;c.functions.round=c.functions.redondeo=Math.round;c.functions.trunc=c.functions.truncamiento=Math.trunc;c.functions.min=Math.min;c.functions.max=Math.max;c.functions._Trace_=c.functions._Print_=function(){console.info.apply(console,arguments);return 0};c.functions._Num_=function(a){if("number"==typeof a)return"NaN";a=a.replace(",",".");return parseFloat(a)==a?parseFloat(a):"NaN"};c.functions.isNumber=c.functions["esN\u00famero"]=
function(a){return Number.isFinite(a)?1:0};c.functions.random=c.functions.aleatorio=function(a,b){a=isNaN(parseFloat(a))?0:parseFloat(a);b=isNaN(parseFloat(b))?1:parseFloat(b);a>b&&(b=$jscomp.makeIterator([b,a]),a=b.next().value,b=b.next().value);return a+Math.random()*(b-a)};c.functions._Stop_Audios_=function(){c.evaluator.parent.stopAudios()};c.functions.esCorrecto=function(a,d,g){return b.esCorrecto(a,d,c.evaluator,g)};c.functions.escorrecto=function(a,d,g){return b.escorrecto(a,d,c.evaluator,
g)};window.parent!==window&&(c.functions["parent.set"]=function(a,b){window.parent.postMessage({type:"set",name:a,value:b},"*");return 0},c.functions["parent.update"]=function(){window.parent.postMessage({type:"update"},"*");return 0},c.functions["parent.exec"]=function(a,b){window.parent.postMessage({type:"exec",name:a,value:b},"*");return 0});c.functions.toFixed=c.functions._NumToStr_=c.functions._NumACadena_=function(a,b){a=isNaN(parseFloat(a))?0:parseFloat(a);return a.toFixed(parseInt(b||0)).replace(".",
c.evaluator.parent.decimal_symbol)};c.functions.charAt=c.functions._charAt_=c.functions._letraEn_=function(a,b){a=(a||"").toString();b=isNaN(parseInt(b))?0:parseInt(b);return a.charAt(b)};c.functions.substring=c.functions._substring_=c.functions._subcadena_=function(a,b,c){a=(a||"").toString();b=isNaN(parseInt(b))?0:parseInt(b);c=isNaN(parseInt(c))?0:parseInt(c);return 0<=b&&0<=c?a.substring(b,c):0>b&&0<=c?a.substring(c):0>c&&0<=b?a.substring(b):""};c.functions.strLength=c.functions._length_=c.functions._longitud_=
function(a){return(a||"").toString().length};c.functions.indexOf=c.functions._indexOf_=c.functions["_\u00edndiceDe_"]=function(a,b){return(a||"").toString().indexOf((b||"").toString())};c.functions.lastIndexOf=function(a,b){return(a||"").toString().lastIndexOf((b||"").toString())};c.functions.replace=c.functions._replace_=c.functions._reemplazar_=function(a,b,c){a=(a||"").toString();b=(b||"").toString();c=(c||"").toString();for(var d=a.indexOf(b);0<=d;)a=a.substring(0,d)+c+a.substring(d+b.length),
d=a.indexOf(b,d+c.length);return a};c.functions.toLowerCase=function(a){return(a||"").toString().toLowerCase()};c.functions.toUpperCase=function(a){return(a||"").toString().toUpperCase()};c.functions.trim=function(a){return(a||"").toString().trim()};c.functions._Load_=function(a){var c="";a&&(c=(c=document.getElementById(a))&&"descartes/archivo"==c.type?c.text:b.openFile(a));return c||""};c.functions._GetValues_=function(a,b){return c.functions._ExecBlock_(c.functions._Load_(a).replace(/&brvbar;/g,
String.fromCharCode("166")),b)};c.functions._GetMatrix_=function(a,b){return c.functions._StrToMatrix_(c.functions._Load_(a).replace(/&brvbar;/g,String.fromCharCode("166")),b)};c.functions._MatrixToStr_=function(a){var d=c.matrices[a];if(d){for(var g="<"+a+">\\n",e=c.evaluator.getVariable(a+".columnas_usadas")||d.cols||0,f=c.evaluator.getVariable(a+".filas_usadas")||d.rows||0,m,l=0;l<e;l++){for(var h=0;h<f;h++)m=d[l][h],void 0!==m&&("string"==typeof m?m="'"+m+"'":"number"==typeof m&&(m=b.removeNeedlessDecimals(m.toFixed(6))),
g+=m+(h<f-1?" \u00a6 ":""));g=g.replace(/(\u00A6 )$/g,"")+"\\n"}return g+"</"+a+">"}return""};c.functions._StrToMatrix_=function(a,b){var g=[],e=!1,f=!1;g.type="matrix";if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var m=0,l=a.length;m<l;m++)a[m].match("<"+b+">")?(f=!0,e=a[m].trim().split("<"+b+">"),2==e.length&&""!=e[1]&&g.push(e[1].split(String.fromCharCode("166")).map(d)),e=!0):(a[m].match("</"+b+">")&&(e=a[m].trim().split("</"+b+">"),2==e.length&&""!=e[0]&&g.push(e[0].split(String.fromCharCode("166")).map(d)),
e=!1,m=a.length),e&&g.push(a[m].split(String.fromCharCode("166")).map(d)));c.matrices[b]=g;c.matrices[b].rows=g&&g[0]&&g[0].length?g[0].length:0;c.matrices[b].cols=g&&g.length?g.length:0;c.evaluator.setVariable(b+".filas",c.matrices[b].rows);c.evaluator.setVariable(b+".columnas",c.matrices[b].cols)}return f?"OK":"ERROR"};c.functions._GetVector_=function(a,b){return c.functions._StrToVector_(c.functions._Load_(a),b)};c.functions._VectorToStr_=function(a){var b=c.vectors[a];if(b){for(var d="<"+a+">\\n",
g=c.evaluator.getVariable(a+".long_usada")||b._size_||0,e,f=0;f<g;f++)e=b[f],void 0!==e?("number"==typeof e&&(e=parseFloat(e)),d+=e+"\\n"):d+="0\\n";return d+"</"+a+">"}return""};c.functions._StrToVector_=function(a,b){var g=[],e=!1,f=!1;g.type="vector";if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var m=0,l=a.length;m<l;m++)a[m].match("<"+b+">")?e=f=!0:(a[m].match("</"+b+">")&&(e=!1,m=a.length),e&&g.push(d(a[m])));g._size_=g.length;c.vectors[b]=g;c.evaluator.setVariable(b+".long",g.length);
c.evaluator.setVariable(b+".long_usada",g.length)}return f?"OK":"ERROR"};c.functions._ExecStr_=function(a){return c.functions._ExecBlock_(a,"")};c.functions._ExecBlock_=function(a,b){var d=[],g=""==b;if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var e=0,f=a.length;e<f;e++)a[e].match("<"+b+">")?(g=a[e].trim().split("<"+b+">"),2==g.length&&""!=g[1]&&(d=d.concat(g[1].split(String.fromCharCode("166")))),g=!0):a[e].match("</"+b+">")?(g=a[e].trim().split("</"+b+">"),2==g.length&&""!=g[0]&&(d=d.concat(g[0].split(String.fromCharCode("166")))),
g=!1):g&&(d=d.concat(a[e].split(String.fromCharCode("166"))));a=0;for(b=d.length;a<b;a++)g=d[a].split("="),g[0]=g[0].trim(),2==g.length&&""!=g[0]&&(isNaN(parseFloat(g[1]))?c.evaluator.setVariable(g[0],g[1].trim().replace(/^'|'$/g,"")):c.evaluator.setVariable(g[0],parseFloat(g[1])))}return 0};var e=b.newHTML("a",{target:"_blank"}),f,m=null;b.newBlobContent=null;c.functions._Save_=function(d,g){c.evaluator.parent.removeButtonClick();1500<Date.now()-a&&(a=Date.now(),document.body.appendChild(e),m=g.replace(/\\r/g,
"").replace(/\\n/g,"\r\n").replace(/\\q/g,"'").replace(/\\_/g,"\\").replace(/\\br/g,"\\n"),f=new Blob(["\ufeff",m],{type:"text/plain;charset=utf-8"}),e.setAttribute("href",window.URL.createObjectURL(f)),e.setAttribute("download",d),m!=b.newBlobContent&&(e.click(),b.newBlobContent=m),document.body.removeChild(e));return 0};var l=b.newHTML("a",{target:"_blank"});c.functions._SaveSpace_=function(d,g){c.evaluator.parent.removeButtonClick();1500<Date.now()-a&&(a=Date.now(),document.body.appendChild(l),
m=g,l.setAttribute("href",m),l.setAttribute("download",d),m!=b.newBlobContent&&(l.click(),b.newBlobContent=m),document.body.removeChild(l));return 0};var h,q,p=b.newHTML("input",{type:"file"});p.addEventListener("change",function(a){h=a.target.files;q=new FileReader;q.onload=function(a){b.addExternalFileContent(h[0].name,a.target.result);c.evaluator.setVariable("DJS.fileName",h[0].name);c.evaluator.setVariable("DJS.fileContent",a.target.result);if(a=c.evaluator.getFunction(c._callback))a.apply(c.evaluator,
[]),c.evaluator.parent.update();p.value=""};0<h.length&&q.readAsText(h[0])});c.functions._Open_=function(b){c.evaluator.parent.removeButtonClick();1500<Date.now()-a&&(c._callback=b,p.click(),a=Date.now());return 0};c.functions._AnchoDeCadena_=c.functions._strWidth_=function(a,c,d,g){return b.getTextWidth(a,b.convertFont(c+","+d+","+g))};c.functions.R=c.functions._Rojo_=c.functions._Red_=function(a){return(new b.Color(a)).r/255};c.functions.G=c.functions._Verde_=c.functions._Green_=function(a){return(new b.Color(a)).g/
255};c.functions.B=c.functions._Azul_=c.functions._Blue_=function(a){return(new b.Color(a)).b/255};c.functions.HSV2RGB=function(a,b,c){a=parseInt(a)%360;b*=c;var d=b*(1-Math.abs(a/60%2-1));c-=b;if(0<=a&&60>a){var g=b;var e=d;var f=0}else 60<=a&&120>a?(g=d,e=b,f=0):120<=a&&180>a?(g=0,e=b,f=d):180<=a&&240>a?(g=0,e=d,f=b):240<=a&&300>a?(g=d,e=0,f=b):300<=a&&360>a&&(g=b,e=0,f=d);g=parseInt(255*(g+c));e=parseInt(255*(e+c));f=parseInt(255*(f+c));return""+g.toString(16).padStart(2,"0")+e.toString(16).padStart(2,
"0")+f.toString(16).padStart(2,"0")};c.functions["DJS.typeof"]=function(a){return a.rows?"matrix":a._size_?"vector":typeof a}};b.Parser=x;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=Math.floor,d=function(a){this.parent=a;this.parser=new b.Parser(this);this.variables=this.parser.variables;this.functions=this.parser.functions;this.vectors=this.parser.vectors;this.matrices=this.parser.matrices;this.definitions=this.parser.definitions};d.prototype.setDefinition=function(a,b){this.definitions[a]=b};d.prototype.getDefinition=function(a){return this.definitions[a]};d.prototype.setVariable=function(a,b){this.variables[a]=b};d.prototype.getVariable=
function(a){return this.variables[a]};d.prototype.setVector=function(b,d,c){d=0>d?0:a(d);this.vectors[b][d]=c};d.prototype.getVector=function(b,d){d=0>d?0:a(d);return this.vectors[b][d]};d.prototype.setMatrix=function(b,d,c,f){d=0>d?0:a(d);c=0>c?0:a(c);void 0==this.matrices[b][d]&&(this.matrices[b][d]=[]);this.matrices[b][d][c]=f};d.prototype.getMatrix=function(b,d,c){d=0>d?0:a(d);c=0>c?0:a(c);return this.matrices[b][d][c]};d.prototype.setFunction=function(a,b){this.functions[a]=b};d.prototype.getFunction=
function(a){return this.functions[a]};d.prototype.eval=function(a){return a?a.evaluate(this):0};b.externalEvaluator=new d;b.Evaluator=d;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l,n,m,g,q,e,r,x,y,u,v=function(c,d){a=this;a.parent=c;a.evaluator=c.evaluator;a.decimals=c.decimals;a.fixed=c.fixed;a.align=c.align||"left";a.anchor=c.anchor||"a_top_left";a.decimal_symbol=c.parent.decimal_symbol;a.w=a.h=100;a.hasContent=""!==d;a.textStr=(d||"").replace(/\\{/g,"\\curlyBracketOpen ").replace(/\\}/g,"\\curlyBracketClose ").replace(/\\\[/g,"\\squareBracketOpen ").replace(/\\\]/g,"\\squareBracketClose ");a.oldTextStr=a.oldWidth=
a.oldSize=a.oldColor=a.oldPosX=a.oldPoxY=null;/^\{\\rtf1/.test(d)?(a.type="rtfNode",a.text=d,a.textNodes=(new b.RTFParser(c.evaluator)).parse(d.substring(10)),a.draw=a.drawRTF):(a.descarTeXParser=new b.DescarTeXParser,a.text=a.parseSimpleText(a.textStr),a.textNodes=new b.TextNode("","txtLineBlock",null,null),a.draw=a.drawText)};v.prototype.drawText=function(g,e,m,q,n){a=this;d=a.evaluator.eval(a.decimals);h=a.evaluator.eval(a.parent.width);p=a.evaluator.eval(a.parent.font_size);c=e.getColor?e.getColor():
e;f=a.textToString(a.text,d,a.fixed).replace(/\\{/g,"\\curlyBracketOpen ").replace(/\\}/g,"\\curlyBracketClose ").replace(/\\\[/g,"\\squareBracketOpen ").replace(/\\\]/g,"\\squareBracketClose ");0<=f.indexOf("[")&&(f=a.textToString(a.parseSimpleText(f),d,a.fixed));if(a.oldTextStr!==f||a.oldWidth!==h||a.oldSize!==p||a.oldColor!==c||a.oldPosX!==m||a.oldPoxY!==q)l=new b.TextStyle({size:p,family:a.parent.font_family||"arial",italic:a.parent.italics||!1,bold:a.parent.bold||!1,color:c,align:a.align,border:a.parent.border,
border_size:a.parent.border_size,shadowBlur:a.parent.shadowBlur,shadowOffsetX:a.parent.shadowOffsetX,shadowOffsetY:a.parent.shadowOffsetY,shadowColor:a.parent.shadowColor||"transparent"}),a.textNodes=a.descarTeXParser.parse(f,a.evaluator,l),a.textNodes.update(m,q,d,a.fixed,a.align,a.anchor,c,h);n||a.textNodes.draw(g);a.oldTextStr=f;a.oldWidth=h;a.oldSize=p;a.oldColor=c;a.oldPosX=m;a.oldPoxY=q};v.prototype.drawRTF=function(a,b,c,d,g){b=b.getColor?b.getColor():b;a.fillStyle=a.strokeStyle=b;a.textBaseline=
"alphabetic";this.textNodes.style.align!==this.align&&this.textNodes.propagateStyle("align",this.align);this.textNodes.update(c,d,this.evaluator.eval(this.decimals),this.fixed,this.align,this.anchor,b,this.evaluator.eval(this.parent.width));g||this.textNodes.draw(a)};v.prototype.parseSimpleText=function(a){a=a.replace("&#x2013","\u2013").replace(/&squot;/g,"'");n=[];m="'";q=g=0;e=-1;for(y=a.length;g<y;)r=a.charAt(g),x=a.charAt(g-1),"["===r&&"\\"===x?(n.push(a.substring(q,g-1)+"["),q=g+1):"]"===r&&
"\\"===x?(n.push(a.substring(q,g-1)+"]"),q=g+1):"["===r&&-1===e?(n.push(a.substring(q,g)),q=g,e++):"["===r?e++:"]"===r&&0===e?(n.push(this.evaluator.parser.parse(a.substring(q,g+1))),q=g+1,e--):("]"==a.charAt(g)&&(e=0>e?e:e-1),m+=a.charAt(g)),g++;n.push(a.substring(q,g));return n};v.prototype.textToString=function(a,c,d){m="";if("rtfNode"!==a.type)for(var g=0,e=a.length;g<e;g++)"string"===typeof a[g]?m+=a[g]:(u=this.evaluator.eval(a[g])[0][0],""!==u&&("string"===typeof u?m+=u:Infinity===u?m+="Infinity":
-Infinity===u?m+="-Infinity":isNaN(u)||"NaN"===u?m+="NaN":(u=parseFloat(u),u=d?u.toFixed(c):b.removeNeedlessDecimals(u.toFixed(c)),m+=u.toString().replace(".",this.decimal_symbol))));return m};b.TextObject=v;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d=function(){};d.prototype.tokenize=function(b){b=b.replace(/\\n/g,"\\newline ");var d=[],c=null,f=0,l=b.length;b.charAt(0);var h=!1,m=!1,g=0;a="";for(var q=0;q<l;q++){var e=b.charAt(q);var r=b.charAt(q+1);"\\"===e&&"$"===r&&(m=!0);"{"===e?g++:"}"===e&&(g--,m&&0===g&&(m=!1));m?"_"===e?(a+="\\subindex","{"!==r&&(a+="{"+r+"}",q++)):"^"===e?(a+="\\superindex","{"!==r&&(a+="{"+r+"}",q++)):a+=e:a+=e}b=a;r=b.charAt(0);for(l=b.length;f<l;)e=r,r=b.charAt(f+
1),h&&("{"===e||"["===e||"\\"===e||" "===e?(h=!1," "===e&&(c={type:"ignore"},d.push(c))):c.value+=e),h||"\\"!==e?h||"{"!==e&&"["!==e?h||"}"!==e&&"]"!==e?h||(c&&"text"===c.type?c.value+=e:c&&"ignore"===c.type?(d.pop(),c=d[d.length-1]):(c={type:"text",value:e},d.push(c))):(c={type:"close",value:e},d.push(c)):(c={type:"open",value:e},d.push(c)):(h=!0,c={type:"cmd",value:""},d.push(c)),f++;return d};b.DescarTeXTokenizer=d;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=function(){this.tokenizer=new b.DescarTeXTokenizer};a.prototype.parse=function(a,h,p){a=this.tokenizer.tokenize(a);var c=new b.TextNode("","txtBlock",p,null),d=new b.TextNode("","txtLineBlock",p.clone(),null);c.addChild(d);var l=[],n=void 0,m=p,g=[p],q,e=!1,r=$jscomp.makeIterator(a);for(q=r.next();!q.done;q=r.next())if(q=q.value,"text"===q.type)if("colorParam"===n)var x=new b.Color(q.value,h);else if("txtSizeParam"===n)var y=parseFloat(q.value);
else if("txtLineBlock"===d.nodeType){q=q.value.split(" ");for(var u=0,v=q.length;u<v;u++)""!==q[u]&&d.addChild(new b.TextNode(q[u],"text",m.clone(),null)),u+1<v&&d.addChild(new b.TextNode(" ","space",m.clone(),null))}else d.addChild(new b.TextNode(q.value,"text",m.clone(),null));else if("cmd"===q.type&&"curlyBracketOpen"===q.value)d.addChild(new b.TextNode("{","text",m.clone(),null));else if("cmd"===q.type&&"curlyBracketClose"===q.value)d.addChild(new b.TextNode("}","text",m.clone(),null));else if("cmd"===
q.type&&"squareBracketOpen"===q.value)d.addChild(new b.TextNode("[","text",m.clone(),null));else if("cmd"===q.type&&"squareBracketClose"===q.value)d.addChild(new b.TextNode("]","text",m.clone(),null));else if("cmd"===q.type&&"newline"===q.value)0===d.children.length&&d.addChild(new b.TextNode("","text",m.clone(),null)),d=new b.TextNode("","txtLineBlock",p.clone(),null),c.addChild(d);else if("cmd"===q.type&&"b"===q.value)n="bold",l.push(n);else if("cmd"===q.type&&"i"===q.value)n="italic",l.push(n);
else if("cmd"===q.type&&"o"===q.value)n="overline",l.push(n);else if("cmd"===q.type&&"u"===q.value)n="underline",l.push(n);else if("cmd"===q.type&&"color"===q.value)n="color",l.push(n);else if("cmd"===q.type&&"ts"===q.value)n="txtSize",l.push(n);else if("cmd"===q.type&&"sansserif"===q.value.toLowerCase())n="sansserif",l.push(n);else if("cmd"===q.type&&"serif"===q.value.toLowerCase())n="serif",l.push(n);else if("cmd"===q.type&&"monospace"===q.value.toLowerCase())n="monospace",l.push(n);else if("cmd"===
q.type&&"c"===q.value)n="center",l.push(n);else if("cmd"===q.type&&"l"===q.value)n="left",l.push(n);else if("cmd"===q.type&&"r"===q.value)n="right",l.push(n);else if("cmd"===q.type&&"j"===q.value)n="justify",l.push(n);else if("cmd"===q.type&&"$"===q.value)n="formula",l.push(n),e=!0;else if("cmd"===q.type&&"sum"===q.value)n="sum",l.push(n);else if("cmd"===q.type&&"prod"===q.value)n="prod",l.push(n);else if("cmd"===q.type&&"int"===q.value)n="integral",l.push(n);else if("cmd"===q.type&&"lim"===q.value)n=
"limit",l.push(n);else if("cmd"===q.type&&"sqrt"===q.value)n="radical",l.push(n);else if("cmd"===q.type&&"subindex"===q.value)n="subIndex",l.push(n);else if("cmd"===q.type&&"superindex"===q.value)n="superIndex",l.push(n);else if("cmd"===q.type&&"frac"===q.value)n="numerator",l.push(n);else if("open"===q.type&&"{"===q.value&&void 0!==n)if("bold"===n||"italic"===n||"overline"===n||"underline"===n)m=m.clone(),m[n]=!0,g.push(m);else if("sansserif"===n)m=m.clone(),m.family=n,g.push(m);else if("serif"===
n)m=m.clone(),m.family=n,g.push(m);else if("monospace"===n)m=m.clone(),m.family=n,g.push(m);else if("txtSize"===n)n="txtSizeParam";else if("txtSizeTxt"===n)m=m.clone(),m.size=y,g.push(m);else if("color"===n)n="colorParam";else if("colorTxt"===n)m=m.clone(),m.color=x,g.push(m);else if("center"===n||"left"===n||"right"===n||"justify"===n)m=m.clone(),m.align=n,g.push(m),d=new b.TextNode("","txtLineBlock",m.clone(),null),c.addChild(d);else if("formula"===n){m=m.clone();g.push(m);var A=new b.TextNode("",
n,m.clone(),null);d.addChild(A);d=A}else"subIndex"===n||"superIndex"===n?e?(m=m.clone(),g.push(m),A=new b.TextNode("",n,m.clone(),null),d.addChild(A),d=A):d.addChild(new b.TextNode("subIndex"===n?"_":"^","text",m.clone(),null)):"radical"===n?e&&(A=new b.TextNode("",n,m.clone(),null),d.addChild(A),d=A,m=m.clone(),g.push(m),A=new b.TextNode("","index",m.clone(),null),d.addChild(A),d=A,n="index"):"index"===n?e&&(g.pop(),m=g[g.length-1],A=new b.TextNode("","radicand",m.clone(),null),d.addChild(A),d=A,
n="radicand"):"sum"===n||"integral"===n||"limit"===n||"prod"===n?e&&(A=new b.TextNode("",n,m.clone(),null),d.addChild(A),d=A,m=m.clone(),g.push(m),A=new b.TextNode("","from",m.clone(),null),d.addChild(A),d=A,n="from",l[l.length-1]=n):"from"===n?e&&(A=new b.TextNode("","to",m.clone(),null),d.addChild(A),d=A,n="to",l[l.length-1]=n):"to"===n?e&&(g.pop(),m=g[g.length-1],A=new b.TextNode("","what",m.clone(),null),d.addChild(A),d=A,n="what",l[l.length-1]=n):"numerator"===n?e&&(A=new b.TextNode("","fraction",
m.clone(),null),d.addChild(A),d=A,m=m.clone(),g.push(m),A=new b.TextNode("","numerator",m.clone(),null),d.addChild(A),d=A,n="numerator"):"denominator"===n&&(A=new b.TextNode("",n,m.clone(),null),d.addChild(A),d=A);else"close"===q.type&&"}"===q.value&&void 0!==n&&("bold"===n||"italic"===n||"overline"===n||"underline"===n||"colorTxt"===n||"color"===n||"txtSizeTxt"===n||"txtSize"===n||"sansserif"===n||"serif"===n||"monospace"===n?(g.pop(),m=g[g.length-1],l.pop(),n=l[l.length-1]):"colorParam"===n?n="colorTxt":
"txtSizeParam"===n?n="txtSizeTxt":"center"===n||"left"===n||"right"===n||"justify"===n?(g.pop(),m=g[g.length-1],l.pop(),n=l[l.length-1],a[i+1]&&"cmd"===a[i+1].type&&"newline"===a[i+1].value?d=c:(d=new b.TextNode("","txtLineBlock",m.clone(),null),c.addChild(d))):"formula"===d.nodeType?(e=!1,g.pop(),m=g[g.length-1],l.pop(),n=l[l.length-1],d=d.parent):"subIndex"===d.nodeType||"superIndex"===d.nodeType?e&&(g.pop(),m=g[g.length-1],l.pop(),n=l[l.length-1],d=d.parent):"index"===d.nodeType?d=d.parent:"radicand"===
d.nodeType?(l.pop(),n=l[l.length-1],d=d.parent.parent):"from"===d.nodeType?d=d.parent:"to"===d.nodeType?d=d.parent:"what"===d.nodeType?(l.pop(),n=l[l.length-1],d=d.parent.parent):"numerator"===d.nodeType?(n="denominator",d=d.parent):"denominator"===d.nodeType&&(g.pop(),m=g[g.length-1],l.pop(),n=l[l.length-1],d=d.parent.parent));var w,z,B=null,D=[];c.children.forEach(function(a){for(var b=0,c=a.children.length;b<c-1;b++)w=a.children[b],z=a.children[b+1],"text"===w.nodeType&&"text"===z.nodeType&&w.style.equals(z.style)?
(null===B&&(B=w,A=w.clone(),B.changeNodeType("word"),B.value="___"+A.value,B.addChild(A)),A=z.clone(),B.addChild(A),D.push(z),B.value+=A.value):B=null});D.forEach(function(a){a.parent.removeChild(a)});c.normalize();c.adjustFontSize();return c};b.DescarTeXParser=a;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d=function(a){this.size=20;this.family="Arimo";this.overline=this.underline=this.bold=this.italic=!1;this.border=this.color=null;this.align="left";a=a||{};this.set(a)};d.prototype.clone=function(){return new d(Object.assign({},this))};d.prototype.set=function(a){Object.assign(this,a)};d.prototype.equals=function(a){var b=!0,c;for(c in this)this.hasOwnProperty(c)&&(b=b&&this[c]===a[c]);return b};d.prototype.toString=function(d){/arial|sansserif/i.test(this.family)?
a=b.sansserif_font:/times|serif/i.test(this.family)?a=d?b.math_font:b.serif_font:/courier|monospaced/i.test(this.family)&&(a=b.monospace_font);return((this.bold?"bold ":"")+(this.italic?"italic ":"")+this.size+"px "+a).trim()};b.TextStyle=d;return b}(descartesJS||{});
descartesJS=function(b){function a(a,b){for(var c=0,d=0;d<b;d++)c+=a[d];return c}function d(a){var b={ascent:0,descent:0,h:0,w:0,x:0,y:0,offsetX:0,offsetY:0,marginX:0,marginY:0,paddingX:0,paddingY:0};if(""==a.trim())return b;var c=parseInt(a.match(/(\d+\.*)+px/)[0]);a=a.match("sansserif")?"sansserif":a.match("serif")?"serif":"monospace";b.ascent=Math.ceil((n[a].ascent+25)*c/n[a].unitsPerEm);b.descent=Math.ceil(Math.abs((n[a].descent-25)*c/n[a].unitsPerEm));b.h=b.ascent+b.descent;return b}if(b.loadLib)return b;
var h=!1,p="#000000",c=2,f=!1,l=function(a,c,d,e){this.type="rtfNode";this.evaluator=e;this.parent=null;this.children=[];this.metrics={ascent:0,descent:0,h:0,w:0,x:0,y:0,offsetX:0,offsetY:0,marginX:0,marginY:0,paddingX:0,paddingY:0};this.value=a;this.style=d;this.changeNodeType(c);this.drawBorder=b.in_editor?this.drawBorderSpecial:function(){}};l.prototype.changeNodeType=function(a){this.nodeType=a;this.draw=null;switch(this.nodeType){case "txtBlock":this.draw=this.drawTxtBlock;break;case "txtLineBlock":this.draw=
this.drawTxtLineBlock;break;case "formula":this.draw=this.drawFormula;break;case "superIndex":this.draw=this.drawSuperIndex;break;case "subIndex":this.draw=this.drawSubIndex;break;case "dynamicTxt":this.draw=this.drawDynamicTxt;this.decimal_symbol=this.evaluator.parent.decimal_symbol;break;case "fraction":this.draw=this.drawFraction;break;case "numerator":case "denominator":this.draw=this.drawNumDen;break;case "radical":this.draw=this.drawRadical;break;case "limit":this.draw=this.drawLimit;break;
case "integral":this.draw=this.drawIntegral;break;case "prod":this.draw=this.drawProd;break;case "sum":this.draw=this.drawSum;break;case "matrix":this.draw=this.drawMatrix;break;case "defparts":this.draw=this.drawDefparts;break;case "text":case "newLine":case "mathSymbol":this.draw=this.drawText;break;case "space":this.draw=this.drawSpace;break;case "word":this.draw=this.drawWord;break;case "hyperlink":this.draw=this.drawHyperlink;break;case "index":case "radicand":case "from":case "to":case "what":case "element":this.draw=
this.drawGenericBlock;break;case "componentNumCtrl":this.draw=this.drawComponentNumCtrl;break;case "componentSpace":this.draw=this.drawComponentSpace}};l.prototype.clone=function(){for(var a=new l(this.value,this.nodeType,this.style.clone()),b=0,c=this.children.length;b<c;b++)a.addChild(this.children[b].clone());return a};l.prototype.toStr=function(){for(var a=this.value,b=0,c=this.children.length;b<c;b++)a+=" "+this.children[b].toStr();return a};l.prototype.stringify=function(){var a="{"+('"NT":"'+
this.nodeType+'",');a+='"V":"'+(this.value||"")+'",';a+='"C":[';for(var b=0,c=this.children.length;b<c;b++)a+=this.children[b].stringify()+(b==c-1?"":",");a=a+"],"+('"S":'+JSON.stringify(this.style));return a+"}"};l.prototype.addChild=function(a,b){b&&null!==a.parent&&a.parent.removeChild(a);a.parent=this;this.children.push(a)};l.prototype.removeChild=function(a){var b=this.children.indexOf(a);-1!==b&&(a.parent=null,this.children.splice(b,1))};l.prototype.getFirstTextNode=function(){for(var a=this;0<
a.children.length;)a=a.children[0];return a};l.prototype.getLastTextNode=function(){for(var a=this;0<a.children.length;)a=a.children[a.children.length-1];return a};l.prototype.nextSibling=function(){if(this.parent)for(var a=null,b=0,c=this.parent.children.length;b<c;b++){if(a)return this.parent.children[b];this.parent.children[b]===this&&(a=!0)}return null};l.prototype.prevSibling=function(){if(this.parent)for(var a=0,b=this.parent.children.length-1;a<b;a++)if(this.parent.children[a+1]===this)return this.parent.children[a];
return null};l.prototype.queryAll=function(a){var b=[];"string"===typeof a&&(a=new RegExp(a));for(var c=0,d=this.children.length;c<d;c++)b=b.concat(this.children[c].queryAll(a));this.nodeType.match(a)&&b.push(this);return b};l.prototype.insertBefore=function(a,b){a=this.children.indexOf(a);-1!==a&&(b.parent=this,this.children.splice(a,0,b))};l.prototype.insertAfter=function(a,b){a=this.children.indexOf(a);-1!==a&&(b.parent=this,this.children.splice(a+1,0,b))};l.prototype.normalize=function(){for(var a=
this.queryAll(/txtLineBlock|formula|numerator|denominator|superIndex|subIndex|index|subIndex|radicand|from|to|what|element/),b=0,c=a.length;b<c;b++)0===a[b].children.length&&a[b].addChild(new l("","text",a[b].style));a=this.queryAll(/formula|fraction|superIndex|subIndex|radical|sum|integral|prod|limit|matrix|defparts|dynamicText|componentNumCtrl|componentSpace/);c=0;for(var d=a.length;c<d;c++)b=a[c],(null===b.prevSibling()||null!==b.prevSibling()&&"text"!==b.prevSibling().nodeType)&&b.parent.insertBefore(b,
new l("","text",b.parent.style)),(null===b.nextSibling()||null!==b.nextSibling()&&"text"!==b.nextSibling().nodeType)&&b.parent.insertAfter(b,new l("","text",b.parent.style));return this};l.prototype.removeEmptyText=function(){for(var a=this.queryAll(/text/),b=0,c=a.length;b<c;b++)""===a[b].value&&a[b].parent&&a[b].parent.removeChild(a[b])};l.prototype.adjustFontSize=function(a){var b=this.style.size;"formula"===this.nodeType&&(a=!0);for(var c=0,d=this.children.length;c<d;c++)"text"===this.children[c].nodeType&&
a?(this.children[c].style.size=b,this.children[c].styleString=this.children[c].style.toString()):"index"===this.children[c].nodeType?(this.children[c].style.size=Math.max(parseInt(b-.5*b),8),this.children[c].styleString=this.children[c].style.toString(),this.children[c].adjustFontSize(!0)):"to"===this.children[c].nodeType||"from"===this.children[c].nodeType?(this.children[c].style.size=Math.max(parseInt(b-.2*b),8),this.children[c].styleString=this.children[c].style.toString(),this.children[c].adjustFontSize(!0)):
"numerator"===this.children[c].nodeType||"denominator"===this.children[c].nodeType?(this.children[c].style.size=Math.max(parseInt(b-.1*b),8),this.children[c].styleString=this.children[c].style.toString(),this.children[c].adjustFontSize(!0)):"subIndex"===this.children[c].nodeType||"superIndex"===this.children[c].nodeType?(this.children[c].style.size=Math.max(parseInt(b-.33*b),8),this.children[c].styleString=this.children[c].style.toString(),this.children[c].adjustFontSize(!0)):(a&&(this.children[c].style.size=
b,this.children[c].styleString=this.children[c].style.toString()),this.children[c].adjustFontSize(a))};l.prototype.propagateStyle=function(a,b){this.style[a]=b;this.styleString=this.style.toString();for(var c=0,d=this.children.length;c<d;c++)this.children[c].propagateStyle(a,b)};l.prototype.update=function(a,b,d,e,l,h,n,u){c=d;f=e;p=n;this.metrics.w=this.metrics.h=0;e=b;if(20<=u)for(d=0;d<this.children.length;d++)this.children[d].breakLines(u);n=0;for(var g=this.children.length;n<g;n++)l=this.children[n],
l.updateLine(),l.metrics.offsetX=a,l.metrics.y=b,b+=parseInt(l.metrics.ascent+.5),l.metrics.offsetY=b,d=parseInt(l.metrics.descent+.5)+parseInt(1.5+.05*l.style.size),b+=d,this.metrics.h+=l.metrics.h,this.metrics.w=Math.max(this.metrics.w,l.metrics.w);b=e;h=h||"";h.match("right")?a-=this.metrics.w:h.match("_center")&&(a-=this.metrics.w/2);h.match("bottom")?b-=this.metrics.h:h.match("center_")&&(b-=this.metrics.h/2);h=this.children;e=0;for(l=h.length;e<l;e++)"left"===h[e].style.align?h[e].metrics.offsetX=
a:"right"===h[e].style.align?h[e].metrics.offsetX=a+this.metrics.w-h[e].metrics.w:"center"===h[e].style.align?h[e].metrics.offsetX=a+(this.metrics.w-h[e].metrics.w)/2:"justify"===h[e].style.align&&20<=u&&(d=e<l-1?h[e+1].value:null,h[e].metrics.offsetX=a,"wrap"===d&&h[e].justifyAux(u)),h[e].metrics.y=b,b+=parseInt(h[e].metrics.ascent+.5),h[e].metrics.offsetY=b,d=parseInt(h[e].metrics.descent+.5)+parseInt(1.5+.05*h[e].style.size),b+=d};l.prototype.breakLines=function(a){for(var c,d=0,e=!1,f=[],m=0,
h=this.children.length;m<h;m++)c=this.children[m],e?f.push(c):("text"===c.nodeType||"space"===c.nodeType?(b.ctx.font=c.style.toString(),c.metrics.w=b.ctx.measureText(c.value).width):"word"===c.nodeType?c.updateLine():"formula"===c.nodeType&&c.updateFormula(),d+=c.metrics.w,d>a&&"space"!==c.nodeType&&0<m&&(e=!0,f.push(c)));if(0<f.length)for(a=new l("wrap","txtLineBlock",this.style.clone(),null),this.parent.insertAfter(this,a),c=0,d=f.length;c<d;c++)f[c].parent&&f[c].parent.removeChild(f[c]),a.addChild(f[c])};
l.prototype.updateLine=function(a){var c=this;if("txtLineBlock"===this.nodeType||"word"===this.nodeType){this.metrics.w=0;this.metrics.ascent=0;for(var f=this.metrics.descent=0,e=this.children,m,l=0,h=e.length;l<h;l++){m=e[l];if("text"===m.nodeType){b.ctx.font=m.style.toString();var p=""!==m.value?m.value:b.in_editor?"\u200a":"";m.metrics=d(b.ctx.font);m.metrics.w=b.ctx.measureText(p).width;m.metrics.offsetX=f;Object.defineProperties(m.metrics,{x:{get:function(){return c.metrics.offsetX+this.offsetX}},
y:{get:function(){return c.metrics.offsetY+this.offsetY}}})}"space"===m.nodeType?(b.ctx.font=m.style.toString(),m.metrics=d(b.ctx.font),m.metrics.w=l===h-1?0:a?a:b.ctx.measureText(" ").width,m.metrics.offsetX=f,Object.defineProperties(m.metrics,{x:{get:function(){return c.metrics.offsetX+this.offsetX}},y:{get:function(){return c.metrics.offsetY+this.offsetY}}})):"word"===m.nodeType&&(m.updateLine(),m.metrics.offsetX_aux=f,Object.defineProperties(m.metrics,{offsetX:{get:function(){return c.metrics.offsetX+
this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}}));"hyperlink"===m.nodeType&&(b.ctx.font=m.styleString,p=""!==m.value?m.value:b.in_editor?"\u200a":"",m.metrics=d(b.ctx.font),m.metrics.w=b.ctx.measureText(p).width,m.metrics.offsetX=f,Object.defineProperties(m.metrics,{x:{get:function(){return c.metrics.offsetX+this.offsetX}},y:{get:function(){return c.metrics.offsetY}}}),m.clickCatcher||(m.clickCatcher=b.newHTML("div",{style:"position:absolute;width:"+m.metrics.w+"px;height:"+
m.metrics.h+"px;cursor:pointer;"}),m.clickCatcher.rtfNode=m,m.clickCatcher.action=new b.OpenURL(this.evaluator.parent,m.URL),m.clickCatcher.addEventListener("click",function(a){this.rtfNode.click=!0;this.action.execute();this.rtfNode.draw(this.rtfNode.ctx)})));"componentNumCtrl"===m.nodeType&&(m.componentNumCtrl=this.evaluator.parent.getControlByCId(m.value),b.ctx.font=m.styleString,m.metrics=d(b.ctx.font),m.metrics.w=m.componentNumCtrl.w,m.metrics.h=m.componentNumCtrl.h,m.metrics.offsetX=f,Object.defineProperties(m.metrics,
{x:{get:function(){return c.metrics.offsetX+this.offsetX}},y:{get:function(){return c.metrics.offsetY}}}));"componentSpace"===m.nodeType?(m.componentSpace=this.evaluator.parent.getSpaceByCId(m.value),b.ctx.font=m.styleString,m.metrics=d(b.ctx.font),m.metrics.w=m.componentSpace.w,m.metrics.h=m.componentSpace.h,m.metrics.offsetX=f,Object.defineProperties(m.metrics,{x:{get:function(){return c.metrics.offsetX+this.offsetX}},y:{get:function(){return c.metrics.offsetY}}})):"formula"===m.nodeType&&(m.updateFormula(),
m.metrics.marginX=m.metrics.marginY=m.metrics.paddingX=m.metrics.paddingY=0,m.metrics.offsetX_aux=f,Object.defineProperties(m.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}}),m.metrics.w+=2*m.metrics.paddingX,m.metrics.ascent+=m.metrics.paddingY,m.metrics.descent+=m.metrics.paddingY,m.metrics.h+=2*m.metrics.paddingY,f+=2*m.metrics.marginX);
this.metrics.w+=m.metrics.w+2*m.metrics.marginX;this.metrics.ascent=Math.max(this.metrics.ascent,m.metrics.ascent);this.metrics.descent=Math.max(this.metrics.descent,m.metrics.descent);f+=m.metrics.w}this.metrics.h=this.metrics.ascent+this.metrics.descent}};l.prototype.updateFormula=function(){var m=this;this.metrics={ascent:0,descent:0,h:0,w:0,x:0,y:0,offsetX:0,offsetY:0,marginX:0,marginY:0,paddingX:0,paddingY:0};for(var g=this.children,l,e=0,h={metrics:{ascent:0,descent:0,h:0,w:0,x:0,y:0,offsetX:0,
offsetY:0,marginX:0,marginY:0,paddingX:0,paddingY:0}},p={},n=0,u=g.length;n<u;p={$jscomp$loop$prop$offsetY$333:p.$jscomp$loop$prop$offsetY$333,$jscomp$loop$prop$radicand$334:p.$jscomp$loop$prop$radicand$334,$jscomp$loop$prop$tmpMetric$335:p.$jscomp$loop$prop$tmpMetric$335,$jscomp$loop$prop$tmpMetric$248$336:p.$jscomp$loop$prop$tmpMetric$248$336,$jscomp$loop$prop$tmpMetric$252$337:p.$jscomp$loop$prop$tmpMetric$252$337,$jscomp$loop$prop$limitFrom$339:p.$jscomp$loop$prop$limitFrom$339},n++){l=g[n];if("text"===
l.nodeType){b.ctx.font=l.style.toString(!0);var v=""!==l.value?l.value:b.in_editor?"\u200a":"";l.metrics=d(b.ctx.font);l.metrics.w=b.ctx.measureText(v).width;l.metrics.offsetX=e;Object.defineProperties(l.metrics,{x:{get:function(){return m.metrics.offsetX+m.metrics.paddingX+this.offsetX}},y:{get:function(){return m.metrics.offsetY}}});e+=m.metrics.marginX}else if("dynamicTxt"===l.nodeType){v=void 0===l.decimals?c:l.evaluator.eval(l.decimals);var A=void 0===l.fixed?f:l.fixed,w=l.evaluator.eval(l.value);
parseFloat(w).toString()===w.toString()&&(w=A?parseFloat(w).toFixed(v):b.removeNeedlessDecimals(parseFloat(w).toFixed(v)),w=(""+w).replace(".",l.decimal_symbol));l.evalValue=w;b.ctx.font=l.style.toString(!0);l.metrics=d(b.ctx.font);l.metrics.marginX=0;l.metrics.paddingX=0;l.metrics.w=b.ctx.measureText(w).width+2*l.metrics.paddingX;l.metrics.offsetX_aux=e;Object.defineProperties(l.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return m.metrics.offsetX+
m.metrics.paddingX+this.offsetX_aux+this.marginX}},offsetY:{get:function(){return m.metrics.offsetY}}});e+=2*l.metrics.marginX}if("superIndex"===l.nodeType)v=l,v.updateFormula(),v.metrics.marginX=0,v.metrics.paddingX=0,v.metrics.paddingY=0,v.metrics.offsetX_aux=e,v.metrics.prevChild=h,Object.defineProperties(v.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return m.metrics.offsetX+m.metrics.paddingX+this.offsetX_aux+this.marginX}},
offsetY:{get:function(){return m.metrics.offsetY+this.ascent+(this.prevChild.metrics.descent-this.prevChild.metrics.ascent)/2-this.h}}}),v.metrics.w+=2*v.metrics.paddingX,v.metrics.ascent+=v.metrics.paddingY,v.metrics.descent+=v.metrics.paddingY,v.metrics.h+=2*v.metrics.paddingY,v.metrics.tmp_ascent=v.metrics.h+(v.metrics.prevChild.metrics.ascent-v.metrics.prevChild.metrics.descent)/2,e+=2*v.metrics.marginX;else if("subIndex"===l.nodeType)v=l,v.updateFormula(),v.metrics.marginX=0,v.metrics.paddingX=
0,v.metrics.paddingY=0,v.metrics.offsetX_aux=e,v.metrics.prevChild=h,Object.defineProperties(v.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return m.metrics.offsetX+m.metrics.paddingX+this.offsetX_aux}},offsetY:{get:function(){return m.metrics.offsetY+this.ascent+(this.prevChild.metrics.descent-this.prevChild.metrics.ascent)/2}}}),v.metrics.w+=v.metrics.paddingX,v.metrics.ascent+=v.metrics.paddingY,v.metrics.descent+=v.metrics.paddingY,
v.metrics.h+=2*v.metrics.paddingY,this.metrics.descent=v.metrics.ascent+(v.metrics.prevChild.metrics.descent-v.metrics.prevChild.metrics.ascent)/2+v.metrics.descent,e+=v.metrics.marginX;else if("fraction"===l.nodeType){v=l;v.updateFormula();w=v.children;A=w[0];w=w[1];v.metrics.marginX=parseInt(.5+.075*this.style.size);v.metrics.paddingX=0;v.metrics.paddingY=0;var z=Math.max(A.metrics.w,w.metrics.w)+2*v.metrics.paddingX;v.metrics.prevChild=h;v.metrics.offsetX_aux=e;p.$jscomp$loop$prop$offsetY$333=
parseInt(-h.metrics.descent+4*h.metrics.h/9);Object.defineProperties(v.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(a){return function(){return this.offsetY+a.$jscomp$loop$prop$offsetY$333}}(p)},offsetX:{get:function(){return m.metrics.offsetX+m.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(a){return function(){return m.metrics.offsetY-a.$jscomp$loop$prop$offsetY$333}}(p)}});Object.defineProperties(A.metrics,{parent:{value:v},maxWidth:{value:z},x:{get:function(){return this.offsetX}},
y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+parseInt((this.maxWidth-this.w)/2)}},offsetY:{get:function(){return this.parent.metrics.offsetY-this.descent-this.parent.metrics.paddingY}}});Object.defineProperties(w.metrics,{parent:{value:v},maxWidth:{value:z},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+parseInt((this.maxWidth-this.w)/2)}},offsetY:{get:function(){return this.parent.metrics.offsetY+
this.ascent+this.parent.metrics.paddingY}}});v.metrics.w=z;v.metrics.ascent=A.metrics.h+p.$jscomp$loop$prop$offsetY$333+2*v.metrics.paddingY;v.metrics.descent=w.metrics.h-p.$jscomp$loop$prop$offsetY$333+2*v.metrics.paddingY;v.metrics.h=A.metrics.h+w.metrics.h+4*v.metrics.paddingY;e+=2*v.metrics.marginX}else if("radical"===l.nodeType)h=l,h.updateFormula(),A=h.children,v=A[0],p.$jscomp$loop$prop$radicand$334=A[1],h.metrics.marginX=parseInt(1.5+.075*this.style.size),h.metrics.paddingX=parseInt(1.5+.075*
this.style.size),h.metrics.paddingY=parseInt(1.5+.05*this.style.size),h.metrics.offsetX_aux=e,Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return m.metrics.offsetX+m.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return m.metrics.offsetY}}}),A=h.style.size,h.radicalSign={w:A,scaleX:A/722,scaleY:p.$jscomp$loop$prop$radicand$334.metrics.h/1E3},w=parseInt(v.metrics.w-2*h.radicalSign.w/
3),Object.defineProperties(h.radicalSign,{parent:{value:h},displaceIndex:{value:w},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+Math.max(this.displaceIndex,0)}},y:{get:function(a){return function(){return m.metrics.offsetY-a.$jscomp$loop$prop$radicand$334.metrics.ascent}}(p)}}),Object.defineProperties(v.metrics,{parent:{value:h},displaceIndex:{value:w},fontSize:{value:A},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+
this.parent.metrics.paddingX+Math.max(this.displaceIndex,0)-this.displaceIndex}},offsetY:{get:function(){return m.metrics.offsetY-this.descent-2*this.fontSize/5}}}),Object.defineProperties(p.$jscomp$loop$prop$radicand$334.metrics,{parent:{value:h},displaceIndex:{value:w},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+this.parent.radicalSign.w+Math.max(this.displaceIndex,0)}},offsetY:{get:function(){return m.metrics.offsetY}}}),
w=v.metrics.w<2*h.radicalSign.w/3?h.radicalSign.w:parseInt(v.metrics.w+h.radicalSign.w/3),h.metrics.w=w+2*h.metrics.paddingX+p.$jscomp$loop$prop$radicand$334.metrics.w,h.metrics.ascent=Math.max(p.$jscomp$loop$prop$radicand$334.metrics.ascent,v.metrics.h+2*A/5)+h.metrics.paddingY,h.metrics.descent=p.$jscomp$loop$prop$radicand$334.metrics.descent+h.metrics.paddingY,h.metrics.h=h.metrics.ascent+h.metrics.descent,e+=2*h.metrics.marginX;else if("sum"===l.nodeType){h=l;h.updateFormula();w=h.children;v=
w[0];A=w[1];w=w[2];h.metrics.marginX=parseInt(1.5+.075*this.style.size);h.metrics.paddingX=parseInt(1.5+.075*this.style.size);h.metrics.paddingY=parseInt(1.5+.05*this.style.size);h.metrics.offsetX_aux=e;Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return m.metrics.offsetX+m.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return m.metrics.offsetY}}});b.ctx.font=l.style.toString();
p.$jscomp$loop$prop$tmpMetric$335=d(b.ctx.font);z=parseInt(1.2*p.$jscomp$loop$prop$tmpMetric$335.h);var B=parseInt(.5+780*z/1E3);h.sigmaSign={w:B,h:z,scale:z/1E3};B=Math.max(A.metrics.w,v.metrics.w,h.sigmaSign.w);h.sigmaSign.parent=h;Object.defineProperties(h.sigmaSign,{sumWidth:{value:B},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.sumWidth-this.w)/2)}},y:{get:function(a){return function(){return m.metrics.offsetY+a.$jscomp$loop$prop$tmpMetric$335.descent-
(this.h+a.$jscomp$loop$prop$tmpMetric$335.h)/2}}(p)}});var D=p.$jscomp$loop$prop$tmpMetric$335.descent-A.metrics.descent-(z+p.$jscomp$loop$prop$tmpMetric$335.h)/2-h.metrics.paddingY;Object.defineProperties(A.metrics,{parent:{value:h},sumWidth:{value:B},newBaselineTo:{value:D},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.sumWidth-this.w)/2)}},offsetY:{get:function(){return m.metrics.offsetY+
this.newBaselineTo}}});z=v.metrics.ascent+p.$jscomp$loop$prop$tmpMetric$335.descent+(z-p.$jscomp$loop$prop$tmpMetric$335.h)/2+h.metrics.paddingY;Object.defineProperties(v.metrics,{parent:{value:h},sumWidth:{value:B},newBaselineFrom:{value:z},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.sumWidth-this.w)/2)}},offsetY:{get:function(){return m.metrics.offsetY+this.newBaselineFrom}}});
Object.defineProperties(w.metrics,{parent:{value:h},sumWidth:{value:B},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+2*this.parent.metrics.paddingX+this.sumWidth}},offsetY:{get:function(){return m.metrics.offsetY}}});h.metrics.w=B+w.metrics.w+3*h.metrics.paddingX;h.metrics.ascent=Math.max(w.metrics.ascent,-D+A.metrics.ascent)+h.metrics.paddingY;h.metrics.descent=Math.max(w.metrics.descent,z+v.metrics.descent)+
h.metrics.paddingY;h.metrics.h=h.metrics.ascent+h.metrics.descent;e+=2*h.metrics.marginX}else if("integral"===l.nodeType){h=l;h.updateFormula();w=h.children;v=w[0];A=w[1];w=w[2];h.metrics.marginX=parseInt(1.5+.075*this.style.size);h.metrics.paddingX=parseInt(1.5+.075*this.style.size);h.metrics.paddingY=parseInt(1.5+.05*this.style.size);h.metrics.offsetX_aux=e;Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return m.metrics.offsetX+
m.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return m.metrics.offsetY}}});b.ctx.font=l.style.toString();p.$jscomp$loop$prop$tmpMetric$248$336=d(b.ctx.font);z=parseInt(1.2*p.$jscomp$loop$prop$tmpMetric$248$336.h);var I=parseInt(10.5+529*z/1E3);h.sign={w:I,h:z,scale:z/1E3};h.sign.parent=h;Object.defineProperties(h.sign,{x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX}},y:{get:function(a){return function(){return m.metrics.offsetY+a.$jscomp$loop$prop$tmpMetric$248$336.descent-
(this.h+a.$jscomp$loop$prop$tmpMetric$248$336.h)/2}}(p)}});B=p.$jscomp$loop$prop$tmpMetric$248$336.descent-(z+p.$jscomp$loop$prop$tmpMetric$248$336.h)/2-A.metrics.descent+z/3;Object.defineProperties(A.metrics,{parent:{value:h},integralWidth:{value:I},newBaselineTo:{value:B},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt(4*this.integralWidth/5)}},offsetY:{get:function(){return m.metrics.offsetY+
this.newBaselineTo}}});D=p.$jscomp$loop$prop$tmpMetric$248$336.descent+v.metrics.ascent/2;Object.defineProperties(v.metrics,{parent:{value:h},integralWidth:{value:I},newBaselineFrom:{value:D},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt(2*this.integralWidth/5)}},offsetY:{get:function(){return m.metrics.offsetY+this.newBaselineFrom}}});I=Math.max(parseInt(3*I/5)+A.metrics.w,
parseInt(2*I/5+v.metrics.w))+h.metrics.paddingX;Object.defineProperties(w.metrics,{parent:{value:h},whatDisplace:{value:I},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+this.whatDisplace}},offsetY:{get:function(){return m.metrics.offsetY}}});h.metrics.w=I+w.metrics.w+2*h.metrics.paddingX;h.metrics.ascent=Math.max(w.metrics.ascent,-B+A.metrics.ascent)+h.metrics.paddingY;h.metrics.descent=
Math.max(w.metrics.descent,D+v.metrics.descent,z-h.metrics.ascent)+h.metrics.paddingY;h.metrics.h=Math.max(h.metrics.ascent+h.metrics.descent,z);e+=2*h.metrics.marginX}else if("prod"===l.nodeType)h=l,h.updateFormula(),w=h.children,v=w[0],A=w[1],w=w[2],h.metrics.marginX=parseInt(1.5+.075*this.style.size),h.metrics.paddingX=parseInt(1.5+.075*this.style.size),h.metrics.paddingY=parseInt(1.5+.05*this.style.size),h.metrics.offsetX_aux=e,Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},
y:{get:function(){return this.offsetY}},offsetX:{get:function(){return m.metrics.offsetX+m.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return m.metrics.offsetY}}}),b.ctx.font=l.style.toString(),p.$jscomp$loop$prop$tmpMetric$252$337=d(b.ctx.font),z=parseInt(1.2*p.$jscomp$loop$prop$tmpMetric$252$337.h),B=parseInt(.5+876*z/1E3),h.piSign={w:B,h:z,scale:z/1E3},B=Math.max(A.metrics.w,v.metrics.w,h.piSign.w),h.piSign.parent=h,Object.defineProperties(h.piSign,{prodWidth:{value:B},
x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.prodWidth-this.w)/2)}},y:{get:function(a){return function(){return m.metrics.offsetY+a.$jscomp$loop$prop$tmpMetric$252$337.descent-(this.h+a.$jscomp$loop$prop$tmpMetric$252$337.h)/2}}(p)}}),D=p.$jscomp$loop$prop$tmpMetric$252$337.descent-A.metrics.descent-(z+p.$jscomp$loop$prop$tmpMetric$252$337.h)/2-h.metrics.paddingY,Object.defineProperties(A.metrics,{parent:{value:h},prodWidth:{value:B},newBaselineTo:{value:D},
x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.prodWidth-this.w)/2)}},offsetY:{get:function(){return m.metrics.offsetY+this.newBaselineTo}}}),z=v.metrics.ascent+p.$jscomp$loop$prop$tmpMetric$252$337.descent+(z-p.$jscomp$loop$prop$tmpMetric$252$337.h)/2+h.metrics.paddingY,Object.defineProperties(v.metrics,{parent:{value:h},prodWidth:{value:B},newBaselineFrom:{value:z},
x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.prodWidth-this.w)/2)}},offsetY:{get:function(){return m.metrics.offsetY+this.newBaselineFrom}}}),Object.defineProperties(w.metrics,{parent:{value:h},prodWidth:{value:B},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+2*this.parent.metrics.paddingX+
this.prodWidth}},offsetY:{get:function(){return m.metrics.offsetY}}}),h.metrics.w=B+w.metrics.w+3*h.metrics.paddingX,h.metrics.ascent=Math.max(w.metrics.ascent,-D+A.metrics.ascent)+h.metrics.paddingY,h.metrics.descent=Math.max(w.metrics.descent,z+v.metrics.descent)+h.metrics.paddingY,h.metrics.h=h.metrics.ascent+h.metrics.descent,e+=2*h.metrics.marginX;else if("limit"===l.nodeType){h=l;h.updateFormula();A=h.children;p.$jscomp$loop$prop$limitFrom$339=A[0];v=A[1];A=A[2];h.metrics.marginX=parseInt(1.5+
.075*this.style.size);h.metrics.paddingX=parseInt(1.5+.075*this.style.size);h.metrics.paddingY=parseInt(1.5+.05*this.style.size);h.metrics.offsetX_aux=e;Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return m.metrics.offsetX+m.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return m.metrics.offsetY}}});b.ctx.font=l.style.toString();z=d(b.ctx.font);w=parseInt(.5+b.ctx.measureText("l\u00edm").width);
B=parseInt(.5+b.ctx.measureText("\u2192").width);D=Math.max(w,p.$jscomp$loop$prop$limitFrom$339.metrics.w+B+v.metrics.w);h.limitText={parent:h};Object.defineProperties(h.limitText,{limitWidth:{value:D},limitTextWidth:{value:w},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+(this.limitWidth-this.limitTextWidth)/2}}});w=z.descent+Math.max(p.$jscomp$loop$prop$limitFrom$339.metrics.ascent,v.metrics.ascent,2*z.ascent/3)+h.metrics.paddingY;h.limitArrow={parent:h};Object.defineProperties(h.limitArrow,
{newBaseline:{value:w},x:{get:function(a){return function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+a.$jscomp$loop$prop$limitFrom$339.metrics.w}}(p)},y:{get:function(){return m.metrics.offsetY+this.newBaseline}}});Object.defineProperties(p.$jscomp$loop$prop$limitFrom$339.metrics,{parent:{value:h},newBaseline:{value:w},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX}},
offsetY:{get:function(){return m.metrics.offsetY+this.newBaseline}}});Object.defineProperties(v.metrics,{parent:{value:h},arrowWidth:{value:B},newBaseline:{value:w},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(a){return function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+a.$jscomp$loop$prop$limitFrom$339.metrics.w+this.arrowWidth}}(p)},offsetY:{get:function(){return m.metrics.offsetY+this.newBaseline}}});Object.defineProperties(A.metrics,
{parent:{value:h},limitWidth:{value:D},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+2*this.parent.metrics.paddingX+this.limitWidth}},offsetY:{get:function(){return m.metrics.offsetY}}});h.metrics.w=D+A.metrics.w+3*h.metrics.paddingX;h.metrics.ascent=Math.max(A.metrics.ascent,z.ascent)+h.metrics.paddingY;z=0;A=Math.max(p.$jscomp$loop$prop$limitFrom$339.metrics.descent,v.metrics.descent,A.metrics.descent);
if(0!=p.$jscomp$loop$prop$limitFrom$339.metrics.h||0!=v.metrics.h)z=w,A=Math.max(p.$jscomp$loop$prop$limitFrom$339.metrics.descent,v.metrics.descent,A-z);h.metrics.descent=z+A+h.metrics.paddingY;h.metrics.h=h.metrics.ascent+h.metrics.descent;e+=2*h.metrics.marginX}else if("matrix"===l.nodeType){h=l;h.updateFormula();v=h.children;B=h.rows;A=h.columns;h.metrics.marginX=parseInt(1.5+.075*this.style.size);h.metrics.paddingX=parseInt(5+.075*this.style.size);h.metrics.paddingY=parseInt(1.5+.05*this.style.size);
h.metrics.offsetX_aux=e;Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return m.metrics.offsetX+m.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return m.metrics.offsetY}}});b.ctx.font=l.style.toString();var H=d(b.ctx.font);w=[];z=[];I=D=void 0;for(var G=0,F=B*A;G<F;G++)D=parseInt(G/A),I=G%A,w[D]=Math.max(w[D]||0,v[G].metrics.h),z[I]=Math.max(z[I]||0,v[G].metrics.w);G=(1+A)*h.metrics.paddingX;
for(D=0;D<A;D++)G+=z[D];F=(1+B)*h.metrics.paddingY;for(D=0;D<B;D++)F+=w[D];H=H.descent-H.h/2;var C=0;for(B*=A;C<B;C++)D=parseInt(C/A),I=C%A,v[C].metrics.offsetX_aux=a(z,I)+(z[I]-v[C].metrics.w)/2+I*h.metrics.paddingX,v[C].metrics.offsetY_aux=a(w,D)+(w[D]-v[C].metrics.h)/2+(1+D)*h.metrics.paddingY,Object.defineProperties(v[C].metrics,{parent:{value:h},matrixH:{value:F},dispY:{value:H},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+
this.parent.metrics.paddingX+this.offsetX_aux}},offsetY:{get:function(){return m.metrics.offsetY-this.matrixH/2+this.ascent+this.offsetY_aux+this.dispY}}});h.metrics.w=G;h.metrics.ascent=F/2-H;h.metrics.descent=F/2+H;h.metrics.h=h.metrics.ascent+h.metrics.descent;e+=2*h.metrics.marginX}else if("defparts"===l.nodeType){h=l;h.updateFormula();v=l.children;A=l.parts;h.metrics.marginX=parseInt(1.5+.075*this.style.size);h.metrics.paddingX=parseInt(1.5+.075*this.style.size);h.metrics.paddingY=parseInt(1.5+
.05*this.style.size);h.metrics.offsetX_aux=e;Object.defineProperties(h.metrics,{parent:{value:m},x:{get:function(){return this.offsetX-2*this.marginX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return m.metrics.offsetX+m.metrics.paddingX+3*this.marginX+this.offsetX_aux}},offsetY:{get:function(){return m.metrics.offsetY}}});b.ctx.font=l.style.toString();B=d(b.ctx.font);w=0;z=h.metrics.paddingY;B=B.descent-B.h/2;for(D=0;D<A;D++)v[D].metrics.offsetY_aux=z,w=Math.max(w,v[D].metrics.w),
z+=v[D].metrics.h+h.metrics.paddingY,Object.defineProperties(v[D].metrics,{parent:{value:h},dispY:{value:B},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX}},offsetY:{get:function(){return m.metrics.offsetY-this.parent.metrics.defpartsH/2+this.ascent+this.offsetY_aux+this.dispY}}});h.metrics.defpartsH=z;h.metrics.w=w+4*h.metrics.paddingX;h.metrics.ascent=z/2-B;h.metrics.descent=
z/2+B;h.metrics.h=h.metrics.ascent+h.metrics.descent;e+=2*h.metrics.marginX}else if("numerator"===l.nodeType||"denominator"===l.nodeType||"index"===l.nodeType||"radicand"===l.nodeType||"from"===l.nodeType||"to"===l.nodeType||"what"===l.nodeType||"element"===l.nodeType)l.updateFormula(),l.metrics.paddingX=parseInt(1.5+.075*this.style.size),l.metrics.paddingY=parseInt(1.5+.05*this.style.size),l.metrics.ascent+=l.metrics.paddingY,l.metrics.descent+=l.metrics.paddingY,l.metrics.h=l.metrics.ascent+l.metrics.descent,
1==l.children.length&&"text"==l.children[0].nodeType&&""==l.children[0].value?(l.metrics.w=0,b.in_editor||(l.metrics.ascent=l.metrics.descent=l.metrics.h=0)):l.metrics.w+=2*l.metrics.paddingX;h=l;this.metrics.ascent=Math.max(this.metrics.ascent,l.metrics.tmp_ascent||l.metrics.ascent);this.metrics.descent=Math.max(this.metrics.descent,l.metrics.descent);this.metrics.w+=l.metrics.w+2*l.metrics.marginX;this.metrics.h=this.metrics.ascent+this.metrics.descent;e+=l.metrics.w}};l.prototype.justifyAux=function(a){for(var b=
0,c=0,d=0,f=this.children.length;d<f-1;d++)"space"===this.children[d].nodeType?b++:c+=this.children[d].metrics.w;this.updateLine((a-c)/b)};l.prototype.drawTxtBlock=function(a){a.fillStyle=p;a.shadowBlur=this.style.shadowBlur;a.shadowOffsetX=this.style.shadowOffsetX;a.shadowOffsetY=this.style.shadowOffsetY;a.shadowColor=this.style.shadowColor;for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);a.shadowColor="transparent"};l.prototype.drawTxtLineBlock=function(a){for(var b=0,c=this.children.length;b<
c;b++)h=!1,this.children[b].draw(a)};l.prototype.drawText=function(a){if(""!==this.value){var b=this.metrics.x,c=this.metrics.y;a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:p;a.font=this.style.toString(h);a.beginPath();this.style.overline&&(a.rect(b,c-this.metrics.ascent+parseInt(1+this.style.size/25),this.metrics.w,parseInt(1+this.style.size/25)),a.fill());this.style.underline&&(a.rect(b,c+parseInt(1+this.style.size/10),this.metrics.w,
parseInt(1+this.style.size/25)),a.fill());if(this.style.border){var d=a.strokeStyle;a.lineWidth=this.style.border_size&&0<parseInt(this.style.border_size)?parseInt(this.style.border_size):1+parseInt(this.style.size/8);a.lineJoin="round";a.miterLimit=2;a.strokeStyle=this.style.border.getColor();a.strokeText(this.value,b,c);a.strokeStyle=d}a.fillText(this.value,b,c)}};l.prototype.drawWord=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a)};l.prototype.drawSpace=function(a){};
l.prototype.drawDynamicTxt=function(a){var b=this.metrics.x+this.metrics.paddingX,c=this.metrics.y;a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:p;a.font=this.style.toString(h);a.beginPath();this.style.overline&&(a.rect(b,c-this.metrics.ascent+parseInt(1+this.style.size/25),this.metrics.w,parseInt(1+this.style.size/25)),a.fill());this.style.underline&&(a.rect(b,c+parseInt(1+this.style.size/10),this.metrics.w,parseInt(1+this.style.size/25)),
a.fill());a.fillText(this.evalValue,b,c);this.drawBorder(a,"blue")};l.prototype.drawHyperlink=function(a){var b=this.metrics.x,c=this.metrics.y;this.ctx=a;this.clickCatcher.parentNode||(a.canvas.nextSibling.className?a.canvas.parentNode.insertBefore(this.clickCatcher,a.canvas.nextSibling.nextSibling):a.canvas.parentNode.insertBefore(this.clickCatcher,a.canvas.nextSibling));this.clickCatcher.style.left=b+"px";this.clickCatcher.style.top=c-this.metrics.ascent+"px";a.fillStyle="blue";this.click&&(a.fillStyle=
"white",a.fillRect(b,c-this.metrics.ascent,this.metrics.w,this.metrics.h),a.fillStyle="red");a.font=this.style.toString(h);a.beginPath();a.rect(b,c+parseInt(1+this.style.size/10),this.metrics.w,parseInt(1+this.style.size/25));a.fill();a.fillText(this.value,b,c)};l.prototype.drawFormula=function(a){for(var b=0,c=this.children.length;b<c;b++)h=!0,this.children[b].draw(a);this.drawBorder(a,"blue")};l.prototype.drawFraction=function(a){a.lineWidth=5;a.fillStyle=null!==this.style.color?this.style.color.getColor?
this.style.color.getColor():this.style.color:p;a.beginPath();var b=parseInt(1+this.style.size/24);a.rect(this.metrics.x,this.metrics.offsetY-parseInt(b/2),this.metrics.w,b);a.fill();this.children[0].draw(a);this.children[1].draw(a);this.drawBorder(a,"blue")};l.prototype.drawNumDen=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);this.drawBorder(a,"blue")};l.prototype.drawSuperIndex=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);this.drawBorder(a,
"blue")};l.prototype.drawSubIndex=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);this.drawBorder(a,"blue")};l.prototype.drawRadical=function(a){a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:p;this.style.border&&(a.lineWidth=this.style.border_size&&0<parseInt(this.style.border_size)?parseInt(this.style.border_size):1+parseInt(this.style.size/8),a.lineJoin="round",a.miterLimit=2,a.strokeStyle=this.style.border.getColor(),
a.lineWidth/=Math.max(this.radicalSign.scaleX,this.radicalSign.scaleY));a.save();a.font="1000px DJS_symbol";a.translate(this.radicalSign.x,this.radicalSign.y);a.scale(this.radicalSign.scaleX,this.radicalSign.scaleY);this.style.border&&a.strokeText("\u221a",-70,800);a.fillText("\u221a",-70,800);a.restore();a.fillRect(this.children[1].metrics.x+2.5,this.radicalSign.y-.5,this.children[1].metrics.w-1.5,parseInt(1+this.style.size/18));for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);
this.drawBorder(a,"blue")};l.prototype.drawSum=function(a){a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:p;a.font=1.9*this.sigmaSign.w+"px DJS_symbol";this.style.border&&(a.lineWidth=this.style.border_size&&0<parseInt(this.style.border_size)?parseInt(this.style.border_size):1+parseInt(this.style.size/8),a.lineJoin="round",a.miterLimit=2,a.strokeStyle=this.style.border.getColor(),a.strokeText("\u03a3",this.sigmaSign.x,this.sigmaSign.y+this.sigmaSign.h));
a.fillText("\u03a3",this.sigmaSign.x,this.sigmaSign.y+this.sigmaSign.h);for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);this.drawBorder(a,"blue")};l.prototype.drawIntegral=function(a){a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:p;a.font=1.5*this.sign.w+"px DJS_symbol";this.style.border&&(a.lineWidth=this.style.border_size&&0<parseInt(this.style.border_size)?parseInt(this.style.border_size):1+parseInt(this.style.size/
8),a.lineJoin="round",a.miterLimit=2,a.strokeStyle=this.style.border.getColor(),a.strokeText("\u222b",this.sign.x,this.sign.y+3*this.sign.h/4));a.fillText("\u222b",this.sign.x,this.sign.y+3*this.sign.h/4);for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);this.drawBorder(a,"blue")};l.prototype.drawProd=function(a){a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:p;a.font=1.5*this.piSign.w+"px DJS_symbol";this.style.border&&
(a.lineWidth=this.style.border_size&&0<parseInt(this.style.border_size)?parseInt(this.style.border_size):1+parseInt(this.style.size/8),a.lineJoin="round",a.miterLimit=2,a.strokeStyle=this.style.border.getColor(),a.strokeText("\u03a0",this.piSign.x,this.piSign.y+this.piSign.h));a.fillText("\u03a0",this.piSign.x,this.piSign.y+this.piSign.h);for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);this.drawBorder(a,"blue")};l.prototype.drawLimit=function(a){for(var b=0,c=this.children.length;b<
c;b++)this.children[b].draw(a);a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:p;this.style.border&&(a.lineWidth=this.style.border_size&&0<parseInt(this.style.border_size)?parseInt(this.style.border_size):1+parseInt(this.style.size/8),a.lineJoin="round",a.miterLimit=2,a.strokeStyle=this.style.border.getColor());a.font=this.style.toString();this.style.border&&a.strokeText("l\u00edm",this.limitText.x,this.metrics.y);a.fillText("l\u00edm",this.limitText.x,
this.metrics.y);0!=this.children[1].metrics.h&&(this.style.border&&a.strokeText("\u2192",this.limitArrow.x,this.limitArrow.y),a.fillText("\u2192",this.limitArrow.x,this.limitArrow.y));this.drawBorder(a,"blue")};l.prototype.drawMatrix=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);c=parseInt(1.5+this.style.size/25);b=c/2;a.lineWidth=c;a.strokeStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:p;a.beginPath();if(0==this.matrix_type)a.moveTo(this.metrics.x+
b+1.5*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+b,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+b,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.lineTo(this.metrics.x+b+1.5*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-b-1.5*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+this.metrics.w-b,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+
this.metrics.w-b,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.lineTo(this.metrics.x+this.metrics.w-b-1.5*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent+this.metrics.h);else if(1==this.matrix_type)a.moveTo(this.metrics.x+b+2*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent),a.bezierCurveTo(this.metrics.x-b,this.metrics.y+b-this.metrics.ascent,this.metrics.x-b,this.metrics.y+b-this.metrics.ascent+this.metrics.h,this.metrics.x+b+2*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent+
this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-b-2*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent),a.bezierCurveTo(this.metrics.x+this.metrics.w+b,this.metrics.y+b-this.metrics.ascent,this.metrics.x+this.metrics.w+b,this.metrics.y+b-this.metrics.ascent+this.metrics.h,this.metrics.x+this.metrics.w-b-2*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent+this.metrics.h);else if(2==this.matrix_type){c=3*this.metrics.marginX;var d=c/2;a.moveTo(this.metrics.x+b+c,this.metrics.y+
b-this.metrics.ascent);a.bezierCurveTo(this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent,this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent,this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+2*this.metrics.marginX);a.lineTo(this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2-5*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+
b,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2);a.bezierCurveTo(this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2+5*this.metrics.marginX);a.lineTo(this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+this.metrics.h-2*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+b+d,this.metrics.y-b-this.metrics.ascent+this.metrics.h,
this.metrics.x+b+d,this.metrics.y-b-this.metrics.ascent+this.metrics.h,this.metrics.x+b+c,this.metrics.y-b-this.metrics.ascent+this.metrics.h);a.moveTo(this.metrics.x+this.metrics.w+b-c,this.metrics.y+b-this.metrics.ascent);a.bezierCurveTo(this.metrics.x+this.metrics.w+b-d,this.metrics.y+b-this.metrics.ascent,this.metrics.x+this.metrics.w+b-d,this.metrics.y+b-this.metrics.ascent,this.metrics.x+this.metrics.w+b-d,this.metrics.y+b-this.metrics.ascent+2*this.metrics.marginX);a.lineTo(this.metrics.x+
this.metrics.w+b-d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2-5*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+this.metrics.w+b-d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+this.metrics.w+b-d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+this.metrics.w+b,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2);a.bezierCurveTo(this.metrics.x+this.metrics.w+b-d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+this.metrics.w+
b-d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+this.metrics.w+b-d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2+5*this.metrics.marginX);a.lineTo(this.metrics.x+this.metrics.w+b-d,this.metrics.y+b-this.metrics.ascent+this.metrics.h-2*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+this.metrics.w+b-d,this.metrics.y-b-this.metrics.ascent+this.metrics.h,this.metrics.x+this.metrics.w+b-d,this.metrics.y-b-this.metrics.ascent+this.metrics.h,this.metrics.x+this.metrics.w+
b-c,this.metrics.y-b-this.metrics.ascent+this.metrics.h)}else 3==this.matrix_type?(a.moveTo(this.metrics.x+b,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+b,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-b,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+this.metrics.w-b,this.metrics.y+b-this.metrics.ascent+this.metrics.h)):4==this.matrix_type&&(a.moveTo(this.metrics.x+b,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+
b,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+b+1.25*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+b+1.25*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-b,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+this.metrics.w-b,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-b-1.25*this.metrics.marginX,this.metrics.y+
b-this.metrics.ascent),a.lineTo(this.metrics.x+this.metrics.w-b-1.25*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent+this.metrics.h));a.stroke();this.drawBorder(a,"blue")};l.prototype.drawDefparts=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);c=parseInt(1.5+this.style.size/25);b=c/2;a.lineWidth=c;a.strokeStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:p;a.beginPath();c=3*this.metrics.marginX;var d=c/2;
a.moveTo(this.metrics.x+b+c,this.metrics.y+b-this.metrics.ascent);a.bezierCurveTo(this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent,this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent,this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+2*this.metrics.marginX);a.lineTo(this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2-5*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+d,this.metrics.y+
b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2);a.bezierCurveTo(this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2+5*this.metrics.marginX);a.lineTo(this.metrics.x+b+d,this.metrics.y+b-this.metrics.ascent+this.metrics.h-2*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+
b+d,this.metrics.y-b-this.metrics.ascent+this.metrics.h,this.metrics.x+b+d,this.metrics.y-b-this.metrics.ascent+this.metrics.h,this.metrics.x+b+c,this.metrics.y-b-this.metrics.ascent+this.metrics.h);a.stroke();this.drawBorder(a,"blue")};l.prototype.drawGenericBlock=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);this.drawBorder(a,"blue")};l.prototype.drawComponentNumCtrl=function(a){this.componentNumCtrl.expresion=this.evaluator.parser.parse("("+this.metrics.x+","+
(this.metrics.y-this.metrics.ascent)+","+this.componentNumCtrl.w+","+this.componentNumCtrl.h+")");this.componentNumCtrl&&this.componentNumCtrl.parent&&this.componentNumCtrl.parent.readyApp&&this.componentNumCtrl.update(!0)};l.prototype.drawComponentSpace=function(a){this.componentSpace.xExpr=this.evaluator.parser.parse(this.metrics.x.toString());this.componentSpace.yExpr=this.evaluator.parser.parse((this.metrics.y-this.metrics.ascent).toString());this.componentSpace&&this.componentSpace.parent&&this.componentSpace.parent.readyApp&&
this.componentSpace.update(!0)};l.prototype.drawBorderSpecial=function(a,b){a.beginPath();a.setLineDash([1,2]);a.strokeStyle=b;a.lineWidth=1;a.rect(parseInt(this.metrics.x)+.5,parseInt(this.metrics.y-this.metrics.ascent)+.5,this.metrics.w,this.metrics.h);a.stroke();a.setLineDash([])};var n={sansserif:{ascent:1854,descent:-434,lineGap:67,capHeight:1409,xHeight:1082,unitsPerEm:2048},serif:{ascent:1825,descent:-443,lineGap:87,capHeight:1341,xHeight:940,unitsPerEm:2048},monospace:{ascent:1705,descent:-615,
lineGap:0,capHeight:1349,xHeight:1082,unitsPerEm:2048}};b.TextNode=l;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=String.fromCharCode,d,h,p,c,f,l,n,m,g,q,e,r=function(){};r.prototype.tokenize=function(b){if(b)b=b.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quote;/g,"''").replace(/&squot;/g,"'").replace(/\\rquote /g,"'").replace(/\\endash /g,"-").replace(/\n/g," ").replace(/\r/g,"").replace(/\\uc(\d+) /g,"").replace(/\\uc(\d+)/g,"");else return[];d=[];h="";c=p=0;l=b.charAt(0);n=!1;for(m="text";p<b.length;)f=l,l=b.charAt(p+1),n?"\\"===l||"{"===l||"}"===
l||" "===l||";"===l?(n=!1,h+=f," "===l?(p++,l=b.charAt(p+1),e=!0):e=!1,(g=h.match(/^'([0-9a-f]{2})/))?(q="","text"===m&&(q=d.pop().value),h=q+=a(parseInt(g[1],16))+h.substring(3)):(g=h.match(/^u[0-9]+/))?(q="","text"===m&&(q=d.pop().value),h=q+=a(g[0].substring(1))):("{"===h||"}"===h||"\\"==f?(d.push({type:"text",value:h+(e?" ":"")}),m="text"):(d.push({type:"controlWord",value:h}),m="controlWord"),h="")):"{"==f||"}"==f||"\\"==f?(n=!1,d.push({type:"text",value:f}),m="text"):h+=f:"\\"===f?(n=!0,""!==
h&&(d.push({type:"text",value:h}),m="text",h="")):"{"===f?(c++,""!==h&&(d.push({type:"text",value:h}),h=""),d.push({type:"openBlock",value:c}),m="openBlock"):"}"===f?(""!==h&&(d.push({type:"text",value:h}),h=""),d.push({type:"closeBlock",value:c}),m="closeBlock",c--):h+=f,p++;""!==h&&d.push({type:"text",value:h});return d};b.RTFTokenizer=r;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=Math.max,d,h,p,c,f,l,n,m,g,q,e,r,x,y,u,v,A,w,z,B,D,I,H,G,F,C,J,Q,R,O,M,P=function(a){this.evaluator=a;this.tokenizer=new b.RTFTokenizer};P.prototype.parse=function(E){d=this.tokenizer.tokenize(E);h={};c=2;if("openBlock"===d[0].type&&"fonttbl"===d[1].value){for(p=d[0].value;"closeBlock"!==d[c].type&&d[c].value!==p;)h[d[c].value]=d[c+2].value.substring(0,d[c+2].value.length-1),c+=3;c++}f={};l=0;if("openBlock"===d[c].type&&"colortbl"===d[c+1].value){p=
d[c++].value;for(c++;"closeBlock"!==d[c].type&&d[c].value!==p;)n=parseInt(d[c++].value.substring(3)).toString(16),m=parseInt(d[c++].value.substring(5)).toString(16),g=parseInt(d[c++].value.substring(4)).toString(16),";"===d[c].value&&c++,f[l++]="#"+(2>n.length?"0"+n:n)+(2>m.length?"0"+m:m)+(2>g.length?"0"+g:g);c++}y=x=r=null;R=Q=J=D=B=z=w=A=v=u=!1;I=[new b.TextStyle];H=I[0];F=G=-1;C=[];q=O=new b.TextNode("","txtBlock",H,this.evaluator);e=new b.TextNode("","txtLineBlock",H,this.evaluator);q.addChild(e);
O.stableWidth=!0;O.hasFormula=!1;E=c;for(var L=d.length;E<L;E++){if("controlWord"==d[E].type)if(h[d[E].value])H.set({family:h[d[E].value]});else if(/^fs(\d+)/.test(d[E].value))H.set({size:parseInt(d[E].value.match(/^fs(\d+)/)[1]/2)});else if("b"==d[E].value)H.set({bold:!0}),0<C.length&&C[C.length-1].style.set({bold:!0});else if("b0"==d[E].value)H.set({bold:!1}),0<C.length&&C[C.length-1].style.set({bold:!1});else if("i"==d[E].value)H.set({italic:!0}),0<C.length&&C[C.length-1].style.set({italic:!0});
else if("i0"==d[E].value)H.set({italic:!1}),0<C.length&&C[C.length-1].style.set({italic:!1});else if("ul"==d[E].value)H.set({underline:!0}),0<C.length&&C[C.length-1].style.set({underline:!0});else if("ulnone"==d[E].value)H.set({underline:!1}),0<C.length&&C[C.length-1].style.set({underline:!1});else if("ol"==d[E].value)H.set({overline:!0}),0<C.length&&C[C.length-1].style.set({overline:!0});else if("olnone"==d[E].value)H.set({overline:!1}),0<C.length&&C[C.length-1].style.set({overline:!1});else if(/^cf(\d+)/.test(d[E].value))H.set({color:f[parseInt(d[E].value.substring(2))]}),
0<C.length&&(C[C.length-1].style.color=H.color);else if("par"==d[E].value){q=new b.TextNode("","txtLineBlock",H.clone(),this.evaluator);if("txtBlock"!=e.nodeType)for(e=e.parent;"txtBlock"!=e.nodeType;)e=e.parent;e.addChild(q);e=q}else if("mjaformula"==d[E].value)O.hasFormula=!0,F=G,u=!0,q=new b.TextNode("","formula",H.clone(),this.evaluator),e.addChild(q),e=q,C[C.length-1]=q;else if("fraction"==d[E].value||"radicand"==d[E].value||"radical"==d[E].value||"what"==d[E].value||"sum"==d[E].value||"integral"==
d[E].value||"limit"==d[E].value){var K=C[C.length-2].style.clone();q=new b.TextNode("",d[E].value,K,this.evaluator);C[C.length-2].addChild(q);C[C.length-1]=q}else"index"==d[E].value?(K=C[C.length-2].style.clone(),K.size=a(parseInt(K.size-.5*K.size),8),q=new b.TextNode("",d[E].value,K,this.evaluator),C[C.length-2].addChild(q),C[C.length-1]=q):"to"==d[E].value||"from"==d[E].value?(K=C[C.length-2].style.clone(),K.size=a(parseInt(K.size-.2*K.size),8),q=new b.TextNode("",d[E].value,K,this.evaluator),C[C.length-
2].addChild(q),C[C.length-1]=q):"num"==d[E].value||"den"==d[E].value?(K=C[C.length-2].style.clone(),K.size=a(Math.round(K.size-.1*K.size),8),"num"==d[E].value?q=new b.TextNode("","numerator",K,this.evaluator):"den"==d[E].value&&(q=new b.TextNode("","denominator",K,this.evaluator)),C[C.length-2].addChild(q),C[C.length-1]=q):"subix"==d[E].value||"supix"==d[E].value?(K=C[C.length-2].style.clone(),K.size=a(Math.floor(K.size-.33*K.size),8),"subix"==d[E].value?q=new b.TextNode("","subIndex",K,this.evaluator):
"supix"==d[E].value&&(q=new b.TextNode("","superIndex",K,this.evaluator)),q.originalStyle=C[C.length-2].style.clone(),C[C.length-2].addChild(q),C[C.length-1]=q):"defparts"==d[E].value||"matrix"==d[E].value||"element"==d[E].value?(K=C[C.length-2].style.clone(),q=new b.TextNode("",d[E].value,K,this.evaluator),C[C.length-2].addChild(q),C[C.length-1]=q,"defparts"==d[E].value?y=q:"matrix"==d[E].value&&(x=q,x.matrix_type=0)):"parts"==d[E].value?D=!0:"type"==d[E].value?w=!0:"rows"==d[E].value?z=!0:"columns"==
d[E].value?B=!0:"expr"==d[E].value?(O.stableWidth=!1,v=!0):"decimals"==d[E].value?A=!0:"fixed1"==d[E].value?r.fixed=!0:"fixed0"==d[E].value?r.fixed=!1:"component"!=d[E].value&&("NumCtrl"==d[E].value?J=!0:"Space"==d[E].value?Q=!0:"hyperlink"==d[E].value&&(R=!0));if("text"==d[E].type)if(D)y.parts=parseInt(d[E].value),D=!1;else if(w)x.matrix_type=parseInt(d[E].value),w=!1;else if(z)x.rows=parseInt(d[E].value),z=!1;else if(B)x.columns=parseInt(d[E].value),B=!1;else if(A)r.decimals=this.evaluator.parser.parse(d[E].value+
""),A=!1;else if(R){M=d[E].value.split("|")[0];tmpStyle=H.clone();q=new b.TextNode(M,"hyperlink",tmpStyle,this.evaluator);q.URL=d[E].value.split("|")[1];if("txtLineBlock"!=e.nodeType)for(e=e.parent;"txtLineBlock"!=e.nodeType;)e=e.parent;e.addChild(q);R=!1}else if(J)q=new b.TextNode(d[E].value,"componentNumCtrl",H.clone(),this.evaluator),e.addChild(q),J=!1;else if(Q)q=new b.TextNode(d[E].value,"componentSpace",H.clone(),this.evaluator),e.addChild(q),Q=!1;else if(v)K=C[C.length-2].style.clone(),M=this.evaluator.parser.parse(d[E].value),
q=new b.TextNode(M,"dynamicTxt",K,this.evaluator),C[C.length-2].addChild(q),r=C[C.length-1]=q,v=!1;else if(v||u)!v&&u&&(M=d[E].value,q=new b.TextNode(M,"text",C[C.length-1].style.clone(),this.evaluator),C[C.length-1].addChild(q));else{M=d[E].value;q=new b.TextNode(M,"text",H.clone(),this.evaluator);if("txtLineBlock"!=e.nodeType)for(e=e.parent;"txtLineBlock"!=e.nodeType;)e=e.parent;e.addChild(q)}else if("openBlock"==d[E].type)G=d[E].value,H=H.clone(),I.push(H),C.push(null);else if("closeBlock"==d[E].type)d[E].value==
F&&(F=-1,u=!1,e=e.parent),I.pop(),H=I[I.length-1],C.pop();else if("("==d[E].type||")"==d[E].type)K=C[C.length-1].style.clone(),K.italic="",q=new b.TextNode(d[E].type,"mathSymbol",K,this.evaluator),C[C.length-1].addChild(q);else if("+"==d[E].type||"-"==d[E].type||"*"==d[E].type||"="==d[E].type)q=new b.TextNode(d[E].type,"mathSymbol",C[C.length-1].style.clone(),this.evaluator),C[C.length-1].addChild(q)}return O.normalize()};b.RTFParser=P;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l,n,m,g,q,e,r=function(c,d){a=this;a.parent=c;a.evaluator=a.parent.evaluator;h=a.evaluator;p=h.parser;a.id=a.imageSrc=a.x_axis=a.y_axis=a.cID="";a.type="2D";a.xExpr=a.yExpr=p.parse("0");a.w=parseInt(c.container.width);a.h=parseInt(c.container.height);a.drawif=p.parse("1");a.fixed=a.text=a.numbers=a.sensitive_to_mouse_movements=!1;a.scale=48;a.Ox=a.Oy=a.mouse_x=a.mouse_y=a.border_width=a.border_radius=0;a.image=new Image;a.image.onload=
function(){this.ready=1};a.bg_display="topleft";a.background=new b.Color("ffffff");a.net=new b.Color("b8c4c8");a.net10=new b.Color("889498");a.axes=new b.Color("405860");a.border_color=new b.Color("000000");a.ctrs=[];a.graphicsCtr=[];a.graphics=[];a.backGraphics=[];a.zIndex=c.zIndex;a.plecaHeight=c.plecaHeight||0;a.displaceRegionNorth=c.displaceRegionNorth||0;a.displaceRegionWest=c.displaceRegionWest||0;Object.assign(a,d);a.initSpace()};r.prototype.initSpace=function(){a=this;d=a.parent;h=a.evaluator;
c=a.id+".";a.resizable||(a.displaceRegionNorth=d.displaceRegionNorth||0,a.displaceRegionSouth=d.displaceRegionSouth||0,a.displaceRegionEast=d.displaceRegionEast||0,a.displaceRegionWest=d.displaceRegionWest||0,m=parseInt(d.container.width),n=parseInt(d.container.height),void 0!=a.wExpr&&(a.w=parseInt(m-a.displaceRegionWest-a.displaceRegionEast)*parseFloat(a.wExpr)/100),void 0!=a.hExpr&&(a.h=parseInt(n-a.displaceRegionNorth-a.displaceRegionSouth)*parseFloat(a.hExpr)/100),void 0!=a.xPercentExpr&&(a.xExpr=
h.parser.parse((parseInt(m-a.displaceRegionWest-a.displaceRegionEast)*parseFloat(a.xPercentExpr)/100).toString())),void 0!=a.yPercentExpr&&(a.yExpr=h.parser.parse((parseInt(n-a.displaceRegionNorth-a.displaceRegionSouth)*parseFloat(a.yPercentExpr)/100).toString())),a.x=h.eval(a.xExpr)+a.displaceRegionWest,a.y=h.eval(a.yExpr)+a.plecaHeight+a.displaceRegionNorth,a.container&&(a.container.style.left=a.x+"px",a.container.style.top=a.y+"px"),0<=a.y?(f=n-a.y,a.h>f&&(a.h=f)):(f=a.h+a.y,a.h=f>=n?n:f),0<=a.x?
(l=m-a.x,a.w>l&&(a.w=l)):(l=a.w+a.x,a.w=l>=m?m:l));""==a.imageSrc&&/vacio.gif$/i.test(a.imageSrc.trim())||(a.image=d.getImage(a.imageSrc));a.OxExpr&&(q=a.OxExpr,q.endsWith("%")?a.Ox=a.w*parseFloat(q)/100:(g=parseFloat(q),g!=q&&(g=0),a.Ox=g));a.OyExpr&&(e=a.OyExpr,e.endsWith("%")?a.Oy=a.h*parseFloat(e)/100:(g=parseFloat(e),g!=e&&(g=0),a.Oy=g));""!==a.id&&2!==d.version?(h.setVariable(c+"_w",a.w),h.setVariable(c+"_h",a.h),h.setVariable(c+"escala",h.getVariable(c+"escala")||a.scale),h.setVariable(c+"Ox",
h.getVariable(c+"Ox")||a.Ox),h.setVariable(c+"Oy",h.getVariable(c+"Oy")||a.Oy),h.setVariable(c+"mouse_x",0),h.setVariable(c+"mouse_y",0),h.setVariable(c+"mouse_pressed",0),h.setVariable(c+"mouse_clicked",0),h.setVariable(c+"clic_izquierdo",0)):(g=h.getVariable("_w"),h.setVariable("_w",void 0===g?a.w:g),g=h.getVariable("_h"),void 0===g&&(g=a.h),h.setVariable("_h",g),g=h.getVariable("escala"),void 0===g&&(g=a.scale),h.setVariable("escala",g),g=h.getVariable("Ox"),void 0===g&&(g=a.Ox),h.setVariable("Ox",
g),g=h.getVariable("Oy"),void 0===g&&(g=a.Oy),h.setVariable("Oy",g),h.setVariable("mouse_x",0),h.setVariable("mouse_y",0),h.setVariable("mouse_pressed",0),h.setVariable("mouse_clicked",0),h.setVariable("clic_izquierdo",0),2==d.version&&""===a.x_axis&&""===a.y_axis&&(a.axes=""));a.w_2=a.w/2;a.h_2=a.h/2;h.setFunction(c+"download_image",function(b){a.evaluator.functions._SaveSpace_(b,a.canvas.toDataURL("image/png"))})};r.prototype.addCtr=function(a){"GraphicControl"===a.type?this.graphicsCtr.push(a):
this.ctrs.push(a)};r.prototype.addGraph=function(a,b){"2D"===this.type&&b||"3D"===this.type&&!b||(a.background&&"3D"!==this.type?this.backGraphics.push(a):this.graphics.push(a))};r.prototype.clearClick=function(){this.evaluator.setVariable(this.mclickedString,0);this.evaluator.setVariable(this.mclicizquierdoString,0)};r.prototype.getRelativeX=function(a){return(parseInt(a)-this.w_2-this.Ox)/this.scale};r.prototype.getRelativeY=function(a){return(-parseInt(a)+this.h_2+this.Oy)/this.scale};r.prototype.getAbsoluteX=
function(a){return a*this.scale+this.w_2+this.Ox};r.prototype.getAbsoluteY=function(a){return-a*this.scale+this.h_2+this.Oy};b.Space=r;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d=function(d){a=this;a.parent=d;a.width=228;a.vSpace=25;a.container=b.newHTML("div",{style:"box-sizing:border-box;border-style:ridge;border-width:5px;border-color:gray;box-shadow:#000 0 0 25px 5px;overflow-y:scroll;overflow-x:hidden;position:fixed;left:0;top:0;z-index:10000;background-color:#63b4fb;width:"+(a.width+27)+"px;height:460px;"});a.movable=b.newHTML("div",{style:"position:absolute;left:0;top:0;width:"+(a.width+27)+"px;height:"+a.vSpace+
"px;line-height:"+a.vSpace+"px;background-color:#ddd;cursor:move;padding-left:75px;font-family:"+b.sansserif_font+";font-size:18px;"});a.movable.innerHTML="Descartes";a.container.appendChild(a.movable);a.ctrs=[]};d.prototype.init=function(){function d(c){a.newPos=b.getCursorPosition(c,document.body);a.container.style.left=a.initialPosition.x+(a.newPos.x-a.oldPos.x)*b.cssScale+"px";a.container.style.top=a.initialPosition.y+(a.newPos.y-a.oldPos.y)*b.cssScale+"px"}function p(a){a.preventDefault();document.body.removeEventListener("mousemove",
d);document.body.removeEventListener("mouseup",p)}a=this;document.body.appendChild(a.container);var c=a.parent.evaluator.parser;a.numCtr=a.ctrs.length;a.ctrs.forEach(function(b,d){b.expresion=c.parse("(0,"+(a.vSpace+23+35*d)+","+a.width+",35)");b.update()});var f=new b.Button(a.parent,{region:"external",name:"english"==a.language?"about":"cr\u00e9ditos",font_size:c.parse("15"),expresion:c.parse("(0,"+a.vSpace+","+a.width/2+",25)")});f.actionExec={execute:b.showAbout};f.update();(new b.Button(a.parent,
{region:"external",name:"config",font_size:c.parse("15"),action:"config",expresion:c.parse("("+a.width/2+","+a.vSpace+","+a.width/2+",25)")})).update();(new b.Button(a.parent,{region:"external",name:"english"==a.language?"init":"inicio",font_size:c.parse("15"),action:"init",expresion:c.parse("(0,"+(a.vSpace+23+35*a.numCtr)+","+a.width/2+",25)")})).update();(new b.Button(a.parent,{region:"external",name:"english"==a.language?"clear":"limpiar",font_size:c.parse("15"),action:"clear",expresion:c.parse("("+
a.width/2+","+(a.vSpace+23+35*a.numCtr)+","+a.width/2+",25)")})).update();f=new b.Button(a.parent,{region:"external",name:"english"==a.language?"close":"cerrar",font_size:c.parse("15"),expresion:c.parse("("+a.width/4+","+(a.vSpace+46+35*a.numCtr)+","+a.width/2+",25)")});f.update();f.btn.addEventListener("click",function(b){a.hide()});a.setPositionAndSize();a.movable.addEventListener("mousedown",function(c){c.preventDefault();a.oldPos=b.getCursorPosition(c,document.body);a.initialPosition={x:a.container.offsetLeft,
y:a.container.offsetTop};document.body.addEventListener("mousemove",d);document.body.addEventListener("mouseup",p)});a.hide()};d.prototype.addCtr=function(a){this.ctrs.push(a)};d.prototype.show=function(){this.setPositionAndSize();this.container.style.display="block"};d.prototype.hide=function(){this.container.style.display="none"};d.prototype.setPositionAndSize=function(){a=this;var b=a.vSpace+46+35*a.numCtr+25+10;a.container.style.left=Math.max(parseInt(window.innerWidth-a.width)/2,0)+"px";a.container.style.top=
"5px";a.container.style.height=window.innerHeight<a.vSpace+75?a.vSpace+75+"px":b>window.innerHeight-10?window.innerHeight-10+"px":b+"px"};b.SpaceExternal=d;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d=2*Math.PI,h=b.convertFont("Serif,BOLD+ITALIC,16"),p=b.convertFont("Monospaced,PLAIN,12"),c=Math.floor,f=Math.round,l,n,m,g,q,e,r,x,y,u,v,A,w,z,B,D,I,H,G,F,C,J,Q,R,O,M,P,E,L,K,N=function(c,d){a=d=b.Space.call(this,c,d)||this;a.ratio=c.ratio;a.canvas=b.newHTML("canvas",{id:a.id+"_canvas",class:"DescartesSpace2DCanvas",width:a.w*a.ratio+"px",height:a.h*a.ratio+"px"});a.backCanvas=b.newHTML("canvas",{id:a.id+"_background",width:a.w*a.ratio+"px",height:a.h*
a.ratio+"px"});a.canvas.style=a.backCanvas.style=(0<a.border_width?"border:"+a.border_width+"px solid "+a.border_color.getColor()+";":"")+(a.border_radius?"border-radius:"+a.border_radius+"px;":"");a.canvas.style.zIndex=a.zIndex;a.canvas.style.width=a.backCanvas.style.width=a.w+"px";a.canvas.style.height=a.backCanvas.style.height=a.h+"px";a.ctx=a.canvas.getContext("2d");a.backCtx=a.backCanvas.getContext("2d");a.ctx.imageSmoothingEnabled=a.backCtx.imageSmoothingEnabled=!1;a.canvas.ratio=a.ratio;a.backCanvas.ratio=
a.ratio;a.graphicControlContainer=b.newHTML("div",{id:a.id+"_graphicControls",style:"position:absolute;left:0;top:0;z-index:"+a.zIndex+";"});a.numCtrContainer=b.newHTML("div",{id:a.id+"_numericalControls",style:"position:absolute;left:0;top:0;z-index:"+a.zIndex+";"});a.container=b.newHTML("div",{id:a.id,class:"DescartesSpace2DContainer",style:"z-index:"+a.zIndex+";"});a.container.appendChild(a.backCanvas);a.container.appendChild(a.canvas);a.container.appendChild(a.graphicControlContainer);a.container.appendChild(a.numCtrContainer);
c.container.insertBefore(a.container,c.loader);var e=a.id+".image";a.parent.images[e]=a.canvas;a.parent.images[e].ready=1;a.parent.images[e].complete=a.parent.images[e].canvas=!0;a.evaluator.setVariable(e,e);e=a.id+".back";a.parent.images[e]=a.backCanvas;a.parent.images[e].ready=1;a.parent.images[e].complete=a.parent.images[e].canvas=!0;a.evaluator.setVariable(e,e);e=""!==a.id&&2!==c.version?a.id+".":"";a.OxStr=e+"Ox";a.OyStr=e+"Oy";a.scaleStr=e+"escala";a.wStr=e+"_w";a.hStr=e+"_h";a.mxStr=e+"mouse_x";
a.myStr=e+"mouse_y";a.mpressedStr=e+"mouse_pressed";a.mclickedStr=e+"mouse_clicked";a.mclickIzqStr=e+"clic_izquierdo";a.click=0;a.resizable&&(a.wModExpr=c.evaluator.parser.parse(a.wModExpr),a.hModExpr=c.evaluator.parser.parse(a.hModExpr));"descartesJS_stage"!==a.id&&a.addEvents();c.evaluator.setVariable(a.id+"._refresh_back_",1);return d};$jscomp.inherits(N,b.Space);N.prototype.init=function(){a=this;a.initSpace();a.canvas&&(a.old_w=a.w,a.old_h=a.h,a.canvas.width=a.backCanvas.width=a.w*a.ratio,a.canvas.height=
a.backCanvas.height=a.h*a.ratio,a.canvas.style.width=a.backCanvas.style.width=a.w+"px",a.canvas.style.height=a.backCanvas.style.height=a.h+"px")};N.prototype.update=function(b){a=this;l=a.evaluator;n=a.parent;if(a.resizable){if(P=a.evaluator.eval(a.wModExpr),E=a.evaluator.eval(a.hModExpr),a.old_w!=P||a.old_h!=E)a.w=P,a.h=E,a.w_2=a.w/2,a.h_2=a.h/2,l.setVariable(a.wStr,a.w),l.setVariable(a.hStr,a.h),a.old_w=a.w,a.old_h=a.h,a.canvas.width=a.backCanvas.width=a.w*a.ratio,a.canvas.height=a.backCanvas.height=
a.h*a.ratio,a.canvas.style.width=a.backCanvas.style.width=a.w+"px",a.canvas.style.height=a.backCanvas.style.height=a.h+"px",b=!0}else l.setVariable(a.wStr,a.w),l.setVariable(a.hStr,a.h);a.drawIfVal=0<l.eval(a.drawif);if(a.drawIfVal){g=a.x!==l.eval(a.xExpr)+a.displaceRegionWest;q=a.y!==l.eval(a.yExpr)+n.plecaHeight+a.displaceRegionNorth;a.spaceChange=b||g||q||a.drawBefore!==a.drawIfVal||a.Ox!==l.getVariable(a.OxStr)||a.Oy!==l.getVariable(a.OyStr)||a.scale!==l.getVariable(a.scaleStr)||a.backColor!==
a.background.getColor();a.x=g?l.eval(a.xExpr)+a.displaceRegionWest:a.x;a.y=q?l.eval(a.yExpr)+n.plecaHeight+a.displaceRegionNorth:a.y;a.Ox=l.getVariable(a.OxStr);a.Oy=l.getVariable(a.OyStr);a.scale=l.getVariable(a.scaleStr);a.drawBefore=a.drawIfVal;a.scale=Math.max(1E-6,Math.min(1E6,a.scale));l.setVariable(a.scaleStr,a.scale);if(g||q)a.container.style.left=a.x+"px",a.container.style.top=a.y+"px";a.container.style.display="block";a.drawTrace=!a.spaceChange&&(!a.fixed&&!a.click||a.fixed);a.spaceChange&&
(a.backCtx.setTransform(a.ratio,0,0,a.ratio,0,0),a.drawBackground());a.ctx.setTransform(a.ratio,0,0,a.ratio,0,0);a.draw()}else a.container.style.display="none"};N.prototype.drawBackground=function(){a=this;l=a.evaluator;m=a.backCtx;m.clearRect(0,0,a.backCanvas.width,a.backCanvas.height);m.fillStyle=a.backColor=a.background.getColor();m.fillRect(0,0,a.backCanvas.width,a.backCanvas.height);a.image&&""!=a.image.src&&a.image.ready&&a.image.complete&&("topleft"===a.bg_display?m.drawImage(a.image,0,0):
"stretch"===a.bg_display?m.drawImage(a.image,0,0,a.w,a.h):"patch"===a.bg_display?(m.fillStyle=m.createPattern(a.image,"repeat"),m.fillRect(0,0,a.w,a.h)):"imgcenter"===a.bg_display&&m.drawImage(a.image,(a.w-a.image.width)/2,(a.h-a.image.height)/2));e=a.scale;r=0;for(x=Math.max(0,a.w+a.h);e>x;)e/=10,r++;for(;e<x/10;)e*=10;m.lineWidth=1;""!==a.net&&(m.strokeStyle=a.net.getColor(),a.drawMarks(m,e/10,-1));if(2!==a.parent.version&&""!==a.net10||2===a.parent.version&&""!==a.net&&""!==a.net10)m.strokeStyle=
a.net10.getColor(),a.drawMarks(m,e,-1);if(""!==a.axes){var b="";"no"==a.x_axis&&(b+="x");"no"==a.y_axis&&(b+="y");m.strokeStyle=a.axes.getColor();m.beginPath();"no"==a.x_axis||""===a.x_axis&&2===a.parent.version||(m.moveTo(0,c(a.h/2+a.Oy)+.5),m.lineTo(a.w,c(a.h/2+a.Oy)+.5));"no"==a.y_axis||""===a.y_axis&&2===a.parent.version||(m.moveTo(c(a.w/2+a.Ox)+.5,0),m.lineTo(c(a.w/2+a.Ox)+.5,a.h));m.lineWidth=1.2;m.stroke();m.lineWidth=1;a.drawMarks(m,e,4,b);a.drawMarks(m,e/2,2,b);a.drawMarks(m,e/10,1,b)}if(""!==
a.x_axis||""!==a.y_axis)m.fillStyle=""!==a.axes?a.axes.getColor():"#000",m.font=h,m.textAlign="right",m.textBaseline="alphabetic","no"!=a.x_axis&&m.fillText(a.x_axis,c(a.w)-2,c(a.h/2+a.Oy)+12),"no"!=a.y_axis&&m.fillText(a.y_axis,c(a.w/2+a.Ox)-2,12);a.numbers&&""!=a.axes&&(m.fillStyle=a.axes.getColor(),m.font=h,m.textAlign="start",m.textBaseline="bottom",e>(a.w+a.h)/2?a.drawNumbers(m,e/5,e<=a.scale?r+1:r):e>(a.w+a.h)/4?a.drawNumbers(m,e/2,e<=a.scale?r+1:r):a.drawNumbers(m,e,r));b=$jscomp.makeIterator(a.backGraphics);
for(var d=b.next();!d.done;d=b.next())d.value.draw()};N.prototype.draw=function(){a=this;m=a.ctx;l.getVariable(a.id+"._refresh_back_")&&m.clearRect(0,0,a.canvas.width,a.canvas.height);for(var b=$jscomp.makeIterator(a.graphics),e=b.next();!e.done;e=b.next())e=e.value,""!==e.trace&&a.drawTrace&&e.drawTrace(),e.draw();b=$jscomp.makeIterator(a.graphicsCtr);for(e=b.next();!e.done;e=b.next())e.value.draw();""!=a.text&&a.click&&"L"===a.whichBtn&&(m.save(),m.strokeStyle=m.fillStyle=a.text.getColor(),m.lineWidth=
1,m.font=p,m.textAlign="center",m.textBaseline="alphabetic",G=1>=a.scale?a.mouse_x.toFixed(0):a.mouse_x.toFixed(parseInt(a.scale).toString().length+1),F=1>=a.scale?a.mouse_y.toFixed(0):a.mouse_y.toFixed(parseInt(a.scale).toString().length+1),C="("+G+","+F+")",J=c(m.measureText(C).width/2),Q=a.getAbsoluteX(a.mouse_x),R=a.getAbsoluteY(a.mouse_y),O=c(Q),M=c(R-10),O+J>a.w?O=a.w-J:0>O-J&&(O=J),M+1>a.h?M=a.h:0>M-14&&(M=15),m.fillText(C,O,M),m.beginPath(),m.arc(Q,R,2.5,0,d),m.stroke(),m.restore())};N.prototype.drawMarks=
function(a,b,d,e){y=this.w;u=this.h;I=B=0;D=y;H=u;w=c(y/2+this.Ox);z=c(u/2+this.Oy);0<=d&&(B=w-d,D=w+d,I=z-d,H=z+d);a.beginPath();if(!e||e&&!e.match("x"))for(d=-f(w/b);(v=w+f(d*b))<y;d++)a.moveTo(v+.5,I+.5),a.lineTo(v+.5,H+.5);if(!e||e&&!e.match("y"))for(e=-f(z/b);(A=z+f(e*b))<u;e++)a.moveTo(B+.5,A+.5),a.lineTo(D+.5,A+.5);a.stroke()};N.prototype.drawNumbers=function(a,b,d){y=this.w;u=this.h;w=c(y/2+this.Ox);z=c(u/2+this.Oy);for(d=-f(w/b);(v=w+f(d*b))<y;d++)a.fillText(parseFloat((d*b/this.scale).toFixed(4)),
v+1,z-2);for(d=-f(z/b);(A=z+f(d*b))<u;d++)0!==parseFloat(-d*b/this.scale)&&a.fillText(parseFloat((-d*b/this.scale).toFixed(4)),w+5,A+5)};N.prototype.addEvents=function(){function a(b){window.focus();document.activeElement.blur();if(g.evaluator.variables[g.id+".DJS_NO_FIXED"]||!g.fixed||g.sensitive_to_mouse_movements)g.click=0,g.evaluator.setVariable(g.mpressedStr,0),g.evaluator.setVariable(g.mclickedStr,1),g.evaluator.setVariable(g.mclickIzqStr,1),window.removeEventListener("touchmove",f),window.removeEventListener("touchend",
a),b.stopPropagation(),b.preventDefault(),g.parent.update()}function c(a){document.activeElement.blur();window.focus();a.stopPropagation();a.preventDefault();g.click=0;g.evaluator.setVariable(g.mpressedStr,0);g.evaluator.setVariable(g.mclickedStr,1);g.evaluator.setVariable(g.mclickIzqStr,1);"R"===g.whichBtn&&(window.removeEventListener("mousemove",e),g.posZoom==g.posZoomNew&&b.showConfig&&(g.parent.externalSpace.show(),g.posZoom=!1,g.posZoomNew=!0));window.removeEventListener("mousemove",f);window.removeEventListener("mouseup",
c);g.parent.deactivateControls();g.parent.update()}function d(a){g.posAnte=b.getCursorPosition(a,g.container);g.mouse_x=g.getRelativeX(g.posAnte.x);g.mouse_y=g.getRelativeY(g.posAnte.y);g.evaluator.setVariable(g.mxStr,g.mouse_x);g.evaluator.setVariable(g.myStr,g.mouse_y);g.evaluator.setVariable(g.mclickedStr,0);g.evaluator.setVariable(g.mclickIzqStr,0);g.parent.update()}function e(a){a.preventDefault();g.posZoomNew=b.getCursorPosition(a,g.container).y;g.evaluator.setVariable(g.scaleStr,g.tempScale+
g.tempScale/45*((g.posZoom-g.posZoomNew)/10));g.parent.update()}function f(a){a.preventDefault();a.stopPropagation();g.fixed||(g.posNext=b.getCursorPosition(a,g.container),L=g.posAnte.x-g.posNext.x,K=g.posAnte.y-g.posNext.y,g.evaluator.setVariable(g.OxStr,g.Ox-L),g.evaluator.setVariable(g.OyStr,g.Oy-K));d(a)}var g=this;g.posZoom=g.posZoomNew=null;g.sensitive_to_mouse_movements&&g.canvas.addEventListener("touchmove",d);g.canvas.addEventListener("touchstart",function(b){window.focus();document.activeElement.blur();
if(g.evaluator.variables[g.id+".DJS_NO_FIXED"]||!g.fixed||g.sensitive_to_mouse_movements)g.parent.clearClick(),g.click=1,g.evaluator.setVariable(g.mpressedStr,1),g.evaluator.setVariable(g.mclickedStr,0),g.evaluator.setVariable(g.mclickIzqStr,0),g.parent.deactivateControls(),d(b),window.addEventListener("touchmove",f),window.addEventListener("touchend",a),b.stopPropagation(),b.preventDefault()});g.sensitive_to_mouse_movements&&g.canvas.addEventListener("mousemove",d);g.canvas.addEventListener("mousedown",
function(a){window.focus();document.activeElement.blur();a.stopPropagation();a.preventDefault();g.parent.clearClick();g.click=1;g.parent.deactivateControls();g.whichBtn=b.whichBtn(a);"R"===g.whichBtn?(window.addEventListener("mouseup",c),g.posZoom=b.getCursorPosition(a,g.container).y,g.posZoomNew=g.posZoom,g.fixed||(g.tempScale=g.scale,window.addEventListener("mousemove",e))):"L"===g.whichBtn&&(g.evaluator.setVariable(g.mpressedStr,1),g.evaluator.setVariable(g.mclickedStr,0),g.evaluator.setVariable(g.mclickIzqStr,
0),d(a),window.addEventListener("mousemove",f),window.addEventListener("mouseup",c))});document.addEventListener("visibilitychange",function(a){c(a)});document.addEventListener("mouseleave",function(a){g.click=0;g.evaluator.setVariable(g.mpressedStr,0);g.evaluator.setVariable(g.mclickedStr,1);g.evaluator.setVariable(g.mclickIzqStr,1);window.removeEventListener("mousemove",f);window.removeEventListener("mouseup",c)})};b.Space2D=N;return b}(descartesJS||{});
descartesJS=function(b){var a,d,h;function p(a,c){P=b.subtract3D(a,b.scalarProd3D(c,b.dotProduct3D(a,c)));E=b.add3D(a,b.scalarProd3D(P,-2));L=b.norm3D(E);return 0!==L?b.scalarProd3D(E,1/L):b.scalarProd3D(a,-1)}function c(a,b){return b.depth-a.depth}if(b.loadLib)return b;var f=Math.floor,l=Math.max,n=Math.cos,m=Math.sin,g,q,e,r,x,y,u,v,A,w,z,B,D,I,H,G,F=[],C,J,Q,R,O,M,P,E,L,K,N,V=function(a,c){e=c=b.Space.call(this,a,c)||this;e.ratio=a.ratio;e.backCanvas=b.newHTML("canvas",{id:e.id+"_background",width:e.w*
e.ratio+"px",height:e.h*e.ratio+"px"});e.canvas=b.newHTML("canvas",{id:e.id+"_canvas",width:e.w*e.ratio+"px",height:e.h*e.ratio+"px",class:"DescartesSpace3DCanvas",style:"z-index: "+e.zIndex+";"});e.ctx=e.canvas.getContext("2d");e.ctx.imageSmoothingEnabled=!1;e.canvas.ratio=e.ratio;e.canvas.style=e.backCanvas.style=(0<e.border_width?"border:"+e.border_width+"px solid "+e.border_color.getColor()+";":"")+(e.border_radius?"border-radius:"+e.border_radius+"px;":"");var d=e.id+".image";e.parent.images[d]=
e.canvas;e.parent.images[d].ready=1;e.parent.images[d].complete=!0;e.parent.images[d].canvas=!0;e.evaluator.setVariable(d,d);e.graphicControlContainer=b.newHTML("div",{id:e.id+"_graphicControls",style:"position:absolute;left:0px;top:0px;z-index:"+e.zIndex+";"});e.numCtrContainer=b.newHTML("div",{id:e.id+"_numericalControls",style:"position:absolute;left:0px;top:0px;z-index:"+e.zIndex+";"});e.container=b.newHTML("div",{id:e.id,class:"DescartesSpace3DContainer",style:"z-index:"+e.zIndex+";"});e.container.appendChild(e.backCanvas);
e.container.appendChild(e.canvas);e.container.appendChild(e.graphicControlContainer);e.container.appendChild(e.numCtrContainer);a.container.insertBefore(e.container,a.loader);e.eye={x:0,y:0,z:0};e.lights=[{x:50,y:50,z:70},{x:50,y:-50,z:30},{x:20,y:0,z:-80},{x:0,y:0,z:0}];d=0;for(var g=e.lights.length;d<g;d++)e.lights[d]=b.normalize3D(e.lights[d]);e.light3={x:0,y:0,z:0};e.intensity=[.4,.5,.3,0];e.userIntensity=0;e.dim=1;e.tmpIntensity=[];e.OxStr=e.id+".Ox";e.OyStr=e.id+".Oy";e.scaleStr=e.id+".escala";
e.wStr=e.id+"._w";e.hStr=e.id+"._h";e.obsStr=e.id+".observador";e.ojoXStr=e.id+".Ojo.x";e.ojoYStr=e.id+".Ojo.y";e.ojoZStr=e.id+".Ojo.z";e.rotZStr=e.id+".rot.z";e.rotYStr=e.id+".rot.y";e.userIDimStr=e.id+".userIlum.dim";e.userIIStr=e.id+".userIlum.I";e.userIxStr=e.id+".userIlum.x";e.userIyStr=e.id+".userIlum.y";e.userIzStr=e.id+".userIlum.z";e.evaluator.setVariable(e.rotZStr,0);e.evaluator.setVariable(e.rotYStr,0);e.evaluator.setVariable(e.userIDimStr,e.dim);e.evaluator.setVariable(e.userIIStr,e.userIntensity);
e.evaluator.setVariable(e.userIxStr,0);e.evaluator.setVariable(e.userIyStr,0);e.evaluator.setVariable(e.userIzStr,0);N=new b.Primitive3D({V:[new b.Vec4D],type:"vertex"},e);e.evaluator.setFunction(e.id+"._X3D2D_",function(a,b,c){N.V[0].x=a;N.V[0].y=b;N.V[0].z=c;N.computeDepth(e);return N.projV[0].x});e.evaluator.setFunction(e.id+"._Y3D2D_",function(a,b,c){N.V[0].x=a;N.V[0].y=b;N.V[0].z=c;N.computeDepth(e);return N.projV[0].y});e.resizable&&(e.wModExpr=a.evaluator.parser.parse(e.wModExpr),e.hModExpr=
a.evaluator.parser.parse(e.hModExpr));e.addEvents();return c};$jscomp.inherits(V,b.Space);V.prototype.init=function(a){e=this;e.initSpace();e.canvas&&(e.old_w=e.w,e.old_h=e.h,e.canvas.width=e.backCanvas.width=e.w*e.ratio,e.canvas.height=e.backCanvas.height=e.h*e.ratio,e.canvas.style.width=e.backCanvas.style.width=e.w+"px",e.canvas.style.height=e.backCanvas.style.height=e.h+"px");e.w_2=e.w/2;e.h_2=e.h/2;e.w_plus_h=e.w+e.h;e.oldMouse={x:0,y:0};e.S={x:e.h/1080*-20.6*(40/e.scale),y:0,z:0};e.Ojo={x:3*
e.w_2,y:0,z:0};e.evaluator.setVariable(e.ojoXStr,e.Ojo.x);e.evaluator.setVariable(e.ojoYStr,e.Ojo.y);e.evaluator.setVariable(e.ojoZStr,e.Ojo.z)};V.prototype.update=function(a){e=this;g=e.evaluator;q=e.parent;g.setVariable(e.wStr,e.w);g.setVariable(e.hStr,e.h);e.drawIfVal=0<g.eval(e.drawif);if(e.drawIfVal){e.resizable&&(wModExpr=e.evaluator.eval(e.wModExpr),hModExpr=e.evaluator.eval(e.hModExpr),e.old_w!=wModExpr||e.old_h!=hModExpr)&&(e.w=wModExpr,e.h=hModExpr,e.w_2=e.w/2,e.h_2=e.h/2,g.setVariable(e.wStr,
e.w),g.setVariable(e.hStr,e.h),e.old_w=e.w,e.old_h=e.h,e.canvas.width=e.backCanvas.width=e.w*e.ratio,e.canvas.height=e.backCanvas.height=e.h*e.ratio,e.canvas.style.width=e.backCanvas.style.width=e.w+"px",e.canvas.style.height=e.backCanvas.style.height=e.h+"px",a=!0,e.S={x:e.h/1080*-20.6*(40/e.scale),y:0,z:0},e.Ojo={x:3*e.w_2,y:0,z:0},e.evaluator.setVariable(e.ojoXStr,e.Ojo.x),e.evaluator.setVariable(e.ojoYStr,e.Ojo.y),e.evaluator.setVariable(e.ojoZStr,e.Ojo.z));y=e.x!==g.eval(e.xExpr)+e.displaceRegionWest;
u=e.y!==g.eval(e.yExpr)+q.plecaHeight+e.displaceRegionNorth;e.spaceChange=a||y||u||e.drawBefore!==e.drawIfVal||e.Ox!==g.getVariable(e.OxStr)||e.Oy!==g.getVariable(e.OyStr)||e.Ojo.x!==g.getVariable(e.ojoXStr)||e.Ojo.y!==g.getVariable(e.ojoYStr)||e.Ojo.z!==g.getVariable(e.ojoZStr)||e.scale!==g.getVariable(e.scaleStr);e.x=y?g.eval(e.xExpr)+e.displaceRegionWest:e.x;e.y=u?g.eval(e.yExpr)+q.plecaHeight+e.displaceRegionNorth:e.y;e.Ojo.x=g.getVariable(e.ojoXStr);e.Ojo.y=g.getVariable(e.ojoYStr);e.Ojo.z=g.getVariable(e.ojoZStr);
e.Ox=g.getVariable(e.OxStr);e.Oy=g.getVariable(e.OyStr);e.scale=g.getVariable(e.scaleStr);e.drawBefore=e.drawIfVal;if(a||void 0==e.observer){a=0;for(var b=e.parent.controls.length;a<b;a++)e.parent.controls[a].id===e.obsStr&&(K=!0);e.observer=K?g.getVariable(e.obsStr)||2.5*e.w_plus_h:2.5*e.w_plus_h;e.observer=l(e.observer,.25*e.w_plus_h);g.setVariable(e.obsStr,e.observer)}1E-6>e.scale?(e.scale=1E-6,g.setVariable(e.scaleStr,1E-6)):1E6<e.scale&&(e.scale=1E6,g.setVariable(e.scaleStr,1E6));if(y||u)e.container.style.left=
e.x+"px",e.container.style.top=e.y+"px";e.container.style.display="block";e.dim=g.getVariable(e.userIDimStr);e.userIntensity=g.getVariable(e.userIIStr);e.light3={x:parseInt(g.getVariable(e.userIxStr)),y:parseInt(g.getVariable(e.userIyStr)),z:parseInt(g.getVariable(e.userIzStr))};e.updateCamera();e.ctx.setTransform(e.ratio,0,0,e.ratio,0,0);e.draw()}else e.container.style.display="none"};V.prototype.updateCamera=function(){this.eye=b.scalarProd3D(this.Ojo,1/this.scale)};V.prototype.rotateVertex=function(c){w=
b.degToRad(e.evaluator.getVariable(e.rotZStr));z=n(w);B=m(w);a=c.x*z-c.y*B;d=c.x*B+c.y*z;h=c.z;w=b.degToRad(e.evaluator.getVariable(e.rotYStr));z=n(w);B=m(w);return{x:h*B+a*z,y:d,z:h*z-a*B}};V.prototype.project=function(a){var b=e.eye.x/(a.x-e.eye.x);return{x:e.getAbsoluteX(b*(e.eye.y-a.y)),y:e.getAbsoluteY(b*(e.eye.z-a.z)),z:e.eye.x-a.x}};V.prototype.computeColor=function(a,c,d){"object"!=typeof a&&(a.match("rgba")?a=b.RGBAToHexColor(a):a.match("#")&&(a=new b.Color(a.substring(1))));R=b.subtract3D(this.eye,
c.avg);O=b.norm3D(R);M=b.scalarProd3D(R,1/O);this.lights[3]=b.subtract3D(this.light3,c.avg);G=b.norm3D(this.lights[3]);for(var e=0,g=this.intensity.length-1;e<g;e++)F[e]=this.intensity[e]*this.dim;F[3]=this.userIntensity*this.userIntensity/G||0;C=d?this.dim/2:this.dim/4;J=0;Q=0>c.direction?c.normal:b.scalarProd3D(c.normal,-1);c=0;for(e=this.lights.length;c<e;c++)d?(J=Math.max(0,b.dotProduct3D(p(this.lights[c],Q),M)),J*=J*J):J=Math.max(0,b.dotProduct3D(this.lights[c],Q)),C+=F[c]*J;C=Math.min(C,1);
D=f(a.r*C);I=f(a.g*C);H=f(a.b*C);return"rgba("+D+","+I+","+H+","+a.a+")"};V.prototype.draw=function(){e=this;e.ctx.clearRect(0,0,e.canvas.width,e.canvas.height);e.ctx.fillStyle=e.background.getColor();e.ctx.fillRect(0,0,e.canvas.width,e.canvas.height);e.image&&""!=e.image.src&&e.image.ready&&e.image.complete&&("topleft"===e.bg_display?e.ctx.drawImage(e.image,0,0):"stretch"===e.bg_display?e.ctx.drawImage(e.image,0,0,e.w,e.h):"patch"===e.bg_display?(e.ctx.fillStyle=ctx.createPattern(e.image,"repeat"),
e.ctx.fillRect(0,0,e.canvas.width,e.canvas.height)):"center"===e.bg_display&&e.ctx.drawImage(e.image,(e.w-e.image.width)/2,(e.h-e.image.height)/2));if(!e.click){for(var a=$jscomp.makeIterator(e.graphics),b=a.next();!b.done;b=a.next())b.value.update();e.primitives=[];if(e.split)for(a=0,b=e.graphics.length;a<b;a++){r=e.graphics[a];for(var d=a+1;d<b;d++)x=e.graphics[d],r.splitFace(x),x.splitFace(r);e.primitives=e.primitives.concat(r.primitives||[])}else for(a=0,b=this.graphics.length;a<b;a++){r=this.graphics[a];
if(r.split)for(d=a+1;d<b;d++)x=this.graphics[d],x.split&&r.splitFace(x);this.primitives=this.primitives.concat(r.primitives||[])}}b=$jscomp.makeIterator(this.primitives);for(a=b.next();!a.done;a=b.next())a.value.computeDepth(this);this.primitives=this.primitives.sort(c);if("painter"===this.render)this.drawPainter(this.primitives);else for(b=$jscomp.makeIterator(this.primitives),a=b.next();!a.done;a=b.next())a.value.draw(this.ctx,this);a=$jscomp.makeIterator(this.graphicsCtr);for(b=a.next();!b.done;b=
a.next())b.value.draw()};V.prototype.drawPainter=function(a){for(var b=a.length,c=0;c<b;c++)a[c].drawn=!1,a[c].draw(this.ctx,this);var d=[];c=[];for(var e=0,g=a.length,f=.001,h,l;;){h=g;for(var m=0;m<b;m++)if(!a[m].drawn){l=!0;for(var p=0;p<b;p++)if(p!=m&&!a[p].drawn&&a[m].inFrontOf(d,a[p],f)){l=!1;break}l&&(g--,c[e++]=a[m],a[m].drawn=!0)}if(0==g)break;else if(g==h){if(f*=10,.1<f){for(d=0;d<b;d++)a[d].drawn||(c[e++]=a[d],a[d].drawn=!0);break}}else f=.001}for(a=0;a<b;a++)c[a].draw(this.ctx,this)};
V.prototype.rayFromEye=function(a,b){return{x:-this.eye.x,y:(a-(this.w_2+this.Ox))/this.scale-this.eye.y,z:(this.h_2+this.Oy-b)/this.scale-this.eye.z}};V.prototype.addEvents=function(){function a(b){window.focus();document.activeElement.blur();f.click=0;f.evaluator.setVariable(f.id+".mouse_pressed",0);window.removeEventListener("touchmove",g,!1);window.removeEventListener("touchend",a,!1);b.preventDefault();f.parent.update()}function c(a){document.body.focus();f.click=0;f.evaluator.setVariable(f.id+
".mouse_pressed",0);a.preventDefault();"R"===f.whichBtn&&(window.removeEventListener("mousemove",e,!1),f.posZoom==f.posZoomNew&&b.showConfig&&f.parent.externalSpace.show());window.removeEventListener("mousemove",g,!1);window.removeEventListener("mouseup",c,!1);f.parent.update()}function d(a){f.posAnte=b.getCursorPosition(a,f.container);f.mouse_x=f.getRelativeX(f.posAnte.x);f.mouse_y=f.getRelativeY(f.posAnte.y);f.evaluator.setVariable(f.id+".mouse_x",f.mouse_x);f.evaluator.setVariable(f.id+".mouse_y",
f.mouse_y);f.parent.update()}function e(a){a.preventDefault();f.posZoomNew=b.getCursorPosition(a,f.container).y;f.evaluator.setVariable(f.scaleStr,f.tempScale+f.tempScale/45*((f.posZoom-f.posZoomNew)/10));f.posObserverNew=b.getCursorPosition(a,f.container).x;f.evaluator.setVariable(f.obsStr,f.tempObserver-2.5*(f.posObserver-f.posObserverNew));f.parent.update()}function g(a){if(!f.fixed&&f.click){v=(f.getAbsoluteX(f.oldMouse.x)-f.getAbsoluteX(f.mouse_x))/4;A=(-f.getAbsoluteY(f.oldMouse.y)+f.getAbsoluteY(f.mouse_y))/
4;if(v!==f.disp.x||A!==f.disp.y)f.alpha=b.degToRad(f.evaluator.getVariable(f.rotZStr)),f.beta=b.degToRad(-f.evaluator.getVariable(f.rotYStr)),f.alpha=b.radToDeg(f.alpha)-v,f.beta=b.radToDeg(f.beta)-A,f.evaluator.setVariable(f.rotZStr,f.alpha),f.evaluator.setVariable(f.rotYStr,-f.beta),f.disp.x=v,f.disp.y=A,f.oldMouse.x=f.getRelativeX(f.posAnte.x),f.oldMouse.y=f.getRelativeY(f.posAnte.y);d(a);a.preventDefault()}}var f=this;f.canvas.addEventListener("touchstart",function(c){window.focus();document.activeElement.blur();
f.click=1;f.evaluator.setVariable(f.id+".mouse_pressed",1);f.parent.deactivateControls();f.posAnte=b.getCursorPosition(c,f.container);f.oldMouse.x=f.getRelativeX(f.posAnte.x);f.oldMouse.y=f.getRelativeY(f.posAnte.y);d(c);window.addEventListener("touchmove",g);window.addEventListener("touchend",a);c.preventDefault()});f.canvas.addEventListener("mousedown",function(a){document.body.focus();f.click=1;f.parent.deactivateControls();f.whichBtn=b.whichBtn(a);"R"===f.whichBtn?(window.addEventListener("mouseup",
c),f.posObserver=b.getCursorPosition(a,f.container).x,f.posObserverNew=f.posObserver,f.posZoom=b.getCursorPosition(a,f.container).y,f.posZoomNew=f.posZoom,f.fixed||(f.tempScale=f.scale,f.tempObserver=f.observer,window.addEventListener("mousemove",e))):"L"==f.whichBtn&&(f.evaluator.setVariable(f.id+".mouse_pressed",1),f.posAnte=b.getCursorPosition(a,f.container),f.oldMouse.x=f.getRelativeX(f.posAnte.x),f.oldMouse.y=f.getRelativeY(f.posAnte.y),d(a),window.addEventListener("mousemove",g),window.addEventListener("mouseup",
c));a.preventDefault()});f.disp={x:0,y:0};document.addEventListener("visibilitychange",function(a){c(a)});document.addEventListener("mouseleave",function(a){c(a)})};b.Space3D=V;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a,d,h,p,c,f,l,n,m=function(a,c){var e=b.Space.call(this,a,c)||this;d=e.parent.evaluator;void 0!=e._w_&&(a=d.parser.parse(e._w_),e._w_="number"!=a.type?a:void 0);void 0!=e._h_&&(a=d.parser.parse(e._h_),e._h_="number"!=a.type?a:void 0);e.isFirefox=/firefox/i.test(window.navigator.userAgent);e.file=e.file?e.file.trim():"";/^\[.*\]$/.test(e.file)?e.file=d.parser.parse(e.file.slice(1,-1)):/^'.*'$/.test(e.file)?e.file=d.parser.parse(e.file):e.file=d.parser.parse("'"+
e.file+"'");e.oldFile=d.eval(e.file);e.MyIFrame=b.newHTML("iframe",{marginheight:0,marginwidth:0,frameborder:0,scrolling:"auto",style:"position:absolute;left:0;top:0;"});0!=e.oldFile&&e.MyIFrame.setAttribute("src",e.oldFile);e.container=b.newHTML("div",{id:e.id,style:(b.isIOS?"overflow:scroll;-webkit-overflow-scrolling:touch;overflow-scrolling:touch;":"")+"position:absolute;width:"+e.w+"px;height:"+e.h+"px;left:"+e.x+"px;top:"+e.y+"px;z-index:"+e.zIndex+";background-repeat:no-repeat;background-position:center;"});
e.container.appendChild(e.MyIFrame);e.imageSrc&&(e.container.style.backgroundImage="url("+e.imageSrc+")");e.parent.container.insertBefore(e.container,e.parent.loader);e.MyIFrame.onload=function(){var a=this;e.evaluator.setFunction(e.id+".set",function(b,c){a.contentWindow.postMessage({type:"set",name:b,value:c},"*");return 0});e.evaluator.setFunction(e.id+".update",function(){a.contentWindow.postMessage({type:"update"},"*");return 0});e.evaluator.setFunction(e.id+".exec",function(b,c){a.contentWindow.postMessage({type:"exec",
name:b,value:c},"*");return 0});e.evaluator.setFunction(e.id+".changeConf",function(c){if(c){if(b.cacheFiles[c])var d=b.cacheFiles[c];else d=(d=document.getElementById(c))&&"descartes/embed"===d.type?d.textContent:b.openFile(c),d=(d=(new DOMParser).parseFromString(d,"text/html").querySelector("ajs"))?d.innerHTML:"",b.cacheFiles[c]=d;a.contentWindow.postMessage({type:"change_config",filename:c,content:d},"*")}return 0});e.evaluator.setFunction(e.id+".changeContent",function(b){b&&(b=(b=(new DOMParser).parseFromString(b.replace(/&sq;/g,
"'"),"text/html").querySelector("ajs"))?b.innerHTML:"",a.contentWindow.postMessage({type:"change_content",content:b},"*"))});e.ImReady=!e.isFirefox;e.isFirefox||(e.container.style.visibility="visible",e.container.style.opacity="1",e.container.style.zIndex=e.zIndex,e.container.style.display=e.drawIfVal?"block":"none");e.MyIFrame.style.visibility="visible";e.container.style.backgroundImage=""};e.update=e.iframeUpdate;e.evaluator.setVariable(e.id+"._scroll",0);return e};$jscomp.inherits(m,b.Space);m.prototype.init=
function(){this.initSpace();this.MyIFrame&&Object.assign(this.MyIFrame.style,{width:this.w+"px",height:this.h+"px"})};m.prototype.iframeUpdate=function(b){a=this;h=a.container;d=a.evaluator;a.drawIfVal=0<d.eval(a.drawif);a.ImReady?h.style.display=a.drawIfVal?"block":"none":(h.style.visibility=a.drawIfVal?"visible":"hidden",h.style.opacity=a.drawIfVal?"1":"0",h.style.zIndex=a.drawIfVal?a.zIndex:-1E3);if(a.drawIfVal){b&&(a.x=a.y=Infinity);f=d.eval(a.xExpr)+a.displaceRegionWest;if(p=a.x!==f)a.x=f;f=
d.eval(a.yExpr)+a.parent.plecaHeight+a.displaceRegionNorth;if(c=a.y!==f)a.y=f;void 0!=a._w_&&(f=d.eval(a._w_),a.w!==f&&(h.style.width=a.MyIFrame.style.width=f+"px",a.w=f));void 0!=a._h_&&(f=d.eval(a._h_),a.h!==f&&(h.style.height=a.MyIFrame.style.height=f+"px",a.h=f));if(p||c)h.style.left=a.x+"px",h.style.top=a.y+"px";l=d.eval(a.file);l!==a.oldFile&&(a.ImReady=!1,a.isFirefox||(h.style.display="block",h.style.visibility=a.drawIfVal?"visible":"hidden",h.style.opacity=a.drawIfVal?"1":"0",h.style.zIndex=
a.drawIfVal?a.zIndex:-1E3),a.imageSrc&&(h.style.backgroundImage="url("+a.imageSrc+")"),a.MyIFrame.style.visibility="hidden",a.oldFile=l,a.MyIFrame.contentWindow.location.replace(l));n=d.getVariable(a.id+"._scroll");1==n?(a.MyIFrame.setAttribute("scrolling","yes"),a.MyIFrame.style.overflow=""):-1==n?(a.MyIFrame.setAttribute("scrolling","no"),a.MyIFrame.style.overflow="hidden"):(a.MyIFrame.setAttribute("scrolling","auto"),a.MyIFrame.style.overflow="")}else a.MyIFrame.contentWindow.blur()};b.SpaceHTMLIFrame=
m;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;var a=1,d=function(d){this.children=d.children;this.lessonParser=d.lessonParser;this.images=d.images;this.audios=d.audios;this.im_l=this.au_l=0;this.descartesApp=d;var h=document.querySelectorAll('script[type="descartes/imagen"]');h=$jscomp.makeIterator(h);for(var c=h.next();!c.done;c=h.next())c=c.value,this.images[c.id]=new Image,this.images[c.id].onload=function(){this.ready=1},this.images[c.id].src=c.innerText.trim();this.imgLoader=b.newHTML("div",
{class:"DescartesLoaderImage"});this.progress=b.newHTML("progress",{class:"PBL",value:0,max:100});d.imgLoader?(d.loader.style.backgroundColor="transparent",this.imgLoader.setAttribute("style","background-image:url("+d.imgLoader+");background-size:contain;")):(a=d.width<d.height?d.width/1144:d.height/1092,a=Math.min(2.5,a),this.imgLoader.setAttribute("style","background-image:url("+b.loaderImg.src+");background-position:50% 33.5%;background-size:"+880*a+"px;"),this.progress.setAttribute("style","visibility:visible;left:"+
(d.width-726*a)/2+"px;top:"+(33.5*d.height/100+940*a/2)+"px;width:"+726*a+"px;height:"+14*a+"px;"));d.loader.appendChild(this.imgLoader);d.loader.appendChild(this.progress);d.firstRun=!1;this.initPreloader()};d.prototype.initPreloader=function(){var a=this,d=a.children,c=a.images,f=a.audios,l=/[\w\.\-//]*(\.png|\.jpg|\.gif|\.svg|\.webp)/gi,n=/[\w\.\-//]*(\.ogg|\.oga|\.mp3|\.wav)/gi,m=/'macro'|'makro'/g,g;var q=0;for(g=d.length;q<g;q++){if(d[q].value.match(m)){var e="";var r=void 0;var x=a.lessonParser.split(d[q].value);
var y=0;for(var u=x.length;y<u;y++)"expresion"===babel[x[y][0]]&&(e=x[y][1]);e&&(r=(r=document.getElementById(e))&&"descartes/macro"==r.type?r.text:b.openFile(e));if(r&&(r=r.match(l)))for(e=0,y=r.length;e<y;e++)x=r[e],x.toLowerCase().endsWith("vacio.gif")||""==x.substring(0,x.length-4)||c[x]||(c[x]=this.descartesApp.getImageAux(x))}if(r=d[q].value.match(l))for(e=0,y=r.length;e<y;e++)x=r[e],x.toLowerCase().endsWith("vacio.gif")||""==x.substring(0,x.length-4)||c[x]||(c[x]=this.descartesApp.getImageAux(x));
if(r=d[q].value.match(n))for(e=0,x=r.length;e<x;e++)f[r[e]]||(f[r[e]]=this.descartesApp.getAudioAux(r[e]))}for(var v in c)c.hasOwnProperty(v)&&a.im_l++;for(var A in f)f.hasOwnProperty(A)&&a.au_l++;var w=a.im_l+a.au_l;0<w&&a.progress.setAttribute("max",w);var z,B=function(){z=0;for(var d in c)c.hasOwnProperty(d)&&(c[d].ready||c[d].errorload)&&z++;for(var e in f)f.hasOwnProperty(e)&&(f[e].ready||f[e].errorload)&&z++;a.progress.setAttribute("value",z);z!=w?a.timer=b.setTimeout(B,1):a.descartesApp.initBuildApp()};
B()};b.DescartesLoader=d;return b}(descartesJS||{});
descartesJS=function(b){function a(){b.cssScale=Math.min(window.innerWidth/this.width,window.innerHeight/this.height);this.container.parentNode.style.width=window.innerWidth+"px";this.container.parentNode.style.height=window.innerHeight+"px";this.container.style.transform="translate(-50%, -50%) scale("+b.cssScale+")"}if(b.loadLib)return b;var d=/type='fill'|tipo='relleno'|tipus='ple'|mota='betea'|type='plein'|tipo='recheo'|tipo='curva_piena'|tipo='preencher'|tipus='ple'/,h=function(a){this.animation=
{playing:!1,play:function(){},stop:function(){},reinit:function(){}};this.ratio=b._ratio;this.URL=window.location.href;this.applet=a;this.parentC=a.parentNode;this.width=parseFloat(a.getAttribute("width"));this.height=parseFloat(a.getAttribute("height"));this.decimal_symbol=".";this.decimal_symbol_regexp=/\./g;this.language="espa\u00f1ol";this.children=a.getElementsByTagName("param");this.code=a.getAttribute("code");this.images={};this.audios={};this.firstRun=!0;this.keyboard=new b.Keyboard(this);
this.scaleToFit=function(){};this.init()};h.prototype.init=function(){this.stop();this.evaluator=new b.Evaluator(this);this.evaluator.setVariable("DJS.w",this.width);this.evaluator.setVariable("DJS.h",this.height);this.evaluator.setVariable("DJS.container_w",this.width);this.evaluator.setVariable("DJS.container_h",this.height);this.getURLParameters();this.lessonParser=new b.LessonParser(this);var d,c=$jscomp.makeIterator(this.children);for(d=c.next();!d.done;d=c.next())if(d=d.value,"Buttons"==babel[d.name])this.buttonsConfig=
this.lessonParser.parseButtonsConfig(d.value);else if("image_loader"==d.name)this.imgLoader=d.value;else if("expand"==d.name)this.expand=d.value;else if("docBase"==d.name)document.head.appendChild(b.newHTML("base",{id:"descartesJS_base",href:d.value}));else if(d.name.startsWith("E_"))break;this.externalSpace&&this.externalSpace.container.parentNode&&document.body.removeChild(this.externalSpace.container);this.externalSpace=new b.SpaceExternal(this);this.northSpace={container:b.newHTML("div"),controls:[]};
this.southSpace={container:b.newHTML("div"),controls:[]};this.eastSpace={container:b.newHTML("div"),controls:[]};this.westSpace={container:b.newHTML("div"),controls:[]};this.editableRegion={container:b.newHTML("div"),textFields:[]};this.spaces=[];this.controls=[];this.auxiliaries=[];this.events=[];this.zIndex=this.tabindex=this.plecaHeight=this.nIframes=0;void 0!=this.container&&(this.cleanCanvasImages(),this.parentC.removeChild(this.container),delete this.container,delete this.loader);this.container=
b.newHTML("div");this.loader=b.newHTML("div",{class:"DescartesLoader"});this.container.addEventListener("contextmenu",b.preventDefault);this.parentC.insertBefore(this.container,this.parentC.firstChild);this.container.width=this.loader.width=this.width;this.container.height=this.loader.height=this.height;this.container.className="DescartesAppContainer";this.container.setAttribute("style","width:"+this.width+"px;height:"+this.height+"px;");this.container.appendChild(this.loader);"fit"==this.expand&&
(c=b.newHTML("style",{rel:"stylesheet",type:"text/css",id:"StyleDescartesAppsPrint"}),document.head.insertBefore(c,document.head.firstChild),c.innerHTML="@page{margin:0cm;size:"+this.width+"px "+this.height+"px;}",this.container.parentNode.removeAttribute("align"),this.container.parentNode.style.overflow="hidden",this.container.style.left=this.container.style.top="50%",this.container.style.transformOrigin="50% 50%",this.scaleToFit=a,this.scaleToFit());"cover"==this.expand&&(this.scaleToFit=function(){this.container.width=
this.width=window.innerWidth;this.container.height=this.height=window.innerHeight;this.container.setAttribute("style","width:"+this.width+"px;height:"+this.height+"px;");this.evaluator.setVariable("DJS.container_w",this.container.width);this.evaluator.setVariable("DJS.container_h",this.container.height);try{this.update()}catch(n){}if(this.spaces)for(var a=$jscomp.makeIterator(this.spaces),b=a.next();!b.done;b=a.next())b=b.value,b.initSpace(),b.init(),b.update(!0)},this.scaleToFit());this.firstRun?
(this.loader.style.display="block",new b.DescartesLoader(this)):this.initBuildApp()};h.prototype.initBuildApp=function(){b.showConfig=!0;var a=this,c,f=a.lessonParser,h=[],n=[],m=[],g=[],q=[],e=[],r=$jscomp.makeIterator(a.children);for(c=r.next();!c.done;c=r.next())c=c.value,"editable"==babel[c.name]?b.showConfig="false"!=babel[c.value]:"language"==babel[c.name]?a.language=c.value:"Buttons"==babel[c.name]?a.buttonsConfig=f.parseButtonsConfig(c.value):"decimal_symbol"==babel[c.name]?(a.decimal_symbol=
c.value,a.decimal_symbol_regexp=new RegExp("\\"+a.decimal_symbol,"g")):"version"==babel[c.name]?a.version=parseInt(c.value):c.name.startsWith("E_")?(/='HTMLIFrame'/.test(c.value)&&a.nIframes++,h.push(c.value)):c.name.startsWith("C_")?n.push(c.value):c.name.startsWith("A_")?m.push(c.value):c.name.startsWith("G_")?(d.test(c.value)&&(a.ratio=1),g.push(c.value)):c.name.startsWith("S_")?q.push(c.value):"Animation"==babel[c.name]&&e.push(c.value);h=$jscomp.makeIterator(h);for(r=h.next();!r.done;r=h.next())a.spaces.push(f.parseSpace(r.value)),
a.zIndex++;g.forEach(function(c,d){b.DEBUG.elemIndex=d;if(c=f.parseGraphic(c))a.editableRegionVisible=a.editableRegionVisible||c.visible,c.space.addGraph(c)});q.forEach(function(a,c){b.DEBUG.elemIndex=c;(a=f.parse3DGraphic(a))&&a.space.addGraph(a,!0)});n=$jscomp.makeIterator(n);for(g=n.next();!g.done;g=n.next())a.controls.push(f.parseControl(g.value));m=$jscomp.makeIterator(m);for(n=m.next();!n.done;n=m.next())f.parseAuxiliar(n.value);e=$jscomp.makeIterator(e);for(m=e.next();!m.done;m=e.next())a.animation=
f.parseAnimation(m.value);a.configRegions();a.updateAuxiliaries();a.updateAuxiliaries();e=$jscomp.makeIterator(a.controls);for(m=e.next();!m.done;m=e.next())m.value.init();a.updateControls();a.updateSpaces(!0);b.setTimeout(function(){a.finishInit()},10*a.nIframes);document.addEventListener("keydown",function(c){if(c.ctrlKey&&c.shiftKey&&"C"===c.key||c.commandKey&&c.shiftKey&&"C"===c.key)navigator.clipboard.writeText(a.applet.innerHTML),b.preventDefault(c)})};h.prototype.finishInit=function(){var a=
this;a.evaluator.setVariable("decimalSymbol",a.decimal_symbol);a.update();a.loader.parentNode.removeChild(a.loader);window.parent!==window&&(a.parentC.style.margin=a.parentC.style.padding="0px","fit"==a.expand&&window.addEventListener("touchmove",function(a){a.preventDefault();a.stopPropagation()}),window.parent.postMessage({type:"reportSize",href:a.URL,width:a.width,height:a.height},"*"),window.parent.postMessage({type:"ready",value:a.URL},"*"),b.onResize());window.opener&&window.opener.postMessage({type:"isResizeNeeded",
href:a.URL},"*");b.showConfig&&a.externalSpace.init();try{window.dispatchEvent(new CustomEvent("descartesReady",{detail:a}))}catch(c){console.warn("CustomEvents not supported in this browser")}a.evaluator.setFunction("openKB",function(b,d,h,p,m,g,q,e,r,x,y){a.keyboard.show(null,b,d,h,p,{x:m,y:g,w:q,h:e,fs:r+"px",value:x+"",type:"custom",tagName:"textfield"},y)});a.readyApp=!0};h.prototype.adjustSize=function(){document.body.style.margin=document.body.style.padding=this.parentC.style.margin=this.parentC.style.padding=
"0px";var a=parseInt(this.width+30),c=parseInt(this.height+90);window.moveTo(parseInt(screen.width-a)/2,parseInt(screen.height-c)/2);window.resizeTo(a,c);b.onResize()};h.prototype.configRegions=function(){var a=this.evaluator.parser,c=this.buttonsConfig||{},d=this.container,h=100,n=100,m=0,g=0,q=0,e=0,r=0,x=this.northSpace.controls,y=this.southSpace.controls;var u=this.eastSpace.controls;var v=this.westSpace.controls;if(0<c.rowsNorth||0<x.length||c.about||c.config){0>=c.rowsNorth?(m=c.height,c.rowsNorth=
1):m=c.height*c.rowsNorth;var A=this.northSpace.container;A.id="descartesJS_north";A.setAttribute("style","width:"+d.width+"px;height:"+m+"px;left:0;top:"+this.plecaHeight+"px;");d.insertBefore(A,this.loader);A=d.width;var w=0;c.about?(w=h,A-=w):h=0;c.config&&(A-=100);for(var z=Math.ceil(x.length/c.rowsNorth),B=A/z,D=0,I=x.length;D<I;D++)x[D].expresion=a.parse("("+(w+D%z*B)+","+c.height*Math.floor(D/z)+","+B+","+c.height+")"),x[D].init();c.about&&(x=new b.Button(this,{region:"north",name:"english"==
this.language?"about":"cr\u00e9ditos",font_size:a.parse("15"),expresion:a.parse("(0,0,"+h+","+m+")")}),x.actionExec={execute:b.showAbout},x.update());c.config&&(new b.Button(this,{region:"north",name:"config",font_size:a.parse("15"),action:"config",expresion:a.parse("("+(A+h)+",0,100,"+m+")")})).update()}if(0<c.rowsSouth||0<y.length||c.init||c.clear){0>=c.rowsSouth?(g=c.height,c.rowsSouth=1):g=c.height*c.rowsSouth;h=d.width;A=0;c.init?(A=n,h-=A):n=0;c.clear&&(h-=100);x=this.southSpace.container;x.id=
"descartesJS_south";x.setAttribute("style","width:"+d.width+"px;height:"+g+"px;left:0;bottom:0;");d.insertBefore(x,this.loader);x=Math.ceil(y.length/c.rowsSouth);w=h/x;z=0;for(B=y.length;z<B;z++)y[z].expresion=a.parse("("+(A+z%x*w)+","+c.height*Math.floor(z/x)+","+w+","+c.height+")"),y[z].init();c.init&&(new b.Button(this,{region:"south",name:"english"==this.language?"init":"inicio",font_size:a.parse("15"),action:"init",expresion:a.parse("(0,0,"+n+","+g+")")})).update();c.clear&&(new b.Button(this,
{region:"south",name:"english"==this.language?"clear":"limpiar",font_size:a.parse("15"),action:"clear",expresion:a.parse("("+(h+n)+",0,100,"+g+")")})).update()}if(0<u.length)for(n=d.height-m-g,e=c.widthEast,y=this.eastSpace.container,y.id="descartesJS_east",y.setAttribute("style","width:"+e+"px;height:"+n+"px;right:0;top:"+m+"px;"),d.insertBefore(y,this.loader),n=0,y=u.length;n<y;n++)u[n].expresion=a.parse("(0,"+c.height*n+","+e+","+c.height+")"),u[n].init();if(0<v.length)for(u=d.height-m-g,r=c.widthWest,
n=this.westSpace.container,n.id="descartesJS_west",n.setAttribute("style","width:"+r+"px;height:"+u+"px;left:0;top:"+m+"px;"),d.insertBefore(n,this.loader),u=0,n=v.length;u<n;u++)v[u].expresion=a.parse("(0,"+c.height*u+","+r+","+c.height),v[u].init();if(this.editableRegionVisible)for(q=c.height,a=this.editableRegion.container,a.id="descartesJS_editableRegion",a.setAttribute("style","position:absolute;width:"+d.width+"px;height:"+q+"px;left:0;top:"+(d.height-g-c.height)+"px;"),d.insertBefore(a,this.loader),
c=this.editableRegion.textFields,d=d.width/c.length,v=b.getFieldFontSize(q),u=0,n=c.length;u<n;u++)"div"==c[u].type?(a.appendChild(c[u].container),c[u].container.setAttribute("style","font-family:"+b.sansserif_font+";width:"+(d-4)+"px;height:"+q+"px;position:absolute;left:"+u*d+"px;top:0;"),y=c[u].container.firstChild,y.setAttribute("style","font-family:"+b.sansserif_font+";font-size:"+v+"px;padding-top:0;background-color:#e0e4e8;position:absolute;left:0;top:0;height:"+q+"px;text-align:center;line-height:"+
q+"px;"),h=y.offsetWidth,y.style.width=h+"px",y.firstChild.textContent=y.firstChild.textContent.substring(3,y.firstChild.textContent.length-3),c[u].container.lastChild.setAttribute("style","font-family:"+b.monospace_font+";font-size:"+v+"px;width:"+(d-h)+"px;height:"+q+"px;position:absolute;left:"+h+"px;top:0;border:2px groove white;")):(a.appendChild(c[u]),c[u].setAttribute("style","font-family:"+b.monospace_font+";font-size:"+v+"px;width:"+d+"px;height:"+q+"px;position:absolute;left:"+u*d+"px;top:0;border:2px groove white;"));
this.displaceRegionNorth=m;this.displaceRegionSouth=g+(q||0);this.displaceRegionEast=e;this.displaceRegionWest=r;m=$jscomp.makeIterator(this.spaces);for(g=m.next();!g.done;g=m.next())g.value.init()};h.prototype.update=function(){this.updateAuxiliaries();this.updateControls();this.updateEvents();this.updateControls();this.updateSpaces()};h.prototype.clearClick=function(){for(var a=$jscomp.makeIterator(this.spaces),b=a.next();!b.done;b=a.next())b.value.clearClick()};h.prototype.removeButtonClick=function(){b.newBlobContent=
null;for(var a=$jscomp.makeIterator(this.controls),c=a.next();!c.done;c=a.next())c.value.buttonClick=!1};h.prototype.deactivateControls=function(){if(this.controls)for(var a=$jscomp.makeIterator(this.controls),b=a.next();!b.done;b=a.next())b=b.value,b.deactivate&&b.deactivate()};h.prototype.updateAuxiliaries=function(){for(var a=$jscomp.makeIterator(this.auxiliaries),b=a.next();!b.done;b=a.next())b.value.update()};h.prototype.updateEvents=function(){for(var a=$jscomp.makeIterator(this.events),b=a.next();!b.done;b=
a.next())b.value.update()};h.prototype.updateControls=function(){for(var a=$jscomp.makeIterator(this.controls),b=a.next();!b.done;b=a.next())b.value.update()};h.prototype.updateSpaces=function(a){for(var b=$jscomp.makeIterator(this.spaces),d=b.next();!d.done;d=b.next())d.value.update(a)};h.prototype.clear=function(){for(var a=$jscomp.makeIterator(this.spaces),b=a.next();!b.done;b=a.next())b=b.value,b.spaceChange=!0,b.drawBackground&&b.drawBackground()};h.prototype.play=function(){this.animation.play()};
h.prototype.stop=function(){this.animation.stop()};h.prototype.reinitAnimation=function(){this.animation.reinit()};h.prototype.stopAudios=function(){this.stop();for(var a in this.audios)this.audios.hasOwnProperty(a)&&this.audios[a].pause&&(this.audios[a].pause(),this.audios[a].currentTime=0)};h.prototype.getImage=function(a){return a?(this.images[a]||(this.images[a]=this.getImageAux(a)),this.images[a]):new Image};h.prototype.getImageAux=function(a){var b=new Image;a.startsWith("http")&&(b.crossOrigin=
"Anonymous");b.onload=function(){this.ready=1};b.onerror=function(){this.errorload=1};b.src=a;return b};h.prototype.getAudio=function(a){return a?(this.audios[a]||(this.audios[a]=this.getAudioAux(a)),this.audios[a]):new Audio};h.prototype.getAudioAux=function(a){var c=new Audio(a);c.filename=a;var d=function(){this.ready=1},h=function(){this.canPlayType("audio/"+this.filename.substring(this.filename.length-3))||"mp3"!=this.filename.substring(this.filename.length-3)?(console.warn("El archivo "+file+
" no puede ser reproducido"),this.errorload=1):(c=new Audio(this.filename.replace("mp3","ogg")),c.filename=this.filename.replace("mp3","ogg"),c.addEventListener("canplaythrough",d),c.addEventListener("load",d),c.addEventListener("error",h),c.load())};c.addEventListener("canplaythrough",d);c.addEventListener("load",d);c.addEventListener("error",h);b.hasTouchSupport?(c.load(),c.play(),b.setTimeout(function(){c.pause()},20),c.ready=1):c.load();return c};h.prototype.getControlByCId=function(a){return this.getControlById(a,
!0)};h.prototype.getControlById=function(a,b){b=b?"cID":"id";for(var c=$jscomp.makeIterator(this.controls),d=c.next();!d.done;d=c.next())if(d=d.value,d[b]==a)return d;return{update:function(){},w:0,h:0}};h.prototype.getSpaceByCId=function(a){return this.getSpaceById(a,!0)};h.prototype.getSpaceById=function(a,b){b=b?"cID":"id";for(var c=$jscomp.makeIterator(this.spaces),d=c.next();!d.done;d=c.next())if(d=d.value,d[b]==a)return d;return{update:function(){},w:0,h:0}};h.prototype.getURLParameters=function(){var a=
this.URL,b=a.indexOf("?");if(-1!=b)for(a=decodeURIComponent(a.substring(b+1)).split("&"),a=$jscomp.makeIterator(a),b=a.next();!b.done;b=a.next())b=b.value.split("="),2==b.length&&this.evaluator.setVariable("URL."+b[0],+b[1]==+b[1]?parseFloat(b[1]):b[1])};h.prototype.cleanCanvasImages=function(){this.container.querySelectorAll("canvas").forEach(function(a){a.width=a.height=1;a.style.width=a.style.height="1px"});this.spaces.forEach(function(a){a.canvas&&(a.canvas=a.ctx=null);a.backCanvas&&(a.backCanvas=
a.backCtx=null)});for(var a in this.images)this.images[a].nodeName&&"canvas"===this.images[a].nodeName.toLowerCase()&&delete this.images[a]};b.DescartesApp=h;return b}(descartesJS||{});
descartesJS=function(b){if(b.loadLib)return b;b.DEBUG={PARENTHESIS_CLOSING:"Faltan par\u00e9ntesis por cerrar",PARENTHESIS_OPENING:"Faltan par\u00e9ntesis por abrir",BRACKET_CLOSING:"Faltan corchetes por cerrar",BRACKET_OPENING:"Faltan corchetes por abrir",INCOMPLETE_IF:"Condicional incompleta",EXPRESSION:"En la expresi\u00f3n",setError:function(a,d){a="Error: "+a+" en\u300a "+d+" \u300b";var h="";switch(b.DEBUG.objectName){case "Auxiliar":d="event"===b.DEBUG.typeName||"algorithm"===b.DEBUG.typeName||
"constant"===b.DEBUG.typeName?"En el programa ":"En la definici\u00f3n ";if("doExpr"==babel[b.DEBUG.pName]||"init"==babel[b.DEBUG.pName])h=" en la l\u00ednea "+(b.DEBUG.lineCount+1);a+=d+"\u300c"+b.DEBUG.idName+"\u300d, en el par\u00e1metro \u300c"+b.DEBUG.pName+"\u300d"+h+".";break;case "Graphic":a+="En el gr\u00e1fico #"+(b.DEBUG.elemIndex+1)+" de tipo \u300c"+b.DEBUG.idName+"\u300d, en el par\u00e1metro \u300c"+b.DEBUG.pName+"\u300d.";break;case "Animation":if("doExpr"==babel[b.DEBUG.pName]||"init"==
babel[b.DEBUG.pName])h=" en la l\u00ednea "+(b.DEBUG.lineCount+1);a+=". En la Animaci\u00f3n, en el par\u00e1metro \u300c"+b.DEBUG.pName+"\u300d"+h+"."}console.info(a)}};return b}(descartesJS||{});
descartesJS=function(b){function a(){d().forEach(function(a){b.apps.push(new b.DescartesApp(a));a.className="DescartesJS"})}function d(){return[].concat($jscomp.arrayFromIterable(document.querySelectorAll("applet,ajs"))).filter(function(a){return/Descartes|DescartesJS|DescartesWeb2_0/i.test(a.getAttribute("code"))})}function h(){document.querySelectorAll(".DescartesAppContainer").forEach(function(a){a.remove()})}function p(){var c,d;return $jscomp.asyncExecutePromiseGeneratorProgram(function(f){switch(f.nextAddress){case 1:return f.setCatchFinallyBlocks(2),
c=[],["descartesJS_serif","descartesJS_sansserif","descartesJS_monospace","DJS_symbol","DJS_math"].forEach(function(a){c.push(document.fonts.load("9px "+a));c.push(document.fonts.load("bold 9px "+a));c.push(document.fonts.load("italic 9px "+a));c.push(document.fonts.load("bold italic 9px "+a))}),f.yield(Promise.all(c),4);case 4:f.leaveTryBlock(3);break;case 2:return d=f.enterCatchBlock(),console.log(d),f.return();case 3:b.getFeatures(),b.hasCanvas?(window.scrollTo(0,100),h(),a(),window.addEventListener("resize",
b.onResize),window.scrollTo(0,0)):document.getElementById("StyleDescartesApps").innerHTML="applet.DescartesJS,applet,ajs.DescartesJS,ajs{display:block;}",f.jumpToEnd()}})}if(b.loadLib)return b;b.apps=[];b.getDescartesApps=function(){return b.apps};(function(){var a=document.getElementById("StyleDescartesApps");a&&a.remove();a=b.newHTML("style",{id:"StyleDescartesApps",type:"text/css",rel:"stylesheet"});a.innerHTML="applet.DescartesJS,applet,ajs.DescartesJS,ajs{display:none;}";document.head.appendChild(a)})();
b.onResize=function(){0<b.apps.length&&b.apps[0].scaleToFit()};var c={};b.onMessage=function(a){if(0<b.apps.length){var d=a.data;if(d)switch(d.type){case "set":"string"==typeof d.value||"number"==typeof d.value?b.apps[0].evaluator.setVariable(d.name,d.value):d.value&&void 0!=d.value.rows?b.apps[0].evaluator.matrices[d.name]=d.value:b.apps[0].evaluator.vectors[d.name]=d.value;break;case "update":b.apps[0].update();break;case "exec":(a=b.apps[0].evaluator.getFunction(d.name))&&a.apply(b.apps[0].evaluator,
d.value.toString().split(","));break;case "isResizeNeeded":a.source.postMessage({type:"doResize"},"*");break;case "doResize":0<b.apps.length&&b.apps[0].adjustSize();break;case "change_config":c[d.filename]?a=c[d.filename]:(a=b.newHTML("div"),a.innerHTML=d.content,a=a.getElementsByTagName("param"),c[d.filename]=a);b.apps[0].children=a;b.apps[0].init();break;case "change_content":a=b.newHTML("div"),a.innerHTML=d.content,a=a.getElementsByTagName("param"),b.apps[0].children=a,b.apps[0].init()}}};void 0==
b.loadLib&&(b.loadLib=!0,window.addEventListener("load",p),window.addEventListener("message",b.onMessage),["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd"].forEach(function(a){window.addEventListener(a,function(a){b.onResize(a)})}));return b}(descartesJS||{});
