1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3558],{2437:(e,t,i)=>{i.d(t,{E9:()=>d,Tw:()=>h,X6:()=>c});var r=i(49033),a=i(98189),s=i(32277),n=i(34880),l=i(87942),o=i(3663),u=i(56536),f=i(70109);async function p(e,t,i){let p=(0,u.Dl)(e),{rasterFunction:h,sourceJSON:c}=t||{},d=h?JSON.stringify(h.rasterFunctionDefinition||h):null,m=(0,u.lF)({...p.query,renderingRule:d,f:"json"}),y=(0,u.jV)(m,i);e=p.path;let g=c||await (0,r.A)(e,y).then(e=>e.data),x=g.hasRasterAttributeTable?(0,r.A)(`${e}/rasterAttributeTable`,y):null,w=g.hasColormap?(0,r.A)(`${e}/colormap`,y):null,v=g.hasHistograms?(0,r.A)(`${e}/histograms`,y):null,I=g.currentVersion>=10.3?(0,r.A)(`${e}/keyProperties`,y):null,b=g.hasMultidimensions?(0,r.A)(`${e}/multidimensionalInfo`,y):null,S=await Promise.allSettled([x,w,v,I,b]),R=null;if(g.minValues&&g.minValues.length===g.bandCount){R=[];for(let e=0;e<g.minValues.length;e++)R.push({min:g.minValues[e],max:g.maxValues[e],avg:g.meanValues[e],stddev:g.stdvValues[e]})}let T=a.A.fromJSON(g.extent),_=Math.ceil(T.width/g.pixelSizeX-.1),A=Math.ceil(T.height/g.pixelSizeY-.1),C=n.A.fromJSON(g.spatialReference||g.extent.spatialReference),M="fulfilled"===S[0].status?S[0].value?.data:null,O=M?.features?.length?f.A.fromJSON(M):null,F="fulfilled"===S[1].status?S[1].value?.data.colormap:null,P=F?.length?F:null,k="fulfilled"===S[2].status?S[2].value?.data.histograms:null,N=k?.[0]?.counts?.length?k:null,D="fulfilled"===S[3].status?S[3].value?.data??{}:{},E="fulfilled"===S[4].status?S[4].value?.data.multidimensionalInfo:null,B=E?.variables?.length?E:null;
1B&&B.variables.forEach(e=>{e.statistics?.length&&e.statistics.forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),e.dimensions?.forEach(e=>{"StdTime"!==e.name||e.recurring||e.unit||(e.unit="ISO8601")})});let{defaultVariable:L,serviceDataType:J}=g;L&&L!==D.DefaultVariable&&(D.DefaultVariable=L),J?.includes("esriImageServiceDataTypeVector")&&!J.includes(D.DataType)&&(D.DataType=J.replace("esriImageServiceDataType",""));let z=g.noDataValue;g.noDataValues?.length&&g.noDataValues.some(e=>e!==z)&&(z=g.noDataValues);let V=g.transposeInfo?new o.A({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new s.A({x:g.extent.xmin,y:g.extent.ymax,spatialReference:C}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(_,A))/Math.LN2-8)),transposeInfo:g.transposeInfo}):void 0;return new l.A({width:_,height:A,bandCount:g.bandCount,extent:a.A.fromJSON(g.extent),spatialReference:C,pixelSize:new s.A({x:g.pixelSizeX,y:g.pixelSizeY,spatialReference:C}),pixelType:g.pixelType.toLowerCase(),statistics:R,attributeTable:O,colormap:P,histograms:N,keyProperties:D,noDataValue:z,multidimensionalInfo:B,storageInfo:V})}function h(e,t,i){return p(e,{sourceJSON:t},i)}
1function c(e,t,i){return p(e,{rasterFunction:t},i)}function d(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}},3558:(e,t,i)=>{i.r(t),i.d(t,{default:()=>eL});var r=i(84533),a=i(24838),s=i(78870),n=i(16682),l=i(82492),o=i(46686),u=i(56098),f=i(58584),p=i(89875),h=i(58961),c=i(2232);i(37779);var d=i(38820),m=i(28040),y=i(69750),g=i(53022),x=i(41138),w=i(15043),v=i(34139),I=i(27133),b=i(38829),S=i(89386),R=i(474),T=i(43837),_=i(42919),A=i(7461),C=i(6991),M=i(17203),O=i(98605),F=i(23556),P=i(45447),k=i(98189),N=i(34880),D=i(48514),E=i(56558),B=i(80407);function L(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function J(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function z(e){let t=(0,D.Z0)();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function V(){return Math.round(255*Math.random())}var j=i(77221),U=i(87942),H=i(56667),Z=i(48673),G=i(50558);let W=class extends F.A{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(e,t,i,r={}){if(!this._pixelBlockTiles){let{rasterInfo:a}=this,[s,n]=a.storageInfo.tileInfo.size,{sliceId:l}=r,{pixelBlocks:o}=this.source,u={pixelBlock:null==l?o[0]:o[l],useBilinear:"thematic"!==a.dataType,tileSize:{width:s,height:n},level:e,row:t,col:i};return Promise.resolve(this.rasterJobHandler?this.rasterJobHandler.clipTile(u,r):(0,Z.J$)(u))}return Promise.resolve(this._pixelBlockTiles.get(`${e}/${t}/${i}`))}async _open(e){let t=this.source,{pixelBlocks:i,attributeTable:r,statistics:a,histograms:s,name:n,nativeExtent:l,transform:o}=t,u=i[0],{width:f,height:p,pixelType:h}=u,c=t.extent??new k.A({xmin:-.5,ymin:.5,xmax:f-.5,ymax:p-.5,spatialReference:new N.A({wkid:3857})}),d=t.isPseudoSpatialReference??!t.extent,m={x:c.width/f,y:c.height/p},y={...t.keyProperties};r&&(y.DataType="Thematic");let g=new U.A({width:f,height:p,pixelType:h,extent:c,nativeExtent:l,attributeTable:r,transform:o,pixelSize:m,spatialReference:c.spatialReference,bandCount:u.pixels.length,keyProperties:y,multidimensionalInfo:t.multidimensionalInfo,statistics:a,isPseudoSpatialReference:d,histograms:s});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(g),this.createRemoteDatasetStorageInfo(g,512,512),this._set("rasterInfo",g),this.updateTileInfo(),g.multidimensionalInfo?await this._buildMDimStats(t.pixelBlocks,g.multidimensionalInfo):await this._buildInMemoryRaster(u,{width:512,height:512},e),g.multidimensionalInfo||(this.source=null),this.datasetName=n}async _buildInMemoryRaster(e,t,i){let{rasterInfo:r}=this,a=r.storageInfo.maximumPyramidLevel??0,s="thematic"!==r.dataType,l=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:a,useBilinear:s},i):Promise.resolve((0,Z.lD)(e,t,a,s)),o=null!=r.statistics,f=null!=r.histograms,p=this.ioConfig.skipStatistics||o?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,G.f4)(e)),h=await (0,u.Lx)([l,p]);if(!h[0].value&&h[1].value)throw new n.A("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=h[0].value,o||(r.statistics=h[1].value?.statistics),f||(r.histograms=h[1].value?.histograms)}async _buildMDimStats(e,t,i){for(let r=0;r<t.variables.length;r++){let a=t.variables[r];if(a.statistics)continue;let s=a.dimensions.map(e=>new j.A({variableName:a.name,dimensionName:e.name,values:[e.values?.[0]??e.extent?.[0]],isSlice:!0})),n=(0,H.NG)(s,t),l=null==n?null:e[n];if(null==l)continue;let o=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:l},i):(0,G.eH)(l);a.statistics=o.statistics,a.histograms||(a.histograms=o.histograms)}}};(0,r._)([(0,p.MZ)({type:String,json:{write:!0}})],W.prototype,"datasetFormat",void 0),(0,r._)([(0,p.MZ)()],W.prototype,"source",void 0),(0,r._)([(0,p.MZ)()],W.prototype,"url",null);let $=W=(0,r._)([(0,d.$)("esri.layers.support.rasterDatasets.InMemoryRaster")],W);var q=i(70109);let X=class extends F.A{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,i,r={}){return this._inMemoryRaster.fetchRawTile(e,t,i,r)}async _open(e){let{extent:t,pixelBlocks:i,multidimensionalInfo:r,attributeTable:a,bandNames:s}=await this._fetchData(e),{statistics:n,histograms:l}=(0,G.eH)(i[0]),o=s?.map(e=>({BandName:e})),u=new $({source:{extent:t,pixelBlocks:i,attributeTable:a?q.A.fromJSON(a):null,multidimensionalInfo:r,statistics:n,histograms:l,keyProperties:{DataType:a?"Thematic":r?"Scientific":"Generic",BandProperties:o},isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;let f=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",f.slice(0,f.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}async _fetchData(e){let t=this.source??(await this.request(this.url,{signal:e?.signal})).data,i="imagery-tile-layer:open-coverage-json";if("coverage"!==t.type?.toLowerCase()||"grid"!==t.domain?.domainType?.toLowerCase())throw new n.A(i,"Only coverage with Grid domain type is supported");if(!t.ranges)throw new n.A(i,"Missing ranges in the grid coverage data");if(!t.domain.referencing?.length)throw new n.A(i,"Missing domain referencing in the grid coverage data");let r=Object.values(t.ranges);for(let e=0;e<r.length;e++){let{axisNames:t,shape:a,type:s,values:l}=r[e];if(!("ndarray"===s.toLowerCase()&&l?.length&&t?.length&&a?.length))throw new n.A(i,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!(L(t[t.length-1])&&J(t[t.length-2])))throw new n.A(i,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return function(e){let{width:t,height:i,extent:r,dimensions:a}=function(e){let{axes:t}=e.domain,i=Object.keys(t),r=[],a=[],s=-1,n=-1,l=[];for(let e=0;e<i.length;e++){let o=i[e];L(o)?s=e:J(o)&&(n=e);let u=t[o],f=[];
1if("values"in u){u.values.forEach(e=>f.push("string"==typeof e?new Date(e).getTime():e));let e=f[1]-f[0];r.push([f[0]-.5*e,f[f.length-1]+.5*e]),a.push(e)}else{let{start:e,stop:t,num:i}=u,s=(t-e)/(i-1);r.push([e-.5*s,t+.5*s]),a.push(s);for(let t=0;t<i;t++)f.push(e+s*t)}l.push({name:o,values:f,extent:[f[0],f[f.length-1]]})}s>-1&&-1===n?n=+(0===s):n>-1&&-1===s?s=+(0===n):-1===n&&-1===s&&(s=0,n=1),l=l.filter((e,t)=>t!==s&&t!==n);let{referencing:o}=e.domain,u=o.find(e=>e.coordinates.includes(i[s])).system.id,f=u?.slice(u.lastIndexOf("/")+1),p=null==f||"CRS84"===f?4326:Number(f),h=new N.A({wkid:p}),[c,d]=r[s],[m,y]=r[n],g=new k.A({xmin:c,xmax:d,ymin:m,ymax:y,spatialReference:h});return{width:Math.round(g.width/a[s]),height:Math.round(g.height/a[n]),extent:g,dimensions:l}}(e),{ranges:s}=e,n=Object.keys(s).sort((e,t)=>e<t?-1:1),l=[];for(let e=0;e<n.length;e++){let t=n[e];a?.length&&l.push({name:t,dimensions:a})}let o=function(e){let t={},{parameters:i}=e;if(!i)return t;for(let[e,r]of Object.entries(i)){let{type:i,description:a,unit:s,categoryEncoding:n,observedProperty:l}=r;if("Parameter"===i&&(t[e]={},a&&(t[e].description=z(a)),s&&(t[e].unit=s.label?z(s.label):null,t[e].symbol=s.symbol?.value),n)){let i=Object.entries(n).map((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1})),r=!1;l?.categories?.length&&(l.categories.forEach(e=>{if(!e.id)return;let t=e.id.slice(e.id.lastIndexOf("/")+1),a=i.find(e=>e.ClassName===t);if(a&&(a.Label=e.label?z(e.label):null,e.preferredColor)){let t=P.A.fromHex(e.preferredColor);t&&(r=!0,a.Red=t.r,a.Green=t.g,a.Blue=t.b)}}),r&&i.forEach(e=>{null==e.Red&&(e.Red=V(),e.Green=V(),e.Blue=V())}));let a={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:i.map(e=>({attributes:e}))};r&&a.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}),t[e].attributeTable=a}}return t}(e);l.forEach(e=>o[e.name]&&Object.assign(e,o[e.name]));let u=l.length?{variables:l}:void 0,f=[];for(let e=0;e<n.length;e++){let{values:r,dataType:l,axisNames:o,shape:u}=s[n[e]],p=u.length>2?e*u.slice(0,-2).reduce((e,t)=>e*t):0,h=o.slice(0,-2),c=u.slice(0,-2),d="float"===l?"f32":function(e){let t=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let r=0;r<e.length;r++){let a=e[r];null!=a&&(a<t&&(t=a),a>i&&(i=a))}return(0,B.X1)(t,i)}(r),m=t*i,y=r.length/m;for(let s=0;s<y;s++){let n=E.A.createEmptyBand(d,m),l=new Uint8Array(m).fill(255),o=!1,u=s*m;for(let e=0;e<m;e++){let t=r[u+e];null==t?(l[e]=0,o=!0):n[e]=t}if(0===e||a?.length){let e=new E.A({width:t,height:i,mask:o?l:null,pixels:[n],pixelType:d});(e.updateStatistics(),a?.length)?f[function(e,t,i){var r;let a=e.map((e,i)=>({name:e,count:t[i]})).sort((e,t)=>e.name>t.name?-1:1),s=(r=1,e=>r*=e.count),n=[...a.slice(1),{name:"",count:1}].reverse().map(s).reverse(),l=0;for(let r=e.length-1;r>=0;r--)l+=n[a.findIndex(({name:t})=>t===e[r])]*(i%t[r]),i=Math.floor(i/t[r]);return l}(h,c,s)+p]=e:f.push(e)}else{let e=f[s];e.pixels.push(n),o?e.mask&&(e.mask=E.A.combineBandMasks([e.mask,l])):e.mask=o?l:null}}}return{extent:r,pixelBlocks:f,multidimensionalInfo:u,attributeTable:Object.values(o).find(e=>e.attributeTable)?.attributeTable,bandNames:u?void 0:n}}(t)}};(0,r._)([(0,p.MZ)({type:String,json:{write:!0}})],X.prototype,"datasetFormat",void 0),(0,r._)([(0,p.MZ)({constructOnly:!0})],X.prototype,"source",void 0);let Y=X=(0,r._)([(0,d.$)("esri.layers.support.rasterDatasets.CovJSONRaster")],X);var K=i(1186),Q=i(28045),ee=i(94783),et=i(54458);function ei(e,t){if(!e||!t)return null;let i=[];for(let r=0;r<e.length;r++)i.push(e[r]),i.push(t[r]);return i}function er(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new N.A({wkid:t});if(e=String(e).trim(),(0,Q.jp)(e))return new N.A({wkt2:e});let i=e.toUpperCase();
1if(i.startsWith("COMPD_CS")){if(!i.includes("VERTCS")||!i.includes("GEOGCS")&&!i.startsWith("PROJCS"))return null;let r=i.indexOf("VERTCS"),a=i.indexOf("PROJCS"),s=a>-1?a:i.indexOf("GEOGCS");if(-1===s)return null;let n=e.slice(s,e.lastIndexOf("]",r)+1).trim(),l=e.slice(r,e.lastIndexOf("]")).trim();t=ea(n);let o=new N.A(t?{wkid:t}:{wkt:n}),u=ea(l);return u&&(o.vcsWkid=u),o}return i.startsWith("GEOGCS")||i.startsWith("PROJCS")?(t=ea(e),new N.A(0!==t?{wkid:t}:{wkt:e})):null}function ea(e){let t=e.replaceAll("]","[").replaceAll('"',"").split("[").map(e=>e.trim()).filter(e=>""!==e),i=t[t.length-1].split(","),r=i[0]?.toLowerCase();if(("epsg"===r||"esri"===r)&&e.endsWith('"]]')){let e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function es(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};let t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach(e=>{if(1===e.nodeType){if((0,ee.g7)(e,"SRS"))t.spatialReference||(t.spatialReference=er((0,ee.mX)(e)));else if((0,ee.g7)(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){let{spatialReference:i,transform:r}=function(e){let t=(0,ee.V6)(e,"GeodataXform"),i=er((0,ee.v7)(t,"SpatialReference/WKID")||(0,ee.mX)(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};let r=(0,ee.v7)(t,"PolynomialOrder")??1,a=(0,ee.Ui)(t,"CoeffX/Double"),s=(0,ee.Ui)(t,"CoeffY/Double"),n=(0,ee.Ui)(t,"InverseCoeffX/Double"),l=(0,ee.Ui)(t,"InverseCoeffY/Double"),o=ei(a,s),u=ei(n,l);return{spatialReference:i,transform:o&&u&&o.length&&u.length?new et.A({spatialReference:i,polynomialOrder:r,forwardCoefficients:o,inverseCoefficients:u}):null}}(e);t.transform=r,t.spatialReference||(t.spatialReference=i)}else(0,ee.IC)(e,"MDI").forEach(e=>t.metadata[e.getAttribute("key")]=(0,ee.mX)(e));else if((0,ee.g7)(e,"PAMRasterBand")){let i=function(e){let t,i,r,a,s=(0,ee.v7)(e,"NoDataValue"),n=(0,ee.V6)(e,"Histograms/HistItem"),l=(0,ee.v7)(n,"HistMin"),o=(0,ee.v7)(n,"HistMax"),u=(0,ee.v7)(n,"BucketCount"),f=(0,ee.mX)(n,"HistCounts")?.split("|").map(e=>Number(e));(0,ee.IC)(e,"Metadata/MDI").forEach(e=>{let s=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":t=s;break;case"STATISTICS_MAXIMUM":i=s;break;case"STATISTICS_MEAN":r=s;break;case"STATISTICS_STDDEV":a=s}});let p=(0,ee.v7)(e,"Metadata/SourceBandIndex");return{noDataValue:s,histogram:f?.length&&null!=l&&null!=o?{min:l,max:o,size:u||f.length,counts:f}:null,sourceBandIndex:p,statistics:null!=t&&null!=i?{min:t,max:i,avg:r,stddev:a}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}}});let i=t.rasterBands;return i.length&&(t.statistics=i[0].statistics?i.map(e=>e.statistics).filter(K.Ru):null,t.histograms=i[0].histogram?i.map(e=>e.histogram).filter(K.Ru):null),t}var en=i(45860);let el=class extends F.A{fetchRawTile(e,t,i,r={}){return this._inMemoryRaster.fetchRawTile(e,t,i,r)}async _open(e){let t=await this._fetchData(e),{spatialReference:i,statistics:r,histograms:a,transform:s}=await this._fetchAuxiliaryData(e),n=!i;n&&(i=new N.A({wkid:3857})),a?.length&&null==r&&(r=(0,G.Pg)(a));let{width:l,height:o}=t,u=new k.A({xmin:-.5,ymin:.5-o,xmax:l-.5,ymax:.5,spatialReference:i}),f=s?s.forwardTransform(u):u;if(s){let e=s.forwardCoefficients;e&&0===e[1]&&0===e[2]&&(s=null,u=f)}let p=new $({source:{extent:f,nativeExtent:u,transform:s,pixelBlocks:[t],statistics:r,histograms:a,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:n},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(p.ioConfig.skipMapInfo=!0),await p.open(),p.source=null,this._set("rasterInfo",p.rasterInfo),this._inMemoryRaster=p}async _fetchData(e){let{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,en.g)(t).toUpperCase();if("JPG"!==i&&"PNG"!==i&&"GIF"!==i&&"BMP"!==i)throw new n.A("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",i);let r=i.toLowerCase(),a="gif"===r||"bmp"===r||!(0,c.A)("ios"),s=await this.decodePixelBlock(t,{format:r,useCanvas:a,hasNoZlibMask:!0});if(null==s)throw new n.A("image-aux-raster:open","the data cannot be decoded");return s}async _fetchAuxiliaryData(e){let t=e?.signal,{skipExtensions:i=[],skipM
1apInfo:r}=this.ioConfig,a=r||i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),s=this.datasetFormat,n="JPG"===s?"jgw":"PNG"===s?"pgw":"BMP"===s?"bpw":null,l=n&&i.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:t}),o=await (0,u.Lx)([a,l]);if(t?.aborted)throw(0,u.NK)();let f=es(o[0].value?.data);if(!f.transform){let e=o[1].value?o[1].value.data.split("\n").slice(0,6).map(e=>Number(e)):null;f.transform=6===e?.length?new et.A({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return f}};(0,r._)([(0,p.MZ)({type:String,json:{write:!0}})],el.prototype,"datasetFormat",void 0);let eo=el=(0,r._)([(0,d.$)("esri.layers.support.rasterDatasets.ImageAuxRaster")],el);var eu=i(18652),ef=i(90986),ep=i(32277),eh=i(3663),ec=i(65647),ed=i(93844),em=i(11163),ey=i(2437);let eg=class extends F.A{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,i,r={}){let{storageInfo:a,extent:s}=this.rasterInfo,{transposeInfo:n}=a,l=null!=n&&!!r.transposedVariableName;if(this._slices&&!l&&null==r.sliceId)return null;let o=l?0:a.maximumPyramidLevel-e+this._levelOffset,u=`${this.url}/tile/${o}/${t}/${i}`,f=this._slices?l?{variable:r.transposedVariableName}:{sliceId:r.sliceId||0}:null,{data:p}=await this.request(u,{query:f,responseType:"array-buffer",signal:r.signal});if(!p)return null;let h=l?n.tileSize:a.tileInfo.size,c=await this.decodePixelBlock(p,{width:h[0],height:h[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:l,noDataValue:this.rasterInfo.noDataValue});if(null==c)return null;let d=a.blockBoundary[e];if("jpg"!==a.compression||i>d.minCol&&i<d.maxCol&&t>d.minRow&&t<d.maxRow)return c;let{origin:m,blockWidth:y,blockHeight:g}=a,{x:x,y:w}=this.getPyramidPixelSize(e),v=Math.round((s.xmin-m.x)/x)%y,I=Math.round((s.xmax-m.x)/x)%y||y,b=Math.round((m.y-s.ymax)/w)%g,S=Math.round((m.y-s.ymin)/w)%g||g,R=i===d.minCol?v:0,T=t===d.minRow?b:0,_=i===d.maxCol?I:y,A=t===d.maxRow?S:g;return(0,Z.z$)(c,{x:R,y:T},{width:_-R,height:A-T}),c}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;for(let t=0;t<this._slices.length;t++){let i=this._slices[t].multidimensionalDefinition;if(i.length===e.length&&!i.some(t=>{let i=e.find(e=>t.variableName===e.variableName&&e.dimensionName===t.dimensionName);return!i||(Array.isArray(t.values[0])?`${t.values[0][0]}-${t.values[0][1]}`:t.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])}))return t}return null}async fetchVariableStatisticsHistograms(e,t){let i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.statistics),r=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.histograms),a=await Promise.all([i,r]);return a[0]&&a[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),a[1]?.[0]?.counts?.length||(a[1]=null),{statistics:a[0]||null,histograms:a[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let r=0,{maximumPyramidLevel:a}=this.rasterInfo.storageInfo,s=a-r+this._levelOffset,n=i.srcLocation;for(;s>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(s,i.row,i.col,t))break}catch{}if(s--,r++,null===(i=this.identifyPixelLocation(n,r,t.datumTransformation)))return null}return -1===s||null==i?null:r}async _open(e){let t,i=e?.signal,r=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:i});r.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let a=r.data;if(this.sourceJSON=a,!a)throw new n.A("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!a.tileInfo)throw new n.A("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=a.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(a.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===a.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=a.name?.slice(a.name.indexOf("/")+1)??"";let s=await this._fetchRasterInfo({signal:i});if(null==s)throw new n.A("image-server-raster:open","cannot initialize image service");(0,ey.E9)(s,a);let l="Map"===this.tileType?function(e,t){if(!e)return null;let{minScale:i,maxScale:r,minLOD:a,maxLOD:s}=t;if(null!=a&&null!=s)return ec.A.fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=a&&e<=s)});if(0!==i&&0!==r){let t=e=>Math.round(1e4*e)/1e4,a=i?t(i):1/0,s=r?t(r):-1/0;return ec.A.fromJSON({...e,lods:e.lods.filter(e=>{let i=t(e.scale);return i<=a&&i>=s})})}return ec.A.fromJSON(e)}(a.tileInfo,a):ec.A.fromJSON(a.tileInfo);(0,eu.Lw)(l);let[o,u]=this._computeMinMaxLOD(s,l),{extent:f,pixelSize:p}=s,h=.5/s.width*p.x,c=Math.max(p.x,p.y),{lods:d}=l;("Map"!==this.tileType&&0!==a.maxScale||Math.abs(p.x-p.y)>h||!d.some(e=>Math.abs(e.resolution-c)<h))&&(p.x=p.y=o.resolution,s.width=Math.ceil((f.xmax-f.xmin)/p.x-.1),s.height=Math.ceil((f.ymax-f.ymin)/p.y-.1));let m=o.level-u.level,[y,g]=l.size,x=[],w=[];d.forEach((e,t)=>{e.level>=u.level&&e.level<=o.level&&x.push({x:e.resolution,y:e.resolution}),t<d.length-1&&w.push(Math.round(10*e.resolution/d[t+1].resolution)/10)}),x.sort((e,t)=>
1e.x-t.x);let v=this.computeBlockBoundary(f,y,g,l.origin,x,m),I=x.length>1?x.slice(1):null;a.transposeInfo&&(t={tileSize:[a.transposeInfo.rows,a.transposeInfo.cols],packetSize:s.keyProperties?._yxs.PacketSize??0});let b=w.length<=1||w.length>=3&&w.slice(0,-1).every(e=>e===w[0])?w[0]??2:Math.round(10/(u.resolution/o.resolution)**(-1/m))/10;if(s.storageInfo=new eh.A({blockWidth:l.size[0],blockHeight:l.size[1],pyramidBlockWidth:l.size[0],pyramidBlockHeight:l.size[1],pyramidResolutions:I,pyramidScalingFactor:b,compression:l.format,origin:l.origin,firstPyramidLevel:1,maximumPyramidLevel:m,tileInfo:l,transposeInfo:t,blockBoundary:v}),function(e){let{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new em.A,e.extent=e.transform.forwardTransform(t))}(s),this._set("rasterInfo",s),a.capabilities.toLowerCase().includes("tilemap")){let e={tileInfo:s.storageInfo.tileInfo,parsedUrl:(0,ef.An)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new ed.d({layer:e})}}async _fetchRasterInfo(e){let t=this.sourceJSON;if("Map"===this.tileType){let e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),r=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),a=N.A.fromJSON(t.spatialReference||e.spatialReference),s=new ep.A({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:a});return new U.A({width:i,height:r,bandCount:3,extent:k.A.fromJSON(e),spatialReference:a,pixelSize:s,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}let{signal:i}=e,r=(0,ey.Tw)(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),a=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then(e=>e.data?.slices).catch(()=>null):null,s=await Promise.all([r,a]);return this._slices=s[1],s[0]}_fixScaleInServiceInfo(){let{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){let{pixelSize:i}=e,r=.5/e.width*i.x,{lods:a}=t,s=t.lodAt(Math.max.apply(null,a.map(e=>e.level))),n=t.lodAt(Math.min.apply(null,a.map(e=>e.level))),{tileType:l}=this;if("Map"===l)return this._levelOffset=a[0].level,[s,n];if("Raster"===l)return[a.find(e=>e.resolution===i.x)??s,n];let{minScale:o,maxScale:u}=this.sourceJSON,f=s;u>0&&((f=a.find(e=>Math.abs(e.scale-u)<r))||(f=a.filter(e=>e.scale>u).sort((e,t)=>e.scale>t.scale?1:-1)[0]??s));let p=n;return o>0&&(p=a.find(e=>Math.abs(e.scale-o)<r)??n,this._levelOffset=p.level-n.level),[f,p]}};(0,r._)([(0,p.MZ)({type:String,json:{write:!0}})],eg.prototype,"datasetFormat",void 0),(0,r._)([(0,p.MZ)()],eg.prototype,"tileType",void 0);let ex=eg=(0,r._)([(0,d.$)("esri.layers.support.rasterDatasets.ImageServerRaster")],eg);var ew=i(17164);let ev=new Map;ev.set("Int8","s8"),ev.set("UInt8","u8"),ev.set("Int16","s16"),ev.set("UInt16","u16"),ev.set("Int32","s32"),ev.set("UInt32","u32"),ev.set("Float32","f32"),ev.set("Float64","f32"),ev.set("Double64","f32");let eI=new Map;eI.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),eI.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),eI.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),eI.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let eb=class extends F.A{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(e,t,i,r={}){let{blockWidth:a,blockHeight:s,blockBoundary:n}=this.rasterInfo.storageInfo,l=n[e];if(!l||l.maxRow<t||l.maxCol<i||l.minRow>t||l.minCol>i)return null;let{bandCount:o,pixelType:u}=this.rasterInfo,{ranges:f,actualTileWidth:p,actualTileHeight:h}=this._getTileLocation(e,t,i);if(!f||0===f.length)return null;if(0===f[0].from&&0===f[0].to){let e=new Uint8Array(a*s);return new E.A({width:a,height:s,pixels:void 0,mask:e,validPixelCount:0})}let{bandIds:c}=this.ioConfig,d=this._getBandSegmentCount(),m=[],y=0;for(y=0;y<d;y++)c&&!c.includes(y)||m.push(this.request(this._files.data,{range:{from:f[y].from,to:f[y].to},responseType:"array-buffer",signal:r.signal}));let g=await Promise.all(m),x=new Uint8Array(g.map(e=>e.data.byteLength).reduce((e,t)=>
1e+t)),w=[],v=0;for(y=0;y<d;y++)w.push(v),x.set(new Uint8Array(g[y].data),v),v+=g[y].data.byteLength;let I=eI.get(this.rasterInfo.storageInfo.compression).decoderFormat,b=await this.decodePixelBlock(x.buffer,{width:a,height:s,format:I,planes:c?.length||o,offsets:w,pixelType:u});if(null==b)return null;let{noDataValue:S}=this.rasterInfo;if(null!=S&&"lerc"!==I&&!b.mask&&null!=(S=S[0])){let e=b.width*b.height,t=new Uint8Array(e);if(Math.abs(S)>1e24)for(y=0;y<e;y++)Math.abs((b.pixels[0][y]-S)/S)>1e-6&&(t[y]=1);else for(y=0;y<e;y++)b.pixels[0][y]!==S&&(t[y]=1);b.mask=t}let R=0,T=0;if(p!==a||h!==s){let e=b.mask;if(e)for(y=0;y<s;y++)if(T=y*a,y<h)for(R=p;R<a;R++)e[T+R]=0;else for(R=0;R<a;R++)e[T+R]=0;else for(b.mask=e=new Uint8Array(a*s),y=0;y<h;y++)for(T=y*a,R=0;R<p;R++)e[T+R]=1}return b}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);let t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:r,files:a}=this._parseHeader(i.data),{skipMapInfo:s,skipExtensions:n=[]}=this.ioConfig;if(!n.includes("aux.xml")&&!s){let t=await this._fetchAuxiliaryData(e);null!=t&&(r.statistics=t.statistics??r.statistics,r.histograms=t.histograms,t.histograms&&null==r.statistics&&(r.statistics=(0,G.Pg)(t.histograms)))}s&&this.updateImageSpaceRasterInfo(r),this._set("rasterInfo",r),this._files=a;let l=await this.request(a.index,{responseType:"array-buffer",signal:t});this._storageIndex=function(e){let t,i,r,a,s,n;if(e.byteLength%16>0)throw Error("invalid array buffer must be multiples of 16");if(ew.Z){for(i=new Uint8Array(e),r=new Uint8Array(a=new ArrayBuffer(e.byteLength)),s=0;s<e.byteLength/4;s++)for(n=0;n<4;n++)r[4*s+n]=i[4*s+3-n];
1t=new Uint32Array(a)}else t=new Uint32Array(e);return t}(l.data);let{blockWidth:o,blockHeight:u}=this.rasterInfo.storageInfo,f=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:p,height:h}=this.rasterInfo,c=[],d=this._getBandSegmentCount(),m=0,y=-1;for(;m<this._storageIndex.length;){y++;let e=Math.ceil(p/o/f**y)-1,t=Math.ceil(h/u/f**y)-1;m+=(e+1)*(t+1)*d*4,c.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=c,y>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=y),this.updateTileInfo()}_getBandSegmentCount(){return eI.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,i){let{blockWidth:r,blockHeight:a,pyramidScalingFactor:s}=this.rasterInfo.storageInfo,{width:n,height:l}=this.rasterInfo,o=this._getBandSegmentCount(),u,f,p,h=0,c=0;for(p=0;p<e;p++)h+=(u=Math.ceil(n/r/(c=s**p)))*(f=Math.ceil(l/a/c));u=Math.ceil(n/r/(c=s**e)),f=Math.ceil(l/a/c),h+=t*u+i,h*=4*o;let d=this._storageIndex.subarray(h,h+4*o),m=0,y=0,g=[];for(let e=0;e<o;e++)y=(m=0x100000000*d[4*e]+d[4*e+1])+0x100000000*d[4*e+2]+d[4*e+3],g.push({from:m,to:y});return{ranges:g,actualTileWidth:i<u-1?r:Math.ceil(n/c)-r*(u-1),actualTileHeight:t<f-1?a:Math.ceil(l/c)-a*(f-1)}}_parseHeader(e){let t,i,r=(0,ee.V6)(e,"MRF_META/Raster");if(!r)throw new n.A("mrf:open","not a valid MRF format");let a=(0,ee.V6)(r,"Size"),s=parseInt(a.getAttribute("x"),10),l=parseInt(a.getAttribute("y"),10),o=parseInt(a.getAttribute("c"),10),u=((0,ee.mX)(r,"Compression")||"none").toLowerCase();if(!eI.has(u))throw new n.A("mrf:open","currently does not support compression "+u);let f=(0,ee.mX)(r,"DataType")||"UInt8",p=ev.get(f);if(null==p)throw new n.A("mrf:open","currently does not support pixel type "+f);let h=(0,ee.V6)(r,"PageSize"),c=parseInt(h.getAttribute("x"),10),d=parseInt(h.getAttribute("y"),10),m=(0,ee.V6)(r,"DataValues");if(m&&null!=(i=m.getAttribute("NoData"))&&(t=i.trim().split(" ").map(e=>parseFloat(e))),(0,ee.V6)(e,"MRF_META/CachedSource"))throw new n.A("mrf:open","currently does not support MRF referencing other data files");let y=(0,ee.V6)(e,"MRF_META/GeoTags"),g=(0,ee.V6)(y,"BoundingBox"),x,w=!1;if(null!=g){let e=parseFloat(g.getAttribute("minx")),t=parseFloat(g.getAttribute("miny")),i=parseFloat(g.getAttribute("maxx")),r=parseFloat(g.getAttribute("maxy")),a=(0,ee.mX)(y,"Projection")||"",s=N.A.WGS84;if("LOCAL_CS[]"!==a)if(a.toLowerCase().startsWith("epsg:")){let e=Number(a.slice(5));isNaN(e)||0===e||(s=new N.A({wkid:e}))}else s=er(a)??N.A.WGS84;else w=!0,s=new N.A({wkid:3857});(x=new k.A(e,t,i,r)).spatialReference=s}else w=!0,x=new k.A({xmin:-.5,ymin:.5-l,xmax:s-.5,ymax:.5,spatialReference:new N.A({wkid:3857})});let v=(0,ee.V6)(e,"MRF_META/Rsets"),I=parseInt(v?.getAttribute("scale")||"2",10),b=x.spatialReference,S=new eh.A({origin:new ep.A({x:x.xmin,y:x.ymax,spatialReference:b}),blockWidth:c,blockHeight:d,pyramidBlockWidth:c,pyramidBlockHeight:d,compression:u,pyramidScalingFactor:I}),R=new ep.A({x:x.width/s,y:x.height/l,spatialReference:b}),T=new U.A({width:s,height:l,extent:x,isPseudoSpatialReference:w,spatialReference:b,bandCount:o,pixelType:p,pixelSize:R,noDataValue:t,storageInfo:S}),_=(0,ee.mX)(e,"datafile"),A=(0,ee.mX)(e,"IndexFile");return{rasterInfo:T,files:{mrf:this.url,index:A||this.url.replace(".mrf",".idx"),data:_||this.url.replace(".mrf",eI.get(u).blobExtension)}}}async _fetchAuxiliaryData(e){try{let{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return es(t)}catch{return null}}};(0,r._)([(0,p.MZ)()],eb.prototype,"_files",void 0),(0,r._)([(0,p.MZ)()],eb.prototype,"_storageIndex",void 0),(0,r._)([(0,p.MZ)({type:String,json:{write:!0}})],eb.prototype,"datasetFormat",void 0);let eS=eb=(0,r._)([(0,d.$)("esri.layers.support.rasterDatasets.MRFRaster")],eb);var eR=i(34019);class eT{static get supportedVersions(){return[5]}static parse(e){let t,i=new DataView(e),r=3&i.getUint8(0);if(3!==r)return{header:{version:r},recordSet:null};let a=i.getUint32(4,!0),s=i.getUint16(8,!0),n=i.getUint16(10,!0),l=32,o=[],u=[];
1if(3===r){for(;13!==i.getUint8(l);)t=String.fromCharCode(i.getUint8(l+11)).trim(),o.push({name:(0,eR.w)(new Uint8Array(e,l,11)),type:t,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(t)],length:i.getUint8(l+16)}),l+=32;if(l+=1,o.length>0)for(;u.length<a&&e.byteLength-l>n;){let t=[];32===i.getUint8(l)?(l+=1,o.forEach(i=>{if("C"===i.type)t.push((0,eR.w)(new Uint8Array(e,l,i.length)).trim());else if("N"===i.type)t.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,l,i.length)).trim(),10));else if("F"===i.type)t.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,l,i.length)).trim()));else if("D"===i.type){let r=String.fromCharCode.apply(null,new Uint8Array(e,l,i.length)).trim();t.push(new Date(parseInt(r.slice(0,4),10),parseInt(r.slice(4,6),10)-1,parseInt(r.slice(6,8),10)))}l+=i.length}),u.push(t)):l+=n}}return{header:{version:r,recordCount:a,headerByteCount:s,recordByteCount:n},fields:o,records:u,recordSet:function(e){let t=e.fields,i=e.records,r=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",a=[{name:r,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),s=a.map(e=>e.name),n=[],l=0,o=0;return i.forEach(e=>{let t={};for(t[r]=l++,o=1;o<s.length;o++)t[s[o]]=e[o-1];n.push({attributes:t})}),{displayFieldName:"",fields:a,features:n}}({fields:o,records:u})}}}var e_=i(86904),eA=i(11121);let eC=(e,t)=>e.get(t)?.values,eM=(e,t)=>e.get(t)?.values?.[0],eO=class extends F.A{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async fetchRawTile(e,t,i,r={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;let a=await this._fetchRawTiffTile(e,t,i,!1,r);if(null!=a&&this._headerInfo.hasMaskBand){let s=await this._fetchRawTiffTile(e,t,i,!0,r);null!=s&&s.pixels[0]instanceof Uint8Array&&(a.mask=s.pixels[0])}return a}async _open(e){let t=e?e.signal:null,{data:i}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!i)throw new n.A("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));let{littleEndian:r,firstIFDPos:a,isBigTiff:s}=(0,e_.uT)(i),o=[];await this._readIFDs(o,i,r,a,0,s?8:4,t);let{imageInfo:u,rasterInfo:f}=function(e){let t=(0,e_.uc)(e),{width:i,height:r,tileWidth:a,tileHeight:s,planes:n,pixelType:l,compression:o,firstPyramidLevel:u,maximumPyramidLevel:f,pyramidBlockWidth:p,pyramidBlockHeight:h,pyramidResolutions:c,tileBoundary:d,affine:m,metadata:y}=t,g=er(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),x=!!t.isPseudoGeographic;null==g&&(x=!0,g=new N.A({wkid:3857}));let w=new k.A({...t.extent,spatialReference:g}),v=new ep.A(w?{x:w.xmin,y:w.ymax,spatialReference:g}:{x:0,y:0}),I=new eh.A({blockWidth:a,blockHeight:s,pyramidBlockWidth:p,pyramidBlockHeight:h,compression:o,origin:v,firstPyramidLevel:u,maximumPyramidLevel:f,pyramidResolutions:c,blockBoundary:d}),b=new ep.A({x:(w.xmax-w.xmin)/i,y:(w.ymax-w.ymin)/r,spatialReference:g}),S=y?{BandProperties:y.bandProperties,DataType:y.dataType}:{},R=null,T=eM(e[0],"PHOTOMETRICINTERPRETATION"),_=eC(e[0],"COLORMAP");if(T<=3&&_?.length>3&&_.length%3==0){R=[];let e=_.length/3;for(let t=0;t<e;t++)R.push([t,_[t]>>>8,_[t+e]>>>8,_[t+2*e]>>>8])}let A=new U.A({width:i,height:r,bandCount:n,pixelType:l,pixelSize:b,storageInfo:I,spatialReference:g,isPseudoSpatialReference:x,keyProperties:S,extent:w,colormap:R,statistics:y?y.statistics:null});if(m?.length&&(A.nativeExtent=new k.A({xmin:-.5,ymin:.5-r,xmax:i-.5,ymax:.5,spatialReference:g}),A.transform=new et.A({polynomialOrder:1,forwardCoefficients:[m[2]+m[0]/2,m[5]-m[3]/2,m[0],m[3],-m[1],-m[4]]}),A.extent=A.transform.forwardTransform(A.nativeExtent),A.pixelSize=new ep.A({x:(w.xmax-w.xmin)/i,y:(w.ymax-w.ymin)/r,spatialReference:g}),I.origin.x=-.5,I.origin.y=.5),c){let{x:e,y:t}=A.pixelSize;c.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:A}}(o),p=(0,e_.zS)(o),h=(0,e_.r9)(o);if(this._headerInfo={littleEndian:r,isBigTiff:s,ifds:o,pyramidIFDs:p,maskIFDs:h,...u}
1,this._set("rasterInfo",f),!u.isSupported)throw new n.A("tiffraster:open","this tiff is not supported: "+u.message);if(!u.tileWidth)throw new n.A("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");f.isPseudoSpatialReference&&l.A.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");let c=o[0].get("PREDICTOR")?.values?.[0];if(3===o[0].get("SAMPLEFORMAT")?.values?.[0]&&2===c)throw new n.A("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");let{skipMapInfo:d,skipExtensions:m=[]}=this.ioConfig;if(!m.includes("aux.xml")&&!d){let t=await this._fetchAuxiliaryMetaData(e);null!=t&&function(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,G.Pg)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;let i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new ep.A({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}(t,f)}m.includes("vat.dbf")||1!==f.bandCount||"u8"!==f.pixelType||d||(f.attributeTable=await this._fetchAuxiliaryTable(e),null!=f.attributeTable&&(f.keyProperties.DataType="thematic")),d&&this.updateImageSpaceRasterInfo(f),this.updateTileInfo()}async _readIFDs(e,t,i,r,a,s=4,n){if(!r)return null;(r>=t.byteLength||r<0)&&(t=(await this.request(this.url,{range:{from:r+a,to:r+a+this._bufferSize},responseType:"array-buffer",signal:n})).data,a=r+a,r=0);let l=await this._readIFD(t,i,r,a,eA.A.tiffTags,s,n);if(e.push(l.ifd),!l.nextIFD)return null;await this._readIFDs(e,t,i,l.nextIFD-a,a,s,n)}async _readIFD(e,t,i,r,a=eA.A.tiffTags,s=4,n){if(!e)return null;let l=(0,e_.JM)(e,t,i,r,a,s);if(l.success){let i=[];if(l.ifd?.forEach(e=>{e.values||i.push(e)}),i.length>0){let a=i.map(e=>e.offlineOffsetSize).filter(K.Ru),s=Math.min.apply(null,a.map(e=>e[0]));if(Math.min.apply(null,a.map(e=>e[0]+e[1]))-s<=this._bufferSize){let{data:a}=await this.request(this.url,{range:{from:s,to:s+this._bufferSize},responseType:"array-buffer",signal:n});e=a,r=s,i.forEach(i=>(0,e_.Cr)(e,t,i,r))}}if(l.ifd?.has("GEOKEYDIRECTORY")){let i=l.ifd.get("GEOKEYDIRECTORY"),a=i?.values;if(a&&a.length>4){let s=a[0]+"."+a[1]+"."+a[2],l=await this._readIFD(e,t,i.valueOffset+6-r,r,eA.A.geoKeys,2,n);i.data=l.ifd,i.data&&i.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[s]})}}return l}if(l.requiredBufferSize&&l.requiredBufferSize!==e.byteLength)return(e=(await this.request(this.url,{range:{from:r,to:r+l.requiredBufferSize+4},responseType:"array-buffer",signal:n})).data).byteLength<l.requiredBufferSize?null:this._readIFD(e,t,0,r,eA.A.tiffTags,4,n)}async _fetchRawTiffTile(e,t,i,r,a={}){let s,n,l,o=this._getTileLocation(e,t,i,r);if(!o)return null;let{ranges:u,actualTileWidth:f,actualTileHeight:p,ifd:h}=o,c=u.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:a.signal})),d=await Promise.all(c),m=d.map(e=>e.data.byteLength).reduce((e,t)=>e+t),y=1===d.length?d[0].data:new ArrayBuffer(m),g=[0],x=[0];if(d.length>1){let e=new Uint8Array(y);for(let t=0,i=0;t<d.length;t++){let r=d[t].data;e.set(new Uint8Array(r),i),g[t]=i,i+=r.byteLength,x[t]=r.byteLength}}let{blockWidth:w,blockHeight:v}=this.getBlockWidthHeight(e),I=await this.decodePixelBlock(y,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:h,offsets:g,sizes:x},width:w,height:v,planes:null,pixelType:null});if(null==I)return null;if(f!==w||p!==v){let e=I.mask;if(e)for(s=0;s<v;s++)if(l=s*w,s<p)for(n=f;n<w;n++)e[l+n]=0;else for(n=0;n<w;n++)e[l+n]=0;else for(I.mask=e=new Uint8Array(w*v),s=0;s<p;s++)for(l=s*w,n=0;n<f;n++)e[l+n]=1}return I}_getTileLocation(e,t,i,r=!1){let{firstPyramidLevel:a,blockBoundary:s}=this.rasterInfo.storageInfo,n=0===e?0:e-(a-1),{_headerInfo:l}=this;if(!l)return null;let o=r?l.maskIFDs[n]:0===n?l?.ifds[0]:l?.pyramidIFDs[n-1];if(!o)return null;let u=(0,e_.XO)(o,l),f=eC(o,"TILEOFFSETS");if(void 0===f)return null;let p=eC(o,"TILEBYTECOUNTS"),{minRow:h,minCol:c,maxRow:d,maxCol:m}=s[n];if(t>d||i>m||t<h||i<c)return null;let y=eM(o,"IMAGEWIDTH"),g=eM(o,"IMAGELENGTH"),x=eM(o,"TILEWIDTH"),w=eM(o,"TILELENGTH"),v=[];
1if(u){let{bandCount:e}=this.rasterInfo;for(let r=0;r<e;r++){let e=r*(d+1)*(m+1)+t*(m+1)+i;v[r]={from:f[e],to:f[e]+p[e]-1}}}else{let e=t*(m+1)+i;v.push({from:f[e],to:f[e]+p[e]-1})}for(let e=0;e<v.length;e++)if(null==v[e].from||!v[e].to||v[e].to<0)return null;return{ranges:v,ifd:o,actualTileWidth:i===m&&y%x||x,actualTileHeight:t===d&&g%w||w}}async _fetchAuxiliaryMetaData(e){try{let{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return es(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{let{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=eT.parse(t);return i?.recordSet?q.A.fromJSON(i.recordSet):null}catch{return null}}};(0,r._)([(0,p.MZ)()],eO.prototype,"_files",void 0),(0,r._)([(0,p.MZ)()],eO.prototype,"_headerInfo",void 0),(0,r._)([(0,p.MZ)()],eO.prototype,"_bufferSize",void 0),(0,r._)([(0,p.MZ)({type:String,json:{write:!0}})],eO.prototype,"datasetFormat",void 0);let eF=eO=(0,r._)([(0,d.$)("esri.layers.support.rasterDatasets.TIFFRaster")],eO),eP=new Map;eP.set("MRF",{desc:"Meta Raster Format",constructor:eS}),eP.set("TIFF",{desc:"GeoTIFF",constructor:eF}),eP.set("RasterTileServer",{desc:"Raster Tile Server",constructor:ex}),eP.set("JPG",{desc:"JPG Raster Format",constructor:eo}),eP.set("PNG",{desc:"PNG Raster Format",constructor:eo}),eP.set("GIF",{desc:"GIF Raster Format",constructor:eo}),eP.set("BMP",{desc:"BMP Raster Format",constructor:eo}),eP.set("CovJSON",{desc:"COVJSON Raster Format",constructor:Y}),eP.set("MEMORY",{desc:"In Memory Raster Format",constructor:$});class ek{static get supportedFormats(){let e=new Set;return eP.forEach((t,i)=>e.add(i)),e}static async open(e){let{url:t,ioConfig:i,source:r,sourceJSON:a}=e,s=e.datasetFormat??i?.datasetFormat;null==s&&(t.includes(".")?s=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===r?.type?.toLowerCase()?s="CovJSON":r?.extent&&r.pixelblocks&&(s="MEMORY")),"OVR"===s||"TIF"===s?s="TIFF":"JPG"===s||"JPEG"===s||"JFIF"===s?s="JPG":"COVJSON"===s&&(s="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(s="RasterTileServer");let l={url:t,source:r,sourceJSON:a,datasetFormat:s,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(l).forEach(e=>{null==l[e]&&delete l[e]}),s){if(!this.supportedFormats.has(s))throw new n.A("rasterfactory:open","not a supported format "+s);if("CRF"===s)throw new n.A("rasterfactory:open",`cannot open raster: ${t}`);let i=new(0,eP.get(s).constructor)(l);return await i.open({signal:e.signal}),i}let o=Array.from(eP.keys()).filter(e=>"CovJSON"!==e&&"Memory"!==e),u=0,f=()=>{if(!(s=o[u++])||"CRF"===s)return null;let t=new(0,eP.get(s).constructor)(l);return t.open({signal:e.signal}).then(()=>t).catch(()=>f())};return f()}static register(e,t,i){eP.has(e.toUpperCase())||eP.set(e.toUpperCase(),{desc:t,constructor:i})}}var eN=i(73583),eD=i(92483),eE=i(51617);let eB=class extends(0,g.dM)((0,R.j)((0,v.q)((0,I.A)((0,b.H)((0,x.d)((0,w.o)((0,T.e)((0,y.b)((0,S.J)((0,o.P)(s.A.ClonableMixin(m.A)))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=(0,u.sg)(async(e,t,r)=>{let{save:a,saveAs:s}=await i.e(98754).then(i.bind(i,98754));switch(e){case eE.X.SAVE:return a(this,t);case eE.X.SAVE_AS:return s(this,r,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){let t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(u.QP).then(()=>this._openRaster(t))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){let e=[(0,C.rZ)("Pixel Value"),(0,C.dy)("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,i=t?.attributeTable;if(i){let t=(0,C.jC)(i);e.push(...t)}let r=t?.dataType,a=t?.multidimensionalInfo;if(("vector-magdir"===r||"vector-uv"===r)&&null!=a){let t=a.variables[0].unit?.trim(),i=(0,C.DV)(t),r=(0,C.y6)();e.push(i,r)}if(a){let t=(0,C.AL)(a);e.push(...t)}return e}createPopupTemplate(e){let{rasterFields:t}=this,i=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==C.F_.rawServicePixelValue)),r=(0,eD.tn)({fields:t,title:this.title},{...e,visibleFieldNames:i}),{rasterInfo:a}=this.raster;return r?.fieldInfos&&a&&(0,C.h4)(r.fieldInfos,a),r}async generateRasterInfo(e,t){if(e=(0,h.PZ)(M.A,e),await this.load(),!e||"none"===e.functionName?.toLowerCase())return this.serviceRasterInfo;try{let{rasterInfo:i}=await this._openFunctionRaster(e,t);return i}catch(e){if(e instanceof n.A)throw e;throw new n.A("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(eE.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(eE.X.SAVE_AS,t,e)}write(e,t){let 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(e,t);if(t?.messages){let e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new n.A("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),(t="Function"===this.raster.datasetFormat)||!this.rasterFu
1nction||(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{let{url:t,rasterFunction:i,source:r}=this;if(!t&&!r)throw new n.A("imagery-tile-layer:open","missing url or source parameter");r?await this._openFromSource(r,e):i?await this._openFromUrlWithRasterFunction(t,i,e):await this._openFromUrl(t,e)}let i=this.raster.rasterInfo;if(!i)throw new n.A("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){let e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else 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((0,f.wB)(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters="Function"===e.datasetFormat?e.primaryRasters.rasters:[e],this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,t,i){let r=[e];t&&(0,eN.UD)(t.toJSON(),r);let a=await Promise.all(r.map(e=>ek.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:i}))),s=a.findIndex(e=>null==e);if(s>-1)throw new n.A("imagery-tile-layer:open",`cannot open raster: ${r[s]}`);return this._primaryRasters=a,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){let i=await ek.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==i)throw new n.A("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[i],this.raster=i}async _openFromSource(e,t){let i="the tiled imagery data source is not supported",r="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!r)throw new n.A("imagery-tile-layer:open",i);"MEMORY"===r&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});let a=await ek.open({url:"",source:e,datasetFormat:r,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==a)throw new n.A("imagery-tile-layer:open",i);this._primaryRasters=[a],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=a}async _openFunctionRaster(e,t){let i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>i[e.url]=e);let r=(0,eN.vt)(e.functionDefinition?.toJSON()??e.toJSON(),i),a=new O.A({rasterFunction:r});return await a.open(t),a}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(e){e instanceof n.A&&l.A.getLogger(this).error("imagery-tile-layer:open",e.message),l.A.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]}}};(0,r._)([(0,p.MZ)({clonable:!1})],eB.prototype,"_primaryRasters",void 0),(0,r._)([(0,p.MZ)(_.fV)],eB.prototype,"legendEnabled",void 0),(0,r._)([(0,p.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],eB.prototype,"isReference",void 0),(0,r._)([(0,p.MZ)({type:["show","hide"]})],eB.prototype,"listMode",void 0),(0,r._)([(0,p.MZ)({json:{read:!0,write:!0}})],eB.prototype,"blendMode",void 0),(0,r._)([(0,p.MZ)({type:M.A,json:{name:"renderingRule",write:!0}})],eB.prototype,"rasterFunction",void 0),(0,r._)([(0,p.MZ)()],eB.prototype,"sourceJSON",void 0),(0,r._)([(0,p.MZ)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],eB.prototype,"version",void 0),(0,r._)([(0,p.MZ)({readOnly:!0,json:{read:!1}})],eB.prototype,"type",void 0),(0,r._)([(0,p.MZ)({type:["ArcGISTiledImageServiceLayer"]})],eB.prototype,"operationalLayerType",void 0),(0,r._)([(0,p.MZ)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],eB.prototype,"popupEnabled",void 0),(0,r._)([(0,p.MZ)({type:a.A,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],eB.prototype,"popupTemplate",void 0),(0,r._)([(0,p.MZ)({readOnly:!0})],eB.prototype,"defaultPopupTemplate",null),(0,r._)([(0,p.MZ)({readOnly:!0,t
1ype:[A.A]})],eB.prototype,"fields",void 0),(0,r._)([(0,p.MZ)({readOnly:!0,type:[A.A]})],eB.prototype,"rasterFields",null),(0,r._)([(0,p.MZ)({constructOnly:!0})],eB.prototype,"source",void 0);let eL=eB=(0,r._)([(0,d.$)("esri.layers.ImageryTileLayer")],eB)},7184:(e,t,i)=>{i.d(t,{A:()=>o});var r=i(84533),a=i(51024),s=i(89875);i(2232),i(82492),i(37779);var n=i(38820);let l=class extends a.A{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};(0,r._)([(0,s.MZ)()],l.prototype,"affectsPixelSize",null),(0,r._)([(0,s.MZ)({json:{write:!0}})],l.prototype,"spatialReference",void 0);let o=l=(0,r._)([(0,n.$)("esri.layers.support.rasterTransforms.BaseRasterTransform")],l)},11163:(e,t,i)=>{i.d(t,{A:()=>f});var r,a=i(84533),s=i(89875);i(2232),i(82492),i(37779);var n=i(8857),l=i(38820),o=i(7184);let u=r=class extends o.A{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(e){return"point"===(e=e.clone()).type?e.x>180+this.tolerance&&(e.x-=360):e.xmin>=180-this.tolerance?(e.xmax-=360,e.xmin-=360):e.xmax>180+this.tolerance&&(e.xmin=-180,e.xmax=180),e}inverseTransform(e){return"point"===(e=e.clone()).type?e.x<-this.tolerance&&(e.x+=360):e.xmin<-this.tolerance&&(e.xmin+=360,e.xmax+=360),e}clone(){return new r({tolerance:this.tolerance})}};(0,a._)([(0,n.e)({GCSShiftXform:"gcs-shift"})],u.prototype,"type",void 0),(0,a._)([(0,s.MZ)()],u.prototype,"tolerance",void 0);let f=u=r=(0,a._)([(0,l.$)("esri.layers.support.rasterTransforms.GCSShiftTransform")],u)},38829:(e,t,i)=>{i.d(t,{H:()=>c});var r=i(84533),a=i(89875);i(2232),i(82492),i(37779);var s=i(38820),n=i(78870),l=i(51024),o=i(58961),u=i(8857),f=i(65489);let p=class extends n.A.ClonableMixin(l.A){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};(0,r._)([(0,a.MZ)({type:String,json:{write:{isRequired:!0}}})],p.prototype,"name",void 0),(0,r._)([(0,a.MZ)({type:["raster-function-template","variable","none"],json:{write:{isRequired:!0}}}),(0,u.e)({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],p.prototype,"method",void 0),(0,r._)([(0,a.MZ)({type:String,json:{write:{isRequired:!0}}})],p.prototype,"value",void 0),(0,r._)([(0,a.MZ)({type:[o.jz],json:{write:{isRequired:!0}}})],p.prototype,"bandIds",void 0),(0,r._)([(0,a.MZ)({types:f.uy,json:{write:!0,origins:{"web-scene":{types:f.Gj,write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],p.prototype,"renderer",void 0);let h=p=(0,r._)([(0,s.$)("esri.renderers.support.RasterPresetRenderer")],p),c=e=>{let t=class extends e{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return(0,r._)([(0,a.MZ)({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],t.prototype,"activePresetRendererName",void 0),(0,r._)([(0,a.MZ)({type:[h],json:{name:"layerDefinition.presetRenderers",write:!0}})],t.prototype,"presetRenderers",void 0),t=(0,r._)([(0,s.$)("esri.layers.mixins.RasterPresetRendererMixin")],t)}},54458:(e,t,i)=>{i.d(t,{A:()=>y});var r,a=i(84533),s=i(89875);i(2232),i(82492),i(37779);var n=i(8857),l=i(31309),o=i(38820),u=i(80129),f=i(98189),p=i(32277),h=i(7184);function c(e,t,i){let{x:r,y:a}=t;if(i<2)return{x:e[0]+r*e[2]+a*e[4],y:e[1]+r*e[3]+a*e[5]};if(2===i){let t=r*r,i=a*a,s=r*a;return{x:e[0]+r*e[2]+a*e[4]+t*e[6]+s*e[8]+i*e[10],y:e[1]+r*e[3]+a*e[5]+t*e[7]+s*e[9]+i*e[11]}}let s=r*r,n=a*a,l=r*a,o=s*r,u=s*a,f=r*n,p=a*n;return{x:e[0]+r*e[2]+a*e[4]+s*e[6]+l*e[8]+n*e[10]+o*e[12]+u*e[14]+f*e[16]+p*e[18],y:e[1]+r*e[3]+a*e[5]+s*e[7]+l*e[9]+n*e[11]+o*e[13]+u*e[15]+f*e[17]+p*e[19]}}function d(e,t,i){let{xmin:r,ymin:a,xmax:s,ymax:n,spatialReference:l}=t,o=[];if(i<2)o.push({x:r,y:n}),o.push({x:s,y:n}),o.push({x:r,y:a}),o.push({x:s,y:a});else{let e=10;for(let t=0;t<e;t++)o.push({x:r,y:a+(n-a)*t/(e-1)}),o.push({x:s,y:a+(n-a)*t/(e-1)});e=8;for(let t=1;t<=e;t++)o.push({x:r+(s-r)*t/e,y:a}),o.push({x:r+(s-r)*t/e,y:n})}let u=(o=o.map(t=>c(e,t,i))).map(e=>e.x),p=o.map(e=>e.y);return new f.A({xmin:Math.min.apply(null,u),xmax:Math.max.apply(null,u),ymin:Math.min.apply(null,p),ymax:Math.max.apply(null,p),spatialReference:l})}let m=r=class extends h.A{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}
1readForwardCoefficients(e,t){let{coeffX:i,coeffY:r}=t;if(!i?.length||!r?.length||i.length!==r.length)return null;let a=[];for(let e=0;e<i.length;e++)a.push(i[e]),a.push(r[e]);return a}writeForwardCoefficients(e,t,i){let r=[],a=[];for(let t=0;t<e?.length;t++)t%2==0?r.push(e[t]):a.push(e[t]);t.coeffX=r,t.coeffY=a}get inverseCoefficients(){let e=this._get("inverseCoefficients"),t=this._get("forwardCoefficients");return!e&&t&&this.polynomialOrder<2&&(e=function(e){let[t,i,r,a,s,n]=e,l=r*n-s*a,o=s*a-r*n;return[(s*i-t*n)/l,(r*i-t*a)/o,n/l,a/o,-s/l,-r/o]}(t)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,t){let{inverseCoeffX:i,inverseCoeffY:r}=t;if(!i?.length||!r?.length||i.length!==r.length)return null;let a=[];for(let e=0;e<i.length;e++)a.push(i[e]),a.push(r[e]);return a}writeInverseCoefficients(e,t,i){let r=[],a=[];for(let t=0;t<e?.length;t++)t%2==0?r.push(e[t]):a.push(e[t]);t.inverseCoeffX=r,t.inverseCoeffY=a}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){let t=c(this.forwardCoefficients,e,this.polynomialOrder);return new p.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return d(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){let t=c(this.inverseCoefficients,e,this.polynomialOrder);return new p.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return d(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new r({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,a._)([(0,s.MZ)({json:{write:!0}})],m.prototype,"polynomialOrder",void 0),(0,a._)([(0,s.MZ)()],m.prototype,"forwardCoefficients",void 0),(0,a._)([(0,l.w)("forwardCoefficients",["coeffX","coeffY"])],m.prototype,"readForwardCoefficients",null),(0,a._)([(0,u.K)("forwardCoefficients")],m.prototype,"writeForwardCoefficients",null),(0,a._)([(0,s.MZ)({json:{write:!0}})],m.prototype,"inverseCoefficients",null),(0,a._)([(0,l.w)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],m.prototype,"readInverseCoefficients",null),(0,a._)([(0,u.K)("inverseCoefficients")],m.prototype,"writeInverseCoefficients",null),(0,a._)([(0,s.MZ)()],m.prototype,"affectsPixelSize",null),(0,a._)([(0,n.e)({PolynomialXform:"polynomial"})],m.prototype,"type",void 0);let y=m=r=(0,a._)([(0,o.$)("esri.layers.support.rasterTransforms.PolynomialTransform")],m)}}]); 2//# sourceMappingURL=3558.6634331a7411c55e.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.