New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@loaders.gl/terrain

Package Overview
Dependencies
Maintainers
11
Versions
271
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/terrain - npm Package Compare versions

Comparing version 2.2.0-alpha.2 to 2.2.0-alpha.3

2

dist/dist.min.js

@@ -1,1 +0,1 @@

!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){(function(t){const r=n(3),i="undefined"==typeof window?t:window;i.loaders=i.loaders||{},e.exports=Object.assign(i.loaders,r)}).call(this,n(2))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t);class r{constructor(e=257){this.gridSize=e;const t=e-1;if(t&t-1)throw new Error(`Expected grid size to be 2^n+1, got ${e}.`);this.numTriangles=t*t*2-2,this.numParentTriangles=this.numTriangles-t*t,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(4*this.numTriangles);for(let e=0;e<this.numTriangles;e++){let n=e+2,r=0,i=0,o=0,a=0,s=0,c=0;for(1&n?o=a=s=t:r=i=c=t;(n>>=1)>1;){const e=r+o>>1,t=i+a>>1;1&n?(o=r,a=i,r=s,i=c):(r=o,i=a,o=s,a=c),s=e,c=t}const u=4*e;this.coords[u+0]=r,this.coords[u+1]=i,this.coords[u+2]=o,this.coords[u+3]=a}}createTile(e){return new i(e,this)}}class i{constructor(e,t){const n=t.gridSize;if(e.length!==n*n)throw new Error(`Expected terrain data of length ${n*n} (${n} x ${n}), got ${e.length}.`);this.terrain=e,this.martini=t,this.errors=new Float32Array(e.length),this.update()}update(){const{numTriangles:e,numParentTriangles:t,coords:n,gridSize:r}=this.martini,{terrain:i,errors:o}=this;for(let a=e-1;a>=0;a--){const e=4*a,s=n[e+0],c=n[e+1],u=n[e+2],d=n[e+3],l=s+u>>1,E=c+d>>1,f=l+E-c,h=E+s-l,g=(i[c*r+s]+i[d*r+u])/2,T=E*r+l,y=Math.abs(g-i[T]);if(o[T]=Math.max(o[T],y),a<t){const e=(c+h>>1)*r+(s+f>>1),t=(d+h>>1)*r+(u+f>>1);o[T]=Math.max(o[T],o[e],o[t])}}}getMesh(e=0){const{gridSize:t,indices:n}=this.martini,{errors:r}=this;let i=0,o=0;const a=t-1;function s(a,c,u,d,l,E){const f=a+u>>1,h=c+d>>1;Math.abs(a-l)+Math.abs(c-E)>1&&r[h*t+f]>e?(s(l,E,a,c,f,h),s(u,d,l,E,f,h)):(n[c*t+a]=n[c*t+a]||++i,n[d*t+u]=n[d*t+u]||++i,n[E*t+l]=n[E*t+l]||++i,o++)}n.fill(0),s(0,0,a,a,a,0),s(a,a,0,0,0,a);const c=new Uint16Array(2*i),u=new Uint32Array(3*o);let d=0;function l(i,o,a,s,E,f){const h=i+a>>1,g=o+s>>1;if(Math.abs(i-E)+Math.abs(o-f)>1&&r[g*t+h]>e)l(E,f,i,o,h,g),l(a,s,E,f,h,g);else{const e=n[o*t+i]-1,r=n[s*t+a]-1,l=n[f*t+E]-1;c[2*e]=i,c[2*e+1]=o,c[2*r]=a,c[2*r+1]=s,c[2*l]=E,c[2*l+1]=f,u[d++]=e,u[d++]=r,u[d++]=l}}return l(0,0,a,a,a,0),l(a,a,0,0,0,a),{vertices:c,triangles:u}}}function o(e){if(!e||!e.POSITION)return null;let t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;const s=e.POSITION.value,c=s&&s.length;if(!c)return null;for(let e=0;e<c;e+=3){const c=s[e],u=s[e+1],d=s[e+2];t=c<t?c:t,n=u<n?u:n,r=d<r?d:r,i=c>i?c:i,o=u>o?u:o,a=d>a?d:a}return[[t,n,r],[i,o,a]]}function a(e,t){if(null===e)return null;const{meshMaxError:n,bounds:i,elevationDecoder:a}=t,s=e.data,c=e.width,u=c+1,d=function(e,t,n){const{rScaler:r,bScaler:i,gScaler:o,offset:a}=n,s=t+1,c=new Float32Array(s*s);for(let n=0,s=0;s<t;s++)for(let u=0;u<t;u++,n++){const t=4*n,u=e[t+0],d=e[t+1],l=e[t+2];c[n+s]=u*r+d*o+l*i+a}for(let e=s*(s-1),t=0;t<s-1;t++,e++)c[e]=c[e-s];for(let e=s-1,t=0;t<s;t++,e+=s)c[e]=c[e-1];return c}(s,c,a),l=new r(u).createTile(d),{vertices:E,triangles:f}=l.getMesh(n),h=function(e,t,n,r){const i=n+1,o=e.length/2,a=new Float32Array(3*o),s=new Float32Array(2*o),[c,u,d,l]=r||[0,0,n,n],E=(d-c)/n,f=(l-u)/n;for(let r=0;r<o;r++){const o=e[2*r],u=e[2*r+1],d=u*i+o;a[3*r+0]=o*E+c,a[3*r+1]=-u*f+l,a[3*r+2]=t[d],s[2*r+0]=o/n,s[2*r+1]=u/n}return{POSITION:{value:a,size:3},TEXCOORD_0:{value:s,size:2}}}(E,d,c,i);return{loaderData:{header:{}},header:{vertexCount:f.length,boundingBox:o(h)},mode:4,indices:{value:f,size:1},attributes:h}}const s={id:"terrain",name:"Terrain",version:"2.2.0-alpha.2",extensions:["png","pngraw"],mimeType:"image/png",options:{terrain:{workerUrl:"https://unpkg.com/@loaders.gl/terrain@2.2.0-alpha.2/dist/terrain-loader.worker.js",meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0}}}},c={...s,parse:async function(e,t,n){return t.image=t.image||{},t.image.type="data",a(await n.parse(e,t,t.baseUri),t.terrain)}},u=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function d(e){return e>>1^-(1&e)}function l(e,t,n,r,i=!0){let o;if(o=2===r?new Uint16Array(e,t,n):new Uint32Array(e,t,n),!i)return o;let a=0;for(let e=0;e<o.length;++e){const t=o[e];o[e]=a-t,0===t&&++a}return o}function E(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}const f={header:0,vertices:1,triangleIndices:2,edgeIndices:3,extensions:4},h={maxDecodingStep:f.extensions};function g(e,t){const n=Object.assign({},h,t),r=new DataView(e),{header:i,headerEndPosition:o}=function(e){let t=0;const n={};for(const[r,i]of u){const o=8===i?e.getFloat64:e.getFloat32;n[r]=o.call(e,t,!0),t+=i}return{header:n,headerEndPosition:t}}(r);if(n.maxDecodingStep<f.vertices)return{header:i};const{vertexData:a,vertexDataEndPosition:s}=function(e,t){let n=t;const r=e.getUint32(n,!0),i=new Uint16Array(3*r);n+=Uint32Array.BYTES_PER_ELEMENT;const o=Uint16Array.BYTES_PER_ELEMENT,a=r*o,s=n,c=s+a,u=c+a;let l=0,E=0,f=0;for(let t=0;t<r;t++)l+=d(e.getUint16(s+o*t,!0)),E+=d(e.getUint16(c+o*t,!0)),f+=d(e.getUint16(u+o*t,!0)),i[t]=l,i[t+r]=E,i[t+2*r]=f;return n+=3*a,{vertexData:i,vertexDataEndPosition:n}}(r,o);if(n.maxDecodingStep<f.triangleIndices)return{header:i,vertexData:a};const{triangleIndices:c,triangleIndicesEndPosition:g}=function(e,t,n){let r=n;const i=t.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;r%i!=0&&(r+=i-r%i);const o=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const a=3*o,s=l(e.buffer,r,a,i);return r+=a*i,{triangleIndicesEndPosition:r,triangleIndices:s}}(r,a,s);if(n.maxDecodingStep<f.edgeIndices)return{header:i,vertexData:a,triangleIndices:c};const{westIndices:T,southIndices:y,eastIndices:p,northIndices:_,edgeIndicesEndPosition:S}=function(e,t,n){let r=n;const i=t.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,o=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const a=l(e.buffer,r,o,i,!1);r+=o*i;const s=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const c=l(e.buffer,r,s,i,!1);r+=s*i;const u=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const d=l(e.buffer,r,u,i,!1);r+=u*i;const E=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const f=l(e.buffer,r,E,i,!1);return r+=E*i,{edgeIndicesEndPosition:r,westIndices:a,southIndices:c,eastIndices:d,northIndices:f}}(r,a,g);if(n.maxDecodingStep<f.extensions)return{header:i,vertexData:a,triangleIndices:c,westIndices:T,northIndices:_,eastIndices:p,southIndices:y};const{extensions:b}=function(e,t){const n={};if(e.byteLength<=t)return{extensions:n,extensionsEndPosition:t};let r=t;for(;r<e.byteLength;){const t=e.getUint8(r,!0);r+=Uint8Array.BYTES_PER_ELEMENT;const o=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const a=new DataView(e.buffer,r,o);switch(t){case 1:n.vertexNormals=(i=a,new Uint8Array(i.buffer,i.byteOffset,i.byteLength));break;case 2:n.waterMask=E(a)}r+=o}var i;return{extensions:n,extensionsEndPosition:r}}(r,S);return{header:i,vertexData:a,triangleIndices:c,westIndices:T,northIndices:_,eastIndices:p,southIndices:y,extensions:b}}function T(e,t){if(!e)return null;const{bounds:n}=t,{header:r,vertexData:i,triangleIndices:a}=g(e,f.triangleIndices),s=function(e,t,n){const{minHeight:r,maxHeight:i}=t,[o,a,s,c]=n||[0,0,1,1],u=s-o,d=c-a,l=i-r,E=e.length/3,f=new Float32Array(3*E),h=new Float32Array(2*E);for(let t=0;t<E;t++){const n=e[t]/32767,i=e[t+E]/32767,s=e[t+2*E]/32767;f[3*t+0]=n*u+o,f[3*t+1]=i*d+a,f[3*t+2]=s*l+r,h[2*t+0]=n,h[2*t+1]=i}return{POSITION:{value:f,size:3},TEXCOORD_0:{value:h,size:2}}}(i,r,n);return{loaderData:{header:{}},header:{vertexCount:a.length,boundingBox:o(s)},mode:4,indices:{value:a,size:1},attributes:s}}function y(e,t){return T(e,t["quantized-mesh"])}const p={id:"quantized-mesh",name:"Quantized Mesh",version:"2.2.0-alpha.2",extensions:["terrain"],mimeType:"application/vnd.quantized-mesh",options:{"quantized-mesh":{workerUrl:"https://unpkg.com/@loaders.gl/terrain@2.2.0-alpha.2/dist/quantized-mesh-loader.worker.js",bounds:[0,0,1,1]}}},_={...p,parseSync:y,parse:async(e,t)=>y(e,t)};n.d(t,"TerrainLoader",(function(){return c})),n.d(t,"TerrainWorkerLoader",(function(){return s})),n.d(t,"QuantizedMeshLoader",(function(){return _})),n.d(t,"QuantizedMeshWorkerLoader",(function(){return p}))}])}));
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){(function(t){const r=n(3),i="undefined"==typeof window?t:window;i.loaders=i.loaders||{},e.exports=Object.assign(i.loaders,r)}).call(this,n(2))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t),n.d(t,"TerrainLoader",(function(){return c})),n.d(t,"TerrainWorkerLoader",(function(){return s})),n.d(t,"QuantizedMeshLoader",(function(){return m})),n.d(t,"QuantizedMeshWorkerLoader",(function(){return b}));class r{constructor(e=257){this.gridSize=e;const t=e-1;if(t&t-1)throw new Error(`Expected grid size to be 2^n+1, got ${e}.`);this.numTriangles=t*t*2-2,this.numParentTriangles=this.numTriangles-t*t,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(4*this.numTriangles);for(let e=0;e<this.numTriangles;e++){let n=e+2,r=0,i=0,o=0,a=0,s=0,c=0;for(1&n?o=a=s=t:r=i=c=t;(n>>=1)>1;){const e=r+o>>1,t=i+a>>1;1&n?(o=r,a=i,r=s,i=c):(r=o,i=a,o=s,a=c),s=e,c=t}const u=4*e;this.coords[u+0]=r,this.coords[u+1]=i,this.coords[u+2]=o,this.coords[u+3]=a}}createTile(e){return new i(e,this)}}class i{constructor(e,t){const n=t.gridSize;if(e.length!==n*n)throw new Error(`Expected terrain data of length ${n*n} (${n} x ${n}), got ${e.length}.`);this.terrain=e,this.martini=t,this.errors=new Float32Array(e.length),this.update()}update(){const{numTriangles:e,numParentTriangles:t,coords:n,gridSize:r}=this.martini,{terrain:i,errors:o}=this;for(let a=e-1;a>=0;a--){const e=4*a,s=n[e+0],c=n[e+1],u=n[e+2],l=n[e+3],d=s+u>>1,E=c+l>>1,f=d+E-c,h=E+s-d,g=(i[c*r+s]+i[l*r+u])/2,T=E*r+d,y=Math.abs(g-i[T]);if(o[T]=Math.max(o[T],y),a<t){const e=(c+h>>1)*r+(s+f>>1),t=(l+h>>1)*r+(u+f>>1);o[T]=Math.max(o[T],o[e],o[t])}}}getMesh(e=0){const{gridSize:t,indices:n}=this.martini,{errors:r}=this;let i=0,o=0;const a=t-1;function s(a,c,u,l,d,E){const f=a+u>>1,h=c+l>>1;Math.abs(a-d)+Math.abs(c-E)>1&&r[h*t+f]>e?(s(d,E,a,c,f,h),s(u,l,d,E,f,h)):(n[c*t+a]=n[c*t+a]||++i,n[l*t+u]=n[l*t+u]||++i,n[E*t+d]=n[E*t+d]||++i,o++)}n.fill(0),s(0,0,a,a,a,0),s(a,a,0,0,0,a);const c=new Uint16Array(2*i),u=new Uint32Array(3*o);let l=0;function d(i,o,a,s,E,f){const h=i+a>>1,g=o+s>>1;if(Math.abs(i-E)+Math.abs(o-f)>1&&r[g*t+h]>e)d(E,f,i,o,h,g),d(a,s,E,f,h,g);else{const e=n[o*t+i]-1,r=n[s*t+a]-1,d=n[f*t+E]-1;c[2*e]=i,c[2*e+1]=o,c[2*r]=a,c[2*r+1]=s,c[2*d]=E,c[2*d+1]=f,u[l++]=e,u[l++]=r,u[l++]=d}}return d(0,0,a,a,a,0),d(a,a,0,0,0,a),{vertices:c,triangles:u}}}function o(e){if(!e||!e.POSITION)return null;let t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;const s=e.POSITION.value,c=s&&s.length;if(!c)return null;for(let e=0;e<c;e+=3){const c=s[e],u=s[e+1],l=s[e+2];t=c<t?c:t,n=u<n?u:n,r=l<r?l:r,i=c>i?c:i,o=u>o?u:o,a=l>a?l:a}return[[t,n,r],[i,o,a]]}function a(e,t){if(null===e)return null;const{meshMaxError:n,bounds:i,elevationDecoder:a}=t,s=e.data,c=e.width,u=c+1,l=function(e,t,n){const{rScaler:r,bScaler:i,gScaler:o,offset:a}=n,s=t+1,c=new Float32Array(s*s);for(let n=0,s=0;s<t;s++)for(let u=0;u<t;u++,n++){const t=4*n,u=e[t+0],l=e[t+1],d=e[t+2];c[n+s]=u*r+l*o+d*i+a}for(let e=s*(s-1),t=0;t<s-1;t++,e++)c[e]=c[e-s];for(let e=s-1,t=0;t<s;t++,e+=s)c[e]=c[e-1];return c}(s,c,a),d=new r(u).createTile(l),{vertices:E,triangles:f}=d.getMesh(n),h=function(e,t,n,r){const i=n+1,o=e.length/2,a=new Float32Array(3*o),s=new Float32Array(2*o),[c,u,l,d]=r||[0,0,n,n],E=(l-c)/n,f=(d-u)/n;for(let r=0;r<o;r++){const o=e[2*r],u=e[2*r+1],l=u*i+o;a[3*r+0]=o*E+c,a[3*r+1]=-u*f+d,a[3*r+2]=t[l],s[2*r+0]=o/n,s[2*r+1]=u/n}return{POSITION:{value:a,size:3},TEXCOORD_0:{value:s,size:2}}}(E,l,c,i);return{loaderData:{header:{}},header:{vertexCount:f.length,boundingBox:o(h)},mode:4,indices:{value:f,size:1},attributes:h}}const s={id:"terrain",name:"Terrain",version:"2.2.0-alpha.3",extensions:["png","pngraw"],mimeType:"image/png",options:{terrain:{workerUrl:"https://unpkg.com/@loaders.gl/terrain@2.2.0-alpha.3/dist/terrain-loader.worker.js",meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0}}}},c={...s,parse:async function(e,t,n){return t.image=t.image||{},t.image.type="data",a(await n.parse(e,t,t.baseUri),t.terrain)}},u=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function l(e){return e>>1^-(1&e)}function d(e,t,n,r,i=!0){let o;if(o=2===r?new Uint16Array(e,t,n):new Uint32Array(e,t,n),!i)return o;let a=0;for(let e=0;e<o.length;++e){const t=o[e];o[e]=a-t,0===t&&++a}return o}function E(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}const f=1,h=2,g=3,T=4,y={maxDecodingStep:T};function p(e,t){const n=Object.assign({},y,t),r=new DataView(e),{header:i,headerEndPosition:o}=function(e){let t=0;const n={};for(const[r,i]of u){const o=8===i?e.getFloat64:e.getFloat32;n[r]=o.call(e,t,!0),t+=i}return{header:n,headerEndPosition:t}}(r);if(n.maxDecodingStep<f)return{header:i};const{vertexData:a,vertexDataEndPosition:s}=function(e,t){let n=t;const r=e.getUint32(n,!0),i=new Uint16Array(3*r);n+=Uint32Array.BYTES_PER_ELEMENT;const o=Uint16Array.BYTES_PER_ELEMENT,a=r*o,s=n,c=s+a,u=c+a;let d=0,E=0,f=0;for(let t=0;t<r;t++)d+=l(e.getUint16(s+o*t,!0)),E+=l(e.getUint16(c+o*t,!0)),f+=l(e.getUint16(u+o*t,!0)),i[t]=d,i[t+r]=E,i[t+2*r]=f;return n+=3*a,{vertexData:i,vertexDataEndPosition:n}}(r,o);if(n.maxDecodingStep<h)return{header:i,vertexData:a};const{triangleIndices:c,triangleIndicesEndPosition:p}=function(e,t,n){let r=n;const i=t.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;r%i!=0&&(r+=i-r%i);const o=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const a=3*o,s=d(e.buffer,r,a,i);return r+=a*i,{triangleIndicesEndPosition:r,triangleIndices:s}}(r,a,s);if(n.maxDecodingStep<g)return{header:i,vertexData:a,triangleIndices:c};const{westIndices:_,southIndices:S,eastIndices:b,northIndices:m,edgeIndicesEndPosition:w}=function(e,t,n){let r=n;const i=t.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,o=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const a=d(e.buffer,r,o,i,!1);r+=o*i;const s=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const c=d(e.buffer,r,s,i,!1);r+=s*i;const u=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const l=d(e.buffer,r,u,i,!1);r+=u*i;const E=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const f=d(e.buffer,r,E,i,!1);return r+=E*i,{edgeIndicesEndPosition:r,westIndices:a,southIndices:c,eastIndices:l,northIndices:f}}(r,a,p);if(n.maxDecodingStep<T)return{header:i,vertexData:a,triangleIndices:c,westIndices:_,northIndices:m,eastIndices:b,southIndices:S};const{extensions:P}=function(e,t){const n={};if(e.byteLength<=t)return{extensions:n,extensionsEndPosition:t};let r=t;for(;r<e.byteLength;){const t=e.getUint8(r,!0);r+=Uint8Array.BYTES_PER_ELEMENT;const o=e.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;const a=new DataView(e.buffer,r,o);switch(t){case 1:n.vertexNormals=(i=a,new Uint8Array(i.buffer,i.byteOffset,i.byteLength));break;case 2:n.waterMask=E(a)}r+=o}var i;return{extensions:n,extensionsEndPosition:r}}(r,w);return{header:i,vertexData:a,triangleIndices:c,westIndices:_,northIndices:m,eastIndices:b,southIndices:S,extensions:P}}function _(e,t){if(!e)return null;const{bounds:n}=t,{header:r,vertexData:i,triangleIndices:a}=p(e,h),s=function(e,t,n){const{minHeight:r,maxHeight:i}=t,[o,a,s,c]=n||[0,0,1,1],u=s-o,l=c-a,d=i-r,E=e.length/3,f=new Float32Array(3*E),h=new Float32Array(2*E);for(let t=0;t<E;t++){const n=e[t]/32767,i=e[t+E]/32767,s=e[t+2*E]/32767;f[3*t+0]=n*u+o,f[3*t+1]=i*l+a,f[3*t+2]=s*d+r,h[2*t+0]=n,h[2*t+1]=i}return{POSITION:{value:f,size:3},TEXCOORD_0:{value:h,size:2}}}(i,r,n);return{loaderData:{header:{}},header:{vertexCount:a.length,boundingBox:o(s)},mode:4,indices:{value:a,size:1},attributes:s}}function S(e,t){return _(e,t["quantized-mesh"])}const b={id:"quantized-mesh",name:"Quantized Mesh",version:"2.2.0-alpha.3",extensions:["terrain"],mimeType:"application/vnd.quantized-mesh",options:{"quantized-mesh":{workerUrl:"https://unpkg.com/@loaders.gl/terrain@2.2.0-alpha.3/dist/quantized-mesh-loader.worker.js",bounds:[0,0,1,1]}}},m={...b,parseSync:S,parse:async(e,t)=>S(e,t)}}])}));

