define((function(){"use strict";return class{constructor(t,i){if(t.height!==t.width)throw new RangeError("DEM tiles must be square");if(i&&"mapbox"!==i&&"terrarium"!==i)return console.log(`"${i}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);const s=this.dim=t.height;this.stride=this.dim+2,this.data=new Int32Array(this.stride*this.stride);const e=t.data,r="terrarium"===i?this._unpackTerrarium:this._unpackMapbox;for(let t=0;t=this.dim+1||i<-1||i>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(i+1)*this.stride+(t+1)}_unpackMapbox(t,i,s){return(256*t*256+256*i+s)/10-1e4}_unpackTerrarium(t,i,s){return 256*t+i+s/256-32768}getPixels(){}backfillBorder(t,i,s){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let e=i*this.dim,r=i*this.dim+this.dim,h=s*this.dim,a=s*this.dim+this.dim;switch(i){case-1:e=r-1;break;case 1:r=e+1}switch(s){case-1:h=a-1;break;case 1:a=h+1}const d=-i*this.dim,n=-s*this.dim;for(let i=h;i