UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

1 lines • 160 kB
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1427],{4095:(t,e,r)=>{r.d(e,{CW:()=>u});var n=r(44208),o=r(53966),i=(r(34727),r(74887)),s=r(87811);r(5443),r(21325);const a=()=>o.A.getLogger("esri.views.2d.engine.flow.dataUtils"),l=10;async function u(t,e,r,o){const u=performance.now(),c=function(t,e){const r=function(t,e,r,n){if(0===n)return t;const o=Math.round(3*n),i=new Array(2*o+1);let s=0;for(let t=-o;t<=o;t++){const e=Math.exp(-t*t/(n*n));i[t+o]=e,s+=e}for(let t=-o;t<=o;t++)i[t+o]/=s;const a=new Float32Array(t.length);for(let n=0;n<r;n++)for(let r=0;r<e;r++){let s=0,l=0;for(let a=-o;a<=o;a++){if(r+a<0||r+a>=e)continue;const u=i[a+o];s+=u*t[2*(n*e+(r+a))],l+=u*t[2*(n*e+(r+a))+1]}a[2*(n*e+r)]=s,a[2*(n*e+r)+1]=l}const l=new Float32Array(t.length);for(let t=0;t<e;t++)for(let n=0;n<r;n++){let s=0,u=0;for(let l=-o;l<=o;l++){if(n+l<0||n+l>=r)continue;const c=i[l+o];s+=c*a[2*((n+l)*e+t)],u+=c*a[2*((n+l)*e+t)+1]}l[2*(n*e+t)]=s,l[2*(n*e+t)+1]=u}return l}(e.data,e.width,e.height,t.smoothing);return t.interpolate?(t,n)=>{const o=Math.floor(t),i=Math.floor(n);if(o<0||o>=e.width)return[0,0];if(i<0||i>=e.height)return[0,0];const s=t-o,a=n-i,l=o,u=i,c=o<e.width-1?o+1:o,h=i<e.height-1?i+1:i,f=r[2*(u*e.width+l)],p=r[2*(u*e.width+c)],d=r[2*(h*e.width+l)],m=r[2*(h*e.width+c)],g=r[2*(u*e.width+l)+1],y=r[2*(u*e.width+c)+1];return[(f*(1-a)+d*a)*(1-s)+(p*(1-a)+m*a)*s,(g*(1-a)+r[2*(h*e.width+l)+1]*a)*(1-s)+(y*(1-a)+r[2*(h*e.width+c)+1]*a)*s]}:(t,n)=>{const o=Math.round(t),i=Math.round(n);return o<0||o>=e.width||i<0||i>=e.height?[0,0]:[r[2*(i*e.width+o)],r[2*(i*e.width+o)+1]]}}(e,r),f=performance.now(),p=h(e,c,r.width,r.height),d=performance.now(),m=function(t){const e=new s.A,r=t.reduce(((t,e)=>t+e.length),0),n=new Float32Array(4*r),o=new Array(t.length);let i=0,a=0;for(const r of t){const t=i;for(const t of r)n[4*i]=t.x,n[4*i+1]=t.y,n[4*i+2]=t.t,n[4*i+3]=t.speed,i++;o[a++]={startVertex:t,numberOfVertices:r.length,totalTime:r[r.length-1].t,timeSeed:e.getFloat()}}return{lineVertices:n,lineDescriptors:o}}(p),g=performance.now(),y="Streamlines"===t?function(t,e){const{lineVertices:r,lineDescriptors:n}=t;let o=0,i=0;for(const t of n)o+=2*t.numberOfVertices,i+=6*(t.numberOfVertices-1);const s=new Float32Array(9*o),a=new Uint32Array(i);let l=0,u=0;function c(){a[u++]=l-2,a[u++]=l,a[u++]=l-1,a[u++]=l,a[u++]=l+1,a[u++]=l-1}function h(t,e,r,n,o,i,a,u){const c=9*l;let h=0;s[c+h++]=t,s[c+h++]=e,s[c+h++]=1,s[c+h++]=r,s[c+h++]=i,s[c+h++]=a,s[c+h++]=n/2,s[c+h++]=o/2,s[c+h++]=u,l++,s[c+h++]=t,s[c+h++]=e,s[c+h++]=-1,s[c+h++]=r,s[c+h++]=i,s[c+h++]=a,s[c+h++]=-n/2,s[c+h++]=-o/2,s[c+h++]=u,l++}for(const t of n){const{totalTime:n,timeSeed:o}=t;let i=null,s=null,a=null,l=null,u=null,f=null;for(let p=0;p<t.numberOfVertices;p++){const d=r[4*(t.startVertex+p)],m=r[4*(t.startVertex+p)+1],g=r[4*(t.startVertex+p)+2],y=r[4*(t.startVertex+p)+3];let w=null,b=null,C=null,v=null;if(p>0){w=d-i,b=m-s;const t=Math.sqrt(w*w+b*b);if(w/=t,b/=t,p>1){let t=w+u,r=b+f;const n=Math.sqrt(t*t+r*r);t/=n,r/=n;const o=Math.min(1/(t*w+r*b),e);t*=o,r*=o,C=-r,v=t}else C=-b,v=w;null!==C&&null!==v&&(h(i,s,a,C,v,n,o,y),c())}i=d,s=m,a=g,u=w,f=b,l=y}h(i,s,a,-f,u,n,o,l)}return{vertexData:s,indexData:a}}(m,l):function(t){const{lineVertices:e,lineDescriptors:r}=t;let n=0,o=0;for(const t of r){const e=t.numberOfVertices-1;n+=4*e*2,o+=6*e*2}const i=new Float32Array(16*n),s=new Uint32Array(o);let a,l,u,c,h,f,p,d,m,g,y,w,b,C,v=0,x=0;function A(){s[x++]=v-8,s[x++]=v-7,s[x++]=v-6,s[x++]=v-7,s[x++]=v-5,s[x++]=v-6,s[x++]=v-4,s[x++]=v-3,s[x++]=v-2,s[x++]=v-3,s[x++]=v-1,s[x++]=v-2}function k(t,e,r,n,o,s,a,l,u,c,h,f,p,d){const m=16*v;let g=0;for(const y of[1,2])for(const w of[1,2,3,4])i[m+g++]=t,i[m+g++]=e,i[m+g++]=r,i[m+g++]=n,i[m+g++]=a,i[m+g++]=l,i[m+g++]=u,i[m+g++]=c,i[m+g++]=y,i[m+g++]=w,i[m+g++]=p,i[m+g++]=d,i[m+g++]=o/2,i[m+g++]=s/2,i[m+g++]=h/2,i[m+g++]=f/2,v++}function M(t,e){let r=m+y,n=g+w;const o=Math.sqrt(r*r+n*n);r/=o,n/=o;const i=m*r+g*n;r/=i,n/=i;let s=y+b,v=w+C;const x=Math.sqrt(s*s+v*v);s/=x,v/=x;const M=y*s+w*v;s/=M,v/=M,k(a,l,u,c,-n,r,h,f,p,d,-v,s,t,e),A()}function S(t,e,r,n,o,i){if(m=y,g=w,y=b,w=C,null==m&&null==g&&(m=y,g=w),null!=h&&null!=f){b=t-h,C=e-f;const r=Math.sqrt(b*b+C*C);b/=r,C/=r}null!=m&&null!=g&&M(o,i),a=h,l=f,u=p,c=d,h=t,f=e,p=r,d=n}function T(t,e){m=y,g=w,y=b,w=C,null==m&&null==g&&(m=y,g=w),null!=m&&null!=g&&M(t,e)}for(const t of r){a=null,l=null,u=null,c=null,h=null,f=null,p=null,d=null,m=null,g=null,y=null,w=null,b=null,C=null;const{totalTime:r,timeSeed:n}=t;for(let o=0;o<t.numberOfVertices;o++)S(e[4*(t.startVertex+o)],e[4*(t.startVertex+o)+1],e[4*(t.startVertex+o)+2],e[4*(t.startVertex+o)+3],r,n);T(r,n)}return{vertexData:i,indexData:s}}(m),w=performance.now();return(0,n.A)("esri-2d-profiler")&&(a().info("I.1","_createFlowFieldFromData (ms)",Math.round(f-u)),a().info("I.2","_getStreamlines (ms)",Math.round(d-f)),a().info("I.3","createAnimatedLinesData (ms)",Math.round(g-d)),a().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(w-g)),a().info("I.5","createFlowMesh (ms)",Math.round(w-u)),a().info("I.6","Mesh size (bytes)",y.vertexData.buffer.byteLength+y.indexData.buffer.byteLength)),await Promise.resolve(),(0,i.Te)(o),y}function c(t,e,r,n,o,i,s,a,l){const u=[];let c=r,h=n,f=0,[p,d]=e(c,h);p*=t.velocityScale,d*=t.velocityScale;const m=Math.sqrt(p*p+d*d);let g,y;u.push({x:c,y:h,t:f,speed:m});for(let r=0;r<t.verticesPerLine;r++){let[r,n]=e(c,h);r*=t.velocityScale,n*=t.velocityScale;const p=Math.sqrt(r*r+n*n);if(p<t.minSpeedThreshold)return u;const d=r/p,m=n/p;if(c+=d*t.segmentLength,h+=m*t.segmentLength,f+=t.segmentLength/p,Math.acos(d*g+m*y)>t.maxTurnAngle)return u;if(t.collisions){const t=Math.round(c*l),e=Math.round(h*l);if(t<0||t>s-1||e<0||e>a-1)return u;const r=i[e*s+t];if(-1!==r&&r!==o)return u;i[e*s+t]=o}u.push({x:c,y:h,t:f,speed:p}),g=d,y=m}return u}function h(t,e,r,n){const o=[],i=new s.A,a=1/Math.max(t.lineCollisionWidth,1),l=Math.round(r*a),u=Math.round(n*a),h=new Int32Array(l*u);for(let t=0;t<h.length;t++)h[t]=-1;const f=[];for(let e=0;e<n;e+=t.lineSpacing)for(let n=0;n<r;n+=t.lineSpacing)f.push({x:n,y:e,sort:i.getFloat()});f.sort(((t,e)=>t.sort-e.sort));for(const{x:r,y:n}of f)if(i.getFloat()<t.density){const i=c(t,e,r,n,o.length,h,l,u,a);if(i.length<2)continue;o.push(i)}return o}},4151:(t,e,r)=>{r.d(e,{z:()=>n});class n{constructor(t=null,e=null,r=null){this.minValue=t,this.maxValue=e,this.noDataValue=r}}},6952:(t,e,r)=>{r.d(e,{DP:()=>w,Nh:()=>b,Pg:()=>y,RP:()=>h,WF:()=>c,_N:()=>C,eH:()=>m,f4:()=>g,fP:()=>p,zj:()=>f,zt:()=>u});var n=r(97768),o=r(14140),i=r(16019),s=r(70274);const a=1,l=[.299,.587,.114];function u(t){if(null==t)return!1;const{max:e,min:r,size:n}=t;return(e-r)/n===1&&r>=-.5&&.5===Math.abs(r%1)&&e<=255.5}function c(t,e=256){e=Math.min(e,256);const{size:r,counts:n}=t,o=new Float64Array(r);o[0]=n[0]/e;for(let t=1;t<r;t++)o[t]=o[t-1]+n[t]/e;const i=new Uint8Array(e),s=e/o[o.length-1];if(r<=e){const n=u(t)?Math.max(0,Math.round(t.min+.5)):0;for(let t=n;t<e;t++)i[t]=t>=r+n?255:Math.min(255,Math.trunc(o[t-n]*s))}else{const t=o.map((t=>Math.min(255,Math.trunc(t*s))));for(let n=0;n<e;n++)i[n]=t[Math.round(r/e)];i[e-1]=255}return i}function h(t){const{minCutOff:e,maxCutOff:r,gamma:n,pixelType:o,rounding:i}=t;if(!["u8","u16","s8","s16"].includes(o))return null;const s=e.length,a="s8"===o?-127:"s16"===o?-32767:0,l=["u16","s16"].includes(o)?65536:256,u=[],c=[],{minOutput:h=0,maxOutput:p=255}=t,d=p-h;for(let t=0;t<s;t++)c[t]=r[t]-e[t],u[t]=0===c[t]?0:d/c[t];const m=[];if(n&&n.length>=s){const t=b(s,n);for(let o=0;o<s;o++){const s=[];for(let u=0;u<l;u++){if(0===c[o]){s[u]=h;continue}const l=u+a,f=(l-e[o])/c[o];let m=1;if(n[o]>1&&(m-=(1/d)**(f*t[o])),l<r[o]&&l>e[o]){const t=m*d*f**(1/n[o])+h;s[u]="floor"===i?Math.floor(t):"round"===i?Math.round(t):t}else l>=r[o]?s[u]=p:s[u]=h}m[o]=s}}else for(let t=0;t<s;t++){const n=[];for(let o=0;o<l;o++){const s=o+a;if(s<=e[t])n[o]=h;else if(s>=r[t])n[o]=p;else{const r=(s-e[t])*u[t]+h;n[o]="floor"===i?Math.floor(r):"round"===i?Math.round(r):r}}m[t]=n}if(null!=t.contrastOffset){const e=f(t.contrastOffset,t.brightnessOffset);for(let t=0;t<s;t++){const r=m[t];for(let t=0;t<l;t++)r[t]=e[r[t]]}}return{lut:m,offset:a}}function f(t,e){const r=Math.min(Math.max(t,-100),100),n=Math.min(Math.max(e??0,-100),100),o=new Uint8Array(256);for(let t=0;t<256;t++){let e=0;r>0&&r<100?e=(200*t-25500+510*n)/(2*(100-r))+128:r<=0&&r>-100?e=(200*t-25500+510*n)*(100+r)/2e4+128:100===r?(e=200*t-25500+256*(100-r)+510*n,e=e>0?255:0):-100===r&&(e=128),o[t]=e>255?255:e<0?0:e}return o}function p(t,e,r){const n=[];for(let o=0;o<e.length;o++){let i=0,s=0,a=0;"min"in e[o]?({min:i,max:s,avg:a}=e[o]):[i,s,a]=e[o];let u=a??0;"u8"!==t&&(u=255*(u-i)/(s-i)),r&&(u*=l[o]),n.push(d(u))}return n}function d(t){if(t<=0||t>=255)return a;const e=t+(150===t?0:t<150?45*Math.cos(.01047*t):17*Math.sin(.021*t)),r=Math.log(t/255),n=Math.log(e/255);if(0===n)return a;const o=r/n;return isNaN(o)?a:Math.min(9.9,Math.max(.01,o))}function m(t){const{pixels:e,mask:r,pixelType:n,bandMasks:o}=t,i=e.map(((t,e)=>function(t,e,r){let n=1/0,o=-1/0,i=0,s=0,a=0,l=0;const u=t.length,c=new Map,h=[];for(let r=0;r<u;r++){const u=t[r];if(!e||e[r]){h.push(u);const t=(c.get(u)??0)+1;c.set(u,t),t>l&&(l=t,a=u),n=u<n?u:n,o=u>o?u:o,i+=u,s++}}if(0===s)return{statistics:{min:0,max:0,avg:0,stddev:0,mode:0,median:0},histogram:null};const f=i/s;let p=0;for(let r=0;r<u;r++)e&&!e[r]||(p+=(t[r]-f)**2);const d=e?e.filter((t=>t)).length:u,m=d<=1?0:Math.sqrt(p/(d-1));h.sort(((t,e)=>t-e));const g=s>>>1,y={min:n,max:o,avg:f,stddev:m,mode:a,median:s%2?h[Math.floor(g)]:(h[g-1]+h[g])/2};if(["u8","s8","u4","u2","u1"].includes(r)){const r=o-n+1,i=new Uint32Array(r);for(let r=0;r<u;r++)e&&!e[r]||i[t[r]-n]++;return{statistics:y,histogram:{min:n-.5,max:o+.5,size:r,counts:i}}}const w=256,b=new Uint32Array(w),C=(o-n)/w;if(0===C)return{statistics:y,histogram:{min:n,max:o,size:1,counts:new Uint32Array(1).fill(s)}};const v=new Uint32Array(257);for(let r=0;r<u;r++)e&&!e[r]||v[Math.floor((t[r]-n)/C)]++;for(let t=0;t<255;t++)b[t]=v[t];return b[255]=v[255]+v[w],{statistics:y,histogram:{min:n,max:o,size:w,counts:b}}}(t,o?.[e]??r,n)));return{statistics:i.map((({statistics:t})=>t)),histograms:i.map((({histogram:t})=>t))}}function g(t){if(!t?.pixels?.length)return null;const{pixels:e,mask:r,bandMasks:n,pixelType:o}=t,i=t.width*t.height,s=e.length,a=[],l=[],u=256;let c,h;for(let f=0;f<s;f++){let s=new Uint32Array(u);const p=e[f],d=n?.[f]??r;if("u8"===o){if(c=255,h=0,d){for(let t=0;t<i;t++)if(d[t]){const e=p[t];c=e<c?e:c,h=e>h?e:h,s[e]++}}else for(let t=0;t<i;t++){const e=p[t];c=e<c?e:c,h=e>h?e:h,s[e]++}s=s.slice(c,h+1)}else{let e=!1;t.statistics||(t.updateStatistics(),e=!0);const r=t.statistics;c=r[f].minValue,h=r[f].maxValue;const n=(h-c)/u;if(0===n){!r||t.validPixelCount||e||t.updateStatistics();const n=(t.validPixelCount||t.width*t.height)/u;for(let t=0;t<u;t++)s[t]=Math.round(n*(t+1))-Math.round(n*t)}else{const t=new Uint32Array(257);for(let e=0;e<i;e++)d&&!d[e]||t[Math.floor((p[e]-c)/n)]++;for(let e=0;e<255;e++)s[e]=t[e];s[255]=t[255]+t[u]}}const m="u8"===o?c-.5:c,g="u8"===o?h+.5:h;a.push({min:m,max:g,size:s.length,counts:s});let y=0,w=0,b=0;for(let t=0;t<s.length;t++)y+=s[t],w+=t*s[t];const C=w/y;for(let t=0;t<s.length;t++)b+=s[t]*(t-C)**2;const v=Math.sqrt(b/(y-1)),x=(g-m)/s.length,A=(C+("u8"===o?0:.5))*x+c,k=v*x;l.push({min:c,max:h,avg:A,stddev:k})}return{statistics:l,histograms:a}}function y(t){const e=[];for(let r=0;r<t.length;r++){const{min:n,max:o,size:i,counts:s}=t[r];let a=0,l=0;for(let t=0;t<i;t++)a+=s[t],l+=t*s[t];const u=l/a;let c=0;for(let t=0;t<i;t++)c+=s[t]*(t-u)**2;const h=(o-n)/i,f=(u+.5)*h+n,p=Math.sqrt(c/(a-1))*h;e.push({min:n,max:o,avg:f,stddev:p})}return e}function w(t,e){const{pixelBlock:r,bandIds:o,returnHistogramLut:a,rasterInfo:l}=e;let u=null,h=null,f=t.stretchType;if("number"==typeof f&&(f=s.x[f]),t.dra)if("minMax"===f&&r?.statistics)u=r.statistics.map((t=>[t.minValue,t.maxValue,0,0]));else{const t=g(r);u=null!=t?t.statistics:null,h=null!=t?t.histograms:null}else u=t.statistics?.length?t.statistics:l.statistics,h="histograms"in t?t.histograms:void 0,h||(h=l.histograms);"percentClip"!==f&&"histogramEqualization"!==f||h?.length||(f="minMax");const p=u?.length||h?.length||l.bandCount,d=[],m=[];u&&!Array.isArray(u[0])&&(u=u.map((t=>[t.min,t.max,t.avg,t.stddev])));const[y,w]=(0,i.hP)(l.pixelType);if(!u?.length){u=[];for(let t=0;t<p;t++)u.push([y,w,1,1]);"standardDeviation"===f&&(f="minMax")}switch(f){case"none":for(let t=0;t<p;t++)d[t]=y,m[t]=w;break;case"minMax":for(let t=0;t<p;t++){const e=u[t];d[t]=e[0],m[t]=e[1]}break;case"standardDeviation":{const{numberOfStandardDeviations:e=2}=t;for(let t=0;t<p;t++){const r=u[t];d[t]=r[2]-e*r[3],m[t]=r[2]+e*r[3],d[t]<r[0]&&(d[t]=r[0]),m[t]>r[1]&&(m[t]=r[1])}}break;case"histogramEqualization":(0,n.Lw)(h);for(let t=0;t<p;t++)d[t]=h[t].min,m[t]=h[t].max;break;case"percentClip":(0,n.Lw)(h);for(let e=0;e<h.length;e++){const r=h[e],n=new Uint32Array(r.size),o=[...r.counts];o.length>=20&&(o[0]=o[1]=o[2]=o[o.length-1]=o[o.length-2]=0);let i=0;const s=(r.max-r.min)/r.size,a=-.5===r.min&&1===s?.5:0;for(let t=0;t<r.size;t++)i+=o[t],n[t]=i;let l=(t.minPercent||0)*i/100;d[e]=r.min+a;for(let t=0;t<r.size;t++)if(n[t]>l){d[e]=r.min+s*(t+a);break}l=(1-(t.maxPercent||0)/100)*i,m[e]=r.max+a;for(let t=r.size-2;t>=0;t--)if(n[t]<l){m[e]=r.min+s*(t+2-a);break}if(m[e]<d[e]){const t=d[e];d[e]=m[e],m[e]=t}}break;default:for(let t=0;t<p;t++){const e=u[t];d[t]=e[0],m[t]=e[1]}}let b,C,v;return"histogramEqualization"===f?((0,n.Lw)(h),C=h[0].size||256,b=0,a&&(v=h.map((t=>c(t))))):(C=t.max||255,b=t.min||0),function(t,e){if(null==e||0===e.length)return t;const r=Math.max.apply(null,e),{minCutOff:n,maxCutOff:o,minOutput:i,maxOutput:s,histogramLut:a}=t;return n.length===e.length||n.length<=r?t:{minCutOff:e.map((t=>n[t])),maxCutOff:e.map((t=>o[t])),histogramLut:a?e.map((t=>a[t])):null,minOutput:i,maxOutput:s}}({minCutOff:d,maxCutOff:m,maxOutput:C,minOutput:b,histogramLut:v},o)}function b(t,e){const r=new Float32Array(t);for(let n=0;n<t;n++)e[n]>1?e[n]>2?r[n]=6.5+(e[n]-2)**2.5:r[n]=6.5+100*(2-e[n])**4:r[n]=1;return r}function C(t,e){if(!t?.pixels?.length)return t;const{mask:r,bandMasks:n,width:i,height:s,pixels:a}=t,{minCutOff:l,maxCutOff:u,minOutput:c,maxOutput:h,gamma:f}=e,p=i*s,d=e.outputPixelType||"u8",m=t.pixels.map((()=>o.A.createEmptyBand(d,p))),g=m.length,y=h-c,w=[],C=[];for(let t=0;t<g;t++)C[t]=u[t]-l[t],w[t]=0===C[t]?0:y/C[t];const v=d.startsWith("u")||d.startsWith("s"),x=f&&f.length>=g,A=!!e.isRenderer;if(x){const t=b(g,f);for(let e=0;e<g;e++){const o=n?.[e]??r;for(let r=0;r<p;r++)if(null==o||o[r]){if(0===C[e]){m[e][r]=c;continue}const n=a[e][r],o=(n-l[e])/C[e];let i=1;if(f[e]>1&&(i-=(1/y)**(o*t[e])),n<u[e]&&n>l[e]){const t=i*y*o**(1/f[e])+c;m[e][r]=A?Math.floor(t):v?Math.round(t):t}else n>=u[e]?m[e][r]=h:m[e][r]=c}}}else for(let t=0;t<g;t++){const e=n?.[t]??r;for(let r=0;r<p;r++)if(null==e||e[r]){const e=a[t][r];if(e<u[t]&&e>l[t]){const n=(e-l[t])*w[t]+c;m[t][r]=A?Math.floor(n):v?Math.round(n):n}else e>=u[t]?m[t][r]=h:m[t][r]=c}}const k=new o.A({width:i,height:s,mask:r,bandMasks:n,pixels:m,pixelType:d});return k.updateStatistics(),k}},11053:(t,e,r)=>{r.d(e,{c:()=>n,g:()=>o});var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}},12196:(t,e,r)=>{r.d(e,{NB:()=>n,RR:()=>a,YC:()=>i,kq:()=>s});const n=(()=>{const t=[];return t[254]="NEWSUBFILETYPE",t[255]="SUBFILETYPE",t[256]="IMAGEWIDTH",t[257]="IMAGELENGTH",t[258]="BITSPERSAMPLE",t[259]="COMPRESSION",t[262]="PHOTOMETRICINTERPRETATION",t[263]="THRESHHOLDING",t[264]="CELLWIDTH",t[265]="CELLLENGTH",t[266]="FILLORDER",t[269]="DOCUMENTNAME",t[270]="IMAGEDESCRIPTION",t[271]="MAKE",t[272]="MODEL",t[273]="STRIPOFFSETS",t[274]="ORIENTATION",t[277]="SAMPLESPERPIXEL",t[278]="ROWSPERSTRIP",t[279]="STRIPBYTECOUNTS",t[280]="MINSAMPLEVALUE",t[281]="MAXSAMPLEVALUE",t[282]="XRESOLUTION",t[283]="YRESOLUTION",t[284]="PLANARCONFIGURATION",t[285]="PAGENAME",t[286]="XPOSITION",t[287]="YPOSITION",t[288]="FREEOFFSETS",t[289]="FREEBYTECOUNTS",t[290]="GRAYRESPONSEUNIT",t[291]="GRAYRESPONSECURVE",t[292]="T4OPTIONS",t[293]="T6OPTIONS",t[296]="RESOLUTIONUNIT",t[297]="PAGENUMBER",t[300]="COLORRESPONSEUNIT",t[301]="TRANSFERFUNCTION",t[305]="SOFTWARE",t[306]="DATETIME",t[315]="ARTIST",t[316]="HOSTCOMPUTER",t[317]="PREDICTOR",t[318]="WHITEPOINT",t[319]="PRIMARYCHROMATICITIES",t[320]="COLORMAP",t[321]="HALFTONEHINTS",t[322]="TILEWIDTH",t[323]="TILELENGTH",t[324]="TILEOFFSETS",t[325]="TILEBYTECOUNTS",t[326]="BADFAXLINES",t[327]="CLEANFAXDATA",t[328]="CONSECUTIVEBADFAXLINES",t[330]="SUBIFD",t[332]="INKSET",t[333]="INKNAMES",t[334]="NUMBEROFINKS",t[336]="DOTRANGE",t[337]="TARGETPRINTER",t[338]="EXTRASAMPLES",t[339]="SAMPLEFORMAT",t[340]="SMINSAMPLEVALUE",t[341]="SMAXSAMPLEVALUE",t[342]="TRANSFERRANGE",t[347]="JPEGTABLES",t[512]="JPEGPROC",t[513]="JPEGIFOFFSET",t[514]="JPEGIFBYTECOUNT",t[515]="JPEGRESTARTINTERVAL",t[517]="JPEGLOSSLESSPREDICTORS",t[518]="JPEGPOINTTRANSFORM",t[519]="JPEGQTABLES",t[520]="JPEGDCTABLES",t[521]="JPEGACTABLES",t[529]="YCBCRCOEFFICIENTS",t[530]="YCBCRSUBSAMPLING",t[531]="YCBCRPOSITIONING",t[532]="REFERENCEBLACKWHITE",t[700]="XMP",t[33550]="GEOPIXELSCALE",t[33922]="GEOTIEPOINTS",t[33432]="COPYRIGHT",t[42112]="GDAL_METADATA",t[42113]="GDAL_NODATA",t[50844]="RPCCOEFFICIENT",t[34264]="GEOTRANSMATRIX",t[34735]="GEOKEYDIRECTORY",t[34736]="GEODOUBLEPARAMS",t[34737]="GEOASCIIPARAMS",t[34665]="EXIFIFD",t[34853]="GPSIFD",t[40965]="INTEROPERABILITYIFD",t})(),o=(()=>{const t=n.slice();return t[36864]="ExifVersion",t[40960]="FlashpixVersion",t[40961]="ColorSpace",t[42240]="Gamma",t[37121]="ComponentsConfiguration",t[37122]="CompressedBitsPerPixel",t[40962]="PixelXDimension",t[40963]="PixelYDimension",t[37500]="MakerNote",t[37510]="UserComment",t[40964]="RelatedSoundFile",t[36867]="DateTimeOriginal",t[36868]="DateTimeDigitized",t[36880]="OffsetTime",t[36881]="OffsetTimeOriginal",t[36882]="OffsetTimeDigitized",t[37520]="SubSecTime",t[37521]="SubSecTimeOriginal",t[37522]="SubSecTimeDigitized",t[37888]="Temperature",t[37889]="Humidity",t[37890]="Pressure",t[37891]="WaterDepth",t[37892]="Acceleration",t[37893]="CameraElevationAngle",t[42016]="ImageUniqueID",t[42032]="CameraOwnerName",t[42033]="BodySerialNumber",t[42034]="LensSpecification",t[42035]="LensMake",t[42036]="LensModel",t[42037]="LensSerialNumber",t[33434]="ExposureTime",t[33437]="FNumber",t[34850]="ExposureProgram",t[34852]="SpectralSensitivity",t[34855]="PhotographicSensitivity",t[34856]="OECF",t[34864]="SensitivityType",t[34865]="StandardOutputSensitivity",t[34866]="RecommendedExposureIndex",t[34867]="ISOSpeed",t[34868]="ISOSpeedLatitudeyyy",t[34869]="ISOSpeedLatitudezzz",t[37377]="ShutterSpeedValue",t[37378]="ApertureValue",t[37379]="BrightnessValue",t[37380]="ExposureBiasValue",t[37381]="MaxApertureValue",t[37382]="SubjectDistance",t[37383]="MeteringMode",t[37384]="LightSource",t[37385]="Flash",t[37386]="FocalLength",t[37396]="SubjectArea",t[41483]="FlashEnergy",t[41484]="SpatialFrequencyResponse",t[41486]="FocalPlaneXResolution",t[41487]="FocalPlaneYResolution",t[41488]="FocalPlaneResolutionUnit",t[41492]="SubjectLocation",t[41493]="ExposureIndex",t[41495]="SensingMethod",t[41728]="FileSource",t[41729]="SceneType",t[41730]="CFAPattern",t[41985]="CustomRendered",t[41986]="ExposureMode",t[41987]="WhiteBalance",t[41988]="DigitalZoomRatio",t[41989]="FocalLengthIn35mmFilm",t[41990]="SceneCaptureType",t[41991]="GainControl",t[41992]="Contrast",t[41993]="Saturation",t[41994]="Sharpness",t[41995]="DeviceSettingDescription",t[41996]="SubjectDistanceRange",t})(),i=(()=>{const t=[];return t[1024]="GTModelTypeGeoKey",t[1025]="GTRasterTypeGeoKey",t[1026]="GTCitationGeoKey",t[2048]="GeographicTypeGeoKey",t[2049]="GeogCitationGeoKey",t[2050]="GeogGeodeticDatumGeoKey",t[2051]="GeogPrimeMeridianGeoKey",t[2052]="GeogLinearUnitsGeoKey",t[2053]="GeogLinearUnitSizeGeoKey",t[2054]="GeogAngularUnitsGeoKey",t[2055]="GeogAngularUnitSizeGeoKey",t[2056]="GeogEllipsoidGeoKey",t[2057]="GeogSemiMajorAxisGeoKey",t[2058]="GeogSemiMinorAxisGeoKey",t[2059]="GeogInvFlatteningGeoKey",t[2061]="GeogPrimeMeridianLongGeoKey",t[2060]="GeogAzimuthUnitsGeoKey",t[3072]="ProjectedCSTypeGeoKey",t[3073]="PCSCitationGeoKey",t[3074]="ProjectionGeoKey",t[3075]="ProjCoordTransGeoKey",t[3076]="ProjLinearUnitsGeoKey",t[3077]="ProjLinearUnitSizeGeoKey",t[3078]="ProjStdParallel1GeoKey",t[3079]="ProjStdParallel2GeoKey",t[3080]="ProjNatOriginLongGeoKey",t[3081]="ProjNatOriginLatGeoKey",t[3082]="ProjFalseEastingGeoKey",t[3083]="ProjFalseNorthingGeoKey",t[3084]="ProjFalseOriginLongGeoKey",t[3085]="ProjFalseOriginLatGeoKey",t[3086]="ProjFalseOriginEastingGeoKey",t[3087]="ProjFalseOriginNorthingGeoKey",t[3088]="ProjCenterLongGeoKey",t[3090]="ProjCenterEastingGeoKey",t[3091]="ProjCenterNorthingGeoKey",t[3092]="ProjScaleAtNatOriginGeoKey",t[3093]="ProjScaleAtCenterGeoKey",t[3094]="ProjAzimuthAngleGeoKey",t[3095]="ProjStraightVertPoleLongGeoKey",t[4096]="VerticalCSTypeGeoKey",t[4097]="VerticalCitationGeoKey",t[4098]="VerticalDatumGeoKey",t[4099]="VerticalUnitsGeoKey",t})(),s=(t,e)=>{let r=(e||n)[t];return void 0===r&&(r="unknown"+String(t)),r},a=new Map([["EXIFIFD",o],["GPSIFD",["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"]]])},13868:(t,e,r)=>{r.d(e,{SZ:()=>o,e8:()=>s,hm:()=>i});var n=r(66552);const o=(0,n.O)()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),i=(0,n.O)()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"}),s=(0,n.O)()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"})},14140:(t,e,r)=>{r.d(e,{A:()=>d});var n,o=r(90237),i=r(49186),s=r(25482),a=r(4718),l=r(53966),u=r(10107),c=r(79901),h=r(40608),f=r(4151),p=r(16019);let d=n=class extends s.A{static createEmptyBand(t,e){return new(n.getPixelArrayConstructor(t))(e)}static combineBandMasks(t){if(t.length<2)return t[0];const e=t[0].length,r=new Uint8Array(e).fill(255);for(let n=0;n<t.length;n++){const o=t[n];for(let t=0;t<e;t++)o[t]||(r[t]=0)}return r}static getPixelArrayConstructor(t){let e;switch(t){case"u1":case"u2":case"u4":case"u8":e=Uint8Array;break;case"u16":e=Uint16Array;break;case"u32":e=Uint32Array;break;case"s8":e=Int8Array;break;case"s16":e=Int16Array;break;case"s32":e=Int32Array;break;case"f32":case"c64":case"c128":case"unknown":e=Float32Array;break;case"f64":e=Float64Array}return e}constructor(t){super(t),this.width=null,this.height=null,this.pixelType="f32",this.validPixelCount=null,this.mask=null,this.maskIsAlpha=!1,this.premultiplyAlpha=!1,this.statistics=null,this.depthCount=1}castPixelType(t){if(!t)return"f32";let e=t.toLowerCase();return["u1","u2","u4"].includes(e)?e="u8":["unknown","u8","s8","u16","s16","u32","s32","f32","f64"].includes(e)||(e="f32"),e}getPlaneCount(){return this.pixels?.length}addData(t){if(!t.pixels||t.pixels.length!==this.width*this.height)throw new i.A("pixelblock:invalid-or-missing-pixels","add data requires valid pixels array that has same length defined by pixel block width * height");this.pixels||(this.pixels=[]),this.statistics||(this.statistics=[]),this.pixels.push(t.pixels),this.statistics.push(t.statistics??new f.z)}getAsRGBA(){const t=new ArrayBuffer(this.width*this.height*4);switch(this.pixelType){case"s8":case"s16":case"u16":case"s32":case"u32":case"f32":case"f64":this._fillFromNon8Bit(t);break;default:this._fillFrom8Bit(t)}return new Uint8ClampedArray(t)}getAsRGBAFloat(){const t=new Float32Array(this.width*this.height*4);return this._fillFrom32Bit(t),t}updateStatistics(){if(!this.pixels)return;this.statistics=this.pixels.map((t=>function(t,e){let r=1/0,n=-1/0;const o=t.length;let i,s=0;if(null!=e)for(i=0;i<o;i++)e[i]&&(s=t[i],r=s<r?s:r,n=s>n?s:n);else for(i=0;i<o;i++)s=t[i],r=s<r?s:r,n=s>n?s:n;return new f.z(r,n)}(t,this.mask)));const t=this.mask;let e=0;if(null!=t)for(let r=0;r<t.length;r++)t[r]&&e++;else e=this.width*this.height;this.validPixelCount=e}clamp(t){if(!t||"f64"===t||"f32"===t||!this.pixels)return;const[e,r]=(0,p.hP)(t),o=this.pixels,i=this.width*this.height,s=o.length;let a,l,u;const c=[];for(let h=0;h<s;h++){u=n.createEmptyBand(t,i),a=o[h];for(let t=0;t<i;t++)l=a[t],u[t]=l>r?r:l<e?e:l;c.push(u)}this.pixels=c,this.pixelType=t}extractBands(t){const{pixels:e,statistics:r}=this;if(null==t||0===t.length||!e||0===e.length)return this;const o=e.length,i=t.some((t=>t>=e.length)),s=o===t.length&&!t.some(((t,e)=>t!==e));if(i||s)return this;const a=this.bandMasks?.length===o?t.map((t=>this.bandMasks[t])):void 0;let{mask:l,validPixelCount:u}=this;const{width:c,height:h}=this;return a?.length&&(l=n.combineBandMasks(a),u=l.filter((t=>!!t)).length),new n({pixelType:this.pixelType,width:c,height:h,mask:l,bandMasks:a,validPixelCount:u,maskIsAlpha:this.maskIsAlpha,pixels:t.map((t=>e[t])),statistics:r&&t.map((t=>r[t]))})}clone(){const t=new n({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;null!=this.mask&&(t.mask=new Uint8Array(this.mask)),this.bandMasks&&(t.bandMasks=this.bandMasks.map((t=>new Uint8Array(t))));const r=n.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const n=!!this.pixels[0].slice;for(e=0;e<this.pixels.length;e++)t.pixels[e]=n?this.pixels[e].slice():new r(this.pixels[e])}if(this.statistics)for(t.statistics=[],e=0;e<this.statistics.length;e++)t.statistics[e]=(0,a.o8)(this.statistics[e]);return t.premultiplyAlpha=this.premultiplyAlpha,t}_fillFrom8Bit(t){const{mask:e,maskIsAlpha:r,premultiplyAlpha:n,pixels:o}=this;if(!t||!o?.length)return void l.A.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.");let i,s,a,u;i=s=a=o[0],o.length>=3?(s=o[1],a=o[2]):2===o.length&&(s=o[1]);const c=new Uint32Array(t),h=this.width*this.height;if(i.length===h)if(null!=e&&e.length===h)if(r)for(u=0;u<h;u++){const t=e[u];if(t){const e=t/255;c[u]=n?t<<24|a[u]*e<<16|s[u]*e<<8|i[u]*e:t<<24|a[u]<<16|s[u]<<8|i[u]}}else for(u=0;u<h;u++)e[u]&&(c[u]=255<<24|a[u]<<16|s[u]<<8|i[u]);else for(u=0;u<h;u++)c[u]=255<<24|a[u]<<16|s[u]<<8|i[u];else l.A.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.")}_fillFromNon8Bit(t){const{pixels:e,mask:r,statistics:n}=this;if(!t||!e?.length)return void l.A.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The input pixel block is empty.");const o=this.pixelType;let i=1,s=0,a=1;if(n&&n.length>0){for(const t of n)if(null!=t.minValue&&(s=Math.min(s,t.minValue)),null!=t.maxValue&&null!=t.minValue){const e=t.maxValue-t.minValue;a=Math.max(a,e)}i=255/a}else{let t=255;"s8"===o?(s=-128,t=127):"u16"===o?t=65535:"s16"===o?(s=-32768,t=32767):"u32"===o?t=4294967295:"s32"===o?(s=-2147483648,t=2147483647):"f32"===o?(s=-34e38,t=34e38):"f64"===o&&(s=-Number.MAX_VALUE,t=Number.MAX_VALUE),i=255/(t-s)}const u=new Uint32Array(t),c=this.width*this.height;let h,f,p,d,m;if(h=f=p=e[0],h.length!==c)return l.A.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(f=e[1],e.length>=3&&(p=e[2]),null!=r&&r.length===c)for(d=0;d<c;d++)r[d]&&(u[d]=255<<24|(p[d]-s)*i<<16|(f[d]-s)*i<<8|(h[d]-s)*i);else for(d=0;d<c;d++)u[d]=255<<24|(p[d]-s)*i<<16|(f[d]-s)*i<<8|(h[d]-s)*i;else if(null!=r&&r.length===c)for(d=0;d<c;d++)m=(h[d]-s)*i,r[d]&&(u[d]=255<<24|m<<16|m<<8|m);else for(d=0;d<c;d++)m=(h[d]-s)*i,u[d]=255<<24|m<<16|m<<8|m}_fillFrom32Bit(t){const{pixels:e,mask:r}=this;if(!t||!e?.length)return l.A.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The input pixel block is empty.");let n,o,i,s;n=o=i=e[0],e.length>=3?(o=e[1],i=e[2]):2===e.length&&(o=e[1]);const a=this.width*this.height;if(n.length!==a)return l.A.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let u=0;if(null!=r&&r.length===a)for(s=0;s<a;s++)t[u++]=n[s],t[u++]=o[s],t[u++]=i[s],t[u++]=1&r[s];else for(s=0;s<a;s++)t[u++]=n[s],t[u++]=o[s],t[u++]=i[s],t[u++]=1}};(0,o._)([(0,u.MZ)({json:{write:!0}})],d.prototype,"width",void 0),(0,o._)([(0,u.MZ)({json:{write:!0}})],d.prototype,"height",void 0),(0,o._)([(0,u.MZ)({json:{write:!0}})],d.prototype,"pixelType",void 0),(0,o._)([(0,c.w)("pixelType")],d.prototype,"castPixelType",null),(0,o._)([(0,u.MZ)({json:{write:!0}})],d.prototype,"validPixelCount",void 0),(0,o._)([(0,u.MZ)({json:{write:!0}})],d.prototype,"mask",void 0),(0,o._)([(0,u.MZ)({json:{write:!0}})],d.prototype,"maskIsAlpha",void 0),(0,o._)([(0,u.MZ)({json:{write:!0}})],d.prototype,"pixels",void 0),(0,o._)([(0,u.MZ)()],d.prototype,"premultiplyAlpha",void 0),(0,o._)([(0,u.MZ)({json:{write:!0}})],d.prototype,"statistics",void 0),(0,o._)([(0,u.MZ)({json:{write:!0}})],d.prototype,"depthCount",void 0),(0,o._)([(0,u.MZ)({json:{write:!0}})],d.prototype,"noDataValues",void 0),(0,o._)([(0,u.MZ)({json:{write:!0}})],d.prototype,"bandMasks",void 0),d=n=(0,o._)([(0,h.$)("esri.layers.support.PixelBlock")],d)},14636:(t,e,r)=>{r.d(e,{FI:()=>d,KL:()=>u,Lu:()=>h,MD:()=>l,Rn:()=>m,Y2:()=>p});var n=r(66552),o=r(14140),i=r(28435);const s=new Map;s.set("meter-per-second",1),s.set("kilometer-per-hour",.277778),s.set("knots",.514444),s.set("feet-per-second",.3048),s.set("mile-per-hour",.44704);const a=180/Math.PI,l=new n.J({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"});function u(t,e){return s.get(t)/s.get(e)||1}function c(t){return(450-t)%360}function h(t,e="geographic"){const[r,n]=t,o=Math.sqrt(r*r+n*n);let i=Math.atan2(n,r)*a;return i=(360+i)%360,"geographic"===e&&(i=c(i)),[o,i]}function f(t,e="geographic"){let r=t[1];"geographic"===e&&(r=c(r)),r%=360;const n=t[0];return[n*Math.cos(r/a),n*Math.sin(r/a)]}function p(t,e,r,n="geographic"){if(!(0,i.AB)(t)||null==r)return t;const o="vector-magdir"===e?t.clone():d(t,e),s=o.pixels[1];for(let t=0;t<s.length;t++)s[t]="geographic"===n?(s[t]+r[t]+270)%360:(s[t]+360-r[t])%360;return"vector-magdir"===e?o:d(o,"vector-magdir")}function d(t,e,r="geographic",n=1){if(!(0,i.AB)(t))return t;const{pixels:s,width:a,height:l}=t,u=a*l,c=s[0],p=s[1],d=t.pixelType.startsWith("f")?t.pixelType:"f32",m=o.A.createEmptyBand(d,u),g=o.A.createEmptyBand(d,u);let y=0;for(let t=0;t<l;t++)for(let t=0;t<a;t++)"vector-uv"===e?([m[y],g[y]]=h([c[y],p[y]],r),m[y]*=n):([m[y],g[y]]=f([c[y],p[y]],r),m[y]*=n,g[y]*=n),y++;const w=new o.A({pixelType:d,width:t.width,height:t.height,mask:t.mask,validPixelCount:t.validPixelCount,maskIsAlpha:t.maskIsAlpha,pixels:[m,g]});return w.updateStatistics(),w}function m(t,e,r=1){if(1===r||!(0,i.AB)(t))return t;const n=t.clone(),{pixels:o,width:s,height:a}=n,l=o[0],u=o[1];let c=0;for(let t=0;t<a;t++)for(let t=0;t<s;t++)"vector-uv"===e?(l[c]*=r,u[c]*=r):l[c]*=r,c++;return n.updateStatistics(),n}function g(t,e,r,n=1){const o=Math.sqrt(t*t+e*e)/n,i=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[o,(2*Math.PI+i-r)%(2*Math.PI)]}!function(t=0,e=0,r=Math.PI,n=!0){n&&(r=(2*Math.PI-r)%(2*Math.PI));const o=n?-1:1,i=13*o,s=-7*o,a=-2*o,l=-16*o,u=21.75,[c,h]=g(0,e+i,r,u),[f,p]=g(t-5.5,e+s,r,u),[d,m]=g(t+5.5,e+s,r,u),[y,w]=g(t-1.5,e+a,r,u),[b,C]=g(t+1.5,e+a,r,u),[v,x]=g(t-1.5,e+l,r,u),[A,k]=g(t+1.5,e+l,r,u)}(0,0,0)},15265:(t,e,r)=>{function n(t,e){let r=0,n="",o=0,i=0;const s=t.length;for(;r<s;)i=t[r++],o=i>>4,o<8?o=1:15===o?(o=4,i=(7&i)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++]):14===o?(o=3,i=(15&i)<<12|(63&t[r++])<<6|63&t[r++]):(o=2,i=(31&i)<<6|63&t[r++]),(0!==i||e)&&(n+=String.fromCharCode(i));return n}r.d(e,{w:()=>n})},16019:(t,e,r)=>{r.d(e,{$p:()=>c,Sp:()=>h,X1:()=>a,hP:()=>s,yM:()=>u,zw:()=>l});const n=9999999e31,o=2e-7,i={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function s(t){return i[t]??[-34028234663852886e22,34028234663852886e22]}function a(t,e){return null==t||null==e?"s32":t<0?t>=-128&&e<128?"s8":t>=-32768&&e<32768?"s16":"s32":e<256?"u8":e<65536?"u16":"u32"}function l(t){return(t?.startsWith("s")||t?.startsWith("u"))??!1}function u(t,e,r,n){let[o,i]=s(r);const a=l(r);return a&&(o-=1e-5,i+=1e-5),a?r.startsWith("u")?function(t,e,r,n){const[o,i]=n;for(let n=0;n<e.length;n++)if(e[n]){const s=t[n];s<o||s>i?e[n]=0:r[n]=s+.5|0}}(t,e,n,[o,i]):function(t,e,r,n){const[o,i]=n;for(let n=0;n<e.length;n++)if(e[n]){const s=t[n];s<o||s>i?e[n]=0:r[n]=s+(s>0?.5:-.5)|0}}(t,e,n,[o,i]):function(t,e,r,n){const[o,i]=n;for(let n=0;n<e.length;n++)if(e[n]){const s=t[n];s<o||s>i?e[n]=0:r[n]=s}}(t,e,n,[o,i])}function c(t,e){for(let r=0;r<e.length;r++)e[r]&&isNaN(t[r])&&(e[r]=0,t[r]=0)}function h(t,e,r){if(t.depthCount&&t.depthCount>1)return;const{pixels:i,statistics:a,pixelType:l}=t,u=i[0].length,c=t.bandMasks??[],h=t.mask??new Uint8Array(u).fill(255),f="f32"===l||"f64"===l,p=s(l);let d=!1;for(let t=0;t<i.length;t++){const s="number"==typeof e?e:e[t];if(null==s)continue;const u=a?.[t]?.minValue??p[0],m=a?.[t]?.maxValue??p[1];if(u>s+Number.EPSILON||m<s-Number.EPSILON)continue;const g=c[t]||h.slice(),y=i[t],w=r?.customFloatTolerance;if(f&&0!==w){let t=w;t||(t=Math.abs(s)>=n?o*Math.abs(s):"f32"===l?2**-23:Number.EPSILON);for(let e=0;e<y.length;e++)g[e]&&Math.abs(y[e]-s)<t&&(y[e]=0,g[e]=0,h[e]=0,d=!0)}else for(let t=0;t<y.length;t++)g[t]&&y[t]===s&&(y[t]=0,g[t]=0,h[t]=0,d=!0);c[t]=g}if(d){const e=t.bandMasks||t.pixels.length>1?c:null;r?.matchAllNoData?t.mask=e&&e.length>1?function(t){if(t.length<2)return t[0];const e=t[0].length,r=new Uint8Array(e).fill(0);for(let n=0;n<t.length;n++){const o=t[n];for(let t=0;t<e;t++)o[t]&&(r[t]=255)}return r}(e):h:(t.bandMasks=e,t.mask=h)}d&&"updateStatistics"in t&&t.updateStatistics()}},20223:(t,e,r)=>{r.d(e,{A:()=>c});var n,o=r(90237),i=r(25482),s=r(4718),a=r(10107),l=(r(44208),r(53966),r(40608)),u=r(86738);let c=n=class extends i.A{constructor(){super(...arguments),this.blockWidth=void 0,this.blockHeight=void 0,this.compression=null,this.origin=null,this.firstPyramidLevel=null,this.maximumPyramidLevel=null,this.pyramidScalingFactor=2,this.pyramidBlockWidth=null,this.pyramidBlockHeight=null,this.isBsqTile=!1,this.isVirtualTileInfo=!1,this.tileInfo=null,this.transposeInfo=null,this.blockBoundary=null}clone(){return new n({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:(0,s.o8)(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:(0,s.o8)(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:(0,s.o8)(this.tileInfo),transposeInfo:(0,s.o8)(this.transposeInfo),blockBoundary:(0,s.o8)(this.blockBoundary)})}};(0,o._)([(0,a.MZ)({type:Number,json:{write:!0}})],c.prototype,"blockWidth",void 0),(0,o._)([(0,a.MZ)({type:Number,json:{write:!0}})],c.prototype,"blockHeight",void 0),(0,o._)([(0,a.MZ)({type:String,json:{write:!0}})],c.prototype,"compression",void 0),(0,o._)([(0,a.MZ)({type:u.A,json:{write:!0}})],c.prototype,"origin",void 0),(0,o._)([(0,a.MZ)({type:Number,json:{write:!0}})],c.prototype,"firstPyramidLevel",void 0),(0,o._)([(0,a.MZ)({type:Number,json:{write:!0}})],c.prototype,"maximumPyramidLevel",void 0),(0,o._)([(0,a.MZ)({json:{write:!0}})],c.prototype,"pyramidResolutions",void 0),(0,o._)([(0,a.MZ)({type:Number,json:{write:!0}})],c.prototype,"pyramidScalingFactor",void 0),(0,o._)([(0,a.MZ)({type:Number,json:{write:!0}})],c.prototype,"pyramidBlockWidth",void 0),(0,o._)([(0,a.MZ)({type:Number,json:{write:!0}})],c.prototype,"pyramidBlockHeight",void 0),(0,o._)([(0,a.MZ)({json:{write:!0}})],c.prototype,"isBsqTile",void 0),(0,o._)([(0,a.MZ)({type:Boolean,json:{write:!0}})],c.prototype,"isVirtualTileInfo",void 0),(0,o._)([(0,a.MZ)({json:{write:!0}})],c.prototype,"tileInfo",void 0),(0,o._)([(0,a.MZ)()],c.prototype,"transposeInfo",void 0),(0,o._)([(0,a.MZ)({json:{write:!0}})],c.prototype,"blockBoundary",void 0),c=n=(0,o._)([(0,l.$)("esri.layers.support.RasterStorageInfo")],c)},28435:(t,e,r)=>{r.d(e,{$Q:()=>L,$i:()=>N,AB:()=>c,Ew:()=>w,Hx:()=>g,IB:()=>n,J$:()=>O,QF:()=>B,UK:()=>m,Wb:()=>o,Wt:()=>k,Wy:()=>h,XU:()=>A,bL:()=>y,dK:()=>x,eH:()=>d,et:()=>u,lD:()=>D,qL:()=>p,z$:()=>T,z7:()=>S,zg:()=>f});var n,o,i,s=r(34727),a=r(14140),l=r(16019);(i=n||(n={}))[i.matchAny=0]="matchAny",i[i.matchAll=1]="matchAll",function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(o||(o={}));const u=9;function c(t){return null!=t&&t.pixels?.length>0}function h(t){if(!t?.length||t.some((t=>!c(t))))return null;if(1===t.length)return t[0]?.clone()??null;const e=t,{width:r,height:n,pixelType:o}=e[0];if(e.some((t=>t.width!==r||t.height!==n)))return null;const i=e.map((({mask:t})=>t)).filter((t=>null!=t));let s=null;i.length&&(s=new Uint8Array(r*n),s.set(i[0]),i.length>1&&v(i.slice(1),s));const l=[];e.forEach((({pixels:t})=>l.push(...t)));const u=e.map((({statistics:t})=>t)).filter((t=>t?.length)),h=[];return u.forEach((t=>h.push(...t))),new a.A({pixelType:o,width:r,height:n,mask:s,pixels:l,statistics:h.length?h:null})}function f(t){if(!t)return;const e=t.colormap;if(!e||0===e.length)return;const r=e.sort(((t,e)=>t[0]-e[0])),n=r[0][0]<0?r[0][0]:0,o=Math.max(256,r[r.length-1][0]-n+1),i=new Uint8Array(4*o),s=[],a=5===r[0].length;if(o>65536)return r.forEach((t=>{s[t[0]-n]=a?t.slice(1):t.slice(1).concat([255])})),{indexed2DColormap:s,offset:n,alphaSpecified:a};if(t.fillUnspecified){let t=r[0];for(let e=t[0]-n,s=0;e<o;e++)i[4*e]=t[1],i[4*e+1]=t[2],i[4*e+2]=t[3],i[4*e+3]=a?t[4]:255,e===t[0]-n&&(t=s===r.length-1?t:r[++s])}else for(let t=0;t<r.length;t++){const e=r[t],o=4*(e[0]-n);i[o]=e[1],i[o+1]=e[2],i[o+2]=e[3],i[o+3]=a?e[4]:255}return{indexedColormap:i,offset:n,alphaSpecified:a}}function p(t,e){if(!c(t))return t;if(!e||!e.indexedColormap&&!e.indexed2DColormap)return t;const r=t.clone(),n=r.pixels;let o=r.mask;const i=r.width*r.height;if(1!==n.length)return t;const{indexedColormap:s,indexed2DColormap:a,offset:l,alphaSpecified:u}=e,h=n[0],f=new Uint8Array(h.length),p=new Uint8Array(h.length),d=new Uint8Array(h.length);let m,g=0;if(s){const t=s.length-1;if(null!=o)for(let e=0;e<i;e++)o[e]&&(g=4*(h[e]-l),g<l||g>t?o[e]=0:(f[e]=s[g],p[e]=s[g+1],d[e]=s[g+2],o[e]=s[g+3]));else{o=new Uint8Array(i);for(let e=0;e<i;e++)g=4*(h[e]-l),g<l||g>t?o[e]=0:(f[e]=s[g],p[e]=s[g+1],d[e]=s[g+2],o[e]=s[g+3]);r.mask=o}}else if(a)if(null!=o)for(let t=0;t<i;t++)o[t]&&(m=a[h[t]],f[t]=m[0],p[t]=m[1],d[t]=m[2],o[t]=m[3]);else{o=new Uint8Array(i);for(let t=0;t<i;t++)m=a[h[t]],f[t]=m[0],p[t]=m[1],d[t]=m[2],o[t]=m[3];r.mask=o}return r.pixels=[f,p,d],r.statistics=null,r.pixelType="u8",r.maskIsAlpha=u,r}function d(t,e){if(!c(t))return null;const{pixels:r,mask:n}=t,o=r.length;let i=e.lut;const{offset:s}=e;i&&1===i[0].length&&(i=r.map((()=>i)));const l=[],u=e.outputPixelType||"u8";for(let t=0;t<o;t++){const e=m(r[t],n,i[t],s||0,u);l.push(e)}const h=new a.A({width:t.width,height:t.height,pixels:l,mask:n,pixelType:u});return h.updateStatistics(),h}function m(t,e,r,n,o){const i=t.length,s=a.A.createEmptyBand(o,i);if(e)for(let o=0;o<i;o++)e[o]&&(s[o]=r[t[o]-n]);else for(let e=0;e<i;e++)s[e]=r[t[e]-n];return s}function g(t,e){if(!c(t))return null;const r=t.clone(),{pixels:n}=r,o=r.width*r.height,i=e.length,s=Math.floor(i/2),a=e[Math.floor(s)],l=n[0],u=new Uint8Array(o),h=new Uint8Array(o),f=new Uint8Array(o);let p=r.mask;const d=4===e[0].mappedColor.length;p||(p=new Uint8Array(o),p.fill(d?255:1),r.mask=p);for(let t=0;t<o;t++)if(p[t]){const r=l[t];let n=!1,o=s,c=a,d=0,m=i-1;for(;m-d>1;){if(r===c.value){n=!0;break}r>c.value?d=o:m=o,o=Math.floor((d+m)/2),c=e[Math.floor(o)]}n||(r===e[d].value?(c=e[d],n=!0):r===e[m].value?(c=e[m],n=!0):r<e[d].value?n=!1:r>e[d].value&&(r<e[m].value?(c=e[d],n=!0):m===i-1?n=!1:(c=e[m],n=!0))),n?(u[t]=c.mappedColor[0],h[t]=c.mappedColor[1],f[t]=c.mappedColor[2],p[t]=c.mappedColor[3]):u[t]=h[t]=f[t]=p[t]=0}return r.pixels=[u,h,f],r.mask=p,r.pixelType="u8",r.maskIsAlpha=d,r}function y(t,e,r=!1){const n=1e-5,o=new Float32Array(3*u),i=e.length;for(let a=0;a<u;a++)o[3*a]=t[2*a]??s.pq-1,o[3*a+1]=t[2*a+1]??s.pq,o[3*a+2]=e[a]??0,a<i&&(a>0&&(o[3*a]-=n),t[2*a+1]!==t[2*a]&&(a<i-1||!r)&&(o[3*a+1]-=n));return o}function w(t,e){if(!c(t))return null;const{width:r,height:n}=t,{inputRanges:o,outputValues:i,outputPixelType:s,noDataRanges:u,allowUnmatched:h,replacementValue:f,isLastInputRangeInclusive:p}=e,d=t.pixels[0],m=a.A.createEmptyBand(s,d.length),g=t.mask,y=new Uint8Array(r*n);g?y.set(g):y.fill(255);const w=t.pixelType.startsWith("f")?1e-6:0,b=o.map((t=>t-w));b[0]=o[0],b[b.length-1]=o[o.length-1]+(p?1e-6:0);const C=o.length/2,[v,x]=(0,l.hP)(s);for(let t=0;t<n;t++)for(let e=0;e<r;e++){const n=t*r+e;if(y[n]){const t=d[n];let e=!1;for(let r=C-1;r>=0;r--)if(t===o[2*r]||t>b[2*r]&&t<b[2*r+1]){m[n]=i[r],e=!0;break}e||(h?m[n]=t>x?x:t<v?v:f??t:y[n]=0)}}const A=u?.length;if(A)for(let t=0;t<n;t++)for(let e=0;e<r;e++){const n=t*r+e;if(!g||g[n]){const t=d[n];for(let e=0;e<A;e+=2)if(t>=u[e]&&t<=u[e+1]){m[n]=0,y[n]=0;break}}}return new a.A({width:r,height:n,pixelType:s,pixels:[m],mask:y})}function b(t,e,r,n){const o=null!=r&&r.length>=2?new Set(r):null,i=1===r?.length?r[0]:null,s=!!e?.length;for(let r=0;r<t.length;r++)if(n[r]){const a=t[r];if(s){let t=!1;for(let r=0;r<e.length;r+=2)if(a>=e[r]&&a<=e[r+1]){t=!0;break}t||(n[r]=0)}n[r]&&(a===i||o?.has(a))&&(n[r]=0)}}function C(t,e){const r=t[0].length;for(let n=0;n<r;n++)if(e[n]){let r=!1;for(let e=0;e<t.length;e++)if(t[e][n]){r=!0;break}r||(e[n]=0)}}function v(t,e){const r=t[0].length;for(let n=0;n<r;n++)if(e[n]){let r=!1;for(let e=0;e<t.length;e++)if(0===t[e][n]){r=!0;break}r&&(e[n]=0)}}function x(t,e){if(!c(t))return null;const{width:r,height:n,pixels:o}=t,i=r*n,s=new Uint8Array(i);t.mask?s.set(t.mask):s.fill(255);const l=o.length,{includedRanges:u,noDataValues:h,outputPixelType:f,matchAll:p,lookups:d}=e;if(d){const t=[];for(let e=0;e<l;e++){const r=d[e],n=m(o[e],s,r.lut,r.offset||0,"u8");t.push(n)}1===t.length?s.set(t[0]):p?C(t,s):v(t,s)}else if(p){const t=[];for(let e=0;e<l;e++){const r=new Uint8Array(i);r.set(s),b(o[e],u?.slice(2*e,2*e+2),h?.[e],r),t.push(r)}1===t.length?s.set(t[0]):C(t,s)}else for(let t=0;t<l;t++)b(o[t],u?.slice(2*t,2*t+2),h?.[t],s);return new a.A({width:r,height:n,pixelType:f,pixels:o,mask:s})}function A(t){const{srcPixelType:e,inputRanges:r,outputValues:n,allowUnmatched:o,noDataRanges:i,isLastInputRangeInclusive:s,outputPixelType:u}=t;if("u8"!==e&&"s8"!==e&&"u16"!==e&&"s16"!==e)return null;const c=e.includes("16")?65536:256,h=e.includes("s")?-c/2:0,f=a.A.createEmptyBand(u,c),p=new Uint8Array(c);o&&p.fill(255);const[d,m]=(0,l.hP)(u);if(r?.length&&n?.length){const t=1e-6,e=r.map((e=>e-t));e[0]=r[0],s&&(e[e.length-1]=r[r.length-1]);for(let t=0;t<e.length;t++){const o=n[t]>m?m:n[t]<d?d:n[t],i=Math.ceil(e[2*t]-h),s=r[2*t+1]===r[2*t]?i:Math.floor(e[2*t+1]-h);for(let t=i;t<=s;t++)f[t]=o,p[t]=255}}if(i?.length)for(let t=0;t<i.length;t++){const e=Math.ceil(i[2*t]-h),r=Math.floor(i[2*t+1]-h);for(let t=e;t<=r;t++)p[t]=0}return{lut:f,offset:h,mask:p}}function k(t,e,r){if("u8"!==t&&"s8"!==t&&"u16"!==t&&"s16"!==t)return null;const n=t.includes("16")?65536:256,o=t.includes("s")?-n/2:0,i=new Uint8Array(n);if(e)for(let t=0;t<e.length;t++){const r=Math.ceil(e[2*t]-o),n=Math.floor(e[2*t+1]-o);for(let t=r;t<=n;t++)i[t]=255}else i.fill(255);if(r)for(let t=0;t<r.length;t++)i[r[t]-o]=0;return{lut:i,offset:o}}function M(t,e,r,n,o,i){const{width:s,height:a}=r.block,{x:l,y:u}=r.offset,{width:c,height:h}=r.mosaic,f=function(t,e,r,n,o,i,s,a){return{xmin:o<=r*t?0:o<r*t+t?o-r*t:t,ymin:i<=n*e?0:i<n*e+e?i-n*e:e,xmax:o+s<=r*t?0:o+s<r*t+t?o+s-r*t:t,ymax:i+a<=n*e?0:i+a<n*e+e?i+a-n*e:e}}(s,a,n,o,l,u,c,h);let p=0,d=0;if(i){const t=i.hasGCSSShiftTransform?360:i.halfWorldWidth??0,e=s*i.resolutionX,r=i.startX+n*e;r<t&&r+e>t?d=i.rightPadding:r>=t&&(p=i.leftMargin-i.rightPadding,d=0)}if(f.xmax-=d,"number"!=typeof e)for(let r=f.ymin;r<f.ymax;r++){const i=(o*a+r-u)*c+(n*s-l)+p,h=r*s;for(let r=f.xmin;r<f.xmax;r++)t[i+r]=e[h+r]}else for(let r=f.ymin;r<f.ymax;r++){const i=(o*a+r-u)*c+(n*s-l)+p;for(let r=f.xmin;r<f.xmax;r++)t[i+r]=e}}function S(t,e,r={}){const{clipOffset:n,clipSize:o,alignmentInfo:i,blockWidths:s}=r;if(s)return function(t,e,r){const n=t.find((t=>null!=t));if(null==n)return null;const o=t.some((t=>null==t||!!t.mask)),{width:i,height:s}=e,l=o?new Uint8Array(i*s):null,{blockWidths:u}=r,h=[],f=n.getPlaneCount(),p=a.A.getPixelArrayConstructor(n.pixelType);if(o)for(let e=0,r=0;e<t.length;r+=u[e],e++){const n=t[e];if(!c(n))continue;const o=n.mask;for(let t=0;t<s;t++)for(let s=0;s<u[e];s++)l[t*i+s+r]=null==o?255:o[t*n.width+s]}const d=t.some((t=>t?.bandMasks&&t.bandMasks.length>1)),m=d?[]:void 0,g=i*s;for(let e=0;e<f;e++){const r=new p(g),n=d?new Uint8Array(g):void 0;for(let o=0,a=0;o<t.length;a+=u[o],o++){const l=t[o];if(!c(l))continue;const h=l.pixels[e];if(null!=h){for(let t=0;t<s;t++)for(let e=0;e<u[o];e++)r[t*i+e+a]=h[t*l.width+e];if(n){const t=l.bandMasks?.[e]??l.mask;for(let e=0;e<s;e++)for(let r=0;r<u[o];r++)n[e*i+r+a]=t?t[e*l.width+r]:255}}}h.push(r),m&&n&&m.push(n)}const y=new a.A({width:i,height:s,mask:l,bandMasks:m,pixels:h,pixelType:n.pixelType});return y.updateStatistics(),y}(t,e,{blockWidths:s});const l=t.find((t=>c(t)));if(null==l)return null;const u=o?o.width:e.width,h=o?o.height:e.height,f=l.width,p=l.height,d=e.width/f,m=e.height/p,g={offset:n||{x:0,y:0},mosaic:o||e,block:{width:f,height:p}},y=l.pixelType,w=a.A.getPixelArrayConstructor(y),b=l.pixels.length,C=[];let v,x;for(let e=0;e<b;e++){x=new w(u*h);for(let r=0;r<m;r++)for(let n=0;n<d;n++){const o=t[r*d+n];c(o)&&(v=o.pixels[e],M(x,v,g,n,r,i))}C.push(x)}const A=t.some((t=>null==t||null!=t.mask&&t.mask.length>0)),k=t.some((t=>t?.bandMasks&&t.bandMasks.length>1)),S=A?new Uint8Array(u*h):void 0,T=k?[]:void 0;if(S){for(let e=0;e<m;e++)for(let r=0;r<d;r++){const n=t[e*d+r],o=null!=n?n.mask:null;M(S,null!=o?o:n?255:0,g,r,e,i)}if(T)for(let e=0;e<b;e++){const r=new Uint8Array(u*h);for(let n=0;n<m;n++)for(let o=0;o<d;o++){const s=t[n*d+o],a=s?.bandMasks?.[e]??s?.mask;M(r,null!=a?a:s?255:0,g,o,n,i)}T.push(r)}}const I=new a.A({width:u,height:h,pixels:C,pixelType:y,bandMasks:T,mask:S});return I.updateStatistics(),I}function T(t,e,r){if(!c(t))return null;const{width:n,height:o}=t,i=e.x,s=e.y,a=r.width+i,l=r.height+s;if(i<0||s<0||a>n||l>o)return t;if(0===i&&0===s&&a===n&&l===o)return t;t.mask||(t.mask=new Uint8Array(n*o));const u=t.mask;for(let t=0;t<o;t++){const e=t*n;for(let r=0;r<n;r++)u[e+r]=t<s||t>=l||r<i||r>=a?0:1}return t.updateStatistics(),t}function I(t){if(!c(t))return null;const e=t.clone(),{width:r,height:n,pixels:o}=t,i=o[0],s=e.pixels[0],a=t.mask;for(let t=2;t<n-1;t++){const e=new Map;for(let n=t-2;n<t+2;n++)for(let t=0;t<4;t++){const o=n*r+t;R(e,i[o],a?a[o]:1)}s[t*r]=P(e),s[t*r+1]=s[t*r+2]=s[t*r];let n=3;for(;n<r-1;n++){let o=(t-2)*r+n+1;R(e,i[o],a?a[o]:1),o=(t-1)*r+n+1,R(e,i[o],a?a[o]:1),o=t*r+n+1,R(e,i[o],a?a[o]:1),o=(t+1)*r+n+1,R(e,i[o],a?a[o]:1),o=(t-2)*r+n-3,E(e,i[o],a?a[o]:1),o=(t-1)*r+n-3,E(e,i[o],a?a[o]:1),o=t*r+n-3,E(e,i[o],a?a[o]:1),o=(t+1)*r+n-3,E(e,i[o],a?a[o]:1),s[t*r+n]=P(e)}s[t*r+n+1]=s[t*r+n]}for(let t=0;t<r;t++)s[t]=s[r+t]=s[2*r+t],s[(n-1)*r+t]=s[(n-2)*r+t];return e.updateStatistics(),e}function P(t){if(0===t.size)return 0;let e=0,r=-1,n=0;const o=t.keys();let i=o.next();for(;!i.done;)n=t.get(i.value),n>e&&(r=i.value,e=n),i=o.next();return r}function E(t,e,r){if(0===r)return;const n=t.get(e);1===n?t.delete(e):t.set(e,n-1)}function R(t,e,r){0!==r&&t.set(e,t.has(e)?t.get(e)+1:1)}function L(t,e,r){let{x:n,y:o}=e;const{width:i,height:s}=r;if(0===n&&0===o&&s===t.height&&i===t.width)return t;const{width:l,height:u}=t,h=Math.max(0,o),f=Math.max(0,n),p=Math.min(n+i,l),d=Math.min(o+s,u);if(p<0||d<0||!c(t))return null;n=Math.max(0,-n),o=Math.max(0,-o);const{pixels:m}=t,g=i*s,y=m.length,w=[];for(let e=0;e<y;e++){const r=m[e],s=a.A.createEmptyBand(t.pixelType,g);for(let t=h;t<d;t++){const e=t*l;let a=(t+o-h)*i+n;for(let t=f;t<p;t++)s[a++]=r[e+t]}w.push(s)}const b=new Uint8Array(g),C=t.mask;for(let t=h;t<d;t++){const e=t*l;let r=(t+o-h)*i+n;for(let t=f;t<p;t++)b[r++]=C?C[e+t]:1}const v=new a.A({width:r.width,height:r.height,pixelType:t.pixelType,pixels:w,mask:b});return v.updateStatistics(),v}function U(t,e=!0){if(!c(t))return null;const{pixels:r,width:n,height:o,mask:i,pixelType:s}=t,l=[],u=Math.round(n/2),h=Math.round(o/2),f=o-1,p=n-1;for(let t=0;t<r.length;t++){const i=r[t],c=a.A.createEmptyBand(s,u*h);let d=0;for(let t=0;t<o;t+=2)for(let r=0;r<n;r+=2){const o=i[t*n+r];if(e){const e=r===p?o:i[t*n+r+1],s=t===f?o:i[t*n+r+n],a=r===p?s:t===f?e:i[t*n+r+n+1];c[d++]=(o+e+s+a)/4}else c[d++]=o}l.push(c)}let d=null;if(null!=i){d=new Uint8Array(u*h);let t=0;for(let r=0;r<o;r+=2)for(let o=0;o<n;o+=2){const s=i[r*n+o];if(e){const e=o===p?s:i[r*n+o+1],a=r===f?s:i[r*n+o+n],l=o===p?a:r===f?e:i[r*n+o+n+1];d[t++]=s*e*a*l?1:0}else d[t++]=s}}return new a.A({width:u,height:h,pixelType:s,pixels:l,mask:d})}function D(t,e,r=0,n=!0){if(!c(t))return null;const{width:o,height:i}=e;let{width:s,height:a}=t;const l=new Map,u={x:0,y:0},h=1+r;let f=t;for(let t=0;t<h;t++){const r=Math.