/*
 Joel Espinosa Longi
 jlongi@im.unam.mx
 https://github.com/jlongi/DescartesJS
 LGPL - http://www.gnu.org/licenses/lgpl.html
 2020-01-15
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var e=0;return function(){return e<a.length?{done:!1,value:a[e++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var e="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return e?e.call(a):$jscomp.arrayIterator(a)};$jscomp.arrayFromIterator=function(a){for(var e,f=[];!(e=a.next()).done;)f.push(e.value);return f};
$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 e=function(){};e.prototype=a;return new e};$jscomp.underscoreProtoCanBeSet=function(){var a={a:!0},e={};try{return e.__proto__=a,e.a}catch(f){}return!1};
$jscomp.setPrototypeOf="function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(a,e){a.__proto__=e;if(a.__proto__!==e)throw new TypeError(a+" is not extensible");return a}:null;
$jscomp.inherits=function(a,e){a.prototype=$jscomp.objectCreate(e.prototype);a.prototype.constructor=a;if($jscomp.setPrototypeOf){var f=$jscomp.setPrototypeOf;f(a,e)}else for(f in e)if("prototype"!=f)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(e,f);d&&Object.defineProperty(a,f,d)}else a[f]=e[f];a.superClass_=e.prototype};
$jscomp.checkStringArgs=function(a,e,f){if(null==a)throw new TypeError("The 'this' value for String.prototype."+f+" must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype."+f+" must not be a regular expression");return a+""};$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,e,f){a!=Array.prototype&&a!=Object.prototype&&(a[e]=f.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,e,f,d){if(e){f=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var r=a[d];r in f||(f[r]={});f=f[r]}a=a[a.length-1];d=f[a];e=e(d);e!=d&&null!=e&&$jscomp.defineProperty(f,a,{configurable:!0,writable:!0,value:e})}};
$jscomp.polyfill("String.prototype.repeat",function(a){return a?a:function(a){var f=$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+=f),a>>>=1)f+=f;return d}},"es6","es3");$jscomp.owns=function(a,e){return Object.prototype.hasOwnProperty.call(a,e)};
$jscomp.assign="function"==typeof Object.assign?Object.assign:function(a,e){for(var f=1;f<arguments.length;f++){var d=arguments[f];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,f,d){var e=this.length||0;0>f&&(f=Math.max(0,e+f));if(null==d||d>e)d=e;d=Number(d);0>d&&(d=Math.max(0,e+d));for(f=Number(f||0);f<d;f++)this[f]=a;return this}},"es6","es3");$jscomp.findInternal=function(a,e,f){a instanceof String&&(a=String(a));for(var d=a.length,r=0;r<d;r++){var l=a[r];if(e.call(f,l,r,a))return{i:r,v:l}}return{i:-1,v:void 0}};
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,f){return $jscomp.findInternal(this,a,f).v}},"es6","es3");$jscomp.polyfill("Array.prototype.flat",function(a){return a?a:function(a){a=void 0===a?1:Number(a);for(var f=[],d=0;d<this.length;d++){var e=this[d];Array.isArray(e)&&0<a?(e=Array.prototype.flat.call(e,a-1),f.push.apply(f,e)):f.push(e)}return f}},"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.border_width="border_width";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";a.label_color="label_color";a.label_text_color="label_text_color";a.extra_style="extra_style";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 e,f,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"";e=d.split(",");f="";f+=a.getFontStyle(e[1])+" ";f+=e[2]+"px ";return f+=a.getFontName(e[0].split(" ")[0])};a.getFontName=function(f){f=f.toLowerCase();d=a.monospace_font;if("serif"===f||"times new roman"===f||"timesroman"===f||"times"===f)d=a.serif_font;else if("sansserif"===f||"arial"===f||"helvetica"===f)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 e(){var a,c,b,g,d,n,f;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")&&(g=a.split("e"),n="-"===g[0][0]?"-":"",d="-"===n?parseFloat(g[0].substring(1)).oToFixed(11):parseFloat(g[0]).oToFixed(11),f=parseInt(g[1]),c=d.indexOf("."),d=d.replace(".",""),0>c+f?(c=0>c?1:c,a=n+"0."+"0".repeat(Math.abs(c+f))+d):a=n+d+"0".repeat(f-d.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 f=2*Math.PI,d=360/f,r=f/360,l=Math.floor,b,h,m,g;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,f,n,m){a.lineWidth=m||1;a.strokeStyle=n||"black";g=a.lineWidth%2*.5;a.beginPath();a.moveTo(l(c)+g,l(b)+g);a.lineTo(l(d)+g,l(f)+g);a.stroke()};a.getColor=function(a,c){if("string"===
typeof c)return c;b=a.eval(c);return"rgba("+l(255*b[0][0])+","+l(255*b[0][1])+","+l(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);e()};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 g=2*a,k=a;k<c;k++)a=l(100-k-35),b+="rgba(0,0,0,"+a*a*192/1E4/255+") "+(2*k-g)+"%, ";return b+"rgba(0,0,0,0.1) 100%)"};a.getCursorPosition=function(c,b){h=c.touches?c.touches[0]:c;m=b.getBoundingClientRect();return h?{x:(h.pageX-window.pageXOffset-m.left)/a.cssScale,y:(h.pageY-window.pageYOffset-m.top)/a.cssScale}:null};a.splitSeparator=function(a){a=a.replace(/\\n/g,"\n");for(var c=!1,b,g=[],d=0,n=0,f=a.length;n<f;n++)b=a.charAt(n),"'"===
b&&(c=!c),c||";"!==b&&"\n"!==b||(g.push(a.substring(d,n).replace(/\n/g,"\\n")),d=n+1);g.push(a.substring(d).replace(/\n/g,"\\n"));return g};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()-g>=c&&(a.call(),g=Date.now());d.value=requestAnimationFrame(b)}if(!requestAnimationFrame)return setInterval(a,c);var g=Date.now(),d={};d.value=requestAnimationFrame(b);return d};a.clearInterval=function(a){a&&(cancelAnimationFrame?cancelAnimationFrame(a.value):clearInterval(a))};a.setTimeout=function(a,c){function b(){Date.now()-
g>=c?a.call():d.value=requestAnimationFrame(b)}if(!requestAnimationFrame)return setTimeout(a,c);var g=Date.now(),d={};d.value=requestAnimationFrame(b);return d};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(e){if(a.cacheFiles[e])return a.cacheFiles[e];var f=null,d=new XMLHttpRequest;d.open("GET",e,!1);try{d.send(null),f=200===d.status||304===d.status?d.responseText:d.responseText||"",f=404===d.status?"":f,f.match(String.fromCharCode(65533))&&(d.open("GET",e,!1),d.overrideMimeType("text/plain;charset=ISO-8859-1"),d.send(null),f=d.responseText)}catch(r){f=null}return f};a.addExternalFileContent=function(e,
f){a.cacheFiles[e]=f};return a}(descartesJS||{});
descartesJS=function(a){function e(a){x=a.indexOf("--radial--");-1!=x&&(a=a.substring(0,x));l=a.trim();a={ignoreAccents:!1,ignoreCaps:!1,regExp:null};l[0]==l[l.length-1]&&"'"==l[0]&&(a.ignoreCaps=!0,l=l.substring(1,l.length-1),"`"==l[0]&&"\u00b4"==l[l.length-1]&&(a.ignoreAccents=!0,l=l.substring(1,l.length-1)));"`"==l[0]&&"\u00b4"==l[l.length-1]&&(a.ignoreAccents=!0,l=l.substring(1,l.length-1),l[0]==l[l.length-1]&&"'"==l[0]&&(a.ignoreCaps=!0,l=l.substring(1,l.length-1)));"*"===l.charAt(0)&&"*"!==
l.charAt(l.length-1)?l=l.substring(1)+"$":"*"!==l.charAt(0)&&"*"===l.charAt(l.length-1)?l="^"+l.substring(0,l.length-1):"*"!==l.charAt(0)&&"*"!==l.charAt(l.length-1)?l="^"+l+"$":"*"===l.charAt(0)&&"*"===l.charAt(l.length-1)&&(l=l.substring(1,l.length-1));a.regExp=l.replace(/\?/g,"[\\S\\s]{1}");return a}function f(a,c){l=(a||"").trim();a={ignoreAccents:!1,ignoreCaps:!1,regExp:null};a.expr=l.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);g=a.expr[0];q=a.expr[1];c=d.eval(g.expr);v=d.eval(q.expr);k="("==g.type||"["==g.type;u=")"==q.type||"]"==q.type;return k&&b>c&&u&&b<=v?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 l,b,h,m,g,q,c,v,k,u,x;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,g=a.length;n<g;n++){b=a[n].split("&");h=[];for(var d=0,k=b.length;d<k;d++)l=b[d],-1===l.indexOf(",")||"("!==
l.charAt(0)&&"["!==l.charAt(0)||")"!==l.charAt(l.length-1)&&"]"!==l.charAt(l.length-1)?h.push(e(l)):h.push(f(l,c));a[n]=h}return a};a.escorrecto=function(c,n,g,k){g=g||a.externalEvaluator;k=k||a.buildRegularExpressionsPatterns(c,g);n=r(n);c=0;for(var f=k.length;c<f;c++){b=k[c];m=!0;for(var h=0,e=b.length;h<e;h++)m=b[h].regExp?m&&!!n.match(new RegExp(r(b[h].regExp),"i")):m&&d(b[h],n,g);if(m)return 1}return 0};a.esCorrecto=function(c,n,g,k){g=g||a.externalEvaluator;k=k||a.buildRegularExpressionsPatterns(c,
g);c=0;for(var f=k.length;c<f;c++){b=k[c];m=!0;for(var h=0,e=b.length;h<e;h++)(l=b[h].regExp)?(b[h].ignoreAccents&&(n=r(n),l=r(l)),b[h].ignoreCaps&&(n=n.toLowerCase(),l=r(l).toLowerCase()),m=m&&!!n.match(l)):m=m=m&&d(b[h],n,g);if(m)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,f){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===f?"24c":f)+'" d="m19.5 17.5-7.5-12-7.5 12z"/></svg>')};a.getSvgArrowDown=function(a,f){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===f?"d00018":f)+'"/></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 e=Math.floor,f,d,r,l,b,h,m,g,q,c,v,k,u,x,p=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],l=parseInt(h,16),h!==l.toString(16)&&h!=="0"+l.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((l/
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+")"};p.prototype.splitComa=function(a){b=[];for(var n=q=g=m=0,d=a.length;n<d;n++)c=a.charAt(n),"("===c?m++:")"===c?m--:"["===c?g++:"]"===c?g--:","===c&&0===m&&0===g&&(b.push(a.substring(q,n)),q=n+1);b.push(a.substring(q));return b};p.prototype.getColorStr=function(){return this.colorStr};p.prototype.getColorExp=function(){f=
this.evaluator;this.r=e(255*f.eval(this.rExpr));this.g=e(255*f.eval(this.gExpr));this.b=e(255*f.eval(this.bExpr));this.a=1-f.eval(this.aExpr);return"rgba("+this.r+","+this.g+","+this.b+","+this.a+")"};p.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(",");v=parseInt(a[0]).toString(16);k=parseInt(a[1]).toString(16);u=parseInt(a[2]).toString(16);x=(255-
parseInt(255*parseFloat(a[3]))).toString(16);1===v.length&&(v="0"+v);1===k.length&&(k="0"+k);1===u.length&&(u="0"+u);1===x.length&&(x="0"+x);return new p(x+v+k+u)};a.Color=p;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=document.head,f=a.newHTML("meta",{"http-equiv":"X-UA-Compatible",content:"IE=edge,chrome=1"});e.appendChild(f);f=a.newHTML("meta",{name:"viewport",content:"width=device-width,initial-scale=1.0,user-scalable=yes"});document.querySelector("meta[name=viewport]")||e.appendChild(f);f=a.newHTML("meta",{name:"mobile-web-app-capable",content:"yes"});e.appendChild(f);f=a.newHTML("meta",{name:"apple-mobile-web-app-capable",content:"yes"});e.appendChild(f);
f=a.newHTML("meta",{name:"apple-mobile-web-app-status-bar-style",content:"black"});e.appendChild(f);(e=document.getElementById("StyleDescartesApps2"))&&e.remove();e=a.newHTML("style",{rel:"stylesheet",type:"text/css",id:"StyleDescartesApps2"});document.head.insertBefore(e,document.head.firstChild);e.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{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;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 e=Math.sin,f=Math.floor,d=Math.random,r=Math.round,l=Math.abs,b=String.fromCharCode,h,m,g,q,c,v,k,u,x,p,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(f(l(7.5*(e(1*c-a)+e(1.4*c+a)+e(.6*c-a)+e(2.2*c+a))))));return h.join("")};n.prototype.encode=function(a){m=f(31*d());this.key=this.getKey(m);return b(this.alfanum(m))+this.encripta(a)};n.prototype.decode=function(a){m=
this.numalfa(a.charCodeAt(0));this.key=this.getKey(m);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;v=Array(3*a.length);for(var c=0,b=a.length;c<b;c++)x=256*f(a[c]+128)+r(255*d())+65536*r(255*d()),p=f((x<<this.shift(c))/256),v[3*c]=this.alfanum(p%32),v[3*c+1]=this.alfanum(p/32%32),v[3*c+2]=this.alfanum(p/1024%32);return v};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++)p=this.numalfa(a[3*c])+32*this.numalfa(a[3*c+1])+1024*this.numalfa(a[3*c+2]),x=f(256*p>>this.shift(c)),u=f(x/256)%256-128,0>u&&(u+=256),k[c]=u;return k};n.prototype.alfanum=function(a){return(10>a?48:87)+f(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){g=this.key.charCodeAt(a%this.key.length);q=this.numalfa(g);c=f(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 e=function(f,d){this.parent=f;var e=f.evaluator,l=e.parser;f=new a.Auxiliary(f);var b=this;b.delay=d.delay?l.parse(d.delay):l.parse("60");b.loop=d.loop?d.loop:!1;b.auto=void 0==d.auto?!0:d.auto;b.controls=d.controls;b.init=f.splitInstructions(l,d.init);b.doExpr=f.splitInstructions(l,d.doExpr);d.whileExpr&&(b.whileExpr=l.parse(d.whileExpr));var h,m=b.doExpr.length;b.animExec=function(){for(h=0;h<m;h++)e.eval(b.doExpr[h]);b.parent.update();b.playing&&
(0<e.eval(b.whileExpr)||b.loop)?b.timer=a.setTimeout(b.animExec,e.eval(b.delay)):(b.stop(),b.pause=!1,b.parent.update())};b.playing=!1;b.auto&&b.play()};e.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))))};e.prototype.stop=function(){this.playing=!1;a.clearTimeout(this.timer)};e.prototype.reinit=function(){for(var a=0,d=this.init.length;a<
d;a++)this.parent.evaluator.eval(this.init[a])};a.Animation=e;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var e=function(a,d){this.parent=a;this.evaluator=this.parent.evaluator};e.prototype.execute=function(){};a.Action=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=function(f,d){f=a.Action.call(this,f,d)||this;f.parameter=(d||"").replace(/\\n/g,"\n").replace(/&squot;/g,"'");return f};$jscomp.inherits(e,a.Action);e.prototype.execute=function(){alert(this.parameter)};a.Message=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=function(f,d){f=a.Action.call(this,f,d)||this;var e=f.evaluator,l=e.parser;d=a.splitSeparator((d||"").replace(/&squot;/g,"'"));for(var b=[],h,m=0,g=d.length;m<g;m++)(h=l.parse(d[m],!0))&&b.push(h);g=b.length;f.execute=function(){for(m=0;m<g;m++)e.eval(b[m])};return f};$jscomp.inherits(e,a.Action);a.Calculate=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=function(f,d){var e=a.Action.call(this,f,d)||this;e.parser=f.evaluator.parser;e.evaluator=f.evaluator;e.parameter=d;e.target="_blank";return e};$jscomp.inherits(e,a.Action);e.prototype.execute=function(){var f=this.parameter;f.match(/^\[.*\]?/)&&(f=this.evaluator.eval(this.parser.parse(f.substring(1,f.length-1))));var d=f.indexOf("target");-1!=d&&(this.target=f.substring(d),this.target=this.target.substring(this.target.indexOf("=")+1),f=f.substring(0,
d-1));if("javascript"==f.substring(0,10)){f=new a.SimpleText(parent,f.substring(11).replace(/&squot;/g,"'"));try{eval(f.toString())}catch(r){}}else"http"!=f.substring(0,4)&&(d=window.__dirname||window.location.href,f=d.substring(0,d.lastIndexOf("/")+1)+f),window.open(f,this.target)};a.OpenURL=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=function(f,d){var e=a.Action.call(this,f,d)||this;e.parser=f.evaluator.parser;e.evaluator=f.evaluator;e.parameter=d.trim();e.target="_blank";return e};$jscomp.inherits(e,a.Action);e.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=e;return a}(descartesJS||
{});
descartesJS=function(a){if(a.loadLib)return a;var e=function(f,d){return a.Action.call(this,f,d)||this};$jscomp.inherits(e,a.Action);e.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=e;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var e=function(f,d){return a.Action.call(this,f,d)||this};$jscomp.inherits(e,a.Action);e.prototype.execute=function(){this.parent.init()};a.Init=e;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var e=function(f,d){return a.Action.call(this,f,d)||this};$jscomp.inherits(e,a.Action);e.prototype.execute=function(){this.parent.clear()};a.Clear=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=function(f,d){return a.Action.call(this,f,d)||this};$jscomp.inherits(e,a.Action);e.prototype.execute=function(){this.parent.play()};a.Animate=e;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var e=function(f,d){return a.Action.call(this,f,d)||this};$jscomp.inherits(e,a.Action);e.prototype.execute=function(){this.parent.reinitAnimation()};a.InitAnimation=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=/[\w\.\-//]*(\.ogg|\.oga|\.mp3|\.wav)/gi,f=function(d,f){d=a.Action.call(this,d,f)||this;f=f||"";f.match(e)?d.filenameExpr=d.evaluator.parser.parse("'"+f.match(e)+"'"):(f.match(/^\[.*\]?/)&&(f=f.substring(1,f.length-1)),d.filenameExpr=d.evaluator.parser.parse(f));return d};$jscomp.inherits(f,a.Action);f.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=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,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,l){f=[];l=l?a.splitSeparator(l):[""];for(var b=0,h=l.length;b<h;b++)a.DEBUG.lineCount=b,(e=d.parse(l[b],!0))&&f.push(e);return f};d.prototype.getPrivateVariables=function(a,d){f=[];d=d?d.split(/;|,/):
[""];for(var b=0,h=d.length;b<h;b++)(e=a.parse(d[b],!0))&&f.push(e);b=0;for(h=f.length;b<h;b++)f[b]="asign"===f[b].type?f[b].childs[0].value:"identifier"===f[b].type?f[b].value:"";return f};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 e=function(f,d){f=a.Auxiliary.call(this,f,d)||this;d=f.evaluator.parser;f.expresionString=f.expresion;f.expresion=d.parse(f.expresionString);f.expresion&&d.setVariable(f.id,f.expresion);f.editable&&(f.registerTextField(),f.parent.editableRegionVisible=!0);return f};$jscomp.inherits(e,a.Auxiliary);e.prototype.registerTextField=function(){var f=a.newHTML("div"),d=a.newHTML("label");d.appendChild(document.createTextNode("___"+this.id+"=___"));var e=a.newHTML("input");
e.value=this.expresionString;e.disabled=!this.editable;f.appendChild(d);f.appendChild(e);var l=this,b=l.evaluator.parser;e.onkeydown=function(a){13==a.keyCode&&(l.expresion=b.parse(this.value),b.setVariable(l.id,l.expresion),l.parent.update())};this.parent.editableRegion.textFields.push({container:f,type:"div"})};a.Variable=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=function(f,d){f=a.Auxiliary.call(this,f,d)||this;f.expresion=f.evaluator.parser.parse(f.expresion);f.update();return f};$jscomp.inherits(e,a.Auxiliary);e.prototype.update=function(){this.evaluator.setVariable(this.id,this.evaluator.eval(this.expresion))};a.Constant=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l=function(b,d){d=a.Auxiliary.call(this,b,d)||this;e=b.evaluator;f=e.parser;d.size=d.size||f.parse("3");d.expresion=d.expresion.split(";");d.parseFile=f.parse(d.file);d.update();return d};$jscomp.inherits(l,a.Auxiliary);l.prototype.update=function(){var b=this.expresion,h;e=this.evaluator;f=e.parser;this.oldFile=this.file;if(d=e.eval(this.parseFile))this.file=d;if(this.file){r=(h=document.getElementById(this.file))&&"descartes/vectorFile"==
h.type?h.text:a.openExternalFile(this.file);if(null!=r){r=r.replace(/\r/g,"").split("\n");var m=[];h=0;for(var g=r.length;h<g;h++)""!=r[h]&&m.push(r[h]);r=m}null==r||1==r.length&&""==r[0]?(r=[],this.size=f.parse("0")):(b=r,this.size=null);null===this.size&&(this.size=f.parse(b.length+""))}var q;m=[];h=0;for(g=b.length;h<g;h++)(q=f.parse(b[h],!0))&&"asign"!=q.type&&(q=f.parse(this.id+"["+h+"]="+b[h],!0)),m.push(q);b=Array(e.eval(this.size)).fill(0);b._size_=b.length;e.vectors[this.id]=b;e.setVariable(this.id+
".long",b._size_);h=0;for(g=m.length;h<g;h++)e.eval(m[h])};a.Vector=l;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b=function(b,m){m=a.Auxiliary.call(this,b,m)||this;e=b.evaluator;f=e.parser;m.rows=m.rows||f.parse("3");m.columns=m.columns||f.parse("3");m.expresion=m.splitInstructions(f,m.expresion);d=e.eval(m.rows);r=e.eval(m.columns);l=[];l.type="matrix";b=0;for(var g=r;b<g;b++)l[b]=Array(d).fill(0);e.matrices[m.id]=l;m.update();return m};$jscomp.inherits(b,a.Auxiliary);b.prototype.update=function(){e=this.evaluator;d=e.eval(this.rows);r=e.eval(this.columns);
e.setVariable(this.id+".filas",d);e.setVariable(this.id+".columnas",r);l=e.matrices[this.id];l.rows=d;l.cols=r;for(var a=0,b=this.expresion.length;a<b;a++)e.eval(this.expresion[a])};a.Matrix=b;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=function(f,d){var e=a.Auxiliary.call(this,f,d)||this;var l=e.evaluator;f=l.parser;d=e.id.indexOf("(");e.name=e.id.substring(0,d);e.params=e.id.substring(d+1,e.id.indexOf(")"));e.domain=e.range?f.parse(e.range):f.parse("1");e.params=""===e.params?[]:e.params.split(",");e.numberOfParams=e.params.length;e.algorithm||(e.init="",e.doExpr="",e.whileExpr="");e.parseExpressions(f);e.expresion=f.parse(e.expresion);e.functionExec=function(){e.iterations=0;
if(e.numberOfParams<=arguments.length){for(var b=[],d=0,f=e.privateVars.length;d<f;d++)b.push(l.getVariable(e.privateVars[d])),l.setVariable(e.privateVars[d],0);var g=[];d=0;for(f=e.params.length;d<f;d++)g[d]=l.getVariable(e.params[d]),l.setVariable(e.params[d],arguments[d]);d=0;for(f=e.init.length;d<f;d++)l.eval(e.init[d]);do{d=0;for(f=e.doExpr.length;d<f;d++)l.eval(e.doExpr[d]);if(1E5<++e.iterations)return console.warn("se ha excedido el l\u00edmite de 100000 repeticiones en la funci\u00f3n << "+
e.name+" >>"),0}while(0<l.eval(e.whileExpr));var q=l.eval(e.expresion);a.rangeOK=l.eval(e.domain);d=0;for(f=e.params.length;d<f;d++)l.setVariable(e.params[d],g[d]);d=0;for(f=e.privateVars.length;d<f;d++)l.setVariable(e.privateVars[d],b[d]);return q}return 0};l.setFunction(e.name,e.functionExec);return e};$jscomp.inherits(e,a.Auxiliary);a.Function=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=function(f,d){var e=a.Auxiliary.call(this,f,d)||this;var l=e.evaluator;e.parseExpressions(l.parser);e.algorithmExec=function(){for(var a=e.iterations=0,d=e.init.length;a<d;a++)l.eval(e.init[a]);do{a=0;for(d=e.doExpr.length;a<d;a++)l.eval(e.doExpr[a]);if(1E5<++e.iterations)return console.warn("se ha excedido el l\u00edmite de 100000 repeticiones en el algoritmo << "+e.name+" >>"),0}while(0<l.eval(e.whileExpr))};return e};$jscomp.inherits(e,a.Auxiliary);
e.prototype.update=function(){this.algorithmExec();"onlyOnce"===this.evaluate&&(this.update=function(){})};a.Algorithm=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=function(f,d){f=a.Auxiliary.call(this,f,d)||this;d=f.evaluator;delete f.evaluate;f.condition=d.parser.parse(f.condition);f.lastEvaluation=!1;f.action=f.parent.lessonParser.parseAction(f);"onlyOnce"==f.execution&&(f.eventExec=function(){0<this.evaluator.eval(this.condition)&&!this.lastEvaluation&&(this.lastEvaluation=!0,this.action.execute())});"alternate"==f.execution&&(f.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"==f.execution&&(f.eventExec=function(){0<this.evaluator.eval(this.condition)&&this.action.execute()});return f};$jscomp.inherits(e,a.Auxiliary);e.prototype.update=function(){this.eventExec()};a.Event=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=function(f,d){var e=a.Auxiliary.call(this,f,d)||this;if(d=d.file){var l=document.getElementById(d);l=l&&"descartes/library"===l.type?l.text:a.openExternalFile(d)}if(l){l=a.convertHTMLEntities(l).replace(/\r/g,"").split("\n");d=0;for(var b=l.length;d<b;d++)""!==l[d].trim()&&f.lessonParser.parseAuxiliar(l[d])}return e};$jscomp.inherits(e,a.Auxiliary);a.Library=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b,h,m,g=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()))};g.prototype.getSpace=function(){var a=this;return this.parent.spaces.find(function(c){return c.id===a.spaceID})||this.parent.spaces[0]};g.prototype.getFamilyValues=function(){e=this.evaluator;f=e.eval(this.family_interval);this.familyInf=f[0][0];this.familySup=f[0][1];this.fSteps=Math.round(e.eval(this.family_steps));this.family_sep=0<this.fSteps?(this.familySup-this.familyInf)/this.fSteps:0};g.prototype.drawFamilyAux=function(a,
c,b){e=this.evaluator;this.getFamilyValues();d=e.getVariable(this.family);if(0<=this.fSteps)for(var g=0,f=this.fSteps;g<=f;g++)e.setVariable(this.family,this.familyInf+g*this.family_sep),0<e.eval(this.drawif)&&(this.update(),a.oldTextNode=null,this.drawAux(a,c,b));e.setVariable("_Text_H_",0);e.setVariable(this.family,d)};g.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))};g.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))};g.prototype.rotate=function(a,c,b){h=Math.cos(b);m=Math.sin(b);return{x:a*h-c*m,y:a*m+c*h}};g.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([])};g.prototype.drawText=function(a,c,b,d,g,f,m,n,h,w,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,w,m,y,g.getColor());else for("simpleText"===c.type&&(c=c.toString(h,w).split("\\n")),e=this.evaluator,a.fillStyle=g.getColor(),a.font=f,a.textAlign=m,a.textBaseline=n,l=1.2*this.fontSize||0,g=0,f=c.length;g<f;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+l*g)),a.fillText(r,b,d+l*g)};a.Graphic=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b,h,m=function(a,f){this.text=f=f.replace("&#x2013","\u2013").replace(/&squot;/g,"'");this.textElements=[];this.textElementsMacros=[];this.parent=a;this.evaluator=a.evaluator;this.type="simpleText";e="'";r=d=0;for(l=-1;d<f.length;)b=f.charAt(d),h=f.charAt(d-1),"["===b&&"\\"===h?(this.textElements.push(f.substring(r,d-1)+"["),this.textElementsMacros.push("'"+f.substring(r,d-1)+"['"),r=d+1):"]"===b&&"\\"===h?(this.textElements.push(f.substring(r,
d-1)+"]"),this.textElementsMacros.push("'"+f.substring(r,d-1)+"]'"),r=d+1):"["===b&&-1===l?(this.textElements.push(f.substring(r,d)),this.textElementsMacros.push("'"+f.substring(r,d)+"'"),r=d,l++):"["===b?l++:"]"===b&&0===l?(this.textElements.push(this.evaluator.parser.parse(f.substring(r,d+1))),this.textElementsMacros.push("["+f.substring(r,d+1)+"]"),r=d+1,l--):("]"==f.charAt(d)&&(l=0>l?l:l-1),e+=f.charAt(d)),d++;this.textElements.push(f.substring(r,d));this.textElementsMacros.push("'"+f.substring(r,
d)+"'")};m.prototype.toString=function(b,d){e="";for(var c=0,g=this.textElements.length;c<g;c++)"string"===typeof this.textElements[c]?e+=this.textElements[c]:(f=this.evaluator.eval(this.textElements[c])[0][0],""!==f&&("string"===typeof f?e+=f:Infinity==f?e+="Infinity":-Infinity==f?e+="-Infinity":isNaN(f)||"NaN"==f?e+="NaN":(f=parseFloat(f),f=d?f.toFixed(b):a.removeNeedlessDecimals(f.toFixed(b)),e+=f.toString().replace(".",this.parent.decimal_symbol))));return e};a.SimpleText=m;return a}(descartesJS||
{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b,h,m,g,q,c,v,k,u,x,p,n,B,w,y,A,E,J,F,H,z,I,C,M,N,O,G,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();v=new a.R2;k=new a.R2;u=new a.R2;n=new a.R2;x=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){f=this.evaluator;this.getFamilyValues();tempParam=f.getVariable(this.family);if(0<=this.fSteps)for(var d=0,n=this.fSteps;d<=n;d++)f.setVariable(this.family,this.familyInf+d*this.family_sep),this.update(),
this.drawAux(a,c,b);f.setVariable(this.family,tempParam)};L.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.fill,this.trace)};L.prototype.drawAux=function(P,Q,R){if(!(0>=this.evaluator.eval(this.drawif))){this.cInd=0;f=this.evaluator;d=f.parser;r=this.space;l=f.eval(this.width);P.strokeStyle=this.color.getColor();P.lineWidth=l;b=d.getVariable("x");h=d.getVariable("y");m=r.w+24;g=r.h+24;q=m/9;3>q&&(q=3);c=g/7;3>c&&(c=3);0==this.cInd?(e=[],this.cInd++):this.cInd=(this.cInd+
1)%1E7;v.set(0,0);k.set(0,0);u.set(0,0);D=.25;K=8;this.abs_coord||(D/=r.scale,K/=r.scale);P.beginPath();for(I=parseInt(c/2);I<g;I+=c)for(z=parseInt(q/2);z<m;z+=q){if(this.abs_coord){n.set(z,I);p=this.newt.findZero(n,D);if(null==p)continue;f.setVariable("x",p.x);f.setVariable("y",p.y);x.set(p.x,p.y)}else{n.set(r.getRelativeX(z),r.getRelativeY(I));p=this.newt.findZero(n,D);if(null==p)continue;f.setVariable("x",p.x);f.setVariable("y",p.y);x.set(r.getAbsoluteX(p.x),r.getAbsoluteY(p.y))}B=x.ix();w=x.iy();
if(-12<=B&&B<m+24&&-12<=w&&w<g+24){if(e[B+12+(w+12)*r.w]===this.cInd)continue;e[B+12+(w+12)*r.w]=this.cInd}a.rangeOK&&(P.moveTo(B,w),P.lineTo(B,w));v.x=p.x;v.y=p.y;k.x=p.x;k.y=p.y;y=this.newt.getUnitNormal();if(0!=y.x||0!=y.y)for(y.rotL90(),u.x=y.x,u.y=y.y,E=A=0,J=!1;2>E;)if(J&&(u.x=-y.x,u.y=-y.y,p.x=v.x,p.y=v.y,k.x=p.x,k.y=p.y,this.abs_coord?x.set(p.x,p.y):x.set(r.getAbsoluteX(p.x),r.getAbsoluteY(p.y)),B=x.ix(),w=x.iy(),J=!1,A=0),p.x+=K*u.x,p.y+=K*u.y,p=this.newt.findZero(p,D),null!=p){f.setVariable("x",
p.x);f.setVariable("y",p.y);u.x=p.x-k.x;u.y=p.y-k.y;u.normalize();if(0==u.x&&0==u.y)break;k.x=p.x;k.y=p.y;this.abs_coord?x.set(p.x,p.y):x.set(r.getAbsoluteX(p.x),r.getAbsoluteY(p.y));F=parseInt(x.ix());H=parseInt(x.iy());if(F!=B||H!=w)if(C=B,M=w,B=F,w=H,-12<=B&&B<m+24&&-12<=w&&w<g+24){A=0;N=e[B+12+(w+12)*r.w];e[B+12+(w+12)*r.w]=this.cInd;for(Q=1;8>Q;Q++)O=C+Math.round((B-C)*Q/8),G=M+Math.round((w-M)*Q/8),0<=O&&O<m&&0<=G&&G<g&&(e[O+12+(G+12)*r.w]=this.cInd);a.rangeOK&&(P.moveTo(C,M),P.lineTo(B,w));
if(N===this.cInd)break}else J=!0,E++;else 4<++A&&(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,g,f){for(var k=this.evaluator.getVariable(b),e=f/2,m=0,h,v,p,q,l,x;1E-15<Math.abs(e);){h=this.evaluator.getVariable(b);v=this.evaluator.getVariable(b)+e;this.evaluator.setVariable(b,v);p=!0;try{q=g,g=this.evaluator.eval(this.funExpr),this.evaluator.setVariable(d,g),0<this.evaluator.eval(c)?(l=new a.R2(Math.min(q,g),Math.max(q,g)),x=0,x=0<f?this.Singularity(Math.abs(e),b,n,h,q,v,g,l):this.Singularity(Math.abs(e),b,n,v,g,h,q,l),0<x&&(p=!1)):p=!1}catch(Z){p=!1}p?m+=e:this.evaluator.setVariable(b,
h);e/=2}this.evaluator.setVariable(b,k);return new a.R2(m/Math.abs(f),g)};L.prototype.extrapolateOnSingularity=function(c,b,d,n,g,f){n=this.evaluator.getVariable(b);for(var k=f/2,e=0,m=g,h;1E-15<Math.abs(k);){this.evaluator.setVariable(b,this.evaluator.getVariable(b)+k);h=!0;if(0<this.evaluator.eval(c))try{m=this.evaluator.eval(this.funExpr),this.evaluator.setVariable(d,m),0>=this.evaluator.eval(c)&&(h=!1)}catch(X){h=!1}else h=!1;h?e+=k:this.evaluator.setVariable(b,this.evaluator.getVariable(b)-k);
k/=2}if(0==e)for(k=f/2,e=f,m=g;1E-15<Math.abs(k);){this.evaluator.setVariable(b,this.evaluator.getVariable(b)-k);h=!0;if(0<this.evaluator.eval(c))try{m=this.evaluator.eval(this.funExpr)}catch(X){h=!1}else h=!1;h?e+=-k:this.evaluator.setVariable(b,this.evaluator.getVariable(b)+k);k/=2}this.evaluator.setVariable(b,n);return new a.R2(e/Math.abs(f),m)};L.prototype.Singularity=function(a,c,b,d,n,g,f,k){if(isNaN(f)||isNaN(n)||isNaN(k.y)||isNaN(k.x)||d>=g)return 2;var e=this.evaluator.getVariable(c),m=0;
try{if(1E-15>Math.abs(g-d)||1E-12>Math.abs(g-d)&&Math.abs(f-n)>Math.abs(a))return this.evaluator.setVariable(c,e),1;var h=(d+g)/2;this.evaluator.setVariable(c,h);var v=NaN;try{v=this.evaluator.eval(this.funExpr)}catch(Y){return 2}if(isNaN(v))return 5;if(Math.abs(f-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,g+1E-12);var q=(this.evaluator.eval(this.funExpr)-f)/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((f-n)/(g-d)))return this.evaluator.setVariable(c,e),2}if(isNaN(k.x)||isNaN(k.y)||isNaN(v))return 2;if(!(k.x<=v&&v<=k.y)){this.evaluator.setVariable(c,h);k.x=Math.min(n,v);k.y=Math.max(n,v);var l=this.Singularity(a/2,c,b,d,n,h,v,k);this.evaluator.setVariable(c,g);k.x=Math.min(f,v);k.y=Math.max(f,v);var x=this.Singularity(a/2,c,b,h,v,g,f,k);m=Math.max(l,x)}}catch(Y){m=1}this.evaluator.setVariable(c,e);return m};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 g="y";this.of_y&&(d="y",g="x");var f=this.drawif,k=this.evaluator.eval(this.width),e=!1,m=new a.R2(this.space.w/2+this.space.Ox,this.space.h/2+this.space.Oy),v=this.of_y?m.ix():m.iy(),p=0,q=0,l=0,x=0,u=1/this.space.scale;m=u*(this.of_y?-this.space.h+m.y:-m.x);var y=0;this.abs_coord&&(m=0,u=1);for(var w,B,r,E,z,F,R,A,M,I=this.of_y?this.space.h+2:this.space.w+2;l<=I;){w=!0;B=0;this.evaluator.setVariable(d,m);try{r=this.evaluator.eval(this.funExpr),
isNaN(r)||(this.evaluator.setVariable(g,r),0<this.evaluator.eval(this.drawif)&&a.rangeOK?(e?(E=Math.min(y,r),z=Math.max(y,r),F=new a.R2(E,z),B=this.Singularity(u,d,0,m-u,y,m,r,F),0===B?(y<=r?(y=F.x,r=F.y):(r=F.x,y=F.y),R=parseInt(this.of_y?this.XX(k,y,this.abs_coord):this.YY(k,y,this.abs_coord)),p=this.abs_coord?Math.round(r):parseInt(this.of_y?this.XX(k,r,this.abs_coord):this.YY(k,r,this.abs_coord)),this.fillM&&p>v&&(c.lineWidth=1,c.strokeStyle=this.fillM.getColor(),c.beginPath(),this.of_y?(c.moveTo(v+
1,this.space.h-l+.5),c.lineTo(p,this.space.h-l+.5)):(c.moveTo(l+.5,v+1),c.lineTo(l+.5,p)),c.stroke()),this.fillP&&p<v&&(c.lineWidth=1,c.strokeStyle=this.fillP.getColor(),c.beginPath(),this.of_y?(c.moveTo(v-1,this.space.h-l+.5),c.lineTo(p,this.space.h-l+.5)):(c.moveTo(l+.5,v-1),c.lineTo(l+.5,p)),c.stroke()),c.lineWidth=k,c.strokeStyle=n.getColor(),c.beginPath(),this.of_y?(c.moveTo(R+.5,this.space.h-x),c.lineTo(p+.5,this.space.h-l)):(c.moveTo(x+.5,R),c.lineTo(l+.5,p)),c.stroke()):1===B?(this.evaluator.setVariable(d,
m-u),A=this.extrapolate(f,d,g,0,y,u),p=this.of_y?this.XX(k,A.y,this.abs_coord):this.YY(k,A.y,this.abs_coord),c.lineWidth=k,c.strokeStyle=n.getColor(),c.beginPath(),this.of_y?(c.moveTo(q+.5,this.space.h-x),c.lineTo(p+.5,this.space.h-x+Math.round(A.x))):(c.moveTo(x+.5,q),c.lineTo(x+Math.round(A.x)+.5,p)),this.evaluator.setVariable(d,m),M=this.extrapolate(f,d,g,0,r,-u),q=this.of_y?this.XX(k,M.y,this.abs_coord):this.YY(k,M.y,this.abs_coord),p=this.of_y?this.XX(k,r,this.abs_coord):this.YY(k,r,this.abs_coord),
c.lineWidth=k,c.strokeStyle=n.getColor(),c.beginPath(),this.of_y?(c.moveTo(q+.5,this.space.h-l),c.lineTo(p+.5,this.space.h-l)):(c.moveTo(l+.5,q),c.lineTo(l+.5,p)),c.stroke()):2===B&&(p=this.of_y?this.XX(k,r,this.abs_coord):this.YY(k,r,this.abs_coord),c.lineWidth=k,c.strokeStyle=n.getColor(),c.beginPath(),this.of_y?(c.moveTo(q+.5,this.space.h-l),c.lineTo(p+.5,this.space.h-l)):(c.moveTo(l+.5,q),c.lineTo(l+.5,p)))):(M=this.extrapolateOnSingularity(f,d,g,0,r,-u),q=this.of_y?this.XX(k,M.y,this.abs_coord):
this.YY(k,M.y,this.abs_coord),p=this.of_y?this.XX(k,r,this.abs_coord):this.YY(k,r,this.abs_coord),c.lineWidth=k,c.strokeStyle=n.getColor(),c.beginPath(),this.of_y?(c.moveTo(q,this.space.h-(l+Math.round(M.x))+.5),c.lineTo(p,this.space.h-l+.5)):(c.moveTo(l+Math.round(M.x),q),c.lineTo(l,p)),c.stroke()),y=r):w=!1)}catch(aa){w=!1}e&&!w&&(this.evaluator.setVariable(d,m-u),this.evaluator.setVariable(g,y),A=this.extrapolate(f,d,g,0,y,u),p=parseInt(this.of_y?this.XX(k,A.y,this.abs_coord):this.YY(k,A.y,this.abs_coord)),
0<this.evaluator.eval(this.drawif)&&a.rangeOK&&(c.lineWidth=k,c.strokeStyle=n.getColor(),c.beginPath(),this.of_y?(c.moveTo(q,this.space.h-(x+Math.round(A.x))+.5),c.lineTo(p,this.space.h-(x+Math.round(A.x))+.5)):(c.moveTo(x+Math.round(A.x)+.5,q),c.lineTo(x+Math.round(A.x)+.5,p)),c.stroke()),this.evaluator.setVariable(d,m));e=w;m+=u;q=p;x=l++}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 e=Math.round,f,d,r,l,b,h,m,g,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(){f=this.evaluator;d=f.eval(this.parameter_interval);this.paraInf=d[0][0];this.paraSup=d[0][1];this.pSteps=f.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){f=this.evaluator;r=this.space;l=e(f.eval(this.width));
c.lineWidth=0<l?l:1E-6;c.lineCap=c.lineJoin="round";c.strokeStyle=k.getColor();b=f.getVariable(this.parameter);c.beginPath();f.setVariable(this.parameter,this.paraInf);h=f.eval(this.expresion);this.exprX=e(this.abs_coord?h[0][0]:r.getAbsoluteX(h[0][0]));this.exprY=e(this.abs_coord?h[0][1]:r.getAbsoluteY(h[0][1]));this.rotateExp&&(m=a.degToRad(f.eval(this.rotateExp)),g=this.rotate(h[0][0],h[0][1],m),this.exprX=e(this.abs_coord?g.x:r.getAbsoluteX(g.x)),this.exprY=e(this.abs_coord?g.y:r.getAbsoluteY(g.y)));
c.moveTo(this.exprX+.5,this.exprY+.5);for(k=1;k<=this.pSteps;k++)f.setVariable(this.parameter,this.paraInf+k*this.paraSep),h=f.eval(this.expresion),this.rotateExp&&(g=this.rotate(h[0][0],h[0][1],m),h[0][0]=g.x,h[0][1]=g.y),this.exprX=e(this.abs_coord?h[0][0]:r.getAbsoluteX(h[0][0])),this.exprY=e(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([]);f.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 e=2*Math.PI,f=Math.round,d,r,l,b,h,m,g,q,c,v,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;l=d.eval(this.expresion);this.exprX=l[0][0];this.exprY=l[0][1];this.rotateExp&&
(b=this.rotate(l[0][0],l[0][1],a.degToRad(d.eval(this.rotateExp))),this.exprX=b.x,this.exprY=b.y);g=d.eval(this.range);this.rangeInf=g[0][0];this.rangeMax=g[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,g){d=this.evaluator;r=this.space;c=q=Math.ceil(d.eval(this.size)-.4);b.fillStyle=g.getColor();b.beginPath();this.rangeInf>
this.rangeMax&&(v=this.rangeInf,this.rangeInf=this.rangeMax,this.rangeMax=v);g=d.getVariable("n");for(var k=this.rangeInf,n=this.rangeMax;k<=n;k++)d.setVariable("n",k),l=d.eval(this.expresion),this.exprX=l[0][0],this.exprY=l[0][1],h=f(this.abs_coord?this.exprX:r.getAbsoluteX(this.exprX)),m=f(this.abs_coord?this.exprY:r.getAbsoluteY(this.exprY)),b.beginPath(),b.arc(h,m,q,0,e,!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,m-c,this.color,this.font,"start","alphabetic",d.eval(this.decimals),this.fixed,!0));d.setVariable("n",g)};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 e=2*Math.PI,f=Math.round,d,r,l,b,h,m,g=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(g,a.Graphic);g.prototype.update=function(){d=this.evaluator;l=d.eval(this.expresion);this.exprX=l[0][0];this.exprY=l[0][1];this.rotateExp&&(b=this.rotate(l[0][0],l[0][1],a.degToRad(d.eval(this.rotateExp))),this.exprX=b.x,this.exprY=b.y)};g.prototype.draw=function(){a.Graphic.prototype.draw.call(this,
this.color,this.color)};g.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};g.prototype.drawAux=function(a,c){r=this.space;a.fillStyle=c.getColor();h=f(this.abs_coord?this.exprX:r.getAbsoluteX(this.exprX));m=f(this.abs_coord?this.exprY:r.getAbsoluteY(this.exprY));a.beginPath();a.arc(h,m,f(this.evaluator.eval(this.size)),0,e,!0);a.fill();this.text.hasContent&&this.text.draw(a,c,h,m)};a.Point=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=Math.round,f=2*Math.PI,d,r,l,b,h,m,g,q,c,v,k,u,x,p=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(p,a.Graphic);p.prototype.update=function(){d=this.evaluator;l=d.eval(this.expresion);this.endPoints=[];for(var c=0,g=l.length;c<g;c++)this.endPoints[c]={x:l[c][0],y:l[c][1]};if(this.rotateExp)for(b=
a.degToRad(d.eval(this.rotateExp)),c=0,g=this.endPoints.length;c<g;c++)this.endPoints[c]=this.rotate(this.endPoints[c].x,this.endPoints[c].y,b)};p.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.color,this.color)};p.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};p.prototype.drawAux=function(a,b,p){d=this.evaluator;r=this.space;h=e(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=
p.getColor();a.lineCap="round";c=0==a.lineWidth%2?0:.5;this.abs_coord?(v=e(this.endPoints[0].x),k=e(this.endPoints[0].y),u=e(this.endPoints[1].x),x=e(this.endPoints[1].y)):(v=e(r.getAbsoluteX(this.endPoints[0].x)),k=e(r.getAbsoluteY(this.endPoints[0].y)),u=e(r.getAbsoluteX(this.endPoints[1].x)),x=e(r.getAbsoluteY(this.endPoints[1].y)));a.beginPath();a.moveTo(v+c,k+c);a.lineTo(u+c,x+c);this.dashStyle();a.stroke();0<q&&(a.beginPath(),a.arc(v,k,q,0,f,!0),a.arc(u,x,q,0,f,!0),a.fill());a.setLineDash([]);
this.text.hasContent&&(m=parseInt((v+u)/2)-3,g=parseInt((k+x)/2)+3,this.text.draw(a,p,m,g))};a.Segment=p;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=Math.floor,f=Math.round,d,r,l,b,h,m,g,q,c,v,k,u,x,p,n,B=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(B,a.Graphic);B.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(l=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,l)};B.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.arrow,this.color)};B.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.arrow,this.trace)};B.prototype.drawAux=function(l,y,r){d=this.evaluator;b=this.space;g=d.eval(this.width);
0>g&&(g=0);q=Math.ceil(g/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);v=this.vect.vectorLength();this.angle=this.vect.angleBetweenVectors(a.Vector2D.AXIS_X);l.fillStyle=y.getColor();l.strokeStyle=r.getColor();l.lineWidth=2;this.abs_coord?(k=f(this.endPoints[0].x),u=f(this.endPoints[0].y),x=f(this.endPoints[1].x),p=f(this.endPoints[1].y)):(k=f(b.getAbsoluteX(this.endPoints[0].x)),u=f(b.getAbsoluteY(this.endPoints[0].y)),x=f(b.getAbsoluteX(this.endPoints[1].x)),
p=f(b.getAbsoluteY(this.endPoints[1].y)));n=d.eval(this.spear);0>n&&(n=0);l.save();l.translate(k,u,v);this.abs_coord?l.rotate(this.angle*(0<=this.vect.y?1:-1)):(v*=c,l.rotate(this.angle*(0<=this.vect.y?-1:1)));l.beginPath();l.moveTo(-q,e(-q));l.lineTo(e(v-n-g),e(-q));l.lineTo(e(v-2*n),e(-n-q));l.lineTo(e(v),0);l.lineTo(e(v-2*n),e(n+q));l.lineTo(e(v-n-g),e(q));l.lineTo(-q,e(q));l.closePath();l.stroke();l.fill();l.restore();this.text.hasContent&&(h=parseInt((k+x)/2)-3,m=parseInt((u+p)/2)+3,this.text.draw(l,
r,h,m))};a.Arrow=B;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=Math.round,f,d,r,l,b,h,m,g,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(){f=this.evaluator;r=f.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(l=a.degToRad(f.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,l)};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,v,k){f=this.evaluator;d=this.space;b=e(f.eval(this.width));a.lineWidth=0<b?b:1E-6;a.strokeStyle=k.getColor();a.lineCap=a.lineJoin="round";h=0<b?.5:0;m=e(this.abs_coord?this.endPoints[0].x:d.getAbsoluteX(this.endPoints[0].x));g=e(this.abs_coord?
this.endPoints[0].y:d.getAbsoluteY(this.endPoints[0].y));a.beginPath();a.moveTo(m+h,g+h);k=1;for(var c=this.endPoints.length;k<c;k++)m=e(this.abs_coord?this.endPoints[k].x:d.getAbsoluteX(this.endPoints[k].x)),g=e(this.abs_coord?this.endPoints[k].y:d.getAbsoluteY(this.endPoints[k].y)),a.lineTo(m+h,g+h);this.fill&&(a.fillStyle=v.getColor(),a.fill());this.dashStyle();a.stroke();a.setLineDash([])};a.Polygon=q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=Math.round,f=Math.min,d=Math.max,r=Math.abs,l,b,h,m,g,q,c,v,k,u,x,p,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(){l=this.evaluator;q=l.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(l.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){l=this.evaluator;b=this.space;m=e(l.eval(this.width));
a.lineWidth=0<m?m:1E-6;a.strokeStyle=h.getColor();a.lineCap="round";a.lineJoin="miter";g=0<m?.5:0;c=e(this.abs_coord?this.exprX:b.getAbsoluteX(this.exprX))+g;v=e(this.abs_coord?this.exprY:b.getAbsoluteY(this.exprY))+g;k=this.abs_coord?this.w:this.w*b.scale;u=this.abs_coord?this.h:-this.h*b.scale;x=f(d(0,l.eval(this.border_radius)),.5*r(k),.5*r(u));p=this.abs_coord?1:-1;a.beginPath();0!==x?(a.moveTo(c+x,v),a.lineTo(c+k-x,v),a.quadraticCurveTo(c+k,v,c+k,v+p*x),a.lineTo(c+k,v+u-p*x),a.quadraticCurveTo(c+
k,v+u,c+k-x,v+u),a.lineTo(c+x,v+u),a.quadraticCurveTo(c,v+u,c,v+u-p*x),a.lineTo(c,v+p*x),a.quadraticCurveTo(c,v,c+x,v),a.lineTo(c+x,v)):(a.moveTo(c,v),a.lineTo(c+k,v),a.lineTo(c+k,v+u),a.lineTo(c,v+u),a.lineTo(c,v));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 e=Math.round,f=Math.min,d=Math.max,r=Math.acos,l=Math.sqrt,b=Math.PI,h=b/2,m=2*b,g,q,c,v,k,u,x,p,n,B,w,y,A,E,J,F,H,z,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(){g=this.evaluator;q=g.eval(this.center);this.exprX=q[0][0];this.exprY=q[0][1];c=0;this.rotateExp&&(c=a.degToRad(g.eval(this.rotateExp)),v=Math.cos(c),k=Math.sin(c),u=this.exprX*v-this.exprY*k,x=this.exprX*k+this.exprY*v,this.exprX=u,this.exprY=x);var e=g.eval(this.initExpr),
z=g.eval(this.endExpr);/^(\(|\[)expr(\)|\])$/i.test(this.initExpr.type)&&/^(\(|\[)expr(\)|\])$/i.test(this.endExpr.type)?(p=e[0][0],n=e[0][1],B=z[0][0],w=z[0][1],this.vectors?this.abs_coord&&(n=-n,w=-w):this.abs_coord?(p-=this.exprX,n=-n+this.exprY,B-=this.exprX,w=-w+this.exprY):(p-=this.exprX,n-=this.exprY,B-=this.exprX,w-=this.exprY),y=0==p?0>n?3*h:h:r(1*p/l(p*p+n*n)),A=0==B?0>w?3*h:h:r(1*B/l(B*B+w*w)),y+=c,A+=c,0<p&&0<n&&this.abs_coord&&(y=m-y),0<p&&0>n&&!this.abs_coord&&(y=m-y),0>p&&0>n&&!this.abs_coord&&
(y=m-y),0>p&&0<n&&this.abs_coord&&(y=m-y),0<B&&0<w&&this.abs_coord&&(A=m-A),0<B&&0>w&&!this.abs_coord&&(A=m-A),0>B&&0>w&&!this.abs_coord&&(A=m-A),0>B&&0<w&&this.abs_coord&&(A=m-A),this.initFlag?(E=y,y=A,A=E):(E=f(y,A),J=d(y,A),y=E,A=J,A-y>b&&this.abs_coord&&(y=J,A=E),A-y<=b&&!this.abs_coord&&(y=J,A=E)),this.iniAng=y,this.endAng=A,this.drawPoints=!0):(this.iniAng=a.degToRad(e)+c,this.endAng=a.degToRad(z)+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){g=this.evaluator;F=this.space;I=g.eval(this.radius);0>I&&(I=0);M=e(g.eval(this.width));a.lineWidth=0<M?M:1E-6;a.lineCap="round";a.strokeStyle=b.getColor();this.drawAngle?(this.abs_coord?(H=e(this.exprX),z=e(this.exprY)):(H=e(F.getAbsoluteX(this.exprX)),z=e(F.getAbsoluteY(this.exprY)),I*=F.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=e(this.exprX),z=e(this.exprY)):(H=e(F.getAbsoluteX(this.exprX)),z=e(F.getAbsoluteY(this.exprY)),I*=F.scale,this.iniAng=-this.iniAng,this.endAng=-this.endAng));this.fill&&(a.fillStyle=c.getColor(),a.beginPath(),a.moveTo(H,z),a.arc(H,z,I,this.iniAng,this.endAng,void 0),a.fill());a.beginPath();a.arc(H,z,I,this.iniAng,this.endAng,void 0);this.dashStyle();a.stroke();this.text.hasContent&&this.text.draw(a,
this.color,H,z)};a.Arc=N;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,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(){e=this.evaluator;f=e.eval(this.expresion);this.exprX=f[0][0];this.exprY=f[0][1];this.rotateExp&&(d=this.rotate(f[0][0],f[0][1],a.degToRad(e.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),l=parseInt(this.exprY)):(r=parseInt(this.space.getAbsoluteX(this.exprX)),l=parseInt(this.space.getAbsoluteY(this.exprY)));this.text.draw(a,b,r,l)};a.Text=b;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=Math.round,f,d,r,l,b,h,m,g,q,c,v,k,u=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(u,a.Graphic);u.prototype.update=function(){f=this.evaluator;d=f.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(f.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((l=f.eval(this.file))||""==l)this.img=this.parent.getImage(l),this.img.addEventListener("load",function(a){c.space.update(!0)})};u.prototype.draw=function(){a.Graphic.prototype.draw.call(this)};u.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this)};
u.prototype.drawAux=function(d){f=this.evaluator;b=this.space;this.img&&this.img.ready&&this.img.complete&&(v=this.img.width,k=this.img.height,this.img.canvas&&(v=e(v/this.ratio),k=e(k/this.ratio)),h=this.centered?0:e(v/2),m=this.centered?0:e(k/2),g=e(this.abs_coord?this.exprX:b.getAbsoluteX(this.exprX)),q=e(this.abs_coord?this.exprY:b.getAbsoluteY(this.exprY)),c=a.degToRad(-f.eval(this.inirot)),d.save(),d.translate(g+h,q+m),d.rotate(c),this.opacity&&(d.globalAlpha=f.eval(this.opacity)),d.scale(this.scaleX,
this.scaleY),d.drawImage(this.img,-v/2,-k/2,v,k),d.restore())};a.Image=u;return a}(descartesJS||{});
descartesJS=function(a){function e(a,b,d){m=4*(b+d*a.width);return{r:a.data[m],g:a.data[m+1],b:a.data[m+2],a:a.data[m+3]}}if(a.loadLib)return a;var f,d,r,l,b,h,m,g,q=function(c,b){return a.Graphic.call(this,c,b)||this};$jscomp.inherits(q,a.Graphic);q.prototype.update=function(){f=this.evaluator.eval(this.expresion);this.exprX=f[0][0];this.exprY=f[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,f){f.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)){l=[[d,r]];h=e(imageData,d,r);for(g=0;0<l.length;){g++;b=l.pop();d=b[0];r=b[1];var c=e(imageData,d,r);if(h.r===c.r&&h.g===c.g&&h.b===c.b&&h.a===c.a){c=imageData;var v=
f;m=4*(d+r*c.width);c.data[m+0]=v.r;c.data[m+1]=v.g;c.data[m+2]=v.b;c.data[m+3]=255*v.a;0<d&&l.push([d-1,r]);d<imageData.width-1&&l.push([d+1,r]);l.push([d,r-1]);l.push([d,r+1])}if(g>=this.space.w*this.space.h*3)break}a.putImageData(imageData,0,0)}};a.Fill=q;return a}(descartesJS||{});
descartesJS=function(a,e){if(a.loadLib)return a;var f=new String("-text-image-point-polygon-arc-segment-arrow-macro-curve-equation-sequence-rectangle-fill-"),d=/[\w\.\-//]*(\.png|\.jpg|\.gif|\.svg)/gi,r,l=function(b,h){var m=a.Graphic.call(this,b,h)||this;m.hasExpresion=m.hasExpresion||!1;m.inirot=m.inirot||b.evaluator.parser.parse("0");m.inipos=m.inipos||b.evaluator.parser.parse("(0,0)");Object.assign(m,h);m.hasExpresion=void 0!==m.expresion;m.graphics=[];b=b.lessonParser;var g=new a.Tokenizer;if(!m.hasExpresion)return m;
"'"!==m.expresion.charAt(0)&&(m.expresion="'"+m.expresion+"'");m.expresion=m.evaluator.parser.parse(m.expresion);h=m.evaluator.eval(m.expresion);if(h)var l=(l=document.getElementById(h))&&"descartes/macro"==l.type?l.text:a.openExternalFile(h);if(l){var c=a.convertHTMLEntities(l).replace(/\r/g,"").split("\n");l=[];h=0;for(var v=c.length;h<v;h++)if(c[h].trim()){var k=c[h].indexOf("=");if(-1!==k){k=b.split(c[h]);for(var u=0,x=k.length;u<x;u++)if(k[u]&&1<k.length&&("id"===e[k[u][0]]||"type"===e[k[u][0]])){l.push(k);
break}}}u=function(c,b){b=g.tokenize(b.replace(/&squot;/g,"'"));for(var d=0,n=b.length;d<n;d++)"identifier"!=b[d].type||a.reservedIds.match("-"+b[d].value+"-")||(b[d].value=m.name+"."+b[d].value);return(c.match(/^\\expr/)?"\\expr ":"\\decimals ")+g.flatTokens(b)};h=0;for(v=l.length;h<v;h++){var p=(x=l[h]||[],x[0])&&"id"===x[0][0];c=0;for(k=x.length;c<k;c++){var n=x[c][0].indexOf(".");-1===n||p?n=e[x[c][0]]:(n=e[x[c][0].substring(n+1)],x[c][0]=m.name+"."+x[c][0]);if(!("font"===n||"font_family"===n||
("fill"===n||"color"===n||"border"===n||"arrow"===n)&&"("!==x[c][1].charAt(0)||"file"===n&&x[c][1].match(d)||"id"!==n&&void 0!==e[x[c][1]])||"radius"===n)if("text"==n)if(x[c][1].match(/\{\\rtf1/))n=x[c][1],n=n.replace(/\\expr ([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,u),n=n.replace(/\\decimals ([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,u),x[c][1]=n;else{var r=b.parseText(x[c][1]).textElementsMacros;for(var w=0,y=r.length;w<y;w++){n=g.tokenize(r[w].replace(/&squot;/g,"'"));for(var A=
0,E=n.length;A<E;A++)"identifier"!==n[A].type||a.reservedIds.match("-"+n[A].value+"-")||(n[A].value=m.name+"."+n[A].value);n=g.flatTokens(n).replace(/&squot;/g,"'").replace(/'\+\(/g,"[").replace(/\)\+'/g,"]");r[w]=n.substring(1,n.length-1)}x[c][1]=r.join("")}else{r=x[c][1].replace(/&squot;/g,"'").split(";");w=0;for(y=r.length;w<y;w++){n=g.tokenize(r[w].replace(/\\n/g,";"));A=0;for(E=n.length;A<E;A++)"identifier"!==n[A].type||a.reservedIds.match("-"+n[A].value+"-")||(n[A].value=m.name+"."+n[A].value);
r[w]=g.flatTokens(n)}x[c][1]=r.join(";")}}}h=0;for(v=l.length;h<v;h++)if(l[h][0]){u="";x=!1;c=0;for(k=l[h].length;c<k;c++)"type"===e[l[h][c][0]]&&f.match("-"+e[l[h][c][1]]+"-")&&(x=!0),u=u+l[h][c][0]+"='"+l[h][c][1]+"' ";l[h]=u+(x?" space='"+m.spaceID+"'":"");x?m.graphics.push(b.parseGraphic(l[h],m.abs_coord,m.background,m.inirot)):b.parseAuxiliar(l[h])}}return m};$jscomp.inherits(l,a.Graphic);l.prototype.update=function(){r=this.evaluator.eval(this.inipos);this.iniPosX=r[0][0];this.iniPosY=r[0][1]};
l.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=l;return a}(descartesJS||{},babel);
descartesJS=function(a){if(a.loadLib)return a;var e=Math.sqrt,f=Math.sin,d=Math.cos,r=Math.abs,l,b,h,m,g,q,c,v,k,u,x,p,n,B,w,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 A=function(a,c,b,d,g,n,k,f,e,m,h,l,p,v,q,x){this.a00=a||0;this.a01=c||0;this.a02=b||0;this.a03=d||0;this.a10=g||0;this.a11=n||0;this.a12=k||0;this.a13=f||0;
this.a20=e||0;this.a21=m||0;this.a22=h||0;this.a23=l||0;this.a30=p||0;this.a31=v||0;this.a32=q||0;this.a33=x||0};A.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};A.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)};A.prototype.translate=function(a){return new A(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)};A.prototype.rotateX=function(a){b=f(a);h=d(a);v=this.a10;k=this.a11;u=this.a12;
x=this.a13;p=this.a20;n=this.a21;B=this.a22;w=this.a23;return new A(this.a00,this.a01,this.a02,this.a03,v*h+p*b,k*h+n*b,u*h+B*b,x*h+w*b,v*-b+p*h,k*-b+n*h,u*-b+B*h,x*-b+w*h,this.a30,this.a31,this.a32,this.a33)};A.prototype.rotateY=function(a){b=f(a);h=d(a);m=this.a00;g=this.a01;q=this.a02;c=this.a03;p=this.a20;n=this.a21;B=this.a22;w=this.a23;return new A(m*h+p*-b,g*h+n*-b,q*h+B*-b,c*h+w*-b,this.a10,this.a11,this.a12,this.a13,m*b+p*h,g*b+n*h,q*b+B*h,c*b+w*h,this.a30,this.a31,this.a32,this.a33)};A.prototype.rotateZ=
function(a){b=f(a);h=d(a);m=this.a00;g=this.a01;q=this.a02;c=this.a03;v=this.a10;k=this.a11;u=this.a12;x=this.a13;return new A(m*h+v*b,g*h+k*b,q*h+u*b,c*h+x*b,m*-b+v*h,g*-b+k*h,q*-b+u*h,c*-b+x*h,this.a20,this.a21,this.a22,this.a23,this.a30,this.a31,this.a32,this.a33)};a.norm3D=function(a){return e(a.x*a.x+a.y*a.y+a.z*a.z)};a.normalize3D=function(c){l=a.norm3D(c);if(0===l)return{x:0,y:0,z:0};if(1===l)return{x:c.x,y:c.y,z:c.z};l=1/l;return{x:c.x*l,y:c.y*l,z:c.z*l}};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=A;return a}(descartesJS||{});
descartesJS=function(a){function e(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 f(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(u=this.projVert.length;k<u;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 l(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",m,g,q,c,v,k,u,x,p,n,B,w,y,A=function(a,c){Object.assign(this,a);this.space=c;this.projVert=[];this.spaceVertices=[];this.newProjVert=[];this.newSpaceVert=[];"vertex"===this.type?this.draw=e:"face"===this.type?(this.normal=l(this.vertices[0],this.vertices[1],this.vertices[2]),this.draw=f):"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]})};A.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(u=this.vertices.length;k<u;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/u);this.average_proy=c.project(this.average);this.depth=a.norm3D(a.subtract3D(c.eye,this.average));2<this.vertices.length&&(this.normal=l(this.spaceVertices[0],this.spaceVertices[1],this.spaceVertices[2]));k=0;for(u=this.vertices.length;k<u;k++)this.newSpaceVert[k]=this.spaceVertices[k],this.projVert[k]=this.newProjVert[k]=c.project(this.spaceVertices[k]);2<this.vertices.length&&(this.direction=l(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(u=this.vertices.length;k<u;k++)x=a.norm3D(a.subtract3D(this.spaceVertices[k],c.eye)),this.minDistanceToEye=Math.min(this.minDistanceToEye,x),this.maxDistanceToEye=Math.max(this.maxDistanceToEye,x);k=0;for(u=this.vertices.length;k<u;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)};A.prototype.removeDoubles=function(){if("edge"!==this.type){v=[];k=0;for(u=this.vertices.length;k<u;k++)(1E-8<Math.abs(this.vertices[k].x-this.vertices[(k+1)%u].x)||1E-8<Math.abs(this.vertices[k].y-this.vertices[(k+1)%u].y)||1E-8<Math.abs(this.vertices[k].z-this.vertices[(k+1)%u].z)||1E-8<Math.abs(this.vertices[k].w-this.vertices[(k+1)%u].w))&&v.push(this.vertices[k]);0===v.length&&v.push(this.vertices[0]);this.vertices=v}};A.prototype.drawText=
function(c,b,d,n,k,f,e,h,l,p,v){m=this.evaluator;c.textNode=b;f=m.eval(this.offset_dist);e=-a.degToRad(m.eval(this.offset_angle));d+=f*Math.cos(e);n+=f*Math.sin(e);c.textNode.pos={x:d,y:n};b.hasContent&&(b.draw(c,k,d,n,!0),q=this.fromPoint?b.textNodes.metrics.w/2:0,g=this.fromPoint?b.textNodes.metrics.h/2:0,b.draw(c,k,d-q,n-g))};A.prototype.splitFace=function(c){if(this.intersects(c)){var b=i2=null,d=ix2=0,g,n;var k=this.vertices;var f=c.vertices;var e=0;for(n=f.length;e<n;e++){var m=this.intersection(f[e],
f[(e+1)%n]);if(null!==m)if(null===b){if(b=m,d=e,2===f.length){i2=b;break}}else if(!a.equals3DEpsilon(m,b,1E-8)){i2=m;ix2=e;break}}if(null!==b&&null!==i2){e=this.isInterior(b)||this.isInterior(i2);var h=g=null;if(!e&&3<=f.length)for(n=0,k=k.length;n<k;n++)if(m=c.intersection(this.vertices[n],this.vertices[(n+1)%k]),null!==m)if(null===g)g=m;else if(!a.equals3DEpsilon(m,g,1E-8)){h=m;break}if(e||null!==g&&null!==h&&c.isInterior(g)&&c.isInterior(h)){h=!0;k=m=null;if(2===f.length)a.equals3DEpsilon(b,f[0],
1E-8)||a.equals3DEpsilon(b,f[1],1E-8)?h=!1:(m=[],m[0]=f[0],m[1]=b,k=[],k[0]=b,k[1]=f[1]);else for(m=[],k=[],e=n=g=0;e<f.length;e++)e<d?m[g++]=f[e]:e==d?(m[g++]=f[e],m[g++]=b,k[n++]=b):e<ix2?k[n++]=f[e]:e==ix2?(k[n++]=f[e],k[n++]=i2,m[g++]=i2):m[g++]=f[e];if(h){b=[];b[0]=new A({vertices:m,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 A({vertices:k,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]};A.prototype.intersects=function(a){return this.intersectsPlane(a)&&a.intersectsPlane(this)};A.prototype.intersectsPlane=function(c){var b=this.vertices;var d=c.vertices;if(0<b.length){var g=a.dotProduct3D(d[0],c.normal);var n=a.dotProduct3D(b[0],c.normal);if(1E-8>Math.abs(g-n))return!0;for(var f=1,k=
b.length;f<k;f++)if(d=a.dotProduct3D(b[f],c.normal),1E-8>Math.abs(g-d)||d>g&&n<g||d<g&&n>g)return!0}return!1};A.prototype.intersection=function(c,b){var d=this.vertices;if(0<d.length){b=a.subtract3D(b,c);var g=a.dotProduct3D(b,this.normal);if(0!==g&&(d=a.dotProduct3D(a.subtract3D(d[0],c),this.normal)/g,-1E-8<d&&1.00000001>d))return a.add3D(c,a.scalarProduct3D(b,d))}return null};A.prototype.isInterior=function(c){var b=this.vertices;if(0<b.length)for(var d=0,g=a.subtract3D(b[0],c),n=0,f=b.length;n<
f;n++){var k=a.subtract3D(b[(n+1)%f],c),e=a.dotProduct3D(a.crossProduct3D(g,k),this.normal);if(1E-8>Math.abs(e)){if(0>a.dotProduct3D(g,k))break}else{if(0>d&&0<e||0<d&&0>e)return!1;g=k;d=e}}return!0};A.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(w=0;3>w;w++)if(p=null,p=0===w?this.intersections(c):1===w?c.verticesContainedIn(this):this.verticesContainedIn(c),null!=p&&0<p.length){for(y=
0;y<p.length;y++)a.push(p[y]);k=0;for(u=p.length;k<u;k++){n=p[k];B=this.space.rayFromEye(n.x,n.y);try{t=this.distanceToEyeAlong(B)-c.distanceToEyeAlong(B);if(t<=-b)return!0;if(t>=b)return!1}catch(H){}}}return!1};A.prototype.intersections=function(c){for(var b=[],d,g,n,f=new a.R2,k=this.newSpaceVert,e=c.newSpaceVert,m=this.newProjVert,h=c.newProjVert,l=0,p=k.length;l<p;l++){c=k[l];d=k[(l+1)%p];for(var v=0,q=e.length;v<q;v++)g=e[v],n=e[(v+1)%q],c!=g&&c!=n&&d!=g&&d!=n&&(g=f.intersection(m[l],m[(l+1)%
p],h[v],h[(v+1)%q]),null!=g&&b.push(g))}return b};A.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");};A.prototype.verticesContainedIn=function(a){for(var c=[],b=this.newSpaceVert,d=this.newProjVert,g=0,n=b.length;g<n;g++)!a.isVertex(b[g])&&a.appearsToContain(d[g])&&c.push(d[g]);return c};A.prototype.appearsToContain=function(a){for(var c=
0,b,d=this.newProjVert,g=0,n=this.newSpaceVert.length;g<n;g++){b=(d[g].x-a.x)*(d[(g+1)%n].y-a.y)-(d[(g+1)%n].x-a.x)*(d[g].y-a.y);if(0!=c)if(1E-8>Math.abs(b)){if(1E-8<Math.abs(d[g].x-d[(g+1)%n].x))return Math.min(d[g].x,d[(g+1)%n].x)<=a.x+1E-8&&a.x<=Math.max(d[g].x,d[(g+1)%n].x)+1E-8;if(1E-8<Math.abs(d[g].y-d[(g+1)%n].y))return Math.min(d[g].y,d[(g+1)%n].y)<=a.y+1E-8&&a.y<=Math.max(d[g].y,d[(g+1)%n].y)+1E-8}else if(0<c&&0>b||0>c&&0<b)return!1;c=b}return!0};A.prototype.isVertex=function(c){for(var b=
this.newSpaceVert,d=0,g=b.length;d<g;d++)if(a.equals3DEpsilon(c,b[d],1E-8))return!0;return!1};a.Primitive3D=A;return a}(descartesJS||{});
descartesJS=function(a){function e(a){for(var c=[],b=0,d,g=a.length,f=a.length-1;-1<f;f--)d=a.charAt(f),0==b?"="==d&&(b=1):1==b?" "!=d&&(b="<"===d||">"===d?0:2):2==b&&" "==d&&(c.unshift(a.substring(f+1,g)),g=f,b=0);c.unshift(a.substring(0,g));return c}if(a.loadLib)return a;var f={x:0,y:0,z:0},d,r,l,b,h,m=a.degToRad,g,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();l=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,l)};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(m(b[0][0])),this.inirotM=
this.inirotM.rotateX(m(b[0][1])),this.inirotM=this.inirotM.rotateZ(m(b[0][2]))):(this.inirotM_X=this.inirotM_X.setIdentity().rotateX(m(b[0][0])),this.inirotM_Y=this.inirotM_Y.setIdentity().rotateY(m(b[0][1])),this.inirotM_Z=this.inirotM_Z.setIdentity().rotateZ(m(b[0][2])));b=this.evaluator.eval(this.inipos);f={x:b[0][0],y:b[0][1],z:b[0][2]};this.iniposM=this.iniposM.setIdentity().translate(f);b=this.evaluator.eval(this.endrot);this.endrotEuler?(this.endrotM=this.endrotM.setIdentity(),this.endrotM=
this.endrotM.rotateZ(m(b[0][0])),this.endrotM=this.endrotM.rotateX(m(b[0][1])),this.endrotM=this.endrotM.rotateZ(m(b[0][2]))):(this.endrotM_X=this.endrotM_X.setIdentity().rotateX(m(b[0][0])),this.endrotM_Y=this.endrotM_Y.setIdentity().rotateY(m(b[0][1])),this.endrotM_Z=this.endrotM_Z.setIdentity().rotateZ(m(b[0][2])));b=this.evaluator.eval(this.endpos);f={x:b[0][0],y:b[0][1],z:b[0][2]};this.endposM=this.endposM.setIdentity().translate(f)};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(e(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(g=[],"face"===this.primitives[c].type){for(var d=0,f=a.primitives.length;d<f;d++)"face"===a.primitives[d].type?g=g.concat(this.primitives[c].splitFace(a.primitives[d])):g.push(a.primitives[d]);a.primitives=g}};a.Graphic3D=q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b=function(b,d){return a.Graphic3D.call(this,b,d)||this};$jscomp.inherits(b,a.Graphic3D);b.prototype.buildPrimitives=function(){e=this.evaluator;this.updateMVMatrix();f=e.eval(this.expresion);d=f[0][0];r=f[0][1];l=f[0][2];this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(d,r,l,1))],type:"vertex",backColor:this.backcolor.getColor(),frontColor:this.color.getColor(),size:e.eval(this.width)}));""!==this.text&&
(this.offset_dist=this.offset_dist||e.parser.parse("10"),this.offset_angle=this.offset_angle||e.parser.parse("270"),this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(d,r,l,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:e.eval(this.decimals),fixed:this.fixed,evaluator:e,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 e,f,d,r,l,b,h,m,g,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(){m=this.evaluator;this.updateMVMatrix();h=m.getVariable("u");m.setVariable("u",this.Nu);g=m.eval(this.expresion);e=g[0][0];f=g[0][1];d=g[0][2];r=g[1][0];l=g[1][1];b=g[1][2];this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(e,
f,d,1)),this.transformVertex(new a.Vector4D(r,l,b,1))],type:"edge",lineDash:this.lineDash,frontColor:this.color.getColor(),lineWidth:m.eval(this.width)},this.space));m.setVariable("u",h)};a.Segment3D=q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b,h,m,g,q,c,v,k,u,x=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(x,a.Graphic3D);x.prototype.buildPrimitives=function(){e=this.evaluator;this.updateMVMatrix();r=e.getVariable("x");l=e.getVariable("y");b=e.getVariable("z");
f=e.getVariable("u");d=e.getVariable("v");e.setVariable("u",0);e.setVariable("v",0);h=parseInt(e.eval(this.Nu));m=parseInt(e.eval(this.Nv));g=[];for(c=0;c<=h;c++)for(e.setVariable("u",c/h),v=0;v<=m;v++){e.setVariable("v",v/m);k=0;for(u=this.expresion.length;k<u;k++)e.eval(this.expresion[k]);g.push(this.transformVertex(new a.Vector4D(e.getVariable("x"),e.getVariable("y"),e.getVariable("z"),1)))}var p=this.color.getColor(),n=this.backcolor.getColor(),x=this.edges?this.edges.getColor():"";for(c=0;c<
h;c++)for(v=0;v<m;v++)q=[],q.push(g[v+c*m+c]),q.push(g[v+1+c*m+c]),q.push(g[v+2+(c+1)*m+c]),q.push(g[v+1+(c+1)*m+c]),this.primitives.push(new a.Primitive3D({vertices:q,type:"face",frontColor:p,backColor:n,edges:x,model:this.model},this.space));e.setVariable("x",r);e.setVariable("y",l);e.setVariable("z",b);e.setVariable("u",f);e.setVariable("v",d)};a.Surface3D=x;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b,h,m,g=function(b,c){c=a.Graphic3D.call(this,b,c)||this;c.width=c.width||b.evaluator.parser.parse("1");return c};$jscomp.inherits(g,a.Graphic3D);g.prototype.buildPrimitives=function(){h=this.evaluator;this.updateMVMatrix();m=h.eval(this.expresion);for(var g=this.color.getColor(),c=0,v=m.length-1;c<v;c++)e=m[c][0],f=m[c][1],d=m[c][2],r=m[c+1][0],l=m[c+1][1],b=m[c+1][2],this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(e,
f,d,1)),this.transformVertex(new a.Vector4D(r,l,b,1))],type:"edge",frontColor:g,lineWidth:h.eval(this.width)},this.space))};a.Polygon3D=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b,h,m=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(m,a.Graphic3D);m.prototype.buildPrimitives=function(){h=this.evaluator;this.updateMVMatrix();r=h.getVariable("x");l=h.getVariable("y");b=h.getVariable("z");d=h.getVariable("u");h.setVariable("u",0);f=h.eval(this.Nu);e=[];for(var g=0;g<=f;g++){h.setVariable("u",g/f);for(var m=0,c=
this.expresion.length;m<c;m++)h.eval(this.expresion[m]);e.push(this.transformVertex(new a.Vector4D(h.getVariable("x"),h.getVariable("y"),h.getVariable("z"),1)))}g=0;for(m=e.length-1;g<m;g++)this.primitives.push(new a.Primitive3D({vertices:[e[g],e[g+1]],type:"edge",frontColor:this.color.getColor(),lineWidth:h.eval(this.width)},this.space));this.fill&&2<e.length&&this.primitives.push(new a.Primitive3D({vertices:e,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",l);h.setVariable("u",d)};a.Curve3D=m;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b,h,m,g,q,c,v=function(c,b){return a.Graphic3D.call(this,c,b)||this};$jscomp.inherits(v,a.Graphic3D);v.prototype.buildPrimitives=function(){q=this.evaluator;this.updateMVMatrix();c=q.eval(this.expresion);e=c[0][0];f=c[0][1];d=c[0][2];r=c[1][0];l=c[1][1];b=c[1][2];h=c[2][0];m=c[2][1];g=c[2][2];var k=this.edges?this.edges.getColor():"";this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(e,f,d,1)),this.transformVertex(new a.Vector4D(h,
m,g,1)),this.transformVertex(new a.Vector4D(r,l,b,1))],type:"face",frontColor:this.color.getColor(),backColor:this.backcolor.getColor(),edges:k,model:this.model},this.space))};a.Triangle3D=v;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r=function(d,b){return a.Graphic3D.call(this,d,b)||this};$jscomp.inherits(r,a.Graphic3D);r.prototype.buildPrimitives=function(){f=this.evaluator;this.updateMVMatrix();d=f.eval(this.expresion);e=[];for(var l=d.length-1;0<=l;l--)e.push(this.transformVertex(new a.Vector4D(d[l][0],d[l][1],d[l][2],1)));l=this.edges?this.edges.getColor():"";this.primitives.push(new a.Primitive3D({vertices:e,type:"face",frontColor:this.color.getColor(),backColor:this.backcolor.getColor(),
edges:l,model:this.model},this.space))};a.Face3D=r;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,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();e=b.eval(this.Nu);f=[this.transformVertex(new a.Vector4D(0,0,0,1))];d=b.eval(this.width)/2;r=b.eval(this.length)/2;l=2*Math.PI/e;for(var m=0;m<e;m++)f.push(this.transformVertex(new a.Vector4D(d*
Math.cos(l*m),r*Math.sin(l*m),0,1)));var g=this.color.getColor(),h=this.backcolor.getColor(),c=this.edges?this.edges.getColor():"";for(m=0;m<e;m++)this.primitives.push(new a.Primitive3D({vertices:[f[0],m+2<=e?f[m+2]:f[1],f[m+1]],type:"face",frontColor:g,backColor:h,edges:c,model:this.model},this.space))};a.Polireg3D=h;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l=function(b,d){return a.Graphic3D.call(this,b,d)||this};$jscomp.inherits(l,a.Graphic3D);l.prototype.buildPrimitives=function(){e=this.evaluator;f=e.eval(this.expresion);d=f[0][0];r=f[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:e.eval(this.decimals),fixed:this.fixed,displace:0,
isText:!0,evaluator:e,text:new a.TextObject(this,this.text),family:this.family,familyValue:this.familyValue},this.space))};a.Text3D=l;return a}(descartesJS||{});
descartesJS=function(a,e){if(a.loadLib)return a;var f=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,l,b=0,h=function(m,g){var h=a.Graphic.call(this,m,g)||this;h.expresion=h.expresion||void 0;h.inirot=h.inirot||"(0,0,0)";h.inirotEuler=h.inirotEuler||!1;h.inipos=h.inipos||m.evaluator.parser.parse("(0,0,0)");h.endrot=h.endrot||
"(0,0,0)";h.endrotEuler=h.endrotEuler||!1;h.endpos=h.endpos||m.evaluator.parser.parse("(0,0,0)");h.name=h.name||"_descartes_empty_name_"+b++;Object.assign(h,g);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=[];m=m.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);g=h.evaluator.eval(h.expresion);if(g)var l=(l=document.getElementById(g))&&"descartes/macro"==l.type?l.text:a.openExternalFile(g);
if(l){var k=a.convertHTMLEntities(l).replace(/\r/g,"").split("\n");l=[];g=0;for(var u=k.length;g<u;g++){var x=k[g].indexOf("=");if(-1!==x){x=m.split(k[g]);for(var p=0,n=x.length;p<n;p++)if(x[p]&&1<x.length&&("id"===e[x[p][0]]||"type"===e[x[p][0]])){l.push(x);break}}}g=0;for(u=l.length;g<u;g++){n=(p=l[g]||[],p[0])&&"id"===p[0][0];var r=!1;k=0;for(x=p.length;k<x;k++){var w=p[k][0].indexOf(".");-1===w||n?w=e[p[k][0]]:(w=e[p[k][0].substring(w+1)],p[k][0]=h.name+"."+p[k][0]);"type"===w&&"surface"===e[p[k][1]]&&
(r=!0);if(!("font"===w||"font_family"===w||("fill"===w||"color"===w||"backcolor"===w||"arrow"===w)&&"("!==p[k][1].charAt(0)||"file"===w&&p[k][1].match(d)||"id"!==w&&void 0!==e[p[k][1]]||r&&"expresion"===w)||"width"===w||"height"===w||"length"===w)if("text"==w)if(p[k][1].match(/\{\\rtf1/)){w=p[k][1];var y=h;var A=function(b,d){d=c.tokenize(d.replace(/&squot;/g,"'"));for(var g=0,n=d.length;g<n;g++)"identifier"!=d[g].type||a.reservedIds.match("-"+d[g].value+"-")||(d[g].value=y.name+"."+d[g].value);return(b.match(/^\\expr/)?
"\\expr ":"\\decimals ")+c.flatTokens(d)};w=w.replace(/\\expr ([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,A);w=w.replace(/\\decimals ([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,A);p[k][1]=w}else{A=m.parseText(p[k][1]).textElementsMacros;for(var E=0,J=A.length;E<J;E++){w=c.tokenize(A[E].replace(/&squot;/g,"'"));for(var F=0,H=w.length;F<H;F++)"identifier"!==w[F].type||a.reservedIds.match("-"+w[F].value+"-")||(w[F].value=h.name+"."+w[F].value);w=c.flatTokens(w).replace(/&squot;/g,"'").replace(/'\+\(/g,
"[").replace(/\)\+'/g,"]");A[E]=w.substring(1,w.length-1)}p[k][1]=A.join("")}else{A=p[k][1].replace(/&squot;/g,"'").split(";");E=0;for(J=A.length;E<J;E++){w=c.tokenize(A[E].replace(/\\n/g,";"));F=0;for(H=w.length;F<H;F++)"identifier"!==w[F].type||a.reservedIds.match("-"+w[F].value+"-")||(w[F].value=h.name+"."+w[F].value);A[E]=c.flatTokens(w)}p[k][1]=A.join(";")}}}g=0;for(u=l.length;g<u;g++)if(l[g][0]){p="";n=!1;k=0;for(x=l[g].length;k<x;k++)"type"===e[l[g][k][0]]&&f.match("-"+e[l[g][k][1]]+"-")&&
(n=!0),p=p+l[g][k][0]+"='"+l[g][k][1]+"' ";l[g]=p+(n?" space='"+h.spaceID+"'":"");n?h.graphics.push(m.parse3DGraphic(l[g],h.abs_coord,h.background,h.inirot)):m.parseAuxiliar(l[g])}}g=0;for(u=h.graphics.length;g<u;g++)h.graphics[g].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++)l=this.graphics[d],(l.split||this.split)&&r.splitFace(l);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 e(a,c,b,d,g){f.call(this,a/p,a/p,a/p,d,g)}function f(a,c,b,d,g){a/=2;c/=2;b/=2;this.changeGeometry(a,c,b,d,g)||(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,g))}function d(a,c,b,d,g){a/=2;if(!this.changeGeometry(a,c,b,d,g)){var f=2*Math.PI/3,k=2*a*Math.sqrt(2)/3,e=-a/
3,h=k*Math.cos(f)+0*Math.sin(f);f=-k*Math.sin(f)+0*Math.cos(f);this.vertices=[new n(0,0,a,1),new n(h,f,e,1),new n(h,-f,e,1),new n(k,0,e,1)];this.faces=[[1,3,2],[0,1,2],[0,2,3],[0,3,1]];this.updateValues(a,c,b,d,g)}}function r(a,c,b,d,g){a/=2;this.changeGeometry(a,c,b,d,g)||(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,g))}function l(c,
b,d,g,f){c/=Math.PI;if(!this.changeGeometry(c,b,d,g,f)){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(-u/6);G=0;for(D=this.vertices.length;G<
D;G++)this.vertices[G]=M.multiplyVector4(this.vertices[G]);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,g,f)}}function b(c,b,d,g,f){c/=3.8;if(!this.changeGeometry(c,b,d,g,f)){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);G=0;for(D=this.vertices.length;G<D;G++)this.vertices[G]=M.multiplyVector4(this.vertices[G]);this.updateValues(c,b,d,g,f)}}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(G=1;G<d;G++)for(F=G*u/d,K=0;K<g;K++)J=K*x/g,y=a*v(F)*k(J),A=b*v(F)*v(J),E=c*k(F),this.vertices.push(new n(y,A,E,1));this.vertices.push(new n(0,0,-c,1));this.faces=[];for(G=0;G<g;G++)this.faces.push([0,(G+1)%g+1,G%g+1]);for(G=1;G<d-1;G++)for(K=0;K<g;K++)this.faces.push([K+1+(G-1)*g,(K+1)%g+1+(G-1)*g,(K+1)%g+1+G*g,K+1+G*g]);for(G=0;G<g;G++)this.faces.push([this.vertices.length-1,this.vertices.length-1-g+G,this.vertices.length-1-g+(G+1)%g]);this.updateValues(a,
c,b,d,g)}}function m(a,c,b,d,g){a/=2;c/=2;b/=2;if(!this.changeGeometry(a,c,b,d,g)){this.vertices=[];for(G=0;G<g;G++)for(K=0;K<d;K++)y=a*(g-G)/g*k(K*x/d),A=b*(g-G)/g*v(K*x/d),E=c-2*G*c/g,this.vertices.push(new n(y,A,E,1));this.vertices.push(new n(0,0,-c,1));this.faces=[];for(G=0;G<g-1;G++)for(K=0;K<d;K++)this.faces.push([K+G*d,(K+1)%d+G*d,(K+1)%d+(G+1)*d,K+(G+1)*d]);for(G=0;G<d;G++)this.faces.push([this.vertices.length-1,this.vertices.length-1-d+G,this.vertices.length-1-d+(G+1)%d]);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(G=0;G<g+1;G++)for(K=0;K<d;K++)y=a*k(K*x/d),A=b*v(K*x/d),E=c-2*G*c/g,this.vertices.push(new n(y,A,E,1));this.faces=[];for(G=0;G<g;G++)for(K=0;K<d;K++)this.faces.push([K+G*d,(K+1)%d+G*d,(K+1)%d+(G+1)*d,K+(G+1)*d]);this.updateValues(a,c,b,d,g)}}function q(a,c,b,d,g){a/=2;c/=2;b/=2;H=B.eval(this.R);z=B.eval(this.r);if(!this.changeGeometry(a,c,b,d,g)){this.vertices=[];for(G=0;G<g+1;G++)for(K=0;K<d;K++)y=
-(H+z*v(x*K/d))*v(x*G/g),A=(H+z*v(x*K/d))*k(x*G/g),E=z*k(x*K/d),this.vertices.push(new n(y,A,E,1));this.faces=[];for(G=0;G<g;G++)for(K=0;K<d;K++)this.faces.push([K+G*d,K+(G+1)*d,(K+1)%d+(G+1)*d,(K+1)%d+G*d]);this.updateValues(a,c,b,d,g)}}function c(){this.vertices=[];this.faces=[];G=0;for(D=this.fileData.length;G<D;G++)N=this.fileData[G],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 v=Math.sin,k=Math.cos,u=Math.PI,x=2*u,p=Math.sqrt(3),n,B,w,y,A,E,J,F,H,z,I,C,M,N,O,G,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=
e;break;case "box":p.buildGeometry=f;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=l;break;case "icosahedron":p.buildGeometry=b;break;case "cone":p.buildGeometry=m;break;case "cylinder":p.buildGeometry=g;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(){B=this.evaluator;this.updateMVMatrix();this.buildGeometry(B.eval(this.width),B.eval(this.height),B.eval(this.length),B.eval(this.Nu),B.eval(this.Nv));var c=this.color.getColor(),b=this.backcolor.getColor(),d=this.edges?this.edges.getColor():"";G=0;for(D=this.faces.length;G<D;G++){w=[];K=0;for(L=this.faces[G].length;K<L;K++)w.push(this.transformVertex(this.vertices[this.faces[G][K]]));this.primitives.push(new a.Primitive3D({vertices:w,
type:"face",frontColor:c,backColor:b,edges:d,model:this.model},this.space))}};P.prototype.changeGeometry=function(a,c,b,d,g){return this.oldWidth===a&&this.oldHeight===c&&this.oldLength===b&&this.oldNu===d&&this.oldNv===g};P.prototype.updateValues=function(a,c,b,d,g){this.oldWidth=a;this.oldHeight=c;this.oldLength=b;this.oldNv=g;this.oldNu=d};a.OtherGeometry3D=P;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=Math.max,f=Math.min,d=Math.PI,r=Math.cos,l=Math.sin,b=Math.abs,h=Math.round,m,g,q,c,v,k,u,x,p,n,B,w,y,A,E,J,F,H,z=function(a,c){this.x=void 0===a?0:a;this.y=void 0===c?0:c};z.prototype.set=function(a,c){this.x=void 0===a?0:a;this.y=void 0===c?0:c;return this};z.prototype.copy=function(){return new z(this.x,this.y)};z.prototype.ix=function(){return h(e(f(this.x,32E3),-32E3))};z.prototype.iy=function(){return h(e(f(this.y,32E3),-32E3))};z.prototype.equals=
function(a){return this.x===a.x&&this.y===a.y};z.prototype.norm2=function(){return this.x*this.x+this.y*this.y};z.prototype.norm=function(){return Math.sqrt(this.norm2())};z.prototype.distance=function(a){g=this.copy();g.sub(a);return g.norm()};z.prototype.dot=function(a){return this.x*a.x+this.y*a.y};z.prototype.det=function(a){return this.x*a.y-this.y*a.x};z.prototype.mul=function(a){this.x*=a;this.y*=a};z.prototype.div=function(a){this.x/=a;this.y/=a};z.prototype.add=function(a){this.x+=a.x;this.y+=
a.y};z.prototype.sub=function(a){this.x-=a.x;this.y-=a.y};z.prototype.normalize=function(){m=this.norm();0!=m&&this.div(m)};z.prototype.rotR90=function(){m=this.x;this.x=this.y;this.y=-m};z.prototype.rotL90=function(){m=this.x;this.x=-this.y;this.y=m};z.prototype.rot=function(a){q=this.copy();k=r(a);u=l(a);this.x=q.x*k-q.y*u;this.y=q.x*u+q.y*k};z.prototype.rot2=function(a){this.rot(a*d/180)};z.prototype.intersection=function(a,d,g,k){x=d.x-a.x;p=g.x-k.x;n=g.x-a.x;B=d.y-a.y;w=g.y-k.y;y=g.y-a.y;H=x*
w-p*B;return 1E-6<b(H)?(c=(n*w-y*p)/H,v=(-n*B+y*x)/H,0<=c&&1>=c&&0<=v&&1>=v?new z(a.x+x*c,a.y+B*c):null):(d.x-g.x)*y!=(d.y-g.y)*n?null:a.x!=d.x?(A=f(a.x,d.x),E=e(a.x,d.x),A<=g.x&&g.x<=E?g:A<=k.x&&k.x<=E?k:null):g.x!=k.x?(J=f(g.x,k.x),F=e(g.x,k.x),J<=a.x&&a.x<=F?a:J<=d.x&&d.x<=F?d:null):a.y!=d.y?(A=f(a.y,d.y),E=e(a.y,d.y),A<=g.y&&g.y<=E?g:A<=k.y&&k.y<=E?k:null):g.y!=k.y?(J=f(g.y,k.y),F=e(g.y,k.y),J<=a.y&&a.y<=F?a:J<=d.y&&d.y<=F?d:null):a.x==g.x&&a.y==g.y?a:null};a.R2=z;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b,h,m,g,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);l=new a.R2(0,0);g=new a.R2(0,0)};q.prototype.getUnitNormal=function(){this.normal.normalize();return g.set(this.normal.x,this.normal.y)};q.prototype.gradient=function(a){e=this.evaluator;b.x=0;b.y=0;h=e.getVariable("x");m=e.getVariable("y");e.setVariable("x",a.x);e.setVariable("y",a.y);this.f0=e.eval(this.constraint);e.setVariable("x",e.getVariable("x")+1E-6);f=e.eval(this.constraint);b.x=(f-this.f0)/1E-6;b.x=isNaN(b.x)?Infinity:b.x;e.setVariable("x",e.getVariable("x")-1E-6);e.setVariable("y",
e.getVariable("y")+1E-6);f=e.eval(this.constraint);b.y=(f-this.f0)/1E-6;b.y=isNaN(b.y)?Infinity:b.y;e.setVariable("x",h);e.setVariable("y",m);return b};q.prototype.findZero=function(a,b,g){e=this.evaluator;l.x=a.x;l.y=a.y;h=e.getVariable("x");m=e.getVariable("y");e.setVariable("x",a.x);e.setVariable("y",a.y);this.f0=e.eval(this.constraint);if("menor"===this.sign&&0>=this.f0||"mayor"===this.sign&&0<=this.f0)return l;e.setVariable("x",h);e.setVariable("y",m);for(var c=0;16>c;c++)if(d=l.x,r=l.y,this.normal=
this.gradient(l),0!=this.normal.norm2()&&this.normal.mul(-this.f0/this.normal.norm2()),l.x=d+this.normal.x,l.y=r+this.normal.y,this.normal.norm()<b)return 0===this.normal.x&&0===this.normal.y&&(this.normal.x=l.x-a.x,this.normal.y=l.y-a.y),l;return g?l:null};a.R2Newton=q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=function(a,d){this.x=a;this.y=d};e.prototype.vectorLength=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};e.prototype.dotProduct=function(a){return this.x*a.x+this.y*a.y};e.prototype.angleBetweenVectors=function(a){return Math.acos(this.dotProduct(a)/(this.vectorLength()*a.vectorLength()))};e.AXIS_X=new e(1,0);e.AXIS_Y=new e(0,1);a.Vector2D=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=Math.floor,f=Math.round,d,r,l,b,h,m,g,q,c,v,k,u,x,p=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=f(b[0][0]);this.y=f(b[0][1]);4==b[0].length&&(this.w=f(b[0][2]),this.h=f(b[0][3]));this.actionExec=c.lessonParser.parseAction(this)};p.prototype.init=function(){};p.prototype.update=function(){};p.prototype.draw=function(){};p.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};p.prototype.addControlContainer=function(a){var c=this.getContainer();c.childNodes[0]?c.insertBefore(a,c.childNodes[0]):c.appendChild(a)};p.prototype.updatePositionAndSize=function(){l=b=h=m=!1;g=this.evaluator.eval(this.expresion);q=f(g[0][0]);l=f(this.x)!==q;this.x=q;q=f(g[0][1]);b=f(this.y)!==q;this.y=q;4===g[0].length&&(q=f(g[0][2]),h=f(this.w)!==q,this.w=q,q=f(g[0][3]),m=f(this.h)!==q,this.h=q);if(h||m||l||b)this.init(!0),this.draw()};
p.prototype.formatOutputValue=function(a){x=this.parent;c=a+"";v=this.evaluator.eval(this.decimals);k=c.indexOf(".");-1!=k&&(u=c.substring(k+1),u.length>v&&(c=parseFloat(c).toFixed(v)));this.fixed&&(2!==x.version||2===x.version&&!this.exponentialif)&&(c=parseFloat(a).toFixed(v));this.exponentialif&&0!=parseFloat(c)&&(c=this.fixed&&2!==x.version?parseFloat(c).toExponential(v):parseFloat(c).toExponential(),c=c.toUpperCase().replace("+",""));return c.replace(".",x.decimal_symbol)};p.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()};p.prototype.createGradient=function(a,c){this.linearGradient=this.ctx.createLinearGradient(0,0,0,c);d=c*c;for(a=0;a<c;a++)r=e(a-35*c/100),this.linearGradient.addColorStop(a/c,"rgba(0,0,0,"+r*r*192/d/255+")")};a.Control=p;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=Math.floor,f=Math.abs,d=/[\w\.\-//]*(\.gif)/gi,r,l,b,h,m,g,q,c,v,k,u,x,p,n,B,w,y,A,E,J,F,H,z,I,C,M,N,O,G,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+" ":"";d.extra_style=d.imageSrc.trim().match("^_STYLE_")?d.imageSrc.trim().substring(8):d.extra_style||"";d.imageSrc.trim().match("^_STYLE_")&&
(d.imageSrc="vacio.gif");if(d.extra_style){d.customStyle=!0;d.btnStyle=[];d.conStyle=[];d.conStyle.textBorder=3;c=d.extra_style.split("|");for(var g,n=0,f=c.length;n<f;n++)b=c[n],g=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:(g?"":"#")+b.substring(12).trim()}):b.match("overColor=")?d.conStyle.overColor=(g?"":"#")+b.substring(10).trim():b.match("downColor=")?d.conStyle.downColor=(g?"":"#")+b.substring(10).trim():b.match("font=")?d.conStyle.font=b.substring(5).trim().toLowerCase():b.match("inactiveColor=")?d.conStyle.inactiveColor=(g?"":"#")+b.substring(14).trim():b.match("inactiveColorBorder=")?d.conStyle.inactiveColorBorder=
(g?"":"#")+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=(g?"":"#")+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=(g?"":"#")+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=(g?"":"#")+b.substring(20).trim():b.match("textBorder=")?d.conStyle.textBorder=parseFloat(b.substring(11).trim()):b.match("flat=")&&(d.flat=1==parseInt(b.substring(5).trim()))}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(".")),g=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"+g),d.imageDown=d.parent.getImage(b+"_down"+
g)}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;w=this.container;l=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]));l.width=this.w*this.ratio;l.height=this.h*this.ratio;l.setAttribute("style","position:absolute;left:0;top:0;width:"+this.w+"px;height:"+this.h+"px;box-sizing:border-box;");w.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,g=this.btnStyle.length;d<g;d++)l.style[this.btnStyle[d].type]=this.btnStyle[d].value;if(this.conStyle){d=0;for(g=this.conStyle.length;d<g;d++)w.style[this.conStyle[d].type]=this.conStyle[d].value;if(this.conStyle.shadowBoxColor){d=this.conStyle.shadowBoxOffsetX||0;g=this.conStyle.shadowBoxOffsetY||2;var n=this.conStyle.shadowBoxBlur||2;w.style.boxShadow=d+"px "+g+"px "+n+"px 1px "+this.conStyle.shadowBoxColor}this.conStyle.shadowInsetBoxColor&&(d=this.conStyle.shadowInsetBoxOffsetX||
0,g=this.conStyle.shadowInsetBoxOffsetY||-2,n=this.conStyle.shadowInsetBoxBlur||1,l.style.boxShadow=d+"px "+g+"px "+n+"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);w.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;w=this.container;l=this.btn;this.activeIfValue=0<r.eval(this.activeif);this.drawIfValue=0<r.eval(this.drawif);(this.space?this.space.drawIfValue:1)&&this.drawIfValue?(w.style.display="block",this.draw(),w.style.cursor=l.style.cursor=this.activeIfValue?"pointer":"not-allowed",this.updatePositionAndSize()):(w.style.display="none",this.buttonClick=!1)};L.prototype.draw=function(f){w=this.container;r=this.evaluator;l=this.btn;b=this.ctx;g=r.eval(this.name);q=this.evaluator.eval(this.imageSrc).toString().trim();
if(!f&&(y=this.over===this.oldOver,A=this.buttonClick===this.oldButtonClick,E=this.activeIfValue===this.oldActiveIfValue,J=this.drawIfValue===this.oldDrawIfValue,F=g===this.oldName,H=q===this.oldImageSrc,z=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=g,this.oldImageSrc=
q,this.oldBackColor=this.colorInt.getColor(),this.oldTextColor=this.color.getColor(),this.oldImageReady=this.image.ready,y&&A&&E&&J&&F&&H&&z&&I&&C))return;b.save();b.setTransform(this.ratio,0,0,this.ratio,0,0);m=this.fs_evaluated;w.setAttribute("data-name",g);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,G=M+"_down"+N,D="vacio.gif"===q?this.emptyImage:this.parent.getImage(O),K="vacio.gif"===q?this.emptyImage:
this.parent.getImage(G)):K=D=c=this.emptyImage;b.clearRect(0,0,this.w,this.h);v=k=0;this.buttonClick&&(v=k=1);"center"==this.text_align[1]?n=e(this.w/2+v)-.5:"left"==this.text_align[1]?(u=b.measureText(g).width,n=u/2+5+v):"right"==this.text_align[1]&&(u=b.measureText(g).width,n=this.w-u/2+v-5);"center"==this.text_align[0]?B=e(this.h/2+k)-.5:"top"==this.text_align[0]?B=m/2+k+4:"bottom"==this.text_align[0]&&(B=this.h-m/2+k-3);c&&("center"==this.image_align[1]?x=parseInt((this.w-c.width)/2)+v:"left"==
this.image_align[1]?x=v:"right"==this.image_align[1]&&(x=this.w-c.width+v),"center"==this.image_align[0]?p=parseInt((this.h-c.height)/2)+k:"top"==this.image_align[0]?p=k:"bottom"==this.image_align[0]&&(p=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=x+"px "+p+"px";else{if("center"!=this.image_align[0]||"center"!=this.image_align[1])w.style.backgroundColor=
this.colorInt.getColor();b.drawImage(c,x,p)}else this.emptyImage&&this.customStyle&&(w.style.backgroundColor=this.colorInt.getColor());else w.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=x+"px "+p+"px"):b.drawImage(D,x,p):this.customStyle&&this.conStyle.overColor&&this.over&&(w.style.backgroundColor=this.conStyle.overColor));this.activeIfValue?K!==this.emptyImage&&this.buttonClick&&K.ready&&K.complete?G.match(d)?(this.btn.style.backgroundImage="url('"+G+"')",this.btn.style.backgroundPosition=x+"px "+p+"px"):b.drawImage(K,x,p):this.customStyle&&this.conStyle.downColor&&this.buttonClick&&(w.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(g,n,B));this.borderColor&&(b.lineWidth=parseInt(m/6),b.strokeStyle=this.borderColor.getColor(),b.strokeText(g,n,B));b.fillText(g,n,B);this.underlined&&(u=b.measureText(g).width,b.strokeStyle=
this.color.getColor(),b.lineWidth=e(m/10)||2,b.lineCap="round",b.beginPath(),b.moveTo(n-u/2+v,B+e(m/2)+e(m/5)-1.5),b.lineTo(n+u/2+v,B+e(m/2)+e(m/5)-1.5),b.stroke());this.activeIfValue||(this.customStyle&&this.conStyle.inactiveColor?w.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=x;this._image_pos_y=p};L.prototype.drawTextBorder=function(){this.colorInt.getColor();this.color.getColor();return!(.5>
(f(this.colorInt.r-this.color.r)+f(this.colorInt.g-this.color.g)+f(this.colorInt.b-this.color.b))/255)};L.prototype.buttonPressed=function(){this.updateAndExecAction()};L.prototype.addEvents=function(){function c(b,d,f){a.clearTimeout(n);g.buttonClick&&g.drawIfValue&&g.activeIfValue&&(d.call(g),b=f?b:100,n=a.setTimeout(function(){c(b,d,!1)},b))}function b(b){this.focus();b.preventDefault();b.stopPropagation();document.activeElement!=document.body&&document.activeElement.blur();g.whichBtn=a.whichBtn(b);
"L"==g.whichBtn&&g.activeIfValue&&(g.buttonClick=!0,g.draw(),"calculate"==g.action&&(g.evaluator.setVariable(g.id,g.evaluator.eval(g.valueExpr)),c(1E3,g.buttonPressed,!0)),g.btn.removeEventListener("touchend",d),g.btn.addEventListener("touchend",d),g.btn.removeEventListener("mouseup",d),g.btn.addEventListener("mouseup",d))}function d(c){a.newBlobContent=null;this.focus();c.preventDefault();c.stopPropagation();if(g.activeIfValue||g.buttonClick)g.buttonClick=!1,g.draw(),"calculate"!=g.action&&(g.evaluator.setVariable(g.id,
g.evaluator.eval(g.valueExpr)),g.buttonPressed()),g.btn.removeEventListener("touchend",d),g.btn.removeEventListener("mouseup",d);g.parent.update()}var g=this,n;g.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();g.over=!0;g.draw()});this.btn.addEventListener("mouseout",function(c){a.newBlobContent=null;c.preventDefault();
c.stopPropagation();g.over=!1;g.buttonClick=!1;g.draw()});document.addEventListener("visibilitychange",function(c){a.newBlobContent=null;g.buttonClick=!1})};a.Button=L;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b,h,m,g,q,c,v,k,u=function(b,d){d=a.Control.call(this,b,d)||this;d.flat=d.image_dec_src&&d.image_inc_src;d.btn_pos=d.btn_pos||"v_left";d.horizontal="h_left"===d.btn_pos||"h_right"===d.btn_pos||"h_left_right"===d.btn_pos;d.label_color=d.label_color||new a.Color("e0e4e8",b.evaluator);d.label_text_color=d.label_text_color||new a.Color("000000",b.evaluator);d.tabindex=++d.parent.tabindex;"_._"==d.name&&(d.name="");d.name.match(/^\[.*\]?/)?d.name=
d.parser.parse(d.name.substring(1,d.name.length-1)):d.name=d.parser.parse("'"+d.name+"'");d.container=a.newHTML("div",{class:"DescartesSpinnerContainer",id:d.id});d.divUp=a.newHTML("div",{class:"DJS_Up"});d.divDown=a.newHTML("div",{class:"DJS_Down"});d.field=a.newHTML("input",{type:"text",id:d.id+"_spinner",class:"DescartesSpinnerField",tabindex:d.tabindex});d.label=a.newHTML("label",{class:"DescartesSpinnerLabel"});d.container.appendChild(d.label);d.container.appendChild(d.field);d.container.appendChild(d.divUp);
d.container.appendChild(d.divDown);d.addControlContainer(d.container);c=d.evaluator.parser.parse("1");d.originalIncr=d.incr;if(0>d.evaluator.eval(d.decimals)||0===d.evaluator.eval(d.incr))b=d.evaluator.eval(d.incr),0<b?(d.incr=d.evaluator.parser.parse(parseInt(b).toString()),d.originalIncr=d.incr):d.incr=c;d.image_dec_src&&(d.image_dec_src.match(/^\[.*\]?/)?d.image_dec_src=d.parser.parse(d.image_dec_src.substring(1,d.image_dec_src.length-1)):d.image_dec_src=d.parser.parse("'"+d.image_dec_src+"'"),
d.old_image_dec_src=d.evaluator.eval(d.image_dec_src).toString().trim(),d.image_dec=d.parent.getImage(d.old_image_dec_src));d.image_inc_src&&(d.image_inc_src.match(/^\[.*\]?/)?d.image_inc_src=d.parser.parse(d.image_inc_src.substring(1,d.image_inc_src.length-1)):d.image_inc_src=d.parser.parse("'"+d.image_inc_src+"'"),d.old_image_inc_src=d.evaluator.eval(d.image_inc_src).toString().trim(),d.image_inc=d.parent.getImage(d.old_image_inc_src));d.addEvents();d.init();return d};$jscomp.inherits(u,a.Control);
u.prototype.init=function(){e=this.evaluator;var c=e.eval(this.name).toString();this.label.innerHTML=c;this.value=this.validateValue(e.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?"__":"_____",g=a.getTextWidth(b+"_",this.fieldFontSize+"px "+a.sansserif_font);if(this.horizontal){var f=parseInt(this.h),k=parseInt(this.w/2-f);d=a.getTextWidth(c+d,this.fieldFontSize+"px "+a.sansserif_font);
this.visible||(k=this.w-2*f,g=0);k<d&&(k=d);""==c&&(k=0);this.w-k-f<g&&(k=this.w-f-g);0>k&&(k=0);c=this.w-(k+2*f);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:"+f+"px;height:"+f+"px;"+("h_left"===this.btn_pos?"left:"+(k+f):"right:0")+"px;top:0;"+(this.flat?"border-width:0;":""));this.divDown.setAttribute("style","width:"+f+"px;height:"+f+
"px;left:"+(k+("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:"+(f+k+("h_left"===this.btn_pos?f:"h_right"===this.btn_pos?-f:0))+"px;")}else f=2+parseInt(this.h/2),k=parseInt(this.w/2-f/2),d=a.getTextWidth(c+d,this.fieldFontSize+"px "+a.sansserif_font),this.visible||(k=this.w-f,g=0),k<d&&(k=d),""==c&&(k=0),this.w-k-f<g&&(k=this.w-
f-g),0>k&&(k=0),c=this.w-(k+f),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:"+f+"px;left:"+(k+("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?f:0)+k)+"px;");this.field.value=b;this.visible||(this.field.style.display="none");this.label.setAttribute("style","font-size:"+this.fieldFontSize+"px;width:"+k+"px;height:"+this.h+"px;line-height:"+this.h+"px;background-color:"+this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";");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);e.setVariable(this.id,this.value)};u.prototype.update=function(){e=this.evaluator;this.label.innerHTML=e.eval(this.name).toString();0>e.eval(this.decimals)?(f=e.eval(this.incr),0<f?this.originalIncr=this.incr=e.parser.parse(parseInt(f).toString()):
this.incr=c):this.incr=0!==e.eval(this.originalIncr)?this.originalIncr:c;this.activeIfValue=0<e.eval(this.activeif);this.drawIfValue=0<e.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&&(v=this.evaluator.eval(this.image_dec_src).toString().trim(),
this.old_image_dec_src!==v&&(this.divDown.style["background-image"]="url("+this.image_dec.src+")",this.old_image_dec_src=v));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(e.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)),e.setVariable(this.id,this.value))};u.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"};u.prototype.validateValue=function(a){e=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,".");l=a==parseFloat(a)?parseFloat(a):parseFloat(e.eval(e.parser.parse(a)));isNaN(l)&&(l=0);m=e.eval(this.min);g=e.eval(this.max);""===m&&(m=-Infinity);""===g&&(g=Infinity);l=Math.min(Math.max(l,m),g);this.discrete&&(b=e.eval(this.incr),l=0==b?0:b*Math.round(l/b));h=e.eval(this.decimals);0>=h&&(h=0);return l=parseFloat(parseFloat(l).toFixed(h))};u.prototype.increase=function(){this.changeValue(parseFloat(this.value)+
this.evaluator.eval(this.incr))};u.prototype.decrease=function(){this.changeValue(parseFloat(this.value)-this.evaluator.eval(this.incr))};u.prototype.changeValue=function(a){this.activeIfValue&&(this.value=this.validateValue(a),this.field.value=this.formatOutputValue(this.value),this.evaluator.setVariable(this.id,this.value),this.updateAndExecAction())};u.prototype.addEvents=function(){function c(b,d,g){a.clearTimeout(h);if(k.up||k.down)d.call(k),b=g?b:10,h=a.setTimeout(function(){c(b,d)},b)}function b(b){b.preventDefault();
k.whichBtn=a.whichBtn(b);"L"==k.whichBtn&&k.activeIfValue&&(k.up=!0,c(e,k.increase,!0))}function d(b){b.preventDefault();k.whichBtn=a.whichBtn(b);"L"==k.whichBtn&&k.activeIfValue&&(k.down=!0,c(e,k.decrease,!0))}function g(c){k.up=!1;a.clearTimeout(h);k.updateStyle()}function f(c){k.down=!1;a.clearTimeout(h);k.updateStyle()}q=a.hasTouchSupport;var k=this,e=q?500:200,h;k.divUp.oncontextmenu=k.divDown.oncontextmenu=k.field.oncontextmenu=k.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&&k.changeValue(k.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){k.up=!1;a.clearTimeout(h);c.preventDefault();k.updateStyle()});this.divDown.addEventListener("mouseout",
function(c){k.down=!1;a.clearTimeout(h);c.preventDefault();k.updateStyle()});this.divUp.addEventListener("touchend",g);window.addEventListener("touchend",g);this.divUp.addEventListener("mouseup",g);window.addEventListener("mouseup",g);this.divDown.addEventListener("touchend",f);window.addEventListener("touchend",f);this.divDown.addEventListener("mouseup",f);window.addEventListener("mouseup",f);document.addEventListener("visibilitychange",function(c){k.up=!1;k.down=!1;a.clearTimeout(h);k.updateStyle()});
k.field.addEventListener("click",function(a){this.focus()})};a.Spinner=u;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f=function(d,f){var e=a.Control.call(this,d,f)||this;e.label_color=e.label_color||new a.Color("e0e4e8",d.evaluator);e.label_text_color=e.label_text_color||new a.Color("000000",d.evaluator);e.typeCtr="checkbox";e.pressed=f.pressed||!1;e.radio_group=(f.radio_group||"").trim();""!==e.radio_group&&(e.typeCtr="radio");e.name.match(/^\[.*\]?/)?e.name=e.parser.parse(e.name.substring(1,e.name.length-1)):e.name=e.parser.parse("'"+e.name.trim()+"'");e.tabindex=
++e.parent.tabindex;e.containerControl=a.newHTML("div",{class:"DescartesCheckboxContainer",id:e.id});e.checkbox=a.newHTML("input",{type:e.typeCtr,id:e.id+e.typeCtr,class:"DescartesCheckbox",tabindex:e.tabindex});""!==e.radio_group&&e.checkbox.setAttribute("name",e.radio_group);e.checkbox.internalID=e.id;e.label=a.newHTML("label",{class:"DescartesCheckboxLabel"});e.dummyLabel=a.newHTML("label",{"for":e.id+e.typeCtr});e.value=e.evaluator.eval(e.valueExpr);e.containerControl.appendChild(e.label);e.containerControl.appendChild(e.checkbox);
e.containerControl.appendChild(e.dummyLabel);e.addControlContainer(e.containerControl);e.addEvents();e.init();return e};$jscomp.inherits(f,a.Control);f.prototype.init=function(d){e=this.evaluator;this.label.innerHTML=e.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;background-color:"+this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";");this.evaluator.setVariable(this.id,this.value);this.update()};f.prototype.update=
function(){e=this.evaluator;this.label.innerHTML=e.eval(this.name).toString();this.activeIfValue=0<e.eval(this.activeif);this.drawIfValue=0<e.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!==e.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&&(e.setVariable(this.radio_group,this.id),this.pressed=!1));e.setVariable(this.id,this.value)}this.updatePositionAndSize()};f.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=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b,h=function(b,d){d=a.Control.call(this,b,d)||this;d.label_color=d.label_color||new a.Color("e0e4e8",b.evaluator);d.label_text_color=d.label_text_color||new a.Color("000000",b.evaluator);d.name.match(/^\[.*\]?/)?d.name=d.parser.parse(d.name.substring(1,d.name.length-1)):d.name=d.parser.parse("'"+d.name.trim()+"'");void 0===d.valueExprString&&(d.valueExprString=d.onlyText?"0":"");d.emptyString=!1;d.ok=0;d.tabindex=++d.parent.tabindex;d.regExpDecimalSymbol=
new RegExp("\\"+d.parent.decimal_symbol,"g");d.answer&&(d.answer.match("krypto_")&&(d.answer=(new a.Krypto).decode(d.answer.substring(7))),d.answerPattern=d.answer,d.answer=a.buildRegularExpressionsPatterns(d.answer,d.evaluator),d.onlyText?(b=d.answerPattern.indexOf("|"),d.firstAnswer=-1==b?d.answerPattern:d.answerPattern.substring(0,b)):d.firstAnswer=d.parser.parse(d.answerPattern.substring(1,d.answerPattern.indexOf(","))));d.onlyText&&(d.valueExprString.match(/^'/)&&d.valueExprString.match(/'$/)||
(d.valueExpr=d.evaluator.parser.parse("'"+d.valueExprString+"'")),d.validateValue=function(a){a=a.toString();return"''"==a||"'"==a?"":a&&a.match(/^'/)&&a.match(/'$/)?a.substring(1,a.length-1):a},d.formatOutputValue=function(a){return a.toString()});""==name.trim()&&(name="");d.containerControl=a.newHTML("div",{class:"DescartesTextFieldContainer",id:d.id});d.field=a.newHTML("input",{type:"text",id:d.id+"TextField",class:"DescartesTextFieldField",tabindex:d.tabindex});d.label=a.newHTML("label",{class:"DescartesTextFieldLabel"});
d.containerControl.appendChild(d.label);d.containerControl.appendChild(d.field);d.addControlContainer(d.containerControl);d.addEvents();d.init();return d};$jscomp.inherits(h,a.Control);h.prototype.init=function(b){e=this.evaluator;var d=e.eval(this.name).toString();this.label.innerHTML=d;b||(this.value=this.validateValue(e.eval(this.valueExpr)));b=this.formatOutputValue(this.value);this.fieldFontSize=a.getFieldFontSize(this.h);var f=a.getTextWidth(b+"_",this.fieldFontSize+"px "+a.sansserif_font),
c=parseInt(this.w/2),h=a.getTextWidth(d,this.fieldFontSize+"px "+a.sansserif_font);this.visible||(c=this.w,f=0);c<h&&(c=h);""==d&&(c=0);this.w-c<f&&(c=this.w-f);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;background-color:"+this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";");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(){e=this.evaluator;this.label.innerHTML=e.eval(this.name).toString();this.activeIfValue=0<e.eval(this.activeif);
this.drawIfValue=0<e.eval(this.drawif);this.field.disabled=!this.activeIfValue;this.containerControl.style.display=this.drawIfValue?"block":"none";this.parent.animation.playing&&document.activeElement==this.field||(f=this.field.value,d=this.value,this.value=this.validateValue(e.getVariable(this.id)),this.field.value=this.formatOutputValue(this.value),this.value===d&&this.field.value!=f&&(this.value=this.validateValue(f),this.field.value=this.formatOutputValue(this.value)),e.setVariable(this.id,this.value));
this.updatePositionAndSize()};h.prototype.validateValue=function(a){if(""===a||"''"==a)return"";e=this.evaluator;a=a.toString().replace(this.regExpDecimalSymbol,".","g");r=a==parseFloat(a)?parseFloat(a):parseFloat(e.eval(e.parser.parse(a)));isNaN(r)&&(r=0);l=e.eval(this.min);b=e.eval(this.max);""===l&&(l=-Infinity);""===b&&(b=Infinity);r<l&&(r=l);r>b&&(r=b);this.discrete&&(a=e.eval(this.incr),r=0===a?0:a*Math.round(r/a));return r=parseFloat(parseFloat(r).toFixed(e.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 e=Math.abs,f,d,r,l,b,h,m,g,q,c,v=function(c,b){function g(c){n.options=c.split(",");n.menuOptions=[];n.strValue=[];c=0;for(var b=n.options.length;c<b;c++){var g=n.customSplit(n.options[c]);1==g.length?(n.menuOptions.push(g[0]),n.strValue.push(c.toString())):2==g.length&&(n.menuOptions.push(g[0]),""==g[1]?n.strValue.push(c.toString()):n.strValue.push(g[1]))}c=0;for(b=n.menuOptions.length;c<b;c++)n.menuOptions[c].match(/^\[/)&&n.menuOptions[c].match(/\]$/)?
n.menuOptions[c]=f.parse(n.menuOptions[c].substring(1,n.menuOptions[c].length-1)):n.menuOptions[c]=f.parse("'"+n.menuOptions[c]+"'");c=0;for(b=n.strValue.length;c<b;c++)n.strValue[c].match(/^\[/)&&n.strValue[c].match(/\]$/)?n.strValue[c]=f.parse(n.strValue[c].substring(1,n.strValue[c].length-1)):n.strValue[c]=f.parse(n.strValue[c]);for(;n.select.firstChild;)n.select.remove();c=0;for(b=n.menuOptions.length;c<b;c++)g=a.newHTML("option"),g.innerHTML=d.eval(n.menuOptions[c]),n.select.appendChild(g);return 0}
var k=a.Control.call(this,c,b)||this;k.label_color=k.label_color||new a.Color("e0e4e8",c.evaluator);k.label_text_color=k.label_text_color||new a.Color("000000",c.evaluator);k.options=b.options||"";f=k.parser;d=k.evaluator;k.ok=0;k.tabindex=++k.parent.tabindex;k.answer&&(k.answer.match("krypto_")&&(k.answer=(new a.Krypto).decode(k.answer.substring(7))),k.answer=parseInt(k.answer.split(",")[0].replace("[",""))||0);k.name.match(/^\[.*\]?/)?k.name=k.parser.parse(k.name.substring(1,k.name.length-1)):k.name=
k.parser.parse("'"+k.name+"'");var n=k;k.evaluator.setFunction(k.id+".setOptions",g);k.containerControl=a.newHTML("div",{class:"DescartesMenuContainer",id:k.id});k.label=a.newHTML("label",{class:"DescartesMenuLabel"});k.select=a.newHTML("select",{id:k.id+"_menuSelect",class:"DescartesMenuSelect",tabindex:k.tabindex});k.field=a.newHTML("input",{type:"text",id:k.id+"_menuField",class:"DescartesMenuField",tabindex:k.tabindex});g(k.options);k.containerControl.appendChild(k.label);k.containerControl.appendChild(k.select);
k.visible&&k.containerControl.appendChild(k.field);k.addControlContainer(k.containerControl);k.addEvents();k.init();return k};$jscomp.inherits(v,a.Control);v.prototype.init=function(c){d=this.evaluator;var b=d.eval(this.name).toString();this.label.innerHTML=b;this.fieldFontSize=2!=this.parent.version?a.getFieldFontSize(this.h):10;var g=0,k=0;this.value=c?this.value:d.eval(this.valueExpr);this.indexValue=this.getIndex(this.value);for(var f=0,e=this.menuOptions.length;f<e;f++)c=a.getTextWidth(d.eval(this.menuOptions[f]).toString(),
this.fieldFontSize+"px "+a.sansserif_font),c>g&&(g=c,k=f);g+=25;c=a.getTextWidth(this.formatOutputValue(d.eval(this.strValue[k])),this.fieldFontSize+"px "+a.sansserif_font)+7;k=a.getTextWidth(b,this.fieldFontSize+"px "+a.sansserif_font)+10;""==b&&(k=0);this.visible||(c=0);for(b=this.w-c-k;b<g&&0<k;)k--,b++;for(;b<g&&0<c;)c--,b++;for(;k+b+c+1<this.w;)b++,c++;g=k;f=g+b;c=this.w-f;e=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:"+k+"px;height:"+this.h+"px;line-height:"+this.h+"px;background-color:"+this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";");this.field.value=e;this.field.setAttribute("style","font-size:"+this.fieldFontSize+"px;width:"+c+"px;height:"+this.h+"px;left:"+f+"px;");this.select.setAttribute("style","text-align:left;font-size:"+
this.fieldFontSize+"px;width:"+b+"px;height:"+this.h+"px;left:"+g+"px;");this.select.selectedIndex=this.indexValue;d.setVariable(this.id,parseFloat(e.replace(this.parent.decimal_symbol,".")));this.update()};v.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,c=this.menuOptions.length;a<c;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()};v.prototype.customSplit=function(a){h=!1;m="";g=0;for(q=-1;g<a.length;){c=a.charAt(g);if("["===c&&-1===q){if(h||""!=m)m+="\u00a6";q++}else"["===c?q++:"]"===c&&0===q?(h=!0,q--):"]"==a.charAt(g)&&(q=0>q?q:q-1);m+=a.charAt(g);g++}return m.split("\u00a6")};v.prototype.getIndex=function(a){a=parseFloat(a.toString().replace(this.parent.decimal_symbol,"."));r=-1;l=Infinity;for(var c=0,d=this.strValue.length;c<
d;c++)b=e(a-parseFloat(this.evaluator.eval(this.strValue[c]))),b<=l&&(l=b,r=c);return r};v.prototype.changeValue=function(){this.activeIfValue&&(this.evaluator.setVariable(this.id,this.value),this.updateAndExecAction())};v.prototype.addEvents=function(){var c=this;c.select.oncontextmenu=c.label.oncontextmenu=c.field.oncontextmenu=function(){return!1};c.label.addEventListener("touchstart",a.preventDefault);c.label.addEventListener("mousedown",a.preventDefault);this.select.addEventListener("change",
function(a){c.value=c.evaluator.eval(c.strValue[this.selectedIndex]);c.field.value=c.formatOutputValue(c.value);c.evaluator.setVariable(c.id,c.field.value);c.changeValue();a.preventDefault()});this.field.addEventListener("keydown",function(a){13==a.keyCode&&(c.indexValue=c.getIndex(c.field.value),c.value=c.evaluator.eval(c.strValue[c.indexValue]),c.field.value=c.formatOutputValue(c.indexValue),c.select.selectedIndex=c.indexValue,c.changeValue())});c.field.addEventListener("click",function(a){this.focus()})};
a.Menu=v;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=Math.floor,f,d,r,l,b,h,m,g,q,c,v,k,u,x,p,n,B,w,y=function(c,b){b=a.Control.call(this,c,b)||this;b.label_color=b.label_color||new a.Color("e0e4e8",c.evaluator);b.label_text_color=b.label_text_color||new a.Color("000000",c.evaluator);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(){f=this.evaluator;0==f.eval(this.decimals)?this.incr=1:this.incr=(f.eval(this.max)-f.eval(this.min))/100;this.value=this.validateValue(f.eval(this.valueExpr));r=this.formatOutputValue(this.value);l=this.evaluator.eval(this.expresion);this.x=l[0][0];this.y=l[0][1];4==l[0].length&&(this.w=l[0][2],this.h=
l[0][3]);this.orientation=this.w>=this.h?"h":"v";this.initScroll(r);this.changeScrollPositionFromValue();this.prePos=this.pos;f.setVariable(this.id,this.value)};y.prototype.initScroll=function(c){d=this;f=d.evaluator;w=f.eval(d.name).toString();d.label.innerHTML=w;var b="v"===d.orientation?parseInt(19+5*(d.h-100)/100):d.h;d.fieldFontSize="v"===d.orientation?b-parseInt(d.h/20)-1:2!==d.parent.version?a.getFieldFontSize(b):10;c=a.getTextWidth(c+"_",d.fieldFontSize+"px "+a.sansserif_font);var g=d.parent.getSpaceById(d.spaceID).h;
d.labelHeight=""==w?0:b;d.fieldHeight=""==d.visible?0:b;if("v"===d.orientation)d.canvasWidth=d.w,d.canvasHeight=d.h-d.labelHeight-d.fieldHeight,18<=d.canvasHeight+d.y-g&&(d.canvasHeight=g),b=d.fieldHeight,c=b+d.canvasHeight,d.canvasX=0,d.canvasY=d.fieldHeight,d.labelWidth=d.w,d.labelY=c,d.upWidth=d.downW=d.w,d.upHeight=d.downH=15,d.upX=0,d.upY=d.fieldHeight,d.downX=0,d.downY=c-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=c-d.downH-d.scrollHandlerH,d.limSup=b+d.downH;else{b=a.getTextWidth(w,d.fieldFontSize+"px "+a.sansserif_font)+10;d.labelWidth=b;d.fieldWidth=c;""==w&&(d.labelWidth=0);d.visible||(d.fieldWidth=0);for(c=d.w-d.fieldWidth-d.labelWidth;58>c&&0<d.labelWidth;)d.labelWidth--,c++;for(;58>c&&0<d.fieldWidth;)d.fieldWidth--,c++;b=d.labelWidth;g=b+c;d.fieldWidth=d.w-g;d.canvasWidth=c;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=g-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=b+d.downW;d.limSup=b+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;background-color:"+
this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";")};y.prototype.update=function(){f=this.evaluator;this.label.innerHTML=f.eval(this.name).toString();0==f.eval(this.decimals)?this.incr=1:this.incr=(f.eval(this.max)-f.eval(this.min))/100;this.activeIfValue=0<f.eval(this.activeif);this.drawIfValue=0<f.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(f.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);f.setVariable(this.id,this.value)};y.prototype.draw=function(){d=this;b=d.ctx;m=e(this.w);h=e(this.h);b.fillStyle="#e0e4e8";b.fillRect(0,0,m,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);g=4;b.fillStyle="black";b.beginPath();"h"===d.orientation?(b.moveTo(d.downX+g,d.downH/2),b.lineTo(d.downX+d.downW-g,g),b.lineTo(d.downX+d.downW-g,d.downH-g),b.moveTo(d.upX+d.upWidth-g,d.downH/2),b.lineTo(d.upX+g,g),b.lineTo(d.upX+g,d.downH-g),b.fill(),d.activeIfValue&&(q=e(d.pos),b.fillStyle="#ccdcec",b.fillRect(q+.5,0,e(d.scrollHandlerW),
h),b.strokeStyle="#6382bf",b.strokeRect(q+.5,0,e(d.scrollHandlerW),h),c=e(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-g),b.lineTo(d.downX+g,d.downY+g),b.lineTo(d.downX+d.downW-g,d.downY+g),b.moveTo(d.upX+d.upWidth/2,d.upY+g),b.lineTo(d.upX+g,d.upY+d.upHeight-g),b.lineTo(d.upX+d.upWidth-g,d.upY+d.upHeight-g),b.fill(),d.activeIfValue&&
(q=e(d.pos),b.fillStyle="#ccdcec",b.fillRect(0,q+.5,m,e(d.scrollHandlerH)),b.strokeStyle="#6382bf",b.strokeRect(0,q+.5,m,e(d.scrollHandlerH)),c=e(d.scrollHandlerH/2),b.beginPath(),b.moveTo(3,q+c+.5-2),b.lineTo(m-3,q+c+.5-2),b.moveTo(3,q+c+.5),b.lineTo(m-3,q+c+.5),b.moveTo(3,q+c+.5+2),b.lineTo(m-3,q+c+.5+2),b.stroke()));b.strokeRect(.5,.5,m-1,h-1);d.activeIfValue||(b.fillStyle="rgba(240,240,240,"+160/255+")",b.fillRect(0,0,m,h.h))};y.prototype.validateValue=function(a){f=this.evaluator;v=a.toString();
v=parseFloat(v.replace(this.parent.decimal_symbol,"."));isNaN(v)&&(v=0);this.minimo=f.eval(this.min);v<this.minimo&&(this.value=null,v=this.minimo);this.maximo=f.eval(this.max);v>this.maximo&&(this.value=null,v=this.maximo);k=this.incr;v=0!=k?v*k/k:0;this.fixed&&(v=parseFloat(parseFloat(v).toFixed(f.eval(this.decimals))));return v};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(){g=(this.evaluator.eval(this.max)-this.evaluator.eval(this.min))/10;"h"==this.orientation?this.clickPos.x>this.prePos&&this.changeValue(parseFloat(this.value)+g):this.clickPos.y<this.prePos&&this.changeValue(parseFloat(this.value)+g)};y.prototype.decrease10=function(){g=(this.evaluator.eval(this.max)-this.evaluator.eval(this.min))/10;"h"==this.orientation?this.clickPos.x<this.prePos&&this.changeValue(parseFloat(this.value)-g):this.clickPos.y>this.prePos&&this.changeValue(parseFloat(this.value)-
g)};y.prototype.changeValue=function(a){this.activeIfValue&&(u=this.validateValue(a),u!=this.value&&(this.value=u,this.field.value=this.formatOutputValue(u),this.changeScrollPositionFromValue(),this.prePos=this.pos,this.evaluator.setVariable(this.id,this.value),this.updateAndExecAction()))};y.prototype.changeValueForScrollMovement=function(){f=this.evaluator;x=this.limInf;p=this.limSup;n=f.eval(this.min);B=f.eval(this.max);k=this.incr;u=e((this.pos-x)*(B-n)/(p-x)/k)*k+n;u!=this.value&&(this.value=
u,this.field.value=this.formatOutputValue(u),f.setVariable(this.id,this.value),this.parent.updateControls(),this.actionExec.execute(),this.parent.update())};y.prototype.changeScrollPositionFromValue=function(){f=this.evaluator;x=this.limInf;p=this.limSup;n=f.eval(this.min);B=f.eval(this.max);k=this.incr;this.pos=(this.value-n)*(p-x)/(B-n)+x;this.scrollHandler.style["h"==this.orientation?"left":"top"]=this.pos+"px"};y.prototype.addEvents=function(){function c(b,d,g,f){a.clearTimeout(x);(p.up||p.down||
p.canvasClick)&&1E-7<Math.abs(p.value-f)&&(d.call(p),b=g?b:30,x=a.setTimeout(function(){c(b,d,!1,f)},b))}function b(b){b.preventDefault();p.whichBtn=a.whichBtn(b);"L"==p.whichBtn&&p.activeIfValue&&(p.clickPos=a.getCursorPosition(b,p.container),p.canvasClick=!0,"h"==p.orientation?p.clickPos.x<p.prePos?c(350,p.decrease10,!0,p.minimo):c(350,p.increase10,!0,p.maximo):p.clickPos.y<p.prePos?c(350,p.increase10,!0,p.maximo):c(350,p.decrease10,!0,p.minimo))}function d(c){p.canvasClick=!1;a.clearTimeout(x)}
function g(c){1==p.canvasClick&&(p.clickPos=a.getCursorPosition(c,p.container),c.preventDefault())}function f(a){p.scrollClick=!1;p.prePos=p.pos;window.removeEventListener("mouseup",f,!1);window.removeEventListener("mousemove",e,!1);a.preventDefault()}function k(a){p.scrollClick=!1;p.prePos=p.pos;window.removeEventListener("touchend",k,!1);window.removeEventListener("touchmove",e,!1);a.preventDefault()}function e(c){var b=a.getCursorPosition(c,p.container);"h"==p.orientation?(p.pos=p.prePos-(p.initPos.x-
b.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-b.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();c.preventDefault()}function n(b){b.preventDefault();p.whichBtn=a.whichBtn(b);
"L"==p.whichBtn&&p.activeIfValue&&(p.up=!0,c(350,p.increase,!0,p.maximo))}function h(b){b.preventDefault();p.whichBtn=a.whichBtn(b);"L"==p.whichBtn&&p.activeIfValue&&(p.down=!0,c(350,p.decrease,!0,p.minimo))}function m(c){p.down=!1;a.clearTimeout(x);c.preventDefault()}function l(c){p.up=!1;a.clearTimeout(x);p.draw()}function v(c){p.down=!1;a.clearTimeout(x);p.draw()}var p=this,x;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",b);this.canvas.addEventListener("mousedown",b);this.divDown.addEventListener("mouseout",m);window.addEventListener("touchend",d);window.addEventListener("mouseup",d);this.canvas.addEventListener("touchmove",g);this.canvas.addEventListener("mousemove",g);this.scrollHandler.addEventListener("touchstart",function(c){p.activeIfValue&&(p.scrollClick=
!0,p.initPos=a.getCursorPosition(c,p.container),window.addEventListener("touchend",k),window.addEventListener("touchmove",e),c.preventDefault())});this.scrollHandler.addEventListener("mousedown",function(c){p.activeIfValue&&(p.scrollClick=!0,p.initPos=a.getCursorPosition(c,p.container),window.addEventListener("mouseup",f),window.addEventListener("mousemove",e),c.preventDefault())});this.divUp.addEventListener("touchstart",n);this.divUp.addEventListener("mousedown",n);this.divDown.addEventListener("touchstart",
h);this.divDown.addEventListener("mousedown",h);this.divUp.addEventListener("mouseout",function(c){p.up=!1;a.clearTimeout(x);c.preventDefault()});this.divDown.addEventListener("mouseout",m);window.addEventListener("touchend",l);window.addEventListener("mouseup",l);window.addEventListener("touchend",v);window.addEventListener("mouseup",v)};a.Scrollbar=y;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d=function(d,f){var b=a.Control.call(this,d,f)||this;b.controls=f.controls||!0;b.file=f.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(m){}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(){e=this.evaluator;"string"!==typeof this.file&&(this.tmpFile=e.eval(this.file),this.oldFile!==
this.tmpFile&&(this.oldFile=this.audio.src=this.tmpFile));(f=0<e.eval(this.drawif))?this.audio.style.display="block":(this.audio.style.display="none",f!==this.oldDrawIf&&this.audio.pause());this.oldDrawIf=f;this.updatePositionAndSize()};a.Audio=d;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d=function(d,f){var b=a.Control.call(this,d,f)||this;b.controls=f.controls||!0;b.file=f.file||"";b.oldDrawIf=0;e=b.evaluator;d=e.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;f=d.lastIndexOf(".");-1!=f&&(d=b.file.substring(0,f));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")&&(f=a.newHTML("source",{src:d+".mp4",type:"video/mp4"}),b.video.appendChild(f));b.video.canPlayType("video/ogg")&&(f=a.newHTML("source",{src:d+".ogg",type:"video/ogg"}),b.video.appendChild(f),f=a.newHTML("source",{src:d+".ogv",type:"video/ogg"}),b.video.appendChild(f));b.video.canPlayType("video/webm")&&
(f=a.newHTML("source",{src:d+".webm",type:"video/webm"}),b.video.appendChild(f));b.addControlContainer(b.video);e.setFunction(b.id+".play",function(){try{b.video.play()}catch(h){}return 0});e.setFunction(b.id+".pause",function(){try{b.video.pause()}catch(h){}return 0});e.setFunction(b.id+".stop",function(){try{b.video.pause(),b.video.currentTime=0}catch(h){}return 0});e.setFunction(b.id+".currentTime",function(a){try{b.video.currentTime=parseFloat(a)}catch(m){}return 0});b.video.addEventListener("timeupdate",
function(a){e.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(){e=this.evaluator;(f=0<e.eval(this.drawif))?this.video.style.display="block":(this.video.style.display="none",f!==this.oldDrawIf&&this.video.pause());this.oldDrawIf=f;this.updatePositionAndSize()};a.Video=d;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r=function(d,b){var f=a.Control.call(this,d,b)||this;f.font_family=b.font_family||"Monospaced";f.style=b.style||",PLAIN,";f.font_size=b.font_size||12;typeof("number"!==f.font_size)&&(f.font_size=f.evaluator.eval(f.font_size));f.font=f.font_family+f.style+f.font_size;f.region="interior";f.tabindex=++f.parent.tabindex;if(f.answer){f.answer.match("krypto_")&&(f.answer=(new a.Krypto).decode(f.answer.substring(7)));var e=f.parent.lessonParser.parseText(f.answer)}f.containerControl=
a.newHTML("div",{class:"DescartesTextAreaContainer",id:f.id,spellcheck:"false"});f.textArea=a.newHTML("div",{class:"DescartesTextAreaContainer",contenteditable:"true"});f.textAreaAnswer=a.newHTML("div",{class:"DescartesTextAreaContainer"});f.showButton=a.newHTML("div",{class:"DJS_Gradient"});f.activeCover=a.newHTML("div");f.containerControl.appendChild(f.textArea);f.containerControl.appendChild(f.textAreaAnswer);f.containerControl.appendChild(f.showButton);f.containerControl.appendChild(f.activeCover);
f.addControlContainer(f.containerControl);f.showAnswer=!1;f.text=void 0==f.text||"simpleText"==f.text.type?f.rawText||"":f.text.hasFormula?f.rawText:f.text.toHTML();e&&"simpleText"!==e.type&&(f.answer=f.text.hasFormula?"":e.toHTML());f.evaluator.setVariable(f.id,f.text);var g,l,c;f.evaluator.setFunction(f.id+".insertAtCursor",function(a){(g=window.getSelection())&&g.getRangeAt&&g.rangeCount&&(c=document.createTextNode(a),l=g.getRangeAt(0),l.deleteContents(),l.insertNode(c),l.setStart(c,c.length),
l.setEnd(c,c.length),g.removeAllRanges(),g.addRange(l),f.textArea.focus());return 0});f.evaluator.setFunction(f.id+".update",function(){f.update()});f.addEvents();f.init();return f};$jscomp.inherits(r,a.Control);r.prototype.init=function(){f=this.answer?28:4;e=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-f)+"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(){e=this.evaluator;this.activeIfValue=0<e.eval(this.activeif);this.drawIfValue=0<e.eval(this.drawif);e.getVariable(this.id)!==this.oldValue&&(this.textArea.innerText=
(e.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," ");e.setVariable(this.id,d);this.oldFieldValue=d;this.oldValue=e.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 e=2*Math.PI,f,d,r,l,b,h,m,g,q,c,v,k,u=function(b,g){var f=a.Control.call(this,b,g)||this;d=b.evaluator.parser;f.spaceID=g.spaceID||"";f.text=g.text||"";f.size=g.size||d.parse("4");f.font=g.font||"Monospaced,PLAIN,12";f.image=new Image;f.image.onload=function(){this.ready=1};f.imageSrc=g.imageSrc||"";f.font=a.convertFont(f.font);if(f.constraintExpr){f.constraint=d.parse(f.constraintExpr);"(expr)"==f.constraint.type&&(f.constraint=d.parse(f.constraintExpr.substring(1,
f.constraintExpr.length-1)));if("compOperator"==f.constraint.type){g=f.constraint.childs[0];var k=f.constraint.childs[1];"identifier"!=g.type||"y"!=g.value||k.contains("y")?"identifier"!=g.type||"x"!=g.value||k.contains("x")?f.newt=new a.R2Newton(f.evaluator,f.constraint):(f.constVar="y",f.noConstVar="x",f.evalConst=f.evalConstXoY,f.constraint=k):(f.constVar="x",f.noConstVar="y",f.evalConst=f.evalConstXoY,f.constraint=k)}else f.constraint=null;c=new a.R2(0,0)}f.container=f.getContainer();f.mouseCatcher=
a.newHTML("div",{class:"DescartesGraphicControl",id:f.id,dragged:!0,tabindex:"-1",style:"cursor:pointer;background-color:rgba(0,0,0,0);z-index:"+f.zIndex+";"});f.ctx=f.space.ctx;f.container.appendChild(f.mouseCatcher);f.addEvents();f.xStr=f.id+".x";f.yStr=f.id+".y";f.activoStr=f.id+".activo";f.activeStr=f.id+".active";""!==f.space.id&&2!==b.version?(f.mxStr=f.space.id+".mouse_x",f.myStr=f.space.id+".mouse_y",f.mclickedStr=f.space.id+".mouse_clicked",f.mclicizquierdoStr=f.space.id+".clic_izquierdo"):
(f.mxStr="mouse_x",f.myStr="mouse_y",f.mclickedStr="mouse_clicked",f.mclicizquierdoStr="clic_izquierdo");f.init();return f};$jscomp.inherits(u,a.Control);u.prototype.init=function(){f=this.evaluator;v=a.hasTouchSupport;var c=f.eval(this.expresion);this.x=c[0][0];this.y=c[0][1];f.setVariable(this.xStr,this.x);f.setVariable(this.yStr,this.y);""==this.imageSrc||this.imageSrc.toLowerCase().match(/vacio.gif$/)?(this.width=2*f.eval(this.size),this.height=2*f.eval(this.size),this._w=v&&48>this.width?48:
this.width,this._h=v&&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";f.setVariable(this.activoStr,0);f.setVariable(this.activeStr,0);this.setImage=!1;this.update()};u.prototype.update=function(){f=this.evaluator;this.activeIfValue=0<f.eval(this.activeif);this.drawIfValue=0<f.eval(this.drawif);this.x=f.getVariable(this.xStr);this.y=f.getVariable(this.yStr);r=this.space.getAbsoluteX(this.x);l=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(l-this._h/2)+"px";this.constraint&&this.evalConst();this.draw()};u.prototype.draw=function(){f=this.evaluator;this.drawIfValue&&(g=this.ctx,q=this.space.backgroundCtx,r=parseInt(this.space.getAbsoluteX(this.x))+.5,l=parseInt(this.space.getAbsoluteY(this.y))+.5,""!=this.text&&this.drawText(r,l),this.image.ready?(b=this.image.width/2,h=this.image.height/2,this.image.complete&&!this.setImage&&g.drawImage(this.image,parseInt(r-b),parseInt(l-
h)),this.trace&&(q.save(),q.translate(r,l),q.scale(parseInt(b),parseInt(h)),q.beginPath(),q.arc(0,0,1,0,e),q.restore(),q.lineWidth=1,q.strokeStyle=this.trace.getColor(),q.stroke())):(b=parseInt(this.width/2),g.beginPath(),g.arc(r,l,b,0,e),g.fillStyle=this.colorInt.getColor(),g.fill(),g.lineWidth=1,g.strokeStyle=this.color.getColor(),g.stroke(),this.active&&(g.strokeStyle=this.colorInt.borderColor(),g.beginPath(),g.arc(r,l,b-2,0,e),g.stroke()),this.trace&&(q.strokeStyle=this.trace.getColor(),q.beginPath(),
q.arc(r,l,b,0,e),q.stroke())))};u.prototype.evalConst=function(){c.set(this.x,this.y);m=this.newt.findZero(c,1/this.space.scale,!0);this.x=m.x;this.y=m.y;this.evaluator.setVariable(this.xStr,this.x);this.evaluator.setVariable(this.yStr,this.y)};u.prototype.evalConstXoY=function(){f=this.evaluator;k=f.getVariable(this.constVar);f.setVariable(this.constVar,this[this.constVar]);this[this.noConstVar]=f.eval(this.constraint);f.setVariable(this.xStr,this.x);f.setVariable(this.yStr,this.y);f.setVariable(this.constVar,
k)};u.prototype.drawText=function(a,c){g=this.ctx;f=this.evaluator;"simpleText"==this.text.type?(g.fillStyle=this.color.getColor(),g.font=this.font,g.textBaseline="alphabetic",g.fillText(this.text.toString(f.eval(this.decimals),this.fixed),parseInt(a+1+this.width/2),parseInt(c-1-this.height/2))):(g.fillStyle=this.color.getColor(),g.strokeStyle=this.color.getColor(),g.textBaseline="alphabetic",this.text.draw(g,parseInt(a+1+this.width/2),parseInt(c-1-this.height/2),this.decimals,this.fixed,"start",
!0,this.color.getColor()))};u.prototype.getContainer=function(){for(var a=this.parent.spaces,c,b=0,d=a.length;b<d;b++)if(c=a[b],c.id==this.spaceID)return c.addCtr(this),this.zIndex=c.zIndex,this.space=c,c.graphicControlContainer;a[0].addCtr(this);this.zIndex=a[0].zIndex;this.space=a[0];return a[0].graphicControlContainer};u.prototype.deactivate=function(){this.active=!1;this.evaluator.setVariable(this.activoStr,0);this.evaluator.setVariable(this.activeStr,0);this.evaluator.setVariable(this.mclicizquierdoStr,
0)};u.prototype.addEvents=function(){function c(c){document.body.focus();c.preventDefault();k.whichBtn=a.whichBtn(c);"L"==k.whichBtn&&k.activeIfValue&&(k.parent.deactivateGraphicControls(),k.click=k.active=!0,k.evaluator.setVariable(k.activoStr,1),k.evaluator.setVariable(k.activeStr,1),k.evaluator.setVariable(k.mclickedStr,0),k.evaluator.setVariable(k.mclicizquierdoStr,0),k.posAnte=a.getCursorPosition(c,k.container),k.prePos={x:k.space.getAbsoluteX(k.x),y:k.space.getAbsoluteY(k.y)},k.evaluator.setVariable(k.mxStr,
k.space.getRelativeX(k.posAnte.x)),k.evaluator.setVariable(k.myStr,k.space.getRelativeY(k.posAnte.y)),k.parent.update(),window.addEventListener("touchend",b),window.addEventListener("touchmove",d),window.addEventListener("mouseup",b),window.addEventListener("mousemove",d))}function b(c){document.body.focus();c.preventDefault();c.stopPropagation();k.evaluator.setVariable(k.mclickedStr,1);k.evaluator.setVariable(k.mclicizquierdoStr,1);if(k.activeIfValue||k.active)k.click=!1,window.removeEventListener("mouseup",
b),window.removeEventListener("mousemove",d),window.removeEventListener("touchend",b),window.removeEventListener("touchmove",d),f=a.getCursorPosition(c,k.container)||f,k.posX=k.prePos.x-(k.posAnte.x-f.x),k.posY=k.prePos.y-(k.posAnte.y-f.y),k.evaluator.setVariable(k.xStr,k.space.getRelativeX(k.posX)),k.evaluator.setVariable(k.yStr,k.space.getRelativeY(k.posY)),k.evaluator.setVariable(k.mxStr,k.space.getRelativeX(f.x)),k.evaluator.setVariable(k.myStr,k.space.getRelativeY(f.y)),k.parent.updateControls(),
k.parent.update(),k.mouseCatcher.style.left=k.space.getAbsoluteX(k.x)-k._w/2+"px",k.mouseCatcher.style.top=k.space.getAbsoluteY(k.y)-k._h/2+"px";k.parent.deactivateGraphicControls();k.parent.updateControls()}function d(c){c.preventDefault();k.evaluator.setVariable(k.mclickedStr,0);k.evaluator.setVariable(k.mclicizquierdoStr,0);f=a.getCursorPosition(c,k.container);k.posX=k.prePos.x-(k.posAnte.x-f.x);k.posY=k.prePos.y-(k.posAnte.y-f.y);k.evaluator.setVariable(k.xStr,k.space.getRelativeX(k.posX));k.evaluator.setVariable(k.yStr,
k.space.getRelativeY(k.posY));k.evaluator.setVariable(k.mxStr,k.space.getRelativeX(f.x));k.evaluator.setVariable(k.myStr,k.space.getRelativeY(f.y));80<Date.now()-g&&(k.parent.updateControls(),k.parent.update(),g=Date.now())}var g=0,f,k=this;this.active=this.over=this.click=!1;this.mouseCatcher.oncontextmenu=function(){return!1};this.mouseCatcher.addEventListener("touchstart",c);this.mouseCatcher.addEventListener("mousedown",c);this.mouseCatcher.addEventListener("mouseover",function(a){k.over=!0});
this.mouseCatcher.addEventListener("mouseout",function(a){k.over=!1;k.click=!1})};a.GraphicControl=u;return a}(descartesJS||{});
descartesJS=function(a,e){var f,d,r,l,b,h,m,g,q,c;function v(a){return a.charAt(0).toUpperCase()+a.substring(1)}if(a.loadLib)return a;var k=/[\w-//]*(\.png|\.jpg|\.gif|\.svg)/gi,u,x,p,n,B,w,y,A,E,J,F,H,z,I,C,M,N,O,G,D,K,L,P,Q,R,W,V,U,T,S=function(c){this.parent=c;this.parser=c.evaluator.parser;this.RTFparser=new a.RTFParser(c.evaluator)};S.prototype.parseButtonsConfig=function(a){var c={rowsNorth:0,rowsSouth:0,widthEast:125,widthWest:125,height:23};a=this.split(a);for(var b=0,d=a.length;b<d;b++)switch(p=
a[b][0],n=a[b][1],x=e[p],x){case "rowsNorth":case "rowsSouth":case "widthEast":case "widthWest":case "height":c[x]=parseInt(n);break;case "about":case "config":case "init":case "clear":c[x]="true"===e[n];break;default:console.warn("Propiedad de botones no identificada: <"+p+"> valor: <"+n+">")}return c};S.prototype.parseSpace=function(c){B={};c=this.split(c);for(var b=0,d=c.length;b<d;b++)switch(p=c[b][0],n=c[b][1],x=e[p],a.DEBUG.paramName=p,a.DEBUG.objectName="Space",x){case "type":if("R2"===n||
"R3"===n)n=e[n];B[x]=n;break;case "id":a.DEBUG.idName=n;case "x_axis":case "y_axis":case "cID":case "file":case "border_width":case "border_radius":case "info":B[x]=n;break;case "fixed":case "numbers":case "sensitive_to_mouse_movements":case "3D":case "split":case "resizable":B[x]="true"===e[n];break;case "bg_display":case "render":B[x]=e[n];break;case "borderColor":case "net":case "net10":case "axes":case "text":B[x]=""!=n?"false"===e[n]?"":new a.Color(n,this.parent.evaluator):"";break;case "O.x":B.OxExpr=
n;break;case "O.y":B.OyExpr=n;break;case "image":B.imageSrc=n;break;case "x":u=n;"%"===u[u.length-1]?(B.xPercentExpr=u.trim(),u=(this.parent.container.width*parseFloat(u)/100).toString()):u=n;B.xExpr=this.parser.parse(u);break;case "y":u=n;"%"===u[u.length-1]?(B.yPercentExpr=u.trim(),u=(this.parent.container.height*parseFloat(u)/100).toString()):u=n;B.yExpr=this.parser.parse(u);break;case "width":u=n.trim();B.wModExpr=u;"%"===u[u.length-1]?(B.wExpr=u,u=this.parent.container.width*parseFloat(u)/100):
(u=parseFloat(n),u!=n&&(u=this.parent.container.width,B._w_=n.trim()));B.w=u;break;case "height":u=n.trim();B.hModExpr=u;"%"===u[u.length-1]?(B.hExpr=u,u=this.parent.container.height*parseFloat(u)/100):(u=parseFloat(n),u!=n&&(u=this.parent.container.height,B._h_=n.trim()));B.h=u;break;case "drawif":""!=n&&(B.drawif=this.parser.parse(n));break;case "scale":u=parseFloat(n);isNaN(u)&&(u=48);B.scale=u;break;case "background":B.background=new a.Color(n,this.parent.evaluator);break;default:console.warn("Propiedad del espacio no identificada: <"+
p+"> valor: <"+n+">")}return new a["Space"+B.type](this.parent,B)};S.prototype.parseControl=function(c){w={type:"Numeric",gui:"Spinner"};c=this.split(c);for(var b=0,d=c.length;b<d;b++)switch(p=c[b][0],n=c[b][1],x=e[p],a.DEBUG.paramName=p,a.DEBUG.objectName="Control",x){case "type":u=e[n.trim()];"graphic"===u?u="GraphicControl":"text"===u&&(u="TextArea");w.type=v(u);break;case "gui":u=e[n];"textfield"===u&&(u="TextField");w[x]=v(u);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 "extra_style":case "info":w[x]=
n;break;case "region":case "action":case "msg_pos":case "poster":case "text_align":case "image_align":case "btn_pos":w[x]=e[n];break;case "fixed":case "visible":case "discrete":case "onlyText":case "evaluate":case "autoplay":case "loop":case "controls":case "flat":w[x]="true"===e[n];break;case "color":case "colorInt":case "label_color":case "label_text_color":case "trace":w[x]=new a.Color(n,this.parent.evaluator);break;case "font_size":case "drawif":case "activeif":case "decimals":case "min":case "max":case "size":""!==
n&&(w[x]=this.parser.parse(n));break;case "constraint":w.constraintExpr=n;break;case "image":w.imageSrc=n;break;case "image_dec":w.image_dec_src=n;break;case "image_inc":w.image_inc_src=n;break;case "space":w.spaceID=n;break;case "expresion":w.expresion=this.parser.parse(n.replace(")(",","));break;case "borderColor":w[x]="false"===e[n]?"":n;break;case "bold":"false"!=e[n]&&(w.bold="bold");break;case "italics":"false"!=e[n]&&(w.italics="italic");break;case "underlined":"false"!=e[n]&&(w.underlined=
!0);break;case "value":var g=n.replace(/&squot;/g,"'");g.match(/^\|/)&&(g="'"+g.substring(1),g.match(/\|$/)&&(g=g.substring(0,g.length-1)+"'"));w.valueExpr=this.parser.parse(g);w.valueExprString=g;break;case "incr":0!=n&&(w.incr=this.parser.parse(n));break;case "exponentialif":w.exponentialif=parseFloat(n);break;case "text":w.rawText=n;g=this.parseText(n);for(var f=0,k=g.length;f<k;f++)g[f]=this.parser.parse(g[f],!1);w.text=g;break;default:f=p.indexOf("."),g=e[p.substring(0,f)],f=e[p.substring(f+
1)],"parameter"===g&&"font"===f?w.parameterFont=n:"Explanation"===g&&"font"===f?w.ExplanationFont=n:"tooltip"===g&&"font"===f?w.tooltipFont=n:console.warn("Propiedad de control no identificada: <"+p+"> valor: <"+n+">")}return new a["Numeric"===w.type?w.gui:w.type](this.parent,w)};S.prototype.parseGraphic=function(c,b,d,g){y={rotateExp:g,parameter:"t"};c=this.split(c);g=0;for(var f=c.length;g<f;g++)if(p=c[g][0],n=c[g][1],x=e[p],a.DEBUG.paramName=p,a.DEBUG.objectName="Graphic",""!=n)switch(x){case "type":a.DEBUG.idName=
n;y[x]=v(e[n]);break;case "align":case "anchor":case "lineDash":y[x]=e[n];break;case "background":case "abs_coord":case "visible":case "editable":case "fixed":case "vectors":case "bold":case "italics":case "underlined":y[x]="true"===e[n];break;case "color":case "fill":case "fillP":case "fillM":case "arrow":case "trace":y[x]="false"===e[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[x]=
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[x]=this.parser.parse(n));break;case "font_size":n=n.trim();n.match(/^\[.*\]?/)&&(n=n.substring(1,n.length-1));""!==n&&(y[x]=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 h=n.replace(/&squot;/g,"'");"["===h.charAt(0)&&"]"===h.charAt(h.length-1)&&(h=h.substring(1,h.length-1));h.match(k)&&(h="'"+h+"'");y.file=this.parser.parse(h);break;case "border":""!=n&&"false"!=e[n]&&(y.border=new a.Color(n,this.parent.evaluator));break;default:if(void 0!=y.family&&p.substring(0,y.family.length+1)===y.family+".")switch(e[p.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&&p.match(y.parameter+"."))switch(y.parameter!==p.substring(0,p.indexOf(y.parameter)+y.parameter.length)&&(y.parameter=p.substring(0,p.indexOf(y.parameter)+y.parameter.length)),e[p.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: <"+p+"> valor: <"+n+">")}b&&(y.abs_coord=
b);d&&(y.background=d);return new a[y.type](this.parent,y)};S.prototype.parse3DGraphic=function(c,b,d,g){y={rotateExp:g,parameter:"t"};c=this.split(c);b=0;for(d=c.length;b<d;b++)switch(p=c[b][0],n=c[b][1],x=e[p],a.DEBUG.paramName=p,a.DEBUG.objectName="Graphic3D",x){case "type":a.DEBUG.idName=n;u=e[n];switch(u){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=
u,u="OtherGeometry"}y[x]=v(u);break;case "model":case "lineDash":y[x]=e[n];break;case "fill":y[x]="false"===e[n]?"":new a.Color(n,this.parent.evaluator);break;case "background":case "fixed":case "split":case "bold":case "italics":case "underlined":y[x]="true"===e[n];break;case "edges":"false"===e[n]?y[x]="":("true"===e[n]&&(n="808080"),y[x]=new a.Color(n,this.parent.evaluator));break;case "color":case "backcolor":y[x]=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[x]=this.parser.parse(n));break;case "family":case "parameter":case "font":case "font_family":case "name":case "inirot":case "endrot":case "info":y[x]=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":g=n.replace(/&squot;/g,"'");"["===g.charAt(0)&&"]"===g.charAt(g.length-1)&&(g=g.substring(1,g.length-1));
g.match(/./)&&(g="'"+g+"'");y.file=this.parser.parse(g);break;default:void 0!==y.family&&p.substring(0,y.family.length+1)===y.family+"."?"interval"===e[p.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: <"+p+"> valor: <"+n+">")}return new a[y.type+"3D"](this.parent,y)};S.prototype.parseAuxiliar=function(c){A={};c=this.split(c);for(var b=0,d=c.length;b<d;b++)c[b][1]=
c[b][1].replace(/&squot;/g,"'");b=0;for(d=c.length;b<d;b++)switch(p=c[b][0],n=c[b][1],x=e[p],a.DEBUG.paramName=p,a.DEBUG.objectName="Auxiliar",x){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":A[x]=n.replace(/&squot;/g,"'");break;case "editable":case "constant":case "array":case "matrix":case "algorithm":case "event":case "sequence":A[x]="true"===
e[n];break;case "size":case "rows":case "columns":case "x":case "y":case "width":case "height":A[x]=this.parser.parse(n);break;case "evaluate":case "execution":case "msg_pos":case "action":case "type":A[x]=e[n];break;default:var g=p.indexOf("."),f=e[p.substring(0,g)];g=e[p.substring(g+1)];"parameter"===f&&"font"===g?A.parameterFont=n:console.warn("Propiedad del auxiliar no identificada: <"+p+"> valor: <"+n+">")}A.sequence?A.type="sequence":A.constant?A.type="constant":A.algorithm&&A.evaluate?A.type=
"algorithm":A.array&&!A.matrix&&")"!=A.id.charAt(A.id.length-1)?A.type="vector":A.matrix&&")"!=A.id.charAt(A.id.length-1)?A.type="matrix":A.event&&")"!=A.id.charAt(A.id.length-1)?A.type="event":"library"===A.type?A.type="library":")"===A.id.charAt(A.id.length-1)?A.type="function":A.type="variable";a.DEBUG.typeName=A.type;switch(A.type){case "sequence":new a.Function(this.parent,A);break;case "constant":c=new a.Constant(this.parent,A);A.evaluate&&"always"===A.evaluate&&this.parent.auxiliaries.push(c);
break;case "algorithm":this.parent.auxiliaries.push(new a.Algorithm(this.parent,A));break;case "vector":c=new a.Vector(this.parent,A);A.evaluate&&"always"===A.evaluate&&this.parent.auxiliaries.push(c);break;case "matrix":c=new a.Matrix(this.parent,A);A.evaluate&&"always"===A.evaluate&&this.parent.auxiliaries.push(c);break;case "event":this.parent.events.push(new a.Event(this.parent,A));break;case "library":new a.Library(this.parent,A);break;case "variable":new a.Variable(this.parent,A);break;default:new a.Function(this.parent,
A)}};S.prototype.parseAction=function(c){E=c.action;J=c.parent;F=c.parameter;return E?new (a[v(E)])(J,F):{execute:function(){}}};S.prototype.parseAnimation=function(c){var b={};c=this.split(c);for(var d=0,g=c.length;d<g;d++)switch(p=c[d][0],n=c[d][1],x=e[p],x){case "id":case "delay":case "init":case "doExpr":case "whileExpr":b[x]=n.replace(/&squot;/g,"'");break;case "controls":case "auto":case "loop":case "algorithm":case "evaluate":b[x]="true"===e[n];break;default:console.warn("Propiedad de la animaci\u00f3n no identificada: <"+
p+">  <"+n+">")}return new a.Animation(this.parent,b)};S.prototype.parsePleca=function(k,e){k=this.split(k);d=f="";r=0;l="#536891";b="white";h="left";m="";g="SansSerif,BOLD,20";q="SansSerif,PLAIN,18";c=void 0;for(var v=0,x=k.length;v<x;v++)switch(p=k[v][0],n=k[v][1],p){case "title":f=n;break;case "subtitle":d=n;break;case "subtitlines":r=n;break;case "bgcolor":""!=n&&(l=(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":m=n;break;case "titlefont":g=""!=n?a.convertFont(n):a.convertFont(g);break;case "subtitlefont":q=""!=n?a.convertFont(n):a.convertFont(q);break;default:console.warn("Propiedad de la pleca no identificada: <"+p+">  <"+n+">")}if(""===f&&""===d)return a.newHTML("div");O=q.substring(0,q.indexOf("px"));O=O.substring(O.lastIndexOf(" "));""!=m&&(G=this.parent.getImage(m),D=G.height);c=a.newHTML("div",{id:"descartesPleca"});D?(c.setAttribute("style",
"position:absolute;left:0;top:0;text-align:"+h+";width:"+e+"px;height:"+D+"px;background-color:"+l+";color:"+b+";padding-top:8px;padding:8px 15px 8px 15px;margin:0;overflow:hidden;z-index:1;"),G.setAttribute("style","position: absolute;left:0;top:0;z-index:-1;width:100%;height:100%;"),c.appendChild(G)):c.setAttribute("style","position:absolute;left:0;top:0;text-align:"+h+";width:"+e+"px;background:"+l+";color:"+b+";padding:12px 15px 12px 15px;margin:0;z-index:100;");K=a.newHTML("div",{style:"padding:0;margin:0;font:"+
g+";overflow:hidden;white-space:nowrap;"});K.innerHTML=f;L=a.newHTML("div");if(1===parseInt(r)){V=0;P=a.newHTML("div");P.innerHTML=d;document.body.appendChild(P);R=O;do R-=V,P.setAttribute("style","padding:0;margin:0;font:"+q+";font-size:"+R+"px;width:"+(e-30)+"px;line-height:"+R+"px;"),Q=P.offsetHeight,W=Q/R,V=1;while(1<W&&8<R);document.body.removeChild(P);L.setAttribute("style","padding:0;margin:0;font:"+q+";font-size:"+R+"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");z=I=M=0;for(C=N=!1;z<a.length;)" "!==a.charAt(z)||C||z++," "===a.charAt(z)||C||(C=!0,M=z),"="!==a.charAt(z)||"'"!==a.charAt(z+1)||N||(N=!0,H[I]=[a.substring(M,z)],M=z+2,z+=2),N&&"'"===a.charAt(z)&&(C=N=!1,H[I].push(a.substring(M,z)),I++),"="!==a.charAt(z)||"'"===a.charAt(z+1)||
N||(H[I]=[a.substring(M,z)],M=z+1,z++,U=a.substring(z).indexOf("="),-1===U?T=U=a.length:(U+=z,T=a.substring(z,U).lastIndexOf(" "),T=-1===T?a.length:T+z),H[I].push(a.substring(M,T)),I++,C=!1,z=T),z++;return H};S.prototype.parseText=function(c){c=c||"";return c.match(/^\{\\rtf1/)?this.RTFparser.parse(c.substring(10)):new a.SimpleText(this.parent,c)};a.LessonParser=S;return a}(descartesJS||{},babel);
descartesJS=function(a){function e(a,c){if(0==c)return 1;if(0>c)return NaN;if(0<=a||h(c)===c)return Math.pow(a,c);if(0>a){var b=1/c,d=h(b);if(d===b&&1===d%2)return-Math.pow(-a,c)}return NaN}function f(a,c){x=[];x.type="matrix";x.rows=a;x.cols=c;n=0;for(B=c;n<B;n++)x[n]=Array(a).fill(0);return x}function d(a,c){k=a.rows;u=a.cols;x=f(k,u);var b;for(n=0;n<k;n++)for(p=0;p<u;p++){for(B=b=0;B<u;B++)b+=a[B][n]*c[p][B];x[p][n]=b}return x}function r(a,c,b){for(var d=f(b.length-1,b.length-1),g=0,k=d.length;g<
k;g++)for(var e=0;e<k;e++)d[g][e]=g<a?e<c?b[g][e]:b[g][e+1]:g<c?b[g+1][e]:b[g+1][e+1];return d}function l(a){if(1<a.cols){for(var c=0,b=1,d=0,g=a.cols;d<g;d++)c+=b*a[0][d]*l(r(0,d,a)),b=-b;return c}return a[0][0]}if(a.loadLib)return a;var b={},h=Math.floor,m,g,q,c,v,k,u,x,p,n,B,w=function(a,c){this.sep="";this.type=a;this.value=c;this.parent=null;this.childs=[]};w.prototype.getRoot=function(){return null===this.parent?this:this.parent.getRoot()};w.prototype.addChild=function(a){a.parent=this;this.childs.push(a)};
w.prototype.replaceLastChild=function(a){q=this.childs.length-1;g=this.childs[q];g.parent=null;this.childs[q]=a;a.parent=this;return a};w.prototype.contains=function(a){if(this.value===a)return!0;for(var c=0,b=this.childs.length;c<b;c++)if(this.childs[c].contains(a))return!0;return!1};w.prototype.equalToMinus=function(){return"compOperator"===this.type?(this.type="operator",this.value="-",v=new w("compOperator","=="),v.addChild(this),v.addChild(new w("number","0")),c=this.getRoot(),c.setAllEvalFun(),
c):this};w.prototype.setAllEvalFun=function(){this.setEvalFun();for(var a=0,c=this.childs.length;a<c;a++)this.childs[a].setAllEvalFun()};w.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 g;this.evaluate=function(a){try{return g=a.getVector(this.value,this.childs[0].childs[0].evaluate(a)),void 0!==g?g: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 g=a.getMatrix(this.value,this.childs[0].childs[0].evaluate(a),this.childs[0].childs[1].evaluate(a)),void 0!==g?g:0}catch(N){return 0}};else if("identifier"===this.type&&"parentheses"===this.childs[0].type){var v,q,w;this.evaluate=function(a){v=[];for(var c=0,d=this.childs[0].childs.length;c<d;c++)v[c]=this.childs[0].childs[c].evaluate(a);if("_Eval_"===this.value){m=0<v.length?v[0]:0;if("number"==
typeof m)return"NaN";m.match(",")&&parseFloat(m.replace(",","."))==m.replace(",",".")&&(m=m.replace(",","."));if(void 0==b[m]){q=m.match(/:=/g)?!0:!1;if(m.match(";")){var g=!1,f=[],k=0;c=0;for(d=m.length;c<d;c++){var e=m.charAt(c);"'"===e&&(g=!g);g||";"!==e||(f.push(m.substring(k,c)),k=c+1)}f.push(m.substring(k));m="("+f.join(")(")+")"}b[m]=a.parser.parse(m,q)}w=a.eval(b[m]);return void 0!=w?w:NaN}return a.functions[this.value].apply(a,v)}}else if("operator"===this.type)"+"===this.value?this.evaluate=
function(c){var b=this.childs[0].evaluate(c,!0);c=this.childs[1].evaluate(c,!0);if("matrix"!==b.type||"matrix"!==c.type)return"number"==typeof b&&"string"==typeof c?b=a.removeNeedlessDecimals(b.toString()):"string"==typeof b&&"number"==typeof c&&(c=a.removeNeedlessDecimals(c.toString())),b+c;k=b.rows;u=b.cols;x=f(k,u);for(n=0;n<k;n++)for(p=0;p<u;p++)x[p][n]=b[p][n]+c[p][n];return x}:"-"===this.value?this.evaluate=function(a){var c=this.childs[0].evaluate(a,!0);a=this.childs[1].evaluate(a,!0);if("matrix"!==
c.type||"matrix"!==a.type)return c-a;k=c.rows;u=c.cols;x=f(k,u);for(n=0;n<k;n++)for(p=0;p<u;p++)x[p][n]=c[p][n]-a[p][n];return x}:"*"===this.value?this.evaluate=function(a){var c=this.childs[0].evaluate(a,!0);a=this.childs[1].evaluate(a,!0);return"matrix"!==c.type||"matrix"!==a.type?c*a:d(c,a)}:"/"===this.value?this.evaluate=function(a){var c=this.childs[0].evaluate(a,!0);a=this.childs[1].evaluate(a,!0);if("matrix"!==c.type||"matrix"!==a.type)return c/a;var b=f(a.length,a.length),g=l(a);if(0===g)a=
0;else{g=1/g;if(1<a.length)for(var k=0,e=a.length;k<e;k++){var n=g;for(var h=0;h<e;h++)b[h][k]=n*l(r(k,h,a)),n=-n;g=-g}else b[0][0]=g;a=b}c=0===a?f(c.rows,c.cols):d(c,a);return c}:"%"===this.value?this.evaluate=function(a){var c=this.childs[0].evaluate(a);a=this.childs[1].evaluate(a);return c-h(c/a)*a}:"^"===this.value&&(this.evaluate=function(a){var c=this.childs[0].evaluate(a);a=this.childs[1].evaluate(a);return 0<=a?e(c,a):1/e(c,-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,c){return this.childs[0].evaluate(a,c)};else if("(expr)"===this.type||"[expr]"===this.type)this.evaluate=function(a){var c=this.childs.length,b=[];if(1===c&&1===this.childs[0].childs.length&&"(expr)"===this.type)b=
this.childs[0].childs[0].evaluate(a);else for(var d=0;d<c;d++){var g=[];for(var f=0,k=this.childs[d].childs.length;f<k;f++)g.push(this.childs[d].childs[f].evaluate(a));b[d]=g}return b};else if("asign"===this.type){var B,z=this.childs[0],I=this.childs[1],C=z.childs[0]?z.childs[0].childs:null;this.evaluate=1===z.childs.length&&"square_bracket"===z.childs[0].type&&1===C.length?function(a){B=I.evaluate(a);a.setVector(z.value,C[0].evaluate(a),B);return B}:1===z.childs.length&&"square_bracket"===z.childs[0].type&&
2===C.length?function(a){B=I.evaluate(a);a.setMatrix(z.value,C[0].evaluate(a),C[1].evaluate(a),B);return B}:function(a){B=I.evaluate(a);return B.type?a.matrices[z.value]=B:"object"!==typeof a.variables[z.value]?a.variables[z.value]=B:0}}};a.Node=w;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b,h,m,g=/^\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]+/,v=/^==|^!=|^<=|^<|^>=|^>|^#/,k=/^!|^~|^&&|^&|^\|\||^\|/,u=/^=|^:=/,x=/^[\?:]/,p=/^[\+\-\*\/%\^\u2212\u00b7\u00D7\u00F7]/,n=/^\[|^\]/,B=/^\(|^\)/,w=/^,/,y=/^;/,A=/\|/g,E=/\|\*/g,J=/\*\|/g,F,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/,
z=function(){};z.prototype.tokenize=function(z){function F(a,c,d){f.push({type:a,value:c});b=b.slice(d);r+=d;m=a}if(e=z){var H=z.indexOf("//");0<=H&&":"!==z[H-1]&&(z=z.substring(0,H));z=z.replace(/\\u(\S+) /g,function(a,c){return 39!==parseInt(c,16)?String.fromCharCode(parseInt(c,16)):a});z=z.replace(/&sup(.+);/g,"^ $1 ");z=z.replace(/&squot;/g,"'");z.match(/=\|\*/g)&&(z=z.replace(E,"'").replace(J,"'"));z.match(/=\|/g)&&(z=z.replace(A,"'"));H=z.trim();"|"==H.charAt(0)&&"|"==H.charAt(H.length-1)&&
(z=H.replace(A,"'"))}f=[];d=!1;r=0;b=z;for(m="";z&&r<z.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"+e+"\u300b");return}l=b.substring(1,h);F("string",l,l.length+2)}else if(l=b.match(g))b=b.slice(l[0].length),r+=l[0].length;else if(l=b.match(p))l[0]=l[0].replace(/\u00F7/g,"/").replace(/\u2212/g,"-").replace(/\u00b7/g,"*").replace(/\u00D7/g,"*"),F("operator",l[0],l[0].length);else if(l=b.match(q))"number"===m&&
f.push({type:"operator",value:"*"}),F("identifier",l[0],l[0].length);else if(l=b.match(c))F("number",l[0],l[0].length);else if(l=b.match(v))H=l[0],"#"==H&&(H="!="),F("compOperator",H,l[0].length);else if(l=b.match(k))H=l[0],"||"==H?H="|":"&&"==H?H="&":"~"==H&&(H="!"),F("boolOperator",H,l[0].length);else if((l=b.match(u))&&!b.match(/^==/))F("asign",l[0],l[0].length);else if(l=b.match(x))F("conditional",l[0],l[0].length);else if(l=b.match(n))F("square_bracket",l[0],l[0].length);else if(l=b.match(B))"("==
l&&"number"===m&&f.push({type:"operator",value:"*"}),F("parentheses",l[0],l[0].length);else if(l=b.match(w))F("separator",l[0],l[0].length);else if(178===b.charCodeAt(0))f.push({type:"operator",value:"^"}),F("number",2,1);else if(179===b.charCodeAt(0))f.push({type:"operator",value:"^"}),F("number",3,1);else if(l=b.match(y))F("final_of_expression",l[0],l[0].length);else if(d==r){a.DEBUG.setError(a.DEBUG.EXPRESSION,e);return}return f};z.prototype.flatTokens=function(a,c){a=a||[];c=c||"";F="";for(var b=
0,d=a.length;b<d;b++)F="string"==a[b].type?F+"&squot;"+a[b].value+"&squot;":"identifier"!=a[b].type||a[b].value.match(H)?F+a[b].value:F+c+a[b].value;return F};a.Tokenizer=z;return a}(descartesJS||{});
descartesJS=function(a){function e(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 f(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,l,b,h,m,g,q,c,v,k,u,x,p=function(c){this.evaluator=c;this.tokenizer=new a.Tokenizer;this.vectors={};this.matrices={};this.variables={};this.functions={};this.definitions={};this.registerDefaultValues();this.registerExternalValues&&this.registerExternalValues()};p.prototype.setDefinition=function(a,c){this.definitions[a]=c};p.prototype.getDefinition=function(a){return this.definitions[a]};p.prototype.setVariable=function(a,c){this.variables[a]=c};p.prototype.getVariable=function(a,
c){c&&(this.variables[a]=void 0!==this.variables[a]?this.variables[a]:void 0);return this.variables[a]};p.prototype.setVector=function(a,c,b){this.vectors[a][c]=b};p.prototype.getVector=function(a){this.vectors.hasOwnProperty(a)||(this.vectors[a]=[0,0,0]);return this.vectors[a]};p.prototype.setMatrix=function(a,c,b,d){this.matrices[a][c][b]=d};p.prototype.getMatrix=function(a){this.matrices.hasOwnProperty(a)||(this.matrices[a]=[[0,0,0],[0,0,0],[0,0,0]]);return this.matrices[a]};p.prototype.setFunction=
function(a,c){this.functions[a]=c};p.prototype.getFunction=function(a){this.functions.hasOwnProperty(a)||(this.functions[a]=function(){return 0});return this.functions[a]};p.prototype.parse=function(d,f){(b=this.tokenizer.tokenize(d))||(b=[]);h=null;f=!f||!1;r=c=q=g=0;for(l=b.length;r<l;r++){v=b[r];k=v.value;u=v.type;if("identifier"===u)if(r+1<l&&"parentheses"===b[r+1].type&&"("===b[r+1].value)this.getFunction(k);else if(r+1<l&&"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"===u&&f&&":="!=k&&(u="compOperator",k="==");if("asign"===u)if(m=new a.Node(u,k),null!=h)if("identifier"===h.type)h.parent&&h.parent.replaceLastChild(m),m.addChild(h),h=m,f=!0;else if("square_bracket"===h.type)m.addChild(h.parent),
h=m,f=!0;else{m.type="compOperator";m.value="==";for(f=!0;h.parent&&e(h.parent.value)>=e(m.value);)h=h.parent;h.parent&&h.parent.replaceLastChild(m);m.addChild(h);h=m}else{console.info("Error1: en la expresi\u00f3n \u300a "+d+" \u300b, en el token {valor: "+k+", tipo: "+u+"}");break}else if("parentheses"===u&&"("===k||"square_bracket"===u&&"["===k)if(m=new a.Node(u,k),"("===k&&g++,"["===k&&q++,null===h)"("===k&&(new a.Node("(expr)","(expr)")).addChild(m),"["===k&&(new a.Node("[expr]","[expr]")).addChild(m),
h=m;else if("operator"===h.type||"boolOperator"===h.type||"compOperator"===h.type||"conditional"===h.type||"asign"===h.type)h.addChild(m),h=m;else if("sign"===h.type)h.addChild(m),h=m;else if("parentheses"===h.type&&"("===h.value)h.addChild(m),h=m;else if("square_bracket"===h.type&&"["===h.value)h.addChild(m),h=m;else if("parentheses"===h.type&&"()"===h.value)h.parent.addChild(m),h=m;else if("square_bracket"===h.type&&"[]"===h.value)h.parent.addChild(m),h=m;else if("identifier"===h.type)h.addChild(m),
h=m;else{console.info("Error2: en la expresi\u00f3n \u300a "+d+" \u300b, en el token ["+r+"] {valor: "+k+", tipo: "+u+"}");break}else if("parentheses"===u&&")"===k)if(g--,null===h)console.info("Error3: en la expresi\u00f3n \u300a "+d+" \u300b, en el token (valor:"+k+", tipo:"+u);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"===u&&"]"===k)if(q--,null===h)console.info("Error5: en la expresi\u00f3n \u300a "+
d+" \u300b, en el token (valor:"+k+", tipo:"+u);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: "+u+"}");break}}else if("number"===u||"string"===u||"identifier"===u)if(m=new a.Node(u,k),null===h)h=m;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(m),h=m;else{a.DEBUG.setError(a.DEBUG.EXPRESSION,d);break}else if("operator"===u||"compOperator"===u||"boolOperator"===u)if(m=new a.Node(u,k),null===h)if("-"===k||"+"===k)m.type="sign",m.value="sign"+k,h=m;else if("!"===k)h=m;else{console.info("Error8: en la expresi\u00f3n \u300a "+d+" \u300b, en el token {valor: "+k+", tipo: "+u+"}");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)m.type="sign",m.value="sign"+k;h.addChild(m);h=m}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&&e(h.parent.value)>=e(m.value);)h=h.parent;
h.parent&&h.parent.replaceLastChild(m);m.addChild(h);h=m}else{console.info("Error9: en la expresi\u00f3n \u300a "+d+" \u300b, en el token {valor: "+k+", tipo: "+u+"}");break}else if("conditional"===u)if(m=new a.Node(u,k),null!=h)if("?"===m.value){for(c++;h.parent&&e(h.parent.value)>e(m.value);)h=h.parent;h.parent&&h.parent.replaceLastChild(m);m.addChild(h);h=m}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: "+u+"}");break}}else{console.info("Error11: en la expresi\u00f3n \u300a "+d+" \u300b, en el token {valor: "+k+", tipo: "+u+"}");break}else if("separator"===u)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: "+u+"}");break}else{console.info("Error13: en la expresi\u00f3n \u300a "+d+" \u300b, en el token {valor: "+k+", tipo: "+u+"}");break}}0<
g&&a.DEBUG.setError(a.DEBUG.PARENTHESIS_CLOSING,d);0>g&&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);(x=h?h.getRoot():null)&&x.setAllEvalFun();return x};p.prototype.registerDefaultValues=function(){var c=this;c.variables.rnd=Math.random;c.variables.pi=c.variables["\u03c0"]=a.returnValue(Math.PI);c.variables.e=a.returnValue(Math.E);c.variables.Infinity=
Infinity;c.variables["-Infinity"]=-Infinity;c.variables.isTouch=c.variables["esT\u00e1ctil"]=a.hasTouchSupport?1:0;Object.defineProperties(c.variables,{screenOrientation:{get:function(){return window.matchMedia("(orientation: landscape)").matches?"landscape":"portrait"}},screenWidth:{get:function(){return window.innerWidth}},screenHeight:{get:function(){return window.innerHeight}}});c.functions.sqr=function(a){return a*a};c.functions.sqrt=c.functions["ra\u00edz"]=Math.sqrt;c.functions.exp=Math.exp;
c.functions.log=Math.log;c.functions.log10=function(a){return Math.log(a)/Math.log(10)};c.functions.abs=Math.abs;c.functions.ent=Math.floor;c.functions.sgn=function(a){return 0<a?1:0>a?-1:0};c.functions.ind=function(a){return a?1:0};c.functions.sin=c.functions.sen=Math.sin;c.functions.cos=Math.cos;c.functions.tan=Math.tan;c.functions.cot=function(a){return 1/Math.tan(a)};c.functions.sec=function(a){return 1/Math.cos(a)};c.functions.csc=function(a){return 1/Math.sin(a)};c.functions.sinh=c.functions.senh=
function(a){return(Math.exp(a)-Math.exp(-a))/2};c.functions.cosh=function(a){return(Math.exp(a)+Math.exp(-a))/2};c.functions.tanh=function(a){return(Math.exp(a)-Math.exp(-a))/(Math.exp(a)+Math.exp(-a))};c.functions.coth=function(a){return 1/c.functions.tanh(a)};c.functions.sech=function(a){return 1/c.functions.cosh(a)};c.functions.csch=function(a){return 1/c.functions.sinh(a)};c.functions.asin=c.functions.asen=Math.asin;c.functions.acos=Math.acos;c.functions.atan=Math.atan;c.functions.atan2=Math.atan2;
c.functions.floor=Math.floor;c.functions.ceil=Math.ceil;c.functions.round=Math.round;c.functions.min=Math.min;c.functions.max=Math.max;c.functions._Trace_=c.functions._Print_=function(){console.info.apply(console,arguments);return 0};c.functions._Num_=function(a){if("number"==typeof a)return"NaN";a=a.replace(",",".");return parseFloat(a)==a?parseFloat(a):"NaN"};c.functions._Stop_Audios_=function(){c.evaluator.parent.stopAudios()};c.functions.esCorrecto=function(b,d,g){return a.esCorrecto(b,d,c.evaluator,
g)};c.functions.escorrecto=function(b,d,g){return a.escorrecto(b,d,c.evaluator,g)};window.parent!==window&&(c.functions["parent.set"]=function(a,c){window.parent.postMessage({type:"set",name:a,value:c},"*");return 0},c.functions["parent.update"]=function(){window.parent.postMessage({type:"update"},"*");return 0},c.functions["parent.exec"]=function(a,c){window.parent.postMessage({type:"exec",name:a,value:c},"*");return 0});c.functions.toFixed=c.functions._NumToStr_=c.functions._NumACadena_=function(a,
c){a=isNaN(parseFloat(a))?0:parseFloat(a);return a.toFixed(parseInt(c||0))};c.functions.charAt=c.functions._charAt_=c.functions._letraEn_=function(a,c){a=(a||"").toString();c=isNaN(parseInt(c))?0:parseInt(c);return a.charAt(c)};c.functions.substring=c.functions._substring_=c.functions._subcadena_=function(a,c,b){a=(a||"").toString();c=isNaN(parseInt(c))?0:parseInt(c);b=isNaN(parseInt(b))?0:parseInt(b);return 0<=c&&0<=b?a.substring(c,b):0>c&&0<=b?a.substring(b):0>b&&0<=c?a.substring(c):""};c.functions.strLength=
c.functions._length_=c.functions._longitud_=function(a){return(a||"").toString().length};c.functions.indexOf=c.functions._indexOf_=c.functions["_\u00edndiceDe_"]=function(a,c){return(a||"").toString().indexOf((c||"").toString())};c.functions.lastIndexOf=function(a,c){return(a||"").toString().lastIndexOf((c||"").toString())};c.functions.replace=c.functions._replace_=c.functions._reemplazar_=function(a,c,b){a=(a||"").toString();c=(c||"").toString();b=(b||"").toString();for(var d=a.indexOf(c);0<=d;)a=
a.substring(0,d)+b+a.substring(d+c.length),d=a.indexOf(c);return a};c.functions.toLowerCase=function(a){return(a||"").toString().toLowerCase()};c.functions.toUpperCase=function(a){return(a||"").toString().toUpperCase()};c.functions.trim=function(a){return(a||"").toString().trim()};c.functions._Load_=function(c){var b="";c&&(b=(b=document.getElementById(c))&&"descartes/archivo"==b.type?b.text:a.openExternalFile(c));return b||""};c.functions._GetValues_=function(a,b){return c.functions._ExecBlock_(c.functions._Load_(a).replace(/&brvbar;/g,
String.fromCharCode("166")),b)};c.functions._GetMatrix_=function(a,b){return c.functions._StrToMatrix_(c.functions._Load_(a).replace(/&brvbar;/g,String.fromCharCode("166")),b)};c.functions._MatrixToStr_=function(b){var d=c.matrices[b];if(d){for(var g="<"+b+">\\n",f=c.getVariable(b+".columnas_usadas")||d.cols||0,k=c.getVariable(b+".filas_usadas")||d.rows||0,e,h=0;h<f;h++){for(var m=0;m<k;m++)e=d[h][m],void 0!==e&&("string"==typeof e?e="'"+e+"'":"number"==typeof e&&(e=a.removeNeedlessDecimals(e.toFixed(6))),
g+=e+(m<k-1?" \u00a6 ":""));g=g.replace(/(\u00A6 )$/g,"")+"\\n"}return g+"</"+b+">"}return""};c.functions._StrToMatrix_=function(a,b){var d=[],g=!1,k=!1;d.type="matrix";if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var e=0,h=a.length;e<h;e++)a[e].match("<"+b+">")?(k=!0,g=a[e].trim().split("<"+b+">"),2==g.length&&""!=g[1]&&d.push(g[1].split(String.fromCharCode("166")).map(f)),g=!0):(a[e].match("</"+b+">")&&(g=a[e].trim().split("</"+b+">"),2==g.length&&""!=g[0]&&d.push(g[0].split(String.fromCharCode("166")).map(f)),
g=!1,e=a.length),g&&d.push(a[e].split(String.fromCharCode("166")).map(f)));c.matrices[b]=d;c.matrices[b].rows=d&&d[0]&&d[0].length?d[0].length:0;c.matrices[b].cols=d&&d.length?d.length:0;c.setVariable(b+".filas",c.matrices[b].rows);c.setVariable(b+".columnas",c.matrices[b].cols)}return k?"OK":"ERROR"};c.functions._GetVector_=function(a,b){return c.functions._StrToVector_(c.functions._Load_(a),b)};c.functions._VectorToStr_=function(a){var b=c.vectors[a];if(b){for(var d="<"+a+">\\n",g=c.getVariable(a+
".long_usada")||b._size_||0,f,k=0;k<g;k++)f=b[k],void 0!==f?("number"==typeof f&&(f=parseFloat(f)),d+=f+"\\n"):d+="0\\n";return d+"</"+a+">"}return""};c.functions._StrToVector_=function(a,b){var d=[],g=!1,k=!1;d.type="vector";if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var e=0,h=a.length;e<h;e++)a[e].match("<"+b+">")?g=k=!0:(a[e].match("</"+b+">")&&(g=!1,e=a.length),g&&d.push(f(a[e])));d._size_=d.length;c.vectors[b]=d;c.setVariable(b+".long",d.length);c.setVariable(b+".long_usada",d.length)}return k?
"OK":"ERROR"};c.functions._ExecStr_=function(a){return c.functions._ExecBlock_(a,"")};c.functions._ExecBlock_=function(a,b){var d=[],g=""==b;if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var f=0,k=a.length;f<k;f++)a[f].match("<"+b+">")?(g=a[f].trim().split("<"+b+">"),2==g.length&&""!=g[1]&&(d=d.concat(g[1].split(String.fromCharCode("166")))),g=!0):a[f].match("</"+b+">")?(g=a[f].trim().split("</"+b+">"),2==g.length&&""!=g[0]&&(d=d.concat(g[0].split(String.fromCharCode("166")))),g=!1):g&&(d=d.concat(a[f].split(String.fromCharCode("166"))));
f=0;for(k=d.length;f<k;f++)g=d[f].split("="),g[0]=g[0].trim(),2==g.length&&""!=g[0]&&(isNaN(parseFloat(g[1]))?c.setVariable(g[0],g[1].replace(/^\s|\s$/g,"").replace(/^'|'$/g,"")):c.setVariable(g[0],parseFloat(g[1])))}return 0};var b=a.newHTML("a",{target:"_blank"}),g,k=null;a.newBlobContent=null;c.functions._Save_=function(f,e){c.evaluator.parent.removeButtonClick();1500<Date.now()-d&&(d=Date.now(),document.body.appendChild(b),k=e.replace(/\\r/g,"").replace(/\\n/g,"\r\n").replace(/\\q/g,"'").replace(/\\_/g,
"\\"),g=new Blob(["\ufeff",k],{type:"text/plain;charset=utf-8"}),b.setAttribute("href",window.URL.createObjectURL(g)),b.setAttribute("download",f),k!=a.newBlobContent&&(b.click(),a.newBlobContent=k),document.body.removeChild(b));return 0};var e,h,m=a.newHTML("input",{type:"file"});m.addEventListener("change",function(b){e=b.target.files;h=new FileReader;h.onload=function(b){a.addExternalFileContent(e[0].name,b.target.result);c.setVariable("DJS.fileName",e[0].name);c.setVariable("DJS.fileContent",
b.target.result);c.getFunction(c._callback)&&(c.getFunction(c._callback).apply(c.evaluator,[]),c.evaluator.parent.update());m.value=""};0<e.length&&h.readAsText(e[0])});c.functions._Open_=function(a){c.evaluator.parent.removeButtonClick();1500<Date.now()-d&&(c._callback=a,m.click(),d=Date.now());return 0};c.functions._AnchoDeCadena_=c.functions._strWidth_=function(c,b,d,g){return a.getTextWidth(c,a.convertFont(b+","+d+","+g))};c.functions.R=c.functions._Rojo_=c.functions._Red_=function(c){return(new a.Color(c)).r/
255};c.functions.G=c.functions._Verde_=c.functions._Green_=function(c){return(new a.Color(c)).g/255};c.functions.B=c.functions._Azul_=c.functions._Blue_=function(c){return(new a.Color(c)).b/255};c.functions["DJS.typeof"]=function(a){return a.rows?"matrix":a._size_?"vector":typeof a}};a.Parser=p;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=Math.floor,f=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};f.prototype.setDefinition=function(a,f){this.definitions[a]=f};f.prototype.getDefinition=function(a){return this.definitions[a]};f.prototype.setVariable=function(a,f){this.variables[a]=f};f.prototype.getVariable=
function(a){return this.variables[a]};f.prototype.setVector=function(a,f,l){f=0>f?0:e(f);this.vectors[a][f]=l};f.prototype.getVector=function(a,f){f=0>f?0:e(f);return this.vectors[a][f]};f.prototype.setMatrix=function(a,f,l,b){f=0>f?0:e(f);l=0>l?0:e(l);void 0==this.matrices[a][f]&&(this.matrices[a][f]=[]);this.matrices[a][f][l]=b};f.prototype.getMatrix=function(a,f,l){f=0>f?0:e(f);l=0>l?0:e(l);return this.matrices[a][f][l]};f.prototype.setFunction=function(a,f){this.functions[a]=f};f.prototype.getFunction=
function(a){return this.functions[a]};f.prototype.eval=function(a){return a?a.evaluate(this):0};a.externalEvaluator=new f;a.Evaluator=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b,h,m,g,q,c,v,k,u,x,p=function(c,b){this.parent=c;this.evaluator=c.evaluator;this.decimals=c.decimals;this.fixed=c.fixed;this.align=c.align||"left";this.anchor=c.anchor||"a_top_left";this.decimal_symbol=c.parent.decimal_symbol;this.w=this.h=100;this.hasContent=""!==b;this.textStr=(b||"").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;b.match(/^\{\\rtf1/)?(this.type="rtfNode",this.text=b,this.textNodes=(new a.RTFParser(c.evaluator)).parse(b.substring(10))):(this.descarTeXParser=new a.DescarTeXParser,this.text=this.parseSimpleText(this.textStr),this.textNodes=new a.TextNode("","textLineBlock",null,null))};p.prototype.draw=function(a,c,b,d,g){this["rtfNode"===this.type?"drawRTF":"drawText"](a,c,b,d,g)};p.prototype.drawText=function(c,g,k,h,m){e=
this.evaluator.eval(this.decimals);f=this.evaluator.eval(this.parent.width);d=this.evaluator.eval(this.parent.font_size);r=g.getColor?g.getColor():g;l=this.textToString(this.text,e,this.fixed).replace(/\\{/g,"\\curlyBracketOpen ").replace(/\\}/g,"\\curlyBracketClose ").replace(/\\\[/g,"\\squareBracketOpen ").replace(/\\\]/g,"\\squareBracketClose ");0<=l.indexOf("[")&&(l=this.textToString(this.parseSimpleText(l),e,this.fixed));if(this.oldTextStr!==l||this.oldWidth!==f||this.oldSize!==d||this.oldColor!==
r||this.oldPosX!==k||this.oldPoxY!==h)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(l,this.evaluator,b),this.textNodes.update(k,h,e,this.fixed,this.align,this.anchor,r,f);m||this.textNodes.draw(c);this.oldTextStr=l;this.oldWidth=f;this.oldSize=d;this.oldColor=r;this.oldPosX=k;this.oldPoxY=h};p.prototype.drawRTF=function(a,c,b,d,
g){c=c.getColor?c.getColor():c;a.fillStyle=a.strokeStyle=c;a.textBaseline="alphabetic";this.textNodes.style.align!==this.align&&this.textNodes.propagateStyle("align",this.align);this.textNodes.update(b,d,this.evaluator.eval(this.decimals),this.fixed,this.align,this.anchor,c,this.evaluator.eval(this.parent.width));g||this.textNodes.draw(a)};p.prototype.parseSimpleText=function(a){a=a.replace("&#x2013","\u2013").replace(/&squot;/g,"'");h=[];m="'";q=g=0;c=-1;for(u=a.length;g<u;)v=a.charAt(g),k=a.charAt(g-
1),"["===v&&"\\"===k?(h.push(a.substring(q,g-1)+"["),q=g+1):"]"===v&&"\\"===k?(h.push(a.substring(q,g-1)+"]"),q=g+1):"["===v&&-1===c?(h.push(a.substring(q,g)),q=g,c++):"["===v?c++:"]"===v&&0===c?(h.push(this.evaluator.parser.parse(a.substring(q,g+1))),q=g+1,c--):("]"==a.charAt(g)&&(c=0>c?c:c-1),m+=a.charAt(g)),g++;h.push(a.substring(q,g));return h};p.prototype.textToString=function(c,b,d){m="";if("rtfNode"!==c.type)for(var g=0,f=c.length;g<f;g++)"string"===typeof c[g]?m+=c[g]:(x=this.evaluator.eval(c[g])[0][0],
""!==x&&("string"===typeof x?m+=x:Infinity===x?m+="Infinity":-Infinity===x?m+="-Infinity":isNaN(x)||"NaN"===x?m+="NaN":(x=parseFloat(x),x=d?x.toFixed(b):a.removeNeedlessDecimals(x.toFixed(b)),m+=x.toString().replace(".",this.decimal_symbol))));return m};a.TextObject=p;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f=function(){};f.prototype.tokenize=function(a){a=a.replace(/\\n/g,"\\newline ");var d=[],f=null,b=0,h=a.length;a.charAt(0);var m=!1,g=!1,q=0;e="";for(var c=0;c<h;c++){var v=a.charAt(c);var k=a.charAt(c+1);"\\"===v&&"$"===k&&(g=!0);"{"===v?q++:"}"===v&&(q--,g&&0===q&&(g=!1));g?"_"===v?"{"===k?e+="\\subindex":(e+="\\subindex{"+k+"}",c++):"^"===v?"{"===k?e+="\\superindex":(e+="\\superindex{"+k+"}",c++):e+=v:e+=v}a=e;k=a.charAt(0);for(h=a.length;b<
h;)v=k,k=a.charAt(b+1),m&&("{"===v||"["===v||"\\"===v||" "===v?(m=!1," "===v&&(f={type:"ignore"},d.push(f))):f.value+=v),m||"\\"!==v?m||"{"!==v&&"["!==v?m||"}"!==v&&"]"!==v?m||(f&&"text"===f.type?f.value+=v:f&&"ignore"===f.type?(d.pop(),f=d[d.length-1]):(f={type:"text",value:v},d.push(f))):(f={type:"close",value:v},d.push(f)):(f={type:"open",value:v},d.push(f)):(m=!0,f={type:"command",value:""},d.push(f)),b++;return d};a.DescarTeXTokenizer=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=function(){this.tokenizer=new a.DescarTeXTokenizer};e.prototype.parse=function(f,d,e){f=this.tokenizer.tokenize(f);var l=new a.TextNode("","textBlock",e,null),b=new a.TextNode("","textLineBlock",e.clone(),null);l.addChild(b);for(var h=[],m=void 0,g=e,q=[e],c,v,k,u,x=!1,p=0,n=f.length;p<n;p++)if("text"===f[p].type)if("color_parameter"===m)v=new a.Color(f[p].value,d);else if("text_size_parameter"===m)k=parseFloat(f[p].value);else if("textLineBlock"===
b.nodeType){c=f[p].value.split(" ");for(var r=0,w=c.length;r<w;r++)""!==c[r]&&b.addChild(new a.TextNode(c[r],"text",g.clone(),null)),r+1<w&&b.addChild(new a.TextNode(" ","space",g.clone(),null))}else b.addChild(new a.TextNode(f[p].value,"text",g.clone(),null));else if("command"===f[p].type&&"curlyBracketOpen"===f[p].value)b.addChild(new a.TextNode("{","text",g.clone(),null));else if("command"===f[p].type&&"curlyBracketClose"===f[p].value)b.addChild(new a.TextNode("}","text",g.clone(),null));else if("command"===
f[p].type&&"squareBracketOpen"===f[p].value)b.addChild(new a.TextNode("[","text",g.clone(),null));else if("command"===f[p].type&&"squareBracketClose"===f[p].value)b.addChild(new a.TextNode("]","text",g.clone(),null));else if("command"===f[p].type&&"newline"===f[p].value)0===b.children.length&&b.addChild(new a.TextNode("","text",g.clone(),null)),b=new a.TextNode("","textLineBlock",e.clone(),null),l.addChild(b);else if("command"===f[p].type&&"b"===f[p].value)m="bold",h.push(m);else if("command"===f[p].type&&
"i"===f[p].value)m="italic",h.push(m);else if("command"===f[p].type&&"color"===f[p].value)m="color",h.push(m);else if("command"===f[p].type&&"ts"===f[p].value)m="text_size",h.push(m);else if("command"===f[p].type&&"sansserif"===f[p].value.toLowerCase())m="sansserif",h.push(m);else if("command"===f[p].type&&"serif"===f[p].value.toLowerCase())m="serif",h.push(m);else if("command"===f[p].type&&"monospace"===f[p].value.toLowerCase())m="monospace",h.push(m);else if("command"===f[p].type&&"c"===f[p].value)m=
"center",h.push(m);else if("command"===f[p].type&&"l"===f[p].value)m="left",h.push(m);else if("command"===f[p].type&&"r"===f[p].value)m="right",h.push(m);else if("command"===f[p].type&&"j"===f[p].value)m="justify",h.push(m);else if("command"===f[p].type&&"$"===f[p].value)m="formula",h.push(m),x=!0;else if("command"===f[p].type&&"sum"===f[p].value)m="sum",h.push(m);else if("command"===f[p].type&&"int"===f[p].value)m="integral",h.push(m);else if("command"===f[p].type&&"lim"===f[p].value)m="limit",h.push(m);
else if("command"===f[p].type&&"sqrt"===f[p].value)m="radical",h.push(m);else if("command"===f[p].type&&"subindex"===f[p].value)m="subIndex",h.push(m);else if("command"===f[p].type&&"superindex"===f[p].value)m="superIndex",h.push(m);else if("command"===f[p].type&&"frac"===f[p].value)m="numerator",h.push(m);else if("open"===f[p].type&&"{"===f[p].value&&void 0!==m)"bold"===m||"italic"===m?(g=g.clone(),g[m]=!0,q.push(g)):"sansserif"===m?(g=g.clone(),g.family="sansserif",q.push(g)):"serif"===m?(g=g.clone(),
g.family="serif",q.push(g)):"monospace"===m?(g=g.clone(),g.family="monospaced",q.push(g)):"text_size"===m?m="text_size_parameter":"text_size_text"===m?(g=g.clone(),g.size=k,q.push(g)):"color"===m?m="color_parameter":"color_text"===m?(g=g.clone(),g.color=v,q.push(g)):"center"===m||"left"===m||"right"===m||"justify"===m?(g=g.clone(),g.align=m,q.push(g),b=new a.TextNode("","textLineBlock",g.clone(),null),l.addChild(b)):"formula"===m?(g=g.clone(),g.italic=!0,q.push(g),u=new a.TextNode("","formula",g.clone(),
null),b.addChild(u),b=u):"subIndex"===m||"superIndex"===m?x?(g=g.clone(),q.push(g),u=new a.TextNode("",m,g.clone(),null),b.addChild(u),b=u):b.addChild(new a.TextNode("subIndex"===m?"_":"^","text",g.clone(),null)):"radical"===m?x&&(u=new a.TextNode("","radical",g.clone(),null),b.addChild(u),b=u,g=g.clone(),q.push(g),u=new a.TextNode("","index",g.clone(),null),b.addChild(u),b=u,m="index"):"index"===m?x&&(q.pop(),g=q[q.length-1],u=new a.TextNode("","radicand",g.clone(),null),b.addChild(u),b=u,m="radicand"):
"sum"===m||"integral"===m||"limit"===m?x&&(u=new a.TextNode("",m,g.clone(),null),b.addChild(u),b=u,g=g.clone(),q.push(g),u=new a.TextNode("","from",g.clone(),null),b.addChild(u),b=u,m="from"):"from"===m?x&&(u=new a.TextNode("","to",g.clone(),null),b.addChild(u),b=u,m="to"):"to"===m?x&&(q.pop(),g=q[q.length-1],u=new a.TextNode("","what",g.clone(),null),b.addChild(u),b=u,m="what"):"numerator"===m?x&&(u=new a.TextNode("","fraction",g.clone(),null),b.addChild(u),b=u,g=g.clone(),q.push(g),u=new a.TextNode("",
"numerator",g.clone(),null),b.addChild(u),b=u,m="numerator"):"denominator"===m&&(u=new a.TextNode("",m,g.clone(),null),b.addChild(u),b=u);else if("close"===f[p].type&&"}"===f[p].value&&void 0!==m){if("bold"===m||"italic"===m||"color_text"===m||"color"===m||"text_size_text"===m||"text_size"===m||"sansserif"===m||"serif"===m||"monospace"===m)q.pop(),g=q[q.length-1],h.pop(),m=h[h.length-1];else if("color_parameter"===m){m="color_text";continue}else if("text_size_parameter"===m){m="text_size_text";continue}else if("center"===
m||"left"===m||"right"===m||"justify"===m)q.pop(),g=q[q.length-1],h.pop(),m=h[h.length-1],f[p+1]&&"command"===f[p+1].type&&"newline"===f[p+1].value?b=l:(b=new a.TextNode("","textLineBlock",g.clone(),null),l.addChild(b));"formula"===b.nodeType?(x=!1,q.pop(),g=q[q.length-1],h.pop(),m=h[h.length-1],b=b.parent):"subIndex"===b.nodeType||"superIndex"===b.nodeType?x&&(q.pop(),g=q[q.length-1],h.pop(),m=h[h.length-1],b=b.parent):"index"===b.nodeType?b=b.parent:"radicand"===b.nodeType?(h.pop(),m=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(),m=h[h.length-1],b=b.parent.parent):"numerator"===b.nodeType?(m="denominator",b=b.parent):"denominator"===b.nodeType&&(q.pop(),g=q[q.length-1],h.pop(),m=h[h.length-1],b=b.parent.parent)}var y,A,E=null,J=[];l.children.forEach(function(a){for(var c=0,b=a.children.length;c<b-1;c++)y=a.children[c],A=a.children[c+1],"text"===y.nodeType&&"text"===A.nodeType&&y.style.equals(A.style)?(null===E&&(E=
y,u=y.clone(),E.changeNodeType("word"),E.value="___"+u.value,E.addChild(u)),u=A.clone(),E.addChild(u),J.push(A),E.value+=u.value):E=null});J.forEach(function(a){a.parent.removeChild(a)});l.normalize();l.adjustFontSize();return l};a.DescarTeXParser=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f=[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)?e=f[0]:/times|serif/i.test(this.family)?e=f[1]:/courier|monospaced/i.test(this.family)&&(e=f[2]);return((this.bold?"bold":"")+" "+(this.italic?"italic":"")+" "+this.size+"px "+e).trim()};a.TextStyle=d;return a}(descartesJS||{});
descartesJS=function(a){function e(a,b){for(var c=0,d=0;d<b;d++)c+=a[d];return c}function f(a){var c={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 c;var b=parseInt(a.match(/(\d+\.*)+px/)[0]);a=a.match("sansserif")?"sansserif":a.match("serif")?"serif":"monospace";c.ascent=Math.ceil((q[a].ascent+25)*b/q[a].unitsPerEm);c.descent=Math.ceil(Math.abs((q[a].descent-25)*b/q[a].unitsPerEm));c.h=c.ascent+c.descent;return c}if(a.loadLib)return a;
var d="#000000",r=2,l=!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 m=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");m.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 g=function(a,b,d,g){this.type="rtfNode";this.evaluator=g;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(){}};g.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}};g.prototype.clone=function(){for(var a=new g(this.value,this.nodeType,this.style.clone()),b=0,d=this.children.length;b<d;b++)a.addChild(this.children[b].clone());return a};g.prototype.toStr=function(){for(var a=this.value,b=0,d=this.children.length;b<d;b++)a+=" "+this.children[b].toStr();return a};g.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+"}"};g.prototype.addChild=function(a,b){b&&null!==a.parent&&a.parent.removeChild(a);a.parent=this;this.children.push(a)};g.prototype.removeChild=function(a){var c=this.children.indexOf(a);-1!==c&&(a.parent=null,this.children.splice(c,1))};g.prototype.getFirstTextNode=function(){for(var a=this;0<a.children.length;)a=a.children[0];return a};g.prototype.getLastTextNode=function(){for(var a=this;0<
a.children.length;)a=a.children[a.children.length-1];return a};g.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};g.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};g.prototype.queryAll=function(a){var c=[];"string"===typeof a&&
(a=new RegExp(a));for(var b=0,d=this.children.length;b<d;b++)c=c.concat(this.children[b].queryAll(a));this.nodeType.match(a)&&c.push(this);return c};g.prototype.insertBefore=function(a,b){a=this.children.indexOf(a);-1!==a&&(b.parent=this,this.children.splice(a,0,b))};g.prototype.insertAfter=function(a,b){a=this.children.indexOf(a);-1!==a&&(b.parent=this,this.children.splice(a+1,0,b))};g.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 g("","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 f=a[b];(null===f.prevSibling()||null!==f.prevSibling()&&"text"!==f.prevSibling().nodeType)&&f.parent.insertBefore(f,new g("","text",f.parent.style));(null===f.nextSibling()||null!==f.nextSibling()&&"text"!==f.nextSibling().nodeType)&&
f.parent.insertAfter(f,new g("","text",f.parent.style))}return this};g.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])};g.prototype.adjustFontSize=function(a){var c=this.style.size;"formula"===this.nodeType&&(a=!0);for(var b=0,d=this.children.length;b<d;b++)"text"===this.children[b].nodeType&&a?(this.children[b].style.size=c,this.children[b].styleString=this.children[b].style.toString()):"index"===
this.children[b].nodeType?(this.children[b].style.size=Math.max(parseInt(c-.5*c),8),this.children[b].styleString=this.children[b].style.toString(),this.children[b].adjustFontSize(!0)):"to"===this.children[b].nodeType||"from"===this.children[b].nodeType?(this.children[b].style.size=Math.max(parseInt(c-.2*c),8),this.children[b].styleString=this.children[b].style.toString(),this.children[b].adjustFontSize(!0)):"numerator"===this.children[b].nodeType||"denominator"===this.children[b].nodeType?(this.children[b].style.size=
Math.max(parseInt(c-.1*c),8),this.children[b].styleString=this.children[b].style.toString(),this.children[b].adjustFontSize(!0)):"subIndex"===this.children[b].nodeType||"superIndex"===this.children[b].nodeType?(this.children[b].style.size=Math.max(parseInt(c-.33*c),8),this.children[b].styleString=this.children[b].style.toString(),this.children[b].adjustFontSize(!0)):(a&&(this.children[b].style.size=c,this.children[b].styleString=this.children[b].style.toString()),this.children[b].adjustFontSize(a))};
g.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)};g.prototype.update=function(a,b,g,f,e,h,m,q){r=g;l=f;d=m;this.metrics.w=this.metrics.h=0;m=b;if(20<=q)for(g=0;g<this.children.length;g++)this.children[g].breakLines(q);g=0;for(f=this.children.length;g<f;g++){var c=this.children[g];c.updateLine();c.metrics.offsetX=a;c.metrics.y=b;b+=parseInt(c.metrics.ascent+.5);c.metrics.offsetY=
b;e=parseInt(c.metrics.descent+.5)+parseInt(1.5+.05*c.style.size);b+=e;this.metrics.h+=c.metrics.h;this.metrics.w=Math.max(this.metrics.w,c.metrics.w)}b=m;h=h||"";h.match("right")?a-=this.metrics.w:h.match("_center")&&(a-=this.metrics.w/2);h.match("bottom")?b-=this.metrics.h:h.match("center_")&&(b-=this.metrics.h/2);h=this.children;g=0;for(f=h.length;g<f;g++)"left"===h[g].style.align?h[g].metrics.offsetX=a:"right"===h[g].style.align?h[g].metrics.offsetX=a+this.metrics.w-h[g].metrics.w:"center"===
h[g].style.align?h[g].metrics.offsetX=a+(this.metrics.w-h[g].metrics.w)/2:"justify"===h[g].style.align&&20<=q&&(e=g<f-1?h[g+1].value:null,h[g].metrics.offsetX=a,"wrap"===e&&h[g].justifyAux(q)),h[g].metrics.y=b,b+=parseInt(h[g].metrics.ascent+.5),h[g].metrics.offsetY=b,e=parseInt(h[g].metrics.descent+.5)+parseInt(1.5+.05*h[g].style.size),b+=e};g.prototype.breakLines=function(c){for(var b,d=0,f=!1,e=[],h=0,m=this.children.length;h<m;h++)b=this.children[h],f?e.push(b):("text"===b.nodeType||"space"===
b.nodeType?(a.ctx.font=b.style.toString(),b.metrics.w=a.ctx.measureText(b.value).width):"word"===b.nodeType?b.updateLine():"formula"===b.nodeType&&b.updateFormula(),d+=b.metrics.w,d>c&&"space"!==b.nodeType&&0<h&&(f=!0,e.push(b)));if(0<e.length)for(c=new g("wrap","textLineBlock",this.style.clone(),null),this.parent.insertAfter(this,c),h=0,m=e.length;h<m;h++)e[h].parent&&e[h].parent.removeChild(e[h]),c.addChild(e[h])};g.prototype.updateLine=function(c){var b=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,e,h=0,m=g.length;h<m;h++){e=g[h];if("text"===e.nodeType){a.ctx.font=e.style.toString();var l=""!==e.value?e.value:"\u200a";e.metrics=f(a.ctx.font);e.metrics.w=a.ctx.measureText(l).width;e.metrics.offsetX=d;Object.defineProperties(e.metrics,{x:{get:function(){return b.metrics.offsetX+this.offsetX}},y:{get:function(){return b.metrics.offsetY+this.offsetY}}})}"space"===e.nodeType?(a.ctx.font=
e.style.toString(),e.metrics=f(a.ctx.font),e.metrics.w=h===m-1?0:c?c:a.ctx.measureText(" ").width,e.metrics.offsetX=d,Object.defineProperties(e.metrics,{x:{get:function(){return b.metrics.offsetX+this.offsetX}},y:{get:function(){return b.metrics.offsetY+this.offsetY}}})):"word"===e.nodeType&&(e.updateLine(),e.metrics.offsetX_aux=d,Object.defineProperties(e.metrics,{offsetX:{get:function(){return b.metrics.offsetX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}}));"hyperlink"===
e.nodeType&&(a.ctx.font=e.styleString,l=""!==e.value?e.value:"\u200a",e.metrics=f(a.ctx.font),e.metrics.w=a.ctx.measureText(l).width,e.metrics.offsetX=d,Object.defineProperties(e.metrics,{x:{get:function(){return b.metrics.offsetX+this.offsetX}},y:{get:function(){return b.metrics.offsetY}}}),e.clickCatcher||(e.clickCatcher=a.newHTML("div",{style:"position:absolute;width:"+e.metrics.w+"px;height:"+e.metrics.h+"px;cursor:pointer;"}),e.clickCatcher.rtfNode=e,e.clickCatcher.action=new a.OpenURL(this.evaluator.parent,
e.URL),e.clickCatcher.addEventListener("click",function(a){this.rtfNode.click=!0;this.action.execute();this.rtfNode.draw(this.rtfNode.ctx)})));"componentNumCtrl"===e.nodeType&&(e.componentNumCtrl=this.evaluator.parent.getControlByCId(e.value),a.ctx.font=e.styleString,e.metrics=f(a.ctx.font),e.metrics.w=e.componentNumCtrl.w,e.metrics.h=e.componentNumCtrl.h,e.metrics.offsetX=d,Object.defineProperties(e.metrics,{x:{get:function(){return b.metrics.offsetX+this.offsetX}},y:{get:function(){return b.metrics.offsetY}}}));
"componentSpace"===e.nodeType?(e.componentSpace=this.evaluator.parent.getSpaceByCId(e.value),a.ctx.font=e.styleString,e.metrics=f(a.ctx.font),e.metrics.w=e.componentSpace.w,e.metrics.h=e.componentSpace.h,e.metrics.offsetX=d,Object.defineProperties(e.metrics,{x:{get:function(){return b.metrics.offsetX+this.offsetX}},y:{get:function(){return b.metrics.offsetY}}})):"formula"===e.nodeType&&(e.updateFormula(),e.metrics.offsetX_aux=d,Object.defineProperties(e.metrics,{x:{get:function(){return this.offsetX}},
y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}}),e.metrics.w+=2*e.metrics.paddingX,e.metrics.ascent+=e.metrics.paddingY,e.metrics.descent+=e.metrics.paddingY,e.metrics.h+=2*e.metrics.paddingY,d+=2*e.metrics.marginX);this.metrics.w+=e.metrics.w+2*e.metrics.marginX;this.metrics.ascent=Math.max(this.metrics.ascent,e.metrics.ascent);this.metrics.descent=Math.max(this.metrics.descent,
e.metrics.descent);d+=e.metrics.w}this.metrics.h=this.metrics.ascent+this.metrics.descent}};g.prototype.updateFormula=function(){var c=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 b=this.children,d,g=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}},m=0,n=b.length;m<n;m++){d=b[m];if("text"===d.nodeType){a.ctx.font=d.style.toString();var q=""!==d.value?d.value:
"\u200a";d.metrics=f(a.ctx.font);d.metrics.w=a.ctx.measureText(q).width;d.metrics.offsetX=g;Object.defineProperties(d.metrics,{x:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.offsetX}},y:{get:function(){return c.metrics.offsetY}}});g+=c.metrics.marginX}else if("dynamicText"===d.nodeType){q=void 0===d.decimals?r:d.evaluator.eval(d.decimals);var w=void 0===d.fixed?l:d.fixed,y=d.evaluator.eval(d.value);parseFloat(y).toString()===y.toString()&&(y=w?parseFloat(y).toFixed(q):a.removeNeedlessDecimals(parseFloat(y).toFixed(q)),
y=(""+y).replace(".",d.decimal_symbol));d.evalValue=y;a.ctx.font=d.style.toString();d.metrics=f(a.ctx.font);d.metrics.marginX=parseInt(1.5+.075*this.style.size);d.metrics.paddingX=parseInt(1.5+.075*this.style.size);d.metrics.w=a.ctx.measureText(y).width+2*d.metrics.paddingX;d.metrics.offsetX_aux=g;Object.defineProperties(d.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.offsetX_aux+this.marginX}},
offsetY:{get:function(){return c.metrics.offsetY}}});g+=2*d.metrics.marginX}if("superIndex"===d.nodeType)q=d,q.updateFormula(),q.metrics.marginX=0*parseInt(1.5+.075*this.style.size),q.metrics.paddingX=0*parseInt(1.5+.075*this.style.size),q.metrics.paddingY=parseInt(1.5+.05*this.style.size),q.metrics.offsetX_aux=g,q.metrics.prevChild=h,Object.defineProperties(q.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+
c.metrics.paddingX+this.offsetX_aux+this.marginX}},offsetY:{get:function(){return c.metrics.offsetY-this.descent+this.prevChild.metrics.descent-parseInt(2*this.prevChild.metrics.h/7)}}}),q.metrics.w+=2*q.metrics.paddingX,q.metrics.ascent+=q.metrics.paddingY,q.metrics.descent+=q.metrics.paddingY,q.metrics.h+=2*q.metrics.paddingY,g+=2*q.metrics.marginX;else if("subIndex"===d.nodeType){var A=d;A.updateFormula();A.metrics.marginX=parseInt(1.5+.09375*this.style.size);A.metrics.paddingX=0*parseInt(1.5+
.01875*this.style.size);A.metrics.paddingY=parseInt(1.5+.05*this.style.size);A.metrics.offsetX_aux=g;A.metrics.prevChild=h;Object.defineProperties(A.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.offsetX_aux+0*this.marginX}},offsetY:{get:function(){return c.metrics.offsetY+this.ascent+A.metrics.prevChild.metrics.descent-parseInt(4*A.metrics.prevChild.metrics.h/7)}}});A.metrics.w+=A.metrics.paddingX;
A.metrics.ascent+=A.metrics.paddingY;A.metrics.descent+=A.metrics.paddingY;A.metrics.h+=2*A.metrics.paddingY;this.metrics.descent=A.metrics.ascent+A.metrics.prevChild.metrics.descent-parseInt(4*A.metrics.prevChild.metrics.h/7)+A.metrics.descent;g+=A.metrics.marginX}else if("fraction"===d.nodeType){w=d;w.updateFormula();q=w.children;y=q[0];q=q[1];w.metrics.marginX=parseInt(1.5+.075*this.style.size);w.metrics.paddingX=0*parseInt(1.5+.075*this.style.size);w.metrics.paddingY=0*parseInt(1.5+.05*this.style.size);
var E=Math.max(y.metrics.w,q.metrics.w)+2*w.metrics.paddingX;w.metrics.prevChild=h;w.metrics.offsetX_aux=g;var J=parseInt(-h.metrics.descent+4*h.metrics.h/9);Object.defineProperties(w.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY+J}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY-J}}});Object.defineProperties(y.metrics,{parent:{value:w},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(q.metrics,{parent:{value:w},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}}});w.metrics.w=E;w.metrics.ascent=y.metrics.h+J+2*w.metrics.paddingY;w.metrics.descent=q.metrics.h-J+2*w.metrics.paddingY;w.metrics.h=y.metrics.h+q.metrics.h+4*w.metrics.paddingY;g+=2*w.metrics.marginX}else if("radical"===d.nodeType){h=d;h.updateFormula();q=h.children;w=q[0];var F=q[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=g;Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}});q=h.style.size;h.radicalSign={w:q,scaleX:q/722,scaleY:F.metrics.h/1E3};y=parseInt(w.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 c.metrics.offsetY-F.metrics.ascent}}});Object.defineProperties(w.metrics,{parent:{value:h},displaceIndex:{value:y},fontSize:{value:q},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 c.metrics.offsetY-this.descent-2*this.fontSize/5}}});Object.defineProperties(F.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 c.metrics.offsetY}}});y=w.metrics.w<2*h.radicalSign.w/3?h.radicalSign.w:parseInt(w.metrics.w+
h.radicalSign.w/3);h.metrics.w=y+2*h.metrics.paddingX+F.metrics.w;h.metrics.ascent=Math.max(F.metrics.ascent,w.metrics.h+2*q/5)+h.metrics.paddingY;h.metrics.descent=F.metrics.descent+h.metrics.paddingY;h.metrics.h=h.metrics.ascent+h.metrics.descent;g+=2*h.metrics.marginX}else if("sum"===d.nodeType){w=d;w.updateFormula();q=w.children;y=q[0];E=q[1];var H=q[2];w.metrics.marginX=parseInt(1.5+.075*this.style.size);w.metrics.paddingX=parseInt(1.5+.075*this.style.size);w.metrics.paddingY=parseInt(1.5+.05*
this.style.size);w.metrics.offsetX_aux=g;Object.defineProperties(w.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}});a.ctx.font=d.style.toString();var z=f(a.ctx.font);h=parseInt(1.2*z.h);q=parseInt(.5+780*h/1E3);w.sigmaSign={w:q,h:h,scale:h/1E3};var I=Math.max(E.metrics.w,y.metrics.w,w.sigmaSign.w);w.sigmaSign.parent=
w;Object.defineProperties(w.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 c.metrics.offsetY+z.descent-(this.h+z.h)/2}}});q=z.descent-E.metrics.descent-(h+z.h)/2-w.metrics.paddingY;Object.defineProperties(E.metrics,{parent:{value:w},sumWidth:{value:I},newBaselineTo:{value:q},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 c.metrics.offsetY+this.newBaselineTo}}});h=y.metrics.ascent+z.descent+(h-z.h)/2+w.metrics.paddingY;Object.defineProperties(y.metrics,{parent:{value:w},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 c.metrics.offsetY+
this.newBaselineFrom}}});Object.defineProperties(H.metrics,{parent:{value:w},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 c.metrics.offsetY}}});w.metrics.w=I+H.metrics.w+3*w.metrics.paddingX;w.metrics.ascent=Math.max(H.metrics.ascent,-q+E.metrics.ascent)+w.metrics.paddingY;w.metrics.descent=Math.max(H.metrics.descent,
h+y.metrics.descent)+w.metrics.paddingY;w.metrics.h=w.metrics.ascent+w.metrics.descent;g+=2*w.metrics.marginX}else if("integral"===d.nodeType){w=d;w.updateFormula();q=w.children;y=q[0];E=q[1];H=q[2];w.metrics.marginX=parseInt(1.5+.075*this.style.size);w.metrics.paddingX=parseInt(1.5+.075*this.style.size);w.metrics.paddingY=parseInt(1.5+.05*this.style.size);w.metrics.offsetX_aux=g;Object.defineProperties(w.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+
c.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}});a.ctx.font=d.style.toString();z=f(a.ctx.font);I=parseInt(1.2*z.h);var C=parseInt(10.5+529*I/1E3);w.sign={w:C,h:I,scale:I/1E3};w.sign.parent=w;Object.defineProperties(w.sign,{x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX}},y:{get:function(){return c.metrics.offsetY+z.descent-(this.h+z.h)/2}}});q=z.descent-(I+z.h)/2-E.metrics.descent+I/3;Object.defineProperties(E.metrics,
{parent:{value:w},integralWidth:{value:C},newBaselineTo:{value:q},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 c.metrics.offsetY+this.newBaselineTo}}});h=z.descent+y.metrics.ascent/2;Object.defineProperties(y.metrics,{parent:{value:w},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 c.metrics.offsetY+this.newBaselineFrom}}});C=Math.max(parseInt(4*C/5)+E.metrics.w,parseInt(2*C/5+y.metrics.w))+w.metrics.paddingX;Object.defineProperties(H.metrics,{parent:{value:w},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 c.metrics.offsetY}}});w.metrics.w=C+H.metrics.w+2*w.metrics.paddingX;w.metrics.ascent=Math.max(H.metrics.ascent,-q+E.metrics.ascent)+w.metrics.paddingY;w.metrics.descent=Math.max(H.metrics.descent,h+y.metrics.descent,I-w.metrics.ascent)+w.metrics.paddingY;w.metrics.h=Math.max(w.metrics.ascent+w.metrics.descent,I);g+=2*w.metrics.marginX}else if("limit"===d.nodeType){h=d;h.updateFormula();q=h.children;var M=q[0];w=q[1];
q=q[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=g;Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}});a.ctx.font=d.style.toString();z=f(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+w.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=z.descent+Math.max(M.metrics.ascent,w.metrics.ascent,2*z.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 c.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 c.metrics.offsetY+
this.newBaseline}}});Object.defineProperties(w.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 c.metrics.offsetY+this.newBaseline}}});Object.defineProperties(q.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 c.metrics.offsetY}}});h.metrics.w=limitWidth+q.metrics.w+3*h.metrics.paddingX;h.metrics.ascent=Math.max(q.metrics.ascent,z.ascent)+h.metrics.paddingY;h.metrics.descent=E+Math.max(M.metrics.descent,w.metrics.descent)+h.metrics.paddingY;h.metrics.h=h.metrics.ascent+h.metrics.descent;g+=2*h.metrics.marginX}else if("matrix"===
d.nodeType){y=d;y.updateFormula();q=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=g;Object.defineProperties(y.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}});
a.ctx.font=d.style.toString();z=f(a.ctx.font);I=[];C=[];h=0;for(var N=E*H;h<N;h++){var O=parseInt(h/H);var G=h%H;I[O]=Math.max(I[O]||0,q[h].metrics.h);C[G]=Math.max(C[G]||0,q[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];w=z.descent-z.h/2;h=0;for(N=E*H;h<N;h++)O=parseInt(h/H),G=h%H,q[h].metrics.offsetX_aux=e(C,G)+(C[G]-q[h].metrics.w)/2+G*y.metrics.paddingX,q[h].metrics.offsetY_aux=e(I,O)+(I[O]-q[h].metrics.h)/2+(1+O)*y.metrics.paddingY,
Object.defineProperties(q[h].metrics,{parent:{value:y},matrixH:{value:K},dispY:{value:w},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY-this.matrixH/2+this.ascent+this.offsetY_aux+this.dispY}}});y.metrics.w=D;y.metrics.ascent=K/2-w;y.metrics.descent=K/2+w;y.metrics.h=y.metrics.ascent+y.metrics.descent;g+=2*y.metrics.marginX}else if("defparts"===
d.nodeType){y=d;y.updateFormula();q=d.children;E=d.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=g;Object.defineProperties(y.metrics,{parent:{value:c},x:{get:function(){return this.offsetX-2*this.marginX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+c.metrics.paddingX+3*this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}});
a.ctx.font=d.style.toString();z=f(a.ctx.font);H=0;I=y.metrics.paddingY;w=z.descent-z.h/2;for(h=0;h<E;h++)q[h].metrics.offsetY_aux=I,H=Math.max(H,q[h].metrics.w),I+=q[h].metrics.h+y.metrics.paddingY,Object.defineProperties(q[h].metrics,{parent:{value:y},dispY:{value:w},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX}},offsetY:{get:function(){return c.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-w;y.metrics.descent=I/2+w;y.metrics.h=y.metrics.ascent+y.metrics.descent;g+=2*y.metrics.marginX}else if("numerator"===d.nodeType||"denominator"===d.nodeType||"index"===d.nodeType||"radicand"===d.nodeType||"from"===d.nodeType||"to"===d.nodeType||"what"===d.nodeType||"element"===d.nodeType)d.updateFormula(),d.metrics.paddingX=parseInt(1.5+.075*this.style.size),d.metrics.paddingY=
parseInt(1.5+.05*this.style.size),d.metrics.w+=2*d.metrics.paddingX,d.metrics.ascent+=d.metrics.paddingY,d.metrics.descent+=d.metrics.paddingY,d.metrics.h=d.metrics.ascent+d.metrics.descent;h=d;this.metrics.ascent=Math.max(this.metrics.ascent,d.metrics.ascent);this.metrics.descent=Math.max(this.metrics.descent,d.metrics.descent);this.metrics.w+=d.metrics.w+2*d.metrics.marginX;this.metrics.h=this.metrics.ascent+this.metrics.descent;g+=d.metrics.w}};g.prototype.justifyAux=function(a){for(var c=0,b=
0,d=0,g=this.children.length;d<g-1;d++)"space"===this.children[d].nodeType?c++:b+=this.children[d].metrics.w;this.updateLine((a-b)/c)};g.prototype.drawTextBlock=function(a){a.fillStyle=d;for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a)};g.prototype.drawTextLineBlock=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a)};g.prototype.drawText=function(a){if(""!==this.value){var c=this.metrics.x,b=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(c,b-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(c,b+parseInt(1+this.style.size/10),this.metrics.w,parseInt(1+this.style.size/25)),a.fill());if(this.style.border){var g=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,c,b);a.strokeStyle=g}a.fillText(this.value,c,b)}};g.prototype.drawWord=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a)};g.prototype.drawSpace=function(a){};g.prototype.drawDynamicText=function(a){var c=this.metrics.x+this.metrics.paddingX,b=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(c,b-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(c,b+parseInt(1+this.style.size/10),this.metrics.w,parseInt(1+this.style.size/25)),a.fill());a.fillText(this.evalValue,c,b);this.drawBorder(a,"blue")};g.prototype.drawHyperlink=function(a){var c=this.metrics.x,b=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=c+"px";this.clickCatcher.style.top=b-this.metrics.ascent+"px";a.fillStyle="blue";this.click&&(a.fillStyle="white",a.fillRect(c,b-this.metrics.ascent,this.metrics.w,this.metrics.h),a.fillStyle="red");a.font=this.style.toString();a.beginPath();a.rect(c,b+parseInt(1+this.style.size/10),this.metrics.w,parseInt(1+this.style.size/25));a.fill();a.fillText(this.value,c,b)};g.prototype.drawFormula=function(a){for(var c=
0,b=this.children.length;c<b;c++)this.children[c].draw(a);this.drawBorder(a,"blue")};g.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 c=parseInt(1+this.style.size/24);a.rect(this.metrics.x,this.metrics.offsetY-parseInt(c/2),this.metrics.w,c);a.fill();this.children[0].draw(a);this.children[1].draw(a);this.drawBorder(a,"blue")};g.prototype.drawNumDen=function(a){for(var c=
0,b=this.children.length;c<b;c++)this.children[c].draw(a);this.drawBorder(a,"blue")};g.prototype.drawSuperIndex=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a);this.drawBorder(a,"blue")};g.prototype.drawSubIndex=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a);this.drawBorder(a,"blue")};g.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 g=0,f=this.children.length;g<f;g++)this.children[g].draw(c);this.drawBorder(c,"blue")};g.prototype.drawSum=function(c){c.save();c.fillStyle=null!==this.style.color?this.style.color.getColor?
this.style.color.getColor():this.style.color:d;c.translate(this.sigmaSign.x,this.sigmaSign.y);c.scale(this.sigmaSign.scale,this.sigmaSign.scale);a.isMsEdge?this.drawSigmaSign(c):c.fill(h);c.restore();for(var b=0,g=this.children.length;b<g;b++)this.children[b].draw(c);this.drawBorder(c,"blue")};g.prototype.drawIntegral=function(c){c.save();c.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:d;c.translate(this.sign.x,this.sign.y);c.scale(this.sign.scale,
this.sign.scale);a.isMsEdge?this.drawIntegralSign(c):c.fill(m);c.restore();for(var b=0,g=this.children.length;b<g;b++)this.children[b].draw(c);this.drawBorder(c,"blue")};g.prototype.drawLimit=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].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")};g.prototype.drawMatrix=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].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();a.moveTo(this.metrics.x+b+1.5*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent);a.lineTo(this.metrics.x+b,this.metrics.y+b-this.metrics.ascent);a.lineTo(this.metrics.x+
b,this.metrics.y-b-this.metrics.ascent+this.metrics.h);a.lineTo(this.metrics.x+b+1.5*this.metrics.marginX,this.metrics.y-b-this.metrics.ascent+this.metrics.h);a.moveTo(this.metrics.x+this.metrics.w-b-1.5*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent);a.lineTo(this.metrics.x+this.metrics.w-b,this.metrics.y+b-this.metrics.ascent);a.lineTo(this.metrics.x+this.metrics.w-b,this.metrics.y+b-this.metrics.ascent+this.metrics.h);a.lineTo(this.metrics.x+this.metrics.w-b-1.5*this.metrics.marginX,
this.metrics.y+b-this.metrics.ascent+this.metrics.h);a.stroke();this.drawBorder(a,"blue")};g.prototype.drawDefparts=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].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();b=3*this.metrics.marginX;var g=b/2;a.moveTo(this.metrics.x+c+b,this.metrics.y+c-this.metrics.ascent);a.bezierCurveTo(this.metrics.x+
c+g,this.metrics.y+c-this.metrics.ascent,this.metrics.x+c+g,this.metrics.y+c-this.metrics.ascent,this.metrics.x+c+g,this.metrics.y+c-this.metrics.ascent+2*this.metrics.marginX);a.lineTo(this.metrics.x+c+g,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2-5*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+c+g,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+c+g,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+c,this.metrics.y+c-this.metrics.ascent+this.metrics.h/
2);a.bezierCurveTo(this.metrics.x+c+g,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+c+g,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2,this.metrics.x+c+g,this.metrics.y+c-this.metrics.ascent+this.metrics.h/2+5*this.metrics.marginX);a.lineTo(this.metrics.x+c+g,this.metrics.y+c-this.metrics.ascent+this.metrics.h-2*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+c+g,this.metrics.y-c-this.metrics.ascent+this.metrics.h,this.metrics.x+c+g,this.metrics.y-c-this.metrics.ascent+
this.metrics.h,this.metrics.x+c+b,this.metrics.y-c-this.metrics.ascent+this.metrics.h);a.stroke();this.drawBorder(a,"blue")};g.prototype.drawGenericBlock=function(a){for(var c=0,b=this.children.length;c<b;c++)this.children[c].draw(a);this.drawBorder(a,"blue")};g.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)};g.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)};g.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()};g.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()};g.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()};g.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([])};g.prototype.toRTF=function(){var a=[],b=[],d="";this.mergeTextNodes();for(var g=0,f=this.children.length;g<f;g++){var e=this.children[g];"textLineBlock"===e.nodeType&&
(d+=e.toRTFAux(a,b)+(1<f&&g<f-1?"\\par":""))}e="{\\fonttbl";g=0;for(f=a.length;g<f;g++)e+="\\f"+g+"\\fcharset0 "+a[g]+";";a="";if(0<b.length){a="{\\colortbl";g=0;for(f=b.length;g<f;g++)a+=b[g];a+="}"}return"{\\rtf1\\uc0"+(e+"}")+a+d+"}"};g.prototype.toRTFAux=function(a,b){for(var c,g,f,e=null,h="",m,l,q,r,v,J=0,F=this.children.length;J<F;J++)m=l="",c=this.children[J],q=this.addToFontTable(c.style.family,a),r=c.style.size,v=this.addToColorTable(c.style.color,b),null===v&&0<b.length&&(v=this.addToColorTable(d,
b)),v!==e&&(m+="\\cf"+v,e=v),q!==g&&(m+="\\f"+q,g=q),r!==f&&(m+="\\fs"+2*r,f=r),c.style.italic&&(m+="\\i",l="\\i0"+l),c.style.bold&&(m+="\\b",l="\\b0"+l),c.style.underline&&(m+="\\ul",l="\\ulnone"+l),c.style.overline&&(m+="\\ol",l="\\olnone"+l),"text"===c.nodeType?(c.value=c.value.replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/{/g,"\\{").replace(/}/g,"\\}"),c=""!==m?m+" "+c.value+l:""!==h&&"}"!==h.charAt(h.length-1)?" "+c.value:c.value,h+=c):"formula"===c.nodeType?h+="{\\*\\mjaformula"+c.formulaToRTF(g,
f,e,a,b)+"}":"componentSpace"===c.nodeType?h+="{\\*\\component\\Space "+c.value+"}":"componentNumCtrl"===c.nodeType&&(h+="{\\*\\component\\NumCtrl "+c.value+"}");return h};g.prototype.formulaToRTF=function(a,b,g,f,e){for(var c,h="",k,m,l,q,r=0,u=this.children.length;r<u;r++)k=m="",c=this.children[r],l=this.addToFontTable(c.style.family,f),q=this.addToColorTable(c.style.color,e),null===q&&0<e.length&&(q=this.addToColorTable(d,e)),l!==a&&(k+="\\f"+l,a=l),q!==g&&(k+="\\cf"+q,"text"!==c.nodeType||"text"===
c.nodeType&&""!==c.value)&&(g=q),c.style.italic&&(k+="\\i",m="\\i0"+m),c.style.bold&&(k+="\\b",m="\\b0"+m),c.style.underline&&(k+="\\ul",m="\\ulnone"+m),c.style.overline&&(k+="\\ol",m="\\olnone"+m),"text"===c.nodeType&&""!==c.value?(c.value=c.value.replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/{/g,"\\{").replace(/}/g,"\\}"),tmpRTF=""!==k?k+" "+c.value+m:"}"!==h.charAt(h.length-1)?" "+c.value:c.value,h+=tmpRTF):"dynamicText"===c.nodeType?(c.value=""===c.value?" ":c.value,h+=k+"{\\expr "+c.value+
"\\decimals "+(c.decimals||2)+"\\fixed"+(c.fixed?1:0)+"}"+m):"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?h+="{\\"+c.nodeType+c.formulaToRTF(a,b,g,f,e)+"}":"numerator"===c.nodeType?h+="{\\num"+c.formulaToRTF(a,b,g,f,e)+"}":"denominator"===c.nodeType?h+="{\\den"+c.formulaToRTF(a,b,g,f,e)+"}":"superIndex"===
c.nodeType?h+="{\\supix"+c.formulaToRTF(a,b,g,f,e)+"}":"subIndex"===c.nodeType?h+="{\\subix"+c.formulaToRTF(a,b,g,f,e)+"}":"matrix"===c.nodeType?h+="{\\matrix\\rows "+(c.rows||2)+"\\columns "+(c.columns||2)+c.formulaToRTF(a,b,g,f,e)+"}":"defparts"===c.nodeType&&(h+="{\\defparts\\parts "+(c.parts||2)+c.formulaToRTF(a,b,g,f,e)+"}");return h};g.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};g.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};g.prototype.mergeTextNodes=function(){for(var a=[],b=null,d=0,g=this.children.length;d<g;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(g=a.length;d<g;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=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=String.fromCharCode,f,d,r,l,b,h,m,g,q,c,v,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[];f=[];d="";l=r=0;h=a.charAt(0);m=!1;for(g="text";r<a.length;)b=h,h=a.charAt(r+1),m?"\\"===h||"{"===h||"}"===
h||" "===h||";"===h?(m=!1,d+=b," "===h?(r++,h=a.charAt(r+1),v=!0):v=!1,(q=d.match(/^'([0-9a-f]{2})/))?(c="","text"===g&&(c=f.pop().value),d=c+=e(parseInt(q[1],16))+d.substring(3)):(q=d.match(/^u[0-9]+/))?(c="","text"===g&&(c=f.pop().value),d=c+=e(q[0].substring(1))):("{"===d||"}"===d||"\\"==b?(f.push({type:"text",value:d+(v?" ":"")}),g="text"):(f.push({type:"controlWord",value:d}),g="controlWord"),d="")):"{"==b||"}"==b||"\\"==b?(m=!1,f.push({type:"text",value:b}),g="text"):d+=b:"\\"===b?(m=!0,""!==
d&&(f.push({type:"text",value:d}),g="text",d="")):"{"===b?(l++,""!==d&&(f.push({type:"text",value:d}),d=""),f.push({type:"openBlock",value:l}),g="openBlock"):"}"===b?(""!==d&&(f.push({type:"text",value:d}),d=""),f.push({type:"closeBlock",value:l}),g="closeBlock",l--):d+=b,r++;""!==d&&f.push({type:"text",value:d});return f};a.RTFTokenizer=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=Math.max,f,d,r,l,b,h,m,g,q,c,v,k,u,x,p,n,B,w,y,A,E,J,F,H,z,I,C,M,N,O,G=function(c){this.evaluator=c;this.tokenizer=new a.RTFTokenizer};G.prototype.parse=function(D){f=this.tokenizer.tokenize(D);d={};l=2;if("openBlock"===f[0].type&&"fonttbl"===f[1].value){for(r=f[0].value;"closeBlock"!==f[l].type&&f[l].value!==r;)d[f[l].value]=f[l+2].value.substring(0,f[l+2].value.length-1),l+=3;l++}b={};h=0;if("openBlock"===f[l].type&&"colortbl"===f[l+1].value){r=
f[l++].value;for(l++;"closeBlock"!==f[l].type&&f[l].value!==r;)m=parseInt(f[l++].value.substring(3)).toString(16),g=parseInt(f[l++].value.substring(5)).toString(16),q=parseInt(f[l++].value.substring(4)).toString(16),";"===f[l].value&&l++,b[h++]="#"+(2>m.length?"0"+m:m)+(2>g.length?"0"+g:g)+(2>q.length?"0"+q:q);l++}x=u=k=null;M=C=I=A=y=w=B=n=p=!1;E=[new a.TextStyle];J=E[0];H=F=-1;z=[];c=N=new a.TextNode("","textBlock",J,this.evaluator);v=new a.TextNode("","textLineBlock",J,this.evaluator);c.addChild(v);
N.stableWidth=!0;N.hasFormula=!1;D=l;for(var G=f.length;D<G;D++){if("controlWord"==f[D].type)if(d[f[D].value])J.set({family:d[f[D].value]});else if(f[D].value.match(/^fs(\d+)/))J.set({size:parseInt(f[D].value.match(/^fs(\d+)/)[1]/2)});else if("b"==f[D].value)J.set({bold:!0}),0<z.length&&z[z.length-1].style.set({bold:!0});else if("b0"==f[D].value)J.set({bold:!1}),0<z.length&&z[z.length-1].style.set({bold:!1});else if("i"==f[D].value)J.set({italic:!0}),0<z.length&&z[z.length-1].style.set({italic:!0});
else if("i0"==f[D].value)J.set({italic:!1}),0<z.length&&z[z.length-1].style.set({italic:!1});else if("ul"==f[D].value)J.set({underline:!0}),0<z.length&&z[z.length-1].style.set({underline:!0});else if("ulnone"==f[D].value)J.set({underline:!1}),0<z.length&&z[z.length-1].style.set({underline:!1});else if("ol"==f[D].value)J.set({overline:!0}),0<z.length&&z[z.length-1].style.set({overline:!0});else if("olnone"==f[D].value)J.set({overline:!1}),0<z.length&&z[z.length-1].style.set({overline:!1});else if(f[D].value.match(/^cf(\d+)/))J.set({color:b[parseInt(f[D].value.substring(2))]}),
0<z.length&&(z[z.length-1].style.color=J.color);else if("par"==f[D].value){c=new a.TextNode("","textLineBlock",J.clone(),this.evaluator);if("textBlock"!=v.nodeType)for(v=v.parent;"textBlock"!=v.nodeType;)v=v.parent;v.addChild(c);v=c}else if("mjaformula"==f[D].value)N.hasFormula=!0,H=F,p=!0,c=new a.TextNode("","formula",J.clone(),this.evaluator),v.addChild(c),v=c,z[z.length-1]=c;else if("fraction"==f[D].value||"radicand"==f[D].value||"radical"==f[D].value||"what"==f[D].value||"sum"==f[D].value||"integral"==
f[D].value||"limit"==f[D].value){var L=z[z.length-2].style.clone();c=new a.TextNode("",f[D].value,L,this.evaluator);z[z.length-2].addChild(c);z[z.length-1]=c}else"index"==f[D].value?(L=z[z.length-2].style.clone(),L.size=e(parseInt(L.size-.5*L.size),8),c=new a.TextNode("",f[D].value,L,this.evaluator),z[z.length-2].addChild(c),z[z.length-1]=c):"to"==f[D].value||"from"==f[D].value?(L=z[z.length-2].style.clone(),L.size=e(parseInt(L.size-.2*L.size),8),c=new a.TextNode("",f[D].value,L,this.evaluator),z[z.length-
2].addChild(c),z[z.length-1]=c):"num"==f[D].value||"den"==f[D].value?(L=z[z.length-2].style.clone(),L.size=e(Math.round(L.size-.1*L.size),8),"num"==f[D].value?c=new a.TextNode("","numerator",L,this.evaluator):"den"==f[D].value&&(c=new a.TextNode("","denominator",L,this.evaluator)),z[z.length-2].addChild(c),z[z.length-1]=c):"subix"==f[D].value||"supix"==f[D].value?(L=z[z.length-2].style.clone(),L.size=e(Math.floor(L.size-.33*L.size),8),"subix"==f[D].value?c=new a.TextNode("","subIndex",L,this.evaluator):
"supix"==f[D].value&&(c=new a.TextNode("","superIndex",L,this.evaluator)),c.originalStyle=z[z.length-2].style.clone(),z[z.length-2].addChild(c),z[z.length-1]=c):"defparts"==f[D].value||"matrix"==f[D].value||"element"==f[D].value?(L=z[z.length-2].style.clone(),c=new a.TextNode("",f[D].value,L,this.evaluator),z[z.length-2].addChild(c),z[z.length-1]=c,"defparts"==f[D].value?x=c:"matrix"==f[D].value&&(u=c)):"parts"==f[D].value?A=!0:"rows"==f[D].value?w=!0:"columns"==f[D].value?y=!0:"expr"==f[D].value?
(N.stableWidth=!1,n=!0):"decimals"==f[D].value?B=!0:"fixed1"==f[D].value?k.fixed=!0:"fixed0"==f[D].value?k.fixed=!1:"component"!=f[D].value&&("NumCtrl"==f[D].value?I=!0:"Space"==f[D].value?C=!0:"hyperlink"==f[D].value&&(M=!0));if("text"==f[D].type)if(A)x.parts=parseInt(f[D].value),A=!1;else if(w)u.rows=parseInt(f[D].value),w=!1;else if(y)u.columns=parseInt(f[D].value),y=!1;else if(B)k.decimals=this.evaluator.parser.parse(f[D].value+""),B=!1;else if(M){O=f[D].value.split("|")[0];L=J.clone();c=new a.TextNode(O,
"hyperlink",L,this.evaluator);c.URL=f[D].value.split("|")[1];if("textLineBlock"!=v.nodeType)for(v=v.parent;"textLineBlock"!=v.nodeType;)v=v.parent;v.addChild(c);M=!1}else if(I)c=new a.TextNode(f[D].value,"componentNumCtrl",J.clone(),this.evaluator),v.addChild(c),I=!1;else if(C)c=new a.TextNode(f[D].value,"componentSpace",J.clone(),this.evaluator),v.addChild(c),C=!1;else if(n)L=z[z.length-2].style.clone(),O=this.evaluator.parser.parse(f[D].value),c=new a.TextNode(O,"dynamicText",L,this.evaluator),
z[z.length-2].addChild(c),k=z[z.length-1]=c,n=!1;else if(n||p)!n&&p&&(O=f[D].value,c=new a.TextNode(O,"text",z[z.length-1].style.clone(),this.evaluator),z[z.length-1].addChild(c));else{O=f[D].value;c=new a.TextNode(O,"text",J.clone(),this.evaluator);if("textLineBlock"!=v.nodeType)for(v=v.parent;"textLineBlock"!=v.nodeType;)v=v.parent;v.addChild(c)}else if("openBlock"==f[D].type)F=f[D].value,J=J.clone(),E.push(J),z.push(null);else if("closeBlock"==f[D].type)f[D].value==H&&(H=-1,p=!1,v=v.parent),E.pop(),
J=E[E.length-1],z.pop();else if("("==f[D].type||")"==f[D].type)L=z[z.length-1].style.clone(),L.italic="",c=new a.TextNode(f[D].type,"mathSymbol",L,this.evaluator),z[z.length-1].addChild(c);else if("+"==f[D].type||"-"==f[D].type||"*"==f[D].type||"="==f[D].type)c=new a.TextNode(f[D].type,"mathSymbol",z[z.length-1].style.clone(),this.evaluator),z[z.length-1].addChild(c)}return N.normalize()};a.RTFParser=G;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b,h,m,g,q,c,v=function(c,b){this.parent=c;f=this.evaluator=this.parent.evaluator;d=f.parser;this.id="";this.type="2D";this.xExpr=d.parse("0");this.yExpr=d.parse("0");this.w=parseInt(c.container.width);this.h=parseInt(c.container.height);this.drawif=d.parse("1");this.fixed=2===c.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!=c.version?new a.Color("c0c0c0"):"";this.net10=2!=c.version?new a.Color("808080"):"";this.axes=2!=c.version?new a.Color("808080"):"";this.text=new a.Color("ffafaf");this.numbers=!1;this.y_axis=this.x_axis=2!=c.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=c.zIndex;this.plecaHeight=c.plecaHeight||0;this.displaceRegionNorth=c.displaceRegionNorth||
0;this.displaceRegionWest=c.displaceRegionWest||0;Object.assign(this,b);this.initSpace()};v.prototype.initSpace=function(){e=this.parent;f=this.evaluator;r=this.id;this.resizable||(this.displaceRegionNorth=e.displaceRegionNorth||0,this.displaceRegionSouth=e.displaceRegionSouth||0,this.displaceRegionEast=e.displaceRegionEast||0,this.displaceRegionWest=e.displaceRegionWest||0,m=parseInt(e.container.width),h=parseInt(e.container.height),void 0!=this.wExpr&&(this.w=parseInt(m-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=f.parser.parse((parseInt(m-this.displaceRegionWest-this.displaceRegionEast)*parseFloat(this.xPercentExpr)/100).toString())),void 0!=this.yPercentExpr&&(this.yExpr=f.parser.parse((parseInt(h-this.displaceRegionNorth-this.displaceRegionSouth)*parseFloat(this.yPercentExpr)/100).toString())),this.x=
f.eval(this.xExpr)+this.displaceRegionWest,this.y=f.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?(l=h-this.y,this.h>l&&(this.h=l)):(l=this.h+this.y,this.h=l>=h?h:l),0<=this.x?(b=m-this.x,this.w>b&&(this.w=b)):(b=this.w+this.x,this.w=b>=m?m:b));""==this.imageSrc&&/vacio.gif$/i.test(this.imageSrc.trim())||(this.image=e.getImage(this.imageSrc));this.OxExpr&&(q=this.OxExpr,"%"===q[q.length-
1]?this.Ox=this.w*parseFloat(q)/100:(g=parseFloat(q),g!=q&&(g=0),this.Ox=g));this.OyExpr&&(c=this.OyExpr,"%"===c[c.length-1]?this.Oy=this.h*parseFloat(c)/100:(g=parseFloat(c),g!=c&&(g=0),this.Oy=g));""!==this.id&&2!==e.version?(f.setVariable(r+"._w",this.w),f.setVariable(r+"._h",this.h),f.setVariable(r+".escala",this.scale),f.setVariable(r+".Ox",this.Ox),f.setVariable(r+".Oy",this.Oy),f.setVariable(r+".mouse_x",0),f.setVariable(r+".mouse_y",0),f.setVariable(r+".mouse_pressed",0),f.setVariable(r+".mouse_clicked",
0),f.setVariable(r+".clic_izquierdo",0)):(g=f.getVariable("_w"),void 0===g&&(g=this.w),f.setVariable("_w",g),g=f.getVariable("_h"),void 0===g&&(g=this.h),f.setVariable("_h",g),g=f.getVariable("escala"),void 0===g&&(g=this.scale),f.setVariable("escala",g),g=f.getVariable("Ox"),void 0===g&&(g=this.Ox),f.setVariable("Ox",g),g=f.getVariable("Oy"),void 0===g&&(g=this.Oy),f.setVariable("Oy",g),f.setVariable("mouse_x",0),f.setVariable("mouse_y",0),f.setVariable("mouse_pressed",0),f.setVariable("mouse_clicked",
0),f.setVariable("clic_izquierdo",0),2==e.version&&""===this.x_axis&&""===this.y_axis&&(this.axes=""));this.w_2=this.w/2;this.h_2=this.h/2};v.prototype.addCtr=function(a){"GraphicControl"===a.type?this.graphicsCtr.push(a):this.ctrs.push(a)};v.prototype.addGraph=function(a,c){"2D"===this.type&&c||"3D"===this.type&&!c||(a.background&&"3D"!==this.type?this.backGraphics.push(a):this.graphics.push(a))};v.prototype.clearClick=function(){this.evaluator.setVariable(this.mclickedString,0);this.evaluator.setVariable(this.mclicizquierdoString,
0)};v.prototype.getRelativeX=function(a){return(parseInt(a)-this.w_2-this.Ox)/this.scale};v.prototype.getRelativeY=function(a){return(-parseInt(a)+this.h_2+this.Oy)/this.scale};v.prototype.getAbsoluteX=function(a){return a*this.scale+this.w_2+this.Ox};v.prototype.getAbsoluteY=function(a){return-a*this.scale+this.h_2+this.Oy};a.Space=v;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f=function(d){e=this;e.parent=d;e.width=228;e.vSpace=25;e.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:"+(e.width+27)+"px;height:460px;"});e.movable=a.newHTML("div",{style:"position:absolute;left:0;top:0;width:"+(e.width+27)+"px;height:"+e.vSpace+
"px;line-height:"+e.vSpace+"px;background-color:#ddd;cursor:move;padding-left:75px;font-family:"+a.sansserif_font+";font-size:18px;"});e.movable.innerHTML="Descartes";e.container.appendChild(e.movable);e.ctrs=[]};f.prototype.init=function(){function d(b){e.newPos=a.getCursorPosition(b,document.body);e.container.style.left=e.initialPosition.x+(e.newPos.x-e.oldPos.x)*a.cssScale+"px";e.container.style.top=e.initialPosition.y+(e.newPos.y-e.oldPos.y)*a.cssScale+"px"}function f(a){a.preventDefault();document.body.removeEventListener("mousemove",
d);document.body.removeEventListener("mouseup",f)}e=this;document.body.appendChild(this.container);for(var l=e.parent.evaluator.parser,b=0,h=e.ctrs.length;b<h;b++)e.ctrs[b].expresion=l.parse("(0,"+(e.vSpace+23+35*b)+","+e.width+",35)"),e.ctrs[b].update();e.numCtr=h;b=new a.Button(e.parent,{region:"external",name:"english"==e.language?"about":"cr\u00e9ditos",font_size:l.parse("15"),expresion:l.parse("(0,"+e.vSpace+","+e.width/2+",25)")});b.actionExec={execute:a.showAbout};b.update();(new a.Button(e.parent,
{region:"external",name:"config",font_size:l.parse("15"),action:"config",expresion:l.parse("("+e.width/2+","+e.vSpace+","+e.width/2+",25)")})).update();(new a.Button(e.parent,{region:"external",name:"english"==e.language?"init":"inicio",font_size:l.parse("15"),action:"init",expresion:l.parse("(0,"+(e.vSpace+23+35*h)+","+e.width/2+",25)")})).update();(new a.Button(e.parent,{region:"external",name:"english"==e.language?"clear":"limpiar",font_size:l.parse("15"),action:"clear",expresion:l.parse("("+e.width/
2+","+(e.vSpace+23+35*h)+","+e.width/2+",25)")})).update();l=new a.Button(e.parent,{region:"external",name:"english"==e.language?"close":"cerrar",font_size:l.parse("15"),expresion:l.parse("("+e.width/4+","+(e.vSpace+46+35*h)+","+e.width/2+",25)")});l.update();l.btn.addEventListener("click",function(a){e.hide()});e.setPositionAndSize();e.movable.addEventListener("mousedown",function(b){b.preventDefault();e.oldPos=a.getCursorPosition(b,document.body);e.initialPosition={x:e.container.offsetLeft,y:e.container.offsetTop};
document.body.addEventListener("mousemove",d);document.body.addEventListener("mouseup",f)});e.hide()};f.prototype.addCtr=function(a){this.ctrs.push(a)};f.prototype.show=function(){this.setPositionAndSize();this.container.style.display="block"};f.prototype.hide=function(){this.container.style.display="none"};f.prototype.setPositionAndSize=function(){e=this;var a=e.vSpace+46+35*e.numCtr+25+10;e.container.style.left=Math.max(parseInt(window.innerWidth-e.width)/2,0)+"px";e.container.style.top="5px";e.container.style.height=
window.innerHeight<e.vSpace+75?e.vSpace+75+"px":a>window.innerHeight-10?window.innerHeight-10:a+"px"};a.SpaceExternal=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e=Math.floor,f=Math.round,d=2*Math.PI,r=a.convertFont("SansSerif,PLAIN,12"),l=a.convertFont("Monospaced,PLAIN,12"),b,h,m,g,q,c,v,k,u,x,p,n,B,w,y,A,E,J,F,H,z,I,C,M,N,O,G,D,K,L,P,Q,R=function(c,d){b=d=a.Space.call(this,c,d)||this;b.ratio=c.ratio;b.border_width=b.border_width||0;b.borderColor=b.borderColor||new a.Color("000000",c.evaluator);b.border_radius=b.border_radius||0;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_width?"border:"+b.border_width+"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 g=b.id+".image";b.parent.images[g]=b.canvas;b.parent.images[g].ready=1;b.parent.images[g].complete=b.parent.images[g].canvas=!0;b.evaluator.setVariable(g,g);g=b.id+".back";b.parent.images[g]=b.backCanvas;b.parent.images[g].ready=1;b.parent.images[g].complete=
b.parent.images[g].canvas=!0;b.evaluator.setVariable(g,g);g=""!==b.id&&2!==c.version?b.id+".":"";b.OxStr=g+"Ox";b.OyStr=g+"Oy";b.scaleStr=g+"escala";b.wStr=g+"_w";b.hStr=g+"_h";b.mxStr=g+"mouse_x";b.myStr=g+"mouse_y";b.mpressedStr=g+"mouse_pressed";b.mclickedStr=g+"mouse_clicked";b.mclickIzqStr=g+"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(R,a.Space);R.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")};R.prototype.update=function(a){b=this;h=b.evaluator;m=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)+m.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)+m.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"};R.prototype.drawBackground=function(){b=this;h=b.evaluator;g=b.backCtx;g.clearRect(0,0,b.backCanvas.width,b.backCanvas.height);g.fillStyle=b.backColor=b.background.getColor();
g.fillRect(0,0,b.backCanvas.width,b.backCanvas.height);b.image&&""!=b.image.src&&b.image.ready&&b.image.complete&&("topleft"===b.bg_display?g.drawImage(b.image,0,0):"stretch"===b.bg_display?g.drawImage(b.image,0,0,b.w,b.h):"patch"===b.bg_display?(g.fillStyle=g.createPattern(b.image,"repeat"),g.fillRect(0,0,b.w,b.h)):"imgcenter"===b.bg_display&&g.drawImage(b.image,(b.w-b.image.width)/2,(b.h-b.image.height)/2));k=b.scale;u=0;for(x=0>b.w+b.h?0:b.w+b.h;k>x;)k/=10,u++;for(;k<x/10;)k*=10;g.lineWidth=1;
""!==b.net&&(g.strokeStyle=b.net.getColor(),b.drawMarks(g,k/10,-1));if(2!==b.parent.version&&""!==b.net10||2===b.parent.version&&""!==b.net&&""!==b.net10)g.strokeStyle=b.net10.getColor(),b.drawMarks(g,k,-1);if(""!==b.axes){var a="";"no"==b.x_axis&&(a+="x");"no"==b.y_axis&&(a+="y");g.strokeStyle=b.axes.getColor();g.beginPath();"no"==b.x_axis||""===b.x_axis&&2===b.parent.version||(g.moveTo(0,e(b.h/2+b.Oy)+.5),g.lineTo(b.w,e(b.h/2+b.Oy)+.5));"no"==b.y_axis||""===b.y_axis&&2===b.parent.version||(g.moveTo(e(b.w/
2+b.Ox)+.5,0),g.lineTo(e(b.w/2+b.Ox)+.5,b.h));g.lineWidth=1.2;g.stroke();g.lineWidth=1;b.drawMarks(g,k,4,a);b.drawMarks(g,k/2,2,a);b.drawMarks(g,k/10,1,a)}if(""!==b.x_axis||""!==b.y_axis)g.fillStyle=""!==b.axes?b.axes.getColor():"#000",g.font=r,g.textAlign="right",g.textBaseline="alphabetic","no"!=b.x_axis&&g.fillText(b.x_axis,e(b.w)-2,e(b.h/2+b.Oy)+12),"no"!=b.y_axis&&g.fillText(b.y_axis,e(b.w/2+b.Ox)-2,12);b.numbers&&""!=b.axes&&(g.fillStyle=b.axes.getColor(),g.font=r,g.textAlign="start",g.textBaseline=
"bottom",k>(b.w+b.h)/2?b.drawNumbers(g,k/5,k<=b.scale?u+1:u):k>(b.w+b.h)/4?b.drawNumbers(g,k/2,k<=b.scale?u+1:u):b.drawNumbers(g,k,u));a=0;for(var c=this.backGraphics.length;a<c;a++)this.backGraphics[a].draw()};R.prototype.draw=function(){b=this;g=b.ctx;g.clearRect(0,0,b.canvas.width,b.canvas.height);for(var a=0,c=b.graphics.length;a<c;a++)v=b.graphics[a],""!==v.trace&&b.drawTrace&&v.drawTrace(),v.draw();a=0;for(c=b.graphicsCtr.length;a<c;a++)b.graphicsCtr[a].draw();""!=b.text&&b.click&&"L"===b.whichBtn&&
(g.save(),g.strokeStyle=g.fillStyle=b.text.getColor(),g.lineWidth=1,g.font=l,g.textAlign="center",g.textBaseline="alphabetic",z=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="("+z+","+I+")",M=e(g.measureText(C).width/2),N=b.getAbsoluteX(b.mouse_x),O=b.getAbsoluteY(b.mouse_y),G=e(N),D=e(O-10),G+M>b.w?G=b.w-M:0>G-M&&(G=M),D+1>b.h?D=b.h:0>D-14&&(D=15),g.fillText(C,G,D),g.beginPath(),g.arc(N,
O,2.5,0,d,!0),g.stroke(),g.restore())};R.prototype.drawMarks=function(a,c,b,d){p=this.w;n=this.h;F=E=0;J=p;H=n;y=e(p/2+this.Ox);A=e(n/2+this.Oy);0<=b&&(E=y-b,J=y+b,F=A-b,H=A+b);a.beginPath();if(!d||d&&!d.match("x"))for(b=-f(y/c);(B=y+f(b*c))<p;b++)a.moveTo(B+.5,F+.5),a.lineTo(B+.5,H+.5);if(!d||d&&!d.match("y"))for(b=-f(A/c);(w=A+f(b*c))<n;b++)a.moveTo(E+.5,w+.5),a.lineTo(J+.5,w+.5);a.stroke()};R.prototype.drawNumbers=function(a,c,b){p=this.w;n=this.h;y=e(p/2+this.Ox);A=e(n/2+this.Oy);for(b=-f(y/c);(B=
y+f(b*c))<p;b++)a.fillText(parseFloat((b*c/this.scale).toFixed(4)),B+1,A-2);for(b=-f(A/c);(w=A+f(b*c))<n;b++)0!==parseFloat(-b*c/this.scale)&&a.fillText(parseFloat((-b*c/this.scale).toFixed(4)),y+5,w+5)};R.prototype.addEvents=function(){function c(a){window.focus();document.activeElement.blur();if(e.evaluator.variables[e.id+".DESCARTESJS_no_fixed"]||!e.fixed||e.sensitive_to_mouse_movements)e.click=0,e.evaluator.setVariable(e.mpressedStr,0),e.evaluator.setVariable(e.mclickedStr,1),e.evaluator.setVariable(e.mclickIzqStr,
1),window.removeEventListener("touchmove",f),window.removeEventListener("touchend",c),a.stopPropagation(),a.preventDefault(),e.parent.update()}function b(c){document.activeElement.blur();window.focus();c.stopPropagation();c.preventDefault();e.click=0;e.evaluator.setVariable(e.mpressedStr,0);e.evaluator.setVariable(e.mclickedStr,1);e.evaluator.setVariable(e.mclickIzqStr,1);"R"===e.whichBtn&&(window.removeEventListener("mousemove",g),e.posZoom==e.posZoomNew&&a.showConfig&&(e.parent.externalSpace.show(),
e.posZoom=!1,e.posZoomNew=!0));window.removeEventListener("mousemove",f);window.removeEventListener("mouseup",b);e.parent.deactivateGraphicControls();e.parent.update()}function d(c){e.posAnte=a.getCursorPosition(c,e.container);e.mouse_x=e.getRelativeX(e.posAnte.x);e.mouse_y=e.getRelativeY(e.posAnte.y);e.evaluator.setVariable(e.mxStr,e.mouse_x);e.evaluator.setVariable(e.myStr,e.mouse_y);e.evaluator.setVariable(e.mclickedStr,0);e.evaluator.setVariable(e.mclickIzqStr,0);e.parent.update()}function g(c){c.preventDefault();
e.posZoomNew=a.getCursorPosition(c,e.container).y;e.evaluator.setVariable(e.scaleStr,e.tempScale+e.tempScale/45*((e.posZoom-e.posZoomNew)/10));e.parent.update()}function f(c){c.preventDefault();c.stopPropagation();e.fixed||(e.posNext=a.getCursorPosition(c,e.container),P=e.posAnte.x-e.posNext.x,Q=e.posAnte.y-e.posNext.y,e.evaluator.setVariable(e.OxStr,e.Ox-P),e.evaluator.setVariable(e.OyStr,e.Oy-Q));d(c)}var e=this;e.posZoom=e.posZoomNew=null;e.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(e.evaluator.variables[e.id+".DESCARTESJS_no_fixed"]||!e.fixed||e.sensitive_to_mouse_movements)e.parent.clearClick(),e.click=1,e.evaluator.setVariable(e.mpressedStr,1),e.evaluator.setVariable(e.mclickedStr,0),e.evaluator.setVariable(e.mclickIzqStr,0),e.parent.deactivateGraphicControls(),d(a),window.addEventListener("touchmove",f),window.addEventListener("touchend",
c),a.stopPropagation(),a.preventDefault()});this.sensitive_to_mouse_movements&&this.canvas.addEventListener("mousemove",d);this.canvas.addEventListener("mousedown",function(c){window.focus();document.activeElement.blur();c.stopPropagation();c.preventDefault();e.parent.clearClick();e.click=1;e.parent.deactivateGraphicControls();e.whichBtn=a.whichBtn(c);"R"===e.whichBtn?(window.addEventListener("mouseup",b),e.posZoom=a.getCursorPosition(c,e.container).y,e.posZoomNew=e.posZoom,e.fixed||(e.tempScale=
e.scale,window.addEventListener("mousemove",g))):"L"===e.whichBtn&&(e.evaluator.setVariable(e.mpressedStr,1),e.evaluator.setVariable(e.mclickedStr,0),e.evaluator.setVariable(e.mclickIzqStr,0),d(c),window.addEventListener("mousemove",f),window.addEventListener("mouseup",b))});document.addEventListener("visibilitychange",function(a){b(a)})};a.Space2D=R;return a}(descartesJS||{});
descartesJS=function(a){var e,f,d;function r(c,b){G=a.subtract3D(c,a.scalarProduct3D(b,a.dotProduct3D(c,b)));D=a.add3D(c,a.scalarProduct3D(G,-2));K=a.norm3D(D);return 0!==K?a.scalarProduct3D(D,1/K):a.scalarProduct3D(c,-1)}if(a.loadLib)return a;var l=Math.floor,b=Math.max,h=Math.cos,m=Math.sin,g,q,c,v,k,u,x,p,n,B,w,y,A,E,J,F,H=[],z,I,C,M,N,O,G,D,K,L,P,Q=function(b,d){c=d=a.Space.call(this,b,d)||this;c.border_width=c.border_width||0;c.borderColor=c.borderColor||new a.Color("000000",b.evaluator);c.border_radius=
c.border_radius||0;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 g=c.id+".image";c.parent.images[g]=c.canvas;c.parent.images[g].ready=1;c.parent.images[g].complete=!0;c.parent.images[g].canvas=!0;c.evaluator.setVariable(g,g);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+";"+(0<c.border_width?"border:"+c.border_width+"px solid "+c.borderColor.getColor()+";":"")+(c.border_radius?"border-radius:"+
c.border_radius+"px;":"")});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}];g=0;for(var f=c.lights.length;g<f;g++)c.lights[g]=a.normalize3D(c.lights[g]);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(Q,a.Space);Q.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)};Q.prototype.update=function(a){c=this;g=c.evaluator;q=c.parent;g.setVariable(c.wStr,c.w);g.setVariable(c.hStr,c.h);c.drawIfValue=0<g.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,g.setVariable(c.wStr,c.w),g.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));u=c.x!==g.eval(c.xExpr)+c.displaceRegionWest;x=c.y!==g.eval(c.yExpr)+q.plecaHeight+c.displaceRegionNorth;c.spaceChange=a||u||x||c.drawBefore!==c.drawIfValue||c.Ox!==g.getVariable(c.OxStr)||c.Oy!==g.getVariable(c.OyStr)||c.Ojo.x!==g.getVariable(c.ojoXStr)||c.Ojo.y!==g.getVariable(c.ojoYStr)||c.Ojo.z!==g.getVariable(c.ojoZStr)||c.scale!==g.getVariable(c.scaleStr);c.x=u?g.eval(c.xExpr)+c.displaceRegionWest:c.x;c.y=x?g.eval(c.yExpr)+q.plecaHeight+c.displaceRegionNorth:
c.y;c.Ojo.x=g.getVariable(c.ojoXStr);c.Ojo.y=g.getVariable(c.ojoYStr);c.Ojo.z=g.getVariable(c.ojoZStr);c.Ox=g.getVariable(c.OxStr);c.Oy=g.getVariable(c.OyStr);c.scale=g.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?g.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);g.setVariable(c.obsStr,c.observer)}1E-6>c.scale?(c.scale=
1E-6,g.setVariable(c.scaleStr,1E-6)):1E6<c.scale&&(c.scale=1E6,g.setVariable(c.scaleStr,1E6));if(u||x)c.container.style.left=c.x+"px",c.container.style.top=c.y+"px";c.container.style.display="block";c.dim=g.getVariable(c.userIDimStr);c.userIntensity=g.getVariable(c.userIIStr);c.light3={x:parseInt(g.getVariable(c.userIxStr)),y:parseInt(g.getVariable(c.userIyStr)),z:parseInt(g.getVariable(c.userIzStr))};c.updateCamera();c.draw()}else c.container.style.display="none"};Q.prototype.updateCamera=function(){this.eye=
a.scalarProduct3D(this.Ojo,1/this.scale)};Q.prototype.rotateVertex=function(b){B=a.degToRad(c.evaluator.getVariable(c.rotZStr));w=h(B);y=m(B);e=b.x*w-b.y*y;f=b.x*y+b.y*w;d=b.z;B=a.degToRad(c.evaluator.getVariable(c.rotYStr));w=h(B);y=m(B);return{x:d*y+e*w,y:f,z:d*w-e*y}};Q.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}};Q.prototype.computeColor=function(c,
b,d){c.match("rgba")?c=a.RGBAToHexColor(c):c.match("#")&&(c=new a.Color(c.substring(1)));M=a.subtract3D(this.eye,b.average);N=a.norm3D(M);O=a.scalarProduct3D(M,1/N);this.lights[3]=a.subtract3D(this.light3,b.average);F=a.norm3D(this.lights[3]);for(var g=0,f=this.intensity.length-1;g<f;g++)H[g]=this.intensity[g]*this.dim;H[3]=this.userIntensity*this.userIntensity/F||0;z=d?this.dim/2:this.dim/4;I=0;C=0>b.direction?b.normal:a.scalarProduct3D(b.normal,-1);g=0;for(f=this.lights.length;g<f;g++)d?(I=Math.max(0,
a.dotProduct3D(r(this.lights[g],C),O)),I*=I*I):I=Math.max(0,a.dotProduct3D(this.lights[g],C)),z+=H[g]*I;z=Math.min(z,1);A=l(c.r*z);E=l(c.g*z);J=l(c.b*z);return"rgba("+A+","+E+","+J+","+c.a+")"};Q.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,c=this.graphics.length;a<c;a++)this.graphics[a].update();this.primitives=[];if(this.split)for(a=0,c=this.graphics.length;a<c;a++){v=
this.graphics[a];for(var b=a+1;b<c;b++)k=this.graphics[b],v.splitFace(k),k.splitFace(v);this.primitives=this.primitives.concat(v.primitives||[])}else for(a=0,c=this.graphics.length;a<c;a++){v=this.graphics[a];if(v.split)for(b=a+1;b<c;b++)k=this.graphics[b],k.split&&v.splitFace(k);this.primitives=this.primitives.concat(v.primitives||[])}}a=0;for(c=this.primitives.length;a<c;a++)this.primitives[a].computeDepth(this);this.primitives=this.primitives.sort(function(a,c){return c.depth-a.depth});if("painter"===
this.render)this.drawPainter(this.primitives);else for(a=0,c=this.primitives.length;a<c;a++)this.primitives[a].draw(this.ctx,this);a=0;for(c=this.graphicsCtr.length;a<c;a++)this.graphicsCtr[a].draw()};Q.prototype.drawPainter=function(a){for(var c=a.length,b=0;b<c;b++)a[b].drawn=!1,a[b].draw(this.ctx,this);for(var d=[],g=[],f=0,e=a.length,h=.001,m,k;;){m=e;for(b=0;b<c;b++)if(!a[b].drawn){k=!0;for(var l=0;l<c;l++)if(l!=b&&!a[l].drawn&&a[b].inFrontOf(d,a[l],h)){k=!1;break}k&&(e--,g[f++]=a[b],a[b].drawn=
!0)}if(0==e)break;else if(e==m){if(h*=10,.1<h){for(b=0;b<c;b++)a[b].drawn||(g[f++]=a[b],a[b].drawn=!0);break}}else h=.001}for(b=0;b<c;b++)g[b].draw(this.ctx,this)};Q.prototype.rayFromEye=function(a,c){return{x:-this.eye.x,y:(a-(this.w_2+this.Ox))/this.scale-this.eye.y,z:(this.h_2+this.Oy-c)/this.scale-this.eye.z}};Q.prototype.addEvents=function(){function c(a){window.focus();document.activeElement.blur();e.click=0;e.evaluator.setVariable(e.id+".mouse_pressed",0);window.removeEventListener("touchmove",
f,!1);window.removeEventListener("touchend",c,!1);a.preventDefault();e.parent.update()}function b(c){document.body.focus();e.click=0;e.evaluator.setVariable(e.id+".mouse_pressed",0);c.preventDefault();"R"===e.whichBtn&&(window.removeEventListener("mousemove",g,!1),e.posZoom==e.posZoomNew&&a.showConfig&&e.parent.externalSpace.show());window.removeEventListener("mousemove",f,!1);window.removeEventListener("mouseup",b,!1);e.parent.update()}function d(c){e.posAnte=a.getCursorPosition(c,e.container);e.mouse_x=
e.getRelativeX(e.posAnte.x);e.mouse_y=e.getRelativeY(e.posAnte.y);e.evaluator.setVariable(e.id+".mouse_x",e.mouse_x);e.evaluator.setVariable(e.id+".mouse_y",e.mouse_y);e.parent.update()}function g(c){c.preventDefault();e.posZoomNew=a.getCursorPosition(c,e.container).y;e.evaluator.setVariable(e.scaleStr,e.tempScale+e.tempScale/45*((e.posZoom-e.posZoomNew)/10));e.posObserverNew=a.getCursorPosition(c,e.container).x;e.evaluator.setVariable(e.obsStr,e.tempObserver-2.5*(e.posObserver-e.posObserverNew));
e.parent.update()}function f(c){if(!e.fixed&&e.click){p=(e.getAbsoluteX(e.oldMouse.x)-e.getAbsoluteX(e.mouse_x))/4;n=(-e.getAbsoluteY(e.oldMouse.y)+e.getAbsoluteY(e.mouse_y))/4;if(p!==e.disp.x||n!==e.disp.y)e.alpha=a.degToRad(e.evaluator.getVariable(e.rotZStr)),e.beta=a.degToRad(-e.evaluator.getVariable(e.rotYStr)),e.alpha=a.radToDeg(e.alpha)-p,e.beta=a.radToDeg(e.beta)-n,e.evaluator.setVariable(e.rotZStr,e.alpha),e.evaluator.setVariable(e.rotYStr,-e.beta),e.disp.x=p,e.disp.y=n,e.oldMouse.x=e.getRelativeX(e.posAnte.x),
e.oldMouse.y=e.getRelativeY(e.posAnte.y);d(c);c.preventDefault()}}var e=this;this.canvas.oncontextmenu=function(){return!1};this.canvas.addEventListener("touchstart",function(b){window.focus();document.activeElement.blur();e.click=1;e.evaluator.setVariable(e.id+".mouse_pressed",1);e.parent.deactivateGraphicControls();e.posAnte=a.getCursorPosition(b,e.container);e.oldMouse.x=e.getRelativeX(e.posAnte.x);e.oldMouse.y=e.getRelativeY(e.posAnte.y);d(b);window.addEventListener("touchmove",f);window.addEventListener("touchend",
c);b.preventDefault()});this.canvas.addEventListener("mousedown",function(c){document.body.focus();e.click=1;e.parent.deactivateGraphicControls();e.whichBtn=a.whichBtn(c);"R"===e.whichBtn?(window.addEventListener("mouseup",b),e.posObserver=a.getCursorPosition(c,e.container).x,e.posObserverNew=e.posObserver,e.posZoom=a.getCursorPosition(c,e.container).y,e.posZoomNew=e.posZoom,e.fixed||(e.tempScale=e.scale,e.tempObserver=e.observer,window.addEventListener("mousemove",g))):"L"==e.whichBtn&&(e.evaluator.setVariable(e.id+
".mouse_pressed",1),e.posAnte=a.getCursorPosition(c,e.container),e.oldMouse.x=e.getRelativeX(e.posAnte.x),e.oldMouse.y=e.getRelativeY(e.posAnte.y),d(c),window.addEventListener("mousemove",f),window.addEventListener("mouseup",b));c.preventDefault()});this.disp={x:0,y:0}};a.Space3D=Q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var e,f,d,r,l,b,h=function(b,d){var g=a.Space.call(this,b,d)||this;e=g.parent.evaluator;void 0!=g._w_&&(b=e.parser.parse(g._w_),g._w_="number"!=b.type?b:void 0);void 0!=g._h_&&(b=e.parser.parse(g._h_),g._h_="number"!=b.type?b:void 0);g.isFirefox=/firefox/i.test(window.navigator.userAgent);g.file=g.file?g.file.trim():"";g.file.match(/^\[/)&&g.file.match(/\]$/)?g.file=e.parser.parse(g.file.substring(1,g.file.length-1)):g.file.match(/^'/)&&g.file.match(/'$/)?
g.file=e.parser.parse(g.file):g.file=e.parser.parse("'"+g.file+"'");g.oldFile=e.eval(g.file);g.MyIFrame=a.newHTML("iframe",{marginheight:0,marginwidth:0,frameborder:0,scrolling:"auto",style:"position:absolute;left:0;top:0;"});0!=g.oldFile&&g.MyIFrame.setAttribute("src",g.oldFile);g.container=a.newHTML("div",{id:g.id,style:(a.isIOS?"overflow:scroll;-webkit-overflow-scrolling:touch;overflow-scrolling:touch;":"")+"position:absolute;width:"+g.w+"px;height:"+g.h+"px;left:"+g.x+"px;top:"+g.y+"px;z-index:"+
g.zIndex+";background-repeat:no-repeat;background-position:center;"});g.container.appendChild(g.MyIFrame);g.imageSrc&&(g.container.style.backgroundImage="url("+g.imageSrc+")");g.parent.container.insertBefore(g.container,g.parent.loader);g.MyIFrame.onload=function(c){var b=this;g.evaluator.setFunction(g.id+".set",function(a,c){b.contentWindow.postMessage({type:"set",name:a,value:c},"*");return 0});g.evaluator.setFunction(g.id+".update",function(){b.contentWindow.postMessage({type:"update"},"*");return 0});
g.evaluator.setFunction(g.id+".exec",function(a,c){b.contentWindow.postMessage({type:"exec",name:a,value:c},"*");return 0});g.evaluator.setFunction(g.id+".changeConf",function(c){if(c){if(a.cacheFiles[c])var d=a.cacheFiles[c];else d=(d=document.getElementById(c))&&"descartes/embed"===d.type?d.textContent:a.openExternalFile(c),d=(d=(new DOMParser).parseFromString(d,"text/html").querySelector("ajs"))?d.innerHTML:"",a.cacheFiles[c]=d;b.contentWindow.postMessage({type:"change_config",filename:c,content:d},
"*")}return 0});g.ImReady=!g.isFirefox;g.isFirefox||(g.container.style.visibility="visible",g.container.style.opacity="1",g.container.style.zIndex=g.zIndex,g.container.style.display=g.drawIfValue?"block":"none");g.MyIFrame.style.visibility="visible";g.container.style.backgroundImage=""};g.update=g.iframeUpdate;g.evaluator.setVariable(g.id+"._scroll",0);return g};$jscomp.inherits(h,a.Space);h.prototype.init=function(){l=this;l.initSpace();l.MyIFrame&&Object.assign(l.MyIFrame.style,{width:l.w+"px",
height:l.h+"px"})};h.prototype.iframeUpdate=function(a){e=this.evaluator;this.drawIfValue=0<e.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);f=this.x!==e.eval(this.xExpr)+this.displaceRegionWest;d=this.y!==e.eval(this.yExpr)+
this.parent.plecaHeight+this.displaceRegionNorth;this.x=f?e.eval(this.xExpr)+this.displaceRegionWest:this.x;this.y=d?e.eval(this.yExpr)+this.parent.plecaHeight+this.displaceRegionNorth:this.y;void 0!=this._w_&&(a=e.eval(this._w_),this.w!==a&&(this.container.style.width=this.MyIFrame.style.width=a+"px",this.w=a));void 0!=this._h_&&(a=e.eval(this._h_),this.h!==a&&(this.container.style.height=this.MyIFrame.style.height=a+"px",this.h=a));if(f||d)this.container.style.left=this.x+"px",this.container.style.top=
this.y+"px";r=e.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=e.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 e=1,f=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;")):(e=d.width<d.height?d.width/1144:d.height/1092,e=2.5<e?2.5:e,this.imgLoader.setAttribute("style","background-image:url("+a.loaderImg.src+");background-position:50% 33.5%;background-size:"+880*e+"px;"),this.progress.setAttribute("style","visibility:visible; left:"+(d.width-726*e)/2+"px; top:"+(33.5*d.height/100+940*e/2)+"px; width:"+726*e+"px; height:"+14*e+"px;"));d.loader.appendChild(this.imgLoader);d.loader.appendChild(this.progress);d.firstRun=!1;this.initPreloader()};
f.prototype.initPreloader=function(){var d=this,e=d.children,f=d.images,b=d.audios,h=/[\w\.\-//]*(\.png|\.jpg|\.gif|\.svg)/gi,m=/[\w\.\-//]*(\.ogg|\.oga|\.mp3|\.wav)/gi;f["lib/DescartesCCLicense.png"]=a.getCCLImg();f["lib/DescartesCCLicense.png"].ready=1;var g,q;var c=0;for(g=e.length;c<g;c++)if("rtf"!==e[c].name){if(e[c].value.match(/'macro'|'makro'/g)){var v="";var k=d.lessonParser.split(e[c].value);var u=0;for(q=k.length;u<q;u++)"expresion"===babel[k[u][0]]&&(v=k[u][1]);if(v)var x=(x=document.getElementById(v))&&
"descartes/macro"==x.type?x.text:a.openExternalFile(v);if(x&&(k=x.match(h)))for(v=0,q=k.length;v<q;v++)u=k[v],u.toLowerCase().match(/vacio.gif$/)||""==u.substring(0,u.length-4)||(f[u]=new Image,f[u].addEventListener("load",function(){this.ready=1}),f[u].addEventListener("error",function(){this.errorload=1}),f[u].src=u)}if(k=e[c].value.match(h))for(v=0,q=k.length;v<q;v++)u=k[v],u.toLowerCase().match(/vacio.gif$/)||""==u.substring(0,u.length-4)||(f[u]=new Image,f[u].addEventListener("load",function(){this.ready=
1}),f[u].addEventListener("error",function(){this.errorload=1}),f[u].src=u);if(k=e[c].value.match(m))for(v=0,u=k.length;v<u;v++)d.initAudio(k[v])}for(var p in f)f.hasOwnProperty(p)&&d.images.length++;for(p in b)b.hasOwnProperty(p)&&d.audios.length++;var n=d.images.length+d.audios.length;0<n&&d.progress.setAttribute("max",n);var B,w=function(){B=0;for(var c in f)f.hasOwnProperty(c)&&(f[c].ready||f[c].errorload)&&B++;for(c in b)b.hasOwnProperty(c)&&(b[c].ready||b[c].errorload)&&B++;d.progress.setAttribute("value",
B);B!=n?d.timer=a.setTimeout(w,1):d.descartesApp.initBuildApp()};w()};f.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=f;return a}(descartesJS||{});
descartesJS=function(a){function e(a){for(var b="[",f=0,c=a.length;f<c;f++)Array.isArray(a[f])?b+=e(a[f]):(d=a[f]||0,"string"==typeof d&&(d="'"+d+"'"),b+=d),f<c-1&&(b+=",");return b+"]"}function f(){r=window.innerWidth/this.width;l=window.innerHeight/this.height;a.cssScale=b=Math.min(r,l);this.container.style.transformOrigin="0 0";r<l?(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,l,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,e=0,c=0,h=a.ccLicense?90:0,k=0,l=b.length;k<l;k++)d=b[k],"rtf_height"==d.name&&(e=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,e&&(this.height=e+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=f,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=[],l=[],r=[],p=[],n=0,B=b.length;n<B;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 w=(this.width-780)/2,y=parseInt(this.height)-this.plecaHeight-this.buttonsConfig.height-45;l.push("space='descartesJS_stage' type='text' abs_coord='yes' expresion='[10,20]' background='yes' text='"+
d.value.replace(/'/g,"&squot;")+"'");l.push("space='descartesJS_stage' type='text' abs_coord='yes' expresion='["+w+","+(y-25)+"]' background='yes' text='"+this.licenseA+"'");a.ccLicense&&l.push("space='descartesJS_stage' type='image' expresion='["+(w+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),l.push(d.value)):/^S_/.test(d.name)?r.push(d.value):"Animation"==babel[d.name]&&p.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(B=c.length;n<B;n++)b=e.parseSpace(c[n]),this.arquimedes&&this.stage.container.appendChild(b.container),this.spaces.push(b),this.zIndex++;n=0;for(B=l.length;n<B;n++)if(a.DEBUG.elemIndex=n,c=e.parseGraphic(l[n]))this.editableRegionVisible=this.editableRegionVisible||c.visible,c.space.addGraph(c);n=0;
for(B=r.length;n<B;n++)(c=e.parse3DGraphic(r[n]))&&c.space.addGraph(c,!0);n=0;for(B=f.length;n<B;n++)this.controls.push(e.parseControl(f[n]));n=0;for(B=h.length;n<B;n++)e.parseAuxiliar(h[n]);n=0;for(B=p.length;n<B;n++)this.animation=e.parseAnimation(p[n]);this.configRegions();this.updateAuxiliaries();this.updateAuxiliaries();n=0;for(B=this.controls.length;n<B;n++)this.controls[n].init();this.updateControls();this.updateSpaces(!0);var A=this;this.nIframes?a.setTimeout(function(){A.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(g){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,l=100,r=100;2==this.version&&(c="14",f=63,h=50,l=44,r=53);var p=0,n=0,B=0,w=0,y=this.northSpace.controls,A=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?(p=d.height,d.rowsNorth=1):p=d.height*d.rowsNorth;var F=this.northSpace.container;F.id="descartesJS_north";F.setAttribute("style","width:"+e.width+"px;height:"+p+"px;left:0;top:"+this.plecaHeight+"px;");e.insertBefore(F,this.loader);F=e.width;var H=0;d.about?(H=f,F-=H):f=0;d.config&&(F-=h);var z=Math.ceil(y.length/d.rowsNorth),I=F/z;var C=0;for(var M=y.length;C<M;C++)y[C].expresion=b.parse("("+(H+C%z*I)+","+d.height*Math.floor(C/z)+","+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+", "+p+")")}),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("("+(F+f)+", 0, "+h+", "+p+")")})).update()}if(0<d.rowsSouth||0<A.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=l,f-=H):l=0;d.clear&&(f-=r);F=this.southSpace.container;F.id="descartesJS_south";F.setAttribute("style","width:"+e.width+"px;height:"+n+"px;left:0;bottom:0;");e.insertBefore(F,this.loader);z=Math.ceil(A.length/d.rowsSouth);I=f/z;C=0;for(M=A.length;C<M;C++)A[C].expresion=b.parse("("+(H+C%z*I)+","+d.height*Math.floor(C/z)+","+I+","+d.height+")"),A[C].drawif=b.parse("1"),A[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, "+l+", "+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+l)+", 0, "+r+", "+n+")")})).update()}if(0<E.length)for(C=e.height-p-n,B=d.widthEast,F=this.eastSpace.container,F.id="descartesJS_east",F.setAttribute("style","width:"+B+"px;height:"+C+"px;right:0;top:"+p+"px;"),e.insertBefore(F,this.loader),C=0,M=E.length;C<M;C++)E[C].expresion=b.parse("(0,"+d.height*
C+","+B+","+d.height+")"),E[C].drawif=b.parse("1"),E[C].init();if(0<J.length)for(C=e.height-p-n,w=d.widthWest,F=this.westSpace.container,F.id="descartesJS_west",F.setAttribute("style","width: "+w+"px;height:"+C+"px;left:0;top:"+p+"px;"),e.insertBefore(F,this.loader),C=0,M=J.length;C<M;C++)J[C].expresion=b.parse("(0,"+d.height*C+","+w+","+d.height+")"),J[C].drawif=b.parse("1"),J[C].init();if(this.editableRegionVisible)for(b=d.height,F=this.editableRegion.container,F.id="descartesJS_editableRegion",
F.setAttribute("style","width:"+e.width+"px;height:"+b+"px;left:0;top:"+(e.height-n-d.height)+"px;"),e.insertBefore(F,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?(F.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;")):(F.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=p;this.displaceRegionSouth=n;this.displaceRegionEast=B;this.displaceRegionWest=w;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 f in c)c.hasOwnProperty(f)&&(a+="\n"+f+"="+e(c[f]));f=this.evaluator.matrices;for(var h in f)f.hasOwnProperty(h)&&(a+="\n"+h+"="+e(f[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(e,f){e="Error: "+e+" en\u300a "+f+" \u300b";var d="";switch(a.DEBUG.objectName){case "Auxiliar":f="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);e+=f+"\u300c"+a.DEBUG.idName+"\u300d, en el param\u00e9tro \u300c"+a.DEBUG.paramName+"\u300d"+d+".";break;case "Graphic":e+="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(e)}};return a}(descartesJS||{});
descartesJS=function(a){function e(){f().forEach(function(b){a.apps.push(new a.DescartesApp(b));b.className="DescartesJS"})}function f(){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 f='<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){f+='<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=f+"</div>";document.body.appendChild(b);a.getFeatures();a.hasCanvas?(window.scrollTo(0,10),d(),e(),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 l=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){l[d.filename]?b=l[d.filename]:(b=a.newHTML("div"),b.innerHTML=d.content,b=b.getElementsByTagName("param"),l[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||{});
