/*
 Joel Espinosa Longi
 jlongi@im.unam.mx
 https://github.com/jlongi/DescartesJS
 LGPL - http://www.gnu.org/licenses/lgpl.html
 2020-01-10
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var f=0;return function(){return f<a.length?{done:!1,value:a[f++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var f="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return f?f.call(a):$jscomp.arrayIterator(a)};$jscomp.arrayFromIterator=function(a){for(var f,e=[];!(f=a.next()).done;)e.push(f.value);return e};
$jscomp.arrayFromIterable=function(a){return a instanceof Array?a:$jscomp.arrayFromIterator($jscomp.makeIterator(a))};$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(a){var f=function(){};f.prototype=a;return new f};$jscomp.underscoreProtoCanBeSet=function(){var a={a:!0},f={};try{return f.__proto__=a,f.a}catch(e){}return!1};
$jscomp.setPrototypeOf="function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(a,f){a.__proto__=f;if(a.__proto__!==f)throw new TypeError(a+" is not extensible");return a}:null;
$jscomp.inherits=function(a,f){a.prototype=$jscomp.objectCreate(f.prototype);a.prototype.constructor=a;if($jscomp.setPrototypeOf){var e=$jscomp.setPrototypeOf;e(a,f)}else for(e in f)if("prototype"!=e)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(f,e);d&&Object.defineProperty(a,e,d)}else a[e]=f[e];a.superClass_=f.prototype};
$jscomp.checkStringArgs=function(a,f,e){if(null==a)throw new TypeError("The 'this' value for String.prototype."+e+" must not be null or undefined");if(f instanceof RegExp)throw new TypeError("First argument to String.prototype."+e+" must not be a regular expression");return a+""};$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,f,e){a!=Array.prototype&&a!=Object.prototype&&(a[f]=e.value)};
$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,f,e,d){if(f){e=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var r=a[d];r in e||(e[r]={});e=e[r]}a=a[a.length-1];d=e[a];f=f(d);f!=d&&null!=f&&$jscomp.defineProperty(e,a,{configurable:!0,writable:!0,value:f})}};
$jscomp.polyfill("String.prototype.repeat",function(a){return a?a:function(a){var e=$jscomp.checkStringArgs(this,null,"repeat");if(0>a||1342177279<a)throw new RangeError("Invalid count value");a|=0;for(var d="";a;)if(a&1&&(d+=e),a>>>=1)e+=e;return d}},"es6","es3");$jscomp.owns=function(a,f){return Object.prototype.hasOwnProperty.call(a,f)};
$jscomp.assign="function"==typeof Object.assign?Object.assign:function(a,f){for(var e=1;e<arguments.length;e++){var d=arguments[e];if(d)for(var r in d)$jscomp.owns(d,r)&&(a[r]=d[r])}return a};$jscomp.polyfill("Object.assign",function(a){return a||$jscomp.assign},"es6","es3");
$jscomp.polyfill("Array.prototype.fill",function(a){return a?a:function(a,e,d){var f=this.length||0;0>e&&(e=Math.max(0,f+e));if(null==d||d>f)d=f;d=Number(d);0>d&&(d=Math.max(0,f+d));for(e=Number(e||0);e<d;e++)this[e]=a;return this}},"es6","es3");$jscomp.findInternal=function(a,f,e){a instanceof String&&(a=String(a));for(var d=a.length,r=0;r<d;r++){var m=a[r];if(f.call(e,m,r,a))return{i:r,v:m}}return{i:-1,v:void 0}};
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,e){return $jscomp.findInternal(this,a,e).v}},"es6","es3");$jscomp.polyfill("Array.prototype.flat",function(a){return a?a:function(a){a=void 0===a?1:Number(a);for(var e=[],d=0;d<this.length;d++){var f=this[d];Array.isArray(f)&&0<a?(f=Array.prototype.flat.call(f,a-1),e.push.apply(e,f)):e.push(f)}return e}},"es9","es5");
var babel=function(a){if(a.loadLib)return a;a.loadLib=!0;a.no=a.ez=a.non=a["n\u00e3o"]=a.falso=a["false"]=a.fals=a.gezurra=a.faux=a.fals="false";a["s\u00ed"]=a.yes=a.bai=a.oui=a.si=a.sim=a.verdadero=a["true"]=a.veritable=a.egia=a.vrai=a.verdadeiro=a.veritable="true";a.negro=a.black=a.negre=a.beltza=a.noir=a.preto=a["#000000"]="#000000";a.maxenta=a.magenta=a["#ff00ff"]="#ff00ff";a.azul=a.blue=a.blau=a.urdina=a.bleu=a["#0000ff"]="#0000ff";a.turquesa=a.cyan=a.turkesa=a.turquoise=a["#00ffff"]="#00ffff";
a.verde=a.green=a.verd=a.berdea=a.vert=a["#00ff00"]="#00ff00";a.amarillo=a.yellow=a.groc=a.horia=a.jaune=a.amarelo=a["#ffff00"]="#ffff00";a.naranja=a.orange=a.taronja=a.laranja=a.laranxa=a["#ffc800"]="#ffc800";a.rojo=a.red=a.vermell=a.gorria=a.rouge=a.vermello=a.vermelho=a["#ff0000"]="#ff0000";a.pink=a.rosa=a.arrosa=a.rose=a["#ffafaf"]="#ffafaf";a.grisObscuro=a.darkGray=a.grisFosc=a["gris iluna"]=a.grisObscur=a.grisEscuro=a.cinzaEscuro=a["#404040"]="#404040";a.gris=a.gray=a.grisa=a.cinza=a["#808080"]=
"#808080";a.grisClaro=a.lightGray=a.grisClar=a["gris argia"]=a.grisClair=a.cinzaClaro=a["#c0c0c0"]="#c0c0c0";a.blanco=a.white=a.blanc=a.zuria=a.branco=a["#ffffff"]="#ffffff";a.escala=a.scale=a.eskala=a["\u00e9chelle"]="scale";a.nombre=a.name=a.nom=a.izena=a.nome="name";a.ikusgai=a["vis\u00edvel"]=a.visible="visible";a.rastro=a.trace=a.rastre=a.arrastoa="trace";a.fondo=a.background=a.fons=a.hondoa=a.fond=a.fundo="background";a["par\u00e1metro"]=a.parameter=a.parametroa=a["par\u00e2metro"]=a["par\u00e0metre"]=
"parameter";a["sucesi\u00f3n"]=a.sequence=a["successi\u00f3"]=a.segida=a.succession=a["seq\u00fc\u00eancia"]="sequence";a["tama\u00f1o"]=a.size=a.neurria=a.taille=a.tamanho=a["grand\u00e0ria"]="size";a.decimales=a.decimals=a.hamartarra=a["d\u00e9cimales"]=a.decimais="decimals";a.red=a.net=a.xarxa=a.sarea=a["r\u00e9seau"]=a.rede=a.malha="net";a.red10=a.net10=a.xarxa10=a.sarea10=a["r\u00e9seau10"]=a.rede10=a.malha10="net10";a.ejes=a.axes=a.eixos=a.ardatzak=a.eixes="axes";a["cr\u00e9ditos"]=a.about=
a["cr\u00e8dits"]=a.kreditoak=a["cr\u00e9dits"]=a.sobre="about";a.config=a.konfig=a["configura\u00e7\u00e3o"]="config";a.inicio=a.init=a.inici=a.hasiera=a.commencement=a["in\u00edcio"]="init";a.limpiar=a.clear=a.neteja=a.ezabatu=a.nettoye=a.limpar="clear";a.incr=a.gehi=a.incremento="incr";a.min=a.inf="min";a.max=a.sup=a["m\u00e1x"]="max";a.relleno=a.fill=a.ple=a.betea=a.plein=a.recheo=a.preencher="fill";a["relleno+"]=a["fill+"]=a["ple+"]=a["betea+"]=a["plein+"]=a["recheo+"]=a["preencher+"]=a.fillP=
"fillP";a["relleno-"]=a["fill-"]=a["ple-"]=a["betea-"]=a["plein-"]=a["recheo-"]=a["preencher-"]=a.fillM="fillM";a.flecha=a.arrow=a.fletxa=a.gezia=a["fl\u00e8che"]=a.frecha=a.seta="arrow";a.punta=a.spear=a.muturra=a.pointe=a.ponta="spear";a["regi\u00f3n"]=a.region=a["regi\u00f3"]=a.eskualde=a["r\u00e9gion"]=a["rexi\u00f3n"]=a["regi\u00e3o"]="region";a.norte=a.north=a.nord=a.ipar="north";a.sur=a.south=a.sud=a.hego=a.sul="south";a.este=a.east=a.est=a.ekialde=a.leste="east";a.oeste=a.west=a.oest=a.hegoalde=
a.ouest="west";a.exterior=a.external=a.kanpoalde=a.externo="external";a["expresi\u00f3n"]=a.expresion=a["expresi\u00f3"]=a.adierazpen=a["express\u00e3o"]="expresion";a.tipo=a.type=a.tipus=a.mota="type";a["posici\u00f3n"]=a.position=a["posici\u00f3"]=a.posizio=a["posi\u00e7\u00e3o"]="position";a["constricci\u00f3n"]=a.constraint=a["constricci\u00f3"]=a.beharte=a.constriction=a["constrici\u00f3n"]=a["restri\u00e7\u00e3o"]="constraint";a.valor=a.value=a.balio=a.valeur="value";a["ecuaci\u00f3n"]=a.equation=
a["equaci\u00f3"]=a.ekuazio=a["\u00e9quation"]=a["equa\u00e7\u00e3o"]="equation";a.curva=a.curve=a.corba=a.kurba=a.courbe="curve";a.texto=a.text=a.testu=a.texte=a.testua="text";a.punto=a.point=a.punt=a.puntu=a.ponto=a.dot="point";a.segmento=a.segment=a.zuzenki="segment";a.arco=a.arc=a.arku="arc";a["pol\u00edgono"]=a.polygon=a["pol\u00edgon"]=a.poligono=a.polygone="polygon";a.imagen=a.image=a.imatge=a.irudi=a.imaxe=a.imagem=a.bg_image=a.irudia=a.imagem_de_fundo=a.irundia="image";a["Versi\u00f3n"]=
a.Version=a["Versi\u00f3"]=a["Vers\u00e3o"]=a.version="version";a.Idioma=a.Language=a.Hizkuntza=a.Langue=a.language="language";a["O.x"]="O.x";a["O.y"]="O.y";a.Botones=a.Buttons=a.Botons=a.Botoiak=a.Boutons=a["Bot\u00f3ns"]=a["Bot\u00f5es"]=a.Botons="Buttons";a["Animaci\u00f3n"]=a.Animation=a["Animaci\u00f3"]=a.Animazio=a["Anima\u00e7\u00e3o"]="Animation";a.constante=a.constant=a.Konstante="constant";a.fuente=a.font=a.iturri=a.source=a.fonte="font";a["num\u00e9rico"]=a.numeric=a["num\u00e8ric"]=a.zenbakizko=
a["num\u00e9rique"]="numeric";a["gr\u00e1fico"]=a.graphic=a["gr\u00e0fic"]=a.grafiko=a.graphique="graphic";a.hacer=a["do"]=a.fer=a.egin=a.faire=a.facer=a.fazer=a.doExpr="doExpr";a.mientras=a["while"]=a.mentre=a.bitartean=a["tandis que"]=a.mentres=a.enquanto=a.whileExpr="whileExpr";a.evaluar=a.evaluate=a.avalua=a.ebaluatu=a["\u00e9valuer"]=a.avaliar="evaluate";a.variable=a.aldagaia=a["vari\u00e1vel"]="variable";a["funci\u00f3n"]=a["function"]=a["funci\u00f3"]=a.funtzio=a.fonction=a["fun\u00e7\u00e3o"]=
"function";a.algoritmo=a.algorithm=a.algorisme=a.algorithme="algorithm";a.vector=a.array=a.bektore=a.vecteur=a.matriz="array";a["dibujar-si"]=a["draw-if"]=a["marraztu-baldin"]=a["dessiner-si"]=a["debuxar-se"]=a["desenhar-se"]=a["dibuixa-si"]=a.drawif="drawif";a.dominio=a.range=a.domini=a["izate-eremua"]=a.domain=a["dom\u00ednio"]="range";a.pausa=a.delay=a.eten="delay";a["eje-x"]=a["x-axis"]=a["eix-x"]=a["x-ardatza"]=a["axe-x"]=a["eixe-x"]=a["eixo-x"]=a.x_axis="x_axis";a["eje-y"]=a["y-axis"]=a["eix-y"]=
a["y-ardatza"]=a["axe-y"]=a["eixe-y"]=a["eixo-y"]=a.y_axis="y_axis";a["n\u00fameros"]=a.numbers=a.nombres=a.zenbakiak="numbers";a["exponencial-si"]=a["exponential-if"]=a["esponentzial-baldin"]=a["exponentiel-si"]=a["exponencial-se"]=a.exponentialif="exponentialif";a.familia=a.family=a["fam\u00edlia"]=a.famille="family";a.intervalo=a.interval=a.tarte=a.intervalle="interval";a.pasos=a.steps=a.passos=a.pausoak=a.pas="steps";a.centro=a.center=a.centre=a.zentro="center";a.radio=a.radius=a.radi=a.erradio=
a.rayon=a.raio="radius";a.fin=a.end=a.fi=a.bukaera=a.fim="end";a["una-sola-vez"]=a["only-once"]=a["una-sola-vegada"]=a["behin-bakarrik"]=a["une-seule-fois"]=a["unha-soa-vez"]=a["apenas-uma-vez"]=a.onlyOnce="onlyOnce";a.siempre=a.always=a.sempre=a.beti=a.toujours="always";a["color-int"]=a["int-colour"]=a["barruko-kolore"]=a["couleur-int"]=a["cor-int"]=a.colorInt="colorInt";a.repetir=a.loop=a.repeteix=a.errepikatu=a["r\u00e9p\u00e9ter"]="loop";a.controles=a.controls=a.kontrolak=a["contr\u00f4les"]=
a.controis="controls";a.animar=a.animate=a.anima=a.animatu=a.animer="animate";a.auto="auto";a.y=a.top="y";a.espacio=a.space=a.espai=a.espazio=a.espace=a.espazo=a["espa\u00e7o"]="space";a.Nu="Nu";a.Nv="Nv";a.alto=a.height=a.alt=a.altu=a.haut=a.altura=a["al\u00e7ada"]=a.hauteur=a.alto="height";a.ancho=a.depth=a.amplada=a.zabalera=a.largeur=a.profundidade=a.amplada=a.width=a.ample=a.large=a.largura="width";a.largo=a.length=a.llargada=a.luzera=a.longueur=a.longo=a.comprimento=a.llargada="length";a.color_reverso=
a.backcolor=a.color_revers=a["atzealde kolorea"]=a.couleur_revers=a.cor_reverso=a.cor_de_fundo="backcolor";a.aristas=a.edges=a.arestes=a.ertzak=a["ar\u00eates"]=a.arestas="edges";a.rotini=a.inirot="inirot";a.posini=a.inipos="inipos";a["tri\u00e1ngulo"]=a.triangle=a.hirukia=a["tri\u00e2ngulo"]="triangle";a.cara=a.face=a.aurpegi="face";a.polireg=a.regpoly=a["pol\u00edgonoRegular"]="polireg";a.superficie=a.surface=a["superf\u00edcie"]=a.azalera="surface";a.cubo=a.cube=a.cub=a.kubo="cube";a["paralelep\u00edpedo"]=
a.box=a["paral\u00b7lelep\u00edpede"]=a.paralelepipedo=a["parall\u00e9l\u00e9pip\u00e8de"]="box";a.cono=a.cone=a.con=a.kono=a["c\u00f4ne"]="cone";a.cilindro=a.cylinder=a.cilindre=a.zilindro=a.cylindre="cylinder";a.esfera=a.sphere=a["sph\u00e8re"]="sphere";a.tetraedro=a.tetrahedron=a.tetraedre=a["t\u00e9tra\u00e8dre"]="tetrahedron";a.octaedro=a.octahedron=a.octaedre=a.oktaedro=a["octa\u00e8dre"]="octahedron";a.dodecaedro=a.dodecahedron=a.dodecaedre=a.dodekaedro=a["dod\u00e9ca\u00e8dre"]="dodecahedron";
a.icosaedro=a.icosahedron=a.icosaedre=a.ikosaedro=a["icosa\u00e8dre"]="icosahedron";a.elipsoide=a.ellipsoid=a["el\u00b7lipsoide"]=a["ellipso\u00efde"]=a["elips\u00f3ide"]="ellipsoid";a.macro=a.makro="macro";a.id="id";a.modelo=a.model=a.eredu=a["mod\u00e8le"]="model";a.color=a.kolore=a.couleur=a.cor=a.colour=a.kolorea="color";a.luz=a.light=a.llum=a.argia=a["lumi\u00e8re"]="light";a.metal=a.metall=a["m\u00e9tal"]="metal";a.alambre=a.wire=a.filferro=a.alanbre=a["fil de fer"]=a.arame="wire";a.cortar=
a.split=a.talla=a.moztu=a.couper=a.dividir="split";a.despliegue=a.render=a.desplegament=a.zabaltze=a["d\u00e8ploiement"]=a.despregamento=a.processar="render";a.orden=a.sort=a.ordre=a.ordena=a.orde=a.ordenar="sort";a.pintor=a.painter=a.margolari=a.peintre="painter";a["trazado de rayos"]=a["ray trace"]=a["tra\u00e7at de raigs"]=a["izpi trazadura"]=a["trace de rayons"]=a["trazado de raios"]=a["tra\u00e7ado de raios"]=a.raytrace="raytrace";a.despl_imagen=a.bg_display=a.despl_imatge=a["irudi desplazamendu"]=
a.despl_image=a.despr_imaxe=a["apresenta\u00e7\u00e3o_de_imagem"]="bg_display";a["arr-izq"]=a.topleft=a["dalt-esq"]=a["goi-ezk"]=a["au-dessus-gau"]=a["arr-esq"]=a["acima-esquerda"]="topleft";a["expand."]=a.stretch=a.hedatu=a["expandir "]="stretch";a.mosaico=a.patch=a.mosaic=a.mosaiko=a["mosa\u00efque"]="patch";a.centrada=a.zentratu=a["centr\u00e9e"]=a.centrado=a.imgcenter="imgcenter";a.archivo=a.file=a.fitxer=a.artxibo=a.fichier=a.arquivo="file";a.filas_norte=a.rows_north=a.files_nord=a["HTML kodea"]=
a.files_nord=a.filas_norte=a.linhas_norte=a.files_nord=a.rowsNorth="rowsNorth";a.filas_sur=a.rows_south=a.files_sud=a.ipar_lerro=a.files_sud=a.filas_sur=a.linhas_sul=a.files_sud=a.rowsSouth="rowsSouth";a.ancho_este=a.width_east=a.ample_est=a.hego_lerro=a.ample_est=a.ancho_leste=a.largura_leste=a.ample_est=a.widthEast="widthEast";a.ancho_oeste=a.width_west=a.ample_oest=a.ekialde_zabalera=a.ample_ouest=a.ancho_oeste=a.largura_oeste=a.ample_oest=a.widthWest="widthWest";a.fijo=a.fixed=a.fix=a.hegoalde_zabalera=
a.fixe=a.fixo="fixed";a["Reiniciar Animaci\u00f3n"]=a["Init Animation"]=a["Reinicia Animaci\u00f3"]=a.finko=a["Recommencer l'Animation"]=a["Reiniciar Anima\u00e7\u00e3o"]=a.initAnimation="initAnimation";a["Explicaci\u00f3n"]=a.Explanation=a.Azalpena=a.Explication=a["Explica\u00e7\u00e3o"]=a["Explicaci\u00f3"]="Explanation";a.tooltip=a.dica="tooltip";a.discreto=a.discrete=a.discret=a.diskretu="discrete";a.interfaz=a.gui=a["interf\u00edcie"]=a.interfaze=a["interface"]="gui";a.pulsador=a.spinner=a.polsador=
a.pultsadore=a.bouton="spinner";a["campo de texto"]=a.textfield=a["camp de text"]=a["testu esarrua"]=a["champ de texte"]="textfield";a["men\u00fa"]=a.choice=a.menu=a.escolha="menu";a.barra=a.scrollbar=a.barre="scrollbar";a.opciones=a.options=a.opcions=a.aukerak=a["opci\u00f3ns"]=a["op\u00e7\u00f5es"]="options";a.interior=a.barruko=a["int\u00e9rieur"]="interior";a["condici\u00f3n"]=a.condition=a["condici\u00f3"]=a.baldintza=a["condi\u00e7\u00e3o"]="condition";a["acci\u00f3n"]=a.action=a["acci\u00f3"]=
a.ekintza=a["a\u00e7\u00e3o"]="action";a.evento=a.event=a.esdeveniment=a.gertaera=a["\u00e9v\u00e9nement"]="event";a["abrir URL"]=a["open URL"]=a["obre URL"]=a["URL zabaldu"]=a["ouvrir URL"]=a.openURL="openURL";a["abrir Escena"]=a["open Scene"]=a["obre Escena"]=a["eszena zabaldu"]=a["ouvrir Escena"]=a["abrir Cena"]=a.openScene="openScene";a["bot\u00f3n"]=a.button=a["bot\u00f3"]=a.botoi=a.bouton=a["bot\u00e3o"]="button";a.mensaje=a.message=a.mezua=a.mensaxe=a.mensagem=a.missatge="message";a.alternar=
a.alternate=a.alterna=a.txandakatu=a.alterner="alternate";a["ejecuci\u00f3n"]=a.execution=a["execuci\u00f3"]=a.gauzatze=a["ex\u00e9cution"]=a["execuci\u00f3n"]=a["execu\u00e7\u00e3o"]="execution";a.calcular=a.calculate=a.calcula=a.kalkulatu=a.calculer="calculate";a.coord_abs=a.abs_coord=a.koor_abs="abs_coord";a.negrita=a.bold=a.negreta=a.lodi=a["caract\u00e8re gras"]=a.negra=a.negrito="bold";a.cursiva=a.italics=a.etzana=a.italique=a["it\u00e1lico"]="italics";a.subrayada=a.underlined=a.subratllat=
a.azpimarratua=a.soulignement=a["subli\u00f1ada"]=a.sublinhado="underlined";a.pos_mensajes=a.msg_pos=a.pos_missatges=a.mezuen_pos=a.pos_messages=a.pos_mensaxes="msg_pos";a.izquierda=a.left=a.esquerra=a.eskerrean=a.gauche=a.esquerda=a.esquerda=a.esquerra=a.x="x";a.derecha=a.right=a.dreta=a.eskuinan=a.droite=a.dereita=a.direita=a.dreta="right";a["sensible_a_los_movimientos_del_rat\u00f3n"]=a.sensitive_to_mouse_movements=a["sensible_als_moviments_del_ratol\u00ed"]=a["xagu mugimenduarekiko sentikorra"]=
a.sensible_aux_mouvements_du_souris=a.sensible_aos_movementos_do_rato=a["sens\u00edvel_aos_movimentos_do_mouse"]="sensitive_to_mouse_movements";a.reproducir=a.play=a.reprodueix=a.erreproduzitu=a.reproduire=a.reproduzir=a.playAudio="playAudio";a["activo-si"]=a["active-if"]=a["actiu-si"]=a["altiboa-baldin"]=a["actif-si"]=a["activo-se"]=a["ativo-se"]=a.activeif="activeif";a.rotfin=a.finrot=a.bukrot=a.endrot="endrot";a.posfin=a.finpos=a.bukpos=a.endpos="endpos";a.editable=a.editagarria=a["edit\u00e1vel"]=
"editable";a.R2="2D";a.R3="3D";a.vectores=a.bektoreak=a.vecteurs=a.vetores=a.vectors="vectors";a["fuente puntos"]=a["font size"]=a["font punts"]=a["puntu iturria"]=a["source points"]=a["fonte puntos"]=a["fonte pontos"]=a.font_size="font_size";a.escenario=a.scenario=a.escenari=a.agertoki=a["sc\u00e8ne"]=a["cen\u00e1rio"]="scenario";a.cID="cID";a.matriz=a.matrix=a.matriu=a.matrice="matrix";a.filas=a.rows=a.files="rows";a.columnas=a.columns=a.colonnes="columns";a.solo_texto=a.only_text=a.seulement_texte=
a["s\u00f3_texto"]=a.tan_sols_texte=a.onlyText="onlyText";a.respuesta=a.answer="answer";a.peso=a.weight=a.pes="weight";a.decimal_symbol=a["signo decimal"]=a["decimal symbol"]="decimal_symbol";a.info="info";a.library="library";a.color_contorn_text=a.color_text_border=a.color_borde_texto=a.muga_testuaren_kolorea=a.couleur_contour_texte=a.cor_borde_texto=a.colore_bordo_testo=a.cor_borda_texto=a.color_contorn_text=a.border="border";a.video=a["vid\u00e9o"]="video";a.audio=a["\u00e0udio"]="audio";a.autoplay=
"autoplay";a.poster="poster";a.opacidad=a.opacity=a["opacit\u00e9"]=a.opacitat=a.opacidade="opacity";a.alinear=a.align=a["ali\u00f1ar"]=a.aligner="align";a.anchor="anchor";a.a_left="left";a.a_center="center";a.a_right="right";a.a_justify="justify";a.a_top_left="top_left";a.a_top_center="top_center";a.a_top_right="top_right";a.a_center_left="center_left";a.a_center_center="center_center";a.a_center_right="center_right";a.a_bottom_left="bottom_left";a.a_bottom_center="bottom_center";a.a_bottom_right=
"bottom_right";a.malla=a.mesh="mesh";a.local=a.Local="local";a.rectangle=a["rect\u00e1ngulo"]="rectangle";a.lineDash="lineDash";a.solid="solid";a.dot="dot";a.dash="dash";a.dash_dot="dash_dot";a.offset_dist="offset_dist";a.offset_angle="offset_angle";a.flat="flat";a.borderColor="borderColor";a.text_align="text_align";a.image_align="image_align";a.checkbox="checkbox";a.torus=a.toro="torus";a.R="R";a.r="r";a.border_radius="border_radius";a.radio_group="radio_group";a.font_family="font_family";a.resizable=
"resizable";a.antialias="antialias";a.image_loader="image_loader";a.expand="expand";a.cover=a.cubrir="expand";a.fit=a.escalar="fit";a.code="code";a.doc="doc";a.image_dec="image_dec";a.image_inc="image_inc";a.btn_pos="btn_pos";a.v_left="v_left";a.v_right="v_right";a.h_left="h_left";a.h_right="h_right";a.h_left_right="h_left_right";return a}(babel||Object.create(null)),descartesJS=function(a){if(a.loadLib)return a;a.symbolFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.extraBFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.extraBIFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.extraIFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.extraRFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.arimoBFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.arimoBIFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.arimoIFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.arimoRFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.cousineBFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.cousineBIFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.cousineIFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.cousineRFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.tinosBFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.tinosBIFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.tinosIFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.tinosRFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.addFonts=function(){return"@font-face{font-family:'DJS_sansserif';src:url('"+a.arimoBFont()+"') format('woff2');font-style:normal;font-weight:bold;}\n@font-face{font-family:'DJS_sansserif';src:url('"+a.arimoBIFont()+"') format('woff2');font-style:italic;font-weight:bold;}\n@font-face{font-family:'DJS_sansserif';src:url('"+a.arimoIFont()+"') format('woff2');font-style:italic;font-weight:normal;}\n@font-face{font-family:'DJS_sansserif';src:url('"+a.arimoRFont()+"') format('woff2');font-style:normal;font-weight:normal;}\n@font-face{font-family:'DJS_monospace';src:url('"+
a.cousineBFont()+"') format('woff2');font-style:normal;font-weight:bold;}\n@font-face{font-family:'DJS_monospace';src:url('"+a.cousineBIFont()+"') format('woff2');font-style:italic;font-weight:bold;}\n@font-face{font-family:'DJS_monospace';src:url('"+a.cousineIFont()+"') format('woff2');font-style:italic;font-weight:normal;}\n@font-face{font-family:'DJS_monospace';src:url('"+a.cousineRFont()+"') format('woff2');font-style:normal;font-weight:normal;}\n@font-face{font-family:'DJS_serif';src:url('"+
a.tinosBFont()+"') format('woff2');font-style:normal;font-weight:bold;}\n@font-face{font-family:'DJS_serif';src:url('"+a.tinosBIFont()+"') format('woff2');font-style:italic;font-weight:bold;}\n@font-face{font-family:'DJS_serif';src:url('"+a.tinosIFont()+"') format('woff2');font-style:italic;font-weight:normal;}\n@font-face{font-family:'DJS_serif';src:url('"+a.tinosRFont()+"') format('woff2');font-style:normal;font-weight:normal;}\n@font-face{font-family:'DJS_symbola';src:url('"+a.symbolFont()+"') format('woff2');font-style:normal;font-weight:bold;}\n@font-face{font-family:'DJS_symbola';src:url('"+
a.symbolFont()+"') format('woff2');font-style:italic;font-weight:bold;}\n@font-face{font-family:'DJS_symbola';src:url('"+a.symbolFont()+"') format('woff2');font-style:italic;font-weight:normal;}\n@font-face{font-family:'DJS_symbola';src:url('"+a.symbolFont()+"') format('woff2');font-style:normal;font-weight:normal;}\n@font-face{font-family:'DJS_extra';src:url('"+a.extraBFont()+"') format('woff2');font-style:normal;font-weight:bold;}\n@font-face{font-family:'DJS_extra';src:url('"+a.extraBIFont()+"') format('woff2');font-style:italic;font-weight:bold;}\n@font-face{font-family:'DJS_extra';src:url('"+
a.extraIFont()+"') format('woff2');font-style:italic;font-weight:normal;}\n@font-face{font-family:'DJS_extra';src:url('"+a.extraRFont()+"') format('woff2');font-style:normal;font-weight:normal;}\n"};return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r={bold:"Bold",italic:"Italic",italics:"Italic","bold+italic":"Italic Bold"};a.serif_font="descartesJS_serif,DJS_symbola,DJS_extra,DJS_serif,Times,'Times New Roman','Liberation Serif','Nimbus Roman No9 L Regular',serif";a.sansserif_font="descartesJS_sansserif,DJS_symbola,DJS_sansserif,Helvetica,Arial,'Liberation Sans','Nimbus Sans L',sans-serif";a.monospace_font="descartesJS_monospace,DJS_symbola,DJS_monospace,'Courier New',Courier,'Liberation Mono','Nimbus Mono L',monospace";
a.convertFont=function(d){if(""==d)return"";f=d.split(",");e="";e+=a.getFontStyle(f[1])+" ";e+=f[2]+"px ";return e+=a.getFontName(f[0].split(" ")[0])};a.getFontName=function(e){e=e.toLowerCase();d=a.monospace_font;if("serif"===e||"times new roman"===e||"timesroman"===e||"times"===e)d=a.serif_font;else if("sansserif"===e||"arial"===e||"helvetica"===e)d=a.sansserif_font;return d};a.getFontStyle=function(a){return r[a.toLowerCase()]||""};a.getTextWidth=function(d,b){a.ctx.font=b;return Math.round(a.ctx.measureText(d).width)};
a.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 a}(descartesJS||{});
descartesJS=function(a){function f(){var a,c,b,d,g,n,e;Number.prototype.oToFixed=Number.prototype.toFixed;Number.prototype.toFixed=function(k){k=k||0;k=0>k?0:parseInt(k);a=this.toString();-1!==a.indexOf("e")&&(d=a.split("e"),n="-"===d[0][0]?"-":"",g="-"===n?parseFloat(d[0].substring(1)).oToFixed(11):parseFloat(d[0]).oToFixed(11),e=parseInt(d[1]),c=g.indexOf("."),g=g.replace(".",""),0>c+e?(c=0>c?1:c,a=n+"0."+"0".repeat(Math.abs(c+e))+g):a=n+g+"0".repeat(e-g.length+1));c=a.indexOf(".");-1===c?0<k&&
(a+="."+"0".repeat(k)):(b=a.length-c-1,a=b>=k?11>=k?parseFloat(a).oToFixed(k):a.substring(0,c+k+1):a+"0".repeat(k-b));return a}}if(a.loadLib)return a;var e=2*Math.PI,d=360/e,r=e/360,m=Math.floor,b,h,g,l;a.rangeOK=1;a.cssScale=1;a.radToDeg=function(a){return a*d};a.degToRad=function(a){return a*r};a.drawLine=function(a,c,b,d,g,n,e){a.lineWidth=e||1;a.strokeStyle=n||"black";l=a.lineWidth%2*.5;a.beginPath();a.moveTo(m(c)+l,m(b)+l);a.lineTo(m(d)+l,m(g)+l);a.stroke()};a.getColor=function(a,c){if("string"===
typeof c)return c;b=a.eval(c);return"rgba("+m(255*b[0][0])+","+m(255*b[0][1])+","+m(255*b[0][2])+","+(1-b[0][3])+")"};a.getFeatures=function(){var c=navigator.appVersion.toLowerCase();a.hasTouchSupport=window.hasOwnProperty&&window.hasOwnProperty("ontouchstart")||"ontouchstart"in window||/android/i.test(c);a.isIOS=/iPad|iPhone/i.test(navigator.userAgent);a.isMsEdge=/Edge/i.test(navigator.userAgent);c=a.newHTML("canvas");a.hasCanvas=c.getContext&&c.getContext("2d");a.hasCanvas&&(c.width=c.height=1,
a.ctx=a.hasCanvas,a._ratio=1.5);f()};var q,c;a.removeNeedlessDecimals=function(a){if("string"==typeof a&&(q=a.indexOf("."),-1!==q)){c=a.substring(q);if(0==parseFloat(c))return a.substring(0,q);for(var b=c.length-1;0<b;b--)if("0"!==c.charAt(b))return a.substring(0,q+b+1)}return a};a.returnValue=function(a){return"number"===typeof a?parseFloat(a.toFixed(11)):a};a.whichBtn=function(a){return a.touches?"L":0===a.button?"L":1===a.button?"M":"R"};a.createGradient=function(a,c,b){a=void 0===a?0:a;c=void 0===
c?100:c;b="linear-gradient("+(void 0===b?0:b)+"deg,";for(var k=2*a,d=a;d<c;d++)a=m(100-d-35),b+="rgba(0,0,0,"+a*a*192/1E4/255+") "+(2*d-k)+"%, ";return b+"rgba(0,0,0,0.1) 100%)"};a.getCursorPosition=function(c,b){h=c.touches?c.touches[0]:c;g=b.getBoundingClientRect();return h?{x:(h.pageX-window.pageXOffset-g.left)/a.cssScale,y:(h.pageY-window.pageYOffset-g.top)/a.cssScale}:null};a.splitSeparator=function(a){a=a.replace(/\\n/g,"\n");for(var c=!1,b,d=[],g=0,n=0,e=a.length;n<e;n++)b=a.charAt(n),"'"===
b&&(c=!c),c||";"!==b&&"\n"!==b||(d.push(a.substring(g,n).replace(/\n/g,"\\n")),g=n+1);d.push(a.substring(g).replace(/\n/g,"\\n"));return d};a.preventDefault=function(a){a.preventDefault();return!1};a.convertHTMLEntities=function(c){var b=a.newHTML("textarea");b.innerHTML=c;return b.value};a.newHTML=function(a,c){a=document.createElement(a);for(var b in c)a.setAttribute(b,c[b]);return a};window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||
window.msRequestAnimationFrame;window.cancelAnimationFrame=window.cancelAnimationFrame||window.mozCancelAnimationFrame;a.setInterval=function(a,c){function b(){Date.now()-d>=c&&(a.call(),d=Date.now());k.value=requestAnimationFrame(b)}if(!requestAnimationFrame)return setInterval(a,c);var d=Date.now(),k={};k.value=requestAnimationFrame(b);return k};a.clearInterval=function(a){a&&(cancelAnimationFrame?cancelAnimationFrame(a.value):clearInterval(a))};a.setTimeout=function(a,c){function b(){Date.now()-
d>=c?a.call():k.value=requestAnimationFrame(b)}if(!requestAnimationFrame)return setTimeout(a,c);var d=Date.now(),k={};k.value=requestAnimationFrame(b);return k};a.clearTimeout=function(a){a&&(cancelAnimationFrame?cancelAnimationFrame(a.value):clearTimeout(a))};a.showAbout=function(){var c="<html>\n<head>\n<style>\nbody{text-align:center;}\niframe{width:650px;height:73px;overflow:hidden;border:1px solid black;}\ndt{font-weight:bold;margin-top:10px;}\n</style>\n</head>\n<body>\n<iframe src='http://arquimedes.matem.unam.mx/Descartes5/creditos/bannerPatrocinadores.html'></iframe>\n<h2><a href='http://proyectodescartes.org/' target='_blank'>ProyectoDescartes.org</a><br><a href='http://descartesjs.org' target='_blank'>DescartesJS.org</a></h2>\n<dl>\n<dt>Dise\u00f1o funcional:</dt>\n<dd>\n<nobr>Jos\u00e9 Luis Abreu Leon,</nobr>\n<nobr>Jos\u00e9 R. Galo Sanchez,</nobr>\n<nobr>Juan Madrigal Muga</nobr>\n</dd>\n<dt>Autores del software:</dt>\n<dd>\n<nobr>Jos\u00e9 Luis Abreu Leon,</nobr>\n<nobr>Marta Oliver\u00e1 Serrat,</nobr>\n<nobr>Oscar Escamilla Gonz\u00e1lez,</nobr>\n<nobr>Joel Espinosa Longi</nobr>\n</dd></dl>\n<p>\nEl software en Java est\u00e1 bajo la licencia\n<a href='https://joinup.ec.europa.eu/software/page/eupl/licence-eupl'>EUPL v.1.1</a>\n<br>\nEl software en JavaScript est\u00e1 bajo licencia\n<a href='http://www.gnu.org/licenses/lgpl.html'>LGPL</a>\n</p>\n<p>\nLa documentaci\u00f3n y el c\u00f3digo fuente se encuentran en :\n<br>\n<a href='http://descartes.matem.unam.mx/'>http://descartes.matem.unam.mx/</a>\n</p>";
a.ccLicense&&(c+="<p>\nEste objeto, creado con Descartes, est\u00e1 licenciado\npor sus autores como\n<a href='https://creativecommons.org/licenses/by-nc-sa/4.0/deed.es'><nobr>Creative Commons</nobr></a>\n<br>\n<a href='https://creativecommons.org/licenses/by-nc-sa/4.0/deed.es'><img src='https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png'></a>\n</p>");c+="</body> </html>";var b=window.open("","creditos","width=700,height=500,titlebar=0,toolbar=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0");
b.document.write(c);b.document.close()};return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;a.cacheFiles=Object.create(null);a.openExternalFile=function(f){if(a.cacheFiles[f])return a.cacheFiles[f];var e=null,d=new XMLHttpRequest;d.open("GET",f,!1);try{d.send(null),e=200===d.status||304===d.status?d.responseText:d.responseText||"",e=404===d.status?"":e,e.match(String.fromCharCode(65533))&&(d.open("GET",f,!1),d.overrideMimeType("text/plain;charset=ISO-8859-1"),d.send(null),e=d.responseText)}catch(r){e=null}return e};a.addExternalFileContent=function(f,
e){a.cacheFiles[f]=e};return a}(descartesJS||{});
descartesJS=function(a){function f(a){p=a.indexOf("--radial--");-1!=p&&(a=a.substring(0,p));m=a.trim();a={ignoreAccents:!1,ignoreCaps:!1,regExp:null};m[0]==m[m.length-1]&&"'"==m[0]&&(a.ignoreCaps=!0,m=m.substring(1,m.length-1),"`"==m[0]&&"\u00b4"==m[m.length-1]&&(a.ignoreAccents=!0,m=m.substring(1,m.length-1)));"`"==m[0]&&"\u00b4"==m[m.length-1]&&(a.ignoreAccents=!0,m=m.substring(1,m.length-1),m[0]==m[m.length-1]&&"'"==m[0]&&(a.ignoreCaps=!0,m=m.substring(1,m.length-1)));"*"===m.charAt(0)&&"*"!==
m.charAt(m.length-1)?m=m.substring(1)+"$":"*"!==m.charAt(0)&&"*"===m.charAt(m.length-1)?m="^"+m.substring(0,m.length-1):"*"!==m.charAt(0)&&"*"!==m.charAt(m.length-1)?m="^"+m+"$":"*"===m.charAt(0)&&"*"===m.charAt(m.length-1)&&(m=m.substring(1,m.length-1));a.regExp=m.replace(/\?/g,"[\\S\\s]{1}");return a}function e(a,c){m=(a||"").trim();a={ignoreAccents:!1,ignoreCaps:!1,regExp:null};a.expr=m.split(",");a.expr[0]=a.expr[0].trim();a.expr[0]={type:a.expr[0].charAt(0),expr:c.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:c.parser.parse(a.expr[1].substring(0,a.expr[1].length-1))};return a}function d(a,b,d){b=parseFloat(b);l=a.expr[0];q=a.expr[1];c=d.eval(l.expr);u=d.eval(q.expr);k="("==l.type||"["==l.type;w=")"==q.type||"]"==q.type;return k&&b>c&&w&&b<=u?1:0}function r(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(a.loadLib)return a;var m,b,h,g,l,q,c,u,k,w,p;a.buildRegularExpressionsPatterns=function(a,c){a=a||"";"("===a.charAt(0)&&")"===a.charAt(a.length-1)&&-1===a.indexOf(",")&&(a=a.substring(1,a.length-1));a=a.replace(/&squot;/g,"'").replace(/&amp;/g,"&").split("|");for(var n=0,d=a.length;n<d;n++){b=a[n].split("&");h=[];for(var k=0,g=b.length;k<g;k++)m=b[k],-1===m.indexOf(",")||"("!==
m.charAt(0)&&"["!==m.charAt(0)||")"!==m.charAt(m.length-1)&&"]"!==m.charAt(m.length-1)?h.push(f(m)):h.push(e(m,c));a[n]=h}return a};a.escorrecto=function(c,n,k,e){k=k||a.externalEvaluator;e=e||a.buildRegularExpressionsPatterns(c,k);n=r(n);c=0;for(var l=e.length;c<l;c++){b=e[c];g=!0;for(var h=0,f=b.length;h<f;h++)g=b[h].regExp?g&&!!n.match(new RegExp(r(b[h].regExp),"i")):g&&d(b[h],n,k);if(g)return 1}return 0};a.esCorrecto=function(c,n,k,e){k=k||a.externalEvaluator;e=e||a.buildRegularExpressionsPatterns(c,
k);c=0;for(var l=e.length;c<l;c++){b=e[c];g=!0;for(var h=0,f=b.length;h<f;h++)(m=b[h].regExp)?(b[h].ignoreAccents&&(n=r(n),m=r(m)),b[h].ignoreCaps&&(n=n.toLowerCase(),m=r(m).toLowerCase()),g=g&&!!n.match(m)):g=g=g&&d(b[h],n,k);if(g)return 1}return 0};return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;a.loaderImg=new Image;a.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>");a.getCCLImg=
function(){var a=new Image;a.src="data:image/svg+xml;base64,"+btoa("<svg xmlns='http://www.w3.org/2000/svg' width='88' height='31' viewBox='0 0 120 42'><path fill='#aab2ab' stroke='#000' d='M.5.5h119v41H.5z'/><path d='M0 29.5h120V42H0z'/><circle cx='21' cy='19.5' r='18.25' fill='#aab2ab'/><path d='M49.935 33.105c.364.298.585.806.585 1.284 0 .403-.07.592-.228.833-.158.242-.377.405-.674.547.41.118.715.323.917.617.202.294.303.649.303 1.063 0 .68-.302 1.117-.721 1.465-.432.359-1.067.455-1.622.455H45.28v-6.622h3.122c.579 0 1.127.025 1.533.358zM48.8 35.24c.175-.141.307-.323.307-.6 0-.331-.126-.473-.307-.612-.188-.145-.351-.147-.697-.147H46.74v1.545h1.363c.26 0 .51-.035.697-.186zm-.5 2.996c.288 0 .553-.018.753-.181a.885.885 0 0 0 .325-.691c0-.34-.095-.552-.288-.727-.196-.177-.446-.218-.762-.218h-1.59v1.817zm2.795-5.489h1.633l1.55 2.616 1.543-2.616h1.623l-2.459 4.08v2.542h-1.46v-2.578zm21.34 6.622H71.07v-6.622h1.448l2.774 4.443.008-4.443h1.367v6.622H75.21l-2.765-4.433zm8.48-5.558c-1.07 0-1.893.887-1.893 2.224 0 1.336.91 2.263 1.893 2.263.823 0 1.503-.646 1.503-1.485h1.41c0 1.63-1.022 2.704-2.913 2.704-1.89 0-3.259-1.07-3.259-3.434 0-2.363 1.407-3.499 3.26-3.499 1.853 0 2.857.96 2.857 2.386h-1.41c0-.774-.755-1.159-1.448-1.159zm17.845 4.297c.27.228.68.283 1.023.283.485 0 .93-.072 1.157-.413.157-.235.118-.615-.043-.848-.223-.323-.713-.38-1.078-.474-.498-.129-.996-.18-1.437-.412-.411-.215-.835-.486-1.078-.881-.139-.225-.172-.506-.172-.775 0-.703.348-1.153.788-1.513.453-.371 1.11-.442 1.687-.49.698-.057 1.352.088 1.843.491.472.387.697 1.03.807 1.644h-1.414c.047-.386-.17-.615-.406-.798-.241-.188-.589-.207-.895-.204-.23.002-.486.028-.669.167-.177.135-.328.36-.328.584 0 .238.161.48.352.622.444.333 1.09.218 1.621.38.398.122.854.17 1.167.445.422.371.797.972.797 1.485 0 .672-.279 1.154-.701 1.517-.54.466-1.37.532-2.055.599-.756.021-1.449-.117-1.97-.558-.505-.427-.849-1.13-.849-1.792h1.413c0 .476.176.717.44.941zm7.886-5.361l2.477 6.622h-1.512l-.501-1.475h-2.477l-.52 1.475h-1.465l2.504-6.622zm-1.632 4.06h1.716l-.845-2.427z' fill='#fff'/><g stroke-width='2' fill='#fff' stroke='#000'><circle r='14.25' cy='19.5' cx='21' stroke-width='2.8'/><circle r='10.55' cx='52' cy='15'/><circle r='10.55' cy='15' cx='78'/><circle r='10.55' cx='104' cy='14.981'/></g><circle r='1.625' cy='9' cx='52'/><path d='M18.75 17.979c-.39-.852-.974-1.278-1.755-1.278-1.378 0-2.067.928-2.067 2.784 0 1.856.69 2.783 2.067 2.783.91 0 1.56-.452 1.951-1.357l1.91 1.017c-.91 1.618-2.277 2.428-4.098 2.428-1.406 0-2.531-.43-3.377-1.292-.846-.862-1.27-2.05-1.27-3.564 0-1.487.438-2.668 1.31-3.543.87-.875 1.958-1.312 3.259-1.312 1.926 0 3.304.759 4.14 2.275zm8.99 0c-.39-.852-.964-1.278-1.72-1.278-1.405 0-2.109.928-2.109 2.784 0 1.856.704 2.783 2.11 2.783.912 0 1.55-.452 1.915-1.357l1.953 1.017c-.91 1.618-2.274 2.428-4.092 2.428-1.404 0-2.526-.43-3.372-1.292-.843-.862-1.266-2.05-1.266-3.564 0-1.487.429-2.668 1.287-3.543.857-.875 1.947-1.312 3.273-1.312 1.923 0 3.3.759 4.13 2.275l-2.108 1.059zm27.381-5.862a.75.75 0 0 0-.75-.75h-4.743a.75.75 0 0 0-.749.75v4.742h1.324v5.617h3.594v-5.617h1.324zm13.779-.352l10.343 4.66a.867.867 0 0 1 .312.696c0 .887-.754 1.154-1.435 1.154-1.05 0-1.818-.324-2.588-1.048l-1.598 1.609c.962.84 2.22 1.374 3.52 1.389v1.789h1.332v-1.79c1.584-.115 2.895-1.108 3.191-2.58l4.471 2.048.852-2.129-10.391-4.682a.467.467 0 0 1-.106-.295c0-.723.814-.9 1.39-.9.71 0 1.42.281 1.983.68L81.7 10.8a5.005 5.005 0 0 0-2.914-1.065V7.95h-1.332v1.787c-1.417.083-2.587.83-2.987 2.059l-4.533-2.073zm29.88 1.58c.461-2.918 2.515-4.478 5.09-4.478 3.7 0 5.957 2.686 5.957 6.268 0 3.495-2.4 6.21-6.016 6.21-2.487 0-4.714-1.53-5.12-4.535h2.922c.087 1.56 1.1 2.109 2.546 2.109 1.648 0 2.718-1.53 2.718-3.87 0-2.456-.925-3.755-2.661-3.755-1.272 0-2.371.462-2.603 2.05l.85-.005-2.3 2.3-2.299-2.3.915.006z'/></svg>");
return a};a.getSvgArrowUp=function(a,e){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===e?"24c":e)+'" d="m19.5 17.5-7.5-12-7.5 12z"/></svg>')};a.getSvgArrowDown=function(a,e){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===e?"d00018":e)+'"/></svg>')};a.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>")};a.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>")};
a.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 a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.floor,e,d,r,m,b,h,g,l,q,c,u,k,w,p,v=function(c,b){this.r=this.g=this.b=0;this.a=1;this.evaluator=b;this.getColor=this.getColorStr;if(c){if(babel[c]&&("net"===babel[c]&&(c="rojo"),c=babel[c],this.r=a.toHex(c.substring(1,3)),this.g=a.toHex(c.substring(3,5)),this.b=a.toHex(c.substring(5,7)),this.colorStr=c),6===c.length&&(this.r=a.toHex(c.substring(0,2)),this.g=a.toHex(c.substring(2,4)),this.b=a.toHex(c.substring(4,6)),this.colorStr="#"+c),8===
c.length&&(this.r=a.toHex(c.substring(2,4)),this.g=a.toHex(c.substring(4,6)),this.b=a.toHex(c.substring(6,8)),this.a=1-a.toHex(c.substring(0,2))/255,this.colorStr="rgba("+this.r+","+this.g+","+this.b+","+this.a+")"),"("===c[0]){d=[];r=this.splitComa(c.substring(1,c.length-1));c=0;for(b=r.length;c<b;c++)h=r[c],m=parseInt(h,16),h!==m.toString(16)&&h!=="0"+m.toString(16)?("["===h.charAt(0)&&"]"===h.charAt(h.length-1)&&(h=h.substring(1,h.length-1)),d.push(this.evaluator.parser.parse(h))):d.push(this.evaluator.parser.parse((m/
255).toString()));this.rExpr=d[0];this.gExpr=d[1];this.bExpr=d[2];this.aExpr=d[3];this.getColor=this.getColorExp}}else this.colorStr="rgba("+this.r+","+this.g+","+this.b+","+this.a+")"};v.prototype.splitComa=function(a){b=[];for(var n=q=l=g=0,d=a.length;n<d;n++)c=a.charAt(n),"("===c?g++:")"===c?g--:"["===c?l++:"]"===c?l--:","===c&&0===g&&0===l&&(b.push(a.substring(q,n)),q=n+1);b.push(a.substring(q));return b};v.prototype.getColorStr=function(){return this.colorStr};v.prototype.getColorExp=function(){e=
this.evaluator;this.r=f(255*e.eval(this.rExpr));this.g=f(255*e.eval(this.gExpr));this.b=f(255*e.eval(this.bExpr));this.a=1-e.eval(this.aExpr);return"rgba("+this.r+","+this.g+","+this.b+","+this.a+")"};v.prototype.borderColor=function(){return 380>this.r+this.g+this.b?"#ffffff":"#000000"};a.toHex=function(a){return parseInt("0x"+a,16)};a.RGBAToHexColor=function(a){a=a.substring(5,a.length-1).split(",");u=parseInt(a[0]).toString(16);k=parseInt(a[1]).toString(16);w=parseInt(a[2]).toString(16);p=(255-
parseInt(255*parseFloat(a[3]))).toString(16);1===u.length&&(u="0"+u);1===k.length&&(k="0"+k);1===w.length&&(w="0"+w);1===p.length&&(p="0"+p);return new v(p+u+k+w)};a.Color=v;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=document.head,e=a.newHTML("meta",{"http-equiv":"X-UA-Compatible",content:"IE=edge,chrome=1"});f.appendChild(e);e=a.newHTML("meta",{name:"viewport",content:"width=device-width,initial-scale=1.0,user-scalable=yes"});document.querySelector("meta[name=viewport]")||f.appendChild(e);e=a.newHTML("meta",{name:"mobile-web-app-capable",content:"yes"});f.appendChild(e);e=a.newHTML("meta",{name:"apple-mobile-web-app-capable",content:"yes"});f.appendChild(e);
e=a.newHTML("meta",{name:"apple-mobile-web-app-status-bar-style",content:"black"});f.appendChild(e);(f=document.getElementById("StyleDescartesApps2"))&&f.remove();f=a.newHTML("style",{rel:"stylesheet",type:"text/css",id:"StyleDescartesApps2"});document.head.insertBefore(f,document.head.firstChild);f.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-apearance:none;apearance: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;}\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:white;border:1px solid gray;}\n.DescartesCheckboxContainer input[type=checkbox]:checked+label::after{content:'';background:url("+
a.getSvgCheckbox()+") center center no-repeat;background-size:contain;background-color:white;}\n.DescartesCheckboxContainer input[type=radio]+label::after{position:absolute;left:0px;content:'';padding:0;margin:0;width:100%;height:100%;background:white;border:1px solid gray;border-radius:50%;}\n.DescartesCheckboxContainer input[type=radio]:checked+label::after{content:'';background:url("+a.getSvgRadio()+") center center no-repeat;background-size:contain;background-color:white;}\n.DescartesCheckbox{position:absolute;}\n.DescartesButton{position:absolute;cursor:pointer;}\n.DescartesButtonContainer{position:absolute;overflow:hidden;}\n.DescartesSpinnerContainer,.DescartesCheckboxContainer,.DescartesTextFieldContainer,.DescartesMenuContainer{background-color:lightgray;position:absolute;overflow:hidden;}\n.DescartesSpinnerContainer input,.DescartesCheckboxContainer,.DescartesTextFieldContainer input,.DescartesMenuContainer select{border-radius:0;}\n.DescartesSpinnerField,.DescartesTextFieldField,.DescartesMenuField,.DescartesScrollbarField{font-family:"+
a.sansserif_font+";padding:0 2px;border:solid #666 1px;position:absolute;}\n.DescartesSpinnerLabel,.DescartesCheckboxLabel,.DescartesMenuLabel,.DescartesScrollbarLabel,.DescartesTextFieldLabel{font-family:"+a.sansserif_font+";font-weight:normal;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;background-color:#e0e4e8;position:absolute;left:0;top:0;}\n.DescartesGraphicControl{touch-action:none;border-style:none;position:absolute;}\n.DescartesTextAreaContainer{position:absolute;overflow:hidden;background:#F7F7F7;}\n.DescartesMenuSelect{font-family:"+
a.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('"+a.getSvgMenu()+"') 100%/22px no-repeat;padding:0 22px 0 5px;-webkit-appearance:none;-moz-appearance:none;appearance:none;}\n.DescartesMenuSelect::-ms-expand{display:none;}\n.DescartesScrollbarContainer{touch-action:none;background:#eee;overflow:hidden;position:absolute;}\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:"+
a.createGradient(50,100)+", url('"+a.getSvgArrowUp()+"');}\n.DJS_Up[horizontal=true]{background-color:#f0f8ff;background-image:"+a.createGradient(50,100,90)+", url('"+a.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:"+a.createGradient(0,50)+", url('"+a.getSvgArrowDown()+"');}\n.DJS_Down[horizontal=true]{background-color:#f0f8ff;background-image:"+
a.createGradient(50,100,-90)+", url('"+a.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.DJS_Gradient{position:absolute;display:none;}\n"+(a.addFonts?a.addFonts():"");return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.sin,e=Math.floor,d=Math.random,r=Math.round,m=Math.abs,b=String.fromCharCode,h,g,l,q,c,u,k,w,p,v,n=function(a){this.key=(void 0===a?0:a).toString()};n.prototype.getKey=function(a){h=[];for(var c=0;256>c;c++)h[c]=b(this.alfanum(e(m(7.5*(f(1*c-a)+f(1.4*c+a)+f(.6*c-a)+f(2.2*c+a))))));return h.join("")};n.prototype.encode=function(a){g=e(31*d());this.key=this.getKey(g);return b(this.alfanum(g))+this.encripta(a)};n.prototype.decode=function(a){g=
this.numalfa(a.charCodeAt(0));this.key=this.getKey(g);return this.desencripta(a.substring(1))};n.prototype.encripta=function(a){return this.bytesToString(this.encriptaAux(this.stringToBytes(a)))};n.prototype.encriptaAux=function(a){if(null==a||null==this.key)return null;u=Array(3*a.length);for(var c=0,b=a.length;c<b;c++)p=256*e(a[c]+128)+r(255*d())+65536*r(255*d()),v=e((p<<this.shift(c))/256),u[3*c]=this.alfanum(v%32),u[3*c+1]=this.alfanum(v/32%32),u[3*c+2]=this.alfanum(v/1024%32);return u};n.prototype.desencripta=
function(a){return this.bytesToString(this.desencriptaAux(this.stringToBytes(a)))};n.prototype.desencriptaAux=function(a){if(null==a||null==this.key)return null;k=Array(a.length/3);for(var c=0,b=k.length;c<b;c++)v=this.numalfa(a[3*c])+32*this.numalfa(a[3*c+1])+1024*this.numalfa(a[3*c+2]),p=e(256*v>>this.shift(c)),w=e(p/256)%256-128,0>w&&(w+=256),k[c]=w;return k};n.prototype.alfanum=function(a){return(10>a?48:87)+e(a)};n.prototype.numalfa=function(a){return a-(58>a?48:87)};n.prototype.stringToBytes=
function(a){q=[];for(var c=0,b=a.length;c<b;c++)q.push(a.charCodeAt(c));return q};n.prototype.bytesToString=function(a){for(var c=0,n=a.length;c<n;c++)a[c]=b(a[c]);return a.join("")};n.prototype.shift=function(a){l=this.key.charCodeAt(a%this.key.length);q=this.numalfa(l);c=e(q/2%8);0==c&&(c=4);return c};n.prototype.parseByte=function(a){a=parseInt(a);a=0>a?0:a;return 255<a?255:a};a.Krypto=n;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){this.parent=e;var f=e.evaluator,m=f.parser;e=new a.Auxiliary(e);var b=this;b.delay=d.delay?m.parse(d.delay):m.parse("60");b.loop=d.loop?d.loop:!1;b.auto=void 0==d.auto?!0:d.auto;b.controls=d.controls;b.init=e.splitInstructions(m,d.init);b.doExpr=e.splitInstructions(m,d.doExpr);d.whileExpr&&(b.whileExpr=m.parse(d.whileExpr));var h,g=b.doExpr.length;b.animExec=function(){for(h=0;h<g;h++)f.eval(b.doExpr[h]);b.parent.update();b.playing&&
(0<f.eval(b.whileExpr)||b.loop)?b.timer=a.setTimeout(b.animExec,f.eval(b.delay)):(b.stop(),b.pause=!1,b.parent.update())};b.playing=!1;b.auto&&b.play()};f.prototype.play=function(){this.playing?(this.pause=!0,this.stop()):(this.pause||this.reinit(),this.playing=!0,this.pause=!1,this.timer=a.setTimeout(this.animExec,Math.max(10,this.parent.evaluator.eval(this.delay))))};f.prototype.stop=function(){this.playing=!1;a.clearTimeout(this.timer)};f.prototype.reinit=function(){for(var a=0,d=this.init.length;a<
d;a++)this.parent.evaluator.eval(this.init[a])};a.Animation=f;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var f=function(a,d){this.parent=a;this.evaluator=this.parent.evaluator};f.prototype.execute=function(){};a.Action=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){e=a.Action.call(this,e,d)||this;e.parameter=(d||"").replace(/\\n/g,"\n").replace(/&squot;/g,"'");return e};$jscomp.inherits(f,a.Action);f.prototype.execute=function(){alert(this.parameter)};a.Message=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){e=a.Action.call(this,e,d)||this;var f=e.evaluator,m=f.parser;d=a.splitSeparator((d||"").replace(/&squot;/g,"'"));for(var b=[],h,g=0,l=d.length;g<l;g++)(h=m.parse(d[g],!0))&&b.push(h);l=b.length;e.execute=function(){for(g=0;g<l;g++)f.eval(b[g])};return e};$jscomp.inherits(f,a.Action);a.Calculate=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){var f=a.Action.call(this,e,d)||this;f.parser=e.evaluator.parser;f.evaluator=e.evaluator;f.parameter=d;f.target="_blank";return f};$jscomp.inherits(f,a.Action);f.prototype.execute=function(){var e=this.parameter;e.match(/^\[.*\]?/)&&(e=this.evaluator.eval(this.parser.parse(e.substring(1,e.length-1))));var d=e.indexOf("target");-1!=d&&(this.target=e.substring(d),this.target=this.target.substring(this.target.indexOf("=")+1),e=e.substring(0,
d-1));if("javascript"==e.substring(0,10)){e=new a.SimpleText(parent,e.substring(11).replace(/&squot;/g,"'"));try{eval(e.toString())}catch(r){}}else"http"!=e.substring(0,4)&&(d=window.__dirname||window.location.href,e=d.substring(0,d.lastIndexOf("/")+1)+e),window.open(e,this.target)};a.OpenURL=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){var f=a.Action.call(this,e,d)||this;f.parser=e.evaluator.parser;f.evaluator=e.evaluator;f.parameter=d.trim();f.target="_blank";return f};$jscomp.inherits(f,a.Action);f.prototype.execute=function(){var a=this.parameter;a.match(/^\[.*\]?/)&&(a=this.evaluator.eval(this.parser.parse(a.substring(1,a.length-1))));var d=a.indexOf("target");-1!=d&&(this.target=a.substring(d),this.target=this.target.substring(this.target.indexOf("=")+1),a=a.substring(0,
d-1));if("javascript"==a.substring(0,10)){a=a.substring(11).replace(/&squot;/g,"'");try{eval(a.toString())}catch(r){}}else"http"!=a.substring(0,4)&&(d=window.__dirname||window.location.href,a=d.substring(0,d.lastIndexOf("/")+1)+a),window.open(a,this.target,"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")};a.OpenScene=f;return a}(descartesJS||
{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){return a.Action.call(this,e,d)||this};$jscomp.inherits(f,a.Action);f.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%;'><script type='text/javascript' src='http://arquimedes.matem.unam.mx/Descartes5/lib/descartes-min.js'>\x3c/script>"+this.parent.applet.outerHTML.replace(/<applet/g,"<ajs").replace(/<\/applet/g,
"</ajs")+"</xmp>")};a.Config=f;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){return a.Action.call(this,e,d)||this};$jscomp.inherits(f,a.Action);f.prototype.execute=function(){this.parent.init()};a.Init=f;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){return a.Action.call(this,e,d)||this};$jscomp.inherits(f,a.Action);f.prototype.execute=function(){this.parent.clear()};a.Clear=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){return a.Action.call(this,e,d)||this};$jscomp.inherits(f,a.Action);f.prototype.execute=function(){this.parent.play()};a.Animate=f;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){return a.Action.call(this,e,d)||this};$jscomp.inherits(f,a.Action);f.prototype.execute=function(){this.parent.reinitAnimation()};a.InitAnimation=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=/[\w\.\-//]*(\.ogg|\.oga|\.mp3|\.wav)/gi,e=function(d,e){d=a.Action.call(this,d,e)||this;e=e||"";e.match(f)?d.filenameExpr=d.evaluator.parser.parse("'"+e.match(f)+"'"):(e.match(/^\[.*\]?/)&&(e=e.substring(1,e.length-1)),d.filenameExpr=d.evaluator.parser.parse(e));return d};$jscomp.inherits(e,a.Action);e.prototype.execute=function(){var a=this.theAudio=this.parent.getAudio(this.evaluator.eval(this.filenameExpr));a.paused?a.play():(a.pause(),a.currentTime=
0)};a.PlayAudio=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d=function(a,d){this.parent=a;this.evaluator=this.parent.evaluator;this.local=this.expresion=this.id="";this.evaluate="onlyOnce";Object.assign(this,d)};d.prototype.firstRun=function(){};d.prototype.update=function(){};d.prototype.splitInstructions=function(d,m){e=[];m=m?a.splitSeparator(m):[""];for(var b=0,h=m.length;b<h;b++)a.DEBUG.lineCount=b,(f=d.parse(m[b],!0))&&e.push(f);return e};d.prototype.getPrivateVariables=function(a,d){e=[];d=d?d.split(/;|,/):
[""];for(var b=0,h=d.length;b<h;b++)(f=a.parse(d[b],!0))&&e.push(f);b=0;for(h=e.length;b<h;b++)e[b]="asign"===e[b].type?e[b].childs[0].value:"identifier"===e[b].type?e[b].value:"";return e};d.prototype.parseExpressions=function(d){a.DEBUG.paramName="inicio";this.init=this.splitInstructions(d,this.init);a.DEBUG.paramName="local";this.privateVars=this.getPrivateVariables(d,this.local);a.DEBUG.paramName="hacer";this.doExpr=this.splitInstructions(d,this.doExpr);a.DEBUG.paramName="mientras";this.whileExpr=
d.parse(this.whileExpr)};a.Auxiliary=d;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){e=a.Auxiliary.call(this,e,d)||this;d=e.evaluator.parser;e.expresionString=e.expresion;e.expresion=d.parse(e.expresionString);e.expresion&&d.setVariable(e.id,e.expresion);e.editable&&(e.registerTextField(),e.parent.editableRegionVisible=!0);return e};$jscomp.inherits(f,a.Auxiliary);f.prototype.registerTextField=function(){var e=a.newHTML("div"),d=a.newHTML("label");d.appendChild(document.createTextNode("___"+this.id+"=___"));var f=a.newHTML("input");
f.value=this.expresionString;f.disabled=!this.editable;e.appendChild(d);e.appendChild(f);var m=this,b=m.evaluator.parser;f.onkeydown=function(a){13==a.keyCode&&(m.expresion=b.parse(this.value),b.setVariable(m.id,m.expresion),m.parent.update())};this.parent.editableRegion.textFields.push({container:e,type:"div"})};a.Variable=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){e=a.Auxiliary.call(this,e,d)||this;e.expresion=e.evaluator.parser.parse(e.expresion);e.update();return e};$jscomp.inherits(f,a.Auxiliary);f.prototype.update=function(){this.evaluator.setVariable(this.id,this.evaluator.eval(this.expresion))};a.Constant=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m=function(b,d){d=a.Auxiliary.call(this,b,d)||this;f=b.evaluator;e=f.parser;d.size=d.size||e.parse("3");d.expresion=d.expresion.split(";");d.parseFile=e.parse(d.file);d.update();return d};$jscomp.inherits(m,a.Auxiliary);m.prototype.update=function(){var b=this.expresion;f=this.evaluator;e=f.parser;this.oldFile=this.file;if(d=f.eval(this.parseFile))this.file=d;if(this.file){r=(vectorElement=document.getElementById(this.file))&&"descartes/vectorFile"==
vectorElement.type?vectorElement.text:a.openExternalFile(this.file);if(null!=r){r=r.replace(/\r/g,"").split("\n");for(var h=[],g=0,l=r.length;g<l;g++)""!=r[g]&&h.push(r[g]);r=h}null==r||1==r.length&&""==r[0]?(r=[],this.size=e.parse("0")):(b=r,this.size=null);null===this.size&&(this.size=e.parse(b.length+""))}var q;h=[];g=0;for(l=b.length;g<l;g++)(q=e.parse(b[g],!0))&&"asign"!=q.type&&(q=e.parse(this.id+"["+g+"]="+b[g],!0)),h.push(q);b=Array(f.eval(this.size)).fill(0);b._size_=b.length;f.vectors[this.id]=
b;f.setVariable(this.id+".long",b._size_);g=0;for(l=h.length;g<l;g++)f.eval(h[g])};a.Vector=m;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b=function(b,g){g=a.Auxiliary.call(this,b,g)||this;f=b.evaluator;e=f.parser;g.rows=g.rows||e.parse("3");g.columns=g.columns||e.parse("3");g.expresion=g.splitInstructions(e,g.expresion);d=f.eval(g.rows);r=f.eval(g.columns);m=[];m.type="matrix";b=0;for(var l=r;b<l;b++)m[b]=Array(d).fill(0);f.matrices[g.id]=m;g.update();return g};$jscomp.inherits(b,a.Auxiliary);b.prototype.update=function(){f=this.evaluator;d=f.eval(this.rows);r=f.eval(this.columns);
f.setVariable(this.id+".filas",d);f.setVariable(this.id+".columnas",r);m=f.matrices[this.id];m.rows=d;m.cols=r;for(var a=0,b=this.expresion.length;a<b;a++)f.eval(this.expresion[a])};a.Matrix=b;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){var f=a.Auxiliary.call(this,e,d)||this;var m=f.evaluator;e=m.parser;d=f.id.indexOf("(");f.name=f.id.substring(0,d);f.params=f.id.substring(d+1,f.id.indexOf(")"));f.domain=f.range?e.parse(f.range):e.parse("1");f.params=""===f.params?[]:f.params.split(",");f.numberOfParams=f.params.length;f.algorithm||(f.init="",f.doExpr="",f.whileExpr="");f.parseExpressions(e);f.expresion=e.parse(f.expresion);f.functionExec=function(){f.iterations=0;
if(f.numberOfParams<=arguments.length){for(var b=[],d=0,g=f.privateVars.length;d<g;d++)b.push(m.getVariable(f.privateVars[d])),m.setVariable(f.privateVars[d],0);var e=[];d=0;for(g=f.params.length;d<g;d++)e[d]=m.getVariable(f.params[d]),m.setVariable(f.params[d],arguments[d]);d=0;for(g=f.init.length;d<g;d++)m.eval(f.init[d]);do{d=0;for(g=f.doExpr.length;d<g;d++)m.eval(f.doExpr[d]);if(1E5<++f.iterations)return console.warn("se ha excedido el l\u00edmite de 100000 repeticiones en la funci\u00f3n << "+
f.name+" >>"),0}while(0<m.eval(f.whileExpr));var q=m.eval(f.expresion);a.rangeOK=m.eval(f.domain);d=0;for(g=f.params.length;d<g;d++)m.setVariable(f.params[d],e[d]);d=0;for(g=f.privateVars.length;d<g;d++)m.setVariable(f.privateVars[d],b[d]);return q}return 0};m.setFunction(f.name,f.functionExec);return f};$jscomp.inherits(f,a.Auxiliary);a.Function=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){var f=a.Auxiliary.call(this,e,d)||this;var m=f.evaluator;f.parseExpressions(m.parser);f.algorithmExec=function(){for(var a=f.iterations=0,d=f.init.length;a<d;a++)m.eval(f.init[a]);do{a=0;for(d=f.doExpr.length;a<d;a++)m.eval(f.doExpr[a]);if(1E5<++f.iterations)return console.warn("se ha excedido el l\u00edmite de 100000 repeticiones en el algoritmo << "+f.name+" >>"),0}while(0<m.eval(f.whileExpr))};return f};$jscomp.inherits(f,a.Auxiliary);
f.prototype.update=function(){this.algorithmExec();"onlyOnce"===this.evaluate&&(this.update=function(){})};a.Algorithm=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){e=a.Auxiliary.call(this,e,d)||this;d=e.evaluator;delete e.evaluate;e.condition=d.parser.parse(e.condition);e.lastEvaluation=!1;e.action=e.parent.lessonParser.parseAction(e);"onlyOnce"==e.execution&&(e.eventExec=function(){0<this.evaluator.eval(this.condition)&&!this.lastEvaluation&&(this.lastEvaluation=!0,this.action.execute())});"alternate"==e.execution&&(e.eventExec=function(){var a=0<this.evaluator.eval(this.condition);a&&!this.lastEvaluation?
(this.action.execute(),this.lastEvaluation=!0):!a&&this.lastEvaluation&&(this.lastEvaluation=!1)});"always"==e.execution&&(e.eventExec=function(){0<this.evaluator.eval(this.condition)&&this.action.execute()});return e};$jscomp.inherits(f,a.Auxiliary);f.prototype.update=function(){this.eventExec()};a.Event=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(e,d){var f=a.Auxiliary.call(this,e,d)||this;if(d=d.file){var m=document.getElementById(d);m=m&&"descartes/library"===m.type?m.text:a.openExternalFile(d)}if(m){m=a.convertHTMLEntities(m).replace(/\r/g,"").split("\n");d=0;for(var b=m.length;d<b;d++)""!==m[d].trim()&&e.lessonParser.parseAuxiliar(m[d])}return f};$jscomp.inherits(f,a.Auxiliary);a.Library=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h,g,l=function(b,c){this.parent=b;this.evaluator=b.evaluator;var d=this.evaluator.parser;this.spaceID="";this.background=!1;this.type="";this.drawif=d.parse("1");this.abs_coord=c.type&&"text"===c.type?!0:!1;this.color=new a.Color("blue");2!==this.parent.version&&(this.color=new a.Color("20303a"),this.parent.arquimedes&&(this.color=new a.Color("black")));this.trace="";this.expresion=d.parse("(0,0)");this.family="";this.family_interval=d.parse("[0,1]");
this.family_steps=d.parse("8");this.editable=this.visible=!1;this.font="SansSerif,PLAIN,"+(5<=this.parent.version?"18":"12");this.fixed=!0;this.text="";this.decimals=d.parse("2");Object.assign(this,c);this.space=this.getSpace();this.canvas=this.background?this.space.backCanvas:this.space.canvas;this.ctx=this.canvas.getContext("2d");this.trace&&(this.traceCtx=this.space.backCtx);this.font_str=this.font;this.font=a.convertFont(this.font);this.fontSize=(this.fontSize=this.font.match(/([\d\.]+)px/))?
parseFloat(this.fontSize[1]):10;this.font_style=a.getFontStyle(this.font_str.split(",")[1]);if("boolean"===typeof this.bold||"boolean"===typeof this.italics)this.bold&&!this.italics?this.font_style="Bold ":!this.bold&&this.italics?this.font_style="Italic ":this.bold&&this.italics?this.font_style="Italic Bold ":this.bold||this.italics||(this.font_style=" ");this.font_family||(this.font_family=this.font_str.split(",")[0]);this.font_family=a.getFontName(this.font_family);"undefined"===typeof this.font_size&&
(this.font_size=b.evaluator.parser.parse(this.fontSize.toString()))};l.prototype.getSpace=function(){var a=this;return this.parent.spaces.find(function(c){return c.id===a.spaceID})||this.parent.spaces[0]};l.prototype.getFamilyValues=function(){f=this.evaluator;e=f.eval(this.family_interval);this.familyInf=e[0][0];this.familySup=e[0][1];this.fSteps=Math.round(f.eval(this.family_steps));this.family_sep=0<this.fSteps?(this.familySup-this.familyInf)/this.fSteps:0};l.prototype.drawFamilyAux=function(a,
c,b){f=this.evaluator;this.getFamilyValues();d=f.getVariable(this.family);if(0<=this.fSteps)for(var k=0,g=this.fSteps;k<=g;k++)f.setVariable(this.family,this.familyInf+k*this.family_sep),0<f.eval(this.drawif)&&(this.update(),a.oldTextNode=null,this.drawAux(a,c,b));f.setVariable("_Text_H_",0);f.setVariable(this.family,d)};l.prototype.draw=function(a,c){""!==this.family?this.drawFamilyAux(this.ctx,a,c):0<this.evaluator.eval(this.drawif)&&(this.update(),this.drawAux(this.ctx,a,c))};l.prototype.drawTrace=
function(a,c){""!=this.family?this.drawFamilyAux(this.traceCtx,a,c):0<this.evaluator.eval(this.drawif)&&(this.update(),this.drawAux(this.traceCtx,a,c))};l.prototype.rotate=function(a,c,b){h=Math.cos(b);g=Math.sin(b);return{x:a*h-c*g,y:a*g+c*h}};l.prototype.dashStyle=function(){b=this.ctx;"dot"===this.lineDash?(b.lineCap="butt",b.setLineDash([b.lineWidth,b.lineWidth])):"dash"===this.lineDash?(b.lineCap="butt",b.setLineDash([4*b.lineWidth,3*b.lineWidth])):"dash_dot"===this.lineDash?(b.lineCap="butt",
b.setLineDash([4*b.lineWidth,2*b.lineWidth,b.lineWidth,2*b.lineWidth])):b.setLineDash([])};l.prototype.drawText=function(a,c,b,d,g,e,l,n,h,x,y){a.textNode=c;if("rtfNode"===c.type)a.fillStyle=a.strokeStyle=g.getColor(),a.textBaseline="alphabetic",a.textNode.pos={x:b,y:d},c.update(a,b,d,h,x,l,y,g.getColor());else for("simpleText"===c.type&&(c=c.toString(h,x).split("\\n")),f=this.evaluator,a.fillStyle=g.getColor(),a.font=e,a.textAlign=l,a.textBaseline=n,m=1.2*this.fontSize||0,g=0,e=c.length;g<e;g++)r=
c[g],this.border&&(a.strokeStyle=this.border.getColor(),a.lineWidth=4,a.lineJoin="round",a.miterLimit=2,a.strokeText(r,b,d+m*g)),a.fillText(r,b,d+m*g)};a.Graphic=l;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h,g=function(a,g){this.text=g=g.replace("&#x2013","\u2013").replace(/&squot;/g,"'");this.textElements=[];this.textElementsMacros=[];this.parent=a;this.evaluator=a.evaluator;this.type="simpleText";f="'";r=d=0;for(m=-1;d<g.length;)b=g.charAt(d),h=g.charAt(d-1),"["===b&&"\\"===h?(this.textElements.push(g.substring(r,d-1)+"["),this.textElementsMacros.push("'"+g.substring(r,d-1)+"['"),r=d+1):"]"===b&&"\\"===h?(this.textElements.push(g.substring(r,
d-1)+"]"),this.textElementsMacros.push("'"+g.substring(r,d-1)+"]'"),r=d+1):"["===b&&-1===m?(this.textElements.push(g.substring(r,d)),this.textElementsMacros.push("'"+g.substring(r,d)+"'"),r=d,m++):"["===b?m++:"]"===b&&0===m?(this.textElements.push(this.evaluator.parser.parse(g.substring(r,d+1))),this.textElementsMacros.push("["+g.substring(r,d+1)+"]"),r=d+1,m--):("]"==g.charAt(d)&&(m=0>m?m:m-1),f+=g.charAt(d)),d++;this.textElements.push(g.substring(r,d));this.textElementsMacros.push("'"+g.substring(r,
d)+"'")};g.prototype.toString=function(b,d){f="";for(var c=0,g=this.textElements.length;c<g;c++)"string"===typeof this.textElements[c]?f+=this.textElements[c]:(e=this.evaluator.eval(this.textElements[c])[0][0],""!==e&&("string"===typeof e?f+=e:Infinity==e?f+="Infinity":-Infinity==e?f+="-Infinity":isNaN(e)||"NaN"==e?f+="NaN":(e=parseFloat(e),e=d?e.toFixed(b):a.removeNeedlessDecimals(e.toFixed(b)),f+=e.toString().replace(".",this.parent.decimal_symbol))));return f};a.SimpleText=g;return a}(descartesJS||
{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h,g,l,q,c,u,k,w,p,v,n,z,x,y,B,E,J,G,H,A,I,C,M,N,O,F,D,K,L=function(c,b){b=a.Graphic.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("1");b.fillP=b.fillP||"";b.fillM=b.fillM||"";b.parseExpression();b.visible=2===b.parent.version&&void 0==b.visible?!0:b.visible;b.visible&&b.registerTextField();u=new a.R2;k=new a.R2;w=new a.R2;n=new a.R2;p=new a.R2;b.cInd=0;return b};$jscomp.inherits(L,a.Graphic);L.prototype.parseExpression=function(){if("compOperator"===
this.expresion.type){var c=this.expresion.childs[0],b=this.expresion.childs[1];"identifier"!=c.type||"y"!=c.value||b.contains("y")?"identifier"!=b.type||"y"!=b.value||c.contains("y")?"identifier"!=c.type||"x"!=c.value||b.contains("x")?"identifier"!=b.type||"x"!=b.value||c.contains("x")||(this.funExpr=b,this.of_y=!0,this.drawAux=this.drawAuxFun):(this.funExpr=b,this.of_y=!0,this.drawAux=this.drawAuxFun):(this.funExpr=c,this.of_y=!1,this.drawAux=this.drawAuxFun):(this.funExpr=b,this.of_y=!1,this.drawAux=
this.drawAuxFun)}this.newt=new a.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,c,b){e=this.evaluator;this.getFamilyValues();tempParam=e.getVariable(this.family);if(0<=this.fSteps)for(var d=0,n=this.fSteps;d<=n;d++)e.setVariable(this.family,this.familyInf+d*this.family_sep),this.update(),
this.drawAux(a,c,b);e.setVariable(this.family,tempParam)};L.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.fill,this.trace)};L.prototype.drawAux=function(P,R,Q){if(!(0>=this.evaluator.eval(this.drawif))){this.cInd=0;e=this.evaluator;d=e.parser;r=this.space;m=e.eval(this.width);P.strokeStyle=this.color.getColor();P.lineWidth=m;b=d.getVariable("x");h=d.getVariable("y");g=r.w+24;l=r.h+24;q=g/9;3>q&&(q=3);c=l/7;3>c&&(c=3);0==this.cInd?(f=[],this.cInd++):this.cInd=(this.cInd+
1)%1E7;u.set(0,0);k.set(0,0);w.set(0,0);D=.25;K=8;this.abs_coord||(D/=r.scale,K/=r.scale);P.beginPath();for(I=parseInt(c/2);I<l;I+=c)for(A=parseInt(q/2);A<g;A+=q){if(this.abs_coord){n.set(A,I);v=this.newt.findZero(n,D);if(null==v)continue;e.setVariable("x",v.x);e.setVariable("y",v.y);p.set(v.x,v.y)}else{n.set(r.getRelativeX(A),r.getRelativeY(I));v=this.newt.findZero(n,D);if(null==v)continue;e.setVariable("x",v.x);e.setVariable("y",v.y);p.set(r.getAbsoluteX(v.x),r.getAbsoluteY(v.y))}z=p.ix();x=p.iy();
if(-12<=z&&z<g+24&&-12<=x&&x<l+24){if(f[z+12+(x+12)*r.w]===this.cInd)continue;f[z+12+(x+12)*r.w]=this.cInd}a.rangeOK&&(P.moveTo(z,x),P.lineTo(z,x));u.x=v.x;u.y=v.y;k.x=v.x;k.y=v.y;y=this.newt.getUnitNormal();if(0!=y.x||0!=y.y)for(y.rotL90(),w.x=y.x,w.y=y.y,E=B=0,J=!1;2>E;)if(J&&(w.x=-y.x,w.y=-y.y,v.x=u.x,v.y=u.y,k.x=v.x,k.y=v.y,this.abs_coord?p.set(v.x,v.y):p.set(r.getAbsoluteX(v.x),r.getAbsoluteY(v.y)),z=p.ix(),x=p.iy(),J=!1,B=0),v.x+=K*w.x,v.y+=K*w.y,v=this.newt.findZero(v,D),null!=v){e.setVariable("x",
v.x);e.setVariable("y",v.y);w.x=v.x-k.x;w.y=v.y-k.y;w.normalize();if(0==w.x&&0==w.y)break;k.x=v.x;k.y=v.y;this.abs_coord?p.set(v.x,v.y):p.set(r.getAbsoluteX(v.x),r.getAbsoluteY(v.y));G=parseInt(p.ix());H=parseInt(p.iy());if(G!=z||H!=x)if(C=z,M=x,z=G,x=H,-12<=z&&z<g+24&&-12<=x&&x<l+24){B=0;N=f[z+12+(x+12)*r.w];f[z+12+(x+12)*r.w]=this.cInd;for(R=1;8>R;R++)O=C+Math.round((z-C)*R/8),F=M+Math.round((x-M)*R/8),0<=O&&O<g&&0<=F&&F<l&&(f[O+12+(F+12)*r.w]=this.cInd);a.rangeOK&&(P.moveTo(C,M),P.lineTo(z,x));
if(N===this.cInd)break}else J=!0,E++;else 4<++B&&(J=!0,E++)}}P.stroke()}};L.prototype.X=function(a,c,b){b||(c=this.space.w/2+this.space.Ox+this.space.scale*c);c<-a&&(c=-a);c>this.space.w+a&&(c=this.space.w+a);return c};L.prototype.Y=function(a,c,b){b||(c=this.space.h/2+this.space.Oy-this.space.scale*c);c<-a&&(c=-a);c>this.space.h+a&&(c=this.space.h+a);return c};L.prototype.XX=function(a,c,b){return Math.round(this.X(a,c,b))};L.prototype.YY=function(a,c,b){return Math.round(this.Y(a,c,b))};L.prototype.extrapolate=
function(c,b,d,n,k,g){for(var e=this.evaluator.getVariable(b),l=g/2,f=0,h,u,p,q,m,w;1E-15<Math.abs(l);){h=this.evaluator.getVariable(b);u=this.evaluator.getVariable(b)+l;this.evaluator.setVariable(b,u);p=!0;try{q=k,k=this.evaluator.eval(this.funExpr),this.evaluator.setVariable(d,k),0<this.evaluator.eval(c)?(m=new a.R2(Math.min(q,k),Math.max(q,k)),w=0,w=0<g?this.Singularity(Math.abs(l),b,n,h,q,u,k,m):this.Singularity(Math.abs(l),b,n,u,k,h,q,m),0<w&&(p=!1)):p=!1}catch(Z){p=!1}p?f+=l:this.evaluator.setVariable(b,
h);l/=2}this.evaluator.setVariable(b,e);return new a.R2(f/Math.abs(g),k)};L.prototype.extrapolateOnSingularity=function(c,b,d,n,k,g){n=this.evaluator.getVariable(b);for(var e=g/2,l=0,f=k,h;1E-15<Math.abs(e);){this.evaluator.setVariable(b,this.evaluator.getVariable(b)+e);h=!0;if(0<this.evaluator.eval(c))try{f=this.evaluator.eval(this.funExpr),this.evaluator.setVariable(d,f),0>=this.evaluator.eval(c)&&(h=!1)}catch(X){h=!1}else h=!1;h?l+=e:this.evaluator.setVariable(b,this.evaluator.getVariable(b)-e);
e/=2}if(0==l)for(e=g/2,l=g,f=k;1E-15<Math.abs(e);){this.evaluator.setVariable(b,this.evaluator.getVariable(b)-e);h=!0;if(0<this.evaluator.eval(c))try{f=this.evaluator.eval(this.funExpr)}catch(X){h=!1}else h=!1;h?l+=-e:this.evaluator.setVariable(b,this.evaluator.getVariable(b)+e);e/=2}this.evaluator.setVariable(b,n);return new a.R2(l/Math.abs(g),f)};L.prototype.Singularity=function(a,c,b,d,n,k,g,e){if(isNaN(g)||isNaN(n)||isNaN(e.y)||isNaN(e.x)||d>=k)return 2;var l=this.evaluator.getVariable(c),f=0;
try{if(1E-15>Math.abs(k-d)||1E-12>Math.abs(k-d)&&Math.abs(g-n)>Math.abs(a))return this.evaluator.setVariable(c,l),1;var h=(d+k)/2;this.evaluator.setVariable(c,h);var u=NaN;try{u=this.evaluator.eval(this.funExpr)}catch(Y){return 2}if(isNaN(u))return 5;if(Math.abs(g-n)>a){this.evaluator.setVariable(c,d-1E-12);var p=this.evaluator.eval(this.funExpr);p=(n-p)/1E-12;this.evaluator.setVariable(c,k+1E-12);var q=(this.evaluator.eval(this.funExpr)-g)/1E-12;if((10>Math.abs(q)||10>Math.abs(p))&&(0<=q&&0<=p||
0>=q&&0>=p)&&4*Math.abs(q)<Math.abs((g-n)/(k-d)))return this.evaluator.setVariable(c,l),2}if(isNaN(e.x)||isNaN(e.y)||isNaN(u))return 2;if(!(e.x<=u&&u<=e.y)){this.evaluator.setVariable(c,h);e.x=Math.min(n,u);e.y=Math.max(n,u);var m=this.Singularity(a/2,c,b,d,n,h,u,e);this.evaluator.setVariable(c,k);e.x=Math.min(g,u);e.y=Math.max(g,u);var w=this.Singularity(a/2,c,b,h,u,k,g,e);f=Math.max(m,w)}}catch(Y){f=1}this.evaluator.setVariable(c,l);return f};L.prototype.drawAuxFun=function(c,d,n){b=this.evaluator.parser.getVariable("x");
h=this.evaluator.parser.getVariable("y");a.rangeOK=1;d="x";var k="y";this.of_y&&(d="y",k="x");var g=this.drawif,e=this.evaluator.eval(this.width),l=!1,f=new a.R2(this.space.w/2+this.space.Ox,this.space.h/2+this.space.Oy),u=this.of_y?f.ix():f.iy(),p=0,q=0,m=0,w=0,v=1/this.space.scale;f=v*(this.of_y?-this.space.h+f.y:-f.x);var y=0;this.abs_coord&&(f=0,v=1);for(var x,r,z,E,B,A,G,Q,M,I=this.of_y?this.space.h+2:this.space.w+2;m<=I;){x=!0;r=0;this.evaluator.setVariable(d,f);try{z=this.evaluator.eval(this.funExpr),
isNaN(z)||(this.evaluator.setVariable(k,z),0<this.evaluator.eval(this.drawif)&&a.rangeOK?(l?(E=Math.min(y,z),B=Math.max(y,z),A=new a.R2(E,B),r=this.Singularity(v,d,0,f-v,y,f,z,A),0===r?(y<=z?(y=A.x,z=A.y):(z=A.x,y=A.y),G=parseInt(this.of_y?this.XX(e,y,this.abs_coord):this.YY(e,y,this.abs_coord)),p=this.abs_coord?Math.round(z):parseInt(this.of_y?this.XX(e,z,this.abs_coord):this.YY(e,z,this.abs_coord)),this.fillM&&p>u&&(c.lineWidth=1,c.strokeStyle=this.fillM.getColor(),c.beginPath(),this.of_y?(c.moveTo(u+
1,this.space.h-m+.5),c.lineTo(p,this.space.h-m+.5)):(c.moveTo(m+.5,u+1),c.lineTo(m+.5,p)),c.stroke()),this.fillP&&p<u&&(c.lineWidth=1,c.strokeStyle=this.fillP.getColor(),c.beginPath(),this.of_y?(c.moveTo(u-1,this.space.h-m+.5),c.lineTo(p,this.space.h-m+.5)):(c.moveTo(m+.5,u-1),c.lineTo(m+.5,p)),c.stroke()),c.lineWidth=e,c.strokeStyle=n.getColor(),c.beginPath(),this.of_y?(c.moveTo(G+.5,this.space.h-w),c.lineTo(p+.5,this.space.h-m)):(c.moveTo(w+.5,G),c.lineTo(m+.5,p)),c.stroke()):1===r?(this.evaluator.setVariable(d,
f-v),Q=this.extrapolate(g,d,k,0,y,v),p=this.of_y?this.XX(e,Q.y,this.abs_coord):this.YY(e,Q.y,this.abs_coord),c.lineWidth=e,c.strokeStyle=n.getColor(),c.beginPath(),this.of_y?(c.moveTo(q+.5,this.space.h-w),c.lineTo(p+.5,this.space.h-w+Math.round(Q.x))):(c.moveTo(w+.5,q),c.lineTo(w+Math.round(Q.x)+.5,p)),this.evaluator.setVariable(d,f),M=this.extrapolate(g,d,k,0,z,-v),q=this.of_y?this.XX(e,M.y,this.abs_coord):this.YY(e,M.y,this.abs_coord),p=this.of_y?this.XX(e,z,this.abs_coord):this.YY(e,z,this.abs_coord),
c.lineWidth=e,c.strokeStyle=n.getColor(),c.beginPath(),this.of_y?(c.moveTo(q+.5,this.space.h-m),c.lineTo(p+.5,this.space.h-m)):(c.moveTo(m+.5,q),c.lineTo(m+.5,p)),c.stroke()):2===r&&(p=this.of_y?this.XX(e,z,this.abs_coord):this.YY(e,z,this.abs_coord),c.lineWidth=e,c.strokeStyle=n.getColor(),c.beginPath(),this.of_y?(c.moveTo(q+.5,this.space.h-m),c.lineTo(p+.5,this.space.h-m)):(c.moveTo(m+.5,q),c.lineTo(m+.5,p)))):(M=this.extrapolateOnSingularity(g,d,k,0,z,-v),q=this.of_y?this.XX(e,M.y,this.abs_coord):
this.YY(e,M.y,this.abs_coord),p=this.of_y?this.XX(e,z,this.abs_coord):this.YY(e,z,this.abs_coord),c.lineWidth=e,c.strokeStyle=n.getColor(),c.beginPath(),this.of_y?(c.moveTo(q,this.space.h-(m+Math.round(M.x))+.5),c.lineTo(p,this.space.h-m+.5)):(c.moveTo(m+Math.round(M.x),q),c.lineTo(m,p)),c.stroke()),y=z):x=!1)}catch(aa){x=!1}l&&!x&&(this.evaluator.setVariable(d,f-v),this.evaluator.setVariable(k,y),Q=this.extrapolate(g,d,k,0,y,v),p=parseInt(this.of_y?this.XX(e,Q.y,this.abs_coord):this.YY(e,Q.y,this.abs_coord)),
0<this.evaluator.eval(this.drawif)&&a.rangeOK&&(c.lineWidth=e,c.strokeStyle=n.getColor(),c.beginPath(),this.of_y?(c.moveTo(q,this.space.h-(w+Math.round(Q.x))+.5),c.lineTo(p,this.space.h-(w+Math.round(Q.x))+.5)):(c.moveTo(w+Math.round(Q.x)+.5,q),c.lineTo(w+Math.round(Q.x)+.5,p)),c.stroke()),this.evaluator.setVariable(d,f));l=x;f+=v;q=p;w=m++}this.evaluator.parser.setVariable("x",b);this.evaluator.parser.setVariable("y",h)};L.prototype.registerTextField=function(){var c=a.newHTML("input");c.value=this.expresionString;
c.disabled=!this.editable;var b=this;oncontextmenu=function(a){return!1};c.onkeydown=function(a){13==a.keyCode&&(b.expresion=b.evaluator.parser.parse(this.value),b.parseExpression(),b.parent.update())};this.parent.editableRegion.textFields.push(c)};a.Equation=L;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.round,e,d,r,m,b,h,g,l,q=function(c,b){b=a.Graphic.call(this,c,b)||this;b.parameter=b.parameter||"t";b.parameter_interval=b.parameter_interval||c.evaluator.parser.parse("[0,1]");b.parameter_steps=b.parameter_steps||c.evaluator.parser.parse("8");b.width=b.width||c.evaluator.parser.parse("1");b.fill=b.fill||"";b.visible=2===b.parent.version&&void 0==b.visible?!0:b.visible;b.visible&&b.registerTextField();return b};$jscomp.inherits(q,a.Graphic);
q.prototype.update=function(){e=this.evaluator;d=e.eval(this.parameter_interval);this.paraInf=d[0][0];this.paraSup=d[0][1];this.pSteps=e.eval(this.parameter_steps);this.paraSep=0<this.pSteps?Math.abs(this.paraSup-this.paraInf)/this.pSteps:0};q.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.fill,this.color)};q.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.fill,this.trace)};q.prototype.drawAux=function(c,d,k){e=this.evaluator;r=this.space;m=f(e.eval(this.width));
c.lineWidth=0<m?m:1E-6;c.lineCap=c.lineJoin="round";c.strokeStyle=k.getColor();b=e.getVariable(this.parameter);c.beginPath();e.setVariable(this.parameter,this.paraInf);h=e.eval(this.expresion);this.exprX=f(this.abs_coord?h[0][0]:r.getAbsoluteX(h[0][0]));this.exprY=f(this.abs_coord?h[0][1]:r.getAbsoluteY(h[0][1]));this.rotateExp&&(g=a.degToRad(e.eval(this.rotateExp)),l=this.rotate(h[0][0],h[0][1],g),this.exprX=f(this.abs_coord?l.x:r.getAbsoluteX(l.x)),this.exprY=f(this.abs_coord?l.y:r.getAbsoluteY(l.y)));
c.moveTo(this.exprX+.5,this.exprY+.5);for(k=1;k<=this.pSteps;k++)e.setVariable(this.parameter,this.paraInf+k*this.paraSep),h=e.eval(this.expresion),this.rotateExp&&(l=this.rotate(h[0][0],h[0][1],g),h[0][0]=l.x,h[0][1]=l.y),this.exprX=f(this.abs_coord?h[0][0]:r.getAbsoluteX(h[0][0])),this.exprY=f(this.abs_coord?h[0][1]:r.getAbsoluteY(h[0][1])),!isNaN(this.exprX)&&!isNaN(this.exprY)&&-1E6<this.exprX&&1E6>this.exprX&&-1E6<this.exprY&&1E6>this.exprY&&c.lineTo(this.exprX+.5,this.exprY+.5);this.fill&&(c.fillStyle=
d.getColor(),c.fill("evenodd"));this.dashStyle();c.stroke();c.setLineDash([]);e.setVariable(this.parameter,b)};q.prototype.registerTextField=function(){var c=a.newHTML("input");c.value=this.expresionString;c.disabled=!this.editable;var b=this;c.oncontextmenu=function(){return!1};c.onkeydown=function(a){13==a.keyCode&&(b.expresion=b.evaluator.parser.parse(this.value),b.parent.update())};this.parent.editableRegion.textFields.push(c)};a.Curve=q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=2*Math.PI,e=Math.round,d,r,m,b,h,g,l,q,c,u,k=function(c,b){b=a.Graphic.call(this,c,b)||this;b.size=b.size||c.evaluator.parser.parse("2");b.range=b.range||c.evaluator.parser.parse("[1, 100]");b.visible=2===b.parent.version&&void 0==b.visible?!0:b.visible;b.visible&&b.registerTextField();return b};$jscomp.inherits(k,a.Graphic);k.prototype.update=function(){d=this.evaluator;m=d.eval(this.expresion);this.exprX=m[0][0];this.exprY=m[0][1];this.rotateExp&&
(b=this.rotate(m[0][0],m[0][1],a.degToRad(d.eval(this.rotateExp))),this.exprX=b.x,this.exprY=b.y);l=d.eval(this.range);this.rangeInf=l[0][0];this.rangeMax=l[0][1]};k.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.color,this.color)};k.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};k.prototype.drawAux=function(b,k){d=this.evaluator;r=this.space;c=q=Math.ceil(d.eval(this.size)-.4);b.fillStyle=k.getColor();b.beginPath();this.rangeInf>
this.rangeMax&&(u=this.rangeInf,this.rangeInf=this.rangeMax,this.rangeMax=u);k=d.getVariable("n");for(var l=this.rangeInf,n=this.rangeMax;l<=n;l++)d.setVariable("n",l),m=d.eval(this.expresion),this.exprX=m[0][0],this.exprY=m[0][1],h=e(this.abs_coord?this.exprX:r.getAbsoluteX(this.exprX)),g=e(this.abs_coord?this.exprY:r.getAbsoluteY(this.exprY)),b.beginPath(),b.arc(h,g,q,0,f,!0),b.fill();b.fill();this.text!=[""]&&(this.fontSize=Math.max(5,d.eval(this.font_size)),this.font=this.font_style+" "+this.fontSize+
"px "+this.font_family,a.Graphic.prototype.drawText.call(this,b,this.text,h+c,g-c,this.color,this.font,"start","alphabetic",d.eval(this.decimals),this.fixed,!0));d.setVariable("n",k)};k.prototype.registerTextField=function(){var c=a.newHTML("input");c.value=this.expresionString;c.disabled=!this.editable;var b=this;oncontextmenu=function(a){return!1};c.onkeydown=function(a){13==a.keyCode&&(b.expresion=b.evaluator.parser.parse(this.value),b.parent.update())};this.parent.editableRegion.textFields.push(c)};
a.Sequence=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=2*Math.PI,e=Math.round,d,r,m,b,h,g,l=function(b,c){c=a.Graphic.call(this,b,c)||this;c.size=c.size||b.evaluator.parser.parse("2");c.text=new a.TextObject(c,c.text);return c};$jscomp.inherits(l,a.Graphic);l.prototype.update=function(){d=this.evaluator;m=d.eval(this.expresion);this.exprX=m[0][0];this.exprY=m[0][1];this.rotateExp&&(b=this.rotate(m[0][0],m[0][1],a.degToRad(d.eval(this.rotateExp))),this.exprX=b.x,this.exprY=b.y)};l.prototype.draw=function(){a.Graphic.prototype.draw.call(this,
this.color,this.color)};l.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};l.prototype.drawAux=function(a,c){r=this.space;a.fillStyle=c.getColor();h=e(this.abs_coord?this.exprX:r.getAbsoluteX(this.exprX));g=e(this.abs_coord?this.exprY:r.getAbsoluteY(this.exprY));a.beginPath();a.arc(h,g,e(this.evaluator.eval(this.size)),0,f,!0);a.fill();this.text.hasContent&&this.text.draw(a,c,h,g)};a.Point=l;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.round,e=2*Math.PI,d,r,m,b,h,g,l,q,c,u,k,w,p,v=function(c,b){b=a.Graphic.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("1");b.size=b.size||c.evaluator.parser.parse("2");b.text=new a.TextObject(b,b.text);return b};$jscomp.inherits(v,a.Graphic);v.prototype.update=function(){d=this.evaluator;m=d.eval(this.expresion);this.endPoints=[];for(var c=0,k=m.length;c<k;c++)this.endPoints[c]={x:m[c][0],y:m[c][1]};if(this.rotateExp)for(b=
a.degToRad(d.eval(this.rotateExp)),c=0,k=this.endPoints.length;c<k;c++)this.endPoints[c]=this.rotate(this.endPoints[c].x,this.endPoints[c].y,b)};v.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.color,this.color)};v.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};v.prototype.drawAux=function(a,b,m){d=this.evaluator;r=this.space;h=f(d.eval(this.width));a.lineWidth=0<h?h:1E-6;q=d.eval(this.size);0>q&&(q=0);a.fillStyle=b.getColor();a.strokeStyle=
m.getColor();a.lineCap="round";c=0==a.lineWidth%2?0:.5;this.abs_coord?(u=f(this.endPoints[0].x),k=f(this.endPoints[0].y),w=f(this.endPoints[1].x),p=f(this.endPoints[1].y)):(u=f(r.getAbsoluteX(this.endPoints[0].x)),k=f(r.getAbsoluteY(this.endPoints[0].y)),w=f(r.getAbsoluteX(this.endPoints[1].x)),p=f(r.getAbsoluteY(this.endPoints[1].y)));a.beginPath();a.moveTo(u+c,k+c);a.lineTo(w+c,p+c);this.dashStyle();a.stroke();0<q&&(a.beginPath(),a.arc(u,k,q,0,e,!0),a.arc(w,p,q,0,e,!0),a.fill());a.setLineDash([]);
this.text.hasContent&&(g=parseInt((u+w)/2)-3,l=parseInt((k+p)/2)+3,this.text.draw(a,m,g,l))};a.Segment=v;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.floor,e=Math.round,d,r,m,b,h,g,l,q,c,u,k,w,p,v,n,z=function(c,b){b=a.Graphic.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("5");b.size=b.size||c.evaluator.parser.parse("2");b.spear=b.spear||c.evaluator.parser.parse("8");b.arrow=b.arrow||new a.Color("ee0022");b.text=new a.TextObject(b,b.text);return b};$jscomp.inherits(z,a.Graphic);z.prototype.update=function(){d=this.evaluator;r=d.eval(this.expresion);this.endPoints=[];for(var c=
0,b=r.length;c<b;c++)this.endPoints[c]={x:r[c][0],y:r[c][1]};if(this.rotateExp)for(m=a.degToRad(d.eval(this.rotateExp)),c=0,b=this.endPoints.length;c<b;c++)this.endPoints[c]=this.rotate(this.endPoints[c].x,this.endPoints[c].y,m)};z.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.arrow,this.color)};z.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.arrow,this.trace)};z.prototype.drawAux=function(m,y,r){d=this.evaluator;b=this.space;l=d.eval(this.width);
0>l&&(l=0);q=Math.ceil(l/2);c=b.scale;this.vect=new a.Vector2D(this.endPoints[1].x-this.endPoints[0].x,this.endPoints[1].y-this.endPoints[0].y);u=this.vect.vectorLength();this.angle=this.vect.angleBetweenVectors(a.Vector2D.AXIS_X);m.fillStyle=y.getColor();m.strokeStyle=r.getColor();m.lineWidth=2;this.abs_coord?(k=e(this.endPoints[0].x),w=e(this.endPoints[0].y),p=e(this.endPoints[1].x),v=e(this.endPoints[1].y)):(k=e(b.getAbsoluteX(this.endPoints[0].x)),w=e(b.getAbsoluteY(this.endPoints[0].y)),p=e(b.getAbsoluteX(this.endPoints[1].x)),
v=e(b.getAbsoluteY(this.endPoints[1].y)));n=d.eval(this.spear);0>n&&(n=0);m.save();m.translate(k,w,u);this.abs_coord?m.rotate(this.angle*(0<=this.vect.y?1:-1)):(u*=c,m.rotate(this.angle*(0<=this.vect.y?-1:1)));m.beginPath();m.moveTo(-q,f(-q));m.lineTo(f(u-n-l),f(-q));m.lineTo(f(u-2*n),f(-n-q));m.lineTo(f(u),0);m.lineTo(f(u-2*n),f(n+q));m.lineTo(f(u-n-l),f(q));m.lineTo(-q,f(q));m.closePath();m.stroke();m.fill();m.restore();this.text.hasContent&&(h=parseInt((k+p)/2)-3,g=parseInt((w+v)/2)+3,this.text.draw(m,
r,h,g))};a.Arrow=z;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.round,e,d,r,m,b,h,g,l,q=function(c,b){b=a.Graphic.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("1");b.fill=b.fill||"";b.endPoints=[];return b};$jscomp.inherits(q,a.Graphic);q.prototype.update=function(){e=this.evaluator;r=e.eval(this.expresion);for(var c=0,b=r.length;c<b;c++)this.endPoints[c]={x:r[c][0],y:r[c][1]};if(this.rotateExp)for(m=a.degToRad(e.eval(this.rotateExp)),c=0,b=this.endPoints.length;c<b;c++)this.endPoints[c]=
this.rotate(this.endPoints[c].x,this.endPoints[c].y,m)};q.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.fill,this.color)};q.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};q.prototype.drawAux=function(a,u,k){e=this.evaluator;d=this.space;b=f(e.eval(this.width));a.lineWidth=0<b?b:1E-6;a.strokeStyle=k.getColor();a.lineCap=a.lineJoin="round";h=0<b?.5:0;g=f(this.abs_coord?this.endPoints[0].x:d.getAbsoluteX(this.endPoints[0].x));l=f(this.abs_coord?
this.endPoints[0].y:d.getAbsoluteY(this.endPoints[0].y));a.beginPath();a.moveTo(g+h,l+h);k=1;for(var c=this.endPoints.length;k<c;k++)g=f(this.abs_coord?this.endPoints[k].x:d.getAbsoluteX(this.endPoints[k].x)),l=f(this.abs_coord?this.endPoints[k].y:d.getAbsoluteY(this.endPoints[k].y)),a.lineTo(g+h,l+h);this.fill&&(a.fillStyle=u.getColor(),a.fill());this.dashStyle();a.stroke();a.setLineDash([])};a.Polygon=q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.round,e=Math.min,d=Math.max,r=Math.abs,m,b,h,g,l,q,c,u,k,w,p,v,n=function(c,b){b=a.Graphic.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("1");b.fill=b.fill||"";b.border_radius=b.border_radius||c.evaluator.parser.parse("0");b.endPoints=[];return b};$jscomp.inherits(n,a.Graphic);n.prototype.update=function(){m=this.evaluator;q=m.eval(this.expresion);this.exprX=q[0][0];this.exprY=q[0][1];this.w=150;this.h=100;this.rotateExp&&(h=
this.rotate(q[0][0],q[0][1],a.degToRad(m.eval(this.rotateExp))),this.exprX=h.x,this.exprY=h.y);4<=q[0].length&&(this.w=q[0][2],this.h=q[0][3]);q[1]&&2==q[1].length&&(this.w=q[1][0],this.h=q[1][1]);this.w=d(0,this.w);this.h=d(0,this.h)};n.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.fill,this.color)};n.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.fill,this.trace,"trace")};n.prototype.drawAux=function(a,n,h,q){m=this.evaluator;b=this.space;g=f(m.eval(this.width));
a.lineWidth=0<g?g:1E-6;a.strokeStyle=h.getColor();a.lineCap="round";a.lineJoin="miter";l=0<g?.5:0;c=f(this.abs_coord?this.exprX:b.getAbsoluteX(this.exprX))+l;u=f(this.abs_coord?this.exprY:b.getAbsoluteY(this.exprY))+l;k=this.abs_coord?this.w:this.w*b.scale;w=this.abs_coord?this.h:-this.h*b.scale;p=e(d(0,m.eval(this.border_radius)),.5*r(k),.5*r(w));v=this.abs_coord?1:-1;a.beginPath();0!==p?(a.moveTo(c+p,u),a.lineTo(c+k-p,u),a.quadraticCurveTo(c+k,u,c+k,u+v*p),a.lineTo(c+k,u+w-v*p),a.quadraticCurveTo(c+
k,u+w,c+k-p,u+w),a.lineTo(c+p,u+w),a.quadraticCurveTo(c,u+w,c,u+w-v*p),a.lineTo(c,u+v*p),a.quadraticCurveTo(c,u,c+p,u),a.lineTo(c+p,u)):(a.moveTo(c,u),a.lineTo(c+k,u),a.lineTo(c+k,u+w),a.lineTo(c,u+w),a.lineTo(c,u));this.fill&&(a.fillStyle=n.getColor(),a.fill());this.dashStyle();a.stroke();a.setLineDash([])};a.Rectangle=n;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.round,e=Math.min,d=Math.max,r=Math.acos,m=Math.sqrt,b=Math.PI,h=b/2,g=2*b,l,q,c,u,k,w,p,v,n,z,x,y,B,E,J,G,H,A,I,C,M,N=function(c,b){b=a.Graphic.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("1");b.fill=b.fill||"";b.center=b.center||c.evaluator.parser.parse("(0,0)");b.radius=b.radius||c.evaluator.parser.parse("1");b.init=b.init||"0";b.end=b.end||"90";b.init.match(/^_\(/)&&(b.initFlag=!0,b.init=b.init.substring(1));b.end.match(/^_\(/)&&
(b.endFlag=!0,b.end=b.end.substring(1));b.initExpr=c.evaluator.parser.parse(b.init);b.endExpr=c.evaluator.parser.parse(b.end);b.text=new a.TextObject(b,b.text);return b};$jscomp.inherits(N,a.Graphic);N.prototype.update=function(){l=this.evaluator;q=l.eval(this.center);this.exprX=q[0][0];this.exprY=q[0][1];c=0;this.rotateExp&&(c=a.degToRad(l.eval(this.rotateExp)),u=Math.cos(c),k=Math.sin(c),w=this.exprX*u-this.exprY*k,p=this.exprX*k+this.exprY*u,this.exprX=w,this.exprY=p);var f=l.eval(this.initExpr),
A=l.eval(this.endExpr);/^(\(|\[)expr(\)|\])$/i.test(this.initExpr.type)&&/^(\(|\[)expr(\)|\])$/i.test(this.endExpr.type)?(v=f[0][0],n=f[0][1],z=A[0][0],x=A[0][1],this.vectors?this.abs_coord&&(n=-n,x=-x):this.abs_coord?(v-=this.exprX,n=-n+this.exprY,z-=this.exprX,x=-x+this.exprY):(v-=this.exprX,n-=this.exprY,z-=this.exprX,x-=this.exprY),y=0==v?0>n?3*h:h:r(1*v/m(v*v+n*n)),B=0==z?0>x?3*h:h:r(1*z/m(z*z+x*x)),y+=c,B+=c,0<v&&0<n&&this.abs_coord&&(y=g-y),0<v&&0>n&&!this.abs_coord&&(y=g-y),0>v&&0>n&&!this.abs_coord&&
(y=g-y),0>v&&0<n&&this.abs_coord&&(y=g-y),0<z&&0<x&&this.abs_coord&&(B=g-B),0<z&&0>x&&!this.abs_coord&&(B=g-B),0>z&&0>x&&!this.abs_coord&&(B=g-B),0>z&&0<x&&this.abs_coord&&(B=g-B),this.initFlag?(E=y,y=B,B=E):(E=e(y,B),J=d(y,B),y=E,B=J,B-y>b&&this.abs_coord&&(y=J,B=E),B-y<=b&&!this.abs_coord&&(y=J,B=E)),this.iniAng=y,this.endAng=B,this.drawPoints=!0):(this.iniAng=a.degToRad(f)+c,this.endAng=a.degToRad(A)+c,this.drawAngle=!0)};N.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.fill,
this.color)};N.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.fill,this.trace)};N.prototype.drawAux=function(a,c,b){l=this.evaluator;G=this.space;I=l.eval(this.radius);0>I&&(I=0);M=f(l.eval(this.width));a.lineWidth=0<M?M:1E-6;a.lineCap="round";a.strokeStyle=b.getColor();this.drawAngle?(this.abs_coord?(H=f(this.exprX),A=f(this.exprY)):(H=f(G.getAbsoluteX(this.exprX)),A=f(G.getAbsoluteY(this.exprY)),I*=G.scale,this.iniAng=-this.iniAng,this.endAng=-this.endAng),this.iniAng>
this.endAng&&(C=this.iniAng,this.iniAng=this.endAng,this.endAng=C)):this.drawPoints&&(this.abs_coord?(H=f(this.exprX),A=f(this.exprY)):(H=f(G.getAbsoluteX(this.exprX)),A=f(G.getAbsoluteY(this.exprY)),I*=G.scale,this.iniAng=-this.iniAng,this.endAng=-this.endAng));this.fill&&(a.fillStyle=c.getColor(),a.beginPath(),a.moveTo(H,A),a.arc(H,A,I,this.iniAng,this.endAng,void 0),a.fill());a.beginPath();a.arc(H,A,I,this.iniAng,this.endAng,void 0);this.dashStyle();a.stroke();this.text.hasContent&&this.text.draw(a,
this.color,H,A)};a.Arc=N;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b=function(b,d){d=a.Graphic.call(this,b,d)||this;d.width=d.width||b.evaluator.parser.parse("0");d.align||(d.align="left");d.anchor||(d.anchor="top_left");d.text=new a.TextObject(d,d.text);return d};$jscomp.inherits(b,a.Graphic);b.prototype.update=function(){f=this.evaluator;e=f.eval(this.expresion);this.exprX=e[0][0];this.exprY=e[0][1];this.rotateExp&&(d=this.rotate(e[0][0],e[0][1],a.degToRad(f.eval(this.rotateExp))),this.exprX=d.x,this.exprY=
d.y)};b.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.color)};b.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace)};b.prototype.drawAux=function(a,b){this.abs_coord?(r=parseInt(this.exprX),m=parseInt(this.exprY)):(r=parseInt(this.space.getAbsoluteX(this.exprX)),m=parseInt(this.space.getAbsoluteY(this.exprY)));this.text.draw(a,b,r,m)};a.Text=b;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.round,e,d,r,m,b,h,g,l,q,c,u,k,w=function(c,b){b=a.Graphic.call(this,c,b)||this;b.file=b.file||"";b.inirot=b.inirot||c.evaluator.parser.parse("0");b.img=new Image;b.scaleX=b.scaleY=1;b.ratio=c.ratio;b.update();return b};$jscomp.inherits(w,a.Graphic);w.prototype.update=function(){e=this.evaluator;d=e.eval(this.expresion);this.exprX=d[0][0];this.exprY=d[0][1];this.rotateExp&&(r=this.rotate(d[0][0],d[0][1],a.degToRad(e.eval(this.rotateExp))),this.exprX=
r.x,this.exprY=r.y);4<=d[0].length&&(this.centered=!0,this.scaleX=d[0][2],this.scaleY=d[0][3]);d[1]&&2==d[1].length&&(this.centered=!0,this.scaleX=d[1][0],this.scaleY=d[1][1]);0==this.scaleX&&(this.scaleX=1E-5);0==this.scaleY&&(this.scaleY=1E-5);var c=this;if((m=e.eval(this.file))||""==m)this.img=this.parent.getImage(m),this.img.addEventListener("load",function(a){c.space.update(!0)})};w.prototype.draw=function(){a.Graphic.prototype.draw.call(this)};w.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this)};
w.prototype.drawAux=function(d){e=this.evaluator;b=this.space;this.img&&this.img.ready&&this.img.complete&&(u=this.img.width,k=this.img.height,this.img.canvas&&(u=f(u/this.ratio),k=f(k/this.ratio)),h=this.centered?0:f(u/2),g=this.centered?0:f(k/2),l=f(this.abs_coord?this.exprX:b.getAbsoluteX(this.exprX)),q=f(this.abs_coord?this.exprY:b.getAbsoluteY(this.exprY)),c=a.degToRad(-e.eval(this.inirot)),d.save(),d.translate(l+h,q+g),d.rotate(c),this.opacity&&(d.globalAlpha=e.eval(this.opacity)),d.scale(this.scaleX,
this.scaleY),d.drawImage(this.img,-u/2,-k/2,u,k),d.restore())};a.Image=w;return a}(descartesJS||{});
descartesJS=function(a){function f(a,b,d){g=4*(b+d*a.width);return{r:a.data[g],g:a.data[g+1],b:a.data[g+2],a:a.data[g+3]}}if(a.loadLib)return a;var e,d,r,m,b,h,g,l,q=function(c,b){return a.Graphic.call(this,c,b)||this};$jscomp.inherits(q,a.Graphic);q.prototype.update=function(){e=this.evaluator.eval(this.expresion);this.exprX=e[0][0];this.exprY=e[0][1]};q.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.color,this.color)};q.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,
this.trace,this.trace)};q.prototype.drawAux=function(a,e){e.getColor();imageData=a.getImageData(0,0,this.space.w,this.space.h);this.abs_coord?(d=parseInt(this.exprX),r=parseInt(this.exprY)):(d=parseInt(this.space.getAbsoluteX(this.exprX)),r=parseInt(this.space.getAbsoluteY(this.exprY)));if(!(0>d||0>r||d>=this.space.w||r>=this.space.h)){m=[[d,r]];h=f(imageData,d,r);for(l=0;0<m.length;){l++;b=m.pop();d=b[0];r=b[1];var c=f(imageData,d,r);if(h.r===c.r&&h.g===c.g&&h.b===c.b&&h.a===c.a){c=imageData;var u=
e;g=4*(d+r*c.width);c.data[g+0]=u.r;c.data[g+1]=u.g;c.data[g+2]=u.b;c.data[g+3]=255*u.a;0<d&&m.push([d-1,r]);d<imageData.width-1&&m.push([d+1,r]);m.push([d,r-1]);m.push([d,r+1])}if(l>=this.space.w*this.space.h*3)break}a.putImageData(imageData,0,0)}};a.Fill=q;return a}(descartesJS||{});
descartesJS=function(a,f){if(a.loadLib)return a;var e=new String("-text-image-point-polygon-arc-segment-arrow-macro-curve-equation-sequence-rectangle-fill-"),d=/[\w\.\-//]*(\.png|\.jpg|\.gif|\.svg)/gi,r,m=function(b,h){var g=a.Graphic.call(this,b,h)||this;g.hasExpresion=g.hasExpresion||!1;g.inirot=g.inirot||b.evaluator.parser.parse("0");g.inipos=g.inipos||b.evaluator.parser.parse("(0,0)");Object.assign(g,h);g.hasExpresion=void 0!==g.expresion;g.graphics=[];b=b.lessonParser;var l=new a.Tokenizer;if(!g.hasExpresion)return g;
"'"!==g.expresion.charAt(0)&&(g.expresion="'"+g.expresion+"'");g.expresion=g.evaluator.parser.parse(g.expresion);h=g.evaluator.eval(g.expresion);if(h)var q=(q=document.getElementById(h))&&"descartes/macro"==q.type?q.text:a.openExternalFile(h);if(q){var c=a.convertHTMLEntities(q).replace(/\r/g,"").split("\n");q=[];h=0;for(var u=c.length;h<u;h++)if(c[h].trim()){var k=c[h].indexOf("=");if(-1!==k){k=b.split(c[h]);for(var m=0,p=k.length;m<p;m++)if(k[m]&&1<k.length&&("id"===f[k[m][0]]||"type"===f[k[m][0]])){q.push(k);
break}}}m=function(c,b){b=l.tokenize(b.replace(/&squot;/g,"'"));for(var d=0,k=b.length;d<k;d++)"identifier"!=b[d].type||a.reservedIds.match("-"+b[d].value+"-")||(b[d].value=g.name+"."+b[d].value);return(c.match(/^\\expr/)?"\\expr ":"\\decimals ")+l.flatTokens(b)};h=0;for(u=q.length;h<u;h++){var v=(p=q[h]||[],p[0])&&"id"===p[0][0];c=0;for(k=p.length;c<k;c++){var n=p[c][0].indexOf(".");-1===n||v?n=f[p[c][0]]:(n=f[p[c][0].substring(n+1)],p[c][0]=g.name+"."+p[c][0]);if(!("font"===n||"font_family"===n||
("fill"===n||"color"===n||"border"===n||"arrow"===n)&&"("!==p[c][1].charAt(0)||"file"===n&&p[c][1].match(d)||"id"!==n&&void 0!==f[p[c][1]])||"radius"===n)if("text"==n)if(p[c][1].match(/\{\\rtf1/))n=p[c][1],n=n.replace(/\\expr ([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,m),n=n.replace(/\\decimals ([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,m),p[c][1]=n;else{var r=b.parseText(p[c][1]).textElementsMacros;for(var x=0,y=r.length;x<y;x++){n=l.tokenize(r[x].replace(/&squot;/g,"'"));for(var B=
0,E=n.length;B<E;B++)"identifier"!==n[B].type||a.reservedIds.match("-"+n[B].value+"-")||(n[B].value=g.name+"."+n[B].value);n=l.flatTokens(n).replace(/&squot;/g,"'").replace(/'\+\(/g,"[").replace(/\)\+'/g,"]");r[x]=n.substring(1,n.length-1)}p[c][1]=r.join("")}else{r=p[c][1].replace(/&squot;/g,"'").split(";");x=0;for(y=r.length;x<y;x++){n=l.tokenize(r[x].replace(/\\n/g,";"));B=0;for(E=n.length;B<E;B++)"identifier"!==n[B].type||a.reservedIds.match("-"+n[B].value+"-")||(n[B].value=g.name+"."+n[B].value);
r[x]=l.flatTokens(n)}p[c][1]=r.join(";")}}}h=0;for(u=q.length;h<u;h++)if(q[h][0]){m="";p=!1;c=0;for(k=q[h].length;c<k;c++)"type"===f[q[h][c][0]]&&e.match("-"+f[q[h][c][1]]+"-")&&(p=!0),m=m+q[h][c][0]+"='"+q[h][c][1]+"' ";q[h]=m+(p?" space='"+g.spaceID+"'":"");p?g.graphics.push(b.parseGraphic(q[h],g.abs_coord,g.background,g.inirot)):b.parseAuxiliar(q[h])}}return g};$jscomp.inherits(m,a.Graphic);m.prototype.update=function(){r=this.evaluator.eval(this.inipos);this.iniPosX=r[0][0];this.iniPosY=r[0][1]};
m.prototype.drawAux=function(a){for(var b=0,d=this.graphics.length;b<d;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())};a.Macro=m;return a}(descartesJS||{},babel);
descartesJS=function(a){if(a.loadLib)return a;var f=Math.sqrt,e=Math.sin,d=Math.cos,r=Math.abs,m,b,h,g,l,q,c,u,k,w,p,v,n,z,x,y=function(a,c,b,d){this.x=a||0;this.y=c||0;this.z=b||0;this.w=d||0;this.adjustDec()};y.prototype.adjustDec=function(){this.x=parseInt(1E9*this.x)/1E9;this.y=parseInt(1E9*this.y)/1E9;this.z=parseInt(1E9*this.z)/1E9};var B=function(a,c,b,d,k,n,g,e,l,f,h,p,u,q,m,v){this.a00=a||0;this.a01=c||0;this.a02=b||0;this.a03=d||0;this.a10=k||0;this.a11=n||0;this.a12=g||0;this.a13=e||0;
this.a20=l||0;this.a21=f||0;this.a22=h||0;this.a23=p||0;this.a30=u||0;this.a31=q||0;this.a32=m||0;this.a33=v||0};B.prototype.setIdentity=function(){this.a00=1;this.a10=this.a03=this.a02=this.a01=0;this.a11=1;this.a21=this.a20=this.a13=this.a12=0;this.a22=1;this.a32=this.a31=this.a30=this.a23=0;this.a33=1;return this};B.prototype.multiplyVector4=function(a){return new y(a.x*this.a00+a.y*this.a10+a.z*this.a20+a.w*this.a30,a.x*this.a01+a.y*this.a11+a.z*this.a21+a.w*this.a31,a.x*this.a02+a.y*this.a12+
a.z*this.a22+a.w*this.a32,a.x*this.a03+a.y*this.a13+a.z*this.a23+a.w*this.a33)};B.prototype.translate=function(a){return new B(this.a00,this.a01,this.a02,this.a03,this.a10,this.a11,this.a12,this.a13,this.a20,this.a21,this.a22,this.a23,this.a00*a.x+this.a10*a.y+this.a20*a.z+this.a30,this.a01*a.x+this.a11*a.y+this.a21*a.z+this.a31,this.a02*a.x+this.a12*a.y+this.a22*a.z+this.a32,this.a03*a.x+this.a13*a.y+this.a23*a.z+this.a33)};B.prototype.rotateX=function(a){b=e(a);h=d(a);u=this.a10;k=this.a11;w=this.a12;
p=this.a13;v=this.a20;n=this.a21;z=this.a22;x=this.a23;return new B(this.a00,this.a01,this.a02,this.a03,u*h+v*b,k*h+n*b,w*h+z*b,p*h+x*b,u*-b+v*h,k*-b+n*h,w*-b+z*h,p*-b+x*h,this.a30,this.a31,this.a32,this.a33)};B.prototype.rotateY=function(a){b=e(a);h=d(a);g=this.a00;l=this.a01;q=this.a02;c=this.a03;v=this.a20;n=this.a21;z=this.a22;x=this.a23;return new B(g*h+v*-b,l*h+n*-b,q*h+z*-b,c*h+x*-b,this.a10,this.a11,this.a12,this.a13,g*b+v*h,l*b+n*h,q*b+z*h,c*b+x*h,this.a30,this.a31,this.a32,this.a33)};B.prototype.rotateZ=
function(a){b=e(a);h=d(a);g=this.a00;l=this.a01;q=this.a02;c=this.a03;u=this.a10;k=this.a11;w=this.a12;p=this.a13;return new B(g*h+u*b,l*h+k*b,q*h+w*b,c*h+p*b,g*-b+u*h,l*-b+k*h,q*-b+w*h,c*-b+p*h,this.a20,this.a21,this.a22,this.a23,this.a30,this.a31,this.a32,this.a33)};a.norm3D=function(a){return f(a.x*a.x+a.y*a.y+a.z*a.z)};a.normalize3D=function(c){m=a.norm3D(c);if(0===m)return{x:0,y:0,z:0};if(1===m)return{x:c.x,y:c.y,z:c.z};m=1/m;return{x:c.x*m,y:c.y*m,z:c.z*m}};a.dotProduct3D=function(a,c){return a.x*
c.x+a.y*c.y+a.z*c.z};a.crossProduct3D=function(a,c){return{x:a.y*c.z-a.z*c.y,y:a.z*c.x-a.x*c.z,z:a.x*c.y-a.y*c.x}};a.scalarProduct3D=function(a,c){return{x:a.x*c,y:a.y*c,z:a.z*c}};a.subtract3D=function(a,c){return{x:a.x-c.x,y:a.y-c.y,z:a.z-c.z}};a.add3D=function(a,c){return{x:a.x+c.x,y:a.y+c.y,z:a.z+c.z}};a.equals3DEpsilon=function(a,c,b){return r(a.x-c.x)<=b&&r(a.y-c.y)<=b&&r(a.z-c.z)<=b};a.Vector4D=y;a.Matrix4x4=B;return a}(descartesJS||{});
descartesJS=function(a){function f(a){a.textNode=null;0!==parseInt(this.size)&&(a.lineWidth=1,a.fillStyle=this.backColor,a.strokeStyle=this.frontColor,a.beginPath(),a.arc(this.projVert[0].x,this.projVert[0].y,this.size,0,b),a.fill(),a.stroke())}function e(a,c){a.textNode=null;a.lineCap=h;a.lineJoin=lineJoin;a.lineWidth=.4;a.beginPath();a.moveTo(this.projVert[0].x,this.projVert[0].y);k=1;for(w=this.projVert.length;k<w;k++)a.lineTo(this.projVert[k].x,this.projVert[k].y);a.closePath();"color"===this.model?
(a.fillStyle=0>this.direction?this.backColor:this.frontColor,a.strokeStyle=a.fillStyle,a.stroke(),a.fill()):"light"===this.model||"metal"===this.model?(a.fillStyle=c.computeColor(0>this.direction?this.backColor:this.frontColor,this,"metal"===this.model),a.strokeStyle=a.fillStyle,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 d(a){a.textNode=null;a.oldTextNode=
"_a1b2c3_";c=this.evaluator.getVariable(this.family);this.evaluator.setVariable(this.family,this.familyValue);this.fontSize=Math.max(5,this.evaluator.eval(this.font_size));this.font=this.font_style+" "+this.fontSize+"px "+this.font_family;this.drawText(a,this.text,this.projVert[0].x,this.projVert[0].y,this.frontColor,this.font,"left","alphabetic",this.decimals,this.fixed,!0);this.evaluator.setVariable(this.family,c)}function r(a){a.textNode=null;a.lineCap=h;a.lineJoin=lineJoin;a.lineWidth=this.lineWidth;
a.strokeStyle=this.frontColor;a.beginPath();a.moveTo(this.projVert[0].x,this.projVert[0].y);a.lineTo(this.projVert[1].x,this.projVert[1].y);"dot"===this.lineDash?(a.lineCap="butt",a.setLineDash([a.lineWidth,a.lineWidth])):"dash"===this.lineDash?(a.lineCap="butt",a.setLineDash([4*a.lineWidth,3*a.lineWidth])):"dash_dot"===this.lineDash?(a.lineCap="butt",a.setLineDash([4*a.lineWidth,2*a.lineWidth,a.lineWidth,2*a.lineWidth])):a.setLineDash([]);a.stroke()}function m(c,b,d){return a.normalize3D(a.crossProduct3D(a.subtract3D(c,
b),a.subtract3D(c,d)))}if(a.loadLib)return a;var b=2*Math.PI,h=lineJoin="round",g,l,q,c,u,k,w,p,v,n,z,x,y,B=function(a,c){Object.assign(this,a);this.space=c;this.projVert=[];this.spaceVertices=[];this.newProjVert=[];this.newSpaceVert=[];"vertex"===this.type?this.draw=f:"face"===this.type?(this.normal=m(this.vertices[0],this.vertices[1],this.vertices[2]),this.draw=e):"text"===this.type?this.draw=d:"edge"===this.type&&(this.draw=r);this.isText&&(this.computeDepth=function(){this.normal={x:0,y:0,z:0};
this.projVert=this.vertices;this.depth=this.vertices[0].z;this.average=this.vertices[0]})};B.prototype.computeDepth=function(c){this.space=c;this.average={x:0,y:0,z:0};this.removeDoubles();this.normal={x:0,y:1,z:0};this.direction={x:1,y:0,z:0};k=0;for(w=this.vertices.length;k<w;k++)this.spaceVertices[k]=c.rotateVertex(this.vertices[k]),this.average.x+=this.spaceVertices[k].x,this.average.y+=this.spaceVertices[k].y,this.average.z+=this.spaceVertices[k].z;this.average=a.scalarProduct3D(this.average,
1/w);this.average_proy=c.project(this.average);this.depth=a.norm3D(a.subtract3D(c.eye,this.average));2<this.vertices.length&&(this.normal=m(this.spaceVertices[0],this.spaceVertices[1],this.spaceVertices[2]));k=0;for(w=this.vertices.length;k<w;k++)this.newSpaceVert[k]=this.spaceVertices[k],this.projVert[k]=this.newProjVert[k]=c.project(this.spaceVertices[k]);2<this.vertices.length&&(this.direction=m(this.projVert[0],this.projVert[1],this.projVert[2]).z);this.minDistanceToEye=Infinity;this.maxDistanceToEye=
-Infinity;this.minx=Infinity;this.maxx=-Infinity;this.miny=Infinity;this.maxy=-Infinity;k=0;for(w=this.vertices.length;k<w;k++)p=a.norm3D(a.subtract3D(this.spaceVertices[k],c.eye)),this.minDistanceToEye=Math.min(this.minDistanceToEye,p),this.maxDistanceToEye=Math.max(this.maxDistanceToEye,p);k=0;for(w=this.vertices.length;k<w;k++)this.minx>this.projVert[k].x&&(this.minx=this.projVert[k].x),this.maxx<this.projVert[k].x&&(this.maxx=this.projVert[k].x),this.miny>this.projVert[k].y&&(this.miny=this.projVert[k].y),
this.maxy<this.projVert[k].y&&(this.maxy=this.projVert[k].y)};B.prototype.removeDoubles=function(){if("edge"!==this.type){u=[];k=0;for(w=this.vertices.length;k<w;k++)(1E-8<Math.abs(this.vertices[k].x-this.vertices[(k+1)%w].x)||1E-8<Math.abs(this.vertices[k].y-this.vertices[(k+1)%w].y)||1E-8<Math.abs(this.vertices[k].z-this.vertices[(k+1)%w].z)||1E-8<Math.abs(this.vertices[k].w-this.vertices[(k+1)%w].w))&&u.push(this.vertices[k]);0===u.length&&u.push(this.vertices[0]);this.vertices=u}};B.prototype.drawText=
function(c,b,d,k,n,e,f,h,p,u,m){g=this.evaluator;c.textNode=b;e=g.eval(this.offset_dist);f=-a.degToRad(g.eval(this.offset_angle));d+=e*Math.cos(f);k+=e*Math.sin(f);c.textNode.pos={x:d,y:k};b.hasContent&&(b.draw(c,n,d,k,!0),q=this.fromPoint?b.textNodes.metrics.w/2:0,l=this.fromPoint?b.textNodes.metrics.h/2:0,b.draw(c,n,d-q,k-l))};B.prototype.splitFace=function(c){if(this.intersects(c)){var b=i2=null,d=ix2=0,k,n;var g=this.vertices;var e=c.vertices;var f=0;for(n=e.length;f<n;f++){var l=this.intersection(e[f],
e[(f+1)%n]);if(null!==l)if(null===b){if(b=l,d=f,2===e.length){i2=b;break}}else if(!a.equals3DEpsilon(l,b,1E-8)){i2=l;ix2=f;break}}if(null!==b&&null!==i2){f=this.isInterior(b)||this.isInterior(i2);var h=k=null;if(!f&&3<=e.length)for(n=0,g=g.length;n<g;n++)if(l=c.intersection(this.vertices[n],this.vertices[(n+1)%g]),null!==l)if(null===k)k=l;else if(!a.equals3DEpsilon(l,k,1E-8)){h=l;break}if(f||null!==k&&null!==h&&c.isInterior(k)&&c.isInterior(h)){h=!0;g=l=null;if(2===e.length)a.equals3DEpsilon(b,e[0],
1E-8)||a.equals3DEpsilon(b,e[1],1E-8)?h=!1:(l=[],l[0]=e[0],l[1]=b,g=[],g[0]=b,g[1]=e[1]);else for(l=[],g=[],f=n=k=0;f<e.length;f++)f<d?l[k++]=e[f]:f==d?(l[k++]=e[f],l[k++]=b,g[n++]=b):f<ix2?g[n++]=e[f]:f==ix2?(g[n++]=e[f],g[n++]=i2,l[k++]=i2):l[k++]=e[f];if(h){b=[];b[0]=new B({vertices:l,type:"face",frontColor:c.frontColor,backColor:c.backColor,edges:c.edges,model:c.model},this.space);b[0].removeDoubles();b[0].normal=c.normal;b[1]=new B({vertices:g,type:"face",frontColor:c.frontColor,backColor:c.backColor,
edges:c.edges,model:c.model},this.space);b[1].removeDoubles();b[1].normal=c.normal;if(2<b[0].vertices.length)return 2<b[1].vertices.length?b:[b[0]];if(2<b[1].vertices.length)return[b[1]]}}}}return[c]};B.prototype.intersects=function(a){return this.intersectsPlane(a)&&a.intersectsPlane(this)};B.prototype.intersectsPlane=function(c){var b=this.vertices;var d=c.vertices;if(0<b.length){var k=a.dotProduct3D(d[0],c.normal);var n=a.dotProduct3D(b[0],c.normal);if(1E-8>Math.abs(k-n))return!0;for(var g=1,e=
b.length;g<e;g++)if(d=a.dotProduct3D(b[g],c.normal),1E-8>Math.abs(k-d)||d>k&&n<k||d<k&&n>k)return!0}return!1};B.prototype.intersection=function(c,b){var d=this.vertices;if(0<d.length){b=a.subtract3D(b,c);var k=a.dotProduct3D(b,this.normal);if(0!==k&&(d=a.dotProduct3D(a.subtract3D(d[0],c),this.normal)/k,-1E-8<d&&1.00000001>d))return a.add3D(c,a.scalarProduct3D(b,d))}return null};B.prototype.isInterior=function(c){var b=this.vertices;if(0<b.length)for(var d=0,k=a.subtract3D(b[0],c),n=0,g=b.length;n<
g;n++){var e=a.subtract3D(b[(n+1)%g],c),f=a.dotProduct3D(a.crossProduct3D(k,e),this.normal);if(1E-8>Math.abs(f)){if(0>a.dotProduct3D(k,e))break}else{if(0>d&&0<f||0<d&&0>f)return!1;k=e;d=f}}return!0};B.prototype.inFrontOf=function(a,c,b){if(this.minDistanceToEye>=c.maxDistanceToEye||this.maxx<=c.minx||this.minx>=c.maxx||this.maxy<=c.miny||this.miny>=c.maxy)return!1;for(x=0;3>x;x++)if(v=null,v=0===x?this.intersections(c):1===x?c.verticesContainedIn(this):this.verticesContainedIn(c),null!=v&&0<v.length){for(y=
0;y<v.length;y++)a.push(v[y]);k=0;for(w=v.length;k<w;k++){n=v[k];z=this.space.rayFromEye(n.x,n.y);try{t=this.distanceToEyeAlong(z)-c.distanceToEyeAlong(z);if(t<=-b)return!0;if(t>=b)return!1}catch(H){}}}return!1};B.prototype.intersections=function(c){for(var b=[],d,k,n,g=new a.R2,e=this.newSpaceVert,f=c.newSpaceVert,l=this.newProjVert,h=c.newProjVert,p=0,u=e.length;p<u;p++){c=e[p];d=e[(p+1)%u];for(var q=0,m=f.length;q<m;q++)k=f[q],n=f[(q+1)%m],c!=k&&c!=n&&d!=k&&d!=n&&(k=g.intersection(l[p],l[(p+1)%
u],h[q],h[(q+1)%m]),null!=k&&b.push(k))}return b};B.prototype.distanceToEyeAlong=function(c){c=a.dotProduct3D(this.normal,c);if(1E-6<Math.abs(c))return a.dotProduct3D(a.subtract3D(this.average,this.space.eye),this.normal)/c;throw new Exception("Face is invisible");};B.prototype.verticesContainedIn=function(a){for(var c=[],b=this.newSpaceVert,d=this.newProjVert,k=0,n=b.length;k<n;k++)!a.isVertex(b[k])&&a.appearsToContain(d[k])&&c.push(d[k]);return c};B.prototype.appearsToContain=function(a){for(var c=
0,b,d=this.newProjVert,k=0,n=this.newSpaceVert.length;k<n;k++){b=(d[k].x-a.x)*(d[(k+1)%n].y-a.y)-(d[(k+1)%n].x-a.x)*(d[k].y-a.y);if(0!=c)if(1E-8>Math.abs(b)){if(1E-8<Math.abs(d[k].x-d[(k+1)%n].x))return Math.min(d[k].x,d[(k+1)%n].x)<=a.x+1E-8&&a.x<=Math.max(d[k].x,d[(k+1)%n].x)+1E-8;if(1E-8<Math.abs(d[k].y-d[(k+1)%n].y))return Math.min(d[k].y,d[(k+1)%n].y)<=a.y+1E-8&&a.y<=Math.max(d[k].y,d[(k+1)%n].y)+1E-8}else if(0<c&&0>b||0>c&&0<b)return!1;c=b}return!0};B.prototype.isVertex=function(c){for(var b=
this.newSpaceVert,d=0,k=b.length;d<k;d++)if(a.equals3DEpsilon(c,b[d],1E-8))return!0;return!1};a.Primitive3D=B;return a}(descartesJS||{});
descartesJS=function(a){function f(a){for(var c=[],b=0,d,g=a.length,e=a.length-1;-1<e;e--)d=a.charAt(e),0==b?"="==d&&(b=1):1==b?" "!=d&&(b="<"===d||">"===d?0:2):2==b&&" "==d&&(c.unshift(a.substring(e+1,g)),g=e,b=0);c.unshift(a.substring(0,g));return c}if(a.loadLib)return a;var e={x:0,y:0,z:0},d,r,m,b,h,g=a.degToRad,l,q=function(c,b){this.parent=c;this.evaluator=c.evaluator;var d=c.evaluator.parser;this.spaceID="E0";this.background=!1;this.type="";this.color=new a.Color("eeffaa");this.backcolor=new a.Color("6090a0");
this.Nu=this.evaluator.parser.parse("7");this.Nv=this.evaluator.parser.parse("7");this.drawif=d.parse("1");this.abs_coord=!1;this.family="";this.family_interval=d.parse("[0,1]");this.family_steps=d.parse("8");this.font="Monospaced,PLAIN,12";this.fixed=!0;this.text="";this.decimals=d.parse("2");this.inirot="(0,0,0)";this.inirotEuler=!1;this.inipos=d.parse("(0,0,0)");this.endrot="(0,0,0)";this.endrotEuler=!1;this.endpos=d.parse("(0,0,0)");this.model="color";Object.assign(this,b);void 0==this.expresion&&
"macro"!=this.type&&(this.expresion=d.parse("(0,0)"));this.space=this.getSpace();this.canvas=this.background?this.space.backCanvas:this.space.canvas;this.ctx=this.canvas.getContext("2d");this.font_str=this.font;this.font=a.convertFont(this.font);this.fontSize=(this.fontSize=this.font.match(/([\d\.]+)px/))?parseFloat(this.fontSize[1]):10;this.font_style=a.getFontStyle(this.font_str.split(",")[1]);if("boolean"===typeof this.bold||"boolean"===typeof this.italics)this.bold&&!this.italics?this.font_style=
"Bold ":!this.bold&&this.italics?this.font_style="Italic ":this.bold&&this.italics?this.font_style="Italic Bold ":this.bold||this.italics||(this.font_style=" ");this.font_family||(this.font_family=this.font_str.split(",")[0]);this.font_family=a.getFontName(this.font_family);"undefined"===typeof this.font_size&&(this.font_size=c.evaluator.parser.parse(this.fontSize.toString()));this.inirot.match("Euler")&&(this.inirot=this.inirot.replace("Euler",""),this.inirotEuler=!0);this.endrot.match("Euler")&&
(this.endrot=this.endrot.replace("Euler",""),this.endrotEuler=!0);this.inirot=d.parse(this.inirot);this.endrot=d.parse(this.endrot);this.inirotM=new a.Matrix4x4;this.inirotM_X=new a.Matrix4x4;this.inirotM_Y=new a.Matrix4x4;this.inirotM_Z=new a.Matrix4x4;this.iniposM=new a.Matrix4x4;this.endrotM=new a.Matrix4x4;this.endrotM_X=new a.Matrix4x4;this.endrotM_Y=new a.Matrix4x4;this.endrotM_Z=new a.Matrix4x4;this.endposM=new a.Matrix4x4};q.prototype.getSpace=function(){for(var a=this.parent.spaces,b,d=0,
g=a.length;d<g;d++)if(b=a[d],b.id==this.spaceID)return b;return a[0]};q.prototype.getFamilyValues=function(){d=this.evaluator;r=d.eval(this.family_interval);this.familyInf=r[0][0];this.familySup=r[0][1];this.fSteps=Math.round(d.eval(this.family_steps));this.family_sep=0<this.fSteps?(this.familySup-this.familyInf)/this.fSteps:0};q.prototype.buildFamilyPrimitives=function(){d=this.evaluator;this.getFamilyValues();m=d.getVariable(this.family);if(0<=this.fSteps)for(var a=0,b=this.fSteps;a<=b;a++)d.setVariable(this.family,
this.familyInf+a*this.family_sep),this.familyValue=this.familyInf+a*this.family_sep,d.eval(this.drawif)&&this.buildPrimitives();d.setVariable(this.family,m)};q.prototype.update=function(){this.primitives=[];this.evaluator.eval(this.drawif)&&(this.family||this.buildPrimitives());this.family&&this.buildFamilyPrimitives()};q.prototype.updateMVMatrix=function(){b=this.evaluator.eval(this.inirot);this.inirotEuler?(this.inirotM=this.inirotM.setIdentity(),this.inirotM=this.inirotM.rotateZ(g(b[0][0])),this.inirotM=
this.inirotM.rotateX(g(b[0][1])),this.inirotM=this.inirotM.rotateZ(g(b[0][2]))):(this.inirotM_X=this.inirotM_X.setIdentity().rotateX(g(b[0][0])),this.inirotM_Y=this.inirotM_Y.setIdentity().rotateY(g(b[0][1])),this.inirotM_Z=this.inirotM_Z.setIdentity().rotateZ(g(b[0][2])));b=this.evaluator.eval(this.inipos);e={x:b[0][0],y:b[0][1],z:b[0][2]};this.iniposM=this.iniposM.setIdentity().translate(e);b=this.evaluator.eval(this.endrot);this.endrotEuler?(this.endrotM=this.endrotM.setIdentity(),this.endrotM=
this.endrotM.rotateZ(g(b[0][0])),this.endrotM=this.endrotM.rotateX(g(b[0][1])),this.endrotM=this.endrotM.rotateZ(g(b[0][2]))):(this.endrotM_X=this.endrotM_X.setIdentity().rotateX(g(b[0][0])),this.endrotM_Y=this.endrotM_Y.setIdentity().rotateY(g(b[0][1])),this.endrotM_Z=this.endrotM_Z.setIdentity().rotateZ(g(b[0][2])));b=this.evaluator.eval(this.endpos);e={x:b[0][0],y:b[0][1],z:b[0][2]};this.endposM=this.endposM.setIdentity().translate(e)};q.prototype.transformVertex=function(a){this.inirotEuler?h=
this.inirotM.multiplyVector4(a):(h=this.inirotM_X.multiplyVector4(a),h=this.inirotM_Y.multiplyVector4(h),h=this.inirotM_Z.multiplyVector4(h));h=this.iniposM.multiplyVector4(h);this.endrotEuler?h=this.endrotM.multiplyVector4(h):(h=this.endrotM_X.multiplyVector4(h),h=this.endrotM_Y.multiplyVector4(h),h=this.endrotM_Z.multiplyVector4(h));h=this.endposM.multiplyVector4(h);this.macroChildren&&(h=this.applyMacroTransform(h));h.adjustDec();return h};q.prototype.applyMacroTransform=function(a){this.macro_inirotEuler?
h=this.macro_inirotM.multiplyVector4(a):(h=this.macro_inirotM_X.multiplyVector4(a),h=this.macro_inirotM_Y.multiplyVector4(h),h=this.macro_inirotM_Z.multiplyVector4(h));h=this.macro_iniposM.multiplyVector4(h);this.macro_endrotEuler?h=this.macro_endrotM.multiplyVector4(h):(h=this.macro_endrotM_X.multiplyVector4(h),h=this.macro_endrotM_Y.multiplyVector4(h),h=this.macro_endrotM_Z.multiplyVector4(h));return h=this.macro_endposM.multiplyVector4(h)};q.prototype.parseExpression=function(){for(var a=this.expresion.split(";"),
b=[],d=0,g=a.length;d<g;d++)""!==a[d].trim()&&(b=b.concat(f(a[d])));d=0;for(g=b.length;d<g;d++)b[d]=this.evaluator.parser.parse(b[d],!0);return b};q.prototype.splitFace=function(a){for(var c=0,b=this.primitives.length;c<b;c++)if(l=[],"face"===this.primitives[c].type){for(var d=0,g=a.primitives.length;d<g;d++)"face"===a.primitives[d].type?l=l.concat(this.primitives[c].splitFace(a.primitives[d])):l.push(a.primitives[d]);a.primitives=l}};a.Graphic3D=q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b=function(b,d){return a.Graphic3D.call(this,b,d)||this};$jscomp.inherits(b,a.Graphic3D);b.prototype.buildPrimitives=function(){f=this.evaluator;this.updateMVMatrix();e=f.eval(this.expresion);d=e[0][0];r=e[0][1];m=e[0][2];this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(d,r,m,1))],type:"vertex",backColor:this.backcolor.getColor(),frontColor:this.color.getColor(),size:f.eval(this.width)}));""!==this.text&&
(this.offset_dist=this.offset_dist||f.parser.parse("10"),this.offset_angle=this.offset_angle||f.parser.parse("270"),this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(d,r,m,1))],type:"text",fromPoint:!0,frontColor:this.color.getColor(),font_size:this.font_size,font_style:this.font_style,font_family:this.font_family,decimals:f.eval(this.decimals),fixed:this.fixed,evaluator:f,text:new a.TextObject(this,this.text),family:this.family,familyValue:this.familyValue,offset_dist:this.offset_dist,
offset_angle:this.offset_angle},this.space)))};a.Point3D=b;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h,g,l,q=function(c,b){b=a.Graphic3D.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("1");return b};$jscomp.inherits(q,a.Graphic3D);q.prototype.buildPrimitives=function(){g=this.evaluator;this.updateMVMatrix();h=g.getVariable("u");g.setVariable("u",this.Nu);l=g.eval(this.expresion);f=l[0][0];e=l[0][1];d=l[0][2];r=l[1][0];m=l[1][1];b=l[1][2];this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(f,
e,d,1)),this.transformVertex(new a.Vector4D(r,m,b,1))],type:"edge",lineDash:this.lineDash,frontColor:this.color.getColor(),lineWidth:g.eval(this.width)},this.space));g.setVariable("u",h)};a.Segment3D=q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h,g,l,q,c,u,k,w,p=function(c,b){b=a.Graphic3D.call(this,c,b)||this;b.parameter=b.parameter||"t";b.parameter_interval=b.parameter_interval||c.evaluator.parser.parse("[0,1]");b.parameter_steps=b.parameter_steps||c.evaluator.parser.parse("8");b.expresion=b.parseExpression();return b};$jscomp.inherits(p,a.Graphic3D);p.prototype.buildPrimitives=function(){f=this.evaluator;this.updateMVMatrix();r=f.getVariable("x");m=f.getVariable("y");b=f.getVariable("z");
e=f.getVariable("u");d=f.getVariable("v");f.setVariable("u",0);f.setVariable("v",0);h=parseInt(f.eval(this.Nu));g=parseInt(f.eval(this.Nv));l=[];for(c=0;c<=h;c++)for(f.setVariable("u",c/h),u=0;u<=g;u++){f.setVariable("v",u/g);k=0;for(w=this.expresion.length;k<w;k++)f.eval(this.expresion[k]);l.push(this.transformVertex(new a.Vector4D(f.getVariable("x"),f.getVariable("y"),f.getVariable("z"),1)))}var p=this.color.getColor(),n=this.backcolor.getColor(),z=this.edges?this.edges.getColor():"";for(c=0;c<
h;c++)for(u=0;u<g;u++)q=[],q.push(l[u+c*g+c]),q.push(l[u+1+c*g+c]),q.push(l[u+2+(c+1)*g+c]),q.push(l[u+1+(c+1)*g+c]),this.primitives.push(new a.Primitive3D({vertices:q,type:"face",frontColor:p,backColor:n,edges:z,model:this.model},this.space));f.setVariable("x",r);f.setVariable("y",m);f.setVariable("z",b);f.setVariable("u",e);f.setVariable("v",d)};a.Surface3D=p;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h,g,l=function(b,c){c=a.Graphic3D.call(this,b,c)||this;c.width=c.width||b.evaluator.parser.parse("1");return c};$jscomp.inherits(l,a.Graphic3D);l.prototype.buildPrimitives=function(){h=this.evaluator;this.updateMVMatrix();g=h.eval(this.expresion);for(var l=this.color.getColor(),c=0,u=g.length-1;c<u;c++)f=g[c][0],e=g[c][1],d=g[c][2],r=g[c+1][0],m=g[c+1][1],b=g[c+1][2],this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(f,
e,d,1)),this.transformVertex(new a.Vector4D(r,m,b,1))],type:"edge",frontColor:l,lineWidth:h.eval(this.width)},this.space))};a.Polygon3D=l;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h,g=function(b,d){d=a.Graphic3D.call(this,b,d)||this;d.width=d.width||b.evaluator.parser.parse("1");d.expresion=d.parseExpression();return d};$jscomp.inherits(g,a.Graphic3D);g.prototype.buildPrimitives=function(){h=this.evaluator;this.updateMVMatrix();r=h.getVariable("x");m=h.getVariable("y");b=h.getVariable("z");d=h.getVariable("u");h.setVariable("u",0);e=h.eval(this.Nu);f=[];for(var g=0;g<=e;g++){h.setVariable("u",g/e);for(var q=0,c=
this.expresion.length;q<c;q++)h.eval(this.expresion[q]);f.push(this.transformVertex(new a.Vector4D(h.getVariable("x"),h.getVariable("y"),h.getVariable("z"),1)))}g=0;for(q=f.length-1;g<q;g++)this.primitives.push(new a.Primitive3D({vertices:[f[g],f[g+1]],type:"edge",frontColor:this.color.getColor(),lineWidth:h.eval(this.width)},this.space));this.fill&&2<f.length&&this.primitives.push(new a.Primitive3D({vertices:f,type:"face",frontColor:this.fill.getColor(),backColor:this.fill.getColor(),edges:"",model:this.model},
this.space));h.setVariable("x",r);h.setVariable("y",b);h.setVariable("z",m);h.setVariable("u",d)};a.Curve3D=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h,g,l,q,c,u=function(c,b){return a.Graphic3D.call(this,c,b)||this};$jscomp.inherits(u,a.Graphic3D);u.prototype.buildPrimitives=function(){q=this.evaluator;this.updateMVMatrix();c=q.eval(this.expresion);f=c[0][0];e=c[0][1];d=c[0][2];r=c[1][0];m=c[1][1];b=c[1][2];h=c[2][0];g=c[2][1];l=c[2][2];var k=this.edges?this.edges.getColor():"";this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(f,e,d,1)),this.transformVertex(new a.Vector4D(h,
g,l,1)),this.transformVertex(new a.Vector4D(r,m,b,1))],type:"face",frontColor:this.color.getColor(),backColor:this.backcolor.getColor(),edges:k,model:this.model},this.space))};a.Triangle3D=u;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r=function(d,b){return a.Graphic3D.call(this,d,b)||this};$jscomp.inherits(r,a.Graphic3D);r.prototype.buildPrimitives=function(){e=this.evaluator;this.updateMVMatrix();d=e.eval(this.expresion);f=[];for(var m=d.length-1;0<=m;m--)f.push(this.transformVertex(new a.Vector4D(d[m][0],d[m][1],d[m][2],1)));m=this.edges?this.edges.getColor():"";this.primitives.push(new a.Primitive3D({vertices:f,type:"face",frontColor:this.color.getColor(),backColor:this.backcolor.getColor(),
edges:m,model:this.model},this.space))};a.Face3D=r;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h=function(b,d){d=a.Graphic3D.call(this,b,d)||this;d.width=d.width||b.evaluator.parser.parse("2");d.length=d.length||b.evaluator.parser.parse("2");return d};$jscomp.inherits(h,a.Graphic3D);h.prototype.buildPrimitives=function(){b=this.evaluator;this.updateMVMatrix();f=b.eval(this.Nu);e=[this.transformVertex(new a.Vector4D(0,0,0,1))];d=b.eval(this.width)/2;r=b.eval(this.length)/2;m=2*Math.PI/f;for(var g=0;g<f;g++)e.push(this.transformVertex(new a.Vector4D(d*
Math.cos(m*g),r*Math.sin(m*g),0,1)));var l=this.color.getColor(),h=this.backcolor.getColor(),c=this.edges?this.edges.getColor():"";for(g=0;g<f;g++)this.primitives.push(new a.Primitive3D({vertices:[e[0],g+2<=f?e[g+2]:e[1],e[g+1]],type:"face",frontColor:l,backColor:h,edges:c,model:this.model},this.space))};a.Polireg3D=h;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m=function(b,d){return a.Graphic3D.call(this,b,d)||this};$jscomp.inherits(m,a.Graphic3D);m.prototype.buildPrimitives=function(){f=this.evaluator;e=f.eval(this.expresion);d=e[0][0];r=e[0][1];this.primitives.push(new a.Primitive3D({vertices:[new a.Vector4D(d,r,0,1)],type:"text",frontColor:this.color.getColor(),font_size:this.font_size,font_style:this.font_style,font_family:this.font_family,decimals:f.eval(this.decimals),fixed:this.fixed,displace:0,
isText:!0,evaluator:f,text:new a.TextObject(this,this.text),family:this.family,familyValue:this.familyValue},this.space))};a.Text3D=m;return a}(descartesJS||{});
descartesJS=function(a,f){if(a.loadLib)return a;var e=new String("-point-segment-polygon-curve-triangle-face-polireg-surface-text-cube-box-tetrahedron-octahedron-sphere-dodecahedron-icosahedron-ellipsoid-cone-cylinder-torus-mesh-macro-"),d=/[\w\.\-//]*(\.png|\.jpg|\.gif|\.svg)/gi,r,m,b=0,h=function(g,l){var h=a.Graphic.call(this,g,l)||this;h.expresion=h.expresion||void 0;h.inirot=h.inirot||"(0,0,0)";h.inirotEuler=h.inirotEuler||!1;h.inipos=h.inipos||g.evaluator.parser.parse("(0,0,0)");h.endrot=h.endrot||
"(0,0,0)";h.endrotEuler=h.endrotEuler||!1;h.endpos=h.endpos||g.evaluator.parser.parse("(0,0,0)");h.name=h.name||"_descartes_empty_name_"+b++;Object.assign(h,l);h.inirot.match("Euler")&&(h.inirot=h.inirot.replace("Euler",""),h.inirotEuler=!0);h.endrot.match("Euler")&&(h.endrot=h.endrot.replace("Euler",""),h.endrotEuler=!0);h.inirot=h.evaluator.parser.parse(h.inirot);h.endrot=h.evaluator.parser.parse(h.endrot);h.inirotM=new a.Matrix4x4;h.inirotM_X=new a.Matrix4x4;h.inirotM_Y=new a.Matrix4x4;h.inirotM_Z=
new a.Matrix4x4;h.iniposM=new a.Matrix4x4;h.endrotM=new a.Matrix4x4;h.endrotM_X=new a.Matrix4x4;h.endrotM_Y=new a.Matrix4x4;h.endrotM_Z=new a.Matrix4x4;h.endposM=new a.Matrix4x4;h.graphics=[];g=g.lessonParser;var c=new a.Tokenizer;if(void 0==h.expresion)return h;"'"!==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 u=(u=document.getElementById(l))&&"descartes/macro"==u.type?u.text:a.openExternalFile(l);
if(u){var k=a.convertHTMLEntities(u).replace(/\r/g,"").split("\n");u=[];l=0;for(var m=k.length;l<m;l++){var p=k[l].indexOf("=");if(-1!==p){p=g.split(k[l]);for(var v=0,n=p.length;v<n;v++)if(p[v]&&1<p.length&&("id"===f[p[v][0]]||"type"===f[p[v][0]])){u.push(p);break}}}l=0;for(m=u.length;l<m;l++){n=(v=u[l]||[],v[0])&&"id"===v[0][0];var r=!1;k=0;for(p=v.length;k<p;k++){var x=v[k][0].indexOf(".");-1===x||n?x=f[v[k][0]]:(x=f[v[k][0].substring(x+1)],v[k][0]=h.name+"."+v[k][0]);"type"===x&&"surface"===f[v[k][1]]&&
(r=!0);if(!("font"===x||"font_family"===x||("fill"===x||"color"===x||"backcolor"===x||"arrow"===x)&&"("!==v[k][1].charAt(0)||"file"===x&&v[k][1].match(d)||"id"!==x&&void 0!==f[v[k][1]]||r&&"expresion"===x)||"width"===x||"height"===x||"length"===x)if("text"==x)if(v[k][1].match(/\{\\rtf1/)){x=v[k][1];var y=h;var B=function(b,d){d=c.tokenize(d.replace(/&squot;/g,"'"));for(var k=0,n=d.length;k<n;k++)"identifier"!=d[k].type||a.reservedIds.match("-"+d[k].value+"-")||(d[k].value=y.name+"."+d[k].value);return(b.match(/^\\expr/)?
"\\expr ":"\\decimals ")+c.flatTokens(d)};x=x.replace(/\\expr ([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,B);x=x.replace(/\\decimals ([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,B);v[k][1]=x}else{B=g.parseText(v[k][1]).textElementsMacros;for(var E=0,J=B.length;E<J;E++){x=c.tokenize(B[E].replace(/&squot;/g,"'"));for(var G=0,H=x.length;G<H;G++)"identifier"!==x[G].type||a.reservedIds.match("-"+x[G].value+"-")||(x[G].value=h.name+"."+x[G].value);x=c.flatTokens(x).replace(/&squot;/g,"'").replace(/'\+\(/g,
"[").replace(/\)\+'/g,"]");B[E]=x.substring(1,x.length-1)}v[k][1]=B.join("")}else{B=v[k][1].replace(/&squot;/g,"'").split(";");E=0;for(J=B.length;E<J;E++){x=c.tokenize(B[E].replace(/\\n/g,";"));G=0;for(H=x.length;G<H;G++)"identifier"!==x[G].type||a.reservedIds.match("-"+x[G].value+"-")||(x[G].value=h.name+"."+x[G].value);B[E]=c.flatTokens(x)}v[k][1]=B.join(";")}}}l=0;for(m=u.length;l<m;l++)if(u[l][0]){v="";n=!1;k=0;for(p=u[l].length;k<p;k++)"type"===f[u[l][k][0]]&&e.match("-"+f[u[l][k][1]]+"-")&&
(n=!0),v=v+u[l][k][0]+"='"+u[l][k][1]+"' ";u[l]=v+(n?" space='"+h.spaceID+"'":"");n?h.graphics.push(g.parse3DGraphic(u[l],h.abs_coord,h.background,h.inirot)):g.parseAuxiliar(u[l])}}l=0;for(m=h.graphics.length;l<m;l++)h.graphics[l].macroChildren=!0;return h};$jscomp.inherits(h,a.Graphic);h.prototype.buildFamilyPrimitives=function(){evaluator=this.evaluator;this.getFamilyValues();var a=evaluator.getVariable(this.family);if(0<=this.fSteps)for(var b=0,d=this.fSteps;b<=d;b++)evaluator.setVariable(this.family,
this.familyInf+b*this.family_sep),this.familyValue=this.familyInf+b*this.family_sep,evaluator.eval(this.drawif)&&this.updateMacro();evaluator.setVariable(this.family,a)};h.prototype.update=function(){this.primitives=[];this.evaluator.eval(this.drawif)&&(this.family||this.updateMacro());this.family&&this.buildFamilyPrimitives()};h.prototype.updateMacro=function(){this.updateTransformation();if(this.inipos){var a=this.evaluator.eval(this.inipos);this.iniPosX=a[0][0];this.iniPosY=a[0][1]}a=0;for(var b=
this.graphics.length;a<b;a++)r=this.graphics[a],r.macro_inirotEuler=this.inirotEuler,r.macro_inirotM=this.inirotM,r.macro_inirotM_X=this.inirotM_X,r.macro_inirotM_Y=this.inirotM_Y,r.macro_inirotM_Z=this.inirotM_Z,r.macro_iniposM=this.iniposM,r.macro_endrotEuler=this.endrotEuler,r.macro_endrotM=this.endrotM,r.macro_endrotM_X=this.endrotM_X,r.macro_endrotM_Y=this.endrotM_Y,r.macro_endrotM_Z=this.endrotM_Z,r.macro_endposM=this.endposM,r.update();a=0;for(b=this.graphics.length;a<b;a++){r=this.graphics[a];
if(r.split||this.split)for(var d=a+1;d<b;d++)m=this.graphics[d],(m.split||this.split)&&r.splitFace(m);this.primitives=this.primitives.concat(r.primitives||[])}};h.prototype.updateTransformation=function(){tmpExpr=this.evaluator.eval(this.inirot);this.inirotEuler?(this.inirotM=this.inirotM.setIdentity(),this.inirotM=this.inirotM.rotateZ(a.degToRad(tmpExpr[0][0])),this.inirotM=this.inirotM.rotateX(a.degToRad(tmpExpr[0][1])),this.inirotM=this.inirotM.rotateZ(a.degToRad(tmpExpr[0][2]))):(this.inirotM_X=
this.inirotM_X.setIdentity().rotateX(a.degToRad(tmpExpr[0][0])),this.inirotM_Y=this.inirotM_Y.setIdentity().rotateY(a.degToRad(tmpExpr[0][1])),this.inirotM_Z=this.inirotM_Z.setIdentity().rotateZ(a.degToRad(tmpExpr[0][2])));tmpExpr=this.evaluator.eval(this.inipos);translate={x:tmpExpr[0][0],y:tmpExpr[0][1],z:tmpExpr[0][2]};this.iniposM=this.iniposM.setIdentity().translate(translate);tmpExpr=this.evaluator.eval(this.endrot);this.endrotEuler?(this.endrotM=this.endrotM.setIdentity(),this.endrotM=this.endrotM.rotateZ(a.degToRad(tmpExpr[0][0])),
this.endrotM=this.endrotM.rotateX(a.degToRad(tmpExpr[0][1])),this.endrotM=this.endrotM.rotateZ(a.degToRad(tmpExpr[0][2]))):(this.endrotM_X=this.endrotM_X.setIdentity().rotateX(a.degToRad(tmpExpr[0][0])),this.endrotM_Y=this.endrotM_Y.setIdentity().rotateY(a.degToRad(tmpExpr[0][1])),this.endrotM_Z=this.endrotM_Z.setIdentity().rotateZ(a.degToRad(tmpExpr[0][2])));tmpExpr=this.evaluator.eval(this.endpos);translate={x:tmpExpr[0][0],y:tmpExpr[0][1],z:tmpExpr[0][2]};this.endposM=this.endposM.setIdentity().translate(translate)};
h.prototype.drawAux=function(a){};a.Macro3D=h;return a}(descartesJS||{},babel);
descartesJS=function(a){function f(a,c,b,d,k){e.call(this,a/v,a/v,a/v,d,k)}function e(a,c,b,d,k){a/=2;c/=2;b/=2;this.changeGeometry(a,c,b,d,k)||(this.vertices=[new n(a,b,c,1),new n(a,-b,c,1),new n(a,b,-c,1),new n(a,-b,-c,1),new n(-a,b,c,1),new n(-a,-b,c,1),new n(-a,b,-c,1),new n(-a,-b,-c,1)],this.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]],this.updateValues(a,c,b,d,k))}function d(a,c,b,d,k){a/=2;if(!this.changeGeometry(a,c,b,d,k)){var g=2*Math.PI/3,e=2*a*Math.sqrt(2)/3,f=-a/
3,l=e*Math.cos(g)+0*Math.sin(g);g=-e*Math.sin(g)+0*Math.cos(g);this.vertices=[new n(0,0,a,1),new n(l,g,f,1),new n(l,-g,f,1),new n(e,0,f,1)];this.faces=[[1,3,2],[0,1,2],[0,2,3],[0,3,1]];this.updateValues(a,c,b,d,k)}}function r(a,c,b,d,k){a/=2;this.changeGeometry(a,c,b,d,k)||(this.vertices=[new n(0,0,a,1),new n(a,0,0,1),new n(-a,0,0,1),new n(0,a,0,1),new n(0,-a,0,1),new n(0,0,-a,1)],this.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]],this.updateValues(a,c,b,d,k))}function m(c,
b,d,k,g){c/=Math.PI;if(!this.changeGeometry(c,b,d,k,g)){I=c/1.6180339887;C=1.6180339887*c;this.vertices=[new n(c,c,c,1),new n(c,c,-c,1),new n(c,-c,c,1),new n(c,-c,-c,1),new n(-c,c,c,1),new n(-c,c,-c,1),new n(-c,-c,c,1),new n(-c,-c,-c,1),new n(0,I,C,1),new n(0,I,-C,1),new n(0,-I,C,1),new n(0,-I,-C,1),new n(I,C,0,1),new n(I,-C,0,1),new n(-I,C,0,1),new n(-I,-C,0,1),new n(C,0,I,1),new n(C,0,-I,1),new n(-C,0,I,1),new n(-C,0,-I,1)];M=(new a.Matrix4x4).setIdentity().rotateY(-w/6);F=0;for(D=this.vertices.length;F<
D;F++)this.vertices[F]=M.multiplyVector4(this.vertices[F]);this.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]];this.updateValues(c,b,d,k,g)}}function b(c,b,d,k,g){c/=3.8;if(!this.changeGeometry(c,b,d,k,g)){C=1.6180339887*c;this.vertices=[new n(0,c,C,1),new n(0,c,-C,1),new n(0,-c,C,1),new n(0,-c,-C,1),new n(c,C,0,1),new n(c,-C,0,1),new n(-c,C,0,1),new n(-c,-C,0,1),
new n(C,0,c,1),new n(C,0,-c,1),new n(-C,0,c,1),new n(-C,0,-c,1)];this.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]];M=(new a.Matrix4x4).setIdentity().rotateY(-1.0285);F=0;for(D=this.vertices.length;F<D;F++)this.vertices[F]=M.multiplyVector4(this.vertices[F]);this.updateValues(c,b,d,k,g)}}function h(a,c,b,d,g){a/=2;this.isSphere?b=c=a:(c/=2,b/=2);if(!this.changeGeometry(a,
c,b,d,g)){this.vertices=[new n(0,0,c,1)];for(F=1;F<d;F++)for(G=F*w/d,K=0;K<g;K++)J=K*p/g,y=a*u(G)*k(J),B=b*u(G)*u(J),E=c*k(G),this.vertices.push(new n(y,B,E,1));this.vertices.push(new n(0,0,-c,1));this.faces=[];for(F=0;F<g;F++)this.faces.push([0,(F+1)%g+1,F%g+1]);for(F=1;F<d-1;F++)for(K=0;K<g;K++)this.faces.push([K+1+(F-1)*g,(K+1)%g+1+(F-1)*g,(K+1)%g+1+F*g,K+1+F*g]);for(F=0;F<g;F++)this.faces.push([this.vertices.length-1,this.vertices.length-1-g+F,this.vertices.length-1-g+(F+1)%g]);this.updateValues(a,
c,b,d,g)}}function g(a,c,b,d,g){a/=2;c/=2;b/=2;if(!this.changeGeometry(a,c,b,d,g)){this.vertices=[];for(F=0;F<g;F++)for(K=0;K<d;K++)y=a*(g-F)/g*k(K*p/d),B=b*(g-F)/g*u(K*p/d),E=c-2*F*c/g,this.vertices.push(new n(y,B,E,1));this.vertices.push(new n(0,0,-c,1));this.faces=[];for(F=0;F<g-1;F++)for(K=0;K<d;K++)this.faces.push([K+F*d,(K+1)%d+F*d,(K+1)%d+(F+1)*d,K+(F+1)*d]);for(F=0;F<d;F++)this.faces.push([this.vertices.length-1,this.vertices.length-1-d+F,this.vertices.length-1-d+(F+1)%d]);this.updateValues(a,
c,b,d,g)}}function l(a,c,b,d,g){a/=2;c/=2;b/=2;if(!this.changeGeometry(a,c,b,d,g)){this.vertices=[];for(F=0;F<g+1;F++)for(K=0;K<d;K++)y=a*k(K*p/d),B=b*u(K*p/d),E=c-2*F*c/g,this.vertices.push(new n(y,B,E,1));this.faces=[];for(F=0;F<g;F++)for(K=0;K<d;K++)this.faces.push([K+F*d,(K+1)%d+F*d,(K+1)%d+(F+1)*d,K+(F+1)*d]);this.updateValues(a,c,b,d,g)}}function q(a,c,b,d,g){a/=2;c/=2;b/=2;H=z.eval(this.R);A=z.eval(this.r);if(!this.changeGeometry(a,c,b,d,g)){this.vertices=[];for(F=0;F<g+1;F++)for(K=0;K<d;K++)y=
-(H+A*u(p*K/d))*u(p*F/g),B=(H+A*u(p*K/d))*k(p*F/g),E=A*k(p*K/d),this.vertices.push(new n(y,B,E,1));this.faces=[];for(F=0;F<g;F++)for(K=0;K<d;K++)this.faces.push([K+F*d,K+(F+1)*d,(K+1)%d+(F+1)*d,(K+1)%d+F*d]);this.updateValues(a,c,b,d,g)}}function c(){this.vertices=[];this.faces=[];F=0;for(D=this.fileData.length;F<D;F++)N=this.fileData[F],N.match(/^V\(/)?(O=N.substring(2,N.length-1).split(",").map(parseFloats),this.vertices.push(new n(O[0]||0,O[1]||0,O[2]||0,1))):N.match(/^F\(/)&&(O=N.substring(2,
N.length-1).split(",").map(parseInt),this.faces.push(O.reverse()))}if(a.loadLib)return a;var u=Math.sin,k=Math.cos,w=Math.PI,p=2*w,v=Math.sqrt(3),n,z,x,y,B,E,J,G,H,A,I,C,M,N,O,F,D,K,L,P=function(k,p){p=a.Graphic3D.call(this,k,p)||this;p.width=p.width||k.evaluator.parser.parse("2");p.height=p.height||k.evaluator.parser.parse("2");p.length=p.length||k.evaluator.parser.parse("2");p.R=p.R||k.evaluator.parser.parse("2");p.r=p.r||k.evaluator.parser.parse("1");n=a.Vector4D;switch(p.subType){case "cube":p.buildGeometry=
f;break;case "box":p.buildGeometry=e;break;case "tetrahedron":p.buildGeometry=d;break;case "octahedron":p.buildGeometry=r;break;case "sphere":p.isSphere=!0;case "ellipsoid":p.buildGeometry=h;break;case "dodecahedron":p.buildGeometry=m;break;case "icosahedron":p.buildGeometry=b;break;case "cone":p.buildGeometry=g;break;case "cylinder":p.buildGeometry=l;break;case "torus":p.buildGeometry=q;break;case "mesh":p.fileData=a.openExternalFile(p.evaluator.eval(p.file)).split(/\r/),p.buildGeometry=c}return p};
$jscomp.inherits(P,a.Graphic3D);P.prototype.buildPrimitives=function(){z=this.evaluator;this.updateMVMatrix();this.buildGeometry(z.eval(this.width),z.eval(this.height),z.eval(this.length),z.eval(this.Nu),z.eval(this.Nv));var c=this.color.getColor(),b=this.backcolor.getColor(),d=this.edges?this.edges.getColor():"";F=0;for(D=this.faces.length;F<D;F++){x=[];K=0;for(L=this.faces[F].length;K<L;K++)x.push(this.transformVertex(this.vertices[this.faces[F][K]]));this.primitives.push(new a.Primitive3D({vertices:x,
type:"face",frontColor:c,backColor:b,edges:d,model:this.model},this.space))}};P.prototype.changeGeometry=function(a,c,b,d,k){return this.oldWidth===a&&this.oldHeight===c&&this.oldLength===b&&this.oldNu===d&&this.oldNv===k};P.prototype.updateValues=function(a,c,b,d,k){this.oldWidth=a;this.oldHeight=c;this.oldLength=b;this.oldNv=k;this.oldNu=d};a.OtherGeometry3D=P;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.max,e=Math.min,d=Math.PI,r=Math.cos,m=Math.sin,b=Math.abs,h=Math.round,g,l,q,c,u,k,w,p,v,n,z,x,y,B,E,J,G,H,A=function(a,c){this.x=void 0===a?0:a;this.y=void 0===c?0:c};A.prototype.set=function(a,c){this.x=void 0===a?0:a;this.y=void 0===c?0:c;return this};A.prototype.copy=function(){return new A(this.x,this.y)};A.prototype.ix=function(){return h(f(e(this.x,32E3),-32E3))};A.prototype.iy=function(){return h(f(e(this.y,32E3),-32E3))};A.prototype.equals=
function(a){return this.x===a.x&&this.y===a.y};A.prototype.norm2=function(){return this.x*this.x+this.y*this.y};A.prototype.norm=function(){return Math.sqrt(this.norm2())};A.prototype.distance=function(a){l=this.copy();l.sub(a);return l.norm()};A.prototype.dot=function(a){return this.x*a.x+this.y*a.y};A.prototype.det=function(a){return this.x*a.y-this.y*a.x};A.prototype.mul=function(a){this.x*=a;this.y*=a};A.prototype.div=function(a){this.x/=a;this.y/=a};A.prototype.add=function(a){this.x+=a.x;this.y+=
a.y};A.prototype.sub=function(a){this.x-=a.x;this.y-=a.y};A.prototype.normalize=function(){g=this.norm();0!=g&&this.div(g)};A.prototype.rotR90=function(){g=this.x;this.x=this.y;this.y=-g};A.prototype.rotL90=function(){g=this.x;this.x=-this.y;this.y=g};A.prototype.rot=function(a){q=this.copy();k=r(a);w=m(a);this.x=q.x*k-q.y*w;this.y=q.x*w+q.y*k};A.prototype.rot2=function(a){this.rot(a*d/180)};A.prototype.intersection=function(a,d,k,g){p=d.x-a.x;v=k.x-g.x;n=k.x-a.x;z=d.y-a.y;x=k.y-g.y;y=k.y-a.y;H=p*
x-v*z;return 1E-6<b(H)?(c=(n*x-y*v)/H,u=(-n*z+y*p)/H,0<=c&&1>=c&&0<=u&&1>=u?new A(a.x+p*c,a.y+z*c):null):(d.x-k.x)*y!=(d.y-k.y)*n?null:a.x!=d.x?(B=e(a.x,d.x),E=f(a.x,d.x),B<=k.x&&k.x<=E?k:B<=g.x&&g.x<=E?g:null):k.x!=g.x?(J=e(k.x,g.x),G=f(k.x,g.x),J<=a.x&&a.x<=G?a:J<=d.x&&d.x<=G?d:null):a.y!=d.y?(B=e(a.y,d.y),E=f(a.y,d.y),B<=k.y&&k.y<=E?k:B<=g.y&&g.y<=E?g:null):k.y!=g.y?(J=e(k.y,g.y),G=f(k.y,g.y),J<=a.y&&a.y<=G?a:J<=d.y&&d.y<=G?d:null):a.x==k.x&&a.y==k.y?a:null};a.R2=A;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h,g,l,q=function(c,d){this.evaluator=c;this.constraint=d;if("=="==this.constraint.value||"<"==this.constraint.value||"<="==this.constraint.value||">"==this.constraint.value||">="==this.constraint.value)this.sign="<"==this.constraint.value||"<="==this.constraint.value?"menor":">"==this.constraint.value||">="==this.constraint.value?"mayor":"igual",this.constraint=this.constraint.equalToMinus(),this.constraint=this.constraint.childs[0];b=
new a.R2(0,0);m=new a.R2(0,0);l=new a.R2(0,0)};q.prototype.getUnitNormal=function(){this.normal.normalize();return l.set(this.normal.x,this.normal.y)};q.prototype.gradient=function(a){f=this.evaluator;b.x=0;b.y=0;h=f.getVariable("x");g=f.getVariable("y");f.setVariable("x",a.x);f.setVariable("y",a.y);this.f0=f.eval(this.constraint);f.setVariable("x",f.getVariable("x")+1E-6);e=f.eval(this.constraint);b.x=(e-this.f0)/1E-6;b.x=isNaN(b.x)?Infinity:b.x;f.setVariable("x",f.getVariable("x")-1E-6);f.setVariable("y",
f.getVariable("y")+1E-6);e=f.eval(this.constraint);b.y=(e-this.f0)/1E-6;b.y=isNaN(b.y)?Infinity:b.y;f.setVariable("x",h);f.setVariable("y",g);return b};q.prototype.findZero=function(a,b,k){f=this.evaluator;m.x=a.x;m.y=a.y;h=f.getVariable("x");g=f.getVariable("y");f.setVariable("x",a.x);f.setVariable("y",a.y);this.f0=f.eval(this.constraint);if("menor"===this.sign&&0>=this.f0||"mayor"===this.sign&&0<=this.f0)return m;f.setVariable("x",h);f.setVariable("y",g);for(var c=0;16>c;c++)if(d=m.x,r=m.y,this.normal=
this.gradient(m),0!=this.normal.norm2()&&this.normal.mul(-this.f0/this.normal.norm2()),m.x=d+this.normal.x,m.y=r+this.normal.y,this.normal.norm()<b)return 0===this.normal.x&&0===this.normal.y&&(this.normal.x=m.x-a.x,this.normal.y=m.y-a.y),m;return k?m:null};a.R2Newton=q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(a,d){this.x=a;this.y=d};f.prototype.vectorLength=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};f.prototype.dotProduct=function(a){return this.x*a.x+this.y*a.y};f.prototype.angleBetweenVectors=function(a){return Math.acos(this.dotProduct(a)/(this.vectorLength()*a.vectorLength()))};f.AXIS_X=new f(1,0);f.AXIS_Y=new f(0,1);a.Vector2D=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.floor,e=Math.round,d,r,m,b,h,g,l,q,c,u,k,w,p,v=function(c,b){this.parent=c;this.evaluator=c.evaluator;var d=this.parser=c.evaluator.parser;this.id="GraphicControl"!==b.type?"C":"G";this.gui=this.type="";this.region="south";this.y=this.x=0;this.w="Video"!==b.type?100:350;this.h="Video"!==b.type?23:120;"GraphicControl"!==b.type&&"Audio"!==b.type&&"Video"!==b.type?"TextArea"!==b.type?this.expresion=d.parse("(0,0,100,23)"):(this.expresion=d.parse("(0,0,300,200)"),
this.w=300,this.h=200):this.expresion=d.parse("(0,0)");this.fixed=2!=this.parent.version?!1:!0;this.visible=!0;this.color=new a.Color(4>this.parent.version?"000000":"222222");this.colorInt=new a.Color("GraphicControl"!==b.type?"f0f8ff":"cc0022");this.font_size=4>this.parent.version?-1:d.parse("12");this.cID=this.msg_pos=this.Explanation=this.tooltip=this.parameter=this.action=this.underlined=this.italics=this.bold="";this.parameterFont=this.tooltipFont=this.ExplanationFont="Monospace 12px";this.drawif=
d.parse("1");this.activeif=d.parse("1");this.valueExpr=d.parse("0");this.decimals=d.parse("2");this.min=d.parse("-Infinity");this.max=d.parse("Infinity");this.incr=d.parse("0.1");this.exponentialif=this.discrete=!1;this.zIndex=-1;Object.assign(this,b);"Video"!==this.type&&"Audio"!==this.type||"interior"===this.region||(this.region="interior");void 0==this.name&&(this.name=2==this.parent.version?this.id:"_nada_");this.name="_._"==this.name||"_nada_"==this.name||"_void_"==this.name?"":this.name;b=this.evaluator.eval(this.expresion);
this.x=e(b[0][0]);this.y=e(b[0][1]);4==b[0].length&&(this.w=e(b[0][2]),this.h=e(b[0][3]));this.actionExec=c.lessonParser.parseAction(this)};v.prototype.init=function(){};v.prototype.update=function(){};v.prototype.draw=function(){};v.prototype.getContainer=function(){var a=this.parent.spaces;if("interior"===this.region)for(var c=0,b=a.length;c<b;c++){var d=a[c];if(d.id===this.spaceID)return d.addCtr(this),this.zIndex=d.zIndex,this.space=d,d.numericalControlContainer}else{if("external"===this.region)return this.parent.externalSpace.addCtr(this),
this.parent.externalSpace.container;if("scenario"===this.region)return this.cID?(this.expresion=this.evaluator.parser.parse("(0,-1000,"+this.w+","+this.h+")"),this.parent.stage.stageSpace.addCtr(this),this.zIndex=this.parent.stage.stageSpace.zIndex,this.parent.stage.stageSpace.numericalControlContainer):this.parent.externalSpace.container;if(/north|south|east|west/.test(this.region))return this.parent[this.region+"Space"].controls.push(this),this.parent[this.region+"Space"].container}a[0].addCtr(this);
this.zIndex=a[0].zIndex;return a[0].numericalControlContainer};v.prototype.addControlContainer=function(a){var c=this.getContainer();c.childNodes[0]?c.insertBefore(a,c.childNodes[0]):c.appendChild(a)};v.prototype.updatePositionAndSize=function(){m=b=h=g=!1;l=this.evaluator.eval(this.expresion);q=e(l[0][0]);m=e(this.x)!==q;this.x=q;q=e(l[0][1]);b=e(this.y)!==q;this.y=q;4===l[0].length&&(q=e(l[0][2]),h=e(this.w)!==q,this.w=q,q=e(l[0][3]),g=e(this.h)!==q,this.h=q);if(h||g||m||b)this.init(!0),this.draw()};
v.prototype.formatOutputValue=function(a){p=this.parent;c=a+"";u=this.evaluator.eval(this.decimals);k=c.indexOf(".");-1!=k&&(w=c.substring(k+1),w.length>u&&(c=parseFloat(c).toFixed(u)));this.fixed&&(2!==p.version||2===p.version&&!this.exponentialif)&&(c=parseFloat(a).toFixed(u));this.exponentialif&&0!=parseFloat(c)&&(c=this.fixed&&2!==p.version?parseFloat(c).toExponential(u):parseFloat(c).toExponential(),c=c.toUpperCase().replace("+",""));return c.replace(".",p.decimal_symbol)};v.prototype.updateAndExecAction=
function(){this.parent.updateControls();"init"===this.action&&(this.click=!1);this.actionExec.execute();this.parent.updateControls();"animate"!==this.action&&this.parent.update();this.parent.updateControls()};v.prototype.createGradient=function(a,c){this.linearGradient=this.ctx.createLinearGradient(0,0,0,c);d=c*c;for(a=0;a<c;a++)r=f(a-35*c/100),this.linearGradient.addColorStop(a/c,"rgba(0,0,0,"+r*r*192/d/255+")")};a.Control=v;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.floor,e=Math.abs,d=/[\w\.\-//]*(\.gif)/gi,r,m,b,h,g,l,q,c,u,k,w,p,v,n,z,x,y,B,E,J,G,H,A,I,C,M,N,O,F,D,K,L=function(c,b){var d=a.Control.call(this,c,b)||this;d.imageSrc=b.imageSrc||"";d.image=b.image||new Image;d.imageOver=b.imageOver||new Image;d.imageDown=b.imageDown||new Image;d.flat=b.flat||!1;d.borderColor=b.borderColor||!1;d.text_align=b.text_align||"center_center";d.image_align=b.image_align||"center_center";d.font_family=a.getFontName(b.font_family||
"arial");d.ratio=c.ratio;-1===d.font_size&&(d.fontSizeNotSet=!0);d.borderColor&&(d.borderColor=new a.Color(d.borderColor));d.text_align=d.text_align.split("_");d.image_align=d.image_align.split("_");d.name.match(/^\[.*\]?/)?d.name=d.parser.parse(d.name.substring(1,d.name.length-1)):d.name=d.parser.parse("'"+d.name+"'");d.classContainer=d.cssClass?" "+d.cssClass+" ":"";if(d.imageSrc.trim().match("^_STYLE_")){d.customStyle=!0;d.btnStyle=[];d.conStyle=[];d.conStyle.textBorder=3;c=d.imageSrc.trim().substring(8).split("|");
for(var k,g=0,n=c.length;g<n;g++)b=c[g],k=b.match(/rgb/g),b.match("class=")?d.classContainer=" "+b.substring(6):b.match("border=")?(d.btnStyle.push({type:"border-style",value:"solid"}),d.btnStyle.push({type:"border-width",value:b.substring(7).trim()+"px"})):b.match("borderRadius=")?(d.btnStyle.push({type:"border-radius",value:b.substring(13).trim()+"px"}),d.conStyle.push({type:"border-radius",value:b.substring(13).trim()+"px"})):b.match("borderColor=")?d.btnStyle.push({type:"border-color",value:(k?
"":"#")+b.substring(12).trim()}):b.match("overColor=")?d.conStyle.overColor=(k?"":"#")+b.substring(10).trim():b.match("downColor=")?d.conStyle.downColor=(k?"":"#")+b.substring(10).trim():b.match("font=")?d.conStyle.font=b.substring(5).trim().toLowerCase():b.match("inactiveColor=")?d.conStyle.inactiveColor=(k?"":"#")+b.substring(14).trim():b.match("inactiveColorBorder=")?d.conStyle.inactiveColorBorder=(k?"":"#")+b.substring(20).trim():b.match("shadowTextBlur=")?d.conStyle.shadowTextBlur=parseFloat(b.substring(15).trim()):
b.match("shadowTextOffsetX=")?d.conStyle.shadowTextOffsetX=parseFloat(b.substring(18).trim()):b.match("shadowTextOffsetY=")?d.conStyle.shadowTextOffsetY=parseFloat(b.substring(18).trim()):b.match("shadowTextColor=")?d.conStyle.shadowTextColor=(k?"":"#")+b.substring(16).trim():b.match("shadowBoxBlur=")?d.conStyle.shadowBoxBlur=parseFloat(b.substring(14).trim()):b.match("shadowBoxOffsetX=")?d.conStyle.shadowBoxOffsetX=parseFloat(b.substring(17).trim()):b.match("shadowBoxOffsetY=")?d.conStyle.shadowBoxOffsetY=
parseFloat(b.substring(17).trim()):b.match("shadowBoxColor=")?d.conStyle.shadowBoxColor=(k?"":"#")+b.substring(15).trim():b.match("shadowInsetBoxBlur=")?d.conStyle.shadowInsetBoxBlur=parseFloat(b.substring(19).trim()):b.match("shadowInsetBoxOffsetX=")?d.conStyle.shadowInsetBoxOffsetX=parseFloat(b.substring(22).trim()):b.match("shadowInsetBoxOffsetY=")?d.conStyle.shadowInsetBoxOffsetY=parseFloat(b.substring(22).trim()):b.match("shadowInsetBoxColor=")?d.conStyle.shadowInsetBoxColor=(k?"":"#")+b.substring(20).trim():
b.match("textBorder=")&&(d.conStyle.textBorder=parseFloat(b.substring(11).trim()));d.imageSrc="vacio.gif"}d.imageSrc.match("_COLORES_")&&(c=d.imageSrc.split("_"),d.colorInt=new a.Color(c[2]),d.color=new a.Color(c[3]),d.font_size=d.parser.parse(c[5]),d.imageSrc="");d.imageSrc.match(/^\[.*\]?/)?d.imageSrc=d.parser.parse(d.imageSrc.substring(1,d.imageSrc.length-1)):d.imageSrc=d.parser.parse("'"+d.imageSrc+"'");c=d.evaluator.eval(d.imageSrc).toString().trim();if(""!=c)if(b=c.substr(0,c.lastIndexOf(".")),
k=c.substr(c.lastIndexOf(".")),c.match(/vacio.gif$/i))d.imageSrc=d.parser.parse("'vacio.gif'"),d.image.ready=1,3===d.parent.version&&(d.name=d.parser.parse("")),d.emptyImage={ready:!0},d.parser.parse("'vacio.gif'");else if(d.image=d.parent.getImage(c),b)try{d.imageOver=d.parent.getImage(b+"_over"+k),d.imageDown=d.parent.getImage(b+"_down"+k)}catch(T){}d.container=a.newHTML("div",{class:"DescartesButtonContainer"+d.classContainer,id:d.id,style:"width:"+d.w+"px;height:"+d.h+"px;left:"+d.x+"px;top:"+
d.y+"px;z-index:"+d.zIndex+";"});d.btn=a.newHTML("canvas",{width:d.w*d.ratio,height:d.h*d.ratio,style:"position:absolute;left:0;top:0;width:"+d.w+"px;height:"+d.h+"px;"});d.ctx=d.btn.getContext("2d");d.ctx.imageSmoothingEnabled=!1;d.container.appendChild(d.btn);d.addControlContainer(d.container);d.addEvents();d.init();return d};$jscomp.inherits(L,a.Control);L.prototype.init=function(c){r=this.evaluator;x=this.container;m=this.btn;b=this.ctx;h=r.eval(this.expresion);this.x=h[0][0];this.y=h[0][1];4==
h[0].length&&(this.w=parseInt(h[0][2]),this.h=parseInt(h[0][3]));m.width=this.w*this.ratio;m.height=this.h*this.ratio;m.setAttribute("style","position:absolute;left:0;top:0;width:"+this.w+"px;height:"+this.h+"px;box-sizing:border-box;");x.setAttribute("style","width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+this.y+"px;z-index:"+this.zIndex+";display:block;");if(this.btnStyle)for(var d=0,k=this.btnStyle.length;d<k;d++)m.style[this.btnStyle[d].type]=this.btnStyle[d].value;if(this.conStyle){d=
0;for(k=this.conStyle.length;d<k;d++)x.style[this.conStyle[d].type]=this.conStyle[d].value;if(this.conStyle.shadowBoxColor){d=this.conStyle.shadowBoxOffsetX||0;k=this.conStyle.shadowBoxOffsetY||2;var g=this.conStyle.shadowBoxBlur||2;x.style.boxShadow=d+"px "+k+"px "+g+"px 1px "+this.conStyle.shadowBoxColor}this.conStyle.shadowInsetBoxColor&&(d=this.conStyle.shadowInsetBoxOffsetX||0,k=this.conStyle.shadowInsetBoxOffsetY||-2,g=this.conStyle.shadowInsetBoxBlur||1,m.style.boxShadow=d+"px "+k+"px "+g+
"px 1px "+this.conStyle.shadowInsetBoxColor+" inset");this.conStyle.shadowTextColor&&(b.shadowBlur=this.conStyle.shadowTextBlur||1,b.shadowOffsetX=this.conStyle.shadowTextOffsetX||0,b.shadowOffsetY=this.conStyle.shadowTextOffsetY||2,b.shadowColor=this.conStyle.shadowTextColor)}this.fontSizeNotSet&&(this.font_size=r.parser.parse(a.getFieldFontSize(this.h)+""));this.fs_evaluated=r.eval(this.font_size);this.createGradient(this.w,this.h);x.style.display=0<r.eval(this.drawif)?"block":"none";b.textAlign=
"center";b.textBaseline="middle";b.lineJoin="round";b.font=this.italics+" "+this.bold+" "+this.fs_evaluated+"px "+this.font_family;this.customStyle&&("serif"==this.conStyle.font?b.font=this.italics+" "+this.bold+" "+this.fs_evaluated+"px "+this.font_family:"monospace"==this.conStyle.font&&(b.font=this.italics+" "+this.bold+" "+this.fs_evaluated+"px "+a.monospace_font));this.draw(c)};L.prototype.update=function(){r=this.evaluator;x=this.container;m=this.btn;this.activeIfValue=0<r.eval(this.activeif);
this.drawIfValue=0<r.eval(this.drawif);(this.space?this.space.drawIfValue:1)&&this.drawIfValue?(x.style.display="block",this.draw(),x.style.cursor=m.style.cursor=this.activeIfValue?"pointer":"not-allowed",this.updatePositionAndSize()):(x.style.display="none",this.buttonClick=!1)};L.prototype.draw=function(e){x=this.container;r=this.evaluator;m=this.btn;b=this.ctx;l=r.eval(this.name);q=this.evaluator.eval(this.imageSrc).toString().trim();if(!e&&(y=this.over===this.oldOver,B=this.buttonClick===this.oldButtonClick,
E=this.activeIfValue===this.oldActiveIfValue,J=this.drawIfValue===this.oldDrawIfValue,G=l===this.oldName,H=q===this.oldImageSrc,A=this.colorInt.getColor()===this.oldBackColor,I=this.color.getColor()===this.oldTextColor,C=this.image.ready===this.oldImageReady,this.oldOver=this.over,this.oldButtonClick=this.buttonClick,this.oldActiveIfValue=this.activeIfValue,this.oldDrawIfValue=this.drawIfValue,this.oldName=l,this.oldImageSrc=q,this.oldBackColor=this.colorInt.getColor(),this.oldTextColor=this.color.getColor(),
this.oldImageReady=this.image.ready,y&&B&&E&&J&&G&&H&&A&&I&&C))return;b.save();b.setTransform(this.ratio,0,0,this.ratio,0,0);g=this.fs_evaluated;x.setAttribute("data-name",l);q?(c="vacio.gif"===q?this.emptyImage:this.parent.getImage(q),M=q.substr(0,q.lastIndexOf(".")),N=q.substr(q.lastIndexOf(".")),O=M+"_over"+N,F=M+"_down"+N,D="vacio.gif"===q?this.emptyImage:this.parent.getImage(O),K="vacio.gif"===q?this.emptyImage:this.parent.getImage(F)):K=D=c=this.emptyImage;b.clearRect(0,0,this.w,this.h);u=k=
0;this.buttonClick&&(u=k=1);"center"==this.text_align[1]?n=f(this.w/2+u)-.5:"left"==this.text_align[1]?(w=b.measureText(l).width,n=w/2+5+u):"right"==this.text_align[1]&&(w=b.measureText(l).width,n=this.w-w/2+u-5);"center"==this.text_align[0]?z=f(this.h/2+k)-.5:"top"==this.text_align[0]?z=g/2+k+4:"bottom"==this.text_align[0]&&(z=this.h-g/2+k-3);c&&("center"==this.image_align[1]?p=parseInt((this.w-c.width)/2)+u:"left"==this.image_align[1]?p=u:"right"==this.image_align[1]&&(p=this.w-c.width+u),"center"==
this.image_align[0]?v=parseInt((this.h-c.height)/2)+k:"top"==this.image_align[0]?v=k:"bottom"==this.image_align[0]&&(v=this.h-c.height+k));if(c&&c.ready)if(c!==this.emptyImage&&c.complete)if(q.match(d))this.btn.style.backgroundRepeat="no-repeat",this.btn.style.backgroundImage="url('"+q+"')",this.btn.style.backgroundPosition=p+"px "+v+"px";else{if("center"!=this.image_align[0]||"center"!=this.image_align[1])x.style.backgroundColor=this.colorInt.getColor();b.drawImage(c,p,v)}else this.emptyImage&&this.customStyle&&
(x.style.backgroundColor=this.colorInt.getColor());else x.style.backgroundColor=this.colorInt.getColor(),this.flat||(this.buttonClick||(a.drawLine(b,this.w-1,0,this.w-1,this.h,"rgba(0,0,0,0.5)"),a.drawLine(b,0,0,0,this.h,"rgba(0,0,0,0.09)"),a.drawLine(b,1,0,1,this.h,"rgba(0,0,0,0.03)")),b.fillStyle=this.linearGradient,b.fillRect(0,0,this.w,this.h));this.activeIfValue&&(D!==this.emptyImage&&this.over&&D.ready&&D.complete?O.match(d)?(this.btn.style.backgroundImage="url('"+O+"')",this.btn.style.backgroundPosition=
p+"px "+v+"px"):b.drawImage(D,p,v):this.customStyle&&this.conStyle.overColor&&this.over&&(x.style.backgroundColor=this.conStyle.overColor));this.activeIfValue?K!==this.emptyImage&&this.buttonClick&&K.ready&&K.complete?F.match(d)?(this.btn.style.backgroundImage="url('"+F+"')",this.btn.style.backgroundPosition=p+"px "+v+"px"):b.drawImage(K,p,v):this.customStyle&&this.conStyle.downColor&&this.buttonClick&&(x.style.backgroundColor=this.conStyle.downColor):this.buttonClick&&!c&&(b.fillStyle="rgba(0,0,0,0.09)",
b.fillRect(0,0,this.w,this.h));b.fillStyle=this.color.getColor();this.customStyle&&this.conStyle.shadowTextColor&&0<this.conStyle.textBorder&&(b.lineWidth=this.conStyle.textBorder,b.strokeStyle=this.conStyle.shadowTextColor,b.strokeText(l,n,z));this.borderColor&&(b.lineWidth=parseInt(g/6),b.strokeStyle=this.borderColor.getColor(),b.strokeText(l,n,z));b.fillText(l,n,z);this.underlined&&(w=b.measureText(l).width,b.strokeStyle=this.color.getColor(),b.lineWidth=f(g/10)||2,b.lineCap="round",b.beginPath(),
b.moveTo(n-w/2+u,z+f(g/2)+f(g/5)-1.5),b.lineTo(n+w/2+u,z+f(g/2)+f(g/5)-1.5),b.stroke());this.activeIfValue||(this.customStyle&&this.conStyle.inactiveColor?x.style.backgroundColor=this.conStyle.inactiveColor:(b.fillStyle="rgba(240,240,240,0.6)",b.fillRect(0,0,this.w,this.h)));b.restore();this._image_pos_x=p;this._image_pos_y=v};L.prototype.drawTextBorder=function(){this.colorInt.getColor();this.color.getColor();return!(.5>(e(this.colorInt.r-this.color.r)+e(this.colorInt.g-this.color.g)+e(this.colorInt.b-
this.color.b))/255)};L.prototype.buttonPressed=function(){this.updateAndExecAction()};L.prototype.addEvents=function(){function c(b,d,n){a.clearTimeout(g);k.buttonClick&&k.drawIfValue&&k.activeIfValue&&(d.call(k),b=n?b:100,g=a.setTimeout(function(){c(b,d,!1)},b))}function b(b){this.focus();b.preventDefault();b.stopPropagation();document.activeElement!=document.body&&document.activeElement.blur();k.whichBtn=a.whichBtn(b);"L"==k.whichBtn&&k.activeIfValue&&(k.buttonClick=!0,k.draw(),"calculate"==k.action&&
(k.evaluator.setVariable(k.id,k.evaluator.eval(k.valueExpr)),c(1E3,k.buttonPressed,!0)),k.btn.removeEventListener("touchend",d),k.btn.addEventListener("touchend",d),k.btn.removeEventListener("mouseup",d),k.btn.addEventListener("mouseup",d))}function d(c){a.newBlobContent=null;this.focus();c.preventDefault();c.stopPropagation();if(k.activeIfValue||k.buttonClick)k.buttonClick=!1,k.draw(),"calculate"!=k.action&&(k.evaluator.setVariable(k.id,k.evaluator.eval(k.valueExpr)),k.buttonPressed()),k.btn.removeEventListener("touchend",
d),k.btn.removeEventListener("mouseup",d);k.parent.update()}var k=this,g;k.btn.oncontextmenu=function(){return!1};this.over=this.buttonClick=!1;this.btn.addEventListener("touchstart",b);this.btn.addEventListener("mousedown",b);this.btn.addEventListener("mouseover",function(a){a.preventDefault();a.stopPropagation();k.over=!0;k.draw()});this.btn.addEventListener("mouseout",function(c){a.newBlobContent=null;c.preventDefault();c.stopPropagation();k.over=!1;k.buttonClick=!1;k.draw()});document.addEventListener("visibilitychange",
function(c){a.newBlobContent=null;k.buttonClick=!1})};a.Button=L;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h,g,l,q,c,u,k,w=function(b,d){b=a.Control.call(this,b,d)||this;b.flat=b.image_dec_src&&b.image_inc_src;b.btn_pos=b.btn_pos||"v_left";b.horizontal="h_left"===b.btn_pos||"h_right"===b.btn_pos||"h_left_right"===b.btn_pos;b.tabindex=++b.parent.tabindex;"_._"==b.name&&(b.name="");b.name.match(/^\[.*\]?/)?b.name=b.parser.parse(b.name.substring(1,b.name.length-1)):b.name=b.parser.parse("'"+b.name+"'");b.container=a.newHTML("div",{class:"DescartesSpinnerContainer",
id:b.id});b.divUp=a.newHTML("div",{class:"DJS_Up"});b.divDown=a.newHTML("div",{class:"DJS_Down"});b.field=a.newHTML("input",{type:"text",id:b.id+"_spinner",class:"DescartesSpinnerField",tabindex:b.tabindex});b.label=a.newHTML("label",{class:"DescartesSpinnerLabel"});b.container.appendChild(b.label);b.container.appendChild(b.field);b.container.appendChild(b.divUp);b.container.appendChild(b.divDown);b.addControlContainer(b.container);c=b.evaluator.parser.parse("1");b.originalIncr=b.incr;if(0>b.evaluator.eval(b.decimals)||
0===b.evaluator.eval(b.incr))d=b.evaluator.eval(b.incr),0<d?(b.incr=b.evaluator.parser.parse(parseInt(d).toString()),b.originalIncr=b.incr):b.incr=c;b.image_dec_src&&(b.image_dec_src.match(/^\[.*\]?/)?b.image_dec_src=b.parser.parse(b.image_dec_src.substring(1,b.image_dec_src.length-1)):b.image_dec_src=b.parser.parse("'"+b.image_dec_src+"'"),b.old_image_dec_src=b.evaluator.eval(b.image_dec_src).toString().trim(),b.image_dec=b.parent.getImage(b.old_image_dec_src));b.image_inc_src&&(b.image_inc_src.match(/^\[.*\]?/)?
b.image_inc_src=b.parser.parse(b.image_inc_src.substring(1,b.image_inc_src.length-1)):b.image_inc_src=b.parser.parse("'"+b.image_inc_src+"'"),b.old_image_inc_src=b.evaluator.eval(b.image_inc_src).toString().trim(),b.image_inc=b.parent.getImage(b.old_image_inc_src));b.addEvents();b.init();return b};$jscomp.inherits(w,a.Control);w.prototype.init=function(){f=this.evaluator;var c=f.eval(this.name).toString();this.label.innerHTML=c;this.value=this.validateValue(f.eval(this.valueExpr));var b=this.formatOutputValue(this.value);
this.fieldFontSize=2!==this.parent.version?a.getFieldFontSize(this.h):10;var d=2!==this.parent.version?"__":"_____",k=a.getTextWidth(b+"_",this.fieldFontSize+"px "+a.sansserif_font);if(this.horizontal){var g=parseInt(this.h),e=parseInt(this.w/2-g);d=a.getTextWidth(c+d,this.fieldFontSize+"px "+a.sansserif_font);this.visible||(e=this.w-2*g,k=0);e<d&&(e=d);""==c&&(e=0);this.w-e-g<k&&(e=this.w-g-k);0>e&&(e=0);c=this.w-(e+2*g);this.container.setAttribute("style","width:"+this.w+"px;height:"+this.h+"px;left:"+
this.x+"px;top:"+this.y+"px;z-index:"+this.zIndex+";background-color:transparent;");this.divUp.setAttribute("style","width:"+g+"px;height:"+g+"px;"+("h_left"===this.btn_pos?"left:"+(e+g):"right:0")+"px;top:0;"+(this.flat?"border-width:0;":""));this.divDown.setAttribute("style","width:"+g+"px;height:"+g+"px;left:"+(e+("h_right"===this.btn_pos?c:0))+"px;top:0;"+(this.flat?"border-width:0;":""));this.field.setAttribute("style","font-family:"+a.sansserif_font+";font-size:"+this.fieldFontSize+"px;width:"+
c+"px;height:"+this.h+"px;left:"+(g+e+("h_left"===this.btn_pos?g:"h_right"===this.btn_pos?-g:0))+"px;")}else g=2+parseInt(this.h/2),e=parseInt(this.w/2-g/2),d=a.getTextWidth(c+d,this.fieldFontSize+"px "+a.sansserif_font),this.visible||(e=this.w-g,k=0),e<d&&(e=d),""==c&&(e=0),this.w-e-g<k&&(e=this.w-g-k),0>e&&(e=0),c=this.w-(e+g),this.container.setAttribute("style","width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+this.y+"px;z-index:"+this.zIndex+";background-color:transparent;"),d="width:"+
g+"px;left:"+(e+("v_right"===this.btn_pos?c:0))+"px;",this.divUp.setAttribute("style",d+";height:"+(this.h/2+1)+"px;top:0;"+(this.flat?"border-width:0;":"")),this.divDown.setAttribute("style",d+";height:"+(this.h/2-1)+"px;top:"+(this.h/2+1)+"px;"+(this.flat?"border-width:0;":"")),this.field.setAttribute("style","font-family:"+a.sansserif_font+";font-size:"+this.fieldFontSize+"px;width:"+c+"px;height:"+this.h+"px;left:"+(("v_left"===this.btn_pos?g:0)+e)+"px;");this.field.value=b;this.visible||(this.field.style.display=
"none");this.label.setAttribute("style","font-size:"+this.fieldFontSize+"px;width:"+e+"px;height:"+this.h+"px;line-height:"+this.h+"px;");this.image_dec&&this.image_dec.ready&&(this.divDown.style["background-image"]="url("+this.image_dec.src+")");this.image_inc&&this.image_inc.ready&&(this.divUp.style["background-image"]="url("+this.image_inc.src+")");this.divUp.setAttribute("horizontal",this.horizontal?!0:!1);this.divDown.setAttribute("horizontal",this.horizontal?!0:!1);f.setVariable(this.id,this.value)};
w.prototype.update=function(){f=this.evaluator;this.label.innerHTML=f.eval(this.name).toString();0>f.eval(this.decimals)?(e=f.eval(this.incr),0<e?this.originalIncr=this.incr=f.parser.parse(parseInt(e).toString()):this.incr=c):this.incr=0!==f.eval(this.originalIncr)?this.originalIncr:c;this.activeIfValue=0<f.eval(this.activeif);this.drawIfValue=0<f.eval(this.drawif);this.field.disabled=!this.activeIfValue;this.divUp.setAttribute("active",!this.field.disabled);this.divDown.setAttribute("active",!this.field.disabled);
this.drawIfValue?(this.updateStyle(),this.container.style.display="block"):(this.click=!1,this.container.style.display="none");this.image_dec&&(u=this.evaluator.eval(this.image_dec_src).toString().trim(),this.old_image_dec_src!==u&&(this.divDown.style["background-image"]="url("+this.image_dec.src+")",this.old_image_dec_src=u));this.image_inc&&(k=this.evaluator.eval(this.image_inc_src).toString().trim(),this.old_image_inc_src!==k&&(this.divUp.style["background-image"]="url("+this.image_inc.src+")",
this.image_inc_src=k));this.updatePositionAndSize();this.parent.animation.playing&&document.activeElement==this.field||(d=this.field.value,r=this.value,this.value=this.validateValue(f.getVariable(this.id)),this.field.value=this.formatOutputValue(this.value),this.value==r&&this.field.value!=d&&(this.value=this.validateValue(d),this.field.value=this.formatOutputValue(this.value)),f.setVariable(this.id,this.value))};w.prototype.updateStyle=function(){this.divUp.style.borderStyle=this.up?"inset":"outset";
this.divUp.style.borderColor=this.up?"gray":"#f0f8ff";this.divUp.style.backgroundColor=this.up?"#bfbfbf":"";this.divUp.style.backgroundColor=this.flat?"transparent":this.divUp.style.backgroundColor;this.divUp.style.backgroundPosition=this.up?"calc(50% + 1px) calc(50% + 1px)":"center";this.divDown.style.borderStyle=this.down?"inset":"outset";this.divDown.style.borderColor=this.down?"gray":"#f0f8ff";this.divDown.style.backgroundColor=this.down?"#bfbfbf":"";this.divDown.style.backgroundColor=this.flat?
"transparent":this.divDown.style.backgroundColor;this.divDown.style.backgroundPosition=this.down?"calc(50% + 1px) calc(50% + 1px)":"center"};w.prototype.validateValue=function(a){f=this.evaluator;isNaN(parseFloat(a))||a.toString().match("e")&&(a=parseFloat(a).toFixed(20));a=void 0!=a?a.toString():"0";a=a.replace(this.parent.decimal_symbol,".");m=a==parseFloat(a)?parseFloat(a):parseFloat(f.eval(f.parser.parse(a)));isNaN(m)&&(m=0);g=f.eval(this.min);l=f.eval(this.max);""===g&&(g=-Infinity);""===l&&
(l=Infinity);m=Math.min(Math.max(m,g),l);this.discrete&&(b=f.eval(this.incr),m=0==b?0:b*Math.round(m/b));h=f.eval(this.decimals);0>=h&&(h=0);return m=parseFloat(parseFloat(m).toFixed(h))};w.prototype.increase=function(){this.changeValue(parseFloat(this.value)+this.evaluator.eval(this.incr))};w.prototype.decrease=function(){this.changeValue(parseFloat(this.value)-this.evaluator.eval(this.incr))};w.prototype.changeValue=function(a){this.activeIfValue&&(this.value=this.validateValue(a),this.field.value=
this.formatOutputValue(this.value),this.evaluator.setVariable(this.id,this.value),this.updateAndExecAction())};w.prototype.addEvents=function(){function c(b,d,k){a.clearTimeout(l);if(e.up||e.down)d.call(e),b=k?b:10,l=a.setTimeout(function(){c(b,d)},b)}function b(b){b.preventDefault();e.whichBtn=a.whichBtn(b);"L"==e.whichBtn&&e.activeIfValue&&(e.up=!0,c(f,e.increase,!0))}function d(b){b.preventDefault();e.whichBtn=a.whichBtn(b);"L"==e.whichBtn&&e.activeIfValue&&(e.down=!0,c(f,e.decrease,!0))}function k(c){e.up=
!1;a.clearTimeout(l);e.updateStyle()}function g(c){e.down=!1;a.clearTimeout(l);e.updateStyle()}q=a.hasTouchSupport;var e=this,f=q?500:200,l;e.divUp.oncontextmenu=e.divDown.oncontextmenu=e.field.oncontextmenu=e.label.oncontextmenu=function(){return!1};this.label.addEventListener("touchstart",a.preventDefault);this.label.addEventListener("mousedown",a.preventDefault);this.field.addEventListener("keydown",function(a){13==a.keyCode&&e.changeValue(e.field.value)});this.divUp.addEventListener("touchstart",
b);this.divUp.addEventListener("mousedown",b);this.divDown.addEventListener("touchstart",d);this.divDown.addEventListener("mousedown",d);this.divUp.addEventListener("mouseout",function(c){e.up=!1;a.clearTimeout(l);c.preventDefault();e.updateStyle()});this.divDown.addEventListener("mouseout",function(c){e.down=!1;a.clearTimeout(l);c.preventDefault();e.updateStyle()});this.divUp.addEventListener("touchend",k);window.addEventListener("touchend",k);this.divUp.addEventListener("mouseup",k);window.addEventListener("mouseup",
k);this.divDown.addEventListener("touchend",g);window.addEventListener("touchend",g);this.divDown.addEventListener("mouseup",g);window.addEventListener("mouseup",g);document.addEventListener("visibilitychange",function(c){e.up=!1;e.down=!1;a.clearTimeout(l);e.updateStyle()});e.field.addEventListener("click",function(a){this.focus()})};a.Spinner=w;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e=function(d,e){d=a.Control.call(this,d,e)||this;d.typeCtr="checkbox";d.pressed=e.pressed||!1;d.radio_group=(e.radio_group||"").trim();""!==d.radio_group&&(d.typeCtr="radio");d.name.match(/^\[.*\]?/)?d.name=d.parser.parse(d.name.substring(1,d.name.length-1)):d.name=d.parser.parse("'"+d.name.trim()+"'");d.tabindex=++d.parent.tabindex;d.containerControl=a.newHTML("div",{class:"DescartesCheckboxContainer",id:d.id});d.checkbox=a.newHTML("input",{type:d.typeCtr,
id:d.id+d.typeCtr,class:"DescartesCheckbox",tabindex:d.tabindex});""!==d.radio_group&&d.checkbox.setAttribute("name",d.radio_group);d.checkbox.internalID=d.id;d.label=a.newHTML("label",{class:"DescartesCheckboxLabel"});d.dummyLabel=a.newHTML("label",{"for":d.id+d.typeCtr});d.value=d.evaluator.eval(d.valueExpr);d.containerControl.appendChild(d.label);d.containerControl.appendChild(d.checkbox);d.containerControl.appendChild(d.dummyLabel);d.addControlContainer(d.containerControl);d.addEvents();d.init();
return d};$jscomp.inherits(e,a.Control);e.prototype.init=function(d){f=this.evaluator;this.label.innerHTML=f.eval(this.name).toString();this.labelFontSize=a.getFieldFontSize(this.h);d=Math.max(this.w-this.h,0);this.containerControl.setAttribute("style","width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+this.y+"px;z-index:"+this.zIndex+";");this.dummyLabel.setAttribute("style","position:absolute;width:"+this.h+"px;height:"+this.h+"px;left:"+d+"px;");this.checkbox.setAttribute("style",
"width:"+this.h+"px;height:"+this.h+"px;left:"+d+"px;");this.checkbox.checked=0!=this.value;this.label.setAttribute("style","font-size:"+this.labelFontSize+"px;width:"+d+"px;height:"+this.h+"px;line-height:"+this.h+"px;");this.evaluator.setVariable(this.id,this.value);this.update()};e.prototype.update=function(){f=this.evaluator;this.label.innerHTML=f.eval(this.name).toString();this.activeIfValue=0<f.eval(this.activeif);this.drawIfValue=0<f.eval(this.drawif);this.checkbox.disabled=!this.activeIfValue;
this.containerControl.style.display=this.drawIfValue?"block":"none";if(!this.parent.animation.playing||document.activeElement!=this.checkbox){var a=0!==f.getVariable(this.id)?1:0;""===this.radio_group?this.pressed?(this.value=this.checkbox.checked?1:0,this.pressed=!1):(this.value=a,this.checkbox.checked=0!==this.value):(this.value=this.checkbox.checked?1:0,this.pressed&&(f.setVariable(this.radio_group,this.id),this.pressed=!1));f.setVariable(this.id,this.value)}this.updatePositionAndSize()};e.prototype.addEvents=
function(){var d=this;d.checkbox.oncontextmenu=d.label.oncontextmenu=d.dummyLabel.oncontextmenu=function(){return!1};d.label.addEventListener("touchstart",a.preventDefault);d.label.addEventListener("mousedown",a.preventDefault);d.dummyLabel.addEventListener("mousedown",a.preventDefault);d.checkbox.addEventListener("click",function(a){d.pressed=!0;d.updateAndExecAction()})};a.Checkbox=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h=function(b,d){b=a.Control.call(this,b,d)||this;b.name.match(/^\[.*\]?/)?b.name=b.parser.parse(b.name.substring(1,b.name.length-1)):b.name=b.parser.parse("'"+b.name.trim()+"'");void 0===b.valueExprString&&(b.valueExprString=b.onlyText?"0":"");b.emptyString=!1;b.ok=0;b.tabindex=++b.parent.tabindex;b.regExpDecimalSymbol=new RegExp("\\"+b.parent.decimal_symbol,"g");b.answer&&(b.answer.match("krypto_")&&(b.answer=(new a.Krypto).decode(b.answer.substring(7))),
b.answerPattern=b.answer,b.answer=a.buildRegularExpressionsPatterns(b.answer,b.evaluator),b.onlyText?(d=b.answerPattern.indexOf("|"),b.firstAnswer=-1==d?b.answerPattern:b.answerPattern.substring(0,d)):b.firstAnswer=b.parser.parse(b.answerPattern.substring(1,b.answerPattern.indexOf(","))));b.onlyText&&(b.valueExprString.match(/^'/)&&b.valueExprString.match(/'$/)||(b.valueExpr=b.evaluator.parser.parse("'"+b.valueExprString+"'")),b.validateValue=function(a){a=a.toString();return"''"==a||"'"==a?"":a&&
a.match(/^'/)&&a.match(/'$/)?a.substring(1,a.length-1):a},b.formatOutputValue=function(a){return a.toString()});""==name.trim()&&(name="");b.containerControl=a.newHTML("div",{class:"DescartesTextFieldContainer",id:b.id});b.field=a.newHTML("input",{type:"text",id:b.id+"TextField",class:"DescartesTextFieldField",tabindex:b.tabindex});b.label=a.newHTML("label",{class:"DescartesTextFieldLabel"});b.containerControl.appendChild(b.label);b.containerControl.appendChild(b.field);b.addControlContainer(b.containerControl);
b.addEvents();b.init();return b};$jscomp.inherits(h,a.Control);h.prototype.init=function(b){f=this.evaluator;var d=f.eval(this.name).toString();this.label.innerHTML=d;b||(this.value=this.validateValue(f.eval(this.valueExpr)));b=this.formatOutputValue(this.value);this.fieldFontSize=a.getFieldFontSize(this.h);var e=a.getTextWidth(b+"_",this.fieldFontSize+"px "+a.sansserif_font),c=parseInt(this.w/2),g=a.getTextWidth(d,this.fieldFontSize+"px "+a.sansserif_font);this.visible||(c=this.w,e=0);c<g&&(c=g);
""==d&&(c=0);this.w-c<e&&(c=this.w-e);0>c&&(c=0);d=this.w-c;this.containerControl.setAttribute("style","width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+this.y+"px;z-index:"+this.zIndex+";");this.field.setAttribute("style","font-size:"+this.fieldFontSize+"px;width:"+d+"px;height:"+this.h+"px;left:"+c+"px;");this.field.value=b;this.label.setAttribute("style","font-size:"+this.fieldFontSize+"px;width:"+c+"px;height:"+this.h+"px;line-height:"+this.h+"px;");this.evaluate&&(this.ok=this.evaluateAnswer());
this.evaluator.setVariable(this.id,this.value);this.evaluator.setVariable(this.id+".ok",this.ok);this.oldValue=this.value;this.update()};h.prototype.update=function(){f=this.evaluator;this.label.innerHTML=f.eval(this.name).toString();this.activeIfValue=0<f.eval(this.activeif);this.drawIfValue=0<f.eval(this.drawif);this.field.disabled=!this.activeIfValue;this.containerControl.style.display=this.drawIfValue?"block":"none";this.parent.animation.playing&&document.activeElement==this.field||(e=this.field.value,
d=this.value,this.value=this.validateValue(f.getVariable(this.id)),this.field.value=this.formatOutputValue(this.value),this.value===d&&this.field.value!=e&&(this.value=this.validateValue(e),this.field.value=this.formatOutputValue(this.value)),f.setVariable(this.id,this.value));this.updatePositionAndSize()};h.prototype.validateValue=function(a){if(""===a||"''"==a)return"";f=this.evaluator;a=a.toString().replace(this.regExpDecimalSymbol,".","g");r=a==parseFloat(a)?parseFloat(a):parseFloat(f.eval(f.parser.parse(a)));
isNaN(r)&&(r=0);m=f.eval(this.min);b=f.eval(this.max);""===m&&(m=-Infinity);""===b&&(b=Infinity);r<m&&(r=m);r>b&&(r=b);this.discrete&&(a=f.eval(this.incr),r=0===a?0:a*Math.round(r/a));return r=parseFloat(parseFloat(r).toFixed(f.eval(this.decimals)))};h.prototype.formatOutputValue=function(b){return""===b?"":a.Control.prototype.formatOutputValue.call(this,b)};h.prototype.changeValue=function(a){this.activeIfValue&&(this.value=this.validateValue(a),this.field.value=this.formatOutputValue(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())};h.prototype.evaluateAnswer=function(){return a.esCorrecto(this.answer,this.value,this.evaluator,this.answer)};h.prototype.getFirstAnswer=function(){return this.answer?this.onlyText?this.firstAnswer:this.evaluator.eval(this.firstAnswer):""};h.prototype.addEvents=function(){var b=this;b.field.oncontextmenu=b.label.oncontextmenu=
function(){return!1};b.label.addEventListener("touchstart",a.preventDefault);b.label.addEventListener("mousedown",a.preventDefault);this.field.addEventListener("blur",function(a){b.evaluator.eval(b.drawIf)&&b.changeValue(b.field.value,!0)});this.field.addEventListener("keydown",function(a){b.activeIfValue&&13==a.keyCode&&b.changeValue(b.field.value,!0)});b.field.addEventListener("click",function(a){this.focus()})};a.TextField=h;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.abs,e,d,r,m,b,h,g,l,q,c,u=function(b,c){function k(b){g.options=b.split(",");g.menuOptions=[];g.strValue=[];b=0;for(var c=g.options.length;b<c;b++){var k=g.customSplit(g.options[b]);1==k.length?(g.menuOptions.push(k[0]),g.strValue.push(b.toString())):2==k.length&&(g.menuOptions.push(k[0]),""==k[1]?g.strValue.push(b.toString()):g.strValue.push(k[1]))}b=0;for(c=g.menuOptions.length;b<c;b++)g.menuOptions[b].match(/^\[/)&&g.menuOptions[b].match(/\]$/)?
g.menuOptions[b]=e.parse(g.menuOptions[b].substring(1,g.menuOptions[b].length-1)):g.menuOptions[b]=e.parse("'"+g.menuOptions[b]+"'");b=0;for(c=g.strValue.length;b<c;b++)g.strValue[b].match(/^\[/)&&g.strValue[b].match(/\]$/)?g.strValue[b]=e.parse(g.strValue[b].substring(1,g.strValue[b].length-1)):g.strValue[b]=e.parse(g.strValue[b]);for(;g.select.firstChild;)g.select.remove();b=0;for(c=g.menuOptions.length;b<c;b++)k=a.newHTML("option"),k.innerHTML=d.eval(g.menuOptions[b]),g.select.appendChild(k);return 0}
b=a.Control.call(this,b,c)||this;b.options=c.options||"";e=b.parser;d=b.evaluator;b.ok=0;b.tabindex=++b.parent.tabindex;b.answer&&(b.answer.match("krypto_")&&(b.answer=(new a.Krypto).decode(b.answer.substring(7))),b.answer=parseInt(b.answer.split(",")[0].replace("[",""))||0);b.name.match(/^\[.*\]?/)?b.name=b.parser.parse(b.name.substring(1,b.name.length-1)):b.name=b.parser.parse("'"+b.name+"'");var g=b;b.evaluator.setFunction(b.id+".setOptions",k);b.containerControl=a.newHTML("div",{class:"DescartesMenuContainer",
id:b.id});b.label=a.newHTML("label",{class:"DescartesMenuLabel"});b.select=a.newHTML("select",{id:b.id+"_menuSelect",class:"DescartesMenuSelect",tabindex:b.tabindex});b.field=a.newHTML("input",{type:"text",id:b.id+"_menuField",class:"DescartesMenuField",tabindex:b.tabindex});k(b.options);b.containerControl.appendChild(b.label);b.containerControl.appendChild(b.select);b.visible&&b.containerControl.appendChild(b.field);b.addControlContainer(b.containerControl);b.addEvents();b.init();return b};$jscomp.inherits(u,
a.Control);u.prototype.init=function(b){d=this.evaluator;var c=d.eval(this.name).toString();this.label.innerHTML=c;this.fieldFontSize=2!=this.parent.version?a.getFieldFontSize(this.h):10;var k=0,e=0;this.value=b?this.value:d.eval(this.valueExpr);this.indexValue=this.getIndex(this.value);for(var g=0,f=this.menuOptions.length;g<f;g++)b=a.getTextWidth(d.eval(this.menuOptions[g]).toString(),this.fieldFontSize+"px "+a.sansserif_font),b>k&&(k=b,e=g);k+=25;b=a.getTextWidth(this.formatOutputValue(d.eval(this.strValue[e])),
this.fieldFontSize+"px "+a.sansserif_font)+7;e=a.getTextWidth(c,this.fieldFontSize+"px "+a.sansserif_font)+10;""==c&&(e=0);this.visible||(b=0);for(c=this.w-b-e;c<k&&0<e;)e--,c++;for(;c<k&&0<b;)b--,c++;for(;e+c+b+1<this.w;)c++,b++;k=e;g=k+c;b=this.w-g;f=this.formatOutputValue(d.eval(this.strValue[this.indexValue]));this.containerControl.setAttribute("style","width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+this.y+"px;z-index:"+this.zIndex+";");this.label.setAttribute("style","font-size:"+
this.fieldFontSize+"px;width:"+e+"px;height:"+this.h+"px;line-height:"+this.h+"px;");this.field.value=f;this.field.setAttribute("style","font-size:"+this.fieldFontSize+"px;width:"+b+"px;height:"+this.h+"px;left:"+g+"px;");this.select.setAttribute("style","text-align:left;font-size:"+this.fieldFontSize+"px;width:"+c+"px;height:"+this.h+"px;left:"+k+"px;");this.select.selectedIndex=this.indexValue;d.setVariable(this.id,parseFloat(f.replace(this.parent.decimal_symbol,".")));this.update()};u.prototype.update=
function(){d=this.evaluator;this.activeIfValue=0<d.eval(this.activeif);this.drawIfValue=0<d.eval(this.drawif);this.field.disabled=this.activeIfValue?!1:!0;this.select.disabled=this.activeIfValue?!1:!0;this.drawIfValue?this.containerControl.style.display="block":(this.click=!1,this.containerControl.style.display="none");if(!this.parent.animation.playing||document.activeElement!=this.select){this.label.innerHTML=d.eval(this.name).toString();for(var a=0,b=this.menuOptions.length;a<b;a++)this.select.options[a].innerHTML=
d.eval(this.menuOptions[a]);this.value=d.getVariable(this.id);isNaN(this.value)&&(this.value=0);this.field.value=this.formatOutputValue(this.value);d.setVariable(this.id,parseFloat(this.value));this.select.selectedIndex=parseFloat(this.getIndex(this.value))}this.ok=this.value==this.answer?1:0;this.evaluator.setVariable(this.id+".ok",this.ok);this.updatePositionAndSize()};u.prototype.customSplit=function(a){h=!1;g="";l=0;for(q=-1;l<a.length;){c=a.charAt(l);if("["===c&&-1===q){if(h||""!=g)g+="\u00a6";
q++}else"["===c?q++:"]"===c&&0===q?(h=!0,q--):"]"==a.charAt(l)&&(q=0>q?q:q-1);g+=a.charAt(l);l++}return g.split("\u00a6")};u.prototype.getIndex=function(a){a=parseFloat(a.toString().replace(this.parent.decimal_symbol,"."));r=-1;m=Infinity;for(var c=0,d=this.strValue.length;c<d;c++)b=f(a-parseFloat(this.evaluator.eval(this.strValue[c]))),b<=m&&(m=b,r=c);return r};u.prototype.changeValue=function(){this.activeIfValue&&(this.evaluator.setVariable(this.id,this.value),this.updateAndExecAction())};u.prototype.addEvents=
function(){var b=this;b.select.oncontextmenu=b.label.oncontextmenu=b.field.oncontextmenu=function(){return!1};b.label.addEventListener("touchstart",a.preventDefault);b.label.addEventListener("mousedown",a.preventDefault);this.select.addEventListener("change",function(a){b.value=b.evaluator.eval(b.strValue[this.selectedIndex]);b.field.value=b.formatOutputValue(b.value);b.evaluator.setVariable(b.id,b.field.value);b.changeValue();a.preventDefault()});this.field.addEventListener("keydown",function(a){13==
a.keyCode&&(b.indexValue=b.getIndex(b.field.value),b.value=b.evaluator.eval(b.strValue[b.indexValue]),b.field.value=b.formatOutputValue(b.indexValue),b.select.selectedIndex=b.indexValue,b.changeValue())});b.field.addEventListener("click",function(a){this.focus()})};a.Menu=u;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.floor,e,d,r,m,b,h,g,l,q,c,u,k,w,p,v,n,z,x,y=function(b,c){b=a.Control.call(this,b,c)||this;b.name.match(/^\[.*\]?/)?b.name=b.parser.parse(b.name.substring(1,b.name.length-1)):b.name=b.parser.parse("'"+b.name+"'");b.orientation=b.w>=b.h?"h":"v";b.container=a.newHTML("div",{class:"DescartesScrollbarContainer",id:b.id});b.canvas=a.newHTML("canvas");b.divUp=a.newHTML("div",{class:"DescartesCatcher up"});b.divDown=a.newHTML("div",{class:"DescartesCatcher down"});
b.field=a.newHTML("input",{type:"text",id:b.id+"scrollbar",class:"DescartesScrollbarField"});b.scrollHandler=a.newHTML("div",{class:"DescartesCatcher manipulator"});b.label=a.newHTML("label",{class:"DescartesScrollbarLabel"});b.container.appendChild(b.canvas);b.container.appendChild(b.label);b.container.appendChild(b.divUp);b.container.appendChild(b.divDown);b.container.appendChild(b.field);b.container.appendChild(b.scrollHandler);b.addControlContainer(b.container);b.addEvents();b.init();return b};
$jscomp.inherits(y,a.Control);y.prototype.init=function(){e=this.evaluator;0==e.eval(this.decimals)?this.incr=1:this.incr=(e.eval(this.max)-e.eval(this.min))/100;this.value=this.validateValue(e.eval(this.valueExpr));r=this.formatOutputValue(this.value);m=this.evaluator.eval(this.expresion);this.x=m[0][0];this.y=m[0][1];4==m[0].length&&(this.w=m[0][2],this.h=m[0][3]);this.orientation=this.w>=this.h?"h":"v";this.initScroll(r);this.changeScrollPositionFromValue();this.prePos=this.pos;e.setVariable(this.id,
this.value)};y.prototype.initScroll=function(b){d=this;e=d.evaluator;x=e.eval(d.name).toString();d.label.innerHTML=x;var c="v"===d.orientation?parseInt(19+5*(d.h-100)/100):d.h;d.fieldFontSize="v"===d.orientation?c-parseInt(d.h/20)-1:2!==d.parent.version?a.getFieldFontSize(c):10;b=a.getTextWidth(b+"_",d.fieldFontSize+"px "+a.sansserif_font);var k=d.parent.getSpaceById(d.spaceID).h;d.labelHeight=""==x?0:c;d.fieldHeight=""==d.visible?0:c;if("v"===d.orientation)d.canvasWidth=d.w,d.canvasHeight=d.h-d.labelHeight-
d.fieldHeight,18<=d.canvasHeight+d.y-k&&(d.canvasHeight=k),c=d.fieldHeight,b=c+d.canvasHeight,d.canvasX=0,d.canvasY=d.fieldHeight,d.labelWidth=d.w,d.labelY=b,d.upWidth=d.downW=d.w,d.upHeight=d.downH=15,d.upX=0,d.upY=d.fieldHeight,d.downX=0,d.downY=b-d.downH,d.fieldWidth=d.w,d.fieldX=0,d.scrollHandlerW=d.w,d.scrollHandlerH=parseInt((d.canvasHeight-d.upHeight-d.downH-d.labelHeight-d.fieldHeight)/10),d.scrollHandlerH=15>d.scrollHandlerH?15:d.scrollHandlerH,d.limInf=b-d.downH-d.scrollHandlerH,d.limSup=
c+d.downH;else{c=a.getTextWidth(x,d.fieldFontSize+"px "+a.sansserif_font)+10;d.labelWidth=c;d.fieldWidth=b;""==x&&(d.labelWidth=0);d.visible||(d.fieldWidth=0);for(b=d.w-d.fieldWidth-d.labelWidth;58>b&&0<d.labelWidth;)d.labelWidth--,b++;for(;58>b&&0<d.fieldWidth;)d.fieldWidth--,b++;c=d.labelWidth;k=c+b;d.fieldWidth=d.w-k;d.canvasWidth=b;d.canvasHeight=d.h;d.canvasX=d.labelWidth;d.canvasY=0;d.fieldX=d.canvasWidth+d.labelWidth;d.labelHeight=d.h;d.labelY=0;d.upWidth=d.downW=15;d.upHeight=d.downH=d.h;
d.upX=k-d.downW;d.upY=0;d.downX=d.labelWidth;d.downY=0;d.scrollHandlerW=parseInt((d.canvasWidth-d.upWidth-d.downW)/10);d.scrollHandlerW=15>d.scrollHandlerW?15:d.scrollHandlerW;d.scrollHandlerH=d.h;d.limInf=c+d.downW;d.limSup=c+d.canvasWidth-d.downW-d.scrollHandlerW}d.container.setAttribute("style","width:"+d.w+"px;height:"+d.h+"px;left:"+d.x+"px;top:"+d.y+"px;z-index:"+d.zIndex+";");d.canvas.setAttribute("width",d.w+"px");d.canvas.setAttribute("height",d.h+"px");d.canvas.setAttribute("style","position:absolute;left:0;top:0;");
d.ctx=d.canvas.getContext("2d");d.ctx.imageSmoothingEnabled=!1;d.divUp.setAttribute("style","width:"+d.upWidth+"px;height:"+d.upHeight+"px;left:"+d.upX+"px;top:"+d.upY+"px;");d.divDown.setAttribute("style","width:"+d.downW+"px;height:"+d.downH+"px;left:"+d.downX+"px;top:"+d.downY+"px;");d.scrollHandler.setAttribute("style","width:"+d.scrollHandlerW+"px;height:"+d.scrollHandlerH+"px;left:"+("v"===d.orientation?0:d.limInf)+"px;top:"+("v"===d.orientation?d.limInf:0)+"px;");d.field.setAttribute("style",
"font-size:"+d.fieldFontSize+"px;width:"+d.fieldWidth+"px;height:"+d.fieldHeight+"px;left:"+d.fieldX+"px;top:0;");0===d.fieldHeight&&(d.field.style.display="none");d.label.setAttribute("style","font-size:"+d.fieldFontSize+"px;width:"+d.labelWidth+"px;height:"+d.labelHeight+"px;line-height:"+d.labelHeight+"px;left:0;top:"+d.labelY+"px;")};y.prototype.update=function(){e=this.evaluator;this.label.innerHTML=e.eval(this.name).toString();0==e.eval(this.decimals)?this.incr=1:this.incr=(e.eval(this.max)-
e.eval(this.min))/100;this.activeIfValue=0<e.eval(this.activeif);this.drawIfValue=0<e.eval(this.drawif);this.field.disabled=!this.activeIfValue;this.drawIfValue?(this.container.style.display="block",this.draw()):this.container.style.display="none";this.updatePositionAndSize();var a=this.validateValue(e.getVariable(this.id));a==this.value||0<Math.abs(a-this.value)&&1E-9>Math.abs(a-this.value)||(this.value=a,this.changeScrollPositionFromValue(),this.prePos=this.pos);this.value=a;this.field.value=this.formatOutputValue(this.value);
e.setVariable(this.id,this.value)};y.prototype.draw=function(){d=this;b=d.ctx;g=f(this.w);h=f(this.h);b.fillStyle="#e0e4e8";b.fillRect(0,0,g,h);b.strokeStyle="#7a8a99";b.fillStyle="#ccdcec";d.down&&b.fillRect(d.downX+.5,d.downY+.5,d.downW,d.downH-1);b.strokeRect(d.downX+.5,d.downY+.5,d.downW,d.downH-1);d.up&&b.fillRect(d.upX+.5,d.upY-.5,d.upWidth,d.upHeight+1);b.strokeRect(d.upX+.5,d.upY-.5,d.upWidth,d.upHeight+1);l=4;b.fillStyle="black";b.beginPath();"h"===d.orientation?(b.moveTo(d.downX+l,d.downH/
2),b.lineTo(d.downX+d.downW-l,l),b.lineTo(d.downX+d.downW-l,d.downH-l),b.moveTo(d.upX+d.upWidth-l,d.downH/2),b.lineTo(d.upX+l,l),b.lineTo(d.upX+l,d.downH-l),b.fill(),d.activeIfValue&&(q=f(d.pos),b.fillStyle="#ccdcec",b.fillRect(q+.5,0,f(d.scrollHandlerW),h),b.strokeStyle="#6382bf",b.strokeRect(q+.5,0,f(d.scrollHandlerW),h),c=f(d.scrollHandlerW/2),b.beginPath(),b.moveTo(q+c+.5-2,3),b.lineTo(q+c+.5-2,h-3),b.moveTo(q+c+.5,3),b.lineTo(q+c+.5,h-3),b.moveTo(q+c+.5+2,3),b.lineTo(q+c+.5+2,h-3),b.stroke())):
(b.moveTo(d.downX+d.downW/2,d.downY+d.downH-l),b.lineTo(d.downX+l,d.downY+l),b.lineTo(d.downX+d.downW-l,d.downY+l),b.moveTo(d.upX+d.upWidth/2,d.upY+l),b.lineTo(d.upX+l,d.upY+d.upHeight-l),b.lineTo(d.upX+d.upWidth-l,d.upY+d.upHeight-l),b.fill(),d.activeIfValue&&(q=f(d.pos),b.fillStyle="#ccdcec",b.fillRect(0,q+.5,g,f(d.scrollHandlerH)),b.strokeStyle="#6382bf",b.strokeRect(0,q+.5,g,f(d.scrollHandlerH)),c=f(d.scrollHandlerH/2),b.beginPath(),b.moveTo(3,q+c+.5-2),b.lineTo(g-3,q+c+.5-2),b.moveTo(3,q+c+.5),
b.lineTo(g-3,q+c+.5),b.moveTo(3,q+c+.5+2),b.lineTo(g-3,q+c+.5+2),b.stroke()));b.strokeRect(.5,.5,g-1,h-1);d.activeIfValue||(b.fillStyle="rgba(240,240,240,"+160/255+")",b.fillRect(0,0,g,h.h))};y.prototype.validateValue=function(a){e=this.evaluator;u=a.toString();u=parseFloat(u.replace(this.parent.decimal_symbol,"."));isNaN(u)&&(u=0);this.minimo=e.eval(this.min);u<this.minimo&&(this.value=null,u=this.minimo);this.maximo=e.eval(this.max);u>this.maximo&&(this.value=null,u=this.maximo);k=this.incr;u=0!=
k?u*k/k:0;this.fixed&&(u=parseFloat(parseFloat(u).toFixed(e.eval(this.decimals))));return u};y.prototype.increase=function(){this.changeValue(parseFloat(this.value)+this.incr)};y.prototype.decrease=function(){this.changeValue(parseFloat(this.value)-this.incr)};y.prototype.increase10=function(){l=(this.evaluator.eval(this.max)-this.evaluator.eval(this.min))/10;"h"==this.orientation?this.clickPos.x>this.prePos&&this.changeValue(parseFloat(this.value)+l):this.clickPos.y<this.prePos&&this.changeValue(parseFloat(this.value)+
l)};y.prototype.decrease10=function(){l=(this.evaluator.eval(this.max)-this.evaluator.eval(this.min))/10;"h"==this.orientation?this.clickPos.x<this.prePos&&this.changeValue(parseFloat(this.value)-l):this.clickPos.y>this.prePos&&this.changeValue(parseFloat(this.value)-l)};y.prototype.changeValue=function(a){this.activeIfValue&&(w=this.validateValue(a),w!=this.value&&(this.value=w,this.field.value=this.formatOutputValue(w),this.changeScrollPositionFromValue(),this.prePos=this.pos,this.evaluator.setVariable(this.id,
this.value),this.updateAndExecAction()))};y.prototype.changeValueForScrollMovement=function(){e=this.evaluator;p=this.limInf;v=this.limSup;n=e.eval(this.min);z=e.eval(this.max);k=this.incr;w=f((this.pos-p)*(z-n)/(v-p)/k)*k+n;w!=this.value&&(this.value=w,this.field.value=this.formatOutputValue(w),e.setVariable(this.id,this.value),this.parent.updateControls(),this.actionExec.execute(),this.parent.update())};y.prototype.changeScrollPositionFromValue=function(){e=this.evaluator;p=this.limInf;v=this.limSup;
n=e.eval(this.min);z=e.eval(this.max);k=this.incr;this.pos=(this.value-n)*(v-p)/(z-n)+p;this.scrollHandler.style["h"==this.orientation?"left":"top"]=this.pos+"px"};y.prototype.addEvents=function(){function b(c,d,k,e){a.clearTimeout(q);(p.up||p.down||p.canvasClick)&&1E-7<Math.abs(p.value-e)&&(d.call(p),c=k?c:30,q=a.setTimeout(function(){b(c,d,!1,e)},c))}function c(c){c.preventDefault();p.whichBtn=a.whichBtn(c);"L"==p.whichBtn&&p.activeIfValue&&(p.clickPos=a.getCursorPosition(c,p.container),p.canvasClick=
!0,"h"==p.orientation?p.clickPos.x<p.prePos?b(350,p.decrease10,!0,p.minimo):b(350,p.increase10,!0,p.maximo):p.clickPos.y<p.prePos?b(350,p.increase10,!0,p.maximo):b(350,p.decrease10,!0,p.minimo))}function d(b){p.canvasClick=!1;a.clearTimeout(q)}function k(b){1==p.canvasClick&&(p.clickPos=a.getCursorPosition(b,p.container),b.preventDefault())}function e(a){p.scrollClick=!1;p.prePos=p.pos;window.removeEventListener("mouseup",e,!1);window.removeEventListener("mousemove",f,!1);a.preventDefault()}function g(a){p.scrollClick=
!1;p.prePos=p.pos;window.removeEventListener("touchend",g,!1);window.removeEventListener("touchmove",f,!1);a.preventDefault()}function f(b){var c=a.getCursorPosition(b,p.container);"h"==p.orientation?(p.pos=p.prePos-(p.initPos.x-c.x),p.pos<p.limInf&&(p.pos=p.limInf),p.pos>p.limSup&&(p.pos=p.limSup),p.scrollHandler.setAttribute("style","width:"+p.scrollHandlerW+"px;height:"+p.h+"px;left:"+p.pos+"px;top:0;")):(p.pos=p.prePos-(p.initPos.y-c.y),p.pos>p.limInf&&(p.pos=p.limInf),p.pos<p.limSup&&(p.pos=
p.limSup),p.scrollHandler.setAttribute("style","width:"+p.w+"px;height:"+p.scrollHandlerH+"px;left:0;top:"+p.pos+"px;"));p.changeValueForScrollMovement();b.preventDefault()}function n(c){c.preventDefault();p.whichBtn=a.whichBtn(c);"L"==p.whichBtn&&p.activeIfValue&&(p.up=!0,b(350,p.increase,!0,p.maximo))}function l(c){c.preventDefault();p.whichBtn=a.whichBtn(c);"L"==p.whichBtn&&p.activeIfValue&&(p.down=!0,b(350,p.decrease,!0,p.minimo))}function h(b){p.down=!1;a.clearTimeout(q);b.preventDefault()}function m(b){p.up=
!1;a.clearTimeout(q);p.draw()}function u(b){p.down=!1;a.clearTimeout(q);p.draw()}var p=this,q;p.canvas.oncontextmenu=p.divUp.oncontextmenu=p.divDown.oncontextmenu=p.label.oncontextmenu=p.field.oncontextmenu=p.scrollHandler.oncontextmenu=function(){return!1};this.field.addEventListener("keydown",function(a){13==a.keyCode&&p.changeValue(p.field.value)});this.canvas.addEventListener("touchstart",c);this.canvas.addEventListener("mousedown",c);this.divDown.addEventListener("mouseout",h);window.addEventListener("touchend",
d);window.addEventListener("mouseup",d);this.canvas.addEventListener("touchmove",k);this.canvas.addEventListener("mousemove",k);this.scrollHandler.addEventListener("touchstart",function(b){p.activeIfValue&&(p.scrollClick=!0,p.initPos=a.getCursorPosition(b,p.container),window.addEventListener("touchend",g),window.addEventListener("touchmove",f),b.preventDefault())});this.scrollHandler.addEventListener("mousedown",function(b){p.activeIfValue&&(p.scrollClick=!0,p.initPos=a.getCursorPosition(b,p.container),
window.addEventListener("mouseup",e),window.addEventListener("mousemove",f),b.preventDefault())});this.divUp.addEventListener("touchstart",n);this.divUp.addEventListener("mousedown",n);this.divDown.addEventListener("touchstart",l);this.divDown.addEventListener("mousedown",l);this.divUp.addEventListener("mouseout",function(b){p.up=!1;a.clearTimeout(q);b.preventDefault()});this.divDown.addEventListener("mouseout",h);window.addEventListener("touchend",m);window.addEventListener("mouseup",m);window.addEventListener("touchend",
u);window.addEventListener("mouseup",u)};a.Scrollbar=y;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d=function(d,e){var b=a.Control.call(this,d,e)||this;b.controls=e.controls||!0;b.file=e.file||"";b.oldDrawIf=0;d=b.evaluator.eval(b.expresion);4==d[0].length?(b.w=d[0][2],b.h=d[0][3]):(b.w=200,b.h=28);b.audio=b.parent.getAudio(b.file);b.oldFile=b.file;"]"===b.file.charAt(b.file.length-1)&&(b.file=b.evaluator.parser.parse(b.file.substring(1,b.file.length-1)));b.autoplay&&(b.audio.setAttribute("autoplay","autoplay"),b.audio.play());b.loop&&b.audio.setAttribute("loop",
"loop");b.controls&&b.audio.setAttribute("controls","controls");b.audio.setAttribute("style","position:absolute;width:"+b.w+"px;left:"+b.x+"px;top:"+b.y+"px;z-index:"+b.zIndex+";");b.addControlContainer(b.audio);b.evaluator.setFunction(b.id+".play",function(){try{b.audio.play()}catch(h){}return 0});b.evaluator.setFunction(b.id+".pause",function(){try{b.audio.pause()}catch(h){}return 0});b.evaluator.setFunction(b.id+".stop",function(){try{b.audio.pause(),b.audio.currentTime=0}catch(h){}return 0});
b.evaluator.setFunction(b.id+".currentTime",function(a){try{b.audio.currentTime=parseFloat(a)}catch(g){}return 0});b.audio.addEventListener("timeupdate",function(a){b.evaluator.setVariable(b.id+".currentTime",b.audio.currentTime)});return b};$jscomp.inherits(d,a.Control);d.prototype.init=function(){this.audio.style.left=this.x+"px";this.audio.style.top=this.y+"px";this.update()};d.prototype.update=function(){f=this.evaluator;"string"!==typeof this.file&&(this.tmpFile=f.eval(this.file),this.oldFile!==
this.tmpFile&&(this.oldFile=this.audio.src=this.tmpFile));(e=0<f.eval(this.drawif))?this.audio.style.display="block":(this.audio.style.display="none",e!==this.oldDrawIf&&this.audio.pause());this.oldDrawIf=e;this.updatePositionAndSize()};a.Audio=d;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d=function(d,e){var b=a.Control.call(this,d,e)||this;b.controls=e.controls||!0;b.file=e.file||"";b.oldDrawIf=0;f=b.evaluator;d=f.eval(b.expresion);4==d[0].length?(b.w=d[0][2],b.h=d[0][3]):(b.w=null,b.h=null);d=b.file;e=d.lastIndexOf(".");-1!=e&&(d=b.file.substring(0,e));b.video=a.newHTML("video",{poster:d+".png",style:"position:absolute;overflow:hidden;left:"+b.x+"px;top:"+b.y+"px;outline:none;background:rgba(0,0,0,0);"});b.autoplay&&b.video.setAttribute("autoplay",
"autoplay");b.loop&&b.video.setAttribute("loop","loop");b.controls&&b.video.setAttribute("controls","controls");b.w&&(b.video.setAttribute("width",b.w),b.video.setAttribute("height",b.h));b.video.canPlayType("video/mp4")&&(e=a.newHTML("source",{src:d+".mp4",type:"video/mp4"}),b.video.appendChild(e));b.video.canPlayType("video/ogg")&&(e=a.newHTML("source",{src:d+".ogg",type:"video/ogg"}),b.video.appendChild(e),e=a.newHTML("source",{src:d+".ogv",type:"video/ogg"}),b.video.appendChild(e));b.video.canPlayType("video/webm")&&
(e=a.newHTML("source",{src:d+".webm",type:"video/webm"}),b.video.appendChild(e));b.addControlContainer(b.video);f.setFunction(b.id+".play",function(){try{b.video.play()}catch(h){}return 0});f.setFunction(b.id+".pause",function(){try{b.video.pause()}catch(h){}return 0});f.setFunction(b.id+".stop",function(){try{b.video.pause(),b.video.currentTime=0}catch(h){}return 0});f.setFunction(b.id+".currentTime",function(a){try{b.video.currentTime=parseFloat(a)}catch(g){}return 0});b.video.addEventListener("timeupdate",
function(a){f.setVariable(b.id+".currentTime",b.video.currentTime)});return b};$jscomp.inherits(d,a.Control);d.prototype.init=function(){this.video.style.left=this.x+"px";this.video.style.top=this.y+"px";this.update()};d.prototype.update=function(){f=this.evaluator;(e=0<f.eval(this.drawif))?this.video.style.display="block":(this.video.style.display="none",e!==this.oldDrawIf&&this.video.pause());this.oldDrawIf=e;this.updatePositionAndSize()};a.Video=d;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r=function(d,b){var e=a.Control.call(this,d,b)||this;e.font_family=b.font_family||"Monospaced";e.style=b.style||",PLAIN,";e.font_size=b.font_size||12;typeof("number"!==e.font_size)&&(e.font_size=e.evaluator.eval(e.font_size));e.font=e.font_family+e.style+e.font_size;e.region="interior";e.tabindex=++e.parent.tabindex;if(e.answer){e.answer.match("krypto_")&&(e.answer=(new a.Krypto).decode(e.answer.substring(7)));var g=e.parent.lessonParser.parseText(e.answer)}e.containerControl=
a.newHTML("div",{class:"DescartesTextAreaContainer",id:e.id,spellcheck:"false"});e.textArea=a.newHTML("div",{class:"DescartesTextAreaContainer",contenteditable:"true"});e.textAreaAnswer=a.newHTML("div",{class:"DescartesTextAreaContainer"});e.showButton=a.newHTML("div",{class:"DJS_Gradient"});e.activeCover=a.newHTML("div");e.containerControl.appendChild(e.textArea);e.containerControl.appendChild(e.textAreaAnswer);e.containerControl.appendChild(e.showButton);e.containerControl.appendChild(e.activeCover);
e.addControlContainer(e.containerControl);e.showAnswer=!1;e.text=void 0==e.text||"simpleText"==e.text.type?e.rawText||"":e.text.hasFormula?e.rawText:e.text.toHTML();g&&"simpleText"!==g.type&&(e.answer=e.text.hasFormula?"":g.toHTML());e.evaluator.setVariable(e.id,e.text);var f,m,c;e.evaluator.setFunction(e.id+".insertAtCursor",function(a){(f=window.getSelection())&&f.getRangeAt&&f.rangeCount&&(c=document.createTextNode(a),m=f.getRangeAt(0),m.deleteContents(),m.insertNode(c),m.setStart(c,c.length),
m.setEnd(c,c.length),f.removeAllRanges(),f.addRange(m),e.textArea.focus());return 0});e.evaluator.setFunction(e.id+".update",function(){e.update()});e.addEvents();e.init();return e};$jscomp.inherits(r,a.Control);r.prototype.init=function(){e=this.answer?28:4;f=this.evaluator;var d=this.text.match(/<span/)?this.text:this.text.replace(/\\n/g,"<br/>");this.containerControl.setAttribute("style","width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+this.y+"px;z-index:"+this.zIndex+";");var b=
"padding:5px;width:"+(this.w-4)+"px;height:"+(this.h-e)+"px;left:2px;top:2px;background-color:white;text-align:left;font:"+a.convertFont(this.font)+";line-height:"+this.font_size+"px;";this.textArea.setAttribute("style",b);this.textArea.innerHTML=d;this.textAreaAnswer.setAttribute("style",b+"display:"+(this.showAnswer?"block":"none")+";");this.textAreaAnswer.innerHTML="<span>"+this.answer+"</span>";this.showButton.setAttribute("style","width:20px;height:16px;position:absolute;bottom:4px;right:4px;cursor:pointer;border:1px outset #f0f8ff;display:"+
(this.answer?"block":"none")+";");this.showButton.innerHTML='<span style="position:relative;top:1px;text-align:center;font:11px '+a.sansserif_font+';">S</span>';this.activeCover.setAttribute("style","position:absolute;width:"+this.w+"px;height:"+this.h+"px;left:"+this.x+"px;top:"+this.y+"px;");this.update()};r.prototype.update=function(){f=this.evaluator;this.activeIfValue=0<f.eval(this.activeif);this.drawIfValue=0<f.eval(this.drawif);f.getVariable(this.id)!==this.oldValue&&(this.textArea.innerText=
(f.getVariable(this.id)||"").replace(/\\n/g,"\n"));d=this.textArea.innerText||"";d="\n"===d.charAt(d.length-1)?d.substring(0,d.length-1):d;d=d.replace(/\n/g,"\\n").replace(/\s/g," ");f.setVariable(this.id,d);this.oldFieldValue=d;this.oldValue=f.getVariable(this.id);this.activeCover.style.display=this.activeIfValue?"none":"block";this.containerControl.style.display=this.drawIfValue?"block":"none";this.updatePositionAndSize()};r.prototype.addEvents=function(){function a(a){a.preventDefault()}var b=
this;this.showButton.addEventListener("mousedown",function(a){a.preventDefault();b.showAnswer=!b.showAnswer;b.textAreaAnswer.style.display=b.showAnswer?"block":"none";b.showButton.childNodes[0].childNodes[0].textContent=b.showAnswer?"T":"S"});this.showButton.addEventListener("mouseup",a);this.showButton.addEventListener("mouseout",a);this.textArea.addEventListener("blur",function(){var a=window.getSelection();b.cursorInd=a.focusOffset});this.textArea.addEventListener("paste",function(a){a.preventDefault();
document.execCommand("insertHTML",!1,a.clipboardData.getData("text/plain").replace(/\n/g,"<br>"))});this.textArea.addEventListener("keydown",function(a){if("PageDown"===a.key||"PageUp"===a.key)a.stopPropagation(),a.preventDefault()})};a.TextArea=r;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=2*Math.PI,e,d,r,m,b,h,g,l,q,c,u,k,w=function(b,e){var k=a.Control.call(this,b,e)||this;d=b.evaluator.parser;k.spaceID=e.spaceID||"";k.text=e.text||"";k.size=e.size||d.parse("4");k.font=e.font||"Monospaced,PLAIN,12";k.image=new Image;k.image.onload=function(){this.ready=1};k.imageSrc=e.imageSrc||"";k.font=a.convertFont(k.font);if(k.constraintExpr){k.constraint=d.parse(k.constraintExpr);"(expr)"==k.constraint.type&&(k.constraint=d.parse(k.constraintExpr.substring(1,
k.constraintExpr.length-1)));if("compOperator"==k.constraint.type){e=k.constraint.childs[0];var g=k.constraint.childs[1];"identifier"!=e.type||"y"!=e.value||g.contains("y")?"identifier"!=e.type||"x"!=e.value||g.contains("x")?k.newt=new a.R2Newton(k.evaluator,k.constraint):(k.constVar="y",k.noConstVar="x",k.evalConst=k.evalConstXoY,k.constraint=g):(k.constVar="x",k.noConstVar="y",k.evalConst=k.evalConstXoY,k.constraint=g)}else k.constraint=null;c=new a.R2(0,0)}k.container=k.getContainer();k.mouseCatcher=
a.newHTML("div",{class:"DescartesGraphicControl",id:k.id,dragged:!0,tabindex:"-1",style:"cursor:pointer;background-color:rgba(0,0,0,0);z-index:"+k.zIndex+";"});k.ctx=k.space.ctx;k.container.appendChild(k.mouseCatcher);k.addEvents();k.xStr=k.id+".x";k.yStr=k.id+".y";k.activoStr=k.id+".activo";k.activeStr=k.id+".active";""!==k.space.id&&2!==b.version?(k.mxStr=k.space.id+".mouse_x",k.myStr=k.space.id+".mouse_y",k.mclickedStr=k.space.id+".mouse_clicked",k.mclicizquierdoStr=k.space.id+".clic_izquierdo"):
(k.mxStr="mouse_x",k.myStr="mouse_y",k.mclickedStr="mouse_clicked",k.mclicizquierdoStr="clic_izquierdo");k.init();return k};$jscomp.inherits(w,a.Control);w.prototype.init=function(){e=this.evaluator;u=a.hasTouchSupport;var b=e.eval(this.expresion);this.x=b[0][0];this.y=b[0][1];e.setVariable(this.xStr,this.x);e.setVariable(this.yStr,this.y);""==this.imageSrc||this.imageSrc.toLowerCase().match(/vacio.gif$/)?(this.width=2*e.eval(this.size),this.height=2*e.eval(this.size),this._w=u&&48>this.width?48:
this.width,this._h=u&&48>this.height?48:this.height,this.mouseCatcher.style.borderRadius=parseInt(Math.min(this._w,this._h)/2)+"px"):(this.image=this.parent.getImage(this.imageSrc),this.width=this.image.width,this.height=this.image.height,this._w=Math.max(this.width,32),this._h=Math.max(this.height,32));this.mouseCatcher.style.width=this._w+"px";this.mouseCatcher.style.height=this._h+"px";this.mouseCatcher.style.left=parseInt(this.space.getAbsoluteX(this.x)-this._w/2)+"px";this.mouseCatcher.style.top=
parseInt(this.space.getAbsoluteY(this.y)-this._h/2)+"px";e.setVariable(this.activoStr,0);e.setVariable(this.activeStr,0);this.setImage=!1;this.update()};w.prototype.update=function(){e=this.evaluator;this.activeIfValue=0<e.eval(this.activeif);this.drawIfValue=0<e.eval(this.drawif);this.x=e.getVariable(this.xStr);this.y=e.getVariable(this.yStr);r=this.space.getAbsoluteX(this.x);m=this.space.getAbsoluteY(this.y);this.mouseCatcher.style.display=this.activeIfValue?"block":"none";this.mouseCatcher.style.left=
parseInt(r-this._w/2)+"px";this.mouseCatcher.style.top=parseInt(m-this._h/2)+"px";this.constraint&&this.evalConst();this.draw()};w.prototype.draw=function(){e=this.evaluator;this.drawIfValue&&(l=this.ctx,q=this.space.backgroundCtx,r=parseInt(this.space.getAbsoluteX(this.x))+.5,m=parseInt(this.space.getAbsoluteY(this.y))+.5,""!=this.text&&this.drawText(r,m),this.image.ready?(b=this.image.width/2,h=this.image.height/2,this.image.complete&&!this.setImage&&l.drawImage(this.image,parseInt(r-b),parseInt(m-
h)),this.trace&&(q.save(),q.translate(r,m),q.scale(parseInt(b),parseInt(h)),q.beginPath(),q.arc(0,0,1,0,f),q.restore(),q.lineWidth=1,q.strokeStyle=this.trace.getColor(),q.stroke())):(b=parseInt(this.width/2),l.beginPath(),l.arc(r,m,b,0,f),l.fillStyle=this.colorInt.getColor(),l.fill(),l.lineWidth=1,l.strokeStyle=this.color.getColor(),l.stroke(),this.active&&(l.strokeStyle=this.colorInt.borderColor(),l.beginPath(),l.arc(r,m,b-2,0,f),l.stroke()),this.trace&&(q.strokeStyle=this.trace.getColor(),q.beginPath(),
q.arc(r,m,b,0,f),q.stroke())))};w.prototype.evalConst=function(){c.set(this.x,this.y);g=this.newt.findZero(c,1/this.space.scale,!0);this.x=g.x;this.y=g.y;this.evaluator.setVariable(this.xStr,this.x);this.evaluator.setVariable(this.yStr,this.y)};w.prototype.evalConstXoY=function(){e=this.evaluator;k=e.getVariable(this.constVar);e.setVariable(this.constVar,this[this.constVar]);this[this.noConstVar]=e.eval(this.constraint);e.setVariable(this.xStr,this.x);e.setVariable(this.yStr,this.y);e.setVariable(this.constVar,
k)};w.prototype.drawText=function(a,b){l=this.ctx;e=this.evaluator;"simpleText"==this.text.type?(l.fillStyle=this.color.getColor(),l.font=this.font,l.textBaseline="alphabetic",l.fillText(this.text.toString(e.eval(this.decimals),this.fixed),parseInt(a+1+this.width/2),parseInt(b-1-this.height/2))):(l.fillStyle=this.color.getColor(),l.strokeStyle=this.color.getColor(),l.textBaseline="alphabetic",this.text.draw(l,parseInt(a+1+this.width/2),parseInt(b-1-this.height/2),this.decimals,this.fixed,"start",
!0,this.color.getColor()))};w.prototype.getContainer=function(){for(var a=this.parent.spaces,b,c=0,d=a.length;c<d;c++)if(b=a[c],b.id==this.spaceID)return b.addCtr(this),this.zIndex=b.zIndex,this.space=b,b.graphicControlContainer;a[0].addCtr(this);this.zIndex=a[0].zIndex;this.space=a[0];return a[0].graphicControlContainer};w.prototype.deactivate=function(){this.active=!1;this.evaluator.setVariable(this.activoStr,0);this.evaluator.setVariable(this.activeStr,0);this.evaluator.setVariable(this.mclicizquierdoStr,
0)};w.prototype.addEvents=function(){function b(b){document.body.focus();b.preventDefault();g.whichBtn=a.whichBtn(b);"L"==g.whichBtn&&g.activeIfValue&&(g.parent.deactivateGraphicControls(),g.click=g.active=!0,g.evaluator.setVariable(g.activoStr,1),g.evaluator.setVariable(g.activeStr,1),g.evaluator.setVariable(g.mclickedStr,0),g.evaluator.setVariable(g.mclicizquierdoStr,0),g.posAnte=a.getCursorPosition(b,g.container),g.prePos={x:g.space.getAbsoluteX(g.x),y:g.space.getAbsoluteY(g.y)},g.evaluator.setVariable(g.mxStr,
g.space.getRelativeX(g.posAnte.x)),g.evaluator.setVariable(g.myStr,g.space.getRelativeY(g.posAnte.y)),g.parent.update(),window.addEventListener("touchend",c),window.addEventListener("touchmove",d),window.addEventListener("mouseup",c),window.addEventListener("mousemove",d))}function c(b){document.body.focus();b.preventDefault();b.stopPropagation();g.evaluator.setVariable(g.mclickedStr,1);g.evaluator.setVariable(g.mclicizquierdoStr,1);if(g.activeIfValue||g.active)g.click=!1,window.removeEventListener("mouseup",
c),window.removeEventListener("mousemove",d),window.removeEventListener("touchend",c),window.removeEventListener("touchmove",d),k=a.getCursorPosition(b,g.container)||k,g.posX=g.prePos.x-(g.posAnte.x-k.x),g.posY=g.prePos.y-(g.posAnte.y-k.y),g.evaluator.setVariable(g.xStr,g.space.getRelativeX(g.posX)),g.evaluator.setVariable(g.yStr,g.space.getRelativeY(g.posY)),g.evaluator.setVariable(g.mxStr,g.space.getRelativeX(k.x)),g.evaluator.setVariable(g.myStr,g.space.getRelativeY(k.y)),g.parent.updateControls(),
g.parent.update(),g.mouseCatcher.style.left=g.space.getAbsoluteX(g.x)-g._w/2+"px",g.mouseCatcher.style.top=g.space.getAbsoluteY(g.y)-g._h/2+"px";g.parent.deactivateGraphicControls();g.parent.updateControls()}function d(b){b.preventDefault();g.evaluator.setVariable(g.mclickedStr,0);g.evaluator.setVariable(g.mclicizquierdoStr,0);k=a.getCursorPosition(b,g.container);g.posX=g.prePos.x-(g.posAnte.x-k.x);g.posY=g.prePos.y-(g.posAnte.y-k.y);g.evaluator.setVariable(g.xStr,g.space.getRelativeX(g.posX));g.evaluator.setVariable(g.yStr,
g.space.getRelativeY(g.posY));g.evaluator.setVariable(g.mxStr,g.space.getRelativeX(k.x));g.evaluator.setVariable(g.myStr,g.space.getRelativeY(k.y));80<Date.now()-e&&(g.parent.updateControls(),g.parent.update(),e=Date.now())}var e=0,k,g=this;this.active=this.over=this.click=!1;this.mouseCatcher.oncontextmenu=function(){return!1};this.mouseCatcher.addEventListener("touchstart",b);this.mouseCatcher.addEventListener("mousedown",b);this.mouseCatcher.addEventListener("mouseover",function(a){g.over=!0});
this.mouseCatcher.addEventListener("mouseout",function(a){g.over=!1;g.click=!1})};a.GraphicControl=w;return a}(descartesJS||{});
descartesJS=function(a,f){var e,d,r,m,b,h,g,l,q,c;function u(a){return a.charAt(0).toUpperCase()+a.substring(1)}if(a.loadLib)return a;var k=/[\w-//]*(\.png|\.jpg|\.gif|\.svg)/gi,w,p,v,n,z,x,y,B,E,J,G,H,A,I,C,M,N,O,F,D,K,L,P,R,Q,W,V,U,T,S=function(b){this.parent=b;this.parser=b.evaluator.parser;this.RTFparser=new a.RTFParser(b.evaluator)};S.prototype.parseButtonsConfig=function(a){var b={rowsNorth:0,rowsSouth:0,widthEast:125,widthWest:125,height:23};a=this.split(a);for(var c=0,d=a.length;c<d;c++)switch(v=
a[c][0],n=a[c][1],p=f[v],p){case "rowsNorth":case "rowsSouth":case "widthEast":case "widthWest":case "height":b[p]=parseInt(n);break;case "about":case "config":case "init":case "clear":b[p]="true"===f[n];break;default:console.warn("Propiedad de botones no identificada: <"+v+"> valor: <"+n+">")}return b};S.prototype.parseSpace=function(b){z={};b=this.split(b);for(var c=0,d=b.length;c<d;c++)switch(v=b[c][0],n=b[c][1],p=f[v],a.DEBUG.paramName=v,a.DEBUG.objectName="Space",p){case "type":if("R2"===n||
"R3"===n)n=f[n];z[p]=n;break;case "id":a.DEBUG.idName=n;case "x_axis":case "y_axis":case "cID":case "file":case "border":case "border_radius":case "info":z[p]=n;break;case "fixed":case "numbers":case "sensitive_to_mouse_movements":case "3D":case "split":case "resizable":z[p]="true"===f[n];break;case "bg_display":case "render":z[p]=f[n];break;case "borderColor":case "net":case "net10":case "axes":case "text":z[p]=""!=n?"false"===f[n]?"":new a.Color(n,this.parent.evaluator):"";break;case "O.x":z.OxExpr=
n;break;case "O.y":z.OyExpr=n;break;case "image":z.imageSrc=n;break;case "x":w=n;"%"===w[w.length-1]?(z.xPercentExpr=w.trim(),w=(this.parent.container.width*parseFloat(w)/100).toString()):w=n;z.xExpr=this.parser.parse(w);break;case "y":w=n;"%"===w[w.length-1]?(z.yPercentExpr=w.trim(),w=(this.parent.container.height*parseFloat(w)/100).toString()):w=n;z.yExpr=this.parser.parse(w);break;case "width":w=n.trim();z.wModExpr=w;"%"===w[w.length-1]?(z.wExpr=w,w=this.parent.container.width*parseFloat(w)/100):
(w=parseFloat(n),w!=n&&(w=this.parent.container.width,z._w_=n.trim()));z.w=w;break;case "height":w=n.trim();z.hModExpr=w;"%"===w[w.length-1]?(z.hExpr=w,w=this.parent.container.height*parseFloat(w)/100):(w=parseFloat(n),w!=n&&(w=this.parent.container.height,z._h_=n.trim()));z.h=w;break;case "drawif":""!=n&&(z.drawif=this.parser.parse(n));break;case "scale":w=parseFloat(n);isNaN(w)&&(w=48);z.scale=w;break;case "background":z.background=new a.Color(n,this.parent.evaluator);break;default:console.warn("Propiedad del espacio no identificada: <"+
v+"> valor: <"+n+">")}return new a["Space"+z.type](this.parent,z)};S.prototype.parseControl=function(b){x={type:"Numeric",gui:"Spinner"};b=this.split(b);for(var c=0,d=b.length;c<d;c++)switch(v=b[c][0],n=b[c][1],p=f[v],a.DEBUG.paramName=v,a.DEBUG.objectName="Control",p){case "type":w=f[n.trim()];"graphic"===w?w="GraphicControl":"text"===w&&(w="TextArea");x.type=u(w);break;case "gui":w=f[n];"textfield"===w&&(w="TextField");x[p]=u(w);break;case "id":a.DEBUG.idName=n;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 "info":x[p]=
n;break;case "region":case "action":case "msg_pos":case "poster":case "text_align":case "image_align":case "btn_pos":x[p]=f[n];break;case "fixed":case "visible":case "discrete":case "onlyText":case "evaluate":case "autoplay":case "loop":case "controls":case "flat":x[p]="true"===f[n];break;case "color":case "colorInt":case "trace":x[p]=new a.Color(n,this.parent.evaluator);break;case "font_size":case "drawif":case "activeif":case "decimals":case "min":case "max":case "size":""!==n&&(x[p]=this.parser.parse(n));
break;case "constraint":x.constraintExpr=n;break;case "image":x.imageSrc=n;break;case "image_dec":x.image_dec_src=n;break;case "image_inc":x.image_inc_src=n;break;case "space":x.spaceID=n;break;case "expresion":x.expresion=this.parser.parse(n.replace(")(",","));break;case "borderColor":x[p]="false"===f[n]?"":n;break;case "bold":"false"!=f[n]&&(x.bold="bold");break;case "italics":"false"!=f[n]&&(x.italics="italic");break;case "underlined":"false"!=f[n]&&(x.underlined=!0);break;case "value":var e=n.replace(/&squot;/g,
"'");e.match(/^\|/)&&(e="'"+e.substring(1),e.match(/\|$/)&&(e=e.substring(0,e.length-1)+"'"));x.valueExpr=this.parser.parse(e);x.valueExprString=e;break;case "incr":0!=n&&(x.incr=this.parser.parse(n));break;case "exponentialif":x.exponentialif=parseFloat(n);break;case "text":x.rawText=n;e=this.parseText(n);for(var g=0,k=e.length;g<k;g++)e[g]=this.parser.parse(e[g],!1);x.text=e;break;default:g=v.indexOf("."),e=f[v.substring(0,g)],g=f[v.substring(g+1)],"parameter"===e&&"font"===g?x.parameterFont=n:
"Explanation"===e&&"font"===g?x.ExplanationFont=n:"tooltip"===e&&"font"===g?x.tooltipFont=n:console.warn("Propiedad de control no identificada: <"+v+"> valor: <"+n+">")}return new a["Numeric"===x.type?x.gui:x.type](this.parent,x)};S.prototype.parseGraphic=function(b,c,d,e){y={rotateExp:e,parameter:"t"};b=this.split(b);e=0;for(var g=b.length;e<g;e++)if(v=b[e][0],n=b[e][1],p=f[v],a.DEBUG.paramName=v,a.DEBUG.objectName="Graphic",""!=n)switch(p){case "type":a.DEBUG.idName=n;y[p]=u(f[n]);break;case "align":case "anchor":case "lineDash":y[p]=
f[n];break;case "background":case "abs_coord":case "visible":case "editable":case "fixed":case "vectors":case "bold":case "italics":case "underlined":y[p]="true"===f[n];break;case "color":case "fill":case "fillP":case "fillM":case "arrow":case "trace":y[p]="false"===f[n]?"":new a.Color(n,this.parent.evaluator);break;case "family":case "parameter":case "info":case "font":case "font_family":case "name":case "init":case "end":y[p]=n;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":""!==
n&&(y[p]=this.parser.parse(n));break;case "font_size":n=n.trim();n.match(/^\[.*\]?/)&&(n=n.substring(1,n.length-1));""!==n&&(y[p]=this.parser.parse(n));break;case "space":y.spaceID=n;break;case "expresion":""!==n&&("Macro"!==y.type?(y.expresion=this.parser.parse(n),y.expresionString=n):y.expresion=n);break;case "text":y.text=n;break;case "file":var l=n.replace(/&squot;/g,"'");"["===l.charAt(0)&&"]"===l.charAt(l.length-1)&&(l=l.substring(1,l.length-1));l.match(k)&&(l="'"+l+"'");y.file=this.parser.parse(l);
break;case "border":""!=n&&"false"!=f[n]&&(y.border=new a.Color(n,this.parent.evaluator));break;default:if(void 0!=y.family&&v.substring(0,y.family.length+1)===y.family+".")switch(f[v.substring(y.family.length+1)]){case "interval":""!=n&&(y.family_interval=this.parser.parse(n));break;case "steps":""!=n&&(y.family_steps=this.parser.parse(n))}else if(void 0!=y.parameter&&v.match(y.parameter+"."))switch(y.parameter!==v.substring(0,v.indexOf(y.parameter)+y.parameter.length)&&(y.parameter=v.substring(0,
v.indexOf(y.parameter)+y.parameter.length)),f[v.substring(y.parameter.length+1)]){case "interval":""!=n&&(y.parameter_interval=this.parser.parse(n));break;case "steps":""!=n&&(y.parameter_steps=this.parser.parse(n))}else console.warn("Propiedad del gr\u00e1fico no identificada: <"+v+"> valor: <"+n+">")}c&&(y.abs_coord=c);d&&(y.background=d);return new a[y.type](this.parent,y)};S.prototype.parse3DGraphic=function(b,c,d,e){y={rotateExp:e,parameter:"t"};b=this.split(b);c=0;for(d=b.length;c<d;c++)switch(v=
b[c][0],n=b[c][1],p=f[v],a.DEBUG.paramName=v,a.DEBUG.objectName="Graphic3D",p){case "type":a.DEBUG.idName=n;w=f[n];switch(w){case "cube":case "box":case "tetrahedron":case "octahedron":case "sphere":case "dodecahedron":case "icosahedron":case "ellipsoid":case "cone":case "cylinder":case "torus":case "mesh":y.subType=w,w="OtherGeometry"}y[p]=u(w);break;case "model":case "lineDash":y[p]=f[n];break;case "fill":y[p]="false"===f[n]?"":new a.Color(n,this.parent.evaluator);break;case "background":case "fixed":case "split":case "bold":case "italics":case "underlined":y[p]=
"true"===f[n];break;case "edges":"false"===f[n]?y[p]="":("true"===f[n]&&(n="808080"),y[p]=new a.Color(n,this.parent.evaluator));break;case "color":case "backcolor":y[p]=new a.Color(n,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":""!=n&&(y[p]=this.parser.parse(n));break;case "family":case "parameter":case "font":case "font_family":case "name":case "inirot":case "endrot":case "info":y[p]=
n;break;case "space":y.spaceID=n;break;case "expresion":"Macro"!=y.type&&"Curve"!=y.type&&"Surface"!=y.type?(y.expresion=this.parser.parse(n),y.expresionString=n):y.expresion=n.replace(/\\n/g,";");break;case "text":y.text=n;break;case "file":e=n.replace(/&squot;/g,"'");"["===e.charAt(0)&&"]"===e.charAt(e.length-1)&&(e=e.substring(1,e.length-1));e.match(/./)&&(e="'"+e+"'");y.file=this.parser.parse(e);break;default:void 0!==y.family&&v.substring(0,y.family.length+1)===y.family+"."?"interval"===f[v.substring(y.family.length+
1)]?""!=n&&(y.family_interval=this.parser.parse(n)):""!=n&&(y.family_steps=this.parser.parse(n)):console.warn("Propiedad del gr\u00e1fico 3D no identificada: <"+v+"> valor: <"+n+">")}return new a[y.type+"3D"](this.parent,y)};S.prototype.parseAuxiliar=function(b){B={};b=this.split(b);for(var c=0,d=b.length;c<d;c++)b[c][1]=b[c][1].replace(/&squot;/g,"'");c=0;for(d=b.length;c<d;c++)switch(v=b[c][0],n=b[c][1],p=f[v],a.DEBUG.paramName=v,a.DEBUG.objectName="Auxiliar",p){case "info":case "code":case "doc":break;
case "id":a.DEBUG.idName=n;case "file":case "init":case "doExpr":case "whileExpr":case "range":case "local":case "expresion":case "condition":case "parameter":B[p]=n.replace(/&squot;/g,"'");break;case "editable":case "constant":case "array":case "matrix":case "algorithm":case "event":case "sequence":B[p]="true"===f[n];break;case "size":case "rows":case "columns":case "x":case "y":case "width":case "height":B[p]=this.parser.parse(n);break;case "evaluate":case "execution":case "msg_pos":case "action":case "type":B[p]=
f[n];break;default:var e=v.indexOf("."),g=f[v.substring(0,e)];e=f[v.substring(e+1)];"parameter"===g&&"font"===e?B.parameterFont=n:console.warn("Propiedad del auxiliar no identificada: <"+v+"> valor: <"+n+">")}B.sequence?B.type="sequence":B.constant?B.type="constant":B.algorithm&&B.evaluate?B.type="algorithm":B.array&&!B.matrix&&")"!=B.id.charAt(B.id.length-1)?B.type="vector":B.matrix&&")"!=B.id.charAt(B.id.length-1)?B.type="matrix":B.event&&")"!=B.id.charAt(B.id.length-1)?B.type="event":"library"===
B.type?B.type="library":")"===B.id.charAt(B.id.length-1)?B.type="function":B.type="variable";a.DEBUG.typeName=B.type;switch(B.type){case "sequence":new a.Function(this.parent,B);break;case "constant":b=new a.Constant(this.parent,B);B.evaluate&&"always"===B.evaluate&&this.parent.auxiliaries.push(b);break;case "algorithm":this.parent.auxiliaries.push(new a.Algorithm(this.parent,B));break;case "vector":b=new a.Vector(this.parent,B);B.evaluate&&"always"===B.evaluate&&this.parent.auxiliaries.push(b);break;
case "matrix":b=new a.Matrix(this.parent,B);B.evaluate&&"always"===B.evaluate&&this.parent.auxiliaries.push(b);break;case "event":this.parent.events.push(new a.Event(this.parent,B));break;case "library":new a.Library(this.parent,B);break;case "variable":new a.Variable(this.parent,B);break;default:new a.Function(this.parent,B)}};S.prototype.parseAction=function(b){E=b.action;J=b.parent;G=b.parameter;return E?new (a[u(E)])(J,G):{execute:function(){}}};S.prototype.parseAnimation=function(b){var c={};
b=this.split(b);for(var d=0,e=b.length;d<e;d++)switch(v=b[d][0],n=b[d][1],p=f[v],p){case "id":case "delay":case "init":case "doExpr":case "whileExpr":c[p]=n.replace(/&squot;/g,"'");break;case "controls":case "auto":case "loop":case "algorithm":case "evaluate":c[p]="true"===f[n];break;default:console.warn("Propiedad de la animaci\u00f3n no identificada: <"+v+">  <"+n+">")}return new a.Animation(this.parent,c)};S.prototype.parsePleca=function(k,f){k=this.split(k);d=e="";r=0;m="#536891";b="white";h=
"left";g="";l="SansSerif,BOLD,20";q="SansSerif,PLAIN,18";c=void 0;for(var p=0,u=k.length;p<u;p++)switch(v=k[p][0],n=k[p][1],v){case "title":e=n;break;case "subtitle":d=n;break;case "subtitlines":r=n;break;case "bgcolor":""!=n&&(m=(new a.Color(n,this.parent.evaluator)).getColor());break;case "fgcolor":""!=n&&(b=(new a.Color(n,this.parent.evaluator)).getColor());break;case "align":""!=n&&(h=n);break;case "titleimage":g=n;break;case "titlefont":l=""!=n?a.convertFont(n):a.convertFont(l);break;case "subtitlefont":q=
""!=n?a.convertFont(n):a.convertFont(q);break;default:console.warn("Propiedad de la pleca no identificada: <"+v+">  <"+n+">")}if(""===e&&""===d)return a.newHTML("div");O=q.substring(0,q.indexOf("px"));O=O.substring(O.lastIndexOf(" "));""!=g&&(F=this.parent.getImage(g),D=F.height);c=a.newHTML("div",{id:"descartesPleca"});D?(c.setAttribute("style","position:absolute;left:0;top:0;text-align:"+h+";width:"+f+"px;height:"+D+"px;background-color:"+m+";color:"+b+";padding-top:8px;padding:8px 15px 8px 15px;margin:0;overflow:hidden;z-index:1;"),
F.setAttribute("style","position: absolute;left:0;top:0;z-index:-1;width:100%;height:100%;"),c.appendChild(F)):c.setAttribute("style","position:absolute;left:0;top:0;text-align:"+h+";width:"+f+"px;background:"+m+";color:"+b+";padding:12px 15px 12px 15px;margin:0;z-index:100;");K=a.newHTML("div",{style:"padding:0;margin:0;font:"+l+";overflow:hidden;white-space:nowrap;"});K.innerHTML=e;L=a.newHTML("div");if(1===parseInt(r)){V=0;P=a.newHTML("div");P.innerHTML=d;document.body.appendChild(P);Q=O;do Q-=
V,P.setAttribute("style","padding:0;margin:0;font:"+q+";font-size:"+Q+"px;width:"+(f-30)+"px;line-height:"+Q+"px;"),R=P.offsetHeight,W=R/Q,V=1;while(1<W&&8<Q);document.body.removeChild(P);L.setAttribute("style","padding:0;margin:0;font:"+q+";font-size:"+Q+"px;line-height:1em;overflow:hidden;white-space:nowrap;")}else L.setAttribute("style","padding:0;margin:0;font:"+q+";line-height:1em;");L.innerHTML=d;c.appendChild(K);c.appendChild(L);c.imageHeight=D;return c};S.prototype.split=function(a){if("string"!==
typeof a)return[];H=[];a=(a||"").replace(/\\'/g,"\u2019");A=I=M=0;for(C=N=!1;A<a.length;)" "!==a.charAt(A)||C||A++," "===a.charAt(A)||C||(C=!0,M=A),"="!==a.charAt(A)||"'"!==a.charAt(A+1)||N||(N=!0,H[I]=[a.substring(M,A)],M=A+2,A+=2),N&&"'"===a.charAt(A)&&(C=N=!1,H[I].push(a.substring(M,A)),I++),"="!==a.charAt(A)||"'"===a.charAt(A+1)||N||(H[I]=[a.substring(M,A)],M=A+1,A++,U=a.substring(A).indexOf("="),-1===U?T=U=a.length:(U+=A,T=a.substring(A,U).lastIndexOf(" "),T=-1===T?a.length:T+A),H[I].push(a.substring(M,
T)),I++,C=!1,A=T),A++;return H};S.prototype.parseText=function(b){b=b||"";return b.match(/^\{\\rtf1/)?this.RTFparser.parse(b.substring(10)):new a.SimpleText(this.parent,b)};a.LessonParser=S;return a}(descartesJS||{},babel);
descartesJS=function(a){function f(a,b){if(0==b)return 1;if(0>b)return NaN;if(0<=a||h(b)===b)return Math.pow(a,b);if(0>a){var c=1/b,d=h(c);if(d===c&&1===d%2)return-Math.pow(-a,b)}return NaN}function e(a,b){p=[];p.type="matrix";p.rows=a;p.cols=b;n=0;for(z=b;n<z;n++)p[n]=Array(a).fill(0);return p}function d(a,b){k=a.rows;w=a.cols;p=e(k,w);var c;for(n=0;n<k;n++)for(v=0;v<w;v++){for(z=c=0;z<w;z++)c+=a[z][n]*b[v][z];p[v][n]=c}return p}function r(a,b,c){for(var d=e(c.length-1,c.length-1),g=0,k=d.length;g<
k;g++)for(var f=0;f<k;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 m(a){if(1<a.cols){for(var b=0,c=1,d=0,e=a.cols;d<e;d++)b+=c*a[0][d]*m(r(0,d,a)),c=-c;return b}return a[0][0]}if(a.loadLib)return a;var b={},h=Math.floor,g,l,q,c,u,k,w,p,v,n,z,x=function(a,b){this.sep="";this.type=a;this.value=b;this.parent=null;this.childs=[]};x.prototype.getRoot=function(){return null===this.parent?this:this.parent.getRoot()};x.prototype.addChild=function(a){a.parent=this;this.childs.push(a)};
x.prototype.replaceLastChild=function(a){q=this.childs.length-1;l=this.childs[q];l.parent=null;this.childs[q]=a;a.parent=this;return a};x.prototype.contains=function(a){if(this.value===a)return!0;for(var b=0,c=this.childs.length;b<c;b++)if(this.childs[b].contains(a))return!0;return!1};x.prototype.equalToMinus=function(){return"compOperator"===this.type?(this.type="operator",this.value="-",u=new x("compOperator","=="),u.addChild(this),u.addChild(new x("number","0")),c=this.getRoot(),c.setAllEvalFun(),
c):this};x.prototype.setAllEvalFun=function(){this.setEvalFun();for(var a=0,b=this.childs.length;a<b;a++)this.childs[a].setAllEvalFun()};x.prototype.setEvalFun=function(){if("number"===this.type)this.evaluate=function(){return parseFloat(this.value)};else if("string"===this.type)this.evaluate=function(){return this.value.replace(/\\u0027/g,"'")};else if("identifier"===this.type&&0===this.childs.length)if("rnd"===this.value)this.evaluate=function(){return Math.random()};else{var c;this.evaluate=function(a,
b){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}}else if("identifier"===this.type&&"square_bracket"===this.childs[0].type&&1===this.childs[0].childs.length){var l;this.evaluate=function(a){try{return l=a.getVector(this.value,this.childs[0].childs[0].evaluate(a)),void 0!==l?l:0}catch(N){return 0}}}else if("identifier"===this.type&&
"square_bracket"===this.childs[0].type&&1<this.childs[0].childs.length)this.evaluate=function(a){try{return l=a.getMatrix(this.value,this.childs[0].childs[0].evaluate(a),this.childs[0].childs[1].evaluate(a)),void 0!==l?l:0}catch(N){return 0}};else if("identifier"===this.type&&"parentheses"===this.childs[0].type){var u,q,x;this.evaluate=function(a){u=[];for(var c=0,d=this.childs[0].childs.length;c<d;c++)u[c]=this.childs[0].childs[c].evaluate(a);if("_Eval_"===this.value){g=0<u.length?u[0]:0;if("number"==
typeof g)return"NaN";g.match(",")&&parseFloat(g.replace(",","."))==g.replace(",",".")&&(g=g.replace(",","."));if(void 0==b[g]){q=g.match(/:=/g)?!0:!1;if(g.match(";")){var e=!1,k=[],f=0;c=0;for(d=g.length;c<d;c++){var l=g.charAt(c);"'"===l&&(e=!e);e||";"!==l||(k.push(g.substring(f,c)),f=c+1)}k.push(g.substring(f));g="("+k.join(")(")+")"}b[g]=a.parser.parse(g,q)}x=a.eval(b[g]);return void 0!=x?x:NaN}return a.functions[this.value].apply(a,u)}}else if("operator"===this.type)"+"===this.value?this.evaluate=
function(b){var c=this.childs[0].evaluate(b,!0);b=this.childs[1].evaluate(b,!0);if("matrix"!==c.type||"matrix"!==b.type)return"number"==typeof c&&"string"==typeof b?c=a.removeNeedlessDecimals(c.toString()):"string"==typeof c&&"number"==typeof b&&(b=a.removeNeedlessDecimals(b.toString())),c+b;k=c.rows;w=c.cols;p=e(k,w);for(n=0;n<k;n++)for(v=0;v<w;v++)p[v][n]=c[v][n]+b[v][n];return p}:"-"===this.value?this.evaluate=function(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;k=b.rows;w=b.cols;p=e(k,w);for(n=0;n<k;n++)for(v=0;v<w;v++)p[v][n]=b[v][n]-a[v][n];return p}:"*"===this.value?this.evaluate=function(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:d(b,a)}:"/"===this.value?this.evaluate=function(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=e(a.length,a.length),g=m(a);if(0===g)a=
0;else{g=1/g;if(1<a.length)for(var k=0,f=a.length;k<f;k++){var l=g;for(var n=0;n<f;n++)c[n][k]=l*m(r(k,n,a)),l=-l;g=-g}else c[0][0]=g;a=c}b=0===a?e(b.rows,b.cols):d(b,a);return b}:"%"===this.value?this.evaluate=function(a){var b=this.childs[0].evaluate(a);a=this.childs[1].evaluate(a);return b-h(b/a)*a}:"^"===this.value&&(this.evaluate=function(a){var b=this.childs[0].evaluate(a);a=this.childs[1].evaluate(a);return 0<=a?f(b,a):1/f(b,-a)});else if("compOperator"===this.type)"<"===this.value?this.evaluate=
function(a){return+(this.childs[0].evaluate(a)<this.childs[1].evaluate(a))}:"<="===this.value?this.evaluate=function(a){return+(this.childs[0].evaluate(a)<=this.childs[1].evaluate(a))}:">"===this.value?this.evaluate=function(a){return+(this.childs[0].evaluate(a)>this.childs[1].evaluate(a))}:">="===this.value?this.evaluate=function(a){return+(this.childs[0].evaluate(a)>=this.childs[1].evaluate(a))}:"=="===this.value?this.evaluate=function(a){return+(this.childs[0].evaluate(a)===this.childs[1].evaluate(a))}:
"!="===this.value&&(this.evaluate=function(a){return+(this.childs[0].evaluate(a)!==this.childs[1].evaluate(a))});else if("boolOperator"===this.type)"&"===this.value?this.evaluate=function(a){return this.childs[0].evaluate(a)?this.childs[1].evaluate(a)?1:0:0}:"|"===this.value?this.evaluate=function(a){return this.childs[0].evaluate(a)?1:this.childs[1].evaluate(a)?1:0}:"!"===this.value&&(this.evaluate=function(a){return+!this.childs[0].evaluate(a)});else if("conditional"===this.type)this.evaluate=function(a){return 0<
this.childs[0].evaluate(a)?this.childs[1].evaluate(a):this.childs[2].evaluate(a)};else if("sign"===this.type)this.evaluate="sign+"===this.value?function(a){return this.childs[0].evaluate(a)}:function(a){return-this.childs[0].evaluate(a)};else if("parentheses"===this.type)this.evaluate=function(a,b){return this.childs[0].evaluate(a,b)};else if("(expr)"===this.type||"[expr]"===this.type)this.evaluate=function(a){var b=this.childs.length,c=[];if(1===b&&1===this.childs[0].childs.length&&"(expr)"===this.type)c=
this.childs[0].childs[0].evaluate(a);else for(var d=0;d<b;d++){var e=[];for(var g=0,k=this.childs[d].childs.length;g<k;g++)e.push(this.childs[d].childs[g].evaluate(a));c[d]=e}return c};else if("asign"===this.type){var z,A=this.childs[0],I=this.childs[1],C=A.childs[0]?A.childs[0].childs:null;this.evaluate=1===A.childs.length&&"square_bracket"===A.childs[0].type&&1===C.length?function(a){z=I.evaluate(a);a.setVector(A.value,C[0].evaluate(a),z);return z}:1===A.childs.length&&"square_bracket"===A.childs[0].type&&
2===C.length?function(a){z=I.evaluate(a);a.setMatrix(A.value,C[0].evaluate(a),C[1].evaluate(a),z);return z}:function(a){z=I.evaluate(a);return z.type?a.matrices[A.value]=z:"object"!==typeof a.variables[A.value]?a.variables[A.value]=z:0}}};a.Node=x;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h,g,l=/^\s+/,q=/^[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]*)*/,c=/^[0-9]+[.][0-9]+|^[.][0-9]+|^[0-9]+/,u=/^==|^!=|^<=|^<|^>=|^>|^#/,k=/^!|^~|^&&|^&|^\|\||^\|/,w=/^=|^:=/,p=/^[\?:]/,v=/^[\+\-\*\/%\^\u2212\u00b7\u00D7\u00F7]/,n=/^\[|^\]/,z=/^\(|^\)/,x=/^,/,y=/^;/,B=/\|/g,E=/\|\*/g,J=/\*\|/g,G,H=/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/,
A=function(){};A.prototype.tokenize=function(A){function G(a,c,d){e.push({type:a,value:c});b=b.slice(d);r+=d;g=a}if(f=A){var H=A.indexOf("//");0<=H&&":"!==A[H-1]&&(A=A.substring(0,H));A=A.replace(/\\u(\S+) /g,function(a,b){return 39!==parseInt(b,16)?String.fromCharCode(parseInt(b,16)):a});A=A.replace(/&sup(.+);/g,"^ $1 ");A=A.replace(/&squot;/g,"'");A.match(/=\|\*/g)&&(A=A.replace(E,"'").replace(J,"'"));A.match(/=\|/g)&&(A=A.replace(B,"'"));H=A.trim();"|"==H.charAt(0)&&"|"==H.charAt(H.length-1)&&
(A=H.replace(B,"'"))}e=[];d=!1;r=0;b=A;for(g="";A&&r<A.length;)if(d=r,"'"==b[0]){for(h=1;"'"!=b[h];)if(h<b.length)h++;else{console.info(">Error, unknown symbol: ["+b+"], in the string \u300a"+f+"\u300b");return}m=b.substring(1,h);G("string",m,m.length+2)}else if(m=b.match(l))b=b.slice(m[0].length),r+=m[0].length;else if(m=b.match(v))m[0]=m[0].replace(/\u00F7/g,"/").replace(/\u2212/g,"-").replace(/\u00b7/g,"*").replace(/\u00D7/g,"*"),G("operator",m[0],m[0].length);else if(m=b.match(q))"number"===g&&
e.push({type:"operator",value:"*"}),G("identifier",m[0],m[0].length);else if(m=b.match(c))G("number",m[0],m[0].length);else if(m=b.match(u))H=m[0],"#"==H&&(H="!="),G("compOperator",H,m[0].length);else if(m=b.match(k))H=m[0],"||"==H?H="|":"&&"==H?H="&":"~"==H&&(H="!"),G("boolOperator",H,m[0].length);else if((m=b.match(w))&&!b.match(/^==/))G("asign",m[0],m[0].length);else if(m=b.match(p))G("conditional",m[0],m[0].length);else if(m=b.match(n))G("square_bracket",m[0],m[0].length);else if(m=b.match(z))"("==
m&&"number"===g&&e.push({type:"operator",value:"*"}),G("parentheses",m[0],m[0].length);else if(m=b.match(x))G("separator",m[0],m[0].length);else if(178===b.charCodeAt(0))e.push({type:"operator",value:"^"}),G("number",2,1);else if(179===b.charCodeAt(0))e.push({type:"operator",value:"^"}),G("number",3,1);else if(m=b.match(y))G("final_of_expression",m[0],m[0].length);else if(d==r){a.DEBUG.setError(a.DEBUG.EXPRESSION,f);return}return e};A.prototype.flatTokens=function(a,b){a=a||[];b=b||"";G="";for(var c=
0,d=a.length;c<d;c++)G="string"==a[c].type?G+"&squot;"+a[c].value+"&squot;":"identifier"!=a[c].type||a[c].value.match(H)?G+a[c].value:G+b+a[c].value;return G};a.Tokenizer=A;return a}(descartesJS||{});
descartesJS=function(a){function f(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 e(a){return isNaN(parseFloat(a))?a.replace(/^\s|\s$/g,"").replace(/^'|'$/g,""):parseFloat(a)==a?parseFloat(a):a.replace(/^\s|\s$/g,"").replace(/^'|'$/g,"")}if(a.loadLib)return a;a.reservedIds=new String("-_-rnd-pi-\u03c0-e-Infinity-isTouch-esT\u00e1ctil-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-ceil-round-min-max-_Trace_-_Print_-_Num_-_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_-_Open_-_SaveState_-_OpenState_-_AnchoDeCadena_-_strWidth_-R-G-B-_Rojo_-_Red_-_Verde_-_Green_-_Azul_-_Blue_-DJS.typeof-");
var d=Date.now(),r,m,b,h,g,l,q,c,u,k,w,p,v=function(b){this.evaluator=b;this.tokenizer=new a.Tokenizer;this.vectors={};this.matrices={};this.variables={};this.functions={};this.definitions={};this.registerDefaultValues();this.registerExternalValues&&this.registerExternalValues()};v.prototype.setDefinition=function(a,b){this.definitions[a]=b};v.prototype.getDefinition=function(a){return this.definitions[a]};v.prototype.setVariable=function(a,b){this.variables[a]=b};v.prototype.getVariable=function(a,
b){b&&(this.variables[a]=void 0!==this.variables[a]?this.variables[a]:void 0);return this.variables[a]};v.prototype.setVector=function(a,b,c){this.vectors[a][b]=c};v.prototype.getVector=function(a){this.vectors.hasOwnProperty(a)||(this.vectors[a]=[0,0,0]);return this.vectors[a]};v.prototype.setMatrix=function(a,b,c,d){this.matrices[a][b][c]=d};v.prototype.getMatrix=function(a){this.matrices.hasOwnProperty(a)||(this.matrices[a]=[[0,0,0],[0,0,0],[0,0,0]]);return this.matrices[a]};v.prototype.setFunction=
function(a,b){this.functions[a]=b};v.prototype.getFunction=function(a){this.functions.hasOwnProperty(a)||(this.functions[a]=function(){return 0});return this.functions[a]};v.prototype.parse=function(d,e){(b=this.tokenizer.tokenize(d))||(b=[]);h=null;e=!e||!1;r=c=q=l=0;for(m=b.length;r<m;r++){u=b[r];k=u.value;w=u.type;if("identifier"===w)if(r+1<m&&"parentheses"===b[r+1].type&&"("===b[r+1].value)this.getFunction(k);else if(r+1<m&&"square_bracket"===b[r+1].type&&"["===b[r+1].value)b[r+3]&&"square_bracket"===
b[r+3].type&&"]"===b[r+3].value?this.getVector(k):this.getMatrix(k);else{var n=k.match(/(\w*)\.mouse_x|(\w*)\.mouse_y|(\w*)\.mouse_pressed|(\w*)\.mouse_clicked|(\w*)\.clic_izquierdo/);n&&(this.variables[(n[1]||n[2]||n[3]||n[4]||n[5])+".DESCARTESJS_no_fixed"]=1);this.getVariable(k,!0)}"asign"===w&&e&&":="!=k&&(w="compOperator",k="==");if("asign"===w)if(g=new a.Node(w,k),null!=h)if("identifier"===h.type)h.parent&&h.parent.replaceLastChild(g),g.addChild(h),h=g,e=!0;else if("square_bracket"===h.type)g.addChild(h.parent),
h=g,e=!0;else{g.type="compOperator";g.value="==";for(e=!0;h.parent&&f(h.parent.value)>=f(g.value);)h=h.parent;h.parent&&h.parent.replaceLastChild(g);g.addChild(h);h=g}else{console.info("Error1: en la expresi\u00f3n \u300a "+d+" \u300b, en el token {valor: "+k+", tipo: "+w+"}");break}else if("parentheses"===w&&"("===k||"square_bracket"===w&&"["===k)if(g=new a.Node(w,k),"("===k&&l++,"["===k&&q++,null===h)"("===k&&(new a.Node("(expr)","(expr)")).addChild(g),"["===k&&(new a.Node("[expr]","[expr]")).addChild(g),
h=g;else if("operator"===h.type||"boolOperator"===h.type||"compOperator"===h.type||"conditional"===h.type||"asign"===h.type)h.addChild(g),h=g;else if("sign"===h.type)h.addChild(g),h=g;else if("parentheses"===h.type&&"("===h.value)h.addChild(g),h=g;else if("square_bracket"===h.type&&"["===h.value)h.addChild(g),h=g;else if("parentheses"===h.type&&"()"===h.value)h.parent.addChild(g),h=g;else if("square_bracket"===h.type&&"[]"===h.value)h.parent.addChild(g),h=g;else if("identifier"===h.type)h.addChild(g),
h=g;else{console.info("Error2: en la expresi\u00f3n \u300a "+d+" \u300b, en el token ["+r+"] {valor: "+k+", tipo: "+w+"}");break}else if("parentheses"===w&&")"===k)if(l--,null===h)console.info("Error3: en la expresi\u00f3n \u300a "+d+" \u300b, en el token (valor:"+k+", tipo:"+w);else{for(;h&&h.parent&&("("!=h.value||"("==h.value&&"parentheses"!=h.type);)h=h.parent;if(h&&"("===h.value)h.value="()";else break}else if("square_bracket"===w&&"]"===k)if(q--,null===h)console.info("Error5: en la expresi\u00f3n \u300a "+
d+" \u300b, en el token (valor:"+k+", tipo:"+w);else{for(;h&&h.parent&&("["!=h.value||"["==h.value&&"square_bracket"!=h.type);)h=h.parent;if(h&&"["===h.value)h.value="[]";else{console.info("Error6: en la expresi\u00f3n \u300a "+d+" \u300b, en el token {valor: "+k+", tipo: "+w+"}");break}}else if("number"===w||"string"===w||"identifier"===w)if(g=new a.Node(w,k),null===h)h=g;else if("operator"===h.type||"compOperator"===h.type||"boolOperator"===h.type||"parentheses"===h.type&&"("===h.value||"square_bracket"===
h.type&&"["===h.value||"sign"===h.type||"conditional"===h.type||"asign"===h.type)h.addChild(g),h=g;else{a.DEBUG.setError(a.DEBUG.EXPRESSION,d);break}else if("operator"===w||"compOperator"===w||"boolOperator"===w)if(g=new a.Node(w,k),null===h)if("-"===k||"+"===k)g.type="sign",g.value="sign"+k,h=g;else if("!"===k)h=g;else{console.info("Error8: en la expresi\u00f3n \u300a "+d+" \u300b, en el token {valor: "+k+", tipo: "+w+"}");break}else if("operator"===h.type||"compOperator"===h.type||"boolOperator"===
h.type||"asign"===h.type||"conditional"===h.type||"square_bracket"===h.type&&"["===h.value&&("-"===k||"+"===k||"!"===k)||"parentheses"===h.type&&"("===h.value&&("-"===k||"+"===k||"!"===k)){if("-"===k||"+"===k)g.type="sign",g.value="sign"+k;h.addChild(g);h=g}else if("number"===h.type||"parentheses"===h.type&&"()"===h.value||"square_bracket"===h.type&&"[]"===h.value||"string"===h.type||"identifier"===h.type||"conditional"===h.type||"asign"===h.type){for(;h.parent&&f(h.parent.value)>=f(g.value);)h=h.parent;
h.parent&&h.parent.replaceLastChild(g);g.addChild(h);h=g}else{console.info("Error9: en la expresi\u00f3n \u300a "+d+" \u300b, en el token {valor: "+k+", tipo: "+w+"}");break}else if("conditional"===w)if(g=new a.Node(w,k),null!=h)if("?"===g.value){for(c++;h.parent&&f(h.parent.value)>f(g.value);)h=h.parent;h.parent&&h.parent.replaceLastChild(g);g.addChild(h);h=g}else{for(c--;h&&h.parent&&("?"!=h.value||"?"==h.value&&"conditional"!=h.type);)h=h.parent;if(h&&"?"===h.value)h.value="?:";else{console.info("Error10: en la expresi\u00f3n \u300a "+
d+" \u300b, en el token {valor: "+k+", tipo: "+w+"}");break}}else{console.info("Error11: en la expresi\u00f3n \u300a "+d+" \u300b, en el token {valor: "+k+", tipo: "+w+"}");break}else if("separator"===w)if(null!=h)for(;h.parent&&"("!=h.value&&"["!=h.value;)h=h.parent;else{console.info("Error12: en la expresi\u00f3n \u300a "+d+" \u300b, en el token {valor: "+k+", tipo: "+w+"}");break}else{console.info("Error13: en la expresi\u00f3n \u300a "+d+" \u300b, en el token {valor: "+k+", tipo: "+w+"}");break}}0<
l&&a.DEBUG.setError(a.DEBUG.PARENTHESIS_CLOSING,d);0>l&&a.DEBUG.setError(a.DEBUG.PARENTHESIS_OPENING,d);0<q&&a.DEBUG.setError(a.DEBUG.BRACKET_CLOSING,d);0>q&&a.DEBUG.setError(a.DEBUG.BRACKET_OPENING,d);0!=c&&a.DEBUG.setError(a.DEBUG.INCOMPLETE_IF,d);(p=h?h.getRoot():null)&&p.setAllEvalFun();return p};v.prototype.registerDefaultValues=function(){var b=this;b.variables.rnd=Math.random;b.variables.pi=b.variables["\u03c0"]=a.returnValue(Math.PI);b.variables.e=a.returnValue(Math.E);b.variables.Infinity=
Infinity;b.variables["-Infinity"]=-Infinity;b.variables.isTouch=b.variables["esT\u00e1ctil"]=a.hasTouchSupport?1:0;Object.defineProperties(b.variables,{screenOrientation:{get:function(){return window.matchMedia("(orientation: landscape)").matches?"landscape":"portrait"}},screenWidth:{get:function(){return window.innerWidth}},screenHeight:{get:function(){return window.innerHeight}}});b.functions.sqr=function(a){return a*a};b.functions.sqrt=b.functions["ra\u00edz"]=Math.sqrt;b.functions.exp=Math.exp;
b.functions.log=Math.log;b.functions.log10=function(a){return Math.log(a)/Math.log(10)};b.functions.abs=Math.abs;b.functions.ent=Math.floor;b.functions.sgn=function(a){return 0<a?1:0>a?-1:0};b.functions.ind=function(a){return a?1:0};b.functions.sin=b.functions.sen=Math.sin;b.functions.cos=Math.cos;b.functions.tan=Math.tan;b.functions.cot=function(a){return 1/Math.tan(a)};b.functions.sec=function(a){return 1/Math.cos(a)};b.functions.csc=function(a){return 1/Math.sin(a)};b.functions.sinh=b.functions.senh=
function(a){return(Math.exp(a)-Math.exp(-a))/2};b.functions.cosh=function(a){return(Math.exp(a)+Math.exp(-a))/2};b.functions.tanh=function(a){return(Math.exp(a)-Math.exp(-a))/(Math.exp(a)+Math.exp(-a))};b.functions.coth=function(a){return 1/b.functions.tanh(a)};b.functions.sech=function(a){return 1/b.functions.cosh(a)};b.functions.csch=function(a){return 1/b.functions.sinh(a)};b.functions.asin=b.functions.asen=Math.asin;b.functions.acos=Math.acos;b.functions.atan=Math.atan;b.functions.atan2=Math.atan2;
b.functions.floor=Math.floor;b.functions.ceil=Math.ceil;b.functions.round=Math.round;b.functions.min=Math.min;b.functions.max=Math.max;b.functions._Trace_=b.functions._Print_=function(){console.info.apply(console,arguments);return 0};b.functions._Num_=function(a){if("number"==typeof a)return"NaN";a=a.replace(",",".");return parseFloat(a)==a?parseFloat(a):"NaN"};b.functions._Stop_Audios_=function(){b.evaluator.parent.stopAudios()};b.functions.esCorrecto=function(c,d,e){return a.esCorrecto(c,d,b.evaluator,
e)};b.functions.escorrecto=function(c,d,e){return a.escorrecto(c,d,b.evaluator,e)};window.parent!==window&&(b.functions["parent.set"]=function(a,b){window.parent.postMessage({type:"set",name:a,value:b},"*");return 0},b.functions["parent.update"]=function(){window.parent.postMessage({type:"update"},"*");return 0},b.functions["parent.exec"]=function(a,b){window.parent.postMessage({type:"exec",name:a,value:b},"*");return 0});b.functions.toFixed=b.functions._NumToStr_=b.functions._NumACadena_=function(a,
b){a=isNaN(parseFloat(a))?0:parseFloat(a);return a.toFixed(parseInt(b||0))};b.functions.charAt=b.functions._charAt_=b.functions._letraEn_=function(a,b){a=(a||"").toString();b=isNaN(parseInt(b))?0:parseInt(b);return a.charAt(b)};b.functions.substring=b.functions._substring_=b.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):""};b.functions.strLength=
b.functions._length_=b.functions._longitud_=function(a){return(a||"").toString().length};b.functions.indexOf=b.functions._indexOf_=b.functions["_\u00edndiceDe_"]=function(a,b){return(a||"").toString().indexOf((b||"").toString())};b.functions.lastIndexOf=function(a,b){return(a||"").toString().lastIndexOf((b||"").toString())};b.functions.replace=b.functions._replace_=b.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);return a};b.functions.toLowerCase=function(a){return(a||"").toString().toLowerCase()};b.functions.toUpperCase=function(a){return(a||"").toString().toUpperCase()};b.functions.trim=function(a){return(a||"").toString().trim()};b.functions._Load_=function(b){var c="";b&&(c=(c=document.getElementById(b))&&"descartes/archivo"==c.type?c.text:a.openExternalFile(b));return c||""};b.functions._GetValues_=function(a,c){return b.functions._ExecBlock_(b.functions._Load_(a).replace(/&brvbar;/g,
String.fromCharCode("166")),c)};b.functions._GetMatrix_=function(a,c){return b.functions._StrToMatrix_(b.functions._Load_(a).replace(/&brvbar;/g,String.fromCharCode("166")),c)};b.functions._MatrixToStr_=function(c){var d=b.matrices[c];if(d){for(var e="<"+c+">\\n",g=b.getVariable(c+".columnas_usadas")||d.cols||0,k=b.getVariable(c+".filas_usadas")||d.rows||0,f,l=0;l<g;l++){for(var h=0;h<k;h++)f=d[l][h],void 0!==f&&("string"==typeof f?f="'"+f+"'":"number"==typeof f&&(f=a.removeNeedlessDecimals(f.toFixed(6))),
e+=f+(h<k-1?" \u00a6 ":""));e=e.replace(/(\u00A6 )$/g,"")+"\\n"}return e+"</"+c+">"}return""};b.functions._StrToMatrix_=function(a,c){var d=[],g=!1,k=!1;d.type="matrix";if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var f=0,l=a.length;f<l;f++)a[f].match("<"+c+">")?(k=!0,g=a[f].trim().split("<"+c+">"),2==g.length&&""!=g[1]&&d.push(g[1].split(String.fromCharCode("166")).map(e)),g=!0):(a[f].match("</"+c+">")&&(g=a[f].trim().split("</"+c+">"),2==g.length&&""!=g[0]&&d.push(g[0].split(String.fromCharCode("166")).map(e)),
g=!1,f=a.length),g&&d.push(a[f].split(String.fromCharCode("166")).map(e)));b.matrices[c]=d;b.matrices[c].rows=d&&d[0]&&d[0].length?d[0].length:0;b.matrices[c].cols=d&&d.length?d.length:0;b.setVariable(c+".filas",b.matrices[c].rows);b.setVariable(c+".columnas",b.matrices[c].cols)}return k?"OK":"ERROR"};b.functions._GetVector_=function(a,c){return b.functions._StrToVector_(b.functions._Load_(a),c)};b.functions._VectorToStr_=function(a){var c=b.vectors[a];if(c){for(var d="<"+a+">\\n",e=b.getVariable(a+
".long_usada")||c._size_||0,g,k=0;k<e;k++)g=c[k],void 0!==g?("number"==typeof g&&(g=parseFloat(g)),d+=g+"\\n"):d+="0\\n";return d+"</"+a+">"}return""};b.functions._StrToVector_=function(a,c){var d=[],g=!1,k=!1;d.type="vector";if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var f=0,l=a.length;f<l;f++)a[f].match("<"+c+">")?g=k=!0:(a[f].match("</"+c+">")&&(g=!1,f=a.length),g&&d.push(e(a[f])));d._size_=d.length;b.vectors[c]=d;b.setVariable(c+".long",d.length);b.setVariable(c+".long_usada",d.length)}return k?
"OK":"ERROR"};b.functions._ExecStr_=function(a){return b.functions._ExecBlock_(a,"")};b.functions._ExecBlock_=function(a,c){var d=[],e=""==c;if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var g=0,k=a.length;g<k;g++)a[g].match("<"+c+">")?(e=a[g].trim().split("<"+c+">"),2==e.length&&""!=e[1]&&(d=d.concat(e[1].split(String.fromCharCode("166")))),e=!0):a[g].match("</"+c+">")?(e=a[g].trim().split("</"+c+">"),2==e.length&&""!=e[0]&&(d=d.concat(e[0].split(String.fromCharCode("166")))),e=!1):e&&(d=d.concat(a[g].split(String.fromCharCode("166"))));
g=0;for(k=d.length;g<k;g++)e=d[g].split("="),e[0]=e[0].trim(),2==e.length&&""!=e[0]&&(isNaN(parseFloat(e[1]))?b.setVariable(e[0],e[1].replace(/^\s|\s$/g,"").replace(/^'|'$/g,"")):b.setVariable(e[0],parseFloat(e[1])))}return 0};var c=a.newHTML("a",{target:"_blank"}),g,k=null;a.newBlobContent=null;b.functions._Save_=function(e,f){b.evaluator.parent.removeButtonClick();1500<Date.now()-d&&(d=Date.now(),document.body.appendChild(c),k=f.replace(/\\r/g,"").replace(/\\n/g,"\r\n").replace(/\\q/g,"'").replace(/\\_/g,
"\\"),g=new Blob(["\ufeff",k],{type:"text/plain;charset=utf-8"}),c.setAttribute("href",window.URL.createObjectURL(g)),c.setAttribute("download",e),k!=a.newBlobContent&&(c.click(),a.newBlobContent=k),document.body.removeChild(c));return 0};var f,l,h=a.newHTML("input",{type:"file"});h.addEventListener("change",function(c){f=c.target.files;l=new FileReader;l.onload=function(c){a.addExternalFileContent(f[0].name,c.target.result);b.setVariable("DJS.fileName",f[0].name);b.setVariable("DJS.fileContent",
c.target.result);b.getFunction(b._callback)&&(b.getFunction(b._callback).apply(b.evaluator,[]),b.evaluator.parent.update());h.value=""};0<f.length&&l.readAsText(f[0])});b.functions._Open_=function(a){b.evaluator.parent.removeButtonClick();1500<Date.now()-d&&(b._callback=a,h.click(),d=Date.now());return 0};b.functions._AnchoDeCadena_=b.functions._strWidth_=function(b,c,d,e){return a.getTextWidth(b,a.convertFont(c+","+d+","+e))};b.functions.R=b.functions._Rojo_=b.functions._Red_=function(b){return(new a.Color(b)).r/
255};b.functions.G=b.functions._Verde_=b.functions._Green_=function(b){return(new a.Color(b)).g/255};b.functions.B=b.functions._Azul_=b.functions._Blue_=function(b){return(new a.Color(b)).b/255};b.functions["DJS.typeof"]=function(a){return a.rows?"matrix":a._size_?"vector":typeof a}};a.Parser=v;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.floor,e=function(d){this.parent=d;this.parser=new a.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};e.prototype.setDefinition=function(a,e){this.definitions[a]=e};e.prototype.getDefinition=function(a){return this.definitions[a]};e.prototype.setVariable=function(a,e){this.variables[a]=e};e.prototype.getVariable=
function(a){return this.variables[a]};e.prototype.setVector=function(a,e,m){e=0>e?0:f(e);this.vectors[a][e]=m};e.prototype.getVector=function(a,e){e=0>e?0:f(e);return this.vectors[a][e]};e.prototype.setMatrix=function(a,e,m,b){e=0>e?0:f(e);m=0>m?0:f(m);void 0==this.matrices[a][e]&&(this.matrices[a][e]=[]);this.matrices[a][e][m]=b};e.prototype.getMatrix=function(a,e,m){e=0>e?0:f(e);m=0>m?0:f(m);return this.matrices[a][e][m]};e.prototype.setFunction=function(a,e){this.functions[a]=e};e.prototype.getFunction=
function(a){return this.functions[a]};e.prototype.eval=function(a){return a?a.evaluate(this):0};a.externalEvaluator=new e;a.Evaluator=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h,g,l,q,c,u,k,w,p,v=function(b,c){this.parent=b;this.evaluator=b.evaluator;this.decimals=b.decimals;this.fixed=b.fixed;this.align=b.align||"left";this.anchor=b.anchor||"a_top_left";this.decimal_symbol=b.parent.decimal_symbol;this.w=this.h=100;this.hasContent=""!==c;this.textStr=(c||"").replace(/\\{/g,"\\curlyBracketOpen ").replace(/\\}/g,"\\curlyBracketClose ").replace(/\\\[/g,"\\squareBracketOpen ").replace(/\\\]/g,"\\squareBracketClose ");
this.oldTextStr=this.oldWidth=this.oldSize=this.oldColor=this.oldPosX=this.oldPoxY=null;c.match(/^\{\\rtf1/)?(this.type="rtfNode",this.text=c,this.textNodes=(new a.RTFParser(b.evaluator)).parse(c.substring(10))):(this.descarTeXParser=new a.DescarTeXParser,this.text=this.parseSimpleText(this.textStr),this.textNodes=new a.TextNode("","textLineBlock",null,null))};v.prototype.draw=function(a,b,c,d,e){this["rtfNode"===this.type?"drawRTF":"drawText"](a,b,c,d,e)};v.prototype.drawText=function(c,g,k,l,h){f=
this.evaluator.eval(this.decimals);e=this.evaluator.eval(this.parent.width);d=this.evaluator.eval(this.parent.font_size);r=g.getColor?g.getColor():g;m=this.textToString(this.text,f,this.fixed).replace(/\\{/g,"\\curlyBracketOpen ").replace(/\\}/g,"\\curlyBracketClose ").replace(/\\\[/g,"\\squareBracketOpen ").replace(/\\\]/g,"\\squareBracketClose ");0<=m.indexOf("[")&&(m=this.textToString(this.parseSimpleText(m),f,this.fixed));if(this.oldTextStr!==m||this.oldWidth!==e||this.oldSize!==d||this.oldColor!==
r||this.oldPosX!==k||this.oldPoxY!==l)b=new a.TextStyle({size:d,family:this.parent.font_family||"arial",italic:this.parent.italics||!1,bold:this.parent.bold||!1,color:r,align:this.align,border:this.parent.border}),this.textNodes=this.descarTeXParser.parse(m,this.evaluator,b),this.textNodes.update(k,l,f,this.fixed,this.align,this.anchor,r,e);h||this.textNodes.draw(c);this.oldTextStr=m;this.oldWidth=e;this.oldSize=d;this.oldColor=r;this.oldPosX=k;this.oldPoxY=l};v.prototype.drawRTF=function(a,b,c,d,
e){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));e||this.textNodes.draw(a)};v.prototype.parseSimpleText=function(a){a=a.replace("&#x2013","\u2013").replace(/&squot;/g,"'");h=[];g="'";q=l=0;c=-1;for(w=a.length;l<w;)u=a.charAt(l),k=a.charAt(l-
1),"["===u&&"\\"===k?(h.push(a.substring(q,l-1)+"["),q=l+1):"]"===u&&"\\"===k?(h.push(a.substring(q,l-1)+"]"),q=l+1):"["===u&&-1===c?(h.push(a.substring(q,l)),q=l,c++):"["===u?c++:"]"===u&&0===c?(h.push(this.evaluator.parser.parse(a.substring(q,l+1))),q=l+1,c--):("]"==a.charAt(l)&&(c=0>c?c:c-1),g+=a.charAt(l)),l++;h.push(a.substring(q,l));return h};v.prototype.textToString=function(b,c,d){g="";if("rtfNode"!==b.type)for(var e=0,k=b.length;e<k;e++)"string"===typeof b[e]?g+=b[e]:(p=this.evaluator.eval(b[e])[0][0],
""!==p&&("string"===typeof p?g+=p:Infinity===p?g+="Infinity":-Infinity===p?g+="-Infinity":isNaN(p)||"NaN"===p?g+="NaN":(p=parseFloat(p),p=d?p.toFixed(c):a.removeNeedlessDecimals(p.toFixed(c)),g+=p.toString().replace(".",this.decimal_symbol))));return g};a.TextObject=v;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e=function(){};e.prototype.tokenize=function(a){a=a.replace(/\\n/g,"\\newline ");var d=[],e=null,b=0,h=a.length;a.charAt(0);var g=!1,l=!1,q=0;f="";for(var c=0;c<h;c++){var u=a.charAt(c);var k=a.charAt(c+1);"\\"===u&&"$"===k&&(l=!0);"{"===u?q++:"}"===u&&(q--,l&&0===q&&(l=!1));l?"_"===u?"{"===k?f+="\\subindex":(f+="\\subindex{"+k+"}",c++):"^"===u?"{"===k?f+="\\superindex":(f+="\\superindex{"+k+"}",c++):f+=u:f+=u}a=f;k=a.charAt(0);for(h=a.length;b<
h;)u=k,k=a.charAt(b+1),g&&("{"===u||"["===u||"\\"===u||" "===u?(g=!1," "===u&&(e={type:"ignore"},d.push(e))):e.value+=u),g||"\\"!==u?g||"{"!==u&&"["!==u?g||"}"!==u&&"]"!==u?g||(e&&"text"===e.type?e.value+=u:e&&"ignore"===e.type?(d.pop(),e=d[d.length-1]):(e={type:"text",value:u},d.push(e))):(e={type:"close",value:u},d.push(e)):(e={type:"open",value:u},d.push(e)):(g=!0,e={type:"command",value:""},d.push(e)),b++;return d};a.DescarTeXTokenizer=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=function(){this.tokenizer=new a.DescarTeXTokenizer};f.prototype.parse=function(e,d,f){e=this.tokenizer.tokenize(e);var m=new a.TextNode("","textBlock",f,null),b=new a.TextNode("","textLineBlock",f.clone(),null);m.addChild(b);for(var h=[],g=void 0,l=f,q=[f],c,u,k,w,p=!1,v=0,n=e.length;v<n;v++)if("text"===e[v].type)if("color_parameter"===g)u=new a.Color(e[v].value,d);else if("text_size_parameter"===g)k=parseFloat(e[v].value);else if("textLineBlock"===
b.nodeType){c=e[v].value.split(" ");for(var r=0,x=c.length;r<x;r++)""!==c[r]&&b.addChild(new a.TextNode(c[r],"text",l.clone(),null)),r+1<x&&b.addChild(new a.TextNode(" ","space",l.clone(),null))}else b.addChild(new a.TextNode(e[v].value,"text",l.clone(),null));else if("command"===e[v].type&&"curlyBracketOpen"===e[v].value)b.addChild(new a.TextNode("{","text",l.clone(),null));else if("command"===e[v].type&&"curlyBracketClose"===e[v].value)b.addChild(new a.TextNode("}","text",l.clone(),null));else if("command"===
e[v].type&&"squareBracketOpen"===e[v].value)b.addChild(new a.TextNode("[","text",l.clone(),null));else if("command"===e[v].type&&"squareBracketClose"===e[v].value)b.addChild(new a.TextNode("]","text",l.clone(),null));else if("command"===e[v].type&&"newline"===e[v].value)0===b.children.length&&b.addChild(new a.TextNode("","text",l.clone(),null)),b=new a.TextNode("","textLineBlock",f.clone(),null),m.addChild(b);else if("command"===e[v].type&&"b"===e[v].value)g="bold",h.push(g);else if("command"===e[v].type&&
"i"===e[v].value)g="italic",h.push(g);else if("command"===e[v].type&&"color"===e[v].value)g="color",h.push(g);else if("command"===e[v].type&&"ts"===e[v].value)g="text_size",h.push(g);else if("command"===e[v].type&&"sansserif"===e[v].value.toLowerCase())g="sansserif",h.push(g);else if("command"===e[v].type&&"serif"===e[v].value.toLowerCase())g="serif",h.push(g);else if("command"===e[v].type&&"monospace"===e[v].value.toLowerCase())g="monospace",h.push(g);else if("command"===e[v].type&&"c"===e[v].value)g=
"center",h.push(g);else if("command"===e[v].type&&"l"===e[v].value)g="left",h.push(g);else if("command"===e[v].type&&"r"===e[v].value)g="right",h.push(g);else if("command"===e[v].type&&"j"===e[v].value)g="justify",h.push(g);else if("command"===e[v].type&&"$"===e[v].value)g="formula",h.push(g),p=!0;else if("command"===e[v].type&&"sum"===e[v].value)g="sum",h.push(g);else if("command"===e[v].type&&"int"===e[v].value)g="integral",h.push(g);else if("command"===e[v].type&&"lim"===e[v].value)g="limit",h.push(g);
else if("command"===e[v].type&&"sqrt"===e[v].value)g="radical",h.push(g);else if("command"===e[v].type&&"subindex"===e[v].value)g="subIndex",h.push(g);else if("command"===e[v].type&&"superindex"===e[v].value)g="superIndex",h.push(g);else if("command"===e[v].type&&"frac"===e[v].value)g="numerator",h.push(g);else if("open"===e[v].type&&"{"===e[v].value&&void 0!==g)"bold"===g||"italic"===g?(l=l.clone(),l[g]=!0,q.push(l)):"sansserif"===g?(l=l.clone(),l.family="sansserif",q.push(l)):"serif"===g?(l=l.clone(),
l.family="serif",q.push(l)):"monospace"===g?(l=l.clone(),l.family="monospaced",q.push(l)):"text_size"===g?g="text_size_parameter":"text_size_text"===g?(l=l.clone(),l.size=k,q.push(l)):"color"===g?g="color_parameter":"color_text"===g?(l=l.clone(),l.color=u,q.push(l)):"center"===g||"left"===g||"right"===g||"justify"===g?(l=l.clone(),l.align=g,q.push(l),b=new a.TextNode("","textLineBlock",l.clone(),null),m.addChild(b)):"formula"===g?(l=l.clone(),l.italic=!0,q.push(l),w=new a.TextNode("","formula",l.clone(),
null),b.addChild(w),b=w):"subIndex"===g||"superIndex"===g?p?(l=l.clone(),q.push(l),w=new a.TextNode("",g,l.clone(),null),b.addChild(w),b=w):b.addChild(new a.TextNode("subIndex"===g?"_":"^","text",l.clone(),null)):"radical"===g?p&&(w=new a.TextNode("","radical",l.clone(),null),b.addChild(w),b=w,l=l.clone(),q.push(l),w=new a.TextNode("","index",l.clone(),null),b.addChild(w),b=w,g="index"):"index"===g?p&&(q.pop(),l=q[q.length-1],w=new a.TextNode("","radicand",l.clone(),null),b.addChild(w),b=w,g="radicand"):
"sum"===g||"integral"===g||"limit"===g?p&&(w=new a.TextNode("",g,l.clone(),null),b.addChild(w),b=w,l=l.clone(),q.push(l),w=new a.TextNode("","from",l.clone(),null),b.addChild(w),b=w,g="from"):"from"===g?p&&(w=new a.TextNode("","to",l.clone(),null),b.addChild(w),b=w,g="to"):"to"===g?p&&(q.pop(),l=q[q.length-1],w=new a.TextNode("","what",l.clone(),null),b.addChild(w),b=w,g="what"):"numerator"===g?p&&(w=new a.TextNode("","fraction",l.clone(),null),b.addChild(w),b=w,l=l.clone(),q.push(l),w=new a.TextNode("",
"numerator",l.clone(),null),b.addChild(w),b=w,g="numerator"):"denominator"===g&&(w=new a.TextNode("",g,l.clone(),null),b.addChild(w),b=w);else if("close"===e[v].type&&"}"===e[v].value&&void 0!==g){if("bold"===g||"italic"===g||"color_text"===g||"color"===g||"text_size_text"===g||"text_size"===g||"sansserif"===g||"serif"===g||"monospace"===g)q.pop(),l=q[q.length-1],h.pop(),g=h[h.length-1];else if("color_parameter"===g){g="color_text";continue}else if("text_size_parameter"===g){g="text_size_text";continue}else if("center"===
g||"left"===g||"right"===g||"justify"===g)q.pop(),l=q[q.length-1],h.pop(),g=h[h.length-1],e[v+1]&&"command"===e[v+1].type&&"newline"===e[v+1].value?b=m:(b=new a.TextNode("","textLineBlock",l.clone(),null),m.addChild(b));"formula"===b.nodeType?(p=!1,q.pop(),l=q[q.length-1],h.pop(),g=h[h.length-1],b=b.parent):"subIndex"===b.nodeType||"superIndex"===b.nodeType?p&&(q.pop(),l=q[q.length-1],h.pop(),g=h[h.length-1],b=b.parent):"index"===b.nodeType?b=b.parent:"radicand"===b.nodeType?(h.pop(),g=h[h.length-
1],b=b.parent.parent):"from"===b.nodeType?b=b.parent:"to"===b.nodeType?b=b.parent:"what"===b.nodeType?(h.pop(),g=h[h.length-1],b=b.parent.parent):"numerator"===b.nodeType?(g="denominator",b=b.parent):"denominator"===b.nodeType&&(q.pop(),l=q[q.length-1],h.pop(),g=h[h.length-1],b=b.parent.parent)}var y,B,E=null,J=[];m.children.forEach(function(a){for(var b=0,c=a.children.length;b<c-1;b++)y=a.children[b],B=a.children[b+1],"text"===y.nodeType&&"text"===B.nodeType&&y.style.equals(B.style)?(null===E&&(E=
y,w=y.clone(),E.changeNodeType("word"),E.value="___"+w.value,E.addChild(w)),w=B.clone(),E.addChild(w),J.push(B),E.value+=w.value):E=null});J.forEach(function(a){a.parent.removeChild(a)});m.normalize();m.adjustFontSize();return m};a.DescarTeXParser=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e=[a.sansserif_font,a.serif_font,a.monospace_font],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 d=!0,b;for(b in this)this.hasOwnProperty(b)&&(d=d&&this[b]===a[b]);return d};
d.prototype.toString=function(){/arial|sansserif/i.test(this.family)?f=e[0]:/times|serif/i.test(this.family)?f=e[1]:/courier|monospaced/i.test(this.family)&&(f=e[2]);return((this.bold?"bold":"")+" "+(this.italic?"italic":"")+" "+this.size+"px "+f).trim()};a.TextStyle=d;return a}(descartesJS||{});
descartesJS=function(a){function f(a,b){for(var c=0,d=0;d<b;d++)c+=a[d];return c}function e(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((q[a].ascent+25)*c/q[a].unitsPerEm);b.descent=Math.ceil(Math.abs((q[a].descent-25)*c/q[a].unitsPerEm));b.h=b.ascent+b.descent;return b}if(a.loadLib)return a;
var d="#000000",r=2,m=!1,b=new Path2D("m 759,1 c -8,0 -15,4 -20,14 L 325,878 153,500 c -5,-11 -11,-14 -17,-9 L 2,596 c -5,4 17,30 22,26 l 65,-47 193,422 c 3,6 27,6 32,-4 L 773,40 V 1 Z");b.svgData="m 759,1 c -8,0 -15,4 -20,14 L 325,878 153,500 c -5,-11 -11,-14 -17,-9 L 2,596 c -5,4 17,30 22,26 l 65,-47 193,422 c 3,6 27,6 32,-4 L 773,40 V 1 Z";var h=new Path2D("M 780,707 H 750 C 728,805 695,872 585,872 H 180 L 509,447 225,65 h 313 c 130,0 167,49 188,181 h 30 V 0 H 25 L 384,500 0,1000 h 729 z");h.svgData=
"M 780,707 H 750 C 728,805 695,872 585,872 H 180 L 509,447 225,65 h 313 c 130,0 167,49 188,181 h 30 V 0 H 25 L 384,500 0,1000 h 729 z";var g=new Path2D("m 150,828 c -21,88 -42,144 -83,144 -6,0 -9,-2 -9,-6 0,-9 15,-8 15,-34 0,-14 -13,-22 -27,-22 -24,0 -45,22 -45,51 0,20 21,39 56,39 97,0 141,-105 159,-176 L 375,181 c 23,-91 45,-154 89,-153 6,0 9,2 9,6 0,7 -15,13 -15,35 0,14 13,20 27,20 24,0 45,-22 45,-51 C 530,18 508,0 473,0 368,0 326,120 309,190 Z");g.svgData="m 150,828 c -21,88 -42,144 -83,144 -6,0 -9,-2 -9,-6 0,-9 15,-8 15,-34 0,-14 -13,-22 -27,-22 -24,0 -45,22 -45,51 0,20 21,39 56,39 97,0 141,-105 159,-176 L 375,181 c 23,-91 45,-154 89,-153 6,0 9,2 9,6 0,7 -15,13 -15,35 0,14 13,20 27,20 24,0 45,-22 45,-51 C 530,18 508,0 473,0 368,0 326,120 309,190 Z";
var l=function(a,b,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(b);this.drawBorder=function(){}};l.prototype.changeNodeType=function(a){this.nodeType=a;this.draw=null;switch(this.nodeType){case "textBlock":this.draw=this.drawTextBlock;break;case "textLineBlock":this.draw=this.drawTextLineBlock;break;case "formula":this.draw=
this.drawFormula;break;case "superIndex":this.draw=this.drawSuperIndex;break;case "subIndex":this.draw=this.drawSubIndex;break;case "dynamicText":this.draw=this.drawDynamicText;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 "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,d=this.children.length;b<d;b++)a.addChild(this.children[b].clone());return a};l.prototype.toStr=function(){for(var a=this.value,b=0,d=this.children.length;b<d;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,d=this.children.length;b<
d;b++)a+=this.children[b].stringify()+(b==d-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,d=this.parent.children.length;b<d;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(/textLineBlock|formula|numerator|denominator|superIndex|subIndex|index|subIndex|radicand|from|to|what|element/),
b=0,d=a.length;b<d;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|limit|matrix|defparts|dynamicText|componentNumCtrl|componentSpace/);b=0;for(d=a.length;b<d;b++){var e=a[b];(null===e.prevSibling()||null!==e.prevSibling()&&"text"!==e.prevSibling().nodeType)&&e.parent.insertBefore(e,new l("","text",e.parent.style));(null===e.nextSibling()||null!==e.nextSibling()&&"text"!==e.nextSibling().nodeType)&&
e.parent.insertAfter(e,new l("","text",e.parent.style))}return this};l.prototype.removeEmptyText=function(){for(var a=this.queryAll(/text/),b=0,d=a.length;b<d;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,e,g,f,l,h,q){r=e;m=g;d=h;this.metrics.w=this.metrics.h=0;h=b;if(20<=q)for(e=0;e<this.children.length;e++)this.children[e].breakLines(q);e=0;for(g=this.children.length;e<g;e++){var c=this.children[e];c.updateLine();c.metrics.offsetX=a;c.metrics.y=b;b+=parseInt(c.metrics.ascent+.5);c.metrics.offsetY=
b;f=parseInt(c.metrics.descent+.5)+parseInt(1.5+.05*c.style.size);b+=f;this.metrics.h+=c.metrics.h;this.metrics.w=Math.max(this.metrics.w,c.metrics.w)}b=h;l=l||"";l.match("right")?a-=this.metrics.w:l.match("_center")&&(a-=this.metrics.w/2);l.match("bottom")?b-=this.metrics.h:l.match("center_")&&(b-=this.metrics.h/2);l=this.children;e=0;for(g=l.length;e<g;e++)"left"===l[e].style.align?l[e].metrics.offsetX=a:"right"===l[e].style.align?l[e].metrics.offsetX=a+this.metrics.w-l[e].metrics.w:"center"===
l[e].style.align?l[e].metrics.offsetX=a+(this.metrics.w-l[e].metrics.w)/2:"justify"===l[e].style.align&&20<=q&&(f=e<g-1?l[e+1].value:null,l[e].metrics.offsetX=a,"wrap"===f&&l[e].justifyAux(q)),l[e].metrics.y=b,b+=parseInt(l[e].metrics.ascent+.5),l[e].metrics.offsetY=b,f=parseInt(l[e].metrics.descent+.5)+parseInt(1.5+.05*l[e].style.size),b+=f};l.prototype.breakLines=function(b){for(var c,d=0,e=!1,g=[],f=0,h=this.children.length;f<h;f++)c=this.children[f],e?g.push(c):("text"===c.nodeType||"space"===
c.nodeType?(a.ctx.font=c.style.toString(),c.metrics.w=a.ctx.measureText(c.value).width):"word"===c.nodeType?c.updateLine():"formula"===c.nodeType&&c.updateFormula(),d+=c.metrics.w,d>b&&"space"!==c.nodeType&&0<f&&(e=!0,g.push(c)));if(0<g.length)for(b=new l("wrap","textLineBlock",this.style.clone(),null),this.parent.insertAfter(this,b),f=0,h=g.length;f<h;f++)g[f].parent&&g[f].parent.removeChild(g[f]),b.addChild(g[f])};l.prototype.updateLine=function(b){var c=this;if("textLineBlock"===this.nodeType||
"word"===this.nodeType){this.metrics.w=0;this.metrics.ascent=0;for(var d=this.metrics.descent=0,g=this.children,f,l=0,h=g.length;l<h;l++){f=g[l];if("text"===f.nodeType){a.ctx.font=f.style.toString();var m=""!==f.value?f.value:"\u200a";f.metrics=e(a.ctx.font);f.metrics.w=a.ctx.measureText(m).width;f.metrics.offsetX=d;Object.defineProperties(f.metrics,{x:{get:function(){return c.metrics.offsetX+this.offsetX}},y:{get:function(){return c.metrics.offsetY+this.offsetY}}})}"space"===f.nodeType?(a.ctx.font=
f.style.toString(),f.metrics=e(a.ctx.font),f.metrics.w=l===h-1?0:b?b:a.ctx.measureText(" ").width,f.metrics.offsetX=d,Object.defineProperties(f.metrics,{x:{get:function(){return c.metrics.offsetX+this.offsetX}},y:{get:function(){return c.metrics.offsetY+this.offsetY}}})):"word"===f.nodeType&&(f.updateLine(),f.metrics.offsetX_aux=d,Object.defineProperties(f.metrics,{offsetX:{get:function(){return c.metrics.offsetX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}}));"hyperlink"===
f.nodeType&&(a.ctx.font=f.styleString,m=""!==f.value?f.value:"\u200a",f.metrics=e(a.ctx.font),f.metrics.w=a.ctx.measureText(m).width,f.metrics.offsetX=d,Object.defineProperties(f.metrics,{x:{get:function(){return c.metrics.offsetX+this.offsetX}},y:{get:function(){return c.metrics.offsetY}}}),f.clickCatcher||(f.clickCatcher=a.newHTML("div",{style:"position:absolute;width:"+f.metrics.w+"px;height:"+f.metrics.h+"px;cursor:pointer;"}),f.clickCatcher.rtfNode=f,f.clickCatcher.action=new a.OpenURL(this.evaluator.parent,
f.URL),f.clickCatcher.addEventListener("click",function(a){this.rtfNode.click=!0;this.action.execute();this.rtfNode.draw(this.rtfNode.ctx)})));"componentNumCtrl"===f.nodeType&&(f.componentNumCtrl=this.evaluator.parent.getControlByCId(f.value),a.ctx.font=f.styleString,f.metrics=e(a.ctx.font),f.metrics.w=f.componentNumCtrl.w,f.metrics.h=f.componentNumCtrl.h,f.metrics.offsetX=d,Object.defineProperties(f.metrics,{x:{get:function(){return c.metrics.offsetX+this.offsetX}},y:{get:function(){return c.metrics.offsetY}}}));
"componentSpace"===f.nodeType?(f.componentSpace=this.evaluator.parent.getSpaceByCId(f.value),a.ctx.font=f.styleString,f.metrics=e(a.ctx.font),f.metrics.w=f.componentSpace.w,f.metrics.h=f.componentSpace.h,f.metrics.offsetX=d,Object.defineProperties(f.metrics,{x:{get:function(){return c.metrics.offsetX+this.offsetX}},y:{get:function(){return c.metrics.offsetY}}})):"formula"===f.nodeType&&(f.updateFormula(),f.metrics.offsetX_aux=d,Object.defineProperties(f.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}}}),f.metrics.w+=2*f.metrics.paddingX,f.metrics.ascent+=f.metrics.paddingY,f.metrics.descent+=f.metrics.paddingY,f.metrics.h+=2*f.metrics.paddingY,d+=2*f.metrics.marginX);this.metrics.w+=f.metrics.w+2*f.metrics.marginX;this.metrics.ascent=Math.max(this.metrics.ascent,f.metrics.ascent);this.metrics.descent=Math.max(this.metrics.descent,
f.metrics.descent);d+=f.metrics.w}this.metrics.h=this.metrics.ascent+this.metrics.descent}};l.prototype.updateFormula=function(){var b=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 d=this.children,g,l=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}},q=0,n=d.length;q<n;q++){g=d[q];if("text"===g.nodeType){a.ctx.font=g.style.toString();var z=""!==g.value?g.value:
"\u200a";g.metrics=e(a.ctx.font);g.metrics.w=a.ctx.measureText(z).width;g.metrics.offsetX=l;Object.defineProperties(g.metrics,{x:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.offsetX}},y:{get:function(){return b.metrics.offsetY}}});l+=b.metrics.marginX}else if("dynamicText"===g.nodeType){z=void 0===g.decimals?r:g.evaluator.eval(g.decimals);var x=void 0===g.fixed?m:g.fixed,y=g.evaluator.eval(g.value);parseFloat(y).toString()===y.toString()&&(y=x?parseFloat(y).toFixed(z):a.removeNeedlessDecimals(parseFloat(y).toFixed(z)),
y=(""+y).replace(".",g.decimal_symbol));g.evalValue=y;a.ctx.font=g.style.toString();g.metrics=e(a.ctx.font);g.metrics.marginX=parseInt(1.5+.075*this.style.size);g.metrics.paddingX=parseInt(1.5+.075*this.style.size);g.metrics.w=a.ctx.measureText(y).width+2*g.metrics.paddingX;g.metrics.offsetX_aux=l;Object.defineProperties(g.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.offsetX_aux+this.marginX}},
offsetY:{get:function(){return b.metrics.offsetY}}});l+=2*g.metrics.marginX}if("superIndex"===g.nodeType)z=g,z.updateFormula(),z.metrics.marginX=0*parseInt(1.5+.075*this.style.size),z.metrics.paddingX=0*parseInt(1.5+.075*this.style.size),z.metrics.paddingY=parseInt(1.5+.05*this.style.size),z.metrics.offsetX_aux=l,z.metrics.prevChild=h,Object.defineProperties(z.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+
b.metrics.paddingX+this.offsetX_aux+this.marginX}},offsetY:{get:function(){return b.metrics.offsetY-this.descent+this.prevChild.metrics.descent-parseInt(2*this.prevChild.metrics.h/7)}}}),z.metrics.w+=2*z.metrics.paddingX,z.metrics.ascent+=z.metrics.paddingY,z.metrics.descent+=z.metrics.paddingY,z.metrics.h+=2*z.metrics.paddingY,l+=2*z.metrics.marginX;else if("subIndex"===g.nodeType){var B=g;B.updateFormula();B.metrics.marginX=parseInt(1.5+.09375*this.style.size);B.metrics.paddingX=0*parseInt(1.5+
.01875*this.style.size);B.metrics.paddingY=parseInt(1.5+.05*this.style.size);B.metrics.offsetX_aux=l;B.metrics.prevChild=h;Object.defineProperties(B.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.offsetX_aux+0*this.marginX}},offsetY:{get:function(){return b.metrics.offsetY+this.ascent+B.metrics.prevChild.metrics.descent-parseInt(4*B.metrics.prevChild.metrics.h/7)}}});B.metrics.w+=B.metrics.paddingX;
B.metrics.ascent+=B.metrics.paddingY;B.metrics.descent+=B.metrics.paddingY;B.metrics.h+=2*B.metrics.paddingY;this.metrics.descent=B.metrics.ascent+B.metrics.prevChild.metrics.descent-parseInt(4*B.metrics.prevChild.metrics.h/7)+B.metrics.descent;l+=B.metrics.marginX}else if("fraction"===g.nodeType){x=g;x.updateFormula();z=x.children;y=z[0];z=z[1];x.metrics.marginX=parseInt(1.5+.075*this.style.size);x.metrics.paddingX=0*parseInt(1.5+.075*this.style.size);x.metrics.paddingY=0*parseInt(1.5+.05*this.style.size);
var E=Math.max(y.metrics.w,z.metrics.w)+2*x.metrics.paddingX;x.metrics.prevChild=h;x.metrics.offsetX_aux=l;var J=parseInt(-h.metrics.descent+4*h.metrics.h/9);Object.defineProperties(x.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY+J}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY-J}}});Object.defineProperties(y.metrics,{parent:{value:x},maxWidth:{value:E},
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(z.metrics,{parent:{value:x},maxWidth:{value:E},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}}});x.metrics.w=E;x.metrics.ascent=y.metrics.h+J+2*x.metrics.paddingY;x.metrics.descent=z.metrics.h-J+2*x.metrics.paddingY;x.metrics.h=y.metrics.h+z.metrics.h+4*x.metrics.paddingY;l+=2*x.metrics.marginX}else if("radical"===g.nodeType){h=g;h.updateFormula();z=h.children;x=z[0];var G=z[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=l;Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}});z=h.style.size;h.radicalSign={w:z,scaleX:z/722,scaleY:G.metrics.h/1E3};y=parseInt(x.metrics.w-2*h.radicalSign.w/3);Object.defineProperties(h.radicalSign,{parent:{value:h},
displaceIndex:{value:y},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+Math.max(this.displaceIndex,0)}},y:{get:function(){return b.metrics.offsetY-G.metrics.ascent}}});Object.defineProperties(x.metrics,{parent:{value:h},displaceIndex:{value:y},fontSize:{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+Math.max(this.displaceIndex,0)-this.displaceIndex}},
offsetY:{get:function(){return b.metrics.offsetY-this.descent-2*this.fontSize/5}}});Object.defineProperties(G.metrics,{parent:{value:h},displaceIndex:{value:y},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 b.metrics.offsetY}}});y=x.metrics.w<2*h.radicalSign.w/3?h.radicalSign.w:parseInt(x.metrics.w+
h.radicalSign.w/3);h.metrics.w=y+2*h.metrics.paddingX+G.metrics.w;h.metrics.ascent=Math.max(G.metrics.ascent,x.metrics.h+2*z/5)+h.metrics.paddingY;h.metrics.descent=G.metrics.descent+h.metrics.paddingY;h.metrics.h=h.metrics.ascent+h.metrics.descent;l+=2*h.metrics.marginX}else if("sum"===g.nodeType){x=g;x.updateFormula();z=x.children;y=z[0];E=z[1];var H=z[2];x.metrics.marginX=parseInt(1.5+.075*this.style.size);x.metrics.paddingX=parseInt(1.5+.075*this.style.size);x.metrics.paddingY=parseInt(1.5+.05*
this.style.size);x.metrics.offsetX_aux=l;Object.defineProperties(x.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}});a.ctx.font=g.style.toString();var A=e(a.ctx.font);h=parseInt(1.2*A.h);z=parseInt(.5+780*h/1E3);x.sigmaSign={w:z,h:h,scale:h/1E3};var I=Math.max(E.metrics.w,y.metrics.w,x.sigmaSign.w);x.sigmaSign.parent=
x;Object.defineProperties(x.sigmaSign,{sumWidth:{value:I},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.sumWidth-this.w)/2)}},y:{get:function(){return b.metrics.offsetY+A.descent-(this.h+A.h)/2}}});z=A.descent-E.metrics.descent-(h+A.h)/2-x.metrics.paddingY;Object.defineProperties(E.metrics,{parent:{value:x},sumWidth:{value:I},newBaselineTo:{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 b.metrics.offsetY+this.newBaselineTo}}});h=y.metrics.ascent+A.descent+(h-A.h)/2+x.metrics.paddingY;Object.defineProperties(y.metrics,{parent:{value:x},sumWidth:{value:I},newBaselineFrom:{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+parseInt((this.sumWidth-this.w)/2)}},offsetY:{get:function(){return b.metrics.offsetY+
this.newBaselineFrom}}});Object.defineProperties(H.metrics,{parent:{value:x},sumWidth:{value:I},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 b.metrics.offsetY}}});x.metrics.w=I+H.metrics.w+3*x.metrics.paddingX;x.metrics.ascent=Math.max(H.metrics.ascent,-z+E.metrics.ascent)+x.metrics.paddingY;x.metrics.descent=Math.max(H.metrics.descent,
h+y.metrics.descent)+x.metrics.paddingY;x.metrics.h=x.metrics.ascent+x.metrics.descent;l+=2*x.metrics.marginX}else if("integral"===g.nodeType){x=g;x.updateFormula();z=x.children;y=z[0];E=z[1];H=z[2];x.metrics.marginX=parseInt(1.5+.075*this.style.size);x.metrics.paddingX=parseInt(1.5+.075*this.style.size);x.metrics.paddingY=parseInt(1.5+.05*this.style.size);x.metrics.offsetX_aux=l;Object.defineProperties(x.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+
b.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}});a.ctx.font=g.style.toString();A=e(a.ctx.font);I=parseInt(1.2*A.h);var C=parseInt(10.5+529*I/1E3);x.sign={w:C,h:I,scale:I/1E3};x.sign.parent=x;Object.defineProperties(x.sign,{x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX}},y:{get:function(){return b.metrics.offsetY+A.descent-(this.h+A.h)/2}}});z=A.descent-(I+A.h)/2-E.metrics.descent+I/3;Object.defineProperties(E.metrics,
{parent:{value:x},integralWidth:{value:C},newBaselineTo:{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(4*this.integralWidth/5)}},offsetY:{get:function(){return b.metrics.offsetY+this.newBaselineTo}}});h=A.descent+y.metrics.ascent/2;Object.defineProperties(y.metrics,{parent:{value:x},integralWidth:{value:C},newBaselineFrom:{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+parseInt(2*this.integralWidth/5)}},offsetY:{get:function(){return b.metrics.offsetY+this.newBaselineFrom}}});C=Math.max(parseInt(4*C/5)+E.metrics.w,parseInt(2*C/5+y.metrics.w))+x.metrics.paddingX;Object.defineProperties(H.metrics,{parent:{value:x},whatDisplace:{value:C},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 b.metrics.offsetY}}});x.metrics.w=C+H.metrics.w+2*x.metrics.paddingX;x.metrics.ascent=Math.max(H.metrics.ascent,-z+E.metrics.ascent)+x.metrics.paddingY;x.metrics.descent=Math.max(H.metrics.descent,h+y.metrics.descent,I-x.metrics.ascent)+x.metrics.paddingY;x.metrics.h=Math.max(x.metrics.ascent+x.metrics.descent,I);l+=2*x.metrics.marginX}else if("limit"===g.nodeType){h=g;h.updateFormula();z=h.children;var M=z[0];x=z[1];
z=z[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=l;Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}});a.ctx.font=g.style.toString();A=e(a.ctx.font);
E=parseInt(.5+a.ctx.measureText("l\u00edm").width);y=parseInt(.5+a.ctx.measureText("\u2192").width);limitWidth=Math.max(E,M.metrics.w+y+x.metrics.w);h.limitText={parent:h};Object.defineProperties(h.limitText,{limitWidth:{value:limitWidth},limitTextWidth:{value:E},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+(this.limitWidth-this.limitTextWidth)/2}}});E=A.descent+Math.max(M.metrics.ascent,x.metrics.ascent,2*A.ascent/3)+h.metrics.paddingY;h.limitArrow={parent:h};
Object.defineProperties(h.limitArrow,{newBaseline:{value:E},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+M.metrics.w}},y:{get:function(){return b.metrics.offsetY+this.newBaseline}}});Object.defineProperties(M.metrics,{parent:{value:h},newBaseline:{value:E},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 b.metrics.offsetY+
this.newBaseline}}});Object.defineProperties(x.metrics,{parent:{value:h},arrowWidth:{value:y},newBaseline:{value:E},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+M.metrics.w+this.arrowWidth}},offsetY:{get:function(){return b.metrics.offsetY+this.newBaseline}}});Object.defineProperties(z.metrics,{parent:{value:h},limitWidth:{value:limitWidth},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 b.metrics.offsetY}}});h.metrics.w=limitWidth+z.metrics.w+3*h.metrics.paddingX;h.metrics.ascent=Math.max(z.metrics.ascent,A.ascent)+h.metrics.paddingY;h.metrics.descent=E+Math.max(M.metrics.descent,x.metrics.descent)+h.metrics.paddingY;h.metrics.h=h.metrics.ascent+h.metrics.descent;l+=2*h.metrics.marginX}else if("matrix"===
g.nodeType){y=g;y.updateFormula();z=y.children;E=y.rows;H=y.columns;y.metrics.marginX=parseInt(1.5+.075*this.style.size);y.metrics.paddingX=parseInt(1.5+.075*this.style.size);y.metrics.paddingY=parseInt(1.5+.05*this.style.size);y.metrics.offsetX_aux=l;Object.defineProperties(y.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}});
a.ctx.font=g.style.toString();A=e(a.ctx.font);I=[];C=[];h=0;for(var N=E*H;h<N;h++){var O=parseInt(h/H);var F=h%H;I[O]=Math.max(I[O]||0,z[h].metrics.h);C[F]=Math.max(C[F]||0,z[h].metrics.w)}var D=(1+H)*y.metrics.paddingX;for(h=0;h<H;h++)D+=C[h];var K=(1+E)*y.metrics.paddingY;for(h=0;h<E;h++)K+=I[h];x=A.descent-A.h/2;h=0;for(N=E*H;h<N;h++)O=parseInt(h/H),F=h%H,z[h].metrics.offsetX_aux=f(C,F)+(C[F]-z[h].metrics.w)/2+F*y.metrics.paddingX,z[h].metrics.offsetY_aux=f(I,O)+(I[O]-z[h].metrics.h)/2+(1+O)*y.metrics.paddingY,
Object.defineProperties(z[h].metrics,{parent:{value:y},matrixH:{value:K},dispY:{value:x},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 b.metrics.offsetY-this.matrixH/2+this.ascent+this.offsetY_aux+this.dispY}}});y.metrics.w=D;y.metrics.ascent=K/2-x;y.metrics.descent=K/2+x;y.metrics.h=y.metrics.ascent+y.metrics.descent;l+=2*y.metrics.marginX}else if("defparts"===
g.nodeType){y=g;y.updateFormula();z=g.children;E=g.parts;y.metrics.marginX=parseInt(1.5+.075*this.style.size);y.metrics.paddingX=parseInt(1.5+.075*this.style.size);y.metrics.paddingY=parseInt(1.5+.05*this.style.size);y.metrics.offsetX_aux=l;Object.defineProperties(y.metrics,{parent:{value:b},x:{get:function(){return this.offsetX-2*this.marginX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+3*this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}});
a.ctx.font=g.style.toString();A=e(a.ctx.font);H=0;I=y.metrics.paddingY;x=A.descent-A.h/2;for(h=0;h<E;h++)z[h].metrics.offsetY_aux=I,H=Math.max(H,z[h].metrics.w),I+=z[h].metrics.h+y.metrics.paddingY,Object.defineProperties(z[h].metrics,{parent:{value:y},dispY:{value:x},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 b.metrics.offsetY-this.parent.metrics.defpartsH/
2+this.ascent+this.offsetY_aux+this.dispY}}});y.metrics.defpartsH=I;y.metrics.w=H+4*y.metrics.paddingX;y.metrics.ascent=I/2-x;y.metrics.descent=I/2+x;y.metrics.h=y.metrics.ascent+y.metrics.descent;l+=2*y.metrics.marginX}else if("numerator"===g.nodeType||"denominator"===g.nodeType||"index"===g.nodeType||"radicand"===g.nodeType||"from"===g.nodeType||"to"===g.nodeType||"what"===g.nodeType||"element"===g.nodeType)g.updateFormula(),g.metrics.paddingX=parseInt(1.5+.075*this.style.size),g.metrics.paddingY=
parseInt(1.5+.05*this.style.size),g.metrics.w+=2*g.metrics.paddingX,g.metrics.ascent+=g.metrics.paddingY,g.metrics.descent+=g.metrics.paddingY,g.metrics.h=g.metrics.ascent+g.metrics.descent;h=g;this.metrics.ascent=Math.max(this.metrics.ascent,g.metrics.ascent);this.metrics.descent=Math.max(this.metrics.descent,g.metrics.descent);this.metrics.w+=g.metrics.w+2*g.metrics.marginX;this.metrics.h=this.metrics.ascent+this.metrics.descent;l+=g.metrics.w}};l.prototype.justifyAux=function(a){for(var b=0,c=
0,d=0,e=this.children.length;d<e-1;d++)"space"===this.children[d].nodeType?b++:c+=this.children[d].metrics.w;this.updateLine((a-c)/b)};l.prototype.drawTextBlock=function(a){a.fillStyle=d;for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a)};l.prototype.drawTextLineBlock=function(a){for(var b=0,c=this.children.length;b<c;b++)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:d;a.font=this.style.toString();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 e=a.strokeStyle;a.lineWidth=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=e}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.drawDynamicText=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:d;a.font=this.style.toString();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();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++)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:d;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(c){c.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:d;c.save();
c.translate(this.radicalSign.x,this.radicalSign.y);c.scale(this.radicalSign.scaleX,this.radicalSign.scaleY);a.isMsEdge?this.drawRadicalSign(c):c.fill(b);c.restore();c.beginPath();c.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 e=0,g=this.children.length;e<g;e++)this.children[e].draw(c);this.drawBorder(c,"blue")};l.prototype.drawSum=function(b){b.save();b.fillStyle=null!==this.style.color?this.style.color.getColor?
this.style.color.getColor():this.style.color:d;b.translate(this.sigmaSign.x,this.sigmaSign.y);b.scale(this.sigmaSign.scale,this.sigmaSign.scale);a.isMsEdge?this.drawSigmaSign(b):b.fill(h);b.restore();for(var c=0,e=this.children.length;c<e;c++)this.children[c].draw(b);this.drawBorder(b,"blue")};l.prototype.drawIntegral=function(b){b.save();b.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:d;b.translate(this.sign.x,this.sign.y);b.scale(this.sign.scale,
this.sign.scale);a.isMsEdge?this.drawIntegralSign(b):b.fill(g);b.restore();for(var c=0,e=this.children.length;c<e;c++)this.children[c].draw(b);this.drawBorder(b,"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:d;a.font=this.style.toString();a.fillText("l\u00edm",this.limitText.x,this.metrics.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);b=parseInt(1.5+this.style.size/25);c=b/2;a.lineWidth=b;a.strokeStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:d;a.beginPath();a.moveTo(this.metrics.x+c+1.5*this.metrics.marginX,this.metrics.y+c-this.metrics.ascent);a.lineTo(this.metrics.x+c,this.metrics.y+c-this.metrics.ascent);a.lineTo(this.metrics.x+
c,this.metrics.y-c-this.metrics.ascent+this.metrics.h);a.lineTo(this.metrics.x+c+1.5*this.metrics.marginX,this.metrics.y-c-this.metrics.ascent+this.metrics.h);a.moveTo(this.metrics.x+this.metrics.w-c-1.5*this.metrics.marginX,this.metrics.y+c-this.metrics.ascent);a.lineTo(this.metrics.x+this.metrics.w-c,this.metrics.y+c-this.metrics.ascent);a.lineTo(this.metrics.x+this.metrics.w-c,this.metrics.y+c-this.metrics.ascent+this.metrics.h);a.lineTo(this.metrics.x+this.metrics.w-c-1.5*this.metrics.marginX,
this.metrics.y+c-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:d;a.beginPath();c=3*this.metrics.marginX;var e=c/2;a.moveTo(this.metrics.x+b+c,this.metrics.y+b-this.metrics.ascent);a.bezierCurveTo(this.metrics.x+
b+e,this.metrics.y+b-this.metrics.ascent,this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent,this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+2*this.metrics.marginX);a.lineTo(this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2-5*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+e,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+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2+5*this.metrics.marginX);a.lineTo(this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h-2*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+b+e,this.metrics.y-b-this.metrics.ascent+this.metrics.h,this.metrics.x+b+e,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.drawRadicalSign=function(a){a.strokeStyle=
"rgba(0,0,0,0)";a.lineCap="butt";a.lineJoin="miter";a.miterLimit=4;a.beginPath();a.moveTo(759,1);a.bezierCurveTo(751,1,744,5,739,15);a.lineTo(325,878);a.lineTo(153,500);a.bezierCurveTo(148,489,142,486,136,491);a.lineTo(2,596);a.bezierCurveTo(-3,600,19,626,24,622);a.lineTo(89,575);a.lineTo(282,997);a.bezierCurveTo(285,1003,309,1003,314,993);a.lineTo(773,40);a.lineTo(773,1);a.closePath();a.fill();a.stroke()};l.prototype.drawSigmaSign=function(a){a.strokeStyle="rgba(0,0,0,0)";a.lineCap="butt";a.lineJoin=
"miter";a.miterLimit=4;a.beginPath();a.moveTo(780,707);a.lineTo(750,707);a.bezierCurveTo(728,805,695,872,585,872);a.lineTo(180,872);a.lineTo(509,447);a.lineTo(225,65);a.lineTo(538,65);a.bezierCurveTo(668,65,705,114,726,246);a.lineTo(756,246);a.lineTo(756,0);a.lineTo(25,0);a.lineTo(384,500);a.lineTo(0,1E3);a.lineTo(729,1E3);a.closePath();a.fill();a.stroke()};l.prototype.drawIntegralSign=function(a){a.strokeStyle="rgba(0,0,0,0)";a.lineCap="butt";a.lineJoin="miter";a.miterLimit=4;a.beginPath();a.moveTo(150,
828);a.bezierCurveTo(129,916,108,972,67,972);a.bezierCurveTo(61,972,58,970,58,966);a.bezierCurveTo(58,957,73,958,73,932);a.bezierCurveTo(73,918,60,910,46,910);a.bezierCurveTo(22,910,1,932,1,961);a.bezierCurveTo(1,981,22,1E3,57,1E3);a.bezierCurveTo(154,1E3,198,895,216,824);a.lineTo(375,181);a.bezierCurveTo(398,90,420,27,464,28);a.bezierCurveTo(470,28,473,30,473,34);a.bezierCurveTo(473,41,458,47,458,69);a.bezierCurveTo(458,83,471,89,485,89);a.bezierCurveTo(509,89,530,67,530,38);a.bezierCurveTo(530,
18,508,0,473,0);a.bezierCurveTo(368,0,326,120,309,190);a.closePath();a.fill();a.stroke()};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([])};l.prototype.toRTF=function(){var a=[],b=[],d="";this.mergeTextNodes();for(var e=0,g=this.children.length;e<g;e++){var f=this.children[e];"textLineBlock"===f.nodeType&&
(d+=f.toRTFAux(a,b)+(1<g&&e<g-1?"\\par":""))}f="{\\fonttbl";e=0;for(g=a.length;e<g;e++)f+="\\f"+e+"\\fcharset0 "+a[e]+";";a="";if(0<b.length){a="{\\colortbl";e=0;for(g=b.length;e<g;e++)a+=b[e];a+="}"}return"{\\rtf1\\uc0"+(f+"}")+a+d+"}"};l.prototype.toRTFAux=function(a,b){for(var c,e,g,f=null,l="",h,m,q,u,r,J=0,G=this.children.length;J<G;J++)h=m="",c=this.children[J],q=this.addToFontTable(c.style.family,a),u=c.style.size,r=this.addToColorTable(c.style.color,b),null===r&&0<b.length&&(r=this.addToColorTable(d,
b)),r!==f&&(h+="\\cf"+r,f=r),q!==e&&(h+="\\f"+q,e=q),u!==g&&(h+="\\fs"+2*u,g=u),c.style.italic&&(h+="\\i",m="\\i0"+m),c.style.bold&&(h+="\\b",m="\\b0"+m),c.style.underline&&(h+="\\ul",m="\\ulnone"+m),c.style.overline&&(h+="\\ol",m="\\olnone"+m),"text"===c.nodeType?(c.value=c.value.replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/{/g,"\\{").replace(/}/g,"\\}"),c=""!==h?h+" "+c.value+m:""!==l&&"}"!==l.charAt(l.length-1)?" "+c.value:c.value,l+=c):"formula"===c.nodeType?l+="{\\*\\mjaformula"+c.formulaToRTF(e,
g,f,a,b)+"}":"componentSpace"===c.nodeType?l+="{\\*\\component\\Space "+c.value+"}":"componentNumCtrl"===c.nodeType&&(l+="{\\*\\component\\NumCtrl "+c.value+"}");return l};l.prototype.formulaToRTF=function(a,b,e,g,f){for(var c,l="",h,k,m,q,p=0,u=this.children.length;p<u;p++)h=k="",c=this.children[p],m=this.addToFontTable(c.style.family,g),q=this.addToColorTable(c.style.color,f),null===q&&0<f.length&&(q=this.addToColorTable(d,f)),m!==a&&(h+="\\f"+m,a=m),q!==e&&(h+="\\cf"+q,"text"!==c.nodeType||"text"===
c.nodeType&&""!==c.value)&&(e=q),c.style.italic&&(h+="\\i",k="\\i0"+k),c.style.bold&&(h+="\\b",k="\\b0"+k),c.style.underline&&(h+="\\ul",k="\\ulnone"+k),c.style.overline&&(h+="\\ol",k="\\olnone"+k),"text"===c.nodeType&&""!==c.value?(c.value=c.value.replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/{/g,"\\{").replace(/}/g,"\\}"),tmpRTF=""!==h?h+" "+c.value+k:"}"!==l.charAt(l.length-1)?" "+c.value:c.value,l+=tmpRTF):"dynamicText"===c.nodeType?(c.value=""===c.value?" ":c.value,l+=h+"{\\expr "+c.value+
"\\decimals "+(c.decimals||2)+"\\fixed"+(c.fixed?1:0)+"}"+k):"fraction"===c.nodeType||"radical"===c.nodeType||"index"===c.nodeType||"radicand"===c.nodeType||"sum"===c.nodeType||"integral"===c.nodeType||"limit"===c.nodeType||"from"===c.nodeType||"to"===c.nodeType||"what"===c.nodeType||"element"===c.nodeType?l+="{\\"+c.nodeType+c.formulaToRTF(a,b,e,g,f)+"}":"numerator"===c.nodeType?l+="{\\num"+c.formulaToRTF(a,b,e,g,f)+"}":"denominator"===c.nodeType?l+="{\\den"+c.formulaToRTF(a,b,e,g,f)+"}":"superIndex"===
c.nodeType?l+="{\\supix"+c.formulaToRTF(a,b,e,g,f)+"}":"subIndex"===c.nodeType?l+="{\\subix"+c.formulaToRTF(a,b,e,g,f)+"}":"matrix"===c.nodeType?l+="{\\matrix\\rows "+(c.rows||2)+"\\columns "+(c.columns||2)+c.formulaToRTF(a,b,e,g,f)+"}":"defparts"===c.nodeType&&(l+="{\\defparts\\parts "+(c.parts||2)+c.formulaToRTF(a,b,e,g,f)+"}");return l};l.prototype.addToFontTable=function(a,b){var c;a.match(/times/i)?c="Times New Roman":a.match(/courier/i)?c="Courier New":a.match(/arial/i)&&(c="Arial");a=b.indexOf(c);
-1===a&&(a=b.length,b.push(c));return a};l.prototype.addToColorTable=function(a,b){if(a){a="\\red"+parseInt(a.substring(1,3),16)+"\\green"+parseInt(a.substring(3,5),16)+"\\blue"+parseInt(a.substring(5,7),16)+";";var c=b.indexOf(a);-1===c&&(c=b.length,b.push(a));return c}return null};l.prototype.mergeTextNodes=function(){for(var a=[],b=null,d=0,e=this.children.length;d<e;d++)"text"===this.children[d].nodeType?null!==b&&"text"===b.nodeType&&b.style.equals(this.children[d].style)&&(this.children[d].value=
b.value+this.children[d].value,a.push(b)):this.children[d].mergeTextNodes(),b=this.children[d];d=0;for(e=a.length;d<e;d++)this.removeChild(a[d])};var q={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}};a.TextNode=l;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=String.fromCharCode,e,d,r,m,b,h,g,l,q,c,u,k=function(){};k.prototype.tokenize=function(a){if(a)a=a.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[];e=[];d="";m=r=0;h=a.charAt(0);g=!1;for(l="text";r<a.length;)b=h,h=a.charAt(r+1),g?"\\"===h||"{"===h||"}"===
h||" "===h||";"===h?(g=!1,d+=b," "===h?(r++,h=a.charAt(r+1),u=!0):u=!1,(q=d.match(/^'([0-9a-f]{2})/))?(c="","text"===l&&(c=e.pop().value),d=c+=f(parseInt(q[1],16))+d.substring(3)):(q=d.match(/^u[0-9]+/))?(c="","text"===l&&(c=e.pop().value),d=c+=f(q[0].substring(1))):("{"===d||"}"===d||"\\"==b?(e.push({type:"text",value:d+(u?" ":"")}),l="text"):(e.push({type:"controlWord",value:d}),l="controlWord"),d="")):"{"==b||"}"==b||"\\"==b?(g=!1,e.push({type:"text",value:b}),l="text"):d+=b:"\\"===b?(g=!0,""!==
d&&(e.push({type:"text",value:d}),l="text",d="")):"{"===b?(m++,""!==d&&(e.push({type:"text",value:d}),d=""),e.push({type:"openBlock",value:m}),l="openBlock"):"}"===b?(""!==d&&(e.push({type:"text",value:d}),d=""),e.push({type:"closeBlock",value:m}),l="closeBlock",m--):d+=b,r++;""!==d&&e.push({type:"text",value:d});return e};a.RTFTokenizer=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.max,e,d,r,m,b,h,g,l,q,c,u,k,w,p,v,n,z,x,y,B,E,J,G,H,A,I,C,M,N,O,F=function(b){this.evaluator=b;this.tokenizer=new a.RTFTokenizer};F.prototype.parse=function(D){e=this.tokenizer.tokenize(D);d={};m=2;if("openBlock"===e[0].type&&"fonttbl"===e[1].value){for(r=e[0].value;"closeBlock"!==e[m].type&&e[m].value!==r;)d[e[m].value]=e[m+2].value.substring(0,e[m+2].value.length-1),m+=3;m++}b={};h=0;if("openBlock"===e[m].type&&"colortbl"===e[m+1].value){r=
e[m++].value;for(m++;"closeBlock"!==e[m].type&&e[m].value!==r;)g=parseInt(e[m++].value.substring(3)).toString(16),l=parseInt(e[m++].value.substring(5)).toString(16),q=parseInt(e[m++].value.substring(4)).toString(16),";"===e[m].value&&m++,b[h++]="#"+(2>g.length?"0"+g:g)+(2>l.length?"0"+l:l)+(2>q.length?"0"+q:q);m++}p=w=k=null;M=C=I=B=y=x=z=n=v=!1;E=[new a.TextStyle];J=E[0];H=G=-1;A=[];c=N=new a.TextNode("","textBlock",J,this.evaluator);u=new a.TextNode("","textLineBlock",J,this.evaluator);c.addChild(u);
N.stableWidth=!0;N.hasFormula=!1;D=m;for(var F=e.length;D<F;D++){if("controlWord"==e[D].type)if(d[e[D].value])J.set({family:d[e[D].value]});else if(e[D].value.match(/^fs(\d+)/))J.set({size:parseInt(e[D].value.match(/^fs(\d+)/)[1]/2)});else if("b"==e[D].value)J.set({bold:!0}),0<A.length&&A[A.length-1].style.set({bold:!0});else if("b0"==e[D].value)J.set({bold:!1}),0<A.length&&A[A.length-1].style.set({bold:!1});else if("i"==e[D].value)J.set({italic:!0}),0<A.length&&A[A.length-1].style.set({italic:!0});
else if("i0"==e[D].value)J.set({italic:!1}),0<A.length&&A[A.length-1].style.set({italic:!1});else if("ul"==e[D].value)J.set({underline:!0}),0<A.length&&A[A.length-1].style.set({underline:!0});else if("ulnone"==e[D].value)J.set({underline:!1}),0<A.length&&A[A.length-1].style.set({underline:!1});else if("ol"==e[D].value)J.set({overline:!0}),0<A.length&&A[A.length-1].style.set({overline:!0});else if("olnone"==e[D].value)J.set({overline:!1}),0<A.length&&A[A.length-1].style.set({overline:!1});else if(e[D].value.match(/^cf(\d+)/))J.set({color:b[parseInt(e[D].value.substring(2))]}),
0<A.length&&(A[A.length-1].style.color=J.color);else if("par"==e[D].value){c=new a.TextNode("","textLineBlock",J.clone(),this.evaluator);if("textBlock"!=u.nodeType)for(u=u.parent;"textBlock"!=u.nodeType;)u=u.parent;u.addChild(c);u=c}else if("mjaformula"==e[D].value)N.hasFormula=!0,H=G,v=!0,c=new a.TextNode("","formula",J.clone(),this.evaluator),u.addChild(c),u=c,A[A.length-1]=c;else if("fraction"==e[D].value||"radicand"==e[D].value||"radical"==e[D].value||"what"==e[D].value||"sum"==e[D].value||"integral"==
e[D].value||"limit"==e[D].value){var L=A[A.length-2].style.clone();c=new a.TextNode("",e[D].value,L,this.evaluator);A[A.length-2].addChild(c);A[A.length-1]=c}else"index"==e[D].value?(L=A[A.length-2].style.clone(),L.size=f(parseInt(L.size-.5*L.size),8),c=new a.TextNode("",e[D].value,L,this.evaluator),A[A.length-2].addChild(c),A[A.length-1]=c):"to"==e[D].value||"from"==e[D].value?(L=A[A.length-2].style.clone(),L.size=f(parseInt(L.size-.2*L.size),8),c=new a.TextNode("",e[D].value,L,this.evaluator),A[A.length-
2].addChild(c),A[A.length-1]=c):"num"==e[D].value||"den"==e[D].value?(L=A[A.length-2].style.clone(),L.size=f(Math.round(L.size-.1*L.size),8),"num"==e[D].value?c=new a.TextNode("","numerator",L,this.evaluator):"den"==e[D].value&&(c=new a.TextNode("","denominator",L,this.evaluator)),A[A.length-2].addChild(c),A[A.length-1]=c):"subix"==e[D].value||"supix"==e[D].value?(L=A[A.length-2].style.clone(),L.size=f(Math.floor(L.size-.33*L.size),8),"subix"==e[D].value?c=new a.TextNode("","subIndex",L,this.evaluator):
"supix"==e[D].value&&(c=new a.TextNode("","superIndex",L,this.evaluator)),c.originalStyle=A[A.length-2].style.clone(),A[A.length-2].addChild(c),A[A.length-1]=c):"defparts"==e[D].value||"matrix"==e[D].value||"element"==e[D].value?(L=A[A.length-2].style.clone(),c=new a.TextNode("",e[D].value,L,this.evaluator),A[A.length-2].addChild(c),A[A.length-1]=c,"defparts"==e[D].value?p=c:"matrix"==e[D].value&&(w=c)):"parts"==e[D].value?B=!0:"rows"==e[D].value?x=!0:"columns"==e[D].value?y=!0:"expr"==e[D].value?
(N.stableWidth=!1,n=!0):"decimals"==e[D].value?z=!0:"fixed1"==e[D].value?k.fixed=!0:"fixed0"==e[D].value?k.fixed=!1:"component"!=e[D].value&&("NumCtrl"==e[D].value?I=!0:"Space"==e[D].value?C=!0:"hyperlink"==e[D].value&&(M=!0));if("text"==e[D].type)if(B)p.parts=parseInt(e[D].value),B=!1;else if(x)w.rows=parseInt(e[D].value),x=!1;else if(y)w.columns=parseInt(e[D].value),y=!1;else if(z)k.decimals=this.evaluator.parser.parse(e[D].value+""),z=!1;else if(M){O=e[D].value.split("|")[0];L=J.clone();c=new a.TextNode(O,
"hyperlink",L,this.evaluator);c.URL=e[D].value.split("|")[1];if("textLineBlock"!=u.nodeType)for(u=u.parent;"textLineBlock"!=u.nodeType;)u=u.parent;u.addChild(c);M=!1}else if(I)c=new a.TextNode(e[D].value,"componentNumCtrl",J.clone(),this.evaluator),u.addChild(c),I=!1;else if(C)c=new a.TextNode(e[D].value,"componentSpace",J.clone(),this.evaluator),u.addChild(c),C=!1;else if(n)L=A[A.length-2].style.clone(),O=this.evaluator.parser.parse(e[D].value),c=new a.TextNode(O,"dynamicText",L,this.evaluator),
A[A.length-2].addChild(c),k=A[A.length-1]=c,n=!1;else if(n||v)!n&&v&&(O=e[D].value,c=new a.TextNode(O,"text",A[A.length-1].style.clone(),this.evaluator),A[A.length-1].addChild(c));else{O=e[D].value;c=new a.TextNode(O,"text",J.clone(),this.evaluator);if("textLineBlock"!=u.nodeType)for(u=u.parent;"textLineBlock"!=u.nodeType;)u=u.parent;u.addChild(c)}else if("openBlock"==e[D].type)G=e[D].value,J=J.clone(),E.push(J),A.push(null);else if("closeBlock"==e[D].type)e[D].value==H&&(H=-1,v=!1,u=u.parent),E.pop(),
J=E[E.length-1],A.pop();else if("("==e[D].type||")"==e[D].type)L=A[A.length-1].style.clone(),L.italic="",c=new a.TextNode(e[D].type,"mathSymbol",L,this.evaluator),A[A.length-1].addChild(c);else if("+"==e[D].type||"-"==e[D].type||"*"==e[D].type||"="==e[D].type)c=new a.TextNode(e[D].type,"mathSymbol",A[A.length-1].style.clone(),this.evaluator),A[A.length-1].addChild(c)}return N.normalize()};a.RTFParser=F;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h,g,l,q,c,u=function(b,c){this.parent=b;e=this.evaluator=this.parent.evaluator;d=e.parser;this.id="";this.type="2D";this.xExpr=d.parse("0");this.yExpr=d.parse("0");this.w=parseInt(b.container.width);this.h=parseInt(b.container.height);this.drawif=d.parse("1");this.fixed=2===b.version;this.scale=48;this.Oy=this.Ox=0;this.image=new Image;this.image.onload=function(){this.ready=1};this.imageSrc="";this.bg_display="topleft";this.background=
new a.Color("ffffff");this.net=2!=b.version?new a.Color("c0c0c0"):"";this.net10=2!=b.version?new a.Color("808080"):"";this.axes=2!=b.version?new a.Color("808080"):"";this.text=new a.Color("ffafaf");this.numbers=!1;this.y_axis=this.x_axis=2!=b.version?"":" ";this.sensitive_to_mouse_movements=!1;this.cID="";this.mouse_y=this.mouse_x=0;this.ctrs=[];this.graphicsCtr=[];this.graphics=[];this.backGraphics=[];this.zIndex=b.zIndex;this.plecaHeight=b.plecaHeight||0;this.displaceRegionNorth=b.displaceRegionNorth||
0;this.displaceRegionWest=b.displaceRegionWest||0;Object.assign(this,c);this.initSpace()};u.prototype.initSpace=function(){f=this.parent;e=this.evaluator;r=this.id;this.resizable||(this.displaceRegionNorth=f.displaceRegionNorth||0,this.displaceRegionSouth=f.displaceRegionSouth||0,this.displaceRegionEast=f.displaceRegionEast||0,this.displaceRegionWest=f.displaceRegionWest||0,g=parseInt(f.container.width),h=parseInt(f.container.height),void 0!=this.wExpr&&(this.w=parseInt(g-this.displaceRegionWest-
this.displaceRegionEast)*parseFloat(this.wExpr)/100),void 0!=this.hExpr&&(this.h=parseInt(h-this.displaceRegionNorth-this.displaceRegionSouth)*parseFloat(this.hExpr)/100),void 0!=this.xPercentExpr&&(this.xExpr=e.parser.parse((parseInt(g-this.displaceRegionWest-this.displaceRegionEast)*parseFloat(this.xPercentExpr)/100).toString())),void 0!=this.yPercentExpr&&(this.yExpr=e.parser.parse((parseInt(h-this.displaceRegionNorth-this.displaceRegionSouth)*parseFloat(this.yPercentExpr)/100).toString())),this.x=
e.eval(this.xExpr)+this.displaceRegionWest,this.y=e.eval(this.yExpr)+this.plecaHeight+this.displaceRegionNorth,this.container&&(this.container.style.left=this.x+"px",this.container.style.top=this.y+"px"),0<=this.y?(m=h-this.y,this.h>m&&(this.h=m)):(m=this.h+this.y,this.h=m>=h?h:m),0<=this.x?(b=g-this.x,this.w>b&&(this.w=b)):(b=this.w+this.x,this.w=b>=g?g:b));""==this.imageSrc&&/vacio.gif$/i.test(this.imageSrc.trim())||(this.image=f.getImage(this.imageSrc));this.OxExpr&&(q=this.OxExpr,"%"===q[q.length-
1]?this.Ox=this.w*parseFloat(q)/100:(l=parseFloat(q),l!=q&&(l=0),this.Ox=l));this.OyExpr&&(c=this.OyExpr,"%"===c[c.length-1]?this.Oy=this.h*parseFloat(c)/100:(l=parseFloat(c),l!=c&&(l=0),this.Oy=l));""!==this.id&&2!==f.version?(e.setVariable(r+"._w",this.w),e.setVariable(r+"._h",this.h),e.setVariable(r+".escala",this.scale),e.setVariable(r+".Ox",this.Ox),e.setVariable(r+".Oy",this.Oy),e.setVariable(r+".mouse_x",0),e.setVariable(r+".mouse_y",0),e.setVariable(r+".mouse_pressed",0),e.setVariable(r+".mouse_clicked",
0),e.setVariable(r+".clic_izquierdo",0)):(l=e.getVariable("_w"),void 0===l&&(l=this.w),e.setVariable("_w",l),l=e.getVariable("_h"),void 0===l&&(l=this.h),e.setVariable("_h",l),l=e.getVariable("escala"),void 0===l&&(l=this.scale),e.setVariable("escala",l),l=e.getVariable("Ox"),void 0===l&&(l=this.Ox),e.setVariable("Ox",l),l=e.getVariable("Oy"),void 0===l&&(l=this.Oy),e.setVariable("Oy",l),e.setVariable("mouse_x",0),e.setVariable("mouse_y",0),e.setVariable("mouse_pressed",0),e.setVariable("mouse_clicked",
0),e.setVariable("clic_izquierdo",0),2==f.version&&""===this.x_axis&&""===this.y_axis&&(this.axes=""));this.w_2=this.w/2;this.h_2=this.h/2};u.prototype.addCtr=function(a){"GraphicControl"===a.type?this.graphicsCtr.push(a):this.ctrs.push(a)};u.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))};u.prototype.clearClick=function(){this.evaluator.setVariable(this.mclickedString,0);this.evaluator.setVariable(this.mclicizquierdoString,
0)};u.prototype.getRelativeX=function(a){return(parseInt(a)-this.w_2-this.Ox)/this.scale};u.prototype.getRelativeY=function(a){return(-parseInt(a)+this.h_2+this.Oy)/this.scale};u.prototype.getAbsoluteX=function(a){return a*this.scale+this.w_2+this.Ox};u.prototype.getAbsoluteY=function(a){return-a*this.scale+this.h_2+this.Oy};a.Space=u;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e=function(d){f=this;f.parent=d;f.width=228;f.vSpace=25;f.container=a.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:"+(f.width+27)+"px;height:460px;"});f.movable=a.newHTML("div",{style:"position:absolute;left:0;top:0;width:"+(f.width+27)+"px;height:"+f.vSpace+
"px;line-height:"+f.vSpace+"px;background-color:#ddd;cursor:move;padding-left:75px;font-family:"+a.sansserif_font+";font-size:18px;"});f.movable.innerHTML="Descartes";f.container.appendChild(f.movable);f.ctrs=[]};e.prototype.init=function(){function d(b){f.newPos=a.getCursorPosition(b,document.body);f.container.style.left=f.initialPosition.x+(f.newPos.x-f.oldPos.x)*a.cssScale+"px";f.container.style.top=f.initialPosition.y+(f.newPos.y-f.oldPos.y)*a.cssScale+"px"}function e(a){a.preventDefault();document.body.removeEventListener("mousemove",
d);document.body.removeEventListener("mouseup",e)}f=this;document.body.appendChild(this.container);for(var m=f.parent.evaluator.parser,b=0,h=f.ctrs.length;b<h;b++)f.ctrs[b].expresion=m.parse("(0,"+(f.vSpace+23+35*b)+","+f.width+",35)"),f.ctrs[b].update();f.numCtr=h;b=new a.Button(f.parent,{region:"external",name:"english"==f.language?"about":"cr\u00e9ditos",font_size:m.parse("15"),expresion:m.parse("(0,"+f.vSpace+","+f.width/2+",25)")});b.actionExec={execute:a.showAbout};b.update();(new a.Button(f.parent,
{region:"external",name:"config",font_size:m.parse("15"),action:"config",expresion:m.parse("("+f.width/2+","+f.vSpace+","+f.width/2+",25)")})).update();(new a.Button(f.parent,{region:"external",name:"english"==f.language?"init":"inicio",font_size:m.parse("15"),action:"init",expresion:m.parse("(0,"+(f.vSpace+23+35*h)+","+f.width/2+",25)")})).update();(new a.Button(f.parent,{region:"external",name:"english"==f.language?"clear":"limpiar",font_size:m.parse("15"),action:"clear",expresion:m.parse("("+f.width/
2+","+(f.vSpace+23+35*h)+","+f.width/2+",25)")})).update();m=new a.Button(f.parent,{region:"external",name:"english"==f.language?"close":"cerrar",font_size:m.parse("15"),expresion:m.parse("("+f.width/4+","+(f.vSpace+46+35*h)+","+f.width/2+",25)")});m.update();m.btn.addEventListener("click",function(a){f.hide()});f.setPositionAndSize();f.movable.addEventListener("mousedown",function(b){b.preventDefault();f.oldPos=a.getCursorPosition(b,document.body);f.initialPosition={x:f.container.offsetLeft,y:f.container.offsetTop};
document.body.addEventListener("mousemove",d);document.body.addEventListener("mouseup",e)});f.hide()};e.prototype.addCtr=function(a){this.ctrs.push(a)};e.prototype.show=function(){this.setPositionAndSize();this.container.style.display="block"};e.prototype.hide=function(){this.container.style.display="none"};e.prototype.setPositionAndSize=function(){f=this;var a=f.vSpace+46+35*f.numCtr+25+10;f.container.style.left=Math.max(parseInt(window.innerWidth-f.width)/2,0)+"px";f.container.style.top="5px";f.container.style.height=
window.innerHeight<f.vSpace+75?f.vSpace+75+"px":a>window.innerHeight-10?window.innerHeight-10:a+"px"};a.SpaceExternal=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=Math.floor,e=Math.round,d=2*Math.PI,r=a.convertFont("SansSerif,PLAIN,12"),m=a.convertFont("Monospaced,PLAIN,12"),b,h,g,l,q,c,u,k,w,p,v,n,z,x,y,B,E,J,G,H,A,I,C,M,N,O,F,D,K,L,P,R,Q=function(c,d){b=d=a.Space.call(this,c,d)||this;b.ratio=c.ratio;b.canvas=a.newHTML("canvas",{id:b.id+"_canvas",class:"DescartesSpace2DCanvas",width:b.w*b.ratio});b.backCanvas=a.newHTML("canvas",{id:b.id+"_background",width:b.w*b.ratio});b.canvas.style.zIndex=b.zIndex;b.canvas.style.width=
b.backCanvas.style.width=b.w+"px";b.canvas.style.height=b.backCanvas.style.height=b.h+"px";b.ctx=b.canvas.getContext("2d");b.backCtx=b.backCanvas.getContext("2d");b.ctx.imageSmoothingEnabled=b.backCtx.imageSmoothingEnabled=!1;b.graphicControlContainer=a.newHTML("div",{id:b.id+"_graphicControls",style:"position:absolute;left:0;top:0;z-index:"+b.zIndex+";"});b.numericalControlContainer=a.newHTML("div",{id:b.id+"_numericalControls",style:"position:absolute;left:0;top:0;z-index:"+b.zIndex+";"});b.container=
a.newHTML("div",{id:b.id,class:"DescartesSpace2DContainer",style:"left:"+b.x+"px;top:"+b.y+"px;z-index:"+b.zIndex+";"+(0<b.border?"border:"+b.border+"px solid "+b.borderColor.getColor()+";":"")+(b.border_radius?"border-radius:"+b.border_radius+"px;":"")});b.parent.arquimedes&&"#f0f8fa"===b.background.getColor()&&(b.container.style.boxShadow="0 0 5px 0 #b8c4c8");b.container.appendChild(b.backCanvas);b.container.appendChild(b.canvas);b.container.appendChild(b.graphicControlContainer);b.container.appendChild(b.numericalControlContainer);
c.container.insertBefore(b.container,c.loader);var e=b.id+".image";b.parent.images[e]=b.canvas;b.parent.images[e].ready=1;b.parent.images[e].complete=b.parent.images[e].canvas=!0;b.evaluator.setVariable(e,e);e=b.id+".back";b.parent.images[e]=b.backCanvas;b.parent.images[e].ready=1;b.parent.images[e].complete=b.parent.images[e].canvas=!0;b.evaluator.setVariable(e,e);e=""!==b.id&&2!==c.version?b.id+".":"";b.OxStr=e+"Ox";b.OyStr=e+"Oy";b.scaleStr=e+"escala";b.wStr=e+"_w";b.hStr=e+"_h";b.mxStr=e+"mouse_x";
b.myStr=e+"mouse_y";b.mpressedStr=e+"mouse_pressed";b.mclickedStr=e+"mouse_clicked";b.mclickIzqStr=e+"clic_izquierdo";b.click=0;b.resizable&&(b.wModExpr=c.evaluator.parser.parse(b.wModExpr),b.hModExpr=c.evaluator.parser.parse(b.hModExpr));"descartesJS_stage"!==b.id?b.addEvents():b.canvas.oncontextmenu=function(a){return!1};return d};$jscomp.inherits(Q,a.Space);Q.prototype.init=function(){b=this;this.initSpace();b.canvas&&(b.old_w=b.w,b.old_h=b.h,b.canvas.width=b.backCanvas.width=b.w*b.ratio,b.canvas.height=
b.backCanvas.height=b.h*b.ratio,b.canvas.style.width=b.backCanvas.style.width=b.w+"px",b.canvas.style.height=b.backCanvas.style.height=b.h+"px")};Q.prototype.update=function(a){b=this;h=b.evaluator;g=b.parent;if(b.resizable){if(K=b.evaluator.eval(b.wModExpr),L=b.evaluator.eval(b.hModExpr),b.old_w!=K||b.old_h!=L)b.w=K,b.h=L,b.w_2=b.w/2,b.h_2=b.h/2,h.setVariable(b.wStr,b.w),h.setVariable(b.hStr,b.h),b.old_w=b.w,b.old_h=b.h,b.canvas.width=b.backCanvas.width=b.w*b.ratio,b.canvas.height=b.backCanvas.height=
b.h*b.ratio,b.canvas.style.width=b.backCanvas.style.width=b.w+"px",b.canvas.style.height=b.backCanvas.style.height=b.h+"px",a=!0}else h.setVariable(b.wStr,b.w),h.setVariable(b.hStr,b.h);b.drawIfValue=0<h.eval(b.drawif);if(b.drawIfValue){q=b.x!==h.eval(b.xExpr)+b.displaceRegionWest;c=b.y!==h.eval(b.yExpr)+g.plecaHeight+b.displaceRegionNorth;b.spaceChange=a||q||c||b.drawBefore!==b.drawIfValue||b.Ox!==h.getVariable(b.OxStr)||b.Oy!==h.getVariable(b.OyStr)||b.scale!==h.getVariable(b.scaleStr)||b.backColor!==
b.background.getColor();b.x=q?h.eval(b.xExpr)+b.displaceRegionWest:b.x;b.y=c?h.eval(b.yExpr)+g.plecaHeight+b.displaceRegionNorth:b.y;b.Ox=h.getVariable(b.OxStr);b.Oy=h.getVariable(b.OyStr);b.scale=h.getVariable(b.scaleStr);b.drawBefore=b.drawIfValue;b.scale=Math.max(1E-6,Math.min(1E6,b.scale));h.setVariable(b.scaleStr,b.scale);if(q||c)b.container.style.left=b.x+"px",b.container.style.top=b.y+"px";b.container.style.display="block";b.drawTrace=!b.spaceChange&&(!b.fixed&&!b.click||b.fixed);b.spaceChange&&
(b.backCtx.setTransform(b.ratio,0,0,b.ratio,0,0),b.drawBackground());b.ctx.setTransform(b.ratio,0,0,b.ratio,0,0);b.draw()}else b.container.style.display="none"};Q.prototype.drawBackground=function(){b=this;h=b.evaluator;l=b.backCtx;l.clearRect(0,0,b.backCanvas.width,b.backCanvas.height);l.fillStyle=b.backColor=b.background.getColor();l.fillRect(0,0,b.backCanvas.width,b.backCanvas.height);b.image&&""!=b.image.src&&b.image.ready&&b.image.complete&&("topleft"===b.bg_display?l.drawImage(b.image,0,0):
"stretch"===b.bg_display?l.drawImage(b.image,0,0,b.w,b.h):"patch"===b.bg_display?(l.fillStyle=l.createPattern(b.image,"repeat"),l.fillRect(0,0,b.w,b.h)):"imgcenter"===b.bg_display&&l.drawImage(b.image,(b.w-b.image.width)/2,(b.h-b.image.height)/2));k=b.scale;w=0;for(p=0>b.w+b.h?0:b.w+b.h;k>p;)k/=10,w++;for(;k<p/10;)k*=10;l.lineWidth=1;""!==b.net&&(l.strokeStyle=b.net.getColor(),b.drawMarks(l,k/10,-1));if(2!==b.parent.version&&""!==b.net10||2===b.parent.version&&""!==b.net&&""!==b.net10)l.strokeStyle=
b.net10.getColor(),b.drawMarks(l,k,-1);if(""!==b.axes){var a="";"no"==b.x_axis&&(a+="x");"no"==b.y_axis&&(a+="y");l.strokeStyle=b.axes.getColor();l.beginPath();"no"==b.x_axis||""===b.x_axis&&2===b.parent.version||(l.moveTo(0,f(b.h/2+b.Oy)+.5),l.lineTo(b.w,f(b.h/2+b.Oy)+.5));"no"==b.y_axis||""===b.y_axis&&2===b.parent.version||(l.moveTo(f(b.w/2+b.Ox)+.5,0),l.lineTo(f(b.w/2+b.Ox)+.5,b.h));l.lineWidth=1.2;l.stroke();l.lineWidth=1;b.drawMarks(l,k,4,a);b.drawMarks(l,k/2,2,a);b.drawMarks(l,k/10,1,a)}if(""!==
b.x_axis||""!==b.y_axis)l.fillStyle=""!==b.axes?b.axes.getColor():"#000",l.font=r,l.textAlign="right",l.textBaseline="alphabetic","no"!=b.x_axis&&l.fillText(b.x_axis,f(b.w)-2,f(b.h/2+b.Oy)+12),"no"!=b.y_axis&&l.fillText(b.y_axis,f(b.w/2+b.Ox)-2,12);b.numbers&&""!=b.axes&&(l.fillStyle=b.axes.getColor(),l.font=r,l.textAlign="start",l.textBaseline="bottom",k>(b.w+b.h)/2?b.drawNumbers(l,k/5,k<=b.scale?w+1:w):k>(b.w+b.h)/4?b.drawNumbers(l,k/2,k<=b.scale?w+1:w):b.drawNumbers(l,k,w));a=0;for(var c=this.backGraphics.length;a<
c;a++)this.backGraphics[a].draw()};Q.prototype.draw=function(){b=this;l=b.ctx;l.clearRect(0,0,b.canvas.width,b.canvas.height);for(var a=0,c=b.graphics.length;a<c;a++)u=b.graphics[a],""!==u.trace&&b.drawTrace&&u.drawTrace(),u.draw();a=0;for(c=b.graphicsCtr.length;a<c;a++)b.graphicsCtr[a].draw();""!=b.text&&b.click&&"L"===b.whichBtn&&(l.save(),l.strokeStyle=l.fillStyle=b.text.getColor(),l.lineWidth=1,l.font=m,l.textAlign="center",l.textBaseline="alphabetic",A=1>=b.scale?b.mouse_x.toFixed(0):b.mouse_x.toFixed(b.scale.toString().length),
I=1>=b.scale?b.mouse_y.toFixed(0):b.mouse_y.toFixed(b.scale.toString().length),C="("+A+","+I+")",M=f(l.measureText(C).width/2),N=b.getAbsoluteX(b.mouse_x),O=b.getAbsoluteY(b.mouse_y),F=f(N),D=f(O-10),F+M>b.w?F=b.w-M:0>F-M&&(F=M),D+1>b.h?D=b.h:0>D-14&&(D=15),l.fillText(C,F,D),l.beginPath(),l.arc(N,O,2.5,0,d,!0),l.stroke(),l.restore())};Q.prototype.drawMarks=function(a,b,c,d){v=this.w;n=this.h;G=E=0;J=v;H=n;y=f(v/2+this.Ox);B=f(n/2+this.Oy);0<=c&&(E=y-c,J=y+c,G=B-c,H=B+c);a.beginPath();if(!d||d&&!d.match("x"))for(c=
-e(y/b);(z=y+e(c*b))<v;c++)a.moveTo(z+.5,G+.5),a.lineTo(z+.5,H+.5);if(!d||d&&!d.match("y"))for(c=-e(B/b);(x=B+e(c*b))<n;c++)a.moveTo(E+.5,x+.5),a.lineTo(J+.5,x+.5);a.stroke()};Q.prototype.drawNumbers=function(a,b,c){v=this.w;n=this.h;y=f(v/2+this.Ox);B=f(n/2+this.Oy);for(c=-e(y/b);(z=y+e(c*b))<v;c++)a.fillText(parseFloat((c*b/this.scale).toFixed(4)),z+1,B-2);for(c=-e(B/b);(x=B+e(c*b))<n;c++)0!==parseFloat(-c*b/this.scale)&&a.fillText(parseFloat((-c*b/this.scale).toFixed(4)),y+5,x+5)};Q.prototype.addEvents=
function(){function b(a){window.focus();document.activeElement.blur();if(f.evaluator.variables[f.id+".DESCARTESJS_no_fixed"]||!f.fixed||f.sensitive_to_mouse_movements)f.click=0,f.evaluator.setVariable(f.mpressedStr,0),f.evaluator.setVariable(f.mclickedStr,1),f.evaluator.setVariable(f.mclickIzqStr,1),window.removeEventListener("touchmove",g),window.removeEventListener("touchend",b),a.stopPropagation(),a.preventDefault(),f.parent.update()}function c(b){document.activeElement.blur();window.focus();b.stopPropagation();
b.preventDefault();f.click=0;f.evaluator.setVariable(f.mpressedStr,0);f.evaluator.setVariable(f.mclickedStr,1);f.evaluator.setVariable(f.mclickIzqStr,1);"R"===f.whichBtn&&(window.removeEventListener("mousemove",e),f.posZoom==f.posZoomNew&&a.showConfig&&(f.parent.externalSpace.show(),f.posZoom=!1,f.posZoomNew=!0));window.removeEventListener("mousemove",g);window.removeEventListener("mouseup",c);f.parent.deactivateGraphicControls();f.parent.update()}function d(b){f.posAnte=a.getCursorPosition(b,f.container);
f.mouse_x=f.getRelativeX(f.posAnte.x);f.mouse_y=f.getRelativeY(f.posAnte.y);f.evaluator.setVariable(f.mxStr,f.mouse_x);f.evaluator.setVariable(f.myStr,f.mouse_y);f.evaluator.setVariable(f.mclickedStr,0);f.evaluator.setVariable(f.mclickIzqStr,0);f.parent.update()}function e(b){b.preventDefault();f.posZoomNew=a.getCursorPosition(b,f.container).y;f.evaluator.setVariable(f.scaleStr,f.tempScale+f.tempScale/45*((f.posZoom-f.posZoomNew)/10));f.parent.update()}function g(b){b.preventDefault();b.stopPropagation();
f.fixed||(f.posNext=a.getCursorPosition(b,f.container),P=f.posAnte.x-f.posNext.x,R=f.posAnte.y-f.posNext.y,f.evaluator.setVariable(f.OxStr,f.Ox-P),f.evaluator.setVariable(f.OyStr,f.Oy-R));d(b)}var f=this;f.posZoom=f.posZoomNew=null;f.canvas.oncontextmenu=function(a){return!1};this.sensitive_to_mouse_movements&&this.canvas.addEventListener("touchmove",d);this.canvas.addEventListener("touchstart",function(a){window.focus();document.activeElement.blur();if(f.evaluator.variables[f.id+".DESCARTESJS_no_fixed"]||
!f.fixed||f.sensitive_to_mouse_movements)f.parent.clearClick(),f.click=1,f.evaluator.setVariable(f.mpressedStr,1),f.evaluator.setVariable(f.mclickedStr,0),f.evaluator.setVariable(f.mclickIzqStr,0),f.parent.deactivateGraphicControls(),d(a),window.addEventListener("touchmove",g),window.addEventListener("touchend",b),a.stopPropagation(),a.preventDefault()});this.sensitive_to_mouse_movements&&this.canvas.addEventListener("mousemove",d);this.canvas.addEventListener("mousedown",function(b){window.focus();
document.activeElement.blur();b.stopPropagation();b.preventDefault();f.parent.clearClick();f.click=1;f.parent.deactivateGraphicControls();f.whichBtn=a.whichBtn(b);"R"===f.whichBtn?(window.addEventListener("mouseup",c),f.posZoom=a.getCursorPosition(b,f.container).y,f.posZoomNew=f.posZoom,f.fixed||(f.tempScale=f.scale,window.addEventListener("mousemove",e))):"L"===f.whichBtn&&(f.evaluator.setVariable(f.mpressedStr,1),f.evaluator.setVariable(f.mclickedStr,0),f.evaluator.setVariable(f.mclickIzqStr,0),
d(b),window.addEventListener("mousemove",g),window.addEventListener("mouseup",c))});document.addEventListener("visibilitychange",function(a){c(a)})};a.Space2D=Q;return a}(descartesJS||{});
descartesJS=function(a){var f,e,d;function r(b,c){F=a.subtract3D(b,a.scalarProduct3D(c,a.dotProduct3D(b,c)));D=a.add3D(b,a.scalarProduct3D(F,-2));K=a.norm3D(D);return 0!==K?a.scalarProduct3D(D,1/K):a.scalarProduct3D(b,-1)}if(a.loadLib)return a;var m=Math.floor,b=Math.max,h=Math.cos,g=Math.sin,l,q,c,u,k,w,p,v,n,z,x,y,B,E,J,G,H=[],A,I,C,M,N,O,F,D,K,L,P,R=function(b,d){c=d=a.Space.call(this,b,d)||this;c.backCanvas=a.newHTML("canvas",{id:c.id+"_background",width:c.w+"px",height:c.h+"px"});c.canvas=a.newHTML("canvas",
{id:c.id+"_canvas",width:c.w+"px",height:c.h+"px",class:"DescartesSpace3DCanvas",style:"z-index: "+c.zIndex+";"});c.ctx=c.canvas.getContext("2d");c.ctx.imageSmoothingEnabled=!1;var e=c.id+".image";c.parent.images[e]=c.canvas;c.parent.images[e].ready=1;c.parent.images[e].complete=!0;c.parent.images[e].canvas=!0;c.evaluator.setVariable(e,e);c.graphicControlContainer=a.newHTML("div",{id:c.id+"_graphicControls",style:"position:absolute;left:0px;top:0px;z-index:"+c.zIndex+";"});c.numericalControlContainer=
a.newHTML("div",{id:c.id+"_numericalControls",style:"position:absolute;left:0px;top:0px;z-index:"+c.zIndex+";"});c.container=a.newHTML("div",{id:c.id,class:"DescartesSpace3DContainer",style:"left:"+c.x+"px;top:"+c.y+"px;z-index:"+c.zIndex+";"});c.container.appendChild(c.backCanvas);c.container.appendChild(c.canvas);c.container.appendChild(c.graphicControlContainer);c.container.appendChild(c.numericalControlContainer);b.container.insertBefore(c.container,b.loader);c.eye={x:0,y:0,z:0};c.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}];e=0;for(var g=c.lights.length;e<g;e++)c.lights[e]=a.normalize3D(c.lights[e]);c.light3={x:0,y:0,z:0};c.intensity=[.4,.5,.3,0];c.userIntensity=0;c.dim=1;c.tmpIntensity=[];c.OxStr=c.id+".Ox";c.OyStr=c.id+".Oy";c.scaleStr=c.id+".escala";c.wStr=c.id+"._w";c.hStr=c.id+"._h";c.obsStr=c.id+".observador";c.ojoXStr=c.id+".Ojo.x";c.ojoYStr=c.id+".Ojo.y";c.ojoZStr=c.id+".Ojo.z";c.rotZStr=c.id+".rot.z";c.rotYStr=c.id+".rot.y";c.userIDimStr=c.id+".userIlum.dim";
c.userIIStr=c.id+".userIlum.I";c.userIxStr=c.id+".userIlum.x";c.userIyStr=c.id+".userIlum.y";c.userIzStr=c.id+".userIlum.z";c.evaluator.setVariable(c.rotZStr,0);c.evaluator.setVariable(c.rotYStr,0);c.evaluator.setVariable(c.userIDimStr,c.dim);c.evaluator.setVariable(c.userIIStr,c.userIntensity);c.evaluator.setVariable(c.userIxStr,0);c.evaluator.setVariable(c.userIyStr,0);c.evaluator.setVariable(c.userIzStr,0);P=new a.Primitive3D({vertices:[new a.Vector4D(0,0,0,1)],type:"vertex"},c);c.evaluator.setFunction(c.id+
"._X3D2D_",function(a,b,d){P.vertices[0].x=a;P.vertices[0].y=b;P.vertices[0].z=d;P.computeDepth(c);return P.projVert[0].x});c.evaluator.setFunction(c.id+"._Y3D2D_",function(a,b,d){P.vertices[0].x=a;P.vertices[0].y=b;P.vertices[0].z=d;P.computeDepth(c);return P.projVert[0].y});c.resizable&&(c.wModExpr=b.evaluator.parser.parse(c.wModExpr),c.hModExpr=b.evaluator.parser.parse(c.hModExpr));c.ratio=1;c.addEvents();return d};$jscomp.inherits(R,a.Space);R.prototype.init=function(a){c=this;c.initSpace();c.canvas&&
(c.canvas.width=c.backCanvas.width=c.w,c.canvas.height=c.backCanvas.height=c.h,c.canvas.style.width=c.backCanvas.style.width=c.w+"px",c.canvas.style.height=c.backCanvas.style.height=c.h+"px");c.w_2=c.w/2;c.h_2=c.h/2;c.w_plus_h=c.w+c.h;c.oldMouse={x:0,y:0};c.S={x:c.h/1080*-20.6*(40/c.scale),y:0,z:0};c.Ojo={x:3*c.w_2,y:0,z:0};c.evaluator.setVariable(c.ojoXStr,c.Ojo.x);c.evaluator.setVariable(c.ojoYStr,c.Ojo.y);c.evaluator.setVariable(c.ojoZStr,c.Ojo.z)};R.prototype.update=function(a){c=this;l=c.evaluator;
q=c.parent;l.setVariable(c.wStr,c.w);l.setVariable(c.hStr,c.h);c.drawIfValue=0<l.eval(c.drawif);if(c.drawIfValue){c.resizable&&(wModExpr=c.evaluator.eval(c.wModExpr),hModExpr=c.evaluator.eval(c.hModExpr),c.old_w!=wModExpr||c.old_h!=hModExpr)&&(c.w=wModExpr,c.h=hModExpr,c.w_2=c.w/2,c.h_2=c.h/2,l.setVariable(c.wStr,c.w),l.setVariable(c.hStr,c.h),c.old_w=c.w,c.old_h=c.h,c.canvas.width=c.backCanvas.width=c.w*c.ratio,c.canvas.height=c.backCanvas.height=c.h*c.ratio,c.canvas.style.width=c.backCanvas.style.width=
c.w+"px",c.canvas.style.height=c.backCanvas.style.height=c.h+"px",a=!0,c.S={x:c.h/1080*-20.6*(40/c.scale),y:0,z:0},c.Ojo={x:3*c.w_2,y:0,z:0},c.evaluator.setVariable(c.ojoXStr,c.Ojo.x),c.evaluator.setVariable(c.ojoYStr,c.Ojo.y),c.evaluator.setVariable(c.ojoZStr,c.Ojo.z));w=c.x!==l.eval(c.xExpr)+c.displaceRegionWest;p=c.y!==l.eval(c.yExpr)+q.plecaHeight+c.displaceRegionNorth;c.spaceChange=a||w||p||c.drawBefore!==c.drawIfValue||c.Ox!==l.getVariable(c.OxStr)||c.Oy!==l.getVariable(c.OyStr)||c.Ojo.x!==
l.getVariable(c.ojoXStr)||c.Ojo.y!==l.getVariable(c.ojoYStr)||c.Ojo.z!==l.getVariable(c.ojoZStr)||c.scale!==l.getVariable(c.scaleStr);c.x=w?l.eval(c.xExpr)+c.displaceRegionWest:c.x;c.y=p?l.eval(c.yExpr)+q.plecaHeight+c.displaceRegionNorth:c.y;c.Ojo.x=l.getVariable(c.ojoXStr);c.Ojo.y=l.getVariable(c.ojoYStr);c.Ojo.z=l.getVariable(c.ojoZStr);c.Ox=l.getVariable(c.OxStr);c.Oy=l.getVariable(c.OyStr);c.scale=l.getVariable(c.scaleStr);c.drawBefore=c.drawIfValue;if(a||void 0==c.observer){a=0;for(var d=c.parent.controls.length;a<
d;a++)c.parent.controls[a].id===c.obsStr&&(L=!0);c.observer=L?l.getVariable(c.obsStr)||2.5*c.w_plus_h:2.5*c.w_plus_h;c.observer=b(c.observer,.25*c.w_plus_h);l.setVariable(c.obsStr,c.observer)}1E-6>c.scale?(c.scale=1E-6,l.setVariable(c.scaleStr,1E-6)):1E6<c.scale&&(c.scale=1E6,l.setVariable(c.scaleStr,1E6));if(w||p)c.container.style.left=c.x+"px",c.container.style.top=c.y+"px";c.container.style.display="block";c.dim=l.getVariable(c.userIDimStr);c.userIntensity=l.getVariable(c.userIIStr);c.light3={x:parseInt(l.getVariable(c.userIxStr)),
y:parseInt(l.getVariable(c.userIyStr)),z:parseInt(l.getVariable(c.userIzStr))};c.updateCamera();c.draw()}else c.container.style.display="none"};R.prototype.updateCamera=function(){this.eye=a.scalarProduct3D(this.Ojo,1/this.scale)};R.prototype.rotateVertex=function(b){z=a.degToRad(c.evaluator.getVariable(c.rotZStr));x=h(z);y=g(z);f=b.x*x-b.y*y;e=b.x*y+b.y*x;d=b.z;z=a.degToRad(c.evaluator.getVariable(c.rotYStr));x=h(z);y=g(z);return{x:d*y+f*x,y:e,z:d*x-f*y}};R.prototype.project=function(a){c=this;this.evaluator.getVariable("URL.oldProj");
var b=c.eye.x/(a.x-c.eye.x);return{x:c.getAbsoluteX(b*(c.eye.y-a.y)),y:c.getAbsoluteY(b*(c.eye.z-a.z)),z:c.eye.x-a.x}};R.prototype.computeColor=function(b,c,d){b.match("rgba")?b=a.RGBAToHexColor(b):b.match("#")&&(b=new a.Color(b.substring(1)));M=a.subtract3D(this.eye,c.average);N=a.norm3D(M);O=a.scalarProduct3D(M,1/N);this.lights[3]=a.subtract3D(this.light3,c.average);G=a.norm3D(this.lights[3]);for(var e=0,g=this.intensity.length-1;e<g;e++)H[e]=this.intensity[e]*this.dim;H[3]=this.userIntensity*this.userIntensity/
G||0;A=d?this.dim/2:this.dim/4;I=0;C=0>c.direction?c.normal:a.scalarProduct3D(c.normal,-1);e=0;for(g=this.lights.length;e<g;e++)d?(I=Math.max(0,a.dotProduct3D(r(this.lights[e],C),O)),I*=I*I):I=Math.max(0,a.dotProduct3D(this.lights[e],C)),A+=H[e]*I;A=Math.min(A,1);B=m(b.r*A);E=m(b.g*A);J=m(b.b*A);return"rgba("+B+","+E+","+J+","+b.a+")"};R.prototype.draw=function(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);this.ctx.fillStyle=this.background.getColor();this.ctx.fillRect(0,0,this.canvas.width,
this.canvas.height);this.image&&""!=this.image.src&&this.image.ready&&this.image.complete&&("topleft"===this.bg_display?this.ctx.drawImage(this.image,0,0):"stretch"===this.bg_display?this.ctx.drawImage(this.image,0,0,this.w,this.h):"patch"===this.bg_display?(this.ctx.fillStyle=ctx.createPattern(this.image,"repeat"),this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)):"center"===this.bg_display&&this.ctx.drawImage(this.image,(this.w-this.image.width)/2,(this.h-this.image.height)/2));if(!this.click){for(var a=
0,b=this.graphics.length;a<b;a++)this.graphics[a].update();this.primitives=[];if(this.split)for(a=0,b=this.graphics.length;a<b;a++){u=this.graphics[a];for(var c=a+1;c<b;c++)k=this.graphics[c],u.splitFace(k),k.splitFace(u);this.primitives=this.primitives.concat(u.primitives||[])}else for(a=0,b=this.graphics.length;a<b;a++){u=this.graphics[a];if(u.split)for(c=a+1;c<b;c++)k=this.graphics[c],k.split&&u.splitFace(k);this.primitives=this.primitives.concat(u.primitives||[])}}a=0;for(b=this.primitives.length;a<
b;a++)this.primitives[a].computeDepth(this);this.primitives=this.primitives.sort(function(a,b){return b.depth-a.depth});if("painter"===this.render)this.drawPainter(this.primitives);else for(a=0,b=this.primitives.length;a<b;a++)this.primitives[a].draw(this.ctx,this);a=0;for(b=this.graphicsCtr.length;a<b;a++)this.graphicsCtr[a].draw()};R.prototype.drawPainter=function(a){for(var b=a.length,c=0;c<b;c++)a[c].drawn=!1,a[c].draw(this.ctx,this);for(var d=[],e=[],g=0,f=a.length,l=.001,h,k;;){h=f;for(c=0;c<
b;c++)if(!a[c].drawn){k=!0;for(var m=0;m<b;m++)if(m!=c&&!a[m].drawn&&a[c].inFrontOf(d,a[m],l)){k=!1;break}k&&(f--,e[g++]=a[c],a[c].drawn=!0)}if(0==f)break;else if(f==h){if(l*=10,.1<l){for(c=0;c<b;c++)a[c].drawn||(e[g++]=a[c],a[c].drawn=!0);break}}else l=.001}for(c=0;c<b;c++)e[c].draw(this.ctx,this)};R.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}};R.prototype.addEvents=function(){function b(a){window.focus();
document.activeElement.blur();f.click=0;f.evaluator.setVariable(f.id+".mouse_pressed",0);window.removeEventListener("touchmove",g,!1);window.removeEventListener("touchend",b,!1);a.preventDefault();f.parent.update()}function c(b){document.body.focus();f.click=0;f.evaluator.setVariable(f.id+".mouse_pressed",0);b.preventDefault();"R"===f.whichBtn&&(window.removeEventListener("mousemove",e,!1),f.posZoom==f.posZoomNew&&a.showConfig&&f.parent.externalSpace.show());window.removeEventListener("mousemove",
g,!1);window.removeEventListener("mouseup",c,!1);f.parent.update()}function d(b){f.posAnte=a.getCursorPosition(b,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(b){b.preventDefault();f.posZoomNew=a.getCursorPosition(b,f.container).y;f.evaluator.setVariable(f.scaleStr,f.tempScale+f.tempScale/45*((f.posZoom-f.posZoomNew)/10));f.posObserverNew=
a.getCursorPosition(b,f.container).x;f.evaluator.setVariable(f.obsStr,f.tempObserver-2.5*(f.posObserver-f.posObserverNew));f.parent.update()}function g(b){if(!f.fixed&&f.click){v=(f.getAbsoluteX(f.oldMouse.x)-f.getAbsoluteX(f.mouse_x))/4;n=(-f.getAbsoluteY(f.oldMouse.y)+f.getAbsoluteY(f.mouse_y))/4;if(v!==f.disp.x||n!==f.disp.y)f.alpha=a.degToRad(f.evaluator.getVariable(f.rotZStr)),f.beta=a.degToRad(-f.evaluator.getVariable(f.rotYStr)),f.alpha=a.radToDeg(f.alpha)-v,f.beta=a.radToDeg(f.beta)-n,f.evaluator.setVariable(f.rotZStr,
f.alpha),f.evaluator.setVariable(f.rotYStr,-f.beta),f.disp.x=v,f.disp.y=n,f.oldMouse.x=f.getRelativeX(f.posAnte.x),f.oldMouse.y=f.getRelativeY(f.posAnte.y);d(b);b.preventDefault()}}var f=this;this.canvas.oncontextmenu=function(){return!1};this.canvas.addEventListener("touchstart",function(c){window.focus();document.activeElement.blur();f.click=1;f.evaluator.setVariable(f.id+".mouse_pressed",1);f.parent.deactivateGraphicControls();f.posAnte=a.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",b);c.preventDefault()});this.canvas.addEventListener("mousedown",function(b){document.body.focus();f.click=1;f.parent.deactivateGraphicControls();f.whichBtn=a.whichBtn(b);"R"===f.whichBtn?(window.addEventListener("mouseup",c),f.posObserver=a.getCursorPosition(b,f.container).x,f.posObserverNew=f.posObserver,f.posZoom=a.getCursorPosition(b,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=a.getCursorPosition(b,f.container),f.oldMouse.x=f.getRelativeX(f.posAnte.x),f.oldMouse.y=f.getRelativeY(f.posAnte.y),d(b),window.addEventListener("mousemove",g),window.addEventListener("mouseup",c));b.preventDefault()});this.disp={x:0,y:0}};a.Space3D=R;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f,e,d,r,m,b,h=function(b,d){var e=a.Space.call(this,b,d)||this;f=e.parent.evaluator;void 0!=e._w_&&(b=f.parser.parse(e._w_),e._w_="number"!=b.type?b:void 0);void 0!=e._h_&&(b=f.parser.parse(e._h_),e._h_="number"!=b.type?b:void 0);e.isFirefox=/firefox/i.test(window.navigator.userAgent);e.file=e.file?e.file.trim():"";e.file.match(/^\[/)&&e.file.match(/\]$/)?e.file=f.parser.parse(e.file.substring(1,e.file.length-1)):e.file.match(/^'/)&&e.file.match(/'$/)?
e.file=f.parser.parse(e.file):e.file=f.parser.parse("'"+e.file+"'");e.oldFile=f.eval(e.file);e.MyIFrame=a.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=a.newHTML("div",{id:e.id,style:(a.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(b){var c=this;e.evaluator.setFunction(e.id+".set",function(a,b){c.contentWindow.postMessage({type:"set",name:a,value:b},"*");return 0});e.evaluator.setFunction(e.id+".update",function(){c.contentWindow.postMessage({type:"update"},"*");return 0});
e.evaluator.setFunction(e.id+".exec",function(a,b){c.contentWindow.postMessage({type:"exec",name:a,value:b},"*");return 0});e.evaluator.setFunction(e.id+".changeConf",function(b){if(b){if(a.cacheFiles[b])var d=a.cacheFiles[b];else d=(d=document.getElementById(b))&&"descartes/embed"===d.type?d.textContent:a.openExternalFile(b),d=(d=(new DOMParser).parseFromString(d,"text/html").querySelector("ajs"))?d.innerHTML:"",a.cacheFiles[b]=d;c.contentWindow.postMessage({type:"change_config",filename:b,content:d},
"*")}return 0});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.drawIfValue?"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(h,a.Space);h.prototype.init=function(){m=this;m.initSpace();m.MyIFrame&&Object.assign(m.MyIFrame.style,{width:m.w+"px",
height:m.h+"px"})};h.prototype.iframeUpdate=function(a){f=this.evaluator;this.drawIfValue=0<f.eval(this.drawif);this.ImReady?this.container.style.display=this.drawIfValue?"block":"none":(this.container.style.visibility=this.drawIfValue?"visible":"hidden",this.container.style.opacity=this.drawIfValue?"1":"0",this.container.style.zIndex=this.drawIfValue?this.zIndex:-1E3);if(this.drawIfValue){a&&(this.x=this.y=Infinity);e=this.x!==f.eval(this.xExpr)+this.displaceRegionWest;d=this.y!==f.eval(this.yExpr)+
this.parent.plecaHeight+this.displaceRegionNorth;this.x=e?f.eval(this.xExpr)+this.displaceRegionWest:this.x;this.y=d?f.eval(this.yExpr)+this.parent.plecaHeight+this.displaceRegionNorth:this.y;void 0!=this._w_&&(a=f.eval(this._w_),this.w!==a&&(this.container.style.width=this.MyIFrame.style.width=a+"px",this.w=a));void 0!=this._h_&&(a=f.eval(this._h_),this.h!==a&&(this.container.style.height=this.MyIFrame.style.height=a+"px",this.h=a));if(e||d)this.container.style.left=this.x+"px",this.container.style.top=
this.y+"px";r=f.eval(this.file);r!==this.oldFile&&(this.ImReady=!1,this.isFirefox||(this.container.style.display="block",this.container.style.visibility=this.drawIfValue?"visible":"hidden",this.container.style.opacity=this.drawIfValue?"1":"0",this.container.style.zIndex=this.drawIfValue?this.zIndex:-1E3),this.imageSrc&&(this.container.style.backgroundImage="url("+this.imageSrc+")"),this.MyIFrame.style.visibility="hidden",this.oldFile=r,this.MyIFrame.contentWindow.location.replace(r));b=f.getVariable(this.id+
"._scroll");1==b?(this.MyIFrame.setAttribute("scrolling","yes"),this.MyIFrame.style.overflow=""):-1==b?(this.MyIFrame.setAttribute("scrolling","no"),this.MyIFrame.style.overflow="hidden"):(this.MyIFrame.setAttribute("scrolling","auto"),this.MyIFrame.style.overflow="")}else this.MyIFrame.contentWindow.blur()};a.SpaceHTMLIFrame=h;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var f=1,e=function(d){this.children=d.children;this.lessonParser=d.lessonParser;this.images=d.images;this.images.length=d.images.length;this.audios=d.audios;this.audios.length=d.audios.length;this.descartesApp=d;this.imgLoader=a.newHTML("div",{class:"DescartesLoaderImage"});this.progress=a.newHTML("progress",{class:"PBL",value:0,max:100});d.imgLoader?(d.loader.style.backgroundColor="rgba(0,0,0,0)",this.imgLoader.setAttribute("style","background-image:url("+
d.imgLoader+");background-size:contain;")):(f=d.width<d.height?d.width/1144:d.height/1092,f=2.5<f?2.5:f,this.imgLoader.setAttribute("style","background-image:url("+a.loaderImg.src+");background-position:50% 33.5%;background-size:"+880*f+"px;"),this.progress.setAttribute("style","visibility:visible; left:"+(d.width-726*f)/2+"px; top:"+(33.5*d.height/100+940*f/2)+"px; width:"+726*f+"px; height:"+14*f+"px;"));d.loader.appendChild(this.imgLoader);d.loader.appendChild(this.progress);d.firstRun=!1;this.initPreloader()};
e.prototype.initPreloader=function(){var d=this,e=d.children,f=d.images,b=d.audios,h=/[\w\.\-//]*(\.png|\.jpg|\.gif|\.svg)/gi,g=/[\w\.\-//]*(\.ogg|\.oga|\.mp3|\.wav)/gi;f["lib/DescartesCCLicense.png"]=a.getCCLImg();f["lib/DescartesCCLicense.png"].ready=1;var l,q;var c=0;for(l=e.length;c<l;c++)if("rtf"!==e[c].name){if(e[c].value.match(/'macro'|'makro'/g)){var u="";var k=d.lessonParser.split(e[c].value);var w=0;for(q=k.length;w<q;w++)"expresion"===babel[k[w][0]]&&(u=k[w][1]);if(u)var p=(p=document.getElementById(u))&&
"descartes/macro"==p.type?p.text:a.openExternalFile(u);if(p&&(k=p.match(h)))for(u=0,q=k.length;u<q;u++)w=k[u],w.toLowerCase().match(/vacio.gif$/)||""==w.substring(0,w.length-4)||(f[w]=new Image,f[w].addEventListener("load",function(){this.ready=1}),f[w].addEventListener("error",function(){this.errorload=1}),f[w].src=w)}if(k=e[c].value.match(h))for(u=0,q=k.length;u<q;u++)w=k[u],w.toLowerCase().match(/vacio.gif$/)||""==w.substring(0,w.length-4)||(f[w]=new Image,f[w].addEventListener("load",function(){this.ready=
1}),f[w].addEventListener("error",function(){this.errorload=1}),f[w].src=w);if(k=e[c].value.match(g))for(u=0,w=k.length;u<w;u++)d.initAudio(k[u])}for(var v in f)f.hasOwnProperty(v)&&d.images.length++;for(v in b)b.hasOwnProperty(v)&&d.audios.length++;var n=d.images.length+d.audios.length;0<n&&d.progress.setAttribute("max",n);var z,x=function(){z=0;for(var c in f)f.hasOwnProperty(c)&&(f[c].ready||f[c].errorload)&&z++;for(c in b)b.hasOwnProperty(c)&&(b[c].ready||b[c].errorload)&&z++;d.progress.setAttribute("value",
z);z!=n?d.timer=a.setTimeout(x,1):d.descartesApp.initBuildApp()};x()};e.prototype.initAudio=function(d){var e=this.audios;e[d]=new Audio(d);e[d].filename=d;var f=function(){this.ready=1},b=function(){this.canPlayType("audio/"+this.filename.substring(this.filename.length-3))||"mp3"!=this.filename.substring(this.filename.length-3)?(console.warn("El archivo '"+d+"' no puede ser reproducido"),this.errorload=1):(e[d]=new Audio(this.filename.replace("mp3","ogg")),e[d].filename=this.filename.replace("mp3",
"ogg"),e[d].addEventListener("canplaythrough",f),e[d].addEventListener("load",f),e[d].addEventListener("error",b),e[d].load())};e[d].addEventListener("canplaythrough",f);e[d].addEventListener("load",f);e[d].addEventListener("error",b);a.hasTouchSupport?(e[d].load(),e[d].play(),a.setTimeout(function(){e[d].pause()},20),e[d].ready=1):e[d].load()};a.DescartesLoader=e;return a}(descartesJS||{});
descartesJS=function(a){function f(a){for(var b="[",e=0,c=a.length;e<c;e++)Array.isArray(a[e])?b+=f(a[e]):(d=a[e]||0,"string"==typeof d&&(d="'"+d+"'"),b+=d),e<c-1&&(b+=",");return b+"]"}function e(){r=window.innerWidth/this.width;m=window.innerHeight/this.height;a.cssScale=b=Math.min(r,m);this.container.style.transformOrigin="0 0";r<m?(this.container.style.left="0",this.container.style.transform="translate3d(0px, 0px, 0px) scale("+b+")"):(this.container.style.left="50%",this.container.style.transform=
"translate3d(0px, 0px, 0px) scale("+b+") translate(-50%, 0)")}if(a.loadLib)return a;var d,r,m,b,h=function(b){this.animation={playing:!1,play:function(){},stop:function(){},reinit:function(){}};this.ratio=a._ratio;this.applet=b;this.parentC=b.parentNode;this.width=parseFloat(b.getAttribute("width"));this.height=parseFloat(b.getAttribute("height"));this.decimal_symbol=".";this.decimal_symbol_regexp=/\./g;this.language="espa\u00f1ol";this.children=b.getElementsByTagName("param");a.ccLicense=!0;for(var d=
0,e=this.children.length;d<e;d++)"CreativeCommonsLicense"===this.children[d].name&&(a.ccLicense="no"!==this.children[d].value);this.code=b.getAttribute("code");this.saveState=[];this.images={length:-1};this.audios={length:-1};this.firstRun=!0;this.scaleToFit=function(){};this.init()};h.prototype.init=function(){this.stop();this.evaluator=new a.Evaluator(this);this.getURLParameters();this.lessonParser=new a.LessonParser(this);this.arquimedes=/DescartesWeb2_0|Arquimedes|Discurso/i.test(this.code);this.licenseA=
a.ccLicense?"{\\rtf1\\uc0{\\fonttbl\\f0\\fcharset0 Arial;}{\\f0\\fs34 __________________________________________________________________________________\\par \\fs22                                        Los contenidos de esta unidad did\u00e1ctica interactiva est\u00e1n bajo una licencia {\\*\\hyperlink Creative Commons|https://creativecommons.org/licenses/by-nc-sa/4.0/deed.es}, si no se indica lo contrario.\\par                                        La unidad did\u00e1ctica fue creada con Descartes, que es un producto de c\u00f3digo abierto, {\\*\\hyperlink Creditos|http://arquimedes.matem.unam.mx/Descartes5/creditos/conCCL.html}\\par }":
"";for(var b=this.children,d,f=0,c=0,h=a.ccLicense?90:0,k=0,m=b.length;k<m;k++)d=b[k],"rtf_height"==d.name&&(f=parseInt(d.value)+120||this.height),"Buttons"==babel[d.name]&&(this.buttonsConfig=this.lessonParser.parseButtonsConfig(d.value),c=this.buttonsConfig.height),"image_loader"==d.name&&(this.imgLoader=d.value),"expand"==d.name&&(this.expand=d.value),"docBase"==d.name&&(this.docBase=d.value,d=a.newHTML("base",{id:"descartesJS_base",href:this.docBase}),document.head.appendChild(d));"cover"==this.expand&&
(this.width=window.innerWidth,this.height=window.innerHeight);this.arquimedes&&(this.ratio=1,f&&(this.height=f+c+h));this.externalSpace&&document.body.removeChild(this.externalSpace.container);this.externalSpace=new a.SpaceExternal(this);this.northSpace={container:a.newHTML("div"),controls:[]};this.southSpace={container:a.newHTML("div"),controls:[]};this.eastSpace={container:a.newHTML("div"),controls:[]};this.westSpace={container:a.newHTML("div"),controls:[]};this.editableRegion={container:a.newHTML("div"),
textFields:[]};this.controls=[];this.auxiliaries=[];this.events=[];this.nIframes=this.plecaHeight=this.tabindex=this.zIndex=0;void 0!=this.container&&(this.cleanCanvasImages(),this.parentC.removeChild(this.container),delete this.container,delete this.loader);this.container=a.newHTML("div");this.loader=a.newHTML("div",{class:"DescartesLoader"});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&&(this.container.parentNode.removeAttribute("align"),this.container.parentNode.style.overflow="hidden",this.container.parentNode.style.width="100vw",this.container.parentNode.style.height="100vh",this.scaleToFit=e,this.scaleToFit());this.spaces=[];this.firstRun?(this.loader.style.display="block",
new a.DescartesLoader(this)):this.initBuildApp()};h.prototype.initBuildApp=function(){a.showConfig=!0;for(var b=this.children,d,e=this.lessonParser,c=[],f=[],h=[],m=[],p=[],r=[],n=0,z=b.length;n<z;n++)if(d=b[n],"editable"==babel[d.name])a.showConfig="false"==babel[d.value]?!1:!0;else if("language"==babel[d.name])this.language=d.value;else if("pleca"==d.name)d=e.parsePleca(d.value,this.width),this.container.insertBefore(d,this.loader),this.plecaHeight=d.imageHeight?d.imageHeight:d.offsetHeight;else if("Buttons"==
babel[d.name])this.buttonsConfig=e.parseButtonsConfig(d.value);else if("decimal_symbol"==babel[d.name])this.decimal_symbol=d.value,this.decimal_symbol_regexp=new RegExp("\\"+this.decimal_symbol,"g");else if("version"==babel[d.name])this.version=parseInt(d.value);else if("language"==babel[d.name])this.language=d.value;else if("rtf"==d.name){var x=(this.width-780)/2,y=parseInt(this.height)-this.plecaHeight-this.buttonsConfig.height-45;m.push("space='descartesJS_stage' type='text' abs_coord='yes' expresion='[10,20]' background='yes' text='"+
d.value.replace(/'/g,"&squot;")+"'");m.push("space='descartesJS_stage' type='text' abs_coord='yes' expresion='["+x+","+(y-25)+"]' background='yes' text='"+this.licenseA+"'");a.ccLicense&&m.push("space='descartesJS_stage' type='image' expresion='["+(x+15)+","+y+"]' background='yes' abs_coord='yes' file='lib/DescartesCCLicense.png'")}else"E"==d.name.charAt(0)?(d.value.match(/'HTMLIFrame'/)&&this.nIframes++,c.push(d.value)):/^C_/.test(d.name)?f.push(d.value):/^A_/.test(d.name)?h.push(d.value):/^G_/.test(d.name)?
(d.value.match(/type='fill'|tipo='relleno'|tipus='ple'|mota='betea'|type='plein'|tipo='recheo'|tipo='curva_piena'|tipo='preencher'|tipus='ple'/)&&(this.ratio=1),m.push(d.value)):/^S_/.test(d.name)?p.push(d.value):"Animation"==babel[d.name]&&r.push(d.value);this.arquimedes&&(this.stage={container:a.newHTML("div",{id:"descartesJS_Stage"}),scroll:0},this.stage.stageSpace=this.lessonParser.parseSpace("tipo='R2' id='descartesJS_stage' fondo='"+(a.TextController?"ffffffff":"blanco")+"' x='0' y='0' fijo='yes' red='no' red10='no' ejes='no' text='no' ancho='"+
this.width+"' alto='"+this.height+"'"),this.stage.container.appendChild(this.stage.stageSpace.container),this.container.appendChild(this.stage.container),this.spaces.push(this.stage.stageSpace));n=0;for(z=c.length;n<z;n++)b=e.parseSpace(c[n]),this.arquimedes&&this.stage.container.appendChild(b.container),this.spaces.push(b),this.zIndex++;n=0;for(z=m.length;n<z;n++)if(a.DEBUG.elemIndex=n,c=e.parseGraphic(m[n]))this.editableRegionVisible=this.editableRegionVisible||c.visible,c.space.addGraph(c);n=0;
for(z=p.length;n<z;n++)(c=e.parse3DGraphic(p[n]))&&c.space.addGraph(c,!0);n=0;for(z=f.length;n<z;n++)this.controls.push(e.parseControl(f[n]));n=0;for(z=h.length;n<z;n++)e.parseAuxiliar(h[n]);n=0;for(z=r.length;n<z;n++)this.animation=e.parseAnimation(r[n]);this.configRegions();this.updateAuxiliaries();this.updateAuxiliaries();n=0;for(z=this.controls.length;n<z;n++)this.controls[n].init();this.updateControls();this.updateSpaces(!0);var B=this;this.nIframes?a.setTimeout(function(){B.finishInit()},200*
this.nIframes):this.finishInit()};h.prototype.finishInit=function(){this.evaluator.setVariable("decimalSymbol",this.decimal_symbol);this.update();this.loader.style.display="none";window.parent!==window&&(this.parentC.style.margin=this.parentC.style.padding="0px","fit"==this.expand&&window.addEventListener("touchmove",function(a){a.preventDefault();a.stopPropagation()}),window.parent.postMessage({type:"reportSize",href:window.location.href,width:this.width,height:this.height},"*"),window.parent.postMessage({type:"ready",
value:window.location.href},"*"),a.onResize());window.opener&&window.opener.postMessage({type:"isResizeNeeded",href:window.location.href},"*");this.externalSpace.init();try{var b=new CustomEvent("descartesReady",{detail:this});window.dispatchEvent(b)}catch(l){console.warn("CustomEvents not supported in this browser")}this.readyApp=!0};h.prototype.adjustSize=function(){document.body.style.margin=document.body.style.padding=this.parentC.style.margin=this.parentC.style.padding="0px";var b=parseInt(this.width)+
30,d=parseInt(this.height)+90;window.moveTo((parseInt(screen.width)-b)/2,(parseInt(screen.height)-d)/2);window.resizeTo(b,d);a.onResize()};h.prototype.configRegions=function(){var b=this.evaluator.parser,d=this.buttonsConfig||{},e=this.container,c="15",f=100,h=100,m=100,p=100;2==this.version&&(c="14",f=63,h=50,m=44,p=53);var r=0,n=0,z=0,x=0,y=this.northSpace.controls,B=this.southSpace.controls,E=this.eastSpace.controls,J=this.westSpace.controls;if(0<d.rowsNorth||0<y.length||d.about||d.config){0>=
d.rowsNorth?(r=d.height,d.rowsNorth=1):r=d.height*d.rowsNorth;var G=this.northSpace.container;G.id="descartesJS_north";G.setAttribute("style","width:"+e.width+"px;height:"+r+"px;left:0;top:"+this.plecaHeight+"px;");e.insertBefore(G,this.loader);G=e.width;var H=0;d.about?(H=f,G-=H):f=0;d.config&&(G-=h);var A=Math.ceil(y.length/d.rowsNorth),I=G/A;var C=0;for(var M=y.length;C<M;C++)y[C].expresion=b.parse("("+(H+C%A*I)+","+d.height*Math.floor(C/A)+","+I+","+d.height+")"),y[C].drawif=b.parse("1"),y[C].init();
d.about&&(C=new a.Button(this,{region:"north",name:"english"==this.language?"about":"cr\u00e9ditos",font_size:b.parse(c),expresion:b.parse("(0, 0, "+f+", "+r+")")}),C.actionExec={execute:a.showAbout},C.update());d.config&&(new a.Button(this,{region:"north",name:"config",font_size:b.parse(c),action:"config",expresion:b.parse("("+(G+f)+", 0, "+h+", "+r+")")})).update()}if(0<d.rowsSouth||0<B.length||d.init||d.clear){0>=d.rowsSouth?(n=d.height,d.rowsSouth=1):n=d.height*d.rowsSouth;f=e.width;H=0;d.init?
(H=m,f-=H):m=0;d.clear&&(f-=p);G=this.southSpace.container;G.id="descartesJS_south";G.setAttribute("style","width:"+e.width+"px;height:"+n+"px;left:0;bottom:0;");e.insertBefore(G,this.loader);A=Math.ceil(B.length/d.rowsSouth);I=f/A;C=0;for(M=B.length;C<M;C++)B[C].expresion=b.parse("("+(H+C%A*I)+","+d.height*Math.floor(C/A)+","+I+","+d.height+")"),B[C].drawif=b.parse("1"),B[C].init();d.init&&(new a.Button(this,{region:"south",name:"english"==this.language?"init":"inicio",font_size:b.parse(c),action:"init",
expresion:b.parse("(0, 0, "+m+", "+n+")")})).update();d.clear&&(new a.Button(this,{region:"south",name:"english"==this.language?"clear":"limpiar",font_size:b.parse(c),action:"clear",expresion:b.parse("("+(f+m)+", 0, "+p+", "+n+")")})).update()}if(0<E.length)for(C=e.height-r-n,z=d.widthEast,G=this.eastSpace.container,G.id="descartesJS_east",G.setAttribute("style","width:"+z+"px;height:"+C+"px;right:0;top:"+r+"px;"),e.insertBefore(G,this.loader),C=0,M=E.length;C<M;C++)E[C].expresion=b.parse("(0,"+d.height*
C+","+z+","+d.height+")"),E[C].drawif=b.parse("1"),E[C].init();if(0<J.length)for(C=e.height-r-n,x=d.widthWest,G=this.westSpace.container,G.id="descartesJS_west",G.setAttribute("style","width: "+x+"px;height:"+C+"px;left:0;top:"+r+"px;"),e.insertBefore(G,this.loader),C=0,M=J.length;C<M;C++)J[C].expresion=b.parse("(0,"+d.height*C+","+x+","+d.height+")"),J[C].drawif=b.parse("1"),J[C].init();if(this.editableRegionVisible)for(b=d.height,G=this.editableRegion.container,G.id="descartesJS_editableRegion",
G.setAttribute("style","width:"+e.width+"px;height:"+b+"px;left:0;top:"+(e.height-n-d.height)+"px;"),e.insertBefore(G,this.loader),d=this.editableRegion.textFields,e=e.width/d.length,J=a.getFieldFontSize(b),C=0,M=d.length;C<M;C++)"div"==d[C].type?(G.appendChild(d[C].container),d[C].container.setAttribute("style","font-family:"+a.sansserif_font+";width:"+(e-4)+"px;height:"+b+"px;position:absolute;left:"+C*e+"px;top:0;"),E=d[C].container.firstChild,E.setAttribute("style","font-family:"+a.sansserif_font+
";font-size:"+J+"px;padding-top:0;background-color:#e0e4e8;position:absolute;left:0;top:0;height:"+b+"px;text-align:center;line-height:"+b+"px;"),c=E.offsetWidth,E.style.width=c+"px",E.firstChild.textContent=E.firstChild.textContent.substring(3,E.firstChild.textContent.length-3),d[C].container.lastChild.setAttribute("style","font-family:"+a.monospace_font+";font-size:"+J+"px;width:"+(e-c)+"px;height:"+b+"px;position:absolute;left:"+c+"px;top:0;border:2px groove white;")):(G.appendChild(d[C]),d[C].setAttribute("style",
"font-family:"+a.monospace_font+";font-size:"+J+"px;width:"+e+"px;height:"+b+"px;position:absolute;left:"+C*e+"px;top:0;border:2px groove white;"));this.displaceRegionNorth=r;this.displaceRegionSouth=n;this.displaceRegionEast=z;this.displaceRegionWest=x;C=0;for(M=this.spaces.length;C<M;C++)this.spaces[C].init()};h.prototype.update=function(){this.updateAuxiliaries();this.updateControls();this.updateEvents();this.updateControls();this.updateSpaces()};h.prototype.clearClick=function(){for(var a=0,b=
this.spaces.length;a<b;a++)this.spaces[a].clearClick()};h.prototype.removeButtonClick=function(){a.newBlobContent=null;for(var b=0,d=this.controls.length;b<d;b++)this.controls[b].buttonClick=!1};h.prototype.deactivateGraphicControls=function(){for(var a,b=0,d=this.controls.length;b<d;b++)a=this.controls[b],"GraphicControl"==a.type&&a.deactivate()};h.prototype.updateAuxiliaries=function(){for(var a=0,b=this.auxiliaries.length;a<b;a++)this.auxiliaries[a].update()};h.prototype.updateEvents=function(){for(var a=
0,b=this.events.length;a<b;a++)this.events[a].update()};h.prototype.updateControls=function(){for(var a=0,b=this.controls.length;a<b;a++)this.controls[a].update()};h.prototype.updateSpaces=function(a){for(var b=0,d=this.spaces.length;b<d;b++)this.spaces[b].update(a)};h.prototype.clear=function(){for(var a=0,b=this.spaces.length;a<b;a++)this.spaces[a].spaceChange=!0,this.spaces[a].drawBackground&&this.spaces[a].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){var b=this.images;return a?(b[a]||(b[a]=new Image,b[a].addEventListener("load",function(){this.ready=1}),b[a].addEventListener("error",function(){this.ready=0;this.errorload=1}),b[a].src=a),b[a]):new Image};h.prototype.getAudio=
function(b){var d=this.audios;if(b){if(!d[b]){b.lastIndexOf(".");d[b]=new Audio(b);var e=function(a){this.ready=1};d[b].addEventListener("canplaythrough",e);var c=function(a){this.canPlayType("audio/"+b.substring(b.length-3))||"mp3"!=b.substring(b.length-3)?(console.warn("El archivo '"+b+"' no puede ser reproducido"),this.errorload=1):(d[b]=new Audio(b.replace("mp3","ogg")),d[b].addEventListener("canplaythrough",e),d[b].addEventListener("load",e),d[b].addEventListener("error",c),d[b].load())};d[b].addEventListener("error",
c);d[b].play();a.setTimeout(function(){d[b].pause()},15)}return d[b]}return new Audio};h.prototype.getControlByCId=function(a){return this.getControlById(a,!0)};h.prototype.getControlById=function(a,b){b=b?"cID":"id";for(var d,c=0,e=this.controls.length;c<e;c++)if(d=this.controls[c],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 d,c=0,e=this.spaces.length;c<e;c++)if(d=
this.spaces[c],d[b]==a)return d;return{update:function(){},w:0,h:0}};h.prototype.getURLParameters=function(){var a=window.location.href,b=a.indexOf("?");if(-1!=b){a=decodeURIComponent(a.substring(b+1)).split("&");for(var d=0,c=a.length;d<c;d++)b=a[d].split("="),2==b.length&&(+b[1]==+b[1]&&(b[1]=parseFloat(b[1])),this.evaluator.setVariable("URL."+b[0],b[1]))}};h.prototype.getState=function(){var a="",b=this.evaluator.variables,d;for(d in b)if(b.hasOwnProperty(d)){var c=b[d];"string"==typeof c&&(c=
"'"+c+"'");void 0!=c&&"rnd"!=d&&"\u03c0"!=d&&"pi"!=d&&"e"!=d&&"Infinity"!=d&&"-Infinity"!=d&&"object"!=typeof c&&(a=""!=a?a+"\n"+d+"="+c:d+"="+c)}c=this.evaluator.vectors;for(var e in c)c.hasOwnProperty(e)&&(a+="\n"+e+"="+f(c[e]));e=this.evaluator.matrices;for(var h in e)e.hasOwnProperty(h)&&(a+="\n"+h+"="+f(e[h]));return a};h.prototype.setState=function(a,b){a=a.split("\n");for(var d,c,e=0,f=a.length;e<f;e++)d=a[e].split("="),2<=d.length&&(c=eval(d[1]),-1!=d[1].indexOf("[[")?(this.evaluator.matrices[d[0]]=
c,this.evaluator.matrices[d[0]].rows=c.length,this.evaluator.matrices[d[0]].cols=c[0].length):-1!=d[1].indexOf("[")?(this.evaluator.vectors[d[0]]=c,this.evaluator.variables[d[0]+".long"]=c.length):this.evaluator.variables[d[0]]=c);b||this.update()};h.prototype.getEvaluation=function(){for(var a=correct=0,b="",d=0,c=this.controls.length;d<c;d++)"textfield"==this.controls[d].gui&&this.controls[d].evaluate&&(a++,correct+=this.controls[d].ok,this.controls[d].value=""==this.controls[d].value?"''":this.controls[d].value,
b+=" \\n "+this.controls[d].id+"="+this.controls[d].value+"|"+this.controls[d].ok);return"questions="+a+" \\n correct="+correct+" \\n wrong="+(a-correct)+b};h.prototype.showSolution=function(){for(var a=this.controls,b=0,d=a.length;b<d;b++)"textfield"==a[b].gui&&a[b].evaluate&&a[b].changeValue(a[b].getFirstAnswer());this.update()};h.prototype.showAnswer=function(){for(var a=0,b=this.saveState.length;a<b;a++)this.evaluator.eval(this.saveState[a]);this.update()};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]};a.DescartesApp=h;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;a.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(f,e){f="Error: "+f+" en\u300a "+e+" \u300b";var d="";switch(a.DEBUG.objectName){case "Auxiliar":e="event"===a.DEBUG.typeName||"algorithm"===a.DEBUG.typeName||
"constant"===a.DEBUG.typeName?"En el programa ":"En la definici\u00f3n ";if("doExpr"==babel[a.DEBUG.paramName]||"init"==babel[a.DEBUG.paramName])d=" en la l\u00ednea "+(a.DEBUG.lineCount+1);f+=e+"\u300c"+a.DEBUG.idName+"\u300d, en el param\u00e9tro \u300c"+a.DEBUG.paramName+"\u300d"+d+".";break;case "Graphic":f+="En el gr\u00e1fico #"+(a.DEBUG.elemIndex+1)+" de tipo \u300c"+a.DEBUG.idName+"\u300d, en el param\u00e9tro \u300c"+a.DEBUG.paramName+"\u300d."}console.info(f)}};return a}(descartesJS||{});
descartesJS=function(a){function f(){e().forEach(function(b){a.apps.push(new a.DescartesApp(b));b.className="DescartesJS"})}function e(){return[].concat($jscomp.arrayFromIterable(document.querySelectorAll("applet,ajs"))).filter(function(a){return/Descartes|DescartesJS|descinst.DescartesWeb2_0.class|Arquimedes|Discurso/i.test(a.getAttribute("code"))})}function d(){document.querySelectorAll(".DescartesAppContainer").forEach(function(a){a.remove()})}function r(b){b=a.newHTML("div");var e='<div style="font-size:12px;visibility:hidden;">';
"descartesJS_serif descartesJS_sansserif descartesJS_monospace DJS_symbola DJS_extra DJS_sansserif DJS_serif DJS_monospace".split(" ").forEach(function(a){e+='<div style="font-family:'+a+';"><span>_</span><span style="font-weight:bold;">_</span><span style="font-style:italic;">_</span><span style="font-weight:bold;font-style:italic;">_</span></div>'});b.innerHTML=e+"</div>";document.body.appendChild(b);a.getFeatures();a.hasCanvas?(window.scrollTo(0,10),d(),f(),window.addEventListener("resize",a.onResize),
window.scrollTo(0,0)):document.getElementById("StyleDescartesApps").innerHTML="applet.DescartesJS,applet,ajs.DescartesJS,ajs{display:block;}";b.remove()}if(a.loadLib)return a;a.apps=[];a.getDescartesApps=function(){return a.apps};(function(){var b=document.getElementById("StyleDescartesApps");b&&b.remove();b=a.newHTML("style",{id:"StyleDescartesApps",type:"text/css",rel:"stylesheet"});b.innerHTML="applet.DescartesJS,applet,ajs.DescartesJS,ajs{display:none;}";document.head.appendChild(b)})();a.onResize=
function(b){0<a.apps.length&&a.apps[0].scaleToFit()};var m=Object.create(null);a.onMessage=function(b){if(0<a.apps.length){var d=b.data;if(d)if("set"===d.type)"string"==typeof d.value||"number"==typeof d.value?a.apps[0].evaluator.setVariable(d.name,d.value):d.value&&void 0!=d.value.rows?a.apps[0].evaluator.matrices[d.name]=d.value:a.apps[0].evaluator.vectors[d.name]=d.value;else if("update"===d.type)a.apps[0].update();else if("exec"===d.type)(b=a.apps[0].evaluator.getFunction(d.name))&&b.apply(a.apps[0].evaluator,
d.value.toString().split(","));else if("isResizeNeeded"===d.type)b.source.postMessage({type:"doResize"},"*");else if("doResize"===d.type)0<a.apps.length&&a.apps[0].adjustSize();else if("change_config"===d.type){m[d.filename]?b=m[d.filename]:(b=a.newHTML("div"),b.innerHTML=d.content,b=b.getElementsByTagName("param"),m[d.filename]=b);var e=document.querySelector("base");e||(e=a.newHTML("base"),document.body.appendChild(e));e.setAttribute("href",d.filename);a.apps[0].children=b;a.apps[0].init()}}};void 0==
a.loadLib&&(a.loadLib=!0,window.addEventListener("load",r),window.addEventListener("message",a.onMessage),["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd"].forEach(function(b){window.addEventListener(b,function(b){a.onResize(b)})}),document.fonts.ready.then(function(){setTimeout(function(){a.apps.forEach(function(a){a.updateControls();a.updateSpaces(!0)})},500)}));return a}(descartesJS||{});
