// 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]X;return aa[0]<=T&&aa[1]>T||aa[0]=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||XV[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&&0V.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(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,1b[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;df[d]+2||a[d]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;HC?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)H+x);f=f.map(H=>H/C)}else{f=[];for(var c=0;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&&0Y.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=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(00I;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;yq;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=(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{var n=this.mask;let l=Infinity,A=-Infinity;const t=h.length;let r,a=0;if(null!=n)for(r=0;rA?a:A);else for(r=0;rA?a:A;return new D.SimpleBandStatistics(l,A)});var b=this.mask,g=0;if(null!=b)for(let h= 0;hh?h:fd>=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&&0t+Number.EPSILON||nJ?-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=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;eL?M=k.rightPadding:E>=L&&(x=k.leftMargin-k.rightPadding,M=0)}d.xmax-=M;if("number"===typeof f)for(k=d.ymin;kJ(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;Lnull==S||null!=S.mask&&0S?.bandMasks&&1null!=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;EE?.bandMasks&&1G;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;uf&&(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{const X=V instanceof Float32Array||V instanceof Float64Array?0:.5;for(let aa=0;aaE[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;NE[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;0M?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;aM?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!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]),1q.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{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;qE-1E-6);x[0]=d[0];q&&(x[x.length-1]=d[d.length-1]);for(var M= 0;MH?H:e[M]k));const u=[];f=f.outputPixelType|| "u8";for(let G=0;GH.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.widthH.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;Ia[2*Y]&&OE?E:O=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;HG.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):uf[y].value&&(uk||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=d||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{"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"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{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(;ea&&kArray.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&&0fa[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&&0T?.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%(0M||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:0M||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=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&&(Tja||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(MO||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=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)||8T[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{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(""=== 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.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||hA[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;lt.dimensionName{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[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{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;tf.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;fd.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||1n.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{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=w.size)){var v=Array.from(w);for(let J=0;J=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=Z[1]-X&&Math.abs(fa-aa[0])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.9955fa?-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;Bfa?-1:0;aa&&la&&aa!==la&&(Z[B][0]=01===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;jama?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=sa&&ja<=xa;for(var ma=0;ma=ra&&oa<=va&&(T.push([ja,oa]),B[ca]=1)}}return{points:T,mask:B}}ja=Q.coef;Q=[];for(pa=0;pa=xa&&qa<=va&&(ma.push(sa*qa+ra),oa.push(ya))}qa=ma;if(2ra-xa)}else ma[0]>ma[1]&& (qa=[ma[1],ma[0]]);Q.push(qa)}for(let sa=0,ra=0;sa=oa[0]&&ja<=oa[1]&&(T.push([ja,ma]),B[ra]=1);else if(2=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;QX)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;eaA(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;laB[fa][la][0]?B[fa][la][0]:X,Z=ZB[fa][la][1]?B[fa][la][1]:aa,ba=ba=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])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)}eafa&&(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[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&&0oa/2;var Ba=!1;fa&&(Ba=e(ba),Ba=null!=Ba&&0ka&&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),0ka&&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;mava;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{if(1===T[0])return[0,0];var aa=1,Z=-1,ba=1,ea=-1;for(var fa=0;faB[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;Zba&&(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=0aa/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=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);-1ra.x<=fa.x+sa),0X&&(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=8la-fa||2Z?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;EM;M++){N=new Uint8Array(C);for(L=0;L{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;CK;++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?KI;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;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?NL;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;KM(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{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&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(PD&&(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;this.codeSize=h-=g;this.bytesPos=A;return n&(1<>16;n&=65535;(0==g||g>h;this.codeSize=g-h;this.bytesPos=t;return n};P.prototype.generateHuffmanTable=function(g){for(var h=g.length,n=0,l=0;ln&&(n=g[l]);for(var A=1<>=1;for(l=e;l>=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;rf)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>16;0=t&&(h=this.ensureBuffer(r+n),t=h.length);for(d=0;d>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>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=1<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)<>=4;if(0===ea){if(15>ba){L=e(ba)+(1<>=4;if(0===ea)15>ba?(L=e(ba)+(1<=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;lL;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=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>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>4;var y=b[l+1]&15;ke;e++,l++)G+=q[e]=b[l];y=new Uint8Array(G);for(e=0;e>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>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>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;lr&&"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{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{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;Ey)break a;const C=new d.ctor(G*y);for(let H=0,x=0;H=z;if(0m(["../../../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=P;P++)R[P]=[P];return R}function J(R,P){for(let U=0;U=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<>>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]),1l||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>b&1;for(b=7;U>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>>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;eaba&&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>>32-T,Z=B<<32-T>>>32-T,I=B,Q.push(aa+Z*2**(X-T)),T-=32-(X-T)):(Q.push(I<>>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;VparseFloat(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);3xa.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;vaja?ja:Z.x,pa=Z.xla?la:Z.y,xa=Z.y{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{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)&&42**30/(8{if(!(E&&0W?0:1;else for(Q=0;QW?0:1);return B},N=E=>{if(!E)return null;var I=E.match(//gi);if(!I||0===I.length)return null;E=new Map;var K;for(var S=0;Sla.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>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._schedule=null;this._next()}))}_next(){for(;0this._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;dp.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-zt-u||p>a-G||qk%1||u===p&&.5G%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;em(["../../../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-(ad?l*Math.round((r-d)/l):0),f=e-(fd?l*Math.floor((t-d)/ l+.1):0),a=e-(a{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{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{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.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;hz.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;lthis._readRasterValue(g,p));return this._processPixels({...p,pixelBlocks:b})}processInputBandIds(){var p=this._getRasterValues().filter(this._isRasterFunctionValue);if(1g.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;gg!==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;nb?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;hha.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>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]?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;hana[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=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;haka)return ca[0];const [na]=ca,ha=na.length;da=w.createEmptyBand(da,ha);for(let ua=0;uaka)return ca[0];const [na]=ca,ha=na.length;da=w.createEmptyBand(da,ha);for(let ua=0;uaBa&&(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;uaAa&&(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;haka)return ca[0];var [na]=ca;na=na.length;da=w.createEmptyBand(da,na);for(let ha=0;haka)return ca[0];var [na]=ca;na=na.length;da=w.createEmptyBand(da,na);for(let wa=0;waka)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=ka)return ja(ca,ia,da);const na=ca[0].length;da=w.createEmptyBand(da,na);const ha=new Map;for(let wa=0;waBa&&(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;waka)return ca[0];var [na]=ca;na=na.length;da=w.createEmptyBand(da,na);const ha=new Set;for(let ua=0;uaha?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;BaAa.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&&.001M+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;Ml[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;be&&(e+=360),360===e?e=0:360u&&(u=0),L=u;else{const N=l.length;for(let E=0;EI&&(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;bd?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;uy-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;Mg.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;bD;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}1b.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 ${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;tt&&(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;dn;n++)0g?l=(200*n-25500+510*h)/(2*(100-g))+128:0>=g&&-100l?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;kf&&(f=u,a=q);l=qA?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;ek).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;cg;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;He?G:e;c[G]++}}else for(q=0;qe?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;yk;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;Cl[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=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)for(q=p(f,l),d=0;dh[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=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[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;kC[1]&&(e[k]=C[1])}break; case "histogramEqualization":w.assertIsSome(h);for(k=0;kH){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]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){y=p(u,d);for(var x=0;xa[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;Ga[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;hA.toLowerCase());const l=[];for(let A=0;Aa.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=k.minWavelength&&a<=k.maxWavelength?qk[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&&3A?A:ft.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||16null==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({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;ll?.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"number"===typeof b?(p=!0,[b]):"string"===typeof b?(b=b.trim().split(" ").filter(g=>""!==g.trim()).map(g=>Number(g)),p=p||0g.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;dl[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;rp||7=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;re-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;rpa&&(pa=ja,la=ma);S?(X[ba+ea]=la,aa[ba+ea]=fa.size):O[ba+ea]=la}}if(S)for(let Z=V;ZNumber(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[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(1fa>=Q)&&(T=null);let aa=V.statistics,Z=V.histograms;1aa[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=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=>1ma.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;QQ.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];aaX&&(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(0xa+=ya/ra);T.counts.forEach((ya,ca)=>{if(0qa.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&&0T);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 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{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;ff&&(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;dt.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;an&& (h=n);for(var A=0;Ak&&e;k++){0===k&&(e=!1);for(var c=0;cMath.abs(A-a[t-1]))b[t]=e;else if(tMath.abs(A-a[t+1])){b[t+1]=e-1;break}e=r;r=0; A=[];t=[];for(let c=0;ce){for(g=0;g=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=a.length}function l(a){return"percentClip"===a||"histogramEqualization"===a}function A(a){return null!=a&&0u.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"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 N>M);L&&G.push([f].concat(L.symbol.color))}}else{u=Math.floor(a.minValue);for(y=0;yp.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"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{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;Na.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;CH.sort-x.sort);for(const {x:H,y:x}of C)k.getFloat()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;eu+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;eu+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;KJ.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=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;nH.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!(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;rt&&(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)=>Cq[C.name]&&Object.assign(C, q[C.name]));l=e.length?{variables:e}:void 0;e=[];for(c=0;cS*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;SC.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;dnew 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;lNumber(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=-1l.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;UD.push(z));return D}P=R.getElementsByTagNameNS("*",U);if(!P||0===P.length)return[];for(R=0;RNumber(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;qh(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;tthis.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;tnull!=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; -1H||!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});BV.x-B.x);const S=this.computeBlockBoundary(y,N,E,q.origin,I,L),O=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&&qC.minRow&&k{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;0Math.abs(x.scale-H) x.scale>H).sort((x,M)=>x.scale>M.scale?1:-1)[0]??G));G=k;0Math.abs(x.scale-C){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)||dthis.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)||dthis.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._prefetches.removeUnordered(H)};H.then(k,k)}}}}_fetchTilemap(d,e,c,k){if(!this.layer.tileInfo.lodAt(d)||dthis.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>5;const p=this._availability;return 0> z||z>p.length?"unknown":p[z]&1<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{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(0C;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;He||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;dI.data.byteLength).reduce((I,K)=>I+K);y=new Uint8Array(d);const N=[];let E=0;for(d=0;dparseFloat(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>>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)});0H.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)&&4this.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(1L||k>N||cS[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;zD;){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(-1I[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)});