/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../core/maybe"],(function(t,e){"use strict";let i=function(){function t(t,i=null){if(this.tile=t,this.zmin=0,this.zmax=0,e.isSome(i)){const e=t.extent;this.samplerData={pixelData:i.values,width:i.width,height:i.height,safeWidth:.99999999*(i.width-1),noDataValue:i.noDataValue,dx:(i.width-1)/(e[2]-e[0]),dy:(i.width-1)/(e[3]-e[1]),x0:e[0],y1:e[3]},this.zmin=i.minValue,this.zmax=i.maxValue}}return t.prototype.sample=function(t,i){if(e.isNone(this.samplerData))return;const{safeWidth:n,width:o,pixelData:l,noDataValue:s,dx:h,dy:u,y1:r,x0:d}=this.samplerData,f=a(u*(r-i),0,n),m=a(h*(t-d),0,n),c=Math.floor(f),x=Math.floor(m),p=c*o+x,D=p+o,y=l[p],w=l[D],V=l[p+1],g=l[D+1];if(y!==s&&w!==s&&V!==s&&g!==s){const t=m-x,e=y+(V-y)*t;return e+(w+(g-w)*t-e)*(f-c)}},t}();function a(t,e,i){return t<e?e:t>i?i:t}t.ElevationTile=i,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
