MediaWiki:Common.js

From LifeWiki
Revision as of 01:36, 23 June 2017 by Nathaniel (talk | contribs) (Back to LV 226)
Jump to navigation Jump to 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: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* 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 226)
(function(){var r;window.performance||(window.performance={});window.performance.now||(window.performance.now=function(){return performance.now||performance.kr||performance.lr||performance.mr||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,d,p,q){A.addEventListener?A.addEventListener(d,p,q):A.attachEvent("on"+d,p)}})();(function(){function r(p,q,e){this.type=p;this.name=e;this.elements=q;this.size=q*d.bh(p);this.Wh=1}function A(){this.Hc=[];this.jh=this.Aj=this.ih=this.zj=0}var d={dk:8,ek:40,bk:9,ck:10,ak:0,Zj:1,$j:2,Xj:18,Yj:19,bh:function(p){return 1<<(p&7)},typeName:function(p){var d;d=(p&16?"Float":p&8?"Uint":"Int")+8*(1<<(p&7));p&32&&(d+="Clamped");return d}};A.prototype.yo=function(p){var q="";0<=p&&p<this.Hc.length&&(p=this.Hc[p],q=d.typeName(p.type)+"\t"+p.elements+"\t"+p.name+"\t"+p.Wh);return q};A.prototype.pq=
function(p,q,e){for(var c=0,a=!1,n;c<this.Hc.length&&!a;)n=this.Hc[c],e===n.name?(a=!0,this.Aj+=1,this.jh+=n.elements*d.bh(n.type)):c+=1;a?(this.Hc[c].type=p,this.Hc[c].elements=q,this.Hc[c].Wh+=1,this.Hc[c].size=q*d.bh(p)):(c=this.Hc.length,this.Hc[c]=new r(p,q,e));this.zj+=1;this.ih+=q*d.bh(p)};A.prototype.Ol=function(p,q,e,c,a){p=p.buffer;c*=d.bh(q);switch(q){case d.dk:e=new Uint8Array(p,c,e);break;case d.ek:e=new Uint8Array(p,c,e);break;case d.bk:e=new Uint16Array(p,c,e);break;case d.ck:e=new Uint32Array(p,
c,e);break;case d.ak:e=new Int8Array(p,c,e);break;case d.Zj:e=new Int16Array(p,c,e);break;case d.$j:e=new Int32Array(p,c,e);break;case d.Xj:e=new Float32Array(p,c,e);break;case d.Yj:e=new Float64Array(p,c,e);break;default:e=null,console.debug("Illegal type specified to allocator.typedView for "+a+": "+q)}return e};A.prototype.Kq=function(p,q,e){switch(p){case d.dk:q=new Uint8Array(q);break;case d.ek:q=new Uint8Array(q);break;case d.bk:q=new Uint16Array(q);break;case d.ck:q=new Uint32Array(q);break;
case d.ak:q=new Int8Array(q);break;case d.Zj:q=new Int16Array(q);break;case d.$j:q=new Int32Array(q);break;case d.Xj:q=new Float32Array(q);break;case d.Yj:q=new Float64Array(q);break;default:q=null,console.debug("Illegal type specified to allocator.typedMemory for "+e+": "+p)}return q};A.prototype.ea=function(p,d,e){var c;(c=this.Kq(p,d,e))&&this.pq(p,d,e);return c};Array.T=function(p,d,e,c,a,n){var b=0,k=[],f;k.l=a;k.type=p;k.wi=null;if(d*e){f=a.ea(p,d*e,n);for(k.wi=f;b<d;)k[b]=a.Ol(f,p,e,b*e,n),
b+=1;if(0!==c)if(f.fill)f.fill(c);else for(b=0;b<f.length;)f[b]=c,b+=1}return k};Array.Zl=function(p,d){var e=p.l.ea(p.type,p[0].length,d);p[p.length]=e};Array.Bd=function(p,d){d.wi.set(p.wi)};Array.gf=function(p,q){var e=Uint16,c,a=p.length,n=[],b=p.l,k=p[0].length/d.bh(e);for(c=0;c<a;c+=1)n[c]=b.Ol(p.wi,e,k,c*k,q);return n};Array.md=function(p,d,e){var c,a=p.length,n=[],b=p.l,k=p.type,f=p[0].length;for(c=0;c<a;c+=1)n[c]=b.Ol(p.wi,k,f-d,c*f+d,e);return n};window.Allocator=A;window.Uint8=d.dk;window.Uint8Clamped=
d.ek;window.Uint16=d.bk;window.Uint32=d.ck;window.Int8=d.ak;window.Int16=d.Zj;window.Int32=d.$j;window.Float32=d.Xj;window.Float64=d.Yj})();window.AliasManager={c:[],Nd:function(){this.c=[];this.c.push(["Totalistic",""]);this.c.push(["","B3/S23"]);this.c.push(["Conway's Life","B3/S23"]);this.c.push(["2x2","B36/S125"]);this.c.push(["34 Life","B34/S34"]);this.c.push(["3-4 Life","B34/S34"]);this.c.push(["Amoeba","B357/S1358"]);this.c.push(["AntiLife","B0123478/S01234678"]);this.c.push(["Assimilation","B345/S4567"]);this.c.push(["Bacteria","B34/S456"]);this.c.push(["Blinkers","B345/S2"]);this.c.push(["Bugs","B3567/S15678"]);this.c.push(["Coagulations",
"B378/S235678"]);this.c.push(["Coral","B3/S45678"]);this.c.push(["Corrosion of Conformity","B3/S124"]);this.c.push(["Day & Night","B3678/S34678"]);this.c.push(["Day and Night","B3678/S34678"]);this.c.push(["Diamoeba","B35678/S5678"]);this.c.push(["DotLife","B3/S023"]);this.c.push(["DryLife","B37/S23"]);this.c.push(["EightLife","B3/S238"]);this.c.push(["Electrified Maze","B45/S12345"]);this.c.push(["Flock","B3/S12"]);this.c.push(["Fredkin","B1357/S02468"]);this.c.push(["Gnarl","B1/S1"]);this.c.push(["H-Trees",
"B1/S012345678"]);this.c.push(["HighLife","B36/S23"]);this.c.push(["HoneyLife","B38/S238"]);this.c.push(["Holstein","B35678/S4678"]);this.c.push(["Iceballs","B25678/S5678"]);this.c.push(["InverseLife","B012345678/S34678"]);this.c.push(["Land Rush","B36/S234578"]);this.c.push(["Life without Death","B3/S012345678"]);this.c.push(["Life","B3/S23"]);this.c.push(["Live Free or Die","B2/S0"]);this.c.push(["LongLife","B345/S5"]);this.c.push(["Long Life","B345/S5"]);this.c.push(["LowDeath","B368/S238"]);this.c.push(["LowLife",
"B3/S13"]);this.c.push(["Majority","B45678/S5678"]);this.c.push(["Maze","B3/S12345"]);this.c.push(["Maze with Mice","B37/S12345"]);this.c.push(["Mazectric","B3/S1234"]);this.c.push(["Mazectric with Mice","B37/S1234"]);this.c.push(["Morley","B368/S245"]);this.c.push(["Move","B368/S245"]);this.c.push(["Pedestrian Life","B38/S23"]);this.c.push(["Persian Rug","B234/S"]);this.c.push(["Plow World","B378/S012345678"]);this.c.push(["Pseudo Life","B357/S238"]);this.c.push(["Replicator","B1357/S1357"]);this.c.push(["Seeds",
"B2/S"]);this.c.push(["Serviettes","B234/S"]);this.c.push(["Slow Blob","B367/S125678"]);this.c.push(["SnowLife","B3/S1237"]);this.c.push(["Stains","B3678/S235678"]);this.c.push(["Vote","B5678/S45678"]);this.c.push(["Vote 4/5","B4678/S35678"]);this.c.push(["Walled Cities","B45678/S2345"]);this.c.push(["Isotropic Non-Totalistic",""]);this.c.push(["aLife","B3/S234w"]);this.c.push(["CB2","B2ae4i/S1e2in"]);this.c.push(["DLife","B3-n/S23"]);this.c.push(["GlideLife","B34ek5ak/S2-c34z"]);this.c.push(["Goat Flock",
"B2in3/S123a"]);this.c.push(["Just Friends","B2-a/S12"]);this.c.push(["Kgdm","B3/S2-c3-en4ceitz"]);this.c.push(["Salad","B2i34c/S2-i3"]);this.c.push(["TauLife","B3-nr/S2-i34-aij"]);this.c.push(["tDryLife","B37/S2-i34q"]);this.c.push(["tHighLife","B36/S2-i34q"]);this.c.push(["TLife","B3/S2-i34q"]);this.c.push(["Generations",""]);this.c.push(["Banners","2367/3457/5"]);this.c.push(["BelZhab","23/23/8"]);this.c.push(["BelZhab Sediment","145678/23/8"]);this.c.push(["Bloomerang","234/34678/24"]);this.c.push(["Bombers",
"345/24/25"]);this.c.push(["Brain 6","6/246/3"]);this.c.push(["Brian's Brain","/2/3"]);this.c.push(["Burst","0235678/3468/9"]);this.c.push(["BurstII","235678/3468/9"]);this.c.push(["Caterpillars","124567/378/4"]);this.c.push(["Chenille","05678/24567/6"]);this.c.push(["Circuit Genesis","2345/1234/8"]);this.c.push(["Cooties","23/2/8"]);this.c.push(["Ebb&Flow","012478/36/18"]);this.c.push(["Ebb&Flow II","012468/37/18"]);this.c.push(["Faders","2/2/25"]);this.c.push(["Fireworks","2/13/21"]);this.c.push(["Flaming Starbows",
"347/23/8"]);this.c.push(["Frogs","12/34/3"]);this.c.push(["Frozen spirals","356/23/6"]);this.c.push(["Glisserati","035678/245678/7"]);this.c.push(["Glissergy","035678/245678/5"]);this.c.push(["Lava","12345/45678/8"]);this.c.push(["Lines","012345/458/3"]);this.c.push(["LivingOn TheEdge","345/3/6"]);this.c.push(["Meteor Guns","01245678/3/8"]);this.c.push(["Nova","45678/2478/25"]);this.c.push(["OrthoGo","3/2/4"]);this.c.push(["Prairie on fire","345/34/6"]);this.c.push(["RainZha","2/23/8"]);this.c.push(["Rake",
"3467/2678/6"]);this.c.push(["SediMental","45678/25678/4"]);this.c.push(["Snake","03467/25/6"]);this.c.push(["SoftFreeze","13458/38/6"]);this.c.push(["Spirals","2/234/5"]);this.c.push(["Star Wars","345/2/4"]);this.c.push(["Sticks","3456/2/6"]);this.c.push(["Swirl","23/34/8"]);this.c.push(["ThrillGrill","1234/34/48"]);this.c.push(["Transers","345/26/5"]);this.c.push(["TransersII","0345/26/6"]);this.c.push(["Wanderers","345/34678/5"]);this.c.push(["Worms","3467/25/6"]);this.c.push(["Xtasy","1456/2356/16"])},
up:function(r){var A=null,d=0;for(r=r.toLowerCase();d<this.c.length&&null===A;)""!==this.c[d][1]&&this.c[d][0].toLowerCase()===r&&(A=this.c[d][1]),d+=1;return A},tp:function(r){for(var A=null,d=0;d<this.c.length&&null===A;)""!==this.c[d][1]&&this.c[d][1]===r&&(A=this.c[d][0]),d+=1;return A}};(function(){function r(a,c,b,e,f){this.g=f;this.Y=a;this.da=c;this.ha=b;this.h="";this.H=a;this.K=c;this.ga=b;this.fe="";this.b=e;this.W=this.v=0;this.un=this.mk="rgb(32,255,255)";this.f=0;this.hk=!1;this.ya="black";this.enabled=!1}function A(a,c,b,e){this.name=a;this.width=c;this.height=b;this.Wh=e}function d(a,c){this.f=c;this.h=a;this.b=[]}function p(a,e,b,k,f,m,g,l,h,u,z,v,C,p,d,w,q,y,E,x){this.id=a;this.M="";this.cf=-1;this.j=!1;this.ob=e;this.caller=b;this.icon=E;this.x=f;this.y=m;this.sd=f;
this.b=m;this.position=k;this.width=g;this.height=l;this.border=p;this.type=v;C===c.cm?this.orientation=g>=l?c.Rb:c.Sj:this.orientation=C;this.lower=h;this.upper=u;v===c.Zg?this.current=[z,z]:this.current=z;this.Ql=d;this.kb=w;this.kl=q;this.fixed=y;this.Vk=!1;this.Mh=this.Lh=this.Ph=this.Oh=this.Ym=this.Xm=-1;this.textAlign=c.km;this.enabled=!0;this.locked=!1;this.oi=[];this.Cj=0;this.Dp=!1;this.yd=x.yd;this.cd=x.cd;this.Dd=x.Dd;this.Zb=x.Zb;this.te=x.te;this.se=x.se;this.fg=x.fg;this.qf=x.qf;this.we=
x.we;this.ff=x.ff;this.border=x.border;this.font=x.Lg}function q(a,e,b,k,f){this.b=k;this.Lg=f;this.locked=this.j=!1;this.mf=this.be=-1;this.vb=!1;this.H=6;this.ob=a;this.ic=[];this.ta=0;this.yd="";this.cd=0;this.Dd="";this.Zb=0;this.te="";this.se=0;this.fg="";this.qf=0;this.we="";this.border=this.ff=0;this.h=c.cm;this.lf=this.vh=-1;this.xk=null;this.yi=e;this.caller=b;this.Da=null}function e(a,c,b,e,f,m){var g=this,n=0,h=a.canvas;this.H=this.K=40;this.Jq=50;this.Ud=0;this.b=this.f=this.h=-1;this.ag=
!1;this.caller=f;this.kg=this.Z=!1;this.wb=4;this.Yi=m;this.hasFocus=this.lk=!1;this.xh=!0;this.ti=!1;this.si=1;this.yd="black";this.cd=.7;this.Dd="rgb(32,255,255)";this.Zb=1;this.te="rgb(0,240,32)";this.se=.7;this.fg="blue";this.qf=.7;this.we="grey";this.border=this.ff=1;this.jm=function(h){return function(){h.ia(h)}}(this);this.Da=e;this.Pd=a;this.Tb=c;this.vb=!1;this.Ae=this.ze=-1;this.Ab=null;this.Lg=b;this.ah=this.gg=!1;this.Wk=performance.now();this.gn=1E3;this.Zf=5;this.mi=0;this.Uk=[];this.Yk=
[];this.Tk=[];for(n=0;5>n;n+=1)this.Uk[n]=0,this.Yk[n]=0,this.Tk[n]=0;this.Sh=null;this.ng=!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.Y(g,h)},!1);registerEvent(h,"mouseup",function(h){g.ha(g,h)},!1);registerEvent(h,"mouseover",function(h){g.ga(g,h)},!1);registerEvent(h,"mouseout",function(h){g.da(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.Pf=function(){var a=!1;if(""!==this.h||""!==this.fe)a=!0;return a};r.prototype.clear=function(a,c){a?""!==this.fe&&(c?this.fe="":this.W=performance.now()-(this.H+this.K)):""!==this.h&&(c?this.h="":this.v=performance.now()-(this.Y+this.da))};r.prototype.D=function(a,c,b){this.enabled&&(b?this.fe!==a&&(this.fe=a,this.H=240,this.K=16*c,this.ga=240,this.W=performance.now(),this.f=0,this.hk=!1):(this.h=a,this.Y=240,this.da=16*c,this.ha=
240,this.v=performance.now()))};r.prototype.Ze=function(a,c){var b;b=this.b.measureText(a).width>>1;this.b.fillStyle=this.ya;this.b.fillText(a,-b+2,2);c?this.hk?(this.b.fillStyle=128>this.f?"rgb("+2*this.f+","+2*this.f+",255)":"rgb("+2*(256-this.f)+","+2*(256-this.f)+",255)",this.f=this.f+4&255):this.b.fillStyle=this.un:this.b.fillStyle=this.mk;this.b.fillText(a,-b,0)};r.prototype.ia=function(a,c,b,e,f,m,g){var n=30,h=n+2,u=this.g.wb,z=60,v=!0;""!==a&&(v=!1,f=performance.now()-f,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,z+m),f<=c?(m=f/c,m*=m,this.b.globalAlpha=m,this.b.scale(m,m)):f>c+b&&f<=c+b+e&&(m=(e-(f-(c+b)))/e,m*=m,this.b.globalAlpha=m,this.b.scale(m,m)),f>c+b+e?v=!0:(c=a.indexOf("\\n"),-1===c?this.Ze(a,g):(this.Ze(a.substr(0,c),g),this.b.translate(0,h),this.Ze(a.substr(c+2),g))),this.b.restore());return v};r.prototype.update=function(){this.ia(this.h,this.Y,this.da,this.ha,this.v,
36,!1)&&(this.h="");this.g.Z&&"Expand"!==this.fe&&"Launch"!==this.fe||!this.ia(this.fe,this.H,this.K,this.ga,this.W,0,!0)||(this.fe="")};d.prototype.Ze=function(a,c,b){this.f.drawImage(this.h,a.Wh*a.width,0,a.width,a.height,c,b,a.width,a.height)};d.prototype.length=function(){return this.b.length};d.prototype.icon=function(a){var c,b=this.b,e=this.length(),f=null;for(c=0;c<e&&!f;)b[c].name===a?f=b[c]:c+=1;return f};d.prototype.add=function(a,c,b){var e=this.b.length;this.b[e]=new A(a,c,b,e)};var c=
{cm:0,Rb:1,Sj:2,Zg:0,button:1,toggle:2,rd:3,list:4,label:5,xl:0,od:1,left:0,km:1,right:2,yj:0,jc:1,Bm:2,ud:3,Jn:4,sf:5,eo:6,Qc:7,Lp:8};p.prototype.Eo=function(a,e){this.x=this.sd;this.y=this.b;switch(this.position){case c.yj:this.x=(a-this.width>>1)+this.sd;break;case c.jc:this.x=a+this.sd;break;case c.Bm:this.y=(e-this.height>>1)+this.b;this.x=a+this.sd;break;case c.ud:this.x=a+this.sd;this.y=e+this.b;break;case c.Jn:this.x=(a-this.width>>1)+this.sd;this.y=e+this.b;break;case c.sf:this.y=e+this.b;
break;case c.eo:this.y=(e-this.height>>1)+this.b;break;case c.Lp:this.x=(a-this.width>>1)+this.sd,this.y=(e-this.height>>1)+this.b}};p.prototype.am=function(a,c){var b=this.Cj;this.oi[b]=[a,c];this.Cj=b+1};p.prototype.Yl=function(a){var c=[],b,e;e=a.length;for(b=0;b<e;b+=1)a[b].am(this,!0);e=c.length;for(b=0;b<e;b+=1)c[b].am(this,!1)};p.prototype.Pp=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,e){var b,
n,f=a.Cj;a.type===c.list&&a.upper===c.od?b=a.current[0]:b=a.current===a.upper;a.Dp&&(b=!b);if(b&&e)for(n=0;n<f;n+=1)b&=this.v(a.oi[n][0],a.oi[n][1]);return b};q.prototype.Wn=function(a){var c,b,e=a.Cj;c=!0;for(b=0;b<e;b+=1)c&=this.v(a.oi[b][0],a.oi[b][1]);a.enabled=c};q.prototype.Nd=function(){var a,e;for(e=0;e<this.ta;e+=1){a=this.ic[e];a.enabled=!0;switch(a.type){case c.toggle:a.ob&&(a.current=a.ob(a.current===a.upper,!1,this.caller)?a.upper:a.lower);break;case c.Zg:a.ob&&(a.current=a.ob(a.current,
!1,this.caller));break;case c.list:a.ob&&(a.current=a.ob(a.current,!1,this.caller))}this.Wn(a)}};q.prototype.bd=function(a,e,b,k,f,m,g,l,h){this.ic[this.ta]=new p(this.ta,a,this.caller,e,b,k,f,m,g,h,l,c.list,this.h,this.border,!0,"","",-1,[],this);this.ta+=1;return this.ic[this.ta-1]};q.prototype.We=function(a,e,b,k,f,m,g,l,h,u,z,v){this.ic[this.ta]=new p(this.ta,a,this.caller,e,b,k,f,m,g,l,h,c.Zg,this.h,this.border,!0,u,z,v,null,this);this.ta+=1;return this.ic[this.ta-1]};q.prototype.Aa=function(a,
e,b,k,f,m){this.ic[this.ta]=new p(this.ta,null,null,a,e,b,k,f,0,0,0,c.label,this.h,this.border,!0,m,"",-1,null,this);this.ta+=1;return this.ic[this.ta-1]};q.prototype.zi=function(a,e,b,k,f){this.ic[this.ta]=new p(this.ta,a,this.caller,e,b,k,40,40,0,0,0,c.button,this.h,this.border,!0,f,"",-1,null,this);this.ta+=1;return this.ic[this.ta-1]};q.prototype.xo=function(){this.ic[this.ta]=new p(this.ta,null,null,Menu.sf,0,-40,100,40,0,100,0,c.rd,this.h,this.border,!1,"","",0,null,this);this.ta+=1;return this.ic[this.ta-
1]};q.prototype.f=function(a,e,b){var n,f,m,g,l;a+=String();if(""!==a){this.b.save();this.b.translate(e.x+e.width/2,e.y+e.height/2);this.b.font=e.font;e.orientation===c.Sj&&this.b.rotate(.5*Math.PI);n=this.b.measureText(a).width;f=e.orientation===c.Sj?e.height:e.width;if(n>=f-6){if(m=a.length){do--m,g=a.substr(0,m)+"...",n=this.b.measureText(g).width;while(1<m&&n>=f-6)}a=g}switch(e.textAlign){case c.left:l=e.width/2-2;break;case c.km:l=n/2;break;case c.right:l=n/2-(e.width-n)/2+4}this.b.fillStyle=
this.yd;b&&this.b.fillRect(2-l,2,n,2);this.b.fillText(a,2-l+.5,2.5);this.b.fillStyle=e.locked||this.locked?this.we:this.Dd;this.b.fillText(a,-l+.5,.5);b&&this.b.fillRect(-l,0,n,2);this.b.restore()}};q.prototype.Y=function(a){this.b.globalAlpha=this.Zb;this.f(a.kb,a,!1)};q.prototype.K=function(a){this.b.globalAlpha=this.Zb;this.f(a.kb,a,!1);a.icon&&this.Da.Ze(a.icon,a.x,a.y)};q.prototype.ga=function(a){var e;e=(a.current-a.lower)/(a.upper-a.lower);this.b.globalAlpha=this.cd;this.b.fillStyle=this.Dd;
a.orientation===c.Rb?(e*=a.width-3,this.b.fillRect(a.x+(e+1|0),a.y,1,a.height)):(e*=a.height-3,this.b.fillRect(a.x,a.y+(e+1|0),a.width,1));e=a.kb;a.Ql&&(e=-1!==a.fixed?e+a.current.toFixed(a.fixed):e+a.current,e+=a.kl);""!==e&&(this.b.globalAlpha=this.Zb,this.f(e,a,!1))};q.prototype.ha=function(a,e){var b,n;b=(a.current[0]-a.lower)/(a.upper-a.lower);n=this.H;a.orientation===c.Rb?(b*=a.width-3,b=b+1|0,e&&(this.b.fillStyle=this.te,this.b.globalAlpha=this.se,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.we,this.b.globalAlpha=this.ff):(this.b.fillStyle=this.Dd,this.b.globalAlpha=this.Zb),this.b.fillRect(a.x+b,a.y,1,a.height)):(b*=a.height-3,b=b+1|0,e&&(this.b.fillStyle=this.te,this.b.globalAlpha=this.se,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.we,this.b.globalAlpha=this.ff):(this.b.fillStyle=this.Dd,this.b.globalAlpha=this.Zb),this.b.fillRect(a.x,a.y+
b,a.width,1));b=a.kb;a.Ql&&(b=0<=a.fixed?b+a.current[1].toFixed(a.fixed):b+a.current[1]);b+=a.kl;""!==b&&(this.b.globalAlpha=this.Zb,this.f(b,a,!1))};q.prototype.ia=function(a){var c,b;this.b.globalAlpha=this.Zb;c="-"===a.lower&&""===a.upper&&a.current===a.lower;b=a.kb;a.Ql&&!c&&(b+=a.current);b+=a.kl;this.f(b,a,c)};q.prototype.da=function(a,e){var b,n,f,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;f=a.lower;n=f.length;l=a.orientation===c.Rb?h/n:u/n;this.b.globalAlpha=
this.qf;this.b.fillStyle=this.fg;if(a.upper===c.xl)b=a.current,a.orientation===c.Rb?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.Rb)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.Zb;if(a.orientation===c.Rb)for(b=0;b<n;b+=1)a.icon[b]&&this.Da.Ze(a.icon[b],a.x+l*b,a.y);else for(b=0;b<n;b+=1)a.icon[b]&&this.Da.Ze(a.icon[b],a.x,a.y+l*b);e?(this.b.globalAlpha=
this.se,this.b.fillStyle=this.te,a.orientation===c.Rb?(b=(this.be-m)/h*n|0,0<=b&&b<n&&this.b.fillRect(m+b*l+.5,g+.5,l-1,u-1)):(b=(this.mf-g)/u*n|0,0<=b&&b<n&&this.b.fillRect(m+.5,g+.5+b*l,h-1,l-1)),a.cf=b):a.cf=-1;this.b.globalAlpha=this.Zb;this.b.fillStyle=this.Dd;if(z===c.Rb)for(b=0;b<n;b+=1)m=f[b],""!==m&&(this.b.save(),this.b.translate((.5+(b-n/2))*l,0),this.f(m,a,!1),this.b.restore());else for(b=0;b<n;b+=1)m=f[b],""!==m&&(this.b.save(),this.b.translate(0,(.5+(b-n/2))*l),this.f(m,a,!1),this.b.restore())};
q.prototype.W=function(a,e,b,k){var f,n,g;!(b===k||-1===k&&e)||a.type!==c.button&&a.type!==c.toggle?(this.b.fillStyle=a.yd,this.b.globalAlpha=a.cd):(this.b.fillStyle=a.te,this.b.globalAlpha=a.se);switch(a.type){case c.rd:f=(a.current-a.lower)/(a.upper-a.lower);this.b.fillStyle=a.fg;this.b.globalAlpha=a.qf;a.orientation===c.Rb?(f*=a.width-3,f=f+1|0,this.b.fillRect(a.x,a.y,f,a.height),this.b.fillStyle=a.yd,this.b.globalAlpha=a.cd,this.b.fillRect(a.x+f,a.y,a.width-f,a.height)):(f*=a.height-3,f=f+1|0,
this.b.fillRect(a.x,a.y,a.width,f),this.b.fillStyle=a.yd,this.b.fillRect(a.x,a.y+f,a.width,a.height-f));break;case c.Zg:f=(a.current[0]-a.lower)/(a.upper-a.lower);b===k||-1===k&&e?(n=this.H,a.orientation===c.Rb?(f*=a.width-3,f=f+1|0,g=f-n,0<g&&this.b.fillRect(a.x,a.y,g,a.height),g=1+f+n,g<a.width&&this.b.fillRect(a.x+g,a.y,a.width-g,a.height)):(f*=a.height-3,f=f+1|0,g=f-n,0<g&&this.b.fillRect(a.x,a.y,a.width,g),g=1+f+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.Zb,this.Da.Ze(a.icon,a.x,a.y),!(b===k||-1===k&&e)||a.type!==c.button&&a.type!==c.toggle||(this.b.globalAlpha=a.qf,this.b.fillRect(a.x,a.y,a.width,a.height)));if(0<a.border)switch(a.locked||this.locked?(this.b.strokeStyle=a.we,this.b.globalAlpha=a.ff):(this.b.strokeStyle=a.Dd,this.b.globalAlpha=a.Zb),this.b.lineWidth=a.border,a.type){case c.label:break;case c.list:n=a.lower.length;
if(a.orientation===c.Rb)for(g=a.width/n,f=0;f<n;f+=1)this.b.strokeRect(a.x+.5+f*g,a.y+.5,g-1,a.height-1);else for(g=a.height/n,f=0;f<n;f+=1)this.b.strokeRect(a.x+.5,a.y+.5+f*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.K(a);break;case c.label:this.Y(a);break;case c.Zg:this.ha(a,b===k||-1===k&&e);break;case c.toggle:this.ia(a);break;case c.rd:this.ga(a);break;case c.list:this.da(a,b===k||-1===k&&e)}if(b===k)switch(a.type){case c.Zg:f=
this.mf,a.orientation===c.Sj?(f<a.y?f=a.y:f>=a.y+a.height&&(f=a.y+a.height-1),a.current[0]=(f-a.y)/(a.height-1)*(a.upper-a.lower)+a.lower):(f=this.be,f<a.x?f=a.x:f>=a.x+a.width&&(f=a.x+a.width-1),a.current[0]=(f-a.x)/(a.width-1)*(a.upper-a.lower)+a.lower),a.ob&&(a.current=a.ob(a.current,!0,a.caller))}if(e&&!this.vb&&a.Vk)switch(a.type){case c.button:a.ob&&a.ob(a.caller);break;case c.toggle:a.current=a.current===a.upper?a.lower:a.upper;a.ob&&a.ob(a.current===a.upper,!0,a.caller);break;case c.list:n=
a.lower.length,g=a.orientation===c.Rb?(this.be-a.x)/a.width*n|0:(this.mf-a.y)/a.height*n|0,a.upper===c.xl?a.ob?a.current=a.ob(g,!0,a.caller):a.current=g:(a.current[g]=!a.current[g],a.ob&&a.ob(a.current,!0,a.caller))}e&&b===k?(a.Vk=this.vb,a.Xm=this.be,a.Ym=this.mf):(a.Vk=!1,a.Xm=-1,a.Ym=-1)};q.prototype.zk=function(){var a,c,b,e,f,m=this.b.canvas.width,g=this.b.canvas.height;f=!1;this.lf=-1;if(!this.j){b=this.vh;this.b.textAlign="left";for(e=0;e<this.ta;e+=1)a=this.ic[e],a.j||(a.Eo(m,g),(c=a.Pp(this.be,
this.mf)&&!(a.locked||this.locked))&&!this.vb&&(this.lf=e),this.vb&&-1===b&&c&&(b=e),e===b&&(a.locked||this.locked)&&(b=-1,c=!1),a.enabled&&this.W(a,c,e,b));0<=b&&!this.vb&&(f=!0);this.vb&&-1===b&&(b=-2);-2===b&&this.xk&&!this.locked&&this.xk(this.be,this.mf,this.vb,this.caller);this.vb||(b=-1);this.vh=b;this.b.globalAlpha=1}return f};e.prototype.Jo=function(){var a=this.Pd.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};e.prototype.Qo=function(a,c,b){a=new q(a,c,b,this.Tb,this.Lg);a.Dd=this.Dd;a.Zb=this.Zb;a.yd=this.yd;a.cd=this.cd;a.te=this.te;a.se=this.se;a.fg=this.fg;a.qf=
this.qf;a.we=this.we;a.ff=this.ff;a.border=this.border;return a};e.prototype.jp=function(){var a=this.Ab,e,b,k,f,m=this.Tb,g,l,h;if(-1!==a.vh||-1===a.vh&&-1===a.lf)this.b=a.vh;-1===a.lf||-1!==this.b&&this.b===a.lf?(-1!==a.lf&&(a=a.ic[a.lf],a.id===this.h&&a.cf!==this.f&&(this.b=-1)),50>this.Ud&&(this.Ud+=1)):(a=a.ic[a.lf],a.id!==this.h||a.id===this.h&&a.cf!==this.f?(this.h=a.id,this.f=a.cf,50>this.Ud&&(this.Ud+=1)):0<=this.Ud&&--this.Ud,g=-1!==this.f?a.M[this.f]:a.M,""!==g&&-1===this.Ud&&(this.b=-1,
k=a.x,f=a.y,e=a.width,b=a.height,-1!==a.cf&&(a.orientation===c.Rb?(k+=e/a.lower.length*a.cf,e/=a.lower.length):(f+=b/a.lower.length*a.cf,b/=a.lower.length)),m.font="18px Arial",h=m.measureText(g).width,l=Math.round(k+e/2),f=Math.round(f+b/2),l-=h/2,5>l?l=5:l+h+4>m.canvas.width&&(l=m.canvas.width-h-4-1),b>e?(-1!==this.H&&e<this.H&&(e=this.H),l>m.canvas.width/2?l=k-h-e/2:l=k+a.width+e/2):(-1!==this.K&&b<this.K&&(b=this.K),f>m.canvas.height/2?f-=b:f+=b),m.globalAlpha=.7,m.fillStyle="black",m.fillRect((l-
4|0)-.5,(f-9-4|0)-.5,h+2+8,26),m.globalAlpha=1,m.strokeStyle="rgb(32,255,255)",m.strokeRect((l-4|0)-.5,(f-9-4|0)-.5,h+2+8,26),m.globalAlpha=.7,m.strokeStyle="black",m.beginPath(),m.moveTo((l-4|0)+.5,(f-9-4|0)+26.5),m.lineTo((l-4|0)+.5+h+2+8,(f-9-4|0)+26.5),m.lineTo((l-4|0)+.5+h+2+8,(f-9-4|0)+.5),m.stroke(),m.globalAlpha=1,m.fillStyle="black",m.fillText(g,l+2,f+2),m.fillStyle="white",m.fillText(g,l,f)))};e.prototype.ia=function(a){var c,b,e,f,m=a.Tb,g,l,h=m.canvas.width-86,u=90;a.Z&&(u=0);a.ti=!1;
a.Sh&&(a.Ab=a.Sh,a.Sh=null,m.font=a.Lg,a.Ab.Nd(),a.Ab.yi&&a.Ab.yi(a.Ab.caller));if(a.xh||a.notification.Pf()||a.si||a.Jq!==a.Ud&&-1!==a.Ud)a.$h(a),a.si&&--a.si;b=performance.now();e=b-a.Wk;a.Wk=b;a.Ab.ob&&(e>a.gn?a.Ab.ob(a.gn,a.Ab.caller):a.Ab.ob(e,a.Ab.caller));b=performance.now()-b;c=performance.now();a.zk();a.jp();a.notification.update();c=performance.now()-c;a.Uk[a.mi]=c;for(f=c=0;f<a.Zf;f+=1)c+=a.Uk[f];c/=a.Zf;a.Yk[a.mi]=b;for(f=b=0;f<a.Zf;f+=1)b+=a.Yk[f];b/=a.Zf;a.Tk[a.mi]=e;for(f=e=0;f<a.Zf;f+=
1)e+=a.Tk[f];e/=a.Zf;a.mi=(a.mi+1)%a.Zf;e=Math.round(1E3/e);a.gg&&(m.font="12px Arial",m.globalAlpha=.7,m.fillStyle="black",a.ah?m.fillRect(h,u,88,83):m.fillRect(h,u,88,20),f=(b+c)/16.6666,1<f&&(f=1),m.fillStyle=.5>f?"rgb("+(510*f|0)+",255,0)":"rgb(255,"+(255*(1-2*(f-.5))|0)+",0)",m.fillRect(h,u,88*f|0,20),c=c.toFixed(1),b=b.toFixed(1),m.globalAlpha=1,m.fillStyle="black",g=e+"fps",l=m.measureText(g).width,m.fillText(g,h+36-l,u+12),g=(100*f|0)+"%",l=m.measureText(g).width,m.fillText(g,h+84-l,u+12),
a.ah&&(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.xh?"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=e+"fps",l=m.measureText(g).width,m.fillText(g,h+34-l,u+10),g=(100*f|0)+"%",l=m.measureText(g).width,
m.fillText(g,h+82-l,u+10),a.ah&&(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.xh?"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.Pd.drawImage(m.canvas,0,0)};e.prototype.uo=function(a){a.Da=this.Da;this.Ab?
this.Sh=a:(this.Sh=null,this.Ab=a,this.Tb.font=this.Lg,this.Ab.Nd(),this.Ab.yi&&this.Ab.yi(this.Ab.caller),this.$h(this))};e.prototype.zk=function(){var a,c,b;if(this.Ab&&(c=this.Ab,this.Tb.font=this.Lg,c.be=this.ze,c.mf=this.Ae,c.vb=this.vb,c.zk()||this.ng)){for(a=0;a<c.ta;a+=1)b=c.ic[a],c.Wn(b);this.ng=!1}};e.prototype.$h=function(a){a.ti||(requestAnimationFrame?requestAnimationFrame(a.jm):setTimeout(a.jm,16),a.ti=!0)};e.prototype.v=function(a,c){var b,e,f="";if("touchend"===c.type)f="mouseup",
e=document.createEvent("MouseEvent"),e.initMouseEvent(f,!0,!0,window,1,a.Oh,a.Ph,a.Lh,a.Mh,!1,!1,!1,!1,0,null),c.target.dispatchEvent(e),c.preventDefault();else{if(1===c.touches.length)switch(c.type){case "touchstart":f="mousedown";break;case "touchmove":f="mousemove"}""!==f&&(b=c.changedTouches[0],e=document.createEvent("MouseEvent"),e.initMouseEvent(f,!0,!0,window,1,b.screenX,b.screenY,b.clientX,b.clientY,!1,!1,!1,!1,0,null),b.target.dispatchEvent(e),c.preventDefault(),a.Oh=b.screenX,a.Ph=b.screenY,
a.Lh=b.clientX,a.Mh=b.clientY)}};e.prototype.W=function(a,c){a.ag||(a.hasFocus?a.Z&&a.Yi&&a.Yi(a.caller):(a.Pd.canvas.focus(),a.hasFocus=!0,a.notification.clear(!0,!1),a.Yi&&a.Yi(a.caller)),a.pg(a,c),a.vb=!0,c.stopPropagation&&c.stopPropagation(),c.preventDefault())};e.prototype.ha=function(a,c){a.ag||(a.pg(a,c),a.vb=!1,c.stopPropagation&&c.stopPropagation(),c.preventDefault())};e.prototype.lm=function(a){a.hasFocus||a.lk&&""!==a.notification.fe||(a.Z?a.kg?a.notification.D("Launch",3600,!0):a.notification.D("Expand",
3600,!0):a.notification.D("Click to control",3600,!0),a.notification.hk=!0,a.lk=!0)};e.prototype.Y=function(a,c){a.ag||(a.lm(a),a.pg(a,c),c.stopPropagation&&c.stopPropagation(),c.preventDefault())};e.prototype.ga=function(a,c){a.ag||(a.lm(a),c.stopPropagation&&c.stopPropagation(),c.preventDefault())};e.prototype.da=function(a,c){a.ag||(a.hasFocus||a.notification.clear(!0,!1),a.Pd.canvas.blur(),a.hasFocus=!1,a.vb=!1,a.ze=-1,a.Ae=-1,a.lk=!1,a.ti||(a.$h(a),a.si=2),c.stopPropagation&&c.stopPropagation(),
c.preventDefault())};e.prototype.pg=function(a,c){var b,e;c.pageX||c.pageY?(b=c.pageX,e=c.pageY):(b=c.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,e=c.clientY+document.body.scrollTop+document.documentElement.scrollTop);a.Jo();b-=a.offsetLeft;e-=a.offsetTop;a.ze=b-1|0;a.Ae=e-1|0;a.ti||(a.$h(a),a.si=2)};e.prototype.rf=function(a){!a&&!this.notification.Pf()||this.xh||this.$h(this);this.xh=a};window.IconManager=d;window.Menu=c;window.MenuManager=e})();(function(){function r(p,d,e,c,a,n){this.eh=p;this.fh=d;this.width=e;this.height=c;this.Cq=a;this.kp=n}function A(p){var d=p.lastIndexOf(".");-1!==d&&(p=p.substr(0,d));this.name=p;this.Zd=this.jd=this.re=-1;this.Rg=this.Gh=0;this.gj=this.Hk=!1;this.bm=this.ra="";this.L=this.Kh=this.Sb=!1;this.Oe=-1;this.ue=!1;this.u=-1;this.height=this.width=0;this.Be=this.Ib=null;this.Rd=this.title="";this.De=2;this.Vh=0;this.Sg=this.Me=!1;this.qn=""}var d={jk:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
ye:86,lp:"XRLE",tn:"Pos",Fm:"Gen",Ia:"",Do:":",hm:"ptkcs",Rj:"012345678ceaiknjqrytwz-",Ye:"0123456789",Bp:"0123456",Zq:"01234",pl:["ce","ceaikn","ceaiknjqry","ceaiknjqrytwz"],Gp:[0,2,6,10,13,10,6,2,0],Qp:[[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]],oq:[[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]],al:13,maxWidth:8192,maxHeight:8192,Jp:256,Wc:new Uint32Array(256),
Gj:new Uint8Array(512),Hq:new Uint16Array(512),Na:!1,Pg:!1,Pm:"history",Nm:"h",co:"v",Me:!1,Dk:0,af:!1,il:0,jl:0,pf:!1,index:0,Yo:function(p,d,e){var c,a,n,b,k=0,f=0,m=0,g,l,h=!1;a=d.length;for(c=b=0;c<a;)switch(n=d[c],c+=1,b){case 0:switch(n){case "!":b=1;l=!0;break;case "O":case "o":case "*":case ".":b=2,f=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 ".":f+=1;break;case "\n":m+=1;f>k&&(k=f);
f=0;break;case " ":case "\t":break;default:c=a,h=!0}}if(!h){2===b&&"\n"!==n&&(m+=1,f>k&&(k=f));p.height=m;p.width=k;p.Rd="Cells";p.Ib=Array.T(Uint16,p.height,(p.width-1>>4)+1,0,e,"Pattern.lifeMap");c=g;for(e=b=0;c<a;)switch(n=d[c],c+=1,n){case "\n":b+=1;e=0;break;case "O":case "o":case "*":p.Ib[b][e>>4]|=1<<(~e&15);e+=1;break;case ".":e+=1}this.Na=!0;this.Jg(p,"")}},Wo:function(p,d,e){var c,a,n,b,k,f,m,g,l,h;a=d.length;k=[];f=0;l=!1;g=m=0;h=!1;for(c=10;c<a;)switch(n=d[c],c+=1,n){case "\n":h&&(h=!1,
2===b&&l&&(g=-g,l=!1),k[f]=[m,g],f+=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[f]=[m,g],f+=1);if(f){a=d=k[0][0];b=n=k[0][1];for(c=1;c<f;c+=1)m=k[c][0],g=k[c][1],m<d&&(d=m),m>a&&(a=m),g<n&&(n=g),g>b&&(b=g);p.height=b-n+1;p.width=a-d+1;p.Ib=Array.T(Uint16,p.height,
(p.width-1>>4)+1,0,e,"Pattern.lifeMap");p.Rd="Life 1.06";this.Jg(p,"");for(c=0;c<f;c+=1)m=k[c][0]-d,g=k[c][1]-n,p.Ib[g][m>>4]|=1<<(~m&15)}},rm:function(p,d,e,c){var a,n,b,k,f,m,g,l,h,u=[],z=0,v=d.length;g=m="";l=!1;var C=0,L=0,q=!1,w=!1,G=0,y=0;for(e=e?10:0;e<v&&!w;)switch(a=d[e],e+=1,C){case 0:switch(a){case "#":C=2;break;case "*":case ".":C=3,k=b=n=0,f=--e}break;case 2:switch(a){case "C":case "D":C=1;h=!0;break;case "N":C=0;break;case "R":C=4;break;case "P":C=5;L=2;q=!1;y=G=0;break;case "\n":C=
0;break;default:C=1,h=!0}break;case 1:"\r"!==a&&(" "===a?h||(p.title+=a):(h=!1,p.title+=a));"\n"===a&&(C=0);break;case 4:switch(a){case "\n":C=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":C=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,f,e-1);z+=1;C=2;break;case "*":case ".":n+=1;break;default:w=!0}}"\n"!==a&&(k+=1);3===C&&(u[z]=new r(G,y,b,k,f,e-1),z+=1);if(z&&!w){G=u[0].eh;y=u[0].fh;a=G+u[0].width-1;n=y+u[0].height-1;for(e=1;e<z;e+=1)u[e].eh<G&&(G=u[e].eh),u[e].fh<y&&(y=u[e].fh),u[e].eh+u[e].width-1>a&&(a=u[e].eh+u[e].width-1),u[e].fh+u[e].height-1>n&&(n=u[e].fh+u[e].height-1);p.height=
n-y+1;p.width=a-G+1;p.Ib=Array.T(Uint16,p.height,(p.width-1>>4)+1,0,c,"Pattern.lifeMap");p.Rd="Life 1.05";l?(this.Jg(p,m+"/"+g),p.ra=m+"/"+g):this.Jg(p,"");for(e=0;e<z;e+=1)for(c=u[e].Cq,m=u[e].kp,l=u[e].eh-G,a=u[e].fh-y,g=l,n=a;c<=m;)switch(a=d[c],c+=1,a){case "\n":n+=1;g=l;break;case "*":p.Ib[n][g>>4]|=1<<(~g&15);g+=1;break;default:g+=1}}},tl:function(p,d,e,c){var a=0,n,b,k;e&&(a=16);for(b=0;512>b;b+=32)for(k=0;16>k;k+=1){e=0;for(n=b+k&c;0<n;)e+=n&1,n>>=1;d===e&&(p[b+k+a]=1)}},qp:function(p){return(p&
7)<<6|(p&448)>>6|p&56},Bn: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},zq:function(p,d,e){var c;for(c=0;4>c;c+=1)p[d]=e,d=this.Bn(d);d=this.qp(d);for(c=0;4>c;c+=1)p[d]=e,d=this.Bn(d)},yq:function(p,d,e,c,a,n){var b=0,k=d-1;0===d||8===d?this.tl(p,d,e,n):(3<k&&(k=6-k,b=495),d=this.pl[k].indexOf(c),-1!==d&&(b^=this.oq[k][d],e&&(b|=16),this.zq(p,b,a)))},Hn:function(p,d,e,c){var a,n=d.length,b=0,k="",f;for(f=0;f<n;f+=1)a=d.charCodeAt(f)-48,b|=1<<
a,this.tl(p,a,e,c);for(f=0;9>f;f+=1)b&1<<f&&(k+=String(f));return k},Bo:function(p){for(var d=0;p;)d+=1,p&=p-1;return d},vo:function(p,d){var e="",c,a=0,n,b;if(d[p]){if(c=d[p],c&1<<this.al&&(a=1,c&=~(1<<this.al)),n=this.Bo(c),b=this.Gp[p],(a||7!==n||13!==b)&&n+a>b>>1&&(c=~c&(1<<b)-1)&&(a=!a),!a||c)for(e+=String(p),a&&(e+="-"),n=0;n<b;n+=1)a=this.Qp[p][n],c&1<<a&&(e+=this.pl[3][a])}else e+=String(p);return e},Gn:function(p,d,e){var c,a,n=d.length,b,k=this.pl[3],f,m=0,g=[],l="",h;d+=" ";for(h=0;9>h;h+=
1)g[h]=0;for(h=0;h<n;h+=1)if(c=d.charCodeAt(h)-48,m|=1<<c,0<=c&&8>=c)for(a=d[h+1],f=k.indexOf(a),-1===f&&this.tl(p,c,e,511),b=1,"-"===a&&(b=0,h+=1,a=d[h+1],f=k.indexOf(a));-1!==f;)this.yq(p,c,e,a,b,511),g[c]|=1<<f,b||(g[c]|=1<<this.al),h+=1,a=d[h+1],f=k.indexOf(a);for(h=0;9>h;h+=1)m&1<<h&&(l+=this.vo(h,g));return l},Vo:function(p,d){var e;for(e=0;512>e;e+=1)p[e]=d&1<<(e&7)?1:e&16?1:0},To:function(p,q,e,c,a,n){var b,k=0,f=0,m;m=this.Gj;var g=this.Hq;for(b=0;512>b;b+=1)m[b]=0,g[b]=(b&448)>>6|b&56|(b&
7)<<6;if(""!==e){q="MAP"+e;for(b=0;b<d.ye-1;b+=1)n=d.jk.indexOf(e[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=d.jk.indexOf(e[b]);m[g[k]]=n>>5;m[g[k+1]]=n>>4&1}else c||a?(c&&(f=254),a&&(f=186),e=this.Hn(m,p,!1,f),m=this.Hn(m,q,!0,f)):(e=this.Gn(m,p,!1),m=this.Gn(m,q,!0)),q=-1!==n?m+"/"+e+"/"+n:"B"+e+"/S"+m;return q},jr:function(p,d){var e,c,a="";for(e=0;e<=d;e+=1)c=this.Rj[e],-1!==p.indexOf(c)&&(a+=this.Rj[d-e]);return a},
gr:function(p){var d,e,c="";for(d=0;9>d;d+=1)e=this.Rj[d],-1===p.indexOf(e)&&(c+=e);return c},vn:function(p){var d=p,e=0;if(-1!==p.indexOf(" "))for(d="";e<p.length;)" "!==p[e]&&(d+=p[e]),e+=1;return d},gp:function(p,d){for(var e=!0,c=0,a,n=1;n<d.length&&e;)a=this.Ye.indexOf(d[n]),-1!==a?c=10*c+a:(this.Ia="Illegal character in Wolfram rule",e=!1),n+=1;e&&(2>c||254<c?(this.Ia="Wolfram rule number must be 2-254",e=!1):c&1?(this.Ia="Wolfram rule number must be even",e=!1):(this.Vo(this.Gj,c),p.Oe=c,p.ra=
"W"+c));return e},wo:function(p){var q;p.L?p.ra+="H":p.ue&&(p.ra+="V");q=AliasManager.tp(p.ra);p.Sb&&(p.ra+="History");-1!==p.re&&(p.ra+=":"+d.hm[p.re].toUpperCase(),p.ra+=p.jd,p.Gh&&(p.ra+="+"+p.Gh),p.Hk&&(p.ra+="*"),p.Zd!==p.jd||p.Rg||p.gj)&&(p.ra+=","+p.Zd,p.Rg&&(p.ra+="+"+p.Rg),p.gj&&(p.ra+="*"));null!==q&&(""===q&&(q=p.Sb?"Life":"Conway's Life"),p.Sb&&(q+="History"),p.bm=q)},ap:function(p){var q=!1,e;if(p.length>=d.ye)for(q=!0,e=0;e<d.ye;e+=1)-1===d.jk.indexOf(p[e])&&(q=!1);return q},Jg:function(p,
q){var e,c,a,n=!1,b=null,k=null,f=null,m=this.Rj;c=d.Nm.length;e=d.co.length;var g="";a=AliasManager.up(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.ap(g))if(f=g.substr(d.ye),g=g.substr(0,d.ye),"/"===f[0]){c=1;for(e=p.u=0;c<f.length&&-1!==e;)e=this.Ye.indexOf(f[c]),-1!==e?p.u=10*p.u+e:(this.Ia="Illegal character in generations number",p.u=-1,n=!1),c+=1;-1!==p.u&&(2>p.u||256<p.u)&&(this.Ia="Generations number must be 2-256",p.u=-1,
n=!1)}else""!==f&&(c=f.length,this.Ia="MAP string length must be "+d.ye+" not "+(c+d.ye),n=!1);else this.Ia=g.length<d.ye?"MAP string length must be "+d.ye+" not "+g.length:"MAP contains illegal base64 character";else if(q=q.toLowerCase(),q=this.vn(q),"w"===q[0])n=this.gp(p,q);else{a=q.lastIndexOf(d.Nm);-1!==a&&a===q.length-c&&(p.L=!0,q=q.substr(0,q.length-c),m=this.Bp);c=q.lastIndexOf(d.co);-1!==c&&c===q.length-e&&(p.ue=!0,q=q.substr(0,q.length-e),m=this.Zq);e=q.indexOf("/");-1===e&&(e=q.indexOf("_"));
-1!==e&&(c=q.lastIndexOf("/"),-1===c&&(c=q.lastIndexOf("_")),c!==e&&(f=q.substring(c+1),q=q.substr(0,c)));c=q.indexOf("b");a=q.indexOf("s");-1===e?-1===c||-1===a||0!==c&&0!==a?this.Ia="Unsupported rule name":c<a?(b=q.substring(c+1,a),k=q.substring(a+1)):(b=q.substring(a+1,c),k=q.substring(c+1)):c<a?(b=q.substring(0,e),k=q.substring(e+1)):(b=q.substring(e+1),k=q.substring(0,e));-1!==c&&b&&"b"===b[0]&&(b=b.substring(1));-1!==a&&k&&"s"===k[0]&&(k=k.substring(1));if(null!==f){c=0;for(e=p.u=0;c<f.length&&
-1!==e;)e=this.Ye.indexOf(f[c]),-1!==e?p.u=10*p.u+e:(this.Ia="Illegal character in generations number",p.u=-1,b=null),c+=1;-1!==p.u&&(2>p.u||256<p.u)&&(this.Ia="Generations number must be 2-256",p.u=-1,b=null)}if(null!==b&&null!==k){n=!0;for(c=0;c<b.length;)e=m.indexOf(b[c]),-1===e?(this.Ia="Illegal character in birth specification",n=!1,c=b.length):c+=1;if(n)for(c=0;c<k.length;)e=m.indexOf(k[c]),-1===e?(this.Ia="Illegal character in survival specification",n=!1,c=k.length):c+=1}}n&&-1===p.Oe&&(p.ra=
this.To(b,k,g,p.L,p.ue,p.u),this.wo(p));return n},tm:function(p,q,e,c){var a=0,n=q.length-1,b=!1,k=!0,f,m,g=0,l=0,h=0,u,z=0,v=this.Wc;for(m=q[a];!b;){f=m;m=q[a+1];u=-1;switch(f){case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":case "8":case "9":z=10*z+parseInt(f,10);break;case "b":u=0;break;case "o":u=1;break;case ".":u=0;break;case "z":u=7;p.Sb=!0;p.Kh=!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"<=
f&&"X">=f?(k=!0,u=f.charCodeAt(0)-64):"p"<=f&&"y">f?"A"<=m&&"X">=m?(k=!0,u=24*(f.charCodeAt(0)-111)+(m.charCodeAt(0)-64),a+=1,m=q[a+1]):"x"===f&&(k=!0,p.Sb=!0,p.Kh=!0,u=3):"y"===f&&("A"<=m&&"O">=m?(k=!0,u=24*(f.charCodeAt(0)-111)+(m.charCodeAt(0)-64),a+=1,m=q[a+1]):(k=!0,p.Sb=!0,p.Kh=!0,u=5))}if(0<=u)if(z||(z=1),e||(0===v[u]&&(p.Vh+=1),v[u]+=z,u>=p.De&&(p.De=u+1)),0<u&&e)for(;0<z;){p.Be[h][l]=-1===p.u?u:0<=p.u-u?p.u-u:1;if(!p.Sb&&-1===p.u||p.Sb&&u&1||-1!==p.u&&1===u)p.Ib[h][l>>4]|=1<<(~l&15);l+=1;
--z}else l+=z,z=0;k||(" "===f||"\t"===f||"\n"===f?k=!0:b=p.Sg=!0);a+=1;a===n&&(b||(z||(z=1),h+=z,z=0,l>g&&(g=l)),b=!0)}e||(p.width=g,p.height=h,0<g&&0<h&&(g>d.maxWidth||h>d.maxHeight?(p.Me=!0,p.Sg=!0):(p.Ib=Array.T(Uint16,h,(g-1>>4)+1,0,c,"Pattern.lifeMap"),p.Be=Array.T(Uint8,h,g,0,c,"Pattern.multiStateMap"),p.Rd="RLE")));p.Sg&&(a=-1);return a},xq:function(p,d){var e=d.indexOf("\n");-1===e&&(e=d.length);p.qn=d.substring(0,e).trim()},Lj:function(p,d,e){for(var c=!1;d<e&&!c;)" "===p[d]?d+=1:c=!0;return d},
bq:function(p){var q=p.indexOf("\n"),e=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.Lj(p,n+1,q);for(a=!1;n<q&&!a;)c=d.Ye.indexOf(p[n]),-1!==c?(e=10*e+c,n+=1):a=!0;this.af=!0;this.Dk=e}},cq:function(p){var q=p.indexOf("\n"),e=0,c=0,a=!1,n=!1,b,k=!1,f=0;-1===q&&(q=p.length);for(;f<q&&!k;)"="===p[f]?k=!0:" "!==p[f]?k=!0:f+=1;if(k&&"="===p[f]&&(f=this.Lj(p,f+1,q),f<q)){"-"===p[f]&&(a=!0,f+=1);for(k=!1;f<q&&!k;)b=d.Ye.indexOf(p[f]),-1!==
b?(e=10*e+b,f+=1):k=!0;this.pf=!0;this.il=a?-e:e;f=this.Lj(p,f,q);if(f<q&&","===p[f]&&(f=this.Lj(p,f+1,q),f<q)){"-"===p[f]&&(n=!0,f+=1);for(k=!1;f<q&&!k;)b=d.Ye.indexOf(p[f]),-1!==b?(c=10*c+b,f+=1):k=!0;this.jl=n?-c:c}}},Go:function(p){var q=p.indexOf(d.lp);0===q&&(q=p.indexOf(d.tn),-1!==q&&this.cq(p.substr(q+d.tn.length)),q=p.indexOf(d.Fm),-1!==q&&this.bq(p.substr(q+d.Fm.length)))},wq:function(d,q){var e=q.indexOf("\n");-1===e&&(e=q.length);d.name=q.substring(0,e).trim()},$l:function(d,q){var e=
q.indexOf("\n");-1===e&&(e=q.length);d.title+=q.substring(0,e)+" ";return e+1},Tc:function(d){var p,e=-1;d+=" ";p=this.Ye.indexOf(d[this.index]);if(-1!==p)for(e=0;-1!==p;)e=10*e+p,this.index+=1,p=this.Ye.indexOf(d[this.index]);return e},ep:function(d,q){var e=this.Tc(q);d.jd=e;d.Zd=e},fp:function(d,q){var e=this.Tc(q),c=-1,a=0,n=0,b;if(-1!==e){b=q[this.index];if("-"===b||"+"===b)this.index+=1,a=this.Tc(q),-1===a?e=-1:"-"===b&&(a=-a);if(","===q[this.index])if(this.index+=1,c=this.Tc(q),-1===c)e=-1;
else{if(b=q[this.index],"-"===b||"+"===b)this.index+=1,n=this.Tc(q),-1===n?e=-1:"-"===b&&(n=-n)}else c=e}0!==a&&0!==n&&(e=-1);0===e&&0===c&&(e=-1);0===a&&0===n||0!==e&&0!==c||(e=-1);d.jd=e;d.Zd=c;d.Gh=a;d.Rg=n},$o:function(d,q){var e=this.Tc(q),c=-1,a=0,n=0,b=!1,k=!1,f;if(-1!==e){f=q[this.index];"*"===f&&(b=!0,this.index+=1,f=q[this.index]);if("-"===f||"+"===f)a=this.Tc(q),-1===a?e=-1:"-"===f&&(a=-a),this.index+=1,f=q[this.index];if(","===f)if(this.index+=1,c=this.Tc(q),-1===c)e=-1;else{if(f=q[this.index],
"*"===f&&(k=!0,this.index+=1,f=q[this.index]),"-"===f||"+"===f)this.index+=1,n=this.Tc(q),-1===n?e=-1:"-"===f&&(n=-n)}else c=e}b&&k&&(e=-1);0!==a&&0!==n&&(e=-1);if(b&&0!==n||k&&0!==a)e=-1;if(0===e||0===c)e=-1;b||k||(b=!0);d.jd=e;d.Zd=c;d.Gh=a;d.Rg=n;d.Hk=b;d.gj=k},Zo:function(d,q){var e=this.Tc(q),c=-1;-1!==e&&(","===q[this.index]?(this.index+=1,c=this.Tc(q),-1===c&&(e=-1)):c=e);d.jd=e;d.Zd=c},bp:function(d,q){var e=this.Tc(q),c=-1;-1!==e&&(","===q[this.index]?(this.index+=1,c=this.Tc(q),-1===c&&
(e=-1)):c=e);0===e&&0===c&&(e=-1);d.jd=e;d.Zd=c},Xo:function(d,q){var e=!1;q=this.vn(q).toLowerCase();if(""!==q){d.re=this.hm.indexOf(q[0]);if(-1!==d.re)switch(this.index=1,d.re){case 0:this.bp(d,q);break;case 1:this.fp(d,q);break;case 2:this.$o(d,q);break;case 3:this.Zo(d,q);break;case 4:this.ep(d,q);break;default:d.jd=-1}-1!==d.jd?e=!0:(d.re=-1,this.reason="Invalid bounded grid definition '"+q+"'")}return e},cp:function(p,q){var e=q.indexOf("\n"),c=q.indexOf("rule"),a,n=d.Pm.length,b="";-1===e&&
(e=q.length);-1!==c&&(b=q.substring(c+4,e).trim(),"="===b[0]&&(b=b.substring(1).trim()));p.ra=b;c=b.lastIndexOf(d.Do);-1!==c&&(this.Xo(p,b.substring(c+1))?b=b.substr(0,c).trim():c=-2);a=b.toLowerCase().lastIndexOf(d.Pm);-1!==a&&a===b.length-n&&(p.Sb=!0,b=b.substr(0,b.length-n).trim());this.Jg(p,b)&&-2!==c?this.Na=!0:this.Pg=!0;return e+1},Co:function(d){switch(d){case 0:d="Plane";break;case 1:d="Torus";break;case 2:d="Klein bottle";break;case 3:d="Cross-surface";break;case 4:d="Sphere";break;default:d=
"(unknown)"}return d},sm:function(p,q,e){var c=0,a=q.length,n,b=!1,k=!1;n=this.Wc;var f=d.Jp,m;p.re=-1;p.width=0;p.height=0;p.Me=!1;p.Ib=null;p.Be=null;p.Sg=!1;p.Sb=!1;p.Kh=!1;p.L=!1;p.Oe=-1;p.ue=!1;p.u=-1;p.title="";p.De=2;for(m=p.Vh=0;m<f;m+=1)n[m]=0;for(q+=" ";c<a&&!p.Sg;)switch(n=q[c],n){case "#":c+=1;n=q[c];c+=1;switch(n){case "N":this.wq(p,q.substring(c));break;case "O":this.xq(p,q.substring(c));break;case "C":this.Go(q.substring(c))}c+=this.$l(p,q.substring(c));break;case "x":c+=this.cp(p,
q.substring(c));k=!0;break;case "\n":c+=1;break;default:b?c+=this.$l(p,q.substring(c)):(b=!0,-1!==this.tm(p,q.substring(c),!1,e)&&(c+=this.tm(p,q.substring(c),!0,e)))}k||(this.Jg(p,"")?this.Na=!0:this.Pg=!0);-1!==p.re&&(p.width>p.jd&&0!==p.jd||p.height>p.Zd&&0!==p.Zd)&&(this.Ia="Pattern larger than bounded grid",this.Na=!1);-1!==p.u&&p.Sb&&(this.Ia="[R]History not valid with Generations",this.Na=p.Sb=!1);this.Na&&(p.Kh?8<p.De&&(this.Ia="Illegal state in pattern for Niemiec",this.Na=!1):p.Sb?7<p.De&&
(this.Ia="Illegal state in pattern for [R]History",this.Na=!1):-1!==p.u&&p.De>p.u&&(this.Ia="Illegal state in pattern for Generations",this.Na=!1))},create:function(d,q,e){d=new A(d);this.Na=this.Pg=this.Me=!1;this.Ia="";this.af=!1;this.Dk=0;this.pf=!1;this.jl=this.il=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.Yo(d,q,e),this.Na=!0;null===d.Ib&&(this.Na=!1,"#Life 1.05"===q.substr(0,10)?(this.rm(d,q,!0,e),this.Na=!0):"#Life 1.06"===
q.substr(0,10)?(this.Wo(d,q,e),this.Na=!0):"#"===q[0]||"x"===q[0]?(this.sm(d,q,e),null!==d.Ib||d.Me||d.Sg||(this.rm(d,q,!1,e),this.Na=!0,this.Pg=!1,d.Be=null,d.Sb=!1,d.De=2,d.Vh=0)):this.sm(d,q,e));d.Me&&(this.Ia="Pattern too big (maximum "+this.maxWidth+"x"+this.maxHeight+")",this.Me=!0,this.Na=!1);null===d.Ib&&(d.Me||(this.Ia="Invalid pattern"),d=null,this.Na=!1);return d}};window.PatternManager=d;window.Pattern=A})();(function(){function r(){this.pk=[]}r.prototype.add=function(d,p,q){this.pk[this.pk.length]=d<<16|p<<8|q};var A={oe:[],Xh:[],Sm:!1,sk:[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],rk:[],hc:{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]},fr:function(){return this.rk},nm:function(d){for(var p=0,q=!1,e=[];p<this.Xh.length&&!q;)d===this.Xh[p][0]?q=!0:p+=1;q&&(e=this.oe[this.Xh[p][1]].pk);return e},la:function(d){this.Xh[this.Xh.length]=d},Nd:function(){var d,p=0,q;if(!this.Sm){this.Sm=!0;for(d=q=0;256>d;d+=1)this.rk[d]=this.sk[q]<<16|this.sk[q+1]<<8|this.sk[q+2],q+=3;d=new r;d.add(0,0,0);d.add(0,255,0);d.add(0,0,128);
d.add(216,255,216);d.add(255,0,0);d.add(255,255,0);d.add(96,96,96);d.add(255,128,128);this.oe[p]=d;A.la(["LifeHistory",p]);p+=1;d=new r;d.add(48,48,48);d.add(0,128,255);d.add(255,255,255);d.add(255,128,0);this.oe[p]=d;A.la(["WireWorld",p]);p+=1;d=new r;d.add(0,0,0);d.add(255,255,255);d.add(144,128,112);d.add(144,90,45);d.add(192,192,192);d.add(255,0,0);d.add(255,128,0);d.add(255,255,0);d.add(0,255,0);d.add(0,255,208);d.add(0,192,255);d.add(0,0,255);d.add(192,0,255);d.add(255,64,160);d.add(112,128,
144);d.add(0,128,0);d.add(0,96,128);d.add(160,0,80);d.add(40,40,40);d.add(220,220,220);d.add(140,60,0);d.add(0,160,0);d.add(160,160,250);this.oe[p]=d;A.la(["WWE",p]);A.la(["WWE2",p]);A.la(["WWEJ",p]);A.la(["WWEJ2",p]);A.la(["WWEJ3",p]);p+=1;d=new r;d.add(30,30,30);d.add(0,128,128);d.add(0,255,0);d.add(255,0,0);d.add(255,128,0);d.add(255,255,0);d.add(128,0,128);d.add(128,128,128);d.add(255,255,255);d.add(128,128,255);this.oe[p]=d;A.la(["Novoloop",p]);p+=1;d=new r;d.add(0,0,0);d.add(255,128,0);d.add(255,
0,0);d.add(0,255,0);d.add(0,0,255);d.add(0,190,0);d.add(0,140,0);d.add(255,255,255);d.add(80,80,80);d.add(95,95,95);d.add(128,128,128);d.add(0,64,0);d.add(255,255,0);d.add(64,0,164);d.add(64,32,64);d.add(80,80,100);d.add(95,95,125);d.add(128,255,128);d.add(64,100,100);this.oe[p]=d;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;d=new r;d.add(0,0,0);d.add(255,255,255);d.add(255,0,0);d.add(0,128,255);d.add(170,0,0);d.add(85,0,0);this.oe[p]=d;A.la(["b3s23mmg",p]);p+=1;d=new r;d.add(0,0,0);d.add(255,0,0);d.add(0,255,0);d.add(0,0,255);d.add(255,255,0);d.add(0,255,255);d.add(255,0,255);d.add(92,36,110);d.add(0,99,140);d.add(176,196,222);d.add(115,61,26);this.oe[p]=d;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;d=new r;d.add(48,48,48);d.add(255,128,0);d.add(0,0,255);d.add(32,32,255);d.add(64,64,255);d.add(96,96,255);this.oe[p]=d;A.la(["Alpha-1",p])}}};window.ColourManager=A})();window.BoundingBox=function(r,A,d,p){this.O=r;this.N=A;this.P=d;this.R=p};(function(){function r(d,p){this.index=p;this.U=d.mg[p];this.va=d.If[p];this.h=d.ej[p];this.f=d.Ei[p];this.C=new BoundingBox(0,0,0,0);this.elapsedTime=this.mc=this.lc=this.cc=0;this.i=-1;this.Kc=this.X=0;this.b=d}function A(d,p){this.l=d;this.Lb=[];this.ed=[];this.mg=[];this.If=[];this.ej=[];this.Ei=[];this.b=0;this.index=-1;this.Ip=51;this.ge=null;this.em=p}r.prototype.nq=function(d,p,q){var e=p.length,c=p[0].length,a,n,b,k,f=0,m,g,l=q.ki;q=q.li;var h,u=0,z=this.h,v=0,C=z[v],L=C.length,P;Array.Bd(this.U,
p);for(a=0;a<e;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=C[f],f+=1,d[k][b]=P&255,d[k][b+1]=P>>8&255,d[k+1][b]=P>>16&255,d[k+1][b+1]=P>>24,k+=2,P=C[f],f+=1,d[k][b]=P&255,d[k][b+1]=P>>8&255,d[k+1][b]=P>>16&255,d[k+1][b+1]=P>>24,k+=2,P=C[f],f+=1,d[k][b]=P&255,d[k][b+1]=P>>8&255,d[k+1][b]=P>>16&255,d[k+1][b+1]=P>>24,k+=2,P=C[f],f+=1,d[k][b]=P&255,d[k][b+1]=P>>8&255,d[k+1][b]=P>>16&255,d[k+1][b+1]=P>>24,k+=2,P=C[f],f+=1,d[k][b]=P&255,d[k][b+1]=P>>8&255,d[k+1][b]=
P>>16&255,d[k+1][b+1]=P>>24,k+=2,P=C[f],f+=1,d[k][b]=P&255,d[k][b+1]=P>>8&255,d[k+1][b]=P>>16&255,d[k+1][b+1]=P>>24,k+=2,P=C[f],f+=1,d[k][b]=P&255,d[k][b+1]=P>>8&255,d[k+1][b]=P>>16&255,d[k+1][b+1]=P>>24,k+=2,P=C[f],f+=1,d[k][b]=P&255,d[k][b+1]=P>>8&255,d[k+1][b]=P>>16&255,d[k+1][b+1]=P>>24,f>=L&&(v+=1,C=z[v],f=0)),h+=l;else h+=l<<4;u+=q}};r.prototype.sq=function(d,p,q){var e=p.length,c=p[0].length,a,n,b,k,f=0,m,g;n=0;var l=q.ki,h=q.li,u,z=0,v=this.h,C=0,L=v[C],P=L.length,w=v.length;b=this.b.em;Array.Bd(p,
this.U);for(a=0;a<e;a+=1)for(m=p[a],q=0;q<c;q+=1)(g=m[q])&&(n+=b[g]);if(n)for(a=0;a<e;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[f]=d[k][b]|d[k][b+1]<<8|d[k+1][b]<<16|d[k+1][b+1]<<24,f+=1,k+=2,L[f]=d[k][b]|d[k][b+1]<<8|d[k+1][b]<<16|d[k+1][b+1]<<24,f+=1,k+=2,L[f]=d[k][b]|d[k][b+1]<<8|d[k+1][b]<<16|d[k+1][b+1]<<24,f+=1,k+=2,L[f]=d[k][b]|d[k][b+1]<<8|d[k+1][b]<<16|d[k+1][b+1]<<24,f+=1,k+=2,L[f]=d[k][b]|d[k][b+1]<<8|d[k+1][b]<<16|d[k+1][b+1]<<24,f+=1,k+=2,L[f]=d[k][b]|
d[k][b+1]<<8|d[k+1][b]<<16|d[k+1][b+1]<<24,f+=1,k+=2,L[f]=d[k][b]|d[k][b+1]<<8|d[k+1][b]<<16|d[k+1][b+1]<<24,f+=1,k+=2,L[f]=d[k][b]|d[k][b+1]<<8|d[k+1][b]<<16|d[k+1][b+1]<<24,f+=1,f>=P&&(C+=1,f=0,C>=w&&(Array.Zl(v,"Snapshot.gridBufferRow"),w+=1)),L=v[C]),u+=l;else u+=l<<4;z+=h}};r.prototype.mq=function(d,p,q){var e=p.length,c=p[0].length,a,n,b,k,f=0,m,g,l=q.ki<<3,h=q.li,u,z=0,v=this.f,C=0,L=v[C],P=L.length,w;Array.Bd(this.va,p);for(a=0;a<e;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[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,
d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+
1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,k+=1,w=L[f],f+=1,d[k][b]=w&255,d[k][b+1]=w>>8&255,d[k][b+2]=w>>16&255,d[k][b+3]=w>>24,f>=P&&(C+=1,L=v[C],f=0);u+=l}else u+=l<<4;z+=h}};r.prototype.qq=function(d,p,q){var e=p.length,c=p[0].length,
a,n,b,k,f=0,m,g;n=0;var l=q.ki<<3,h=q.li,u,z=0,v=this.f,C=0,L=v[C],P=L.length,w=v.length;b=this.b.em;Array.Bd(p,this.va);for(a=0;a<e;a+=1)for(m=p[a],q=0;q<c;q+=1)(g=m[q])&&(n+=b[g]);if(n)for(a=0;a<e;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[f]=d[k][b]|d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|d[k][b+
1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|
d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,k+=1,L[f]=d[k][b]|d[k][b+1]<<8|d[k][b+2]<<16|d[k][b+3]<<24,f+=1,f>=P&&(C+=1,f=0,C>=w&&(Array.Zl(v,"Snapshot.colourGridBufferRow"),w+=1),L=v[C]);u+=l}else u+=l<<4;z+=h}};A.prototype.bufferSize=function(){for(var d=0,p=0;p<this.ed.length;)d+=this.mg[p].length*this.mg[p][0].length*
2,d+=this.If[p].length*this.If[p][0].length*2,d+=this.ej[p].length*this.ej[p][0].length*4,d+=this.Ei[p].length*this.Ei[p][0].length*4,p+=1;return d};A.prototype.Uq=function(){for(var d=0,p=0;p<this.ed.length;)this.ed[p]&&(d+=1),p+=1;return d};A.prototype.reset=function(){var d=0,p=-1;this.Lb=[];this.index=-1;this.ge&&(p=this.ge.index);for(;d<this.ed.length;)d!==p&&(this.ed[d]=!1),d+=1};A.prototype.Bq=function(d){var p=null;0<this.Lb.length&&(p=this.Lb[this.index],p.i>d&&(p=null,0<this.index&&(this.f(this.Lb[this.index].index),
this.Lb.pop(),--this.index,0<=this.index&&(p=this.Lb[this.index]))));return p};A.prototype.Zh=function(d,p,q,e,c,a,n,b,k,f,m,g,l,h,u,z){if(h)m=this.ge;else if(51>this.Lb.length)m=this.qk(m,g,!1),this.index+=1;else{this.index+=1;if(51<=this.index){this.index=50;this.f(this.Lb[0].index);for(h=0;50>h;h+=1)this.Lb[h]=this.Lb[h+1];this.Lb.pop();this.qk(m,g,!1)}m=this.Lb[this.index]}m.X=u;m.Kc=z;m.sq(d,p,l);m.qq(q,e,l);m.C.O=c.O;m.C.P=c.P;m.C.N=c.N;m.C.R=c.R;m.cc=a;m.lc=n;m.mc=b;m.elapsedTime=k;m.i=f};
A.prototype.f=function(d){this.ed[d]=!1};A.prototype.v=function(d,p){var q,e=0;for(q=!1;e<this.b&&!q;)this.ed[e]?e+=1:q=!0;q?(q=e,this.ed[e]=!0):(this.mg[e]=Array.T(Uint16,p,d,0,this.l,"Snapshot.tileGrid"+e),this.If[e]=Array.T(Uint16,p,d,0,this.l,"Snapshot.colourTileGrid"+e),this.ej[e]=Array.T(Uint32,1,1024,0,this.l,"Snapshot.gridBuffer"+e),this.Ei[e]=Array.T(Uint32,1,8192,0,this.l,"Snapshot.colourGridBuffer"+e),this.ed[e]=!0,this.b+=1,q=e);return q};A.prototype.qk=function(d,p,q){d=this.v(d,p);d=
new r(this,d);q?this.ge=d:this.Lb[this.Lb.length]=d;return d};A.prototype.h=function(d,p,q,e){var c=d.U,a=d.va,n=d.U.length,b=n>>1,k=d.U[0].length>>1,f=0,m=d.index;this.mg[m]=Array.T(Uint16,q,p,0,this.l,"Snapshot.tileGrid"+m);this.If[m]=Array.T(Uint16,q,p,0,this.l,"Snapshot.colourTileGrid"+m);d.U=this.mg[m];for(d.va=this.If[m];f<n;)d.U[f+b].set(c[f],k),d.va[f+b].set(a[f],k),f+=1;d.C.O+=e;d.C.P+=e;d.C.N+=e;d.C.R+=e};A.prototype.lq=function(d,p,q){var e=0,c=this.Lb.length;for(this.h(this.ge,d,p,q);e<
c;)this.h(this.Lb[e],d,p,q),e+=1;for(e=0;e<this.ed.length;)this.ed[e]||(this.mg[e]=Array.T(Uint16,p,d,0,this.l,"Snapshot.tileGrid"+e),this.If[e]=Array.T(Uint16,p,d,0,this.l,"Snapshot.colourTileGrid"+e)),e+=1};window.SnapshotManager=A;window.Snapshot=r})();(function(){function r(e,c,a){this.Ra=c;this.La=e;this.ec=a}function A(e,c,a){this.red=e;this.green=c;this.blue=a}function d(e,c){this.I=e;this.ba=c}function p(e,c,a,n,b){this.l=new Allocator;this.Bc=this.l.ea(Uint8,65536,"Life.bitCounts16");this.Bg();this.Ac=this.l.ea(Uint32,q.Wg,"Life.popGraphData");this.gd=this.l.ea(Uint32,q.Wg,"Life.birthGraphData");this.Ld=this.l.ea(Uint32,q.Wg,"Life.deathGraphData");this.tc=this.Rc=this.Pa=0;this.Ub=1;this.X=0;this.Oj=-1;this.Kc=0;this.Ka=this.pa=this.Gb=-1;
this.Ah=this.zh=0;this.im=this.kk=!1;this.Fj=ViewConstants.um;this.Cc=[];this.Dc=[];this.Cc[0]=this.l.ea(Int32,q.ml,"Life.boundaryX0");this.Dc[0]=this.l.ea(Int32,q.ml,"Life.boundaryY0");this.tf=0;this.Fg=4294967295;this.Oe=-1;this.ue=this.Dj=this.L=!1;this.u=-1;this.qe=this.oc=!1;this.elapsedTime=0;this.Vc=new SnapshotManager(this.l,this.Bc);this.Yf=q.di;this.Bb=this.Rn=!1;this.Ef=this.Ha=this.ac=this.C=null;this.title="LifeViewer";this.width=n;this.height=b;this.ki=2;this.li=16;this.f=this.width>>
4;this.h=this.height>>4;this.ge=this.Vc.qk((this.f-1>>4)+1,this.h,!0);this.s=c;this.m=a;this.mc=this.lc=this.cc=0;this.W=64;this.H=127;this.Fc=63;this.Ec=1;this.Wk=this.ec=0;this.Hf=this.Ad=this.o=1;this.mm=30;this.angle=this.i=0;this.zoom=6;this.A=this.F=0;this.pc=.1;this.pb=0;this.J=1;this.rb=this.qb=0;this.b=.1;this.ef=littleEndian;this.dc=[];this.nb=this.da=this.ga=this.kc=this.ya=this.Ga=null;this.sc=12;this.Pb=this.Yb=this.ve=null;this.fd=e;this.Ua=this.Oa=0;this.U=Array.T(Uint16,this.h,(this.f-
1>>4)+1,0,this.l,"Life.tileGrid");this.oa=Array.T(Uint16,this.h,(this.f-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.hb=Array.gf(this.fb,"Life.grid16");this.Y=Array.gf(this.zb,"Life.nextGrid16");this.Cd=this.l.ea(Uint32,this.s,"Life.blankPixelRow");this.Fa=this.l.ea(Uint8,(this.width-1>>3)+1,"Life.blankRow");this.Eb=this.l.ea(Uint16,this.f>>4,"Life.blankTileRow");
this.hd=this.l.ea(Uint8,this.width,"Life.blankColourRow");this.ma=Array.T(Uint8,this.height,this.width,this.ec,this.l,"Life.colourGrid");this.v=Array.T(Uint8,this.height,this.width,this.ec,this.l,"Life.smallColourGrid");this.ha=Array.md(this.v,1,"Life.smallColourGrid4");this.ia=Array.md(this.v,3,"Life.smallColourGrid8");this.Qa=Array.md(this.v,7,"Life.smallColourGrid16");this.wf=Array.gf(this.ma,"Life.colourGrid16");this.$d=this.Ic=this.gc=this.fc=this.K=this.bc=null;this.va=Array.T(Uint16,this.h,
(this.f-1>>4)+1,0,this.l,"Life.colourTileGrid");this.Ca=Array.T(Uint16,this.h,(this.f-1>>4)+1,0,this.l,"Life.colourTileHistoryGrid");this.Sd=this.Wb=this.Xb=this.$a=null;this.Uc=this.l.ea(Uint8,256,"Life.redChannel");this.Mc=this.l.ea(Uint8,256,"Life.greenChannel");this.Jc=this.l.ea(Uint8,256,"Life.blueChannel");this.ee=this.l.ea(Uint32,256,"Life.pixelColours");this.l.ea(Uint8,q.Mm,"Life.indexLookup33");this.Md=this.l.ea(Uint8,q.Kk,"Life.indexLookup63");this.Od=this.l.ea(Uint8,q.Kk,"Life.indexLookup632");
this.xf=this.l.ea(Uint8,2*(this.H+1),"Life.colourLookup");this.yf=this.l.ea(Uint8,1048576,"Life.colourReset");this.Oc=this.fj=5263440;this.Ee=-1;this.Kd=this.Ik=7368816;this.Ce=-1;this.Ag=13750737;this.Ue=15066597;this.Nc=10;this.bf=!0;this.Ed=this.l.ea(Uint16,(this.width-1>>4)+1,"Life.columnOccupied16");this.ib=8192;this.xp=[0,0,48];this.wp=[255,255,255];this.vp=[255,255,255];this.yp=[0,255,0];this.zp=[255,0,0];this.Hd=[0,0,48];this.Gd=[255,255,255];this.Fd=[255,255,255];this.Id=[0,255,0];this.Jd=
[255,0,0]}var q={ml:4096,Mm:512,Kk:262144,di:50,gm:255,Wg:1E5,ld:1,td:2,vd:4,dd:8,ie:16,je:32,Vd:64,Wd:128};r.prototype.Ap=function(){var e=!0;this.Ra.I.Qk(this.Ra.ba)&&this.La.I.Qk(this.La.ba)&&this.La.I.Qk(this.ec)&&(e=!1);return e};A.prototype.set=function(e){this.red=e.red;this.green=e.green;this.blue=e.blue};A.prototype.Qk=function(e){var c=!1;this.red===e.red&&this.green===e.green&&this.blue===e.blue&&(c=!0);return c};d.prototype.set=function(e){this.I.set(e.I);this.ba.set(e.ba)};p.prototype.Ek=
function(e,c,a){var n=0,b,k=ViewConstants.Ea[3]+128,f=ViewConstants.Ea[4]+128,m=ViewConstants.Ea[5]+128,g=ViewConstants.Ea[6]+128;e===(e&this.Oa)&&c===(c&this.Ua)&&(b=this.ma[c][e],a||-1!==this.u?-1!==this.u&&0<b?n=this.u-b:n=b:this.bc?(e=this.bc[c][e],e===f||e===g?(b>=this.W&&(e=k),n=ViewConstants.Ea[e-128]):e===k||e===m?(b<this.W&&(e=f),n=ViewConstants.Ea[e-128]):n=b===this.ec?0:b<=this.Fc?2:1):n=b<=this.Fc?0:1);return n};p.prototype.ji=function(e){var c,a,n,b,k=e.length,f=e[0].length,m=this.Bc,
g=0;for(a=0;a<k;a+=1)for(c=e[a],n=0;n<f;n+=1)(b=c[n])&&(g+=m[b]);return g};p.prototype.Yh=function(e,c,a,n){var b=this.Vc.Lb.length,k=this.Vc.Bq(e),f=!0;b!==this.Vc.Lb.length&&(this.Yf-=q.di);if(k){for(this.Cf(k);this.i<e-1;)this.Xf(!1,this.elapsedTime,!0,n),this.Hg();this.i<e&&this.Xf(c,this.elapsedTime,!0,n);f=this.Hg();this.elapsedTime=a-(a-k.elapsedTime)/(e-k.i+1)}return f};p.prototype.Cf=function(e){var c,a,n,b,k,f,m=this.Fa,g=this.hd;this.i=e.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);f=c.length;for(k=0;k<f;k+=1)c[k].set(m),this.ma[k].set(g),this.v[k].set(g);Array.Bd(c,a);Array.Bd(this.Ca,this.va);e.nq(c,n,this);e.mq(this.ma,this.Ca,this);Array.Bd(n,b);Array.Bd(c,a);this.C.O=e.C.O;this.C.N=e.C.N;this.C.P=e.C.P;this.C.R=e.C.R;this.cc=e.cc;this.lc=e.lc;this.mc=e.mc;this.elapsedTime=e.elapsedTime;this.X=e.X;this.Kc=e.Kc};p.prototype.Zh=function(e){var c,a;this.i&1?(c=this.zb,a=this.oa):(c=this.fb,a=this.U);this.Df(!1,c,a,e)};p.prototype.ol=
function(e){this.Cf(this.ge);this.Vc.reset();this.Yf=q.di;e||this.Zh(0)};p.prototype.Df=function(e,c,a,n){this.Vc.Zh(c,a,this.ma,this.Ca,this.C,this.cc,this.lc,this.mc,n,this.i,(this.f-1>>4)+1,this.h,this,e,this.X,this.Kc)};p.prototype.rq=function(e){this.Vc.reset();this.Df(!0,this.fb,this.U,0);e||this.Zh(0)};p.prototype.Lm=function(){var e=this.fb,c=this.zb,a=this.ma,n=this.v,b=this.bc,k=this.K,f=this.$a,m=this.Wb,g=this.Xb,l=this.Sd,h=this.U,u=this.oa,z=this.va,v=this.Ca,C=this.height,d=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.hb=Array.gf(this.fb,"Life.grid16");this.Y=Array.gf(this.zb,"Life.nextGrid16");f&&(this.$a=Array.T(Uint16,this.height,(this.width-1>>4)+1,0,this.l,"Life.state6Mask"),this.Wb=Array.T(Uint16,this.height,(this.width-1>>4)+1,0,this.l,"Life.state6Alive"),this.Xb=
Array.T(Uint16,this.height,(this.width-1>>4)+1,0,this.l,"Life.state6Cells"));this.f=this.width>>4;this.h=this.height>>4;f&&(this.Sd=Array.T(Uint16,this.h,(this.f-1>>4)+1,0,this.l,"Life.state6TileGrid"));this.U=Array.T(Uint16,this.h,(this.f-1>>4)+1,0,this.l,"Life.tileGrid");this.oa=Array.T(Uint16,this.h,(this.f-1>>4)+1,0,this.l,"Life.nextTileGrid");this.va=Array.T(Uint16,this.h,(this.f-1>>4)+1,0,this.l,"Life.colourTileGrid");this.Ca=Array.T(Uint16,this.h,(this.f-1>>4)+1,0,this.l,"Life.colourTileHistoryGrid");
this.Fa=this.l.ea(Uint8,(this.width-1>>3)+1,"Life.blankRow");this.Eb=this.l.ea(Uint16,this.f>>4,"Life.blankTileRow");this.hd=this.l.ea(Uint8,this.width,"Life.blankColourRow");this.Ed=this.l.ea(Uint16,(this.width-1>>4)+1,"Life.columnOccupied16");this.ma=Array.T(Uint8,this.height,this.width,this.ec,this.l,"Life.colourGrid");this.v=Array.T(Uint8,this.height,this.width,this.ec,this.l,"Life.smallColourGrid");this.ha=Array.md(this.v,1,"Life.smallColourGrid4");this.ia=Array.md(this.v,3,"Life.smallColourGrid8");
this.Qa=Array.md(this.v,7,"Life.smallColourGrid16");this.wf=Array.gf(this.ma,"Life.colourGrid16");b&&(this.bc=Array.T(Uint8,this.height,this.width,this.ec,this.l,"Life.overlayGrid"),this.K=Array.T(Uint8,this.height,this.width,this.ec,this.l,"Life.smallOverlayGrid"),this.fc=Array.md(this.K,1,"Life.smallColourGrid4"),this.gc=Array.md(this.K,3,"Life.smallColourGrid8"),this.Ic=Array.md(this.K,7,"Life.smallColourGrid16"),this.$d=Array.gf(this.bc,"Life.overlayGrid16"));this.Oa=this.width-1;this.Ua=this.height-
1;for(q=0;q<C;q+=1)this.fb[q+w].set(e[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.bc[q+w].set(b[q],p),this.K[q+w].set(k[q],p)),f&&(this.$a[q+w].set(f[q],p>>4),this.Wb[q+w].set(m[q],p>>4),this.Xb[q+w].set(g[q],p>>4));w=d>>1;for(q=0;q<d;q+=1)f&&this.Sd[q+w].set(l[q],this.Sd[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.va[q+w].set(z[q],this.va[q].length>>2),this.Ca[q+w].set(v[q],this.Ca[q].length>>
2);p=this.width>>2;w=this.height>>2;this.Vc.lq((this.f-1>>4)+1,this.h,p);this.F+=p;this.A+=w;this.L&&(this.F-=w/2|0);this.C.O+=p;this.C.P+=p;this.C.R+=w;this.C.N+=w;this.ac.O+=p;this.ac.P+=p;this.ac.R+=w;this.ac.N+=w;this.Ha.O+=p;this.Ha.P+=p;this.Ha.R+=w;this.Ha.N+=w}};p.prototype.Ho=function(e){var c=this.C,a=this.width,n=this.height,b=!1;8192>a&&this.X&&(c.O<=e||c.N<=e||c.P>=a-e||c.R>=n-e)&&(this.Lm(),b=!0);return b};p.prototype.Bg=function(){var e,c,a,n=this.Bc;for(e=0;65536>e;e+=1){c=e;for(a=
0;c;a+=1)c&=c-1;n[e]=a}};p.prototype.Cg=function(){var e,c,a=this.yf,n=this.W;for(e=0;65536>e;e+=1)for(c=0;16>c;c+=1)a[(e<<4)+c]=e&1<<15-c?n:0};p.prototype.jq=function(e){var c,a,n,b=0,k,f=this.Bc;c=this.C;var m=c.O>>4,g=c.P>>4,l=c.R;for(c=c.N;c<=l;c+=1)for(n=e[c],a=m;a<=g;a+=1)k=f[n[a]],b+=k;this.cc=b;this.mc=this.lc=0};p.prototype.zn=function(e,c){var a=this.fd,n;n=this.ef?4278190080:255;this.s=e;this.m=c;this.ve=this.Yb=this.Pb=null;this.Pb=a.createImageData(a.canvas.width,a.canvas.height);this.Pb.data.buffer?
this.Yb=new Uint32Array(this.Pb.data.buffer):(this.Yb=new Uint32Array(this.Pb.data.length>>2),this.ve=new Uint8Array(this.Yb.buffer));this.Cd=this.l.ea(Uint32,e,"Life.blankPixelRow");for(a=0;a<e;a+=1)this.Cd[a]=n;this.ug()};p.prototype.Lo=function(e,c,a){var n,b=this.ma,k,f=e.width,m=e.height;c=(this.width-f>>1)+c;var g=(this.height-m>>1)+a,l=this.Oa,h=this.Ua,u,z=this.Ec,v=ViewConstants.Ea[2];for(n=0;n<m;n+=1)for(u=e.Be[n],k=b[n+g&h],a=0;a<f;a+=1)u[a]===v&&(k[a+c&l]=z)};p.prototype.rp=function(){this.$d=
this.K=this.bc=null};p.prototype.So=function(){this.bc=Array.T(Uint8,this.height,this.width,this.ec,this.l,"Life.overlayGrid");this.K=Array.T(Uint8,this.height,this.width,this.ec,this.l,"Life.smallOverlayGrid");this.fc=Array.md(this.K,1,"Life.smallOverlayGrid4");this.gc=Array.md(this.K,3,"Life.smallOverlayGrid8");this.Ic=Array.md(this.K,7,"Life.smallOverlayGrid16");this.$d=Array.gf(this.bc,"Life.overlayGrid16")};p.prototype.sp=function(){this.Sd=this.Xb=this.Wb=this.$a=null};p.prototype.Uo=function(){this.$a=
Array.T(Uint16,this.height,(this.width-1>>4)+1,0,this.l,"Life.state6Mask");this.Wb=Array.T(Uint16,this.height,(this.width-1>>4)+1,0,this.l,"Life.state6Alive");this.Xb=Array.T(Uint16,this.height,(this.width-1>>4)+1,0,this.l,"Life.state6Cells");this.Sd=Array.T(Uint16,this.h,(this.f-1>>4)+1,0,this.l,"Life.state6TileGrid")};p.prototype.Vp=function(e,c,a){var n,b,k,f,m,g=e.width,l=e.height;c=(this.width-g>>1)+c;var h=(this.height-l>>1)+a,u=this.Oa,z=this.Ua,v,C,d=this.Sd,p,w,q;for(n=0;n<l;n+=1)for(v=e.Be[n],
b=this.$a[n-1+h&z],k=this.$a[n+h&z],f=this.$a[n+1+h&z],m=this.Xb[n+h&z],p=d[(n-1+h&z)>>4],w=d[(n+h&z)>>4],q=d[(n+1+h&z)>>4],a=0;a<g;a+=1)6===v[a]&&(C=a+c&u,m[C>>4]|=1<<(~C&15),b[C>>4]|=1<<(~C&15),k[C>>4]|=1<<(~C&15),f[C>>4]|=1<<(~C&15),p[C>>8]|=1<<(~(C>>4)&15),w[C>>8]|=1<<(~(C>>4)&15),q[C>>8]|=1<<(~(C>>4)&15),C=a-1+c&u,b[C>>4]|=1<<(~C&15),k[C>>4]|=1<<(~C&15),f[C>>4]|=1<<(~C&15),p[C>>8]|=1<<(~(C>>4)&15),w[C>>8]|=1<<(~(C>>4)&15),q[C>>8]|=1<<(~(C>>4)&15),C=a+1+c&u,b[C>>4]|=1<<(~C&15),k[C>>4]|=1<<(~C&
15),f[C>>4]|=1<<(~C&15),p[C>>8]|=1<<(~(C>>4)&15),w[C>>8]|=1<<(~(C>>4)&15),q[C>>8]|=1<<(~(C>>4)&15))};p.prototype.iq=function(e){var c,a,n,b=this.ma,k=this.yf,f,m,g;c=this.C;var l=c.O>>4,h=c.P>>4,u=c.R;for(a=c.N;a<=u;a+=1)for(f=e[a],m=b[a],n=l<<4,c=l;c<=h;c+=1)g=f[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.Cp=function(e,c,a){var n=this.ec,b=this.Fa,k=this.hd,f=this.Cd,m=this.Eb,g;g=this.ef?4278190080:255;this.qe=!1;this.Oa=this.width-1;this.Ua=this.height-1;this.C=new BoundingBox(0,0,this.width-1,this.height-1);this.ac=new BoundingBox(0,0,this.width-1,this.height-1);this.Ha=new BoundingBox(0,0,this.width-1,this.height-1);this.Ef=new BoundingBox(0,0,this.width-1,this.height-1);this.fd=e;this.Cg();AliasManager.Nd();this.zn(c,a);a=(this.width-1>>
3)+1;for(e=0;e<a;e+=1)b[e]=0;a=this.width;for(e=0;e<a;e+=1)k[e]=n;a=this.f>>4;for(e=0;e<a;e+=1)m[e]=0;for(e=0;e<c;e+=1)f[e]=g};p.prototype.Oo=function(){var e=0;this.dc[e]=new r(new d(new A(0,0,0),new A(0,0,0)),new d(new A(255,255,255),new A(255,255,255)),new A(0,0,0));e+=1;this.dc[e]=new r(new d(new A(0,0,47),new A(0,0,255)),new d(new A(0,255,255),new A(255,255,255)),new A(0,0,0));e+=1;this.dc[e]=new r(new d(new A(32,0,0),new A(160,0,0)),new d(new A(255,144,0),new A(255,255,0)),new A(0,0,0));e+=
1;this.dc[e]=new r(new d(new A(0,24,0),new A(0,128,0)),new d(new A(0,255,255),new A(255,255,255)),new A(0,0,0));e+=1;this.dc[e]=new r(new d(new A(0,47,0),new A(128,0,128)),new d(new A(255,255,0),new A(255,255,255)),new A(0,32,128));e+=1;this.dc[e]=new r(new d(new A(16,16,16),new A(104,104,104)),new d(new A(176,176,176),new A(255,255,255)),new A(0,0,0));e+=1;this.dc[e]=new r(new d(new A(255,255,255),new A(255,255,255)),new d(new A(0,0,0),new A(0,0,0)),new A(255,255,255));e+=1;this.dc[e]=new r(new d(new A(240,
240,240),new A(0,255,255)),new d(new A(0,0,255),new A(0,0,0)),new A(255,255,255));e+=1;this.dc[e]=new r(new d(new A(240,240,240),new A(240,240,240)),new d(new A(240,240,240),new A(240,240,240)),new A(0,0,0));e+=1;this.dc[e]=new r(new d(new A(160,0,0),new A(160,0,0)),new d(new A(240,240,240),new A(240,240,240)),new A(0,0,0));e+=1;this.dc[e]=new r(new d(new A(0,0,96),new A(0,0,160)),new d(new A(0,240,0),new A(16,255,16)),new A(0,0,0));e+=1;this.dc[e]=new r(new d(new A(255,255,0),new A(255,255,0)),new d(new A(255,
0,0),new A(255,0,0)),new A(0,0,0));this.dc[e+1]=new r(new d(new A(0,0,0),new A(0,0,0)),new d(new A(0,0,0),new A(0,0,0)),new A(0,0,0));this.ya=new d(new A(0,0,0),new A(0,0,0));this.Ga=new d(new A(0,0,0),new A(0,0,0));this.kc=new A(0,0,0);this.da=new d(new A(0,0,0),new A(0,0,0));this.ga=new d(new A(0,0,0),new A(0,0,0));this.nb=new A(0,0,0)};p.prototype.Ke=function(e,c){var a=this.dc[e];this.Ad=e;this.ya.set(this.da);this.Ga.set(this.ga);this.kc.set(this.nb);this.da.set(a.Ra);this.ga.set(a.La);this.nb.set(a.ec);
this.Hf=c;this.Rn=a.Ap();if(this.Oc===this.fj||this.Oc===this.Ue)128<=(this.nb.red+this.nb.green+this.nb.blue)/3?(this.Oc=this.Ue,this.Kd=this.Ag):(this.Oc=this.fj,this.Kd=this.Ik)};p.prototype.No=function(){var e,c,a,n,b,k;e=this.xf;c=this.H;a=this.W;n=this.Ec;b=this.Fc;e[0]=0;e[c+1]=a;for(k=1;k<c+1;k+=1)e[k]=Math.min(Math.max(k-1,n),b),e[k+c+1]=Math.max(Math.min(k+1,c),a)};p.prototype.pm=function(){var e,c,a,n,b;c=(this.Hf-1)/30;e=0;this.Uc[e]=this.kc.red*c+this.nb.red*(1-c);this.Mc[e]=this.kc.green*
c+this.nb.green*(1-c);this.Jc[e]=this.kc.blue*c+this.nb.blue*(1-c);if(-1!==this.u)for(e=1;e<this.u;e+=1)a=2===this.u?1:1-(e-1)/(this.u-2),n=this.ya.I.red*a+this.Ga.I.red*(1-a),b=this.da.I.red*a+this.ga.I.red*(1-a),this.Uc[e]=n*c+b*(1-c),n=this.ya.I.green*a+this.Ga.I.green*(1-a),b=this.da.I.green*a+this.ga.I.green*(1-a),this.Mc[e]=n*c+b*(1-c),n=this.ya.I.blue*a+this.Ga.I.blue*(1-a),b=this.da.I.blue*a+this.ga.I.blue*(1-a),this.Jc[e]=n*c+b*(1-c);else{for(e=this.Ec;e<=this.Fc;e+=1)a=1-(e-this.Ec)/(this.Fc-
this.Ec),n=this.Ga.I.red*a+this.Ga.ba.red*(1-a),b=this.ga.I.red*a+this.ga.ba.red*(1-a),this.Uc[e]=n*c+b*(1-c),n=this.Ga.I.green*a+this.Ga.ba.green*(1-a),b=this.ga.I.green*a+this.ga.ba.green*(1-a),this.Mc[e]=n*c+b*(1-c),n=this.Ga.I.blue*a+this.Ga.ba.blue*(1-a),b=this.ga.I.blue*a+this.ga.ba.blue*(1-a),this.Jc[e]=n*c+b*(1-c);for(e=this.W;e<=this.H;e+=1)a=1-(e-this.W)/(this.H-this.W),n=this.ya.I.red*a+this.ya.ba.red*(1-a),b=this.da.I.red*a+this.da.ba.red*(1-a),this.Uc[e]=n*c+b*(1-c),n=this.ya.I.green*
a+this.ya.ba.green*(1-a),b=this.da.I.green*a+this.da.ba.green*(1-a),this.Mc[e]=n*c+b*(1-c),n=this.ya.I.blue*a+this.ya.ba.blue*(1-a),b=this.da.I.blue*a+this.da.ba.blue*(1-a),this.Jc[e]=n*c+b*(1-c)}};p.prototype.Ro=function(e){var c=this.Uc,a=this.Mc,n=this.Jc,b,k;for(b=0;b<e.length;b+=1)k=e[b],c[b]=k>>16,a[b]=k>>8&255,n[b]=k&255;this.Hf=0};p.prototype.Po=function(e,c){var a=this.Uc,n=this.Mc,b=this.Jc,k=ViewConstants.Ea,f=c.length,m;for(m=0;m<e.length;m+=1)m>=f||-1===c[m]?(a[128+k[m]]=e[m]>>16,n[128+
k[m]]=e[m]>>8&255,b[128+k[m]]=e[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.Qb=function(e){var c=this.Uc,a=this.Mc,n=this.Jc,b=this.ee,k=this.Oc,f=this.Kd,m,g=0;if(-1!==this.u)if(this.ef)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.ef){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]*e<<16|a[m]*e<<8|c[m]*e;for(m=this.H+1;256>m;m+=1)b[m]=-16777216|n[m]*e<<16|a[m]*e<<8|c[m]*e}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]*e<<24|a[m]*e<<16|n[m]*e<<8|255;for(m=this.H+1;256>m;m+=1)b[m]=c[m]*e<<24|a[m]*e<<16|n[m]*e<<8|255}this.ef?(this.Ee=-16777216|(k&255)<<16|(k>>8&255)<<8|k>>16,this.Ce=-16777216|(f&255)<<16|(f>>8&255)<<8|f>>16):(this.Ee=(k&255)<<24|(k>>8&255)<<16|k>>16<<8|255,this.Ce=(f&255)<<24|(f>>8&255)<<16|f>>16<<8|255);
-1!==this.Gb&&(b[q.gm]=this.ef?4286611584:2155905279)};p.prototype.Io=function(){var e=this.height,c=this.fb,a=this.zb,n=this.ma,b=this.v,k=this.bc,f=this.K,m=this.U,g=this.va,l=this.Ca,h=this.oa,u=this.Fa,z=this.Eb,v=this.hd,C;for(C=0;C<e;C+=1)c[C].set(u),a[C].set(u),n[C].set(v),b[C].set(v),k&&(k[C].set(v),f[C].set(v));e=this.h;for(C=0;C<e;C+=1)m[C].set(z),h[C].set(z),g[C].set(z),l[C].set(z)};p.prototype.Te=function(e,c){var a=q.Kk,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],e[n]=b};p.prototype.Oq=function(){var e,c,a=PatternManager.Gj,n=q.Mm,b=!1;if(-1===this.Oe&&a[0]){if(!a[n-1]){for(e=0;e<n/2;e+=1)c=a[e],a[e]=a[n-e-1],a[n-e-1]=c;b=!0;this.Te(this.Od,a)}for(e=0;e<n/2;e+=1)c=a[e],a[e]=1-a[n-e-1],a[n-e-1]=1-c}this.Te(this.Md,PatternManager.Gj);b||this.Od.set(this.Md)};p.prototype.Fe=function(e){var c=0;e&32768?c=0:e&16384?c=1:e&8192?c=2:e&4096?c=3:e&2048?c=4:e&1024?c=5:e&512?c=6:e&256?c=7:
e&128?c=8:e&64?c=9:e&32?c=10:e&16?c=11:e&8?c=12:e&4?c=13:e&2?c=14:e&1&&(c=15);return c};p.prototype.Je=function(e){var c=0;e&1?c=15:e&2?c=14:e&4?c=13:e&8?c=12:e&16?c=11:e&32?c=10:e&64?c=9:e&128?c=8:e&256?c=7:e&512?c=6:e&1024?c=5:e&2048?c=4:e&4096?c=3:e&8192?c=2:e&16384&&(c=1);return c};p.prototype.wg=function(e){var c=this.bc,a,n=this.U,b,k=this.width,f=this.height,m,g=this.C.R,l=this.C.N,h=this.C.O,u=this.C.P,z,v;for(z=0;z<f;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))}e||(this.C.R=g,this.C.N=l,this.C.O=h,this.C.P=u)};p.prototype.rj=function(){var e,c,a,n,b,k=this.hb,f=this.oa,m,g=this.U,l,h,u,z,v,C,d,p,w,G,y,E=this.h,x=this.f>>4,D=this.Eb,B;p=0;w=p+16;for(n=0;n<E;n+=1)g[n].set(D);for(n=0;n<E;n+=1){G=0;m=f[n];l=g[n];h=0<n?g[n-1]:D;u=n<E-1?g[n+1]:D;m[0]&=32767;m[x-1]&=65534;for(b=0;b<x;b+=1)if(z=m[b]){v=l[b];C=h[b];d=u[b];for(c=15;0<=c;--c){if(z&1<<c){y=!1;B=0;e=p;a=k[e];if(a=a[G])y=!0,a&32768&&(B|=
q.ld,B|=q.Vd),a&1&&(B|=q.td,B|=q.Wd),B|=q.dd;for(e+=1;e<w-1;){a=k[e];if(a=a[G])y=!0,a&32768&&(B|=q.ld),a&1&&(B|=q.td);e+=1}a=k[e];if(a=a[G])y=!0,a&32768&&(B|=q.ld,B|=q.ie),a&1&&(B|=q.td,B|=q.je),B|=q.vd;y&&(v|=1<<c,B&&(B&q.ld&&(15>c?v|=1<<c+1:0<b&&(l[b-1]|=1)),B&q.td&&(0<c?v|=1<<c-1:b<x-1&&(l[b+1]|=32768)),B&q.dd&&(C|=1<<c),B&q.vd&&(d|=1<<c),B&q.Vd&&(15>c?C|=1<<c+1:0<b&&(h[b-1]|=1)),B&q.Wd&&(0<c?C|=1<<c-1:b<x-1&&(h[b+1]|=32768)),B&q.ie&&(15>c?d|=1<<c+1:0<b&&(u[b-1]|=1)),B&q.je&&(0<c?d|=1<<c-1:b<x-
1&&(u[b+1]|=32768))))}G+=1}l[b]|=v;0<n&&(h[b]|=C);n<E-1&&(u[b]|=d)}else G+=16;p+=16;w+=16}for(n=0;n<D.length;n+=1)D[n]=0};p.prototype.tj=function(){var e,c,a,n,b,k=this.hb,f=this.oa,m,g=this.ma,l,h=this.U,u,z,v,C,d,p,w,G,y,E,x,D,B=this.h,t=this.f>>4,A=this.Eb,r;G=0;y=G+16;for(n=0;n<B;n+=1)h[n].set(A);for(n=0;n<B;n+=1){E=0;m=f[n];u=h[n];z=0<n?h[n-1]:A;v=n<B-1?h[n+1]:A;m[0]&=32767;m[t-1]&=65534;for(b=0;b<t;b+=1)if(C=m[b]){d=u[b];p=z[b];w=v[b];for(c=15;0<=c;--c){if(C&1<<c){D=!1;r=0;e=G;a=k[e];l=g[e];
a=a[E];x=E<<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&&(D=!0,a&32768&&(r|=q.ld,r|=q.Vd),a&1&&(r|=q.td,r|=q.Wd),r|=q.dd);for(e+=1;e<y-1;)a=k[e],l=g[e],a=a[E],x=E<<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&&(D=!0,a&32768&&(r|=q.ld),a&1&&(r|=q.td)),e+=1;a=k[e];l=g[e];a=a[E];x=E<<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&&(D=!0,a&32768&&(r|=q.ld,r|=q.ie),a&1&&(r|=q.td,r|=q.je),r|=q.vd);D&&(d|=1<<c,r&&(r&q.ld&&(15>c?d|=1<<c+1:0<b&&(u[b-1]|=1)),r&q.td&&(0<c?d|=1<<c-1:b<t-1&&(u[b+1]|=32768)),r&q.dd&&(p|=1<<c),r&q.vd&&(w|=1<<c),r&q.Vd&&(15>c?p|=1<<c+1:0<b&&(z[b-1]|=1)),r&q.Wd&&(0<c?p|=1<<
c-1:b<t-1&&(z[b+1]|=32768)),r&q.ie&&(15>c?w|=1<<c+1:0<b&&(v[b-1]|=1)),r&q.je&&(0<c?w|=1<<c-1:b<t-1&&(v[b+1]|=32768))))}E+=1}u[b]|=d;0<n&&(z[b]|=p);n<B-1&&(v[b]|=w)}else E+=16;G+=16;y+=16}for(n=0;n<A.length;n+=1)A[n]=0};p.prototype.gq=function(e){var c,a,n,b=this.width>>4,k=this.height,f=this.width,m=this.hb,g,l=this.bc,h;g=this.ma;var u=this.C,z=this.ac,v=this.height,C=-1,d=this.width,p=-1,w=this.height,q=-1,y=this.width,E=-1,x,D=this.Ed,B=this.h,t=this.U,A=this.oa,r=this.va,J=this.Ca,K=this.Eb;if(l&&
!e)for(a=0;a<k;a+=1){h=l[a];for(c=x=0;c<f;c+=1)n=h[c],x|=n,n&&(c<y&&(y=c),c>E&&(E=c));x&&(a<w&&(w=a),a>q&&(q=a))}for(a=0;a<D.length;a+=1)D[a]=0;for(a=0;a<B;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<f;c+=1)n=b[c],x|=n,n&&(c<d&&(d=c),c>p&&(p=c));x&&(a<v&&(v=a),a>C&&(C=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,D[c]|=n;x&&(a<v&&(v=a),a>C&&(C=a))}for(c=0;c<b;c+=1)D[c]&&(c<d&&(d=c),c>p&&(p=c));d=(d<<4)+this.Fe(D[d]);p=(p<<4)+this.Je(D[p])}if(0>C||v>=k||
d>=f||0>p)v=C=k>>1,p=d=f>>1;l&&!e&&(q<C&&(C=q),w>v&&(v=w),y<d&&(d=y),E>p&&(p=E));C>this.height-1&&(C=this.height-1);0>v&&(v=0);0>d&&(d=0);p>this.width-1&&(p=this.width-1);u.R=C;u.N=v;u.O=d;u.P=p;z.R=C;z.N=v;z.O=d;z.P=p;0<d&&--d;0<v&&--v;p<this.width-1&&(p+=1);C<this.height-1&&(C+=1);n=C>>4;d>>=8;p>>=8;for(a=v>>4;a<=n;a+=1)for(v=A[a],c=d;c<=p;c+=1)v[c]=-1;-1!==this.u?this.tj():this.rj();l&&(this.wg(e),z.R=u.R,z.N=u.N,z.O=u.O,z.P=u.P);Array.Bd(t,A);Array.Bd(t,r);Array.Bd(t,J)};p.prototype.yb=function(e){var c,
a=this.width-this.pa>>1,n=this.height-this.Ka>>1,b=a+this.pa-1,k=n+this.Ka-1,f=b+e>>4,m,g,l=a-e>>4,h=b+e>>4,u=~(1<<(~(a-e)&15)),z=~(1<<(~(b+e)&15)),v;c=this.i&1?this.Y:this.hb;m=c[k+e];g=c[n-e];if(this.pa)if(this.Ka){for(v=a-e>>4;v<=f;v+=1)g[v]=0,m[v]=0;for(f=n-e+1;f<=k+e-1;f+=1)c[f][l]&=u,c[f][h]&=z}else for(n=0,k=this.height,f=0;f<k;f+=1)c[f][l]&=u,c[f][h]&=z;else for(f=this.width>>4,v=0;v<f;v+=1)g[v]=0,m[v]=0;if(-1!==this.u)if(c=this.ma,a-=e,b+=e,k+=e,n-=e,m=c[k],g=c[n],this.pa)if(this.Ka){for(v=
a;v<=b;v+=1)g[v]=0,m[v]=0;for(f=n+1;f<=k-1;f+=1)c[f][a]=0,c[f][b]=0}else for(f=0;f<this.height;f+=1)c[f][a]=0,c[f][b]=0;else for(v=0;v<this.width;v+=1)g[v]=0,m[v]=0};p.prototype.En=function(){var e,c,a=this.pa;e=this.Ka;var n=(this.width-a)/2-1>>4,b=(this.width+a)/2>>4;c=(this.height-e)/2-1>>4;var k=(this.height+e)/2>>4;e||(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(e=n;e<=b;e+=
1)a=1<<(~e&15),this.U[c][e>>4]|=a,this.oa[c][e>>4]|=a,this.va[c][e>>4]|=a,this.Ca[c][e>>4]|=a,this.U[k][e>>4]|=a,this.oa[k][e>>4]|=a,this.va[k][e>>4]|=a,this.Ca[k][e>>4]|=a;for(;c<=k;c+=1)a=1<<(~n&15),this.U[c][n>>4]|=a,this.oa[c][n>>4]|=a,this.va[c][n>>4]|=a,this.Ca[c][n>>4]|=a,a=1<<(~b&15),this.U[c][b>>4]|=a,this.oa[c][b>>4]|=a,this.va[c][b>>4]|=a,this.Ca[c][b>>4]|=a};p.prototype.kh=function(){var e,c,a=this.va,n=this.pa,b=this.Ka,k=this.width-n>>1,f=this.height-b>>1,m=k+n-1,g=f+b-1,l=this.zh,h=
this.Ah,u,z,v;this.i&1?(e=this.Y,c=this.oa):(e=this.hb,c=this.U);this.pa||(k=0,m=this.width-1,n=this.width);this.Ka||(f=0,g=this.height-1,b=this.height);if(this.Ka)for(v=0;v<n;v+=1)u=k+v,z=k+(v+l+n)%n,e[g][u>>4]&1<<(~u&15)&&(e[f-1][z>>4]|=1<<(~z&15),c[f-1>>4][z>>8]|=1<<(~(z>>4)&15),a[f-1>>4][z>>8]|=1<<(~(z>>4)&15),15===(f-1&15)&&(c[(f-1>>4)+1][z>>8]|=1<<(~(z>>4)&15),a[(f-1>>4)+1][z>>8]|=1<<(~(z>>4)&15))),z=k+(v-l+n)%n,e[f][u>>4]&1<<(~u&15)&&(e[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=f+v,z=f+(v-h+b)%b,e[u][k>>4]&1<<(~k&15)&&(e[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=f+(v+h+b)%b,e[u][m>>4]&1<<(~m&15)&&(e[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.Ka&&(u=k+(-l+n)%n,e[f-1][m+1>>4]=e[f+(b-1+h+b)%b][u>>4]&1<<(~u&15)?e[f-1][m+1>>4]|1<<(~(m+1)&15):e[f-1][m+1>>4]&~(1<<(~(m+1)&15)),u=k+(n-1-l+n)%n,e[f-1][k-1>>4]=e[f+(b-1+h+b)%b][u>>4]&1<<(~u&15)?e[f-1][k-1>>4]|1<<(~(k-1)&15):e[f-1][k-1>>4]&~(1<<(~(k-1)&15)),u=k+(l+n)%n,e[g+1][m+1>>4]=e[f+(h+b)%b][u>>4]&1<<(~u&15)?e[g+1][m+1>>4]|1<<(~(m+1)&15):e[g+1][m+1>>4]&~(1<<(~(m+1)&15)),u=k+(n-
1+l+n)%n,e[g+1][k-1>>4]=e[f+(h+b)%b][u>>4]&1<<(~u&15)?e[g+1][k-1>>4]|1<<(~(k-1)&15):e[g+1][k-1>>4]&~(1<<(~(k-1)&15)))};p.prototype.sh=function(){var e,c,a=this.va,n=this.pa,b=this.Ka,k=this.width-n>>1,f=this.height-b>>1,m=k+n-1,g=f+b-1,l=this.zh,h=this.Ah,u=this.kk,z=this.im,v,C,d;this.i&1?(e=this.Y,c=this.oa):(e=this.hb,c=this.U);for(d=0;d<n;d+=1)v=k+d,C=u?m-(d+l+n)%n:k+(d+l+n)%n,e[g][v>>4]&1<<(~v&15)&&(e[f-1][C>>4]|=1<<(~C&15),c[f-1>>4][C>>8]|=1<<(~(C>>4)&15),a[f-1>>4][C>>8]|=1<<(~(C>>4)&15),15===
(f-1&15)&&(c[(f-1>>4)+1][C>>8]|=1<<(~(C>>4)&15),a[(f-1>>4)+1][C>>8]|=1<<(~(C>>4)&15))),C=u?m-(d-l+n)%n:k+(d-l+n)%n,e[f][v>>4]&1<<(~v&15)&&(e[g+1][C>>4]|=1<<(~C&15),c[g+1>>4][C>>8]|=1<<(~(C>>4)&15),a[g+1>>4][C>>8]|=1<<(~(C>>4)&15),g+1&15||(c[(g+1>>4)-1][C>>8]|=1<<(~(C>>4)&15),a[(g+1>>4)-1][C>>8]|=1<<(~(C>>4)&15)));for(d=0;d<b;d+=1)v=f+d,C=z?g-(d-h+b)%b:f+(d-h+b)%b,e[v][k>>4]&1<<(~k&15)&&(e[C][m+1>>4]|=1<<(~(m+1)&15),c[C>>4][m+1>>8]|=1<<(~(m+1>>4)&15),a[C>>4][m+1>>8]|=1<<(~(m+1>>4)&15),m+1&15||(c[C>>
4][m-15>>8]|=1<<(~(m-15>>4)&15),a[C>>4][m-15>>8]|=1<<(~(m-15>>4)&15))),C=z?g-(d+h+b)%b:f+(d+h+b)%b,e[v][m>>4]&1<<(~m&15)&&(e[C][k-1>>4]|=1<<(~(k-1)&15),c[C>>4][k-1>>8]|=1<<(~(k-1>>4)&15),a[C>>4][k-1>>8]|=1<<(~(k-1>>4)&15),15===(k-1&15)&&(c[C>>4][k+15>>8]|=1<<(~(k+15>>4)&15),a[C>>4][k+15>>8]|=1<<(~(k+15>>4)&15)));v=u?m-(-l+n)%n:k+(-l+n)%n;e[z?g-(b-1+h+b)%b:f+(b-1+h+b)%b][v>>4]&1<<(~v&15)&&(e[f-1][m+1>>4]|=1<<(~(m+1)&15));v=u?m-(n-1-l+n)%n:k+(n-1-l+n)%n;e[z?g-(b-1+h+b)%b:f+(b-1+h+b)%b][v>>4]&1<<(~v&
15)&&(e[f-1][k-1>>4]|=1<<(~(k-1)&15));v=u?m-(l+n)%n:k+(l+n)%n;e[z?g-(h+b)%b:f+(h+b)%b][v>>4]&1<<(~v&15)&&(e[g+1][m+1>>4]|=1<<(~(m+1)&15));v=u?m-(n-1+l+n)%n:k+(n-1+l+n)%n;e[z?g-(h+b)%b:f+(h+b)%b][v>>4]&1<<(~v&15)&&(e[g+1][k-1>>4]|=1<<(~(k-1)&15))};p.prototype.rh=function(){var e,c,a=this.va,n=this.width-this.pa>>1,b=this.height-this.Ka>>1,k=n+this.pa-1,f=b+this.Ka-1,m,g,l;this.i&1?(e=this.Y,c=this.oa):(e=this.hb,c=this.U);for(m=0;m<this.pa;m+=1)g=n+m,l=k-m,e[f][g>>4]&1<<(~g&15)&&(e[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))),e[b][g>>4]&1<<(~g&15)&&(e[f+1][l>>4]|=1<<(~l&15),c[f+1>>4][l>>8]|=1<<(~(l>>4)&15),a[f+1>>4][l>>8]|=1<<(~(l>>4)&15),f+1&15||(c[(f+1>>4)-1][l>>8]|=1<<(~(l>>4)&15),a[(f+1>>4)-1][l>>8]|=1<<(~(l>>4)&15)));for(m=0;m<=this.Ka;m+=1)g=b+m,l=f-m,e[g][n>>4]&1<<(~n&15)&&(e[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))),e[g][k>>4]&1<<(~k&15)&&(e[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)));e[f][n>>4]&1<<(~n&15)&&(e[f+1][n-1>>4]|=1<<(~(n-1)&15));e[f][k>>4]&1<<(~k&15)&&(e[f+1][k+1>>4]|=1<<(~(k+1)&15));e[b][n>>4]&1<<(~n&15)&&(e[b-1][n-1>>4]|=1<<(~(n-1)&15));e[b][k>>4]&
1<<(~k&15)&&(e[b-1][k+1>>4]|=1<<(~(k+1)&15))};p.prototype.th=function(){var e,c,a=this.va,n=this.width-this.pa>>1,b=this.height-this.pa>>1,k=n+this.pa-1,f=b+this.pa-1,m,g,l;this.i&1?(e=this.Y,c=this.oa):(e=this.hb,c=this.U);for(m=0;m<this.pa;m+=1)l=b+m,g=n+m,e[l][n>>4]&1<<(~n&15)&&(e[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))),e[l][k>>4]&1<<(~k&15)&&(e[f+1][g>>4]|=
1<<(~g&15),c[f+1>>4][g>>8]|=1<<(~(g>>4)&15),a[f+1>>4][g>>8]|=1<<(~(g>>4)&15),f+1&15||(c[(f+1>>4)-1][g>>8]|=1<<(~(g>>4)&15),a[(f+1>>4)-1][g>>8]|=1<<(~(g>>4)&15))),e[b][g>>4]&1<<(~g&15)&&(e[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))),e[f][g>>4]&1<<(~g&15)&&(e[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)));e[f][n>>4]&1<<(~n&15)&&(e[f+1][n-1>>4]|=1<<(~(n-1)&15));e[f][k>>4]&1<<(~k&15)&&(e[f+1][k+1>>4]|=1<<(~(k+1)&15));e[b][n>>4]&1<<(~n&15)&&(e[b-1][n-1>>4]|=1<<(~(n-1)&15));e[b][k>>4]&1<<(~k&15)&&(e[b-1][k+1>>4]|=1<<(~(k+1)&15))};p.prototype.ph=function(){switch(this.Gb){case 0:this.yb(1);break;case 1:this.yb(1);this.yb(2);break;case 2:this.yb(1);this.yb(2);break;case 3:this.yb(1);this.yb(2);break;case 4:this.yb(1),this.yb(2)}};
p.prototype.qh=function(){switch(this.Gb){case 1:this.kh();break;case 2:this.sh();break;case 3:this.rh();break;case 4:this.th()}this.En()};p.prototype.Xf=function(e,c,a,n){var b=!1,k=this.C,f=this.Ha;n||(e=!0);this.i===this.Yf-1&&(b=!0,a||(e=!0));-1!==this.Gb&&this.qh();this.$a&&this.el();this.X&&(e?this.oh():this.nh());this.i+=1;-1!==this.u&&(this.X?this.lh():this.mh());this.$a&&this.$k();-1!==this.Gb&&this.ph();8192===this.width&&(16>=k.O||8176<=k.P||16>=k.N||8176<=k.R)&&this.tg();b&&(this.Yf+=
q.di,a||this.Zh(c));k.O<f.O&&(f.O=k.O);k.P>f.P&&(f.P=k.P);k.N<f.N&&(f.N=k.N);k.R>f.R&&(f.R=k.R);this.i<q.Wg&&(e?(this.Ac[this.i]=this.cc,this.gd[this.i]=this.lc,this.Ld[this.i]=this.mc,this.cc>this.Pa&&(this.Pa=this.cc),this.lc>this.Pa&&(this.Pa=this.lc),this.mc>this.Pa&&(this.Pa=this.mc)):(this.Ac[this.i]=0,this.gd[this.i]=0,this.Ld[this.i]=0))};p.prototype.Ie=function(e,c,a,n,b,k,f,m){var g,l,h,u,z=1,v,C;this.i>a&&(z=a/this.i);m?(e.strokeStyle=c,e.beginPath(),l=n-f[0]/this.Pa*n|0,e.moveTo(0+k+.5,
l+b+k+.5)):e.fillStyle=c;u=0;for(c=h=1;c<a;c+=1){if(h<q.Wg){C=v=f[h];u+=z;for(h+=1;!(u|0);)g=f[h],h+=1,g>C&&(C=g),g<v&&(v=g),u+=z;--u}else C=v=0;c<=this.i&&(g=0+k+1+c,l=n-v/this.Pa*n|0,m?(e.lineTo(g+.5,l+b+k+.5),v!==C&&(l=n-C/this.Pa*n|0,e.lineTo(g+.5,l+b+k+.5))):0<v&&0<C&&(v!==C&&(l=n-C/this.Pa*n|0),e.fillRect(g+.5,l+b+k+.5,1,1)))}m&&e.stroke()};p.prototype.Am=function(e,c,a,n){var b=this.fd,k=40,f=40,m=this.s-0-f,g=this.m-k-f,l,h="rgb("+this.Hd[0]+","+this.Hd[1]+","+this.Hd[2]+")",u="rgb("+this.Gd[0]+
","+this.Gd[1]+","+this.Gd[2]+")",z="rgb("+this.Fd[0]+","+this.Fd[1]+","+this.Fd[2]+")",v="rgb("+this.Id[0]+","+this.Id[1]+","+this.Id[2]+")",C="rgb("+this.Jd[0]+","+this.Jd[1]+","+this.Jd[2]+")";if(a||n)k=0,g+=80;n&&(f=0,m=this.s-0);l=m-0-f;b.save();b.fillStyle=h;b.globalAlpha=c;b.fillRect(0,k,m+f,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+f/2-6),b.fillText("Generation",c,c),b.restore(),b.save(),
b.translate(f/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+f-f/2+6,k+f),b.rotate(-90*Math.PI/180),b.fillText(String(this.Pa),c,c),b.restore(),b.save(),b.translate(0+f-f/2+6,g),b.rotate(-90*Math.PI/180),b.fillText("0",c,c),b.restore(),b.save(),b.translate(0+f,g+f/2-6),b.fillText("0",c,c),b.restore(),b.save(),b.translate(m,g+f/2-6),b.fillText(String(this.i>
l?this.i:l),c,c),b.restore(),b.fillStyle=u}this.Ie(b,C,l,g-k-f,k,f,this.Ld,e);this.Ie(b,v,l,g-k-f,k,f,this.gd,e);this.Ie(b,z,l,g-k-f,k,f,this.Ac,e);b.strokeStyle=u;b.lineWidth=1;b.beginPath();b.moveTo(f+.5,k+f+.5);b.lineTo(f+.5,g+.5);b.lineTo(m+.5,g+.5);b.lineTo(m+.5,g+2.5);b.moveTo(f+.5,g+.5);b.lineTo(f+.5,g+2.5);b.moveTo(f+.5,g+.5);b.lineTo(f+.5-2,g+.5);b.moveTo(f+.5,k+f+.5);b.lineTo(f+.5-2,k+f+.5);b.stroke();b.restore()};p.prototype.yn=function(){var e;for(e=0;e<q.Wg;e+=1)this.Ac[e]=0,this.gd[e]=
0,this.Ld[e]=0;this.Pa=this.Ac[0]=this.cc};p.prototype.xn=function(){var e=this.C,c=this.Ha;c.O=e.O;c.P=e.P;c.R=e.R;c.N=e.N};p.prototype.el=function(){var e,c,a,n,b,k,f,m=this.$a,g=this.Wb,l=this.Xb,h=this.Sd,u,z=this.h,v=this.f>>4,C;b=0;f=this.i&1?this.Y:this.hb;for(e=0;e<z;e+=1){k=0;u=h[e];for(c=0;c<v;c+=1)if(C=u[c])for(a=15;0<=a;--a){if(C&1<<a)for(n=b;n<b+16;n+=1)g[n][k]=(f[n][k]|l[n][k])&m[n][k];k+=1}else k+=16;b+=16}};p.prototype.$k=function(){var e,c,a,n,b,k,f,m=this.Wb,g=this.Sd,l,h=this.h,
u=this.f>>4,z;f=this.i&1?this.Y:this.hb;for(e=b=0;e<h;e+=1){k=0;l=g[e];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)f[n][k]&=~m[n][k];k+=1}else k+=16;b+=16}};p.prototype.He=function(e,c,a){var n,b,k=this.tf,f=0,m=this.Cc[f],g=this.Dc[f],l=0,h=q.ml,u=h-1,z=0,v=h,C=this.Fj,d=this.Oa,p=this.Ua;m[l]=e;g[l]=c;l+=1;for(a[c][e>>4]&=~(1<<(~e&15));0<l;)for(--l,l<z&&(--f,z-=h,v-=h,m=this.Cc[f],g=this.Dc[f]),e=m[l&u],c=g[l&u],b=c-C;b<=c+C;){for(n=e-C;n<=e+C;)n===(n&d)&&b===(b&
p)&&a[b][n>>4]&1<<(~n&15)&&(a[b][n>>4]&=~(1<<(~n&15)),l===v&&(f+=1,z+=h,v+=h,f>k&&(this.Cc[f]=this.l.ea(Int32,h,"Life.boundaryX"+f),this.Dc[f]=this.l.ea(Int32,h,"Life.boundaryY"+f),this.tf=k+=1),m=this.Cc[f],g=this.Dc[f]),m[l&u]=n,g[l&u]=b,l+=1),n+=1;b+=1}};p.prototype.Ve=function(e,c,a){for(var n=a[c][e],b=15;0<=b;)n&1<<b&&this.He((e<<4)+(~b&15),c,a),--b};p.prototype.uh=function(e,c){this.He(0,e,c)};p.prototype.yh=function(e,c,a){this.He((e<<4)+15,c,a)};p.prototype.tg=function(){var e,c,a,n,b,k;
e=this.i&1?this.Y:this.hb;c=e.length;a=e[0].length;b=e[0];k=e[c-1];for(n=0;n<a;)b[n]&&this.Ve(n,0,e),k[n]&&this.Ve(n,c-1,e),n+=1;for(n=0;n<c;)e[n][0]&32768&&this.uh(n,e),e[n][a-1]&1&&this.yh(a-1,n,e),n+=1};p.prototype.nh=function(){var e,c,a,n,b,k,f,m,g,l,h,u,z,v,C,d,p,w,G,y,E,x,A,B,t,r,F=this.Ed,J,K=this.height,Q=this.width,T=Q>>4,X=this.C,N=K,I=-1,O=Q,Y=-1,Z=this.h,aa=this.f>>4,ba=this.Eb,R;n=0;var S=Z;this.i&1?(h=this.Y,u=this.hb,z=this.oa,v=this.U,e=this.Od):(h=this.hb,u=this.Y,z=this.U,v=this.oa,
e=this.Md);for(g=0;g<F.length;g+=1)F[g]=0;0>n&&(n=0);S>Z&&(S=Z);A=n<<4;B=A+16;for(g=n;g<S;g+=1)for(C=v[g],l=0;l<C.length;l+=1)C[l]=0;for(g=n;g<S;g+=1){t=0;C=z[g];d=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=C[l]){y=d[l];E=p[l];x=w[l];for(k=15;0<=k;--k){if(G&1<<k){R=J=0;c=(b=A)?h[b-1]:this.Fa;a=h[b];n=h[b+1];r=a[t];if(t)if(t>=T-1){c=c[t-1]<<17|c[t]<<1;a=a[t-1]<<17|r<<1;f=n[t-1]<<17|n[t]<<1;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;
m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b),m&32768&&(R|=q.Vd),R|=q.dd;for(b+=1;b<B-1;){r|=n[t];n=h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1}r|=n[t];n=b===this.height-1?this.Fa:h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1;m=e[c>>12&63|
(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b),m&32768&&(R|=q.ie),R|=q.vd}else{c=c[t-1]<<17|c[t]<<1|c[t+1]>>15;a=a[t-1]<<17|r<<1|a[t+1]>>15;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=
m,b<N&&(N=b),b>I&&(I=b),m&32768&&(R|=q.Vd),m&1&&(R|=q.Wd),R|=q.dd;b+=1;r|=n[t];n=h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;r|=n[t];n=h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|
(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;r|=n[t];n=h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;r|=n[t];n=h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<
6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;r|=n[t];n=h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;r|=n[t];n=h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&
63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;r|=n[t];n=h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;r|=n[t];n=h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>
15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;r|=n[t];n=h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;r|=n[t];n=h[b+1];
c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;r|=n[t];n=h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=
b),b>I&&(I=b);b+=1;r|=n[t];n=h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;r|=n[t];n=h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&
63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;r|=n[t];n=h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1;r|=n[t];n=b===this.height-1?this.Fa:h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>
4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b),m&32768&&(R|=q.ie),m&1&&(R|=q.je),R|=q.vd}else{c=c[t]<<1|c[t+1]>>15;a=r<<1|a[t+1]>>15;f=n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b),m&1&&(R|=q.Wd),R|=q.dd;for(b+=1;b<B-1;){r|=n[t];n=h[b+1];c=a;a=f;f=n[t]<<1|n[t+
1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b);b+=1}r|=n[t];n=b===this.height-1?this.Fa:h[b+1];c=a;a=f;f=n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&63)<<12];if(u[b][t]=m)J|=m,b<N&&(N=b),b>I&&(I=b),m&1&&
(R|=q.je),R|=q.vd}J&&(J&32768&&(R|=q.ld),J&1&&(R|=q.td));F[t]|=J;if(J||r)y|=1<<k,R&&(R&q.ld&&(15>k?y|=1<<k+1:0<l&&0<t&&(d[l-1]|=1)),R&q.td&&(0<k?y|=1<<k-1:l<aa-1&&t<T-1&&(d[l+1]|=32768)),R&q.dd&&(E|=1<<k),R&q.vd&&(x|=1<<k),R&q.Vd&&(15>k?E|=1<<k+1:0<l&&0<t&&(p[l-1]|=1)),R&q.Wd&&(0<k?E|=1<<k-1:l<aa-1&&t<T-1&&(p[l+1]|=32768)),R&q.ie&&(15>k?x|=1<<k+1:0<l&&0<t&&(w[l-1]|=1)),R&q.je&&(0<k?x|=1<<k-1:l<aa-1&&t<T-1&&(w[l+1]|=32768)))}t+=1}d[l]|=y;0<g&&(p[l]|=E);g<Z-1&&(w[l]|=x)}else t+=16;A+=16;B+=16}for(l=
0;l<T;l+=1)F[l]&&(l<O&&(O=l),l>Y&&(Y=l));O=(O<<4)+this.Fe(F[O]);Y=(Y<<4)+this.Je(F[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.oh=function(){var e,c,a,n,b,k,f,m,g,l,h,u,z,v,C,d,p,w,G,y,E,x,A,B,t,r,F,J=this.Ed,K,Q=this.height,T=this.width,X=T>>4,N=this.C,I=Q,O=-1,Y=T,Z=-1,aa=this.h,ba=this.f>>4,R=this.Eb,S,M=this.Bc,U=0,V=0,W=0;n=0;var ca=aa;this.i&1?(h=this.Y,u=this.hb,
z=this.oa,v=this.U,e=this.Od):(h=this.hb,u=this.Y,z=this.U,v=this.oa,e=this.Md);for(g=0;g<J.length;g+=1)J[g]=0;0>n&&(n=0);ca>aa&&(ca=aa);A=n<<4;B=A+16;for(g=n;g<ca;g+=1)for(C=v[g],l=0;l<C.length;l+=1)C[l]=0;for(g=n;g<ca;g+=1){t=0;C=z[g];d=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=C[l]){y=d[l];E=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.Fa;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;f=n[t-1]<<17|n[t]<<1;m=e[c>>12&63|(a>>
12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&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.Vd),S|=q.dd);for(b+=1;b<B-1;)F=n[t],r|=F,n=h[b+1],c=a,a=f,f=n[t-1]<<17|n[t]<<1,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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.Fa:h[b+1];c=a;a=f;f=n[t-1]<<17|n[t]<<1;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&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.ie),S|=q.vd)}else c=c[t-1]<<17|c[t]<<1|c[t+1]>>15,a=a[t-1]<<17|F<<1|a[t+1]>>15,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>
12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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.Vd),m&1&&(S|=q.Wd),S|=q.dd),b+=1,F=n[t],r|=F,n=h[b+1],c=a,a=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>
8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&
63|(a&63)<<6|(f&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=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&
63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&
63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>
12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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.Fa:h[b+1],c=a,a=f,f=n[t-1]<<17|n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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.ie),m&1&&(S|=q.je),S|=q.vd);else{c=c[t]<<1|c[t+1]>>15;a=F<<1|a[t+1]>>15;f=n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<
12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&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.Wd),S|=q.dd);for(b+=1;b<B-1;)F=n[t],r|=F,n=h[b+1],c=a,a=f,f=n[t]<<1|n[t+1]>>15,m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12,m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8,m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4,m|=e[c&63|(a&63)<<6|(f&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.Fa:h[b+1];c=a;a=f;f=n[t]<<1|n[t+1]>>15;m=e[c>>12&63|(a>>12&63)<<6|(f>>12&63)<<12]<<12;m|=e[c>>8&63|(a>>8&63)<<6|(f>>8&63)<<12]<<8;m|=e[c>>4&63|(a>>4&63)<<6|(f>>4&63)<<12]<<4;m|=e[c&63|(a&63)<<6|(f&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.je),S|=q.vd)}K&&(K&32768&&(S|=q.ld),K&1&&(S|=q.td));J[t]|=K;if(K||r)y|=1<<k,S&&(S&q.ld&&(15>k?y|=1<<k+1:0<l&&0<t&&(d[l-1]|=1)),S&q.td&&(0<k?y|=1<<
k-1:l<ba-1&&t<X-1&&(d[l+1]|=32768)),S&q.dd&&(E|=1<<k),S&q.vd&&(x|=1<<k),S&q.Vd&&(15>k?E|=1<<k+1:0<l&&0<t&&(p[l-1]|=1)),S&q.Wd&&(0<k?E|=1<<k-1:l<ba-1&&t<X-1&&(p[l+1]|=32768)),S&q.ie&&(15>k?x|=1<<k+1:0<l&&0<t&&(w[l-1]|=1)),S&q.je&&(0<k?x|=1<<k-1:l<ba-1&&t<X-1&&(w[l+1]|=32768)))}t+=1}d[l]|=y;0<g&&(p[l]|=E);g<aa-1&&(w[l]|=x)}else t+=16;A+=16;B+=16}for(l=0;l<X;l+=1)J[l]&&(l<Y&&(Y=l),l>Z&&(Z=l));Y=(Y<<4)+this.Fe(J[Y]);Z=(Z<<4)+this.Je(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.cc=U;this.lc=V;this.mc=W};p.prototype.Af=function(e,c){var a,n,b,k,f,m=this.Ca,g,l,h,u,z,v,d,p,q,w,G=this.h,y=this.f>>4;v=0;d=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<d;n+=2)b=e[n],k=e[n+1],f=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),f[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),f[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),f[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),f[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),f[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),f[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),f[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),f[a+a]=w;p+=1}else p+=16;v+=16;d+=16}};p.prototype.Bf=function(e,c){var a,n,b,k,f,m=this.Ca,g,l,h,u,z,v,d,p,q,w,G=this.h,y=this.f>>4;v=0;d=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<d;a+=4)f=c[a],b=e[a],k=e[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),f[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),f[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),f[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),f[n]=w;p+=1}else p+=16;v+=16;d+=16}};p.prototype.Se=function(e,c){var a,n,b,k,f,m=this.Ca,g,l,h,u,z,v,d,p,q,w,G=this.h,y=this.f>>4;v=0;d=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<d;a+=8)f=c[a],b=e[a],k=e[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),f[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),f[n]=w;p+=1}else p+=16;v+=16;d+=16}};p.prototype.zf=function(e,c){var a,n,b,k,f=this.Ca,m,g,l,h,u,z,v,d,p=this.h,q=this.f>>4;for(g=u=0;g<p;g+=1){z=0;m=f[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=e[u],b=e[u+8],a=z<<4,d=n[a],n=n[a+8],n>d&&(d=n),n=b[a],n>d&&(d=n),n=b[a+8],n>d&&(d=n),k[a]=
d),z+=1;else z+=16;u+=16}};p.prototype.xg=function(){1>this.J&&(this.Af(this.wf,this.v),.5>this.J&&(this.Bf(this.v,this.ha),.25>this.J&&(this.Se(this.ha,this.ia),.125>this.J&&this.zf(this.ia,this.Qa))));this.qe&&1>this.J&&(this.Af(this.$d,this.K),.5>this.J&&(this.Bf(this.K,this.fc),.25>this.J&&(this.Se(this.fc,this.gc),.125>this.J&&this.zf(this.gc,this.Ic))))};p.prototype.lh=function(){var e,c,a,n=this.ma,b,k,f,m=this.Ca,g=this.va,l,h,u,z,v,d,p,q,w,G,y,E,x,A,B;G=this.h;var t=this.f>>4,r=this.u-1;
e=0;var F=G;this.Kc=this.X=0;this.i&1?(l=this.Y,u=this.oa):(l=this.hb,u=this.U);0>e&&(e=0);F>G&&(F=G);G=e<<4;y=G+16;for(d=e;d<F;d+=1){E=0;z=u[d];k=g[d];f=m[d];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){B=0;for(e=G;e<y;e+=1)h=l[e],b=n[e],c=E<<4,a=h[E],w=32768,v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=
v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,c+=1,w>>=1,
v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,c+=1,w>>=1,v=b[c],(0===v||v===r)&&
a&w?(v=r,B|=v):(a&=~w,0<v&&(--v,B|=v)),b[c]=v,h[E]=a,this.X|=a;B&&(A|=1<<q,this.Kc=B)}E+=1}else E+=16;k[p]=A;f[p]|=A}G+=16;y+=16}};p.prototype.mh=function(){var e,c,a=this.ma,n,b,k=this.Ca,f,m,g,l,h,u,z,v,d;u=this.h;var p=this.f>>4;e=0;var q=u;this.Kc=0;0>e&&(e=0);q>u&&(q=u);u=e<<4;z=u+16;for(m=e;m<q;m+=1){v=0;b=k[m];for(g=0;g<p;g+=1)if(d=b[g])for(l=15;0<=l;--l){if(d&1<<l)for(e=u;e<z;e+=1)for(n=a[e],c=v<<4,h=15;0<=h;--h)f=n[c],0<f&&--f,n[c]=f,c+=1,this.Kc|=f;v+=1}else v+=16;u+=16;z+=16}};p.prototype.Hg=
function(){var e=this.X,c=this.i;-1===this.u?(0===e&&-1!==this.Oj&&(this.i=this.Oj),this.vg(),this.i=c,0!==e&&0===this.X&&(this.Oj=this.i),e=this.X):e=this.X|this.Kc;return e};p.prototype.vg=function(){var e,c,a,n=this.ma,b,k,f,m=this.Ca,g=this.va,l=this.xf,h=this.H+1,u,z,v,d,p,q,w,G,y,E,x,A,B;G=this.h;var t=this.f>>4;e=0;var r=G;this.X=0;this.i&1?(u=this.Y,z=this.oa):(u=this.hb,z=this.U);0>e&&(e=0);r>G&&(r=G);G=e<<4;y=G+16;for(p=e;p<r;p+=1){E=0;v=z[p];k=g[p];f=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){B=0;for(e=G;e<y;)a=u[e],b=n[e],c=E<<4,a=a[E],this.X|=a,B|=a,a&32768?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&16384?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&8192?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&4096?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&2048?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&1024?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&512?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&256?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&
128?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&64?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&32?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&16?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&8?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&4?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&2?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&1?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,e+=1,a=u[e],b=n[e],c=E<<4,a=a[E],this.X|=a,B|=a,a&32768?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&16384?d=l[b[c]+h]:(d=l[b[c]],
B|=1<d),b[c]=d,c+=1,a&8192?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&4096?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&2048?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&1024?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&512?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&256?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&128?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&64?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&32?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&16?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=
d,c+=1,a&8?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&4?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&2?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&1?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,e+=1,a=u[e],b=n[e],c=E<<4,a=a[E],this.X|=a,B|=a,a&32768?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&16384?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&8192?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&4096?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&2048?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&1024?d=l[b[c]+
h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&512?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&256?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&128?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&64?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&32?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&16?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&8?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&4?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&2?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&1?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),
b[c]=d,e+=1,a=u[e],b=n[e],c=E<<4,a=a[E],this.X|=a,B|=a,a&32768?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&16384?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&8192?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&4096?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&2048?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&1024?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&512?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&256?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&128?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=
1,a&64?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&32?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&16?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&8?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&4?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&2?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,c+=1,a&1?d=l[b[c]+h]:(d=l[b[c]],B|=1<d),b[c]=d,e+=1;B&&(A|=1<<w)}E+=1}else E+=16;k[q]=A;f[q]|=A}G+=16;y+=16}};p.prototype.fo=function(e,c,a,d,b,k,f,m,g,l){var h=this.ac;d=d*e+h.R;a=a*e+h.P;c=c*e+h.N;b=b*e+h.O;h=a-b+1;e=
d-c+1;this.L&&(h=a-c/2-(b-d/2)+1);h||(h=1);e||(e=1);k/=h;f/=e;l=Math.round(1E3*(k>f?f:k)/l)/1E3;l<m?l=m:l>g&&(l=g);return l};p.prototype.Yd=function(e,c,a,d,b,k,f,m,g,l,h,u,z,v,p,q,A){var n=this.C,C=this.ac,y=this.Ha,L=this.Ef,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+C.R,L.P=u*x+C.P,L.N=h*x+C.N,L.O=v*x+C.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.oc&&!A&&(C.O<g&&(g=C.O),C.P>l&&(l=C.P),C.R>h&&
(h=C.R),C.N<n&&(n=C.N));-1!==this.Gb&&(A=this.pa,C=this.Ka,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-C/2<n&&(n=this.height/2-C/2),this.height/2+C/2>h&&(h=this.height/2+C/2));m?(A=k,C=f,g=this.width/2-A/2,l=this.width/2+A/2,h=this.height/2+C/2,n=this.height/2-C/2):(A=l-g+1,C=h-n+1);this.L&&(g-=h/2,A=l-n/2-g+1);0===A&&(A=1);0===C&&(C=1);e/=A;c/=C;b=Math.round(1E3*(e>c?c:e)/b)/1E3;b/=this.Ub;b<a?b=a:b>d&&(b=d);return[b,g-this.Rc+A/2,n-this.tc+C/2]};
p.prototype.zg=function(e,c,a){var d=this.Yb,b=this.s,k=this.m,f=c*b+0;e=c*b+e;b=e-15;if(0<=c&&c<k){for(;f<=b;)d[f]=a,f+=1,d[f]=a,f+=1,d[f]=a,f+=1,d[f]=a,f+=1,d[f]=a,f+=1,d[f]=a,f+=1,d[f]=a,f+=1,d[f]=a,f+=1,d[f]=a,f+=1,d[f]=a,f+=1,d[f]=a,f+=1,d[f]=a,f+=1,d[f]=a,f+=1,d[f]=a,f+=1,d[f]=a,f+=1,d[f]=a,f+=1;for(;f<=e;)d[f]=a,f+=1}};p.prototype.xe=function(e,c,a,d){var b=this.Yb,n=this.s;c=c*n+e;a=a*n+e;var f=a-15*n;if(0<=e&&e<n){for(;c<=f;)b[c]=d,c+=n,b[c]=d,c+=n,b[c]=d,c+=n,b[c]=d,c+=n,b[c]=d,c+=n,b[c]=
d,c+=n,b[c]=d,c+=n,b[c]=d,c+=n,b[c]=d,c+=n,b[c]=d,c+=n,b[c]=d,c+=n,b[c]=d,c+=n,b[c]=d,c+=n,b[c]=d,c+=n,b[c]=d,c+=n,b[c]=d,c+=n;for(;c<=a;)b[c]=d,c+=n}};p.prototype.Fb=function(){var e,c,a,d=this.s,b=this.m,k=this.Ee,f=this.Ce,m=this.J,g,l,h=k,u,z=((this.height/2-(this.A+this.tc))*m+b/2)%m,v=((this.width/2-(this.F+this.Rc))*m+d/2)%m;a=0<this.Nc&&this.bf?2:1;for(u=k;a;){g=-(d/2/m)-(this.width/2-this.F-this.Rc)|0;for(e=0;e<=d+m;e+=m)if(0<this.Nc&&this.bf&&(h=g%this.Nc?k:f),g+=1,h===u)if(this.L)for(l=
-(b/2/m)-(this.height/2-this.A-this.tc)|0,c=z;c<b;c+=m)l&1?this.xe(Math.round(e+v+m/2),Math.round(c),Math.round(c+m-1),h):this.xe(Math.round(e+v),Math.round(c),Math.round(c+m-1),h),l+=1;else this.xe(Math.round(e+v),0,b-1,h);g=-(b/2/m)-(this.height/2-this.A-this.tc)|0;for(c=z;c<b;c+=m)0<this.Nc&&this.bf&&(h=g%this.Nc?k:f),g+=1,h===u&&this.zg(d-1,Math.round(c),h);--a;u=f}};p.prototype.ne=function(){return 4<=this.J&&!this.pb};p.prototype.yg=function(){var e=this.pa,c=this.Ka,a=this.ma,d=(this.width-
e)/2-1|0,b=(this.width+e)/2|0,k=(this.height-c)/2-1|0,f=(this.height+c)/2|0,m=q.gm,g=a[k],l=a[f];if(e)if(c){for(e=d;e<=b;e+=1)g[e]=m,l[e]=m;for(e=k+1;e<=f-1;e+=1)a[e][d]=m,a[e][b]=m}else for(e=0;e<this.height;e+=1)a[e][d]=m,a[e][b]=m;else for(e=0;e<this.width;e+=1)g[e]=m,l[e]=m};p.prototype.eq=function(){this.Hf&&(this.pm(),--this.Hf,this.Hf||(this.ya.set(this.da),this.Ga.set(this.ga),this.kc.set(this.nb)));this.J=this.zoom*this.Ub;this.J<ViewConstants.sa?this.J=ViewConstants.sa:this.J>ViewConstants.jb&&
(this.J=ViewConstants.jb);this.qb=this.F+this.Rc;this.rb=this.A+this.tc;this.b=this.pc/2+1;this.pb=this.L?0:this.angle;-1!==this.Gb&&this.yg();this.xg();.125>this.J?this.qe?0===this.i?this.gb(this.Ic,15):this.Gc(this.Ic,this.Qa,15):this.gb(this.Qa,15):.25>this.J?this.qe?0===this.i?this.gb(this.gc,7):this.Gc(this.gc,this.ia,7):this.gb(this.ia,7):.5>this.J?this.qe?0===this.i?this.gb(this.fc,3):this.Gc(this.fc,this.ha,3):this.gb(this.ha,3):1>this.J?this.qe?0===this.i?this.gb(this.K,1):this.Gc(this.K,
this.v,1):this.gb(this.v,1):this.qe?0===this.i?this.gb(this.bc,0):this.Gc(this.bc,this.ma,0):this.gb(this.ma,0)};p.prototype.ij=function(e,c){var a=this.s>>3,d=this.ee,b=this.Yb,k,f,m,g,l,h,u,z,v,p,q,A=1,w=1,G=0,y,E=this.Oa&~c,x=this.Ua&~c,r=~c,B=~c,t=e,H=this.J;1<this.b&&(A=this.o);h=Math.sin(this.pb/180*Math.PI)/this.J;u=Math.cos(this.pb/180*Math.PI)/this.J;z=-(this.s/2*-h+this.m/2*u)+this.rb;v=-(this.s/2*u+this.m/2*h)+this.qb;1<this.o&&1<this.b&&(G=.4/(this.o-1),w=.6);this.Qb(w);k=8192>this.width?
d[0]|0:this.Fg|0;q=0;l=z;for(f=0;f<this.m;f+=1){g=v;for(m=0;m<a;m+=1)(g&r)===(g&E)&&(l&B)===(l&x)?(y=t[l&x][g&E]|0,b[q]=d[y]):b[q]=k,q+=1,g+=u,l-=h,(g&r)===(g&E)&&(l&B)===(l&x)?(y=t[l&x][g&E]|0,b[q]=d[y]):b[q]=k,q+=1,g+=u,l-=h,(g&r)===(g&E)&&(l&B)===(l&x)?(y=t[l&x][g&E]|0,b[q]=d[y]):b[q]=k,q+=1,g+=u,l-=h,(g&r)===(g&E)&&(l&B)===(l&x)?(y=t[l&x][g&E]|0,b[q]=d[y]):b[q]=k,q+=1,g+=u,l-=h,(g&r)===(g&E)&&(l&B)===(l&x)?(y=t[l&x][g&E]|0,b[q]=d[y]):b[q]=k,q+=1,g+=u,l-=h,(g&r)===(g&E)&&(l&B)===(l&x)?(y=t[l&x][g&
E]|0,b[q]=d[y]):b[q]=k,q+=1,g+=u,l-=h,(g&r)===(g&E)&&(l&B)===(l&x)?(y=t[l&x][g&E]|0,b[q]=d[y]):b[q]=k,q+=1,g+=u,l-=h,(g&r)===(g&E)&&(l&B)===(l&x)?(y=t[l&x][g&E]|0,b[q]=d[y]):b[q]=k,q+=1,g+=u,l-=h;v+=h;l=z+=u}this.Bb&&this.ne()&&this.Fb();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.Qb(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),E=this.Oa&~c,x=this.Ua&~c,r=~c,B=~c,z=-(this.s/
2*-h+this.m/2*u)+this.rb,v=-(this.s/2*u+this.m/2*h)+this.qb,q=0,l=z,f=0;f<this.m;f+=1){g=v;for(m=0;m<a;m+=1)(g&r)===(g&E)&&(l&B)===(l&x)&&(y=t[l&x][g&E]|0,y>=p&&(b[q]=d[y])),q+=1,g+=u,l-=h,(g&r)===(g&E)&&(l&B)===(l&x)&&(y=t[l&x][g&E]|0,y>=p&&(b[q]=d[y])),q+=1,g+=u,l-=h,(g&r)===(g&E)&&(l&B)===(l&x)&&(y=t[l&x][g&E]|0,y>=p&&(b[q]=d[y])),q+=1,g+=u,l-=h,(g&r)===(g&E)&&(l&B)===(l&x)&&(y=t[l&x][g&E]|0,y>=p&&(b[q]=d[y])),q+=1,g+=u,l-=h,(g&r)===(g&E)&&(l&B)===(l&x)&&(y=t[l&x][g&E]|0,y>=p&&(b[q]=d[y])),q+=
1,g+=u,l-=h,(g&r)===(g&E)&&(l&B)===(l&x)&&(y=t[l&x][g&E]|0,y>=p&&(b[q]=d[y])),q+=1,g+=u,l-=h,(g&r)===(g&E)&&(l&B)===(l&x)&&(y=t[l&x][g&E]|0,y>=p&&(b[q]=d[y])),q+=1,g+=u,l-=h,(g&r)===(g&E)&&(l&B)===(l&x)&&(y=t[l&x][g&E]|0,y>=p&&(b[q]=d[y])),q+=1,g+=u,l-=h;v+=h;l=z+=u}};p.prototype.kj=function(e,c){var a=this.s>>3,d=this.ee,b=this.Yb,k,f,m,g,l,h,u,z,v,p,q=1,A=1,w=0,G,y=this.Oa&~c,E=this.Ua&~c,x=~c,r=~c,B=e,t,H=this.J;1<this.b&&(q=this.o);h=1/this.J;u=-(this.m/2*h)+this.rb;z=-(this.s/2*h)+this.qb;1<
this.o&&1<this.b&&(w=.4/(this.o-1),A=.6);this.Qb(A);k=8192>this.width?d[0]|0:this.Fg|0;p=0;l=u;for(f=0;f<this.m;f+=1){if((l&r)===(l&E))for(t=B[l&E],g=z,this.L&&(g+=.5*(l|0)),m=0;m<a;m+=1)(g&x)===(g&y)?(G=t[g&y]|0,b[p]=d[G]):b[p]=k,p+=1,g+=h,(g&x)===(g&y)?(G=t[g&y]|0,b[p]=d[G]):b[p]=k,p+=1,g+=h,(g&x)===(g&y)?(G=t[g&y]|0,b[p]=d[G]):b[p]=k,p+=1,g+=h,(g&x)===(g&y)?(G=t[g&y]|0,b[p]=d[G]):b[p]=k,p+=1,g+=h,(g&x)===(g&y)?(G=t[g&y]|0,b[p]=d[G]):b[p]=k,p+=1,g+=h,(g&x)===(g&y)?(G=t[g&y]|0,b[p]=d[G]):b[p]=k,
p+=1,g+=h,(g&x)===(g&y)?(G=t[g&y]|0,b[p]=d[G]):b[p]=k,p+=1,g+=h,(g&x)===(g&y)?(G=t[g&y]|0,b[p]=d[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.ne()&&this.Fb();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.Qb(A),h/=this.b,H*=this.b,.125>H?(B=this.Qa,c=15):.25>H?(B=this.ia,c=7):.5>H?(B=this.ha,c=3):1>H?(B=this.v,c=1):(B=this.ma,c=0),y=this.Oa&~c,E=
this.Ua&~c,x=~c,r=~c,u=-(this.m/2*h)+this.rb,z=-(this.s/2*h)+this.qb,p=0,l=u,f=0;f<this.m;f+=1){if((l&r)===(l&E))for(t=B[l&E],g=z,this.L&&(g+=.5*(l|0)),m=0;m<a;m+=1)(g&x)===(g&y)&&(G=t[g&y]|0,G>=v&&(b[p]=d[G])),p+=1,g+=h,(g&x)===(g&y)&&(G=B[l&E][g&y]|0,G>=v&&(b[p]=d[G])),p+=1,g+=h,(g&x)===(g&y)&&(G=B[l&E][g&y]|0,G>=v&&(b[p]=d[G])),p+=1,g+=h,(g&x)===(g&y)&&(G=B[l&E][g&y]|0,G>=v&&(b[p]=d[G])),p+=1,g+=h,(g&x)===(g&y)&&(G=B[l&E][g&y]|0,G>=v&&(b[p]=d[G])),p+=1,g+=h,(g&x)===(g&y)&&(G=B[l&E][g&y]|0,G>=v&&
(b[p]=d[G])),p+=1,g+=h,(g&x)===(g&y)&&(G=B[l&E][g&y]|0,G>=v&&(b[p]=d[G])),p+=1,g+=h,(g&x)===(g&y)&&(G=B[l&E][g&y]|0,G>=v&&(b[p]=d[G])),p+=1,g+=h;else p+=a<<3;l=u+=h}};p.prototype.mj=function(e,c){var a=this.s>>3,d=this.ee,b=this.Yb,k,f,m,g,l,h,u,z,v,p,q,A=1,w=1,G=0,y,E=this.Oa&~c,x=this.Ua&~c,r=e,B=this.J;1<this.b&&(A=this.o);h=Math.sin(this.pb/180*Math.PI)/this.J;u=Math.cos(this.pb/180*Math.PI)/this.J;z=-(this.s/2*-h+this.m/2*u)+this.rb;v=-(this.s/2*u+this.m/2*h)+this.qb;1<this.o&&1<this.b&&(G=.4/
(this.o-1),w=.6);this.Qb(w);q=0;l=z;for(f=0;f<this.m;f+=1){g=v;for(m=0;m<a;m+=1)y=r[l&x][g&E]|0,b[q]=d[y],q+=1,g+=u,l-=h,y=r[l&x][g&E]|0,b[q]=d[y],q+=1,g+=u,l-=h,y=r[l&x][g&E]|0,b[q]=d[y],q+=1,g+=u,l-=h,y=r[l&x][g&E]|0,b[q]=d[y],q+=1,g+=u,l-=h,y=r[l&x][g&E]|0,b[q]=d[y],q+=1,g+=u,l-=h,y=r[l&x][g&E]|0,b[q]=d[y],q+=1,g+=u,l-=h,y=r[l&x][g&E]|0,b[q]=d[y],q+=1,g+=u,l-=h,y=r[l&x][g&E]|0,b[q]=d[y],q+=1,g+=u,l-=h;v+=h;l=z+=u}this.Bb&&this.ne()&&this.Fb();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.Qb(w),h/=this.b,u/=this.b,B*=this.b,.125>B?(r=this.Qa,c=15):.25>B?(r=this.ia,c=7):.5>B?(r=this.ha,c=3):1>B?(r=this.v,c=1):(r=this.ma,c=0),E=this.Oa&~c,x=this.Ua&~c,z=-(this.s/2*-h+this.m/2*u)+this.rb,v=-(this.s/2*u+this.m/2*h)+this.qb,q=0,l=z,f=0;f<this.m;f+=1){g=v;for(m=0;m<a;m+=1)y=r[l&x][g&E]|0,y>=p&&(b[q]=d[y]),q+=1,g+=u,l-=h,y=r[l&x][g&E]|0,y>=p&&(b[q]=d[y]),q+=1,g+=u,l-=h,y=r[l&x][g&E]|0,y>=p&&(b[q]=d[y]),q+=1,g+=u,l-=h,y=r[l&x][g&E]|0,y>=p&&(b[q]=d[y]),q+=
1,g+=u,l-=h,y=r[l&x][g&E]|0,y>=p&&(b[q]=d[y]),q+=1,g+=u,l-=h,y=r[l&x][g&E]|0,y>=p&&(b[q]=d[y]),q+=1,g+=u,l-=h,y=r[l&x][g&E]|0,y>=p&&(b[q]=d[y]),q+=1,g+=u,l-=h,y=r[l&x][g&E]|0,y>=p&&(b[q]=d[y]),q+=1,g+=u,l-=h;v+=h;l=z+=u}};p.prototype.nj=function(e,c){var a=this.s>>3,d=this.ee,b=this.Yb,k,f,m,g,l,h,u,z,v,p=1,q=1,r=0,w,G=this.Oa&~c,y=this.Ua&~c,A=e,x,D=this.J;1<this.b&&(p=this.o);l=1/this.J;h=-(this.m/2*l)+this.rb;u=-(this.s/2*l)+this.qb;1<this.o&&1<this.b&&(r=.4/(this.o-1),q=.6);this.Qb(q);v=0;m=h;
for(f=0;f<this.m;f+=1){x=A[m&y];g=u;this.L&&(g+=.5*(m|0));for(m=0;m<a;m+=1)w=x[g&G]|0,b[v]=d[w],v+=1,g+=l,w=x[g&G]|0,b[v]=d[w],v+=1,g+=l,w=x[g&G]|0,b[v]=d[w],v+=1,g+=l,w=x[g&G]|0,b[v]=d[w],v+=1,g+=l,w=x[g&G]|0,b[v]=d[w],v+=1,g+=l,w=x[g&G]|0,b[v]=d[w],v+=1,g+=l,w=x[g&G]|0,b[v]=d[w],v+=1,g+=l,w=x[g&G]|0,b[v]=d[w],v+=1,g+=l;m=h+=l}this.Bb&&this.ne()&&this.Fb();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+=r,this.Qb(q),l/=this.b,D*=this.b,.125>D?(A=this.Qa,c=15):.25>D?
(A=this.ia,c=7):.5>D?(A=this.ha,c=3):1>D?(A=this.v,c=1):(A=this.ma,c=0),G=this.Oa&~c,y=this.Ua&~c,h=-(this.m/2*l)+this.rb,u=-(this.s/2*l)+this.qb,v=0,m=h,f=0;f<this.m;f+=1){x=A[m&y];g=u;this.L&&(g+=.5*(m|0));for(m=0;m<a;m+=1)w=x[g&G]|0,w>=z&&(b[v]=d[w]),v+=1,g+=l,w=x[g&G]|0,w>=z&&(b[v]=d[w]),v+=1,g+=l,w=x[g&G]|0,w>=z&&(b[v]=d[w]),v+=1,g+=l,w=x[g&G]|0,w>=z&&(b[v]=d[w]),v+=1,g+=l,w=x[g&G]|0,w>=z&&(b[v]=d[w]),v+=1,g+=l,w=x[g&G]|0,w>=z&&(b[v]=d[w]),v+=1,g+=l,w=x[g&G]|0,w>=z&&(b[v]=d[w]),v+=1,g+=l,w=x[g&
G]|0,w>=z&&(b[v]=d[w]),v+=1,g+=l;m=h+=l}};p.prototype.gb=function(e,c){var a=Math.sin(this.pb/180*Math.PI)/this.J,d=Math.cos(this.pb/180*Math.PI)/this.J,b=this.s,k=this.m,f=-(this.s/2*-a+this.m/2*d)+this.rb,m=-(this.s/2*d+this.m/2*a)+this.qb,g=f+b*-a,l=m+b*d,h=f+k*d,k=m+k*a,a=h+b*-a,d=k+b*d,b=f,u=m;l<u&&(u=l);k<u&&(u=k);d<u&&(u=k);l>m&&(m=l);k>m&&(m=k);d>m&&(m=d);g<b&&(b=g);h<b&&(b=h);a<b&&(b=a);g>f&&(f=g);h>f&&(f=h);a>f&&(f=a);0>(u|0)||(m|0)>=this.width||0>(b|0)||(f|0)>=this.height?this.pb?this.ij(e,
c):this.kj(e,c):this.pb?this.mj(e,c):this.nj(e,c)};p.prototype.Bh=function(e,c,a){var d=this.s>>3,b=this.ee,k=this.Yb,f,m,g,l,h,u,z,v;v=ViewConstants.Ea[3]+128;var p=ViewConstants.Ea[4]+128,q=ViewConstants.Ea[5]+128,A=ViewConstants.Ea[6]+128,w,G=1,y=1,r=0,x,D,B=this.W,t=this.Oa&~a,H=this.Ua&~a,F=~a;a=~a;var J,K=c,Q=this.J;1<this.b&&(G=this.o);c=Math.sin(this.pb/180*Math.PI)/this.J;h=Math.cos(this.pb/180*Math.PI)/this.J;u=-(this.s/2*-c+this.m/2*h)+this.rb;z=-(this.s/2*h+this.m/2*c)+this.qb;1<this.o&&
1<this.b&&(r=.4/(this.o-1),y=.6);this.Qb(y);J=8192>this.width?b[0]|0:this.Fg|0;w=0;l=u;for(f=0;f<this.m;f+=1){g=z;for(m=0;m<d;m+=1)(g&F)===(g&t)&&(l&a)===(l&H)?(x=K[l&H][g&t],D=e[l&H][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|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],D=e[l&H][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|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],D=e[l&H][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|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],D=e[l&H][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|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],D=e[l&H][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|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],D=e[l&H][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|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],D=e[l&H][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|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],D=e[l&H][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|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.ne()&&this.Fb();
for(e=1;e<G;e+=1)for(v=-1!==this.u?this.u/this.o*e|0:(this.H+1)/this.o*e|0,y+=r,this.Qb(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.Oa&~a,H=this.Ua&~a,F=~a,a=~a,u=-(this.s/2*-c+this.m/2*h)+this.rb,z=-(this.s/2*h+this.m/2*c)+this.qb,w=0,l=u,f=0;f<this.m;f+=1){g=z;for(m=0;m<d;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.Wi=function(e,c,a){var d=this.s>>3,b=this.ee,k=this.Yb,f,m,g,l,h,u,z,v;v=ViewConstants.Ea[3]+128;var p=ViewConstants.Ea[4]+128,q=ViewConstants.Ea[5]+128,A=ViewConstants.Ea[6]+128,w,G=1,y=1,r=0,x,D,B=this.W,t=this.Oa&~a;a=this.Ua&~a;var H=c,F=this.J;1<this.b&&(G=this.o);c=Math.sin(this.pb/180*Math.PI)/this.J;h=Math.cos(this.pb/180*Math.PI)/this.J;u=-(this.s/2*-c+this.m/2*h)+this.rb;z=-(this.s/2*h+this.m/2*c)+this.qb;1<this.o&&1<this.b&&(r=.4/(this.o-
1),y=.6);this.Qb(y);w=0;l=u;for(f=0;f<this.m;f+=1){g=z;for(m=0;m<d;m+=1)x=H[l&a][g&t],D=e[l&a][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c,x=H[l&a][g&t],D=e[l&a][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c,x=H[l&a][g&t],D=e[l&a][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c,x=H[l&a][g&t],D=e[l&a][g&t],D===p||D===
A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c,x=H[l&a][g&t],D=e[l&a][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c,x=H[l&a][g&t],D=e[l&a][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c,x=H[l&a][g&t],D=e[l&a][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c,x=H[l&a][g&t],D=e[l&
a][g&t],D===p||D===A?(x>=B&&(D=v),x=b[D]|0):D===v||D===q?(x<B&&(D=p),x=b[D]|0):x=b[x]|0,k[w]=x,w+=1,g+=h,l-=c;z+=c;l=u+=h}this.Bb&&this.ne()&&this.Fb();for(e=1;e<G;e+=1)for(v=-1!==this.u?this.u/this.o*e|0:(this.H+1)/this.o*e|0,y+=r,this.Qb(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.Oa&~a,a=this.Ua&~a,u=-(this.s/2*-c+this.m/2*h)+this.rb,z=-(this.s/2*h+this.m/2*c)+this.qb,w=0,l=u,f=0;f<this.m;f+=1){g=
z;for(m=0;m<d;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.Zi=function(e,c,a){var d=this.s>>3,b=this.ee,k=this.Yb,f,m,g,l,h,
u;u=ViewConstants.Ea[3]+128;var z=ViewConstants.Ea[4]+128,v=ViewConstants.Ea[5]+128,p=ViewConstants.Ea[6]+128,q,A=1,w=1,G=0,y,r,x=this.W,D=this.Oa&~a;a=this.Ua&~a;var B=c,t,H,F=this.J;1<this.b&&(A=this.o);c=1/this.J;l=-(this.m/2*c)+this.rb;h=-(this.s/2*c)+this.qb;1<this.o&&1<this.b&&(G=.4/(this.o-1),w=.6);this.Qb(w);q=0;m=l;for(f=0;f<this.m;f+=1){t=B[m&a];H=e[m&a];g=h;this.L&&(g+=.5*(m|0));for(m=0;m<d;m+=1)y=t[g&D],r=H[g&D],r===z||r===p?(y>=x&&(r=u),y=b[r]|0):r===u||r===v?(y<x&&(r=z),y=b[r]|0):y=
b[y]|0,k[q]=y,q+=1,g+=c,y=t[g&D],r=H[g&D],r===z||r===p?(y>=x&&(r=u),y=b[r]|0):r===u||r===v?(y<x&&(r=z),y=b[r]|0):y=b[y]|0,k[q]=y,q+=1,g+=c,y=t[g&D],r=H[g&D],r===z||r===p?(y>=x&&(r=u),y=b[r]|0):r===u||r===v?(y<x&&(r=z),y=b[r]|0):y=b[y]|0,k[q]=y,q+=1,g+=c,y=t[g&D],r=H[g&D],r===z||r===p?(y>=x&&(r=u),y=b[r]|0):r===u||r===v?(y<x&&(r=z),y=b[r]|0):y=b[y]|0,k[q]=y,q+=1,g+=c,y=t[g&D],r=H[g&D],r===z||r===p?(y>=x&&(r=u),y=b[r]|0):r===u||r===v?(y<x&&(r=z),y=b[r]|0):y=b[y]|0,k[q]=y,q+=1,g+=c,y=t[g&D],r=H[g&D],
r===z||r===p?(y>=x&&(r=u),y=b[r]|0):r===u||r===v?(y<x&&(r=z),y=b[r]|0):y=b[y]|0,k[q]=y,q+=1,g+=c,y=t[g&D],r=H[g&D],r===z||r===p?(y>=x&&(r=u),y=b[r]|0):r===u||r===v?(y<x&&(r=z),y=b[r]|0):y=b[y]|0,k[q]=y,q+=1,g+=c,y=t[g&D],r=H[g&D],r===z||r===p?(y>=x&&(r=u),y=b[r]|0):r===u||r===v?(y<x&&(r=z),y=b[r]|0):y=b[y]|0,k[q]=y,q+=1,g+=c;m=l+=c}this.Bb&&this.ne()&&this.Fb();for(e=1;e<A;e+=1)for(u=-1!==this.u?this.u/this.o*e|0:(this.H+1)/this.o*e|0,w+=G,this.Qb(w),c/=this.b,F*=this.b,.125>F?(B=this.Qa,a=15):.25>
F?(B=this.ia,a=7):.5>F?(B=this.ha,a=3):1>F?(B=this.v,a=1):(B=this.ma,a=0),D=this.Oa&~a,a=this.Ua&~a,l=-(this.m/2*c)+this.rb,h=-(this.s/2*c)+this.qb,q=0,m=l,f=0;f<this.m;f+=1){t=B[m&a];g=h;this.L&&(g+=.5*(m|0));for(m=0;m<d;m+=1)y=t[g&D]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c,y=t[g&D]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c,y=t[g&D]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c,y=t[g&D]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c,y=t[g&D]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c,y=t[g&D]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c,y=t[g&D]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c,y=
t[g&D]|0,y>=u&&(k[q]=b[y]),q+=1,g+=c;m=l+=c}};p.prototype.Vi=function(e,c,a){var d=this.s>>3,b=this.ee,k=this.Yb,f,m,g,l,h,u;u=ViewConstants.Ea[3]+128;var z=ViewConstants.Ea[4]+128,v=ViewConstants.Ea[5]+128,p=ViewConstants.Ea[6]+128,q,r=1,w=1,A=0,y,E,x,D=this.W,B=this.Oa&~a,t=this.Ua&~a,H=~a;a=~a;var F=c,J,K,Q=this.J;1<this.b&&(r=this.o);c=1/this.J;l=-(this.m/2*c)+this.rb;h=-(this.s/2*c)+this.qb;1<this.o&&1<this.b&&(A=.4/(this.o-1),w=.6);this.Qb(w);x=8192>this.width?b[0]|0:this.Fg|0;q=0;m=l;for(f=
0;f<this.m;f+=1){if((m&a)===(m&t))for(J=F[m&t],K=e[m&t],g=h,this.L&&(g+=.5*(m|0)),m=0;m<d;m+=1)(g&H)===(g&B)?(y=J[g&B],E=K[g&B],E===z||E===p?(y>=D&&(E=u),y=b[E]|0):E===u||E===v?(y<D&&(E=z),y=b[E]|0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c,(g&H)===(g&B)?(y=J[g&B],E=K[g&B],E===z||E===p?(y>=D&&(E=u),y=b[E]|0):E===u||E===v?(y<D&&(E=z),y=b[E]|0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c,(g&H)===(g&B)?(y=J[g&B],E=K[g&B],E===z||E===p?(y>=D&&(E=u),y=b[E]|0):E===u||E===v?(y<D&&(E=z),y=b[E]|0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c,(g&
H)===(g&B)?(y=J[g&B],E=K[g&B],E===z||E===p?(y>=D&&(E=u),y=b[E]|0):E===u||E===v?(y<D&&(E=z),y=b[E]|0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c,(g&H)===(g&B)?(y=J[g&B],E=K[g&B],E===z||E===p?(y>=D&&(E=u),y=b[E]|0):E===u||E===v?(y<D&&(E=z),y=b[E]|0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c,(g&H)===(g&B)?(y=J[g&B],E=K[g&B],E===z||E===p?(y>=D&&(E=u),y=b[E]|0):E===u||E===v?(y<D&&(E=z),y=b[E]|0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c,(g&H)===(g&B)?(y=J[g&B],E=K[g&B],E===z||E===p?(y>=D&&(E=u),y=b[E]|0):E===u||E===v?(y<D&&(E=z),y=b[E]|
0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c,(g&H)===(g&B)?(y=J[g&B],E=K[g&B],E===z||E===p?(y>=D&&(E=u),y=b[E]|0):E===u||E===v?(y<D&&(E=z),y=b[E]|0):y=b[y]|0):y=x,k[q]=y,q+=1,g+=c;else for(m=0;m<d;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.ne()&&this.Fb();for(e=1;e<r;e+=1)for(u=-1!==this.u?this.u/this.o*e|0:(this.H+1)/this.o*e|0,w+=A,this.Qb(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),B=this.Oa&~a,t=this.Ua&~a,H=~a,a=~a,l=-(this.m/2*c)+this.rb,h=-(this.s/2*c)+this.qb,q=0,m=l,f=0;f<this.m;f+=1){if((m&a)===(m&t))for(J=F[m&t],g=h,this.L&&(g+=.5*(m|0)),m=0;m<d;m+=1)(g&H)===(g&B)&&(y=J[g&B]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c,(g&H)===(g&B)&&(y=J[g&B]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c,(g&H)===(g&B)&&(y=J[g&B]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c,(g&H)===(g&B)&&(y=J[g&B]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c,(g&H)===(g&B)&&(y=J[g&B]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c,(g&H)===
(g&B)&&(y=J[g&B]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c,(g&H)===(g&B)&&(y=J[g&B]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c,(g&H)===(g&B)&&(y=J[g&B]|0,y>=u&&(k[q]=b[y])),q+=1,g+=c;else q+=d<<3;m=l+=c}};p.prototype.Gc=function(e,c,a){var d=Math.sin(this.pb/180*Math.PI)/this.J,b=Math.cos(this.pb/180*Math.PI)/this.J,k=this.s,f=this.m,m=-(this.s/2*-d+this.m/2*b)+this.rb,g=-(this.s/2*b+this.m/2*d)+this.qb,l=m+k*-d,h=g+k*b,u=m+f*b,f=g+f*d,d=u+k*-d,b=f+k*b,k=m,z=g;h<z&&(z=h);f<z&&(z=f);b<z&&(z=f);h>g&&(g=h);f>g&&(g=f);b>g&&
(g=b);l<k&&(k=l);u<k&&(k=u);d<k&&(k=d);l>m&&(m=l);u>m&&(m=u);d>m&&(m=d);0>(z|0)||(g|0)>=this.width||0>(k|0)||(m|0)>=this.height?this.pb?this.Bh(e,c,a):this.Vi(e,c,a):this.pb?this.Wi(e,c,a):this.Zi(e,c,a)};p.prototype.yk=function(){var e,c,a,d;if(!this.Pb.data.buffer)for(a=this.Pb.data,d=this.ve,c=d.length,e=0;e<c;)a[e]=d[e],e+=1,a[e]=d[e],e+=1,a[e]=d[e],e+=1,a[e]=d[e],e+=1;this.fd.putImageData(this.Pb,0,0)};p.prototype.ug=function(){var e,c=0,a=this.m,d=this.s,b=this.Yb,k=this.Cd;for(e=0;e<a;e+=1)b.set(k,
c),c+=d};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.wa=function(){var r="";this.b&&this.current<this.b.length&&(r=this.b[this.current],this.current+=1);return r};r.prototype.cg=function(){var r="";this.b&&this.current<this.b.length&&(r=this.b[this.current]);return r};r.prototype.Dm=function(r){var d=!1;if(this.b)for(;this.current<this.b.length&&!d;)this.b[this.current]===r&&(d=!0),this.current+=1;return d};r.prototype.f=function(r){return!isNaN(parseFloat(r))&&
isFinite(r)};r.prototype.h=function(r){var d=!1,p=r.indexOf("/");-1!==p&&(d=r.substr(0,p),r=r.substr(p+1),d=this.f(d)&&this.f(r));return d};r.prototype.H=function(r){var d=0,p,q;this.h(r)?(p=r.indexOf("/"),q=r.substr(0,p),r=r.substr(p+1),0!==r&&(d=q/r)):this.f(r)&&(d=parseFloat(r));return d};r.prototype.$=function(){var r=this.wa();return this.H(r)};r.prototype.aa=function(){var r=!1,d;this.b&&this.current<this.b.length&&(d=this.b[this.current],this.h(d)?r=!0:r=this.f(d));return r};window.Script=
r})();(function(){function r(d){this.f=d;this.Um=!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.xa=0;this.Vb="";this.xi=this.Re=this.Qe=this.Jl=this.Nn=this.Mn=this.fi=this.Qg=this.vf=this.Ch=this.Qh=this.zc=this.wh=this.le=this.Pe=this.ad=this.$c=this.Zc=this.$b=!1}function A(){this.ja=[];this.Sc=[];this.current=new r(this);this.H=new r(this);this.f=new r(this);this.h=!1;this.uf=0}r.prototype.set=function(d){this.x=d.x;this.y=d.y;this.Zc=d.Zc;
this.$c=d.$c;this.ad=d.ad;this.$b=d.$b;this.angle=d.angle;this.zoom=d.zoom;this.o=d.o;this.depth=d.depth;this.Xa=d.Xa;this.Ta=d.Ta;this.xa=d.xa;this.cb=d.cb;this.Vb=d.Vb};r.prototype.b=function(d,p,q){var e=d.cb+0,c=p.cb+0,a=d.angle+0,n=p.angle+0,b=1,k=1,f=1,m=1,g=1;c!==e&&(b=(q-e)/(c-e)+0,k=this.f.dm(b)+0);p.Zc||p.$b?f=b:f=k;p.$c||p.$b?m=b:m=k;p.ad||p.$b?g=b:g=k;this.x=d.x+f*(p.x-d.x);this.y=d.y+m*(p.y-d.y);this.zoom=d.zoom*Math.pow(p.zoom/d.zoom,g);180<n-a?a+=360:-180>n-a&&(n+=360);this.angle=(a+
k*(n-a))%360;this.o=d.o+b*(p.o-d.o)|0;this.depth=d.depth+b*(p.depth-d.depth);this.Xa=p.Xa;this.Ta=p.Ta;this.step=p.step;this.xa=d.xa+b*(p.xa-d.xa)|0;this.cb=q;this.Vb=p.Vb;this.$b=p.$b};A.prototype.Fi=function(){return new r(this)};A.prototype.dm=function(d){return-2*Math.pow(d,3)+3*Math.pow(d,2)+0*d+0};A.prototype.reset=function(){this.ja=[];this.Sc=[];this.h=!1;this.uf=0};A.prototype.Ep=function(){return this.ja[this.ja.length-1]};A.prototype.Cm=function(d){var p=this.v(d),q=this.ja[p];d>q.xa?d=
q.cb+1E3*(d-q.xa)/(q.Ta*q.step):0<p?(p=this.ja[p-1],d=p.cb+1E3*(d-p.xa)/(q.Ta*q.step)):d=1E3*d/(q.Ta*q.step);return d};A.prototype.qm=function(d,p,q,e,c,a,n,b,k,f,m){var g=this.H;g.x=d;g.y=p;g.zoom=q;g.angle=e;g.Ta=b;g.step=k;g.o=c;g.depth=a;g.Xa=n;g.xa=f;this.h&&(m=this.f.cb);g.cb=m-1E3;this.update(m,f);this.f.set(this.current);this.f.$b=!1;this.f.cb=m;this.h=!0;return g.cb};A.prototype.pp=function(){return this.ja[0]};A.prototype.add=function(d){d.Um?this.Sc[this.Sc.length]=d:this.ja[this.ja.length]=
d};A.prototype.ik=function(d){var p=!1;this.uf>=this.ja.length-1&&d>=this.ja[this.uf].cb&&(p=!0);return p};A.prototype.b=function(d){return d===(d|0)?String(d|0):String(d.toFixed(1))};A.prototype.Up=function(d,p){var q="",e;0<=d&&d<this.Sc.length&&(e=this.Sc[d],q="X "+e.x+" Y "+e.y+" Z "+this.b(e.zoom),""!==e.Vb&&(q+=" "+p+e.Vb+p));return q};A.prototype.$q=function(d,p){var q="",e,c;0<=d&&d<this.ja.length&&(e=this.ja[d],0<d?(c=this.ja[d-1],q=e.xa===c.xa?"P "+this.b((e.cb-c.cb|0)/1E3):"T "+e.xa,e.$b?
q+=" F":(e.x!==c.x&&(q+=" X "+-e.x),e.y!==c.y&&(q+=" Y "+-e.y),e.zoom!==c.zoom&&(q+=" Z "+this.b(e.zoom))),e.angle!==c.angle&&(q+=" A "+e.angle),e.o!==c.o&&(q+=" L "+e.o),e.depth!==c.depth&&(q+=" D "+this.b(e.depth)),e.Xa!==c.Xa&&(q+=" C "+e.Xa),e.Ta!==c.Ta&&(q+=" G "+e.Ta),e.step!==c.step&&(q+=" S "+e.step),""!==e.Vb&&(q+=" "+p+e.Vb+p)):q="T "+e.xa+" X "+-e.x+" Y "+-e.y+" Z "+this.b(e.zoom)+" A "+e.angle+" L "+e.o+" D "+this.b(e.depth)+" C "+e.Xa+" G "+e.Ta+" S "+e.step);return q};A.prototype.update=
function(d,p){var q=this.ja.length,e=!1,c=this.uf,a,n=!1;if(this.h)this.current.b(this.H,this.f,d),d>=this.f.cb&&(this.h=!1);else{for(;c<q&&!e;)a=this.ja[c],a.cb>=d?e=!0:c+=1;e?0<c?(this.ja[c].$b&&(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],d)):(c=0,this.current.set(this.ja[c])):(c=q-1,this.current.set(this.ja[c]),p>=this.current.xa&&(n=!0));this.uf=c}return n};A.prototype.v=function(d){for(var p=0,q=!1,e=this.ja,
c=this.ja.length;p<c&&!q;)e[p].xa>=d?q=!0:p+=1;q||(p=c-1);return p};A.prototype.op=function(d){this.uf=this.v(d)};A.prototype.Wp=function(d){var p,q,e,c=this.ja,a=this.ja.length;for(p=1;p<a;p+=1)q=c[p-1],e=c[p],e.Pe||(e.x=q.x),e.le||(e.y=q.y),e.Qe||(e.Zc=q.Zc),e.Re||(e.$c=q.$c),e.xi||(e.ad=q.ad),e.wh||(e.angle=q.angle),e.zc||(e.zoom=q.zoom),e.Qh||(e.o=q.o),e.Ch||(e.depth=q.depth),e.vf||(e.Xa=q.Xa),e.Qg||(e.Ta=q.Ta),e.fi||(e.step=q.step),e.Mn?e.xa<=q.xa&&(d[d.length]=[Keywords.Pj+" "+e.xa,"target generation must be later than previous ("+
q.xa+")"]):e.xa=q.xa,e.cb=e.Nn?1E3*e.cb+q.cb:q.cb+1E3*(e.xa-q.xa)/(e.Ta*e.step)};window.Waypoint=r;window.WaypointManager=A})();(function(){function r(r,d){var p=this;this.Wl=r;this.g=d;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.vb=this.Pf=!1;this.Mh=this.Lh=this.Ph=this.Oh=this.Ae=this.ze=-1;registerEvent(r,"mousedown",function(d){p.f(p,d)},!1);registerEvent(document,"mousemove",function(d){p.h(p,d)},!1);registerEvent(document,"mouseup",function(d){p.v(p,d)},!1);registerEvent(r,"touchstart",function(d){p.b(p,d)},!1);registerEvent(r,
"touchmove",function(d){p.b(p,d)},!1);registerEvent(r,"touchend",function(d){p.b(p,d)},!1);registerEvent(window,"resize",function(){p.An(p)},!1)}r.prototype.An=function(r){r.In(r.left,r.top,r.Wl)};r.prototype.Pq=function(r,d){this.In(this.left+r,this.top+d,this.Wl)};r.prototype.In=function(r,d,p){var q=window.innerWidth-p.clientWidth,e=window.innerHeight-p.clientHeight;window.innerHeight<document.getElementsByTagName("body")[0].clientHeight&&(q-=21);0>r&&(r=0);0>d&&(d=0);r>q&&(r=q);d>e&&(d=e);p.style.left=
r+"px";p.style.top=d+"px";p.style.position="fixed";this.left=r;this.top=d};r.prototype.Ko=function(){var r=this.Wl,d=r.offsetParent;this.offsetLeft=r.offsetLeft;for(this.offsetTop=r.offsetTop;d;)this.offsetLeft+=d.offsetLeft,this.offsetTop+=d.offsetTop,d=d.offsetParent;d=r.parentNode;if("fixed"===d.style.position)this.offsetLeft+=document.body.scrollLeft+document.documentElement.scrollLeft,this.offsetTop+=document.body.scrollTop+document.documentElement.scrollTop;else for(;"body"!==d.tagName.toLowerCase();)this.offsetLeft-=
d.scrollLeft,this.offsetTop-=d.scrollTop,d=d.parentNode};r.prototype.b=function(r,d){var p,q,e="";if("touchend"===d.type)e="mouseup",q=document.createEvent("MouseEvent"),q.initMouseEvent(e,!0,!0,window,1,r.Oh,r.Ph,r.Lh,r.Mh,!1,!1,!1,!1,0,null),d.target.dispatchEvent(q),d.preventDefault();else{if(1===d.touches.length)switch(d.type){case "touchstart":e="mousedown";break;case "touchmove":e="mousemove"}""!==e&&(p=d.changedTouches[0],q=document.createEvent("MouseEvent"),q.initMouseEvent(e,!0,!0,window,
1,p.screenX,p.screenY,p.clientX,p.clientY,!1,!1,!1,!1,0,null),p.target.dispatchEvent(q),d.preventDefault(),r.Oh=p.screenX,r.Ph=p.screenY,r.Lh=p.clientX,r.Mh=p.clientY)}};r.prototype.f=function(r,d){r.pg(r,d);r.vb=!0;r.g.ag=!0;d.stopPropagation&&d.stopPropagation();d.preventDefault()};r.prototype.v=function(r,d){r.Pf&&r.vb&&(r.pg(r,d),r.vb=!1,r.g.ag=!1,d.stopPropagation&&d.stopPropagation(),d.preventDefault())};r.prototype.h=function(r,d){if(r.Pf&&r.vb){var p=r.ze,q=r.Ae;r.pg(r,d);r.vb&&r.Pq(r.ze-
p,r.Ae-q);r.ze=p;r.Ae=q;d.stopPropagation&&d.stopPropagation();d.preventDefault()}};r.prototype.pg=function(r,d){var p,q;d.pageX||d.pageY?(p=d.pageX,q=d.pageY):(p=d.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,q=d.clientY+document.body.scrollTop+document.documentElement.scrollTop);r.Ko();p-=r.offsetLeft;q-=r.offsetTop;r.ze=p-1|0;r.Ae=q-1|0};window.PopupWindow=r})();(function(){function r(){this.key=new Uint8Array(256);this.Rk=this.Pk=0}r.prototype.Nd=function(r){var d,p,q,e=this.key;for(d=0;256>d;d+=1)e[d]=d;for(d=p=0;256>d;d+=1)p=p+e[d]+r.charCodeAt(d%r.length)&255,q=e[d],e[d]=e[p],e[p]=q;this.Rk=this.Pk=0};r.prototype.random=function(){var r,d,p=0,q=1,e=this.key,c=this.Pk,a=this.Rk;for(r=0;8>r;r+=1)c=c+1&255,a=a+e[c]&255,d=e[c],e[c]=e[a],e[a]=d,p+=e[e[c]+e[a]&255]*q,q*=256;this.Pk=c;this.Rk=a;return p/1.8446744073709552E19};window.Random=r;window.myRand=new r})();(function(){function r(r,d){this.Bj=r;this.x=d.ea(Float32,r,"Stars.x");this.y=d.ea(Float32,r,"Stars.y");this.f=d.ea(Float32,r,"Stars.z");this.blue=this.green=this.red=255;this.b=new Random;this.b.Nd(Date.now().toString());this.sin=d.ea(Float32,2880,"Stars.sin");this.cos=d.ea(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.Nd=function(r,d,p){var q,e,c,a,n=this.Bj,b=r*r+d*d;for(q=0;q<
n;q+=1){a=q/n*(q/n)*(q/n)*(q/n)*p+1;do e=3*(this.b.random()*r-r/2),c=3*(this.b.random()*d-d/2);while(e*e+c*c>b);this.x[q]=e;this.y[q]=c;this.f[q]=a}};r.prototype.Mo=function(r,d,p,q,e,c,a,n){var b,k,f,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.Bj;b+=1)k=this.x[b]+r,f=this.y[b]+d,0!==q&&(m=Math.sqrt(k*k+f*f),f=Math.atan2(f,k)*this.v,f+=q,0>f?f+=360:360<=f&&(f-=360),f*=8,f|=0,k=m*this.cos[f],f=m*this.sin[f]),m=this.f[b]/p*2,k=e/2+k/
m|0,f=c/2+f/m|0,0<k&&k<e-1&&0<f&&f<c-1&&(k+=f*e,m=1536/m|0,255<m&&(m=255),m/=255,a[k]===n&&(f=g+(this.red-g)*m,u=l+(this.green-l)*m,z=h+(this.blue-h)*m,f=littleEndian?-16777216|z<<16|u<<8|f:f<<24|z<<16|u<<8|255,a[k]=f),m/=2,f=g+(this.red-g)*m,u=l+(this.green-l)*m,z=h+(this.blue-h)*m,f=littleEndian?-16777216|z<<16|u<<8|f:f<<24|z<<16|u<<8|255,--k,a[k]===n&&(a[k]=f),k+=2,a[k]===n&&(a[k]=f),--k,k-=e,a[k]===n&&(a[k]=f),k+=e+e,a[k]===n&&(a[k]=f))};window.Stars=r})();(function(){function r(h){this.kh=Date.now().toString();this.Kb=this.uh=!1;this.qd=!0;this.bb=g.vm;this.Lc=!1;this.$k=h;this.fa=!1;this.Eb=this.fb=this.gb=this.zb=this.vg=this.Ef=this.ug=this.tg=0;this.Za=this.hd=this.Ya=this.gd=!1;this.Fh=!0;this.aj=!1;this.$i=0;this.af=!1;this.Bf=this.Af=0;this.pf=!1;this.Ia="";this.ha=this.ga=0;this.vc=this.Dh=this.Rf=this.Og=this.$e=this.hg=this.gh=this.jg=this.ig=this.pe=-1;this.Gg=!1;this.om=0;this.Bi=this.Sa=!1;this.Ff=0;this.Ao=.01;this.Le=this.df=!1;this.ia=
null;this.Pb=[80,80,80];this.Qj=null;this.Ha="";this.dh=this.Na=this.Qd=!1;this.$a=null;this.kd=!1;this.H=1;this.de=this.Ge=0;this.ab=this.Sk=!1;this.V=new WaypointManager;this.pj="";this.Xk=-1;this.qc=this.eb=!1;this.G=1;this.Ck=this.sh=this.Je=0;this.Xb=g.Kp;this.wk=0;this.Se=this.fd=-1;this.wf=this.tf="";this.yf=this.fc=this.nb=this.Qa=0;this.xf=null;this.Pa=this.yb=this.Rd="";this.Jf=!1;this.f=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];this.Ce=this.xe=-1;this.ve="";this.hc=[];this.Cf=!1;this.W=
[];this.Ed=[];this.Db=[];this.na=1;this.B=0;this.Yg=100;this.Va=10;this.lj=this.Dn=1;this.h=[64,200,290,530,700];this.ka=this.Td=-1;this.Zi=this.hj=this.Xe=this.wd=this.Jb=this.xb=this.mb=this.qa=!1;this.yh=this.oh=this.th=-1;this.a=null;this.X=!0;this.Xd=this.elapsedTime=0;this.s=640;this.m=512;this.Xc=this.yl=this.ce=this.tb=!1;this.S=this.rd=this.Mf=this.Ee=this.Gf=this.$d=this.dg=this.zf=this.Fb=this.Qf=this.Ve=this.Tf=this.ph=this.Df=this.Ue=this.Sf=this.Uf=this.me=this.Vf=this.Od=this.Ld=this.Ga=
this.Cd=this.Cc=this.Ec=this.Dc=this.Bc=this.xg=this.zg=this.yg=this.wg=this.qh=this.kc=this.Fe=this.Ac=this.Ie=this.Fc=this.He=this.Vg=this.Md=this.Ic=this.nc=this.ub=this.Ma=this.za=this.ua=this.Mb=this.pd=this.Wa=this.ca=null;this.Ug=this.Tg=-1;this.wheelDelta=0;this.Tb=this.$f=this.Pd=this.v=this.gc=null;this.sb=60;this.w=this.g=null;this.Ng=this.Hb=this.Kg=this.oj=this.Nh=0;this.Nf=this.xm=1;this.uk=60;this.Mg=this.Si=1;this.tk=.1;this.eg=this.Cb=this.ql=0;this.$g=1;this.lg=this.Z=this.mh=this.lh=
this.nh=!1;this.wb=g.wm;this.ij=this.mj=this.Bh=this.kj=0;this.kg=!1;this.ai=0}function A(h,a,b,c,e){var z,u=a.parentNode,f=null,d=null;for(z=0;z<l.Nb.length&&!d;)l.Nb[z][0].tabIndex===a.tabIndex?d=l.Nb[z][1]:z+=1;d||(d=new r(e),d.kd=c,m.Rh&&(d.Xb=b&-8,d.Xb<g.ae&&(d.Xb=g.ae)),a.tabIndex=l.Nb.length+1,d.Rp(a),"none"===u.style.display&&(f=new PopupWindow(u,d.g)),l.Nb[l.Nb.length]=[a,d,f]);c||d.Cl(h,!1)}function d(h){h=h.parentNode;for(var a=!1;!a;)"div"!==h.localName||h.className!==m.Ui&&"codebox"!==
h.className||(a=!0),a||(h=h.parentNode);return h}function p(){var h=l.Bl(),a=h[1],b=h[2];h[0].parentNode.style.display="none";b.Pf=!1;a.tb&&(a.S.current=a.Yc(g.Ja,!0,a))}function q(h){p();h.stopPropagation&&h.stopPropagation();h.preventDefault();return!1}function e(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=d(h);
h=e(a.getElementsByTagName(m.bg)[0]);a=a.getElementsByTagName("form")[0];a.getElementsByTagName("input")[0].value=h;a.submit()}function a(h){var a=d(h),b=e(a.getElementsByTagName(m.bg)[0]),c=l.Bl(),f,n,k,p,r,y;c?c[1].Tl(c[1]):(c=document.createElement("canvas"),c.width=g.ae,c.height=g.Uh+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),f=document.createElement("div"),f.style.display="none",f.style.position="fixed",f.style.border="1px solid rgb(128,128,128)",f.style.left="2048px",f.style.top="0px",f.style.width=g.ae+"px",f.style.textAlign="right",f.style.boxShadow="0px 0px 3px 3px rgba(0,0,0,.3), 12px 12px 8px rgba(0,0,0,.5)",f.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),f.appendChild(k),f.appendChild(c),a.appendChild(f),A(b,c,g.ae,!0,h),l.Al=l.Nb.length-1,c=l.Bl(),c[1].Qj=p);a=c[0].parentNode;""!==a.style.display&&(a.style.display="");c[1].s=g.ae;c[1].m=g.Uh+80;c[1].resize();c[1].g.notification.clear(!0,!0);c[1].g.notification.clear(!1,!0);c[1].Cl(b,!0);h=c[2];h.Pf=!0;h.An(h);c[1].Pd.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,f,d,g,l=new Allocator;a=document.getElementsByTagName("meta");for(c=0;c<a.length;c+=1)if(d=a[c],d.name===m.tagName&&(m.Nk=!1,m.Rh=!1,d=d.content,f=d.match(/\S+/g),2<=f.length&&5>=f.length))for(m.Ui=f[0],m.bg=f[1],d=2;d<f.length;d+=1)switch(f[d]){case "hide":m.Nk=
!0;break;case "limit":m.Rh=!0;break;default:g=f[d],!isNaN(parseFloat(g))&&isFinite(g)&&(m.Ej=parseFloat(g)|0)}for(a=0;a<h.length;a+=1)if(d=h[a],d.className===m.Ui)c=d.getElementsByTagName(m.bg)[0],d=d.getElementsByTagName("canvas")[0],(f=c.getElementsByTagName(m.bg)[0])&&(c=f),typedArrays&&d&&d.getContext?c&&(f=e(c),-1<m.Ej&&c.clientHeight>m.Ej&&(c.style.height=m.Ej+"px"),A(f,d,c.offsetWidth,!1,c)):m.Nk&&d&&(d.style.display="none");else if(typedArrays&&d.className===m.hp&&d.parentNode.className!==
m.Ui&&(c=d.getElementsByTagName(m.bg)[0])){f=e(c);c=null;g=!1;var k=null;try{k=PatternManager.create("",f,l),k.Ib&&(g=!0)}catch(G){}if(f=g)c=d.getElementsByTagName("a")[0],f=document.createElement("a"),f.setAttribute("href","#"),f.innerHTML="Show in Viewer",registerEvent(f,"click",b,!1),g=document.createTextNode(" / "),c.parentNode.appendChild(g),c.parentNode.appendChild(f);f=!1}}var f={lb:'"',bi:"[[",sl:"]]",Dl:"STATE1FIT",Jk:"HARDRESET",ri:"TRACK",og:"TRACKBOX",pi:"TRACKLOOP",cl:"NOREPORT",cj:"GRAPH",
xj:"NOGRAPH",Fk:"GRAPHOPACITY",Gk:"GRAPHPOINTS",Eg:"ALL",Pc:"LINEAR",xd:"BEZIER",Mk:"HEXDISPLAY",zl:"SQUAREDISPLAY",Tm:"INTEGERZOOM",ll:"RANDOMSEED",vk:"DELETERANGE",wl:"SHOWTIMING",Bk:"EXTENDEDTIMING",ul:"SHOWGENSTATS",vl:"SHOWINFOBAR",hl:"POI",hh:"TITLE",ei:"STARS",hi:"CUSTOM",Uj:"XOFFSET",Vj:"YOFFSET",Pn:"BACKGROUND",Kl:"ALIVE",On:"ALIVERAMP",Ll:"DEAD",Qn:"DEADRAMP",fm:"BOUNDARY",Ci:"AUTOFIT",Ok:"HISTORYFIT",Nj:"STEP",bl:"NOSTEPBACK",Pj:"T",fl:"PAUSE",Ih:"GRID",Hh:"GRIDMAJOR",Il:"TEXT",mn:"OFF",
on:"ON",Om:"HISTORY",Zm:"MARK1",cn:"MARKOFF",an:"MARK2",Vm:"KILL",Im:"GRAPHBG",Hm:"GRAPHAXIS",Gm:"GRAPHALIVE",Jm:"GRAPHBIRTH",Km:"GRAPHDEATH",Ba:"COLOR",nk:"COLOUR",Fl:"STRICT",vi:"VIEWONLY",Nl:"THUMBNAIL",Ml:"THUMBSIZE",Sn:"THUMBLAUNCH",ii:"THEME",Di:"AUTOSTART",Th:"LOOP",gi:"STOP",Ai:"ANGLE",qj:"LAYERS",Ti:"DEPTH",bj:"GPS",Ob:"ZOOM",gk:"Z",xc:"X",yc:"Y",Vl:"WIDTH",Lk:"HEIGHT",wc:"#"},m={tagName:"LifeViewer",Ui:"rle",bg:"code",Ej:37,Nk:!0,Rh:!0,hp:"codebox"},g={vm:.7,Bj:1E4,uq:"Script errors",kf:-2,
jf:2,ln:2,hn:4,wm:4,Zn:45,ir:0,hr:1,Rm:null,kn:1,en:16,um:3,Kf:0,Ig:1,Gi:2,Lf:3,Ii:4,Oi:5,Pi:6,Qi:7,Ri:8,Hi:9,Li:10,Ki:11,Ji:12,Mi:13,Ni:14,nn:0,pn:1,Qm:2,$m:3,dn:4,bn:5,Wm:6,Ea:[0,6,2,5,3,4,1],Eq:"Off On History Mark1 MarkOff Mark2 Kill".split(" "),Dq:"OFF ON HISTORY MARK1 MARKOFF MARK2 KILL".split(" "),dl:12,Tp:0,Sp:160,sn:10,gl:100,rn:20,Em:19,er:!1,Ak:1800,mp:"LifeViewer",rl:"LifeViewer Image",ao:"LifeViewer Plugin",Rl:226,$n:"Chris Rowett",vj:1,sj:10,Zk:0,Op:1,Ja:2,Xg:3,Wj:1.25,uj:0,fn:10,Of:10,
sa:.0625,jb:32,Np:-16,Hp:-1,nd:1,hf:60,Wf:1,rc:50,Da:null,fontSize:18,Xi:"18px Courier",qg:"18px Arial",he:"18px Arial",uc:"14px Arial",Mj:"9px Arial",Jh:"rgb(32,255,255)",jj:"#000000",Eh:"rgb(255,96,96)",dj:"rgb(128,128,128)",ae:480,Kp:1024,wj:240,jn:800,Uh:480,np:64,El:0,Kn:1,Ln:2,Mp:0,Fp:16},l={Nb:[],Al:-1,Bl:function(){var h=null;-1!==this.Al&&(h=this.Nb[this.Al]);return h},Yq:function(){var h,a=0,b;for(b=0;b<this.Nb.length;b+=1)h=this.Nb[b][1],h.tb&&(a+=1);return a},fq:function(){var h,a,b=0;
for(a=0;a<this.Nb.length;a+=1)h=this.Nb[a][1],h.S.current=h.Yc(g.Zk,!0,h),h.g.rf(!0),b+=1;return b},Fq:function(){var h,a,b=0;for(a=0;a<this.Nb.length;a+=1)h=this.Nb[a][1],h.tb&&(h.S.current=h.Yc(g.Ja,!0,h),b+=1);return b},Gq:function(h){var a,b,c=0;for(b=0;b<this.Nb.length;b+=1)a=this.Nb[b][1],a!==h&&a.tb&&(a.S.current=a.Yc(g.Ja,!0,a),c+=1);return c}};r.prototype.Fo=function(h){var a=h.$f.toDataURL("image/png"),b=window.open("",g.rl);b?(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.rl+'</title>\n\t</head>\n\t<body>\n\t\t<img width="'+h.s+'" height="'+h.m+'" src="'+a+'" alt="'+g.rl+'"/>\n\t</body>\n</html>\n'),b.document.close(),h.g.notification.D("Image Captured",300,!0)):h.g.notification.D("Could not open Image window!",g.Ak,!0)};r.prototype.Iq=function(h,a,b){var c,z,u=this.a.hb,f=this.a.ma,e=this.a.bc,d=h.width,l=h.height,m=(d-1>>4)+1,n=a>>4,k=this.a.Oa,p=this.a.Oa>>4,q=this.a.Ua,r=a&15,A,J,K,Q,T=this.Jb;for(z=0;z<l;z+=1){A=h.Ib[z];J=u[z+b&q];if(T||-1!==this.a.u)for(K=
h.Be[z],Q=f[z+b&q],c=0;c<d;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(e)for(z=0;z<l;z+=1)for(K=h.Be[z],u=e[z+b&q],c=0;c<d;c+=1)(f=K[c])&&(u[c+a&k]=g.Ea[f]+128)};r.prototype.Cg=function(h,a,b){h=h[0];a&&(b.bb=h);return[h,100*h]};r.prototype.ke=function(h,a,b){var c=h[0],z=0;a?(b.qc=!0,b.a.zoom=g.sa*Math.pow(g.jb/g.sa,h[0])/b.a.Ub):(c=Math.log(b.a.zoom*b.a.Ub/g.sa)/Math.log(g.jb/g.sa),0>c?c=0:1<c&&(c=1));this.Ya&&!this.Za?
z=b.a.zoom*b.a.Ub:z=b.a.zoom;z<g.sa?z=g.sa:z>g.jb&&(z=g.jb);1>z&&(z=-1/z);return[c,z]};r.prototype.zo=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.Yd=function(h,a){var b,c=this.a.zoom,u=this.a.F,f=this.a.A;this.Z?(b=this.a.Yd(this.s*this.wb,this.m*this.wb,g.sa,g.jb,g.Wj,this.Qa,this.nb,this.xb&&this.io,this.df,this.Ya,this.zb,this.fb,this.gb,this.Eb,this.elapsedTime,this.sb,this.Le),b[0]/=this.wb):b=this.a.Yd(this.s,this.m-80,g.sa,
g.jb,g.Wj,this.Qa,this.nb,this.xb&&this.io,this.df,this.Ya,this.zb,this.fb,this.gb,this.Eb,this.elapsedTime,this.sb,this.Le);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,f=this.a.A>f?this.a.A-f:f-this.a.A,this.Ff=c,u>this.Ff&&(this.Ff=u),f>this.Ff&&(this.Ff=f),.01>=this.Ff&&(this.a.zoom=b[0],this.a.F=b[1],this.a.A=b[2])):(this.ig=this.a.width/2-this.a.F,this.jg=
this.a.height/2-this.a.A,this.gh=this.a.zoom,this.hg=this.a.angle,this.$e=this.a.width/2-b[1],this.Og=this.a.height/2-b[2],this.Rf=b[0],this.Dh=this.hg,a?this.vc=0:(this.vc=g.dl,this.Xn()));this.za&&(this.za.current=this.ke([this.a.zoom,this.a.zoom],!1,this));this.ua&&(this.ua.current=this.ui([this.a.angle,this.a.angle],!1,this))};r.prototype.tq=function(h){var a=h.width,b=h.height;-1!==this.a.Gb&&(0!==this.a.pa&&(a=this.a.pa),0!==this.a.Ka&&(b=this.a.Ka));a=(this.a.width-a>>1)+this.ga;b=(this.a.height-
b>>1)+this.ha;!this.xb&&this.a.oc||!PatternManager.Pg||(this.xb=this.Jb=!0);this.Iq(h,a,b)};r.prototype.ci=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.lo=function(h,a,b){var c=b,z=!1,u=this.H;h&&(h.fillStyle===g.jj&&(z=!0),0<=u&&u<=0+this.Va&&(h.font=g.Xi,z||(h.fillStyle=1<(this.B|0)?g.Jh:g.dj),h.fillText("Up",a,b),z||(h.fillStyle=g.Jh),h.fillText(" / ",a+h.measureText("Up").width,
b),z||(h.fillStyle=(this.B|0)<this.Yg-this.Va?g.Jh:g.dj),h.fillText("Down",a+h.measureText("Up / ").width,b),z||(h.fillStyle=g.Jh),h.font=g.qg,h.fillText("scroll help",a+this.h[0],b),c+=19));this.H+=1;return c};r.prototype.K=function(h,a,b,c,f,e,d){var z,u=this.H;c&&(z=13,u>=d&&u<=d+this.Va&&(d=c.fillStyle,d!==g.jj&&(c.fillStyle="rgb("+h+","+a+","+b+")"),c.fillRect(f,e-(z>>1)-1,z,z),c.fillStyle=d))};r.prototype.b=function(h,a,b,c,f,e){var z=f,u=String(a).indexOf("\t"),d=this.H,l=0;if(b&&d>=e&&d<=
e+this.Va){if(h.length){b.font=g.Xi;b.fillText(h,c,f);for(b.font=g.qg;-1!==u;)b.fillText(a.substr(0,u),c+this.h[l],f),l+=1,a=a.substr(u+1),u=a.indexOf("\t");b.fillText(a,c+this.h[l],f)}else b.font=g.qg,b.fillText(a,c,f);z+=19}this.H+=1;return z};r.prototype.da=function(h,a,b){for(var c=ColourManager.hc,z=Object.keys(c),u="    "+h+" "+a+" "+b,f=!1,e,d=0;d<z.length&&!f;)e=c[z[d]],e[1]===h&&e[2]===a&&e[3]===b?(u+=" "+e[0],f=!0,d=z.length):d+=1;return u};r.prototype.Te=function(h){return this.da(h.red,
h.green,h.blue)};r.prototype.el=function(){var h=0,a=0;this.a.i?this.X&&(h=this.a.C.P-this.a.C.O+1,a=this.a.C.R-this.a.C.N+1):(h=this.Qa,a=this.nb);-1!==this.a.Gb&&(0!==this.a.pa&&(h=this.a.pa),0!==this.a.Ka&&(a=this.a.Ka));return h+" x "+a};r.prototype.$p=function(){var h="AutoFit";this.df&&(h+=" History");this.Le&&(h+=" State 1");return h};r.prototype.Vi=function(h){for(var a=10-h.length,b="";0<a;)b+=" ",--a;return b+h};r.prototype.nl=function(h,a,b,c){var e=b,d="Player",u,n,k,p;u=this.a.dc[this.a.Ad];
k=this.hc;this.H=1;this.h[0]=108;b=this.b("",g.ao+" build "+g.Rl+" by "+g.$n,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.Jb?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.kd?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.Uh||(this.Z&&this.Bh)>=g.Uh)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.Sc.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.oc&&(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.Jb||(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.Jb||(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.Nc&&(b=this.b("Shift X","toggle major grid lines",h,a,b,c));this.lg&&(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("","",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.Dn=this.H;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(f.bi,"start script section",h,a,b,c);b=this.b(f.sl,"end script section",h,a,b,c);b=this.b(f.Fl,"enable strict validation",h,a,b,c);b=this.b(f.Di,"start play automatically",h,a,b,c);b=this.b(f.Jk,"always use hard reset",
h,a,b,c);b=this.b(f.Th+" <1..>","loop at generation",h,a,b,c);b=this.b(f.gi+" <1..>","stop at generation",h,a,b,c);b=this.b(f.Pj+" <0..>","waypoint at generation",h,a,b,c);b=this.b(f.fl+" <0.0..>","pause for time",h,a,b,c);b=this.b(f.Pc+" "+f.Eg+"|"+f.xc+"|"+f.yc+"|"+f.Ob,"linear motion",h,a,b,c);b=this.b(f.xd+" "+f.Eg+"|"+f.xc+"|"+f.yc+"|"+f.Ob,"bezier motion (default)",h,a,b,c);b=this.b(f.Ci,"fit pattern to display",h,a,b,c);b=this.b(f.Ok,"autofit uses pattern history",h,a,b,c);b=this.b(f.Dl,"autofit only uses state 1",
h,a,b,c);b=this.b(f.ri+" 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(f.og+" 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(f.pi+" 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(f.hl,"define point of interest",h,a,b,c);b=this.b(f.lb+"<string>"+f.lb,"define message",h,a,b,c);b=this.b(f.vi,"disable playback",h,a,b,c);b=this.b(f.hh+" "+f.lb+"<string>"+f.lb,"set window title",h,a,b,c);b=this.b(" "+f.wc+"B","program build number",h,a,b,c);b=this.b(" "+f.wc+"N","pattern name",h,a,b,c);b=this.b(" "+f.wc+"O","pattern originator",h,a,b,c);b=this.b(" "+
f.wc+"R","rule name",h,a,b,c);b=this.b(" "+f.wc+"A","rule alias",h,a,b,c);b=this.b(" "+f.wc+"T","program title",h,a,b,c);b=this.b(" "+f.wc+f.wc,f.wc+" symbol",h,a,b,c);b=this.b(f.bl,"disable step back",h,a,b,c);b=this.b(f.cl,"disable stop messages",h,a,b,c);b=this.b(f.Nl,"start at 1/"+this.wb+" size",h,a,b,c);b=this.b(f.Ml+" <"+g.ln+".."+g.hn+">","set thumbnail divisor",h,a,b,c);b=this.b(f.Sn,"thumbnail launches viewer",h,a,b,c);b=this.b(f.Ih,"display grid lines",h,a,b,c);b=this.b(f.Hh+" <0..16>",
"set major grid line interval",h,a,b,c);b=this.b(f.cj,"display population graph",h,a,b,c);b=this.b(f.Fk+" <0.0..1.0>","population graph opacity",h,a,b,c);b=this.b(f.Gk,"population graph use points",h,a,b,c);b=this.b(f.xj,"disable population graph",h,a,b,c);b=this.b(f.ei,"display stars",h,a,b,c);b=this.b(f.Mk,"force hex display",h,a,b,c);b=this.b(f.zl,"force square display",h,a,b,c);b=this.b(f.ii+" <0.."+(this.a.sc-1)+">|"+f.hi,"set theme",h,a,b,c);b=this.b(f.Ba+" "+f.Pn+" R G B","set theme background",
h,a,b,c);b=this.b(f.Ba+" "+f.Kl+" R G B","set theme alive color",h,a,b,c);b=this.b(f.Ba+" "+f.On+" R G B","set theme alive ramp",h,a,b,c);b=this.b(f.Ba+" "+f.Ll+" R G B","set theme dead color",h,a,b,c);b=this.b(f.Ba+" "+f.Qn+" R G B","set theme dead ramp",h,a,b,c);b=this.b(f.Ba+" "+f.fm+" R G B","set boundary color",h,a,b,c);b=this.b(f.Ba+" <0..> R G B","set state color",h,a,b,c);b=this.b(f.Ba+" "+f.mn+" R G B","set [R]History state color "+g.nn,h,a,b,c);b=this.b(f.Ba+" "+f.on+" R G B","set [R]History state color "+
g.pn,h,a,b,c);b=this.b(f.Ba+" "+f.Om+" R G B","set [R]History state color "+g.Qm,h,a,b,c);b=this.b(f.Ba+" "+f.Zm+" R G B","set [R]History state color "+g.$m,h,a,b,c);b=this.b(f.Ba+" "+f.cn+" R G B","set [R]History state color "+g.dn,h,a,b,c);b=this.b(f.Ba+" "+f.an+" R G B","set [R]History state color "+g.bn,h,a,b,c);b=this.b(f.Ba+" "+f.Vm+" R G B","set [R]History state color "+g.Wm,h,a,b,c);b=this.b(f.Ba+" "+f.Ih+" R G B","set grid color",h,a,b,c);b=this.b(f.Ba+" "+f.Hh+" R G B","set grid major color",
h,a,b,c);b=this.b(f.Ba+" "+f.ei+" R G B","set star color",h,a,b,c);b=this.b(f.Ba+" "+f.Il+" R G B","set waypoint message color",h,a,b,c);b=this.b(f.Ba+" "+f.Im+" R G B","set graph background color",h,a,b,c);b=this.b(f.Ba+" "+f.Hm+" R G B","set graph axis color",h,a,b,c);b=this.b(f.Ba+" "+f.Gm+" R G B","set graph alive color",h,a,b,c);b=this.b(f.Ba+" "+f.Jm+" R G B","set graph birth color",h,a,b,c);b=this.b(f.Ba+" "+f.Km+" R G B","set graph death color",h,a,b,c);b=this.b(f.nk,"same as "+f.Ba,h,a,b,
c);b=this.b(f.bj+" <"+g.nd+".."+g.hf+">","set steps per second",h,a,b,c);b=this.b(f.Nj+" <"+g.Wf+".."+g.rc+">","set generations per step",h,a,b,c);b=this.b(f.Ai+" <0..359>","set camera angle",h,a,b,c);b=this.b(f.xc+" <-"+(this.a.ib>>1)+".."+(this.a.ib>>1)+">","set camera x position",h,a,b,c);b=this.b(f.yc+" <-"+(this.a.ib>>1)+".."+(this.a.ib>>1)+">","set camera y position",h,a,b,c);b=this.b(f.Ob+" <"+(-1/g.sa).toFixed(1)+".."+g.jb.toFixed(1)+">","set camera zoom",h,a,b,c);b=this.b(f.gk,"same as "+
f.Ob,h,a,b,c);b=this.b(f.qj+" <"+g.vj+".."+g.sj+">","set number of layers",h,a,b,c);b=this.b(f.Ti+" <"+g.uj.toFixed(1)+".."+g.fn.toFixed(1)+">","set layer depth",h,a,b,c);b=this.b(f.Uj+" <-"+(this.a.ib>>1)+".."+(this.a.ib>>1)+">","set pattern x offset",h,a,b,c);b=this.b(f.Vj+" <-"+(this.a.ib>>1)+".."+(this.a.ib>>1)+">","set pattern y offset",h,a,b,c);b=this.b(f.Vl+" <"+g.ae+".."+this.Xb+">","set LifeViewer width",h,a,b,c);b=this.b(f.Lk+" <"+g.wj+".."+g.jn+">","set LifeViewer height",h,a,b,c);b=this.b(f.wl,
"show timing information",h,a,b,c);b=this.b(f.Bk,"extended timing information",h,a,b,c);b=this.b(f.ul,"show generation statistics",h,a,b,c);b=this.b(f.vl,"show information bar",h,a,b,c);b=this.b(f.vk+" <"+g.kn+".."+g.en+">","set boundary delete range",h,a,b,c);b=this.b(f.ll+" <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.lj=this.H;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.Rh&&(b=this.b("Limit Width",this.Xb,h,a,b,c));p=this.a.J;1>p&&(p=-1/p);b=this.b("View","X "+-(this.a.width/2-(this.a.F+this.a.Rc)|0)+"  Y "+-(this.a.height/2-(this.a.A+this.a.tc)|0)+"  Z "+p.toFixed(2)+"  ANGLE "+this.a.angle.toFixed(0),h,a,b,c);p=this.$g;1>p&&(p=1/p);b=this.b("Saved View","X "+-(this.a.width/2-this.Cb|0)+"  Y "+-(this.a.height/2-this.eg|0)+"  Z "+p.toFixed(2)+"  ANGLE "+this.ql.toFixed(0),h,a,b,c);b=this.b("Origin","X "+this.a.Rc.toFixed(2)+"  Y "+this.a.tc.toFixed(2)+
"  Z "+this.a.Ub.toFixed(3),h,a,b,c);this.xb?d=this.Jb?"Multi-State Viewer":"Viewer":this.a.oc&&(d="History Player");b=this.b("Type",d,h,a,b,c);d=this.a.L?"Hex":"Square";b=this.b("Mode",d,h,a,b,c);this.lg&&(b=this.b("Thumbnail","1/"+this.wb,h,a,b,c));b=this.b("","",h,a,b,c);b=this.b("","Pattern:",h,a,b,c);""!==this.tf&&(b=this.b("Name",this.tf,h,a,b,c));""!==this.wf&&(b=this.b("Originator",this.wf,h,a,b,c));b=this.b("Size",this.Qa+" x "+this.nb,h,a,b,c);b=this.b("Offset","X "+this.ga+"  Y "+this.ha,
h,a,b,c);this.af&&(b=this.b("CXRLE Gen",this.$i,h,a,b,c));this.pf&&(b=this.b("CXRLE Pos","X "+this.Af+"  Y "+this.Bf,h,a,b,c));this.Na?d=this.yb:(d=this.yb,""===d&&(d="(none)"));b=this.b("Rule",d,h,a,b,c);""!==this.Pa&&(b=this.b("Alias",this.Pa,h,a,b,c));d=-1!==this.a.Oe?"1D":this.a.Dj?"Hex":this.a.ue?"Von Neumann":"Moore";b=this.b("N'hood",d,h,a,b,c);d=this.fc;2<this.fc&&this.yf!==this.fc&&(d=this.yf+" of "+d);b=this.b("States",d,h,a,b,c);if(this.xf)for(d=1;d<this.fc;d+=1)this.xf[d]&&(b=this.b("State "+
d,this.xf[d],h,a,b,c));b=this.b("Decoder",this.Rd,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.ib+" x "+this.a.ib,h,a,b,c);b=this.b("Area",this.el(),h,a,b,c);b=this.a.i&1?this.b("Tiles",this.a.ji(this.a.oa)+" / "+this.a.ji(this.a.Ca),h,a,b,c):this.b("Tiles",this.a.ji(this.a.U)+" / "+this.a.ji(this.a.Ca),h,a,b,c);this.a.Sd&&(b=this.b("State6",this.a.ji(this.a.Sd),h,a,b,c));b=this.b("Tile Size",(this.a.ki<<
3)+" x "+this.a.li,h,a,b,c);b=this.b("DeleteRange",this.a.Fj,h,a,b,c);b=this.b("","",h,a,b,c);-1!==this.a.Gb&&(b=this.b("","Bounded grid:",h,a,b,c),b=this.b("Type",PatternManager.Co(this.a.Gb),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.Gb&&(b=0===this.a.Ka?this.b("Height","Infinite",h,a,b,c):this.b("Height",this.a.Ka,h,a,b,c),2===this.a.Gb&&(b=this.a.kk?this.b("Twist","Horizontal",h,a,b,c):this.b("Twist","Vertical",h,a,b,c)),0!==this.a.zh&&
(b=this.b("H'Shift",this.a.zh,h,a,b,c)),0!==this.a.Ah&&(b=this.b("V'Shift",this.a.Ah,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.$p(),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.gd?(b=this.b("Mode","Track Box",h,a,b,c),b=this.b("Definition","E "+this.fb.toFixed(3)+"  S "+this.gb.toFixed(3)+"  W "+this.Eb.toFixed(3)+"  N "+
this.zb.toFixed(3),h,a,b,c)):(b=this.b("Mode","Track",h,a,b,c),b=this.b("Definition","X "+this.fb.toFixed(3)+"  Y "+this.gb.toFixed(3),h,a,b,c)));b=this.b("Current","E "+this.Ef.toFixed(3)+"  S "+this.ug.toFixed(3)+"  W "+this.vg.toFixed(3)+"  N "+this.tg.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.Qd?"Off":"On",h,a,b,c);this.Qd||(b=this.b("Snapshots",this.a.Vc.Uq()+"/"+this.a.Vc.ed.length,h,a,b,c),b=this.b("Buffer",(this.a.Vc.bufferSize()>>
10)+"K",h,a,b,c),b=this.b("Next",this.a.Yf,h,a,b,c));b=this.b("","",h,a,b,c);b=this.b("","Engine:",h,a,b,c);b=this.b("Name",g.ao,h,a,b,c);b=this.b("Build",g.Rl,h,a,b,c);b=this.b("Author",g.$n,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.Nb.length,h,a,b,c);b=this.b("Playing",l.Yq(),h,a,b,c);b=this.b("","",h,a,b,c);if(this.Jb)for(b=this.b("","Set:",h,a,b,c),b=this.b("Name",this.ve,h,a,b,c),b=this.b("Used",this.yf,h,a,b,c),d=0;d<k.length;d+=1)this.Ed[d]!==g.El&&(u=this.da(k[d]>>16&255,k[d]>>8&255,k[d]&255),n=String(d),this.Ed[d]!==g.Kn||this.Cf||(n+="*"),this.K(k[d]>>16,k[d]>>8&255,k[d]&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.Ad===this.a.sc?"(custom)":String(this.a.Ad);b=this.b("Name",k,h,a,b,c);this.K(this.a.Uc[0],this.a.Mc[0],this.a.Jc[0],h,a+this.h[0],b,c);b=this.b("Background",this.da(this.a.Uc[0],this.a.Mc[0],this.a.Jc[0]),h,a,b,c);if(-1!==this.a.u)for(d=1;d<this.a.u;d+=1)this.K(this.a.Uc[d],this.a.Mc[d],this.a.Jc[d],h,a+this.h[0],b,c),b=this.b("State "+d,this.da(this.a.Uc[d],this.a.Mc[d],this.a.Jc[d]),h,a,b,c);else this.K(u.Ra.I.red,u.Ra.I.green,u.Ra.I.blue,h,a+this.h[0],
b,c),b=this.b("Alive",this.Te(u.Ra.I),h,a,b,c),u.Ra.I.red!==u.Ra.ba.red||u.Ra.I.green!==u.Ra.ba.green||u.Ra.I.blue!==u.Ra.ba.blue?(this.K(u.Ra.ba.red,u.Ra.ba.green,u.Ra.ba.blue,h,a+this.h[0],b,c),b=this.b("AliveRamp",this.Te(u.Ra.ba),h,a,b,c)):b=this.b("AliveRamp","    (none)",h,a,b,c),this.K(u.La.I.red,u.La.I.green,u.La.I.blue,h,a+this.h[0],b,c),b=this.b("Dead",this.Te(u.La.I),h,a,b,c),u.La.I.red!==u.La.ba.red||u.La.I.green!==u.La.ba.green||u.La.I.blue!==u.La.ba.blue?(this.K(u.La.ba.red,u.La.ba.green,
u.La.ba.blue,h,a+this.h[0],b,c),b=this.b("DeadRamp",this.Te(u.La.ba),h,a,b,c)):b=this.b("DeadRamp","    (none)",h,a,b,c);if(this.a.oc)for(d=3;6>=d;d+=1)p=128+g.Ea[d],u=this.da(this.a.Uc[p],this.a.Mc[p],this.a.Jc[p]),n=g.Eq[d],this.K(this.a.Uc[p],this.a.Mc[p],this.a.Jc[p],h,a+this.h[0],b,c),b=this.b(n,u,h,a,b,c)}this.K(this.Pb[0],this.Pb[1],this.Pb[2],h,a+this.h[0],b,c);b=this.b("Boundary",this.da(this.Pb[0],this.Pb[1],this.Pb[2]),h,a,b,c);this.ia&&(this.K(this.ia[0],this.ia[1],this.ia[2],h,a+this.h[0],
b,c),b=this.b("Text",this.da(this.ia[0],this.ia[1],this.ia[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.ne()&&(k+=" (Hidden)");b=this.b("Enabled",k,h,a,b,c);k="Line Color";-1!==this.xe&&(k+="*");this.K(this.a.Oc>>16,this.a.Oc>>8&255,this.a.Oc&255,h,a+this.h[0],b,c);b=this.b(k,this.da(this.a.Oc>>16,this.a.Oc>>8&255,this.a.Oc&255),h,a,b,c);k="Major Color";-1!==this.Ce&&(k+="*");this.K(this.a.Kd>>16,this.a.Kd>>8&255,this.a.Kd&255,
h,a+this.h[0],b,c);b=this.b(k,this.da(this.a.Kd>>16,this.a.Kd>>8&255,this.a.Kd&255),h,a,b,c);k=0<this.a.Nc&&this.a.bf?String(this.a.Nc):"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.Kb?"On":"Off",h,a,b,c);b=this.b("Disabled",this.Lc?"On":"Off",h,a,b,c);b=this.b("Mode",this.qd?"Lines":"Points",h,a,b,c);b=this.b("Opacity",this.bb.toFixed(2),h,a,b,c);this.K(this.a.Hd[0],this.a.Hd[1],this.a.Hd[2],h,a+this.h[0],b,c);b=this.b("Bg Color",
this.da(this.a.Hd[0],this.a.Hd[1],this.a.Hd[2]),h,a,b,c);this.K(this.a.Gd[0],this.a.Gd[1],this.a.Gd[2],h,a+this.h[0],b,c);b=this.b("Axis Color",this.da(this.a.Gd[0],this.a.Gd[1],this.a.Gd[2]),h,a,b,c);this.K(this.a.Fd[0],this.a.Fd[1],this.a.Fd[2],h,a+this.h[0],b,c);b=this.b("Alive Color",this.da(this.a.Fd[0],this.a.Fd[1],this.a.Fd[2]),h,a,b,c);this.K(this.a.Id[0],this.a.Id[1],this.a.Id[2],h,a+this.h[0],b,c);b=this.b("Birth Color",this.da(this.a.Id[0],this.a.Id[1],this.a.Id[2]),h,a,b,c);this.K(this.a.Jd[0],
this.a.Jd[1],this.a.Jd[2],h,a+this.h[0],b,c);b=this.b("Death Color",this.da(this.a.Jd[0],this.a.Jd[1],this.a.Jd[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.uh?"On":"Off",h,a,b,c);b=this.b("Seed",this.kh,h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("","Stars:",h,a,b,c);b=this.b("Enabled",this.dh?"On":"Off",h,a,b,c);this.K(this.$a.red,this.$a.green,this.$a.blue,h,a+this.h[0],b,c);b=this.b("Color",this.Te(this.$a),h,a,b,c);b=this.b("","",h,a,b,c);b=this.b("",
"Script:",h,a,b,c);b=this.b("Commands",this.Je,h,a,b,c);b=this.b("Errors",this.sh,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.mb?"Off":"On",h,a,b,c),b=this.b("Number",this.V.ja.length,h,a,b,c),d=0;d<this.V.ja.length;d+=1)k=String(d),d===this.V.uf&&(k=this.V.ik(this.elapsedTime)?k+">":k+"*"),b=this.b(k,this.V.$q(d,f.lb),h,a,b,c);if(this.V.Sc.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.Sc.length,h,a,b,c),d=0;d<this.V.Sc.length;d+=1)k=String(d),b=this.b(k,this.V.Up(d,f.lb),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.zj+"\t"+(this.a.l.ih>>20)+"M\t"+this.a.l.ih,h,a,b,c);b=this.b("Frees",this.a.l.Aj+"\t"+(this.a.l.jh>>20)+"M\t"+this.a.l.jh,h,a,b,c);b=this.b("In Use",this.a.l.zj-
this.a.l.Aj+"\t"+(this.a.l.ih-this.a.l.jh>>20)+"M\t"+(this.a.l.ih-this.a.l.jh),h,a,b,c);b=this.b(this.Vi("Bytes"),"Type\tElements\tName\tCount",h,a,b,c);for(d=0;d<this.a.l.Hc.length;d+=1)b=this.b(this.Vi(String(this.a.l.Hc[d].size)),this.a.l.yo(d),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(d=0;d<AliasManager.c.length;d+=1)""===AliasManager.c[d][1]?(b=this.b("","",h,a,b,c),b=this.b("",AliasManager.c[d][0]+" Aliases:",h,a,b,c)):""!==AliasManager.c[d][0]&&
(b=this.b(AliasManager.c[d][0],AliasManager.c[d][1],h,a,b,c));this.Yg=this.H-1;this.H=1;this.h[0]=120;b=e+19*(this.Va+2);b=this.lo(h,a,b);this.kd?this.b("H","close help",h,a,b,0):this.b("H / Esc","close help",h,a,b,0)};r.prototype.zm=function(b){var a=b.Tb;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.jj;b.nl(a,6,14,b.B|0);a.fillStyle=g.Jh;b.nl(a,4,12,b.B|0)};r.prototype.ko=function(b,a,c){var h=c,d=0,f=!1,e=this.H;
"#000000"===b.fillStyle&&(f=!0);0<=e&&e<=0+this.Va&&(b.font=g.Xi,f||(b.fillStyle=1<(this.na|0)?g.Eh:g.dj),b.fillText("Up",a,c),f||(b.fillStyle=g.Eh),b.fillText(" / ",a+b.measureText("Up").width,c),f||(b.fillStyle=(this.na|0)<this.Db.length-this.Va?g.Eh:g.dj),b.fillText("Down",a+b.measureText("Up / ").width,c),this.h[0]&&(d=this.h[0]),f||(b.fillStyle=g.Eh),b.font=g.qg,b.fillText("scroll errors",a+d,c),h+=19);return h};r.prototype.Ag=function(b,a,c,d,f,e){var h=f,u=0,l=this.H;l>=e&&l<=e+this.Va&&(b.length&&
(c.font=g.Xi,c.fillText(b,d,f),u=c.measureText(b+" ").width),this.h[0]&&(u=this.h[0]),c.font=g.qg,c.fillText(a,d+u,f),h+=19);this.H+=1;return h};r.prototype.wn=function(b,a,c,d){var h,f=this.Db,e=c;this.H=1;this.h[0]=0;b.font=g.qg;c=this.Ag("",g.uq,b,a,c,d);for(h=0;h<f.length;h+=1)c=this.Ag(f[h][0],f[h][1],b,a,c,d);this.Z||(this.h[0]=120,this.H=1,c=e+19*(this.Va+2),c=this.ko(b,a,c),c=this.Ag("Esc","clear messages",b,a,c,0),this.Ag("H  ","help on script commands",b,a,c,0))};r.prototype.ym=function(b){var a=
b.Tb,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.jj;b.wn(a,6,14,b.na|0);a.fillStyle=g.Eh;b.wn(a,4,12,b.na|0)};r.prototype.Dg=function(b,a){var c=this.g.ze,h=this.g.Ae,d=b+a,f=-this.a.angle,e=Math.sin(f/180*Math.PI),f=Math.cos(f/180*Math.PI);0>d?d=0:1<d&&(d=1);b=g.sa*Math.pow(g.jb/g.sa,b);d=g.sa*Math.pow(g.jb/g.sa,d);d<g.sa?d=g.sa:d>g.jb&&(d=g.jb);c-=this.s/2;h-=this.m/2;c=(c-d/b*c)/d;h=(h-d/b*h)/
d;this.a.F-=c*f+h*-e;this.a.A-=c*e+h*f;d=Math.log(d/g.sa)/Math.log(g.jb/g.sa);this.za.current=this.ke([d,d],!0,this)};r.prototype.Rq=function(b,a){b.rd.current=b.a.i/a*100;b.rd.j=!1;b.nc.cd=0};r.prototype.Qq=function(b){var a=!1,c=!1,h=0,d;b.qa||-1===b.ka||(a=!0);!b.mb&&b.eb&&(c=!0);if(a||c){d=!1;if(c&&a)h=b.elapsedTime/b.V.Cm(b.ka);else if(c){if(a=b.V.Ep().cb)h=b.elapsedTime/a,1<h&&(d=!0)}else 0<b.ka&&(h=b.a.i/b.ka);1<h&&(h=1);b.rd.current=100*h}else d=!0;(b.rd.j=d)?b.nc.cd=b.w.cd:b.nc.cd=0};r.prototype.ip=
function(){this.$a.Mo(this.a.width/2-this.a.qb,this.a.height/2-this.a.rb,this.a.J,this.a.pb,this.a.s,this.a.m,this.a.Yb,this.a.ee[0])};r.prototype.Ek=function(b,a){b+=this.a.width/2-Math.round(this.Qa/2);a+=this.a.height/2-Math.round(this.nb/2);return this.a.Ek(b,a,this.Jb&&this.xb)};r.prototype.Aq=function(){var b=this.w.mf-this.m/2,a=Math.floor(b/this.a.zoom-(this.a.height/2-this.a.A)+Math.round(this.nb/2)),c=Math.floor((this.w.be-this.s/2)/this.a.zoom+(this.a.L?b/this.a.zoom/2:0)-(this.a.width/
2-this.a.F-(this.a.L?this.a.A/2:0))+Math.round(this.Qa/2)),d;-1===this.w.be||0!==this.a.pb?(this.Fb.kb="",this.Fb.j=!this.Xc):(b=-9999>c||9999<c?(c/1E4).toFixed(1)+"K":c+"",d=-9999>a||9999<a?(a/1E4).toFixed(1)+"K":a+"",a=this.Ek(c,a),this.Fb.kb=b+","+d+"="+a,this.Fb.j=!1);this.Fb.enabled=this.Xc||this.S.current===g.Ja&&-1!==this.w.be?this.B||this.na||!this.Qa?!1:!0:!1};r.prototype.Zp=function(b){var a;0<this.B?0<b?this.Kj(this,3):this.Jj(this,3):0<this.na?0<b?this.Ij(this,3):this.Hj(this,3):this.ab||
(a=this.za.current[0],0>b?this.Dg(a,-.05):this.Dg(a,.05))};r.prototype.Xq=function(b,a){var c,h;h=a.V.current;var d,f=!1,e=!1,l=!1;a.ab=!1;c=a.elapsedTime-a.Nh;a.Sk&&(a.Sk=!1,b=c=0);a.xb||a.Qq(a);a.S.current!==g.Ja?(b>g.Em&&(b=g.Em,e=!0),a.elapsedTime+=b,a.Xd+=b,a.tb&&(c>1E3/a.sb||a.sb===g.hf)&&(a.Nh=a.elapsedTime,a.ce=!0)):a.ce&&(a.elapsedTime=1E3*(a.a.i+1)/a.sb,a.Xd+=1E3/a.sb,a.Nh=a.elapsedTime);a.Pl();a.ce&&(a.oj=a.elapsedTime);a.G=a.Wa.current[0];a.eb&&!a.mb&&a.S.current!==g.Ja?(a.qc&&!a.V.ik(a.elapsedTime)&&
(a.qc=!1,a.elapsedTime=a.V.qm(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.pc*g.Of,a.a.Ad,a.sb,a.G,a.a.i,a.elapsedTime)),h.$b&&(a.Yd(!0,!1),a.qc=!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.wb),h.zoom=a.a.zoom),(l=a.V.update(a.elapsedTime,a.a.i))?h.$b&&(h.$b=!1,a.Z&&(a.a.zoom=h.zoom/a.wb),a.za&&(a.za.current=a.ke([a.a.zoom,a.a.zoom],!1,a))):(a.S.current!==g.Ja&&(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.wb),a.za&&(a.za.current=a.ke([a.a.zoom,a.a.zoom],!1,a)),a.a.angle=h.angle,a.ua&&(a.ua.current=[a.a.angle,a.a.angle]),a.a.o=h.o,a.ub&&(a.ub.current=[a.a.o,a.a.o]),a.a.pc=h.depth/g.Of+g.uj,a.Ma&&(a.Ma.current=[Math.sqrt(a.a.pc),a.a.pc*g.Of]),a.sb=h.Ta,a.ca&&(a.ca.current=[Math.sqrt((h.Ta-g.nd)/(g.hf-g.nd)),h.Ta]),a.G=h.step,a.Wa.current=[a.G,a.G],h.xa>a.a.i?(a.ce=!0,a.G=h.xa-a.a.i|0,1>a.G&&(a.G=1),a.G>g.rc&&(a.G=g.rc)):a.ce=!1,h.Vb!==a.pj&&(""===h.Vb?a.g.notification.clear(!1,!1):a.g.notification.D(h.Vb,
1E3,!1),a.pj=h.Vb),h.Xa!==a.Xk&&(a.a.Ke(h.Xa,a.a.mm),a.Mb&&(a.Mb.current=[h.Xa,h.Xa]),a.Xk=h.Xa))):a.Sa&&a.S.current!==g.Ja&&(a.ab=!0);a.ab&&(a.vc=-1);c=0;if(a.ce){if(a.X){h=performance.now();for(d=0;d<a.G;d+=1){c=performance.now()-h;if(a.a.i===a.Td-1||c>g.Zn||a.yl)d=a.G-1;a.Xc&&d===a.G-1?a.a.Xf(!0,a.elapsedTime,a.Qd,a.Lc):a.a.Xf(!1,a.elapsedTime,a.Qd,a.Lc);if(a.a.Rn||d===a.G-1)a.X=a.a.Hg();-1!==a.ka&&a.a.i>=a.ka&&!a.qa&&(a.elapsedTime=0,a.reset(a),l&&(a.ab=!0));a.X||(d=a.G-1)}a.X||(a.Ck=g.np,a.wk=
a.a.i,a.Fh&&(-1===a.ka||a.qa)&&a.g.notification.D("Life ended at generation "+a.wk,600,!0))}else a.Ck&&(--a.Ck,h=a.a.i,a.a.i=a.wk,a.a.Hg(),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.Td&&(a.S.current=a.Yc(g.Ja,!0,a),a.Fh&&a.g.notification.D("STOP reached - Play to continue ",180,!0))}a.me.locked=a.ab&&a.eb;a.Sf.locked=a.ab;a.ca.locked=a.ab&&a.eb;a.Wa.locked=a.ab&&a.eb;a.Mb.locked=a.ab&&a.eb;a.za.locked=a.ab;a.ua.locked=a.ab;a.ub.locked=a.ab&&
a.eb;a.Ma.locked=a.ab&&a.eb;a.wheelDelta&&(a.Zp(a.wheelDelta),a.wheelDelta=0);a.Sa&&(a.S.current!==g.Ja||a.eb)&&a.Yd(!1,!1);a.a.eq();a.dh&&a.ip();a.a.yk();a.ai&&(2===a.ai&&a.a.Am(a.qd,1,!0,a.Z),a.Fo(a),2===a.ai&&a.a.yk(),a.ai=0);a.a.i&&a.X&&a.a.Ho(g.rc)&&(a.Hb+=a.a.width>>2,a.Ng+=a.a.height>>2,a.Cb+=a.a.width>>2,a.eg+=a.a.height>>2,a.a.L&&(a.Hb-=a.a.height>>3,a.Cb-=a.a.height>>3));a.Kb&&a.a.Am(a.qd,a.bb,!1,a.Z);a.B?a.zm(a):a.Db.length&&a.ym(a);a.nc.lower[0]=a.aj?"+ "+a.ci(a.a.i):"T "+a.ci(a.a.i+a.$i);
a.Qf.kb=a.zo(a.Xd);a.dg.kb=a.ci(a.a.cc);a.Gf.kb=a.ci(a.a.lc);a.Mf.kb=a.ci(a.a.mc);c>g.Zn?(a.de+=g.rn,a.de>=2*g.gl&&(a.de=0)):0<a.de&&(a.de-=g.rn);e?a.Ge<g.Sp&&(a.Ge+=g.sn):a.Ge>g.Tp&&(a.Ge-=g.sn);c=a.de<g.gl?"rgb("+a.Ge+","+a.de+",0)":"rgb("+a.Ge+","+(2*g.gl-a.de)+",0)";a.Wa.yd=c;c="rgb("+a.Ge+",0,0)";a.ca.yd=c;a.ce=!1;a.yl=!1;a.Aq();-1!==a.vc&&a.Xn();if(a.tb||a.Sa&&a.Ff>a.Ao||-1!==a.vc)f=!0;a.Mq();a.Sq();a.Nq();a.Tq(a.B||a.Db.length);a.g.rf(f)};r.prototype.Pl=function(){var a=this.a.i,b=(this.elapsedTime-
this.oj)/1E3*this.sb;0>b?b=0:1<b&&(b=1);a+=b;this.Ya&&!this.Za?(this.a.Rc=a*(this.fb+this.Eb)/2,this.a.tc=a*(this.zb+this.gb)/2,b=this.a.fo(0,this.zb,this.fb,this.gb,this.Eb,this.s,this.m-80,g.sa,g.jb,g.Wj),a=this.a.fo(a,this.zb,this.fb,this.gb,this.Eb,this.s,this.m-80,g.sa,g.jb,g.Wj),this.a.Ub=a/b):(this.a.Rc=0,this.a.tc=0,this.a.Ub=1);this.za.current=this.ke([this.a.zoom,this.a.zoom],!1,this)};r.prototype.Tq=function(a){this.me.j=a;this.za.j=a||this.Kb;this.Sf.j=a;this.Uf.j=a;this.Cd.j=a||this.Kb;
this.Od.j=a||this.Kb;this.Ga.j=a||this.Kb;this.Ld.j=a||this.Kb;this.Md.j=a||!this.Kb;this.ph.j=a||!this.Kb;this.Vg.j=a||!this.Kb;this.Ve.j=a;this.Qf.j=a;this.zf.j=a;this.dg.j=a;this.$d.j=a;this.Gf.j=a;this.Ee.j=a;this.Mf.j=a;this.gc.j=a;this.ua.j=a||this.a.L;this.Ma.j=a;this.Mb.j=a;this.ub.j=a;this.Sf.j=a;this.Ue.j=a||!this.lg;this.Df.j=a||!this.kd;this.Tf.j=a;this.He.j=a||!this.fa;this.Fc.j=a||!this.fa;this.Ie.j=a||!this.fa;this.Ac.j=a||!this.fa;this.Fe.j=a||!this.fa;this.kc.j=a||!this.fa;this.qh.j=
a||!this.fa;this.wg.j=a||!this.fa;this.yg.j=a||!this.fa;this.zg.j=a||!this.fa;this.xg.j=a||!this.fa;this.Bc.j=a||!this.fa;this.Dc.j=a||!this.fa;this.Ec.j=a||!this.fa;this.Cc.j=a||!this.fa};r.prototype.Nq=function(){var a=-(this.a.width/2-this.a.F-this.a.Rc|0),b=-(this.a.height/2-this.a.A-this.a.tc|0);this.He.j=!this.fa;this.Fc.j=!this.fa;this.Ie.j=!this.fa;this.Ac.j=!this.fa;this.Fe.j=!this.fa;this.kc.j=!this.fa;this.qh.j=!this.fa;this.wg.j=!this.fa;this.yg.j=!this.fa;this.zg.j=!this.fa;this.xg.j=
!this.fa;this.Bc.j=!this.fa;this.Dc.j=!this.fa;this.Cc.j=!this.fa;this.Ec.j=!this.fa;if(-99999>a||99999<a)a=(a/1E3|0)+"K";if(-99999>b||99999<b)b=(b/1E3|0)+"K";this.Fc.kb=a;this.Ac.kb=b;this.kc.kb=this.a.angle.toFixed(0)+"\u00b0";this.Bc.kb=this.Ef.toFixed(3);this.Dc.kb=this.ug.toFixed(3);this.Ec.kb=this.vg.toFixed(3);this.Cc.kb=this.tg.toFixed(3)};r.prototype.Sq=function(){0===this.a.i?this.vg=this.Ef=this.ug=this.tg=0:(this.ug=(this.a.C.R-this.a.ac.R)/this.a.i,this.tg=(this.a.C.N-this.a.ac.N)/this.a.i,
this.Ef=(this.a.C.P-this.a.ac.P)/this.a.i,this.vg=(this.a.C.O-this.a.ac.O)/this.a.i)};r.prototype.Mq=function(){this.me.current=[this.Sa];this.Cd.current=[!this.Xe&&this.wd];this.Cd.locked=!this.wd;this.Ya?(this.Ga.lower[0]="TRACK",this.Ga.current=[!this.Za&&this.Ya],this.Ga.locked=!this.Ya,this.Ga.M=["toggle track mode"]):(this.Ga.lower[0]="WAYPT",this.Ga.current=[!this.mb&&this.eb],this.Ga.locked=!this.eb,this.Ga.M=["toggle waypoint mode"]);this.Ld.current=[!this.qa&&-1!==this.ka];this.Ld.locked=
-1===this.ka;this.Od.current=[-1!==this.Td];this.Od.locked=-1===this.Td};r.prototype.Wq=function(a){for(var b=a.om,c=performance.now(),h,d=a.a.Vc.Ip*LifeConstants.di;a.a.i<b-1&&13>performance.now()-c;)h=b-1-a.a.i<=d?!1:!0,a.a.Xf(!1,0,h,a.Lc),a.a.Hg();a.a.i===b-1?(a.a.Xf(a.Xc,0,!1,a.Lc),a.X=a.a.Hg(),a.Gg=!1,a.g.notification.clear(!0,!1),a.w.locked=!1):a.w.locked=!0;a.Rq(a,b);a.a.yk();a.B?a.zm(a):a.Db.length&&a.ym(a);a.g.rf(!0)};r.prototype.to=function(a,b){b.Gg?b.Wq(b):b.Xq(a,b)};r.prototype.Tl=function(a){a.a.i=
0;a.elapsedTime=0;a.Xd=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.Nh=0;a.oj=0;a.X=!0;a.Sk=!0};r.prototype.Tj=function(a,b,c){b&&(c.g.gg=a[0]);c.g.rf(!0);return[c.g.gg]};r.prototype.bo=function(a,b,c){b?(b=a[0]+.5|0,c.a.Ad!==b&&(c.a.Ke(b,c.a.mm),c.Jf&&b===c.a.sc?c.g.notification.D("Custom Theme",40,!0):c.g.notification.D("Theme "+b,40,!0)),a=a[0]):a=c.a.Ad;return[a,c.a.Ad]};r.prototype.sg=function(a,b,c){b&&(c.G=a[0]+.5|0);return[c.G,c.G]};r.prototype.Ne=function(a,
b,c){b?(c.sb=g.nd+a[0]*a[0]*(g.hf-g.nd),a=a[0]):a=Math.sqrt((c.sb-g.nd)/(g.hf-g.nd));return[a,c.sb]};r.prototype.Cn=function(a){a.$g=a.a.zoom;a.Z&&(a.$g=a.$g*a.wb);a.ql=a.a.angle;a.Cb=a.a.F;a.eg=a.a.A};r.prototype.kq=function(a){a.ig=a.a.width/2-a.a.F;a.jg=a.a.height/2-a.a.A;a.gh=a.a.zoom;a.hg=a.a.angle;a.$e=a.a.width/2-a.Cb;a.Og=a.a.height/2-a.eg;a.Dh=a.ql;a.Z?a.Rf=a.$g/a.wb:a.Rf=a.$g;a.vc=0};r.prototype.hq=function(a,b){var c;a.a.zoom=a.xm;a.Z&&(a.a.zoom=a.a.zoom/a.wb);a.za&&(a.za.current=a.ke([a.a.zoom,
a.a.zoom],!1,a));a.a.angle=a.Kg;a.ua&&(a.ua.current=[a.Kg,a.Kg]);a.a.F=a.Hb;a.a.A=a.Ng;b&&(a.a.Ke(a.Nf,1),a.Mb.current=[a.Nf,a.Nf],a.Jb&&(a.a.Hf=0),c=Math.sqrt((a.uk-g.nd)/(g.hf-g.nd)),a.ca.current=a.Ne([c,c],!0,a),a.G=a.Si,a.Wa.current=[a.G,a.G],a.a.o=a.Mg,a.ub.current=[a.Mg,a.Mg],c=Math.sqrt(a.tk),a.Ma.current=a.rg([c,c],!0,a))};r.prototype.fk=function(a){a?(this.a.F+=this.a.Rc,this.a.A+=this.a.tc,this.a.zoom*=this.a.Ub):(this.Pl(),this.a.F-=this.a.Rc,this.a.A-=this.a.tc,this.a.zoom/=this.a.Ub,
this.Pl());this.a.zoom<g.sa?this.a.zoom=g.sa:this.a.zoom>g.jb&&(this.a.zoom=g.jb)};r.prototype.reset=function(a){var b=!1,c=!1;if(0===a.elapsedTime||a.hj)b=!0;a.qa||a.a.i===a.ka&&(c=!0);c||b||(a.eb&&(a.mb=!0),a.Ya&&(a.Za=!0),-1!==a.ka&&(a.qa=!0),a.Bi&&(a.Sa=!1));a.elapsedTime=0;a.Xd=0;a.Nh=0;a.oj=0;a.a.Rc=0;a.a.tc=0;a.a.Ub=1;b&&(c||a.hq(a,b),a.eb&&(a.mb=!1),a.Ya&&(a.Za=!1),a.qa=!1,a.Bi&&(a.Sa=!0));a.Jb||(a.a.ol(a.Qd),a.X=!0,a.a.X=!0,a.a.Kc=!0);a.a.yn();a.a.xn();a.pj="";a.Xk=-1;a.qc=!1;a.V.uf=0;a.g.notification.clear(!1,
!1)};r.prototype.Fn=function(a){a?(this.S.icon[2]=g.Da.icon("pause"),this.S.M[2]="pause"):(this.S.icon[2]=g.Da.icon("stepforward"),this.S.M[2]="next generation")};r.prototype.Yc=function(a,b,c){var h=a,d=c.qa,f=c.mb,e=c.Xe,l=c.Sa,m=c.Za,k=40,n=0,p=0,q=0,z=0,u=0;if(b){switch(a){case g.Zk:c.Xe=c.hj||c.wd&&0===c.a.i&&0===c.elapsedTime?!1:!0;c.wd&&!c.Xe?(a=g.Xg,c.tb=!0):(a=g.Ja,c.tb=!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.mb&&
f&&(p=1);c.mb&&!f&&(p=-1);!c.Za&&m&&(q=1);c.Za&&!m&&(q=-1);!c.Xe&&e&&c.wd&&(z=1);c.Xe&&!e&&c.wd&&(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.D(b,k,!0);break;case g.Xg:c.S.current!==g.Xg&&(c.tb=!0,c.g.notification.D("Play",40,!0));break;case g.Op:c.tb?(c.tb=!1,c.g.notification.D("Pause",40,!0)):0<c.a.i&&c.Yh(c.a.i-
c.G);a=g.Ja;break;case g.Ja:c.tb?(c.tb=!1,(c.a.i!==c.Td||c.Fh)&&c.g.notification.D("Pause",40,!0)):c.ce=!0}h=a;c.Fn(c.tb)}return h};r.prototype.ui=function(a,b,c){b&&(c.qc=!0,c.a.angle=a[0]);return[c.a.angle,c.a.angle]};r.prototype.Sl=function(a,b,c){b?(c.qc=!0,c.a.o=a[0]+.5|0,a=a[0]):a=c.a.o;return[a,c.a.o]};r.prototype.rg=function(a,b,c){return b?(c.qc=!0,c.a.pc=a[0]*a[0],[a[0],c.a.pc*g.Of]):[Math.sqrt(c.a.pc),c.a.pc*g.Of]};r.prototype.rj=function(a,b,c,d){var h,f,e;c?(-1!==d.Tg&&(d.B?(h=d.Ug-b,
h/=g.fontSize,0<h?d.Jj(d,h):0>h&&d.Kj(d,-h)):d.na?(h=d.Ug-b,h/=g.fontSize,0<h?d.Hj(d,h):0>h&&d.Ij(d,-h)):(c=(d.Tg-a)/d.a.J,h=(d.Ug-b)/d.a.J,f=d.a.L?0:-d.a.angle,e=Math.sin(f/180*Math.PI),f=Math.cos(f/180*Math.PI),d.ab||(d.qc=!0,d.a.F+=c*f+h*-e,d.a.A+=c*e+h*f))),d.Tg=a,d.Ug=b):(d.Tg=-1,d.Ug=-1)};r.prototype.nf=function(a,b){this.Ug=this.Tg=0;this.rj(a,b,!0,this);this.Tg=-1};r.prototype.Lq=function(a){var b=g.Rm;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.Rm=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.Yn=function(){this.Uf.icon=this.a.L?[g.Da.icon("hexgrid")]:[g.Da.icon("grid")]};r.prototype.tj=function(a,b){a.g.hasFocus&&(a.Gg||(b.wheelDelta?a.wheelDelta=
b.wheelDelta/120:b.detail&&(a.wheelDelta=-b.detail/3),a.g.rf(!0)),b.preventDefault())};r.prototype.Xn=function(){var a=this.V.dm(this.vc/g.dl),b=this.hg,c=this.Dh;this.a.F=this.a.width/2-(this.ig+a*(this.$e-this.ig));this.a.A=this.a.height/2-(this.jg+a*(this.Og-this.jg));this.a.zoom=this.gh*Math.pow(this.Rf/this.gh,a);180<c-b?b+=360:-180>c-b&&(c+=360);this.a.angle=(b+a*(c-b))%360;this.vc+=1;this.vc>g.dl&&(this.vc=-1,this.a.zoom=this.Rf,this.a.angle=c,this.a.F=this.a.width/2-this.$e,this.a.A=this.a.height/
2-this.Og);this.za&&(this.za.current=this.ke([this.a.zoom,this.a.zoom],!1,this));this.ua&&(this.ua.current=this.ui([this.a.angle,this.a.angle],!1,this))};r.prototype.vq=function(a,b){var c=this.V.Sc[b];a.ig=a.a.width/2-a.a.F;a.jg=a.a.height/2-a.a.A;a.gh=a.a.zoom;a.hg=a.a.angle;a.$e=c.x;a.Og=c.y;a.Rf=c.zoom;a.Dh=c.angle;a.a.L&&(a.$e+=a.a.A/2);a.vc=0;a.g.notification.D("POI "+b,60,!0);""!==c.Vb?a.g.notification.D(c.Vb,180,!1):a.g.notification.clear(!1,!0)};r.prototype.zd=function(a,b,c){var h=b/a.a.Ub;
c&&(b=1<=b?Math.round(b):1/Math.round(1/b),h=b/a.a.Ub);a.ab||(a.ig=a.a.width/2-a.a.F,a.jg=a.a.height/2-a.a.A,a.gh=a.a.zoom,a.hg=a.a.angle,a.$e=a.ig,a.Og=a.jg,a.Rf=h,a.Dh=a.hg,a.vc=0)};r.prototype.dr=function(a){a.Kb=!1};r.prototype.aq=function(){p()};r.prototype.no=function(a){a.Hl();a.B&&(a.B=0);a.resize();a.pd.current[0]=!1;a.g.ng=!0};r.prototype.ar=function(a){a.Yd(!0,!0);a.S.current===g.Ja&&(a.qc=!0)};r.prototype.Un=function(a,b,c){b&&(c.a.Bb=a[0],c.g.notification.D("Grid Lines "+(c.a.Bb?"On":
"Off"),40,!0));return[c.a.Bb]};r.prototype.Vn=function(a,b,c){b&&(c.qd=a[0]);return[c.qd]};r.prototype.Tn=function(a,b,c){b&&(c.Sa=a[0],c.g.notification.D("AutoFit "+(c.Sa?"On":"Off"),40,!0),c.Sa&&c.S.current===g.Ja&&c.Yd(!0,!0));return[c.Sa]};r.prototype.po=function(a,b,c){b&&-1!==c.ka&&(c.qa=!a[0],c.eb?(c.mb=c.qa,c.g.notification.D("Loop and Waypoints "+(c.qa?"Off":"On"),40,!0)):c.Ya?(c.Za=c.qa,c.g.notification.D("Loop and Track "+(c.qa?"Off":"On"),40,!0),c.fk(c.Za)):c.g.notification.D("Loop "+
(c.qa?"Off":"On"),40,!0));return[c.qa]};r.prototype.qo=function(a,b,c){b&&(c.Ya?(c.Za=!a[0],c.fk(c.Za),-1!==c.ka?(c.qa=c.Za,c.g.notification.D("Loop and Track "+(c.qa?"Off":"On"),40,!0)):c.g.notification.D("Track "+(c.Za?"Off":"On"),40,!0)):c.eb&&(c.mb=!a[0],-1!==c.ka?(c.qa=c.mb,c.g.notification.D("Loop and Waypoints "+(c.qa?"Off":"On"),40,!0)):c.g.notification.D("Waypoints "+(c.mb?"Off":"On"),40,!0)));return c.Ya?[c.Za]:[c.mb]};r.prototype.ni=function(a,b,c){b&&(c.B=a[0]);return[c.B]};r.prototype.Ul=
function(a,b,c){b&&(c.Xc=a[0],c.Xc&&(c.X?0===c.a.i?(c.a.cc=c.a.ge.cc,c.a.lc=c.a.ge.lc,c.a.mc=c.a.ge.mc):-1===c.a.u&&(--c.a.i,c.a.Xf(!0,c.elapsedTime,c.Qd,c.Lc)):(c.a.cc=0,c.a.lc=0,c.a.mc=0)));c.g.rf(!0);return[c.Xc]};r.prototype.Ij=function(a,b){1<a.na&&(a.na-=b,1>a.na&&(a.na=1))};r.prototype.Hj=function(a,b){a.na<a.Db.length-a.Va&&(a.na+=b,a.na>a.Db.length-a.Va&&(a.na=a.Db.length-a.Va))};r.prototype.Kj=function(a,b){1<a.B&&(a.B-=b,1>a.B&&(a.B=1))};r.prototype.Jj=function(a,b){a.B<a.Yg-a.Va&&(a.B+=
b,a.B>a.Yg-a.Va&&(a.B=a.Yg-a.Va))};r.prototype.Yh=function(a){this.Qd?this.g.notification.D("Step back disabled",40,!0):(0>a&&(a=0),this.elapsedTime-=1E3/this.sb,this.Xd-=1E3/this.sb,this.X=this.a.Yh(a,this.Xc,this.elapsedTime,this.Lc),a!==this.a.i&&(this.Gg=!0,this.om=a,this.a.ol(!1),this.g.notification.D("Computing previous generations",1E4,!0)))};r.prototype.Xp=function(a,b,c){var d=!0;if(c.ctrlKey||c.metaKey||c.altKey)b=-1;switch(b){case 191:case 111:c.shiftKey?a.a.Dj!==a.a.L&&(a.a.L?(a.a.F+=
a.a.A/2,a.Hb+=a.a.A/2,a.Cb+=a.a.A/2,a.a.L=!1):(a.a.F-=a.a.A/2,a.Hb-=a.a.A/2,a.Cb-=a.a.A/2,a.a.L=!0)):a.a.L?(a.a.F+=a.a.A/2,a.Hb+=a.a.A/2,a.Cb+=a.a.A/2,a.a.L=!1):(a.a.F-=a.a.A/2,a.Hb-=a.a.A/2,a.Cb-=a.a.A/2,a.a.L=!0);a.g.notification.D("Hex Display "+(a.a.L?"On":"Off"),40,!0);a.Yn();a.ua.j=a.a.L;break;case 66:a.xb||(a.S.current===g.Ja?0<a.a.i&&a.Yh(a.a.i-1):a.S.current=a.Yc(g.Ja,!0,a));break;case 13:a.xb||(a.S.current=a.S.current===g.Xg?a.Yc(g.Ja,!0,a):a.Yc(g.Xg,!0,a));break;case 9:a.xb||(a.tb?a.S.current=
a.Yc(g.Ja,!0,a):c.shiftKey?0<a.a.i&&a.Yh(a.a.i-a.G):a.ce=!0);break;case 32:a.xb||(a.tb?a.S.current=a.Yc(g.Ja,!0,a):(a.ce=!0,a.yl=!0));break;case 87:a.eb?(a.mb=!a.mb,-1!==a.ka?(a.qa=a.mb,a.g.notification.D("Loop and Waypoints "+(a.mb?"Off":"On"),40,!0)):a.g.notification.D("Waypoints "+(a.mb?"Off":"On"),40,!0),a.mb?a.g.notification.clear(!1,!1):a.V.ik(a.elapsedTime)||(a.V.op(a.a.i),a.elapsedTime=a.V.Cm(a.a.i),a.elapsedTime=a.V.qm(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.pc*
g.Of,a.a.Ad,a.sb,a.G,a.a.i,a.elapsedTime),a.qc=!1)):a.Ya?(a.Za=!a.Za,-1!==a.ka?(a.qa=a.Za,a.g.notification.D("Loop and Track "+(a.Za?"Off":"On"),40,!0)):a.g.notification.D("Track "+(a.Za?"Off":"On"),40,!0),a.fk(a.Za)):-1!==a.ka&&(a.qa=!a.qa,a.g.notification.D("Loop "+(a.qa?"Off":"On"),40,!0));break;case 69:!a.Wa.locked&&a.G<g.rc&&(c.shiftKey?a.G=g.rc:a.G+=1,a.Wa.current=a.sg([a.G,a.G],!0,a));break;case 68:!a.Wa.locked&&a.G>g.Wf&&(c.shiftKey?a.G=g.Wf:--a.G,a.Wa.current=a.sg([a.G,a.G],!0,a));break;
case 90:c.shiftKey?(b=l.Fq(),0===b?a.g.notification.D("No LifeViewers playing",100,!0):1<b&&a.g.notification.D("Paused all LifeViewers",100,!0)):(b=l.Gq(a),0===b?a.g.notification.D("No other LifeViewers playing",100,!0):1<b?a.g.notification.D("Paused "+b+" other LifeViewers",100,!0):a.g.notification.D("Paused "+b+" other LifeViewer",100,!0));break;case 88:c.shiftKey?(a.a.bf=!a.a.bf,0<a.a.Nc&&a.g.notification.D("Major Grid Lines "+(a.a.bf?"On":"Off"),40,!0)):(a.a.Bb=!a.a.Bb,a.Uf.current=a.Un([a.a.Bb],
!0,a));break;case 89:a.Lc?a.g.notification.D("Graph Disabled",40,!0):c.shiftKey?(a.qd=!a.qd,a.Vg.current=a.Vn([a.qd],!0,a),a.g.notification.D("Graph "+(a.qd?"Lines":"Points"),40,!0)):(a.Kb=!a.Kb,a.g.notification.D("Population Graph "+(a.Kb?"On":"Off"),40,!0));break;case 80:a.Jb||a.Ma.locked||(a.Ma.current=.99>=a.Ma.current[0]?a.rg([a.Ma.current[0]+.01,a.Ma.current[1]],!0,a):a.rg([1,a.Ma.current[1]],!0,a));break;case 76:a.Jb||a.Ma.locked||(a.Ma.current=.01<=a.Ma.current[0]?a.rg([a.Ma.current[0]-.01,
a.Ma.current[1]],!0,a):a.rg([0,a.Ma.current[1]],!0,a));break;case 81:!a.Jb&&!a.ub.locked&&a.ub.current[0]<g.sj&&(a.ub.current=a.Sl([a.a.o+1,a.ub.current[1]],!0,a));break;case 65:!a.Jb&&!a.ub.locked&&a.ub.current[0]>g.vj&&(a.ub.current=a.Sl([a.a.o-1,a.ub.current[1]],!0,a));break;case 82:c.shiftKey?l.fq():a.S.current=a.Yc(g.Zk,!0,a);break;case 83:c.shiftKey?a.a.oc&&(a.Le=!a.Le,a.g.notification.D("AutoFit State 1 Mode "+(a.Le?"On":"Off"),40,!0)):a.dh=!a.dh;break;case 78:a.lg&&(a.Z?a.Gl():(a.Hl(),a.B&&
(a.B=0)),a.resize());break;case 86:c.shiftKey?(a.Cn(a),a.g.notification.D("Saved camera position",100,!0)):a.ab||(a.kq(a),a.g.notification.D("Restored camera position",100,!0),a.S.current===g.Ja&&(a.qc=!0));break;case 221:a.ab||(c.shiftKey?a.Dg(a.za.current[0],Math.log(a.a.zoom*a.a.Ub*2/g.sa)/Math.log(g.jb/g.sa)-a.za.current[0]):a.Dg(a.za.current[0],.01));break;case 219:a.ab||(c.shiftKey?a.Dg(a.za.current[0],Math.log(a.a.zoom*a.a.Ub/2/g.sa)/Math.log(g.jb/g.sa)-a.za.current[0]):a.Dg(a.za.current[0],
-.01));break;case 53:case 101:a.ua.locked||(a.a.angle=0,a.ua.current=[a.a.angle,a.a.angle]);break;case 49:case 97:c.shiftKey?(a.zd(a,a.a.zoom*a.a.Ub,!0),a.g.notification.D("Integer Zoom",40,!0)):a.zd(a,1,!1);break;case 50:case 98:c.shiftKey?a.zd(a,.5,!1):a.zd(a,2,!1);break;case 51:case 99:a.zd(a,32,!1);break;case 52:case 100:c.shiftKey?a.zd(a,.25,!1):a.zd(a,4,!1);break;case 54:case 102:c.shiftKey?a.zd(a,.0625,!1):a.zd(a,16,!1);break;case 55:a.Lc?a.g.notification.D("Graph Disabled",40,!0):(0<a.bb&&
(a.bb-=.05,0>a.bb&&(a.bb=0)),this.Md.current=this.Cg([a.bb,a.bb],!1,a));break;case 56:case 104:c.shiftKey?a.zd(a,.125,!1):a.zd(a,8,!1);break;case 57:a.Lc?a.g.notification.D("Graph Disabled",40,!0):(1>a.bb&&(a.bb+=.05,1<a.bb&&(a.bb=1)),this.Md.current=this.Cg([a.bb,a.bb],!1,a));break;case 48:case 96:a.G=1;a.Wa.current=a.sg([a.G,a.G],!0,a);a.ca.current=a.Ne([1,a.ca.current[1]],!0,a);break;case 189:case 109:a.xb||(a.G>g.Wf?(c.shiftKey?a.G=g.Wf:--a.G,a.Wa.current=a.sg([a.G,a.G],!0,a)):a.ca&&(a.ca.current=
.01<=a.ca.current[0]&&!c.shiftKey?a.Ne([a.ca.current[0]-.01,a.ca.current[1]],!0,a):a.Ne([0,a.ca.current[1]],!0,a)));break;case 187:case 107:!a.xb&&a.ca&&(.99>=a.ca.current[0]&&!c.shiftKey?a.ca.current=a.Ne([a.ca.current[0]+.01,a.ca.current[1]],!0,a):.99>=a.ca.current[0]?a.ca.current=a.Ne([1,a.ca.current[1]],!0,a):(a.ca.current=a.Ne([1,a.ca.current[1]],!0,a),a.G<g.rc&&(c.shiftKey?a.G=g.rc:a.G+=1,a.Wa.current=a.sg([a.G,a.G],!0,a))));break;case 188:a.ua.locked||(b=a.ua.current[0],b=c.shiftKey?b-90:b-
1,0>b&&(b+=360),a.ua.current=a.ui([b,b],!0,a));break;case 190:a.ua.locked||(b=a.ua.current[0],b=c.shiftKey?b+90:b+1,360<=b&&(b-=360),a.ua.current=a.ui([b,b],!0,a));break;case 74:a.V.Sc.length?a.ab||(c.shiftKey?(--a.pe,0>a.pe&&(a.pe=a.V.Sc.length-1)):(a.pe+=1,a.pe>=a.V.Sc.length&&(a.pe=0)),a.vq(a,a.pe)):a.g.notification.D("No POIs defined",80,!0);break;case 84:c.shiftKey?a.g.ah=!a.g.ah:a.Tf.current=a.Tj([!a.g.gg],!0,a);break;case 71:a.xb||(c.shiftKey?a.af&&(a.aj=!a.aj):(a.Ul([!a.Xc],!0,a),a.nc&&(a.nc.current=
[a.Xc],a.g.ng=!0)));break;case 70:c.shiftKey?a.me.locked||(a.Sa=!a.Sa,a.me.current=a.Tn([a.Sa],!0,a)):a.Sf.locked||(a.Yd(!0,!0),a.g.notification.D("Fit Zoom",80,!0),a.S.current===g.Ja&&(a.qc=!0));break;case 79:a.ai=c.shiftKey?2:1;break;case 37:c.shiftKey?a.nf(a.a.zoom,a.a.zoom):a.nf(a.a.zoom,0);break;case 38:a.B?a.Kj(a,1):a.na?a.Ij(a,1):c.shiftKey?a.nf(-a.a.zoom,a.a.zoom):a.nf(0,a.a.zoom);break;case 39:c.shiftKey?a.nf(-a.a.zoom,-a.a.zoom):a.nf(-a.a.zoom,0);break;case 40:a.B?a.Jj(a,1):a.na?a.Hj(a,
1):c.shiftKey?a.nf(a.a.zoom,-a.a.zoom):a.nf(0,-a.a.zoom);break;case 77:a.pd&&!a.pd.j&&(a.pd.current[0]=!a.pd.current[0],a.g.ng=!0);break;case 67:a.Jb||!a.Mb||a.Mb.locked||(c.shiftKey?b=a.Nf:(b=a.Mb.current[0],b+=1,a.Jf?b>=a.a.sc+1&&(b=0):b>=a.a.sc&&(b=0)),a.Mb.current=a.bo([b,b],!0,a));break;case 72:c.shiftKey?(a.df=!a.df,a.g.notification.D("AutoFit History Mode "+(a.df?"On":"Off"),40,!0)):(a.Db.length?a.B?a.B=0:a.B=a.Dn:a.B?a.B=0:a.Z||(a.B=1),a.Vf.current=a.ni([a.B],!0,a));break;case 73:c.shiftKey?
a.fa=!a.fa:(a.B?a.B!==a.lj?a.B=a.lj:a.B=0:a.Z||(a.B=a.lj),a.Vf.current=a.ni([a.B],!0,a));break;case 27:a.kd?a.Db.length?(a.Db=[],a.na=0):p():a.B?a.B=0:a.Db.length?(a.Db=[],a.na=0):a.tb&&(a.S.current=a.Yc(g.Ja,!0,a));a.B=0;a.Vf.current=a.ni([a.B],!0,a);break;case 33:a.B?a.Kj(a,a.Va):a.na&&a.Ij(a,a.Va);break;case 34:a.B?a.Jj(a,a.Va):a.na&&a.Hj(a,a.Va);break;case 36:a.B?a.B=1:a.na&&(a.na=1);break;case 35:a.B?a.B=a.Yg-a.Va:a.na&&(a.na=a.Db.length-a.Va);break;default:d=!1}return d};r.prototype.Yp=function(a,
b,c){var d=!0;if(c.ctrlKey||c.metaKey||c.altKey)b=-1;switch(b){case 84:a.Tj([!a.g.gg],!0,a);break;default:d=!1}return d};r.prototype.ho=function(a,b){var c=b.charCode||b.keyCode;if(a.Gg?a.Yp(a,c,b):a.Xp(a,c,b))a.g.rf(!0),b.preventDefault()};r.prototype.Vq=function(){this.w=this.g.Qo(this.to,this.Tl,this);this.w.xk=this.rj;this.He=this.w.Aa(Menu.Qc,0,40,16,20,"X");this.He.font=g.uc;this.He.orientation=Menu.Rb;this.Ie=this.w.Aa(Menu.Qc,70,40,16,20,"Y");this.Ie.font=g.uc;this.Ie.orientation=Menu.Rb;
this.Fe=this.w.Aa(Menu.Qc,140,40,16,20,"A");this.Fe.font=g.uc;this.Fe.orientation=Menu.Rb;this.Fc=this.w.Aa(Menu.Qc,16,40,54,20,"");this.Fc.font=g.uc;this.Fc.textAlign=Menu.right;this.Fc.M="camera X position";this.Ac=this.w.Aa(Menu.Qc,86,40,54,20,"");this.Ac.font=g.uc;this.Ac.textAlign=Menu.right;this.Ac.M="camera Y position";this.kc=this.w.Aa(Menu.Qc,156,40,40,20,"");this.kc.font=g.uc;this.kc.textAlign=Menu.right;this.kc.M="camera angle";this.qh=this.w.Aa(Menu.Qc,196,40,4,20,"");this.wg=this.w.Aa(Menu.jc,
-280,40,20,20,"E");this.wg.font=g.uc;this.yg=this.w.Aa(Menu.jc,-210,40,20,20,"S");this.yg.font=g.uc;this.zg=this.w.Aa(Menu.jc,-140,40,20,20,"W");this.zg.font=g.uc;this.xg=this.w.Aa(Menu.jc,-70,40,20,20,"N");this.xg.font=g.uc;this.Bc=this.w.Aa(Menu.jc,-260,40,50,20,"");this.Bc.font=g.uc;this.Bc.textAlign=Menu.right;this.Bc.M="bounding box east edge velocity";this.Dc=this.w.Aa(Menu.jc,-190,40,50,20,"");this.Dc.font=g.uc;this.Dc.textAlign=Menu.right;this.Dc.M="bounding box south edge velocity";this.Ec=
this.w.Aa(Menu.jc,-120,40,50,20,"");this.Ec.font=g.uc;this.Ec.textAlign=Menu.right;this.Ec.M="bounding box west edge velocity";this.Cc=this.w.Aa(Menu.jc,-50,40,50,20,"");this.Cc.font=g.uc;this.Cc.textAlign=Menu.right;this.Cc.M="bounding box north edge velocity";this.Cd=this.w.bd(null,Menu.Qc,90,0,40,20,["START"],[!1],Menu.od);this.Cd.font=g.Mj;this.Cd.M=["autostart indicator"];this.Od=this.w.bd(null,Menu.Qc,90,20,40,20,["STOP"],[!1],Menu.od);this.Od.font=g.Mj;this.Od.M=["stop indicator"];this.Ga=
this.w.bd(this.qo,Menu.jc,-130,0,40,20,["WAYPT"],[!1],Menu.od);this.Ga.font=g.Mj;this.Ga.M=["toggle waypoint mode"];this.Ld=this.w.bd(this.po,Menu.jc,-130,20,40,20,["LOOP"],[!1],Menu.od);this.Ld.font=g.Mj;this.Ld.M=["toggle loop mode"];this.Vf=this.w.bd(this.ni,Menu.jc,-40,0,40,40,[""],[!1],Menu.od);this.Vf.icon=[g.Da.icon("help")];this.Vf.M=["toggle help display"];this.me=this.w.bd(this.Tn,Menu.Qc,0,0,40,40,[""],[!1],Menu.od);this.me.icon=[g.Da.icon("autofit")];this.me.M=["toggle autofit"];this.Sf=
this.w.zi(this.ar,Menu.Qc,45,0,"");this.Sf.icon=g.Da.icon("fit");this.Sf.M="fit pattern to display";this.Uf=this.w.bd(this.Un,Menu.jc,-85,0,40,40,[""],[!1],Menu.od);this.Uf.icon=[g.Da.icon("grid")];this.Uf.M=["toggle grid lines"];this.rd=this.w.xo();this.rd.locked=!0;this.Ve=this.w.Aa(Menu.sf,0,-100,70,30,"Time");this.Ve.textAlign=Menu.left;this.Ve.font=g.he;this.Qf=this.w.Aa(Menu.sf,70,-100,70,30,"");this.Qf.textAlign=Menu.right;this.Qf.font=g.he;this.Qf.M="elapsed time";this.Fb=this.w.Aa(Menu.sf,
0,-70,140,30,"");this.Fb.textAlign=Menu.left;this.Fb.font=g.he;this.Fb.M="cell state at cursor position";this.nc=this.w.bd(this.Ul,Menu.sf,0,-40,100,40,[""],[this.Xc],Menu.od);this.nc.M=["toggle generation statistics"];this.Ic=this.w.Aa(Menu.sf,0,-40,this.s-40,40,"");this.Ic.textAlign=Menu.left;this.Ic.j=!0;this.zf=this.w.Aa(Menu.ud,-140,-130,70,30,"Alive");this.zf.textAlign=Menu.left;this.zf.font=g.he;this.dg=this.w.Aa(Menu.ud,-70,-130,70,30,"");this.dg.textAlign=Menu.right;this.dg.font=g.he;this.dg.M=
"current population";this.$d=this.w.Aa(Menu.ud,-140,-100,70,30,"Births");this.$d.textAlign=Menu.left;this.$d.font=g.he;this.Gf=this.w.Aa(Menu.ud,-70,-100,70,30,"");this.Gf.textAlign=Menu.right;this.Gf.font=g.he;this.Gf.M="cells born this generation";this.Ee=this.w.Aa(Menu.ud,-140,-70,70,30,"Deaths");this.Ee.textAlign=Menu.left;this.Ee.font=g.he;this.Mf=this.w.Aa(Menu.ud,-70,-70,70,30,"");this.Mf.textAlign=Menu.right;this.Mf.font=g.he;this.Mf.M="cells died this generation";this.gc=this.w.Aa(Menu.sf,
0,-130,140,30,this.yb);this.gc.font=g.he;this.za=this.w.We(this.ke,Menu.yj,0,0,212,40,0,1,.1,"Zoom ","x",1);this.za.M="camera zoom";this.ub=this.w.We(this.Sl,Menu.eo,30,0,40,292,g.sj,g.vj,1,"Layers ","",0);this.ub.M="number of layers";this.Ma=this.w.We(this.rg,Menu.Bm,-70,0,40,292,1,0,.1,"Depth ","",2);this.Ma.M="depth between layers";this.ua=this.w.We(this.ui,Menu.yj,0,50,390,40,0,359,0,"Angle ","\u00b0",0);this.ua.M="camera angle";this.Ue=this.w.zi(this.no,Menu.Qc,0,50,"");this.Ue.icon=g.Da.icon("shrink");
this.Ue.M="shrink to thumbnail";this.Df=this.w.zi(this.aq,Menu.ud,-40,-90,"X");this.Df.M="close window";this.Tf=this.w.bd(this.Tj,Menu.jc,-40,50,40,40,[""],[this.g.gg],Menu.od);this.Tf.icon=[g.Da.icon("fps")];this.Tf.M=["toggle timing display"];this.Md=this.w.We(this.Cg,Menu.yj,0,0,212,40,0,1,this.bb,"Opacity ","%",0);this.Md.M="graph opacity";this.Vg=this.w.bd(this.Vn,Menu.Qc,90,0,40,40,[""],[!1],Menu.od);this.Vg.icon=[g.Da.icon("lines")];this.Vg.M=["toggle lines"];this.ph=this.w.zi(this.dr,Menu.jc,
-130,0,"X");this.ph.M="close graph";this.pd=this.w.bd(null,Menu.ud,-40,-40,40,40,[""],[!1],Menu.od);this.pd.icon=[g.Da.icon("menu")];this.pd.M=["toggle navigation menu"];this.Mb=this.w.We(this.bo,Menu.Jn,0,-90,390,40,0,this.a.sc-1,1,"Theme ","",0);this.Mb.M="colour theme";this.ca=this.w.We(this.Ne,Menu.ud,-375,-40,80,40,0,1,0,"","gps",0);this.ca.M="steps per second";this.Wa=this.w.We(this.sg,Menu.ud,-290,-40,80,40,g.Wf,g.rc,1,"x","",0);this.Wa.M="generations per step";this.S=this.w.bd(this.Yc,Menu.ud,
-205,-40,160,40,["","","",""],g.Ja,Menu.xl);this.S.icon=[g.Da.icon("tostart"),g.Da.icon("stepback"),g.Da.icon("pause"),g.Da.icon("play")];this.S.M=["reset","previous generation","pause","play"];this.pd.Yl([this.ub,this.Ma,this.ua,this.Mb,this.Ue,this.Df,this.Tf]);this.nc.Yl([this.zf,this.dg,this.$d,this.Gf,this.Ee,this.Mf,this.Ve,this.Qf,this.gc])};r.prototype.Rp=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.Xb&&m.Rh&&(c=this.Xb),c<g.ae&&(c=g.ae),
d<g.wj&&(d=g.wj),c&=-8,this.v.width!==c&&(this.v.width=c),this.v.height!==d&&(this.v.height=d),this.Pd=this.v.getContext("2d",{alpha:!1}),this.Pd.globalAlpha=1,this.Pd.fillStyle="black",this.Pd.fillRect(0,0,this.v.width,this.v.height),this.$f=document.createElement("canvas"),this.$f.width=this.v.width,this.$f.height=this.v.height,this.Tb=this.$f.getContext("2d",{alpha:!1}),this.s=this.v.width,this.m=this.v.height,this.a=new Life(this.Tb,this.s,this.m,1024,1024),this.a.Cp(this.Tb,this.s,this.m),this.$a=
new Stars(g.Bj,this.a.l),this.$a.Nd(8192,8192,1024),this.a.l.ea(Uint16,1024,"Life.fillAllBuffer"),this.Tb.textAlign="left",this.Tb.textBaseline="middle",g.Da=this.Lq(this.Tb),this.g=new MenuManager(this.Pd,this.Tb,"24px Arial",g.Da,this,this.cr),this.g.gg=!1,this.Vq(),this.th=this.S.x,this.oh=this.ca.x,this.yh=this.Wa.x,registerEvent(this.v,"DOMMouseScroll",function(a){b.tj(b,a)},!1),registerEvent(this.v,"mousewheel",function(a){b.tj(b,a)},!1),this.g.notification.enabled=!0,this.g.uo(this.w),registerEvent(this.v,
"keydown",function(a){b.ho(b,a)},!1))};r.prototype.rh=function(a){switch(a){case f.Il:case f.ul:case f.wl:case f.Bk:case f.vl:case f.Pc:case f.xd:case f.Mk:case f.zl:case f.ll:case f.vk:case f.hl:case f.hh:case f.bl:case f.cl:case f.ri:case f.Jk:case f.Dl:case f.og:case f.pi:case f.cj:case f.xj:case f.Fk:case f.Gk:case f.ei:case f.Ci:case f.Ok:case f.Pj:case f.Nj:case f.fl:case f.Ih:case f.Hh:case f.Fl:case f.Ba:case f.nk:case f.xc:case f.yc:case f.Uj:case f.Vj:case f.Ob:case f.gk:case f.Tm:case f.Th:case f.vi:case f.Nl:case f.Ml:case f.kg:case f.Di:case f.bi:case f.sl:case f.Ai:case f.ii:case f.bj:case f.gi:case f.qj:case f.Ti:case f.Vl:case f.Lk:a=
!0;break;default:a=!1}return a};r.prototype.Gc=function(a,b,c,d,f){var e=a.cg();""===e||this.rh(e)?b[b.length]=[c,d+" missing"]:(b[b.length]=[c+" "+e,d+" must be "+f],a.wa())};r.prototype.Y=function(a,b,c,d){var f=!0,e=0,h=0,l=0,m,k,n=a.wa();if(a.aa()){e=a.$()|0;if(0>e||255<e)b[b.length]=[d+" "+n+" "+e,"RED out of range"];if(a.aa()){h=a.$();if(0>h||255<h)b[b.length]=[d+" "+n+" "+e+" "+h,"GREEN out of range"];a.aa()?(l=a.$(),0>l||255<l?b[b.length]=[d+" "+n+" "+e+" "+h+" "+l,"BLUE out of range"]:f=
!1):this.Gc(a,b,d+" "+n+" "+e+" "+h,"BLUE","numeric")}else this.Gc(a,b,d+" "+n+" "+e,"GREEN","numeric")}else m=a.cg(),k=ColourManager.hc[m.toLowerCase()],void 0!==k?(a.wa(),e=k[1],h=k[2],l=k[3],f=!1):""===m||this.rh(m)?b[b.length]=[d+" "+n,"name missing"]:(b[b.length]=[d+" "+n+" "+m,"name not known"],a.wa());if(!f)switch(-1!==this.f[c]&&(b[b.length]=[d+" "+n+" "+e+" "+h+" "+l,"overwrites ("+(this.f[c]>>16)+" "+(this.f[c]>>8&255)+" "+(this.f[c]&255)+")"]),this.f[c]=e<<16|h<<8|l,c){case g.Oi:this.xe=
this.f[c];break;case g.Pi:this.Ce=this.f[c];break;case g.Qi:this.$a.red=e;this.$a.green=h;this.$a.blue=l;break;case g.Ri:this.ia=[e,h,l];break;case g.Hi:this.Pb=[e,h,l];this.a.Fg=this.a.ef?-16777216|l<<16|h<<8|e:e<<24|h<<16|l<<8|255;break;case g.Li:this.a.Hd=[e,h,l];break;case g.Ki:this.a.Gd=[e,h,l];break;case g.Ji:this.a.Fd=[e,h,l];break;case g.Mi:this.a.Id=[e,h,l];break;case g.Ni:this.a.Jd=[e,h,l];break;default:this.Jf=!0}};r.prototype.ro=function(a,b){var c=!0,d=this.a.dc[this.a.sc];-1===this.f[g.Ig]&&
(a[a.length]=[b+" "+f.Kl,"missing"],c=!1);-1===this.f[g.Kf]&&-1===this.f[g.Lf]&&(a[a.length]=[b+" "+f.Ll,"missing"],c=!1);c&&(c=this.f[g.Kf],-1===c&&(c=this.f[g.Lf]),d.ec.red=c>>16,d.ec.green=c>>8&255,d.ec.blue=c&255,c=this.f[g.Ig],d.Ra.I.red=c>>16,d.Ra.I.green=c>>8&255,d.Ra.I.blue=c&255,c=this.f[g.Gi],-1===c&&(c=this.f[g.Ig]),d.Ra.ba.red=c>>16,d.Ra.ba.green=c>>8&255,d.Ra.ba.blue=c&255,c=this.f[g.Lf],-1===c&&(c=this.f[g.Kf]),d.La.I.red=c>>16,d.La.I.green=c>>8&255,d.La.I.blue=c&255,c=this.f[g.Ii],
-1===c&&(c=this.f[g.Lf],-1===c&&(c=this.f[g.Kf])),d.La.ba.red=c>>16,d.La.ba.green=c>>8&255,d.La.ba.blue=c&255,this.a.Ke(this.a.sc,1))};r.prototype.so=function(a){var b=this.V.pp();b.Pe||(b.x=this.a.width/2-this.a.F);b.le||(b.y=this.a.height/2-this.a.A);b.zc||(b.zoom=this.a.zoom);b.wh||(b.angle=this.a.angle);b.Qh||(b.o=this.a.o);b.Ch||(b.depth=this.a.pc);b.Qg||(b.Ta=this.sb);b.fi||(b.step=this.G);b.vf||(b.Xa=this.a.Ad);this.V.Wp(a)};r.prototype.br=function(a){var b=a,c=this.Tb,d,f=a.length;c.font=
g.qg;d=c.measureText(a).width;if(420<d){--f;for(d=c.measureText(a.substr(0,f)+"...").width;420<d;)--f,d=c.measureText(a.substr(0,f)+"...").width;b=b.substr(0,f)+"..."}return b};r.prototype.Bg=function(a,b){var c=a;a.length>b&&(c=a.substr(0,b-1)+"...");return c};r.prototype.nj=function(a,b,c){var d=a.indexOf("\\n");-1!==d&&(c?b[b.length]=[f.hh+" "+f.lb+this.Bg(a,23)+f.lb,"only one line allowed"]:(d=a.substr(d+2).indexOf("\\n"),-1!==d&&(b[b.length]=[f.lb+this.Bg(a,23),"only two lines allowed"])))};
r.prototype.Wi=function(a,b,c){var d=f.ii+" ",e="overwrites (",d=b>=this.a.sc?d+f.hi:d+b,e=c>=this.a.sc?e+f.hi:e+c;a[a.length]=[d,e+")"]};r.prototype.Wb=function(a,b,c,d,f,e){var g=0,h=0,l=0,m,k;if(a.aa())if(g=a.$()|0,0>g||255<g)b[b.length]=[d+" "+e+" "+g,"RED out of range"],f=!0;else if(a.aa())if(h=a.$()|0,0>h||255<h)b[b.length]=[d+" "+e+" "+g+" "+h,"GREEN out of range"],f=!0;else if(a.aa()){if(l=a.$()|0,0>l||255<l)b[b.length]=[d+" "+e+" "+g+" "+h+" "+l,"BLUE out of range"],f=!0}else this.Gc(a,b,
d+" "+e+" "+g+" "+h,"BLUE","numeric"),f=!0;else this.Gc(a,b,d+" "+e+" "+g,"GREEN","numeric"),f=!0;else m=a.cg(),k=ColourManager.hc[m.toLowerCase()],void 0!==k?(a.wa(),g=k[1],h=k[2],l=k[3]):(f=!0,""===m||this.rh(m)?b[b.length]=[d+" "+e,"name missing"]:(b[b.length]=[d+" "+e+" "+m,"name not known"],a.wa()));f||(-1!==this.W[c]&&(b[b.length]=[d+" "+e+" "+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.oo=function(a){var b=
"",c=a.indexOf(f.wc),d;if(-1===c)b=a;else{for(;-1!==c;)if(b+=a.substr(0,c),c+1<a.length){d=a[c+1];a=a.substr(c+2);switch(d){case "B":b+=g.Rl;break;case "N":b+=this.tf;break;case "R":b+=this.yb;break;case "A":b=""===this.Pa?b+this.yb:b+this.Pa;break;case "O":b+=this.wf;break;case "T":b+=g.mp;break;case f.wc:b+=f.wc;break;default:b+=f.wc+d}c=a.indexOf(f.wc)}else c=-1;b+=a}return b};r.prototype.ya=function(a,b,c,d){d[d.length]=a?b===f.Pc?[b+" "+c,"already defined"]:[b+" "+c,"overwrites "+f.Pc]:b===f.Pc?
[b+" "+c,"overwrites "+f.xd]:[b+" "+c,"already defined"]};r.prototype.Fa=function(a){var b="";a===(a|0)?b=String(a):b=a.toFixed(2);return b};r.prototype.jo=function(a,b){var c=new Script(a),d=!1,e,h,l=!1,m="",k=0,n,p,q=this.Db,r=0,u="",t=this.V.Fi(),A=!1,F=!1,J=-1,K=-1,Q=-1,T,X,N;this.sh=this.Je=0;this.Jf=!1;this.f[g.Kf]=-1;this.f[g.Ig]=-1;this.f[g.Gi]=-1;this.f[g.Lf]=-1;this.f[g.Ii]=-1;this.f[g.Oi]=-1;this.f[g.Pi]=-1;this.f[g.Qi]=-1;this.f[g.Ri]=-1;this.f[g.Hi]=-1;this.f[g.Li]=-1;this.f[g.Ki]=-1;
this.f[g.Ji]=-1;this.f[g.Mi]=-1;this.f[g.Ni]=-1;this.W=[];if(c.Dm(f.bi)){for(e=0;256>e;e+=1)this.W[e]=-1;for(e=c.wa();""!==e;){if(l)e[e.length-1]===f.lb?(m=m+" "+e.substr(0,e.length-1),l=!1,this.nj(m,q,d),d?(""!==this.Ha&&(q[q.length]=[f.hh+" "+f.lb+this.Bg(m,20)+f.lb,"overwrites "+f.lb+this.Ha+f.lb]),this.Ha=m,d=!1):(t.Vb=m,t.Jl=!0)):m=m+" "+e;else if(e[0]===f.lb)m=e.substr(1),l=!0,e[e.length-1]===f.lb&&(l=!1,m=m.substr(0,m.length-1),this.nj(m,q,d),d?(""!==this.Ha&&(q[q.length]=[f.hh+" "+f.lb+this.Bg(m,
20)+f.lb,"overwrites "+f.lb+this.Ha+f.lb]),this.Ha=m,d=!1):(t.Vb=m,t.Jl=!0));else{n=p=!1;this.Je+=1;switch(e){case f.hh:n=d=!0;break;case f.bl:n=this.Qd=!0;break;case f.cl:this.Fh=!1;n=!0;break;case f.ei:n=this.dh=!0;break;case f.Ci:n=t.$b=!0;break;case f.Ok:n=this.df=!0;break;case f.Ih:n=this.a.Bb=!0;break;case f.Hh:c.aa()&&(p=!0,k=c.$()|0,k>=g.Mp&&k<=g.Fp&&(this.a.Nc=k,n=!0));break;case f.Ba:case f.nk:u=e;h=!1;if(c.aa()){n=c.$()|0;if(0>n||255<=n)q[q.length]=[e+" "+n,"STATE out of range"],h=!0;this.Wb(c,
q,n,e,h,n)}else switch(h=c.cg(),h){case f.mn:h=c.wa();this.Wb(c,q,g.nn,e,!1,h);break;case f.on:h=c.wa();this.Wb(c,q,g.pn,e,!1,h);break;case f.Om:h=c.wa();this.Wb(c,q,g.Qm,e,!1,h);break;case f.Zm:h=c.wa();this.Wb(c,q,g.$m,e,!1,h);break;case f.cn:h=c.wa();this.Wb(c,q,g.dn,e,!1,h);break;case f.an:h=c.wa();this.Wb(c,q,g.bn,e,!1,h);break;case f.Vm:h=c.wa();this.Wb(c,q,g.Wm,e,!1,h);break;case f.Pn:this.Y(c,q,g.Kf,u);break;case f.Kl:this.Y(c,q,g.Ig,u);break;case f.On:this.Y(c,q,g.Gi,u);break;case f.Ll:this.Y(c,
q,g.Lf,u);break;case f.Qn:this.Y(c,q,g.Ii,u);break;case f.Ih:this.Y(c,q,g.Oi,u);break;case f.Hh:this.Y(c,q,g.Pi,u);break;case f.ei:this.Y(c,q,g.Qi,u);break;case f.Il:this.Y(c,q,g.Ri,u);break;case f.fm:this.Y(c,q,g.Hi,u);break;case f.Im:this.Y(c,q,g.Li,u);break;case f.Hm:this.Y(c,q,g.Ki,u);break;case f.Gm:this.Y(c,q,g.Ji,u);break;case f.Jm:this.Y(c,q,g.Mi,u);break;case f.Km:this.Y(c,q,g.Ni,u);break;default:q[q.length]=[e+" "+h,"illegal element"],c.wa()}n=!0;break;case f.sl:c.Dm(f.bi);n=!0;--this.Je;
break;case f.vi:n=this.xb=!0;break;case f.Fl:n=this.Zi=!0;break;case f.Di:this.Na&&(this.wd=!0);n=!0;break;case f.Jk:n=this.hj=!0;break;case f.Dl:n=this.Le=!0;break;case f.ri:c.aa()&&(p=!0,k=c.$(),k>=g.kf&&k<=g.jf&&(T=k,p=!1,e+=" "+k,c.aa()&&(p=!0,k=c.$(),k>=g.kf&&k<=g.jf&&(X=k,n=!0,this.Ya&&(q[q.length]=[f.ri+" "+T+" "+X,"overwrites "+K+" "+Q]),K=T,Q=X,this.Ya=!0))));break;case f.pi:c.aa()&&(p=!0,k=c.$()|0,0<k&&(h=k,p=!1,e+=" "+k,c.aa()&&(p=!0,k=c.$(),k>=g.kf&&k<=g.jf&&(T=k,p=!1,e+=" "+k,c.aa()&&
(p=!0,k=c.$(),k>=g.kf&&k<=g.jf&&(X=k,n=!0,this.hd&&(q[q.length]=[f.pi+" "+h+" "+T+" "+X,"overwrites "+J+" "+K+" "+Q]),J=h,K=T,Q=X,this.Ya=this.hd=!0))))));break;case f.og:c.aa()&&(p=!0,k=c.$(),k>=g.kf&&k<=g.jf&&(X=k,p=!1,e+=" "+k,c.aa()&&(p=!0,k=c.$(),k>=g.kf&&k<=g.jf&&(T=k,p=!1,e+=" "+k,c.aa()&&(p=!0,k=c.$(),k>=g.kf&&k<=g.jf&&(N=k,p=!1,e+=" "+k,c.aa()&&(p=!0,k=c.$(),k>=g.kf&&k<=g.jf&&(h=k,n=!0,N>X?q[q.length]=[f.og+" W "+this.Fa(N)+" E "+this.Fa(X),"W is greater than E"]:h>T?q[q.length]=[f.og+" N "+
this.Fa(h)+" S "+this.Fa(T),"N is greater than S"]:(this.gd&&(q[q.length]=[f.og+" "+this.Fa(X)+" "+this.Fa(T)+" "+this.Fa(N)+" "+this.Fa(h),"overwrites "+this.Fa(this.fb)+" "+this.Fa(this.gb)+" "+this.Fa(this.Eb)+" "+this.Fa(this.zb)]),this.Ya=this.gd=!0,this.zb=h,this.fb=X,this.gb=T,this.Eb=N)))))))));break;case f.Th:c.aa()&&(p=!0,k=c.$()|0,0<k&&(-1!==this.ka&&(q[q.length]=[f.Th+" "+k,"overwrites "+this.ka]),this.ka=k,n=!0));break;case f.gi:c.aa()&&(p=!0,k=c.$()|0,0<k&&(-1!==this.Td&&(q[q.length]=
[f.gi+" "+k,"overwrites "+this.Td]),this.Td=k,n=!0));break;case f.Ai:c.aa()&&(p=!0,k=c.$()|0,0<=k&&359>=k&&(t.wh&&(q[q.length]=[f.Ai+" "+k,"overwrites ("+t.angle+")"]),t.angle=k,n=t.wh=!0));break;case f.qj:c.aa()&&(p=!0,k=c.$()|0,k>=g.vj&&k<=g.sj&&(t.Qh&&(q[q.length]=[f.qj+" "+k,"overwrites ("+t.o+")"]),t.o=k,n=t.Qh=!0));break;case f.Ti:c.aa()&&(p=!0,k=c.$(),k>=g.uj&&k<=g.fn&&(t.Ch&&(q[q.length]=[f.Ti+" "+k+"overwrites ("+t.depth+")"]),t.depth=k,n=t.Ch=!0));break;case f.Uj:c.aa()&&(p=!0,k=c.$(),k>=
-this.a.ib/2&&k<=this.a.ib/2&&(this.ga=k,n=!0));break;case f.Vj:c.aa()&&(p=!0,k=c.$(),k>=-this.a.ib/2&&k<=this.a.ib/2&&(this.ha=k,n=!0));break;case f.xc:c.aa()&&(p=!0,k=c.$(),k>=-this.a.ib/2&&k<=this.a.ib/2&&(t.Pe&&(q[q.length]=[f.xc+" "+k,"overwrites ("+t.x+")"]),t.x=-k,n=t.Pe=!0));break;case f.yc:c.aa()&&(p=!0,k=c.$(),k>=-this.a.ib/2&&k<=this.a.ib/2&&(t.le&&(q[q.length]=[f.yc+" "+k,"overwrites ("+t.y+")"]),t.y=-k,n=t.le=!0));break;case f.Tm:n=!0;break;case f.gk:case f.Ob:c.aa()&&(p=!0,k=c.$(),k>=
g.sa&&k<=g.jb?(t.zc&&(q[q.length]=1>t.zoom?[f.Ob+" "+k,"overwrites ("+-(1/t.zoom)+")"]:[f.Ob+" "+k,"overwrites ("+t.zoom+")"]),t.zoom=k,n=t.zc=!0):k>=g.Np&&k<=g.Hp&&(t.zc&&(q[q.length]=1>t.zoom?[f.Ob+" "+k,"overwrites ("+-(1/t.zoom)+")"]:[f.Ob+" "+k,"overwrites ("+t.zoom+")"]),t.zoom=-(1/k),n=t.zc=!0));break;case f.bj:c.aa()&&(p=!0,k=c.$()|0,k>=g.nd&&k<=g.hf&&(t.Qg&&(q[q.length]=[f.bj+" "+k,"overwrites ("+t.Ta+")"]),t.Ta=k,n=t.Qg=!0));break;case f.Nl:this.kd||(this.lg=this.Z=!0);n=!0;break;case f.Sn:this.kd||
(this.kg=this.lg=this.Z=!0,this.g.kg=!0);n=!0;break;case f.Ml:c.aa()&&(p=!0,k=c.$()|0,k>=g.ln&&k<=g.hn&&(this.wb=k,n=!0));break;case f.ii:c.aa()?(p=!0,k=c.$()|0,0<=k&&k<this.a.sc&&(t.vf&&this.Wi(q,k,t.Xa),t.Xa=k,n=t.vf=!0)):(h=c.cg(),h===f.hi&&(c.wa(),this.Jf?(t.vf&&this.Wi(q,this.a.sc,t.Xa),t.Xa=this.a.sc,t.vf=!0):q[q.length]=[f.ii+" "+f.hi,"no custom THEME defined"],n=!0));break;case f.bi:q[q.length]=[e,"already in a script block"];n=!0;break;case f.vl:this.fa=!this.fa;n=!0;break;case f.wl:this.Tf.current=
this.Tj([!0],!0,this);n=!0;break;case f.Bk:n=this.g.ah=!0;break;case f.ul:this.Ul([!0],!0,this);this.nc&&(this.nc.current=[this.Xc],this.g.ng=!0);n=!0;break;case f.vk:c.aa()&&(p=!0,k=c.$()|0,k>=g.kn&&k<=g.en&&(n=!0,this.a.Fj=k));break;case f.xj:n=this.Lc=!0;break;case f.cj:n=this.Kb=!0;break;case f.Fk:c.aa()&&(p=!0,k=c.$(),0<=k&&1>=k&&(n=!0,this.bb=k));break;case f.Gk:this.qd=!1;n=!0;break;case f.zl:this.a.L=!1;this.ua.j=this.a.L;n=!0;break;case f.Mk:this.a.L=!0;this.ua.j=this.a.L;n=!0;break;case f.ll:this.kh=
c.wa();n=this.uh=!0;break;case f.Pc:h=c.cg();switch(h){case f.xc:t.Qe&&this.ya(t.Zc,f.Pc,f.xc,q);t.Zc=!0;t.Qe=!0;c.wa();break;case f.yc:t.Re&&this.ya(t.$c,f.Pc,f.yc,q);t.$c=!0;t.Re=!0;c.wa();break;case f.Ob:t.Xl&&this.ya(t.ad,f.Pc,f.Ob,q);t.ad=!0;t.xi=!0;c.wa();break;case f.Eg:t.Qe&&this.ya(t.Zc,f.Pc,f.xc,q);t.Re&&this.ya(t.$c,f.Pc,f.yc,q);t.Xl&&this.ya(t.ad,f.Pc,f.Ob,q);t.Zc=!0;t.Qe=!0;t.$c=!0;t.Re=!0;t.ad=!0;t.xi=!0;c.wa();break;default:this.Gc(c,q,f.Pc,"argument",f.Eg+", "+f.xc+", "+f.yc+" or "+
f.Ob)}n=!0;break;case f.xd:h=c.cg();switch(h){case f.xc:t.Qe&&this.ya(t.Zc,f.xd,f.xc,q);t.Zc=!1;t.Qe=!0;c.wa();break;case f.yc:t.Re&&this.ya(t.$c,f.xd,f.yc,q);t.$c=!1;t.Re=!0;c.wa();break;case f.Ob:t.Xl&&this.ya(t.ad,f.xd,f.Ob,q);t.ad=!1;t.xi=!0;c.wa();break;case f.Eg:t.Qe&&this.ya(t.Zc,f.xd,f.xc,q);t.Re&&this.ya(t.$c,f.xd,f.yc,q);t.Xl&&this.ya(t.ad,f.xd,f.Ob,q);t.Zc=!1;t.Qe=!0;t.$c=!1;t.Re=!0;t.ad=!1;t.xi=!0;c.wa();break;default:this.Gc(c,q,f.xd,"argument",f.Eg+", "+f.xc+", "+f.yc+" or "+f.Ob)}n=
!0;break;case f.hl:F=!0;this.V.add(t);t=this.V.Fi();n=t.Um=!0;break;case f.Pj:c.aa()&&(p=!0,k=c.$()|0,0<=k&&(A||(A=!0),0<k&&(this.V.add(t),t=this.V.Fi()),t.xa=k,n=t.Mn=!0));break;case f.Nj:c.aa()&&(p=!0,k=c.$()|0,k>=g.Wf&&k<=g.rc&&(t.fi&&(q[q.length]=[f.Nj+" "+k,"overwrites ("+t.step+")"]),t.step=k,n=t.fi=!0));break;case f.fl:c.aa()&&(p=!0,k=c.$(),0<k&&(A||(A=!0),this.V.add(t),t=this.V.Fi(),t.cb=k,n=t.Nn=!0));break;case f.Vl:c.aa()&&(p=!0,k=c.$()|0,k>=g.ae&&k<=this.Xb||this.kd)&&(n=!0,this.kd||(this.fd=
k));break;case f.Lk:c.aa()&&(p=!0,k=c.$()|0,k>=g.wj&&k<=g.jn||this.kd)&&(n=!0,this.kd||(this.Se=k));break;default:q[q.length]=[e,"unknown or misspelt command"],n=!0}n||(p?q[q.length]=[e+" "+k,"argument out of range"]:this.Gc(c,q,e,"argument","numeric"))}""!==e&&(e=c.wa())}l&&(q[q.length]=[f.lb+m,"unterminated string"]);A&&this.Ya&&(c=this.gd?f.og:this.hd?f.pi:f.ri,q[q.length]=[c,"can not be used with Waypoints"],this.hd=this.gd=this.Ya=!1);this.gd||!this.Ya&&!this.hd||(this.hd&&(0<this.a.Nc&&(J*=
this.a.Nc),this.ka=J),this.zb=Q,this.fb=K,this.gb=Q,this.Eb=K);(A||F)&&this.V.add(t);if(A){t=this.V.ja[0];t.vf&&this.a.Ke(t.Xa,1);t.Pe&&(this.a.F=this.a.width/2-t.x);t.le&&(this.a.A=this.a.height/2-t.y);t.zc&&(this.a.zoom=t.zoom);t.Qg&&(this.sb=t.Ta);this.eb=!0;for(e=0;e<this.V.ja.length;e+=1)t=this.V.ja[e],t.$b&&(t.Pe||t.le||t.zc)&&(m="",t.Pe?(m="X "+t.x,t.le?m=t.zc?m+(", Y "+t.y+" and ZOOM "+t.zoom):m+(" and Y "+t.y):t.zc&&(m+=" and ZOOM "+t.zoom)):t.le?(m="Y "+t.y,t.zc&&(m+=" and ZOOM "+t.zoom)):
t.zc&&(m="ZOOM "+t.zoom),q[q.length]=[f.Ci,"overwrites "+m]);t=this.V.ja[0]}else t.$b&&(this.Sa=!0),t.Pe&&(this.a.F=this.a.width/2-t.x),t.le&&(this.a.A=this.a.height/2-t.y),t.zc&&(this.a.zoom=t.zoom),t.wh&&(this.a.angle=t.angle),t.vf&&this.a.Ke(t.Xa,1),t.Ch&&(this.a.pc=t.depth/g.Of+g.uj),t.Qh&&(this.a.o=t.o),t.Qg&&(this.sb=t.Ta),t.fi&&(this.G=t.step),t.Jl&&this.g.notification.D(t.Vb,1E3,!1);t.zc&&(this.nh=!0);t.Pe&&(this.lh=!0);t.le&&(this.mh=!0);for(e=0;e<b;e+=1)-1!==this.W[e]&&(r+=1);if(0<r){this.Cf=
!0;for(e=0;e<b;e+=1)PatternManager.Wc[e]?-1===this.W[e]?(r=this.hc[e],this.Zi&&(q[q.length]=this.a.oc?[u+" "+g.Dq[e],"definition missing (used "+(r>>16)+" "+(r>>8&255)+" "+(r&255)+")"]:[u+" "+e,"definition missing (used "+(r>>16)+" "+(r>>8&255)+" "+(r&255)+")"]),this.W[e]=r,this.Cf=!1,this.Ed[e]=g.Ln):this.Ed[e]=g.Kn:this.Ed[e]=g.El;this.ve=this.Cf?"(custom)":this.ve+" (custom*)"}else this.W=[];this.Jf&&this.ro(q,u);-1!==this.xe&&(this.a.Oc=this.xe);-1!==this.Ce&&(this.a.Kd=this.Ce);2<b&&!this.a.oc&&
-1===this.a.u&&(this.xb=!0);this.xb&&(c="not possible due to "+f.vi,this.wd&&(q[q.length]=[f.Di,c],this.wd=!1),-1!==this.Td&&(q[q.length]=[f.gi+" "+this.Td,c]),-1!==this.ka&&(q[q.length]=[f.Th+" "+this.ka,c]));this.Qa+g.rc+2*Math.abs(this.ga)>=this.a.ib&&(q[q.length]=[f.Uj+" "+this.ga,"pattern does not fit on grid at this offset"],this.ga=0);this.nb+g.rc+2*Math.abs(this.ha)>=this.a.ib&&(q[q.length]=[f.Vj+" "+this.ha,"pattern does not fit on grid at this offset"],this.ha=0);this.sh=q.length}this.Jf&&
this.Mb&&(this.Mb.upper=this.a.sc);""!==this.Ha&&(this.Ha=this.oo(this.Ha));this.Sa&&(this.Bi=!0);this.Kb&&this.Lc&&(q[q.length]=[f.cj,"not valid with "+f.xj],this.Kb=!1)};r.prototype.mo=function(){this.uh=!1;this.a.Rc=0;this.a.tc=0;this.a.Ub=1;this.fa=this.Bi=this.Sa=!1;this.W=[];this.ia=null;this.a.Hd=this.a.xp;this.a.Gd=this.a.wp;this.a.Fd=this.a.vp;this.a.Id=this.a.yp;this.a.Jd=this.a.zp;this.Xe=this.wd=this.hj=!1;this.ka=this.Td=-1;this.Xc=this.Za=this.hd=this.Ya=this.gd=this.eb=this.mb=this.qa=
!1};r.prototype.Gl=function(){this.kg?a(this.$k):(this.s=this.kj,this.m=this.Bh,this.Sa?(this.Z=!1,this.Yd(!0,!1)):this.a.zoom=this.mj,this.za&&(this.za.current=this.ke([this.a.zoom,this.a.zoom],!1,this)),this.B=this.ij,this.Z=!1,this.g.Z=!1,this.w.j=!1,this.g.notification.D("Shrink with hotkey N",100,!0))};r.prototype.cr=function(a){a.Z&&(a.Gl(),a.resize())};r.prototype.resize=function(){this.v.width=this.s;this.v.height=this.m;this.$f.width=this.s;this.$f.height=this.m;this.Tb.textBaseline="middle";
this.a.zn(this.s,this.m)};r.prototype.Hl=function(){this.kj=this.s;this.Bh=this.m;this.mj=this.a.zoom;this.ij=this.B;this.s=this.s/this.wb|0;this.m=this.m/this.wb|0;this.a.zoom=this.a.zoom/this.wb;this.s&=-8;this.w.j=!0;this.g.Z=!0;this.g.wb=this.wb;this.Z=!0};r.prototype.Cl=function(a,b){var c,d,e,h,k,l=!1;this.Db=[];if(c=PatternManager.create("",a,this.a.l))for(this.af=PatternManager.af,this.$i=PatternManager.Dk,this.pf=PatternManager.pf,this.Af=PatternManager.il,this.Bf=PatternManager.jl,this.Qa=
c.width,this.nb=c.height,this.tf=c.name,this.wf=c.qn,this.Rd=c.Rd,""===this.Rd&&(this.Rd="(none)"),this.fc=c.De,this.yf=c.Vh,this.yb=c.ra,this.Pa=c.bm,this.Na=PatternManager.Na,this.a.oc=c.Sb,this.a.u=c.u,this.a.L=c.L,this.a.Dj=c.L,this.a.ue=c.ue,this.a.Oe=c.Oe,this.a.Gb=c.re,this.a.pa=c.jd,this.a.Ka=c.Zd,this.a.zh=c.Gh,this.a.Ah=c.Rg,this.a.kk=c.Hk,this.a.im=c.gj,this.xf=new Uint32Array(this.fc),d=0;d<this.fc;d+=1)this.xf[d]=PatternManager.Wc[d];else this.af=!1,this.$i=0,this.pf=!1,this.Bf=this.Af=
0,this.wf=this.tf=this.Pa=this.yb="",this.yf=this.fc=this.nb=this.Qa=0,this.Rd="(none)",this.a.oc=!1,this.a.L=!1,this.a.ue=!1,this.a.Oe=-1,this.a.Dj=!1,this.a.u=-1,this.a.Gb=-1;this.Kb=!1;this.qd=!0;this.bb=g.vm;this.Lc=!1;this.Fh=!0;this.aj=!1;this.ua.j=this.a.L;this.Ia=PatternManager.Ia;this.a.X=!0;this.a.Kc=-1===this.a.u?!1:!0;this.a.Oj=-1;this.a.Fj=g.um;this.ha=this.ga=0;this.vc=this.pe=-1;this.Gg=!1;this.Le=this.df=this.w.locked=!1;this.a.rp();this.a.sp();this.a.oc&&((PatternManager.Wc[2]||PatternManager.Wc[3]||
PatternManager.Wc[4]||PatternManager.Wc[5]||PatternManager.Wc[6])&&this.a.So(),PatternManager.Wc[6]&&this.a.Uo());this.Ha="";this.dh=!1;ColourManager.Nd();this.a.Oo();this.a.No();this.a.Io();this.a.oc?this.a.Ke(10,1):-1!==this.a.u?this.a.Ke(11,1):this.a.Ke(1,1);this.a.pm();this.a.Qb(1);this.sb=60;this.G=1;this.a.o=1;this.a.pc=.1;this.a.angle=0;this.a.zoom=6;this.a.F=this.a.width/2;this.a.A=this.a.height/2;this.mh=this.lh=this.nh=!1;this.Se=this.fd=-1;this.f[g.Kf]=-1;this.f[g.Ig]=-1;this.f[g.Gi]=-1;
this.f[g.Lf]=-1;this.f[g.Ii]=-1;this.f[g.Oi]=-1;this.f[g.Pi]=-1;this.f[g.Qi]=-1;this.f[g.Ri]=-1;this.f[g.Hi]=-1;this.f[g.Li]=-1;this.f[g.Ki]=-1;this.f[g.Ji]=-1;this.f[g.Mi]=-1;this.f[g.Ni]=-1;this.Z&&(this.Gl(),this.resize());this.lg=!1;this.g.Z=!1;this.wb=g.wm;this.kg=!1;this.xb=this.Jb=this.g.nr=!1;this.a.Bb=!1;this.S.j=!1;this.nc.j=!1;this.ca.j=!1;this.Wa.j=!1;this.pd.j=!1;this.ub.j=!1;this.Ma.j=!1;this.Mb.j=!1;this.w.j=!1;this.rd.j=!1;this.pd.current=[!1];this.nc.current=[!1];this.na=this.B=0;
this.Vf.current=this.ni([this.B],!0,this);this.a.Oc=this.a.fj;this.a.Kd=this.a.Ik;this.a.Nc=10;this.a.bf=!0;this.xe=this.Ce=-1;this.Pb=[96,96,96];this.a.Fg=this.a.ef?4284506208:1616929023;this.V.reset();this.Qd=this.eb=!1;if(c){if(PatternManager.Pg||c.Sb)c.Sb?(this.hc=ColourManager.nm("LifeHistory"),this.hc[2]=96):this.hc=ColourManager.nm(c.ra),this.hc.length?this.ve=c.ra:(this.hc=ColourManager.rk,this.ve="(default)");this.mo();c.title&&(this.jo(c.title,c.De),myRand.Nd(this.kh),this.Db.length&&(this.na=
1),this.Z&&b&&(this.Z=!1),-1<this.fd&&(this.fd&=-8,this.fd!==this.s&&(this.s=this.fd,l=!0)),-1<this.Se&&this.Se!==this.m&&(this.m=this.Se,l=!0));-1!==this.a.Gb?(d=this.a.pa,e=this.a.Ka,0===d&&(d=c.width),0===e&&(e=c.height)):(d=c.width,e=c.height);this.pf&&(-1!==this.a.Gb?(this.ga+=(this.a.pa>>1)+this.Af,this.ha+=(this.a.Ka>>1)+this.Bf):(this.ga+=(c.width>>1)+this.Af,this.ha+=(c.height>>1)+this.Bf));for(;this.a.width<this.a.ib&&(d+g.rc+2*Math.abs(this.ga)>=this.a.width||e+g.rc+2*Math.abs(this.ha)>=
this.a.height);)this.a.Lm(),this.Hb+=this.a.width>>2,this.Ng+=this.a.height>>2,this.Cb+=this.a.width>>2,this.eg+=this.a.height>>2,this.a.L&&(this.Hb-=this.a.height>>3,this.Cb-=this.a.height>>3);this.a.oc&&PatternManager.Wc[6]&&this.a.Vp(c,this.ga,this.ha);this.ia?this.g.notification.mk="rgb("+this.ia[0]+","+this.ia[1]+","+this.ia[2]+")":this.g.notification.mk=this.g.notification.un;if(!this.W.length)for(d=0;d<this.hc.length;d+=1)this.Ed[d]=PatternManager.Wc[d]?g.Ln:g.El;this.a.bc?(this.a.Po(this.hc,
this.W),this.a.qe=!0):this.a.qe=!1;this.tq(c);this.a.Oq();this.gc.kb=""!==this.Pa?this.Pa:this.yb;this.gc.M="rule "+this.yb;""!==this.Pa&&(this.gc.M+=" alias "+this.Pa)}this.Md.current=this.Cg([this.bb,this.bb],!1,this);this.Vg.current=[this.qd];this.me.current=[this.Sa];this.Uf.current=[this.a.Bb];this.a.gq(this.Le);this.a.xn();this.Xd=this.elapsedTime=this.a.i=0;this.Jb?(c&&0<this.W.length&&(this.hc=this.W),this.a.Ro(this.hc),this.a.Vc.reset()):(-1===this.a.u&&this.a.iq(this.a.hb),this.a.oc&&PatternManager.Wc[2]&&
this.a.Lo(c,this.ga,this.ha),this.a.jq(this.a.hb),-1!==this.a.Gb&&this.a.En(),this.a.rq(this.Qd),this.a.ol(this.Qd));this.a.yn();c&&(c.Be=null);d=this.a.zoom;e=this.a.F;h=this.a.A;k=this.Z;this.Z=!1;this.Yd(!0,!1);this.Z=k;this.nh&&(this.a.zoom=d);this.lh&&(this.a.F=e);this.mh&&(this.a.A=h);this.eb&&this.so(this.Db);this.xm=this.a.zoom;this.za&&(this.za.current=this.ke([this.a.zoom,this.a.zoom],!1,this));this.Hb=this.a.F;this.Ng=this.a.A;this.Kg=this.a.angle;this.ua&&(this.ua.current=[this.Kg,this.Kg]);
this.Nf=this.a.Ad;this.Mb&&(this.Mb.current=[this.Nf,this.Nf]);this.uk=this.sb;d=Math.sqrt((this.uk-g.nd)/(g.hf-g.nd));this.ca&&(this.ca.current=this.Ne([d,d],!0,this));this.Si=this.G;this.Wa&&(this.Wa.current=this.sg([this.Si,this.Si],!0,this));this.Mg=this.a.o;this.ub&&(this.ub.current=[this.Mg,this.Mg]);this.tk=this.a.pc;d=Math.sqrt(this.tk);this.Ma&&(this.Ma.current=this.rg([d,d],!0,this));this.X=!0;this.wd&&!this.Xe?(this.tb=!0,this.S.current=g.Xg):(this.tb=!1,this.S.current=g.Ja);this.Fn(this.tb);
this.m<g.Uh?(this.pd.j=!0,this.S.x=this.th+45,this.S.sd=this.S.x,this.ca.x=this.oh+45,this.ca.sd=this.ca.x,this.Wa.x=this.yh+45):(this.S.x=this.th,this.S.sd=this.S.x,this.ca.x=this.oh,this.ca.sd=this.ca.x,this.Wa.x=this.yh);this.Wa.sd=this.Wa.x;if(l||this.Z)this.Z&&this.Hl(),this.resize();c||(PatternManager.Me?this.g.notification.D("Pattern too big!",g.Ak,!1):this.g.notification.D("Invalid pattern!",g.Ak,!1));this.Db.length?this.B=0:this.na=0;this.Na||(this.xb=!0);this.xb?(this.S.j=!0,this.nc.j=!0,
this.rd.j=!0,this.ca.j=!0,this.Wa.j=!0,this.Jb&&(this.ub.j=!0,this.Ma.j=!0,this.Mb.j=!0,this.a.o=1),this.Ic.j=!1,""===this.Ia?this.Ic.kb=f.vi:this.Ic.kb=this.Ia):this.Ic.j=!0;this.Yn();this.nl(null,6,14,0);this.qc=!1;this.pj="";this.Cn(this);this.g.ng=!0;this.g.rf(!0);this.kd&&this.Qj&&(""===this.Ha?this.Qj.nodeValue="LifeViewer":this.Qj.nodeValue=this.br(this.Ha))};registerEvent(window,"load",k,!1);window.Keywords=f;window.ViewConstants=g;window.startAllViewers=k;window.updateViewer=a;window.updateMe=
function(a){var b=d(a).getElementsByTagName(m.bg)[0];a=l.Nb[0];b.innerHTML=b.value;b=e(b);a[1].Tl(a[1]);a[1].g.notification.clear(!0,!0);a[1].g.notification.clear(!1,!0);a[1].Cl(b,!1)};window.hideViewer=p;window.launchInMolly=c})();