@@ -13,2 +13,8 @@ "use strict";

function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
var QUANTIZED_MESH_HEADER = new Map([['centerX', Float64Array.BYTES_PER_ELEMENT], ['centerY', Float64Array.BYTES_PER_ELEMENT], ['centerZ', Float64Array.BYTES_PER_ELEMENT], ['minHeight', Float32Array.BYTES_PER_ELEMENT], ['maxHeight', Float32Array.BYTES_PER_ELEMENT], ['boundingSphereCenterX', Float64Array.BYTES_PER_ELEMENT], ['boundingSphereCenterY', Float64Array.BYTES_PER_ELEMENT], ['boundingSphereCenterZ', Float64Array.BYTES_PER_ELEMENT], ['boundingSphereRadius', Float64Array.BYTES_PER_ELEMENT], ['horizonOcclusionPointX', Float64Array.BYTES_PER_ELEMENT], ['horizonOcclusionPointY', Float64Array.BYTES_PER_ELEMENT], ['horizonOcclusionPointZ', Float64Array.BYTES_PER_ELEMENT]]);

@@ -23,8 +29,8 @@

var header = {};
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
var _iterator = _createForOfIteratorHelper(QUANTIZED_MESH_HEADER),
_step;
try {
for (var _iterator = QUANTIZED_MESH_HEADER[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var _step$value = (0, _slicedToArray2["default"])(_step.value, 2),

@@ -39,14 +45,5 @@ key = _step$value[0],

} catch (err) {
_didIteratorError = true;
_iteratorError = err;
_iterator.e(err);
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
_iterator.f();
}

@@ -53,0 +50,0 @@

@@ -22,3 +22,3 @@ "use strict";

var VERSION = typeof "2.2.0-alpha.2" !== 'undefined' ? "2.2.0-alpha.2" : 'latest';
var VERSION = typeof "2.2.0-alpha.3" !== 'undefined' ? "2.2.0-alpha.3" : 'latest';
var QuantizedMeshWorkerLoader = {

@@ -39,3 +39,3 @@ id: 'quantized-mesh',

var QuantizedMeshLoader = _objectSpread({}, QuantizedMeshWorkerLoader, {
var QuantizedMeshLoader = _objectSpread(_objectSpread({}, QuantizedMeshWorkerLoader), {}, {
parseSync: _parseQuantizedMesh["default"],

@@ -42,0 +42,0 @@ parse: function () {

@@ -18,3 +18,3 @@ "use strict";

var VERSION = typeof "2.2.0-alpha.2" !== 'undefined' ? "2.2.0-alpha.2" : 'latest';
var VERSION = typeof "2.2.0-alpha.3" !== 'undefined' ? "2.2.0-alpha.3" : 'latest';
var TerrainWorkerLoader = {

@@ -41,3 +41,3 @@ id: 'terrain',

var TerrainLoader = _objectSpread({}, TerrainWorkerLoader, {
var TerrainLoader = _objectSpread(_objectSpread({}, TerrainWorkerLoader), {}, {
parse: _parseTerrain["default"]

@@ -44,0 +44,0 @@ });

@@ -8,3 +8,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

import parseQuantizedMesh from './lib/parse-quantized-mesh';
const VERSION = typeof "2.2.0-alpha.2" !== 'undefined' ? "2.2.0-alpha.2" : 'latest';
const VERSION = typeof "2.2.0-alpha.3" !== 'undefined' ? "2.2.0-alpha.3" : 'latest';
export const QuantizedMeshWorkerLoader = {

@@ -23,3 +23,3 @@ id: 'quantized-mesh',

};
export const QuantizedMeshLoader = _objectSpread({}, QuantizedMeshWorkerLoader, {
export const QuantizedMeshLoader = _objectSpread(_objectSpread({}, QuantizedMeshWorkerLoader), {}, {
parseSync: parseQuantizedMesh,

@@ -26,0 +26,0 @@ parse: async (arrayBuffer, options) => parseQuantizedMesh(arrayBuffer, options)

@@ -8,3 +8,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

import loadTerrain from './lib/parse-terrain';
const VERSION = typeof "2.2.0-alpha.2" !== 'undefined' ? "2.2.0-alpha.2" : 'latest';
const VERSION = typeof "2.2.0-alpha.3" !== 'undefined' ? "2.2.0-alpha.3" : 'latest';
export const TerrainWorkerLoader = {

@@ -29,5 +29,5 @@ id: 'terrain',

};
export const TerrainLoader = _objectSpread({}, TerrainWorkerLoader, {
export const TerrainLoader = _objectSpread(_objectSpread({}, TerrainWorkerLoader), {}, {
parse: loadTerrain
});
//# sourceMappingURL=terrain-loader.js.map
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
var QUANTIZED_MESH_HEADER = new Map([['centerX', Float64Array.BYTES_PER_ELEMENT], ['centerY', Float64Array.BYTES_PER_ELEMENT], ['centerZ', Float64Array.BYTES_PER_ELEMENT], ['minHeight', Float32Array.BYTES_PER_ELEMENT], ['maxHeight', Float32Array.BYTES_PER_ELEMENT], ['boundingSphereCenterX', Float64Array.BYTES_PER_ELEMENT], ['boundingSphereCenterY', Float64Array.BYTES_PER_ELEMENT], ['boundingSphereCenterZ', Float64Array.BYTES_PER_ELEMENT], ['boundingSphereRadius', Float64Array.BYTES_PER_ELEMENT], ['horizonOcclusionPointX', Float64Array.BYTES_PER_ELEMENT], ['horizonOcclusionPointY', Float64Array.BYTES_PER_ELEMENT], ['horizonOcclusionPointZ', Float64Array.BYTES_PER_ELEMENT]]);

@@ -11,8 +18,8 @@

var header = {};
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
var _iterator = _createForOfIteratorHelper(QUANTIZED_MESH_HEADER),
_step;
try {
for (var _iterator = QUANTIZED_MESH_HEADER[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var _step$value = _slicedToArray(_step.value, 2),

@@ -27,14 +34,5 @@ key = _step$value[0],

} catch (err) {
_didIteratorError = true;
_iteratorError = err;
_iterator.e(err);
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
_iterator.f();
}

@@ -41,0 +39,0 @@

@@ -10,3 +10,3 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";

import parseQuantizedMesh from './lib/parse-quantized-mesh';
var VERSION = typeof "2.2.0-alpha.2" !== 'undefined' ? "2.2.0-alpha.2" : 'latest';
var VERSION = typeof "2.2.0-alpha.3" !== 'undefined' ? "2.2.0-alpha.3" : 'latest';
export var QuantizedMeshWorkerLoader = {

@@ -25,3 +25,3 @@ id: 'quantized-mesh',

};
export var QuantizedMeshLoader = _objectSpread({}, QuantizedMeshWorkerLoader, {
export var QuantizedMeshLoader = _objectSpread(_objectSpread({}, QuantizedMeshWorkerLoader), {}, {
parseSync: parseQuantizedMesh,

@@ -28,0 +28,0 @@ parse: function () {

@@ -8,3 +8,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

import loadTerrain from './lib/parse-terrain';
var VERSION = typeof "2.2.0-alpha.2" !== 'undefined' ? "2.2.0-alpha.2" : 'latest';
var VERSION = typeof "2.2.0-alpha.3" !== 'undefined' ? "2.2.0-alpha.3" : 'latest';
export var TerrainWorkerLoader = {

@@ -29,5 +29,5 @@ id: 'terrain',

};
export var TerrainLoader = _objectSpread({}, TerrainWorkerLoader, {
export var TerrainLoader = _objectSpread(_objectSpread({}, TerrainWorkerLoader), {}, {
parse: loadTerrain
});
//# sourceMappingURL=terrain-loader.js.map

@@ -1,1 +0,1 @@

!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=10)}([function(e,t,r){e.exports=r(6)},function(e,t){function r(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function c(e){r(a,o,i,c,s,"next",e)}function s(e){r(a,o,i,c,s,"throw",e)}c(void 0)}))}}},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t,r){var n=r(7),o=r(8),i=r(9);e.exports=function(e,t){return n(e)||o(e,t)||i()}},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},,function(e,t,r){var n=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,r,n){var o=t&&t.prototype instanceof y?t:y,i=Object.create(o.prototype),a=new T(n||[]);return i._invoke=function(e,t,r){var n=f;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=P(a,r);if(c){if(c===d)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var s=u(e,t,r);if("normal"===s.type){if(n=r.done?h:l,s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=h,r.method="throw",r.arg=s.arg)}}}(e,r,a),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var f="suspendedStart",l="suspendedYield",p="executing",h="completed",d={};function y(){}function v(){}function E(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,m=b&&b(b(L([])));m&&m!==r&&n.call(m,i)&&(g=m);var w=E.prototype=y.prototype=Object.create(g);function x(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function O(e){var t;this._invoke=function(r,o){function i(){return new Promise((function(t,i){!function t(r,o,i,a){var c=u(e[r],e,o);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?Promise.resolve(f.__await).then((function(e){t("next",e,i,a)}),(function(e){t("throw",e,i,a)})):Promise.resolve(f).then((function(e){s.value=e,i(s)}),(function(e){return t("throw",e,i,a)}))}a(c.arg)}(r,o,t,i)}))}return t=t?t.then(i,i):i()}}function P(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=u(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function L(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:j}}function j(){return{value:t,done:!0}}return v.prototype=w.constructor=E,E.constructor=v,E[c]=v.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},x(O.prototype),O.prototype[a]=function(){return this},e.AsyncIterator=O,e.async=function(t,r,n,o){var i=new O(s(t,r,n,o));return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},x(w),w[c]="Generator",w[i]=function(){return this},w.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=L,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(S),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(n=(a=c.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),i=r(1),a=r.n(i),c=r(2),s=r.n(c),u=r(3),f=r.n(u);function l(e){if(!e||!e.POSITION)return null;var t=1/0,r=1/0,n=1/0,o=-1/0,i=-1/0,a=-1/0,c=e.POSITION.value,s=c&&c.length;if(!s)return null;for(var u=0;u<s;u+=3){var f=c[u],l=c[u+1],p=c[u+2];t=f<t?f:t,r=l<r?l:r,n=p<n?p:n,o=f>o?f:o,i=l>i?l:i,a=p>a?p:a}return[[t,r,n],[o,i,a]]}var p=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function h(e){return e>>1^-(1&e)}function d(e,t,r,n){var o,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(o=2===n?new Uint16Array(e,t,r):new Uint32Array(e,t,r),!i)return o;for(var a=0,c=0;c<o.length;++c){var s=o[c];o[c]=a-s,0===s&&++a}return o}function y(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}var v={header:0,vertices:1,triangleIndices:2,edgeIndices:3,extensions:4},E={maxDecodingStep:v.extensions};function g(e,t){var r=Object.assign({},E,t),n=new DataView(e),o=function(e){var t=0,r={},n=!0,o=!1,i=void 0;try{for(var a,c=p[Symbol.iterator]();!(n=(a=c.next()).done);n=!0){var s=f()(a.value,2),u=s[0],l=s[1],h=8===l?e.getFloat64:e.getFloat32;r[u]=h.call(e,t,!0),t+=l}}catch(e){o=!0,i=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return{header:r,headerEndPosition:t}}(n),i=o.header,a=o.headerEndPosition;if(r.maxDecodingStep<v.vertices)return{header:i};var c=function(e,t){var r=t,n=e.getUint32(r,!0),o=new Uint16Array(3*n);r+=Uint32Array.BYTES_PER_ELEMENT;for(var i=Uint16Array.BYTES_PER_ELEMENT,a=n*i,c=r,s=c+a,u=s+a,f=0,l=0,p=0,d=0;d<n;d++)f+=h(e.getUint16(c+i*d,!0)),l+=h(e.getUint16(s+i*d,!0)),p+=h(e.getUint16(u+i*d,!0)),o[d]=f,o[d+n]=l,o[d+2*n]=p;return{vertexData:o,vertexDataEndPosition:r+=3*a}}(n,a),s=c.vertexData,u=c.vertexDataEndPosition;if(r.maxDecodingStep<v.triangleIndices)return{header:i,vertexData:s};var l=function(e,t,r){var n=r,o=t.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;n%o!=0&&(n+=o-n%o);var i=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var a=3*i,c=d(e.buffer,n,a,o);return{triangleIndicesEndPosition:n+=a*o,triangleIndices:c}}(n,s,u),g=l.triangleIndices,b=l.triangleIndicesEndPosition;if(r.maxDecodingStep<v.edgeIndices)return{header:i,vertexData:s,triangleIndices:g};var m=function(e,t,r){var n=r,o=t.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,i=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var a=d(e.buffer,n,i,o,!1);n+=i*o;var c=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var s=d(e.buffer,n,c,o,!1);n+=c*o;var u=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var f=d(e.buffer,n,u,o,!1);n+=u*o;var l=e.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var p=d(e.buffer,n,l,o,!1);return{edgeIndicesEndPosition:n+=l*o,westIndices:a,southIndices:s,eastIndices:f,northIndices:p}}(n,s,b),w=m.westIndices,x=m.southIndices,O=m.eastIndices,P=m.northIndices,_=m.edgeIndicesEndPosition;return r.maxDecodingStep<v.extensions?{header:i,vertexData:s,triangleIndices:g,westIndices:w,northIndices:P,eastIndices:O,southIndices:x}:{header:i,vertexData:s,triangleIndices:g,westIndices:w,northIndices:P,eastIndices:O,southIndices:x,extensions:function(e,t){var r={};if(e.byteLength<=t)return{extensions:r,extensionsEndPosition:t};for(var n,o=t;o<e.byteLength;){var i=e.getUint8(o,!0);o+=Uint8Array.BYTES_PER_ELEMENT;var a=e.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;var c=new DataView(e.buffer,o,a);switch(i){case 1:r.vertexNormals=(n=c,new Uint8Array(n.buffer,n.byteOffset,n.byteLength));break;case 2:r.waterMask=y(c)}o+=a}return{extensions:r,extensionsEndPosition:o}}(n,_).extensions}}function b(e,t){if(!e)return null;var r=t.bounds,n=g(e,v.triangleIndices),o=n.header,i=n.vertexData,a=n.triangleIndices,c=function(e,t,r){for(var n=t.minHeight,o=t.maxHeight,i=r||[0,0,1,1],a=f()(i,4),c=a[0],s=a[1],u=a[2]-c,l=a[3]-s,p=o-n,h=e.length/3,d=new Float32Array(3*h),y=new Float32Array(2*h),v=0;v<h;v++){var E=e[v]/32767,g=e[v+h]/32767,b=e[v+2*h]/32767;d[3*v+0]=E*u+c,d[3*v+1]=g*l+s,d[3*v+2]=b*p+n,y[2*v+0]=E,y[2*v+1]=g}return{POSITION:{value:d,size:3},TEXCOORD_0:{value:y,size:2}}}(i,o,r);return{loaderData:{header:{}},header:{vertexCount:a.length,boundingBox:l(c)},mode:4,indices:{value:a,size:1},attributes:c}}function m(e,t){return b(e,t["quantized-mesh"])}function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var x,O=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){s()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},{id:"quantized-mesh",name:"Quantized Mesh",version:"2.2.0-alpha.2",extensions:["terrain"],mimeType:"application/vnd.quantized-mesh",options:{"quantized-mesh":{workerUrl:"https://unpkg.com/@loaders.gl/terrain@".concat("2.2.0-alpha.2","/dist/quantized-mesh-loader.worker.js"),bounds:[0,0,1,1]}}},{parseSync:m,parse:(x=a()(o.a.mark((function e(t,r){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",m(t,r));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return x.apply(this,arguments)})}),P=r(4),_=r.n(P);function S(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(e){if(T(e))n.add(e);else if(T(e.buffer))n.add(e.buffer);else if(t&&"object"===_()(e))for(var o in e)S(e[o],t,n)}else;return void 0===r?Array.from(n):null}function T(e){return!!e&&(e instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&e instanceof MessagePort||("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)))}var L="2.2.0-alpha.2";function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L;!function(e,t){if(!e)throw new Error(t||"loader assertion failed.")}(e,"no loader provided");var r=e.version;t&&r&&(t=I(t),r=I(r))}function I(e){var t=e.split(".").map(Number);return{major:t[0],minor:t[1]}}function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){s()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function M(e){return Y.apply(this,arguments)}function Y(){return(Y=a()(o.a.mark((function e(t){var r,n,i,a,c,s,u;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.loader,n=t.arraybuffer,t.byteOffset,t.byteLength,i=t.options,a=t.context,!r.parseSync&&!r.parse){e.next=6;break}c=n,s=r.parseSync||r.parse,e.next=13;break;case 6:if(!r.parseTextSync){e.next=12;break}u=new TextDecoder,c=u.decode(n),s=r.parseTextSync,e.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return i=N({},i,{modules:r&&r.options&&r.options.modules||{},worker:!1}),e.next=16,s(c,N({},i),a,r);case 16:return e.abrupt("return",e.sent);case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function B(e,t){return e&&"parse"===e.type&&e.source&&e.source.startsWith("loaders.gl")}!function(e){if("undefined"!=typeof self){var t=0,r=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(o,i){var a=t++;self.addEventListener("message",(function e(t){var r=t.data;if(r&&r.id===a)switch(r.type){case"parse-done":self.removeEventListener("message",e),o(r.result);break;case"parse-error":self.removeEventListener("message",e),i(r.message)}})),self.postMessage({type:"parse",id:a,arraybuffer:e,options:r,url:n},[e])}))};self.onmessage=function(){var t=a()(o.a.mark((function t(n){var i,a,c,s,u,f,l,p,h,d;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=n.data,t.prev=1,B(i,e.name)){t.next=4;break}return t.abrupt("return");case 4:return j(e,i.source.split("@")[1]),a=i.arraybuffer,c=i.byteOffset,s=void 0===c?0:c,u=i.byteLength,f=void 0===u?0:u,l=i.options,p=void 0===l?{}:l,t.next=8,M({loader:e,arraybuffer:a,byteOffset:s,byteLength:f,options:p,context:{parse:r}});case 8:h=t.sent,d=S(h),self.postMessage({type:"done",result:h},d),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(1),self.postMessage({type:"error",message:t.t0.message});case 16:case"end":return t.stop()}}),t,null,[[1,13]])})));return function(e){return t.apply(this,arguments)}}()}}(O)}]);
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=12)}([function(t,e,r){t.exports=r(6)},function(t,e){function r(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function u(t){r(a,o,i,u,c,"next",t)}function c(t){r(a,o,i,u,c,"throw",t)}u(void 0)}))}}},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},function(t,e,r){var n=r(7),o=r(8),i=r(9),a=r(11);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||a()}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},,function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new x(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=m(a,r);if(u){if(u===s)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=c(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===s)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}(t,r,a),i}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var s={};function f(){}function l(){}function p(){}var d={};d[o]=function(){return this};var h=Object.getPrototypeOf,y=h&&h(h(O([])));y&&y!==e&&r.call(y,o)&&(d=y);var v=p.prototype=f.prototype=Object.create(d);function E(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function g(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,u){var s=c(t[o],t,i);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function m(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function O(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return l.prototype=v.constructor=p,p.constructor=l,p[a]=l.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},E(g.prototype),g.prototype[i]=function(){return this},t.AsyncIterator=g,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new g(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(v),v[a]="Generator",v[o]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;w(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}}},function(t,e,r){var n=r(10);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),i=r(1),a=r.n(i),u=r(2),c=r.n(u),s=r(3),f=r.n(s);function l(t){if(!t||!t.POSITION)return null;var e=1/0,r=1/0,n=1/0,o=-1/0,i=-1/0,a=-1/0,u=t.POSITION.value,c=u&&u.length;if(!c)return null;for(var s=0;s<c;s+=3){var f=u[s],l=u[s+1],p=u[s+2];e=f<e?f:e,r=l<r?l:r,n=p<n?p:n,o=f>o?f:o,i=l>i?l:i,a=p>a?p:a}return[[e,r,n],[o,i,a]]}function p(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var h=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function y(t){return t>>1^-(1&t)}function v(t,e,r,n){var o,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(o=2===n?new Uint16Array(t,e,r):new Uint32Array(t,e,r),!i)return o;for(var a=0,u=0;u<o.length;++u){var c=o[u];o[u]=a-c,0===c&&++a}return o}function E(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}var g=1,m=2,b=3,w=4,x={maxDecodingStep:w};function O(t,e){var r=Object.assign({},x,e),n=new DataView(t),o=function(t){var e,r=0,n={},o=p(h);try{for(o.s();!(e=o.n()).done;){var i=f()(e.value,2),a=i[0],u=i[1],c=8===u?t.getFloat64:t.getFloat32;n[a]=c.call(t,r,!0),r+=u}}catch(t){o.e(t)}finally{o.f()}return{header:n,headerEndPosition:r}}(n),i=o.header,a=o.headerEndPosition;if(r.maxDecodingStep<g)return{header:i};var u=function(t,e){var r=e,n=t.getUint32(r,!0),o=new Uint16Array(3*n);r+=Uint32Array.BYTES_PER_ELEMENT;for(var i=Uint16Array.BYTES_PER_ELEMENT,a=n*i,u=r,c=u+a,s=c+a,f=0,l=0,p=0,d=0;d<n;d++)f+=y(t.getUint16(u+i*d,!0)),l+=y(t.getUint16(c+i*d,!0)),p+=y(t.getUint16(s+i*d,!0)),o[d]=f,o[d+n]=l,o[d+2*n]=p;return{vertexData:o,vertexDataEndPosition:r+=3*a}}(n,a),c=u.vertexData,s=u.vertexDataEndPosition;if(r.maxDecodingStep<m)return{header:i,vertexData:c};var l=function(t,e,r){var n=r,o=e.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;n%o!=0&&(n+=o-n%o);var i=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var a=3*i,u=v(t.buffer,n,a,o);return{triangleIndicesEndPosition:n+=a*o,triangleIndices:u}}(n,c,s),d=l.triangleIndices,O=l.triangleIndicesEndPosition;if(r.maxDecodingStep<b)return{header:i,vertexData:c,triangleIndices:d};var S=function(t,e,r){var n=r,o=e.length/3>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,i=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var a=v(t.buffer,n,i,o,!1);n+=i*o;var u=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var c=v(t.buffer,n,u,o,!1);n+=u*o;var s=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var f=v(t.buffer,n,s,o,!1);n+=s*o;var l=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var p=v(t.buffer,n,l,o,!1);return{edgeIndicesEndPosition:n+=l*o,westIndices:a,southIndices:c,eastIndices:f,northIndices:p}}(n,c,O),P=S.westIndices,_=S.southIndices,T=S.eastIndices,L=S.northIndices,j=S.edgeIndicesEndPosition;return r.maxDecodingStep<w?{header:i,vertexData:c,triangleIndices:d,westIndices:P,northIndices:L,eastIndices:T,southIndices:_}:{header:i,vertexData:c,triangleIndices:d,westIndices:P,northIndices:L,eastIndices:T,southIndices:_,extensions:function(t,e){var r={};if(t.byteLength<=e)return{extensions:r,extensionsEndPosition:e};for(var n,o=e;o<t.byteLength;){var i=t.getUint8(o,!0);o+=Uint8Array.BYTES_PER_ELEMENT;var a=t.getUint32(o,!0);o+=Uint32Array.BYTES_PER_ELEMENT;var u=new DataView(t.buffer,o,a);switch(i){case 1:r.vertexNormals=(n=u,new Uint8Array(n.buffer,n.byteOffset,n.byteLength));break;case 2:r.waterMask=E(u)}o+=a}return{extensions:r,extensionsEndPosition:o}}(n,j).extensions}}function S(t,e){if(!t)return null;var r=e.bounds,n=O(t,m),o=n.header,i=n.vertexData,a=n.triangleIndices,u=function(t,e,r){for(var n=e.minHeight,o=e.maxHeight,i=r||[0,0,1,1],a=f()(i,4),u=a[0],c=a[1],s=a[2]-u,l=a[3]-c,p=o-n,d=t.length/3,h=new Float32Array(3*d),y=new Float32Array(2*d),v=0;v<d;v++){var E=t[v]/32767,g=t[v+d]/32767,m=t[v+2*d]/32767;h[3*v+0]=E*s+u,h[3*v+1]=g*l+c,h[3*v+2]=m*p+n,y[2*v+0]=E,y[2*v+1]=g}return{POSITION:{value:h,size:3},TEXCOORD_0:{value:y,size:2}}}(i,o,r);return{loaderData:{header:{}},header:{vertexCount:a.length,boundingBox:l(u)},mode:4,indices:{value:a,size:1},attributes:u}}function P(t,e){return S(t,e["quantized-mesh"])}function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function T(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_(Object(r),!0).forEach((function(e){c()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var L,j=T(T({},{id:"quantized-mesh",name:"Quantized Mesh",version:"2.2.0-alpha.3",extensions:["terrain"],mimeType:"application/vnd.quantized-mesh",options:{"quantized-mesh":{workerUrl:"https://unpkg.com/@loaders.gl/terrain@".concat("2.2.0-alpha.3","/dist/quantized-mesh-loader.worker.js"),bounds:[0,0,1,1]}}}),{},{parseSync:P,parse:(L=a()(o.a.mark((function t(e,r){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",P(e,r));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return L.apply(this,arguments)})}),A=r(4),I=r.n(A);function M(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(N(t))n.add(t);else if(N(t.buffer))n.add(t.buffer);else if(e&&"object"===I()(t))for(var o in t)M(t[o],e,n)}else;return void 0===r?Array.from(n):null}function N(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}function U(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function Y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"2.2.0-alpha.3";U(t,"no loader provided");var r=t.version;e&&r&&(e=B(e),r=B(r))}function B(t){var e=t.split(".").map(Number);return{major:e[0],minor:e[1]}}function R(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?R(Object(r),!0).forEach((function(e){c()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function k(t){return F.apply(this,arguments)}function F(){return(F=a()(o.a.mark((function t(e){var r,n,i,a,u,c,s;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arraybuffer,e.byteOffset,e.byteLength,i=e.options,a=e.context,!r.parseSync&&!r.parse){t.next=6;break}u=n,c=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}s=new TextDecoder,u=s.decode(n),c=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return i=D(D({},i),{},{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,c(u,D({},i),a,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function z(t,e){return t&&"parse"===t.type&&t.source&&t.source.startsWith("loaders.gl")}!function(t){if("undefined"!=typeof self){var e=0,r=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(o,i){var a=e++;self.addEventListener("message",(function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case"parse-done":self.removeEventListener("message",t),o(r.result);break;case"parse-error":self.removeEventListener("message",t),i(r.message)}})),self.postMessage({type:"parse",id:a,arraybuffer:t,options:r,url:n},[t])}))};self.onmessage=function(){var e=a()(o.a.mark((function e(n){var i,a,u,c,s,f,l,p,d,h;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.data,e.prev=1,z(i,t.name)){e.next=4;break}return e.abrupt("return");case 4:return Y(t,i.source.split("@")[1]),a=i.arraybuffer,u=i.byteOffset,c=void 0===u?0:u,s=i.byteLength,f=void 0===s?0:s,l=i.options,p=void 0===l?{}:l,e.next=8,k({loader:t,arraybuffer:a,byteOffset:c,byteLength:f,options:p,context:{parse:r}});case 8:d=e.sent,h=M(d),self.postMessage({type:"done",result:d},h),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 16:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t){return e.apply(this,arguments)}}()}}(j)}]);

@@ -1,1 +0,1 @@

!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=10)}([function(t,e,r){t.exports=r(6)},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,c,"next",t)}function c(t){r(a,o,i,s,c,"throw",t)}s(void 0)}))}}},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e,r){var n=r(7),o=r(8),i=r(9);t.exports=function(t,e){return n(t)||o(t,e)||i()}},,function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r,n){var o=e&&e.prototype instanceof d?e:d,i=Object.create(o.prototype),a=new L(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var c=u(t,e,r);if("normal"===c.type){if(n=r.done?h:l,c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=h,r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f="suspendedStart",l="suspendedYield",p="executing",h="completed",y={};function d(){}function v(){}function g(){}var m={};m[i]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(T([])));w&&w!==r&&n.call(w,i)&&(m=w);var x=g.prototype=d.prototype=Object.create(m);function O(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function j(t){var e;this._invoke=function(r,o){function i(){return new Promise((function(e,i){!function e(r,o,i,a){var s=u(t[r],t,o);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==typeof f&&n.call(f,"__await")?Promise.resolve(f.__await).then((function(t){e("next",t,i,a)}),(function(t){e("throw",t,i,a)})):Promise.resolve(f).then((function(t){c.value=t,i(c)}),(function(t){return e("throw",t,i,a)}))}a(s.arg)}(r,o,e,i)}))}return e=e?e.then(i,i):i()}}function S(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,S(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=u(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function T(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:k}}function k(){return{value:e,done:!0}}return v.prototype=x.constructor=g,g.constructor=v,g[s]=v.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},O(j.prototype),j.prototype[a]=function(){return this},t.AsyncIterator=j,t.async=function(e,r,n,o){var i=new j(c(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},O(x),x[s]="Generator",x[i]=function(){return this},x.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=T,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:T(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e,r){"use strict";r.r(e);var n=r(2),o=r.n(n),i=r(0),a=r.n(i),s=r(1),c=r.n(s),u=r(4),f=r.n(u);class l{constructor(t=257){this.gridSize=t;const e=t-1;if(e&e-1)throw new Error(`Expected grid size to be 2^n+1, got ${t}.`);this.numTriangles=e*e*2-2,this.numParentTriangles=this.numTriangles-e*e,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(4*this.numTriangles);for(let t=0;t<this.numTriangles;t++){let r=t+2,n=0,o=0,i=0,a=0,s=0,c=0;for(1&r?i=a=s=e:n=o=c=e;(r>>=1)>1;){const t=n+i>>1,e=o+a>>1;1&r?(i=n,a=o,n=s,o=c):(n=i,o=a,i=s,a=c),s=t,c=e}const u=4*t;this.coords[u+0]=n,this.coords[u+1]=o,this.coords[u+2]=i,this.coords[u+3]=a}}createTile(t){return new p(t,this)}}class p{constructor(t,e){const r=e.gridSize;if(t.length!==r*r)throw new Error(`Expected terrain data of length ${r*r} (${r} x ${r}), got ${t.length}.`);this.terrain=t,this.martini=e,this.errors=new Float32Array(t.length),this.update()}update(){const{numTriangles:t,numParentTriangles:e,coords:r,gridSize:n}=this.martini,{terrain:o,errors:i}=this;for(let a=t-1;a>=0;a--){const t=4*a,s=r[t+0],c=r[t+1],u=r[t+2],f=r[t+3],l=s+u>>1,p=c+f>>1,h=l+p-c,y=p+s-l,d=(o[c*n+s]+o[f*n+u])/2,v=p*n+l,g=Math.abs(d-o[v]);if(i[v]=Math.max(i[v],g),a<e){const t=(c+y>>1)*n+(s+h>>1),e=(f+y>>1)*n+(u+h>>1);i[v]=Math.max(i[v],i[t],i[e])}}}getMesh(t=0){const{gridSize:e,indices:r}=this.martini,{errors:n}=this;let o=0,i=0;const a=e-1;function s(a,c,u,f,l,p){const h=a+u>>1,y=c+f>>1;Math.abs(a-l)+Math.abs(c-p)>1&&n[y*e+h]>t?(s(l,p,a,c,h,y),s(u,f,l,p,h,y)):(r[c*e+a]=r[c*e+a]||++o,r[f*e+u]=r[f*e+u]||++o,r[p*e+l]=r[p*e+l]||++o,i++)}r.fill(0),s(0,0,a,a,a,0),s(a,a,0,0,0,a);const c=new Uint16Array(2*o),u=new Uint32Array(3*i);let f=0;function l(o,i,a,s,p,h){const y=o+a>>1,d=i+s>>1;if(Math.abs(o-p)+Math.abs(i-h)>1&&n[d*e+y]>t)l(p,h,o,i,y,d),l(a,s,p,h,y,d);else{const t=r[i*e+o]-1,n=r[s*e+a]-1,l=r[h*e+p]-1;c[2*t]=o,c[2*t+1]=i,c[2*n]=a,c[2*n+1]=s,c[2*l]=p,c[2*l+1]=h,u[f++]=t,u[f++]=n,u[f++]=l}}return l(0,0,a,a,a,0),l(a,a,0,0,0,a),{vertices:c,triangles:u}}}function h(t){if(!t||!t.POSITION)return null;var e=1/0,r=1/0,n=1/0,o=-1/0,i=-1/0,a=-1/0,s=t.POSITION.value,c=s&&s.length;if(!c)return null;for(var u=0;u<c;u+=3){var f=s[u],l=s[u+1],p=s[u+2];e=f<e?f:e,r=l<r?l:r,n=p<n?p:n,o=f>o?f:o,i=l>i?l:i,a=p>a?p:a}return[[e,r,n],[o,i,a]]}function y(t,e){if(null===t)return null;var r=e.meshMaxError,n=e.bounds,o=e.elevationDecoder,i=t.data,a=t.width,s=a+1,c=function(t,e,r){for(var n=r.rScaler,o=r.bScaler,i=r.gScaler,a=r.offset,s=e+1,c=new Float32Array(s*s),u=0,f=0;f<e;f++)for(var l=0;l<e;l++,u++){var p=4*u,h=t[p+0],y=t[p+1],d=t[p+2];c[u+f]=h*n+y*i+d*o+a}for(var v=s*(s-1),g=0;g<s-1;g++,v++)c[v]=c[v-s];for(var m=s-1,b=0;b<s;b++,m+=s)c[m]=c[m-1];return c}(i,a,o),u=new l(s).createTile(c).getMesh(r),p=u.vertices,y=u.triangles,d=function(t,e,r,n){for(var o=r+1,i=t.length/2,a=new Float32Array(3*i),s=new Float32Array(2*i),c=n||[0,0,r,r],u=f()(c,4),l=u[0],p=u[1],h=u[2],y=u[3],d=(h-l)/r,v=(y-p)/r,g=0;g<i;g++){var m=t[2*g],b=t[2*g+1],w=b*o+m;a[3*g+0]=m*d+l,a[3*g+1]=-b*v+y,a[3*g+2]=e[w],s[2*g+0]=m/r,s[2*g+1]=b/r}return{POSITION:{value:a,size:3},TEXCOORD_0:{value:s,size:2}}}(p,c,a,n);return{loaderData:{header:{}},header:{vertexCount:y.length,boundingBox:h(d)},mode:4,indices:{value:y,size:1},attributes:d}}function d(){return(d=c()(a.a.mark((function t(e,r,n){var o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r.image=r.image||{},r.image.type="data",t.next=4,n.parse(e,r,r.baseUri);case 4:return o=t.sent,t.abrupt("return",y(o,r.terrain));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var g=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},{id:"terrain",name:"Terrain",version:"2.2.0-alpha.2",extensions:["png","pngraw"],mimeType:"image/png",options:{terrain:{workerUrl:"https://unpkg.com/@loaders.gl/terrain@".concat("2.2.0-alpha.2","/dist/terrain-loader.worker.js"),meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0}}}},{parse:function(t,e,r){return d.apply(this,arguments)}}),m=r(3),b=r.n(m);function w(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(x(t))n.add(t);else if(x(t.buffer))n.add(t.buffer);else if(e&&"object"===b()(t))for(var o in t)w(t[o],e,n)}else;return void 0===r?Array.from(n):null}function x(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}var O="2.2.0-alpha.2";function j(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:O;!function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(t,"no loader provided");var r=t.version;e&&r&&(e=S(e),r=S(r))}function S(t){var e=t.split(".").map(Number);return{major:e[0],minor:e[1]}}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function L(t){return T.apply(this,arguments)}function T(){return(T=c()(a.a.mark((function t(e){var r,n,o,i,s,c,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arraybuffer,e.byteOffset,e.byteLength,o=e.options,i=e.context,!r.parseSync&&!r.parse){t.next=6;break}s=n,c=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}u=new TextDecoder,s=u.decode(n),c=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return o=P({},o,{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,c(s,P({},o),i,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function k(t,e){return t&&"parse"===t.type&&t.source&&t.source.startsWith("loaders.gl")}!function(t){if("undefined"!=typeof self){var e=0,r=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(o,i){var a=e++;self.addEventListener("message",(function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case"parse-done":self.removeEventListener("message",t),o(r.result);break;case"parse-error":self.removeEventListener("message",t),i(r.message)}})),self.postMessage({type:"parse",id:a,arraybuffer:t,options:r,url:n},[t])}))};self.onmessage=function(){var e=c()(a.a.mark((function e(n){var o,i,s,c,u,f,l,p,h,y;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.data,e.prev=1,k(o,t.name)){e.next=4;break}return e.abrupt("return");case 4:return j(t,o.source.split("@")[1]),i=o.arraybuffer,s=o.byteOffset,c=void 0===s?0:s,u=o.byteLength,f=void 0===u?0:u,l=o.options,p=void 0===l?{}:l,e.next=8,L({loader:t,arraybuffer:i,byteOffset:c,byteLength:f,options:p,context:{parse:r}});case 8:h=e.sent,y=w(h),self.postMessage({type:"done",result:h},y),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 16:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t){return e.apply(this,arguments)}}()}}(g)}]);
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=12)}([function(t,e,r){t.exports=r(6)},function(t,e){function r(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,s,"next",t)}function s(t){r(a,o,i,c,s,"throw",t)}c(void 0)}))}}},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e,r){var n=r(7),o=r(8),i=r(9),a=r(11);t.exports=function(t,e){return n(t)||o(t,e)||i(t,e)||a()}},,function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new O(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===u)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=s(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===u)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var u={};function f(){}function l(){}function p(){}var h={};h[o]=function(){return this};var d=Object.getPrototypeOf,y=d&&d(d(j([])));y&&y!==e&&r.call(y,o)&&(h=y);var v=p.prototype=f.prototype=Object.create(h);function g(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function m(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,u;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function j(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return l.prototype=v.constructor=p,p.constructor=l,p[a]=l.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},g(m.prototype),m.prototype[i]=function(){return this},t.AsyncIterator=m,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new m(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(v),v[a]="Generator",v[o]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=j,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(n=(a=c.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}}},function(t,e,r){var n=r(10);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e,r){"use strict";r.r(e);var n=r(2),o=r.n(n),i=r(0),a=r.n(i),c=r(1),s=r.n(c),u=r(4),f=r.n(u);class l{constructor(t=257){this.gridSize=t;const e=t-1;if(e&e-1)throw new Error(`Expected grid size to be 2^n+1, got ${t}.`);this.numTriangles=e*e*2-2,this.numParentTriangles=this.numTriangles-e*e,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(4*this.numTriangles);for(let t=0;t<this.numTriangles;t++){let r=t+2,n=0,o=0,i=0,a=0,c=0,s=0;for(1&r?i=a=c=e:n=o=s=e;(r>>=1)>1;){const t=n+i>>1,e=o+a>>1;1&r?(i=n,a=o,n=c,o=s):(n=i,o=a,i=c,a=s),c=t,s=e}const u=4*t;this.coords[u+0]=n,this.coords[u+1]=o,this.coords[u+2]=i,this.coords[u+3]=a}}createTile(t){return new p(t,this)}}class p{constructor(t,e){const r=e.gridSize;if(t.length!==r*r)throw new Error(`Expected terrain data of length ${r*r} (${r} x ${r}), got ${t.length}.`);this.terrain=t,this.martini=e,this.errors=new Float32Array(t.length),this.update()}update(){const{numTriangles:t,numParentTriangles:e,coords:r,gridSize:n}=this.martini,{terrain:o,errors:i}=this;for(let a=t-1;a>=0;a--){const t=4*a,c=r[t+0],s=r[t+1],u=r[t+2],f=r[t+3],l=c+u>>1,p=s+f>>1,h=l+p-s,d=p+c-l,y=(o[s*n+c]+o[f*n+u])/2,v=p*n+l,g=Math.abs(y-o[v]);if(i[v]=Math.max(i[v],g),a<e){const t=(s+d>>1)*n+(c+h>>1),e=(f+d>>1)*n+(u+h>>1);i[v]=Math.max(i[v],i[t],i[e])}}}getMesh(t=0){const{gridSize:e,indices:r}=this.martini,{errors:n}=this;let o=0,i=0;const a=e-1;function c(a,s,u,f,l,p){const h=a+u>>1,d=s+f>>1;Math.abs(a-l)+Math.abs(s-p)>1&&n[d*e+h]>t?(c(l,p,a,s,h,d),c(u,f,l,p,h,d)):(r[s*e+a]=r[s*e+a]||++o,r[f*e+u]=r[f*e+u]||++o,r[p*e+l]=r[p*e+l]||++o,i++)}r.fill(0),c(0,0,a,a,a,0),c(a,a,0,0,0,a);const s=new Uint16Array(2*o),u=new Uint32Array(3*i);let f=0;function l(o,i,a,c,p,h){const d=o+a>>1,y=i+c>>1;if(Math.abs(o-p)+Math.abs(i-h)>1&&n[y*e+d]>t)l(p,h,o,i,d,y),l(a,c,p,h,d,y);else{const t=r[i*e+o]-1,n=r[c*e+a]-1,l=r[h*e+p]-1;s[2*t]=o,s[2*t+1]=i,s[2*n]=a,s[2*n+1]=c,s[2*l]=p,s[2*l+1]=h,u[f++]=t,u[f++]=n,u[f++]=l}}return l(0,0,a,a,a,0),l(a,a,0,0,0,a),{vertices:s,triangles:u}}}function h(t){if(!t||!t.POSITION)return null;var e=1/0,r=1/0,n=1/0,o=-1/0,i=-1/0,a=-1/0,c=t.POSITION.value,s=c&&c.length;if(!s)return null;for(var u=0;u<s;u+=3){var f=c[u],l=c[u+1],p=c[u+2];e=f<e?f:e,r=l<r?l:r,n=p<n?p:n,o=f>o?f:o,i=l>i?l:i,a=p>a?p:a}return[[e,r,n],[o,i,a]]}function d(t,e){if(null===t)return null;var r=e.meshMaxError,n=e.bounds,o=e.elevationDecoder,i=t.data,a=t.width,c=a+1,s=function(t,e,r){for(var n=r.rScaler,o=r.bScaler,i=r.gScaler,a=r.offset,c=e+1,s=new Float32Array(c*c),u=0,f=0;f<e;f++)for(var l=0;l<e;l++,u++){var p=4*u,h=t[p+0],d=t[p+1],y=t[p+2];s[u+f]=h*n+d*i+y*o+a}for(var v=c*(c-1),g=0;g<c-1;g++,v++)s[v]=s[v-c];for(var m=c-1,b=0;b<c;b++,m+=c)s[m]=s[m-1];return s}(i,a,o),u=new l(c).createTile(s).getMesh(r),p=u.vertices,d=u.triangles,y=function(t,e,r,n){for(var o=r+1,i=t.length/2,a=new Float32Array(3*i),c=new Float32Array(2*i),s=n||[0,0,r,r],u=f()(s,4),l=u[0],p=u[1],h=u[2],d=u[3],y=(h-l)/r,v=(d-p)/r,g=0;g<i;g++){var m=t[2*g],b=t[2*g+1],w=b*o+m;a[3*g+0]=m*y+l,a[3*g+1]=-b*v+d,a[3*g+2]=e[w],c[2*g+0]=m/r,c[2*g+1]=b/r}return{POSITION:{value:a,size:3},TEXCOORD_0:{value:c,size:2}}}(p,s,a,n);return{loaderData:{header:{}},header:{vertexCount:d.length,boundingBox:h(y)},mode:4,indices:{value:d,size:1},attributes:y}}function y(){return(y=s()(a.a.mark((function t(e,r,n){var o;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r.image=r.image||{},r.image.type="data",t.next=4,n.parse(e,r,r.baseUri);case 4:return o=t.sent,t.abrupt("return",d(o,r.terrain));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?v(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var m=g(g({},{id:"terrain",name:"Terrain",version:"2.2.0-alpha.3",extensions:["png","pngraw"],mimeType:"image/png",options:{terrain:{workerUrl:"https://unpkg.com/@loaders.gl/terrain@".concat("2.2.0-alpha.3","/dist/terrain-loader.worker.js"),meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0}}}}),{},{parse:function(t,e,r){return y.apply(this,arguments)}}),b=r(3),w=r.n(b);function x(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(O(t))n.add(t);else if(O(t.buffer))n.add(t.buffer);else if(e&&"object"===w()(t))for(var o in t)x(t[o],e,n)}else;return void 0===r?Array.from(n):null}function O(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}function j(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function S(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"2.2.0-alpha.3";j(t,"no loader provided");var r=t.version;e&&r&&(e=E(e),r=E(r))}function E(t){var e=t.split(".").map(Number);return{major:e[0],minor:e[1]}}function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function L(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?P(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function T(t){return k.apply(this,arguments)}function k(){return(k=s()(a.a.mark((function t(e){var r,n,o,i,c,s,u;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arraybuffer,e.byteOffset,e.byteLength,o=e.options,i=e.context,!r.parseSync&&!r.parse){t.next=6;break}c=n,s=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}u=new TextDecoder,c=u.decode(n),s=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return o=L(L({},o),{},{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,s(c,L({},o),i,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _(t,e){return t&&"parse"===t.type&&t.source&&t.source.startsWith("loaders.gl")}!function(t){if("undefined"!=typeof self){var e=0,r=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(o,i){var a=e++;self.addEventListener("message",(function t(e){var r=e.data;if(r&&r.id===a)switch(r.type){case"parse-done":self.removeEventListener("message",t),o(r.result);break;case"parse-error":self.removeEventListener("message",t),i(r.message)}})),self.postMessage({type:"parse",id:a,arraybuffer:t,options:r,url:n},[t])}))};self.onmessage=function(){var e=s()(a.a.mark((function e(n){var o,i,c,s,u,f,l,p,h,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.data,e.prev=1,_(o,t.name)){e.next=4;break}return e.abrupt("return");case 4:return S(t,o.source.split("@")[1]),i=o.arraybuffer,c=o.byteOffset,s=void 0===c?0:c,u=o.byteLength,f=void 0===u?0:u,l=o.options,p=void 0===l?{}:l,e.next=8,T({loader:t,arraybuffer:i,byteOffset:s,byteLength:f,options:p,context:{parse:r}});case 8:h=e.sent,d=x(h),self.postMessage({type:"done",result:h},d),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 16:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t){return e.apply(this,arguments)}}()}}(m)}]);
{
"name": "@loaders.gl/terrain",
"version": "2.2.0-alpha.2",
"version": "2.2.0-alpha.3",
"description": "Framework-independent loader for terrain raster formats",

@@ -40,3 +40,3 @@ "license": "MIT",

},
"gitHead": "76d78ba514e077ce034cc45b73bdd1957e0788df"
"gitHead": "4a14e79ae0486151240fb18896c413edeb5b0b67"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc