0xecc6…2cdb

All memos sent from and to 0xecc6…2cdb.

0xecc60439…2cdb·#18,934,996·0x6caad711…be5768
[PPPPPPPP[PPPPPbAddress: call to non-contractAddress: call to non-contractAddress: low-level delegate call failedAddress: low-level delegate call failedhttps://arweave.net/3dmakBYUOu__S-MKdpEEvLN84l4frZrdGqYMV08GiqcThe Emperor Has No Clotheshttps://arweave.net/3ePlThehFSNw2Qzy3Nnsd_rGB78HDFOIZWbB7y-UEnIhttps://highlight-creator-assets.highlight.xyz/main/base-dir/4fa5de13-eb90-4daa-a0db-ae0a4823d004/onChainDir
S=Uint32Array.from([0,1,s=t=2,3].map(t=>parseInt(tokenData.hash.substr(8*t+2,8),16))),R=i=>(t=S[3],S[3]=S[2],S[2]=S[1],S[1]=s=S[0],t^=t<<11,S[0]^=t^t>>>8^s>>>19,S[0]/2**32);let sd=parseInt(tokenData.hash.slice(0,16),16),rnd=function(t,s){var i,h=R();return void 0===t?h:void 0===s?t instanceof Array?t[Math.floor(h*t.length)]:h*t:(s<t&&(i=t,t=s,s=i),h*(s-t)+t)},st,fm,bbs=[],cps={},pT,iP=!1,iE=!1,sW=900,sH=1200;function setup(){var t;noiseSeed(sd),tokenData.plot?(width=sW,height=sH,noCanvas(),noLoop(),gs(),t=cS(),doc.body.appendChild(t),(t=doc.ce("style")).appendChild(doc.createTextNode(".plot{width:100vw;height:100vh;}")),doc.head.appendChild(t)):(createCanvas(3*windowHeight/4,windowHeight),frameRate(120),strokeWeight(1.5*width/1080),gs(),pT=millis())}function gs(){st=new St,fm=new F,zz()}function zz(){for(let t=0;t<st.cs.length;t++)cps[st.cs[t]]=new Path2D;for(let s=0;s<st.nX;s++){var i=st.cX*s+st.cX/2;for(let t=0;t<st.nY;t++){var h=st.cF(s,t),e=new P(i,st.cY*t+st.cY/2,PI/4,st.cX/1.5,4,h);cps[h].addPath(e.gp()),bbs.push(e)}}}function draw(){if(!(tokenData.plot||iP||iE)){var t,s=millis();background(st.bC),Object.keys(cps).forEach(t=>{drawingContext.save();var s=cps[t];drawingContext.clip(s),background(st.bC),stroke(t),fm.sh(),drawingContext.restore()});for(let t=0;t<bbs.length;t++)bbs[t].sb();500<s&&(t=max(map(s,500,2e3,1e3,100),100),fm.sp((s-pT)/t)),pT=s}}function dCS(s){var i=[];for(let t=0;t<s.length;t++){var h=s[t].copy();i.push(h)}return i}class F{constructor(){this.x=width/2,this.y=height/2,this.r1=width/rnd(40,15),this.r2=width/rnd(4,8),this.rF=20*rnd([1,2,4,8]),this.rO=rnd(1.5,4),this.x1=rnd(0,width/12),this.x2=width/rnd(4,2),this.y1=rnd(0,height/12),this.y2=height/rnd(4,2),this.d=rnd([-1,1]),this.sD=rnd([-1,1]),this.p=.01,this.sO=0,this.nS=rnd([3,4,5,6]),this.sP(),this.sM=rnd(-5,5),this.pD=rnd([76,100,200])}sP(){this.ps=[];let s=this.p;for(let t=this.sO;t<=st.nS+this.sO;t++){var i=map(t-this.sO,0,st.nS,this.r2,width/120),i=map(sin(t/this.rF),-1,1,this.r1,i)+i*noise(cos(t/st.nS))/2,h=map(t-this.sO,0,st.nS,this.x1,this.x2),e=map(t-this.sO,0,st.nS,this.y1,this.y2),n=h*cos(s)-e*sin(s)+this.x,e=e*cos(s)+h*sin(s)+this.y;this.ps.push(new P(n,e,s,i,this.nS,this.clr)),s+=2*this.rO*PI/st.nS*this.d}}sp(t=1){this.sO+=t*this.sM,this.p+=t/this.pD*this.sD,this.sP()}sh(){this.ps.forEach(t=>t.sh())}}function cl(i){for(let s=0;s<i.length;s++)for(let t=s+1;t<i.length;t++)rHL(i[s],i[t])}function rHL(t,s){if(t.iN(s)){var i=t.ls,h=s.ls;for(let t=0;t<i.length;t++){var e=i[t];if(s.cP(e.p1)&&s.cP(e.p2))i.splice(t,1),t--;else{var n=[];for(let t=0;t<h.length;t++){var r=h[t].gI(e);r&&n.push(r)}1===n.length?s.cP(e.p1)?i.splice(t,1,new L(n[0],e.p2)):i.splice(t,1,new L(n[0],e.p1)):2===n.length&&(p5.Vector.dist(e.p1,n[0])<p5.Vector.dist(e.p1,n[1])?i.splice(t,1,new L(n[0],e.p1),new L(n[1],e.p2)):i.splice(t,1,new L(n[0],e.p2),new L(n[1],e.p1)),t++)}}}}class St{constructor(){this.cF=this.gCF(),this.nX=3*floor(rnd(1,4)),this.nY=floor(height/width*this.nX),this.cX=width/this.nX,this.cY=height/this.nY,this.nS=rnd(300,400)}gCF(){this.bC="#f9f9fa";const i=[];for(var t=Object.keys(clrMap),s=floor(rnd(1,6));i.length<s;){var h=floor(rnd(t.length));i.push(t[h]),t.splice(h,1)}this.cs=i;var e=[(t,s)=>i[t%i.length],(t,s)=>i[s%i.length],(t,s)=>i[(t+s)%i.length]];clrMap["#eae6de"]="White",clrMap["#383131"]="Black";let n="#eae6de",r="#383131";return rnd()<.18?rnd()<.5?(this.bC=n,this.cs=[r],()=>r):(this.bC=r,this.cs=[n],()=>n):rnd(e)}}clrMap={"#ba4796":"Rose","#e0142c":"Red","#ffa038":"Orange","#12a691":"Green","#0972c4":"Blue","#842eae":"Purple","#a14725":"Brown","#00275f":"Blue Black","#85031b":"Burgundy","#67bd4f":"Fresh Green"};class P{constructor(s,i,h,t,e,n){this.x=s,this.y=i,this.c=createVector(s,i),this.p=h,this.r=t,this.nP=e,this.clr=n,this.points=[];for(let t=0;t<this.nP;t++){var r=this.p+TWO_PI*t/this.nP;const s=this.x+sin(r)*this.r,i=this.y+cos(r)*this.r;this.points.push(createVector(s,i))}this.x1=1/0,this.x2=-1/0,this.y1=1/0,this.y2=-1/0;for(let t=0;t<this.points.length;t++){const h=this.points[t];this.x1=min(this.x1,h.x),this.x2=max(this.x2,h.x),this.y1=min(this.y1,h.y),this.y2=max(this.y2,h.y)}this.ls=[];for(let t=0;t<this.points.length;t++)this.ls.push(new L(this.points[t],this.points[(t+1)%this.points.length]))}copy(){var s=new P(this.x,this.y,this.p,this.r,this.nP,this.clr);s.x1=this.x1,s.x2=this.x2,s.y1=this.y1,s.y2=this.y2,s.ls=[];for(let t=0;t<this.ls.length;t++)s.ls.push(this.ls[t].copy());return s}cP(t){if(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)return!1;let s=0;var i=new L(t,createVector(2*width,height+width));for(let t=0;t<this.ls.length;t++)this.ls[t].gI(i)&&s++;return s%2==1}cn(s){for(let t=0;t<this.ls.length;t++){var i=this.ls[t],h=s.cP(i.p1),e=s.cP(i.p2),n=[];for(let t=0;t<s.ls.length;t++){var r=s.ls[t].gI(i);r&&n.push(r)}0===n.length?h||e||(this.ls.splice(t,1),t--):1===n.length?h?this.ls[t].p2=n[0]:e&&(this.ls[t].p1=n[0]):2===n.length&&(this.ls[t]=new L(n[0],n[1]))}}iN(t){return p5.Vector.dist(this.c,t.c)<this.r+t.r}sh(){push(),fill(st.bC),beginShape(),this.points.forEach(t=>{vertex(t.x,t.y)}),endShape(CLOSE),pop()}sb(){push(),strokeWeight(2*width/1080),noFill(),stroke(this.clr),beginShape(),this.points.forEach(t=>{vertex(t.x,t.y)}),endShape(CLOSE),pop()}gsp(){let s="",i;for(let t=0;t<this.ls.length;t++){var h=this.ls[t],e=new L(h.p1.copy().mult(sW/width),h.p2.copy().mult(sW/width));i&&i.p2.equals(h.p1)?s+=`L ${e.p2.x} `+e.p2.y:s+=`M ${e.p1.x} ${e.p1.y} L ${e.p2.x} ${e.p2.y} `,i=h}return s}gp(){var s=new Path2D;s.moveTo(this.points[0].x,this.points[0].y);for(let t=0;t<this.points.length;t++){var i=this.points[(t+1)%this.points.length];s.lineTo(i.x,i.y)}return s}}class L{constructor(t,s){this.p1=t,this.p2=s,this.m=(s.y-t.y)/(s.x-t.x),999999999999<this.m&&(this.m=1/0),this.m<-999999999999&&(this.m=-1/0),this.b=t.y-this.m*t.x}gI(t){let s,i;i=this.m===1/0||this.m===-1/0?(s=this.p1.x,t.m*s+t.b):t.m===1/0||t.m===-1/0?(s=t.p1.x,this.m*s*this.b):(s=(t.b-this.b)/(this.m-t.m),this.m*s+this.b);var h=createVector(s,i);return this.hP(h)&&t.hP(h)?h:null}hP(t){var s=(t.y-this.p1.a)*(this.p1.x-this.p2.x)-(t.x-this.p1.x)*(this.p2.y-this.p1.y);return!(abs(s)>Number.EPSILON||(s=(t.x-this.p1.x)*(this.p2.x-this.p1.x)+(t.y-this.p1.y)*(this.p2.y-this.p1.y))<0||(this.p2.x-this.p1.x)*(this.p2.x-this.p1.x)+(this.p2.y-this.p1.y)*(this.p2.y-this.p1.y)<s)}copy(){return new L(this.p1.copy(),this.p2.copy())}}function eS(){var t=cS(),s=doc.ce("a"),t=new Blob([t.outerHTML],{type:"text/plain"});s.href=URL.createObjectURL(t),s.download=`framed_${tokenData.tokenId}.svg`,s.click(),URL.revokeObjectURL(s.href)}(doc=document).cen=doc.createElementNS,doc.ce=doc.createElement;let ns="http://www.w3.org/2000/svg";function cS(){var s=doc.cen(ns,"svg"),i=(s.sA=s.setAttribute,s.sA("class","plot"),s.sA("width",sW+"px"),s.sA("height",sH+"px"),s.sA("viewBox","0 0 "+sW+" "+sH),s.sA("xmlns","http://www.w3.org/2000/svg"),s.sA("xmlns:inkscape","http://www.inkscape.org/namespaces/inkscape"),s.sA("style",`background-color:${st.bC};stroke-linecap:round`),gSL());for(let t=0;t<i.length;t++)s.appendChild(i[t]);return s}function gSL(){var s={},i={};for(let t=0;t<st.cs.length;t++){var h=st.cs[t];i[h]=s[h]=""}for(let t=0;t<bbs.length;t++){var e=bbs[t],n=(i[e.clr]+=e.gsp(),dCS(fm.ps,fm.clr));cl(n);for(let t=0;t<n.length;t++){n[t].cn(e);var r=n[t].gsp();r&&r.length&&(s[e.clr]+=r)}}var p=[];let l=1;var o=Object.keys(i);for(let t=0;t<st.cs.length;t++){var c=st.cs[t],c=cL(l,"Form",c,s[c],1.5*sW/1080);c&&(p.push(c),l++)}for(let t=0;t<o.length;t++){var a=o[t],a=cL(l,"Frame",a,i[a],2*sW/1080);a&&(p.push(a),l++)}return p}function cL(t,s,i,h,e){var n;return""===h?null:((n=doc.cen(ns,"g")).sA=n.setAttribute,t=t+` - ${s} - `+clrMap[i],n.sA("id",t),n.sA("inkscape:groupmode","layer"),n.sA("inkscape:label",t),n.sA("style",`fill:none;stroke-width:${e};stroke:`+i),(s=doc.cen(ns,"path")).setAttribute("d",h),n.appendChild(s),n)}function keyPressed(t){"p"===t.key?(iP=!iP,pT=millis()):"i"===t.key?(iE=!0,save(`framed_${tokenData.tokenId}.png`),pT=millis(),iE=!1):"s"===t.key&&(iE=!0,eS(),pT=millis(),iE=!1)}
0xecc60439…2cdb·#18,115,212·0xf2f22a4c…e7f6ff
ERC1967: new implementation is n`Address: call to non-contract`,V[`*`&`.V[`;V[V[V[`3Address: low-level delegate call failedPsychedelic Repair
function setup(){const a=createVector;noiseSeed(s),noCanvas();var o=900,l=1200;const t=new CC;var i=rnd()<.45,e=60*floor(i?rnd(20,26):rnd(15,20)),n=floor(rnd(2,6)),c=e/n;const p=[],r=[];for(let e=0;e<n;e++){const{v:a,n:$}=t.N(r);r.push(a),p[e]={v:a,n:$,shapes:[]}}const h=gnf();var v=18e4/1080,f=floor(rnd(3,9)),u=o/(i?rnd(48,128):rnd(24,40));for(let r=0;r<n;r++){const A=[];for(let e=0;e<f-1;e++)A[e]=[rnd(2e3),rnd(2e3)];for(let e=0;e<c;e++){var g,w=e<c/2?map(e,0,c/2,0,u):map(e,c/2,c,u,0);let t,n;const N=[];n=i?(g=map(e,0,c-1,0,l),t=a(0,g),a(o,g)):(x=map(e,0,c-1,0,o),t=a(x,0),a(x,l));for(let e=0;e<A.length;e++){const a=p5.Vector.lerp(t,n,(e+1)/f);var[m,y]=A[e];a.x+=map(h(m,a.x/v,a.y/v),0,1,-w,w),a.y+=map(h(y,a.y/v,a.x/v),0,1,-w,w),a.x<0&&(a.x=0),a.y<0&&(a.y=0),a.x>o&&(a.x=o),a.y>l&&(a.y=l),N.push(a)}var x=e%2==0?[t,...N,n]:[n,...N.reverse(),t];p[r].shapes.push(x)}}var S="http://www.w3.org/2000/svg";let C=document.createElementNS(S,"svg");C.sa=C.setAttribute,C.sa("class","plot"),C.sa("width","9in"),C.sa("height","12in"),C.sa("viewBox","0 0 900 "+l),C.sa("style","background-color:white;"),C.sa("xmlns","http://www.w3.org/2000/svg"),C.sa("xmlns:inkscape","http://www.inkscape.org/namespaces/inkscape");for(let e=0;e<p.length;e++){var k=p[e];const E=d.createElementNS(S,"g");var M=`${e+1} - ${k.n}`;E.sa=E.setAttribute,E.sa("id",M),E.sa("inkscape:groupmode","layer"),E.sa("inkscape:label",M);for(let e=0;e<k.shapes.length;e++){var b=k.shapes[e];let t=`M ${b[0].x} ${b[0].y}`;for(let e=1;e<b.length;e++)t+=` L ${b[e].x} ${b[e].y}`;const B=d.createElementNS(S,"path");B.setAttribute("style",`fill:none;stroke-width:1;stroke:${k.v};`),B.setAttribute("d",t),E.appendChild(B)}C.appendChild(E)}d.body.appendChild(C);let R=d.createElement("style");R.appendChild(d.createTextNode(".plot{width:100vw;height:100vh;}")),d.head.appendChild(R)}h=tokenData.hash,S=Uint32Array.from([0,1,s=t=2,3].map(e=>parseInt(h.substr(8*e+2,8),16))),R=e=>(t=S[3],S[3]=S[2],S[2]=S[1],S[1]=s=S[0],t^=t<<11,S[0]^=t^t>>>8^s>>>19,S[0]/2**32),s=parseInt(h.slice(0,16),16),d=document,rnd=(e,t)=>{var n,r=R();return void 0===e?r:void 0===t?e instanceof Array?e[Math.floor(r*e.length)]:r*e:(t<e&&(n=e,e=t,t=n),r*(t-e)+e)};class CC{n=["Micron Rose","Micron Red","Micron Orange","Micron Green","Micron Blue","Micron Purple","Micron Brown"];v=["#df4a82","#f1230a","#f47d3d","#47a858","#0972c4","#842eae","#a14725"];R(){return rnd(this.v)}N(e){let t=this.R();for(;e.includes(t);)t=this.R();var n=this.n[this.v.indexOf(t)];return{v:t,n:n}}}function gnf(){const r=floor(rnd(5,10));return rnd([(e,t,n)=>noise(e,t,n),(e,t,n)=>ceil(noise(e,t,n)*r)/r])}
Departing from generative art’s focus on the size and variety of algorithmic outputs, Coalition contains just 36 geometric creations. Every mint is composed of unique combinations of line, shape, and color, making them artworks unto themselves. However, just as significant as the individual mints is the larger series of which they are each a part. When viewed collectively as a 6x6 grid, the 36 tokens make up a larger, single artwork, the titular Coalition. Patterns and palettes that exist across different tokens come together seamlessly in the Coalition, allowing users to recognize their mint as an indispensable element of the coherent whole. By highlighting the inextricable relationship between the single set and its 36 components, Coalition suggests that storytelling must play a vital role in the future of generative art. The medium’s current emphasis on long-form algorithmic exploration has come at the expense of narrative craft. While long-form algorithmic exploration has produced groundbreaking artwork and will continue to do so, our project urges practitioners and collectors to consider generative art’s capabilities outside of replicating the look of analog media. Instead of attempting a mimesis of old modes of production, Coalition foregrounds the stories about human experience that emerge when artists free their code from the burden of replicating paint and paper. We ask, does the “art” in generative art refer to the algorithm, or the outputs? To encourage artists and collectors to value storytelling and limitation in their NFTs, Coalition doubles as performance art. While the set is limited to 36 mints, a 37th is available for purchase. The collector who buys the final token will find only an error message. The algorithm self-destructs after mint #35. Read about why we chose to do this [here](https://medium.com/@generativeartworks/from-reservation-to-coalition-the-stories-that-generative-art-can-tell-d5466e7ba15b). There can be no avant-garde because everything has been done. —Pedro Friedeberg
const sOR="0x21376e43c4960ae2719cfc148c6cba7f9d87ed54880dbd9bcfa0f89f29626e34";function createRandomness(e){const o=Uint32Array.from([0,1,s=t=2,3].map((t=>parseInt(e.substr(8*t+2,8),16))));return e=>(t=o[3],o[3]=o[2],o[2]=o[1],o[1]=s=o[0],t^=t<<11,o[0]^=t^t>>>8^s>>>19,o[0]/2**32)}const R=createRandomness(tokenData.hash),R2=createRandomness(sOR),shapes={PYRAMID:"PYRAMID",SQUARE:"SQUARE",DODEC:"DODEC",SPHERE:"SPHERE"},getShape=t=>t[0]<3?t[1]<3?shapes.PYRAMID:shapes.SQUARE:t[1]<3?shapes.DODEC:shapes.SPHERE;class Shape{constructor(t,e){this.size=t,this.strokeColor="#0C191D",this.strokeWeight=width/1080*6,this.hasStroke=e,this.rotationY=0,this.rotationX=0,this.rndNum=floor(rnd(0,3.999))}draw(){noStroke(),strokeWeight(this.strokeWeight);switch(getShape(position)){case shapes.PYRAMID:this.pyramid(this.size,this.hasStroke);break;case shapes.SQUARE:this.square(this.size,this.hasStroke);break;case shapes.DODEC:this.dodecahedron(this.size,this.hasStroke);break;case shapes.SPHERE:this.sphere(this.size,this.hasStroke)}}sphere(t,e){noStroke(),e&&(push(),fill(this.strokeColor),translate(0,0,-width/10),rotateX(this.rotationX),rotateY(this.rotationY),sphere(3*t/4+this.strokeWeight,50,50),pop()),rotateX(PI/4),rotateX(this.rotationX),rotateY(PI),rotateY(this.rotationY),sphere(3*t/4,50,50)}pyramid(t,e){e&&(push(),fill(this.strokeColor),translate(0,this.strokeWeight/4,-width/2),rotateX(PI/4),rotateX(this.rotationX),rotateY(-PI/4),rotateY(this.rotationY),noStroke(),pyramidModel(t+2*this.strokeWeight,0),pop()),rotateX(PI/4),rotateX(this.rotationX),rotateY(-PI/4),rotateY(this.rotationY),pyramidModel(t,1)}square(t,e){e&&(push(),fill(this.strokeColor),translate(0,0,-width/5),rotateX(PI/4),rotateX(this.rotationX),rotateY(-PI/4),rotateY(this.rotationY),noStroke(),cubeModel(t+this.strokeWeight,0),pop()),rotateX(PI/4),rotateX(this.rotationX),rotateY(-PI/4),rotateY(this.rotationY),cubeModel(t,1)}dodecahedron(t,e){e&&(push(),fill(this.strokeColor),translate(0,0,-width/5),rotateX(PI/6),rotateX(this.rotationX),rotateY(this.rotationY),noStroke(),dodecahedronModel(t+this.strokeWeight,0),pop()),rotateX(PI/6),rotateX(this.rotationX),rotateY(this.rotationY),dodecahedronModel(t,1)}}const textures={concentrics:t=>{t.background(palette[0]),t.noStroke();const e=3*t.width/floor(rnd(20,50)),o=floor(rnd(2,5));let r=3*t.width,s=0;for(;r>0;)r-=s%2==0?e:e/o,r<0&&(r=0),push(),s%2==0?t.fill(palette[1]):t.fill(palette[0]),t.circle(0,0,r),pop(),s++},pieceMeil:t=>{t.background(palette[0]),t.fill(palette[1]),t.noStroke();const e=floor(rnd(15,30));for(let o=0;o<=e;o++)for(let r=0;r<=e;r++){const s=t.width/e*8/10,i=t.width/e*o,n=t.height/e*r;push(),t.circle(i,n,s),pop()}},bricks:t=>{t.drawingContext.setLineDash([t.width/1080*5,t.width/1080*10,t.width/1080*30,t.width/1080*10]),t.background(palette[0]),t.stroke(palette[1]),t.strokeWeight(t.width/1080*5);const e=floor(rnd(15,30)),o=e/3;for(let r=0;r<e;r++){const s=t.height/(e-1)*r,i=t.height/(e-1)*(r-1);t.line(0,s,t.width,s);for(let e=0;e<o;e++){const n=t.width/(o-1),a=n*e,h=r%2==0?0:n/2;t.line(a+h,s,a+h,i)}}},checkered:t=>{t.rectMode(CENTER),t.background(palette[0]);const e=[palette[0],palette[1]];t.strokeWeight(t.width/1080);const o=floor(rnd(5,30)),r=t.width/o;for(let s=o-1;s>=0;s--)for(let i=0;i<o;i++){t.fill(e[(s+i)%e.length]),t.stroke(e[(s+i)%e.length]),o%2==0&&s>=o/2&&i<o/2&&getShape(position)===shapes.SQUARE&&(t.fill(e[(s+i+1)%e.length]),t.stroke(e[(s+i+1)%e.length]));const n=r*s+r/2,a=r*i+r/2;t.square(n,a,r)}},zoom:t=>{t.push(),t.rectMode(CENTER),t.background(palette[0]),t.strokeWeight(t.width/1080);const e=floor(rnd(3,7)),o=floor(rnd(3,15)),r=t.width/e,s=[palette[0],palette[1]];for(let i=e-1;i>=0;i--)for(let n=0;n<e;n++){let a=(i+n)%2==0?1:0;e%2==0&&i>=e/2&&n<e/2&&getShape(position)===shapes.SQUARE&&(a=(i+n)%2==0?0:1);const h=r*i+r/2,c=r*n+r/2;for(let e=0;e<o;e++){const i=r-r/o*e;t.fill(s[(e+a)%s.length]),t.stroke(s[(e+a)%s.length]),t.square(h,c,i)}}t.pop()},zigzag:t=>{t.background(palette[0]),t.stroke(palette[1]),t.strokeCap(PROJECT),t.noFill();const e=floor(rnd(5,30)),o=t.width/e;t.strokeWeight(o/4);for(let r=-1;r<e+1;r++){t.beginShape();for(let s=-1;s<e+1;s++){const e=o*s+o/2,i=o*r+o/2;t.vertex(e-o/2,i-o/2),t.vertex(e,i+o/2),t.vertex(e+o/2,i-o/2)}t.endShape()}},lines:t=>{t.background(palette[0]),t.stroke(palette[1]),t.strokeCap(PROJECT),t.noFill();const e=floor(rnd(5,30)),o=t.width/e;t.strokeWeight(o/4);const r=rnd([1,2,3]);for(let o=0;o<=e;o++){const s=t.width/e*o;1!==r&&3!==r||t.line(0,s,t.width,s),2!==r&&3!==r||t.line(s,0,s,t.width)}},ench:t=>{t.background(palette[0]),t.stroke(palette[1]),t.strokeWeight(t.width/1080*5);const e=t.width/30,o=t.width/30,r=(s,i,n,a)=>{if(n>e&&a>o){const e=rnd(.4,.6);rnd()<.5?(t.line(s+n*e,i,s+n*e,i+a),r(s,i,n*e,a),r(s+n*e,i,n*(1-e),a)):(t.line(s,i+a*e,s+n,i+a*e),r(s,i,n,a*e),r(s,i+a*e,n,a*(1-e)))}};r(0,0,t.width,t.height)},beziers:t=>{t.background(palette[0]),t.stroke(palette[1]),t.strokeWeight(t.width/1080*6),t.noFill();const e=800*t.width/1080,o=getNoiseFunc(),r=256,s=t.width;for(let i=0;i<r;i++){const n=map(i,128,r,0,t.width),a=map(i,0,128,t.height,0),h=createVector(n,a),c=map(i,0,128,0,t.width),l=map(i,128,r,t.height,0),p=createVector(c,l),d=p5.Vector.lerp(h,p,1/3),u=p5.Vector.lerp(h,p,2/3);d.x+=map(o(d.x/e,d.y/e),0,1,-s,s),d.y+=map(o(d.y/e,d.x/e),0,1,-s,s),u.x+=map(o(u.x/e,u.y/e),0,1,-s,s),u.y+=map(o(u.y/e,u.x/e),0,1,-s,s),t.bezier(h.x,h.y,d.x,d.y,u.x,u.y,p.x,p.y)}},honeycomb:t=>{t.background(palette[0]),t.stroke(palette[1]),t.strokeWeight(t.width/1080*7),t.fill(palette[0]);const e=(e,o,r)=>{t.beginShape();for(let s=PI/2;s<5*PI/2;s+=PI/3){let i=e+cos(s)*r,n=o+sin(s)*r;t.vertex(i,n)}t.endShape(CLOSE)},o=2*floor(rnd(6,8)),r=2*o,s=1.25*width/o,i=s/2;for(let t=0;t<r;t++){const r=t*s*sqrt(3)/2;for(let n=0;n<o+1;n++)e(t%2!=0?n*s:s/2+n*s,r,i)}},qTree:t=>{t.background(palette[0]),t.stroke(palette[1]),t.strokeWeight(t.width/1080*5),t.noFill();const e=rnd(100,200),o=[];for(let r=0;r<e;r++)o.push(createVector(rnd(t.width),rnd(t.height)));const r=(t,e,o,r,s)=>s.x>t&&s.x<t+o&&s.y>e&&s.y<e+r,s=t.width/30,i=t.height/30,n=(e,a,h,c)=>{h>s&&c>i&&((t,e,s,i)=>{for(let n=0;n<o.length;n++)if(r(t,e,s,i,o[n]))return!0;return!1})(e,a,h,c)?(n(e,a,h/2,c/2),n(e+h/2,a,h/2,c/2),n(e,a+c/2,h/2,c/2),n(e+h/2,a+c/2,h/2,c/2)):t.rect(e,a,h,c,t.width/128)};n(0,0,t.width,t.height)},stars:t=>{t.background(palette[0]),t.stroke(palette[1]),rnd()<.75?t.fill(palette[1]):t.noFill(),t.strokeWeight(t.width/1080*3);const e=circlePack(t);for(let o=0;o<e.length;o++){const r=e[o];star(r.x,r.y,r.r,r.r/2,floor(rnd(5,19)),t,rnd(TWO_PI))}},trigGrid:t=>{t.background(palette[0]),t.stroke(palette[1]),t.noFill(),t.strokeWeight(t.width/1080*2);class e{constructor(t,e,o){this.x=t,this.y=e,this.size=o/2,this.getXValue=this.getTrigFunc(),this.numCurves=floor(rnd(14,20)),this.resolution=floor(rnd([rnd(4,9),rnd(20,25)]))}display(){t.push(),t.translate(this.x,this.y),t.rotate(rnd(TWO_PI));for(let e=0;e<this.numCurves;e++){t.beginShape();for(let e=0;e<TWO_PI;e+=TWO_PI/this.resolution){const o=this.getXValue(e),r=map(e,0,TWO_PI,0,this.size/1.1);t.vertex(o,r)}t.endShape(),t.rotate(TWO_PI/this.numCurves)}t.pop()}getTrigFunc(){return rnd([t=>map(Math.tanh(1/Math.exp(tan(t),3)),-1,1,-this.size/2,this.size/2),t=>map(cos(t)*cos(t),0,1,-this.size/2.2,this.size/2.2),t=>map(sin(t)*sin(t),0,1,-this.size/2,this.size/2),t=>map(sin(t)*cos(t),-1,1,-this.size,this.size),t=>map(Math.tanh(1/tan(t)),0,1,-this.size/6,this.size/6),t=>map(cos(t)*cos(t),0,1,-this.size/2.2,this.size/2.2),t=>map(Math.tanh(-1/(cos(t)*cos(t))),0,1,-this.size/6.6,this.size/6.6),t=>map(Math.exp(2.71828,cos(t)),-20,1,-this.size/6,this.size/6),t=>map(Math.exp(sin(t)*cos(t),3),0,1,-this.size/8,this.size/8)])}}const o=floor(rnd(7,10));for(let r=0;r<o+1;r++){const s=r*t.width/o;for(let r=0;r<o+1;r++){new e(s,r*t.height/o,t.width/o).display()}}},rhombus:t=>{t.background(palette[0]),t.stroke(palette[1]),t.noFill(),t.strokeWeight(t.width/1080*7);const e=floor(rnd(5,9));let o=floor(rnd(17,21));o%2==0&&o++;const r=t.width/e,s=t.height/o;for(let i=0;i<o;i++){const n=map(i,0,o,0,height);for(let a=0;a<e;a++){const h=map(a,0,e,0,width);t.push(),i%2==0?(t.translate(h,n),t.quad(0,s/2,r/2,0,r,s/2,r/2,s),0===a?(t.line(0,s/2,0,s),t.line(0,s,r/2,3*s/2),t.line(r,s/2,r,s),i===o-1&&t.line(r/2,3*s/2,r,s)):a===e-1?(t.line(r,s/2,r,s),t.line(r,s,r/2,3*s/2),i===o-1&&t.line(0,s,r/2,3*s/2)):(t.line(r,s/2,r,s),i===o-1&&(t.line(0,s,r/2,3*s/2),t.line(r/2,3*s/2,r,s)))):a!==e-1?(t.translate(h+r/2,n),t.quad(0,s/2,r/2,0,r,s/2,r/2,s),0===a&&(t.line(0,s/2,0,s),t.line(0,s/2,-r/2,s)),t.line(r,s/2,r,s)):(t.translate(h+r/2,n),t.line(0,s/2,r/2,s)),t.pop()}}},squares:t=>{t.background(palette[0]),t.stroke(palette[1]),t.noFill(),t.strokeWeight(t.width/1080*5),t.rectMode(CENTER);const e=rnd(6,16),o=e*t.height/t.width,r=t.width/e,s=r/2,i=getNoiseFunc(),n=200*t.width/1080;for(let a=0;a<e+1;a++){const h=map(a,0,e,0,t.width);for(let e=0;e<o+1;e++){const a=map(e,0,o,0,t.height),c=r+s*map(i(h/n,a/n),0,1,-1,1);t.rect(h,a,c),t.rect(h,a,r+s*rnd(-1,1))}}},diagonals:t=>{t.background(palette[0]);const e=rnd()<.5;t.stroke(palette[e?0:1]),t.fill(palette[1]),t.strokeWeight(t.width/1080*(e?6:1.5)),t.strokeCap(SQUARE);const o=rnd(24,32),r=o*t.height/t.width,s=t.width/o,i=t.height/r,n=getNoiseFunc(),a=2*t.width/1080;for(let e=0;e<r;e++){const r=i*e;for(let e=0;e<o;e++){const o=s*e;rnd()<.5||(t.beginShape(),n(o/a,r/a)<.5?(t.vertex(o,r),t.vertex(o+s,r+i),t.vertex(o+s,r+2*i),t.vertex(o,r+i)):(t.vertex(o,r+i),t.vertex(o+s,r),t.vertex(o+s,r+i),t.vertex(o,r+2*i)),t.endShape(CLOSE))}}},roundedPoly:t=>{class e{constructor(t,e,o,r){this.x=t,this.y=e,this.r=o,this.numSides=r,this.phase=rnd(TWO_PI),this.vertices=this.getVertices()}getVertices(){const t=[];for(let e=this.phase;e<TWO_PI+this.phase;e+=TWO_PI/this.numSides)t.push(createVector(this.x+this.r*cos(e),this.y+this.r*sin(e)));return t}show(){const e=createVector(this.x,this.y),o=floor(rnd(2,4));for(let t=0;t<this.vertices.length;t++){const r=this.vertices[t],s=this.vertices[t+1%this.vertices.length];for(let i=1;i<o;i++)this.vertices.splice(t,1,p5.Vector.lerp(p5.Vector.lerp(r,s,i/o),e,rnd(-.25,.75))),t++}!function(e,o){t.beginShape();for(let r=0;r<e.length;r++){const s=e[r],i=e[(r+1)%e.length],n=e[(r+2)%e.length],a=s.copy().sub(i).normalize(),h=n.copy().sub(i).normalize(),c=a.angleBetween(h),l=min(s.dist(i),n.dist(i))/2*abs(sin(c/2)),p=min(o,l),d=abs(p/sin(c/2)),u=i.copy().add(a.copy().mult(d)),w=i.copy().add(h.copy().mult(d)),g=.5523,f=u.copy().sub(a.copy().mult(2*p*g)),m=w.copy().sub(h.copy().mult(2*p*g));t.vertex(u.x,u.y),t.bezierVertex(f.x,f.y,m.x,m.y,w.x,w.y)}t.endShape(CLOSE)}(this.vertices,this.r/4)}}t.background(palette[0]),t.stroke(palette[1]),rnd()<.75?t.fill(palette[1]):t.noFill(),t.strokeWeight(t.width/1080*2.5);circlePack(t,t.width/200,t.width/20,600).forEach((t=>{new e(t.x,t.y,t.r,floor(rnd(5,9))).show()}))}};class PackCircle{constructor(t,e,o){this.growing=!0,this.x=t,this.y=e,this.r=o}edges(){return!(this.x-this.r>0&&this.x+this.r<canvas.width&&this.y-this.r>0&&this.y+this.r<canvas.height)}grow(){this.r+=canvas.width/1080}}function circlePack(t,e=t.width/40,o=t.width/10,r=400){const s=[],i=pack(t,e,o,r);return s.push(...i),s}function pack(t,e,o,r){const s=[];let i=0;for(let n=0;n<r;n++){for(let e=0;e<s.length;e++){const o=s[e];if(o.growing){for(let e=0;e<s.length;e++){const r=s[e];if(r!=o){dist(o.x,o.y,r.x,r.y)-t.width/1080<o.r+r.r&&o.growing&&(o.growing=!1)}}o.growing&&(o.growing=!o.edges()),o.growing&&o.grow()}}const r=1;let n=0;for(let a=0;a<500;a++){if(addCircle(t,s,e,o)&&(n++,i++),i===this.numCurves)return s;if(n===r)break}}return s}function addCircle(t,e,o,r){const s=rnd(o,r),i=rnd(t.width),n=rnd(t.height);let a=new PackCircle(i,n,s);for(let t=0;t<e.length;t++){const o=e[t];if(dist(a.x,a.y,o.x,o.y)<o.r+a.r){a=void 0;break}}return!!a&&(e.push(a),!0)}function getNoiseFunc(){const t=floor(rnd(8,16));return rnd([(t,e,o)=>noise(t,e,o),(e,o,r)=>ceil(noise(e,o,r)*t)/t])}const backgroundGradient=t=>{const e=t.drawingContext,o=-t.width*position[1],r=-t.height*position[0],s=t.width*(6-position[1]),i=t.height*(6-position[0]);t.push(),t.noStroke();const n=e.createLinearGradient(o,r,s,i);n.addColorStop(0,"#fcfcfc"),n.addColorStop(1,"#d1d1d1"),e.fillStyle=n,t.rect(0,0,t.width,t.height),t.pop()},backgroundElements={star:t=>{t.noStroke(),star(0,0,7*t.width/24*scaleFactor,t.width/3*scaleFactor,2*floor(rnd(12,26)),t)},circle:t=>{const e=rnd([0,rnd(PI/3,PI/2)]);rnd()<.5&&t.rotate(PI),nCircle(0,0,t.height/3*scaleFactor,100,t,e)}},easingFunctions={linear:t=>t,easeInQuad:(t,e)=>e?1-(1-t)*(1-t):t*t,easeInOutQuad:t=>t<.5?2*t*t:1-pow(-2*t+2,2)/2};function stripeElement(t){const e=rnd(),o=randomAttribute(easingFunctions,R2);let r=!1,s=!1;e<.33?r=!0:e<.66&&(s=!0);const i=t.width,n=i/2,a=n/12,h=t.height/2-12*a/2,c=(t.height-n)/2.1;let l,p;t.strokeWeight(i/1080),position[0]<3?(l=color("#b61624"),p=color("#ffcae9")):(l=color("#6ccff6"),p=color("#573280"));for(let e=0;e<12;e++){t.push();const n=lerpColor(l,p,o(e/11,position[0]>=3));t.fill(n),t.stroke(n);const d=h+e*a,u=d+a;r||s?(t.beginShape(),t.vertex(0,d),t.vertex(0,d),r?t.vertex(i/2,d-c):t.vertex(i/2,d+c),t.vertex(i,d),t.vertex(i,d),t.vertex(i,u),t.vertex(i,u),r?t.vertex(i/2,u-c):t.vertex(i/2,u+c),t.vertex(0,u),t.vertex(0,u),t.endShape(CLOSE)):t.rect(0,d,i,a),t.pop()}}function getPosition(){const t=`${tokenData.tokenId}`,e=parseInt(t.substring(t.length-4,t.length));if(e>35)throw new Error(random(errorMessages));const o=[0,0];for(let t=0;t<e;t++)o[1]++,o[1]>5&&(o[0]++,o[1]=0);return o}const bwPalette=["#0C191D","#F5F4F6"];function getPalette(){const t=[["#b61624","#ffcae9"],["#0356c9","#ffcae9"],["#573280","#ffcae9"],["#12695f","#ffcae9"],["#561643","#ffcae9"],["#f9dc5c","#b61624"],["#85ffd0","#b61624"],["#0356c9","#f9dc5c"],["#573280","#f9dc5c"],["#12695f","#f9dc5c"],["#561643","#f9dc5c"],["#85ffd0","#0356c9"],["#85ffd0","#573280"],["#6ccff6","#573280"],["#85ffd0","#12695f"],["#561643","#85ffd0"],["#6ccff6","#561643"],["#561643","#f07f42"],["#b61624","#cff186"],["#0356c9","#cff186"],["#573280","#cff186"],["#12695f","#cff186"],["#561643","#cff186"],["#573280","#f2c57c"],["#561643","#f2c57c"]],e=rnd(t),o=[];t.forEach((t=>{o.includes(t[0])||o.push(t[0]),o.includes(t[1])||o.push(t[1])})),shuffleArray(o,!0,R2);const r=o[getBgElemIndex()];if([1,4].includes(position[0])&&[1,4].includes(position[1])||[2,3].includes(position[0])&&[2,3].includes(position[1]))return shuffleArray(e,!0),e.push(r),e;const s=shuffleArray(bwPalette,!1);return s.push(r),s}function getBgElemIndex(){const t=[[1,2],[1,3],[2,1],[2,2],[2,3],[2,4],[3,1],[3,2],[3,3],[3,4],[4,2],[4,3]];for(let e=0;e<t.length;e++){const o=t[e];if(position[0]===o[0]&&position[1]===o[1])return e}}let bE,shapeTexture,shape,position,palette;const scaleFactor=1.25;function setup(){position=getPosition(),noiseSeed(seed);const t=min(windowWidth,windowHeight);createCanvas(t,t,WEBGL);let e=!1,o=!1;if(([1,4].includes(position[0])&&[2,3].includes(position[1])||[2,3].includes(position[0])&&[1,2,3,4].includes(position[1]))&&(e=!0),2!==position[0]&&3!==position[0]||(o=!0),palette=getPalette(),bE=createGraphics(width,height),bE.translate(0,bE.height),bE.scale(1,-1),backgroundGradient(bE),push(),o&&stripeElement(bE),e){const t=randomAttribute(backgroundElements);bE.stroke(palette[2]),bE.fill(palette[2]),bE.translate(bE.width/2,bE.height/2),t(bE)}pop(),shapeTexture=createGraphics(width,height);const r=randomAttribute(textures);shapeTexture.translate(0,shapeTexture.height),shapeTexture.scale(1,-1),r(shapeTexture),ortho(-width/2,width/2,height/2,-height/2,0,10*width);const s=(position[0]+position[1])%2==0;shape=new Shape(width/3*scaleFactor,s)}let mouseReleasedAt,resetDuration,easingExp,mouseDownPos=null,mouseIsPressed=!1,globalProgressX=0,globalProgressY=0;function draw(){if(texture(bE),push(),noStroke(),translate(0,0,-width),plane(width,height),pop(),push(),texture(shapeTexture),mouseIsPressed){const t=map(constrain(mouseDownPos[0]-mouseX,-width,width),-width,width,1,-1),e=map(constrain(mouseDownPos[1]-mouseY,-width,width),-width,width,1,-1);mouseDownPos=[mouseX,mouseY],globalProgressX=constrain(globalProgressX+t,-1,1),globalProgressY=constrain(globalProgressY+e,-1,1)}else if(0!==shape.rotationY||0!==shape.rotationX){const t=millis()-mouseReleasedAt,e=globalProgressX>0?max:min,o=globalProgressY>0?max:min;globalProgressX=e(lerp(globalProgressX,0,pow(t/resetDuration,easingExp)),0),globalProgressY=o(lerp(globalProgressY,0,pow(t/resetDuration,easingExp)),0)}const t=abs(globalProgressX),e=abs(globalProgressY),o=Math.sign(globalProgressX),r=Math.sign(globalProgressY);shape.rotationX=map(1-pow(1-e,5),0,1,0,PI/5)*r,shape.rotationY=map(1-pow(1-t,5),0,1,0,PI/5)*o,shape.draw(),pop()}function mousePressed(){mouseButton===LEFT&&(mouseDownPos=[mouseX,mouseY],mouseIsPressed=!0)}function mouseReleased(){mouseIsPressed=!1,mouseDownPos=null,mouseReleasedAt=millis();const t=max(abs(globalProgressX),abs(globalProgressY));resetDuration=map(t,0,1,100,1e3),easingExp=map(t,0,1,3,1.75)}function nCircle(t,e,o,r,s,i=0){s.noStroke();let n=(TWO_PI-i)/r;s.beginShape();for(let a=0;a<=r;a++){const r=n*a;let h=t+cos(r-HALF_PI+i/2)*o,c=e+sin(r-HALF_PI+i/2)*o;s.vertex(h,c)}s.endShape(CLOSE)}function star(t,e,o,r,s,i,n=0){let a=TWO_PI/s,h=a/2;i.beginShape();for(let s=n;s<TWO_PI+n;s+=a){let n=t+cos(s)*r,a=e+sin(s)*r;i.vertex(n,a),n=t+cos(s+h)*o,a=e+sin(s+h)*o,i.vertex(n,a)}i.endShape(CLOSE)}const hashPairs=[];for(let t=0;t<32;t++)hashPairs.push(tokenData.hash.slice(2+2*t,4+2*t));const decPairs=hashPairs.map((t=>parseInt(t,16))),seed=parseInt(tokenData.hash.slice(0,16),16),randomAttribute=function(t,e=R){const o=Object.keys(t);return t[o[o.length*e()<<0]]},rnd=function(t,e){const o=R();if(void 0===t)return o;if(void 0===e)return t instanceof Array?t[Math.floor(o*t.length)]:o*t;if(t>e){const o=t;t=e,e=o}return o*(e-t)+t};function shuffleArray(t,e,o=R){const r=ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t);let s,i,n=(t=e||r?t:t.slice()).length;for(;n>1;)s=o(0,1)*n|0,i=t[--n],t[n]=t[s],t[s]=i;return t}const pyramidModel=(t,e)=>{const o=[new p5.Vector(0,1.2*t,0),new p5.Vector(t/2,-t/2,t/2),new p5.Vector(-t/2,-t/2,t/2),new p5.Vector(0,1.2*t,0),new p5.Vector(t/2,-t/2,-t/2),new p5.Vector(t/2,-t/2,t/2),new p5.Vector(0,1.2*t,0),new p5.Vector(-t/2,-t/2,t/2),new p5.Vector(-t/2,-t/2,-t/2),new p5.Vector(0,1.2*t,0),new p5.Vector(t/2,-t/2,-t/2),new p5.Vector(-t/2,-t/2,-t/2)],r=[[0,1,2],[3,4,5],[6,7,8],[9,10,11]],s=[.25,1,.5,0,0,0,.75,1,1,0,.5,0,.75,1,1,0,.5,0,.25,1,.5,0,0,0],i=new p5.Geometry(1,1,(function(){this.strokeIndices=[[0,1],[2,3],[3,4],[8,9]],o.map((t=>{this.vertices.push(t)})),this.faces=r,this.uvs=s}));i.gid=e,i.computeNormals(),model(i)},cubeModel=(t,e)=>{const o=[new p5.Vector(-t/2,-t/2,t/2),new p5.Vector(t/2,-t/2,t/2),new p5.Vector(t/2,t/2,t/2),new p5.Vector(-t/2,t/2,t/2),new p5.Vector(-t/2,t/2,-t/2),new p5.Vector(-t/2,t/2,t/2),new p5.Vector(t/2,t/2,t/2),new p5.Vector(t/2,t/2,-t/2),new p5.Vector(t/2,-t/2,-t/2),new p5.Vector(t/2,t/2,-t/2),new p5.Vector(t/2,t/2,t/2),new p5.Vector(t/2,-t/2,t/2)],r=[[0,1,2],[0,2,3],[4,5,6],[4,6,7],[8,9,10],[8,10,11]],s=[0,0,.5,0,.5,.5,0,.5,0,1,0,.5,.5,.5,.5,1,1,0,1,.5,.5,.5,.5,0],i=new p5.Geometry(1,1,(function(){this.strokeIndices=[[1,2],[2,3],[2,7]],o.map((t=>{this.vertices.push(t)})),this.faces=r,this.uvs=s}));i.gid=e,i.computeNormals(),model(i)},dodecahedronModel=(t,e)=>{const o=(1+sqrt(5))/2,r=.5,s=.5/o,i=.5*(2-o);let n=[new p5.Vector(s,s,s),new p5.Vector(0,r,i),new p5.Vector(-s,s,s),new p5.Vector(-i,0,r),new p5.Vector(i,0,r),new p5.Vector(-s,-s,s),new p5.Vector(0,-r,i),new p5.Vector(s,-s,s),new p5.Vector(i,0,r),new p5.Vector(-i,0,r),new p5.Vector(s,-s,-s),new p5.Vector(0,-r,-i),new p5.Vector(-s,-s,-s),new p5.Vector(-i,0,-r),new p5.Vector(i,0,-r),new p5.Vector(-s,s,-s),new p5.Vector(0,r,-i),new p5.Vector(s,s,-s),new p5.Vector(i,0,-r),new p5.Vector(-i,0,-r),new p5.Vector(0,r,-i),new p5.Vector(0,r,i),new p5.Vector(s,s,s),new p5.Vector(r,i,0),new p5.Vector(s,s,-s),new p5.Vector(0,r,i),new p5.Vector(0,r,-i),new p5.Vector(-s,s,-s),new p5.Vector(-r,i,0),new p5.Vector(-s,s,s),new p5.Vector(0,-r,-i),new p5.Vector(0,-r,i),new p5.Vector(-s,-s,s),new p5.Vector(-r,-i,0),new p5.Vector(-s,-s,-s),new p5.Vector(0,-r,i),new p5.Vector(0,-r,-i),new p5.Vector(s,-s,-s),new p5.Vector(r,-i,0),new p5.Vector(s,-s,s),new p5.Vector(s,s,s),new p5.Vector(i,0,r),new p5.Vector(s,-s,s),new p5.Vector(r,-i,0),new p5.Vector(r,i,0),new p5.Vector(s,-s,-s),new p5.Vector(i,0,-r),new p5.Vector(s,s,-s),new p5.Vector(r,i,0),new p5.Vector(r,-i,0),new p5.Vector(-s,s,-s),new p5.Vector(-i,0,-r),new p5.Vector(-s,-s,-s),new p5.Vector(-r,-i,0),new p5.Vector(-r,i,0),new p5.Vector(-s,-s,s),new p5.Vector(-i,0,r),new p5.Vector(-s,s,s),new p5.Vector(-r,i,0),new p5.Vector(-r,-i,0)];n=n.map((e=>e.normalize().mult(t/1.2)));const a=[[0,1,2,3,4],[5,6,7,8,9],[10,11,12,13,14],[15,16,17,18,19],[20,21,22,23,24],[25,26,27,28,29],[30,31,32,33,34],[35,36,37,38,39],[40,41,42,43,44],[45,46,47,48,49],[50,51,52,53,54],[55,56,57,58,59]],h=[];for(let t=0;t<a.length;t++){const e=a[t];h.push([e[0],e[1],e[2]]),h.push([e[2],e[0],e[3]]),h.push([e[3],e[4],e[0]])}const c=[[4,3],[4,0],[4,7],[3,2],[3,5],[2,1],[2,28],[1,0],[1,16],[0,23],[7,6],[7,38],[6,5],[6,11],[5,33],[14,13],[14,10],[14,17],[13,12],[13,15],[12,11],[12,33],[11,10],[10,38],[17,16],[17,23],[16,15],[15,28],[23,38],[28,33]],l=.5/(sqrt(5+2*sqrt(5))/2),p=l*o,d=sqrt(pow(l,2)*sqrt(25+10*sqrt(5))/(5*sqrt((5+sqrt(5))/2))),u=[],w=a.length;for(let t=0;t<w;t++){const t=.5+p/3*rnd(-1,1),e=.5+p/3*rnd(-1,1),o=rnd(TWO_PI);for(let r=0;r<5;r++){const s=t+d*cos(TWO_PI*(r%5)/5+o)*1.15,i=e+d*sin(TWO_PI*(r%5)/5+o)*1.15;u.push(s,i)}}const g=new p5.Geometry(1,1,(function(){n.map((t=>{this.vertices.push(t)})),this.faces=h,this.uvs=u,this.strokeIndices=c}));g.gid=e,g.computeNormals(),model(g)},errorMessages=['"Art is anything you can get away with." - Andy Warhol','"Everything that is contradictory creates life." - Salvador Dali','"Computers are useless. They can only give you answers." - Pablo Picasso','"I am just another dot in the world." - Yayoi Kusama','"You have to step over the boundaries sometimes just to find out where they are." - Damien Hirst','"In terms of existing, everything is equal." - Donald Judd','"Nothing is important... so everything is important." - Keith Haring','"MIND THE SCAMS!!!" - DALEK','"Less is only more where more is no good." - Frank Lloyd Wright',"\"I love computer programmers. They have a very beautiful definition of complexity as 'the capacity to transmit the maximum information with the minimum data'.\" - Bjarke Ingels",'"By withholding most of the program output, the artist could present a particular, limited view of the algorithm." - Tyler Hobbs','"There can be no avant-garde because everything has been done." - Pedro Friedeberg'];
Departing from generative art’s focus on the size and variety of algorithmic outputs, Coalition contains just 36 geometric creations. Every mint is composed of unique combinations of line, shape, and color, making them artworks unto themselves. However, just as significant as the individual mints is the larger series of which they are each a part. When viewed collectively as a 6x6 grid, the 36 tokens make up a larger, single artwork, the titular Coalition. Patterns and palettes that exist across different tokens come together seamlessly in the Coalition, allowing users to recognize their mint as an indispensable element of the coherent whole. By highlighting the inextricable relationship between the single set and its 36 components, Coalition suggests that storytelling must play a vital role in the future of generative art. The medium’s current emphasis on long-form algorithmic exploration has come at the expense of narrative craft. While long-form algorithmic exploration has produced groundbreaking artwork and will continue to do so, our project urges practitioners and collectors to consider generative art’s capabilities outside of replicating the look of analog media. Instead of attempting a mimesis of old modes of production, Coalition foregrounds the stories about human experience that emerge when artists free their code from the burden of replicating paint and paper. We ask, does the “art” in generative art refer to the algorithm, or the outputs? There can be no avant-garde because everything has been done. —Pedro Friedeberg
S=Uint32Array.from([0,1,s=t=2,3].map(t=>parseInt(tokenData.hash.substr(8*t+2,8),16)));let ggPrev=!(R=e=>(t=S[3],S[3]=S[2],S[2]=S[1],S[1]=s=S[0],t^=t<<11,S[0]^=t^t>>>8^s>>>19,S[0]/2**32)),gy2=0,clrC,width,height;const hashPairs=[];for(let t=0;t<32;t++)hashPairs.push(tokenData.hash.slice(2+2*t,4+2*t));const decPairs=hashPairs.map(t=>parseInt(t,16));let seed=parseInt(tokenData.hash.slice(0,16),16),hWob,vWob,wobRes;function setup(){noiseSeed(seed),randomSeed(seed),clrC=new ClrC,wobRes=pow(2,floor(rnd(5,9))),noCanvas();width=900,height=1200;const s=new M;s.setup();var i="http://www.w3.org/2000/svg";let e=document.createElementNS(i,"svg");e.setAttribute("class","plot"),e.setAttribute("width","9in"),e.setAttribute("height","12in"),e.setAttribute("viewBox","0 0 "+width+" "+height),e.setAttribute("style","background-color:white;");for(let t=0;t<Object.keys(s.ps).length;t++){var h=Object.keys(s.ps)[t];const a=document.createElementNS(i,"g");a.setAttribute("id",`${clrC.nms[h]}`);var r=s.ps[h];for(let e=0;e<r.length;e++){let s="";s="M "+r[e][0].x+" "+r[e][0].y;for(let t=1;t<r[e].length;t++)s+=" L "+r[e][t].x+" "+r[e][t].y,t===r[e].length-1&&r[e][t]&&(s+=" L "+r[e][0].x+" "+r[e][0].y);if(s){const o=document.createElementNS(i,"path");o.setAttribute("style",`fill:none;stroke-width:1.5;stroke:${clrC.vals[h]};`),o.setAttribute("d",s),a.appendChild(o)}}e.appendChild(a)}if(s.aps.length){const c=document.createElementNS(i,"g");c.setAttribute("id","Accent Lines (Bold Black)");for(let t=0;t<s.aps.length;t++){var n=s.aps[t];if(n.length){let s="M "+n[0].x+" "+n[0].y;if(1===n.length)s+=" L "+n[0].x+" "+n[0].y;else for(let t=1;t<n.length;t++)s+=" L "+n[t].x+" "+n[t].y;const l=document.createElementNS(i,"path");l.setAttribute("style","fill:none;stroke-width:2.25;stroke:black;"),l.setAttribute("d",s),c.appendChild(l)}}e.appendChild(c)}document.body.appendChild(e);let t=document.createElement("style");t.appendChild(document.createTextNode(".plot{width:100vw;height:100vh;}")),document.head.appendChild(t)}function rnd(t,s){var e,i=R();return void 0===t?i:void 0===s?t instanceof Array?t[Math.floor(i*t.length)]:i*t:(s<t&&(e=t,t=s,s=e),i*(s-t)+t)}function rndFromArray(t){return t[floor(rnd(0,t.length))]}function shuffleArray(t,s){var e=ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t);let i,h,r=(t=s||e?t:t.slice()).length;for(;1<r;)i=rnd(0,1)*r|0,h=t[--r],t[r]=t[i],t[i]=h;return t}const rAttH=function(t,s){var e=Object.keys(t);return t[e[(e.length-1e-9)*dptp(decPairs[s])<<0]]},rAtt=function(t){var s=Object.keys(t);return t[s[Math.floor(s.length*R())]]};function dptp(t){return map(t,0,255,0,1)}const wChsr=function(s,...t){const e=[],i=[];Object.keys(s).forEach(t=>{i.push(s[t].weight),e.push(s[t].value)});let h=rnd();if(0<decPairs.length&&void 0!==t[0]){let s="";t.forEach(t=>{s+=hashPairs[t]}),h=map(parseInt(s,16),0,Math.pow(16,2*t.length),0,1)}for(let t=0;t<e.length;t++)if(h<=i[t])return e[t]};class M{constructor(){this.field=[];var t=[5,6,7,8,9,10,11,12,13,14,15,16],s=floor(map(dptp(decPairs[8]),0,1,0,t.length-1e-8));this.gs=4*t[s];t=height/1200,s=height/800;hWob=random(t,s),vWob=random(t,s),this.rez=height/this.gs,this.cols=1+width/this.rez,this.inc=rnd([.1,.08,.05]),this.rows=1+height/this.rez;this.lAmt=rAttH({small:.25,medium:.375,large:.5},6),this.ps={},this.aps=[],this.cClr;const o={a:()=>()=>R()*TWO_PI,b:()=>{const t=R()*TWO_PI;return()=>t}},c={a:()=>()=>rnd(5*PI/12,11*PI/12),b:()=>()=>rnd(PI/12,PI/4),c:()=>()=>PI/3,d:()=>{const t=rnd(PI/12,PI/4);return()=>t},e:()=>{const t=rnd(5*PI/12,11*PI/12);return()=>t}},l={a:{weight:.25,value:(t,s)=>({disX:()=>rndGaussian(1,.175)*t/2,disY:()=>rnd(s)})},b:{weight:.5,value:(t,s)=>({disX:()=>rnd(t),disY:()=>rndGaussian(1,.175)*s/2})},c:{weight:.6,value:(t,s)=>({disX:()=>rndGaussian(1,.21)*t/2,disY:()=>rndGaussian(1,.21)*s/2})},d:{weight:1,value:(t,s)=>({disX:()=>rnd(t),disY:()=>rnd(s)})}},d={a:()=>{const t=rnd(width/15,width/3);return()=>t},b:()=>()=>rnd(width/100,width/2)};s={a:s=>{const t=[...clrC.clrs];shuffleArray(t,!0);const e=t.slice(0,floor(rnd(2,max(2,floor(s/2+1))))),i=[];for(let t=0;t<s;t++)i.push(e[0]),e.push(e.shift());return i},b:s=>{const e=[clrC.rand()];for(let t=1;t<s;t++)e.push(clrC.new(e[t-1]));return e}};this.mLvls=floor(map(R(),0,1,4,20)),this.fTs={circles:{weight:.2,value:()=>{const{disX:s,disY:e}=wChsr(l,5)(width,height),i=rAtt(d)(),n=[];for(let t=0;t<100;t++)n.push(new LevelCircle(s(),e(),i(),Math.ceil(R()*this.mLvls)));const a=rAtt(easeFs);return({i:s,j:e})=>{for(let t=0;t<n.length;t++){var i=n[t],h=dist(i.x,i.y,s*this.rez,e*this.rez),r=map(h,0,i.radius,0,1);h<i.radius?this.field[s][e]=max(min(map(a(r),0,1,i.levels,1),i.levels),this.field[s][e]):this.field[s][e]=this.field[s][e]}}}},centered:{weight:.3,value:()=>{const n=rAtt(easeFs);return({xOff:t,yOff:s,zOff:e,i,j:h})=>{var r=constrain(map(dist(i*this.rez,h*this.rez,width/2,height/2),0,width/2,0,1),0,1);this.field[i][h]=map(noise(t,s,e)*n(r),0,1,0,this.mLvls)}}},classic:{weight:.4,value:()=>({xOff:t,yOff:s,zOff:e,i,j:h})=>{this.field[i][h]=map(noise(t,s,e),0,1,0,this.mLvls)}},points:{weight:.5,value:()=>({xOff:t,yOff:s,zOff:e,i,j:h})=>{this.field[i][h]=map(Math.pow(noise(t,s,e),2),0,1,0,this.mLvls)}},island:{weight:.6,value:()=>{let n=rAtt(easeFs);return({xOff:t,yOff:s,zOff:e,i,j:h})=>{var r=constrain(map(dist(i*this.rez,h*this.rez,width/2,height/2),0,width/2,1,0),0,1),e=map(noise(t,s,e),0,1,0,this.mLvls);this.field[i][h]=e*n(r)}}},triangles:{weight:.8,value:()=>{const s=rAtt(o)(),e=rAtt(c)(),{disX:i,disY:h}=wChsr(l,5)(width,height),r=rAtt(d)(),n=[];for(let t=0;t<100;t++)n.push(new LevelTriangle(i(),h(),r(),e(),Math.ceil(R()*this.mLvls),s()));const a=rAtt(easeFs);return({i:s,j:e})=>{for(let t=0;t<n.length;t++){const h=n[t];var i;h.containsPoint(s*this.rez,e*this.rez)?(i=h.distanceToTriangle(s*this.rez,e*this.rez),i=map(i,0,h.distanceToEdge,0,1),this.field[s][e]=max(min(map(a(i),0,1,h.levels,1),h.levels),this.field[s][e])):this.field[s][e]=this.field[s][e]}}}},squares:{weight:1,value:()=>{const s=rAtt(o)(),{disX:e,disY:i}=wChsr(l,5)(width,height),h=rAtt(d)(),r=[];for(let t=0;t<100;t++)r.push(new LevelSquare(e(),i(),h(),Math.ceil(R()*this.mLvls),s()));const n=rAtt(easeFs);return({i:s,j:e})=>{for(let t=0;t<r.length;t++){const h=r[t];var i;h.containsPoint(s*this.rez,e*this.rez)?(i=h.distanceToSquare(s*this.rez,e*this.rez),i=map(i,0,h.distanceToEdge,0,1),this.field[s][e]=max(min(map(n(i),0,1,h.levels,1),h.levels),this.field[s][e])):this.field[s][e]=this.field[s][e]}}}}},this.cSchm=rAttH(s,4)(this.mLvls),this.fType=wChsr(this.fTs,3)}setup(){for(let t=0;t<this.cols;t++){const V=[];for(let t=0;t<this.rows;t++)V.push(0);this.field.push(V)}const i=this.fType();let h=0;for(let e=0;e<this.cols;e++){let s=0;for(let t=0;t<this.rows;t++)i({xOff:h,yOff:s,zOff:0,i:e,j:t}),s+=this.inc;h+=this.inc}const r=[];push();for(let i=0;i<this.cols-1;i++)for(let e=0;e<this.rows-1;e++){var n=i*this.rez,a=e*this.rez,o=createVector(n,a),c=createVector(n+this.rez/2,a+this.rez/2),l=createVector(n+this.rez,a),d=createVector(n,a+this.rez),p=createVector(n+this.rez,a+this.rez),u=createVector(n+.5*this.rez,a),g=createVector(n+this.rez,a+.5*this.rez),f=createVector(n+.5*this.rez,a+this.rez),w=createVector(n,a+.5*this.rez),y=this.field[i][e],v=this.field[i+1][e],m=this.field[i+1][e+1],b=this.field[i][e+1],q=floor(Math.min(y,v,m,b)),x=floor(y)-q,S=floor(v)-q,T=floor(m)-q,P=floor(b)-q;let t=new Set;t.add(x),t.add(S),t.add(T),t.add(P);const M=[{i:0,p:x},{i:1,p:S},{i:2,p:T},{i:3,p:P}];M.sort((t,s)=>t.p-s.p);let s=0;const O=[];O[M[0].i]=M[0];for(let t=1;t<M.length;t++)M[t].p!=M[t-1].p&&s++,O[M[t].i]={i:M[t].i,p:s};var z=this.cSchm[floor(y)%this.cSchm.length],A=this.cSchm[floor(v)%this.cSchm.length],k=this.cSchm[floor(m)%this.cSchm.length],n=this.cSchm[floor(b)%this.cSchm.length],a=O[0].p,q=O[1].p,x=O[2].p,S=O[3].p;if(t.size<=2){var T=this.getState(a,q,x,S),P=floor(Math.max(y,v,m,b)),b=floor(Math.min(y,v,m,b)),L=this.cSchm[P%this.cSchm.length],C=this.cSchm[b%this.cSchm.length];switch(T){case 0:this.sgc(C),this.qwe(l,p,d,o);break;case 1:this.sgc(C),this.qwe(w,f,p,l,o),this.sgc(L),this.qwe(f,w,d),r.push([f,w]);break;case 2:this.sgc(C),this.qwe(g,f,d,o,l),this.sgc(L),this.qwe(g,f,p),r.push([g,f]),r.push([d,l]);break;case 3:this.sgc(C),this.qwe(g,w,o,l),this.sgc(L),this.qwe(g,w,d,p),r.push([g,w]),r.push([o,l]);break;case 4:this.sgc(C),this.qwe(u,g,p,d,o),this.sgc(L),this.qwe(u,g,l),r.push([u,g]);break;case 5:this.sgc(C),this.qwe(u,w,o),this.qwe(f,g,p),this.sgc(L),this.qwe(u,w,d,f,g,l),r.push([u,w]),r.push([g,f]);break;case 6:this.sgc(C),this.qwe(u,f,d,o),this.sgc(L),this.qwe(u,f,p,l),r.push([u,f]),r.push([d,o]);break;case 7:this.sgc(C),this.qwe(u,w,o),this.sgc(L),this.qwe(u,w,d,p,l),r.push([u,w]);break;case 8:this.sgc(C),this.qwe(u,w,d,p,l),this.sgc(L),this.qwe(u,w,o),r.push([u,w]);break;case 9:this.sgc(C),this.qwe(u,f,p,l),this.sgc(L),this.qwe(u,f,d,o),r.push([u,f]);break;case 10:this.sgc(C),this.qwe(u,g,l),this.qwe(f,w,d),this.sgc(L),this.qwe(u,g,p,f,w,o),r.push([u,g]),r.push([f,w]);break;case 11:this.sgc(C),this.qwe(u,g,l),this.sgc(L),this.qwe(u,g,p,d,o),r.push([u,g]);break;case 12:this.sgc(C),this.qwe(g,w,d,p),this.sgc(L),this.qwe(g,w,o,l),r.push([g,w]);break;case 13:this.sgc(C),this.qwe(g,f,p),this.sgc(L),this.qwe(g,f,d,o,l),r.push([g,f]);break;case 14:this.sgc(C),this.qwe(f,w,d),this.sgc(L),this.qwe(f,w,o,l,p),r.push([f,w]);break;case 15:this.sgc(L),this.qwe(o,l,p,d)}}else a!==x?q!==S?a!==q?q!==x?x!==S?S!==a?(this.sgc(z),this.qwe(u,c,w,o,u),this.sgc(A),this.qwe(u,c,g,l,u),this.sgc(n),this.qwe(f,c,w,d,f),this.sgc(k),this.qwe(f,c,g,p,f),r.push([u,f]),r.push([w,g])):(this.sgc(z),this.qwe(u,f,d,o),this.sgc(A),this.qwe(u,c,g,l),this.sgc(k),this.qwe(f,c,g,p),r.push([u,f]),r.push([g,c])):(this.sgc(n),this.qwe(w,g,p,d),this.sgc(z),this.qwe(u,c,w,o),this.sgc(A),this.qwe(u,c,g,l),r.push([w,g]),r.push([u,c])):(this.sgc(A),this.qwe(u,f,p,l),this.sgc(z),this.qwe(u,c,w,o),this.sgc(n),this.qwe(f,c,w,d),r.push([u,f]),r.push([c,w])):(this.sgc(z),this.qwe(w,g,l,o),this.sgc(k),this.qwe(g,c,f,p),this.sgc(n),this.qwe(w,c,f,d),r.push([w,g]),r.push([c,f])):(this.sgc(k),this.qwe(g,f,p),this.sgc(z),this.qwe(u,w,o),this.sgc(A),this.qwe(u,w,d,f,g,l),r.push([u,w]),r.push([g,f])):(this.sgc(A),this.qwe(u,g,l),this.sgc(n),this.qwe(w,f,d),this.sgc(z),this.qwe(u,g,p,f,w,o),r.push([u,g]),r.push([f,w]))}pop(),this.aSegs=[],r.forEach(t=>this.aSegs.push(new Seg(t[0],t[1],0)));var t=[cos,sin,t=>sin(t)*sin(t),t=>1.2*sin(3*t)*cos(t),t=>sin(t)/(Math.atanh(t)||1)];const s=rnd(t),e=rnd(t);if(dptp(decPairs[11])<.75){const I=dptp(decPairs[10])<.75,E=this.sSegs(this.aSegs);E.forEach(t=>{t.forEach(t=>this.aps.push(...t.show(I,s,e)))})}}sgc(t){this.ps[t]||(this.ps[t]=[]),this.cClr=t}sSegs(s){const n={},a={},e=[],i=[],h=[];for(let t=0;t<s.length;t++){var r=s[t];r.aType===aTypes.h?n[r.start.y]?n[r.start.y].push(r):n[r.start.y]=[r]:r.aType===aTypes.v?a[r.start.x]?a[r.start.x].push(r):a[r.start.x]=[r]:(r.aType===aTypes.da?e:r.aType===aTypes.db?i:h).push(r)}const o=[];Object.keys(n).forEach(t=>{const s=n[t];s.sort((t,s)=>t.start.x-s.start.x);let e=s[0].start,i=s[0].end,h=s[0].clr;if(1===s.length)return o.push(new Line(e,i,h));for(let t=1;t<s.length;t++){var r=s[t];r.start.x!==i.x||r.clr!==h?(o.push(new Line(e,i,h)),e=r.start,i=r.end,h=r.clr,t===s.length-1&&o.push(new Line(e,i,h))):t===s.length-1?o.push(new Line(e,r.end,h)):i=r.end}});const c=[];Object.keys(a).forEach(t=>{const s=a[t];s.sort((t,s)=>t.start.y-s.start.y);let e=s[0].start,i=s[0].end,h=s[0].clr;if(1===s.length)return c.push(new Line(e,i,h));for(let t=1;t<s.length;t++){var r=s[t];r.start.y!==i.y||r.clr!==h?(c.push(new Line(e,i,h)),e=r.start,i=r.end,h=r.clr,t===s.length-1&&c.push(new Line(e,i,h))):t===s.length-1?c.push(new Line(e,r.end,h)):i=r.end}});var t=this.gDiag(e),l=this.gDiag(i);const d=[];return h.forEach(t=>{d.push(new Line(t.start,t.end,t.clr))}),[o,c,t,l,d]}gDiag(e){const i=[];for(let t=0;t<e.length;t++){var h=e[t];let s=!1;for(let t=0;t<i.length;t++){var r=i[t];if(h.clr===r.clr){if(h.start.x===r.end.x&&h.start.y===r.end.y){i[t]=new Line(r.start,h.end,r.clr),s=!0;break}if(h.end.x===r.start.x&&h.end.y===r.start.y){i[t]=new Line(h.start,r.end,r.clr),s=!0;break}}}s||i.push(new Line(h.start,h.end,h.clr))}return i}qwe(...s){let e=0,i=0;for(let t=0;t<s.length;t++)e+=s[t].x,i+=s[t].y;const h=[],r=createVector(e/s.length,i/s.length);s.forEach(t=>{h.push(p5.Vector.lerp(t,r,this.lAmt))}),this.ps[this.cClr].push(h)}getState(t,s,e,i){return t%2*8+s%2*4+e%2*2+i%2*1}}class Seg{constructor(t,s,e){t.x=round(t.x,8),t.y=round(t.y,8),s.x=round(s.x,8),s.y=round(s.y,8),this.clr=e,t.y===s.y?(this.aType=aTypes.h,t.x<s.x?(this.start=t,this.end=s):(this.start=s,this.end=t)):t.x===s.x?(this.aType=aTypes.v,t.y<s.y?(this.start=t,this.end=s):(this.start=s,this.end=t)):(t.y<s.y?(this.start=t,this.end=s):(this.start=s,this.end=t),1===(e=round((this.end.y-this.start.y)/(this.end.x-this.start.x),8))?this.aType=aTypes.da:-1===e?this.aType=aTypes.db:(this.aType=aTypes.o,this.start=t,this.end=s))}}class Line{constructor(t,s,e){this.start=t,this.end=s,this.clr=e,this.isHorizontal=t.y===s.y,this.isVertical=t.x===s.x}show(t=!1,i,h){var s=p5.Vector.dist(this.start,this.end);const r=[];let n=[];if(t){var a=map(s,0,height,2,400);for(let e=0;e<a;e++){let t,s;var o=map(e,0,a-1,this.start.x,this.end.x),c=map(e,0,a-1,this.start.y,this.end.y);this.isHorizontal?(t=o,s=this.start.y+map(i(wobRes*t/width),-1,1,-hWob,hWob)):this.isVertical?(s=c,t=this.start.x+map(h(wobRes*s/width),-1,1,-vWob,vWob)):(t=o+map(h(wobRes*c/width),-1,1,-vWob,vWob),s=c+map(i(wobRes*o/width),-1,1,-hWob,hWob)),0<=t&&t<=width&&0<=s&&s<=height?n.push(createVector(t,s)):(1<n.length&&r.push([...n]),n=[])}1<n.length&&r.push(n)}else r.push([this.start,this.end]);return r}}class LevelCircle{constructor(t,s,e,i,h){this.x=t,this.y=s,this.radius=e,this.levels=i}}class LevelTriangle{constructor(t,s,e,i,h,r=0){this.points=[],this.levels=h;var n=createVector(t,s),a=(PI-i)/2,o=2*e/3,h=sqrt(pow(e/3,2)+pow(e/tan(a),2)),e=asin(e/3/h);const c=createVector(0,-o);c.rotate(r),this.points.push(p5.Vector.add(n,c)),c.rotate(PI-(i/2+(a-e))),c.setMag(h),this.points.push(p5.Vector.add(n,c)),c.rotate(PI-2*e),this.points.push(p5.Vector.add(n,c)),this.distanceToEdge=this.distanceToTriangle(t,s)}distanceToTriangle(s,e){let i;for(let t=0;t<this.points.length;t++){var h=this.points[t],r=this.points[(t+1)%this.points.length],h=abs((r.x-h.x)*(h.y-e)-(h.x-s)*(r.y-h.y))/sqrt(pow(r.x-h.x,2)+pow(r.y-h.y,2));i=i?min(h,i):h}return i}containsPoint(t,s){return pointInPolygon(createVector(t,s),[this.points[0],this.points[1],this.points[2]])}}class LevelSquare{constructor(t,s,e,i,h=0){this.points=[],this.levels=i;i=createVector(t,s);const r=createVector(-e/2,-e/2);r.rotate(h),this.points.push(p5.Vector.add(i,r)),r.rotate(PI/2),this.points.push(p5.Vector.add(i,r)),r.rotate(PI/2),this.points.push(p5.Vector.add(i,r)),r.rotate(PI/2),this.points.push(p5.Vector.add(i,r)),this.distanceToEdge=this.distanceToSquare(t,s)}distanceToSquare(s,e){let i;for(let t=0;t<this.points.length;t++){var h=this.points[t],r=this.points[(t+1)%this.points.length],h=abs((r.x-h.x)*(h.y-e)-(h.x-s)*(r.y-h.y))/sqrt(pow(r.x-h.x,2)+pow(r.y-h.y,2));i=i?min(h,i):h}return i}containsPoint(t,s){return pointInPolygon(createVector(t,s),[this.points[0],this.points[1],this.points[2],this.points[3]])}}function pointInPolygon(t,e){var{x:i,y:h}=t;let r=!1;var n=e.length;for(let t=0,s=n-1;t<n;s=t++){var a=e[t].x,o=e[t].y,c=e[s].x,l=e[s].y;h<o!=h<l&&i<(c-a)*(h-o)/(l-o)+a&&(r=!r)}return r}const aTypes={h:0,v:1,da:2,db:3,o:4};class ClrC{nms=["Micron Rose","Micron Red","Micron Orange","Micron Green","Micron Blue","Micron Purple","Micron Brown","Micron Light Cool Gray","Micron Cool Gray","Micron Black"];vals=["#df4a82","#f1230a","#f47d3d","#47a858","#0972c4","#842eae","#a14725","#cac8c9","#979699","#000"];constructor(){const t=[0,1,2,3,4,5,6];dptp(decPairs[15])<.15?this.clrs=[7,8,9]:(shuffleArray(t,!0),this.clrs=t.slice(0,rnd([3,5])))}rand(){return rnd(this.clrs)}new(t){if(this.clrs.length<=1)return t;let s=this.rand();for(;s===t;)s=this.rand();return s}}const easeFs={a:t=>t,b:t=>t<.5?2*t*t:1-pow(-2*t+2,2)/2,c:t=>t*t,d:t=>1-(1-t)*(1-t),e:t=>1-easeFs.f(1-t),f:t=>{var s=7.5625,e=2.75;return t<1/e?s*t*t:t<2/e?s*(t-=1.5/e)*t+.75:t<2.5/e?s*(t-=2.25/e)*t+.9375:s*(t-=2.625/e)*t+.984375},g:t=>t<.5?(1-easeFs.f(1-2*t))/2:(1+easeFs.f(2*t-1))/2,h:t=>t<=.5?2*t:2*(.5-(t-.5))};function rndGaussian(t,s=1){let e,i,h,r;if(ggPrev)e=gy2,ggPrev=!1;else{for(;i=rnd(2)-1,h=rnd(2)-1,r=i*i+h*h,1<=r;);r=Math.sqrt(-2*Math.log(r)/r),e=i*r,gy2=h*r,ggPrev=!0}return e*s+(t||0)}
S=Uint32Array.from([0,1,s=t=2,3].map(t=>parseInt(tokenData.hash.substr(8*t+2,8),16)));let ggPrev=!(R=e=>(t=S[3],S[3]=S[2],S[2]=S[1],S[1]=s=S[0],t^=t<<11,S[0]^=t^t>>>8^s>>>19,S[0]/2**32)),gy2=0,clrC,width,height;const hashPairs=[];for(let t=0;t<32;t++)hashPairs.push(tokenData.hash.slice(2+2*t,4+2*t));const decPairs=hashPairs.map(t=>parseInt(t,16));let seed=parseInt(tokenData.hash.slice(0,16),16),hWob,vWob,wobRes;function setup(){noiseSeed(seed),randomSeed(seed),clrC=new ClrC,wobRes=pow(2,floor(rnd(5,9))),noCanvas();width=900,height=1200;const s=new M;s.setup();var i="http://www.w3.org/2000/svg";let e=document.createElementNS(i,"svg");e.setAttribute("class","plot"),e.setAttribute("width","9in"),e.setAttribute("height","12in"),e.setAttribute("viewBox","0 0 "+width+" "+height),e.setAttribute("style","background-color:white;");for(let t=0;t<Object.keys(s.ps).length;t++){var h=Object.keys(s.ps)[t];const a=document.createElementNS(i,"g");a.setAttribute("id",`${clrC.nms[h]}`);var r=s.ps[h];for(let e=0;e<r.length;e++){let s="";s="M "+r[e][0].x+" "+r[e][0].y;for(let t=1;t<r[e].length;t++)s+=" L "+r[e][t].x+" "+r[e][t].y,t===r[e].length-1&&r[e][t]&&(s+=" L "+r[e][0].x+" "+r[e][0].y);if(s){const o=document.createElementNS(i,"path");o.setAttribute("style",`fill:none;stroke-width:1.5;stroke:${clrC.vals[h]};`),o.setAttribute("d",s),a.appendChild(o)}}e.appendChild(a)}if(s.aps.length){const c=document.createElementNS(i,"g");c.setAttribute("id","Accent Lines (Bold Black)");for(let t=0;t<s.aps.length;t++){var n=s.aps[t];if(n.length){let s="M "+n[0].x+" "+n[0].y;if(1===n.length)s+=" L "+n[0].x+" "+n[0].y;else for(let t=1;t<n.length;t++)s+=" L "+n[t].x+" "+n[t].y;const l=document.createElementNS(i,"path");l.setAttribute("style","fill:none;stroke-width:2.25;stroke:black;"),l.setAttribute("d",s),c.appendChild(l)}}e.appendChild(c)}document.body.appendChild(e);let t=document.createElement("style");t.appendChild(document.createTextNode(".plot{width:100vw;height:100vh;}")),document.head.appendChild(t)}function rnd(t,s){var e,i=R();return void 0===t?i:void 0===s?t instanceof Array?t[Math.floor(i*t.length)]:i*t:(s<t&&(e=t,t=s,s=e),i*(s-t)+t)}function rndFromArray(t){return t[floor(rnd(0,t.length))]}function shuffleArray(t,s){var e=ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t);let i,h,r=(t=s||e?t:t.slice()).length;for(;1<r;)i=rnd(0,1)*r|0,h=t[--r],t[r]=t[i],t[i]=h;return t}const rAttH=function(t,s){var e=Object.keys(t);return t[e[(e.length-1e-9)*dptp(decPairs[s])<<0]]},rAtt=function(t){var s=Object.keys(t);return t[s[Math.floor(s.length*R())]]};function dptp(t){return map(t,0,255,0,1)}const wChsr=function(s,...t){const e=[],i=[];Object.keys(s).forEach(t=>{i.push(s[t].weight),e.push(s[t].value)});let h=rnd();if(0<decPairs.length&&void 0!==t[0]){let s="";t.forEach(t=>{s+=hashPairs[t]}),h=map(parseInt(s,16),0,Math.pow(16,2*t.length),0,1)}for(let t=0;t<e.length;t++)if(h<=i[t])return e[t]};class M{constructor(){this.field=[];var t=[5,6,7,8,9,10,11,12,13,14,15,16],s=floor(map(dptp(decPairs[8]),0,1,0,t.length-1e-8));this.gs=4*t[s];t=height/1200,s=height/800;hWob=random(t,s),vWob=random(t,s),this.rez=height/this.gs,this.cols=1+width/this.rez,this.inc=rnd([.1,.08,.05]),this.rows=1+height/this.rez;this.lAmt=rAttH({small:.25,medium:.375,large:.5},6),this.ps={},this.aps=[],this.cClr;const o={a:()=>()=>R()*TWO_PI,b:()=>{const t=R()*TWO_PI;return()=>t}},c={a:()=>()=>rnd(5*PI/12,11*PI/12),b:()=>()=>rnd(PI/12,PI/4),c:()=>()=>PI/3,d:()=>{const t=rnd(PI/12,PI/4);return()=>t},e:()=>{const t=rnd(5*PI/12,11*PI/12);return()=>t}},l={a:{weight:.25,value:(t,s)=>({disX:()=>rndGaussian(1,.175)*t/2,disY:()=>rnd(s)})},b:{weight:.5,value:(t,s)=>({disX:()=>rnd(t),disY:()=>rndGaussian(1,.175)*s/2})},c:{weight:.6,value:(t,s)=>({disX:()=>rndGaussian(1,.21)*t/2,disY:()=>rndGaussian(1,.21)*s/2})},d:{weight:1,value:(t,s)=>({disX:()=>rnd(t),disY:()=>rnd(s)})}},d={a:()=>{const t=rnd(width/15,width/3);return()=>t},b:()=>()=>rnd(width/100,width/2)};s={a:s=>{const t=[...clrC.clrs];shuffleArray(t,!0);const e=t.slice(0,floor(rnd(2,max(2,floor(s/2+1))))),i=[];for(let t=0;t<s;t++)i.push(e[0]),e.push(e.shift());return i},b:s=>{const e=[clrC.rand()];for(let t=1;t<s;t++)e.push(clrC.new(e[t-1]));return e}};this.mLvls=floor(map(R(),0,1,4,20)),this.fTs={circles:{weight:.2,value:()=>{const{disX:s,disY:e}=wChsr(l,5)(width,height),i=rAtt(d)(),n=[];for(let t=0;t<100;t++)n.push(new LevelCircle(s(),e(),i(),Math.ceil(R()*this.mLvls)));const a=rAtt(easeFs);return({i:s,j:e})=>{for(let t=0;t<n.length;t++){var i=n[t],h=dist(i.x,i.y,s*this.rez,e*this.rez),r=map(h,0,i.radius,0,1);h<i.radius?this.field[s][e]=max(min(map(a(r),0,1,i.levels,1),i.levels),this.field[s][e]):this.field[s][e]=this.field[s][e]}}}},centered:{weight:.3,value:()=>{const n=rAtt(easeFs);return({xOff:t,yOff:s,zOff:e,i,j:h})=>{var r=constrain(map(dist(i*this.rez,h*this.rez,width/2,height/2),0,width/2,0,1),0,1);this.field[i][h]=map(noise(t,s,e)*n(r),0,1,0,this.mLvls)}}},classic:{weight:.4,value:()=>({xOff:t,yOff:s,zOff:e,i,j:h})=>{this.field[i][h]=map(noise(t,s,e),0,1,0,this.mLvls)}},points:{weight:.5,value:()=>({xOff:t,yOff:s,zOff:e,i,j:h})=>{this.field[i][h]=map(Math.pow(noise(t,s,e),2),0,1,0,this.mLvls)}},island:{weight:.6,value:()=>{let n=rAtt(easeFs);return({xOff:t,yOff:s,zOff:e,i,j:h})=>{var r=constrain(map(dist(i*this.rez,h*this.rez,width/2,height/2),0,width/2,1,0),0,1),e=map(noise(t,s,e),0,1,0,this.mLvls);this.field[i][h]=e*n(r)}}},triangles:{weight:.8,value:()=>{const s=rAtt(o)(),e=rAtt(c)(),{disX:i,disY:h}=wChsr(l,5)(width,height),r=rAtt(d)(),n=[];for(let t=0;t<100;t++)n.push(new LevelTriangle(i(),h(),r(),e(),Math.ceil(R()*this.mLvls),s()));const a=rAtt(easeFs);return({i:s,j:e})=>{for(let t=0;t<n.length;t++){const h=n[t];var i;h.containsPoint(s*this.rez,e*this.rez)?(i=h.distanceToTriangle(s*this.rez,e*this.rez),i=map(i,0,h.distanceToEdge,0,1),this.field[s][e]=max(min(map(a(i),0,1,h.levels,1),h.levels),this.field[s][e])):this.field[s][e]=this.field[s][e]}}}},squares:{weight:1,value:()=>{const s=rAtt(o)(),{disX:e,disY:i}=wChsr(l,5)(width,height),h=rAtt(d)(),r=[];for(let t=0;t<100;t++)r.push(new LevelSquare(e(),i(),h(),Math.ceil(R()*this.mLvls),s()));const n=rAtt(easeFs);return({i:s,j:e})=>{for(let t=0;t<r.length;t++){const h=r[t];var i;h.containsPoint(s*this.rez,e*this.rez)?(i=h.distanceToSquare(s*this.rez,e*this.rez),i=map(i,0,h.distanceToEdge,0,1),this.field[s][e]=max(min(map(n(i),0,1,h.levels,1),h.levels),this.field[s][e])):this.field[s][e]=this.field[s][e]}}}}},this.cSchm=rAttH(s,4)(this.mLvls),this.fType=wChsr(this.fTs,3)}setup(){for(let t=0;t<this.cols;t++){const V=[];for(let t=0;t<this.rows;t++)V.push(0);this.field.push(V)}const i=this.fType();let h=0;for(let e=0;e<this.cols;e++){let s=0;for(let t=0;t<this.rows;t++)i({xOff:h,yOff:s,zOff:0,i:e,j:t}),s+=this.inc;h+=this.inc}const r=[];push();for(let i=0;i<this.cols-1;i++)for(let e=0;e<this.rows-1;e++){var n=i*this.rez,a=e*this.rez,o=createVector(n,a),c=createVector(n+this.rez/2,a+this.rez/2),l=createVector(n+this.rez,a),d=createVector(n,a+this.rez),p=createVector(n+this.rez,a+this.rez),u=createVector(n+.5*this.rez,a),g=createVector(n+this.rez,a+.5*this.rez),f=createVector(n+.5*this.rez,a+this.rez),w=createVector(n,a+.5*this.rez),y=this.field[i][e],v=this.field[i+1][e],m=this.field[i+1][e+1],b=this.field[i][e+1],q=floor(Math.min(y,v,m,b)),x=floor(y)-q,S=floor(v)-q,T=floor(m)-q,P=floor(b)-q;let t=new Set;t.add(x),t.add(S),t.add(T),t.add(P);const M=[{i:0,p:x},{i:1,p:S},{i:2,p:T},{i:3,p:P}];M.sort((t,s)=>t.p-s.p);let s=0;const O=[];O[M[0].i]=M[0];for(let t=1;t<M.length;t++)M[t].p!=M[t-1].p&&s++,O[M[t].i]={i:M[t].i,p:s};var z=this.cSchm[floor(y)%this.cSchm.length],A=this.cSchm[floor(v)%this.cSchm.length],L=this.cSchm[floor(m)%this.cSchm.length],n=this.cSchm[floor(b)%this.cSchm.length],a=O[0].p,q=O[1].p,x=O[2].p,S=O[3].p;if(t.size<=2){var T=this.getState(a,q,x,S),P=floor(Math.max(y,v,m,b)),b=floor(Math.min(y,v,m,b)),k=this.cSchm[P%this.cSchm.length],C=this.cSchm[b%this.cSchm.length];switch(T){case 0:this.sgc(C),this.qwe(l,p,d,o);break;case 1:this.sgc(C),this.qwe(w,f,p,l,o),this.sgc(k),this.qwe(f,w,d),r.push([f,w]);break;case 2:this.sgc(C),this.qwe(g,f,d,o,l),this.sgc(k),this.qwe(g,f,p),r.push([g,f]),r.push([d,l]);break;case 3:this.sgc(C),this.qwe(g,w,o,l),this.sgc(k),this.qwe(g,w,d,p),r.push([g,w]),r.push([o,l]);break;case 4:this.sgc(C),this.qwe(u,g,p,d,o),this.sgc(k),this.qwe(u,g,l),r.push([u,g]);break;case 5:this.sgc(C),this.qwe(u,w,o),this.qwe(f,g,p),this.sgc(k),this.qwe(u,w,d,f,g,l),r.push([u,w]),r.push([g,f]);break;case 6:this.sgc(C),this.qwe(u,f,d,o),this.sgc(k),this.qwe(u,f,p,l),r.push([u,f]),r.push([d,o]);break;case 7:this.sgc(C),this.qwe(u,w,o),this.sgc(k),this.qwe(u,w,d,p,l),r.push([u,w]);break;case 8:this.sgc(C),this.qwe(u,w,d,p,l),this.sgc(k),this.qwe(u,w,o),r.push([u,w]);break;case 9:this.sgc(C),this.qwe(u,f,p,l),this.sgc(k),this.qwe(u,f,d,o),r.push([u,f]);break;case 10:this.sgc(C),this.qwe(u,g,l),this.qwe(f,w,d),this.sgc(k),this.qwe(u,g,p,f,w,o),r.push([u,g]),r.push([f,w]);break;case 11:this.sgc(C),this.qwe(u,g,l),this.sgc(k),this.qwe(u,g,p,d,o),r.push([u,g]);break;case 12:this.sgc(C),this.qwe(g,w,d,p),this.sgc(k),this.qwe(g,w,o,l),r.push([g,w]);break;case 13:this.sgc(C),this.qwe(g,f,p),this.sgc(k),this.qwe(g,f,d,o,l),r.push([g,f]);break;case 14:this.sgc(C),this.qwe(f,w,d),this.sgc(k),this.qwe(f,w,o,l,p),r.push([f,w]);break;case 15:this.sgc(k),this.qwe(o,l,p,d)}}else a!==x?q!==S?a!==q?q!==x?x!==S?S!==a?(this.sgc(z),this.qwe(u,c,w,o,u),this.sgc(A),this.qwe(u,c,g,l,u),this.sgc(n),this.qwe(f,c,w,d,f),this.sgc(L),this.qwe(f,c,g,p,f),r.push([u,f]),r.push([w,g])):(this.sgc(z),this.qwe(u,f,d,o),this.sgc(A),this.qwe(u,c,g,l),this.sgc(L),this.qwe(f,c,g,p),r.push([u,f]),r.push([g,c])):(this.sgc(n),this.qwe(w,g,p,d),this.sgc(z),this.qwe(u,c,w,o),this.sgc(A),this.qwe(u,c,g,l),r.push([w,g]),r.push([u,c])):(this.sgc(A),this.qwe(u,f,p,l),this.sgc(z),this.qwe(u,c,w,o),this.sgc(n),this.qwe(f,c,w,d),r.push([u,f]),r.push([c,w])):(this.sgc(z),this.qwe(w,g,l,o),this.sgc(L),this.qwe(g,c,f,p),this.sgc(n),this.qwe(w,c,f,d),r.push([w,g]),r.push([c,f])):(this.sgc(L),this.qwe(g,f,p),this.sgc(z),this.qwe(u,w,o),this.sgc(A),this.qwe(u,w,d,f,g,l),r.push([u,w]),r.push([g,f])):(this.sgc(A),this.qwe(u,g,l),this.sgc(n),this.qwe(w,f,d),this.sgc(z),this.qwe(u,g,p,f,w,o),r.push([u,g]),r.push([f,w]))}pop(),this.aSegs=[],r.forEach(t=>this.aSegs.push(new Seg(t[0],t[1],0)));var t=[cos,sin,t=>sin(t)*sin(t),t=>1.2*sin(3*t)*cos(t),t=>sin(t)/(Math.atanh(t)||1)];const s=rnd(t),e=rnd(t);if(dptp(decPairs[11])<.75){const I=dptp(decPairs[10])<.75,E=this.sSegs(this.aSegs);E.forEach(t=>{t.forEach(t=>this.aps.push(...t.show(I,s,e)))})}}sgc(t){this.ps[t]||(this.ps[t]=[]),this.cClr=t}sSegs(s){const n={},a={},e=[],i=[],h=[];for(let t=0;t<s.length;t++){var r=s[t];r.aType===aTypes.h?n[r.start.y]?n[r.start.y].push(r):n[r.start.y]=[r]:r.aType===aTypes.v?a[r.start.x]?a[r.start.x].push(r):a[r.start.x]=[r]:(r.aType===aTypes.da?e:r.aType===aTypes.db?i:h).push(r)}const o=[];Object.keys(n).forEach(t=>{const s=n[t];s.sort((t,s)=>t.start.x-s.start.x);let e=s[0].start,i=s[0].end,h=s[0].clr;if(1===s.length)return o.push(new Line(e,i,h));for(let t=1;t<s.length;t++){var r=s[t];r.start.x!==i.x||r.clr!==h?(o.push(new Line(e,i,h)),e=r.start,i=r.end,h=r.clr,t===s.length-1&&o.push(new Line(e,i,h))):t===s.length-1?o.push(new Line(e,r.end,h)):i=r.end}});const c=[];Object.keys(a).forEach(t=>{const s=a[t];s.sort((t,s)=>t.start.y-s.start.y);let e=s[0].start,i=s[0].end,h=s[0].clr;if(1===s.length)return c.push(new Line(e,i,h));for(let t=1;t<s.length;t++){var r=s[t];r.start.y!==i.y||r.clr!==h?(c.push(new Line(e,i,h)),e=r.start,i=r.end,h=r.clr,t===s.length-1&&c.push(new Line(e,i,h))):t===s.length-1?c.push(new Line(e,r.end,h)):i=r.end}});var t=this.gDiag(e),l=this.gDiag(i);const d=[];return h.forEach(t=>{d.push(new Line(t.start,t.end,t.clr))}),[o,c,t,l,d]}gDiag(e){const i=[];for(let t=0;t<e.length;t++){var h=e[t];let s=!1;for(let t=0;t<i.length;t++){var r=i[t];h.clr===r.clr&&(h.start.x===r.end.x&&h.start.y===r.end.y?(i[t]=new Line(r.start,h.end,r.clr),s=!0):h.end.x===r.start.x&&h.end.y===r.start.y&&(i[t]=new Line(h.start,r.end,r.clr),s=!0))}s||i.push(new Line(h.start,h.end,h.clr))}return i}qwe(...s){let e=0,i=0;for(let t=0;t<s.length;t++)e+=s[t].x,i+=s[t].y;const h=[],r=createVector(e/s.length,i/s.length);s.forEach(t=>{h.push(p5.Vector.lerp(t,r,this.lAmt))}),this.ps[this.cClr].push(h)}getState(t,s,e,i){return t%2*8+s%2*4+e%2*2+i%2*1}}class Seg{constructor(t,s,e){t.x=round(t.x,8),t.y=round(t.y,8),s.x=round(s.x,8),s.y=round(s.y,8),this.clr=e,t.y===s.y?(this.aType=aTypes.h,t.x<s.x?(this.start=t,this.end=s):(this.start=s,this.end=t)):t.x===s.x?(this.aType=aTypes.v,t.y<s.y?(this.start=t,this.end=s):(this.start=s,this.end=t)):(t.y<s.y?(this.start=t,this.end=s):(this.start=s,this.end=t),1===(e=round((this.end.y-this.start.y)/(this.end.x-this.start.x),8))?this.aType=aTypes.da:-1===e?this.aType=aTypes.db:(this.aType=aTypes.o,this.start=t,this.end=s))}}class Line{constructor(t,s,e){this.start=t,this.end=s,this.clr=e,this.isHorizontal=t.y===s.y,this.isVertical=t.x===s.x}show(t=!1,i,h){var s=p5.Vector.dist(this.start,this.end);const r=[];let n=[];if(t){var a=map(s,0,height,2,400);for(let e=0;e<a;e++){let t,s;var o=map(e,0,a-1,this.start.x,this.end.x),c=map(e,0,a-1,this.start.y,this.end.y);this.isHorizontal?(t=o,s=this.start.y+map(i(wobRes*t/width),-1,1,-hWob,hWob)):this.isVertical?(s=c,t=this.start.x+map(h(wobRes*s/width),-1,1,-vWob,vWob)):(t=o+map(h(wobRes*c/width),-1,1,-vWob,vWob),s=c+map(i(wobRes*o/width),-1,1,-hWob,hWob)),0<=t&&t<=width&&0<=s&&s<=height?n.push(createVector(t,s)):(1<n.length&&r.push([...n]),n=[])}1<n.length&&r.push(n)}else r.push([this.start,this.end]);return r}}class LevelCircle{constructor(t,s,e,i,h){this.x=t,this.y=s,this.radius=e,this.levels=i}}class LevelTriangle{constructor(t,s,e,i,h,r=0){this.points=[],this.levels=h;var n=createVector(t,s),a=(PI-i)/2,o=2*e/3,h=sqrt(pow(e/3,2)+pow(e/tan(a),2)),e=asin(e/3/h);const c=createVector(0,-o);c.rotate(r),this.points.push(p5.Vector.add(n,c)),c.rotate(PI-(i/2+(a-e))),c.setMag(h),this.points.push(p5.Vector.add(n,c)),c.rotate(PI-2*e),this.points.push(p5.Vector.add(n,c)),this.distanceToEdge=this.distanceToTriangle(t,s)}distanceToTriangle(s,e){let i;for(let t=0;t<this.points.length;t++){var h=this.points[t],r=this.points[(t+1)%this.points.length],h=abs((r.x-h.x)*(h.y-e)-(h.x-s)*(r.y-h.y))/sqrt(pow(r.x-h.x,2)+pow(r.y-h.y,2));i=i?min(h,i):h}return i}containsPoint(t,s){return pointInPolygon(createVector(t,s),[this.points[0],this.points[1],this.points[2]])}}class LevelSquare{constructor(t,s,e,i,h=0){this.points=[],this.levels=i;i=createVector(t,s);const r=createVector(-e/2,-e/2);r.rotate(h),this.points.push(p5.Vector.add(i,r)),r.rotate(PI/2),this.points.push(p5.Vector.add(i,r)),r.rotate(PI/2),this.points.push(p5.Vector.add(i,r)),r.rotate(PI/2),this.points.push(p5.Vector.add(i,r)),this.distanceToEdge=this.distanceToSquare(t,s)}distanceToSquare(s,e){let i;for(let t=0;t<this.points.length;t++){var h=this.points[t],r=this.points[(t+1)%this.points.length],h=abs((r.x-h.x)*(h.y-e)-(h.x-s)*(r.y-h.y))/sqrt(pow(r.x-h.x,2)+pow(r.y-h.y,2));i=i?min(h,i):h}return i}containsPoint(t,s){return pointInPolygon(createVector(t,s),[this.points[0],this.points[1],this.points[2],this.points[3]])}}function pointInPolygon(t,e){var{x:i,y:h}=t;let r=!1;var n=e.length;for(let t=0,s=n-1;t<n;s=t++){var a=e[t].x,o=e[t].y,c=e[s].x,l=e[s].y;h<o!=h<l&&i<(c-a)*(h-o)/(l-o)+a&&(r=!r)}return r}const aTypes={h:0,v:1,da:2,db:3,o:4};class ClrC{nms=["Micron Rose","Micron Red","Micron Orange","Micron Green","Micron Blue","Micron Purple","Micron Brown","Micron Light Cool Gray","Micron Cool Gray","Micron Black"];vals=["#df4a82","#f1230a","#f47d3d","#47a858","#0972c4","#842eae","#a14725","#cac8c9","#979699","#000"];constructor(){const t=[0,1,2,3,4,5,6];dptp(decPairs[15])<.15?this.clrs=[7,8,9]:(shuffleArray(t,!0),this.clrs=t.slice(0,rnd([3,5])))}rand(){return rnd(this.clrs)}new(t){if(this.clrs.length<=1)return t;let s=this.rand();for(;s===t;)s=this.rand();return s}}const easeFs={a:t=>t,b:t=>t<.5?2*t*t:1-pow(-2*t+2,2)/2,c:t=>t*t,d:t=>1-(1-t)*(1-t),e:t=>1-easeFs.f(1-t),f:t=>{var s=7.5625,e=2.75;return t<1/e?s*t*t:t<2/e?s*(t-=1.5/e)*t+.75:t<2.5/e?s*(t-=2.25/e)*t+.9375:s*(t-=2.625/e)*t+.984375},g:t=>t<.5?(1-easeFs.f(1-2*t))/2:(1+easeFs.f(2*t-1))/2,h:t=>t<=.5?2*t:2*(.5-(t-.5))};function rndGaussian(t,s=1){let e,i,h,r;if(ggPrev)e=gy2,ggPrev=!1;else{for(;i=rnd(2)-1,h=rnd(2)-1,r=i*i+h*h,1<=r;);r=Math.sqrt(-2*Math.log(r)/r),e=i*r,gy2=h*r,ggPrev=!0}return e*s+(t||0)}
In our daily practice we explore many different algorithms at a surface level. This piece started out as a simple implementation of the marching squares algorithm and quickly began to show its potential for emergence and exploration. In Reservation we run with this concept, exploring its possibilities but artificially capping it at 50 mints. This small set of outputs will be the face of the underlying algorithm, which holds infinite possibility. The art here is the algorithm and the outputs are a representation of a piece of ownership of that art. All colors used in Reservation are available in Sakura Pigma Micron 01 & 05 pens. If you don't have one of the recommended pens, experiment with other combinations and create something that is your own. Accent Lines should be plotted with a bold pen, at least 0.5mm on 9x12" paper. We recommend plotting on smooth bristol paper.
Take something as simple as concentric circles and modify, expand, and implode each point relative to the others and you will find yourself with something completely different. With Implosion we explore this concept and look to make a statement about what it means to plot a piece. As artists that almost always work with a plotter, it often feels like plotting adds another layer of complexity and depth to a piece. You work alongside the plotter to translate the piece from the screen to the physical world. As one of the first pieces on Plottables we want to convey that passion to you and let you experience it for yourselves. All Implosion pieces are represented on the screen as black & white images, but behind the scenes are split into layers so that you can recolor and plot your piece as many different ways as you want. Those layers are just the beginning though. Try pausing your print halfway through to change the pen size, color, or shape. Afterwards hang them as a matrix on your wall and make it an exploration of the elements of art across a complex pattern. If you’re not into exploration you can’t go wrong with a black Pigma Micron pen on smooth Bristol paper.
let nc=200,mag=.0125,st;const hp=[];for(let t=0;t<32;t++)hp.push(tokenData.hash.slice(2+2*t,4+2*t));const dp=hp.map(t=>parseInt(t,16));function setup(){noCanvas(),noLoop();var t=parseInt(tokenData.hash.slice(0,16),16);noiseSeed(t);t=1100;st=new St(850,t);var n=new I(nc,850,t),e="http://www.w3.org/2000/svg";let i=document.createElementNS(e,"svg");i.setAttribute("class","plot"),i.setAttribute("width","8.5in"),i.setAttribute("height","11in"),i.setAttribute("viewBox","0 0 850 "+t),i.setAttribute("style","background-color:white;");for(let s=0;s<n.paths.length;s++){let t=document.createElementNS(e,"g");t.setAttribute("id",`layer ${s}`);var r=n.paths[s];for(let h=0;h<r.length;h++){let s="",n=!1,i=!1;r[h][0]?(i=!0,s="M "+r[h][0][0]+" "+r[h][0][1]):n=!0;for(let t=1;t<r[h].length;t++)r[h][t]?n?(s+="M "+r[h][t][0]+" "+r[h][t][1],n=!1):s+=" L "+r[h][t][0]+" "+r[h][t][1]:n=!0,t===r[h].length-1&&r[h][t]&&i&&(s+=" L "+r[h][0][0]+" "+r[h][0][1]);if(s){const p=document.createElementNS(e,"path");p.setAttribute("style","fill:none;stroke-width:1;stroke:rgb(0%,0%,0%);"),p.setAttribute("d",s),t.appendChild(p)}}i.appendChild(t)}document.body.appendChild(i);let s=document.createElement("style");s.appendChild(document.createTextNode(".plot{width:100vw;height:100vh;}")),document.head.appendChild(s)}class I{constructor(s,t,n){this.w=t,this.h=n,this.paths=[];n=min(t,n);this.mm=n/10,this.mi=2*this.mm/s,this.ri=(n/2-this.mm)/s;let i=0,h=!0,e=0,r=0,p=0;for(let t=s;0<t;t--)st.nCon||st.numSkip?h?e===st.nCon?(h=!1,e=0,st.unc(),r++):(this.fc(t,i,p),e++):r===st.numSkip?(p++,h=!0,r=0,st.uns(),this.fc(t,i,p),e++):r++:(t<s&&t%20==0&&p++,this.fc(t,i,p)),i+=.01}fc(t,s,n){t=new FC(this.w/2,this.h/2,t*this.ri,this.mi*t,mag*t,s,t).display();this.paths[n]?this.paths[n].push(t):this.paths[n]=[t]}}class FC{constructor(t,s,n,i,h,e,r){this.x=t,this.y=s,this.rad=n,this.mg=i,this.nm=h,this.zOff=e,this.paths=[],this.dpth=r}display(){var s=map(R(),0,1,0,TWO_PI),n=TWO_PI/(4*this.dpth);let i=[];for(let t=0;t<=TWO_PI;t+=n){var h=map(cos(t+s),-1,1,-this.nm,this.nm)+st.nsx,e=map(sin(t+s),-1,1,-this.nm,this.nm)+st.nsy,r=map(st.snf(h,e,this.zOff),0,1,-this.mg/2,this.mg/2),h=st.lsnf(h,e,this.zOff+100)<.5?r:0,e=this.rad+h,r=e*cos(t+s)+this.x,h=e*sin(t+s)+this.y,e=st.rnf(r/st.nRes,h/st.nRes,this.zOff);st.nrvr&&e<.3?i.push(null):i.push([r,h])}return i}}class St{constructor(t,s){this.nsx=mag*nc,this.nsy=mag*nc,this.chcon=!1,this.chskp=!1,this.nCon,this.numSkip,this.nrvr=!1,this.nRes=100*min(t,s)/1080,this.snf,this.lsnf,this.rnf,this.csf,this.ssf,this.decide()}decide(){this.conVs=[];var s=floor(map(R(),0,1,3,5)),n=floor(map(R(),0,1,3,5));for(let t=1;t<n;t++)this.conVs.push(pow(s,t));this.skpVs=[];var i=floor(map(R(),0,1,3,5)),h=floor(map(R(),0,1,3,5));for(let t=1;t<h;t++)this.skpVs.push(pow(i,t));var t=dptp(dp[0]);t<.4&&(t<.12?(this.chcon=!0,this.chskp=!0):t<.21?this.chcon=!0:t<.3&&(this.chskp=!0),this.csf=rndAFH(cpfs,1),this.ssf=rndAFH(spfs,2),this.icas());var e=dptp(dp[3])<.1,t=dptp(dp[4])<.1;e&&(this.nsx=0),t&&(this.nsy=0),this.nrvr=dptp(dp[8])<.4,this.snf=rndAFH(nFuncs,5),this.lsnf=rndAFH(nFuncs,6);const r=createCopy(nFuncs);delete r.power,this.rnf=rndAFH(r,7)}icas(){this.chcon?this.nCon=this.csf.init(this):this.nCon=ncpf.init(this),this.chskp?this.numSkip=this.ssf.init(this):this.numSkip=nspf.init(this)}unc(){this.chcon&&(this.nCon=this.csf.update(this))}uns(){this.chskp&&(this.numSkip=this.ssf.update(this))}}function createCopy(s){const n={};return Object.keys(s).forEach(t=>{n[t]=s[t]}),n}const nFuncs={classic:(t,s,n)=>noise(t,s,n),octaves:(t,s,n)=>{return(noise(t,s,n)+.5*noise(2*t,2*s,2*n)+.25*noise(4*t,4*s,4*n))/1.75},power:(t,s,n)=>{n=noise(t,s,n)+.5*noise(2*t,2*s,2*n)+.25*noise(4*t,4*s,4*n);return map(Math.cbrt(n/1.75-.5),Math.cbrt(-.5),Math.cbrt(.5),0,1)},steps:(t,s,n)=>Math.round(30*noise(t,s,n))/30},ncpf={init:()=>floor(map(R(),0,1,10,30))},cpfs={increment:{init:()=>floor(map(R(),0,1,5,15)),update:t=>constrain(2*t.nCon,1,60)},decrement:{init:()=>floor(map(R(),0,1,40,60)),update:t=>constrain(floor(t.nCon/1.5),1,60)},alternate:{init:t=>{var s=t.conVs.shift();return t.conVs.push(s),s},update:t=>{var s=t.conVs.shift();return t.conVs.push(s),s}}},nspf={init:()=>floor(map(R(),0,1,3,6))},spfs={increment:{init:()=>floor(map(R(),0,1,1,6)),update:t=>constrain(2*t.numSkip,1,24)},decrement:{init:()=>floor(map(R(),0,1,24,12)),update:t=>constrain(floor(t.numSkip/1.25),1,24)},alternate:{init:t=>{var s=t.skpVs.shift();return t.skpVs.push(s),s},update:t=>{var s=t.skpVs.shift();return t.skpVs.push(s),s}}};function dptp(t){return map(t,0,255,0,1)}function rndAFH(t,s){var n=Object.keys(t);return t[n[(n.length-1e-9)*dptp(dp[s])<<0]]}S=Uint32Array.from([0,1,s=t=2,3].map(t=>parseInt(tokenData.hash.substr(8*t+2,8),16))),R=n=>(t=S[3],S[3]=S[2],S[2]=S[1],S[1]=s=S[0],t^=t<<11,S[0]^=t^t>>>8^s>>>19,S[0]/2**32);
Democracity is inspired by the diorama of the same name at the 1939 New York World's Fair which depicted a utopian city of the future. This piece satirizes the concept showing that the optimism of the 1930's did not account for the problems of the future brought about by climate change such as flooding. This piece is fully interactive with the best way to experience it being to explore and try to understand the stories that the different city layouts are trying to tell you. Note the cities are tileable meaning you can easily edit them together visually (Example: bit.ly/3yWCHvn). Controls: Click & drag to pan, Scroll wheel to zoom in and out, "c" - Change camera mode, "r" - Reset camera positioning, "p" - Toggle auto-pan, "z" - Zoomed out view, "t" - Toggle background transparency, 1-4 - Change detail level.
Democracity is inspired by the diorama of the same name at the 1939 New York World's Fair which depicted a utopian city of the future. This piece satirizes the concept showing that the optimism of the 1930's did not account for the problems of the future brought about by climate change such as flooding. This piece is fully interactive with the best way to experience it being to explore and try to understand the stories that the different city layouts are trying to tell you. Note the cities are tileable meaning you can easily edit them together visually (Example: bit.ly/3yWCHvn). Controls: Click & drag to pan, Scroll wheel to zoom in and out, "c" - Change camera mode, "r" - Reset camera positioning, "p" - Toggle auto-pan, "z" - Zoomed out view, "t" - Toggle background transparency, 1-4 - Change detail level. Dutch auction with a 2.50Ξ start price and decreasing in price every 5 minutes to a resting price of 0.20Ξ. Pricing Tiers: 2.50Ξ, 1.75Ξ, 1.00Ξ, 0.75Ξ , 0.50Ξ , 0.35Ξ , 0.25Ξ , 0.20Ξ.
Democracity is inspired by the diorama of the same name at the 1939 New York World's Fair which depicted a utopian city of the future. This piece satirizes the concept showing that the optimism of the 1930's did not account for the problems of the future brought about by climate change such as flooding. This piece is fully interactive with the best way to experience it being to explore and try to understand the stories that the different city layouts are trying to tell you. Note the cities are tileable meaning you can easily edit them together visually (Example: bit.ly/3yWCHvn). Controls: Click & drag to pan, Scroll wheel to zoom in and out, "c" - Change camera mode, "r" - Reset camera positioning, "p" - Toggle auto-pan, "z" - Zoomed out view, "t" - Toggle background transparency, 1-4 - Change detail level. Dutch auction with a 2.50Ξ start price and decreasing in price every 5 minutes to a resting price of 0.20Ξ. Pricing Tiers: 2.50Ξ, 1.75Ξ, 1.00Ξ, 0.75Ξ , 0.50Ξ , 0.35Ξ , 0.25Ξ , 0.20Ξ. DO NOT APPROVE GATV1 IF YOU DO NOT OWN GATV1.
const f=4095;const C=t=>.5*(1-Math.cos(t*Math.PI));let E;function r(t,e=0,i=0){if(null==E){E=new Array(1+f);for(let t=0;t<1+f;t++)E[t]=R()}t<0&&(t=-t),e<0&&(e=-e),i<0&&(i=-i);let s=Math.floor(t),h=Math.floor(e),o=Math.floor(i),n=t-s,a=e-h,r=i-o;var l,p;let c=0,d=.5;for(let t=0;t<4;t++){var u=s+(h<<4)+(o<<8),m=C(n),M=C(a),w=E[u&f];w+=m*(E[u+1&f]-w),l=E[u+16&f],w+=M*((l+=m*(E[u+16+1&f]-l))-w),u+=256,l=E[u&f],l+=m*(E[u+1&f]-l),p=E[u+16&f],l+=M*((p+=m*(E[u+16+1&f]-p))-l),w+=C(r)*(l-w),c+=w*d,d*=.5,s<<=1,n*=2,h<<=1,a*=2,o<<=1,r*=2,1<=n&&(s++,n--),1<=a&&(h++,a--),1<=r&&(o++,r--)}return c}const l=function(t,e,i,s,h){return(t-e)/(i-e)*(h-s)+s};function z(t,e){return e?Number(Math.round(t+"e"+e)+"e-"+e):Math.round(t)}const e=[];for(let t=0;t<32;t++)e.push(tokenData.hash.slice(2+2*t,4+2*t));const p=e.map(t=>parseInt(t,16));!function(t){const e=(()=>{const e=4294967296;let i,s;return{setSeed(t){s=i=(null==t?R()*e:t)>>>0},getSeed(){return i},rand(){return s=(1664525*s+1013904223)%e,s/e}}})();e.setSeed(t),E=new Array(1+f);for(let t=0;t<1+f;t++)E[t]=e.rand()}(parseInt(tokenData.hash.slice(2,10),16)),S=Uint32Array.from([0,1,s=t=2,3].map(t=>parseInt(tokenData.hash.substr(8*t+2,8),16))),R=e=>(t=S[3],S[3]=S[2],S[2]=S[1],S[1]=s=S[0],t^=t<<11,S[0]^=t^t>>>8^s>>>19,S[0]/2**32);const y=new THREE.Scene,n=120,k=n/240,b=n/40,W=n/n;let i=window.innerWidth/window.innerHeight,a=!0;const h=1.5*n;var o=Rt(p[1]);let c;c=o<.4?n/4:o<.8?n/8:n/16;let d=c;const u=new THREE.PerspectiveCamera(75,i,.1,7*n),m=new THREE.OrthographicCamera(-d*i,d*i,d,-d,1,3*n);let M=a?m:u;const w="mixed",g=Rt(p[13]),x=[.25,.5,1];let v=[.28,.56,.84,1];g<.6&&(x.push(0),v=[.25,.5,.75,.85,1]);o=[...x,w];function T(t){var e=Object.keys(t);return t[e[e.length*R()<<0]]}function H(t,e){var i=Object.keys(t);return t[i[(i.length-1e-9)*Rt(p[e])<<0]]}function I(t,e,i){var s=Rt(p[t]);for(let t=0;t<e.length;t++)if(s<=e[t])return i[t]}const P=H({BW:[1315860,15987699],REEF:[867683,1938037,2471875,15721901,14897443],BRICK:[5649953,13585211,15515822,10852495,13996659],DOLPHIN:[1126479,3560792,7192023,14213854,16711421],OAXACA:[14964526,1556155,3024938,16438096,7778369],WHO_ATE_THE_CRANS:[16752562,16506082,708095,6335386,10582712],MOSS_AGATE:[16120815,9612692,7637877,13037440,5258562],FIREWATER:[15770114,5775128,15828997,14245177,2108505],BRINKMAN:[15885963,2344921,4774308,15908647,7960952],TOMATO_TOMATO:[7829180,13486053,16776155,16772177,16738125],THE_PINK_ONE:[7816112,6440803,12988005,16364497,14039801],DROPDOWN:[15385653,3430805,14942310,249508,16469309]},0),D=I(10,v,o),B=new THREE.WebGLRenderer({powerPreference:"high-performance",antialias:!0,alpha:!0});let A=!1;const X=new THREE.Color(O());function L(t,e){return R()*(e-t)+t}B.setSize(window.innerWidth,window.innerHeight),B.shadowMap.enabled=!0,B.shadowMap.autoUpdate=!1,B.shadowMap.needsUpdate=!0,B.shadowMap.type=THREE.PCFSoftShadowMap,document.body.appendChild(B.domElement),function(t,i){const e=document.body.querySelectorAll(t);e.forEach(e=>{Object.keys(i).forEach(t=>{e.style[t]=i[t]})})}("canvas",{touchAction:"none",cursor:"pointer","-webkit-tap-highlight-color":"transparent"});const G=[];function O(t,e=D){return!t||R()<e?P[Math.floor(R()*P.length)]:t}class Z{constructor(t,e,i,s,h,o,n,a){this.x=t,this.z=e,this.width=i,this.depth=s,this.boxes=[],this.colorCohesion=D===w?x[Math.floor(R()*x.length)]:D,this.stepBackPercent=R(),this.repeatWidth=h,this.repeatDepth=o,this.numRepeatWidth=n,this.numRepeatDepth=a}display(){this.boxes=this.makeStructure(this.x,this.z,this.width,this.depth,0,null,0,this.repeatWidth,this.repeatDepth,this.numRepeatWidth,this.numRepeatDepth,!1)}makeStructure(h,o,n,a,r,l,p=0,c=[],d=[],u=[],m=[],t){var e=R();let{splitWidthChance:i,splitDepthChance:s,splitRepeatChance:M,splitWhere:w,createLevelChance:f,numRepetitionsX:C,numRepetitionsZ:E}=tt.attributes.buildingSplitChances(h,o,n,a,p);t&&(t=i,y=s,g=M,x={splitWidthChance:t+=(x=t/(t+y))*g,splitDepthChance:y+=(1-x)*g,splitRepeatChance:g=0},i=x.splitWidthChance,s=x.splitDepthChance,M=x.splitRepeatChance);var y=i+s,g=e<=i,x=e<=y&&e>i,y=e<=y+M&&y<e;let b=[];if(g&&n>k){e=this.makeStructure(h,o,n*w,a,r,l,p,c,d,u,m,!1),g=this.makeStructure(h+n*w,o,n*(1-w),a,r,l,p,c,d,u,m,!1);b=[...e,...g]}else if(x&&a>k){var v=this.makeStructure(h,o,n,a*w,r,l,p,c,d,u,m,!1),T=this.makeStructure(h,o+a*w,n,a*(1-w),r,l,p,c,d,u,m,!1);b=[...v,...T]}else if(y&&a>k&&n>k){var H,S=n/C,I=a/E,P=this.makeStructure(h,o,S,I,r,l,p,[...c,S],[...d,I],[...u,C],[...m,E],!0);for(let i=0;i<C;i++)for(let e=0;e<E;e++)for(let t=0;t<P.length;t++)0===i&&0===e||((H=P[t]).width>S&&0<i||H.depth>I&&0<e||(b.push({x:H.x+S*i,y:H.y,z:H.z+I*e,width:H.width,height:H.height,depth:H.depth,color:H.color}),H=new THREE.Color(H.color),G.push(H.r),G.push(H.g),G.push(H.b)));b=[...P,...b]}else{v=tt.attributes.buildingHeightGenerator(h,r,o,n,a,p),T=O(l,this.colorCohesion);let t=n,e=c.length-1;for(;z(t,10)===z(c[e],10);)t*=u[e],e--;let i=a;for(e=d.length-1;z(i,10)===z(d[e],10);)i*=m[e],e--;y={x:h+t/2,y:r+v/2,z:o+i/2,width:t,height:v,depth:i,color:T},l=new THREE.Color(T);G.push(l.r),G.push(l.g),G.push(l.b);let s=[];n>W&&a>W&&R()<=f?R()<this.stepBackPercent||tt.type===Q.MONOLITH&&p<5?(l=Math.min(n,a)/Math.floor(L(10,20)),s=this.makeStructure(h+l,o+l,n-2*l,a-2*l,v+r,T,p+1,c,d,u,m,!1),_(h,r,o,t,i,v,s)):s=this.makeStructure(h,o,n,a,v+r,T,p+1,c,d,u,m,!1):_(h,r,o,t,i,v,s),b=[y,...s]}return b}}function _(t,e,i,s,h,o,n){var a=L(.02,.06);et.weather.snow&&e+o>et.weather.flood.waterDepth&&e+o+a>et.weather.flood.waterDepth+et.weather.flood.snowHeight&&R()<.7&&(n.push({x:t+s/2,y:e+o+a/2,z:i+h/2,width:s,height:a,depth:h,color:15592941}),h=new THREE.Color(15592941),G.push(h.r),G.push(h.g),G.push(h.b))}class Y{constructor(t,e,i,s){this.x=t,this.z=e,this.width=i,this.depth=s,this.boxes=[]}display(){this.splitBlock(this.x,this.z,this.width,this.depth)}splitBlock(t,e,i,s,h=0){var o=R(),{splitWidthChance:n,splitDepthChance:a,splitRepeatChance:r,splitWhere:l,numRepetitionsX:p,numRepetitionsZ:c}=tt.attributes.blockSplitChances(t,e,i,s,h),d=n+a,a=o<=d&&n<o,d=o<=d+r&&d<o;if(o<=n&&i>k)this.splitBlock(t,e,i*l,s,h+1),this.splitBlock(t+i*l,e,i*(1-l),s,h+1);else if(a&&s>k)this.splitBlock(t,e,i,s*l,h+1),this.splitBlock(t,e+s*l,i,s*(1-l),h+1);else if(d&&s>k&&i>k){var u=i/p,m=s/c;const f=new Z(t,e,u,m,[u],[m],[p],[c]);f.display();var M,w=f.boxes;const C=[];for(let i=0;i<p;i++)for(let e=0;e<c;e++)for(let t=0;t<w.length;t++)0===i&&0===e||((M=w[t]).width>u&&0<i||M.depth>m&&0<e||(C.push({x:M.x+u*i,y:M.y,z:M.z+m*e,width:M.width,height:M.height,depth:M.depth,color:M.color}),M=new THREE.Color(M.color),G.push(M.r),G.push(M.g),G.push(M.b)));this.boxes=[...this.boxes,...w,...C]}else{const E=new Z(t,e,i,s);E.display(),this.boxes=[...this.boxes,...E.boxes]}}}class F{constructor(t,e,i,s,h){this.x=t,this.z=e,this.width=i,this.depth=s,this.color=h,this.types={SQUARE:"square",PYRAMID:"pyramid",STAGE:"stage"},this.type=H(this.types,12)}display(){if(this.type===this.types.SQUARE){var t=new THREE.BoxBufferGeometry(this.width,1e3,this.depth),e=new THREE.MeshStandardMaterial({color:this.color});const h=new THREE.Mesh(t,e);h.receiveShadow=!0,h.position.x=this.x+this.width/2,h.position.z=this.z+this.depth/2,h.position.y=-500,y.add(h)}else if(this.type===this.types.PYRAMID){var i=new THREE.ConeGeometry(this.width*Math.sin(Math.PI/4),50,4),s=new THREE.MeshStandardMaterial({color:this.color});const o=new THREE.Mesh(i,s);o.receiveShadow=!0,o.rotation.x=Math.PI,o.rotation.y=Math.PI/4,o.position.x=this.x+this.width/2,o.position.y=-25,o.position.z=this.z+this.depth/2,y.add(o)}else if(this.type===this.types.STAGE){i=this.width*Math.sin(Math.PI/4),s=new THREE.CylinderGeometry(i,.15*i,50,4),i=new THREE.MeshStandardMaterial({color:this.color});const n=new THREE.Mesh(s,i);n.receiveShadow=!0,n.rotation.y=Math.PI/4,n.position.x=this.x+this.width/2,n.position.y=-25,n.position.z=this.z+this.depth/2,y.add(n)}}}class N{constructor(t,e,i,s){this.x=t,this.z=e,this.width=i,this.depth=s,this.boxes=[],this.baseColor=O()}display(){this.subdivideStreets(this.x,this.z,this.width,this.depth);const t=new F(this.x,this.z,this.width,this.depth,this.baseColor);t.display()}subdivideStreets(t,e,i,s,h=0){var o=R(),n=tt.attributes.streetSizeGenerator(h),{splitWidthChance:a,splitDepthChance:r,splitRepeatChance:l,splitChoices:p,numRepetitionsX:c,numRepetitionsZ:d}=tt.attributes.streetGenerationChances(t,e,i,s,h,n),u=a+r,r=o<=a,a=o<=u&&a<o,o=o<=u+l&&u<o,p=p[Math.floor(R()*p.length)];if(r&&i>b){if(0===h&&2<=n){const C=new j(t+i*p,e+s/2,n,s);this.boxes=C.display()}this.subdivideStreets(t,e,i*p-n/2,s,h+1),this.subdivideStreets(t+i*p+n/2,e,i*(1-p)-n/2,s,h+1)}else if(a&&s>b){if(0===h&&2<=n){const E=new j(t+i/2,e+s*p,i,n);this.boxes=E.display()}this.subdivideStreets(t,e,i,s*p-n/2,h+1),this.subdivideStreets(t,e+s*p+n/2,i,s*(1-p)-n/2,h+1)}else if(o&&s>b&&i>b){var m=(i-n*(c-1))/c,M=(s-n*(d-1))/d;const y=new Y(t,e,m,M);y.display();var w,f=y.boxes;const g=[];for(let i=0;i<c;i++)for(let e=0;e<d;e++)for(let t=0;t<f.length;t++)0===i&&0===e||(w=f[t],g.push({x:w.x+(m+n)*i,y:w.y,z:w.z+(M+n)*e,width:w.width,height:w.height,depth:w.depth,color:w.color}),w=new THREE.Color(w.color),G.push(w.r),G.push(w.g),G.push(w.b));this.boxes=[...this.boxes,...f,...g]}else{const x=new Y(t,e,i,s);x.display(),this.boxes=[...this.boxes,...x.boxes]}}}class j{constructor(t,e,i,s){this.x=t,this.z=e,this.color=O(),this.direction=s<i?1:0,this.streetSize=Math.min(.75*Math.min(i,s),4),this.width=this.direction?i:this.streetSize,this.depth=this.direction?this.streetSize:s}display(){if(.5<Rt(p[15]))return[];var t=new THREE.BoxBufferGeometry(this.width,.5,this.depth),e=new THREE.MeshStandardMaterial({color:O(this.color)});const i=new THREE.Mesh(t,e),s=[];_(this.x-this.width/2,1.25,this.z-this.depth/2,this.width,this.depth,.25,s),i.receiveShadow=!0,i.castShadow=!0,i.position.x=this.x,i.position.y=1.25,i.position.z=this.z,y.add(i);var h=Math.max(this.width,this.depth)/12;let o=h;for(;o<=11*h;){var n={x:this.x+(this.direction?o-this.width/2:0),y:.5,z:this.z+(this.direction?0:o-this.depth/2),width:1,height:1,depth:1,color:O(this.color)};s.push(n);n=new THREE.Color(n.color);G.push(n.r),G.push(n.g),G.push(n.b),o+=h}return s}}class U{constructor(t,e,i,s,h,o){this.rainCells=h,this.x=t,this.y=e,this.z=i,this.rainDensity=o,this.rainGeo=new THREE.BufferGeometry,this.particles=[],this.scale=s,this.orthoRainSize=2,this.perspectiveRainSize=.2,this.snowTimeToRepeat=5,this.rainTimeToRepeat=1,this.timeToRepeat=et.weather.snow?this.snowTimeToRepeat:this.rainTimeToRepeat;s=Rt(p[14]);const n=new THREE.Color(et.weather.snow?15592941:s<.1?O():11591423);.1<=s&&n.lerp(new THREE.Color(et.sun.skyColor),.25),this.rainMaterial=new THREE.PointsMaterial({color:n,size:a?this.orthoRainSize:this.perspectiveRainSize,transparent:!0,opacity:et.weather.snow?.8:.4}),this.addParticles(),this.updateGeometry(),this.rain=new THREE.Points(this.rainGeo,this.rainMaterial),y.add(this.rain)}updateSize(){this.rainMaterial.size=a?this.orthoRainSize:this.perspectiveRainSize,this.rainMaterial.needsUpdate=!0}addParticles(){for(let t=0;t<Object.keys(this.rainCells).length*this.rainDensity;t++){var e=T(this.rainCells)["position"],i=e[1]*this.scale+this.y-this.scale/2,s=new THREE.Vector3(e[0]*this.scale+th
{"type":"threejs","aspectRatio":"3/4","instructions":"Click & drag to pan|Scroll wheel to zoom in and out|\"c\" - Change camera mode|\"r\" - Reset camera positioning|\"p\" - Toggle auto-pan|\"z\" - Zoomed out view|\"t\" - Toggle background transparency|1-4 - Change detail level.","interactive":"true"}
es:[.25,.5,.75],numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/(k+o),6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/(k+o),6))),1)}},tall:(t,e,i,s,h,o)=>{var n=1-Math.pow(h/8,2),h=.95*n/(i+s);return{splitWidthChance:h*i,splitDepthChance:h*s,splitRepeatChance:.05*n,splitChoices:[.25,.5,.75],numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/(k+o),6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/(k+o),6))),1)}},chaos:(t,e,i,s,h,o)=>({splitWidthChance:.49,splitDepthChance:.49,splitRepeatChance:0,splitChoices:[.1,.2,.3,.4,.5,.6,.7,.8,.9],numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/(k+o),6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/(k+o),6))),1)}),peteRepeat:(t,e,i,s,h,o)=>({splitWidthChance:.3,splitDepthChance:.3,splitRepeatChance:.3,splitChoices:[.25,.5,.75],numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/(k+o),6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/(k+o),6))),1)})},blockSplitChances:{traditional:(t,e,i,s,h)=>({splitWidthChance:.33,splitDepthChance:.33,splitRepeatChance:.1,splitWhere:L(.2,.8),numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/k,6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/k,6))),1)}),agridustrial:(t,e,i,s,h)=>({splitWidthChance:.2,splitDepthChance:.2,splitRepeatChance:.6,splitWhere:L(.2,.8),numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/k,6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/k,6))),1)}),monolith:(t,e,i,s,h)=>({splitWidthChance:0,splitDepthChance:0,splitRepeatChance:0,splitWhere:0,numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/k,6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/k,6))),1)}),biggerInCenter:(t,e,i,s,h)=>{t=J(t,e,i,s),e=Math.min(l(t,0,n/3,0,1),1),t=(5<h?.85*e:+e)/(i+s);return{splitWidthChance:t*i,splitDepthChance:t*s,splitRepeatChance:5<h?.05*e:0,splitWhere:L(.2,.8),numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/k,6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/k,6))),1)}},smallerInCenter:(t,e,i,s,h)=>{t=J(t,e,i,s,!1),e=Math.min(Math.max(l(t,0,n/2,2,0),0),1),t=(5<h?.95*e:+e)/(i+s);return{splitWidthChance:t*i,splitDepthChance:t*s,splitRepeatChance:5<h?.05*e:0,splitWhere:L(.2,.8),numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/k,6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/k,6))),1)}},short:(t,e,i,s,h)=>({splitWidthChance:.33,splitDepthChance:.33,splitRepeatChance:.1,splitWhere:L(.2,.8),numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/k,6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/k,6))),1)}),tall:(t,e,i,s,h)=>({splitWidthChance:.33,splitDepthChance:.33,splitRepeatChance:.1,splitWhere:L(.2,.8),numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/k,6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/k,6))),1)}),chaos:(t,e,i,s,h)=>{h=3<h?.85:1;return{splitWidthChance:h/2,splitDepthChance:h/2,splitRepeatChance:0,splitWhere:L(.1,.9),numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/k,6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/k,6))),1)}},peteRepeat:(t,e,i,s,h)=>({splitWidthChance:.3,splitDepthChance:.3,splitRepeatChance:.3,splitWhere:L(.2,.8),numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/k,6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/k,6))),1)})},buildingSplitChances:{traditional:(t,e,i,s,h)=>({splitWidthChance:.33,splitDepthChance:.33,splitRepeatChance:.1,splitWhere:L(.2,.8),createLevelChance:1,numRepetitionsX:Math.floor(L(1,Math.min(i/k,6)))||1,numRepetitionsZ:Math.floor(L(1,Math.min(s/k,6)))||1}),agridustrial:(t,e,i,s,h)=>({splitWidthChance:.8,splitDepthChance:.05,splitRepeatChance:.1,splitWhere:.2,createLevelChance:1,numRepetitionsX:Math.floor(L(1,Math.min(i/k,6)))||1,numRepetitionsZ:Math.floor(L(1,Math.min(s/k,6)))||1}),monolith:(t,e,i,s,h)=>({splitWidthChance:0===h?0:.2,splitDepthChance:0===h?0:.2,splitRepeatChance:0===h?0:.05,splitWhere:L(.4,.6),createLevelChance:1,numRepetitionsX:Math.floor(L(1,Math.min(i/k,6)))||1,numRepetitionsZ:Math.floor(L(1,Math.min(s/k,6)))||1}),biggerInCenter:(t,e,i,s,h)=>{e=J(t,e,i,s,!1);return{splitWidthChance:.33,splitDepthChance:.33,splitRepeatChance:.05,splitWhere:L(.2,.8),createLevelChance:l(e,0,n/2,1.2,0),numRepetitionsX:Math.floor(L(1,Math.min(i/k,6)))||1,numRepetitionsZ:Math.floor(L(1,Math.min(s/k,6)))||1}},smallerInCenter:(t,e,i,s,h)=>{e=J(t,e,i,s,!1);return{splitWidthChance:.33,splitDepthChance:.33,splitRepeatChance:.05,splitWhere:L(.2,.8),createLevelChance:l(e,0,n/3,0,1.2),numRepetitionsX:Math.floor(L(1,Math.min(i/k,6)))||1,numRepetitionsZ:Math.floor(L(1,Math.min(s/k,6)))||1}},short:(t,e,i,s,h)=>({splitWidthChance:.33,splitDepthChance:.33,splitRepeatChance:.1,splitWhere:L(.2,.8),createLevelChance:1,numRepetitionsX:Math.floor(L(1,Math.min(i/k,6)))||1,numRepetitionsZ:Math.floor(L(1,Math.min(s/k,6)))||1}),tall:(t,e,i,s,h)=>({splitWidthChance:.33,splitDepthChance:.33,splitRepeatChance:.1,splitWhere:L(.2,.8),createLevelChance:1,numRepetitionsX:Math.floor(L(1,Math.min(i/k,6)))||1,numRepetitionsZ:Math.floor(L(1,Math.min(s/k,6)))||1}),chaos:(t,e,i,s,h)=>({splitWidthChance:.4,splitDepthChance:.4,splitRepeatChance:0,splitWhere:L(.2,.8),createLevelChance:1,numRepetitionsX:Math.floor(L(1,Math.min(i/k,6)))||1,numRepetitionsZ:Math.floor(L(1,Math.min(s/k,6)))||1}),peteRepeat:(t,e,i,s,h)=>({splitWidthChance:.3,splitDepthChance:.3,splitRepeatChance:.3,splitWhere:L(.2,.8),createLevelChance:1,numRepetitionsX:Math.floor(L(1,Math.min(i/k,6)))||1,numRepetitionsZ:Math.floor(L(1,Math.min(s/k,6)))||1})},buildingHeightGenerator:{traditional:(t,e,i,s,h,o)=>L(.2,1)*Math.min(Math.min(s,h),n/40)*2,agridustrial:(t,e,i,s,h,o)=>L(.2,1)*Math.min(Math.min(s,h),n/40)*2,monolith:(t,e,i,s,h,o)=>L(.2,1)*Math.min(Math.min(s,h),n/40)*2,biggerInCenter:(t,e,i,s,h,o)=>{i=J(t,i,s,h,!1);return l(i,0,Math.sqrt(n*n+n*n),3,0)*Math.min(Math.min(s,h),n/40)},smallerInCenter:(t,e,i,s,h,o)=>{i=J(t,i,s,h,!1);return l(i,0,Math.sqrt(n*n+n*n),.5,3)*Math.min(Math.min(s,h),n/40)},short:(t,e,i,s,h,o)=>L(.2,1)*Math.min(Math.min(s,h),n/40)*1,tall:(t,e,i,s,h,o)=>L(.2,1)*Math.min(Math.min(s,h),n/40)*3.2,chaos:(t,e,i,s,h,o)=>L(L(.1,.3),L(1,1.4))*Math.min(Math.min(s,h),n/40)*L(1.5,3),peteRepeat:(t,e,i,s,h,o)=>L(.2,1)*Math.min(Math.min(s,h),n/40)*2}},this.attributes=this.initBiome()}initBiome(){const e={};var i=Object.keys(this.biomes);for(let t=0;t<i.length;t++){var s=i[t];e[s]=this.biomes[s][this.type]}return e}decideType(){this.type=I(11,this.typePercentages,Object.values(Q))}},et=new class{constructor(t,e,i,s){this.x=t-i/2,this.z=e-s/2,this.width=i,this.depth=s,this.weather,this.sun,this.create()}display(){this.sun=new q,this.weather=new V(this.x,60,this.z,this.width,this.depth),this.weather.decideWeather(),this.weather.initWeather(),this.weather.display();const t=new N(this.x,this.z,this.width,this.depth);t.display();var e=t.boxes;const i=new THREE.BufferGeometry,s=[],h=[],o=[];for(let t=0;t<5;++t){s.push(...this.geometries_[t].attributes.position.array);var n=s.length/3;h.push(...this.geometries_[t].attributes.normal.array);const u=[...this.geometries_[t].index.array];for(let t=0;t<u.length;++t)u[t]+=n-4;o.push(...u)}const a=new THREE.MeshPhongMaterial;i.setAttribute("instanceColor",new THREE.InstancedBufferAttribute(new Float32Array(G),3)),i.setAttribute("position",new THREE.Float32BufferAttribute(s,3)),i.setAttribute("normal",new THREE.Float32BufferAttribute(h,3)),i.setIndex(new THREE.BufferAttribute(new Uint32Array(o),1));const r=["attribute vec3 instanceColor;","varying vec3 vInstanceColor;","#include <common>"].join("\n"),l=["#include <begin_vertex>","\tvInstanceColor = instanceColor;"].join("\n"),p=["varying vec3 vInstanceColor;","#include <common>"].join("\n"),c=["vec4 diffuseColor = vec4( diffuse * vInstanceColor, opacity );"].join("\n");a.onBeforeCompile=function(t){t.vertexShader=t.vertexShader.replace("#include <common>",r).replace("#include <begin_vertex>",l),t.fragmentShader=t.fragmentShader.replace("#include <common>",p).replace("vec4 diffuseColor = vec4( diffuse, opacity );",c)};const d=new THREE.InstancedMesh(i,a,e.length);for(let t=0;t<e.length;t++){const m=new THREE.Matrix4,M=new THREE.Vector3;M.x=e[t].x,M.y=e[t].y,M.z=e[t].z;const w=new THREE.Vector3;w.x=e[t].width,w.y=e[t].height,w.z=e[t].depth,m.compose(M,new THREE.Quaternion,w),d.setMatrixAt(t,m)}y.add(d),d.receiveShadow=!0,d.castShadow=!0}step(t){this.weather.step(t)}create(){const t=new THREE.PlaneBufferGeometry(1,1);t.rotateY(Math.PI/2),t.translate(.5,0,0);const e=new THREE.PlaneBufferGeometry(1,1);e.rotateY(-Math.PI/2),e.translate(-.5,0,0);const i=new THREE.PlaneBufferGeometry(1,1);i.rotateX(-Math.PI/2),i.translate(0,.5,0);const s=new THREE.PlaneBufferGeometry(1,1);s.translate(0,0,.5);const h=new THREE.PlaneBufferGeometry(1,1);h.rotateY(Math.PI),h.translate(0,0,-.5),this.geometries_=[t,e,i,s,h]}}(0,0,n,n);et.display();const it=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];c===n/4&&it.shift();const st=it[Math.floor(l(Rt(p[8]),0,1,0,it.length-1e-9))];let ht=st;o=[Math.PI/4,Math.PI/8,Math.PI/16,Math.PI/64,-Math.PI/4,-Math.PI/8,-Math.PI/16,-Math.PI/64];const ot=o[Math.floor(l(Rt(p[11]),0,1,0,o.length-1e-9))]+$;let nt=ot;function at(t){t=d+t/10;t<0||t>1.5*n||(d=t,wt(),rt())}function rt(){et.weather.fog&&(y.fog.density=a?.005:l(Math.pow(d,1/3),0,Math.pow(1.5*n,1/3),.025,.006))}window.addEventListener("resize",function(){i=window.innerWidth/window.innerHeight,u.aspect=i,m.aspect=i,wt(),u.updateProjectionMatrix(),m.updateProjectionMatrix(),B.setSize(window.innerWidth,window.innerHeight)},!1),window.addEventListener("wheel",t=>{at(t.deltaY)});let lt=0,pt=0,ct=!1,dt=!0;const ut=[];let mt;function Mt(e){return t=>{e&&(t.pointerId=e),function(e){for(let t=0;t<ut.length;t++)if(ut[t].pointerId==e.pointerId){ut.splice(t,1);break}}(t),ut.length<2&&(mt=-1),ct&&(lt=0,pt=0,ct=!1)}}function wt(){m.left=-d*i,m.right=d*i,m.top=d,m.bottom=-d,m.updateProjectionMatrix()}window.addEventListener("pointerdown",t=>{t.button||(ut.push(t),lt=t.offsetX,pt=t.offsetY,ct=!0)}),window.addEventListener("pointermove",e=>{if(ct){for(let t=0;t<ut.length;t++)if(e.pointerId==ut[t].pointerId){ut[t]=e;break}var t;2===ut.length?(t=Math.abs(ut[0].clientX-ut[1].clientX),0<mt&&at(mt-t),mt=t):1===ut.length&&((t=ht-(pt-e.offsetY)/300)<Math.PI/2&&t>-Math.PI/2&&(ht=t),nt-=(lt-e.offsetX)/300,lt=e.offsetX,pt=e.offsetY)}}),window.addEventListener("pointerup",Mt()),window.addEventListener("pointercancel",Mt()),window.addEventListener("pointerout",Mt()),window.addEventListener("pointerleave",Mt()),window.addEventListener("contextmenu",Mt(1)),window.addEventListener("keydown",function(t){switch(t.key){case"p":dt=!dt;break;case"r":d=c,wt(),nt=ot,ht=st,rt();break;case"c":M=a?u:m,a=!a,y.camera=M,et.weather.display(),et.weather.rain?.updateSize(),rt();break;case"z":ht=Math.PI/4,nt=Math.PI/4+$,d=a?+n:1.4*n,rt(),wt();break;case"t":A?B.setClearColor(X,1):B.setClearColor(0,0),A=!A;break;case"1":B.setPixelRatio(.25);break;case"2":B.setPixelRatio(.75);break;case"3":B.setPixelRatio(.9);break;case"4":B.setPixelRatio(1)}});let ft=new THREE.Clock;function Rt(t){return l(t,0,255,0,1)}requestAnimationFrame(function t(){var e=ft.getDelta(),i=a?h:d;dt&&(nt+=e*(2*Math.PI/240)),et.step(e),M.position.x=Math.cos(nt)*Math.cos(ht)*i,M.position.y=Math.sin(ht)*i,M.position.z=Math.sin(nt)
is.x+R()*this.scale/2,i-l(Math.pow(R(),2),0,1,0,i),e[2]*this.scale+this.z+R()*this.scale/2),h=i-s.y,e=2*i/Math.pow(this.timeToRepeat,2);this.particles.push({initY:i,position:s,particalAcceleration:e,timeElapsed:Math.sqrt(2*h/e),visible:s.y>et.weather.flood.waterDepth})}}updateGeometry(){const t=[];for(var e of this.particles)e.visible&&t.push(e.position.x,e.position.y,e.position.z);this.rainGeo.setAttribute("position",new THREE.Float32BufferAttribute(t,3)),this.rainGeo.attributes.position.needsUpdate=!0}updateParticles(t){for(var e of this.particles){var i=Math.sqrt(2*e.initY/e.particalAcceleration);e.timeElapsed+=t;var s=.5*e.particalAcceleration*Math.pow(e.timeElapsed,2);e.timeElapsed>=i?(i=(e.timeElapsed-i)%i,e.position.y=e.initY-.5*e.particalAcceleration*Math.pow(i,2),e.timeElapsed=i,e.visible=e.position.y>et.weather.flood.waterDepth):(e.position.y=e.initY-s,e.visible=e.position.y>et.weather.flood.waterDepth)}}step(t){this.updateParticles(t),this.updateGeometry()}}class q{constructor(){this.sunX,this.sunY;var t=Rt(p[2]);t<.4?(this.sunX=+n/24,this.sunY=23*n/24,this.directionalColor=16250578,this.groundColor=16757627,this.skyColor=11519487):t<.6?(this.sunX=n,this.sunY=n/2,this.directionalColor=16700785,this.groundColor=12004412,this.skyColor=16700785):t<.8?(this.sunX=-n,this.sunY=n/2,this.directionalColor=16761159,this.skyColor=12730432,this.groundColor=7479690,this.skyColor=13916024,this.groundColor=9455270,$=Math.PI):t<.9?(this.sunX=0,this.sunY=n,this.directionalColor=16777215,this.groundColor=16777215,this.skyColor=16777215):(this.sunX=+n/24,this.sunY=23*n/24,this.directionalColor=11250572,this.skyColor=5532607,this.groundColor=3495352),X.lerp(new THREE.Color(this.skyColor),.5),X.lerp(new THREE.Color(0),.2),B.setClearColor(X);const e=new THREE.DirectionalLight(this.directionalColor,.7);t=new THREE.HemisphereLight(this.skyColor,this.groundColor,.65);e.castShadow=!0,e.target.updateMatrixWorld(),e.shadow.camera.near=.1,e.shadow.camera.far=2*n,e.shadow.camera.left=-n,e.shadow.camera.right=n,e.shadow.camera.top=n,e.shadow.camera.bottom=-n,e.shadow.mapSize.width=4096,e.shadow.mapSize.height=4096,e.position.x=this.sunX,e.position.y=this.sunY,y.add(t),y.add(e)}}class V{constructor(t,e,i,s,h,o=150){this.x=t,this.y=e,this.z=i,this.position=[t,e,i],this.width=s,this.depth=h,this.resolution=o,this.cells={},this.rainCells={},this.cloudLayers=0,this.rain,this.padding=.1,this.blockSize=(this.width-this.padding)/this.resolution,this.lowBound,this.highBound,this.shouldRain=!1,this.snow=!1,this.rainDensity=0,this.flood,this.cloudUuid,this.fog,this.flash=new THREE.PointLight(404873,0,n,2),this.create()}decideWeather(){var t=g;t<.4?(this.lowBound=0,this.highBound=0):t<.6?(this.lowBound=.32,this.highBound=.34,this.cloudLayers=Math.floor(L(1,3)),t<.45&&(this.shouldRain=!0)):t<.8?(this.lowBound=.4,this.highBound=.5,this.cloudLayers=Math.floor(L(2,5)),t<.7&&(this.shouldRain=!0)):(this.lowBound=.4,this.highBound=.6,this.cloudLayers=Math.floor(L(3,6)),t<.95&&(this.shouldRain=!0,.9<t&&(this.lightning=!0))),this.shouldRain&&(this.rainDensity=(e=[.04,.07,.11])[Math.floor(e.length*R())]),Rt(p[4])<.1&&(this.snow=!0,this.lightning=!1),this.lightning&&y.add(this.flash),this.flood=new K(0,0,n-.05,n-.05,this.snow),Rt(p[5])<.125&&(this.fog=!0,y.fog=new THREE.FogExp2(X,.005));var e=Rt(p[16]);this.cloudFallOff=e<.3?(t,e,i)=>{e=e<this.resolution/2?e:this.resolution-e,i=i<this.resolution/2?i:this.resolution-i,i=Math.min(l(Math.pow(Math.min(e,i),1/3),0,Math.pow(this.resolution/16,1/3),0,1),1);return Math.min(l(t,this.resolution/3,this.resolution/2,1,.6),1)*i}:e<.6?t=>t<this.resolution/3?Math.min(Math.max(l(t,this.resolution/8,this.resolution/3,0,1),0),1):Math.min(Math.max(l(t,this.resolution/3,this.resolution/2,1,0),0),1):e<.8?(t,e,i)=>{if(t<this.resolution/3)return Math.min(Math.max(l(t,this.resolution/8,this.resolution/3,0,1),0),1);e=e<this.resolution/2?e:this.resolution-e,i=i<this.resolution/2?i:this.resolution-i;return Math.min(l(Math.pow(Math.min(e,i),1/3),0,Math.pow(this.resolution/4,1/3),0,1),1)}:(t,e,i)=>{e=e<this.resolution/2?e:this.resolution-e,i=i<this.resolution/2?i:this.resolution-i;return Math.min(l(Math.pow(Math.min(e,i),1/3),0,Math.pow(this.resolution/4,1/3),0,1),1)}}initWeather(){let o=0;for(let h=0;h<this.resolution;h++){let s=0;for(let i=0;i<this.cloudLayers;i++){let e=0;for(let t=0;t<this.resolution;t++){var n=Math.PI/2/(this.cloudLayers-1||1)*i,a=l(Math.cos(n),0,1,this.lowBound,this.highBound),n=Math.sqrt(Math.pow(h-this.resolution/2,2)+Math.pow(t-this.resolution/2,2)),n=this.cloudFallOff(n,h,t);(16*r(o,s,e)+8*r(2*o,2*s,2*e)+4*r(4*o,4*s,4*e)+2*r(8*o,8*s,8*e)+r(16*o,16*s,16*e))/30<a*n&&(this.cells[this.key(h,i,t)]={position:[h,i,t],facesHidden:[!1,!1,!1,!1,!1,!1]}),e+=.05}s+=.05}o+=.05}this.prunedVoxels=this.pruneHiddenVoxels_(this.cells)}display(){const t=y.getObjectByProperty("uuid",this.cloudUuid);t&&t.geometry&&t.material&&(t.geometry.dispose(),t.material.dispose(),y.remove(t)),this.makeRain(),this.makeClouds()}makeClouds(){const h=this.buildMeshDataFromVoxels(this.prunedVoxels);[THREE.FrontSide].forEach(t=>{const e=new THREE.MeshPhongMaterial({opacity:a?.4:.5,transparent:!0,color:"#ffffff",side:t});e.depthWrite=!1;const i=new THREE.BufferGeometry,s=new THREE.Mesh(i,e);this.cloudUuid=s.uuid,i.setAttribute("position",new THREE.Float32BufferAttribute(h.positions,3)),i.setAttribute("normal",new THREE.Float32BufferAttribute(h.normals,3)),i.setIndex(new THREE.BufferAttribute(h.indices,1)),i.attributes.position.needsUpdate=!0,i.attributes.normal.needsUpdate=!0,s.receiveShadow=!0,s.castShadow=!0,y.add(s)})}makeRain(){0<Object.keys(this.rainCells).length&&this.shouldRain&&!this.rain&&(this.rain=new U(this.x,this.y,this.z,this.blockSize,this.rainCells,this.rainDensity))}step(t){this.rain&&(this.rain.step(t),.99<R()||100<this.flash.power?(this.flash.power<100&&(t=T(this.rainCells)["position"],this.flash.position.set(t[0]*this.blockSize-this.width/2,this.y+t[1]*this.blockSize,t[2]*this.blockSize-this.depth/2)),this.flash.power=50+500*R()):this.flash.power=0)}key(t,e,i){return t+"."+e+"."+i}pruneHiddenVoxels_(i){const t={};for(var s in i){const n=i[s];var h=[this.key(n.position[0]+1,n.position[1],n.position[2]),this.key(n.position[0]-1,n.position[1],n.position[2]),this.key(n.position[0],n.position[1]+1,n.position[2]),this.key(n.position[0],n.position[1]-1,n.position[2]),this.key(n.position[0],n.position[1],n.position[2]+1),this.key(n.position[0],n.position[1],n.position[2]-1)];let e=!1;for(let t=0;t<6;++t){var o=h[t]in i;(n.facesHidden[t]=o)||(e=!0,3==t&&(this.rainCells[s]=n))}e&&(t[s]=n)}return t}buildMeshDataFromVoxels(t){const e={positions:[],normals:[],indices:[]};for(var i in t){var s=t[i];for(let t=0;t<6;++t)if(!s.facesHidden[t]){var h=e.positions.length/3;const r=[...this.geometries_[t].attributes.position.array];for(let e=0;e<3;++e)for(let t=0;t<4;++t)r[3*t+e]+=s.position[e]*this.blockSize+this.position[e]+this.blockSize/2+this.padding/2;e.positions.push(...r),e.normals.push(...this.geometries_[t].attributes.normal.array);const l=[...this.geometries_[t].index.array];for(let t=0;t<l.length;++t)l[t]+=h;e.indices.push(...l)}}const o=new Float32Array(4*e.positions.length),n=new Float32Array(4*e.normals.length),a=new Uint32Array(4*e.indices.length);return o.set(e.positions,0),n.set(e.normals,0),a.set(e.indices,0),{positions:e.positions,normals:n,indices:a}}create(){var t=this.blockSize;const e=new THREE.PlaneBufferGeometry(t,t);e.rotateY(Math.PI/2),e.translate(t/2,0,0);const i=new THREE.PlaneBufferGeometry(t,t);i.rotateY(-Math.PI/2),i.translate(-t/2,0,0);const s=new THREE.PlaneBufferGeometry(t,t);s.rotateX(-Math.PI/2),s.translate(0,t/2,0);const h=new THREE.PlaneBufferGeometry(t,t);h.rotateX(Math.PI/2),h.translate(0,-t/2,0);const o=new THREE.PlaneBufferGeometry(t,t);o.translate(0,0,t/2);const n=new THREE.PlaneBufferGeometry(t,t);n.rotateY(Math.PI),n.translate(0,0,-t/2),this.geometries_=[e,i,s,h,o,n]}}class K{constructor(t,e,i,s,h){if(this.x=t,this.z=e,this.width=i,this.depth=s,this.waterDepth=0,this.snow=h,this.snowHeight=0,.95<Rt(p[6])&&(this.waterDepth=tt.type===Q.MONOLITH?L(6.5,10):L(1,6)),(!et.weather.shouldRain||this.snow)&&0<this.waterDepth&&Rt(p[7])<.5&&(this.frozen=!0,this.waterDepth=tt.type===Q.MONOLITH?L(6.5,10):L(1,4)),0<this.waterDepth){var o=new THREE.BoxBufferGeometry(this.width,this.waterDepth,this.depth);const n=new THREE.MeshPhongMaterial({transparent:!0,opacity:this.frozen?.8:.5});n.depthWrite=!1;const a=new THREE.Mesh(o,n);a.position.set(this.x,this.waterDepth/2,this.z),y.add(a)}if(this.snow&&(0===this.waterDepth||this.frozen)){this.snowHeight=L(.06,.1);h=new THREE.BoxBufferGeometry(this.width,this.snowHeight,this.depth),o=new THREE.MeshPhongMaterial;const r=new THREE.Mesh(h,o);r.receiveShadow=!0,r.position.set(this.x,this.waterDepth+this.snowHeight/2,this.z),y.add(r)}}}const Q={TRADITONAL:"traditional",SHORT:"short",TALL:"tall",BIGGER_IN_CENTER:"biggerInCenter",AGRIDUSTRIAL:"agridustrial",SMALLER_IN_CENTER:"smallerInCenter",MONOLITH:"monolith",CHAOS:"chaos",PETE_REPEAT:"peteRepeat"};function J(t,e,i,s,h=!0){s=e+s;const o=h?Math.min:Math.max;i=o(t,0,-(t+i)),s=o(e,0,-s);return Math.sqrt(i*i+s*s)}let $=0;const tt=new class{constructor(){this.typePercentages=[.16,.3025,.445,.5625,.68,.7725,.865,.9325,1],this.decideType(),this.biomes={streetSizeGenerator:{traditional:t=>5<t?.5:0===t?L(2,4):1,agridustrial:t=>0===t&&R()<.8?L(2,6):L(.05,.3),monolith:t=>0,biggerInCenter:t=>5<t?.5:0===t?2:1,smallerInCenter:t=>5<t?.5:0===t?2:1,short:t=>0===t?1:.5,tall:t=>0===t?1.9:1,chaos:t=>L(.2,1),peteRepeat:t=>5<t?.5:0===t?L(2,4):1},streetGenerationChances:{traditional:(t,e,i,s,h,o)=>{var n=1-Math.pow(h/8,2),h=.95*n/(i+s);return{splitWidthChance:h*i,splitDepthChance:h*s,splitRepeatChance:.05*n,splitChoices:[.25,.5,.75],numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/(k+o),6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/(k+o),6))),1)}},agridustrial:(t,e,i,s,h,o)=>{var n=.84/(i+s);return{splitWidthChance:n*i,splitDepthChance:n*s,splitRepeatChance:.03,splitChoices:[.25,.5,.75],numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/(k+o),6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/(k+o),6))),1)}},monolith:(t,e,i,s,h,o)=>({splitWidthChance:0,splitDepthChance:0,splitRepeatChance:0,splitChoices:[.25,.5,.75],numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/(k+o),6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/(k+o),6))),1)}),biggerInCenter:(t,e,i,s,h,o)=>{var n=1-Math.pow(h/8,2),a=(4<h?.95*n:n)/(i+s);return{splitWidthChance:a*i,splitDepthChance:a*s,splitRepeatChance:4<h?.05*n:0,splitChoices:[.25,.5,.75],numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/(k+o),6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/(k+o),6))),1)}},smallerInCenter:(t,e,i,s,h,o)=>{var n=1-Math.pow(h/8,2),a=(4<h?.95*n:n)/(i+s);return{splitWidthChance:a*i,splitDepthChance:a*s,splitRepeatChance:4<h?.05*n:0,splitChoices:[.25,.5,.75],numRepetitionsX:Math.max(Math.floor(L(1,Math.min(i/(k+o),6))),1),numRepetitionsZ:Math.max(Math.floor(L(1,Math.min(s/(k+o),6))),1)}},short:(t,e,i,s,h,o)=>{var n=1-Math.pow(h/8,2),h=.95*n/(i+s);return{splitWidthChance:h*i,splitDepthChance:h*s,splitRepeatChance:.05*n,splitChoic
const f=4095;const C=t=>.5*(1-Math.cos(t*Math.PI));let E;function r(t,e=0,i=0){if(null==E){E=new Array(1+f);for(let t=0;t<1+f;t++)E[t]=R()}t<0&&(t=-t),e<0&&(e=-e),i<0&&(i=-i);let s=Math.floor(t),h=Math.floor(e),o=Math.floor(i),n=t-s,a=e-h,r=i-o;var l,p;let c=0,d=.5;for(let t=0;t<4;t++){var u=s+(h<<4)+(o<<8),m=C(n),M=C(a),w=E[u&f];w+=m*(E[u+1&f]-w),l=E[u+16&f],w+=M*((l+=m*(E[u+16+1&f]-l))-w),u+=256,l=E[u&f],l+=m*(E[u+1&f]-l),p=E[u+16&f],l+=M*((p+=m*(E[u+16+1&f]-p))-l),w+=C(r)*(l-w),c+=w*d,d*=.5,s<<=1,n*=2,h<<=1,a*=2,o<<=1,r*=2,1<=n&&(s++,n--),1<=a&&(h++,a--),1<=r&&(o++,r--)}return c}const l=function(t,e,i,s,h){return(t-e)/(i-e)*(h-s)+s};function z(t,e){return e?Number(Math.round(t+"e"+e)+"e-"+e):Math.round(t)}const e=[];for(let t=0;t<32;t++)e.push(tokenData.hash.slice(2+2*t,4+2*t));const p=e.map(t=>parseInt(t,16));!function(t){const e=(()=>{const e=4294967296;let i,s;return{setSeed(t){s=i=(null==t?R()*e:t)>>>0},getSeed(){return i},rand(){return s=(1664525*s+1013904223)%e,s/e}}})();e.setSeed(t),E=new Array(1+f);for(let t=0;t<1+f;t++)E[t]=e.rand()}(parseInt(tokenData.hash.slice(2,10),16)),S=Uint32Array.from([0,1,s=t=2,3].map(t=>parseInt(tokenData.hash.substr(8*t+2,8),16))),R=e=>(t=S[3],S[3]=S[2],S[2]=S[1],S[1]=s=S[0],t^=t<<11,S[0]^=t^t>>>8^s>>>19,S[0]/2**32);const y=new THREE.Scene,n=120,k=n/240,b=n/40,W=n/n;let i=window.innerWidth/window.innerHeight,a=!0;const h=1.5*n;var o=Rt(p[1]);let c;c=o<.4?n/4:o<.8?n/8:n/16;let d=c;const u=new THREE.PerspectiveCamera(75,i,.1,7*n),m=new THREE.OrthographicCamera(-d*i,d*i,d,-d,1,3*n);let M=a?m:u;const w="mixed",g=Rt(p[13]),x=[.25,.5,1];let v=[.28,.56,.84,1];g<.6&&(x.push(0),v=[.25,.5,.75,.85,1]);o=[...x,w];function T(t){var e=Object.keys(t);return t[e[e.length*R()<<0]]}function H(t,e){var i=Object.keys(t);return t[i[(i.length-1e-9)*Rt(p[e])<<0]]}function I(t,e,i){var s=Rt(p[t]);for(let t=0;t<e.length;t++)if(s<=e[t])return i[t]}const P=H({BW:[1315860,15987699],REEF:[867683,1938037,2471875,15721901,14897443],BRICK:[5649953,13585211,15515822,10852495,13996659],DOLPHIN:[1126479,3560792,7192023,14213854,16711421],OAXACA:[14964526,1556155,3024938,16438096,7778369],WHO_ATE_THE_CRANS:[16752562,16506082,708095,6335386,10582712],MOSS_AGATE:[16120815,9612692,7637877,13037440,5258562],FIREWATER:[15770114,5775128,15828997,14245177,2108505],BRINKMAN:[15885963,2344921,4774308,15908647,7960952],TOMATO_TOMATO:[7829180,13486053,16776155,16772177,16738125],THE_PINK_ONE:[7816112,6440803,12988005,16364497,14039801],DROPDOWN:[15385653,3430805,14942310,249508,16469309]},0),D=I(10,v,o),B=new THREE.WebGLRenderer({powerPreference:"high-performance",antialias:!0,alpha:!0});let A=!1;const X=new THREE.Color(O());function L(t,e){return R()*(e-t)+t}B.setSize(window.innerWidth,window.innerHeight),B.shadowMap.enabled=!0,B.shadowMap.autoUpdate=!1,B.shadowMap.needsUpdate=!0,B.shadowMap.type=THREE.PCFSoftShadowMap,document.body.appendChild(B.domElement),function(t,i){const e=document.body.querySelectorAll(t);e.forEach(e=>{Object.keys(i).forEach(t=>{e.style[t]=i[t]})})}("canvas",{touchAction:"none",cursor:"pointer","-webkit-tap-highlight-color":"transparent"});const G=[];function O(t,e=D){return!t||R()<e?P[Math.floor(R()*P.length)]:t}class Z{constructor(t,e,i,s,h,o,n,a){this.x=t,this.z=e,this.width=i,this.depth=s,this.boxes=[],this.colorCohesion=D===w?x[Math.floor(R()*x.length)]:D,this.stepBackPercent=R(),this.repeatWidth=h,this.repeatDepth=o,this.numRepeatWidth=n,this.numRepeatDepth=a}display(){this.boxes=this.makeStructure(this.x,this.z,this.width,this.depth,0,null,0,this.repeatWidth,this.repeatDepth,this.numRepeatWidth,this.numRepeatDepth,!1)}makeStructure(h,o,n,a,r,l,p=0,c=[],d=[],u=[],m=[],t){var e=R();let{splitWidthChance:i,splitDepthChance:s,splitRepeatChance:M,splitWhere:w,createLevelChance:f,numRepetitionsX:C,numRepetitionsZ:E}=tt.attributes.buildingSplitChances(h,o,n,a,p);t&&(t=i,y=s,g=M,x={splitWidthChance:t+=(x=t/(t+y))*g,splitDepthChance:y+=(1-x)*g,splitRepeatChance:g=0},i=x.splitWidthChance,s=x.splitDepthChance,M=x.splitRepeatChance);var y=i+s,g=e<=i,x=e<=y&&e>i,y=e<=y+M&&y<e;let b=[];if(g&&n>k){e=this.makeStructure(h,o,n*w,a,r,l,p,c,d,u,m,!1),g=this.makeStructure(h+n*w,o,n*(1-w),a,r,l,p,c,d,u,m,!1);b=[...e,...g]}else if(x&&a>k){var v=this.makeStructure(h,o,n,a*w,r,l,p,c,d,u,m,!1),T=this.makeStructure(h,o+a*w,n,a*(1-w),r,l,p,c,d,u,m,!1);b=[...v,...T]}else if(y&&a>k&&n>k){var H,S=n/C,I=a/E,P=this.makeStructure(h,o,S,I,r,l,p,[...c,S],[...d,I],[...u,C],[...m,E],!0);for(let i=0;i<C;i++)for(let e=0;e<E;e++)for(let t=0;t<P.length;t++)0===i&&0===e||((H=P[t]).width>S&&0<i||H.depth>I&&0<e||(b.push({x:H.x+S*i,y:H.y,z:H.z+I*e,width:H.width,height:H.height,depth:H.depth,color:H.color}),H=new THREE.Color(H.color),G.push(H.r),G.push(H.g),G.push(H.b)));b=[...P,...b]}else{v=tt.attributes.buildingHeightGenerator(h,r,o,n,a,p),T=O(l,this.colorCohesion);let t=n,e=c.length-1;for(;z(t,10)===z(c[e],10);)t*=u[e],e--;let i=a;for(e=d.length-1;z(i,10)===z(d[e],10);)i*=m[e],e--;y={x:h+t/2,y:r+v/2,z:o+i/2,width:t,height:v,depth:i,color:T},l=new THREE.Color(T);G.push(l.r),G.push(l.g),G.push(l.b);let s=[];n>W&&a>W&&R()<=f?R()<this.stepBackPercent||tt.type===Q.MONOLITH&&p<5?(l=Math.min(n,a)/Math.floor(L(10,20)),s=this.makeStructure(h+l,o+l,n-2*l,a-2*l,v+r,T,p+1,c,d,u,m,!1),_(h,r,o,t,i,v,s)):s=this.makeStructure(h,o,n,a,v+r,T,p+1,c,d,u,m,!1):_(h,r,o,t,i,v,s),b=[y,...s]}return b}}function _(t,e,i,s,h,o,n){var a=L(.02,.06);et.weather.snow&&e+o>et.weather.flood.waterDepth&&e+o+a>et.weather.flood.waterDepth+et.weather.flood.snowHeight&&R()<.7&&(n.push({x:t+s/2,y:e+o+a/2,z:i+h/2,width:s,height:a,depth:h,color:15592941}),h=new THREE.Color(15592941),G.push(h.r),G.push(h.g),G.push(h.b))}class Y{constructor(t,e,i,s){this.x=t,this.z=e,this.width=i,this.depth=s,this.boxes=[]}display(){this.splitBlock(this.x,this.z,this.width,this.depth)}splitBlock(t,e,i,s,h=0){var o=R(),{splitWidthChance:n,splitDepthChance:a,splitRepeatChance:r,splitWhere:l,numRepetitionsX:p,numRepetitionsZ:c}=tt.attributes.blockSplitChances(t,e,i,s,h),d=n+a,a=o<=d&&n<o,d=o<=d+r&&d<o;if(o<=n&&i>k)this.splitBlock(t,e,i*l,s,h+1),this.splitBlock(t+i*l,e,i*(1-l),s,h+1);else if(a&&s>k)this.splitBlock(t,e,i,s*l,h+1),this.splitBlock(t,e+s*l,i,s*(1-l),h+1);else if(d&&s>k&&i>k){var u=i/p,m=s/c;const f=new Z(t,e,u,m,[u],[m],[p],[c]);f.display();var M,w=f.boxes;const C=[];for(let i=0;i<p;i++)for(let e=0;e<c;e++)for(let t=0;t<w.length;t++)0===i&&0===e||((M=w[t]).width>u&&0<i||M.depth>m&&0<e||(C.push({x:M.x+u*i,y:M.y,z:M.z+m*e,width:M.width,height:M.height,depth:M.depth,color:M.color}),M=new THREE.Color(M.color),G.push(M.r),G.push(M.g),G.push(M.b)));this.boxes=[...this.boxes,...w,...C]}else{const E=new Z(t,e,i,s);E.display(),this.boxes=[...this.boxes,...E.boxes]}}}class F{constructor(t,e,i,s,h){this.x=t,this.z=e,this.width=i,this.depth=s,this.color=h,this.types={SQUARE:"square",PYRAMID:"pyramid",STAGE:"stage"},this.type=H(this.types,12)}display(){if(this.type===this.types.SQUARE){var t=new THREE.BoxBufferGeometry(this.width,1e3,this.depth),e=new THREE.MeshStandardMaterial({color:this.color});const h=new THREE.Mesh(t,e);h.receiveShadow=!0,h.position.x=this.x+this.width/2,h.position.z=this.z+this.depth/2,h.position.y=-500,y.add(h)}else if(this.type===this.types.PYRAMID){var i=new THREE.ConeGeometry(this.width*Math.sin(Math.PI/4),50,4),s=new THREE.MeshStandardMaterial({color:this.color});const o=new THREE.Mesh(i,s);o.receiveShadow=!0,o.rotation.x=Math.PI,o.rotation.y=Math.PI/4,o.position.x=this.x+this.width/2,o.position.y=-25,o.position.z=this.z+this.depth/2,y.add(o)}else if(this.type===this.types.STAGE){i=this.width*Math.sin(Math.PI/4),s=new THREE.CylinderGeometry(i,.25*i,50,4),i=new THREE.MeshStandardMaterial({color:this.color});const n=new THREE.Mesh(s,i);n.receiveShadow=!0,n.rotation.y=Math.PI/4,n.position.x=this.x+this.width/2,n.position.y=-25,n.position.z=this.z+this.depth/2,y.add(n)}}}class N{constructor(t,e,i,s){this.x=t,this.z=e,this.width=i,this.depth=s,this.boxes=[],this.baseColor=O()}display(){this.subdivideStreets(this.x,this.z,this.width,this.depth);const t=new F(this.x,this.z,this.width,this.depth,this.baseColor);t.display()}subdivideStreets(t,e,i,s,h=0){var o=R(),n=tt.attributes.streetSizeGenerator(h),{splitWidthChance:a,splitDepthChance:r,splitRepeatChance:l,splitChoices:p,numRepetitionsX:c,numRepetitionsZ:d}=tt.attributes.streetGenerationChances(t,e,i,s,h,n),u=a+r,r=o<=a,a=o<=u&&a<o,o=o<=u+l&&u<o,p=p[Math.floor(R()*p.length)];if(r&&i>b){if(0===h&&2<=n){const C=new j(t+i*p,e+s/2,n,s);this.boxes=C.display()}this.subdivideStreets(t,e,i*p-n/2,s,h+1),this.subdivideStreets(t+i*p+n/2,e,i*(1-p)-n/2,s,h+1)}else if(a&&s>b){if(0===h&&2<=n){const E=new j(t+i/2,e+s*p,i,n);this.boxes=E.display()}this.subdivideStreets(t,e,i,s*p-n/2,h+1),this.subdivideStreets(t,e+s*p+n/2,i,s*(1-p)-n/2,h+1)}else if(o&&s>b&&i>b){var m=(i-n*(c-1))/c,M=(s-n*(d-1))/d;const y=new Y(t,e,m,M);y.display();var w,f=y.boxes;const g=[];for(let i=0;i<c;i++)for(let e=0;e<d;e++)for(let t=0;t<f.length;t++)0===i&&0===e||(w=f[t],g.push({x:w.x+(m+n)*i,y:w.y,z:w.z+(M+n)*e,width:w.width,height:w.height,depth:w.depth,color:w.color}),w=new THREE.Color(w.color),G.push(w.r),G.push(w.g),G.push(w.b));this.boxes=[...this.boxes,...f,...g]}else{const x=new Y(t,e,i,s);x.display(),this.boxes=[...this.boxes,...x.boxes]}}}class j{constructor(t,e,i,s){this.x=t,this.z=e,this.color=O(),this.direction=s<i?1:0,this.streetSize=Math.min(.75*Math.min(i,s),4),this.width=this.direction?i:this.streetSize,this.depth=this.direction?this.streetSize:s}display(){if(.5<Rt(p[15]))return[];var t=new THREE.BoxBufferGeometry(this.width,.5,this.depth),e=new THREE.MeshStandardMaterial({color:O(this.color)});const i=new THREE.Mesh(t,e),s=[];_(this.x-this.width/2,1.25,this.z-this.depth/2,this.width,this.depth,.25,s),i.receiveShadow=!0,i.castShadow=!0,i.position.x=this.x,i.position.y=1.25,i.position.z=this.z,y.add(i);var h=Math.max(this.width,this.depth)/12;let o=h;for(;o<=11*h;){var n={x:this.x+(this.direction?o-this.width/2:0),y:.5,z:this.z+(this.direction?0:o-this.depth/2),width:1,height:1,depth:1,color:O(this.color)};s.push(n);n=new THREE.Color(n.color);G.push(n.r),G.push(n.g),G.push(n.b),o+=h}return s}}class U{constructor(t,e,i,s,h,o){this.rainCells=h,this.x=t,this.y=e,this.z=i,this.rainDensity=o,this.rainGeo=new THREE.BufferGeometry,this.particles=[],this.scale=s,this.orthoRainSize=2,this.perspectiveRainSize=.2,this.snowTimeToRepeat=5,this.rainTimeToRepeat=1,this.timeToRepeat=et.weather.snow?this.snowTimeToRepeat:this.rainTimeToRepeat;s=Rt(p[14]);const n=new THREE.Color(et.weather.snow?15592941:s<.1?O():11591423);.1<=s&&n.lerp(new THREE.Color(et.sun.skyColor),.25),this.rainMaterial=new THREE.PointsMaterial({color:n,size:a?this.orthoRainSize:this.perspectiveRainSize,transparent:!0,opacity:et.weather.snow?.8:.4}),this.addParticles(),this.updateGeometry(),this.rain=new THREE.Points(this.rainGeo,this.rainMaterial),y.add(this.rain)}updateSize(){this.rainMaterial.size=a?this.orthoRainSize:this.perspectiveRainSize,this.rainMaterial.needsUpdate=!0}addParticles(){for(let t=0;t<Object.keys(this.rainCells).length*this.rainDensity;t++){var e=T(this.rainCells)["position"],i=e[1]*this.scale+this.y-this.scale/2,s=new THREE.Vector3(e[0]*this.scale+th
{"type":"threejs","aspectRatio":".75","instructions":"Click & drag to pan|Scroll wheel to zoom in and out|\"c\" - Change camera mode|\"r\" - Reset camera positioning|\"p\" - Toggle auto-pan|\"z\" - Zoomed out view|\"t\" - Toggle background transparency|1-4 - Change detail level.","interactive":"true"}
Democracity is inspired by the diorama of the same name at the 1939 New York World's Fair which depicted a utopian city of the future. This piece satirizes the concept showing that the optimism of the 1930's did not account for the problems of the future brought about by climate change such as flooding. This piece is fully interactive with the best way to experience it being to explore and try to understand the stories that the different city layouts are trying to tell you. Note the cities are tileable meaning you can easily edit them together visually (Example: bit.ly/3yWCHvn). Controls: Click & drag to pan, Scroll wheel to zoom in and out, "c" - Change camera mode, "r" - Reset camera positioning, "p" - Toggle auto-pan, "z" - Zoomed out view, "t" - Toggle background transparency, 1-4 - Change detail level.