import{ax as _t,s as pe,g$ as ur,h0 as cr,_ as hr,eQ as fr,$ as $e,A as D,B as N,C as Oe,a6 as De,a8 as dr,a9 as pr,aH as mr,bb as Q,ab as Ct,f as gr,a1 as jt,jZ as yr,ey as bt,z as wt}from"./index-b5c8f851.js";import{c as ht,u as te,o as Se,h as Cr,i as Je,j as br,k as vt,n as Re}from"./dataUtils-c2b057a0.js";import{A as St,z as _e,j as Tt,y as wr}from"./colorUtils-23771bca.js";var qe,kt,It,et={exports:{}};et.exports,kt=et,qe=function(){function e(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return e.prototype={ensureBuffer:function(t){var r=this.buffer,o=r?r.byteLength:0;if(tu&&(o=u)}else{for(;!this.eof;)this.readBlock();o=this.bufferLength}return this.pos=o,this.buffer.subarray(r,o)},lookChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(t,r,o){for(var u=t+r;this.bufferLength<=u&&!this.eof;)this.readBlock();return new Stream(this.buffer,t,r,o)},skip:function(t){t||(t=1),this.pos+=t},reset:function(){this.pos=0}},e}(),(It=function(){if(!self||!self.Uint32Array)return null;var e=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),t=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]),r=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]),o=[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],u=[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];function a(n){throw new Error(n)}function f(n){var i=0,l=n[i++],s=n[i++];l!=-1&&s!=-1||a("Invalid header in flate stream"),(15&l)!=8&&a("Unknown compression method in flate stream"),((l<<8)+s)%31!=0&&a("Bad FCHECK in flate stream"),32&s&&a("FDICT bit set in flate stream"),this.bytes=n,this.bytesPos=i,this.codeSize=0,this.codeBuf=0,qe.call(this)}return f.prototype=Object.create(qe.prototype),f.prototype.getBits=function(n){for(var i,l=this.codeSize,s=this.codeBuf,c=this.bytes,d=this.bytesPos;l>n,this.codeSize=l-=n,this.bytesPos=d,i},f.prototype.getCode=function(n){for(var i=n[0],l=n[1],s=this.codeSize,c=this.codeBuf,d=this.bytes,C=this.bytesPos;s>16,h=65535&b;return(s==0||s>S,this.codeSize=s-S,this.bytesPos=C,h},f.prototype.generateHuffmanTable=function(n){for(var i=n.length,l=0,s=0;sl&&(l=n[s]);for(var c=1<>=1;for(s=h;s0;)W[b++]=j}var i=this.getBits(3);if(1&i&&(this.eof=!0),(i>>=1)!=0){var l,s;if(i==1)l=o,s=u;else if(i==2){for(var c=this.getBits(5)+257,d=this.getBits(5)+1,C=this.getBits(4)+4,g=Array(e.length),b=0;b=w&&(w=(R=this.ensureBuffer(k+1)).length),R[k++]=v;else{if(v==256)return void(this.bufferLength=k);var I=(v=t[v-=257])>>16;I>0&&(I=this.getBits(I)),h=(65535&v)+I,v=this.getCode(s),(I=(v=r[v])>>16)>0&&(I=this.getBits(I));var T=(65535&v)+I;k+h>=w&&(w=(R=this.ensureBuffer(k+h)).length);for(var A=0;A{let s=null;f==="jpg"&&n&&(s=zt._getMask(t,{width:u,height:a}));const c=new Blob([new Uint8Array(t)],{type:"image/"+f=="jpg"?"jpeg":f}),d=URL.createObjectURL(c),C=new Image;let g;C.src=d,C.onload=()=>{if(URL.revokeObjectURL(d),ur(o))return void l(cr());u=C.width,a=C.height,this._canvas&&this._ctx?(this._canvas.width===u&&this._canvas.height===a||(this._canvas.width=u,this._canvas.height=a),this._ctx.clearRect(0,0,u,a)):(this._canvas=document.createElement("canvas"),this._canvas.width=u,this._canvas.height=a,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(C,0,0);const b=this._ctx.getImageData(0,0,u,a);let S;if(g=b.data,r.renderOnCanvas){if(s)for(S=0;S{URL.revokeObjectURL(d),l("cannot load image")}})}static _getMask(t,r){let o=null;try{const u=new Uint8Array(t),a=Math.ceil(u.length/2);let f=0;const n=u.length-2;for(f=a;f=0;c--)o[l++]=i[s]>>c&1}}catch{}return o}};var xt,At,Et,tt={exports:{}};tt.exports,xt=tt,At=function(){var e=function(){function t(r){this.message="JPEG error: "+r}return t.prototype=new Error,t.prototype.name="JpegError",t.constructor=t,t}();return function(){if(!self||!self.Uint8ClampedArray)return null;var t=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=4017,o=799,u=3406,a=2276,f=1567,n=3784,i=5793,l=2896;function s(){this.decodeTransform=null,this.colorTransform=-1}function c(h,p){for(var m,y,w=0,k=[],v=16;v>0&&!h[v-1];)v--;k.push({children:[],index:0});var I,T=k[0];for(m=0;m0;)T=k.pop();for(T.index++,k.push(T);k.length<=m;)k.push(I={children:[],index:0}),T.children[T.index]=I.children,T=I;w++}m+10)return O--,P>>O&1;if((P=h[p++])===255){var U=h[p++];if(U)throw new e("unexpected marker "+(P<<8|U).toString(16))}return O=7,P>>>7}function B(U){for(var z=U;;){if(typeof(z=z[L()])=="number")return z;if(typeof z!="object")throw new e("invalid huffman sequence")}}function R(U){for(var z=0;U>0;)z=z<<1|L(),U--;return z}function _(U){if(U===1)return L()===1?1:-1;var z=R(U);return z>=1<>4;if(X!==0){var lr=t[re+=ne];U.blockData[z+lr]=_(X),re++}else{if(ne<15)break;re+=16}}}function M(U,z){var H=B(U.huffmanTableDC),Y=H===0?0:_(H)<0)$--;else for(var H=k,Y=v;H<=Y;){var re=B(U.huffmanTableAC),le=15&re,X=re>>4;if(le!==0){var ne=t[H+=X];U.blockData[z+ne]=_(le)*(1<>4,(H=15&Y)==0)X<15?($=R(X)+(1<=65488&&Ce<=65495))break;p+=2}return(se=S(h,p))&&se.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+se.invalid),p=se.offset),p-E}function g(h,p,m){var y,w,k,v,I,T,A,x,E,P,O,L,B,R,_,G,M,W=h.quantizationTable,$=h.blockData;if(!W)throw new e("missing required Quantization Table.");for(var F=0;F<64;F+=8)E=$[p+F],P=$[p+F+1],O=$[p+F+2],L=$[p+F+3],B=$[p+F+4],R=$[p+F+5],_=$[p+F+6],G=$[p+F+7],E*=W[F],P|O|L|B|R|_|G?(P*=W[F+1],O*=W[F+2],L*=W[F+3],B*=W[F+4],R*=W[F+5],_*=W[F+6],G*=W[F+7],w=(y=(y=i*E+128>>8)+(w=i*B+128>>8)+1>>1)-w,M=(k=O)*n+(v=_)*f+128>>8,k=k*f-v*n+128>>8,A=(I=(I=l*(P-G)+128>>8)+(A=R<<4)+1>>1)-A,T=(x=(x=l*(P+G)+128>>8)+(T=L<<4)+1>>1)-T,v=(y=y+(v=M)+1>>1)-v,k=(w=w+k+1>>1)-k,M=I*a+x*u+2048>>12,I=I*u-x*a+2048>>12,x=M,M=T*o+A*r+2048>>12,T=T*r-A*o+2048>>12,A=M,m[F]=y+x,m[F+7]=y-x,m[F+1]=w+A,m[F+6]=w-A,m[F+2]=k+T,m[F+5]=k-T,m[F+3]=v+I,m[F+4]=v-I):(M=i*E+512>>10,m[F]=M,m[F+1]=M,m[F+2]=M,m[F+3]=M,m[F+4]=M,m[F+5]=M,m[F+6]=M,m[F+7]=M);for(var j=0;j<8;++j)E=m[j],(P=m[j+8])|(O=m[j+16])|(L=m[j+24])|(B=m[j+32])|(R=m[j+40])|(_=m[j+48])|(G=m[j+56])?(w=(y=4112+((y=i*E+2048>>12)+(w=i*B+2048>>12)+1>>1))-w,M=(k=O)*n+(v=_)*f+2048>>12,k=k*f-v*n+2048>>12,v=M,A=(I=(I=l*(P-G)+2048>>12)+(A=R)+1>>1)-A,T=(x=(x=l*(P+G)+2048>>12)+(T=L)+1>>1)-T,M=I*a+x*u+2048>>12,I=I*u-x*a+2048>>12,x=M,M=T*o+A*r+2048>>12,T=T*r-A*o+2048>>12,E=(E=(y=y+v+1>>1)+x)<16?0:E>=4080?255:E>>4,P=(P=(w=w+k+1>>1)+(A=M))<16?0:P>=4080?255:P>>4,O=(O=(k=w-k)+T)<16?0:O>=4080?255:O>>4,L=(L=(v=y-v)+I)<16?0:L>=4080?255:L>>4,B=(B=v-I)<16?0:B>=4080?255:B>>4,R=(R=k-T)<16?0:R>=4080?255:R>>4,_=(_=w-A)<16?0:_>=4080?255:_>>4,G=(G=y-x)<16?0:G>=4080?255:G>>4,$[p+j]=E,$[p+j+8]=P,$[p+j+16]=O,$[p+j+24]=L,$[p+j+32]=B,$[p+j+40]=R,$[p+j+48]=_,$[p+j+56]=G):(M=(M=i*E+8192>>14)<-2040?0:M>=2024?255:M+2056>>4,$[p+j]=M,$[p+j+8]=M,$[p+j+16]=M,$[p+j+24]=M,$[p+j+32]=M,$[p+j+40]=M,$[p+j+48]=M,$[p+j+56]=M)}function b(h,p){for(var m=p.blocksPerLine,y=p.blocksPerColumn,w=new Int16Array(64),k=0;k=w)return null;var v=y(p);if(v>=65472&&v<=65534)return{invalid:null,marker:v,offset:p};for(var I=y(k);!(I>=65472&&I<=65534);){if(++k>=w)return null;I=y(k)}return{invalid:v.toString(16),marker:I,offset:k}}return s.prototype={parse:function(h){function p(){var U=h[v]<<8|h[v+1];return v+=2,U}function m(){var U=p(),z=v+U-2,H=S(h,z,v);H&&H.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+H.invalid),z=H.offset);var Y=h.subarray(v,z);return v+=Y.length,Y}function y(U){for(var z=Math.ceil(U.samplesPerLine/8/U.maxH),H=Math.ceil(U.scanLines/8/U.maxV),Y=0;Y>4){if(G>>4!=1)throw new e("DQT - invalid table spec");for(L=0;L<64;L++)M[t[L]]=p()}else for(L=0;L<64;L++)M[t[L]]=h[v++];A[15&G]=M}break;case 65472:case 65473:case 65474:if(w)throw new e("Only single frame JPEGs supported");p(),(w={}).extended=P===65473,w.progressive=P===65474,w.precision=h[v++],w.scanLines=p(),w.samplesPerLine=p(),w.components=[],w.componentIds={};var W,$=h[v++],F=0,j=0;for(O=0;O<$;O++){W=h[v];var q=h[v+1]>>4,oe=15&h[v+1];F>4?x:E)[15&ce]=c(ie,me)}break;case 65501:p(),k=p();break;case 65498:p();var J,Pe=h[v++],ge=[];for(O=0;O>4],J.huffmanTableAC=x[15&ye],ge.push(J)}var Ge=h[v++],Ne=h[v++],fe=h[v++],Be=C(h,v,w,ge,k,Ge,Ne,fe>>4,15&fe);v+=Be;break;case 65535:h[v]!==255&&v--;break;default:if(h[v-3]===255&&h[v-2]>=192&&h[v-2]<=254){v-=3;break}throw new e("unknown marker "+P.toString(16))}P=p()}for(this.width=w.samplesPerLine,this.height=w.scanLines,this.jfif=I,this.eof=v,this.adobe=T,this.components=[],O=0;O>8)+$[x+1];return G},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(h){for(var p,m,y,w=0,k=h.length;w4)throw new e("Unsupported color mode");var y=this._getLinearizedBlockData(h,p);if(this.numComponents===1&&m){for(var w=y.length,k=new Uint8ClampedArray(3*w),v=0,I=0;I=0;b--)d[h++]=S[C]>>b&1}catch{}if(n===1&&l.length===a*f){const S=new Uint8Array(l.buffer);c=[S,S,S]}else{for(c=[],C=0;C<3;C++)c.push(new Uint8Array(s));for(b=0,g=0;gimport("./lerc-wasm-9604db8c.js"),["assets/lerc-wasm-9604db8c.js","assets/index-b5c8f851.js","assets/index-86716609.css"]).then(e=>e.l).then(({default:e})=>e({locateFile:t=>fr(`esri/layers/support/rasterFormats/${t}`)})).then(e=>{kr(e)}),Ye)}const je={getBlobInfo:null,decode:null};function Tr(e){return 16+(e>>3<<3)}function de(e,t,r){r.set(e.slice(t,t+r.length))}function kr(e){const{_malloc:t,_free:r,_lerc_getBlobInfo:o,_lerc_getDataRanges:u,_lerc_decode_4D:a,asm:f}=e;let n;const i=Object.values(f).find(s=>s&&"buffer"in s&&s.buffer===e.HEAPU8.buffer),l=s=>{const c=s.map(b=>Tr(b)),d=c.reduce((b,S)=>b+S),C=t(d);n=new Uint8Array(i.buffer);let g=c[0];c[0]=C;for(let b=1;b{const C=new Uint8Array(48),g=new Uint8Array(8*3),[b,S,h]=l([s.length,C.length,g.length]);n.set(s,b),n.set(C,S),n.set(g,h);let p=o(b,s.length,S,h,12,3);if(p)throw r(b),new Error(`lerc-getBlobInfo: error code is ${p}`);n=new Uint8Array(i.buffer),de(n,S,C),de(n,h,g);const m=new Uint32Array(C.buffer),y=new Float64Array(g.buffer),[w,k,,v,I,T,A,x,E,P,O]=m,L={version:w,depthCount:P,width:v,height:I,validPixelCount:A,bandCount:T,blobSize:x,maskCount:E,dataType:k,minValue:y[0],maxValue:y[1],maxZerror:y[2],statistics:[],bandCountWithNoData:O};if(O&&P>1)return r(b),L;if(P===1&&T===1)return r(b),L.statistics.push({minValue:y[0],maxValue:y[1]}),L;const B=P*T*8,R=new Uint8Array(B),_=new Uint8Array(B);let G=b,M=0,W=0,$=!1;if(n.byteLength1){const Te=F.slice(oe*P,(oe+1)*P),ke=j.slice(oe*P,(oe+1)*P),ce=Math.min.apply(null,Te),ie=Math.max.apply(null,ke);q.push({minValue:ce,maxValue:ie,depthStats:{minValues:Te,maxValues:ke}})}else q.push({minValue:F[oe],maxValue:j[oe]});return r(G),$||r(M),L},je.decode=(s,c)=>{const{maskCount:d,depthCount:C,bandCount:g,width:b,height:S,dataType:h,bandCountWithNoData:p}=c,m=Ht[h],y=b*S,w=new Uint8Array(y*g),k=y*C*g*m.size,v=new Uint8Array(k),I=new Uint8Array(g),T=new Uint8Array(8*g),[A,x,E,P,O]=l([s.length,w.length,v.length,I.length,T.length]);n.set(s,A),n.set(w,x),n.set(v,E),n.set(I,P),n.set(T,O);const L=a(A,s.length,d,x,C,b,S,g,h,E,P,O);if(L)throw r(A),new Error(`lerc-decode: error code is ${L}`);n=new Uint8Array(i.buffer),de(n,E,v),de(n,x,w);let B=null;if(p){de(n,P,I),de(n,O,T),B=[];const R=new Float64Array(T.buffer);for(let _=0;_1){w.set(p[0]);for(let A=1;A=k;if(C>0&&v)for(let A=0;A1?p:null,{pixelType:T}=b;return{width:i,height:l,bandCount:s,pixelType:T,depthCount:c,statistics:g,pixels:h,mask:w,bandMasks:I,noDataValues:n}}function xr(e,t,r,o=!0){if(t%4!=0||r%4!=0){const u=new ArrayBuffer(4*Math.ceil(r/4)),a=new Uint8Array(u),f=new Uint8Array(e,t,r);if(o)for(let n=0;n=a)n-=a,d=c>>>32-a,c<<=a;else{d=c>>>32-n,c=u[s++];const h=a-n;n=32-h,d=(d<>>n),c<<=h}if(d===257)break;if(d===256){a=9,f=Pt(),i=f.length,l=[];continue}const S=f[d];if(S==null){if(d>f.length)throw new Error("data integrity issue: code does not exist on code page");l.push(l[0]),f[i++]=l.slice(),Rt(b,l)}else Rt(b,S),l.push(S[0]),l.length>1&&(f[i++]=l.slice()),l=S.slice();if(Ie.has(i)&&a++,n===0&&(c=u[s++],n=32),s>C||s===C&&n<=g)break}return new Uint8Array(b)}Ie.add(511),Ie.add(1023),Ie.add(2047),Ie.add(4095),Ie.add(8191);const Mt=(e,t)=>{const r=t.width*t.height,o=t.pixelType;return Math.floor(e.byteLength/(r*qt(o)))},qt=e=>{let t=1;switch(e){case Uint8Array:case Int8Array:t=1;break;case Uint16Array:case Int16Array:t=2;break;case Uint32Array:case Int32Array:case Float32Array:t=4;break;case Float64Array:t=8}return t},Ar=(e,t)=>{if(8*e.byteLength=0;n--)o[u++]=a>>n&1;for(n=7;u>n&1,n--;return o};let Er=class{static decode(t,r){const o=r.pixelType,u=[],a=r.width*r.height,f=Mt(t,r),{bandIds:n,format:i}=r,l=(n==null?void 0:n.length)||Mt(t,r),s=t.byteLength-t.byteLength%(a*qt(o)),c=new o(t,0,a*f);let d,C,g,b,S=null;if(i==="bip")for(d=0;d>4,u<8?u=1:u===15?(u=4,a=(7&a)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]):u===14?(u=3,a=(15&a)<<12|(63&e[r++])<<6|63&e[r++]):(u=2,a=(31&a)<<6|63&e[r++]),(a!==0||t)&&(o+=String.fromCharCode(a));return o}const dt=(()=>{const e=[];return e[254]="NEWSUBFILETYPE",e[255]="SUBFILETYPE",e[256]="IMAGEWIDTH",e[257]="IMAGELENGTH",e[258]="BITSPERSAMPLE",e[259]="COMPRESSION",e[262]="PHOTOMETRICINTERPRETATION",e[263]="THRESHHOLDING",e[264]="CELLWIDTH",e[265]="CELLLENGTH",e[266]="FILLORDER",e[269]="DOCUMENTNAME",e[270]="IMAGEDESCRIPTION",e[271]="MAKE",e[272]="MODEL",e[273]="STRIPOFFSETS",e[274]="ORIENTATION",e[277]="SAMPLESPERPIXEL",e[278]="ROWSPERSTRIP",e[279]="STRIPBYTECOUNTS",e[280]="MINSAMPLEVALUE",e[281]="MAXSAMPLEVALUE",e[282]="XRESOLUTION",e[283]="YRESOLUTION",e[284]="PLANARCONFIGURATION",e[285]="PAGENAME",e[286]="XPOSITION",e[287]="YPOSITION",e[288]="FREEOFFSETS",e[289]="FREEBYTECOUNTS",e[290]="GRAYRESPONSEUNIT",e[291]="GRAYRESPONSECURVE",e[292]="T4OPTIONS",e[293]="T6OPTIONS",e[296]="RESOLUTIONUNIT",e[297]="PAGENUMBER",e[300]="COLORRESPONSEUNIT",e[301]="TRANSFERFUNCTION",e[305]="SOFTWARE",e[306]="DATETIME",e[315]="ARTIST",e[316]="HOSTCOMPUTER",e[317]="PREDICTOR",e[318]="WHITEPOINT",e[319]="PRIMARYCHROMATICITIES",e[320]="COLORMAP",e[321]="HALFTONEHINTS",e[322]="TILEWIDTH",e[323]="TILELENGTH",e[324]="TILEOFFSETS",e[325]="TILEBYTECOUNTS",e[326]="BADFAXLINES",e[327]="CLEANFAXDATA",e[328]="CONSECUTIVEBADFAXLINES",e[330]="SUBIFD",e[332]="INKSET",e[333]="INKNAMES",e[334]="NUMBEROFINKS",e[336]="DOTRANGE",e[337]="TARGETPRINTER",e[338]="EXTRASAMPLES",e[339]="SAMPLEFORMAT",e[340]="SMINSAMPLEVALUE",e[341]="SMAXSAMPLEVALUE",e[342]="TRANSFERRANGE",e[347]="JPEGTABLES",e[512]="JPEGPROC",e[513]="JPEGIFOFFSET",e[514]="JPEGIFBYTECOUNT",e[515]="JPEGRESTARTINTERVAL",e[517]="JPEGLOSSLESSPREDICTORS",e[518]="JPEGPOINTTRANSFORM",e[519]="JPEGQTABLES",e[520]="JPEGDCTABLES",e[521]="JPEGACTABLES",e[529]="YCBCRCOEFFICIENTS",e[530]="YCBCRSUBSAMPLING",e[531]="YCBCRPOSITIONING",e[532]="REFERENCEBLACKWHITE",e[700]="XMP",e[33550]="GEOPIXELSCALE",e[33922]="GEOTIEPOINTS",e[33432]="COPYRIGHT",e[42112]="GDAL_METADATA",e[42113]="GDAL_NODATA",e[50844]="RPCCOEFFICIENT",e[34264]="GEOTRANSMATRIX",e[34735]="GEOKEYDIRECTORY",e[34736]="GEODOUBLEPARAMS",e[34737]="GEOASCIIPARAMS",e[34665]="EXIFIFD",e[34853]="GPSIFD",e[40965]="INTEROPERABILITYIFD",e})(),Rr=(()=>{const e=dt.slice();return e[36864]="ExifVersion",e[40960]="FlashpixVersion",e[40961]="ColorSpace",e[42240]="Gamma",e[37121]="ComponentsConfiguration",e[37122]="CompressedBitsPerPixel",e[40962]="PixelXDimension",e[40963]="PixelYDimension",e[37500]="MakerNote",e[37510]="UserComment",e[40964]="RelatedSoundFile",e[36867]="DateTimeOriginal",e[36868]="DateTimeDigitized",e[36880]="OffsetTime",e[36881]="OffsetTimeOriginal",e[36882]="OffsetTimeDigitized",e[37520]="SubSecTime",e[37521]="SubSecTimeOriginal",e[37522]="SubSecTimeDigitized",e[37888]="Temperature",e[37889]="Humidity",e[37890]="Pressure",e[37891]="WaterDepth",e[37892]="Acceleration",e[37893]="CameraElevationAngle",e[42016]="ImageUniqueID",e[42032]="CameraOwnerName",e[42033]="BodySerialNumber",e[42034]="LensSpecification",e[42035]="LensMake",e[42036]="LensModel",e[42037]="LensSerialNumber",e[33434]="ExposureTime",e[33437]="FNumber",e[34850]="ExposureProgram",e[34852]="SpectralSensitivity",e[34855]="PhotographicSensitivity",e[34856]="OECF",e[34864]="SensitivityType",e[34865]="StandardOutputSensitivity",e[34866]="RecommendedExposureIndex",e[34867]="ISOSpeed",e[34868]="ISOSpeedLatitudeyyy",e[34869]="ISOSpeedLatitudezzz",e[37377]="ShutterSpeedValue",e[37378]="ApertureValue",e[37379]="BrightnessValue",e[37380]="ExposureBiasValue",e[37381]="MaxApertureValue",e[37382]="SubjectDistance",e[37383]="MeteringMode",e[37384]="LightSource",e[37385]="Flash",e[37386]="FocalLength",e[37396]="SubjectArea",e[41483]="FlashEnergy",e[41484]="SpatialFrequencyResponse",e[41486]="FocalPlaneXResolution",e[41487]="FocalPlaneYResolution",e[41488]="FocalPlaneResolutionUnit",e[41492]="SubjectLocation",e[41493]="ExposureIndex",e[41495]="SensingMethod",e[41728]="FileSource",e[41729]="SceneType",e[41730]="CFAPattern",e[41985]="CustomRendered",e[41986]="ExposureMode",e[41987]="WhiteBalance",e[41988]="DigitalZoomRatio",e[41989]="FocalLengthIn35mmFilm",e[41990]="SceneCaptureType",e[41991]="GainControl",e[41992]="Contrast",e[41993]="Saturation",e[41994]="Sharpness",e[41995]="DeviceSettingDescription",e[41996]="SubjectDistanceRange",e})(),Mr=["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"],Lr=(()=>{const e=[];return e[1024]="GTModelTypeGeoKey",e[1025]="GTRasterTypeGeoKey",e[1026]="GTCitationGeoKey",e[2048]="GeographicTypeGeoKey",e[2049]="GeogCitationGeoKey",e[2050]="GeogGeodeticDatumGeoKey",e[2051]="GeogPrimeMeridianGeoKey",e[2052]="GeogLinearUnitsGeoKey",e[2053]="GeogLinearUnitSizeGeoKey",e[2054]="GeogAngularUnitsGeoKey",e[2055]="GeogAngularUnitSizeGeoKey",e[2056]="GeogEllipsoidGeoKey",e[2057]="GeogSemiMajorAxisGeoKey",e[2058]="GeogSemiMinorAxisGeoKey",e[2059]="GeogInvFlatteningGeoKey",e[2061]="GeogPrimeMeridianLongGeoKey",e[2060]="GeogAzimuthUnitsGeoKey",e[3072]="ProjectedCSTypeGeoKey",e[3073]="PCSCitationGeoKey",e[3074]="ProjectionGeoKey",e[3075]="ProjCoordTransGeoKey",e[3076]="ProjLinearUnitsGeoKey",e[3077]="ProjLinearUnitSizeGeoKey",e[3078]="ProjStdParallel1GeoKey",e[3079]="ProjStdParallel2GeoKey",e[3080]="ProjNatOriginLongGeoKey",e[3081]="ProjNatOriginLatGeoKey",e[3082]="ProjFalseEastingGeoKey",e[3083]="ProjFalseNorthingGeoKey",e[3084]="ProjFalseOriginLongGeoKey",e[3085]="ProjFalseOriginLatGeoKey",e[3086]="ProjFalseOriginEastingGeoKey",e[3087]="ProjFalseOriginNorthingGeoKey",e[3088]="ProjCenterLongGeoKey",e[3090]="ProjCenterEastingGeoKey",e[3091]="ProjCenterNorthingGeoKey",e[3092]="ProjScaleAtNatOriginGeoKey",e[3093]="ProjScaleAtCenterGeoKey",e[3094]="ProjAzimuthAngleGeoKey",e[3095]="ProjStraightVertPoleLongGeoKey",e[4096]="VerticalCSTypeGeoKey",e[4097]="VerticalCitationGeoKey",e[4098]="VerticalDatumGeoKey",e[4099]="VerticalUnitsGeoKey",e})(),Or=(e,t)=>{let r=(t||dt)[e];return r===void 0&&(r="unknown"+String(e)),r},rt=new Map;rt.set("EXIFIFD",Rr),rt.set("GPSIFD",Mr);const Ae={tiffTags:dt,ifdTags:rt,geoKeys:Lr,getTagName:Or},pt=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,t[0]===1})(),Lt=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],Ee=4294967296,Dr=new Set([1,5,6,7,8,34712,34887]);function mt(e,t){let r="unknown";return e===3?r=t===64?"f64":"f32":e===1?t===1?r="u1":t===2?r="u2":t===4?r="u4":t<=8?r="u8":t<=16?r="u16":t<=32&&(r="u32"):e===2&&(t<=8?r="s8":t<=16?r="s16":t<=32&&(r="s32")),r}function ze(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}function Ur(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function Yt(e,t){var r;return(r=e.get(t))==null?void 0:r.values}function ve(e,t){var r;return(r=e.get(t))==null?void 0:r.values}function Ot(e,t){var r,o;return(o=(r=e.get(t))==null?void 0:r.values)==null?void 0:o[0]}function V(e,t){var r,o;return(o=(r=e.get(t))==null?void 0:r.values)==null?void 0:o[0]}function Xe(e,t,r,o=0,u=Ae.tiffTags,a=4){const f=a===8,n=f?yt(new DataView(e,r,8),0,t):new DataView(e,r,2).getUint16(0,t),i=4+2*a,l=f?8:2,s=l+n*i;if(r+s>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:s};const c=r+s+4<=e.byteLength?Ve(new DataView(e,r+s,a===8?8:4),0,t,a===8):null,d=r+l,C=new Map;let g,b,S,h,p,m=0,y=0;for(let w=0;wJt(e,{inputOffset:t}).pixels[0];function ot(e,t){if(t!==1&&t!==2&&t!==4)return e;const r=new Uint8Array(e),o=8/t,u=new Uint8Array(e.byteLength*o);let a=0;const f=2**t-1;for(let n=0;n>>8-t&f}return u.buffer}function nt(e,t,r){const o=new Wt;o.parse(e),o.colorTransform=r===6?-1:0;const u=o.getData(o.width,o.height,t!==1&&t!==4);return new Uint8Array(u.buffer)}function it(e){const t=new Ue(e).getBytes(),r=new ArrayBuffer(t.length),o=new Uint8Array(r);return o.set(t),o}async function at(e,t,r,o,u){const a=pt===t,f=V(r,"BITSPERSAMPLE"),n=V(r,"SAMPLESPERPIXEL")??1,i=V(r,"PHOTOMETRICINTERPRETATION"),l=V(r,"SAMPLEFORMAT")??1,s=mt(l,f),c=V(r,"COMPRESSION")??1,d=ze(s);let C,g,b;if(c===34887)return await Kt(),Gr(e,o);if(c===1)C=e.slice(o,o+u),g=new Uint8Array(C);else if(c===8||c===32946)g=new Uint8Array(e,o,u),g=it(g),C=g.buffer;else if(c===6)g=new Uint8Array(e,o,u),g=nt(g,n,i),C=g.buffer;else if(c===7){const m=r.get("JPEGTABLES").values,y=m.length-2;g=new Uint8Array(y+u-2);for(let k=0;k1&&(c===5||c===8||c===32946)&&h&&p){const m=We(r),y=new d(b.length);y.set(b),b=Hr(y,p,h,l===3&&S===3,m?1:n)}return b}async function Nr(e,t,r){const o=ve(r,"TILEOFFSETS");if(o===void 0)return null;const u=ve(r,"TILEBYTECOUNTS"),{width:a,height:f,pixelType:n,tileWidth:i,tileHeight:l}=gt([r]),s=We(r,t),c=V(r,"SAMPLESPERPIXEL")||t.planes,d=a*f,C=V(r,"BITSPERSAMPLE"),g=(V(r,"COMPRESSION")??1)===34887,b=ze(n),S=[];for(let R=0;R1){const R=Math.round(o.length/c);for(h=0;h{const o=pt===t.littleEndian,u=ve(r,"STRIPOFFSETS");if(u===void 0)return null;const{width:a,height:f,pixelType:n}=gt([r]),i=V(r,"SAMPLESPERPIXEL")||t.planes,l=V(r,"PHOTOMETRICINTERPRETATION"),s=a*f,c=V(r,"BITSPERSAMPLE"),d=ze(n),C=new d(s*i),g=ve(r,"STRIPBYTECOUNTS"),b=V(r,"ROWSPERSTRIP"),S=V(r,"COMPRESSION")??1;let h,p,m,y,w,k,v,I,T,A=b;if(c%8==0)for(h=0;hf?f-h*b:b,n==="u8"||n==="s8"||o)S===8||S===32946?(v=new Uint8Array(e,u[h],g[h]),v=it(v),k=v.buffer):S===6?(v=new Uint8Array(e,u[h],g[h]),v=nt(v,i,l),k=v.buffer):S===5?(v=ft(e,u[h],g[h],t.littleEndian),k=v.buffer):(g[h]!==A*a*i*c/8&&console.log("strip byte counts is different than expected"),k=e.slice(u[h],u[h]+g[h])),k=ot(k,c),y=new d(k);else{switch(S===6||S===8||S===32946?(v=new Uint8Array(e,u[h],g[h]),I=it(v),k=I.buffer):(g[h]!==A*a*i*c/8&&console.log("strip byte counts is different than expected"),k=new ArrayBuffer(g[h]),v=new Uint8Array(e,u[h],g[h]),I=new Uint8Array(k)),n){case"u16":case"s16":for(m=0;m{if(!(e&&e.length>0&&t&&r))return null;let o,u,a;const f=e[0].length,n=e.length,i=new Uint8Array(f);for(let l=0;la?0:1;else for(let s=0;sa?0:1);return i},$r=e=>{if(!e)return null;const t=e.match(//gi);if(!t||t.length===0)return null;const r=new Map;let o,u,a,f,n;for(let h=0;h")),f=o.indexOf("sample="),f>-1&&(n=o.slice(f+8,o.indexOf('"',f+8))),f=o.indexOf("name="),f>-1&&(u=o.slice(f+6,o.indexOf('"',f+6))),u&&(a=o.slice(o.indexOf(">")+1,o.indexOf("")).trim(),n!=null?r.has(u)?r.get(u)[n]=a:r.set(u,[a]):r.set(u,a)),n=null;const i=r.get("STATISTICS_MINIMUM"),l=r.get("STATISTICS_MAXIMUM"),s=r.get("STATISTICS_MEAN"),c=r.get("STATISTICS_STDDEV");let d=null;if(i&&l){d=[];for(let h=0;hS&&d>(u?e.byteLength:e?e.byteLength-i+o:0))return r.offlineOffsetSize=[i,d],r.values=null,!1;if(C<=S){if(!t)if(S<=32)i>>>=32-C;else{const p=h!=null&&h.length?h[0]:i>>>0,m=h!=null&&h.length?h[1]:Math.round((i-p)/Ee);C<=32?(i=p>>>32-C,h[0]=i):(i=p*2**(32-C)+(m>>>32-C),h[0]=p,h[1]=m>>>32-C)}if(n===1&&c===S)l=[i];else if(S===64){const p=h!=null&&h.length?h[0]:i>>>0,m=h!=null&&h.length?h[1]:Math.round((i-p)/Ee);let y=p,w=32;for(b=1;b<=n;b++){const k=32-c*b%32;if(w>>32-w,I=m<<32-w>>>32-w;y=m,l.push(v+I*2**(c-w)),w-=32-(c-w)}else l.push(y<>>32-c),w-=c;w===0&&(w=32,y=m)}}else for(b=1;b<=n;b++){const p=32-c*b;l.push(i<

>>32-c)}}else{i-=o,u&&(i=0);for(let p=i;pparseFloat(G)),d.some(G=>isNaN(G))&&(d=null));const C=V(t,"COMPRESSION")??1;let g;switch(C){case 1:g="NONE";break;case 2:case 3:case 4:case 32771:g="CCITT";break;case 5:g="LZW";break;case 6:case 7:g="JPEG";break;case 32773:g="PACKBITS";break;case 8:case 32946:g="DEFLATE";break;case 34712:g="JPEG2000";break;case 34887:g="LERC";break;default:g=String(C)}let b=!0,S="";Dr.has(C)||(b=!1,S+="unsupported tag compression "+C),i>3&&(b=!1,S+="unsupported tag sampleFormat "+i),f!==1&&f!==2&&f!==4&&f%8!=0&&(b=!1,S+="unsupported tag bitsPerSample "+f);const h=Ot(t,"GEOASCIIPARAMS");let p;if(h){const G=h.split("|").find(W=>W.includes("ESRI PE String = ")),M=G?G.replace("ESRI PE String = ",""):"";p=M.startsWith("COMPD_CS")||M.startsWith("PROJCS")||M.startsWith("GEOGCS")?{wkid:null,wkt:M}:null}const m=ve(t,"GEOTIEPOINTS"),y=ve(t,"GEOPIXELSCALE"),w=ve(t,"GEOTRANSMATRIX"),k=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let v,I,T=!1,A=!1;if(k){T=V(k,"GTRasterTypeGeoKey")===2;const G=V(k,"GTModelTypeGeoKey");if(G===2){const M=V(k,"GeographicTypeGeoKey");M>=1024&&M<=32766&&(p={wkid:M}),p||M!==32767||(A=!0,p={wkid:4326})}else if(G===1){const M=V(k,"ProjectedCSTypeGeoKey");M>=1024&&M<=32766&&(p={wkid:M})}}if(y&&m&&m.length>=6?(v=[y[0],0,m[3]-m[0]*y[0],0,-Math.abs(y[1]),m[4]-m[1]*y[1]],T&&(v[2]-=.5*v[0]+.5*v[1],v[5]-=.5*v[3]+.5*v[4])):w&&w.length===16&&(v=T?[w[0],w[1],w[3]-.5*w[0],w[4],w[5],w[7]-.5*w[5]]:[w[0],w[1],w[3],w[4],w[5],w[7]]),v){const G=[{x:0,y:a},{x:0,y:0},{x:u,y:a},{x:u,y:0}];let M,W=Number.POSITIVE_INFINITY,$=Number.POSITIVE_INFINITY,F=Number.NEGATIVE_INFINITY,j=Number.NEGATIVE_INFINITY;for(let q=0;qW?W:M.x,F=M.x$?$:M.y,j=M.y400||Math.max(Math.abs(I.xmin),Math.abs(I.xmax))>361)&&(p=null,I.spatialReference=null);const x=Xt(e);let E,P,O,L,B;if(x.length>0){O=Math.round(Math.log(u/V(x[0],"IMAGEWIDTH"))/Math.LN2);const G=x[x.length-1];L=Math.round(Math.log(u/V(G,"IMAGEWIDTH"))/Math.LN2),E=V(G,"TILEWIDTH"),P=V(G,"TILELENGTH")}E=L!=null&&L>0?E||r:null,P=L!=null&&L>0?P||o:null,r&&(B=[{maxCol:Math.ceil(u/r)-1,maxRow:Math.ceil(a/o)-1,minRow:0,minCol:0}],x.forEach(G=>{B.push({maxCol:Math.ceil(V(G,"IMAGEWIDTH")/V(G,"TILEWIDTH"))-1,maxRow:Math.ceil(V(G,"IMAGELENGTH")/V(G,"TILELENGTH"))-1,minRow:0,minCol:0})}));const R=Ot(e[0],"GDAL_METADATA"),_=$r(R);return S+=" "+Qt({width:u,height:a,tileWidth:r,tileHeight:o,planes:n,ifds:e}),{width:u,height:a,tileWidth:r,tileHeight:o,planes:n,isBSQ:s,pixelType:l,compression:g,noData:d,hasMaskBand:Zt(e).length===x.length+1,isSupported:b,message:S,extent:I,isPseudoGeographic:A,affine:y?null:v,firstPyramidLevel:O,maximumPyramidLevel:L,pyramidBlockWidth:E,pyramidBlockHeight:P,tileBoundary:B,metadata:_}}function We(e,t){const r=Yt(e,"PLANARCONFIGURATION");return r?r[0]===2:!!t&&t.isBSQ}function Xt(e){return e.filter(t=>V(t,"NEWSUBFILETYPE")===1)}function Zt(e){return e.filter(t=>{const r=(4&(V(t,"NEWSUBFILETYPE")??0))==4,o=V(t,"PHOTOMETRICINTERPRETATION")===4;return r&&o})}function _r(e){const{littleEndian:t,isBigTiff:r,firstIFDPos:o}=zr(e);let u=o;const a=[];do{const f=Wr(e,t,u,0,Ae.tiffTags,r?8:4);if(!f.success)break;a.push(f.ifd),u=f.nextIFD}while(u>0);return{...gt(a),littleEndian:t,isBigTiff:r,ifds:a,pyramidIFDs:Xt(a),maskIFDs:Zt(a)}}function yt(e,t,r){const o=e.getUint32(t,r),u=e.getUint32(t+4,r);return r?u*Ee+o:o*Ee+u}function jr(e,t,r){let o=r?e.getInt32(t,r):e.getUint32(t,r),u=r?e.getUint32(t+4,r):e.getInt32(t+4,r);const a=(r?o:u)>=0?1:-1;return r?o*=a:u*=a,a*(r?u*Ee+o:o*Ee+u)}function Ve(e,t,r,o){return o?yt(e,t,r):e.getUint32(t,r)}function zr(e){const t=new DataView(e,0,16),r=t.getUint16(0,!1);let o=null;if(r===18761)o=!0;else{if(r!==19789)throw new Error("unexpected endianess byte");o=!1}const u=t.getUint16(2,o);if(u!==42&&u!==43)throw new Error("unexpected tiff identifier");let a=4;const f=u===43;if(f){const n=t.getUint16(a,o);if(a+=2,n!==8)throw new Error("unsupported bigtiff version");if(t.getUint16(a,o)!==0)throw new Error("unsupported bigtiff version");a+=2}return{littleEndian:o,isBigTiff:f,firstIFDPos:Ve(t,a,o,f)}}function Wr(e,t,r,o=0,u=Ae.tiffTags,a=4){const f=Xe(e,t,r,o,u,a);let n;const i=f.ifd;if(i){if(Ae.ifdTags.forEach((l,s)=>{i.has(s)&&(n=i.get(s),n.data=Xe(e,t,n.valueOffset-o,o,l).ifd)}),i.has("GEOKEYDIRECTORY")){n=i.get("GEOKEYDIRECTORY");const l=n.values;if(l&&l.length>4){const s=l[0]+"."+l[1]+"."+l[2];n.data=Xe(e,t,n.valueOffset+6-o,o,Ae.geoKeys,2).ifd,n.data&&n.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[s]})}}if(i.has("XMP")){n=i.get("XMP");const l=n.values;typeof l[0]=="number"&&n.type===7&&(n.values=[Pr(new Uint8Array(l))])}}return f}function Qt(e){const{width:t,height:r,tileHeight:o,tileWidth:u}=e,a=e.planes,f=u?u*o:t*r,n=V(e.ifds[0],"BITSPERSAMPLE");let i="";return f*a>2**30/(n>8?n/8:1)&&(i=u?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),i}function Hr(e,t,r,o,u){const a=o?4:1,f=r*a*u;o&&(e=new Uint8Array(e.buffer));for(let l=0;lT.min):null,v=w?w.map(T=>T.max):null,I={pixelType:l,width:d,height:C,pixels:h,noDataValue:y};return y!=null?ht(I,y):k&&v&&t.applyMinMaxConstraint&&(I.mask=Fr(h,k,v)),I}async function Jr(e,t={}){const r=t.pyramidLevel||0,o=t.headerInfo||_r(e),{ifds:u,noData:a}=o;if(u.length===0)throw new Error("no valid image file directory");const f=Qt(o);if(f)throw f;let n=null;const i=r===-1?u[u.length-1]:u[r],l=a??t.noDataValue;return n=o.tileWidth?await Nr(e,o,i):Br(e,o,i),n&&(l!=null&&ht(n,l),n)}var qr=function(e){var t,r,o,u,a,f;function n(i){var l,s,c,d,C,g,b,S,h,p,m,y,w;for(this.data=i,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},C=null;;){switch(l=this.readUInt32(),S=(function(){var k,v;for(v=[],k=0;k<4;++k)v.push(String.fromCharCode(this.data[this.pos++]));return v}).call(this).join(""),S){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()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(l);break;case"fcTL":C&&this.animation.frames.push(C),this.pos+=4,C={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},d=this.readUInt16(),c=this.readUInt16()||100,C.delay=1e3*d/c,C.disposeOp=this.data[this.pos++],C.blendOp=this.data[this.pos++],C.data=[];break;case"IDAT":case"fdAT":for(S==="fdAT"&&(this.pos+=4,l-=4),i=(C!=null?C.data:void 0)||this.imgData,m=0;0<=l?ml;0<=l?++m:--m)i.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(l),(h=255-this.transparency.indexed.length)>0)for(y=0;0<=h?yh;0<=h?++y:--y)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(l)[0];break;case 2:this.transparency.rgb=this.read(l)}break;case"tEXt":g=(p=this.read(l)).indexOf(0),b=String.fromCharCode.apply(String,p.slice(0,g)),this.text[b]=String.fromCharCode.apply(String,p.slice(g+1));break;case"IEND":return C&&this.animation.frames.push(C),this.colors=(function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}).call(this),this.hasAlphaChannel=(w=this.colorType)===4||w===6,s=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*s,this.colorSpace=(function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}).call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=l}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return n.load=function(i,l,s){var c;return typeof l=="function"&&(s=l),(c=new XMLHttpRequest).open("GET",i,!0),c.responseType="arraybuffer",c.onload=function(){var d;return d=new n(new Uint8Array(c.response||c.mozResponseArrayBuffer)),typeof(l!=null?l.getContext:void 0)=="function"&&d.render(l),typeof s=="function"?s(d):void 0},c.send(null)},r=1,o=2,t=0,n.prototype.read=function(i){var l,s;for(s=[],l=0;0<=i?li;0<=i?++l:--l)s.push(this.data[this.pos++]);return s},n.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.decodePixels=function(i){var l,s,c,d,C,g,b,S,h,p,m,y,w,k,v,I,T,A,x,E,P,O,L;if(i==null&&(i=this.imgData),i.length===0)return new Uint8Array(0);for(i=(i=new Ue(i)).getBytes(),I=(y=this.pixelBitlength/8)*this.width,w=new Uint8Array(I*this.height),g=i.length,v=0,k=0,s=0;k1&&s/dro(r,o,e);break;case"tiff":t=Zr;break;case"deflate":t=eo;break;case"lzw":t=to;break;case"error":t=()=>{throw new pe("rasterCodec:decode","input data contains error")};break;default:t=()=>{throw new pe("rasterCodec:decode","unsupported raster format")}}return t}function so(e){let t=null,r=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":r=255,t=Uint8Array;break;case"u16":r=r||65535,t=Uint16Array;break;case"u32":r=r||2**32-1,t=Uint32Array;break;case"s8":r=r||-128,t=Int8Array;break;case"s16":r=r||-32768,t=Int16Array;break;case"s32":r=r||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:r}}function lo(e,t=1){if(!e)return;const{pixels:r,width:o,height:u,mask:a}=e;if(!r||r.length===0)return;const f=r.length,n=o-1,i=u-1,l=[];let s,c,d,C,g,b,S=null;const h=te.getPixelArrayConstructor(e.pixelType);if(t===0){for(s=0;sDt.fromJSON(o));for(let o=0;o.001&&(d/=xe,C/=xe),f==="adjusted")if(n){const E=s*xe,P=c*xe;d=(l+E**u*a)/(8*E),C=(l+P**u*a)/(8*P)}else d=(l+s**u*a)/(8*s),C=(l+c**u*a)/(8*c);let g=(90-t)*Math.PI/180,b=Math.cos(g),S=(360-r+90)*Math.PI/180,h=Math.sin(g)*Math.cos(S),p=Math.sin(g)*Math.sin(S);const m=[315,270,225,360,180,0],y=[60,60,60,60,60,90],w=new Float32Array([3,5,3,2,1,4]),k=w.reduce((E,P)=>E+P),v=w.map(E=>E/k),I=o==="multi-directional"?m.length:1,T=new Float32Array(6),A=new Float32Array(6),x=new Float32Array(6);if(o==="multi-directional")for(let E=0;Eg?g:S],m=f[b],y=m*p,w=y*(1-Math.abs(h%2-1)),k=m-y;switch(Math.floor(h)){case 0:c[b]=y+k,d[b]=w+k,C[b]=k;break;case 1:c[b]=w+k,d[b]=y+k,C[b]=k;break;case 2:c[b]=k,d[b]=y+k,C[b]=w+k;break;case 3:c[b]=k,d[b]=w+k,C[b]=y+k;break;case 4:c[b]=w+k,d[b]=k,C[b]=y+k;break;case 5:case 6:c[b]=y+k,d[b]=k,C[b]=w+k}}e.pixels=[c,d,C],e.updateStatistics()}function jo(e,t){if(!Se(e))return e;const r=t.zFactor,o=t.pixelSizePower??1,u=t.pixelSizeFactor??1,a=t.slopeType,f=t.isGCS,{x:n,y:i}=t.resolution;let l=r/(8*n),s=r/(8*i);f&&Math.abs(r-1)<1e-4&&(l/=xe,s/=xe),a==="adjusted"&&(l=(r+n**o*u)/(8*n),s=(r+i**o*u)/(8*i));const{dzxs:c,dzys:d,outMask:C}=He(e),{width:g,height:b}=e,S=new Float32Array(g*b);for(let p=ee;p360&&(h%=360)),s[d+C]=h}}}return Ke(s,i,l),new te({width:i,height:l,pixels:[s],mask:n,pixelType:"f32",validPixelCount:e.validPixelCount,statistics:[{minValue:-1,maxValue:360}]})}function Wo(e,t){if(!Se(e))return e;const{curvatures:r,outMask:o}=He(e,t),{width:u,height:a}=e;Ke(r,u,a);const f=new te({width:u,height:a,pixels:[r],mask:o,pixelType:"f32",validPixelCount:e.validPixelCount});return f.updateStatistics(),f}const Ho=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],or=[{id:"aspect",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"black-to-white",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blue-bright",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blue-light-to-dark",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blue-green-bright",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blue-green-light-to-dark",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brown-light-to-dark",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brown-to-blue-green-diverging-right",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brown-to-blue-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficient-bias",fromColor:[214,214,255],toColor:[0,57,148]},{id:"cold-to-hot-diverging",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"condition-number",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyan-to-purple",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyan-light-to-blue-dark",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors",fromColor:[255,235,214],toColor:[196,10,10]},{id:"gray-light-to-dark",fromColor:[219,219,219],toColor:[69,69,69]},{id:"green-bright",fromColor:[204,255,204],toColor:[14,204,14]},{id:"green-light-to-dark",fromColor:[220,245,233],toColor:[34,102,51]},{id:"green-to-blue",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orange-bright",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orange-light-to-dark",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partial-spectrum",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partial-spectrum-1-diverging",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partial-spectrum-2-diverging",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pink-to-yellow-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pink-to-yellow-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purple-bright",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purple-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purple-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purple-blue-bright",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purple-blue-light-to-dark",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purple-red-bright",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purple-red-light-to-dark",fromColor:[250,215,246],toColor:[143,17,57]},{id:"red-bright",fromColor:[255,204,204],toColor:[219,0,0]},{id:"red-light-to-dark",fromColor:[255,224,224],toColor:[143,10,10]},{id:"red-to-blue-diverging-bright",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"red-to-blue-diverging-dark",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"red-to-green",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"red-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"red-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrum-full-bright",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrum-full-dark",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrum-full-light",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"white-to-black",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellow-to-dark-red",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellow-to-green-to-dark-blue",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellow-to-red",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellow-green-bright",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellow-green-light-to-dark",fromColor:[215,240,175],toColor:[96,107,45]}],mo=new jt({Aspect:"aspect","Black to White":"black-to-white","Blue Bright":"blue-bright","Blue Light to Dark":"blue-light-to-dark","Blue-Green Bright":"blue-green-bright","Blue-Green Light to Dark":"blue-green-light-to-dark","Brown Light to Dark":"brown-light-to-dark","Brown to Blue Green Diverging, Bright":"brown-to-blue-green-diverging-right","Brown to Blue Green Diverging, Dark":"brown-to-blue-green-diverging-dark","Coefficient Bias":"coefficient-bias","Cold to Hot Diverging":"cold-to-hot-diverging","Condition Number":"condition-number","Cyan to Purple":"cyan-to-purple","Cyan-Light to Blue-Dark":"cyan-light-to-blue-dark",Distance:"distance","Elevation #1":"elevation1","Elevation #2":"elevation2",Errors:"errors","Gray Light to Dark":"gray-light-to-dark","Green Bright":"green-bright","Green Light to Dark":"green-light-to-dark","Green to Blue":"green-to-blue","Orange Bright":"orange-bright","Orange Light to Dark":"orange-light-to-dark","Partial Spectrum":"partial-spectrum","Partial Spectrum 1 Diverging":"partial-spectrum-1-diverging","Partial Spectrum 2 Diverging":"partial-spectrum-2-diverging","Pink to YellowGreen Diverging, Bright":"pink-to-yellow-green-diverging-bright","Pink to YellowGreen Diverging, Dark":"pink-to-yellow-green-diverging-dark",Precipitation:"precipitation",Prediction:"prediction","Purple Bright":"purple-bright","Purple to Green Diverging, Bright":"purple-to-green-diverging-bright","Purple to Green Diverging, Dark":"purple-to-green-diverging-dark","Purple-Blue Bright":"purple-blue-bright","Purple-Blue Light to Dark":"purple-blue-light-to-dark","Purple-Red Bright":"purple-red-bright","Purple-Red Light to Dark":"purple-red-light-to-dark","Red Bright":"red-bright","Red Light to Dark":"red-light-to-dark","Red to Blue Diverging, Bright":"red-to-blue-diverging-bright","Red to Blue Diverging, Dark":"red-to-blue-diverging-dark","Red to Green":"red-to-green","Red to Green Diverging, Bright":"red-to-green-diverging-bright","Red to Green Diverging, Dark":"red-to-green-diverging-dark",Slope:"slope","Spectrum-Full Bright":"spectrum-full-bright","Spectrum-Full Dark":"spectrum-full-dark","Spectrum-Full Light":"spectrum-full-light",Surface:"surface",Temperature:"temperature","White to Black":"white-to-black","Yellow to Dark Red":"yellow-to-dark-red","Yellow to Green to Dark Blue":"yellow-to-green-to-dark-blue","Yellow to Red":"yellow-to-red","Yellow-Green Bright":"yellow-green-bright","Yellow-Green Light to Dark":"yellow-green-light-to-dark"});function Fe(e,t){if(!e||!t||e.length!==t.length)return!1;for(let r=0;rt[r]+2||e[r]Ut(o))),r}return Ut(e)}function Gt(e,t){if(!e)return;const r=t??or;let o=null;return e.type==="algorithmic"?r.some(u=>{if(Fe(e.fromColor.toRgb(),u.fromColor)&&Fe(e.toColor.toRgb(),u.toColor))return o=u.id,!0}):e.type==="multipart"&&r.some(u=>{const a=e.colorRamps,f=u.colorRamps;if(a&&f&&a.length===f.length&&!f.some((n,i)=>{if(!Fe(a[i].fromColor.toRgb(),new bt(n.fromColor).toRgb())||!Fe(a[i].toColor.toRgb(),new bt(n.toColor).toRgb()))return!0})){if(o)return!0;o=u.id}}),o}function yo(e,t,r=!1){if(!e)return;let o=Gt(e,t);return o!=null||r||(o=Gt(e=go(e),t)),o}function Co(e,t=!1){const r=typeof e=="string"?e:yo(e,void 0,t);return r?mo.toJSON(r):null}function Ko(e,t="esriCIELabAlgorithm"){const r=or.find(({id:o})=>o===e);return r?r.colorRamps?{type:"multipart",colorRamps:r.colorRamps.map(o=>({type:"algorithmic",algorithm:t,fromColor:[...o.fromColor],toColor:[...o.toColor]}))}:{type:"algorithmic",algorithm:t,fromColor:[...r.fromColor],toColor:[...r.toColor]}:null}function nr(e){const t=(e=e||{}).numColors||256,r=e.distanceOffset||0,o=e.isCustomInterval!=null?e.isCustomInterval:e.distanceInterval!==null&&e.distanceInterval!==1/(t-1),u=e.distanceInterval||1/(t-1);return{...e,numColors:t,distanceOffset:r,interpolateAlpha:!!e.interpolateAlpha,distanceInterval:u,isCustomInterval:o,weights:e.weights}}function bo(e,t,r){const{numColors:o,distanceOffset:u,distanceInterval:a,isCustomInterval:f}=r,n=e.s===0,i=t.s===0;let l=e.h,s=t.h;n&&!i?l=s:i&&!n&&(t={...t,h:l},s=l);let c,d=Math.abs(s-l);const C=360;ds?d*a:-d*a);const g=(t.s-e.s)*a,b=(t.v-e.v)*a;let{s:S,v:h}=e,p=l;if(u){const y=u/a;p=(p+y*c+C)%C,S+=y*g,h+=y*b}const m=[];for(let y=0;yC+g);u=u.map(C=>C/d)}else{u=[];for(let d=0;d{u.unshift(a),o||u.pop()}),r}function Bt(e){const t=_e(e);return{type:"HsvColor",Hue:t.h,Saturation:t.s,Value:t.v,AlphaValue:255}}function Ft(e){const t=e.toJSON();return{Algorithm:(t==null?void 0:t.Algorithm)||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",FromColor:Bt(e.fromColor),ToColor:Bt(e.toColor)}}function Jo(e){const t=Co(e);if(!t)return null;if(e.type==="algorithmic")return{...Ft(e),Name:t};if(e.colorRamps){const r=e.colorRamps.map(Ft);return{type:"MultiPartColorRamp",NumColorRamps:r.length,ArrayOfColorRamp:r,Name:t}}return null}function qo(e){const t=e.reverse().map(r=>{const o=r.toString(16);return o.length<2?"0"+o:o});return 4294967295&Number.parseInt(t.join(""),16)}const Yo=new jt({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),ko={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"},Ze=1,Io=[.299,.587,.114];function ar(e,t=256){t=Math.min(t,256);const{size:r,counts:o}=e,u=new Uint8Array(r),a=o.reduce((s,c)=>s+c/t,0);let f=0,n=0,i=0,l=a;for(let s=0;s=i){const w=sr(i,o);for(l=0;l1&&(m-=(1/b)**(S*w[l])),pt[l]){const k=m*b*S**(1/o[l])+f;y[s]=a==="floor"?Math.floor(k):a==="round"?Math.round(k):k}else p>=r[l]?y[s]=n:y[s]=f;else y[s]=f;h[l]=y}}else for(l=0;l=r[l])y[s]=n;else{const w=(p-t[l])*C[l]+f;y[s]=a==="floor"?Math.floor(w):a==="round"?Math.round(w):w}h[l]=y}if(e.contrastOffset!=null){const w=xo(e.contrastOffset,e.brightnessOffset);for(l=0;l0&&r<100?n=(200*f-100*u+2*u*o)/(2*(100-r))+a:r<=0&&r>-100?n=(200*f-100*u+2*u*o)*(100+r)/2e4+a:r===100?(n=200*f-100*u+(u+1)*(100-r)+2*u*o,n=n>0?u:0):r===-100&&(n=a),i[f]=n>u?u:n<0?0:n;return i}function Ao(e,t,r){const o=[];for(let u=0;u=255)return Ze;let t=0;e!==150&&(t=e<=150?45*Math.cos(.01047*e):17*Math.sin(.021*e));const r=255,o=e+t,u=Math.log(e/r),a=Math.log(o/r);if(a===0)return Ze;const f=u/a;return isNaN(f)?Ze:Math.min(9.9,Math.max(.01,f))}function Po(e,t,r,o){let u=1/0,a=-1/0,f=0,n=0,i=0,l=0;const s=e.length,c=new Map,d=[];for(let v=0;vl&&(l=T,i=I),u=Ia?I:a,f+=I,n++}}if(n===0)return{statistics:{min:0,max:0,avg:0,stddev:0,mode:0,median:0},histogram:null};const C=f/n;let g=0;for(let v=0;vv).length:s,S=b<=1?0:Math.sqrt(g/(b-1));d.sort((v,I)=>v-I);const h=n>>>1,p={min:u,max:a,avg:C,stddev:S,mode:i,median:n%2?d[Math.floor(h)]:(d[h-1]+d[h])/2};if(!o)return{statistics:p,histogram:null};if(["u8","s8","u4","u2","u1"].includes(r)){const v=a-u+1,I=new Uint32Array(v);for(let T=0;TPo(f,(u==null?void 0:u[n])??r,o,!0));return{statistics:a.map(({statistics:f})=>f),histograms:a.map(({histogram:f})=>f)}}function Ro(e){var T;if(!((T=e==null?void 0:e.pixels)!=null&&T.length))return null;const{pixels:t,mask:r,bandMasks:o,pixelType:u}=e,a=e.width*e.height,f=t.length;let n,i,l,s,c;const d=[],C=[];let g,b,S,h,p,m,y,w,k,v;const I=256;for(s=0;s[x.minValue,x.maxValue,0,0]);else{const x=Ro(r);f=x!=null?x.statistics:null,n=x!=null?x.histograms:null}else f=(A=e.statistics)!=null&&A.length?e.statistics:a.statistics,n="histograms"in e?e.histograms:void 0,n||(n=a.histograms);i!=="percentClip"&&i!=="histogramEqualization"||n!=null&&n.length||(i="minMax");const l=(f==null?void 0:f.length)||(n==null?void 0:n.length)||a.bandCount,s=[],c=[];let d,C,g,b,S,h,p,m,y;f&&!Array.isArray(f[0])&&(f=f.map(x=>[x.min,x.max,x.avg,x.stddev]));const[w,k]=Cr(a.pixelType);if(!(f!=null&&f.length)){for(f=[],m=0;mE[1]&&(c[m]=E[1])}}break;case"histogramEqualization":for($e(n),m=0;m=20&&(b[0]=b[1]=b[2]=b[b.length-1]=b[b.length-2]=0),g=0,C=(d.max-d.min)/d.size,p=d.min===-.5&&C===1?.5:0,y=0;yh){s[m]=d.min+C*(y+p);break}for(h=(1-(e.maxPercent||0)/100)*g,c[m]=d.max+p,y=d.size-2;y>=0;y--)if(S[y]ar(x)))):(I=e.max||255,v=e.min||0),Mo({minCutOff:s,maxCutOff:c,outMax:I,outMin:v,histogramLut:T},o)}function Mo(e,t){if(t==null||t.length===0)return e;const r=Math.max.apply(null,t),{minCutOff:o,maxCutOff:u,outMin:a,outMax:f,histogramLut:n}=e;return o.length===t.length||o.length<=r?e:{minCutOff:t.map(i=>o[i]),maxCutOff:t.map(i=>u[i]),histogramLut:n?t.map(i=>n[i]):null,outMin:a,outMax:f}}function sr(e,t){const r=new Float32Array(e);for(let o=0;o1?t[o]>2?r[o]=6.5+(t[o]-2)**2.5:r[o]=6.5+100*(2-t[o])**4:r[o]=1;return r}function Qe(e,t){var v;if(!((v=e==null?void 0:e.pixels)!=null&&v.length))return e;const{mask:r,bandMasks:o,width:u,height:a,pixels:f}=e,{minCutOff:n,maxCutOff:i,gamma:l}=t,s=t.outMin||0,c=t.outMax||255,d=u*a,C=t.outputPixelType||"u8",g=e.pixels.map(()=>te.createEmptyBand(C,d)),b=g.length,S=c-s,h=[],p=[];for(let I=0;I=b,w=!!t.isRenderer;if(y){const I=sr(b,l);for(let T=0;T1&&(O-=(1/S)**(P*I[T])),En[T]){const L=O*S*P**(1/l[T])+s;g[T][x]=w?Math.floor(L):m?Math.round(L):L}else E>=i[T]?g[T][x]=c:g[T][x]=s}}}else for(let I=0;In[I]){const E=(x-n[I])*h[I]+s;g[I][A]=w?Math.floor(E):m?Math.round(E):E}else x>=i[I]?g[I][A]=c:g[I][A]=s}}const k=new te({width:u,height:a,mask:r,bandMasks:o,pixels:g,pixelType:C});return k.updateStatistics(),k}function Lo(e){var t,r,o;return["u8","s8"].includes(e.pixelType)&&((r=(t=e.statistics)==null?void 0:t[0])==null?void 0:r.min)!=null&&((o=e.statistics[0])==null?void 0:o.max)!=null&&e.bandCount===1}function Oo(e,t){const{attributeTable:r,bandCount:o}=e;return r==null&&Lo(e)?!0:!(r==null||o>1||t&&r.fields.find(u=>u.name.toLowerCase()===t.toLowerCase())==null)}function Do(e){const{bandCount:t,dataType:r,pixelType:o}=e;return r==="elevation"||r==="generic"&&t===1&&(o==="s16"||o==="s32"||o==="f32"||o==="f64")}function Uo(e,t=!1){const{bandCount:r,colormap:o,pixelType:u}=e;return r===1&&(!!(o!=null&&o.length)||!t&&u==="u8")}function Qo(e,t=!1){const{attributeTable:r,bandCount:o}=e;return o===1&&(!t||r!=null||e.histograms!=null)}function en(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function tn(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}let we=class extends De{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e==null?void 0:e.pixelBlock;if(!Vt(t))return t;if(e.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands([0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const o=e.extent,u=o.spatialReference.isGeographic,a={x:(o.xmax-o.xmin)/t.width,y:(o.ymax-o.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:u,resolution:a});break}}return r}catch(r){return wt.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!Vt(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),Qe(e,{...t,isRenderer:!0})}catch(r){return wt.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:f,offset:n}=this.lookup.colormapLut||{};return{colormap:f,colormapOffset:n,type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:o,bandIds:u}=e,{rendererJSON:a}=this;return a.type==="rasterStretch"?this._generateStretchWebGLParams(t,a,u):a.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(a,r,o??void 0):a.type==="vectorField"?this._generateVectorFieldWebGLParams(a):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){return this._isLUTChanged()&&!this.bind().success?e:Je(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:t?Je(e,this.lookup.colormapLut):br(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){var c,d;const{rasterInfo:r}=this,{pixelType:o,bandCount:u}=r,a=this.rendererJSON,f=["u8","u16","s8","s16"].includes(o);let n,i;const{dra:l}=a,{gamma:s}=this.lookup;if(a.stretchType==="histogramEqualization"){const C=l?null:(c=this.lookup)==null?void 0:c.histogramLut,g=Le(a,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!C}),b=Qe(e,{...g,gamma:s,isRenderer:!0});i=vt(b,{lut:l?g.histogramLut:C,offset:0})}else if(f){if(l){const C=Le(a,{rasterInfo:r,pixelBlock:e,bandIds:t});n=$t({pixelType:o,...C,gamma:s,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;n=this.lookup?this.lookup.stretchLut:null}else n=this.lookup?this.lookup.stretchLut:null;if(!n)return e;u>1&&t!=null&&t.length===(e==null?void 0:e.pixels.length)&&(n==null?void 0:n.lut.length)===u&&(n={lut:t.map(C=>n.lut[C]),offset:n.offset}),i=vt(e,n)}else{const C=Le(a,{rasterInfo:r,pixelBlock:e,bandIds:t});i=Qe(e,{...C,gamma:s,isRenderer:!0})}if(a.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;i=Je(i,(d=this.lookup)==null?void 0:d.colormapLut)}return i}_symbolizeShadedRelief(e,t){var n;const r=this.rendererJSON,o={...r,...t},u=fo(e,o);if(!r.colorRamp)return u;let a;if(this._isLUTChanged(!0)){if(!this.bind().success)return u;a=this.lookup?this.lookup.hsvMap:null}else a=this.lookup?this.lookup.hsvMap:null;if(!a)return u;const f=((n=this.rasterInfo.statistics)==null?void 0:n[0])??{min:0,max:8e3};return po(u,e,a,f),u}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return e===2&&(t==="vector-magdir"||t==="vector-uv")}_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(e){var l;const{bandCount:t,attributeTable:r,pixelType:o}=this.rasterInfo,u=e.field1;if(!u)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const a=e.defaultSymbol,f=t===1&&["u8","s8"].includes(o);if(!Oo(this.rasterInfo,u)&&!f)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const n=[];if(r!=null){const s=r.fields.find(c=>c.name.toLowerCase()==="value");if(!s)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(c=>{var g,b;const d=(g=e.uniqueValueInfos)==null?void 0:g.find(S=>String(S.value)===String(c.attributes[u])),C=(b=d==null?void 0:d.symbol)==null?void 0:b.color;C?n.push([c.attributes[s.name]].concat(C)):a&&n.push([c.attributes[s.name]].concat(a.color))})}else{if(u.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};(l=e.uniqueValueInfos)==null||l.forEach(s=>{var d;const c=(d=s==null?void 0:s.symbol)==null?void 0:d.color;c?n.push([parseInt(""+s.value,10)].concat(c)):a&&n.push([parseInt(""+s.value,10)].concat(a==null?void 0:a.color))})}if(n.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const i=Re({colormap:n});return this.lookup={rendererJSON:e,colormapLut:i},this.canRenderInWebGL=this._isColormapSupportedByWebGL(i==null?void 0:i.indexedColormap),{success:!0}}_updateColormapRenderer(e){if(!Uo(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(o=>[o.value].concat(o.color)).sort((o,u)=>o[0]-u[0]);if(!t||t.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=Re({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=this._isColormapSupportedByWebGL(r==null?void 0:r.indexedColormap),{success:!0}}_updateShadedReliefRenderer(e){if(!Do(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const t=Nt(e.colorRamp,{interpolateAlpha:!0}),r=Re({colormap:t}),o=[],u=r.indexedColormap;for(let a=0;af.name.toLowerCase()==="value"):null,u=t!=null?t.fields.find(f=>f.name.toLowerCase()===e.field.toLowerCase()):null,a=o!=null&&u!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||a,tableValueField:o,tableBreakField:u}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:o,tableBreakField:u}=this._analyzeClassBreaks(e),a=e.classBreakInfos;if(!(a!=null&&a.length))return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const f=a.sort((c,d)=>c.classMaxValue-d.classMaxValue),n=f[f.length-1];let i=e.minValue;if(!r){const c=[];for(let d=0;dm>h);p&&l.push([S].concat(p.symbol.color))}}else{i=Math.floor(e.minValue);for(let c=0;c0&&e[0].min!=null&&e[0].max!=null}_updateStretchRenderer(e){var s,c;let{stretchType:t,dra:r}=e;if(!(t==="none"||(s=e.statistics)!=null&&s.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const o=e.histograms||this.rasterInfo.histograms;!this._isHistogramRequired(e.stretchType)||o!=null&&o.length||r||(t="minMax");const{computeGamma:u,useGamma:a,colorRamp:f}=e;let{gamma:n}=e;if(a&&u&&!(n!=null&&n.length)){const d=(c=e.statistics)!=null&&c.length?e.statistics:this.rasterInfo.statistics;n=Ao(this.rasterInfo.pixelType,d)}const i=this.rasterInfo.pixelType,l=!r&&["u8","u16","s8","s16"].includes(i);if(t==="histogramEqualization"){const d=o.map(C=>ar(C));this.lookup={rendererJSON:e,histogramLut:d}}else if(l){const d=Le(e,{rasterInfo:this.rasterInfo}),C=$t({pixelType:i,...d,gamma:a?n:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:C}}if(f&&!this._isStretchColorRampNoop(f)){const d=Nt(f,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=Re({colormap:d}),this.lookup.rendererJSON=e}return this.lookup.gamma=a&&(n!=null&&n.length)?n:null,this.canRenderInWebGL=!0,{success:!0}}_isStretchColorRampNoop(e){return e.type==="algorithmic"&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}_generateStretchWebGLParams(e,t,r){var m;let o=null,u=null;const a=(m=this.lookup)==null?void 0:m.colormapLut;t.colorRamp&&a&&(o=a.indexedColormap,u=a.offset),t.stretchType==="histogramEqualization"&&(t={...t,stretchType:"minMax"});const{gamma:f}=this.lookup,n=!!(t.useGamma&&f&&f.some(y=>y!==1)),{minCutOff:i,maxCutOff:l,outMin:s,outMax:c}=Le(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let d=0;e!=null&&(d=e.getPlaneCount(),d===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:C}=this.rasterInfo,g=Math.min(3,(r==null?void 0:r.length)||d||C,C),b=new Float32Array(g),S=o||n?1:255;let h;for(h=0;h1?f[h]>2?p[h]=6.5+(f[h]-2)**2.5:p[h]=6.5+100*(2-f[h])**4:p[h]=1;return{bandCount:g,outMin:s/S,outMax:c/S,minCutOff:i,maxCutOff:l,factor:b,useGamma:n,gamma:n?f:[1,1,1],gammaCorrection:n?p:[1,1,1],colormap:o,colormapOffset:u,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){var l,s;let o=null,u=null;const a=(l=this.lookup)==null?void 0:l.colormapLut;e.colorRamp&&a&&(o=a.indexedColormap,u=a.offset);const f={...e,isGCS:t,resolution:r},n=rr(f),i=(s=this.rasterInfo.statistics)==null?void 0:s[0];return{...n,minValue:(i==null?void 0:i.min)??0,maxValue:(i==null?void 0:i.max)??8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:o,colormapOffset:u}}_generateVectorFieldWebGLParams(e){var h,p,m;const{style:t,inputUnit:r,outputUnit:o,visualVariables:u,symbolTileSize:a,flowRepresentation:f}=e;let n;const i=((h=this.rasterInfo.statistics)==null?void 0:h[0].min)??0,l=((p=this.rasterInfo.statistics)==null?void 0:p[0].max)??50,s=(u==null?void 0:u.find(y=>y.type==="sizeInfo"))??{type:"sizeInfo",field:"Magnitude",maxDataValue:l,maxSize:.8*a,minDataValue:i,minSize:.2*a},c=s.minDataValue??i,d=s.maxDataValue??l,C=s.maxSize!=null&&s.minSize!=null?[s.minSize/a,s.maxSize/a]:[.2,.8];if(t==="wind_speed"){const y=(C[0]+C[1])/2;C[0]=C[1]=y}const g=c!=null&&d!=null?[c,d]:null;if(t==="classified_arrow")if(c!=null&&d!=null&&s!=null){n=[];const y=(s.maxDataValue-s.minDataValue)/5;for(let w=0;w<6;w++)n.push(s.minDataValue+y*w)}else n=[0,1e-6,3.5,7,10.5,14];const b=f==="flow_to"==(t==="ocean_current_kn"||t==="ocean_current_m")?0:Math.PI,S=u==null?void 0:u.find(y=>y.type==="rotationInfo");return{breakValues:n,dataRange:g,inputUnit:r,outputUnit:o,symbolTileSize:a,symbolPercentRange:C,style:t||"single_arrow",rotation:b,rotationType:(m=this.rasterInfo.storageInfo)!=null&&m.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":(S==null?void 0:S.rotationType)||e.rotationType,type:"vectorField"}}};function Vt(e){return Se(e)&&e.validPixelCount!==0}D([N({json:{write:!0}})],we.prototype,"rendererJSON",void 0),D([N({type:ho,json:{write:!0}})],we.prototype,"rasterInfo",void 0),D([N({json:{write:!0}})],we.prototype,"lookup",void 0),D([N()],we.prototype,"canRenderInWebGL",void 0),we=D([Oe("esri.renderers.support.RasterSymbolizer")],we);const rn=we;export{qo as A,Wr as B,Ho as C,We as D,xe as E,zr as F,Jo as G,Wo as H,jo as I,Le as J,$t as K,rn as L,Qe as M,Zt as N,sr as O,Vo as P,gt as R,Xt as U,ho as a,pt as b,Ae as c,Vr as d,Nt as e,Yo as f,Zo as g,Ro as h,ko as i,_o as j,or as k,Qo as l,Xo as m,co as n,en as o,Do as p,tn as q,Pr as r,Co as s,Oo as t,Uo as u,zo as v,mo as w,To as x,Ko as y,xo as z};