0x6f73…175b

All memos sent from and to 0x6f73…175b.

The concept of barbarism always refers to “the other”, accentuating the dichotomy between us and them, right and wrong, form and matter, space and time, human and nature. Yet here, in this landscape of contradictions, these divisions are not so clear-cut after all.
In aerial photos from 1945, you can see dozens of buildings crammed around the main street of Gallarta - a town 13 km northwest of Bilbao. The street leads to a small open pit where they extract iron. Images from 1956 and 1965 show how the road becomes shorter, and houses once surrounded by fields are now on the pit's edge. Some of them disappeared to facilitate access to the ore. The mine grew, consuming mountains, meadows, and settlements. Gallarta disappeared in 1977, replaced by a chasm extending across the area until today. The open pit extraction in the mine stopped being profitable only six years later. The scar it left on the surface of the mountainous area is a monument to the disappearance of this and numerous other towns with similar stories. Cantera is a project that brings these stories to a non-physical, generative space. It replaces atoms of stone and soil with digital bits. It draws landscapes inspired by the imagery of Basque stone quarries and iron mines and writes narratives about non-existent habitats where the boundaries between extraction, shelter, and natural forms become indistinct.
555:(t,n,s)=>{const i=s(937);var e;function r(t){const n=Math.round(Math.min(255,Math.max(0,t))).toString(16);return 1==n.length?"0"+n:n}function h(t,n,s){const i=Math.sin(s),e=Math.cos(s);return[t*e-n*i,t*i+n*e]}function o(t){const n=Math.floor(t[0]/S);if(n<0||n>=BLOCKS.length)return null;const s=Math.floor(t[1]/S);if(s<0||s>=BLOCKS[n].length)return null;const i=Math.floor((t[2]+Z)/S);if(i<0||i>=BLOCKS[n][s].length)return null;const e=BLOCKS[n][s][i];return e.isEmpty?null:e}function a(t,n,s,i,e,r,h){return!(t[0]<n-.01)&&(!(t[1]<i-.01)&&(!(t[2]<r-.01)&&(!(t[0]>s+.01)&&(!(t[1]>e+.01)&&!(t[2]>h+.01)))))}function l(t,n,s,i){const e=d(i,n);if(Math.abs(e)<=1e-4)return[0,0,0,!1,-10];const r=d([t[0]-s[0],t[1]-s[1],t[2]-s[2]],n)/e;return[s[0]+r*i[0],s[1]+r*i[1],s[2]+r*i[2],!0,r]}function d(t,n){const s=Math.min(t.length,n.length);let i=0;for(let e=0;e<s;e++)i+=t[e]*n[e];return i}function c(t,n,s,i){const e=h(t,n,i);return[e[0],e[1],s]}function u(t,n,s,i,e){let r=function(t,n,s,i){const e=h(n,s,i);return[t,e[0],e[1]]}(t,n,s,i);return c(r[0],r[1],r[2],e)}function f(t,n,s){return[t[0]+s*n[0],t[1]+s*n[1],t[2]+s*n[2]]}function M(t,n,s){const i=[];for(let e=0;e<Math.min(3,t.length);e++)i.push(t[e]+s*(n[e]-t[e]));return i}t.exports={SetSimplex:function(t){e=t},noise:function(t,n,s,i){return Math.round(1e3*e(Math.round(1e3*i*t)/1e3,Math.round(1e3*i*n)/1e3,Math.round(1e3*i*s)/1e3))/1e3},Distance:function(t,n){return Math.sqrt(Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2)+Math.pow(n[2]-t[2],2))},GetBlock:o,RayPlane:l,IsVis:function(t,n,s){return DMAP.ReadN(t[0]/n,(s-t[1])/s)>t[2]-.1},normalize:function(t){let n=t[0],s=t[1],i=t[2];const e=Math.sqrt(n*n+s*s+i*i);return e>.001?(n/=e,s/=e,i/=e,[n,s,i]):[0,0,0]},clamp:function(t,n){let s=t[0],i=t[1],e=t[2];const r=Math.sqrt(s*s+i*i+e*e);return r>n?(s*=n/r,i*=n/r,e*=n/r,[s,i,e]):[s,i,e]},CrossProduct:function(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]},lerp:M,IsFrame:function(t,n,s,i,e,r){return t*e<FRAME+r-e||n*e<FRAME+r-e||t*e>=s*e-FRAME-r||n*e>=i*e-FRAME-r},Rotate:h,RotateZ:c,RotateXZ:u,addVec:f,hashColor:function(t){return"#"+r(t[0])+r(t[1])+r(t[2])+r(255*t[3])},getColorIndices:function(t,n,s,i,e){let r=4*s*(i-1-n-e)+4*t;return[r,r+1,r+2,r+3]},Trace:function(t,n,s,i,e){let r=0;r=n[0]>=0?Math.max(Math.floor((t[0]+.001)/S)*S,0):Math.max(0,Math.floor((t[0]+.001-s)/S)*S);let h=0;if(h=n[0]<=0?Math.min(Math.ceil((t[0]-.001)/S)*S,T):Math.min(T,Math.ceil((t[0]-.001+s)/S)*S),h-r<=.001)return null;let d=0;d=n[1]>=0?Math.max(Math.floor((t[1]+.001)/S)*S,0):Math.max(0,Math.floor((t[1]+.001-s)/S)*S);let c=0;if(c=n[1]<=0?Math.min(Math.ceil((t[1]-.001)/S)*S,T):Math.min(T,Math.ceil((t[1]-.001+s)/S)*S),c-d<=.001)return null;let u=0;u=n[2]>=0?Math.max(Math.floor((t[2]+.001)/S)*S,-Z):Math.max(-Z,Math.floor((t[2]+.001-s)/S)*S);let f=0;if(f=n[2]<=0?Math.min(Math.ceil((t[2]-.001)/S)*S,U):Math.min(U,Math.ceil((t[2]-.001+s)/S)*S),f-u<=.001)return null;const p=new Array;i&&p.push([t[0],t[1],t[2],!0,-1]);for(let s=d;s<c+1;s+=c-d){const i=l([0,s,0],[0,-1,0],t,n);i[3]&&(i[4]<=0||a(i,r,h,d,c,u,f)&&p.push(i))}for(let s=r;s<h+1;s+=h-r){const i=l([s,0,0],[-1,0,0],t,n);i[3]&&(i[4]<=0||a(i,r,h,d,c,u,f)&&p.push(i))}for(let s=u;s<f+1;s+=f-u){const i=l([0,0,s],[0,0,1],t,n);i[3]&&(i[4]<=0||a(i,r,h,d,c,u,f)&&p.push(i))}if(p.length<2)return null;let g=9999,m=-9999,C=9999,R=-9999,x=9999,y=-9999;for(let t=0;t<p.length;t++){const n=p[t][0],s=p[t][1],i=p[t][2];g>n&&(g=n),C>s&&(C=s),x>i&&(x=i),m<n&&(m=n),R<s&&(R=s),y<i&&(y=i)}g=Math.floor((g+.01)/S)*S,C=Math.floor((C+.01)/S)*S,x=Math.floor((x+.01)/S)*S,m=Math.ceil((m-.01)/S)*S,R=Math.ceil((R-.01)/S)*S,y=Math.ceil((y-.01)/S)*S;const w=new Array;for(let t=0;t<p.length;t++)w.push(p[t]);for(let i=C;i<R+1;i+=S){if(i==d||i==c)continue;const e=l([0,i,0],[0,-1,0],t,n);e[3]&&(e[4]<=0||e[4]>s||a(e,g,m,C,R,x,y)&&w.push(e))}for(let i=g;i<m+1;i+=S){if(i==r||i==h)continue;const e=l([i,0,0],[-1,0,0],t,n);e[3]&&(e[4]<=0||e[4]>s||a(e,g,m,C,R,x,y)&&w.push(e))}for(let i=x;i<y+1;i+=S){if(i==u||i==f)continue;const e=l([0,0,i],[0,0,1],t,n);e[3]&&(e[4]<=0||e[4]>s||a(e,g,m,C,R,x,y)&&w.push(e))}if(w.length<2)return null;w.sort((function(t,n){return t[4]-n[4]}));for(let t=0;t<w.length-1;t++){const n=o(M(w[t],w[t+1],.5));if(null!=n){const s=n.Intersect(w[t],w[t+1],e,w[t][4]);if(null!=s)return s}}return null},Diag:function(t,n,s,i){if(BLOCKS[t+i[0]][n+i[1]][s+i[2]].isEmpty)return!1;for(let e=0;e<i.length;e++){const r=[i[0],i[1],i[2]];for(let t=0;t<r.length;t++)e!=t&&(r[t]=0);if((0!=r[0]||0!=r[1]||0!=r[2])&&!BLOCKS[t+r[0]][n+r[1]][s+r[2]].isEmpty)return!1}return!0},myRandom:class{constructor(t){this.rng=new i.impl(t)}rnd(){return this.rng.double()}},Camera:class{constructor(t,n,s,i,e){this.planeO=[t,n,s],this.planeX=u(1,0,0,i,e),this.planeY=u(0,1,0,i,e),this.planeZ=u(0,0,1,i,e)}MoveBack(t){this.planeO=f(this.planeO,this.planeZ,t)}GetVector(){return[-this.planeZ[0],-this.planeZ[1],-this.planeZ[2]]}ScreenP(t,n,s,i){const e=[t[0]-this.planeO[0],t[1]-this.planeO[1],t[2]-this.planeO[2]];return[s/2+d(e,this.planeX)/n,i/2-d(e,this.planeY)/(n*SQUEEZE),-d(e,this.planeZ)]}}}}},n={};function s(i){var e=n[i];if(void 0!==e)return e.exports;var r=n[i]={exports:{}};return t[i](r,r.exports,s),r.exports}s.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return s.d(n,{a:n}),n},s.d=(t,n)=>{for(var i in n)s.o(n,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),(()=>{var t=s(824),n=s(80),i=s(558),e=s(569),r=s(374),h=s(413),o=s(479),a=s(555);try{0==parseInt(tokenData.tokenId)%1e6&&(tokenData.hash="0xa313d17667adeec2cb2d6f2ec328af6e1db15588c007cbd95bca700bcf1e317f"),console.log("Seed: "+tokenData.hash)}catch{}s.g.R=new t.Random,s.g.U=80,s.g.S=8,s.g.T=392,s.g.D=1.5,s.g.Z=S,s.g.TERCHANGE=R.random_dec()<.6,s.g.FLATTEN=R.random_dec()<.4,s.g.STRIPES=Math.round(R.random_dec()),s.g.MILL=R.random_dec()>.36,MILL||(s.g.TERCHANGE=!0);const l=[["graphite",[45,48,53],[214,196,188]],["crimson",[75,43,43],[255,204,185]],["goldblack",[65,62,54],[226,193,142]],["blackAndWhite",[48,48,48],[230,230,230]],["darkgreen",[48,60,58],[203,197,196]],["sepia",[64,57,47],[255,229,192]]];let d=Math.min(l.length-1,Math.max(0,Math.floor(.99*l.length*R.random_dec())));l[d][0];s.g.TERCLR=l[d][1],s.g.CUTCLR=l[d][2];try{document.body.style.backgroundColor="#000000"}catch{}s.g.CAMTYPE=Math.max(0,Math.floor(1.4*R.random_dec())),s.g.FRAME=2,s.g.XYtype=Math.round(R.random_dec()),s.g.Ztype=Math.round(R.random_dec()),s.g.GRID=R.random_dec()>.35,s.g.SMGRID=R.random_dec()>.35;let c=0;const u=R.random_dec();c=0==CAMTYPE?u<.5?.4-1.1*u:-.35-1.1*(u-.5):.33-1.17*u,c>=0&&c<.1&&(c=.1),c<0&&c>-.1&&(c=-.1),c>=-.5&&c<-.4&&(c=-.4),c<-.5&&c>-.6&&(c=-.6),s.g.LV=(0,a.RotateXZ)(0,1,0,.29,c*Math.PI);let f=Math.PI/4,M=-Math.PI/4;s.g.IMG=88*Math.SQRT2,s.g.SQUEEZE=1,1==CAMTYPE&&(s.g.IMG=112,M=0,s.g.SQUEEZE=.99),s.g.FRAME=FRAME*IMG/128,s.g.SQUEEZE*=(-2*FRAME+16*(IMG+2*FRAME)/9)/(16*IMG/9),s.g.IMG+=2*FRAME,s.g.CAM=new a.Camera(-S/2+T/2,S/2+T/2,0,f,M),CAM.MoveBack(500),s.g.landscape=null,s.g.DMAP=null,s.g.BLOCKS=new Array;let p=!1;for(;!p;)try{(0,a.SetSimplex)((0,h.makeNoise3D)(Math.round(1e4*R.random_dec())));const t=Math.round(1e3*(.02+.05*R.random_dec()))/1e3,o=Math.round(1e5*R.random_dec())/1e3,l=Math.round(1e3*(.02+.05*R.random_dec()))/1e3,d=Math.round(1e5*R.random_dec())/1e3;s.g.landscape=new r.Mountain(l,d,t,o),s.g.BLOCKS=new Array;for(let t=0;t<T-S;t+=S){const s=new Array;for(let i=0;i<T-S;i+=S){const e=new Array;for(let s=-Z;s<U;s+=S)e.push(new n.BBlock(t,i,s,S));s.push(e)}BLOCKS.push(s)}const c=1-Math.round(R.random_dec()),u=R.random_dec()<.5;if((0,i.GrowBoxes)([(5+(u?c:0))*S,(5+(u?0:c))*S,4*S]),(0,i.ClearBoxes)(),!MILL)for(let t of BLOCKS)for(let n of t)for(let t of n)t.isEmpty&&(t.isEmpty=!1,t.terrain=1);let f=!0,M=0;for(;f&&M<1e3;){f=!1;for(let t of BLOCKS)for(let n of t)for(let t=0;t<n.length;t++)0==M&&n[t].Resolve(),n[t].isEmpty||n[t].hasTerrain&&n[t].isThin&&0!=t&&(n[t-1].isEmpty||n[t-1].isFlat||n[t].terrain!=n[t-1].terrain&&n[t-1].hasTerrain)&&(n[t].isEmpty=!0,f=!0);for(let t=1;t<BLOCKS.length-1;t++)for(let n=1;n<BLOCKS[t].length-1;n++)for(let s=1;s<BLOCKS[t][n].length-1;s++)BLOCKS[t][n][s].isEmpty||BLOCKS[t][n][s].isTip||((0,a.Diag)(t,n,s,[1,1,0])||(0,a.Diag)(t,n,s,[1,-1,0])||(0,a.Diag)(t,n,s,[1,0,1])||(0,a.Diag)(t,n,s,[1,0,-1])||(0,a.Diag)(t,n,s,[0,1,1])||(0,a.Diag)(t,n,s,[0,1,-1]))&&(f=!0,BLOCKS[t][n][s].isEmpty=!0);M++}let g=new Array;for(let t of BLOCKS)for(let n of t)n[0].isEmpty||(g.push(n[0]),n[0].visited=!0);for(M=0;g.length>0&&M<1e3;){const t=new Array;for(let n of g){const s=n.GetNeigh();for(let n of s)t.push(n)}g=t,M++}for(let t of BLOCKS)for(let n of t)for(let t of n)t.visited||(t.isEmpty=!0);landscape.CalculateLight();for(let t=0;t<BLOCKS.length;t++)for(let s=0;s<BLOCKS[t].length;s++)for(let i=0;i<BLOCKS[t][s].length;i++)BLOCKS[t][s][i].isEmpty?0!=i&&(BLOCKS[t][s][i-1].isEmpty||BLOCKS[t][s][i-1].hasTerrain)||(BLOCKS[t][s][i].roof=!0):(t>0&&(0,n.Continous)(BLOCKS[t-1][s][i],BLOCKS[t][s][i])&&(BLOCKS[t][s][i].contX=!0),s>0&&(0,n.Continous)(BLOCKS[t][s-1][i],BLOCKS[t][s][i])&&(BLOCKS[t][s][i].contY=!0),(0==t||t>0&&BLOCKS[t-1][s][i].isEmpty)&&(BLOCKS[t][s][i].winX=!0),(0==s||s>0&&BLOCKS[t][s-1][i].isEmpty)&&(BLOCKS[t][s][i].winY=!0),i<BLOCKS[t][s].length-1&&(0,n.Continous)(BLOCKS[t][s][i],BLOCKS[t][s][i+1])&&(BLOCKS[t][s][i].contZ=!0));(0,e.SetUpEffects)(),p=!0;break}catch(t){p=!1,console.log("problem. repeating.")}let g=0,m=4,C=self.innerWidth,x=self.innerHeight;try{const t=new URLSearchParams(window.location.search),n=t.get("h"),s=t.get("w");n&&(x=parseInt(n),console.log("set H to "+x)),s&&(C=parseInt(s),console.log("set W to "+C))}catch{C=self.innerWidth,x=self.innerHeight}const y=document.createElement("canvas");y.id="sumCanvas",y.style.maxWidth="100%",y.style.maxHeight="100%",y.style.zIndex=999,s.g.birdCtx=y.getContext("2d"),document.body.prepend(y),s.g.mainCanvas=document.createElement("canvas"),mainCanvas.id="mainCanvas",mainCanvas.style.display="none",s.g.mainCtx=mainCanvas.getContext("2d",{willReadFrequently:!0}),document.body.prepend(mainCanvas),function(t,n){let i=Math.min(18*Math.ceil(t/18),18*Math.ceil(n/32));i=18*Math.ceil(Math.max(90,i,Math.min(900,3*i))/18);let e=Math.round(16*i/9);console.log("best size for w="+t+", h="+n+" is "+i+"x"+e),mainCanvas.width=Math.round(i),mainCanvas.height=Math.round(e),y.width=mainCanvas.width,y.height=mainCanvas.height,g=0,m=4*Math.min(20,Math.round(Math.max(1,3200/Math.max(1,mainCanvas.height)))),s.g.DMAP=new r.Array2D(Math.min(mainCanvas.width,900),Math.min(mainCanvas.height,1600),0)}(C,x),setInterval((function(){!function(){const t=IMG/Math.max(1,mainCanvas.width);if(g<m){if((0,o.renderLight)(g,5e3,t,mainCanvas.width,mainCanvas.height),0==g)try{for(let n=0;n<100;n++)(0,e.RenderBirds)(t,mainCanvas.width,mainCanvas.height)}catch{}if(3==g)try{(0,e.SetUpPeople)(t,mainCanvas.width,mainCanvas.height)}catch{}}birdCtx.drawImage(mainCanvas,0,0);try{if(g>3&&(0,e.RenderBirds)(t,mainCanvas.width,mainCanvas.height),g<m){birdCtx.fillStyle=(0,a.hashColor)([CUTCLR[0]+.5*(255-CUTCLR[0]),CUTCLR[1]+.5*(255-CUTCLR[1]),CUTCLR[2]+.5*(255-CUTCLR[2]),1]),birdCtx.beginPath(),birdCtx.arc(mainCanvas.width/2,mainCanvas.height/2,mainCanvas.width/16,0,2*Math.PI),birdCtx.fill(),birdCtx.fillStyle=(0,a.hashColor)([TERCLR[0],TERCLR[1],TERCLR[2],.9]);let t=Math.round(100*(g+1)/m)+"%";birdCtx.font=.031*mainCanvas.width+"px monospace",birdCtx.textAlign="center",birdCtx.textBaseline="ideographic",birdCtx.fillText(t,.499*mainCanvas.width,.015*mainCanvas.width+mainCanvas.height/2)}}catch{}g++,g>1e4&&(g=1e4)}()}),80)})()})();
374:(t,n,s)=>{const i=s(555);class e extends Array{constructor(t,n,s){super(),this.orgRnd=s,this.conRand=new i.myRandom(Math.round(1e3*s)),this.indRand=new i.myRandom(Math.round(1e3*R.random_dec()));for(let s=0;s<t;s++){const t=new Array;for(let s=0;s<n;s++)t.push(0);this.push(t)}}WriteN(t,n,s){const i=Math.max(0,Math.min(this.length-1,Math.round(n*this.length))),e=Math.max(0,Math.min(this[i].length-1,Math.round(s*this[i].length)));this[i][e]=t}ReadN(t,n){const s=Math.max(0,Math.min(this.length-1,t*this.length)),i=Math.max(0,Math.min(this[0].length-1,n*this[0].length));return this.Eval(s,i,!0)[2]}Grow(t,n,s,i,e){this.NoiseGrowth(12*(.155+.65*this.conRand.rnd()),100*this.conRand.rnd(),.025,-.5*this.conRand.rnd()-.5,.5+.5*this.conRand.rnd(),!1,1,1,e),this.NoiseGrowth(12*(.45+.65*this.conRand.rnd()),100*this.conRand.rnd(),.025,-.5*this.conRand.rnd()-.5,1,!0,10*this.conRand.rnd(),.03+.06*this.conRand.rnd(),e),this.NoiseGrowth(8,100*this.conRand.rnd(),.006,-.5*this.conRand.rnd()-.5,.5+.5*this.conRand.rnd(),!1,1,1,e),this.Erode(15e3,.05,30,.2,.06,!0,2*t,n,2*s,i),this.Resize(T,T),this.NoiseGrowth(24,100*this.conRand.rnd(),.004,-.25*this.conRand.rnd()-.75,1,!1,100*this.conRand.rnd(),.012,e);const r=100*this.conRand.rnd();this.NoiseGrowth(24*.67,100*this.conRand.rnd(),.012,-.3*this.conRand.rnd()-.3,1,!0,r,.012,e),this.NoiseGrowth(7.92,100*this.conRand.rnd(),.022,-.3*this.conRand.rnd()-.3,1,!0,r,.012,e),this.NoiseGrowth(6,100*this.conRand.rnd(),.015,-1,1,!0,10*this.conRand.rnd(),.012,e),this.Erode(7e4,.05,40,.2,.05,!0,t,n,s,i),this.Normalize(),this.Resize(2*T,2*T),this.Erode(1e5,.05,40,.2,.05,!0,t/2,n,s/2,i)}NoiseGrowth(t,n,s,e,r,h,o,a,l){const d=this.RandomTransformation();for(let c=0;c<this.length;c++)for(let u=0;u<this[c].length;u++){const f=i.Rotate(c*d[1],u*d[2],d[0]),M=(Math.min(r,Math.max(e,(l?-1:1)*i.noise(f[0],f[1],n,s)))-e)/Math.max(.1,r-e)*(h?.75+.75*Math.min(.5,Math.max(-.5,(l?-1:1)*i.noise(c,u,o,a))):1);this[c][u]=Math.round(1e3*(this[c][u]+Math.round(1e3*t*M/30)/1e3))/1e3}}Curvature(t,n,s){return 10*(this.Eval(t,n,!0)[2]-this.MidH(t,n,s))}MidH(t,n,s){return(this.Eval(t-s,n-s,!0)[2]+this.Eval(t-s,n+s,!0)[2]+this.Eval(t+s,n+s,!0)[2]+this.Eval(t+s,n-s,!0)[2])/4}Eval(t,n,s){const i=Math.max(0,Math.min(this.length-2,t)),e=Math.max(0,Math.min(this[0].length-2,n)),r=Math.max(0,Math.min(this.length-2,Math.floor(i))),h=Math.max(0,Math.min(this[0].length-2,Math.floor(e))),o=i-r,a=e-h,l=this[r][h],d=this[r+1][h],c=this[r][h+1],u=this[r+1][h+1],f=l*(1-o)*(1-a)+d*o*(1-a)+c*(1-o)*a+u*o*a;if(s)return[0,0,Math.round(1e3*f)/1e3];const M=(d-l)*(1-a)+(u-c)*a,p=(c-l)*(1-o)+(u-d)*o;return[Math.round(-1e3*M)/1e3,Math.round(-1e3*p)/1e3,Math.round(1e3*f)/1e3]}Resize(t,n){t<1&&(t=1),n<1&&(n=1);const s=new e(0,0,this.conRand.rnd());if(this.length<2)return s;if(this[0].length<2)return s;const i=(this.length-1)/t,r=(this[0].length-1)/n;for(let e=0;e<t+1;e++){const t=new Array;for(let s=0;s<n+1;s++)t.push(this.Eval(e*i,s*r,!0)[2]);s.push(t)}this.splice(0,this.length);for(let t=0;t<s.length;t++)this.push(s[t])}Normalize(){let t=99999,n=-99999;for(let s=0;s<this.length;s++)for(let i=0;i<this[s].length;i++)t>this[s][i]&&(t=this[s][i]),n<this[s][i]&&(n=this[s][i]);if(Math.abs(n-t)>1)for(let s=0;s<this.length;s++)for(let i=0;i<this[s].length;i++)this[s][i]=Math.round(1e3*(this[s][i]-t)/Math.max(.1,n-t))/1e3;else for(let n=0;n<this.length;n++)for(let s=0;s<this[n].length;s++)this[n][s]=Math.round(1e3*(this[n][s]-t))/1e3}Erode(t,n,s,i,e,h,o,a,l,d){if(this.length-1<1)return;if(this[0].length-1<1)return;const c=this.length-1,u=this[0].length-1;for(let f=0;f<t;f++){let t=Math.round(1e3*this.indRand.rnd()*c)/1e3,f=Math.round(1e3*this.indRand.rnd()*u)/1e3,M=1,p=0;const g=Math.max(1,.5*this.indRand.rnd()*s);let m=0,C=0;const S=1/g;for(let s=0;s<g;s++){let s=Math.floor(t),c=Math.floor(f);if(s<=0||c<=0||s>=this.length-1||c>=this[0].length-1)break;const u=t-s,g=f-c,R=this.Eval(t,f,!1);m=n*m+(1-n)*R[0],C=n*C+(1-n)*R[1];const x=Math.sqrt(m*m+C*C);if(x>.001?(m/=x,C/=x):(m=0,C=0),t+=m,f+=C,t<.5||f<.5||t>this.length-1.5||f>this[0].length-1.5||0==m&&0==C)break;const y=this.Eval(t,f,!0)[2]-R[2],w=Math.max(.01,-y*M*40);if(p>w||y>0){const n=y>0?Math.min(y,p):(p-w)*i*r(t,f,h,l,d);p-=n,this[s][c]=Math.round(1e4*(this[s][c]+n*(1-u)*(1-g)))/1e4,this[s+1][c]=Math.round(1e4*(this[s+1][c]+n*u*(1-g)))/1e4,this[s][c+1]=Math.round(1e4*(this[s][c+1]+n*(1-u)*g))/1e4,this[s+1][c+1]=Math.round(1e4*(this[s+1][c+1]+n*u*g))/1e4}else{const n=Math.min(-y,(w-p)*e*r(t,f,h,o,a)),i=Math.min(n*(1-u)*(1-g),this[s][c]);this[s][c]=Math.round(1e4*(this[s][c]-i))/1e4;const l=Math.min(n*u*(1-g),this[s+1][c]);this[s+1][c]=Math.round(1e4*(this[s+1][c]-l))/1e4;const d=Math.min(n*(1-u)*g,this[s][c+1]);this[s][c+1]=Math.round(1e4*(this[s][c+1]-d))/1e4;const M=Math.min(n*u*g,this[s+1][c+1]);this[s+1][c+1]=Math.round(1e4*(this[s+1][c+1]-M))/1e4,p+=i+l+d+M}M-=S}}this.RoundAll()}RoundAll(){for(let t=0;t<this.length;t++)for(let n=0;n<this[t].length;n++)this[t][n]=Math.round(1e3*this[t][n])/1e3}RandomTransformation(){return[Math.round(1e3*this.conRand.rnd()*Math.PI)/1e3,Math.round(1e3*(1+this.conRand.rnd()))/1e3,Math.round(1e3*(1+this.conRand.rnd()))/1e3]}}function r(t,n,s,e,r){return s?Math.round(1e3*(.25+.75*(Math.min(.5,Math.max(-.5,i.noise(t,n,r,e)))+.5)))/1e3:1}t.exports={Mountain:class{constructor(t,n,s,i){const r=R.random_dec();this.t0=new e(100,100,r),this.t0.Grow(t,n,s,i,!1),this.t1=new e(100,100,r),this.t1.Grow(t,n,s,i,!0);for(let t=0;t<this.t0.length;t++)for(let n=0;n<this.t0[t].length;n++){TERCHANGE||(this.t1[t][n]=this.t0[t][n]);const s=.5*(this.t0[t][n]+this.t1[t][n]);let i=Math.max(0,Math.min(1,(Math.sqrt(t*t+n*n)-630)/150));MILL&&FLATTEN||(i=0),this.t0[t][n]=this.t0[t][n]+i*(s-this.t0[t][n]),this.t1[t][n]=this.t1[t][n]+i*(s-this.t1[t][n])}this.c0=new e(this.t0.length,this.t0[0].length,0),this.c1=new e(this.t0.length,this.t0[0].length,0)}CalculateLight(){for(let t=0;t<this.c0.length;t++)for(let n=0;n<this.c0[t].length;n++){let s=2.5*(.4+.6*this.t0[t][n]);this.c0[t][n]=.3*s*this.t0.Curvature(t,n,20)+.4*s*this.t0.Curvature(t,n,6)+3*s*this.t0.Curvature(t,n,.5),s=2.5*(.4+.6*this.t1[t][n]),this.c1[t][n]=.3*s*this.t1.Curvature(t,n,20)+.4*s*this.t1.Curvature(t,n,6)+3*s*this.t1.Curvature(t,n,.5)}}Evaluate(t,n,s){let i=0;const e=2*(t+S/2)%(this.t0.length-1),r=2*(n+S/2)%(this.t0[0].length-1);return i=s.terrain<.5?this.t0.Eval(e,r,!0)[2]:this.t1.Eval(e,r,!0)[2],i}Color(t,n,s){let i=0;const e=2*(t+S/2)%(this.c0.length-1),r=2*(n+S/2)%(this.c0[0].length-1);return i=s.terrain<.5?this.c0.Eval(e,r,!0)[2]:this.c1.Eval(e,r,!0)[2],i}},Array2D:e}},413:t=>{function n(t){let n=new Uint32Array(1);return n[0]=1664525*t[0]+1013904223,n}const s=(Math.sqrt(4)-1)/3,i=(1/Math.sqrt(4)-1)/3;function e(t,n,i,e){return{dx:-n-t*s,dy:-i-t*s,dz:-e-t*s,xsb:n,ysb:i,zsb:e}}const r=[[0,0,0,0,1,1,0,0,1,0,1,0,1,0,0,1],[2,1,1,0,2,1,0,1,2,0,1,1,3,1,1,1],[1,1,0,0,1,0,1,0,1,0,0,1,2,1,1,0,2,1,0,1,2,0,1,1]],h=[-11,4,4,-4,11,4,-4,4,11,11,4,4,4,11,4,4,4,11,-11,-4,4,-4,-11,4,-4,-4,11,11,-4,4,4,-11,4,4,-4,11,-11,4,-4,-4,11,-4,-4,4,-11,11,4,-4,4,11,-4,4,4,-11,-11,-4,-4,-4,-11,-4,-4,-4,-11,11,-4,-4,4,-11,-4,4,-4,-11],o=[0,2,1,1,2,2,5,1,6,0,7,0,32,2,34,2,129,1,133,1,160,5,161,5,518,0,519,0,546,4,550,4,645,3,647,3,672,5,673,5,674,4,677,3,678,4,679,3,680,13,681,13,682,12,685,14,686,12,687,14,712,20,714,18,809,21,813,23,840,20,841,21,1198,19,1199,22,1226,18,1230,19,1325,23,1327,22,1352,15,1353,17,1354,15,1357,17,1358,16,1359,16,1360,11,1361,10,1362,11,1365,10,1366,9,1367,9,1392,11,1394,11,1489,10,1493,10,1520,8,1521,8,1878,9,1879,9,1906,7,1910,7,2005,6,2007,6,2032,8,2033,8,2034,7,2037,6,2038,7,2039,6],a=[0,0,1,-1,0,0,1,0,-1,0,0,-1,1,0,0,0,1,-1,0,0,-1,0,1,0,0,-1,1,0,2,1,1,0,1,1,1,-1,0,2,1,0,1,1,1,-1,1,0,2,0,1,1,1,-1,1,1,1,3,2,1,0,3,1,2,0,1,3,2,0,1,3,1,0,2,1,3,0,2,1,3,0,1,2,1,1,1,0,0,2,2,0,0,1,1,0,1,0,2,0,2,0,1,1,0,0,1,2,0,0,2,2,0,0,0,0,1,1,-1,1,2,0,0,0,0,1,-1,1,1,2,0,0,0,0,1,1,1,-1,2,3,1,1,1,2,0,0,2,2,3,1,1,1,2,2,0,0,2,3,1,1,1,2,0,2,0,2,1,1,-1,1,2,0,0,2,2,1,1,-1,1,2,2,0,0,2,1,-1,1,1,2,0,0,2,2,1,-1,1,1,2,0,2,0,2,1,1,1,-1,2,2,0,0,2,1,1,1,-1,2,0,2,0];t.exports={makeNoise3D:function(t){const l=[];for(let t=0;t<a.length;t+=9){const n=r[a[t]];let s=null,i=null;for(let r=0;r<n.length;r+=4)i=e(n[r],n[r+1],n[r+2],n[r+3]),null===s?l[t/9]=i:s.next=i,s=i;i.next=e(a[t+1],a[t+2],a[t+3],a[t+4]),i.next.next=e(a[t+5],a[t+6],a[t+7],a[t+8])}const d=[];for(let t=0;t<o.length;t+=2)d[o[t]]=l[o[t+1]];const c=new Uint8Array(256),u=new Uint8Array(256),f=new Uint8Array(256);for(let t=0;t<256;t++)f[t]=t;let M=new Uint32Array(1);M[0]=t,M=n(n(n(M)));for(let t=255;t>=0;t--){M=n(M);const s=new Uint32Array(1);s[0]=(M[0]+31)%(t+1),s[0]<0&&(s[0]+=t+1),c[t]=f[s[0]],u[t]=c[t]%24*3,f[s[0]]=f[t]}return function(t,n,e){const r=(t+n+e)*i,o=t+r,a=n+r,l=e+r,f=Math.floor(o),M=Math.floor(a),p=Math.floor(l),g=(f+M+p)*s,m=t-(f+g),C=n-(M+g),S=e-(p+g),R=o-f,x=a-M,y=l-p,w=R+x+y;let E=0;for(let t=d[x-y+1|R-x+1<<1|R-y+1<<2|w<<3|w+y<<5|w+x<<7|w+R<<9];void 0!==t;t=t.next){const n=m+t.dx,s=C+t.dy,i=S+t.dz,e=2-n*n-s*s-i*i;if(e>0){const r=f+t.xsb,o=M+t.ysb,a=p+t.zsb,l=c[255&r],d=c[l+o&255],g=u[d+a&255];E+=e*e*e*e*(h[g]*n+h[g+1]*s+h[g+2]*i)}}return.009708737864077669*E}}}},479:(t,n,s)=>{const i=s(555);var e=new i.myRandom(0);function r(t,n,s,i,r,h){return t*r+h>FRAME-r&&t*r-h<FRAME-r||n*r+h>FRAME-r&&n*r-h<FRAME-r||t*r+h>s*r-FRAME&&t*r-h<s*r-FRAME||n*r+h>i*r-FRAME&&n*r-h<i*r-FRAME?.1+.4*e.rnd():0}function h(t,n){return 3==t[3]?n<.5||n>1.1:t[3]==(STRIPES>.5?2:1)?n<.6||n>1.1:0==t[3]&&2*t[5]<t[2]/U-.1}function o(t,n,s){const i=t%n;return i<s||i>n-s?.1+.35*e.rnd():0}function a(t,n,s){return 0==t[3]||3==t[3]?Math.max(o(t[0],n,s),o(t[1],n,s)):0}function l(t,n){if(0==t[3]||3==t[3])return 0;const s=Math.floor((t[0]+.1)/S),r=Math.floor((t[1]+.1)/S),h=Math.floor((t[2]+.1+Z)/S),o=1+.6*Math.round(.5+.5*i.noise(s,r,h,.23));let a=t[0]+100*t[1],l=t[2]+Z;1==t[3]&&(a=100*t[0]+t[1]+100*S);const d=(a+.4*n*(e.rnd()-.5))%o,c=(l+.4*n*(e.rnd()-.5))%2,u=Math.floor(a/o),f=Math.floor(l/2);if(c+t[5]<3)return 0;const M=1.2*(.12+.12*Math.round(.5+.5*i.noise(u,f,0,1.3))),p=.25+.4*Math.round(.5+.5*i.noise(u,f,77,.73));if(d<M)return 0;if(d>o-M)return 0;if(c<p)return 0;if(c>1.5)return 0;if(i.noise(u,f,11,6.73)<.15)return 0;return(i.noise(u,f,-11,4.73)>.4?1:-.75)*(.6+.3*Math.round(.5+.5*i.noise(u,f,-111,7.73))/2)*(.5+.5*e.rnd())}function d(t,n){const s=Math.floor(2*t[0]),r=Math.floor(2*t[1]),h=Math.floor(2*(t[2]+Z));let o=0,a=0,l=0;return 0==n||3==n?Ztype>.5?(l=t[0],o=h,a=r):(l=t[1],o=s,a=h):2==n?XYtype>.5?(l=t[0],o=r,a=h):(l=t[2],o=s,a=r):XYtype>.5?(l=t[1],o=h,a=s):(l=t[2],o=r,a=s),e.rnd()-.5+.15*Math.sin(.125*l+3*Math.floor(.2*l*i.noise(o,a,0,2134.567))+122*i.noise(o,0,a,2134.567))}t.exports={renderLight:function(t,n,c,u,f){0==t&&(mainCtx.fillStyle="#000000",mainCtx.fillRect(-10,-10,u+20,f+20));const M=Math.floor(t/2)%2==0,p=t%2%2==0;e=new i.myRandom(t);const g=Math.floor(t/4),m=CAM.planeY,C=CAM.planeX;let R=CAM.GetVector();const x=Math.max(10,Math.round(1e6/u));let y=Math.ceil(f/x),w=0,E=f;const b=Math.round(u/2),A=-b,L=Math.round(f/2);for(let v=0;v<y;v++){const B=Math.min(x,E);try{console.log("rendering pass "+(t+1)+", fragment "+(v+1)+"/"+y)}catch{}w+=B,E-=B;const P=mainCtx.getImageData(0,E,u,B),O=P.data,I=-L+w-B,G=-L+w;for(let t=A;t<b;t++){const x=t+b;if((!M||x%2!=1)&&(M||x%2!=0))for(let M=I;M<G;M++){const y=M+L;if(p&&y%2==1)continue;if(!p&&y%2==0)continue;let w=i.addVec(CAM.planeO,C,c*(t+e.rnd()));w=i.addVec(w,m,SQUEEZE*c*(M+e.rnd()));const b=i.getColorIndices(x,y,u,f,E),A=[O[b[0]],O[b[1]],O[b[2]]];let v=[0,0,0];s.g.D=1;let B=i.Trace(w,R,n,!1,!1);const P=i.IsFrame(x,y,u,f,c,0);if(null==B||P){const t=i.RayPlane([0,0,-Z],[0,0,1],w,R);t[3]&&(B=[t[0],t[1],t[2],3,P?500:t[4],200])}if(null!=B){let t=[0,0,0];t=0==B[3]?i.addVec(B,[0,0,1],.045*S*e.rnd()+.05):i.addVec(B,R,-.02*S*e.rnd()-.02);let n=0;DMAP.WriteN(P?0:B[4],x/u,y/f);let M=.2*(P?0:1-(B[2]+Z+12)/(Z+U+25))+.9*Math.min(1,Math.max(0,B[4]-410)/370);s.g.D=8;for(let s=0;s<2;s++)if(e.rnd()>.2+.8*M&&!P){const s=i.Trace(t,i.RotateXZ(LV[0],LV[1],LV[2],.2*(e.rnd()-.5),.15*(e.rnd()-.5)),.2*T,!0,!0);n+=null!=s?(1.25*Math.min(1,s[0]/(.2*T))+.125)/2:.5675}else n+=P?.75-.4*Math.pow(e.rnd(),2):.06*e.rnd()+.12;P||3!=B[3]||(n*=1.1+.2*e.rnd()),n+=l(B,.1+.4*M)*(1.3-.5*M),!P&&h(B,n)&&(n-=2*o(B[STRIPES>.5?0:1],S/16,.08)),!P&&GRID&&(n-=a(B,S,.125)*(SMGRID?.5:1)),!P&&SMGRID&&(n-=.8*a(B,S/2,.125)),n-=2*r(x,y,u,f,c,.125);const p=(1-.2*n)*d(B,B[3])*(1-M);let g=0==B[3]?1.125*(n+.125+.3*p):1.125*(n+.3*p);0==B[3]&&(g=1.22*g+(.5+e.rnd())*B[5]),P||(g=1.35*g-.1);let m=[TERCLR[0],TERCLR[1],TERCLR[2]];0!=B[3]&&(m=[CUTCLR[0],CUTCLR[1],CUTCLR[2]]);const C=P?.3:M/1.5,w=3==B[3]?125:155;m[0]+=C*(w-m[0]),m[1]+=C*(w-m[1]),m[2]+=C*(w-m[2]),v=[m[0]*g,m[1]*g,m[2]*g]}O[b[0]]=g*A[0]/(g+1)+v[0]/(g+1),O[b[1]]=g*A[1]/(g+1)+v[1]/(g+1),O[b[2]]=g*A[2]/(g+1)+v[2]/(g+1)}}mainCtx.putImageData(P,0,E)}}}},
569:(t,n,s)=>{const i=s(555),e=1.6,r=[[-5,89,-5,96,-4,98,-1,100,1,100,6,96,5,89,4,86,5,85,8,85,14,78,17,61,14,60,13,59,11,47,9,43,8,10,10,3,7,0,4,0,0,30,2,7,1,1,-5,1,-7,1,-3,6,-10,43,-13,58,-15,61,-17,66,-11,81,-4,85,-4,86],[-2,100,3,99,5,95,5,93,6,92,5,91,5,86,2,86,0,84,4,80,10,67,10,63,8,62,6,61,10,29,6,5,12,2,12,1,11,0,0,0,-2,1,2,27,2,34,-4,10,-1,4,-2,0,-7,0,-9,1,-9,3,-7,41,-12,77,-11,82,-6,87,-5,89,-8,94,-6,99,-3,100],[1,100,5,97,5,88,12,84,15,62,7,25,7,13,5,10,4,1,-5,1,-6,3,-6,40,-9,44,-11,46,-12,48,-15,79,-10,84,-8,88,-6,90,-6,98,-2,100],[1,101,6,98,6,93,5,89,5,88,14,77,14,44,11,43,6,6,7,2,7,0,-2,-1,-2,1,0,3,1,4,1,35,-1,40,-3,1,-4,0,-14,-1,-14,1,-11,2,-10,4,-11,58,-11,63,-12,64,-13,67,-6,84,-3,86,-4,87,-6,88,-6,97,-4,100],[-6,98,-8,86,-13,80,-13,64,-12,63,-9,10,-11,2,-11,1,-4,0,-5,9,-1,41,4,6,3,3,3,0,12,0,12,2,8,8,10,48,13,50,12,56,8,63,13,64,13,73,8,87,6,88,5,97,3,99,-2,100],[5,89,5,96,3,100,-2,99,-5,98,-5,95,-5,87,-14,81,-18,68,-16,65,-14,62,-11,62,-12,49,-9,25,-10,6,-15,1,-14,0,-4,1,-5,4,-4,6,-4,8,0,44,1,44,3,2,4,1,10,1,11,6,10,8,11,63,13,63,18,66,15,81,5,88],[-3,98,-1,100,5,100,6,97,6,88,7,86,7,85,10,82,11,47,9,43,10,6,11,3,11,1,-10,1,-11,3,-4,7,-9,62,-11,67,-6,79,-2,82,-1,84,-1,85,-2,87,-4,87,-4,95]];var h=new i.myRandom(1),o=new Array,a=new Array,l=new Array;function d(t,n,s,i,r){if(t.isEmpty&&t.roof)for(let o=0;o<n;o++)for(let a=0;a<n;a++)for(let d=0;d<10;d++){const d=t.x0+(.2+.6*h.rnd())*(t.x1-t.x0)/n+o*(t.x1-t.x0)/n,c=t.y0+(.2+.6*h.rnd())*(t.y1-t.y0)/n+a*(t.y1-t.y0)/n,f=t.z0+.1,M=t.z0+1.92+.1,p=CAM.planeX[0]*e/4,g=CAM.planeX[1]*e/4,m=new u(d,c,f,.02*(.5+.5*h.rnd())),C=new u(d-p,c-g,f,0),S=new u(d+p,c+g,f,0),R=new u(d-p,c-g,M,0),x=new u(d+p,c+g,M,0);if(m.BrighAndOp(s,i,r),C.BrighAndOp(s,i,r),S.BrighAndOp(s,i,r),R.BrighAndOp(s,i,r),x.BrighAndOp(s,i,r),m.UpdateColor((C.bright+S.bright+x.bright+R.bright)/4),m.isVis&&C.isVis&&S.isVis&&x.isVis&&R.isVis){m.rand.rnd()>.1+.4*m.bright&&l.push(m);break}}}class c{constructor(t,n,s){this.brease=!0,this.firstpass=!0,this.pos=[t,n,s],this.rPos=[t,n,s],this.scPos=[0,0,0],this.rand=new i.myRandom(Math.round(1e3*h.rnd())),this.speed=.25+1.5*this.rand.rnd(),this.bright=0,this.oldb=0,this.opacity=0;const e=this.rand.rnd();this.clr=[255,255,255],e<.4?this.clr=CUTCLR:e<.6&&(this.clr=[1.75*TERCLR[0],1.75*TERCLR[1],1.75*TERCLR[2]]),this.isVis=!1,this.die=0,this.alone=0}BrighAndOp(t,n,e){this.scPos=CAM.ScreenP(this.rPos,t,n,e);const r=1-.33*Math.max(0,Math.min(1,(this.scPos[2]-400)/350));if(this.isVis=!i.IsFrame(this.scPos[0],this.scPos[1],n,e,t,.5)&&i.IsVis(this.scPos,n,e),this.rand.rnd()<.05&&this.brease||this.firstpass){s.g.D=S/2;const t=this.brease?1:0,n=i.Trace(this.rPos,i.RotateXZ(LV[0],LV[1],LV[2],.2*t*(this.rand.rnd()-.5),.15*t*(this.rand.rnd()-.5)),.2*T,!0,!0),e=null==n?1:Math.min(1,n[0]/(.2*T));this.oldb=e*(this.brease?1.2+.6*this.rand.rnd():1)}const h=this.isVis&&this.die<.5&&this.alone<30?1:0;return this.opacity=this.opacity+(h-this.opacity)*(this.firstpass?1:.75),this.bright=this.bright+(this.oldb*(.5+.5*h)-this.bright)*(this.firstpass?1:.25),this.firstpass=!1,r}}class u extends c{constructor(t,n,s,i){super(t,n,s),this.delta=i,this.ind=Math.max(0,Math.min(r.length-1,Math.floor(.999*this.rand.rnd()*r.length))),this.flip=this.rand.rnd()>.5?1.25:-1.25,this.brease=!1,this.age=20*this.rand.rnd()}UpdateColor(t){this.bright=t,this.rand.rnd()<.6*this.bright+.2&&(this.clr=[TERCLR[0]/1.6,TERCLR[1]/1.6,TERCLR[2]/1.6])}Render(t,n,s){this.age-=this.delta,this.age<=0&&(this.age=20);const h=this.BrighAndOp(t,n,s),o=.8*Math.min(this.age,10-this.age,.5)*2;if(o>.01){const n=h/t,s=.016*n;birdCtx.beginPath(),birdCtx.moveTo(this.scPos[0]+this.flip*s*r[this.ind][0],this.scPos[1]-s*r[this.ind][1]);for(let t=2;t<r[this.ind].length-1;t+=2)birdCtx.lineTo(this.scPos[0]+this.flip*s*r[this.ind][t],this.scPos[1]-s*r[this.ind][t+1]);birdCtx.closePath();const a=birdCtx.createLinearGradient(this.scPos[0],this.scPos[1]-n*e,this.scPos[0],this.scPos[1]);a.addColorStop(0,i.hashColor([this.clr[0],this.clr[1],this.clr[2],.95*o])),a.addColorStop(1,i.hashColor([this.clr[0],this.clr[1],this.clr[2],.05*o]));const l=birdCtx.createLinearGradient(this.scPos[0],this.scPos[1]-n*e,this.scPos[0],this.scPos[1]);l.addColorStop(0,i.hashColor([0,0,0,.95*o])),l.addColorStop(.5,i.hashColor([0,0,0,.9*o])),l.addColorStop(1,i.hashColor([0,0,0,.05*o])),birdCtx.lineWidth=.04/t,birdCtx.strokeStyle=l;for(let t=0;t<2;t++)birdCtx.stroke();birdCtx.fillStyle=a,birdCtx.fill()}}}class f extends c{constructor(t,n,s){super(t,n,s),this.neigh=new Array,this.RDir(),this.towards=[0,1,0],this.right=[1,0,0]}RDir(){this.forward=[0,1,0];const t=2*Math.PI*this.rand.rnd()-Math.PI,n=2*Math.PI*this.rand.rnd()-Math.PI;this.forward=i.RotateXZ(0,1,0,t,n)}Render(t,n,s){let e=!1;for(let t=0;t<25;t++){e=!0;let t=[this.pos[0],this.pos[1],this.pos[2]];if(this.pos=i.addVec(this.pos,this.forward,.08*this.speed*4),(this.pos[2]>U/1.4&&this.forward[2]>0||this.pos[0]>T&&this.forward[0]>0||this.pos[0]<0&&this.forward[0]<0||this.pos[1]<0&&this.forward[1]<0||this.pos[1]>T&&this.forward[1]>0||this.pos[2]<0&&this.forward[2]<0||null!=i.GetBlock(this.pos))&&(e=!1,this.pos=t,this.RDir()),e){this.die=0;break}}e||this.die++;const r=[.08*(this.pos[0]-this.rPos[0]),.08*(this.pos[1]-this.rPos[1]),.08*(this.pos[2]-this.rPos[2])];this.towards=i.lerp(this.towards,r,.8),this.rPos=i.addVec(this.rPos,this.towards,1);const h=this.BrighAndOp(t,n,s);if(this.opacity>.1){const e=this.bright*(1+.45*this.rand.rnd()),r=i.hashColor([this.clr[0]*e,this.clr[1]*e,this.clr[2]*e,this.opacity]);let o=i.normalize(this.towards),a=[0,0,1],l=[1,0,0];Math.abs(o[2])>.999?(o=[0,0,o[2]>.5?1:-1],l=[this.right[0],this.right[1],0],l=Math.sqrt(l[0]*l[0]+l[1]*l[1])<.1?i.RotateXZ(1,0,0,0,2*Math.PI*this.rand.rnd()):i.normalize(l)):l=i.CrossProduct(o,a),this.right=l,a=i.CrossProduct(l,o);const d=.65*Math.PI*this.rand.rnd()-.35,c=CAM.ScreenP(i.addVec(this.rPos,o,.36*h),t,n,s);for(let e=-1;e<1.2;e+=2){let o=i.RotateZ(e,0,0,e*d);const u=CAM.ScreenP(i.addVec(this.rPos,i.normalize(i.addVec(i.addVec([0,0,0],l,o[0]),a,o[1])),.35*h),t,n,s);birdCtx.fillStyle=r,birdCtx.beginPath(),birdCtx.moveTo(this.scPos[0],this.scPos[1]),birdCtx.lineTo(u[0],u[1]),birdCtx.lineTo(c[0],c[1]),birdCtx.strokeStyle=r,birdCtx.lineWidth=.07/t,birdCtx.stroke(),birdCtx.fill()}}}}t.exports={SetUpEffects:function(){h=new i.myRandom(Math.round(1e3*R.random_dec())),o=new Array,a=new Array;for(let t=0;t<45;t++){const t=new Array;let n=1,s=4;h.rnd()<.08&&(n=8,s=14);const e=n+Math.round(s*h.rnd());for(let n=0;n<150;n++){const n=Math.floor(h.rnd()*T/S)*S+S/2,s=Math.floor(h.rnd()*T/S)*S+S/2,r=Math.floor(h.rnd()*U*.5/S)*S+S/2;if(null==i.GetBlock([n,s,r])){for(let i=0;i<e;i++)t.push(new f(n+2*h.rnd()-1,s+2*h.rnd()-1,r+2*h.rnd()-1));break}}0!=t.length&&(o.push(t),a.push(.1+.5*h.rnd()))}},SetUpPeople:function(t,n,s){l=new Array;for(let i of BLOCKS)for(let e of i)for(let i of e)try{d(i,2,t,n,s)}catch{}l.length<1||l.sort((function(t,n){return t.rPos[2]-n.rPos[2]}))},RenderBirds:function(t,n,s){birdCtx.imageSmoothingEnabled=!1,birdCtx.lineJoin="round";for(let i of l)i.Render(t,n,s);for(let e=0;e<o.length;e++){const r=o[e];for(let t=0;t<r.length;t++)r[t].neigh.splice(0,r[t].neigh.length),0==t&&r[t].rand.rnd()<.005&&r[t].RDir();for(let t=0;t<r.length;t++)try{const n=r[t],s=n.pos[0],i=n.pos[1],h=n.pos[2];if(n.die>5||n.alone>50)for(let t of r)if(!(t.die>0||t.alone>10)){n.die=0,n.alone=0,n.pos=[t.pos[0]+n.rand.rnd()+.01,t.pos[1]+n.rand.rnd()+.01,t.pos[2]+n.rand.rnd()+.01];break}if(t>=r.length-1)continue;for(let o=t+1;o<r.length;o++){if(n.rand.rnd()<a[e])continue;const l=r[o],d=l.pos[0],c=l.pos[1],u=l.pos[2],f=Math.abs(s-d);if(t>0&&f>4)continue;const M=Math.abs(i-c);if(t>0&&M>4)continue;const p=Math.abs(h-u);if(t>0&&p>4)continue;const g=Math.sqrt(f*f+M*M+p*p);t>0&&g>4||(l.neigh.push([t,g]),0==t&&(g>60?(l.alone++,l.alone>99999&&(l.alone=99999)):l.alone=0))}}catch{}for(let e of r)try{let h=[0,0,0],o=[0,0,0],a=!0;for(let t of e.neigh){e.rand.rnd()<.25&&(e.forward=i.lerp(e.forward,r[t[0]].forward,.08));const n=[r[t[0]].pos[0]-e.pos[0],r[t[0]].pos[1]-e.pos[1],r[t[0]].pos[2]-e.pos[2]];(a||e.rand.rnd()<.25)&&(h=i.addVec(h,n,.33)),a=!1;const s=3.5-t[1];s>0&&(o=i.addVec(o,i.normalize(n),-s))}e.forward=i.clamp(e.forward,3.3),e.forward=i.addVec(i.addVec(e.forward,h,.02),o,.04),e.Render(t,n,s)}catch{}}}}},
(()=>{"use strict";var t={824:t=>{t.exports={Random:class{constructor(){this.useA=!1;let t=function(t){let n=parseInt(t.substring(0,8),16),s=parseInt(t.substring(8,16),16),i=parseInt(t.substring(16,24),16),e=parseInt(t.substring(24,32),16);return function(){n|=0,s|=0,i|=0,e|=0;let t=(n+s|0)+e|0;return e=e+1|0,n=s^s>>>9,s=i+(i<<3)|0,i=i<<21|i>>>11,i=i+t|0,(t>>>0)/4294967296}};this.prngA=new t(tokenData.hash.substring(2,34)),this.prngB=new t(tokenData.hash.substring(34,66));for(let t=0;t<1e6;t+=2)this.prngA(),this.prngB()}random_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}}}},937:t=>{function n(t){let n=this,s=(i=4022871197,function(t){t=String(t);for(let n=0;n<t.length;n++){let s=.02519603282416938*(i+=t.charCodeAt(n));s-=i=s>>>0,s*=i,s-=i=s>>>0,i+=4294967296*s}return 2.3283064365386963e-10*(i>>>0)});var i;n.next=function(){let t=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=t-(n.c=0|t)},n.c=1,n.s0=s(" "),n.s1=s(" "),n.s2=s(" "),n.s0-=s(t),n.s0<0&&(n.s0+=1),n.s1-=s(t),n.s1<0&&(n.s1+=1),n.s2-=s(t),n.s2<0&&(n.s2+=1),s=null}function s(t,n){return n.c=t.c,n.s0=t.s0,n.s1=t.s1,n.s2=t.s2,n}t.exports={impl:function(t,i){let e=new n(t),r=i&&i.state,h=e.next;return h.int32=function(){return 4294967296*e.next()|0},h.double=function(){return h()+11102230246251565e-32*(2097152*h()|0)},h.quick=h,r&&("object"==typeof r&&s(r,e),h.state=function(){return s(e,{})}),h}}},80:(t,n,s)=>{const i=s(555);t.exports={BBlock:class{constructor(t,n,s,e){this.x0=t,this.x1=t+e,this.y0=n,this.y1=n+e,this.z0=s,this.z1=s+e,this.indRand=new i.myRandom(Math.round(1e3*(1+i.noise(t,n,s,77.072)))),this.isEmpty=!1,this.isThin=!1,this.isFlat=!1,this.isTip=!1,this.contX=!1,this.contY=!1,this.contZ=!1,this.terrain=MILL?Math.round(.5*i.noise(t,n,0,.02)+.5):0,this.hasTerrain=!1,this.visited=!1,this.winX=!1,this.winY=!1,this.roof=!1}GetNeigh(){const t=new Array;let n=i.GetBlock([this.x0+.1-S,this.y0+.1,this.z0+.1]),s=i.GetBlock([this.x0+.1+S,this.y0+.1,this.z0+.1]),e=i.GetBlock([this.x0+.1,this.y0+.1-S,this.z0+.1]),r=i.GetBlock([this.x0+.1,this.y0+.1+S,this.z0+.1]),h=i.GetBlock([this.x0+.1,this.y0+.1,this.z0+.1-S]),o=i.GetBlock([this.x0+.1,this.y0+.1,this.z0+.1+S]);null==n||n.visited||this.hasTerrain&&n.terrain!=this.terrain||t.push(n),null==s||s.visited||this.hasTerrain&&s.terrain!=this.terrain||t.push(s),null==e||e.visited||this.hasTerrain&&e.terrain!=this.terrain||t.push(e),null==r||r.visited||this.hasTerrain&&r.terrain!=this.terrain||t.push(r),null==h||h.visited||h.isFlat||h.hasTerrain&&h.terrain!=this.terrain||t.push(h),null==o||o.visited||this.isFlat||this.hasTerrain&&o.terrain!=this.terrain||t.push(o);for(let n of t)n.visited=!0;return t}Resolve(){const t=this.isEmpty;this.isEmpty=!0;let n=S,s=-1,i=0,e=0;for(let t=0;t<S;t+=.35)for(let r=0;r<S;r+=.35){i++;const h=landscape.Evaluate(this.x0+t,this.y0+r,this)*U,o=h-this.z0;o<n&&(n=o),s<o&&(s=o),h<=this.z1&&(this.hasTerrain=!0),h>this.z0-.02&&(e++,this.isEmpty=!1)}i>0&&(e/=i),(n<.5*S||e<.5)&&(this.isThin=!0),s<S&&(this.isFlat=!0),(s<.25*S&&n<0||e<.3)&&(this.isTip=!0),t&&!this.isTip&&(this.isEmpty=!0)}Intersect(t,n,s,e){const r=i.Distance(t,n),h=Math.max(1,Math.round(r/D));let o=t,a=0;for(let l=0;l<h+.1;l+=1){let d=Math.min(l/h,1);!s&&d>.01&&d<.99&&(d=Math.max(0,Math.min(d+(this.indRand.rnd()-.5)*(1/h),1)));const c=i.lerp(t,n,d),u=landscape.Evaluate(c[0],c[1],this)*U-c[2];if(u>=-.1){if(s)return[e+d*r];let t=l>0||u<.125*D?0:3;const n=o[0]<=this.x0+.05,h=o[1]<=this.y0+.05,f=o[2]>=this.z1-.05;!f||!this.contZ||n&&!this.contX||h&&!this.contY||(t=0),!n||!this.contX||h&&!this.contY||f&&!this.contZ||(t=0),!h||!this.contY||n&&!this.contX||f&&!this.contZ||(t=0),t>0&&(f&&(!n||n&&this.contX)&&(!h||h&&this.contY)?t=3:n&&(!h||h&&this.contY)?t=1:h&&(t=2));let M=u;if(n&&!this.winX&&(M=-999),h&&!this.winY&&(M=-999),l>.001){const t=Math.abs(a);o=i.lerp(o,c,t/Math.max(.001,t+u)),o[2]=landscape.Evaluate(o[0],o[1],this)*U}return[o[0],o[1],o[2],t,e+d*r,0==t?landscape.Color(o[0],o[1],this):M]}o=c,a=u}return null}},Continous:function(t,n){return t.isEmpty==n.isEmpty&&(!t.hasTerrain&&!n.hasTerrain||t.terrain==n.terrain)}}},558:(t,n,s)=>{const i=s(555);var e=new i.myRandom(0),r=new Array,h=new Array;class o{constructor(t,n,s,i,e,r,h,o,a){this.S=[t,n,s],this.E=[t+h*i,n+o*e,s+a*r],this.t=[h,o,a],this.Si=[Math.round(this.S[0]/i),Math.round(this.S[1]/e),Math.round((this.S[2]+Z)/r)],this.Ei=[Math.round(this.E[0]/i),Math.round(this.E[1]/e),Math.round((this.E[2]+Z)/r)]}Alter(t,n,s,i,e){this.S[0]+=t*S+i*S*this.t[0],this.S[1]+=n*S+i*S*this.t[1],this.S[2]+=s*S+i*S*this.t[2],this.E[0]+=t*S+e*S*this.t[0],this.E[1]+=n*S+e*S*this.t[1],this.E[2]+=s*S+e*S*this.t[2],this.Update()}Update(){a(this.Si,this.S),a(this.Ei,this.E)}RandomCopy(t,n){let s=[0,0,0];s=this.t[0]>.5?t<.5?[0,1,0]:[0,0,1]:this.t[1]>.5?t<.5?[1,0,0]:[0,0,1]:t<.5?[0,1,0]:[1,0,0];const i=new o(this.S[0]+s[0]*n*S,this.S[1]+s[1]*n*S,this.S[2]+s[2]*n*S,this.E[0]-this.S[0],this.E[1]-this.S[1],this.E[2]-this.S[2],this.t[0],this.t[1],this.t[2]);return i.Si=this.Si,i.Ei=this.Ei,i}Clear(){new d(this.S[0],this.E[0],this.S[1],this.E[1],this.S[2],this.E[2]).Clear()}}function a(t,n){if(3==t.length&&!(t[0]<0||t[1]<0||t[2]<0||t[0]>=h.length||t[1]>=h[t[0]].length||t[2]>=h[t[0]][t[1]].length))try{h[t[0]][t[1]][t[2]].Append(n)}catch{}}class l{constructor(){this.box=null}Append(t){null!=this.box?this.box.Append(t):this.box=new d(t[0],t[0],t[1],t[1],t[2],t[2])}Clear(){null!=this.box&&this.box.Clear()}}class d{constructor(t,n,s,i,e,r){this.X=[t,n],this.Y=[s,i],this.Z=[e,r]}Clear(){for(let t=this.X[0];t<this.X[1]+.1;t+=S)for(let n=this.Y[0];n<this.Y[1]+.1;n+=S)for(let s=this.Z[0];s<this.Z[1]+.1;s+=S){const e=i.GetBlock([t+.1,n+.1,s+.1]);null!=e&&(e.isEmpty=!0)}}Append(t){this.X[0]=Math.min(this.X[0],t[0]),this.Y[0]=Math.min(this.Y[0],t[1]),this.Z[0]=Math.min(this.Z[0],t[2]),this.X[1]=Math.max(this.X[1],t[0]),this.Y[1]=Math.max(this.Y[1],t[1]),this.Z[1]=Math.max(this.Z[1],t[2])}}t.exports={GrowBoxes:function(t){let n=0,s=0,a=9999;for(let t=-T/2;t<T/2;t+=16)for(let e=-T/2;e<T/2;e+=16){let r=0;for(let n=-32;n<33;n+=16)for(let s=-32;s<33;s+=16)for(let h=-16;h<17;h+=16)r+=Math.abs(i.noise(t+T/2+n,e+T/2+s,U/2+h,.012));r<a&&(a=r,n=t,s=e)}e=new i.myRandom(Math.round(1e3*R.random_dec())),h=new Array,r=new Array;for(let a=0;a<T;a+=t[0]){const d=new Array;for(let h=0;h<T;h+=t[1]){const c=new Array;for(let d=-Z;d<U;d+=t[2])c.push(new l),Math.abs(i.noise(a+n,h+s,d,.012))>(TERCHANGE&&MILL&&!FLATTEN?.4:.6)||(e.rnd()<.72&&r.push(new o(a,h,d,t[0],t[1],t[2],1,0,0)),e.rnd()<.72&&r.push(new o(a,h,d,t[0],t[1],t[2],0,1,0)),e.rnd()<.82&&r.push(new o(a,h,d,t[0],t[1],t[2],0,0,1)));d.push(c)}h.push(d)}const d=new Array;for(let t of r){t.Alter(Math.round(3*e.rnd()-1),Math.round(3*e.rnd()-1),Math.round(3*e.rnd()-1),Math.round(2*e.rnd()-1),Math.round(2*e.rnd()-1));const n=e.rnd(),s=Math.round(2*e.rnd()-1);Math.abs(s)>.2&&e.rnd()<.67&&d.push(t.RandomCopy(n,s))}for(let t of d)r.push(t)},ClearBoxes:function(){for(let t of h)for(let n of t)for(let t of n)t.Clear();for(let t of r)t.Clear()}}},