/*
 Joel Espinosa Longi
 jlongi@im.unam.mx
 https://github.com/jlongi/DescartesJS
 LGPL - http://www.gnu.org/licenses/lgpl.html
 2021-03-26
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var k=0;return function(){return k<a.length?{done:!1,value:a[k++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var k="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return k?k.call(a):$jscomp.arrayIterator(a)};$jscomp.arrayFromIterator=function(a){for(var k,e=[];!(k=a.next()).done;)e.push(k.value);return e};
$jscomp.arrayFromIterable=function(a){return a instanceof Array?a:$jscomp.arrayFromIterator($jscomp.makeIterator(a))};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.objectCreate=$jscomp.ASSUME_ES5||"function"==typeof Object.create?Object.create:function(a){var k=function(){};k.prototype=a;return new k};$jscomp.underscoreProtoCanBeSet=function(){var a={a:!0},k={};try{return k.__proto__=a,k.a}catch(e){}return!1};
$jscomp.setPrototypeOf="function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(a,k){a.__proto__=k;if(a.__proto__!==k)throw new TypeError(a+" is not extensible");return a}:null;
$jscomp.inherits=function(a,k){a.prototype=$jscomp.objectCreate(k.prototype);a.prototype.constructor=a;if($jscomp.setPrototypeOf){var e=$jscomp.setPrototypeOf;e(a,k)}else for(e in k)if("prototype"!=e)if(Object.defineProperties){var f=Object.getOwnPropertyDescriptor(k,e);f&&Object.defineProperty(a,e,f)}else a[e]=k[e];a.superClass_=k.prototype};
$jscomp.checkStringArgs=function(a,k,e){if(null==a)throw new TypeError("The 'this' value for String.prototype."+e+" must not be null or undefined");if(k instanceof RegExp)throw new TypeError("First argument to String.prototype."+e+" must not be a regular expression");return a+""};$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,k,e){a!=Array.prototype&&a!=Object.prototype&&(a[k]=e.value)};
$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,k,e,f){if(k){e=$jscomp.global;a=a.split(".");for(f=0;f<a.length-1;f++){var r=a[f];r in e||(e[r]={});e=e[r]}a=a[a.length-1];f=e[a];k=k(f);k!=f&&null!=k&&$jscomp.defineProperty(e,a,{configurable:!0,writable:!0,value:k})}};
$jscomp.polyfill("String.prototype.repeat",function(a){return a?a:function(a){var e=$jscomp.checkStringArgs(this,null,"repeat");if(0>a||1342177279<a)throw new RangeError("Invalid count value");a|=0;for(var f="";a;)if(a&1&&(f+=e),a>>>=1)e+=e;return f}},"es6","es3");$jscomp.owns=function(a,k){return Object.prototype.hasOwnProperty.call(a,k)};
$jscomp.assign="function"==typeof Object.assign?Object.assign:function(a,k){for(var e=1;e<arguments.length;e++){var f=arguments[e];if(f)for(var r in f)$jscomp.owns(f,r)&&(a[r]=f[r])}return a};$jscomp.polyfill("Object.assign",function(a){return a||$jscomp.assign},"es6","es3");
$jscomp.polyfill("Array.prototype.fill",function(a){return a?a:function(a,e,f){var k=this.length||0;0>e&&(e=Math.max(0,k+e));if(null==f||f>k)f=k;f=Number(f);0>f&&(f=Math.max(0,k+f));for(e=Number(e||0);e<f;e++)this[e]=a;return this}},"es6","es3");$jscomp.findInternal=function(a,k,e){a instanceof String&&(a=String(a));for(var f=a.length,r=0;r<f;r++){var n=a[r];if(k.call(e,n,r,a))return{i:r,v:n}}return{i:-1,v:void 0}};
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,e){return $jscomp.findInternal(this,a,e).v}},"es6","es3");$jscomp.polyfill("Array.prototype.flat",function(a){return a?a:function(a){a=void 0===a?1:Number(a);for(var e=[],f=0;f<this.length;f++){var k=this[f];Array.isArray(k)&&0<a?(k=Array.prototype.flat.call(k,a-1),e.push.apply(e,k)):e.push(k)}return e}},"es9","es5");
var babel=function(a){if(a.loadLib)return a;a.loadLib=!0;a.no=a.ez=a.non=a["n\u00e3o"]=a.falso=a["false"]=a.fals=a.gezurra=a.faux=a.fals="false";a["s\u00ed"]=a.yes=a.bai=a.oui=a.si=a.sim=a.verdadero=a["true"]=a.veritable=a.egia=a.vrai=a.verdadeiro=a.veritable="true";a.negro=a.black=a.negre=a.beltza=a.noir=a.preto=a["#000000"]="#000000";a.maxenta=a.magenta=a["#ff00ff"]="#ff00ff";a.azul=a.blue=a.blau=a.urdina=a.bleu=a["#0000ff"]="#0000ff";a.turquesa=a.cyan=a.turkesa=a.turquoise=a["#00ffff"]="#00ffff";
a.verde=a.green=a.verd=a.berdea=a.vert=a["#00ff00"]="#00ff00";a.amarillo=a.yellow=a.groc=a.horia=a.jaune=a.amarelo=a["#ffff00"]="#ffff00";a.naranja=a.orange=a.taronja=a.laranja=a.laranxa=a["#ffc800"]="#ffc800";a.rojo=a.red=a.vermell=a.gorria=a.rouge=a.vermello=a.vermelho=a["#ff0000"]="#ff0000";a.pink=a.rosa=a.arrosa=a.rose=a["#ffafaf"]="#ffafaf";a.grisObscuro=a.darkGray=a.grisFosc=a["gris iluna"]=a.grisObscur=a.grisEscuro=a.cinzaEscuro=a["#404040"]="#404040";a.gris=a.gray=a.grisa=a.cinza=a["#808080"]=
"#808080";a.grisClaro=a.lightGray=a.grisClar=a["gris argia"]=a.grisClair=a.cinzaClaro=a["#c0c0c0"]="#c0c0c0";a.blanco=a.white=a.blanc=a.zuria=a.branco=a["#ffffff"]="#ffffff";a.escala=a.scale=a.eskala=a["\u00e9chelle"]="scale";a.nombre=a.name=a.nom=a.izena=a.nome="name";a.ikusgai=a["vis\u00edvel"]=a.visible="visible";a.rastro=a.trace=a.rastre=a.arrastoa="trace";a.fondo=a.background=a.fons=a.hondoa=a.fond=a.fundo="background";a["par\u00e1metro"]=a.parameter=a.parametroa=a["par\u00e2metro"]=a["par\u00e0metre"]=
"parameter";a["sucesi\u00f3n"]=a.sequence=a["successi\u00f3"]=a.segida=a.succession=a["seq\u00fc\u00eancia"]="sequence";a["tama\u00f1o"]=a.size=a.neurria=a.taille=a.tamanho=a["grand\u00e0ria"]="size";a.decimales=a.decimals=a.hamartarra=a["d\u00e9cimales"]=a.decimais="decimals";a.red=a.net=a.xarxa=a.sarea=a["r\u00e9seau"]=a.rede=a.malha="net";a.red10=a.net10=a.xarxa10=a.sarea10=a["r\u00e9seau10"]=a.rede10=a.malha10="net10";a.ejes=a.axes=a.eixos=a.ardatzak=a.eixes="axes";a["cr\u00e9ditos"]=a.about=
a["cr\u00e8dits"]=a.kreditoak=a["cr\u00e9dits"]=a.sobre="about";a.config=a.konfig=a["configura\u00e7\u00e3o"]="config";a.inicio=a.init=a.inici=a.hasiera=a.commencement=a["in\u00edcio"]="init";a.limpiar=a.clear=a.neteja=a.ezabatu=a.nettoye=a.limpar="clear";a.incr=a.gehi=a.incremento="incr";a.min=a.inf="min";a.max=a.sup=a["m\u00e1x"]="max";a.relleno=a.fill=a.ple=a.betea=a.plein=a.recheo=a.preencher="fill";a["relleno+"]=a["fill+"]=a["ple+"]=a["betea+"]=a["plein+"]=a["recheo+"]=a["preencher+"]=a.fillP=
"fillP";a["relleno-"]=a["fill-"]=a["ple-"]=a["betea-"]=a["plein-"]=a["recheo-"]=a["preencher-"]=a.fillM="fillM";a.flecha=a.arrow=a.fletxa=a.gezia=a["fl\u00e8che"]=a.frecha=a.seta="arrow";a.punta=a.spear=a.muturra=a.pointe=a.ponta="spear";a["regi\u00f3n"]=a.region=a["regi\u00f3"]=a.eskualde=a["r\u00e9gion"]=a["rexi\u00f3n"]=a["regi\u00e3o"]="region";a.norte=a.north=a.nord=a.ipar="north";a.sur=a.south=a.sud=a.hego=a.sul="south";a.este=a.east=a.est=a.ekialde=a.leste="east";a.oeste=a.west=a.oest=a.hegoalde=
a.ouest="west";a.exterior=a.external=a.kanpoalde=a.externo="external";a["expresi\u00f3n"]=a.expresion=a["expresi\u00f3"]=a.adierazpen=a["express\u00e3o"]="expresion";a.tipo=a.type=a.tipus=a.mota="type";a["posici\u00f3n"]=a.position=a["posici\u00f3"]=a.posizio=a["posi\u00e7\u00e3o"]="position";a["constricci\u00f3n"]=a.constraint=a["constricci\u00f3"]=a.beharte=a.constriction=a["constrici\u00f3n"]=a["restri\u00e7\u00e3o"]="constraint";a.valor=a.value=a.balio=a.valeur="value";a["ecuaci\u00f3n"]=a.equation=
a["equaci\u00f3"]=a.ekuazio=a["\u00e9quation"]=a["equa\u00e7\u00e3o"]="equation";a.curva=a.curve=a.corba=a.kurba=a.courbe="curve";a.texto=a.text=a.testu=a.texte=a.testua="text";a.punto=a.point=a.punt=a.puntu=a.ponto=a.dot="point";a.segmento=a.segment=a.zuzenki="segment";a.arco=a.arc=a.arku="arc";a["pol\u00edgono"]=a.polygon=a["pol\u00edgon"]=a.poligono=a.polygone="polygon";a.imagen=a.image=a.imatge=a.irudi=a.imaxe=a.imagem=a.bg_image=a.irudia=a.imagem_de_fundo=a.irundia="image";a["Versi\u00f3n"]=
a.Version=a["Versi\u00f3"]=a["Vers\u00e3o"]=a.version="version";a.Idioma=a.Language=a.Hizkuntza=a.Langue=a.language="language";a["O.x"]="O.x";a["O.y"]="O.y";a.Botones=a.Buttons=a.Botons=a.Botoiak=a.Boutons=a["Bot\u00f3ns"]=a["Bot\u00f5es"]=a.Botons="Buttons";a["Animaci\u00f3n"]=a.Animation=a["Animaci\u00f3"]=a.Animazio=a["Anima\u00e7\u00e3o"]="Animation";a.constante=a.constant=a.Konstante="constant";a.fuente=a.font=a.iturri=a.source=a.fonte="font";a["num\u00e9rico"]=a.numeric=a["num\u00e8ric"]=a.zenbakizko=
a["num\u00e9rique"]="numeric";a["gr\u00e1fico"]=a.graphic=a["gr\u00e0fic"]=a.grafiko=a.graphique="graphic";a.hacer=a["do"]=a.fer=a.egin=a.faire=a.facer=a.fazer=a.doExpr="doExpr";a.mientras=a["while"]=a.mentre=a.bitartean=a["tandis que"]=a.mentres=a.enquanto=a.whileExpr="whileExpr";a.evaluar=a.evaluate=a.avalua=a.ebaluatu=a["\u00e9valuer"]=a.avaliar="evaluate";a.variable=a.aldagaia=a["vari\u00e1vel"]="variable";a["funci\u00f3n"]=a["function"]=a["funci\u00f3"]=a.funtzio=a.fonction=a["fun\u00e7\u00e3o"]=
"function";a.algoritmo=a.algorithm=a.algorisme=a.algorithme="algorithm";a.vector=a.array=a.bektore=a.vecteur=a.matriz="array";a["dibujar-si"]=a["draw-if"]=a["marraztu-baldin"]=a["dessiner-si"]=a["debuxar-se"]=a["desenhar-se"]=a["dibuixa-si"]=a.drawif="drawif";a.dominio=a.range=a.domini=a["izate-eremua"]=a.domain=a["dom\u00ednio"]="range";a.pausa=a.delay=a.eten="delay";a["eje-x"]=a["x-axis"]=a["eix-x"]=a["x-ardatza"]=a["axe-x"]=a["eixe-x"]=a["eixo-x"]=a.x_axis="x_axis";a["eje-y"]=a["y-axis"]=a["eix-y"]=
a["y-ardatza"]=a["axe-y"]=a["eixe-y"]=a["eixo-y"]=a.y_axis="y_axis";a["n\u00fameros"]=a.numbers=a.nombres=a.zenbakiak="numbers";a["exponencial-si"]=a["exponential-if"]=a["esponentzial-baldin"]=a["exponentiel-si"]=a["exponencial-se"]=a.exponentialif="exponentialif";a.familia=a.family=a["fam\u00edlia"]=a.famille="family";a.intervalo=a.interval=a.tarte=a.intervalle="interval";a.pasos=a.steps=a.passos=a.pausoak=a.pas="steps";a.centro=a.center=a.centre=a.zentro="center";a.radio=a.radius=a.radi=a.erradio=
a.rayon=a.raio="radius";a.fin=a.end=a.fi=a.bukaera=a.fim="end";a["una-sola-vez"]=a["only-once"]=a["una-sola-vegada"]=a["behin-bakarrik"]=a["une-seule-fois"]=a["unha-soa-vez"]=a["apenas-uma-vez"]=a.onlyOnce="onlyOnce";a.siempre=a.always=a.sempre=a.beti=a.toujours="always";a["color-int"]=a["int-colour"]=a["barruko-kolore"]=a["couleur-int"]=a["cor-int"]=a.colorInt="colorInt";a.repetir=a.loop=a.repeteix=a.errepikatu=a["r\u00e9p\u00e9ter"]="loop";a.controles=a.controls=a.kontrolak=a["contr\u00f4les"]=
a.controis="controls";a.animar=a.animate=a.anima=a.animatu=a.animer="animate";a.auto="auto";a.y=a.top="y";a.espacio=a.space=a.espai=a.espazio=a.espace=a.espazo=a["espa\u00e7o"]="space";a.Nu="Nu";a.Nv="Nv";a.alto=a.height=a.alt=a.altu=a.haut=a.altura=a["al\u00e7ada"]=a.hauteur=a.alto="height";a.ancho=a.depth=a.amplada=a.zabalera=a.largeur=a.profundidade=a.amplada=a.width=a.ample=a.large=a.largura="width";a.largo=a.length=a.llargada=a.luzera=a.longueur=a.longo=a.comprimento=a.llargada="length";a.color_reverso=
a.backcolor=a.color_revers=a["atzealde kolorea"]=a.couleur_revers=a.cor_reverso=a.cor_de_fundo="backcolor";a.aristas=a.edges=a.arestes=a.ertzak=a["ar\u00eates"]=a.arestas="edges";a.rotini=a.inirot="inirot";a.posini=a.inipos="inipos";a["tri\u00e1ngulo"]=a.triangle=a.hirukia=a["tri\u00e2ngulo"]="triangle";a.cara=a.face=a.aurpegi="face";a.polireg=a.regpoly=a["pol\u00edgonoRegular"]="polireg";a.superficie=a.surface=a["superf\u00edcie"]=a.azalera="surface";a.cubo=a.cube=a.cub=a.kubo="cube";a["paralelep\u00edpedo"]=
a.box=a["paral\u00b7lelep\u00edpede"]=a.paralelepipedo=a["parall\u00e9l\u00e9pip\u00e8de"]="box";a.cono=a.cone=a.con=a.kono=a["c\u00f4ne"]="cone";a.cilindro=a.cylinder=a.cilindre=a.zilindro=a.cylindre="cylinder";a.esfera=a.sphere=a["sph\u00e8re"]="sphere";a.tetraedro=a.tetrahedron=a.tetraedre=a["t\u00e9tra\u00e8dre"]="tetrahedron";a.octaedro=a.octahedron=a.octaedre=a.oktaedro=a["octa\u00e8dre"]="octahedron";a.dodecaedro=a.dodecahedron=a.dodecaedre=a.dodekaedro=a["dod\u00e9ca\u00e8dre"]="dodecahedron";
a.icosaedro=a.icosahedron=a.icosaedre=a.ikosaedro=a["icosa\u00e8dre"]="icosahedron";a.elipsoide=a.ellipsoid=a["el\u00b7lipsoide"]=a["ellipso\u00efde"]=a["elips\u00f3ide"]="ellipsoid";a.macro=a.makro="macro";a.id="id";a.modelo=a.model=a.eredu=a["mod\u00e8le"]="model";a.color=a.kolore=a.couleur=a.cor=a.colour=a.kolorea="color";a.luz=a.light=a.llum=a.argia=a["lumi\u00e8re"]="light";a.metal=a.metall=a["m\u00e9tal"]="metal";a.alambre=a.wire=a.filferro=a.alanbre=a["fil de fer"]=a.arame="wire";a.cortar=
a.split=a.talla=a.moztu=a.couper=a.dividir="split";a.despliegue=a.render=a.desplegament=a.zabaltze=a["d\u00e8ploiement"]=a.despregamento=a.processar="render";a.orden=a.sort=a.ordre=a.ordena=a.orde=a.ordenar="sort";a.pintor=a.painter=a.margolari=a.peintre="painter";a["trazado de rayos"]=a["ray trace"]=a["tra\u00e7at de raigs"]=a["izpi trazadura"]=a["trace de rayons"]=a["trazado de raios"]=a["tra\u00e7ado de raios"]=a.raytrace="raytrace";a.despl_imagen=a.bg_display=a.despl_imatge=a["irudi desplazamendu"]=
a.despl_image=a.despr_imaxe=a["apresenta\u00e7\u00e3o_de_imagem"]="bg_display";a["arr-izq"]=a.topleft=a["dalt-esq"]=a["goi-ezk"]=a["au-dessus-gau"]=a["arr-esq"]=a["acima-esquerda"]="topleft";a["expand."]=a.stretch=a.hedatu=a["expandir "]="stretch";a.mosaico=a.patch=a.mosaic=a.mosaiko=a["mosa\u00efque"]="patch";a.centrada=a.zentratu=a["centr\u00e9e"]=a.centrado=a.imgcenter="imgcenter";a.archivo=a.file=a.fitxer=a.artxibo=a.fichier=a.arquivo="file";a.filas_norte=a.rows_north=a.files_nord=a["HTML kodea"]=
a.files_nord=a.filas_norte=a.linhas_norte=a.files_nord=a.rowsNorth="rowsNorth";a.filas_sur=a.rows_south=a.files_sud=a.ipar_lerro=a.files_sud=a.filas_sur=a.linhas_sul=a.files_sud=a.rowsSouth="rowsSouth";a.ancho_este=a.width_east=a.ample_est=a.hego_lerro=a.ample_est=a.ancho_leste=a.largura_leste=a.ample_est=a.widthEast="widthEast";a.ancho_oeste=a.width_west=a.ample_oest=a.ekialde_zabalera=a.ample_ouest=a.ancho_oeste=a.largura_oeste=a.ample_oest=a.widthWest="widthWest";a.fijo=a.fixed=a.fix=a.hegoalde_zabalera=
a.fixe=a.fixo="fixed";a["Reiniciar Animaci\u00f3n"]=a["Init Animation"]=a["Reinicia Animaci\u00f3"]=a.finko=a["Recommencer l'Animation"]=a["Reiniciar Anima\u00e7\u00e3o"]=a.initAnimation="initAnimation";a["Explicaci\u00f3n"]=a.Explanation=a.Azalpena=a.Explication=a["Explica\u00e7\u00e3o"]=a["Explicaci\u00f3"]="Explanation";a.tooltip=a.dica="tooltip";a.discreto=a.discrete=a.discret=a.diskretu="discrete";a.interfaz=a.gui=a["interf\u00edcie"]=a.interfaze=a["interface"]="gui";a.pulsador=a.spinner=a.polsador=
a.pultsadore=a.bouton="spinner";a["campo de texto"]=a.textfield=a["camp de text"]=a["testu esarrua"]=a["champ de texte"]="textfield";a["men\u00fa"]=a.choice=a.menu=a.escolha="menu";a.barra=a.scrollbar=a.barre="scrollbar";a.opciones=a.options=a.opcions=a.aukerak=a["opci\u00f3ns"]=a["op\u00e7\u00f5es"]="options";a.interior=a.barruko=a["int\u00e9rieur"]="interior";a["condici\u00f3n"]=a.condition=a["condici\u00f3"]=a.baldintza=a["condi\u00e7\u00e3o"]="condition";a["acci\u00f3n"]=a.action=a["acci\u00f3"]=
a.ekintza=a["a\u00e7\u00e3o"]="action";a.evento=a.event=a.esdeveniment=a.gertaera=a["\u00e9v\u00e9nement"]="event";a["abrir URL"]=a["open URL"]=a["obre URL"]=a["URL zabaldu"]=a["ouvrir URL"]=a.openURL="openURL";a["abrir Escena"]=a["open Scene"]=a["obre Escena"]=a["eszena zabaldu"]=a["ouvrir Escena"]=a["abrir Cena"]=a.openScene="openScene";a["bot\u00f3n"]=a.button=a["bot\u00f3"]=a.botoi=a.bouton=a["bot\u00e3o"]="button";a.mensaje=a.message=a.mezua=a.mensaxe=a.mensagem=a.missatge="message";a.alternar=
a.alternate=a.alterna=a.txandakatu=a.alterner="alternate";a["ejecuci\u00f3n"]=a.execution=a["execuci\u00f3"]=a.gauzatze=a["ex\u00e9cution"]=a["execuci\u00f3n"]=a["execu\u00e7\u00e3o"]="execution";a.calcular=a.calculate=a.calcula=a.kalkulatu=a.calculer="calculate";a.coord_abs=a.abs_coord=a.koor_abs="abs_coord";a.negrita=a.bold=a.negreta=a.lodi=a["caract\u00e8re gras"]=a.negra=a.negrito="bold";a.cursiva=a.italics=a.etzana=a.italique=a["it\u00e1lico"]="italics";a.subrayada=a.underlined=a.subratllat=
a.azpimarratua=a.soulignement=a["subli\u00f1ada"]=a.sublinhado="underlined";a.pos_mensajes=a.msg_pos=a.pos_missatges=a.mezuen_pos=a.pos_messages=a.pos_mensaxes="msg_pos";a.izquierda=a.left=a.esquerra=a.eskerrean=a.gauche=a.esquerda=a.esquerda=a.esquerra=a.x="x";a.derecha=a.right=a.dreta=a.eskuinan=a.droite=a.dereita=a.direita=a.dreta="right";a["sensible_a_los_movimientos_del_rat\u00f3n"]=a.sensitive_to_mouse_movements=a["sensible_als_moviments_del_ratol\u00ed"]=a["xagu mugimenduarekiko sentikorra"]=
a.sensible_aux_mouvements_du_souris=a.sensible_aos_movementos_do_rato=a["sens\u00edvel_aos_movimentos_do_mouse"]="sensitive_to_mouse_movements";a.reproducir=a.play=a.reprodueix=a.erreproduzitu=a.reproduire=a.reproduzir=a.playAudio="playAudio";a["activo-si"]=a["active-if"]=a["actiu-si"]=a["altiboa-baldin"]=a["actif-si"]=a["activo-se"]=a["ativo-se"]=a.activeif="activeif";a.rotfin=a.finrot=a.bukrot=a.endrot="endrot";a.posfin=a.finpos=a.bukpos=a.endpos="endpos";a.editable=a.editagarria=a["edit\u00e1vel"]=
"editable";a.R2="2D";a.R3="3D";a.vectores=a.bektoreak=a.vecteurs=a.vetores=a.vectors="vectors";a["fuente puntos"]=a["font size"]=a["font punts"]=a["puntu iturria"]=a["source points"]=a["fonte puntos"]=a["fonte pontos"]=a.font_size="font_size";a.escenario=a.scenario=a.escenari=a.agertoki=a["sc\u00e8ne"]=a["cen\u00e1rio"]="scenario";a.cID="cID";a.matriz=a.matrix=a.matriu=a.matrice="matrix";a.filas=a.rows=a.files="rows";a.columnas=a.columns=a.colonnes="columns";a.solo_texto=a.only_text=a.seulement_texte=
a["s\u00f3_texto"]=a.tan_sols_texte=a.onlyText="onlyText";a.respuesta=a.answer="answer";a.peso=a.weight=a.pes="weight";a.decimal_symbol=a["signo decimal"]=a["decimal symbol"]="decimal_symbol";a.info="info";a.library="library";a.color_contorn_text=a.color_text_border=a.color_borde_texto=a.muga_testuaren_kolorea=a.couleur_contour_texte=a.cor_borde_texto=a.colore_bordo_testo=a.cor_borda_texto=a.color_contorn_text=a.border="border";a.video=a["vid\u00e9o"]="video";a.audio=a["\u00e0udio"]="audio";a.autoplay=
"autoplay";a.poster="poster";a.opacidad=a.opacity=a["opacit\u00e9"]=a.opacitat=a.opacidade="opacity";a.alinear=a.align=a["ali\u00f1ar"]=a.aligner="align";a.anchor="anchor";a.a_left="left";a.a_center="center";a.a_right="right";a.a_justify="justify";a.a_top_left="top_left";a.a_top_center="top_center";a.a_top_right="top_right";a.a_center_left="center_left";a.a_center_center="center_center";a.a_center_right="center_right";a.a_bottom_left="bottom_left";a.a_bottom_center="bottom_center";a.a_bottom_right=
"bottom_right";a.malla=a.mesh="mesh";a.local=a.Local="local";a.rectangle=a["rect\u00e1ngulo"]="rectangle";a.lineDash="lineDash";a.solid="solid";a.dot="dot";a.dash="dash";a.dash_dot="dash_dot";a.offset_dist="offset_dist";a.offset_angle="offset_angle";a.flat="flat";a.borderColor="borderColor";a.text_align="text_align";a.image_align="image_align";a.checkbox="checkbox";a.torus=a.toro="torus";a.R="R";a.r="r";a.border_radius="border_radius";a.radio_group="radio_group";a.font_family="font_family";a.resizable=
"resizable";a.antialias="antialias";a.image_loader="image_loader";a.expand="expand";a.cover=a.cubrir="expand";a.fit=a.escalar="fit";a.code="code";a.doc="doc";a.image_dec="image_dec";a.image_inc="image_inc";a.btn_pos="btn_pos";a.border_width="border_width";a.border_color="border_color";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.shadowColor="shadowColor";a.shadowBlur="shadowBlur";
a.shadowOffsetX="shadowOffsetX";a.shadowOffsetY="shadowOffsetY";a.border_size="border_size";a.clip="clip";a.extra_style="extra_style";return a}(babel||Object.create(null)),descartesJS=function(a){if(a.loadLib)return a;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.mathBFont=function(){return"data:font/woff2;charset=utf-8;base64, "};
a.mathRFont=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_math';src:url('"+a.mathBFont()+"') format('woff2');font-style:normal;font-weight:bold;}\n@font-face{font-family:'DJS_math';src:url('"+
a.mathBFont()+"') format('woff2');font-style:italic;font-weight:bold;}\n@font-face{font-family:'DJS_math';src:url('"+a.mathRFont()+"') format('woff2');font-style:italic;font-weight:normal;}\n@font-face{font-family:'DJS_math';src:url('"+a.mathRFont()+"') format('woff2');font-style:normal;font-weight:normal;}\n"};return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;a.symbolFont=function(){return"data:font/woff2;charset=utf-8;base64, "};a.addSymbolFont=
function(){return"@font-face{font-family:'DJS_symbol';src:url('"+a.symbolFont()+"') format('woff2');font-style:normal;font-weight:bold;}\n@font-face{font-family:'DJS_symbol';src:url('"+a.symbolFont()+"') format('woff2');font-style:italic;font-weight:bold;}\n@font-face{font-family:'DJS_symbol';src:url('"+a.symbolFont()+"') format('woff2');font-style:italic;font-weight:normal;}\n@font-face{font-family:'DJS_symbol';src:url('"+a.symbolFont()+"') format('woff2');font-style:normal;font-weight:normal;}\n"};
return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r={bold:"Bold",italic:"Italic",italics:"Italic","bold+italic":"Italic Bold"};a.serif_font="descartesJS_serif,DJS_symbol,DJS_serif,Times,'Times New Roman','Liberation Serif','Nimbus Roman No9 L Regular',serif";a.sansserif_font="descartesJS_sansserif,DJS_symbol,DJS_sansserif,Helvetica,Arial,'Liberation Sans','Nimbus Sans L',sans-serif";a.monospace_font="descartesJS_monospace,DJS_symbol,DJS_monospace,'Courier New',Courier,'Liberation Mono','Nimbus Mono L',monospace";a.math_font=
"descartesJS_math,DJS_symbol,DJS_math,DJS_serif,Times,'Times New Roman','Liberation Serif','Nimbus Roman No9 L Regular',serif";a.convertFont=function(f){if(""==f)return"";k=f.split(",");e="";e+=a.getFontStyle(k[1])+" ";e+=k[2]+"px ";return e+=a.getFontName(k[0].split(" ")[0])};a.getFontName=function(e){e=e.toLowerCase();f=a.monospace_font;if("serif"===e||"times new roman"===e||"timesroman"===e||"times"===e)f=a.serif_font;else if("sansserif"===e||"arial"===e||"helvetica"===e)f=a.sansserif_font;return f};
a.getFontStyle=function(a){return r[a.toLowerCase()]||""};a.getTextWidth=function(e,c){a.ctx.font=c;return Math.round(a.ctx.measureText(e).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 k(){var a,b,d,c,g,l,h;Number.prototype.oToFixed=Number.prototype.toFixed;Number.prototype.toFixed=function(q){q=q||0;q=0>q?0:parseInt(q);a=this.toString();-1!==a.indexOf("e")&&(c=a.split("e"),l="-"===c[0][0]?"-":"",g="-"===l?parseFloat(c[0].substring(1)).oToFixed(11):parseFloat(c[0]).oToFixed(11),h=parseInt(c[1]),b=g.indexOf("."),g=g.replace(".",""),0>b+h?(b=0>b?1:b,a=l+"0."+"0".repeat(Math.abs(b+h))+g):a=l+g+"0".repeat(h-g.length+1));b=a.indexOf(".");-1===b?0<q&&
(a+="."+"0".repeat(q)):(d=a.length-b-1,a=d>=q?11>=q?parseFloat(a).oToFixed(q):a.substring(0,b+q+1):a+"0".repeat(q-d));return a}}if(a.loadLib)return a;var e=2*Math.PI,f=360/e,r=e/360,n=Math.floor,c,h,p,b;a.rangeOK=1;a.cssScale=1;a.radToDeg=function(a){return a*f};a.degToRad=function(a){return a*r};a.drawLine=function(a,d,c,g,h,l,e){a.lineWidth=e||1;a.strokeStyle=l||"black";b=a.lineWidth%2*.5;a.beginPath();a.moveTo(n(d)+b,n(c)+b);a.lineTo(n(g)+b,n(h)+b);a.stroke()};a.getColor=function(a,b){if("string"===
typeof b)return b;c=a.eval(b);return"rgba("+n(255*c[0][0])+","+n(255*c[0][1])+","+n(255*c[0][2])+","+(1-c[0][3])+")"};a.getFeatures=function(){var b=navigator.appVersion.toLowerCase();a.hasTouchSupport=window.hasOwnProperty&&window.hasOwnProperty("ontouchstart")||"ontouchstart"in window||/android/i.test(b);a.isIOS=/iPad|iPhone/i.test(navigator.userAgent);a.isMsEdge=/Edge/i.test(navigator.userAgent);b=a.newHTML("canvas");a.hasCanvas=b.getContext&&b.getContext("2d");a.hasCanvas&&(b.width=b.height=1,
a.ctx=a.hasCanvas,a._ratio=2);k()};var g,d;a.removeNeedlessDecimals=function(a){if("string"==typeof a&&(g=a.indexOf("."),-1!==g)){d=a.substring(g);if(0==parseFloat(d))return a.substring(0,g);for(var b=d.length-1;0<b;b--)if("0"!==d.charAt(b))return a.substring(0,g+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,b,d){a=void 0===a?0:a;b=void 0===
b?100:b;d="linear-gradient("+(void 0===d?0:d)+"deg,";for(var c=2*a,g=a;g<b;g++)a=n(100-g-35),d+="rgba(0,0,0,"+a*a*192/1E4/255+") "+(2*g-c)+"%, ";return d+"rgba(0,0,0,0.1) 100%)"};a.getCursorPosition=function(b,d){h=b.touches?b.touches[0]:b;p=d.getBoundingClientRect();return h?{x:(h.pageX-window.pageXOffset-p.left)/a.cssScale,y:(h.pageY-window.pageYOffset-p.top)/a.cssScale}:null};a.splitSeparator=function(a){a=a.replace(/\\n/g,"\n");for(var b=!1,d,c=[],g=0,l=0,h=a.length;l<h;l++)d=a.charAt(l),"'"===
d&&(b=!b),b||";"!==d&&"\n"!==d||(c.push(a.substring(g,l).replace(/\n/g,"\\n")),g=l+1);c.push(a.substring(g).replace(/\n/g,"\\n"));return c};a.preventDefault=function(a){a.preventDefault();return!1};a.convertHTMLEntities=function(b){var d=a.newHTML("textarea");d.innerHTML=b;return d.value};a.newHTML=function(a,b){a=document.createElement(a);for(var d in b)a.setAttribute(d,b[d]);return a};window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||
window.msRequestAnimationFrame;window.cancelAnimationFrame=window.cancelAnimationFrame||window.mozCancelAnimationFrame;a.setInterval=function(a,b){function d(){Date.now()-c>=b&&(a.call(),c=Date.now());g.value=requestAnimationFrame(d)}if(!requestAnimationFrame)return setInterval(a,b);var c=Date.now(),g={};g.value=requestAnimationFrame(d);return g};a.clearInterval=function(a){a&&(cancelAnimationFrame?cancelAnimationFrame(a.value):clearInterval(a))};a.setTimeout=function(a,b){function d(){Date.now()-
c>=b?a.call():g.value=requestAnimationFrame(d)}if(!requestAnimationFrame)return setTimeout(a,b);var c=Date.now(),g={};g.value=requestAnimationFrame(d);return g};a.clearTimeout=function(a){a&&(cancelAnimationFrame?cancelAnimationFrame(a.value):clearTimeout(a))};a.showAbout=function(){var b="<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&&(b+="<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>");b+="</body> </html>";var d=window.open("","creditos","width=700,height=500,titlebar=0,toolbar=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0");
d.document.write(b);d.document.close()};return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;a.cacheFiles=Object.create(null);a.openExternalFile=function(k){if(a.cacheFiles[k])return a.cacheFiles[k];var e=null,f=new XMLHttpRequest;f.open("GET",k,!1);try{f.send(null),e=200===f.status||304===f.status?f.responseText:f.responseText||"",e=404===f.status?"":e,e.match(String.fromCharCode(65533))&&(f.open("GET",k,!1),f.overrideMimeType("text/plain;charset=ISO-8859-1"),f.send(null),e=f.responseText)}catch(r){e=null}return e};a.addExternalFileContent=function(k,
e){a.cacheFiles[k]=e};return a}(descartesJS||{});
descartesJS=function(a){function k(a){y=a.indexOf("--radial--");-1!=y&&(a=a.substring(0,y));n=a.trim();a={ignoreAccents:!1,ignoreCaps:!1,regExp:null};n[0]==n[n.length-1]&&"'"==n[0]&&(a.ignoreCaps=!0,n=n.substring(1,n.length-1),"`"==n[0]&&"\u00b4"==n[n.length-1]&&(a.ignoreAccents=!0,n=n.substring(1,n.length-1)));"`"==n[0]&&"\u00b4"==n[n.length-1]&&(a.ignoreAccents=!0,n=n.substring(1,n.length-1),n[0]==n[n.length-1]&&"'"==n[0]&&(a.ignoreCaps=!0,n=n.substring(1,n.length-1)));"*"===n.charAt(0)&&"*"!==
n.charAt(n.length-1)?n=n.substring(1)+"$":"*"!==n.charAt(0)&&"*"===n.charAt(n.length-1)?n="^"+n.substring(0,n.length-1):"*"!==n.charAt(0)&&"*"!==n.charAt(n.length-1)?n="^"+n+"$":"*"===n.charAt(0)&&"*"===n.charAt(n.length-1)&&(n=n.substring(1,n.length-1));a.regExp=n.replace(/\?/g,"[\\S\\s]{1}");return a}function e(a,b){n=(a||"").trim();a={ignoreAccents:!1,ignoreCaps:!1,regExp:null};a.expr=n.split(",");a.expr[0]=a.expr[0].trim();a.expr[0]={type:a.expr[0].charAt(0),expr:b.parser.parse(a.expr[0].substring(1))};
a.expr[1]=a.expr[1].trim();a.expr[1]={type:a.expr[1].charAt(a.expr[1].length-1),expr:b.parser.parse(a.expr[1].substring(0,a.expr[1].length-1))};return a}function f(a,l,c){l=parseFloat(l);b=a.expr[0];g=a.expr[1];d=c.eval(b.expr);v=c.eval(g.expr);q="("==b.type||"["==b.type;u=")"==g.type||"]"==g.type;return q&&l>d&&u&&l<=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 n,c,h,p,b,g,d,v,q,u,y;a.buildRegularExpressionsPatterns=function(a,b){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 d=0,l=a.length;d<l;d++){c=a[d].split("&");h=[];for(var g=0,q=c.length;g<q;g++)n=c[g],-1===n.indexOf(",")||"("!==
n.charAt(0)&&"["!==n.charAt(0)||")"!==n.charAt(n.length-1)&&"]"!==n.charAt(n.length-1)?h.push(k(n)):h.push(e(n,b));a[d]=h}return a};a.escorrecto=function(b,d,g,h){g=g||a.externalEvaluator;h=h||a.buildRegularExpressionsPatterns(b,g);d=r(d);b=0;for(var l=h.length;b<l;b++){c=h[b];p=!0;for(var q=0,e=c.length;q<e;q++)p=c[q].regExp?p&&!!d.match(new RegExp(r(c[q].regExp),"i")):p&&f(c[q],d,g);if(p)return 1}return 0};a.esCorrecto=function(b,d,g,h){g=g||a.externalEvaluator;h=h||a.buildRegularExpressionsPatterns(b,
g);b=0;for(var l=h.length;b<l;b++){c=h[b];p=!0;for(var q=0,e=c.length;q<e;q++)(n=c[q].regExp)?(c[q].ignoreAccents&&(d=r(d),n=r(n)),c[q].ignoreCaps&&(d=d.toLowerCase(),n=r(n).toLowerCase()),p=p&&!!d.match(n)):p=p=p&&f(c[q],d,g);if(p)return 1}return 0};return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;a.loaderImg=new Image;a.loaderImg.src="data:image/svg+xml;base64,"+btoa("<svg xmlns='http://www.w3.org/2000/svg' width='880' height='840' viewBox='0 0 880 840'><path d='M440 80c-132.5 0-240 107.5-240 240s107.5 240 240 240 240-107.5 240-240S572.5 80 440 80zm-11.1 462.2c-122.7 0-224.4-99.5-224.4-222.2S306.2 97.8 428.9 97.8 651.1 197.3 651.1 320s-99.5 222.2-222.2 222.2zm-11.1-426.6c-112.9 0-208.9 91.5-208.9 204.4s96 204.4 208.9 204.4S622.2 432.9 622.2 320s-91.5-204.4-204.4-204.4zm-11.1 391.1c-103.1 0-193.3-83.6-193.3-186.7s90.2-186.7 193.3-186.7S593.3 216.9 593.3 320s-83.5 186.7-186.6 186.7zm-11.1-355.6c-93.3 0-177.8 75.6-177.8 168.9s84.5 168.9 177.8 168.9S564.4 413.3 564.4 320c0-93.3-75.6-168.9-168.8-168.9zm-11.2 320c-83.5 0-162.2-67.7-162.2-151.1S301 168.9 384.4 168.9 535.6 236.5 535.6 320s-67.7 151.1-151.2 151.1zm-11.1-284.4c-73.6 0-146.7 59.7-146.7 133.3s73 133.3 146.7 133.3S506.7 393.6 506.7 320 447 186.7 373.3 186.7zm-11.1 248.9c-63.8 0-131.1-51.7-131.1-115.6s67.3-115.6 131.1-115.6S477.8 256.2 477.8 320 426 435.6 362.2 435.6zm-11.1-213.4c-54 0-115.6 43.8-115.6 97.8s61.6 97.8 115.6 97.8c54 0 97.8-43.8 97.8-97.8s-43.8-97.8-97.8-97.8zM340 400c-44.2 0-100-35.8-100-80s55.8-80 100-80 80 35.8 80 80-35.8 80-80 80z' fill='#2daae4'/><path d='M115.8 600.7c32.5 0 48.8 24.8 48.8 49.7 0 24.9-16.2 49.6-48.8 49.6H80.2v-99.3zm0 85c23 0 34.6-17.6 34.6-35.2s-11.6-35.4-34.6-35.4H94.5v70.6zm118.2 0V700h-60.6v-99.3h60.5V615h-46v28h45v14.5h-45l-.05 28.2zm42.2.9c10.6 0 22.3-6 22.3-16.2 0-1-.1-2.1-.4-3.4-1.7-7.5-11.9-8.8-21.9-9.8-15.5-1.6-33.7-5-35.2-25.65-.6-6.65 1.1-13.25 5.4-18.85 6.7-8.7 18.6-13.2 30.1-13.2 15.3 0 31.2 8 33.8 26.1l-14.3.7c-2-8.9-11.6-12.8-20.3-12.6-6.7.1-14.1 2.4-18 7.5-2 2.6-2.7 5.8-2.4 9.2.7 10.2 11.9 11.5 22.6 12.5 13.6 1.7 30.5 5.3 34.4 21.2.4 2.1.7 4.5.7 6.5 0 19.2-19 30.2-36.9 30.2-15.3 0-33.9-9.1-35.8-26.8l-.1-2.7 14.5-.3.1 1.8c1 8.9 12.2 13.8 21.4 13.8zm58-71.7c8.7-8.9 20.9-14.8 34.4-14.8 22.7 0 40.6 14.2 46.3 36.6h-14.2c-5.3-14.9-17.5-22.4-32.1-22.4-9.5 0-18.2 4.1-24.4 10.7-6.2 6.5-10.2 15.3-10.2 25.6 0 9.9 4 18.7 10.2 25.3 6.2 6.6 14.9 10.6 24.4 10.6 15.1 0 27.8-8.7 32.9-23.7h14.1c-5.7 22.6-23.9 37.9-47 37.9-13.5 0-25.7-5.7-34.4-14.8-8.5-9.1-14.2-21.6-14.2-35.4 0-14 5.7-26.5 14.2-35.6zm144.6 55.8h-35.6c-3.8 9.1-8.8 21-11.9 29.3h-15.5l39.9-100.7h10.5L506 700h-15.3zm-30.3-13.4h24.7L461 622.2zm96.9-7.7c12.1 0 18-8.7 18-17.3 0-8.5-6-17.2-18-17.2h-22V700h-14.2v-99.4h36.2c21.6 0 32.4 15.9 32.4 31.7 0 14.1-8.7 27.4-25.7 30.4l31.4 37.3h-18.6l-36.2-43.6-.05-6.8zm64.9 50.8v-85.3h-30.1v-14.5h74.4v14.5h-30v85.3zm112.2-14.7V700H662v-99.3h60.5V615h-46v28h45v14.5h-45l-.05 28.2zm42.3.9c10.6 0 22.3-6 22.3-16.2 0-1-.1-2.1-.4-3.4-1.7-7.5-11.9-8.8-21.9-9.8-15.5-1.6-33.7-5-35.2-25.65-.6-6.65 1.1-13.25 5.4-18.85 6.7-8.7 18.6-13.2 30.1-13.2 15.3 0 31.2 8 33.8 26.1l-14.3.7c-2-8.9-11.6-12.8-20.3-12.6-6.7.1-14.1 2.4-18 7.5-2 2.6-2.7 5.8-2.4 9.2.7 10.2 11.9 11.5 22.6 12.5 13.6 1.7 30.5 5.3 34.4 21.2.4 2.1.7 4.5.7 6.5 0 19.2-19 30.2-36.9 30.2-15.3 0-33.9-9.1-35.8-26.8l-.1-2.7 14.5-.3.1 1.8c1 8.9 12.2 13.8 21.4 13.8z' fill='#868686'/></svg>");a.getCCLImg=
function(){var a=new Image;a.src="data:image/svg+xml;base64,"+btoa("<svg xmlns='http://www.w3.org/2000/svg' width='88' height='31' viewBox='0 0 120 42'><path fill='#aab2ab' stroke='#000' d='M.5.5h119v41H.5z'/><path d='M0 29.5h120V42H0z'/><circle cx='21' cy='19.5' r='18.25' fill='#aab2ab'/><path d='M49.935 33.105c.364.298.585.806.585 1.284 0 .403-.07.592-.228.833-.158.242-.377.405-.674.547.41.118.715.323.917.617.202.294.303.649.303 1.063 0 .68-.302 1.117-.721 1.465-.432.359-1.067.455-1.622.455H45.28v-6.622h3.122c.579 0 1.127.025 1.533.358zM48.8 35.24c.175-.141.307-.323.307-.6 0-.331-.126-.473-.307-.612-.188-.145-.351-.147-.697-.147H46.74v1.545h1.363c.26 0 .51-.035.697-.186zm-.5 2.996c.288 0 .553-.018.753-.181a.885.885 0 0 0 .325-.691c0-.34-.095-.552-.288-.727-.196-.177-.446-.218-.762-.218h-1.59v1.817zm2.795-5.489h1.633l1.55 2.616 1.543-2.616h1.623l-2.459 4.08v2.542h-1.46v-2.578zm21.34 6.622H71.07v-6.622h1.448l2.774 4.443.008-4.443h1.367v6.622H75.21l-2.765-4.433zm8.48-5.558c-1.07 0-1.893.887-1.893 2.224 0 1.336.91 2.263 1.893 2.263.823 0 1.503-.646 1.503-1.485h1.41c0 1.63-1.022 2.704-2.913 2.704-1.89 0-3.259-1.07-3.259-3.434 0-2.363 1.407-3.499 3.26-3.499 1.853 0 2.857.96 2.857 2.386h-1.41c0-.774-.755-1.159-1.448-1.159zm17.845 4.297c.27.228.68.283 1.023.283.485 0 .93-.072 1.157-.413.157-.235.118-.615-.043-.848-.223-.323-.713-.38-1.078-.474-.498-.129-.996-.18-1.437-.412-.411-.215-.835-.486-1.078-.881-.139-.225-.172-.506-.172-.775 0-.703.348-1.153.788-1.513.453-.371 1.11-.442 1.687-.49.698-.057 1.352.088 1.843.491.472.387.697 1.03.807 1.644h-1.414c.047-.386-.17-.615-.406-.798-.241-.188-.589-.207-.895-.204-.23.002-.486.028-.669.167-.177.135-.328.36-.328.584 0 .238.161.48.352.622.444.333 1.09.218 1.621.38.398.122.854.17 1.167.445.422.371.797.972.797 1.485 0 .672-.279 1.154-.701 1.517-.54.466-1.37.532-2.055.599-.756.021-1.449-.117-1.97-.558-.505-.427-.849-1.13-.849-1.792h1.413c0 .476.176.717.44.941zm7.886-5.361l2.477 6.622h-1.512l-.501-1.475h-2.477l-.52 1.475h-1.465l2.504-6.622zm-1.632 4.06h1.716l-.845-2.427z' fill='#fff'/><g stroke-width='2' fill='#fff' stroke='#000'><circle r='14.25' cy='19.5' cx='21' stroke-width='2.8'/><circle r='10.55' cx='52' cy='15'/><circle r='10.55' cy='15' cx='78'/><circle r='10.55' cx='104' cy='14.981'/></g><circle r='1.625' cy='9' cx='52'/><path d='M18.75 17.979c-.39-.852-.974-1.278-1.755-1.278-1.378 0-2.067.928-2.067 2.784 0 1.856.69 2.783 2.067 2.783.91 0 1.56-.452 1.951-1.357l1.91 1.017c-.91 1.618-2.277 2.428-4.098 2.428-1.406 0-2.531-.43-3.377-1.292-.846-.862-1.27-2.05-1.27-3.564 0-1.487.438-2.668 1.31-3.543.87-.875 1.958-1.312 3.259-1.312 1.926 0 3.304.759 4.14 2.275zm8.99 0c-.39-.852-.964-1.278-1.72-1.278-1.405 0-2.109.928-2.109 2.784 0 1.856.704 2.783 2.11 2.783.912 0 1.55-.452 1.915-1.357l1.953 1.017c-.91 1.618-2.274 2.428-4.092 2.428-1.404 0-2.526-.43-3.372-1.292-.843-.862-1.266-2.05-1.266-3.564 0-1.487.429-2.668 1.287-3.543.857-.875 1.947-1.312 3.273-1.312 1.923 0 3.3.759 4.13 2.275l-2.108 1.059zm27.381-5.862a.75.75 0 0 0-.75-.75h-4.743a.75.75 0 0 0-.749.75v4.742h1.324v5.617h3.594v-5.617h1.324zm13.779-.352l10.343 4.66a.867.867 0 0 1 .312.696c0 .887-.754 1.154-1.435 1.154-1.05 0-1.818-.324-2.588-1.048l-1.598 1.609c.962.84 2.22 1.374 3.52 1.389v1.789h1.332v-1.79c1.584-.115 2.895-1.108 3.191-2.58l4.471 2.048.852-2.129-10.391-4.682a.467.467 0 0 1-.106-.295c0-.723.814-.9 1.39-.9.71 0 1.42.281 1.983.68L81.7 10.8a5.005 5.005 0 0 0-2.914-1.065V7.95h-1.332v1.787c-1.417.083-2.587.83-2.987 2.059l-4.533-2.073zm29.88 1.58c.461-2.918 2.515-4.478 5.09-4.478 3.7 0 5.957 2.686 5.957 6.268 0 3.495-2.4 6.21-6.016 6.21-2.487 0-4.714-1.53-5.12-4.535h2.922c.087 1.56 1.1 2.109 2.546 2.109 1.648 0 2.718-1.53 2.718-3.87 0-2.456-.925-3.755-2.661-3.755-1.272 0-2.371.462-2.603 2.05l.85-.005-2.3 2.3-2.299-2.3.915.006z'/></svg>");
return a};a.getSvgArrowUp=function(a,e){return"data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path transform="rotate('+(a?90:0)+',12,12)" fill="#'+(void 0===e?"24c":e)+'" d="m19.5 17.5-7.5-12-7.5 12z"/></svg>')};a.getSvgArrowDown=function(a,e){return"data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path transform="rotate('+(a?90:0)+',12,12)" d="m19.5 5-7.5 12-7.5-12z" fill="#'+
(void 0===e?"d00018":e)+'"/></svg>')};a.getSvgMenu=function(){return"data:image/svg+xml;base64,"+btoa("<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path d='M6.64 8L12 12.962 17.36 8 19 9.519 12 16 5 9.519z'/></svg>")};a.getSvgCheckbox=function(){return"data:image/svg+xml;base64,"+btoa("<svg xmlns='http://www.w3.org/2000/svg' width='45' height='45' viewBox='0 0 45 45'><path d='M37.095 6.284L15.473 27.905l-7.568-7.567L2.5 25.743l12.973 12.973L42.5 11.69z' fill='#1e272e'/></svg>")};
a.getSvgRadio=function(){return"data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" width="45" height="45" viewBox="0 0 45 45"><circle cx="22.5" cy="22.5" r="15" fill="#1e272e"/></svg>')};return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.floor,e,f,r,n,c,h,p,b,g,d,v,q,u,y,m=function(b,d){this.r=this.g=this.b=0;this.a=1;this.evaluator=d;this.getColor=this.getColorStr;if(b){if(babel[b]&&("net"===babel[b]&&(b="rojo"),b=babel[b],this.r=a.toHex(b.substring(1,3)),this.g=a.toHex(b.substring(3,5)),this.b=a.toHex(b.substring(5,7)),this.colorStr=b),6===b.length&&(this.r=a.toHex(b.substring(0,2)),this.g=a.toHex(b.substring(2,4)),this.b=a.toHex(b.substring(4,6)),this.colorStr="#"+b),8===
b.length&&(this.r=a.toHex(b.substring(2,4)),this.g=a.toHex(b.substring(4,6)),this.b=a.toHex(b.substring(6,8)),this.a=1-a.toHex(b.substring(0,2))/255,this.colorStr="rgba("+this.r+","+this.g+","+this.b+","+this.a+")"),"("===b[0]){f=[];r=this.splitComa(b.substring(1,b.length-1));b=0;for(d=r.length;b<d;b++)h=r[b],n=parseInt(h,16),h!==n.toString(16)&&h!=="0"+n.toString(16)?("["===h.charAt(0)&&"]"===h.charAt(h.length-1)&&(h=h.substring(1,h.length-1)),f.push(this.evaluator.parser.parse(h))):f.push(this.evaluator.parser.parse((n/
255).toString()));this.rExpr=f[0];this.gExpr=f[1];this.bExpr=f[2];this.aExpr=f[3];this.getColor=this.getColorExp}}else this.colorStr="rgba("+this.r+","+this.g+","+this.b+","+this.a+")"};m.prototype.splitComa=function(a){c=[];for(var l=g=b=p=0,h=a.length;l<h;l++)d=a.charAt(l),"("===d?p++:")"===d?p--:"["===d?b++:"]"===d?b--:","===d&&0===p&&0===b&&(c.push(a.substring(g,l)),g=l+1);c.push(a.substring(g));return c};m.prototype.getColorStr=function(){return this.colorStr};m.prototype.getColorExp=function(){e=
this.evaluator;this.r=k(255*e.eval(this.rExpr));this.g=k(255*e.eval(this.gExpr));this.b=k(255*e.eval(this.bExpr));this.a=1-e.eval(this.aExpr);return"rgba("+this.r+","+this.g+","+this.b+","+this.a+")"};m.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);q=parseInt(a[1]).toString(16);u=parseInt(a[2]).toString(16);y=(255-
parseInt(255*parseFloat(a[3]))).toString(16);1===v.length&&(v="0"+v);1===q.length&&(q="0"+q);1===u.length&&(u="0"+u);1===y.length&&(y="0"+y);return new m(y+v+q+u)};a.Color=m;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=document.head,e=a.newHTML("meta",{"http-equiv":"X-UA-Compatible",content:"IE=edge,chrome=1"});k.appendChild(e);e=a.newHTML("meta",{name:"viewport",content:"width=device-width,initial-scale=1.0,user-scalable=yes"});document.querySelector("meta[name=viewport]")||k.appendChild(e);e=a.newHTML("meta",{name:"mobile-web-app-capable",content:"yes"});k.appendChild(e);e=a.newHTML("meta",{name:"apple-mobile-web-app-capable",content:"yes"});k.appendChild(e);
e=a.newHTML("meta",{name:"apple-mobile-web-app-status-bar-style",content:"black"});k.appendChild(e);(k=document.getElementById("StyleDescartesApps2"))&&k.remove();k=a.newHTML("style",{rel:"stylesheet",type:"text/css",id:"StyleDescartesApps2"});document.head.insertBefore(k,document.head.firstChild);k.innerHTML="body{-webkit-font-smoothing:antialiased;}\n#descartesJS_north,#descartesJS_south,#descartesJS_east,#descartesJS_west{background:#c0c0c0;position:absolute;z-index:100;}\n.PBL{position:absolute;background-color:#f2f2f2;border:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;color:#2daae4;visibility:hidden;border-radius:100vw;}\n.PBL::-moz-progress-bar{background:#2daae4;border-radius:inherit;}\n.PBL::-webkit-progress-bar{background:#f2f2f2;border-radius:100vw;}\n.PBL::-webkit-progress-value{background:#2daae4;border-radius:inherit;}\n.PBL::-ms-fill{background:#2daae4;border-radius:inherit;}\n.DescartesAppContainer *,.DescartesAppContainer *:before,.DescartesAppContainer *:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;transform:translate3d(0,0,0);}\n.DescartesAppContainer{border:none;overflow:hidden;position:relative;top:0;left:0;}\n.DescartesCatcher{background-color:rgba(0,0,0,0);cursor:pointer;position:absolute;}\n.DescartesLoader{background-color:#fff;overflow:hidden;position:absolute;top:0;left:0;z-index:1000;width:100%;height:100%;display:none;}\n.DescartesLoaderImage{position:absolute;background-repeat:no-repeat;background-position:center;overflow:hidden;top:0;left:0;width:100%;height:100%;}\n.DescartesSpace2DCanvas,.DescartesSpace3DCanvas,.blocker{touch-action:none;position:absolute;overflow:hidden;left:0;top:0;}\n.DescartesSpace2DContainer,.DescartesSpace3DContainer{position:absolute;overflow:hidden;line-height:0;}\n.DescartesCheckboxContainer input[type=checkbox],.DescartesCheckboxContainer input[type=radio]{display: none;}\n.DescartesCheckboxContainer input[type=checkbox]+label::after{position:absolute;left:0px;content:'';padding:0;margin:0;width:100%;height:100%;background:#fff;border:1px solid gray;}\n.DescartesCheckboxContainer input[type=checkbox]:checked+label::after{content:'';background:url("+
a.getSvgCheckbox()+") center center no-repeat;background-size:contain;background-color:#fff;}\n.DescartesCheckboxContainer input[type=radio]+label::after{position:absolute;left:0px;content:'';padding:0;margin:0;width:100%;height:100%;background:#fff;border:1px solid gray;border-radius:50%;}\n.DescartesCheckboxContainer input[type=radio]:checked+label::after{content:'';background:url("+a.getSvgRadio()+") center center no-repeat;background-size:contain;background-color:#fff;}\n.DescartesCheckbox{position:absolute;}\n.DescartesButton{position:absolute;cursor:pointer;}\n.DescartesButtonContainer,.DescartesSpinnerContainer,.DescartesCheckboxContainer,.DescartesTextFieldContainer,.DescartesMenuContainer{position:absolute;overflow:hidden;}\n.DescartesSpinnerContainer input,.DescartesCheckboxContainer,.DescartesTextFieldContainer input,.DescartesMenuContainer select{border-radius:0;}\n.DescartesSpinnerField,.DescartesTextFieldField,.DescartesMenuField,.DescartesScrollbarField{font-family:"+
a.sansserif_font+";padding:0 2px;border:solid #666 1px;position:absolute;}\ninput[type='text']:disabled,.DescartesMenuSelect:disabled{background-color:#e3e3e3;cursor:not-allowed;opacity:1;}\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;outline: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.addSymbolFont?a.addSymbolFont():"")+(a.addFonts?a.addFonts():"");return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.sin,e=Math.floor,f=Math.random,r=Math.round,n=Math.abs,c=String.fromCharCode,h,p,b,g,d,v,q,u,y,m,l=function(a){this.key=(void 0===a?0:a).toString()};l.prototype.getKey=function(a){h=[];for(var b=0;256>b;b++)h[b]=c(this.alfanum(e(n(7.5*(k(1*b-a)+k(1.4*b+a)+k(.6*b-a)+k(2.2*b+a))))));return h.join("")};l.prototype.encode=function(a){p=e(31*f());this.key=this.getKey(p);return c(this.alfanum(p))+this.encripta(a)};l.prototype.decode=function(a){p=
this.numalfa(a.charCodeAt(0));this.key=this.getKey(p);return this.desencripta(a.substring(1))};l.prototype.encripta=function(a){return this.bytesToString(this.encriptaAux(this.stringToBytes(a)))};l.prototype.encriptaAux=function(a){if(null==a||null==this.key)return null;v=Array(3*a.length);for(var b=0,d=a.length;b<d;b++)y=256*e(a[b]+128)+r(255*f())+65536*r(255*f()),m=e((y<<this.shift(b))/256),v[3*b]=this.alfanum(m%32),v[3*b+1]=this.alfanum(m/32%32),v[3*b+2]=this.alfanum(m/1024%32);return v};l.prototype.desencripta=
function(a){return this.bytesToString(this.desencriptaAux(this.stringToBytes(a)))};l.prototype.desencriptaAux=function(a){if(null==a||null==this.key)return null;q=Array(a.length/3);for(var b=0,d=q.length;b<d;b++)m=this.numalfa(a[3*b])+32*this.numalfa(a[3*b+1])+1024*this.numalfa(a[3*b+2]),y=e(256*m>>this.shift(b)),u=e(y/256)%256-128,0>u&&(u+=256),q[b]=u;return q};l.prototype.alfanum=function(a){return(10>a?48:87)+e(a)};l.prototype.numalfa=function(a){return a-(58>a?48:87)};l.prototype.stringToBytes=
function(a){g=[];for(var b=0,d=a.length;b<d;b++)g.push(a.charCodeAt(b));return g};l.prototype.bytesToString=function(a){for(var b=0,d=a.length;b<d;b++)a[b]=c(a[b]);return a.join("")};l.prototype.shift=function(a){b=this.key.charCodeAt(a%this.key.length);g=this.numalfa(b);d=e(g/2%8);0==d&&(d=4);return d};l.prototype.parseByte=function(a){a=parseInt(a);a=0>a?0:a;return 255<a?255:a};a.Krypto=l;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){this.parent=e;var k=e.evaluator,n=k.parser;e=new a.Auxiliary(e);var c=this;c.delay=f.delay?n.parse(f.delay):n.parse("60");c.loop=f.loop?f.loop:!1;c.auto=void 0==f.auto?!0:f.auto;c.controls=f.controls;c.init=e.splitInstructions(n,f.init);c.doExpr=e.splitInstructions(n,f.doExpr);f.whileExpr&&(c.whileExpr=n.parse(f.whileExpr));var h,p=c.doExpr.length;c.animExec=function(){for(h=0;h<p;h++)k.eval(c.doExpr[h]);c.parent.update();c.playing&&
(0<k.eval(c.whileExpr)||c.loop)?c.timer=a.setTimeout(c.animExec,k.eval(c.delay)):(c.stop(),c.pause=!1,c.parent.update())};c.playing=!1;c.auto&&c.play()};k.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))))};k.prototype.stop=function(){this.playing=!1;a.clearTimeout(this.timer)};k.prototype.reinit=function(){for(var a=0,f=this.init.length;a<
f;a++)this.parent.evaluator.eval(this.init[a])};a.Animation=k;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var k=function(a,f){this.parent=a;this.evaluator=this.parent.evaluator};k.prototype.execute=function(){};a.Action=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){e=a.Action.call(this,e,f)||this;e.parameter=(f||"").replace(/\\n/g,"\n").replace(/&squot;/g,"'");return e};$jscomp.inherits(k,a.Action);k.prototype.execute=function(){alert(this.parameter)};a.Message=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){e=a.Action.call(this,e,f)||this;var k=e.evaluator,n=k.parser;f=a.splitSeparator((f||"").replace(/&squot;/g,"'"));for(var c=[],h,p=0,b=f.length;p<b;p++)(h=n.parse(f[p],!0))&&c.push(h);b=c.length;e.execute=function(){for(p=0;p<b;p++)k.eval(c[p])};return e};$jscomp.inherits(k,a.Action);a.Calculate=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){var k=a.Action.call(this,e,f)||this;k.parser=e.evaluator.parser;k.evaluator=e.evaluator;k.parameter=f;k.target="_blank";return k};$jscomp.inherits(k,a.Action);k.prototype.execute=function(){var e=this.parameter;e.match(/^\[.*\]?/)&&(e=this.evaluator.eval(this.parser.parse(e.substring(1,e.length-1))));var f=e.indexOf("target");-1!=f&&(this.target=e.substring(f),this.target=this.target.substring(this.target.indexOf("=")+1),e=e.substring(0,
f-1));if("javascript"==e.substring(0,10)){e=new a.SimpleText(parent,e.substring(11).replace(/&squot;/g,"'"));try{eval(e.toString())}catch(r){}}else"http"!=e.substring(0,4)&&(f=window.__dirname||window.location.href,e=f.substring(0,f.lastIndexOf("/")+1)+e),window.open(e,this.target)};a.OpenURL=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){var k=a.Action.call(this,e,f)||this;k.parser=e.evaluator.parser;k.evaluator=e.evaluator;k.parameter=f.trim();k.target="_blank";return k};$jscomp.inherits(k,a.Action);k.prototype.execute=function(){var a=this.parameter;a.match(/^\[.*\]?/)&&(a=this.evaluator.eval(this.parser.parse(a.substring(1,a.length-1))));var f=a.indexOf("target");-1!=f&&(this.target=a.substring(f),this.target=this.target.substring(this.target.indexOf("=")+1),a=a.substring(0,
f-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)&&(f=window.__dirname||window.location.href,a=f.substring(0,f.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=k;return a}(descartesJS||
{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){return a.Action.call(this,e,f)||this};$jscomp.inherits(k,a.Action);k.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=k;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){return a.Action.call(this,e,f)||this};$jscomp.inherits(k,a.Action);k.prototype.execute=function(){this.parent.init()};a.Init=k;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){return a.Action.call(this,e,f)||this};$jscomp.inherits(k,a.Action);k.prototype.execute=function(){this.parent.clear()};a.Clear=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){return a.Action.call(this,e,f)||this};$jscomp.inherits(k,a.Action);k.prototype.execute=function(){this.parent.play()};a.Animate=k;return a}(descartesJS||{});descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){return a.Action.call(this,e,f)||this};$jscomp.inherits(k,a.Action);k.prototype.execute=function(){this.parent.reinitAnimation()};a.InitAnimation=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=/[\w\.\-//]*(\.ogg|\.oga|\.mp3|\.wav)/gi,e=function(f,e){f=a.Action.call(this,f,e)||this;e=e||"";e.match(k)?f.filenameExpr=f.evaluator.parser.parse("'"+e.match(k)+"'"):(e.match(/^\[.*\]?/)&&(e=e.substring(1,e.length-1)),f.filenameExpr=f.evaluator.parser.parse(e));return f};$jscomp.inherits(e,a.Action);e.prototype.execute=function(){var a=this.theAudio=this.parent.getAudio(this.evaluator.eval(this.filenameExpr));a.paused?a.play():(a.pause(),a.currentTime=
0)};a.PlayAudio=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f=function(a,e){this.parent=a;this.evaluator=this.parent.evaluator;this.local=this.expresion=this.id="";this.evaluate="onlyOnce";Object.assign(this,e)};f.prototype.firstRun=function(){};f.prototype.update=function(){};f.prototype.splitInstructions=function(f,n){e=[];n=n?a.splitSeparator(n):[""];for(var c=0,h=n.length;c<h;c++)a.DEBUG.lineCount=c,(k=f.parse(n[c],!0))&&e.push(k);return e};f.prototype.getPrivateVariables=function(a,f){e=[];f=f?f.split(/;|,/):
[""];for(var c=0,h=f.length;c<h;c++)(k=a.parse(f[c],!0))&&e.push(k);c=0;for(h=e.length;c<h;c++)e[c]="assign"===e[c].type?e[c].childs[0].value:"identifier"===e[c].type?e[c].value:"";return e};f.prototype.parseExpressions=function(f){a.DEBUG.paramName="inicio";this.init=this.splitInstructions(f,this.init);a.DEBUG.paramName="local";this.privateVars=this.getPrivateVariables(f,this.local);a.DEBUG.paramName="hacer";this.doExpr=this.splitInstructions(f,this.doExpr);a.DEBUG.paramName="mientras";this.whileExpr=
f.parse(this.whileExpr)};a.Auxiliary=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){e=a.Auxiliary.call(this,e,f)||this;f=e.evaluator.parser;e.expresionString=e.expresion;e.expresion=f.parse(e.expresionString);e.expresion&&f.setVariable(e.id,e.expresion);e.editable&&(e.registerTextField(),e.parent.editableRegionVisible=!0);return e};$jscomp.inherits(k,a.Auxiliary);k.prototype.registerTextField=function(){var e=a.newHTML("div"),f=a.newHTML("label");f.appendChild(document.createTextNode("___"+this.id+"=___"));var k=a.newHTML("input");
k.value=this.expresionString;k.disabled=!this.editable;e.appendChild(f);e.appendChild(k);var n=this,c=n.evaluator.parser;k.onkeydown=function(a){13==a.keyCode&&(n.expresion=c.parse(this.value),c.setVariable(n.id,n.expresion),n.parent.update())};this.parent.editableRegion.textFields.push({container:e,type:"div"})};a.Variable=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){e=a.Auxiliary.call(this,e,f)||this;e.expresion=e.evaluator.parser.parse(e.expresion);e.update();return e};$jscomp.inherits(k,a.Auxiliary);k.prototype.update=function(){this.evaluator.setVariable(this.id,this.evaluator.eval(this.expresion))};a.Constant=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n=function(c,h){h=a.Auxiliary.call(this,c,h)||this;k=c.evaluator;e=k.parser;h.size=h.size||e.parse("3");h.expresion=h.expresion.split(";");h.parseFile=e.parse(h.file);h.update();return h};$jscomp.inherits(n,a.Auxiliary);n.prototype.update=function(){var c=this.expresion,h;k=this.evaluator;e=k.parser;this.oldFile=this.file;if(f=k.eval(this.parseFile))this.file=f;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");h=[];for(var p=0,b=r.length;p<b;p++)""!=r[p]&&h.push(r[p]);r=h}null==r||1==r.length&&""==r[0]?(r=[],this.size=e.parse("0")):(c=r,this.size=null);null===this.size&&(this.size=e.parse(c.length+""))}var g;h=[];p=0;for(b=c.length;p<b;p++)(g=e.parse(c[p],!0))&&"assign"!=g.type&&(g=e.parse(this.id+"["+p+"]="+c[p],!0)),h.push(g);c=parseInt(Math.abs(k.eval(this.size)));c=Array(c).fill(0);c._size_=c.length;k.vectors[this.id]=
c;k.setVariable(this.id+".long",c._size_);p=0;for(b=h.length;p<b;p++)k.eval(h[p])};a.Vector=n;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c=function(c,p){p=a.Auxiliary.call(this,c,p)||this;k=c.evaluator;e=k.parser;p.rows=p.rows||e.parse("3");p.columns=p.columns||e.parse("3");p.expresion=p.splitInstructions(e,p.expresion);f=k.eval(p.rows);r=k.eval(p.columns);n=[];n.type="matrix";c=0;for(var b=r;c<b;c++)n[c]=Array(f).fill(0);k.matrices[p.id]=n;p.update();return p};$jscomp.inherits(c,a.Auxiliary);c.prototype.update=function(){k=this.evaluator;f=k.eval(this.rows);r=k.eval(this.columns);
k.setVariable(this.id+".filas",f);k.setVariable(this.id+".columnas",r);n=k.matrices[this.id];n.rows=f;n.cols=r;for(var a=0,c=this.expresion.length;a<c;a++)k.eval(this.expresion[a])};a.Matrix=c;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){var k=a.Auxiliary.call(this,e,f)||this;var n=k.evaluator;e=n.parser;f=k.id.indexOf("(");k.name=k.id.substring(0,f);k.params=k.id.substring(f+1,k.id.indexOf(")"));k.domain=k.range?e.parse(k.range):e.parse("1");k.params=""===k.params?[]:k.params.split(",");k.numberOfParams=k.params.length;k.algorithm||(k.init="",k.doExpr="",k.whileExpr="");k.parseExpressions(e);k.expresion=e.parse(k.expresion);k.functionExec=function(){k.iterations=0;
if(k.numberOfParams<=arguments.length){for(var c=[],h=0,f=k.privateVars.length;h<f;h++)c.push(n.getVariable(k.privateVars[h])),n.setVariable(k.privateVars[h],0);var b=[];h=0;for(f=k.params.length;h<f;h++)b[h]=n.getVariable(k.params[h]),n.setVariable(k.params[h],arguments[h]);h=0;for(f=k.init.length;h<f;h++)n.eval(k.init[h]);do{h=0;for(f=k.doExpr.length;h<f;h++)n.eval(k.doExpr[h]);if(1E5<++k.iterations)return console.warn("se ha excedido el l\u00edmite de 100000 repeticiones en la funci\u00f3n << "+
k.name+" >>"),0}while(0<n.eval(k.whileExpr));var g=n.eval(k.expresion);a.rangeOK=n.eval(k.domain);h=0;for(f=k.params.length;h<f;h++)n.setVariable(k.params[h],b[h]);h=0;for(f=k.privateVars.length;h<f;h++)n.setVariable(k.privateVars[h],c[h]);return g}return 0};n.setFunction(k.name,k.functionExec);return k};$jscomp.inherits(k,a.Auxiliary);a.Function=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){var k=a.Auxiliary.call(this,e,f)||this;var n=k.evaluator;k.parseExpressions(n.parser);k.algorithmExec=function(){for(var a=k.iterations=0,f=k.init.length;a<f;a++)n.eval(k.init[a]);do{a=0;for(f=k.doExpr.length;a<f;a++)n.eval(k.doExpr[a]);if(1E5<++k.iterations)return console.warn("se ha excedido el l\u00edmite de 100000 repeticiones en el algoritmo << "+k.name+" >>"),0}while(0<n.eval(k.whileExpr))};return k};$jscomp.inherits(k,a.Auxiliary);
k.prototype.update=function(){this.algorithmExec();"onlyOnce"===this.evaluate&&(this.update=function(){})};a.Algorithm=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){e=a.Auxiliary.call(this,e,f)||this;f=e.evaluator;delete e.evaluate;e.condition=f.parser.parse(e.condition);e.lastEvaluation=!1;e.action=e.parent.lessonParser.parseAction(e);"onlyOnce"==e.execution&&(e.eventExec=function(){0<this.evaluator.eval(this.condition)&&!this.lastEvaluation&&(this.lastEvaluation=!0,this.action.execute())});"alternate"==e.execution&&(e.eventExec=function(){var a=0<this.evaluator.eval(this.condition);a&&!this.lastEvaluation?
(this.action.execute(),this.lastEvaluation=!0):!a&&this.lastEvaluation&&(this.lastEvaluation=!1)});"always"==e.execution&&(e.eventExec=function(){0<this.evaluator.eval(this.condition)&&this.action.execute()});return e};$jscomp.inherits(k,a.Auxiliary);k.prototype.update=function(){this.eventExec()};a.Event=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(e,f){var k=a.Auxiliary.call(this,e,f)||this;if(f=f.file){var n=document.getElementById(f);n=n&&"descartes/library"===n.type?n.text:a.openExternalFile(f)}if(n){n=a.convertHTMLEntities(n).replace(/\r/g,"").split("\n");f=0;for(var c=n.length;f<c;f++)""!==n[f].trim()&&e.lessonParser.parseAuxiliar(n[f])}return k};$jscomp.inherits(k,a.Auxiliary);a.Library=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h,p,b=function(b,d){this.parent=b;this.evaluator=b.evaluator;var c=this.evaluator.parser;this.spaceID="";this.background=!1;this.type="";this.drawif=c.parse("1");this.abs_coord=d.type&&"text"===d.type.toLowerCase()?!0:!1;this.color=new a.Color("20303a");this.trace="";this.expresion=c.parse("(0,0)");this.family="";this.family_interval=c.parse("[0,1]");this.family_steps=c.parse("8");this.editable=this.visible=!1;this.font="SansSerif,PLAIN,"+
(5<=this.parent.version?"18":"12");this.fixed=!0;this.text="";this.decimals=c.parse("2");Object.assign(this,d);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()))};b.prototype.getSpace=
function(){var a=this;return this.parent.spaces.find(function(b){return b.id===a.spaceID})||this.parent.spaces[0]};b.prototype.getFamilyValues=function(){k=this.evaluator;e=k.eval(this.family_interval);this.familyInf=e[0][0];this.familySup=e[0][1];this.fSteps=Math.round(k.eval(this.family_steps));this.family_sep=0<this.fSteps?(this.familySup-this.familyInf)/this.fSteps:0};b.prototype.drawFamilyAux=function(a,b,c){k=this.evaluator;this.getFamilyValues();f=k.getVariable(this.family);if(0<=this.fSteps)for(var d=
0,g=this.fSteps;d<=g;d++)k.setVariable(this.family,this.familyInf+d*this.family_sep),0<k.eval(this.drawif)&&(this.update(),a.oldTextNode=null,this.drawAux(a,b,c));k.setVariable("_Text_H_",0);k.setVariable(this.family,f)};b.prototype.draw=function(a,b){""!==this.family?this.drawFamilyAux(this.ctx,a,b):0<this.evaluator.eval(this.drawif)&&(this.update(),this.drawAux(this.ctx,a,b));this.ctx.setLineDash([])};b.prototype.drawTrace=function(a,b){""!=this.family?this.drawFamilyAux(this.traceCtx,a,b):0<this.evaluator.eval(this.drawif)&&
(this.update(),this.drawAux(this.traceCtx,a,b))};b.prototype.rotate=function(a,b,c){h=Math.cos(c);p=Math.sin(c);return{x:a*h-b*p,y:a*p+b*h}};b.prototype.dashStyle=function(){c=this.ctx;"dot"===this.lineDash?(c.lineCap="butt",c.setLineDash([c.lineWidth,c.lineWidth])):"dash"===this.lineDash?(c.lineCap="butt",c.setLineDash([4*c.lineWidth,3*c.lineWidth])):"dash_dot"===this.lineDash?(c.lineCap="butt",c.setLineDash([4*c.lineWidth,2*c.lineWidth,c.lineWidth,2*c.lineWidth])):c.setLineDash([])};b.prototype.drawText=
function(a,b,c,f,h,e,p,l,x,w,z){a.textNode=b;if("rtfNode"===b.type)a.fillStyle=a.strokeStyle=h.getColor(),a.textBaseline="alphabetic",a.textNode.pos={x:c,y:f},b.update(a,c,f,x,w,p,z,h.getColor());else for("simpleText"===b.type&&(b=b.toString(x,w).split("\\n")),k=this.evaluator,a.fillStyle=h.getColor(),a.font=e,a.textAlign=p,a.textBaseline=l,n=1.2*this.fontSize||0,h=0,e=b.length;h<e;h++)r=b[h],this.border&&(a.strokeStyle=this.border.getColor(),a.lineWidth=4,a.lineJoin="round",a.miterLimit=2,a.strokeText(r,
c,f+n*h)),a.fillText(r,c,f+n*h)};a.Graphic=b;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h,p=function(a,g){this.text=g=g.replace("&#x2013","\u2013").replace(/&squot;/g,"'");this.textElements=[];this.textElementsMacros=[];this.parent=a;this.evaluator=a.evaluator;this.type="simpleText";k="'";r=f=0;for(n=-1;f<g.length;)c=g.charAt(f),h=g.charAt(f-1),"["===c&&"\\"===h?(this.textElements.push(g.substring(r,f-1)+"["),this.textElementsMacros.push("'"+g.substring(r,f-1)+"['"),r=f+1):"]"===c&&"\\"===h?(this.textElements.push(g.substring(r,
f-1)+"]"),this.textElementsMacros.push("'"+g.substring(r,f-1)+"]'"),r=f+1):"["===c&&-1===n?(this.textElements.push(g.substring(r,f)),this.textElementsMacros.push("'"+g.substring(r,f)+"'"),r=f,n++):"["===c?n++:"]"===c&&0===n?(this.textElements.push(this.evaluator.parser.parse(g.substring(r,f+1))),this.textElementsMacros.push("["+g.substring(r,f+1)+"]"),r=f+1,n--):("]"==g.charAt(f)&&(n=0>n?n:n-1),k+=g.charAt(f)),f++;this.textElements.push(g.substring(r,f));this.textElementsMacros.push("'"+g.substring(r,
f)+"'")};p.prototype.toString=function(b,c){k="";for(var d=0,g=this.textElements.length;d<g;d++)"string"===typeof this.textElements[d]?k+=this.textElements[d]:(e=this.evaluator.eval(this.textElements[d])[0][0],""!==e&&("string"===typeof e?k+=e:Infinity==e?k+="Infinity":-Infinity==e?k+="-Infinity":isNaN(e)||"NaN"==e?k+="NaN":(e=parseFloat(e),e=c?e.toFixed(b):a.removeNeedlessDecimals(e.toFixed(b)),k+=e.toString().replace(".",this.parent.decimal_symbol))));return k};a.SimpleText=p;return a}(descartesJS||
{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h,p,b,g,d,v,q,u,y,m,l,x,w,z,A,G,J,E,F,D,B,L,I,M,O,H,P,C,N=function(b,d){d=a.Graphic.call(this,b,d)||this;d.width=d.width||b.evaluator.parser.parse("1");d.fillP=d.fillP||"";d.fillM=d.fillM||"";d.parseExpression();d.visible=2===d.parent.version&&void 0==d.visible?!0:d.visible;d.visible&&d.registerTextField();v=new a.R2;q=new a.R2;u=new a.R2;l=new a.R2;y=new a.R2;d.cInd=0;return d};$jscomp.inherits(N,a.Graphic);N.prototype.parseExpression=function(){if("compOperator"===
this.expresion.type){var b=this.expresion.childs[0],d=this.expresion.childs[1];"identifier"!=b.type||"y"!=b.value||d.contains("y")?"identifier"!=d.type||"y"!=d.value||b.contains("y")?"identifier"!=b.type||"x"!=b.value||d.contains("x")?"identifier"!=d.type||"x"!=d.value||b.contains("x")||(this.funExpr=d,this.of_y=!0,this.drawAux=this.drawAuxFun):(this.funExpr=d,this.of_y=!0,this.drawAux=this.drawAuxFun):(this.funExpr=b,this.of_y=!1,this.drawAux=this.drawAuxFun):(this.funExpr=d,this.of_y=!1,this.drawAux=
this.drawAuxFun)}this.newt=new a.R2Newton(this.evaluator,this.expresion)};N.prototype.update=function(){};N.prototype.draw=function(){""!=this.family?this.drawFamilyAux(this.ctx,this.fill,this.color):(this.update(),this.drawAux(this.ctx,this.fill,this.color))};N.prototype.drawFamilyAux=function(a,b,d){e=this.evaluator;this.getFamilyValues();tempParam=e.getVariable(this.family);if(0<=this.fSteps)for(var c=0,l=this.fSteps;c<=l;c++)e.setVariable(this.family,this.familyInf+c*this.family_sep),this.update(),
this.drawAux(a,b,d);e.setVariable(this.family,tempParam)};N.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.fill,this.trace)};N.prototype.drawAux=function(K,Q,R){if(!(0>=this.evaluator.eval(this.drawif))){this.cInd=0;e=this.evaluator;f=e.parser;r=this.space;n=e.eval(this.width);K.strokeStyle=this.color.getColor();K.lineWidth=n;c=f.getVariable("x");h=f.getVariable("y");p=r.w+24;b=r.h+24;g=p/9;3>g&&(g=3);d=b/7;3>d&&(d=3);0==this.cInd?(k=[],this.cInd++):this.cInd=(this.cInd+
1)%1E7;v.set(0,0);q.set(0,0);u.set(0,0);P=.25;C=8;this.abs_coord||(P/=r.scale,C/=r.scale);K.beginPath();for(B=parseInt(d/2);B<b;B+=d)for(D=parseInt(g/2);D<p;D+=g){if(this.abs_coord){l.set(D,B);m=this.newt.findZero(l,P);if(null==m)continue;e.setVariable("x",m.x);e.setVariable("y",m.y);y.set(m.x,m.y)}else{l.set(r.getRelativeX(D),r.getRelativeY(B));m=this.newt.findZero(l,P);if(null==m)continue;e.setVariable("x",m.x);e.setVariable("y",m.y);y.set(r.getAbsoluteX(m.x),r.getAbsoluteY(m.y))}x=y.ix();w=y.iy();
if(-12<=x&&x<p+24&&-12<=w&&w<b+24){if(k[x+12+(w+12)*r.w]===this.cInd)continue;k[x+12+(w+12)*r.w]=this.cInd}a.rangeOK&&(K.moveTo(x,w),K.lineTo(x,w));v.x=m.x;v.y=m.y;q.x=m.x;q.y=m.y;z=this.newt.getUnitNormal();if(0!=z.x||0!=z.y)for(z.rotL90(),u.x=z.x,u.y=z.y,G=A=0,J=!1;2>G;)if(J&&(u.x=-z.x,u.y=-z.y,m.x=v.x,m.y=v.y,q.x=m.x,q.y=m.y,this.abs_coord?y.set(m.x,m.y):y.set(r.getAbsoluteX(m.x),r.getAbsoluteY(m.y)),x=y.ix(),w=y.iy(),J=!1,A=0),m.x+=C*u.x,m.y+=C*u.y,m=this.newt.findZero(m,P),null!=m){e.setVariable("x",
m.x);e.setVariable("y",m.y);u.x=m.x-q.x;u.y=m.y-q.y;u.normalize();if(0==u.x&&0==u.y)break;q.x=m.x;q.y=m.y;this.abs_coord?y.set(m.x,m.y):y.set(r.getAbsoluteX(m.x),r.getAbsoluteY(m.y));E=parseInt(y.ix());F=parseInt(y.iy());if(E!=x||F!=w)if(L=x,I=w,x=E,w=F,-12<=x&&x<p+24&&-12<=w&&w<b+24){A=0;M=k[x+12+(w+12)*r.w];k[x+12+(w+12)*r.w]=this.cInd;for(Q=1;8>Q;Q++)O=L+Math.round((x-L)*Q/8),H=I+Math.round((w-I)*Q/8),0<=O&&O<p&&0<=H&&H<b&&(k[O+12+(H+12)*r.w]=this.cInd);a.rangeOK&&(K.moveTo(L,I),K.lineTo(x,w));
if(M===this.cInd)break}else J=!0,G++;else 4<++A&&(J=!0,G++)}}K.stroke()}};N.prototype.X=function(a,b,d){d||(b=this.space.w/2+this.space.Ox+this.space.scale*b);b<-a&&(b=-a);b>this.space.w+a&&(b=this.space.w+a);return b};N.prototype.Y=function(a,b,d){d||(b=this.space.h/2+this.space.Oy-this.space.scale*b);b<-a&&(b=-a);b>this.space.h+a&&(b=this.space.h+a);return b};N.prototype.XX=function(a,b,d){return Math.round(this.X(a,b,d))};N.prototype.YY=function(a,b,d){return Math.round(this.Y(a,b,d))};N.prototype.extrapolate=
function(b,d,c,l,g,f){for(var h=this.evaluator.getVariable(d),q=f/2,e=0,k,p,m,n,u,v;1E-15<Math.abs(q);){k=this.evaluator.getVariable(d);p=this.evaluator.getVariable(d)+q;this.evaluator.setVariable(d,p);m=!0;try{n=g,g=this.evaluator.eval(this.funExpr),this.evaluator.setVariable(c,g),0<this.evaluator.eval(b)?(u=new a.R2(Math.min(n,g),Math.max(n,g)),v=0,v=0<f?this.Singularity(Math.abs(q),d,l,k,n,p,g,u):this.Singularity(Math.abs(q),d,l,p,g,k,n,u),0<v&&(m=!1)):m=!1}catch(Z){m=!1}m?e+=q:this.evaluator.setVariable(d,
k);q/=2}this.evaluator.setVariable(d,h);return new a.R2(e/Math.abs(f),g)};N.prototype.extrapolateOnSingularity=function(b,d,c,l,g,f){l=this.evaluator.getVariable(d);for(var h=f/2,q=0,e=g,k;1E-15<Math.abs(h);){this.evaluator.setVariable(d,this.evaluator.getVariable(d)+h);k=!0;if(0<this.evaluator.eval(b))try{e=this.evaluator.eval(this.funExpr),this.evaluator.setVariable(c,e),0>=this.evaluator.eval(b)&&(k=!1)}catch(X){k=!1}else k=!1;k?q+=h:this.evaluator.setVariable(d,this.evaluator.getVariable(d)-h);
h/=2}if(0==q)for(h=f/2,q=f,e=g;1E-15<Math.abs(h);){this.evaluator.setVariable(d,this.evaluator.getVariable(d)-h);k=!0;if(0<this.evaluator.eval(b))try{e=this.evaluator.eval(this.funExpr)}catch(X){k=!1}else k=!1;k?q+=-h:this.evaluator.setVariable(d,this.evaluator.getVariable(d)+h);h/=2}this.evaluator.setVariable(d,l);return new a.R2(q/Math.abs(f),e)};N.prototype.Singularity=function(a,b,d,c,l,g,f,h){if(isNaN(f)||isNaN(l)||isNaN(h.y)||isNaN(h.x)||c>=g)return 2;var q=this.evaluator.getVariable(b),e=0;
try{if(1E-15>Math.abs(g-c)||1E-12>Math.abs(g-c)&&Math.abs(f-l)>Math.abs(a))return this.evaluator.setVariable(b,q),1;var k=(c+g)/2;this.evaluator.setVariable(b,k);var p=NaN;try{p=this.evaluator.eval(this.funExpr)}catch(Y){return 2}if(isNaN(p))return 5;if(Math.abs(f-l)>a){this.evaluator.setVariable(b,c-1E-12);var m=this.evaluator.eval(this.funExpr);m=(l-m)/1E-12;this.evaluator.setVariable(b,g+1E-12);var n=(this.evaluator.eval(this.funExpr)-f)/1E-12;if((10>Math.abs(n)||10>Math.abs(m))&&(0<=n&&0<=m||
0>=n&&0>=m)&&4*Math.abs(n)<Math.abs((f-l)/(g-c)))return this.evaluator.setVariable(b,q),2}if(isNaN(h.x)||isNaN(h.y)||isNaN(p))return 2;if(!(h.x<=p&&p<=h.y)){this.evaluator.setVariable(b,k);h.x=Math.min(l,p);h.y=Math.max(l,p);var u=this.Singularity(a/2,b,d,c,l,k,p,h);this.evaluator.setVariable(b,g);h.x=Math.min(f,p);h.y=Math.max(f,p);var v=this.Singularity(a/2,b,d,k,p,g,f,h);e=Math.max(u,v)}}catch(Y){e=1}this.evaluator.setVariable(b,q);return e};N.prototype.drawAuxFun=function(b,d,l){c=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,q=this.evaluator.eval(this.width),e=!1,k=new a.R2(this.space.w/2+this.space.Ox,this.space.h/2+this.space.Oy),p=this.of_y?k.ix():k.iy(),m=0,n=0,u=0,v=0,z=1/this.space.scale;k=z*(this.of_y?-this.space.h+k.y:-k.x);var r=0;this.abs_coord&&(k=0,z=1);for(var x,G,y,w,B,F,I,A,D,R=this.of_y?this.space.h+2:this.space.w+2;u<=R;){x=!0;G=0;this.evaluator.setVariable(d,k);try{y=this.evaluator.eval(this.funExpr),
isNaN(y)||(this.evaluator.setVariable(g,y),0<this.evaluator.eval(this.drawif)&&a.rangeOK?(e?(w=Math.min(r,y),B=Math.max(r,y),F=new a.R2(w,B),G=this.Singularity(z,d,0,k-z,r,k,y,F),0===G?(r<=y?(r=F.x,y=F.y):(y=F.x,r=F.y),I=parseInt(this.of_y?this.XX(q,r,this.abs_coord):this.YY(q,r,this.abs_coord)),m=this.abs_coord?Math.round(y):parseInt(this.of_y?this.XX(q,y,this.abs_coord):this.YY(q,y,this.abs_coord)),this.fillM&&m>p&&(b.lineWidth=1,b.strokeStyle=this.fillM.getColor(),b.beginPath(),this.of_y?(b.moveTo(p+
1,this.space.h-u+.5),b.lineTo(m,this.space.h-u+.5)):(b.moveTo(u+.5,p+1),b.lineTo(u+.5,m)),b.stroke()),this.fillP&&m<p&&(b.lineWidth=1,b.strokeStyle=this.fillP.getColor(),b.beginPath(),this.of_y?(b.moveTo(p-1,this.space.h-u+.5),b.lineTo(m,this.space.h-u+.5)):(b.moveTo(u+.5,p-1),b.lineTo(u+.5,m)),b.stroke()),b.lineWidth=q,b.strokeStyle=l.getColor(),b.beginPath(),this.of_y?(b.moveTo(I+.5,this.space.h-v),b.lineTo(m+.5,this.space.h-u)):(b.moveTo(v+.5,I),b.lineTo(u+.5,m)),b.stroke()):1===G?(this.evaluator.setVariable(d,
k-z),A=this.extrapolate(f,d,g,0,r,z),m=this.of_y?this.XX(q,A.y,this.abs_coord):this.YY(q,A.y,this.abs_coord),b.lineWidth=q,b.strokeStyle=l.getColor(),b.beginPath(),this.of_y?(b.moveTo(n+.5,this.space.h-v),b.lineTo(m+.5,this.space.h-v+Math.round(A.x))):(b.moveTo(v+.5,n),b.lineTo(v+Math.round(A.x)+.5,m)),this.evaluator.setVariable(d,k),D=this.extrapolate(f,d,g,0,y,-z),n=this.of_y?this.XX(q,D.y,this.abs_coord):this.YY(q,D.y,this.abs_coord),m=this.of_y?this.XX(q,y,this.abs_coord):this.YY(q,y,this.abs_coord),
b.lineWidth=q,b.strokeStyle=l.getColor(),b.beginPath(),this.of_y?(b.moveTo(n+.5,this.space.h-u),b.lineTo(m+.5,this.space.h-u)):(b.moveTo(u+.5,n),b.lineTo(u+.5,m)),b.stroke()):2===G&&(m=this.of_y?this.XX(q,y,this.abs_coord):this.YY(q,y,this.abs_coord),b.lineWidth=q,b.strokeStyle=l.getColor(),b.beginPath(),this.of_y?(b.moveTo(n+.5,this.space.h-u),b.lineTo(m+.5,this.space.h-u)):(b.moveTo(u+.5,n),b.lineTo(u+.5,m)))):(D=this.extrapolateOnSingularity(f,d,g,0,y,-z),n=this.of_y?this.XX(q,D.y,this.abs_coord):
this.YY(q,D.y,this.abs_coord),m=this.of_y?this.XX(q,y,this.abs_coord):this.YY(q,y,this.abs_coord),b.lineWidth=q,b.strokeStyle=l.getColor(),b.beginPath(),this.of_y?(b.moveTo(n,this.space.h-(u+Math.round(D.x))+.5),b.lineTo(m,this.space.h-u+.5)):(b.moveTo(u+Math.round(D.x),n),b.lineTo(u,m)),b.stroke()),r=y):x=!1)}catch(aa){x=!1}e&&!x&&(this.evaluator.setVariable(d,k-z),this.evaluator.setVariable(g,r),A=this.extrapolate(f,d,g,0,r,z),m=parseInt(this.of_y?this.XX(q,A.y,this.abs_coord):this.YY(q,A.y,this.abs_coord)),
0<this.evaluator.eval(this.drawif)&&a.rangeOK&&(b.lineWidth=q,b.strokeStyle=l.getColor(),b.beginPath(),this.of_y?(b.moveTo(n,this.space.h-(v+Math.round(A.x))+.5),b.lineTo(m,this.space.h-(v+Math.round(A.x))+.5)):(b.moveTo(v+Math.round(A.x)+.5,n),b.lineTo(v+Math.round(A.x)+.5,m)),b.stroke()),this.evaluator.setVariable(d,k));e=x;k+=z;n=m;v=u++}this.evaluator.parser.setVariable("x",c);this.evaluator.parser.setVariable("y",h)};N.prototype.registerTextField=function(){var b=a.newHTML("input");b.value=this.expresionString;
b.disabled=!this.editable;var d=this;oncontextmenu=function(a){return!1};b.onkeydown=function(a){13==a.keyCode&&(d.expresion=d.evaluator.parser.parse(this.value),d.parseExpression(),d.parent.update())};this.parent.editableRegion.textFields.push(b)};a.Equation=N;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.round,e,f,r,n,c,h,p,b,g=function(b,c){c=a.Graphic.call(this,b,c)||this;c.parameter=c.parameter||"t";c.parameter_interval=c.parameter_interval||b.evaluator.parser.parse("[0,1]");c.parameter_steps=c.parameter_steps||b.evaluator.parser.parse("8");c.width=c.width||b.evaluator.parser.parse("1");c.fill=c.fill||"";c.visible=2===c.parent.version&&void 0==c.visible?!0:c.visible;c.visible&&c.registerTextField();return c};$jscomp.inherits(g,a.Graphic);
g.prototype.update=function(){e=this.evaluator;f=e.eval(this.parameter_interval);this.paraInf=f[0][0];this.paraSup=f[0][1];this.pSteps=e.eval(this.parameter_steps);this.paraSep=0<this.pSteps?Math.abs(this.paraSup-this.paraInf)/this.pSteps:0};g.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.fill,this.color)};g.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.fill,this.trace)};g.prototype.drawAux=function(d,g,q){e=this.evaluator;r=this.space;n=k(e.eval(this.width));
d.lineWidth=0<n?n:1E-6;d.lineCap=d.lineJoin="round";d.strokeStyle=q.getColor();c=e.getVariable(this.parameter);d.beginPath();e.setVariable(this.parameter,this.paraInf);h=e.eval(this.expresion);this.exprX=k(this.abs_coord?h[0][0]:r.getAbsoluteX(h[0][0]));this.exprY=k(this.abs_coord?h[0][1]:r.getAbsoluteY(h[0][1]));this.rotateExp&&(p=a.degToRad(e.eval(this.rotateExp)),b=this.rotate(h[0][0],h[0][1],p),this.exprX=k(this.abs_coord?b.x:r.getAbsoluteX(b.x)),this.exprY=k(this.abs_coord?b.y:r.getAbsoluteY(b.y)));
d.moveTo(this.exprX+.5,this.exprY+.5);for(q=1;q<=this.pSteps;q++)e.setVariable(this.parameter,this.paraInf+q*this.paraSep),h=e.eval(this.expresion),this.rotateExp&&(b=this.rotate(h[0][0],h[0][1],p),h[0][0]=b.x,h[0][1]=b.y),this.exprX=k(this.abs_coord?h[0][0]:r.getAbsoluteX(h[0][0])),this.exprY=k(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&&d.lineTo(this.exprX+.5,this.exprY+.5);this.fill&&(d.fillStyle=
g.getColor(),d.fill("evenodd"));this.dashStyle();d.stroke();d.setLineDash([]);e.setVariable(this.parameter,c)};g.prototype.registerTextField=function(){var b=a.newHTML("input");b.value=this.expresionString;b.disabled=!this.editable;var c=this;b.oncontextmenu=function(){return!1};b.onkeydown=function(a){13==a.keyCode&&(c.expresion=c.evaluator.parser.parse(this.value),c.parent.update())};this.parent.editableRegion.textFields.push(b)};a.Curve=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=2*Math.PI,e=Math.round,f,r,n,c,h,p,b,g,d,v,q=function(b,d){d=a.Graphic.call(this,b,d)||this;d.size=d.size||b.evaluator.parser.parse("2");d.range=d.range||b.evaluator.parser.parse("[1, 100]");d.visible=2===d.parent.version&&void 0==d.visible?!0:d.visible;d.visible&&d.registerTextField();return d};$jscomp.inherits(q,a.Graphic);q.prototype.update=function(){f=this.evaluator;n=f.eval(this.expresion);this.exprX=n[0][0];this.exprY=n[0][1];this.rotateExp&&
(c=this.rotate(n[0][0],n[0][1],a.degToRad(f.eval(this.rotateExp))),this.exprX=c.x,this.exprY=c.y);b=f.eval(this.range);this.rangeInf=b[0][0];this.rangeMax=b[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(b,c){f=this.evaluator;r=this.space;d=g=Math.ceil(f.eval(this.size)-.4);b.fillStyle=c.getColor();b.beginPath();this.rangeInf>
this.rangeMax&&(v=this.rangeInf,this.rangeInf=this.rangeMax,this.rangeMax=v);c=f.getVariable("n");for(var q=this.rangeInf,l=this.rangeMax;q<=l;q++)f.setVariable("n",q),n=f.eval(this.expresion),this.exprX=n[0][0],this.exprY=n[0][1],h=e(this.abs_coord?this.exprX:r.getAbsoluteX(this.exprX)),p=e(this.abs_coord?this.exprY:r.getAbsoluteY(this.exprY)),b.beginPath(),b.arc(h,p,g,0,k,!0),b.fill();b.fill();this.text!=[""]&&(this.fontSize=Math.max(5,f.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+d,p-d,this.color,this.font,"start","alphabetic",f.eval(this.decimals),this.fixed,!0));f.setVariable("n",c)};q.prototype.registerTextField=function(){var b=a.newHTML("input");b.value=this.expresionString;b.disabled=!this.editable;var d=this;oncontextmenu=function(a){return!1};b.onkeydown=function(a){13==a.keyCode&&(d.expresion=d.evaluator.parser.parse(this.value),d.parent.update())};this.parent.editableRegion.textFields.push(b)};
a.Sequence=q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=2*Math.PI,e=Math.round,f,r,n,c,h,p,b=function(b,d){d=a.Graphic.call(this,b,d)||this;d.size=d.size||b.evaluator.parser.parse("2");d.text=new a.TextObject(d,d.text);return d};$jscomp.inherits(b,a.Graphic);b.prototype.update=function(){f=this.evaluator;n=f.eval(this.expresion);this.exprX=n[0][0];this.exprY=n[0][1];this.rotateExp&&(c=this.rotate(n[0][0],n[0][1],a.degToRad(f.eval(this.rotateExp))),this.exprX=c.x,this.exprY=c.y)};b.prototype.draw=function(){a.Graphic.prototype.draw.call(this,
this.color,this.color)};b.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};b.prototype.drawAux=function(a,b){r=this.space;a.fillStyle=b.getColor();h=e(this.abs_coord?this.exprX:r.getAbsoluteX(this.exprX));p=e(this.abs_coord?this.exprY:r.getAbsoluteY(this.exprY));a.beginPath();a.arc(h,p,e(this.evaluator.eval(this.size)),0,k,!0);a.fill();this.text.hasContent&&this.text.draw(a,b,h,p)};a.Point=b;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.round,e=2*Math.PI,f,r,n,c,h,p,b,g,d,v,q,u,y,m=function(b,d){d=a.Graphic.call(this,b,d)||this;d.width=d.width||b.evaluator.parser.parse("1");d.size=d.size||b.evaluator.parser.parse("2");d.text=new a.TextObject(d,d.text);return d};$jscomp.inherits(m,a.Graphic);m.prototype.update=function(){f=this.evaluator;n=f.eval(this.expresion);this.endPoints=[];for(var b=0,d=n.length;b<d;b++)this.endPoints[b]={x:n[b][0],y:n[b][1]};if(this.rotateExp)for(c=
a.degToRad(f.eval(this.rotateExp)),b=0,d=this.endPoints.length;b<d;b++)this.endPoints[b]=this.rotate(this.endPoints[b].x,this.endPoints[b].y,c)};m.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.color,this.color)};m.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};m.prototype.drawAux=function(a,c,m){f=this.evaluator;r=this.space;h=k(f.eval(this.width));a.lineWidth=0<h?h:1E-6;g=f.eval(this.size);0>g&&(g=0);a.fillStyle=c.getColor();a.strokeStyle=
m.getColor();a.lineCap="round";d=0==a.lineWidth%2?0:.5;this.abs_coord?(v=k(this.endPoints[0].x),q=k(this.endPoints[0].y),u=k(this.endPoints[1].x),y=k(this.endPoints[1].y)):(v=k(r.getAbsoluteX(this.endPoints[0].x)),q=k(r.getAbsoluteY(this.endPoints[0].y)),u=k(r.getAbsoluteX(this.endPoints[1].x)),y=k(r.getAbsoluteY(this.endPoints[1].y)));a.beginPath();a.moveTo(v+d,q+d);a.lineTo(u+d,y+d);this.dashStyle();a.stroke();0<g&&(a.beginPath(),a.arc(v,q,g,0,e,!0),a.arc(u,y,g,0,e,!0),a.fill());a.setLineDash([]);
this.text.hasContent&&(p=parseInt((v+u)/2)-3,b=parseInt((q+y)/2)+3,this.text.draw(a,m,p,b))};a.Segment=m;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.floor,e=Math.round,f,r,n,c,h,p,b,g,d,v,q,u,y,m,l,x=function(b,d){d=a.Graphic.call(this,b,d)||this;d.width=d.width||b.evaluator.parser.parse("5");d.size=d.size||b.evaluator.parser.parse("2");d.spear=d.spear||b.evaluator.parser.parse("8");d.arrow=d.arrow||new a.Color("ee0022");d.text=new a.TextObject(d,d.text);return d};$jscomp.inherits(x,a.Graphic);x.prototype.update=function(){f=this.evaluator;r=f.eval(this.expresion);this.endPoints=[];for(var b=
0,d=r.length;b<d;b++)this.endPoints[b]={x:r[b][0],y:r[b][1]};if(this.rotateExp)for(n=a.degToRad(f.eval(this.rotateExp)),b=0,d=this.endPoints.length;b<d;b++)this.endPoints[b]=this.rotate(this.endPoints[b].x,this.endPoints[b].y,n)};x.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.arrow,this.color)};x.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.arrow,this.trace)};x.prototype.drawAux=function(n,z,r){f=this.evaluator;c=this.space;b=f.eval(this.width);
0>b&&(b=0);g=Math.ceil(b/2);d=c.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);n.fillStyle=z.getColor();n.strokeStyle=r.getColor();n.lineWidth=2;this.abs_coord?(q=e(this.endPoints[0].x),u=e(this.endPoints[0].y),y=e(this.endPoints[1].x),m=e(this.endPoints[1].y)):(q=e(c.getAbsoluteX(this.endPoints[0].x)),u=e(c.getAbsoluteY(this.endPoints[0].y)),y=e(c.getAbsoluteX(this.endPoints[1].x)),
m=e(c.getAbsoluteY(this.endPoints[1].y)));l=f.eval(this.spear);0>l&&(l=0);n.save();n.translate(q,u,v);this.abs_coord?n.rotate(this.angle*(0<=this.vect.y?1:-1)):(v*=d,n.rotate(this.angle*(0<=this.vect.y?-1:1)));n.beginPath();n.moveTo(-g,k(-g));n.lineTo(k(v-l-b),k(-g));n.lineTo(k(v-2*l),k(-l-g));n.lineTo(k(v),0);n.lineTo(k(v-2*l),k(l+g));n.lineTo(k(v-l-b),k(g));n.lineTo(-g,k(g));n.closePath();n.stroke();n.fill();n.restore();this.text.hasContent&&(h=parseInt((q+y)/2)-3,p=parseInt((u+m)/2)+3,this.text.draw(n,
r,h,p))};a.Arrow=x;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.round,e,f,r,n,c,h,p,b,g=function(b,c){c=a.Graphic.call(this,b,c)||this;c.width=c.width||b.evaluator.parser.parse("1");c.fill=c.fill||"";c.endPoints=[];return c};$jscomp.inherits(g,a.Graphic);g.prototype.update=function(){e=this.evaluator;r=e.eval(this.expresion);for(var b=0,c=r.length;b<c;b++)this.endPoints[b]={x:r[b][0],y:r[b][1]};if(this.rotateExp)for(n=a.degToRad(e.eval(this.rotateExp)),b=0,c=this.endPoints.length;b<c;b++)this.endPoints[b]=
this.rotate(this.endPoints[b].x,this.endPoints[b].y,n)};g.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.fill,this.color)};g.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace,this.trace)};g.prototype.drawAux=function(a,g,q){e=this.evaluator;f=this.space;c=k(e.eval(this.width));a.lineWidth=0<c?c:1E-6;a.strokeStyle=q.getColor();a.lineCap=a.lineJoin="round";h=0<c?.5:0;p=k(this.abs_coord?this.endPoints[0].x:f.getAbsoluteX(this.endPoints[0].x));b=k(this.abs_coord?
this.endPoints[0].y:f.getAbsoluteY(this.endPoints[0].y));a.beginPath();a.moveTo(p+h,b+h);q=1;for(var d=this.endPoints.length;q<d;q++)p=k(this.abs_coord?this.endPoints[q].x:f.getAbsoluteX(this.endPoints[q].x)),b=k(this.abs_coord?this.endPoints[q].y:f.getAbsoluteY(this.endPoints[q].y)),a.lineTo(p+h,b+h);this.fill&&(a.fillStyle=g.getColor(),a.fill());this.dashStyle();a.stroke();a.setLineDash([])};a.Polygon=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.round,e=Math.min,f=Math.max,r=Math.abs,n,c,h,p,b,g,d,v,q,u,y,m,l=function(b,d){d=a.Graphic.call(this,b,d)||this;d.width=d.width||b.evaluator.parser.parse("1");d.fill=d.fill||"";d.border_radius=d.border_radius||b.evaluator.parser.parse("0");d.endPoints=[];return d};$jscomp.inherits(l,a.Graphic);l.prototype.update=function(){n=this.evaluator;g=n.eval(this.expresion);this.exprX=g[0][0];this.exprY=g[0][1];this.w=150;this.h=100;this.rotateExp&&(h=
this.rotate(g[0][0],g[0][1],a.degToRad(n.eval(this.rotateExp))),this.exprX=h.x,this.exprY=h.y);4<=g[0].length&&(this.w=g[0][2],this.h=g[0][3]);g[1]&&2==g[1].length&&(this.w=g[1][0],this.h=g[1][1]);this.w=f(0,this.w);this.h=f(0,this.h)};l.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.fill,this.color)};l.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.fill,this.trace,"trace")};l.prototype.drawAux=function(a,g,l,h){n=this.evaluator;c=this.space;p=k(n.eval(this.width));
a.lineWidth=0<p?p:1E-6;a.strokeStyle=l.getColor();a.lineCap="round";a.lineJoin="miter";b=0<p?.5:0;d=k(this.abs_coord?this.exprX:c.getAbsoluteX(this.exprX))+b;v=k(this.abs_coord?this.exprY:c.getAbsoluteY(this.exprY))+b;q=this.abs_coord?this.w:this.w*c.scale;u=this.abs_coord?this.h:-this.h*c.scale;y=e(f(0,n.eval(this.border_radius)),.5*r(q),.5*r(u));m=this.abs_coord?1:-1;a.beginPath();0!==y?(a.moveTo(d+y,v),a.lineTo(d+q-y,v),a.quadraticCurveTo(d+q,v,d+q,v+m*y),a.lineTo(d+q,v+u-m*y),a.quadraticCurveTo(d+
q,v+u,d+q-y,v+u),a.lineTo(d+y,v+u),a.quadraticCurveTo(d,v+u,d,v+u-m*y),a.lineTo(d,v+m*y),a.quadraticCurveTo(d,v,d+y,v),a.lineTo(d+y,v)):(a.moveTo(d,v),a.lineTo(d+q,v),a.lineTo(d+q,v+u),a.lineTo(d,v+u),a.lineTo(d,v));this.fill&&(a.fillStyle=g.getColor(),a.fill());this.dashStyle();a.stroke();a.setLineDash([])};a.Rectangle=l;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.round,e=Math.min,f=Math.max,r=Math.acos,n=Math.sqrt,c=Math.PI,h=c/2,p=2*c,b,g,d,v,q,u,y,m,l,x,w,z,A,G,J,E,F,D,B,L,I,M=function(b,d){d=a.Graphic.call(this,b,d)||this;d.width=d.width||b.evaluator.parser.parse("1");d.fill=d.fill||"";d.center=d.center||b.evaluator.parser.parse("(0,0)");d.radius=d.radius||b.evaluator.parser.parse("1");d.init=d.init||"0";d.end=d.end||"90";d.init.match(/^_\(/)&&(d.initFlag=!0,d.init=d.init.substring(1));d.end.match(/^_\(/)&&
(d.endFlag=!0,d.end=d.end.substring(1));d.initExpr=b.evaluator.parser.parse(d.init);d.endExpr=b.evaluator.parser.parse(d.end);d.text=new a.TextObject(d,d.text);return d};$jscomp.inherits(M,a.Graphic);M.prototype.update=function(){b=this.evaluator;g=b.eval(this.center);this.exprX=g[0][0];this.exprY=g[0][1];d=0;this.rotateExp&&(d=a.degToRad(b.eval(this.rotateExp)),v=Math.cos(d),q=Math.sin(d),u=this.exprX*v-this.exprY*q,y=this.exprX*q+this.exprY*v,this.exprX=u,this.exprY=y);var k=b.eval(this.initExpr),
B=b.eval(this.endExpr);/^(\(|\[)expr(\)|\])$/i.test(this.initExpr.type)&&/^(\(|\[)expr(\)|\])$/i.test(this.endExpr.type)?(m=k[0][0],l=k[0][1],x=B[0][0],w=B[0][1],this.vectors?this.abs_coord&&(l=-l,w=-w):this.abs_coord?(m-=this.exprX,l=-l+this.exprY,x-=this.exprX,w=-w+this.exprY):(m-=this.exprX,l-=this.exprY,x-=this.exprX,w-=this.exprY),z=0==m?0>l?3*h:h:r(1*m/n(m*m+l*l)),A=0==x?0>w?3*h:h:r(1*x/n(x*x+w*w)),z+=d,A+=d,0<m&&0<l&&this.abs_coord&&(z=p-z),0<m&&0>l&&!this.abs_coord&&(z=p-z),0>m&&0>l&&!this.abs_coord&&
(z=p-z),0>m&&0<l&&this.abs_coord&&(z=p-z),0<x&&0<w&&this.abs_coord&&(A=p-A),0<x&&0>w&&!this.abs_coord&&(A=p-A),0>x&&0>w&&!this.abs_coord&&(A=p-A),0>x&&0<w&&this.abs_coord&&(A=p-A),this.initFlag?(G=z,z=A,A=G):(G=e(z,A),J=f(z,A),z=G,A=J,A-z>c&&this.abs_coord&&(z=J,A=G),A-z<=c&&!this.abs_coord&&(z=J,A=G)),this.iniAng=z,this.endAng=A,this.drawPoints=!0):(this.iniAng=a.degToRad(k)+d,this.endAng=a.degToRad(B)+d,this.drawAngle=!0)};M.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.fill,
this.color)};M.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.fill,this.trace)};M.prototype.drawAux=function(a,d,c){b=this.evaluator;E=this.space;B=b.eval(this.radius);0>B&&(B=0);I=k(b.eval(this.width));a.lineWidth=0<I?I:1E-6;a.lineCap="round";a.strokeStyle=c.getColor();this.drawAngle?(this.abs_coord?(F=k(this.exprX),D=k(this.exprY)):(F=k(E.getAbsoluteX(this.exprX)),D=k(E.getAbsoluteY(this.exprY)),B*=E.scale,this.iniAng=-this.iniAng,this.endAng=-this.endAng),this.iniAng>
this.endAng&&(L=this.iniAng,this.iniAng=this.endAng,this.endAng=L)):this.drawPoints&&(this.abs_coord?(F=k(this.exprX),D=k(this.exprY)):(F=k(E.getAbsoluteX(this.exprX)),D=k(E.getAbsoluteY(this.exprY)),B*=E.scale,this.iniAng=-this.iniAng,this.endAng=-this.endAng));this.fill&&(a.fillStyle=d.getColor(),a.beginPath(),a.moveTo(F,D),a.arc(F,D,B,this.iniAng,this.endAng,void 0),a.fill());a.beginPath();a.arc(F,D,B,this.iniAng,this.endAng,void 0);this.dashStyle();a.stroke();this.text.hasContent&&this.text.draw(a,
this.color,F,D)};a.Arc=M;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c=function(c,f){f=a.Graphic.call(this,c,f)||this;f.width=f.width||c.evaluator.parser.parse("0");f.align||(f.align="left");f.anchor||(f.anchor="top_left");f.shadowColor=f.shadowColor?f.shadowColor.getColor():"transparent";f.text=new a.TextObject(f,f.text);return f};$jscomp.inherits(c,a.Graphic);c.prototype.update=function(){k=this.evaluator;e=k.eval(this.expresion);this.exprX=e[0][0];this.exprY=e[0][1];this.rotateExp&&(f=this.rotate(e[0][0],
e[0][1],a.degToRad(k.eval(this.rotateExp))),this.exprX=f.x,this.exprY=f.y)};c.prototype.draw=function(){a.Graphic.prototype.draw.call(this,this.color)};c.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this,this.trace)};c.prototype.drawAux=function(a,c){this.abs_coord?(r=parseInt(this.exprX),n=parseInt(this.exprY)):(r=parseInt(this.space.getAbsoluteX(this.exprX)),n=parseInt(this.space.getAbsoluteY(this.exprY)));this.text.draw(a,c,r,n)};a.Text=c;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.round,e,f,r,n,c,h,p,b,g,d,v,q=function(b,d){d=a.Graphic.call(this,b,d)||this;d.file=d.file||"";d.inirot=d.inirot||b.evaluator.parser.parse("0");d.img=new Image;d.scaleX=d.scaleY=1;d.ratio=b.ratio;b=d.expresion.getChildren();d.x_e=b[0];d.y_e=b[1];2<b.length&&(d.centered=!0,d.s_x_e=b[2],d.s_y_e=3<b.length?b[3]:b[2]);d.evaluator.eval(d.clip)&&(d.clip=d.clip.getChildren());d.update();return d};$jscomp.inherits(q,a.Graphic);q.prototype.update=function(){e=
this.evaluator;var b=e.eval(this.x_e),d=e.eval(this.y_e);this.exprX=b;this.exprY=d;this.rotateExp&&(f=this.rotate(b,d,a.degToRad(e.eval(this.rotateExp))),this.exprX=f.x,this.exprY=f.y);this.centered&&(this.scaleX=e.eval(this.s_x_e),this.scaleY=e.eval(this.s_y_e),0==this.scaleX&&(this.scaleX=1E-5),0==this.scaleY&&(this.scaleY=1E-5));var c=this;if((r=e.eval(this.file))||""==r)this.img=this.parent.getImage(r),this.img.addEventListener("load",function(a){c.space.update(!0)})};q.prototype.draw=function(){a.Graphic.prototype.draw.call(this)};
q.prototype.drawTrace=function(){a.Graphic.prototype.drawTrace.call(this)};q.prototype.drawAux=function(f){e=this.evaluator;n=this.space;this.img&&this.img.ready&&this.img.complete&&(this.clip?(d=e.eval(this.clip[2]),v=e.eval(this.clip[3])):(d=this.img.width,v=this.img.height),this.img.canvas&&(d=k(d/this.ratio),v=k(v/this.ratio)),c=this.centered?0:k(d/2),h=this.centered?0:k(v/2),p=k(this.abs_coord?this.exprX:n.getAbsoluteX(this.exprX)),b=k(this.abs_coord?this.exprY:n.getAbsoluteY(this.exprY)),g=
a.degToRad(-e.eval(this.inirot)),f.save(),f.translate(p+c,b+h),f.rotate(g),this.opacity&&(f.globalAlpha=e.eval(this.opacity)),f.scale(this.scaleX,this.scaleY),this.clip?f.drawImage(this.img,e.eval(this.clip[0]),e.eval(this.clip[1]),d,v,-d/2,-v/2,d,v):f.drawImage(this.img,-d/2,-v/2,d,v),f.restore())};a.Image=q;return a}(descartesJS||{});
descartesJS=function(a){function k(a,b,c){p=4*(b+c*a.width);return{r:a.data[p],g:a.data[p+1],b:a.data[p+2],a:a.data[p+3]}}if(a.loadLib)return a;var e,f,r,n,c,h,p,b,g=function(b,c){return a.Graphic.call(this,b,c)||this};$jscomp.inherits(g,a.Graphic);g.prototype.update=function(){e=this.evaluator.eval(this.expresion);this.exprX=e[0][0];this.exprY=e[0][1]};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,g){g.getColor();imageData=a.getImageData(0,0,this.space.w,this.space.h);this.abs_coord?(f=parseInt(this.exprX),r=parseInt(this.exprY)):(f=parseInt(this.space.getAbsoluteX(this.exprX)),r=parseInt(this.space.getAbsoluteY(this.exprY)));if(!(0>f||0>r||f>=this.space.w||r>=this.space.h)){n=[[f,r]];h=k(imageData,f,r);for(b=0;0<n.length;){b++;c=n.pop();f=c[0];r=c[1];var d=k(imageData,f,r);if(h.r===d.r&&h.g===d.g&&h.b===d.b&&h.a===d.a){d=imageData;var e=
g;p=4*(f+r*d.width);d.data[p+0]=e.r;d.data[p+1]=e.g;d.data[p+2]=e.b;d.data[p+3]=255*e.a;0<f&&n.push([f-1,r]);f<imageData.width-1&&n.push([f+1,r]);n.push([f,r-1]);n.push([f,r+1])}if(b>=this.space.w*this.space.h*3)break}a.putImageData(imageData,0,0)}};a.Fill=g;return a}(descartesJS||{});
descartesJS=function(a,k){if(a.loadLib)return a;var e=new String("-text-image-point-polygon-arc-segment-arrow-macro-curve-equation-sequence-rectangle-fill-"),f=/[\w\.\-//]*(\.png|\.jpg|\.gif|\.svg)/gi,r,n=function(c,h){var p=a.Graphic.call(this,c,h)||this;p.hasExpresion=p.hasExpresion||!1;p.inirot=p.inirot||c.evaluator.parser.parse("0");p.inipos=p.inipos||c.evaluator.parser.parse("(0,0)");Object.assign(p,h);p.hasExpresion=void 0!==p.expresion;p.graphics=[];c=c.lessonParser;var b=new a.Tokenizer;if(!p.hasExpresion)return p;
"'"!==p.expresion.charAt(0)&&(p.expresion="'"+p.expresion+"'");p.expresion=p.evaluator.parser.parse(p.expresion);h=p.evaluator.eval(p.expresion);if(h)var g=(g=document.getElementById(h))&&"descartes/macro"==g.type?g.text:a.openExternalFile(h);if(g){var d=a.convertHTMLEntities(g).replace(/\r/g,"").split("\n");g=[];h=0;for(var n=d.length;h<n;h++)if(d[h].trim()){var q=d[h].indexOf("=");if(-1!==q){q=c.split(d[h]);for(var u=0,r=q.length;u<r;u++)if(q[u]&&1<q.length&&("id"===k[q[u][0]]||"type"===k[q[u][0]])){g.push(q);
break}}}u=function(d,c){c=b.tokenize(c.replace(/&squot;/g,"'"));for(var g=0,l=c.length;g<l;g++)if("identifier"==c[g].type&&!a.reservedIds.match("-"+c[g].value+"-")||"R"===c[g].value||"G"===c[g].value||"B"===c[g].value)c[g].value=p.name+"."+c[g].value;return(d.match(/^\\expr/)?"\\expr ":"\\decimals ")+b.flatTokens(c)};h=0;for(n=g.length;h<n;h++){var m=(r=g[h]||[],r[0])&&"id"===r[0][0];d=0;for(q=r.length;d<q;d++){var l=r[d][0].indexOf(".");-1===l||m?l=k[r[d][0]]:(l=k[r[d][0].substring(l+1)],r[d][0]=
p.name+"."+r[d][0]);if(!("font"===l||"font_family"===l||("fill"===l||"color"===l||"border"===l||"arrow"===l)&&"("!==r[d][1].charAt(0)||"file"===l&&r[d][1].match(f)||"id"!==l&&void 0!==k[r[d][1]])||"radius"===l)if("text"==l)if(r[d][1].match(/\{\\rtf1/))l=r[d][1],l=l.replace(/\\expr ([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,u),l=l.replace(/\\decimals ([a-zA-Z_0-9\u00C0-\u021B+*/%|&^#!?:()><.'\+\-]*)/gi,u),r[d][1]=l;else{var x=c.parseText(r[d][1]).textElementsMacros;for(var w=0,z=x.length;w<
z;w++){l=b.tokenize(x[w].replace(/&squot;/g,"'"));for(var A=0,G=l.length;A<G;A++)if("identifier"===l[A].type&&!a.reservedIds.match("-"+l[A].value+"-")||"R"===l[A].value||"G"===l[A].value||"B"===l[A].value)l[A].value=p.name+"."+l[A].value;l=b.flatTokens(l).replace(/&squot;/g,"'").replace(/'\+\(/g,"[").replace(/\)\+'/g,"]");x[w]=l.substring(1,l.length-1)}r[d][1]=x.join("")}else{x=r[d][1].replace(/&squot;/g,"'").split(";");w=0;for(z=x.length;w<z;w++){l=b.tokenize(x[w].replace(/\\n/g,";"));A=0;for(G=
l.length;A<G;A++)if("identifier"===l[A].type&&!a.reservedIds.match("-"+l[A].value+"-")||"R"===l[A].value||"G"===l[A].value||"B"===l[A].value)l[A].value=p.name+"."+l[A].value;x[w]=b.flatTokens(l)}r[d][1]=x.join(";")}}}h=0;for(n=g.length;h<n;h++)if(g[h][0]){u="";r=!1;d=0;for(q=g[h].length;d<q;d++)"type"===k[g[h][d][0]]&&e.match("-"+k[g[h][d][1]]+"-")&&(r=!0),u=u+g[h][d][0]+"='"+g[h][d][1]+"' ";g[h]=u+(r?" space='"+p.spaceID+"'":"");r?p.graphics.push(c.parseGraphic(g[h],p.abs_coord,p.background,p.inirot)):
c.parseAuxiliar(g[h])}}return p};$jscomp.inherits(n,a.Graphic);n.prototype.update=function(){r=this.evaluator.eval(this.inipos);this.iniPosX=r[0][0];this.iniPosY=r[0][1]};n.prototype.drawAux=function(a){for(var c=0,f=this.graphics.length;c<f;c++)this.graphics[c]&&(a.save(),this.graphics[c].abs_coord?a.translate(this.iniPosX,this.iniPosY):a.translate(this.iniPosX*this.space.scale,-this.iniPosY*this.space.scale),this.graphics[c].draw(),a.restore())};a.Macro=n;return a}(descartesJS||{},babel);
descartesJS=function(a){if(a.loadLib)return a;var k=Math.sqrt,e=Math.sin,f=Math.cos,r=Math.abs,n,c,h,p,b,g,d,v,q,u,y,m,l,x,w,z=function(a,b,d,c){this.x=a||0;this.y=b||0;this.z=d||0;this.w=c||0;this.adjustDec()};z.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,b,d,c,g,l,f,q,h,e,k,p,m,n,u,v){this.a00=a||0;this.a01=b||0;this.a02=d||0;this.a03=c||0;this.a10=g||0;this.a11=l||0;this.a12=f||0;this.a13=q||0;
this.a20=h||0;this.a21=e||0;this.a22=k||0;this.a23=p||0;this.a30=m||0;this.a31=n||0;this.a32=u||0;this.a33=v||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 z(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){c=e(a);h=f(a);v=this.a10;q=this.a11;u=this.a12;
y=this.a13;m=this.a20;l=this.a21;x=this.a22;w=this.a23;return new A(this.a00,this.a01,this.a02,this.a03,v*h+m*c,q*h+l*c,u*h+x*c,y*h+w*c,v*-c+m*h,q*-c+l*h,u*-c+x*h,y*-c+w*h,this.a30,this.a31,this.a32,this.a33)};A.prototype.rotateY=function(a){c=e(a);h=f(a);p=this.a00;b=this.a01;g=this.a02;d=this.a03;m=this.a20;l=this.a21;x=this.a22;w=this.a23;return new A(p*h+m*-c,b*h+l*-c,g*h+x*-c,d*h+w*-c,this.a10,this.a11,this.a12,this.a13,p*c+m*h,b*c+l*h,g*c+x*h,d*c+w*h,this.a30,this.a31,this.a32,this.a33)};A.prototype.rotateZ=
function(a){c=e(a);h=f(a);p=this.a00;b=this.a01;g=this.a02;d=this.a03;v=this.a10;q=this.a11;u=this.a12;y=this.a13;return new A(p*h+v*c,b*h+q*c,g*h+u*c,d*h+y*c,p*-c+v*h,b*-c+q*h,g*-c+u*h,d*-c+y*h,this.a20,this.a21,this.a22,this.a23,this.a30,this.a31,this.a32,this.a33)};a.norm3D=function(a){return k(a.x*a.x+a.y*a.y+a.z*a.z)};a.normalize3D=function(b){n=a.norm3D(b);if(0===n)return{x:0,y:0,z:0};if(1===n)return{x:b.x,y:b.y,z:b.z};n=1/n;return{x:b.x*n,y:b.y*n,z:b.z*n}};a.dotProduct3D=function(a,b){return a.x*
b.x+a.y*b.y+a.z*b.z};a.crossProduct3D=function(a,b){return{x:a.y*b.z-a.z*b.y,y:a.z*b.x-a.x*b.z,z:a.x*b.y-a.y*b.x}};a.scalarProduct3D=function(a,b){return{x:a.x*b,y:a.y*b,z:a.z*b}};a.subtract3D=function(a,b){return{x:a.x-b.x,y:a.y-b.y,z:a.z-b.z}};a.add3D=function(a,b){return{x:a.x+b.x,y:a.y+b.y,z:a.z+b.z}};a.equals3DEpsilon=function(a,b,d){return r(a.x-b.x)<=d&&r(a.y-b.y)<=d&&r(a.z-b.z)<=d};a.Vector4D=z;a.Matrix4x4=A;return a}(descartesJS||{});
descartesJS=function(a){function k(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,c),a.fill(),a.stroke())}function e(a,b){a.textNode=null;a.lineCap=h;a.lineJoin=lineJoin;a.lineWidth=.4;a.beginPath();a.moveTo(this.projVert[0].x,this.projVert[0].y);q=1;for(u=this.projVert.length;q<u;q++)a.lineTo(this.projVert[q].x,this.projVert[q].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=b.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 f(a){a.textNode=null;a.oldTextNode=
"_a1b2c3_";d=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,d)}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 n(b,d,c){return a.normalize3D(a.crossProduct3D(a.subtract3D(b,
d),a.subtract3D(b,c)))}if(a.loadLib)return a;var c=2*Math.PI,h=lineJoin="round",p,b,g,d,v,q,u,y,m,l,x,w,z,A=function(a,b){Object.assign(this,a);this.space=b;this.projVert=[];this.spaceVertices=[];this.newProjVert=[];this.newSpaceVert=[];"vertex"===this.type?this.draw=k:"face"===this.type?(this.normal=n(this.vertices[0],this.vertices[1],this.vertices[2]),this.draw=e):"text"===this.type?this.draw=f:"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(b){this.space=b;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};q=0;for(u=this.vertices.length;q<u;q++)this.spaceVertices[q]=b.rotateVertex(this.vertices[q]),this.average.x+=this.spaceVertices[q].x,this.average.y+=this.spaceVertices[q].y,this.average.z+=this.spaceVertices[q].z;this.average=a.scalarProduct3D(this.average,
1/u);this.average_proy=b.project(this.average);this.depth=a.norm3D(a.subtract3D(b.eye,this.average));2<this.vertices.length&&(this.normal=n(this.spaceVertices[0],this.spaceVertices[1],this.spaceVertices[2]));q=0;for(u=this.vertices.length;q<u;q++)this.newSpaceVert[q]=this.spaceVertices[q],this.projVert[q]=this.newProjVert[q]=b.project(this.spaceVertices[q]);2<this.vertices.length&&(this.direction=n(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;q=0;for(u=this.vertices.length;q<u;q++)y=a.norm3D(a.subtract3D(this.spaceVertices[q],b.eye)),this.minDistanceToEye=Math.min(this.minDistanceToEye,y),this.maxDistanceToEye=Math.max(this.maxDistanceToEye,y);q=0;for(u=this.vertices.length;q<u;q++)this.minx>this.projVert[q].x&&(this.minx=this.projVert[q].x),this.maxx<this.projVert[q].x&&(this.maxx=this.projVert[q].x),this.miny>this.projVert[q].y&&(this.miny=this.projVert[q].y),
this.maxy<this.projVert[q].y&&(this.maxy=this.projVert[q].y)};A.prototype.removeDoubles=function(){if("edge"!==this.type){v=[];q=0;for(u=this.vertices.length;q<u;q++)(1E-8<Math.abs(this.vertices[q].x-this.vertices[(q+1)%u].x)||1E-8<Math.abs(this.vertices[q].y-this.vertices[(q+1)%u].y)||1E-8<Math.abs(this.vertices[q].z-this.vertices[(q+1)%u].z)||1E-8<Math.abs(this.vertices[q].w-this.vertices[(q+1)%u].w))&&v.push(this.vertices[q]);0===v.length&&v.push(this.vertices[0]);this.vertices=v}};A.prototype.drawText=
function(d,c,l,f,q,h,e,k,m,n,u){p=this.evaluator;d.textNode=c;h=p.eval(this.offset_dist);e=-a.degToRad(p.eval(this.offset_angle));l+=h*Math.cos(e);f+=h*Math.sin(e);d.textNode.pos={x:l,y:f};c.hasContent&&(c.draw(d,q,l,f,!0),g=this.fromPoint?c.textNodes.metrics.w/2:0,b=this.fromPoint?c.textNodes.metrics.h/2:0,c.draw(d,q,l-g,f-b))};A.prototype.splitFace=function(b){if(this.intersects(b)){var d=i2=null,c=ix2=0,g,l;var f=this.vertices;var q=b.vertices;var h=0;for(l=q.length;h<l;h++){var e=this.intersection(q[h],
q[(h+1)%l]);if(null!==e)if(null===d){if(d=e,c=h,2===q.length){i2=d;break}}else if(!a.equals3DEpsilon(e,d,1E-8)){i2=e;ix2=h;break}}if(null!==d&&null!==i2){h=this.isInterior(d)||this.isInterior(i2);var k=g=null;if(!h&&3<=q.length)for(l=0,f=f.length;l<f;l++)if(e=b.intersection(this.vertices[l],this.vertices[(l+1)%f]),null!==e)if(null===g)g=e;else if(!a.equals3DEpsilon(e,g,1E-8)){k=e;break}if(h||null!==g&&null!==k&&b.isInterior(g)&&b.isInterior(k)){k=!0;f=e=null;if(2===q.length)a.equals3DEpsilon(d,q[0],
1E-8)||a.equals3DEpsilon(d,q[1],1E-8)?k=!1:(e=[],e[0]=q[0],e[1]=d,f=[],f[0]=d,f[1]=q[1]);else for(e=[],f=[],h=l=g=0;h<q.length;h++)h<c?e[g++]=q[h]:h==c?(e[g++]=q[h],e[g++]=d,f[l++]=d):h<ix2?f[l++]=q[h]:h==ix2?(f[l++]=q[h],f[l++]=i2,e[g++]=i2):e[g++]=q[h];if(k){d=[];d[0]=new A({vertices:e,type:"face",frontColor:b.frontColor,backColor:b.backColor,edges:b.edges,model:b.model},this.space);d[0].removeDoubles();d[0].normal=b.normal;d[1]=new A({vertices:f,type:"face",frontColor:b.frontColor,backColor:b.backColor,
edges:b.edges,model:b.model},this.space);d[1].removeDoubles();d[1].normal=b.normal;if(2<d[0].vertices.length)return 2<d[1].vertices.length?d:[d[0]];if(2<d[1].vertices.length)return[d[1]]}}}}return[b]};A.prototype.intersects=function(a){return this.intersectsPlane(a)&&a.intersectsPlane(this)};A.prototype.intersectsPlane=function(b){var d=this.vertices;var c=b.vertices;if(0<d.length){var g=a.dotProduct3D(c[0],b.normal);var l=a.dotProduct3D(d[0],b.normal);if(1E-8>Math.abs(g-l))return!0;for(var f=1,h=
d.length;f<h;f++)if(c=a.dotProduct3D(d[f],b.normal),1E-8>Math.abs(g-c)||c>g&&l<g||c<g&&l>g)return!0}return!1};A.prototype.intersection=function(b,d){var c=this.vertices;if(0<c.length){d=a.subtract3D(d,b);var g=a.dotProduct3D(d,this.normal);if(0!==g&&(c=a.dotProduct3D(a.subtract3D(c[0],b),this.normal)/g,-1E-8<c&&1.00000001>c))return a.add3D(b,a.scalarProduct3D(d,c))}return null};A.prototype.isInterior=function(b){var d=this.vertices;if(0<d.length)for(var c=0,g=a.subtract3D(d[0],b),l=0,f=d.length;l<
f;l++){var h=a.subtract3D(d[(l+1)%f],b),q=a.dotProduct3D(a.crossProduct3D(g,h),this.normal);if(1E-8>Math.abs(q)){if(0>a.dotProduct3D(g,h))break}else{if(0>c&&0<q||0<c&&0>q)return!1;g=h;c=q}}return!0};A.prototype.inFrontOf=function(a,b,d){if(this.minDistanceToEye>=b.maxDistanceToEye||this.maxx<=b.minx||this.minx>=b.maxx||this.maxy<=b.miny||this.miny>=b.maxy)return!1;for(w=0;3>w;w++)if(m=null,m=0===w?this.intersections(b):1===w?b.verticesContainedIn(this):this.verticesContainedIn(b),null!=m&&0<m.length){for(z=
0;z<m.length;z++)a.push(m[z]);q=0;for(u=m.length;q<u;q++){l=m[q];x=this.space.rayFromEye(l.x,l.y);try{t=this.distanceToEyeAlong(x)-b.distanceToEyeAlong(x);if(t<=-d)return!0;if(t>=d)return!1}catch(F){}}}return!1};A.prototype.intersections=function(b){for(var d=[],c,g,l,f=new a.R2,h=this.newSpaceVert,q=b.newSpaceVert,e=this.newProjVert,k=b.newProjVert,p=0,m=h.length;p<m;p++){b=h[p];c=h[(p+1)%m];for(var n=0,u=q.length;n<u;n++)g=q[n],l=q[(n+1)%u],b!=g&&b!=l&&c!=g&&c!=l&&(g=f.intersection(e[p],e[(p+1)%
m],k[n],k[(n+1)%u]),null!=g&&d.push(g))}return d};A.prototype.distanceToEyeAlong=function(b){b=a.dotProduct3D(this.normal,b);if(1E-6<Math.abs(b))return a.dotProduct3D(a.subtract3D(this.average,this.space.eye),this.normal)/b;throw new Exception("Face is invisible");};A.prototype.verticesContainedIn=function(a){for(var b=[],d=this.newSpaceVert,c=this.newProjVert,g=0,l=d.length;g<l;g++)!a.isVertex(d[g])&&a.appearsToContain(c[g])&&b.push(c[g]);return b};A.prototype.appearsToContain=function(a){for(var b=
0,d,c=this.newProjVert,g=0,l=this.newSpaceVert.length;g<l;g++){d=(c[g].x-a.x)*(c[(g+1)%l].y-a.y)-(c[(g+1)%l].x-a.x)*(c[g].y-a.y);if(0!=b)if(1E-8>Math.abs(d)){if(1E-8<Math.abs(c[g].x-c[(g+1)%l].x))return Math.min(c[g].x,c[(g+1)%l].x)<=a.x+1E-8&&a.x<=Math.max(c[g].x,c[(g+1)%l].x)+1E-8;if(1E-8<Math.abs(c[g].y-c[(g+1)%l].y))return Math.min(c[g].y,c[(g+1)%l].y)<=a.y+1E-8&&a.y<=Math.max(c[g].y,c[(g+1)%l].y)+1E-8}else if(0<b&&0>d||0>b&&0<d)return!1;b=d}return!0};A.prototype.isVertex=function(b){for(var d=
this.newSpaceVert,c=0,g=d.length;c<g;c++)if(a.equals3DEpsilon(b,d[c],1E-8))return!0;return!1};a.Primitive3D=A;return a}(descartesJS||{});
descartesJS=function(a){function k(a){for(var b=[],d=0,c,g=a.length,f=a.length-1;-1<f;f--)c=a.charAt(f),0==d?"="==c&&(d=1):1==d?" "!=c&&(d="<"===c||">"===c?0:2):2==d&&" "==c&&(b.unshift(a.substring(f+1,g)),g=f,d=0);b.unshift(a.substring(0,g));return b}if(a.loadLib)return a;var e={x:0,y:0,z:0},f,r,n,c,h,p=a.degToRad,b,g=function(b,c){this.parent=b;this.evaluator=b.evaluator;var d=b.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="SansSerif,PLAIN,18";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,c);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=b.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};g.prototype.getSpace=function(){for(var a=this.parent.spaces,b,c=0,
g=a.length;c<g;c++)if(b=a[c],b.id==this.spaceID)return b;return a[0]};g.prototype.getFamilyValues=function(){f=this.evaluator;r=f.eval(this.family_interval);this.familyInf=r[0][0];this.familySup=r[0][1];this.fSteps=Math.round(f.eval(this.family_steps));this.family_sep=0<this.fSteps?(this.familySup-this.familyInf)/this.fSteps:0};g.prototype.buildFamilyPrimitives=function(){f=this.evaluator;this.getFamilyValues();n=f.getVariable(this.family);if(0<=this.fSteps)for(var a=0,b=this.fSteps;a<=b;a++)f.setVariable(this.family,
this.familyInf+a*this.family_sep),this.familyValue=this.familyInf+a*this.family_sep,f.eval(this.drawif)&&this.buildPrimitives();f.setVariable(this.family,n)};g.prototype.update=function(){this.primitives=[];this.evaluator.eval(this.drawif)&&(this.family||this.buildPrimitives());this.family&&this.buildFamilyPrimitives()};g.prototype.updateMVMatrix=function(){c=this.evaluator.eval(this.inirot);this.inirotEuler?(this.inirotM=this.inirotM.setIdentity(),this.inirotM=this.inirotM.rotateZ(p(c[0][0])),this.inirotM=
this.inirotM.rotateX(p(c[0][1])),this.inirotM=this.inirotM.rotateZ(p(c[0][2]))):(this.inirotM_X=this.inirotM_X.setIdentity().rotateX(p(c[0][0])),this.inirotM_Y=this.inirotM_Y.setIdentity().rotateY(p(c[0][1])),this.inirotM_Z=this.inirotM_Z.setIdentity().rotateZ(p(c[0][2])));c=this.evaluator.eval(this.inipos);e={x:c[0][0],y:c[0][1],z:c[0][2]};this.iniposM=this.iniposM.setIdentity().translate(e);c=this.evaluator.eval(this.endrot);this.endrotEuler?(this.endrotM=this.endrotM.setIdentity(),this.endrotM=
this.endrotM.rotateZ(p(c[0][0])),this.endrotM=this.endrotM.rotateX(p(c[0][1])),this.endrotM=this.endrotM.rotateZ(p(c[0][2]))):(this.endrotM_X=this.endrotM_X.setIdentity().rotateX(p(c[0][0])),this.endrotM_Y=this.endrotM_Y.setIdentity().rotateY(p(c[0][1])),this.endrotM_Z=this.endrotM_Z.setIdentity().rotateZ(p(c[0][2])));c=this.evaluator.eval(this.endpos);e={x:c[0][0],y:c[0][1],z:c[0][2]};this.endposM=this.endposM.setIdentity().translate(e)};g.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};g.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)};g.prototype.parseExpression=function(){for(var a=this.expresion.split(";"),
b=[],c=0,g=a.length;c<g;c++)""!==a[c].trim()&&(b=b.concat(k(a[c])));c=0;for(g=b.length;c<g;c++)b[c]=this.evaluator.parser.parse(b[c],!0);return b};g.prototype.splitFace=function(a){for(var d=0,c=this.primitives.length;d<c;d++)if(b=[],"face"===this.primitives[d].type){for(var g=0,f=a.primitives.length;g<f;g++)"face"===a.primitives[g].type?b=b.concat(this.primitives[d].splitFace(a.primitives[g])):b.push(a.primitives[g]);a.primitives=b}};a.Graphic3D=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c=function(c,f){return a.Graphic3D.call(this,c,f)||this};$jscomp.inherits(c,a.Graphic3D);c.prototype.buildPrimitives=function(){k=this.evaluator;this.updateMVMatrix();e=k.eval(this.expresion);f=e[0][0];r=e[0][1];n=e[0][2];this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(f,r,n,1))],type:"vertex",backColor:this.backcolor.getColor(),frontColor:this.color.getColor(),size:k.eval(this.width)}));""!==this.text&&
(this.offset_dist=this.offset_dist||k.parser.parse("10"),this.offset_angle=this.offset_angle||k.parser.parse("270"),this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(f,r,n,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:k.eval(this.decimals),fixed:this.fixed,evaluator:k,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=c;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h,p,b,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(){p=this.evaluator;this.updateMVMatrix();h=p.getVariable("u");p.setVariable("u",this.Nu);b=p.eval(this.expresion);k=b[0][0];e=b[0][1];f=b[0][2];r=b[1][0];n=b[1][1];c=b[1][2];this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(k,
e,f,1)),this.transformVertex(new a.Vector4D(r,n,c,1))],type:"edge",lineDash:this.lineDash,frontColor:this.color.getColor(),lineWidth:p.eval(this.width)},this.space));p.setVariable("u",h)};a.Segment3D=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h,p,b,g,d,v,q,u,y=function(b,d){d=a.Graphic3D.call(this,b,d)||this;d.parameter=d.parameter||"t";d.parameter_interval=d.parameter_interval||b.evaluator.parser.parse("[0,1]");d.parameter_steps=d.parameter_steps||b.evaluator.parser.parse("8");d.expresion=d.parseExpression();return d};$jscomp.inherits(y,a.Graphic3D);y.prototype.buildPrimitives=function(){k=this.evaluator;this.updateMVMatrix();r=k.getVariable("x");n=k.getVariable("y");c=k.getVariable("z");
e=k.getVariable("u");f=k.getVariable("v");k.setVariable("u",0);k.setVariable("v",0);h=parseInt(k.eval(this.Nu));p=parseInt(k.eval(this.Nv));b=[];for(d=0;d<=h;d++)for(k.setVariable("u",d/h),v=0;v<=p;v++){k.setVariable("v",v/p);q=0;for(u=this.expresion.length;q<u;q++)k.eval(this.expresion[q]);b.push(this.transformVertex(new a.Vector4D(k.getVariable("x"),k.getVariable("y"),k.getVariable("z"),1)))}var m=this.color.getColor(),l=this.backcolor.getColor(),x=this.edges?this.edges.getColor():"";for(d=0;d<
h;d++)for(v=0;v<p;v++)g=[],g.push(b[v+d*p+d]),g.push(b[v+1+d*p+d]),g.push(b[v+2+(d+1)*p+d]),g.push(b[v+1+(d+1)*p+d]),this.primitives.push(new a.Primitive3D({vertices:g,type:"face",frontColor:m,backColor:l,edges:x,model:this.model},this.space));k.setVariable("x",r);k.setVariable("y",n);k.setVariable("z",c);k.setVariable("u",e);k.setVariable("v",f)};a.Surface3D=y;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h,p,b=function(b,d){d=a.Graphic3D.call(this,b,d)||this;d.width=d.width||b.evaluator.parser.parse("1");return d};$jscomp.inherits(b,a.Graphic3D);b.prototype.buildPrimitives=function(){h=this.evaluator;this.updateMVMatrix();p=h.eval(this.expresion);for(var b=this.color.getColor(),d=0,v=p.length-1;d<v;d++)k=p[d][0],e=p[d][1],f=p[d][2],r=p[d+1][0],n=p[d+1][1],c=p[d+1][2],this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(k,
e,f,1)),this.transformVertex(new a.Vector4D(r,n,c,1))],type:"edge",frontColor:b,lineWidth:h.eval(this.width)},this.space))};a.Polygon3D=b;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h,p=function(b,c){c=a.Graphic3D.call(this,b,c)||this;c.width=c.width||b.evaluator.parser.parse("1");c.expresion=c.parseExpression();return c};$jscomp.inherits(p,a.Graphic3D);p.prototype.buildPrimitives=function(){h=this.evaluator;this.updateMVMatrix();r=h.getVariable("x");n=h.getVariable("y");c=h.getVariable("z");f=h.getVariable("u");h.setVariable("u",0);e=h.eval(this.Nu);k=[];for(var b=0;b<=e;b++){h.setVariable("u",b/e);for(var g=0,d=
this.expresion.length;g<d;g++)h.eval(this.expresion[g]);k.push(this.transformVertex(new a.Vector4D(h.getVariable("x"),h.getVariable("y"),h.getVariable("z"),1)))}b=0;for(g=k.length-1;b<g;b++)this.primitives.push(new a.Primitive3D({vertices:[k[b],k[b+1]],type:"edge",frontColor:this.color.getColor(),lineWidth:h.eval(this.width)},this.space));this.fill&&2<k.length&&this.primitives.push(new a.Primitive3D({vertices:k,type:"face",frontColor:this.fill.getColor(),backColor:this.fill.getColor(),edges:"",model:this.model},
this.space));h.setVariable("x",r);h.setVariable("y",c);h.setVariable("z",n);h.setVariable("u",f)};a.Curve3D=p;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h,p,b,g,d,v=function(b,d){return a.Graphic3D.call(this,b,d)||this};$jscomp.inherits(v,a.Graphic3D);v.prototype.buildPrimitives=function(){g=this.evaluator;this.updateMVMatrix();d=g.eval(this.expresion);k=d[0][0];e=d[0][1];f=d[0][2];r=d[1][0];n=d[1][1];c=d[1][2];h=d[2][0];p=d[2][1];b=d[2][2];var q=this.edges?this.edges.getColor():"";this.primitives.push(new a.Primitive3D({vertices:[this.transformVertex(new a.Vector4D(k,e,f,1)),this.transformVertex(new a.Vector4D(h,
p,b,1)),this.transformVertex(new a.Vector4D(r,n,c,1))],type:"face",frontColor:this.color.getColor(),backColor:this.backcolor.getColor(),edges:q,model:this.model},this.space))};a.Triangle3D=v;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r=function(f,c){return a.Graphic3D.call(this,f,c)||this};$jscomp.inherits(r,a.Graphic3D);r.prototype.buildPrimitives=function(){e=this.evaluator;this.updateMVMatrix();f=e.eval(this.expresion);k=[];for(var n=f.length-1;0<=n;n--)k.push(this.transformVertex(new a.Vector4D(f[n][0],f[n][1],f[n][2],1)));n=this.edges?this.edges.getColor():"";this.primitives.push(new a.Primitive3D({vertices:k,type:"face",frontColor:this.color.getColor(),backColor:this.backcolor.getColor(),
edges:n,model:this.model},this.space))};a.Face3D=r;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h=function(c,b){b=a.Graphic3D.call(this,c,b)||this;b.width=b.width||c.evaluator.parser.parse("2");b.length=b.length||c.evaluator.parser.parse("2");return b};$jscomp.inherits(h,a.Graphic3D);h.prototype.buildPrimitives=function(){c=this.evaluator;this.updateMVMatrix();k=c.eval(this.Nu);e=[this.transformVertex(new a.Vector4D(0,0,0,1))];f=c.eval(this.width)/2;r=c.eval(this.length)/2;n=2*Math.PI/k;for(var h=0;h<k;h++)e.push(this.transformVertex(new a.Vector4D(f*
Math.cos(n*h),r*Math.sin(n*h),0,1)));var b=this.color.getColor(),g=this.backcolor.getColor(),d=this.edges?this.edges.getColor():"";for(h=0;h<k;h++)this.primitives.push(new a.Primitive3D({vertices:[e[0],h+2<=k?e[h+2]:e[1],e[h+1]],type:"face",frontColor:b,backColor:g,edges:d,model:this.model},this.space))};a.Polireg3D=h;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n=function(c,f){c=a.Graphic3D.call(this,c,f)||this;c.shadowColor=c.shadowColor?c.shadowColor.getColor():"transparent";return c};$jscomp.inherits(n,a.Graphic3D);n.prototype.buildPrimitives=function(){k=this.evaluator;e=k.eval(this.expresion);f=e[0][0];r=e[0][1];this.primitives.push(new a.Primitive3D({vertices:[new a.Vector4D(f,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:k.eval(this.decimals),fixed:this.fixed,displace:0,isText:!0,evaluator:k,text:new a.TextObject(this,this.text),family:this.family,familyValue:this.familyValue},this.space))};a.Text3D=n;return a}(descartesJS||{});
descartesJS=function(a,k){if(a.loadLib)return a;var e=new String("-point-segment-polygon-curve-triangle-face-polireg-surface-text-cube-box-tetrahedron-octahedron-sphere-dodecahedron-icosahedron-ellipsoid-cone-cylinder-torus-mesh-macro-"),f=/[\w\.\-//]*(\.png|\.jpg|\.gif|\.svg)/gi,r,n,c=0,h=function(h,b){var g=a.Graphic.call(this,h,b)||this;g.expresion=g.expresion||void 0;g.inirot=g.inirot||"(0,0,0)";g.inirotEuler=g.inirotEuler||!1;g.inipos=g.inipos||h.evaluator.parser.parse("(0,0,0)");g.endrot=g.endrot||
"(0,0,0)";g.endrotEuler=g.endrotEuler||!1;g.endpos=g.endpos||h.evaluator.parser.parse("(0,0,0)");g.name=g.name||"_descartes_empty_name_"+c++;Object.assign(g,b);g.inirot.match("Euler")&&(g.inirot=g.inirot.replace("Euler",""),g.inirotEuler=!0);g.endrot.match("Euler")&&(g.endrot=g.endrot.replace("Euler",""),g.endrotEuler=!0);g.inirot=g.evaluator.parser.parse(g.inirot);g.endrot=g.evaluator.parser.parse(g.endrot);g.inirotM=new a.Matrix4x4;g.inirotM_X=new a.Matrix4x4;g.inirotM_Y=new a.Matrix4x4;g.inirotM_Z=
new a.Matrix4x4;g.iniposM=new a.Matrix4x4;g.endrotM=new a.Matrix4x4;g.endrotM_X=new a.Matrix4x4;g.endrotM_Y=new a.Matrix4x4;g.endrotM_Z=new a.Matrix4x4;g.endposM=new a.Matrix4x4;g.graphics=[];h=h.lessonParser;var d=new a.Tokenizer;if(void 0==g.expresion)return g;"'"!==g.expresion.charAt(0)&&(g.expresion="'"+g.expresion+"'");g.expresion=g.evaluator.parser.parse(g.expresion);b=g.evaluator.eval(g.expresion);if(b)var p=(p=document.getElementById(b))&&"descartes/macro"==p.type?p.text:a.openExternalFile(b);
if(p){var q=a.convertHTMLEntities(p).replace(/\r/g,"").split("\n");p=[];b=0;for(var n=q.length;b<n;b++){var r=q[b].indexOf("=");if(-1!==r){r=h.split(q[b]);for(var m=0,l=r.length;m<l;m++)if(r[m]&&1<r.length&&("id"===k[r[m][0]]||"type"===k[r[m][0]])){p.push(r);break}}}b=0;for(n=p.length;b<n;b++){l=(m=p[b]||[],m[0])&&"id"===m[0][0];var x=!1;q=0;for(r=m.length;q<r;q++){var w=m[q][0].indexOf(".");-1===w||l?w=k[m[q][0]]:(w=k[m[q][0].substring(w+1)],m[q][0]=g.name+"."+m[q][0]);"type"===w&&"surface"===k[m[q][1]]&&
(x=!0);if(!("font"===w||"font_family"===w||("fill"===w||"color"===w||"backcolor"===w||"arrow"===w)&&"("!==m[q][1].charAt(0)||"file"===w&&m[q][1].match(f)||"id"!==w&&void 0!==k[m[q][1]]||x&&"expresion"===w)||"width"===w||"height"===w||"length"===w)if("text"==w)if(m[q][1].match(/\{\\rtf1/)){w=m[q][1];var z=g;var A=function(b,c){c=d.tokenize(c.replace(/&squot;/g,"'"));for(var g=0,l=c.length;g<l;g++)if("identifier"==c[g].type&&!a.reservedIds.match("-"+c[g].value+"-")||"R"===c[g].value||"G"===c[g].value||
"B"===c[g].value)c[g].value=z.name+"."+c[g].value;return(b.match(/^\\expr/)?"\\expr ":"\\decimals ")+d.flatTokens(c)};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);m[q][1]=w}else{A=h.parseText(m[q][1]).textElementsMacros;for(var G=0,J=A.length;G<J;G++){w=d.tokenize(A[G].replace(/&squot;/g,"'"));for(var E=0,F=w.length;E<F;E++)if("identifier"===w[E].type&&!a.reservedIds.match("-"+w[E].value+
"-")||"R"===w[E].value||"G"===w[E].value||"B"===w[E].value)w[E].value=g.name+"."+w[E].value;w=d.flatTokens(w).replace(/&squot;/g,"'").replace(/'\+\(/g,"[").replace(/\)\+'/g,"]");A[G]=w.substring(1,w.length-1)}m[q][1]=A.join("")}else{A=m[q][1].replace(/&squot;/g,"'").split(";");G=0;for(J=A.length;G<J;G++){w=d.tokenize(A[G].replace(/\\n/g,";"));E=0;for(F=w.length;E<F;E++)if("identifier"===w[E].type&&!a.reservedIds.match("-"+w[E].value+"-")||"R"===w[E].value||"G"===w[E].value||"B"===w[E].value)w[E].value=
g.name+"."+w[E].value;A[G]=d.flatTokens(w)}m[q][1]=A.join(";")}}}b=0;for(n=p.length;b<n;b++)if(p[b][0]){m="";l=!1;q=0;for(r=p[b].length;q<r;q++)"type"===k[p[b][q][0]]&&e.match("-"+k[p[b][q][1]]+"-")&&(l=!0),m=m+p[b][q][0]+"='"+p[b][q][1]+"' ";p[b]=m+(l?" space='"+g.spaceID+"'":"");l?g.graphics.push(h.parse3DGraphic(p[b],g.abs_coord,g.background,g.inirot)):h.parseAuxiliar(p[b])}}b=0;for(n=g.graphics.length;b<n;b++)g.graphics[b].macroChildren=!0;return g};$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,c=this.fSteps;b<=c;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 c=a+1;c<b;c++)n=this.graphics[c],(n.split||this.split)&&r.splitFace(n);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 k(a,b,d,c,g){e.call(this,a/m,a/m,a/m,c,g)}function e(a,b,d,c,g){a/=2;b/=2;d/=2;this.changeGeometry(a,b,d,c,g)||(this.vertices=[new l(a,d,b,1),new l(a,-d,b,1),new l(a,d,-b,1),new l(a,-d,-b,1),new l(-a,d,b,1),new l(-a,-d,b,1),new l(-a,d,-b,1),new l(-a,-d,-b,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,b,d,c,g))}function f(a,b,d,c,g){a/=2;if(!this.changeGeometry(a,b,d,c,g)){var f=2*Math.PI/3,h=2*a*Math.sqrt(2)/3,e=-a/
3,q=h*Math.cos(f)+0*Math.sin(f);f=-h*Math.sin(f)+0*Math.cos(f);this.vertices=[new l(0,0,a,1),new l(q,f,e,1),new l(q,-f,e,1),new l(h,0,e,1)];this.faces=[[1,3,2],[0,1,2],[0,2,3],[0,3,1]];this.updateValues(a,b,d,c,g)}}function r(a,b,d,c,g){a/=2;this.changeGeometry(a,b,d,c,g)||(this.vertices=[new l(0,0,a,1),new l(a,0,0,1),new l(-a,0,0,1),new l(0,a,0,1),new l(0,-a,0,1),new l(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,b,d,c,g))}function n(b,
d,c,g,f){b/=Math.PI;if(!this.changeGeometry(b,d,c,g,f)){B=b/1.6180339887;L=1.6180339887*b;this.vertices=[new l(b,b,b,1),new l(b,b,-b,1),new l(b,-b,b,1),new l(b,-b,-b,1),new l(-b,b,b,1),new l(-b,b,-b,1),new l(-b,-b,b,1),new l(-b,-b,-b,1),new l(0,B,L,1),new l(0,B,-L,1),new l(0,-B,L,1),new l(0,-B,-L,1),new l(B,L,0,1),new l(B,-L,0,1),new l(-B,L,0,1),new l(-B,-L,0,1),new l(L,0,B,1),new l(L,0,-B,1),new l(-L,0,B,1),new l(-L,0,-B,1)];I=(new a.Matrix4x4).setIdentity().rotateY(-u/6);H=0;for(P=this.vertices.length;H<
P;H++)this.vertices[H]=I.multiplyVector4(this.vertices[H]);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(b,d,c,g,f)}}function c(b,d,c,g,f){b/=3.8;if(!this.changeGeometry(b,d,c,g,f)){L=1.6180339887*b;this.vertices=[new l(0,b,L,1),new l(0,b,-L,1),new l(0,-b,L,1),new l(0,-b,-L,1),new l(b,L,0,1),new l(b,-L,0,1),new l(-b,L,0,1),new l(-b,-L,0,1),
new l(L,0,b,1),new l(L,0,-b,1),new l(-L,0,b,1),new l(-L,0,-b,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]];I=(new a.Matrix4x4).setIdentity().rotateY(-1.0285);H=0;for(P=this.vertices.length;H<P;H++)this.vertices[H]=I.multiplyVector4(this.vertices[H]);this.updateValues(b,d,c,g,f)}}function h(a,b,d,c,g){a/=2;this.isSphere?d=b=a:(b/=2,d/=2);if(!this.changeGeometry(a,
b,d,c,g)){this.vertices=[new l(0,0,b,1)];for(H=1;H<c;H++)for(E=H*u/c,C=0;C<g;C++)J=C*y/g,z=a*v(E)*q(J),A=d*v(E)*v(J),G=b*q(E),this.vertices.push(new l(z,A,G,1));this.vertices.push(new l(0,0,-b,1));this.faces=[];for(H=0;H<g;H++)this.faces.push([0,(H+1)%g+1,H%g+1]);for(H=1;H<c-1;H++)for(C=0;C<g;C++)this.faces.push([C+1+(H-1)*g,(C+1)%g+1+(H-1)*g,(C+1)%g+1+H*g,C+1+H*g]);for(H=0;H<g;H++)this.faces.push([this.vertices.length-1,this.vertices.length-1-g+H,this.vertices.length-1-g+(H+1)%g]);this.updateValues(a,
b,d,c,g)}}function p(a,b,d,c,g){a/=2;b/=2;d/=2;if(!this.changeGeometry(a,b,d,c,g)){this.vertices=[];for(H=0;H<g;H++)for(C=0;C<c;C++)z=a*(g-H)/g*q(C*y/c),A=d*(g-H)/g*v(C*y/c),G=b-2*H*b/g,this.vertices.push(new l(z,A,G,1));this.vertices.push(new l(0,0,-b,1));this.faces=[];for(H=0;H<g-1;H++)for(C=0;C<c;C++)this.faces.push([C+H*c,(C+1)%c+H*c,(C+1)%c+(H+1)*c,C+(H+1)*c]);for(H=0;H<c;H++)this.faces.push([this.vertices.length-1,this.vertices.length-1-c+H,this.vertices.length-1-c+(H+1)%c]);this.updateValues(a,
b,d,c,g)}}function b(a,b,d,c,g){a/=2;b/=2;d/=2;if(!this.changeGeometry(a,b,d,c,g)){this.vertices=[];for(H=0;H<g+1;H++)for(C=0;C<c;C++)z=a*q(C*y/c),A=d*v(C*y/c),G=b-2*H*b/g,this.vertices.push(new l(z,A,G,1));this.faces=[];for(H=0;H<g;H++)for(C=0;C<c;C++)this.faces.push([C+H*c,(C+1)%c+H*c,(C+1)%c+(H+1)*c,C+(H+1)*c]);this.updateValues(a,b,d,c,g)}}function g(a,b,d,c,g){a/=2;b/=2;d/=2;F=x.eval(this.R);D=x.eval(this.r);if(!this.changeGeometry(a,b,d,c,g)){this.vertices=[];for(H=0;H<g+1;H++)for(C=0;C<c;C++)z=
-(F+D*v(y*C/c))*v(y*H/g),A=(F+D*v(y*C/c))*q(y*H/g),G=D*q(y*C/c),this.vertices.push(new l(z,A,G,1));this.faces=[];for(H=0;H<g;H++)for(C=0;C<c;C++)this.faces.push([C+H*c,C+(H+1)*c,(C+1)%c+(H+1)*c,(C+1)%c+H*c]);this.updateValues(a,b,d,c,g)}}function d(){this.vertices=[];this.faces=[];H=0;for(P=this.fileData.length;H<P;H++)M=this.fileData[H],M.match(/^V\(/)?(O=M.substring(2,M.length-1).split(",").map(parseFloats),this.vertices.push(new l(O[0]||0,O[1]||0,O[2]||0,1))):M.match(/^F\(/)&&(O=M.substring(2,
M.length-1).split(",").map(parseInt),this.faces.push(O.reverse()))}if(a.loadLib)return a;var v=Math.sin,q=Math.cos,u=Math.PI,y=2*u,m=Math.sqrt(3),l,x,w,z,A,G,J,E,F,D,B,L,I,M,O,H,P,C,N,K=function(q,m){m=a.Graphic3D.call(this,q,m)||this;m.width=m.width||q.evaluator.parser.parse("2");m.height=m.height||q.evaluator.parser.parse("2");m.length=m.length||q.evaluator.parser.parse("2");m.R=m.R||q.evaluator.parser.parse("2");m.r=m.r||q.evaluator.parser.parse("1");l=a.Vector4D;switch(m.subType){case "cube":m.buildGeometry=
k;break;case "box":m.buildGeometry=e;break;case "tetrahedron":m.buildGeometry=f;break;case "octahedron":m.buildGeometry=r;break;case "sphere":m.isSphere=!0;case "ellipsoid":m.buildGeometry=h;break;case "dodecahedron":m.buildGeometry=n;break;case "icosahedron":m.buildGeometry=c;break;case "cone":m.buildGeometry=p;break;case "cylinder":m.buildGeometry=b;break;case "torus":m.buildGeometry=g;break;case "mesh":m.fileData=a.openExternalFile(m.evaluator.eval(m.file)).split(/\r/),m.buildGeometry=d}return m};
$jscomp.inherits(K,a.Graphic3D);K.prototype.buildPrimitives=function(){x=this.evaluator;this.updateMVMatrix();this.buildGeometry(x.eval(this.width),x.eval(this.height),x.eval(this.length),x.eval(this.Nu),x.eval(this.Nv));var b=this.color.getColor(),d=this.backcolor.getColor(),c=this.edges?this.edges.getColor():"";H=0;for(P=this.faces.length;H<P;H++){w=[];C=0;for(N=this.faces[H].length;C<N;C++)w.push(this.transformVertex(this.vertices[this.faces[H][C]]));this.primitives.push(new a.Primitive3D({vertices:w,
type:"face",frontColor:b,backColor:d,edges:c,model:this.model},this.space))}};K.prototype.changeGeometry=function(a,b,d,c,g){return this.oldWidth===a&&this.oldHeight===b&&this.oldLength===d&&this.oldNu===c&&this.oldNv===g};K.prototype.updateValues=function(a,b,d,c,g){this.oldWidth=a;this.oldHeight=b;this.oldLength=d;this.oldNv=g;this.oldNu=c};a.OtherGeometry3D=K;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.max,e=Math.min,f=Math.PI,r=Math.cos,n=Math.sin,c=Math.abs,h=Math.round,p,b,g,d,v,q,u,y,m,l,x,w,z,A,G,J,E,F,D=function(a,b){this.x=void 0===a?0:a;this.y=void 0===b?0:b};D.prototype.set=function(a,b){this.x=void 0===a?0:a;this.y=void 0===b?0:b;return this};D.prototype.copy=function(){return new D(this.x,this.y)};D.prototype.ix=function(){return h(k(e(this.x,32E3),-32E3))};D.prototype.iy=function(){return h(k(e(this.y,32E3),-32E3))};D.prototype.equals=
function(a){return this.x===a.x&&this.y===a.y};D.prototype.norm2=function(){return this.x*this.x+this.y*this.y};D.prototype.norm=function(){return Math.sqrt(this.norm2())};D.prototype.distance=function(a){b=this.copy();b.sub(a);return b.norm()};D.prototype.dot=function(a){return this.x*a.x+this.y*a.y};D.prototype.det=function(a){return this.x*a.y-this.y*a.x};D.prototype.mul=function(a){this.x*=a;this.y*=a};D.prototype.div=function(a){this.x/=a;this.y/=a};D.prototype.add=function(a){this.x+=a.x;this.y+=
a.y};D.prototype.sub=function(a){this.x-=a.x;this.y-=a.y};D.prototype.normalize=function(){p=this.norm();0!=p&&this.div(p)};D.prototype.rotR90=function(){p=this.x;this.x=this.y;this.y=-p};D.prototype.rotL90=function(){p=this.x;this.x=-this.y;this.y=p};D.prototype.rot=function(a){g=this.copy();q=r(a);u=n(a);this.x=g.x*q-g.y*u;this.y=g.x*u+g.y*q};D.prototype.rot2=function(a){this.rot(a*f/180)};D.prototype.intersection=function(a,b,g,f){y=b.x-a.x;m=g.x-f.x;l=g.x-a.x;x=b.y-a.y;w=g.y-f.y;z=g.y-a.y;F=y*
w-m*x;return 1E-6<c(F)?(d=(l*w-z*m)/F,v=(-l*x+z*y)/F,0<=d&&1>=d&&0<=v&&1>=v?new D(a.x+y*d,a.y+x*d):null):(b.x-g.x)*z!=(b.y-g.y)*l?null:a.x!=b.x?(A=e(a.x,b.x),G=k(a.x,b.x),A<=g.x&&g.x<=G?g:A<=f.x&&f.x<=G?f:null):g.x!=f.x?(J=e(g.x,f.x),E=k(g.x,f.x),J<=a.x&&a.x<=E?a:J<=b.x&&b.x<=E?b:null):a.y!=b.y?(A=e(a.y,b.y),G=k(a.y,b.y),A<=g.y&&g.y<=G?g:A<=f.y&&f.y<=G?f:null):g.y!=f.y?(J=e(g.y,f.y),E=k(g.y,f.y),J<=a.y&&a.y<=E?a:J<=b.y&&b.y<=E?b:null):a.x==g.x&&a.y==g.y?a:null};a.R2=D;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h,p,b,g=function(d,g){this.evaluator=d;this.constraint=g;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];c=
new a.R2(0,0);n=new a.R2(0,0);b=new a.R2(0,0)};g.prototype.getUnitNormal=function(){this.normal.normalize();return b.set(this.normal.x,this.normal.y)};g.prototype.gradient=function(a){k=this.evaluator;c.x=0;c.y=0;h=k.getVariable("x");p=k.getVariable("y");k.setVariable("x",a.x);k.setVariable("y",a.y);this.f0=k.eval(this.constraint);k.setVariable("x",k.getVariable("x")+1E-6);e=k.eval(this.constraint);c.x=(e-this.f0)/1E-6;c.x=isNaN(c.x)?Infinity:c.x;k.setVariable("x",k.getVariable("x")-1E-6);k.setVariable("y",
k.getVariable("y")+1E-6);e=k.eval(this.constraint);c.y=(e-this.f0)/1E-6;c.y=isNaN(c.y)?Infinity:c.y;k.setVariable("x",h);k.setVariable("y",p);return c};g.prototype.findZero=function(a,b,c){k=this.evaluator;n.x=a.x;n.y=a.y;h=k.getVariable("x");p=k.getVariable("y");k.setVariable("x",a.x);k.setVariable("y",a.y);this.f0=k.eval(this.constraint);if("menor"===this.sign&&0>=this.f0||"mayor"===this.sign&&0<=this.f0)return n;k.setVariable("x",h);k.setVariable("y",p);for(var d=0;16>d;d++)if(f=n.x,r=n.y,this.normal=
this.gradient(n),0!=this.normal.norm2()&&this.normal.mul(-this.f0/this.normal.norm2()),n.x=f+this.normal.x,n.y=r+this.normal.y,this.normal.norm()<b)return 0===this.normal.x&&0===this.normal.y&&(this.normal.x=n.x-a.x,this.normal.y=n.y-a.y),n;return c?n:null};a.R2Newton=g;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(a,f){this.x=a;this.y=f};k.prototype.vectorLength=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};k.prototype.dotProduct=function(a){return this.x*a.x+this.y*a.y};k.prototype.angleBetweenVectors=function(a){return Math.acos(this.dotProduct(a)/(this.vectorLength()*a.vectorLength()))};k.AXIS_X=new k(1,0);k.AXIS_Y=new k(0,1);a.Vector2D=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.floor,e=Math.round,f,r,n,c,h,p,b,g,d,v,q,u,y,m=function(b,d){this.parent=b;this.evaluator=b.evaluator;var c=this.parser=b.evaluator.parser;this.id="GraphicControl"!==d.type?"C":"G";this.gui=this.type="";this.region="south";this.y=this.x=0;this.w="Video"!==d.type?100:350;this.h="Video"!==d.type?23:120;"GraphicControl"!==d.type&&"Audio"!==d.type&&"Video"!==d.type?"TextArea"!==d.type?this.expresion=c.parse("(0,0,100,23)"):(this.expresion=c.parse("(0,0,300,200)"),
this.w=300,this.h=200):this.expresion=c.parse("(0,0)");this.visible=this.fixed=!0;this.color=new a.Color("222222");this.colorInt=new a.Color("GraphicControl"!==d.type?"f0f8ff":"cc0022");this.font_size=c.parse("0");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=c.parse("1");this.activeif=c.parse("1");this.valueExpr=c.parse("0");this.decimals=
c.parse("2");this.min=c.parse("-Infinity");this.max=c.parse("Infinity");this.incr=c.parse("0.1");this.exponentialif=this.discrete=!1;this.zIndex=-1;Object.assign(this,d);"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;d=this.evaluator.eval(this.expresion);this.x=e(d[0][0]);this.y=e(d[0][1]);4==d[0].length&&
(this.w=e(d[0][2]),this.h=e(d[0][3]));this.actionExec=b.lessonParser.parseAction(this)};m.prototype.init=function(){};m.prototype.update=function(){};m.prototype.draw=function(){};m.prototype.getContainer=function(){var a=this.parent.spaces;if("interior"===this.region)for(var b=0,d=a.length;b<d;b++){var c=a[b];if(c.id===this.spaceID)return c.addCtr(this),this.zIndex=c.zIndex,this.space=c,c.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};
m.prototype.addControlContainer=function(a){var b=this.getContainer();b.childNodes[0]?b.insertBefore(a,b.childNodes[0]):b.appendChild(a)};m.prototype.updatePositionAndSize=function(){n=c=h=p=!1;b=this.evaluator.eval(this.expresion);g=e(b[0][0]);n=e(this.x)!==g;this.x=g;g=e(b[0][1]);c=e(this.y)!==g;this.y=g;4===b[0].length&&(g=e(b[0][2]),h=e(this.w)!==g,this.w=g,g=e(b[0][3]),p=e(this.h)!==g,this.h=g);if(h||p||n||c)this.init(!0,!0),this.draw()};m.prototype.formatOutputValue=function(a){y=this.parent;
d=a+"";v=this.evaluator.eval(this.decimals);q=d.indexOf(".");-1!=q&&(u=d.substring(q+1),u.length>v&&(d=parseFloat(d).toFixed(v)));this.fixed&&(2!==y.version||2===y.version&&!this.exponentialif)&&(d=parseFloat(a).toFixed(v));this.exponentialif&&0!=parseFloat(d)&&(d=this.fixed&&2!==y.version?parseFloat(d).toExponential(v):parseFloat(d).toExponential(),d=d.toUpperCase().replace("+",""));return d.replace(".",y.decimal_symbol)};m.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()};m.prototype.createGradient=function(a,b){this.linearGradient=this.ctx.createLinearGradient(0,0,0,b);f=b*b;for(a=0;a<b;a++)r=k(a-35*b/100),this.linearGradient.addColorStop(a/b,"rgba(0,0,0,"+r*r*192/f/255+")")};a.Control=m;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.floor,e=Math.abs,f=/[\w\.\-//]*(\.gif)/gi,r,n,c,h,p,b,g,d,v,q,u,y,m,l,x,w,z,A,G,J,E,F,D,B,L,I,M,O,H,P,C,N,K=function(b,d){var c=a.Control.call(this,b,d)||this;c.imageSrc=d.imageSrc||"";c.image=d.image||new Image;c.imageOver=d.imageOver||new Image;c.imageDown=d.imageDown||new Image;c.flat=d.flat||!1;c.borderColor=d.borderColor||!1;c.text_align=d.text_align||"center_center";c.image_align=d.image_align||"center_center";c.font_family=a.getFontName(d.font_family||
"arial");c.ratio=b.ratio;-1===c.font_size&&(c.fontSizeNotSet=!0);c.borderColor&&(c.borderColor=new a.Color(c.borderColor));c.text_align=c.text_align.split("_");c.image_align=c.image_align.split("_");c.old_name=c.name;c.name.match(/^\[.*\]?/)?c.name=c.parser.parse(c.name.substring(1,c.name.length-1)):c.name=c.parser.parse("'"+c.name+"'");c.classContainer=c.cssClass?" "+c.cssClass+" ":"";c.extra_style=c.imageSrc.trim().match("^_STYLE_")?c.imageSrc.trim().substring(8):c.extra_style||"";c.imageSrc.trim().match("^_STYLE_")&&
(c.imageSrc="vacio.gif");if(c.extra_style){c.customStyle=!0;c.btnStyle=[];c.conStyle=[];c.conStyle.textBorder=3;b=c.extra_style.split("|");for(var g,l=0,f=b.length;l<f;l++)d=b[l],g=d.match(/rgb/g),d.match("class=")?c.classContainer=" "+d.substring(6):d.match("border=")?(c.btnStyle.push({type:"border-style",value:"solid"}),c.btnStyle.push({type:"border-width",value:d.substring(7).trim()+"px"})):d.match("borderRadius=")?(c.btnStyle.push({type:"border-radius",value:d.substring(13).trim()+"px"}),c.conStyle.push({type:"border-radius",
value:d.substring(13).trim()+"px"})):d.match("borderColor=")?c.btnStyle.push({type:"border-color",value:(g?"":"#")+d.substring(12).trim()}):d.match("overColor=")?c.conStyle.overColor=(g?"":"#")+d.substring(10).trim():d.match("downColor=")?c.conStyle.downColor=(g?"":"#")+d.substring(10).trim():d.match("font=")?c.conStyle.font=d.substring(5).trim().toLowerCase():d.match("inactiveColor=")?c.conStyle.inactiveColor=(g?"":"#")+d.substring(14).trim():d.match("inactiveColorBorder=")?c.conStyle.inactiveColorBorder=
(g?"":"#")+d.substring(20).trim():d.match("shadowTextBlur=")?c.conStyle.shadowTextBlur=parseFloat(d.substring(15).trim()):d.match("shadowTextOffsetX=")?c.conStyle.shadowTextOffsetX=parseFloat(d.substring(18).trim()):d.match("shadowTextOffsetY=")?c.conStyle.shadowTextOffsetY=parseFloat(d.substring(18).trim()):d.match("shadowTextColor=")?c.conStyle.shadowTextColor=(g?"":"#")+d.substring(16).trim():d.match("shadowBoxBlur=")?c.conStyle.shadowBoxBlur=parseFloat(d.substring(14).trim()):d.match("shadowBoxOffsetX=")?
c.conStyle.shadowBoxOffsetX=parseFloat(d.substring(17).trim()):d.match("shadowBoxOffsetY=")?c.conStyle.shadowBoxOffsetY=parseFloat(d.substring(17).trim()):d.match("shadowBoxColor=")?c.conStyle.shadowBoxColor=(g?"":"#")+d.substring(15).trim():d.match("shadowInsetBoxBlur=")?c.conStyle.shadowInsetBoxBlur=parseFloat(d.substring(19).trim()):d.match("shadowInsetBoxOffsetX=")?c.conStyle.shadowInsetBoxOffsetX=parseFloat(d.substring(22).trim()):d.match("shadowInsetBoxOffsetY=")?c.conStyle.shadowInsetBoxOffsetY=
parseFloat(d.substring(22).trim()):d.match("shadowInsetBoxColor=")?c.conStyle.shadowInsetBoxColor=(g?"":"#")+d.substring(20).trim():d.match("textBorder=")?c.conStyle.textBorder=parseFloat(d.substring(11).trim()):d.match("flat=")&&(c.flat=1==parseInt(d.substring(5).trim()))}c.imageSrc.match("_COLORES_")&&(b=c.imageSrc.split("_"),c.colorInt=new a.Color(b[2]),c.color=new a.Color(b[3]),c.font_size=c.parser.parse(b[5]),c.imageSrc="");c.imageSrc.match(/^\[.*\]?/)?c.imageSrc=c.parser.parse(c.imageSrc.substring(1,
c.imageSrc.length-1)):c.imageSrc=c.parser.parse("'"+c.imageSrc+"'");b=c.evaluator.eval(c.imageSrc).toString().trim();if(""!=b)if(d=b.substr(0,b.lastIndexOf(".")),g=b.substr(b.lastIndexOf(".")),b.match(/vacio.gif$/i))c.imageSrc=c.parser.parse("'vacio.gif'"),c.image.ready=1,3===c.parent.version&&(c.name=c.parser.parse("")),c.emptyImage={ready:!0},c.parser.parse("'vacio.gif'");else if(c.image=c.parent.getImage(b),d)try{c.imageOver=c.parent.getImage(d+"_over"+g),c.imageDown=c.parent.getImage(d+"_down"+
g)}catch(S){}c.container=a.newHTML("div",{class:"DescartesButtonContainer"+c.classContainer,id:c.id,style:"width:"+c.w+"px;height:"+c.h+"px;left:"+c.x+"px;top:"+c.y+"px;z-index:"+c.zIndex+";"});c.btn=a.newHTML("canvas",{width:c.w*c.ratio,height:c.h*c.ratio,style:"position:absolute;left:0;top:0;width:"+c.w+"px;height:"+c.h+"px;"});c.ctx=c.btn.getContext("2d");c.ctx.imageSmoothingEnabled=!1;c.tooltip&&(c.btn.title=c.tooltip);c.container.appendChild(c.btn);c.addControlContainer(c.container);c.addEvents();
c.init();return c};$jscomp.inherits(K,a.Control);K.prototype.init=function(b){r=this.evaluator;z=this.container;n=this.btn;c=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]));n.width=this.w*this.ratio;n.height=this.h*this.ratio;n.setAttribute("style","position:absolute;left:0;top:0;width:"+this.w+"px;height:"+this.h+"px;box-sizing:border-box;");z.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++)n.style[this.btnStyle[d].type]=this.btnStyle[d].value;if(this.conStyle){d=0;for(g=this.conStyle.length;d<g;d++)z.style[this.conStyle[d].type]=this.conStyle[d].value;if(this.conStyle.shadowBoxColor){d=this.conStyle.shadowBoxOffsetX||0;g=this.conStyle.shadowBoxOffsetY||2;var l=this.conStyle.shadowBoxBlur||2;z.style.boxShadow=d+"px "+g+"px "+l+"px 1px "+this.conStyle.shadowBoxColor}this.conStyle.shadowInsetBoxColor&&
(d=this.conStyle.shadowInsetBoxOffsetX||0,g=this.conStyle.shadowInsetBoxOffsetY||-2,l=this.conStyle.shadowInsetBoxBlur||1,n.style.boxShadow=d+"px "+g+"px "+l+"px 1px "+this.conStyle.shadowInsetBoxColor+" inset")}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);z.style.display=0<r.eval(this.drawif)?"block":"none";c.lineJoin="round";c.font=this.italics+" "+this.bold+" "+this.fs_evaluated+"px "+
this.font_family;this.text_object=new a.TextObject({parent:{decimal_symbol:this.parent.decimal_symbol},evaluator:this.evaluator,decimals:this.decimals,fixed:!1,align:"left",anchor:"center_center",width:this.parser.parse("0"),font_size:this.font_size,font_family:this.font_family,italics:this.italics,bold:this.bold,border:this.borderColor,border_size:this.conStyle?this.conStyle.textBorder:void 0,shadowBlur:this.conStyle&&this.conStyle.shadowTextColor?this.conStyle.shadowTextBlur||1:void 0,shadowOffsetX:this.conStyle&&
this.conStyle.shadowTextColor?this.conStyle.shadowTextOffsetX||0:void 0,shadowOffsetY:this.conStyle&&this.conStyle.shadowTextColor?this.conStyle.shadowTextOffsetY||2:void 0,shadowColor:this.conStyle&&this.conStyle.shadowTextColor?this.conStyle.shadowTextColor:void 0},this.old_name);this.draw(b)};K.prototype.update=function(){r=this.evaluator;z=this.container;n=this.btn;this.activeIfValue=0<r.eval(this.activeif);this.drawIfValue=0<r.eval(this.drawif);(this.space?this.space.drawIfValue:1)&&this.drawIfValue?
(z.style.display="block",this.draw(),z.style.cursor=n.style.cursor=this.activeIfValue?"pointer":"not-allowed",this.updatePositionAndSize()):(z.style.display="none",this.buttonClick=!1)};K.prototype.draw=function(h){z=this.container;r=this.evaluator;n=this.btn;c=this.ctx;b=r.eval(this.name);this.text_object.draw(a.ctx,"#000000",0,0);b=this.text_object.textNodes.toStr();g=this.evaluator.eval(this.imageSrc).toString().trim();if(!h&&(A=this.over===this.oldOver,G=this.buttonClick===this.oldButtonClick,
J=this.activeIfValue===this.oldActiveIfValue,E=this.drawIfValue===this.oldDrawIfValue,F=b===this.oldName,D=g===this.oldImageSrc,B=this.colorInt.getColor()===this.oldBackColor,L=this.color.getColor()===this.oldTextColor,I=this.image.ready===this.oldImageReady,this.oldOver=this.over,this.oldButtonClick=this.buttonClick,this.oldActiveIfValue=this.activeIfValue,this.oldDrawIfValue=this.drawIfValue,this.oldName=b,this.oldImageSrc=g,this.oldBackColor=this.colorInt.getColor(),this.oldTextColor=this.color.getColor(),
this.oldImageReady=this.image.ready,A&&G&&J&&E&&F&&D&&B&&L&&I))return;c.save();c.setTransform(this.ratio,0,0,this.ratio,0,0);p=this.fs_evaluated;z.setAttribute("data-name",b);g?(d="vacio.gif"===g?this.emptyImage:this.parent.getImage(g),M=g.substr(0,g.lastIndexOf(".")),O=g.substr(g.lastIndexOf(".")),H=M+"_over"+O,P=M+"_down"+O,C="vacio.gif"===g?this.emptyImage:this.parent.getImage(H),N="vacio.gif"===g?this.emptyImage:this.parent.getImage(P)):N=C=d=this.emptyImage;c.clearRect(0,0,this.w,this.h);v=q=
0;this.buttonClick&&(v=q=1);this.text_object.draw(c,this.color.getColor(),0,0,!0);u=this.text_object.textNodes.metrics.w;y=this.text_object.textNodes.metrics.h;"center"==this.text_align[1]?x=k(this.w/2+v)-.5:"left"==this.text_align[1]?x=u/2+5+v:"right"==this.text_align[1]&&(x=this.w-u/2+v-5);"center"==this.text_align[0]?w=k(this.h/2+q)-.5:"top"==this.text_align[0]?w=y/2+q+4:"bottom"==this.text_align[0]&&(w=this.h-y/2+q-3);d&&("center"==this.image_align[1]?m=parseInt((this.w-d.width)/2)+v:"left"==
this.image_align[1]?m=v:"right"==this.image_align[1]&&(m=this.w-d.width+v),"center"==this.image_align[0]?l=parseInt((this.h-d.height)/2)+q:"top"==this.image_align[0]?l=q:"bottom"==this.image_align[0]&&(l=this.h-d.height+q));if(d&&d.ready)if(d!==this.emptyImage&&d.complete)if(g.match(f))this.btn.style.backgroundRepeat="no-repeat",this.btn.style.backgroundImage="url('"+g+"')",this.btn.style.backgroundPosition=m+"px "+l+"px";else{if("center"!=this.image_align[0]||"center"!=this.image_align[1])z.style.backgroundColor=
this.colorInt.getColor();c.drawImage(d,m,l)}else this.emptyImage&&this.customStyle&&(z.style.backgroundColor=this.colorInt.getColor());else z.style.backgroundColor=this.colorInt.getColor(),this.flat||(this.buttonClick||(a.drawLine(c,this.w-1,0,this.w-1,this.h,"rgba(0,0,0,0.5)"),a.drawLine(c,0,0,0,this.h,"rgba(0,0,0,0.09)"),a.drawLine(c,1,0,1,this.h,"rgba(0,0,0,0.03)")),c.fillStyle=this.linearGradient,c.fillRect(0,0,this.w,this.h));this.activeIfValue&&(C!==this.emptyImage&&this.over&&C.ready&&C.complete?
H.match(f)?(this.btn.style.backgroundImage="url('"+H+"')",this.btn.style.backgroundPosition=m+"px "+l+"px"):c.drawImage(C,m,l):this.customStyle&&this.conStyle.overColor&&this.over&&(z.style.backgroundColor=this.conStyle.overColor));this.activeIfValue?N!==this.emptyImage&&this.buttonClick&&N.ready&&N.complete?P.match(f)?(this.btn.style.backgroundImage="url('"+P+"')",this.btn.style.backgroundPosition=m+"px "+l+"px"):c.drawImage(N,m,l):this.customStyle&&this.conStyle.downColor&&this.buttonClick&&(z.style.backgroundColor=
this.conStyle.downColor):this.buttonClick&&!d&&(c.fillStyle="rgba(0,0,0,0.09)",c.fillRect(0,0,this.w,this.h));c.fillStyle=this.color.getColor();this.customStyle&&this.conStyle.shadowTextColor&&0<this.conStyle.textBorder&&(c.lineWidth=this.conStyle.textBorder,c.strokeStyle=this.conStyle.shadowTextColor);this.borderColor&&(c.lineWidth=parseInt(p/6),c.strokeStyle=this.borderColor.getColor());this.text_object.draw(c,this.color.getColor(),x,w);this.underlined&&(c.strokeStyle=this.color.getColor(),c.lineWidth=
k(p/10)||2,c.lineCap="round",c.beginPath(),c.moveTo(x-u/2+v,w+k(p/2)+k(p/5)-1.5),c.lineTo(x+u/2+v,w+k(p/2)+k(p/5)-1.5),c.stroke());this.activeIfValue||(this.customStyle&&this.conStyle.inactiveColor?z.style.backgroundColor=this.conStyle.inactiveColor:(c.fillStyle="rgba(240,240,240,0.6)",c.fillRect(0,0,this.w,this.h)));c.restore();this._image_pos_x=m;this._image_pos_y=l};K.prototype.drawTextBorder=function(){this.colorInt.getColor();this.color.getColor();return!(.5>(e(this.colorInt.r-this.color.r)+
e(this.colorInt.g-this.color.g)+e(this.colorInt.b-this.color.b))/255)};K.prototype.buttonPressed=function(){this.updateAndExecAction()};K.prototype.addEvents=function(){function b(d,c,f){a.clearTimeout(l);g.buttonClick&&g.drawIfValue&&g.activeIfValue&&(c.call(g),d=f?d:100,l=a.setTimeout(function(){b(d,c,!1)},d))}function d(d){this.focus();d.preventDefault();d.stopPropagation();document.activeElement!=document.body&&document.activeElement.blur();g.whichBtn=a.whichBtn(d);"L"==g.whichBtn&&g.activeIfValue&&
(g.buttonClick=!0,g.draw(),"calculate"==g.action&&(g.evaluator.setVariable(g.id,g.evaluator.eval(g.valueExpr)),b(1E3,g.buttonPressed,!0)),g.btn.removeEventListener("touchend",c),g.btn.addEventListener("touchend",c),g.btn.removeEventListener("mouseup",c),g.btn.addEventListener("mouseup",c))}function c(b){a.newBlobContent=null;this.focus();b.preventDefault();b.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",c),g.btn.removeEventListener("mouseup",c);g.parent.update()}var g=this,l;g.btn.oncontextmenu=function(){return!1};this.over=this.buttonClick=!1;this.btn.addEventListener("touchstart",d);this.btn.addEventListener("mousedown",d);this.btn.addEventListener("mouseover",function(a){a.preventDefault();a.stopPropagation();g.over=!0;g.draw()});this.btn.addEventListener("mouseout",function(b){a.newBlobContent=null;b.preventDefault();b.stopPropagation();
g.over=!1;g.buttonClick=!1;g.draw()});document.addEventListener("visibilitychange",function(b){a.newBlobContent=null;g.buttonClick=!1})};a.Button=K;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h,p,b,g,d,v,q,u=function(b,c){c=a.Control.call(this,b,c)||this;c.flat=c.image_dec_src&&c.image_inc_src;c.btn_pos=c.btn_pos||"v_left";c.horizontal="h_left"===c.btn_pos||"h_right"===c.btn_pos||"h_left_right"===c.btn_pos;c.label_color=c.label_color||new a.Color("e0e4e8",b.evaluator);c.label_text_color=c.label_text_color||new a.Color("000000",b.evaluator);c.tabindex=++c.parent.tabindex;c.name_str=c.name;c.name.match(/^\[.*\]?/)?c.name=c.parser.parse(c.name.substring(1,
c.name.length-1)):c.name=c.parser.parse("'"+c.name+"'");c.container=a.newHTML("div",{class:"DescartesSpinnerContainer",id:c.id});c.divUp=a.newHTML("div",{class:"DJS_Up"});c.divDown=a.newHTML("div",{class:"DJS_Down"});c.field=a.newHTML("input",{type:"text",id:c.id+"_spinner",class:"DescartesSpinnerField",tabindex:c.tabindex});c.label=a.newHTML("canvas",{class:"DescartesSpinnerLabel"});c.label_ctx=c.label.getContext("2d");c.ratio=b.ratio;c.container.appendChild(c.label);c.container.appendChild(c.field);
c.container.appendChild(c.divUp);c.container.appendChild(c.divDown);c.addControlContainer(c.container);d=c.evaluator.parser.parse("1");c.originalIncr=c.incr;if(0>c.evaluator.eval(c.decimals)||0===c.evaluator.eval(c.incr))b=c.evaluator.eval(c.incr),0<b?(c.incr=c.evaluator.parser.parse(parseInt(b).toString()),c.originalIncr=c.incr):c.incr=d;c.image_dec_src&&(c.image_dec_src.match(/^\[.*\]?/)?c.image_dec_src=c.parser.parse(c.image_dec_src.substring(1,c.image_dec_src.length-1)):c.image_dec_src=c.parser.parse("'"+
c.image_dec_src+"'"),c.old_image_dec_src=c.evaluator.eval(c.image_dec_src).toString().trim(),c.image_dec=c.parent.getImage(c.old_image_dec_src));c.image_inc_src&&(c.image_inc_src.match(/^\[.*\]?/)?c.image_inc_src=c.parser.parse(c.image_inc_src.substring(1,c.image_inc_src.length-1)):c.image_inc_src=c.parser.parse("'"+c.image_inc_src+"'"),c.old_image_inc_src=c.evaluator.eval(c.image_inc_src).toString().trim(),c.image_inc=c.parent.getImage(c.old_image_inc_src));c.addEvents();c.init();return c};$jscomp.inherits(u,
a.Control);u.prototype.init=function(b,c){k=this.evaluator;this.label.innerHTML=k.eval(this.name).toString();var d=this.label.textContent;c||(this.value=this.validateValue(k.eval(this.valueExpr)));c=this.formatOutputValue(this.value);this.fieldFontSize=0<k.eval(this.font_size)?k.eval(this.font_size):a.getFieldFontSize(this.h);this.text_object=new a.TextObject({parent:{decimal_symbol:this.parent.decimal_symbol},evaluator:this.evaluator,decimals:this.decimals,fixed:!1,align:"left",anchor:"center_center",
width:this.parser.parse("0"),font_size:this.parser.parse(""+this.fieldFontSize),font_family:this.font_family,italics:this.italics,bold:this.bold},this.name_str);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0,!0);var g=2!==this.parent.version?"__":"_____",f=a.getTextWidth(c+"_",this.fieldFontSize+"px "+a.sansserif_font);if(this.horizontal){b=parseInt(this.h);var h=parseInt(this.w/2-b);g=this.text_object.textNodes.metrics.w+parseInt(this.fieldFontSize);this.visible||(h=this.w-
2*b,f=0);h<g&&(h=g);""==d&&(h=0);this.w-h-b<f&&(h=this.w-b-f);0>h&&(h=0);d=this.w-(h+2*b);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:"+b+"px;height:"+b+"px;"+("h_left"===this.btn_pos?"left:"+(h+b):"right:0")+"px;top:0;"+(this.flat?"border-width:0;":""));this.divDown.setAttribute("style","width:"+b+"px;height:"+b+"px;left:"+(h+("h_right"===
this.btn_pos?d:0))+"px;top:0;"+(this.flat?"border-width:0;":""));this.field.setAttribute("style","font-family:"+a.sansserif_font+";font-size:"+this.fieldFontSize+"px;width:"+d+"px;height:"+this.h+"px;left:"+(b+h+("h_left"===this.btn_pos?b:"h_right"===this.btn_pos?-b:0))+"px;text-align:center;")}else b=2+parseInt(this.h/2),h=parseInt(this.w/2-b/2),g=a.getTextWidth(d+g,this.fieldFontSize+"px "+a.sansserif_font),this.visible||(h=this.w-b,f=0),h<g&&(h=g),""==d&&(h=0),this.w-h-b<f&&(h=this.w-b-f),0>h&&
(h=0),d=this.w-(h+b),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;"),g="width:"+b+"px;left:"+(h+("v_right"===this.btn_pos?d:0))+"px;",this.divUp.setAttribute("style",g+";height:"+(this.h/2+1)+"px;top:0;"+(this.flat?"border-width:0;":"")),this.divDown.setAttribute("style",g+";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:"+d+"px;height:"+this.h+"px;left:"+(("v_left"===this.btn_pos?b:0)+h)+"px;");this.field.value=c;this.visible||(this.field.style.display="none");this.label.setAttribute("style","font-size:"+this.fieldFontSize+"px;width:"+h+"px;height:"+this.h+"px;line-height:"+this.h+"px;background-color:"+this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";");this.label.width=h*this.ratio;this.label.height=this.h*this.ratio;
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);k.setVariable(this.id,this.value)};u.prototype.update=function(){k=this.evaluator;0>k.eval(this.decimals)?(e=k.eval(this.incr),0<e?this.originalIncr=this.incr=k.parser.parse(parseInt(e).toString()):
this.incr=d):this.incr=0!==k.eval(this.originalIncr)?this.originalIncr:d;this.activeIfValue=0<k.eval(this.activeif);this.drawIfValue=0<k.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&&(q=this.evaluator.eval(this.image_inc_src).toString().trim(),this.old_image_inc_src!==q&&(this.divUp.style["background-image"]="url("+this.image_inc.src+")",this.image_inc_src=q));this.updatePositionAndSize();this.parent.animation.playing&&document.activeElement==this.field||(f=this.field.value,r=this.value,this.value=this.validateValue(k.getVariable(this.id)),
this.field.value=this.formatOutputValue(this.value),this.value==r&&this.field.value!=f&&(this.value=this.validateValue(f),this.field.value=this.formatOutputValue(this.value)),k.setVariable(this.id,this.value));this.label_ctx.setTransform(this.ratio,0,0,this.ratio,0,0);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0);this.label_ctx.clearRect(0,0,this.label.width,this.label.height);this.text_object.textNodes.metrics.w>this.label.width/this.ratio?(this.text_object.anchor="center_left",
this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),5,this.label.height/this.ratio/2)):(this.text_object.anchor="center_center",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),this.label.width/this.ratio/2,this.label.height/this.ratio/2));this.label_ctx.setTransform(1,0,0,1,0,0)};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){k=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,".");n=a==parseFloat(a)?parseFloat(a):parseFloat(k.eval(k.parser.parse(a)));isNaN(n)&&(n=0);p=k.eval(this.min);b=k.eval(this.max);""===p&&(p=-Infinity);""===b&&(b=Infinity);n=Math.min(Math.max(n,p),b);this.discrete&&(c=k.eval(this.incr),n=0==c?0:c*Math.round(n/
c));h=k.eval(this.decimals);0>=h&&(h=0);return n=parseFloat(parseFloat(n).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 b(c,d,g){a.clearTimeout(k);if(e.up||e.down)d.call(e),c=g?c:10,k=a.setTimeout(function(){b(c,d)},c)}function c(c){c.preventDefault();e.whichBtn=a.whichBtn(c);"L"==e.whichBtn&&e.activeIfValue&&(e.up=!0,b(q,e.increase,!0))}function d(c){c.preventDefault();e.whichBtn=a.whichBtn(c);"L"==e.whichBtn&&e.activeIfValue&&(e.down=!0,b(q,e.decrease,!0))}function f(b){e.up=!1;a.clearTimeout(k);e.updateStyle()}function h(b){e.down=!1;a.clearTimeout(k);e.updateStyle()}g=
a.hasTouchSupport;var e=this,q=g?500:200,k;e.divUp.oncontextmenu=e.divDown.oncontextmenu=e.field.oncontextmenu=e.label.oncontextmenu=function(){return!1};this.label.addEventListener("touchstart",a.preventDefault);this.label.addEventListener("mousedown",a.preventDefault);this.field.addEventListener("keydown",function(a){13==a.keyCode&&e.changeValue(e.field.value)});this.divUp.addEventListener("touchstart",c);this.divUp.addEventListener("mousedown",c);this.divDown.addEventListener("touchstart",d);this.divDown.addEventListener("mousedown",
d);this.divUp.addEventListener("mouseout",function(b){e.up=!1;a.clearTimeout(k);b.preventDefault();e.updateStyle()});this.divDown.addEventListener("mouseout",function(b){e.down=!1;a.clearTimeout(k);b.preventDefault();e.updateStyle()});this.divUp.addEventListener("touchend",f);window.addEventListener("touchend",f);this.divUp.addEventListener("mouseup",f);window.addEventListener("mouseup",f);this.divDown.addEventListener("touchend",h);window.addEventListener("touchend",h);this.divDown.addEventListener("mouseup",
h);window.addEventListener("mouseup",h);document.addEventListener("visibilitychange",function(b){e.up=!1;e.down=!1;a.clearTimeout(k);e.updateStyle()});this.field.addEventListener("blur",function(a){e.drawIfValue&&e.changeValue(e.field.value,!0)});e.field.addEventListener("click",function(a){this.focus()})};a.Spinner=u;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e=function(f,e){var k=a.Control.call(this,f,e)||this;k.label_color=k.label_color||new a.Color("e0e4e8",f.evaluator);k.label_text_color=k.label_text_color||new a.Color("000000",f.evaluator);k.typeCtr="checkbox";k.pressed=e.pressed||!1;k.radio_group=(e.radio_group||"").trim();""!==k.radio_group&&(k.typeCtr="radio");k.name_str=k.name;k.name.match(/^\[.*\]?/)?k.name=k.parser.parse(k.name.substring(1,k.name.length-1)):k.name=k.parser.parse("'"+k.name.trim()+
"'");k.tabindex=++k.parent.tabindex;k.containerControl=a.newHTML("div",{class:"DescartesCheckboxContainer",id:k.id});k.checkbox=a.newHTML("input",{type:k.typeCtr,id:k.id+k.typeCtr,class:"DescartesCheckbox",tabindex:k.tabindex});""!==k.radio_group&&k.checkbox.setAttribute("name",k.radio_group);k.checkbox.internalID=k.id;k.label=a.newHTML("canvas",{class:"DescartesCheckboxLabel"});k.label_ctx=k.label.getContext("2d");k.ratio=f.ratio;k.dummyLabel=a.newHTML("label",{"for":k.id+k.typeCtr});k.value=k.evaluator.eval(k.valueExpr);
k.evaluator.setVariable(k.id,k.value);k.containerControl.appendChild(k.label);k.containerControl.appendChild(k.checkbox);k.containerControl.appendChild(k.dummyLabel);k.addControlContainer(k.containerControl);k.addEvents();k.init();return k};$jscomp.inherits(e,a.Control);e.prototype.init=function(f){k=this.evaluator;this.label.innerHTML=k.eval(this.name).toString();this.labelFontSize=0<k.eval(this.font_size)?k.eval(this.font_size):a.getFieldFontSize(this.h);f=Math.max(this.w-this.h,0);this.text_object=
new a.TextObject({parent:{decimal_symbol:this.parent.decimal_symbol},evaluator:this.evaluator,decimals:this.decimals,fixed:!1,align:"left",anchor:"center_center",width:this.parser.parse("0"),font_size:this.parser.parse(""+this.labelFontSize),font_family:this.font_family,italics:this.italics,bold:this.bold},this.name_str);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0,!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+";");"right"==this.position?(this.dummyLabel.setAttribute("style","position:absolute;width:"+this.h+"px;height:"+this.h+"px;left:"+f+"px;"),this.checkbox.setAttribute("style","width:"+this.h+"px;height:"+this.h+"px;left:"+f+"px;"),this.label.setAttribute("style","font-size:"+this.labelFontSize+"px;width:"+f+"px;height:"+this.h+"px;line-height:"+this.h+"px;background-color:"+this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";")):(this.dummyLabel.setAttribute("style",
"position:absolute;width:"+this.h+"px;height:"+this.h+"px;left:0;"),this.checkbox.setAttribute("style","width:"+this.h+"px;height:"+this.h+"px;left:0;"),this.label.setAttribute("style","font-size:"+this.labelFontSize+"px;width:"+f+"px;height:"+this.h+"px;line-height:"+this.h+"px;background-color:"+this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";left:"+this.h+"px"));this.checkbox.checked=0!=this.evaluator.getVariable(this.id);this.label.width=f*this.ratio;this.label.height=
this.h*this.ratio;this.update()};e.prototype.update=function(){k=this.evaluator;this.activeIfValue=0<k.eval(this.activeif);this.drawIfValue=0<k.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!==k.getVariable(this.id)?1:0;if(""===this.radio_group)this.pressed?(this.value=this.checkbox.checked?1:0,this.pressed=!1):(this.value=a,this.checkbox.checked=
0!==this.value),k.setVariable(this.id,this.value);else{this.value=k.getVariable(this.id);k.setVariable(this.radio_group,0);a=document.querySelectorAll("[name="+this.radio_group+"]");var e=-1;if(this.pressed){for(var n=a.length-1;0<=n;n--)k.setVariable(a[n].internalID,0),a[n].checked=!1;k.setVariable(this.id,1);this.checkbox.checked=!0;this.value=1;k.setVariable(this.radio_group,this.id);this.pressed=0}else{for(n=a.length-1;0<=n;n--)e=0!=k.getVariable(a[n].internalID)?n:e,k.setVariable(a[n].internalID,
0),a[n].checked=!1;0<=e&&(k.setVariable(a[e].internalID,1),a[e].checked=!0,k.setVariable(this.radio_group,a[e].internalID));this.value=this.checkbox.checked?1:0}}}this.updatePositionAndSize();this.label_ctx.setTransform(this.ratio,0,0,this.ratio,0,0);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0);this.label_ctx.clearRect(0,0,this.label.width,this.label.height);this.text_object.textNodes.metrics.w>this.label.width/this.ratio?(this.text_object.anchor="center_left",this.text_object.draw(this.label_ctx,
this.label_text_color.getColor(),5,this.label.height/this.ratio/2)):(this.text_object.anchor="center_center",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),this.label.width/this.ratio/2,this.label.height/this.ratio/2));this.label_ctx.setTransform(1,0,0,1,0,0)};e.prototype.addEvents=function(){var f=this;f.checkbox.oncontextmenu=f.label.oncontextmenu=f.dummyLabel.oncontextmenu=function(){return!1};f.label.addEventListener("touchstart",a.preventDefault);f.label.addEventListener("mousedown",
a.preventDefault);f.dummyLabel.addEventListener("mousedown",a.preventDefault);f.checkbox.addEventListener("click",function(a){f.pressed=!0;f.updateAndExecAction()})};a.Checkbox=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h=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_str=b.name;b.name.match(/^\[.*\]?/)?b.name=b.parser.parse(b.name.substring(1,b.name.length-1)):b.name=b.parser.parse("'"+b.name.trim()+"'");void 0===b.valueExprString&&(b.valueExprString=b.onlyText?"0":"");b.emptyString=!1;b.ok=0;b.tabindex=++b.parent.tabindex;
b.regExpDecimalSymbol=new RegExp("\\"+b.parent.decimal_symbol,"g");if(b.answer)if(b.answer.match("krypto_")&&(b.answer=(new a.Krypto).decode(b.answer.substring(7))),b.answerPattern=b.answer,b.answer=a.buildRegularExpressionsPatterns(b.answer,b.evaluator),b.onlyText){var g=b.answerPattern.indexOf("|");b.firstAnswer=-1==g?b.answerPattern:b.answerPattern.substring(0,g)}else b.firstAnswer=b.parser.parse(b.answerPattern.substring(1,b.answerPattern.indexOf(",")));b.onlyText&&(b.valueExprString.match(/^'/)&&
b.valueExprString.match(/'$/)||(b.valueExpr=b.evaluator.parser.parse("'"+b.valueExprString+"'")),b.validateValue=function(a){a=a.toString();return"''"==a||"'"==a?"":a&&a.match(/^'/)&&a.match(/'$/)?a.substring(1,a.length-1):a},b.formatOutputValue=function(a){return a.toString()});b.containerControl=a.newHTML("div",{class:"DescartesTextFieldContainer",id:b.id});b.field=a.newHTML("input",{type:"text",id:b.id+"TextField",class:"DescartesTextFieldField",tabindex:b.tabindex});b.label=a.newHTML("canvas",
{class:"DescartesTextFieldLabel"});b.label_ctx=b.label.getContext("2d");b.ratio=c.ratio;b.containerControl.appendChild(b.label);b.containerControl.appendChild(b.field);b.addControlContainer(b.containerControl);b.addEvents();b.init();return b};$jscomp.inherits(h,a.Control);h.prototype.init=function(c){k=this.evaluator;this.label.innerHTML=k.eval(this.name).toString();var b=this.label.textContent;c||(this.value=this.validateValue(k.eval(this.valueExpr)));c=this.formatOutputValue(this.value);this.fieldFontSize=
0<k.eval(this.font_size)?k.eval(this.font_size):a.getFieldFontSize(this.h);this.text_object=new a.TextObject({parent:{decimal_symbol:this.parent.decimal_symbol},evaluator:this.evaluator,decimals:this.decimals,fixed:!1,align:"left",anchor:"center_center",width:this.parser.parse("0"),font_size:this.parser.parse(""+this.fieldFontSize),font_family:this.font_family,italics:this.italics,bold:this.bold},this.name_str);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0,!0);var g=a.getTextWidth(c+
"_",this.fieldFontSize+"px "+a.sansserif_font),d=parseInt(this.w/2),f=this.text_object.textNodes.metrics.w+parseInt(this.fieldFontSize);this.visible||(d=this.w,g=0);d<f&&(d=f);""==b&&(d=0);this.w-d<g&&(d=this.w-g);0>d&&(d=0);b=this.w-d;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:"+b+"px;height:"+this.h+"px;left:"+d+"px;");this.field.value=
c;this.label.setAttribute("style","font-size:"+this.fieldFontSize+"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.label.width=d*this.ratio;this.label.height=this.h*this.ratio;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(){k=
this.evaluator;this.activeIfValue=0<k.eval(this.activeif);this.drawIfValue=0<k.eval(this.drawif);this.field.disabled=!this.activeIfValue;this.containerControl.style.display=this.drawIfValue?"block":"none";this.parent.animation.playing&&document.activeElement==this.field||(e=this.field.value,f=this.value,this.value=this.validateValue(k.getVariable(this.id)),this.field.value=this.formatOutputValue(this.value),this.value===f&&this.field.value!=e&&(this.value=this.validateValue(e),this.field.value=this.formatOutputValue(this.value)),
k.setVariable(this.id,this.value));this.updatePositionAndSize();this.label_ctx.setTransform(this.ratio,0,0,this.ratio,0,0);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0);this.label_ctx.clearRect(0,0,this.label.width,this.label.height);this.text_object.textNodes.metrics.w>this.label.width/this.ratio?(this.text_object.anchor="center_left",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),5,this.label.height/this.ratio/2)):(this.text_object.anchor="center_center",
this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),this.label.width/this.ratio/2,this.label.height/this.ratio/2));this.label_ctx.setTransform(1,0,0,1,0,0)};h.prototype.validateValue=function(a){if(""===a||"''"==a)return"";k=this.evaluator;a=a.toString().replace(this.regExpDecimalSymbol,".","g");r=a==parseFloat(a)?parseFloat(a):parseFloat(k.eval(k.parser.parse(a)));isNaN(r)&&(r=0);n=k.eval(this.min);c=k.eval(this.max);""===n&&(n=-Infinity);""===c&&(c=Infinity);r<n&&(r=n);r>c&&(r=
c);this.discrete&&(a=k.eval(this.incr),r=0===a?0:a*Math.round(r/a));return r=parseFloat(parseFloat(r).toFixed(k.eval(this.decimals)))};h.prototype.formatOutputValue=function(c){return""===c?"":a.Control.prototype.formatOutputValue.call(this,c)};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 c=this;c.field.oncontextmenu=c.label.oncontextmenu=function(){return!1};c.label.addEventListener("touchstart",a.preventDefault);c.label.addEventListener("mousedown",a.preventDefault);
this.field.addEventListener("blur",function(a){c.drawIfValue&&c.changeValue(c.field.value,!0)});this.field.addEventListener("keydown",function(a){c.activeIfValue&&13==a.keyCode&&c.changeValue(c.field.value,!0)});c.field.addEventListener("click",function(a){this.focus()})};a.TextField=h;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.abs,e,f,r,n,c,h,p,b,g,d,v=function(b,c){function d(b){l.options=b.split(",");l.menuOptions=[];l.strValue=[];b=0;for(var c=l.options.length;b<c;b++){var d=l.customSplit(l.options[b]);1==d.length?(l.menuOptions.push(d[0]),l.strValue.push(b.toString())):2==d.length&&(l.menuOptions.push(d[0]),""==d[1]?l.strValue.push(b.toString()):l.strValue.push(d[1]))}b=0;for(c=l.menuOptions.length;b<c;b++)l.menuOptions[b].match(/^\[/)&&l.menuOptions[b].match(/\]$/)?
l.menuOptions[b]=e.parse(l.menuOptions[b].substring(1,l.menuOptions[b].length-1)):l.menuOptions[b]=e.parse("'"+l.menuOptions[b]+"'");b=0;for(c=l.strValue.length;b<c;b++)l.strValue[b].match(/^\[/)&&l.strValue[b].match(/\]$/)?l.strValue[b]=e.parse(l.strValue[b].substring(1,l.strValue[b].length-1)):l.strValue[b]=e.parse(l.strValue[b]);l.select.innerHTML="";b=0;for(c=l.menuOptions.length;b<c;b++)d=a.newHTML("option"),d.innerHTML=f.eval(l.menuOptions[b]),l.select.appendChild(d);return 0}var g=a.Control.call(this,
b,c)||this;g.label_color=g.label_color||new a.Color("e0e4e8",b.evaluator);g.label_text_color=g.label_text_color||new a.Color("000000",b.evaluator);g.options=c.options||"";e=g.parser;f=g.evaluator;g.ok=0;g.tabindex=++g.parent.tabindex;g.answer&&(g.answer.match("krypto_")&&(g.answer=(new a.Krypto).decode(g.answer.substring(7))),g.answer=parseInt(g.answer.split(",")[0].replace("[",""))||0);g.name_str=g.name;g.name.match(/^\[.*\]?/)?g.name=g.parser.parse(g.name.substring(1,g.name.length-1)):g.name=g.parser.parse("'"+
g.name+"'");var l=g;g.evaluator.setFunction(g.id+".setOptions",d);g.containerControl=a.newHTML("div",{class:"DescartesMenuContainer",id:g.id});g.label=a.newHTML("canvas",{class:"DescartesMenuLabel"});g.label_ctx=g.label.getContext("2d");g.ratio=b.ratio;g.select=a.newHTML("select",{id:g.id+"_menuSelect",class:"DescartesMenuSelect",tabindex:g.tabindex});g.field=a.newHTML("input",{type:"text",id:g.id+"_menuField",class:"DescartesMenuField",tabindex:g.tabindex});d(g.options);g.containerControl.appendChild(g.label);
g.containerControl.appendChild(g.select);g.visible&&g.containerControl.appendChild(g.field);g.addControlContainer(g.containerControl);g.addEvents();g.init();return g};$jscomp.inherits(v,a.Control);v.prototype.init=function(b){f=this.evaluator;this.label.innerHTML=f.eval(this.name).toString();var c=this.label.textContent;this.fieldFontSize=0<f.eval(this.font_size)?f.eval(this.font_size):a.getFieldFontSize(this.h);this.text_object=new a.TextObject({parent:{decimal_symbol:this.parent.decimal_symbol},
evaluator:this.evaluator,decimals:this.decimals,fixed:!1,align:"left",anchor:"center_center",width:this.parser.parse("0"),font_size:this.parser.parse(""+this.fieldFontSize),font_family:this.font_family,italics:this.italics,bold:this.bold},this.name_str);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0,!0);var d=0,g=0;this.value=b?this.value:f.eval(this.valueExpr);this.indexValue=this.getIndex(this.value);for(var l=0,h=this.menuOptions.length;l<h;l++)b=a.getTextWidth(f.eval(this.menuOptions[l]).toString(),
this.fieldFontSize+"px "+a.sansserif_font),b>d&&(d=b,g=l);d+=25;b=a.getTextWidth(this.formatOutputValue(f.eval(this.strValue[g])),this.fieldFontSize+"px "+a.sansserif_font)+7;g=this.text_object.textNodes.metrics.w+parseInt(this.fieldFontSize);""==c&&(g=0);this.visible||(b=0);for(c=this.w-b-g;c<d&&0<g;)g--,c++;for(;c<d&&0<b;)b--,c++;for(;g+c+b+1<this.w;)c++,b++;d=g;l=d+c;b=this.w-l;h=this.formatOutputValue(f.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:"+g+"px;height:"+this.h+"px;line-height:"+this.h+"px;background-color:"+this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";");this.label.width=g*this.ratio;this.label.height=this.h*this.ratio;this.field.value=h;this.field.setAttribute("style","font-size:"+this.fieldFontSize+"px;width:"+b+"px;height:"+this.h+"px;left:"+
l+"px;");this.select.setAttribute("style","text-align:left;font-size:"+this.fieldFontSize+"px;width:"+c+"px;height:"+this.h+"px;left:"+d+"px;");this.select.selectedIndex=this.indexValue;f.setVariable(this.id,parseFloat(h.replace(this.parent.decimal_symbol,".")));this.update()};v.prototype.update=function(){f=this.evaluator;this.activeIfValue=0<f.eval(this.activeif);this.drawIfValue=0<f.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){for(var a=0,b=this.menuOptions.length;a<b;a++)this.select.options[a].innerHTML=f.eval(this.menuOptions[a]);this.value=f.getVariable(this.id);isNaN(this.value)&&(this.value=0);this.field.value=this.formatOutputValue(this.value);f.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();this.label_ctx.setTransform(this.ratio,0,0,this.ratio,0,0);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0);this.label_ctx.clearRect(0,0,this.label.width,this.label.height);this.text_object.textNodes.metrics.w>this.label.width/this.ratio?(this.text_object.anchor="center_left",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),5,this.label.height/this.ratio/
2)):(this.text_object.anchor="center_center",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),this.label.width/this.ratio/2,this.label.height/this.ratio/2));this.label_ctx.setTransform(1,0,0,1,0,0)};v.prototype.customSplit=function(a){h=!1;p="";b=0;for(g=-1;b<a.length;){d=a.charAt(b);if("["===d&&-1===g){if(h||""!=p)p+="\u00a6";g++}else"["===d?g++:"]"===d&&0===g?(h=!0,g--):"]"==a.charAt(b)&&(g=0>g?g:g-1);p+=a.charAt(b);b++}return p.split("\u00a6")};v.prototype.getIndex=function(a){a=
parseFloat(a.toString().replace(this.parent.decimal_symbol,"."));r=-1;n=Infinity;for(var b=0,d=this.strValue.length;b<d;b++)c=k(a-parseFloat(this.evaluator.eval(this.strValue[b]))),c<=n&&(n=c,r=b);return r};v.prototype.changeValue=function(){this.activeIfValue&&(this.evaluator.setVariable(this.id,this.value),this.updateAndExecAction())};v.prototype.addEvents=function(){var b=this;b.select.oncontextmenu=b.label.oncontextmenu=b.field.oncontextmenu=function(){return!1};b.label.addEventListener("touchstart",
a.preventDefault);b.label.addEventListener("mousedown",a.preventDefault);this.select.addEventListener("change",function(a){b.value=b.evaluator.eval(b.strValue[this.selectedIndex]);b.field.value=b.formatOutputValue(b.value);b.evaluator.setVariable(b.id,b.field.value);b.changeValue();a.preventDefault()});this.field.addEventListener("keydown",function(a){13==a.keyCode&&(b.indexValue=b.getIndex(b.field.value),b.value=b.evaluator.eval(b.strValue[b.indexValue]),b.field.value=b.formatOutputValue(b.indexValue),
b.select.selectedIndex=b.indexValue,b.changeValue())});this.field.addEventListener("blur",function(a){b.drawIfValue&&b.changeValue(b.field.value,!0)});b.field.addEventListener("click",function(a){this.focus()})};a.Menu=v;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.floor,e,f,r,n,c,h,p,b,g,d,v,q,u,y,m,l,x,w,z=function(b,c){c=a.Control.call(this,b,c)||this;c.label_color=c.label_color||new a.Color("e0e4e8",b.evaluator);c.label_text_color=c.label_text_color||new a.Color("000000",b.evaluator);c.name_str=c.name;c.name.match(/^\[.*\]?/)?c.name=c.parser.parse(c.name.substring(1,c.name.length-1)):c.name=c.parser.parse("'"+c.name+"'");c.orientation=c.w>=c.h?"h":"v";c.container=a.newHTML("div",{class:"DescartesScrollbarContainer",
id:c.id});c.canvas=a.newHTML("canvas");c.divUp=a.newHTML("div",{class:"DescartesCatcher up"});c.divDown=a.newHTML("div",{class:"DescartesCatcher down"});c.field=a.newHTML("input",{type:"text",id:c.id+"scrollbar",class:"DescartesScrollbarField"});c.scrollHandler=a.newHTML("div",{class:"DescartesCatcher manipulator"});c.label=a.newHTML("canvas",{class:"DescartesScrollbarLabel"});c.label_ctx=c.label.getContext("2d");c.ratio=b.ratio;c.container.appendChild(c.canvas);c.container.appendChild(c.label);c.container.appendChild(c.divUp);
c.container.appendChild(c.divDown);c.container.appendChild(c.field);c.container.appendChild(c.scrollHandler);c.addControlContainer(c.container);c.addEvents();c.init();return c};$jscomp.inherits(z,a.Control);z.prototype.init=function(){e=this.evaluator;0==e.eval(this.decimals)?this.incr=1:this.incr=(e.eval(this.max)-e.eval(this.min))/100;this.value=this.validateValue(e.eval(this.valueExpr));r=this.formatOutputValue(this.value);n=this.evaluator.eval(this.expresion);this.x=n[0][0];this.y=n[0][1];4==
n[0].length&&(this.w=n[0][2],this.h=n[0][3]);this.orientation=this.w>=this.h?"h":"v";this.initScroll(r);this.changeScrollPositionFromValue();this.prePos=this.pos;e.setVariable(this.id,this.value)};z.prototype.initScroll=function(b){f=this;e=f.evaluator;f.label.innerHTML=e.eval(f.name).toString();w=this.label.textContent;var c="v"===f.orientation?parseInt(19+5*(f.h-100)/100):f.h;f.fieldFontSize=0<e.eval(f.font_size)?e.eval(f.font_size):"v"===f.orientation?c-parseInt(f.h/20)-1:a.getFieldFontSize(c);
this.text_object=new a.TextObject({parent:{decimal_symbol:this.parent.decimal_symbol},evaluator:this.evaluator,decimals:this.decimals,fixed:!1,align:"left",anchor:"center_center",width:this.parser.parse("0"),font_size:this.parser.parse(""+this.fieldFontSize),font_family:this.font_family,italics:this.italics,bold:this.bold},f.name_str);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0,!0);b=a.getTextWidth(b+"_",f.fieldFontSize+"px "+a.sansserif_font);var d=f.parent.getSpaceById(f.spaceID).h;
f.labelHeight=""==w?0:c;f.fieldHeight=""==f.visible?0:c;if("v"===f.orientation)f.canvasWidth=f.w,f.canvasHeight=f.h-f.labelHeight-f.fieldHeight,18<=f.canvasHeight+f.y-d&&(f.canvasHeight=d),c=f.fieldHeight,b=c+f.canvasHeight,f.canvasX=0,f.canvasY=f.fieldHeight,f.labelWidth=f.w,f.labelY=b,f.upWidth=f.downW=f.w,f.upHeight=f.downH=15,f.upX=0,f.upY=f.fieldHeight,f.downX=0,f.downY=b-f.downH,f.fieldWidth=f.w,f.fieldX=0,f.scrollHandlerW=f.w,f.scrollHandlerH=parseInt((f.canvasHeight-f.upHeight-f.downH-f.labelHeight-
f.fieldHeight)/10),f.scrollHandlerH=15>f.scrollHandlerH?15:f.scrollHandlerH,f.limInf=b-f.downH-f.scrollHandlerH,f.limSup=c+f.downH;else{c=this.text_object.textNodes.metrics.w+parseInt(this.fieldFontSize);f.labelWidth=c;f.fieldWidth=b;""==w&&(f.labelWidth=0);f.visible||(f.fieldWidth=0);for(b=f.w-f.fieldWidth-f.labelWidth;58>b&&0<f.labelWidth;)f.labelWidth--,b++;for(;58>b&&0<f.fieldWidth;)f.fieldWidth--,b++;c=f.labelWidth;d=c+b;f.fieldWidth=f.w-d;f.canvasWidth=b;f.canvasHeight=f.h;f.canvasX=f.labelWidth;
f.canvasY=0;f.fieldX=f.canvasWidth+f.labelWidth;f.labelHeight=f.h;f.labelY=0;f.upWidth=f.downW=15;f.upHeight=f.downH=f.h;f.upX=d-f.downW;f.upY=0;f.downX=f.labelWidth;f.downY=0;f.scrollHandlerW=parseInt((f.canvasWidth-f.upWidth-f.downW)/10);f.scrollHandlerW=15>f.scrollHandlerW?15:f.scrollHandlerW;f.scrollHandlerH=f.h;f.limInf=c+f.downW;f.limSup=c+f.canvasWidth-f.downW-f.scrollHandlerW}f.container.setAttribute("style","width:"+f.w+"px;height:"+f.h+"px;left:"+f.x+"px;top:"+f.y+"px;z-index:"+f.zIndex+
";");f.canvas.setAttribute("width",f.w+"px");f.canvas.setAttribute("height",f.h+"px");f.canvas.setAttribute("style","position:absolute;left:0;top:0;");f.ctx=f.canvas.getContext("2d");f.ctx.imageSmoothingEnabled=!1;f.divUp.setAttribute("style","width:"+f.upWidth+"px;height:"+f.upHeight+"px;left:"+f.upX+"px;top:"+f.upY+"px;");f.divDown.setAttribute("style","width:"+f.downW+"px;height:"+f.downH+"px;left:"+f.downX+"px;top:"+f.downY+"px;");f.scrollHandler.setAttribute("style","width:"+f.scrollHandlerW+
"px;height:"+f.scrollHandlerH+"px;left:"+("v"===f.orientation?0:f.limInf)+"px;top:"+("v"===f.orientation?f.limInf:0)+"px;");f.field.setAttribute("style","font-size:"+f.fieldFontSize+"px;width:"+f.fieldWidth+"px;height:"+f.fieldHeight+"px;left:"+f.fieldX+"px;top:0;");0===f.fieldHeight&&(f.field.style.display="none");f.label.setAttribute("style","font-size:"+f.fieldFontSize+"px;width:"+f.labelWidth+"px;height:"+f.labelHeight+"px;line-height:"+f.labelHeight+"px;left:0;top:"+f.labelY+"px;background-color:"+
this.label_color.getColor()+";color:"+this.label_text_color.getColor()+";");this.label.width=f.labelWidth*this.ratio;this.label.height=f.labelHeight*this.ratio};z.prototype.update=function(){e=this.evaluator;0==e.eval(this.decimals)?this.incr=1:this.incr=(e.eval(this.max)-e.eval(this.min))/100;this.activeIfValue=0<e.eval(this.activeif);this.drawIfValue=0<e.eval(this.drawif);this.field.disabled=!this.activeIfValue;this.drawIfValue?(this.container.style.display="block",this.draw()):this.container.style.display=
"none";this.updatePositionAndSize();var a=this.validateValue(e.getVariable(this.id));a==this.value||0<Math.abs(a-this.value)&&1E-9>Math.abs(a-this.value)||(this.value=a,this.changeScrollPositionFromValue(),this.prePos=this.pos);this.value=a;this.field.value=this.formatOutputValue(this.value);e.setVariable(this.id,this.value);this.label_ctx.setTransform(this.ratio,0,0,this.ratio,0,0);this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),0,0);this.label_ctx.clearRect(0,0,this.label.width,
this.label.height);this.text_object.textNodes.metrics.w>this.label.width/this.ratio?(this.text_object.anchor="center_left",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),5,this.label.height/this.ratio/2)):(this.text_object.anchor="center_center",this.text_object.draw(this.label_ctx,this.label_text_color.getColor(),this.label.width/this.ratio/2,this.label.height/this.ratio/2));this.label_ctx.setTransform(1,0,0,1,0,0)};z.prototype.draw=function(){f=this;c=f.ctx;p=k(this.w);h=
k(this.h);c.fillStyle="#e0e4e8";c.fillRect(0,0,p,h);c.strokeStyle="#7a8a99";c.fillStyle="#ccdcec";f.down&&c.fillRect(f.downX+.5,f.downY+.5,f.downW,f.downH-1);c.strokeRect(f.downX+.5,f.downY+.5,f.downW,f.downH-1);f.up&&c.fillRect(f.upX+.5,f.upY-.5,f.upWidth,f.upHeight+1);c.strokeRect(f.upX+.5,f.upY-.5,f.upWidth,f.upHeight+1);b=4;c.fillStyle="black";c.beginPath();"h"===f.orientation?(c.moveTo(f.downX+b,f.downH/2),c.lineTo(f.downX+f.downW-b,b),c.lineTo(f.downX+f.downW-b,f.downH-b),c.moveTo(f.upX+f.upWidth-
b,f.downH/2),c.lineTo(f.upX+b,b),c.lineTo(f.upX+b,f.downH-b),c.fill(),f.activeIfValue&&(g=k(f.pos),c.fillStyle="#ccdcec",c.fillRect(g+.5,0,k(f.scrollHandlerW),h),c.strokeStyle="#6382bf",c.strokeRect(g+.5,0,k(f.scrollHandlerW),h),d=k(f.scrollHandlerW/2),c.beginPath(),c.moveTo(g+d+.5-2,3),c.lineTo(g+d+.5-2,h-3),c.moveTo(g+d+.5,3),c.lineTo(g+d+.5,h-3),c.moveTo(g+d+.5+2,3),c.lineTo(g+d+.5+2,h-3),c.stroke())):(c.moveTo(f.downX+f.downW/2,f.downY+f.downH-b),c.lineTo(f.downX+b,f.downY+b),c.lineTo(f.downX+
f.downW-b,f.downY+b),c.moveTo(f.upX+f.upWidth/2,f.upY+b),c.lineTo(f.upX+b,f.upY+f.upHeight-b),c.lineTo(f.upX+f.upWidth-b,f.upY+f.upHeight-b),c.fill(),f.activeIfValue&&(g=k(f.pos),c.fillStyle="#ccdcec",c.fillRect(0,g+.5,p,k(f.scrollHandlerH)),c.strokeStyle="#6382bf",c.strokeRect(0,g+.5,p,k(f.scrollHandlerH)),d=k(f.scrollHandlerH/2),c.beginPath(),c.moveTo(3,g+d+.5-2),c.lineTo(p-3,g+d+.5-2),c.moveTo(3,g+d+.5),c.lineTo(p-3,g+d+.5),c.moveTo(3,g+d+.5+2),c.lineTo(p-3,g+d+.5+2),c.stroke()));c.strokeRect(.5,
.5,p-1,h-1);f.activeIfValue||(c.fillStyle="rgba(240,240,240,"+160/255+")",c.fillRect(0,0,p,h.h))};z.prototype.validateValue=function(a){e=this.evaluator;v=a.toString();v=parseFloat(v.replace(this.parent.decimal_symbol,"."));isNaN(v)&&(v=0);this.minimo=e.eval(this.min);v<this.minimo&&(this.value=null,v=this.minimo);this.maximo=e.eval(this.max);v>this.maximo&&(this.value=null,v=this.maximo);q=this.incr;v=0!=q?v*q/q:0;this.fixed&&(v=parseFloat(parseFloat(v).toFixed(e.eval(this.decimals))));return v};
z.prototype.increase=function(){this.changeValue(parseFloat(this.value)+this.incr)};z.prototype.decrease=function(){this.changeValue(parseFloat(this.value)-this.incr)};z.prototype.increase10=function(){b=(this.evaluator.eval(this.max)-this.evaluator.eval(this.min))/10;"h"==this.orientation?this.clickPos.x>this.prePos&&this.changeValue(parseFloat(this.value)+b):this.clickPos.y<this.prePos&&this.changeValue(parseFloat(this.value)+b)};z.prototype.decrease10=function(){b=(this.evaluator.eval(this.max)-
this.evaluator.eval(this.min))/10;"h"==this.orientation?this.clickPos.x<this.prePos&&this.changeValue(parseFloat(this.value)-b):this.clickPos.y>this.prePos&&this.changeValue(parseFloat(this.value)-b)};z.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())};z.prototype.changeValueForScrollMovement=
function(){e=this.evaluator;y=this.limInf;m=this.limSup;l=e.eval(this.min);x=e.eval(this.max);q=this.incr;u=k((this.pos-y)*(x-l)/(m-y)/q)*q+l;u!=this.value&&(this.value=u,this.field.value=this.formatOutputValue(u),e.setVariable(this.id,this.value),this.parent.updateControls(),this.actionExec.execute(),this.parent.update())};z.prototype.changeScrollPositionFromValue=function(){e=this.evaluator;y=this.limInf;m=this.limSup;l=e.eval(this.min);x=e.eval(this.max);q=this.incr;this.pos=(this.value-l)*(m-
y)/(x-l)+y;this.scrollHandler.style["h"==this.orientation?"left":"top"]=this.pos+"px"};z.prototype.addEvents=function(){function b(c,d,g,l){a.clearTimeout(u);(m.up||m.down||m.canvasClick)&&1E-7<Math.abs(m.value-l)&&(d.call(m),c=g?c:30,u=a.setTimeout(function(){b(c,d,!1,l)},c))}function c(c){c.preventDefault();m.whichBtn=a.whichBtn(c);"L"==m.whichBtn&&m.activeIfValue&&(m.clickPos=a.getCursorPosition(c,m.container),m.canvasClick=!0,"h"==m.orientation?m.clickPos.x<m.prePos?b(350,m.decrease10,!0,m.minimo):
b(350,m.increase10,!0,m.maximo):m.clickPos.y<m.prePos?b(350,m.increase10,!0,m.maximo):b(350,m.decrease10,!0,m.minimo))}function d(b){m.canvasClick=!1;a.clearTimeout(u)}function g(b){1==m.canvasClick&&(m.clickPos=a.getCursorPosition(b,m.container),b.preventDefault())}function l(a){m.scrollClick=!1;m.prePos=m.pos;window.removeEventListener("mouseup",l,!1);window.removeEventListener("mousemove",h,!1);a.preventDefault()}function f(a){m.scrollClick=!1;m.prePos=m.pos;window.removeEventListener("touchend",
f,!1);window.removeEventListener("touchmove",h,!1);a.preventDefault()}function h(b){var c=a.getCursorPosition(b,m.container);"h"==m.orientation?(m.pos=m.prePos-(m.initPos.x-c.x),m.pos<m.limInf&&(m.pos=m.limInf),m.pos>m.limSup&&(m.pos=m.limSup),m.scrollHandler.setAttribute("style","width:"+m.scrollHandlerW+"px;height:"+m.h+"px;left:"+m.pos+"px;top:0;")):(m.pos=m.prePos-(m.initPos.y-c.y),m.pos>m.limInf&&(m.pos=m.limInf),m.pos<m.limSup&&(m.pos=m.limSup),m.scrollHandler.setAttribute("style","width:"+
m.w+"px;height:"+m.scrollHandlerH+"px;left:0;top:"+m.pos+"px;"));m.changeValueForScrollMovement();b.preventDefault()}function e(c){c.preventDefault();m.whichBtn=a.whichBtn(c);"L"==m.whichBtn&&m.activeIfValue&&(m.up=!0,b(350,m.increase,!0,m.maximo))}function k(c){c.preventDefault();m.whichBtn=a.whichBtn(c);"L"==m.whichBtn&&m.activeIfValue&&(m.down=!0,b(350,m.decrease,!0,m.minimo))}function q(b){m.down=!1;a.clearTimeout(u);b.preventDefault()}function p(b){m.up=!1;a.clearTimeout(u);m.draw()}function n(b){m.down=
!1;a.clearTimeout(u);m.draw()}var m=this,u;m.canvas.oncontextmenu=m.divUp.oncontextmenu=m.divDown.oncontextmenu=m.label.oncontextmenu=m.field.oncontextmenu=m.scrollHandler.oncontextmenu=function(){return!1};this.field.addEventListener("keydown",function(a){13==a.keyCode&&m.changeValue(m.field.value)});this.field.addEventListener("blur",function(a){m.drawIfValue&&m.changeValue(m.field.value,!0)});this.canvas.addEventListener("touchstart",c);this.canvas.addEventListener("mousedown",c);this.divDown.addEventListener("mouseout",
q);window.addEventListener("touchend",d);window.addEventListener("mouseup",d);this.canvas.addEventListener("touchmove",g);this.canvas.addEventListener("mousemove",g);this.scrollHandler.addEventListener("touchstart",function(b){m.activeIfValue&&(m.scrollClick=!0,m.initPos=a.getCursorPosition(b,m.container),window.addEventListener("touchend",f),window.addEventListener("touchmove",h),b.preventDefault())});this.scrollHandler.addEventListener("mousedown",function(b){m.activeIfValue&&(m.scrollClick=!0,
m.initPos=a.getCursorPosition(b,m.container),window.addEventListener("mouseup",l),window.addEventListener("mousemove",h),b.preventDefault())});this.divUp.addEventListener("touchstart",e);this.divUp.addEventListener("mousedown",e);this.divDown.addEventListener("touchstart",k);this.divDown.addEventListener("mousedown",k);this.divUp.addEventListener("mouseout",function(b){m.up=!1;a.clearTimeout(u);b.preventDefault()});this.divDown.addEventListener("mouseout",q);window.addEventListener("touchend",p);
window.addEventListener("mouseup",p);window.addEventListener("touchend",n);window.addEventListener("mouseup",n)};a.Scrollbar=z;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f=function(f,e){var c=a.Control.call(this,f,e)||this;c.controls=e.controls||!0;c.file=e.file||"";c.oldDrawIf=0;f=c.evaluator.eval(c.expresion);4==f[0].length?(c.w=f[0][2],c.h=f[0][3]):(c.w=200,c.h=28);c.audio=c.parent.getAudio(c.file);c.oldFile=c.file;"]"===c.file.charAt(c.file.length-1)&&(c.file=c.evaluator.parser.parse(c.file.substring(1,c.file.length-1)));c.autoplay&&(c.audio.setAttribute("autoplay","autoplay"),c.audio.play());c.loop&&c.audio.setAttribute("loop",
"loop");c.controls&&c.audio.setAttribute("controls","controls");c.audio.setAttribute("style","position:absolute;width:"+c.w+"px;left:"+c.x+"px;top:"+c.y+"px;z-index:"+c.zIndex+";");c.addControlContainer(c.audio);c.evaluator.setFunction(c.id+".play",function(){try{c.audio.play()}catch(h){}return 0});c.evaluator.setFunction(c.id+".pause",function(){try{c.audio.pause()}catch(h){}return 0});c.evaluator.setFunction(c.id+".stop",function(){try{c.audio.pause(),c.audio.currentTime=0}catch(h){}return 0});
c.evaluator.setFunction(c.id+".currentTime",function(a){try{c.audio.currentTime=parseFloat(a)}catch(p){}return 0});c.audio.addEventListener("timeupdate",function(a){c.evaluator.setVariable(c.id+".currentTime",c.audio.currentTime)});return c};$jscomp.inherits(f,a.Control);f.prototype.init=function(){this.audio.style.left=this.x+"px";this.audio.style.top=this.y+"px";this.update()};f.prototype.update=function(){k=this.evaluator;"string"!==typeof this.file&&(this.tmpFile=k.eval(this.file),this.oldFile!==
this.tmpFile&&(this.oldFile=this.audio.src=this.tmpFile));(e=0<k.eval(this.drawif))?this.audio.style.display="block":(this.audio.style.display="none",e!==this.oldDrawIf&&this.audio.pause());this.oldDrawIf=e;this.updatePositionAndSize()};a.Audio=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f=function(f,e){var c=a.Control.call(this,f,e)||this;c.controls=e.controls||!0;c.file=e.file||"";c.oldDrawIf=0;k=c.evaluator;f=k.eval(c.expresion);4==f[0].length?(c.w=f[0][2],c.h=f[0][3]):(c.w=null,c.h=null);f=c.file;e=f.lastIndexOf(".");-1!=e&&(f=c.file.substring(0,e));c.video=a.newHTML("video",{poster:f+".png",style:"position:absolute;overflow:hidden;left:"+c.x+"px;top:"+c.y+"px;outline:none;background:rgba(0,0,0,0);"});c.autoplay&&c.video.setAttribute("autoplay",
"autoplay");c.loop&&c.video.setAttribute("loop","loop");c.controls&&c.video.setAttribute("controls","controls");c.w&&(c.video.setAttribute("width",c.w),c.video.setAttribute("height",c.h));c.video.canPlayType("video/mp4")&&(e=a.newHTML("source",{src:f+".mp4",type:"video/mp4"}),c.video.appendChild(e));c.video.canPlayType("video/ogg")&&(e=a.newHTML("source",{src:f+".ogg",type:"video/ogg"}),c.video.appendChild(e),e=a.newHTML("source",{src:f+".ogv",type:"video/ogg"}),c.video.appendChild(e));c.video.canPlayType("video/webm")&&
(e=a.newHTML("source",{src:f+".webm",type:"video/webm"}),c.video.appendChild(e));c.addControlContainer(c.video);k.setFunction(c.id+".play",function(){try{c.video.play()}catch(h){}return 0});k.setFunction(c.id+".pause",function(){try{c.video.pause()}catch(h){}return 0});k.setFunction(c.id+".stop",function(){try{c.video.pause(),c.video.currentTime=0}catch(h){}return 0});k.setFunction(c.id+".currentTime",function(a){try{c.video.currentTime=parseFloat(a)}catch(p){}return 0});c.video.addEventListener("timeupdate",
function(a){k.setVariable(c.id+".currentTime",c.video.currentTime)});return c};$jscomp.inherits(f,a.Control);f.prototype.init=function(){this.video.style.left=this.x+"px";this.video.style.top=this.y+"px";this.update()};f.prototype.update=function(){k=this.evaluator;(e=0<k.eval(this.drawif))?this.video.style.display="block":(this.video.style.display="none",e!==this.oldDrawIf&&this.video.pause());this.oldDrawIf=e;this.updatePositionAndSize()};a.Video=f;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r=function(f,c){var h=a.Control.call(this,f,c)||this;h.font_family=c.font_family||"Monospaced";h.style=c.style||",PLAIN,";h.font_size=c.font_size||12;typeof("number"!==h.font_size)&&(h.font_size=h.evaluator.eval(h.font_size));h.font=h.font_family+h.style+h.font_size;h.region="interior";h.tabindex=++h.parent.tabindex;if(h.answer){h.answer.match("krypto_")&&(h.answer=(new a.Krypto).decode(h.answer.substring(7)));var e=h.parent.lessonParser.parseText(h.answer)}h.containerControl=
a.newHTML("div",{class:"DescartesTextAreaContainer",id:h.id,spellcheck:"false"});h.textArea=a.newHTML("div",{class:"DescartesTextAreaContainer",contenteditable:"true"});h.textAreaAnswer=a.newHTML("div",{class:"DescartesTextAreaContainer"});h.showButton=a.newHTML("div",{class:"DJS_Gradient"});h.activeCover=a.newHTML("div");h.containerControl.appendChild(h.textArea);h.containerControl.appendChild(h.textAreaAnswer);h.containerControl.appendChild(h.showButton);h.containerControl.appendChild(h.activeCover);
h.addControlContainer(h.containerControl);h.showAnswer=!1;h.text=void 0==h.text||"simpleText"==h.text.type?h.rawText||"":h.text.hasFormula?h.rawText:h.text.toHTML();e&&"simpleText"!==e.type&&(h.answer=h.text.hasFormula?"":e.toHTML());h.evaluator.setVariable(h.id,h.text);var b,g,d;h.evaluator.setFunction(h.id+".insertAtCursor",function(a){(b=window.getSelection())&&b.getRangeAt&&b.rangeCount&&(d=document.createTextNode(a),g=b.getRangeAt(0),g.deleteContents(),g.insertNode(d),g.setStart(d,d.length),
g.setEnd(d,d.length),b.removeAllRanges(),b.addRange(g),h.textArea.focus());return 0});h.evaluator.setFunction(h.id+".update",function(){h.update()});h.addEvents();h.init();return h};$jscomp.inherits(r,a.Control);r.prototype.init=function(){e=this.answer?28:4;k=this.evaluator;var f=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 c=
"padding:5px;width:"+(this.w-4)+"px;height:"+(this.h-e)+"px;left:2px;top:2px;background-color:white;text-align:left;font:"+a.convertFont(this.font)+";line-height:"+this.font_size+"px;";this.textArea.setAttribute("style",c);this.textArea.innerHTML=f;this.textAreaAnswer.setAttribute("style",c+"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(){k=this.evaluator;this.activeIfValue=0<k.eval(this.activeif);this.drawIfValue=0<k.eval(this.drawif);k.getVariable(this.id)!==this.oldValue&&(this.textArea.innerText=
(k.getVariable(this.id)||"").replace(/\\n/g,"\n"));f=this.textArea.innerText||"";f="\n"===f.charAt(f.length-1)?f.substring(0,f.length-1):f;f=f.replace(/\n/g,"\\n").replace(/\s/g," ");k.setVariable(this.id,f);this.oldFieldValue=f;this.oldValue=k.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 c=
this;this.showButton.addEventListener("mousedown",function(a){a.preventDefault();c.showAnswer=!c.showAnswer;c.textAreaAnswer.style.display=c.showAnswer?"block":"none";c.showButton.childNodes[0].childNodes[0].textContent=c.showAnswer?"T":"S"});this.showButton.addEventListener("mouseup",a);this.showButton.addEventListener("mouseout",a);this.textArea.addEventListener("blur",function(){var a=window.getSelection();c.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 k=2*Math.PI,e,f,r,n,c,h,p,b,g,d,v,q,u=function(b,c){var g=a.Control.call(this,b,c)||this;f=b.evaluator.parser;g.spaceID=c.spaceID||"";g.text=c.text||"";g.size=c.size||f.parse("4");g.font=c.font||"Serif,PLAIN,12";g.image=new Image;g.image.onload=function(){this.ready=1};g.imageSrc=c.imageSrc||"";g.imageSrc.match(/^\[.*\]?/)?g.imageSrc=g.parser.parse(g.imageSrc.substring(1,g.imageSrc.length-1)):g.imageSrc=g.parser.parse("'"+g.imageSrc+"'");g.font=a.convertFont(g.font);
if(g.constraintExpr){g.constraint=f.parse(g.constraintExpr);"(expr)"==g.constraint.type&&(g.constraint=f.parse(g.constraintExpr.substring(1,g.constraintExpr.length-1)));if("compOperator"==g.constraint.type){c=g.constraint.childs[0];var e=g.constraint.childs[1];"identifier"!=c.type||"y"!=c.value||e.contains("y")?"identifier"!=c.type||"x"!=c.value||e.contains("x")?g.newt=new a.R2Newton(g.evaluator,g.constraint):(g.constVar="y",g.noConstVar="x",g.evalConst=g.evalConstXoY,g.constraint=e):(g.constVar=
"x",g.noConstVar="y",g.evalConst=g.evalConstXoY,g.constraint=e)}else g.constraint=null;d=new a.R2(0,0)}g.container=g.getContainer();g.mouseCatcher=a.newHTML("div",{class:"DescartesGraphicControl",id:g.id,dragged:!0,tabindex:"-1",style:"cursor:pointer;background-color:transparent;z-index:"+g.zIndex+";"});g.ctx=g.space.ctx;g.container.appendChild(g.mouseCatcher);g.addEvents();g.xStr=g.id+".x";g.yStr=g.id+".y";g.activoStr=g.id+".activo";g.activeStr=g.id+".active";""!==g.space.id&&2!==b.version?(g.mxStr=
g.space.id+".mouse_x",g.myStr=g.space.id+".mouse_y",g.mclickedStr=g.space.id+".mouse_clicked",g.mclicizquierdoStr=g.space.id+".clic_izquierdo"):(g.mxStr="mouse_x",g.myStr="mouse_y",g.mclickedStr="mouse_clicked",g.mclicizquierdoStr="clic_izquierdo");g.init();return g};$jscomp.inherits(u,a.Control);u.prototype.init=function(b){e=this.evaluator;v=a.hasTouchSupport;b||(b=e.eval(this.expresion),this.x=b[0][0],this.y=b[0][1],e.setVariable(this.xStr,this.x),e.setVariable(this.yStr,this.y));this.img_src_eval=
e.eval(this.imageSrc).toString().trim();""==this.img_src_eval||this.img_src_eval.toLowerCase().match(/vacio.gif$/)?(this.width=2*e.eval(this.size),this.height=2*e.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.img_src_eval),this.width=this.image.width,this.height=this.image.height,this._w=Math.max(this.width,32),this._h=Math.max(this.height,
32));this.mouseCatcher.style.width=this._w+"px";this.mouseCatcher.style.height=this._h+"px";this.mouseCatcher.style.left=parseInt(this.space.getAbsoluteX(this.x)-this._w/2)+"px";this.mouseCatcher.style.top=parseInt(this.space.getAbsoluteY(this.y)-this._h/2)+"px";e.setVariable(this.activoStr,0);e.setVariable(this.activeStr,0);this.setImage=!1;this.update()};u.prototype.update=function(){e=this.evaluator;e.eval(this.imageSrc).toString().trim()!==this.img_src_eval&&this.init(!0);this.activeIfValue=0<
e.eval(this.activeif);this.drawIfValue=0<e.eval(this.drawif);this.x=e.getVariable(this.xStr);this.y=e.getVariable(this.yStr);r=this.space.getAbsoluteX(this.x);n=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(n-this._h/2)+"px";this.constraint&&this.evalConst();this.draw()};u.prototype.draw=function(){e=this.evaluator;this.drawIfValue&&(b=this.ctx,g=this.space.backgroundCtx,
r=parseInt(this.space.getAbsoluteX(this.x))+.5,n=parseInt(this.space.getAbsoluteY(this.y))+.5,""!=this.text&&this.drawText(r,n),this.image.ready?(c=this.image.width/2,h=this.image.height/2,this.image.complete&&!this.setImage&&b.drawImage(this.image,parseInt(r-c),parseInt(n-h)),this.trace&&(g.save(),g.translate(r,n),g.scale(parseInt(c),parseInt(h)),g.beginPath(),g.arc(0,0,1,0,k),g.restore(),g.lineWidth=1,g.strokeStyle=this.trace.getColor(),g.stroke())):(c=parseInt(this.width/2),b.beginPath(),b.arc(r,
n,c,0,k),b.fillStyle=this.colorInt.getColor(),b.fill(),b.lineWidth=1,b.strokeStyle=this.color.getColor(),b.stroke(),this.active&&(b.strokeStyle=this.colorInt.borderColor(),b.beginPath(),b.arc(r,n,c-2,0,k),b.stroke()),this.trace&&(g.strokeStyle=this.trace.getColor(),g.beginPath(),g.arc(r,n,c,0,k),g.stroke())))};u.prototype.evalConst=function(){d.set(this.x,this.y);p=this.newt.findZero(d,1/this.space.scale,!0);this.x=p.x;this.y=p.y;this.evaluator.setVariable(this.xStr,this.x);this.evaluator.setVariable(this.yStr,
this.y)};u.prototype.evalConstXoY=function(){e=this.evaluator;q=e.getVariable(this.constVar);e.setVariable(this.constVar,this[this.constVar]);this[this.noConstVar]=e.eval(this.constraint);e.setVariable(this.xStr,this.x);e.setVariable(this.yStr,this.y);e.setVariable(this.constVar,q)};u.prototype.drawText=function(a,c){b=this.ctx;e=this.evaluator;"simpleText"==this.text.type?(b.fillStyle=this.color.getColor(),b.font=this.font,b.textBaseline="alphabetic",b.fillText(this.text.toString(e.eval(this.decimals),
this.fixed),parseInt(a+1+this.width/2),parseInt(c-1-this.height/2))):(b.fillStyle=this.color.getColor(),b.strokeStyle=this.color.getColor(),b.textBaseline="alphabetic",this.text.draw(b,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,b,c=0,d=a.length;c<d;c++)if(b=a[c],b.id==this.spaceID)return b.addCtr(this),this.zIndex=b.zIndex,this.space=b,b.graphicControlContainer;
a[0].addCtr(this);this.zIndex=a[0].zIndex;this.space=a[0];return a[0].graphicControlContainer};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 b(b){document.body.focus();b.preventDefault();e.whichBtn=a.whichBtn(b);"L"==e.whichBtn&&e.activeIfValue&&(e.parent.deactivateGraphicControls(),e.click=e.active=!0,e.evaluator.setVariable(e.activoStr,
1),e.evaluator.setVariable(e.activeStr,1),e.evaluator.setVariable(e.mclickedStr,0),e.evaluator.setVariable(e.mclicizquierdoStr,0),e.posAnte=a.getCursorPosition(b,e.container),e.prePos={x:e.space.getAbsoluteX(e.x),y:e.space.getAbsoluteY(e.y)},e.evaluator.setVariable(e.mxStr,e.space.getRelativeX(e.posAnte.x)),e.evaluator.setVariable(e.myStr,e.space.getRelativeY(e.posAnte.y)),e.parent.update(),window.addEventListener("touchend",c),window.addEventListener("touchmove",d),window.addEventListener("mouseup",
c),window.addEventListener("mousemove",d))}function c(b){document.body.focus();b.preventDefault();b.stopPropagation();e.evaluator.setVariable(e.mclickedStr,1);e.evaluator.setVariable(e.mclicizquierdoStr,1);if(e.activeIfValue||e.active)e.click=!1,window.removeEventListener("mouseup",c),window.removeEventListener("mousemove",d),window.removeEventListener("touchend",c),window.removeEventListener("touchmove",d),f=a.getCursorPosition(b,e.container)||f,e.posX=e.prePos.x-(e.posAnte.x-f.x),e.posY=e.prePos.y-
(e.posAnte.y-f.y),e.evaluator.setVariable(e.xStr,e.space.getRelativeX(e.posX)),e.evaluator.setVariable(e.yStr,e.space.getRelativeY(e.posY)),e.evaluator.setVariable(e.mxStr,e.space.getRelativeX(f.x)),e.evaluator.setVariable(e.myStr,e.space.getRelativeY(f.y)),e.parent.updateControls(),e.parent.update(),e.mouseCatcher.style.left=e.space.getAbsoluteX(e.x)-e._w/2+"px",e.mouseCatcher.style.top=e.space.getAbsoluteY(e.y)-e._h/2+"px";e.parent.deactivateGraphicControls();e.parent.updateControls()}function d(b){b.preventDefault();
e.evaluator.setVariable(e.mclickedStr,0);e.evaluator.setVariable(e.mclicizquierdoStr,0);f=a.getCursorPosition(b,e.container);e.posX=e.prePos.x-(e.posAnte.x-f.x);e.posY=e.prePos.y-(e.posAnte.y-f.y);e.evaluator.setVariable(e.xStr,e.space.getRelativeX(e.posX));e.evaluator.setVariable(e.yStr,e.space.getRelativeY(e.posY));e.evaluator.setVariable(e.mxStr,e.space.getRelativeX(f.x));e.evaluator.setVariable(e.myStr,e.space.getRelativeY(f.y));80<Date.now()-g&&(e.parent.updateControls(),e.parent.update(),g=
Date.now())}var g=0,f,e=this;this.active=this.over=this.click=!1;this.mouseCatcher.oncontextmenu=function(){return!1};this.mouseCatcher.addEventListener("touchstart",b);this.mouseCatcher.addEventListener("mousedown",b);this.mouseCatcher.addEventListener("mouseover",function(a){e.over=!0});this.mouseCatcher.addEventListener("mouseout",function(a){e.over=!1;e.click=!1})};a.GraphicControl=u;return a}(descartesJS||{});
descartesJS=function(a,k){var e,f,r,n,c,h,p,b,g,d;function v(a){return a.charAt(0).toUpperCase()+a.substring(1)}if(a.loadLib)return a;var q=/[\w-//]*(\.png|\.jpg|\.gif|\.svg)/gi,u,y,m,l,x,w,z,A,G,J,E,F,D,B,L,I,M,O,H,P,C,N,K,Q,R,W,V,U,T,S=function(b){this.parent=b;this.parser=b.evaluator.parser;this.RTFparser=new a.RTFParser(b.evaluator)};S.prototype.parseButtonsConfig=function(a){var b={rowsNorth:0,rowsSouth:0,widthEast:125,widthWest:125,height:23};a=this.split(a);for(var c=0,d=a.length;c<d;c++)switch(m=
a[c][0],l=a[c][1],y=k[m],y){case "rowsNorth":case "rowsSouth":case "widthEast":case "widthWest":case "height":b[y]=parseInt(l);break;case "about":case "config":case "init":case "clear":b[y]="true"===k[l];break;default:console.warn("Propiedad de botones no identificada: <"+m+"> valor: <"+l+">")}return b};S.prototype.parseSpace=function(b){x={};b=this.split(b);for(var c=0,d=b.length;c<d;c++)switch(m=b[c][0],l=b[c][1],y=k[m],a.DEBUG.paramName=m,a.DEBUG.objectName="Space",y){case "type":if("R2"===l||
"R3"===l)l=k[l];x[y]=l;break;case "id":a.DEBUG.idName=l;case "x_axis":case "y_axis":case "cID":case "file":case "border_width":case "border_radius":case "info":x[y]=l;break;case "fixed":case "numbers":case "sensitive_to_mouse_movements":case "3D":case "split":case "resizable":x[y]="true"===k[l];break;case "bg_display":case "render":x[y]=k[l];break;case "border_color":case "net":case "net10":case "axes":case "text":x[y]=""!=l?"false"===k[l]?"":new a.Color(l,this.parent.evaluator):"";break;case "O.x":x.OxExpr=
l;break;case "O.y":x.OyExpr=l;break;case "image":x.imageSrc=l;break;case "x":u=l;"%"===u[u.length-1]?(x.xPercentExpr=u.trim(),u=(this.parent.container.width*parseFloat(u)/100).toString()):u=l;x.xExpr=this.parser.parse(u);break;case "y":u=l;"%"===u[u.length-1]?(x.yPercentExpr=u.trim(),u=(this.parent.container.height*parseFloat(u)/100).toString()):u=l;x.yExpr=this.parser.parse(u);break;case "width":u=l.trim();x.wModExpr=u;"%"===u[u.length-1]?(x.wExpr=u,u=this.parent.container.width*parseFloat(u)/100):
(u=parseFloat(l),u!=l&&(u=this.parent.container.width,x._w_=l.trim()));x.w=u;break;case "height":u=l.trim();x.hModExpr=u;"%"===u[u.length-1]?(x.hExpr=u,u=this.parent.container.height*parseFloat(u)/100):(u=parseFloat(l),u!=l&&(u=this.parent.container.height,x._h_=l.trim()));x.h=u;break;case "drawif":""!=l&&(x.drawif=this.parser.parse(l));break;case "scale":u=parseFloat(l);isNaN(u)&&(u=48);x.scale=u;break;case "background":x.background=new a.Color(l,this.parent.evaluator);break;default:console.warn("Propiedad del espacio no identificada: <"+
m+"> valor: <"+l+">")}return new a["Space"+x.type](this.parent,x)};S.prototype.parseControl=function(b){w={type:"Numeric",gui:"Spinner"};b=this.split(b);for(var c=0,d=b.length;c<d;c++)switch(m=b[c][0],l=b[c][1],y=k[m],a.DEBUG.paramName=m,a.DEBUG.objectName="Control",y){case "type":u=k[l.trim()];"graphic"===u?u="GraphicControl":"text"===u&&(u="TextArea");w.type=v(u);break;case "gui":u=k[l];"textfield"===u&&(u="TextField");w[y]=v(u);break;case "id":a.DEBUG.idName=l;case "name":case "parameter":case "tooltip":case "tooltipFont":case "Explanation":case "ExplanationFont":case "cID":case "options":case "font":case "font_family":case "file":case "answer":case "cssClass":case "radio_group":case "extra_style":case "info":w[y]=
l;break;case "region":case "position":case "action":case "msg_pos":case "poster":case "text_align":case "image_align":case "btn_pos":w[y]=k[l];break;case "fixed":case "visible":case "discrete":case "onlyText":case "evaluate":case "autoplay":case "loop":case "controls":case "flat":w[y]="true"===k[l];break;case "color":case "colorInt":case "label_color":case "label_text_color":case "trace":w[y]=new a.Color(l,this.parent.evaluator);break;case "font_size":case "drawif":case "activeif":case "decimals":case "min":case "max":case "size":""!==
l&&(w[y]=this.parser.parse(l));break;case "constraint":w.constraintExpr=l;break;case "image":w.imageSrc=l;break;case "image_dec":w.image_dec_src=l;break;case "image_inc":w.image_inc_src=l;break;case "space":w.spaceID=l;break;case "expresion":w.expresion=this.parser.parse(l.replace(")(",","));break;case "borderColor":w[y]="false"===k[l]?"":l;break;case "bold":"false"!=k[l]&&(w.bold="bold");break;case "italics":"false"!=k[l]&&(w.italics="italic");break;case "underlined":"false"!=k[l]&&(w.underlined=
!0);break;case "value":var g=l.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!=l&&(w.incr=this.parser.parse(l));break;case "exponentialif":w.exponentialif=parseFloat(l);break;case "text":w.rawText=l;g=this.parseText(l);for(var e=0,f=g.length;e<f;e++)g[e]=this.parser.parse(g[e],!1);w.text=g;break;default:e=m.indexOf("."),g=k[m.substring(0,e)],e=k[m.substring(e+
1)],"parameter"===g&&"font"===e?w.parameterFont=l:"Explanation"===g&&"font"===e?w.ExplanationFont=l:"tooltip"===g&&"font"===e?w.tooltipFont=l:console.warn("Propiedad de control no identificada: <"+m+"> valor: <"+l+">")}return new a["Numeric"===w.type?w.gui:w.type](this.parent,w)};S.prototype.parseGraphic=function(b,c,d,g){z={rotateExp:g,parameter:"t"};b=this.split(b);g=0;for(var e=b.length;g<e;g++)if(m=b[g][0],l=b[g][1],y=k[m],a.DEBUG.paramName=m,a.DEBUG.objectName="Graphic",""!=l)switch(y){case "type":a.DEBUG.idName=
l;z[y]=v(k[l]);break;case "align":case "anchor":case "lineDash":z[y]=k[l];break;case "background":case "abs_coord":case "visible":case "editable":case "fixed":case "vectors":case "bold":case "italics":case "underlined":z[y]="true"===k[l];break;case "shadowColor":case "color":case "fill":case "fillP":case "fillM":case "arrow":case "trace":z[y]="false"===k[l]?"":new a.Color(l,this.parent.evaluator);break;case "border_size":case "shadowBlur":case "shadowOffsetX":case "shadowOffsetY":case "family":case "parameter":case "info":case "font":case "font_family":case "name":case "init":case "end":z[y]=
l;break;case "drawif":case "width":case "decimals":case "size":case "spear":case "center":case "radius":case "border_radius":case "opacity":case "inirot":case "inipos":case "range":case "clip":""!==l&&(z[y]=this.parser.parse(l));break;case "font_size":l=l.trim();l.match(/^\[.*\]?/)&&(l=l.substring(1,l.length-1));""!==l&&(z[y]=this.parser.parse(l));break;case "space":z.spaceID=l;break;case "expresion":""!==l&&("Macro"!==z.type?(z.expresion=this.parser.parse(l),z.expresionString=l):z.expresion=l);break;
case "text":z.text=l;break;case "file":var f=l.replace(/&squot;/g,"'");"["===f.charAt(0)&&"]"===f.charAt(f.length-1)&&(f=f.substring(1,f.length-1));f.match(q)&&(f="'"+f+"'");z.file=this.parser.parse(f);break;case "border":""!=l&&"false"!=k[l]&&(z.border=new a.Color(l,this.parent.evaluator));break;default:if(void 0!=z.family&&m.substring(0,z.family.length+1)===z.family+".")switch(k[m.substring(z.family.length+1)]){case "interval":""!=l&&(z.family_interval=this.parser.parse(l));break;case "steps":""!=
l&&(z.family_steps=this.parser.parse(l))}else if(void 0!=z.parameter&&m.match(z.parameter+"."))switch(z.parameter!==m.substring(0,m.indexOf(z.parameter)+z.parameter.length)&&(z.parameter=m.substring(0,m.indexOf(z.parameter)+z.parameter.length)),k[m.substring(z.parameter.length+1)]){case "interval":""!=l&&(z.parameter_interval=this.parser.parse(l));break;case "steps":""!=l&&(z.parameter_steps=this.parser.parse(l))}else console.warn("Propiedad del gr\u00e1fico no identificada: <"+m+"> valor: <"+l+">")}c&&
(z.abs_coord=c);d&&(z.background=d);return new a[z.type](this.parent,z)};S.prototype.parse3DGraphic=function(b,c,d,g){z={rotateExp:g,parameter:"t"};b=this.split(b);c=0;for(d=b.length;c<d;c++)switch(m=b[c][0],l=b[c][1],y=k[m],a.DEBUG.paramName=m,a.DEBUG.objectName="Graphic3D",y){case "type":a.DEBUG.idName=l;u=k[l];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":z.subType=
u,u="OtherGeometry"}z[y]=v(u);break;case "model":case "align":case "anchor":case "lineDash":z[y]=k[l];break;case "shadowColor":case "fill":z[y]="false"===k[l]?"":new a.Color(l,this.parent.evaluator);break;case "background":case "fixed":case "split":case "bold":case "italics":case "underlined":z[y]="true"===k[l];break;case "edges":"false"===k[l]?z[y]="":("true"===k[l]&&(l="808080"),z[y]=new a.Color(l,this.parent.evaluator));break;case "border":""!=l&&"false"!=k[l]&&(z.border=new a.Color(l,this.parent.evaluator));
break;case "color":case "backcolor":z[y]=new a.Color(l,this.parent.evaluator);break;case "drawif":case "width":case "length":case "height":case "R":case "r":case "decimals":case "Nu":case "Nv":case "inipos":case "endpos":case "offset_angle":case "offset_dist":case "font_size":""!=l&&(z[y]=this.parser.parse(l));break;case "border_size":case "shadowBlur":case "shadowOffsetX":case "shadowOffsetY":case "family":case "parameter":case "font":case "font_family":case "name":case "inirot":case "endrot":case "info":z[y]=
l;break;case "space":z.spaceID=l;break;case "expresion":"Macro"!=z.type&&"Curve"!=z.type&&"Surface"!=z.type?(z.expresion=this.parser.parse(l),z.expresionString=l):z.expresion=l.replace(/\\n/g,";");break;case "text":z.text=l;break;case "file":g=l.replace(/&squot;/g,"'");"["===g.charAt(0)&&"]"===g.charAt(g.length-1)&&(g=g.substring(1,g.length-1));g.match(/./)&&(g="'"+g+"'");z.file=this.parser.parse(g);break;default:void 0!==z.family&&m.substring(0,z.family.length+1)===z.family+"."?"interval"===k[m.substring(z.family.length+
1)]?""!=l&&(z.family_interval=this.parser.parse(l)):""!=l&&(z.family_steps=this.parser.parse(l)):console.warn("Propiedad del gr\u00e1fico 3D no identificada: <"+m+"> valor: <"+l+">")}return new a[z.type+"3D"](this.parent,z)};S.prototype.parseAuxiliar=function(b){A={};b=this.split(b);for(var c=0,d=b.length;c<d;c++)b[c][1]=b[c][1].replace(/&squot;/g,"'");c=0;for(d=b.length;c<d;c++)switch(m=b[c][0],l=b[c][1],y=k[m],a.DEBUG.paramName=m,a.DEBUG.objectName="Auxiliar",y){case "info":case "code":case "doc":break;
case "id":a.DEBUG.idName=l;case "file":case "init":case "doExpr":case "whileExpr":case "range":case "local":case "expresion":case "condition":case "parameter":A[y]=l.replace(/&squot;/g,"'");break;case "editable":case "constant":case "array":case "matrix":case "algorithm":case "event":case "sequence":A[y]="true"===k[l];break;case "size":case "rows":case "columns":case "x":case "y":case "width":case "height":A[y]=this.parser.parse(l);break;case "evaluate":case "execution":case "msg_pos":case "action":case "type":A[y]=
k[l];break;default:var g=m.indexOf("."),e=k[m.substring(0,g)];g=k[m.substring(g+1)];"parameter"===e&&"font"===g?A.parameterFont=l:console.warn("Propiedad del auxiliar no identificada: <"+m+"> valor: <"+l+">")}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":b=new a.Constant(this.parent,A);A.evaluate&&"always"===A.evaluate&&this.parent.auxiliaries.push(b);break;case "algorithm":this.parent.auxiliaries.push(new a.Algorithm(this.parent,A));break;case "vector":b=new a.Vector(this.parent,A);A.evaluate&&"always"===A.evaluate&&this.parent.auxiliaries.push(b);break;
case "matrix":b=new a.Matrix(this.parent,A);A.evaluate&&"always"===A.evaluate&&this.parent.auxiliaries.push(b);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(b){G=b.action;J=b.parent;E=b.parameter;return G?new (a[v(G)])(J,E):{execute:function(){}}};S.prototype.parseAnimation=function(b){var c={};
b=this.split(b);for(var d=0,g=b.length;d<g;d++)switch(m=b[d][0],l=b[d][1],y=k[m],y){case "id":case "delay":case "init":case "doExpr":case "whileExpr":c[y]=l.replace(/&squot;/g,"'");break;case "controls":case "auto":case "loop":case "algorithm":case "evaluate":c[y]="true"===k[l];break;default:console.warn("Propiedad de la animaci\u00f3n no identificada: <"+m+">  <"+l+">")}return new a.Animation(this.parent,c)};S.prototype.parsePleca=function(k,q){k=this.split(k);f=e="";r=0;n="#536891";c="white";h=
"left";p="";b="SansSerif,BOLD,20";g="SansSerif,PLAIN,18";d=void 0;for(var u=0,v=k.length;u<v;u++)switch(m=k[u][0],l=k[u][1],m){case "title":e=l;break;case "subtitle":f=l;break;case "subtitlines":r=l;break;case "bgcolor":""!=l&&(n=(new a.Color(l,this.parent.evaluator)).getColor());break;case "fgcolor":""!=l&&(c=(new a.Color(l,this.parent.evaluator)).getColor());break;case "align":""!=l&&(h=l);break;case "titleimage":p=l;break;case "titlefont":b=""!=l?a.convertFont(l):a.convertFont(b);break;case "subtitlefont":g=
""!=l?a.convertFont(l):a.convertFont(g);break;default:console.warn("Propiedad de la pleca no identificada: <"+m+">  <"+l+">")}if(""===e&&""===f)return a.newHTML("div");O=g.substring(0,g.indexOf("px"));O=O.substring(O.lastIndexOf(" "));""!=p&&(H=this.parent.getImage(p),P=H.height);d=a.newHTML("div",{id:"descartesPleca"});P?(d.setAttribute("style","position:absolute;left:0;top:0;text-align:"+h+";width:"+q+"px;height:"+P+"px;background-color:"+n+";color:"+c+";padding-top:8px;padding:8px 15px 8px 15px;margin:0;overflow:hidden;z-index:1;"),
H.setAttribute("style","position: absolute;left:0;top:0;z-index:-1;width:100%;height:100%;"),d.appendChild(H)):d.setAttribute("style","position:absolute;left:0;top:0;text-align:"+h+";width:"+q+"px;background:"+n+";color:"+c+";padding:12px 15px 12px 15px;margin:0;z-index:100;");C=a.newHTML("div",{style:"padding:0;margin:0;font:"+b+";overflow:hidden;white-space:nowrap;"});C.innerHTML=e;N=a.newHTML("div");if(1===parseInt(r)){V=0;K=a.newHTML("div");K.innerHTML=f;document.body.appendChild(K);R=O;do R-=
V,K.setAttribute("style","padding:0;margin:0;font:"+g+";font-size:"+R+"px;width:"+(q-30)+"px;line-height:"+R+"px;"),Q=K.offsetHeight,W=Q/R,V=1;while(1<W&&8<R);document.body.removeChild(K);N.setAttribute("style","padding:0;margin:0;font:"+g+";font-size:"+R+"px;line-height:1em;overflow:hidden;white-space:nowrap;")}else N.setAttribute("style","padding:0;margin:0;font:"+g+";line-height:1em;");N.innerHTML=f;d.appendChild(C);d.appendChild(N);d.imageHeight=P;return d};S.prototype.split=function(a){if("string"!==
typeof a)return[];F=[];a=(a||"").replace(/\\'/g,"\u2019");D=B=I=0;for(L=M=!1;D<a.length;)" "!==a.charAt(D)||L||D++," "===a.charAt(D)||L||(L=!0,I=D),"="!==a.charAt(D)||"'"!==a.charAt(D+1)||M||(M=!0,F[B]=[a.substring(I,D)],I=D+2,D+=2),M&&"'"===a.charAt(D)&&(L=M=!1,F[B].push(a.substring(I,D)),B++),"="!==a.charAt(D)||"'"===a.charAt(D+1)||M||(F[B]=[a.substring(I,D)],I=D+1,D++,U=a.substring(D).indexOf("="),-1===U?T=U=a.length:(U+=D,T=a.substring(D,U).lastIndexOf(" "),T=-1===T?a.length:T+D),F[B].push(a.substring(I,
T)),B++,L=!1,D=T),D++;return F};S.prototype.parseText=function(b){b=b||"";return b.match(/^\{\\rtf1/)?this.RTFparser.parse(b.substring(10)):new a.SimpleText(this.parent,b)};a.LessonParser=S;return a}(descartesJS||{},babel);
descartesJS=function(a){function k(a,b){if(0==b)return 1;if(0>b)return NaN;if(0<=a||h(b)===b)return Math.pow(a,b);if(0>a){var c=1/b,d=h(c);if(d===c&&1===d%2)return-Math.pow(-a,b)}return NaN}function e(a,b){y=[];y.type="matrix";y.rows=a;y.cols=b;l=0;for(x=b;l<x;l++)y[l]=Array(a).fill(0);return y}function f(a,b){q=a.rows;u=a.cols;y=e(q,u);var c;for(l=0;l<q;l++)for(m=0;m<u;m++){for(x=c=0;x<u;x++)c+=a[x][l]*b[m][x];y[m][l]=c}return y}function r(a,b,c){for(var d=e(c.length-1,c.length-1),g=0,f=d.length;g<
f;g++)for(var l=0;l<f;l++)d[g][l]=g<a?l<b?c[g][l]:c[g][l+1]:g<b?c[g+1][l]:c[g+1][l+1];return d}function n(a){if(1<a.cols){for(var b=0,c=1,d=0,g=a.cols;d<g;d++)b+=c*a[0][d]*n(r(0,d,a)),c=-c;return b}return a[0][0]}if(a.loadLib)return a;var c={},h=Math.floor,p,b,g,d,v,q,u,y,m,l,x,w=function(a,b){this.sep="";this.type=a;this.value=b;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){g=this.childs.length-1;b=this.childs[g];b.parent=null;this.childs[g]=a;a.parent=this;return a};w.prototype.contains=function(a){if(this.value===a)return!0;for(var b=0,c=this.childs.length;b<c;b++)if(this.childs[b].contains(a))return!0;return!1};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")),d=this.getRoot(),d.setAllEvalFun(),
d):this};w.prototype.getChildren=function(){if("(expr)"===this.type||"[expr]"===this.type){if(this.childArray)return this.childArray;this.childArray=[];for(var a=0,b=this.childs.length;a<b;a++)if("square_bracket"===this.childs[a].type||"parentheses"===this.childs[a].type)this.childArray=this.childArray.concat(this.childs[a].childs);return this.childArray}return null};w.prototype.setAllEvalFun=function(){this.setEvalFun();for(var a=0,b=this.childs.length;a<b;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 b;this.evaluate=function(a,c){b=a.variables[this.value];if("object"===typeof b&&void 0==b.length)return b.evaluate(a);void 0==b&&(c||a.matrices[this.value]?b=a.matrices[this.value]:
a.vectors[this.value]&&(b=a.vectors[this.value]));return void 0!==b?b:0}}else if("identifier"===this.type&&"square_bracket"===this.childs[0].type&&1===this.childs[0].childs.length){var d;this.evaluate=function(a){try{return d=a.getVector(this.value,this.childs[0].childs[0].evaluate(a)),void 0!==d?d:0}catch(M){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 d=a.getMatrix(this.value,this.childs[0].childs[0].evaluate(a),
this.childs[0].childs[1].evaluate(a)),void 0!==d?d:0}catch(M){return 0}};else if("identifier"===this.type&&"parentheses"===this.childs[0].type){var g,v,x;this.evaluate=function(a){g=[];for(var b=0,d=this.childs[0].childs.length;b<d;b++)g[b]=this.childs[0].childs[b].evaluate(a);if("_Eval_"===this.value){p=0<g.length?g[0]:0;if("number"==typeof p)return"NaN";p.match(",")&&parseFloat(p.replace(",","."))==p.replace(",",".")&&(p=p.replace(",","."));if(void 0==c[p]){v=p.match(/:=/g)?!0:!1;if(p.match(";")){var e=
!1,f=[],l=0;b=0;for(d=p.length;b<d;b++){var h=p.charAt(b);"'"===h&&(e=!e);e||";"!==h||(f.push(p.substring(l,b)),l=b+1)}f.push(p.substring(l));p="("+f.join(")(")+")"}c[p]=a.parser.parse(p,v)}x=a.eval(c[p]);return void 0!=x?x:NaN}return a.functions[this.value].apply(a,g)}}else if("operator"===this.type)"+"===this.value?this.evaluate=function(b){var c=this.childs[0].evaluate(b,!0);b=this.childs[1].evaluate(b,!0);if("matrix"!==c.type||"matrix"!==b.type)return"number"==typeof c&&"string"==typeof b?c=a.removeNeedlessDecimals(c.toString()):
"string"==typeof c&&"number"==typeof b&&(b=a.removeNeedlessDecimals(b.toString())),c+b;q=c.rows;u=c.cols;y=e(q,u);for(l=0;l<q;l++)for(m=0;m<u;m++)y[m][l]=c[m][l]+b[m][l];return y}:"-"===this.value?this.evaluate=function(a){var b=this.childs[0].evaluate(a,!0);a=this.childs[1].evaluate(a,!0);if("matrix"!==b.type||"matrix"!==a.type)return b-a;q=b.rows;u=b.cols;y=e(q,u);for(l=0;l<q;l++)for(m=0;m<u;m++)y[m][l]=b[m][l]-a[m][l];return y}:"*"===this.value?this.evaluate=function(a){var b=this.childs[0].evaluate(a,
!0);a=this.childs[1].evaluate(a,!0);return"matrix"!==b.type||"matrix"!==a.type?b*a:f(b,a)}:"/"===this.value?this.evaluate=function(a){var b=this.childs[0].evaluate(a,!0);a=this.childs[1].evaluate(a,!0);if("matrix"!==b.type||"matrix"!==a.type)return b/a;var c=e(a.length,a.length),d=n(a);if(0===d)a=0;else{d=1/d;if(1<a.length)for(var g=0,l=a.length;g<l;g++){var h=d;for(var k=0;k<l;k++)c[k][g]=h*n(r(g,k,a)),h=-h;d=-d}else c[0][0]=d;a=c}b=0===a?e(b.rows,b.cols):f(b,a);return b}:"%"===this.value?this.evaluate=
function(a){var b=this.childs[0].evaluate(a);a=this.childs[1].evaluate(a);return b-h(b/a)*a}:"^"===this.value&&(this.evaluate=function(a){var b=this.childs[0].evaluate(a);a=this.childs[1].evaluate(a);return 0<=a?k(b,a):1/k(b,-a)});else if("compOperator"===this.type)"<"===this.value?this.evaluate=function(a){return+(this.childs[0].evaluate(a)<this.childs[1].evaluate(a))}:"<="===this.value?this.evaluate=function(a){return+(this.childs[0].evaluate(a)<=this.childs[1].evaluate(a))}:">"===this.value?this.evaluate=
function(a){return+(this.childs[0].evaluate(a)>this.childs[1].evaluate(a))}:">="===this.value?this.evaluate=function(a){return+(this.childs[0].evaluate(a)>=this.childs[1].evaluate(a))}:"=="===this.value?this.evaluate=function(a){return+(this.childs[0].evaluate(a)===this.childs[1].evaluate(a))}:"!="===this.value&&(this.evaluate=function(a){return+(this.childs[0].evaluate(a)!==this.childs[1].evaluate(a))});else if("boolOperator"===this.type)"&"===this.value?this.evaluate=function(a){return this.childs[0].evaluate(a)?
this.childs[1].evaluate(a)?1:0:0}:"|"===this.value?this.evaluate=function(a){return this.childs[0].evaluate(a)?1:this.childs[1].evaluate(a)?1:0}:"!"===this.value&&(this.evaluate=function(a){return+!this.childs[0].evaluate(a)});else if("conditional"===this.type)this.evaluate=function(a){return 0<this.childs[0].evaluate(a)?this.childs[1].evaluate(a):this.childs[2]?this.childs[2].evaluate(a):0};else if("sign"===this.type)this.evaluate="sign+"===this.value?function(a){return this.childs[0].evaluate(a)}:
function(a){return-this.childs[0].evaluate(a)};else if("parentheses"===this.type)this.evaluate=function(a,b){return this.childs[0].evaluate(a,b)};else if("(expr)"===this.type||"[expr]"===this.type)this.evaluate=function(a){var b=this.childs.length,c=[];if(1===b&&1===this.childs[0].childs.length&&"(expr)"===this.type)c=this.childs[0].childs[0].evaluate(a);else for(var d=0;d<b;d++){var g=[];for(var e=0,f=this.childs[d].childs.length;e<f;e++)g.push(this.childs[d].childs[e].evaluate(a));c[d]=g}return c};
else if("assign"===this.type){var w,D=this.childs[0],B=this.childs[1],L=D.childs[0]?D.childs[0].childs:null;this.evaluate=1===D.childs.length&&"square_bracket"===D.childs[0].type&&1===L.length?function(a){w=B.evaluate(a);a.setVector(D.value,L[0].evaluate(a),w);return w}:1===D.childs.length&&"square_bracket"===D.childs[0].type&&2===L.length?function(a){w=B.evaluate(a);a.setMatrix(D.value,L[0].evaluate(a),L[1].evaluate(a),w);return w}:function(a){w=B.evaluate(a);return w.type?a.matrices[D.value]=w:
"object"!==typeof a.variables[D.value]?a.variables[D.value]=w:0}}};a.Node=w;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h,p,b=/^\s+/,g=/^[a-zA-Z_\u00C0-\u021B\u0391-\u03C9]+[a-zA-Z_0-9\u00C0-\u021B\u0391-\u03C9]*([.]*[0-9a-zA-Z_\u00C0-\u021B\u0391-\u03C9]+[0-9]*)*/,d=/^[0-9]+[.][0-9]+|^[.][0-9]+|^[0-9]+/,v=/^==|^!=|^<=|^<|^>=|^>|^#/,q=/^!|^~|^&&|^&|^\|\||^\|/,u=/^=|^:=/,y=/^[\?:]/,m=/^[\+\-\*\/%\^\u2212\u00b7\u00D7\u00F7]/,l=/^\[|^\]/,x=/^\(|^\)/,w=/^,/,z=/^;/,A=/\|/g,G=/\|\*/g,J=/\*\|/g,E,F=/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/,
D=function(){};D.prototype.tokenize=function(F){function B(a,b,d){e.push({type:a,value:b});c=c.slice(d);r+=d;p=a}if(k=F){var D=F.indexOf("//");0<=D&&":"!==F[D-1]&&(F=F.substring(0,D));F=F.replace(/\\u(\S+) /g,function(a,b){return 39!==parseInt(b,16)?String.fromCharCode(parseInt(b,16)):a});F=F.replace(/&sup(.+);/g,"^ $1 ");F=F.replace(/&squot;/g,"'");F.match(/=\|\*/g)&&(F=F.replace(G,"'").replace(J,"'"));F.match(/=\|/g)&&(F=F.replace(A,"'"));D=F.trim();"|"==D.charAt(0)&&"|"==D.charAt(D.length-1)&&
(F=D.replace(A,"'"))}e=[];f=!1;r=0;c=F;for(p="";F&&r<F.length;)if(f=r,"'"==c[0]){for(h=1;"'"!=c[h];)if(h<c.length)h++;else{console.info(">Error, unknown symbol: ["+c+"], in the string \u300a"+k+"\u300b");return}n=c.substring(1,h);B("string",n,n.length+2)}else if(n=c.match(b))c=c.slice(n[0].length),r+=n[0].length;else if(n=c.match(m))n[0]=n[0].replace(/\u00F7/g,"/").replace(/\u2212/g,"-").replace(/\u00b7/g,"*").replace(/\u00D7/g,"*"),B("operator",n[0],n[0].length);else if(n=c.match(g))"number"===p&&
e.push({type:"operator",value:"*"}),B("identifier",n[0],n[0].length);else if(n=c.match(d))B("number",n[0],n[0].length);else if(n=c.match(v))D=n[0],"#"==D&&(D="!="),B("compOperator",D,n[0].length);else if(n=c.match(q))D=n[0],"||"==D?D="|":"&&"==D?D="&":"~"==D&&(D="!"),B("boolOperator",D,n[0].length);else if((n=c.match(u))&&!c.match(/^==/))B("assign",n[0],n[0].length);else if(n=c.match(y))B("conditional",n[0],n[0].length);else if(n=c.match(l))B("square_bracket",n[0],n[0].length);else if(n=c.match(x))"("==
n&&"number"===p&&e.push({type:"operator",value:"*"}),B("parentheses",n[0],n[0].length);else if(n=c.match(w))B("separator",n[0],n[0].length);else if(178===c.charCodeAt(0))e.push({type:"operator",value:"^"}),B("number",2,1);else if(179===c.charCodeAt(0))e.push({type:"operator",value:"^"}),B("number",3,1);else if(n=c.match(z))B("final_of_expression",n[0],n[0].length);else if(f==r){a.DEBUG.setError(a.DEBUG.EXPRESSION,k);return}return e};D.prototype.flatTokens=function(a,b){a=a||[];b=b||"";E="";for(var c=
0,d=a.length;c<d;c++)E="string"==a[c].type?E+"&squot;"+a[c].value+"&squot;":"identifier"!=a[c].type||a[c].value.match(F)?E+a[c].value:E+b+a[c].value;return E};a.Tokenizer=D;return a}(descartesJS||{});
descartesJS=function(a){function k(a){switch(a){case "=":return 1;case ":=":return 1;case "(":return 2;case "[":return 2;case "?":return 2;case ":":return 3;case "?:":return 3;case "|":return 6;case "&":return 7;case "<":return 5;case "<=":return 5;case ">":return 5;case ">=":return 5;case "==":return 5;case "!=":return 5;case "+":return 6;case "-":return 6;case "/":return 7;case "*":return 7;case "sign-":return 7;case "sign+":return 7;case "!":return 8;case "%":return 8;case "^":return 9;default:return 9}}
function e(a){return isNaN(parseFloat(a))?a.replace(/^\s|\s$/g,"").replace(/^'|'$/g,""):parseFloat(a)==a?parseFloat(a):a.replace(/^\s|\s$/g,"").replace(/^'|'$/g,"")}if(a.loadLib)return a;a.reservedIds=new String("-_-rnd-pi-\u03c0-e-Infinity-isTouch-esT\u00e1ctil-screenOrientation-screenWidth-screenHeight-sqr-sqrt-ra\u00edz-exp-log-log10-abs-ent-sgn-ind-sin-sen-cos-tan-cot-sec-csc-sinh-senh-cosh-tanh-coth-sech-csch-asin-asen-acos-atan-atan2-floor-ceil-round-min-max-_Trace_-_Print_-_Num_-_Stop_Audios_-esCorrecto-escorrecto-parent.set-parent.update-parent.exec-toFixed-_NumToStr_-_NumACadena_-charAt-_charAt_-_letraEn_-substring-_substring_-_subcadena_-strLength-_length_-_longitud_-indexOf-_indexOf_-\u00edndiceDe-lastIndexOf-replace-_replace_-_reemplazar_-toLowerCase-toUpperCase-trim-_Load_-_GetValues_-_GetMatrix_-_MatrixToStr_-_StrToMatrix_-_GetVector_-_VectorToStr_-_StrToVector_-_ExecStr_-_ExecBlock_-_Save_-_Open_-_SaveState_-_OpenState_-_AnchoDeCadena_-_strWidth_-R-G-B-_Rojo_-_Red_-_Verde_-_Green_-_Azul_-_Blue_-DJS.typeof-");
var f=Date.now(),r,n,c,h,p,b,g,d,v,q,u,y,m=function(b){this.evaluator=b;this.tokenizer=new a.Tokenizer;this.vectors={};this.matrices={};this.variables={};this.functions={};this.definitions={};this.registerDefaultValues();this.registerExternalValues&&this.registerExternalValues()};m.prototype.setDefinition=function(a,b){this.definitions[a]=b};m.prototype.getDefinition=function(a){return this.definitions[a]};m.prototype.setVariable=function(a,b){this.variables[a]=b};m.prototype.getVariable=function(a,
b){b&&(this.variables[a]=void 0!==this.variables[a]?this.variables[a]:void 0);return this.variables[a]};m.prototype.setVector=function(a,b,c){this.vectors[a][b]=c};m.prototype.getVector=function(a){this.vectors.hasOwnProperty(a)||(this.vectors[a]=[0,0,0]);return this.vectors[a]};m.prototype.setMatrix=function(a,b,c,d){this.matrices[a][b][c]=d};m.prototype.getMatrix=function(a){this.matrices.hasOwnProperty(a)||(this.matrices[a]=[[0,0,0],[0,0,0],[0,0,0]]);return this.matrices[a]};m.prototype.setFunction=
function(a,b){this.functions[a]=b};m.prototype.getFunction=function(a){this.functions.hasOwnProperty(a)||(this.functions[a]=function(){return 0});return this.functions[a]};m.prototype.parse=function(e,f){(c=this.tokenizer.tokenize(e))||(c=[]);h=null;f=!f||!1;r=d=g=b=0;for(n=c.length;r<n;r++){v=c[r];q=v.value;u=v.type;if("identifier"===u)if(r+1<n&&"parentheses"===c[r+1].type&&"("===c[r+1].value)this.getFunction(q);else if(r+1<n&&"square_bracket"===c[r+1].type&&"["===c[r+1].value)c[r+3]&&"square_bracket"===
c[r+3].type&&"]"===c[r+3].value?this.getVector(q):this.getMatrix(q);else{var l=q.match(/(\w*)\.mouse_x|(\w*)\.mouse_y|(\w*)\.mouse_pressed|(\w*)\.mouse_clicked|(\w*)\.clic_izquierdo/);l&&(this.variables[(l[1]||l[2]||l[3]||l[4]||l[5])+".DESCARTESJS_no_fixed"]=1);this.getVariable(q,!0)}"assign"===u&&f&&":="!=q&&(u="compOperator",q="==");if("assign"===u)if(p=new a.Node(u,q),null!=h)if("identifier"===h.type)h.parent&&h.parent.replaceLastChild(p),p.addChild(h),h=p,f=!0;else if("square_bracket"===h.type)p.addChild(h.parent),
h=p,f=!0;else{p.type="compOperator";p.value="==";for(f=!0;h.parent&&k(h.parent.value)>=k(p.value);)h=h.parent;h.parent&&h.parent.replaceLastChild(p);p.addChild(h);h=p}else{console.info("Error1: en la expresi\u00f3n \u300a "+e+" \u300b, en el token {valor: "+q+", tipo: "+u+"}");break}else if("parentheses"===u&&"("===q||"square_bracket"===u&&"["===q)if(p=new a.Node(u,q),"("===q&&b++,"["===q&&g++,null===h)"("===q&&(new a.Node("(expr)","(expr)")).addChild(p),"["===q&&(new a.Node("[expr]","[expr]")).addChild(p),
h=p;else if("operator"===h.type||"boolOperator"===h.type||"compOperator"===h.type||"conditional"===h.type||"assign"===h.type)h.addChild(p),h=p;else if("sign"===h.type)h.addChild(p),h=p;else if("parentheses"===h.type&&"("===h.value)h.addChild(p),h=p;else if("square_bracket"===h.type&&"["===h.value)h.addChild(p),h=p;else if("parentheses"===h.type&&"()"===h.value)h.parent.addChild(p),h=p;else if("square_bracket"===h.type&&"[]"===h.value)h.parent.addChild(p),h=p;else if("identifier"===h.type)h.addChild(p),
h=p;else{console.info("Error2: en la expresi\u00f3n \u300a "+e+" \u300b, en el token ["+r+"] {valor: "+q+", tipo: "+u+"}");break}else if("parentheses"===u&&")"===q)if(b--,null===h)console.info("Error3: en la expresi\u00f3n \u300a "+e+" \u300b, en el token (valor:"+q+", 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&&"]"===q)if(g--,null===h)console.info("Error5: en la expresi\u00f3n \u300a "+
e+" \u300b, en el token (valor:"+q+", 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 "+e+" \u300b, en el token {valor: "+q+", tipo: "+u+"}");break}}else if("number"===u||"string"===u||"identifier"===u)if(p=new a.Node(u,q),null===h)h=p;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||"assign"===h.type)h.addChild(p),h=p;else{a.DEBUG.setError(a.DEBUG.EXPRESSION,e);break}else if("operator"===u||"compOperator"===u||"boolOperator"===u)if(p=new a.Node(u,q),null===h)if("-"===q||"+"===q)p.type="sign",p.value="sign"+q,h=p;else if("!"===q)h=p;else{console.info("Error8: en la expresi\u00f3n \u300a "+e+" \u300b, en el token {valor: "+q+", tipo: "+u+"}");break}else if("operator"===h.type||"compOperator"===h.type||"boolOperator"===
h.type||"assign"===h.type||"conditional"===h.type||"square_bracket"===h.type&&"["===h.value&&("-"===q||"+"===q||"!"===q)||"parentheses"===h.type&&"("===h.value&&("-"===q||"+"===q||"!"===q)){if("-"===q||"+"===q)p.type="sign",p.value="sign"+q;h.addChild(p);h=p}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||"assign"===h.type){for(;h.parent&&k(h.parent.value)>=k(p.value);)h=
h.parent;h.parent&&h.parent.replaceLastChild(p);p.addChild(h);h=p}else{console.info("Error9: en la expresi\u00f3n \u300a "+e+" \u300b, en el token {valor: "+q+", tipo: "+u+"}");break}else if("conditional"===u)if(p=new a.Node(u,q),null!=h)if("?"===p.value){for(d++;h.parent&&k(h.parent.value)>k(p.value);)h=h.parent;h.parent&&h.parent.replaceLastChild(p);p.addChild(h);h=p}else{for(d--;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 "+
e+" \u300b, en el token {valor: "+q+", tipo: "+u+"}");break}}else{console.info("Error11: en la expresi\u00f3n \u300a "+e+" \u300b, en el token {valor: "+q+", 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 "+e+" \u300b, en el token {valor: "+q+", tipo: "+u+"}");break}else{console.info("Error13: en la expresi\u00f3n \u300a "+e+" \u300b, en el token {valor: "+q+", tipo: "+u+"}");break}}0<
b&&a.DEBUG.setError(a.DEBUG.PARENTHESIS_CLOSING,e);0>b&&a.DEBUG.setError(a.DEBUG.PARENTHESIS_OPENING,e);0<g&&a.DEBUG.setError(a.DEBUG.BRACKET_CLOSING,e);0>g&&a.DEBUG.setError(a.DEBUG.BRACKET_OPENING,e);0!=d&&a.DEBUG.setError(a.DEBUG.INCOMPLETE_IF,e);(y=h?h.getRoot():null)&&y.setAllEvalFun();return y};m.prototype.registerDefaultValues=function(){var b=this;b.variables.rnd=Math.random;b.variables.pi=b.variables["\u03c0"]=a.returnValue(Math.PI);b.variables.e=a.returnValue(Math.E);b.variables.Infinity=
Infinity;b.variables["-Infinity"]=-Infinity;b.variables.isTouch=b.variables["esT\u00e1ctil"]=a.hasTouchSupport?1:0;Object.defineProperties(b.variables,{screenOrientation:{get:function(){return window.matchMedia("(orientation: landscape)").matches?"landscape":"portrait"}},screenWidth:{get:function(){return window.innerWidth}},screenHeight:{get:function(){return window.innerHeight}}});b.functions.sqr=function(a){return a*a};b.functions.sqrt=b.functions["ra\u00edz"]=Math.sqrt;b.functions.exp=Math.exp;
b.functions.log=Math.log;b.functions.log10=function(a){return Math.log(a)/Math.log(10)};b.functions.abs=Math.abs;b.functions.ent=Math.floor;b.functions.sgn=function(a){return 0<a?1:0>a?-1:0};b.functions.ind=function(a){return a?1:0};b.functions.sin=b.functions.sen=Math.sin;b.functions.cos=Math.cos;b.functions.tan=Math.tan;b.functions.cot=function(a){return 1/Math.tan(a)};b.functions.sec=function(a){return 1/Math.cos(a)};b.functions.csc=function(a){return 1/Math.sin(a)};b.functions.sinh=b.functions.senh=
function(a){return(Math.exp(a)-Math.exp(-a))/2};b.functions.cosh=function(a){return(Math.exp(a)+Math.exp(-a))/2};b.functions.tanh=function(a){return(Math.exp(a)-Math.exp(-a))/(Math.exp(a)+Math.exp(-a))};b.functions.coth=function(a){return 1/b.functions.tanh(a)};b.functions.sech=function(a){return 1/b.functions.cosh(a)};b.functions.csch=function(a){return 1/b.functions.sinh(a)};b.functions.asin=b.functions.asen=Math.asin;b.functions.acos=Math.acos;b.functions.atan=Math.atan;b.functions.atan2=Math.atan2;
b.functions.floor=Math.floor;b.functions.ceil=Math.ceil;b.functions.round=Math.round;b.functions.min=Math.min;b.functions.max=Math.max;b.functions._Trace_=b.functions._Print_=function(){console.info.apply(console,arguments);return 0};b.functions._Num_=function(a){if("number"==typeof a)return"NaN";a=a.replace(",",".");return parseFloat(a)==a?parseFloat(a):"NaN"};b.functions._Stop_Audios_=function(){b.evaluator.parent.stopAudios()};b.functions.esCorrecto=function(c,d,g){return a.esCorrecto(c,d,b.evaluator,
g)};b.functions.escorrecto=function(c,d,g){return a.escorrecto(c,d,b.evaluator,g)};window.parent!==window&&(b.functions["parent.set"]=function(a,b){window.parent.postMessage({type:"set",name:a,value:b},"*");return 0},b.functions["parent.update"]=function(){window.parent.postMessage({type:"update"},"*");return 0},b.functions["parent.exec"]=function(a,b){window.parent.postMessage({type:"exec",name:a,value:b},"*");return 0});b.functions.toFixed=b.functions._NumToStr_=b.functions._NumACadena_=function(a,
b){a=isNaN(parseFloat(a))?0:parseFloat(a);return a.toFixed(parseInt(b||0))};b.functions.charAt=b.functions._charAt_=b.functions._letraEn_=function(a,b){a=(a||"").toString();b=isNaN(parseInt(b))?0:parseInt(b);return a.charAt(b)};b.functions.substring=b.functions._substring_=b.functions._subcadena_=function(a,b,c){a=(a||"").toString();b=isNaN(parseInt(b))?0:parseInt(b);c=isNaN(parseInt(c))?0:parseInt(c);return 0<=b&&0<=c?a.substring(b,c):0>b&&0<=c?a.substring(c):0>c&&0<=b?a.substring(b):""};b.functions.strLength=
b.functions._length_=b.functions._longitud_=function(a){return(a||"").toString().length};b.functions.indexOf=b.functions._indexOf_=b.functions["_\u00edndiceDe_"]=function(a,b){return(a||"").toString().indexOf((b||"").toString())};b.functions.lastIndexOf=function(a,b){return(a||"").toString().lastIndexOf((b||"").toString())};b.functions.replace=b.functions._replace_=b.functions._reemplazar_=function(a,b,c){a=(a||"").toString();b=(b||"").toString();c=(c||"").toString();for(var d=a.indexOf(b);0<=d;)a=
a.substring(0,d)+c+a.substring(d+b.length),d=a.indexOf(b,d+c.length);return a};b.functions.toLowerCase=function(a){return(a||"").toString().toLowerCase()};b.functions.toUpperCase=function(a){return(a||"").toString().toUpperCase()};b.functions.trim=function(a){return(a||"").toString().trim()};b.functions._Load_=function(b){var c="";b&&(c=(c=document.getElementById(b))&&"descartes/archivo"==c.type?c.text:a.openExternalFile(b));return c||""};b.functions._GetValues_=function(a,c){return b.functions._ExecBlock_(b.functions._Load_(a).replace(/&brvbar;/g,
String.fromCharCode("166")),c)};b.functions._GetMatrix_=function(a,c){return b.functions._StrToMatrix_(b.functions._Load_(a).replace(/&brvbar;/g,String.fromCharCode("166")),c)};b.functions._MatrixToStr_=function(c){var d=b.matrices[c];if(d){for(var g="<"+c+">\\n",e=b.getVariable(c+".columnas_usadas")||d.cols||0,f=b.getVariable(c+".filas_usadas")||d.rows||0,h,k=0;k<e;k++){for(var q=0;q<f;q++)h=d[k][q],void 0!==h&&("string"==typeof h?h="'"+h+"'":"number"==typeof h&&(h=a.removeNeedlessDecimals(h.toFixed(6))),
g+=h+(q<f-1?" \u00a6 ":""));g=g.replace(/(\u00A6 )$/g,"")+"\\n"}return g+"</"+c+">"}return""};b.functions._StrToMatrix_=function(a,c){var d=[],g=!1,f=!1;d.type="matrix";if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var h=0,k=a.length;h<k;h++)a[h].match("<"+c+">")?(f=!0,g=a[h].trim().split("<"+c+">"),2==g.length&&""!=g[1]&&d.push(g[1].split(String.fromCharCode("166")).map(e)),g=!0):(a[h].match("</"+c+">")&&(g=a[h].trim().split("</"+c+">"),2==g.length&&""!=g[0]&&d.push(g[0].split(String.fromCharCode("166")).map(e)),
g=!1,h=a.length),g&&d.push(a[h].split(String.fromCharCode("166")).map(e)));b.matrices[c]=d;b.matrices[c].rows=d&&d[0]&&d[0].length?d[0].length:0;b.matrices[c].cols=d&&d.length?d.length:0;b.setVariable(c+".filas",b.matrices[c].rows);b.setVariable(c+".columnas",b.matrices[c].cols)}return f?"OK":"ERROR"};b.functions._GetVector_=function(a,c){return b.functions._StrToVector_(b.functions._Load_(a),c)};b.functions._VectorToStr_=function(a){var c=b.vectors[a];if(c){for(var d="<"+a+">\\n",g=b.getVariable(a+
".long_usada")||c._size_||0,e,f=0;f<g;f++)e=c[f],void 0!==e?("number"==typeof e&&(e=parseFloat(e)),d+=e+"\\n"):d+="0\\n";return d+"</"+a+">"}return""};b.functions._StrToVector_=function(a,c){var d=[],g=!1,f=!1;d.type="vector";if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var h=0,k=a.length;h<k;h++)a[h].match("<"+c+">")?g=f=!0:(a[h].match("</"+c+">")&&(g=!1,h=a.length),g&&d.push(e(a[h])));d._size_=d.length;b.vectors[c]=d;b.setVariable(c+".long",d.length);b.setVariable(c+".long_usada",d.length)}return f?
"OK":"ERROR"};b.functions._ExecStr_=function(a){return b.functions._ExecBlock_(a,"")};b.functions._ExecBlock_=function(a,c){var d=[],g=""==c;if(a){a=a.replace(/\r|\\r/g,"").split(/\n|\\n/);for(var e=0,f=a.length;e<f;e++)a[e].match("<"+c+">")?(g=a[e].trim().split("<"+c+">"),2==g.length&&""!=g[1]&&(d=d.concat(g[1].split(String.fromCharCode("166")))),g=!0):a[e].match("</"+c+">")?(g=a[e].trim().split("</"+c+">"),2==g.length&&""!=g[0]&&(d=d.concat(g[0].split(String.fromCharCode("166")))),g=!1):g&&(d=d.concat(a[e].split(String.fromCharCode("166"))));
e=0;for(f=d.length;e<f;e++)g=d[e].split("="),g[0]=g[0].trim(),2==g.length&&""!=g[0]&&(isNaN(parseFloat(g[1]))?b.setVariable(g[0],g[1].replace(/^\s|\s$/g,"").replace(/^'|'$/g,"")):b.setVariable(g[0],parseFloat(g[1])))}return 0};var c=a.newHTML("a",{target:"_blank"}),d,g=null;a.newBlobContent=null;b.functions._Save_=function(e,h){b.evaluator.parent.removeButtonClick();1500<Date.now()-f&&(f=Date.now(),document.body.appendChild(c),g=h.replace(/\\r/g,"").replace(/\\n/g,"\r\n").replace(/\\q/g,"'").replace(/\\_/g,
"\\"),d=new Blob(["\ufeff",g],{type:"text/plain;charset=utf-8"}),c.setAttribute("href",window.URL.createObjectURL(d)),c.setAttribute("download",e),g!=a.newBlobContent&&(c.click(),a.newBlobContent=g),document.body.removeChild(c));return 0};var h=a.newHTML("a",{target:"_blank"});b.functions._SaveSpace_=function(c,d){b.evaluator.parent.removeButtonClick();1500<Date.now()-f&&(f=Date.now(),document.body.appendChild(h),g=d,h.setAttribute("href",g),h.setAttribute("download",c),g!=a.newBlobContent&&(h.click(),
a.newBlobContent=g),document.body.removeChild(h));return 0};var k,q,p=a.newHTML("input",{type:"file"});p.addEventListener("change",function(c){k=c.target.files;q=new FileReader;q.onload=function(c){a.addExternalFileContent(k[0].name,c.target.result);b.setVariable("DJS.fileName",k[0].name);b.setVariable("DJS.fileContent",c.target.result);b.getFunction(b._callback)&&(b.getFunction(b._callback).apply(b.evaluator,[]),b.evaluator.parent.update());p.value=""};0<k.length&&q.readAsText(k[0])});b.functions._Open_=
function(a){b.evaluator.parent.removeButtonClick();1500<Date.now()-f&&(b._callback=a,p.click(),f=Date.now());return 0};b.functions._AnchoDeCadena_=b.functions._strWidth_=function(b,c,d,g){return a.getTextWidth(b,a.convertFont(c+","+d+","+g))};b.functions.R=b.functions._Rojo_=b.functions._Red_=function(b){return(new a.Color(b)).r/255};b.functions.G=b.functions._Verde_=b.functions._Green_=function(b){return(new a.Color(b)).g/255};b.functions.B=b.functions._Azul_=b.functions._Blue_=function(b){return(new a.Color(b)).b/
255};b.functions["DJS.typeof"]=function(a){return a.rows?"matrix":a._size_?"vector":typeof a}};a.Parser=m;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.floor,e=function(e){this.parent=e;this.parser=new a.Parser(this);this.variables=this.parser.variables;this.functions=this.parser.functions;this.vectors=this.parser.vectors;this.matrices=this.parser.matrices;this.definitions=this.parser.definitions};e.prototype.setDefinition=function(a,e){this.definitions[a]=e};e.prototype.getDefinition=function(a){return this.definitions[a]};e.prototype.setVariable=function(a,e){this.variables[a]=e};e.prototype.getVariable=
function(a){return this.variables[a]};e.prototype.setVector=function(a,e,n){e=0>e?0:k(e);this.vectors[a][e]=n};e.prototype.getVector=function(a,e){e=0>e?0:k(e);return this.vectors[a][e]};e.prototype.setMatrix=function(a,e,n,c){e=0>e?0:k(e);n=0>n?0:k(n);void 0==this.matrices[a][e]&&(this.matrices[a][e]=[]);this.matrices[a][e][n]=c};e.prototype.getMatrix=function(a,e,n){e=0>e?0:k(e);n=0>n?0:k(n);return this.matrices[a][e][n]};e.prototype.setFunction=function(a,e){this.functions[a]=e};e.prototype.getFunction=
function(a){return this.functions[a]};e.prototype.eval=function(a){return a?a.evaluate(this):0};a.externalEvaluator=new e;a.Evaluator=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h,p,b,g,d,v,q,u,y,m=function(b,c){this.parent=b;this.evaluator=b.evaluator;this.decimals=b.decimals;this.fixed=b.fixed;this.align=b.align||"left";this.anchor=b.anchor||"a_top_left";this.decimal_symbol=b.parent.decimal_symbol;this.w=this.h=100;this.hasContent=""!==c;this.textStr=(c||"").replace(/\\{/g,"\\curlyBracketOpen ").replace(/\\}/g,"\\curlyBracketClose ").replace(/\\\[/g,"\\squareBracketOpen ").replace(/\\\]/g,"\\squareBracketClose ");
this.oldTextStr=this.oldWidth=this.oldSize=this.oldColor=this.oldPosX=this.oldPoxY=null;c.match(/^\{\\rtf1/)?(this.type="rtfNode",this.text=c,this.textNodes=(new a.RTFParser(b.evaluator)).parse(c.substring(10)),this.draw=this.drawRTF):(this.descarTeXParser=new a.DescarTeXParser,this.text=this.parseSimpleText(this.textStr),this.textNodes=new a.TextNode("","textLineBlock",null,null),this.draw=this.drawText)};m.prototype.drawText=function(b,d,g,h,q){k=this.evaluator.eval(this.decimals);e=this.evaluator.eval(this.parent.width);
f=this.evaluator.eval(this.parent.font_size);r=d.getColor?d.getColor():d;n=this.textToString(this.text,k,this.fixed).replace(/\\{/g,"\\curlyBracketOpen ").replace(/\\}/g,"\\curlyBracketClose ").replace(/\\\[/g,"\\squareBracketOpen ").replace(/\\\]/g,"\\squareBracketClose ");0<=n.indexOf("[")&&(n=this.textToString(this.parseSimpleText(n),k,this.fixed));if(this.oldTextStr!==n||this.oldWidth!==e||this.oldSize!==f||this.oldColor!==r||this.oldPosX!==g||this.oldPoxY!==h)c=new a.TextStyle({size:f,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,border_size:this.parent.border_size,shadowBlur:this.parent.shadowBlur,shadowOffsetX:this.parent.shadowOffsetX,shadowOffsetY:this.parent.shadowOffsetY,shadowColor:this.parent.shadowColor||"transparent"}),this.textNodes=this.descarTeXParser.parse(n,this.evaluator,c),this.textNodes.update(g,h,k,this.fixed,this.align,this.anchor,r,e);q||this.textNodes.draw(b);this.oldTextStr=n;this.oldWidth=
e;this.oldSize=f;this.oldColor=r;this.oldPosX=g;this.oldPoxY=h};m.prototype.drawRTF=function(a,b,c,d,g){b=b.getColor?b.getColor():b;a.fillStyle=a.strokeStyle=b;a.textBaseline="alphabetic";this.textNodes.style.align!==this.align&&this.textNodes.propagateStyle("align",this.align);this.textNodes.update(c,d,this.evaluator.eval(this.decimals),this.fixed,this.align,this.anchor,b,this.evaluator.eval(this.parent.width));g||this.textNodes.draw(a)};m.prototype.parseSimpleText=function(a){a=a.replace("&#x2013",
"\u2013").replace(/&squot;/g,"'");h=[];p="'";g=b=0;d=-1;for(u=a.length;b<u;)v=a.charAt(b),q=a.charAt(b-1),"["===v&&"\\"===q?(h.push(a.substring(g,b-1)+"["),g=b+1):"]"===v&&"\\"===q?(h.push(a.substring(g,b-1)+"]"),g=b+1):"["===v&&-1===d?(h.push(a.substring(g,b)),g=b,d++):"["===v?d++:"]"===v&&0===d?(h.push(this.evaluator.parser.parse(a.substring(g,b+1))),g=b+1,d--):("]"==a.charAt(b)&&(d=0>d?d:d-1),p+=a.charAt(b)),b++;h.push(a.substring(g,b));return h};m.prototype.textToString=function(b,c,d){p="";if("rtfNode"!==
b.type)for(var g=0,e=b.length;g<e;g++)"string"===typeof b[g]?p+=b[g]:(y=this.evaluator.eval(b[g])[0][0],""!==y&&("string"===typeof y?p+=y:Infinity===y?p+="Infinity":-Infinity===y?p+="-Infinity":isNaN(y)||"NaN"===y?p+="NaN":(y=parseFloat(y),y=d?y.toFixed(c):a.removeNeedlessDecimals(y.toFixed(c)),p+=y.toString().replace(".",this.decimal_symbol))));return p};a.TextObject=m;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e=function(){};e.prototype.tokenize=function(a){a=a.replace(/\\n/g,"\\newline ");var e=[],f=null,c=0,h=a.length;a.charAt(0);var p=!1,b=!1,g=0;k="";for(var d=0;d<h;d++){var v=a.charAt(d);var q=a.charAt(d+1);"\\"===v&&"$"===q&&(b=!0);"{"===v?g++:"}"===v&&(g--,b&&0===g&&(b=!1));b?"_"===v?"{"===q?k+="\\subindex":(k+="\\subindex{"+q+"}",d++):"^"===v?"{"===q?k+="\\superindex":(k+="\\superindex{"+q+"}",d++):k+=v:k+=v}a=k;q=a.charAt(0);for(h=a.length;c<
h;)v=q,q=a.charAt(c+1),p&&("{"===v||"["===v||"\\"===v||" "===v?(p=!1," "===v&&(f={type:"ignore"},e.push(f))):f.value+=v),p||"\\"!==v?p||"{"!==v&&"["!==v?p||"}"!==v&&"]"!==v?p||(f&&"text"===f.type?f.value+=v:f&&"ignore"===f.type?(e.pop(),f=e[e.length-1]):(f={type:"text",value:v},e.push(f))):(f={type:"close",value:v},e.push(f)):(f={type:"open",value:v},e.push(f)):(p=!0,f={type:"command",value:""},e.push(f)),c++;return e};a.DescarTeXTokenizer=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=function(){this.tokenizer=new a.DescarTeXTokenizer};k.prototype.parse=function(e,f,k){e=this.tokenizer.tokenize(e);var n=new a.TextNode("","textBlock",k,null),c=new a.TextNode("","textLineBlock",k.clone(),null);n.addChild(c);for(var h=[],p=void 0,b=k,g=[k],d,v,q,u,r=!1,m=0,l=e.length;m<l;m++)if("text"===e[m].type)if("color_parameter"===p)v=new a.Color(e[m].value,f);else if("text_size_parameter"===p)q=parseFloat(e[m].value);else if("textLineBlock"===
c.nodeType){d=e[m].value.split(" ");for(var x=0,w=d.length;x<w;x++)""!==d[x]&&c.addChild(new a.TextNode(d[x],"text",b.clone(),null)),x+1<w&&c.addChild(new a.TextNode(" ","space",b.clone(),null))}else c.addChild(new a.TextNode(e[m].value,"text",b.clone(),null));else"command"===e[m].type&&"curlyBracketOpen"===e[m].value?c.addChild(new a.TextNode("{","text",b.clone(),null)):"command"===e[m].type&&"curlyBracketClose"===e[m].value?c.addChild(new a.TextNode("}","text",b.clone(),null)):"command"===e[m].type&&
"squareBracketOpen"===e[m].value?c.addChild(new a.TextNode("[","text",b.clone(),null)):"command"===e[m].type&&"squareBracketClose"===e[m].value?c.addChild(new a.TextNode("]","text",b.clone(),null)):"command"===e[m].type&&"newline"===e[m].value?(0===c.children.length&&c.addChild(new a.TextNode("","text",b.clone(),null)),c=new a.TextNode("","textLineBlock",k.clone(),null),n.addChild(c)):"command"===e[m].type&&"b"===e[m].value?(p="bold",h.push(p)):"command"===e[m].type&&"i"===e[m].value?(p="italic",
h.push(p)):"command"===e[m].type&&"o"===e[m].value?(p="overline",h.push(p)):"command"===e[m].type&&"u"===e[m].value?(p="underline",h.push(p)):"command"===e[m].type&&"color"===e[m].value?(p="color",h.push(p)):"command"===e[m].type&&"ts"===e[m].value?(p="text_size",h.push(p)):"command"===e[m].type&&"sansserif"===e[m].value.toLowerCase()?(p="sansserif",h.push(p)):"command"===e[m].type&&"serif"===e[m].value.toLowerCase()?(p="serif",h.push(p)):"command"===e[m].type&&"monospace"===e[m].value.toLowerCase()?
(p="monospace",h.push(p)):"command"===e[m].type&&"c"===e[m].value?(p="center",h.push(p)):"command"===e[m].type&&"l"===e[m].value?(p="left",h.push(p)):"command"===e[m].type&&"r"===e[m].value?(p="right",h.push(p)):"command"===e[m].type&&"j"===e[m].value?(p="justify",h.push(p)):"command"===e[m].type&&"$"===e[m].value?(p="formula",h.push(p),r=!0):"command"===e[m].type&&"sum"===e[m].value?(p="sum",h.push(p)):"command"===e[m].type&&"prod"===e[m].value?(p="prod",h.push(p)):"command"===e[m].type&&"int"===
e[m].value?(p="integral",h.push(p)):"command"===e[m].type&&"lim"===e[m].value?(p="limit",h.push(p)):"command"===e[m].type&&"sqrt"===e[m].value?(p="radical",h.push(p)):"command"===e[m].type&&"subindex"===e[m].value?(p="subIndex",h.push(p)):"command"===e[m].type&&"superindex"===e[m].value?(p="superIndex",h.push(p)):"command"===e[m].type&&"frac"===e[m].value?(p="numerator",h.push(p)):"open"===e[m].type&&"{"===e[m].value&&void 0!==p?"bold"===p||"italic"===p||"overline"===p||"underline"===p?(b=b.clone(),
b[p]=!0,g.push(b)):"sansserif"===p?(b=b.clone(),b.family="sansserif",g.push(b)):"serif"===p?(b=b.clone(),b.family="serif",g.push(b)):"monospace"===p?(b=b.clone(),b.family="monospaced",g.push(b)):"text_size"===p?p="text_size_parameter":"text_size_text"===p?(b=b.clone(),b.size=q,g.push(b)):"color"===p?p="color_parameter":"color_text"===p?(b=b.clone(),b.color=v,g.push(b)):"center"===p||"left"===p||"right"===p||"justify"===p?(b=b.clone(),b.align=p,g.push(b),c=new a.TextNode("","textLineBlock",b.clone(),
null),n.addChild(c)):"formula"===p?(b=b.clone(),g.push(b),u=new a.TextNode("","formula",b.clone(),null),c.addChild(u),c=u):"subIndex"===p||"superIndex"===p?r?(b=b.clone(),g.push(b),u=new a.TextNode("",p,b.clone(),null),c.addChild(u),c=u):c.addChild(new a.TextNode("subIndex"===p?"_":"^","text",b.clone(),null)):"radical"===p?r&&(u=new a.TextNode("","radical",b.clone(),null),c.addChild(u),c=u,b=b.clone(),g.push(b),u=new a.TextNode("","index",b.clone(),null),c.addChild(u),c=u,p="index"):"index"===p?r&&
(g.pop(),b=g[g.length-1],u=new a.TextNode("","radicand",b.clone(),null),c.addChild(u),c=u,p="radicand"):"sum"===p||"integral"===p||"limit"===p||"prod"===p?r&&(u=new a.TextNode("",p,b.clone(),null),c.addChild(u),c=u,b=b.clone(),g.push(b),u=new a.TextNode("","from",b.clone(),null),c.addChild(u),c=u,p="from",h[h.length-1]=p):"from"===p?r&&(u=new a.TextNode("","to",b.clone(),null),c.addChild(u),c=u,p="to",h[h.length-1]=p):"to"===p?r&&(g.pop(),b=g[g.length-1],u=new a.TextNode("","what",b.clone(),null),
c.addChild(u),c=u,p="what",h[h.length-1]=p):"numerator"===p?r&&(u=new a.TextNode("","fraction",b.clone(),null),c.addChild(u),c=u,b=b.clone(),g.push(b),u=new a.TextNode("","numerator",b.clone(),null),c.addChild(u),c=u,p="numerator"):"denominator"===p&&(u=new a.TextNode("",p,b.clone(),null),c.addChild(u),c=u):"close"===e[m].type&&"}"===e[m].value&&void 0!==p&&("bold"===p||"italic"===p||"overline"===p||"underline"===p||"color_text"===p||"color"===p||"text_size_text"===p||"text_size"===p||"sansserif"===
p||"serif"===p||"monospace"===p?(g.pop(),b=g[g.length-1],h.pop(),p=h[h.length-1]):"color_parameter"===p?p="color_text":"text_size_parameter"===p?p="text_size_text":"center"===p||"left"===p||"right"===p||"justify"===p?(g.pop(),b=g[g.length-1],h.pop(),p=h[h.length-1],e[m+1]&&"command"===e[m+1].type&&"newline"===e[m+1].value?c=n:(c=new a.TextNode("","textLineBlock",b.clone(),null),n.addChild(c))):"formula"===c.nodeType?(r=!1,g.pop(),b=g[g.length-1],h.pop(),p=h[h.length-1],c=c.parent):"subIndex"===c.nodeType||
"superIndex"===c.nodeType?r&&(g.pop(),b=g[g.length-1],h.pop(),p=h[h.length-1],c=c.parent):"index"===c.nodeType?c=c.parent:"radicand"===c.nodeType?(h.pop(),p=h[h.length-1],c=c.parent.parent):"from"===c.nodeType?c=c.parent:"to"===c.nodeType?c=c.parent:"what"===c.nodeType?(h.pop(),p=h[h.length-1],c=c.parent.parent):"numerator"===c.nodeType?(p="denominator",c=c.parent):"denominator"===c.nodeType&&(g.pop(),b=g[g.length-1],h.pop(),p=h[h.length-1],c=c.parent.parent));var z,A,G=null,J=[];n.children.forEach(function(a){for(var b=
0,c=a.children.length;b<c-1;b++)z=a.children[b],A=a.children[b+1],"text"===z.nodeType&&"text"===A.nodeType&&z.style.equals(A.style)?(null===G&&(G=z,u=z.clone(),G.changeNodeType("word"),G.value="___"+u.value,G.addChild(u)),u=A.clone(),G.addChild(u),J.push(A),G.value+=u.value):G=null});J.forEach(function(a){a.parent.removeChild(a)});n.normalize();n.adjustFontSize();return n};a.DescarTeXParser=k;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e=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)};e.prototype.clone=function(){return new e(Object.assign({},this))};e.prototype.set=function(a){Object.assign(this,a)};e.prototype.equals=function(a){var e=!0,f;for(f in this)this.hasOwnProperty(f)&&(e=e&&this[f]===a[f]);return e};e.prototype.toString=function(e){/arial|sansserif/i.test(this.family)?
k=a.sansserif_font:/times|serif/i.test(this.family)?k=e?a.math_font:a.serif_font:/courier|monospaced/i.test(this.family)&&(k=a.monospace_font);return((this.bold?"bold":"")+" "+(this.italic?"italic":"")+" "+this.size+"px "+k).trim()};a.TextStyle=e;return a}(descartesJS||{});
descartesJS=function(a){function k(a,c){for(var b=0,g=0;g<c;g++)b+=a[g];return b}function e(a){var b={ascent:0,descent:0,h:0,w:0,x:0,y:0,offsetX:0,offsetY:0,marginX:0,marginY:0,paddingX:0,paddingY:0};if(""==a.trim())return b;var c=parseInt(a.match(/(\d+\.*)+px/)[0]);a=a.match("sansserif")?"sansserif":a.match("serif")?"serif":"monospace";b.ascent=Math.ceil((p[a].ascent+25)*c/p[a].unitsPerEm);b.descent=Math.ceil(Math.abs((p[a].descent-25)*c/p[a].unitsPerEm));b.h=b.ascent+b.descent;return b}if(a.loadLib)return a;
var f=!1,r="#000000",n=2,c=!1;(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")).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";(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")).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";(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")).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";
(new Path2D("m 876.3561,999.59384 v -27.38613 h -17.60537 c -64.55302,0 -96.82952,-41.07919 -96.82952,-124.21565 V 144.75542 c 0,-83.136456 27.38612,-117.369116 114.43489,-117.369116 V 1.7633057e-4 H 1.184082e-5 V 27.386304 H 16.627304 c 60.640711,0 98.785676,24.4519 98.785676,121.281426 v 716.9297 c 0,71.39954 -31.298433,106.61028 -96.829524,106.61028 H 1.184082e-5 v 27.38613 H 359.93198 v -27.38613 h -30.32036 c -64.55302,0 -86.07069,-40.10112 -86.07069,-131.06218 V 64.553192 H 633.79325 V 841.14553 c 0,75.31185 -17.60537,131.06218 -86.07068,131.06218 h -31.29844 v 27.38613 z")).svgData=
"m 876.3561,999.59384 v -27.38613 h -17.60537 c -64.55302,0 -96.82952,-41.07919 -96.82952,-124.21565 V 144.75542 c 0,-83.136456 27.38612,-117.369116 114.43489,-117.369116 V 1.7633057e-4 H 1.184082e-5 V 27.386304 H 16.627304 c 60.640711,0 98.785676,24.4519 98.785676,121.281426 v 716.9297 c 0,71.39954 -31.298433,106.61028 -96.829524,106.61028 H 1.184082e-5 v 27.38613 H 359.93198 v -27.38613 h -30.32036 c -64.55302,0 -86.07069,-40.10112 -86.07069,-131.06218 V 64.553192 H 633.79325 V 841.14553 c 0,75.31185 -17.60537,131.06218 -86.07068,131.06218 h -31.29844 v 27.38613 z";
var h=function(b,c,d,e){this.type="rtfNode";this.evaluator=e;this.parent=null;this.children=[];this.metrics={ascent:0,descent:0,h:0,w:0,x:0,y:0,offsetX:0,offsetY:0,marginX:0,marginY:0,paddingX:0,paddingY:0};this.value=b;this.style=d;this.changeNodeType(c);this.drawBorder=a.in_editor?this.drawBorderSpecial:function(){}};h.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 "prod":this.draw=this.drawProd;break;case "sum":this.draw=this.drawSum;break;case "matrix":this.draw=this.drawMatrix;break;case "defparts":this.draw=this.drawDefparts;break;case "text":case "newLine":case "mathSymbol":this.draw=this.drawText;break;case "space":this.draw=this.drawSpace;break;case "word":this.draw=this.drawWord;break;case "hyperlink":this.draw=this.drawHyperlink;break;case "index":case "radicand":case "from":case "to":case "what":case "element":this.draw=
this.drawGenericBlock;break;case "componentNumCtrl":this.draw=this.drawComponentNumCtrl;break;case "componentSpace":this.draw=this.drawComponentSpace}};h.prototype.clone=function(){for(var a=new h(this.value,this.nodeType,this.style.clone()),c=0,d=this.children.length;c<d;c++)a.addChild(this.children[c].clone());return a};h.prototype.toStr=function(){for(var a=this.value,c=0,d=this.children.length;c<d;c++)a+=" "+this.children[c].toStr();return a};h.prototype.stringify=function(){var a="{"+('"NT":"'+
this.nodeType+'",');a+='"V":"'+(this.value||"")+'",';a+='"C":[';for(var c=0,d=this.children.length;c<d;c++)a+=this.children[c].stringify()+(c==d-1?"":",");a=a+"],"+('"S":'+JSON.stringify(this.style));return a+"}"};h.prototype.addChild=function(a,c){c&&null!==a.parent&&a.parent.removeChild(a);a.parent=this;this.children.push(a)};h.prototype.removeChild=function(a){var b=this.children.indexOf(a);-1!==b&&(a.parent=null,this.children.splice(b,1))};h.prototype.getFirstTextNode=function(){for(var a=this;0<
a.children.length;)a=a.children[0];return a};h.prototype.getLastTextNode=function(){for(var a=this;0<a.children.length;)a=a.children[a.children.length-1];return a};h.prototype.nextSibling=function(){if(this.parent)for(var a=null,c=0,d=this.parent.children.length;c<d;c++){if(a)return this.parent.children[c];this.parent.children[c]===this&&(a=!0)}return null};h.prototype.prevSibling=function(){if(this.parent)for(var a=0,c=this.parent.children.length-1;a<c;a++)if(this.parent.children[a+1]===this)return this.parent.children[a];
return null};h.prototype.queryAll=function(a){var b=[];"string"===typeof a&&(a=new RegExp(a));for(var c=0,e=this.children.length;c<e;c++)b=b.concat(this.children[c].queryAll(a));this.nodeType.match(a)&&b.push(this);return b};h.prototype.insertBefore=function(a,c){a=this.children.indexOf(a);-1!==a&&(c.parent=this,this.children.splice(a,0,c))};h.prototype.insertAfter=function(a,c){a=this.children.indexOf(a);-1!==a&&(c.parent=this,this.children.splice(a+1,0,c))};h.prototype.normalize=function(){for(var a=
this.queryAll(/textLineBlock|formula|numerator|denominator|superIndex|subIndex|index|subIndex|radicand|from|to|what|element/),c=0,d=a.length;c<d;c++)0===a[c].children.length&&a[c].addChild(new h("","text",a[c].style));a=this.queryAll(/formula|fraction|superIndex|subIndex|radical|sum|integral|prod|limit|matrix|defparts|dynamicText|componentNumCtrl|componentSpace/);c=0;for(d=a.length;c<d;c++){var e=a[c];(null===e.prevSibling()||null!==e.prevSibling()&&"text"!==e.prevSibling().nodeType)&&e.parent.insertBefore(e,
new h("","text",e.parent.style));(null===e.nextSibling()||null!==e.nextSibling()&&"text"!==e.nextSibling().nodeType)&&e.parent.insertAfter(e,new h("","text",e.parent.style))}return this};h.prototype.removeEmptyText=function(){for(var a=this.queryAll(/text/),c=0,d=a.length;c<d;c++)""===a[c].value&&a[c].parent&&a[c].parent.removeChild(a[c])};h.prototype.adjustFontSize=function(a){var b=this.style.size;"formula"===this.nodeType&&(a=!0);for(var c=0,e=this.children.length;c<e;c++)"text"===this.children[c].nodeType&&
a?(this.children[c].style.size=b,this.children[c].styleString=this.children[c].style.toString()):"index"===this.children[c].nodeType?(this.children[c].style.size=Math.max(parseInt(b-.5*b),8),this.children[c].styleString=this.children[c].style.toString(),this.children[c].adjustFontSize(!0)):"to"===this.children[c].nodeType||"from"===this.children[c].nodeType?(this.children[c].style.size=Math.max(parseInt(b-.2*b),8),this.children[c].styleString=this.children[c].style.toString(),this.children[c].adjustFontSize(!0)):
"numerator"===this.children[c].nodeType||"denominator"===this.children[c].nodeType?(this.children[c].style.size=Math.max(parseInt(b-.1*b),8),this.children[c].styleString=this.children[c].style.toString(),this.children[c].adjustFontSize(!0)):"subIndex"===this.children[c].nodeType||"superIndex"===this.children[c].nodeType?(this.children[c].style.size=Math.max(parseInt(b-.33*b),8),this.children[c].styleString=this.children[c].style.toString(),this.children[c].adjustFontSize(!0)):(a&&(this.children[c].style.size=
b,this.children[c].styleString=this.children[c].style.toString()),this.children[c].adjustFontSize(a))};h.prototype.propagateStyle=function(a,c){this.style[a]=c;this.styleString=this.style.toString();for(var b=0,g=this.children.length;b<g;b++)this.children[b].propagateStyle(a,c)};h.prototype.update=function(a,g,d,e,f,h,k,p){n=d;c=e;r=k;this.metrics.w=this.metrics.h=0;k=g;if(20<=p)for(d=0;d<this.children.length;d++)this.children[d].breakLines(p);d=0;for(e=this.children.length;d<e;d++){var b=this.children[d];
b.updateLine();b.metrics.offsetX=a;b.metrics.y=g;g+=parseInt(b.metrics.ascent+.5);b.metrics.offsetY=g;f=parseInt(b.metrics.descent+.5)+parseInt(1.5+.05*b.style.size);g+=f;this.metrics.h+=b.metrics.h;this.metrics.w=Math.max(this.metrics.w,b.metrics.w)}g=k;h=h||"";h.match("right")?a-=this.metrics.w:h.match("_center")&&(a-=this.metrics.w/2);h.match("bottom")?g-=this.metrics.h:h.match("center_")&&(g-=this.metrics.h/2);h=this.children;d=0;for(e=h.length;d<e;d++)"left"===h[d].style.align?h[d].metrics.offsetX=
a:"right"===h[d].style.align?h[d].metrics.offsetX=a+this.metrics.w-h[d].metrics.w:"center"===h[d].style.align?h[d].metrics.offsetX=a+(this.metrics.w-h[d].metrics.w)/2:"justify"===h[d].style.align&&20<=p&&(f=d<e-1?h[d+1].value:null,h[d].metrics.offsetX=a,"wrap"===f&&h[d].justifyAux(p)),h[d].metrics.y=g,g+=parseInt(h[d].metrics.ascent+.5),h[d].metrics.offsetY=g,f=parseInt(h[d].metrics.descent+.5)+parseInt(1.5+.05*h[d].style.size),g+=f};h.prototype.breakLines=function(b){for(var c,d=0,e=!1,f=[],k=0,
p=this.children.length;k<p;k++)c=this.children[k],e?f.push(c):("text"===c.nodeType||"space"===c.nodeType?(a.ctx.font=c.style.toString(),c.metrics.w=a.ctx.measureText(c.value).width):"word"===c.nodeType?c.updateLine():"formula"===c.nodeType&&c.updateFormula(),d+=c.metrics.w,d>b&&"space"!==c.nodeType&&0<k&&(e=!0,f.push(c)));if(0<f.length)for(b=new h("wrap","textLineBlock",this.style.clone(),null),this.parent.insertAfter(this,b),k=0,p=f.length;k<p;k++)f[k].parent&&f[k].parent.removeChild(f[k]),b.addChild(f[k])};
h.prototype.updateLine=function(b){var c=this;if("textLineBlock"===this.nodeType||"word"===this.nodeType){this.metrics.w=0;this.metrics.ascent=0;for(var d=this.metrics.descent=0,f=this.children,h,k=0,p=f.length;k<p;k++){h=f[k];if("text"===h.nodeType){a.ctx.font=h.style.toString();var m=""!==h.value?h.value:a.in_editor?"\u200a":"";h.metrics=e(a.ctx.font);h.metrics.w=a.ctx.measureText(m).width;h.metrics.offsetX=d;Object.defineProperties(h.metrics,{x:{get:function(){return c.metrics.offsetX+this.offsetX}},
y:{get:function(){return c.metrics.offsetY+this.offsetY}}})}"space"===h.nodeType?(a.ctx.font=h.style.toString(),h.metrics=e(a.ctx.font),h.metrics.w=k===p-1?0:b?b:a.ctx.measureText(" ").width,h.metrics.offsetX=d,Object.defineProperties(h.metrics,{x:{get:function(){return c.metrics.offsetX+this.offsetX}},y:{get:function(){return c.metrics.offsetY+this.offsetY}}})):"word"===h.nodeType&&(h.updateLine(),h.metrics.offsetX_aux=d,Object.defineProperties(h.metrics,{offsetX:{get:function(){return c.metrics.offsetX+
this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}}));"hyperlink"===h.nodeType&&(a.ctx.font=h.styleString,m=""!==h.value?h.value:a.in_editor?"\u200a":"",h.metrics=e(a.ctx.font),h.metrics.w=a.ctx.measureText(m).width,h.metrics.offsetX=d,Object.defineProperties(h.metrics,{x:{get:function(){return c.metrics.offsetX+this.offsetX}},y:{get:function(){return c.metrics.offsetY}}}),h.clickCatcher||(h.clickCatcher=a.newHTML("div",{style:"position:absolute;width:"+h.metrics.w+"px;height:"+
h.metrics.h+"px;cursor:pointer;"}),h.clickCatcher.rtfNode=h,h.clickCatcher.action=new a.OpenURL(this.evaluator.parent,h.URL),h.clickCatcher.addEventListener("click",function(a){this.rtfNode.click=!0;this.action.execute();this.rtfNode.draw(this.rtfNode.ctx)})));"componentNumCtrl"===h.nodeType&&(h.componentNumCtrl=this.evaluator.parent.getControlByCId(h.value),a.ctx.font=h.styleString,h.metrics=e(a.ctx.font),h.metrics.w=h.componentNumCtrl.w,h.metrics.h=h.componentNumCtrl.h,h.metrics.offsetX=d,Object.defineProperties(h.metrics,
{x:{get:function(){return c.metrics.offsetX+this.offsetX}},y:{get:function(){return c.metrics.offsetY}}}));"componentSpace"===h.nodeType?(h.componentSpace=this.evaluator.parent.getSpaceByCId(h.value),a.ctx.font=h.styleString,h.metrics=e(a.ctx.font),h.metrics.w=h.componentSpace.w,h.metrics.h=h.componentSpace.h,h.metrics.offsetX=d,Object.defineProperties(h.metrics,{x:{get:function(){return c.metrics.offsetX+this.offsetX}},y:{get:function(){return c.metrics.offsetY}}})):"formula"===h.nodeType&&(h.updateFormula(),
h.metrics.marginX=h.metrics.marginY=h.metrics.paddingX=h.metrics.paddingY=0,h.metrics.offsetX_aux=d,Object.defineProperties(h.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return c.metrics.offsetX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return c.metrics.offsetY}}}),h.metrics.w+=2*h.metrics.paddingX,h.metrics.ascent+=h.metrics.paddingY,h.metrics.descent+=h.metrics.paddingY,h.metrics.h+=2*h.metrics.paddingY,d+=2*h.metrics.marginX);
this.metrics.w+=h.metrics.w+2*h.metrics.marginX;this.metrics.ascent=Math.max(this.metrics.ascent,h.metrics.ascent);this.metrics.descent=Math.max(this.metrics.descent,h.metrics.descent);d+=h.metrics.w}this.metrics.h=this.metrics.ascent+this.metrics.descent}};h.prototype.updateFormula=function(){var b=this;this.metrics={ascent:0,descent:0,h:0,w:0,x:0,y:0,offsetX:0,offsetY:0,marginX:0,marginY:0,paddingX:0,paddingY:0};for(var g=this.children,d,h=0,f={metrics:{ascent:0,descent:0,h:0,w:0,x:0,y:0,offsetX:0,
offsetY:0,marginX:0,marginY:0,paddingX:0,paddingY:0}},p=0,r=g.length;p<r;p++){d=g[p];if("text"===d.nodeType){a.ctx.font=d.style.toString(!0);var m=""!==d.value?d.value:a.in_editor?"\u200a":"";d.metrics=e(a.ctx.font);d.metrics.w=a.ctx.measureText(m).width;d.metrics.offsetX=h;Object.defineProperties(d.metrics,{x:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.offsetX}},y:{get:function(){return b.metrics.offsetY}}});h+=b.metrics.marginX}else if("dynamicText"===d.nodeType){m=void 0===
d.decimals?n:d.evaluator.eval(d.decimals);var l=void 0===d.fixed?c:d.fixed,x=d.evaluator.eval(d.value);parseFloat(x).toString()===x.toString()&&(x=l?parseFloat(x).toFixed(m):a.removeNeedlessDecimals(parseFloat(x).toFixed(m)),x=(""+x).replace(".",d.decimal_symbol));d.evalValue=x;a.ctx.font=d.style.toString(!0);d.metrics=e(a.ctx.font);d.metrics.marginX=0;d.metrics.paddingX=0;d.metrics.w=a.ctx.measureText(x).width+2*d.metrics.paddingX;d.metrics.offsetX_aux=h;Object.defineProperties(d.metrics,{x:{get:function(){return this.offsetX}},
y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.offsetX_aux+this.marginX}},offsetY:{get:function(){return b.metrics.offsetY}}});h+=2*d.metrics.marginX}if("superIndex"===d.nodeType)m=d,m.updateFormula(),m.metrics.marginX=0,m.metrics.paddingX=0,m.metrics.paddingY=0,m.metrics.offsetX_aux=h,m.metrics.prevChild=f,Object.defineProperties(m.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+
b.metrics.paddingX+this.offsetX_aux+this.marginX}},offsetY:{get:function(){return b.metrics.offsetY+this.ascent+(this.prevChild.metrics.descent-this.prevChild.metrics.ascent)/2-this.h}}}),m.metrics.w+=2*m.metrics.paddingX,m.metrics.ascent+=m.metrics.paddingY,m.metrics.descent+=m.metrics.paddingY,m.metrics.h+=2*m.metrics.paddingY,m.metrics.tmp_ascent=m.metrics.h+(m.metrics.prevChild.metrics.ascent-m.metrics.prevChild.metrics.descent)/2,h+=2*m.metrics.marginX;else if("subIndex"===d.nodeType)m=d,m.updateFormula(),
m.metrics.marginX=0,m.metrics.paddingX=0,m.metrics.paddingY=0,m.metrics.offsetX_aux=h,m.metrics.prevChild=f,Object.defineProperties(m.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY+this.ascent+(this.prevChild.metrics.descent-this.prevChild.metrics.ascent)/2}}}),m.metrics.w+=m.metrics.paddingX,m.metrics.ascent+=m.metrics.paddingY,
m.metrics.descent+=m.metrics.paddingY,m.metrics.h+=2*m.metrics.paddingY,this.metrics.descent=m.metrics.ascent+(m.metrics.prevChild.metrics.descent-m.metrics.prevChild.metrics.ascent)/2+m.metrics.descent,h+=m.metrics.marginX;else if("fraction"===d.nodeType){l=d;l.updateFormula();m=l.children;x=m[0];m=m[1];l.metrics.marginX=parseInt(.5+.075*this.style.size);l.metrics.paddingX=0;l.metrics.paddingY=0;var w=Math.max(x.metrics.w,m.metrics.w)+2*l.metrics.paddingX;l.metrics.prevChild=f;l.metrics.offsetX_aux=
h;var z=parseInt(-f.metrics.descent+4*f.metrics.h/9);Object.defineProperties(l.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY+z}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY-z}}});Object.defineProperties(x.metrics,{parent:{value:l},maxWidth:{value:w},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(m.metrics,{parent:{value:l},maxWidth:{value:w},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}}});l.metrics.w=
w;l.metrics.ascent=x.metrics.h+z+2*l.metrics.paddingY;l.metrics.descent=m.metrics.h-z+2*l.metrics.paddingY;l.metrics.h=x.metrics.h+m.metrics.h+4*l.metrics.paddingY;h+=2*l.metrics.marginX}else if("radical"===d.nodeType){f=d;f.updateFormula();m=f.children;l=m[0];var A=m[1];f.metrics.marginX=parseInt(1.5+.075*this.style.size);f.metrics.paddingX=parseInt(1.5+.075*this.style.size);f.metrics.paddingY=parseInt(1.5+.05*this.style.size);f.metrics.offsetX_aux=h;Object.defineProperties(f.metrics,{x:{get:function(){return this.offsetX}},
y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}});m=f.style.size;f.radicalSign={w:m,scaleX:m/722,scaleY:A.metrics.h/1E3};x=parseInt(l.metrics.w-2*f.radicalSign.w/3);Object.defineProperties(f.radicalSign,{parent:{value:f},displaceIndex:{value:x},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+Math.max(this.displaceIndex,0)}},
y:{get:function(){return b.metrics.offsetY-A.metrics.ascent}}});Object.defineProperties(l.metrics,{parent:{value:f},displaceIndex:{value:x},fontSize:{value:m},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+Math.max(this.displaceIndex,0)-this.displaceIndex}},offsetY:{get:function(){return b.metrics.offsetY-this.descent-2*this.fontSize/5}}});Object.defineProperties(A.metrics,{parent:{value:f},
displaceIndex:{value:x},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+this.parent.radicalSign.w+Math.max(this.displaceIndex,0)}},offsetY:{get:function(){return b.metrics.offsetY}}});x=l.metrics.w<2*f.radicalSign.w/3?f.radicalSign.w:parseInt(l.metrics.w+f.radicalSign.w/3);f.metrics.w=x+2*f.metrics.paddingX+A.metrics.w;f.metrics.ascent=Math.max(A.metrics.ascent,l.metrics.h+2*m/5)+
f.metrics.paddingY;f.metrics.descent=A.metrics.descent+f.metrics.paddingY;f.metrics.h=f.metrics.ascent+f.metrics.descent;h+=2*f.metrics.marginX}else if("sum"===d.nodeType){l=d;l.updateFormula();m=l.children;x=m[0];w=m[1];var G=m[2];l.metrics.marginX=parseInt(1.5+.075*this.style.size);l.metrics.paddingX=parseInt(1.5+.075*this.style.size);l.metrics.paddingY=parseInt(1.5+.05*this.style.size);l.metrics.offsetX_aux=h;Object.defineProperties(l.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},
offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}});a.ctx.font=d.style.toString();var J=e(a.ctx.font);f=parseInt(1.2*J.h);m=parseInt(.5+780*f/1E3);l.sigmaSign={w:m,h:f,scale:f/1E3};var E=Math.max(w.metrics.w,x.metrics.w,l.sigmaSign.w);l.sigmaSign.parent=l;Object.defineProperties(l.sigmaSign,{sumWidth:{value:E},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.sumWidth-
this.w)/2)}},y:{get:function(){return b.metrics.offsetY+J.descent-(this.h+J.h)/2}}});m=J.descent-w.metrics.descent-(f+J.h)/2-l.metrics.paddingY;Object.defineProperties(w.metrics,{parent:{value:l},sumWidth:{value:E},newBaselineTo:{value:m},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.sumWidth-this.w)/2)}},offsetY:{get:function(){return b.metrics.offsetY+this.newBaselineTo}}});
f=x.metrics.ascent+J.descent+(f-J.h)/2+l.metrics.paddingY;Object.defineProperties(x.metrics,{parent:{value:l},sumWidth:{value:E},newBaselineFrom:{value:f},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.sumWidth-this.w)/2)}},offsetY:{get:function(){return b.metrics.offsetY+this.newBaselineFrom}}});Object.defineProperties(G.metrics,{parent:{value:l},sumWidth:{value:E},
x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+2*this.parent.metrics.paddingX+this.sumWidth}},offsetY:{get:function(){return b.metrics.offsetY}}});l.metrics.w=E+G.metrics.w+3*l.metrics.paddingX;l.metrics.ascent=Math.max(G.metrics.ascent,-m+w.metrics.ascent)+l.metrics.paddingY;l.metrics.descent=Math.max(G.metrics.descent,f+x.metrics.descent)+l.metrics.paddingY;l.metrics.h=l.metrics.ascent+l.metrics.descent;
h+=2*l.metrics.marginX}else if("integral"===d.nodeType){l=d;l.updateFormula();m=l.children;x=m[0];w=m[1];G=m[2];l.metrics.marginX=parseInt(1.5+.075*this.style.size);l.metrics.paddingX=parseInt(1.5+.075*this.style.size);l.metrics.paddingY=parseInt(1.5+.05*this.style.size);l.metrics.offsetX_aux=h;Object.defineProperties(l.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.marginX+this.offsetX_aux}},
offsetY:{get:function(){return b.metrics.offsetY}}});a.ctx.font=d.style.toString();J=e(a.ctx.font);E=parseInt(1.2*J.h);var F=parseInt(10.5+529*E/1E3);l.sign={w:F,h:E,scale:E/1E3};l.sign.parent=l;Object.defineProperties(l.sign,{x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX}},y:{get:function(){return b.metrics.offsetY+J.descent-(this.h+J.h)/2}}});m=J.descent-(E+J.h)/2-w.metrics.descent+E/3;Object.defineProperties(w.metrics,{parent:{value:l},integralWidth:{value:F},
newBaselineTo:{value:m},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt(4*this.integralWidth/5)}},offsetY:{get:function(){return b.metrics.offsetY+this.newBaselineTo}}});f=J.descent+x.metrics.ascent/2;Object.defineProperties(x.metrics,{parent:{value:l},integralWidth:{value:F},newBaselineFrom:{value:f},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},
offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt(2*this.integralWidth/5)}},offsetY:{get:function(){return b.metrics.offsetY+this.newBaselineFrom}}});F=Math.max(parseInt(3*F/5)+w.metrics.w,parseInt(2*F/5+x.metrics.w))+l.metrics.paddingX;Object.defineProperties(G.metrics,{parent:{value:l},whatDisplace:{value:F},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+
this.whatDisplace}},offsetY:{get:function(){return b.metrics.offsetY}}});l.metrics.w=F+G.metrics.w+2*l.metrics.paddingX;l.metrics.ascent=Math.max(G.metrics.ascent,-m+w.metrics.ascent)+l.metrics.paddingY;l.metrics.descent=Math.max(G.metrics.descent,f+x.metrics.descent,E-l.metrics.ascent)+l.metrics.paddingY;l.metrics.h=Math.max(l.metrics.ascent+l.metrics.descent,E);h+=2*l.metrics.marginX}else if("prod"===d.nodeType)l=d,l.updateFormula(),m=l.children,x=m[0],w=m[1],G=m[2],l.metrics.marginX=parseInt(1.5+
.075*this.style.size),l.metrics.paddingX=parseInt(1.5+.075*this.style.size),l.metrics.paddingY=parseInt(1.5+.05*this.style.size),l.metrics.offsetX_aux=h,Object.defineProperties(l.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}}),a.ctx.font=d.style.toString(),J=e(a.ctx.font),f=parseInt(1.2*J.h),m=parseInt(.5+
876*f/1E3),l.piSign={w:m,h:f,scale:f/1E3},E=Math.max(w.metrics.w,x.metrics.w,l.piSign.w),l.piSign.parent=l,Object.defineProperties(l.piSign,{prodWidth:{value:E},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.prodWidth-this.w)/2)}},y:{get:function(){return b.metrics.offsetY+J.descent-(this.h+J.h)/2}}}),m=J.descent-w.metrics.descent-(f+J.h)/2-l.metrics.paddingY,Object.defineProperties(w.metrics,{parent:{value:l},prodWidth:{value:E},newBaselineTo:{value:m},
x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.prodWidth-this.w)/2)}},offsetY:{get:function(){return b.metrics.offsetY+this.newBaselineTo}}}),f=x.metrics.ascent+J.descent+(f-J.h)/2+l.metrics.paddingY,Object.defineProperties(x.metrics,{parent:{value:l},prodWidth:{value:E},newBaselineFrom:{value:f},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},
offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+parseInt((this.prodWidth-this.w)/2)}},offsetY:{get:function(){return b.metrics.offsetY+this.newBaselineFrom}}}),Object.defineProperties(G.metrics,{parent:{value:l},prodWidth:{value:E},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+2*this.parent.metrics.paddingX+this.prodWidth}},offsetY:{get:function(){return b.metrics.offsetY}}}),
l.metrics.w=E+G.metrics.w+3*l.metrics.paddingX,l.metrics.ascent=Math.max(G.metrics.ascent,-m+w.metrics.ascent)+l.metrics.paddingY,l.metrics.descent=Math.max(G.metrics.descent,f+x.metrics.descent)+l.metrics.paddingY,l.metrics.h=l.metrics.ascent+l.metrics.descent,h+=2*l.metrics.marginX;else if("limit"===d.nodeType){f=d;f.updateFormula();m=f.children;var D=m[0];l=m[1];m=m[2];f.metrics.marginX=parseInt(1.5+.075*this.style.size);f.metrics.paddingX=parseInt(1.5+.075*this.style.size);f.metrics.paddingY=
parseInt(1.5+.05*this.style.size);f.metrics.offsetX_aux=h;Object.defineProperties(f.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}});a.ctx.font=d.style.toString();J=e(a.ctx.font);x=parseInt(.5+a.ctx.measureText("l\u00edm").width);w=parseInt(.5+a.ctx.measureText("\u2192").width);G=Math.max(x,D.metrics.w+w+l.metrics.w);
f.limitText={parent:f};Object.defineProperties(f.limitText,{limitWidth:{value:G},limitTextWidth:{value:x},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+(this.limitWidth-this.limitTextWidth)/2}}});x=J.descent+Math.max(D.metrics.ascent,l.metrics.ascent,2*J.ascent/3)+f.metrics.paddingY;f.limitArrow={parent:f};Object.defineProperties(f.limitArrow,{newBaseline:{value:x},x:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+D.metrics.w}},y:{get:function(){return b.metrics.offsetY+
this.newBaseline}}});Object.defineProperties(D.metrics,{parent:{value:f},newBaseline:{value:x},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX}},offsetY:{get:function(){return b.metrics.offsetY+this.newBaseline}}});Object.defineProperties(l.metrics,{parent:{value:f},arrowWidth:{value:w},newBaseline:{value:x},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},
offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+D.metrics.w+this.arrowWidth}},offsetY:{get:function(){return b.metrics.offsetY+this.newBaseline}}});Object.defineProperties(m.metrics,{parent:{value:f},limitWidth:{value:G},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+2*this.parent.metrics.paddingX+this.limitWidth}},offsetY:{get:function(){return b.metrics.offsetY}}});
f.metrics.w=G+m.metrics.w+3*f.metrics.paddingX;f.metrics.ascent=Math.max(m.metrics.ascent,J.ascent)+f.metrics.paddingY;w=0;m=Math.max(D.metrics.descent,l.metrics.descent,m.metrics.descent);if(0!=D.metrics.h||0!=l.metrics.h)w=x,m=Math.max(D.metrics.descent,l.metrics.descent,m-w);f.metrics.descent=w+m+f.metrics.paddingY;f.metrics.h=f.metrics.ascent+f.metrics.descent;h+=2*f.metrics.marginX}else if("matrix"===d.nodeType){x=d;x.updateFormula();m=x.children;w=x.rows;G=x.columns;x.metrics.marginX=parseInt(1.5+
.075*this.style.size);x.metrics.paddingX=parseInt(5+.075*this.style.size);x.metrics.paddingY=parseInt(1.5+.05*this.style.size);x.metrics.offsetX_aux=h;Object.defineProperties(x.metrics,{x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}});a.ctx.font=d.style.toString();J=e(a.ctx.font);E=[];F=[];f=0;for(var B=w*G;f<B;f++){var L=
parseInt(f/G);var I=f%G;E[L]=Math.max(E[L]||0,m[f].metrics.h);F[I]=Math.max(F[I]||0,m[f].metrics.w)}var M=(1+G)*x.metrics.paddingX;for(f=0;f<G;f++)M+=F[f];var O=(1+w)*x.metrics.paddingY;for(f=0;f<w;f++)O+=E[f];l=J.descent-J.h/2;f=0;for(B=w*G;f<B;f++)L=parseInt(f/G),I=f%G,m[f].metrics.offsetX_aux=k(F,I)+(F[I]-m[f].metrics.w)/2+I*x.metrics.paddingX,m[f].metrics.offsetY_aux=k(E,L)+(E[L]-m[f].metrics.h)/2+(1+L)*x.metrics.paddingY,Object.defineProperties(m[f].metrics,{parent:{value:x},matrixH:{value:O},
dispY:{value:l},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY-this.matrixH/2+this.ascent+this.offsetY_aux+this.dispY}}});x.metrics.w=M;x.metrics.ascent=O/2-l;x.metrics.descent=O/2+l;x.metrics.h=x.metrics.ascent+x.metrics.descent;h+=2*x.metrics.marginX}else if("defparts"===d.nodeType){x=d;x.updateFormula();m=d.children;
w=d.parts;x.metrics.marginX=parseInt(1.5+.075*this.style.size);x.metrics.paddingX=parseInt(1.5+.075*this.style.size);x.metrics.paddingY=parseInt(1.5+.05*this.style.size);x.metrics.offsetX_aux=h;Object.defineProperties(x.metrics,{parent:{value:b},x:{get:function(){return this.offsetX-2*this.marginX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return b.metrics.offsetX+b.metrics.paddingX+3*this.marginX+this.offsetX_aux}},offsetY:{get:function(){return b.metrics.offsetY}}});a.ctx.font=
d.style.toString();J=e(a.ctx.font);G=0;E=x.metrics.paddingY;l=J.descent-J.h/2;for(f=0;f<w;f++)m[f].metrics.offsetY_aux=E,G=Math.max(G,m[f].metrics.w),E+=m[f].metrics.h+x.metrics.paddingY,Object.defineProperties(m[f].metrics,{parent:{value:x},dispY:{value:l},x:{get:function(){return this.offsetX}},y:{get:function(){return this.offsetY}},offsetX:{get:function(){return this.parent.metrics.offsetX+this.parent.metrics.paddingX}},offsetY:{get:function(){return b.metrics.offsetY-this.parent.metrics.defpartsH/
2+this.ascent+this.offsetY_aux+this.dispY}}});x.metrics.defpartsH=E;x.metrics.w=G+4*x.metrics.paddingX;x.metrics.ascent=E/2-l;x.metrics.descent=E/2+l;x.metrics.h=x.metrics.ascent+x.metrics.descent;h+=2*x.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.ascent+=d.metrics.paddingY,d.metrics.descent+=d.metrics.paddingY,d.metrics.h=d.metrics.ascent+d.metrics.descent,1==d.children.length&&"text"==d.children[0].nodeType&&""==d.children[0].value?(d.metrics.w=0,a.in_editor||(d.metrics.ascent=d.metrics.descent=d.metrics.h=0)):d.metrics.w+=2*d.metrics.paddingX;f=d;this.metrics.ascent=Math.max(this.metrics.ascent,d.metrics.tmp_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;h+=d.metrics.w}};h.prototype.justifyAux=function(a){for(var b=0,c=0,e=0,f=this.children.length;e<f-1;e++)"space"===this.children[e].nodeType?b++:c+=this.children[e].metrics.w;this.updateLine((a-c)/b)};h.prototype.drawTextBlock=function(a){a.fillStyle=r;a.shadowBlur=this.style.shadowBlur;a.shadowOffsetX=this.style.shadowOffsetX;a.shadowOffsetY=this.style.shadowOffsetY;a.shadowColor=this.style.shadowColor;
for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);a.shadowColor="transparent"};h.prototype.drawTextLineBlock=function(a){for(var b=0,c=this.children.length;b<c;b++)f=!1,this.children[b].draw(a)};h.prototype.drawText=function(a){if(""!==this.value){var b=this.metrics.x,c=this.metrics.y;a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:r;a.font=this.style.toString(f);a.beginPath();this.style.overline&&(a.rect(b,c-this.metrics.ascent+
parseInt(1+this.style.size/25),this.metrics.w,parseInt(1+this.style.size/25)),a.fill());this.style.underline&&(a.rect(b,c+parseInt(1+this.style.size/10),this.metrics.w,parseInt(1+this.style.size/25)),a.fill());if(this.style.border){var e=a.strokeStyle;a.lineWidth=this.style.border_size&&0<parseInt(this.style.border_size)?parseInt(this.style.border_size):1+parseInt(this.style.size/8);a.lineJoin="round";a.miterLimit=2;a.strokeStyle=this.style.border.getColor();a.strokeText(this.value,b,c);a.strokeStyle=
e}a.fillText(this.value,b,c)}};h.prototype.drawWord=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a)};h.prototype.drawSpace=function(a){};h.prototype.drawDynamicText=function(a){var b=this.metrics.x+this.metrics.paddingX,c=this.metrics.y;a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:r;a.font=this.style.toString(f);a.beginPath();this.style.overline&&(a.rect(b,c-this.metrics.ascent+parseInt(1+this.style.size/
25),this.metrics.w,parseInt(1+this.style.size/25)),a.fill());this.style.underline&&(a.rect(b,c+parseInt(1+this.style.size/10),this.metrics.w,parseInt(1+this.style.size/25)),a.fill());a.fillText(this.evalValue,b,c);this.drawBorder(a,"blue")};h.prototype.drawHyperlink=function(a){var b=this.metrics.x,c=this.metrics.y;this.ctx=a;this.clickCatcher.parentNode||(a.canvas.nextSibling.className?a.canvas.parentNode.insertBefore(this.clickCatcher,a.canvas.nextSibling.nextSibling):a.canvas.parentNode.insertBefore(this.clickCatcher,
a.canvas.nextSibling));this.clickCatcher.style.left=b+"px";this.clickCatcher.style.top=c-this.metrics.ascent+"px";a.fillStyle="blue";this.click&&(a.fillStyle="white",a.fillRect(b,c-this.metrics.ascent,this.metrics.w,this.metrics.h),a.fillStyle="red");a.font=this.style.toString(f);a.beginPath();a.rect(b,c+parseInt(1+this.style.size/10),this.metrics.w,parseInt(1+this.style.size/25));a.fill();a.fillText(this.value,b,c)};h.prototype.drawFormula=function(a){for(var b=0,c=this.children.length;b<c;b++)f=
!0,this.children[b].draw(a);this.drawBorder(a,"blue")};h.prototype.drawFraction=function(a){a.lineWidth=5;a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:r;a.beginPath();var b=parseInt(1+this.style.size/24);a.rect(this.metrics.x,this.metrics.offsetY-parseInt(b/2),this.metrics.w,b);a.fill();this.children[0].draw(a);this.children[1].draw(a);this.drawBorder(a,"blue")};h.prototype.drawNumDen=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);
this.drawBorder(a,"blue")};h.prototype.drawSuperIndex=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);this.drawBorder(a,"blue")};h.prototype.drawSubIndex=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);this.drawBorder(a,"blue")};h.prototype.drawRadical=function(a){a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:r;a.save();a.translate(this.radicalSign.x,this.radicalSign.y);a.scale(this.radicalSign.scaleX,
this.radicalSign.scaleY);this.drawRadicalSign(a);a.restore();a.beginPath();a.fillRect(this.children[1].metrics.x+2.5,this.radicalSign.y-.5,this.children[1].metrics.w-1.5,parseInt(1+this.style.size/18));for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);this.drawBorder(a,"blue")};h.prototype.drawSum=function(a){a.save();a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:r;a.translate(this.sigmaSign.x,this.sigmaSign.y);a.scale(this.sigmaSign.scale,
this.sigmaSign.scale);if(this.style.border){var b=a.strokeStyle;a.lineWidth=this.style.border_size&&0<parseInt(this.style.border_size)?parseInt(this.style.border_size):1+parseInt(this.style.size/8);a.lineWidth=parseInt(a.lineWidth/this.sigmaSign.scale);a.lineJoin="round";a.miterLimit=2;a.strokeStyle=this.style.border.getColor();a.strokeStyle=b}this.drawSigmaSign(a);a.restore();b=0;for(var c=this.children.length;b<c;b++)this.children[b].draw(a);this.drawBorder(a,"blue")};h.prototype.drawIntegral=function(a){a.save();
a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:r;a.translate(this.sign.x,this.sign.y);a.scale(this.sign.scale,this.sign.scale);this.drawIntegralSign(a);a.restore();for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);this.drawBorder(a,"blue")};h.prototype.drawProd=function(a){a.save();a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:r;a.translate(this.piSign.x,this.piSign.y);
a.scale(this.piSign.scale,this.piSign.scale);this.drawProdSign(a);a.restore();for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);this.drawBorder(a,"blue")};h.prototype.drawLimit=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);a.fillStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:r;a.font=this.style.toString();a.fillText("l\u00edm",this.limitText.x,this.metrics.y);0!=this.children[1].metrics.h&&a.fillText("\u2192",
this.limitArrow.x,this.limitArrow.y);this.drawBorder(a,"blue")};h.prototype.drawMatrix=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);c=parseInt(1.5+this.style.size/25);b=c/2;a.lineWidth=c;a.strokeStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:r;a.beginPath();if(0==this.matrix_type)a.moveTo(this.metrics.x+b+1.5*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+b,this.metrics.y+b-
this.metrics.ascent),a.lineTo(this.metrics.x+b,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.lineTo(this.metrics.x+b+1.5*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-b-1.5*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+this.metrics.w-b,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+this.metrics.w-b,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.lineTo(this.metrics.x+
this.metrics.w-b-1.5*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent+this.metrics.h);else if(1==this.matrix_type)a.moveTo(this.metrics.x+b+2*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent),a.bezierCurveTo(this.metrics.x-b,this.metrics.y+b-this.metrics.ascent,this.metrics.x-b,this.metrics.y+b-this.metrics.ascent+this.metrics.h,this.metrics.x+b+2*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-b-2*this.metrics.marginX,
this.metrics.y+b-this.metrics.ascent),a.bezierCurveTo(this.metrics.x+this.metrics.w+b,this.metrics.y+b-this.metrics.ascent,this.metrics.x+this.metrics.w+b,this.metrics.y+b-this.metrics.ascent+this.metrics.h,this.metrics.x+this.metrics.w-b-2*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent+this.metrics.h);else if(2==this.matrix_type){c=3*this.metrics.marginX;var e=c/2;a.moveTo(this.metrics.x+b+c,this.metrics.y+b-this.metrics.ascent);a.bezierCurveTo(this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent,
this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent,this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+2*this.metrics.marginX);a.lineTo(this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2-5*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2);a.bezierCurveTo(this.metrics.x+
b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2+5*this.metrics.marginX);a.lineTo(this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h-2*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+b+e,this.metrics.y-b-this.metrics.ascent+this.metrics.h,this.metrics.x+b+e,this.metrics.y-b-this.metrics.ascent+this.metrics.h,this.metrics.x+
b+c,this.metrics.y-b-this.metrics.ascent+this.metrics.h);a.moveTo(this.metrics.x+this.metrics.w+b-c,this.metrics.y+b-this.metrics.ascent);a.bezierCurveTo(this.metrics.x+this.metrics.w+b-e,this.metrics.y+b-this.metrics.ascent,this.metrics.x+this.metrics.w+b-e,this.metrics.y+b-this.metrics.ascent,this.metrics.x+this.metrics.w+b-e,this.metrics.y+b-this.metrics.ascent+2*this.metrics.marginX);a.lineTo(this.metrics.x+this.metrics.w+b-e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2-5*this.metrics.marginX);
a.bezierCurveTo(this.metrics.x+this.metrics.w+b-e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+this.metrics.w+b-e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+this.metrics.w+b,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2);a.bezierCurveTo(this.metrics.x+this.metrics.w+b-e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+this.metrics.w+b-e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+this.metrics.w+
b-e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2+5*this.metrics.marginX);a.lineTo(this.metrics.x+this.metrics.w+b-e,this.metrics.y+b-this.metrics.ascent+this.metrics.h-2*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+this.metrics.w+b-e,this.metrics.y-b-this.metrics.ascent+this.metrics.h,this.metrics.x+this.metrics.w+b-e,this.metrics.y-b-this.metrics.ascent+this.metrics.h,this.metrics.x+this.metrics.w+b-c,this.metrics.y-b-this.metrics.ascent+this.metrics.h)}else 3==this.matrix_type?
(a.moveTo(this.metrics.x+b,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+b,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-b,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+this.metrics.w-b,this.metrics.y+b-this.metrics.ascent+this.metrics.h)):4==this.matrix_type&&(a.moveTo(this.metrics.x+b,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+b,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+
b+1.25*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+b+1.25*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-b,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+this.metrics.w-b,this.metrics.y+b-this.metrics.ascent+this.metrics.h),a.moveTo(this.metrics.x+this.metrics.w-b-1.25*this.metrics.marginX,this.metrics.y+b-this.metrics.ascent),a.lineTo(this.metrics.x+this.metrics.w-b-1.25*this.metrics.marginX,
this.metrics.y+b-this.metrics.ascent+this.metrics.h));a.stroke();this.drawBorder(a,"blue")};h.prototype.drawDefparts=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);c=parseInt(1.5+this.style.size/25);b=c/2;a.lineWidth=c;a.strokeStyle=null!==this.style.color?this.style.color.getColor?this.style.color.getColor():this.style.color:r;a.beginPath();c=3*this.metrics.marginX;var e=c/2;a.moveTo(this.metrics.x+b+c,this.metrics.y+b-this.metrics.ascent);a.bezierCurveTo(this.metrics.x+
b+e,this.metrics.y+b-this.metrics.ascent,this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent,this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+2*this.metrics.marginX);a.lineTo(this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2-5*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b,this.metrics.y+b-this.metrics.ascent+this.metrics.h/
2);a.bezierCurveTo(this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2,this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h/2+5*this.metrics.marginX);a.lineTo(this.metrics.x+b+e,this.metrics.y+b-this.metrics.ascent+this.metrics.h-2*this.metrics.marginX);a.bezierCurveTo(this.metrics.x+b+e,this.metrics.y-b-this.metrics.ascent+this.metrics.h,this.metrics.x+b+e,this.metrics.y-b-this.metrics.ascent+
this.metrics.h,this.metrics.x+b+c,this.metrics.y-b-this.metrics.ascent+this.metrics.h);a.stroke();this.drawBorder(a,"blue")};h.prototype.drawGenericBlock=function(a){for(var b=0,c=this.children.length;b<c;b++)this.children[b].draw(a);this.drawBorder(a,"blue")};h.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)};h.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)};h.prototype.drawRadicalSign=function(a){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.stroke();a.fill()};h.prototype.drawSigmaSign=function(a){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.stroke();a.fill()};h.prototype.drawIntegralSign=function(a){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.stroke();a.fill()};h.prototype.drawProdSign=function(a){a.beginPath();a.moveTo(876.3561,999.59384);a.lineTo(876.3561,972.20771);a.lineTo(858.75073,972.20771);a.bezierCurveTo(794.19771,
972.20771,761.92121,931.12852,761.92121,847.99206);a.lineTo(761.92121,144.75542);a.bezierCurveTo(761.92121,61.618964,789.30733,27.386304,876.3561,27.386304);a.lineTo(876.3561,1.7633057E-4);a.lineTo(1.184082E-5,1.7633057E-4);a.lineTo(1.184082E-5,27.386304);a.lineTo(16.627304,27.386304);a.bezierCurveTo(77.268015,27.386304,115.41298,51.838204,115.41298,148.66773);a.lineTo(115.41298,865.59743);a.bezierCurveTo(115.41298,936.99697,84.114547,972.20771,18.583456,972.20771);a.lineTo(1.184082E-5,972.20771);
a.lineTo(1.184082E-5,999.59384);a.lineTo(359.93198,999.59384);a.lineTo(359.93198,972.20771);a.lineTo(329.61162,972.20771);a.bezierCurveTo(265.0586,972.20771,243.54093,932.10659,243.54093,841.14553);a.lineTo(243.54093,64.553192);a.lineTo(633.79325,64.553192);a.lineTo(633.79325,841.14553);a.bezierCurveTo(633.79325,916.45738,616.18788,972.20771,547.72257,972.20771);a.lineTo(516.42413,972.20771);a.lineTo(516.42413,999.59384);a.closePath();a.stroke();a.fill()};h.prototype.drawBorderSpecial=function(a,
c){a.beginPath();a.setLineDash([1,2]);a.strokeStyle=c;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([])};h.prototype.toRTF=function(){var a=[],c=[],d="";this.mergeTextNodes();for(var e=0,f=this.children.length;e<f;e++){var h=this.children[e];"textLineBlock"===h.nodeType&&(d+=h.toRTFAux(a,c)+(1<f&&e<f-1?"\\par":""))}h="{\\fonttbl";e=0;for(f=a.length;e<f;e++)h+="\\f"+e+"\\fcharset0 "+a[e]+";";
a="";if(0<c.length){a="{\\colortbl";e=0;for(f=c.length;e<f;e++)a+=c[e];a+="}"}return"{\\rtf1\\uc0"+(h+"}")+a+d+"}"};h.prototype.toRTFAux=function(a,c){for(var b,e,g,f=null,h="",k,p,n,w,z,A=0,G=this.children.length;A<G;A++)k=p="",b=this.children[A],n=this.addToFontTable(b.style.family,a),w=b.style.size,z=this.addToColorTable(b.style.color,c),null===z&&0<c.length&&(z=this.addToColorTable(r,c)),z!==f&&(k+="\\cf"+z,f=z),n!==e&&(k+="\\f"+n,e=n),w!==g&&(k+="\\fs"+2*w,g=w),b.style.italic&&(k+="\\i",p="\\i0"+
p),b.style.bold&&(k+="\\b",p="\\b0"+p),b.style.underline&&(k+="\\ul",p="\\ulnone"+p),b.style.overline&&(k+="\\ol",p="\\olnone"+p),"text"===b.nodeType?(b.value=b.value.replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/{/g,"\\{").replace(/}/g,"\\}"),b=""!==k?k+" "+b.value+p:""!==h&&"}"!==h.charAt(h.length-1)?" "+b.value:b.value,h+=b):"formula"===b.nodeType?h+="{\\*\\mjaformula"+b.formulaToRTF(e,g,f,a,c)+"}":"componentSpace"===b.nodeType?h+="{\\*\\component\\Space "+b.value+"}":"componentNumCtrl"===b.nodeType&&
(h+="{\\*\\component\\NumCtrl "+b.value+"}");return h};h.prototype.formulaToRTF=function(a,c,d,e,f){for(var b,g="",h,k,p,q,n=0,v=this.children.length;n<v;n++)h=k="",b=this.children[n],p=this.addToFontTable(b.style.family,e),q=this.addToColorTable(b.style.color,f),null===q&&0<f.length&&(q=this.addToColorTable(r,f)),p!==a&&(h+="\\f"+p,a=p),q!==d&&(h+="\\cf"+q,"text"!==b.nodeType||"text"===b.nodeType&&""!==b.value)&&(d=q),b.style.italic&&(h+="\\i",k="\\i0"+k),b.style.bold&&(h+="\\b",k="\\b0"+k),b.style.underline&&
(h+="\\ul",k="\\ulnone"+k),b.style.overline&&(h+="\\ol",k="\\olnone"+k),"text"===b.nodeType&&""!==b.value?(b.value=b.value.replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/{/g,"\\{").replace(/}/g,"\\}"),tmpRTF=""!==h?h+" "+b.value+k:"}"!==g.charAt(g.length-1)?" "+b.value:b.value,g+=tmpRTF):"dynamicText"===b.nodeType?(b.value=""===b.value?" ":b.value,g+=h+"{\\expr "+b.value+"\\decimals "+(b.decimals||2)+"\\fixed"+(b.fixed?1:0)+"}"+k):"fraction"===b.nodeType||"radical"===b.nodeType||"index"===b.nodeType||
"radicand"===b.nodeType||"sum"===b.nodeType||"integral"===b.nodeType||"prod"===b.nodeType||"limit"===b.nodeType||"from"===b.nodeType||"to"===b.nodeType||"what"===b.nodeType||"element"===b.nodeType?g+="{\\"+b.nodeType+b.formulaToRTF(a,c,d,e,f)+"}":"numerator"===b.nodeType?g+="{\\num"+b.formulaToRTF(a,c,d,e,f)+"}":"denominator"===b.nodeType?g+="{\\den"+b.formulaToRTF(a,c,d,e,f)+"}":"superIndex"===b.nodeType?g+="{\\supix"+b.formulaToRTF(a,c,d,e,f)+"}":"subIndex"===b.nodeType?g+="{\\subix"+b.formulaToRTF(a,
c,d,e,f)+"}":"matrix"===b.nodeType?g+="{\\matrix\\rows "+(b.rows||2)+"\\columns "+(b.columns||2)+b.formulaToRTF(a,c,d,e,f)+"}":"defparts"===b.nodeType&&(g+="{\\defparts\\parts "+(b.parts||2)+b.formulaToRTF(a,c,d,e,f)+"}");return g};h.prototype.addToFontTable=function(a,c){var b;a.match(/times/i)?b="Times New Roman":a.match(/courier/i)?b="Courier New":a.match(/arial/i)&&(b="Arial");a=c.indexOf(b);-1===a&&(a=c.length,c.push(b));return a};h.prototype.addToColorTable=function(a,c){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 b=c.indexOf(a);-1===b&&(b=c.length,c.push(a));return b}return null};h.prototype.mergeTextNodes=function(){for(var a=[],c=null,d=0,e=this.children.length;d<e;d++)"text"===this.children[d].nodeType?null!==c&&"text"===c.nodeType&&c.style.equals(this.children[d].style)&&(this.children[d].value=c.value+this.children[d].value,a.push(c)):this.children[d].mergeTextNodes(),c=this.children[d];d=0;for(e=a.length;d<
e;d++)this.removeChild(a[d])};var p={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=h;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=String.fromCharCode,e,f,r,n,c,h,p,b,g,d,v,q=function(){};q.prototype.tokenize=function(a){if(a)a=a.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quote;/g,"''").replace(/&squot;/g,"'").replace(/\\rquote /g,"'").replace(/\\endash /g,"-").replace(/\n/g," ").replace(/\r/g,"").replace(/\\uc(\d+) /g,"").replace(/\\uc(\d+)/g,"");else return[];e=[];f="";n=r=0;h=a.charAt(0);p=!1;for(b="text";r<a.length;)c=h,h=a.charAt(r+1),p?"\\"===h||"{"===h||"}"===
h||" "===h||";"===h?(p=!1,f+=c," "===h?(r++,h=a.charAt(r+1),v=!0):v=!1,(g=f.match(/^'([0-9a-f]{2})/))?(d="","text"===b&&(d=e.pop().value),f=d+=k(parseInt(g[1],16))+f.substring(3)):(g=f.match(/^u[0-9]+/))?(d="","text"===b&&(d=e.pop().value),f=d+=k(g[0].substring(1))):("{"===f||"}"===f||"\\"==c?(e.push({type:"text",value:f+(v?" ":"")}),b="text"):(e.push({type:"controlWord",value:f}),b="controlWord"),f="")):"{"==c||"}"==c||"\\"==c?(p=!1,e.push({type:"text",value:c}),b="text"):f+=c:"\\"===c?(p=!0,""!==
f&&(e.push({type:"text",value:f}),b="text",f="")):"{"===c?(n++,""!==f&&(e.push({type:"text",value:f}),f=""),e.push({type:"openBlock",value:n}),b="openBlock"):"}"===c?(""!==f&&(e.push({type:"text",value:f}),f=""),e.push({type:"closeBlock",value:n}),b="closeBlock",n--):f+=c,r++;""!==f&&e.push({type:"text",value:f});return e};a.RTFTokenizer=q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.max,e,f,r,n,c,h,p,b,g,d,v,q,u,y,m,l,x,w,z,A,G,J,E,F,D,B,L,I,M,O,H,P=function(b){this.evaluator=b;this.tokenizer=new a.RTFTokenizer};P.prototype.parse=function(C){e=this.tokenizer.tokenize(C);f={};n=2;if("openBlock"===e[0].type&&"fonttbl"===e[1].value){for(r=e[0].value;"closeBlock"!==e[n].type&&e[n].value!==r;)f[e[n].value]=e[n+2].value.substring(0,e[n+2].value.length-1),n+=3;n++}c={};h=0;if("openBlock"===e[n].type&&"colortbl"===e[n+1].value){r=
e[n++].value;for(n++;"closeBlock"!==e[n].type&&e[n].value!==r;)p=parseInt(e[n++].value.substring(3)).toString(16),b=parseInt(e[n++].value.substring(5)).toString(16),g=parseInt(e[n++].value.substring(4)).toString(16),";"===e[n].value&&n++,c[h++]="#"+(2>p.length?"0"+p:p)+(2>b.length?"0"+b:b)+(2>g.length?"0"+g:g);n++}y=u=q=null;M=I=L=G=A=z=w=x=l=m=!1;J=[new a.TextStyle];E=J[0];D=F=-1;B=[];d=O=new a.TextNode("","textBlock",E,this.evaluator);v=new a.TextNode("","textLineBlock",E,this.evaluator);d.addChild(v);
O.stableWidth=!0;O.hasFormula=!1;C=n;for(var N=e.length;C<N;C++){if("controlWord"==e[C].type)if(f[e[C].value])E.set({family:f[e[C].value]});else if(e[C].value.match(/^fs(\d+)/))E.set({size:parseInt(e[C].value.match(/^fs(\d+)/)[1]/2)});else if("b"==e[C].value)E.set({bold:!0}),0<B.length&&B[B.length-1].style.set({bold:!0});else if("b0"==e[C].value)E.set({bold:!1}),0<B.length&&B[B.length-1].style.set({bold:!1});else if("i"==e[C].value)E.set({italic:!0}),0<B.length&&B[B.length-1].style.set({italic:!0});
else if("i0"==e[C].value)E.set({italic:!1}),0<B.length&&B[B.length-1].style.set({italic:!1});else if("ul"==e[C].value)E.set({underline:!0}),0<B.length&&B[B.length-1].style.set({underline:!0});else if("ulnone"==e[C].value)E.set({underline:!1}),0<B.length&&B[B.length-1].style.set({underline:!1});else if("ol"==e[C].value)E.set({overline:!0}),0<B.length&&B[B.length-1].style.set({overline:!0});else if("olnone"==e[C].value)E.set({overline:!1}),0<B.length&&B[B.length-1].style.set({overline:!1});else if(e[C].value.match(/^cf(\d+)/))E.set({color:c[parseInt(e[C].value.substring(2))]}),
0<B.length&&(B[B.length-1].style.color=E.color);else if("par"==e[C].value){d=new a.TextNode("","textLineBlock",E.clone(),this.evaluator);if("textBlock"!=v.nodeType)for(v=v.parent;"textBlock"!=v.nodeType;)v=v.parent;v.addChild(d);v=d}else if("mjaformula"==e[C].value)O.hasFormula=!0,D=F,m=!0,d=new a.TextNode("","formula",E.clone(),this.evaluator),v.addChild(d),v=d,B[B.length-1]=d;else if("fraction"==e[C].value||"radicand"==e[C].value||"radical"==e[C].value||"what"==e[C].value||"sum"==e[C].value||"integral"==
e[C].value||"limit"==e[C].value){var K=B[B.length-2].style.clone();d=new a.TextNode("",e[C].value,K,this.evaluator);B[B.length-2].addChild(d);B[B.length-1]=d}else"index"==e[C].value?(K=B[B.length-2].style.clone(),K.size=k(parseInt(K.size-.5*K.size),8),d=new a.TextNode("",e[C].value,K,this.evaluator),B[B.length-2].addChild(d),B[B.length-1]=d):"to"==e[C].value||"from"==e[C].value?(K=B[B.length-2].style.clone(),K.size=k(parseInt(K.size-.2*K.size),8),d=new a.TextNode("",e[C].value,K,this.evaluator),B[B.length-
2].addChild(d),B[B.length-1]=d):"num"==e[C].value||"den"==e[C].value?(K=B[B.length-2].style.clone(),K.size=k(Math.round(K.size-.1*K.size),8),"num"==e[C].value?d=new a.TextNode("","numerator",K,this.evaluator):"den"==e[C].value&&(d=new a.TextNode("","denominator",K,this.evaluator)),B[B.length-2].addChild(d),B[B.length-1]=d):"subix"==e[C].value||"supix"==e[C].value?(K=B[B.length-2].style.clone(),K.size=k(Math.floor(K.size-.33*K.size),8),"subix"==e[C].value?d=new a.TextNode("","subIndex",K,this.evaluator):
"supix"==e[C].value&&(d=new a.TextNode("","superIndex",K,this.evaluator)),d.originalStyle=B[B.length-2].style.clone(),B[B.length-2].addChild(d),B[B.length-1]=d):"defparts"==e[C].value||"matrix"==e[C].value||"element"==e[C].value?(K=B[B.length-2].style.clone(),d=new a.TextNode("",e[C].value,K,this.evaluator),B[B.length-2].addChild(d),B[B.length-1]=d,"defparts"==e[C].value?y=d:"matrix"==e[C].value&&(u=d,u.matrix_type=0)):"parts"==e[C].value?G=!0:"type"==e[C].value?w=!0:"rows"==e[C].value?z=!0:"columns"==
e[C].value?A=!0:"expr"==e[C].value?(O.stableWidth=!1,l=!0):"decimals"==e[C].value?x=!0:"fixed1"==e[C].value?q.fixed=!0:"fixed0"==e[C].value?q.fixed=!1:"component"!=e[C].value&&("NumCtrl"==e[C].value?L=!0:"Space"==e[C].value?I=!0:"hyperlink"==e[C].value&&(M=!0));if("text"==e[C].type)if(G)y.parts=parseInt(e[C].value),G=!1;else if(w)u.matrix_type=parseInt(e[C].value),w=!1;else if(z)u.rows=parseInt(e[C].value),z=!1;else if(A)u.columns=parseInt(e[C].value),A=!1;else if(x)q.decimals=this.evaluator.parser.parse(e[C].value+
""),x=!1;else if(M){H=e[C].value.split("|")[0];K=E.clone();d=new a.TextNode(H,"hyperlink",K,this.evaluator);d.URL=e[C].value.split("|")[1];if("textLineBlock"!=v.nodeType)for(v=v.parent;"textLineBlock"!=v.nodeType;)v=v.parent;v.addChild(d);M=!1}else if(L)d=new a.TextNode(e[C].value,"componentNumCtrl",E.clone(),this.evaluator),v.addChild(d),L=!1;else if(I)d=new a.TextNode(e[C].value,"componentSpace",E.clone(),this.evaluator),v.addChild(d),I=!1;else if(l)K=B[B.length-2].style.clone(),H=this.evaluator.parser.parse(e[C].value),
d=new a.TextNode(H,"dynamicText",K,this.evaluator),B[B.length-2].addChild(d),q=B[B.length-1]=d,l=!1;else if(l||m)!l&&m&&(H=e[C].value,d=new a.TextNode(H,"text",B[B.length-1].style.clone(),this.evaluator),B[B.length-1].addChild(d));else{H=e[C].value;d=new a.TextNode(H,"text",E.clone(),this.evaluator);if("textLineBlock"!=v.nodeType)for(v=v.parent;"textLineBlock"!=v.nodeType;)v=v.parent;v.addChild(d)}else if("openBlock"==e[C].type)F=e[C].value,E=E.clone(),J.push(E),B.push(null);else if("closeBlock"==
e[C].type)e[C].value==D&&(D=-1,m=!1,v=v.parent),J.pop(),E=J[J.length-1],B.pop();else if("("==e[C].type||")"==e[C].type)K=B[B.length-1].style.clone(),K.italic="",d=new a.TextNode(e[C].type,"mathSymbol",K,this.evaluator),B[B.length-1].addChild(d);else if("+"==e[C].type||"-"==e[C].type||"*"==e[C].type||"="==e[C].type)d=new a.TextNode(e[C].type,"mathSymbol",B[B.length-1].style.clone(),this.evaluator),B[B.length-1].addChild(d)}return O.normalize()};a.RTFParser=P;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h,p,b,g,d,v=function(b,c){this.parent=b;e=this.evaluator=this.parent.evaluator;f=e.parser;this.id="";this.type="2D";this.xExpr=f.parse("0");this.yExpr=f.parse("0");this.w=parseInt(b.container.width);this.h=parseInt(b.container.height);this.drawif=f.parse("1");this.fixed=!1;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=new a.Color("b8c4c8");this.net10=new a.Color("889498");this.axes=new a.Color("405860");this.numbers=this.text=!1;this.y_axis=this.x_axis="";this.sensitive_to_mouse_movements=!1;this.cID="";this.mouse_y=this.mouse_x=0;this.ctrs=[];this.graphicsCtr=[];this.graphics=[];this.backGraphics=[];this.zIndex=b.zIndex;this.border_width=0;this.border_color=new a.Color("000000");this.border_radius=0;this.plecaHeight=b.plecaHeight||0;this.displaceRegionNorth=b.displaceRegionNorth||0;this.displaceRegionWest=
b.displaceRegionWest||0;Object.assign(this,c);this.initSpace()};v.prototype.initSpace=function(){var a=this;k=a.parent;e=a.evaluator;r=a.id;a.resizable||(a.displaceRegionNorth=k.displaceRegionNorth||0,a.displaceRegionSouth=k.displaceRegionSouth||0,a.displaceRegionEast=k.displaceRegionEast||0,a.displaceRegionWest=k.displaceRegionWest||0,p=parseInt(k.container.width),h=parseInt(k.container.height),void 0!=a.wExpr&&(a.w=parseInt(p-a.displaceRegionWest-a.displaceRegionEast)*parseFloat(a.wExpr)/100),void 0!=
a.hExpr&&(a.h=parseInt(h-a.displaceRegionNorth-a.displaceRegionSouth)*parseFloat(a.hExpr)/100),void 0!=a.xPercentExpr&&(a.xExpr=e.parser.parse((parseInt(p-a.displaceRegionWest-this.displaceRegionEast)*parseFloat(a.xPercentExpr)/100).toString())),void 0!=a.yPercentExpr&&(a.yExpr=e.parser.parse((parseInt(h-a.displaceRegionNorth-a.displaceRegionSouth)*parseFloat(a.yPercentExpr)/100).toString())),a.x=e.eval(a.xExpr)+a.displaceRegionWest,a.y=e.eval(a.yExpr)+a.plecaHeight+a.displaceRegionNorth,a.container&&
(a.container.style.left=a.x+"px",a.container.style.top=a.y+"px"),0<=a.y?(n=h-a.y,a.h>n&&(a.h=n)):(n=a.h+a.y,a.h=n>=h?h:n),0<=a.x?(c=p-a.x,a.w>c&&(a.w=c)):(c=a.w+a.x,a.w=c>=p?p:c));""==a.imageSrc&&/vacio.gif$/i.test(a.imageSrc.trim())||(a.image=k.getImage(a.imageSrc));a.OxExpr&&(g=a.OxExpr,"%"===g[g.length-1]?a.Ox=a.w*parseFloat(g)/100:(b=parseFloat(g),b!=g&&(b=0),a.Ox=b));a.OyExpr&&(d=a.OyExpr,"%"===d[d.length-1]?a.Oy=a.h*parseFloat(d)/100:(b=parseFloat(d),b!=d&&(b=0),a.Oy=b));""!==a.id&&2!==k.version?
(e.setVariable(r+"._w",a.w),e.setVariable(r+"._h",a.h),e.setVariable(r+".escala",a.scale),e.setVariable(r+".Ox",a.Ox),e.setVariable(r+".Oy",a.Oy),e.setVariable(r+".mouse_x",0),e.setVariable(r+".mouse_y",0),e.setVariable(r+".mouse_pressed",0),e.setVariable(r+".mouse_clicked",0),e.setVariable(r+".clic_izquierdo",0)):(b=e.getVariable("_w"),void 0===b&&(b=a.w),e.setVariable("_w",b),b=e.getVariable("_h"),void 0===b&&(b=a.h),e.setVariable("_h",b),b=e.getVariable("escala"),void 0===b&&(b=a.scale),e.setVariable("escala",
b),b=e.getVariable("Ox"),void 0===b&&(b=a.Ox),e.setVariable("Ox",b),b=e.getVariable("Oy"),void 0===b&&(b=a.Oy),e.setVariable("Oy",b),e.setVariable("mouse_x",0),e.setVariable("mouse_y",0),e.setVariable("mouse_pressed",0),e.setVariable("mouse_clicked",0),e.setVariable("clic_izquierdo",0),2==k.version&&""===a.x_axis&&""===a.y_axis&&(a.axes=""));a.w_2=a.w/2;a.h_2=a.h/2;e.setFunction(r+".download_image",function(b){a.evaluator.functions._SaveSpace_(b,a.canvas.toDataURL("image/png"))})};v.prototype.addCtr=
function(a){"GraphicControl"===a.type?this.graphicsCtr.push(a):this.ctrs.push(a)};v.prototype.addGraph=function(a,b){"2D"===this.type&&b||"3D"===this.type&&!b||(a.background&&"3D"!==this.type?this.backGraphics.push(a):this.graphics.push(a))};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 k,e=function(e){k=this;k.parent=e;k.width=228;k.vSpace=25;k.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:"+(k.width+27)+"px;height:460px;"});k.movable=a.newHTML("div",{style:"position:absolute;left:0;top:0;width:"+(k.width+27)+"px;height:"+k.vSpace+
"px;line-height:"+k.vSpace+"px;background-color:#ddd;cursor:move;padding-left:75px;font-family:"+a.sansserif_font+";font-size:18px;"});k.movable.innerHTML="Descartes";k.container.appendChild(k.movable);k.ctrs=[]};e.prototype.init=function(){function e(c){k.newPos=a.getCursorPosition(c,document.body);k.container.style.left=k.initialPosition.x+(k.newPos.x-k.oldPos.x)*a.cssScale+"px";k.container.style.top=k.initialPosition.y+(k.newPos.y-k.oldPos.y)*a.cssScale+"px"}function r(a){a.preventDefault();document.body.removeEventListener("mousemove",
e);document.body.removeEventListener("mouseup",r)}k=this;document.body.appendChild(this.container);for(var n=k.parent.evaluator.parser,c=0,h=k.ctrs.length;c<h;c++)k.ctrs[c].expresion=n.parse("(0,"+(k.vSpace+23+35*c)+","+k.width+",35)"),k.ctrs[c].update();k.numCtr=h;c=new a.Button(k.parent,{region:"external",name:"english"==k.language?"about":"cr\u00e9ditos",font_size:n.parse("15"),expresion:n.parse("(0,"+k.vSpace+","+k.width/2+",25)")});c.actionExec={execute:a.showAbout};c.update();(new a.Button(k.parent,
{region:"external",name:"config",font_size:n.parse("15"),action:"config",expresion:n.parse("("+k.width/2+","+k.vSpace+","+k.width/2+",25)")})).update();(new a.Button(k.parent,{region:"external",name:"english"==k.language?"init":"inicio",font_size:n.parse("15"),action:"init",expresion:n.parse("(0,"+(k.vSpace+23+35*h)+","+k.width/2+",25)")})).update();(new a.Button(k.parent,{region:"external",name:"english"==k.language?"clear":"limpiar",font_size:n.parse("15"),action:"clear",expresion:n.parse("("+k.width/
2+","+(k.vSpace+23+35*h)+","+k.width/2+",25)")})).update();n=new a.Button(k.parent,{region:"external",name:"english"==k.language?"close":"cerrar",font_size:n.parse("15"),expresion:n.parse("("+k.width/4+","+(k.vSpace+46+35*h)+","+k.width/2+",25)")});n.update();n.btn.addEventListener("click",function(a){k.hide()});k.setPositionAndSize();k.movable.addEventListener("mousedown",function(c){c.preventDefault();k.oldPos=a.getCursorPosition(c,document.body);k.initialPosition={x:k.container.offsetLeft,y:k.container.offsetTop};
document.body.addEventListener("mousemove",e);document.body.addEventListener("mouseup",r)});k.hide()};e.prototype.addCtr=function(a){this.ctrs.push(a)};e.prototype.show=function(){this.setPositionAndSize();this.container.style.display="block"};e.prototype.hide=function(){this.container.style.display="none"};e.prototype.setPositionAndSize=function(){k=this;var a=k.vSpace+46+35*k.numCtr+25+10;k.container.style.left=Math.max(parseInt(window.innerWidth-k.width)/2,0)+"px";k.container.style.top="5px";k.container.style.height=
window.innerHeight<k.vSpace+75?k.vSpace+75+"px":a>window.innerHeight-10?window.innerHeight-10:a+"px"};a.SpaceExternal=e;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k=Math.floor,e=Math.round,f=2*Math.PI,r=a.convertFont("Serif,BOLD+ITALIC,16"),n=a.convertFont("Monospaced,PLAIN,12"),c,h,p,b,g,d,v,q,u,y,m,l,x,w,z,A,G,J,E,F,D,B,L,I,M,O,H,P,C,N,K,Q,R=function(b,d){c=d=a.Space.call(this,b,d)||this;c.ratio=b.ratio;c.canvas=a.newHTML("canvas",{id:c.id+"_canvas",class:"DescartesSpace2DCanvas",width:c.w*c.ratio});c.backCanvas=a.newHTML("canvas",{id:c.id+"_background",width:c.w*c.ratio});c.canvas.style=c.backCanvas.style=
(0<c.border_width?"border:"+c.border_width+"px solid "+c.border_color.getColor()+";":"")+(c.border_radius?"border-radius:"+c.border_radius+"px;":"");c.canvas.style.zIndex=c.zIndex;c.canvas.style.width=c.backCanvas.style.width=c.w+"px";c.canvas.style.height=c.backCanvas.style.height=c.h+"px";c.ctx=c.canvas.getContext("2d");c.backCtx=c.backCanvas.getContext("2d");c.ctx.imageSmoothingEnabled=c.backCtx.imageSmoothingEnabled=!1;c.graphicControlContainer=a.newHTML("div",{id:c.id+"_graphicControls",style:"position:absolute;left:0;top:0;z-index:"+
c.zIndex+";"});c.numericalControlContainer=a.newHTML("div",{id:c.id+"_numericalControls",style:"position:absolute;left:0;top:0;z-index:"+c.zIndex+";"});c.container=a.newHTML("div",{id:c.id,class:"DescartesSpace2DContainer",style:"z-index:"+c.zIndex+";"});c.parent.arquimedes&&"#f0f8fa"===c.background.getColor()&&(c.container.style.boxShadow="0 0 5px 0 #b8c4c8");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);var e=c.id+".image";c.parent.images[e]=c.canvas;c.parent.images[e].ready=1;c.parent.images[e].complete=c.parent.images[e].canvas=!0;c.evaluator.setVariable(e,e);e=c.id+".back";c.parent.images[e]=c.backCanvas;c.parent.images[e].ready=1;c.parent.images[e].complete=c.parent.images[e].canvas=!0;c.evaluator.setVariable(e,e);e=""!==c.id&&2!==b.version?c.id+".":"";c.OxStr=e+"Ox";c.OyStr=e+"Oy";c.scaleStr=e+"escala";c.wStr=e+"_w";c.hStr=e+"_h";c.mxStr=e+"mouse_x";
c.myStr=e+"mouse_y";c.mpressedStr=e+"mouse_pressed";c.mclickedStr=e+"mouse_clicked";c.mclickIzqStr=e+"clic_izquierdo";c.click=0;c.resizable&&(c.wModExpr=b.evaluator.parser.parse(c.wModExpr),c.hModExpr=b.evaluator.parser.parse(c.hModExpr));"descartesJS_stage"!==c.id?c.addEvents():c.canvas.oncontextmenu=function(a){return!1};return d};$jscomp.inherits(R,a.Space);R.prototype.init=function(){c=this;this.initSpace();c.canvas&&(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")};R.prototype.update=function(a){c=this;h=c.evaluator;p=c.parent;if(c.resizable){if(C=c.evaluator.eval(c.wModExpr),N=c.evaluator.eval(c.hModExpr),c.old_w!=C||c.old_h!=N)c.w=C,c.h=N,c.w_2=c.w/2,c.h_2=c.h/2,h.setVariable(c.wStr,c.w),h.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}else h.setVariable(c.wStr,c.w),h.setVariable(c.hStr,c.h);c.drawIfValue=0<h.eval(c.drawif);if(c.drawIfValue){g=c.x!==h.eval(c.xExpr)+c.displaceRegionWest;d=c.y!==h.eval(c.yExpr)+p.plecaHeight+c.displaceRegionNorth;c.spaceChange=a||g||d||c.drawBefore!==c.drawIfValue||c.Ox!==h.getVariable(c.OxStr)||c.Oy!==h.getVariable(c.OyStr)||c.scale!==h.getVariable(c.scaleStr)||c.backColor!==
c.background.getColor();c.x=g?h.eval(c.xExpr)+c.displaceRegionWest:c.x;c.y=d?h.eval(c.yExpr)+p.plecaHeight+c.displaceRegionNorth:c.y;c.Ox=h.getVariable(c.OxStr);c.Oy=h.getVariable(c.OyStr);c.scale=h.getVariable(c.scaleStr);c.drawBefore=c.drawIfValue;c.scale=Math.max(1E-6,Math.min(1E6,c.scale));h.setVariable(c.scaleStr,c.scale);if(g||d)c.container.style.left=c.x+"px",c.container.style.top=c.y+"px";c.container.style.display="block";c.drawTrace=!c.spaceChange&&(!c.fixed&&!c.click||c.fixed);c.spaceChange&&
(c.backCtx.setTransform(c.ratio,0,0,c.ratio,0,0),c.drawBackground());c.ctx.setTransform(c.ratio,0,0,c.ratio,0,0);c.draw()}else c.container.style.display="none"};R.prototype.drawBackground=function(){c=this;h=c.evaluator;b=c.backCtx;b.clearRect(0,0,c.backCanvas.width,c.backCanvas.height);b.fillStyle=c.backColor=c.background.getColor();b.fillRect(0,0,c.backCanvas.width,c.backCanvas.height);c.image&&""!=c.image.src&&c.image.ready&&c.image.complete&&("topleft"===c.bg_display?b.drawImage(c.image,0,0):
"stretch"===c.bg_display?b.drawImage(c.image,0,0,c.w,c.h):"patch"===c.bg_display?(b.fillStyle=b.createPattern(c.image,"repeat"),b.fillRect(0,0,c.w,c.h)):"imgcenter"===c.bg_display&&b.drawImage(c.image,(c.w-c.image.width)/2,(c.h-c.image.height)/2));q=c.scale;u=0;for(y=0>c.w+c.h?0:c.w+c.h;q>y;)q/=10,u++;for(;q<y/10;)q*=10;b.lineWidth=1;""!==c.net&&(b.strokeStyle=c.net.getColor(),c.drawMarks(b,q/10,-1));if(2!==c.parent.version&&""!==c.net10||2===c.parent.version&&""!==c.net&&""!==c.net10)b.strokeStyle=
c.net10.getColor(),c.drawMarks(b,q,-1);if(""!==c.axes){var a="";"no"==c.x_axis&&(a+="x");"no"==c.y_axis&&(a+="y");b.strokeStyle=c.axes.getColor();b.beginPath();"no"==c.x_axis||""===c.x_axis&&2===c.parent.version||(b.moveTo(0,k(c.h/2+c.Oy)+.5),b.lineTo(c.w,k(c.h/2+c.Oy)+.5));"no"==c.y_axis||""===c.y_axis&&2===c.parent.version||(b.moveTo(k(c.w/2+c.Ox)+.5,0),b.lineTo(k(c.w/2+c.Ox)+.5,c.h));b.lineWidth=1.2;b.stroke();b.lineWidth=1;c.drawMarks(b,q,4,a);c.drawMarks(b,q/2,2,a);c.drawMarks(b,q/10,1,a)}if(""!==
c.x_axis||""!==c.y_axis)b.fillStyle=""!==c.axes?c.axes.getColor():"#000",b.font=r,b.textAlign="right",b.textBaseline="alphabetic","no"!=c.x_axis&&b.fillText(c.x_axis,k(c.w)-2,k(c.h/2+c.Oy)+12),"no"!=c.y_axis&&b.fillText(c.y_axis,k(c.w/2+c.Ox)-2,12);c.numbers&&""!=c.axes&&(b.fillStyle=c.axes.getColor(),b.font=r,b.textAlign="start",b.textBaseline="bottom",q>(c.w+c.h)/2?c.drawNumbers(b,q/5,q<=c.scale?u+1:u):q>(c.w+c.h)/4?c.drawNumbers(b,q/2,q<=c.scale?u+1:u):c.drawNumbers(b,q,u));a=0;for(var d=this.backGraphics.length;a<
d;a++)this.backGraphics[a].draw()};R.prototype.draw=function(){c=this;b=c.ctx;b.clearRect(0,0,c.canvas.width,c.canvas.height);for(var a=0,d=c.graphics.length;a<d;a++)v=c.graphics[a],""!==v.trace&&c.drawTrace&&v.drawTrace(),v.draw();a=0;for(d=c.graphicsCtr.length;a<d;a++)c.graphicsCtr[a].draw();""!=c.text&&c.click&&"L"===c.whichBtn&&(b.save(),b.strokeStyle=b.fillStyle=c.text.getColor(),b.lineWidth=1,b.font=n,b.textAlign="center",b.textBaseline="alphabetic",D=1>=c.scale?c.mouse_x.toFixed(0):c.mouse_x.toFixed(parseInt(c.scale).toString().length+
1),B=1>=c.scale?c.mouse_y.toFixed(0):c.mouse_y.toFixed(parseInt(c.scale).toString().length+1),L="("+D+","+B+")",I=k(b.measureText(L).width/2),M=c.getAbsoluteX(c.mouse_x),O=c.getAbsoluteY(c.mouse_y),H=k(M),P=k(O-10),H+I>c.w?H=c.w-I:0>H-I&&(H=I),P+1>c.h?P=c.h:0>P-14&&(P=15),b.fillText(L,H,P),b.beginPath(),b.arc(M,O,2.5,0,f,!0),b.stroke(),b.restore())};R.prototype.drawMarks=function(a,b,c,d){m=this.w;l=this.h;E=G=0;J=m;F=l;z=k(m/2+this.Ox);A=k(l/2+this.Oy);0<=c&&(G=z-c,J=z+c,E=A-c,F=A+c);a.beginPath();
if(!d||d&&!d.match("x"))for(c=-e(z/b);(x=z+e(c*b))<m;c++)a.moveTo(x+.5,E+.5),a.lineTo(x+.5,F+.5);if(!d||d&&!d.match("y"))for(c=-e(A/b);(w=A+e(c*b))<l;c++)a.moveTo(G+.5,w+.5),a.lineTo(J+.5,w+.5);a.stroke()};R.prototype.drawNumbers=function(a,b,c){m=this.w;l=this.h;z=k(m/2+this.Ox);A=k(l/2+this.Oy);for(c=-e(z/b);(x=z+e(c*b))<m;c++)a.fillText(parseFloat((c*b/this.scale).toFixed(4)),x+1,A-2);for(c=-e(A/b);(w=A+e(c*b))<l;c++)0!==parseFloat(-c*b/this.scale)&&a.fillText(parseFloat((-c*b/this.scale).toFixed(4)),
z+5,w+5)};R.prototype.addEvents=function(){function b(a){window.focus();document.activeElement.blur();if(f.evaluator.variables[f.id+".DESCARTESJS_no_fixed"]||!f.fixed||f.sensitive_to_mouse_movements)f.click=0,f.evaluator.setVariable(f.mpressedStr,0),f.evaluator.setVariable(f.mclickedStr,1),f.evaluator.setVariable(f.mclickIzqStr,1),window.removeEventListener("touchmove",g),window.removeEventListener("touchend",b),a.stopPropagation(),a.preventDefault(),f.parent.update()}function c(b){document.activeElement.blur();
window.focus();b.stopPropagation();b.preventDefault();f.click=0;f.evaluator.setVariable(f.mpressedStr,0);f.evaluator.setVariable(f.mclickedStr,1);f.evaluator.setVariable(f.mclickIzqStr,1);"R"===f.whichBtn&&(window.removeEventListener("mousemove",e),f.posZoom==f.posZoomNew&&a.showConfig&&(f.parent.externalSpace.show(),f.posZoom=!1,f.posZoomNew=!0));window.removeEventListener("mousemove",g);window.removeEventListener("mouseup",c);f.parent.deactivateGraphicControls();f.parent.update()}function d(b){f.posAnte=
a.getCursorPosition(b,f.container);f.mouse_x=f.getRelativeX(f.posAnte.x);f.mouse_y=f.getRelativeY(f.posAnte.y);f.evaluator.setVariable(f.mxStr,f.mouse_x);f.evaluator.setVariable(f.myStr,f.mouse_y);f.evaluator.setVariable(f.mclickedStr,0);f.evaluator.setVariable(f.mclickIzqStr,0);f.parent.update()}function e(b){b.preventDefault();f.posZoomNew=a.getCursorPosition(b,f.container).y;f.evaluator.setVariable(f.scaleStr,f.tempScale+f.tempScale/45*((f.posZoom-f.posZoomNew)/10));f.parent.update()}function g(b){b.preventDefault();
b.stopPropagation();f.fixed||(f.posNext=a.getCursorPosition(b,f.container),K=f.posAnte.x-f.posNext.x,Q=f.posAnte.y-f.posNext.y,f.evaluator.setVariable(f.OxStr,f.Ox-K),f.evaluator.setVariable(f.OyStr,f.Oy-Q));d(b)}var f=this;f.posZoom=f.posZoomNew=null;f.canvas.oncontextmenu=function(a){return!1};this.sensitive_to_mouse_movements&&this.canvas.addEventListener("touchmove",d);this.canvas.addEventListener("touchstart",function(a){window.focus();document.activeElement.blur();if(f.evaluator.variables[f.id+
".DESCARTESJS_no_fixed"]||!f.fixed||f.sensitive_to_mouse_movements)f.parent.clearClick(),f.click=1,f.evaluator.setVariable(f.mpressedStr,1),f.evaluator.setVariable(f.mclickedStr,0),f.evaluator.setVariable(f.mclickIzqStr,0),f.parent.deactivateGraphicControls(),d(a),window.addEventListener("touchmove",g),window.addEventListener("touchend",b),a.stopPropagation(),a.preventDefault()});this.sensitive_to_mouse_movements&&this.canvas.addEventListener("mousemove",d);this.canvas.addEventListener("mousedown",
function(b){window.focus();document.activeElement.blur();b.stopPropagation();b.preventDefault();f.parent.clearClick();f.click=1;f.parent.deactivateGraphicControls();f.whichBtn=a.whichBtn(b);"R"===f.whichBtn?(window.addEventListener("mouseup",c),f.posZoom=a.getCursorPosition(b,f.container).y,f.posZoomNew=f.posZoom,f.fixed||(f.tempScale=f.scale,window.addEventListener("mousemove",e))):"L"===f.whichBtn&&(f.evaluator.setVariable(f.mpressedStr,1),f.evaluator.setVariable(f.mclickedStr,0),f.evaluator.setVariable(f.mclickIzqStr,
0),d(b),window.addEventListener("mousemove",g),window.addEventListener("mouseup",c))});document.addEventListener("visibilitychange",function(a){c(a)});document.addEventListener("mouseleave",function(a){f.click=0;f.evaluator.setVariable(f.mpressedStr,0);f.evaluator.setVariable(f.mclickedStr,1);f.evaluator.setVariable(f.mclickIzqStr,1);window.removeEventListener("mousemove",g);window.removeEventListener("mouseup",c)})};a.Space2D=R;return a}(descartesJS||{});
descartesJS=function(a){var k,e,f;function r(b,c){H=a.subtract3D(b,a.scalarProduct3D(c,a.dotProduct3D(b,c)));P=a.add3D(b,a.scalarProduct3D(H,-2));C=a.norm3D(P);return 0!==C?a.scalarProduct3D(P,1/C):a.scalarProduct3D(b,-1)}if(a.loadLib)return a;var n=Math.floor,c=Math.max,h=Math.cos,p=Math.sin,b,g,d,v,q,u,y,m,l,x,w,z,A,G,J,E,F=[],D,B,L,I,M,O,H,P,C,N,K,Q=function(b,c){d=c=a.Space.call(this,b,c)||this;d.backCanvas=a.newHTML("canvas",{id:d.id+"_background",width:d.w+"px",height:d.h+"px"});d.canvas=a.newHTML("canvas",
{id:d.id+"_canvas",width:d.w+"px",height:d.h+"px",class:"DescartesSpace3DCanvas",style:"z-index: "+d.zIndex+";"});d.ctx=d.canvas.getContext("2d");d.ctx.imageSmoothingEnabled=!1;d.canvas.style=d.backCanvas.style=(0<d.border_width?"border:"+d.border_width+"px solid "+d.border_color.getColor()+";":"")+(d.border_radius?"border-radius:"+d.border_radius+"px;":"");var e=d.id+".image";d.parent.images[e]=d.canvas;d.parent.images[e].ready=1;d.parent.images[e].complete=!0;d.parent.images[e].canvas=!0;d.evaluator.setVariable(e,
e);d.graphicControlContainer=a.newHTML("div",{id:d.id+"_graphicControls",style:"position:absolute;left:0px;top:0px;z-index:"+d.zIndex+";"});d.numericalControlContainer=a.newHTML("div",{id:d.id+"_numericalControls",style:"position:absolute;left:0px;top:0px;z-index:"+d.zIndex+";"});d.container=a.newHTML("div",{id:d.id,class:"DescartesSpace3DContainer",style:"z-index:"+d.zIndex+";"});d.container.appendChild(d.backCanvas);d.container.appendChild(d.canvas);d.container.appendChild(d.graphicControlContainer);
d.container.appendChild(d.numericalControlContainer);b.container.insertBefore(d.container,b.loader);d.eye={x:0,y:0,z:0};d.lights=[{x:50,y:50,z:70},{x:50,y:-50,z:30},{x:20,y:0,z:-80},{x:0,y:0,z:0}];e=0;for(var f=d.lights.length;e<f;e++)d.lights[e]=a.normalize3D(d.lights[e]);d.light3={x:0,y:0,z:0};d.intensity=[.4,.5,.3,0];d.userIntensity=0;d.dim=1;d.tmpIntensity=[];d.OxStr=d.id+".Ox";d.OyStr=d.id+".Oy";d.scaleStr=d.id+".escala";d.wStr=d.id+"._w";d.hStr=d.id+"._h";d.obsStr=d.id+".observador";d.ojoXStr=
d.id+".Ojo.x";d.ojoYStr=d.id+".Ojo.y";d.ojoZStr=d.id+".Ojo.z";d.rotZStr=d.id+".rot.z";d.rotYStr=d.id+".rot.y";d.userIDimStr=d.id+".userIlum.dim";d.userIIStr=d.id+".userIlum.I";d.userIxStr=d.id+".userIlum.x";d.userIyStr=d.id+".userIlum.y";d.userIzStr=d.id+".userIlum.z";d.evaluator.setVariable(d.rotZStr,0);d.evaluator.setVariable(d.rotYStr,0);d.evaluator.setVariable(d.userIDimStr,d.dim);d.evaluator.setVariable(d.userIIStr,d.userIntensity);d.evaluator.setVariable(d.userIxStr,0);d.evaluator.setVariable(d.userIyStr,
0);d.evaluator.setVariable(d.userIzStr,0);K=new a.Primitive3D({vertices:[new a.Vector4D(0,0,0,1)],type:"vertex"},d);d.evaluator.setFunction(d.id+"._X3D2D_",function(a,b,c){K.vertices[0].x=a;K.vertices[0].y=b;K.vertices[0].z=c;K.computeDepth(d);return K.projVert[0].x});d.evaluator.setFunction(d.id+"._Y3D2D_",function(a,b,c){K.vertices[0].x=a;K.vertices[0].y=b;K.vertices[0].z=c;K.computeDepth(d);return K.projVert[0].y});d.resizable&&(d.wModExpr=b.evaluator.parser.parse(d.wModExpr),d.hModExpr=b.evaluator.parser.parse(d.hModExpr));
d.ratio=1;d.addEvents();return c};$jscomp.inherits(Q,a.Space);Q.prototype.init=function(a){d=this;d.initSpace();d.canvas&&(d.canvas.width=d.backCanvas.width=d.w,d.canvas.height=d.backCanvas.height=d.h,d.canvas.style.width=d.backCanvas.style.width=d.w+"px",d.canvas.style.height=d.backCanvas.style.height=d.h+"px");d.w_2=d.w/2;d.h_2=d.h/2;d.w_plus_h=d.w+d.h;d.oldMouse={x:0,y:0};d.S={x:d.h/1080*-20.6*(40/d.scale),y:0,z:0};d.Ojo={x:3*d.w_2,y:0,z:0};d.evaluator.setVariable(d.ojoXStr,d.Ojo.x);d.evaluator.setVariable(d.ojoYStr,
d.Ojo.y);d.evaluator.setVariable(d.ojoZStr,d.Ojo.z)};Q.prototype.update=function(a){d=this;b=d.evaluator;g=d.parent;b.setVariable(d.wStr,d.w);b.setVariable(d.hStr,d.h);d.drawIfValue=0<b.eval(d.drawif);if(d.drawIfValue){d.resizable&&(wModExpr=d.evaluator.eval(d.wModExpr),hModExpr=d.evaluator.eval(d.hModExpr),d.old_w!=wModExpr||d.old_h!=hModExpr)&&(d.w=wModExpr,d.h=hModExpr,d.w_2=d.w/2,d.h_2=d.h/2,b.setVariable(d.wStr,d.w),b.setVariable(d.hStr,d.h),d.old_w=d.w,d.old_h=d.h,d.canvas.width=d.backCanvas.width=
d.w*d.ratio,d.canvas.height=d.backCanvas.height=d.h*d.ratio,d.canvas.style.width=d.backCanvas.style.width=d.w+"px",d.canvas.style.height=d.backCanvas.style.height=d.h+"px",a=!0,d.S={x:d.h/1080*-20.6*(40/d.scale),y:0,z:0},d.Ojo={x:3*d.w_2,y:0,z:0},d.evaluator.setVariable(d.ojoXStr,d.Ojo.x),d.evaluator.setVariable(d.ojoYStr,d.Ojo.y),d.evaluator.setVariable(d.ojoZStr,d.Ojo.z));u=d.x!==b.eval(d.xExpr)+d.displaceRegionWest;y=d.y!==b.eval(d.yExpr)+g.plecaHeight+d.displaceRegionNorth;d.spaceChange=a||u||
y||d.drawBefore!==d.drawIfValue||d.Ox!==b.getVariable(d.OxStr)||d.Oy!==b.getVariable(d.OyStr)||d.Ojo.x!==b.getVariable(d.ojoXStr)||d.Ojo.y!==b.getVariable(d.ojoYStr)||d.Ojo.z!==b.getVariable(d.ojoZStr)||d.scale!==b.getVariable(d.scaleStr);d.x=u?b.eval(d.xExpr)+d.displaceRegionWest:d.x;d.y=y?b.eval(d.yExpr)+g.plecaHeight+d.displaceRegionNorth:d.y;d.Ojo.x=b.getVariable(d.ojoXStr);d.Ojo.y=b.getVariable(d.ojoYStr);d.Ojo.z=b.getVariable(d.ojoZStr);d.Ox=b.getVariable(d.OxStr);d.Oy=b.getVariable(d.OyStr);
d.scale=b.getVariable(d.scaleStr);d.drawBefore=d.drawIfValue;if(a||void 0==d.observer){a=0;for(var e=d.parent.controls.length;a<e;a++)d.parent.controls[a].id===d.obsStr&&(N=!0);d.observer=N?b.getVariable(d.obsStr)||2.5*d.w_plus_h:2.5*d.w_plus_h;d.observer=c(d.observer,.25*d.w_plus_h);b.setVariable(d.obsStr,d.observer)}1E-6>d.scale?(d.scale=1E-6,b.setVariable(d.scaleStr,1E-6)):1E6<d.scale&&(d.scale=1E6,b.setVariable(d.scaleStr,1E6));if(u||y)d.container.style.left=d.x+"px",d.container.style.top=d.y+
"px";d.container.style.display="block";d.dim=b.getVariable(d.userIDimStr);d.userIntensity=b.getVariable(d.userIIStr);d.light3={x:parseInt(b.getVariable(d.userIxStr)),y:parseInt(b.getVariable(d.userIyStr)),z:parseInt(b.getVariable(d.userIzStr))};d.updateCamera();d.draw()}else d.container.style.display="none"};Q.prototype.updateCamera=function(){this.eye=a.scalarProduct3D(this.Ojo,1/this.scale)};Q.prototype.rotateVertex=function(b){x=a.degToRad(d.evaluator.getVariable(d.rotZStr));w=h(x);z=p(x);k=b.x*
w-b.y*z;e=b.x*z+b.y*w;f=b.z;x=a.degToRad(d.evaluator.getVariable(d.rotYStr));w=h(x);z=p(x);return{x:f*z+k*w,y:e,z:f*w-k*z}};Q.prototype.project=function(a){d=this;this.evaluator.getVariable("URL.oldProj");var b=d.eye.x/(a.x-d.eye.x);return{x:d.getAbsoluteX(b*(d.eye.y-a.y)),y:d.getAbsoluteY(b*(d.eye.z-a.z)),z:d.eye.x-a.x}};Q.prototype.computeColor=function(b,c,d){b.match("rgba")?b=a.RGBAToHexColor(b):b.match("#")&&(b=new a.Color(b.substring(1)));I=a.subtract3D(this.eye,c.average);M=a.norm3D(I);O=a.scalarProduct3D(I,
1/M);this.lights[3]=a.subtract3D(this.light3,c.average);E=a.norm3D(this.lights[3]);for(var e=0,f=this.intensity.length-1;e<f;e++)F[e]=this.intensity[e]*this.dim;F[3]=this.userIntensity*this.userIntensity/E||0;D=d?this.dim/2:this.dim/4;B=0;L=0>c.direction?c.normal:a.scalarProduct3D(c.normal,-1);e=0;for(f=this.lights.length;e<f;e++)d?(B=Math.max(0,a.dotProduct3D(r(this.lights[e],L),O)),B*=B*B):B=Math.max(0,a.dotProduct3D(this.lights[e],L)),D+=F[e]*B;D=Math.min(D,1);A=n(b.r*D);G=n(b.g*D);J=n(b.b*D);
return"rgba("+A+","+G+","+J+","+b.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,b=this.graphics.length;a<b;a++)this.graphics[a].update();this.primitives=[];if(this.split)for(a=0,b=this.graphics.length;a<b;a++){v=this.graphics[a];for(var c=a+1;c<b;c++)q=this.graphics[c],v.splitFace(q),q.splitFace(v);this.primitives=this.primitives.concat(v.primitives||[])}else for(a=
0,b=this.graphics.length;a<b;a++){v=this.graphics[a];if(v.split)for(c=a+1;c<b;c++)q=this.graphics[c],q.split&&v.splitFace(q);this.primitives=this.primitives.concat(v.primitives||[])}}a=0;for(b=this.primitives.length;a<b;a++)this.primitives[a].computeDepth(this);this.primitives=this.primitives.sort(function(a,b){return b.depth-a.depth});if("painter"===this.render)this.drawPainter(this.primitives);else for(a=0,b=this.primitives.length;a<b;a++)this.primitives[a].draw(this.ctx,this);a=0;for(b=this.graphicsCtr.length;a<
b;a++)this.graphicsCtr[a].draw()};Q.prototype.drawPainter=function(a){for(var b=a.length,c=0;c<b;c++)a[c].drawn=!1,a[c].draw(this.ctx,this);for(var d=[],e=[],f=0,g=a.length,h=.001,k,p;;){k=g;for(c=0;c<b;c++)if(!a[c].drawn){p=!0;for(var l=0;l<b;l++)if(l!=c&&!a[l].drawn&&a[c].inFrontOf(d,a[l],h)){p=!1;break}p&&(g--,e[f++]=a[c],a[c].drawn=!0)}if(0==g)break;else if(g==k){if(h*=10,.1<h){for(c=0;c<b;c++)a[c].drawn||(e[f++]=a[c],a[c].drawn=!0);break}}else h=.001}for(c=0;c<b;c++)e[c].draw(this.ctx,this)};
Q.prototype.rayFromEye=function(a,b){return{x:-this.eye.x,y:(a-(this.w_2+this.Ox))/this.scale-this.eye.y,z:(this.h_2+this.Oy-b)/this.scale-this.eye.z}};Q.prototype.addEvents=function(){function b(a){window.focus();document.activeElement.blur();g.click=0;g.evaluator.setVariable(g.id+".mouse_pressed",0);window.removeEventListener("touchmove",f,!1);window.removeEventListener("touchend",b,!1);a.preventDefault();g.parent.update()}function c(b){document.body.focus();g.click=0;g.evaluator.setVariable(g.id+
".mouse_pressed",0);b.preventDefault();"R"===g.whichBtn&&(window.removeEventListener("mousemove",e,!1),g.posZoom==g.posZoomNew&&a.showConfig&&g.parent.externalSpace.show());window.removeEventListener("mousemove",f,!1);window.removeEventListener("mouseup",c,!1);g.parent.update()}function d(b){g.posAnte=a.getCursorPosition(b,g.container);g.mouse_x=g.getRelativeX(g.posAnte.x);g.mouse_y=g.getRelativeY(g.posAnte.y);g.evaluator.setVariable(g.id+".mouse_x",g.mouse_x);g.evaluator.setVariable(g.id+".mouse_y",
g.mouse_y);g.parent.update()}function e(b){b.preventDefault();g.posZoomNew=a.getCursorPosition(b,g.container).y;g.evaluator.setVariable(g.scaleStr,g.tempScale+g.tempScale/45*((g.posZoom-g.posZoomNew)/10));g.posObserverNew=a.getCursorPosition(b,g.container).x;g.evaluator.setVariable(g.obsStr,g.tempObserver-2.5*(g.posObserver-g.posObserverNew));g.parent.update()}function f(b){if(!g.fixed&&g.click){m=(g.getAbsoluteX(g.oldMouse.x)-g.getAbsoluteX(g.mouse_x))/4;l=(-g.getAbsoluteY(g.oldMouse.y)+g.getAbsoluteY(g.mouse_y))/
4;if(m!==g.disp.x||l!==g.disp.y)g.alpha=a.degToRad(g.evaluator.getVariable(g.rotZStr)),g.beta=a.degToRad(-g.evaluator.getVariable(g.rotYStr)),g.alpha=a.radToDeg(g.alpha)-m,g.beta=a.radToDeg(g.beta)-l,g.evaluator.setVariable(g.rotZStr,g.alpha),g.evaluator.setVariable(g.rotYStr,-g.beta),g.disp.x=m,g.disp.y=l,g.oldMouse.x=g.getRelativeX(g.posAnte.x),g.oldMouse.y=g.getRelativeY(g.posAnte.y);d(b);b.preventDefault()}}var g=this;this.canvas.oncontextmenu=function(){return!1};this.canvas.addEventListener("touchstart",
function(c){window.focus();document.activeElement.blur();g.click=1;g.evaluator.setVariable(g.id+".mouse_pressed",1);g.parent.deactivateGraphicControls();g.posAnte=a.getCursorPosition(c,g.container);g.oldMouse.x=g.getRelativeX(g.posAnte.x);g.oldMouse.y=g.getRelativeY(g.posAnte.y);d(c);window.addEventListener("touchmove",f);window.addEventListener("touchend",b);c.preventDefault()});this.canvas.addEventListener("mousedown",function(b){document.body.focus();g.click=1;g.parent.deactivateGraphicControls();
g.whichBtn=a.whichBtn(b);"R"===g.whichBtn?(window.addEventListener("mouseup",c),g.posObserver=a.getCursorPosition(b,g.container).x,g.posObserverNew=g.posObserver,g.posZoom=a.getCursorPosition(b,g.container).y,g.posZoomNew=g.posZoom,g.fixed||(g.tempScale=g.scale,g.tempObserver=g.observer,window.addEventListener("mousemove",e))):"L"==g.whichBtn&&(g.evaluator.setVariable(g.id+".mouse_pressed",1),g.posAnte=a.getCursorPosition(b,g.container),g.oldMouse.x=g.getRelativeX(g.posAnte.x),g.oldMouse.y=g.getRelativeY(g.posAnte.y),
d(b),window.addEventListener("mousemove",f),window.addEventListener("mouseup",c));b.preventDefault()});this.disp={x:0,y:0};document.addEventListener("visibilitychange",function(a){c(a)});document.addEventListener("mouseleave",function(a){c(a)})};a.Space3D=Q;return a}(descartesJS||{});
descartesJS=function(a){if(a.loadLib)return a;var k,e,f,r,n,c,h=function(c,b){var g=a.Space.call(this,c,b)||this;k=g.parent.evaluator;void 0!=g._w_&&(c=k.parser.parse(g._w_),g._w_="number"!=c.type?c:void 0);void 0!=g._h_&&(c=k.parser.parse(g._h_),g._h_="number"!=c.type?c: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=k.parser.parse(g.file.substring(1,g.file.length-1)):g.file.match(/^'/)&&g.file.match(/'$/)?
g.file=k.parser.parse(g.file):g.file=k.parser.parse("'"+g.file+"'");g.oldFile=k.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(b){var c=this;g.evaluator.setFunction(g.id+".set",function(a,b){c.contentWindow.postMessage({type:"set",name:a,value:b},"*");return 0});g.evaluator.setFunction(g.id+".update",function(){c.contentWindow.postMessage({type:"update"},"*");return 0});
g.evaluator.setFunction(g.id+".exec",function(a,b){c.contentWindow.postMessage({type:"exec",name:a,value:b},"*");return 0});g.evaluator.setFunction(g.id+".changeConf",function(b){if(b){if(a.cacheFiles[b])var d=a.cacheFiles[b];else d=(d=document.getElementById(b))&&"descartes/embed"===d.type?d.textContent:a.openExternalFile(b),d=(d=(new DOMParser).parseFromString(d,"text/html").querySelector("ajs"))?d.innerHTML:"",a.cacheFiles[b]=d;c.contentWindow.postMessage({type:"change_config",filename:b,content:d},
"*")}return 0});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(){n=this;n.initSpace();n.MyIFrame&&Object.assign(n.MyIFrame.style,{width:n.w+"px",
height:n.h+"px"})};h.prototype.iframeUpdate=function(a){k=this.evaluator;this.drawIfValue=0<k.eval(this.drawif);this.ImReady?this.container.style.display=this.drawIfValue?"block":"none":(this.container.style.visibility=this.drawIfValue?"visible":"hidden",this.container.style.opacity=this.drawIfValue?"1":"0",this.container.style.zIndex=this.drawIfValue?this.zIndex:-1E3);if(this.drawIfValue){a&&(this.x=this.y=Infinity);e=this.x!==k.eval(this.xExpr)+this.displaceRegionWest;f=this.y!==k.eval(this.yExpr)+
this.parent.plecaHeight+this.displaceRegionNorth;this.x=e?k.eval(this.xExpr)+this.displaceRegionWest:this.x;this.y=f?k.eval(this.yExpr)+this.parent.plecaHeight+this.displaceRegionNorth:this.y;void 0!=this._w_&&(a=k.eval(this._w_),this.w!==a&&(this.container.style.width=this.MyIFrame.style.width=a+"px",this.w=a));void 0!=this._h_&&(a=k.eval(this._h_),this.h!==a&&(this.container.style.height=this.MyIFrame.style.height=a+"px",this.h=a));if(e||f)this.container.style.left=this.x+"px",this.container.style.top=
this.y+"px";r=k.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));c=k.getVariable(this.id+
"._scroll");1==c?(this.MyIFrame.setAttribute("scrolling","yes"),this.MyIFrame.style.overflow=""):-1==c?(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 k=1,e=function(e){this.children=e.children;this.lessonParser=e.lessonParser;this.images=e.images;this.images.length=e.images.length;this.audios=e.audios;this.audios.length=e.audios.length;this.descartesApp=e;this.imgLoader=a.newHTML("div",{class:"DescartesLoaderImage"});this.progress=a.newHTML("progress",{class:"PBL",value:0,max:100});e.imgLoader?(e.loader.style.backgroundColor="rgba(0,0,0,0)",this.imgLoader.setAttribute("style","background-image:url("+
e.imgLoader+");background-size:contain;")):(k=e.width<e.height?e.width/1144:e.height/1092,k=2.5<k?2.5:k,this.imgLoader.setAttribute("style","background-image:url("+a.loaderImg.src+");background-position:50% 33.5%;background-size:"+880*k+"px;"),this.progress.setAttribute("style","visibility:visible; left:"+(e.width-726*k)/2+"px; top:"+(33.5*e.height/100+940*k/2)+"px; width:"+726*k+"px; height:"+14*k+"px;"));e.loader.appendChild(this.imgLoader);e.loader.appendChild(this.progress);e.firstRun=!1;this.initPreloader()};
e.prototype.initPreloader=function(){var e=this,k=e.children,n=e.images,c=e.audios,h=/[\w\.\-//]*(\.png|\.jpg|\.gif|\.svg)/gi,p=/[\w\.\-//]*(\.ogg|\.oga|\.mp3|\.wav)/gi;n["lib/DescartesCCLicense.png"]=a.getCCLImg();n["lib/DescartesCCLicense.png"].ready=1;var b,g;var d=0;for(b=k.length;d<b;d++)if("rtf"!==k[d].name){if(k[d].value.match(/'macro'|'makro'/g)){var v="";var q=e.lessonParser.split(k[d].value);var u=0;for(g=q.length;u<g;u++)"expresion"===babel[q[u][0]]&&(v=q[u][1]);if(v)var y=(y=document.getElementById(v))&&
"descartes/macro"==y.type?y.text:a.openExternalFile(v);if(y&&(q=y.match(h)))for(v=0,g=q.length;v<g;v++)u=q[v],u.toLowerCase().match(/vacio.gif$/)||""==u.substring(0,u.length-4)||(n[u]=new Image,n[u].addEventListener("load",function(){this.ready=1}),n[u].addEventListener("error",function(){this.errorload=1}),n[u].src=u)}if(q=k[d].value.match(h))for(v=0,g=q.length;v<g;v++)u=q[v],u.toLowerCase().match(/vacio.gif$/)||""==u.substring(0,u.length-4)||(n[u]=new Image,n[u].addEventListener("load",function(){this.ready=
1}),n[u].addEventListener("error",function(){this.errorload=1}),n[u].src=u);if(q=k[d].value.match(p))for(v=0,u=q.length;v<u;v++)e.initAudio(q[v])}for(var m in n)n.hasOwnProperty(m)&&e.images.length++;for(m in c)c.hasOwnProperty(m)&&e.audios.length++;var l=e.images.length+e.audios.length;0<l&&e.progress.setAttribute("max",l);var x,w=function(){x=0;for(var b in n)n.hasOwnProperty(b)&&(n[b].ready||n[b].errorload)&&x++;for(b in c)c.hasOwnProperty(b)&&(c[b].ready||c[b].errorload)&&x++;e.progress.setAttribute("value",
x);x!=l?e.timer=a.setTimeout(w,1):e.descartesApp.initBuildApp()};w()};e.prototype.initAudio=function(e){var f=this.audios;f[e]=new Audio(e);f[e].filename=e;var k=function(){this.ready=1},c=function(){this.canPlayType("audio/"+this.filename.substring(this.filename.length-3))||"mp3"!=this.filename.substring(this.filename.length-3)?(console.warn("El archivo '"+e+"' no puede ser reproducido"),this.errorload=1):(f[e]=new Audio(this.filename.replace("mp3","ogg")),f[e].filename=this.filename.replace("mp3",
"ogg"),f[e].addEventListener("canplaythrough",k),f[e].addEventListener("load",k),f[e].addEventListener("error",c),f[e].load())};f[e].addEventListener("canplaythrough",k);f[e].addEventListener("load",k);f[e].addEventListener("error",c);a.hasTouchSupport?(f[e].load(),f[e].play(),a.setTimeout(function(){f[e].pause()},20),f[e].ready=1):f[e].load()};a.DescartesLoader=e;return a}(descartesJS||{});
descartesJS=function(a){function k(a){for(var b="[",c=0,d=a.length;c<d;c++)Array.isArray(a[c])?b+=k(a[c]):(f=a[c]||0,"string"==typeof f&&(f="'"+f+"'"),b+=f),c<d-1&&(b+=",");return b+"]"}function e(){r=window.innerWidth/this.width;n=window.innerHeight/this.height;a.cssScale=c=Math.min(r,n);this.container.style.transformOrigin="0 0";r<n?(this.container.style.left="0",this.container.style.transform="translate3d(0px, 0px, 0px) scale("+c+")"):(this.container.style.left="50%",this.container.style.transform=
"translate3d(0px, 0px, 0px) scale("+c+") translate(-50%, 0)")}if(a.loadLib)return a;var f,r,n,c,h=function(c){this.animation={playing:!1,play:function(){},stop:function(){},reinit:function(){}};this.ratio=a._ratio;this.applet=c;this.parentC=c.parentNode;this.width=parseFloat(c.getAttribute("width"));this.height=parseFloat(c.getAttribute("height"));this.decimal_symbol=".";this.decimal_symbol_regexp=/\./g;this.language="espa\u00f1ol";this.children=c.getElementsByTagName("param");a.ccLicense=!0;for(var b=
0,e=this.children.length;b<e;b++)"CreativeCommonsLicense"===this.children[b].name&&(a.ccLicense="no"!==this.children[b].value);this.code=c.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 c=this.children,b,g=0,d=0,f=a.ccLicense?90:0,h=0,k=c.length;h<k;h++)b=c[h],"rtf_height"==b.name&&(g=parseInt(b.value)+120||this.height),"Buttons"==babel[b.name]&&(this.buttonsConfig=this.lessonParser.parseButtonsConfig(b.value),d=this.buttonsConfig.height),"image_loader"==b.name&&(this.imgLoader=b.value),"expand"==b.name&&(this.expand=b.value),"docBase"==b.name&&(this.docBase=b.value,b=a.newHTML("base",{id:"descartesJS_base",href:this.docBase}),document.head.appendChild(b));"cover"==this.expand&&
(this.width=window.innerWidth,this.height=window.innerHeight);this.arquimedes&&(this.ratio=1,g&&(this.height=g+d+f));this.externalSpace&&document.body.removeChild(this.externalSpace.container);this.externalSpace=new a.SpaceExternal(this);this.northSpace={container:a.newHTML("div"),controls:[]};this.southSpace={container:a.newHTML("div"),controls:[]};this.eastSpace={container:a.newHTML("div"),controls:[]};this.westSpace={container:a.newHTML("div"),controls:[]};this.editableRegion={container:a.newHTML("div"),
textFields:[]};this.controls=[];this.auxiliaries=[];this.events=[];this.nIframes=this.plecaHeight=this.tabindex=this.zIndex=0;void 0!=this.container&&(this.cleanCanvasImages(),this.parentC.removeChild(this.container),delete this.container,delete this.loader);this.container=a.newHTML("div");this.loader=a.newHTML("div",{class:"DescartesLoader"});this.parentC.insertBefore(this.container,this.parentC.firstChild);this.container.width=this.loader.width=this.width;this.container.height=this.loader.height=
this.height;this.container.className="DescartesAppContainer";this.container.setAttribute("style","width:"+this.width+"px;height:"+this.height+"px;");this.container.appendChild(this.loader);"fit"==this.expand&&(this.container.parentNode.removeAttribute("align"),this.container.parentNode.style.overflow="hidden",this.container.parentNode.style.width="100vw",this.container.parentNode.style.height="100vh",this.scaleToFit=e,this.scaleToFit());this.spaces=[];this.firstRun?(this.loader.style.display="block",
new a.DescartesLoader(this)):this.initBuildApp()};h.prototype.initBuildApp=function(){a.showConfig=!0;for(var c=this.children,b,e=this.lessonParser,d=[],f=[],h=[],k=[],n=[],m=[],l=0,r=c.length;l<r;l++)if(b=c[l],"editable"==babel[b.name])a.showConfig="false"==babel[b.value]?!1:!0;else if("language"==babel[b.name])this.language=b.value;else if("pleca"==b.name)b=e.parsePleca(b.value,this.width),this.container.insertBefore(b,this.loader),this.plecaHeight=b.imageHeight?b.imageHeight:b.offsetHeight;else if("Buttons"==
babel[b.name])this.buttonsConfig=e.parseButtonsConfig(b.value);else if("decimal_symbol"==babel[b.name])this.decimal_symbol=b.value,this.decimal_symbol_regexp=new RegExp("\\"+this.decimal_symbol,"g");else if("version"==babel[b.name])this.version=parseInt(b.value);else if("language"==babel[b.name])this.language=b.value;else if("rtf"==b.name){var w=(this.width-780)/2,z=parseInt(this.height)-this.plecaHeight-this.buttonsConfig.height-45;k.push("space='descartesJS_stage' type='text' abs_coord='yes' expresion='[10,20]' background='yes' text='"+
b.value.replace(/'/g,"&squot;")+"'");k.push("space='descartesJS_stage' type='text' abs_coord='yes' expresion='["+w+","+(z-25)+"]' background='yes' text='"+this.licenseA+"'");a.ccLicense&&k.push("space='descartesJS_stage' type='image' expresion='["+(w+15)+","+z+"]' background='yes' abs_coord='yes' file='lib/DescartesCCLicense.png'")}else"E"==b.name.charAt(0)?(b.value.match(/'HTMLIFrame'/)&&this.nIframes++,d.push(b.value)):/^C_/.test(b.name)?f.push(b.value):/^A_/.test(b.name)?h.push(b.value):/^G_/.test(b.name)?
(b.value.match(/type='fill'|tipo='relleno'|tipus='ple'|mota='betea'|type='plein'|tipo='recheo'|tipo='curva_piena'|tipo='preencher'|tipus='ple'/)&&(this.ratio=1),k.push(b.value)):/^S_/.test(b.name)?n.push(b.value):"Animation"==babel[b.name]&&m.push(b.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));l=0;for(r=d.length;l<r;l++)c=e.parseSpace(d[l]),this.arquimedes&&this.stage.container.appendChild(c.container),this.spaces.push(c),this.zIndex++;l=0;for(r=k.length;l<r;l++)if(a.DEBUG.elemIndex=l,d=e.parseGraphic(k[l]))this.editableRegionVisible=this.editableRegionVisible||d.visible,d.space.addGraph(d);l=0;
for(r=n.length;l<r;l++)(d=e.parse3DGraphic(n[l]))&&d.space.addGraph(d,!0);l=0;for(r=f.length;l<r;l++)this.controls.push(e.parseControl(f[l]));l=0;for(r=h.length;l<r;l++)e.parseAuxiliar(h[l]);l=0;for(r=m.length;l<r;l++)this.animation=e.parseAnimation(m[l]);this.configRegions();this.updateAuxiliaries();this.updateAuxiliaries();l=0;for(r=this.controls.length;l<r;l++)this.controls[l].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 c=new CustomEvent("descartesReady",{detail:this});window.dispatchEvent(c)}catch(b){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 c=parseInt(this.width)+
30,b=parseInt(this.height)+90;window.moveTo((parseInt(screen.width)-c)/2,(parseInt(screen.height)-b)/2);window.resizeTo(c,b);a.onResize()};h.prototype.configRegions=function(){var c=this.evaluator.parser,b=this.buttonsConfig||{},e=this.container,d="15",f=100,h=100,k=100,n=100;2==this.version&&(d="14",f=63,h=50,k=44,n=53);var m=0,l=0,r=0,w=0,z=0,A=this.northSpace.controls,G=this.southSpace.controls,J=this.eastSpace.controls,E=this.westSpace.controls;if(0<b.rowsNorth||0<A.length||b.about||b.config){0>=
b.rowsNorth?(m=b.height,b.rowsNorth=1):m=b.height*b.rowsNorth;var F=this.northSpace.container;F.id="descartesJS_north";F.setAttribute("style","width:"+e.width+"px;height:"+m+"px;left:0;top:"+this.plecaHeight+"px;");e.insertBefore(F,this.loader);F=e.width;var D=0;b.about?(D=f,F-=D):f=0;b.config&&(F-=h);var B=Math.ceil(A.length/b.rowsNorth),L=F/B;var I=0;for(var M=A.length;I<M;I++)A[I].expresion=c.parse("("+(D+I%B*L)+","+b.height*Math.floor(I/B)+","+L+","+b.height+")"),A[I].drawif=c.parse("1"),A[I].init();
b.about&&(I=new a.Button(this,{region:"north",name:"english"==this.language?"about":"cr\u00e9ditos",font_size:c.parse(d),expresion:c.parse("(0, 0, "+f+", "+m+")")}),I.actionExec={execute:a.showAbout},I.update());b.config&&(new a.Button(this,{region:"north",name:"config",font_size:c.parse(d),action:"config",expresion:c.parse("("+(F+f)+", 0, "+h+", "+m+")")})).update()}if(0<b.rowsSouth||0<G.length||b.init||b.clear){0>=b.rowsSouth?(l=b.height,b.rowsSouth=1):l=b.height*b.rowsSouth;f=e.width;D=0;b.init?
(D=k,f-=D):k=0;b.clear&&(f-=n);F=this.southSpace.container;F.id="descartesJS_south";F.setAttribute("style","width:"+e.width+"px;height:"+l+"px;left:0;bottom:0;");e.insertBefore(F,this.loader);B=Math.ceil(G.length/b.rowsSouth);L=f/B;I=0;for(M=G.length;I<M;I++)G[I].expresion=c.parse("("+(D+I%B*L)+","+b.height*Math.floor(I/B)+","+L+","+b.height+")"),G[I].drawif=c.parse("1"),G[I].init();b.init&&(new a.Button(this,{region:"south",name:"english"==this.language?"init":"inicio",font_size:c.parse(d),action:"init",
expresion:c.parse("(0, 0, "+k+", "+l+")")})).update();b.clear&&(new a.Button(this,{region:"south",name:"english"==this.language?"clear":"limpiar",font_size:c.parse(d),action:"clear",expresion:c.parse("("+(f+k)+", 0, "+n+", "+l+")")})).update()}if(0<J.length)for(I=e.height-m-l,w=b.widthEast,F=this.eastSpace.container,F.id="descartesJS_east",F.setAttribute("style","width:"+w+"px;height:"+I+"px;right:0;top:"+m+"px;"),e.insertBefore(F,this.loader),I=0,M=J.length;I<M;I++)J[I].expresion=c.parse("(0,"+b.height*
I+","+w+","+b.height+")"),J[I].drawif=c.parse("1"),J[I].init();if(0<E.length)for(I=e.height-m-l,z=b.widthWest,F=this.westSpace.container,F.id="descartesJS_west",F.setAttribute("style","width: "+z+"px;height:"+I+"px;left:0;top:"+m+"px;"),e.insertBefore(F,this.loader),I=0,M=E.length;I<M;I++)E[I].expresion=c.parse("(0,"+b.height*I+","+z+","+b.height+")"),E[I].drawif=c.parse("1"),E[I].init();if(this.editableRegionVisible)for(r=b.height,F=this.editableRegion.container,F.id="descartesJS_editableRegion",
F.setAttribute("style","position:absolute;width:"+e.width+"px;height:"+r+"px;left:0;top:"+(e.height-l-b.height)+"px;"),e.insertBefore(F,this.loader),c=this.editableRegion.textFields,e=e.width/c.length,b=a.getFieldFontSize(r),I=0,M=c.length;I<M;I++)"div"==c[I].type?(F.appendChild(c[I].container),c[I].container.setAttribute("style","font-family:"+a.sansserif_font+";width:"+(e-4)+"px;height:"+r+"px;position:absolute;left:"+I*e+"px;top:0;"),E=c[I].container.firstChild,E.setAttribute("style","font-family:"+
a.sansserif_font+";font-size:"+b+"px;padding-top:0;background-color:#e0e4e8;position:absolute;left:0;top:0;height:"+r+"px;text-align:center;line-height:"+r+"px;"),J=E.offsetWidth,E.style.width=J+"px",E.firstChild.textContent=E.firstChild.textContent.substring(3,E.firstChild.textContent.length-3),c[I].container.lastChild.setAttribute("style","font-family:"+a.monospace_font+";font-size:"+b+"px;width:"+(e-J)+"px;height:"+r+"px;position:absolute;left:"+J+"px;top:0;border:2px groove white;")):(F.appendChild(c[I]),
c[I].setAttribute("style","font-family:"+a.monospace_font+";font-size:"+b+"px;width:"+e+"px;height:"+r+"px;position:absolute;left:"+I*e+"px;top:0;border:2px groove white;"));this.displaceRegionNorth=m;this.displaceRegionSouth=l+(r||0);this.displaceRegionEast=w;this.displaceRegionWest=z;I=0;for(M=this.spaces.length;I<M;I++)this.spaces[I].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 c=0,b=this.controls.length;c<b;c++)this.controls[c].buttonClick=!1};h.prototype.deactivateGraphicControls=function(){for(var a,b=0,c=this.controls.length;b<c;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,c=this.spaces.length;b<c;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(c){var b=this.audios;if(c){if(!b[c]){c.lastIndexOf(".");b[c]=new Audio(c);var e=function(a){this.ready=1};b[c].addEventListener("canplaythrough",e);var d=function(a){this.canPlayType("audio/"+c.substring(c.length-3))||"mp3"!=c.substring(c.length-3)?(console.warn("El archivo '"+c+"' no puede ser reproducido"),this.errorload=1):(b[c]=new Audio(c.replace("mp3","ogg")),b[c].addEventListener("canplaythrough",e),b[c].addEventListener("load",
e),b[c].addEventListener("error",d),b[c].load())};b[c].addEventListener("error",d);b[c].play();a.setTimeout(function(){b[c].pause()},15)}return b[c]}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 c,d=0,e=this.controls.length;d<e;d++)if(c=this.controls[d],c[b]==a)return c;return{update:function(){},w:0,h:0}};h.prototype.getSpaceByCId=function(a){return this.getSpaceById(a,!0)};h.prototype.getSpaceById=
function(a,b){b=b?"cID":"id";for(var c,d=0,e=this.spaces.length;d<e;d++)if(c=this.spaces[d],c[b]==a)return c;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 c=0,d=a.length;c<d;c++)b=a[c].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,
c;for(c in b)if(b.hasOwnProperty(c)){var d=b[c];"string"==typeof d&&(d="'"+d+"'");void 0!=d&&"rnd"!=c&&"\u03c0"!=c&&"pi"!=c&&"e"!=c&&"Infinity"!=c&&"-Infinity"!=c&&"object"!=typeof d&&(a=""!=a?a+"\n"+c+"="+d:c+"="+d)}d=this.evaluator.vectors;for(var e in d)d.hasOwnProperty(e)&&(a+="\n"+e+"="+k(d[e]));e=this.evaluator.matrices;for(var f in e)e.hasOwnProperty(f)&&(a+="\n"+f+"="+k(e[f]));return a};h.prototype.setState=function(a,b){a=a.split("\n");for(var c,d,e=0,f=a.length;e<f;e++)c=a[e].split("="),
2<=c.length&&(d=eval(c[1]),-1!=c[1].indexOf("[[")?(this.evaluator.matrices[c[0]]=d,this.evaluator.matrices[c[0]].rows=d.length,this.evaluator.matrices[c[0]].cols=d[0].length):-1!=c[1].indexOf("[")?(this.evaluator.vectors[c[0]]=d,this.evaluator.variables[c[0]+".long"]=d.length):this.evaluator.variables[c[0]]=d);b||this.update()};h.prototype.getEvaluation=function(){for(var a=correct=0,b="",c=0,d=this.controls.length;c<d;c++)"textfield"==this.controls[c].gui&&this.controls[c].evaluate&&(a++,correct+=
this.controls[c].ok,this.controls[c].value=""==this.controls[c].value?"''":this.controls[c].value,b+=" \\n "+this.controls[c].id+"="+this.controls[c].value+"|"+this.controls[c].ok);return"questions="+a+" \\n correct="+correct+" \\n wrong="+(a-correct)+b};h.prototype.showSolution=function(){for(var a=this.controls,b=0,c=a.length;b<c;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(k,e){k="Error: "+k+" en\u300a "+e+" \u300b";var f="";switch(a.DEBUG.objectName){case "Auxiliar":e="event"===a.DEBUG.typeName||"algorithm"===a.DEBUG.typeName||
"constant"===a.DEBUG.typeName?"En el programa ":"En la definici\u00f3n ";if("doExpr"==babel[a.DEBUG.paramName]||"init"==babel[a.DEBUG.paramName])f=" en la l\u00ednea "+(a.DEBUG.lineCount+1);k+=e+"\u300c"+a.DEBUG.idName+"\u300d, en el param\u00e9tro \u300c"+a.DEBUG.paramName+"\u300d"+f+".";break;case "Graphic":k+="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(k)}};return a}(descartesJS||{});
descartesJS=function(a){function k(){e().forEach(function(c){a.apps.push(new a.DescartesApp(c));c.className="DescartesJS"})}function e(){return[].concat($jscomp.arrayFromIterable(document.querySelectorAll("applet,ajs"))).filter(function(a){return/Descartes|DescartesJS|descinst.DescartesWeb2_0.class|Arquimedes|Discurso/i.test(a.getAttribute("code"))})}function f(){document.querySelectorAll(".DescartesAppContainer").forEach(function(a){a.remove()})}function r(c){c=a.newHTML("div");var e='<div style="font-size:12px;visibility:hidden;">';
"descartesJS_serif descartesJS_sansserif descartesJS_monospace DJS_symbol DJS_sansserif DJS_serif DJS_monospace DJS_math".split(" ").forEach(function(a){e+='<div style="font-family:'+a+';"><span>_</span><span style="font-weight:bold;">_</span><span style="font-style:italic;">_</span><span style="font-weight:bold;font-style:italic;">_</span></div>'});c.innerHTML=e+"</div>";document.body.appendChild(c);a.getFeatures();a.hasCanvas?(window.scrollTo(0,10),f(),k(),window.addEventListener("resize",a.onResize),
window.scrollTo(0,0)):document.getElementById("StyleDescartesApps").innerHTML="applet.DescartesJS,applet,ajs.DescartesJS,ajs{display:block;}";c.remove()}if(a.loadLib)return a;a.apps=[];a.getDescartesApps=function(){return a.apps};(function(){var c=document.getElementById("StyleDescartesApps");c&&c.remove();c=a.newHTML("style",{id:"StyleDescartesApps",type:"text/css",rel:"stylesheet"});c.innerHTML="applet.DescartesJS,applet,ajs.DescartesJS,ajs{display:none;}";document.head.appendChild(c)})();a.onResize=
function(c){0<a.apps.length&&a.apps[0].scaleToFit()};var n=Object.create(null);a.onMessage=function(c){if(0<a.apps.length){var e=c.data;if(e)if("set"===e.type)"string"==typeof e.value||"number"==typeof e.value?a.apps[0].evaluator.setVariable(e.name,e.value):e.value&&void 0!=e.value.rows?a.apps[0].evaluator.matrices[e.name]=e.value:a.apps[0].evaluator.vectors[e.name]=e.value;else if("update"===e.type)a.apps[0].update();else if("exec"===e.type)(c=a.apps[0].evaluator.getFunction(e.name))&&c.apply(a.apps[0].evaluator,
e.value.toString().split(","));else if("isResizeNeeded"===e.type)c.source.postMessage({type:"doResize"},"*");else if("doResize"===e.type)0<a.apps.length&&a.apps[0].adjustSize();else if("change_config"===e.type){n[e.filename]?c=n[e.filename]:(c=a.newHTML("div"),c.innerHTML=e.content,c=c.getElementsByTagName("param"),n[e.filename]=c);var f=document.querySelector("base");f||(f=a.newHTML("base"),document.body.appendChild(f));f.setAttribute("href",e.filename);a.apps[0].children=c;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(c){window.addEventListener(c,function(c){a.onResize(c)})}),document.fonts.ready.then(function(){setTimeout(function(){a.apps.forEach(function(a){a.updateControls();a.updateSpaces(!0)})},500)}));return a}(descartesJS||{});
