class Runescape{constructor(){this.mondrian=null,this.txList=[]}launch(t,e,i){this.blockHeight=`${t}`,console.log("blockHeight",this.blockHeight),this.txValueCache=e,this.parcelId=i?Number(i.split(":").pop()):null,this.loadRoutine()}async loadRoutine(){const t=await fetch("/content/a9f6a9b050af3de1a4ce714978c1f2231ba731f1f46731a16d0e411f89308566i0"),e=document.createElement("script");e.innerHTML=await t.text(),document.body.appendChild(e);const i=document.createElement("div");function o(t){const e=new Uint8Array(t.length/2);for(var i=0;i<e.length;i++)e[i]=parseInt(t.substring(2*i,2*i+2),16);return e.buffer}i.setAttribute("id","css3d"),document.body.appendChild(i),document.getElementById("css3d").style="margin: 0; overflow: hidden; position: absolute; top: 0px;";const n={};let s=null,r={},a=[],l=!1;null!==this.parcelId||(l=!0);if(s=(t=>{t=BigInt(t);const e=5000000000n,i=210000n,o=t=>e/2n**t,n=t/i;let s=0n;for(let t=0n;t<n;t++)s+=o(t)*i;return s+=t%i*o(n),String(s)})(this.blockHeight),Number(this.blockHeight)<84e4){const t=await import("/content/d36f3434809b4b4bed7da6c17d45fbb3e72b89d31f3334d9d34e168519b51bd9i0"),e=await t.getBitmapSat(Number(this.blockHeight)),i=await fetch(`/r/sat/${e}/at/-1`).then((t=>t.json()));try{const t=await fetch(`/r/metadata/${i.id}`).then((async t=>{if(t.ok)return await t.text();throw new Error(`${t.status} ${i.id} metadata not found`)})).then((t=>CBOR.decode(o(t.replace(/"/g,"")))));Number(t.blockHeight)===Number(this.blockHeight)&&(s=e)}catch(t){}}if(s){const t=await fetch(`/r/sat/${s}/at/-1`).then((t=>t.json()));let e=!0,i=0;try{if(t&&t.id)for(;e;){const o=await fetch(`/r/children/${t.id}/inscriptions/${i}`).then((t=>t.json()));e=o.more,a=a.concat(o.children),i+=1}}catch(t){console.log("/r/children/{id}/inscriptions/{page} recursive endpoint not supported.")}if(a.length>0)for(let t=0;t<a.length;t++){const e=a[t];fetch(`/r/metadata/${e.id}`).then((async t=>{if(t.ok)return await t.text();throw new Error(`${t.status} ${e.id} metadata not found`)})).then((t=>CBOR.decode(o(t.replace(/"/g,""))))).then((async t=>{if(t&&t.parcelId){const i=Number(t.parcelId.split(":").pop());if(!(i in n)&&(n[i]=e.id,!l&&i!==this.parcelId))return}})).catch((t=>console.log(t)))}}window.THREE=await import("/content/0d013bb60fc5bf5a6c77da7371b07dc162ebc7d7f3af0ff3bd00ae5f0c546445i0");const{default:h}=await import("/content/036f12ea42d0fd664948e952b61f4c2f0d04e5672e7a7b3e2c33ac2544b6b1a7i0"),{iframe3DRenderer:d,iframe3D:c}=await import("/content/3b7fd16da25b50dc8042cee1b0ef7947c4ef83993fb9c74420d24bec94824155i0");function p(t,e,i,o,n,s,r,a){const l=document.createElement("div");l.style.width="350px",l.style.height="350px",l.style.backgroundColor="transparent",l.style.border="0px",l.style.overflow="hidden";const h=document.createElement("iframe");h.style.overflow="hidden",h.style.width="350px",h.style.height="350px",h.style.border="0px",h.setAttribute("scrolling","no"),h.src=t.includes("http")?t:`/content/${t}`,l.appendChild(h);const d=a||130,p=new c(l);return p.position.set(e,i,o),p.rotation.set(n-Math.PI/2,s,r),p.scale.set(1/d,1/d,1/d),p}const{POSTPROCESSING:f}=await import("/content/5f68b5b0e97c51679eba9f8987fc3945dc04fc894a0bb7c099385145cbd3a617i0"),w=f.BloomEffect,u=f.EffectComposer,x=f.EffectPass,m=f.RenderPass,g=f.BlendFunction,b={headers:{Accept:"application/json"}},y=await fetch("/r/blockheight",b).then((t=>t.json())),E=await fetch(`/r/blockinfo/${y}`,b).then((t=>t.json()));console.log("latest blockHeight",y,"tx_count",E.transaction_count);const M=Math.floor(E.transaction_count/2);console.log("treasure tx: 1/2 tx x latest tx_count =",M),await this.fetchData();const R=M<this.txList.length?this.txList[M].value:0;if(console.log("treasure tx #",M,"in block",this.blockHeight,"has tx value in total of",R,"sats"),null===this.parcelId)for(let t=0;t<this.txList.length;t++)this.txList[t].size=this.logTxSize(this.txList[t].value);let H=0;for(let t of this.txList)H+=t.size*t.size;let S=Math.ceil(Math.sqrt(H));this.mondrian=new MondrianLayout(S,S),h.install({THREE:THREE});const T=window.innerWidth,I=window.innerHeight,k=new THREE.Clock,L=new THREE.Scene,C=new THREE.PerspectiveCamera(90,T/I,.01,1e3);C.position.set(0,S/1.6+2,0);const v=new d;v.setSize(T,I),document.getElementById("css3d").appendChild(v.domElement);const B=new THREE.WebGLRenderer({powerPreference:"high-performance",antialias:!0,alpha:!0});B.setSize(T,I),B.shadowMap.enabled=!0,B.setClearColor(0,0),B.setPixelRatio(window.devicePixelRatio),B.shadowMap.type=THREE.PCFSoftShadowMap;let $=new THREE.HemisphereLight(16777215,0,2);L.add($);let P=new THREE.DirectionalLight(16777215,1);P.position.set(-10,100,-10),P.target.position.set(0,0,0),P.castShadow=!0,L.add(P),document.getElementById("root").appendChild(B.domElement);const A=new h(C,B.domElement),D=new h(C,v.domElement);let z=13576336;this.blockHeight<84e4&&(z=16356896);const O=new THREE.MeshStandardMaterial({color:z,wireframe:!1}),N=new THREE.MeshStandardMaterial({color:16775424,wireframe:!1,roughness:.375});new THREE.MeshStandardMaterial({color:16225050,wireframe:!1});let G=0;const j=a.length-1;let _=!1;for(let t=0;t<this.txList.length;t++){const e=this.mondrian.place(this.txList[t].size),i=.5*e.r,o=new THREE.Mesh(new THREE.BoxGeometry(.9*e.r,.2*e.r,.9*e.r),this.txList[t].value===R&&G<=j?N:O);if(l&&n&&n[t])if(6!==e.r||_){let o=null;o=t in n&&t in r&&r[t].length>0?new THREE.MeshStandardMaterial({color:16777215,wireframe:!1,map:(new THREE.TextureLoader).load(`/content/${r[t][0]?.getAttribute("content")}`)}):new THREE.MeshStandardMaterial({color:16777215,wireframe:!1});const s=new THREE.Mesh(new THREE.BoxGeometry(.7*e.r,.25*e.r,.7*e.r),o);s.position.set(e.position.x-S/2+i,.1*e.r/2,e.position.y-S/2+i),L.add(s)}else{const t=new THREE.Group;t.add(new p("b10b2e2d243f565bebf658508c3cb5fa6b76a7028bbdd220e236a5e45f65168ci213",e.position.x-S/2+i,.1*e.r+.35,e.position.y-S/2+i,0,0,0,70)),L.add(t),_=!0}else if(null!==this.parcelId&&t===this.parcelId){console.log("child parcelId",this.parcelId);const t=new THREE.MeshStandardMaterial({color:16777215,wireframe:!1,map:this.parcelId&&r[this.parcelId]&&(new THREE.TextureLoader).load(`/content/${r[this.parcelId][0]?.getAttribute("content")}`)}),o=new THREE.Mesh(new THREE.BoxGeometry(.7*e.r,.25*e.r,.7*e.r),t);o.position.set(e.position.x-S/2+i,.1*e.r/2,e.position.y-S/2+i),L.add(o)}this.txList[t].value===R&&(G+=1),L.add(o),o.position.set(e.position.x-S/2+i,.1*e.r/2,e.position.y-S/2+i)}console.log("found",G,1!==G?"treasure parcels":"treasure parcel","with the same output value for BlockDrop");const F=new u(B);F.addPass(new m(L,C));const W=new w({blendFunction:g.ADD,mipmapBlur:!0,luminanceThreshold:.4,luminanceSmoothing:.12,intensity:2});F.addPass(new x(C,W)),B.render(L,C),F.render();let q=!0;!function t(){const e=k.getDelta(),i=k.getElapsedTime(),o=A.update(e);D.update(e);q&&(W.intensity=1+1*Math.sin(i),F.render(),v.render(L,C)),requestAnimationFrame(t),o&&(q=!0)}()}async fetchData(){const t=await fetch(this.txValueCache).then((t=>t.text()));if(t){let e=t.split(/\r?\n/);this.txList=new Array(e.length);for(let t=0;t<e.length;t++){let i=parseInt(e[t]);this.txList[t]={value:i}}}}decompress=t=>{const e=Uint8Array.from(atob(t),(t=>t.charCodeAt(0))),i=new DecompressionStream("gzip"),o=i.writable.getWriter();return o.write(e),o.close(),new Response(i.readable).arrayBuffer().then((function(t){return(new TextDecoder).decode(t)}))};logTxSize(t){if(0===t)return 1;let e=Math.ceil(Math.log10(t))-5;return Math.min(Number.MAX_SAFE_INTEGER,Math.max(1,e))}}class MondrianLayout{constructor(t,e){this.width=t,this.height=e,this.xMax=0,this.yMax=0,this.rowOffset=0,this.rows=[],this.txMap=[]}getSize(){return{width:this.xMax,height:this.yMax}}getRow(t){let e=t.y-this.rowOffset;return e<this.rows.length?this.rows[e]:null}getSlot(t){let e=this.getRow(t);return null!==e&&e.map.hasOwnProperty(t.x)?e.map[t.x]:null}addRow(){let t={y:this.rows.length+this.rowOffset,slots:[],map:{},max:0};return this.rows.push(t),t}addSlot(t){if(t.r<=0)return null;let e=this.getSlot(t.position);if(null!==e)return e.r=Math.max(e.r,t.r),e;{let e=this.getRow(t.position);if(null===e)return null;let i=e.slots.findIndex((e=>e.position.x>t.position.x));return-1===i?e.slots.push(t):e.slots.splice(i,0,t),e.map[t.position.x]=t,t}}removeSlot(t){let e=this.getRow(t.position);if(null!==e){delete e.map[t.position.x];let i=e.slots.findIndex((e=>e.position.x===t.position.x));-1!==i&&e.slots.splice(i,1)}}fillSlot(t,e){let i={left:t.position.x,right:t.position.x+e,bottom:t.position.y,top:t.position.y+e};this.removeSlot(t);for(let o=t.position.y;o<i.top;o++){let n=this.getRow({x:t.position.x,y:o});if(null!==n){let s=[],r=0;for(let e of n.slots)if(!(e.position.x+e.r<i.left||e.position.x>=i.right)){s.push(e);let i=Math.max(0,e.position.x+e.r-(t.position.x+t.r));r=Math.max(r,i)}i.right<this.width&&!n.map.hasOwnProperty(i.right)&&this.addSlot({position:{x:i.right,y:o},r:t.r-e+r});for(let e of s)e.r=t.position.x-e.position.x,0===e.r&&this.removeSlot(e)}else this.addRow(),t.position.x>0&&this.addSlot({position:{x:0,y:o},r:t.position.x}),i.right<this.width&&this.addSlot({position:{x:i.right,y:o},r:this.width-i.right})}for(let i=Math.max(0,t.position.y-e);i<t.position.y;i++){let o=this.getRow({x:t.position.x,y:i});if(null!==o)for(let i=0;i<o.slots.length;i++){let n=o.slots[i];if(n.position.x<t.position.x+e&&n.position.x+n.r>t.position.x&&n.position.y+n.r>=t.position.y){let e=n.r;n.r=t.position.y-n.position.y;let i={x:n.position.x+n.r,y:n.position.y,width:e-n.r,height:n.r};for(;i.width>0&&i.height>0;)i.width<=i.height?(this.addSlot({position:{x:i.x,y:i.y},r:i.width}),i.y+=i.width,i.height-=i.width):(this.addSlot({position:{x:i.x,y:i.y},r:i.height}),i.x+=i.height,i.width-=i.height)}}}return{position:t.position,r:e}}place(t){let e={},i=!1,o=null;for(let e of this.rows){for(let n of e.slots)if(n.r>=t){i=!0,o=this.fillSlot(n,t);break}if(i)break}if(!i){let e=this.addRow(),i=this.addSlot({position:{x:0,y:e.y},r:this.width});o=this.fillSlot(i,t)}for(let t=0;t<o.r;t++)for(let i=0;i<o.r;i++)this.setTxMapCell({x:o.position.x+t,y:o.position.y+i},e);return o.position.x+o.r>this.xMax&&(this.xMax=o.position.x+o.r),o.position.y+o.r>this.yMax&&(this.yMax=o.position.y+o.r),o}setTxMapCell(t,e){let i=t.y-this.rowOffset;if(i>=0&&i<this.height&&t.x>=0&&t.x<this.width){let o=i*this.width+t.x;o>=0&&o<this.txMap.length&&(this.txMap[o]=e)}}}