MediaWiki:Common.js

From LifeWiki
Revision as of 12:37, 20 June 2017 by Nathaniel (Talk | contribs)

Jump to: navigation, search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Clear the cache in Tools → Preferences
/* Test if an element has a certain class
 */
 
var hasClass = (function () {
    var reCache = {};
    return function (element, className) {
        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
    };
})();

/** Collapsible tables *********************************************************
 *
 *  Description: Allows tables to be collapsed, showing only the header.
 */
 
var autoCollapse = 2;
var collapseCaption = "hide";
var expandCaption = "show";
 
function collapseTable( tableIndex )
{
    var Button = document.getElementById( "collapseButton" + tableIndex );
    var Table = document.getElementById( "collapsibleTable" + tableIndex );
 
    if ( !Table || !Button ) {
        return false;
    }
 
    var Rows = Table.rows;
 
    if ( Button.firstChild.data == collapseCaption ) {
        for ( var i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = "none";
        }
        Button.firstChild.data = expandCaption;
    } else {
        for ( var i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
    }
}
 
function createCollapseButtons()
{
    var tableIndex = 0;
    var NavigationBoxes = new Object();
    var Tables = document.getElementsByTagName( "table" );
 
    for ( var i = 0; i < Tables.length; i++ ) {
        if ( hasClass( Tables[i], "collapsible" ) ) {

            /* only add button and increment count if there is a header row to work with */
            var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
            if (!HeaderRow) continue;
            var Header = HeaderRow.getElementsByTagName( "th" )[0];
            if (!Header) continue;
 
            NavigationBoxes[ tableIndex ] = Tables[i];
            Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );
 
            var Button     = document.createElement( "span" );
            var ButtonLink = document.createElement( "a" );
            var ButtonText = document.createTextNode( collapseCaption );
 
            Button.className = "collapseButton";  //Styles are declared in Common.css
 
            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
            ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
            ButtonLink.appendChild( ButtonText );
 
            Button.appendChild( document.createTextNode( "[" ) );
            Button.appendChild( ButtonLink );
            Button.appendChild( document.createTextNode( "]" ) );
 
            Header.insertBefore( Button, Header.childNodes[0] );
            tableIndex++;
        }
    }
 
    for ( var i = 0;  i < tableIndex; i++ ) {
        if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
            collapseTable( i );
        } 
        else if ( hasClass( NavigationBoxes[i], "innercollapse" ) ) {
            var element = NavigationBoxes[i];
            while (element = element.parentNode) {
                if ( hasClass( element, "outercollapse" ) ) {
                    collapseTable ( i );
                    break;
                }
            }
        }
    }
}
 
addOnloadHook( createCollapseButtons );


// LifeViewer plugin (Build 231)

(function(){var r;window.performance||(window.performance={});window.performance.now||(window.performance.now=function(){return performance.now||performance.rr||performance.sr||performance.tr||performance.webkitNow||function(){return(new Date).getTime()}}());window.requestAnimationFrame||(window.requestAnimationFrame=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame);window.cancelRequestAnimationFrame||(window.cancelRequestAnimationFrame=
window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame);window.Uint8Array?window.typedArrays=!0:(window.typedArrays=!1,window.Uint8Array=Array);window.Uint8ClampedArray||(window.Uint8ClampedArray=window.Uint8Array);window.Uint16Array||(window.Uint16Array=Array);window.Uint32Array||(window.Uint32Array=Array);r=new Uint32Array(1);r[0]=4660;52===(new Uint8Array(r.buffer))[0]?window.littleEndian=!0:window.littleEndian=
!1;window.registerEvent=function(A,e,p,q){A.addEventListener?A.addEventListener(e,p,q):A.attachEvent("on"+e,p)}})();(function(){function r(p,q,f){this.type=p;this.name=f;this.elements=q;this.size=q*e.ih(p);this.$h=1}function A(){this.Jc=[];this.ph=this.Hj=this.oh=this.Gj=0}var e={kk:8,lk:40,ik:9,jk:10,hk:0,fk:1,gk:2,dk:18,ek:19,ih:function(p){return 1<<(p&7)},typeName:function(p){var e;e=(p&16?"Float":p&8?"Uint":"Int")+8*(1<<(p&7));p&32&&(e+="Clamped");return e}};A.prototype.Bo=function(p){var q="";0<=p&&p<this.Jc.length&&(p=this.Jc[p],q=e.typeName(p.type)+"\t"+p.elements+"\t"+p.name+"\t"+p.$h);return q};A.prototype.b=
function(p,q,f){for(var c=0,a=!1,n;c<this.Jc.length&&!a;)n=this.Jc[c],f===n.name?(a=!0,this.Hj+=1,this.ph+=n.elements*e.ih(n.type)):c+=1;a?(this.Jc[c].type=p,this.Jc[c].elements=q,this.Jc[c].$h+=1,this.Jc[c].size=q*e.ih(p)):(c=this.Jc.length,this.Jc[c]=new r(p,q,f));this.Gj+=1;this.oh+=q*e.ih(p)};A.prototype.Vl=function(p,q,f,c,a){p=p.buffer;c*=e.ih(q);switch(q){case e.kk:f=new Uint8Array(p,c,f);break;case e.lk:f=new Uint8Array(p,c,f);break;case e.ik:f=new Uint16Array(p,c,f);break;case e.jk:f=new Uint32Array(p,
c,f);break;case e.hk:f=new Int8Array(p,c,f);break;case e.fk:f=new Int16Array(p,c,f);break;case e.gk:f=new Int32Array(p,c,f);break;case e.dk:f=new Float32Array(p,c,f);break;case e.ek:f=new Float64Array(p,c,f);break;default:f=null,console.debug("Illegal type specified to allocator.typedView for "+a+": "+q)}return f};A.prototype.c=function(p,q,f){switch(p){case e.kk:q=new Uint8Array(q);break;case e.lk:q=new Uint8Array(q);break;case e.ik:q=new Uint16Array(q);break;case e.jk:q=new Uint32Array(q);break;
case e.hk:q=new Int8Array(q);break;case e.fk:q=new Int16Array(q);break;case e.gk:q=new Int32Array(q);break;case e.dk:q=new Float32Array(q);break;case e.ek:q=new Float64Array(q);break;default:q=null,console.debug("Illegal type specified to allocator.typedMemory for "+f+": "+p)}return q};A.prototype.ga=function(p,e,f){var c;(c=this.c(p,e,f))&&this.b(p,e,f);return c};Array.T=function(p,e,f,c,a,n){var b=0,k=[],d;k.l=a;k.type=p;k.Ci=null;if(e*f){d=a.ga(p,e*f,n);for(k.Ci=d;b<e;)k[b]=a.Vl(d,p,f,b*f,n),b+=
1;if(0!==c)if(d.fill)d.fill(c);else for(b=0;b<d.length;)d[b]=c,b+=1}return k};Array.dm=function(p,e){var f=p.l.ga(p.type,p[0].length,e);p[p.length]=f};Array.Fd=function(p,e){e.Ci.set(p.Ci)};Array.kf=function(p,q){var f=Uint16,c,a=p.length,n=[],b=p.l,k=p[0].length/e.ih(f);for(c=0;c<a;c+=1)n[c]=b.Vl(p.Ci,f,k,c*k,q);return n};Array.rd=function(p,e,f){var c,a=p.length,n=[],b=p.l,k=p.type,d=p[0].length;for(c=0;c<a;c+=1)n[c]=b.Vl(p.Ci,k,d-e,c*d+e,f);return n};window.Allocator=A;window.Uint8=e.kk;window.Uint8Clamped=
e.lk;window.Uint16=e.ik;window.Uint32=e.jk;window.Int8=e.hk;window.Int16=e.fk;window.Int32=e.gk;window.Float32=e.dk;window.Float64=e.ek})();window.AliasManager={f:[],Rd:function(){this.f=[];this.f.push(["Totalistic",""]);this.f.push(["","B3/S23"]);this.f.push(["Conway's Life","B3/S23"]);this.f.push(["2x2","B36/S125"]);this.f.push(["34 Life","B34/S34"]);this.f.push(["3-4 Life","B34/S34"]);this.f.push(["Amoeba","B357/S1358"]);this.f.push(["AntiLife","B0123478/S01234678"]);this.f.push(["Assimilation","B345/S4567"]);this.f.push(["Bacteria","B34/S456"]);this.f.push(["Blinkers","B345/S2"]);this.f.push(["Bugs","B3567/S15678"]);this.f.push(["Coagulations",
"B378/S235678"]);this.f.push(["Coral","B3/S45678"]);this.f.push(["Corrosion of Conformity","B3/S124"]);this.f.push(["Day & Night","B3678/S34678"]);this.f.push(["Day and Night","B3678/S34678"]);this.f.push(["Diamoeba","B35678/S5678"]);this.f.push(["DotLife","B3/S023"]);this.f.push(["DryLife","B37/S23"]);this.f.push(["EightLife","B3/S238"]);this.f.push(["Electrified Maze","B45/S12345"]);this.f.push(["Flock","B3/S12"]);this.f.push(["Fredkin","B1357/S02468"]);this.f.push(["Gnarl","B1/S1"]);this.f.push(["H-Trees",
"B1/S012345678"]);this.f.push(["HighLife","B36/S23"]);this.f.push(["HoneyLife","B38/S238"]);this.f.push(["Holstein","B35678/S4678"]);this.f.push(["Iceballs","B25678/S5678"]);this.f.push(["InverseLife","B012345678/S34678"]);this.f.push(["Land Rush","B36/S234578"]);this.f.push(["Life without Death","B3/S012345678"]);this.f.push(["Life","B3/S23"]);this.f.push(["Live Free or Die","B2/S0"]);this.f.push(["LongLife","B345/S5"]);this.f.push(["Long Life","B345/S5"]);this.f.push(["LowDeath","B368/S238"]);this.f.push(["LowLife",
"B3/S13"]);this.f.push(["Majority","B45678/S5678"]);this.f.push(["Maze","B3/S12345"]);this.f.push(["Maze with Mice","B37/S12345"]);this.f.push(["Mazectric","B3/S1234"]);this.f.push(["Mazectric with Mice","B37/S1234"]);this.f.push(["Morley","B368/S245"]);this.f.push(["Move","B368/S245"]);this.f.push(["Pedestrian Life","B38/S23"]);this.f.push(["Persian Rug","B234/S"]);this.f.push(["Plow World","B378/S012345678"]);this.f.push(["Pseudo Life","B357/S238"]);this.f.push(["Replicator","B1357/S1357"]);this.f.push(["Seeds",
"B2/S"]);this.f.push(["Serviettes","B234/S"]);this.f.push(["Slow Blob","B367/S125678"]);this.f.push(["SnowLife","B3/S1237"]);this.f.push(["Stains","B3678/S235678"]);this.f.push(["Vote","B5678/S45678"]);this.f.push(["Vote 4/5","B4678/S35678"]);this.f.push(["Walled Cities","B45678/S2345"]);this.f.push(["Isotropic Non-Totalistic",""]);this.f.push(["aLife","B3/S234w"]);this.f.push(["CB2","B2ae4i/S1e2in"]);this.f.push(["DLife","B3-n/S23"]);this.f.push(["GlideLife","B34ek5ak/S2-c34z"]);this.f.push(["Goat Flock",
"B2in3/S123a"]);this.f.push(["Just Friends","B2-a/S12"]);this.f.push(["Kgdm","B3/S2-c3-en4ceitz"]);this.f.push(["Salad","B2i34c/S2-i3"]);this.f.push(["TauLife","B3-nr/S2-i34-aij"]);this.f.push(["tDryLife","B37/S2-i34q"]);this.f.push(["tHighLife","B36/S2-i34q"]);this.f.push(["TLife","B3/S2-i34q"]);this.f.push(["Generations",""]);this.f.push(["Banners","2367/3457/5"]);this.f.push(["BelZhab","23/23/8"]);this.f.push(["BelZhab Sediment","145678/23/8"]);this.f.push(["Bloomerang","234/34678/24"]);this.f.push(["Bombers",
"345/24/25"]);this.f.push(["Brain 6","6/246/3"]);this.f.push(["Brian's Brain","/2/3"]);this.f.push(["Burst","0235678/3468/9"]);this.f.push(["BurstII","235678/3468/9"]);this.f.push(["Caterpillars","124567/378/4"]);this.f.push(["Chenille","05678/24567/6"]);this.f.push(["Circuit Genesis","2345/1234/8"]);this.f.push(["Cooties","23/2/8"]);this.f.push(["Ebb&Flow","012478/36/18"]);this.f.push(["Ebb&Flow II","012468/37/18"]);this.f.push(["Faders","2/2/25"]);this.f.push(["Fireworks","2/13/21"]);this.f.push(["Flaming Starbows",
"347/23/8"]);this.f.push(["Frogs","12/34/3"]);this.f.push(["Frozen spirals","356/23/6"]);this.f.push(["Glisserati","035678/245678/7"]);this.f.push(["Glissergy","035678/245678/5"]);this.f.push(["Lava","12345/45678/8"]);this.f.push(["Lines","012345/458/3"]);this.f.push(["LivingOn TheEdge","345/3/6"]);this.f.push(["Meteor Guns","01245678/3/8"]);this.f.push(["Nova","45678/2478/25"]);this.f.push(["OrthoGo","3/2/4"]);this.f.push(["Prairie on fire","345/34/6"]);this.f.push(["RainZha","2/23/8"]);this.f.push(["Rake",
"3467/2678/6"]);this.f.push(["SediMental","45678/25678/4"]);this.f.push(["Snake","03467/25/6"]);this.f.push(["SoftFreeze","13458/38/6"]);this.f.push(["Spirals","2/234/5"]);this.f.push(["Star Wars","345/2/4"]);this.f.push(["Sticks","3456/2/6"]);this.f.push(["Swirl","23/34/8"]);this.f.push(["ThrillGrill","1234/34/48"]);this.f.push(["Transers","345/26/5"]);this.f.push(["TransersII","0345/26/6"]);this.f.push(["Wanderers","345/34678/5"]);this.f.push(["Worms","3467/25/6"]);this.f.push(["Xtasy","1456/2356/16"])},
xp:function(r){var A=null,e=0;for(r=r.toLowerCase();e<this.f.length&&null===A;)""!==this.f[e][1]&&this.f[e][0].toLowerCase()===r&&(A=this.f[e][1]),e+=1;return A},wp:function(r){for(var A=null,e=0;e<this.f.length&&null===A;)""!==this.f[e][1]&&this.f[e][1]===r&&(A=this.f[e][0]),e+=1;return A}};(function(){function r(a,c,b,f,d){this.g=d;this.X=a;this.aa=c;this.ia=b;this.h="";this.H=a;this.L=c;this.ha=b;this.le="";this.b=f;this.fa=!1;this.W=this.v=0;this.An=this.uk="rgb(32,255,255)";this.c=0;this.pk=!1;this.Aa=this.Ba="black";this.enabled=!1}function A(a,c,b,f){this.name=a;this.width=c;this.height=b;this.$h=f}function e(a,c){this.c=c;this.h=a;this.b=[]}function p(a,f,b,k,d,m,g,l,h,u,z,v,D,p,e,w,q,y,B,x){this.id=a;this.I="";this.ff=-1;this.j=!1;this.pb=f;this.caller=b;this.icon=B;this.x=d;
this.y=m;this.xd=d;this.b=m;this.position=k;this.width=g;this.height=l;this.border=p;this.type=v;D===c.hm?this.orientation=g>=l?c.Tb:c.Yj:this.orientation=D;this.lower=h;this.upper=u;v===c.fh?this.current=[z,z]:this.current=z;this.Xl=e;this.lb=w;this.ql=q;this.fixed=y;this.al=!1;this.Rh=this.Qh=this.Uh=this.Th=this.dn=this.cn=-1;this.textAlign=c.pm;this.enabled=!0;this.locked=!1;this.ui=[];this.Jj=0;this.Hp=!1;this.Cd=x.Cd;this.hd=x.hd;this.Lc=x.Lc;this.ac=x.ac;this.ze=x.ze;this.ye=x.ye;this.ig=x.ig;
this.wf=x.wf;this.Ce=x.Ce;this.jf=x.jf;this.border=x.border;this.font=x.Og}function q(a,f,b,k,d){this.b=k;this.Og=d;this.locked=this.j=!1;this.qf=this.ge=-1;this.wb=!1;this.H=6;this.pb=a;this.mc=[];this.ta=0;this.Cd="";this.hd=0;this.Lc="";this.ac=0;this.ze="";this.ye=0;this.ig="";this.wf=0;this.Ce="";this.border=this.jf=0;this.h=c.hm;this.pf=this.Ch=-1;this.Fk=null;this.Ei=f;this.caller=b;this.Ga=null}function f(a,c,b,f,d,m){var g=this,n=0,h=a.canvas;this.H=this.L=40;this.Qq=50;this.Xd=0;this.b=
this.c=this.h=-1;this.eg=!1;this.caller=d;this.Cf=this.Z=this.dh=this.dc=!1;this.xb=4;this.dj=m;this.hasFocus=this.tk=!1;this.Eh=!0;this.yi=!1;this.xi=1;this.Cd="black";this.hd=.7;this.Lc="rgb(32,255,255)";this.ac=1;this.ze="rgb(0,240,32)";this.ye=.7;this.ig="blue";this.wf=.7;this.Ce="grey";this.border=this.jf=1;this.om=function(h){return function(){h.ia(h)}}(this);this.Ga=f;this.qd=a;this.Vb=c;this.wb=!1;this.Fe=this.Ee=-1;this.Ab=null;this.Og=b;this.hh=this.jg=!1;this.bl=performance.now();this.nn=
1E3;this.cg=5;this.si=0;this.$k=[];this.dl=[];this.Zk=[];for(n=0;5>n;n+=1)this.$k[n]=0,this.dl[n]=0,this.Zk[n]=0;this.Xh=null;this.pg=!1;this.notification=new r(25,100,25,c,this);registerEvent(h,"mousedown",function(h){g.W(g,h)},!1);registerEvent(h,"mousemove",function(h){g.X(g,h)},!1);registerEvent(h,"mouseup",function(h){g.ha(g,h)},!1);registerEvent(h,"mouseover",function(h){g.fa(g,h)},!1);registerEvent(h,"mouseout",function(h){g.aa(g,h)},!1);registerEvent(h,"touchstart",function(h){g.v(g,h)},!1);
registerEvent(h,"touchmove",function(h){g.v(g,h)},!1);registerEvent(h,"touchend",function(h){g.v(g,h)},!1)}r.prototype.Tf=function(){var a=!1;if(""!==this.h||""!==this.le)a=!0;return a};r.prototype.clear=function(a,c){a?""!==this.le&&(c?this.le="":this.W=performance.now()-(this.H+this.L)):""!==this.h&&(c?this.h="":this.v=performance.now()-(this.X+this.aa))};r.prototype.B=function(a,c,b){this.enabled&&(b?this.le!==a&&(this.le=a,this.H=240,this.L=16*c,this.ha=240,this.W=performance.now(),this.c=0,this.pk=
!1):(this.h=a,this.X=240,this.aa=16*c,this.ia=240,this.v=performance.now()))};r.prototype.bf=function(a,c){var b,f;b=this.b.measureText(a).width>>1;this.fa&&(this.b.fillStyle=this.Aa,f=this.b.globalAlpha,this.b.globalAlpha=.5*f,this.b.fillRect(-b-20,-30,2*b+40,60),this.b.globalAlpha=f);this.b.fillStyle=this.Ba;this.b.fillText(a,-b+2,2);c?this.pk?(this.b.fillStyle=128>this.c?"rgb("+2*this.c+","+2*this.c+",255)":"rgb("+2*(256-this.c)+","+2*(256-this.c)+",255)",this.c=this.c+4&255):this.b.fillStyle=
this.An:this.b.fillStyle=this.uk;this.b.fillText(a,-b,0)};r.prototype.ua=function(a,c,b,f,d,m,g){var n=30,h=n+2,u=this.g.xb,z=60,v=!0;this.g.dc?(z=0,m=this.b.canvas.height/2,this.fa=!0):this.fa=!1;""!==a&&(v=!1,d=performance.now()-d,this.b.save(),this.g.Z&&(g?(z=0,m=this.b.canvas.height/2):(n/=u,h=h/u|0,m=m/u|0,z=z/u|0)),this.b.font=n+"px Arial",this.b.translate(this.b.canvas.width/2-1,z+m),d<=c?(m=d/c,m*=m,this.b.globalAlpha=m,this.b.scale(m,m)):d>c+b&&d<=c+b+f&&(m=(f-(d-(c+b)))/f,m*=m,this.b.globalAlpha=
m,this.b.scale(m,m)),d>c+b+f?v=!0:(c=a.indexOf("\\n"),-1===c?this.bf(a,g):(this.bf(a.substr(0,c),g),this.b.translate(0,h),this.bf(a.substr(c+2),g))),this.b.restore());return v};r.prototype.update=function(){this.ua(this.h,this.X,this.aa,this.ia,this.v,36,!1)&&(this.h="");this.g.Z&&"Expand"!==this.le&&"Launch"!==this.le||!this.ua(this.le,this.H,this.L,this.ha,this.W,0,!0)||(this.le="")};e.prototype.bf=function(a,c,b){this.c.drawImage(this.h,a.$h*a.width,0,a.width,a.height,c,b,a.width,a.height)};e.prototype.length=
function(){return this.b.length};e.prototype.icon=function(a){var c,b=this.b,f=this.length(),d=null;for(c=0;c<f&&!d;)b[c].name===a?d=b[c]:c+=1;return d};e.prototype.add=function(a,c,b){var f=this.b.length;this.b[f]=new A(a,c,b,f)};var c={hm:0,Tb:1,Yj:2,fh:0,button:1,toggle:2,wd:3,list:4,label:5,El:0,td:1,left:0,pm:1,right:2,Fj:0,nc:1,Hm:2,zd:3,On:4,yf:5,ko:6,Sc:7,Pp:8};p.prototype.Ho=function(a,f){this.x=this.xd;this.y=this.b;switch(this.position){case c.Fj:this.x=(a-this.width>>1)+this.xd;break;
case c.nc:this.x=a+this.xd;break;case c.Hm:this.y=(f-this.height>>1)+this.b;this.x=a+this.xd;break;case c.zd:this.x=a+this.xd;this.y=f+this.b;break;case c.On:this.x=(a-this.width>>1)+this.xd;this.y=f+this.b;break;case c.yf:this.y=f+this.b;break;case c.ko:this.y=(f-this.height>>1)+this.b;break;case c.Pp:this.x=(a-this.width>>1)+this.xd,this.y=(f-this.height>>1)+this.b}};p.prototype.fm=function(a,c){var b=this.Jj;this.ui[b]=[a,c];this.Jj=b+1};p.prototype.cm=function(a){var c=[],b,f;f=a.length;for(b=
0;b<f;b+=1)a[b].fm(this,!0);f=c.length;for(b=0;b<f;b+=1)c[b].fm(this,!1)};p.prototype.Vp=function(a,c){var b=!1;this.enabled&&a>=this.x&&a<this.x+this.width&&c>=this.y&&c<this.y+this.height&&(b=!0);return b};q.prototype.v=function(a,f){var b,n,d=a.Jj;a.type===c.list&&a.upper===c.td?b=a.current[0]:b=a.current===a.upper;a.Hp&&(b=!b);if(b&&f)for(n=0;n<d;n+=1)b&=this.v(a.ui[n][0],a.ui[n][1]);return b};q.prototype.ao=function(a){var c,b,f=a.Jj;c=!0;for(b=0;b<f;b+=1)c&=this.v(a.ui[b][0],a.ui[b][1]);a.enabled=
c};q.prototype.Rd=function(){var a,f;for(f=0;f<this.ta;f+=1){a=this.mc[f];a.enabled=!0;switch(a.type){case c.toggle:a.pb&&(a.current=a.pb(a.current===a.upper,!1,this.caller)?a.upper:a.lower);break;case c.fh:a.pb&&(a.current=a.pb(a.current,!1,this.caller));break;case c.list:a.pb&&(a.current=a.pb(a.current,!1,this.caller))}this.ao(a)}};q.prototype.ed=function(a,f,b,k,d,m,g,l,h){this.mc[this.ta]=new p(this.ta,a,this.caller,f,b,k,d,m,g,h,l,c.list,this.h,this.border,!0,"","",-1,[],this);this.ta+=1;return this.mc[this.ta-
1]};q.prototype.Xe=function(a,f,b,k,d,m,g,l,h,u,z,v){this.mc[this.ta]=new p(this.ta,a,this.caller,f,b,k,d,m,g,l,h,c.fh,this.h,this.border,!0,u,z,v,null,this);this.ta+=1;return this.mc[this.ta-1]};q.prototype.Da=function(a,f,b,k,d,m){this.mc[this.ta]=new p(this.ta,null,null,a,f,b,k,d,0,0,0,c.label,this.h,this.border,!0,m,"",-1,null,this);this.ta+=1;return this.mc[this.ta-1]};q.prototype.Fi=function(a,f,b,k,d){this.mc[this.ta]=new p(this.ta,a,this.caller,f,b,k,40,40,0,0,0,c.button,this.h,this.border,
!0,d,"",-1,null,this);this.ta+=1;return this.mc[this.ta-1]};q.prototype.Ao=function(){this.mc[this.ta]=new p(this.ta,null,null,Menu.yf,0,-40,100,40,0,100,0,c.wd,this.h,this.border,!1,"","",0,null,this);this.ta+=1;return this.mc[this.ta-1]};q.prototype.c=function(a,f,b){var n,d,m,g,l;a+=String();if(""!==a){this.b.save();this.b.translate(f.x+f.width/2,f.y+f.height/2);this.b.font=f.font;f.orientation===c.Yj&&this.b.rotate(.5*Math.PI);n=this.b.measureText(a).width;d=f.orientation===c.Yj?f.height:f.width;
if(n>=d-6){if(m=a.length){do--m,g=a.substr(0,m)+"...",n=this.b.measureText(g).width;while(1<m&&n>=d-6)}a=g}switch(f.textAlign){case c.left:l=f.width/2-2;break;case c.pm:l=n/2;break;case c.right:l=n/2-(f.width-n)/2+4}this.b.fillStyle=f.Cd;b&&this.b.fillRect(2-l,2,n,2);this.b.fillText(a,2-l+.5,2.5);this.b.fillStyle=f.locked||this.locked?f.Ce:f.Lc;this.b.fillText(a,-l+.5,.5);b&&this.b.fillRect(-l,0,n,2);this.b.restore()}};q.prototype.X=function(a){this.b.globalAlpha=this.ac;this.c(a.lb,a,!1)};q.prototype.L=
function(a){this.b.globalAlpha=this.ac;this.c(a.lb,a,!1);a.icon&&this.Ga.bf(a.icon,a.x,a.y)};q.prototype.fa=function(a){var f;f=(a.current-a.lower)/(a.upper-a.lower);this.b.globalAlpha=this.hd;this.b.fillStyle=this.Lc;a.orientation===c.Tb?(f*=a.width-3,this.b.fillRect(a.x+(f+1|0),a.y,1,a.height)):(f*=a.height-3,this.b.fillRect(a.x,a.y+(f+1|0),a.width,1));f=a.lb;a.Xl&&(f=-1!==a.fixed?f+a.current.toFixed(a.fixed):f+a.current,f+=a.ql);""!==f&&(this.b.globalAlpha=this.ac,this.c(f,a,!1))};q.prototype.ha=
function(a,f){var b,n;b=(a.current[0]-a.lower)/(a.upper-a.lower);n=this.H;a.orientation===c.Tb?(b*=a.width-3,b=b+1|0,f&&(this.b.fillStyle=this.ze,this.b.globalAlpha=this.ye,this.b.fillRect(a.x+b-n,a.y,n,a.height),this.b.fillRect(a.x+b+1,a.y,n,a.height)),a.locked||this.locked?(this.b.fillStyle=this.Ce,this.b.globalAlpha=this.jf):(this.b.fillStyle=this.Lc,this.b.globalAlpha=this.ac),this.b.fillRect(a.x+b,a.y,1,a.height)):(b*=a.height-3,b=b+1|0,f&&(this.b.fillStyle=this.ze,this.b.globalAlpha=this.ye,
this.b.fillRect(a.x,a.y+b-n,a.width,n),this.b.fillRect(a.x,a.y+b+1,a.width,n)),a.locked||this.locked?(this.b.fillStyle=this.Ce,this.b.globalAlpha=this.jf):(this.b.fillStyle=this.Lc,this.b.globalAlpha=this.ac),this.b.fillRect(a.x,a.y+b,a.width,1));b=a.lb;a.Xl&&(b=0<=a.fixed?b+a.current[1].toFixed(a.fixed):b+a.current[1]);b+=a.ql;""!==b&&(this.b.globalAlpha=this.ac,this.c(b,a,!1))};q.prototype.ia=function(a){var c,b;this.b.globalAlpha=this.ac;c="-"===a.lower&&""===a.upper&&a.current===a.lower;b=a.lb;
a.Xl&&!c&&(b+=a.current);b+=a.ql;this.c(b,a,c)};q.prototype.aa=function(a,f){var b,n,d,m,g,l,h,u,z,v;m=a.x;g=a.y;h=a.width;u=a.height;z=a.orientation;v=a.current;d=a.lower;n=d.length;l=a.orientation===c.Tb?h/n:u/n;this.b.globalAlpha=this.wf;this.b.fillStyle=this.ig;if(a.upper===c.El)b=a.current,a.orientation===c.Tb?this.b.fillRect(m+b*l+1,g+1,l-2,u-2):this.b.fillRect(m+1,g+1+b*l,h-2,l-2);else if(a.orientation===c.Tb)for(b=0;b<n;b+=1)v[b]&&this.b.fillRect(m+b*l+1,g+1,l-2,u-2);else for(b=0;b<n;b+=1)v[b]&&
this.b.fillRect(m+1,g+1+b*l,h-2,l-2);this.b.globalAlpha=this.ac;if(a.orientation===c.Tb)for(b=0;b<n;b+=1)a.icon[b]&&this.Ga.bf(a.icon[b],a.x+l*b,a.y);else for(b=0;b<n;b+=1)a.icon[b]&&this.Ga.bf(a.icon[b],a.x,a.y+l*b);f?(this.b.globalAlpha=this.ye,this.b.fillStyle=this.ze,a.orientation===c.Tb?(b=(this.ge-m)/h*n|0,0<=b&&b<n&&this.b.fillRect(m+b*l+.5,g+.5,l-1,u-1)):(b=(this.qf-g)/u*n|0,0<=b&&b<n&&this.b.fillRect(m+.5,g+.5+b*l,h-1,l-1)),a.ff=b):a.ff=-1;this.b.globalAlpha=this.ac;this.b.fillStyle=this.Lc;
if(z===c.Tb)for(b=0;b<n;b+=1)m=d[b],""!==m&&(this.b.save(),this.b.translate((.5+(b-n/2))*l,0),this.c(m,a,!1),this.b.restore());else for(b=0;b<n;b+=1)m=d[b],""!==m&&(this.b.save(),this.b.translate(0,(.5+(b-n/2))*l),this.c(m,a,!1),this.b.restore())};q.prototype.W=function(a,f,b,k){var d,n,g;!(b===k||-1===k&&f)||a.type!==c.button&&a.type!==c.toggle?(this.b.fillStyle=a.Cd,this.b.globalAlpha=a.hd):(this.b.fillStyle=a.ze,this.b.globalAlpha=a.ye);switch(a.type){case c.wd:d=(a.current-a.lower)/(a.upper-a.lower);
this.b.fillStyle=a.ig;this.b.globalAlpha=a.wf;a.orientation===c.Tb?(d*=a.width-3,d=d+1|0,this.b.fillRect(a.x,a.y,d,a.height),this.b.fillStyle=a.Cd,this.b.globalAlpha=a.hd,this.b.fillRect(a.x+d,a.y,a.width-d,a.height)):(d*=a.height-3,d=d+1|0,this.b.fillRect(a.x,a.y,a.width,d),this.b.fillStyle=a.Cd,this.b.fillRect(a.x,a.y+d,a.width,a.height-d));break;case c.fh:d=(a.current[0]-a.lower)/(a.upper-a.lower);b===k||-1===k&&f?(n=this.H,a.orientation===c.Tb?(d*=a.width-3,d=d+1|0,g=d-n,0<g&&this.b.fillRect(a.x,
a.y,g,a.height),g=1+d+n,g<a.width&&this.b.fillRect(a.x+g,a.y,a.width-g,a.height)):(d*=a.height-3,d=d+1|0,g=d-n,0<g&&this.b.fillRect(a.x,a.y,a.width,g),g=1+d+n,g<a.height&&this.b.fillRect(a.x,a.y+g,a.width,a.height-g))):this.b.fillRect(a.x,a.y,a.width,a.height);break;default:this.b.fillRect(a.x,a.y,a.width,a.height)}a.type!==c.list&&a.icon&&(this.b.globalAlpha=a.ac,this.Ga.bf(a.icon,a.x,a.y),!(b===k||-1===k&&f)||a.type!==c.button&&a.type!==c.toggle||(this.b.globalAlpha=a.wf,this.b.fillRect(a.x,a.y,
a.width,a.height)));if(0<a.border)switch(a.locked||this.locked?(this.b.strokeStyle=a.Ce,this.b.globalAlpha=a.jf):(this.b.strokeStyle=a.Lc,this.b.globalAlpha=a.ac),this.b.lineWidth=a.border,a.type){case c.label:break;case c.list:n=a.lower.length;if(a.orientation===c.Tb)for(g=a.width/n,d=0;d<n;d+=1)this.b.strokeRect(a.x+.5+d*g,a.y+.5,g-1,a.height-1);else for(g=a.height/n,d=0;d<n;d+=1)this.b.strokeRect(a.x+.5,a.y+.5+d*g,a.width-1,g-1);break;default:this.b.strokeRect(a.x+.5,a.y+.5,a.width-1,a.height-
1)}switch(a.type){case c.button:this.L(a);break;case c.label:this.X(a);break;case c.fh:this.ha(a,b===k||-1===k&&f);break;case c.toggle:this.ia(a);break;case c.wd:this.fa(a);break;case c.list:this.aa(a,b===k||-1===k&&f)}if(b===k)switch(a.type){case c.fh:d=this.qf,a.orientation===c.Yj?(d<a.y?d=a.y:d>=a.y+a.height&&(d=a.y+a.height-1),a.current[0]=(d-a.y)/(a.height-1)*(a.upper-a.lower)+a.lower):(d=this.ge,d<a.x?d=a.x:d>=a.x+a.width&&(d=a.x+a.width-1),a.current[0]=(d-a.x)/(a.width-1)*(a.upper-a.lower)+
a.lower),a.pb&&(a.current=a.pb(a.current,!0,a.caller))}if(f&&!this.wb&&a.al)switch(a.type){case c.button:a.pb&&a.pb(a.caller);break;case c.toggle:a.current=a.current===a.upper?a.lower:a.upper;a.pb&&a.pb(a.current===a.upper,!0,a.caller);break;case c.list:n=a.lower.length,g=a.orientation===c.Tb?(this.ge-a.x)/a.width*n|0:(this.qf-a.y)/a.height*n|0,a.upper===c.El?a.pb?a.current=a.pb(g,!0,a.caller):a.current=g:(a.current[g]=!a.current[g],a.pb&&a.pb(a.current,!0,a.caller))}f&&b===k?(a.al=this.wb,a.cn=this.ge,
a.dn=this.qf):(a.al=!1,a.cn=-1,a.dn=-1)};q.prototype.Hk=function(){var a,c,b,f,d,m=this.b.canvas.width,g=this.b.canvas.height;d=!1;this.pf=-1;if(!this.j){b=this.Ch;this.b.textAlign="left";for(f=0;f<this.ta;f+=1)a=this.mc[f],a.j||(a.Ho(m,g),(c=a.Vp(this.ge,this.qf)&&!(a.locked||this.locked))&&!this.wb&&(this.pf=f),this.wb&&-1===b&&c&&(b=f),f===b&&(a.locked||this.locked)&&(b=-1,c=!1),a.enabled&&this.W(a,c,f,b));0<=b&&!this.wb&&(d=!0);this.wb&&-1===b&&(b=-2);-2===b&&this.Fk&&!this.locked&&this.Fk(this.ge,
this.qf,this.wb,this.caller);this.wb||(b=-1);this.Ch=b;this.b.globalAlpha=1}return d};f.prototype.Mo=function(){var a=this.qd.canvas,c=a.offsetParent;this.offsetLeft=a.offsetLeft;for(this.offsetTop=a.offsetTop;c;)this.offsetLeft+=c.offsetLeft,this.offsetTop+=c.offsetTop,c=c.offsetParent;c=a.parentNode;if("fixed"===c.style.position)this.offsetLeft+=document.body.scrollLeft+document.documentElement.scrollLeft,this.offsetTop+=document.body.scrollTop+document.documentElement.scrollTop;else for(;"body"!==
c.tagName.toLowerCase();)this.offsetLeft-=c.scrollLeft,this.offsetTop-=c.scrollTop,c=c.parentNode};f.prototype.To=function(a,c,b){a=new q(a,c,b,this.Vb,this.Og);a.Lc=this.Lc;a.ac=this.ac;a.Cd=this.Cd;a.hd=this.hd;a.ze=this.ze;a.ye=this.ye;a.ig=this.ig;a.wf=this.wf;a.Ce=this.Ce;a.jf=this.jf;a.border=this.border;return a};f.prototype.mp=function(){var a=this.Ab,f,b,k,d,m=this.Vb,g,l,h;if(-1!==a.Ch||-1===a.Ch&&-1===a.pf)this.b=a.Ch;-1===a.pf||-1!==this.b&&this.b===a.pf?(-1!==a.pf&&(a=a.mc[a.pf],a.id===
this.h&&a.ff!==this.c&&(this.b=-1)),50>this.Xd&&(this.Xd+=1)):(a=a.mc[a.pf],a.id!==this.h||a.id===this.h&&a.ff!==this.c?(this.h=a.id,this.c=a.ff,50>this.Xd&&(this.Xd+=1)):0<=this.Xd&&--this.Xd,g=-1!==this.c?a.I[this.c]:a.I,""!==g&&-1===this.Xd&&(this.b=-1,k=a.x,d=a.y,f=a.width,b=a.height,-1!==a.ff&&(a.orientation===c.Tb?(k+=f/a.lower.length*a.ff,f/=a.lower.length):(d+=b/a.lower.length*a.ff,b/=a.lower.length)),m.font="18px Arial",h=m.measureText(g).width,l=Math.round(k+f/2),d=Math.round(d+b/2),l-=
h/2,5>l?l=5:l+h+4>m.canvas.width&&(l=m.canvas.width-h-4-1),b>f?(-1!==this.H&&f<this.H&&(f=this.H),l>m.canvas.width/2?l=k-h-f/2:l=k+a.width+f/2):(-1!==this.L&&b<this.L&&(b=this.L),d>m.canvas.height/2?d-=b:d+=b),m.globalAlpha=.7,m.fillStyle="black",m.fillRect((l-4|0)-.5,(d-9-4|0)-.5,h+2+8,26),m.globalAlpha=1,m.strokeStyle="rgb(32,255,255)",m.strokeRect((l-4|0)-.5,(d-9-4|0)-.5,h+2+8,26),m.globalAlpha=.7,m.strokeStyle="black",m.beginPath(),m.moveTo((l-4|0)+.5,(d-9-4|0)+26.5),m.lineTo((l-4|0)+.5+h+2+8,
(d-9-4|0)+26.5),m.lineTo((l-4|0)+.5+h+2+8,(d-9-4|0)+.5),m.stroke(),m.globalAlpha=1,m.fillStyle="black",m.fillText(g,l+2,d+2),m.fillStyle="white",m.fillText(g,l,d)))};f.prototype.ia=function(a){var c,b,f,d,m=a.Vb,g,l,h=m.canvas.width-86,u=90;a.Z&&(u=0);a.yi=!1;a.Xh&&(a.Ab=a.Xh,a.Xh=null,m.font=a.Og,a.Ab.Rd(),a.Ab.Ei&&a.Ab.Ei(a.Ab.caller));if(a.Eh||a.notification.Tf()||a.xi||a.Qq!==a.Xd&&-1!==a.Xd)a.ei(a),a.xi&&--a.xi;b=performance.now();f=b-a.bl;a.bl=b;a.Ab.pb&&(f>a.nn?a.Ab.pb(a.nn,a.Ab.caller):a.Ab.pb(f,
a.Ab.caller));b=performance.now()-b;c=performance.now();a.Hk();a.mp();a.notification.update();c=performance.now()-c;a.$k[a.si]=c;for(d=c=0;d<a.cg;d+=1)c+=a.$k[d];c/=a.cg;a.dl[a.si]=b;for(d=b=0;d<a.cg;d+=1)b+=a.dl[d];b/=a.cg;a.Zk[a.si]=f;for(d=f=0;d<a.cg;d+=1)f+=a.Zk[d];f/=a.cg;a.si=(a.si+1)%a.cg;f=Math.round(1E3/f);a.jg&&(m.font="12px Arial",m.globalAlpha=.7,m.fillStyle="black",a.hh?m.fillRect(h,u,88,83):m.fillRect(h,u,88,20),d=(b+c)/16.6666,1<d&&(d=1),m.fillStyle=.5>d?"rgb("+(510*d|0)+",255,0)":
"rgb(255,"+(255*(1-2*(d-.5))|0)+",0)",m.fillRect(h,u,88*d|0,20),c=c.toFixed(1),b=b.toFixed(1),m.globalAlpha=1,m.fillStyle="black",g=f+"fps",l=m.measureText(g).width,m.fillText(g,h+36-l,u+12),g=(100*d|0)+"%",l=m.measureText(g).width,m.fillText(g,h+84-l,u+12),a.hh&&(m.fillText("menu",h+6,u+28),m.fillText("work",h+6,u+44),m.fillText("update",h+6,u+60),m.fillText("focus",h+6,u+76),g=c+"ms",l=m.measureText(g).width,m.fillText(g,h+84-l,u+28),g=b+"ms",l=m.measureText(g).width,m.fillText(g,h+84-l,u+44),g=
a.Eh?"on":"off",l=m.measureText(g).width,m.fillText(g,h+84-l,u+60),g=a.hasFocus?"on":"off",l=m.measureText(g).width,m.fillText(g,h+84-l,u+76)),m.fillStyle="white",g=f+"fps",l=m.measureText(g).width,m.fillText(g,h+34-l,u+10),g=(100*d|0)+"%",l=m.measureText(g).width,m.fillText(g,h+82-l,u+10),a.hh&&(m.fillText("menu",h+4,u+26),m.fillText("work",h+4,u+42),m.fillText("update",h+4,u+58),m.fillText("focus",h+4,u+74),g=c+"ms",l=m.measureText(g).width,m.fillText(g,h+82-l,u+26),g=b+"ms",l=m.measureText(g).width,
m.fillText(g,h+82-l,u+42),g=a.Eh?"on":"off",l=m.measureText(g).width,m.fillText(g,h+82-l,u+58),g=a.hasFocus?"on":"off",l=m.measureText(g).width,m.fillText(g,h+82-l,u+74)),m.globalAlpha=1);a.qd.drawImage(m.canvas,0,0)};f.prototype.xo=function(a){a.Ga=this.Ga;this.Ab?this.Xh=a:(this.Xh=null,this.Ab=a,this.Vb.font=this.Og,this.Ab.Rd(),this.Ab.Ei&&this.Ab.Ei(this.Ab.caller),this.ei(this))};f.prototype.Hk=function(){var a,c,b;if(this.Ab&&(c=this.Ab,this.Vb.font=this.Og,c.ge=this.Ee,c.qf=this.Fe,c.wb=this.wb,
c.Hk()||this.pg)){for(a=0;a<c.ta;a+=1)b=c.mc[a],c.ao(b);this.pg=!1}};f.prototype.ei=function(a){a.yi||(requestAnimationFrame?requestAnimationFrame(a.om):setTimeout(a.om,16),a.yi=!0)};f.prototype.v=function(a,c){var b,f,d="";if("touchend"===c.type)d="mouseup",f=document.createEvent("MouseEvent"),f.initMouseEvent(d,!0,!0,window,1,a.Th,a.Uh,a.Qh,a.Rh,!1,!1,!1,!1,0,null),c.target.dispatchEvent(f),c.preventDefault();else{if(1===c.touches.length)switch(c.type){case "touchstart":d="mousedown";break;case "touchmove":d=
"mousemove"}""!==d&&(b=c.changedTouches[0],f=document.createEvent("MouseEvent"),f.initMouseEvent(d,!0,!0,window,1,b.screenX,b.screenY,b.clientX,b.clientY,!1,!1,!1,!1,0,null),b.target.dispatchEvent(f),c.preventDefault(),a.Th=b.screenX,a.Uh=b.screenY,a.Qh=b.clientX,a.Rh=b.clientY)}};f.prototype.W=function(a,c){a.eg||(a.hasFocus?a.Z&&a.dj&&a.dj(a.caller):(a.qd.canvas.focus(),a.hasFocus=!0,a.notification.clear(!0,!1),a.dj&&a.dj(a.caller)),a.rg(a,c),a.wb=!0,c.stopPropagation&&c.stopPropagation(),c.preventDefault())};
f.prototype.ha=function(a,c){a.eg||(a.rg(a,c),a.wb=!1,c.stopPropagation&&c.stopPropagation(),c.preventDefault())};f.prototype.qm=function(a){a.hasFocus||a.tk&&""!==a.notification.le||(a.dc?a.dh||a.notification.B("RLE",3600,!0):a.Z?a.Cf?a.notification.B("Launch",3600,!0):a.notification.B("Expand",3600,!0):a.notification.B("Click to control",3600,!0),a.notification.pk=!0,a.tk=!0)};f.prototype.X=function(a,c){a.eg||(a.qm(a),a.rg(a,c),c.stopPropagation&&c.stopPropagation(),c.preventDefault())};f.prototype.fa=
function(a,c){a.eg||(a.qm(a),c.stopPropagation&&c.stopPropagation(),c.preventDefault())};f.prototype.aa=function(a,c){a.eg||(a.hasFocus||a.notification.clear(!0,!1),a.qd.canvas.blur(),a.hasFocus=!1,a.wb=!1,a.Ee=-1,a.Fe=-1,a.tk=!1,a.yi||(a.ei(a),a.xi=2),c.stopPropagation&&c.stopPropagation(),c.preventDefault())};f.prototype.rg=function(a,c){var b,f;c.pageX||c.pageY?(b=c.pageX,f=c.pageY):(b=c.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,f=c.clientY+document.body.scrollTop+document.documentElement.scrollTop);
a.Mo();b-=a.offsetLeft;f-=a.offsetTop;a.Ee=b-1|0;a.Fe=f-1|0;a.yi||(a.ei(a),a.xi=2)};f.prototype.xf=function(a){!a&&!this.notification.Tf()||this.Eh||this.ei(this);this.Eh=a};window.IconManager=e;window.Menu=c;window.MenuManager=f})();(function(){function r(p,e,f,c,a,n){this.kh=p;this.lh=e;this.width=f;this.height=c;this.Jq=a;this.np=n}function A(p){var e=p.lastIndexOf(".");-1!==e&&(p=p.substr(0,e));this.name=p;this.be=this.od=this.xe=-1;this.Ug=this.Mh=0;this.mj=this.Qk=!1;this.gm=this.ra="";this.M=this.Ph=this.Ub=!1;this.Qe=-1;this.Be=!1;this.u=-1;this.height=this.width=0;this.Ge=this.Kb=null;this.Ud=this.title="";this.He=2;this.Zh=0;this.Wg=this.Oe=!1;this.wn=""}var e={rk:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
De:86,op:"XRLE",zn:"Pos",Lm:"Gen",Fa:"",Go:":",mm:"ptkcs",Xj:"012345678ceaiknjqrytwz-",af:"0123456789",Fp:"0123456",er:"01234",vl:["ce","ceaikn","ceaiknjqry","ceaiknjqrytwz"],Kp:[0,2,6,10,13,10,6,2,0],Yp:[[0],[0,1],[2,0,1,3,4,5],[2,0,1,3,6,4,5,7,8,9],[2,0,1,3,6,4,5,7,8,10,11,9,12],[2,0,1,3,6,4,5,7,8,9],[2,0,1,3,4,5],[0,1],[0]],wq:[[1,2],[5,10,3,40,33,68],[69,42,11,7,98,13,14,70,41,97],[325,170,15,45,99,71,106,102,43,101,105,78,108]],fl:13,maxWidth:8192,maxHeight:8192,Np:256,Yc:new Uint32Array(256),
ai:new Uint8Array(512),Oq:new Uint16Array(512),Ka:!1,Sg:!1,Vm:"history",Tm:"h",jo:"v",Oe:!1,Mk:0,df:!1,ol:0,pl:0,tf:!1,index:0,ap:function(p,e,f){var c,a,n,b,k=0,d=0,m=0,g,l,h=!1;a=e.length;for(c=b=0;c<a;)switch(n=e[c],c+=1,b){case 0:switch(n){case "!":b=1;l=!0;break;case "O":case "o":case "*":case ".":b=2,d=k=m=0,g=--c}break;case 1:"\r"!==n&&(" "===n?l||(p.title+=n):(l=!1,p.title+=n));"\n"===n&&(b=0);break;case 2:switch(n){case "O":case "o":case "*":case ".":d+=1;break;case "\n":m+=1;d>k&&(k=d);
d=0;break;case " ":case "\t":break;default:c=a,h=!0}}if(!h){2===b&&"\n"!==n&&(m+=1,d>k&&(k=d));p.height=m;p.width=k;p.Ud="Cells";p.Kb=Array.T(Uint16,p.height,(p.width-1>>4)+1,0,f,"Pattern.lifeMap");c=g;for(f=b=0;c<a;)switch(n=e[c],c+=1,n){case "\n":b+=1;f=0;break;case "O":case "o":case "*":p.Kb[b][f>>4]|=1<<(~f&15);f+=1;break;case ".":f+=1}this.Ka=!0;this.Mg(p,"")}},Zo:function(p,e,f){var c,a,n,b,k,d,m,g,l,h;a=e.length;k=[];d=0;l=!1;g=m=0;h=!1;for(c=10;c<a;)switch(n=e[c],c+=1,n){case "\n":h&&(h=!1,
2===b&&l&&(g=-g,l=!1),k[d]=[m,g],d+=1);b=g=m=0;break;case "-":l=!0;0===b?b=1:1===b&&(b=2);break;case " ":1===b&&(l&&(m=-m,l=!1),b=2);break;case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":0===b&&(b=1),1===b?m=10*m+parseInt(n,10):(g=10*g+parseInt(n,10),h=!0)}h&&(2===b&&l&&(g=-g),k[d]=[m,g],d+=1);if(d){a=e=k[0][0];b=n=k[0][1];for(c=1;c<d;c+=1)m=k[c][0],g=k[c][1],m<e&&(e=m),m>a&&(a=m),g<n&&(n=g),g>b&&(b=g);p.height=b-n+1;p.width=a-e+1;p.Kb=Array.T(Uint16,p.height,
(p.width-1>>4)+1,0,f,"Pattern.lifeMap");p.Ud="Life 1.06";this.Mg(p,"");for(c=0;c<d;c+=1)m=k[c][0]-e,g=k[c][1]-n,p.Kb[g][m>>4]|=1<<(~m&15)}},xm:function(p,e,f,c){var a,n,b,k,d,m,g,l,h,u=[],z=0,v=e.length;g=m="";l=!1;var D=0,L=0,q=!1,w=!1,G=0,y=0;for(f=f?10:0;f<v&&!w;)switch(a=e[f],f+=1,D){case 0:switch(a){case "#":D=2;break;case "*":case ".":D=3,k=b=n=0,d=--f}break;case 2:switch(a){case "C":case "D":D=1;h=!0;break;case "N":D=0;break;case "R":D=4;break;case "P":D=5;L=2;q=!1;y=G=0;break;case "\n":D=
0;break;default:D=1,h=!0}break;case 1:"\r"!==a&&(" "===a?h||(p.title+=a):(h=!1,p.title+=a));"\n"===a&&(D=0);break;case 4:switch(a){case "\n":D=0;break;case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":switch(L){case 1:g+=a;l=!0;break;case 0:m+=a,l=!0}break;case "/":L=1,l=!0}break;case 5:switch(a){case "\n":D=0;4===L&&q&&(y=-y,q=!1);break;case "-":q=!0;2===L?L=3:3===L&&(L=4);break;case " ":3===L&&(q&&(G=-G,q=!1),L=4);break;case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":2===
L&&(L=3),3===L?G=10*G+parseInt(a,10):y=10*y+parseInt(a,10)}break;case 3:switch(a){case "\n":n>b&&(b=n);n=0;k+=1;break;case "#":u[z]=new r(G,y,b,k,d,f-1);z+=1;D=2;break;case "*":case ".":n+=1;break;default:w=!0}}"\n"!==a&&(k+=1);3===D&&(u[z]=new r(G,y,b,k,d,f-1),z+=1);if(z&&!w){G=u[0].kh;y=u[0].lh;a=G+u[0].width-1;n=y+u[0].height-1;for(f=1;f<z;f+=1)u[f].kh<G&&(G=u[f].kh),u[f].lh<y&&(y=u[f].lh),u[f].kh+u[f].width-1>a&&(a=u[f].kh+u[f].width-1),u[f].lh+u[f].height-1>n&&(n=u[f].lh+u[f].height-1);p.height=
n-y+1;p.width=a-G+1;p.Kb=Array.T(Uint16,p.height,(p.width-1>>4)+1,0,c,"Pattern.lifeMap");p.Ud="Life 1.05";l?(this.Mg(p,m+"/"+g),p.ra=m+"/"+g):this.Mg(p,"");for(f=0;f<z;f+=1)for(c=u[f].Jq,m=u[f].np,l=u[f].kh-G,a=u[f].lh-y,g=l,n=a;c<=m;)switch(a=e[c],c+=1,a){case "\n":n+=1;g=l;break;case "*":p.Kb[n][g>>4]|=1<<(~g&15);g+=1;break;default:g+=1}}},Al:function(p,e,f,c){var a=0,n,b,k;f&&(a=16);for(b=0;512>b;b+=32)for(k=0;16>k;k+=1){f=0;for(n=b+k&c;0<n;)f+=n&1,n>>=1;e===f&&(p[b+k+a]=1)}},tp:function(p){return(p&
7)<<6|(p&448)>>6|p&56},Hn:function(p){return(p&4)<<6|(p&32)<<2|(p&256)>>2|(p&2)<<4|p&16|(p&128)>>4|(p&1)<<2|(p&8)>>2|(p&64)>>6},Gq:function(p,e,f){var c;for(c=0;4>c;c+=1)p[e]=f,e=this.Hn(e);e=this.tp(e);for(c=0;4>c;c+=1)p[e]=f,e=this.Hn(e)},Fq:function(p,e,f,c,a,n){var b=0,k=e-1;0===e||8===e?this.Al(p,e,f,n):(3<k&&(k=6-k,b=495),e=this.vl[k].indexOf(c),-1!==e&&(b^=this.wq[k][e],f&&(b|=16),this.Gq(p,b,a)))},Mn:function(p,e,f,c){var a,n=e.length,b=0,k="",d;for(d=0;d<n;d+=1)a=e.charCodeAt(d)-48,b|=1<<
a,this.Al(p,a,f,c);for(d=0;9>d;d+=1)b&1<<d&&(k+=String(d));return k},Eo:function(p){for(var e=0;p;)e+=1,p&=p-1;return e},yo:function(p,e){var f="",c,a=0,n,b;if(e[p]){if(c=e[p],c&1<<this.fl&&(a=1,c&=~(1<<this.fl)),n=this.Eo(c),b=this.Kp[p],(a||7!==n||13!==b)&&n+a>b>>1&&(c=~c&(1<<b)-1)&&(a=!a),!a||c)for(f+=String(p),a&&(f+="-"),n=0;n<b;n+=1)a=this.Yp[p][n],c&1<<a&&(f+=this.vl[3][a])}else f+=String(p);return f},Ln:function(p,e,f){var c,a,n=e.length,b,k=this.vl[3],d,m=0,g=[],l="",h;e+=" ";for(h=0;9>h;h+=
1)g[h]=0;for(h=0;h<n;h+=1)if(c=e.charCodeAt(h)-48,m|=1<<c,0<=c&&8>=c)for(a=e[h+1],d=k.indexOf(a),-1===d&&this.Al(p,c,f,511),b=1,"-"===a&&(b=0,h+=1,a=e[h+1],d=k.indexOf(a));-1!==d;)this.Fq(p,c,f,a,b,511),g[c]|=1<<d,b||(g[c]|=1<<this.fl),h+=1,a=e[h+1],d=k.indexOf(a);for(h=0;9>h;h+=1)m&1<<h&&(l+=this.yo(h,g));return l},Yo:function(p,e){var f;for(f=0;512>f;f+=1)p[f]=e&1<<(f&7)?1:f&16?1:0},Wo:function(p,q,f,c,a,n){var b,k=0,d=0,m;m=this.ai;var g=this.Oq;for(b=0;512>b;b+=1)m[b]=0,g[b]=(b&448)>>6|b&56|(b&
7)<<6;if(""!==f){q="MAP"+f;for(b=0;b<e.De-1;b+=1)n=e.rk.indexOf(f[b]),m[g[k]]=n>>5,k+=1,m[g[k]]=n>>4&1,k+=1,m[g[k]]=n>>3&1,k+=1,m[g[k]]=n>>2&1,k+=1,m[g[k]]=n>>1&1,k+=1,m[g[k]]=n&1,k+=1;n=e.rk.indexOf(f[b]);m[g[k]]=n>>5;m[g[k+1]]=n>>4&1}else c||a?(c&&(d=254),a&&(d=186),f=this.Mn(m,p,!1,d),m=this.Mn(m,q,!0,d)):(f=this.Ln(m,p,!1),m=this.Ln(m,q,!0)),q=-1!==n?m+"/"+f+"/"+n:"B"+f+"/S"+m;return q},qr:function(p,e){var f,c,a="";for(f=0;f<=e;f+=1)c=this.Xj[f],-1!==p.indexOf(c)&&(a+=this.Xj[e-f]);return a},
nr:function(p){var e,f,c="";for(e=0;9>e;e+=1)f=this.Xj[e],-1===p.indexOf(f)&&(c+=f);return c},Bn:function(p){var e=p,f=0;if(-1!==p.indexOf(" "))for(e="";f<p.length;)" "!==p[f]&&(e+=p[f]),f+=1;return e},jp:function(p,e){for(var f=!0,c=0,a,n=1;n<e.length&&f;)a=this.af.indexOf(e[n]),-1!==a?c=10*c+a:(this.Fa="Illegal character in Wolfram rule",f=!1),n+=1;f&&(2>c||254<c?(this.Fa="Wolfram rule number must be 2-254",f=!1):c&1?(this.Fa="Wolfram rule number must be even",f=!1):(this.Yo(this.ai,c),p.Qe=c,p.ra=
"W"+c));return f},zo:function(p){var q;p.M?p.ra+="H":p.Be&&(p.ra+="V");q=AliasManager.wp(p.ra);p.Ub&&(p.ra+="History");-1!==p.xe&&(p.ra+=":"+e.mm[p.xe].toUpperCase(),p.ra+=p.od,p.Mh&&(p.ra+="+"+p.Mh),p.Qk&&(p.ra+="*"),p.be!==p.od||p.Ug||p.mj)&&(p.ra+=","+p.be,p.Ug&&(p.ra+="+"+p.Ug),p.mj&&(p.ra+="*"));null!==q&&(""===q&&(q=p.Ub?"Life":"Conway's Life"),p.Ub&&(q+="History"),p.gm=q)},ep:function(p){var q=!1,f;if(p.length>=e.De)for(q=!0,f=0;f<e.De;f+=1)-1===e.rk.indexOf(p[f])&&(q=!1);return q},Mg:function(p,
q){var f,c,a,n=!1,b=null,k=null,d=null,m=this.Xj;c=e.Tm.length;f=e.jo.length;var g="";a=AliasManager.xp(q);null!==a&&(""===q&&(p.ra="Conway's Life"),q=a);if("map"===q.substr(0,3).toLowerCase())if(g=q.substr(3),n=this.ep(g))if(d=g.substr(e.De),g=g.substr(0,e.De),"/"===d[0]){c=1;for(f=p.u=0;c<d.length&&-1!==f;)f=this.af.indexOf(d[c]),-1!==f?p.u=10*p.u+f:(this.Fa="Illegal character in generations number",p.u=-1,n=!1),c+=1;-1!==p.u&&(2>p.u||256<p.u)&&(this.Fa="Generations number must be 2-256",p.u=-1,
n=!1)}else""!==d&&(c=d.length,this.Fa="MAP string length must be "+e.De+" not "+(c+e.De),n=!1);else this.Fa=g.length<e.De?"MAP string length must be "+e.De+" not "+g.length:"MAP contains illegal base64 character";else if(q=q.toLowerCase(),q=this.Bn(q),"w"===q[0])n=this.jp(p,q);else{a=q.lastIndexOf(e.Tm);-1!==a&&a===q.length-c&&(p.M=!0,q=q.substr(0,q.length-c),m=this.Fp);c=q.lastIndexOf(e.jo);-1!==c&&c===q.length-f&&(p.Be=!0,q=q.substr(0,q.length-f),m=this.er);f=q.indexOf("/");-1===f&&(f=q.indexOf("_"));
-1!==f&&(c=q.lastIndexOf("/"),-1===c&&(c=q.lastIndexOf("_")),c!==f&&(d=q.substring(c+1),q=q.substr(0,c)));c=q.indexOf("b");a=q.indexOf("s");-1===f?0===c||0===a?-1===a?(b=q,k=""):-1==c?(k=q,b=""):c<a&&-1!==a?(b=q.substring(c+1,a),k=q.substring(a+1)):(b=q.substring(a+1,c),k=q.substring(c+1)):this.Fa="Unsupported rule name":c<a?(b=q.substring(0,f),k=q.substring(f+1)):(b=q.substring(f+1),k=q.substring(0,f));-1!==c&&b&&"b"===b[0]&&(b=b.substring(1));-1!==a&&k&&"s"===k[0]&&(k=k.substring(1));if(null!==
d){c=0;for(f=p.u=0;c<d.length&&-1!==f;)f=this.af.indexOf(d[c]),-1!==f?p.u=10*p.u+f:(this.Fa="Illegal character in generations number",p.u=-1,b=null),c+=1;-1!==p.u&&(2>p.u||256<p.u)&&(this.Fa="Generations number must be 2-256",p.u=-1,b=null)}if(null!==b&&null!==k){n=!0;for(c=0;c<b.length;)f=m.indexOf(b[c]),-1===f?(this.Fa="Illegal character in birth specification",n=!1,c=b.length):c+=1;if(n)for(c=0;c<k.length;)f=m.indexOf(k[c]),-1===f?(this.Fa="Illegal character in survival specification",n=!1,c=k.length):
c+=1}}n&&-1===p.Qe&&(p.ra=this.Wo(b,k,g,p.M,p.Be,p.u),this.zo(p));return n},zm:function(p,q,f,c){var a=0,n=q.length-1,b=!1,k=!0,d,m,g=0,l=0,h=0,u,z=0,v=this.Yc;for(m=q[a];!b;){d=m;m=q[a+1];u=-1;switch(d){case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":z=10*z+parseInt(d,10);break;case "b":u=0;break;case "o":u=1;break;case ".":u=0;break;case "z":u=7;p.Ub=!0;p.Ph=!0;break;case "$":z||(z=1);h+=z;z=0;l>g&&(g=l);l=0;break;case "!":z||(z=1);h+=z;z=0;l>g&&(g=l);b=
!0;break;default:k=!1,"A"<=d&&"X">=d?(k=!0,u=d.charCodeAt(0)-64):"p"<=d&&"y">d?"A"<=m&&"X">=m?(k=!0,u=24*(d.charCodeAt(0)-111)+(m.charCodeAt(0)-64),a+=1,m=q[a+1]):"x"===d&&(k=!0,p.Ub=!0,p.Ph=!0,u=3):"y"===d&&("A"<=m&&"O">=m?(k=!0,u=24*(d.charCodeAt(0)-111)+(m.charCodeAt(0)-64),a+=1,m=q[a+1]):(k=!0,p.Ub=!0,p.Ph=!0,u=5))}if(0<=u)if(z||(z=1),f||(0===v[u]&&(p.Zh+=1),v[u]+=z,u>=p.He&&(p.He=u+1)),0<u&&f)for(;0<z;){p.Ge[h][l]=-1===p.u?u:0<=p.u-u?p.u-u:1;if(!p.Ub&&-1===p.u||p.Ub&&u&1||-1!==p.u&&1===u)p.Kb[h][l>>
4]|=1<<(~l&15);l+=1;--z}else l+=z,z=0;k||(" "===d||"\t"===d||"\n"===d?k=!0:b=p.Wg=!0);a+=1;a===n&&(b||(z||(z=1),h+=z,z=0,l>g&&(g=l)),b=!0)}f||(p.width=g,p.height=h,0<g&&0<h&&(g>e.maxWidth||h>e.maxHeight?(p.Oe=!0,p.Wg=!0):(p.Kb=Array.T(Uint16,h,(g-1>>4)+1,0,c,"Pattern.lifeMap"),p.Ge=Array.T(Uint8,h,g,0,c,"Pattern.multiStateMap"),p.Ud="RLE")));p.Wg&&(a=-1);return a},Eq:function(p,e){var f=e.indexOf("\n");-1===f&&(f=e.length);p.wn=e.substring(0,f).trim()},Rj:function(p,e,f){for(var c=!1;e<f&&!c;)" "===
p[e]?e+=1:c=!0;return e},kq:function(p){var q=p.indexOf("\n"),f=0,c,a=!1,n=0;-1===q&&(q=p.length);for(;n<q&&!a;)"="===p[n]?a=!0:" "!==p[n]?a=!0:n+=1;if(a&&"="===p[n]){n=this.Rj(p,n+1,q);for(a=!1;n<q&&!a;)c=e.af.indexOf(p[n]),-1!==c?(f=10*f+c,n+=1):a=!0;this.df=!0;this.Mk=f}},lq:function(p){var q=p.indexOf("\n"),f=0,c=0,a=!1,n=!1,b,k=!1,d=0;-1===q&&(q=p.length);for(;d<q&&!k;)"="===p[d]?k=!0:" "!==p[d]?k=!0:d+=1;if(k&&"="===p[d]&&(d=this.Rj(p,d+1,q),d<q)){"-"===p[d]&&(a=!0,d+=1);for(k=!1;d<q&&!k;)b=
e.af.indexOf(p[d]),-1!==b?(f=10*f+b,d+=1):k=!0;this.tf=!0;this.ol=a?-f:f;d=this.Rj(p,d,q);if(d<q&&","===p[d]&&(d=this.Rj(p,d+1,q),d<q)){"-"===p[d]&&(n=!0,d+=1);for(k=!1;d<q&&!k;)b=e.af.indexOf(p[d]),-1!==b?(c=10*c+b,d+=1):k=!0;this.pl=n?-c:c}}},Jo:function(p){var q=p.indexOf(e.op);0===q&&(q=p.indexOf(e.zn),-1!==q&&this.lq(p.substr(q+e.zn.length)),q=p.indexOf(e.Lm),-1!==q&&this.kq(p.substr(q+e.Lm.length)))},Dq:function(e,q){var f=q.indexOf("\n");-1===f&&(f=q.length);e.name=q.substring(0,f).trim()},
em:function(e,q){var f=q.indexOf("\n");-1===f&&(f=q.length);e.title+=q.substring(0,f)+" ";return f+1},Vc:function(e){var p,f=-1;e+=" ";p=this.af.indexOf(e[this.index]);if(-1!==p)for(f=0;-1!==p;)f=10*f+p,this.index+=1,p=this.af.indexOf(e[this.index]);return f},hp:function(e,q){var f=this.Vc(q);e.od=f;e.be=f},ip:function(e,q){var f=this.Vc(q),c=-1,a=0,n=0,b;if(-1!==f){b=q[this.index];if("-"===b||"+"===b)this.index+=1,a=this.Vc(q),-1===a?f=-1:"-"===b&&(a=-a);if(","===q[this.index])if(this.index+=1,c=
this.Vc(q),-1===c)f=-1;else{if(b=q[this.index],"-"===b||"+"===b)this.index+=1,n=this.Vc(q),-1===n?f=-1:"-"===b&&(n=-n)}else c=f}0!==a&&0!==n&&(f=-1);0===f&&0===c&&(f=-1);0===a&&0===n||0!==f&&0!==c||(f=-1);e.od=f;e.be=c;e.Mh=a;e.Ug=n},cp:function(e,q){var f=this.Vc(q),c=-1,a=0,n=0,b=!1,k=!1,d;if(-1!==f){d=q[this.index];"*"===d&&(b=!0,this.index+=1,d=q[this.index]);if("-"===d||"+"===d)a=this.Vc(q),-1===a?f=-1:"-"===d&&(a=-a),this.index+=1,d=q[this.index];if(","===d)if(this.index+=1,c=this.Vc(q),-1===
c)f=-1;else{if(d=q[this.index],"*"===d&&(k=!0,this.index+=1,d=q[this.index]),"-"===d||"+"===d)this.index+=1,n=this.Vc(q),-1===n?f=-1:"-"===d&&(n=-n)}else c=f}b&&k&&(f=-1);0!==a&&0!==n&&(f=-1);if(b&&0!==n||k&&0!==a)f=-1;if(0===f||0===c)f=-1;b||k||(b=!0);e.od=f;e.be=c;e.Mh=a;e.Ug=n;e.Qk=b;e.mj=k},bp:function(e,q){var f=this.Vc(q),c=-1;-1!==f&&(","===q[this.index]?(this.index+=1,c=this.Vc(q),-1===c&&(f=-1)):c=f);e.od=f;e.be=c},fp:function(e,q){var f=this.Vc(q),c=-1;-1!==f&&(","===q[this.index]?(this.index+=
1,c=this.Vc(q),-1===c&&(f=-1)):c=f);0===f&&0===c&&(f=-1);e.od=f;e.be=c},$o:function(e,q){var f=!1;q=this.Bn(q).toLowerCase();if(""!==q){e.xe=this.mm.indexOf(q[0]);if(-1!==e.xe)switch(this.index=1,e.xe){case 0:this.fp(e,q);break;case 1:this.ip(e,q);break;case 2:this.cp(e,q);break;case 3:this.bp(e,q);break;case 4:this.hp(e,q);break;default:e.od=-1}-1!==e.od?f=!0:(e.xe=-1,this.reason="Invalid bounded grid definition '"+q+"'")}return f},gp:function(p,q){var f=q.indexOf("\n"),c=q.indexOf("rule"),a,n=e.Vm.length,
b="";-1===f&&(f=q.length);-1!==c&&(b=q.substring(c+4,f).trim(),"="===b[0]&&(b=b.substring(1).trim()));p.ra=b;c=b.lastIndexOf(e.Go);-1!==c&&(this.$o(p,b.substring(c+1))?b=b.substr(0,c).trim():c=-2);a=b.toLowerCase().lastIndexOf(e.Vm);-1!==a&&a===b.length-n&&(p.Ub=!0,b=b.substr(0,b.length-n).trim());this.Mg(p,b)&&-2!==c?this.Ka=!0:this.Sg=!0;return f+1},Fo:function(e){switch(e){case 0:e="Plane";break;case 1:e="Torus";break;case 2:e="Klein bottle";break;case 3:e="Cross-surface";break;case 4:e="Sphere";
break;default:e="(unknown)"}return e},ym:function(p,q,f){var c=0,a=q.length,n,b=!1,k=!1;n=this.Yc;var d=e.Np,m;p.xe=-1;p.width=0;p.height=0;p.Oe=!1;p.Kb=null;p.Ge=null;p.Wg=!1;p.Ub=!1;p.Ph=!1;p.M=!1;p.Qe=-1;p.Be=!1;p.u=-1;p.title="";p.He=2;for(m=p.Zh=0;m<d;m+=1)n[m]=0;for(q+=" ";c<a&&!p.Wg;)switch(n=q[c],n){case "#":c+=1;n=q[c];c+=1;switch(n){case "N":this.Dq(p,q.substring(c));break;case "O":this.Eq(p,q.substring(c));break;case "C":this.Jo(q.substring(c))}c+=this.em(p,q.substring(c));break;case "x":c+=
this.gp(p,q.substring(c));k=!0;break;case "\n":c+=1;break;default:b?c+=this.em(p,q.substring(c)):(b=!0,-1!==this.zm(p,q.substring(c),!1,f)&&(c+=this.zm(p,q.substring(c),!0,f)))}k||(this.Mg(p,"")?this.Ka=!0:this.Sg=!0);-1!==p.xe&&(p.width>p.od&&0!==p.od||p.height>p.be&&0!==p.be)&&(this.Fa="Pattern larger than bounded grid",this.Ka=!1);-1!==p.u&&p.Ub&&(this.Fa="[R]History not valid with Generations",this.Ka=p.Ub=!1);-1!==p.u&&this.ai[0]&&(this.Fa="Generations does not support B0",this.Ka=!1);this.Ka&&
(p.Ph?8<p.He&&(this.Fa="Illegal state in pattern for Niemiec",this.Ka=!1):p.Ub?7<p.He&&(this.Fa="Illegal state in pattern for [R]History",this.Ka=!1):-1!==p.u&&p.He>p.u&&(this.Fa="Illegal state in pattern for Generations",this.Ka=!1))},create:function(e,q,f){e=new A(e);this.Ka=this.Sg=this.Oe=!1;this.Fa="";this.df=!1;this.Mk=0;this.tf=!1;this.pl=this.ol=0;if("!"===q.substr(0,1)||"O"===q.substr(0,1)||"."===q.substr(0,1)||"*"===q.substr(0,1)||"o"===q.substr(0,1))this.ap(e,q,f),this.Ka=!0;null===e.Kb&&
(this.Ka=!1,"#Life 1.05"===q.substr(0,10)?(this.xm(e,q,!0,f),this.Ka=!0):"#Life 1.06"===q.substr(0,10)?(this.Zo(e,q,f),this.Ka=!0):"#"===q[0]||"x"===q[0]?(this.ym(e,q,f),null!==e.Kb||e.Oe||e.Wg||(this.xm(e,q,!1,f),this.Ka=!0,this.Sg=!1,e.Ge=null,e.Ub=!1,e.He=2,e.Zh=0)):this.ym(e,q,f));e.Oe&&(this.Fa="Pattern too big (maximum "+this.maxWidth+"x"+this.maxHeight+")",this.Oe=!0,this.Ka=!1);null===e.Kb&&(e.Oe||(this.Fa="Invalid pattern"),e=null,this.Ka=!1);return e}};window.PatternManager=e;window.Pattern=
A})();(function(){function r(){this.wk=[]}r.prototype.add=function(e,p,q){this.wk[this.wk.length]=e<<16|p<<8|q};var A={ue:[],bi:[],Ym:!1,Ak:[48,48,48,0,255,127,127,0,255,148,148,148,128,255,0,255,0,128,0,128,255,1,159,0,159,0,1,255,254,96,0,1,159,96,255,254,254,96,255,126,125,21,21,126,125,125,21,126,255,116,116,116,255,116,116,116,255,228,227,0,28,255,27,255,27,28,0,228,227,227,0,228,27,28,255,59,59,59,234,195,176,175,196,255,171,194,68,194,68,171,68,171,194,72,184,71,184,71,72,71,72,184,169,255,188,252,
179,63,63,252,179,179,63,252,80,9,0,0,80,9,9,0,80,255,175,250,199,134,213,115,100,95,188,163,0,0,188,163,163,0,188,203,73,0,0,203,73,73,0,203,94,189,0,189,0,94,0,94,189,187,243,119,55,125,32,125,32,55,32,55,125,255,102,185,102,185,255,120,209,168,208,166,119,135,96,192,182,255,41,83,153,130,247,88,55,89,247,55,88,55,247,87,75,0,0,87,75,75,0,87,200,135,59,51,213,127,255,255,162,255,37,182,37,182,255,228,57,117,142,163,210,57,117,228,193,255,246,188,107,123,123,194,107,145,59,5,5,145,59,59,5,145,119,
39,198,40,197,23,197,23,40,23,40,197,178,199,158,255,201,121,134,223,223,39,253,84,149,203,15,203,15,149,15,149,203,152,144,90,143,75,139,71,97,132,224,65,219,65,219,224,255,255,40,218,223,69,74,241,0,241,0,74,0,74,241,122,171,51,220,211,227,61,127,87,90,124,176,36,39,13,165,142,255,255,38,255,38,255,255,83,50,107,224,142,165,255,181,9,9,255,181,181,9,255,140,238,70,255,74,5,74,5,255,138,84,51,31,172,101,177,115,17,221,0,0,0,221,0,0,0,221,220,255,200,0,41,50,255,150,205,178,45,116,113,255,189,47,
0,44,40,119,171,205,107,255,177,115,172,133,73,236,109,0,168,168,46,207,188,181,203,212,188,35,90,97,52,39,209,184,41,164,152,227,46,70,46,70,227,211,156,255,98,146,222,136,56,95,102,54,152,86,142,0,142,0,86,0,86,142,86,223,96,246,135,46,4,208,120,212,233,158,177,92,214,104,147,88,149,240,147,227,93,148,72,255,133,209,27,194,147,255,255,44,93,0,160,36,158,182,233,0,96,94,217,218,103,88,163,154,38,118,114,139,94,0,43,113,164,174,168,188,114,0,23,119,42,86,93,255,226,202,80,191,155,255,158,136,0,247,
62,234,146,88,0,183,229,110,212,36,0,143,161,105,191,210,133,164,0,41,30,89,164,0,132,30,89,42,178,222,217,121,22,11,221,107,22,69,151,255,45,158,3,158,3,45,3,45,158,86,42,29,9,122,22,213,209,110,53,221,57,159,101,91,93,140,45,247,213,37,185,34,0,0,185,34,34,0,185,236,0,172,210,180,78,231,107,221,162,49,43,43,162,49,49,43,162,36,248,213,114,0,214,213,36,248,149,34,243,185,158,167,144,122,224,34,245,149,255,31,98,31,98,255,152,200,193,255,80,95,128,123,63,102,62,72,255,62,148,151,226,108,159,99,255,
226,255,126,98,223,136,80,95,255,225,153,15,73,41,211,212,71,41,83,217,187,180,235,79,0,166,127,251,135,243,229,41,0,41,0,229,82,255,216,141,174,249,249,215,255,167,31,79,31,79,167,213,102,185,255,215,83,4,2,40,224,171,220,41,0,4,6,50,90,221,15,113,15,113,221,33,0,115,108,23,90,182,215,36],zk:[],kc:{aliceblue:["AliceBlue",240,248,255],antiquewhite:["AntiqueWhite",250,235,215],aqua:["Aqua",0,255,255],aquamarine:["Aquamarine",127,255,212],azure:["Azure",240,255,255],beige:["Beige",245,245,220],bisque:["Bisque",
255,228,196],black:["Black",0,0,0],blanchedalmond:["BlanchedAlmond",255,235,205],blue:["Blue",0,0,255],blueviolet:["BlueViolet",138,43,226],brown:["Brown",165,42,42],burlywood:["BurlyWood",222,184,135],cadetblue:["CadetBlue",95,158,160],chartreuse:["Chartreuse",127,255,0],chocolate:["Chocolate",210,105,30],coral:["Coral",255,127,80],cornflowerblue:["CornflowerBlue",100,149,237],cornsilk:["Cornsilk",255,248,220],crimson:["Crimson",220,20,60],cyan:["Cyan",0,255,255],darkblue:["DarkBlue",0,0,139],darkcyan:["DarkCyan",
0,139,139],darkgoldenrod:["DarkGoldenRod",184,134,11],darkgray:["DarkGray",169,169,169],darkgreen:["DarkGreen",0,100,0],darkkhaki:["DarkKhaki",189,183,107],darkmagenta:["DarkMagenta",139,0,139],darkolivegreen:["DarkOliveGreen",85,107,47],darkorange:["DarkOrange",255,140,0],darkorchid:["DarkOrchid",153,50,204],darkred:["DarkRed",139,0,0],darksalmon:["DarkSalmon",233,150,122],darkseagreen:["DarkSeaGreen",143,188,143],darkslateblue:["DarkSlateBlue",72,61,139],darkslategray:["DarkSlateGray",47,79,79],
darkturquoise:["DarkTurquoise",0,206,209],darkviolet:["DarkViolet",148,0,211],deeppink:["DeepPink",255,20,147],deepskyblue:["DeepSkyBlue",0,191,255],dimgray:["DimGray",105,105,105],dodgerblue:["DodgerBlue",30,144,255],firebrick:["FireBrick",178,34,34],floralwhite:["FloralWhite",255,250,240],forestgreen:["ForestGreen",34,139,34],fuchsia:["Fuchsia",255,0,255],gainsboro:["Gainsboro",220,220,220],ghostwhite:["GhostWhite",248,248,255],gold:["Gold",255,215,0],goldenrod:["GoldenRod",218,165,32],gray:["Gray",
128,128,128],green:["Green",0,128,0],greenyellow:["GreenYellow",173,255,47],honeydew:["HoneyDew",240,255,240],hotpink:["HotPink",255,105,180],indianred:["IndianRed",205,92,92],indigo:["Indigo",75,0,130],ivory:["Ivory",255,255,240],khaki:["Khaki",240,230,140],lavender:["Lavender",230,230,250],lavenderblush:["LavenderBlush",255,240,245],lawngreen:["LawnGreen",124,252,0],lemonchiffon:["LemonChiffon",255,250,205],lightblue:["LightBlue",173,216,230],lightcoral:["LightCoral",240,128,128],lightcyan:["LightCyan",
224,255,255],lightgoldenrodyellow:["LightGoldenRodYellow",250,250,210],lightgray:["LightGray",211,211,211],lightgreen:["LightGreen",144,238,144],lightpink:["LightPink",255,182,193],lightsalmon:["LightSalmon",255,160,122],lightseagreen:["LightSeaGreen",32,178,170],lightskyblue:["LightSkyBlue",135,206,250],lightslategray:["LightSlateGray",119,136,153],lightsteelblue:["LightSteelBlue",176,196,222],lightyellow:["LightYellow",255,255,224],lime:["Lime",0,255,0],limegreen:["LimeGreen",50,205,50],linen:["Linen",
250,240,230],magenta:["Magenta",255,0,255],maroon:["Maroon",128,0,0],mediumaquamarine:["MediumAquaMarine",102,205,170],mediumblue:["MediumBlue",0,0,205],mediumorchid:["MediumOrchid",186,85,211],mediumpurple:["MediumPurple",147,112,219],mediumseagreen:["MediumSeaGreen",60,179,113],mediumslateblue:["MediumSlateBlue",123,104,238],mediumspringgreen:["MediumSpringGreen",0,250,154],mediumturquoise:["MediumTurquoise",72,209,204],mediumvioletred:["MediumVioletRed",199,21,133],midnightblue:["MidnightBlue",
25,25,112],mintcream:["MintCream",245,255,250],mistyrose:["MistyRose",255,228,225],moccasin:["Moccasin",255,228,181],navajowhite:["NavajoWhite",255,222,173],navy:["Navy",0,0,128],oldlace:["OldLace",253,245,230],olive:["Olive",128,128,0],olivedrab:["OliveDrab",107,142,35],orange:["Orange",255,165,0],orangered:["OrangeRed",255,69,0],orchid:["Orchid",218,112,214],palegoldenrod:["PaleGoldenRod",238,232,170],palegreen:["PaleGreen",152,251,152],paleturquoise:["PaleTurquoise",175,238,238],palevioletred:["PaleVioletRed",
219,112,147],papayawhip:["PapayaWhip",255,239,213],peachpuff:["PeachPuff",255,218,185],peru:["Peru",205,133,63],pink:["Pink",255,192,203],plum:["Plum",221,160,221],powderblue:["PowderBlue",176,224,230],purple:["Purple",128,0,128],rebeccapurple:["RebeccaPurple",102,51,153],red:["Red",255,0,0],rosybrown:["RosyBrown",188,143,143],royalblue:["RoyalBlue",65,105,225],saddlebrown:["SaddleBrown",139,69,19],salmon:["Salmon",250,128,114],sandybrown:["SandyBrown",244,164,96],seagreen:["SeaGreen",46,139,87],
seashell:["SeaShell",255,245,238],sienna:["Sienna",160,82,45],silver:["Silver",192,192,192],skyblue:["SkyBlue",135,206,235],slateblue:["SlateBlue",106,90,205],slategray:["SlateGray",112,128,144],snow:["Snow",255,250,250],springgreen:["SpringGreen",0,255,127],steelblue:["SteelBlue",70,130,180],tan:["Tan",210,180,140],teal:["Teal",0,128,128],thistle:["Thistle",216,191,216],tomato:["Tomato",255,99,71],turquoise:["Turquoise",64,224,208],violet:["Violet",238,130,238],wheat:["Wheat",245,222,179],white:["White",
255,255,255],whitesmoke:["WhiteSmoke",245,245,245],yellow:["Yellow",255,255,0],yellowgreen:["YellowGreen",154,205,50]},mr:function(){return this.zk},sm:function(e){for(var p=0,q=!1,f=[];p<this.bi.length&&!q;)e===this.bi[p][0]?q=!0:p+=1;q&&(f=this.ue[this.bi[p][1]].wk);return f},la:function(e){this.bi[this.bi.length]=e},Rd:function(){var e,p=0,q;if(!this.Ym){this.Ym=!0;for(e=q=0;256>e;e+=1)this.zk[e]=this.Ak[q]<<16|this.Ak[q+1]<<8|this.Ak[q+2],q+=3;e=new r;e.add(0,0,0);e.add(0,255,0);e.add(0,0,128);
e.add(216,255,216);e.add(255,0,0);e.add(255,255,0);e.add(96,96,96);e.add(255,128,128);this.ue[p]=e;A.la(["LifeHistory",p]);p+=1;e=new r;e.add(48,48,48);e.add(0,128,255);e.add(255,255,255);e.add(255,128,0);this.ue[p]=e;A.la(["WireWorld",p]);p+=1;e=new r;e.add(0,0,0);e.add(255,255,255);e.add(144,128,112);e.add(144,90,45);e.add(192,192,192);e.add(255,0,0);e.add(255,128,0);e.add(255,255,0);e.add(0,255,0);e.add(0,255,208);e.add(0,192,255);e.add(0,0,255);e.add(192,0,255);e.add(255,64,160);e.add(112,128,
144);e.add(0,128,0);e.add(0,96,128);e.add(160,0,80);e.add(40,40,40);e.add(220,220,220);e.add(140,60,0);e.add(0,160,0);e.add(160,160,250);this.ue[p]=e;A.la(["WWE",p]);A.la(["WWE2",p]);A.la(["WWEJ",p]);A.la(["WWEJ2",p]);A.la(["WWEJ3",p]);p+=1;e=new r;e.add(30,30,30);e.add(0,128,128);e.add(0,255,0);e.add(255,0,0);e.add(255,128,0);e.add(255,255,0);e.add(128,0,128);e.add(128,128,128);e.add(255,255,255);e.add(128,128,255);this.ue[p]=e;A.la(["Novoloop",p]);p+=1;e=new r;e.add(0,0,0);e.add(255,128,0);e.add(255,
0,0);e.add(0,255,0);e.add(0,0,255);e.add(0,190,0);e.add(0,140,0);e.add(255,255,255);e.add(80,80,80);e.add(95,95,95);e.add(128,128,128);e.add(0,64,0);e.add(255,255,0);e.add(64,0,164);e.add(64,32,64);e.add(80,80,100);e.add(95,95,125);e.add(128,255,128);e.add(64,100,100);this.ue[p]=e;A.la(["shapeloop",p]);A.la(["shapeloop-b",p]);A.la(["shapeloop2",p]);A.la(["shapeloop-ltd",p]);A.la(["2armshapeloop-a",p]);A.la(["2armshapeloop2-a",p]);A.la(["shapeloop2a-bounded",p]);A.la(["foodshapeloop",p]);A.la(["foodshapeloop2",
p]);p+=1;e=new r;e.add(0,0,0);e.add(255,255,255);e.add(255,0,0);e.add(0,128,255);e.add(170,0,0);e.add(85,0,0);this.ue[p]=e;A.la(["b3s23mmg",p]);p+=1;e=new r;e.add(0,0,0);e.add(255,0,0);e.add(0,255,0);e.add(0,0,255);e.add(255,255,0);e.add(0,255,255);e.add(255,0,255);e.add(92,36,110);e.add(0,99,140);e.add(176,196,222);e.add(115,61,26);this.ue[p]=e;A.la(["_235_4_O3",p]);A.la(["0_245_5_O4",p]);A.la(["0_245_5_O3",p]);A.la(["58_27_4_O3",p]);A.la(["0_24_4H_O3",p]);A.la(["2_235_4H_O3",p]);A.la(["24_235_4H_O3",
p]);A.la(["3_25_4_O2",p]);A.la(["Snake_O5",p]);A.la(["Mites",p]);A.la(["Mites2",p]);A.la(["Mites3",p]);p+=1;e=new r;e.add(48,48,48);e.add(255,128,0);e.add(0,0,255);e.add(32,32,255);e.add(64,64,255);e.add(96,96,255);this.ue[p]=e;A.la(["Alpha-1",p])}}};window.ColourManager=A})();window.BoundingBox=function(r,A,e,p){this.O=r;this.N=A;this.P=e;this.R=p};(function(){function r(e,p){this.index=p;this.U=e.og[p];this.xa=e.Nf[p];this.h=e.kj[p];this.c=e.Ki[p];this.D=new BoundingBox(0,0,0,0);this.elapsedTime=this.lc=this.jc=this.Xb=0;this.i=-1;this.Mc=this.Y=0;this.b=e}function A(e,p){this.l=e;this.Mb=[];this.kd=[];this.og=[];this.Nf=[];this.kj=[];this.Ki=[];this.b=0;this.index=-1;this.Mp=51;this.me=null;this.jm=p}r.prototype.vq=function(e,p,q){var f=p.length,c=p[0].length,a,n,b,k,d=0,m,g,l=q.pi;q=q.ri;var h,u=0,z=this.h,v=0,D=z[v],L=D.length,P;Array.Fd(this.U,
p);for(a=0;a<f;a+=1){m=this.U[a];for(p=h=0;p<c;p+=1)if(g=m[p])for(n=15;0<=n;--n)g&1<<n&&(k=u,b=h,P=D[d],d+=1,e[k][b]=P&255,e[k][b+1]=P>>8&255,e[k+1][b]=P>>16&255,e[k+1][b+1]=P>>24,k+=2,P=D[d],d+=1,e[k][b]=P&255,e[k][b+1]=P>>8&255,e[k+1][b]=P>>16&255,e[k+1][b+1]=P>>24,k+=2,P=D[d],d+=1,e[k][b]=P&255,e[k][b+1]=P>>8&255,e[k+1][b]=P>>16&255,e[k+1][b+1]=P>>24,k+=2,P=D[d],d+=1,e[k][b]=P&255,e[k][b+1]=P>>8&255,e[k+1][b]=P>>16&255,e[k+1][b+1]=P>>24,k+=2,P=D[d],d+=1,e[k][b]=P&255,e[k][b+1]=P>>8&255,e[k+1][b]=
P>>16&255,e[k+1][b+1]=P>>24,k+=2,P=D[d],d+=1,e[k][b]=P&255,e[k][b+1]=P>>8&255,e[k+1][b]=P>>16&255,e[k+1][b+1]=P>>24,k+=2,P=D[d],d+=1,e[k][b]=P&255,e[k][b+1]=P>>8&255,e[k+1][b]=P>>16&255,e[k+1][b+1]=P>>24,k+=2,P=D[d],d+=1,e[k][b]=P&255,e[k][b+1]=P>>8&255,e[k+1][b]=P>>16&255,e[k+1][b+1]=P>>24,d>=L&&(v+=1,D=z[v],d=0)),h+=l;else h+=l<<4;u+=q}};r.prototype.zq=function(e,p,q){var f=p.length,c=p[0].length,a,n,b,k,d=0,m,g;n=0;var l=q.pi,h=q.ri,u,z=0,v=this.h,D=0,L=v[D],P=L.length,w=v.length;b=this.b.jm;Array.Fd(p,
this.U);for(a=0;a<f;a+=1)for(m=p[a],q=0;q<c;q+=1)(g=m[q])&&(n+=b[g]);if(n)for(a=0;a<f;a+=1){m=p[a];for(q=u=0;q<c;q+=1)if(g=m[q])for(n=15;0<=n;--n)g&1<<n&&(k=z,b=u,L[d]=e[k][b]|e[k][b+1]<<8|e[k+1][b]<<16|e[k+1][b+1]<<24,d+=1,k+=2,L[d]=e[k][b]|e[k][b+1]<<8|e[k+1][b]<<16|e[k+1][b+1]<<24,d+=1,k+=2,L[d]=e[k][b]|e[k][b+1]<<8|e[k+1][b]<<16|e[k+1][b+1]<<24,d+=1,k+=2,L[d]=e[k][b]|e[k][b+1]<<8|e[k+1][b]<<16|e[k+1][b+1]<<24,d+=1,k+=2,L[d]=e[k][b]|e[k][b+1]<<8|e[k+1][b]<<16|e[k+1][b+1]<<24,d+=1,k+=2,L[d]=e[k][b]|
e[k][b+1]<<8|e[k+1][b]<<16|e[k+1][b+1]<<24,d+=1,k+=2,L[d]=e[k][b]|e[k][b+1]<<8|e[k+1][b]<<16|e[k+1][b+1]<<24,d+=1,k+=2,L[d]=e[k][b]|e[k][b+1]<<8|e[k+1][b]<<16|e[k+1][b+1]<<24,d+=1,d>=P&&(D+=1,d=0,D>=w&&(Array.dm(v,"Snapshot.gridBufferRow"),w+=1)),L=v[D]),u+=l;else u+=l<<4;z+=h}};r.prototype.uq=function(e,p,q){var f=p.length,c=p[0].length,a,n,b,k,d=0,m,g,l=q.pi<<3,h=q.ri,u,z=0,v=this.c,D=0,L=v[D],P=L.length,w;Array.Fd(this.xa,p);for(a=0;a<f;a+=1){m=p[a];for(q=u=0;q<c;q+=1)if(g=m[q])for(n=15;0<=n;--n){if(g&
1<<n)for(b=u;b<u+l;b+=4)k=z,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,
e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+
1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,k+=1,w=L[d],d+=1,e[k][b]=w&255,e[k][b+1]=w>>8&255,e[k][b+2]=w>>16&255,e[k][b+3]=w>>24,d>=P&&(D+=1,L=v[D],d=0);u+=l}else u+=l<<4;z+=h}};r.prototype.xq=function(e,p,q){var f=p.length,c=p[0].length,
a,n,b,k,d=0,m,g;n=0;var l=q.pi<<3,h=q.ri,u,z=0,v=this.c,D=0,L=v[D],P=L.length,w=v.length;b=this.b.jm;Array.Fd(p,this.xa);for(a=0;a<f;a+=1)for(m=p[a],q=0;q<c;q+=1)(g=m[q])&&(n+=b[g]);if(n)for(a=0;a<f;a+=1){m=p[a];for(q=u=0;q<c;q+=1)if(g=m[q])for(n=15;0<=n;--n){if(g&1<<n)for(b=u;b<u+l;b+=4)k=z,L[d]=e[k][b]|e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|e[k][b+
1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|
e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,k+=1,L[d]=e[k][b]|e[k][b+1]<<8|e[k][b+2]<<16|e[k][b+3]<<24,d+=1,d>=P&&(D+=1,d=0,D>=w&&(Array.dm(v,"Snapshot.colourGridBufferRow"),w+=1),L=v[D]);u+=l}else u+=l<<4;z+=h}};A.prototype.bufferSize=function(){for(var e=0,p=0;p<this.kd.length;)e+=this.og[p].length*this.og[p][0].length*
2,e+=this.Nf[p].length*this.Nf[p][0].length*2,e+=this.kj[p].length*this.kj[p][0].length*4,e+=this.Ki[p].length*this.Ki[p][0].length*4,p+=1;return e};A.prototype.$q=function(){for(var e=0,p=0;p<this.kd.length;)this.kd[p]&&(e+=1),p+=1;return e};A.prototype.reset=function(){var e=0,p=-1;this.Mb=[];this.index=-1;this.me&&(p=this.me.index);for(;e<this.kd.length;)e!==p&&(this.kd[e]=!1),e+=1};A.prototype.Iq=function(e){var p=null;0<this.Mb.length&&(p=this.Mb[this.index],p.i>e&&(p=null,0<this.index&&(this.c(this.Mb[this.index].index),
this.Mb.pop(),--this.index,0<=this.index&&(p=this.Mb[this.index]))));return p};A.prototype.di=function(e,p,q,f,c,a,n,b,k,d,m,g,l,h,u,z){if(h)m=this.me;else if(51>this.Mb.length)m=this.xk(m,g,!1),this.index+=1;else{this.index+=1;if(51<=this.index){this.index=50;this.c(this.Mb[0].index);for(h=0;50>h;h+=1)this.Mb[h]=this.Mb[h+1];this.Mb.pop();this.xk(m,g,!1)}m=this.Mb[this.index]}m.Y=u;m.Mc=z;m.zq(e,p,l);m.xq(q,f,l);m.D.O=c.O;m.D.P=c.P;m.D.N=c.N;m.D.R=c.R;m.Xb=a;m.jc=n;m.lc=b;m.elapsedTime=k;m.i=d};
A.prototype.c=function(e){this.kd[e]=!1};A.prototype.v=function(e,p){var q,f=0;for(q=!1;f<this.b&&!q;)this.kd[f]?f+=1:q=!0;q?(q=f,this.kd[f]=!0):(this.og[f]=Array.T(Uint16,p,e,0,this.l,"Snapshot.tileGrid"+f),this.Nf[f]=Array.T(Uint16,p,e,0,this.l,"Snapshot.colourTileGrid"+f),this.kj[f]=Array.T(Uint32,1,1024,0,this.l,"Snapshot.gridBuffer"+f),this.Ki[f]=Array.T(Uint32,1,8192,0,this.l,"Snapshot.colourGridBuffer"+f),this.kd[f]=!0,this.b+=1,q=f);return q};A.prototype.xk=function(e,p,q){e=this.v(e,p);e=
new r(this,e);q?this.me=e:this.Mb[this.Mb.length]=e;return e};A.prototype.h=function(e,p,q,f){var c=e.U,a=e.xa,n=e.U.length,b=n>>1,k=e.U[0].length>>1,d=0,m=e.index;this.og[m]=Array.T(Uint16,q,p,0,this.l,"Snapshot.tileGrid"+m);this.Nf[m]=Array.T(Uint16,q,p,0,this.l,"Snapshot.colourTileGrid"+m);e.U=this.og[m];for(e.xa=this.Nf[m];d<n;)e.U[d+b].set(c[d],k),e.xa[d+b].set(a[d],k),d+=1;e.D.O+=f;e.D.P+=f;e.D.N+=f;e.D.R+=f};A.prototype.tq=function(e,p,q){var f=0,c=this.Mb.length;for(this.h(this.me,e,p,q);f<
c;)this.h(this.Mb[f],e,p,q),f+=1;for(f=0;f<this.kd.length;)this.kd[f]||(this.og[f]=Array.T(Uint16,p,e,0,this.l,"Snapshot.tileGrid"+f),this.Nf[f]=Array.T(Uint16,p,e,0,this.l,"Snapshot.colourTileGrid"+f)),f+=1};window.SnapshotManager=A;window.Snapshot=r})();(function(){function r(f,c,a){this.Ra=c;this.Na=f;this.gc=a}function A(f,c,a){this.red=f;this.green=c;this.blue=a}function e(f,c){this.J=f;this.ca=c}function p(f,c,a,n,b){this.l=new Allocator;this.oc=this.l.ga(Uint8,65536,"Life.bitCounts16");this.Dg();this.Hc=this.l.ga(Uint32,q.$g,"Life.popGraphData");this.gd=this.l.ga(Uint32,q.$g,"Life.birthGraphData");this.Hd=this.l.ga(Uint32,q.$g,"Life.deathGraphData");this.xc=this.Tc=this.Ja=0;this.Wb=1;this.Y=0;this.Uj=-1;this.Mc=0;this.Ma=this.pa=this.Ib=-1;
this.Hh=this.Gh=0;this.nm=this.sk=!1;this.Mj=ViewConstants.Am;this.pc=[];this.qc=[];this.pc[0]=this.l.ga(Int32,q.sl,"Life.boundaryX0");this.qc[0]=this.l.ga(Int32,q.sl,"Life.boundaryY0");this.uf=0;this.Ig=4294967295;this.Qe=-1;this.Be=this.Kj=this.M=!1;this.u=-1;this.we=this.sc=!1;this.elapsedTime=0;this.Xc=new SnapshotManager(this.l,this.oc);this.bg=q.ii;this.Bb=this.Wn=!1;this.Kf=this.Ia=this.cc=this.D=null;this.title="LifeViewer";this.width=n;this.height=b;this.pi=2;this.ri=16;this.c=this.width>>
4;this.h=this.height>>4;this.me=this.Xc.xk((this.c-1>>4)+1,this.h,!0);this.s=c;this.m=a;this.lc=this.jc=this.Xb=0;this.W=64;this.H=127;this.Gc=63;this.Fc=1;this.bl=this.gc=0;this.Mf=this.Ed=this.o=1;this.rm=30;this.angle=this.i=0;this.zoom=6;this.A=this.F=0;this.tc=.1;this.qb=0;this.K=1;this.sb=this.rb=0;this.b=.1;this.hf=littleEndian;this.fc=[];this.hb=this.aa=this.fa=this.ic=this.ua=this.Ba=null;this.wc=12;this.Hb=this.$b=this.ce=null;this.dd=f;this.Ua=this.Pa=0;this.U=Array.T(Uint16,this.h,(this.c-
1>>4)+1,0,this.l,"Life.tileGrid");this.oa=Array.T(Uint16,this.h,(this.c-1>>4)+1,0,this.l,"Life.nextTileGrid");this.fb=Array.T(Uint8,this.height,(this.width-1>>3)+1,0,this.l,"Life.grid");this.zb=Array.T(Uint8,this.height,(this.width-1>>3)+1,0,this.l,"Life.nextGrid");this.ib=Array.kf(this.fb,"Life.grid16");this.X=Array.kf(this.zb,"Life.nextGrid16");this.md=this.l.ga(Uint32,this.s,"Life.blankPixelRow");this.Aa=this.l.ga(Uint8,(this.width-1>>3)+1,"Life.blankRow");this.Fb=this.l.ga(Uint16,this.c>>4,"Life.blankTileRow");
this.ld=this.l.ga(Uint8,this.width,"Life.blankColourRow");this.ma=Array.T(Uint8,this.height,this.width,this.gc,this.l,"Life.colourGrid");this.v=Array.T(Uint8,this.height,this.width,this.gc,this.l,"Life.smallColourGrid");this.ha=Array.rd(this.v,1,"Life.smallColourGrid4");this.ia=Array.rd(this.v,3,"Life.smallColourGrid8");this.Qa=Array.rd(this.v,7,"Life.smallColourGrid16");this.vf=Array.kf(this.ma,"Life.colourGrid16");this.Qd=this.Ec=this.hc=this.Zb=this.L=this.ec=null;this.xa=Array.T(Uint16,this.h,
(this.c-1>>4)+1,0,this.l,"Life.colourTileGrid");this.Ea=Array.T(Uint16,this.h,(this.c-1>>4)+1,0,this.l,"Life.colourTileHistoryGrid");this.Vd=this.Qb=this.Rb=this.$a=null;this.Wc=this.l.ga(Uint8,256,"Life.redChannel");this.Oc=this.l.ga(Uint8,256,"Life.greenChannel");this.Kc=this.l.ga(Uint8,256,"Life.blueChannel");this.ke=this.l.ga(Uint32,256,"Life.pixelColours");this.l.ga(Uint8,q.Sm,"Life.indexLookup33");this.Id=this.l.ga(Uint8,q.Tk,"Life.indexLookup63");this.Pd=this.l.ga(Uint8,q.Tk,"Life.indexLookup632");
this.zf=this.l.ga(Uint8,2*(this.H+1),"Life.colourLookup");this.Df=this.l.ga(Uint8,1048576,"Life.colourReset");this.Qc=this.lj=5263440;this.fe=-1;this.Od=this.Rk=7368816;this.ee=-1;this.Cg=13750737;this.Ue=15066597;this.Pc=10;this.ef=!0;this.nd=this.l.ga(Uint16,(this.width-1>>4)+1,"Life.columnOccupied16");this.jb=8192;this.Ap=[0,0,48];this.zp=[255,255,255];this.yp=[255,255,255];this.Bp=[0,255,0];this.Cp=[255,0,0];this.Ld=[0,0,48];this.Kd=[255,255,255];this.Jd=[255,255,255];this.Md=[0,255,0];this.Nd=
[255,0,0]}var q={sl:4096,Sm:512,Tk:262144,ii:50,lm:255,$g:1E5,pd:1,yd:2,Ad:4,jd:8,oe:16,pe:32,Yd:64,Zd:128};r.prototype.Ep=function(){var f=!0;this.Ra.J.Xk(this.Ra.ca)&&this.Na.J.Xk(this.Na.ca)&&this.Na.J.Xk(this.gc)&&(f=!1);return f};A.prototype.set=function(f){this.red=f.red;this.green=f.green;this.blue=f.blue};A.prototype.Xk=function(f){var c=!1;this.red===f.red&&this.green===f.green&&this.blue===f.blue&&(c=!0);return c};e.prototype.set=function(f){this.J.set(f.J);this.ca.set(f.ca)};p.prototype.Nk=
function(f,c,a){var n=0,b,k=ViewConstants.Ha[3]+128,d=ViewConstants.Ha[4]+128,m=ViewConstants.Ha[5]+128,g=ViewConstants.Ha[6]+128;f===(f&this.Pa)&&c===(c&this.Ua)&&(b=this.ma[c][f],a||-1!==this.u?-1!==this.u&&0<b?n=this.u-b:n=b:this.ec?(f=this.ec[c][f],f===d||f===g?(b>=this.W&&(f=k),n=ViewConstants.Ha[f-128]):f===k||f===m?(b<this.W&&(f=d),n=ViewConstants.Ha[f-128]):n=b===this.gc?0:b<=this.Gc?2:1):n=b<=this.Gc?0:1);return n};p.prototype.oi=function(f){var c,a,n,b,k=f.length,d=f[0].length,m=this.oc,
g=0;for(a=0;a<k;a+=1)for(c=f[a],n=0;n<d;n+=1)(b=c[n])&&(g+=m[b]);return g};p.prototype.ci=function(f,c,a,n){var b=this.Xc.Mb.length,k=this.Xc.Iq(f),d=!0;b!==this.Xc.Mb.length&&(this.bg-=q.ii);if(k){for(this.We(k);this.i<f-1;)this.ag(!1,this.elapsedTime,!0,n),this.Kg();this.i<f&&this.ag(c,this.elapsedTime,!0,n);d=this.Kg();this.elapsedTime=a-(a-k.elapsedTime)/(f-k.i+1)}return d};p.prototype.We=function(f){var c,a,n,b,k,d,m=this.Aa,g=this.ld;this.i=f.i;this.i&1?(c=this.zb,a=this.fb,n=this.oa,b=this.U):
(c=this.fb,a=this.zb,n=this.U,b=this.oa);d=c.length;for(k=0;k<d;k+=1)c[k].set(m),this.ma[k].set(g),this.v[k].set(g);Array.Fd(c,a);Array.Fd(this.Ea,this.xa);f.vq(c,n,this);f.uq(this.ma,this.Ea,this);Array.Fd(n,b);Array.Fd(c,a);this.D.O=f.D.O;this.D.N=f.D.N;this.D.P=f.D.P;this.D.R=f.D.R;this.Xb=f.Xb;this.jc=f.jc;this.lc=f.lc;this.elapsedTime=f.elapsedTime;this.Y=f.Y;this.Mc=f.Mc};p.prototype.di=function(f){var c,a;this.i&1?(c=this.zb,a=this.oa):(c=this.fb,a=this.U);this.Jf(!1,c,a,f)};p.prototype.ul=
function(f){this.We(this.me);this.Xc.reset();this.bg=q.ii;f||this.di(0)};p.prototype.Jf=function(f,c,a,n){this.Xc.di(c,a,this.ma,this.Ea,this.D,this.Xb,this.jc,this.lc,n,this.i,(this.c-1>>4)+1,this.h,this,f,this.Y,this.Mc)};p.prototype.yq=function(f){this.Xc.reset();this.Jf(!0,this.fb,this.U,0);f||this.di(0)};p.prototype.Rm=function(){var f=this.fb,c=this.zb,a=this.ma,n=this.v,b=this.ec,k=this.L,d=this.$a,m=this.Qb,g=this.Rb,l=this.Vd,h=this.U,u=this.oa,z=this.xa,v=this.Ea,D=this.height,e=this.h,
p=this.width>>1,w=this.height>>1,q;if(8192>this.width){this.width*=2;this.height*=2;this.fb=Array.T(Uint8,this.height,(this.width-1>>3)+1,0,this.l,"Life.grid");this.zb=Array.T(Uint8,this.height,(this.width-1>>3)+1,0,this.l,"Life.nextGrid");this.ib=Array.kf(this.fb,"Life.grid16");this.X=Array.kf(this.zb,"Life.nextGrid16");d&&(this.$a=Array.T(Uint16,this.height,(this.width-1>>4)+1,0,this.l,"Life.state6Mask"),this.Qb=Array.T(Uint16,this.height,(this.width-1>>4)+1,0,this.l,"Life.state6Alive"),this.Rb=
Array.T(Uint16,this.height,(this.width-1>>4)+1,0,this.l,"Life.state6Cells"));this.c=this.width>>4;this.h=this.height>>4;d&&(this.Vd=Array.T(Uint16,this.h,(this.c-1>>4)+1,0,this.l,"Life.state6TileGrid"));this.U=Array.T(Uint16,this.h,(this.c-1>>4)+1,0,this.l,"Life.tileGrid");this.oa=Array.T(Uint16,this.h,(this.c-1>>4)+1,0,this.l,"Life.nextTileGrid");this.xa=Array.T(Uint16,this.h,(this.c-1>>4)+1,0,this.l,"Life.colourTileGrid");this.Ea=Array.T(Uint16,this.h,(this.c-1>>4)+1,0,this.l,"Life.colourTileHistoryGrid");
this.Aa=this.l.ga(Uint8,(this.width-1>>3)+1,"Life.blankRow");this.Fb=this.l.ga(Uint16,this.c>>4,"Life.blankTileRow");this.ld=this.l.ga(Uint8,this.width,"Life.blankColourRow");this.nd=this.l.ga(Uint16,(this.width-1>>4)+1,"Life.columnOccupied16");this.ma=Array.T(Uint8,this.height,this.width,this.gc,this.l,"Life.colourGrid");this.v=Array.T(Uint8,this.height,this.width,this.gc,this.l,"Life.smallColourGrid");this.ha=Array.rd(this.v,1,"Life.smallColourGrid4");this.ia=Array.rd(this.v,3,"Life.smallColourGrid8");
this.Qa=Array.rd(this.v,7,"Life.smallColourGrid16");this.vf=Array.kf(this.ma,"Life.colourGrid16");b&&(this.ec=Array.T(Uint8,this.height,this.width,this.gc,this.l,"Life.overlayGrid"),this.L=Array.T(Uint8,this.height,this.width,this.gc,this.l,"Life.smallOverlayGrid"),this.Zb=Array.rd(this.L,1,"Life.smallColourGrid4"),this.hc=Array.rd(this.L,3,"Life.smallColourGrid8"),this.Ec=Array.rd(this.L,7,"Life.smallColourGrid16"),this.Qd=Array.kf(this.ec,"Life.overlayGrid16"));this.Pa=this.width-1;this.Ua=this.height-
1;for(q=0;q<D;q+=1)this.fb[q+w].set(f[q],p>>3),this.zb[q+w].set(c[q],p>>3),this.ma[q+w].set(a[q],p),this.v[q+w].set(n[q],p),b&&(this.ec[q+w].set(b[q],p),this.L[q+w].set(k[q],p)),d&&(this.$a[q+w].set(d[q],p>>4),this.Qb[q+w].set(m[q],p>>4),this.Rb[q+w].set(g[q],p>>4));w=e>>1;for(q=0;q<e;q+=1)d&&this.Vd[q+w].set(l[q],this.Vd[q].length>>2),this.U[q+w].set(h[q],this.U[q].length>>2),this.oa[q+w].set(u[q],this.oa[q].length>>2),this.xa[q+w].set(z[q],this.xa[q].length>>2),this.Ea[q+w].set(v[q],this.Ea[q].length>>
2);p=this.width>>2;w=this.height>>2;this.Xc.tq((this.c-1>>4)+1,this.h,p);this.F+=p;this.A+=w;this.M&&(this.F-=w/2|0);this.D.O+=p;this.D.P+=p;this.D.R+=w;this.D.N+=w;this.cc.O+=p;this.cc.P+=p;this.cc.R+=w;this.cc.N+=w;this.Ia.O+=p;this.Ia.P+=p;this.Ia.R+=w;this.Ia.N+=w}};p.prototype.Ko=function(f){var c=this.D,a=this.width,n=this.height,b=!1;8192>a&&this.Y&&(c.O<=f||c.N<=f||c.P>=a-f||c.R>=n-f)&&(this.Rm(),b=!0);return b};p.prototype.Dg=function(){var f,c,a,n=this.oc;for(f=0;65536>f;f+=1){c=f;for(a=
0;c;a+=1)c&=c-1;n[f]=a}};p.prototype.Eg=function(){var f,c,a=this.Df,n=this.W;for(f=0;65536>f;f+=1)for(c=0;16>c;c+=1)a[(f<<4)+c]=f&1<<15-c?n:0};p.prototype.rq=function(f){var c,a,n,b=0,k,d=this.oc;c=this.D;var m=c.O>>4,g=c.P>>4,l=c.R;for(c=c.N;c<=l;c+=1)for(n=f[c],a=m;a<=g;a+=1)k=d[n[a]],b+=k;this.Xb=b;this.lc=this.jc=0};p.prototype.Fn=function(f,c){var a=this.dd,n;n=this.hf?4278190080:255;this.s=f;this.m=c;this.ce=this.$b=this.Hb=null;this.Hb=a.createImageData(a.canvas.width,a.canvas.height);this.Hb.data.buffer?
this.$b=new Uint32Array(this.Hb.data.buffer):(this.$b=new Uint32Array(this.Hb.data.length>>2),this.ce=new Uint8Array(this.$b.buffer));this.md=this.l.ga(Uint32,f,"Life.blankPixelRow");for(a=0;a<f;a+=1)this.md[a]=n;this.wg()};p.prototype.Oo=function(f,c,a){var n,b=this.ma,k,d=f.width,m=f.height;c=(this.width-d>>1)+c;var g=(this.height-m>>1)+a,l=this.Pa,h=this.Ua,u,z=this.Fc,v=ViewConstants.Ha[2];for(n=0;n<m;n+=1)for(u=f.Ge[n],k=b[n+g&h],a=0;a<d;a+=1)u[a]===v&&(k[a+c&l]=z)};p.prototype.up=function(){this.Qd=
this.L=this.ec=null};p.prototype.Vo=function(){this.ec=Array.T(Uint8,this.height,this.width,this.gc,this.l,"Life.overlayGrid");this.L=Array.T(Uint8,this.height,this.width,this.gc,this.l,"Life.smallOverlayGrid");this.Zb=Array.rd(this.L,1,"Life.smallOverlayGrid4");this.hc=Array.rd(this.L,3,"Life.smallOverlayGrid8");this.Ec=Array.rd(this.L,7,"Life.smallOverlayGrid16");this.Qd=Array.kf(this.ec,"Life.overlayGrid16")};p.prototype.vp=function(){this.Vd=this.Rb=this.Qb=this.$a=null};p.prototype.Xo=function(){this.$a=
Array.T(Uint16,this.height,(this.width-1>>4)+1,0,this.l,"Life.state6Mask");this.Qb=Array.T(Uint16,this.height,(this.width-1>>4)+1,0,this.l,"Life.state6Alive");this.Rb=Array.T(Uint16,this.height,(this.width-1>>4)+1,0,this.l,"Life.state6Cells");this.Vd=Array.T(Uint16,this.h,(this.c-1>>4)+1,0,this.l,"Life.state6TileGrid")};p.prototype.cq=function(f,c,a){var n,b,k,d,m,g=f.width,l=f.height;c=(this.width-g>>1)+c;var h=(this.height-l>>1)+a,u=this.Pa,z=this.Ua,v,D,e=this.Vd,p,w,q;for(n=0;n<l;n+=1)for(v=f.Ge[n],
b=this.$a[n-1+h&z],k=this.$a[n+h&z],d=this.$a[n+1+h&z],m=this.Rb[n+h&z],p=e[(n-1+h&z)>>4],w=e[(n+h&z)>>4],q=e[(n+1+h&z)>>4],a=0;a<g;a+=1)6===v[a]&&(D=a+c&u,m[D>>4]|=1<<(~D&15),b[D>>4]|=1<<(~D&15),k[D>>4]|=1<<(~D&15),d[D>>4]|=1<<(~D&15),p[D>>8]|=1<<(~(D>>4)&15),w[D>>8]|=1<<(~(D>>4)&15),q[D>>8]|=1<<(~(D>>4)&15),D=a-1+c&u,b[D>>4]|=1<<(~D&15),k[D>>4]|=1<<(~D&15),d[D>>4]|=1<<(~D&15),p[D>>8]|=1<<(~(D>>4)&15),w[D>>8]|=1<<(~(D>>4)&15),q[D>>8]|=1<<(~(D>>4)&15),D=a+1+c&u,b[D>>4]|=1<<(~D&15),k[D>>4]|=1<<(~D&
15),d[D>>4]|=1<<(~D&15),p[D>>8]|=1<<(~(D>>4)&15),w[D>>8]|=1<<(~(D>>4)&15),q[D>>8]|=1<<(~(D>>4)&15))};p.prototype.qq=function(f){var c,a,n,b=this.ma,k=this.Df,d,m,g;c=this.D;var l=c.O>>4,h=c.P>>4,u=c.R;for(a=c.N;a<=u;a+=1)for(d=f[a],m=b[a],n=l<<4,c=l;c<=h;c+=1)g=d[c]<<4,m[n]=k[g+0],n+=1,m[n]=k[g+1],n+=1,m[n]=k[g+2],n+=1,m[n]=k[g+3],n+=1,m[n]=k[g+4],n+=1,m[n]=k[g+5],n+=1,m[n]=k[g+6],n+=1,m[n]=k[g+7],n+=1,m[n]=k[g+8],n+=1,m[n]=k[g+9],n+=1,m[n]=k[g+10],n+=1,m[n]=k[g+11],n+=1,m[n]=k[g+12],n+=1,m[n]=k[g+
13],n+=1,m[n]=k[g+14],n+=1,m[n]=k[g+15],n+=1};p.prototype.Gp=function(f,c,a){var n=this.gc,b=this.Aa,k=this.ld,d=this.md,m=this.Fb,g;g=this.hf?4278190080:255;this.we=!1;this.Pa=this.width-1;this.Ua=this.height-1;this.D=new BoundingBox(0,0,this.width-1,this.height-1);this.cc=new BoundingBox(0,0,this.width-1,this.height-1);this.Ia=new BoundingBox(0,0,this.width-1,this.height-1);this.Kf=new BoundingBox(0,0,this.width-1,this.height-1);this.dd=f;this.Eg();AliasManager.Rd();this.Fn(c,a);a=(this.width-1>>
3)+1;for(f=0;f<a;f+=1)b[f]=0;a=this.width;for(f=0;f<a;f+=1)k[f]=n;a=this.c>>4;for(f=0;f<a;f+=1)m[f]=0;for(f=0;f<c;f+=1)d[f]=g};p.prototype.Ro=function(){var f=0;this.fc[f]=new r(new e(new A(0,0,0),new A(0,0,0)),new e(new A(255,255,255),new A(255,255,255)),new A(0,0,0));f+=1;this.fc[f]=new r(new e(new A(0,0,47),new A(0,0,255)),new e(new A(0,255,255),new A(255,255,255)),new A(0,0,0));f+=1;this.fc[f]=new r(new e(new A(32,0,0),new A(160,0,0)),new e(new A(255,144,0),new A(255,255,0)),new A(0,0,0));f+=
1;this.fc[f]=new r(new e(new A(0,24,0),new A(0,128,0)),new e(new A(0,255,255),new A(255,255,255)),new A(0,0,0));f+=1;this.fc[f]=new r(new e(new A(0,47,0),new A(128,0,128)),new e(new A(255,255,0),new A(255,255,255)),new A(0,32,128));f+=1;this.fc[f]=new r(new e(new A(16,16,16),new A(104,104,104)),new e(new A(176,176,176),new A(255,255,255)),new A(0,0,0));f+=1;this.fc[f]=new r(new e(new A(255,255,255),new A(255,255,255)),new e(new A(0,0,0),new A(0,0,0)),new A(255,255,255));f+=1;this.fc[f]=new r(new e(new A(240,
240,240),new A(0,255,255)),new e(new A(0,0,255),new A(0,0,0)),new A(255,255,255));f+=1;this.fc[f]=new r(new e(new A(240,240,240),new A(240,240,240)),new e(new A(240,240,240),new A(240,240,240)),new A(0,0,0));f+=1;this.fc[f]=new r(new e(new A(160,0,0),new A(160,0,0)),new e(new A(240,240,240),new A(240,240,240)),new A(0,0,0));f+=1;this.fc[f]=new r(new e(new A(0,0,96),new A(0,0,160)),new e(new A(0,240,0),new A(16,255,16)),new A(0,0,0));f+=1;this.fc[f]=new r(new e(new A(255,255,0),new A(255,255,0)),new e(new A(255,
0,0),new A(255,0,0)),new A(0,0,0));this.fc[f+1]=new r(new e(new A(0,0,0),new A(0,0,0)),new e(new A(0,0,0),new A(0,0,0)),new A(0,0,0));this.ua=new e(new A(0,0,0),new A(0,0,0));this.Ba=new e(new A(0,0,0),new A(0,0,0));this.ic=new A(0,0,0);this.aa=new e(new A(0,0,0),new A(0,0,0));this.fa=new e(new A(0,0,0),new A(0,0,0));this.hb=new A(0,0,0)};p.prototype.Me=function(f,c){var a=this.fc[f];this.Ed=f;this.ua.set(this.aa);this.Ba.set(this.fa);this.ic.set(this.hb);this.aa.set(a.Ra);this.fa.set(a.Na);this.hb.set(a.gc);
this.Mf=c;this.Wn=a.Ep();if(this.Qc===this.lj||this.Qc===this.Ue)128<=(this.hb.red+this.hb.green+this.hb.blue)/3?(this.Qc=this.Ue,this.Od=this.Cg):(this.Qc=this.lj,this.Od=this.Rk)};p.prototype.Qo=function(){var f,c,a,n,b,k;f=this.zf;c=this.H;a=this.W;n=this.Fc;b=this.Gc;f[0]=0;f[c+1]=a;for(k=1;k<c+1;k+=1)f[k]=Math.min(Math.max(k-1,n),b),f[k+c+1]=Math.max(Math.min(k+1,c),a)};p.prototype.vm=function(){var f,c,a,n,b;c=(this.Mf-1)/30;f=0;this.Wc[f]=this.ic.red*c+this.hb.red*(1-c);this.Oc[f]=this.ic.green*
c+this.hb.green*(1-c);this.Kc[f]=this.ic.blue*c+this.hb.blue*(1-c);if(-1!==this.u)for(f=1;f<this.u;f+=1)a=2===this.u?1:1-(f-1)/(this.u-2),n=this.ua.J.red*a+this.Ba.J.red*(1-a),b=this.aa.J.red*a+this.fa.J.red*(1-a),this.Wc[f]=n*c+b*(1-c),n=this.ua.J.green*a+this.Ba.J.green*(1-a),b=this.aa.J.green*a+this.fa.J.green*(1-a),this.Oc[f]=n*c+b*(1-c),n=this.ua.J.blue*a+this.Ba.J.blue*(1-a),b=this.aa.J.blue*a+this.fa.J.blue*(1-a),this.Kc[f]=n*c+b*(1-c);else{for(f=this.Fc;f<=this.Gc;f+=1)a=1-(f-this.Fc)/(this.Gc-
this.Fc),n=this.Ba.J.red*a+this.Ba.ca.red*(1-a),b=this.fa.J.red*a+this.fa.ca.red*(1-a),this.Wc[f]=n*c+b*(1-c),n=this.Ba.J.green*a+this.Ba.ca.green*(1-a),b=this.fa.J.green*a+this.fa.ca.green*(1-a),this.Oc[f]=n*c+b*(1-c),n=this.Ba.J.blue*a+this.Ba.ca.blue*(1-a),b=this.fa.J.blue*a+this.fa.ca.blue*(1-a),this.Kc[f]=n*c+b*(1-c);for(f=this.W;f<=this.H;f+=1)a=1-(f-this.W)/(this.H-this.W),n=this.ua.J.red*a+this.ua.ca.red*(1-a),b=this.aa.J.red*a+this.aa.ca.red*(1-a),this.Wc[f]=n*c+b*(1-c),n=this.ua.J.green*
a+this.ua.ca.green*(1-a),b=this.aa.J.green*a+this.aa.ca.green*(1-a),this.Oc[f]=n*c+b*(1-c),n=this.ua.J.blue*a+this.ua.ca.blue*(1-a),b=this.aa.J.blue*a+this.aa.ca.blue*(1-a),this.Kc[f]=n*c+b*(1-c)}};p.prototype.Uo=function(f){var c=this.Wc,a=this.Oc,n=this.Kc,b,k;for(b=0;b<f.length;b+=1)k=f[b],c[b]=k>>16,a[b]=k>>8&255,n[b]=k&255;this.Mf=0};p.prototype.So=function(f,c){var a=this.Wc,n=this.Oc,b=this.Kc,k=ViewConstants.Ha,d=c.length,m;for(m=0;m<f.length;m+=1)m>=d||-1===c[m]?(a[128+k[m]]=f[m]>>16,n[128+
k[m]]=f[m]>>8&255,b[128+k[m]]=f[m]&255):(a[128+k[m]]=c[m]>>16,n[128+k[m]]=c[m]>>8&255,b[128+k[m]]=c[m]&255)};p.prototype.Sb=function(f){var c=this.Wc,a=this.Oc,n=this.Kc,b=this.ke,k=this.Qc,d=this.Od,m,g=0;if(-1!==this.u)if(this.hf)for(m=0;m<this.u;m+=1)0<m&&(g=this.u-m),b[m]=-16777216|n[g]<<16|a[g]<<8|c[g];else for(m=0;m<this.u;m+=1)0<m&&(g=this.u-m),b[m]=c[g]<<24|a[g]<<16|n[g]<<8|255;else if(this.hf){for(m=0;m<this.W;m+=1)b[m]=-16777216|n[m]<<16|a[m]<<8|c[m];for(m=this.W;m<=this.H;m+=1)b[m]=-16777216|
n[m]*f<<16|a[m]*f<<8|c[m]*f;for(m=this.H+1;256>m;m+=1)b[m]=-16777216|n[m]*f<<16|a[m]*f<<8|c[m]*f}else{for(m=0;m<this.W;m+=1)b[m]=c[m]<<24|a[m]<<16|n[m]<<8|255;for(m=this.W;m<=this.H;m+=1)b[m]=c[m]*f<<24|a[m]*f<<16|n[m]*f<<8|255;for(m=this.H+1;256>m;m+=1)b[m]=c[m]*f<<24|a[m]*f<<16|n[m]*f<<8|255}this.hf?(this.fe=-16777216|(k&255)<<16|(k>>8&255)<<8|k>>16,this.ee=-16777216|(d&255)<<16|(d>>8&255)<<8|d>>16):(this.fe=(k&255)<<24|(k>>8&255)<<16|k>>16<<8|255,this.ee=(d&255)<<24|(d>>8&255)<<16|d>>16<<8|255);
-1!==this.Ib&&(b[q.lm]=this.hf?4286611584:2155905279)};p.prototype.Lo=function(){var f=this.height,c=this.fb,a=this.zb,n=this.ma,b=this.v,k=this.ec,d=this.L,m=this.U,g=this.xa,l=this.Ea,h=this.oa,u=this.Aa,z=this.Fb,v=this.ld,D;for(D=0;D<f;D+=1)c[D].set(u),a[D].set(u),n[D].set(v),b[D].set(v),k&&(k[D].set(v),d[D].set(v));f=this.h;for(D=0;D<f;D+=1)m[D].set(z),h[D].set(z),g[D].set(z),l[D].set(z)};p.prototype.If=function(f,c){var a=q.Tk,n,b;for(n=0;n<a;n+=1)b=c[n>>9&448|n>>6&56|n>>3&7]<<3,b|=c[n>>8&448|
n>>5&56|n>>2&7]<<2,b|=c[n>>7&448|n>>4&56|n>>1&7]<<1,b|=c[n>>6&448|n>>3&56|n&7],f[n]=b};p.prototype.Uq=function(){var f,c,a=PatternManager.ai,n=q.Sm,b=!1;if(-1===this.Qe&&a[0]){if(!a[n-1]){for(f=0;f<n/2;f+=1)c=a[f],a[f]=a[n-f-1],a[n-f-1]=c;b=!0;this.If(this.Pd,a)}for(f=0;f<n/2;f+=1)c=a[f],a[f]=1-a[n-f-1],a[n-f-1]=1-c}this.If(this.Id,PatternManager.ai);b||this.Pd.set(this.Id)};p.prototype.he=function(f){var c=0;f&32768?c=0:f&16384?c=1:f&8192?c=2:f&4096?c=3:f&2048?c=4:f&1024?c=5:f&512?c=6:f&256?c=7:
f&128?c=8:f&64?c=9:f&32?c=10:f&16?c=11:f&8?c=12:f&4?c=13:f&2?c=14:f&1&&(c=15);return c};p.prototype.Le=function(f){var c=0;f&1?c=15:f&2?c=14:f&4?c=13:f&8?c=12:f&16?c=11:f&32?c=10:f&64?c=9:f&128?c=8:f&256?c=7:f&512?c=6:f&1024?c=5:f&2048?c=4:f&4096?c=3:f&8192?c=2:f&16384&&(c=1);return c};p.prototype.yg=function(f){var c=this.ec,a,n=this.U,b,k=this.width,d=this.height,m,g=this.D.R,l=this.D.N,h=this.D.O,u=this.D.P,z,v;for(z=0;z<d;z+=1){a=c[z];b=n[z>>4];for(v=m=0;v<k;v+=1)0!==a[v]&&(b[v>>8]|=1<<(~(v>>
4)&15),m|=a[v],v<h&&(h=v),v>u&&(u=v));m&&(z<l&&(l=z),z>g&&(g=z))}f||(this.D.R=g,this.D.N=l,this.D.O=h,this.D.P=u)};p.prototype.tj=function(){var f,c,a,n,b,k=this.ib,d=this.oa,m,g=this.U,l,h,u,z,v,D,e,p,w,G,y,B=this.h,x=this.c>>4,E=this.Fb,C;p=0;w=p+16;for(n=0;n<B;n+=1)g[n].set(E);for(n=0;n<B;n+=1){G=0;m=d[n];l=g[n];h=0<n?g[n-1]:E;u=n<B-1?g[n+1]:E;m[0]&=32767;m[x-1]&=65534;for(b=0;b<x;b+=1)if(z=m[b]){v=l[b];D=h[b];e=u[b];for(c=15;0<=c;--c){if(z&1<<c){y=!1;C=0;f=p;a=k[f];if(a=a[G])y=!0,a&32768&&(C|=
q.pd,C|=q.Yd),a&1&&(C|=q.yd,C|=q.Zd),C|=q.jd;for(f+=1;f<w-1;){a=k[f];if(a=a[G])y=!0,a&32768&&(C|=q.pd),a&1&&(C|=q.yd);f+=1}a=k[f];if(a=a[G])y=!0,a&32768&&(C|=q.pd,C|=q.oe),a&1&&(C|=q.yd,C|=q.pe),C|=q.Ad;y&&(v|=1<<c,C&&(C&q.pd&&(15>c?v|=1<<c+1:0<b&&(l[b-1]|=1)),C&q.yd&&(0<c?v|=1<<c-1:b<x-1&&(l[b+1]|=32768)),C&q.jd&&(D|=1<<c),C&q.Ad&&(e|=1<<c),C&q.Yd&&(15>c?D|=1<<c+1:0<b&&(h[b-1]|=1)),C&q.Zd&&(0<c?D|=1<<c-1:b<x-1&&(h[b+1]|=32768)),C&q.oe&&(15>c?e|=1<<c+1:0<b&&(u[b-1]|=1)),C&q.pe&&(0<c?e|=1<<c-1:b<x-
1&&(u[b+1]|=32768))))}G+=1}l[b]|=v;0<n&&(h[b]|=D);n<B-1&&(u[b]|=e)}else G+=16;p+=16;w+=16}for(n=0;n<E.length;n+=1)E[n]=0};p.prototype.uj=function(){var f,c,a,n,b,k=this.ib,d=this.oa,m,g=this.ma,l,h=this.U,u,z,v,D,e,p,w,G,y,B,x,E,C=this.h,t=this.c>>4,A=this.Fb,r;G=0;y=G+16;for(n=0;n<C;n+=1)h[n].set(A);for(n=0;n<C;n+=1){B=0;m=d[n];u=h[n];z=0<n?h[n-1]:A;v=n<C-1?h[n+1]:A;m[0]&=32767;m[t-1]&=65534;for(b=0;b<t;b+=1)if(D=m[b]){e=u[b];p=z[b];w=v[b];for(c=15;0<=c;--c){if(D&1<<c){E=!1;r=0;f=G;a=k[f];l=g[f];
a=a[B];x=B<<4;0<l[x]&&(a|=32768);x+=1;0<l[x]&&(a|=16384);x+=1;0<l[x]&&(a|=8192);x+=1;0<l[x]&&(a|=4096);x+=1;0<l[x]&&(a|=2048);x+=1;0<l[x]&&(a|=1024);x+=1;0<l[x]&&(a|=512);x+=1;0<l[x]&&(a|=256);x+=1;0<l[x]&&(a|=128);x+=1;0<l[x]&&(a|=64);x+=1;0<l[x]&&(a|=32);x+=1;0<l[x]&&(a|=16);x+=1;0<l[x]&&(a|=8);x+=1;0<l[x]&&(a|=4);x+=1;0<l[x]&&(a|=2);x+=1;0<l[x]&&(a|=1);a&&(E=!0,a&32768&&(r|=q.pd,r|=q.Yd),a&1&&(r|=q.yd,r|=q.Zd),r|=q.jd);for(f+=1;f<y-1;)a=k[f],l=g[f],a=a[B],x=B<<4,0<l[x]&&(a|=32768),x+=1,0<l[x]&&
(a|=16384),x+=1,0<l[x]&&(a|=8192),x+=1,0<l[x]&&(a|=4096),x+=1,0<l[x]&&(a|=2048),x+=1,0<l[x]&&(a|=1024),x+=1,0<l[x]&&(a|=512),x+=1,0<l[x]&&(a|=256),x+=1,0<l[x]&&(a|=128),x+=1,0<l[x]&&(a|=64),x+=1,0<l[x]&&(a|=32),x+=1,0<l[x]&&(a|=16),x+=1,0<l[x]&&(a|=8),x+=1,0<l[x]&&(a|=4),x+=1,0<l[x]&&(a|=2),x+=1,0<l[x]&&(a|=1),a&&(E=!0,a&32768&&(r|=q.pd),a&1&&(r|=q.yd)),f+=1;a=k[f];l=g[f];a=a[B];x=B<<4;0<l[x]&&(a|=32768);x+=1;0<l[x]&&(a|=16384);x+=1;0<l[x]&&(a|=8192);x+=1;0<l[x]&&(a|=4096);x+=1;0<l[x]&&(a|=2048);
x+=1;0<l[x]&&(a|=1024);x+=1;0<l[x]&&(a|=512);x+=1;0<l[x]&&(a|=256);x+=1;0<l[x]&&(a|=128);x+=1;0<l[x]&&(a|=64);x+=1;0<l[x]&&(a|=32);x+=1;0<l[x]&&(a|=16);x+=1;0<l[x]&&(a|=8);x+=1;0<l[x]&&(a|=4);x+=1;0<l[x]&&(a|=2);x+=1;0<l[x]&&(a|=1);a&&(E=!0,a&32768&&(r|=q.pd,r|=q.oe),a&1&&(r|=q.yd,r|=q.pe),r|=q.Ad);E&&(e|=1<<c,r&&(r&q.pd&&(15>c?e|=1<<c+1:0<b&&(u[b-1]|=1)),r&q.yd&&(0<c?e|=1<<c-1:b<t-1&&(u[b+1]|=32768)),r&q.jd&&(p|=1<<c),r&q.Ad&&(w|=1<<c),r&q.Yd&&(15>c?p|=1<<c+1:0<b&&(z[b-1]|=1)),r&q.Zd&&(0<c?p|=1<<
c-1:b<t-1&&(z[b+1]|=32768)),r&q.oe&&(15>c?w|=1<<c+1:0<b&&(v[b-1]|=1)),r&q.pe&&(0<c?w|=1<<c-1:b<t-1&&(v[b+1]|=32768))))}B+=1}u[b]|=e;0<n&&(z[b]|=p);n<C-1&&(v[b]|=w)}else B+=16;G+=16;y+=16}for(n=0;n<A.length;n+=1)A[n]=0};p.prototype.oq=function(f){var c,a,n,b=this.width>>4,k=this.height,d=this.width,m=this.ib,g,l=this.ec,h;g=this.ma;var u=this.D,z=this.cc,v=this.height,D=-1,e=this.width,p=-1,w=this.height,q=-1,y=this.width,B=-1,x,E=this.nd,C=this.h,t=this.U,A=this.oa,r=this.xa,J=this.Ea,K=this.Fb;if(l&&
!f)for(a=0;a<k;a+=1){h=l[a];for(c=x=0;c<d;c+=1)n=h[c],x|=n,n&&(c<y&&(y=c),c>B&&(B=c));x&&(a<w&&(w=a),a>q&&(q=a))}for(a=0;a<E.length;a+=1)E[a]=0;for(a=0;a<C;a+=1)A[a].set(K);if(-1!==this.u)for(a=0;a<k;a+=1){b=g[a];for(c=x=0;c<d;c+=1)n=b[c],x|=n,n&&(c<e&&(e=c),c>p&&(p=c));x&&(a<v&&(v=a),a>D&&(D=a))}else{for(a=0;a<k;a+=1){g=m[a];for(c=x=0;c<b;c+=1)n=g[c],x|=n,E[c]|=n;x&&(a<v&&(v=a),a>D&&(D=a))}for(c=0;c<b;c+=1)E[c]&&(c<e&&(e=c),c>p&&(p=c));e=(e<<4)+this.he(E[e]);p=(p<<4)+this.Le(E[p])}if(0>D||v>=k||
e>=d||0>p)v=D=k>>1,p=e=d>>1;l&&!f&&(q<D&&(D=q),w>v&&(v=w),y<e&&(e=y),B>p&&(p=B));D>this.height-1&&(D=this.height-1);0>v&&(v=0);0>e&&(e=0);p>this.width-1&&(p=this.width-1);u.R=D;u.N=v;u.O=e;u.P=p;z.R=D;z.N=v;z.O=e;z.P=p;0<e&&--e;0<v&&--v;p<this.width-1&&(p+=1);D<this.height-1&&(D+=1);n=D>>4;e>>=8;p>>=8;for(a=v>>4;a<=n;a+=1)for(v=A[a],c=e;c<=p;c+=1)v[c]=-1;-1!==this.u?this.uj():this.tj();l&&(this.yg(f),z.R=u.R,z.N=u.N,z.O=u.O,z.P=u.P);Array.Fd(t,A);Array.Fd(t,r);Array.Fd(t,J)};p.prototype.ob=function(f){var c,
a=this.width-this.pa>>1,n=this.height-this.Ma>>1,b=a+this.pa-1,k=n+this.Ma-1,d=b+f>>4,m,g,l=a-f>>4,h=b+f>>4,u=~(1<<(~(a-f)&15)),z=~(1<<(~(b+f)&15)),v;c=this.i&1?this.X:this.ib;m=c[k+f];g=c[n-f];if(this.pa)if(this.Ma){for(v=a-f>>4;v<=d;v+=1)g[v]=0,m[v]=0;for(d=n-f+1;d<=k+f-1;d+=1)c[d][l]&=u,c[d][h]&=z}else for(n=0,k=this.height,d=0;d<k;d+=1)c[d][l]&=u,c[d][h]&=z;else for(d=this.width>>4,v=0;v<d;v+=1)g[v]=0,m[v]=0;if(-1!==this.u)if(c=this.ma,a-=f,b+=f,k+=f,n-=f,m=c[k],g=c[n],this.pa)if(this.Ma){for(v=
a;v<=b;v+=1)g[v]=0,m[v]=0;for(d=n+1;d<=k-1;d+=1)c[d][a]=0,c[d][b]=0}else for(d=0;d<this.height;d+=1)c[d][a]=0,c[d][b]=0;else for(v=0;v<this.width;v+=1)g[v]=0,m[v]=0};p.prototype.zl=function(){var f,c,a=this.pa;f=this.Ma;var n=(this.width-a)/2-1>>4,b=(this.width+a)/2>>4;c=(this.height-f)/2-1>>4;var k=(this.height+f)/2>>4;f||(c=0,k=(this.height>>4)-1);a||(n=0,b=(this.width>>4)-1);0>n&&(n=0);0>c&&(c=0);b>=this.width>>4&&(b=(this.width>>4)-1);k>=this.height>>4&&(k=(this.height>>4)-1);for(f=n;f<=b;f+=
1)a=1<<(~f&15),this.U[c][f>>4]|=a,this.oa[c][f>>4]|=a,this.xa[c][f>>4]|=a,this.Ea[c][f>>4]|=a,this.U[k][f>>4]|=a,this.oa[k][f>>4]|=a,this.xa[k][f>>4]|=a,this.Ea[k][f>>4]|=a;for(;c<=k;c+=1)a=1<<(~n&15),this.U[c][n>>4]|=a,this.oa[c][n>>4]|=a,this.xa[c][n>>4]|=a,this.Ea[c][n>>4]|=a,a=1<<(~b&15),this.U[c][b>>4]|=a,this.oa[c][b>>4]|=a,this.xa[c][b>>4]|=a,this.Ea[c][b>>4]|=a};p.prototype.zh=function(){var f,c,a=this.xa,n=this.pa,b=this.Ma,k=this.width-n>>1,d=this.height-b>>1,m=k+n-1,g=d+b-1,l=this.Gh,h=
this.Hh,u,z,v;this.i&1?(f=this.X,c=this.oa):(f=this.ib,c=this.U);this.pa||(k=0,m=this.width-1,n=this.width);this.Ma||(d=0,g=this.height-1,b=this.height);if(this.Ma)for(v=0;v<n;v+=1)u=k+v,z=k+(v+l+n)%n,f[g][u>>4]&1<<(~u&15)&&(f[d-1][z>>4]|=1<<(~z&15),c[d-1>>4][z>>8]|=1<<(~(z>>4)&15),a[d-1>>4][z>>8]|=1<<(~(z>>4)&15),15===(d-1&15)&&(c[(d-1>>4)+1][z>>8]|=1<<(~(z>>4)&15),a[(d-1>>4)+1][z>>8]|=1<<(~(z>>4)&15))),z=k+(v-l+n)%n,f[d][u>>4]&1<<(~u&15)&&(f[g+1][z>>4]|=1<<(~z&15),c[g+1>>4][z>>8]|=1<<(~(z>>4)&15),
a[g+1>>4][z>>8]|=1<<(~(z>>4)&15),g+1&15||(c[(g+1>>4)-1][z>>8]|=1<<(~(z>>4)&15),a[(g+1>>4)-1][z>>8]|=1<<(~(z>>4)&15)));if(this.pa)for(v=0;v<b;v+=1)u=d+v,z=d+(v-h+b)%b,f[u][k>>4]&1<<(~k&15)&&(f[z][m+1>>4]|=1<<(~(m+1)&15),c[z>>4][m+1>>8]|=1<<(~(m+1>>4)&15),a[z>>4][m+1>>8]|=1<<(~(m+1>>4)&15),m+1&15||(c[z>>4][m-15>>8]|=1<<(~(m-15>>4)&15),a[z>>4][m-15>>8]|=1<<(~(m-15>>4)&15))),z=d+(v+h+b)%b,f[u][m>>4]&1<<(~m&15)&&(f[z][k-1>>4]|=1<<(~(k-1)&15),c[z>>4][k-1>>8]|=1<<(~(k-1>>4)&15),a[z>>4][k-1>>8]|=1<<(~(k-
1>>4)&15),15===(k-1&15)&&(c[z>>4][k+15>>8]|=1<<(~(k+15>>4)&15),a[z>>4][k+15>>8]|=1<<(~(k+15>>4)&15)));this.pa&&this.Ma&&(u=k+(-l+n)%n,f[d-1][m+1>>4]=f[d+(b-1+h+b)%b][u>>4]&1<<(~u&15)?f[d-1][m+1>>4]|1<<(~(m+1)&15):f[d-1][m+1>>4]&~(1<<(~(m+1)&15)),u=k+(n-1-l+n)%n,f[d-1][k-1>>4]=f[d+(b-1-h+b)%b][u>>4]&1<<(~u&15)?f[d-1][k-1>>4]|1<<(~(k-1)&15):f[d-1][k-1>>4]&~(1<<(~(k-1)&15)),u=k+(l+n)%n,f[g+1][m+1>>4]=f[d+(h+b)%b][u>>4]&1<<(~u&15)?f[g+1][m+1>>4]|1<<(~(m+1)&15):f[g+1][m+1>>4]&~(1<<(~(m+1)&15)),u=k+(n-
1+l+n)%n,f[g+1][k-1>>4]=f[d+(-h+b)%b][u>>4]&1<<(~u&15)?f[g+1][k-1>>4]|1<<(~(k-1)&15):f[g+1][k-1>>4]&~(1<<(~(k-1)&15)))};p.prototype.xh=function(){var f,c,a=this.xa,n=this.pa,b=this.Ma,k=this.width-n>>1,d=this.height-b>>1,m=k+n-1,g=d+b-1,l=this.Gh,h=this.Hh,u=this.sk,z=this.nm,v,D,e;this.i&1?(f=this.X,c=this.oa):(f=this.ib,c=this.U);for(e=0;e<n;e+=1)v=k+e,D=u?m-(e+l+n)%n:k+(e+l+n)%n,f[g][v>>4]&1<<(~v&15)&&(f[d-1][D>>4]|=1<<(~D&15),c[d-1>>4][D>>8]|=1<<(~(D>>4)&15),a[d-1>>4][D>>8]|=1<<(~(D>>4)&15),15===
(d-1&15)&&(c[(d-1>>4)+1][D>>8]|=1<<(~(D>>4)&15),a[(d-1>>4)+1][D>>8]|=1<<(~(D>>4)&15))),D=u?m-(e-l+n)%n:k+(e-l+n)%n,f[d][v>>4]&1<<(~v&15)&&(f[g+1][D>>4]|=1<<(~D&15),c[g+1>>4][D>>8]|=1<<(~(D>>4)&15),a[g+1>>4][D>>8]|=1<<(~(D>>4)&15),g+1&15||(c[(g+1>>4)-1][D>>8]|=1<<(~(D>>4)&15),a[(g+1>>4)-1][D>>8]|=1<<(~(D>>4)&15)));for(e=0;e<b;e+=1)v=d+e,D=z?g-(e-h+b)%b:d+(e-h+b)%b,f[v][k>>4]&1<<(~k&15)&&(f[D][m+1>>4]|=1<<(~(m+1)&15),c[D>>4][m+1>>8]|=1<<(~(m+1>>4)&15),a[D>>4][m+1>>8]|=1<<(~(m+1>>4)&15),m+1&15||(c[D>>
4][m-15>>8]|=1<<(~(m-15>>4)&15),a[D>>4][m-15>>8]|=1<<(~(m-15>>4)&15))),D=z?g-(e+h+b)%b:d+(e+h+b)%b,f[v][m>>4]&1<<(~m&15)&&(f[D][k-1>>4]|=1<<(~(k-1)&15),c[D>>4][k-1>>8]|=1<<(~(k-1>>4)&15),a[D>>4][k-1>>8]|=1<<(~(k-1>>4)&15),15===(k-1&15)&&(c[D>>4][k+15>>8]|=1<<(~(k+15>>4)&15),a[D>>4][k+15>>8]|=1<<(~(k+15>>4)&15)));v=u?m-(-l+n)%n:k+(-l+n)%n;f[z?g-(b-1+h+b)%b:d+(b-1+h+b)%b][v>>4]&1<<(~v&15)&&(f[d-1][m+1>>4]|=1<<(~(m+1)&15));v=u?m-(n-1-l+n)%n:k+(n-1-l+n)%n;f[z?g-(b-1+h+b)%b:d+(b-1+h+b)%b][v>>4]&1<<(~v&
15)&&(f[d-1][k-1>>4]|=1<<(~(k-1)&15));v=u?m-(l+n)%n:k+(l+n)%n;f[z?g-(h+b)%b:d+(h+b)%b][v>>4]&1<<(~v&15)&&(f[g+1][m+1>>4]|=1<<(~(m+1)&15));v=u?m-(n-1+l+n)%n:k+(n-1+l+n)%n;f[z?g-(h+b)%b:d+(h+b)%b][v>>4]&1<<(~v&15)&&(f[g+1][k-1>>4]|=1<<(~(k-1)&15))};p.prototype.wh=function(){var f,c,a=this.xa,n=this.width-this.pa>>1,b=this.height-this.Ma>>1,k=n+this.pa-1,d=b+this.Ma-1,m,g,l;this.i&1?(f=this.X,c=this.oa):(f=this.ib,c=this.U);for(m=0;m<this.pa;m+=1)g=n+m,l=k-m,f[d][g>>4]&1<<(~g&15)&&(f[b-1][l>>4]|=1<<
(~l&15),c[b-1>>4][l>>8]|=1<<(~(l>>4)&15),a[b-1>>4][l>>8]|=1<<(~(l>>4)&15),15===(b-1&15)&&(c[(b-1>>4)+1][l>>8]|=1<<(~(l>>4)&15),a[(b-1>>4)+1][l>>8]|=1<<(~(l>>4)&15))),f[b][g>>4]&1<<(~g&15)&&(f[d+1][l>>4]|=1<<(~l&15),c[d+1>>4][l>>8]|=1<<(~(l>>4)&15),a[d+1>>4][l>>8]|=1<<(~(l>>4)&15),d+1&15||(c[(d+1>>4)-1][l>>8]|=1<<(~(l>>4)&15),a[(d+1>>4)-1][l>>8]|=1<<(~(l>>4)&15)));for(m=0;m<=this.Ma;m+=1)g=b+m,l=d-m,f[g][n>>4]&1<<(~n&15)&&(f[l][k+1>>4]|=1<<(~(k+1)&15),c[l>>4][k+1>>8]|=1<<(~(k+1>>4)&15),a[l>>4][k+1>>
8]|=1<<(~(k+1>>4)&15),k+1&15||(c[l>>4][k-15>>8]|=1<<(~(k-15>>4)&15),a[l>>4][k-15>>8]|=1<<(~(k-15>>4)&15))),f[g][k>>4]&1<<(~k&15)&&(f[l][n-1>>4]|=1<<(~(n-1)&15),c[l>>4][n-1>>8]|=1<<(~(n-1>>4)&15),a[l>>4][n-1>>8]|=1<<(~(n-1>>4)&15),15===(n-1&15)&&(c[l>>4][n+15>>8]|=1<<(~(n+15>>4)&15),a[l>>4][n+15>>8]|=1<<(~(n+15>>4)&15)));f[d][n>>4]&1<<(~n&15)&&(f[d+1][n-1>>4]|=1<<(~(n-1)&15));f[d][k>>4]&1<<(~k&15)&&(f[d+1][k+1>>4]|=1<<(~(k+1)&15));f[b][n>>4]&1<<(~n&15)&&(f[b-1][n-1>>4]|=1<<(~(n-1)&15));f[b][k>>4]&
1<<(~k&15)&&(f[b-1][k+1>>4]|=1<<(~(k+1)&15))};p.prototype.yh=function(){var f,c,a=this.xa,n=this.width-this.pa>>1,b=this.height-this.pa>>1,k=n+this.pa-1,d=b+this.pa-1,m,g,l;this.i&1?(f=this.X,c=this.oa):(f=this.ib,c=this.U);for(m=0;m<this.pa;m+=1)l=b+m,g=n+m,f[l][n>>4]&1<<(~n&15)&&(f[b-1][g>>4]|=1<<(~g&15),c[b-1>>4][g>>8]|=1<<(~(g>>4)&15),a[b-1>>4][g>>8]|=1<<(~(g>>4)&15),15===(b-1&15)&&(c[(b-1>>4)+1][g>>8]|=1<<(~(g>>4)&15),a[(b-1>>4)+1][g>>8]|=1<<(~(g>>4)&15))),f[l][k>>4]&1<<(~k&15)&&(f[d+1][g>>4]|=
1<<(~g&15),c[d+1>>4][g>>8]|=1<<(~(g>>4)&15),a[d+1>>4][g>>8]|=1<<(~(g>>4)&15),d+1&15||(c[(d+1>>4)-1][g>>8]|=1<<(~(g>>4)&15),a[(d+1>>4)-1][g>>8]|=1<<(~(g>>4)&15))),f[b][g>>4]&1<<(~g&15)&&(f[l][n-1>>4]|=1<<(~(n-1)&15),c[l>>4][n-1>>8]|=1<<(~(n-1>>4)&15),a[l>>4][n-1>>8]|=1<<(~(n-1>>4)&15),15===(n-1&15)&&(c[l>>4][n+15>>8]|=1<<(~(n+15>>4)&15),a[l>>4][n+15>>8]|=1<<(~(n+15>>4)&15))),f[d][g>>4]&1<<(~g&15)&&(f[l][k+1>>4]|=1<<(~(k+1)&15),c[l>>4][k+1>>8]|=1<<(~(k+1>>4)&15),a[l>>4][k+1>>8]|=1<<(~(k+1>>4)&15),k+
1&15||(c[l>>4][k-15>>8]|=1<<(~(k-15>>4)&15),a[l>>4][k-15>>8]|=1<<(~(k-15>>4)&15)));f[d][n>>4]&1<<(~n&15)&&(f[d+1][n-1>>4]|=1<<(~(n-1)&15));f[d][k>>4]&1<<(~k&15)&&(f[d+1][k+1>>4]|=1<<(~(k+1)&15));f[b][n>>4]&1<<(~n&15)&&(f[b-1][n-1>>4]|=1<<(~(n-1)&15));f[b][k>>4]&1<<(~k&15)&&(f[b-1][k+1>>4]|=1<<(~(k+1)&15))};p.prototype.uh=function(){switch(this.Ib){case 0:this.ob(1);break;case 1:this.ob(1);this.ob(2);break;case 2:this.ob(1);this.ob(2);break;case 3:this.ob(1);this.ob(2);break;case 4:this.ob(1),this.ob(2)}};
p.prototype.vh=function(){this.zl();switch(this.Ib){case 1:this.zh();break;case 2:this.xh();break;case 3:this.wh();break;case 4:this.yh()}this.zl()};p.prototype.ag=function(f,c,a,n){var b=!1,k=this.D,d=this.Ia;n||(f=!0);this.i===this.bg-1&&(b=!0,a||(f=!0));-1!==this.Ib&&this.vh();this.$a&&this.Aj();this.Y&&(f?this.th():this.sh());this.i+=1;-1!==this.u&&(this.Y?this.Fg():this.rh());this.$a&&this.yj();-1!==this.Ib&&this.uh();8192===this.width&&(16>=k.O||8176<=k.P||16>=k.N||8176<=k.R)&&this.vg();b&&
(this.bg+=q.ii,a||this.di(c));k.O<d.O&&(d.O=k.O);k.P>d.P&&(d.P=k.P);k.N<d.N&&(d.N=k.N);k.R>d.R&&(d.R=k.R);this.i<q.$g&&(f?(this.Hc[this.i]=this.Xb,this.gd[this.i]=this.jc,this.Hd[this.i]=this.lc,this.Xb>this.Ja&&(this.Ja=this.Xb),this.jc>this.Ja&&(this.Ja=this.jc),this.lc>this.Ja&&(this.Ja=this.lc)):(this.Hc[this.i]=0,this.gd[this.i]=0,this.Hd[this.i]=0))};p.prototype.Je=function(f,c,a,n,b,k,d,m){var g,l,h,u,z=1,v,D;this.i>a&&(z=a/this.i);m?(f.strokeStyle=c,f.beginPath(),l=n-d[0]/this.Ja*n|0,f.moveTo(0+
k+.5,l+b+k+.5)):f.fillStyle=c;u=0;for(c=h=1;c<a;c+=1){if(h<q.$g){D=v=d[h];u+=z;for(h+=1;!(u|0);)g=d[h],h+=1,g>D&&(D=g),g<v&&(v=g),u+=z;--u}else D=v=0;c<=this.i&&(g=0+k+1+c,l=n-v/this.Ja*n|0,m?(f.lineTo(g+.5,l+b+k+.5),v!==D&&(l=n-D/this.Ja*n|0,f.lineTo(g+.5,l+b+k+.5))):0<v&&0<D&&(v!==D&&(l=n-D/this.Ja*n|0),f.fillRect(g+.5,l+b+k+.5,1,1)))}m&&f.stroke()};p.prototype.Gm=function(f,c,a,n){var b=this.dd,k=40,d=40,m=this.s-0-d,g=this.m-k-d,l,h="rgb("+this.Ld[0]+","+this.Ld[1]+","+this.Ld[2]+")",u="rgb("+
this.Kd[0]+","+this.Kd[1]+","+this.Kd[2]+")",z="rgb("+this.Jd[0]+","+this.Jd[1]+","+this.Jd[2]+")",v="rgb("+this.Md[0]+","+this.Md[1]+","+this.Md[2]+")",D="rgb("+this.Nd[0]+","+this.Nd[1]+","+this.Nd[2]+")";if(a||n)k=0,g+=80;n&&(d=0,m=this.s-0);l=m-0-d;b.save();b.fillStyle=h;b.globalAlpha=c;b.fillRect(0,k,m+d,g);b.globalAlpha=1;a&&(g-=40);if(!n){b.font="16px Arial";b.textAlign="center";b.fillStyle="black";for(c=2;0<=c;c-=2)b.save(),b.translate(this.s/2,g+d/2-6),b.fillText("Generation",c,c),b.restore(),
b.save(),b.translate(d/2+6,this.m/2),b.rotate(-90*Math.PI/180),320>this.m?b.fillText("Pop",c,c):b.fillText("Population",c,c),b.restore(),b.fillStyle=u;b.fillStyle="black";for(c=2;0<=c;c-=2)b.save(),b.translate(0+d-d/2+6,k+d),b.rotate(-90*Math.PI/180),b.fillText(String(this.Ja),c,c),b.restore(),b.save(),b.translate(0+d-d/2+6,g),b.rotate(-90*Math.PI/180),b.fillText("0",c,c),b.restore(),b.save(),b.translate(0+d,g+d/2-6),b.fillText("0",c,c),b.restore(),b.save(),b.translate(m,g+d/2-6),b.fillText(String(this.i>
l?this.i:l),c,c),b.restore(),b.fillStyle=u}this.Je(b,D,l,g-k-d,k,d,this.Hd,f);this.Je(b,v,l,g-k-d,k,d,this.gd,f);this.Je(b,z,l,g-k-d,k,d,this.Hc,f);b.strokeStyle=u;b.lineWidth=1;b.beginPath();b.moveTo(d+.5,k+d+.5);b.lineTo(d+.5,g+.5);b.lineTo(m+.5,g+.5);b.lineTo(m+.5,g+2.5);b.moveTo(d+.5,g+.5);b.lineTo(d+.5,g+2.5);b.moveTo(d+.5,g+.5);b.lineTo(d+.5-2,g+.5);b.moveTo(d+.5,k+d+.5);b.lineTo(d+.5-2,k+d+.5);b.stroke();b.restore()};p.prototype.En=function(){var f;for(f=0;f<q.$g;f+=1)this.Hc[f]=0,this.gd[f]=
0,this.Hd[f]=0;this.Ja=this.Hc[0]=this.Xb};p.prototype.Dn=function(){var f=this.D,c=this.Ia;c.O=f.O;c.P=f.P;c.R=f.R;c.N=f.N};p.prototype.Aj=function(){var f,c,a,n,b,k,d,m=this.$a,g=this.Qb,l=this.Rb,h=this.Vd,u,z=this.h,v=this.c>>4,D;b=0;d=this.i&1?this.X:this.ib;for(f=0;f<z;f+=1){k=0;u=h[f];for(c=0;c<v;c+=1)if(D=u[c])for(a=15;0<=a;--a){if(D&1<<a)for(n=b;n<b+16;n+=1)g[n][k]=(d[n][k]|l[n][k])&m[n][k];k+=1}else k+=16;b+=16}};p.prototype.yj=function(){var f,c,a,n,b,k,d,m=this.Qb,g=this.Vd,l,h=this.h,
u=this.c>>4,z;d=this.i&1?this.X:this.ib;for(f=b=0;f<h;f+=1){k=0;l=g[f];for(c=0;c<u;c+=1)if(z=l[c])for(a=15;0<=a;--a){if(z&1<<a)for(n=b;n<b+16;n+=1)d[n][k]&=~m[n][k];k+=1}else k+=16;b+=16}};p.prototype.Ie=function(f,c,a){var n,b,k=this.uf,d=0,m=this.pc[d],g=this.qc[d],l=0,h=q.sl,u=h-1,z=0,v=h,D=this.Mj,e=this.Pa,p=this.Ua;m[l]=f;g[l]=c;l+=1;for(a[c][f>>4]&=~(1<<(~f&15));0<l;)for(--l,l<z&&(--d,z-=h,v-=h,m=this.pc[d],g=this.qc[d]),f=m[l&u],c=g[l&u],b=c-D;b<=c+D;){for(n=f-D;n<=f+D;)n===(n&e)&&b===(b&
p)&&a[b][n>>4]&1<<(~n&15)&&(a[b][n>>4]&=~(1<<(~n&15)),l===v&&(d+=1,z+=h,v+=h,d>k&&(this.pc[d]=this.l.ga(Int32,h,"Life.boundaryX"+d),this.qc[d]=this.l.ga(Int32,h,"Life.boundaryY"+d),this.uf=k+=1),m=this.pc[d],g=this.qc[d]),m[l&u]=n,g[l&u]=b,l+=1),n+=1;b+=1}};p.prototype.Ve=function(f,c,a){for(var n=a[c][f],b=15;0<=b;)n&1<<b&&this.Ie((f<<4)+(~b&15),c,a),--b};p.prototype.Ah=function(f,c){this.Ie(0,f,c)};p.prototype.qh=function(f,c,a){this.Ie((f<<4)+15,c,a)};p.prototype.vg=function(){var f,c,a,n,b,k;
f=this.i&1?this.X:this.ib;c=f.length;a=f[0].length;b=f[0];k=f[c-1];for(n=0;n<a;)b[n]&&this.Ve(n,0,f),k[n]&&this.Ve(n,c-1,f),n+=1;for(n=0;n<c;)f[n][0]&32768&&this.Ah(n,f),f[n][a-1]&1&&this.qh(a-1,n,f),n+=1};p.prototype.sh=function(){var f,c,a,n,b,k,d,m,g,l,h,u,z,v,D,e,p,w,G,y,B,x,E,C,t,A,r=this.nd,J,K=this.height,Q=this.width,T=Q>>4,X=this.D,N=K,I=-1,O=Q,Y=-1,Z=this.h,aa=this.c>>4,ba=this.Fb,R;n=0;var S=Z;this.i&1?(h=this.X,u=this.ib,z=this.oa,v=this.U,f=this.Pd):(h=this.ib,u=this.X,z=this.U,v=this.oa,
f=this.Id);for(g=0;g<r.length;g+=1)r[g]=0;0>n&&(n=0);S>Z&&(S=Z);E=n<<4;C=E+16;for(g=n;g<S;g+=1)for(D=v[g],l=0;l<D.length;l+=1)D[l]=0;for(g=n;g<S;g+=1){t=0;D=z[g];e=v[g];p=0<g?v[g-1]:ba;w=g<Z-1?v[g+1]:ba;for(l=0;l<aa;l+=1)if(G=D[l]){y=e[l];B=p[l];x=w[l];for(k=15;0<=k;--k){if(G&1<<k){R=J=0;c=(b=E)?h[b-1]:this.Aa;a=h[b];n=h[b+1];A=a[t];if(t)if(t>=T-1){c=c[t-1]<<17|c[t]<<1;a=a[t-1]<<17|A<<1;d=n[t-1]<<17|n[t]<<1;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;
m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b),m&32768&&(R|=q.Yd),R|=q.jd;for(b+=1;b<C-1;){A|=n[t];n=h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1}A|=n[t];n=b===this.height-1?this.Aa:h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1;m=f[c>>12&63|
(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b),m&32768&&(R|=q.oe),R|=q.Ad}else{c=c[t-1]<<17|c[t]<<1|c[t+1]>>15;a=a[t-1]<<17|A<<1|a[t+1]>>15;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=
m,b<N&&(N=b),b>I&&(I=b),m&32768&&(R|=q.Yd),m&1&&(R|=q.Zd),R|=q.jd;b+=1;A|=n[t];n=h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;A|=n[t];n=h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|
(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;A|=n[t];n=h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;A|=n[t];n=h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<
6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;A|=n[t];n=h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;A|=n[t];n=h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&
63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;A|=n[t];n=h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;A|=n[t];n=h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>
15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;A|=n[t];n=h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;A|=n[t];n=h[b+1];
c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;A|=n[t];n=h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=
b),b>I&&(I=b);b+=1;A|=n[t];n=h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;A|=n[t];n=h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&
63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;A|=n[t];n=h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;A|=n[t];n=b===this.height-1?this.Aa:h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>
4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b),m&32768&&(R|=q.oe),m&1&&(R|=q.pe),R|=q.Ad}else{c=c[t]<<1|c[t+1]>>15;a=A<<1|a[t+1]>>15;d=n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b),m&1&&(R|=q.Zd),R|=q.jd;for(b+=1;b<C-1;){A|=n[t];n=h[b+1];c=a;a=d;d=n[t]<<1|n[t+
1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1}A|=n[t];n=b===this.height-1?this.Aa:h[b+1];c=a;a=d;d=n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b),m&1&&
(R|=q.pe),R|=q.Ad}J&&(J&32768&&(R|=q.pd),J&1&&(R|=q.yd));r[t]|=J;if(J||A)y|=1<<k,R&&(R&q.pd&&(15>k?y|=1<<k+1:0<l&&0<t&&(e[l-1]|=1)),R&q.yd&&(0<k?y|=1<<k-1:l<aa-1&&t<T-1&&(e[l+1]|=32768)),R&q.jd&&(B|=1<<k),R&q.Ad&&(x|=1<<k),R&q.Yd&&(15>k?B|=1<<k+1:0<l&&0<t&&(p[l-1]|=1)),R&q.Zd&&(0<k?B|=1<<k-1:l<aa-1&&t<T-1&&(p[l+1]|=32768)),R&q.oe&&(15>k?x|=1<<k+1:0<l&&0<t&&(w[l-1]|=1)),R&q.pe&&(0<k?x|=1<<k-1:l<aa-1&&t<T-1&&(w[l+1]|=32768)))}t+=1}e[l]|=y;0<g&&(p[l]|=B);g<Z-1&&(w[l]|=x)}else t+=16;E+=16;C+=16}for(l=
0;l<T;l+=1)r[l]&&(l<O&&(O=l),l>Y&&(Y=l));O=(O<<4)+this.he(r[O]);Y=(Y<<4)+this.Le(r[Y]);0>I&&(I=K-1);N>=K&&(N=0);O>=Q&&(O=0);0>Y&&(Y=Q-1);I>K-1&&(I=K-1);0>N&&(N=0);0>O&&(O=0);Y>Q-1&&(Y=Q-1);X.R=I;X.N=N;X.O=O;X.P=Y;for(g=0;g<ba.length;g+=1)ba[g]=0};p.prototype.th=function(){var f,c,a,n,b,k,d,m,g,l,h,u,z,v,D,e,p,w,G,y,B,x,A,C,t,r,F,J=this.nd,K,Q=this.height,T=this.width,X=T>>4,N=this.D,I=Q,O=-1,Y=T,Z=-1,aa=this.h,ba=this.c>>4,R=this.Fb,S,M=this.oc,U=0,V=0,W=0;n=0;var ca=aa;this.i&1?(h=this.X,u=this.ib,
z=this.oa,v=this.U,f=this.Pd):(h=this.ib,u=this.X,z=this.U,v=this.oa,f=this.Id);for(g=0;g<J.length;g+=1)J[g]=0;0>n&&(n=0);ca>aa&&(ca=aa);A=n<<4;C=A+16;for(g=n;g<ca;g+=1)for(D=v[g],l=0;l<D.length;l+=1)D[l]=0;for(g=n;g<ca;g+=1){t=0;D=z[g];e=v[g];p=0<g?v[g-1]:R;w=g<aa-1?v[g+1]:R;for(l=0;l<ba;l+=1)if(G=D[l]){y=e[l];B=p[l];x=w[l];for(k=15;0<=k;--k){if(G&1<<k){S=K=0;c=(b=A)?h[b-1]:this.Aa;a=h[b];n=h[b+1];r=F=a[t];if(t)if(t>=X-1){c=c[t-1]<<17|c[t]<<1;a=a[t-1]<<17|F<<1;d=n[t-1]<<17|n[t]<<1;m=f[c>>12&63|(a>>
12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];u[b][t]=m;U+=M[m];V+=M[m&~F];W+=M[F&~m];m&&(K|=m,b<I&&(I=b),b>O&&(O=b),m&32768&&(S|=q.Yd),S|=q.jd);for(b+=1;b<C-1;)F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=
M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b)),b+=1;F=n[t];r|=F;n=b===this.height-1?this.Aa:h[b+1];c=a;a=d;d=n[t-1]<<17|n[t]<<1;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];u[b][t]=m;U+=M[m];V+=M[m&~F];W+=M[F&~m];m&&(K|=m,b<I&&(I=b),b>O&&(O=b),m&32768&&(S|=q.oe),S|=q.Ad)}else c=c[t-1]<<17|c[t]<<1|c[t+1]>>15,a=a[t-1]<<17|F<<1|a[t+1]>>15,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>
12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b),m&32768&&(S|=q.Yd),m&1&&(S|=q.Zd),S|=q.jd),b+=1,F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<
12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b)),b+=1,F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b)),b+=1,F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>
8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b)),b+=1,F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b)),b+=1,F=n[t],
r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b)),b+=1,F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&
63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b)),b+=1,F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b)),b+=1,F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&
63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b)),b+=1,F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&
(O=b)),b+=1,F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b)),b+=1,F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&
63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b)),b+=1,F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b)),b+=1,F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>
12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b)),b+=1,F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=
m,b<I&&(I=b),b>O&&(O=b)),b+=1,F=n[t],r|=F,n=b===this.height-1?this.Aa:h[b+1],c=a,a=d,d=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=m,b<I&&(I=b),b>O&&(O=b),m&32768&&(S|=q.oe),m&1&&(S|=q.pe),S|=q.Ad);else{c=c[t]<<1|c[t+1]>>15;a=F<<1|a[t+1]>>15;d=n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<
12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];u[b][t]=m;U+=M[m];V+=M[m&~F];W+=M[F&~m];m&&(K|=m,b<I&&(I=b),b>O&&(O=b),m&1&&(S|=q.Zd),S|=q.jd);for(b+=1;b<C-1;)F=n[t],r|=F,n=h[b+1],c=a,a=d,d=n[t]<<1|n[t+1]>>15,m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12,m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8,m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4,m|=f[c&63|(a&63)<<6|(d&63)<<12],u[b][t]=m,U+=M[m],V+=M[m&~F],W+=M[F&~m],m&&(K|=
m,b<I&&(I=b),b>O&&(O=b)),b+=1;F=n[t];r|=F;n=b===this.height-1?this.Aa:h[b+1];c=a;a=d;d=n[t]<<1|n[t+1]>>15;m=f[c>>12&63|(a>>12&63)<<6|(d>>12&63)<<12]<<12;m|=f[c>>8&63|(a>>8&63)<<6|(d>>8&63)<<12]<<8;m|=f[c>>4&63|(a>>4&63)<<6|(d>>4&63)<<12]<<4;m|=f[c&63|(a&63)<<6|(d&63)<<12];u[b][t]=m;U+=M[m];V+=M[m&~F];W+=M[F&~m];m&&(K|=m,b<I&&(I=b),b>O&&(O=b),m&1&&(S|=q.pe),S|=q.Ad)}K&&(K&32768&&(S|=q.pd),K&1&&(S|=q.yd));J[t]|=K;if(K||r)y|=1<<k,S&&(S&q.pd&&(15>k?y|=1<<k+1:0<l&&0<t&&(e[l-1]|=1)),S&q.yd&&(0<k?y|=1<<
k-1:l<ba-1&&t<X-1&&(e[l+1]|=32768)),S&q.jd&&(B|=1<<k),S&q.Ad&&(x|=1<<k),S&q.Yd&&(15>k?B|=1<<k+1:0<l&&0<t&&(p[l-1]|=1)),S&q.Zd&&(0<k?B|=1<<k-1:l<ba-1&&t<X-1&&(p[l+1]|=32768)),S&q.oe&&(15>k?x|=1<<k+1:0<l&&0<t&&(w[l-1]|=1)),S&q.pe&&(0<k?x|=1<<k-1:l<ba-1&&t<X-1&&(w[l+1]|=32768)))}t+=1}e[l]|=y;0<g&&(p[l]|=B);g<aa-1&&(w[l]|=x)}else t+=16;A+=16;C+=16}for(l=0;l<X;l+=1)J[l]&&(l<Y&&(Y=l),l>Z&&(Z=l));Y=(Y<<4)+this.he(J[Y]);Z=(Z<<4)+this.Le(J[Z]);0>O&&(O=Q-1);I>=Q&&(I=0);Y>=T&&(Y=0);0>Z&&(Z=T-1);O>Q-1&&(O=Q-
1);0>I&&(I=0);0>Y&&(Y=0);Z>T-1&&(Z=T-1);N.R=O;N.N=I;N.O=Y;N.P=Z;for(g=0;g<R.length;g+=1)R[g]=0;this.Xb=U;this.jc=V;this.lc=W};p.prototype.Ff=function(f,c){var a,n,b,k,d,m=this.Ea,g,l,h,u,z,v,e,p,q,w,G=this.h,y=this.c>>4;v=0;e=v+16;for(h=0;h<G;h+=1){p=0;g=m[h];for(u=0;u<y;u+=1)if(q=g[u])for(z=15;0<=z;--z){if(q&1<<z)for(n=v;n<e;n+=2)b=f[n],k=f[n+1],d=c[n],a=p<<3,w=0,l=b[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),l=k[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),d[a+a]=w,a+=1,w=0,l=b[a],(l&255)>w&&(w=l&255),
l>>=8,l>w&&(w=l),l=k[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),d[a+a]=w,a+=1,w=0,l=b[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),l=k[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),d[a+a]=w,a+=1,w=0,l=b[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),l=k[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),d[a+a]=w,a+=1,w=0,l=b[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),l=k[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),d[a+a]=w,a+=1,w=0,l=b[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),l=k[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),d[a+a]=
w,a+=1,w=0,l=b[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),l=k[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),d[a+a]=w,a+=1,w=0,l=b[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),l=k[a],(l&255)>w&&(w=l&255),l>>=8,l>w&&(w=l),d[a+a]=w;p+=1}else p+=16;v+=16;e+=16}};p.prototype.Gf=function(f,c){var a,n,b,k,d,m=this.Ea,g,l,h,u,z,v,e,p,q,w,G=this.h,y=this.c>>4;v=0;e=v+16;for(h=0;h<G;h+=1){p=0;g=m[h];for(u=0;u<y;u+=1)if(q=g[u])for(z=15;0<=z;--z){if(q&1<<z)for(a=v;a<e;a+=4)d=c[a],b=f[a],k=f[a+2],n=p<<4,w=b[n],l=b[n+2],
l>w&&(w=l),l=k[n],l>w&&(w=l),l=k[n+2],l>w&&(w=l),d[n]=w,n+=4,w=b[n],l=b[n+2],l>w&&(w=l),l=k[n],l>w&&(w=l),l=k[n+2],l>w&&(w=l),d[n]=w,n+=4,w=b[n],l=b[n+2],l>w&&(w=l),l=k[n],l>w&&(w=l),l=k[n+2],l>w&&(w=l),d[n]=w,n+=4,w=b[n],l=b[n+2],l>w&&(w=l),l=k[n],l>w&&(w=l),l=k[n+2],l>w&&(w=l),d[n]=w;p+=1}else p+=16;v+=16;e+=16}};p.prototype.Hf=function(f,c){var a,n,b,k,d,m=this.Ea,g,l,h,u,z,v,e,p,q,w,G=this.h,y=this.c>>4;v=0;e=v+16;for(h=0;h<G;h+=1){p=0;g=m[h];for(u=0;u<y;u+=1)if(q=g[u])for(z=15;0<=z;--z){if(q&
1<<z)for(a=v;a<e;a+=8)d=c[a],b=f[a],k=f[a+4],n=p<<4,w=b[n],l=b[n+4],l>w&&(w=l),l=k[n],l>w&&(w=l),l=k[n+4],l>w&&(w=l),d[n]=w,n+=8,w=b[n],l=b[n+4],l>w&&(w=l),l=k[n],l>w&&(w=l),l=k[n+4],l>w&&(w=l),d[n]=w;p+=1}else p+=16;v+=16;e+=16}};p.prototype.Ef=function(f,c){var a,n,b,k,d=this.Ea,m,g,l,h,u,z,v,e,p=this.h,q=this.c>>4;for(g=u=0;g<p;g+=1){z=0;m=d[g];for(l=0;l<q;l+=1)if(v=m[l])for(h=15;0<=h;--h)v&1<<h&&(k=c[u],n=f[u],b=f[u+8],a=z<<4,e=n[a],n=n[a+8],n>e&&(e=n),n=b[a],n>e&&(e=n),n=b[a+8],n>e&&(e=n),k[a]=
e),z+=1;else z+=16;u+=16}};p.prototype.zg=function(){1>this.K&&(this.Ff(this.vf,this.v),.5>this.K&&(this.Gf(this.v,this.ha),.25>this.K&&(this.Hf(this.ha,this.ia),.125>this.K&&this.Ef(this.ia,this.Qa))));this.we&&1>this.K&&(this.Ff(this.Qd,this.L),.5>this.K&&(this.Gf(this.L,this.Zb),.25>this.K&&(this.Hf(this.Zb,this.hc),.125>this.K&&this.Ef(this.hc,this.Ec))))};p.prototype.Fg=function(){var f,c,a,n=this.ma,b,k,d,m=this.Ea,g=this.xa,l,h,u,z,v,e,p,q,w,G,y,B,x,A,C;G=this.h;var t=this.c>>4,r=this.u-1;
f=0;var F=G;this.Mc=this.Y=0;this.i&1?(l=this.X,u=this.oa):(l=this.ib,u=this.U);0>f&&(f=0);F>G&&(F=G);G=f<<4;y=G+16;for(e=f;e<F;e+=1){B=0;z=u[e];k=g[e];d=m[e];for(p=0;p<t;p+=1){x=z[p]|k[p];A=0;if(x)for(q=15;0<=q;--q){if(x&1<<q){C=0;for(f=G;f<y;f+=1)h=l[f],b=n[f],c=B<<4,a=h[B],w=32768,v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=
v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,c+=1,w>>=1,
v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&
a&w?(v=r,C|=v):(a&=~w,0<v&&(--v,C|=v)),b[c]=v,h[B]=a,this.Y|=a;C&&(A|=1<<q,this.Mc=C)}B+=1}else B+=16;k[p]=A;d[p]|=A}G+=16;y+=16}};p.prototype.rh=function(){var f,c,a=this.ma,n,b,k=this.Ea,d,m,g,l,h,u,z,v,e;u=this.h;var p=this.c>>4;f=0;var q=u;this.Mc=0;0>f&&(f=0);q>u&&(q=u);u=f<<4;z=u+16;for(m=f;m<q;m+=1){v=0;b=k[m];for(g=0;g<p;g+=1)if(e=b[g])for(l=15;0<=l;--l){if(e&1<<l)for(f=u;f<z;f+=1)for(n=a[f],c=v<<4,h=15;0<=h;--h)d=n[c],0<d&&--d,n[c]=d,c+=1,this.Mc|=d;v+=1}else v+=16;u+=16;z+=16}};p.prototype.Kg=
function(){var f=this.Y,c=this.i;-1===this.u?(0===f&&-1!==this.Uj&&(this.i=this.Uj),this.xg(),this.i=c,0!==f&&0===this.Y&&(this.Uj=this.i),f=this.Y):f=this.Y|this.Mc;return f};p.prototype.xg=function(){var f,c,a,n=this.ma,b,k,d,m=this.Ea,g=this.xa,l=this.zf,h=this.H+1,u,z,v,e,p,q,w,G,y,B,x,A,C;G=this.h;var t=this.c>>4;f=0;var r=G;this.Y=0;this.i&1?(u=this.X,z=this.oa):(u=this.ib,z=this.U);0>f&&(f=0);r>G&&(r=G);G=f<<4;y=G+16;for(p=f;p<r;p+=1){B=0;v=z[p];k=g[p];d=m[p];for(q=0;q<t;q+=1){x=v[q]|k[q];
A=0;if(x)for(w=15;0<=w;--w){if(x&1<<w){C=0;for(f=G;f<y;)a=u[f],b=n[f],c=B<<4,a=a[B],this.Y|=a,C|=a,a&32768?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&16384?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&8192?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&4096?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&2048?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&1024?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&512?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&256?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&
128?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&64?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&32?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&16?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&8?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&4?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&2?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&1?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,f+=1,a=u[f],b=n[f],c=B<<4,a=a[B],this.Y|=a,C|=a,a&32768?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&16384?e=l[b[c]+h]:(e=l[b[c]],
C|=1<e),b[c]=e,c+=1,a&8192?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&4096?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&2048?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&1024?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&512?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&256?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&128?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&64?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&32?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&16?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=
e,c+=1,a&8?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&4?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&2?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&1?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,f+=1,a=u[f],b=n[f],c=B<<4,a=a[B],this.Y|=a,C|=a,a&32768?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&16384?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&8192?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&4096?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&2048?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&1024?e=l[b[c]+
h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&512?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&256?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&128?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&64?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&32?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&16?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&8?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&4?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&2?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&1?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),
b[c]=e,f+=1,a=u[f],b=n[f],c=B<<4,a=a[B],this.Y|=a,C|=a,a&32768?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&16384?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&8192?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&4096?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&2048?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&1024?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&512?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&256?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&128?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=
1,a&64?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&32?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&16?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&8?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&4?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&2?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,c+=1,a&1?e=l[b[c]+h]:(e=l[b[c]],C|=1<e),b[c]=e,f+=1;C&&(A|=1<<w)}B+=1}else B+=16;k[q]=A;d[q]|=A}G+=16;y+=16}};p.prototype.lo=function(f,c,a,e,b,k,d,m,g,l){var h=this.cc;e=e*f+h.R;a=a*f+h.P;c=c*f+h.N;b=b*f+h.O;h=a-b+1;f=
e-c+1;this.M&&(h=a-c/2-(b-e/2)+1);h||(h=1);f||(f=1);k/=h;d/=f;l=Math.round(1E3*(k>d?d:k)/l)/1E3;l<m?l=m:l>g&&(l=g);return l};p.prototype.ae=function(f,c,a,e,b,k,d,m,g,l,h,u,z,v,p,q,A){var n=this.D,D=this.cc,y=this.Ia,L=this.Kf,x=this.i;p=q*(p/1E3-this.i/q);0>p?p=0:1<p&&(p=1);l?(x+=p,L.R=z*x+D.R,L.P=u*x+D.P,L.N=h*x+D.N,L.O=v*x+D.O,g&&(y.O<L.O&&(L.O=y.O),y.N<L.N&&(L.N=y.N),y.P>L.P&&(L.P=y.P),y.R>L.R&&(L.R=y.R)),n=L):g&&(n=y);g=n.O;l=n.P;h=n.R;n=n.N;this.sc&&!A&&(D.O<g&&(g=D.O),D.P>l&&(l=D.P),D.R>h&&
(h=D.R),D.N<n&&(n=D.N));-1!==this.Ib&&(A=this.pa,D=this.Ma,this.width/2-A/2<g&&(g=this.width/2-A/2),this.width/2+A/2>l&&(l=this.width/2+A/2),this.height/2-D/2<n&&(n=this.height/2-D/2),this.height/2+D/2>h&&(h=this.height/2+D/2));m?(A=k,D=d,g=this.width/2-A/2,l=this.width/2+A/2,h=this.height/2+D/2,n=this.height/2-D/2):(A=l-g+1,D=h-n+1);this.M&&(g-=h/2,A=l-n/2-g+1);0===A&&(A=1);0===D&&(D=1);f/=A;c/=D;b=Math.round(1E3*(f>c?c:f)/b)/1E3;b/=this.Wb;b<a?b=a:b>e&&(b=e);return[b,g-this.Tc+A/2,n-this.xc+D/2]};
p.prototype.Bg=function(f,c,a){var e=this.$b,b=this.s,k=this.m,d=c*b+0;f=c*b+f;b=f-15;if(0<=c&&c<k){for(;d<=b;)e[d]=a,d+=1,e[d]=a,d+=1,e[d]=a,d+=1,e[d]=a,d+=1,e[d]=a,d+=1,e[d]=a,d+=1,e[d]=a,d+=1,e[d]=a,d+=1,e[d]=a,d+=1,e[d]=a,d+=1,e[d]=a,d+=1,e[d]=a,d+=1,e[d]=a,d+=1,e[d]=a,d+=1,e[d]=a,d+=1,e[d]=a,d+=1;for(;d<=f;)e[d]=a,d+=1}};p.prototype.de=function(f,c,a,e){var b=this.$b,n=this.s;c=c*n+f;a=a*n+f;var d=a-15*n;if(0<=f&&f<n){for(;c<=d;)b[c]=e,c+=n,b[c]=e,c+=n,b[c]=e,c+=n,b[c]=e,c+=n,b[c]=e,c+=n,b[c]=
e,c+=n,b[c]=e,c+=n,b[c]=e,c+=n,b[c]=e,c+=n,b[c]=e,c+=n,b[c]=e,c+=n,b[c]=e,c+=n,b[c]=e,c+=n,b[c]=e,c+=n,b[c]=e,c+=n,b[c]=e,c+=n;for(;c<=a;)b[c]=e,c+=n}};p.prototype.Gb=function(){var f,c,a,e=this.s,b=this.m,k=this.fe,d=this.ee,m=this.K,g,l,h=k,u,z=((this.height/2-(this.A+this.xc))*m+b/2)%m,v=((this.width/2-(this.F+this.Tc))*m+e/2)%m;a=0<this.Pc&&this.ef?2:1;for(u=k;a;){g=-(e/2/m)-(this.width/2-this.F-this.Tc)|0;for(f=0;f<=e+m;f+=m)if(0<this.Pc&&this.ef&&(h=g%this.Pc?k:d),g+=1,h===u)if(this.M)for(l=
-(b/2/m)-(this.height/2-this.A-this.xc)|0,c=z;c<b;c+=m)l&1?this.de(Math.round(f+v+m/2),Math.round(c),Math.round(c+m-1),h):this.de(Math.round(f+v),Math.round(c),Math.round(c+m-1),h),l+=1;else this.de(Math.round(f+v),0,b-1,h);g=-(b/2/m)-(this.height/2-this.A-this.xc)|0;for(c=z;c<b;c+=m)0<this.Pc&&this.ef&&(h=g%this.Pc?k:d),g+=1,h===u&&this.Bg(e-1,Math.round(c),h);--a;u=d}};p.prototype.te=function(){return 4<=this.K&&!this.qb};p.prototype.Ag=function(){var f=this.pa,c=this.Ma,a=this.ma,e=(this.width-
f)/2-1|0,b=(this.width+f)/2|0,k=(this.height-c)/2-1|0,d=(this.height+c)/2|0,m=q.lm,g=a[k],l=a[d];if(f)if(c){for(f=e;f<=b;f+=1)g[f]=m,l[f]=m;for(f=k+1;f<=d-1;f+=1)a[f][e]=m,a[f][b]=m}else for(f=0;f<this.height;f+=1)a[f][e]=m,a[f][b]=m;else for(f=0;f<this.width;f+=1)g[f]=m,l[f]=m};p.prototype.mq=function(){this.Mf&&(this.vm(),--this.Mf,this.Mf||(this.ua.set(this.aa),this.Ba.set(this.fa),this.ic.set(this.hb)));this.K=this.zoom*this.Wb;this.K<ViewConstants.sa?this.K=ViewConstants.sa:this.K>ViewConstants.kb&&
(this.K=ViewConstants.kb);this.rb=this.F+this.Tc;this.sb=this.A+this.xc;this.b=this.tc/2+1;this.qb=this.M?0:this.angle;-1!==this.Ib&&this.Ag();this.zg();.125>this.K?this.we?0===this.i?this.gb(this.Ec,15):this.Ic(this.Ec,this.Qa,15):this.gb(this.Qa,15):.25>this.K?this.we?0===this.i?this.gb(this.hc,7):this.Ic(this.hc,this.ia,7):this.gb(this.ia,7):.5>this.K?this.we?0===this.i?this.gb(this.Zb,3):this.Ic(this.Zb,this.ha,3):this.gb(this.ha,3):1>this.K?this.we?0===this.i?this.gb(this.L,1):this.Ic(this.L,
this.v,1):this.gb(this.v,1):this.we?0===this.i?this.gb(this.ec,0):this.Ic(this.ec,this.ma,0):this.gb(this.ma,0)};p.prototype.bj=function(f,c){var a=this.s>>3,e=this.ke,b=this.$b,k,d,m,g,l,h,u,z,v,p,q,A=1,w=1,G=0,y,B=this.Pa&~c,x=this.Ua&~c,r=~c,C=~c,t=f,H=this.K;1<this.b&&(A=this.o);h=Math.sin(this.qb/180*Math.PI)/this.K;u=Math.cos(this.qb/180*Math.PI)/this.K;z=-(this.s/2*-h+this.m/2*u)+this.sb;v=-(this.s/2*u+this.m/2*h)+this.rb;1<this.o&&1<this.b&&(G=.4/(this.o-1),w=.6);this.Sb(w);k=8192>this.width?
e[0]|0:this.Ig|0;q=0;l=z;for(d=0;d<this.m;d+=1){g=v;for(m=0;m<a;m+=1)(g&r)===(g&B)&&(l&C)===(l&x)?(y=t[l&x][g&B]|0,b[q]=e[y]):b[q]=k,q+=1,g+=u,l-=h,(g&r)===(g&B)&&(l&C)===(l&x)?(y=t[l&x][g&B]|0,b[q]=e[y]):b[q]=k,q+=1,g+=u,l-=h,(g&r)===(g&B)&&(l&C)===(l&x)?(y=t[l&x][g&B]|0,b[q]=e[y]):b[q]=k,q+=1,g+=u,l-=h,(g&r)===(g&B)&&(l&C)===(l&x)?(y=t[l&x][g&B]|0,b[q]=e[y]):b[q]=k,q+=1,g+=u,l-=h,(g&r)===(g&B)&&(l&C)===(l&x)?(y=t[l&x][g&B]|0,b[q]=e[y]):b[q]=k,q+=1,g+=u,l-=h,(g&r)===(g&B)&&(l&C)===(l&x)?(y=t[l&x][g&
B]|0,b[q]=e[y]):b[q]=k,q+=1,g+=u,l-=h,(g&r)===(g&B)&&(l&C)===(l&x)?(y=t[l&x][g&B]|0,b[q]=e[y]):b[q]=k,q+=1,g+=u,l-=h,(g&r)===(g&B)&&(l&C)===(l&x)?(y=t[l&x][g&B]|0,b[q]=e[y]):b[q]=k,q+=1,g+=u,l-=h;v+=h;l=z+=u}this.Bb&&this.te()&&this.Gb();for(k=1;k<A;k+=1)for(p=-1!==this.u?this.u/this.o*k|0:(this.H+1)/this.o*k|0,w+=G,this.Sb(w),h/=this.b,u/=this.b,H*=this.b,.125>H?(t=this.Qa,c=15):.25>H?(t=this.ia,c=7):.5>H?(t=this.ha,c=3):1>H?(t=this.v,c=1):(t=this.ma,c=0),B=this.Pa&~c,x=this.Ua&~c,r=~c,C=~c,z=-(this.s/
2*-h+this.m/2*u)+this.sb,v=-(this.s/2*u+this.m/2*h)+this.rb,q=0,l=z,d=0;d<this.m;d+=1){g=v;for(m=0;m<a;m+=1)(g&r)===(g&B)&&(l&C)===(l&x)&&(y=t[l&x][g&B]|0,y>=p&&(b[q]=e[y])),q+=1,g+=u,l-=h,(g&r)===(g&B)&&(l&C)===(l&x)&&(y=t[l&x][g&B]|0,y>=p&&(b[q]=e[y])),q+=1,g+=u,l-=h,(g&r)===(g&B)&&(l&C)===(l&x)&&(y=t[l&x][g&B]|0,y>=p&&(b[q]=e[y])),q+=1,g+=u,l-=h,(g&r)===(g&B)&&(l&C)===(l&x)&&(y=t[l&x][g&B]|0,y>=p&&(b[q]=e[y])),q+=1,g+=u,l-=h,(g&r)===(g&B)&&(l&C)===(l&x)&&(y=t[l&x][g&B]|0,y>=p&&(b[q]=e[y])),q+=
1,g+=u,l-=h,(g&r)===(g&B)&&(l&C)===(l&x)&&(y=t[l&x][g&B]|0,y>=p&&(b[q]=e[y])),q+=1,g+=u,l-=h,(g&r)===(g&B)&&(l&C)===(l&x)&&(y=t[l&x][g&B]|0,y>=p&&(b[q]=e[y])),q+=1,g+=u,l-=h,(g&r)===(g&B)&&(l&C)===(l&x)&&(y=t[l&x][g&B]|0,y>=p&&(b[q]=e[y])),q+=1,g+=u,l-=h;v+=h;l=z+=u}};p.prototype.ej=function(f,c){var a=this.s>>3,e=this.ke,b=this.$b,k,d,m,g,l,h,u,z,v,p,q=1,A=1,w=0,G,y=this.Pa&~c,B=this.Ua&~c,x=~c,r=~c,C=f,t,H=this.K;1<this.b&&(q=this.o);h=1/this.K;u=-(this.m/2*h)+this.sb;z=-(this.s/2*h)+this.rb;1<
this.o&&1<this.b&&(w=.4/(this.o-1),A=.6);this.Sb(A);k=8192>this.width?e[0]|0:this.Ig|0;p=0;l=u;for(d=0;d<this.m;d+=1){if((l&r)===(l&B))for(t=C[l&B],g=z,this.M&&(g+=.5*(l|0)),m=0;m<a;m+=1)(g&x)===(g&y)?(G=t[g&y]|0,b[p]=e[G]):b[p]=k,p+=1,g+=h,(g&x)===(g&y)?(G=t[g&y]|0,b[p]=e[G]):b[p]=k,p+=1,g+=h,(g&x)===(g&y)?(G=t[g&y]|0,b[p]=e[G]):b[p]=k,p+=1,g+=h,(g&x)===(g&y)?(G=t[g&y]|0,b[p]=e[G]):b[p]=k,p+=1,g+=h,(g&x)===(g&y)?(G=t[g&y]|0,b[p]=e[G]):b[p]=k,p+=1,g+=h,(g&x)===(g&y)?(G=t[g&y]|0,b[p]=e[G]):b[p]=k,
p+=1,g+=h,(g&x)===(g&y)?(G=t[g&y]|0,b[p]=e[G]):b[p]=k,p+=1,g+=h,(g&x)===(g&y)?(G=t[g&y]|0,b[p]=e[G]):b[p]=k,p+=1,g+=h;else for(m=0;m<a;m+=1)b[p]=k,p+=1,b[p]=k,p+=1,b[p]=k,p+=1,b[p]=k,p+=1,b[p]=k,p+=1,b[p]=k,p+=1,b[p]=k,p+=1,b[p]=k,p+=1;l=u+=h}this.Bb&&this.te()&&this.Gb();for(k=1;k<q;k+=1)for(v=-1!==this.u?this.u/this.o*k|0:(this.H+1)/this.o*k|0,A+=w,this.Sb(A),h/=this.b,H*=this.b,.125>H?(C=this.Qa,c=15):.25>H?(C=this.ia,c=7):.5>H?(C=this.ha,c=3):1>H?(C=this.v,c=1):(C=this.ma,c=0),y=this.Pa&~c,B=
this.Ua&~c,x=~c,r=~c,u=-(this.m/2*h)+this.sb,z=-(this.s/2*h)+this.rb,p=0,l=u,d=0;d<this.m;d+=1){if((l&r)===(l&B))for(t=C[l&B],g=z,this.M&&(g+=.5*(l|0)),m=0;m<a;m+=1)(g&x)===(g&y)&&(G=t[g&y]|0,G>=v&&(b[p]=e[G])),p+=1,g+=h,(g&x)===(g&y)&&(G=C[l&B][g&y]|0,G>=v&&(b[p]=e[G])),p+=1,g+=h,(g&x)===(g&y)&&(G=C[l&B][g&y]|0,G>=v&&(b[p]=e[G])),p+=1,g+=h,(g&x)===(g&y)&&(G=C[l&B][g&y]|0,G>=v&&(b[p]=e[G])),p+=1,g+=h,(g&x)===(g&y)&&(G=C[l&B][g&y]|0,G>=v&&(b[p]=e[G])),p+=1,g+=h,(g&x)===(g&y)&&(G=C[l&B][g&y]|0,G>=v&&
(b[p]=e[G])),p+=1,g+=h,(g&x)===(g&y)&&(G=C[l&B][g&y]|0,G>=v&&(b[p]=e[G])),p+=1,g+=h,(g&x)===(g&y)&&(G=C[l&B][g&y]|0,G>=v&&(b[p]=e[G])),p+=1,g+=h;else p+=a<<3;l=u+=h}};p.prototype.oj=function(f,c){var a=this.s>>3,e=this.ke,b=this.$b,k,d,m,g,l,h,u,z,v,p,q,A=1,w=1,G=0,y,B=this.Pa&~c,x=this.Ua&~c,r=f,C=this.K;1<this.b&&(A=this.o);h=Math.sin(this.qb/180*Math.PI)/this.K;u=Math.cos(this.qb/180*Math.PI)/this.K;z=-(this.s/2*-h+this.m/2*u)+this.sb;v=-(this.s/2*u+this.m/2*h)+this.rb;1<this.o&&1<this.b&&(G=.4/
(this.o-1),w=.6);this.Sb(w);q=0;l=z;for(d=0;d<this.m;d+=1){g=v;for(m=0;m<a;m+=1)y=r[l&x][g&B]|0,b[q]=e[y],q+=1,g+=u,l-=h,y=r[l&x][g&B]|0,b[q]=e[y],q+=1,g+=u,l-=h,y=r[l&x][g&B]|0,b[q]=e[y],q+=1,g+=u,l-=h,y=r[l&x][g&B]|0,b[q]=e[y],q+=1,g+=u,l-=h,y=r[l&x][g&B]|0,b[q]=e[y],q+=1,g+=u,l-=h,y=r[l&x][g&B]|0,b[q]=e[y],q+=1,g+=u,l-=h,y=r[l&x][g&B]|0,b[q]=e[y],q+=1,g+=u,l-=h,y=r[l&x][g&B]|0,b[q]=e[y],q+=1,g+=u,l-=h;v+=h;l=z+=u}this.Bb&&this.te()&&this.Gb();for(k=1;k<A;k+=1)for(p=-1!==this.u?this.u/this.o*k|
0:(this.H+1)/this.o*k|0,w+=G,this.Sb(w),h/=this.b,u/=this.b,C*=this.b,.125>C?(r=this.Qa,c=15):.25>C?(r=this.ia,c=7):.5>C?(r=this.ha,c=3):1>C?(r=this.v,c=1):(r=this.ma,c=0),B=this.Pa&~c,x=this.Ua&~c,z=-(this.s/2*-h+this.m/2*u)+this.sb,v=-(this.s/2*u+this.m/2*h)+this.rb,q=0,l=z,d=0;d<this.m;d+=1){g=v;for(m=0;m<a;m+=1)y=r[l&x][g&B]|0,y>=p&&(b[q]=e[y]),q+=1,g+=u,l-=h,y=r[l&x][g&B]|0,y>=p&&(b[q]=e[y]),q+=1,g+=u,l-=h,y=r[l&x][g&B]|0,y>=p&&(b[q]=e[y]),q+=1,g+=u,l-=h,y=r[l&x][g&B]|0,y>=p&&(b[q]=e[y]),q+=
1,g+=u,l-=h,y=r[l&x][g&B]|0,y>=p&&(b[q]=e[y]),q+=1,g+=u,l-=h,y=r[l&x][g&B]|0,y>=p&&(b[q]=e[y]),q+=1,g+=u,l-=h,y=r[l&x][g&B]|0,y>=p&&(b[q]=e[y]),q+=1,g+=u,l-=h,y=r[l&x][g&B]|0,y>=p&&(b[q]=e[y]),q+=1,g+=u,l-=h;v+=h;l=z+=u}};p.prototype.rj=function(f,c){var a=this.s>>3,e=this.ke,b=this.$b,k,d,m,g,l,h,u,z,v,p=1,q=1,A=0,w,G=this.Pa&~c,y=this.Ua&~c,B=f,x,r=this.K;1<this.b&&(p=this.o);l=1/this.K;h=-(this.m/2*l)+this.sb;u=-(this.s/2*l)+this.rb;1<this.o&&1<this.b&&(A=.4/(this.o-1),q=.6);this.Sb(q);v=0;m=h;
for(d=0;d<this.m;d+=1){x=B[m&y];g=u;this.M&&(g+=.5*(m|0));for(m=0;m<a;m+=1)w=x[g&G]|0,b[v]=e[w],v+=1,g+=l,w=x[g&G]|0,b[v]=e[w],v+=1,g+=l,w=x[g&G]|0,b[v]=e[w],v+=1,g+=l,w=x[g&G]|0,b[v]=e[w],v+=1,g+=l,w=x[g&G]|0,b[v]=e[w],v+=1,g+=l,w=x[g&G]|0,b[v]=e[w],v+=1,g+=l,w=x[g&G]|0,b[v]=e[w],v+=1,g+=l,w=x[g&G]|0,b[v]=e[w],v+=1,g+=l;m=h+=l}this.Bb&&this.te()&&this.Gb();for(k=1;k<p;k+=1)for(z=-1!==this.u?this.u/this.o*k|0:(this.H+1)/this.o*k|0,q+=A,this.Sb(q),l/=this.b,r*=this.b,.125>r?(B=this.Qa,c=15):.25>r?
(B=this.ia,c=7):.5>r?(B=this.ha,c=3):1>r?(B=this.v,c=1):(B=this.ma,c=0),G=this.Pa&~c,y=this.Ua&~c,h=-(this.m/2*l)+this.sb,u=-(this.s/2*l)+this.rb,v=0,m=h,d=0;d<this.m;d+=1){x=B[m&y];g=u;this.M&&(g+=.5*(m|0));for(m=0;m<a;m+=1)w=x[g&G]|0,w>=z&&(b[v]=e[w]),v+=1,g+=l,w=x[g&G]|0,w>=z&&(b[v]=e[w]),v+=1,g+=l,w=x[g&G]|0,w>=z&&(b[v]=e[w]),v+=1,g+=l,w=x[g&G]|0,w>=z&&(b[v]=e[w]),v+=1,g+=l,w=x[g&G]|0,w>=z&&(b[v]=e[w]),v+=1,g+=l,w=x[g&G]|0,w>=z&&(b[v]=e[w]),v+=1,g+=l,w=x[g&G]|0,w>=z&&(b[v]=e[w]),v+=1,g+=l,w=x[g&
G]|0,w>=z&&(b[v]=e[w]),v+=1,g+=l;m=h+=l}};p.prototype.gb=function(f,c){var a=Math.sin(this.qb/180*Math.PI)/this.K,e=Math.cos(this.qb/180*Math.PI)/this.K,b=this.s,k=this.m,d=-(this.s/2*-a+this.m/2*e)+this.sb,m=-(this.s/2*e+this.m/2*a)+this.rb,g=d+b*-a,l=m+b*e,h=d+k*e,k=m+k*a,a=h+b*-a,e=k+b*e,b=d,u=m;l<u&&(u=l);k<u&&(u=k);e<u&&(u=k);l>m&&(m=l);k>m&&(m=k);e>m&&(m=e);g<b&&(b=g);h<b&&(b=h);a<b&&(b=a);g>d&&(d=g);h>d&&(d=h);a>d&&(d=a);0>(u|0)||(m|0)>=this.width||0>(b|0)||(d|0)>=this.height?this.qb?this.bj(f,
c):this.ej(f,c):this.qb?this.oj(f,c):this.rj(f,c)};p.prototype.Bh=function(f,c,a){var e=this.s>>3,b=this.ke,k=this.$b,d,m,g,l,h,u,z,v;v=ViewConstants.Ha[3]+128;var p=ViewConstants.Ha[4]+128,q=ViewConstants.Ha[5]+128,A=ViewConstants.Ha[6]+128,w,G=1,y=1,B=0,x,r,C=this.W,t=this.Pa&~a,H=this.Ua&~a,F=~a;a=~a;var J,K=c,Q=this.K;1<this.b&&(G=this.o);c=Math.sin(this.qb/180*Math.PI)/this.K;h=Math.cos(this.qb/180*Math.PI)/this.K;u=-(this.s/2*-c+this.m/2*h)+this.sb;z=-(this.s/2*h+this.m/2*c)+this.rb;1<this.o&&
1<this.b&&(B=.4/(this.o-1),y=.6);this.Sb(y);J=8192>this.width?b[0]|0:this.Ig|0;w=0;l=u;for(d=0;d<this.m;d+=1){g=z;for(m=0;m<e;m+=1)(g&F)===(g&t)&&(l&a)===(l&H)?(x=K[l&H][g&t],r=f[l&H][g&t],r===p||r===A?(x>=C&&(r=v),x=b[r]|0):r===v||r===q?(x<C&&(r=p),x=b[r]|0):x=b[x]|0,k[w]=x):k[w]=J,w+=1,g+=h,l-=c,(g&F)===(g&t)&&(l&a)===(l&H)?(x=K[l&H][g&t],r=f[l&H][g&t],r===p||r===A?(x>=C&&(r=v),x=b[r]|0):r===v||r===q?(x<C&&(r=p),x=b[r]|0):x=b[x]|0,k[w]=x):k[w]=J,w+=1,g+=h,l-=c,(g&F)===(g&t)&&(l&a)===(l&H)?(x=K[l&
H][g&t],r=f[l&H][g&t],r===p||r===A?(x>=C&&(r=v),x=b[r]|0):r===v||r===q?(x<C&&(r=p),x=b[r]|0):x=b[x]|0,k[w]=x):k[w]=J,w+=1,g+=h,l-=c,(g&F)===(g&t)&&(l&a)===(l&H)?(x=K[l&H][g&t],r=f[l&H][g&t],r===p||r===A?(x>=C&&(r=v),x=b[r]|0):r===v||r===q?(x<C&&(r=p),x=b[r]|0):x=b[x]|0,k[w]=x):k[w]=J,w+=1,g+=h,l-=c,(g&F)===(g&t)&&(l&a)===(l&H)?(x=K[l&H][g&t],r=f[l&H][g&t],r===p||r===A?(x>=C&&(r=v),x=b[r]|0):r===v||r===q?(x<C&&(r=p),x=b[r]|0):x=b[x]|0,k[w]=x):k[w]=J,w+=1,g+=h,l-=c,(g&F)===(g&t)&&(l&a)===(l&H)?(x=K[l&
H][g&t],r=f[l&H][g&t],r===p||r===A?(x>=C&&(r=v),x=b[r]|0):r===v||r===q?(x<C&&(r=p),x=b[r]|0):x=b[x]|0,k[w]=x):k[w]=J,w+=1,g+=h,l-=c,(g&F)===(g&t)&&(l&a)===(l&H)?(x=K[l&H][g&t],r=f[l&H][g&t],r===p||r===A?(x>=C&&(r=v),x=b[r]|0):r===v||r===q?(x<C&&(r=p),x=b[r]|0):x=b[x]|0,k[w]=x):k[w]=J,w+=1,g+=h,l-=c,(g&F)===(g&t)&&(l&a)===(l&H)?(x=K[l&H][g&t],r=f[l&H][g&t],r===p||r===A?(x>=C&&(r=v),x=b[r]|0):r===v||r===q?(x<C&&(r=p),x=b[r]|0):x=b[x]|0,k[w]=x):k[w]=J,w+=1,g+=h,l-=c;z+=c;l=u+=h}this.Bb&&this.te()&&this.Gb();
for(f=1;f<G;f+=1)for(v=-1!==this.u?this.u/this.o*f|0:(this.H+1)/this.o*f|0,y+=B,this.Sb(y),c/=this.b,h/=this.b,Q*=this.b,.125>Q?(K=this.Qa,a=15):.25>Q?(K=this.ia,a=7):.5>Q?(K=this.ha,a=3):1>Q?(K=this.v,a=1):(K=this.ma,a=0),t=this.Pa&~a,H=this.Ua&~a,F=~a,a=~a,u=-(this.s/2*-c+this.m/2*h)+this.sb,z=-(this.s/2*h+this.m/2*c)+this.rb,w=0,l=u,d=0;d<this.m;d+=1){g=z;for(m=0;m<e;m+=1)(g&F)===(g&t)&&(l&a)===(l&H)&&(x=K[l&H][g&t]|0,x>=v&&(k[w]=b[x])),w+=1,g+=h,l-=c,(g&F)===(g&t)&&(l&a)===(l&H)&&(x=K[l&H][g&
t]|0,x>=v&&(k[w]=b[x])),w+=1,g+=h,l-=c,(g&F)===(g&t)&&(l&a)===(l&H)&&(x=K[l&H][g&t]|0,x>=v&&(k[w]=b[x])),w+=1,g+=h,l-=c,(g&F)===(g&t)&&(l&a)===(l&H)&&(x=K[l&H][g&t]|0,x>=v&&(k[w]=b[x])),w+=1,g+=h,l-=c,(g&F)===(g&t)&&(l&a)===(l&H)&&(x=K[l&H][g&t]|0,x>=v&&(k[w]=b[x])),w+=1,g+=h,l-=c,(g&F)===(g&t)&&(l&a)===(l&H)&&(x=K[l&H][g&t]|0,x>=v&&(k[w]=b[x])),w+=1,g+=h,l-=c,(g&F)===(g&t)&&(l&a)===(l&H)&&(x=K[l&H][g&t]|0,x>=v&&(k[w]=b[x])),w+=1,g+=h,l-=c,(g&F)===(g&t)&&(l&a)===(l&H)&&(x=K[l&H][g&t]|0,x>=v&&(k[w]=
b[x])),w+=1,g+=h,l-=c;z+=c;l=u+=h}};p.prototype.Ih=function(f,c,a){var e=this.s>>3,b=this.ke,k=this.$b,d,m,g,l,h,u,z,v;v=ViewConstants.Ha[3]+128;var p=ViewConstants.Ha[4]+128,q=ViewConstants.Ha[5]+128,r=ViewConstants.Ha[6]+128,w,A=1,y=1,B=0,x,E,C=this.W,t=this.Pa&~a;a=this.Ua&~a;var H=c,F=this.K;1<this.b&&(A=this.o);c=Math.sin(this.qb/180*Math.PI)/this.K;h=Math.cos(this.qb/180*Math.PI)/this.K;u=-(this.s/2*-c+this.m/2*h)+this.sb;z=-(this.s/2*h+this.m/2*c)+this.rb;1<this.o&&1<this.b&&(B=.4/(this.o-
1),y=.6);this.Sb(y);w=0;l=u;for(d=0;d<this.m;d+=1){g=z;for(m=0;m<e;m+=1)x=H[l&a][g&t],E=f[l&a][g&t],E===p||E===r?(x>=C&&(E=v),x=b[E]|0):E===v||E===q?(x<C&&(E=p),x=b[E]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c,x=H[l&a][g&t],E=f[l&a][g&t],E===p||E===r?(x>=C&&(E=v),x=b[E]|0):E===v||E===q?(x<C&&(E=p),x=b[E]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c,x=H[l&a][g&t],E=f[l&a][g&t],E===p||E===r?(x>=C&&(E=v),x=b[E]|0):E===v||E===q?(x<C&&(E=p),x=b[E]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c,x=H[l&a][g&t],E=f[l&a][g&t],E===p||E===
r?(x>=C&&(E=v),x=b[E]|0):E===v||E===q?(x<C&&(E=p),x=b[E]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c,x=H[l&a][g&t],E=f[l&a][g&t],E===p||E===r?(x>=C&&(E=v),x=b[E]|0):E===v||E===q?(x<C&&(E=p),x=b[E]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c,x=H[l&a][g&t],E=f[l&a][g&t],E===p||E===r?(x>=C&&(E=v),x=b[E]|0):E===v||E===q?(x<C&&(E=p),x=b[E]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c,x=H[l&a][g&t],E=f[l&a][g&t],E===p||E===r?(x>=C&&(E=v),x=b[E]|0):E===v||E===q?(x<C&&(E=p),x=b[E]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c,x=H[l&a][g&t],E=f[l&
a][g&t],E===p||E===r?(x>=C&&(E=v),x=b[E]|0):E===v||E===q?(x<C&&(E=p),x=b[E]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c;z+=c;l=u+=h}this.Bb&&this.te()&&this.Gb();for(f=1;f<A;f+=1)for(v=-1!==this.u?this.u/this.o*f|0:(this.H+1)/this.o*f|0,y+=B,this.Sb(y),c/=this.b,h/=this.b,F*=this.b,.125>F?(H=this.Qa,a=15):.25>F?(H=this.ia,a=7):.5>F?(H=this.ha,a=3):1>F?(H=this.v,a=1):(H=this.ma,a=0),t=this.Pa&~a,a=this.Ua&~a,u=-(this.s/2*-c+this.m/2*h)+this.sb,z=-(this.s/2*h+this.m/2*c)+this.rb,w=0,l=u,d=0;d<this.m;d+=1){g=
z;for(m=0;m<e;m+=1)x=H[l&a][g&t]|0,x>=v&&(k[w]=b[x]),w+=1,g+=h,l-=c,x=H[l&a][g&t]|0,x>=v&&(k[w]=b[x]),w+=1,g+=h,l-=c,x=H[l&a][g&t]|0,x>=v&&(k[w]=b[x]),w+=1,g+=h,l-=c,x=H[l&a][g&t]|0,x>=v&&(k[w]=b[x]),w+=1,g+=h,l-=c,x=H[l&a][g&t]|0,x>=v&&(k[w]=b[x]),w+=1,g+=h,l-=c,x=H[l&a][g&t]|0,x>=v&&(k[w]=b[x]),w+=1,g+=h,l-=c,x=H[l&a][g&t]|0,x>=v&&(k[w]=b[x]),w+=1,g+=h,l-=c,x=H[l&a][g&t]|0,x>=v&&(k[w]=b[x]),w+=1,g+=h,l-=c;z+=c;l=u+=h}};p.prototype.aj=function(f,c,a){var e=this.s>>3,b=this.ke,k=this.$b,d,m,g,l,h,
u;u=ViewConstants.Ha[3]+128;var z=ViewConstants.Ha[4]+128,v=ViewConstants.Ha[5]+128,p=ViewConstants.Ha[6]+128,q,r=1,w=1,A=0,y,B,x=this.W,E=this.Pa&~a;a=this.Ua&~a;var C=c,t,H,F=this.K;1<this.b&&(r=this.o);c=1/this.K;l=-(this.m/2*c)+this.sb;h=-(this.s/2*c)+this.rb;1<this.o&&1<this.b&&(A=.4/(this.o-1),w=.6);this.Sb(w);q=0;m=l;for(d=0;d<this.m;d+=1){t=C[m&a];H=f[m&a];g=h;this.M&&(g+=.5*(m|0));for(m=0;m<e;m+=1)y=t[g&E],B=H[g&E],B===z||B===p?(y>=x&&(B=u),y=b[B]|0):B===u||B===v?(y<x&&(B=z),y=b[B]|0):y=
b[y]|0,k[q]=y,q+=1,g+=c,y=t[g&E],B=H[g&E],B===z||B===p?(y>=x&&(B=u),y=b[B]|0):B===u||B===v?(y<x&&(B=z),y=b[B]|0):y=b[y]|0,k[q]=y,q+=1,g+=c,y=t[g&E],B=H[g&E],B===z||B===p?(y>=x&&(B=u),y=b[B]|0):B===u||B===v?(y<x&&(B=z),y=b[B]|0):y=b[y]|0,k[q]=y,q+=1,g+=c,y=t[g&E],B=H[g&E],B===z||B===p?(y>=x&&(B=u),y=b[B]|0):B===u||B===v?(y<x&&(B=z),y=b[B]|0):y=b[y]|0,k[q]=y,q+=1,g+=c,y=t[g&E],B=H[g&E],B===z||B===p?(y>=x&&(B=u),y=b[B]|0):B===u||B===v?(y<x&&(B=z),y=b[B]|0):y=b[y]|0,k[q]=y,q+=1,g+=c,y=t[g&E],B=H[g&E],
B===z||B===p?(y>=x&&(B=u),y=b[B]|0):B===u||B===v?(y<x&&(B=z),y=b[B]|0):y=b[y]|0,k[q]=y,q+=1,g+=c,y=t[g&E],B=H[g&E],B===z||B===p?(y>=x&&(B=u),y=b[B]|0):B===u||B===v?(y<x&&(B=z),y=b[B]|0):y=b[y]|0,k[q]=y,q+=1,g+=c,y=t[g&E],B=H[g&E],B===z||B===p?(y>=x&&(B=u),y=b[B]|0):B===u||B===v?(y<x&&(B=z),y=b[B]|0):y=b[y]|0,k[q]=y,q+=1,g+=c;m=l+=c}this.Bb&&this.te()&&this.Gb();for(f=1;f<r;f+=1)for(u=-1!==this.u?this.u/this.o*f|0:(this.H+1)/this.o*f|0,w+=A,this.Sb(w),c/=this.b,F*=this.b,.125>F?(C=this.Qa,a=15):.25>
F?(C=this.ia,a=7):.5>F?(C=this.ha,a=3):1>F?(C=this.v,a=1):(C=this.ma,a=0),E=this.Pa&~a,a=this.Ua&~a,l=-(this.m/2*c)+this.sb,h=-(this.s/2*c)+this.rb,q=0,m=l,d=0;d<this.m;d+=1){t=C[m&a];g=h;this.M&&(g+=.5*(m|0));for(m=0;m<e;m+=1)y=t[g&E]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c,y=t[g&E]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c,y=t[g&E]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c,y=t[g&E]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c,y=t[g&E]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c,y=t[g&E]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c,y=t[g&E]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c,y=
t[g&E]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c;m=l+=c}};p.prototype.Fh=function(f,c,a){var e=this.s>>3,b=this.ke,k=this.$b,d,m,g,l,h,u;u=ViewConstants.Ha[3]+128;var z=ViewConstants.Ha[4]+128,v=ViewConstants.Ha[5]+128,p=ViewConstants.Ha[6]+128,q,r=1,w=1,A=0,y,B,x,E=this.W,C=this.Pa&~a,t=this.Ua&~a,H=~a;a=~a;var F=c,J,K,Q=this.K;1<this.b&&(r=this.o);c=1/this.K;l=-(this.m/2*c)+this.sb;h=-(this.s/2*c)+this.rb;1<this.o&&1<this.b&&(A=.4/(this.o-1),w=.6);this.Sb(w);x=8192>this.width?b[0]|0:this.Ig|0;q=0;m=l;for(d=
0;d<this.m;d+=1){if((m&a)===(m&t))for(J=F[m&t],K=f[m&t],g=h,this.M&&(g+=.5*(m|0)),m=0;m<e;m+=1)(g&H)===(g&C)?(y=J[g&C],B=K[g&C],B===z||B===p?(y>=E&&(B=u),y=b[B]|0):B===u||B===v?(y<E&&(B=z),y=b[B]|0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c,(g&H)===(g&C)?(y=J[g&C],B=K[g&C],B===z||B===p?(y>=E&&(B=u),y=b[B]|0):B===u||B===v?(y<E&&(B=z),y=b[B]|0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c,(g&H)===(g&C)?(y=J[g&C],B=K[g&C],B===z||B===p?(y>=E&&(B=u),y=b[B]|0):B===u||B===v?(y<E&&(B=z),y=b[B]|0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c,(g&
H)===(g&C)?(y=J[g&C],B=K[g&C],B===z||B===p?(y>=E&&(B=u),y=b[B]|0):B===u||B===v?(y<E&&(B=z),y=b[B]|0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c,(g&H)===(g&C)?(y=J[g&C],B=K[g&C],B===z||B===p?(y>=E&&(B=u),y=b[B]|0):B===u||B===v?(y<E&&(B=z),y=b[B]|0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c,(g&H)===(g&C)?(y=J[g&C],B=K[g&C],B===z||B===p?(y>=E&&(B=u),y=b[B]|0):B===u||B===v?(y<E&&(B=z),y=b[B]|0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c,(g&H)===(g&C)?(y=J[g&C],B=K[g&C],B===z||B===p?(y>=E&&(B=u),y=b[B]|0):B===u||B===v?(y<E&&(B=z),y=b[B]|
0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c,(g&H)===(g&C)?(y=J[g&C],B=K[g&C],B===z||B===p?(y>=E&&(B=u),y=b[B]|0):B===u||B===v?(y<E&&(B=z),y=b[B]|0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c;else for(m=0;m<e;m+=1)k[q]=x,q+=1,k[q]=x,q+=1,k[q]=x,q+=1,k[q]=x,q+=1,k[q]=x,q+=1,k[q]=x,q+=1,k[q]=x,q+=1,k[q]=x,q+=1;m=l+=c}this.Bb&&this.te()&&this.Gb();for(f=1;f<r;f+=1)for(u=-1!==this.u?this.u/this.o*f|0:(this.H+1)/this.o*f|0,w+=A,this.Sb(w),c/=this.b,Q*=this.b,.125>Q?(F=this.Qa,a=15):.25>Q?(F=this.ia,a=7):.5>Q?(F=this.ha,a=3):
1>Q?(F=this.v,a=1):(F=this.ma,a=0),C=this.Pa&~a,t=this.Ua&~a,H=~a,a=~a,l=-(this.m/2*c)+this.sb,h=-(this.s/2*c)+this.rb,q=0,m=l,d=0;d<this.m;d+=1){if((m&a)===(m&t))for(J=F[m&t],g=h,this.M&&(g+=.5*(m|0)),m=0;m<e;m+=1)(g&H)===(g&C)&&(y=J[g&C]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c,(g&H)===(g&C)&&(y=J[g&C]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c,(g&H)===(g&C)&&(y=J[g&C]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c,(g&H)===(g&C)&&(y=J[g&C]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c,(g&H)===(g&C)&&(y=J[g&C]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c,(g&H)===
(g&C)&&(y=J[g&C]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c,(g&H)===(g&C)&&(y=J[g&C]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c,(g&H)===(g&C)&&(y=J[g&C]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c;else q+=e<<3;m=l+=c}};p.prototype.Ic=function(f,c,a){var e=Math.sin(this.qb/180*Math.PI)/this.K,b=Math.cos(this.qb/180*Math.PI)/this.K,k=this.s,d=this.m,m=-(this.s/2*-e+this.m/2*b)+this.sb,g=-(this.s/2*b+this.m/2*e)+this.rb,l=m+k*-e,h=g+k*b,u=m+d*b,d=g+d*e,e=u+k*-e,b=d+k*b,k=m,z=g;h<z&&(z=h);d<z&&(z=d);b<z&&(z=d);h>g&&(g=h);d>g&&(g=d);b>g&&
(g=b);l<k&&(k=l);u<k&&(k=u);e<k&&(k=e);l>m&&(m=l);u>m&&(m=u);e>m&&(m=e);0>(z|0)||(g|0)>=this.width||0>(k|0)||(m|0)>=this.height?this.qb?this.Bh(f,c,a):this.Fh(f,c,a):this.qb?this.Ih(f,c,a):this.aj(f,c,a)};p.prototype.Gk=function(){var f,c,a,e;if(!this.Hb.data.buffer)for(a=this.Hb.data,e=this.ce,c=e.length,f=0;f<c;)a[f]=e[f],f+=1,a[f]=e[f],f+=1,a[f]=e[f],f+=1,a[f]=e[f],f+=1;this.dd.putImageData(this.Hb,0,0)};p.prototype.wg=function(){var f,c=0,a=this.m,e=this.s,b=this.$b,k=this.md;for(f=0;f<a;f+=1)b.set(k,
c),c+=e};window.LifeConstants=q;window.Life=p})();(function(){function r(r){this.v=r.replace(/&amp;/gi,"&");this.b=this.v.match(/\S+/g);this.current=0}r.prototype.ya=function(){var r="";this.b&&this.current<this.b.length&&(r=this.b[this.current],this.current+=1);return r};r.prototype.gg=function(){var r="";this.b&&this.current<this.b.length&&(r=this.b[this.current]);return r};r.prototype.Jm=function(r){var e=!1;if(this.b)for(;this.current<this.b.length&&!e;)this.b[this.current]===r&&(e=!0),this.current+=1;return e};r.prototype.c=function(r){return!isNaN(parseFloat(r))&&
isFinite(r)};r.prototype.h=function(r){var e=!1,p=r.indexOf("/");-1!==p&&(e=r.substr(0,p),r=r.substr(p+1),e=this.c(e)&&this.c(r));return e};r.prototype.H=function(r){var e=0,p,q;this.h(r)?(p=r.indexOf("/"),q=r.substr(0,p),r=r.substr(p+1),0!==r&&(e=q/r)):this.c(r)&&(e=parseFloat(r));return e};r.prototype.$=function(){var r=this.ya();return this.H(r)};r.prototype.ba=function(){var r=!1,e;this.b&&this.current<this.b.length&&(e=this.b[this.current],this.h(e)?r=!0:r=this.c(e));return r};window.Script=
r})();(function(){function r(e){this.c=e;this.$m=!1;this.angle=this.y=this.x=0;this.depth=this.o=this.zoom=1;this.Xa=0;this.Ta=60;this.step=1;this.cb=this.za=0;this.Yb="";this.Di=this.Te=this.Se=this.Ql=this.Sn=this.Rn=this.ki=this.Tg=this.Bf=this.Jh=this.Vh=this.Dc=this.Dh=this.re=this.Re=this.cd=this.bd=this.ad=this.bc=!1}function A(){this.ja=[];this.Uc=[];this.current=new r(this);this.H=new r(this);this.c=new r(this);this.h=!1;this.Af=0}r.prototype.set=function(e){this.x=e.x;this.y=e.y;this.ad=e.ad;
this.bd=e.bd;this.cd=e.cd;this.bc=e.bc;this.angle=e.angle;this.zoom=e.zoom;this.o=e.o;this.depth=e.depth;this.Xa=e.Xa;this.Ta=e.Ta;this.za=e.za;this.cb=e.cb;this.Yb=e.Yb};r.prototype.b=function(e,p,q){var f=e.cb+0,c=p.cb+0,a=e.angle+0,n=p.angle+0,b=1,k=1,d=1,m=1,g=1;c!==f&&(b=(q-f)/(c-f)+0,k=this.c.im(b)+0);p.ad||p.bc?d=b:d=k;p.bd||p.bc?m=b:m=k;p.cd||p.bc?g=b:g=k;this.x=e.x+d*(p.x-e.x);this.y=e.y+m*(p.y-e.y);this.zoom=e.zoom*Math.pow(p.zoom/e.zoom,g);180<n-a?a+=360:-180>n-a&&(n+=360);this.angle=(a+
k*(n-a))%360;this.o=e.o+b*(p.o-e.o)|0;this.depth=e.depth+b*(p.depth-e.depth);this.Xa=p.Xa;this.Ta=p.Ta;this.step=p.step;this.za=e.za+b*(p.za-e.za)|0;this.cb=q;this.Yb=p.Yb;this.bc=p.bc};A.prototype.Li=function(){return new r(this)};A.prototype.im=function(e){return-2*Math.pow(e,3)+3*Math.pow(e,2)+0*e+0};A.prototype.reset=function(){this.ja=[];this.Uc=[];this.h=!1;this.Af=0};A.prototype.Ip=function(){return this.ja[this.ja.length-1]};A.prototype.Im=function(e){var p=this.v(e),q=this.ja[p];e>q.za?e=
q.cb+1E3*(e-q.za)/(q.Ta*q.step):0<p?(p=this.ja[p-1],e=p.cb+1E3*(e-p.za)/(q.Ta*q.step)):e=1E3*e/(q.Ta*q.step);return e};A.prototype.wm=function(e,p,q,f,c,a,n,b,k,d,m){var g=this.H;g.x=e;g.y=p;g.zoom=q;g.angle=f;g.Ta=b;g.step=k;g.o=c;g.depth=a;g.Xa=n;g.za=d;this.h&&(m=this.c.cb);g.cb=m-1E3;this.update(m,d);this.c.set(this.current);this.c.bc=!1;this.c.cb=m;this.h=!0;return g.cb};A.prototype.sp=function(){return this.ja[0]};A.prototype.add=function(e){e.$m?this.Uc[this.Uc.length]=e:this.ja[this.ja.length]=
e};A.prototype.qk=function(e){var p=!1;this.Af>=this.ja.length-1&&e>=this.ja[this.Af].cb&&(p=!0);return p};A.prototype.b=function(e){return e===(e|0)?String(e|0):String(e.toFixed(1))};A.prototype.bq=function(e,p){var q="",f;0<=e&&e<this.Uc.length&&(f=this.Uc[e],q="X "+f.x+" Y "+f.y+" Z "+this.b(f.zoom),""!==f.Yb&&(q+=" "+p+f.Yb+p));return q};A.prototype.fr=function(e,p){var q="",f,c;0<=e&&e<this.ja.length&&(f=this.ja[e],0<e?(c=this.ja[e-1],q=f.za===c.za?"P "+this.b((f.cb-c.cb|0)/1E3):"T "+f.za,f.bc?
q+=" F":(f.x!==c.x&&(q+=" X "+-f.x),f.y!==c.y&&(q+=" Y "+-f.y),f.zoom!==c.zoom&&(q+=" Z "+this.b(f.zoom))),f.angle!==c.angle&&(q+=" A "+f.angle),f.o!==c.o&&(q+=" L "+f.o),f.depth!==c.depth&&(q+=" D "+this.b(f.depth)),f.Xa!==c.Xa&&(q+=" C "+f.Xa),f.Ta!==c.Ta&&(q+=" G "+f.Ta),f.step!==c.step&&(q+=" S "+f.step),""!==f.Yb&&(q+=" "+p+f.Yb+p)):q="T "+f.za+" X "+-f.x+" Y "+-f.y+" Z "+this.b(f.zoom)+" A "+f.angle+" L "+f.o+" D "+this.b(f.depth)+" C "+f.Xa+" G "+f.Ta+" S "+f.step);return q};A.prototype.update=
function(e,p){var q=this.ja.length,f=!1,c=this.Af,a,n=!1;if(this.h)this.current.b(this.H,this.c,e),e>=this.c.cb&&(this.h=!1);else{for(;c<q&&!f;)a=this.ja[c],a.cb>=e?f=!0:c+=1;f?0<c?(this.ja[c].bc&&(this.ja[c].x=this.current.x,this.ja[c].y=this.current.y,this.ja[c].zoom=this.current.zoom),this.current.b(this.ja[c-1],this.ja[c],e)):(c=0,this.current.set(this.ja[c])):(c=q-1,this.current.set(this.ja[c]),p>=this.current.za&&(n=!0));this.Af=c}return n};A.prototype.v=function(e){for(var p=0,q=!1,f=this.ja,
c=this.ja.length;p<c&&!q;)f[p].za>=e?q=!0:p+=1;q||(p=c-1);return p};A.prototype.rp=function(e){this.Af=this.v(e)};A.prototype.eq=function(e){var p,q,f,c=this.ja,a=this.ja.length;for(p=1;p<a;p+=1)q=c[p-1],f=c[p],f.Re||(f.x=q.x),f.re||(f.y=q.y),f.Se||(f.ad=q.ad),f.Te||(f.bd=q.bd),f.Di||(f.cd=q.cd),f.Dh||(f.angle=q.angle),f.Dc||(f.zoom=q.zoom),f.Vh||(f.o=q.o),f.Jh||(f.depth=q.depth),f.Bf||(f.Xa=q.Xa),f.Tg||(f.Ta=q.Ta),f.ki||(f.step=q.step),f.Rn?f.za<=q.za&&(e[e.length]=[Keywords.Vj+" "+f.za,"target generation must be later than previous ("+
q.za+")"]):f.za=q.za,f.cb=f.Sn?1E3*f.cb+q.cb:q.cb+1E3*(f.za-q.za)/(f.Ta*f.step)};window.Waypoint=r;window.WaypointManager=A})();(function(){function r(r,e){var p=this;this.am=r;this.g=e;this.top=this.left=0;""!==r.style.left&&(this.left=parseInt(r.style.left,10));""!==r.style.top&&(this.top=parseInt(r.style.top,10));this.wb=this.Tf=!1;this.Rh=this.Qh=this.Uh=this.Th=this.Fe=this.Ee=-1;registerEvent(r,"mousedown",function(e){p.c(p,e)},!1);registerEvent(document,"mousemove",function(e){p.h(p,e)},!1);registerEvent(document,"mouseup",function(e){p.v(p,e)},!1);registerEvent(r,"touchstart",function(e){p.b(p,e)},!1);registerEvent(r,
"touchmove",function(e){p.b(p,e)},!1);registerEvent(r,"touchend",function(e){p.b(p,e)},!1);registerEvent(window,"resize",function(){p.Gn(p)},!1)}r.prototype.Gn=function(r){r.Nn(r.left,r.top,r.am)};r.prototype.Vq=function(r,e){this.Nn(this.left+r,this.top+e,this.am)};r.prototype.Nn=function(r,e,p){var q=window.innerWidth-p.clientWidth,f=window.innerHeight-p.clientHeight;window.innerHeight<document.getElementsByTagName("body")[0].clientHeight&&(q-=21);0>r&&(r=0);0>e&&(e=0);r>q&&(r=q);e>f&&(e=f);p.style.left=
r+"px";p.style.top=e+"px";p.style.position="fixed";this.left=r;this.top=e};r.prototype.No=function(){var r=this.am,e=r.offsetParent;this.offsetLeft=r.offsetLeft;for(this.offsetTop=r.offsetTop;e;)this.offsetLeft+=e.offsetLeft,this.offsetTop+=e.offsetTop,e=e.offsetParent;e=r.parentNode;if("fixed"===e.style.position)this.offsetLeft+=document.body.scrollLeft+document.documentElement.scrollLeft,this.offsetTop+=document.body.scrollTop+document.documentElement.scrollTop;else for(;"body"!==e.tagName.toLowerCase();)this.offsetLeft-=
e.scrollLeft,this.offsetTop-=e.scrollTop,e=e.parentNode};r.prototype.b=function(r,e){var p,q,f="";if("touchend"===e.type)f="mouseup",q=document.createEvent("MouseEvent"),q.initMouseEvent(f,!0,!0,window,1,r.Th,r.Uh,r.Qh,r.Rh,!1,!1,!1,!1,0,null),e.target.dispatchEvent(q),e.preventDefault();else{if(1===e.touches.length)switch(e.type){case "touchstart":f="mousedown";break;case "touchmove":f="mousemove"}""!==f&&(p=e.changedTouches[0],q=document.createEvent("MouseEvent"),q.initMouseEvent(f,!0,!0,window,
1,p.screenX,p.screenY,p.clientX,p.clientY,!1,!1,!1,!1,0,null),p.target.dispatchEvent(q),e.preventDefault(),r.Th=p.screenX,r.Uh=p.screenY,r.Qh=p.clientX,r.Rh=p.clientY)}};r.prototype.c=function(r,e){r.rg(r,e);r.wb=!0;r.g.eg=!0;e.stopPropagation&&e.stopPropagation();e.preventDefault()};r.prototype.v=function(r,e){r.Tf&&r.wb&&(r.rg(r,e),r.wb=!1,r.g.eg=!1,e.stopPropagation&&e.stopPropagation(),e.preventDefault())};r.prototype.h=function(r,e){if(r.Tf&&r.wb){var p=r.Ee,q=r.Fe;r.rg(r,e);r.wb&&r.Vq(r.Ee-
p,r.Fe-q);r.Ee=p;r.Fe=q;e.stopPropagation&&e.stopPropagation();e.preventDefault()}};r.prototype.rg=function(r,e){var p,q;e.pageX||e.pageY?(p=e.pageX,q=e.pageY):(p=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,q=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);r.No();p-=r.offsetLeft;q-=r.offsetTop;r.Ee=p-1|0;r.Fe=q-1|0};window.PopupWindow=r})();(function(){function r(){this.h=new Uint8Array(256);this.c=this.b=0}r.prototype.Rd=function(r){var e,p,q,f=this.h;for(e=0;256>e;e+=1)f[e]=e;for(e=p=0;256>e;e+=1)p=p+f[e]+r.charCodeAt(e%r.length)&255,q=f[e],f[e]=f[p],f[p]=q;this.c=this.b=0};r.prototype.random=function(){var r,e,p=0,q=1,f=this.h,c=this.b,a=this.c;for(r=0;8>r;r+=1)c=c+1&255,a=a+f[c]&255,e=f[c],f[c]=f[a],f[a]=e,p+=f[f[c]+f[a]&255]*q,q*=256;this.b=c;this.c=a;return p/1.8446744073709552E19};window.Random=r;window.myRand=new r})();(function(){function r(r,e){this.Ij=r;this.x=e.ga(Float32,r,"Stars.x");this.y=e.ga(Float32,r,"Stars.y");this.c=e.ga(Float32,r,"Stars.z");this.blue=this.green=this.red=255;this.b=new Random;this.b.Rd(Date.now().toString());this.sin=e.ga(Float32,2880,"Stars.sin");this.cos=e.ga(Float32,2880,"Stars.cos");this.h=Math.PI/180;this.v=180/Math.PI;for(var p=0;2880>p;)this.sin[p]=Math.sin(p/8*this.h),this.cos[p]=Math.cos(p/8*this.h),p+=1}r.prototype.Rd=function(r,e,p){var q,f,c,a,n=this.Ij,b=r*r+e*e;for(q=0;q<
n;q+=1){a=q/n*(q/n)*(q/n)*(q/n)*p+1;do f=3*(this.b.random()*r-r/2),c=3*(this.b.random()*e-e/2);while(f*f+c*c>b);this.x[q]=f;this.y[q]=c;this.c[q]=a}};r.prototype.Po=function(r,e,p,q,f,c,a,n){var b,k,d,m,g,l,h,u,z;littleEndian?(h=n>>16&255,l=n>>8&255,g=n&255):(g=n>>24&255,l=n>>16&255,h=n>>8&255);for(b=0;b<this.Ij;b+=1)k=this.x[b]+r,d=this.y[b]+e,0!==q&&(m=Math.sqrt(k*k+d*d),d=Math.atan2(d,k)*this.v,d+=q,0>d?d+=360:360<=d&&(d-=360),d*=8,d|=0,k=m*this.cos[d],d=m*this.sin[d]),m=this.c[b]/p*2,k=f/2+k/
m|0,d=c/2+d/m|0,0<k&&k<f-1&&0<d&&d<c-1&&(k+=d*f,m=1536/m|0,255<m&&(m=255),m/=255,a[k]===n&&(d=g+(this.red-g)*m,u=l+(this.green-l)*m,z=h+(this.blue-h)*m,d=littleEndian?-16777216|z<<16|u<<8|d:d<<24|z<<16|u<<8|255,a[k]=d),m/=2,d=g+(this.red-g)*m,u=l+(this.green-l)*m,z=h+(this.blue-h)*m,d=littleEndian?-16777216|z<<16|u<<8|d:d<<24|z<<16|u<<8|255,--k,a[k]===n&&(a[k]=d),k+=2,a[k]===n&&(a[k]=d),--k,k-=f,a[k]===n&&(a[k]=d),k+=f+f,a[k]===n&&(a[k]=d))};window.Stars=r})();(function(){function r(h){this.Ah=Date.now().toString();this.Cb=this.qh=!1;this.vd=!0;this.bb=g.Bm;this.Nc=!1;this.element=h;this.ea=!1;this.Rb=this.hb=this.ob=this.Qb=this.yg=this.vg=this.xg=this.wg=0;this.Za=this.nd=this.Ya=this.md=!1;this.Lh=!0;this.gj=!1;this.fj=0;this.df=!1;this.Ue=this.If=0;this.tf=!1;this.Fa="";this.ha=this.fa=0;this.zc=this.Kh=this.Vf=this.Rg=this.cf=this.kg=this.mh=this.mg=this.lg=this.ve=-1;this.Jg=!1;this.tm=0;this.Hi=this.Sa=!1;this.Lf=0;this.Do=.01;this.Ne=this.gf=!1;
this.zb=this.ia=null;this.Gd=g.Gd;this.hc=[80,80,80];this.Wj=null;this.Ja="";this.jh=this.Ka=this.Td=!1;this.gb=null;this.Ae=!1;this.L=1;this.je=this.Ke=0;this.ab=this.Yk=!1;this.V=new WaypointManager;this.wj="";this.cl=-1;this.uc=this.eb=!1;this.G=1;this.Lk=this.yh=this.Df=0;this.oc=g.Op;this.Ek=0;this.fb=this.Aa=-1;this.Ff=this.Ef="";this.Hf=this.pc=this.Fb=this.$a=0;this.Gf=null;this.Qa=this.Gb=this.Ud="";this.Of=!1;this.c=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];this.Le=this.Je=-1;this.Ie=
"";this.kc=[];this.Jf=!1;this.W=[];this.Pd=[];this.Eb=[];this.na=1;this.C=0;this.eh=100;this.Va=10;this.sj=this.Jn=1;this.h=[64,200,290,530,700];this.ka=this.Wd=-1;this.ej=this.nj=this.Ye=this.fd=this.Lb=this.dh=this.dc=this.yb=this.nb=this.qa=!1;this.Bh=this.uh=this.zh=-1;this.a=null;this.Y=!0;this.$d=this.elapsedTime=0;this.s=640;this.m=512;this.Zc=this.Fl=this.ie=this.ub=!1;this.S=this.wd=this.$e=this.Qd=this.Ze=this.Id=this.sf=this.ee=this.Zb=this.Uf=this.he=this.Xf=this.vh=this.Kf=this.We=this.Wf=
this.Yf=this.se=this.Zf=this.fe=this.ce=this.Ia=this.Hd=this.Hc=this.Ec=this.Ic=this.Gc=this.Ag=this.Cg=this.Bg=this.zg=this.wh=this.Fc=this.uf=this.gd=this.zf=this.dd=this.vf=this.Zg=this.de=this.Hb=this.rc=this.vb=this.Oa=this.Ca=this.va=this.Nb=this.ud=this.Wa=this.da=null;this.Yg=this.Xg=-1;this.wheelDelta=0;this.Vb=this.dg=this.qd=this.v=this.qc=null;this.tb=60;this.w=this.g=null;this.Qg=this.Jb=this.Ng=this.vj=this.Sh=0;this.Rf=this.Dm=1;this.Ck=60;this.Pg=this.Yi=1;this.Bk=.1;this.hg=this.Db=
this.wl=0;this.gh=1;this.ng=this.Z=this.sh=this.rh=this.th=!1;this.xb=g.Cm;this.oj=this.tj=this.Ih=this.rj=0;this.Cf=!1;this.fi=0}function A(h,a,b,c,f){var z,u=a.parentNode,d=null,e=null;for(z=0;z<l.Ob.length&&!e;)l.Ob[z][0].tabIndex===a.tabIndex?e=l.Ob[z][1]:z+=1;e||(e=new r(f),e.Ae=c,m.Wh&&(e.oc=b&-8,e.oc<g.Sd&&(e.oc=g.Sd)),a.tabIndex=l.Ob.length+1,e.Xp(a),"none"===u.style.display&&(d=new PopupWindow(u,e.g)),l.Ob[l.Ob.length]=[a,e,d]);c||e.Jl(h,!1)}function e(h){h=h.parentNode;for(var a=!1;!a;)"div"!==
h.localName||h.className!==m.$i&&"codebox"!==h.className||(a=!0),a||(h=h.parentNode);return h}function p(){var h=l.Il(),a=h[1],b=h[2];h[0].parentNode.style.display="none";b.Tf=!1;a.ub&&(a.S.current=a.$c(g.La,!0,a))}function q(h){p();h.stopPropagation&&h.stopPropagation();h.preventDefault();return!1}function f(h){return h.innerHTML.replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/<br *\/>/gi,"\n").replace(/<br>/gi,"\n").replace(/&nbsp;/gi," ").replace(/<span class="posthilit">/gi,"").replace(/<\/span>/gi,
"").trim()}function c(h){var a=e(h);h=f(a.getElementsByTagName(m.fg)[0]);a=a.getElementsByTagName("form")[0];a.getElementsByTagName("input")[0].value=h;a.submit()}function a(h){var a=e(h),b=f(a.getElementsByTagName(m.fg)[0]),c=l.Il(),d,n,k,p,r,y;c?c[1].$l(c[1]):(c=document.createElement("canvas"),c.width=g.Sd,c.height=g.ah+80,c.style.display="block",n=document.createElement("a"),n.setAttribute("href","#"),n.innerHTML="&nbsp;X&nbsp;",n.style.textDecoration="none",n.style.fontFamily="Lucida Grande,Verdana,Helvetica,Arial,sans-serif",
n.style.color="#FFFFFF",n.style.backgroundColor="#C75050",n.style.cssFloat="right",n.style.height="28px",n.style.fontSize="18px",y=document.createElement("a"),y.innerHTML="&nbsp;X&nbsp;",y.style.textDecoration="none",y.style.fontFamily="Lucida Grande,Verdana,Helvetica,Arial,sans-serif",y.style.visibility="hidden",y.style.cssFloat="left",y.style.height="28px",y.style.fontSize="18px",r=document.createElement("div"),r.style.textAlign="center",r.style.color="rgb(83,100,130)",r.style.fontFamily="Arial, Verdana, Helvetica, sans-serif",
r.style.fontSize="18px",r.style.height="28px",p=document.createTextNode("LifeViewer"),r.style.cursor="default",r.appendChild(p),registerEvent(n,"click",q,!1),d=document.createElement("div"),d.style.display="none",d.style.position="fixed",d.style.border="1px solid rgb(128,128,128)",d.style.left="2048px",d.style.top="0px",d.style.width=g.Sd+"px",d.style.textAlign="right",d.style.boxShadow="0px 0px 3px 3px rgba(0,0,0,.3), 12px 12px 8px rgba(0,0,0,.5)",d.style.margin="1px",k=document.createElement("div"),
k.className="codebox",k.style.backgroundColor="#FFFFFF",k.style.height="28px",k.style.lineHeight="28px",k.appendChild(y),k.appendChild(n),k.appendChild(r),d.appendChild(k),d.appendChild(c),a.appendChild(d),A(b,c,g.Sd,!0,h),l.Hl=l.Ob.length-1,c=l.Il(),c[1].Wj=p);a=c[0].parentNode;""!==a.style.display&&(a.style.display="");c[1].s=g.Sd;c[1].m=g.ah+80;c[1].resize();c[1].g.notification.clear(!0,!0);c[1].g.notification.clear(!1,!0);c[1].Jl(b,!0);h=c[2];h.Tf=!0;h.Gn(h);c[1].qd.canvas.focus();c[1].g.hasFocus=
!0;return!1}function n(h){c(this);h.stopPropagation&&h.stopPropagation();h.preventDefault();return!1}function b(h){a(this);h.stopPropagation&&h.stopPropagation();h.preventDefault();return!1}function k(){var h=document.getElementsByTagName("div"),a,c,d,e,g,l=new Allocator;a=document.getElementsByTagName("meta");for(c=0;c<a.length;c+=1)if(e=a[c],e.name===m.tagName&&(m.Vk=!1,m.Wh=!1,e=e.content,d=e.match(/\S+/g),2<=d.length&&5>=d.length))for(m.$i=d[0],m.fg=d[1],e=2;e<d.length;e+=1)switch(d[e]){case "hide":m.Vk=
!0;break;case "limit":m.Wh=!0;break;default:g=d[e],!isNaN(parseFloat(g))&&isFinite(g)&&(m.Lj=parseFloat(g)|0)}for(a=0;a<h.length;a+=1)if(e=h[a],e.className===m.$i)c=e.getElementsByTagName(m.fg)[0],e=e.getElementsByTagName("canvas")[0],(d=c.getElementsByTagName(m.fg)[0])&&(c=d),typedArrays&&e&&e.getContext?c&&(d=f(c),-1<m.Lj&&c.clientHeight>m.Lj&&(c.style.height=m.Lj+"px"),A(d,e,c.offsetWidth,!1,c)):m.Vk&&e&&(e.style.display="none");else if(typedArrays&&e.className===m.kp&&e.parentNode.className!==
m.$i&&(c=e.getElementsByTagName(m.fg)[0])){d=f(c);c=null;g=!1;var k=null;try{k=PatternManager.create("",d,l),k.Kb&&(g=!0)}catch(G){}if(d=g)c=e.getElementsByTagName("a")[0],d=document.createElement("a"),d.setAttribute("href","#"),d.innerHTML="Show in Viewer",registerEvent(d,"click",b,!1),g=document.createTextNode(" / "),c.parentNode.appendChild(g),c.parentNode.appendChild(d);d=!1}}var d={mb:'"',gi:"[[",yl:"]]",Kl:"STATE1FIT",Sk:"HARDRESET",wi:"TRACK",qg:"TRACKBOX",vi:"TRACKLOOP",jl:"NOREPORT",ij:"GRAPH",
Ej:"NOGRAPH",Ok:"GRAPHOPACITY",Pk:"GRAPHPOINTS",Hg:"ALL",Rc:"LINEAR",Bd:"BEZIER",Uk:"HEXDISPLAY",Gl:"SQUAREDISPLAY",Zm:"INTEGERZOOM",rl:"RANDOMSEED",Dk:"DELETERANGE",Dl:"SHOWTIMING",Kk:"EXTENDEDTIMING",Bl:"SHOWGENSTATS",Cl:"SHOWINFOBAR",nl:"POI",nh:"TITLE",ji:"STARS",mi:"CUSTOM",ak:"XOFFSET",bk:"YOFFSET",Un:"BACKGROUND",Rl:"ALIVE",Tn:"ALIVERAMP",Sl:"DEAD",Vn:"DEADRAMP",km:"BOUNDARY",Ii:"AUTOFIT",Wk:"HISTORYFIT",Tj:"STEP",hl:"NOSTEPBACK",Vj:"T",ll:"PAUSE",Oh:"GRID",Nh:"GRIDMAJOR",Pl:"TEXT",Ik:"ERROR",
sn:"OFF",un:"ON",Um:"HISTORY",en:"MARK1",jn:"MARKOFF",gn:"MARK2",an:"KILL",Om:"GRAPHBG",Nm:"GRAPHAXIS",Mm:"GRAPHALIVE",Pm:"GRAPHBIRTH",Qm:"GRAPHDEATH",wa:"COLOR",vk:"COLOUR",Ml:"STRICT",Bi:"VIEWONLY",gl:"NOGUI",il:"NORLE",Ul:"THUMBNAIL",Tl:"THUMBSIZE",Xn:"THUMBLAUNCH",ni:"THEME",Ji:"AUTOSTART",Yh:"LOOP",li:"STOP",Gi:"ANGLE",xj:"LAYERS",Zi:"DEPTH",hj:"GPS",Pb:"ZOOM",nk:"Z",Bc:"X",Cc:"Y",$j:"WIDTH",pj:"HEIGHT",Ac:"#"},m={tagName:"LifeViewer",$i:"rle",fg:"code",Lj:37,Vk:!0,Wh:!0,kp:"codebox"},g={Bm:.7,
Ij:1E4,Bq:"Script errors",nf:-2,mf:2,rn:2,on:4,Cm:4,eo:45,pr:0,or:1,Xm:null,qn:1,ln:16,Am:3,Pf:0,Lg:1,Mi:2,Qf:3,Oi:4,Ui:5,Vi:6,Wi:7,Xi:8,Ni:9,Ri:10,Qi:11,Pi:12,Si:13,Ti:14,yk:15,tn:0,vn:1,Wm:2,fn:3,kn:4,hn:5,bn:6,Ha:[0,6,2,5,3,4,1],Lq:"Off On History Mark1 MarkOff Mark2 Kill".split(" "),Kq:"OFF ON HISTORY MARK1 MARKOFF MARK2 KILL".split(" "),kl:12,aq:0,$p:160,yn:10,ml:100,xn:20,Km:19,lr:!1,Jk:1800,pp:"LifeViewer",xl:"LifeViewer Image",ho:"LifeViewer Plugin",Yl:231,fo:"Chris Rowett",Cj:1,zj:10,el:0,
Up:1,La:2,bh:3,ck:1.25,Bj:0,mn:10,Sf:10,sa:.0625,kb:32,Rp:-16,Lp:-1,sd:1,lf:60,$f:1,vc:50,Ga:null,fontSize:18,cj:"18px Courier",sg:"18px Arial",ne:"18px Arial",yc:"14px Arial",Sj:"9px Arial",Vg:"rgb(32,255,255)",qj:"#000000",Gd:"rgb(255,96,96)",jj:"rgb(128,128,128)",Tp:64,Sp:64,Sd:480,Op:1024,Dp:80,Dj:240,pn:800,ah:480,qp:64,Ll:0,Pn:1,Qn:2,Qp:0,Jp:16},l={Ob:[],Hl:-1,Il:function(){var h=null;-1!==this.Hl&&(h=this.Ob[this.Hl]);return h},dr:function(){var h,a=0,b;for(b=0;b<this.Ob.length;b+=1)h=this.Ob[b][1],
h.ub&&(a+=1);return a},nq:function(){var h,a,b=0;for(a=0;a<this.Ob.length;a+=1)h=this.Ob[a][1],h.S.current=h.$c(g.el,!0,h),h.g.xf(!0),b+=1;return b},Mq:function(){var h,a,b=0;for(a=0;a<this.Ob.length;a+=1)h=this.Ob[a][1],h.ub&&(h.S.current=h.$c(g.La,!0,h),b+=1);return b},Nq:function(h){var a,b,c=0;for(b=0;b<this.Ob.length;b+=1)a=this.Ob[b][1],a!==h&&a.ub&&(a.S.current=a.$c(g.La,!0,a),c+=1);return c}};r.prototype.Io=function(h){var a=h.dg.toDataURL("image/png"),b;(b=document.getElementById("screenshot"))?
b.src=a:(b=window.open("",g.xl))?(b.width=h.s+20,b.height=h.m+20,b.document.open(),b.document.write('<!DOCTYPE html>\n<html>\n\t<head>\n\t\t<meta charset="UTF-8">\n\t\t<title>'+g.xl+'</title>\n\t</head>\n\t<body>\n\t\t<img width="'+h.s+'" height="'+h.m+'" src="'+a+'" alt="'+g.xl+'"/>\n\t</body>\n</html>\n'),b.document.close(),h.g.notification.B("Image Captured",300,!0)):h.g.notification.B("Could not open Image window!",g.Jk,!0)};r.prototype.Aq=function(h,a,b){var c,z,u=this.a.ib,d=this.a.ma,f=this.a.ec,
e=h.width,l=h.height,m=(e-1>>4)+1,n=a>>4,k=this.a.Pa,p=this.a.Pa>>4,q=this.a.Ua,r=a&15,A,J,K,Q,T=this.Lb;for(z=0;z<l;z+=1){A=h.Kb[z];J=u[z+b&q];if(T||-1!==this.a.u)for(K=h.Ge[z],Q=d[z+b&q],c=0;c<e;c+=1)Q[c+a&k]=K[c];if(r)for(c=0;c<m;c+=1)J[c+n&p]|=A[c]>>r,J[c+1+n&p]|=A[c]<<16-r;else for(c=0;c<m;c+=1)J[c+n&p]|=A[c]}if(f)for(z=0;z<l;z+=1)for(K=h.Ge[z],u=f[z+b&q],c=0;c<e;c+=1)(d=K[c])&&(u[c+a&k]=g.Ha[d]+128)};r.prototype.Fg=function(h,a,b){h=h[0];a&&(b.bb=h);return[h,100*h]};r.prototype.qe=function(h,
a,b){var c=h[0],z=0;a?(b.uc=!0,b.a.zoom=g.sa*Math.pow(g.kb/g.sa,h[0])/b.a.Wb):(c=Math.log(b.a.zoom*b.a.Wb/g.sa)/Math.log(g.kb/g.sa),0>c?c=0:1<c&&(c=1));this.Ya&&!this.Za?z=b.a.zoom*b.a.Wb:z=b.a.zoom;z<g.sa?z=g.sa:z>g.kb&&(z=g.kb);1>z&&(z=-1/z);return[c,z]};r.prototype.Co=function(h){var a=h/6E4|0;h=h%6E4/1E3;var b="";0<a&&(b=a+":",10>h&&(b+="0"));return b+=h.toFixed(2)};r.prototype.ae=function(h,a){var b,c=this.a.zoom,u=this.a.F,d=this.a.A;this.Z?(b=this.a.ae(this.s*this.xb,this.m*this.xb,g.sa,g.kb,
g.ck,this.$a,this.Fb,this.yb&&this.mo,this.gf,this.Ya,this.Qb,this.hb,this.ob,this.Rb,this.elapsedTime,this.tb,this.Ne),b[0]/=this.xb):(b=g.Dp,this.dc&&(b=0),b=this.a.ae(this.s,this.m-b,g.sa,g.kb,g.ck,this.$a,this.Fb,this.yb&&this.mo,this.gf,this.Ya,this.Qb,this.hb,this.ob,this.Rb,this.elapsedTime,this.tb,this.Ne));this.Sa&&!h?(this.a.zoom=(5*this.a.zoom+b[0])/6,this.a.F=(5*this.a.F+b[1])/6,this.a.A=(5*this.a.A+b[2])/6,c=this.a.zoom>c?this.a.zoom/c-1:c/this.a.zoom-1,u=this.a.F>u?this.a.F-u:u-this.a.F,
d=this.a.A>d?this.a.A-d:d-this.a.A,this.Lf=c,u>this.Lf&&(this.Lf=u),d>this.Lf&&(this.Lf=d),.01>=this.Lf&&(this.a.zoom=b[0],this.a.F=b[1],this.a.A=b[2])):(this.lg=this.a.width/2-this.a.F,this.mg=this.a.height/2-this.a.A,this.mh=this.a.zoom,this.kg=this.a.angle,this.cf=this.a.width/2-b[1],this.Rg=this.a.height/2-b[2],this.Vf=b[0],this.Kh=this.kg,a?this.zc=0:(this.zc=g.kl,this.bo()));this.Ca&&(this.Ca.current=this.qe([this.a.zoom,this.a.zoom],!1,this));this.va&&(this.va.current=this.zi([this.a.angle,
this.a.angle],!1,this))};r.prototype.jq=function(h){var a=h.width,b=h.height;-1!==this.a.Ib&&(0!==this.a.pa&&(a=this.a.pa),0!==this.a.Ma&&(b=this.a.Ma));a=(this.a.width-a>>1)+this.fa;b=(this.a.height-b>>1)+this.ha;!this.yb&&this.a.sc||!PatternManager.Sg||(this.yb=this.Lb=!0);this.Aq(h,a,b)};r.prototype.hi=function(h){var a=h+String();1E9<=h?a="1B+":1E8<=h?a=(h/1E6|0)+"M":1E7<=h?a=(h/1E6).toFixed(1)+"M":1E6<=h?a=(h/1E6).toFixed(2)+"M":1E5<=h&&(a=(h/1E3|0)+"K");return a};r.prototype.po=function(h,a,
b){var c=b,z=!1,u=this.L;h&&(h.fillStyle===g.qj&&(z=!0),0<=u&&u<=0+this.Va&&(h.font=g.cj,z||(h.fillStyle=1<(this.C|0)?g.Vg:g.jj),h.fillText("Up",a,b),z||(h.fillStyle=g.Vg),h.fillText(" / ",a+h.measureText("Up").width,b),z||(h.fillStyle=(this.C|0)<this.eh-this.Va?g.Vg:g.jj),h.fillText("Down",a+h.measureText("Up / ").width,b),z||(h.fillStyle=g.Vg),h.font=g.sg,h.fillText("scroll help",a+this.h[0],b),c+=19));this.L+=1;return c};r.prototype.H=function(h,a,b,c,d,f,e){var z,u=this.L;c&&(z=13,u>=e&&u<=e+
this.Va&&(e=c.fillStyle,e!==g.qj&&(c.fillStyle="rgb("+h+","+a+","+b+")"),c.fillRect(d,f-(z>>1)-1,z,z),c.fillStyle=e))};r.prototype.b=function(h,a,b,c,d,f){var z=d,u=String(a).indexOf("\t"),e=this.L,l=0;if(b&&e>=f&&e<=f+this.Va){if(h.length){b.font=g.cj;b.fillText(h,c,d);for(b.font=g.sg;-1!==u;)b.fillText(a.substr(0,u),c+this.h[l],d),l+=1,a=a.substr(u+1),u=a.indexOf("\t");b.fillText(a,c+this.h[l],d)}else b.font=g.sg,b.fillText(a,c,d);z+=19}this.L+=1;return z};r.prototype.aa=function(h,a,b){for(var c=
ColourManager.kc,z=Object.keys(c),u="    "+h+" "+a+" "+b,d=!1,f,e=0;e<z.length&&!d;)f=c[z[e]],f[1]===h&&f[2]===a&&f[3]===b?(u+=" "+f[0],d=!0,e=z.length):e+=1;return u};r.prototype.Ve=function(h){return this.aa(h.red,h.green,h.blue)};r.prototype.Wp=function(){var h=0,a=0;this.a.i?this.Y&&(h=this.a.D.P-this.a.D.O+1,a=this.a.D.R-this.a.D.N+1):(h=this.$a,a=this.Fb);-1!==this.a.Ib&&(0!==this.a.pa&&(h=this.a.pa),0!==this.a.Ma&&(a=this.a.Ma));return h+" x "+a};r.prototype.Zp=function(){var h="AutoFit";this.gf&&
(h+=" History");this.Ne&&(h+=" State 1");return h};r.prototype.aj=function(h){for(var a=10-h.length,b="";0<a;)b+=" ",--a;return b+h};r.prototype.tl=function(h,a,b,c){var f=b,e="Player",u,n,k,p;u=this.a.fc[this.a.Ed];k=this.kc;this.L=1;this.h[0]=108;b=this.b("",g.ho+" build "+g.Yl+" by "+g.fo,h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","",h,a,b,c);this.h[0]=124;b=this.b("","Keyboard commands",h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","Playback controls:",h,a,b,c);this.Lb?b=this.b("R","reset",h,
a,b,c):(b=this.b("Enter","toggle play / pause",h,a,b,c),b=this.b("Space","pause / next generation",h,a,b,c),b=this.b("B","pause / previous generation",h,a,b,c),b=this.b("Tab","pause / next step",h,a,b,c),b=this.b("Shift Tab","pause / previous step",h,a,b,c),b=this.Ae?this.b("Esc","close LifeViewer",h,a,b,c):this.b("Esc","pause if playing",h,a,b,c),b=this.b("R","reset to generation 0",h,a,b,c),b=this.b("Shift R","reset all LifeViewers to generation 0",h,a,b,c),b=this.b("-","decrease generation speed",
h,a,b,c),b=this.b("+","increase generation speed",h,a,b,c),b=this.b("Shift -","minimum generation speed",h,a,b,c),b=this.b("Shift +","maximum generation speed",h,a,b,c),b=this.b("D","decrease step size",h,a,b,c),b=this.b("E","increase step size",h,a,b,c),b=this.b("Shift D","minimum step size",h,a,b,c),b=this.b("Shift E","maximum step size",h,a,b,c),b=this.b("0","reset step and speed",h,a,b,c),this.eb?(b=-1!==this.ka?this.b("W","toggle waypoint playback and loop",h,a,b,c):this.b("W","toggle waypoint playback",
h,a,b,c),b=this.b("Y","move back in time",h,a,b,c),b=this.b("U","move forward in time",h,a,b,c)):-1!==this.ka&&(b=this.b("W","toggle loop",h,a,b,c)));b=this.b("Z","stop playback in all other LifeViewers",h,a,b,c);b=this.b("Shift Z","stop playback in all LifeViewers",h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","Camera controls:",h,a,b,c);if(this.m>=g.ah||(this.Z&&this.Ih)>=g.ah)b=this.b("M","toggle navigation menu",h,a,b,c);b=this.b("V","restore saved camera position",h,a,b,c);b=this.b("Shift V",
"save current camera position",h,a,b,c);this.V.Uc.length&&(b=this.b("J","jump to next point of interest",h,a,b,c),b=this.b("Shift J","jump to previous point of interest",h,a,b,c));b=this.b("F","fit pattern to display",h,a,b,c);b=this.b("Shift F","toggle autofit",h,a,b,c);b=this.b("Shift H","toggle autofit history mode",h,a,b,c);this.a.sc&&(b=this.b("Shift S","toggle autofit state 1 mode",h,a,b,c));b=this.b("[","zoom out",h,a,b,c);b=this.b("]","zoom in",h,a,b,c);b=this.b("Shift [","halve zoom",h,a,
b,c);b=this.b("Shift ]","double zoom",h,a,b,c);b=this.b("1","1x zoom",h,a,b,c);b=this.b("2","2x zoom",h,a,b,c);b=this.b("4","4x zoom",h,a,b,c);b=this.b("8","8x zoom",h,a,b,c);b=this.b("6","16x zoom",h,a,b,c);b=this.b("3","32x zoom",h,a,b,c);b=this.b("Shift 1","integer zoom",h,a,b,c);b=this.b("Shift 2","-2x zoom",h,a,b,c);b=this.b("Shift 4","-4x zoom",h,a,b,c);b=this.b("Shift 8","-8x zoom",h,a,b,c);b=this.b("Shift 6","-16x zoom",h,a,b,c);b=this.b("Left","pan left",h,a,b,c);b=this.b("Right","pan right",
h,a,b,c);b=this.b("Up","pan up",h,a,b,c);b=this.b("Down","pan down",h,a,b,c);b=this.b("Shift Left","pan north west",h,a,b,c);b=this.b("Shift Right","pan south east",h,a,b,c);b=this.b("Shift Up","pan north east",h,a,b,c);b=this.b("Shift Down","pan south west",h,a,b,c);b=this.b("<","rotate left",h,a,b,c);b=this.b(">","rotate right",h,a,b,c);b=this.b("Shift <","rotate left 90 degrees",h,a,b,c);b=this.b("Shift >","rotate right 90 degrees",h,a,b,c);b=this.b("5","reset angle",h,a,b,c);b=this.b("","",h,
a,b,c);this.Lb||(b=this.b("","View controls:",h,a,b,c),b=this.b("Q","increase number of layers",h,a,b,c),b=this.b("A","decrease number of layers",h,a,b,c),b=this.b("P","increase layer depth",h,a,b,c),b=this.b("L","decrease layer depth",h,a,b,c),b=this.b("C","cycle colour theme",h,a,b,c),b=this.b("Shift C","default theme",h,a,b,c),b=this.b("","",h,a,b,c));b=this.b("","Display controls:",h,a,b,c);this.Lb||(b=this.b("G","toggle generation statistics",h,a,b,c),b=this.b("Shift G","toggle generation display mode",
h,a,b,c),b=this.b("Y","toggle population graph",h,a,b,c),b=this.b("Shift Y","toggle graph lines",h,a,b,c),b=this.b("7","decrease graph opacity",h,a,b,c),b=this.b("9","increase graph opacity",h,a,b,c));b=this.b("/","toggle hex view",h,a,b,c);b=this.b("Shift /","pattern default view",h,a,b,c);b=this.b("T","toggle timing information",h,a,b,c);b=this.b("Shift T","toggle extended timing information",h,a,b,c);b=this.b("I","toggle pattern and engine information",h,a,b,c);b=this.b("Shift I","toggle information bar",
h,a,b,c);b=this.b("X","toggle grid lines",h,a,b,c);0<this.a.Pc&&(b=this.b("Shift X","toggle major grid lines",h,a,b,c));this.ng&&(b=this.b("N","toggle thumbnail view",h,a,b,c));b=this.b("S","toggle stars",h,a,b,c);b=this.b("O","open screenshot in separate window",h,a,b,c);b=this.b("Shift O","open population graph in separate window",h,a,b,c);b=this.b("Control C","copy pattern to clipboard",h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","Help controls:",h,a,b,c);b=this.b("Up","scroll up one line",h,
a,b,c);b=this.b("Down","scroll down one line",h,a,b,c);b=this.b("Page Up","scroll up one page",h,a,b,c);b=this.b("Page Down","scroll down one page",h,a,b,c);b=this.b("Home","go to first help page",h,a,b,c);b=this.b("End","go to last help page",h,a,b,c);b=this.b("","",h,a,b,c);this.h[0]=252;b=this.b("","",h,a,b,c);this.Jn=this.L;b=this.b("","Scripts",h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","Scripts must be embedded in pattern comments",h,a,b,c);b=this.b("","Commands must be surrounded by whitespace",
h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","Commands:",h,a,b,c);b=this.b(d.gi,"start script section",h,a,b,c);b=this.b(d.yl,"end script section",h,a,b,c);b=this.b(d.Ml,"enable strict validation",h,a,b,c);b=this.b(d.Ji,"start play automatically",h,a,b,c);b=this.b(d.Sk,"always use hard reset",h,a,b,c);b=this.b(d.Yh+" <1..>","loop at generation",h,a,b,c);b=this.b(d.li+" <1..>","stop at generation",h,a,b,c);b=this.b(d.Vj+" <0..>","waypoint at generation",h,a,b,c);b=this.b(d.ll+" <0.0..>","pause for time",
h,a,b,c);b=this.b(d.Rc+" "+d.Hg+"|"+d.Bc+"|"+d.Cc+"|"+d.Pb,"linear motion",h,a,b,c);b=this.b(d.Bd+" "+d.Hg+"|"+d.Bc+"|"+d.Cc+"|"+d.Pb,"bezier motion (default)",h,a,b,c);b=this.b(d.Ii,"fit pattern to display",h,a,b,c);b=this.b(d.Wk,"autofit uses pattern history",h,a,b,c);b=this.b(d.Kl,"autofit only uses state 1",h,a,b,c);b=this.b(d.wi+" X Y","camera tracking",h,a,b,c);b=this.b(" X ","horizontal speed cells/gen",h,a,b,c);b=this.b(" Y ","vertical speed cells/gen",h,a,b,c);b=this.b(d.qg+" E S W N","camera box tracking",
h,a,b,c);b=this.b(" E ","east edge speed cells/gen",h,a,b,c);b=this.b(" S ","south edge speed cells/gen",h,a,b,c);b=this.b(" W ","west edge speed cells/gen",h,a,b,c);b=this.b(" N ","north edge speed cells/gen",h,a,b,c);b=this.b(d.vi+" P X Y","camera tracking with loop",h,a,b,c);b=this.b(" P ","period",h,a,b,c);b=this.b(" X ","horizontal speed cells/gen",h,a,b,c);b=this.b(" Y ","vertical speed cells/gen",h,a,b,c);b=this.b(d.nl,"define point of interest",h,a,b,c);b=this.b(d.mb+"<string>"+d.mb,"define message",
h,a,b,c);b=this.b(d.nh+" "+d.mb+"<string>"+d.mb,"set window title",h,a,b,c);b=this.b(" "+d.Ac+"B","program build number",h,a,b,c);b=this.b(" "+d.Ac+"N","pattern name",h,a,b,c);b=this.b(" "+d.Ac+"O","pattern originator",h,a,b,c);b=this.b(" "+d.Ac+"R","rule name",h,a,b,c);b=this.b(" "+d.Ac+"A","rule alias",h,a,b,c);b=this.b(" "+d.Ac+"T","program title",h,a,b,c);b=this.b(" "+d.Ac+d.Ac,d.Ac+" symbol",h,a,b,c);b=this.b(d.gl,"disable menus and hotkeys",h,a,b,c);b=this.b(d.il,"disable NOGUI RLE copy",h,
a,b,c);b=this.b(d.Bi,"disable playback",h,a,b,c);b=this.b(d.hl,"disable step back",h,a,b,c);b=this.b(d.jl,"disable stop messages",h,a,b,c);b=this.b(d.Ul,"start at 1/"+this.xb+" size",h,a,b,c);b=this.b(d.Tl+" <"+g.rn+".."+g.on+">","set thumbnail divisor",h,a,b,c);b=this.b(d.Xn,"thumbnail launches viewer",h,a,b,c);b=this.b(d.Oh,"display grid lines",h,a,b,c);b=this.b(d.Nh+" <0..16>","set major grid line interval",h,a,b,c);b=this.b(d.ij,"display population graph",h,a,b,c);b=this.b(d.Ok+" <0.0..1.0>",
"population graph opacity",h,a,b,c);b=this.b(d.Pk,"population graph use points",h,a,b,c);b=this.b(d.Ej,"disable population graph",h,a,b,c);b=this.b(d.ji,"display stars",h,a,b,c);b=this.b(d.Uk,"force hex display",h,a,b,c);b=this.b(d.Gl,"force square display",h,a,b,c);b=this.b(d.ni+" <0.."+(this.a.wc-1)+">|"+d.mi,"set theme",h,a,b,c);b=this.b(d.wa+" "+d.Un+" R G B","set theme background",h,a,b,c);b=this.b(d.wa+" "+d.Rl+" R G B","set theme alive color",h,a,b,c);b=this.b(d.wa+" "+d.Tn+" R G B","set theme alive ramp",
h,a,b,c);b=this.b(d.wa+" "+d.Sl+" R G B","set theme dead color",h,a,b,c);b=this.b(d.wa+" "+d.Vn+" R G B","set theme dead ramp",h,a,b,c);b=this.b(d.wa+" "+d.km+" R G B","set boundary color",h,a,b,c);b=this.b(d.wa+" <0..> R G B","set state color",h,a,b,c);b=this.b(d.wa+" "+d.sn+" R G B","set [R]History state color "+g.tn,h,a,b,c);b=this.b(d.wa+" "+d.un+" R G B","set [R]History state color "+g.vn,h,a,b,c);b=this.b(d.wa+" "+d.Um+" R G B","set [R]History state color "+g.Wm,h,a,b,c);b=this.b(d.wa+" "+d.en+
" R G B","set [R]History state color "+g.fn,h,a,b,c);b=this.b(d.wa+" "+d.jn+" R G B","set [R]History state color "+g.kn,h,a,b,c);b=this.b(d.wa+" "+d.gn+" R G B","set [R]History state color "+g.hn,h,a,b,c);b=this.b(d.wa+" "+d.an+" R G B","set [R]History state color "+g.bn,h,a,b,c);b=this.b(d.wa+" "+d.Oh+" R G B","set grid color",h,a,b,c);b=this.b(d.wa+" "+d.Nh+" R G B","set grid major color",h,a,b,c);b=this.b(d.wa+" "+d.ji+" R G B","set star color",h,a,b,c);b=this.b(d.wa+" "+d.Pl+" R G B","set waypoint message color",
h,a,b,c);b=this.b(d.wa+" "+d.Ik+" R G B","set error message color",h,a,b,c);b=this.b(d.wa+" "+d.Om+" R G B","set graph background color",h,a,b,c);b=this.b(d.wa+" "+d.Nm+" R G B","set graph axis color",h,a,b,c);b=this.b(d.wa+" "+d.Mm+" R G B","set graph alive color",h,a,b,c);b=this.b(d.wa+" "+d.Pm+" R G B","set graph birth color",h,a,b,c);b=this.b(d.wa+" "+d.Qm+" R G B","set graph death color",h,a,b,c);b=this.b(d.vk,"same as "+d.wa,h,a,b,c);b=this.b(d.hj+" <"+g.sd+".."+g.lf+">","set steps per second",
h,a,b,c);b=this.b(d.Tj+" <"+g.$f+".."+g.vc+">","set generations per step",h,a,b,c);b=this.b(d.Gi+" <0..359>","set camera angle",h,a,b,c);b=this.b(d.Bc+" <-"+(this.a.jb>>1)+".."+(this.a.jb>>1)+">","set camera x position",h,a,b,c);b=this.b(d.Cc+" <-"+(this.a.jb>>1)+".."+(this.a.jb>>1)+">","set camera y position",h,a,b,c);b=this.b(d.Pb+" <"+(-1/g.sa).toFixed(1)+".."+g.kb.toFixed(1)+">","set camera zoom",h,a,b,c);b=this.b(d.nk,"same as "+d.Pb,h,a,b,c);b=this.b(d.xj+" <"+g.Cj+".."+g.zj+">","set number of layers",
h,a,b,c);b=this.b(d.Zi+" <"+g.Bj.toFixed(1)+".."+g.mn.toFixed(1)+">","set layer depth",h,a,b,c);b=this.b(d.ak+" <-"+(this.a.jb>>1)+".."+(this.a.jb>>1)+">","set pattern x offset",h,a,b,c);b=this.b(d.bk+" <-"+(this.a.jb>>1)+".."+(this.a.jb>>1)+">","set pattern y offset",h,a,b,c);b=this.b(d.$j+" <"+g.Sd+".."+this.oc+">","set LifeViewer width",h,a,b,c);b=this.b(d.pj+" <"+g.Dj+".."+g.pn+">","set LifeViewer height",h,a,b,c);b=this.b(d.Dl,"show timing information",h,a,b,c);b=this.b(d.Kk,"extended timing information",
h,a,b,c);b=this.b(d.Bl,"show generation statistics",h,a,b,c);b=this.b(d.Cl,"show information bar",h,a,b,c);b=this.b(d.Dk+" <"+g.qn+".."+g.ln+">","set boundary delete range",h,a,b,c);b=this.b(d.rl+" <string>","set random seed",h,a,b,c);b=this.b("","",h,a,b,c);this.h[0]=128;b=this.b("","",h,a,b,c);this.sj=this.L;b=this.b("","Information",h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","Display:",h,a,b,c);b=this.b("Size",this.s+" x "+this.m,h,a,b,c);m.Wh&&(b=this.b("Limit Width",this.oc,h,a,b,c));p=this.a.K;
1>p&&(p=-1/p);b=this.b("View","X "+-(this.a.width/2-(this.a.F+this.a.Tc)|0)+"  Y "+-(this.a.height/2-(this.a.A+this.a.xc)|0)+"  Z "+p.toFixed(2)+"  ANGLE "+this.a.angle.toFixed(0),h,a,b,c);p=this.gh;1>p&&(p=1/p);b=this.b("Saved View","X "+-(this.a.width/2-this.Db|0)+"  Y "+-(this.a.height/2-this.hg|0)+"  Z "+p.toFixed(2)+"  ANGLE "+this.wl.toFixed(0),h,a,b,c);b=this.b("Origin","X "+this.a.Tc.toFixed(2)+"  Y "+this.a.xc.toFixed(2)+"  Z "+this.a.Wb.toFixed(3),h,a,b,c);this.yb?e=this.Lb?"Multi-State Viewer":
"Viewer":this.a.sc&&(e="History Player");b=this.b("Type",e,h,a,b,c);e=this.a.M?"Hex":"Square";b=this.b("Mode",e,h,a,b,c);this.ng&&(b=this.b("Thumbnail","1/"+this.xb,h,a,b,c));b=this.b("","",h,a,b,c);b=this.b("","Pattern:",h,a,b,c);""!==this.Ef&&(b=this.b("Name",this.Ef,h,a,b,c));""!==this.Ff&&(b=this.b("Originator",this.Ff,h,a,b,c));b=this.b("Size",this.$a+" x "+this.Fb,h,a,b,c);b=this.b("Offset","X "+this.fa+"  Y "+this.ha,h,a,b,c);this.df&&(b=this.b("CXRLE Gen",this.fj,h,a,b,c));this.tf&&(b=this.b("CXRLE Pos",
"X "+this.If+"  Y "+this.Ue,h,a,b,c));this.Ka?e=this.Gb:(e=this.Gb,""===e&&(e="(none)"));b=this.b("Rule",e,h,a,b,c);""!==this.Qa&&(b=this.b("Alias",this.Qa,h,a,b,c));e=-1!==this.a.Qe?"1D":this.a.Kj?"Hex":this.a.Be?"Von Neumann":"Moore";b=this.b("N'hood",e,h,a,b,c);e=this.pc;2<this.pc&&this.Hf!==this.pc&&(e=this.Hf+" of "+e);b=this.b("States",e,h,a,b,c);if(this.Gf)for(e=1;e<this.pc;e+=1)this.Gf[e]&&(b=this.b("State "+e,this.Gf[e],h,a,b,c));b=this.b("Decoder",this.Ud,h,a,b,c);b=this.b("","",h,a,b,c);
b=this.b("","Grid:",h,a,b,c);b=this.b("Size",this.a.width+" x "+this.a.height,h,a,b,c);b=this.b("Maximum",this.a.jb+" x "+this.a.jb,h,a,b,c);b=this.b("Area",this.Wp(),h,a,b,c);b=this.a.i&1?this.b("Tiles",this.a.oi(this.a.oa)+" / "+this.a.oi(this.a.Ea),h,a,b,c):this.b("Tiles",this.a.oi(this.a.U)+" / "+this.a.oi(this.a.Ea),h,a,b,c);this.a.Vd&&(b=this.b("State6",this.a.oi(this.a.Vd),h,a,b,c));b=this.b("Tile Size",(this.a.pi<<3)+" x "+this.a.ri,h,a,b,c);b=this.b("Generation",this.a.i,h,a,b,c);b=this.b("DeleteRange",
this.a.Mj,h,a,b,c);b=this.b("","",h,a,b,c);-1!==this.a.Ib&&(b=this.b("","Bounded grid:",h,a,b,c),b=this.b("Type",PatternManager.Fo(this.a.Ib),h,a,b,c),b=0===this.a.pa?this.b("Width","Infinite",h,a,b,c):this.b("Width",this.a.pa,h,a,b,c),4!==this.a.Ib&&(b=0===this.a.Ma?this.b("Height","Infinite",h,a,b,c):this.b("Height",this.a.Ma,h,a,b,c),2===this.a.Ib&&(b=this.a.sk?this.b("Twist","Horizontal",h,a,b,c):this.b("Twist","Vertical",h,a,b,c)),0!==this.a.Gh&&(b=this.b("H'Shift",this.a.Gh,h,a,b,c)),0!==this.a.Hh&&
(b=this.b("V'Shift",this.a.Hh,h,a,b,c))),b=this.b("","",h,a,b,c));b=this.b("","AutoFit:",h,a,b,c);b=this.b("Enabled",this.Sa?"On":"Off",h,a,b,c);b=this.b("Mode",this.Zp(),h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","Track:",h,a,b,c);b=this.b("Enabled",this.Ya&&!this.Za?"On":"Off",h,a,b,c);this.Ya&&(this.md?(b=this.b("Mode","Track Box",h,a,b,c),b=this.b("Definition","E "+this.hb.toFixed(3)+"  S "+this.ob.toFixed(3)+"  W "+this.Rb.toFixed(3)+"  N "+this.Qb.toFixed(3),h,a,b,c)):(b=this.b("Mode","Track",
h,a,b,c),b=this.b("Definition","X "+this.hb.toFixed(3)+"  Y "+this.ob.toFixed(3),h,a,b,c)));b=this.b("Current","E "+this.vg.toFixed(3)+"  S "+this.xg.toFixed(3)+"  W "+this.yg.toFixed(3)+"  N "+this.wg.toFixed(3),h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","Step back:",h,a,b,c);b=this.b("Enabled",this.Td?"Off":"On",h,a,b,c);this.Td||(b=this.b("Snapshots",this.a.Xc.$q()+"/"+this.a.Xc.kd.length,h,a,b,c),b=this.b("Buffer",(this.a.Xc.bufferSize()>>10)+"K",h,a,b,c),b=this.b("Next",this.a.bg,h,a,b,c));
b=this.b("","",h,a,b,c);b=this.b("","Engine:",h,a,b,c);b=this.b("Name",g.ho,h,a,b,c);b=this.b("Build",g.Yl,h,a,b,c);b=this.b("Author",g.fo,h,a,b,c);b=this.b("Decoders","Cells, Life 1.05, Life 1.06, RLE",h,a,b,c);b=this.b("N'hoods","1D, Moore, Hex, Von Neumann",h,a,b,c);b=this.b("Rules","Wolfram, Totalistic, Generations,",h,a,b,c);b=this.b(" ","Isotropic Non-Totalistic (Hensel), MAP",h,a,b,c);b=this.b("BoundedGrid","Plane, Torus, Klein, Cross-surface, Sphere",h,a,b,c);b=this.b("States","2 state, [R]History, Niemiec, Generations",
h,a,b,c);b=this.b("Viewers",l.Ob.length,h,a,b,c);b=this.b("Playing",l.dr(),h,a,b,c);b=this.b("","",h,a,b,c);if(this.Lb)for(b=this.b("","Set:",h,a,b,c),b=this.b("Name",this.Ie,h,a,b,c),b=this.b("Used",this.Hf,h,a,b,c),e=0;e<k.length;e+=1)this.Pd[e]!==g.Ll&&(u=this.aa(k[e]>>16&255,k[e]>>8&255,k[e]&255),n=String(e),this.Pd[e]!==g.Pn||this.Jf||(n+="*"),this.H(k[e]>>16,k[e]>>8&255,k[e]&255,h,a+this.h[0],b,c),b=this.b(n,u,h,a,b,c));else{b=this.b("","Theme:",h,a,b,c);k=this.a.Ed===this.a.wc?"(custom)":String(this.a.Ed);
b=this.b("Name",k,h,a,b,c);this.H(this.a.Wc[0],this.a.Oc[0],this.a.Kc[0],h,a+this.h[0],b,c);b=this.b("Background",this.aa(this.a.Wc[0],this.a.Oc[0],this.a.Kc[0]),h,a,b,c);if(-1!==this.a.u)for(e=1;e<this.a.u;e+=1)this.H(this.a.Wc[e],this.a.Oc[e],this.a.Kc[e],h,a+this.h[0],b,c),b=this.b("State "+e,this.aa(this.a.Wc[e],this.a.Oc[e],this.a.Kc[e]),h,a,b,c);else this.H(u.Ra.J.red,u.Ra.J.green,u.Ra.J.blue,h,a+this.h[0],b,c),b=this.b("Alive",this.Ve(u.Ra.J),h,a,b,c),u.Ra.J.red!==u.Ra.ca.red||u.Ra.J.green!==
u.Ra.ca.green||u.Ra.J.blue!==u.Ra.ca.blue?(this.H(u.Ra.ca.red,u.Ra.ca.green,u.Ra.ca.blue,h,a+this.h[0],b,c),b=this.b("AliveRamp",this.Ve(u.Ra.ca),h,a,b,c)):b=this.b("AliveRamp","    (none)",h,a,b,c),this.H(u.Na.J.red,u.Na.J.green,u.Na.J.blue,h,a+this.h[0],b,c),b=this.b("Dead",this.Ve(u.Na.J),h,a,b,c),u.Na.J.red!==u.Na.ca.red||u.Na.J.green!==u.Na.ca.green||u.Na.J.blue!==u.Na.ca.blue?(this.H(u.Na.ca.red,u.Na.ca.green,u.Na.ca.blue,h,a+this.h[0],b,c),b=this.b("DeadRamp",this.Ve(u.Na.ca),h,a,b,c)):b=this.b("DeadRamp",
"    (none)",h,a,b,c);if(this.a.sc)for(e=3;6>=e;e+=1)p=128+g.Ha[e],u=this.aa(this.a.Wc[p],this.a.Oc[p],this.a.Kc[p]),n=g.Lq[e],this.H(this.a.Wc[p],this.a.Oc[p],this.a.Kc[p],h,a+this.h[0],b,c),b=this.b(n,u,h,a,b,c)}this.H(this.hc[0],this.hc[1],this.hc[2],h,a+this.h[0],b,c);b=this.b("Boundary",this.aa(this.hc[0],this.hc[1],this.hc[2]),h,a,b,c);this.ia&&(this.H(this.ia[0],this.ia[1],this.ia[2],h,a+this.h[0],b,c),b=this.b("Text",this.aa(this.ia[0],this.ia[1],this.ia[2]),h,a,b,c));this.zb&&(this.H(this.zb[0],
this.zb[1],this.zb[2],h,a+this.h[0],b,c),b=this.b("Error",this.aa(this.zb[0],this.zb[1],this.zb[2]),h,a,b,c));b=this.b("","",h,a,b,c);b=this.b("","Grid Lines:",h,a,b,c);k=this.a.Bb?"On":"Off";this.a.Bb&&!this.a.te()&&(k+=" (Hidden)");b=this.b("Enabled",k,h,a,b,c);k="Line Color";-1!==this.Je&&(k+="*");this.H(this.a.Qc>>16,this.a.Qc>>8&255,this.a.Qc&255,h,a+this.h[0],b,c);b=this.b(k,this.aa(this.a.Qc>>16,this.a.Qc>>8&255,this.a.Qc&255),h,a,b,c);k="Major Color";-1!==this.Le&&(k+="*");this.H(this.a.Od>>
16,this.a.Od>>8&255,this.a.Od&255,h,a+this.h[0],b,c);b=this.b(k,this.aa(this.a.Od>>16,this.a.Od>>8&255,this.a.Od&255),h,a,b,c);k=0<this.a.Pc&&this.a.ef?String(this.a.Pc):"Off";b=this.b("Interval",k,h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","Population Graph:",h,a,b,c);b=this.b("Enabled",this.Cb?"On":"Off",h,a,b,c);b=this.b("Disabled",this.Nc?"On":"Off",h,a,b,c);b=this.b("Mode",this.vd?"Lines":"Points",h,a,b,c);b=this.b("Opacity",this.bb.toFixed(2),h,a,b,c);this.H(this.a.Ld[0],this.a.Ld[1],this.a.Ld[2],
h,a+this.h[0],b,c);b=this.b("Bg Color",this.aa(this.a.Ld[0],this.a.Ld[1],this.a.Ld[2]),h,a,b,c);this.H(this.a.Kd[0],this.a.Kd[1],this.a.Kd[2],h,a+this.h[0],b,c);b=this.b("Axis Color",this.aa(this.a.Kd[0],this.a.Kd[1],this.a.Kd[2]),h,a,b,c);this.H(this.a.Jd[0],this.a.Jd[1],this.a.Jd[2],h,a+this.h[0],b,c);b=this.b("Alive Color",this.aa(this.a.Jd[0],this.a.Jd[1],this.a.Jd[2]),h,a,b,c);this.H(this.a.Md[0],this.a.Md[1],this.a.Md[2],h,a+this.h[0],b,c);b=this.b("Birth Color",this.aa(this.a.Md[0],this.a.Md[1],
this.a.Md[2]),h,a,b,c);this.H(this.a.Nd[0],this.a.Nd[1],this.a.Nd[2],h,a+this.h[0],b,c);b=this.b("Death Color",this.aa(this.a.Nd[0],this.a.Nd[1],this.a.Nd[2]),h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","Random Seed:",h,a,b,c);b=this.b("Custom",this.qh?"On":"Off",h,a,b,c);b=this.b("Seed",this.Ah,h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","Stars:",h,a,b,c);b=this.b("Enabled",this.jh?"On":"Off",h,a,b,c);this.H(this.gb.red,this.gb.green,this.gb.blue,h,a+this.h[0],b,c);b=this.b("Color",this.Ve(this.gb),
h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","Script:",h,a,b,c);b=this.b("Commands",this.Df,h,a,b,c);b=this.b("Errors",this.yh,h,a,b,c);if(this.eb)for(b=this.b("","",h,a,b,c),b=this.b("","Waypoints:",h,a,b,c),b=this.b("Enabled",this.nb?"Off":"On",h,a,b,c),b=this.b("Number",this.V.ja.length,h,a,b,c),e=0;e<this.V.ja.length;e+=1)k=String(e),e===this.V.Af&&(k=this.V.qk(this.elapsedTime)?k+">":k+"*"),b=this.b(k,this.V.fr(e,d.mb),h,a,b,c);if(this.V.Uc.length)for(b=this.b("","",h,a,b,c),b=this.b("","Points of interest:",
h,a,b,c),b=this.b("Number",this.V.Uc.length,h,a,b,c),e=0;e<this.V.Uc.length;e+=1)k=String(e),b=this.b(k,this.V.bq(e,d.mb),h,a,b,c);-1!==this.ka&&(b=this.b("","",h,a,b,c),b=this.b("","Loop:",h,a,b,c),b=this.b("Enabled",this.qa?"Off":"On",h,a,b,c),b=this.b("Generation",this.ka,h,a,b,c));b=this.b("","",h,a,b,c);b=this.b("","Memory:",h,a,b,c);b=this.b("Allocations",this.a.l.Gj+"\t"+(this.a.l.oh>>20)+"M\t"+this.a.l.oh,h,a,b,c);b=this.b("Frees",this.a.l.Hj+"\t"+(this.a.l.ph>>20)+"M\t"+this.a.l.ph,h,a,b,
c);b=this.b("In Use",this.a.l.Gj-this.a.l.Hj+"\t"+(this.a.l.oh-this.a.l.ph>>20)+"M\t"+(this.a.l.oh-this.a.l.ph),h,a,b,c);b=this.b(this.aj("Bytes"),"Type\tElements\tName\tCount",h,a,b,c);for(e=0;e<this.a.l.Jc.length;e+=1)b=this.b(this.aj(String(this.a.l.Jc[e].size)),this.a.l.Bo(e),h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","Aliases",h,a,b,c);this.h[0]=260;for(e=0;e<AliasManager.f.length;e+=1)""===AliasManager.f[e][1]?(b=this.b("","",h,a,b,c),b=this.b("",AliasManager.f[e][0]+
" Aliases:",h,a,b,c)):""!==AliasManager.f[e][0]&&(b=this.b(AliasManager.f[e][0],AliasManager.f[e][1],h,a,b,c));this.eh=this.L-1;this.L=1;this.h[0]=120;b=f+19*(this.Va+2);b=this.po(h,a,b);this.Ae?this.b("H","close help",h,a,b,0):this.b("H / Esc","close help",h,a,b,0)};r.prototype.Fm=function(b){var a=b.Vb;b.Va=(b.m/19|0)-6;a.fillStyle="black";a.globalAlpha=.5;a.fillRect(0,0,a.canvas.width,a.canvas.height);a.globalAlpha=1;a.fillStyle=g.qj;b.tl(a,6,14,b.C|0);a.fillStyle=g.Vg;b.tl(a,4,12,b.C|0)};r.prototype.oo=
function(b,a,c){var h=c,d=0,e=!1,f=this.L;"#000000"===b.fillStyle&&(e=!0);0<=f&&f<=0+this.Va&&(b.font=g.cj,e||(b.fillStyle=1<(this.na|0)?this.Gd:g.jj),b.fillText("Up",a,c),e||(b.fillStyle=this.Gd),b.fillText(" / ",a+b.measureText("Up").width,c),e||(b.fillStyle=(this.na|0)<this.Eb.length-this.Va?this.Gd:g.jj),b.fillText("Down",a+b.measureText("Up / ").width,c),this.h[0]&&(d=this.h[0]),e||(b.fillStyle=this.Gd),b.font=g.sg,b.fillText("scroll errors",a+d,c),h+=19);return h};r.prototype.Dg=function(b,
a,c,d,e,f){var h=e,u=0,l=this.L;l>=f&&l<=f+this.Va&&(b.length&&(c.font=g.cj,c.fillText(b,d,e),u=c.measureText(b+" ").width),this.h[0]&&(u=this.h[0]),c.font=g.sg,c.fillText(a,d+u,e),h+=19);this.L+=1;return h};r.prototype.Cn=function(b,a,c,d){var h,e=this.Eb,f=c;this.L=1;this.h[0]=0;b.font=g.sg;c=this.Dg("",g.Bq,b,a,c,d);for(h=0;h<e.length;h+=1)c=this.Dg(e[h][0],e[h][1],b,a,c,d);this.Z||(this.h[0]=120,this.L=1,c=f+19*(this.Va+2),c=this.oo(b,a,c),c=this.Dg("Esc","clear messages",b,a,c,0),this.Dg("H  ",
"help on script commands",b,a,c,0))};r.prototype.Em=function(b){var a=b.Vb,c=7;b.Z&&(c=1);b.Va=(b.m/19|0)-c;a.fillStyle="black";a.globalAlpha=.5;a.fillRect(0,0,a.canvas.width,a.canvas.height);a.globalAlpha=1;a.fillStyle=g.qj;b.Cn(a,6,14,b.na|0);a.fillStyle=this.Gd;b.Cn(a,4,12,b.na|0)};r.prototype.Gg=function(b,a){var c=this.g.Ee,h=this.g.Fe,d=b+a,e=-this.a.angle,f=Math.sin(e/180*Math.PI),e=Math.cos(e/180*Math.PI);0>d?d=0:1<d&&(d=1);b=g.sa*Math.pow(g.kb/g.sa,b);d=g.sa*Math.pow(g.kb/g.sa,d);d<g.sa?
d=g.sa:d>g.kb&&(d=g.kb);c-=this.s/2;h-=this.m/2;c=(c-d/b*c)/d;h=(h-d/b*h)/d;this.a.F-=c*e+h*-f;this.a.A-=c*f+h*e;d=Math.log(d/g.sa)/Math.log(g.kb/g.sa);this.Ca.current=this.qe([d,d],!0,this)};r.prototype.Xq=function(b,a){b.wd.current=b.a.i/a*100;b.wd.j=!1;b.rc.hd=0};r.prototype.Wq=function(b){var a=!1,c=!1,h=0,d;b.qa||-1===b.ka||(a=!0);!b.nb&&b.eb&&(c=!0);if(a||c){d=!1;if(c&&a)h=b.elapsedTime/b.V.Im(b.ka);else if(c){if(a=b.V.Ip().cb)h=b.elapsedTime/a,1<h&&(d=!0)}else 0<b.ka&&(h=b.a.i/b.ka);1<h&&(h=
1);b.wd.current=100*h}else d=!0;(b.wd.j=d)?b.rc.hd=b.w.hd:b.rc.hd=0};r.prototype.lp=function(){this.gb.Po(this.a.width/2-this.a.rb,this.a.height/2-this.a.sb,this.a.K,this.a.qb,this.a.s,this.a.m,this.a.$b,this.a.ke[0])};r.prototype.Nk=function(b,a){b+=this.a.width/2-Math.round(this.$a/2);a+=this.a.height/2-Math.round(this.Fb/2);return this.a.Nk(b,a,this.Lb&&this.yb)};r.prototype.Hq=function(){var b=this.w.qf-this.m/2,a=Math.floor(b/this.a.zoom-(this.a.height/2-this.a.A)+Math.round(this.Fb/2)),c=Math.floor((this.w.ge-
this.s/2)/this.a.zoom+(this.a.M?b/this.a.zoom/2:0)-(this.a.width/2-this.a.F-(this.a.M?this.a.A/2:0))+Math.round(this.$a/2)),d;-1===this.w.ge||0!==this.a.qb?(this.Zb.lb="",this.Zb.j=!this.Zc):(b=-9999>c||9999<c?(c/1E4).toFixed(1)+"K":c+"",d=-9999>a||9999<a?(a/1E4).toFixed(1)+"K":a+"",a=this.Nk(c,a),this.Zb.lb=b+","+d+"="+a,this.Zb.j=!1);this.Zb.enabled=this.Zc||this.S.current===g.La&&-1!==this.w.ge?this.C||this.na||!this.$a?!1:!0:!1};r.prototype.hq=function(b){var a;this.dc||(0<this.C?0<b?this.Qj(this,
3):this.Pj(this,3):0<this.na?0<b?this.Oj(this,3):this.Nj(this,3):this.ab||(a=this.Ca.current[0],0>b?this.Gg(a,-.05):this.Gg(a,.05)))};r.prototype.cr=function(b,a){var c,h;h=a.V.current;var d,e=!1,f=!1,l=!1;a.ab=!1;c=a.elapsedTime-a.Sh;a.Yk&&(a.Yk=!1,b=c=0);a.yb||a.Wq(a);a.S.current!==g.La?(b>g.Km&&(b=g.Km,f=!0),a.elapsedTime+=b,a.$d+=b,a.ub&&(c>1E3/a.tb||a.tb===g.lf)&&(a.Sh=a.elapsedTime,a.ie=!0)):a.ie&&(a.elapsedTime=1E3*(a.a.i+1)/a.tb,a.$d+=1E3/a.tb,a.Sh=a.elapsedTime);a.Wl();a.ie&&(a.vj=a.elapsedTime);
a.G=a.Wa.current[0];a.eb&&!a.nb&&a.S.current!==g.La?(a.uc&&!a.V.qk(a.elapsedTime)&&(a.uc=!1,a.elapsedTime=a.V.wm(a.a.width/2-a.a.F,a.a.height/2-a.a.A,a.a.zoom,a.a.angle,a.a.o,a.a.tc*g.Sf,a.a.Ed,a.tb,a.G,a.a.i,a.elapsedTime)),h.bc&&(a.ae(!0,!1),a.uc=!1,h.x=a.a.width/2-a.a.F,h.y=a.a.height/2-a.a.A,a.Z&&(a.a.zoom*=a.xb),h.zoom=a.a.zoom),(l=a.V.update(a.elapsedTime,a.a.i))?h.bc&&(h.bc=!1,a.Z&&(a.a.zoom=h.zoom/a.xb),a.Ca&&(a.Ca.current=a.qe([a.a.zoom,a.a.zoom],!1,a))):(a.S.current!==g.La&&(a.ab=!0),a.a.F=
a.a.width/2-h.x,a.a.A=a.a.height/2-h.y,a.a.zoom=h.zoom,a.Z&&(a.a.zoom=a.a.zoom/a.xb),a.Ca&&(a.Ca.current=a.qe([a.a.zoom,a.a.zoom],!1,a)),a.a.angle=h.angle,a.va&&(a.va.current=[a.a.angle,a.a.angle]),a.a.o=h.o,a.vb&&(a.vb.current=[a.a.o,a.a.o]),a.a.tc=h.depth/g.Sf+g.Bj,a.Oa&&(a.Oa.current=[Math.sqrt(a.a.tc),a.a.tc*g.Sf]),a.tb=h.Ta,a.da&&(a.da.current=[Math.sqrt((h.Ta-g.sd)/(g.lf-g.sd)),h.Ta]),a.G=h.step,a.Wa.current=[a.G,a.G],h.za>a.a.i?(a.ie=!0,a.G=h.za-a.a.i|0,1>a.G&&(a.G=1),a.G>g.vc&&(a.G=g.vc)):
a.ie=!1,h.Yb!==a.wj&&(""===h.Yb?a.g.notification.clear(!1,!1):a.g.notification.B(h.Yb,1E3,!1),a.wj=h.Yb),h.Xa!==a.cl&&(a.a.Me(h.Xa,a.a.rm),a.Nb&&(a.Nb.current=[h.Xa,h.Xa]),a.cl=h.Xa))):a.Sa&&a.S.current!==g.La&&(a.ab=!0);a.ab&&(a.zc=-1);c=0;if(a.ie){if(a.Y){h=performance.now();for(d=0;d<a.G;d+=1){c=performance.now()-h;if(a.a.i===a.Wd-1||c>g.eo||a.Fl)d=a.G-1;a.Zc&&d===a.G-1?a.a.ag(!0,a.elapsedTime,a.Td,a.Nc):a.a.ag(!1,a.elapsedTime,a.Td,a.Nc);if(a.a.Wn||d===a.G-1)a.Y=a.a.Kg();-1!==a.ka&&a.a.i>=a.ka&&
!a.qa&&(a.elapsedTime=0,a.reset(a),l&&(a.ab=!0));a.Y||(d=a.G-1)}a.Y||(a.Lk=g.qp,a.Ek=a.a.i,a.Lh&&(-1===a.ka||a.qa)&&a.g.notification.B("Life ended at generation "+a.Ek,600,!0))}else a.Lk&&(--a.Lk,h=a.a.i,a.a.i=a.Ek,a.a.Kg(),a.a.i=h),a.a.i+=a.G,-1!==a.ka&&a.a.i>=a.ka&&!a.qa&&(a.elapsedTime=0,a.reset(a),l&&(a.ab=!0));a.a.i===a.Wd&&(a.S.current=a.$c(g.La,!0,a),a.Lh&&a.g.notification.B("STOP reached - Play to continue ",180,!0))}a.se.locked=a.ab&&a.eb;a.Wf.locked=a.ab;a.da.locked=a.ab&&a.eb;a.Wa.locked=
a.ab&&a.eb;a.Nb.locked=a.ab&&a.eb;a.Ca.locked=a.ab;a.va.locked=a.ab;a.vb.locked=a.ab&&a.eb;a.Oa.locked=a.ab&&a.eb;a.wheelDelta&&(a.hq(a.wheelDelta),a.wheelDelta=0);a.Sa&&(a.S.current!==g.La||a.eb)&&a.ae(!1,!1);a.a.mq();a.jh&&a.lp();a.a.Gk();a.fi&&(2===a.fi&&a.a.Gm(a.vd,1,!0,a.Z),a.Io(a),2===a.fi&&a.a.Gk(),a.fi=0);a.a.i&&a.Y&&a.a.Ko(g.vc)&&(a.Jb+=a.a.width>>2,a.Qg+=a.a.height>>2,a.Db+=a.a.width>>2,a.hg+=a.a.height>>2,a.a.M&&(a.Jb-=a.a.height>>3,a.Db-=a.a.height>>3));a.Cb&&a.a.Gm(a.vd,a.bb,!1,a.Z);
a.C?a.Fm(a):a.Eb.length&&a.Em(a);a.rc.lower[0]=a.gj?"+ "+a.hi(a.a.i):"T "+a.hi(a.a.i+a.fj);a.Uf.lb=a.Co(a.$d);a.sf.lb=a.hi(a.a.Xb);a.Ze.lb=a.hi(a.a.jc);a.$e.lb=a.hi(a.a.lc);a.sf.I="alive "+a.a.Xb;a.Ze.I="births "+a.a.jc;a.$e.I="deaths "+a.a.lc;c>g.eo?(a.je+=g.xn,a.je>=2*g.ml&&(a.je=0)):0<a.je&&(a.je-=g.xn);f?a.Ke<g.$p&&(a.Ke+=g.yn):a.Ke>g.aq&&(a.Ke-=g.yn);c=a.je<g.ml?"rgb("+a.Ke+","+a.je+",0)":"rgb("+a.Ke+","+(2*g.ml-a.je)+",0)";a.Wa.Cd=c;c="rgb("+a.Ke+",0,0)";a.da.Cd=c;a.ie=!1;a.Fl=!1;a.Hq();-1!==
a.zc&&a.bo();if(a.ub||a.Sa&&a.Lf>a.Do||-1!==a.zc)e=!0;a.Sq();a.Yq();a.Tq();a.Zq(a.C||a.Eb.length);a.g.xf(e)};r.prototype.Wl=function(){var a=this.a.i,b=(this.elapsedTime-this.vj)/1E3*this.tb;0>b?b=0:1<b&&(b=1);a+=b;this.Ya&&!this.Za?(this.a.Tc=a*(this.hb+this.Rb)/2,this.a.xc=a*(this.Qb+this.ob)/2,b=this.a.lo(0,this.Qb,this.hb,this.ob,this.Rb,this.s,this.m-80,g.sa,g.kb,g.ck),a=this.a.lo(a,this.Qb,this.hb,this.ob,this.Rb,this.s,this.m-80,g.sa,g.kb,g.ck),this.a.Wb=a/b):(this.a.Tc=0,this.a.xc=0,this.a.Wb=
1);this.Ca.current=this.qe([this.a.zoom,this.a.zoom],!1,this)};r.prototype.Zq=function(a){this.se.j=a;this.Ca.j=a||this.Cb;this.Wf.j=a;this.Yf.j=a;this.Hd.j=a||this.Cb;this.fe.j=a||this.Cb;this.Ia.j=a||this.Cb;this.ce.j=a||this.Cb;this.de.j=a||!this.Cb;this.vh.j=a||!this.Cb;this.Zg.j=a||!this.Cb;this.he.j=a;this.Uf.j=a;this.ee.j=a;this.sf.j=a;this.Id.j=a;this.Ze.j=a;this.Qd.j=a;this.$e.j=a;this.qc.j=a;this.va.j=a||this.a.M;this.Oa.j=a;this.Nb.j=a;this.vb.j=a;this.Wf.j=a;this.We.j=a||!this.ng;this.Kf.j=
a||!this.Ae;this.Xf.j=a;this.vf.j=a||!this.ea;this.dd.j=a||!this.ea;this.zf.j=a||!this.ea;this.gd.j=a||!this.ea;this.uf.j=a||!this.ea;this.Fc.j=a||!this.ea;this.wh.j=a||!this.ea;this.zg.j=a||!this.ea;this.Bg.j=a||!this.ea;this.Cg.j=a||!this.ea;this.Ag.j=a||!this.ea;this.Gc.j=a||!this.ea;this.Ic.j=a||!this.ea;this.Ec.j=a||!this.ea;this.Hc.j=a||!this.ea};r.prototype.Tq=function(){var a=-(this.a.width/2-this.a.F-this.a.Tc|0),b=-(this.a.height/2-this.a.A-this.a.xc|0);this.vf.j=!this.ea;this.dd.j=!this.ea;
this.zf.j=!this.ea;this.gd.j=!this.ea;this.uf.j=!this.ea;this.Fc.j=!this.ea;this.wh.j=!this.ea;this.zg.j=!this.ea;this.Bg.j=!this.ea;this.Cg.j=!this.ea;this.Ag.j=!this.ea;this.Gc.j=!this.ea;this.Ic.j=!this.ea;this.Hc.j=!this.ea;this.Ec.j=!this.ea;if(-99999>a||99999<a)a=(a/1E3|0)+"K";if(-99999>b||99999<b)b=(b/1E3|0)+"K";this.dd.lb=a;this.gd.lb=b;this.Fc.lb=this.a.angle.toFixed(0)+"\u00b0";this.Gc.lb=this.vg.toFixed(3);this.Ic.lb=this.xg.toFixed(3);this.Ec.lb=this.yg.toFixed(3);this.Hc.lb=this.wg.toFixed(3)};
r.prototype.Yq=function(){0===this.a.i?this.yg=this.vg=this.xg=this.wg=0:(this.xg=(this.a.D.R-this.a.cc.R)/this.a.i,this.wg=(this.a.D.N-this.a.cc.N)/this.a.i,this.vg=(this.a.D.P-this.a.cc.P)/this.a.i,this.yg=(this.a.D.O-this.a.cc.O)/this.a.i)};r.prototype.Sq=function(){this.se.current=[this.Sa];this.Hd.current=[!this.Ye&&this.fd];this.Hd.locked=!this.fd;this.Ya?(this.Ia.lower[0]="TRACK",this.Ia.current=[!this.Za&&this.Ya],this.Ia.locked=!this.Ya,this.Ia.I=["toggle track mode"]):(this.Ia.lower[0]=
"WAYPT",this.Ia.current=[!this.nb&&this.eb],this.Ia.locked=!this.eb,this.Ia.I=["toggle waypoint mode"]);this.ce.current=[!this.qa&&-1!==this.ka];this.ce.locked=-1===this.ka;this.fe.current=[-1!==this.Wd];this.fe.locked=-1===this.Wd};r.prototype.br=function(a){for(var b=a.tm,c=performance.now(),h,d=a.a.Xc.Mp*LifeConstants.ii;a.a.i<b-1&&13>performance.now()-c;)h=b-1-a.a.i<=d?!1:!0,a.a.ag(!1,0,h,a.Nc),a.a.Kg();a.a.i===b-1?(a.a.ag(a.Zc,0,!1,a.Nc),a.Y=a.a.Kg(),a.Jg=!1,a.g.notification.clear(!0,!1),a.w.locked=
!1):a.w.locked=!0;a.Xq(a,b);a.a.Gk();a.C?a.Fm(a):a.Eb.length&&a.Em(a);a.g.xf(!0)};r.prototype.wo=function(a,b){b.Jg?b.br(b):b.cr(a,b)};r.prototype.$l=function(a){a.a.i=0;a.elapsedTime=0;a.$d=0;a.a.F=a.a.width>>1;a.a.A=a.a.height>>1;a.a.F&=a.a.width-1;a.a.A&=a.a.height-1;a.Sh=0;a.vj=0;a.Y=!0;a.Yk=!0};r.prototype.Ai=function(a,b,c){b&&(c.g.jg=a[0]);c.g.xf(!0);return[c.g.jg]};r.prototype.io=function(a,b,c){b?(b=a[0]+.5|0,c.a.Ed!==b&&(c.a.Me(b,c.a.rm),c.Of&&b===c.a.wc?c.g.notification.B("Custom Theme",
40,!0):c.g.notification.B("Theme "+b,40,!0)),a=a[0]):a=c.a.Ed;return[a,c.a.Ed]};r.prototype.ug=function(a,b,c){b&&(c.G=a[0]+.5|0);return[c.G,c.G]};r.prototype.Pe=function(a,b,c){b?(c.tb=g.sd+a[0]*a[0]*(g.lf-g.sd),a=a[0]):a=Math.sqrt((c.tb-g.sd)/(g.lf-g.sd));return[a,c.tb]};r.prototype.In=function(a){a.gh=a.a.zoom;a.Z&&(a.gh=a.gh*a.xb);a.wl=a.a.angle;a.Db=a.a.F;a.hg=a.a.A};r.prototype.sq=function(a){a.lg=a.a.width/2-a.a.F;a.mg=a.a.height/2-a.a.A;a.mh=a.a.zoom;a.kg=a.a.angle;a.cf=a.a.width/2-a.Db;a.Rg=
a.a.height/2-a.hg;a.Kh=a.wl;a.Z?a.Vf=a.gh/a.xb:a.Vf=a.gh;a.zc=0};r.prototype.pq=function(a,b){var c;a.a.zoom=a.Dm;a.Z&&(a.a.zoom=a.a.zoom/a.xb);a.Ca&&(a.Ca.current=a.qe([a.a.zoom,a.a.zoom],!1,a));a.a.angle=a.Ng;a.va&&(a.va.current=[a.Ng,a.Ng]);a.a.F=a.Jb;a.a.A=a.Qg;b&&(a.a.Me(a.Rf,1),a.Nb.current=[a.Rf,a.Rf],a.Lb&&(a.a.Mf=0),c=Math.sqrt((a.Ck-g.sd)/(g.lf-g.sd)),a.da.current=a.Pe([c,c],!0,a),a.G=a.Yi,a.Wa.current=[a.G,a.G],a.a.o=a.Pg,a.vb.current=[a.Pg,a.Pg],c=Math.sqrt(a.Bk),a.Oa.current=a.tg([c,
c],!0,a))};r.prototype.mk=function(a){a?(this.a.F+=this.a.Tc,this.a.A+=this.a.xc,this.a.zoom*=this.a.Wb):(this.Wl(),this.a.F-=this.a.Tc,this.a.A-=this.a.xc,this.a.zoom/=this.a.Wb,this.Wl());this.a.zoom<g.sa?this.a.zoom=g.sa:this.a.zoom>g.kb&&(this.a.zoom=g.kb)};r.prototype.reset=function(a){var b=!1,c=!1;if(0===a.elapsedTime||a.nj)b=!0;a.qa||a.a.i===a.ka&&(c=!0);c||b||(a.eb&&(a.nb=!0),a.Ya&&(a.Za=!0),-1!==a.ka&&(a.qa=!0),a.Hi&&(a.Sa=!1));a.elapsedTime=0;a.$d=0;a.Sh=0;a.vj=0;a.a.Tc=0;a.a.xc=0;a.a.Wb=
1;b&&(c||a.pq(a,b),a.eb&&(a.nb=!1),a.Ya&&(a.Za=!1),a.qa=!1,a.Hi&&(a.Sa=!0));a.Lb||(a.a.ul(a.Td),a.Y=!0,a.a.Y=!0,a.a.Mc=!0);a.a.En();a.a.Dn();a.wj="";a.cl=-1;a.uc=!1;a.V.Af=0;a.g.notification.clear(!1,!1)};r.prototype.Kn=function(a){a?(this.S.icon[2]=g.Ga.icon("pause"),this.S.I[2]="pause"):(this.S.icon[2]=g.Ga.icon("stepforward"),this.S.I[2]="next generation")};r.prototype.$c=function(a,b,c){var h=a,d=c.qa,e=c.nb,f=c.Ye,l=c.Sa,m=c.Za,k=40,n=0,p=0,q=0,z=0,u=0;if(b){switch(a){case g.el:c.Ye=c.nj||c.fd&&
0===c.a.i&&0===c.elapsedTime?!1:!0;c.fd&&!c.Ye?(a=g.bh,c.ub=!0):(a=g.La,c.ub=!1);c.reset(c);b="Reset";!c.qa&&d&&-1!==c.ka&&(n=1);c.qa&&!d&&-1!==c.ka&&(n=-1);!l&&c.Sa&&(u=1);l&&!c.Sa&&(u=-1);!c.nb&&e&&(p=1);c.nb&&!e&&(p=-1);!c.Za&&m&&(q=1);c.Za&&!m&&(q=-1);!c.Ye&&f&&c.fd&&(z=1);c.Ye&&!f&&c.fd&&(z=-1);if(n||p||q||z||u){b="";n&&(b+="Loop");if(p||q||u)n&&(b=z?b+", ":b+" and "),b=p?b+"Waypoints":q?b+"Track":b+"AutoFit";if(z){if(n||p||q||u)b+=" and ";b+="AutoStart"}b=0<n||0<p||0<q||0<z||0<u?b+" On":b+" Off";
k=120}c.g.notification.B(b,k,!0);break;case g.bh:c.S.current!==g.bh&&(c.ub=!0,c.g.notification.B("Play",40,!0));break;case g.Up:c.ub?(c.ub=!1,c.g.notification.B("Pause",40,!0)):0<c.a.i&&c.ci(c.a.i-c.G);a=g.La;break;case g.La:c.ub?(c.ub=!1,(c.a.i!==c.Wd||c.Lh)&&c.g.notification.B("Pause",40,!0)):c.ie=!0}h=a;c.Kn(c.ub)}return h};r.prototype.zi=function(a,b,c){b&&(c.uc=!0,c.a.angle=a[0]);return[c.a.angle,c.a.angle]};r.prototype.Zl=function(a,b,c){b?(c.uc=!0,c.a.o=a[0]+.5|0,a=a[0]):a=c.a.o;return[a,c.a.o]};
r.prototype.tg=function(a,b,c){return b?(c.uc=!0,c.a.tc=a[0]*a[0],[a[0],c.a.tc*g.Sf]):[Math.sqrt(c.a.tc),c.a.tc*g.Sf]};r.prototype.yj=function(a,b,c,d){var h,e,f;c?(-1!==d.Xg&&(d.C?(h=d.Yg-b,h/=g.fontSize,0<h?d.Pj(d,h):0>h&&d.Qj(d,-h)):d.na?(h=d.Yg-b,h/=g.fontSize,0<h?d.Nj(d,h):0>h&&d.Oj(d,-h)):(c=(d.Xg-a)/d.a.K,h=(d.Yg-b)/d.a.K,e=d.a.M?0:-d.a.angle,f=Math.sin(e/180*Math.PI),e=Math.cos(e/180*Math.PI),d.ab||(d.uc=!0,d.a.F+=c*e+h*-f,d.a.A+=c*f+h*e))),d.Xg=a,d.Yg=b):(d.Xg=-1,d.Yg=-1)};r.prototype.rf=
function(a,b){this.Yg=this.Xg=0;this.yj(a,b,!0,this);this.Xg=-1};r.prototype.Pq=function(a){var b=g.Xm;null===b&&(b=new Image,b.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAjAAAAAoCAMAAADXNTCCAAAAb1BMVEUAAAAAADoAAGYAAP8AOpAAZrYAZv8IAAAIAP8IkNsIkP8NAAANADoNAGYNAP8NZrYNtv8TOgATOmYTOv8T2/8XZgAXZmYXZv8XtrYXttsX//8bkDob//8gtmYgtv8g25Ag/7Yg/9sg//9wcHD///8u+qFBAAAAAXRSTlMAQObYZgAABDJJREFUeAHsmYl28jYQhdUU/5Quf02Dm5alRKP7/s9Y5VohwkeZeEC49OB7ghHWMDORPmsR7j/QrFmzgvJ+57npOc4CpdeOt6sPDKqYzMBUBGaEhcGuemeAF72uMjAKh7Pg8KWBxa46MHQLvWo6YGaBf3q9xa4yMHpo1kwKzCzwpVdb7KoDQ8dQKiYFZhZ40WstdrWBoQDD/emBMRgjqfR5YGYPY2hMJCn5Afb/F2a7MEq1tnGpziBDfrAAAuBWwChB5HMpGYwGBvM5jCU/6P1eaOj6wOghROzEwACMgZgZGPMIQ90OGKAKMLABU4mYGRj/WUPjNsAAdYCBFRjc4px4ImAw0H0CA9QGRnFu5sUODP7HwCgfJwbG6zTXBUZ3bREuAQYzMDcHBqgHTMVhFUZglJgr2dUF5ptEHZfvHfC0ff2FhZAKvOfX8W2x552BnR0Yfluo7sltJSUQ1cbSzp6fg4EXh6HqAAPUAwZGYJSgP2zYtpna7kJgArWRXs8haSvf88IkwCRiWpZ2pvwqAANcDwxQERhYgVGiLvZ/+fU5QJ27QiuR9ZtXOWRD/RQjTPr2k2NpsffrPswqfyBClt9wOnr7YigFgM6LQ0nXAZOpwqIXlwFTNlv5P7aH1ODx8uumfzhXfDLVUaXgjSg8u6jmuAyx/LdE99FzxFBeysAwVNdnEF+/ixTAQV4aAQy5jzeH/0NI+YWYn8vyC8yvDAwAKzBUZWAu31bjOmAwmJGOy7ZnJQemZdyDERgycPzpo3NE5PW36PmNF8lIYE26k6aNBEyaTS6dkg5nIwx9d2fApPwIRiG/EjAe3ue8PDYwi/3BNdIlYPq269jc8SKdGZhGYoew/V+/8wGnU/r7VgQm9uCSNv2L5BTinq74Cph8DcNE8hk36PmVgPG8eCswzt0NMFWnpFXfzgNgGg4urewuG2FSh3DioVP6+7E4JTVC+fU7NIx71RomHx0j9fkUFwb5hfP8CsD4/J2XO1n0juGl/qL3NBbXAYZP+kvfUTZgpBsFDMauYXKEsyEmMD+CMwaYHBHvHfjpobfVnBBcKx3ngRXXFGlK4uWyXRJhy4Ghq5+lBMxppzRiSqIMwDTC6S4HJuUXUn5hkN8QGK/+TP14B3fp1K6Rw8eytM0WvVr0r85h/glhK8/peCPdLJ3DtGnFMVj01gAmd2fKLwWA18M+4E8DG3Zc/5CJ/BnfXUNs8m21Coxy0nsaYfRtdUvzwba6CjAMS15s+aUA+LedM7YBEIiB2C6w/46UqQjIEjKFvcAX7y53t/6RcHyE+MfHXRh+S5pv929J+zNevIEn7sR4gyCMHm9YKEDlC8OxhCmiWeJuRw6BE2EKgfvCeDWT457f10yAMEbNhAsTnxTZzldYRTbQS4qqslVlK+MnjD/30dzHEw0KDQ0KRZNlCSPQKCIn4gKh3CRFwGJehgAAAABJRU5ErkJggg==",
g.Xm=b);a=new IconManager(b,a);a.add("play",40,40);a.add("pause",40,40);a.add("tostart",40,40);a.add("menu",40,40);a.add("stepback",40,40);a.add("stepforward",40,40);a.add("autofit",40,40);a.add("fit",40,40);a.add("grid",40,40);a.add("help",40,40);a.add("shrink",40,40);a.add("fps",40,40);a.add("hexgrid",40,40);a.add("lines",40,40);return a};r.prototype.co=function(){this.Yf.icon=this.a.M?[g.Ga.icon("hexgrid")]:[g.Ga.icon("grid")]};r.prototype.Aj=function(a,b){a.g.hasFocus&&(a.Jg||(b.wheelDelta?a.wheelDelta=
b.wheelDelta/120:b.detail&&(a.wheelDelta=-b.detail/3),a.g.xf(!0)),b.preventDefault())};r.prototype.bo=function(){var a=this.V.im(this.zc/g.kl),b=this.kg,c=this.Kh;this.a.F=this.a.width/2-(this.lg+a*(this.cf-this.lg));this.a.A=this.a.height/2-(this.mg+a*(this.Rg-this.mg));this.a.zoom=this.mh*Math.pow(this.Vf/this.mh,a);180<c-b?b+=360:-180>c-b&&(c+=360);this.a.angle=(b+a*(c-b))%360;this.zc+=1;this.zc>g.kl&&(this.zc=-1,this.a.zoom=this.Vf,this.a.angle=c,this.a.F=this.a.width/2-this.cf,this.a.A=this.a.height/
2-this.Rg);this.Ca&&(this.Ca.current=this.qe([this.a.zoom,this.a.zoom],!1,this));this.va&&(this.va.current=this.zi([this.a.angle,this.a.angle],!1,this))};r.prototype.Cq=function(a,b){var c=this.V.Uc[b];a.lg=a.a.width/2-a.a.F;a.mg=a.a.height/2-a.a.A;a.mh=a.a.zoom;a.kg=a.a.angle;a.cf=c.x;a.Rg=c.y;a.Vf=c.zoom;a.Kh=c.angle;a.a.M&&(a.cf+=a.a.A/2);a.zc=0;a.g.notification.B("POI "+b,60,!0);""!==c.Yb?a.g.notification.B(c.Yb,180,!1):a.g.notification.clear(!1,!0)};r.prototype.Dd=function(a,b,c){var h=b/a.a.Wb;
c&&(b=1<=b?Math.round(b):1/Math.round(1/b),h=b/a.a.Wb);a.ab||(a.lg=a.a.width/2-a.a.F,a.mg=a.a.height/2-a.a.A,a.mh=a.a.zoom,a.kg=a.a.angle,a.cf=a.lg,a.Rg=a.mg,a.Vf=h,a.Kh=a.kg,a.zc=0)};r.prototype.ir=function(a){a.Cb=!1};r.prototype.iq=function(){p()};r.prototype.ro=function(a){a.Ol();a.C&&(a.C=0);a.resize();a.ud.current[0]=!1;a.g.pg=!0};r.prototype.ar=function(a){a.ae(!0,!0);a.S.current===g.La&&(a.uc=!0)};r.prototype.Zn=function(a,b,c){b&&(c.a.Bb=a[0],c.g.notification.B("Grid Lines "+(c.a.Bb?"On":
"Off"),40,!0));return[c.a.Bb]};r.prototype.$n=function(a,b,c){b&&(c.vd=a[0]);return[c.vd]};r.prototype.Yn=function(a,b,c){b&&(c.Sa=a[0],c.g.notification.B("AutoFit "+(c.Sa?"On":"Off"),40,!0),c.Sa&&c.S.current===g.La&&c.ae(!0,!0));return[c.Sa]};r.prototype.so=function(a,b,c){b&&-1!==c.ka&&(c.qa=!a[0],c.eb?(c.nb=c.qa,c.g.notification.B("Loop and Waypoints "+(c.qa?"Off":"On"),40,!0)):c.Ya?(c.Za=c.qa,c.g.notification.B("Loop and Track "+(c.qa?"Off":"On"),40,!0),c.mk(c.Za)):c.g.notification.B("Loop "+
(c.qa?"Off":"On"),40,!0));return[c.qa]};r.prototype.to=function(a,b,c){b&&(c.Ya?(c.Za=!a[0],c.mk(c.Za),-1!==c.ka?(c.qa=c.Za,c.g.notification.B("Loop and Track "+(c.qa?"Off":"On"),40,!0)):c.g.notification.B("Track "+(c.Za?"Off":"On"),40,!0)):c.eb&&(c.nb=!a[0],-1!==c.ka?(c.qa=c.nb,c.g.notification.B("Loop and Waypoints "+(c.qa?"Off":"On"),40,!0)):c.g.notification.B("Waypoints "+(c.nb?"Off":"On"),40,!0)));return c.Ya?[c.Za]:[c.nb]};r.prototype.ti=function(a,b,c){b&&(c.C=a[0]);return[c.C]};r.prototype.Zj=
function(a,b,c){b&&(c.Zc=a[0],c.Zc&&(c.Y?0===c.a.i?(c.a.Xb=c.a.me.Xb,c.a.jc=c.a.me.jc,c.a.lc=c.a.me.lc):-1===c.a.u&&(--c.a.i,c.a.ag(!0,c.elapsedTime,c.Td,c.Nc)):(c.a.Xb=0,c.a.jc=0,c.a.lc=0)));c.g.xf(!0);return[c.Zc]};r.prototype.Oj=function(a,b){1<a.na&&(a.na-=b,1>a.na&&(a.na=1))};r.prototype.Nj=function(a,b){a.na<a.Eb.length-a.Va&&(a.na+=b,a.na>a.Eb.length-a.Va&&(a.na=a.Eb.length-a.Va))};r.prototype.Qj=function(a,b){1<a.C&&(a.C-=b,1>a.C&&(a.C=1))};r.prototype.Pj=function(a,b){a.C<a.eh-a.Va&&(a.C+=
b,a.C>a.eh-a.Va&&(a.C=a.eh-a.Va))};r.prototype.ci=function(a){this.Td?this.g.notification.B("Step back disabled",40,!0):(0>a&&(a=0),this.elapsedTime-=1E3/this.tb,this.$d-=1E3/this.tb,this.Y=this.a.ci(a,this.Zc,this.elapsedTime,this.Nc),a!==this.a.i&&(this.Jg=!0,this.tm=a,this.a.ul(!1),this.g.notification.B("Computing previous generations",1E4,!0)))};r.prototype.um=function(a){var b=document.createElement("textarea");b.value=a.element.value;document.body.appendChild(b);b.select();try{document.execCommand("copy")}catch(z){}document.body.removeChild(b);
a.qd.canvas.focus()};r.prototype.fq=function(a,b,c){var d=!0;if(!a.dc){if(c.ctrlKey&&67!==b||c.metaKey||c.altKey)b=-1;switch(b){case 191:case 111:c.shiftKey?a.a.Kj!==a.a.M&&(a.a.M?(a.a.F+=a.a.A/2,a.Jb+=a.a.A/2,a.Db+=a.a.A/2,a.a.M=!1):(a.a.F-=a.a.A/2,a.Jb-=a.a.A/2,a.Db-=a.a.A/2,a.a.M=!0)):a.a.M?(a.a.F+=a.a.A/2,a.Jb+=a.a.A/2,a.Db+=a.a.A/2,a.a.M=!1):(a.a.F-=a.a.A/2,a.Jb-=a.a.A/2,a.Db-=a.a.A/2,a.a.M=!0);a.g.notification.B("Hex Display "+(a.a.M?"On":"Off"),40,!0);a.co();a.va.j=a.a.M;break;case 66:a.yb||
(a.S.current===g.La?0<a.a.i&&a.ci(a.a.i-1):a.S.current=a.$c(g.La,!0,a));break;case 13:a.yb||(a.S.current=a.S.current===g.bh?a.$c(g.La,!0,a):a.$c(g.bh,!0,a));break;case 9:a.yb||(a.ub?a.S.current=a.$c(g.La,!0,a):c.shiftKey?0<a.a.i&&a.ci(a.a.i-a.G):a.ie=!0);break;case 32:a.yb||(a.ub?a.S.current=a.$c(g.La,!0,a):(a.ie=!0,a.Fl=!0));break;case 87:a.eb?(a.nb=!a.nb,-1!==a.ka?(a.qa=a.nb,a.g.notification.B("Loop and Waypoints "+(a.nb?"Off":"On"),40,!0)):a.g.notification.B("Waypoints "+(a.nb?"Off":"On"),40,!0),
a.nb?a.g.notification.clear(!1,!1):a.V.qk(a.elapsedTime)||(a.V.rp(a.a.i),a.elapsedTime=a.V.Im(a.a.i),a.elapsedTime=a.V.wm(a.a.width/2-a.a.F,a.a.height/2-a.a.A,a.a.zoom,a.a.angle,a.a.o,a.a.tc*g.Sf,a.a.Ed,a.tb,a.G,a.a.i,a.elapsedTime),a.uc=!1)):a.Ya?(a.Za=!a.Za,-1!==a.ka?(a.qa=a.Za,a.g.notification.B("Loop and Track "+(a.Za?"Off":"On"),40,!0)):a.g.notification.B("Track "+(a.Za?"Off":"On"),40,!0),a.mk(a.Za)):-1!==a.ka&&(a.qa=!a.qa,a.g.notification.B("Loop "+(a.qa?"Off":"On"),40,!0));break;case 69:!a.Wa.locked&&
a.G<g.vc&&(c.shiftKey?a.G=g.vc:a.G+=1,a.Wa.current=a.ug([a.G,a.G],!0,a));break;case 68:!a.Wa.locked&&a.G>g.$f&&(c.shiftKey?a.G=g.$f:--a.G,a.Wa.current=a.ug([a.G,a.G],!0,a));break;case 90:c.shiftKey?(b=l.Mq(),0===b?a.g.notification.B("No LifeViewers playing",100,!0):1<b&&a.g.notification.B("Paused all LifeViewers",100,!0)):(b=l.Nq(a),0===b?a.g.notification.B("No other LifeViewers playing",100,!0):1<b?a.g.notification.B("Paused "+b+" other LifeViewers",100,!0):a.g.notification.B("Paused "+b+" other LifeViewer",
100,!0));break;case 88:c.shiftKey?(a.a.ef=!a.a.ef,0<a.a.Pc&&a.g.notification.B("Major Grid Lines "+(a.a.ef?"On":"Off"),40,!0)):(a.a.Bb=!a.a.Bb,a.Yf.current=a.Zn([a.a.Bb],!0,a));break;case 89:a.Nc?a.g.notification.B("Graph Disabled",40,!0):c.shiftKey?(a.vd=!a.vd,a.Zg.current=a.$n([a.vd],!0,a),a.g.notification.B("Graph "+(a.vd?"Lines":"Points"),40,!0)):(a.Cb=!a.Cb,a.g.notification.B("Population Graph "+(a.Cb?"On":"Off"),40,!0));break;case 80:a.Lb||a.Oa.locked||(a.Oa.current=.99>=a.Oa.current[0]?a.tg([a.Oa.current[0]+
.01,a.Oa.current[1]],!0,a):a.tg([1,a.Oa.current[1]],!0,a));break;case 76:a.Lb||a.Oa.locked||(a.Oa.current=.01<=a.Oa.current[0]?a.tg([a.Oa.current[0]-.01,a.Oa.current[1]],!0,a):a.tg([0,a.Oa.current[1]],!0,a));break;case 81:!a.Lb&&!a.vb.locked&&a.vb.current[0]<g.zj&&(a.vb.current=a.Zl([a.a.o+1,a.vb.current[1]],!0,a));break;case 65:!a.Lb&&!a.vb.locked&&a.vb.current[0]>g.Cj&&(a.vb.current=a.Zl([a.a.o-1,a.vb.current[1]],!0,a));break;case 82:c.shiftKey?l.nq():a.S.current=a.$c(g.el,!0,a);break;case 83:c.shiftKey?
a.a.sc&&(a.Ne=!a.Ne,a.g.notification.B("AutoFit State 1 Mode "+(a.Ne?"On":"Off"),40,!0)):a.jh=!a.jh;break;case 78:a.ng&&(a.Z?a.Nl():(a.Ol(),a.C&&(a.C=0)),a.resize());break;case 86:c.shiftKey?(a.In(a),a.g.notification.B("Saved camera position",100,!0)):a.ab||(a.sq(a),a.g.notification.B("Restored camera position",100,!0),a.S.current===g.La&&(a.uc=!0));break;case 221:a.ab||(c.shiftKey?a.Gg(a.Ca.current[0],Math.log(a.a.zoom*a.a.Wb*2/g.sa)/Math.log(g.kb/g.sa)-a.Ca.current[0]):a.Gg(a.Ca.current[0],.01));
break;case 219:a.ab||(c.shiftKey?a.Gg(a.Ca.current[0],Math.log(a.a.zoom*a.a.Wb/2/g.sa)/Math.log(g.kb/g.sa)-a.Ca.current[0]):a.Gg(a.Ca.current[0],-.01));break;case 53:case 101:a.va.locked||(a.a.angle=0,a.va.current=[a.a.angle,a.a.angle]);break;case 49:case 97:c.shiftKey?(a.Dd(a,a.a.zoom*a.a.Wb,!0),a.g.notification.B("Integer Zoom",40,!0)):a.Dd(a,1,!1);break;case 50:case 98:c.shiftKey?a.Dd(a,.5,!1):a.Dd(a,2,!1);break;case 51:case 99:a.Dd(a,32,!1);break;case 52:case 100:c.shiftKey?a.Dd(a,.25,!1):a.Dd(a,
4,!1);break;case 54:case 102:c.shiftKey?a.Dd(a,.0625,!1):a.Dd(a,16,!1);break;case 55:a.Nc?a.g.notification.B("Graph Disabled",40,!0):(0<a.bb&&(a.bb-=.05,0>a.bb&&(a.bb=0)),this.de.current=this.Fg([a.bb,a.bb],!1,a));break;case 56:case 104:c.shiftKey?a.Dd(a,.125,!1):a.Dd(a,8,!1);break;case 57:a.Nc?a.g.notification.B("Graph Disabled",40,!0):(1>a.bb&&(a.bb+=.05,1<a.bb&&(a.bb=1)),this.de.current=this.Fg([a.bb,a.bb],!1,a));break;case 48:case 96:a.G=1;a.Wa.current=a.ug([a.G,a.G],!0,a);a.da.current=a.Pe([1,
a.da.current[1]],!0,a);break;case 189:case 109:a.yb||(a.G>g.$f?(c.shiftKey?a.G=g.$f:--a.G,a.Wa.current=a.ug([a.G,a.G],!0,a)):a.da&&(a.da.current=.01<=a.da.current[0]&&!c.shiftKey?a.Pe([a.da.current[0]-.01,a.da.current[1]],!0,a):a.Pe([0,a.da.current[1]],!0,a)));break;case 187:case 107:!a.yb&&a.da&&(.99>=a.da.current[0]&&!c.shiftKey?a.da.current=a.Pe([a.da.current[0]+.01,a.da.current[1]],!0,a):.99>=a.da.current[0]?a.da.current=a.Pe([1,a.da.current[1]],!0,a):(a.da.current=a.Pe([1,a.da.current[1]],!0,
a),a.G<g.vc&&(c.shiftKey?a.G=g.vc:a.G+=1,a.Wa.current=a.ug([a.G,a.G],!0,a))));break;case 188:a.va.locked||(b=a.va.current[0],b=c.shiftKey?b-90:b-1,0>b&&(b+=360),a.va.current=a.zi([b,b],!0,a));break;case 190:a.va.locked||(b=a.va.current[0],b=c.shiftKey?b+90:b+1,360<=b&&(b-=360),a.va.current=a.zi([b,b],!0,a));break;case 74:a.V.Uc.length?a.ab||(c.shiftKey?(--a.ve,0>a.ve&&(a.ve=a.V.Uc.length-1)):(a.ve+=1,a.ve>=a.V.Uc.length&&(a.ve=0)),a.Cq(a,a.ve)):a.g.notification.B("No POIs defined",80,!0);break;case 84:c.shiftKey?
a.g.hh=!a.g.hh:a.Xf.current=a.Ai([!a.g.jg],!0,a);break;case 71:a.yb||(c.shiftKey?a.df&&(a.gj=!a.gj):(a.Zj([!a.Zc],!0,a),a.rc&&(a.rc.current=[a.Zc],a.g.pg=!0)));break;case 70:c.shiftKey?a.se.locked||(a.Sa=!a.Sa,a.se.current=a.Yn([a.Sa],!0,a)):a.Wf.locked||(a.ae(!0,!0),a.g.notification.B("Fit Zoom",80,!0),a.S.current===g.La&&(a.uc=!0));break;case 79:a.fi=c.shiftKey?2:1;break;case 37:c.shiftKey?a.rf(a.a.zoom,a.a.zoom):a.rf(a.a.zoom,0);break;case 38:a.C?a.Qj(a,1):a.na?a.Oj(a,1):c.shiftKey?a.rf(-a.a.zoom,
a.a.zoom):a.rf(0,a.a.zoom);break;case 39:c.shiftKey?a.rf(-a.a.zoom,-a.a.zoom):a.rf(-a.a.zoom,0);break;case 40:a.C?a.Pj(a,1):a.na?a.Nj(a,1):c.shiftKey?a.rf(a.a.zoom,-a.a.zoom):a.rf(0,-a.a.zoom);break;case 77:a.ud&&!a.ud.j&&(a.ud.current[0]=!a.ud.current[0],a.g.pg=!0);break;case 67:c.ctrlKey?(a.um(a),a.g.notification.B("Copied to Clipboard",180,!0)):a.Lb||!a.Nb||a.Nb.locked||(c.shiftKey?b=a.Rf:(b=a.Nb.current[0],b+=1,a.Of?b>=a.a.wc+1&&(b=0):b>=a.a.wc&&(b=0)),a.Nb.current=a.io([b,b],!0,a));break;case 72:c.shiftKey?
(a.gf=!a.gf,a.g.notification.B("AutoFit History Mode "+(a.gf?"On":"Off"),40,!0)):(a.Eb.length?a.C?a.C=0:a.C=a.Jn:a.C?a.C=0:a.Z||(a.C=1),a.Zf.current=a.ti([a.C],!0,a));break;case 73:c.shiftKey?a.ea=!a.ea:(a.C?a.C!==a.sj?a.C=a.sj:a.C=0:a.Z||(a.C=a.sj),a.Zf.current=a.ti([a.C],!0,a));break;case 27:a.Ae?a.Eb.length?(a.Eb=[],a.na=0):p():a.C?a.C=0:a.Eb.length?(a.Eb=[],a.na=0):a.ub&&(a.S.current=a.$c(g.La,!0,a));a.C=0;a.Zf.current=a.ti([a.C],!0,a);break;case 33:a.C?a.Qj(a,a.Va):a.na&&a.Oj(a,a.Va);break;case 34:a.C?
a.Pj(a,a.Va):a.na&&a.Nj(a,a.Va);break;case 36:a.C?a.C=1:a.na&&(a.na=1);break;case 35:a.C?a.C=a.eh-a.Va:a.na&&(a.na=a.Eb.length-a.Va);break;default:d=!1}}return d};r.prototype.gq=function(a,b,c){var d=!0;if(c.ctrlKey||c.metaKey||c.altKey)b=-1;switch(b){case 84:a.Ai([!a.g.jg],!0,a);break;default:d=!1}return d};r.prototype.jr=function(a,b){var c=b.charCode||b.keyCode;if(a.Jg?a.gq(a,c,b):a.fq(a,c,b))a.g.xf(!0),b.preventDefault()};r.prototype.Rq=function(){this.w=this.g.To(this.wo,this.$l,this);this.w.Fk=
this.yj;this.vf=this.w.Da(Menu.Sc,0,40,16,20,"X");this.vf.font=g.yc;this.vf.orientation=Menu.Tb;this.zf=this.w.Da(Menu.Sc,70,40,16,20,"Y");this.zf.font=g.yc;this.zf.orientation=Menu.Tb;this.uf=this.w.Da(Menu.Sc,140,40,16,20,"A");this.uf.font=g.yc;this.uf.orientation=Menu.Tb;this.dd=this.w.Da(Menu.Sc,16,40,54,20,"");this.dd.font=g.yc;this.dd.textAlign=Menu.right;this.dd.I="camera X position";this.gd=this.w.Da(Menu.Sc,86,40,54,20,"");this.gd.font=g.yc;this.gd.textAlign=Menu.right;this.gd.I="camera Y position";
this.Fc=this.w.Da(Menu.Sc,156,40,40,20,"");this.Fc.font=g.yc;this.Fc.textAlign=Menu.right;this.Fc.I="camera angle";this.wh=this.w.Da(Menu.Sc,196,40,4,20,"");this.zg=this.w.Da(Menu.nc,-280,40,20,20,"E");this.zg.font=g.yc;this.Bg=this.w.Da(Menu.nc,-210,40,20,20,"S");this.Bg.font=g.yc;this.Cg=this.w.Da(Menu.nc,-140,40,20,20,"W");this.Cg.font=g.yc;this.Ag=this.w.Da(Menu.nc,-70,40,20,20,"N");this.Ag.font=g.yc;this.Gc=this.w.Da(Menu.nc,-260,40,50,20,"");this.Gc.font=g.yc;this.Gc.textAlign=Menu.right;this.Gc.I=
"bounding box east edge velocity";this.Ic=this.w.Da(Menu.nc,-190,40,50,20,"");this.Ic.font=g.yc;this.Ic.textAlign=Menu.right;this.Ic.I="bounding box south edge velocity";this.Ec=this.w.Da(Menu.nc,-120,40,50,20,"");this.Ec.font=g.yc;this.Ec.textAlign=Menu.right;this.Ec.I="bounding box west edge velocity";this.Hc=this.w.Da(Menu.nc,-50,40,50,20,"");this.Hc.font=g.yc;this.Hc.textAlign=Menu.right;this.Hc.I="bounding box north edge velocity";this.Hd=this.w.ed(null,Menu.Sc,90,0,40,20,["START"],[!1],Menu.td);
this.Hd.font=g.Sj;this.Hd.I=["autostart indicator"];this.fe=this.w.ed(null,Menu.Sc,90,20,40,20,["STOP"],[!1],Menu.td);this.fe.font=g.Sj;this.fe.I=["stop indicator"];this.Ia=this.w.ed(this.to,Menu.nc,-130,0,40,20,["WAYPT"],[!1],Menu.td);this.Ia.font=g.Sj;this.Ia.I=["toggle waypoint mode"];this.ce=this.w.ed(this.so,Menu.nc,-130,20,40,20,["LOOP"],[!1],Menu.td);this.ce.font=g.Sj;this.ce.I=["toggle loop mode"];this.Zf=this.w.ed(this.ti,Menu.nc,-40,0,40,40,[""],[!1],Menu.td);this.Zf.icon=[g.Ga.icon("help")];
this.Zf.I=["toggle help display"];this.se=this.w.ed(this.Yn,Menu.Sc,0,0,40,40,[""],[!1],Menu.td);this.se.icon=[g.Ga.icon("autofit")];this.se.I=["toggle autofit"];this.Wf=this.w.Fi(this.ar,Menu.Sc,45,0,"");this.Wf.icon=g.Ga.icon("fit");this.Wf.I="fit pattern to display";this.Yf=this.w.ed(this.Zn,Menu.nc,-85,0,40,40,[""],[!1],Menu.td);this.Yf.icon=[g.Ga.icon("grid")];this.Yf.I=["toggle grid lines"];this.wd=this.w.Ao();this.wd.locked=!0;this.he=this.w.Da(Menu.yf,0,-100,70,30,"Time");this.he.textAlign=
Menu.left;this.he.font=g.ne;this.he.I="elapsed time";this.Uf=this.w.Da(Menu.yf,70,-100,70,30,"");this.Uf.textAlign=Menu.right;this.Uf.font=g.ne;this.Uf.I="elapsed time";this.Zb=this.w.Da(Menu.yf,0,-70,140,30,"");this.Zb.textAlign=Menu.left;this.Zb.font=g.ne;this.Zb.I="cell state at cursor position";this.rc=this.w.ed(this.Zj,Menu.yf,0,-40,100,40,[""],[this.Zc],Menu.td);this.rc.I=["toggle generation statistics"];this.Hb=this.w.Da(Menu.yf,0,-40,this.s-40,40,"");this.Hb.textAlign=Menu.left;this.Hb.j=
!0;this.ee=this.w.Da(Menu.zd,-140,-130,70,30,"Alive");this.ee.textAlign=Menu.left;this.ee.font=g.ne;this.ee.I="current population";this.sf=this.w.Da(Menu.zd,-70,-130,70,30,"");this.sf.textAlign=Menu.right;this.sf.font=g.ne;this.sf.I="alive";this.Id=this.w.Da(Menu.zd,-140,-100,70,30,"Births");this.Id.textAlign=Menu.left;this.Id.font=g.ne;this.Id.I="cells born this generation";this.Ze=this.w.Da(Menu.zd,-70,-100,70,30,"");this.Ze.textAlign=Menu.right;this.Ze.font=g.ne;this.Ze.I="births";this.Qd=this.w.Da(Menu.zd,
-140,-70,70,30,"Deaths");this.Qd.textAlign=Menu.left;this.Qd.font=g.ne;this.Qd.I="cells died this generation";this.$e=this.w.Da(Menu.zd,-70,-70,70,30,"");this.$e.textAlign=Menu.right;this.$e.font=g.ne;this.$e.I="deaths";this.qc=this.w.Da(Menu.yf,0,-130,140,30,this.Gb);this.qc.font=g.ne;this.Ca=this.w.Xe(this.qe,Menu.Fj,0,0,212,40,0,1,.1,"Zoom ","x",1);this.Ca.I="camera zoom";this.vb=this.w.Xe(this.Zl,Menu.ko,30,0,40,292,g.zj,g.Cj,1,"Layers ","",0);this.vb.I="number of layers";this.Oa=this.w.Xe(this.tg,
Menu.Hm,-70,0,40,292,1,0,.1,"Depth ","",2);this.Oa.I="depth between layers";this.va=this.w.Xe(this.zi,Menu.Fj,0,50,390,40,0,359,0,"Angle ","\u00b0",0);this.va.I="camera angle";this.We=this.w.Fi(this.ro,Menu.Sc,0,50,"");this.We.icon=g.Ga.icon("shrink");this.We.I="shrink to thumbnail";this.Kf=this.w.Fi(this.iq,Menu.zd,-40,-90,"X");this.Kf.I="close window";this.Xf=this.w.ed(this.Ai,Menu.nc,-40,50,40,40,[""],[this.g.jg],Menu.td);this.Xf.icon=[g.Ga.icon("fps")];this.Xf.I=["toggle timing display"];this.de=
this.w.Xe(this.Fg,Menu.Fj,0,0,212,40,0,1,this.bb,"Opacity ","%",0);this.de.I="graph opacity";this.Zg=this.w.ed(this.$n,Menu.Sc,90,0,40,40,[""],[!1],Menu.td);this.Zg.icon=[g.Ga.icon("lines")];this.Zg.I=["toggle lines"];this.vh=this.w.Fi(this.ir,Menu.nc,-130,0,"X");this.vh.I="close graph";this.ud=this.w.ed(null,Menu.zd,-40,-40,40,40,[""],[!1],Menu.td);this.ud.icon=[g.Ga.icon("menu")];this.ud.I=["toggle navigation menu"];this.Nb=this.w.Xe(this.io,Menu.On,0,-90,390,40,0,this.a.wc-1,1,"Theme ","",0);this.Nb.I=
"colour theme";this.da=this.w.Xe(this.Pe,Menu.zd,-375,-40,80,40,0,1,0,"","gps",0);this.da.I="steps per second";this.Wa=this.w.Xe(this.ug,Menu.zd,-290,-40,80,40,g.$f,g.vc,1,"x","",0);this.Wa.I="generations per step";this.S=this.w.ed(this.$c,Menu.zd,-205,-40,160,40,["","","",""],g.La,Menu.El);this.S.icon=[g.Ga.icon("tostart"),g.Ga.icon("stepback"),g.Ga.icon("pause"),g.Ga.icon("play")];this.S.I=["reset","previous generation","pause","play"];this.ud.cm([this.vb,this.Oa,this.va,this.Nb,this.We,this.Kf,
this.Xf]);this.rc.cm([this.ee,this.sf,this.Id,this.Ze,this.Qd,this.$e,this.he,this.Uf,this.qc])};r.prototype.Xp=function(a){var b=this,c=0,d=0;this.v=a;this.v.getContext&&(c=this.v.width,d=this.v.height,c!==this.oc&&m.Wh&&(c=this.oc),c<g.Sd&&(c=g.Sd),d<g.Dj&&(d=g.Dj),c&=-8,this.v.width!==c&&(this.v.width=c),this.v.height!==d&&(this.v.height=d),this.qd=this.v.getContext("2d",{alpha:!1}),this.qd.globalAlpha=1,this.qd.fillStyle="black",this.qd.fillRect(0,0,this.v.width,this.v.height),this.dg=document.createElement("canvas"),
this.dg.width=this.v.width,this.dg.height=this.v.height,this.Vb=this.dg.getContext("2d",{alpha:!1}),this.s=this.v.width,this.m=this.v.height,this.a=new Life(this.Vb,this.s,this.m,1024,1024),this.a.Gp(this.Vb,this.s,this.m),this.gb=new Stars(g.Ij,this.a.l),this.gb.Rd(8192,8192,1024),this.a.l.ga(Uint16,1024,"Life.fillAllBuffer"),this.Vb.textAlign="left",this.Vb.textBaseline="middle",g.Ga=this.Pq(this.Vb),this.g=new MenuManager(this.qd,this.Vb,"24px Arial",g.Ga,this,this.hr),this.g.jg=!1,this.Rq(),this.zh=
this.S.x,this.uh=this.da.x,this.Bh=this.Wa.x,registerEvent(this.v,"DOMMouseScroll",function(a){b.Aj(b,a)},!1),registerEvent(this.v,"mousewheel",function(a){b.Aj(b,a)},!1),this.g.notification.enabled=!0,this.g.xo(this.w),registerEvent(this.v,"keydown",function(a){b.jr(b,a)},!1))};r.prototype.xh=function(a){switch(a){case d.Pl:case d.Ik:case d.Bl:case d.Dl:case d.Kk:case d.Cl:case d.Rc:case d.Bd:case d.Uk:case d.Gl:case d.rl:case d.Dk:case d.nl:case d.nh:case d.hl:case d.jl:case d.wi:case d.Sk:case d.Kl:case d.qg:case d.vi:case d.ij:case d.Ej:case d.Ok:case d.Pk:case d.ji:case d.Ii:case d.Wk:case d.Vj:case d.Tj:case d.ll:case d.Oh:case d.Nh:case d.Ml:case d.wa:case d.vk:case d.Bc:case d.Cc:case d.ak:case d.bk:case d.Pb:case d.nk:case d.Zm:case d.Yh:case d.Bi:case d.gl:case d.il:case d.Ul:case d.Tl:case d.Cf:case d.Ji:case d.gi:case d.yl:case d.Gi:case d.ni:case d.hj:case d.li:case d.xj:case d.Zi:case d.$j:case d.pj:a=
!0;break;default:a=!1}return a};r.prototype.ld=function(a,b,c,d,e){var f=a.gg();""===f||this.xh(f)?b[b.length]=[c,d+" missing"]:(b[b.length]=[c+" "+f,d+" must be "+e],a.ya())};r.prototype.X=function(a,b,c,d){var e=!0,f=0,h=0,l=0,m,k,n=a.ya();if(a.ba()){f=a.$()|0;if(0>f||255<f)b[b.length]=[d+" "+n+" "+f,"RED out of range"];if(a.ba()){h=a.$();if(0>h||255<h)b[b.length]=[d+" "+n+" "+f+" "+h,"GREEN out of range"];a.ba()?(l=a.$(),0>l||255<l?b[b.length]=[d+" "+n+" "+f+" "+h+" "+l,"BLUE out of range"]:e=
!1):this.ld(a,b,d+" "+n+" "+f+" "+h,"BLUE","numeric")}else this.ld(a,b,d+" "+n+" "+f,"GREEN","numeric")}else m=a.gg(),k=ColourManager.kc[m.toLowerCase()],void 0!==k?(a.ya(),f=k[1],h=k[2],l=k[3],e=!1):""===m||this.xh(m)?b[b.length]=[d+" "+n,"name missing"]:(b[b.length]=[d+" "+n+" "+m,"name not known"],a.ya());if(!e)switch(-1!==this.c[c]&&(b[b.length]=[d+" "+n+" "+f+" "+h+" "+l,"overwrites ("+(this.c[c]>>16)+" "+(this.c[c]>>8&255)+" "+(this.c[c]&255)+")"]),this.c[c]=f<<16|h<<8|l,c){case g.Ui:this.Je=
this.c[c];break;case g.Vi:this.Le=this.c[c];break;case g.Wi:this.gb.red=f;this.gb.green=h;this.gb.blue=l;break;case g.Xi:this.ia=[f,h,l];break;case g.yk:this.zb=[f,h,l];this.Gd="rgb("+f+","+h+","+l+")";break;case g.Ni:this.hc=[f,h,l];this.a.Ig=this.a.hf?-16777216|l<<16|h<<8|f:f<<24|h<<16|l<<8|255;break;case g.Ri:this.a.Ld=[f,h,l];break;case g.Qi:this.a.Kd=[f,h,l];break;case g.Pi:this.a.Jd=[f,h,l];break;case g.Si:this.a.Md=[f,h,l];break;case g.Ti:this.a.Nd=[f,h,l];break;default:this.Of=!0}};r.prototype.uo=
function(a,b){var c=!0,e=this.a.fc[this.a.wc];-1===this.c[g.Lg]&&(a[a.length]=[b+" "+d.Rl,"missing"],c=!1);-1===this.c[g.Pf]&&-1===this.c[g.Qf]&&(a[a.length]=[b+" "+d.Sl,"missing"],c=!1);c&&(c=this.c[g.Pf],-1===c&&(c=this.c[g.Qf]),e.gc.red=c>>16,e.gc.green=c>>8&255,e.gc.blue=c&255,c=this.c[g.Lg],e.Ra.J.red=c>>16,e.Ra.J.green=c>>8&255,e.Ra.J.blue=c&255,c=this.c[g.Mi],-1===c&&(c=this.c[g.Lg]),e.Ra.ca.red=c>>16,e.Ra.ca.green=c>>8&255,e.Ra.ca.blue=c&255,c=this.c[g.Qf],-1===c&&(c=this.c[g.Pf]),e.Na.J.red=
c>>16,e.Na.J.green=c>>8&255,e.Na.J.blue=c&255,c=this.c[g.Oi],-1===c&&(c=this.c[g.Qf],-1===c&&(c=this.c[g.Pf])),e.Na.ca.red=c>>16,e.Na.ca.green=c>>8&255,e.Na.ca.blue=c&255,this.a.Me(this.a.wc,1))};r.prototype.vo=function(a){var b=this.V.sp();b.Re||(b.x=this.a.width/2-this.a.F);b.re||(b.y=this.a.height/2-this.a.A);b.Dc||(b.zoom=this.a.zoom);b.Dh||(b.angle=this.a.angle);b.Vh||(b.o=this.a.o);b.Jh||(b.depth=this.a.tc);b.Tg||(b.Ta=this.tb);b.ki||(b.step=this.G);b.Bf||(b.Xa=this.a.Ed);this.V.eq(a)};r.prototype.gr=
function(a){var b=a,c=this.Vb,d,e=a.length;c.font=g.sg;d=c.measureText(a).width;if(420<d){--e;for(d=c.measureText(a.substr(0,e)+"...").width;420<d;)--e,d=c.measureText(a.substr(0,e)+"...").width;b=b.substr(0,e)+"..."}return b};r.prototype.Eg=function(a,b){var c=a;a.length>b&&(c=a.substr(0,b-1)+"...");return c};r.prototype.uj=function(a,b,c){var e=a.indexOf("\\n");-1!==e&&(c?b[b.length]=[d.nh+" "+d.mb+this.Eg(a,23)+d.mb,"only one line allowed"]:(e=a.substr(e+2).indexOf("\\n"),-1!==e&&(b[b.length]=
[d.mb+this.Eg(a,23),"only two lines allowed"])))};r.prototype.bj=function(a,b,c){var e=d.ni+" ",f="overwrites (",e=b>=this.a.wc?e+d.mi:e+b,f=c>=this.a.wc?f+d.mi:f+c;a[a.length]=[e,f+")"]};r.prototype.ic=function(a,b,c,d,e,f){var g=0,h=0,l=0,m,k;if(a.ba())if(g=a.$()|0,0>g||255<g)b[b.length]=[d+" "+f+" "+g,"RED out of range"],e=!0;else if(a.ba())if(h=a.$()|0,0>h||255<h)b[b.length]=[d+" "+f+" "+g+" "+h,"GREEN out of range"],e=!0;else if(a.ba()){if(l=a.$()|0,0>l||255<l)b[b.length]=[d+" "+f+" "+g+" "+
h+" "+l,"BLUE out of range"],e=!0}else this.ld(a,b,d+" "+f+" "+g+" "+h,"BLUE","numeric"),e=!0;else this.ld(a,b,d+" "+f+" "+g,"GREEN","numeric"),e=!0;else m=a.gg(),k=ColourManager.kc[m.toLowerCase()],void 0!==k?(a.ya(),g=k[1],h=k[2],l=k[3]):(e=!0,""===m||this.xh(m)?b[b.length]=[d+" "+f,"name missing"]:(b[b.length]=[d+" "+f+" "+m,"name not known"],a.ya()));e||(-1!==this.W[c]&&(b[b.length]=[d+" "+f+" "+g+" "+h+" "+l,"overwrites ("+(this.W[c]>>16)+" "+(this.W[c]>>8&255)+" "+(this.W[c]&255)+")"]),this.W[c]=
g<<16|h<<8|l)};r.prototype.Fh=function(a){var b="",c=a.indexOf(d.Ac),e;if(-1===c)b=a;else{for(;-1!==c;)if(b+=a.substr(0,c),c+1<a.length){e=a[c+1];a=a.substr(c+2);switch(e){case "B":b+=g.Yl;break;case "N":b+=this.Ef;break;case "R":b+=this.Gb;break;case "A":b=""===this.Qa?b+this.Gb:b+this.Qa;break;case "O":b+=this.Ff;break;case "T":b+=g.pp;break;case d.Ac:b+=d.Ac;break;default:b+=d.Ac+e}c=a.indexOf(d.Ac)}else c=-1;b+=a}return b};r.prototype.ua=function(a,b,c,e){e[e.length]=a?b===d.Rc?[b+" "+c,"already defined"]:
[b+" "+c,"overwrites "+d.Rc]:b===d.Rc?[b+" "+c,"overwrites "+d.Bd]:[b+" "+c,"already defined"]};r.prototype.Ba=function(a){var b="";a===(a|0)?b=String(a):b=a.toFixed(2);return b};r.prototype.no=function(a,b){var c=new Script(a),e=!1,f,h,l=!1,m="",k=0,n,p,q=this.Eb,r=0,u="",t=this.V.Li(),A=!1,F=!1,J=-1,K=-1,Q=-1,T,X,N;this.yh=this.Df=0;this.Of=!1;this.c[g.Pf]=-1;this.c[g.Lg]=-1;this.c[g.Mi]=-1;this.c[g.Qf]=-1;this.c[g.Oi]=-1;this.c[g.Ui]=-1;this.c[g.Vi]=-1;this.c[g.Wi]=-1;this.c[g.Xi]=-1;this.c[g.Ni]=
-1;this.c[g.Ri]=-1;this.c[g.Qi]=-1;this.c[g.Pi]=-1;this.c[g.Si]=-1;this.c[g.Ti]=-1;this.c[g.yk]=-1;this.W=[];if(c.Jm(d.gi)){for(f=0;256>f;f+=1)this.W[f]=-1;for(f=c.ya();""!==f;){if(l)f[f.length-1]===d.mb?(m=m+" "+f.substr(0,f.length-1),l=!1,this.uj(m,q,e),e?(""!==this.Ja&&(q[q.length]=[d.nh+" "+d.mb+this.Eg(m,20)+d.mb,"overwrites "+d.mb+this.Ja+d.mb]),this.Ja=m,e=!1):(t.Yb=this.Fh(m),t.Ql=!0)):m=m+" "+f;else if(f[0]===d.mb)m=f.substr(1),l=!0,f[f.length-1]===d.mb&&(l=!1,m=m.substr(0,m.length-1),this.uj(m,
q,e),e?(""!==this.Ja&&(q[q.length]=[d.nh+" "+d.mb+this.Eg(m,20)+d.mb,"overwrites "+d.mb+this.Ja+d.mb]),this.Ja=m,e=!1):(t.Yb=this.Fh(m),t.Ql=!0));else{n=p=!1;this.Df+=1;switch(f){case d.nh:n=e=!0;break;case d.hl:n=this.Td=!0;break;case d.jl:this.Lh=!1;n=!0;break;case d.ji:n=this.jh=!0;break;case d.Ii:n=t.bc=!0;break;case d.Wk:n=this.gf=!0;break;case d.Oh:n=this.a.Bb=!0;break;case d.Nh:c.ba()&&(p=!0,k=c.$()|0,k>=g.Qp&&k<=g.Jp&&(this.a.Pc=k,n=!0));break;case d.wa:case d.vk:u=f;h=!1;if(c.ba()){n=c.$()|
0;if(0>n||255<=n)q[q.length]=[f+" "+n,"STATE out of range"],h=!0;this.ic(c,q,n,f,h,n)}else switch(h=c.gg(),h){case d.sn:h=c.ya();this.ic(c,q,g.tn,f,!1,h);break;case d.un:h=c.ya();this.ic(c,q,g.vn,f,!1,h);break;case d.Um:h=c.ya();this.ic(c,q,g.Wm,f,!1,h);break;case d.en:h=c.ya();this.ic(c,q,g.fn,f,!1,h);break;case d.jn:h=c.ya();this.ic(c,q,g.kn,f,!1,h);break;case d.gn:h=c.ya();this.ic(c,q,g.hn,f,!1,h);break;case d.an:h=c.ya();this.ic(c,q,g.bn,f,!1,h);break;case d.Un:this.X(c,q,g.Pf,u);break;case d.Rl:this.X(c,
q,g.Lg,u);break;case d.Tn:this.X(c,q,g.Mi,u);break;case d.Sl:this.X(c,q,g.Qf,u);break;case d.Vn:this.X(c,q,g.Oi,u);break;case d.Oh:this.X(c,q,g.Ui,u);break;case d.Nh:this.X(c,q,g.Vi,u);break;case d.ji:this.X(c,q,g.Wi,u);break;case d.Pl:this.X(c,q,g.Xi,u);break;case d.Ik:this.X(c,q,g.yk,u);break;case d.km:this.X(c,q,g.Ni,u);break;case d.Om:this.X(c,q,g.Ri,u);break;case d.Nm:this.X(c,q,g.Qi,u);break;case d.Mm:this.X(c,q,g.Pi,u);break;case d.Pm:this.X(c,q,g.Si,u);break;case d.Qm:this.X(c,q,g.Ti,u);break;
default:q[q.length]=[f+" "+h,"illegal element"],c.ya()}n=!0;break;case d.yl:c.Jm(d.gi);n=!0;--this.Df;break;case d.Bi:n=this.yb=!0;break;case d.gl:n=this.dc=!0;break;case d.il:n=this.dh=!0;break;case d.Ml:n=this.ej=!0;break;case d.Ji:this.Ka&&(this.fd=!0);n=!0;break;case d.Sk:n=this.nj=!0;break;case d.Kl:n=this.Ne=!0;break;case d.wi:c.ba()&&(p=!0,k=c.$(),k>=g.nf&&k<=g.mf&&(T=k,p=!1,f+=" "+k,c.ba()&&(p=!0,k=c.$(),k>=g.nf&&k<=g.mf&&(X=k,n=!0,this.Ya&&(q[q.length]=[d.wi+" "+T+" "+X,"overwrites "+K+" "+
Q]),K=T,Q=X,this.Ya=!0))));break;case d.vi:c.ba()&&(p=!0,k=c.$()|0,0<k&&(h=k,p=!1,f+=" "+k,c.ba()&&(p=!0,k=c.$(),k>=g.nf&&k<=g.mf&&(T=k,p=!1,f+=" "+k,c.ba()&&(p=!0,k=c.$(),k>=g.nf&&k<=g.mf&&(X=k,n=!0,this.nd&&(q[q.length]=[d.vi+" "+h+" "+T+" "+X,"overwrites "+J+" "+K+" "+Q]),J=h,K=T,Q=X,this.Ya=this.nd=!0))))));break;case d.qg:c.ba()&&(p=!0,k=c.$(),k>=g.nf&&k<=g.mf&&(X=k,p=!1,f+=" "+k,c.ba()&&(p=!0,k=c.$(),k>=g.nf&&k<=g.mf&&(T=k,p=!1,f+=" "+k,c.ba()&&(p=!0,k=c.$(),k>=g.nf&&k<=g.mf&&(N=k,p=!1,f+=" "+
k,c.ba()&&(p=!0,k=c.$(),k>=g.nf&&k<=g.mf&&(h=k,n=!0,N>X?q[q.length]=[d.qg+" W "+this.Ba(N)+" E "+this.Ba(X),"W is greater than E"]:h>T?q[q.length]=[d.qg+" N "+this.Ba(h)+" S "+this.Ba(T),"N is greater than S"]:(this.md&&(q[q.length]=[d.qg+" "+this.Ba(X)+" "+this.Ba(T)+" "+this.Ba(N)+" "+this.Ba(h),"overwrites "+this.Ba(this.hb)+" "+this.Ba(this.ob)+" "+this.Ba(this.Rb)+" "+this.Ba(this.Qb)]),this.Ya=this.md=!0,this.Qb=h,this.hb=X,this.ob=T,this.Rb=N)))))))));break;case d.Yh:c.ba()&&(p=!0,k=c.$()|
0,0<k&&(-1!==this.ka&&(q[q.length]=[d.Yh+" "+k,"overwrites "+this.ka]),this.ka=k,n=!0));break;case d.li:c.ba()&&(p=!0,k=c.$()|0,0<k&&(-1!==this.Wd&&(q[q.length]=[d.li+" "+k,"overwrites "+this.Wd]),this.Wd=k,n=!0));break;case d.Gi:c.ba()&&(p=!0,k=c.$()|0,0<=k&&359>=k&&(t.Dh&&(q[q.length]=[d.Gi+" "+k,"overwrites ("+t.angle+")"]),t.angle=k,n=t.Dh=!0));break;case d.xj:c.ba()&&(p=!0,k=c.$()|0,k>=g.Cj&&k<=g.zj&&(t.Vh&&(q[q.length]=[d.xj+" "+k,"overwrites ("+t.o+")"]),t.o=k,n=t.Vh=!0));break;case d.Zi:c.ba()&&
(p=!0,k=c.$(),k>=g.Bj&&k<=g.mn&&(t.Jh&&(q[q.length]=[d.Zi+" "+k+"overwrites ("+t.depth+")"]),t.depth=k,n=t.Jh=!0));break;case d.ak:c.ba()&&(p=!0,k=c.$(),k>=-this.a.jb/2&&k<=this.a.jb/2&&(this.fa=k,n=!0));break;case d.bk:c.ba()&&(p=!0,k=c.$(),k>=-this.a.jb/2&&k<=this.a.jb/2&&(this.ha=k,n=!0));break;case d.Bc:c.ba()&&(p=!0,k=c.$(),k>=-this.a.jb/2&&k<=this.a.jb/2&&(t.Re&&(q[q.length]=[d.Bc+" "+k,"overwrites ("+t.x+")"]),t.x=-k,n=t.Re=!0));break;case d.Cc:c.ba()&&(p=!0,k=c.$(),k>=-this.a.jb/2&&k<=this.a.jb/
2&&(t.re&&(q[q.length]=[d.Cc+" "+k,"overwrites ("+t.y+")"]),t.y=-k,n=t.re=!0));break;case d.Zm:n=!0;break;case d.nk:case d.Pb:c.ba()&&(p=!0,k=c.$(),k>=g.sa&&k<=g.kb?(t.Dc&&(q[q.length]=1>t.zoom?[d.Pb+" "+k,"overwrites ("+-(1/t.zoom)+")"]:[d.Pb+" "+k,"overwrites ("+t.zoom+")"]),t.zoom=k,n=t.Dc=!0):k>=g.Rp&&k<=g.Lp&&(t.Dc&&(q[q.length]=1>t.zoom?[d.Pb+" "+k,"overwrites ("+-(1/t.zoom)+")"]:[d.Pb+" "+k,"overwrites ("+t.zoom+")"]),t.zoom=-(1/k),n=t.Dc=!0));break;case d.hj:c.ba()&&(p=!0,k=c.$()|0,k>=g.sd&&
k<=g.lf&&(t.Tg&&(q[q.length]=[d.hj+" "+k,"overwrites ("+t.Ta+")"]),t.Ta=k,n=t.Tg=!0));break;case d.Ul:this.Ae||(this.ng=this.Z=!0);n=!0;break;case d.Xn:this.Ae||(this.Cf=this.ng=this.Z=!0,this.g.Cf=!0);n=!0;break;case d.Tl:c.ba()&&(p=!0,k=c.$()|0,k>=g.rn&&k<=g.on&&(this.xb=k,n=!0));break;case d.ni:c.ba()?(p=!0,k=c.$()|0,0<=k&&k<this.a.wc&&(t.Bf&&this.bj(q,k,t.Xa),t.Xa=k,n=t.Bf=!0)):(h=c.gg(),h===d.mi&&(c.ya(),this.Of?(t.Bf&&this.bj(q,this.a.wc,t.Xa),t.Xa=this.a.wc,t.Bf=!0):q[q.length]=[d.ni+" "+d.mi,
"no custom THEME defined"],n=!0));break;case d.gi:q[q.length]=[f,"already in a script block"];n=!0;break;case d.Cl:this.ea=!this.ea;n=!0;break;case d.Dl:this.Xf.current=this.Ai([!0],!0,this);n=!0;break;case d.Kk:n=this.g.hh=!0;break;case d.Bl:this.Zj([!0],!0,this);this.rc&&(this.rc.current=[this.Zc],this.g.pg=!0);n=!0;break;case d.Dk:c.ba()&&(p=!0,k=c.$()|0,k>=g.qn&&k<=g.ln&&(n=!0,this.a.Mj=k));break;case d.Ej:n=this.Nc=!0;break;case d.ij:n=this.Cb=!0;break;case d.Ok:c.ba()&&(p=!0,k=c.$(),0<=k&&1>=
k&&(n=!0,this.bb=k));break;case d.Pk:this.vd=!1;n=!0;break;case d.Gl:this.a.M=!1;this.va.j=this.a.M;n=!0;break;case d.Uk:this.a.M=!0;this.va.j=this.a.M;n=!0;break;case d.rl:this.Ah=c.ya();n=this.qh=!0;break;case d.Rc:h=c.gg();switch(h){case d.Bc:t.Se&&this.ua(t.ad,d.Rc,d.Bc,q);t.ad=!0;t.Se=!0;c.ya();break;case d.Cc:t.Te&&this.ua(t.bd,d.Rc,d.Cc,q);t.bd=!0;t.Te=!0;c.ya();break;case d.Pb:t.bm&&this.ua(t.cd,d.Rc,d.Pb,q);t.cd=!0;t.Di=!0;c.ya();break;case d.Hg:t.Se&&this.ua(t.ad,d.Rc,d.Bc,q);t.Te&&this.ua(t.bd,
d.Rc,d.Cc,q);t.bm&&this.ua(t.cd,d.Rc,d.Pb,q);t.ad=!0;t.Se=!0;t.bd=!0;t.Te=!0;t.cd=!0;t.Di=!0;c.ya();break;default:this.ld(c,q,d.Rc,"argument",d.Hg+", "+d.Bc+", "+d.Cc+" or "+d.Pb)}n=!0;break;case d.Bd:h=c.gg();switch(h){case d.Bc:t.Se&&this.ua(t.ad,d.Bd,d.Bc,q);t.ad=!1;t.Se=!0;c.ya();break;case d.Cc:t.Te&&this.ua(t.bd,d.Bd,d.Cc,q);t.bd=!1;t.Te=!0;c.ya();break;case d.Pb:t.bm&&this.ua(t.cd,d.Bd,d.Pb,q);t.cd=!1;t.Di=!0;c.ya();break;case d.Hg:t.Se&&this.ua(t.ad,d.Bd,d.Bc,q);t.Te&&this.ua(t.bd,d.Bd,d.Cc,
q);t.bm&&this.ua(t.cd,d.Bd,d.Pb,q);t.ad=!1;t.Se=!0;t.bd=!1;t.Te=!0;t.cd=!1;t.Di=!0;c.ya();break;default:this.ld(c,q,d.Bd,"argument",d.Hg+", "+d.Bc+", "+d.Cc+" or "+d.Pb)}n=!0;break;case d.nl:F=!0;this.V.add(t);t=this.V.Li();n=t.$m=!0;break;case d.Vj:c.ba()&&(p=!0,k=c.$()|0,0<=k&&(A||(A=!0),0<k&&(this.V.add(t),t=this.V.Li()),t.za=k,n=t.Rn=!0));break;case d.Tj:c.ba()&&(p=!0,k=c.$()|0,k>=g.$f&&k<=g.vc&&(t.ki&&(q[q.length]=[d.Tj+" "+k,"overwrites ("+t.step+")"]),t.step=k,n=t.ki=!0));break;case d.ll:c.ba()&&
(p=!0,k=c.$(),0<k&&(A||(A=!0),this.V.add(t),t=this.V.Li(),t.cb=k,n=t.Sn=!0));break;case d.$j:c.ba()&&(p=!0,k=c.$()|0,this.kr||(this.Aa=k),n=!0);break;case d.pj:c.ba()&&(p=!0,k=c.$()|0,this.Ae||(this.fb=k),n=!0);break;default:q[q.length]=[f,"unknown or misspelt command"],n=!0}n||(p?q[q.length]=[f+" "+k,"argument out of range"]:this.ld(c,q,f,"argument","numeric"))}""!==f&&(f=c.ya())}l&&(q[q.length]=[d.mb+m,"unterminated string"]);A&&this.Ya&&(c=this.md?d.qg:this.nd?d.vi:d.wi,q[q.length]=[c,"can not be used with Waypoints"],
this.nd=this.md=this.Ya=!1);this.md||!this.Ya&&!this.nd||(this.nd&&(0<this.a.Pc&&(J*=this.a.Pc),this.ka=J),this.Qb=Q,this.hb=K,this.ob=Q,this.Rb=K);(A||F)&&this.V.add(t);if(A){t=this.V.ja[0];t.Bf&&this.a.Me(t.Xa,1);t.Re&&(this.a.F=this.a.width/2-t.x);t.re&&(this.a.A=this.a.height/2-t.y);t.Dc&&(this.a.zoom=t.zoom);t.Tg&&(this.tb=t.Ta);this.eb=!0;for(f=0;f<this.V.ja.length;f+=1)t=this.V.ja[f],t.bc&&(t.Re||t.re||t.Dc)&&(m="",t.Re?(m="X "+t.x,t.re?m=t.Dc?m+(", Y "+t.y+" and ZOOM "+t.zoom):m+(" and Y "+
t.y):t.Dc&&(m+=" and ZOOM "+t.zoom)):t.re?(m="Y "+t.y,t.Dc&&(m+=" and ZOOM "+t.zoom)):t.Dc&&(m="ZOOM "+t.zoom),q[q.length]=[d.Ii,"overwrites "+m]);t=this.V.ja[0]}else t.bc&&(this.Sa=!0),t.Re&&(this.a.F=this.a.width/2-t.x),t.re&&(this.a.A=this.a.height/2-t.y),t.Dc&&(this.a.zoom=t.zoom),t.Dh&&(this.a.angle=t.angle),t.Bf&&this.a.Me(t.Xa,1),t.Jh&&(this.a.tc=t.depth/g.Sf+g.Bj),t.Vh&&(this.a.o=t.o),t.Tg&&(this.tb=t.Ta),t.ki&&(this.G=t.step),t.Ql&&this.g.notification.B(t.Yb,1E3,!1);t.Dc&&(this.th=!0);t.Re&&
(this.rh=!0);t.re&&(this.sh=!0);for(f=0;f<b;f+=1)-1!==this.W[f]&&(r+=1);if(0<r){this.Jf=!0;for(f=0;f<b;f+=1)PatternManager.Yc[f]?-1===this.W[f]?(r=this.kc[f],this.ej&&(q[q.length]=this.a.sc?[u+" "+g.Kq[f],"definition missing (used "+(r>>16)+" "+(r>>8&255)+" "+(r&255)+")"]:[u+" "+f,"definition missing (used "+(r>>16)+" "+(r>>8&255)+" "+(r&255)+")"]),this.W[f]=r,this.Jf=!1,this.Pd[f]=g.Qn):this.Pd[f]=g.Pn:this.Pd[f]=g.Ll;this.Ie=this.Jf?"(custom)":this.Ie+" (custom*)"}else this.W=[];this.Of&&this.uo(q,
u);-1!==this.Je&&(this.a.Qc=this.Je);-1!==this.Le&&(this.a.Od=this.Le);2<b&&!this.a.sc&&-1===this.a.u&&(this.yb=!0);this.yb&&(c="not possible due to "+d.Bi,this.fd&&(q[q.length]=[d.Ji,c],this.fd=!1),-1!==this.Wd&&(q[q.length]=[d.li+" "+this.Wd,c]),-1!==this.ka&&(q[q.length]=[d.Yh+" "+this.ka,c]));this.$a+g.vc+2*Math.abs(this.fa)>=this.a.jb&&(q[q.length]=[d.ak+" "+this.fa,"pattern does not fit on grid at this offset"],this.fa=0);this.Fb+g.vc+2*Math.abs(this.ha)>=this.a.jb&&(q[q.length]=[d.bk+" "+this.ha,
"pattern does not fit on grid at this offset"],this.ha=0);this.yh=q.length}this.Of&&this.Nb&&(this.Nb.upper=this.a.wc);""!==this.Ja&&(this.Ja=this.Fh(this.Ja));this.Sa&&(this.Hi=!0);this.Cb&&this.Nc&&(q[q.length]=[d.ij,"not valid with "+d.Ej],this.Cb=!1);r=!1;-1!=this.Aa&&(u=g.Sd,this.dc&&(u=g.Tp),this.Aa<u||this.Aa>this.oc)&&(q[q.length]=[d.$j+" "+this.Aa,"argument out of range"],r=!0);-1!=this.fb&&(u=g.Dj,this.dc&&(u=g.Sp),this.fb<u||this.fb>g.pn)&&(q[q.length]=[d.pj+" "+this.fb,"argument out of range"],
r=!0);if(r||q.length)this.Aa=g.Sd,this.fb=g.ah,this.dc=!1;this.w.j=this.dc;this.g.dc=this.dc;this.g.dh=this.dh;this.dc&&(this.Cb=this.Cf=this.Z=this.fd=!1,this.Ai([!1],!0,this),this.Zj([!1],!0,this),this.ea=!1)};r.prototype.qo=function(){this.qh=this.dh=this.dc=!1;this.a.Tc=0;this.a.xc=0;this.a.Wb=1;this.ea=this.Hi=this.Sa=!1;this.W=[];this.zb=this.ia=null;this.Gd=g.Gd;this.a.Ld=this.a.Ap;this.a.Kd=this.a.zp;this.a.Jd=this.a.yp;this.a.Md=this.a.Bp;this.a.Nd=this.a.Cp;this.Ye=this.fd=this.nj=!1;this.ka=
this.Wd=-1;this.Zc=this.Za=this.nd=this.Ya=this.md=this.eb=this.nb=this.qa=!1};r.prototype.Nl=function(){this.Cf?a(this.element):(this.s=this.rj,this.m=this.Ih,this.Sa?(this.Z=!1,this.ae(!0,!1)):this.a.zoom=this.tj,this.Ca&&(this.Ca.current=this.qe([this.a.zoom,this.a.zoom],!1,this)),this.C=this.oj,this.Z=!1,this.g.Z=!1,this.w.j=!1,this.g.notification.B("Shrink with hotkey N",100,!0))};r.prototype.hr=function(a){a.Z?(a.Nl(),a.resize()):a.dc&&a.um(a)};r.prototype.resize=function(){this.v.width=this.s;
this.v.height=this.m;this.dg.width=this.s;this.dg.height=this.m;this.Vb.textBaseline="middle";this.a.Fn(this.s,this.m)};r.prototype.Ol=function(){this.rj=this.s;this.Ih=this.m;this.tj=this.a.zoom;this.oj=this.C;this.s=this.s/this.xb|0;this.m=this.m/this.xb|0;this.a.zoom=this.a.zoom/this.xb;this.s&=-8;this.w.j=!0;this.g.Z=!0;this.g.xb=this.xb;this.Z=!0};r.prototype.Jl=function(a,b){var c,e,f,h,k,l=!1;this.Eb=[];if(c=PatternManager.create("",a,this.a.l))for(this.df=PatternManager.df,this.fj=PatternManager.Mk,
this.tf=PatternManager.tf,this.If=PatternManager.ol,this.Ue=PatternManager.pl,this.$a=c.width,this.Fb=c.height,this.Ef=c.name,this.Ff=c.wn,this.Ud=c.Ud,""===this.Ud&&(this.Ud="(none)"),this.pc=c.He,this.Hf=c.Zh,this.Gb=c.ra,this.Qa=c.gm,this.Ka=PatternManager.Ka,this.a.sc=c.Ub,this.a.u=c.u,this.a.M=c.M,this.a.Kj=c.M,this.a.Be=c.Be,this.a.Qe=c.Qe,this.a.Ib=c.xe,this.a.pa=c.od,this.a.Ma=c.be,this.a.Gh=c.Mh,this.a.Hh=c.Ug,this.a.sk=c.Qk,this.a.nm=c.mj,this.Gf=new Uint32Array(this.pc),e=0;e<this.pc;e+=
1)this.Gf[e]=PatternManager.Yc[e];else this.df=!1,this.fj=0,this.tf=!1,this.Ue=this.If=0,this.Ff=this.Ef=this.Qa=this.Gb="",this.Hf=this.pc=this.Fb=this.$a=0,this.Ud="(none)",this.a.sc=!1,this.a.M=!1,this.a.Be=!1,this.a.Qe=-1,this.a.Kj=!1,this.a.u=-1,this.a.Ib=-1;this.Cb=!1;this.vd=!0;this.bb=g.Bm;this.Nc=!1;this.Lh=!0;this.gj=!1;this.va.j=this.a.M;this.Fa=PatternManager.Fa;this.a.Y=!0;this.a.Mc=-1===this.a.u?!1:!0;this.a.Uj=-1;this.a.Mj=g.Am;this.ha=this.fa=0;this.zc=this.ve=-1;this.Jg=!1;this.Ne=
this.gf=this.w.locked=!1;this.a.up();this.a.vp();this.a.sc&&((PatternManager.Yc[2]||PatternManager.Yc[3]||PatternManager.Yc[4]||PatternManager.Yc[5]||PatternManager.Yc[6])&&this.a.Vo(),PatternManager.Yc[6]&&this.a.Xo());this.Ja="";this.jh=!1;ColourManager.Rd();this.a.Ro();this.a.Qo();this.a.Lo();this.a.sc?this.a.Me(10,1):-1!==this.a.u?this.a.Me(11,1):this.a.Me(1,1);this.a.vm();this.a.Sb(1);this.tb=60;this.G=1;this.a.o=1;this.a.tc=.1;this.a.angle=0;this.a.zoom=6;this.a.F=this.a.width/2;this.a.A=this.a.height/
2;this.sh=this.rh=this.th=!1;this.fb=this.Aa=-1;this.c[g.Pf]=-1;this.c[g.Lg]=-1;this.c[g.Mi]=-1;this.c[g.Qf]=-1;this.c[g.Oi]=-1;this.c[g.Ui]=-1;this.c[g.Vi]=-1;this.c[g.Wi]=-1;this.c[g.Xi]=-1;this.c[g.Ni]=-1;this.c[g.Ri]=-1;this.c[g.Qi]=-1;this.c[g.Pi]=-1;this.c[g.Si]=-1;this.c[g.Ti]=-1;this.Z&&(this.Nl(),this.resize());this.ng=!1;this.g.Z=!1;this.xb=g.Cm;this.Cf=!1;this.yb=this.Lb=this.g.ur=!1;this.a.Bb=!1;this.S.j=!1;this.rc.j=!1;this.da.j=!1;this.Wa.j=!1;this.ud.j=!1;this.vb.j=!1;this.Oa.j=!1;
this.Nb.j=!1;this.w.j=!1;this.wd.j=!1;this.ud.current=[!1];this.rc.current=[!1];this.na=this.C=0;this.Zf.current=this.ti([this.C],!0,this);this.a.Qc=this.a.lj;this.a.Od=this.a.Rk;this.a.Pc=10;this.a.ef=!0;this.Je=this.Le=-1;this.hc=[96,96,96];this.a.Ig=this.a.hf?4284506208:1616929023;this.V.reset();this.Td=this.eb=!1;if(c){if(PatternManager.Sg||c.Ub)c.Ub?(this.kc=ColourManager.sm("LifeHistory"),this.kc[2]=96):this.kc=ColourManager.sm(c.ra),this.kc.length?this.Ie=c.ra:(this.kc=ColourManager.zk,this.Ie=
"(default)");this.qo();c.title&&(this.no(c.title,c.He),myRand.Rd(this.Ah),this.Eb.length&&(this.na=1),this.Z&&b&&(this.Z=!1),-1<this.Aa&&(this.Aa&=-8,this.Aa!==this.s&&(this.s=this.Aa,l=!0)),-1<this.fb&&this.fb!==this.m&&(this.m=this.fb,l=!0));-1!==this.a.Ib?(e=this.a.pa,f=this.a.Ma,0===e&&(e=c.width),0===f&&(f=c.height)):(e=c.width,f=c.height);this.tf&&(-1!==this.a.Ib?(this.fa+=(this.a.pa>>1)+this.If,this.ha+=(this.a.Ma>>1)+this.Ue):(this.fa+=(c.width>>1)+this.If,this.ha+=(c.height>>1)+this.Ue));
for(;this.a.width<this.a.jb&&(e+g.vc+2*Math.abs(this.fa)>=this.a.width||f+g.vc+2*Math.abs(this.ha)>=this.a.height);)this.a.Rm(),this.Jb+=this.a.width>>2,this.Qg+=this.a.height>>2,this.Db+=this.a.width>>2,this.hg+=this.a.height>>2,this.a.M&&(this.Jb-=this.a.height>>3,this.Db-=this.a.height>>3);this.a.sc&&PatternManager.Yc[6]&&this.a.cq(c,this.fa,this.ha);this.ia?this.g.notification.uk="rgb("+this.ia[0]+","+this.ia[1]+","+this.ia[2]+")":this.g.notification.uk=this.g.notification.An;if(!this.W.length)for(e=
0;e<this.kc.length;e+=1)this.Pd[e]=PatternManager.Yc[e]?g.Qn:g.Ll;this.a.ec?(this.a.So(this.kc,this.W),this.a.we=!0):this.a.we=!1;this.jq(c);this.a.Uq();this.qc.lb=""!==this.Qa?this.Qa:this.Gb;this.qc.I="rule "+this.Gb;""!==this.Qa&&(this.qc.I+=" alias "+this.Qa)}this.de.current=this.Fg([this.bb,this.bb],!1,this);this.Zg.current=[this.vd];this.se.current=[this.Sa];this.Yf.current=[this.a.Bb];this.a.oq(this.Ne);this.a.Dn();this.$d=this.elapsedTime=this.a.i=0;this.Lb?(c&&0<this.W.length&&(this.kc=this.W),
this.a.Uo(this.kc),this.a.Xc.reset()):(-1===this.a.u&&this.a.qq(this.a.ib),this.a.sc&&PatternManager.Yc[2]&&this.a.Oo(c,this.fa,this.ha),this.a.rq(this.a.ib),-1!==this.a.Ib&&this.a.zl(),this.a.yq(this.Td),this.a.ul(this.Td));this.a.En();c&&(c.Ge=null);e=this.a.zoom;f=this.a.F;h=this.a.A;k=this.Z;this.Z=!1;this.ae(!0,!1);this.Z=k;this.th&&(this.a.zoom=e);this.rh&&(this.a.F=f);this.sh&&(this.a.A=h);this.eb&&this.vo(this.Eb);this.Dm=this.a.zoom;this.Ca&&(this.Ca.current=this.qe([this.a.zoom,this.a.zoom],
!1,this));this.Jb=this.a.F;this.Qg=this.a.A;this.Ng=this.a.angle;this.va&&(this.va.current=[this.Ng,this.Ng]);this.Rf=this.a.Ed;this.Nb&&(this.Nb.current=[this.Rf,this.Rf]);this.Ck=this.tb;e=Math.sqrt((this.Ck-g.sd)/(g.lf-g.sd));this.da&&(this.da.current=this.Pe([e,e],!0,this));this.Yi=this.G;this.Wa&&(this.Wa.current=this.ug([this.Yi,this.Yi],!0,this));this.Pg=this.a.o;this.vb&&(this.vb.current=[this.Pg,this.Pg]);this.Bk=this.a.tc;e=Math.sqrt(this.Bk);this.Oa&&(this.Oa.current=this.tg([e,e],!0,this));
this.Y=!0;this.fd&&!this.Ye?(this.ub=!0,this.S.current=g.bh):(this.ub=!1,this.S.current=g.La);this.Kn(this.ub);this.m<g.ah?(this.ud.j=!0,this.S.x=this.zh+45,this.S.xd=this.S.x,this.da.x=this.uh+45,this.da.xd=this.da.x,this.Wa.x=this.Bh+45):(this.S.x=this.zh,this.S.xd=this.S.x,this.da.x=this.uh,this.da.xd=this.da.x,this.Wa.x=this.Bh);this.Wa.xd=this.Wa.x;if(l||this.Z)this.Z&&this.Ol(),this.resize();c||(PatternManager.Oe?this.g.notification.B("Pattern too big!",g.Jk,!1):this.g.notification.B("Invalid pattern!",
g.Jk,!1));this.Eb.length?this.C=0:this.na=0;this.Ka||(this.yb=!0);this.yb?(this.S.j=!0,this.rc.j=!0,this.wd.j=!0,this.da.j=!0,this.Wa.j=!0,this.Lb&&(this.vb.j=!0,this.Oa.j=!0,this.Nb.j=!0,this.a.o=1),this.Hb.j=!1,""===this.Fa?(this.Hb.lb=d.Bi,this.Hb.Lc=g.Vg):(this.Hb.lb=this.Fa,this.Hb.Lc=this.Gd)):this.Hb.j=!0;this.co();this.tl(null,6,14,0);this.uc=!1;this.wj="";this.In(this);this.g.pg=!0;this.g.xf(!0);this.Ae&&this.Wj&&(""===this.Ja?this.Wj.nodeValue="LifeViewer":this.Wj.nodeValue=this.gr(this.Ja))};
registerEvent(window,"load",k,!1);window.Keywords=d;window.ViewConstants=g;window.startAllViewers=k;window.updateViewer=a;window.updateMe=function(a){var b=e(a).getElementsByTagName(m.fg)[0];a=l.Ob[0];b.innerHTML=b.value;b=f(b);a[1].$l(a[1]);a[1].g.notification.clear(!0,!0);a[1].g.notification.clear(!1,!0);a[1].Jl(b,!1)};window.hideViewer=p;window.launchInMolly=c})();