Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

1060 lines
549 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
require({cache:{"esri/layers/mixins/ImageryTileMixin":function(){define("exports ../../chunks/tslib.es6 ../../geometry ../../rasterRenderers ../../request ../../core/deprecate ../../core/Error ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../geometry/support/spatialReferenceUtils ../support/arcgisLayerUrl ../support/commonProperties ../support/DimensionalDefinition ../support/MultidimensionalSubset ../support/RasterFunction ../support/RasterJobHandler ../support/TileInfo ../support/rasterDatasets/FunctionRaster ../support/rasterDatasets/multidimensionalUtils ../support/rasterFunctions/clipUtils ../support/rasterFunctions/rasterFunctionHelper ../support/rasterFunctions/rasterProjectionHelper ../support/rasterFunctions/stretchUtils ../support/rasterFunctions/vectorFieldUtils ../../renderers/support/rasterRendererHelper ../../renderers/support/RasterSymbolizer ../../rest/support/ImageHistogramParameters ../../views/2d/engine/flow/dataUtils ../../geometry/SpatialReference ../../geometry/Point".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h,n,l,A,t,r,a,f,d,e,c,k,q,u,G,y,C,H,x,M,L,N){m.ImageryTileMixin=E=>{function I(K){if(!K.raster||!K.serviceRasterInfo)throw new P("imagery-tile","no raster");}E=class extends E{constructor(...K){super(...K);this._isConstructedFromFunctionRaster=!1;this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null};this.copyright=this.bandIds=null;this.interpolation="nearest";this.symbolizer=this.spatialReference=this.sourceJSON=this.serviceRasterInfo=this.raster=
this.multidimensionalSubset=null;this._isConstructedFromFunctionRaster="Function"===K[0]?.raster?.datasetFormat}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(K){this._set("multidimensionalDefinition",K);this.updateRenderer()}set rasterFunction(K){"none"===K?.functionName?.toLowerCase()&&(K=void 0);this._set("rasterFunction",K);this.updateRasterFunction()}get rasterInfo(){R.deprecatedProperty(U.getLogger(this),"rasterInfo",{replacement:"serviceRasterInfo",version:"4.29",
warnOnce:!0});return this._get("serviceRasterInfo")}set url(K){this._set("url",l.sanitizeUrl(K,U.getLogger(this)))}set renderer(K){null==K&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("renderer",K),this.updateRenderer())}readRenderer(K,S,O){return J.read(S?.layerDefinition?.drawingInfo?.renderer,O)||void 0}async convertVectorFieldData(K,S){var {serviceRasterInfo:O}=this;if(null==K||!O)return null;const W=this._rasterJobHandler.instance;O=O.dataType;return W?W.convertVectorFieldData({pixelBlock:K,
dataType:O},S):y.convertVectorFieldData(K,O)}async computeStatisticsHistograms(K,S){await this.load(S);K=z.ensureClass(x,K).clone();var {serviceRasterInfo:O}=this;if(null==O)throw new P("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const {geometry:W}=K;if(null==W)throw new P("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");var Y=W;const {spatialReference:V}=O;W.spatialReference.equals(V)||(await u.load(),Y="extent"===W.type?
u.projectExtent(W,V):u.projectPolygon(W,V));K=K.pixelSize??new N({x:O.pixelSize.x,y:O.pixelSize.y,spatialReference:V});const {extent:B,width:Q,height:T}=k.snapToRaster(O,Y,K);O=await this.fetchPixels(B,Q,T,{...S,interpolation:"nearest"});if(null==O.pixelBlock)throw new P("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");Y=await k.clip(O.pixelBlock,B,Y);return(O=this._rasterJobHandler.instance)?O.computeStatisticsHistograms({pixelBlock:Y},S):G.computeStatisticsHistograms(Y)}async createFlowMesh(K,
S){const O=this._rasterJobHandler.instance;return O?O.createFlowMesh(K,S):M.createFlowMesh(K.meshType,K.simulationSettings,K.flowData,null!=S.signal?S.signal:(new AbortController).signal)}normalizeRasterFetchOptions(K){var {multidimensionalInfo:S}=this.serviceRasterInfo??{};if(null==S)return K;let O=K.multidimensionalDefinition||this.multidimensionalDefinition;O?.length||(O=c.getDefaultMultidimensionalDefinition(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));var W=K.timeExtent||
this.timeExtent;if(null!=O&&null!=W&&(null!=W.start||null!=W.end)){O=O.map(aa=>aa.clone());var Y=S.variables.find(({name:aa})=>aa===O[0].variableName)?.dimensions?.find(({name:aa})=>"StdTime"===aa);S=O.find(({dimensionName:aa})=>"StdTime"===aa);if(!Y||!S)return{...K,multidimensionalDefinition:null};const {start:V,end:B}=W;W=null==V?null:V.getTime();const Q=null==B?null:B.getTime(),T=W??Q,X=Q??W;if(null!=Y.values)Y=Y.values.filter(aa=>{if(Array.isArray(aa)){if(T===X)return aa[0]<=T&&aa[1]>=T;const Z=
aa[0]>=T&&aa[1]<=X||aa[0]<T&&aa[1]>X;return aa[0]<=T&&aa[1]>T||aa[0]<X&&aa[1]>=X||Z}return T===X?aa===T:aa>=T&&aa<=X}),Y.length?(Y=Y.sort((aa,Z)=>{const ba=Array.isArray(aa)?aa[0]:aa;aa=Array.isArray(aa)?aa[1]:aa;const ea=Array.isArray(Z)?Z[0]:Z;Z=Array.isArray(Z)?Z[1]:Z;return T===X?ba-ea:Math.abs(aa-X)-Math.abs(Z-X)})[0],S.values=[Y]):O=null;else if(Y.hasRegularIntervals&&Y.extent){const [aa,Z]=Y.extent;T>Z||X<aa?O=null:S.values=T===X?[T]:[Math.max(aa,T),Math.min(Z,X)]}}return null!=O&&c.hasExcludedVariableOrDimension(O,
this.multidimensionalSubset)?{...K,multidimensionalDefinition:null}:{...K,multidimensionalDefinition:O}}async updateRasterFunction(){if(this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson))if(this._isConstructedFromFunctionRaster&&"Function"===this.raster.datasetFormat){var K=this.raster.rasterFunction.toJSON();!this.rasterFunction&&K&&this._set("rasterFunction",a.fromJSON(K));
this._cachedRasterFunctionJson=this.rasterFunction?.toJSON()}else{var S=this.raster;K=!1;if("Function"===S.datasetFormat){var O=S.primaryRasters.rasters;S=O[0];K=!0}else O=[S];var {rasterFunction:W}=this;if(W){const V={raster:S};1<O.length&&O.forEach(B=>V[B.url]=B);S=q.create(W.functionDefinition?.toJSON()??W.toJSON(),V);S=new e({rasterFunction:S});S.rasterJobHandler=this._rasterJobHandler.instance;await S.open();this._cachedRasterFunctionJson=this.rasterFunction?.toJSON();this.raster=S}else this.raster=
S,this._cachedRasterFunctionJson=null,await S.when();this._cachedRendererJson=null;if(K||W){({bandIds:K}=this);var {bandCount:Y}=this.raster.rasterInfo;W=K?.length?K.some(V=>V>=Y):3<=Y;K&&(W||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null);this._configDefaultRenderer("auto")}}}async updateRenderer(){const {loaded:K,symbolizer:S}=this;if(K&&S&&this.renderer){var {rasterInfo:O}=this.raster,W=c.getDefaultVariableInfo(O,{multidimensionalDefinition:this.multidimensionalDefinition,
multidimensionalSubset:this.multidimensionalSubset})?.name,Y=C.normalizeRendererJSON({...this.renderer.toJSON(),variableName:W});if(JSON.stringify(this._cachedRendererJson)!==JSON.stringify(Y)){var V=this._rasterJobHandler.instance;V&&(S.rasterInfo=C.getVariableRasterInfo(O,W),S.rendererJSON=Y,S.bind(),await V.updateSymbolizer(S),this._cachedRendererJson=Y)}}}async applyRenderer(K,S){var O=K?.pixelBlock;if(!(null!=O&&O.pixels&&0<O.pixels.length))return null;await this.updateRenderer();O=this._rasterJobHandler.instance;
const W=this.bandIds??[];return O?await O.symbolize({...K,simpleStretchParams:S,bandIds:W}):this.symbolizer.symbolize({...K,simpleStretchParams:S,bandIds:W})}getTileUrl(K,S,O){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${K}/${S}/${O}`:""}getCompatibleTileInfo(K,S,O=!1){if(!this.loaded||null==S)return null;if(O&&K.equals(this.spatialReference))return this.tileInfo;O=n.getInfo(K);return d.create({size:256,spatialReference:K,origin:O?{x:O.origin[0],y:O.origin[1]}:{x:S.xmin,
y:S.ymax}})}getCompatibleFullExtent(K){return this.loaded?this._compatibleFullExtent?.spatialReference.equals(K)?this._compatibleFullExtent:this._compatibleFullExtent=this.raster.computeExtent(K):null}async fetchTile(K,S,O,W={}){I(this);if(W.requestAsImageElement)return K=this.getTileUrl(K,S,O),F(K,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:W.signal}).then(V=>V.data);const {serviceRasterInfo:Y}=this;if(null!=Y.multidimensionalInfo&&
(W=this.normalizeRasterFetchOptions(W),null==W.multidimensionalDefinition))return{extent:this.raster.getTileExtentFromTileInfo(K,S,O,W.tileInfo||Y.storageInfo.tileInfo),pixelBlock:null};await this._initJobHandler();await this.updateRasterFunction();"raster-shaded-relief"===this.renderer?.type&&(W={...W,buffer:{cols:1,rows:1}});return this.raster.fetchTile(K,S,O,W)}async fetchPixels(K,S,O,W={}){if(null!=this.serviceRasterInfo.multidimensionalInfo&&(W=this.normalizeRasterFetchOptions(W),null==W.multidimensionalDefinition))return{extent:K,
pixelBlock:null};await this._initJobHandler();await this.updateRasterFunction();S=Math.round(S);O=Math.round(O);return this.raster.fetchPixels(K,S,O,W)}async identify(K,S={}){await this.load();const {raster:O,serviceRasterInfo:W}=this;if(!(null==W?.multidimensionalInfo||W.hasMultidimensionalTranspose&&(c.isMultiSliceOrRangeDefinition(S.multidimensionalDefinition)||S.transposedVariableName||S.timeExtent))&&(S=this.normalizeRasterFetchOptions(S),null==S.multidimensionalDefinition))return{location:K,
value:null};const Y=this.multidimensionalSubset?.areaOfInterest;if(Y&&!Y.contains(K))throw new P("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return O.identify(K,S)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--;0>=this._rasterJobHandler.refCount&&this._shutdownJobHandler()}hasStandardTime(){const K=this.serviceRasterInfo?.multidimensionalInfo;
if(null==K||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const S=this.multidimensionalDefinition,O=S?.[0]?.variableName;return K.variables.some(W=>W.name===O&&(!S?.[0].dimensionName||W.dimensions.some(Y=>"StdTime"===Y.name)))}getStandardTimeValue(K){return(new Date(864E5*(K-25569))).toString()}getMultidimensionalSubsetVariables(K){return c.getSubsetVariablesFromMdInfo(this.multidimensionalSubset,K??this.serviceRasterInfo?.multidimensionalInfo)}_configDefaultSettings(){this._configDefaultInterpolation();
this.multidimensionalDefinition||(this.multidimensionalDefinition=c.getDefaultMultidimensionalDefinition(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));this.rasterFunction&&"Function"===this.raster.datasetFormat&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON());this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const K=new f;this._rasterJobHandler.connectionPromise=
K.initialize().then(async()=>{I(this);this._rasterJobHandler.instance=K;this.raster.rasterJobHandler=K;"Function"===this.raster.datasetFormat&&this.raster.syncJobHandler();this.rasterFunction&&await this.updateRasterFunction().catch(()=>{});this.renderer&&this.updateRenderer()}).catch(()=>{});return this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy();this._rasterJobHandler.instance=null;this._rasterJobHandler.connectionPromise=
null;this._rasterJobHandler.refCount=0;this._cachedRendererJson=null;this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){if(null==this.interpolation){I(this);var {raster:K}=this;K=C.getDefaultInterpolation(K.rasterInfo,K.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",K)}}_configDefaultRenderer(K="no"){I(this);var {rasterInfo:S}=this.raster;!this.bandIds&&1<S.bandCount&&(this.bandIds=C.getDefaultBandCombination(S));var O=c.getDefaultVariableInfo(S,
{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset})?.name,W=C.getFunctionColorramp(this.raster);if(!this.renderer||"override"===K){W=C.createDefaultRenderer(S,{bandIds:this.bandIds,variableName:O,rasterFunctionColorRamp:W});var Y=S.statistics;Y=Y&&0<Y.length?Y[0]:null;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===W.type&&(1E24<(Y?.max??0)||-1E24>(Y?.min??0))&&(W.dynamicRangeAdjustment=!0,W.statistics=null,"none"===W.stretchType&&
(W.stretchType="min-max"));this.renderer=W}W=C.normalizeRendererJSON({...this.renderer.toJSON(),variableName:O});S=C.getVariableRasterInfo(S,O);this.symbolizer?(this.symbolizer.rendererJSON=W,this.symbolizer.rasterInfo=S):this.symbolizer=new H({rendererJSON:W,rasterInfo:S});S=this.symbolizer.bind();S.success?"auto"===K&&({colormap:S}=this.raster.rasterInfo,K=this.renderer,null!=S&&"raster-colormap"===K.type?(S=C.createDefaultRenderer(this.raster.rasterInfo),JSON.stringify(S)!==JSON.stringify(K)&&
this._configDefaultRenderer("override")):"raster-stretch"===K.type&&(S=this.bandIds?.length,O=K.statistics?.length,!K.dynamicRangeAdjustment&&O&&S&&O!==S&&this._configDefaultRenderer("override"))):(U.getLogger(this).warn("imagery-tile-mixin",S.error||"The given renderer is not supported by the layer."),"auto"===K&&this._configDefaultRenderer("override"))}};w.__decorate([D.property({clonable:!1})],E.prototype,"_cachedRendererJson",void 0);w.__decorate([D.property({clonable:!1})],E.prototype,"_cachedRasterFunctionJson",
void 0);w.__decorate([D.property({clonable:!1})],E.prototype,"_compatibleFullExtent",void 0);w.__decorate([D.property({clonable:!1})],E.prototype,"_isConstructedFromFunctionRaster",void 0);w.__decorate([D.property({clonable:!1})],E.prototype,"_rasterJobHandler",void 0);w.__decorate([D.property()],E.prototype,"bandIds",void 0);w.__decorate([D.property({json:{origins:{service:{read:{source:"copyrightText"}}}}})],E.prototype,"copyright",void 0);w.__decorate([D.property({json:{read:!1}})],E.prototype,
"fullExtent",null);w.__decorate([D.property()],E.prototype,"interpolation",void 0);w.__decorate([D.property()],E.prototype,"ioConfig",void 0);w.__decorate([D.property({type:[t],json:{write:!0}})],E.prototype,"multidimensionalDefinition",null);w.__decorate([D.property({type:r,json:{write:!0}})],E.prototype,"multidimensionalSubset",void 0);w.__decorate([D.property()],E.prototype,"raster",void 0);w.__decorate([D.property({type:a,json:{name:"renderingRule",write:!0}})],E.prototype,"rasterFunction",null);
w.__decorate([D.property({readOnly:!0})],E.prototype,"rasterInfo",null);w.__decorate([D.property()],E.prototype,"serviceRasterInfo",void 0);w.__decorate([D.property()],E.prototype,"sourceJSON",void 0);w.__decorate([D.property({readOnly:!0,type:L,json:{read:!1}})],E.prototype,"spatialReference",void 0);w.__decorate([D.property({type:d})],E.prototype,"tileInfo",void 0);w.__decorate([D.property(A.url)],E.prototype,"url",null);w.__decorate([D.property({types:J.rasterRendererTypes,json:{name:"layerDefinition.drawingInfo.renderer",
write:{overridePolicy(){const K="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!K}}},origins:{"web-scene":{types:J.websceneRasterRendererTypes,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(K){return{enabled:K&&"vector-field"!==K.type&&"flow"!==K.type}}}}}}})],E.prototype,"renderer",null);w.__decorate([g.reader("renderer")],E.prototype,"readRenderer",null);w.__decorate([D.property({clonable:!1})],
E.prototype,"symbolizer",void 0);return E=w.__decorate([h.subclass("esri.layers.mixins.ImageryTileMixin")],E)};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/rasterRenderers":function(){define("exports ./core/Warning ./renderers/ClassBreaksRenderer ./renderers/FlowRenderer ./renderers/RasterColormapRenderer ./renderers/RasterShadedReliefRenderer ./renderers/RasterStretchRenderer ./renderers/UniqueValueRenderer ./renderers/VectorFieldRenderer".split(" "),function(m,w,v,J,F,R,
P,U,D){function z(h,n){if(!h)return null;if("classBreaks"===h.type&&h.classificationMethod){var l=h.authoringInfo||{classificationMethod:""};l.classificationMethod=h.classificationMethod;h.authoringInfo=l}"vectorField"===h.type&&h.visualVariables&&!Array.isArray(h.visualVariables)&&(h.visualVariables=[h.visualVariables]);l=h?g[h.type]||null:null;if(l)return l=new l,l.read(h,n),l;n?.messages&&h&&n.messages.push(new w("renderer:unsupported","Renderers of type '"+(h.type||"unknown")+"' are not supported",
{definition:h,context:n}));return null}const p={key:"type",base:null,typeMap:{"unique-value":U,"class-breaks":v,"raster-colormap":F,"raster-stretch":P,"vector-field":D,"raster-shaded-relief":R,flow:J}},b={...p,typeMap:{...p.typeMap}};delete b.typeMap["vector-field"];delete b.typeMap.flow;const g={uniqueValue:U,classBreaks:v,rasterStretch:P,rasterColormap:F,vectorField:D,rasterShadedRelief:R,flowRenderer:J};m.ClassBreaksRenderer=v;m.FlowRenderer=J;m.RasterColormapRenderer=F;m.RasterShadedReliefRenderer=
R;m.RasterStretchRenderer=P;m.UniqueValueRenderer=U;m.VectorFieldRenderer=D;m.fromJSON=function(h,n){return z(h,n)};m.rasterRendererTypes=p;m.read=z;m.websceneRasterRendererTypes=b;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/renderers/FlowRenderer":function(){define("../chunks/tslib.es6 ../Color ../core/jsonMap ../core/JSONSupport ../core/screenUtils ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/enumeration ../core/accessorSupport/decorators/subclass ./mixins/VisualVariablesMixin ./support/AuthoringInfo ./support/LegendOptions".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h){var n;v=new v.JSONMap({flow_from:"flow-from",flow_to:"flow-to"});J=n=class extends b.VisualVariablesMixin(J.JSONSupport){constructor(l){super(l);this.density=.8;this.color=new w([255,255,255,1]);this.maxPathLength=200;this.trailWidth=1.5;this.flowSpeed=10;this.trailLength=100;this.smoothing=0;this.flowRepresentation="flow-from";this.type="flow";this.legendOptions=this.authoringInfo=null;this.trailCap="butt";this.background="none"}clone(){const {density:l,maxPathLength:A,
trailWidth:t,flowSpeed:r,trailLength:a,smoothing:f,flowRepresentation:d,trailCap:e,background:c}=this,k=this.color.clone(),q=(this.visualVariables||[]).map(y=>y.clone()),u=this.authoringInfo?.clone(),G=this.legendOptions?.clone();return new n({density:l,color:k,maxPathLength:A,trailWidth:t,flowSpeed:r,trailLength:a,trailCap:e,background:c,smoothing:f,flowRepresentation:d,visualVariables:q,authoringInfo:u,legendOptions:G})}getSymbol(l,A){}async getSymbolAsync(l,A){}getSymbols(){return[]}};m.__decorate([R.property({type:Number,
json:{write:!0}})],J.prototype,"density",void 0);m.__decorate([R.property({type:w,json:{write:{allowNull:!0}}})],J.prototype,"color",void 0);m.__decorate([R.property({type:Number,cast:F.toPt,json:{write:!0}})],J.prototype,"maxPathLength",void 0);m.__decorate([R.property({type:Number,cast:F.toPt,json:{write:!0}})],J.prototype,"trailWidth",void 0);m.__decorate([R.property({type:Number,json:{write:!0}})],J.prototype,"flowSpeed",void 0);m.__decorate([R.property({type:Number,json:{write:!0}})],J.prototype,
"trailLength",void 0);m.__decorate([R.property({type:Number,cast:F.toPt,json:{write:!1}})],J.prototype,"smoothing",void 0);m.__decorate([R.property({type:v.apiValues,json:{type:v.jsonValues,read:{reader:v.read},write:{writer:v.write}}})],J.prototype,"flowRepresentation",void 0);m.__decorate([z.enumeration({flowRenderer:"flow"})],J.prototype,"type",void 0);m.__decorate([R.property({type:g,json:{write:!0}})],J.prototype,"authoringInfo",void 0);m.__decorate([R.property({type:h.LegendOptions,json:{write:!0}})],
J.prototype,"legendOptions",void 0);m.__decorate([R.property({type:String,json:{write:!0}})],J.prototype,"trailCap",void 0);m.__decorate([R.property({type:String,json:{write:!0}})],J.prototype,"background",void 0);return J=n=m.__decorate([p.subclass("esri.renderers.FlowRenderer")],J)})},"esri/renderers/RasterColormapRenderer":function(){define("../chunks/tslib.es6 ../core/JSONSupport ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/enumeration ../core/accessorSupport/decorators/subclass ./support/ColormapInfo ./support/colorRampUtils".split(" "),
function(m,w,v,J,F,R,P,U,D,z){var p;w=p=class extends w.JSONSupport{constructor(b){super(b);this.colormapInfos=null;this.type="raster-colormap"}static createFromColormap(b,g){if(!b)return null;const h=5===b[0].length;b=[...b].sort((n,l)=>n[0]-l[0]).map(n=>D.fromJSON({value:n[0],color:h?n.slice(1,5):n.slice(1,4).concat([255]),label:g?g[n[0]]??"":n[0]}));return new p({colormapInfos:b})}static createFromColorramp(b){b=z.convertColorRampToColormap(b);return p.createFromColormap(b)}clone(){return new p({colormapInfos:this.colormapInfos.map(b=>
b.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:b,color:g})=>[b,g.r,g.g,g.b,1<g.a?g.a:255*g.a&255]).sort((b,g)=>b[0]-g[0])}};m.__decorate([v.property({type:[D],json:{write:!0}})],w.prototype,"colormapInfos",void 0);m.__decorate([P.enumeration({rasterColormap:"raster-colormap"})],w.prototype,"type",void 0);return w=p=m.__decorate([U.subclass("esri.renderers.RasterColormapRenderer")],w)})},"esri/renderers/support/ColormapInfo":function(){define("../../chunks/tslib.es6 ../../Color ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/subclass".split(" "),
function(m,w,v,J,F,R,P,U){v=class extends v.JSONSupport{constructor(){super(...arguments);this.color=this.label=this.value=null}};m.__decorate([J.property({type:Number,json:{write:!0}})],v.prototype,"value",void 0);m.__decorate([J.property({type:String,json:{write:!0}})],v.prototype,"label",void 0);m.__decorate([J.property({type:w,json:{type:[F.Integer],write:!0}})],v.prototype,"color",void 0);return v=m.__decorate([U.subclass("esri.renderers.support.ColormapInfo")],v)})},"esri/renderers/support/colorRampUtils":function(){define(["exports",
"../../Color","../../core/colorUtils","../../core/jsonMap","../../core/JSONSupport"],function(m,w,v,J,F){function R(a,f){if(!a||!f||a.length!==f.length)return!1;for(let d=0;d<a.length;d++)if(a[d]>f[d]+2||a[d]<f[d]-2)return!1;return!0}function P(a){const f=a.clone();f.fromColor=a.toColor;f.toColor=a.fromColor;f.algorithm=a.algorithm;return f}function U(a){if("multipart"===a.type){a=a.clone();if(!a.colorRamps?.length)return a;a.colorRamps=a.colorRamps.reverse().map(f=>P(f));return a}return P(a)}function D(a,
f){if(a){f=f??t;var d=null;"algorithmic"===a.type?f.some(e=>{if(R(a.fromColor.toRgb(),e.fromColor)&&R(a.toColor.toRgb(),e.toColor))return d=e.id,!0}):"multipart"===a.type&&f.some(e=>{const c=a.colorRamps,k=e.colorRamps;if(c&&k&&c.length===k.length&&!k.some((q,u)=>{if(!R(c[u].fromColor.toRgb(),(new w(q.fromColor)).toRgb())||!R(c[u].toColor.toRgb(),(new w(q.toColor)).toRgb()))return!0})){if(d)return!0;d=e.id}});return d}}function z(a,f,d=!1){if(a){var e=!1,c=D(a,f);null!=c||d||(e=!0,a=U(a),c=D(a,f));
return c?{id:c,inverted:e}:void 0}}function p(a,f=!1){return(a="string"===typeof a?a:z(a,void 0,f)?.id)?r.toJSON(a):null}function b(a){a=a||{};const f=a.numColors||256;return{...a,numColors:f,distanceOffset:a.distanceOffset||0,interpolateAlpha:!!a.interpolateAlpha,distanceInterval:a.distanceInterval||1/(f-1),isCustomInterval:null!=a.isCustomInterval?a.isCustomInterval:null!==a.distanceInterval&&a.distanceInterval!==1/(f-1),weights:a.weights}}function g(a,f){let {fromColor:d,toColor:e}=a;d=[...d];
e=[...e];3===d.length&&(d=d.concat([255]));3===e.length&&(e=e.concat([255]));a=a.algorithm||"esriCIELabAlgorithm";var c=b(f);const {numColors:k,distanceOffset:q,isCustomInterval:u,interpolateAlpha:G}=c;if(1===k&&0===q)return[d];if(2===k&&0===q&&!u)return[d,e];var y={r:d[0],g:d[1],b:d[2]};f={r:e[0],g:e[1],b:e[2]};if("esriCIELabAlgorithm"===a){a=v.toLAB(y);f=v.toLAB(f);const {numColors:M,distanceOffset:L,distanceInterval:N,isCustomInterval:E}=c;let {l:I,a:K,b:S}=a;a=(f.l-I)*N;y=(f.a-K)*N;c=(f.b-S)*
N;var C=[];if(L){var H=L/N;I+=H*a;K+=H*y;S+=H*c}for(H=0;H<M-1;H++)C.push({l:I,a:K,b:S}),I+=a,K+=y,S+=c;C.push(E?{l:I,a:K,b:S}:f);f=C}else if("esriHSVAlgorithm"===a){a=v.toHSV(y);f=v.toHSV(f);const {numColors:M,distanceOffset:L,distanceInterval:N,isCustomInterval:E}=c;C=0===a.s;H=0===f.s;y=a.h;c=f.h;C&&!H?y=c:H&&!C&&(f={...f,h:y},c=y);C=Math.abs(c-y);180>C?c=(c-y)*N:(C=360-C,c=y>c?C*N:-C*N);C=(f.s-a.s)*N;H=(f.v-a.v)*N;let {s:I,v:K}=a;a=y;L&&(y=L/N,a=(a+y*c+360)%360,I+=y*C,K+=y*H);y=[];for(var x=0;x<
M-1;x++)y.push({h:a,s:I,v:K}),a=(a+c+360)%360,I+=C,K+=H;y.push(E?{h:a,s:I,v:K}:f);f=y}else{y=v.toLCH(y);f=v.toLCH(f);const {numColors:M,distanceOffset:L,distanceInterval:N,isCustomInterval:E}=c;c=y.h;C=f.h;a=2*Math.PI;c<=C?(H=C-c,c=C-c-a,c=Math.abs(c)<Math.abs(H)?c:H):(H=C+a-c,c=C-c,c=Math.abs(c)<Math.abs(H)?c:H);c*=N;C=(f.l-y.l)*N;H=(f.c-y.c)*N;let {l:I,c:K,h:S}=y;L&&(y=L/N,I+=y*C,K+=y*H,S=(S+y*c+a)%a);y=[];for(x=0;x<M-1;x++)y.push({l:I,c:K,h:S}),I+=C,K+=H,S=(S+c+a)%a;y.push(E?{l:I,c:K,h:S}:f);f=
y}a=[];y=d[3]??255;c=((e[3]??255)-y)/(k-1);for(C=0;C<k;C++){const {r:M,g:L,b:N}=v.toRGB(f[C]);a.push([M,L,N,G?Math.round(y+c*C):255])}return a}function h(a,f){const {numColors:d,interpolateAlpha:e}=b(f);f=f?.weights;({colorRamps:a}=a);if(f){const C=f.reduce((H,x)=>H+x);f=f.map(H=>H/C)}else{f=[];for(var c=0;c<a.length;c++)f[c]=1/a.length}c=[];const k=1/(d-1);let q=0,u=!1;for(let C=0;C<a.length;C++){var G=c.length,y=u?0:G*k-q;q+=f[C];G=C===a.length-1?d-1-G:(f[C]-y)/k;u=Math.ceil(G)===G;G=Math.ceil(G);
0!==G&&(y=g(a[C],{numColors:G,interpolateAlpha:e,distanceOffset:y/f[C],distanceInterval:k/f[C]}),c.push(...y))}f=[...a[a.length-1].toColor];3===f.length&&f.push(255);c.push(f);return c}function n(a,f){a=F.isSerializable(a)?a.toJSON():a;return"multipart"===a.type?h(a,f):g(a,f)}function l(a){a=v.toHSV(a);return{type:"HsvColor",Hue:a.h,Saturation:a.s,Value:a.v,AlphaValue:255}}function A(a){return{Algorithm:a.toJSON()?.Algorithm||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",FromColor:l(a.fromColor),
ToColor:l(a.toColor)}}const t=[{id:"aspect",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"black-to-white",fromColor:[0,
0,0],toColor:[255,255,255]},{id:"blue-bright",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blue-light-to-dark",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blue-green-bright",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blue-green-light-to-dark",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brown-light-to-dark",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brown-to-blue-green-diverging-right",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,
255,191],toColor:[33,130,145]}]},{id:"brown-to-blue-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficient-bias",fromColor:[214,214,255],toColor:[0,57,148]},{id:"cold-to-hot-diverging",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"condition-number",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,
255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyan-to-purple",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyan-light-to-blue-dark",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,
255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,
96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors",fromColor:[255,235,214],toColor:[196,10,10]},{id:"gray-light-to-dark",fromColor:[219,219,219],toColor:[69,69,69]},{id:"green-bright",fromColor:[204,255,204],toColor:[14,204,14]},{id:"green-light-to-dark",fromColor:[220,245,233],toColor:[34,102,51]},{id:"green-to-blue",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,
242],toColor:[2,33,227]}]},{id:"orange-bright",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orange-light-to-dark",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partial-spectrum",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partial-spectrum-1-diverging",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},
{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partial-spectrum-2-diverging",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pink-to-yellow-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},
{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pink-to-yellow-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction",type:"multipart",
colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purple-bright",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purple-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purple-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purple-blue-bright",
fromColor:[223,184,230],toColor:[112,12,242]},{id:"purple-blue-light-to-dark",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purple-red-bright",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purple-red-light-to-dark",fromColor:[250,215,246],toColor:[143,17,57]},{id:"red-bright",fromColor:[255,204,204],toColor:[219,0,0]},{id:"red-light-to-dark",fromColor:[255,224,224],toColor:[143,10,10]},{id:"red-to-blue-diverging-bright",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},
{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"red-to-blue-diverging-dark",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"red-to-green",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"red-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"red-to-green-diverging-dark",
type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrum-full-bright",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrum-full-dark",type:"multipart",colorRamps:[{fromColor:[153,
0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrum-full-light",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},
{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"white-to-black",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellow-to-dark-red",type:"multipart",
colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellow-to-green-to-dark-blue",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellow-to-red",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellow-green-bright",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellow-green-light-to-dark",fromColor:[215,240,175],toColor:[96,
107,45]}],r=new J.JSONMap({Aspect:"aspect","Black to White":"black-to-white","Blue Bright":"blue-bright","Blue Light to Dark":"blue-light-to-dark","Blue-Green Bright":"blue-green-bright","Blue-Green Light to Dark":"blue-green-light-to-dark","Brown Light to Dark":"brown-light-to-dark","Brown to Blue Green Diverging, Bright":"brown-to-blue-green-diverging-right","Brown to Blue Green Diverging, Dark":"brown-to-blue-green-diverging-dark","Coefficient Bias":"coefficient-bias","Cold to Hot Diverging":"cold-to-hot-diverging",
"Condition Number":"condition-number","Cyan to Purple":"cyan-to-purple","Cyan-Light to Blue-Dark":"cyan-light-to-blue-dark",Distance:"distance","Elevation #1":"elevation1","Elevation #2":"elevation2",Errors:"errors","Gray Light to Dark":"gray-light-to-dark","Green Bright":"green-bright","Green Light to Dark":"green-light-to-dark","Green to Blue":"green-to-blue","Orange Bright":"orange-bright","Orange Light to Dark":"orange-light-to-dark","Partial Spectrum":"partial-spectrum","Partial Spectrum 1 Diverging":"partial-spectrum-1-diverging",
"Partial Spectrum 2 Diverging":"partial-spectrum-2-diverging","Pink to YellowGreen Diverging, Bright":"pink-to-yellow-green-diverging-bright","Pink to YellowGreen Diverging, Dark":"pink-to-yellow-green-diverging-dark",Precipitation:"precipitation",Prediction:"prediction","Purple Bright":"purple-bright","Purple to Green Diverging, Bright":"purple-to-green-diverging-bright","Purple to Green Diverging, Dark":"purple-to-green-diverging-dark","Purple-Blue Bright":"purple-blue-bright","Purple-Blue Light to Dark":"purple-blue-light-to-dark",
"Purple-Red Bright":"purple-red-bright","Purple-Red Light to Dark":"purple-red-light-to-dark","Red Bright":"red-bright","Red Light to Dark":"red-light-to-dark","Red to Blue Diverging, Bright":"red-to-blue-diverging-bright","Red to Blue Diverging, Dark":"red-to-blue-diverging-dark","Red to Green":"red-to-green","Red to Green Diverging, Bright":"red-to-green-diverging-bright","Red to Green Diverging, Dark":"red-to-green-diverging-dark",Slope:"slope","Spectrum-Full Bright":"spectrum-full-bright","Spectrum-Full Dark":"spectrum-full-dark",
"Spectrum-Full Light":"spectrum-full-light",Surface:"surface",Temperature:"temperature","White to Black":"white-to-black","Yellow to Dark Red":"yellow-to-dark-red","Yellow to Green to Dark Blue":"yellow-to-green-to-dark-blue","Yellow to Red":"yellow-to-red","Yellow-Green Bright":"yellow-green-bright","Yellow-Green Light to Dark":"yellow-green-light-to-dark"});m.colorRampDict=r;m.convertColorRampToColormap=function(a,f){a=n(a,f);const d=f?.interpolateAlpha;a.forEach((e,c)=>{e.unshift(c);d||e.pop()});
return a};m.convertColorRampToColors=n;m.convertRGBATo32Bit=function(a){a=a.reverse().map(f=>{f=f.toString(16);return 2>f.length?"0"+f:f});return 4294967295&Number.parseInt(a.join(""),16)};m.getColorRampId=z;m.getColorRampJSON=function(a,f="esriCIELabAlgorithm"){const d=t.find(({id:e})=>e===a);return d?d.colorRamps?{type:"multipart",colorRamps:d.colorRamps.map(e=>({type:"algorithmic",algorithm:f,fromColor:[...e.fromColor],toColor:[...e.toColor]}))}:{type:"algorithmic",algorithm:f,fromColor:[...d.fromColor],
toColor:[...d.toColor]}:null};m.getColorRampName=p;m.getRFxArgColorRampValue=function(a){const f=p(a);return f?"algorithmic"===a.type?{...A(a),Name:f}:a.colorRamps?(a=a.colorRamps.map(A),{type:"MultiPartColorRamp",NumColorRamps:a.length,ArrayOfColorRamp:a,Name:f}):null:null};m.predefinedJsonColorRamps=t;m.rasterColormapNames="random ndvi ndvi2 ndvi3 elevation gray hillshade".split(" ");Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/renderers/RasterShadedReliefRenderer":function(){define("../chunks/tslib.es6 ../core/JSONSupport ../core/lang ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/accessorSupport/decorators/enumeration ../core/accessorSupport/decorators/reader ../core/accessorSupport/decorators/subclass ../rest/support/colorRamps".split(" "),
function(m,w,v,J,F,R,P,U,D,z){var p;w=p=class extends w.JSONSupport{constructor(b){super(b);this.altitude=45;this.azimuth=315;this.colorRamp=null;this.hillshadeType="traditional";this.pixelSizePower=.664;this.pixelSizeFactor=.024;this.scalingType="none";this.type="raster-shaded-relief";this.zFactor=1}readColorRamp(b){return z.fromJSON(b)}clone(){return new p({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,
pixelSizePower:this.pixelSizePower,colorRamp:v.clone(this.colorRamp)})}};m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"altitude",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"azimuth",void 0);m.__decorate([J.property({types:z.types,json:{write:!0}})],w.prototype,"colorRamp",void 0);m.__decorate([U.reader("colorRamp")],w.prototype,"readColorRamp",null);m.__decorate([J.property({type:["traditional","multi-directional"],json:{write:!0}})],w.prototype,
"hillshadeType",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"pixelSizePower",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"pixelSizeFactor",void 0);m.__decorate([J.property({type:["none","adjusted"],json:{write:!0}})],w.prototype,"scalingType",void 0);m.__decorate([P.enumeration({rasterShadedRelief:"raster-shaded-relief"})],w.prototype,"type",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"zFactor",void 0);
return w=p=m.__decorate([D.subclass("esri.renderers.RasterShadedReliefRenderer")],w)})},"esri/renderers/RasterStretchRenderer":function(){define("../chunks/tslib.es6 ../core/JSONSupport ../core/lang ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/accessorSupport/decorators/enumeration ../core/accessorSupport/decorators/reader ../core/accessorSupport/decorators/subclass ../core/accessorSupport/decorators/writer ./support/stretchRendererUtils ../rest/support/colorRamps".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b){var g;w=g=class extends w.JSONSupport{constructor(h){super(h);this.colorRamp=null;this.dynamicRangeAdjustment=this.computeGamma=!1;this.gamma=[];this.sigmoidStrengthLevel=this.outputMin=this.outputMax=this.numberOfStandardDeviations=this.minPercent=this.maxPercent=null;this.statistics=[];this.histograms=null;this.useGamma=!1;this.stretchType="none";this.type="raster-stretch"}readColorRamp(h){if(h)return b.fromJSON(h)}writeStatistics(h,n,l){h?.length&&(Array.isArray(h[0])||
(h=h.map(A=>[A.min,A.max,A.avg,A.stddev])),n[l]=h)}readStretchType(h,n){h=n.stretchType;"number"===typeof h&&(h=p.stretchTypeFunctionEnum[h]);return p.stretchTypeJSONDict.read(h)}clone(){return new g({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:v.clone(this.statistics),gamma:v.clone(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,
minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:v.clone(this.colorRamp),histograms:v.clone(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};m.__decorate([J.property({types:b.types,json:{write:!0}})],w.prototype,"colorRamp",void 0);m.__decorate([U.reader("colorRamp")],w.prototype,"readColorRamp",null);m.__decorate([J.property({type:Boolean,json:{write:!0}})],w.prototype,"computeGamma",void 0);m.__decorate([J.property({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],
w.prototype,"dynamicRangeAdjustment",void 0);m.__decorate([J.property({type:[Number],json:{write:!0}})],w.prototype,"gamma",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"maxPercent",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"minPercent",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"numberOfStandardDeviations",void 0);m.__decorate([J.property({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],
w.prototype,"outputMax",void 0);m.__decorate([J.property({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],w.prototype,"outputMin",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"sigmoidStrengthLevel",void 0);m.__decorate([J.property({json:{type:[[Number]],write:!0}})],w.prototype,"statistics",void 0);m.__decorate([J.property()],w.prototype,"histograms",void 0);m.__decorate([z.writer("statistics")],w.prototype,"writeStatistics",null);m.__decorate([J.property({type:Boolean,
json:{write:!0}})],w.prototype,"useGamma",void 0);m.__decorate([J.property({type:p.stretchTypeJSONDict.apiValues,json:{type:p.stretchTypeJSONDict.jsonValues,write:p.stretchTypeJSONDict.write}})],w.prototype,"stretchType",void 0);m.__decorate([U.reader("stretchType",["stretchType"])],w.prototype,"readStretchType",null);m.__decorate([P.enumeration({rasterStretch:"raster-stretch"})],w.prototype,"type",void 0);return w=g=m.__decorate([D.subclass("esri.renderers.RasterStretchRenderer")],w)})},"esri/renderers/support/stretchRendererUtils":function(){define(["exports",
"../../core/jsonMap"],function(m,w){w=new w.JSONMap({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"});m.stretchTypeFunctionEnum={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"};m.stretchTypeJSONDict=w;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/renderers/VectorFieldRenderer":function(){define("../chunks/tslib.es6 ../Color ../geometry ../Graphic ../symbols ../core/jsonMap ../core/JSONSupport ../core/lang ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/accessorSupport/decorators/enumeration ../core/accessorSupport/decorators/reader ../core/accessorSupport/decorators/subclass ../geometry/support/normalizeUtils ../layers/support/rasterFunctions/vectorFieldUtils ./ClassBreaksRenderer ./mixins/VisualVariablesMixin ./support/ClassBreakInfo ./visualVariables/RotationVariable ./visualVariables/SizeVariable ./visualVariables/support/visualVariableUtils ../symbols/SimpleLineSymbol ../symbols/SimpleMarkerSymbol ../symbols/support/utils ../geometry/Point ../symbols/PictureMarkerSymbol".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h,n,l,A,t,r,a,f,d,e,c,k,q,u){var G;const y=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]);v=new R.JSONMap({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"});
R=new R.JSONMap({flow_from:"flow-from",flow_to:"flow-to"});P=G=class extends t.VisualVariablesMixin(P.JSONSupport){constructor(C){super(C);this.attributeField="Magnitude";this.flowRepresentation="flow-from";this.rotationType="arithmetic";this.style="single-arrow";this.symbolTileSize=50;this.type="vector-field"}readInputUnit(C,H){return y.has(C)?l.unitKebabDict.fromJSON(C):null}readOutputUnit(C,H){return y.has(C)?l.unitKebabDict.fromJSON(C):null}get styleRenderer(){const C=this.attributeField,H=this._createStyleRenderer(this.style);
H.field=C;return H}get sizeVariables(){const C=[];if(this.visualVariables)for(var H of this.visualVariables)"size"===H.type&&C.push(H);0===C.length&&(H=new f({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize}),this.visualVariables?this.visualVariables.push(H):this._set("visualVariables",[H]),C.push(H));return C}get rotationVariables(){const C=[];if(this.visualVariables)for(var H of this.visualVariables)"rotation"===H.type&&C.push(H);0===C.length&&(H=new a({field:"Direction",
rotationType:this.rotationType}),this.visualVariables?this.visualVariables.push(H):this._set("visualVariables",[H]),C.push(H));return C}clone(){return new G({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:U.clone(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(C,H=!1,x=[]){const M=[];var L=l.getUnitConversionFactor(this.inputUnit,
this.outputUnit),N=this.rotationVariables[0]?.rotationType||this.rotationType;H=H?l.convertVectorFieldData(C.pixelBlock,"vector-uv",N,L):l.convertVectorFieldUnit(C.pixelBlock,"vector-magdir",L);if(null==H)return M;C=C.extent;L=null!=H.mask&&0<H.mask.length;N=0;const E=(C.xmax-C.xmin)/H.width,I=(C.ymax-C.ymin)/H.height;for(let S=0;S<H.height;S++)for(let O=0;O<H.width;O++,N++){let W=new q({x:C.xmin+O*E+E/2,y:C.ymax-S*I-I/2,spatialReference:C.spatialReference});W=(await n.normalizeCentralMeridian(W))[0];
var K=x.some(Y=>Y.intersects(W));L&&!H.mask[N]||K||(K={Magnitude:H.pixels[0][N],Direction:H.pixels[1][N]},K=new J({geometry:new q({x:W.x,y:W.y,spatialReference:C.spatialReference}),attributes:K}),K.symbol=this._getVisualVariablesAppliedSymbol(K),M.push(K))}return M}getSymbol(C,H){}async getSymbolAsync(C,H){}getSymbols(){return[]}getClassBreakInfos(){return this.styleRenderer?.classBreakInfos}getDefaultSymbol(){return this.styleRenderer?.defaultSymbol}_getDefaultSymbol(C){return new c({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",
outline:new e({width:0}),size:20,color:C||new w([0,92,230])})}_getVisualVariablesAppliedSymbol(C){if(C){var H=this.styleRenderer?.getSymbol(C)?.clone(),x=this.sizeVariables,M=this.rotationVariables;x&&x.length&&this.sizeVariables.forEach(L=>k.applySizesToSymbol(H,d.getAllSizes([L],C)));M&&M.length&&(C.attributes.Direction+="flow-to"===this.flowRepresentation===("ocean-current-kn"===this.style||"ocean-current-m"===this.style)?0:180,this.rotationVariables.forEach(L=>k.applyRotationToSymbol(H,d.getRotationAngle(L,
C),L.axis)));return H}}_createStyleRenderer(C){let H={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(C){case "single-arrow":H=this._createSingleArrowRenderer();break;case "beaufort-kn":H=this._createBeaufortKnotsRenderer();break;case "beaufort-m":H=this._createBeaufortMeterRenderer();break;case "beaufort-ft":H=this._createBeaufortFeetRenderer();break;case "beaufort-mi":H=this._createBeaufortMilesRenderer();break;case "beaufort-km":H=this._createBeaufortKilometersRenderer();break;
case "ocean-current-m":H=this._createCurrentMeterRenderer();break;case "ocean-current-kn":H=this._createCurrentKnotsRenderer();break;case "simple-scalar":H=this._createSimpleScalarRenderer();break;case "wind-barb":H=this._createWindBarbsRenderer();break;case "classified-arrow":H=this._createClassifiedArrowRenderer()}return new A(H)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const C=this._getDefaultSymbol(new w([214,47,39])),H=this._getClassBreaks([0,
1,3,6,10,16,21,27,33,40,47,55,63],[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]]);return{defaultSymbol:C,classBreakInfos:H}}_createBeaufortMeterRenderer(){const C=this._getDefaultSymbol(new w([214,47,39])),H=this._getClassBreaks([0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,
220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]]);return{defaultSymbol:C,classBreakInfos:H}}_createBeaufortFeetRenderer(){const C=this._getDefaultSymbol(new w([214,47,39]));var H=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];H=H.map(x=>3.28084*x);H=this._getClassBreaks(H,[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]]);return{defaultSymbol:C,classBreakInfos:H}}_createBeaufortMilesRenderer(){const C=
this._getDefaultSymbol(new w([214,47,39]));var H=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];H=H.map(x=>2.23694*x);H=this._getClassBreaks(H,[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]]);return{defaultSymbol:C,classBreakInfos:H}}_createBeaufortKilometersRenderer(){const C=this._getDefaultSymbol(new w([214,47,39]));var H=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,
32.7];H=H.map(x=>3.6*x);H=this._getClassBreaks(H,[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]]);return{defaultSymbol:C,classBreakInfos:H}}_createCurrentMeterRenderer(){const C=this._getDefaultSymbol(new w([177,177,177])),H=this._getClassBreaks([0,.5,1,1.5,2],[[78,26,153],[179,27,26],[202,128,26],[177,177,177]]);return{defaultSymbol:C,classBreakInfos:H}}_createCurrentKnotsRenderer(){const C=
this._getDefaultSymbol(new w([177,177,177])),H=this._getClassBreaks([0,.25,.5,1,1.5,2,2.5,3,3.5,4],[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]]);return{defaultSymbol:C,classBreakInfos:H}}_createClassifiedArrowRenderer(){const C=this._getDefaultSymbol(new w([56,168,0]));var H=[0,1E-6,3.5,7,10.5,14];if(this.sizeVariables?.length){const x=this.sizeVariables[0].minDataValue,M=this.sizeVariables[0].maxDataValue;if(x&&M){const L=(M-x)/5;H=
Array.from(Array(6).keys()).map(N=>x+L*N)}}H=this._getClassBreaks(H,[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]]);return{defaultSymbol:C,classBreakInfos:H}}_createSimpleScalarRenderer(){return{defaultSymbol:u.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII\x3d",
height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const C=Array.from(Array(31).keys()).map(L=>5*L),H=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4\x3d"},
{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4\x3d"},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg\x3d\x3d"},
{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4\x3d"},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},
{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg\x3d\x3d"},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg\x3d\x3d"},
{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4\x3d"},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",
imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg\x3d\x3d"},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4\x3d"},
{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4\x3d"},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4\x3d"},
{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg\x3d\x3d"},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4\x3d"},
{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg\x3d\x3d"},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",
imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4\x3d"},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg\x3d\x3d"},
{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4\x3d"},{range:"90-95",
path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg\x3d\x3d"},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",
imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4\x3d"},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg\x3d\x3d"},
{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg\x3d\x3d"},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},
{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg\x3d\x3d"},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",
imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg\x3d\x3d"},
{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",
imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg\x3d\x3d"},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",
imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",
imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4\x3d"}],x=u.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",
height:20,width:20,type:"esriPMS",angle:0}),M=C.map((L,N)=>{if(N!==C.length-1)if(0===N)var E={minValue:L,maxValue:C[N+1],symbol:x};else E=u.fromJSON({type:"esriPMS",imageData:H[N].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0}),E={minValue:L,maxValue:C[N+1],symbol:E};return new r(E)});return{defaultSymbol:x,classBreakInfos:M}}_getClassBreaks(C,H){return H.map((x,M)=>new r({minValue:C[M],maxValue:C[M+1],symbol:this._getDefaultSymbol(new w(x))}))}};m.__decorate([D.property({type:["Magnitude"],
json:{write:!0}})],P.prototype,"attributeField",void 0);m.__decorate([D.property({type:R.apiValues,json:{type:R.jsonValues,read:{reader:R.read},write:{writer:R.write}}})],P.prototype,"flowRepresentation",void 0);m.__decorate([D.property({type:["geographic","arithmetic"],json:{write:!0}})],P.prototype,"rotationType",void 0);m.__decorate([D.property({type:v.apiValues,json:{type:v.jsonValues,read:{reader:v.read},write:{writer:v.write}}})],P.prototype,"style",void 0);m.__decorate([D.property({json:{write:!0}})],
P.prototype,"symbolTileSize",void 0);m.__decorate([D.property({type:l.unitKebabDict.apiValues,json:{type:l.unitKebabDict.jsonValues,write:{writer:l.unitKebabDict.write}}})],P.prototype,"inputUnit",void 0);m.__decorate([g.reader("inputUnit")],P.prototype,"readInputUnit",null);m.__decorate([D.property({type:l.unitKebabDict.apiValues,json:{type:l.unitKebabDict.jsonValues,read:{reader:l.unitKebabDict.read},write:{writer:l.unitKebabDict.write}}})],P.prototype,"outputUnit",void 0);m.__decorate([g.reader("outputUnit")],
P.prototype,"readOutputUnit",null);m.__decorate([b.enumeration({vectorField:"vector-field"})],P.prototype,"type",void 0);m.__decorate([D.property({type:A})],P.prototype,"styleRenderer",null);m.__decorate([D.property({type:f})],P.prototype,"sizeVariables",null);m.__decorate([D.property({type:a})],P.prototype,"rotationVariables",null);return P=G=m.__decorate([h.subclass("esri.renderers.VectorFieldRenderer")],P)})},"esri/layers/support/rasterFunctions/vectorFieldUtils":function(){define(["exports","../../../core/jsonMap",
"../PixelBlock","./pixelUtils"],function(m,w,v,J){function F(c,k){return l.get(c)/l.get(k)||1}function R(c,k="geographic"){const [q,u]=c;c=Math.sqrt(q*q+u*u);let G=Math.atan2(u,q)*A;G=(360+G)%360;"geographic"===k&&(G=(450-G)%360);return[c,G]}function P(c,k="geographic"){let q=c[1];"geographic"===k&&(q=(450-q)%360);q%=360;c=c[0];return[c*Math.cos(q/A),c*Math.sin(q/A)]}function U(c,k,q="geographic",u=1){if(!J.isValidPixelBlock(c))return c;const {pixels:G,width:y,height:C}=c;var H=y*C;const x=G[0],M=
G[1],L=c.pixelType.startsWith("f")?c.pixelType:"f32",N=v.createEmptyBand(L,H);H=v.createEmptyBand(L,H);let E=0;for(let I=0;I<C;I++)for(let K=0;K<y;K++)"vector-uv"===k?([N[E],H[E]]=R([x[E],M[E]],q),N[E]*=u):([N[E],H[E]]=P([x[E],M[E]],q),N[E]*=u,H[E]*=u),E++;c=new v({pixelType:L,width:c.width,height:c.height,mask:c.mask,validPixelCount:c.validPixelCount,maskIsAlpha:c.maskIsAlpha,pixels:[N,H]});c.updateStatistics();return c}function D(c=0,k=0,q=Math.PI,u=!0){u&&(q=(2*Math.PI-q)%(2*Math.PI));u=u?-1:1;
const G=-7*u,y=-2*u,C=-16*u,[H,x]=p(0,k+13*u,q,21.75),[M,L]=p(c-5.5,k+G,q,21.75),[N,E]=p(c+5.5,k+G,q,21.75),[I,K]=p(c-1.5,k+y,q,21.75),[S,O]=p(c+1.5,k+y,q,21.75),[W,Y]=p(c-1.5,k+C,q,21.75),[V,B]=p(c+1.5,k+C,q,21.75);return[H,x,M,L,I,K,S,O,N,E,W,Y,V,B]}function z(c=0,k=Math.PI,q=!0){q&&(k=(2*Math.PI-k)%(2*Math.PI));var u=q?-1:1,G=5*u;const y=20*u,C=25*u;u*=2;const H=q?1:-1;q=5*H;let [x,M]=[0+q,0-y],[L,N]=[x+2*H,M],[E,I]=[L-0*H,N+u],[K,S]=[0-q,0-C],[O,W]=[K+0*H,S-u],Y=Math.ceil(c/5),V=Math.floor(Y/
10);Y-=8*V;c=[];const B=[];for(let la=0;la<Y/2;la++,V--){0>=V&&1===Y%2&&la===(Y-1)/2&&(K=0,O=K+0*H,S=(S+M)/2,W=S-u);const [ja,pa]=p(K,S,k,45);if(0<V){const [ma,oa]=p(L,S,k,45),[qa,ta]=p(x,M,k,45);c.push(ma);c.push(oa);c.push(ja);c.push(pa);c.push(qa);c.push(ta)}else{const [ma,oa]=p(L,N,k,45),[qa,ta]=p(E,I,k,45),[sa,ra]=p(O,W,k,45);B.push(ja);B.push(pa);B.push(sa);B.push(ra);B.push(qa);B.push(ta);B.push(ma);B.push(oa)}S+=G;M+=G;N+=G;I+=G;W+=G}const [Q,T]=p(0+q,0+y,k,45);G=7*H;const [X,aa]=p(0+G,0+
y,k,45),[Z,ba]=p(0+q,0-C,k,45),[ea,fa]=p(0+G,0-C,k,45);return{pennants:c,barbs:B,shaft:[Q,T,X,aa,Z,ba,ea,fa]}}function p(c,k,q,u=1){return[Math.sqrt(c*c+k*k)/u,(2*Math.PI+(2*Math.PI+Math.atan2(k,c))%(2*Math.PI)-q)%(2*Math.PI)]}function b(c,k,q,u){q=F(u||"knots",q);for(u=1;u<k.length;u++)if(u===k.length-1){if(c<k[u]*q)break}else if(c<=k[u]*q)break;return Math.min(u-1,k.length-2)}function g(c,k,q,u,G){let y=0;switch(k){case "beaufort_kn":y=b(c,a,"knots",q);break;case "beaufort_km":y=b(c,a,"kilometer-per-hour",
q);break;case "beaufort_ft":y=b(c,a,"feet-per-second",q);break;case "beaufort_m":y=b(c,a,"meter-per-second",q);break;case "classified_arrow":y=b(c,G??[],u,q);break;case "ocean_current_m":y=b(c,f,"meter-per-second",q);break;case "ocean_current_kn":y=b(c,d,"knots",q)}return y}function h(c,k){const {style:q,inputUnit:u,outputUnit:G,breakValues:y}=k,C=t.fromJSON(u),H=t.fromJSON(G);let x=0,M=0;const {width:L,height:N,mask:E}=c,I=c.pixels[0];c=c.pixels[1];var K=null!=E?E.filter(W=>0<W).length:L*N;const S=
new Float32Array(42*K);K=new Uint32Array(15*K);k=k.invertDirection?D(0,0,0,!1):r;for(let W=0;W<N;W++)for(let Y=0;Y<L;Y++){var O=W*L+Y;if(!E||E[W*L+Y]){const V=(c[O]+360)%360/180*Math.PI,B=g(I[O],q,C,H,y);for(let Q=0;Q<k.length;Q+=2)S[x++]=(Y+.5)/L,S[x++]=(W+.5)/N,S[x++]=k[Q],S[x++]=k[Q+1]+V,S[x++]=B,S[x++]=I[O];O=7*(x/42-1);K[M++]=O;K[M++]=O+1;K[M++]=O+2;K[M++]=O+0;K[M++]=O+4;K[M++]=O+3;K[M++]=O+0;K[M++]=O+2;K[M++]=O+3;K[M++]=O+2;K[M++]=O+5;K[M++]=O+3;K[M++]=O+5;K[M++]=O+6;K[M++]=O+3}}return{vertexData:S,
indexData:K}}function n(c,k){let q=0,u=0;const {width:G,height:y,mask:C}=c;c=c.pixels[0];const H=[],x=[];var M=t.fromJSON(k.inputUnit);M=F(M,"knots");k="wind_speed"===k.style?5:Number.MAX_VALUE;for(let N=0;N<y;N++)for(let E=0;E<G;E++){var L=c[N*G+E]*M;if((!C||C[N*G+E])&&L<k){for(let I=0;4>I;I++)H[q++]=(E+.5)/G,H[q++]=(N+.5)/y,H[q++]=2>I?-.5:.5,H[q++]=0===I%2?-.5:.5,H[q++]=0,H[q++]=L;L=4*(q/24-1);x[u++]=L;x[u++]=L+1;x[u++]=L+2;x[u++]=L+1;x[u++]=L+2;x[u++]=L+3}}return{vertexData:new Float32Array(H),
indexData:new Uint32Array(x)}}const l=new Map;l.set("meter-per-second",1);l.set("kilometer-per-hour",.277778);l.set("knots",.514444);l.set("feet-per-second",.3048);l.set("mile-per-hour",.44704);const A=180/Math.PI,t=new w.JSONMap({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"}),r=D(0,0,0),a=[0,1,3,6,10,16,21,27,33,40,47,55,63],f=[0,.5,1,1.5,2],d=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],
e=[];m.convertToLocalDirections=function(c,k,q,u="geographic"){if(!J.isValidPixelBlock(c)||null==q)return c;c="vector-magdir"===k?c.clone():U(c,k);const G=c.pixels[1];for(let y=0;y<G.length;y++)G[y]="geographic"===u?(G[y]+q[y]+270)%360:(G[y]+360-q[y])%360;return"vector-magdir"===k?c:U(c,"vector-magdir")};m.convertVectorFieldData=U;m.convertVectorFieldUnit=function(c,k,q=1){if(1===q||!J.isValidPixelBlock(c))return c;c=c.clone();const {pixels:u,width:G,height:y}=c,C=u[0],H=u[1];let x=0;for(let M=0;M<
y;M++)for(let L=0;L<G;L++)"vector-uv"===k?(C[x]*=q,H[x]*=q):C[x]*=q,x++;c.updateStatistics();return c};m.createVFMesh=function(c,k){if("simple_scalar"===k.style)k=n(c,k);else if("wind_speed"===k.style){if(0===e.length)for(var q=0;30>q;q++)e.push(z(5*q,0,!k.invertDirection));k=t.fromJSON(k.inputUnit);k=F(k,"knots");const {width:C,height:H,mask:x}=c;q=c.pixels[0];c=c.pixels[1];const M=[],L=[];let N=0,E=0;for(let I=0;I<H;I++)for(let K=0;K<C;K++){var u=I*C+K,G=q[u]*k;if((!x||x[I*C+K])&&5<=G){const S=
(c[u]+360)%360/180*Math.PI,{pennants:O,barbs:W,shaft:Y}=e[Math.min(Math.floor(G/5),29)];if(0===O.length+W.length)continue;u=M.length/6;const V=(K+.5)/C,B=(I+.5)/H;for(var y=0;y<O.length;y+=2)M[N++]=V,M[N++]=B,M[N++]=O[y],M[N++]=O[y+1]+S,M[N++]=0,M[N++]=G;for(y=0;y<W.length;y+=2)M[N++]=V,M[N++]=B,M[N++]=W[y],M[N++]=W[y+1]+S,M[N++]=0,M[N++]=G;for(y=0;y<Y.length;y+=2)M[N++]=V,M[N++]=B,M[N++]=Y[y],M[N++]=Y[y+1]+S,M[N++]=0,M[N++]=G;for(G=0;G<O.length/6;G++)L[E++]=u,L[E++]=u+1,L[E++]=u+2,u+=3;for(G=0;G<
W.length/8;G++)L[E++]=u,L[E++]=u+1,L[E++]=u+2,L[E++]=u+1,L[E++]=u+2,L[E++]=u+3,u+=4;L[E++]=u+0;L[E++]=u+1;L[E++]=u+2;L[E++]=u+1;L[E++]=u+3;L[E++]=u+2;u+=4}}k={vertexData:new Float32Array(M),indexData:new Uint32Array(L)}}else k=h(c,k);return k};m.createVFMeshScalar=n;m.getUnitConversionFactor=F;m.sampleVectorField=function(c,k,q,u=[0,0],G=.5){const {width:y,height:C,mask:H}=c,[x,M]=c.pixels,[L,N]=u;c=Math.round((y-L)/q);u=Math.round((C-N)/q);var E=c*u;const I=new Float32Array(E),K=new Float32Array(E);
E=new Uint8Array(E);k="vector-uv"===k;for(let O=0;O<u;O++)for(let W=0;W<c;W++){let Y=0;const V=O*c+W,B=Math.max(0,O*q+N),Q=Math.max(0,W*q+L),T=Math.min(C,B+q),X=Math.min(y,Q+q);for(let aa=B;aa<T;aa++)for(let Z=Q;Z<X;Z++){var S=aa*y+Z;if(!H||H[S]){Y++;S=k?[x[S],M[S]]:[x[S],(360+M[S])%360];const [ba,ea]=k?S:P(S);I[V]+=ba;K[V]+=ea}}if(Y>=(T-B)*(X-Q)*(1-G)){E[V]=1;const [aa,Z]=R([I[V]/Y,K[V]/Y]);I[V]=aa;K[V]=Z}else E[V]=0,I[V]=0,K[V]=0}q=new v({width:c,height:u,pixels:[I,K],mask:E});q.updateStatistics();
return q};m.snapImageToSymbolTile=function(c,k,q,u,G){if(null==G||!G.spatialReference.equals(c.spatialReference))return{extent:c,width:Math.round(k/u),height:Math.round(q/u),resolution:c.width/k};const y=G.xmin;G=G.ymax;k=(c.xmax-c.xmin)/k*u;q=(c.ymax-c.ymin)/q*u;c.xmin=y+Math.floor((c.xmin-y)/k)*k;c.xmax=y+Math.ceil((c.xmax-y)/k)*k;c.ymin=G+Math.floor((c.ymin-G)/q)*q;c.ymax=G+Math.ceil((c.ymax-G)/q)*q;return{extent:c,width:Math.round(c.width/k),height:Math.round(c.height/q),resolution:(k+q)/2}};
m.unitKebabDict=t;m.uvComponentToVector=R;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/PixelBlock":function(){define("../../chunks/tslib.es6 ../../core/Error ../../core/JSONSupport ../../core/lang ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/accessorSupport/decorators/subclass ./SimpleBandStatistics ./rasterFormats/pixelRangeUtils".split(" "),function(m,w,v,J,F,R,P,U,D,z){var p;v=p=class extends v.JSONSupport{static createEmptyBand(b,
g){return new (p.getPixelArrayConstructor(b))(g)}static combineBandMasks(b){if(2>b.length)return b[0];const g=b[0].length,h=(new Uint8Array(g)).fill(255);for(let n=0;n<b.length;n++){const l=b[n];for(let A=0;A<g;A++)l[A]||(h[A]=0)}return h}static getPixelArrayConstructor(b){let g;switch(b){case "u1":case "u2":case "u4":case "u8":g=Uint8Array;break;case "u16":g=Uint16Array;break;case "u32":g=Uint32Array;break;case "s8":g=Int8Array;break;case "s16":g=Int16Array;break;case "s32":g=Int32Array;break;case "f32":g=
Float32Array;break;case "f64":g=Float64Array;break;case "c64":case "c128":case "unknown":g=Float32Array}return g}constructor(b){super(b);this.height=this.width=null;this.pixelType="f32";this.mask=this.validPixelCount=null;this.premultiplyAlpha=this.maskIsAlpha=!1;this.statistics=null;this.depthCount=1}castPixelType(b){if(!b)return"f32";b=b.toLowerCase();["u1","u2","u4"].includes(b)?b="u8":"unknown u8 s8 u16 s16 u32 s32 f32 f64".split(" ").includes(b)||(b="f32");return b}getPlaneCount(){return this.pixels?.length}addData(b){if(!b.pixels||
b.pixels.length!==this.width*this.height)throw new w("pixelblock:invalid-or-missing-pixels","add data requires valid pixels array that has same length defined by pixel block width * height");this.pixels||(this.pixels=[]);this.statistics||(this.statistics=[]);this.pixels.push(b.pixels);this.statistics.push(b.statistics??new D.SimpleBandStatistics)}getAsRGBA(){const b=new ArrayBuffer(this.width*this.height*4);switch(this.pixelType){case "s8":case "s16":case "u16":case "s32":case "u32":case "f32":case "f64":this._fillFromNon8Bit(b);
break;default:this._fillFrom8Bit(b)}return new Uint8ClampedArray(b)}getAsRGBAFloat(){const b=new Float32Array(this.width*this.height*4);this._fillFrom32Bit(b);return b}updateStatistics(){if(this.pixels){this.statistics=this.pixels.map(h=>{var n=this.mask;let l=Infinity,A=-Infinity;const t=h.length;let r,a=0;if(null!=n)for(r=0;r<t;r++)n[r]&&(a=h[r],l=a<l?a:l,A=a>A?a:A);else for(r=0;r<t;r++)a=h[r],l=a<l?a:l,A=a>A?a:A;return new D.SimpleBandStatistics(l,A)});var b=this.mask,g=0;if(null!=b)for(let h=
0;h<b.length;h++)b[h]&&g++;else g=this.width*this.height;this.validPixelCount=g}}clamp(b){if(b&&"f64"!==b&&"f32"!==b&&this.pixels){var [g,h]=z.getPixelValueRange(b),n=this.pixels,l=this.width*this.height,A=n.length,t=[];for(let d=0;d<A;d++){var r=p.createEmptyBand(b,l);var a=n[d];for(let e=0;e<l;e++){var f=a[e];r[e]=f>h?h:f<g?g:f}t.push(r)}this.pixels=t;this.pixelType=b}}extractBands(b){const {pixels:g,statistics:h}=this;if(null==b||0===b.length||!g||0===g.length)return this;var n=g.length;const l=
b.some(d=>d>=g.length),A=n===b.length&&!b.some((d,e)=>d!==e);if(l||A)return this;n=this.bandMasks?.length===n?b.map(d=>this.bandMasks[d]):void 0;let {mask:t,validPixelCount:r}=this;const {width:a,height:f}=this;n?.length&&(t=p.combineBandMasks(n),r=t.filter(d=>!!d).length);return new p({pixelType:this.pixelType,width:a,height:f,mask:t,bandMasks:n,validPixelCount:r,maskIsAlpha:this.maskIsAlpha,pixels:b.map(d=>g[d]),statistics:h&&b.map(d=>h[d])})}clone(){const b=new p({width:this.width,height:this.height,
pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});null!=this.mask&&(b.mask=new Uint8Array(this.mask));this.bandMasks&&(b.bandMasks=this.bandMasks.map(n=>new Uint8Array(n)));let g;const h=p.getPixelArrayConstructor(this.pixelType);if(this.pixels&&0<this.pixels.length){b.pixels=[];const n=!!this.pixels[0].slice;for(g=0;g<this.pixels.length;g++)b.pixels[g]=n?this.pixels[g].slice(0,this.pixels[g].length):new h(this.pixels[g])}if(this.statistics)for(b.statistics=
[],g=0;g<this.statistics.length;g++)b.statistics[g]=J.clone(this.statistics[g]);b.premultiplyAlpha=this.premultiplyAlpha;return b}_fillFrom8Bit(b){const {mask:g,maskIsAlpha:h,premultiplyAlpha:n,pixels:l}=this;if(b&&l?.length){var A,t;var r=A=t=l[0];3<=l.length?(A=l[1],t=l[2]):2===l.length&&(A=l[1]);var a=new Uint32Array(b),f=this.width*this.height;if(r.length!==f)F.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");else if(null!=g&&g.length===f)if(h)for(b=
0;b<f;b++){const d=g[b];if(d){const e=d/255;a[b]=n?d<<24|t[b]*e<<16|A[b]*e<<8|r[b]*e:d<<24|t[b]<<16|A[b]<<8|r[b]}}else for(b=0;b<f;b++)g[b]&&(a[b]=-16777216|t[b]<<16|A[b]<<8|r[b]);else for(b=0;b<f;b++)a[b]=-16777216|t[b]<<16|A[b]<<8|r[b]}else F.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.")}_fillFromNon8Bit(b){const {pixels:g,mask:h,statistics:n}=this;if(b&&g?.length){var l=this.pixelType,A=1,t=0;A=1;if(n&&0<n.length){for(var r of n)null!=r.minValue&&
(t=Math.min(t,r.minValue)),null!=r.maxValue&&null!=r.minValue&&(A=Math.max(A,r.maxValue-r.minValue));A=255/A}else A=255,"s8"===l?(t=-128,A=127):"u16"===l?A=65535:"s16"===l?(t=-32768,A=32767):"u32"===l?A=4294967295:"s32"===l?(t=-2147483648,A=2147483647):"f32"===l?(t=-3.4*1E39,A=3.4*1E39):"f64"===l&&(t=-Number.MAX_VALUE,A=Number.MAX_VALUE),A=255/(A-t);b=new Uint32Array(b);l=this.width*this.height;var a,f,d;r=a=f=g[0];if(r.length!==l)return F.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");
if(2<=g.length)if(a=g[1],3<=g.length&&(f=g[2]),null!=h&&h.length===l)for(d=0;d<l;d++)h[d]&&(b[d]=-16777216|(f[d]-t)*A<<16|(a[d]-t)*A<<8|(r[d]-t)*A);else for(d=0;d<l;d++)b[d]=-16777216|(f[d]-t)*A<<16|(a[d]-t)*A<<8|(r[d]-t)*A;else if(null!=h&&h.length===l)for(d=0;d<l;d++)a=(r[d]-t)*A,h[d]&&(b[d]=-16777216|a<<16|a<<8|a);else for(d=0;d<l;d++)a=(r[d]-t)*A,b[d]=-16777216|a<<16|a<<8|a}else F.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.")}_fillFrom32Bit(b){const {pixels:g,
mask:h}=this;if(!b||!g?.length)return F.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The input pixel block is empty.");let n,l,A,t;n=l=A=g[0];3<=g.length?(l=g[1],A=g[2]):2===g.length&&(l=g[1]);const r=this.width*this.height;if(n.length!==r)return F.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let a=0;if(null!=h&&h.length===r)for(t=0;t<r;t++)b[a++]=n[t],b[a++]=l[t],b[a++]=A[t],b[a++]=h[t]&1;else for(t=0;t<r;t++)b[a++]=n[t],
b[a++]=l[t],b[a++]=A[t],b[a++]=1}};m.__decorate([R.property({json:{write:!0}})],v.prototype,"width",void 0);m.__decorate([R.property({json:{write:!0}})],v.prototype,"height",void 0);m.__decorate([R.property({json:{write:!0}})],v.prototype,"pixelType",void 0);m.__decorate([P.cast("pixelType")],v.prototype,"castPixelType",null);m.__decorate([R.property({json:{write:!0}})],v.prototype,"validPixelCount",void 0);m.__decorate([R.property({json:{write:!0}})],v.prototype,"mask",void 0);m.__decorate([R.property({json:{write:!0}})],
v.prototype,"maskIsAlpha",void 0);m.__decorate([R.property({json:{write:!0}})],v.prototype,"pixels",void 0);m.__decorate([R.property()],v.prototype,"premultiplyAlpha",void 0);m.__decorate([R.property({json:{write:!0}})],v.prototype,"statistics",void 0);m.__decorate([R.property({json:{write:!0}})],v.prototype,"depthCount",void 0);m.__decorate([R.property({json:{write:!0}})],v.prototype,"noDataValues",void 0);m.__decorate([R.property({json:{write:!0}})],v.prototype,"bandMasks",void 0);return v=p=m.__decorate([U.subclass("esri.layers.support.PixelBlock")],
v)})},"esri/layers/support/SimpleBandStatistics":function(){define(["exports"],function(m){class w{constructor(v=null,J=null,F=null){this.minValue=v;this.maxValue=J;this.noDataValue=F}}m.SimpleBandStatistics=w;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFormats/pixelRangeUtils":function(){define(["exports"],function(m){function w(J){return v[J]??[-3.4028234663852886E38,3.4028234663852886E38]}const v={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],
u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-3.4028234663852886E38,3.4028234663852886E38],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};m.convertNoDataToMask=function(J,F,R){if(!(J.depthCount&&1<J.depthCount)){var {pixels:P,statistics:U,pixelType:D}=J,z=P[0].length,p=J.bandMasks??[];z=J.mask??(new Uint8Array(z)).fill(255);var b="f32"===D||"f64"===D,g=w(D),h=!1;for(let A=0;A<P.length;A++){const t="number"===typeof F?F:F[A];
if(null==t)continue;var n=U?.[A]?.maxValue??g[1];if((U?.[A]?.minValue??g[0])>t+Number.EPSILON||n<t-Number.EPSILON)continue;n=p[A]||z.slice();const r=P[A];var l=R?.customFloatTolerance;if(b&&0!==l){l||=9.999999E37<=Math.abs(t)?2E-7*Math.abs(t):"f32"===D?2**-23:Number.EPSILON;for(let a=0;a<r.length;a++)n[a]&&Math.abs(r[a]-t)<l&&(r[a]=0,n[a]=0,z[a]=0,h=!0)}else for(l=0;l<r.length;l++)n[l]&&r[l]===t&&(r[l]=0,n[l]=0,z[l]=0,h=!0);p[A]=n}h&&(J.bandMasks=J.bandMasks||1<J.pixels.length?p:null,J.mask=z);h&&
"updateStatistics"in J&&J.updateStatistics()}};m.getIntegerPixelType=function(J,F){return null==J||null==F?"s32":0>J?-128<=J&&128>F?"s8":-32768<=J&&32768>F?"s16":"s32":256>F?"u8":65536>F?"u16":"u32"};m.getPixelValueRange=w;m.isIntegerPixelType=function(J){return(J?.startsWith("s")||J?.startsWith("u"))??!1};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/pixelUtils":function(){define(["exports","../PixelBlock","../rasterFormats/pixelRangeUtils"],
function(m,w,v){function J(a){return null!=a&&"esri.layers.support.PixelBlock"===a.declaredClass&&a.pixels&&0<a.pixels.length}function F(a,f,d,e,c){const k=a.length;c=w.createEmptyBand(c,k);if(f)for(let q=0;q<k;q++)f[q]&&(c[q]=d[a[q]-e]);else for(f=0;f<k;f++)c[f]=d[a[f]-e];return c}function R(a,f,d,e){const c=null!=d&&2<=d.length?new Set(d):null;d=1===d?.length?d[0]:null;const k=!!f?.length;for(let q=0;q<a.length;q++)if(e[q]){const u=a[q];if(k){let G=!1;for(let y=0;y<f.length;y+=2)if(u>=f[y]&&u<=
f[y+1]){G=!0;break}G||(e[q]=0)}e[q]&&(u===d||c?.has(u))&&(e[q]=0)}}function P(a,f){const d=a[0].length;for(let e=0;e<d;e++)if(f[e]){let c=!1;for(let k=0;k<a.length;k++)if(a[k][e]){c=!0;break}c||(f[e]=0)}}function U(a,f){const d=a[0].length;for(let e=0;e<d;e++)if(f[e]){let c=!1;for(let k=0;k<a.length;k++)if(0===a[k][e]){c=!0;break}c&&(f[e]=0)}}function D(a,f,d,e,c,k,q,u){return{xmin:c<=d*a?0:c<d*a+a?c-d*a:a,ymin:k<=e*f?0:k<e*f+f?k-e*f:f,xmax:c+q<=d*a?0:c+q<d*a+a?c+q-d*a:a,ymax:k+u<=e*f?0:k+u<e*f+f?
k+u-e*f:f}}function z(a,f,d,e,c,k){const {width:q,height:u}=d.block,{x:G,y}=d.offset,{width:C,height:H}=d.mosaic;d=D(q,u,e,c,G,y,C,H);let x=0;var M=0;if(k){var L=k.hasGCSSShiftTransform?360:k.halfWorldWidth??0,N=q*k.resolutionX;const E=k.startX+e*N;E<L&&E+N>L?M=k.rightPadding:E>=L&&(x=k.leftMargin-k.rightPadding,M=0)}d.xmax-=M;if("number"===typeof f)for(k=d.ymin;k<d.ymax;k++)for(M=(c*u+k-y)*C+(e*q-G)+x,L=d.xmin;L<d.xmax;L++)a[M+L]=f;else for(k=d.ymin;k<d.ymax;k++)for(M=(c*u+k-y)*C+(e*q-G)+x,L=k*q,
N=d.xmin;N<d.xmax;N++)a[M+N]=f[L+N]}function p(a,f,d={}){const {clipOffset:e,clipSize:c,alignmentInfo:k,blockWidths:q}=d;if(q)return b(a,f,{blockWidths:q});var u=a.find(S=>J(S));if(null==u)return null;d=c?c.width:f.width;const G=c?c.height:f.height;var y=u.width,C=u.height;const H=f.width/y,x=f.height/C;f={offset:e||{x:0,y:0},mosaic:c||f,block:{width:y,height:C}};y=u.pixelType;var M=w.getPixelArrayConstructor(y);u=u.pixels.length;C=[];for(var L=0;L<u;L++){var N=new M(d*G);for(var E=0;E<x;E++)for(var I=
0;I<H;I++){var K=a[E*H+I];J(K)&&(K=K.pixels[L],z(N,K,f,I,E,k))}C.push(N)}M=a.some(S=>null==S||null!=S.mask&&0<S.mask.length);N=a.some(S=>S?.bandMasks&&1<S.bandMasks.length);M=M?new Uint8Array(d*G):void 0;N=N?[]:void 0;if(M){for(L=0;L<x;L++)for(E=0;E<H;E++)I=a[L*H+E],K=null!=I?I.mask:null,null!=K?z(M,K,f,E,L,k):I?z(M,255,f,E,L,k):z(M,0,f,E,L,k);if(N)for(L=0;L<u;L++){E=new Uint8Array(d*G);for(I=0;I<x;I++)for(K=0;K<H;K++){const S=a[I*H+K],O=S?.bandMasks?.[L]??S?.mask;null!=O?z(E,O,f,K,I,k):S?z(E,255,
f,K,I,k):z(E,0,f,K,I,k)}N.push(E)}}a=new w({width:d,height:G,pixels:C,pixelType:y,bandMasks:N,mask:M});a.updateStatistics();return a}function b(a,f,d){const e=a.find(E=>null!=E);if(null==e)return null;var c=a.some(E=>null!=E?!!E.mask:!0);const {width:k,height:q}=f;f=c?new Uint8Array(k*q):null;({blockWidths:d}=d);const u=[],G=e.getPlaneCount(),y=w.getPixelArrayConstructor(e.pixelType);if(c)for(let E=0,I=0;E<a.length;I+=d[E],E++)if(c=a[E],J(c)){var C=c.mask;for(var H=0;H<q;H++)for(var x=0;x<d[E];x++)f[H*
k+x+I]=null==C?255:C[H*c.width+x]}C=(c=a.some(E=>E?.bandMasks&&1<E.bandMasks.length))?[]:void 0;H=k*q;for(x=0;x<G;x++){const E=new y(H),I=c?new Uint8Array(H):void 0;for(let K=0,S=0;K<a.length;S+=d[K],K++){const O=a[K];if(J(O)){var M=O.pixels[x];if(null!=M){for(var L=0;L<q;L++)for(var N=0;N<d[K];N++)E[L*k+N+S]=M[L*O.width+N];if(I)for(M=O.bandMasks?.[x]??O.mask,L=0;L<q;L++)for(N=0;N<d[K];N++)I[L*k+N+S]=M?M[L*O.width+N]:255}}}u.push(E);C&&I&&C.push(I)}a=new w({width:k,height:q,mask:f,bandMasks:C,pixels:u,
pixelType:e.pixelType});a.updateStatistics();return a}function g(a){if(!J(a))return null;const f=a.clone(),{width:d,height:e,pixels:c}=a;var k=c[0];const q=f.pixels[0];a=a.mask;for(let y=2;y<e-1;y++){const C=new Map;for(var u=y-2;u<y+2;u++)for(var G=0;4>G;G++){const H=u*d+G;l(C,k[H],a?a[H]:1)}q[y*d]=h(C);q[y*d+1]=q[y*d+2]=q[y*d];for(u=3;u<d-1;u++)G=(y-2)*d+u+1,l(C,k[G],a?a[G]:1),G=(y-1)*d+u+1,l(C,k[G],a?a[G]:1),G=y*d+u+1,l(C,k[G],a?a[G]:1),G=(y+1)*d+u+1,l(C,k[G],a?a[G]:1),G=(y-2)*d+u-3,n(C,k[G],a?
a[G]:1),G=(y-1)*d+u-3,n(C,k[G],a?a[G]:1),G=y*d+u-3,n(C,k[G],a?a[G]:1),G=(y+1)*d+u-3,n(C,k[G],a?a[G]:1),q[y*d+u]=h(C);q[y*d+u+1]=q[y*d+u]}for(k=0;k<d;k++)q[k]=q[d+k]=q[2*d+k],q[(e-1)*d+k]=q[(e-2)*d+k];f.updateStatistics();return f}function h(a){if(0===a.size)return 0;let f=0,d=-1,e=0;const c=a.keys();let k=c.next();for(;!k.done;)e=a.get(k.value),e>f&&(d=k.value,f=e),k=c.next();return d}function n(a,f,d){0!==d&&(d=a.get(f),1===d?a.delete(f):a.set(f,d-1))}function l(a,f,d){0!==d&&a.set(f,a.has(f)?a.get(f)+
1:1)}function A(a,f,d){let {x:e,y:c}=f;const {width:k,height:q}=d;if(0===e&&0===c&&q===a.height&&k===a.width)return a;const {width:u,height:G}=a;f=Math.max(0,c);const y=Math.max(0,e),C=Math.min(e+k,u),H=Math.min(c+q,G);if(0>C||0>H||!J(a))return null;e=Math.max(0,-e);c=Math.max(0,-c);var {pixels:x}=a,M=k*q,L=x.length;const N=[];for(var E=0;E<L;E++){var I=x[E],K=w.createEmptyBand(a.pixelType,M);for(let S=f;S<H;S++){const O=S*u;let W=(S+c-f)*k+e;for(let Y=y;Y<C;Y++)K[W++]=I[O+Y]}N.push(K)}x=new Uint8Array(M);
M=a.mask;for(L=f;L<H;L++)for(E=L*u,I=(L+c-f)*k+e,K=y;K<C;K++)x[I++]=M?M[E+K]:1;a=new w({width:d.width,height:d.height,pixelType:a.pixelType,pixels:N,mask:x});a.updateStatistics();return a}function t(a,f=!0){if(!J(a))return null;const {pixels:d,width:e,height:c,mask:k,pixelType:q}=a;a=[];const u=Math.round(e/2),G=Math.round(c/2),y=c-1,C=e-1;for(var H=0;H<d.length;H++){var x=d[H],M=w.createEmptyBand(q,u*G),L=0;for(var N=0;N<c;N+=2)for(var E=0;E<e;E+=2){var I=x[N*e+E];if(f){var K=E===C?I:x[N*e+E+1];
const S=N===y?I:x[N*e+E+e],O=E===C?S:N===y?K:x[N*e+E+e+1];M[L++]=(I+K+S+O)/4}else M[L++]=I}a.push(M)}H=null;if(null!=k)for(H=new Uint8Array(u*G),x=0,M=0;M<c;M+=2)for(L=0;L<e;L+=2)N=k[M*e+L],f?(E=L===C?N:k[M*e+L+1],I=M===y?N:k[M*e+L+e],K=L===C?I:M===y?E:k[M*e+L+e+1],H[x++]=N*E*I*K?1:0):H[x++]=N;return new w({width:u,height:G,pixelType:q,pixels:a,mask:H})}function r(a,f,d,e,c=0){const {width:k,height:q}=a,{width:u,height:G}=f;a=e.cols;e=e.rows;f=Math.ceil(u/a-.1/a);const y=Math.ceil(G/e-.1/e);let C,
H,x,M,L;const N=f*a;var E=N*y*e;const I=new Float32Array(E),K=new Float32Array(E),S=new Uint32Array(E),O=new Uint32Array(E);let W=0,Y,V;for(let T=0;T<y;T++)for(let X=0;X<f;X++){var B=12*(T*f+X);E=d[B];C=d[B+1];H=d[B+2];x=d[B+3];M=d[B+4];L=d[B+5];for(var Q=0;Q<e;Q++){W=(T*e+Q)*N+X*a;V=(Q+.5)/e;for(let aa=0;aa<Q;aa++)Y=(aa+.5)/a,I[W+aa]=(E*Y+C*V+H)*k+c,K[W+aa]=(x*Y+M*V+L)*q+c,S[W+aa]=Math.floor(I[W+aa]),O[W+aa]=Math.floor(K[W+aa])}B+=6;E=d[B];C=d[B+1];H=d[B+2];x=d[B+3];M=d[B+4];L=d[B+5];for(B=0;B<e;B++)for(W=
(T*e+B)*N+X*a,V=(B+.5)/e,Q=B;Q<a;Q++)Y=(Q+.5)/a,I[W+Q]=(E*Y+C*V+H)*k+c,K[W+Q]=(x*Y+M*V+L)*q+c,S[W+Q]=Math.floor(I[W+Q]),O[W+Q]=Math.floor(K[W+Q])}return{offsets_x:I,offsets_y:K,offsets_xi:S,offsets_yi:O,gridWidth:N}}m.NoDataInterpretation=void 0;(function(a){a[a.matchAny=0]="matchAny";a[a.matchAll=1]="matchAll"})(m.NoDataInterpretation||(m.NoDataInterpretation={}));m.MissingBandAction=void 0;(function(a){a[a.bestMatch=0]="bestMatch";a[a.fail=1]="fail"})(m.MissingBandAction||(m.MissingBandAction={}));
m.approximateTransform=function(a,f,d,e,c="nearest"){if(!J(a))return null;"majority"===c&&(a=g(a));const {pixels:k,mask:q,bandMasks:u,pixelType:G}=a,y=a.width;var C=a.height;const H=w.getPixelArrayConstructor(G),x=k.length,{width:M,height:L}=f;a=!1;for(var N=0;N<d.length;N+=3)-1===d[N]&&-1===d[N+1]&&-1===d[N+2]&&(a=!0);const {offsets_x:E,offsets_y:I,offsets_xi:K,offsets_yi:S,gridWidth:O}=r({width:y,height:C},f,d,e,"majority"===c?.5:0);let W;f=(V,B,Q,T)=>{const X=V instanceof Float32Array||V instanceof
Float64Array?0:.5;for(let aa=0;aa<L;aa++){W=aa*O;for(let Z=0;Z<M;Z++){if(0>E[W]||0>I[W])V[aa*M+Z]=0;else if(T)V[aa*M+Z]=B[K[W]+S[W]*y];else{const ba=Math.floor(E[W]),ea=Math.floor(I[W]),fa=Math.ceil(E[W]),la=Math.ceil(I[W]),ja=E[W]-ba,pa=I[W]-ea;V[aa*M+Z]=!Q||Q[ba+ea*y]&&Q[fa+ea*y]&&Q[ba+la*y]&&Q[fa+la*y]?(1-pa)*((1-ja)*B[ba+ea*y]+ja*B[fa+ea*y])+pa*((1-ja)*B[ba+la*y]+ja*B[fa+la*y])+X:B[K[W]+S[W]*y]}W++}}};d=[];e=u?.length===x;C=[];for(N=0;N<x;N++){if(e){var Y=new Uint8Array(M*L);f(Y,u[N],u[N],!0);
C.push(Y)}Y=new H(M*L);f(Y,k[N],e?u[N]:q,"nearest"===c||"majority"===c);d.push(Y)}c=new w({width:M,height:L,pixelType:G,pixels:d,bandMasks:e?C:void 0});if(null!=q)c.mask=new Uint8Array(M*L),f(c.mask,q,q,!0);else if(a)for(c.mask=new Uint8Array(M*L),a=0;a<M*L;a++)c.mask[a]=0>E[a]||0>I[a]?0:1;c.updateStatistics();return c};m.clip=A;m.clipTile=function(a){const {pixelBlock:f,tileSize:d,level:e,row:c,col:k,useBilinear:q}=a;if(!J(f))return null;const {width:u,height:G}=d;var y=2**e;a=y*u;y*=G;a=A(f,{y:c*
y,x:k*a},{width:a,height:y});if(!a)return null;for(y=e;0<y;y--)a=t(a,q);return a};m.colorize=function(a,f){if(!J(a)||!f||!f.indexedColormap&&!f.indexed2DColormap)return a;const d=a.clone();var e=d.pixels;let c=d.mask;const k=d.width*d.height;if(1!==e.length)return a;const {indexedColormap:q,indexed2DColormap:u,offset:G,alphaSpecified:y}=f;a=0;e=e[0];f=new Uint8Array(e.length);const C=new Uint8Array(e.length),H=new Uint8Array(e.length);var x=0;if(q){const M=q.length-1;if(null!=c)for(a=0;a<k;a++)c[a]&&
(x=4*(e[a]-G),x<G||x>M?c[a]=0:(f[a]=q[x],C[a]=q[x+1],H[a]=q[x+2],c[a]=q[x+3]));else{c=new Uint8Array(k);for(a=0;a<k;a++)x=4*(e[a]-G),x<G||x>M?c[a]=0:(f[a]=q[x],C[a]=q[x+1],H[a]=q[x+2],c[a]=q[x+3]);d.mask=c}}else if(u)if(null!=c)for(a=0;a<k;a++)c[a]&&(x=u[e[a]],f[a]=x[0],C[a]=x[1],H[a]=x[2],c[a]=x[3]);else{c=new Uint8Array(k);for(a=0;a<k;a++)x=u[e[a]],f[a]=x[0],C[a]=x[1],H[a]=x[2],c[a]=x[3];d.mask=c}d.pixels=[f,C,H];d.statistics=null;d.pixelType="u8";d.maskIsAlpha=y;return d};m.compositeBands=function(a){if(!a?.length||
a.some(G=>!J(G)))return null;if(1===a.length)return a[0]?.clone()??null;const {width:f,height:d,pixelType:e}=a[0];if(a.some(G=>G.width!==f||G.height!==d))return null;const c=a.map(({mask:G})=>G).filter(G=>null!=G);let k=null;c.length&&(k=new Uint8Array(f*d),k.set(c[0]),1<c.length&&U(c.slice(1),k));const q=[];a.forEach(({pixels:G})=>q.push(...G));const u=[];a.map(({statistics:G})=>G).filter(G=>G?.length).forEach(G=>u.push(...G));return new w({pixelType:e,width:f,height:d,mask:k,pixels:q,statistics:u.length?
u:null})};m.createColormapLUT=function(a){if(a){var f=a.colormap;if(f&&0!==f.length){f=f.sort((y,C)=>y[0]-C[0]);var d=0;0>f[0][0]&&(d=f[0][0]);var e=Math.max(256,f[f.length-1][0]-d+1),c=new Uint8Array(4*e),k=[],q=0,u=0,G=5===f[0].length;if(65536<e)return f.forEach(y=>{k[y[0]-d]=G?y.slice(1):y.slice(1).concat([255])}),{indexed2DColormap:k,offset:d,alphaSpecified:G};if(a.fillUnspecified)for(a=f[u],q=a[0]-d;q<e;q++)c[4*q]=a[1],c[4*q+1]=a[2],c[4*q+2]=a[3],c[4*q+3]=G?a[4]:255,q===a[0]-d&&(a=u===f.length-
1?a:f[++u]);else for(q=0;q<f.length;q++)a=f[q],u=4*(a[0]-d),c[u]=a[1],c[u+1]=a[2],c[u+2]=a[3],c[u+3]=G?a[4]:255;return{indexedColormap:c,offset:d,alphaSpecified:G}}}};m.createMaskLUT=function(a,f,d){if("u8"!==a&&"s8"!==a&&"u16"!==a&&"s16"!==a)return null;var e=a.includes("16")?65536:256;a=a.includes("s")?-e/2:0;e=new Uint8Array(e);if(f)for(let k=0;k<f.length;k++){var c=Math.ceil(f[2*k]-a);const q=Math.floor(f[2*k+1]-a);for(;c<=q;c++)e[c]=255}else e.fill(255);if(d)for(f=0;f<d.length;f++)e[d[f]-a]=
0;return{lut:e,offset:a}};m.createRemapLUT=function(a){const {srcPixelType:f,inputRanges:d,outputValues:e,allowUnmatched:c,noDataRanges:k,isLastInputRangeInclusive:q,outputPixelType:u}=a;if("u8"!==f&&"s8"!==f&&"u16"!==f&&"s16"!==f)return null;var G=f.includes("16")?65536:256;a=f.includes("s")?-G/2:0;const y=w.createEmptyBand(u,G);G=new Uint8Array(G);c&&G.fill(255);const [C,H]=v.getPixelValueRange(u);if(d?.length&&e?.length){var x=d.map(E=>E-1E-6);x[0]=d[0];q&&(x[x.length-1]=d[d.length-1]);for(var M=
0;M<x.length;M++){var L=e[M]>H?H:e[M]<C?C:e[M],N=Math.ceil(x[2*M]-a);const E=Math.floor(x[2*M+1]-a);for(;N<=E;N++)y[N]=L,G[N]=255}}if(k?.length)for(x=0;x<k.length;x++)for(L=Math.ceil(k[2*x]-a),M=Math.floor(k[2*x+1]-a);L<=M;L++)G[L]=0;return{lut:y,offset:a,mask:G}};m.extractBands=function(a,f){return f?.length&&J(a)?a.extractBands(f):a};m.getClipBounds=D;m.getLocalArithmeticNorthRotations=function(a,f){const {coefficients:d,spacing:e}=f,{offsets_x:c,offsets_y:k,gridWidth:q}=r(a,a,d,{rows:e[0],cols:e[1]}),
{width:u,height:G}=a;a=new Float32Array(u*G);f=180/Math.PI;for(let H=0;H<G;H++)for(let x=0;x<u;x++){var y=H*q+x,C=0===H?y:y-q;const M=H===G-1?y:y+q;y=c[C]-c[M];C=k[M]-k[C];isNaN(y)||isNaN(C)?a[H*u+x]=90:(C=Math.atan2(C,y)*f,C=(360+C)%360,a[H*u+x]=C)}return a};m.interpolateOffsets=r;m.isValidPixelBlock=J;m.lookupBandValues=F;m.lookupPixels=function(a,f){if(!J(a))return null;const {pixels:d,mask:e}=a,c=d.length;let k=f.lut;const {offset:q}=f;k&&1===k[0].length&&(k=d.map(()=>k));const u=[];f=f.outputPixelType||
"u8";for(let G=0;G<c;G++){const y=F(d[G],e,k[G],q||0,f);u.push(y)}a=new w({width:a.width,height:a.height,pixels:u,mask:e,pixelType:f});a.updateStatistics();return a};m.mask=function(a,f){if(!J(a))return null;const {width:d,height:e,pixels:c}=a;var k=d*e;const q=new Uint8Array(k);a.mask?q.set(a.mask):q.fill(255);a=c.length;const {includedRanges:u,noDataValues:G,outputPixelType:y,matchAll:C,lookups:H}=f;if(H){k=[];for(f=0;f<a;f++){var x=H[f];x=F(c[f],q,x.lut,x.offset||0,"u8");k.push(x)}1===k.length?
q.set(k[0]):C?P(k,q):U(k,q)}else if(C){f=[];for(x=0;x<a;x++){const M=new Uint8Array(k);M.set(q);R(c[x],u?.slice(2*x,2*x+2),G?.[x],M);f.push(M)}1===f.length?q.set(f[0]):P(f,q)}else for(k=0;k<a;k++)R(c[k],u?.slice(2*k,2*k+2),G?.[k],q);return new w({width:d,height:e,pixelType:y,pixels:c,mask:q})};m.maxMapSizeGpu=6;m.mosaic=p;m.mosaicPixelData=function(a,f){if(!a||0===a.length)return null;var d=a.find(H=>H.pixelBlock);if(null==d?.pixelBlock)return null;var e=(d.extent.xmax-d.extent.xmin)/d.pixelBlock.width;
const c=(d.extent.ymax-d.extent.ymin)/d.pixelBlock.height,k=.01*Math.min(e,c),q=a.sort((H,x)=>Math.abs(H.extent.ymax-x.extent.ymax)>k?x.extent.ymax-H.extent.ymax:Math.abs(H.extent.xmin-x.extent.xmin)>k?H.extent.xmin-x.extent.xmin:0);var u=Math.min.apply(null,q.map(H=>H.extent.xmin));const G=Math.min.apply(null,q.map(H=>H.extent.ymin)),y=Math.max.apply(null,q.map(H=>H.extent.xmax)),C=Math.max.apply(null,q.map(H=>H.extent.ymax));a={x:Math.round((f.xmin-u)/e),y:Math.round((C-f.ymax)/c)};u={width:Math.round((y-
u)/e),height:Math.round((C-G)/c)};e={width:Math.round((f.xmax-f.xmin)/e),height:Math.round((f.ymax-f.ymin)/c)};if(Math.round(u.width/d.pixelBlock.width)*Math.round(u.height/d.pixelBlock.height)!==q.length||0>a.x||0>a.y||u.width<e.width||u.height<e.height)return null;d=q.map(H=>H.pixelBlock);d=p(d,u,{clipOffset:a,clipSize:e});return{extent:f,pixelBlock:d}};m.remap=function(a,f){if(!J(a))return null;const {width:d,height:e}=a,{inputRanges:c,outputValues:k,outputPixelType:q,noDataRanges:u,allowUnmatched:G,
isLastInputRangeInclusive:y}=f;f=a.pixels[0];const C=w.createEmptyBand(q,f.length),H=a.mask,x=new Uint8Array(d*e);H?x.set(H):x.fill(255);const M=a.pixelType.startsWith("f")?1E-6:0;a=c.map(W=>W-M);a[0]=c[0];a[a.length-1]=c[c.length-1]+(y?1E-6:0);var L=c.length/2;const [N,E]=v.getPixelValueRange(q);for(var I=0;I<e;I++)for(var K=0;K<d;K++){var S=I*d+K;if(x[S]){var O=f[S];let W=!1;for(let Y=L-1;0<=Y;Y--)if(O===a[2*Y]||O>a[2*Y]&&O<a[2*Y+1]){C[S]=k[Y];W=!0;break}W||(G?C[S]=O>E?E:O<N?N:O:x[S]=0)}}if(a=u?.length)for(L=
0;L<e;L++)for(I=0;I<d;I++)if(K=L*d+I,!H||H[K])for(S=f[K],O=0;O<a;O+=2)if(S>=u[O]&&S<=u[O+1]){C[K]=0;x[K]=0;break}return new w({width:d,height:e,pixelType:q,pixels:[C],mask:x})};m.remapColor=function(a,f){if(!J(a))return null;a=a.clone();var {pixels:d}=a;const e=a.width*a.height,c=f.length,k=Math.floor(c/2),q=f[Math.floor(k)];d=d[0];let u,G,y,C,H,x,M=!1;const L=new Uint8Array(e),N=new Uint8Array(e),E=new Uint8Array(e);let I=a.mask;const K=4===f[0].mappedColor.length;I||(I=new Uint8Array(e),I.fill(K?
255:1),a.mask=I);for(H=0;H<e;H++)if(I[H]){u=d[H];M=!1;x=k;G=q;y=0;for(C=c-1;1<C-y;){if(u===G.value){M=!0;break}u>G.value?y=x:C=x;x=Math.floor((y+C)/2);G=f[Math.floor(x)]}M||(u===f[y].value?(G=f[y],M=!0):u===f[C].value?(G=f[C],M=!0):u<f[y].value?(M=!1,G=null):u>f[y].value&&(u<f[C].value?(G=f[y],M=!0):C===c-1?(M=!1,G=null):(G=f[C],M=!0)));M?(L[H]=G.mappedColor[0],N[H]=G.mappedColor[1],E[H]=G.mappedColor[2],I[H]=G.mappedColor[3]):L[H]=N[H]=E[H]=I[H]=0}a.pixels=[L,N,E];a.mask=I;a.pixelType="u8";a.maskIsAlpha=
K;return a};m.resampleByMajority=g;m.setValidBoundary=function(a,f,d){if(!J(a))return null;const {width:e,height:c}=a,k=f.x;f=f.y;const q=d.width+k;d=d.height+f;if(0>k||0>f||q>e||d>c||0===k&&0===f&&q===e&&d===c)return a;a.mask||(a.mask=new Uint8Array(e*c));const u=a.mask;for(let G=0;G<c;G++){const y=G*e;for(let C=0;C<e;C++)u[y+C]=G<f||G>=d||C<k||C>=q?0:1}a.updateStatistics();return a};m.split=function(a,f,d=0,e=!0){if(!J(a))return null;const {width:c,height:k}=f;let {width:q,height:u}=a;const G=new Map,
y={x:0,y:0};d=1+d;for(let C=0;C<d;C++){const H=Math.ceil(q/c),x=Math.ceil(u/k);for(let M=0;M<x;M++){y.y=M*k;for(let L=0;L<H;L++){y.x=L*c;const N=A(a,y,f);G.set(`${C}/${M}/${L}`,N)}}C<d-1&&(a=t(a,e));q=Math.round(q/2);u=Math.round(u/2)}return G};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/support/utils":function(){define("require exports ../../Color ../../symbols ../../core/asyncUtils ../../core/has ../../core/screenUtils ../../core/libs/gl-matrix-2/factories/vec3f64 ../../layers/effects/jsonUtils ./cimSymbolUtils ./gfxUtils ./Symbol3DMaterial".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b){function g(c){c=c.symbolLayers;if(!c)return null;let k=null;c.forEach(q=>{"object"===q.type&&q.resource?.href||(k="water"===q.type?q.color:q.material?q.material.color:null)});return k?new v(k):null}function h(c,k){if(null==k||null==c)return c;c=c.toRgba();c[3]*=k;return new v(c)}function n(c,k,q){if(c=c.symbolLayers){var u=G=>{k=k??G??(null!=q?e:null);return h(k,q)};c.forEach(G=>{if("object"!==G.type||!G.resource?.href||k)if("water"===G.type)G.color=u(G.color);else{const y=
u(null!=G.material?G.material.color:null);null==G.material?G.material=new b.Symbol3DMaterial({color:y}):G.material.color=y;null!=q&&"outline"in G&&null!=G.outline?.color&&(G.outline.color=h(G.outline.color,q))}})}}async function l(c,k){(c=c.symbolLayers)&&await F.forEach(c,async q=>A(q,k))}async function A(c,k){switch(c.type){case "extrude":c.size="number"===typeof k[2]?k[2]:0;break;case "icon":case "line":case "text":k=t(k);null!=k&&(c.size=k);break;case "path":const q=a(k,U.ONES,[c.width,void 0,
c.height]);c.width=d(k[0],c.width,1,q);c.height=d(k[2],c.height,1,q);break;case "object":await r(c,k)}}function t(c){for(const k of c)if("number"===typeof k)return k;return null}async function r(c,k){const {resourceSize:q,symbolSize:u}=await f(c),G=a(k,q,u);c.width=d(k[0],u[0],q[0],G);c.depth=d(k[1],u[1],q[1],G);c.height=d(k[2],u[2],q[2],G)}function a(c,k,q){for(let u=0;3>u;u++){const G=c[u];switch(G){case "symbol-value":return c=q[u],null!=c?c/k[u]:1;case "proportional":break;default:if(G&&k[u])return G/
k[u]}}return 1}async function f(c){var {computeObjectLayerResourceSize:k}=await new Promise((H,x)=>m(["./symbolLayerUtils"],H,x));k=await k(c,10);const {width:q,height:u,depth:G}=c;c=[q,G,u];let y=1;for(var C=0;3>C;C++){const H=c[C];if(null!=H){y=H/k[C];break}}for(C=0;3>C;C++)null==c[C]&&(c[C]=k[C]*y);return{resourceSize:k,symbolSize:c}}function d(c,k,q,u){switch(c){case "proportional":return q*u;case "symbol-value":return null!=k?k:q;default:return c}}const e=new v("white");w.applyColorToSymbol=
function(c,k,q){if(c&&(k||null!=q))if(k&&=new v(k),J.isSymbol3D(c))n(c,k,q);else if(J.isSymbol2D(c)){if(k=k??c.color)c.color=h(k,q);null!=q&&"outline"in c&&c.outline?.color&&(c.outline.color=h(c.outline.color,q))}};w.applyOpacityToColor=h;w.applyRotationToSymbol=function(c,k,q){c&&null!=k&&(J.isSymbol3D(c)?(c=c.symbolLayers)&&c.forEach(u=>{if(u&&"object"===u.type)switch(q){case "tilt":u.tilt=(u.tilt??0)+k;break;case "roll":u.roll=(u.roll??0)+k;break;default:u.heading=(u.heading??0)+k}}):!J.isSymbol2D(c)||
"simple-marker"!==c.type&&"picture-marker"!==c.type&&"text"!==c.type||(c.angle+=k))};w.applySizesToSymbol=async function(c,k){if(c&&k){if(J.isSymbol3D(c))return l(c,k);if(J.isSymbol2D(c)&&(k=t(k),null!=k))switch(c.type){case "simple-marker":c.size=k;break;case "picture-marker":const q=c.width/c.height;1<q?(c.width=k,c.height=k*q):(c.width=k*q,c.height=k);break;case "simple-line":c.width=k;break;case "text":c.font.size=k}}};w.fetchWebStyleSymbol=async function(c,k){const q=await c.fetchSymbol(k);return q?
q:c.fetchCIMSymbol(k)};w.getCSSFilterFromEffectList=function(c){if(!c)return null;c=c.effects.filter(k=>"bloom"!==k.type).map(k=>k.toJSON());return D.effectFunctionsFromJSON(c)};w.getColorFromSymbol=function(c,k){if(!c)return null;let q=null;J.isSymbol3D(c)?q=g(c):J.isSymbol2D(c)&&(q="cim"===c.type?z.getCIMSymbolColor(c):c.color?new v(c.color):null);return q?h(q,k):null};w.getIconHref=function(c){return c.resource?.href??""};w.getSymbolOutlineSize=function(c){return c?J.isSymbol3D(c)?(c=(c=c.symbolLayers?.at(-1))&&
"outline"in c?c?.outline?.size:void 0,null!=c?c:0):P.px2pt(p.getStroke(c)?.width):0};w.isVolumetricSymbol=function(c){if(null==c||!("symbolLayers"in c)||null==c.symbolLayers)return!1;switch(c.type){case "point-3d":return c.symbolLayers.some(k=>"object"===k.type);case "line-3d":return c.symbolLayers.some(k=>"path"===k.type);case "polygon-3d":return c.symbolLayers.some(k=>"object"===k.type||"extrude"===k.type);default:return!1}};w.symbolHasExtrudeSymbolLayer=function(c){return null!=c&&"polygon-3d"===
c.type&&c.symbolLayers.some(k=>"extrude"===k.type)};Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/support/cimSymbolUtils":function(){define(["exports","../../Color","../cim/utils"],function(m,w,v){function J(b){b=v.toCIMSymbolJSON(b);if("CIMTextSymbol"===b?.type)return b.height??0;let g=0;if(b?.symbolLayers)for(const h of b.symbolLayers)v.isCIMMarker(h)&&null!=h.size&&h.size>g?g=h.size:v.isCIMStroke(h)&&null!=h.width&&h.width>g?g=h.width:v.isCIMFill(h);return g}function F(b,
g,h,n){if(b)if("CIMTextSymbol"===b.type)null!=b.height&&(b.height*=g);else{if(h&&b.effects)for(const l of b.effects)U(l,g);if(b.symbolLayers)for(const l of b.symbolLayers)switch(l.type){case "CIMPictureMarker":case "CIMVectorMarker":R(l,g,n);break;case "CIMPictureStroke":case "CIMSolidStroke":!n?.preserveOutlineWidth&&l.width&&(l.width*=g);break;case "CIMPictureFill":l.height&&(l.height*=g);l.offsetX&&(l.offsetX*=g);l.offsetY&&(l.offsetY*=g);break;case "CIMHatchFill":F(l.lineSymbol,g,!0,{...n,preserveOutlineWidth:!1}),
l.offsetX&&(l.offsetX*=g),l.offsetY&&(l.offsetY*=g),l.separation&&(l.separation*=g)}}}function R(b,g,h){if(b&&(b.markerPlacement&&P(b.markerPlacement,g),b.offsetX&&(b.offsetX*=g),b.offsetY&&(b.offsetY*=g),b.anchorPoint&&"Absolute"===b.anchorPointUnits&&(b.anchorPoint={x:b.anchorPoint.x*g,y:b.anchorPoint.y*g}),b.size=null!=b.size?b.size*g:0,"CIMVectorMarker"===b.type&&b.markerGraphics))for(const n of b.markerGraphics)b.scaleSymbolsProportionally||F(n.symbol,g,!0,h)}function P(b,g){v.isCIMMarkerStrokePlacement(b)&&
b.offset&&(b.offset*=g);switch(b.type){case "CIMMarkerPlacementAlongLineRandomSize":case "CIMMarkerPlacementAlongLineSameSize":b.customEndingOffset&&(b.customEndingOffset*=g);b.offsetAlongLine&&(b.offsetAlongLine*=g);if(b.placementTemplate&&b.placementTemplate.length){var h=b.placementTemplate.map(n=>n*g);b.placementTemplate=h}break;case "CIMMarkerPlacementAlongLineVariableSize":b.maxRandomOffset&&(b.maxRandomOffset*=g);b.placementTemplate&&b.placementTemplate.length&&(h=b.placementTemplate.map(n=>
n*g),b.placementTemplate=h);break;case "CIMMarkerPlacementOnLine":b.startPointOffset&&(b.startPointOffset*=g);break;case "CIMMarkerPlacementAtExtremities":b.offsetAlongLine&&(b.offsetAlongLine*=g);break;case "CIMMarkerPlacementAtRatioPositions":b.beginPosition&&(b.beginPosition*=g);b.endPosition&&(b.endPosition*=g);break;case "CIMMarkerPlacementPolygonCenter":b.offsetX&&(b.offsetX*=g);b.offsetY&&(b.offsetY*=g);break;case "CIMMarkerPlacementInsidePolygon":b.offsetX&&(b.offsetX*=g),b.offsetY&&(b.offsetY*=
g),b.stepX&&(b.stepX*=g),b.stepY&&(b.stepY*=g)}}function U(b,g){switch(b.type){case "CIMGeometricEffectArrow":case "CIMGeometricEffectDonut":b.width&&(b.width*=g);break;case "CIMGeometricEffectBuffer":b.size&&(b.size*=g);break;case "CIMGeometricEffectCut":b.beginCut&&(b.beginCut*=g);b.endCut&&(b.endCut*=g);b.middleCut&&(b.middleCut*=g);break;case "CIMGeometricEffectDashes":b.customEndingOffset&&(b.customEndingOffset*=g);b.offsetAlongLine&&(b.offsetAlongLine*=g);if(b.dashTemplate&&b.dashTemplate.length){const h=
b.dashTemplate.map(n=>n*g);b.dashTemplate=h}break;case "CIMGeometricEffectExtension":case "CIMGeometricEffectJog":case "CIMGeometricEffectRadial":b.length&&(b.length*=g);break;case "CIMGeometricEffectMove":b.offsetX&&(b.offsetX*=g);b.offsetY&&(b.offsetY*=g);break;case "CIMGeometricEffectOffset":case "CIMGeometricEffectOffsetTangent":b.offset&&(b.offset*=g);break;case "CIMGeometricEffectRegularPolygon":b.radius&&(b.radius*=g);break;case "CIMGeometricEffectTaperedPolygon":b.fromWidth&&(b.fromWidth*=
g);b.length&&(b.length*=g);b.toWidth&&(b.toWidth*=g);break;case "CIMGeometricEffectWave":b.amplitude&&(b.amplitude*=g),b.period&&(b.period*=g)}}function D(b,g){if(b){var h="CIMTextSymbol"===b.type?b.symbol:b;b="CIMPolygonSymbol"===b.type;if(h?.symbolLayers)for(const n of h.symbolLayers)if(!(n.colorLocked||b&&(v.isCIMStroke(n)||v.isCIMMarker(n)&&n.markerPlacement&&v.isCIMMarkerStrokePlacement(n.markerPlacement))))switch(n.type){case "CIMPictureMarker":case "CIMPictureStroke":case "CIMPictureFill":n.tintColor&&
z(g,n.tintColor);break;case "CIMVectorMarker":n.markerGraphics?.forEach(l=>{D(l.symbol,g)});break;case "CIMSolidStroke":case "CIMSolidFill":z(g,n.color);break;case "CIMHatchFill":D(n.lineSymbol,g)}}}function z(b,g){for(const h of b)if(h.join(".")===g.join("."))return;b.push(g)}function p(b,g,h){if(b){var n="CIMTextSymbol"===b.type?b.symbol:b;b="CIMPolygonSymbol"===n?.type;if(n?.symbolLayers)for(const l of n.symbolLayers)if(!l.colorLocked){if(b)if(h){if({layersToColor:n}=h,(v.isCIMStroke(l)||v.isCIMMarker(l)&&
l.markerPlacement&&v.isCIMMarkerStrokePlacement(l.markerPlacement))&&"fill"===n||v.isCIMFill(l)&&"outline"===n)continue}else if(v.isCIMStroke(l)||v.isCIMMarker(l)&&l.markerPlacement&&v.isCIMMarkerStrokePlacement(l.markerPlacement))continue;n=g.toArray();switch(l.type){case "CIMPictureMarker":case "CIMPictureStroke":case "CIMPictureFill":l.tintColor=n;break;case "CIMVectorMarker":l.markerGraphics?.forEach(A=>{p(A.symbol,g,h)});break;case "CIMSolidStroke":case "CIMSolidFill":l.color=n;break;case "CIMHatchFill":p(l.lineSymbol,
g,h)}}}}m.applyCIMSymbolColor=function(b,g,h){g instanceof w||(g=new w(g));(b=v.toCIMSymbolJSON(b))&&p(b,g,h)};m.applyCIMSymbolRotation=function(b,g,h=!1){b=v.toCIMSymbolJSON(b);h&&(g=360-g);if("CIMTextSymbol"===b?.type)b.angle=g;else if("CIMPointSymbol"===b?.type&&b.symbolLayers){h=g-(b.angle||0);for(const n of b.symbolLayers)if(v.isCIMMarker(n)){let l=n.rotation||0;l=n.rotateClockwise?l-h:l+h;n.rotation=l}b.angle=g}};m.getCIMSymbolColor=function(b){b=v.toCIMSymbolJSON(b);const g=[];D(b,g);return g.length?
new w(v.normalizeAlpha(g[0])):null};m.getCIMSymbolRotation=function(b,g=!1){b=v.toCIMSymbolJSON(b);return"CIMTextSymbol"===b?.type||"CIMPointSymbol"===b?.type?(b=b.angle,null!=b&&g?360-b:b??0):0};m.getCIMSymbolSize=J;m.getCIMSymbolType=function(b){b=v.toCIMSymbolJSON(b);if(!b)return null;switch(b.type){case "CIMPointSymbol":return"CIMPointSymbol";case "CIMLineSymbol":return"CIMLineSymbol";case "CIMPolygonSymbol":return"CIMPolygonSymbol";case "CIMTextSymbol":return"CIMTextSymbol";case "CIMMeshSymbol":return"CIMMeshSymbol";
default:return null}};m.scaleCIMMarker=R;m.scaleCIMSymbol=F;m.scaleCIMSymbolTo=function(b,g,h){if(b){var n=v.toCIMSymbolJSON(b);b=J(b);if(0===b){if(n)if("CIMTextSymbol"===n.type)n.height=g;else if(n.symbolLayers)for(const l of n.symbolLayers)switch(l.type){case "CIMPictureMarker":case "CIMVectorMarker":l.size=g;break;case "CIMPictureStroke":case "CIMSolidStroke":l.width=g}}else F(n,g/b,!1,h)}};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/symbols/support/gfxUtils":function(){define("exports ../../assets ../../Color ../../request ../../core/LRUCache ../../core/screenUtils ./cimSymbolUtils".split(" "),
function(m,w,v,J,F,R,P){function U(g){if(!g)return null;let h=null;switch(g.type){case "simple-fill":case "picture-fill":case "simple-marker":h=U(g.outline);break;case "simple-line":const n=R.pt2px(g.width);null!=g.style&&"none"!==g.style&&0!==n&&(h={color:g.color,style:b(g.style),width:n,cap:g.cap,join:"miter"===g.join?R.pt2px(g.miterLimit):g.join},h.dashArray=D(h).join(",")||"none");break;default:h=null}return h}function D(g){if(!g?.style)return[];const {dashArray:h,style:n,width:l}=g;if("string"===
typeof h&&"none"!==h)return h.split(",").map(r=>Number(r));const A=l??0,t=z.has(n)?z.get(n).map(r=>r*A):[];if("butt"!==g.cap)for(const [r,a]of t.entries())t[r]=1===r%2?a+A:Math.max(a-A,1);return t}const z=new Map([["dash",[4,3]],["dashdot",[4,3,1,3]],["dot",[1,3]],["longdash",[8,3]],["longdashdot",[8,3,1,3]],["longdashdotdot",[8,3,1,3,1,3]],["shortdash",[4,1]],["shortdashdot",[4,1,1,1]],["shortdashdotdot",[4,1,1,1,1,1]],["shortdot",[1,1]],["solid",[]]]),p=new F.LRUCache(1E3),b=(()=>{const g={};return h=>
{if(g[h])return g[h];const n=h.replaceAll("-","");return g[h]=n}})();v=new v([128,128,128]);m.defaultThematicColor=v;m.dekebabifyLineStyle=b;m.getDashArray=D;m.getFill=function(g){const h=g.style;let n=null;if(g)switch(g.type){case "simple-marker":"cross"!==h&&"x"!==h&&(n=g.color);break;case "simple-fill":h&&"solid"!==h?"none"!==h&&(n={type:"pattern",x:0,y:0,src:w.getAssetUrl(`esri/symbols/patterns/${h}.png`),width:5,height:5}):n=g.color;break;case "picture-fill":n={type:"pattern",src:g.url,width:R.pt2px(g.width)*
g.xscale,height:R.pt2px(g.height)*g.yscale,x:R.pt2px(g.xoffset),y:R.pt2px(g.yoffset)};break;case "text":n=g.color;break;case "cim":n=P.getCIMSymbolColor(g)}return n};m.getPatternUrlWithColor=function(g,h){const n=g+"-"+h;return void 0!==p.get(n)?Promise.resolve(p.get(n)):J(g,{responseType:"image"}).then(l=>{l=l.data;const A=l.naturalWidth,t=l.naturalHeight,r=document.createElement("canvas");r.width=A;r.height=t;const a=r.getContext("2d");a.fillStyle=h;a.fillRect(0,0,A,t);a.globalCompositeOperation=
"destination-in";a.drawImage(l,0,0);l=r.toDataURL();p.put(n,l);return l})};m.getStroke=U;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/DimensionalDefinition":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/lang ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/accessorSupport/decorators/subclass".split(" "),function(m,w,v,J,F,R){var P;w=P=class extends w.JSONSupport{constructor(U){super(U);
this.dimensionName=this.variableName=null;this.values=[];this.isSlice=!1}clone(){return new P({variableName:this.variableName,dimensionName:this.dimensionName,values:v.clone(this.values),isSlice:this.isSlice})}};m.__decorate([J.property({type:String,json:{write:!0}})],w.prototype,"variableName",void 0);m.__decorate([J.property({type:String,json:{write:!0}})],w.prototype,"dimensionName",void 0);m.__decorate([J.property({type:F.types.array(F.types.oneOf([F.types.native(Number),F.types.array(F.types.native(Number))])),
json:{write:!0}})],w.prototype,"values",void 0);m.__decorate([J.property({type:Boolean,json:{write:!0}})],w.prototype,"isSlice",void 0);return w=P=m.__decorate([R.subclass("esri.layers.support.DimensionalDefinition")],w)})},"esri/layers/support/MultidimensionalSubset":function(){define("../../chunks/tslib.es6 ../../geometry ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../geometry/Extent ../../geometry/Polygon ../../geometry/support/jsonUtils ./DimensionalDefinition ../../geometry/Geometry".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g){var h;w={base:g,key:"type",typeMap:{extent:D,polygon:z}};v=h=class extends v.JSONSupport{constructor(n){super(n);this.subsetDefinitions=this.areaOfInterest=null}get dimensions(){var {subsetDefinitions:n}=this;if(null==n||0===n.length)return[];const l=new Map;n.forEach(A=>{if(A.dimensionName){if(Array.isArray(A.values[0])){var t=A.values;var r=t[0][0];t=t[A.values.length-1][1]}else t=A.values,r=t[0],t=t[A.values.length-1];l.has(A.dimensionName)?(A=l.get(A.dimensionName),
A[0]=Math.min(r,A[0]),A[1]=Math.max(t,A[1])):l.set(A.dimensionName,[r,t])}});n=[];for(const A of l)n.push({name:A[0],extent:A[1]});return n}get variables(){const {subsetDefinitions:n}=this;if(null==n||0===n.length)return[];const l=new Set;n.forEach(A=>{A.variableName&&l.add(A.variableName)});return[...l]}clone(){const n=this.subsetDefinitions?.map(A=>A.clone()),l=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new h({areaOfInterest:l,subsetDefinitions:n})}};m.__decorate([J.property({types:w,
json:{read:p.fromJSON,write:!0}})],v.prototype,"areaOfInterest",void 0);m.__decorate([J.property({readOnly:!0})],v.prototype,"dimensions",null);m.__decorate([J.property({readOnly:!0})],v.prototype,"variables",null);m.__decorate([J.property({type:[b],json:{write:!0}})],v.prototype,"subsetDefinitions",void 0);return v=h=m.__decorate([U.subclass("esri.layers.support.MultidimensionalSubset")],v)})},"esri/layers/support/RasterFunction":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/lang ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/accessorSupport/decorators/enumeration ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer ./RasterFunctionTemplate".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p){var b;const g=new Set(["raster","raster2","dem","fillraster"]),h=new Set(["rasters"]),n=r=>r?.rasterFunction?t.fromJSON(r):r,l=r=>r&&r instanceof t?r.toJSON():r,A=r=>r?.functionName&&!r.declaredClass?new t(r):r;F={types:{key:"type",base:null,typeMap:{RasterFunctionTemplate:p}},json:{write:!0,name:"rasterFunctionDefinition"}};let t=b=class extends w.JSONSupport{constructor(r){super(r);this.functionName=null;this.outputPixelType="unknown";this.functionDefinition=this.variableName=
null}set functionArguments(r){if(r){const a=Object.keys(r);if(a.some(f=>{var d;if(d=g.has(f.toLowerCase()))f=r[f],d=f?.functionName&&!f.declaredClass;return d})||a.some(f=>h.has(f.toLowerCase())&&Array.isArray(r[f])&&r[f].some(d=>d?.functionName&&!d.declaredClass))){r=v.clone(r);for(const f of a)g.has(f.toLowerCase())?r[f]=A(r[f]):h.has(f.toLowerCase())&&Array.isArray(r[f])&&(r[f]=r[f].map(d=>A(d)))}}this._set("functionArguments",r)}readFunctionArguments(r){if(null==r)var a=null;else{r=v.clone(r);
var f={};for(a of Object.keys(r))g.has(a.toLowerCase())?f[a]=n(r[a]):h.has(a.toLowerCase())&&Array.isArray(r[a])?f[a]=r[a].map(n):f[a]=r[a];a=f}return a}writeFunctionArguments(r,a,f){const d={};for(const e of Object.keys(r))g.has(e.toLowerCase())?d[e]=l(r[e]):h.has(e.toLowerCase())&&Array.isArray(r[e])?d[e]=r[e].map(l):d[e]=l(r[e]);a[f]=d}readFunctionName(r,a){r=a.rasterFunctionInfos;const f=a.name;return f?f:r?.length&&"None"!==r[0].name?r[0].name:a.rasterFunctionDefinition?a.rasterFunctionDefinition.name:
a.rasterFunction}get rasterFunctionDefinition(){return this.functionDefinition?.toJSON()}set rasterFunctionDefinition(r){this.functionDefinition=r?p.fromJSON(r):null}get hasClipFunction(){return this.rasterFunctionDefinition?JSON.stringify(this.rasterFunctionDefinition).includes('"type":"ClipFunction"'):JSON.stringify(this).includes('"rasterFunction":"Clip"')}clone(){return new b({functionName:this.functionName,functionArguments:v.clone(this.functionArguments),outputPixelType:this.outputPixelType,
variableName:this.variableName,rasterFunctionDefinition:v.clone(this.rasterFunctionDefinition)})}};m.__decorate([J.property({json:{type:Object,name:"rasterFunctionArguments"}})],t.prototype,"functionArguments",null);m.__decorate([U.reader("functionArguments")],t.prototype,"readFunctionArguments",null);m.__decorate([z.writer("functionArguments")],t.prototype,"writeFunctionArguments",null);m.__decorate([J.property({json:{type:String,write:{target:"rasterFunction"}}})],t.prototype,"functionName",void 0);
m.__decorate([U.reader("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],t.prototype,"readFunctionName",null);m.__decorate([P.enumeration({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1}),J.property({json:{default:"unknown"}})],t.prototype,"outputPixelType",void 0);m.__decorate([J.property({type:String,json:{read:!0,write:!0}})],t.prototype,"variableName",
void 0);m.__decorate([J.property()],t.prototype,"rasterFunctionDefinition",null);m.__decorate([J.property(F)],t.prototype,"functionDefinition",void 0);m.__decorate([J.property()],t.prototype,"hasClipFunction",null);return t=b=m.__decorate([D.subclass("esri.layers.support.RasterFunction")],t)})},"esri/layers/support/RasterFunctionTemplate":function(){define("../../chunks/tslib.es6 ../../core/jsonMap ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/subclass ./RasterFunctionInfo ./RasterFunctionProperties".split(" "),
function(m,w,v,J,F,R,P,U,D,z){w=new w.JSONMap({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});v=class extends v.JSONSupport{constructor(){super(...arguments);this.functionType="mosaic";this.type="RasterFunctionTemplate"}};m.__decorate([J.property({type:[String],json:{write:!0}})],v.prototype,"aliases",void 0);m.__decorate([J.property({type:Object,json:{write:!0}})],v.prototype,"arguments",void 0);m.__decorate([J.property({type:String,json:{write:!0}})],v.prototype,"description",void 0);
m.__decorate([J.property({type:D,json:{write:!0,name:"function"}})],v.prototype,"functionInfo",void 0);m.__decorate([J.property({type:w.apiValues,json:{type:[0,1,2],read:w.read,write:w.write}})],v.prototype,"functionType",void 0);m.__decorate([J.property({type:String,json:{write:!0}})],v.prototype,"group",void 0);m.__decorate([J.property({type:String,json:{write:!0}})],v.prototype,"help",void 0);m.__decorate([J.property({type:Number,json:{type:F.Integer,write:!0,name:"_object_id"}})],v.prototype,
"id",void 0);m.__decorate([J.property({type:String,json:{write:!0}})],v.prototype,"name",void 0);m.__decorate([J.property({type:String,json:{write:!0,name:"definition"}})],v.prototype,"queryDefinition",void 0);m.__decorate([J.property({type:String,json:{write:!0}})],v.prototype,"tag",void 0);m.__decorate([J.property({type:z,json:{write:!0}})],v.prototype,"properties",void 0);m.__decorate([J.property({type:String,json:{write:!0}})],v.prototype,"thumbnail",void 0);m.__decorate([J.property({type:String,
json:{write:!0}})],v.prototype,"thumbnailEx",void 0);m.__decorate([J.property({json:{type:["RasterFunctionTemplate"],write:!0}})],v.prototype,"type",void 0);return v=m.__decorate([U.subclass("esri.layers.support.RasterFunctionTemplate")],v)})},"esri/layers/support/RasterFunctionInfo":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/subclass ./rasterEnums".split(" "),
function(m,w,v,J,F,R,P,U){w=class extends w.JSONSupport{constructor(){super(...arguments);this.pixelType="unknown"}};m.__decorate([v.property({type:String,json:{write:!0}})],w.prototype,"name",void 0);m.__decorate([v.property({type:String,json:{write:!0}})],w.prototype,"description",void 0);m.__decorate([v.property({type:J.Integer,json:{type:J.Integer,write:!0,name:"_object_id"}})],w.prototype,"id",void 0);m.__decorate([v.property({type:String,json:{type:U.pixelTypeKebabDict.jsonValues,read:U.pixelTypeKebabDict.read,
write:U.pixelTypeKebabDict.write}})],w.prototype,"pixelType",void 0);m.__decorate([v.property({type:String,json:{write:!0}})],w.prototype,"type",void 0);return w=m.__decorate([P.subclass("esri.layers.support.RasterFunctionInfo")],w)})},"esri/layers/support/rasterEnums":function(){define(["exports","../../core/jsonMap"],function(m,w){const v=w.strict()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),J=w.strict()({esriNoDataMatchAny:"any",
esriNoDataMatchAll:"all"});w=w.strict()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"});m.interpolationKebab=v;m.noDataInterpretationKebab=J;m.pixelTypeKebabDict=w;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/RasterFunctionProperties":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/subclass ./RasterFunctionVariable".split(" "),
function(m,w,v,J,F,R,P,U){F={key:"type",base:null,typeMap:{RasterFunctionVariable:U}};w=class extends w.JSONSupport{};m.__decorate([v.property({types:F,json:{types:F,name:"MatchVariable"}})],w.prototype,"matchVariable",void 0);m.__decorate([v.property({types:F,json:{types:F,name:"UnionDimension"}})],w.prototype,"unionDimension",void 0);m.__decorate([v.property({type:Number,json:{type:J.Integer,write:!0,name:"_object_id"}})],w.prototype,"id",void 0);m.__decorate([v.property({type:String,json:{write:!0}})],
w.prototype,"type",void 0);return w=m.__decorate([P.subclass("esri.layers.support.RasterFunctionProperties")],w)})},"esri/layers/support/RasterFunctionVariable":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/subclass".split(" "),function(m,w,v,J,F,R,P){w=class extends w.JSONSupport{constructor(){super(...arguments);this.isPublic=
this.isDataset=!1;this.type="RasterFunctionVariable"}};m.__decorate([v.property({type:String,json:{write:!0}})],w.prototype,"name",void 0);m.__decorate([v.property({type:Number,json:{type:J.Integer,write:!0,name:"_object_id"}})],w.prototype,"id",void 0);m.__decorate([v.property({type:Boolean,json:{write:!0}})],w.prototype,"isDataset",void 0);m.__decorate([v.property({type:Boolean,json:{write:!0}})],w.prototype,"isPublic",void 0);m.__decorate([v.property({json:{write:!0}})],w.prototype,"value",void 0);
m.__decorate([v.property({type:String,json:{write:!0}})],w.prototype,"type",void 0);return w=m.__decorate([P.subclass("esri.layers.support.RasterFunctionVariable")],w)})},"esri/layers/support/RasterJobHandler":function(){define(["../../core/Error","../../core/workers/workers","./PixelBlock"],function(m,w,v){class J{constructor(){this._workerThread=null;this._destroyed=!1}async initialize(){const F=await w.open("RasterWorker");this._destroyed?F.close():this._workerThread=F}destroy(){this._destroyed=
!0;this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(F,R){if(!this._workerThread)throw new m("raster-jobhandler:no-connection","no available worker connection");return(F=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:F.pixelBlock.toJSON(),type:F.dataType},R))?new v(F):null}computeStatisticsHistograms(F,R){if(!this._workerThread)throw new m("raster-jobhandler:no-connection","no available worker connection");return this._workerThread.invoke("computeStatisticsHistograms",
{pixelBlock:F.pixelBlock.toJSON()},R)}async decode(F,R){if(!this._workerThread)throw new m("raster-jobhandler:no-connection","no available worker connection");return(F=await this._workerThread.invoke("decode",F,R))?new v(F):null}async symbolize(F,R){if(!this._workerThread)throw new m("raster-jobhandler:no-connection","no available worker connection");F={extent:F.extent?.toJSON(),pixelBlock:F.pixelBlock?.toJSON(),simpleStretchParams:F.simpleStretchParams,bandIds:F.bandIds};return(R=await this._workerThread.invoke("symbolize",
F,R))?new v(R):null}async updateSymbolizer(F,R){if(!this._workerThread)throw new m("raster-jobhandler:no-connection","no available worker connection");const P=F?.rendererJSON?.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:F.toJSON(),histograms:P},R))}async updateRasterFunction(F,R){if(!this._workerThread)throw new m("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",
{rasterFunctionJSON:F.toJSON()},R))}async process(F,R){if(!this._workerThread)throw new m("raster-jobhandler:no-connection","no available worker connection");return(F=await this._workerThread.invoke("process",{extent:F.extent?.toJSON(),primaryPixelSizes:F.primaryPixelSizes?.map(P=>null!=P?P.toJSON():null),primaryPixelBlocks:F.primaryPixelBlocks.map(P=>null!=P?P.toJSON():null),primaryRasterIds:F.primaryRasterIds},R))?new v(F):null}async stretch(F,R){if(!this._workerThread)throw new m("raster-jobhandler:no-connection",
"no available worker connection");if(!F?.pixelBlock)return null;F={srcPixelBlock:F.pixelBlock.toJSON(),stretchParams:F.stretchParams};return(R=await this._workerThread.invoke("stretch",F,R))?new v(R):null}async split(F,R){if(!this._workerThread)throw new m("raster-jobhandler:no-connection","no available worker connection");if(!F?.pixelBlock)return null;F={srcPixelBlock:F.pixelBlock.toJSON(),tileSize:F.tileSize,maximumPyramidLevel:F.maximumPyramidLevel,useBilinear:F.useBilinear};const P=await this._workerThread.invoke("split",
F,R);P&&P.forEach((U,D)=>{P.set(D,U?v.fromJSON(U):null)});return P}async clipTile(F,R){if(!this._workerThread)throw new m("raster-jobhandler:no-connection","no available worker connection");if(!F?.pixelBlock)return null;F={...F,pixelBlock:F.pixelBlock.toJSON()};return(R=await this._workerThread.invoke("clipTile",F,R))?v.fromJSON(R):null}async estimateStatisticsHistograms(F,R){if(!this._workerThread)throw new m("raster-jobhandler:no-connection","no available worker connection");if(!F?.pixelBlock)return null;
F={srcPixelBlock:F.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",F,R)}async mosaicAndTransform(F,R){if(!this._workerThread)throw new m("raster-jobhandler:no-connection","no available worker connection");if(!F?.srcPixelBlocks?.length)return{pixelBlock:null};F={...F,srcPixelBlocks:F.srcPixelBlocks.map(P=>null!=P?P.toJSON():null)};R=await this._workerThread.invoke("mosaicAndTransform",F,R);return{pixelBlock:R.pixelBlock?new v(R.pixelBlock):null,localNorthDirections:R.localNorthDirections}}async createFlowMesh(F,
R){if(!this._workerThread)throw new m("raster-jobhandler:no-connection","no available worker connection");const P={buffer:F.flowData.data.buffer,maskBuffer:F.flowData.mask.buffer,width:F.flowData.width,height:F.flowData.height},{meshType:U,simulationSettings:D}=F;F=await this._workerThread.invoke("createFlowMesh",{meshType:U,flowData:P,simulationSettings:D},{...R,transferList:[P.buffer,P.maskBuffer]});return{vertexData:new Float32Array(F.vertexBuffer),indexData:new Uint32Array(F.indexBuffer)}}getProjectionOffsetGrid(F,
R){if(!this._workerThread)throw new m("raster-jobhandler:no-connection","no available worker connection");const P=null!=F.datumTransformation?F.datumTransformation.steps.map(D=>({wkid:D.wkid,wkt:D.wkt,isInverse:D.isInverse})):null,U=null!=F.rasterTransform?F.rasterTransform.toJSON():null;F={projectedExtent:F.projectedExtent.toJSON(),srcBufferExtent:F.srcBufferExtent.toJSON(),pixelSize:F.pixelSize,hasWrapAround:F.hasWrapAround,spacing:F.spacing,datumTransformationSteps:P,rasterTransform:U,isAdaptive:F.isAdaptive,
includeGCSGrid:F.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",F,R)}}return J})},"esri/layers/support/TileInfo":function(){define("../../chunks/tslib.es6 ../../core/jsonMap ../../core/JSONSupport ../../core/unitUtils ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer ../../geometry/Point ../../geometry/SpatialReference ../../geometry/support/aaBoundingRect ../../geometry/support/spatialReferenceUtils ../../geometry/support/webMercatorUtils ./LOD ./TileKey".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h,n,l,A,t){var r;w=new w.JSONMap({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});v=r=class extends v.JSONSupport{static create(a={}){const {resolutionFactor:f=1,scales:d,size:e=256,spatialReference:c=g.WebMercator,numLODs:k=24}=a;if(!n.isValid(c)){a=[];if(d)for(var q=0;q<d.length;q++){var u=
d[q];a.push(new A({level:q,scale:u,resolution:u}))}else for(q=5E-4,u=k-1;0<=u;u--)a.unshift(new A({level:u,scale:q,resolution:q})),q*=2;return new r({dpi:96,lods:a,origin:new b(0,0,c),size:[e,e],spatialReference:c})}q=n.getInfo(c);a=a.origin?new b({x:a.origin.x,y:a.origin.y,spatialReference:c}):q?new b({x:q.origin[0],y:q.origin[1],spatialReference:c}):new b({x:0,y:0,spatialReference:c});q=1/(39.37*J.getMetersPerUnitForSR(c)*96);u=[];if(d)for(var G=0;G<d.length;G++){var y=d[G];u.push(new A({level:G,
scale:y,resolution:y*q}))}else{var C=n.isGeographic(c)?512/e*5.916575275917094E8:256/e*5.91657527591555E8;G=Math.ceil(k/f);u.push(new A({level:0,scale:C,resolution:C*q}));for(y=1;y<G;y++)C/=2**f,u.push(new A({level:y,scale:C,resolution:C*q}))}return new r({dpi:96,lods:u,origin:a,size:[e,e],spatialReference:c})}constructor(a){super(a);this.dpi=96;this.spatialReference=this.size=this.origin=this.format=null}get isWrappable(){const {spatialReference:a,origin:f}=this;if(a&&f){const d=n.getInfo(a);return a.isWrappable&&
!!d&&Math.abs(d.origin[0]-f.x)<=d.dx}return!1}readOrigin(a,f){return b.fromJSON({spatialReference:f.spatialReference,...a})}set lods(a){const f=[],d=this._levelToLOD={};a&&a.forEach(e=>{f.push(e.scale);d[e.level]=e});this._set("scales",f);this._set("lods",a);this._initializeUpsampleLevels()}readSize(a,f){return[f.cols,f.rows]}writeSize(a,f){f.cols=a[0];f.rows=a[1]}zoomToScale(a){const f=this.scales;if(0>=a)return f[0];if(a>=f.length-1)return f[f.length-1];const d=Math.floor(a);return f[d]/(f[d]/f[d+
1])**(a-d)}scaleToZoom(a){const f=this.scales,d=f.length-1;let e=0;for(;e<d;e++){const c=f[e],k=f[e+1];if(c<=a)break;if(k===a)return e+1;if(c>a&&k<a)return e+Math.log(c/a)/Math.log(c/k)}return e}tileAt(a,f,d,e){var c=this.lodAt(a);if(!c)return null;let k;if("number"===typeof f)k=f,f=d;else{if(n.equals(f.spatialReference,this.spatialReference))k=f.x,f=f.y;else{e=l.project(f,this.spatialReference);if(null==e)return null;k=e.x;f=e.y}e=d}d=c.resolution*this.size[0];c=c.resolution*this.size[1];e||=new t.TileKey(null,
0,0,0,h.create());e.level=a;e.row=Math.floor((this.origin.y-f)/c+.001);e.col=Math.floor((k-this.origin.x)/d+.001);this.updateTileInfo(e);return e}updateTileInfo(a,f=r.ExtrapolateOptions.NONE){var d=this.lodAt(a.level);d||f!==r.ExtrapolateOptions.POWER_OF_TWO||(f=this.lods[this.lods.length-1],f.level<a.level&&(d=f));if(d){var e=a.level-d.level;f=d.resolution*this.size[0]/2**e;d=d.resolution*this.size[1]/2**e;a.id=`${a.level}/${a.row}/${a.col}`;a.extent||(a.extent=h.create());a.extent[0]=this.origin.x+
a.col*f;a.extent[1]=this.origin.y-(a.row+1)*d;a.extent[2]=a.extent[0]+f;a.extent[3]=a.extent[1]+d}}upsampleTile(a){const f=this._upsampleLevels[a.level];if(!f||-1===f.parentLevel)return!1;a.level=f.parentLevel;a.row=Math.floor(a.row/f.factor+.001);a.col=Math.floor(a.col/f.factor+.001);this.updateTileInfo(a);return!0}getTileBounds(a,f){var d=this.lodAt(f.level);if(null==d)return null;var {resolution:e}=d;d=e*this.size[0];e*=this.size[1];a[0]=this.origin.x+f.col*d;a[1]=this.origin.y-(f.row+1)*e;a[2]=
a[0]+d;a[3]=a[1]+e;return a}lodAt(a){return this._levelToLOD?.[a]??null}clone(){return r.fromJSON(this.write({}))}getCompatibleForVTL(a){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===a)return null;const f=(512===this.size[0]&&256===a?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===a&&0===f)return this;const d=[],e=this.lods.length-f;for(let c=0;c<e;c++){const k=c+f,{scale:q,resolution:u}=0<=k?this.lods[k]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};
d.push(new A({level:c,scale:q,resolution:u}))}return new r({size:[a,a],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:d})}_initializeUpsampleLevels(){const a=this.lods;this._upsampleLevels=[];let f=null;for(let d=0;d<a.length;d++){const e=a[d];this._upsampleLevels[e.level]={parentLevel:f?f.level:-1,factor:f?f.resolution/e.resolution:0};f=e}}};m.__decorate([F.property({type:Number,json:{write:!0}})],v.prototype,
"compressionQuality",void 0);m.__decorate([F.property({type:Number,json:{write:!0}})],v.prototype,"dpi",void 0);m.__decorate([F.property({type:String,json:{read:w.read,write:w.write,origins:{"web-scene":{read:!1,write:!1}}}})],v.prototype,"format",void 0);m.__decorate([F.property({readOnly:!0})],v.prototype,"isWrappable",null);m.__decorate([F.property({type:b,json:{write:!0}})],v.prototype,"origin",void 0);m.__decorate([D.reader("origin")],v.prototype,"readOrigin",null);m.__decorate([F.property({type:[A],
value:null,json:{write:!0}})],v.prototype,"lods",null);m.__decorate([F.property({readOnly:!0})],v.prototype,"scales",void 0);m.__decorate([F.property({cast:a=>Array.isArray(a)?a:"number"===typeof a?[a,a]:[256,256]})],v.prototype,"size",void 0);m.__decorate([D.reader("size",["rows","cols"])],v.prototype,"readSize",null);m.__decorate([p.writer("size",{cols:{type:R.Integer},rows:{type:R.Integer}})],v.prototype,"writeSize",null);m.__decorate([F.property({type:g,json:{write:!0}})],v.prototype,"spatialReference",
void 0);v=r=m.__decorate([z.subclass("esri.layers.support.TileInfo")],v);(function(a){a=a.ExtrapolateOptions||(a.ExtrapolateOptions={});a[a.NONE=0]="NONE";a[a.POWER_OF_TWO=1]="POWER_OF_TWO"})(v||={});return v})},"esri/layers/support/LOD":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/accessorSupport/ensureType ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/subclass".split(" "),function(m,w,v,J,F,
R,P){var U;w=U=class extends w.JSONSupport{constructor(D){super(D);this.cols=null;this.level=0;this.origin=this.levelValue=null;this.resolution=0;this.rows=null;this.scale=0}clone(){return new U({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};m.__decorate([v.property({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],w.prototype,"cols",void 0);m.__decorate([v.property({type:J.Integer,
json:{write:!0}})],w.prototype,"level",void 0);m.__decorate([v.property({type:String,json:{write:!0}})],w.prototype,"levelValue",void 0);m.__decorate([v.property({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],w.prototype,"origin",void 0);m.__decorate([v.property({type:Number,json:{write:!0}})],w.prototype,"resolution",void 0);m.__decorate([v.property({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],w.prototype,
"rows",void 0);m.__decorate([v.property({type:Number,json:{write:!0}})],w.prototype,"scale",void 0);return w=U=m.__decorate([P.subclass("esri.layers.support.LOD")],w)})},"esri/layers/support/TileKey":function(){define(["exports"],function(m){class w{constructor(v,J,F,R,P){this.id=v;this.level=J;this.row=F;this.col=R;this.extent=P}}m.TileKey=w;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterDatasets/FunctionRaster":function(){define("require ../../../chunks/tslib.es6 ../../../core/Error ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/Polygon ./BaseRaster ../rasterFunctions/clipUtils ../rasterFunctions/pixelUtils ../rasterFunctions/rasterProjectionHelper ../../../rest/support/FeatureSet".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h){F=class extends z{constructor(){super(...arguments);this.datasetFormat="Function";this.tileType="Raster";this.rasterFunction=null;this._clippingGeometry=new Map}async open(n){await this.init();const {rasterFunction:l}=this;this.primaryRasters?.rasters?.length?l.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=l.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach(d=>d.rasterJobHandler=this.rasterJobHandler));const {rasters:A,
rasterIds:t}=this.primaryRasters;var r=A.map(d=>d.rasterInfo?void 0:d.open(n));await Promise.all(r);r=A.map(({rasterInfo:d})=>d);var a=l.bind({rasterInfos:r,rasterIds:t});l.rawSourceRasterInfos=r;if(!a.success||0===r.length)throw new v("raster-function:open",`cannot bind the function: ${a.error??""}`);a="Table"===l.functionName?l:l.functionArguments?.raster;"Table"===a?.functionName&&(l.rasterInfo.attributeTable=h.fromJSON(a.functionArguments.attributeTableAsRecordSet));await this.syncJobHandler();
const f=r[0];this.hasUniqueSourceStorageInfo=1===r.length||r.slice(1).every(d=>{const {storageInfo:e,pixelSize:c,spatialReference:k,extent:q}=d,{storageInfo:u,pixelSize:G,spatialReference:y,extent:C}=f;return c.x===G.x&&c.y===G.y&&k.equals(y)&&q.equals(C)&&e.blockHeight===u.blockHeight&&e.blockWidth===u.blockWidth&&e.maximumPyramidLevel===u.maximumPyramidLevel});this.set("sourceJSON",A[0].sourceJSON);this.set("rasterInfo",l.rasterInfo);await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async fetchPixels(n,
l,A,t={}){const {rasters:r,rasterIds:a}=this.primaryRasters;var f=!1,{interpolation:d}=t,e=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!t.requestRawData&&e&&(f=1===r.length&&!t.skipRasterFunction,t={...t,interpolation:"bilinear",requestRawData:f});e=r.map(u=>u.fetchPixels(n,l,A,t));e=await Promise.all(e);var c=e.map(u=>u.pixelBlock),k=f||t.requestRawData?e.map(u=>u.srcTilePixelSize):null;if(t.skipRasterFunction||c.every(u=>null==u))return e[0];const q=e.find(u=>null!=u.pixelBlock)?.extent??
n;c=this.rasterJobHandler?await this.rasterJobHandler.process({extent:q,primaryPixelBlocks:c,primaryPixelSizes:k,primaryRasterIds:a}):this.rasterFunction.process({extent:q,primaryPixelBlocks:c,primaryPixelSizes:k,primaryRasterIds:a});({transformGrid:k}=e[0]);if(!f||null==c||null==k)return d=t.noClip?null:this.getClippingGeometry(q.spatialReference),t.noClip||t.requestRawData||null==c||!d||(c=await p.clip(c,q,d)),{...e[0],pixelBlock:c};f={rows:k.spacing[0],cols:k.spacing[1]};d=this.rasterJobHandler?
(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[c],srcMosaicSize:{width:c.width,height:c.height},destDimension:{width:l,height:A},coefs:k.coefficients,sampleSpacing:f,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:d,alignmentInfo:void 0,blockWidths:null},t)).pixelBlock:b.approximateTransform(c,{width:l,height:A},k.coefficients,f,d);f=t.noClip?null:this.getClippingGeometry(n.spatialReference);t.noClip||t.requestRawData||null==d||null==f||(d=await p.clip(d,n,f));return{extent:n,
srcExtent:e[0].srcExtent,pixelBlock:d}}getClippingGeometry(n){const l=this._clippingGeometry.get("0");if(!n||!l)return l;const A=String(n.wkid??n.wkt??n.wkt2);let t=this._clippingGeometry.get(A);if(null!=t)return t;t=n.equals(l.spatialReference)?l:g.projectPolygon(l,n);this._clippingGeometry.set(A,t);return t}async _updateClipGeometry(){var n=this.rasterFunction.getClippingGeometries()[0];let l=n?.clippingGeometry;if(l&&"inside"===n.clippingType){({extent:n}=this.rasterInfo);const {difference:A,densify:t}=
await new Promise((r,a)=>m(["../../../geometry/geometryEngine"],r,a));n=t(D.fromExtent(n),2*(n.width+n.height)/40);n=g.projectPolygon(n,l.spatialReference);l=A(n,l)}this._clippingGeometry.clear();l&&this._clippingGeometry.set("0",l)}};w.__decorate([J.property({type:String,json:{write:!0}})],F.prototype,"datasetFormat",void 0);w.__decorate([J.property()],F.prototype,"tileType",void 0);w.__decorate([J.property()],F.prototype,"rasterFunction",void 0);w.__decorate([J.property()],F.prototype,"primaryRasters",
void 0);return F=w.__decorate([U.subclass("esri.layers.support.rasterDatasets.FunctionRaster")],F)})},"esri/layers/support/rasterDatasets/BaseRaster":function(){define("../../../chunks/tslib.es6 ../../../geometry ../../../request ../../../core/Error ../../../core/JSONSupport ../../../core/Logger ../../../core/Promise ../../../core/promiseUtils ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/ensureType ../../../core/RandomLCG ../../../core/has ../../../core/accessorSupport/decorators/subclass ../arcgisLayerUrl ../commonProperties ../DimensionalDefinition ../LOD ../RasterStorageInfo ../TileInfo ./multidimensionalUtils ./RawBlockCache ../rasterFormats/pixelRangeUtils ../rasterFormats/RasterCodec ../rasterFunctions/pixelUtils ../rasterFunctions/rasterProjectionHelper ../rasterFunctions/vectorFieldUtils ../../../views/support/QueueProcessor ../../../geometry/Extent ../../../geometry/Point ../../../geometry/SpatialReference".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h,n,l,A,t,r,a,f,d,e,c,k,q,u,G,y,C){let H=0;w=class extends P.EsriPromiseMixin(F.JSONSupport){constructor(){super(...arguments);this._tileFetchQueue=new u.QueueProcessor({concurrency:32,process:(x,M)=>this._fetchRawTile(x.pyramidLevel,x.row,x.col,{...x.options,signal:M})});this.datasetFormat=this.datasetName=null;this.hasUniqueSourceStorageInfo=!0;this.rasterInfo=null;this.ioConfig={sampling:"closest"}}async init(){const x=k.load();this.addResolvingPromise(x);await this.when()}normalizeCtorArgs(x){x?.ioConfig&&
(x={...x,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:r.create(),...x.ioConfig}});return x}get _isGlobalWrappableSource(){const {rasterInfo:x}=this,M=k.getWorldWidth(x.spatialReference);return null!=M&&x.extent.width>=M/2}get _hasNoneOrGCSShiftTransform(){const {transform:x}=this.rasterInfo;return null==x||"gcs-shift"===x.type}set rasterJobHandler(x){this._set("rasterJobHandler",x);"Function"===this.datasetFormat&&this.primaryRasters?.rasters?.forEach(M=>M.rasterJobHandler=x)}get rasterId(){return this.url||
`rasterId-${H++}`}set url(x){this._set("url",h.sanitizeUrl(x,R.getLogger(this)))}async open(x){throw new J("BaseRaster:open-not-implemented","open() is not implemented");}async fetchTile(x,M,L,N={}){const E=N.tileInfo||this.rasterInfo.storageInfo.tileInfo;x=this.getTileExtentFromTileInfo(x,M,L,E);N={noClip:!0,...N};return this.fetchPixels(x,E.size[0],E.size[1],N)}async identify(x,M={}){x=z.ensureClass(y,x).clone().normalize();const {multidimensionalDefinition:L,timeExtent:N}=M;var {rasterInfo:E}=
this;const {hasMultidimensionalTranspose:I,multidimensionalInfo:K}=E;var {transposedVariableName:S}=M,O=null!=K&&I&&(null!=N||a.isMultiSliceOrRangeDefinition(L));O&&!S&&(S=null!=L&&0<L.length?L[0].variableName??void 0:K.variables[0].name,M={...M,transposedVariableName:S});M=this._getRequestOptionsWithSliceId(M);const {spatialReference:W,extent:Y}=E;var {datumTransformation:V}=M;V=k.projectPoint(x,W,V);if(!Y.intersects(V)||null!=E.transform&&(V=E.transform.inverseTransform(V),!E.nativeExtent.intersects(V)))return{location:V,
value:null};var B=0,Q=null!=S&&null!=K&&E.hasMultidimensionalTranspose;if("Function"===this.datasetFormat){O=this.primaryRasters.rasters[0];if(Q)return O.identify(V,M);({pixelSize:B}=E);Q=3*B.x/2;B=3*B.y/2;Q=new G({xmin:V.x-Q,xmax:V.x+Q,ymin:V.y-B,ymax:V.y+B,spatialReference:W});M={interpolation:"nearest",multidimensionalDefinition:L,sliceId:M.sliceId};({pixelBlock:O}=await O.fetchPixels(Q,3,3,M));({pixelBlock:M}=await this.fetchPixels(Q,3,3,M));if(null==O)return{location:V,value:null};O=!O.mask||
O.mask[4]?O.pixels.map(fa=>fa[4]):null;var T;null!=M&&(T=!M.mask||M.mask[4]?M.pixels.map(fa=>fa[4]):void 0);return{location:V,value:O,processedValue:T,pyramidLevel:0}}if(!Q)if(M.srcResolution)B=k.snapPyramid(M.srcResolution,E,this.ioConfig.sampling).pyramidLevel;else if(B=await this.computeBestPyramidLevelForLocation(x,M),null==B)return{location:V,value:null};T=this.identifyPixelLocation(V,B,null,Q);if(null===T)return{location:V,value:null};const {row:X,col:aa,rowOffset:Z,colOffset:ba,blockWidth:ea}=
T;T=f.getRasterId(this.rasterId,S??M.sliceId);E=`${B}/${X}/${aa}`;S=f.getBlock(T,null,E);null==S&&(S=this.fetchRawTile(B,X,aa,M),f.putBlock(T,null,E,S));T=await S;return T?.pixels?.length?this._processIdentifyResult(T,{srcLocation:V,position:Z*ea+ba,pyramidLevel:B,useTransposedTile:!!Q,requestSomeSlices:O,identifyOptions:M}):{location:V,value:null}}async fetchPixels(x,M,L,N={}){x=k.shiftExtent(x);N=this._getRequestOptionsWithSliceId(N);var {_hasNoneOrGCSShiftTransform:E}=this;if(N.requestRawData&&
E)return this._fetchPixels(x,M,L,N);var I=k.getWorldWidth(x.spatialReference),K=k.getWorldWrapCount(x);if(null==I||0===K||1===K&&this._isGlobalWrappableSource&&E)return this._fetchPixels(x,M,L,N);if(3<=K)return{extent:x,pixelBlock:null};const S=[],{xmin:O,xmax:W}=x,Y=Math.round(I/(W-O)*M),V=Y-Math.round((I/2-O)/(W-O)*M);let B=0;E=[];for(let T=0;T<=K;T++){var Q=new G({xmin:0===T?O:-I/2,xmax:T===K?W-I*T:I/2,ymin:x.ymin,ymax:x.ymax,spatialReference:x.spatialReference});const X=0===T?Y-V:T===K?M-B:Y;
B+=X;E.push(X);Q=N.disableWrapAround&&0<T?null:this._fetchPixels(Q,X,L,N);S.push(Q)}I=(await Promise.all(S)).map(T=>T?.pixelBlock);K=null;M={width:M,height:L};K=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:I,srcMosaicSize:M,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:E},N)).pixelBlock:c.mosaic(I,M,{blockWidths:E});N=k.projectExtent(x,this.rasterInfo.spatialReference,N.datumTransformation);return{extent:x,
srcExtent:N,pixelBlock:K}}async fetchRawPixels(x,M,L,N={}){M={x:Math.floor(M.x),y:Math.floor(M.y)};const E=await this._fetchRawTiles(x,M,L,N),{nativeExtent:I,nativePixelSize:K,storageInfo:S}=this.rasterInfo;var O=2**x,W=K.x*O;O*=K.y;W=new G({xmin:I.xmin+W*M.x,xmax:I.xmin+W*(M.x+L.width-1),ymin:I.ymax-O*(M.y+L.height-1),ymax:I.ymax-O*M.y,spatialReference:I.spatialReference});if(!E)return{extent:W,srcExtent:W,pixelBlock:null};const {pixelBlocks:Y,mosaicSize:V}=E;if(1===Y.length&&null!=Y[0]&&Y[0].width===
L.width&&Y[0].height===L.height)return{extent:W,srcExtent:W,pixelBlock:E.pixelBlocks[0]};x={x:M.x%(0<x?S.pyramidBlockWidth:S.blockWidth),y:M.y%(0<x?S.pyramidBlockHeight:S.blockHeight)};L=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:Y,srcMosaicSize:V,destDimension:L,clipOffset:x,clipSize:L,coefs:null,sampleSpacing:null,interpolation:N.interpolation,alignmentInfo:null,blockWidths:null},N)).pixelBlock:c.mosaic(Y,V,{clipOffset:x,clipSize:L});return{extent:W,srcExtent:W,
pixelBlock:L}}fetchRawTile(x,M,L,N){throw new J("BaseRaster:read-not-implemented","fetchRawTile() is not implemented");}computeExtent(x){return k.projectExtent(this.rasterInfo.extent,x)}decodePixelBlock(x,M){return!this.rasterJobHandler||M.useCanvas?e.decode(x,M):this.rasterJobHandler.decode({data:x,options:M})}async request(x,M,L=0){const {customFetchParameters:N}=this.ioConfig,{range:E,query:I,headers:K}=M;L=L??M.retryCount??this.ioConfig.retryCount;const S=E?{Range:`bytes=${E.from}-${E.to}`}:null;
try{return await v(x,{...M,query:{...I,...N},headers:{...K,...S}})}catch(O){if(0<L)return L--,this.request(x,M,L);throw O;}}getSliceIndex(x){const {multidimensionalInfo:M}=this.rasterInfo;return null==M||null==x||0===x.length?null:a.getSliceIndex(x,M)}getTileExtentFromTileInfo(x,M,L,N){x=N.lodAt(x);return this.getTileExtent({x:x.resolution,y:x.resolution},M,L,N.origin,N.spatialReference,N.size)}updateTileInfo(){const {storageInfo:x,spatialReference:M,extent:L,pixelSize:N}=this.rasterInfo;var {pyramidResolutions:E}=
x;if(!x.tileInfo){const I=[],K=x.maximumPyramidLevel||0;let S=(N.x+N.y)/2,O=1/.0254*96*S;for(let W=0;W<=K;W++){I.unshift(new A({level:K-W,resolution:S,scale:O}));if(W===K)break;if(E){const Y=(E[W].x+E[W].y)/2;O*=Y/S;S=Y}else S*=2,O*=2}E=new y({x:L.xmin,y:L.ymax,spatialReference:M});x.tileInfo=new r({origin:E,size:[x.blockWidth,x.blockHeight],spatialReference:M,lods:I});x.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(x,M=512,L=512,N){const {width:E,height:I,nativeExtent:K,pixelSize:S,spatialReference:O}=
x,W=new y({x:K.xmin,y:K.ymax,spatialReference:O});null==N&&(N=Math.max(0,Math.round(Math.log(Math.max(E,I))/Math.LN2-8)));const Y=this.computeBlockBoundary(K,512,512,{x:K.xmin,y:K.ymax},[S],N);x.storageInfo=new t({blockWidth:M,blockHeight:L,pyramidBlockWidth:M,pyramidBlockHeight:L,origin:W,firstPyramidLevel:1,maximumPyramidLevel:N,blockBoundary:Y})}async computeBestPyramidLevelForLocation(x,M){return 0}computeBlockBoundary(x,M,L,N,E,I=0,K=2){if(1===E.length&&0<I){E=[...E];let {x:W,y:Y}=E[0];for(let V=
0;V<I;V++)W*=K,Y*=K,E.push({x:W,y:Y})}I=[];const {x:S,y:O}=N;for(N=0;N<E.length;N++){const {x:W,y:Y}=E[N];I.push({minCol:Math.floor((x.xmin-S+.1*W)/M/W),maxCol:Math.floor((x.xmax-S-.1*W)/M/W),minRow:Math.floor((O-x.ymax+.1*Y)/L/Y),maxRow:Math.floor((O-x.ymin-.1*Y)/L/Y)})}return I}getPyramidPixelSize(x){const {nativePixelSize:M}=this.rasterInfo,{pyramidResolutions:L,pyramidScalingFactor:N}=this.rasterInfo.storageInfo;if(0===x)return M;if(null!=L&&L.length)return L[x-1];x=N**x;return{x:M.x*x,y:M.y*
x}}identifyPixelLocation(x,M,L,N){const {spatialReference:E,nativeExtent:I,storageInfo:K}=this.rasterInfo,{maximumPyramidLevel:S,origin:O,transposeInfo:W}=K,Y=N&&null!=W?W.tileSize[0]:K.blockWidth;N=N&&null!=W?W.tileSize[1]:K.blockHeight;x=k.projectPoint(x,E,L);if(!I.intersects(x)||0>M||M>S)return null;L=this.getPyramidPixelSize(M);const {x:V,y:B}=L;L=(O.y-x.y)/B/N;const Q=(x.x-O.x)/V/Y;return{pyramidLevel:M,row:Math.floor(L),col:Math.floor(Q),rowOffset:Math.min(N-1,Math.floor((L-Math.floor(L))*N)),
colOffset:Math.min(Y-1,Math.floor((Q-Math.floor(Q))*Y)),blockWidth:Y,srcLocation:x}}getTileExtent(x,M,L,N,E,I){const [K,S]=I;L=N.x+L*K*x.x;M=N.y-M*S*x.y;return new G({xmin:L,xmax:L+K*x.x,ymin:M-S*x.y,ymax:M,spatialReference:E})}getBlockWidthHeight(x){return{blockWidth:0<x?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:0<x?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(x,M,L){x=this.rasterInfo.storageInfo.blockBoundary[x];
return!x||x.maxRow<M||x.maxCol<L||x.minRow>M||x.minCol>L}updateImageSpaceRasterInfo(x){const {extent:M,pixelSize:L}=x;if(-.5!==M.xmin||.5!==M.ymax||1!==L.x||1!==L.y||null!=x.transform){var {width:N,height:E}=x,I=C.WebMercator;x.spatialReference=I;x.extent=x.nativeExtent=new G({xmin:-.5,ymax:.5,xmax:N-.5,ymin:.5-E,spatialReference:I});x.isPseudoSpatialReference=!0;x.transform=null;x.pixelSize=new y({x:1,y:1,spatialReference:I});var {extent:K,storageInfo:S}=x;if(S){S.origin=new y({x:K.xmin,y:K.ymax,
spatialReference:I});const {pyramidResolutions:O,tileInfo:W}=S;O&&O.forEach(Y=>{Y.x/=L.x;Y.y/=L.y});if(W){W.origin=S.origin;const Y=(x.nativePixelSize.x+x.nativePixelSize.y)/2;W.lods.forEach((V,B)=>{V.resolution=Y*2**B;V.scale=96*V.resolution/.0254})}}}}async _fetchPixels(x,M,L,N={}){var E=k.getWorldWrapCount(x);if(2<=E)return{extent:x,pixelBlock:null};var I=this._getSourceDataInfo(x,M,L,N);const {pyramidLevel:K,srcResolution:S,srcExtent:O,srcWidth:W,srcHeight:Y,ul:V}=I;if(0===W||0===Y)return{extent:x,
srcExtent:O,pixelBlock:null};var {rasterInfo:B}=this,Q=B.transform,T="gcs-shift"===Q?.type,X=null!=k.getWorldWidth(x.spatialReference);if(T||!X)E=k.getWorldWrapCount(I.srcExtent,T);I=await this._fetchRawTiles(K,V,{width:W,height:Y,wrapCount:E},N);if(!I)return{extent:x,srcExtent:O,pixelBlock:null};var aa=B.storageInfo;T=0<K?aa.pyramidBlockWidth:aa.blockWidth;var Z=0<K?aa.pyramidBlockHeight:aa.blockHeight;let {x:ba,y:ea}=B.pixelSize;if(0<K){const {pyramidResolutions:ta,pyramidScalingFactor:sa}=aa;null!=
ta&&ta[K-1]?{x:ba,y:ea}=ta[K-1]:(aa=sa**K,ba*=aa,ea*=aa)}var fa=B.spatialReference;B=new y({x:ba,y:ea,spatialReference:fa});const la=T===W&&Z===Y&&0===V.x%T&&0===V.y%Z;aa=new y({x:(x.xmax-x.xmin)/M,y:(x.ymax-x.ymin)/L,spatialReference:x.spatialReference});const ja=!x.spatialReference.equals(fa),pa=fa.isGeographic?1E-9:1E-4;({datumTransformation:fa}=N);if(!ja&&la&&1===I.pixelBlocks.length&&T===M&&Z===L&&Math.abs(S.x-aa.x)<pa&&Math.abs(S.y-aa.y)<pa)return{extent:x,srcExtent:O,srcTilePixelSize:B,pixelBlock:I.pixelBlocks[0]};
T=X&&null!=k.getWorldWidth(O.spatialReference)&&this._hasNoneOrGCSShiftTransform;(X=N.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector"))&&!this.rasterJobHandler&&await k.load();E=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:x,srcBufferExtent:I.extent,pixelSize:aa.toJSON(),datumTransformation:fa,rasterTransform:Q,hasWrapAround:0<E||T,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:X},N):k.getProjectionOffsetGrid({projectedExtent:x,
srcBufferExtent:I.extent,pixelSize:aa,datumTransformation:fa,rasterTransform:Q,hasWrapAround:0<E||T,isAdaptive:!1,includeGCSGrid:X});Q=!N.requestRawData;T={rows:E.spacing[0],cols:E.spacing[1]};Z=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(K,I.extent.xmin):void 0;const {pixelBlocks:ma,mosaicSize:oa,isPartiallyFilled:qa}=I;I=null;this.rasterJobHandler?(M=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:ma,srcMosaicSize:oa,destDimension:Q?{width:M,height:L}:null,coefs:Q?
E.coefficients:null,sampleSpacing:Q?T:null,projectDirections:X,gcsGrid:X?E.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:N.interpolation,alignmentInfo:Z,blockWidths:null},N),{pixelBlock:Q,localNorthDirections:I}=M):(Z=c.mosaic(ma,oa,{alignmentInfo:Z}),Q=Q?c.approximateTransform(Z,{width:M,height:L},E.coefficients,T,N.interpolation):Z,X&&E.gcsGrid&&(I=c.getLocalArithmeticNorthRotations({width:M,height:L},E.gcsGrid),Q=q.convertToLocalDirections(Q,this.rasterInfo.dataType,I)));
return N.requestRawData||X?{extent:x,srcExtent:O,srcTilePixelSize:B,pixelBlock:Q,transformGrid:E,localNorthDirections:I,isPartiallyFilled:qa}:{extent:x,srcExtent:O,srcTilePixelSize:B,pixelBlock:Q}}async _fetchRawTiles(x,M,L,N){const {origin:E,blockBoundary:I}=this.rasterInfo.storageInfo,{blockWidth:K,blockHeight:S}=this.getBlockWidthHeight(x);let {x:O,y:W}=M,{width:Y,height:V,wrapCount:B}=L;var Q=this._getRasterTileAlignmentInfo(x,0);N.buffer&&(O-=N.buffer.cols,W-=N.buffer.rows,Y+=2*N.buffer.cols,
V+=2*N.buffer.rows);var T=0,X=0;let aa=0;B&&null!=Q&&({worldColumnCountFromOrigin:X,originColumnOffset:aa,rightPadding:T}=Q,X*Q.blockWidth-T>=O+Y&&(T=0));M=Math.floor(O/K);L=Math.floor(W/S);const Z=Math.floor((O+Y+T-1)/K);T=Math.floor((W+V+T-1)/S);var ba=I[x];if(!ba)return null;const {minRow:ea,minCol:fa,maxCol:la,maxRow:ja}=ba;if(0===B&&(T<ea||Z<fa||L>ja||M>la))return null;ba=[];let pa=!1;const ma=null==this.ioConfig.allowPartialFill?N.allowPartialFill:this.ioConfig.allowPartialFill;for(let ta=L;ta<=
T;ta++)for(let sa=M;sa<=Z;sa++){let ra=sa;!N.disableWrapAround&&B&&null!=Q&&X<=sa&&(ra=sa-X-aa);if(ta>=ea&&ra>=fa&&ja>=ta&&la>=ra){const xa=this._tileFetchQueue.push({pyramidLevel:x,row:ta,col:ra,options:N},{signal:N.signal});ma?ba.push(new Promise(va=>{xa.then(ya=>va(ya)).catch(()=>{pa=!0;va(null)})})):ba.push(xa)}else ba.push(Promise.resolve(null))}if(0===ba.length)return null;N=await Promise.all(ba);Q={height:(T-L+1)*S,width:(Z-M+1)*K};({spatialReference:X}=this.rasterInfo);x=this.getPyramidPixelSize(x);
const {x:oa,y:qa}=x;return{extent:new G({xmin:E.x+M*K*oa,xmax:E.x+(Z+1)*K*oa,ymin:E.y-(T+1)*S*qa,ymax:E.y-L*S*qa,spatialReference:X}),pixelBlocks:N,mosaicSize:Q,isPartiallyFilled:pa}}_fetchRawTile(x,M,L,N){var E=this.rasterInfo.storageInfo.blockBoundary[x];if(!E)return Promise.resolve(null);const {minRow:I,minCol:K,maxCol:S,maxRow:O}=E;if(M<I||L<K||M>O||L>S)return Promise.resolve(null);const W=f.getRasterId(this.rasterId,N.sliceId),Y=`${x}/${M}/${L}`;E=f.getBlock(W,N.registryId,Y);if(null==E){const V=
new AbortController;E=this.fetchRawTile(x,M,L,{...N,signal:V.signal});f.putBlock(W,N.registryId,Y,E,V);E.catch(()=>f.deleteBlock(W,N.registryId,Y))}if(N.signal)U.onAbort(N,()=>{f.decreaseRefCount(W,N.registryId,Y)});return E}_computeMagDirValues(x){const {bandCount:M,dataType:L}=this.rasterInfo;if((2!==M||"vector-magdir"!==L)&&"vector-uv"!==L||2!==x?.length||!x[0]?.length)return null;var N=x[0].length;if("vector-magdir"===L)return N=x[1].map(S=>(S+360)%360),[x[0],N];const [E,I]=x;x=[];const K=[];
for(let S=0;S<N;S++){const [O,W]=q.uvComponentToVector([E[S],I[S]]);x.push(O);K.push(W)}return[x,K]}_getRasterTileAlignmentInfo(x,M){null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=k.getRasterDatasetAlignmentInfo(this.rasterInfo));return null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:M,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[x]}}_getSourceDataInfo(x,
M,L,N={}){const E={datumTransformation:N.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};N.srcResolution&&(E.srcResolution=N.srcResolution,this._updateSourceDataInfo(x,E));var I=this.rasterInfo.storageInfo.maximumPyramidLevel||0;const {srcWidth:K,srcHeight:S,pyramidLevel:O}=E;var W=K/M;const Y=S/L,V=O<I&&16<=W*Y;var B=O===I&&this._requireTooManySrcTiles(K,S,M,L);if(V||B||0===K||0===S){B=new y({x:(x.xmax-x.xmin)/M,y:(x.ymax-
x.ymin)/L,spatialReference:x.spatialReference});B=k.projectResolution(B,this.rasterInfo.spatialReference,x,E.datumTransformation);const Q=!B||N.srcResolution&&B.x+B.y<N.srcResolution.x+N.srcResolution.y;V&&N.srcResolution&&Q&&(W=Math.round(Math.log(Math.max(W,Y))/Math.LN2)-1,I-O+3>=W&&(I=2**W,B={x:N.srcResolution.x*I,y:N.srcResolution.y*I}));B&&(E.srcResolution=B,this._updateSourceDataInfo(x,E))}this._requireTooManySrcTiles(E.srcWidth,E.srcHeight,M,L)&&(E.srcWidth=0,E.srcHeight=0);return E}_requireTooManySrcTiles(x,
M,L,N){const {tileInfo:E}=this.rasterInfo.storageInfo;return Math.ceil(x/E.size[0])*Math.ceil(M/E.size[1])>=256*Math.max(1,(L+N)/1024)||8<x/L||8<M/N}_updateSourceDataInfo(x,M){M.srcWidth=0;M.srcHeight=0;var {rasterInfo:L}=this,N=L.spatialReference;const {srcResolution:E,datumTransformation:I}=M,{pyramidLevel:K,pyramidResolution:S,excessiveReading:O}=k.snapPyramid(E,L,this.ioConfig.sampling);if(!O&&(x=M.srcExtent||k.projectExtent(x,N,I),null!=x)){(N=L.transform)&&(x=N.inverseTransform(x));M.srcExtent=
x;var {x:W,y:Y}=L.storageInfo.origin;L=Math.floor((x.xmin-W)/S.x+.1);N=Math.floor((Y-x.ymax)/S.y+.1);var V=Math.floor((x.xmax-W)/S.x-.1),B=Math.floor((Y-x.ymin)/S.y-.1);V=x.width<.1*S.x?0:V-L+1;x=x.height<.1*S.y?0:B-N+1;M.pyramidLevel=K;M.pyramidResolution=S;M.srcWidth=V;M.srcHeight=x;M.ul={x:L,y:N}}}_getRequestOptionsWithSliceId(x){null!=this.rasterInfo.multidimensionalInfo&&null==x.sliceId&&(x={...x,sliceId:this.getSliceIndex(x.multidimensionalDefinition)});return x}_processIdentifyResult(x,M){const {srcLocation:L,
position:N,pyramidLevel:E,useTransposedTile:I}=M,K=x.pixels[0].length/x.width/x.height;if(x.mask&&!x.mask[N])return{location:L,value:null};const {multidimensionalInfo:S}=this.rasterInfo;if(null==S||!I)return M=x.pixels.map(T=>T[N]),x={location:L,value:M,pyramidLevel:E},M=this._computeMagDirValues(M.map(T=>[T])),M?.length&&(x.magdirValue=M.map(T=>T[0])),x;let O=x.pixels.map(T=>T.slice(N*K,N*K+K)),W=this._computeMagDirValues(O);const {requestSomeSlices:Y,identifyOptions:V}=M;let B=a.createSlices(S,
V.transposedVariableName);if(Y){const T=a.getSliceIds(B,V.multidimensionalDefinition,V.timeExtent);O=O.map(X=>T.map(aa=>X[aa]));W=W?.map(X=>T.map(aa=>X[aa]));B=T.map(X=>B[X])}M=x.noDataValues||this.rasterInfo.noDataValue;x={pixels:O,pixelType:x.pixelType};let Q;null!=M&&(d.convertNoDataToMask(x,M),Q=x.mask);x=B.map((T,X)=>{T={value:0===Q?.[X]?null:O.map(aa=>aa[X]),multidimensionalDefinition:T.multidimensionalDefinition.map(aa=>new l({...aa,isSlice:!0}))};W?.length&&(T.magdirValue=[W[0][X],W[1][X]]);
return T});return{location:L,value:null,dataSeries:x,pyramidLevel:E}}};m.__decorate([D.property()],w.prototype,"_rasterTileAlignmentInfo",void 0);m.__decorate([D.property()],w.prototype,"_tileFetchQueue",void 0);m.__decorate([D.property({readOnly:!0})],w.prototype,"_isGlobalWrappableSource",null);m.__decorate([D.property({readOnly:!0})],w.prototype,"_hasNoneOrGCSShiftTransform",null);m.__decorate([D.property()],w.prototype,"rasterJobHandler",null);m.__decorate([D.property({readOnly:!0})],w.prototype,
"rasterId",null);m.__decorate([D.property(n.url)],w.prototype,"url",null);m.__decorate([D.property({type:String,json:{write:!0}})],w.prototype,"datasetName",void 0);m.__decorate([D.property({type:String,json:{write:!0}})],w.prototype,"datasetFormat",void 0);m.__decorate([D.property()],w.prototype,"hasUniqueSourceStorageInfo",void 0);m.__decorate([D.property()],w.prototype,"rasterInfo",void 0);m.__decorate([D.property()],w.prototype,"ioConfig",void 0);m.__decorate([D.property()],w.prototype,"sourceJSON",
void 0);return w=m.__decorate([g.subclass("esri.layers.support.rasterDatasets.BaseRaster")],w)})},"esri/layers/support/RasterStorageInfo":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/lang ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/accessorSupport/decorators/subclass ../../geometry/Point".split(" "),function(m,w,v,J,F,R,P,U){var D;w=D=class extends w.JSONSupport{constructor(){super(...arguments);this.blockHeight=this.blockWidth=
void 0;this.maximumPyramidLevel=this.firstPyramidLevel=this.origin=this.compression=null;this.pyramidScalingFactor=2;this.pyramidBlockHeight=this.pyramidBlockWidth=null;this.isVirtualTileInfo=!1;this.blockBoundary=this.transposeInfo=this.tileInfo=null}clone(){return new D({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:v.clone(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:v.clone(this.pyramidResolutions),
pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:v.clone(this.tileInfo),transposeInfo:v.clone(this.transposeInfo),blockBoundary:v.clone(this.blockBoundary)})}};m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"blockWidth",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"blockHeight",void 0);m.__decorate([J.property({type:String,
json:{write:!0}})],w.prototype,"compression",void 0);m.__decorate([J.property({type:U,json:{write:!0}})],w.prototype,"origin",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"firstPyramidLevel",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"maximumPyramidLevel",void 0);m.__decorate([J.property({json:{write:!0}})],w.prototype,"pyramidResolutions",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"pyramidScalingFactor",
void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"pyramidBlockWidth",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],w.prototype,"pyramidBlockHeight",void 0);m.__decorate([J.property({type:Boolean,json:{write:!0}})],w.prototype,"isVirtualTileInfo",void 0);m.__decorate([J.property({json:{write:!0}})],w.prototype,"tileInfo",void 0);m.__decorate([J.property()],w.prototype,"transposeInfo",void 0);m.__decorate([J.property()],w.prototype,"blockBoundary",void 0);
return w=D=m.__decorate([P.subclass("esri.layers.support.RasterStorageInfo")],w)})},"esri/layers/support/rasterDatasets/multidimensionalUtils":function(){define(["exports","../../../core/arrayUtils","../DimensionalDefinition"],function(m,w,v){function J(h,n,l){const A=n.shift();0===l.length&&l.push({sliceId:-1,multidimensionalDefinition:[]});const t=l.length;for(let r=0;r<t;r++){const a=l.shift().multidimensionalDefinition;A.values?.forEach(f=>{l.push({sliceId:-1,multidimensionalDefinition:[...a,
{variableName:h,dimensionName:A.name,values:[f]}]})})}n.length&&J(h,n,l)}function F(h,n){return Array.isArray(h)?n[0]===n[1]?h[0]===n[0]||h[1]===n[0]:h[0]>=n[0]&&h[0]<=n[1]&&h[1]>=n[0]&&h[1]<=n[1]:h>=n[0]&&h<=n[1]}function R(h,n){return h[0]<=n[0]&&h[1]>=n[0]||h[0]<=n[1]&&h[1]>=n[1]||h[0]>=n[0]&&h[1]<=n[1]}function P(h){return 1===h.length?[h[0],h[0]]:[h[0],h[h.length-1]]}function U(h,n,l){if(!n?.subsetDefinitions?.length)return h;if(l){const {variables:t}=n;if(t.length&&!t.includes(l))return null;
n=n.subsetDefinitions.find(r=>r.dimensionName===h.name&&r.variableName===l);if(!n?.values?.length)return h;n=P(n.values)}else n=n.dimensions.find(({name:t})=>t===h.name)?.extent;const A=n;if(!A?.length)return h;n=h.values.filter(t=>F(t,A));return{...h,extent:[...A],values:n}}function D(h,n,l){if(!n?.subsetDefinitions?.length)return!1;const {variables:A}=n;if(A.length&&h.some(({variableName:t})=>t&&!A.includes(t)))return!0;for(let t=0;t<h.length;t++){const r=h[t],a=n.subsetDefinitions.find(f=>(""===
r.variableName||f.variableName===r.variableName)&&f.dimensionName===r.dimensionName);if(a?.values.length){const f=P(a.values);if(!r.isSlice&&2===r.values.length&&!Array.isArray(r.values[0])&&r.values[0]!==r.values[1]&&l){if(!R(r.values,f))return!0}else if(r.values.some(d=>!F(d,f)))return!0}}return!1}function z(h,n){var l=h.dimensions.find(({name:a})=>"StdTime"===a);if(null==l||null==n.start&&null==n.end)return n;n=n.clone();const {start:A,end:t}=n.toJSON(),r=A===t?[A]:null!=A&&null!=t?[A,t]:[A??t];
if(2===r.length&&l?.extent.length&&(r[0]=Math.max(r[0],l.extent[0]),r[1]=Math.min(r[1],l.extent[1]??l.extent[0]),r[1]<r[0]))return null;l=new v({variableName:"",dimensionName:"StdTime",isSlice:1===r.length,values:r});if(D([l],h,!0))return null;n.start=new Date(r[0]);n.end=new Date(r[1]??r[0]);return n}function p(h,n={}){const {multidimensionalInfo:l,keyProperties:A}=h;if(null==l)return null;const {variableName:t,multidimensionalSubset:r,multidimensionalDefinition:a}=n;h=null!=a?a[0]?.variableName:
null;const f=t||h||A?.DefaultVariable;({variables:h}=l);r?.variables?.length&&(h=h.filter(({name:d})=>r.variables.includes(d)));return f?h.find(({name:d})=>d===f)??h[0]:h[0]}function b(h,n){var {values:l}=n;if(l?.length){n=Array.isArray(l[0]);var A=Array.isArray(h);return n!==A?-1:n&&A?l.findIndex(r=>r[0]===h[0]&&r[1]===h[1]):l.indexOf(h)}({extent:A}=n);if(Array.isArray(h)||!A||h<A[0]||h>A[1])return-1;l=n.interval||1;if("ISO8601"!==n.unit)return Math.round((h-A[0])/l);A=A[0];let t=-1;switch(n.intervalUnit?.toLowerCase()||
"seconds"){case "seconds":t=Math.round((h-A)/1E3/l);break;case "minutes":t=Math.round((h-A)/6E4/l);break;case "hours":t=Math.round((h-A)/36E5/l);break;case "days":t=Math.round((h-A)/864E5/l);break;case "months":n=(new Date(h)).getUTCFullYear()-(new Date(A)).getUTCFullYear();l=(new Date(A)).getUTCMonth();A=(new Date(h)).getUTCMonth();t=0===n?A-l:A+11-l+12*(n-1);break;case "years":t=Math.round(((new Date(h)).getUTCFullYear()-(new Date(A)).getUTCFullYear())/l);break;case "decades":t=Math.round(((new Date(h)).getUTCFullYear()-
(new Date(A)).getUTCFullYear())/10/l)}return t}function g(h){var n=h.values?.length;if(n)return n;const {extent:l,unit:A}=h;n=h.interval||1;var t=l?l[1]-l[0]:0;if("ISO8601"!==A)return Math.round(t/n);switch(h.intervalUnit?.toLowerCase()??"seconds"){case "seconds":n=Math.round(t/1E3/n);break;case "minutes":n=Math.round(t/6E4/n);break;case "hours":n=Math.round(t/36E5/n);break;case "days":n=Math.round(t/864E5/n);break;case "months":l?(h=(new Date(l[1])).getUTCFullYear()-(new Date(l[0])).getUTCFullYear(),
n=(new Date(l[0])).getUTCMonth(),t=(new Date(l[1])).getUTCMonth(),n=0===h?t-n+1:t+11-n+12*(h-1)+1):n=0;break;case "years":n=l?Math.round(((new Date(l[1])).getUTCFullYear()-(new Date(l[0])).getUTCFullYear())/n):0;break;case "decades":n=l?Math.round(((new Date(l[1])).getUTCFullYear()-(new Date(l[0])).getUTCFullYear())/10/n):0;break;default:n=0}return n}m.createSlices=function(h,n){const l=[];let A=0;(n?h.variables.filter(t=>t.name.toLowerCase()===n.toLowerCase()):[...h.variables].sort((t,r)=>t.name>
r.name?1:-1)).forEach(t=>{const r=[],a=[...t.dimensions].sort((f,d)=>f.name>d.name?-1:1);J(t.name,a,r);r.forEach(f=>{l.push({...f,sliceId:A++})})});return l};m.getDefaultMultidimensionalDefinition=function(h,n={}){var l=p(h,n);if(!l)return null;h=[];const {dimensions:A,name:t}=l;if(0===A.length)return[new v({variableName:t,dimensionName:"",values:[],isSlice:!0})];for(l=0;l<A.length;l++){const r=U(A[l],n.multidimensionalSubset,t);if(!r)return null;const {values:a,extent:f}=r;let d=a?.[0]??f?.[0];"stdz"===
r.name.toLowerCase()&&!r.hasRanges&&f&&Math.abs(f[1])<=Math.abs(f[0])&&(d=a?.length?a[a.length-1]:f[1]);h.push(new v({variableName:t,dimensionName:r.name,values:[d],isSlice:n.useRangeForRangedDimensionInfo?!!r.hasRanges:!0}))}return h};m.getDefaultVariableInfo=p;m.getSliceIds=function(h,n,l){let A=h;n&&(n=[...n].sort((t,r)=>t.dimensionName<r.dimensionName?-1:1),n.forEach(({dimensionName:t,values:r,isSlice:a})=>{r.length&&(A=A.filter(f=>{f=f.multidimensionalDefinition.find(e=>e.dimensionName===t);
if(null==f)return!1;const d=f.values[0];return"number"===typeof d?"number"===typeof r[0]?r.includes(d):r.some(e=>e[0]<=d&&e[1]>=d):"number"===typeof r[0]?r.some(e=>d[0]<=e&&d[1]>=e):a?r.some(e=>e[0]===d[0]&&e[0]===d[1]):r.some(e=>e[0]>=d[0]&&e[0]<=d[1]||e[1]>=d[0]&&e[1]<=d[1]||e[0]<d[0]&&e[1]>d[1])}))}));if(A.length&&null!=l?.start&&null!=l.end){const t=l.start.getTime(),r=l.end.getTime(),a=A[0].multidimensionalDefinition.findIndex(f=>"StdTime"===f.dimensionName);-1<a&&(A=A.filter(f=>{f=f.multidimensionalDefinition[a].values[0];
return t<=f&&r>=f}))}return A.map(t=>t.sliceId)};m.getSliceIndex=function(h,n){let l=0;var A=h[0].variableName;n=[...n.variables].sort((r,a)=>r.name>a.name?1:-1);for(var t=0;t<n.length;t++){const r=n[t],a=[...r.dimensions].sort((f,d)=>f.name>d.name?-1:1);if(r.name!==A)l+=a.map(f=>g(f)).reduce((f,d)=>f*d);else{A=a.map(f=>g(f));n=a.length;for(let f=0;f<n;f++){t=h.find(d=>d.dimensionName===a[f].name);if(null==t)return null;t=b(t.values[0],a[f]);if(-1===t)return null;A.shift();l=f===n-1?l+t:l+t*A.reduce((d,
e)=>d*e)}break}}return l};m.getSubsetVariablesFromMdInfo=function(h,n){if(null==n||null==h)return null;n=n.variables.map(l=>({...l}));h?.variables?.length&&(n=n.filter(({name:l})=>h.variables.includes(l)),n.forEach(l=>{l.dimensions=l.dimensions.map(A=>U(A,h,l.name)).filter(w.isSome)}));return n};m.hasExcludedVariableOrDimension=D;m.intersectMultimensionalSubset=function(h,n){if(null==h)return{isOutside:!1};const {geometry:l,timeExtent:A,multidimensionalDefinition:t}=n;n=null;if(null!=A&&(n=z(h,A),
null==n))return{isOutside:!0};const {areaOfInterest:r}=h;if(r&&l){const a="point"===l.type?l:"extent"===l.type?l.center:"polygon"===l.type?l.centroid:null;if(a&&!r.contains(a))return{isOutside:!0}}return null!=t&&t.length&&D(t,h,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:l,timeExtent:n,multidimensionalDefinition:t}}};m.isMultiSliceOrRangeDefinition=function(h){return h?.length?h.some(n=>{if(null==n.values)return!0;const l=n.values.length;return 0===l||1<l||!n.isSlice&&Array.isArray(n.values[0])}):
!1};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterDatasets/RawBlockCache":function(){define(["exports","../../../geometry","./EphemeralBlockCache","../rasterFunctions/rasterProjectionHelper","../../../geometry/Point"],function(m,w,v,J,F){function R(D,z){return(D=P.get(D))?D[z]??null:null}const P=new Map,U=new v;m.decreaseRefCount=function(D,z,p){const b=P.get(D);if(!b)return null==z?U.decreaseRefCount(D,p):0;if(null==z||null==b[z])return U.decreaseRefCount(D,
p);z=b[z]?.cache;D=z?.get(p);if(z&&D){D.refCount--;if(0===D.refCount){z.delete(p);for(z=0;z<b.length;z++)b[z]?.cache.delete(p);D.controller&&D.controller.abort()}return D.refCount}return 0};m.deleteBlock=function(D,z,p){const b=P.get(D);b?null==z||null==b[z]?U.deleteBlock(D,p):b[z]?.cache.delete(p):null==z&&U.deleteBlock(D,p)};m.deleteRaster=function(D){P.delete(D)};m.getBlock=function(D,z,p){const b=P.get(D);if(!b)return null==z?U.getBlock(D,p):null;if(null==z||null==b[z]){for(z=0;z<b.length;z++){var g=
b[z]?.cache.get(p);if(g)return g.refCount++,g.block}return U.getBlock(D,p)}if(D=b[z]?.cache.get(p))return D.refCount++,D.block;for(D=0;D<b.length;D++){if(D===z||!b[D])continue;g=b[D]?.cache;const h=g?.get(p);if(g&&h)return h.refCount++,g.set(p,h),h.block}return null};m.getRasterId=function(D,z){return null==z?D:`${D}?sliceId=${z}`};m.putBlock=function(D,z,p,b,g=null){const h=P.get(D);if(h)if(null==z||null==h[z])U.putBlock(D,p,b,g);else{var n={refCount:1,block:b,isResolved:!1,isRejected:!1,controller:g};
b.then(()=>n.isResolved=!0).catch(()=>n.isRejected=!0);h[z]?.cache.set(p,n)}else null==z&&U.putBlock(D,p,b,g)};m.register=function(D,z){z={extent:null,rasterInfo:z,cache:new Map};const p=P.get(D);if(p)return p.push(z),p.length-1;P.set(D,[z]);return 0};m.unregister=function(D,z){const p=P.get(D);p&&(p[z]=null,p.some(b=>null!=b)||P.delete(D))};m.update=function(D,z,p,b,g,h,n=null){if(D=R(D,z)){z=D.extent;var {cache:l,rasterInfo:A}=D;if(!z||z.xmin!==p.xmin||z.xmax!==p.xmax||z.ymin!==p.ymin||z.ymax!==
p.ymax){b=b??0;z=p.clone().normalize();var {spatialReference:t,transform:r}=A,a=new Set;for(let q=0;q<z.length;q++){var f=z[q];if(f.xmax-f.xmin<=b||f.ymax-f.ymin<=b)continue;var d=J.projectExtent(f,t,n);null!=r&&(d=r.inverseTransform(d));var e=new F({x:b,y:b,spatialReference:f.spatialReference});if(null==g&&(g=J.projectResolution(e,t,f,n),!g))return;const {pyramidLevel:u,pyramidResolution:G,excessiveReading:y}=J.snapPyramid(g,A,h||"closest");if(y)return;({storageInfo:f}=A);var {origin:c}=f;e=Math.max(0,
Math.floor((d.xmin-c.x)/G.x));c=Math.max(0,Math.floor((c.y-d.ymax)/G.y));const C=0<u?f.pyramidBlockWidth:f.blockWidth,H=0<u?f.pyramidBlockHeight:f.blockHeight;f=Math.max(0,Math.floor(e/C)-1);var k=Math.max(0,Math.floor(c/H)-1);e=Math.floor((e+Math.ceil((d.xmax-d.xmin)/G.x-.1)-1)/C)+1;d=Math.floor((c+Math.ceil((d.ymax-d.ymin)/G.y-.1)-1)/H)+1;for(c=k;c<=d;c++)for(k=f;k<=e;k++)a.add(`${u}/${c}/${k}`)}l.forEach((q,u)=>{a.has(u)||(q=l.get(u),(null==q||q.isResolved||q.isRejected)&&l.delete(u))});D.extent=
{xmin:p.xmin,ymin:p.ymin,xmax:p.xmax,ymax:p.ymax}}}};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterDatasets/EphemeralBlockCache":function(){define(function(){class m{constructor(w=15E3,v=5E3){this._timer=null;this._cachedBlocks=new Map;this._size=-1;this._duration=w;this._interval=Math.min(w,v)}decreaseRefCount(w,v){w=w+"/"+v;v=this._cachedBlocks;if(v.has(w)){const J=v.get(w);J.refCount--;0>=J.refCount&&(v.delete(w),J.controller&&J.controller.abort());
return J.refCount}return 0}getBlock(w,v){w=w+"/"+v;v=this._cachedBlocks;if(v.has(w)){const J=v.get(w);J.ts=Date.now();J.refCount++;v.delete(w);v.set(w,J);return J.block}return null}putBlock(w,v,J,F){const R=this._cachedBlocks;w=w+"/"+v;R.has(w)?(J=R.get(w),J.ts=Date.now(),J.refCount++):R.set(w,{block:J,ts:Date.now(),refCount:1,controller:F});this._trim();this._updateTimer()}deleteBlock(w,v){const J=this._cachedBlocks;w=w+"/"+v;J.has(w)&&J.delete(w)}updateMaxSize(w){this._size=w;this._trim()}empty(){this._cachedBlocks.clear();
this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null==this._timer){var w=this._cachedBlocks;this._timer=setInterval(()=>{const v=Array.from(w),J=Date.now();for(let F=0;F<v.length;F++)if(v[F][1].ts<=J-this._duration)w.delete(v[F][0]);else break;0===w.size&&this._clearTimer()},this._interval)}}_trim(){const w=this._cachedBlocks;if(!(-1===this._size||this._size>=w.size)){var v=Array.from(w);for(let J=0;J<v.length-this._size;J++)w.delete(v[J][0])}}_clearTimer(){null!=
this._timer&&(clearInterval(this._timer),this._timer=null)}}return m})},"esri/layers/support/rasterFunctions/rasterProjectionHelper":function(){define("exports ../../../geometry ../../../core/arrayUtils ../../../core/Error ../../../core/unitUtils ../../../chunks/pe ../../../geometry/projection ../../../geometry/support/spatialReferenceUtils ../../../geometry/Extent ../../../geometry/Point ../../../geometry/Polygon ../../../geometry/SpatialReference".split(" "),function(m,w,v,J,F,R,P,U,D,z,p,b){function g(B,
Q,T){return!P.canProjectWithoutEngine(B,Q,T)}function h(B,Q,T){if((B=g(B,Q,T))&&!P.isLoaded())throw new J("rasterprojectionhelper-project","projection engine is not loaded");return B}function n(B,Q,T){h(B.spatialReference,Q);return T?P.getTransformation(Q,B.spatialReference,B):P.getTransformation(B.spatialReference,Q,B)}function l(B,Q,T,X=null){const aa=B.spatialReference;if(aa.equals(Q))return B;h(aa,Q,X);T=T.center;T=new D({xmin:T.x-B.x/2,xmax:T.x+B.x/2,ymin:T.y-B.y/2,ymax:T.y+B.y/2,spatialReference:aa});
X=P.project(T,Q,X);T=H(Q);null==X||null!=T&&X.width>=T?(Q=F.getMetersPerUnitForSR(aa)/F.getMetersPerUnitForSR(Q),B={x:B.x*Q,y:B.y*Q}):B={x:X.width,y:X.height};return B}function A(B,Q=.01){return F.getMetersPerUnitForSR(B)?Q/F.getMetersPerUnitForSR(B):0}function t(B,Q,T=null,X=!0){const aa=B.spatialReference;if(aa.equals(Q))return B;h(aa,Q,T);T=P.project(B,Q,T);if(!X||!T)return T;r([B],[T],aa,Q);return T}function r(B,Q,T,X){const aa=x(T,!0),Z=x(X,!0);T=A(T,500);X=A(X,500);if(T&&null!=aa&&null!=Z)for(let ba=
0;ba<B.length;ba++){const ea=Q[ba];if(!ea)continue;const {x:fa}=B[ba],{x:la}=ea;la>=Z[1]-X&&Math.abs(fa-aa[0])<T?ea.x-=Z[1]-Z[0]:la<=Z[0]+X&&Math.abs(fa-aa[1])<T&&(ea.x+=Z[1]-Z[0])}}function a(B){const {inSR:Q,outSR:T,datumTransformation:X,preferPE:aa}=B;if(Q.equals(T))return{points:B}=k(B,null),B;if(Q.isWebMercator&&T.isWGS84||Q.isWGS84&&T.isWebMercator){const {cols:fa,rows:la,xres:ja,yres:pa,usePixelCenter:ma,inSR:oa,outSR:qa}=B;let {xmin:ta,ymax:sa}=B;ma&&(ta+=ja/2,sa-=pa/2);B=[];const ra=[];var Z=
Math.max(fa,la);for(var ba=0;ba<Z;ba++){var ea=P.project(new z({x:ta+ja*Math.min(fa,ba),y:sa-pa*Math.min(la,ba),spatialReference:oa}),qa);ba<=fa&&B.push(ea.x);ba<=la&&ra.push(ea.y)}Z=[];for(ba=0;ba<fa;ba++)for(ea=0;ea<la;ea++)Z.push([B[ba],ra[ea]]);return Z}return h(Q,T,X)&&aa&&(Q.isGeographic||null!=e(Q))?d(B):f(B)}function f(B){var {points:Q}=k(B,null);const {inSR:T,outSR:X,datumTransformation:aa}=B;B=Q.map(Z=>new z(Z[0],Z[1],T));Q=P.project(B,X,aa);aa&&r(B,Q,T,X);return Q.map(Z=>Z?[Z.x,Z.y]:[NaN,
NaN])}function d(B){const {inSR:Q,outSR:T,datumTransformation:X}=B;var aa=e(Q);const {points:Z,mask:ba}=k(B,aa);Q.isGeographic||(B=Q.wkid?R.PeFactory.coordsys(Q.wkid):R.PeFactory.fromString(Q.isGeographic?R.PeDefs.PE_TYPE_GEOGCS:R.PeDefs.PE_TYPE_PROJCS,Q.wkt2||Q.wkt),R.PeCSTransformations.projToGeog(B,Z.length,Z));if(null!=X&&X.steps.length){var ea;T.isGeographic&&(ea=Z.map(([fa])=>179.9955<fa?1:-179.9955>fa?-1:0));X.steps.forEach(fa=>{const la=fa.wkid?R.PeFactory.geogtran(fa.wkid):R.PeFactory.fromString(R.PeDefs.PE_TYPE_GEOGTRAN,
fa.wkt);R.PeGTTransformations.geogToGeog(la,Z.length,Z,null,fa.isInverse?R.PeDefs.PE_TRANSFORM_2_TO_1:R.PeDefs.PE_TRANSFORM_1_TO_2)});if(ea)for(B=0;B<Z.length;B++){aa=ea[B];const fa=Z[B][0],la=179.9955<fa?1:-179.9955>fa?-1:0;aa&&la&&aa!==la&&(Z[B][0]=0<aa?fa+360:fa-360)}}T.isGeographic||(ea=e(T,!0),q(Z,null!=ea&&ea.isEnvelope?[ea.bbox[1],ea.bbox[3]]:[-90,90]),ea=T.wkid?R.PeFactory.coordsys(T.wkid):R.PeFactory.fromString(T.isGeographic?R.PeDefs.PE_TYPE_GEOGCS:R.PeDefs.PE_TYPE_PROJCS,T.wkt2||T.wkt),
R.PeCSTransformations.geogToProj(ea,Z.length,Z));ea=Z;if(ba&&Z.length!==ba.length){ea=[];for(let fa=0,la=0;fa<ba.length;fa++)ba[fa]?ea.push(Z[la++]):ea.push([NaN,NaN])}return ea}function e(B,Q=!1){var T=B.wkid||B.wkt2||B.wkt;if(!T||B.isGeographic)return null;T=String(T);if(Y.has(T))return T=Y.get(T),Q?T?.gcs:T?.pcs;var X=B.wkid?R.PeFactory.coordsys(B.wkid):R.PeFactory.fromString(B.isGeographic?R.PeDefs.PE_TYPE_GEOGCS:R.PeDefs.PE_TYPE_PROJCS,B.wkt2||B.wkt);B=A(B,1E-4);B=c(X,B);X=c(X,0,!0);Y.set(T,
{pcs:B,gcs:X});return Q?X:B}function c(B,Q=0,T=!1){var X=R.PePCSInfo.generate(B),aa=T?B.horizonGcsGenerate():B.horizonPcsGenerate();if(!X||!aa?.length)return null;B=!1;var Z=aa.find(ja=>1===ja.getInclusive()&&1===ja.getKind());if(!Z){Z=aa.find(ja=>1===ja.getInclusive()&&0===ja.getKind());if(!Z)return null;B=!0}T=T?0:(2===X.getNorthPoleLocation()?1:0)|(2===X.getSouthPoleLocation()?2:0);X=X.isPannableRectangle();Z=Z.getCoord();if(B)return{isEnvelope:B,isPannable:X,vertices:Z,coef:null,bbox:[Z[0][0]-
Q,Z[0][1]-Q,Z[1][0]+Q,Z[1][1]+Q],poleLocation:T};Q=0;B=[];let [ba,ea]=Z[0],[fa,la]=Z[0];for(let ja=0,pa=Z.length;ja<pa;ja++){Q++;Q===pa&&(Q=0);const [ma,oa]=Z[ja],[qa,ta]=Z[Q];if(ta===oa)B.push([ma,qa,oa,ta,2]);else{aa=(qa-ma)/(ta-oa||1E-4);const sa=ma-aa*oa;oa<ta?B.push([aa,sa,oa,ta,0]):B.push([aa,sa,ta,oa,1])}ba=ba<ma?ba:ma;ea=ea<oa?ea:oa;fa=fa>ma?fa:ma;la=la>oa?la:oa}return{isEnvelope:!1,isPannable:X,vertices:Z,coef:B,bbox:[ba,ea,fa,la],poleLocation:T}}function k(B,Q){const T=[],{cols:X,rows:aa,
xres:Z,yres:ba,usePixelCenter:ea}=B;let {xmin:fa,ymax:la}=B;ea&&(fa+=Z/2,la-=ba/2);if(null==Q){for(B=0;B<X;B++)for(Q=0;Q<aa;Q++)T.push([fa+Z*B,la-ba*Q]);return{points:T}}B=new Uint8Array(X*aa);if(Q.isEnvelope){const {bbox:[sa,ra,xa,va]}=Q;for(let ya=0,ca=0;ya<X;ya++){var ja=fa+Z*ya,pa=Q.isPannable||ja>=sa&&ja<=xa;for(var ma=0;ma<aa;ma++,ca++){var oa=la-ba*ma;pa&&oa>=ra&&oa<=va&&(T.push([ja,oa]),B[ca]=1)}}return{points:T,mask:B}}ja=Q.coef;Q=[];for(pa=0;pa<aa;pa++){var qa=la-ba*pa;ma=[];oa=[];for(var ta=
0;ta<ja.length;ta++){const [sa,ra,xa,va,ya]=ja[ta];qa===xa&&xa===va?(ma.push(sa),ma.push(ra),oa.push(2),oa.push(2)):qa>=xa&&qa<=va&&(ma.push(sa*qa+ra),oa.push(ya))}qa=ma;if(2<ma.length){ta=2===oa[0]?0:oa[0];let sa=ma[0];qa=[];for(let ra=1;ra<oa.length;ra++)if(2!==oa[ra]||ra===oa.length-1)oa[ra]!==ta&&(qa.push(0===ta?Math.min(sa,ma[ra-1]):Math.max(sa,ma[ra-1])),ta=oa[ra],sa=ma[ra]),ra===oa.length-1&&qa.push(0===oa[ra]?Math.min(sa,ma[ra]):Math.max(sa,ma[ra]));qa.sort((ra,xa)=>ra-xa)}else ma[0]>ma[1]&&
(qa=[ma[1],ma[0]]);Q.push(qa)}for(let sa=0,ra=0;sa<X;sa++)for(ja=fa+Z*sa,pa=0;pa<aa;pa++,ra++)if(ma=la-ba*pa,oa=Q[pa],2===oa.length)ja>=oa[0]&&ja<=oa[1]&&(T.push([ja,ma]),B[ra]=1);else if(2<oa.length){qa=!1;for(ta=0;ta<oa.length;ta+=2)if(ja>=oa[ta]&&ja<=oa[ta+1]){qa=!0;break}qa&&(T.push([ja,ma]),B[ra]=1)}return{points:T,mask:B}}function q(B,Q){const [T,X]=Q;for(Q=0;Q<B.length;Q++){const aa=B[Q][1];if(aa<T||aa>X)B[Q]=[NaN,NaN]}}function u(B,Q){const T=H(B[0].spatialReference);if(2>B.length||null==
T)return B[0];Q=Q??A(B[0].spatialReference);B=B.filter(ea=>ea.width>Q);if(1===B.length)return B[0];let {xmin:X,xmax:aa,ymin:Z,ymax:ba}=B[0];for(let ea=1;ea<B.length;ea++){const fa=B[ea];aa=fa.xmax+T*ea;Z=Math.min(Z,fa.ymin);ba=Math.max(ba,fa.ymax)}return new D({xmin:X,xmax:aa,ymin:Z,ymax:ba,spatialReference:B[0].spatialReference})}function G(B,Q,T=null,X=!0){var aa=B.spatialReference;if(aa.equals(Q))return B;var Z=L(B);const ba=H(aa,!0);var ea=H(Q);if(0===Z||null==ba||null==ea)return Z=C(B,Q,T,X),
null==ba&&null!=ea&&Math.abs(Z.width-ea)<A(Q)&&P.isLoaded()&&(aa=e(aa),null!=aa&&aa.poleLocation===S.None&&B.width<(aa.bbox[2]-aa.bbox[0])/2)?y(B,Q)||Z:Z;ea=B.clone().normalize();if(1===ea.length&&B.xmax<ba&&B.xmax-ba/2>A(aa)){const {xmin:fa,xmax:la}=B;for(let ja=0;ja<=Z;ja++)ea[ja]=new D({xmin:0===ja?fa:-ba/2,xmax:ja===Z?la-ba*ja:ba/2,ymin:B.ymin,ymax:B.ymax,spatialReference:aa})}B=ea.map(fa=>C(fa,Q,T,X));return u(B.filter(v.isSome))}function y(B,Q){const T=H(Q);if(null==T)return null;let {xmin:X,
ymin:aa,xmax:Z,ymax:ba}=B;var ea=B.spatialReference;B=new p({spatialReference:ea,rings:[[[X,aa],[Z,aa],[Z,ba],[X,ba],[X,aa]]]});B=P.project(B,Q);if(2!==B.rings.length||!B.rings[0].length||!B.rings[1].length)return null;({rings:B}=B);ea=A(ea);Q=new D({spatialReference:Q});for(let fa=0;2>fa;fa++){X=Z=B[fa][0][0];aa=ba=B[fa][0][1];for(let la=0;la<B[fa].length;la++)X=X>B[fa][la][0]?B[fa][la][0]:X,Z=Z<B[fa][la][0]?B[fa][la][0]:Z,aa=aa>B[fa][la][1]?B[fa][la][1]:aa,ba=ba<B[fa][la][1]?B[fa][la][1]:ba;if(0===
fa)Q.ymin=aa,Q.ymax=ba,Q.xmin=X,Q.xmax=Z;else if(Q.ymin=Math.min(Q.ymin,aa),Q.ymax=Math.max(Q.ymax,ba),Math.abs(Z-T/2)<ea)Q.xmin=X,Q.xmax+=T;else if(Math.abs(X+T/2)<ea)Q.xmax=Z+T;else return null}return Q}function C(B,Q,T=null,X=!0,aa=!0){const Z=B.spatialReference;if(Z.equals(Q)||!Q)return B;h(Z,Q,T);const ba=P.project(B,Q,T);if(aa&&Q.isWebMercator&&ba&&(ba.ymax=Math.min(2.0037508342787E7,ba.ymax),ba.ymin=Math.max(-2.0037508342787E7,ba.ymin),ba.ymin>=ba.ymax))return null;if(!X||!ba)return ba;var ea=
x(Z,!0);X=x(Q,!0);if(null==ea||null==X)return ba;aa=A(Z,.001);const fa=A(Z,500);var la=A(Q,.001);if(Math.abs(ba.xmin-X[0])<la&&Math.abs(ba.xmax-X[1])<la){la=Math.abs(B.xmin-ea[0]);ea=Math.abs(ea[1]-B.xmax);if(la<aa&&ea>fa){ba.xmin=X[0];var ja=[];ja.push(new z(B.xmax,B.ymin,Z));ja.push(new z(B.xmax,(B.ymin+B.ymax)/2,Z));ja.push(new z(B.xmax,B.ymax,Z));ja=ja.map(pa=>t(pa,Q,T)).filter(pa=>!isNaN(pa?.x)).map(pa=>pa.x);ba.xmax=Math.max.apply(null,ja)}ea<aa&&la>fa&&(ba.xmax=X[1],X=[],X.push(new z(B.xmin,
B.ymin,Z)),X.push(new z(B.xmin,(B.ymin+B.ymax)/2,Z)),X.push(new z(B.xmin,B.ymax,Z)),B=X.map(pa=>t(pa,Q,T)).filter(pa=>!isNaN(pa?.x)).map(pa=>pa.x),ba.xmin=Math.min.apply(null,B))}else B=A(Q,.001),Math.abs(ba.xmin-X[0])<B&&(ba.xmin=X[0]),Math.abs(ba.xmax-X[1])<B&&(ba.xmax=X[1]);return ba}function H(B,Q=!1){return B?B.isWebMercator?2*(Q?2.0037508342787E7:2.0037508342788905E7):B.wkid&&B.isGeographic?360:2*W[B.wkid]||null:null}function x(B,Q=!1){if(B.isGeographic)return[-180,180];B=H(B,Q);return null!=
B?[-B/2,B/2]:null}function M(B,Q,T,X){B=(B-Q)/T;0!==B-Math.floor(B)?B=Math.floor(B):X&&--B;return B}function L(B,Q=!1){var T=H(B.spatialReference);if(null==T)return 0;const X=Q?0:-(T/2),aa=A(B.spatialReference),Z=!Q&&Math.abs(B.xmin+T/2)<aa?-T/2:B.xmin;B=M(!Q&&Math.abs(B.xmax-T/2)<aa?T/2:B.xmax,X,T,!0);T=M(Z,X,T,!1);return B-T}function N(B){const {projectedExtent:Q,srcBufferExtent:T,pixelSize:X,datumTransformation:aa,rasterTransform:Z}=B;var ba=Q.spatialReference;const ea=T.spatialReference;var fa=
h(ba,ea);const {xmin:la,ymin:ja,xmax:pa,ymax:ma}=Q,oa=H(ea),qa=null!=oa&&(B.hasWrapAround||"gcs-shift"===Z?.type);B=B.spacing||[32,32];var ta=B[0]*X.x,sa=B[1]*X.y;const ra=1===B[0],xa=Math.ceil((pa-la)/ta-.1/B[0])+(ra?0:1),va=Math.ceil((ma-ja)/sa-.1/B[1])+(ra?0:1);ta=a({cols:xa,rows:va,xmin:la,ymax:ma,xres:ta,yres:sa,inSR:ba,outSR:ea,datumTransformation:aa,preferPE:4>=B[0],usePixelCenter:ra});sa=[];let ya,ca=0;const ia=ra?-1:NaN,{xmin:da,xmax:ka,ymax:na,width:ha,height:ua}=T,wa=A(ea,500),za=null!=
oa&&0<da&&ka>oa/2;var Ba=!1;fa&&(Ba=e(ba),Ba=null!=Ba&&0<Ba.poleLocation);for(ba=0;ba<xa;ba++){fa=[];for(let Ca=0;Ca<va;Ca++){var Aa=ta[ba*va+Ca];qa&&Aa[0]>ka&&Aa[0]>oa/2-wa?Aa[0]-=oa:qa&&0===ba&&0>Aa[0]&&za&&!Z&&(Aa[0]+=oa);!Aa||isNaN(Aa[0])||isNaN(Aa[1])?(sa.push(ia),sa.push(ia),fa.push(null),ca++):(Z&&(Aa=Z.inverseTransform(new z({x:Aa[0],y:Aa[1],spatialReference:ea})),Aa=[Aa.x,Aa.y]),fa.push(Aa),0<ba&&qa&&ya[Ca]&&Aa[0]<ya[Ca][0]&&(Aa[0]+=oa,Ba&&Aa[0]>ka&&Aa[0]>oa&&(Aa[0]-=oa)),sa.push((Aa[0]-
da)/ha),sa.push((na-Aa[1])/ua))}ya=fa}return{offsets:sa,error:null,coefficients:null,outofBoundPointCount:ca,spacing:B,size:ra?[xa,va]:[xa-1,va-1]}}function E(B,Q,T){const {cols:X,rows:aa}=Q;Q=new Float32Array((X-1)*(aa-1)*12);const Z=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),ba=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let ma=0;ma<X-1;ma++){for(var ea=0;ea<aa-1;ea++){var fa=ma*aa*2+2*ea,la=B[fa];const oa=B[fa+1];var ja=B[fa+2],pa=B[fa+3];fa+=2*aa;const qa=B[fa],ta=B[fa+1],sa=B[fa+2];fa=B[fa+
3];let ra=0,xa=12*(ea*(X-1)+ma);for(let va=0;3>va;va++)Q[xa++]=Z[ra++]*la+Z[ra++]*ja+Z[ra++]*sa;ra=0;for(ja=0;3>ja;ja++)Q[xa++]=Z[ra++]*oa+Z[ra++]*pa+Z[ra++]*fa;ra=0;for(pa=0;3>pa;pa++)Q[xa++]=ba[ra++]*la+ba[ra++]*qa+ba[ra++]*sa;ra=0;for(la=0;3>la;la++)Q[xa++]=ba[ra++]*oa+ba[ra++]*ta+ba[ra++]*fa}if(T)for(ea=0;ea<Q.length;ea++)isNaN(Q[ea])&&(Q[ea]=-1)}return Q}function I(B,Q){B=B.clone().normalize();return 1===B.length?B[0]:u(B,Q)}function K(B,Q){const {pixelSize:T,extent:X}=B;B=n(X,Q,!1);const aa=
I(X,(T.x+T.y)/16);return G(aa,Q,B)}var S;(function(B){B[B.None=0]="None";B[B.North=1]="North";B[B.South=2]="South";B[B.Both=3]="Both"})(S||={});const O=(B,Q,T,X=0)=>{if(1===T[0])return[0,0];var aa=1,Z=-1,ba=1,ea=-1;for(var fa=0;fa<B.length;fa+=2)isNaN(B[fa])||(aa=aa>B[fa]?B[fa]:aa,Z=Z>B[fa]?Z:B[fa],ba=ba>B[fa+1]?B[fa+1]:ba,ea=ea>B[fa+1]?ea:B[fa+1]);const {cols:la,rows:ja}=Q;Q=(Z-aa)/la/T[0];T=(ea-ba)/ja/T[1];X*=2;ba=0;ea=!1;aa=[0,0];for(Z=0;Z<la-3;Z++){for(fa=0;fa<ja-3;fa++){var pa=Z*ja*2+2*fa;const ma=
Math.abs(((B[pa]+B[pa+4]+B[pa+4*ja]+B[pa+4*ja+4])/4-B[pa+2*ja+2])/Q);pa=Math.abs(((B[pa+1]+B[pa+5]+B[pa+4*ja+1]+B[pa+4*ja+5])/4-B[pa+2*ja+3])/T);ma+pa>ba&&(ba=ma+pa,aa=[ma,pa]);if(X&&ba>X){ea=!0;break}}if(ea)break}return aa},W={3395:2.0037508342789244E7,3410:1.7334193943686873E7,3857:2.0037508342788905E7,3975:1.7367530445161372E7,4087:2.0037508342789244E7,4088:2.0015108787169147E7,6933:1.7367530445161372E7,32662:2.0037508342789244E7,53001:2.001508679602057E7,53002:1.000754339801029E7,53003:2.001508679602057E7,
53004:2.001508679602057E7,53016:1.4152803599503474E7,53017:1.7333573624304302E7,53034:2.001508679602057E7,53079:2.0015114352186374E7,53080:2.0015114352186374E7,54001:2.0037508342789244E7,54002:1.0018754171394624E7,54003:2.0037508342789244E7,54004:2.0037508342789244E7,54016:1.4168658027268292E7,54017:1.736753044516137E7,54034:2.0037508342789244E7,54079:2.0037508342789244E7,54080:2.0037508342789244E7,54100:2.0037508342789244E7,54101:2.0037508342789244E7},Y=new Map,V=new Map;m.computeProjectedScales=
function(B,Q,T){var X=T?.tileSize??512,aa=T?.alignGlobalDatasetWithAGOL??!0,Z=!!T?.limitToSrcResolution;const {extent:ba,spatialReference:ea,pixelSize:fa}=B;T=l(new z({x:fa.x,y:fa.y,spatialReference:ea}),Q,ba);if(null==T)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const la=(T.x+T.y)/2,ja=F.getMetersPerUnitForSR(Q);var pa=la*ja*96*39.37,ma=Q.isGeographic?256/X*2.958287637958547E8:256/X*5.91657527591555E8,oa="vector-magdir"===B.dataType||"vector-uv"===B.dataType,
qa=K(B,Q),ta=Math.min(Math.ceil(Math.log(Math.min(B.width,B.height)/32)/Math.LN2),Math.ceil(Math.log(ma/2/pa)/Math.LN2));if(!oa&&aa&&(Q.isGeographic||Q.isWebMercator)&&(aa=H(Q),oa=0<L(qa)||null!=aa&&qa.width>aa/4,!oa&&null!=aa)){oa=-1;if(3>ta)oa=2**ta*la*X;else if(B.storageInfo){const {maximumPyramidLevel:sa=0,pyramidScalingFactor:ra=2}=B.storageInfo;oa=ra**sa*la*X}X=Math.ceil(aa/oa);oa=1===X||2===X&&aa/2-qa.xmax<oa}X=pa;B=Math.min(2,Math.max(1.414,B.storageInfo?.pyramidScalingFactor||2));if(oa)X=
ma,ma=Q.isGeographic?1.341104507446289E-6:.29858214164761665,ta=96*ma*ja*39.37,Q=l(new z({x:ma,y:ma,spatialReference:{wkid:Q.isGeographic?4326:3857}}),ea,qa),Q.x*=X/ta,Q.y*=X/ta;else{Q={x:fa.x,y:fa.y};for(qa=0;X<.5005*ma&&qa<ta;)qa++,X*=B,Q.x*=B,Q.y*=B;1.001>=Math.max(X,ma)/Math.min(X,ma)&&(X=ma)}ma=[X];qa=[{x:Q.x,y:Q.y}];for(pa=Math.min(70.5310735,pa)/1.001;X>=pa;)X/=B,Q.x/=B,Q.y/=B,ma.push(X),qa.push({x:Q.x,y:Q.y});if(Z){const sa=.001*fa.x;Z=qa.findIndex(ra=>ra.x>=fa.x-sa&&ra.x<=fa.x+sa);-1<Z?(qa.length=
Z+1,ma.length=Z+1):(Z=qa.findIndex(ra=>ra.x<=fa.x+sa),0<Z&&(qa.length=Z,ma.length=Z))}return{projectedPixelSize:T,scales:ma,srcResolutions:qa,isCustomTilingScheme:!oa}};m.defaultGridSpacing=32;m.defaultProjectionToleranceInPixels=4;m.getDefaultDatumTransformationForDataset=n;m.getProjectedGridPoints=a;m.getProjectionOffsetGrid=function(B){var Q=B.isAdaptive&&null==B.spacing;let T=B.spacing||[32,32],X=N(B);var aa={cols:X.size[0]+1,rows:X.size[1]+1};const Z=0<X.outofBoundPointCount&&X.outofBoundPointCount<
X.offsets.length/2;let ba=X.outofBoundPointCount===X.offsets.length/2||Q&&Z?[0,0]:O(X.offsets,aa,T,4);const ea=(ba[0]+ba[1])/2;var fa=B.projectedExtent.spatialReference;const la=B.srcBufferExtent.spatialReference;Q&&(Z||4<ea)&&(g(fa,la,B.datumTransformation)&&(fa.isGeographic||null!=e(fa)),T=[4,4],X=N({...B,spacing:T}),aa={cols:X.size[0]+1,rows:X.size[1]+1},ba=O(X.offsets,aa,T,4));X.error=ba;1<T[0]&&(X.coefficients=E(X.offsets,aa,Z));!B.includeGCSGrid||fa.isGeographic||fa.isWebMercator||(la.isGeographic?
X.gcsGrid={offsets:X.offsets,coefficients:X.coefficients,spacing:T}:(Q=e(fa),null==Q||Q.isEnvelope||(fa&&!fa.isGeographic&&(Q=String(fa.wkid||fa.wkt2||fa.wkt),V.has(Q)?fa=V.get(Q):(fa=(fa.wkid?R.PeFactory.coordsys(fa.wkid):R.PeFactory.fromString(R.PeDefs.PE_TYPE_PROJCS,fa.wkt2||fa.wkt)).getGeogcs().getCode(),V.set(Q,fa)),fa=new b({wkid:fa})),fa=G(B.projectedExtent,fa),{offsets:B}=N({...B,srcBufferExtent:fa,spacing:T}),aa=E(B,aa,Z),X.gcsGrid={offsets:B,coefficients:aa,spacing:T})));return X};m.getRasterDatasetAlignmentInfo=
function(B){const Q=B.storageInfo.origin.x;var T=H(B.spatialReference,!0);if(null==T)return{originX:Q,halfWorldWidth:null,pyramidsInfo:null};const X=T/2,{nativePixelSize:aa,storageInfo:Z,extent:ba}=B,{maximumPyramidLevel:ea,blockWidth:fa,pyramidScalingFactor:la}=Z;let ja=aa.x;const pa=[];B=null!=B.transform&&"gcs-shift"===B.transform.type;const ma=Q+(B?0:X);T=B?T-Q:X-Q;for(let oa=0;oa<=ea;oa++){const qa=(ba.xmax-Q)/ja/fa,ta=T/ja/fa;pa.push({resolutionX:ja,blockWidth:fa,datasetColumnCount:0===qa-Math.floor(qa)?
qa:Math.ceil(qa),worldColumnCountFromOrigin:0===ta-Math.floor(ta)?ta:Math.ceil(ta),leftMargin:Math.round(ma/ja)%fa,rightPadding:(fa-Math.round(T/ja)%fa)%fa,originColumnOffset:Math.floor(ma/ja/fa)});ja*=la}return{originX:Q,halfWorldWidth:X,pyramidsInfo:pa,hasGCSSShiftTransform:B}};m.getWorldWidth=H;m.getWorldWrapCount=L;m.load=async function(){P.isLoaded()||await P.load()};m.minimumGridSpacing=4;m.projectDatasetExtent=K;m.projectExtent=G;m.projectPoint=t;m.projectPolygon=function(B,Q,T){if("extent"===
B.type){const {xmin:X,ymin:aa,xmax:Z,ymax:ba,spatialReference:ea}=B;B=new p({rings:[[[X,ba],[Z,ba],[Z,aa],[X,aa],[X,ba]]],spatialReference:ea})}if(B.spatialReference.equals(Q))return B;h(B.spatialReference,Q,T);return P.project(B,Q,T)};m.projectResolution=l;m.requirePE=g;m.shiftExtent=function(B){var {spatialReference:Q}=B;Q=U.getInfo(Q);if(!Q)return B;const [T,X]=Q.valid;Q=X-T;let aa=0;B.xmin<T?aa=Math.ceil((T-B.xmin)/Q):B.xmin>X&&(aa=-Math.ceil((B.xmin-X)/Q));return new D({spatialReference:B.spatialReference,
xmin:B.xmin+aa*Q,ymin:B.ymin,xmax:B.xmax+aa*Q,ymax:B.ymax})};m.snapExtent=I;m.snapPyramid=function(B,Q,T){const {storageInfo:X,pixelSize:aa}=Q;var Z=0;let ba=!1;var {pyramidResolutions:ea}=X,fa="mixed"===X.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,X.tileInfo.dpi/96)):1;fa=(B.x+B.y)/2/fa;if(null!=ea&&ea.length){B=ea[ea.length-1];B=(B.x+B.y)/2;var la=(aa.x+aa.y)/2;if(fa<=la)Z=0;else if(fa>=B)Z=ea.length,ba=8<fa/B;else{B=la;for(let ja=1;ja<=ea.length;ja++){la=(ea[ja-1].x+ea[ja-1].y)/2;if(fa<=
la){fa===la?Z=ja:"down"===T?(Z=ja-1,ba=8<fa/B):Z="up"===T?ja:fa-B>la-fa||2<fa/B?ja:ja-1;break}B=la}}T=0===Z?aa:ea[Z-1];ba&&(ea=Math.min(T.x,T.y),fa=F.getMetersPerUnitForSR(Q.spatialReference),19567<ea*fa&&(ba=!1));return{pyramidLevel:Z,pyramidResolution:new z({x:T.x,y:T.y,spatialReference:Q.spatialReference}),excessiveReading:ba}}Z=Math.log(B.x/aa.x)/Math.LN2;fa=Math.log(B.y/aa.y)/Math.LN2;ea=Q.storageInfo.maximumPyramidLevel||0;Z="down"===T?Math.floor(Math.min(Z,fa)):"up"===T?Math.ceil(Math.max(Z,
fa)):Math.round((Z+fa)/2);0>Z?Z=0:Z>ea&&(ba=Z>ea+3,Z=ea);T=2**Z;Q=new z({x:T*Q.nativePixelSize.x,y:T*Q.nativePixelSize.y,spatialReference:Q.spatialReference});return{pyramidLevel:Z,pyramidResolution:Q,excessiveReading:ba}};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFormats/RasterCodec":function(){define("exports ../../../core/Error ../../../core/maybe ../PixelBlock ../SimpleBandStatistics ./ImageCanvasDecoder ./JpgPlus ./Lerc ./Lzw ./pixelRangeUtils ../../../chunks/Zlib ./Raw ./TiffDecoder ./utils".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h){async function n(y,C){if(!h.isPlatformLittleEndian)throw new w("rasterCoded:decode","lerc decoder is not supported on big endian platform");await U.load();const {offset:H}=C,{width:x,height:M,pixelType:L,statistics:N,depthCount:E,noDataValues:I,bandMasks:K,pixels:S,mask:O}=U.decode(y,{inputOffset:H,returnInterleaved:C.returnInterleaved});y=new J({width:x,height:M,pixelType:L.toLowerCase(),pixels:S,mask:O,statistics:N.map(({minValue:W,maxValue:Y})=>new F.SimpleBandStatistics(W,
Y)),bandMasks:K,depthCount:E,noDataValues:I});N?.length||y.updateStatistics();return y}async function l(y,C){y=await g.decode(y,{...C,noDataValue:null});v.assertIsSome(y);y=new J({width:y.width,height:y.height,pixels:y.pixels,pixelType:y.pixelType.toLowerCase(),mask:y.mask,bandMasks:y.bandMasks,statistics:null});y.updateStatistics();return y}async function A(y,C){y=await g.decodeTileOrStrip(y,C.customOptions);y=new J({width:y.width,height:y.height,pixels:y.pixels,pixelType:y.pixelType.toLowerCase(),
mask:y.mask,statistics:null});y.updateStatistics();return y}function t(y,C){const H=C.pixelType||"u8",x=J.getPixelArrayConstructor(H),M="u8"===H?y:new x(y.buffer),L=[],N=C.planes||1;if(1===N)L.push(M);else for(let E=0;E<N;E++){const I=(C.width||1)*(C.height||y.length),K=new x(I);for(let S=0;S<I;S++)K[S]=M[S*N+E];L.push(K)}y=new J({width:C.width||1,height:C.height||y.length,pixels:L,pixelType:H,statistics:null});y.updateStatistics();return y}function r(y,C){y=(new p.Zlib(new Uint8Array(y))).getBytes();
return t(y,C)}function a(y,C){y=D.decode(y,C.offset,C.eof,!C.isInputBigEndian);return t(y,C)}function f(y,C){y=P.decode(y,C.hasNoZlibMask??void 0);y=new J({width:y.width,height:y.height,pixels:y.pixels,pixelType:"u8",mask:y.mask,statistics:null});y.updateStatistics();return y}function d(y,C){y=new Uint8Array(y);y=new u(y);const {width:H,height:x}=C;C=H*x;y=y.decode();let M=0;var L=0;let N;L=new Uint8Array(C);for(M=0;M<C;M++)L[M]=y[4*M+3];const E=new J({width:H,height:x,pixels:[],pixelType:"u8",mask:L,
statistics:[]});for(M=0;3>M;M++){N=new Uint8Array(C);for(L=0;L<C;L++)N[L]=y[4*L+M];E.addData({pixels:N})}E.updateStatistics();return E}async function e(y,C,H,x){y=await (new R).decode(y,{applyJpegMask:!1,format:C,...H},x);y=new J(y);y.updateStatistics();return y}function c(y){if(null==y)throw new w("rasterCodec:decode","parameter encodeddata is required.");y=new Uint8Array(y,0,10);let C="";255===y[0]&&216===y[1]?C="jpg":137===y[0]&&80===y[1]&&78===y[2]&&71===y[3]?C="png":67===y[0]&&110===y[1]&&116===
y[2]&&90===y[3]&&73===y[4]&&109===y[5]&&97===y[6]&&103===y[7]&&101===y[8]&&32===y[9]?C="lerc":76===y[0]&&101===y[1]&&114===y[2]&&99===y[3]&&50===y[4]&&32===y[5]?C="lerc2":73===y[0]&&73===y[1]&&42===y[2]&&0===y[3]||77===y[0]&&77===y[1]&&0===y[2]&&42===y[3]||73===y[0]&&73===y[1]&&43===y[2]&&0===y[3]||77===y[0]&&77===y[1]&&0===y[2]&&43===y[3]?C="tiff":71===y[0]&&73===y[1]&&70===y[2]?C="gif":66===y[0]&&77===y[1]?C="bmp":String.fromCharCode.apply(null,y).toLowerCase().includes("error")&&(C="error");return C}
function k(y){let C=null;switch(y){case "lerc":case "lerc2":C=n;break;case "jpg":C=f;break;case "png":C=d;break;case "bsq":case "bip":C=(H,x)=>{var M=x.pixelType,L=null;let N=null;switch(M?M.toLowerCase():"f32"){case "u1":case "u2":case "u4":case "u8":N=255;L=Uint8Array;break;case "u16":N=N||65535;L=Uint16Array;break;case "u32":N=N||2**32-1;L=Uint32Array;break;case "s8":N=N||-128;L=Int8Array;break;case "s16":N=N||-32768;L=Int16Array;break;case "s32":N=N||-(2**31);L=Int32Array;break;default:L=Float32Array}({pixelTypeCtor:M}=
{pixelTypeCtor:L,noDataValue:N});L=b.decode;H=L(H,{width:x.width,height:x.height,pixelType:M,format:y});x=new J({width:x.width,height:x.height,pixels:H.pixels,pixelType:x.pixelType,mask:H.mask,statistics:null});x.updateStatistics();return x};break;case "tiff":C=l;break;case "deflate":C=r;break;case "lzw":C=a;break;case "error":C=()=>{throw new w("rasterCodec:decode","input data contains error");};break;default:C=()=>{throw new w("rasterCodec:decode","unsupported raster format");}}return C}function q(y,
C=1){if(y){var {pixels:H,width:x,height:M,mask:L}=y;if(H&&0!==H.length){var N=H.length,E=x-1,I=M-1,K=[],S,O,W=null,Y=J.getPixelArrayConstructor(y.pixelType);if(0===C){for(C=0;C<N;C++){var V=H[C];var B=new Y(E*I);for(S=0;S<I;S++){var Q=S*x;for(O=0;O<E;O++)B[S*E+O]=V[Q+O]}K.push(B)}if(null!=L)for(W=new Uint8Array(E*I),S=0;S<I;S++)for(Q=S*x,O=0;O<E;O++)W[S*E+O]=L[Q+O]}else{for(C=0;C<N;C++){V=H[C];B=new Y(E*I);for(S=0;S<I;S++)for(Q=S*x,O=0;O<E;O++)B[S*E+O]=(V[Q+O]+V[Q+O+1]+V[Q+x+O]+V[Q+x+O+1])/4;K.push(B)}if(L)for(W=
new Uint8Array(E*I),S=0;S<I;S++)for(Q=S*x,O=0;O<E;O++)W[S*E+O]=Math.min.apply(null,[L[Q+O],L[Q+O+1],L[Q+x+O],L[Q+x+O+1]])}y.width=E;y.height=I;y.mask=W;y.pixels=K}}}var u=function(y){function C(L){var N,E;this.data=L;this.pos=8;this.palette=[];this.imgData=[];this.transparency={};this.animation=null;this.text={};for(E=null;;){var I=this.readUInt32();var K=L=void 0;L=[];for(K=0;4>K;++K)L.push(String.fromCharCode(this.data[this.pos++]));L=L.join("");switch(L){case "IHDR":this.width=this.readUInt32();
this.height=this.readUInt32();this.bits=this.data[this.pos++];this.colorType=this.data[this.pos++];this.compressionMethod=this.data[this.pos++];this.filterMethod=this.data[this.pos++];this.interlaceMethod=this.data[this.pos++];break;case "acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||Infinity,frames:[]};break;case "PLTE":this.palette=this.read(I);break;case "fcTL":E&&this.animation.frames.push(E);this.pos+=4;E={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),
yOffset:this.readUInt32()};L=this.readUInt16();I=this.readUInt16()||100;E.delay=1E3*L/I;E.disposeOp=this.data[this.pos++];E.blendOp=this.data[this.pos++];E.data=[];break;case "IDAT":case "fdAT":"fdAT"===L&&(this.pos+=4,I-=4);L=(null!=E?E.data:void 0)||this.imgData;for(K=0;0<=I?K<I:K>I;0<=I?++K:--K)L.push(this.data[this.pos++]);break;case "tRNS":this.transparency={};switch(this.colorType){case 3:this.transparency.indexed=this.read(I);I=255-this.transparency.indexed.length;if(0<I)for(L=0;0<=I?L<I:L>
I;0<=I?++L:--L)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(I)[0];break;case 2:this.transparency.rgb=this.read(I)}break;case "tEXt":K=this.read(I);I=K.indexOf(0);L=String.fromCharCode.apply(String,K.slice(0,I));this.text[L]=String.fromCharCode.apply(String,K.slice(I+1));break;case "IEND":E&&this.animation.frames.push(E);a:{switch(this.colorType){case 0:case 3:case 4:E=1;break a;case 2:case 6:E=3;break a}E=void 0}this.colors=E;this.hasAlphaChannel=4===(N=this.colorType)||
6===N;N=this.colors+(this.hasAlphaChannel?1:0);this.pixelBitlength=this.bits*N;a:{switch(this.colors){case 1:N="DeviceGray";break a;case 3:N="DeviceRGB";break a}N=void 0}this.colorSpace=N;this.imgData=new Uint8Array(this.imgData);return;default:this.pos+=I}this.pos+=4;if(this.pos>this.data.length)throw Error("Incomplete or corrupt PNG file");}}var H;C.load=function(L,N,E){"function"===typeof N&&(E=N);var I=new XMLHttpRequest;I.open("GET",L,!0);I.responseType="arraybuffer";I.onload=function(){var K=
new Uint8Array(I.response||I.mozResponseArrayBuffer);K=new C(K);"function"===typeof(null!=N?N.getContext:void 0)&&K.render(N);return"function"===typeof E?E(K):void 0};return I.send(null)};C.prototype.read=function(L){var N;var E=[];for(N=0;0<=L?N<L:N>L;0<=L?++N:--N)E.push(this.data[this.pos++]);return E};C.prototype.readUInt32=function(){var L=this.data[this.pos++]<<24;var N=this.data[this.pos++]<<16;var E=this.data[this.pos++]<<8;var I=this.data[this.pos++];return L|N|E|I};C.prototype.readUInt16=
function(){var L=this.data[this.pos++]<<8;var N=this.data[this.pos++];return L|N};C.prototype.decodePixels=function(L){var N,E,I,K,S,O,W,Y;null==L&&(L=this.imgData);if(0===L.length)return new Uint8Array(0);L=new p.Zlib(L);L=L.getBytes();var V=this.pixelBitlength/8;var B=V*this.width;var Q=new Uint8Array(B*this.height);var T=L.length;for(E=K=S=0;K<T;){switch(L[K++]){case 0:for(I=N=0;N<B;I=N+=1)Q[E++]=L[K++];break;case 1:for(I=O=0;O<B;I=O+=1){N=L[K++];var X=I<V?0:Q[E-V];Q[E++]=(N+X)%256}break;case 2:for(I=
X=0;X<B;I=X+=1){N=L[K++];var aa=(I-I%V)/V;O=S&&Q[(S-1)*B+aa*V+I%V];Q[E++]=(O+N)%256}break;case 3:for(I=Y=0;Y<B;I=Y+=1)N=L[K++],aa=(I-I%V)/V,X=I<V?0:Q[E-V],O=S&&Q[(S-1)*B+aa*V+I%V],Q[E++]=(N+Math.floor((X+O)/2))%256;break;case 4:for(I=Y=0;Y<B;I=Y+=1){N=L[K++];aa=(I-I%V)/V;X=I<V?0:Q[E-V];0===S?O=W=0:(O=Q[(S-1)*B+aa*V+I%V],W=aa&&Q[(S-1)*B+(aa-1)*V+I%V]);var Z=X+O-W;I=Math.abs(Z-X);aa=Math.abs(Z-O);Z=Math.abs(Z-W);X=I<=aa&&I<=Z?X:aa<=Z?O:W;Q[E++]=(N+X)%256}break;default:throw Error("Invalid filter algorithm: "+
L[K-1]);}S++}return Q};C.prototype.decodePalette=function(){var L,N,E,I;var K=this.palette;var S=this.transparency.indexed||[];var O=new Uint8Array((S.length||0)+K.length);var W=0;K.length;var Y=N=L=0;for(E=K.length;N<E;Y=N+=3)O[W++]=K[Y],O[W++]=K[Y+1],O[W++]=K[Y+2],O[W++]=null!=(I=S[L++])?I:255;return O};C.prototype.copyToImageData=function(L,N){var E,I;var K=this.colors;var S=null;var O=this.hasAlphaChannel;this.palette.length&&(S=null!=(E=this._decodedPalette)?E:this._decodedPalette=this.decodePalette(),
K=4,O=!0);L=L.data||L;var W=L.length;var Y=S||N;E=I=0;if(1===K)for(;E<W;)K=S?4*N[E/4]:I,I=Y[K++],L[E++]=I,L[E++]=I,L[E++]=I,L[E++]=O?Y[K++]:this.transparency.grayscale&&this.transparency.grayscale===I?0:255,I=K;else for(;E<W;)K=S?4*N[E/4]:I,L[E++]=Y[K++],L[E++]=Y[K++],L[E++]=Y[K++],L[E++]=O?Y[K++]:this.transparency.rgb&&this.transparency.rgb[1]===Y[K-3]&&this.transparency.rgb[3]===Y[K-2]&&this.transparency.rgb[5]===Y[K-1]?0:255,I=K};C.prototype.decode=function(){var L=new Uint8Array(this.width*this.height*
4);this.copyToImageData(L,this.decodePixels());return L};var x=(H=y.document&&y.document.createElement("canvas"))&&H.getContext("2d");var M=function(L){x.width=L.width;x.height=L.height;x.clearRect(0,0,L.width,L.height);x.putImageData(L,0,0);L=new Image;L.src=H.toDataURL();return L};C.prototype.decodeFrames=function(L){var N,E;if(this.animation){var I=this.animation.frames;var K=[];var S=N=0;for(E=I.length;N<E;S=++N){S=I[S];var O=L.createImageData(S.width,S.height);var W=this.decodePixels(new Uint8Array(S.data));
this.copyToImageData(O,W);S.imageData=O;K.push(S.image=M(O))}return K}};C.prototype.renderFrame=function(L,N){var E=this.animation.frames;var I=E[N];E=E[N-1];0===N&&L.clearRect(0,0,this.width,this.height);1===(null!=E?E.disposeOp:void 0)?L.clearRect(E.xOffset,E.yOffset,E.width,E.height):2===(null!=E?E.disposeOp:void 0)&&L.putImageData(E.imageData,E.xOffset,E.yOffset);0===I.blendOp&&L.clearRect(I.xOffset,I.yOffset,I.width,I.height);return L.drawImage(I.image,I.xOffset,I.yOffset)};C.prototype.animate=
function(L){var N,E=this;var I=0;var K=this.animation;var S=K.numFrames;var O=K.frames;var W=K.numPlays;return(N=function(){var Y=I++%S;var V=O[Y];E.renderFrame(L,Y);if(1<S&&I/S<W)return E.animation._timeout=setTimeout(N,V.delay)})()};C.prototype.stopAnimation=function(){var L;return clearTimeout(null!=(L=this.animation)?L._timeout:void 0)};C.prototype.render=function(L){L._png&&L._png.stopAnimation();L._png=this;L.width=this.width;L.height=this.height;L=L.getContext("2d");if(this.animation)return this.decodeFrames(L),
this.animate(L);var N=L.createImageData(this.width,this.height);this.copyToImageData(N,this.decodePixels());return L.putImageData(N,0,0)};return C}(self);const G=new Set(["jpg","png","bmp","gif"]);m.decode=async function(y,C={},H){if(null==y)throw new w("rasterCodec:decode","missing encodeddata parameter.");let x=C.format?.toLowerCase();if(!("bsq"!==x&&"bip"!==x||null!=C.width&&null!=C.height))throw new w("rasterCodec:decode","requires width and height in options parameter.");if("tiff"===x&&C.customOptions)return A(y,
C);if(!x||"bsq"!==x&&"bip"!==x&&"deflate"!==x&&"lzw"!==x)x=c(y);if(C.useCanvas&&G.has(x))return e(y,x,C,H);const M=k(x);C.isPoint&&(C={...C},null!=C.width&&C.width++,null!=C.height&&C.height++);let L;const {offsets:N}=C;if(N&&1<N.length){H=N.map((I,K)=>M(y.slice(I,N[K+1]),C));H=await Promise.all(H);L=H[0];L.pixels=H.map(I=>I.pixels[0]);const E=H.map(I=>I.mask);H.some(I=>null!=I)&&(E.forEach((I,K)=>{null==I&&(E[K]=(new Uint8Array(L.width*L.height)).fill(255))}),L.bandMasks=E,L.mask=J.combineBandMasks(E));
L.updateStatistics()}else L=await M(y,{...C,offset:N?.[0]??C.offset});"jpg"!==x&&null!=C.noDataValue&&1===L.depthCount&&z.convertNoDataToMask(L,C.noDataValue,{customFloatTolerance:C.tolerance});C.isPoint&&q(L);return L};m.getFormat=function(y){y=c(y);"lerc2"===y?y="lerc":"error"===y&&(y="");return y};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFormats/ImageCanvasDecoder":function(){define(["../../../core/Error","../../../core/promiseUtils","../../../chunks/Zlib"],
function(m,w,v){class J{constructor(F){this._ctx=this._canvas=null;F&&(this._canvas=F.canvas,this._ctx=F.ctx||F.canvas&&F.canvas.getContext("2d"))}decode(F,R,P){if(!F||10>F.byteLength)throw new m("imagecanvasdecoder: decode","required a valid encoded data as input.");let {width:U=0,height:D=0,format:z}=R;const {applyJpegMask:p}=R;if(p&&(!U||!D))throw new m("imagecanvasdecoder: decode","image width and height are needed to apply jpeg mask directly to canvas");return new Promise((b,g)=>{let h=null;
"jpg"===z&&p&&(h=J._getMask(F,{width:U,height:D}));const n=new Blob([new Uint8Array(F)],{type:"jpg"==="image/"+z?"jpeg":z}),l=URL.createObjectURL(n),A=new Image;let t;A.src=l;A.onload=()=>{URL.revokeObjectURL(l);if(w.isAborted(P))g(w.createAbortError());else{U=A.width;D=A.height;if(this._canvas&&this._ctx){if(this._canvas.width!==U||this._canvas.height!==D)this._canvas.width=U,this._canvas.height=D;this._ctx.clearRect(0,0,U,D)}else this._canvas=document.createElement("canvas"),this._canvas.width=
U,this._canvas.height=D,this._ctx=this._canvas.getContext("2d");this._ctx.drawImage(A,0,0);var r=this._ctx.getImageData(0,0,U,D);t=r.data;var a;if(R.renderOnCanvas){if(h)for(a=0;a<h.length;a++)t[4*a+3]=h[a]?255:0;this._ctx.putImageData(r,0,0);b(null)}else{r=U*D;var f=new Uint8Array(r),d=new Uint8Array(r),e=new Uint8Array(r);if(h)for(a=0;a<r;a++)f[a]=t[4*a],d[a]=t[4*a+1],e[a]=t[4*a+2];else for(h=new Uint8Array(r),a=0;a<r;a++)f[a]=t[4*a],d[a]=t[4*a+1],e[a]=t[4*a+2],h[a]=t[4*a+3];b({width:U,height:D,
pixels:[f,d,e],mask:h,pixelType:"u8"})}}};A.onerror=()=>{URL.revokeObjectURL(l);g("cannot load image")}})}static _getMask(F,R){let P=null;try{var U=new Uint8Array(F);F=0;var D=U.length-2;for(F=Math.ceil(U.length/2);F<D&&(255!==U[F]||217!==U[F+1]);F++);F+=2;if(F<U.length-1){const z=(new v.Zlib(U.subarray(F))).getBytes();P=new Uint8Array(R.width*R.height);R=0;for(U=0;U<z.length;U++)for(D=7;0<=D;D--)P[R++]=z[U]>>D&1}}catch(z){}return P}}return J})},"esri/chunks/Zlib":function(){define(["exports","./_commonjsHelpers"],
function(m,w){var v={exports:{}};(function(J){(function(F){F=F();void 0!==F&&(J.exports=F)})(function(){var F=function(){function R(){this.bufferLength=this.pos=0;this.eof=!1;this.buffer=null}R.prototype={ensureBuffer:function(P){var U=this.buffer,D=U?U.byteLength:0;if(P<D)return U;for(var z=512;z<P;)z<<=1;P=new Uint8Array(z);for(z=0;z<D;++z)P[z]=U[z];return this.buffer=P},getByte:function(){for(var P=this.pos;this.bufferLength<=P;){if(this.eof)return null;this.readBlock()}return this.buffer[this.pos++]},
getBytes:function(P){var U=this.pos;if(P){this.ensureBuffer(U+P);for(P=U+P;!this.eof&&this.bufferLength<P;)this.readBlock();var D=this.bufferLength;P>D&&(P=D)}else{for(;!this.eof;)this.readBlock();P=this.bufferLength}this.pos=P;return this.buffer.subarray(U,P)},lookChar:function(){for(var P=this.pos;this.bufferLength<=P;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var P=this.pos;this.bufferLength<=P;){if(this.eof)return null;
this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(P,U,D){for(var z=P+U;this.bufferLength<=z&&!this.eof;)this.readBlock();return new Stream(this.buffer,P,U,D)},skip:function(P){P||=1;this.pos+=P},reset:function(){this.pos=0}};return R}();return function(){function R(g){throw Error(g);}function P(g){var h=0,n=g[h++],l=g[h++];-1!=n&&-1!=l||R("Invalid header in flate stream");8!=(n&15)&&R("Unknown compression method in flate stream");0!=((n<<8)+l)%31&&R("Bad FCHECK in flate stream");
l&32&&R("FDICT bit set in flate stream");this.bytes=g;this.bytesPos=h;this.codeBuf=this.codeSize=0;F.call(this)}if(!self||!self.Uint32Array)return null;var U=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),D=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),z=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,
393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),p=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59E4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,
524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,
524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,
524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,
524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,
524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,
524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,
524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],b=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];P.prototype=Object.create(F.prototype);P.prototype.getBits=function(g){for(var h=
this.codeSize,n=this.codeBuf,l=this.bytes,A=this.bytesPos,t;h<g;)"undefined"==typeof(t=l[A++])&&R("Bad encoding in flate stream"),n|=t<<h,h+=8;this.codeBuf=n>>g;this.codeSize=h-=g;this.bytesPos=A;return n&(1<<g)-1};P.prototype.getCode=function(g){var h=g[0],n=g[1];g=this.codeSize;for(var l=this.codeBuf,A=this.bytes,t=this.bytesPos;g<n;){var r;"undefined"==typeof(r=A[t++])&&R("Bad encoding in flate stream");l|=r<<g;g+=8}n=h[l&(1<<n)-1];h=n>>16;n&=65535;(0==g||g<h||0==h)&&R("Bad encoding in flate stream");
this.codeBuf=l>>h;this.codeSize=g-h;this.bytesPos=t;return n};P.prototype.generateHuffmanTable=function(g){for(var h=g.length,n=0,l=0;l<h;++l)g[l]>n&&(n=g[l]);for(var A=1<<n,t=new Uint32Array(A),r=1,a=0,f=2;r<=n;++r,a<<=1,f<<=1)for(var d=0;d<h;++d)if(g[d]==r){var e=0,c=a;for(l=0;l<r;++l)e=e<<1|c&1,c>>=1;for(l=e;l<A;l+=f)t[l]=r<<16|d;++a}return[t,n]};P.prototype.readBlock=function(){function g(e,c,k,q,u){for(e=e.getBits(k)+q;0<e--;)c[a++]=u}var h=this.getBits(3);h&1&&(this.eof=!0);h>>=1;if(0==h){var n=
this.bytes,l=this.bytesPos,A;"undefined"==typeof(A=n[l++])&&R("Bad block header in flate stream");var t=A;"undefined"==typeof(A=n[l++])&&R("Bad block header in flate stream");t|=A<<8;"undefined"==typeof(A=n[l++])&&R("Bad block header in flate stream");h=A;"undefined"==typeof(A=n[l++])&&R("Bad block header in flate stream");(h|A<<8)!=(~t&65535)&&R("Bad uncompressed block length in flate stream");this.codeSize=this.codeBuf=0;A=this.bufferLength;h=this.ensureBuffer(A+t);this.bufferLength=t=A+t;for(var r=
A;r<t;++r){if("undefined"==typeof(A=n[l++])){this.eof=!0;break}h[r]=A}this.bytesPos=l}else{if(1==h)l=p,A=b;else if(2==h){h=this.getBits(5)+257;A=this.getBits(5)+1;n=this.getBits(4)+4;l=Array(U.length);for(var a=0;a<n;)l[U[a++]]=this.getBits(3);l=this.generateHuffmanTable(l);a=n=0;A=h+A;for(t=Array(A);a<A;)r=this.getCode(l),16==r?g(this,t,2,3,n):17==r?g(this,t,3,3,n=0):18==r?g(this,t,7,11,n=0):t[a++]=n=r;l=this.generateHuffmanTable(t.slice(0,h));A=this.generateHuffmanTable(t.slice(h,A))}else R("Unknown block type in flate stream");
t=(h=this.buffer)?h.length:0;for(r=this.bufferLength;;){var f=this.getCode(l);if(256>f)r+1>=t&&(h=this.ensureBuffer(r+1),t=h.length),h[r++]=f;else{if(256==f){this.bufferLength=r;break}f-=257;f=D[f];var d=f>>16;0<d&&(d=this.getBits(d));n=(f&65535)+d;f=this.getCode(A);f=z[f];d=f>>16;0<d&&(d=this.getBits(d));f=(f&65535)+d;r+n>=t&&(h=this.ensureBuffer(r+n),t=h.length);for(d=0;d<n;++d,++r)h[r]=h[r-f]}}}};return P}()})})(v);w=w.getDefaultExportFromCjs(v.exports);m.Zlib=w})},"esri/layers/support/rasterFormats/JpgPlus":function(){define(["../../../chunks/Jpg",
"../../../chunks/Zlib"],function(m,w){class v{static decode(J,F=!1){const R=new Uint8Array(J);J=new m.JpegImage;J.parse(R);const {width:P,height:U,numComponents:D,eof:z}=J,p=J.getData(P,U,!0),b=P*U;J=null;let g=0,h=0,n=0;if(!F&&z<R.length-1)try{var l=(new w.Zlib(R.subarray(z))).getBytes();J=new Uint8Array(b);for(g=F=0;g<l.length;g++)for(n=7;0<=n;n--)J[F++]=l[g]>>n&1}catch{}if(1===D&&p.length===P*U)l=new Uint8Array(p.buffer),l=[l,l,l];else{l=[];for(g=0;3>g;g++)l.push(new Uint8Array(b));for(h=n=0;h<
b;h++)for(g=0;3>g;g++)l[g][h]=p[n++]}return{width:P,height:U,pixels:l,mask:J}}}return v})},"esri/chunks/Jpg":function(){define(["exports","./_commonjsHelpers"],function(m,w){var v={exports:{}};(function(J){(function(F){F=F();void 0!==F&&(J.exports=F)})(function(){var F=function(){function R(P){this.message="JPEG error: "+P}R.prototype=Error();R.prototype.name="JpegError";return R.constructor=R}();return function(){function R(){this.decodeTransform=null;this.colorTransform=-1}function P(b,g){for(var h=
0,n=[],l,A,t=16;0<t&&!b[t-1];)t--;n.push({children:[],index:0});var r=n[0],a;for(l=0;l<t;l++){for(A=0;A<b[l];A++){r=n.pop();for(r.children[r.index]=g[h];0<r.index;)r=n.pop();r.index++;for(n.push(r);n.length<=l;)n.push(a={children:[],index:0}),r.children[r.index]=a.children,r=a;h++}l+1<t&&(n.push(a={children:[],index:0}),r.children[r.index]=a.children,r=a)}return n[0].children}function U(b,g,h,n,l,A,t,r,a){function f(){if(0<M)return M--,x>>M&1;x=b[g++];if(255===x){var X=b[g++];if(X)throw new F("unexpected marker "+
(x<<8|X).toString(16));}M=7;return x>>>7}function d(X){for(;;){X=X[f()];if("number"===typeof X)return X;if("object"!==typeof X)throw new F("invalid huffman sequence");}}function e(X){for(var aa=0;0<X;)aa=aa<<1|f(),X--;return aa}function c(X){if(1===X)return 1===f()?1:-1;var aa=e(X);return aa>=1<<X-1?aa:aa+(-1<<X)+1}function k(X,aa){var Z=d(X.huffmanTableDC);Z=0===Z?0:c(Z);X.blockData[aa]=X.pred+=Z;for(Z=1;64>Z;){var ba=d(X.huffmanTableAC),ea=ba&15;ba>>=4;if(0===ea){if(15>ba)break;Z+=16}else Z+=ba,
X.blockData[aa+p[Z]]=c(ea),Z++}}function q(X,aa){var Z=d(X.huffmanTableDC);Z=0===Z?0:c(Z)<<a;X.blockData[aa]=X.pred+=Z}function u(X,aa){X.blockData[aa]|=f()<<a}function G(X,aa){if(0<L)L--;else for(var Z=A;Z<=t;){var ba=d(X.huffmanTableAC),ea=ba&15;ba>>=4;if(0===ea){if(15>ba){L=e(ba)+(1<<ba)-1;break}Z+=16}else Z+=ba,X.blockData[aa+p[Z]]=c(ea)*(1<<a),Z++}}function y(X,aa){for(var Z=A,ba=0,ea;Z<=t;){ea=p[Z];switch(N){case 0:ba=d(X.huffmanTableAC);ea=ba&15;ba>>=4;if(0===ea)15>ba?(L=e(ba)+(1<<ba),N=4):
(ba=16,N=1);else{if(1!==ea)throw new F("invalid ACn encoding");E=c(ea);N=ba?2:3}continue;case 1:case 2:X.blockData[aa+ea]?X.blockData[aa+ea]+=f()<<a:(ba--,0===ba&&(N=2===N?3:0));break;case 3:X.blockData[aa+ea]?X.blockData[aa+ea]+=f()<<a:(X.blockData[aa+ea]=E<<a,N=0);break;case 4:X.blockData[aa+ea]&&(X.blockData[aa+ea]+=f()<<a)}Z++}4===N&&(L--,0===L&&(N=0))}var C=h.mcusPerLine,H=g,x=0,M=0,L=0,N=0,E,I=n.length,K,S,O,W;r=h.progressive?0===A?0===r?q:u:0===r?G:y:k;var Y=0;h=1===I?n[0].blocksPerLine*n[0].blocksPerColumn:
C*h.mcusPerColumn;for(var V,B;Y<h;){var Q=l?Math.min(h-Y,l):h;for(K=0;K<I;K++)n[K].pred=0;L=0;if(1===I){var T=n[0];for(W=0;W<Q;W++)r(T,64*((T.blocksPerLine+1)*(Y/T.blocksPerLine|0)+Y%T.blocksPerLine)),Y++}else for(W=0;W<Q;W++){for(K=0;K<I;K++)for(T=n[K],V=T.h,B=T.v,S=0;S<B;S++)for(O=0;O<V;O++)r(T,64*((T.blocksPerLine+1)*((Y/C|0)*T.v+S)+(Y%C*T.h+O)));Y++}M=0;(T=z(b,g))&&T.invalid&&(console.log("decodeScan - unexpected MCU data, next marker is: "+T.invalid),g=T.offset);T=T&&T.marker;if(!T||65280>=T)throw new F("marker was not found");
if(65488<=T&&65495>=T)g+=2;else break}(T=z(b,g))&&T.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+T.invalid),g=T.offset);return g-H}function D(b,g){b=g.blocksPerLine;for(var h=g.blocksPerColumn,n=new Int16Array(64),l=0;l<h;l++)for(var A=0;A<b;A++){var t=void 0,r=void 0,a=void 0,f=void 0,d=void 0,e=void 0,c=void 0,k=void 0,q=d=e=f=r=t=void 0,u=void 0,G=void 0,y=void 0,C=64*((g.blocksPerLine+1)*l+A),H=n,x=g.quantizationTable,M=g.blockData;if(!x)throw new F("missing required Quantization Table.");
for(var L=0;64>L;L+=8)t=M[C+L],k=M[C+L+1],c=M[C+L+2],e=M[C+L+3],d=M[C+L+4],f=M[C+L+5],a=M[C+L+6],r=M[C+L+7],t*=x[L],0===(k|c|e|d|f|a|r)?(t=5793*t+512>>10,H[L]=t,H[L+1]=t,H[L+2]=t,H[L+3]=t,H[L+4]=t,H[L+5]=t,H[L+6]=t,H[L+7]=t):(k*=x[L+1],c*=x[L+2],e*=x[L+3],d*=x[L+4],f*=x[L+5],a*=x[L+6],r*=x[L+7],y=5793*t+128>>8,G=5793*d+128>>8,u=c,q=a,d=2896*(k-r)+128>>8,r=2896*(k+r)+128>>8,e<<=4,f<<=4,y=y+G+1>>1,G=y-G,t=3784*u+1567*q+128>>8,u=1567*u-3784*q+128>>8,q=t,d=d+f+1>>1,f=d-f,r=r+e+1>>1,e=r-e,y=y+q+1>>1,q=
y-q,G=G+u+1>>1,u=G-u,t=2276*d+3406*r+2048>>12,d=3406*d-2276*r+2048>>12,r=t,t=799*e+4017*f+2048>>12,e=4017*e-799*f+2048>>12,f=t,H[L]=y+r,H[L+7]=y-r,H[L+1]=G+f,H[L+6]=G-f,H[L+2]=u+e,H[L+5]=u-e,H[L+3]=q+d,H[L+4]=q-d);for(x=0;8>x;++x)t=H[x],k=H[x+8],c=H[x+16],e=H[x+24],d=H[x+32],f=H[x+40],a=H[x+48],r=H[x+56],0===(k|c|e|d|f|a|r)?(t=5793*t+8192>>14,t=-2040>t?0:2024<=t?255:t+2056>>4,M[C+x]=t,M[C+x+8]=t,M[C+x+16]=t,M[C+x+24]=t,M[C+x+32]=t,M[C+x+40]=t,M[C+x+48]=t,M[C+x+56]=t):(y=5793*t+2048>>12,G=5793*d+2048>>
12,u=c,q=a,d=2896*(k-r)+2048>>12,r=2896*(k+r)+2048>>12,y=(y+G+1>>1)+4112,G=y-G,t=3784*u+1567*q+2048>>12,u=1567*u-3784*q+2048>>12,q=t,d=d+f+1>>1,f=d-f,r=r+e+1>>1,e=r-e,y=y+q+1>>1,q=y-q,G=G+u+1>>1,u=G-u,t=2276*d+3406*r+2048>>12,d=3406*d-2276*r+2048>>12,r=t,t=799*e+4017*f+2048>>12,e=4017*e-799*f+2048>>12,f=t,t=y+r,r=y-r,k=G+f,a=G-f,c=u+e,f=u-e,e=q+d,d=q-d,t=16>t?0:4080<=t?255:t>>4,k=16>k?0:4080<=k?255:k>>4,c=16>c?0:4080<=c?255:c>>4,e=16>e?0:4080<=e?255:e>>4,d=16>d?0:4080<=d?255:d>>4,f=16>f?0:4080<=f?
255:f>>4,a=16>a?0:4080<=a?255:a>>4,r=16>r?0:4080<=r?255:r>>4,M[C+x]=t,M[C+x+8]=k,M[C+x+16]=c,M[C+x+24]=e,M[C+x+32]=d,M[C+x+40]=f,M[C+x+48]=a,M[C+x+56]=r)}return g.blockData}function z(b,g,h){var n=b.length-1;h=h<g?h:g;if(g>=n)return null;var l=b[g]<<8|b[g+1];if(65472<=l&&65534>=l)return{invalid:null,marker:l,offset:g};for(g=b[h]<<8|b[h+1];!(65472<=g&&65534>=g);){if(++h>=n)return null;g=b[h]<<8|b[h+1]}return{invalid:l.toString(16),marker:g,offset:h}}if(!self||!self.Uint8ClampedArray)return null;var p=
new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);R.prototype={parse:function(b){function g(){var x=b[l]<<8|b[l+1];l+=2;return x}function h(){var x=g();x=l+x-2;var M=z(b,x,l);M&&M.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+M.invalid),x=M.offset);x=b.subarray(l,x);l+=x.length;return x}function n(x){for(var M=Math.ceil(x.samplesPerLine/
8/x.maxH),L=Math.ceil(x.scanLines/8/x.maxV),N=0;N<x.components.length;N++){H=x.components[N];var E=Math.ceil(Math.ceil(x.samplesPerLine/8)*H.h/x.maxH),I=Math.ceil(Math.ceil(x.scanLines/8)*H.v/x.maxV);H.blockData=new Int16Array(64*L*H.v*(M*H.h+1));H.blocksPerLine=E;H.blocksPerColumn=I}x.mcusPerLine=M;x.mcusPerColumn=L}var l=0,A=null,t=null,r=[],a=[],f=[],d=g();if(65496!==d)throw new F("SOI not found");for(d=g();65497!==d;){switch(d){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var e=
h();65504===d&&74===e[0]&&70===e[1]&&73===e[2]&&70===e[3]&&0===e[4]&&(A={version:{major:e[5],minor:e[6]},densityUnits:e[7],xDensity:e[8]<<8|e[9],yDensity:e[10]<<8|e[11],thumbWidth:e[12],thumbHeight:e[13],thumbData:e.subarray(14,14+3*e[12]*e[13])});65518===d&&65===e[0]&&100===e[1]&&111===e[2]&&98===e[3]&&101===e[4]&&(t={version:e[5]<<8|e[6],flags0:e[7]<<8|e[8],flags1:e[9]<<8|e[10],transformCode:e[11]});break;case 65499:d=g()+l-2;for(var c;l<d;){var k=b[l++],q=new Uint16Array(64);if(0===k>>4)for(e=
0;64>e;e++)c=p[e],q[c]=b[l++];else if(1===k>>4)for(e=0;64>e;e++)c=p[e],q[c]=g();else throw new F("DQT - invalid table spec");r[k&15]=q}break;case 65472:case 65473:case 65474:if(u)throw new F("Only single frame JPEGs supported");g();var u={};u.extended=65473===d;u.progressive=65474===d;u.precision=b[l++];u.scanLines=g();u.samplesPerLine=g();u.components=[];u.componentIds={};e=b[l++];for(d=q=k=0;d<e;d++){c=b[l];var G=b[l+1]>>4;var y=b[l+1]&15;k<G&&(k=G);q<y&&(q=y);G=u.components.push({h:G,v:y,quantizationId:b[l+
2],quantizationTable:null});u.componentIds[c]=G-1;l+=3}u.maxH=k;u.maxV=q;n(u);break;case 65476:c=g();for(d=2;d<c;){k=b[l++];q=new Uint8Array(16);for(e=G=0;16>e;e++,l++)G+=q[e]=b[l];y=new Uint8Array(G);for(e=0;e<G;e++,l++)y[e]=b[l];d+=17+G;(0===k>>4?f:a)[k&15]=P(q,y)}break;case 65501:g();var C=g();break;case 65498:g();c=b[l++];e=[];for(d=0;d<c;d++){k=u.componentIds[b[l++]];var H=u.components[k];k=b[l++];H.huffmanTableDC=f[k>>4];H.huffmanTableAC=a[k&15];e.push(H)}d=b[l++];c=b[l++];k=b[l++];d=U(b,l,
u,e,C,d,c,k>>4,k&15);l+=d;break;case 65535:255!==b[l]&&l--;break;default:if(255===b[l-3]&&192<=b[l-2]&&254>=b[l-2])l-=3;else throw new F("unknown marker "+d.toString(16));}d=g()}this.width=u.samplesPerLine;this.height=u.scanLines;this.jfif=A;this.eof=l;this.adobe=t;this.components=[];for(d=0;d<u.components.length;d++){H=u.components[d];if(A=r[H.quantizationId])H.quantizationTable=A;this.components.push({output:D(u,H),scaleX:H.h/u.maxH,scaleY:H.v/u.maxV,blocksPerLine:H.blocksPerLine,blocksPerColumn:H.blocksPerColumn})}this.numComponents=
this.components.length},_getLinearizedBlockData:function(b,g){var h=this.width/b,n=this.height/g,l,A,t=0,r=this.components.length,a=b*g*r,f=new Uint8ClampedArray(a),d=new Uint32Array(b);for(A=0;A<r;A++){var e=this.components[A];var c=e.scaleX*h;var k=e.scaleY*n;t=A;var q=e.output;var u=e.blocksPerLine+1<<3;for(l=0;l<b;l++)e=0|l*c,d[l]=(e&4294967288)<<3|e&7;for(c=0;c<g;c++)for(e=0|c*k,e=u*(e&4294967288)|(e&7)<<3,l=0;l<b;l++)f[t]=q[e+d[l]],t+=r}if(g=this.decodeTransform)for(A=0;A<a;)for(b=e=0;e<r;e++,
A++,b+=2)f[A]=(f[A]*g[b]>>8)+g[b+1];return f},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0===this.colorTransform?!1:!0:1===this.colorTransform?!0:!1},_convertYccToRgb:function(b){for(var g,h,n,l=0,A=b.length;l<A;l+=3)g=b[l],h=b[l+1],n=b[l+2],b[l]=g-179.456+1.402*n,b[l+1]=g+135.459-.344*h-.714*n,b[l+2]=g-226.816+1.772*h;return b},_convertYcckToRgb:function(b){for(var g,h,n,l,A=0,t=0,r=b.length;t<r;t+=4)g=b[t],h=b[t+1],n=b[t+2],l=b[t+3],b[A++]=
-122.67195406894+h*(-6.60635669420364E-5*h+4.37130475926232E-4*n-5.4080610064599E-5*g+4.8449797120281E-4*l-.154362151871126)+n*(-9.57964378445773E-4*n+8.17076911346625E-4*g-.00477271405408747*l+1.53380253221734)+g*(9.61250184130688E-4*g-.00266257332283933*l+.48357088451265)+l*(-3.36197177618394E-4*l+.484791561490776),b[A++]=107.268039397724+h*(2.19927104525741E-5*h-6.40992018297945E-4*n+6.59397001245577E-4*g+4.26105652938837E-4*l-.176491792462875)+n*(-7.78269941513683E-4*n+.00130872261408275*g+7.70482631801132E-4*
l-.151051492775562)+g*(.00126935368114843*g-.00265090189010898*l+.25802910206845)+l*(-3.18913117588328E-4*l-.213742400323665),b[A++]=-20.810012546947+h*(-5.70115196973677E-4*h-2.63409051004589E-5*n+.0020741088115012*g-.00288260236853442*l+.814272968359295)+n*(-1.53496057440975E-5*n-1.32689043961446E-4*g+5.60833691242812E-4*l-.195152027534049)+g*(.00174418132927582*g-.00255243321439347*l+.116935020465145)+l*(-3.43531996510555E-4*l+.24165260232407);return b},_convertYcckToCmyk:function(b){for(var g,
h,n,l=0,A=b.length;l<A;l+=4)g=b[l],h=b[l+1],n=b[l+2],b[l]=434.456-g-1.402*n,b[l+1]=119.541-g+.344*h+.714*n,b[l+2]=481.816-g-1.772*h;return b},_convertCmykToRgb:function(b){for(var g,h,n,l,A=0,t=1/255,r=0,a=b.length;r<a;r+=4)g=b[r]*t,h=b[r+1]*t,n=b[r+2]*t,l=b[r+3]*t,b[A++]=255+g*(-4.387332384609988*g+54.48615194189176*h+18.82290502165302*n+212.25662451639585*l-285.2331026137004)+h*(1.7149763477362134*h-5.6096736904047315*n-17.873870861415444*l-5.497006427196366)+n*(-2.5217340131683033*n-21.248923337353073*
l+17.5119270841813)-l*(21.86122147463605*l+189.48180835922747),b[A++]=255+g*(8.841041422036149*g+60.118027045597366*h+6.871425592049007*n+31.159100130055922*l-79.2970844816548)+h*(-15.310361306967817*h+17.575251261109482*n+131.35250912493976*l-190.9453302588951)+n*(4.444339102852739*n+9.8632861493405*l-24.86741582555878)-l*(20.737325471181034*l+187.80453709719578),b[A++]=255+g*(.8842522430003296*g+8.078677503112928*h+30.89978309703729*n-.23883238689178934*l-14.183576799673286)+h*(10.49593273432072*
h+63.02378494754052*n+50.606957656360734*l-112.23884253719248)+n*(.03296041114873217*n+115.60384449646641*l-193.58209356861505)-l*(22.33816807309886*l+180.12613974708367);return b},getData:function(b,g,h){if(4<this.numComponents)throw new F("Unsupported color mode");b=this._getLinearizedBlockData(b,g);if(1===this.numComponents&&h){h=b.length;g=new Uint8ClampedArray(3*h);for(var n=0,l=0;l<h;l++){var A=b[l];g[n++]=A;g[n++]=A;g[n++]=A}return g}if(3===this.numComponents&&this._isColorConversionNeeded())return this._convertYccToRgb(b);
if(4===this.numComponents){if(this._isColorConversionNeeded())return h?this._convertYcckToRgb(b):this._convertYcckToCmyk(b);if(h)return this._convertCmykToRgb(b)}return b}};return R}()})})(v);w=w.getDefaultExportFromCjs(v.exports);m.JpegImage=w})},"esri/layers/support/rasterFormats/Lerc":function(){define(["require","exports","../../../assets"],function(m,w,v){function J(D,z,p){p.set(D.slice(z,z+p.length))}function F(D){const {_malloc:z,_free:p,_lerc_getBlobInfo:b,_lerc_getDataRanges:g,_lerc_decode_4D:h,
asm:n}=D;let l;const A=Object.values(n).find(r=>r&&"buffer"in r&&r.buffer===D.HEAPU8.buffer),t=r=>{r=r.map(d=>(d>>3<<3)+16);var a=r.reduce((d,e)=>d+e),f=z(a);l=new Uint8Array(A.buffer);a=r[0];r[0]=f;for(f=1;f<r.length;f++){const d=r[f];r[f]=r[f-1]+a;a=d}return r};U.getBlobInfo=r=>{var a=new Uint8Array(48),f=new Uint8Array(24);const [d,e,c]=t([r.length,a.length,f.length]);l.set(r,d);l.set(a,e);l.set(f,c);var k=b(d,r.length,e,c,12,3);if(k)throw p(d),Error(`lerc-getBlobInfo: error code is ${k}`);l=new Uint8Array(A.buffer);
J(l,e,a);J(l,c,f);a=new Uint32Array(a.buffer);var q=new Float64Array(f.buffer);const [u,G,,y,C,H,x,M,L,N,E]=a;f={version:u,depthCount:N,width:y,height:C,validPixelCount:x,bandCount:H,blobSize:M,maskCount:L,dataType:G,minValue:q[0],maxValue:q[1],maxZerror:q[2],statistics:[],bandCountWithNoData:E};if(E&&1<N)return p(d),f;if(1===N&&1===H)return p(d),f.statistics.push({minValue:q[0],maxValue:q[1]}),f;k=N*H*8;var I=new Uint8Array(k),K=new Uint8Array(k);a=d;var S=q=0;let O=!1;l.byteLength<d+2*k?(p(d),O=
!0,[a,q,S]=t([r.length,k,k]),l.set(r,a)):[q,S]=t([k,k]);l.set(I,q);l.set(K,S);if(k=g(a,r.length,N,H,q,S))throw p(a),O||p(q),Error(`lerc-getDataRanges: error code is ${k}`);l=new Uint8Array(A.buffer);J(l,q,I);J(l,S,K);r=new Float64Array(I.buffer);k=new Float64Array(K.buffer);K=f.statistics;for(I=0;I<H;I++)if(1<N){S=r.slice(I*N,(I+1)*N);const W=k.slice(I*N,(I+1)*N),Y=Math.min.apply(null,S),V=Math.max.apply(null,W);K.push({minValue:Y,maxValue:V,depthStats:{minValues:S,maxValues:W}})}else K.push({minValue:r[I],
maxValue:k[I]});p(a);O||p(q);return f};U.decode=(r,a)=>{const {maskCount:f,depthCount:d,bandCount:e,width:c,height:k,dataType:q,bandCountWithNoData:u}=a;var G=R[q],y=c*k;a=new Uint8Array(y*e);G=new Uint8Array(y*d*e*G.size);y=new Uint8Array(e);var C=new Uint8Array(8*e);const [H,x,M,L,N]=t([r.length,a.length,G.length,y.length,C.length]);l.set(r,H);l.set(a,x);l.set(G,M);l.set(y,L);l.set(C,N);if(r=h(H,r.length,f,x,d,c,k,e,q,M,L,N))throw p(H),Error(`lerc-decode: error code is ${r}`);l=new Uint8Array(A.buffer);
J(l,M,G);J(l,x,a);r=null;if(u){J(l,L,y);J(l,N,C);r=[];C=new Float64Array(C.buffer);for(let E=0;E<y.length;E++)r.push(y[E]?C[E]:null)}p(H);return{data:G,maskData:a,noDataValues:r}}}const R=[{pixelType:"S8",size:1,ctor:Int8Array,range:[-128,127]},{pixelType:"U8",size:1,ctor:Uint8Array,range:[0,255]},{pixelType:"S16",size:2,ctor:Int16Array,range:[-32768,32767]},{pixelType:"U16",size:2,ctor:Uint16Array,range:[0,65536]},{pixelType:"S32",size:4,ctor:Int32Array,range:[-2147483648,2147483647]},{pixelType:"U32",
size:4,ctor:Uint32Array,range:[0,4294967296]},{pixelType:"F32",size:4,ctor:Float32Array,range:[-3.4027999387901484E38,3.4027999387901484E38]},{pixelType:"F64",size:8,ctor:Float64Array,range:[-1.7976931348623157E308,1.7976931348623157E308]}];let P=null;const U={getBlobInfo:null,decode:null};w.decode=function(D,z={}){var p=z.inputOffset??0;D=D instanceof Uint8Array?D.subarray(p):new Uint8Array(D,p);p=U.getBlobInfo(D);const {data:b,maskData:g,noDataValues:h}=U.decode(D,p),{width:n,height:l,bandCount:A,
depthCount:t,dataType:r,maskCount:a,statistics:f}=p;var d=R[r],e=new d.ctor(b.buffer);D=[];p=[];const c=n*l;var k=c*t;for(var q=0;q<A;q++){var u=e.subarray(q*k,(q+1)*k);if(z.returnInterleaved)D.push(u);else{a:{var G=c,y=t;if(2>y)break a;const C=new d.ctor(G*y);for(let H=0,x=0;H<G;H++)for(let M=0,L=H;M<y;M++,L+=G)C[L]=u[x++];u=C}D.push(u)}p.push(g.subarray(q*k,(q+1)*k))}e=0===a?null:1===a?p[0]:new Uint8Array(c);if(1<a)for(e.set(p[0]),k=1;k<p.length;k++)for(q=p[k],u=0;u<c;u++)e[u]&=q[u];({noDataValue:z}=
z);k=null!=z&&d.range[0]<=z&&d.range[1]>=z;if(0<a&&k)for(k=0;k<A;k++)for(q=D[k],u=p[k]||e,G=0;G<c;G++)0===u[G]&&(q[G]=z);({pixelType:d}=d);return{width:n,height:l,bandCount:A,pixelType:d,depthCount:t,statistics:f,pixels:D,mask:e,bandMasks:a===A&&1<A?p:null,noDataValues:h}};w.getBlobInfo=function(D,z={}){D=D instanceof Uint8Array?D.subarray(z.inputOffset??0):new Uint8Array(D,z.inputOffset??0);return U.getBlobInfo(D)};w.load=function(){return P?P:P=(new Promise((D,z)=>m(["../../../chunks/lerc-wasm"],
D,z))).then(D=>D.lercWasm).then(({default:D})=>D({locateFile:z=>v.getAssetUrl(`esri/layers/support/rasterFormats/${z}`)})).then(D=>{F(D)})};w.pixelTypeInfoMap=R;Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFormats/Lzw":function(){define(["exports"],function(m){function w(R,P,U,D=!0){if(0!==P%4||0!==U%4){var z=new ArrayBuffer(4*Math.ceil(U/4));z=new Uint8Array(z);R=new Uint8Array(R,P,U);if(D)for(D=0;D<z.length;D+=4)z[D]=R[D+3],z[D+1]=R[D+2],z[D+2]=R[D+
1],z[D+3]=R[D];else z.set(R);return new Uint32Array(z.buffer)}if(D){D=new Uint8Array(R,P,U);z=new Uint8Array(D.length);for(R=0;R<z.length;R+=4)z[R]=D[R+3],z[R+1]=D[R+2],z[R+2]=D[R+1],z[R+3]=D[R];return new Uint32Array(z.buffer)}return new Uint32Array(R,P,U/4)}function v(){const R=[];for(let P=0;257>=P;P++)R[P]=[P];return R}function J(R,P){for(let U=0;U<P.length;U++)R.push(P[U])}const F=new Set;F.add(511);F.add(1023);F.add(2047);F.add(4095);F.add(8191);m.decode=function(R,P,U,D=!0){R=w(R,P,U,D);P=
9;D=v();let z=32,p=D.length,b=[],g=1,h=R[0],n=0;const l=R.length;U=8*(4*l-U);const A=[];for(;null!=h;){if(z>=P)z-=P,n=h>>>32-P,h<<=P;else{n=h>>>32-z;h=R[g++];var t=P-z;z=32-t;n=(n<<t)+(h>>>z);h<<=t}if(257===n)break;if(256===n)P=9,D=v(),p=D.length,b=[];else{t=D[n];if(null==t){if(n>D.length)throw Error("data integrity issue: code does not exist on code page");b.push(b[0]);D[p++]=b.slice();J(A,b)}else J(A,t),b.push(t[0]),1<b.length&&(D[p++]=b.slice()),b=t.slice();F.has(p)&&P++;0===z&&(h=R[g++],z=32);
if(g>l||g===l&&z<=U)break}}return new Uint8Array(A)};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFormats/Raw":function(){define(function(){const m=v=>{let J=1;switch(v){case Uint8Array:case Int8Array:J=1;break;case Uint16Array:case Int16Array:J=2;break;case Uint32Array:case Int32Array:case Float32Array:J=4;break;case Float64Array:J=8}return J};class w{static decode(v,J){var F=J.pixelType;const R=[],P=J.width*J.height;var U=Math.floor(v.byteLength/(J.width*
J.height*m(J.pixelType)));const {bandIds:D,format:z}=J;J=D?.length||Math.floor(v.byteLength/(J.width*J.height*m(J.pixelType)));var p=v.byteLength-v.byteLength%(P*m(F)),b=new F(v,0,P*U);let g,h,n,l,A=null;if("bip"===z)for(g=0;g<J;g++){n=new F(P);l=D?D[g]:g;for(h=0;h<P;h++)n[h]=b[h*U+l];R.push(n)}else if("bsq"===z)for(g=0;g<J;g++)l=D?D[g]:g,R.push(b.subarray(l*P,(l+1)*P));if(p<v.byteLength-1)if(v=v.slice(p),8*v.byteLength<P)A=null;else{v=new Uint8Array(v,0,Math.ceil(P/8));F=new Uint8Array(P);for(p=
b=p=J=U=0;p<v.length-1;p++)for(J=v[p],b=7;0<=b;b--)F[U++]=J>>b&1;for(b=7;U<P-1;)J=v[v.length-1],F[U++]=J>>b&1,b--;A=F}return{pixels:R,mask:A}}}return w})},"esri/layers/support/rasterFormats/TiffDecoder":function(){define("exports ../../../core/has ../rasterDatasets/byteStreamUtils ../../../chunks/Jpg ./Lerc ./Lzw ./pixelRangeUtils ./TiffTags ./utils ../../../chunks/Zlib".split(" "),function(m,w,v,J,F,R,P,U,D,z){function p(E,I){let K="unknown";3===E?K=64===I?"f64":"f32":1===E?1===I?K="u1":2===I?K=
"u2":4===I?K="u4":8>=I?K="u8":16>=I?K="u16":32>=I&&(K="u32"):2===E&&(8>=I?K="s8":16>=I?K="s16":32>=I&&(K="s32"));return K}function b(E){let I=null;switch(E?E.toLowerCase():"f32"){case "u1":case "u2":case "u4":case "u8":I=Uint8Array;break;case "u16":I=Uint16Array;break;case "u32":I=Uint32Array;break;case "s8":I=Int8Array;break;case "s16":I=Int16Array;break;case "s32":I=Int32Array;break;case "f64":I=Float64Array;break;default:I=Float32Array}return I}function g(E,I){return{x:I[0]*E.x+I[1]*E.y+I[2],y:I[3]*
E.x+I[4]*E.y+I[5]}}function h(E,I){return E.get(I)?.values?.[0]}function n(E,I,K,S=0,O=U.tiffTags,W=4){var Y=8===W;const V=Y?u(new DataView(E,K,8),0,I):(new DataView(E,K,2)).getUint16(0,I),B=4+2*W;var Q=Y?8:2;Y=Q+V*B;if(K+Y>E.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:Y};const T=K+Y+4<=E.byteLength?G(new DataView(E,K+Y,8===W?8:4),0,I,8===W):null;K+=Q;Q=new Map;let X,aa,Z,ba=0,ea=0;for(let la=0;la<V;la++){var fa=new DataView(E,K+B*la,B);X=fa.getUint16(0,I);Z=fa.getUint16(2,
I);aa=U.getTagName(X,O);const ja=[];2===W?(ba=fa.getUint16(4,I),ea=fa.getUint16(6,I)):4===W?(ba=fa.getUint32(4,I),ea=fa.getUint32(8,I)):8===W&&(ba=G(fa,4,I,!0),ea=G(fa,12,I,!0),ja.push(fa.getUint32(12,I)),ja.push(fa.getUint32(16,I)));fa={id:X,type:Z,valueCount:ba,valueOffset:ea,valueOffsets:ja,values:null};f(E,I,fa,S,!1,W);Q.set(aa,fa)}return{success:!0,ifd:Q,nextIFD:T,requiredBufferSize:Y}}function l(E,I){if(1!==I&&2!==I&&4!==I)return E;const K=new Uint8Array(E),S=8/I;E=new Uint8Array(E.byteLength*
S);let O=0;const W=2**I-1;for(let Y=0;Y<K.length;Y++){const V=K[Y];for(let B=0;B<S;B++)E[O++]=V<<I*B>>>8-I&W}return E.buffer}function A(E,I,K){const S=new J.JpegImage;S.parse(E);S.colorTransform=6===K?-1:0;E=S.getData(S.width,S.height,1!==I&&4!==I);return new Uint8Array(E.buffer)}function t(E){E=(new z.Zlib(E)).getBytes();var I=new ArrayBuffer(E.length);I=new Uint8Array(I);I.set(E);return I}async function r(E,I,K,S,O){var W=D.isPlatformLittleEndian===I,Y=h(K,"BITSPERSAMPLE"),V=h(K,"SAMPLESPERPIXEL")??
1,B=h(K,"PHOTOMETRICINTERPRETATION"),Q=h(K,"SAMPLEFORMAT")??1,T=p(Q,Y),X=h(K,"COMPRESSION")??1,aa=b(T);if(34887===X)return await F.load(),F.decode(E,{inputOffset:S}).pixels[0];if(1===X)B=E.slice(S,S+O),I=new Uint8Array(B);else if(8===X||32946===X)I=new Uint8Array(E,S,O),I=t(I),B=I.buffer;else if(6===X)I=new Uint8Array(E,S,O),I=A(I,V,B),B=I.buffer;else if(7===X){const Z=K.get("JPEGTABLES").values,ba=Z.length-2;I=new Uint8Array(ba+O-2);for(let ea=0;ea<ba;ea++)I[ea]=Z[ea];E=new Uint8Array(E,S+2,O-2);
for(S=0;S<E.length;S++)I[ba+S]=E[S];I=A(I,V,B);B=I.buffer}else if(5===X)I=R.decode(E,S,O,I),B=I.buffer;else throw Error("tiff-decode: unsupport compression "+X);B=l(B,Y);if("u8"!==T&&"s8"!==T&&!W)switch(B=new ArrayBuffer(I.length),W=new Uint8Array(B),T){case "u16":case "s16":for(T=0;T<I.length;T+=2)W[T]=I[T+1],W[T+1]=I[T];break;case "u32":case "s32":case "f32":for(T=0;T<I.length;T+=4)W[T]=I[T+3],W[T+1]=I[T+2],W[T+2]=I[T+1],W[T+3]=I[T]}Y=new aa(B);W=h(K,"PREDICTOR")??1;T=h(K,"TILEWIDTH");I=h(K,"TILELENGTH");
if(1<W&&(5===X||8===X||32946===X)&&T&&I){X=e(K);aa=new aa(Y.length);aa.set(Y);K=3===Q&&3===W;X=X?1:V;V=K?4:1;Q=T*V*X;K&&(aa=new Uint8Array(aa.buffer));for(W=0;W<I;W++)for(Y=W*Q,B=X;B<Q;B++)aa[Y+B]+=aa[Y+B-X];if(K){K=new Uint8Array(aa.length);X*=T;for(T=0;T<I;T++)for(W=T*Q,Y=0;Y<X;Y++)for(B=0;B<V;B++)K[W+Y*V+B]=aa[W+Y+(V-B-1)*X];Y=new Float32Array(K.buffer)}else Y=aa}return Y}async function a(E,I,K){const S=K.get("TILEOFFSETS")?.values;if(void 0===S)return null;const O=K.get("TILEBYTECOUNTS")?.values,
{width:W,height:Y,pixelType:V,tileWidth:B,tileHeight:Q}=d([K]);var T=e(K,I);const X=h(K,"SAMPLESPERPIXEL")||I.planes;var aa=W*Y,Z=h(K,"BITSPERSAMPLE"),ba=34887===(h(K,"COMPRESSION")??1),ea=b(V);const fa=[];for(var la=0;la<X;la++)fa.push(new ea(aa));let ja,pa,ma,oa,qa,ta,sa,ra,xa;ea=Math.ceil(W/B);aa=(new Uint8Array(aa)).fill(255);la=!1;if(0===Z%8)if(ba&&T&&1<X)for(T=Math.round(S.length/X),Z=0;Z<T;Z++){var va=Math.floor(Z/ea)*Q;ma=Z%ea*B;oa=va*W+ma;for(ba=0;ba<X;ba++){var ya=Z*X+ba;0===O[ya]?(ya=null,
la=!0):ya=await r(E,I.littleEndian,K,S[ya],O[ya]);ta=0;qa=oa;ra=Math.min(B,W-ma);sa=Math.min(Q,Y-va);xa=fa[ba];for(ja=0;ja<sa;ja++)for(qa=oa+ja*W,ta=ja*B,pa=0;pa<ra;pa++,qa++,ta++)ya?xa[qa]=ya[ta]:aa[qa]=0}}else for(Z=0;Z<S.length;Z++)for(va=Math.floor(Z/ea)*Q,ma=Z%ea*B,oa=va*W+ma,0===O[Z]?(ya=null,la=!0):ya=await r(E,I.littleEndian,K,S[Z],O[Z]),ta=0,qa=oa,ra=Math.min(B,W-ma),sa=Math.min(Q,Y-va),va=0;va<X;va++)if(xa=fa[va],T||ba)for(ja=0;ja<sa;ja++)for(qa=oa+ja*W,ta=B*Q*va+ja*B,pa=0;pa<ra;pa++,qa++,
ta++)ya?xa[qa]=ya[ta]:aa[qa]=0;else for(ja=0;ja<sa;ja++)for(qa=oa+ja*W,ta=ja*B*X+va,pa=0;pa<ra;pa++,qa++,ta+=X)ya?xa[qa]=ya[ta]:aa[qa]=0;return{width:W,height:Y,pixelType:V,pixels:fa,mask:la?aa:void 0}}function f(E,I,K,S=0,O=!1,W=4){if(K.values)return!0;var Y=K.type,V=K.valueCount,B=K.valueOffset;let Q=[];var T=x[Y],X=8*T,aa=V*T,Z=V*x[Y]*8,ba=8===W?64:32;W=K.valueOffsets;if(Z>ba&&aa>(O?E.byteLength:E?E.byteLength-B+S:0))return K.offlineOffsetSize=[B,aa],K.values=null,!1;if(Z<=ba)if(I||(32>=ba?B>>>=
32-Z:(E=W?.length?W[0]:B>>>0,I=W?.length?W[1]:Math.round((B-E)/4294967296),32>=Z?(B=E>>>32-Z,W[0]=B):(B=E*2**(32-Z)+(I>>>32-Z),W[0]=E,W[1]=I>>>32-Z))),1===V&&X===ba)Q=[B];else if(64===ba)for(E=W?.length?W[0]:B>>>0,B=W?.length?W[1]:Math.round((B-E)/4294967296),I=E,T=32,E=1;E<=V;E++)aa=32-X*E%32,T<X?(aa=I<<aa>>>32-T,Z=B<<32-T>>>32-T,I=B,Q.push(aa+Z*2**(X-T)),T-=32-(X-T)):(Q.push(I<<aa>>>32-X),T-=X),0===T&&(T=32,I=B);else for(E=1;E<=V;E++)Q.push(B<<32-X*E>>>32-X);else for(B-=S,O&&(B=0),V=B;V<B+aa;V+=
T){switch(Y){case 1:X=(new DataView(E,V,1)).getUint8(0);break;case 2:X=(new DataView(E,V,1)).getUint8(0);break;case 3:X=(new DataView(E,V,2)).getUint16(0,I);break;case 4:case 13:X=(new DataView(E,V,4)).getUint32(0,I);break;case 5:X=(new DataView(E,V,4)).getUint32(0,I)/(new DataView(E,V+4,4)).getUint32(0,I);break;case 6:X=(new DataView(E,V,1)).getInt8(0);break;case 7:X=(new DataView(E,V,1)).getUint8(0);break;case 8:X=(new DataView(E,V,2)).getInt16(0,I);break;case 9:X=(new DataView(E,V,4)).getInt32(0,
I);break;case 10:X=(new DataView(E,V,4)).getInt32(0,I)/(new DataView(E,V+4,4)).getInt32(0,I);break;case 11:X=(new DataView(E,V,4)).getFloat32(0,I);break;case 12:X=(new DataView(E,V,8)).getFloat64(0,I);break;case 16:case 18:X=u(new DataView(E,V,8),0,I);break;case 17:W=new DataView(E,V,8);Z=(X=I)?W.getInt32(0,X):W.getUint32(0,X);W=X?W.getUint32(4,X):W.getInt32(4,X);ba=0<=(X?Z:W)?1:-1;X?Z*=ba:W*=ba;X=ba*(X?4294967296*W+Z:4294967296*Z+W);break;default:X=null}Q.push(X)}if(2===Y){Y="";B=Q;Q=[];for(E=0;E<
B.length;E++)0===B[E]&&""!==Y?(Q.push(Y),Y=""):Y+=String.fromCharCode(B[E]);""===Y&&0!==Q.length||Q.push(Y)}K.values=Q;return!0}function d(E){var I=E[0];const K=h(I,"TILEWIDTH"),S=h(I,"TILELENGTH"),O=h(I,"IMAGEWIDTH"),W=h(I,"IMAGELENGTH");var Y=h(I,"BITSPERSAMPLE");const V=h(I,"SAMPLESPERPIXEL");var B=h(I,"SAMPLEFORMAT")??1;const Q=p(B,Y),T=e(I);var X=I.get("GDAL_NODATA")?.values;let aa=null;X?.length&&(aa=X.map(xa=>parseFloat(xa)),aa.some(xa=>isNaN(xa))&&(aa=null));var Z=h(I,"COMPRESSION")??1;switch(Z){case 1:X=
"NONE";break;case 2:case 3:case 4:case 32771:X="CCITT";break;case 5:X="LZW";break;case 6:case 7:X="JPEG";break;case 32773:X="PACKBITS";break;case 8:case 32946:X="DEFLATE";break;case 34712:X="JPEG2000";break;case 34887:X="LERC";break;default:X=String(Z)}let ba=!0,ea="";M.has(Z)||(ba=!1,ea+="unsupported tag compression "+Z);3<B&&(ba=!1,ea+="unsupported tag sampleFormat "+B);1!==Y&&2!==Y&&4!==Y&&0!==Y%8&&(ba=!1,ea+="unsupported tag bitsPerSample "+Y);Y=I.get("GEOASCIIPARAMS")?.values?.[0];if(Y){Y=(Y=
Y.split("|").find(xa=>xa.includes("ESRI PE String \x3d ")))?Y.replace("ESRI PE String \x3d ",""):"";var fa=Y.startsWith("COMPD_CS")||Y.startsWith("PROJCS")||Y.startsWith("GEOGCS")?{wkid:null,wkt:Y}:null}B=I.get("GEOTIEPOINTS")?.values;Y=I.get("GEOPIXELSCALE")?.values;Z=I.get("GEOTRANSMATRIX")?.values;var la=I.has("GEOKEYDIRECTORY")?I.get("GEOKEYDIRECTORY").data:null,ja=!1;I=!1;if(la){ja=2===h(la,"GTRasterTypeGeoKey");var pa=h(la,"GTModelTypeGeoKey");2===pa?(la=h(la,"GeographicTypeGeoKey"),1024<=la&&
32766>=la&&(fa={wkid:la}),fa||32767!==la||(I=!0,fa={wkid:4326})):1===pa&&(la=h(la,"ProjectedCSTypeGeoKey"),1024<=la&&32766>=la&&(fa={wkid:la}))}let ma;Y&&B&&6<=B.length?(ma=[Y[0],0,B[3]-B[0]*Y[0],0,-Math.abs(Y[1]),B[4]-B[1]*Y[1]],ja&&(ma[2]-=.5*ma[0]+.5*ma[1],ma[5]-=.5*ma[3]+.5*ma[4])):Z&&16===Z.length&&(ma=ja?[Z[0],Z[1],Z[3]-.5*Z[0],Z[4],Z[5],Z[7]-.5*Z[5]]:[Z[0],Z[1],Z[3],Z[4],Z[5],Z[7]]);if(ma){B=[{x:0,y:W},{x:0,y:0},{x:O,y:W},{x:O,y:0}];la=ja=Number.POSITIVE_INFINITY;let xa=pa=Number.NEGATIVE_INFINITY;
for(let va=0;va<B.length;va++)Z=g(B[va],ma),ja=Z.x>ja?ja:Z.x,pa=Z.x<pa?pa:Z.x,la=Z.y>la?la:Z.y,xa=Z.y<xa?xa:Z.y;B={xmin:ja,xmax:pa,ymin:la,ymax:xa,spatialReference:fa}}else B={xmin:-.5,ymin:.5-W,xmax:O-.5,ymax:.5,spatialReference:fa};I&&(400<B.xmax-B.xmin||361<Math.max(Math.abs(B.xmin),Math.abs(B.xmax)))&&(fa=null,B.spatialReference=null);fa=c(E);let oa;let qa,ta;if(0<fa.length){qa=Math.round(Math.log(O/h(fa[0],"IMAGEWIDTH"))/Math.LN2);var sa=fa[fa.length-1];ta=fa.length;oa=h(sa,"TILEWIDTH");sa=h(sa,
"TILELENGTH")}oa=null!=ta&&0<ta?oa||K:null;sa=null!=ta&&0<ta?sa||S:null;let ra;K&&(ra=[{maxCol:Math.ceil(O/K)-1,maxRow:Math.ceil(W/S)-1,minRow:0,minCol:0}],fa.forEach(xa=>{ra.push({maxCol:Math.ceil(h(xa,"IMAGEWIDTH")/h(xa,"TILEWIDTH"))-1,maxRow:Math.ceil(h(xa,"IMAGELENGTH")/h(xa,"TILELENGTH"))-1,minRow:0,minCol:0})}));Z=E[0].get("GDAL_METADATA")?.values?.[0];Z=N(Z);ea+=" "+H({width:O,height:W,tileWidth:K,tileHeight:S,planes:V,ifds:E});E=k(E).length===fa.length+1;fa=fa?.length?fa.map(xa=>{const va=
O/h(xa,"IMAGEWIDTH");xa=W/h(xa,"IMAGELENGTH");return{x:va,y:xa}}):void 0;return{width:O,height:W,tileWidth:K,tileHeight:S,planes:V,isBSQ:T,pixelType:Q,compression:X,noData:aa,hasMaskBand:E,isSupported:ba,pyramidResolutions:fa,message:ea,extent:B,isPseudoGeographic:I,affine:Y?null:ma,firstPyramidLevel:qa,maximumPyramidLevel:ta,pyramidBlockWidth:oa,pyramidBlockHeight:sa,tileBoundary:ra,metadata:Z}}function e(E,I){return(E=E.get("PLANARCONFIGURATION")?.values)?2===E[0]:I?I.isBSQ:!1}function c(E){return E.filter(I=>
1===h(I,"NEWSUBFILETYPE"))}function k(E){return E.filter(I=>{const K=4===((h(I,"NEWSUBFILETYPE")??0)&4);I=4===h(I,"PHOTOMETRICINTERPRETATION");return K&&I})}function q(E){const {littleEndian:I,isBigTiff:K,firstIFDPos:S}=y(E);var O=S;const W=[];do if(O=C(E,I,O,0,U.tiffTags,K?8:4),O.success)W.push(O.ifd),O=O.nextIFD;else break;while(0<O);E=d(W);O=c(W);const Y=k(W);return{...E,littleEndian:I,isBigTiff:K,ifds:W,pyramidIFDs:O,maskIFDs:Y}}function u(E,I,K){const S=E.getUint32(I,K);E=E.getUint32(I+4,K);
return K?4294967296*E+S:4294967296*S+E}function G(E,I,K,S){return S?u(E,I,K):E.getUint32(I,K)}function y(E){var I=new DataView(E,0,16),K=I.getUint16(0,!1);E=null;if(18761===K)E=!0;else if(19789===K)E=!1;else throw Error("unexpected endianess byte");var S=I.getUint16(2,E);if(42!==S&&43!==S)throw Error("unexpected tiff identifier");K=4;if(S=43===S){const O=I.getUint16(K,E);K+=2;if(8!==O)throw Error("unsupported bigtiff version");if(0!==I.getUint16(K,E))throw Error("unsupported bigtiff version");K+=
2}I=G(I,K,E,S);return{littleEndian:E,isBigTiff:S,firstIFDPos:I}}function C(E,I,K,S=0,O=U.tiffTags,W=4){K=n(E,I,K,S,O,W);let Y;const V=K.ifd;V&&(U.ifdTags.forEach((B,Q)=>{V.has(Q)&&(Y=V.get(Q),Y.data=n(E,I,Y.valueOffset-S,S,B).ifd)}),V.has("GEOKEYDIRECTORY")&&(Y=V.get("GEOKEYDIRECTORY"),(O=Y.values)&&4<O.length&&(O=O[0]+"."+O[1]+"."+O[2],Y.data=n(E,I,Y.valueOffset+6-S,S,U.geoKeys,2).ifd,Y.data&&Y.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[O]}))),V.has("XMP")&&(Y=V.get("XMP"),
O=Y.values,"number"===typeof O[0]&&7===Y.type&&(Y.values=[v.bytesToUTF8(new Uint8Array(O))])));return K}function H(E){const {width:I,height:K,tileHeight:S,tileWidth:O}=E,W=E.planes,Y=O?O*S:I*K;E=h(E.ifds[0],"BITSPERSAMPLE");let V="";Y*W>2**30/(8<E?E/8:1)&&(V=O?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported");return V}const x=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],M=new Set([1,5,6,7,8,34712,34887]),L=(E,I,K)=>{if(!(E&&0<E.length&&
I&&K))return null;let S,O,W;const Y=E[0].length,V=E.length,B=new Uint8Array(Y);for(let T=0;T<V;T++)if(S=E[T],O=I[T],W=K[T],0===T)for(var Q=0;Q<Y;Q++)B[Q]=S[Q]<O||S[Q]>W?0:1;else for(Q=0;Q<Y;Q++)B[Q]&&(B[Q]=S[Q]<O||S[Q]>W?0:1);return B},N=E=>{if(!E)return null;var I=E.match(/<Item(.*?)Item>/gi);if(!I||0===I.length)return null;E=new Map;var K;for(var S=0;S<I.length;S++){var O=I[S];var W=O.slice(6,O.indexOf("\x3e"));var Y=O.indexOf("sample\x3d");-1<Y&&(K=O.slice(Y+8,O.indexOf('"',Y+8)));Y=O.indexOf("name\x3d");
-1<Y&&(W=O.slice(Y+6,O.indexOf('"',Y+6)));W&&(O=O.slice(O.indexOf("\x3e")+1,O.indexOf("\x3c/Item\x3e")).trim(),null!=K?E.has(W)?E.get(W)[K]=O:E.set(W,[O]):E.set(W,O));K=null}I=E.get("STATISTICS_MINIMUM");W=E.get("STATISTICS_MAXIMUM");S=E.get("STATISTICS_MEAN");O=E.get("STATISTICS_STDDEV");K=null;if(I&&W)for(K=[],Y=0;Y<I.length;Y++)K.push({min:parseFloat(I[Y]),max:parseFloat(W[Y]),avg:S&&parseFloat(S[Y]),stddev:O&&parseFloat(O[Y])});W=E.get("BandName");S=E.get("WavelengthMin");O=E.get("WavelengthMax");
I=null;if(W)for(I=[],Y=0;Y<W.length;Y++)I.push({BandName:W[Y],WavelengthMin:S&&parseFloat(S[Y]),WavelengthMax:O&&parseFloat(O[Y])});W=E.get("DataType");return{statistics:K,bandProperties:I,dataType:W,rawMetadata:E}};m.decode=async function(E,I={}){var K=I.pyramidLevel||0,S=I.headerInfo||q(E);const {ifds:O,noData:W}=S;if(0===O.length)throw Error("no valid image file directory");var Y=H(S);if(Y)throw Y;Y=null;var V=-1===K?O[O.length-1]:O[K];I=W??I.noDataValue;if(S.tileWidth)Y=await a(E,S,V);else{{const ta=
D.isPlatformLittleEndian===S.littleEndian,sa=V.get("STRIPOFFSETS")?.values;if(void 0===sa)Y=null;else{var {width:B,height:Q,pixelType:T}=d([V]);K=h(V,"SAMPLESPERPIXEL")||S.planes;var X=h(V,"PHOTOMETRICINTERPRETATION");Y=B*Q;var aa=h(V,"BITSPERSAMPLE"),Z=b(T),ba=new Z(Y*K),ea=V.get("STRIPBYTECOUNTS")?.values,fa=h(V,"ROWSPERSTRIP"),la=h(V,"COMPRESSION")??1,ja;if(0===aa%8)for(V=0;V<sa.length;V++){var pa=V*fa*B*K;if("u8"===T||"s8"===T||ta)if(8===la||32946===la){var ma=new Uint8Array(E,sa[V],ea[V]);ma=
t(ma);var oa=ma.buffer}else 6===la?(ma=new Uint8Array(E,sa[V],ea[V]),ma=A(ma,K,X),oa=ma.buffer):5===la?(ma=R.decode(E,sa[V],ea[V],S.littleEndian),oa=ma.buffer):oa=E.slice(sa[V],sa[V]+ea[V]);else{if(6===la||8===la||32946===la){ma=new Uint8Array(E,sa[V],ea[V]);var qa=t(ma);oa=qa.buffer}else oa=new ArrayBuffer(ea[V]),ma=new Uint8Array(E,sa[V],ea[V]),qa=new Uint8Array(oa);switch(T){case "u16":case "s16":for(ja=0;ja<ma.length;ja+=2)qa[ja]=ma[ja+1],qa[ja+1]=ma[ja];break;case "u32":case "s32":case "f32":for(ja=
0;ja<ma.length;ja+=4)qa[ja]=ma[ja+3],qa[ja+1]=ma[ja+2],qa[ja+2]=ma[ja+1],qa[ja+3]=ma[ja]}}oa=l(oa,aa);ja=new Z(oa);ba.set(ja,pa)}X=[];if(1===K)X.push(ba);else for(V=0;V<K;V++){S=new Z(Y);for(E=0;E<Y;E++)S[E]=ba[E*K+V];X.push(S)}Y={width:B,height:Q,pixelType:T,pixels:X}}}}if(!Y)return Y;null!=I&&P.convertNoDataToMask(Y,I);return Y};m.decodeTileOrStrip=async function(E,I){const {headerInfo:K,ifd:S,offsets:O,sizes:W}=I;var Y=[];for(var V=0;V<O.length;V++){0===W[V]?1:0;var B=await r(E,K.littleEndian,
S,O[V],W[V]||E.byteLength);Y.push(B)}var Q=e(S,K);E=h(S,"BITSPERSAMPLE");V=h(S,"SAMPLEFORMAT")??1;V=p(V,E);var T=h(S,"SAMPLESPERPIXEL")||K.planes;const X=b(V);B=h(S,"TILEWIDTH");const aa=h(S,"TILELENGTH");var Z=h(S,"COMPRESSION")??1;const ba=B*aa;E=[];let ea=Y[0];const fa=34887===Z;for(let la=0;la<T;la++){Z=new X(ba);if(Y.length===T)ea=Y[la],ea.length===ba&&(Z=ea);else if(ea.length)if(Q||fa)Z=ea.length===ba?ea:ea.slice(ba*la,ba*(la+1));else for(let ja=0;ja<ba;ja++)Z[ja]=ea[ja*T+la];E.push(Z)}Y=K.noData?
K.noData[0]:I.noDataValue;Q=(T=K.metadata?K.metadata.statistics:null)?T.map(la=>la.min):null;T=T?T.map(la=>la.max):null;V={pixelType:V,width:B,height:aa,pixels:E,noDataValue:Y};null!=Y?P.convertNoDataToMask(V,Y):Q&&T&&I.applyMinMaxConstraint&&(V.mask=L(E,Q,T));return V};m.getImageInfo=d;m.getMaskIFDs=k;m.getPyramidIFDs=c;m.isBSQConfig=e;m.parseFieldValues=f;m.parseHeader=q;m.parseIFD=C;m.parseSignature=y;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterDatasets/byteStreamUtils":function(){define(["exports"],
function(m){m.bytesToUTF8=function(w,v){let J=0,F="",R=0,P=0;const U=w.length;for(;J<U;)if(P=w[J++],R=P>>4,8>R?R=1:15===R?(R=4,P=(P&7)<<18|(w[J++]&63)<<12|(w[J++]&63)<<6|w[J++]&63):14===R?(R=3,P=(P&15)<<12|(w[J++]&63)<<6|w[J++]&63):(R=2,P=(P&31)<<6|w[J++]&63),0!==P||v)F+=String.fromCharCode(P);return F};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFormats/TiffTags":function(){define(function(){const m=(()=>{const F=[];F[254]="NEWSUBFILETYPE";F[255]="SUBFILETYPE";
F[256]="IMAGEWIDTH";F[257]="IMAGELENGTH";F[258]="BITSPERSAMPLE";F[259]="COMPRESSION";F[262]="PHOTOMETRICINTERPRETATION";F[263]="THRESHHOLDING";F[264]="CELLWIDTH";F[265]="CELLLENGTH";F[266]="FILLORDER";F[269]="DOCUMENTNAME";F[270]="IMAGEDESCRIPTION";F[271]="MAKE";F[272]="MODEL";F[273]="STRIPOFFSETS";F[274]="ORIENTATION";F[277]="SAMPLESPERPIXEL";F[278]="ROWSPERSTRIP";F[279]="STRIPBYTECOUNTS";F[280]="MINSAMPLEVALUE";F[281]="MAXSAMPLEVALUE";F[282]="XRESOLUTION";F[283]="YRESOLUTION";F[284]="PLANARCONFIGURATION";
F[285]="PAGENAME";F[286]="XPOSITION";F[287]="YPOSITION";F[288]="FREEOFFSETS";F[289]="FREEBYTECOUNTS";F[290]="GRAYRESPONSEUNIT";F[291]="GRAYRESPONSECURVE";F[292]="T4OPTIONS";F[293]="T6OPTIONS";F[296]="RESOLUTIONUNIT";F[297]="PAGENUMBER";F[300]="COLORRESPONSEUNIT";F[301]="TRANSFERFUNCTION";F[305]="SOFTWARE";F[306]="DATETIME";F[315]="ARTIST";F[316]="HOSTCOMPUTER";F[317]="PREDICTOR";F[318]="WHITEPOINT";F[319]="PRIMARYCHROMATICITIES";F[320]="COLORMAP";F[321]="HALFTONEHINTS";F[322]="TILEWIDTH";F[323]="TILELENGTH";
F[324]="TILEOFFSETS";F[325]="TILEBYTECOUNTS";F[326]="BADFAXLINES";F[327]="CLEANFAXDATA";F[328]="CONSECUTIVEBADFAXLINES";F[330]="SUBIFD";F[332]="INKSET";F[333]="INKNAMES";F[334]="NUMBEROFINKS";F[336]="DOTRANGE";F[337]="TARGETPRINTER";F[338]="EXTRASAMPLES";F[339]="SAMPLEFORMAT";F[340]="SMINSAMPLEVALUE";F[341]="SMAXSAMPLEVALUE";F[342]="TRANSFERRANGE";F[347]="JPEGTABLES";F[512]="JPEGPROC";F[513]="JPEGIFOFFSET";F[514]="JPEGIFBYTECOUNT";F[515]="JPEGRESTARTINTERVAL";F[517]="JPEGLOSSLESSPREDICTORS";F[518]=
"JPEGPOINTTRANSFORM";F[519]="JPEGQTABLES";F[520]="JPEGDCTABLES";F[521]="JPEGACTABLES";F[529]="YCBCRCOEFFICIENTS";F[530]="YCBCRSUBSAMPLING";F[531]="YCBCRPOSITIONING";F[532]="REFERENCEBLACKWHITE";F[700]="XMP";F[33550]="GEOPIXELSCALE";F[33922]="GEOTIEPOINTS";F[33432]="COPYRIGHT";F[42112]="GDAL_METADATA";F[42113]="GDAL_NODATA";F[50844]="RPCCOEFFICIENT";F[34264]="GEOTRANSMATRIX";F[34735]="GEOKEYDIRECTORY";F[34736]="GEODOUBLEPARAMS";F[34737]="GEOASCIIPARAMS";F[34665]="EXIFIFD";F[34853]="GPSIFD";F[40965]=
"INTEROPERABILITYIFD";return F})(),w=(()=>{const F=m.slice();F[36864]="ExifVersion";F[40960]="FlashpixVersion";F[40961]="ColorSpace";F[42240]="Gamma";F[37121]="ComponentsConfiguration";F[37122]="CompressedBitsPerPixel";F[40962]="PixelXDimension";F[40963]="PixelYDimension";F[37500]="MakerNote";F[37510]="UserComment";F[40964]="RelatedSoundFile";F[36867]="DateTimeOriginal";F[36868]="DateTimeDigitized";F[36880]="OffsetTime";F[36881]="OffsetTimeOriginal";F[36882]="OffsetTimeDigitized";F[37520]="SubSecTime";
F[37521]="SubSecTimeOriginal";F[37522]="SubSecTimeDigitized";F[37888]="Temperature";F[37889]="Humidity";F[37890]="Pressure";F[37891]="WaterDepth";F[37892]="Acceleration";F[37893]="CameraElevationAngle";F[42016]="ImageUniqueID";F[42032]="CameraOwnerName";F[42033]="BodySerialNumber";F[42034]="LensSpecification";F[42035]="LensMake";F[42036]="LensModel";F[42037]="LensSerialNumber";F[33434]="ExposureTime";F[33437]="FNumber";F[34850]="ExposureProgram";F[34852]="SpectralSensitivity";F[34855]="PhotographicSensitivity";
F[34856]="OECF";F[34864]="SensitivityType";F[34865]="StandardOutputSensitivity";F[34866]="RecommendedExposureIndex";F[34867]="ISOSpeed";F[34868]="ISOSpeedLatitudeyyy";F[34869]="ISOSpeedLatitudezzz";F[37377]="ShutterSpeedValue";F[37378]="ApertureValue";F[37379]="BrightnessValue";F[37380]="ExposureBiasValue";F[37381]="MaxApertureValue";F[37382]="SubjectDistance";F[37383]="MeteringMode";F[37384]="LightSource";F[37385]="Flash";F[37386]="FocalLength";F[37396]="SubjectArea";F[41483]="FlashEnergy";F[41484]=
"SpatialFrequencyResponse";F[41486]="FocalPlaneXResolution";F[41487]="FocalPlaneYResolution";F[41488]="FocalPlaneResolutionUnit";F[41492]="SubjectLocation";F[41493]="ExposureIndex";F[41495]="SensingMethod";F[41728]="FileSource";F[41729]="SceneType";F[41730]="CFAPattern";F[41985]="CustomRendered";F[41986]="ExposureMode";F[41987]="WhiteBalance";F[41988]="DigitalZoomRatio";F[41989]="FocalLengthIn35mmFilm";F[41990]="SceneCaptureType";F[41991]="GainControl";F[41992]="Contrast";F[41993]="Saturation";F[41994]=
"Sharpness";F[41995]="DeviceSettingDescription";F[41996]="SubjectDistanceRange";return F})(),v=(()=>{const F=[];F[1024]="GTModelTypeGeoKey";F[1025]="GTRasterTypeGeoKey";F[1026]="GTCitationGeoKey";F[2048]="GeographicTypeGeoKey";F[2049]="GeogCitationGeoKey";F[2050]="GeogGeodeticDatumGeoKey";F[2051]="GeogPrimeMeridianGeoKey";F[2052]="GeogLinearUnitsGeoKey";F[2053]="GeogLinearUnitSizeGeoKey";F[2054]="GeogAngularUnitsGeoKey";F[2055]="GeogAngularUnitSizeGeoKey";F[2056]="GeogEllipsoidGeoKey";F[2057]="GeogSemiMajorAxisGeoKey";
F[2058]="GeogSemiMinorAxisGeoKey";F[2059]="GeogInvFlatteningGeoKey";F[2061]="GeogPrimeMeridianLongGeoKey";F[2060]="GeogAzimuthUnitsGeoKey";F[3072]="ProjectedCSTypeGeoKey";F[3073]="PCSCitationGeoKey";F[3074]="ProjectionGeoKey";F[3075]="ProjCoordTransGeoKey";F[3076]="ProjLinearUnitsGeoKey";F[3077]="ProjLinearUnitSizeGeoKey";F[3078]="ProjStdParallel1GeoKey";F[3079]="ProjStdParallel2GeoKey";F[3080]="ProjNatOriginLongGeoKey";F[3081]="ProjNatOriginLatGeoKey";F[3082]="ProjFalseEastingGeoKey";F[3083]="ProjFalseNorthingGeoKey";
F[3084]="ProjFalseOriginLongGeoKey";F[3085]="ProjFalseOriginLatGeoKey";F[3086]="ProjFalseOriginEastingGeoKey";F[3087]="ProjFalseOriginNorthingGeoKey";F[3088]="ProjCenterLongGeoKey";F[3090]="ProjCenterEastingGeoKey";F[3091]="ProjCenterNorthingGeoKey";F[3092]="ProjScaleAtNatOriginGeoKey";F[3093]="ProjScaleAtCenterGeoKey";F[3094]="ProjAzimuthAngleGeoKey";F[3095]="ProjStraightVertPoleLongGeoKey";F[4096]="VerticalCSTypeGeoKey";F[4097]="VerticalCitationGeoKey";F[4098]="VerticalDatumGeoKey";F[4099]="VerticalUnitsGeoKey";
return F})(),J=new Map;J.set("EXIFIFD",w);J.set("GPSIFD","GPSVersionID GPSLatitudeRef GPSLatitude GPSLongitudeRef GPSLongitude GPSAltitudeRef GPSAltitude GPSTimeStamp GPSSatellites GPSStatus GPSMeasureMode GPSDOP GPSSpeedRef GPSSpeed GPSTrackRef GPSTrack GPSImgDirectionRef GPSImgDirection GPSMapDatum GPSDestLatitudeRef GPSDestLatitude GPSDestLongitudeRef GPSDestLongitude GPSDestBearingRef GPSDestBearing GPSDestDistanceRef GPSDestDistance GPSProcessingMethod GPSAreaInformation GPSDateStamp GPSDifferential GPSHPositioningError".split(" "));
return{tiffTags:m,ifdTags:J,geoKeys:v,getTagName:(F,R)=>{R=(R||m)[F];void 0===R&&(R="unknown"+String(F));return R}}})},"esri/layers/support/rasterFormats/utils":function(){define(["exports"],function(m){const w=new ArrayBuffer(4),v=new Uint8Array(w);(new Uint32Array(w))[0]=1;m.isPlatformLittleEndian=1===v[0];Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/QueueProcessor":function(){define("exports ../../core/has ../../core/maybe ../../core/promiseUtils ../../core/Queue ../../core/ReactiveMap ../../core/scheduling ../../core/signal".split(" "),
function(m,w,v,J,F,R,P,U){class D{constructor(p,b){this.item=p;this.controller=b;this.promise=null}}class z{constructor(p){this._task=this._schedule=null;this._deferreds=new R;this._controllers=new R;this._processingItems=new R;this._pausedSignal=U.signal(!1);this.concurrency=1;p.concurrency&&(this.concurrency=p.concurrency);this._queue=new F(p.peeker);this.process=p.process;const b=p.scheduler;p.priority&&b&&(this._task=b.registerTask(p.priority,this))}destroy(){this.clear();this._schedule=v.removeMaybe(this._schedule);
this._task=v.removeMaybe(this._task)}get updating(){return!!this._task?.updating||this.running}get length(){return this._processingItems.size+this._queue.length}abort(p){(p=this._controllers.get(p))&&p.abort()}clear(){this._queue.clear();const p=[];this._controllers.forEach(b=>p.push(b));this._controllers.clear();p.forEach(b=>b.abort());this._processingItems.clear();this._cancelNext()}forEach(p){this._deferreds.forEach((b,g)=>p(g))}get(p){return(p=this._deferreds.get(p))?p.promise:void 0}isOngoing(p){return this._processingItems.has(p)}has(p){return this._deferreds.has(p)}pause(){this._pausedSignal.value||
(this._pausedSignal.value=!0,this._cancelNext())}push(p,b){const g=this.get(p);if(g)return g;const h=new AbortController;let n=null;b&&(n=J.onAbort(b,()=>h.abort()));const l=()=>{A.remove();null!=n&&n.remove();this._removeItem(p);this._queue.remove(p);this._scheduleNext()},A=J.onAbortOrThrow(h.signal,()=>{const r=this._processingItems.get(p);r&&r.controller.abort();l();t.reject(J.createAbortError())}),t=J.createResolver();this._deferreds.set(p,t);this._controllers.set(p,h);t.promise.then(l,l);this._queue.push(p);
this._scheduleNext();return t.promise}last(){return this._queue.last()}lastPromise(){const p=this.last();return p?this.get(p):null}peek(){return this._queue.peek()}popLast(){const p=this._queue.popLast();p&&(this._deferreds.get(p)?.reject(J.createAbortError("Removed from queue")),this._removeItem(p));return p}reset(){const p=[];this._processingItems.forEach(b=>p.push(b));this._processingItems.clear();for(const b of p)this._queue.push(b.item),b.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&
(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const p=[];for(;this._queue.length;)p.push(this._queue.pop());this.clear();return p}get running(){return!this._pausedSignal.value&&0<this._queue.length&&this._processingItems.size<this.concurrency}runTask(p){for(;!p.done&&0<this._queue.length&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop()),p.madeProgress()}_removeItem(p){this._deferreds.delete(p);this._controllers.delete(p);this._processingItems.delete(p)}_scheduleNext(){this._task||
this._pausedSignal.value||this._schedule||(this._schedule=P.schedule(()=>{this._schedule=null;this._next()}))}_next(){for(;0<this._queue.length&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(p,b){this._canProcessFulfillment(p)&&(this._scheduleNext(),this._deferreds.get(p.item).resolve(b))}_processError(p,b){this._canProcessFulfillment(p)&&(this._scheduleNext(),this._deferreds.get(p.item).reject(b))}_canProcessFulfillment(p){return this._deferreds.get(p.item)&&
this._processingItems.get(p.item)===p?!0:!1}_process(p){if(null!=p){var b=new AbortController,g=new D(p,b);this._processingItems.set(p,g);try{var h=this.process(p,b.signal)}catch(n){this._processError(g,n)}J.isPromiseLike(h)?(g.promise=h,h.then(n=>this._processResult(g,n),n=>this._processError(g,n))):this._processResult(g,h)}}get test(){}}m.QueueProcessor=z;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/clipUtils":function(){define(["require",
"exports","../../../core/unitUtils","../../../geometry/Extent","../PixelBlock"],function(m,w,v,J,F){function R(D,z,p){if(!D)return D;const {width:b,height:g}=D,h=z.width/b,n=z.height/g,{xmin:l,ymax:A}=z;if("extent"===p.type){z=(p.xmin-l)/h;var t=(p.xmax-l)/h,r=(A-p.ymax)/n;p=(A-p.ymin)/n;p=[[[z,r],[z,p],[t,p],[t,r],[z,r]]]}else p=p.rings.map(f=>f.map(([d,e])=>[(d-l)/h,(A-e)/n]));z=document.createElement("canvas");z.width=b;z.height=g;const a=z.getContext("2d");a.fillStyle="#f00";a.beginPath();p.forEach(f=>
{a.moveTo(f[0][0],f[0][1]);for(let d=0;d<f.length;d++)a.lineTo(f[d][0],f[d][1]);a.closePath()});a.fill();p=a.getImageData(0,0,b,g).data;z=D.mask;t=b*g;r=new Uint8Array(t);for(let f=0;f<t;f++)if(!z||z[f])r[f]=127<p[4*f+3]?255:0;return new F({pixelType:D.pixelType,width:b,height:g,mask:r,maskIsAlpha:!1,pixels:[...D.pixels]})}function P(D,z,p){const {width:b,height:g}=D,h=new Uint8Array(b*g);var n=z.width/b,l=z.height/g;if(.5>p.width/n||.5>p.height/l)return new F({pixelType:D.pixelType,width:b,height:g,
mask:h,pixels:[...D.pixels]});const {xmin:A,xmax:t,ymin:r,ymax:a}=z,{xmin:f,xmax:d,ymin:e,ymax:c}=p;z=Math.max(A,f);var k=Math.min(t,d);p=Math.max(r,e);var q=Math.min(a,c),u=.5*n,G=.5*l;if(k-z<u||q-p<G||k<A+u||z>t-u||p>a-G||q<r+G)return new F({pixelType:D.pixelType,width:b,height:g,mask:h,pixels:[...D.pixels]});z=Math.max(0,(z-A)/n);k=Math.min(b,Math.max(0,(k-A)/n));q=Math.max(0,(a-q)/l);G=Math.min(g,Math.max(0,(a-p)/l));l=Math.round(z);n=Math.round(k)-1;u=Math.round(q);p=Math.round(G)-1;if(l===n&&
.5<z%1&&.5>k%1||u===p&&.5<q%1&&.5>G%1)return new F({pixelType:D.pixelType,width:b,height:g,mask:h,pixels:[...D.pixels]});if(0===l&&0===u&&n===b&&p===g)return D;z=D.mask;for(k=u;k<=p;k++)for(q=l;q<=n;q++)u=k*b+q,h[u]=z?z[u]:255;return new F({pixelType:D.pixelType,width:b,height:g,mask:h,pixels:[...D.pixels]})}function U(D,z,p){const {width:b,height:g}=D,h=new Uint8Array(b*g),n=z.width/b,l=z.height/g,{xmin:A,ymax:t}=z;({paths:z}=p);p=D.mask;for(let e=0;e<z.length;e++){const c=z[e];for(let k=0;k<c.length-
1;k++){const [q,u]=c[k],[G,y]=c[k+1];let C=Math.floor((t-u)/l),H=Math.floor((t-y)/l);if(H<C){var r=C;C=H;H=r}C=Math.max(0,C);H=Math.min(g-1,H);r=(G-q)/(y-u);for(let x=C;x<=H;x++){var a=x===C?Math.max(u,y):(g+1-x)*l,f=x===H?Math.min(u,y):a-l;a=y===u?Math.floor((q-A)/n):Math.floor((r*(a-u)+q-A)/n);f=y===u?Math.floor((G-A)/n):Math.floor((r*(f-u)+q-A)/n);if(f<a){var d=a;a=f;f=d}d=x*b;a=Math.max(0,a);f=Math.min(b-1,f);for(a=d+a;a<=d+f;a++)h[a]=p?p[a]:255}}}return new F({pixelType:D.pixelType,width:b,height:g,
mask:h,pixels:[...D.pixels]})}w.clip=async function(D,z,p){if("extent"===p.type)return P(D,z,p);const {width:b,height:g}=D,h=new Uint8Array(b*g),{contains:n,intersects:l}=await new Promise((A,t)=>m(["../../../geometry/geometryEngine"],A,t));return l(z,p)?"polyline"===p.type?U(D,z,p):n(p,z)?D:R(D,z,p):new F({pixelType:D.pixelType,width:b,height:g,mask:h,maskIsAlpha:!1,pixels:[...D.pixels]})};w.snapToRaster=function(D,z,p,b=!0){var {spatialReference:g}=D;if(!p.spatialReference.equals(g)){var h=v.getMetersPerUnitForSR(p.spatialReference),
n=v.getMetersPerUnitForSR(g);h!==n&&(h/=n,p={x:p.x*h,y:p.y*h})}const {x:l,y:A}=p;let {xmin:t,xmax:r,ymax:a,ymin:f}="extent"===z.type?z:z.extent;const {xmin:d,ymax:e}=D.extent;b?(t=d+(t>d?l*Math.round((t-d)/l):0),a=e-(a<e?A*Math.round((e-a)/A):0),r=d+(r>d?l*Math.round((r-d)/l):0),f=e-(f<e?A*Math.round((e-f)/A):0),g=new J({xmin:t,ymax:a,xmax:r,ymin:f,spatialReference:g}),D=Math.round(g.width/l),z=Math.round(g.height/A)):(D=Math.floor((r-t)/l+.8),z=Math.floor((a-f)/A+.8),t=d+(t>d?l*Math.floor((t-d)/
l+.1):0),a=e-(a<e?A*Math.floor((e-a)/A+.1):0),g=new J({xmin:t,ymax:a,xmax:t+D*l,ymin:a-z*A,spatialReference:g}));return{extent:g,width:D,height:z}};Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/rasterFunctionHelper":function(){define("exports ../../../core/colorUtils ../../../core/Error ../../../core/lang ./ArithmeticFunction ./AspectFunction ./BandArithmeticFunction ./ClipFunction ./ColormapFunction ./CompositeBandFunction ./ComputeChangeFunction ./ContrastBrightnessFunction ./ConvolutionFunction ./CurvatureFunction ./ExtractBandFunction ./GrayscaleFunction ./LocalFunction ./MaskFunction ./NDVIFunction ./RemapFunction ./SlopeFunction ./StatisticsFunction ./StatisticsHistogramFunction ./StretchFunction ./TableFunction".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h,n,l,A,t,r,a,f,d,e,c,k){function q(O,W){({rasterFunctionArguments:O}=O);O&&(O.rasters||[O.raster,O.raster2]).forEach(Y=>{Y&&"number"!==typeof Y&&("string"===typeof Y?Y.startsWith("http")&&(W.includes(Y)||W.push(Y)):"rasterFunctionArguments"in Y&&q(Y,W))})}function u(O,W){return"rasters"===W[0]&&Array.isArray(O.rasters)?O.rasters:W.map(Y=>O[Y])}function G(O){return!!(O&&"object"===typeof O&&O.rasterFunction&&O.rasterFunctionArguments)}function y(O){const {rasterFunction:W,
rasterFunctionArguments:Y}=O,V={};for(const Q in Y){let T=Y[Q];var B=Q.toLowerCase();if("rasters"===B&&Array.isArray(T))V.rasters=T.map(X=>G(X)?y(X):X);else switch(G(T)&&(T=y(T)),B){case "dra":V.dra=T;break;case "pspower":V.psPower=T;break;case "pszfactor":V.psZFactor=T;break;case "bandids":V.bandIds=T;break;default:B=Q[0].toLowerCase()+Q.slice(1),V[B]=T}}"Local"!==W||V.rasters?.length||(V.rasters=["$$"]);return{...O,rasterFunctionArguments:V}}function C(O,W){const {rasterFunction:Y,rasterFunctionArguments:V}=
O;var B=O.outputPixelType?.toLowerCase();if(null==Y||!S.has(Y))throw new v("raster-function-helper",`unsupported raster function: ${Y}`);var Q=S.get(Y);const T=("function"===typeof Q.ctor?Q.ctor:Q.ctor["default"]).fromJSON({...O,outputPixelType:B});({rasterArgumentNames:O}=T);B=[];Q=u(V,O);const X="rasters"===O[0]||1<O.length,aa=[];for(let Z=0;Z<Q.length;Z++){const ba=Q[Z];let ea;null==ba||"string"===typeof ba&&ba.startsWith("$")?B.push(W?.raster):"string"===typeof ba?W[ba]&&B.push(W[ba]):"number"!==
typeof ba&&"rasterFunction"in ba&&(ea=C(ba,W),X||(T.functionArguments[O[Z]]=ea),B.push(ea));X&&aa.push(ea??ba)}X&&("rasters"===O[0]?T.functionArguments.rasters=aa:O.forEach((Z,ba)=>{T.functionArguments[Z]=aa[ba]}));W&&(T.sourceRasters=B,W=W.raster?.url)&&(T.mainPrimaryRasterId=W);return T}function H(O,W){if(O&&W)for(const Y in O){const V=O[Y];V&&"object"===typeof V&&"type"in V&&("RasterFunctionTemplate"===V.type?H(V.arguments,W):"RasterFunctionVariable"===V.type&&null!=W[V.name]&&(V.value=W[V.name]))}}
function x(O,W){if(!O||"object"!==typeof O)return O;const {value:Y}=O;if(!Y||"object"!==typeof Y)return O.isDataset?"$$":Y;if(Array.isArray(Y))return 0===Y.length?[]:Y.map(B=>"object"===typeof B&&"RasterFunctionVariable"===B.type?x(B,W):B);if("value"in Y&&["number","string","boolean"].includes(typeof Y.value))return Y.value;if(O.isDataset&&"Scalar"!==Y.type)return"$$";if(!("type"in Y))return Y;O=Y;switch(Y.type){case "Scalar":O=Y.value;break;case "AlgorithmicColorRamp":O=M(Y);break;case "MultiPartColorRamp":O=
{type:"multipart",colorRamps:Y.ArrayOfColorRamp.map(M)};break;case "ArgumentArray":if(Y.elements?.length&&"RasterStatistics"!==Y.elements[0].type){O=[];for(let B=0;B<Y.elements.length;B++){const Q=Y.elements[B];var {type:V}=Q;if(V)if("RasterFunctionTemplate"===V)({renderingRule:V}=L(Q,W)),O.push(V),null!=Q._object_id&&W.set(Q._object_id,V);else if("RasterFunctionVariable"===V)V=x(Q,W),O.push(V),null!=Q._object_id&&W.set(Q._object_id,V);else throw new v("raster-function-helper","unsupported raster function json.");
else O.push(Q)}}else O=Y.elements}null!=Y._object_id&&W.set(Y._object_id,O);return O}function M(O){const W=O.algorithm??"esriHSVAlgorithm";let {FromColor:Y,ToColor:V}=O;if(!Array.isArray(Y)){const {r:B,g:Q,b:T}=w.toRGB({h:Y.Hue,s:Y.Saturation,v:Y.Value});Y=[B,Q,T,Y.AlphaValue]}if(!Array.isArray(V)){const {r:B,g:Q,b:T}=w.toRGB({h:V.Hue,s:V.Saturation,v:V.Value});V=[B,Q,T,V.AlphaValue]}return{type:"algorithmic",algorithm:W,fromColor:Y,toColor:V}}function L(O,W,Y){Y&&H(O,Y);W={renderingRule:{},templates:W};
N(O,W);return W}function N(O,W){if(O&&W.renderingRule){var {renderingRule:Y,templates:V}=W,{function:B,arguments:Q,_object_id:T}=O;if(B&&Q){null!=T&&V.set(T,Y);Y.rasterFunction=B.type.replace("Function","");Y.outputPixelType=B.pixelType;O={};Y.rasterFunctionArguments=O;for(const X in Q)"type"!==X&&"object_id"!==X&&"_object_ref_id"!==X&&((W=Q[X])&&"object"===typeof W&&"type"in W&&("RasterFunctionTemplate"===W.type||"RasterFunctionVariable"===W.type)?("RasterFunctionVariable"===W.type?O[X]=x(W,V):(Y.rasterFunctionArguments[X]=
{},N(W,{renderingRule:Y.rasterFunctionArguments[X],templates:V})),null!=W._object_id&&V.set(W._object_id,O[X])):O[X]=W);O.DEM&&!O.Raster&&(O.Raster=O.DEM,delete O.DEM);switch(Y.rasterFunction){case "Stretch":I(O);break;case "Colormap":"randomcolorramp"===O.ColorRamp?.type?.toLowerCase()&&(delete O.ColorRamp,O.ColormapName="Random");0===O.ColorSchemeType&&delete O.ColorRamp;break;case "Convolution":null!=O.ConvolutionType&&(O.Type=O.ConvolutionType,delete O.ConvolutionType);break;case "Mask":K(O)}}}}
function E(O){const {renderingRule:W,templates:Y}=O;if("object"===typeof W&&W?.rasterFunctionArguments&&Y.size){({rasterFunctionArguments:O}=W);for(const V in O){const B=O[V],Q="_object_ref_id"===V?B:B&&"object"===typeof B&&"_object_ref_id"in B?B._object_ref_id:null;if(null!=Q){if(!Y.has(Q))throw new v("raster-function-helper",`unsupported raster function json. _object_ref_id: ${Q} does not exist`);const T=Y.get(Q);"_object_ref_id"!==V?O[V]=T:T&&"object"===typeof T&&Object.assign(O,T)}else B&&"object"===
typeof B&&(B.rasterFunctionArguments&&E({renderingRule:B,templates:Y}),Array.isArray(B)&&B.forEach((T,X)=>{if("object"===typeof T)if(null!=T._object_ref_id){if(!Y.has(T._object_ref_id))throw new v("raster-function-helper",`unsupported raster function json. _object_ref_id: ${B} does not exist`);const aa=Y.get(Q);aa&&"object"===typeof aa?Object.assign(T,aa):B[X]=aa}else E({renderingRule:T,templates:Y})}))}}}function I(O){O.Statistics?.length&&"object"===typeof O.Statistics&&(O.Statistics=O.Statistics.map(W=>
[W.min,W.max,W.mean,W.standardDeviation]));null!=O.NumberOfStandardDeviation&&(O.NumberOfStandardDeviations=O.NumberOfStandardDeviation,delete O.NumberOfStandardDeviation)}function K(O){O.NoDataValues?.length&&"string"===typeof O.NoDataValues[0]&&(O.NoDataValues=O.NoDataValues.filter(W=>""!==W).map(W=>Number(W)))}const S=new Map;S.set("Arithmetic",{desc:"Arithmetic Function",ctor:F,rasterArgumentNames:["rasters"]});S.set("Aspect",{desc:"Aspect Function",ctor:R,rasterArgumentNames:["raster"]});S.set("BandArithmetic",
{desc:"Band Arithmetic Function",ctor:P,rasterArgumentNames:["raster"]});S.set("Colormap",{desc:"Colormap Function",ctor:D,rasterArgumentNames:["raster"]});S.set("CompositeBand",{desc:"CompositeBand Function",ctor:z,rasterArgumentNames:["rasters"]});S.set("ComputeChange",{desc:"ComputeChange Function",ctor:p,rasterArgumentNames:["rasters"]});S.set("Convolution",{desc:"Convolution Function",ctor:g,rasterArgumentNames:["raster"]});S.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:b,
rasterArgumentNames:["raster"]});S.set("ExtractBand",{desc:"ExtractBand Function",ctor:n,rasterArgumentNames:["raster"]});S.set("Curvature",{desc:"Curvature Function",ctor:h,rasterArgumentNames:["raster"]});S.set("Grayscale",{desc:"Grayscale Function",ctor:l,rasterArgumentNames:["raster"]});S.set("Clip",{desc:"Clip Function",ctor:U,rasterArgumentNames:["raster"]});S.set("Local",{desc:"Local Function",ctor:A,rasterArgumentNames:["rasters"]});S.set("Mask",{desc:"Mask Function",ctor:t,rasterArgumentNames:["raster"]});
S.set("NDVI",{desc:"NDVI Function",ctor:r,rasterArgumentNames:["raster"]});S.set("Remap",{desc:"Remap Function",ctor:a,rasterArgumentNames:["raster"]});S.set("Slope",{desc:"Slope Function",ctor:f,rasterArgumentNames:["raster"]});S.set("Statistics",{desc:"Focal Statistics Function",ctor:d,rasterArgumentNames:["raster"]});S.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:e,rasterArgumentNames:["raster"]});S.set("Stretch",{desc:"Stretch Function",ctor:c,rasterArgumentNames:["raster"]});
S.set("Table",{desc:"Attribute Table Function",ctor:k,rasterArgumentNames:["raster"]});m.create=function(O,W){W=W??{};O=J.clone(O);if("function"in O&&"arguments"in O&&O.arguments){const Y=new Map;O=L(O,Y,W);E(O);if(!O.renderingRule)throw new v("raster-function-helper","Unsupported raster function json.");O=O.renderingRule}if("rasterFunction"in O)return O=y(O),C(O,W);throw new v("raster-function-helper","unsupported raster function json.");};m.getPrimaryRasterUrls=q;m.getRasterValues=u;Object.defineProperty(m,
Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/ArithmeticFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../rasterFormats/pixelRangeUtils ./ArithmeticFunctionArguments ./BaseRasterFunction ./localUtils".split(" "),function(m,w,v,J,F,R,P,U,D,z){v=class extends D{constructor(){super(...arguments);this.functionName=
"Arithmetic";this.functionArguments=null;this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){var {operation:p}=this.functionArguments;if(1>p||6<p)return{success:!1,supportsGPU:!1,error:"unsupported operation"};p=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(p.pixelType);p.pixelType=this.outputPixelType;this._removeStatsHistColormapVAT(p);this.rasterInfo=p;return{success:!0,supportsGPU:3>=p.bandCount}}_processPixels(p){({pixelBlocks:p}=p);return null==
p?.[0]||null==p?.[1]?null:z.arithmetic(p,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){var {operation:p}=this.functionArguments;p=" plus minus times divide power mod".split(" ")[p];var b=this.outputPixelType??"f32";let [g,h]=P.getPixelValueRange(b);if(b=P.isIntegerPixelType(b))g-=1E-4,h+=1E-4;return{imageCount:2,operationName:p,domainRange:[g,h],isOutputRounded:b}}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);
m.__decorate([w.property({type:U,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.ArithmeticFunction")],v)})},"esri/layers/support/rasterFunctions/ArithmeticFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseFunctionArguments".split(" "),
function(m,w,v,J,F,R,P){var U;v=U=class extends P{constructor(){super(...arguments);this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new U({raster:this.raster,raster2:this.raster2,operation:this.operation})}};m.__decorate([w.property({json:{write:!0}})],v.prototype,"operation",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"raster2",void 0);m.__decorate([w.property({readOnly:!0})],v.prototype,"rasters",null);return v=U=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.ArithmeticFunctionArguments")],
v)})},"esri/layers/support/rasterFunctions/BaseFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "),function(m,w,v,J,F,R,P){w=class extends w.JSONSupport{constructor(){super(...arguments);this.raster=void 0}};m.__decorate([v.property({json:{write:!0}})],w.prototype,"raster",void 0);return w=
m.__decorate([P.subclass("esri.layers.support.rasterFunctions.BaseFunctionArguments")],w)})},"esri/layers/support/rasterFunctions/BaseRasterFunction":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/cast ../../../core/RandomLCG ../../../core/has ../../../core/accessorSupport/decorators/subclass ../PixelBlock ../RasterInfo".split(" "),function(m,w,v,J,F,R,P,U,D){const z=new Set("slope aspect curvature hillshade shadedrelief statistics".split(" "));
w=class extends w.JSONSupport{constructor(){super(...arguments);this.functionArguments=null;this.readingBufferSize=0;this.id=-1;this.isNoopProcess=!1;this.rawInputBandIds=[];this.rawSourceRasterInfos=null;this.isInputBandIdsSwizzled=!1;this.swizzledBandSelection=[];this.isBranch=!1;this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){var p=this.getWebGLProcessorDefinition();if(!p)return null;const b=[p];({parameters:p}=p);for(p=p.rasters||
p.raster&&[p.raster];p?.length;){b.unshift(...p);var g=[];for(var h=0;h<p.length;h++){var {parameters:n}=p[h];n=n.rasters||n.raster&&[n.raster];n?.length&&g.push(...n)}p=g}for(p=b.length-1;0<=p;p--)b[p].isNoopProcess&&b.splice(p,1);p=!1;for(g=0;g<b.length;g++)h=b[g],h.id=b.length-g-1,{rasters:h}=h.parameters,p=p||null!=h&&1<h.length;g=b.some(({name:l})=>z.has(l.toLowerCase()));({rawSourceRasterInfos:h}=this);return{functions:b,hasBranches:p,hasFocalFunction:g,isSourceSingleBand:1===h?.[0]?.bandCount}}bind(p,
b=!1,g=-1){this.id=g+1;g=this._getRasterValues();let h=!0;for(let l=0;l<g.length;l++){var n=g[l];if(null!=n&&this._isRasterFunctionValue(n)){n=n.bind(p,b,this.id+l);if(!n.success)return this._bindingResult=n;h=h&&n.supportsGPU}}if(!this.rasterInfo||b)return this.sourceRasterInfos=this._getSourceRasterInfos(p),this._bindingResult=this._bindSourceRasters(),this._bindingResult.success&&this._patchRasterInfo(),this._bindingResult.supportsGPU=h&&this._bindingResult.supportsGPU,this.processInputBandIds(),
this._bindingResult;this._bindingResult={success:!0,supportsGPU:!0};this.processInputBandIds();return this._bindingResult}process(p){var b=this._getRasterValues();b=0===b.length?p.pixelBlocks??p.primaryPixelBlocks:b.map(g=>this._readRasterValue(g,p));return this._processPixels({...p,pixelBlocks:b})}processInputBandIds(){var p=this._getRasterValues().filter(this._isRasterFunctionValue);if(1<p.length)return this.rawInputBandIds=p.map(g=>g.processInputBandIds()[0]),this.isInputBandIdsSwizzled=this.rawInputBandIds.some((g,
h)=>g!==h),p=p.filter(g=>"ExtractBand"===g.functionName),p.length&&p.forEach((g,h)=>{g.isInputBandIdsSwizzled=!0;g.swizzledBandSelection=[h,h,h]}),this.rawInputBandIds;var b=p[0];if(b){if(p=b.processInputBandIds(),b.isInputBandIdsSwizzled)return this.rawInputBandIds=p}else{p=[];({bandCount:b}=this.sourceRasterInfos[0]);for(let g=0;g<b;g++)p.push(g)}p=this._getInputBandIds(p);this.isInputBandIdsSwizzled=p.some((g,h)=>g!==h);return this.rawInputBandIds=p}getPrimaryRasters(){const p=[],b=[];this._getPrimaryRasters(this,
p,b);return{rasters:p,rasterIds:b}}getWebGLProcessorDefinition(){const p=this._getWebGLParameters(),{raster:b,rasters:g}=this.functionArguments;g&&Array.isArray(g)&&g.length?(p.rasters=g.map(h=>this._isRasterFunctionValue(h)?h.getWebGLProcessorDefinition():"number"===typeof h?{name:"Constant",parameters:{value:h},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:h},pixelType:"f32",id:-1,isNoopProcess:!1}),p.rasters.some(h=>null!=h)||(p.rasters=null)):this._isRasterFunctionValue(b)&&
(p.raster=b.getWebGLProcessorDefinition());return{name:this.functionName,parameters:p,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const p=[];"Clip"===this.functionName&&p.push(this.functionArguments);const {raster:b,rasters:g}=this.functionArguments;if(g&&Array.isArray(g)&&g.length)g.forEach(h=>{this._isRasterFunctionValue(h)&&(h=h.getClippingGeometries(),p.push(...h))});else if(this._isRasterFunctionValue(b)){const h=b.getClippingGeometries();
p.push(...h)}return p}_getOutputPixelType(p){return"unknown"===this.outputPixelType?p:this.outputPixelType??p}_getWebGLParameters(){return{}}_getInputBandIds(p){return p}_removeStatsHistColormapVAT(p){p.statistics=null;p.histograms=null;p.colormap=null;p.attributeTable=null}_getRasterValues(){const {rasterArgumentNames:p}=this;return"rasters"===p[0]?this.functionArguments.rasters??[]:p.flatMap(b=>this.functionArguments[b])}_getSourceRasterInfos(p){const b=this._getRasterValues(),{rasterInfos:g,rasterIds:h}=
p;if(0===b.length)return g;const n=b.map(A=>{if(A&&"object"===typeof A&&"bind"in A&&A.rasterInfo)return A.rasterInfo;if("string"===typeof A&&h.includes(A))return g[h.indexOf(A)];if("number"!==typeof A)return g[0]}),l=n.find(A=>A)??g[0];n.forEach((A,t)=>{void 0===A&&(n[t]=l)});return n}_getPrimaryRasterId(p){return p?.rasterId}_getPrimaryRasters(p,b=[],g=[]){for(let n=0;n<p.sourceRasters.length;n++){var h=p.sourceRasters[n];if("number"!==typeof h)if("bind"in h)this._getPrimaryRasters(h,b,g);else{const l=
this._getPrimaryRasterId(h);null==l||g.includes(l)||(this.mainPrimaryRasterId===l?(b.unshift(h),g.unshift(l)):(b.push(h),g.push(l)))}}}_isRasterFunctionValue(p){return null!=p&&"object"===typeof p&&"getWebGLProcessorDefinition"in p}_readRasterValue(p,b){var {primaryPixelBlocks:g}=b;if(null==p||"$$"===p)return p=g[0],null==p?null:p.clone();if("string"===typeof p)return p=b.primaryRasterIds.indexOf(p),-1===p?null:g[p];if("number"===typeof p){g=g[0];if(null==g)return null;const {width:h,height:n,pixelType:l}=
g;g=new Float32Array(h*n);g.fill(p);p=Array(this.sourceRasterInfos[0].bandCount).fill(g);return new U({width:h,height:n,pixelType:l,pixels:p})}return p.process(b)}_patchRasterInfo(){const {rasterInfo:p}=this;if(p?.keyProperties){var {bandCount:b,keyProperties:g,statistics:h,histograms:n}=p,l=g.BandProperties;l&&l.length!==b&&(p.keyProperties={...g,BandProperties:void 0});h&&h.length!==b&&(p.statistics=h.length>b?h.slice(0,b):null);n&&n.length!==b&&(p.histograms=n.length>b?n.slice(0,b):null);g.BAND_COUNT&&
Number(g.BAND_COUNT)!==b&&(p.keyProperties={...g,BAND_COUNT:"string"===typeof g.BAND_COUNT?String(b):b})}}};m.__decorate([v.property({json:{write:!0}})],w.prototype,"functionName",void 0);m.__decorate([v.property({json:{write:!0}})],w.prototype,"functionArguments",void 0);m.__decorate([v.property()],w.prototype,"rasterArgumentNames",void 0);m.__decorate([v.property({json:{write:!0}}),J.cast(p=>p?.toLowerCase())],w.prototype,"outputPixelType",void 0);m.__decorate([v.property({json:{write:!0}})],w.prototype,
"mainPrimaryRasterId",void 0);m.__decorate([v.property()],w.prototype,"sourceRasters",void 0);m.__decorate([v.property({type:[D],json:{write:!0}})],w.prototype,"sourceRasterInfos",void 0);m.__decorate([v.property({json:{write:!0}})],w.prototype,"rasterInfo",void 0);m.__decorate([v.property({json:{write:!0}})],w.prototype,"readingBufferSize",void 0);m.__decorate([v.property({json:{write:!0}})],w.prototype,"id",void 0);m.__decorate([v.property()],w.prototype,"isNoopProcess",void 0);m.__decorate([v.property()],
w.prototype,"supportsGPU",null);m.__decorate([v.property()],w.prototype,"rawInputBandIds",void 0);m.__decorate([v.property()],w.prototype,"rawSourceRasterInfos",void 0);m.__decorate([v.property()],w.prototype,"isInputBandIdsSwizzled",void 0);m.__decorate([v.property()],w.prototype,"swizzledBandSelection",void 0);m.__decorate([v.property()],w.prototype,"isBranch",void 0);m.__decorate([v.property({readOnly:!0})],w.prototype,"flatWebGLFunctionChain",null);m.__decorate([v.property()],w.prototype,"_bindingResult",
void 0);return w=m.__decorate([P.subclass("esri.layers.support.rasterFunctions.BaseRasterFunction")],w)})},"esri/layers/support/RasterInfo":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/lang ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/accessorSupport/decorators/subclass ../../geometry/Extent ../../geometry/SpatialReference ./RasterBandInfo ./RasterSensorInfo ./RasterStorageInfo".split(" "),function(m,w,v,J,F,R,P,U,D,z,p,
b){var g;w=g=class extends w.JSONSupport{constructor(h){super(h);this.extent=this.colormap=this.bandCount=this.attributeTable=null;this.format=void 0;this.histograms=this.width=this.height=null;this.keyProperties={};this.pixelType=this.pixelSize=this.noDataValue=this.multidimensionalInfo=null;this.isPseudoSpatialReference=!1;this.transform=this.storageInfo=this.statistics=this.spatialReference=null}get bandInfos(){var h=this.keyProperties.BandProperties,{bandCount:n}=this;if(!h?.length||h.length<
n){h=[];for(let l=1;l<=n;l++)h.push(new z({name:"band_"+l}));return h}n=h.map(l=>z.fromJSON(l));for(h=0;h<n.length;h++)n[h].name=n[h].name||"band_"+(h+1);return n}get dataType(){const h=this.keyProperties?.DataType?.toLowerCase()??"generic";return"stdtime"===h?"standard-time":h}get nativeExtent(){return this._get("nativeExtent")||this.extent}set nativeExtent(h){h&&this._set("nativeExtent",h)}get nativePixelSize(){if(null==this.transform||!this.transform.affectsPixelSize)return this.pixelSize;const h=
this.nativeExtent;return{x:h.width/this.width,y:h.height/this.height}}get hasMultidimensionalTranspose(){return!!this.storageInfo?.transposeInfo}get sensorInfo(){if(this.keyProperties?.SensorName)return p.fromJSON(this.keyProperties)}clone(){return new g({attributeTable:v.clone(this.attributeTable),bandCount:this.bandCount,colormap:v.clone(this.colormap),extent:v.clone(this.extent),format:this.format,height:this.height,width:this.width,histograms:v.clone(this.histograms),keyProperties:v.clone(this.keyProperties),
multidimensionalInfo:v.clone(this.multidimensionalInfo),noDataValue:this.noDataValue,pixelSize:v.clone(this.pixelSize),pixelType:this.pixelType,isPseudoSpatialReference:this.isPseudoSpatialReference,spatialReference:v.clone(this.spatialReference),statistics:v.clone(this.statistics),storageInfo:v.clone(this.storageInfo),transform:v.clone(this.transform)})}};m.__decorate([J.property({json:{write:!0}})],w.prototype,"attributeTable",void 0);m.__decorate([J.property({json:{write:!0}})],w.prototype,"bandCount",
void 0);m.__decorate([J.property({readOnly:!0})],w.prototype,"bandInfos",null);m.__decorate([J.property({json:{write:!0}})],w.prototype,"colormap",void 0);m.__decorate([J.property({type:String,readOnly:!0})],w.prototype,"dataType",null);m.__decorate([J.property({type:U,json:{write:!0}})],w.prototype,"extent",void 0);m.__decorate([J.property({type:U,json:{write:!0}})],w.prototype,"nativeExtent",null);m.__decorate([J.property({json:{write:!0}})],w.prototype,"nativePixelSize",null);m.__decorate([J.property({json:{write:!0}})],
w.prototype,"format",void 0);m.__decorate([J.property({json:{write:!0}})],w.prototype,"height",void 0);m.__decorate([J.property({json:{write:!0}})],w.prototype,"width",void 0);m.__decorate([J.property({json:{write:!0}})],w.prototype,"hasMultidimensionalTranspose",null);m.__decorate([J.property({json:{write:!0}})],w.prototype,"histograms",void 0);m.__decorate([J.property({json:{write:!0}})],w.prototype,"keyProperties",void 0);m.__decorate([J.property({json:{write:!0}})],w.prototype,"multidimensionalInfo",
void 0);m.__decorate([J.property({json:{write:!0}})],w.prototype,"noDataValue",void 0);m.__decorate([J.property({json:{write:!0}})],w.prototype,"pixelSize",void 0);m.__decorate([J.property({json:{write:!0}})],w.prototype,"pixelType",void 0);m.__decorate([J.property()],w.prototype,"isPseudoSpatialReference",void 0);m.__decorate([J.property({readOnly:!0})],w.prototype,"sensorInfo",null);m.__decorate([J.property({type:D,json:{write:!0}})],w.prototype,"spatialReference",void 0);m.__decorate([J.property({json:{write:!0}})],
w.prototype,"statistics",void 0);m.__decorate([J.property({type:b,json:{write:!0}})],w.prototype,"storageInfo",void 0);m.__decorate([J.property({json:{write:!0}})],w.prototype,"transform",void 0);return w=g=m.__decorate([P.subclass("esri.layers.support.RasterInfo")],w)})},"esri/layers/support/RasterBandInfo":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),
function(m,w,v,J,F,R,P){function U(z){z=Number(z);return isNaN(z)?void 0:z}var D;w=D=class extends w.JSONSupport{constructor(){super(...arguments);this.name=null;this.solarIrradiance=this.reflectanceGain=this.reflectanceBias=this.radianceGain=this.radianceBias=this.maxWavelength=this.minWavelength=void 0}clone(){return new D({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,
reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};m.__decorate([v.property({json:{name:"BandName",write:!0}})],w.prototype,"name",void 0);m.__decorate([v.property({json:{name:"WavelengthMin",read:{reader:U},write:!0}})],w.prototype,"minWavelength",void 0);m.__decorate([v.property({json:{name:"WavelengthMax",read:{reader:U},write:!0}})],w.prototype,"maxWavelength",void 0);m.__decorate([v.property({json:{name:"RadianceBias",read:{reader:U},write:!0}})],w.prototype,"radianceBias",
void 0);m.__decorate([v.property({json:{name:"RadianceGain",read:{reader:U},write:!0}})],w.prototype,"radianceGain",void 0);m.__decorate([v.property({json:{name:"ReflectanceBias",read:{reader:U},write:!0}})],w.prototype,"reflectanceBias",void 0);m.__decorate([v.property({json:{name:"ReflectanceGain",read:{reader:U},write:!0}})],w.prototype,"reflectanceGain",void 0);m.__decorate([v.property({json:{name:"SolarIrradiance",read:{reader:U},write:!0}})],w.prototype,"solarIrradiance",void 0);return w=D=
m.__decorate([P.subclass("esri.layers.support.RasterBandInfo")],w)})},"esri/layers/support/RasterSensorInfo":function(){define("../../chunks/tslib.es6 ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer".split(" "),function(m,w,v,J,F,R,P,U,D){function z(b){b=Number(b);return isNaN(b)?void 0:
b}var p;w=p=class extends w.JSONSupport{constructor(){super(...arguments);this.productName=this.cloudCover=this.acquisitionDate=void 0;this.sensorName=null;this.sunElevation=this.sunAzimuth=this.sensorElevation=this.sensorAzimuth=void 0}readAcquisitionDate(b){return new Date(b)}writeAcquisitionDate(b,g){g.AcquisitionDate=b.getTime()}clone(){return new p({acquisitionDate:this.acquisitionDate,cloudCover:this.cloudCover,productName:this.productName,sensorName:this.sensorName,sensorAzimuth:this.sensorAzimuth,
sensorElevation:this.sensorElevation,sunAzimuth:this.sunAzimuth,sunElevation:this.sunElevation})}};m.__decorate([v.property({json:{name:"AcquisitionDate",write:!0}})],w.prototype,"acquisitionDate",void 0);m.__decorate([P.reader("acquisitionDate")],w.prototype,"readAcquisitionDate",null);m.__decorate([D.writer("acquisitionDate")],w.prototype,"writeAcquisitionDate",null);m.__decorate([v.property({json:{name:"CloudCover",read:{reader:z},write:!0}})],w.prototype,"cloudCover",void 0);m.__decorate([v.property({json:{name:"ProductName",
write:!0}})],w.prototype,"productName",void 0);m.__decorate([v.property({json:{name:"SensorName",write:!0}})],w.prototype,"sensorName",void 0);m.__decorate([v.property({json:{name:"SensorAzimuth",read:{reader:z},write:!0}})],w.prototype,"sensorAzimuth",void 0);m.__decorate([v.property({json:{name:"SensorElevation",read:{reader:z},write:!0}})],w.prototype,"sensorElevation",void 0);m.__decorate([v.property({json:{name:"SunAzimuth",read:{reader:z},write:!0}})],w.prototype,"sunAzimuth",void 0);m.__decorate([v.property({json:{name:"SunElevation",
read:{reader:z},write:!0}})],w.prototype,"sunElevation",void 0);return w=p=m.__decorate([U.subclass("esri.layers.support.RasterSensorInfo")],w)})},"esri/layers/support/rasterFunctions/localUtils":function(){define(["exports","../PixelBlock","../rasterFunctionConstants","../rasterFormats/pixelRangeUtils"],function(m,w,v,J){function F(ca,ia=!1){var da=ca.map(ha=>ha.mask);const ka=da.filter(ha=>null!=ha);ca=ca[0].pixels[0].length;if(0===ka.length||ia&&ka.length!==da.length)return(new Uint8Array(ca)).fill(255);
da=new Uint8Array(ka[0]);if(1===ka.length)return da;if(!ia){for(ia=1;ia<ka.length;ia++){ca=ka[ia];for(var na=0;na<da.length;na++)da[na]&&(da[na]=ca[na]?255:0)}return da}for(ia=1;ia<ka.length;ia++)for(ca=ka[ia],na=0;na<da.length;na++)0===da[na]&&(da[na]=ca[na]?255:0);return da}function R(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]+na[ha];return da}function P(ca,ia,da){[ca]=ca;ia=w.createEmptyBand("f32",ca.length);ia.set(ca);
return ia}function U(ca,ia,da){[ca]=ca;const ka=ca.length;da=w.createEmptyBand(da,ka);for(let na=0;na<ka;na++)if(!ia||ia[na])da[na]=ca[na]*ca[na];return da}function D(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]-na[ha];return da}function z(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]*na[ha];return da}function p(ca,ia,da){[ca]=ca;const ka=ca.length;
da=w.createEmptyBand(da,ka);for(let na=0;na<ka;na++)if(!ia||ia[na])da[na]=Math.sign(ca[na])*Math.floor(Math.abs(ca[na]));return da}function b(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]/na[ha];return da}function g(ca,ia,da){return b(ca,ia,"f32")}function h(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=Math.floor(ka[ha]/na[ha]);return da}function n(ca,ia,
da,ka){ca=ca[0];const na=ca.length;da=w.createEmptyBand(da,na);if(ka===v.localTrigonometricOperation.atanh){for(ka=0;ka<na;ka++)if(ia[ka]){var ha=ca[ka];1<=Math.abs(ha)?ia[ka]=0:da[ka]=Math.atanh(ha)}return da}ka=ka===v.localTrigonometricOperation.asin?Math.asin:Math.acos;for(ha=0;ha<na;ha++)if(ia[ha]){const ua=ca[ha];1<Math.abs(ua)?ia[ha]=0:da[ha]=ka(ua)}return da}function l(ca,ia,da,ka){[ca]=ca;const na=ca.length;da=w.createEmptyBand(da,na);for(let ha=0;ha<na;ha++)if(!ia||ia[ha])da[ha]=ka(ca[ha]);
return da}function A(ca,ia,da,ka){const [na,ha]=ca;ca=na.length;da=w.createEmptyBand(da,ca);for(let ua=0;ua<ca;ua++)if(!ia||ia[ua])da[ua]=ka(na[ua],ha[ua]);return da}function t(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]&na[ha];return da}function r(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]<<na[ha];return da}function a(ca,ia,da){[ca]=ca;const ka=
ca.length;da=w.createEmptyBand(da,ka);for(let na=0;na<ka;na++)if(!ia||ia[na])da[na]=~ca[na];return da}function f(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]|na[ha];return da}function d(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]>>na[ha];return da}function e(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||
ia[ha])da[ha]=ka[ha]^na[ha];return da}function c(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]&&na[ha]?1:0;return da}function k(ca,ia,da){[ca]=ca;const ka=ca.length;da=w.createEmptyBand(da,ka);for(let na=0;na<ka;na++)if(!ia||ia[na])da[na]=ca[na]?0:1;return da}function q(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]||na[ha]?1:0;return da}function u(ca,
ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=(ka[ha]?1:0)^(na[ha]?1:0);return da}function G(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]===na[ha]?1:0;return da}function y(ca,ia,da,ka){[ca]=ca;const na=ca.length;da=w.createEmptyBand(da,na);const ha=ka===Math.E;for(let ua=0;ua<na;ua++)if(!ia||ia[ua])da[ua]=ha?Math.exp(ca[ua]):ka**ca[ua];return da}function C(ca,
ia,da){return y(ca,ia,da,10)}function H(ca,ia,da){return y(ca,ia,da,2)}function x(ca,ia,da){return y(ca,ia,da,Math.E)}function M(ca,ia,da,ka){[ca]=ca;const na=ca.length;da=w.createEmptyBand(da,na);for(let ha=0;ha<na;ha++)if(!ia||ia[ha])0>=ca[ha]?ia[ha]=0:da[ha]=ka(ca[ha]);return da}function L(ca,ia,da){return M(ca,ia,da,Math.log10)}function N(ca,ia,da){return M(ca,ia,da,Math.log2)}function E(ca,ia,da){return M(ca,ia,da,Math.log)}function I(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,
ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]>na[ha]?1:0;return da}function K(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]>=na[ha]?1:0;return da}function S(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]<na[ha]?1:0;return da}function O(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=
ka[ha]<=na[ha]?1:0;return da}function W(ca,ia,da){[ca]=ca;ca=ca.length;da=w.createEmptyBand(da,ca);if(!ia)return da;for(let ka=0;ka<ca;ka++)da[ka]=ia[ka]?0:1;return da}function Y(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]%na[ha];return da}function V(ca,ia,da){[ca]=ca;const ka=ca.length;da=w.createEmptyBand(da,ka);for(let na=0;na<ka;na++)if(!ia||ia[na])da[na]=-ca[na];return da}function B(ca,ia,da){const [ka,na]=ca;ca=ka.length;
da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)if(!ia||ia[ha])da[ha]=ka[ha]===na[ha]?0:1;return da}function Q(ca,ia,da){const [ka,na]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);const ha=new Uint8Array(ca);for(let ua=0;ua<ca;ua++)null!=ia&&!ia[ua]||0!==ka[ua]||(da[ua]=na[ua],ha[ua]=255);return{band:da,mask:ha}}function T(ca,ia,da){const [ka,na,ha]=ca;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ua=0;ua<ca;ua++)if(!ia||ia[ua])da[ua]=ka[ua]?na[ua]:ha[ua];return da}function X(ca,ia,da){const ka=
ca.length;if(2>ka)return ca[0];const [na]=ca,ha=na.length;da=w.createEmptyBand(da,ha);for(let ua=0;ua<ha;ua++)if(!ia||ia[ua]){let wa=na[ua];for(let za=1;za<ka;za++){const Ba=ca[za][ua];wa<Ba&&(wa=Ba)}da[ua]=wa}return da}function aa(ca,ia,da){const ka=ca.length;if(2>ka)return ca[0];const [na]=ca,ha=na.length;da=w.createEmptyBand(da,ha);for(let ua=0;ua<ha;ua++)if(!ia||ia[ua]){let wa=na[ua];for(let za=1;za<ka;za++){const Ba=ca[za][ua];wa>Ba&&(wa=Ba)}da[ua]=wa}return da}function Z(ca,ia,da){const ka=
ca.length;if(2>ka)return ca[0];const [na]=ca,ha=na.length;da=w.createEmptyBand(da,ha);for(let ua=0;ua<ha;ua++)if(!ia||ia[ua]){let wa=na[ua],za=wa;for(let Ba=1;Ba<ka;Ba++){const Aa=ca[Ba][ua];za<Aa?za=Aa:wa>Aa&&(wa=Aa)}da[ua]=za-wa}return da}function ba(ca,ia,da){const ka=ca.length;if(2>ka)return ca[0];var [na]=ca;na=na.length;da=w.createEmptyBand(da,na);for(let ha=0;ha<na;ha++)if(!ia||ia[ha]){let ua=0;for(let wa=0;wa<ka;wa++)ua+=ca[wa][ha];da[ha]=ua/ka}return da}function ea(ca,ia,da){const ka=ca.length;
if(2>ka)return ca[0];var [na]=ca;na=na.length;da=w.createEmptyBand(da,na);for(let ha=0;ha<na;ha++)if(!ia||ia[ha])for(let ua=0;ua<ka;ua++)da[ha]+=ca[ua][ha];return da}function fa(ca,ia,da){const ka=ca.length;if(2>ka)return ca[0];var [na]=ca;na=na.length;da=w.createEmptyBand(da,na);for(let wa=0;wa<na;wa++)if(!ia||ia[wa]){const za=new Float32Array(ka);let Ba=0;for(var ha=0;ha<ka;ha++){var ua=ca[ha];Ba+=ua[wa];za[ha]=ua[wa]}Ba/=ka;ha=0;for(ua=0;ua<ka;ua++)ha+=(za[ua]-Ba)**2;da[wa]=Math.sqrt(ha/ka)}return da}
function la(ca,ia,da){const ka=ca.length;if(2>ka)return ca[0];const na=Math.floor(ka/2);var [ha]=ca;ha=ha.length;da=w.createEmptyBand(da,ha);const ua=new Float32Array(ka),wa=1===ka%2;for(let za=0;za<ha;za++)if(!ia||ia[za]){for(let Ba=0;Ba<ka;Ba++)ua[Ba]=ca[Ba][za];ua.sort();da[za]=wa?ua[na]:(ua[na]+ua[na-1])/2}return da}function ja(ca,ia,da){const [ka,na]=ca;if(null==na)return ka;ca=ka.length;da=w.createEmptyBand(da,ca);for(let ha=0;ha<ca;ha++)ia[ha]&&(ka[ha]===na[ha]?da[ha]=ka[ha]:ia[ha]=0);return da}
function pa(ca,ia,da){const ka=ca.length;if(2>=ka)return ja(ca,ia,da);const na=ca[0].length;da=w.createEmptyBand(da,na);const ha=new Map;for(let wa=0;wa<na;wa++)if(!ia||ia[wa]){ha.clear();let za;for(var ua=0;ua<ka;ua++)za=ca[ua][wa],ha.set(za,ha.has(za)?ha.get(za)+1:1);let Ba=ua=0;for(const Aa of ha.keys())ua=ha.get(Aa),ua>Ba&&(Ba=ua,za=Aa);da[wa]=za}return da}function ma(ca,ia,da){const ka=ca.length;if(2>=ka)return ja(ca,ia,da);const na=ca[0].length;da=w.createEmptyBand(da,na);const ha=new Map;for(let wa=
0;wa<na;wa++)if(!ia||ia[wa]){ha.clear();let za;for(var ua=0;ua<ka;ua++)za=ca[ua][wa],ha.set(za,ha.has(za)?ha.get(za)+1:1);ua=0;let Ba=ca.length;for(const Aa of ha.keys())ua=ha.get(Aa),ua<Ba&&(Ba=ua,za=Aa);da[wa]=za}return da}function oa(ca,ia,da){const ka=ca.length;if(2>ka)return ca[0];var [na]=ca;na=na.length;da=w.createEmptyBand(da,na);const ha=new Set;for(let ua=0;ua<na;ua++)if(!ia||ia[ua]){ha.clear();let wa;for(let za=0;za<ka;za++)wa=ca[za][ua],ha.add(wa);da[ua]=ha.size}return da}function qa(ca,
ia,da,ka){let [na,ha]=J.getPixelValueRange(da);if(da=J.isIntegerPixelType(da))na-=1E-5,ha+=1E-5;for(let ua=0;ua<ia.length;ua++)if(ia[ua]){const wa=ca[ua];isNaN(wa)||wa<na||wa>ha?ia[ua]=0:ka[ua]=da?Math.round(wa):wa}}function ta(ca,ia,da={}){ra.size||(ra.set(4,Math.sqrt),ra.set(6,Math.acos),ra.set(7,Math.asin),ra.set(8,Math.atan),ra.set(9,Math.atanh),ra.set(10,Math.abs),ra.set(21,Math.cos),ra.set(22,Math.cosh),ra.set(48,Math.floor),ra.set(49,Math.ceil),ra.set(51,Math.sin),ra.set(52,Math.sinh),ra.set(56,
Math.tan),ra.set(57,Math.tanh),ra.set(59,Math.acosh),ra.set(60,Math.asinh),ra.set(65,Math.floor),xa.set(5,Math.pow),xa.set(61,Math.atan2),va.set(1,R),va.set(2,D),va.set(3,z),va.set(11,t),va.set(12,r),va.set(13,a),va.set(14,f),va.set(15,d),va.set(16,e),va.set(17,c),va.set(18,k),va.set(19,q),va.set(20,u),va.set(23,b),va.set(24,G),va.set(25,x),va.set(26,C),va.set(27,H),va.set(28,I),va.set(29,K),va.set(30,p),va.set(31,W),va.set(32,P),va.set(33,S),va.set(34,O),va.set(35,E),va.set(36,L),va.set(37,N),va.set(44,
Y),va.set(45,V),va.set(46,B),va.set(53,U),va.set(64,g),va.set(65,h),va.set(76,T),va.set(78,T),ya.set(38,pa),ya.set(39,X),ya.set(40,ba),ya.set(41,la),ya.set(42,aa),ya.set(43,ma),ya.set(47,Z),ya.set(54,fa),ya.set(55,ea),ya.set(58,oa),ya.set(66,pa),ya.set(67,X),ya.set(68,ba),ya.set(69,la),ya.set(70,aa),ya.set(71,ma),ya.set(72,Z),ya.set(73,fa),ya.set(74,ea),ya.set(75,oa));var ka=F(ca,66<=ia&&75>=ia);const {outputPixelType:na="f32"}=da,ha=!ya.has(ia)||da.processAsMultiband,ua=ha?ca[0].pixels.length:1;
da=[];for(let Ba=0;Ba<ua;Ba++){var wa=ya.has(ia)&&!ha?ca.flatMap(Aa=>Aa.pixels):ca.map(Aa=>Aa.pixels[Ba]),za=!0;ia===v.localConditionalOperation.setNull?(ka=Q(wa,ka,na),wa=ka.band,ka=ka.mask,za=!1):va.has(ia)?wa=va.get(ia)(wa,ka,"f64"):ra.has(ia)?wa=ia===v.localTrigonometricOperation.asin||ia===v.localTrigonometricOperation.acos||ia===v.localTrigonometricOperation.atanh?n(wa,ka,"f64",ia):l(wa,ka,"f64",ra.get(ia)):xa.has(ia)?wa=A(wa,ka,"f64",xa.get(ia)):ya.has(ia)?wa=ya.get(ia)(wa,ka,"f64"):(wa=wa[0],
za=!1);za&&ia!==v.localLogicalOperation.isNull&&!sa.has(ia)&&(za=w.createEmptyBand(na,wa.length),ka||=(new Uint8Array(wa.length)).fill(255),qa(wa,ka,na,za),wa=za);da.push(wa)}ca=ca[0];return new w({width:ca.width,height:ca.height,pixelType:na,mask:ia===v.localLogicalOperation.isNull?null:ka,pixels:da})}const sa=new Map([[v.localTrigonometricOperation.acos,{domain:[0,Math.PI],isInteger:!1}],[v.localTrigonometricOperation.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[v.localTrigonometricOperation.atan,
{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[v.localTrigonometricOperation.cos,{domain:[-1,1],isInteger:!1}],[v.localTrigonometricOperation.sin,{domain:[-1,1],isInteger:!1}],[v.localLogicalOperation.booleanAnd,{domain:[0,1],isInteger:!0}],[v.localLogicalOperation.booleanNot,{domain:[0,1],isInteger:!0}],[v.localLogicalOperation.booleanOr,{domain:[0,1],isInteger:!0}],[v.localLogicalOperation.booleanXOr,{domain:[0,1],isInteger:!0}],[v.localLogicalOperation.equalTo,{domain:[0,1],isInteger:!0}],[v.localLogicalOperation.notEqual,
{domain:[0,1],isInteger:!0}],[v.localLogicalOperation.greaterThan,{domain:[0,1],isInteger:!0}],[v.localLogicalOperation.greaterThanEqual,{domain:[0,1],isInteger:!0}],[v.localLogicalOperation.lessThan,{domain:[0,1],isInteger:!0}],[v.localLogicalOperation.lessThanEqual,{domain:[0,1],isInteger:!0}],[v.localLogicalOperation.isNull,{domain:[0,1],isInteger:!0}]]),ra=new Map,xa=new Map,va=new Map,ya=new Map;m.arithmetic=function(ca,ia,da){ia=[null,1,2,3,23,5,44][ia]??1;return ta(ca,ia,{outputPixelType:da})};
m.getOutputDomain=function(ca){return sa.get(ca)};m.local=ta;m.operandsCount=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctionConstants":function(){define(["exports"],function(m){const w={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,
exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65},v={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},J={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},F={majority:38,
max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75},R={setNull:50,conditional:78},P={...w,...v,...J,...F,...R};m.arithmeticOperation={plus:1,minus:2,multiply:3,divide:4,power:5,mod:6};m.bandIndexType={userDefined:0,NDVI:1,SAVI:2,TSAVI:3,MSAVI:4,GEMI:5,PVI:6,GVITM:7,
Sultan:8,VARI:9,GNDVI:10,SR:11,NDVIRe:12,SRRe:13,MTVI2:14,RTVICore:15,CIRe:16,CIG:17,NDWI:18,EVI:19,ironOxide:20,ferrousMinerals:21,clayMinerals:22,WNDWI:23,BAI:24,NBR:25,NDBI:26,NDMI:27,NDSI:28,MNDWI:29};m.cellStatisticalOperation=F;m.clippingType={outside:1,inside:2};m.colorRampName={aspect:"Aspect",blackToWhite:"Black to White",blueBright:"Blue Bright",blueLightToDark:"Blue Light to Dark",blueGreenBright:"Blue-Green Bright",blueGreenLightToDark:"Blue-Green Light to Dark",brownLightToDark:"Brown Light to Dark",
brownToBlueGreenDivergingBright:"Brown to Blue Green Diverging, Bright",brownToBlueGreenDivergingDark:"Brown to Blue Green Diverging, Dark",coefficientBias:"Coefficient Bias",coldToHotDiverging:"Cold to Hot Diverging",conditionNumber:"Condition Number",cyanToPurple:"Cyan to Purple",cyanLightToBlueDark:"Cyan-Light to Blue-Dark",distance:"Distance",elevation1:"Elevation #1",elevation2:"Elevation #2",errors:"Errors",grayLightToDark:"Gray Light to Dark",greenBright:"Green Bright",greenLightToDark:"Green Light to Dark",
greenToBlue:"Green to Blue",orangeBright:"Orange Bright",orangeLightToDark:"Orange Light to Dark",partialSpectrum:"Partial Spectrum",partialSpectrum1Diverging:"Partial Spectrum 1 Diverging",partialSpectrum2Diverging:"Partial Spectrum 2 Diverging",pinkToYellowGreenDivergingBright:"Pink to YellowGreen Diverging, Bright",pinkToYellowGreenDivergingDark:"Pink to YellowGreen Diverging, Dark",precipitation:"Precipitation",prediction:"Prediction",purpleBright:"Purple Bright",purpleToGreenDivergingBright:"Purple to Green Diverging, Bright",
purpleToGreenDivergingDark:"Purple to Green Diverging, Dark",purpleBlueBright:"Purple-Blue Bright",purpleBlueLightToDark:"Purple-Blue Light to Dark",purpleRedBright:"Purple-Red Bright",purpleRedLightToDark:"Purple-Red Light to Dark",redBright:"Red Bright",redLightToDark:"Red Light to Dark",redToBlueDivergingBright:"Red to Blue Diverging, Bright",redToBlueDivergingDark:"Red to Blue Diverging, Dark",redToGreen:"Red to Green",redToGreenDivergingBright:"Red to Green Diverging, Bright",redToGreenDivergingDark:"Red to Green Diverging, Dark",
slope:"Slope",spectrumFullBright:"Spectrum-Full Bright",spectrumFullDark:"Spectrum-Full Dark",spectrumFullLight:"Spectrum-Full Light",surface:"Surface",temperature:"Temperature",whiteToBlack:"White to Black",yellowToDarkRed:"Yellow to Dark Red",yellowToGreenToDarkBlue:"Yellow to Green to Dark Blue",yellowToRed:"Yellow to Red",yellowGreenBright:"Yellow-Green Bright",yellowGreenLightToDark:"Yellow-Green Light to Dark"};m.colormapName={random:"Random",NDVI:"NDVI",NDVI2:"NDVI2",NDVI3:"NDVI3",elevation:"Elevation",
gray:"Gray",hillshade:"Hillshade"};m.computeChangeMethod={difference:0,relativeDifference:1,categorical:2,spectralEuclidianDistance:3,spectralAngleDifference:4,bandWithMostChange:5};m.convolutionKernel={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,
laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255};m.curvatureType={standard:0,platform:1,profile:2};m.localArithmeticOperation=w;m.localConditionalOperation=R;m.localLogicalOperation=v;m.localOperators=P;m.localTrigonometricOperation=J;m.missingBandAction={bestMatch:0,fail:1};m.noDataInterpretation={matchAny:0,matchAll:1};m.slopeType={degree:1,percentRise:2,adjusted:3};m.statisticsType={min:1,max:2,mean:3,standardDeviation:4,median:5,
majority:6,minority:7};m.stretchType={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/AspectFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./AspectFunctionArguments ./BaseRasterFunction ./surfaceUtils".split(" "),
function(m,w,v,J,F,R,P,U,D){v=class extends U{constructor(){super(...arguments);this.functionName="Aspect";this.functionArguments=null;this.rasterArgumentNames=["raster"];this.isGCS=!1}_bindSourceRasters(){var z=this.sourceRasterInfos[0];this.isGCS=z.spatialReference?.isGeographic??!1;this.outputPixelType=this._getOutputPixelType("f32");z=z.clone();z.pixelType=this.outputPixelType;z.statistics=[{min:-1,max:360,avg:180,stddev:30}];z.histograms=null;z.colormap=null;z.attributeTable=null;z.bandCount=
1;this.rasterInfo=z;return{success:!0,supportsGPU:!0}}_processPixels(z){const p=z.pixelBlocks?.[0];if(null==p)return null;const {extent:b,primaryPixelSizes:g}=z;z=g?.[0];return D.aspect(p,{resolution:null==z?b?{x:b.width/p.width,y:b.height/p.height}:{x:1,y:1}:z})}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:P,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],
v.prototype,"rasterArgumentNames",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"isGCS",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.AspectFunction")],v)})},"esri/layers/support/rasterFunctions/AspectFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/Logger ../../../core/has ../../../core/RandomLCG ../../../core/Error ../../../core/accessorSupport/decorators/subclass ./BaseFunctionArguments".split(" "),function(m,w,v,
J,F,R,P){var U;w=U=class extends P{clone(){return new U({raster:this.raster})}};return w=U=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.AspectFunctionArguments")],w)})},"esri/layers/support/rasterFunctions/surfaceUtils":function(){define(["exports","../PixelBlock","../SimpleBandStatistics","./pixelUtils"],function(m,w,v,J){function F(D){let {altitude:z,azimuth:p}=D;const {hillshadeType:b,pixelSizePower:g=1,pixelSizeFactor:h=1,scalingType:n,isGCS:l,resolution:A}=D;var t="multi-directional"===
b?2*D.zFactor:D.zFactor;const {x:r,y:a}=A;D=t/(8*r);var f=t/(8*a);l&&.001<t&&(D/=U,f/=U);"adjusted"===n&&(l?(D=r*U,f=a*U,D=(t+D**g*h)/(8*D),f=(t+f**g*h)/(8*f)):(D=(t+r**g*h)/(8*r),f=(t+a**g*h)/(8*a)));var d=(90-z)*Math.PI/180;t=Math.cos(d);let e=(360-p+90)*Math.PI/180,c=Math.sin(d)*Math.cos(e);d=Math.sin(d)*Math.sin(e);const k=[315,270,225,360,180,0],q=[60,60,60,60,60,90];var u=new Float32Array([3,5,3,2,1,4]);const G=u.reduce((M,L)=>M+L);u=u.map(M=>M/G);const y="multi-directional"===b?k.length:1,
C=new Float32Array(6),H=new Float32Array(6),x=new Float32Array(6);if("multi-directional"===b)for(let M=0;M<y;M++)z=q[M],p=k[M],d=(90-z)*Math.PI/180,t=Math.cos(d),e=(360-p+90)*Math.PI/180,c=Math.sin(d)*Math.cos(e),d=Math.sin(d)*Math.sin(e),C[M]=t,H[M]=c,x[M]=d;else C.fill(t),H.fill(c),x.fill(d);return{resolution:A,factor:[D,f],sinZcosA:c,sinZsinA:d,cosZ:t,sinZcosAs:H,sinZsinAs:x,cosZs:C,weights:u,hillshadeType:["traditional","multi-directional"].indexOf(b)}}function R(D,z){const {width:p,height:b}=
D;var g=p*b;const h=new Uint8Array(g),n=null!=D.mask;let l;if(n){l=new Uint8Array(D.mask);for(var A=0;A<l.length;A++)l[A]&&(h[A]=1,l[A]=1)}D=D.pixels[0];A=new Float32Array(g);const t=new Float32Array(g);let r=0;if(z){({resolution:a}=z);var a=a?(a.x+a.y)/2:1;r=200*z.zFactor/(a*a);a=new Float32Array(g)}z=z?.curvatureType;let f;let d;for(g=1;g<b-1;g++){const C=g*p;for(let H=1;H<p-1;H++){const x=C+H;if(!l||0!==l[x]){if(l){if(7>l[x-p-1]+l[x-p]+l[x-p+1]+l[x-1]+l[x+1]+l[x+p-1]+l[x+p]+l[x+p+1]){h[x]=0;continue}var e=
l[x-p-1]?D[x-p-1]:D[x];var c=l[x-p]?D[x-p]:D[x];var k=l[x-p+1]?D[x-p+1]:D[x];var q=l[x-1]?D[x-1]:D[x];var u=l[x+1]?D[x+1]:D[x];f=l[x+p-1]?D[x+p-1]:D[x];var G=l[x+p]?D[x+p]:D[x];d=l[x+p+1]?D[x+p+1]:D[x]}else e=D[x-p-1],c=D[x-p],k=D[x-p+1],q=D[x-1],u=D[x+1],f=D[x+p-1],G=D[x+p],d=D[x+p+1];A[x]=k+u+u+d-(e+q+q+f);t[x]=f+G+G+d-(e+c+c+k);if(null!=a){var y=D[x];const M=.5*(q+u)-y;y=.5*(c+G)-y;"standard"===z?a[x]=-r*(M+y):(e=(-e+k+f-d)/4,q=(-q+u)/2,c=(c-G)/2,G=q*q,u=c*c,(k=G+u)&&(a[x]="profile"===z?r*(M*G+
y*u+e*q*c)/k:-r*(M*u+y*G-e*q*c)/k))}}}}return{outMask:n?h:null,dzxs:A,dzys:t,curvatures:a}}function P(D,z,p){for(var b=0;b<p;b++)D[b*z]=D[b*z+1],D[(b+1)*z-1]=D[(b+1)*z-2];for(b=1;b<z-1;b++)D[b]=D[b+z],D[b+(p-1)*z]=D[b+(p-2)*z]}const U=1/111E3;m.aspect=function(D,z={}){if(!J.isValidPixelBlock(D))return D;var {resolution:p}=z;z=p?1/p.x:1;p=p?1/p.y:1;const {dzxs:b,dzys:g,outMask:h}=R(D),{width:n,height:l}=D,A=new Float32Array(n*l);for(let r=1;r<l-1;r++){const a=r*n;for(let f=1;f<n-1;f++){var t=a+f;if(!h||
h[t]){const d=b[t]*z;t=g[t]*p;let e=-1;if(0!==d||0!==t)e=90-57.29578*Math.atan2(t,-d),0>e&&(e+=360),360===e?e=0:360<e&&(e%=360);A[a+f]=e}}}P(A,n,l);return new w({width:n,height:l,pixels:[A],mask:h,pixelType:"f32",validPixelCount:D.validPixelCount,statistics:[new v.SimpleBandStatistics(-1,360)]})};m.calculateHillshadeParams=F;m.curvature=function(D,z){if(!J.isValidPixelBlock(D))return D;const {curvatures:p,outMask:b}=R(D,z),{width:g,height:h}=D;P(p,g,h);D=new w({width:g,height:h,pixels:[p],mask:b,
pixelType:"f32",validPixelCount:D.validPixelCount});D.updateStatistics();return D};m.gcsFactor=U;m.hillshade=function(D,z){if(!J.isValidPixelBlock(D))return D;const {factor:p,sinZcosA:b,sinZsinA:g,cosZ:h,sinZcosAs:n,sinZsinAs:l,cosZs:A,weights:t}=F(z),[r,a]=p;z="traditional"===z.hillshadeType;const {width:f,height:d}=D,e=new Uint8Array(f*d),{dzxs:c,dzys:k,outMask:q}=R(D);for(let G=1;G<d-1;G++){const y=G*f;for(let C=1;C<f-1;C++){const H=y+C;if(!q||q[H]){var u=c[H]*r;const x=k[H]*a,M=Math.sqrt(1+u*
u+x*x);let L=0;if(z)u=255*(h+g*x-b*u)/M,0>u&&(u=0),L=u;else{const N=l.length;for(let E=0;E<N;E++){let I=255*(A[E]+l[E]*x-n[E]*u)/M;0>I&&(I=0);L+=I*t[E]}}e[H]=L&255}}}P(e,f,d);return new w({width:f,height:d,pixels:[e],mask:q,pixelType:"u8",validPixelCount:D.validPixelCount,statistics:[new v.SimpleBandStatistics(0,255)]})};m.slope=function(D,z){if(!J.isValidPixelBlock(D))return D;var p=z.zFactor,b=z.pixelSizePower??1,g=z.pixelSizeFactor??1;const h=z.slopeType;var n=z.isGCS;const {x:l,y:A}=z.resolution;
z=p/(8*l);let t=p/(8*A);n&&1E-4>Math.abs(p-1)&&(z/=U,t/=U);"adjusted"===h&&(z=(p+l**b*g)/(8*l),t=(p+A**b*g)/(8*A));const {dzxs:r,dzys:a,outMask:f}=R(D),{width:d,height:e}=D;p=new Float32Array(d*e);for(b=1;b<e-1;b++)for(g=b*d,n=1;n<d-1;n++){var c=g+n;if(!f||f[c]){var k=r[c]*z;c=a[c]*t;k=Math.sqrt(k*k+c*c);p[g+n]="percent-rise"===h?100*k:57.2957795*Math.atan(k)}}P(p,d,e);D=new w({width:d,height:e,pixels:[p],mask:f,pixelType:"f32",validPixelCount:D.validPixelCount});D.updateStatistics();return D};m.tintHillshade=
function(D,z,p,b){if(J.isValidPixelBlock(D)&&J.isValidPixelBlock(z)){var {min:g,max:h}=b;b=D.pixels[0];var {pixels:n,mask:l}=z;z=n[0];var A=255.00001/(h-g),t=new Uint8ClampedArray(z.length),r=new Uint8ClampedArray(z.length),a=new Uint8ClampedArray(z.length),f=p.length-1;for(let c=0;c<z.length;c++){if(l&&0===l[c])continue;var d=Math.floor((z[c]-g)*A);const [k,q]=p[0>d?0:d>f?f:d];var e=b[c];d=e*q;const u=d*(1-Math.abs(k%2-1));e-=d;switch(Math.floor(k)){case 0:t[c]=d+e;r[c]=u+e;a[c]=e;break;case 1:t[c]=
u+e;r[c]=d+e;a[c]=e;break;case 2:t[c]=e;r[c]=d+e;a[c]=u+e;break;case 3:t[c]=e;r[c]=u+e;a[c]=d+e;break;case 4:t[c]=u+e;r[c]=e;a[c]=d+e;break;case 5:case 6:t[c]=d+e,r[c]=e,a[c]=u+e}}D.pixels=[t,r,a];D.updateStatistics()}};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/BandArithmeticFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BandArithmeticFunctionArguments ./bandIndexUtils ./BaseRasterFunction".split(" "),
function(m,w,v,J,F,R,P,U,D){const z=new Set(["vari","mtvi2","rtvi-core","evi"]);v=class extends D{constructor(){super(...arguments);this.functionName="BandArithmetic";this.functionArguments=null;this.rasterArgumentNames=["raster"]}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");var p=this.sourceRasterInfos[0];if(2>p.bandCount)return{success:!1,supportsGPU:!1,error:"band-arithmetic-function: source raster has insufficient amount of raster bands"};p=p.clone();p.pixelType=this.outputPixelType;
p.bandCount="sultan"===this.functionArguments.method?3:1;this._removeStatsHistColormapVAT(p);p.keyProperties={...p.keyProperties,BandProperties:void 0};this.rasterInfo=p;return{success:!0,supportsGPU:!["custom","gvitm","sultan"].includes(this.functionArguments.method)}}_processPixels(p){p=p.pixelBlocks?.[0];if(null==p)return p;const {method:b,bandIndexes:g}=this.functionArguments,h=g.split(" ").map(n=>parseFloat(n));return U.calculateBandIndex(p,{method:b,bandIndexes:h,equation:g})}_getWebGLParameters(){const p=
this.functionArguments.bandIndexes.split(" ").map(n=>parseFloat(n)-1);2===p.length&&p.push(0);var b=this.isInputBandIdsSwizzled?[0,1,2]:p;const g=new Float32Array(3);({method:h}=this.functionArguments);switch(h){case "gndvi":case "nbr":case "ndbi":case "ndvi":case "ndvi-re":case "ndsi":case "ndmi":case "mndwi":b=U.getBandMatrix3([b[0],b[1],0]);var h="ndxi";break;case "ndwi":b=U.getBandMatrix3([b[1],b[0],0]);h="ndxi";break;case "sr":case "sr-re":case "iron-oxide":case "ferrous-minerals":case "clay-minerals":b=
U.getBandMatrix3([b[0],b[1],0]);h="sr";break;case "ci-g":case "ci-re":b=U.getBandMatrix3([b[0],b[1],0]);h="ci";break;case "savi":b=U.getBandMatrix3([b[0],b[1],0]);h="savi";g[0]=p[2]+1;break;case "tsavi":b=U.getBandMatrix3([b[0],b[1],0]);h="tsavi";g[0]=p[2]+1;g[1]=p[3]+1;g[2]=p[4]+1;break;case "msavi":b=U.getBandMatrix3([b[0],b[1],0]);h="msavi";break;case "gemi":b=U.getBandMatrix3([b[0],b[1],0]);h="gemi";break;case "pvi":b=U.getBandMatrix3([b[0],b[1],0]);h="tsavi";g[0]=p[2]+1;g[1]=p[3]+1;break;case "vari":b=
U.getBandMatrix3([b[0],b[1],b[2]]);h="vari";break;case "mtvi2":b=U.getBandMatrix3([b[0],b[1],b[2]]);h="mtvi";break;case "rtvi-core":b=U.getBandMatrix3([b[0],b[1],b[2]]);h="rtvicore";break;case "evi":b=U.getBandMatrix3([b[0],b[1],b[2]]);h="evi";break;case "wndwi":b=U.getBandMatrix3([b[0],b[1],0]);h="wndwi";g[0]=p[3]?p[3]+1:.5;break;case "bai":b=U.getBandMatrix3([b[1],b[0],0]);h="bai";break;default:b=U.getBandMatrix3([0,1,2]),h="custom"}return{bandIndexMat3:b,indexType:h,adjustments:g}}_getInputBandIds(p){if("custom"===
this.functionArguments.method)return p;var b=this.functionArguments.bandIndexes.split(" ").map(n=>parseFloat(n)-1);const g=p.length;b=b.map(n=>n>=g?g-1:n);const h=z.has(this.functionArguments.method)?3:2;b=b.slice(0,h).map(n=>p[n]);2===b.length&&b.push(0);return b}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:P,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],
v.prototype,"rasterArgumentNames",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.BandArithmeticFunction")],v)})},"esri/layers/support/rasterFunctions/BandArithmeticFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/lang ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass ./bandIndexUtils ./BaseFunctionArguments".split(" "),
function(m,w,v,J,F,R,P,U,D){var z;J=z=class extends D{constructor(){super(...arguments);this.method="custom"}clone(){return new z({method:this.method,bandIndexes:this.bandIndexes,raster:w.clone(this.raster)})}};m.__decorate([v.property({json:{type:String,write:!0}})],J.prototype,"bandIndexes",void 0);m.__decorate([R.enumeration(U.bandIndexMethodMap)],J.prototype,"method",void 0);return J=z=m.__decorate([P.subclass("esri.layers.support.rasterFunctions.BandArithmeticFunctionArguments")],J)})},"esri/layers/support/rasterFunctions/bandIndexUtils":function(){define(["exports",
"../../../core/jsonMap","../PixelBlock","./customBandIndexUtils","./pixelUtils"],function(m,w,v,J,F){function R(d,e,c){const k=c.length,q=new Float32Array(k);for(let u=0;u<k;u++)if(null==d||d[u]){const G=e[u],y=c[u],C=G+y;C&&(q[u]=(G-y)/C)}return[q]}function P(d,e,c){const k=c.length,q=new Float32Array(k);for(let u=0;u<k;u++)if(null==d||d[u]){const G=e[u],y=c[u];y&&(q[u]=G/y)}return[q]}function U(d,e,c){const k=e.length,q=new Float32Array(k);for(let u=0;u<k;u++)if(null==d||d[u]){const G=e[u],y=c[u];
y&&(q[u]=G/y-1)}return[q]}function D(d,e,c,k){const q=c.length,u=new Float32Array(q);for(let G=0;G<q;G++)if(null==d||d[G]){const y=c[G],C=e[G],H=C+y+k;H&&(u[G]=(C-y)/H*(1+k))}return[u]}function z(d,e,c,k,q,u){const G=c.length,y=new Float32Array(G);u=-q*k+u*(1+k*k);for(let C=0;C<G;C++)if(null==d||d[C]){const H=c[C],x=e[C],M=q*x+H+u;M&&(y[C]=k*(x-k*H-q)/M)}return[y]}function p(d,e,c){const k=c.length,q=new Float32Array(k);for(let u=0;u<k;u++)if(null==d||d[u]){const G=e[u],y=2*G+1;q[u]=.5*(y-Math.sqrt(y*
y-8*(G-c[u])))}return[q]}function b(d,e,c){const k=c.length,q=new Float32Array(k);for(let G=0;G<k;G++)if(null==d||d[G]){const y=c[G];var u=e[G];1!==y&&0!==u+y+.5&&(u=(2*(u*u-y*y)+1.5*u+.5*y)/(u+y+.5),q[G]=u*(1-.25*u)-(y-.125)/(1-y))}return[q]}function g(d,e,c,k,q){const u=c.length,G=new Float32Array(u),y=1/Math.sqrt(1+k*k);for(let C=0;C<u;C++)if(null==d||d[C])G[C]=(e[C]-k*c[C]-q)*y;return[G]}function h(d,e){const [c,k,q,u,G,y]=e;e=c.length;const C=new Float32Array(e);for(let H=0;H<e;H++)if(null==
d||d[H])C[H]=-.2848*c[H]-.2435*k[H]-.5436*q[H]+.7243*u[H]+.084*G[H]-.18*y[H];return[C]}function n(d,e){const [c,k,q,u,G]=e;e=c.length;const y=new Float32Array(e),C=new Float32Array(e),H=new Float32Array(e);for(let x=0;x<e;x++)if(null==d||d[x])y[x]=G[x]?u[x]/G[x]*100:0,C[x]=c[x]?u[x]/c[x]*100:0,H[x]=q[x]?k[x]/q[x]*(u[x]/q[x])*100:0;return[y,C,H]}function l(d,e){const [c,k,q]=e;e=c.length;const u=new Float32Array(e);for(let G=0;G<e;G++)if(null==d||d[G])for(G=0;G<e;G++){const y=c[G],C=k[G],H=C+y-q[G];
H&&(u[G]=(C-y)/H)}return[u]}function A(d,e){const [c,k,q]=e;e=c.length;const u=new Float32Array(e);for(let G=0;G<e;G++)if(null==d||d[G])for(G=0;G<e;G++){const y=c[G],C=k[G],H=q[G],x=Math.sqrt((2*y+1)**2-(6*y-5*Math.sqrt(C))-.5);x&&(u[G]=1.5*(1.2*(y-H)-2.5*(C-H))/x)}return[u]}function t(d,e){const [c,k,q]=e;e=c.length;const u=new Float32Array(e);for(let G=0;G<e;G++)if(null==d||d[G])for(G=0;G<e;G++){const y=c[G];u[G]=100*(y-k[G])-10*(y-q[G])}return[u]}function r(d,e){const [c,k,q]=e;e=c.length;const u=
new Float32Array(e);for(let G=0;G<e;G++)if(null==d||d[G])for(G=0;G<e;G++){const y=c[G],C=k[G],H=y+6*C-7.5*q[G]+1;H&&(u[G]=2.5*(y-C)/H)}return[u]}function a(d,e,c=.5){const [k,q,u]=e;e=q.length;const G=new Float32Array(e);for(let y=0;y<e;y++)if(null==d||d[y])for(y=0;y<e;y++){const C=k[y],H=q[y],x=u[y],M=C+c*H+(1-c)*x;M&&(G[y]=(C-c*H-(1-c)*x)/M)}return[G]}function f(d,e,c){const k=c.length,q=new Float32Array(k);for(let u=0;u<k;u++)if(null==d||d[u])for(u=0;u<k;u++){const G=(.1-e[u])**2+(.06-c[u])**2;
G&&(q[u]=1/G)}return[q]}w=new w.JSONMap({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});m.bandIndexMethodMap=w;m.calculateBandIndex=function(d,e){if(!F.isValidPixelBlock(d))return d;const {equation:c,
method:k}=e;e=e.bandIndexes.map(y=>y-1);const {pixels:q,mask:u}=d;switch(k){case "gndvi":case "nbr":case "ndbi":case "ndvi":case "ndvi-re":case "ndsi":case "ndmi":case "mndwi":e=R(u,q[e[0]],q[e[1]]);break;case "ndwi":e=R(u,q[e[1]],q[e[0]]);break;case "sr":case "sr-re":case "iron-oxide":case "ferrous-minerals":case "clay-minerals":e=P(u,q[e[0]],q[e[1]]);break;case "ci-g":case "ci-re":e=U(u,q[e[0]],q[e[1]]);break;case "savi":e=D(u,q[e[0]],q[e[1]],e[2]+1);break;case "tsavi":e=z(u,q[e[0]],q[e[1]],e[2]+
1,e[3]+1,e[4]+1);break;case "msavi":e=p(u,q[e[0]],q[e[1]]);break;case "gemi":e=b(u,q[e[0]],q[e[1]]);break;case "pvi":e=g(u,q[e[0]],q[e[1]],e[2]+1,e[3]+1);break;case "gvitm":e=h(u,[q[e[0]],q[e[1]],q[e[2]],q[e[3]],q[e[4]],q[e[5]]]);break;case "sultan":e=n(u,[q[e[0]],q[e[1]],q[e[2]],q[e[3]],q[e[4]]]);break;case "vari":e=l(u,[q[e[0]],q[e[1]],q[e[2]]]);break;case "mtvi2":e=A(u,[q[e[0]],q[e[1]],q[e[2]]]);break;case "rtvi-core":e=t(u,[q[e[0]],q[e[1]],q[e[2]]]);break;case "evi":e=r(u,[q[e[0]],q[e[1]],q[e[2]]]);
break;case "wndwi":e=a(u,[q[e[0]],q[e[1]],q[e[2]]],e[3]?e[3]+1:.5);break;case "bai":e=f(u,q[e[0]],q[e[1]]);break;case "custom":e=J.calculateCustomBandIndex(u,q,c);break;default:return d}const G=null!=u?new Uint8Array(u.length):null;null!=u&&null!=G&&G.set(u);d=new v({width:d.width,height:d.height,pixelType:"f32",pixels:e,mask:G});d.updateStatistics();return d};m.calculateNDVI=function(d,e,c,k){const {mask:q,pixels:u,width:G,height:y}=d;d=u[c];e=u[e];c=e.length;const C=k?new Uint8Array(c):new Float32Array(c),
H=k?100:1,x=k?100.5:0;for(let M=0;M<c;M++)if(null==q||q[M]){const L=d[M],N=e[M],E=L+N;E&&(C[M]=(L-N)/E*H+x)}k=new v({width:G,height:y,mask:q,pixelType:k?"u8":"f32",pixels:[C]});k.updateStatistics();return k};m.getBandMatrix3=function(d){const e=new Float32Array(9);e[3*d[0]]=1;e[3*d[1]+1]=1;e[3*d[2]+2]=1;return e};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/customBandIndexUtils":function(){define(["exports","../../../core/has"],function(m,w){function v(F,
R){return F.toLowerCase().startsWith("b")?R[parseInt(F.slice(1),10)-1]:parseFloat(F)}const J=new Set("+-*/()".split(""));m.calculateCustomBandIndex=function(F,R,P){P=P.replaceAll(" ","");P.startsWith("-")&&(P="0"+P);P.startsWith("+")&&(P=P.slice(1,P.length));P=P.split("");var U=[],D=[],z="";for(var p=0;p<P.length;p++){const n=P[p];J.has(n)?(z.length&&D.push(v(z,R)),U.push(n),z=""):z=z.concat(n)}z.length&&D.push(v(z,R));let {ops:b,nums:g}={ops:U,nums:D};if(0===b.length){F=1===g.length?g[0]:R[0];if(F instanceof
Float32Array)return[F];var h=new Float32Array(R[0].length);"number"===typeof F?h.fill(F):h.set(F);return[h]}for(;0<b.length;){h=b;if(1===h.length)h={opIndex:0,numIndex:0};else{U=P=0;for(R=0;R<h.length;R++)if("("===h[R])P=R;else if(")"===h[R]){U=R;break}D=0===U?h:h.slice(P+1,U);R=-1;for(z=0;z<D.length;z++)if("*"===D[z]||"/"===D[z]){R=z;break}if(!(-1<R))for(z=0;z<D.length;z++)if("+"===D[z]||"-"===D[z]){R=z;break}0<U&&(R+=P+1);P=0;for(U=0;U<R;U++)"("===h[U]&&P++;h={opIndex:R,numIndex:R-P}}const {numIndex:n,
opIndex:l}=h;U=P=R=void 0;h=F;z=b[l];D=g[n];p=g[n+1];if("number"===typeof D&&"number"===typeof p)h=D+p;else{"number"===typeof D?(R=p,U=R.length,P=new Float32Array(U),P.fill(D)):(U=D.length,P=D,p.constructor===Number?(R=new Float32Array(U),R.fill(p)):R=p);D=new Float32Array(U);switch(z){case "+":for(z=0;z<U;z++)if(null==h||h[z])D[z]=P[z]+R[z];break;case "-":for(z=0;z<U;z++)if(null==h||h[z])D[z]=P[z]-R[z];break;case "*":for(z=0;z<U;z++)if(null==h||h[z])D[z]=P[z]*R[z];break;case "/":for(z=0;z<U;z++)(null==
h||h[z])&&R[z]&&(D[z]=P[z]/R[z]);break;case "(":case ")":throw Error("encountered error with custom band index equation");}h=D}if(1===b.length)break;else{R=b;R.splice(l,1);U=P=0;do{U=P=0;for(D=0;D<R.length;D++)if("("===R[D])P=D;else if(")"===R[D]){U=D;break}U===P+1&&R.splice(P,2)}while(U===P+1);b=R;g.splice(n,2,h)}}return[h]};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/ClipFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseRasterFunction ./ClipFunctionArguments".split(" "),
function(m,w,v,J,F,R,P,U){v=class extends P{constructor(){super(...arguments);this.functionName="Clip";this.functionArguments=null;this.rasterArgumentNames=["raster"];this.isNoopProcess=!0}_bindSourceRasters(){const D=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(D.pixelType);D.pixelType=this.outputPixelType;this.rasterInfo=D;return{success:!0,supportsGPU:!0}}_processPixels(D){return D.pixelBlocks?.[0]}_getWebGLParameters(){const {clippingGeometry:D,clippingType:z}=
this.functionArguments;return{clippingGeometry:D.toJSON(),clippingType:z}}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:U,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",void 0);m.__decorate([w.property()],v.prototype,"isNoopProcess",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.ClipFunction")],
v)})},"esri/layers/support/rasterFunctions/ClipFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../geometry ../../../core/jsonMap ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/support/jsonUtils ./BaseFunctionArguments".split(" "),function(m,w,v,J,F,R,P,U,D,z){var p;v=new v.JSONMap({1:"outside",2:"inside"},{useNumericKeys:!0});z=p=class extends z{constructor(){super(...arguments);
this.clippingType="outside"}clone(){return new p({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};m.__decorate([J.property({types:w.geometryTypes,json:{read:D.fromJSON,write:!0}})],z.prototype,"clippingGeometry",void 0);m.__decorate([J.property({json:{read:v.read,write:v.write}})],z.prototype,"clippingType",void 0);return z=p=m.__decorate([U.subclass("esri.layers.support.rasterFunctions.ClipFunctionArguments")],z)})},"esri/layers/support/rasterFunctions/ColormapFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../rasterFormats/pixelRangeUtils ./BaseRasterFunction ./ColormapFunctionArguments ./colormaps ../../../renderers/support/colorRampUtils ../../../rest/support/colorRamps".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b){v=class extends U{constructor(){super(...arguments);this.functionName="Colormap";this.functionArguments=null;this.rasterArgumentNames=["raster"];this.isNoopProcess=!0}_bindSourceRasters(){var g=this.sourceRasterInfos[0];if(1<g.bandCount)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let {colormap:h,colormapName:n,colorRamp:l,colorRampName:A}=this.functionArguments;if(!h?.length)if(l)this.colorRamp=l,h=p.convertColorRampToColormap(l,
{interpolateAlpha:!0});else if(A){var t=p.getColorRampJSON(A);t&&(h=p.convertColorRampToColormap(t),this.colorRamp=b.fromJSON(t))}else n&&(h=z.getColormapByName(n));if(!h?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};t=this._getOutputPixelType(g.pixelType);this.outputPixelType=t.startsWith("f")?"s32":t;g=g.clone();g.pixelType=this.outputPixelType;g.colormap=h;g.bandCount=1;this.rasterInfo=g;return{success:!0,supportsGPU:!0}}_processPixels(g){g=g.pixelBlocks?.[0];
if(!g||P.isIntegerPixelType(g.pixelType))return g;g=g.clone();g.clamp(this.outputPixelType);return g}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:D,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",void 0);m.__decorate([w.property()],v.prototype,"isNoopProcess",void 0);m.__decorate([w.property({json:{write:!0}})],
v.prototype,"indexedColormap",void 0);m.__decorate([w.property()],v.prototype,"colorRamp",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.ColormapFunction")],v)})},"esri/layers/support/rasterFunctions/ColormapFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/lang ../../../core/accessorSupport/decorators/property ../../../core/accessorSupport/decorators/cast ../../../core/accessorSupport/decorators/reader ../../../core/accessorSupport/decorators/subclass ./BaseFunctionArguments ../../../renderers/support/colorRampUtils ../../../rest/support/colorRamps".split(" "),
function(m,w,v,J,F,R,P,U,D){var z;P=z=class extends P{castColormapName(p){if(!p)return null;p=p.toLowerCase();return U.rasterColormapNames.includes(p)?p:null}readColorRamp(p){return D.fromJSON(p)}readColorRampName(p,b){return p?(b=U.colorRampDict.jsonValues.find(g=>g.toLowerCase()===p.toLowerCase()))?U.colorRampDict.fromJSON(b):null:null}clone(){return new z({colormap:w.clone(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};m.__decorate([v.property({type:[[Number]],
json:{write:!0}})],P.prototype,"colormap",void 0);m.__decorate([v.property({type:String,json:{write:!0}})],P.prototype,"colormapName",void 0);m.__decorate([J.cast("colormapName")],P.prototype,"castColormapName",null);m.__decorate([v.property({types:D.types,json:{write:!0}})],P.prototype,"colorRamp",void 0);m.__decorate([F.reader("colorRamp")],P.prototype,"readColorRamp",null);m.__decorate([v.property({type:U.colorRampDict.apiValues,json:{type:U.colorRampDict.jsonValues,write:U.colorRampDict.write}})],
P.prototype,"colorRampName",void 0);m.__decorate([F.reader("colorRampName")],P.prototype,"readColorRampName",null);return P=z=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],P)})},"esri/layers/support/rasterFunctions/colormaps":function(){define(["exports","../../../renderers/support/colorRampUtils"],function(m,w){function v(U,D){const z=[],p=[];for(let b=0;b<U.length-1;b++)z.push({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:U[b].slice(1),toColor:U[b+
1].slice(1)}),p.push(U[b+1][0]-U[b][0]);U=U[U.length-1][0];D=D??p;return w.convertColorRampToColors({type:"multipart",colorRamps:z},{numColors:U,weights:D})}function J(){const U=v([[0,255,255,255],[70,0,255,0],[80,205,173,193],[100,150,150,150],[110,120,51,100],[130,120,100,200],[140,28,3,144],[160,6,0,55],[180,10,25,30],[201,6,7,27]]);for(let D=U.length;256>D;D++)U.push([6,27,7]);return U}function F(){const U=[];for(let D=0;256>D;D++){const z=[];for(let p=0;3>p;p++)z.push(Math.round(255*Math.random()));
U.push(z)}return U}const R=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,
5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,
111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,
247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,
101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,
57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],P=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,
0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,
0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,
238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,
173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,
130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],
[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];m.getColormapByName=function(U){let D;switch(U){case "elevation":D=v([[0,0,191,191],[51,0,0,255],[102,255,0,255],[153,255,0,127],[204,191,63,127],[256,
20,20,20]]);break;case "gray":D=w.convertColorRampToColors({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:[0,0,0],toColor:[255,255,255]});break;case "hillshade":D=v([[0,38,41,54],[69,79,82,90],[131,156,156,156],[256,253,253,241]],[.268,.238,.495]);break;case "ndvi":D=R;break;case "ndvi2":D=J();break;case "ndvi3":D=P;break;case "random":D=F()}return D?D=D.map((z,p)=>[p,...z]):null};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/CompositeBandFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseRasterFunction ./CompositeBandFunctionArguments ./pixelUtils".split(" "),
function(m,w,v,J,F,R,P,U,D){v=class extends P{constructor(){super(...arguments);this.functionName="CompositeBand";this.functionArguments=null;this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){var {sourceRasterInfos:z}=this,p=z[0];this.outputPixelType=this._getOutputPixelType(p.pixelType);p=p.clone();p.attributeTable=null;p.colormap=null;p.pixelType=this.outputPixelType;p.bandCount=z.map(({bandCount:b})=>b).reduce((b,g)=>b+g);if(z.every(({statistics:b})=>null!=b&&b.length)){const b=[];z.forEach(({statistics:g})=>
null!=g&&b.push(...g));p.statistics=b}if(z.every(({histograms:b})=>null!=b&&b.length)){const b=[];z.forEach(({histograms:g})=>null!=g&&b.push(...g));p.histograms=b}1<p.bandCount&&(p.colormap=null,p.attributeTable=null);z=z.every(b=>b.keyProperties.BandProperties?.length)?z.flatMap(b=>b.keyProperties.BandProperties):void 0;p.keyProperties={...p.keyProperties,BandProperties:z};this.rasterInfo=p;return{success:!0,supportsGPU:3>=p.bandCount}}_processPixels(z){({pixelBlocks:z}=z);return z&&null!=z?.[0]?
D.compositeBands(z):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:U,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.CompositeBandFunction")],v)})},"esri/layers/support/rasterFunctions/CompositeBandFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/lang ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/accessorSupport/decorators/subclass ../../../core/accessorSupport/decorators/writer ./BaseFunctionArguments".split(" "),
function(m,w,v,J,F,R,P,U){var D;J=D=class extends U{constructor(){super(...arguments);this.rasters=[]}writeRasters(z,p){p.rasters=z.map(b=>"number"===typeof b||"string"===typeof b?b:b.toJSON())}clone(){return new D({rasters:w.clone(this.rasters)})}};m.__decorate([v.property({json:{write:!0}})],J.prototype,"rasters",void 0);m.__decorate([P.writer("rasters")],J.prototype,"writeRasters",null);return J=D=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],J)})},
"esri/layers/support/rasterFunctions/ComputeChangeFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../Field ../rasterFormats/pixelRangeUtils ./BaseRasterFunction ./changeDetectionUtils ./ComputeChangeFunctionArguments".split(" "),function(m,w,v,J,F,R,P,U,D,z,p){v=class extends D{constructor(){super(...arguments);this.functionName=
"ComputeChange";this.functionArguments=null;this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const {method:b}=this.functionArguments,g=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(g.pixelType);g.pixelType=this.outputPixelType;this._removeStatsHistColormapVAT(g);if("categorical"===b){var h=this.sourceRasterInfos.map(l=>l.attributeTable);const n=this._getFieldNames(h,"value");h=h.map(l=>this._getClassFieldName(l));if(null==n[0]||null==n[1]||null==
h[0]||null==h[1])return{success:!1,supportsGPU:!1,error:"both inputs must have proper attribute table with value and class fields"};this._updateAttributeTable(g,n,h)}g.bandCount=1;this.rasterInfo=g;return{success:!0,supportsGPU:"difference"===b||"relative-difference"===b}}_processPixels(b){({pixelBlocks:b}=b);if(null==b?.[0]||null==b?.[1])return null;const {method:g}=this.functionArguments;return z.computeChange(b,g,this.outputPixelType,this._categoryConfig)}_getWebGLParameters(){var b=this.outputPixelType??
"f32";let [g,h]=U.getPixelValueRange(b);if(b=U.isIntegerPixelType(b))g-=1E-4,h+=1E-4;return{method:this.functionArguments.method,domainRange:[g,h],isOutputRounded:b}}_updateAttributeTable(b,g,h){var n=this.sourceRasterInfos.map(G=>G.attributeTable),l=n.map((G,y)=>G.features.map(C=>C.attributes[g[y]])),A=n.map((G,y)=>G.features.map(C=>C.attributes[h[y]])),t=l.map(G=>{const y=[];G.forEach((C,H)=>y[C]=H);return y});const {keepMethod:r}=this.functionArguments;this._categoryConfig={categoryIndexLookups:t,
classNames:A,keepMethod:r};t=n[0].clone();t.fields=[new P({name:"OID",type:"oid"}),new P({name:"Value",type:"integer"}),new P({name:"ClassName",type:"string"}),new P({name:"Class_From",type:"string"}),new P({name:"Class_To",type:"string"})];const a=this._getFieldNames(n,"red"),f=this._getFieldNames(n,"green"),d=this._getFieldNames(n,"blue"),e=[],c=2===a.length&&2===f.length&&2===d.length;c&&(e.push(...n.map((G,y)=>G.features.map(C=>[C.attributes[a[y]],C.attributes[f[y]],C.attributes[d[y]]]))),t.fields.push(new P({name:"Red",
type:"integer"}),new P({name:"Green",type:"integer"}),new P({name:"Blue",type:"integer"})));const k=t.features[0].clone();k.geometry=null;n=[];const [q,u]=l.map(G=>G.length);l=1;for(let G=0;G<q;G++){const y=A[0][G];for(let C=0;C<u;C++){const H=A[1][C];if("changed"===r&&y===H||"unchanged"===r&&y!==H)continue;const x=k.clone();x.attributes={OID:l++,Value:G*u+C,ClassName:y===H?y:`${y} -> ${H}`,Class_From:y,Class_To:H};c&&(x.attributes.Red=e[0][G][0]+e[1][C][0]>>1,x.attributes.Green=e[0][G][1]+e[1][C][1]>>
1,x.attributes.Blue=e[0][G][2]+e[1][C][2]>>1);n.push(x)}}"changed"===r?(A=k.clone(),A.attributes={OID:l++,Value:q*u+1,ClassName:"No Change",Class_From:"Same",Class_To:"Same"},n.push(A)):"unchanged"===r&&(A=k.clone(),A.attributes={OID:l++,Value:q*u+2,ClassName:"Changed",Class_From:"Any",Class_To:"Any"},n.push(A));t.features=n;b.attributeTable=t}_getFieldNames(b,g){return b.map(({fields:h})=>h.find(n=>n.name.toLowerCase()===g)?.name).filter(h=>h)}_getClassFieldName(b){return(b.fields.find(g=>"string"===
g.type&&g.name.toLowerCase().startsWith("class"))??b.fields.find(g=>"string"===g.type&&g.name.toLowerCase().includes("class")||g.name.toLowerCase().includes("type")||g.name.toLowerCase().includes("name"))??b.fields.find(g=>"string"===g.type))?.name}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:p,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],
v.prototype,"rasterArgumentNames",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"_categoryConfig",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.ComputeChangeFunction")],v)})},"esri/layers/support/rasterFunctions/changeDetectionUtils":function(){define(["exports","../../../core/has","../../../core/jsonMap","../PixelBlock","../rasterFormats/pixelRangeUtils"],function(m,w,v,J,F){function R(p){const {bands:[b,g],mask:h,isRelative:n,isRoundingNeeded:l,
outBand:A}=p;p=b.length;for(let t=0;t<p;t++)if(!h||h[t]){let r=b[t]-g[t];if(n){const a=Math.max(Math.abs(b[t])-Math.abs(g[t]));r=0<a?r/a:0}A[t]=l?Math.round(r):r}}function P(p){const {bands:[b,g],categoryIndexLookups:[h,n],classNames:[l,A],mask:t,keepMethod:r,outBand:a}=p;p=b.length;const f=A.length,d=l.length*f,e=d+1,c=d+2;for(let k=0;k<p;k++)if(!t||t[k]){const q=h[b[k]],u=n[g[k]],G=l[q],y=A[u];a[k]=null==q||null==u?d:"changed"===r&&G===y?e:"unchanged"===r&&G!==y?c:q*f+u}}function U(p){const {pixels:[b,
g],mask:h,outBand:n}=p;p=b[0].length;const l=b.length;for(let A=0;A<p;A++)if(!h||h[A]){let t=0;for(let r=0;r<l;r++){const a=b[r][A]-g[r][A];t+=a*a}n[A]=Math.sqrt(t)}}function D(p){const {pixels:[b,g],mask:h,outBand:n}=p;p=b[0].length;const l=b.length;for(let t=0;t<p;t++)if(!h||h[t]){let r=0;var A=0;let a=0;for(let f=0;f<l;f++){const d=b[f][t],e=g[f][t];r+=d*e;A+=d*d;a+=e*e}A=Math.sqrt(A*a);n[t]=A?Math.acos(r/A):1.5707963267948966}}function z(p){const {pixels:[b,g],mask:h,outBand:n}=p;p=b[0].length;
const l=b.length;for(let A=0;A<p;A++)if(!h||h[A]){let t=0,r=0;for(let a=0;a<l;a++){const f=Math.abs(b[a][A]-g[a][A]);f>t&&(t=f,r=a)}n[A]=r}}w=new v.JSONMap({0:"difference",1:"relative-difference",2:"categorical",3:"euclidean-distance",4:"angle-difference",5:"band-with-most-change"},{useNumericKeys:!0});v=new v.JSONMap({0:"all",1:"changed",2:"unchanged"},{useNumericKeys:!0});m.changeMethodMap=w;m.computeChange=function(p,b,g,h){const [n,l]=p,A=F.isIntegerPixelType(g)&&!F.isIntegerPixelType(n.pixelType)&&
!F.isIntegerPixelType(l.pixelType);var t=[n.mask,l.mask].filter(e=>e);t=J.combineBandMasks(t);const r=p.map(e=>e.pixels[0]),{width:a,height:f}=n,d=J.createEmptyBand(g,a*f);switch(b){case "difference":case "relative-difference":R({bands:r,mask:t,outBand:d,isRoundingNeeded:A,isRelative:"relative-difference"===b});break;case "categorical":P({bands:r,mask:t,outBand:d,...h});break;case "euclidean-distance":U({pixels:p.map(e=>e.pixels),mask:t,outBand:d});break;case "angle-difference":D({pixels:p.map(e=>
e.pixels),mask:t,outBand:d});break;case "band-with-most-change":z({pixels:p.map(e=>e.pixels),mask:t,outBand:d})}p=new J({width:a,height:f,pixels:[d],pixelType:g,mask:t});p.updateStatistics();return p};m.keepMethodMap=v;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/ComputeChangeFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass ./BaseFunctionArguments ./changeDetectionUtils".split(" "),
function(m,w,v,J,F,R,P,U,D){var z;v=z=class extends U{constructor(){super(...arguments);this.method="difference";this.keepMethod="all";this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new z({raster:this.raster,raster2:this.raster2,method:this.method,keepMethod:this.keepMethod})}};m.__decorate([R.enumeration(D.changeMethodMap)],v.prototype,"method",void 0);m.__decorate([R.enumeration(D.keepMethodMap)],v.prototype,"keepMethod",void 0);m.__decorate([w.property({json:{write:!0}})],
v.prototype,"raster2",void 0);m.__decorate([w.property({readOnly:!0})],v.prototype,"rasters",null);return v=z=m.__decorate([P.subclass("esri.layers.support.rasterFunctions.ComputeChangeFunctionArguments")],v)})},"esri/layers/support/rasterFunctions/ContrastBrightnessFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseRasterFunction ./ContrastBrightnessFunctionArguments ./pixelUtils ./stretchUtils".split(" "),
function(m,w,v,J,F,R,P,U,D,z){v=class extends P{constructor(){super(...arguments);this.functionName="ContrastBrightness";this.functionArguments=null;this.rasterArgumentNames=["raster"];this.lookup=null}_bindSourceRasters(){var {sourceRasterInfos:p}=this;p=p[0];if("u8"!==p.pixelType)return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");p=p.clone();this._removeStatsHistColormapVAT(p);this.rasterInfo=
p;const {contrastOffset:b,brightnessOffset:g}=this.functionArguments;this.lookup=z.createContrastBrightnessLUT(b,g);return{success:!0,supportsGPU:!0}}_processPixels(p){p=p.pixelBlocks?.[0];return null==p?null:D.lookupPixels(p,{lut:p.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const {contrastOffset:p,brightnessOffset:b}=this.functionArguments;return{contrastOffset:p,brightnessOffset:b}}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,
"functionName",void 0);m.__decorate([w.property({type:U,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"lookup",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],v)})},"esri/layers/support/rasterFunctions/ContrastBrightnessFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseFunctionArguments".split(" "),
function(m,w,v,J,F,R,P){var U;v=U=class extends P{constructor(){super(...arguments);this.brightnessOffset=this.contrastOffset=0}clone(){return new U({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};m.__decorate([w.property({json:{write:!0}})],v.prototype,"contrastOffset",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"brightnessOffset",void 0);return v=U=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],
v)})},"esri/layers/support/rasterFunctions/stretchUtils":function(){define(["exports","../../../core/maybe","../PixelBlock","../rasterFormats/pixelRangeUtils","../../../renderers/support/stretchRendererUtils"],function(m,w,v,J,F){function R(g,h=256){h=Math.min(h,256);const {size:n,counts:l}=g;g=new Uint8Array(n);var A=l.reduce((d,e)=>d+e/h,0);let t=0;var r=0;let a=0,f=A;for(let d=0;d<n;d++)if(a+=l[d],!(d<n-1&&a+l[d+1]<f)){for(;t<h-1&&f<a;)t++,f+=A;for(;r<=d;r++)g[r]=t;r=d+1}for(A=r;A<n;A++)g[A]=h-
1;return g}function P(g,h){g=Math.min(Math.max(g,-100),100);h=Math.min(Math.max(h??0,-100),100);let n=0,l=0;const A=new Uint8Array(256);for(n=0;256>n;n++)0<g&&100>g?l=(200*n-25500+510*h)/(2*(100-g))+128:0>=g&&-100<g?l=(200*n-25500+510*h)*(100+g)/2E4+128:100===g?(l=200*n-25500+256*(100-g)+510*h,l=0<l?255:0):-100===g&&(l=128),A[n]=255<l?255:0>l?0:l;return A}function U(g,h,n,l){l=Infinity;let A=-Infinity;var t=0,r=0,a=0,f=0;const d=g.length;var e=new Map,c=[];for(let k=0;k<d;k++){const q=g[k];if(!h||
h[k]){c.push(q);const u=(e.get(q)??0)+1;e.set(q,u);u>f&&(f=u,a=q);l=q<l?q:l;A=q>A?q:A;t+=q;r++}}if(0===r)return{statistics:{min:0,max:0,avg:0,stddev:0,mode:0,median:0},histogram:null};t/=r;f=0;for(e=0;e<d;e++)if(!h||h[e])f+=(g[e]-t)**2;e=h?h.filter(k=>k).length:d;f=1>=e?0:Math.sqrt(f/(e-1));c.sort((k,q)=>k-q);e=r>>>1;a={min:l,max:A,avg:t,stddev:f,mode:a,median:r%2?c[Math.floor(e)]:(c[e-1]+c[e])/2};if(["u8","s8","u4","u2","u1"].includes(n)){r=A-l+1;n=new Uint32Array(r);for(c=0;c<d;c++)h&&!h[c]||n[g[c]-
l]++;return{statistics:a,histogram:{min:l-.5,max:A+.5,size:r,counts:n}}}n=new Uint32Array(256);c=(A-l)/256;if(0===c)return{statistics:a,histogram:{min:l,max:A,size:1,counts:(new Uint32Array(1)).fill(r)}};r=new Uint32Array(257);for(t=0;t<d;t++)h&&!h[t]||r[Math.floor((g[t]-l)/c)]++;for(g=0;255>g;g++)n[g]=r[g];n[255]=r[255]+r[256];return{statistics:a,histogram:{min:l,max:A,size:256,counts:n}}}function D(g){if(!g?.pixels?.length)return null;const {pixels:h,mask:n,bandMasks:l,pixelType:A}=g,t=g.width*
g.height,r=h.length,a=[],f=[];let d,e;for(let H=0;H<r;H++){var c=new Uint32Array(256);var k=h[H],q=l?.[H]??n;if("u8"===A){d=255;e=0;if(q)for(var u=0;u<t;u++){if(q[u]){var G=k[u];d=G<d?G:d;e=G>e?G:e;c[G]++}}else for(q=0;q<t;q++)u=k[q],d=u<d?u:d,e=u>e?u:e,c[u]++;c=c.slice(d,e+1)}else{G=!1;g.statistics||(g.updateStatistics(),G=!0);var y=g.statistics;d=y[H].minValue;e=y[H].maxValue;u=(e-d)/256;if(0===u)for(!y||g.validPixelCount||G||g.updateStatistics(),k=(g.validPixelCount||g.width*g.height)/256,q=0;256>
q;q++)c[q]=Math.round(k*(q+1))-Math.round(k*q);else{G=new Uint32Array(257);for(y=0;y<t;y++)q&&!q[y]||G[Math.floor((k[y]-d)/u)]++;for(k=0;255>k;k++)c[k]=G[k];c[255]=G[255]+G[256]}}u="u8"===A?d-.5:d;G="u8"===A?e+.5:e;a.push({min:u,max:G,size:c.length,counts:c});q=y=k=0;for(var C=0;C<c.length;C++)k+=c[C],y+=C*c[C];y/=k;for(C=0;C<c.length;C++)q+=c[C]*(C-y)**2;c=(G-u)/c.length;f.push({min:d,max:e,avg:(y+("u8"===A?0:.5))*c+d,stddev:Math.sqrt(q/(k-1))*c})}return{statistics:f,histograms:a}}function z(g,h){if(null==
h||0===h.length)return g;const n=Math.max.apply(null,h),{minCutOff:l,maxCutOff:A,outMin:t,outMax:r,histogramLut:a}=g;return l.length===h.length||l.length<=n?g:{minCutOff:h.map(f=>l[f]),maxCutOff:h.map(f=>A[f]),histogramLut:a?h.map(f=>a[f]):null,outMin:t,outMax:r}}function p(g,h){const n=new Float32Array(g);for(let l=0;l<g;l++)n[l]=1<h[l]?2<h[l]?6.5+(h[l]-2)**2.5:6.5+100*(2-h[l])**4:1;return n}const b=[.299,.587,.114];m.computeGammaCorrection=p;m.computeGammaValues=function(g,h,n){const l=[];for(let f=
0;f<h.length;f++){var A=0,t=0,r=0;"min"in h[f]?{min:A,max:t,avg:r}=h[f]:[A,t,r]=h[f];r=r??0;"u8"!==g&&(r=255*(r-A)/(t-A));n&&(r*=b[f]);A=l;t=A.push;if(0>=r||255<=r)r=1;else{var a=0;150!==r&&(a=150>=r?45*Math.cos(.01047*r):17*Math.sin(.021*r));a=Math.log((r+a)/255);0===a?r=1:(r=Math.log(r/255)/a,r=isNaN(r)?1:Math.min(9.9,Math.max(.01,r)))}t.call(A,r)}return l};m.computeStatisticsHistograms=function(g){const {pixels:h,mask:n,pixelType:l,bandMasks:A}=g;var t=h.map((r,a)=>U(r,A?.[a]??n,l));g=t.map(({statistics:r})=>
r);t=t.map(({histogram:r})=>r);return{statistics:g,histograms:t}};m.createContrastBrightnessLUT=P;m.createHistogramEqualizationLUT=R;m.createStretchLUT=function(g){const {minCutOff:h,maxCutOff:n,gamma:l,pixelType:A,rounding:t}=g,r=g.outMin||0,a=g.outMax||255;if(!["u8","u16","s8","s16"].includes(A))return null;const f=h.length;let d,e,c=0;"s8"===A?c=-127:"s16"===A&&(c=-32767);let k=256;["u16","s16"].includes(A)&&(k=65536);var q=[],u=[];const G=a-r;for(d=0;d<f;d++)u[d]=n[d]-h[d],q[d]=0===u[d]?0:G/u[d];
let y;const C=[];let H,x;if(l&&l.length>=f)for(q=p(f,l),d=0;d<f;d++){x=[];for(e=0;e<k;e++)if(0===u[d])x[e]=r;else{var M=e+c;y=(M-h[d])/u[d];H=1;1<l[d]&&(H-=(1/G)**(y*q[d]));M<n[d]&&M>h[d]?(M=H*G*y**(1/l[d])+r,x[e]="floor"===t?Math.floor(M):"round"===t?Math.round(M):M):x[e]=M>=n[d]?a:r}C[d]=x}else for(d=0;d<f;d++){x=[];for(e=0;e<k;e++)M=e+c,M<=h[d]?x[e]=r:M>=n[d]?x[e]=a:(u=(M-h[d])*q[d]+r,x[e]="floor"===t?Math.floor(u):"round"===t?Math.round(u):u);C[d]=x}if(null!=g.contrastOffset)for(g=P(g.contrastOffset,
g.brightnessOffset),d=0;d<f;d++)for(x=C[d],e=0;e<k;e++)x[e]=g[x[e]];return{lut:C,offset:c}};m.estimateStatisticsFromHistograms=function(g){const h=[];for(let t=0;t<g.length;t++){const {min:r,max:a,size:f,counts:d}=g[t];let e=0;var n=0;for(var l=0;l<f;l++)e+=d[l],n+=l*d[l];n/=e;l=0;for(var A=0;A<f;A++)l+=d[A]*(A-n)**2;A=(a-r)/f;h.push({min:r,max:a,avg:(n+.5)*A+r,stddev:Math.sqrt(l/(e-1))*A})}return h};m.estimateStatisticsHistograms=D;m.getStretchCutoff=function(g,h){const {pixelBlock:n,bandIds:l,returnHistogramLut:A,
rasterInfo:t}=h;var r=null;h=null;var a=g.stretchType;"number"===typeof a&&(a=F.stretchTypeFunctionEnum[a]);g.dra?"minMax"===a&&n?.statistics?r=n.statistics.map(M=>[M.minValue,M.maxValue,0,0]):(h=D(n),r=null!=h?h.statistics:null,h=null!=h?h.histograms:null):(r=g.statistics?.length?g.statistics:t.statistics,h="histograms"in g?g.histograms:void 0,h||(h=t.histograms));"percentClip"!==a&&"histogramEqualization"!==a||h?.length||(a="minMax");var f=r?.length||h?.length||t.bandCount;const d=[],e=[];let c,
k,q;r&&!Array.isArray(r[0])&&(r=r.map(M=>[M.min,M.max,M.avg,M.stddev]));const [u,G]=J.getPixelValueRange(t.pixelType);if(!r?.length){r=[];for(k=0;k<f;k++)r.push([u,G,1,1]);"standardDeviation"===a&&(a="minMax")}switch(a){case "none":for(k=0;k<f;k++)d[k]=u,e[k]=G;break;case "minMax":for(k=0;k<f;k++){var y=r[k];d[k]=y[0];e[k]=y[1]}break;case "standardDeviation":({numberOfStandardDeviations:y=2}=g);for(k=0;k<f;k++){var C=r[k];d[k]=C[2]-y*C[3];e[k]=C[2]+y*C[3];d[k]<C[0]&&(d[k]=C[0]);e[k]>C[1]&&(e[k]=C[1])}break;
case "histogramEqualization":w.assertIsSome(h);for(k=0;k<f;k++)d[k]=h[k].min,e[k]=h[k].max;break;case "percentClip":w.assertIsSome(h);for(k=0;k<h.length;k++){r=h[k];C=new Uint32Array(r.size);var H=[...r.counts];20<=H.length&&(H[0]=H[1]=H[2]=H[H.length-1]=H[H.length-2]=0);y=0;f=(r.max-r.min)/r.size;c=-.5===r.min&&1===f?.5:0;for(q=0;q<r.size;q++)y+=H[q],C[q]=y;H=(g.minPercent||0)*y/100;d[k]=r.min+c;for(q=0;q<r.size;q++)if(C[q]>H){d[k]=r.min+f*(q+c);break}H=(1-(g.maxPercent||0)/100)*y;e[k]=r.max+c;for(q=
r.size-2;0<=q;q--)if(C[q]<H){e[k]=r.min+f*(q+2-c);break}e[k]<d[k]&&(r=d[k],d[k]=e[k],e[k]=r)}break;default:for(k=0;k<f;k++)y=r[k],d[k]=y[0],e[k]=y[1]}let x;"histogramEqualization"===a?(w.assertIsSome(h),a=h[0].size||256,g=0,A&&(x=h.map(M=>R(M)))):(a=g.max||255,g=g.min||0);return z({minCutOff:d,maxCutOff:e,outMax:a,outMin:g,histogramLut:x},l)};m.stretch=function(g,h){if(!g?.pixels?.length)return g;const {mask:n,bandMasks:l,width:A,height:t,pixels:r}=g,{minCutOff:a,maxCutOff:f,gamma:d}=h;var e=h.outMin||
0;const c=h.outMax||255,k=A*t,q=h.outputPixelType||"u8";g=g.pixels.map(()=>v.createEmptyBand(q,k));const u=g.length;var G=c-e,y=[],C=[];for(var H=0;H<u;H++)C[H]=f[H]-a[H],y[H]=0===C[H]?0:G/C[H];H=q.startsWith("u")||q.startsWith("s");h=!!h.isRenderer;if(d&&d.length>=u){y=p(u,d);for(var x=0;x<u;x++){var M=l?.[x]??n;for(let N=0;N<k;N++)if(null==M||M[N]){if(0===C[x]){g[x][N]=e;continue}var L=r[x][N];const E=(L-a[x])/C[x];let I=1;1<d[x]&&(I-=(1/G)**(E*y[x]));L<f[x]&&L>a[x]?(L=I*G*E**(1/d[x])+e,g[x][N]=
h?Math.floor(L):H?Math.round(L):L):g[x][N]=L>=f[x]?c:e}}}else for(G=0;G<u;G++)for(C=l?.[G]??n,x=0;x<k;x++)if(null==C||C[x])M=r[G][x],M<f[G]&&M>a[G]?(M=(M-a[G])*y[G]+e,g[G][x]=h?Math.floor(M):H?Math.round(M):M):g[G][x]=M>=f[G]?c:e;e=new v({width:A,height:t,mask:n,bandMasks:l,pixels:g,pixelType:q});e.updateStatistics();return e};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/ConvolutionFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../rasterFunctionConstants ../rasterFormats/pixelRangeUtils ./BaseRasterFunction ./ConvolutionFunctionArguments ./convolutionUtils".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p){v=class extends D{constructor(){super(...arguments);this.functionName="Convolution";this.rasterArgumentNames=["raster"]}get _normalizedKernel(){const {kernel:b,convolutionType:g}=this.functionArguments,h=b.reduce((n,l)=>n+l);return-1===g||0===h||1===h?b:b.map(n=>n/h)}_bindSourceRasters(){const {convolutionType:b,rows:g,cols:h,kernel:n}=this.functionArguments;if(!Object.values(P.convolutionKernel).includes(b))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${b}`};
if(b!==P.convolutionKernel.none&&g*h!==n.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};var l=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(l.pixelType);l=l.clone();l.pixelType=this.outputPixelType;const A=[P.convolutionKernel.none,P.convolutionKernel.sharpen,P.convolutionKernel.sharpen2,P.convolutionKernel.sharpening3x3,P.convolutionKernel.sharpening5x5];if(-1===b||"u8"!==this.outputPixelType&&
!A.includes(b))l.statistics=null,l.histograms=null;l.colormap=null;l.attributeTable=null;this.rasterInfo=l;return{success:!0,supportsGPU:25>=n.length}}_processPixels(b){b=b.pixelBlocks?.[0];if(null==b||this.functionArguments.convolutionType===P.convolutionKernel.none)return b;const {rows:g,cols:h}=this.functionArguments,{_normalizedKernel:n}=this;return p.convolute(b,{kernel:n,rows:g,cols:h,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const b=new Float32Array(25);b.set(this._normalizedKernel);
return{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:b,clampRange:U.getPixelValueRange(this.outputPixelType)}}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:z,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",void 0);m.__decorate([w.property()],v.prototype,"_normalizedKernel",
null);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.ConvolutionFunction")],v)})},"esri/layers/support/rasterFunctions/ConvolutionFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/lang ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/accessorSupport/decorators/subclass ../rasterFunctionConstants ./BaseFunctionArguments ./convolutionUtils".split(" "),function(m,w,v,J,F,R,P,U,D){var z;J=z=class extends U{constructor(){super(...arguments);
this.cols=this.rows=3;this.kernel=[0,0,0,0,1,0,0,0,0]}set convolutionType(p){this._set("convolutionType",p);const b=D.convolutionKernels.get(p);b&&p!==P.convolutionKernel.userDefined&&p!==P.convolutionKernel.none&&(p=Math.sqrt(b.length),this._set("kernel",b),this._set("cols",p),this._set("rows",p))}clone(){return new z({cols:this.cols,rows:this.rows,kernel:[...this.kernel],convolutionType:this.convolutionType,raster:w.clone(this.raster)})}};m.__decorate([v.property({json:{type:Number,write:!0}})],
J.prototype,"rows",void 0);m.__decorate([v.property({json:{type:Number,write:!0}})],J.prototype,"cols",void 0);m.__decorate([v.property({json:{name:"type",type:Number,write:!0}})],J.prototype,"convolutionType",null);m.__decorate([v.property({json:{type:[Number],write:!0}})],J.prototype,"kernel",void 0);return J=z=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.ConvolutionFunctionArguments")],J)})},"esri/layers/support/rasterFunctions/convolutionUtils":function(){define(["exports","../PixelBlock",
"../rasterFunctionConstants","./mirror"],function(m,w,v,J){function F(z){const p=Math.sqrt(z.length),b=z.slice(0,p),g=[1];for(let h=1;h<p;h++){let n=null;for(let l=0;l<p;l++){const A=z[l+h*p],t=z[l];if(null==n)if(0===t){if(A)return{separable:!1,row:null,col:null}}else n=A/t;else if(A/t!==n)return{separable:!1,row:null,col:null}}if(null==n)return{separable:!1,row:null,col:null};g.push(n)}return{separable:!0,row:b,col:g}}function R(z,p,b,g,h,n,l){const A=new Float32Array(p*b),t=n.length,r=l?0:g,a=l?
g:0;l=l?1:p;for(let f=r;f<b-r;f++){const d=f*p;for(let e=a;e<p-a;e++){if(h&&!h[d+e])continue;let c=0;for(let k=0;k<t;k++)c+=z[d+e+(k-g)*l]*n[k];A[d+e]=c}}return A}function P(z,p,b=!0){const {pixels:g,width:h,height:n,pixelType:l,mask:A}=z;z=g.length;const t=[],{kernel:r,rows:a,cols:f}=p;for(p=0;p<z;p++){var d=g[p],e=h,c=n,k=a,q=f,u=A,G=r;const y=new Float32Array(e*c),C=Math.floor(k/2),H=Math.floor(q/2);for(let x=C;x<c-C;x++){const M=x*e;for(let L=H;L<e-H;L++){if(u&&!u[M+L])continue;let N=0;for(let E=
0;E<k;E++)for(let I=0;I<q;I++)N+=d[M+L+(E-C)*e+I-H]*G[E*q+I];y[M+L]=N}}d=y;b&&J.mirror(d,h,n,a,f);t.push(d)}return new w({width:h,height:n,pixelType:l,pixels:t,mask:A})}function U(z,p,b,g=!0){const {pixels:h,width:n,height:l,pixelType:A,mask:t}=z;z=h.length;const r=[],a=p.length,f=b.length,d=Math.floor(a/2),e=Math.floor(f/2);for(let c=0;c<z;c++){let k=R(h[c],n,l,d,t,p,!0);k=R(k,n,l,e,t,b,!1);g&&J.mirror(k,n,l,a,f);r.push(k)}return new w({width:n,height:l,pixelType:A,pixels:r,mask:t})}const D=new Map;
D.set(v.convolutionKernel.none,[0,0,0,0,1,0,0,0,0]);D.set(v.convolutionKernel.lineDetectionHorizontal,[-1,-1,-1,2,2,2,-1,-1,-1]);D.set(v.convolutionKernel.lineDetectionVertical,[-1,2,-1,-1,2,-1,-1,2,-1]);D.set(v.convolutionKernel.lineDetectionLeftDiagonal,[2,-1,-1,-1,2,-1,-1,-1,2]);D.set(v.convolutionKernel.lineDetectionRightDiagonal,[-1,-1,2,-1,2,-1,2,-1,-1]);D.set(v.convolutionKernel.gradientNorth,[-1,-2,-1,0,0,0,1,2,1]);D.set(v.convolutionKernel.gradientWest,[-1,0,1,-2,0,2,-1,0,1]);D.set(v.convolutionKernel.gradientEast,
[1,0,-1,2,0,-2,1,0,-1]);D.set(v.convolutionKernel.gradientSouth,[1,2,1,0,0,0,-1,-2,-1]);D.set(v.convolutionKernel.gradientNorthEast,[0,-1,-2,1,0,-1,2,1,0]);D.set(v.convolutionKernel.gradientNorthWest,[-2,-1,0,-1,0,1,0,1,2]);D.set(v.convolutionKernel.smoothArithmeticMean,[.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111]);D.set(v.convolutionKernel.smoothing3x3,[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625]);D.set(v.convolutionKernel.smoothing5x5,
[1,1,1,1,1,1,4,4,4,1,1,4,12,4,1,1,4,4,4,1,1,1,1,1,1]);D.set(v.convolutionKernel.sharpening3x3,[-1,-1,-1,-1,9,-1,-1,-1,-1]);D.set(v.convolutionKernel.sharpening5x5,[-1,-3,-4,-3,-1,-3,0,6,0,-3,-4,6,21,6,-4,-3,0,6,0,-3,-1,-3,-4,-3,-1]);D.set(v.convolutionKernel.laplacian3x3,[0,-1,0,-1,4,-1,0,-1,0]);D.set(v.convolutionKernel.laplacian5x5,[0,0,-1,0,0,0,-1,-2,-1,0,-1,-2,17,-2,-1,0,-1,-2,-1,0,0,0,-1,0,0]);D.set(v.convolutionKernel.sobelHorizontal,[-1,-2,-1,0,0,0,1,2,1]);D.set(v.convolutionKernel.sobelVertical,
[-1,0,1,-2,0,2,-1,0,1]);D.set(v.convolutionKernel.sharpen,[0,-.25,0,-.25,2,-.25,0,-.25,0]);D.set(v.convolutionKernel.sharpen2,[-.25,-.25,-.25,-.25,3,-.25,-.25,-.25,-.25]);D.set(v.convolutionKernel.pointSpread,[-.627,.352,-.627,.352,2.923,.352,-.627,.352,-.627]);m.convolute=function(z,p){const b=F(p.kernel),g=!1!==p.mirrorEdges;z=b.separable?U(z,b.row,b.col,g):P(z,p,g);({outputPixelType:p}=p);p&&z.clamp(p);return z};m.convoluteSeparable=U;m.convolutionKernels=D;m.separateKernels=F;Object.defineProperty(m,
Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/mirror":function(){define(["exports"],function(m){m.mirror=function(w,v,J,F,R){F=Math.floor(F/2);for(var P=0;P<F;P++)for(var U=0;U<v;U++)w[P*v+U]=w[(R-1-P)*v+U],w[(J-1-P)*v+U]=w[(J-R+P)*v+U];F=Math.floor(R/2);for(P=0;P<J;P++){U=P*v;for(let D=0;D<F;D++)w[U+D]=w[U+R-1-D],w[U+v-D-1]=w[U+v+D-R]}};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/CurvatureFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseRasterFunction ./CurvatureFunctionArguments ./surfaceUtils".split(" "),
function(m,w,v,J,F,R,P,U,D){v=class extends P{constructor(){super(...arguments);this.functionName="Curvature";this.functionArguments=null;this.rasterArgumentNames=["raster"];this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const z=this.sourceRasterInfos[0].clone();z.pixelType=this.outputPixelType;z.bandCount=1;this._removeStatsHistColormapVAT(z);this.rasterInfo=z;this.isGCS=z.spatialReference?.isGeographic??!1;return{success:!0,supportsGPU:!0}}_processPixels(z){const p=
z.pixelBlocks?.[0];if(null==p)return null;const {zFactor:b,curvatureType:g}=this.functionArguments,{extent:h,primaryPixelSizes:n}=z;z=n?.[0];return D.curvature(p,{zFactor:this.isGCS&&1<=b?b*D.gcsFactor:b,curvatureType:g,resolution:null==z?h?{x:h.width/p.width,y:h.height/p.height}:{x:1,y:1}:z})}_getWebGLParameters(){const {zFactor:z,curvatureType:p}=this.functionArguments;return{curvatureType:p,zFactor:this.isGCS&&1<=z?z*D.gcsFactor:z}}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],
v.prototype,"functionName",void 0);m.__decorate([w.property({type:U,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"isGCS",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.CurvatureFunction")],v)})},"esri/layers/support/rasterFunctions/CurvatureFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/jsonMap ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/reader ../../../core/accessorSupport/decorators/subclass ./BaseFunctionArguments".split(" "),
function(m,w,v,J,F,R,P,U,D,z){var p;const b=new w.JSONMap({0:"standard",1:"platform",2:"profile"},{useNumericKeys:!0});w=p=class extends z{constructor(){super(...arguments);this.curvatureType="standard";this.zFactor=1}readCurvatureType(g,h){return b.fromJSON(h.type??h.curvatureType??0)}clone(){return new p({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};m.__decorate([v.property({json:{write:{target:"type"}}}),P.enumeration(b)],w.prototype,"curvatureType",void 0);m.__decorate([U.reader("curvatureType",
["type","curvatureType"])],w.prototype,"readCurvatureType",null);m.__decorate([v.property({type:Number,json:{write:!0}})],w.prototype,"zFactor",void 0);return w=p=m.__decorate([D.subclass("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],w)})},"esri/layers/support/rasterFunctions/ExtractBandFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./bandIndexUtils ./BaseRasterFunction ./ExtractBandFunctionArguments ./pixelUtils".split(" "),
function(m,w,v,J,F,R,P,U,D,z){function p(h,n){h=h.bandInfos.map(({name:A})=>A.toLowerCase());const l=[];for(let A=0;A<n.length;A++){const t=n[A].toLowerCase();let r=h.indexOf(t);-1===r&&"nearinfrared"===t&&(r=h.findIndex(a=>a.startsWith("nearinfrared_1")),-1===r&&(r=h.findIndex(a=>a.startsWith("nearinfrared"))));if(-1===r)return null;l.push(r)}return l}function b(h,n,l){const {bandCount:A}=h;return!n?.length||l&&n.some(t=>0>t||t>=A)?null:n}function g(h,n,{wavelengthMatchTolerance:l},A){var {bandInfos:t}=
h;h=[];for(var r=0;r<t.length;r++){const {minWavelength:a,maxWavelength:f}=t[r];if(!a||!f)return null;h.push({minWavelength:a,maxWavelength:f})}t=[];for(r=0;r<n.length;r++){const a=n[r];let f=!1,d=-1,e=Number.MAX_VALUE;for(let c=0;c<h.length;c++){const k=h[c],q=Math.abs(a-(k.minWavelength+k.maxWavelength)/2);a>=k.minWavelength&&a<=k.maxWavelength?q<e&&(f=!0,d=c,e=q):!f&&q<e&&(d=c,e=q)}!f&&l&&e<l&&(f=!0);if(!f&&A)return null;t.push(d)}return t}v=class extends U{constructor(){super(...arguments);this.functionName=
"ExtractBand";this.functionArguments=null;this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const {functionArguments:h,sourceRasterInfos:n}=this;var l=n[0];const {method:A,bandNames:t,bandWavelengths:r,bandIds:a,missingBandAction:f}=h,d=t?.length&&("name"===A||"id"!==A&&!a?.length),e=r?.length&&("wavelength"===A||"id"!==A&&!a?.length);var c=f===z.MissingBandAction.fail;c=d?p(l,t):e?g(l,r,this.functionArguments,c):b(l,a,c);if(null==c)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${d?
"band names":e?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=c;this.functionArguments.method="id";this.outputPixelType=this._getOutputPixelType("f32");l=l.clone();l.pixelType=this.outputPixelType;l.bandCount=c.length;const {statistics:k,histograms:q}=l;null!=k&&k.length&&(l.statistics=c.map(G=>k[G]||k[k.length-1]));null!=q&&q.length&&(l.histograms=c.map(G=>q[G]||q[q.length-1]));let u=l.keyProperties?.BandProperties;u?.length&&(u=c.map(G=>G>=u.length?u[u.length-
1]:u[G]),l.keyProperties={...l.keyProperties,BandProperties:u});this.rasterInfo=l;return{success:!0,supportsGPU:3>=l.bandCount}}_processPixels(h){h=h.pixelBlocks?.[0];if(null==h)return null;const n=h.pixels.length,l=this.functionArguments.bandIds.map(A=>A>=n?n-1:A);return h.extractBands(l)}_getWebGLParameters(){let h;if(this.isInputBandIdsSwizzled)h=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{h=[...this.functionArguments.bandIds];0===h.length?h=[0,1,2]:3>h.length&&(h[1]=
h[1]??h[0],h[2]=h[2]??h[1]);for(let n=0;3>n;n++)h[n]=Math.min(h[n],2)}return{bandIndexMat3:P.getBandMatrix3(h)}}_getInputBandIds(h){const n=h.length;return this.functionArguments.bandIds.map(l=>l>=n?n-1:l).map(l=>h[l])}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:D,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",
void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.ExtractBandFunction")],v)})},"esri/layers/support/rasterFunctions/ExtractBandFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass ./BaseFunctionArguments ./pixelUtils".split(" "),function(m,w,v,J,
F,R,P,U,D){var z;v=z=class extends U{constructor(){super(...arguments);this.bandIds=[];this.bandNames=[];this.bandWavelengths=[];this.missingBandAction=D.MissingBandAction.bestMatch}clone(){return new z({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};m.__decorate([w.property({json:{write:!0}})],v.prototype,"bandIds",void 0);
m.__decorate([w.property({json:{write:!0}})],v.prototype,"bandNames",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"bandWavelengths",void 0);m.__decorate([R.enumeration({0:"name",1:"wavelength",2:"id"})],v.prototype,"method",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"missingBandAction",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"wavelengthMatchTolerance",void 0);return v=z=m.__decorate([P.subclass("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],
v)})},"esri/layers/support/rasterFunctions/GrayscaleFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseRasterFunction ./conversionUtils ./GrayscaleFunctionArguments".split(" "),function(m,w,v,J,F,R,P,U,D){v=class extends P{constructor(){super(...arguments);this.functionName="Grayscale";this.functionArguments=null;this.rasterArgumentNames=
["raster"]}get _normalizedWeights(){const {conversionParameters:z}=this.functionArguments,p=z.reduce((b,g)=>b+g);return z.map(b=>b/p)}_bindSourceRasters(){var {conversionParameters:z}=this.functionArguments;if(!z?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const p=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(p.pixelType);p.pixelType=this.outputPixelType;z=3===z.length||3===p.bandCount&&3<z.length;p.bandCount=1;this._removeStatsHistColormapVAT(p);
this.rasterInfo=p;return{success:!0,supportsGPU:z}}_processPixels(z){z=z.pixelBlocks?.[0];return null==z?null:U.grayscale(z,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:D,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",
void 0);m.__decorate([w.property()],v.prototype,"_normalizedWeights",null);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.GrayscaleFunction")],v)})},"esri/layers/support/rasterFunctions/conversionUtils":function(){define(["exports","../PixelBlock","../rasterFormats/pixelRangeUtils"],function(m,w,v){m.grayscale=function(J,F,R){const {pixels:P,width:U,height:D,mask:z,bandMasks:p}=J;var b=U*D;const g=p?.length?w.combineBandMasks(p):z,h=Math.min(F.length,P.length),n=R.startsWith("f");
J=!n&&R!==J.pixelType;const [l,A]=v.getPixelValueRange(R);b=w.createEmptyBand(R,b);for(let t=0;t<D;t++){let r=t*U;for(let a=0;a<U;a++,r++)if(!g||g[r]){let f=0;for(let d=0;d<h;d++)f+=F[d]*P[d][r];n||(f=Math.round(f),J&&(f=f>A?A:f<l?l:f));b[r]=f}}F=new w({width:U,height:D,pixels:[b],pixelType:R,mask:g});F.updateStatistics();return F};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/GrayscaleFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseFunctionArguments".split(" "),
function(m,w,v,J,F,R,P){var U;v=U=class extends P{clone(){return new U({conversionParameters:[...this.conversionParameters],raster:this.raster})}};m.__decorate([w.property({type:[Number],json:{write:!0}})],v.prototype,"conversionParameters",void 0);return v=U=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.GrayscaleFunctionArguments")],v)})},"esri/layers/support/rasterFunctions/LocalFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../rasterFunctionConstants ../rasterFormats/pixelRangeUtils ./BaseRasterFunction ./LocalFunctionArguments ./localUtils".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p){v=class extends D{constructor(){super(...arguments);this.functionName="Local";this.functionArguments=null;this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){var {sourceRasterInfos:b}=this,g=b[0];const {bandCount:h}=g,{processAsMultiband:n}=this.functionArguments;if(b.some(t=>t.bandCount!==h))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const {operation:l,rasters:A}=this.functionArguments;b=p.operandsCount[l];
if(!(999===b||A.length===b||1>=A.length&&1===b))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${b}`};g=g.clone();g.bandCount=999!==b||n?h:1;this._removeStatsHistColormapVAT(g);this._updateStatistics(g);this._updatePixelType(g);this.rasterInfo=g;return{success:!0,supportsGPU:1===g.bandCount&&3>=b&&(11>l||16<l)}}_processPixels(b){({pixelBlocks:b}=b);return null==b||b.some(g=>null==g)?null:p.local(b,this.functionArguments.operation,
{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const {operation:b}=this.functionArguments,g=p.operandsCount[b],h=Object.keys(P.localOperators).find(t=>P.localOperators[t]===b)?.toLowerCase()??"undefined";var n=this.outputPixelType??"f32";let [l,A]=U.getPixelValueRange(n);if(n=U.isIntegerPixelType(n))l-=1E-4,A+=1E-4;return{imageCount:g,operationName:h,domainRange:[l,A],isOutputRounded:n}}_updateStatistics(b){var g=
this.sourceRasterInfos[0];const {operation:h}=this.functionArguments,n=p.getOutputDomain(h)?.domain;if(n)for(b.statistics=[],g=0;g<b.bandCount;g++)b.statistics[g]={min:n[0],max:n[1],avg:(n[0]+n[1])/2,stddev:(n[0]+n[1])/10};else 45===h&&g.statistics?.length&&(b.statistics=g.statistics.map(l=>({min:-l.max,max:-l.min,avg:null!=l.avg?-l.avg:void 0,stddev:null!=l.stddev?-l.stddev:void 0})))}_updatePixelType(b){const {statistics:g,pixelType:h}=this.sourceRasterInfos[0];var {operation:n}=this.functionArguments;
const {domain:l,isInteger:A}=p.getOutputDomain(n)??{domain:null,isInteger:!1};var t="f32";l&&A?t=U.getIntegerPixelType(l[0],l[1]):30===n?t=(n=g?.[0])?U.getIntegerPixelType(n.min,n.max):U.isIntegerPixelType(h)?h:"s32":45===n&&U.isIntegerPixelType(h)&&(t=g?.map(({max:r})=>-r),n=g?.map(({min:r})=>-r),t=t?.length?Math.min(...t):null,n=n?.length?Math.min(...n):null,t=null!=t&&null!=n?U.getIntegerPixelType(t,n):h.startsWith("s")?h.replace("s","u"):"u1"===h||"u2"===h||"u4"===h?"s8":"u8"===h?"s16":"s32");
b.pixelType=this.outputPixelType=this._getOutputPixelType(t)}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:z,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.LocalFunction")],v)})},"esri/layers/support/rasterFunctions/LocalFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/lang ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/accessorSupport/decorators/subclass ../../../core/accessorSupport/decorators/writer ./BaseFunctionArguments".split(" "),
function(m,w,v,J,F,R,P,U){var D;J=D=class extends U{constructor(){super(...arguments);this.rasters=[];this.processAsMultiband=!0}writeRasters(z,p){p.rasters=z.map(b=>"number"===typeof b||"string"===typeof b?b:b.toJSON())}clone(){return new D({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:w.clone(this.rasters)})}};m.__decorate([v.property({json:{write:!0}})],J.prototype,"operation",void 0);m.__decorate([v.property({json:{write:!0}})],J.prototype,"rasters",void 0);m.__decorate([P.writer("rasters")],
J.prototype,"writeRasters",null);m.__decorate([v.property({json:{write:!0}})],J.prototype,"processAsMultiband",void 0);return J=D=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.LocalFunctionArguments")],J)})},"esri/layers/support/rasterFunctions/MaskFunction":function(){define("../../../chunks/tslib.es6 ../../../core/mathUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseRasterFunction ./MaskFunctionArguments ./pixelUtils".split(" "),
function(m,w,v,J,F,R,P,U,D,z){J=class extends U{constructor(){super(...arguments);this.functionName="Mask";this.functionArguments=null;this.rasterArgumentNames=["raster"]}_bindSourceRasters(){var p=this.sourceRasterInfos[0].clone();const {pixelType:b}=p;this.outputPixelType=this._getOutputPixelType(b);p.pixelType=this.outputPixelType;this.rasterInfo=p;const {includedRanges:g,normalizedNoDataValues:h}=this.functionArguments;if(!g?.length&&!h?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};
let n=[];for(let l=0;l<p.bandCount;l++){const A=z.createMaskLUT(b,g?.slice(2*l,2*l+2),h?.[l]);if(null==A){n=null;break}n.push(A)}this.lookups=n;p=null!=h&&h.every(l=>l?.length===h[0]?.length);return{success:!0,supportsGPU:(!g||g.length<=2*z.maxMapSizeGpu)&&(!h||p&&h[0].length<=z.maxMapSizeGpu)}}_processPixels(p){p=p.pixelBlocks?.[0];if(null==p)return null;const {outputPixelType:b,lookups:g}=this,{includedRanges:h,noDataInterpretation:n,normalizedNoDataValues:l}=this.functionArguments;return z.mask(p,
{includedRanges:h,noDataValues:l,outputPixelType:b,matchAll:n===z.NoDataInterpretation.matchAll,lookups:g})}_getWebGLParameters(){const {includedRanges:p,normalizedNoDataValues:b}=this.functionArguments,g=new Float32Array(z.maxMapSizeGpu);g.fill(w.numberMaxFloat32);b?.[0]?.length&&g.set(b[0]);const h=new Float32Array(z.maxMapSizeGpu);for(let n=0;n<h.length;n+=2)h[n]=p?.[n]??-w.numberMaxFloat32,h[n+1]=p?.[n+1]??w.numberMaxFloat32;p?.length&&h.set(p);return{bandCount:this.sourceRasterInfos[0].bandCount,
noDataValues:g,includedRanges:h}}};m.__decorate([v.property({json:{write:!0,name:"rasterFunction"}})],J.prototype,"functionName",void 0);m.__decorate([v.property({type:D,json:{write:!0,name:"rasterFunctionArguments"}})],J.prototype,"functionArguments",void 0);m.__decorate([v.property()],J.prototype,"rasterArgumentNames",void 0);m.__decorate([v.property({json:{write:!0}})],J.prototype,"lookups",void 0);return J=m.__decorate([P.subclass("esri.layers.support.rasterFunctions.MaskFunction")],J)})},"esri/layers/support/rasterFunctions/MaskFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseFunctionArguments ./pixelUtils".split(" "),
function(m,w,v,J,F,R,P,U){var D;v=D=class extends P{constructor(){super(...arguments);this.noDataValues=this.includedRanges=null;this.noDataInterpretation=U.NoDataInterpretation.matchAny}get normalizedNoDataValues(){var {noDataValues:z}=this;if(!z?.length)return null;let p=!1;z=z.map(b=>"number"===typeof b?(p=!0,[b]):"string"===typeof b?(b=b.trim().split(" ").filter(g=>""!==g.trim()).map(g=>Number(g)),p=p||0<b.length,0===b.length?null:b):null);return p?z:null}clone(){return new D({includedRanges:this.includedRanges?.slice()??
[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};m.__decorate([w.property({json:{write:!0}})],v.prototype,"includedRanges",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"noDataValues",void 0);m.__decorate([w.property()],v.prototype,"normalizedNoDataValues",null);m.__decorate([w.property({json:{write:!0}})],v.prototype,"noDataInterpretation",void 0);return v=D=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.MaskFunctionArguments")],
v)})},"esri/layers/support/rasterFunctions/NDVIFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./bandIndexUtils ./BaseRasterFunction ./NDVIFunctionArguments".split(" "),function(m,w,v,J,F,R,P,U,D){v=class extends U{constructor(){super(...arguments);this.functionName="NDVI";this.functionArguments=null;this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const {scientificOutput:z,
visibleBandID:p,infraredBandID:b}=this.functionArguments;this.outputPixelType=this._getOutputPixelType(z?"f32":"u8");var g=this.sourceRasterInfos[0];const h=Math.max(p,b);if(2>g.bandCount||h>=g.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};g=g.clone();g.pixelType=this.outputPixelType;g.colormap=null;g.histograms=null;g.bandCount=1;g.keyProperties={...g.keyProperties,BandProperties:void 0};const [n,l,A,t]=z?[-1,1,0,.1]:[0,200,
100,10];g.statistics=[{min:n,max:l,avg:A,stddev:t}];this.rasterInfo=g;return{success:!0,supportsGPU:!0}}_processPixels(z){z=z.pixelBlocks?.[0];if(null==z)return null;const {visibleBandID:p,infraredBandID:b,scientificOutput:g}=this.functionArguments;return P.calculateNDVI(z,p,b,!g)}_getWebGLParameters(){const {visibleBandID:z,infraredBandID:p,scientificOutput:b}=this.functionArguments;return{bandIndexMat3:P.getBandMatrix3(this.isInputBandIdsSwizzled?[0,1,2]:[p,z,0]),scaled:!b}}_getInputBandIds(z){const {visibleBandID:p,
infraredBandID:b}=this.functionArguments;return[b,p,0].map(g=>z[g])}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:D,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.NDVIFunction")],v)})},"esri/layers/support/rasterFunctions/NDVIFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseFunctionArguments".split(" "),
function(m,w,v,J,F,R,P){var U;v=U=class extends P{constructor(){super(...arguments);this.visibleBandID=0;this.infraredBandID=1;this.scientificOutput=!1}clone(){const {visibleBandID:D,infraredBandID:z,scientificOutput:p}=this;return new U({visibleBandID:D,infraredBandID:z,scientificOutput:p})}};m.__decorate([w.property({json:{write:!0}})],v.prototype,"visibleBandID",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"infraredBandID",void 0);m.__decorate([w.property({json:{write:!0}})],
v.prototype,"scientificOutput",void 0);return v=U=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.NDVIFunctionArguments")],v)})},"esri/layers/support/rasterFunctions/RemapFunction":function(){define("../../../chunks/tslib.es6 ../../../core/mathUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../rasterFormats/pixelRangeUtils ./BaseRasterFunction ./pixelUtils ./RemapFunctionArguments".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p){J=class extends D{constructor(){super(...arguments);this.functionName="Remap";this.functionArguments=null;this.rasterArgumentNames=["raster"];this.lookup=null}_bindSourceRasters(){const b=this.sourceRasterInfos[0].clone(),{pixelType:g}=b;this.outputPixelType=this._getOutputPixelType(g);b.pixelType=this.outputPixelType;b.colormap=null;b.histograms=null;b.bandCount=1;b.attributeTable=null;const {statistics:h}=b,{allowUnmatched:n,outputValues:l,inputRanges:A,noDataRanges:t,
isLastInputRangeInclusive:r}=this.functionArguments;if(null!=h&&h.length&&l?.length)if(n){var a=Math.min.apply(null,[...l,h[0].min]),f=Math.max.apply(null,[...l,h[0].max]);b.statistics=[{...h[0],min:a,max:f}]}else{f=a=l[0];for(let d=0;d<l.length;d++)a=a>l[d]?l[d]:a,f=f>l[d]?f:l[d];b.statistics=[{...h[0],min:a,max:f}]}this.rasterInfo=b;this.lookup=n?null:z.createRemapLUT({srcPixelType:g,inputRanges:A,outputValues:l,noDataRanges:t,allowUnmatched:n,isLastInputRangeInclusive:r,outputPixelType:this.outputPixelType});
return{success:!0,supportsGPU:(!l||l.length<=z.maxMapSizeGpu)&&(!t||t.length<=z.maxMapSizeGpu)}}_processPixels(b){b=b.pixelBlocks?.[0];if(null==b)return null;const {lookup:g,outputPixelType:h}=this;if(g){const a=z.lookupPixels(b,{lut:[g.lut],offset:g.offset,outputPixelType:h});null!=a&&g.mask&&(a.mask=z.lookupBandValues(b.pixels[0],b.mask,g.mask,g.offset,"u8"));return a}const {inputRanges:n,outputValues:l,noDataRanges:A,allowUnmatched:t,isLastInputRangeInclusive:r}=this.functionArguments;return z.remap(b,
{inputRanges:n,outputValues:l,noDataRanges:A,outputPixelType:h,allowUnmatched:t,isLastInputRangeInclusive:r})}_getWebGLParameters(){const {allowUnmatched:b,noDataRanges:g,isLastInputRangeInclusive:h}=this.functionArguments,n=new Float32Array(3*z.maxMapSizeGpu);var l=this.functionArguments.inputRanges??[],A=this.functionArguments.outputValues??[];const t=A.length;for(let r=0;r<z.maxMapSizeGpu;r++)if(n[3*r]=l[2*r]??w.numberMaxFloat32-1,n[3*r+1]=l[2*r+1]??w.numberMaxFloat32,n[3*r+2]=A[r]??0,r<t&&(0<
r&&(n[3*r]-=1E-5),r<t-1||!h))n[3*r+1]-=1E-5;l=new Float32Array(2*z.maxMapSizeGpu);l.fill(w.numberMaxFloat32);g?.length&&l.set(g);A=U.getPixelValueRange(this.outputPixelType);return{allowUnmatched:b,rangeMaps:n,noDataRanges:l,clampRange:A}}};m.__decorate([v.property({json:{write:!0,name:"rasterFunction"}})],J.prototype,"functionName",void 0);m.__decorate([v.property({type:p,json:{write:!0,name:"rasterFunctionArguments"}})],J.prototype,"functionArguments",void 0);m.__decorate([v.property()],J.prototype,
"rasterArgumentNames",void 0);m.__decorate([v.property({json:{write:!0}})],J.prototype,"lookup",void 0);return J=m.__decorate([P.subclass("esri.layers.support.rasterFunctions.RemapFunction")],J)})},"esri/layers/support/rasterFunctions/RemapFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseFunctionArguments".split(" "),
function(m,w,v,J,F,R,P){var U;v=U=class extends P{constructor(){super(...arguments);this.noDataRanges=this.outputValues=this.inputRanges=null;this.isLastInputRangeInclusive=this.allowUnmatched=!1}clone(){return new U({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};m.__decorate([w.property({json:{write:!0}})],v.prototype,"inputRanges",void 0);m.__decorate([w.property({json:{write:!0}})],
v.prototype,"outputValues",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"noDataRanges",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"allowUnmatched",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"isLastInputRangeInclusive",void 0);return v=U=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.RemapFunctionArguments")],v)})},"esri/layers/support/rasterFunctions/SlopeFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseRasterFunction ./SlopeFunctionArguments ./surfaceUtils".split(" "),
function(m,w,v,J,F,R,P,U,D){v=class extends P{constructor(){super(...arguments);this.functionName="Slope";this.functionArguments=null;this.rasterArgumentNames=["raster"];this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const z=this.sourceRasterInfos[0].clone();z.pixelType=this.outputPixelType;z.statistics="percent-rise"!==this.functionArguments.slopeType?[{min:0,max:90,avg:1,stddev:1}]:null;z.histograms=null;z.colormap=null;z.attributeTable=null;z.bandCount=
1;this.rasterInfo=z;this.isGCS=z.spatialReference?.isGeographic??!1;return{success:!0,supportsGPU:!0}}_processPixels(z){const p=z.pixelBlocks?.[0];if(null==p)return null;const {zFactor:b,slopeType:g,pixelSizePower:h,pixelSizeFactor:n}=this.functionArguments,{isGCS:l}=this,{extent:A,primaryPixelSizes:t}=z;z=t?.[0];return D.slope(p,{zFactor:b,slopeType:g,pixelSizePower:h,pixelSizeFactor:n,isGCS:l,resolution:null==z?A?{x:A.width/p.width,y:A.height/p.height}:{x:1,y:1}:z})}_getWebGLParameters(){const {zFactor:z,
slopeType:p,pixelSizeFactor:b,pixelSizePower:g}=this.functionArguments;return{zFactor:this.isGCS&&1<=z?z*D.gcsFactor:z,slopeType:p,pixelSizeFactor:b??0,pixelSizePower:g??0}}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:U,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",void 0);m.__decorate([w.property({json:{write:!0}})],
v.prototype,"isGCS",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.SlopeFunction")],v)})},"esri/layers/support/rasterFunctions/SlopeFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/jsonMap ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass ./BaseFunctionArguments".split(" "),
function(m,w,v,J,F,R,P,U,D){var z;w=new w.JSONMap({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});D=z=class extends D{constructor(){super(...arguments);this.slopeType="degree";this.zFactor=1;this.pixelSizePower=.664;this.pixelSizeFactor=.024;this.removeEdgeEffect=!1}clone(){return new z({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};m.__decorate([P.enumeration(w)],
D.prototype,"slopeType",void 0);m.__decorate([v.property({type:Number,json:{write:!0}})],D.prototype,"zFactor",void 0);m.__decorate([v.property({type:Number,json:{name:"psPower",write:!0}})],D.prototype,"pixelSizePower",void 0);m.__decorate([v.property({type:Number,json:{name:"psZFactor",write:!0}})],D.prototype,"pixelSizeFactor",void 0);m.__decorate([v.property({type:Boolean,json:{write:!0}})],D.prototype,"removeEdgeEffect",void 0);return D=z=m.__decorate([U.subclass("esri.layers.support.rasterFunctions.SlopeFunctionArguments")],
D)})},"esri/layers/support/rasterFunctions/StatisticsFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../rasterFormats/pixelRangeUtils ./BaseRasterFunction ./focalStatUtils ./StatisticsFunctionArguments".split(" "),function(m,w,v,J,F,R,P,U,D,z){v=class extends U{constructor(){super(...arguments);this.functionName="Statistics";this.rasterArgumentNames=
["raster"]}_bindSourceRasters(){const {type:p}=this.functionArguments.toJSON();if(1>p||7<p)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${p}`};var b=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(b.pixelType);b=b.clone();b.pixelType=this.outputPixelType;const {statisticsType:g}=this.functionArguments;"stddev"===g&&this._removeStatsHistColormapVAT(b);this.rasterInfo=b;return{success:!0,supportsGPU:3>=b.bandCount&&5>
p}}_processPixels(p){p=p.pixelBlocks?.[0];if(null==p)return p;const {statisticsType:b,rows:g,cols:h,fillNoDataOnly:n}=this.functionArguments;return D.computeFocalStatistics(p,{kernelRows:g,kernelCols:h,fillNoDataOnly:n,outputPixelType:this.outputPixelType,statisticsType:b,mirrorEdges:!0})}_getWebGLParameters(){const {rows:p,cols:b,statisticsType:g,fillNoDataOnly:h}=this.functionArguments;return{fillNoDataOnly:h,kernelRows:p,kernelCols:b,statisticsType:g,clampRange:P.getPixelValueRange(this.outputPixelType)}}};
m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:z,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.StatisticsFunction")],v)})},"esri/layers/support/rasterFunctions/focalStatUtils":function(){define(["exports","../../../core/has","../../../core/jsonMap",
"../PixelBlock","./mirror"],function(m,w,v,J,F){function R(P,U){const {fillNoDataOnly:D}=U,{band:z,width:p,height:b,mask:g,outBand:h}=P;if(D&&!g)h.set(z);else{var {kernelRows:n,kernelCols:l}=U;P=Math.floor(n/2);U=Math.floor(l/2);var A=h.slice(),t=new Uint32Array(p*b);for(var r=P;r<b-P;r++){var a=r*p;for(var f=U;f<p-U;f++){if(D&&g?.[a+f])continue;const d=[];for(let e=0;e<n;e++)for(let c=0;c<l;c++){const k=a+f+(e-P)*p+c-U;g&&!g[k]||d.push(z[k])}d.length&&(d.sort((e,c)=>e-c),g?(A[a+f]=d[Math.floor((d.length-
1)/2)],t[a+f]=d.length):h[a+f]=d[Math.floor((d.length-1)/2)])}}if(g)for(r=P;r<b-P;r++)for(a=r*p,f=U;f<p-U;f++)!t[a+f]||D&&g[a+f]||(h[a+f]=A[a+f],g[a+f]=255)}}w=new v.JSONMap({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});m.computeFocalStatistics=function(P,U){const {mask:D}=P,{fillNoDataOnly:z}=U;if(z&&!D)return P;const {pixels:p,width:b,height:g,bandMasks:h,pixelType:n}=P,l=p.length,A=b*g,t=[],{kernelRows:r,kernelCols:a,statisticsType:f,mirrorEdges:d}=
U;if(z&&!D)return P;const e=U.outputPixelType??n,c=[];for(let C=0;C<l;C++){const H=p[C],x=J.createEmptyBand(e,A);z&&x.set(H);const M=(h?.[C]??D)?.slice()??null,L={band:H,width:b,height:g,mask:M,outBand:x};switch(f){case "min":case "max":a:{var k=U;const {fillNoDataOnly:N}=k,{band:E,width:I,height:K,mask:S,outBand:O}=L;if(N&&!S){O.set(E);break a}const {kernelRows:W,kernelCols:Y,statisticsType:V}=k,B=Math.floor(W/2),Q=Math.floor(Y/2),T="min"===V,X=O.slice(),aa=new Uint32Array(I*K);for(let Z=B;Z<K-B;Z++){const ba=
Z*I;for(let ea=Q;ea<I-Q;ea++){let fa=T?Number.MAX_VALUE:-Number.MAX_VALUE,la=0;for(let ja=0;ja<W;ja++)for(let pa=0;pa<Y;pa++){const ma=ba+ea+(ja-B)*I+pa-Q;if(!S||S[ma])fa=T?Math.min(fa,E[ma]):Math.max(fa,E[ma]),la++}S?(X[ba+ea]=0===la?0:fa,aa[ba+ea]=la):O[ba+ea]=0===la?0:fa}}if(S)for(let Z=B;Z<K-B;Z++){const ba=Z*I;for(let ea=Q;ea<I-Q;ea++)!aa[ba+ea]||N&&S[ba+ea]||(O[ba+ea]=X[ba+ea],S[ba+ea]=255)}}break;case "mean":case "stddev":a:{var q=U;const {fillNoDataOnly:N}=q,{band:E,width:I,height:K,mask:S,
outBand:O}=L;if(N&&!S){O.set(E);break a}const {statisticsType:W,kernelRows:Y,kernelCols:V}=q,B="stddev"===W,Q=I*K,T=new Float64Array(Q),X=new Float64Array(Q),aa=new Uint32Array(Q);for(let pa=0;pa<K;pa++){const ma=pa*I;let oa=0,qa=0,ta=0;for(let sa=0;sa<V;sa++)if(!S||S[ma+sa])oa+=E[ma+sa],B&&(qa+=E[ma+sa]**2),ta++;T[ma]=oa;X[ma]=qa;aa[ma]=ta;for(let sa=1;sa<=I-V;sa++){const ra=ma+sa-1,xa=ra+V;S?(S[ra]&&(ta--,oa-=E[ra],B&&(qa-=E[ra]**2)),S[xa]&&(ta++,oa+=E[xa],B&&(qa+=E[xa]**2))):(oa-=E[ra],oa+=E[xa],
B&&(qa-=E[ra]**2,qa+=E[xa]**2));T[ma+sa]=oa;aa[ma+sa]=ta;B&&(X[ma+sa]=qa)}}const Z=new Float64Array(Q),ba=new Float64Array(Q),ea=new Uint32Array(Q),fa=Y*I;for(let pa=0;pa<=I-V;pa++){let ma=0,oa=0,qa=0;for(let ta=0;ta<Y;ta++){const sa=ta*I+pa;ma+=T[sa];qa+=aa[sa];B&&(oa+=X[sa])}Z[pa]=ma;ba[pa]=oa;ea[pa]=qa;for(let ta=1;ta<=K-Y;ta++){const sa=(ta-1)*I+pa,ra=sa+fa;ma-=T[sa];ma+=T[ra];qa-=aa[sa];qa+=aa[ra];B&&(oa-=X[sa],oa+=X[ra]);Z[ta*I+pa]=ma;ba[ta*I+pa]=oa;ea[ta*I+pa]=qa}}const la=Math.floor(Y/2),
ja=Math.floor(V/2);for(let pa=la;pa<K-la;pa++){const ma=pa*I;for(let oa=ja;oa<I-ja;oa++){const qa=(pa-la)*I+oa-ja,ta=ea[qa];if(0===ta||N&&(!S||S[ma+oa]))continue;const sa=Z[qa]/ta;O[ma+oa]=B?Math.sqrt((ba[qa]-Z[qa]*sa)/ta):sa;S&&(S[ma+oa]=255)}}}break;case "median":R(L,U);break;case "majority":case "minority":a:{var u=U;const {fillNoDataOnly:N}=u,{band:E,width:I,height:K,mask:S,outBand:O}=L;if(N&&!S){O.set(E);break a}const {kernelRows:W,kernelCols:Y}=u,V=Math.floor(W/2),B=Math.floor(Y/2),Q="majority"===
u.statisticsType,T=W*Y,X=O.slice(),aa=new Uint32Array(I*K);for(let Z=V;Z<K-V;Z++){const ba=Z*I;for(let ea=B;ea<I-B;ea++){if(N&&S?.[ba+ea])continue;const fa=new Map;for(let ma=0;ma<W;ma++)for(let oa=0;oa<Y;oa++){const qa=ba+ea+(ma-V)*I+oa-B;if(S&&!S[qa])continue;const ta=E[qa];fa.set(ta,fa.has(ta)?fa.get(ta)+1:1)}if(0===fa.size)continue;let la=0,ja=0,pa=Q?0:T+1;for(const ma of fa.keys())ja=fa.get(ma),Q===ja>pa&&(pa=ja,la=ma);S?(X[ba+ea]=la,aa[ba+ea]=fa.size):O[ba+ea]=la}}if(S)for(let Z=V;Z<K-V;Z++){const ba=
Z*I;for(let ea=B;ea<I-B;ea++)!aa[ba+ea]||N&&S[ba+ea]||(O[ba+ea]=X[ba+ea],S[ba+ea]=255)}}}d&&!z&&F.mirror(x,b,g,r,a);t.push(x);M&&c.push(M)}let G=c[0]??D;c.length!==l&&(c.length=0);1<l&&h?.length&&(G=J.combineBandMasks(h));const y=new J({pixelType:e,width:b,height:g,pixels:t,bandMasks:h&&c.length?c:null,mask:G});y.updateStatistics();return y};m.statisticsTypeMap=w;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterFunctions/StatisticsFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/lang ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass ./BaseFunctionArguments ./focalStatUtils".split(" "),
function(m,w,v,J,F,R,P,U,D){var z;J=z=class extends U{constructor(){super(...arguments);this.cols=this.rows=3;this.fillNoDataOnly=!1;this.statisticsType="min"}clone(){return new z({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:w.clone(this.raster)})}};m.__decorate([v.property({json:{write:!0,read:{source:["kernelRows","rows"],reader:(p,b)=>Number(p??b?.kernelRows??3)}}})],J.prototype,"rows",void 0);m.__decorate([v.property({json:{write:!0,
read:{source:["kernelCols","cols"],reader:(p,b)=>Number(p??b?.kernelCols??3)}}})],J.prototype,"cols",void 0);m.__decorate([v.property({json:{write:!0}})],J.prototype,"fillNoDataOnly",void 0);m.__decorate([v.property({json:{read:{source:["statisticsType","type"],reader:(p,b)=>D.statisticsTypeMap.fromJSON(b?.statisticsType??b?.type)??"min"},write:{target:"type"}}}),R.enumeration(D.statisticsTypeMap)],J.prototype,"statisticsType",void 0);return J=z=m.__decorate([P.subclass("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],
J)})},"esri/layers/support/rasterFunctions/StatisticsHistogramFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseRasterFunction ./StatisticsHistogramFunctionArguments".split(" "),function(m,w,v,J,F,R,P,U){v=class extends P{constructor(){super(...arguments);this.functionName="StatisticsHistogram";this.functionArguments=null;this.rasterArgumentNames=
["raster"];this.isNoopProcess=!0}_bindSourceRasters(){var D=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");D=D.clone();const {statistics:z,histograms:p}=this.functionArguments;p&&(D.histograms=p);z&&(D.statistics=z);this.rasterInfo=D;return{success:!0,supportsGPU:!0}}_processPixels(D){return D.pixelBlocks?.[0]}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:U,json:{write:!0,name:"rasterFunctionArguments"}})],
v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"indexedColormap",void 0);m.__decorate([w.property()],v.prototype,"isNoopProcess",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],v)})},"esri/layers/support/rasterFunctions/StatisticsHistogramFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/lang ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/accessorSupport/decorators/reader ../../../core/accessorSupport/decorators/subclass ../../../core/accessorSupport/decorators/writer ./BaseFunctionArguments".split(" "),
function(m,w,v,J,F,R,P,U,D){var z;J=z=class extends D{constructor(){super(...arguments);this.histograms=this.statistics=null}readStatistics(p,b){if(!p?.length)return null;const g=[];p.forEach(h=>{g.push({min:h.min,max:h.max,avg:h.avg??h.mean,stddev:h.stddev??h.standardDeviation})});return g}writeStatistics(p,b,g){if(p?.length){var h=[];p.forEach(n=>{n={...n,mean:n.avg,standardDeviation:n.stddev};delete n.avg;delete n.stddev;h.push(n)});b[g]=h}}clone(){return new z({statistics:w.clone(this.statistics),
histograms:w.clone(this.histograms)})}};m.__decorate([v.property({json:{write:!0}})],J.prototype,"statistics",void 0);m.__decorate([R.reader("statistics")],J.prototype,"readStatistics",null);m.__decorate([U.writer("statistics")],J.prototype,"writeStatistics",null);m.__decorate([v.property({json:{write:!0}})],J.prototype,"histograms",void 0);return J=z=m.__decorate([P.subclass("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],J)})},"esri/layers/support/rasterFunctions/StretchFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../rasterFormats/pixelRangeUtils ./BaseRasterFunction ./pixelUtils ./StretchFunctionArguments ./stretchUtils".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p){v=class extends U{constructor(){super(...arguments);this.functionName="Stretch";this.functionArguments=null;this.rasterArgumentNames=["raster"];this.cutOffs=this.lookup=null}_bindSourceRasters(){this.cutOffs=this.lookup=null;var b=this.sourceRasterInfos[0],{pixelType:g}=b,{functionArguments:h}=this;const {dynamicRangeAdjustment:n,gamma:l,useGamma:A}=h;if(!n&&["u8","u16","s8","s16"].includes(g)){h=p.getStretchCutoff(h.toJSON(),{rasterInfo:b});const a=P.isIntegerPixelType(this.outputPixelType)?
"round":"float";this.lookup=p.createStretchLUT({pixelType:g,...h,gamma:A?l:null,rounding:a});this.cutOffs=h}else n||(this.cutOffs=p.getStretchCutoff(h.toJSON(),{rasterInfo:b}));this.outputPixelType=this._getOutputPixelType(g);b=b.clone();b.pixelType=this.outputPixelType;this._removeStatsHistColormapVAT(b);"u8"===this.outputPixelType&&(b.keyProperties.DataType="processed");const {outputMin:t=0,outputMax:r=255}=this.functionArguments;b.statistics=[];for(g=0;g<b.bandCount;g++)b.statistics[g]={min:t,
max:r};this.rasterInfo=b;return{success:!0,supportsGPU:!n}}_processPixels(b){b=b.pixelBlocks?.[0];if(null==b)return b;var {lookup:g}=this;if(g)return D.lookupPixels(b,{...g,outputPixelType:this.rasterInfo.pixelType});({functionArguments:g}=this);const h=this.cutOffs||p.getStretchCutoff(g.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:b});return p.stretch(b,{...h,gamma:g.useGamma?g.gamma:null,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const {outputMin:b=0,outputMax:g=255,
gamma:h,useGamma:n}=this.functionArguments,l=2<=this.rasterInfo.bandCount?3:1,A=n&&h?.length?p.computeGammaCorrection(l,h):[1,1,1],{minCutOff:t,maxCutOff:r}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};1===t.length&&(t[1]=t[2]=t[0],r[1]=r[2]=r[0]);const a=new Float32Array(l);var f;for(f=0;f<l;f++)a[f]=(g-b)/(r[f]-t[f]);f=P.isIntegerPixelType(this.outputPixelType);return{bandCount:l,outMin:b,outMax:g,minCutOff:t,maxCutOff:r,factor:a,useGamma:n,gamma:n&&h?h:[1,1,1],gammaCorrection:n&&A?
A:[1,1,1],stretchType:this.functionArguments.stretchType,isOutputRounded:f,type:"stretch"}}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",void 0);m.__decorate([w.property({type:z,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",void 0);m.__decorate([w.property({json:{write:!0}})],v.prototype,"lookup",void 0);m.__decorate([w.property({json:{write:!0}})],
v.prototype,"cutOffs",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.StretchFunction")],v)})},"esri/layers/support/rasterFunctions/StretchFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/jsonMap ../../../core/lang ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass ../../../core/accessorSupport/decorators/writer ./BaseFunctionArguments".split(" "),
function(m,w,v,J,F,R,P,U,D,z){var p;w=new w.JSONMap({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});z=p=class extends z{constructor(){super(...arguments);this.dynamicRangeAdjustment=this.computeGamma=!1;this.gamma=[];this.statistics=this.histograms=null;this.stretchType="none";this.useGamma=!1}writeStatistics(b,g,h){b?.length&&(Array.isArray(b[0])||(b=b.map(n=>[n.min,n.max,n.avg,n.stddev])),g[h]=b)}clone(){return new p({stretchType:this.stretchType,
outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:v.clone(this.statistics),gamma:v.clone(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:v.clone(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};m.__decorate([J.property({type:Boolean,json:{write:!0}})],z.prototype,
"computeGamma",void 0);m.__decorate([J.property({type:Boolean,json:{name:"dra",write:!0}})],z.prototype,"dynamicRangeAdjustment",void 0);m.__decorate([J.property({type:[Number],json:{write:!0}})],z.prototype,"gamma",void 0);m.__decorate([J.property()],z.prototype,"histograms",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],z.prototype,"maxPercent",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],z.prototype,"minPercent",void 0);m.__decorate([J.property({type:Number,
json:{write:!0}})],z.prototype,"numberOfStandardDeviations",void 0);m.__decorate([J.property({type:Number,json:{name:"max",write:!0}})],z.prototype,"outputMax",void 0);m.__decorate([J.property({type:Number,json:{name:"min",write:!0}})],z.prototype,"outputMin",void 0);m.__decorate([J.property({type:Number,json:{write:!0}})],z.prototype,"sigmoidStrengthLevel",void 0);m.__decorate([J.property({json:{type:[[Number]],write:!0}})],z.prototype,"statistics",void 0);m.__decorate([D.writer("statistics")],z.prototype,
"writeStatistics",null);m.__decorate([P.enumeration(w)],z.prototype,"stretchType",void 0);m.__decorate([J.property({type:Boolean,json:{write:!0}})],z.prototype,"useGamma",void 0);return z=p=m.__decorate([U.subclass("esri.layers.support.rasterFunctions.StretchFunctionArguments")],z)})},"esri/layers/support/rasterFunctions/TableFunction":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseRasterFunction ./TableFunctionArguments".split(" "),
function(m,w,v,J,F,R,P,U){v=class extends P{constructor(){super(...arguments);this.functionName="Table";this.functionArguments=null;this.rasterArgumentNames=["raster"];this.isNoopProcess=!0}_bindSourceRasters(){var D=this.sourceRasterInfos[0];if(1<D.bandCount||D.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const {attributeTableAsRecordSet:z}=this.functionArguments;if(!z)return{success:!1,supportsGPU:!1,
error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(D.pixelType);D=D.clone();D.pixelType=this.outputPixelType;D.bandCount=1;"thematic"!==D.dataType&&(D.keyProperties=D.keyProperties?{...D.keyProperties,DataType:"thematic"}:{DataType:"thematic"});this.rasterInfo=D;return{success:!0,supportsGPU:!0}}_processPixels(D){return D.pixelBlocks?.[0]}};m.__decorate([w.property({json:{write:!0,name:"rasterFunction"}})],v.prototype,"functionName",
void 0);m.__decorate([w.property({type:U,json:{write:!0,name:"rasterFunctionArguments"}})],v.prototype,"functionArguments",void 0);m.__decorate([w.property()],v.prototype,"rasterArgumentNames",void 0);m.__decorate([w.property()],v.prototype,"isNoopProcess",void 0);return v=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.TableFunction")],v)})},"esri/layers/support/rasterFunctions/TableFunctionArguments":function(){define("../../../chunks/tslib.es6 ../../../core/lang ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/accessorSupport/decorators/subclass ./BaseFunctionArguments".split(" "),
function(m,w,v,J,F,R,P){var U;J=U=class extends P{constructor(){super(...arguments);this.attributeTableAsRecordSet=null}clone(){return new U({attributeTableAsRecordSet:w.clone(this.attributeTableAsRecordSet)})}};m.__decorate([v.property({json:{write:!0}})],J.prototype,"attributeTableAsRecordSet",void 0);return J=U=m.__decorate([R.subclass("esri.layers.support.rasterFunctions.TableFunctionArguments")],J)})},"esri/renderers/support/rasterRendererHelper":function(){define("exports ../../Color ../../rasterRenderers ../../core/unitUtils ../../layers/support/Field ../FlowRenderer ./AuthoringInfo ./ClassBreakInfo ./colorRampUtils ./rasterRendererChecks ./UniqueValueInfo ../visualVariables/ColorVariable ../visualVariables/SizeVariable ../visualVariables/support/ColorStop ../../rest/support/ClassBreaksDefinition ../../rest/support/generateRendererUtils ../../rest/support/MultipartColorRamp ../../symbols/SimpleFillSymbol ../RasterStretchRenderer ../UniqueValueRenderer ../RasterColormapRenderer ../RasterShadedReliefRenderer ../ClassBreaksRenderer ../VectorFieldRenderer".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h,n,l,A,t,r,a,f,d,e,c){function k(V,B){V=q(V,B?.variableName);const {bandCount:Q}=V;let {bandIds:T,stretchType:X}=B||{};T?.some(fa=>fa>=Q)&&(T=null);let aa=V.statistics,Z=V.histograms;1<Q?(T=T?.length?T:u(V),aa=null==aa?null:T?.map(fa=>aa[fa]),Z=null==Z?null:T?.map(fa=>Z[fa])):T=[0];null==X&&(X=y(V));let ba=!1;switch(X){case "none":ba=!1;break;case "percent-clip":ba=!Z?.length;break;default:ba=!aa?.length}var {dataType:ea}=V;ea=1===T?.length&&W.has(ea)?S:null;ea=
new r({stretchType:X,dynamicRangeAdjustment:ba,colorRamp:ea,outputMin:0,outputMax:255,gamma:1===T?.length?[1]:[1,1,1],useGamma:!1});"percent-clip"===X?ea.maxPercent=ea.minPercent=.25:"standard-deviation"===X&&(ea.numberOfStandardDeviations=2);if(!ba&&(null!=V.multidimensionalInfo||B?.includeStatisticsInStretch))if("percent-clip"===X)ea.histograms=Z;else if("min-max"===X||"standard-deviation"===X)ea.statistics=aa;return ea}function q(V,B){var {multidimensionalInfo:Q}=V;if(!B||!Q)return V;Q=Q.variables.find(T=>
T.name===B);if(!Q)return V;V=V.clone();if(Q){const {statistics:T,histograms:X}=Q;T?.length&&(V.statistics=T.map(aa=>({min:aa.min,max:aa.max,avg:aa.avg,stddev:aa.stddev})));X?.length&&(V.histograms=X)}return V}function u(V){const B=V.bandCount;if(1===B)return null;if(2===B)return[0];({bandInfos:V}=V);let Q;if(V.length===B){const {red:T,green:X,blue:aa,nir:Z}=G(V);null!=T&&null!=X&&null!=aa?Q=[T,X,aa]:null!=Z&&null!=T&&null!=X&&(Q=[Z,T,X])}!Q&&3<=B&&(Q=[0,1,2]);return Q}function G(V){const B={};for(let X=
0;X<V.length;X++){var Q=V[X],T=Q.name.toLowerCase();"red"===T?B.red=X:"green"===T?B.green=X:"blue"===T?B.blue=X:"nearinfrared"===T||"nearinfrared_1"===T||"nir"===T?B.nir=X:Q.maxWavelength&&Q.minWavelength&&(T=Q.minWavelength,Q=Q.maxWavelength,null==B.blue&&410<=T&&480>=T&&480<=Q&&540>=Q?B.blue=X:null==B.green&&490<=T&&560>=T&&560<=Q&&610>=Q?B.green=X:null==B.red&&595<=T&&670>=T&&660<=Q&&730>=Q?B.red=X:null==B.nir&&700<=T&&860>=T&&800<=Q&&950>=Q&&(B.nir=X))}return B}function y(V){let B="percent-clip";
const {pixelType:Q,dataType:T,histograms:X,statistics:aa,multidimensionalInfo:Z}=V;V=W.has(T)||"generic"===T&&null!=Z;"u8"!==Q||"processed"!==T&&null!=X&&null!=aa?"u8"===Q||"elevation"===T||V?B="min-max":null!=X?B="percent-clip":null!=aa&&(B="min-max"):B="none";return B}function C(V,B,Q,T){if(!z.isUVRendererSupported(V,B))return null;const {attributeTable:X,statistics:aa}=V,Z=H(X,B),ba=M(X,"red"),ea=M(X,"green"),fa=M(X,"blue");V=new P;const la=[],ja=new Set,pa=!!(ba&&ea&&fa);if(null!=X)X.features.forEach(ma=>
{var oa=ma.attributes[Z.name];ja.has(ma.attributes[Z.name])||null==oa||(ja.add(oa),oa=!pa||"single"!==ba.type&&"double"!==ba.type||"single"!==ea.type&&"double"!==ea.type||"single"!==fa.type&&"double"!==fa.type||X.features.some(qa=>1<qa.attributes[ba.name]||1<qa.attributes[ea.name]||1<qa.attributes[fa.name])?1:255,la.push(new p({value:ma.attributes[Z.name],label:ma.attributes[Z.name]+"",symbol:new t({style:"solid",outline:null,color:pa?new w([ma.attributes[ba.name]*oa,ma.attributes[ea.name]*oa,ma.attributes[fa.name]*
oa,1]):new w([0,0,0,0])})})))});else if(aa?.[0])for(B=aa[0].min;B<=aa[0].max;B++)la.push(new p({value:B,label:B.toString(),symbol:new t({style:"solid",outline:null,color:new w([0,0,0,0])})}));la.sort((ma,oa)=>ma.value&&"string"===typeof ma.value.valueOf()?0:ma.value>oa.value?1:-1);if(!pa){const ma=D.convertColorRampToColormap(O,{numColors:la.length});la.forEach((oa,qa)=>oa.symbol.color=new w(ma[qa].slice(1,4)));V.colorRamp=O}if(Q||T){const ma=Q||D.convertColorRampToColormap(T,{numColors:la.length}).map(oa=>
oa.slice(1));la.forEach((oa,qa)=>oa.symbol.color=new w(ma[qa]));V.colorRamp=T}return new a({field:Z.name,uniqueValueInfos:la,authoringInfo:V})}function H(V,B,Q){let T;null!=V?(T=B?V.fields.find(X=>B.toLowerCase()===X.name.toLowerCase()):x(V.fields),T||(Q||(T=V.fields.find(X=>"string"===X.type)),T||=M(V,"value"))):T=new F({name:"value"});return T}function x(V){let B;for(let Q=0;Q<V.length;Q++){const T=V[Q].name.toLowerCase();if("string"===V[Q].type){if(T.startsWith("class")){B=V[Q];break}null==B&&
(T.endsWith("name")||T.endsWith("type"))&&(B=V[Q])}}return B}function M(V,B){return null==V?null:V.fields.find(Q=>Q.name.toLowerCase()===B)}function L(V){if(!z.isColormapRendererSupported(V))return null;let B;const {attributeTable:Q,colormap:T}=V;if(null!=Q){const X=M(Q,"value"),aa=H(Q,null,!0);"string"===aa.type&&(B={},Q.features.forEach(Z=>{Z=Z.attributes;B[Z[X.name]]=aa?Z[aa.name]:Z[X.name]}))}return f.createFromColormap(T,B)}function N(V,B,Q){let T=0,X=0;null!=V.attributeTable?(V=V.attributeTable,
T=X=V.features[0].attributes[B.name],V.features.forEach(aa=>{aa=aa.attributes[B.name];aa<T&&(T=aa);aa>X&&(X=aa)})):null!=V.histograms&&(V=V.histograms,T=V[0].min,X=V[0].max);return(X-T)/Q}function E(V){if(!z.isVectorFieldRendererSupported(V))return null;if(null!=V.statistics&&V.statistics.length&&("vector-magdir"===V.dataType||"vector-uv"===V.dataType)){const {minMagnitude:Q,maxMagnitude:T}=K(V.dataType,V.statistics);var B=[new g({field:"Magnitude",minSize:10,maxSize:40,minDataValue:Q,maxDataValue:T})]}V=
null!=V.multidimensionalInfo?Y.get(V.multidimensionalInfo.variables[0].unit):void 0;B=new c({visualVariables:B,inputUnit:V,rotationType:"geographic"});B.visualVariables=[...B.sizeVariables,...B.rotationVariables];return B}function I(V){return{color:V.symbolLayers[0].material?.color,type:"esriSFS",style:"esriSFSSolid"}}function K(V,B){if("vector-magdir"===V)V=B[0].min,B=B[0].max;else{const Q=B[0].min,T=B[0].max,X=B[1].min;B=B[1].max;V=0;B=Math.max(Math.abs(Q),Math.abs(X),Math.abs(T),Math.abs(B))}return{minMagnitude:V,
maxMagnitude:B}}const S=A.fromJSON({type:"multipart",colorRamps:[{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]}),O=A.fromJSON(D.predefinedJsonColorRamps[0]),W=new Set("scientific standard-time vector-uv vector-magdir vector-u vector-v vector-magnitude vector-direction".split(" ")),Y=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);
m.createClassBreaksRenderer=function(V,B){V=q(V,B?.variableName);const {attributeTable:Q}=V;if(!z.isClassBreaksSupported(V))return null;const T=null!=V.histograms?V.histograms[0]:null,X=null!=B?.numClasses&&isFinite(B?.numClasses)?B.numClasses:5,aa=new P({classificationMethod:B?.classificationMethod,colorRamp:B?.colorRamp});let Z=B?.field||"value";const ba=[],ea=[],fa=null!=Q,la=fa&&Q.fields.find(qa=>"count"===qa.name.toLowerCase()),ja=fa?Q.fields.find(qa=>qa.name.toLowerCase()===Z.toLowerCase()):
void 0;if(ja&&fa){Z=ja.name;const qa=Q.features.length;let ta=0;Q.features.forEach(sa=>ta+=(la?sa.attributes[la.name]:50)/qa);Q.features.forEach(sa=>{const ra=sa.attributes[ja.name];sa=la?sa.attributes[la.name]:50;if(0<sa){ea.push(sa);sa=Math.max(1,Math.round(sa/qa/ta*1E3));for(let xa=0;xa<sa;xa++)ba.push(ra)}})}else{var {pixelType:pa}=V;const qa=(T.max-T.min)/T.size,ta=(pa=pa.includes("s")||pa.includes("u"))&&1===qa?Math.floor(T.min+.5):T.min,sa=pa&&1===qa?Math.floor(T.max-.5):T.max,ra=T.size;let xa=
0,va;T.counts.forEach(ya=>xa+=ya/ra);T.counts.forEach((ya,ca)=>{if(0<ya)for(ea.push(ya),ya=Math.max(1,Math.round(ya/ra/xa*1E3)),va=fa?Q.features[ca].attributes[ja.name]:0===ca?ta:ca===ra-1?sa:T.min+qa*(ca+.5),ca=0;ca<ya;ca++)ba.push(va)})}pa=B?.classificationMethod||"natural-breaks";let ma=B?.definedInterval;"defined-interval"!==pa||ma||(ma=N(V,ja,X));V=l.createGenerateRendererClassBreaks({values:ba,valueFrequency:ea,normalizationTotal:null,definition:new n({classificationMethod:pa,breakCount:X,definedInterval:ma})});
let oa=B?.colors;oa||(B=B?.colorRamp||S,aa.colorRamp=B,oa=D.convertColorRampToColormap(B,{numColors:V.classBreaks.length,interpolateAlpha:!0}).map(qa=>qa.slice(1)));B=V.classBreaks.map((qa,ta)=>new U({minValue:qa.minValue,maxValue:qa.maxValue,label:qa.label,symbol:new t({color:oa[ta]})}));return new e({field:Z,classBreakInfos:B,authoringInfo:aa})};m.createColormapRenderer=L;m.createDefaultRenderer=function(V,B){const {attributeTable:Q,colormap:T}=V;if(z.isVectorFieldRendererSupported(V)){var X=E(V);
if(null!=X)return X}return B?.rasterFunctionColorRamp?(V=k(V,B),V.colorRamp=B.rasterFunctionColorRamp,V):null!=T&&(X=L(V),null!=X)||null!=Q&&(X=C(V),null!=X)?X:k(V,B)};m.createFlowRenderer=function(V){if(!z.isFlowRendererSupported(V))return null;let B;if(null!=V.statistics&&0<V.statistics.length&&("vector-magdir"===V.dataType||"vector-uv"===V.dataType)){const {minMagnitude:Q,maxMagnitude:T}=K(V.dataType,V.statistics);B=[new b({field:"Magnitude",stops:[new h({value:Q,color:new w("#1020C0")}),new h({value:T,
color:new w("#C02010")})]})]}return new R({visualVariables:B})};m.createShadedReliefRenderer=function(V,B="traditional"){if(!z.isShadedReliefRendererSupported(V))return null;({extent:V}=V);V=V.width*J.getMetersPerUnitForSR(V.spatialReference);return new d({hillshadeType:B,scalingType:5E6<V?"adjusted":"none"})};m.createStretchRenderer=k;m.createUVRenderer=C;m.createVectorFieldRenderer=E;m.estimateMagnitudeRange=K;m.getBandNames=function(V,B){const Q=V.bandInfos.map(({name:T})=>T);return B?.length?
B.map(T=>Q[T]):Q};m.getClassField=H;m.getDefaultBandCombination=u;m.getDefaultInterpolation=function(V,B,Q){const T=Q?.toLowerCase().replace("bicubic","cubic");Q=["nearest","bilinear","cubic","majority"].find(X=>X===T);return"Map"===B?Q??"bilinear":"standard-time"===V.dataType?Q??"nearest":"thematic"===V.dataType||V.attributeTable||V.colormap?"nearest"===Q||"majority"===Q?Q:"nearest":Q??"bilinear"};m.getDefinedInterval=N;m.getField=M;m.getFunctionColorramp=function(V){return"Function"===V.datasetFormat&&
"Colormap"===V.rasterFunction.functionName?V.rasterFunction.colorRamp:void 0};m.getSupportedRendererTypes=function(V,B=!1){const Q=["raster-stretch"];z.isColormapRendererSupported(V,B)&&Q.push("raster-colormap");z.isUVRendererSupported(V)&&Q.push("unique-value");z.isClassBreaksSupported(V,B)&&Q.push("class-breaks");z.isShadedReliefRendererSupported(V)&&Q.push("raster-shaded-relief");z.isVectorFieldRendererSupported(V)&&Q.push("vector-field");z.isFlowRendererSupported(V)&&Q.push("flow");return Q};
m.getVariableRasterInfo=q;m.getWellKnownBandIndexes=G;m.normalizeRendererJSON=function(V){if("uniqueValue"===V.type){var B=V.uniqueValueInfos;B?.[0].symbol?.symbolLayers?.length&&(V.uniqueValueInfos=B?.map(Q=>({value:Q.value,label:Q.label,symbol:Q.symbol?I(Q.symbol):null})));return V}"classBreaks"===V.type&&(B=V.classBreakInfos,B[0].symbol?.symbolLayers?.length&&(V.classBreakInfos=B.map(Q=>({classMinValue:Q.classMinValue,classMaxValue:Q.classMaxValue,label:Q.label,symbol:Q.symbol?I(Q.symbol):null}))));
return V};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/renderers/support/rasterRendererChecks":function(){define(["exports"],function(m){function w(v){return["u8","s8"].includes(v.pixelType)&&null!=v.statistics?.[0]?.min&&null!=v.statistics[0]?.max&&1===v.bandCount}m.isClassBreaksSupported=function(v,J=!1){const {attributeTable:F,bandCount:R}=v;return 1===R&&(!J||null!=F||null!=v.histograms)};m.isColormapRendererSupported=function(v,J=!1){const {bandCount:F,colormap:R,pixelType:P}=
v;return 1===F&&(!!R?.length||!J&&"u8"===P)};m.isFlowRendererSupported=function(v){({dataType:v}=v);return"vector-uv"===v||"vector-magdir"===v};m.isShadedReliefRendererSupported=function(v){const {bandCount:J,dataType:F,pixelType:R}=v;return"elevation"===F||"generic"===F&&1===J&&("s16"===R||"s32"===R||"f32"===R||"f64"===R)};m.isSingleBand8BitRasterWithStats=w;m.isUVRendererSupported=function(v,J){const {attributeTable:F,bandCount:R}=v;return null==F&&w(v)?!0:null==F||1<R||J&&null==F.fields.find(P=>
P.name.toLowerCase()===J.toLowerCase())?!1:!0};m.isVectorFieldRendererSupported=function(v){({dataType:v}=v);return"vector-uv"===v||"vector-magdir"===v};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/rest/support/ClassBreaksDefinition":function(){define("../../chunks/tslib.es6 ../../core/jsonMap ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/enumeration ../../core/accessorSupport/decorators/subclass".split(" "),
function(m,w,v,J,F,R,P,U,D){F=new w.JSONMap({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"});w=new w.JSONMap({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});v=class extends v.JSONSupport{constructor(z){super(z);this.type="class-breaks-definition";
this.normalizationType=this.normalizationField=this.classificationMethod=this.classificationField=this.breakCount=null}set standardDeviationInterval(z){"standard-deviation"===this.classificationMethod&&this._set("standardDeviationInterval",z)}set definedInterval(z){"defined-interval"===this.classificationMethod&&this._set("definedInterval",z)}};m.__decorate([U.enumeration({classBreaksDef:"class-breaks-definition"})],v.prototype,"type",void 0);m.__decorate([J.property({json:{write:!0}})],v.prototype,
"breakCount",void 0);m.__decorate([J.property({json:{write:!0}})],v.prototype,"classificationField",void 0);m.__decorate([J.property({type:String,json:{read:F.read,write:F.write}})],v.prototype,"classificationMethod",void 0);m.__decorate([J.property({json:{write:!0}})],v.prototype,"normalizationField",void 0);m.__decorate([J.property({json:{read:w.read,write:w.write}})],v.prototype,"normalizationType",void 0);m.__decorate([J.property({value:null,json:{write:!0}})],v.prototype,"standardDeviationInterval",
null);m.__decorate([J.property({value:null,json:{write:!0}})],v.prototype,"definedInterval",null);return v=m.__decorate([D.subclass("esri.rest.support.ClassBreaksDefinition")],v)})},"esri/rest/support/generateRendererUtils":function(){define(["exports","../../core/Logger"],function(m,w){function v(b){var g=b.definition;const {classificationMethod:h,normalizationType:n,definedInterval:l}=g;g=g.breakCount??1;const A=[];var t=b.values;if(0===t.length)return[];t=t.sort((c,k)=>c-k);var r=t[0],a=t[t.length-
1];if("equal-interval"===h)if(t.length>=g){t=(a-r)/g;b=r;for(var f=1;f<g;f++){var d=Number((r+f*t).toFixed(6));A.push({minValue:b,maxValue:d,label:J(b,d,n)});b=d}A.push({minValue:b,maxValue:a,label:J(b,a,n)})}else t.forEach(c=>{A.push({minValue:c,maxValue:c,label:J(c,c,n)})});else if("natural-breaks"===h){t=F(t);b=R(t.uniqueValues,b.valueFrequency||t.valueFrequency,g);for(f=1;f<g;f++)t.uniqueValues.length>f&&(d=Number(t.uniqueValues[b[f]].toFixed(6)),A.push({minValue:r,maxValue:d,label:J(r,d,n)}),
r=d);A.push({minValue:r,maxValue:a,label:J(r,a,n)})}else if("quantile"===h)if(t.length>=g&&r!==a){b=Math.ceil(t.length/g);f=0;for(d=1;d<g;d++){var e=b+f-1;e>t.length&&(e=t.length-1);0>e&&(e=0);A.push({minValue:r,maxValue:t[e],label:J(r,t[e],n)});r=t[e];f+=b;b=Math.ceil((t.length-f)/(g-d))}A.push({minValue:r,maxValue:a,label:J(r,a,n)})}else for(g=-1,a=0;a<t.length;a++)r=t[a],r!==g&&(g=r,A.push({minValue:g,maxValue:r,label:J(g,r,n)}),g=r);else if("standard-deviation"===h)if(b=D(t),f=z(t,b),0===f)A.push({minValue:t[0],
maxValue:t[0],label:J(t[0],t[0],n)});else{t=U(r,a,g,b,f)*f;f=0;for(d=g;1<=d;d--)e=Number((b-(d-.5)*t).toFixed(6)),A.push({minValue:r,maxValue:e,label:J(r,e,n)}),r=e,f++;d=Number((b+.5*t).toFixed(6));A.push({minValue:r,maxValue:d,label:J(r,d,n)});r=d;f++;for(e=1;e<=g;e++)d=f===2*g?a:Number((b+(e+.5)*t).toFixed(6)),A.push({minValue:r,maxValue:d,label:J(r,d,n)}),r=d,f++}else if("defined-interval"===h){if(!l)return A;g=t[0];a=t[t.length-1];t=Math.ceil((a-g)/l);r=g;for(b=1;b<t;b++)f=Number((g+b*l).toFixed(6)),
A.push({minValue:r,maxValue:f,label:J(r,f,n)}),r=f;A.push({minValue:r,maxValue:a,label:J(r,a,n)})}return A}function J(b,g,h){let n=null;return n=b===g?h&&"percent-of-total"===h?b+"%":b.toString():h&&"percent-of-total"===h?b+"% - "+g+"%":b+" - "+g}function F(b){const g=[],h=[];let n=Number.MIN_VALUE,l=1,A=-1;for(let t=0;t<b.length;t++){const r=b[t];r===n?(l++,h[A]=l):null!==r&&(g.push(r),n=r,l=1,h.push(l),A++)}return{uniqueValues:g,valueFrequency:h}}function R(b,g,h){var n=b.length;const l=[];h>n&&
(h=n);for(var A=0;A<h;A++)l.push(Math.round(A*n/h-1));l.push(n-1);A=P(l,b,g,h);n=A.mean;A=A.sdcm;var t=h,r=0,a=0;let f=0,d=0,e=!0;for(let k=0;2>k&&e;k++){0===k&&(e=!1);for(var c=0;c<t-1;c++)for(;l[c+1]+1!==l[c+2];)if(l[c+1]+=1,r=p(c,l,b,g),f=r.sbMean,r=r.sbSdcm,a=p(c+1,l,b,g),d=a.sbMean,a=a.sbSdcm,r+a<A[c]+A[c+1])A[c]=r,A[c+1]=a,n[c]=f,n[c+1]=d,e=!0;else{--l[c+1];break}for(c=t-1;0<c;c--)for(;l[c]!==l[c-1]+1;)if(--l[c],r=p(c-1,l,b,g),f=r.sbMean,r=r.sbSdcm,a=p(c,l,b,g),d=a.sbMean,a=a.sbSdcm,r+a<A[c-
1]+A[c])A[c-1]=r,A[c]=a,n[c-1]=f,n[c]=d,e=!0;else{l[c]+=1;break}}e&&(A=P(l,b,g,h));return l}function P(b,g,h,n){let l=[];var A=[],t=[];let r=0;const a=[],f=[];for(var d=0;d<n;d++){var e=p(d,b,g,h);a.push(e.sbMean);f.push(e.sbSdcm);r+=f[d]}e=r;for(d=!0;d||r<e;){d=!1;l=[];for(A=0;A<n;A++)l.push(b[A]);for(t=0;t<n;t++)for(e=b[t]+1;e<=b[t+1];e++)if(A=g[e],0<t&&e!==b[t+1]&&Math.abs(A-a[t])>Math.abs(A-a[t-1]))b[t]=e;else if(t<n-1&&b[t]!==e-1&&Math.abs(A-a[t])>Math.abs(A-a[t+1])){b[t+1]=e-1;break}e=r;r=0;
A=[];t=[];for(let c=0;c<n;c++){A.push(a[c]);t.push(f[c]);const k=p(c,b,g,h);a[c]=k.sbMean;f[c]=k.sbSdcm;r+=f[c]}}if(r>e){for(g=0;g<n;g++)b[g]=l[g],a[g]=A[g],f[g]=t[g];r=e}return{mean:a,sdcm:f}}function U(b,g,h,n,l){b=Math.max(n-b,g-n)/l/h;return 1<=b?1:.5<=b?.5:.25}function D(b){let g=0;for(let h=0;h<b.length;h++)g+=b[h];return g/=b.length}function z(b,g){let h=0;for(let n=0;n<b.length;n++){const l=b[n];h+=(l-g)*(l-g)}h/=b.length;return Math.sqrt(h)}function p(b,g,h,n){var l=0,A=0;for(var t=g[b]+
1;t<=g[b+1];t++){const r=n[t];l+=h[t]*r;A+=r}0>=A&&w.getLogger("esri.rest.support.generateRendererUtils").warn("Exception in Natural Breaks calculation");l/=A;A=0;for(t=g[b]+1;t<=g[b+1];t++)A+=n[t]*(h[t]-l)**2;return{sbMean:l,sbSdcm:A}}m.createGenerateRendererClassBreaks=function(b){const {normalizationTotal:g}=b;return{classBreaks:v(b),normalizationTotal:g}};m.createGenerateRendererUniqueValues=function(b){b=F(b);const g=[],h=b.uniqueValues.length;for(let n=0;n<h;n++){const l=b.uniqueValues[n];g.push({value:l,
count:b.valueFrequency[n],label:l.toString()})}return{uniqueValues:g}};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/renderers/support/RasterSymbolizer":function(){define("../../chunks/tslib.es6 ../../core/colorUtils ../../core/JSONSupport ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/has ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../layers/support/RasterInfo ../../layers/support/rasterFunctions/pixelUtils ../../layers/support/rasterFunctions/stretchUtils ../../layers/support/rasterFunctions/surfaceUtils ./colorRampUtils ./rasterRendererChecks".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h){function n(a){return!!a?.length&&16384>=a.length}function l(a){return"percentClip"===a||"histogramEqualization"===a}function A(a){return null!=a&&0<a.length&&null!=a[0].min&&null!=a[0].max}function t(a){return z.isValidPixelBlock(a)&&0!==a.validPixelCount}function r(a){return"algorithmic"===a.type&&["0,0,0,255","0,0,0"].includes(a.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(a.toColor.join(","))}v=class extends v.JSONSupport{constructor(a){super(a)}bind(){const {rendererJSON:a}=
this;if(!a)return{success:!1};this.lookup={rendererJSON:{}};let f;switch(a.type){case "uniqueValue":f=this._updateUVRenderer(a);break;case "rasterColormap":f=this._updateColormapRenderer(a);break;case "rasterStretch":f=this._updateStretchRenderer(a);break;case "classBreaks":f=this._updateClassBreaksRenderer(a);break;case "rasterShadedRelief":f=this._updateShadedReliefRenderer(a);break;case "vectorField":f=this._updateVectorFieldRenderer();break;case "flowRenderer":f=this._updateFlowRenderer()}return f}symbolize(a){let f=
a?.pixelBlock;if(!t(f))return f;if(a.simpleStretchParams&&"rasterStretch"===this.rendererJSON.type)return this.simpleStretch(f,a.simpleStretchParams);try{3<f.pixels.length&&(f=f.extractBands(a.bandIds??[0,1,2]));let d;switch(this.rendererJSON.type){case "uniqueValue":case "rasterColormap":d=this._symbolizeColormap(f);break;case "classBreaks":d=this._symbolizeClassBreaks(f);break;case "rasterStretch":d=this._symbolizeStretch(f,a.bandIds);break;case "rasterShadedRelief":const e=a.extent;d=this._symbolizeShadedRelief(f,
{isGCS:e.spatialReference.isGeographic,resolution:{x:(e.xmax-e.xmin)/f.width,y:(e.ymax-e.ymin)/f.height}})}return d}catch(d){return J.getLogger(this).error("symbolize",d.message),f}}simpleStretch(a,f){if(!t(a))return a;try{return 3<a.pixels.length&&(a=a.extractBands([0,1,2])),p.stretch(a,{...f,isRenderer:!0})}catch(d){return J.getLogger(this).error("symbolize",d.message),a}}generateWebGLParameters(a){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const {indexedColormap:k,
offset:q}=this.lookup.colormapLut||{};return{colormap:k,colormapOffset:q,type:"lut"}}const {pixelBlock:f,isGCS:d,resolution:e,bandIds:c}=a;({rendererJSON:a}=this);return"rasterStretch"===a.type?this._generateStretchWebGLParams(f,a,c):"rasterShadedRelief"===a.type?this._generateShadedReliefWebGLParams(a,d,e??void 0):"vectorField"===a.type?this._generateVectorFieldWebGLParams(a):null}_isLUTChanged(a){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const f=this.rendererJSON.colorRamp;
if(a)return JSON.stringify(f)!==JSON.stringify(this.lookup.rendererJSON.colorRamp);({...this.rendererJSON});({...this.lookup.rendererJSON})}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(a){return this._isLUTChanged()&&!this.bind().success?a:z.colorize(a,this.lookup.colormapLut)}_symbolizeClassBreaks(a){const {canUseIndexedLUT:f}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?a:f?z.colorize(a,this.lookup.colormapLut):
z.remapColor(a,this.lookup.remapLut??[])}_symbolizeStretch(a,f){const {rasterInfo:d}=this,{pixelType:e,bandCount:c}=d,k=this.rendererJSON;var q=["u8","u16","s8","s16"].includes(e);let u;var {dra:G}=k;({gamma:y}=this.lookup);if("histogramEqualization"===k.stretchType){q=G?null:this.lookup?.histogramLut;f=p.getStretchCutoff(k,{rasterInfo:d,pixelBlock:a,bandIds:f,returnHistogramLut:!q});var y=p.stretch(a,{...f,gamma:y,isRenderer:!0});y=z.lookupPixels(y,{lut:G?f.histogramLut:q,offset:0})}else if(q){if(G)G=
p.getStretchCutoff(k,{rasterInfo:d,pixelBlock:a,bandIds:f}),u=p.createStretchLUT({pixelType:e,...G,gamma:y,rounding:"floor"});else{if(this._isLUTChanged()&&!this.bind().success)return a;u=this.lookup?this.lookup.stretchLut:null}if(!u)return a;1<c&&null!=f&&f.length===a?.pixels.length&&u?.lut.length===c&&(u={lut:f.map(C=>u.lut[C]),offset:u.offset});y=z.lookupPixels(a,u)}else G=p.getStretchCutoff(k,{rasterInfo:d,pixelBlock:a,bandIds:f}),y=p.stretch(a,{...G,gamma:y,isRenderer:!0});if(k.colorRamp){if(this._isLUTChanged(!0)&&
!this.bind().success)return a;y=z.colorize(y,this.lookup?.colormapLut)}return y}_symbolizeShadedRelief(a,f){var d=this.rendererJSON;f=b.hillshade(a,{...d,...f});if(!d.colorRamp||this._isLUTChanged(!0)&&!this.bind().success)return f;d=this.lookup?this.lookup.hsvMap:null;if(!d)return f;b.tintHillshade(f,a,d,this.rasterInfo.statistics?.[0]??{min:0,max:8E3});return f}_isVectorFieldData(){const {bandCount:a,dataType:f}=this.rasterInfo;return 2===a&&("vector-magdir"===f||"vector-uv"===f)}_updateVectorFieldRenderer(){return this._isVectorFieldData()?
{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(a){const {bandCount:f,attributeTable:d,pixelType:e}=this.rasterInfo,c=a.field1;if(!c)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};
const k=a.defaultSymbol;var q=1===f&&["u8","s8"].includes(e);if(!h.isUVRendererSupported(this.rasterInfo,c)&&!q)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const u=[];if(null!=d){const G=d.fields.find(y=>"value"===y.name.toLowerCase());if(!G)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};d.features.forEach(y=>{const C=a.uniqueValueInfos?.find(H=>
String(H.value)===String(y.attributes[c]))?.symbol?.color;C?u.push([y.attributes[G.name]].concat(C)):k&&u.push([y.attributes[G.name]].concat(k.color))})}else{if("value"!==c.toLowerCase())return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not available.'};a.uniqueValueInfos?.forEach(G=>{const y=G?.symbol?.color;y?u.push([parseInt(""+G.value,10)].concat(y)):k&&u.push([parseInt(""+G.value,10)].concat(k?.color))})}if(0===u.length)return{success:!1,
error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};q=z.createColormapLUT({colormap:u});this.lookup={rendererJSON:a,colormapLut:q};this.canRenderInWebGL=n(q?.indexedColormap);return{success:!0}}_updateColormapRenderer(a){if(!h.isColormapRendererSupported(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};var f=a.colormapInfos.map(d=>[d.value].concat(d.color)).sort((d,e)=>d[0]-e[0]);if(!f||0===f.length)return{success:!1,
error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};f=z.createColormapLUT({colormap:f});this.lookup={rendererJSON:a,colormapLut:f};this.canRenderInWebGL=n(f?.indexedColormap);return{success:!0}}_updateShadedReliefRenderer(a){if(!h.isShadedReliefRendererSupported(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(a.colorRamp){var f=g.convertColorRampToColormap(a.colorRamp,
{interpolateAlpha:!0});f=z.createColormapLUT({colormap:f});const d=[],e=f.indexedColormap;for(let c=0;c<e.length;c+=4){const k=w.toHSV({r:e[c],g:e[c+1],b:e[c+2]});d.push([k.h/60,k.s/100,255*k.v/100])}this.lookup={rendererJSON:a,colormapLut:f,hsvMap:d}}else this.lookup=null;this.canRenderInWebGL=!0;return{success:!0}}_analyzeClassBreaks(a){const {attributeTable:f,pixelType:d}=this.rasterInfo,e=null!=f?f.fields.find(q=>"value"===q.name.toLowerCase()):null,c=null!=f?f.fields.find(q=>q.name.toLowerCase()===
a.field.toLowerCase()):null,k=null!=e&&null!==c;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(d)||k,tableValueField:e,tableBreakField:c}}_updateClassBreaksRenderer(a){var {attributeTable:f}=this.rasterInfo;const {canUseIndexedLUT:d,tableValueField:e,tableBreakField:c}=this._analyzeClassBreaks(a);var k=a.classBreakInfos;if(!k?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};k=k.sort((C,H)=>C.classMaxValue-H.classMaxValue);var q=
k[k.length-1],u=a.minValue;if(!d){var G=[];for(var y=0;y<k.length;y++)G.push({value:k[y].classMinValue??u,mappedColor:k[y].symbol.color}),u=k[y].classMaxValue;G.push({value:q.classMaxValue,mappedColor:q.symbol.color});this.lookup={rendererJSON:a,remapLut:G};this.canRenderInWebGL=!1;return{success:!0}}G=[];if(null!=f&&null!=e&&null!==c&&e!==c){q=e.name;const C=c.name,H=k[k.length-1],{classMaxValue:x}=H;u=a.minValue;for(y of f.features){f=y.attributes[q];const M=y.attributes[C],L=M===x?H:M<u?null:k.find(({classMaxValue:N})=>
N>M);L&&G.push([f].concat(L.symbol.color))}}else{u=Math.floor(a.minValue);for(y=0;y<k.length;y++){for(f=k[y];u<f.classMaxValue;u++)G.push([u].concat(f.symbol.color));u=Math.ceil(f.classMaxValue)}q.classMaxValue===u&&G.push([q.classMaxValue].concat(q.symbol.color))}k=z.createColormapLUT({colormap:G,fillUnspecified:!1});this.lookup={rendererJSON:a,colormapLut:k};this.canRenderInWebGL=n(k?.indexedColormap);return{success:!0}}_updateStretchRenderer(a){let {stretchType:f,dra:d}=a;if(!("none"===f||a.statistics?.length||
A(this.rasterInfo.statistics)||d))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};var e=a.histograms||this.rasterInfo.histograms;!l(a.stretchType)||e?.length||d||(f="minMax");const {computeGamma:c,useGamma:k,colorRamp:q}=a;let {gamma:u}=a;k&&c&&!u?.length&&(u=p.computeGammaValues(this.rasterInfo.pixelType,a.statistics?.length?a.statistics:this.rasterInfo.statistics));var G=this.rasterInfo.pixelType;const y=!d&&["u8",
"u16","s8","s16"].includes(G);"histogramEqualization"===f?(G=e.map(C=>p.createHistogramEqualizationLUT(C)),this.lookup={rendererJSON:a,histogramLut:G}):y&&(e=p.getStretchCutoff(a,{rasterInfo:this.rasterInfo}),G=p.createStretchLUT({pixelType:G,...e,gamma:k?u:null,rounding:"floor"}),this.lookup={rendererJSON:a,stretchLut:G});q&&!r(q)&&(G=g.convertColorRampToColormap(q,{interpolateAlpha:!0}),this.lookup||(this.lookup={rendererJSON:a}),this.lookup.colormapLut=z.createColormapLUT({colormap:G}),this.lookup.rendererJSON=
a);this.lookup.gamma=k&&u?.length?u:null;this.canRenderInWebGL=!0;return{success:!0}}_generateStretchWebGLParams(a,f,d){let e=null,c=null;var k=this.lookup?.colormapLut;f.colorRamp&&k&&(e=k.indexedColormap,c=k.offset);"histogramEqualization"===f.stretchType&&(f={...f,stretchType:"minMax"});({gamma:k}=this.lookup);const q=!(!f.useGamma||!k?.some(L=>1!==L)),{minCutOff:u,maxCutOff:G,outMin:y,outMax:C}=p.getStretchCutoff(f,{rasterInfo:this.rasterInfo,pixelBlock:a,bandIds:d});var H=0;null!=a&&(H=a.getPlaneCount(),
2===H&&(a=a.clone(),a.statistics=[a.statistics[0]],a.pixels=[a.pixels[0]]));({bandCount:a}=this.rasterInfo);d=Math.min(3,d?.length||H||a,a);a=new Float32Array(d);H=e||q?1:255;let x;for(x=0;x<u.length;x++)a[x]=G[x]===u[x]?0:(C-y)/(G[x]-u[x])/H;const M=new Float32Array(d);if(q&&k)for(x=0;x<d;x++)M[x]=1<k[x]?2<k[x]?6.5+(k[x]-2)**2.5:6.5+100*(2-k[x])**4:1;return{bandCount:d,outMin:y/H,outMax:C/H,minCutOff:u,maxCutOff:G,factor:a,useGamma:q,gamma:q?k:[1,1,1],gammaCorrection:q?M:[1,1,1],colormap:e,colormapOffset:c,
stretchType:f.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(a,f=!1,d={x:0,y:0}){let e=null,c=null;const k=this.lookup?.colormapLut;a.colorRamp&&k&&(e=k.indexedColormap,c=k.offset);f=b.calculateHillshadeParams({...a,isGCS:f,resolution:d});d=this.rasterInfo.statistics?.[0];return{...f,minValue:d?.min??0,maxValue:d?.max??8E3,hillshadeType:"traditional"===a.hillshadeType?0:1,type:"hillshade",colormap:e,colormapOffset:c}}_generateVectorFieldWebGLParams(a){const {style:f,inputUnit:d,outputUnit:e,
visualVariables:c,symbolTileSize:k,flowRepresentation:q}=a;let u;var G=this.rasterInfo.statistics?.[0].min??0,y=this.rasterInfo.statistics?.[0].max??50,C=c?.find(M=>"sizeInfo"===M.type)??{type:"sizeInfo",field:"Magnitude",maxDataValue:y,maxSize:.8*k,minDataValue:G,minSize:.2*k},H=C.minDataValue??G,x=C.maxDataValue??y;y=null!=C.maxSize&&null!=C.minSize?[C.minSize/k,C.maxSize/k]:[.2,.8];"wind_speed"===f&&(y[0]=y[1]=(y[0]+y[1])/2);G=null!=H&&null!=x?[H,x]:null;if("classified_arrow"===f)if(null!=H&&null!=
x&&null!=C)for(u=[],H=(C.maxDataValue-C.minDataValue)/5,x=0;6>x;x++)u.push(C.minDataValue+H*x);else u=[0,1E-6,3.5,7,10.5,14];C="flow_to"===q===("ocean_current_kn"===f||"ocean_current_m"===f)?0:Math.PI;H=c?.find(M=>"rotationInfo"===M.type);return{breakValues:u,dataRange:G,inputUnit:d,outputUnit:e,symbolTileSize:k,symbolPercentRange:y,style:f||"single_arrow",rotation:C,rotationType:this.rasterInfo.storageInfo?.tileInfo&&"vector-uv"===this.rasterInfo.dataType?"geographic":H?.rotationType||a.rotationType,
type:"vectorField"}}};m.__decorate([F.property({json:{write:!0}})],v.prototype,"rendererJSON",void 0);m.__decorate([F.property({type:D,json:{write:!0}})],v.prototype,"rasterInfo",void 0);m.__decorate([F.property({json:{write:!0}})],v.prototype,"lookup",void 0);m.__decorate([F.property()],v.prototype,"canRenderInWebGL",void 0);return v=m.__decorate([U.subclass("esri.renderers.support.RasterSymbolizer")],v)})},"esri/rest/support/ImageHistogramParameters":function(){define("../../chunks/tslib.es6 ../../geometry ../../TimeExtent ../../core/deprecate ../../core/JSONSupport ../../core/lang ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/has ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer ../../geometry/support/jsonUtils ../../layers/support/MosaicRule ../../layers/support/RasterFunction ../../geometry/Point".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h,n){var l;F=l=class extends F.JSONSupport{constructor(){super(...arguments);this.pixelSize=this.rasterFunction=this.mosaicRule=this.geometry=null;this.raster=void 0;this.timeExtent=null}writeGeometry(A,t,r){null!=A&&(t.geometryType=b.getJsonType(A),t[r]=A.toJSON())}get renderingRule(){J.deprecatedProperty(P.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0});return this._get("rasterFunction")}set renderingRule(A){J.deprecatedProperty(P.getLogger(this),
"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0});this._set("rasterFunction",A)}clone(){return new l(R.clone({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};m.__decorate([U.property({types:w.geometryTypes,json:{read:b.fromJSON}})],F.prototype,"geometry",void 0);m.__decorate([p.writer("geometry")],F.prototype,"writeGeometry",null);m.__decorate([U.property({type:g,
json:{write:!0}})],F.prototype,"mosaicRule",void 0);m.__decorate([U.property({type:h})],F.prototype,"renderingRule",null);m.__decorate([U.property({type:h,json:{write:!0,name:"renderingRule"}})],F.prototype,"rasterFunction",void 0);m.__decorate([U.property({type:n,json:{write:!0}})],F.prototype,"pixelSize",void 0);m.__decorate([U.property({json:{write:!0}})],F.prototype,"raster",void 0);m.__decorate([U.property({type:v,json:{read:{source:"time"},write:{target:"time"}}})],F.prototype,"timeExtent",
void 0);return F=l=m.__decorate([z.subclass("esri.rest.support.ImageHistogramParameters")],F)})},"esri/layers/support/MosaicRule":function(){define("../../chunks/tslib.es6 ../../core/deprecate ../../core/jsonMap ../../core/JSONSupport ../../core/lang ../../core/Logger ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/decorators/writer ../../core/accessorSupport/ensureType ../../geometry/Point ./DimensionalDefinition ./RasterFunction".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h,n){var l;const A=v.strict()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),t=v.strict()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});v=l=class extends J.JSONSupport{constructor(r){super(r);this.ascending=!0;this.where=
this.viewpoint=this.sortValue=this.sortField=this.operation=this.objectIds=this.multidimensionalDefinition=this.method=this.lockRasterIds=this.itemRasterFunction=null}readAscending(r,a){return null!=a.ascending?a.ascending:null!=a.sortAscending?a.sortAscending:!0}get itemRenderingRule(){w.deprecatedProperty(R.getLogger(this),"itemRenderingRule",{replacement:"itemRasterFunction",version:"4.27",warnOnce:!0});return this._get("itemRasterFunction")}set itemRenderingRule(r){w.deprecatedProperty(R.getLogger(this),
"itemRenderingRule",{replacement:"itemRasterFunction",version:"4.27",warnOnce:!0});this._set("itemRasterFunction",r)}readMethod(r,a){r=a.mosaicMethod||a.defaultMosaicMethod;switch(r?r.toLowerCase().replace("esrimosaic",""):""){case "byattribute":case "attribute":r="esriMosaicAttribute";break;case "lockraster":r="esriMosaicLockRaster";break;case "center":r="esriMosaicCenter";break;case "northwest":r="esriMosaicNorthwest";break;case "nadir":r="esriMosaicNadir";break;case "viewpoint":r="esriMosaicViewpoint";
break;case "seamline":r="esriMosaicSeamline";break;case "none":r="esriMosaicNone";break;default:r="esriMosaicNone"}return t.fromJSON(r)}writeMultidimensionalDefinition(r,a,f){null!=r&&(r=r.filter(({variableName:d,dimensionName:e})=>d&&"*"!==d||e),r.length&&(a[f]=r.map(d=>d.toJSON())))}readOperation(r,a){r=a.mosaicOperation;a=a.mosaicOperator?.toLowerCase();a=r||(a?A.toJSON(a):null);return A.fromJSON(a)||"first"}castSortValue(r){return null==r||"string"===typeof r||"number"===typeof r?r:`${r}`}clone(){return new l({ascending:this.ascending,
itemRasterFunction:F.clone(this.itemRasterFunction),lockRasterIds:F.clone(this.lockRasterIds),method:this.method,multidimensionalDefinition:F.clone(this.multidimensionalDefinition),objectIds:F.clone(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:F.clone(this.viewpoint),where:this.where})}};m.__decorate([P.property({type:Boolean,json:{write:!0}})],v.prototype,"ascending",void 0);m.__decorate([D.reader("ascending",["ascending","sortAscending"])],
v.prototype,"readAscending",null);m.__decorate([P.property({type:n,json:{name:"itemRenderingRule",write:!0}})],v.prototype,"itemRasterFunction",void 0);m.__decorate([P.property({type:n})],v.prototype,"itemRenderingRule",null);m.__decorate([P.property({type:[b.Integer],json:{write:{overridePolicy(){return{enabled:"lock-raster"===this.method}}}}})],v.prototype,"lockRasterIds",void 0);m.__decorate([P.property({type:String,json:{type:t.jsonValues,write:{target:"mosaicMethod",writer:t.write}}})],v.prototype,
"method",void 0);m.__decorate([D.reader("method",["mosaicMethod","defaultMosaicMethod"])],v.prototype,"readMethod",null);m.__decorate([P.property({type:[h],json:{write:!0}})],v.prototype,"multidimensionalDefinition",void 0);m.__decorate([p.writer("multidimensionalDefinition")],v.prototype,"writeMultidimensionalDefinition",null);m.__decorate([P.property({type:[b.Integer],json:{name:"fids",write:!0}})],v.prototype,"objectIds",void 0);m.__decorate([P.property({json:{type:A.jsonValues,read:{reader:A.read},
write:{target:"mosaicOperation",writer:A.write}}})],v.prototype,"operation",void 0);m.__decorate([D.reader("operation",["mosaicOperation","mosaicOperator"])],v.prototype,"readOperation",null);m.__decorate([P.property({type:String,json:{write:{overridePolicy(){return{enabled:"attribute"===this.method}}}}})],v.prototype,"sortField",void 0);m.__decorate([P.property({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:"attribute"===this.method,allowNull:!0}}}}})],v.prototype,
"sortValue",void 0);m.__decorate([U.cast("sortValue")],v.prototype,"castSortValue",null);m.__decorate([P.property({type:g,json:{write:!0}})],v.prototype,"viewpoint",void 0);m.__decorate([P.property({type:String,json:{write:!0}})],v.prototype,"where",void 0);return v=l=m.__decorate([z.subclass("esri.layers.support.MosaicRule")],v)})},"esri/views/2d/engine/flow/dataUtils":function(){define("exports ../../../../geometry ../../../../core/has ../../../../core/Logger ../../../../core/mathUtils ../../../../core/promiseUtils ../../../../core/RandomLCG ../../../../geometry/support/spatialReferenceUtils ../../../../geometry/Extent".split(" "),
function(m,w,v,J,F,R,P,U,D){function z(a,f){const d=g(f.data,f.width,f.height,a.smoothing);return a.interpolate?(e,c)=>{const k=Math.floor(e),q=Math.floor(c);if(0>k||k>=f.width||0>q||q>=f.height)return[0,0];e-=k;c-=q;const u=k<f.width-1?k+1:k,G=q<f.height-1?q+1:q;return[(d[2*(q*f.width+k)]*(1-c)+d[2*(G*f.width+k)]*c)*(1-e)+(d[2*(q*f.width+u)]*(1-c)+d[2*(G*f.width+u)]*c)*e,(d[2*(q*f.width+k)+1]*(1-c)+d[2*(G*f.width+k)+1]*c)*(1-e)+(d[2*(q*f.width+u)+1]*(1-c)+d[2*(G*f.width+u)+1]*c)*e]}:(e,c)=>{e=Math.round(e);
c=Math.round(c);return 0>e||e>=f.width||0>c||c>=f.height?[0,0]:[d[2*(c*f.width+e)],d[2*(c*f.width+e)+1]]}}function p(a,f,d,e,c,k,q,u,G){const y=[];let C=0,[H,x]=f(d,e);H*=a.velocityScale;x*=a.velocityScale;y.push({x:d,y:e,t:C,speed:Math.sqrt(H*H+x*x)});for(let N=0;N<a.verticesPerLine;N++){let [E,I]=f(d,e);E*=a.velocityScale;I*=a.velocityScale;const K=Math.sqrt(E*E+I*I);if(K<a.minSpeedThreshold)break;const S=E/K,O=I/K;d+=S*a.segmentLength;e+=O*a.segmentLength;C+=a.segmentLength/K;if(Math.acos(S*M+
O*L)>a.maxTurnAngle)break;if(a.collisions){var M=Math.round(d*G);var L=Math.round(e*G);if(0>M||M>q-1||0>L||L>u-1)break;const W=k[L*q+M];if(-1!==W&&W!==c)break;k[L*q+M]=c}y.push({x:d,y:e,t:C,speed:K});M=S;L=O}return y}function b(a,f,d,e){const c=[],k=new P,q=1/Math.max(a.lineCollisionWidth,1),u=Math.round(d*q),G=Math.round(e*q),y=new Int32Array(u*G);for(var C=0;C<y.length;C++)y[C]=-1;C=[];for(let H=0;H<e;H+=a.lineSpacing)for(let x=0;x<d;x+=a.lineSpacing)C.push({x,y:H,sort:k.getFloat()});C.sort((H,
x)=>H.sort-x.sort);for(const {x:H,y:x}of C)k.getFloat()<a.density&&(d=p(a,f,H,x,c.length,y,u,G,q),2>d.length||c.push(d));return c}function g(a,f,d,e){if(0===e)return a;const c=Math.round(3*e),k=Array(2*c+1);var q=0;for(var u=-c;u<=c;u++){var G=Math.exp(-u*u/(e*e));k[u+c]=G;q+=G}for(e=-c;e<=c;e++)k[e+c]/=q;q=new Float32Array(a.length);for(e=0;e<d;e++)for(u=0;u<f;u++){var y=G=0;for(var C=-c;C<=c;C++)if(!(0>u+C||u+C>=f)){var H=k[C+c];G+=H*a[2*(e*f+(u+C))];y+=H*a[2*(e*f+(u+C))+1]}q[2*(e*f+u)]=G;q[2*(e*
f+u)+1]=y}a=new Float32Array(a.length);for(e=0;e<f;e++)for(u=0;u<d;u++){y=G=0;for(C=-c;C<=c;C++)0>u+C||u+C>=d||(H=k[C+c],G+=H*q[2*((u+C)*f+e)],y+=H*q[2*((u+C)*f+e)+1]);a[2*(u*f+e)]=G;a[2*(u*f+e)+1]=y}return a}function h(a,f){const d=new P;var e=a.reduce((u,G)=>u+G.length,0);e=new Float32Array(4*e);const c=Array(a.length);let k=0,q=0;for(const u of a){a=k;for(const G of u)e[4*k]=G.x,e[4*k+1]=G.y,e[4*k+2]=G.t,e[4*k+3]=G.speed,k++;c[q++]={startVertex:a,numberOfVertices:u.length,totalTime:u[u.length-
1].t,timeSeed:f?d.getFloat():0}}return{lineVertices:e,lineDescriptors:c}}function n(a,f){function d(M,L,N,E,I,K,S,O){const W=9*G;let Y=0;u[W+Y++]=M;u[W+Y++]=L;u[W+Y++]=1;u[W+Y++]=N;u[W+Y++]=K;u[W+Y++]=S;u[W+Y++]=E/2;u[W+Y++]=I/2;u[W+Y++]=O;G++;u[W+Y++]=M;u[W+Y++]=L;u[W+Y++]=-1;u[W+Y++]=N;u[W+Y++]=K;u[W+Y++]=S;u[W+Y++]=-E/2;u[W+Y++]=-I/2;u[W+Y++]=O;G++}const {lineVertices:e,lineDescriptors:c}=a;var k=a=0;for(var q of c)a+=2*q.numberOfVertices,k+=6*(q.numberOfVertices-1);const u=new Float32Array(9*
a);q=new Uint32Array(k);let G=0;a=0;for(const M of c){const {totalTime:L,timeSeed:N}=M;let E=k=null,I=null;var y=null,C=null,H=null;for(let K=0;K<M.numberOfVertices;K++){y=e[4*(M.startVertex+K)];const S=e[4*(M.startVertex+K)+1],O=e[4*(M.startVertex+K)+2],W=e[4*(M.startVertex+K)+3];let Y=null,V=null;var x=null;let B=null;0<K&&(Y=y-k,V=S-E,x=Math.sqrt(Y*Y+V*V),Y/=x,V/=x,1<K?(C=Y+C,H=V+H,x=Math.sqrt(C*C+H*H),C/=x,H/=x,x=Math.min(1/(C*Y+H*V),f),C*=x,H*=x,x=-H,B=C):(x=-V,B=Y),null!==x&&null!==B&&(d(k,
E,I,x,B,L,N,W),q[a++]=G-2,q[a++]=G,q[a++]=G-1,q[a++]=G,q[a++]=G+1,q[a++]=G-1));k=y;E=S;I=O;C=Y;H=V;y=W}d(k,E,I,-H,C,L,N,y)}return{vertexData:u,indexData:q}}function l(a){function f(T,X){var aa=O+Y,Z=W+V,ba=Math.sqrt(aa*aa+Z*Z);aa/=ba;Z/=ba;var ea=O*aa+W*Z,fa=Y+B,la=V+Q;ba=Math.sqrt(fa*fa+la*la);fa/=ba;la/=ba;var ja=Y*fa+V*la;ba=x;var pa=M,ma=L,oa=N;Z=-(Z/ea);aa/=ea;ea=E;var qa=I,ta=K,sa=S;la=-(la/ja);fa/=ja;ja=16*C;let ra=0;for(const xa of[1,2])for(const va of[1,2,3,4])G[ja+ra++]=ba,G[ja+ra++]=pa,
G[ja+ra++]=ma,G[ja+ra++]=oa,G[ja+ra++]=ea,G[ja+ra++]=qa,G[ja+ra++]=ta,G[ja+ra++]=sa,G[ja+ra++]=xa,G[ja+ra++]=va,G[ja+ra++]=T,G[ja+ra++]=X,G[ja+ra++]=Z/2,G[ja+ra++]=aa/2,G[ja+ra++]=la/2,G[ja+ra++]=fa/2,C++;y[H++]=C-8;y[H++]=C-7;y[H++]=C-6;y[H++]=C-7;y[H++]=C-5;y[H++]=C-6;y[H++]=C-4;y[H++]=C-3;y[H++]=C-2;y[H++]=C-3;y[H++]=C-1;y[H++]=C-2}function d(T,X,aa,Z,ba,ea){O=Y;W=V;Y=B;V=Q;null==O&&null==W&&(O=Y,W=V);if(null!=E&&null!=I){B=T-E;Q=X-I;const fa=Math.sqrt(B*B+Q*Q);B/=fa;Q/=fa}null!=O&&null!=W&&f(ba,
ea);x=E;M=I;L=K;N=S;E=T;I=X;K=aa;S=Z}function e(T,X){O=Y;W=V;Y=B;V=Q;null==O&&null==W&&(O=Y,W=V);null!=O&&null!=W&&f(T,X)}const {lineVertices:c,lineDescriptors:k}=a;let q=a=0;for(var u of k){const T=u.numberOfVertices-1;a+=8*T;q+=12*T}const G=new Float32Array(16*a),y=new Uint32Array(q);let C=0,H=0,x,M,L,N,E,I,K,S,O,W,Y,V,B,Q;for(const T of k){Q=B=V=Y=W=O=S=K=I=E=N=L=M=x=null;const {totalTime:X,timeSeed:aa}=T;for(u=0;u<T.numberOfVertices;u++)d(c[4*(T.startVertex+u)],c[4*(T.startVertex+u)+1],c[4*(T.startVertex+
u)+2],c[4*(T.startVertex+u)+3],X,aa);e(X,aa)}return{vertexData:G,indexData:y}}function A(a,f){const d=f.pixels,{width:e,height:c}=f,k=new Float32Array(e*c*2),q=f.mask||new Uint8Array(e*c*2);f.mask||q.fill(255);if("vector-uv"===a)for(a=0;a<e*c;a++)k[2*a]=d[0][a],k[2*a+1]=-d[1][a];else if("vector-magdir"===a)for(a=0;a<e*c;a++){f=d[0][a];const u=F.deg2rad(d[1][a]),G=Math.sin(u-Math.PI/2);k[2*a]=Math.cos(u-Math.PI/2)*f;k[2*a+1]=G*f}return{data:k,mask:q,width:e,height:c}}async function t(a,f,d,e,c,k){const q=
{requestProjectedLocalDirections:!0,signal:k};null!=c&&(q.timeExtent=c);if("imagery"===a.type)return await a.load({signal:k}),c=a.rasterInfo.dataType,a=await a.fetchImage(f,d,e,q),null==a?.pixelData?.pixelBlock?{data:new Float32Array(d*e*2),mask:new Uint8Array(d*e),width:d,height:e}:A(c,a.pixelData.pixelBlock);await a.load({signal:k});c=a.serviceRasterInfo.dataType;a=await a.fetchPixels(f,d,e,q);return null==a?.pixelBlock?{data:new Float32Array(d*e*2),mask:new Uint8Array(d*e),width:d,height:e}:A(c,
a.pixelBlock)}const r=()=>J.getLogger("esri.views.2d.engine.flow.dataUtils");m.createAnimatedLinesData=h;m.createFlowMesh=async function(a,f,d,e){const c=performance.now();var k=z(f,d);const q=performance.now();d=b(f,k,d.width,d.height);f=performance.now();k=h(d,!0);d=performance.now();a="Streamlines"===a?n(k,10):l(k);k=performance.now();v("esri-2d-profiler")&&(r().info("I.1","_createFlowFieldFromData (ms)",Math.round(q-c)),r().info("I.2","_getStreamlines (ms)",Math.round(f-q)),r().info("I.3","createAnimatedLinesData (ms)",
Math.round(d-f)),r().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(k-d)),r().info("I.5","createFlowMesh (ms)",Math.round(k-c)),r().info("I.6","Mesh size (bytes)",a.vertexData.buffer.byteLength+a.indexData.buffer.byteLength));await Promise.resolve();R.throwIfAborted(e);return a};m.createParticlesMesh=l;m.createStreamlinesMesh=n;m.loadImagery=async function(a,f,d,e,c,k){const q=performance.now();var u=U.getInfo(f.spatialReference);if(!u)return d=await t(a,f,d,e,c,k),v("esri-2d-profiler")&&
r().info("I.7","loadImagery, early exit (ms)",Math.round(performance.now()-q)),v("esri-2d-profiler")&&r().info("I.9","Number of parts",1),d;const [G,y]=u.valid,C=Math.ceil(f.width/(y-G)),H=f.width/C,x=Math.round(d/C);let M=f.xmin;const L=[];u=performance.now();for(let N=0;N<C;N++){const E=new D({xmin:M,xmax:M+H,ymin:f.ymin,ymax:f.ymax,spatialReference:f.spatialReference});L.push(t(a,E,x,e,c,k));M+=H}a=await Promise.all(L);v("esri-2d-profiler")&&r().info("I.8","All calls to _fetchPart (ms)",Math.round(performance.now()-
u));v("esri-2d-profiler")&&r().info("I.9","Number of parts",a.length);e={data:new Float32Array(d*e*2),mask:new Uint8Array(d*e),width:d,height:e};f=0;for(const N of a){for(a=0;a<N.height;a++)for(c=0;c<N.width;c++)f+c>=d||(e.data[2*(a*d+f+c)]=N.data[2*(a*N.width+c)],e.data[2*(a*d+f+c)+1]=N.data[2*(a*N.width+c)+1],e.mask[a*d+f+c]=N.mask[a*N.width+c]);f+=N.width}v("esri-2d-profiler")&&r().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-q));return e};Object.defineProperty(m,Symbol.toStringTag,
{value:"Module"})})},"esri/layers/support/rasterDatasets/RasterFactory":function(){define("../../../core/Error ./CovJSONRaster ./ImageAuxRaster ./ImageServerRaster ./InMemoryRaster ./MRFRaster ./TIFFRaster".split(" "),function(m,w,v,J,F,R,P){const U=new Map;U.set("MRF",{desc:"Meta Raster Format",constructor:R});U.set("TIFF",{desc:"GeoTIFF",constructor:P});U.set("RasterTileServer",{desc:"Raster Tile Server",constructor:J});U.set("JPG",{desc:"JPG Raster Format",constructor:v});U.set("PNG",{desc:"PNG Raster Format",
constructor:v});U.set("GIF",{desc:"GIF Raster Format",constructor:v});U.set("BMP",{desc:"BMP Raster Format",constructor:v});U.set("CovJSON",{desc:"COVJSON Raster Format",constructor:w});U.set("MEMORY",{desc:"In Memory Raster Format",constructor:F});class D{static get supportedFormats(){const z=new Set;U.forEach((p,b)=>z.add(b));return z}static async open(z){const {url:p,ioConfig:b,source:g,sourceJSON:h}=z;let n=z.datasetFormat??b?.datasetFormat;null==n&&(p.includes(".")?n=p.slice(p.lastIndexOf(".")+
1).toUpperCase():"coverage"===g?.type?.toLowerCase()?n="CovJSON":g?.extent&&g.pixelblocks&&(n="MEMORY"));"OVR"===n||"TIF"===n?n="TIFF":"JPG"===n||"JPEG"===n||"JFIF"===n?n="JPG":"COVJSON"===n&&(n="CovJSON");p.toLowerCase().includes("/imageserver")&&!p.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");var l={bandIds:null,sampling:null};const A={url:p,source:g,sourceJSON:h,datasetFormat:n,ioConfig:b??l};Object.keys(A).forEach(f=>{null==A[f]&&delete A[f]});if(n){if(!this.supportedFormats.has(n))throw new m("rasterfactory:open",
"not a supported format "+n);if("CRF"===n)throw new m("rasterfactory:open",`cannot open raster: ${p}`);l=new (U.get(n).constructor)(A);await l.open({signal:z.signal});return l}const t=Array.from(U.keys()).filter(f=>"CovJSON"!==f&&"Memory"!==f);let r=0;const a=()=>{n=t[r++];if(!n||"CRF"===n)return null;const f=new (U.get(n).constructor)(A);return f.open({signal:z.signal}).then(()=>f).catch(()=>a())};return a()}static register(z,p,b){U.has(z.toUpperCase())||U.set(z.toUpperCase(),{desc:p,constructor:b})}}
return D})},"esri/layers/support/rasterDatasets/CovJSONRaster":function(){define("../../../chunks/tslib.es6 ../../../core/Error ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseRaster ./covJSONParser ./InMemoryRaster ../rasterFunctions/stretchUtils ../../../rest/support/FeatureSet".split(" "),function(m,w,v,J,F,R,P,U,D,z,p,b){J=class extends U{constructor(){super(...arguments);this.datasetFormat=
"CovJSON"}async open(g){await this.init();const {extent:h,pixelBlocks:n,multidimensionalInfo:l,attributeTable:A,bandNames:t}=await this._fetchData(g),{statistics:r,histograms:a}=p.computeStatisticsHistograms(n[0]);g=t?.map(d=>({BandName:d}));g={DataType:A?"Thematic":l?"Scientific":"Generic",BandProperties:g};g=new z({source:{extent:h,pixelBlocks:n,attributeTable:A?b.fromJSON(A):null,multidimensionalInfo:l,statistics:r,histograms:a,keyProperties:g,isPseudoSpatialReference:!1}});await g.open();this._inMemoryRaster=
g;const f=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",f.slice(0,f.indexOf(".")));this._set("rasterInfo",g.rasterInfo)}fetchRawTile(g,h,n,l={}){return this._inMemoryRaster.fetchRawTile(g,h,n,l)}async _fetchData(g){g=this.source??(await this.request(this.url,{signal:g?.signal})).data;if("coverage"!==g.type?.toLowerCase()||"grid"!==g.domain?.domainType?.toLowerCase())throw new w("imagery-tile-layer:open-coverage-json","Only coverage with Grid domain type is supported");
if(!g.ranges)throw new w("imagery-tile-layer:open-coverage-json","Missing ranges in the grid coverage data");if(!g.domain.referencing?.length)throw new w("imagery-tile-layer:open-coverage-json","Missing domain referencing in the grid coverage data");const h=Object.values(g.ranges);for(let n=0;n<h.length;n++){const {axisNames:l,shape:A,type:t,values:r}=h[n];if(!("ndarray"===t.toLowerCase()&&r?.length&&l?.length&&A?.length))throw new w("imagery-tile-layer:open-coverage-json","Only ranges with valid NdArray, axisNames, shape, and inline values are supported");
if(!D.isXAxis(l[l.length-1])||!D.isYAxis(l[l.length-2]))throw new w("imagery-tile-layer:open-coverage-json","Only row-major ordered pixel values are supported. X axis must be the last axis.");}return D.parseGridCoverage(g)}};m.__decorate([v.property({type:String,json:{write:!0}})],J.prototype,"datasetFormat",void 0);m.__decorate([v.property({constructOnly:!0})],J.prototype,"source",void 0);return J=m.__decorate([P.subclass("esri.layers.support.rasterDatasets.CovJSONRaster")],J)})},"esri/layers/support/rasterDatasets/covJSONParser":function(){define("exports ../../../Color ../../../geometry ../../../geometry/Extent ../../../intl/locale ../PixelBlock ../rasterFormats/pixelRangeUtils ../../../geometry/SpatialReference".split(" "),
function(m,w,v,J,F,R,P,U){function D(l){return["x","e","east","long","longitude"].includes(l.toLowerCase())}function z(l){return["y","n","west","lat","latitude"].includes(l.toLowerCase())}function p(l){const {axes:A}=l.domain,t=Object.keys(A);var r=[];const a=[];let f=-1,d=-1,e=[];for(let y=0;y<t.length;y++){const C=t[y];D(C)?f=y:z(C)&&(d=y);var c=A[C];const H=[];if("values"in c)c.values.forEach(x=>H.push("string"===typeof x?(new Date(x)).getTime():x)),c=H[1]-H[0],r.push([H[0]-.5*c,H[H.length-1]+
.5*c]),a.push(c);else{const {start:x,stop:M,num:L}=c;c=(M-x)/(L-1);r.push([x-.5*c,M+.5*c]);a.push(c);for(let N=0;N<L;N++)H.push(x+c*N)}e.push({name:C,values:H,extent:[H[0],H[H.length-1]]})}-1<f&&-1===d?d=0===f?1:0:-1<d&&-1===f?f=0===d?1:0:-1===d&&-1===f&&(f=0,d=1);e=e.filter((y,C)=>!(C===f||C===d));({referencing:l}=l.domain);l=l.find(y=>y.coordinates.includes(t[f])).system.id;l=l?.slice(l.lastIndexOf("/")+1);l=new U({wkid:null==l||"CRS84"===l?4326:Number(l)});const [k,q]=r[f],[u,G]=r[d];r=new J({xmin:k,
xmax:q,ymin:u,ymax:G,spatialReference:l});return{width:Math.round(r.width/a[f]),height:Math.round(r.height/a[d]),extent:r,dimensions:e}}function b(l){const A=F.getLanguage();return A?l[A]??Object.values(l)[0]:Object.values(l)[0]}function g(l){const A={};({parameters:l}=l);if(!l)return A;for(const [t,r]of Object.entries(l)){const {type:a,description:f,unit:d,categoryEncoding:e,observedProperty:c}=r;if("Parameter"===a&&(A[t]={},f&&(A[t].description=b(f)),d&&(A[t].unit=d.label?b(d.label):null,A[t].symbol=
d.symbol?.value),e)){const k=Object.entries(e).map((u,G)=>({OID:G,Value:Number(u[1]),ClassName:u[0].slice(u[0].lastIndexOf("/")+1),Count:1}));let q=!1;c?.categories?.length&&(c.categories.forEach(u=>{if(u.id){var G=u.id.slice(u.id.lastIndexOf("/")+1),y=k.find(H=>H.ClassName===G);if(y){var C=u.label?b(u.label):null;y.Label=C;u.preferredColor&&(u=w.fromHex(u.preferredColor))&&(q=!0,y.Red=u.r,y.Green=u.g,y.Blue=u.b)}}}),q&&k.forEach(u=>{null==u.Red&&(u.Red=Math.round(255*Math.random()),u.Green=Math.round(255*
Math.random()),u.Blue=Math.round(255*Math.random()))}));l={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:k.map(u=>({attributes:u}))};q&&l.fields.push({name:"Red",
type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null});A[t].attributeTable=l}}return A}function h(l){let A=Number.MAX_VALUE,t=-Number.MAX_VALUE;for(let r=0;r<l.length;r++){const a=l[r];null!=a&&(a<A&&(A=a),a>t&&(t=a))}return P.getIntegerPixelType(A,t)}function n(l,A,t){const r=l.map((d,e)=>({name:d,count:A[e]})).sort((d,e)=>d.name>e.name?-1:1);var a=(d=>e=>d*=e.count)(1);
a=[...r.slice(1),{name:"",count:1}].reverse().map(a).reverse();let f=0;for(let d=l.length-1;0<=d;d--){const e=r.findIndex(({name:c})=>c===l[d]);f+=t%A[d]*a[e];t=Math.floor(t/A[d])}return f}m.isXAxis=D;m.isYAxis=z;m.parseGridCoverage=function(l){const {width:A,height:t,extent:r,dimensions:a}=p(l);var {ranges:f}=l;const d=Object.keys(f).sort((C,H)=>C<H?-1:1);var e=[];for(var c=0;c<d.length;c++){var k=d[c];a?.length&&e.push({name:k,dimensions:a})}const q=g(l);e.forEach(C=>q[C.name]&&Object.assign(C,
q[C.name]));l=e.length?{variables:e}:void 0;e=[];for(c=0;c<d.length;c++){const {values:C,dataType:H,axisNames:x,shape:M}=f[d[c]];k=2<M.length?c*M.slice(0,-2).reduce((S,O)=>S*O):0;const L=x.slice(0,-2),N=M.slice(0,-2),E="float"===H?"f32":h(C),I=A*t,K=C.length/I;for(let S=0;S<K;S++){var u=R.createEmptyBand(E,I),G=(new Uint8Array(I)).fill(255);let O=!1;var y=S*I;for(let W=0;W<I;W++){const Y=C[y+W];null==Y?(G[W]=0,O=!0):u[W]=Y}0===c||a?.length?(u=new R({width:A,height:t,mask:O?G:null,pixels:[u],pixelType:E}),
u.updateStatistics(),a?.length?(G=n(L,N,S),e[G+k]=u):e.push(u)):(y=e[S],y.pixels.push(u),O?y.mask&&(y.mask=R.combineBandMasks([y.mask,G])):y.mask=O?G:null)}}f=Object.values(q).find(C=>C.attributeTable)?.attributeTable;return{extent:r,pixelBlocks:e,multidimensionalInfo:l,attributeTable:f,bandNames:l?void 0:d}};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterDatasets/InMemoryRaster":function(){define("../../../chunks/tslib.es6 ../../../geometry ../../../core/Error ../../../core/promiseUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../DimensionalDefinition ../RasterInfo ./BaseRaster ./multidimensionalUtils ../rasterFunctions/pixelUtils ../rasterFunctions/stretchUtils ../../../geometry/Extent ../../../geometry/SpatialReference".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h,n,l,A){w=class extends b{constructor(){super(...arguments);this.datasetFormat="MEMORY";this.source=null}get url(){return""}async open(t){await this.init();const r=this.source,{pixelBlocks:a,attributeTable:f,statistics:d,histograms:e,name:c,nativeExtent:k,transform:q}=r,u=a[0],{width:G,height:y,pixelType:C}=u;var H=r.extent??new l({xmin:-.5,ymin:.5,xmax:G-.5,ymax:y-.5,spatialReference:new A({wkid:3857})});const x=r.isPseudoSpatialReference??!r.extent,M={x:H.width/
G,y:H.height/y},L={...r.keyProperties};f&&(L.DataType="Thematic");H=new p({width:G,height:y,pixelType:C,extent:H,nativeExtent:k,attributeTable:f,transform:q,pixelSize:M,spatialReference:H.spatialReference,bandCount:u.pixels.length,keyProperties:L,multidimensionalInfo:r.multidimensionalInfo,statistics:d,isPseudoSpatialReference:x,histograms:e});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(H);this.createRemoteDatasetStorageInfo(H,512,512);this._set("rasterInfo",H);this.updateTileInfo();
H.multidimensionalInfo?await this._buildMDimStats(r.pixelBlocks,H.multidimensionalInfo):await this._buildInMemoryRaster(u,{width:512,height:512},t);H.multidimensionalInfo||(this.source=null);this.datasetName=c}fetchRawTile(t,r,a,f={}){if(!this._pixelBlockTiles){const {rasterInfo:d}=this,[e,c]=d.storageInfo.tileInfo.size,{sliceId:k}=f,{pixelBlocks:q}=this.source;t={pixelBlock:null==k?q[0]:q[k],useBilinear:"thematic"!==d.dataType,tileSize:{width:e,height:c},level:t,row:r,col:a};f=this.rasterJobHandler?
this.rasterJobHandler.clipTile(t,f):h.clipTile(t);return Promise.resolve(f)}f=this._pixelBlockTiles.get(`${t}/${r}/${a}`);return Promise.resolve(f)}async _buildInMemoryRaster(t,r,a){const {rasterInfo:f}=this;var d=f.storageInfo.maximumPyramidLevel??0,e="thematic"!==f.dataType;e=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:t,tileSize:r,maximumPyramidLevel:d,useBilinear:e},a):Promise.resolve(h.split(t,r,d,e));r=null!=f.statistics;d=null!=f.histograms;t=this.ioConfig.skipStatistics||
r?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:t},a):Promise.resolve(n.estimateStatisticsHistograms(t));t=await J.eachAlways([e,t]);if(!t[0].value&&t[1].value)throw new v("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=t[0].value;r||(f.statistics=t[1].value?.statistics);d||(f.histograms=t[1].value?.histograms)}async _buildMDimStats(t,r,a){for(let d=0;d<r.variables.length;d++){const e=
r.variables[d];if(!e.statistics){var f=e.dimensions.map(c=>new z({variableName:e.name,dimensionName:c.name,values:[c.values?.[0]??c.extent?.[0]],isSlice:!0}));f=g.getSliceIndex(f,r);f=null==f?null:t[f];null!=f&&(f=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:f},a):n.computeStatisticsHistograms(f),e.statistics=f.statistics,e.histograms||(e.histograms=f.histograms))}}}};m.__decorate([F.property({type:String,json:{write:!0}})],w.prototype,"datasetFormat",
void 0);m.__decorate([F.property()],w.prototype,"source",void 0);m.__decorate([F.property()],w.prototype,"url",null);return w=m.__decorate([D.subclass("esri.layers.support.rasterDatasets.InMemoryRaster")],w)})},"esri/layers/support/rasterDatasets/ImageAuxRaster":function(){define("../../../chunks/tslib.es6 ../../../geometry ../../../core/Error ../../../core/has ../../../core/promiseUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./BaseRaster ./InMemoryRaster ./pamParser ../rasterFormats/RasterCodec ../rasterFunctions/stretchUtils ../rasterTransforms/PolynomialTransform ../../../geometry/SpatialReference ../../../geometry/Extent".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h,n,l,A){w=class extends z{async open(t){await this.init();var r=await this._fetchData(t);let {spatialReference:a,statistics:f,histograms:d,transform:e}=await this._fetchAuxiliaryData(t);(t=!a)&&(a=new l({wkid:3857}));d?.length&&null==f&&(f=h.estimateStatisticsFromHistograms(d));const {width:c,height:k}=r;let q=new A({xmin:-.5,ymin:.5-k,xmax:c-.5,ymax:.5,spatialReference:a});const u=e?e.forwardTransform(q):q;var G=!0;e&&(G=(G=e.forwardCoefficients)&&0===G[1]&&0===
G[2])&&(e=null,q=u);r=new p({source:{extent:u,nativeExtent:q,transform:e,pixelBlocks:[r],statistics:f,histograms:d,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:t},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(r.ioConfig.skipMapInfo=!0);await r.open();r.source=null;this._set("rasterInfo",r.rasterInfo);this._inMemoryRaster=r}fetchRawTile(t,r,a,f={}){return this._inMemoryRaster.fetchRawTile(t,r,a,f)}async _fetchData(t){({data:t}=await this.request(this.url,
{responseType:"array-buffer",signal:t?.signal}));var r=g.getFormat(t).toUpperCase();if("JPG"===r||"PNG"===r||"GIF"===r||"BMP"===r)this._set("datasetFormat",r);else throw new v("image-aux-raster:open","the data is not a supported format");r=r.toLowerCase();const a="gif"===r||"bmp"===r||!J("ios");t=await this.decodePixelBlock(t,{format:r,useCanvas:a,hasNoZlibMask:!0});if(null==t)throw new v("image-aux-raster:open","the data cannot be decoded");return t}async _fetchAuxiliaryData(t){t=t?.signal;const {skipExtensions:r=
[],skipMapInfo:a}=this.ioConfig;var f=a||r.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),d=this.datasetFormat;d=(d="JPG"===d?"jgw":"PNG"===d?"pgw":"BMP"===d?"bpw":null)&&r.includes(d)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+d,{responseType:"text",signal:t});f=await F.eachAlways([f,d]);if(t?.aborted)throw F.createAbortError();t=b.parsePAMInfo(f[0].value?.data);t.transform||(f=f[1].value?f[1].value.data.split("\n").slice(0,6).map(e=>
Number(e)):null,t.transform=6===f?.length?new n({forwardCoefficients:[f[4],f[5],f[0],-f[1],f[2],-f[3]]}):null);return t}};m.__decorate([R.property({type:String,json:{write:!0}})],w.prototype,"datasetFormat",void 0);return w=m.__decorate([D.subclass("esri.layers.support.rasterDatasets.ImageAuxRaster")],w)})},"esri/layers/support/rasterDatasets/pamParser":function(){define("exports ../../../geometry ../../../core/arrayUtils ../../../geometry/support/spatialReferenceUtils ./xmlUtilities ../rasterTransforms/PolynomialTransform ../../../geometry/SpatialReference".split(" "),
function(m,w,v,J,F,R,P){function U(g,h){if(!g||!h)return null;const n=[];for(let l=0;l<g.length;l++)n.push(g[l]),n.push(h[l]);return n}function D(g){var h=F.getElement(g,"GeodataXform");g=F.getElementNumericValue(h,"SpatialReference/WKID")||F.getElementValue(h,"SpatialReference/WKT");g=p(g);if("typens:PolynomialXform"!==h.getAttribute("xsi:type"))return{spatialReference:g,transform:null};var n=F.getElementNumericValue(h,"PolynomialOrder")??1,l=F.getElementNumericValues(h,"CoeffX/Double");const A=
F.getElementNumericValues(h,"CoeffY/Double");var t=F.getElementNumericValues(h,"InverseCoeffX/Double");h=F.getElementNumericValues(h,"InverseCoeffY/Double");l=U(l,A);t=U(t,h);n=l&&t&&l.length&&t.length?new R({spatialReference:g,polynomialOrder:n,forwardCoefficients:l,inverseCoefficients:t}):null;return{spatialReference:g,transform:n}}function z(g){const h=F.getElementNumericValue(g,"NoDataValue");var n=F.getElement(g,"Histograms/HistItem");const l=F.getElementNumericValue(n,"HistMin"),A=F.getElementNumericValue(n,
"HistMax"),t=F.getElementNumericValue(n,"BucketCount");n=F.getElementValue(n,"HistCounts")?.split("|").map(e=>Number(e));let r,a,f,d;F.getElements(g,"Metadata/MDI").forEach(e=>{const c=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case "STATISTICS_MINIMUM":r=c;break;case "STATISTICS_MAXIMUM":a=c;break;case "STATISTICS_MEAN":f=c;break;case "STATISTICS_STDDEV":d=c}});g=F.getElementNumericValue(g,"Metadata/SourceBandIndex");return{noDataValue:h,histogram:n?.length&&null!=
l&&null!=A?{min:l,max:A,size:t||n.length,counts:n}:null,sourceBandIndex:g,statistics:null!=r&&null!=a?{min:r,max:a,avg:f,stddev:d}:null}}function p(g){if(!g)return null;var h=Number(g);if(!isNaN(h)&&0!==h)return new P({wkid:h});g=String(g).trim();if(J.isWKT2(g))return new P({wkt2:g});var n=g.toUpperCase();if(n.startsWith("COMPD_CS")){if(!n.includes("VERTCS")||!n.includes("GEOGCS")&&!n.startsWith("PROJCS"))return null;h=n.indexOf("VERTCS");const l=n.indexOf("PROJCS");n=-1<l?l:n.indexOf("GEOGCS");if(-1===
n)return null;n=g.slice(n,g.lastIndexOf("]",h)+1).trim();g=g.slice(h,g.lastIndexOf("]")).trim();h=(h=b(n))?new P({wkid:h}):new P({wkt:n});if(g=b(g))h.vcsWkid=g;return h}if(!n.startsWith("GEOGCS")&&!n.startsWith("PROJCS"))return null;h=b(g);return 0!==h?new P({wkid:h}):new P({wkt:g})}function b(g){var h=g.replaceAll("]","[").replaceAll('"',"").split("[").map(l=>l.trim()).filter(l=>""!==l);h=h[h.length-1].split(",");const n=h[0]?.toLowerCase();return"epsg"!==n&&"esri"!==n||!g.endsWith('"]]')||(g=Number(h[1]),
isNaN(g)||0===g)?0:g}m.parsePAMInfo=function(g){if("pamdataset"!==g?.documentElement.tagName?.toLowerCase())return{};const h={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};g.documentElement.childNodes.forEach(n=>{if(1===n.nodeType)if(F.isSameTagIgnoreNS(n,"SRS"))h.spatialReference||(n=F.getElementValue(n),h.spatialReference=p(n));else if(F.isSameTagIgnoreNS(n,"Metadata"))if("xml:ESRI"===n.getAttribute("domain")){const {spatialReference:l,transform:A}=
D(n);h.transform=A;h.spatialReference||(h.spatialReference=l)}else F.getElements(n,"MDI").forEach(l=>h.metadata[l.getAttribute("key")]=F.getElementValue(l));else F.isSameTagIgnoreNS(n,"PAMRasterBand")&&(n=z(n),null!=n.sourceBandIndex&&null==h.rasterBands[n.sourceBandIndex]?h.rasterBands[n.sourceBandIndex]=n:h.rasterBands.push(n))});g=h.rasterBands;g.length&&(h.statistics=g[0].statistics?g.map(n=>n.statistics).filter(v.isSome):null,h.histograms=g[0].histogram?g.map(n=>n.histogram).filter(v.isSome):
null);return h};m.parseSpatialReference=p;Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterDatasets/xmlUtilities":function(){define(["exports"],function(m){function w(R,P){if(!R||!P)return[];var U=P;P.includes("/")?(U=P.slice(0,P.indexOf("/")),P=P.slice(P.indexOf("/")+1)):P="";const D=[];if(P){R=w(R,U);for(U=0;U<R.length;U++)w(R[U],P).forEach(z=>D.push(z));return D}P=R.getElementsByTagNameNS("*",U);if(!P||0===P.length)return[];for(R=0;R<P.length;R++)D.push(P[R]||
P.item(R));return D}function v(R,P){if(!R||!P)return null;let U=P;P.includes("/")?(U=P.slice(0,P.indexOf("/")),P=P.slice(P.indexOf("/")+1)):P="";R=w(R,U);return 0<R.length?P?v(R[0],P):R[0]:null}function J(R,P=null){if(R=P?v(R,P):R)if(R=R.textContent||R.nodeValue)return R.trim();return null}function F(R,P){R=w(R,P);P=[];let U;for(let D=0;D<R.length;D++)if(U=R[D].textContent||R[D].nodeValue)U=U.trim(),""!==U&&P.push(U);return P}m.getElement=v;m.getElementNumericValue=function(R,P){R=J(R,P);return Number(R)};
m.getElementNumericValues=function(R,P){return F(R,P).map(U=>Number(U))};m.getElementValue=J;m.getElementValues=F;m.getElements=w;m.getNodeNameIgnoreNS=function(R){return R.nodeName.slice(R.nodeName.lastIndexOf(":")+1)};m.getSpaceDelimitedNumericValues=function(R,P=null){return J(R,P)?.split(" ").map(U=>Number(U))??[]};m.isSameTagIgnoreNS=function(R,P){R=R?.nodeName?.toLowerCase();P=P.toLowerCase();return R.slice(R.lastIndexOf(":")+1)===P};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},
"esri/layers/support/rasterTransforms/PolynomialTransform":function(){define("../../../chunks/tslib.es6 ../../../geometry ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/reader ../../../core/accessorSupport/decorators/subclass ../../../core/accessorSupport/decorators/writer ./BaseRasterTransform ../../../geometry/Point ../../../geometry/Extent".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g){function h(A,t,r){const {x:a,y:f}=t;if(2>r)return{x:A[0]+a*A[2]+f*A[4],y:A[1]+a*A[3]+f*A[5]};if(2===r){t=a*a;r=f*f;var d=a*f;return{x:A[0]+a*A[2]+f*A[4]+t*A[6]+d*A[8]+r*A[10],y:A[1]+a*A[3]+f*A[5]+t*A[7]+d*A[9]+r*A[11]}}t=a*a;r=f*f;d=a*f;const e=t*a,c=t*f,k=a*r,q=f*r;return{x:A[0]+a*A[2]+f*A[4]+t*A[6]+d*A[8]+r*A[10]+e*A[12]+c*A[14]+k*A[16]+q*A[18],y:A[1]+a*A[3]+f*A[5]+t*A[7]+d*A[9]+r*A[11]+e*A[13]+c*A[15]+k*A[17]+q*A[19]}}function n(A,t,r){const {xmin:a,ymin:f,xmax:d,
ymax:e,spatialReference:c}=t;t=[];if(2>r)t.push({x:a,y:e}),t.push({x:d,y:e}),t.push({x:a,y:f}),t.push({x:d,y:f});else{var k=10;for(var q=0;q<k;q++)t.push({x:a,y:f+(e-f)*q/(k-1)}),t.push({x:d,y:f+(e-f)*q/(k-1)});k=8;for(q=1;q<=k;q++)t.push({x:a+(d-a)*q/k,y:f}),t.push({x:a+(d-a)*q/k,y:e})}t=t.map(u=>h(A,u,r));k=t.map(u=>u.x);t=t.map(u=>u.y);return new g({xmin:Math.min.apply(null,k),xmax:Math.max.apply(null,k),ymin:Math.min.apply(null,t),ymax:Math.max.apply(null,t),spatialReference:c})}var l;w=l=class extends p{constructor(){super(...arguments);
this.polynomialOrder=1;this.type="polynomial"}readForwardCoefficients(A,t){const {coeffX:r,coeffY:a}=t;if(!r?.length||!a?.length||r.length!==a.length)return null;A=[];for(t=0;t<r.length;t++)A.push(r[t]),A.push(a[t]);return A}writeForwardCoefficients(A,t,r){r=[];const a=[];for(let f=0;f<A?.length;f++)0===f%2?r.push(A[f]):a.push(A[f]);t.coeffX=r;t.coeffY=a}get inverseCoefficients(){var A=this._get("inverseCoefficients"),t=this._get("forwardCoefficients");if(!A&&t&&2>this.polynomialOrder){const [r,a,
f,d,e,c]=t;A=f*c-e*d;t=e*d-f*c;A=[(e*a-r*c)/A,(f*a-r*d)/t,c/A,d/t,-e/A,-f/t]}return A}set inverseCoefficients(A){this._set("inverseCoefficients",A)}readInverseCoefficients(A,t){const {inverseCoeffX:r,inverseCoeffY:a}=t;if(!r?.length||!a?.length||r.length!==a.length)return null;A=[];for(t=0;t<r.length;t++)A.push(r[t]),A.push(a[t]);return A}writeInverseCoefficients(A,t,r){r=[];const a=[];for(let f=0;f<A?.length;f++)0===f%2?r.push(A[f]):a.push(A[f]);t.inverseCoeffX=r;t.inverseCoeffY=a}get affectsPixelSize(){return 0<
this.polynomialOrder}forwardTransform(A){if("point"===A.type){const t=h(this.forwardCoefficients,A,this.polynomialOrder);return new b({x:t.x,y:t.y,spatialReference:A.spatialReference})}return n(this.forwardCoefficients,A,this.polynomialOrder)}inverseTransform(A){if("point"===A.type){const t=h(this.inverseCoefficients,A,this.polynomialOrder);return new b({x:t.x,y:t.y,spatialReference:A.spatialReference})}return n(this.inverseCoefficients,A,this.polynomialOrder)}clone(){return new l({polynomialOrder:this.polynomialOrder,
forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};m.__decorate([v.property({json:{write:!0}})],w.prototype,"polynomialOrder",void 0);m.__decorate([v.property()],w.prototype,"forwardCoefficients",void 0);m.__decorate([U.reader("forwardCoefficients",["coeffX","coeffY"])],w.prototype,"readForwardCoefficients",null);m.__decorate([z.writer("forwardCoefficients")],w.prototype,"writeForwardCoefficients",
null);m.__decorate([v.property({json:{write:!0}})],w.prototype,"inverseCoefficients",null);m.__decorate([U.reader("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],w.prototype,"readInverseCoefficients",null);m.__decorate([z.writer("inverseCoefficients")],w.prototype,"writeInverseCoefficients",null);m.__decorate([v.property()],w.prototype,"affectsPixelSize",null);m.__decorate([P.enumeration({PolynomialXform:"polynomial"})],w.prototype,"type",void 0);return w=l=m.__decorate([D.subclass("esri.layers.support.rasterTransforms.PolynomialTransform")],
w)})},"esri/layers/support/rasterTransforms/BaseRasterTransform":function(){define("../../../chunks/tslib.es6 ../../../core/JSONSupport ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "),function(m,w,v,J,F,R,P){w=class extends w.JSONSupport{get affectsPixelSize(){return!1}forwardTransform(U){return U}inverseTransform(U){return U}};m.__decorate([v.property()],w.prototype,"affectsPixelSize",
null);m.__decorate([v.property({json:{write:!0}})],w.prototype,"spatialReference",void 0);return w=m.__decorate([P.subclass("esri.layers.support.rasterTransforms.BaseRasterTransform")],w)})},"esri/layers/support/rasterDatasets/ImageServerRaster":function(){define("../../../chunks/tslib.es6 ../../../geometry ../../../core/Error ../../../core/maybe ../../../core/urlUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../RasterInfo ../RasterStorageInfo ../TileInfo ../TilemapCache ./BaseRaster ../rasterFunctions/pixelUtils ../rasterTransforms/GCSShiftTransform ../../../rest/imageService/fetchRasterInfo ../../../geometry/SpatialReference ../../../geometry/Point ../../../geometry/Extent".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h,n,l,A,t,r,a,f){function d(c,k){if(!c)return null;const {minScale:q,maxScale:u,minLOD:G,maxLOD:y}=k;if(null!=G&&null!=y)return g.fromJSON({...c,lods:c.lods.filter(({level:C})=>null!=C&&C>=G&&C<=y)});if(0!==q&&0!==u){const C=q?Math.round(1E4*q)/1E4:Infinity,H=u?Math.round(1E4*u)/1E4:-Infinity;return g.fromJSON({...c,lods:c.lods.filter(x=>{x=Math.round(1E4*x.scale)/1E4;return x<=C&&x>=H})})}return g.fromJSON(c)}function e(c){const {extent:k,spatialReference:q}=c;
-1<k.xmin&&181<k.xmax&&q?.wkid&&q.isGeographic&&(c.nativeExtent=c.extent,c.transform=new A,c.extent=c.transform.forwardTransform(k))}w=class extends n{constructor(){super(...arguments);this._levelOffset=0;this._slices=this._tilemapCache=null;this.datasetFormat="RasterTileServer";this.tileType=null}async open(c){await this.init();var k=c?.signal;c=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:k});c.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));this.sourceJSON=
c=c.data;if(!c)throw new v("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!c.tileInfo)throw new v("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();var q="jpg jpeg png png8 png24 png32 mixed".split(" ");this.tileType=c.cacheType;null==this.tileType&&(q.includes(c.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===c.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster");
this.datasetName=c.name?.slice(c.name.indexOf("/")+1)??"";k=await this._fetchRasterInfo({signal:k});if(null==k)throw new v("image-server-raster:open","cannot initialize image service");t.patchServiceInfo(k,c);q="Map"===this.tileType?d(c.tileInfo,c):g.fromJSON(c.tileInfo);J.assertIsSome(q);const [u,G]=this._computeMinMaxLOD(k,q),{extent:y,pixelSize:C}=k,H=.5/k.width*C.x,x=Math.max(C.x,C.y),{lods:M}=q;if("Map"!==this.tileType&&0!==c.maxScale||Math.abs(C.x-C.y)>H||!M.some(V=>Math.abs(V.resolution-x)<
H))C.x=C.y=u.resolution,k.width=Math.ceil((y.xmax-y.xmin)/C.x-.1),k.height=Math.ceil((y.ymax-y.ymin)/C.y-.1);const L=u.level-G.level,[N,E]=q.size,I=[],K=[];M.forEach((V,B)=>{V.level>=G.level&&V.level<=u.level&&I.push({x:V.resolution,y:V.resolution});B<M.length-1&&K.push(Math.round(10*V.resolution/M[B+1].resolution)/10)});I.sort((V,B)=>V.x-B.x);const S=this.computeBlockBoundary(y,N,E,q.origin,I,L),O=1<I.length?I.slice(1):null;var W;c.transposeInfo&&(W={tileSize:[c.transposeInfo.rows,c.transposeInfo.cols],
packetSize:k.keyProperties?._yxs.PacketSize??0});const Y=1>=K.length||3<=K.length&&K.slice(0,-1).every(V=>V===K[0])?K[0]??2:Math.round(10/(G.resolution/u.resolution)**(-1/L))/10;k.storageInfo=new b({blockWidth:q.size[0],blockHeight:q.size[1],pyramidBlockWidth:q.size[0],pyramidBlockHeight:q.size[1],pyramidResolutions:O,pyramidScalingFactor:Y,compression:q.format,origin:q.origin,firstPyramidLevel:1,maximumPyramidLevel:L,tileInfo:q,transposeInfo:W,blockBoundary:S});e(k);this._set("rasterInfo",k);c.capabilities.toLowerCase().includes("tilemap")&&
(W={tileInfo:k.storageInfo.tileInfo,parsedUrl:F.urlToObject(this.url),url:this.url,tileServers:[]},this._tilemapCache=new h.TilemapCache({layer:W}))}async fetchRawTile(c,k,q,u={}){const {storageInfo:G,extent:y}=this.rasterInfo;var {transposeInfo:C}=G,H=null!=C&&!!u.transposedVariableName;if(this._slices&&!H&&null==u.sliceId)return null;({data:u}=await this.request(`${this.url}/tile/${H?0:G.maximumPyramidLevel-c+this._levelOffset}/${k}/${q}`,{query:this._slices?H?{variable:u.transposedVariableName}:
{sliceId:u.sliceId||0}:null,responseType:"array-buffer",signal:u.signal}));if(!u)return null;C=H?C.tileSize:G.tileInfo.size;H=await this.decodePixelBlock(u,{width:C[0],height:C[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:H,noDataValue:this.rasterInfo.noDataValue});if(null==H)return null;C=G.blockBoundary[c];if("jpg"!==G.compression||q>C.minCol&&q<C.maxCol&&k>C.minRow&&k<C.maxRow)return H;const {origin:x,blockWidth:M,blockHeight:L}=G,{x:N,y:E}=this.getPyramidPixelSize(c);
var I=Math.round((y.xmin-x.x)/N)%M;c=Math.round((y.xmax-x.x)/N)%M||M;var K=Math.round((x.y-y.ymax)/E)%L;u=Math.round((x.y-y.ymin)/E)%L||L;I=q===C.minCol?I:0;K=k===C.minRow?K:0;l.setValidBoundary(H,{x:I,y:K},{width:(q===C.maxCol?c:M)-I,height:(k===C.maxRow?u:L)-K});return H}getSliceIndex(c){if(!this._slices||null==c||0===c.length)return null;for(let k=0;k<this._slices.length;k++){const q=this._slices[k].multidimensionalDefinition;if(q.length===c.length&&!q.some(u=>{var G=c.find(C=>u.variableName===
C.variableName&&C.dimensionName===u.dimensionName);if(!G)return!0;const y=Array.isArray(u.values[0])?`${u.values[0][0]}-${u.values[0][1]}`:u.values[0];G=Array.isArray(G.values[0])?`${G.values[0][0]}-${G.values[0][1]}`:G.values[0];return y!==G}))return k}return null}async fetchVariableStatisticsHistograms(c,k){var q=this.request(this.url+"/statistics",{query:{variable:c,f:"json"},signal:k}).then(u=>u.data?.statistics);c=this.request(this.url+"/histograms",{query:{variable:c,f:"json"},signal:k}).then(u=>
u.data?.histograms);q=await Promise.all([q,c]);q[0]&&q[0].forEach(u=>{u.avg=u.mean;u.stddev=u.standardDeviation});q[1]?.[0]?.counts?.length||(q[1]=null);return{statistics:q[0]||null,histograms:q[1]||null}}async computeBestPyramidLevelForLocation(c,k={}){if(!this._tilemapCache)return 0;c=this.identifyPixelLocation(c,0,k.datumTransformation);if(null===c)return null;let q=0;var {maximumPyramidLevel:u}=this.rasterInfo.storageInfo;u=u-q+this._levelOffset;const G=c.srcLocation;for(;0<=u;){try{if("available"===
await this._tilemapCache.fetchAvailability(u,c.row,c.col,k))break}catch{}u--;q++;c=this.identifyPixelLocation(G,q,k.datumTransformation);if(null===c)return null}return-1===u||null==c?null:q}async _fetchRasterInfo(c){var k=this.sourceJSON;if("Map"===this.tileType){c=k.fullExtent||k.extent;var q=Math.ceil((c.xmax-c.xmin)/k.pixelSizeX-.1);const u=Math.ceil((c.ymax-c.ymin)/k.pixelSizeY-.1),G=r.fromJSON(k.spatialReference||c.spatialReference);k=new a({x:k.pixelSizeX,y:k.pixelSizeY,spatialReference:G});
return new p({width:q,height:u,bandCount:3,extent:f.fromJSON(c),spatialReference:G,pixelSize:k,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}({signal:q}=c);c=t.fetchServiceRasterInfo(this.url,this.sourceJSON,{signal:q,query:this.ioConfig.customFetchParameters});k=k.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:q}).then(u=>u.data?.slices).catch(()=>null):null;k=await Promise.all([c,k]);this._slices=k[1];return k[0]}_fixScaleInServiceInfo(){const {sourceJSON:c}=
this;c.minScale&&0>c.minScale&&(c.minScale=0);c.maxScale&&0>c.maxScale&&(c.maxScale=0)}_computeMinMaxLOD(c,k){const {pixelSize:q}=c,u=.5/c.width*q.x;({lods:c}=k);var G=k.lodAt(Math.max.apply(null,c.map(x=>x.level)));k=k.lodAt(Math.min.apply(null,c.map(x=>x.level)));var {tileType:y}=this;if("Map"===y)return this._levelOffset=c[0].level,[G,k];if("Raster"===y)return[c.find(x=>x.resolution===q.x)??G,k];const {minScale:C,maxScale:H}=this.sourceJSON;y=G;0<H&&((y=c.find(x=>Math.abs(x.scale-H)<u))||(y=c.filter(x=>
x.scale>H).sort((x,M)=>x.scale>M.scale?1:-1)[0]??G));G=k;0<C&&(G=c.find(x=>Math.abs(x.scale-C)<u)??k,this._levelOffset=G.level-k.level);return[y,G]}};m.__decorate([R.property({type:String,json:{write:!0}})],w.prototype,"datasetFormat",void 0);m.__decorate([R.property()],w.prototype,"tileType",void 0);return w=m.__decorate([z.subclass("esri.layers.support.rasterDatasets.ImageServerRaster")],w)})},"esri/layers/support/TilemapCache":function(){define("exports ../../chunks/tslib.es6 ../../request ../../core/Accessor ../../core/ByteSizeUnit ../../core/Error ../../core/handleUtils ../../core/has ../../core/LRUCache ../../core/PooledArray ../../core/promiseUtils ../../core/reactiveUtils ../../core/scheduling ../../core/urlUtils ../../core/accessorSupport/decorators/property ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./TileKey ./Tilemap".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h,n,l,A,t,r,a){var f;m.TilemapCache=f=class extends J{constructor(d){super(d);this._pendingTilemapRequests={};this.request=v;this.size=32;this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new D.LRUCache(2*F.ByteSizeUnit.MEGABYTES);this.addHandles(b.watch(()=>{const {layer:d}=this;return[d?.parsedUrl,d?.tileServers,d?.apiKey,d?.customParameters]},()=>this._initializeTilemapDefinition(),b.initial))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??
this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(d,e,c){return!this.layer.tileInfo.lodAt(d)||d<this.effectiveMinLOD||d>this.effectiveMaxLOD?"unavailable":(d=this._tilemapFromCache(d,e,c,this._tmpTilemapDefinition))?d.getAvailability(e,c):"unknown"}fetchAvailability(d,e,c,k){return!this.layer.tileInfo.lodAt(d)||d<this.effectiveMinLOD||d>this.effectiveMaxLOD?Promise.reject(new R("tile-map:tile-unavailable","Tile is not available",{level:d,row:e,col:c})):this._fetchTilemap(d,
e,c,k).catch(q=>q).then(q=>{if(q instanceof a.Tilemap){q=q.getAvailability(e,c);if("unavailable"===q)throw new R("tile-map:tile-unavailable","Tile is not available",{level:d,row:e,col:c});return q}if(p.isAbortError(q))throw q;return"unknown"})}fetchAvailabilityUpsample(d,e,c,k,q){k.level=d;k.row=e;k.col=c;const u=this.layer.tileInfo;u.updateTileInfo(k);const G=this.fetchAvailability(d,e,c,q).catch(y=>{if(p.isAbortError(y))throw y;if(u.upsampleTile(k))return this.fetchAvailabilityUpsample(k.level,
k.row,k.col,k,q);throw y;});this._fetchAvailabilityUpsamplePrefetch(k.id,d,e,c,q,G);return G}async _fetchAvailabilityUpsamplePrefetch(d,e,c,k,q,u){if(this._prefetchingEnabled&&null!=d){var G=`prefetch-${d}`;if(!this.hasHandles(G)){var y=new AbortController;u.then(()=>y.abort(),()=>y.abort());var C=!1;u=P.makeHandle(()=>{C||(C=!0,y.abort())});this.addHandles(u,G);await g.waitTicks(10,y.signal).catch(()=>{});C||(C=!0,this.removeHandles(G));if(!p.isAborted(y))for(d=new r.TileKey(d,e,c,k),q={...q,signal:y.signal},
e=this.layer.tileInfo,c=0;f._prefetches.length<f._maxPrefetch&&e.upsampleTile(d);++c){const H=this.fetchAvailability(d.level,d.row,d.col,q);f._prefetches.push(H);k=()=>{f._prefetches.removeUnordered(H)};H.then(k,k)}}}}_fetchTilemap(d,e,c,k){if(!this.layer.tileInfo.lodAt(d)||d<this.effectiveMinLOD||d>this.effectiveMaxLOD)return Promise.reject(new R("tilemap-cache:level-unavailable",`Level ${d} is unavailable in the service`));const q=this._tmpTilemapDefinition;if(d=this._tilemapFromCache(d,e,c,q))return Promise.resolve(d);
const u=k?.signal;k={...k,signal:null};return new Promise((G,y)=>{p.onAbort(u,()=>y(p.createAbortError()));const C=a.tilemapDefinitionId(q);let H=this._pendingTilemapRequests[C];if(!H){H=a.Tilemap.fromDefinition(q,k).then(M=>{this._tilemapCache.put(C,M,M.byteSize);return M});const x=()=>{delete this._pendingTilemapRequests[C]};this._pendingTilemapRequests[C]=H;H.then(x,x)}H.then(G,y)})}_initializeTilemapDefinition(){if(this.layer.parsedUrl){var {parsedUrl:d,apiKey:e,customParameters:c}=this.layer;
this._tilemapCache.clear();this._tmpTilemapDefinition={service:{url:d.path,query:h.objectToQuery({...d.query,...c,token:e??d.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}}_tilemapFromCache(d,e,c,k){k.level=d;k.row=e-e%this.size;k.col=c-c%this.size;d=a.tilemapDefinitionId(k);return this._tilemapCache.get(d)}get test(){}};m.TilemapCache._maxPrefetch=4;m.TilemapCache._prefetches=new z({initialSize:f._maxPrefetch});w.__decorate([n.property({constructOnly:!0})],
m.TilemapCache.prototype,"layer",void 0);w.__decorate([n.property({constructOnly:!0})],m.TilemapCache.prototype,"minLOD",void 0);w.__decorate([n.property({constructOnly:!0})],m.TilemapCache.prototype,"maxLOD",void 0);w.__decorate([n.property({constructOnly:!0})],m.TilemapCache.prototype,"request",void 0);w.__decorate([n.property({constructOnly:!0})],m.TilemapCache.prototype,"size",void 0);m.TilemapCache=f=w.__decorate([t.subclass("esri.layers.support.TilemapCache")],m.TilemapCache);Object.defineProperty(m,
Symbol.toStringTag,{value:"Module"})})},"esri/core/ByteSizeUnit":function(){define(["exports"],function(m){m.ByteSizeUnit=void 0;var w=m.ByteSizeUnit||(m.ByteSizeUnit={});w[w.KILOBYTES=1024]="KILOBYTES";w[w.MEGABYTES=1048576]="MEGABYTES";w[w.GIGABYTES=1073741824]="GIGABYTES";Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/Tilemap":function(){define("exports ../../request ../../core/Error ../../core/lang ../../core/typedArrayUtil ../../geometry/support/UintArray".split(" "),
function(m,w,v,J,F,R){function P(D){if(D.service.tileServers?.length){var z=D.service.tileServers;z=`${z&&z.length?z[D.row%z.length]:D.service.url}/tilemap/${D.level}/${D.row}/${D.col}/${D.width}/${D.height}`}else z=`${D.service.url}/tilemap/${D.level}/${D.row}/${D.col}/${D.width}/${D.height}`;(D=D.service.query)&&(z=`${z}?${D}`);return z}class U{constructor(D){if(!D?.location)throw new v("tilemap:missing-location","Location missing from tilemap response");if(!1===D.valid)throw new v("tilemap:invalid",
"Tilemap response was marked as invalid");if(!D.data)throw new v("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(D.data))throw new v("tilemap:data-mismatch","Data must be an array of numbers");if(D.data.length!==D.location.width*D.location.height)throw new v("tilemap:data-mismatch","Number of data items does not match width/height of tilemap");const {location:z,data:p}=D;this.location=Object.freeze(J.clone(z));let b=D=!0;const g=R.newUintArray(Math.ceil(this.location.width*
this.location.height/32));let h=0;for(let n=0;n<p.length;n++){const l=n%32;p[n]?(b=!1,g[h]|=1<<l):D=!1;31===l&&++h}b?(this._availability="unavailable",this.byteSize=40):D?(this._availability="available",this.byteSize=40):(this._availability=g,this.byteSize=40+F.estimateSize(g))}getAvailability(D,z){if("unavailable"===this._availability||"available"===this._availability)return this._availability;D=(D-this.location.top)*this.location.width+(z-this.location.left);z=D>>5;const p=this._availability;return 0>
z||z>p.length?"unknown":p[z]&1<<D%32?"available":"unavailable"}static fromDefinition(D,z){const p=D.service.request||w,{row:b,col:g,width:h,height:n}=D,l={query:{f:"json"}};z=z?{...l,...z}:l;return p(P(D),z).then(A=>A.data).catch(A=>{if(422===A?.details?.httpStatus)return{location:{top:b,left:g,width:h,height:n},valid:!0,data:Array(h*n).fill(0)};throw A;}).then(A=>{if(A.location&&(A.location.top!==b||A.location.left!==g||A.location.width!==h||A.location.height!==n))throw new v("tilemap:location-mismatch",
"Tilemap response for different location than requested",{response:A,definition:{top:b,left:g,width:h,height:n}});return U.fromJSON(A)})}static fromJSON(D){return Object.freeze(new U(D))}}m.Tilemap=U;m.tilemapDefinitionId=function(D){return`${D.level}/${D.row}/${D.col}/${D.width}/${D.height}`};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/UintArray":function(){define(["exports","../../core/typedArrayUtil"],function(m,w){m.newUintArray=function(v,J=!1){return v<=
w.nativeArrayMaxSize?J?Array(v).fill(0):Array(v):new Uint32Array(v)};m.uintSubArray=function(v,J,F){return Array.isArray(v)?v.slice(J,J+F):v.subarray(J,J+F)};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterTransforms/GCSShiftTransform":function(){define("../../../chunks/tslib.es6 ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/enumeration ../../../core/accessorSupport/decorators/subclass ./BaseRasterTransform".split(" "),
function(m,w,v,J,F,R,P,U){var D;v=D=class extends U{constructor(){super(...arguments);this.type="gcs-shift";this.tolerance=1E-8}forwardTransform(z){z=z.clone();if("point"===z.type)return z.x>180+this.tolerance&&(z.x-=360),z;z.xmin>=180-this.tolerance?(z.xmax-=360,z.xmin-=360):z.xmax>180+this.tolerance&&(z.xmin=-180,z.xmax=180);return z}inverseTransform(z){z=z.clone();if("point"===z.type)return z.x<-this.tolerance&&(z.x+=360),z;z.xmin<-this.tolerance&&(z.xmin+=360,z.xmax+=360);return z}clone(){return new D({tolerance:this.tolerance})}};
m.__decorate([R.enumeration({GCSShiftXform:"gcs-shift"})],v.prototype,"type",void 0);m.__decorate([w.property()],v.prototype,"tolerance",void 0);return v=D=m.__decorate([P.subclass("esri.layers.support.rasterTransforms.GCSShiftTransform")],v)})},"esri/rest/imageService/fetchRasterInfo":function(){define("exports ../../request ../../geometry/Extent ../../geometry/Point ../../geometry/SpatialReference ../../layers/support/RasterInfo ../../layers/support/RasterStorageInfo ../utils ../support/FeatureSet".split(" "),
function(m,w,v,J,F,R,P,U,D){async function z(p,b,g){p=U.parseUrl(p);const {rasterFunction:h,sourceJSON:n}=b||{};b=h?JSON.stringify(h.rasterFunctionDefinition||h):null;b=U.encode({...p.query,renderingRule:b,f:"json"});b=U.asValidOptions(b,g);p=p.path;g=n||await w(p,b).then(u=>u.data);var l=g.hasRasterAttributeTable?w(`${p}/rasterAttributeTable`,b):null,A=g.hasColormap?w(`${p}/colormap`,b):null,t=g.hasHistograms?w(`${p}/histograms`,b):null,r=10.3<=g.currentVersion?w(`${p}/keyProperties`,b):null;p=g.hasMultidimensions?
w(`${p}/multidimensionalInfo`,b):null;t=await Promise.allSettled([l,A,t,r,p]);p=null;if(g.minValues&&g.minValues.length===g.bandCount)for(p=[],b=0;b<g.minValues.length;b++)p.push({min:g.minValues[b],max:g.maxValues[b],avg:g.meanValues[b],stddev:g.stdvValues[b]});l=v.fromJSON(g.extent);b=Math.ceil(l.width/g.pixelSizeX-.1);l=Math.ceil(l.height/g.pixelSizeY-.1);A=F.fromJSON(g.spatialReference||g.extent.spatialReference);r="fulfilled"===t[0].status?t[0].value?.data:null;r=r?.features?.length?D.fromJSON(r):
null;var a="fulfilled"===t[1].status?t[1].value?.data.colormap:null;a=a?.length?a:null;var f="fulfilled"===t[2].status?t[2].value?.data.histograms:null;f=f?.[0]?.counts?.length?f:null;const d="fulfilled"===t[3].status?t[3].value?.data??{}:{};t="fulfilled"===t[4].status?t[4].value?.data.multidimensionalInfo:null;(t=t?.variables?.length?t:null)&&t.variables.forEach(u=>{u.statistics?.length&&u.statistics.forEach(G=>{G.avg=G.mean;G.stddev=G.standardDeviation})});const {defaultVariable:e,serviceDataType:c}=
g;e&&e!==d.DefaultVariable&&(d.DefaultVariable=e);c?.includes("esriImageServiceDataTypeVector")&&!c.includes(d.DataType)&&(d.DataType=c.replace("esriImageServiceDataType",""));let k=g.noDataValue;g.noDataValues?.length&&g.noDataValues.some(u=>u!==k)&&(k=g.noDataValues);const q=g.transposeInfo?new P({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new J({x:g.extent.xmin,y:g.extent.ymax,spatialReference:A}),firstPyramidLevel:1,
maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(b,l))/Math.LN2-8)),transposeInfo:g.transposeInfo}):void 0;return new R({width:b,height:l,bandCount:g.bandCount,extent:v.fromJSON(g.extent),spatialReference:A,pixelSize:new J({x:g.pixelSizeX,y:g.pixelSizeY,spatialReference:A}),pixelType:g.pixelType.toLowerCase(),statistics:p,attributeTable:r,colormap:a,histograms:f,keyProperties:d,noDataValue:k,multidimensionalInfo:t,storageInfo:q})}m.fetchServiceRasterInfo=function(p,b,g){return z(p,{sourceJSON:b},
g)};m.generateRasterInfo=function(p,b,g){return z(p,{rasterFunction:b},g)};m.patchServiceInfo=function(p,b){p.attributeTable||(b.hasRasterAttributeTable=!1);p.histograms||(b.hasHistograms=!1);p.colormap||(b.hasColormap=!1);p.multidimensionalInfo||(b.hasMultidimensions=!1)};Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/rasterDatasets/MRFRaster":function(){define("../../../chunks/tslib.es6 ../../../geometry ../../../core/Error ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../PixelBlock ../RasterInfo ../RasterStorageInfo ./BaseRaster ./pamParser ./xmlUtilities ../rasterFormats/utils ../rasterFunctions/stretchUtils ../../../geometry/SpatialReference ../../../geometry/Extent ../../../geometry/Point".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h,n,l,A,t,r){const a=new Map;a.set("Int8","s8");a.set("UInt8","u8");a.set("Int16","s16");a.set("UInt16","u16");a.set("Int32","s32");a.set("UInt32","u32");a.set("Float32","f32");a.set("Float64","f32");a.set("Double64","f32");const f=new Map;f.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"});f.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"});f.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"});
f.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});w=class extends b{constructor(){super(...arguments);this._storageIndex=this._files=null;this.datasetFormat="MRF"}async open(d){await this.init();this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);var e=d?d.signal:null,c=await this.request(this.url,{responseType:"xml",signal:e});const {rasterInfo:k,files:q}=this._parseHeader(c.data),{skipMapInfo:u,skipExtensions:G=[]}=this.ioConfig;G.includes("aux.xml")||u||(d=await this._fetchAuxiliaryData(d),
null!=d&&(k.statistics=d.statistics??k.statistics,(k.histograms=d.histograms)&&null==k.statistics&&(k.statistics=l.estimateStatisticsFromHistograms(d.histograms))));u&&this.updateImageSpaceRasterInfo(k);this._set("rasterInfo",k);this._files=q;e=(await this.request(q.index,{responseType:"array-buffer",signal:e})).data;if(0<e.byteLength%16)throw Error("invalid array buffer must be multiples of 16");var y,C;if(n.isPlatformLittleEndian){d=new Uint8Array(e);var H=new ArrayBuffer(e.byteLength);c=new Uint8Array(H);
for(y=0;y<e.byteLength/4;y++)for(C=0;4>C;C++)c[4*y+C]=d[4*y+3-C];e=new Uint32Array(H)}else e=new Uint32Array(e);this._storageIndex=e;const {blockWidth:x,blockHeight:M}=this.rasterInfo.storageInfo;e=this.rasterInfo.storageInfo.pyramidScalingFactor;const {width:L,height:N}=this.rasterInfo;d=[];c=this._getBandSegmentCount();H=0;for(y=-1;H<this._storageIndex.length;){y++;C=Math.ceil(L/x/e**y)-1;const E=Math.ceil(N/M/e**y)-1;H+=(C+1)*(E+1)*c*4;d.push({maxRow:E,maxCol:C,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=
d;0<y&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=y);this.updateTileInfo()}async fetchRawTile(d,e,c,k={}){const {blockWidth:q,blockHeight:u,blockBoundary:G}=this.rasterInfo.storageInfo;var y=G[d];if(!y||y.maxRow<e||y.maxCol<c||y.minRow>e||y.minCol>c)return null;const {bandCount:C,pixelType:H}=this.rasterInfo,{ranges:x,actualTileWidth:M,actualTileHeight:L}=this._getTileLocation(d,e,c);if(!x||0===x.length)return null;if(0===x[0].from&&0===x[0].to)return d=
new Uint8Array(q*u),new D({width:q,height:u,pixels:void 0,mask:d,validPixelCount:0});({bandIds:e}=this.ioConfig);c=this._getBandSegmentCount();y=[];for(d=d=0;d<c;d++)e&&!e.includes(d)||y.push(this.request(this._files.data,{range:{from:x[d].from,to:x[d].to},responseType:"array-buffer",signal:k.signal}));k=await Promise.all(y);d=k.map(I=>I.data.byteLength).reduce((I,K)=>I+K);y=new Uint8Array(d);const N=[];let E=0;for(d=0;d<c;d++)N.push(E),y.set(new Uint8Array(k[d].data),E),E+=k[d].data.byteLength;d=
f.get(this.rasterInfo.storageInfo.compression).decoderFormat;e=await this.decodePixelBlock(y.buffer,{width:q,height:u,format:d,planes:e?.length||C,offsets:N,pixelType:H});if(null==e)return null;({noDataValue:c}=this.rasterInfo);if(null!=c&&"lerc"!==d&&!e.mask&&(c=c[0],null!=c)){k=e.width*e.height;y=new Uint8Array(k);if(1E24<Math.abs(c))for(d=0;d<k;d++)1E-6<Math.abs((e.pixels[0][d]-c)/c)&&(y[d]=1);else for(d=0;d<k;d++)e.pixels[0][d]!==c&&(y[d]=1);e.mask=y}k=c=0;if(M!==q||L!==u)if(y=e.mask)for(d=0;d<
u;d++)for(k=d*q,c=d<L?M:0;c<q;c++)y[k+c]=0;else for(y=new Uint8Array(q*u),e.mask=y,d=0;d<L;d++)for(k=d*q,c=0;c<M;c++)y[k+c]=1;return e}_getBandSegmentCount(){return f.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(d,e,c){const {blockWidth:k,blockHeight:q,pyramidScalingFactor:u}=this.rasterInfo.storageInfo,{width:G,height:y}=this.rasterInfo,C=this._getBandSegmentCount();let H,x;var M,L=0;let N=0;for(M=0;M<d;M++)N=u**M,H=Math.ceil(G/k/N),x=Math.ceil(y/
q/N),L+=H*x;N=u**d;H=Math.ceil(G/k/N);x=Math.ceil(y/q/N);L=4*(L+(e*H+c))*C;d=this._storageIndex.subarray(L,L+4*C);L=M=0;const E=[];for(let I=0;I<C;I++)M=d[4*I]*2**32+d[4*I+1],L=M+d[4*I+2]*2**32+d[4*I+3],E.push({from:M,to:L});return{ranges:E,actualTileWidth:c<H-1?k:Math.ceil(G/N)-k*(H-1),actualTileHeight:e<x-1?q:Math.ceil(y/N)-q*(x-1)}}_parseHeader(d){var e=h.getElement(d,"MRF_META/Raster");if(!e)throw new v("mrf:open","not a valid MRF format");var c=h.getElement(e,"Size"),k=parseInt(c.getAttribute("x"),
10),q=parseInt(c.getAttribute("y"),10);const u=parseInt(c.getAttribute("c"),10);c=(h.getElementValue(e,"Compression")||"none").toLowerCase();if(!f.has(c))throw new v("mrf:open","currently does not support compression "+c);var G=h.getElementValue(e,"DataType")||"UInt8";const y=a.get(G);if(null==y)throw new v("mrf:open","currently does not support pixel type "+G);var C=h.getElement(e,"PageSize");G=parseInt(C.getAttribute("x"),10);C=parseInt(C.getAttribute("y"),10);e=h.getElement(e,"DataValues");let H;
e&&(e=e.getAttribute("NoData"),null!=e&&(H=e.trim().split(" ").map(K=>parseFloat(K))));if(h.getElement(d,"MRF_META/CachedSource"))throw new v("mrf:open","currently does not support MRF referencing other data files");var x=h.getElement(d,"MRF_META/GeoTags"),M=h.getElement(x,"BoundingBox");e=!1;if(null!=M){var L=parseFloat(M.getAttribute("minx"));var N=parseFloat(M.getAttribute("miny")),E=parseFloat(M.getAttribute("maxx"));M=parseFloat(M.getAttribute("maxy"));var I=h.getElementValue(x,"Projection")||
"";x=A.WGS84;"LOCAL_CS[]"!==I?I.toLowerCase().startsWith("epsg:")?(I=Number(I.slice(5)),isNaN(I)||0===I||(x=new A({wkid:I}))):x=g.parseSpatialReference(I)??A.WGS84:(e=!0,x=new A({wkid:3857}));L=new t(L,N,E,M);L.spatialReference=x}else e=!0,L=new t({xmin:-.5,ymin:.5-q,xmax:k-.5,ymax:.5,spatialReference:new A({wkid:3857})});N=h.getElement(d,"MRF_META/Rsets");E=parseInt(N?.getAttribute("scale")||"2",10);N=L.spatialReference;G=new p({origin:new r({x:L.xmin,y:L.ymax,spatialReference:N}),blockWidth:G,blockHeight:C,
pyramidBlockWidth:G,pyramidBlockHeight:C,compression:c,pyramidScalingFactor:E});C=new r({x:L.width/k,y:L.height/q,spatialReference:N});k=new z({width:k,height:q,extent:L,isPseudoSpatialReference:e,spatialReference:N,bandCount:u,pixelType:y,pixelSize:C,noDataValue:H,storageInfo:G});q=h.getElementValue(d,"datafile");d=h.getElementValue(d,"IndexFile");d={mrf:this.url,index:d||this.url.replace(".mrf",".idx"),data:q||this.url.replace(".mrf",f.get(c).blobExtension)};return{rasterInfo:k,files:d}}async _fetchAuxiliaryData(d){try{const {data:e}=
await this.request(this.url+".aux.xml",{responseType:"xml",signal:d?.signal});return g.parsePAMInfo(e)}catch{return null}}};m.__decorate([J.property()],w.prototype,"_files",void 0);m.__decorate([J.property()],w.prototype,"_storageIndex",void 0);m.__decorate([J.property({type:String,json:{write:!0}})],w.prototype,"datasetFormat",void 0);return w=m.__decorate([U.subclass("esri.layers.support.rasterDatasets.MRFRaster")],w)})},"esri/layers/support/rasterDatasets/TIFFRaster":function(){define("../../../chunks/tslib.es6 ../../../geometry ../../../core/arrayUtils ../../../core/Error ../../../core/Logger ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/accessorSupport/decorators/subclass ../RasterInfo ../RasterStorageInfo ./BaseRaster ./DBFParser ./pamParser ../rasterFormats/TiffDecoder ../rasterFormats/TiffTags ../rasterFunctions/stretchUtils ../rasterTransforms/PolynomialTransform ../../../rest/support/FeatureSet ../../../geometry/SpatialReference ../../../geometry/Extent ../../../geometry/Point".split(" "),
function(m,w,v,J,F,R,P,U,D,z,p,b,g,h,n,l,A,t,r,a,f){function d(e){const c=h.getImageInfo(e),{width:k,height:q,tileWidth:u,tileHeight:G,planes:y,pixelType:C,compression:H,firstPyramidLevel:x,maximumPyramidLevel:M,pyramidBlockWidth:L,pyramidBlockHeight:N,pyramidResolutions:E,tileBoundary:I,affine:K,metadata:S}=c;let O=g.parseSpatialReference(c.extent.spatialReference?.wkt||c.extent.spatialReference?.wkid);var W=!!c.isPseudoGeographic;null==O&&(W=!0,O=new r({wkid:3857}));const Y=new a({...c.extent,spatialReference:O});
var V=Y?new f({x:Y.xmin,y:Y.ymax,spatialReference:O}):new f({x:0,y:0});V=new z({blockWidth:u,blockHeight:G,pyramidBlockWidth:L,pyramidBlockHeight:N,compression:H,origin:V,firstPyramidLevel:x,maximumPyramidLevel:M,pyramidResolutions:E,blockBoundary:I});const B=new f({x:(Y.xmax-Y.xmin)/k,y:(Y.ymax-Y.ymin)/q,spatialReference:O}),Q=S?{BandProperties:S.bandProperties,DataType:S.dataType}:{};let T=null;var X=e[0].get("PHOTOMETRICINTERPRETATION")?.values?.[0];e=e[0].get("COLORMAP")?.values;if(3>=X&&3<e?.length&&
0===e.length%3){T=[];X=e.length/3;for(let aa=0;aa<X;aa++)T.push([aa,e[aa]>>>8,e[aa+X]>>>8,e[aa+2*X]>>>8])}W=new D({width:k,height:q,bandCount:y,pixelType:C,pixelSize:B,storageInfo:V,spatialReference:O,isPseudoSpatialReference:W,keyProperties:Q,extent:Y,colormap:T,statistics:S?S.statistics:null});K?.length&&(W.nativeExtent=new a({xmin:-.5,ymin:.5-q,xmax:k-.5,ymax:.5,spatialReference:O}),W.transform=new A({polynomialOrder:1,forwardCoefficients:[K[2]+K[0]/2,K[5]-K[3]/2,K[0],K[3],-K[1],-K[4]]}),W.extent=
W.transform.forwardTransform(W.nativeExtent),W.pixelSize=new f({x:(Y.xmax-Y.xmin)/k,y:(Y.ymax-Y.ymin)/q,spatialReference:O}),V.origin.x=-.5,V.origin.y=.5);if(E){const {x:aa,y:Z}=W.pixelSize;E.forEach(ba=>{ba.x*=aa;ba.y*=Z})}return{imageInfo:c,rasterInfo:W}}w=class extends p{constructor(){super(...arguments);this._headerInfo=this._files=null;this._bufferSize=1048576;this.datasetFormat="TIFF"}async open(e){await this.init();var c=e?e.signal:null,{data:k}=await this.request(this.url,{range:{from:0,to:this._bufferSize},
responseType:"array-buffer",signal:c});if(!k)throw new J("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const {littleEndian:q,firstIFDPos:u,isBigTiff:G}=h.parseSignature(k);var y=[];await this._readIFDs(y,k,q,u,0,G?8:4,c);const {imageInfo:C,rasterInfo:H}=d(y);c=h.getPyramidIFDs(y);k=h.getMaskIFDs(y);this._headerInfo={littleEndian:q,isBigTiff:G,ifds:y,pyramidIFDs:c,maskIFDs:k,...C};this._set("rasterInfo",H);if(!C.isSupported)throw new J("tiffraster:open",
"this tiff is not supported: "+C.message);if(!C.tileWidth)throw new J("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");H.isPseudoSpatialReference&&F.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");c=y[0].get("PREDICTOR")?.values?.[0];if(3===y[0].get("SAMPLEFORMAT")?.values?.[0]&&2===c)throw new J("tiffraster:open","unsupported horizontal difference encoding. Predictor\x3d3 is supported for floating point data");
const {skipMapInfo:x,skipExtensions:M=[]}=this.ioConfig;M.includes("aux.xml")||x||(y=await this._fetchAuxiliaryMetaData(e),null!=y&&(H.statistics=y.statistics??H.statistics,(H.histograms=y.histograms)&&null==H.statistics&&(H.statistics=l.estimateStatisticsFromHistograms(y.histograms)),y.transform&&null==H.transform&&(H.transform=y.transform,H.nativeExtent=H.extent,c=H.transform.forwardTransform(H.nativeExtent),H.pixelSize=new f({x:(c.xmax-c.xmin)/H.width,y:(c.ymax-c.ymin)/H.height,spatialReference:H.spatialReference}),
H.extent=c),H.isPseudoSpatialReference&&y.spatialReference&&(H.spatialReference=y.spatialReference,H.extent.spatialReference=H.nativeExtent.spatialReference=H.storageInfo.origin.spatialReference=H.spatialReference)));M.includes("vat.dbf")||1!==H.bandCount||"u8"!==H.pixelType||x||(H.attributeTable=await this._fetchAuxiliaryTable(e),null!=H.attributeTable&&(H.keyProperties.DataType="thematic"));x&&this.updateImageSpaceRasterInfo(H);this.updateTileInfo()}async fetchRawTile(e,c,k,q={}){if(!this._headerInfo?.isSupported||
this.isBlockOutside(e,c,k))return null;const u=await this._fetchRawTiffTile(e,c,k,!1,q);null!=u&&this._headerInfo.hasMaskBand&&(e=await this._fetchRawTiffTile(e,c,k,!0,q),null!=e&&e.pixels[0]instanceof Uint8Array&&(u.mask=e.pixels[0]));return u}async _readIFDs(e,c,k,q,u,G=4,y){if(!q)return null;if(q>=c.byteLength||0>q)c=(await this.request(this.url,{range:{from:q+u,to:q+u+this._bufferSize},responseType:"array-buffer",signal:y})).data,u=q+u,q=0;q=await this._readIFD(c,k,q,u,n.tiffTags,G,y);e.push(q.ifd);
if(!q.nextIFD)return null;await this._readIFDs(e,c,k,q.nextIFD-u,u,G,y)}async _readIFD(e,c,k,q,u=n.tiffTags,G=4,y){if(!e)return null;k=h.parseIFD(e,c,k,q,u,G);if(k.success){const C=[];k.ifd?.forEach(H=>{H.values||C.push(H)});0<C.length&&(G=C.map(H=>H.offlineOffsetSize).filter(v.isSome),u=Math.min.apply(null,G.map(H=>H[0])),Math.min.apply(null,G.map(H=>H[0]+H[1]))-u<=this._bufferSize&&({data:G}=await this.request(this.url,{range:{from:u,to:u+this._bufferSize},responseType:"array-buffer",signal:y}),
e=G,q=u,C.forEach(H=>h.parseFieldValues(e,c,H,q))));k.ifd?.has("GEOKEYDIRECTORY")&&(u=k.ifd.get("GEOKEYDIRECTORY"),(G=u?.values)&&4<G.length&&(G=G[0]+"."+G[1]+"."+G[2],y=await this._readIFD(e,c,u.valueOffset+6-q,q,n.geoKeys,2,y),u.data=y.ifd,u.data&&u.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[G]})));return k}if(k.requiredBufferSize&&k.requiredBufferSize!==e.byteLength)return e=(await this.request(this.url,{range:{from:q,to:q+k.requiredBufferSize+4},responseType:"array-buffer",
signal:y})).data,e.byteLength<k.requiredBufferSize?null:this._readIFD(e,c,0,q,n.tiffTags,4,y)}async _fetchRawTiffTile(e,c,k,q,u={}){c=this._getTileLocation(e,c,k,q);if(!c)return null;const {ranges:G,actualTileWidth:y,actualTileHeight:C,ifd:H}=c;c=G.map(N=>this.request(this.url,{range:N,responseType:"array-buffer",signal:u.signal}));c=await Promise.all(c);k=c.map(N=>N.data.byteLength).reduce((N,E)=>N+E);k=1===c.length?c[0].data:new ArrayBuffer(k);q=[0];var x=[0];if(1<c.length){const N=new Uint8Array(k);
for(let E=0,I=0;E<c.length;E++){const K=c[E].data;N.set(new Uint8Array(K),I);q[E]=I;I+=K.byteLength;x[E]=K.byteLength}}const {blockWidth:M,blockHeight:L}=this.getBlockWidthHeight(e);e=await this.decodePixelBlock(k,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:H,offsets:q,sizes:x},width:M,height:L,planes:null,pixelType:null});if(null==e)return null;if(y!==M||C!==L)if(x=e.mask)for(c=0;c<L;c++)for(q=c*M,k=c<C?y:0;k<M;k++)x[q+k]=0;else for(x=new Uint8Array(M*L),e.mask=x,c=0;c<C;c++)for(q=
c*M,k=0;k<y;k++)x[q+k]=1;return e}_getTileLocation(e,c,k,q=!1){const {firstPyramidLevel:u,blockBoundary:G}=this.rasterInfo.storageInfo;var y=0===e?0:e-(u-1);({_headerInfo:e}=this);if(!e)return null;q=q?e.maskIFDs[y]:0===y?e?.ifds[0]:e?.pyramidIFDs[y-1];if(!q)return null;var C=h.isBSQConfig(q,e);e=q.get("TILEOFFSETS")?.values;if(void 0===e)return null;const H=q.get("TILEBYTECOUNTS")?.values,{minRow:x,minCol:M,maxRow:L,maxCol:N}=G[y];if(c>L||k>N||c<x||k<M)return null;y=q.get("IMAGEWIDTH")?.values?.[0];
const E=q.get("IMAGELENGTH")?.values?.[0],I=q.get("TILEWIDTH")?.values?.[0],K=q.get("TILELENGTH")?.values?.[0],S=[];if(C){({bandCount:C}=this.rasterInfo);for(let O=0;O<C;O++){const W=O*(L+1)*(N+1)+c*(N+1)+k;S[O]={from:e[W],to:e[W]+H[W]-1}}}else C=c*(N+1)+k,S.push({from:e[C],to:e[C]+H[C]-1});for(e=0;e<S.length;e++)if(null==S[e].from||!S[e].to||0>S[e].to)return null;return{ranges:S,ifd:q,actualTileWidth:k===N?y%I||I:I,actualTileHeight:c===L?E%K||K:K}}async _fetchAuxiliaryMetaData(e){try{const {data:c}=
await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return g.parsePAMInfo(c)}catch{return null}}async _fetchAuxiliaryTable(e){try{const {data:c}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),k=b.parse(c);return k?.recordSet?t.fromJSON(k.recordSet):null}catch{return null}}};m.__decorate([R.property()],w.prototype,"_files",void 0);m.__decorate([R.property()],w.prototype,"_headerInfo",void 0);m.__decorate([R.property()],w.prototype,"_bufferSize",
void 0);m.__decorate([R.property({type:String,json:{write:!0}})],w.prototype,"datasetFormat",void 0);return w=m.__decorate([U.subclass("esri.layers.support.rasterDatasets.TIFFRaster")],w)})},"esri/layers/support/rasterDatasets/DBFParser":function(){define(["./byteStreamUtils"],function(m){function w(J){var F=J.fields;J=J.records;const R=F.some(p=>"oid"===p.name.toLowerCase())?"OBJECTID":"OID";F=[{name:R,type:"esriFieldTypeOID",alias:"OID"}].concat(F.map(p=>({name:p.name,type:"esriFieldType"+p.typeName,
alias:p.name})));const P=F.map(p=>p.name),U=[];let D=0,z=0;J.forEach(p=>{const b={};b[R]=D++;for(z=1;z<P.length;z++)b[P[z]]=p[z-1];U.push({attributes:b})});return{displayFieldName:"",fields:F,features:U}}class v{static get supportedVersions(){return[5]}static parse(J){var F=new DataView(J),R=F.getUint8(0)&3;if(3!==R)return{header:{version:R},recordSet:null};const P=F.getUint32(4,!0);var U=F.getUint16(8,!0);const D=F.getUint16(10,!0);U={version:R,recordCount:P,headerByteCount:U,recordByteCount:D};
let z=32;const p=[],b=[];if(3===R){for(;13!==F.getUint8(z);)R=String.fromCharCode(F.getUint8(z+11)).trim(),p.push({name:m.bytesToUTF8(new Uint8Array(J,z,11)),type:R,typeName:"String Date Double Boolean String Integer".split(" ")["CDFLMN".split("").indexOf(R)],length:F.getUint8(z+16)}),z+=32;z+=1;if(0<p.length)for(;b.length<P&&J.byteLength-z>D;){const g=[];32===F.getUint8(z)?(z+=1,p.forEach(h=>{if("C"===h.type)g.push(m.bytesToUTF8(new Uint8Array(J,z,h.length)).trim());else if("N"===h.type)g.push(parseInt(String.fromCharCode.apply(null,
new Uint8Array(J,z,h.length)).trim(),10));else if("F"===h.type)g.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(J,z,h.length)).trim()));else if("D"===h.type){const n=String.fromCharCode.apply(null,new Uint8Array(J,z,h.length)).trim();g.push(new Date(parseInt(n.substring(0,4),10),parseInt(n.substring(4,6),10)-1,parseInt(n.substring(6,8),10)))}z+=h.length}),b.push(g)):z+=D}}F=w({fields:p,records:b});return{header:U,fields:p,records:b,recordSet:F}}}return v})},"*noref":1}});
define("require ../chunks/tslib.es6 ../PopupTemplate ../core/Clonable ../core/Error ../core/Logger ../core/MultiOriginJSONSupport ../core/promiseUtils ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/accessorSupport/ensureType ../core/RandomLCG ../core/has ../core/accessorSupport/decorators/enumeration ../core/accessorSupport/decorators/subclass ./Layer ./mixins/ArcGISService ./mixins/BlendLayer ./mixins/CustomParametersMixin ./mixins/ImageryTileMixin ./mixins/OperationalLayer ./mixins/PortalLayer ./mixins/RefreshableLayer ./mixins/ScaleRangeLayer ./mixins/TemporalLayer ./support/commonProperties ./support/Field ./support/rasterEnums ./support/RasterFunction ./support/rasterDatasets/FunctionRaster ./support/rasterDatasets/RasterFactory ./support/rasterFunctions/rasterFunctionHelper ../support/popupUtils ../webdoc/interfaces".split(" "),function(m,
w,v,J,F,R,P,U,D,z,p,b,g,h,n,l,A,t,r,a,f,d,e,c,k,q,u,G,y,C,H,x,M,L){J=class extends t.BlendLayer(c.ScaleRangeLayer(f.OperationalLayer(d.PortalLayer(r.CustomParametersMixin(a.ImageryTileMixin(k.TemporalLayer(A.ArcGISService(e.RefreshableLayer(P.MultiOriginJSONMixin(J.ClonableMixin(l))))))))))){constructor(...N){super(...N);this._primaryRasters=[];this.interpolation=this.bandIds=null;this.legendEnabled=!0;this.isReference=null;this.listMode="show";this.version=this.sourceJSON=null;this.type="imagery-tile";
this.operationalLayerType="ArcGISTiledImageServiceLayer";this.popupEnabled=!0;this.fields=this.popupTemplate=null;this.source=void 0;this._debouncedSaveOperations=U.debounce(async(E,I,K)=>{const {save:S,saveAs:O}=await new Promise((W,Y)=>m(["./save/imageryUtils"],W,Y));switch(E){case L.SaveOperationType.SAVE:return S(this,I);case L.SaveOperationType.SAVE_AS:return O(this,K,I)}})}normalizeCtorArgs(N,E){return"string"===typeof N?{url:N,...E}:N}load(N){const E=null!=N?N.signal:null;this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},
N).catch(U.throwIfAbortError).then(()=>this._openRaster(E)));return Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){var N=new u({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),E=new u({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"});N=[N,E];E=this.raster?.rasterInfo??this.serviceRasterInfo;var I=E?.attributeTable;if(I=null!=I?I.fields:
null)I=I.filter(K=>"oid"!==K.type&&"value"!==K.name.toLowerCase()).map(K=>{const S=K.clone();S.name="Raster."+K.name;return S}),N.push(...I);I=E?.dataType;E=E?.multidimensionalInfo;"vector-magdir"!==I&&"vector-uv"!==I||null==E||(E=E.variables[0].unit?.trim(),N.push(new u({name:"Raster.Magnitude",alias:"Magnitude"+(E?` (${E})`:""),domain:null,editable:!1,type:"double"})),N.push(new u({name:"Raster.Direction",alias:"Direction (\u00b0)",domain:null,editable:!1,type:"double"})));return N}createPopupTemplate(N){const {rasterFields:E}=
this,I=new Set(E.map(({name:K})=>K).filter(K=>"raster.servicepixelvalue.raw"!==K.toLowerCase()));return M.createPopupTemplate({fields:E,title:this.title},{...N,visibleFieldNames:I})}async generateRasterInfo(N,E){N=p.ensureClass(y,N);await this.load();if(!N||"none"===N.functionName?.toLowerCase())return this.serviceRasterInfo;try{const {rasterInfo:I}=await this._openFunctionRaster(N,E);return I}catch(I){if(I instanceof F)throw I;throw new F("imagery-tile-layer","the given raster function is not supported");
}}async save(N){return this._debouncedSaveOperations(L.SaveOperationType.SAVE,N)}async saveAs(N,E){return this._debouncedSaveOperations(L.SaveOperationType.SAVE_AS,E,N)}write(N,E){const I=this._primaryRasters[0]??this.raster;if(this.loaded?"RasterTileServer"===I.datasetFormat&&("Raster"===I.tileType||"Map"===I.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(N,E);E?.messages&&E.messages.push(new F("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${`${E.origin}/${E.layerContainerType||
"operational-layers"}`}'`,{layer:this}));return null}async _openRaster(N){let E=!1;if(this.raster)await this._openFromRaster(this.raster,N),E="Function"===this.raster.datasetFormat;else{const {url:I,rasterFunction:K,source:S}=this;if(!I&&!S)throw new F("imagery-tile-layer:open","missing url or source parameter");S?await this._openFromSource(S,N):K?await this._openFromUrlWithRasterFunction(I,K,N):await this._openFromUrl(I,N)}N=this.raster.rasterInfo;if(!N)throw new F("imagery-tile-layer:load","cannot load resources on "+
this.url);this._set("serviceRasterInfo",E?N:this._primaryRasters[0].rasterInfo);this._set("spatialReference",N.spatialReference);this.sourceJSON=this.sourceJSON||this.raster.sourceJSON;null!=this.sourceJSON?this.read("Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0},{origin:"service"}):this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=
this.raster.datasetName);"Map"===this.raster.tileType&&(this.popupEnabled=!1);this._configDefaultSettings();this.addHandles(D.watch(()=>this.customParameters,I=>{this.raster&&(this.raster.ioConfig.customFetchParameters=I)}))}async _openFromRaster(N,E){N.rasterInfo||await N.open({signal:E});this._primaryRasters="Function"===N.datasetFormat?N.primaryRasters.rasters:[N];this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(N,E,I){N=[N];E&&x.getPrimaryRasterUrls(E.toJSON(),
N);const K=await Promise.all(N.map(O=>H.open({url:O,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:I}))),S=K.findIndex(O=>null==O);if(-1<S)throw new F("imagery-tile-layer:open",`cannot open raster: ${N[S]}`);this._primaryRasters=K;return this._initializeWithFunctionRaster(E)}async _openFromUrl(N,E){E=await H.open({url:N,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},
signal:E});if(null==E)throw new F("imagery-tile-layer:open",`cannot open raster: ${N}`);this._primaryRasters=[E];this.raster=E}async _openFromSource(N,E){const I="coverage"===N.type?.toLowerCase()?"CovJSON":N.extent&&N.pixelBlock?"MEMORY":null;if(!I)throw new F("imagery-tile-layer:open","the tiled imagery data source is not supported");"MEMORY"===I&&(N={extent:N.extent,pixelBlocks:[N.pixelBlock]});N=await H.open({url:"",source:N,datasetFormat:I,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},
signal:E});if(null==N)throw new F("imagery-tile-layer:open","the tiled imagery data source is not supported");this._primaryRasters=[N];this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=N}async _openFunctionRaster(N,E){const I={raster:this._primaryRasters[0]};1<this._primaryRasters.length&&this._primaryRasters.forEach(K=>I[K.url]=K);N=x.create(N.functionDefinition?.toJSON()??N.toJSON(),I);N=new C({rasterFunction:N});await N.open(E);return N}async _initializeWithFunctionRaster(N,
E){try{this.raster=await this._openFunctionRaster(N,E)}catch(I){I instanceof F&&R.getLogger(this).error("imagery-tile-layer:open",I.message),R.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}};w.__decorate([z.property({clonable:!1})],J.prototype,"_primaryRasters",void 0);w.__decorate([z.property({type:[p.Integer],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===
this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],J.prototype,"bandIds",void 0);w.__decorate([z.property({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),h.enumeration(G.interpolationKebab)],J.prototype,"interpolation",void 0);w.__decorate([z.property(q.legendEnabled)],J.prototype,"legendEnabled",void 0);w.__decorate([z.property({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],
J.prototype,"isReference",void 0);w.__decorate([z.property({type:["show","hide"]})],J.prototype,"listMode",void 0);w.__decorate([z.property({json:{read:!0,write:!0}})],J.prototype,"blendMode",void 0);w.__decorate([z.property()],J.prototype,"sourceJSON",void 0);w.__decorate([z.property({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],J.prototype,"version",void 0);w.__decorate([z.property({readOnly:!0,json:{read:!1}})],J.prototype,"type",void 0);w.__decorate([z.property({type:["ArcGISTiledImageServiceLayer"]})],
J.prototype,"operationalLayerType",void 0);w.__decorate([z.property({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader(N,E){return!E.disablePopup}},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(N,E,I){E[I]=!N}}}})],J.prototype,"popupEnabled",void 0);w.__decorate([z.property({type:v,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],
J.prototype,"popupTemplate",void 0);w.__decorate([z.property({readOnly:!0})],J.prototype,"defaultPopupTemplate",null);w.__decorate([z.property({readOnly:!0,type:[u]})],J.prototype,"fields",void 0);w.__decorate([z.property({readOnly:!0,type:[u]})],J.prototype,"rasterFields",null);w.__decorate([z.property({constructOnly:!0})],J.prototype,"source",void 0);return J=w.__decorate([n.subclass("esri.layers.ImageryTileLayer")],J)});