(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0b4cc6fb"],{"0722":function(e,t,i){"use strict";i.d(t,"a",(function(){return f}));i("c120");var s=i("b2b2"),r=i("1c92"),n=i("8c71"),a=i("738e"),o=i("19db"),l=i("7c4b"),c=i("c8dd"),h=i("7ce4"),u=i("d17d"),d=i("0fa6");class f extends l["a"]{constructor(e=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.width=null,this.source=e}destroy(){var e,t;Object(s["k"])(this.vaoData)&&(null==(e=this.vaoData.magdir)||e.vao.dispose(),null==(t=this.vaoData.scalar)||t.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(e){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(e)&&(this._symbolizerParameters=e,this.invalidateVAO())}get source(){return this._source}set source(e){this._source=e,this.invalidateVAO()}invalidateVAO(){var e,t;!this._vaoInvalidated&&Object(s["k"])(this.vaoData)&&(null==(e=this.vaoData.magdir)||e.vao.dispose(),null==(t=this.vaoData.scalar)||t.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(e){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,Object(s["k"])(this.source)&&!Object(s["k"])(this.vaoData)){const{style:t}=this.symbolizerParameters;switch(t){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const t=Object(o["d"])(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(e.context,t);this.vaoData={magdir:i}}break;case"simple_scalar":{const t=Object(o["e"])(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(e.context,t);this.vaoData={scalar:i}}break;case"wind_speed":{const t=Object(o["d"])(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(e.context,t),s=Object(o["e"])(this.source,this.symbolizerParameters),r=this._createVectorFieldVAO(e.context,s);this.vaoData={magdir:i,scalar:r}}}}this.ready(),this.requestRender()}}_createTransforms(){return{dvs:Object(n["b"])()}}setTransform(e){const t=Object(r["b"])(this.transforms.dvs),[i,s]=e.toScreenNoRotation([0,0],[this.x,this.y]),n=this.resolution/this.pixelRatio/e.resolution,o=n*this.width,l=n*this.height,c=Math.PI*this.rotation/180;Object(r["c"])(t,t,Object(a["b"])(i,s)),Object(r["c"])(t,t,Object(a["b"])(o/2,l/2)),Object(r["n"])(t,t,-c),Object(r["c"])(t,t,Object(a["b"])(-o/2,-l/2)),Object(r["j"])(t,t,Object(a["b"])(o,l)),Object(r["l"])(this.transforms.dvs,e.displayViewMat3,t)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(e,t){const{vertexData:i,indexData:s}=t,r=h["a"].createVertex(e,u["D"].STATIC_DRAW,new Float32Array(i)),n=h["a"].createIndex(e,u["D"].STATIC_DRAW,new Uint32Array(s)),a=Object(c["g"])("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:u["k"].FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:u["k"].FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:u["k"].FLOAT,normalized:!1}]});return{vao:new d["a"](e,a.attributes,a.bufferLayouts,{geometry:r},n),elementCount:s.length}}}},"19db":function(e,t,i){"use strict";i.d(t,"a",(function(){return b})),i.d(t,"b",(function(){return m})),i.d(t,"c",(function(){return y})),i.d(t,"d",(function(){return C})),i.d(t,"e",(function(){return I})),i.d(t,"f",(function(){return u})),i.d(t,"g",(function(){return V})),i.d(t,"h",(function(){return g})),i.d(t,"i",(function(){return h})),i.d(t,"j",(function(){return f}));var s=i("fa8a"),r=i("b2b2"),n=i("3e27"),a=i("9dee");const o=new Map;o.set("meter-per-second",1),o.set("kilometer-per-hour",.277778),o.set("knots",.514444),o.set("feet-per-second",.3048),o.set("mile-per-hour",.44704);const l=180/Math.PI,c=5,h=new s["a"]({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"});function u(e,t){return o.get(e)/o.get(t)||1}function d(e){return(450-e)%360}function f(e,t="geographic"){const[i,s]=e,r=Math.sqrt(i*i+s*s);let n=Math.atan2(s,i)*l;return n=(360+n)%360,"geographic"===t&&(n=d(n)),[r,n]}function p(e,t="geographic"){let i=e[1];"geographic"===t&&(i=d(i)),i%=360;const s=e[0];return[s*Math.cos(i/l),s*Math.sin(i/l)]}function b(e,t,i,s="geographic"){if(!Object(a["j"])(e)||Object(r["j"])(i))return e;const n="vector-magdir"===t?e.clone():Object(r["t"])(m(e,t)),o=n.pixels[1];for(let r=0;r0){const[s,r]=v(y,O,t,l),[n,a]=v(b,m,t,l);k.push(s),k.push(r),k.push(e),k.push(i),k.push(n),k.push(a)}else{const[s,r]=v(y,g,t,l),[n,a]=v(x,w,t,l),[o,c]=v(j,S,t,l);T.push(e),T.push(i),T.push(o),T.push(c),T.push(n),T.push(a),T.push(s),T.push(r)}O+=n,m+=n,g+=n,w+=n,S+=n}const[M,I]=v(h+s/2,u+a,t,l),C=s/2+d,[V,D]=v(h+C,u+a,t,l),[A,z]=v(h+s/2,u-o,t,l),[E,L]=v(h+C,u-o,t,l);return{pennants:k,barbs:T,shaft:[M,I,V,D,A,z,E,L]}}function v(e,t,i,s=1){const r=Math.sqrt(e*e+t*t)/s,n=(2*Math.PI+Math.atan2(t,e))%(2*Math.PI);return[r,(2*Math.PI+n-i)%(2*Math.PI)]}const O=[0,1,3,6,10,16,21,27,33,40,47,55,63],j=[0,.5,1,1.5,2],S=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function R(e,t,i,s){const r=u(s||"knots",i);let n;for(n=1;ne>0).length:f*p,w=new Float32Array(g*l),_=new Uint32Array(c*g);for(let h=0;h=c){var m;const i=null!=(m=(o[t]+360)%360/180*Math.PI)?m:2*Math.PI*Math.random(),{pennants:n,barbs:a,shaft:c}=T[Math.min(Math.floor(u/5),29)];if(n.length+a.length===0)continue;let y=d.length/l;const g=(e+.5)/s,x=(h+.5)/r;for(let e=0;e=(v-m)*(O-y)*(1-r)){w[s]=1;const[e,i]=f([g[s]/t,x[s]/t]);g[s]=e,x[s]=i}else w[s]=0,g[s]=0,x[s]=0}const v=new n["a"]({width:b,height:m,pixels:[g,x],mask:w});return v.updateStatistics(),v}},"218c":function(e,t,i){"use strict";i.d(t,"a",(function(){return d})),i.d(t,"b",(function(){return b})),i.d(t,"c",(function(){return f})),i.d(t,"d",(function(){return c})),i.d(t,"e",(function(){return p})),i.d(t,"f",(function(){return h})),i.d(t,"g",(function(){return u})),i.d(t,"h",(function(){return y}));i("e06a");var s=i("b2b2");class r{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.refCount--,e.refCount<=0&&(s.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.ts=Date.now(),e.refCount++,s.delete(i),s.set(i,e),e.block}return null}putBlock(e,t,i,s=null){const r=this._cachedBlocks,n=e+"/"+t;if(r.has(n)){const e=r.get(n);e.ts=Date.now(),e.refCount++}else r.set(n,{block:i,ts:Date.now(),refCount:1,controller:s});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,s=e+"/"+t;i.has(s)&&i.delete(s)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval(()=>{const t=Array.from(e),i=Date.now();for(let s=0;s=e.size)return;const t=Array.from(e);for(let i=0;inull!=e)||o.delete(e)}}function d(e,t,i){if(!o.has(e))return null==t?l.decreaseRefCount(e,i):0;const s=o.get(e);if(null==s[t])return l.decreaseRefCount(e,i);const r=s[t].cache;if(r.has(i)){const e=r.get(i);if(e.refCount--,0===e.refCount){r.delete(i);for(let e=0;ea.isResolved=!0).catch(()=>a.isRejected=!0),n[t].cache.set(i,a)}function b(e,t,i){if(!o.has(e))return void(null==t&&l.deleteBlock(e,i));const s=o.get(e);null!=s[t]?s[t].cache.delete(i):l.deleteBlock(e,i)}function m(e,t){if(!o.has(e))return null;const i=o.get(e);return null==i[t]?null:i[t]}function y(e,t,i,r,o,l,c=null){const h=m(e,t),u=h.extent,{cache:d,rasterInfo:f}=h;if(u&&u.xmin===i.xmin&&u.xmax===i.xmax&&u.ymin===i.ymin&&u.ymax===i.ymax)return;const p=i.clone().normalize(),{spatialReference:b,transform:y}=f,g=new Set;for(let m=0;m0?x.pyramidBlockWidth:x.blockWidth,S=h>0?x.pyramidBlockHeight:x.blockHeight,R=1,P=Math.max(0,Math.floor(_.x/j)-R),k=Math.max(0,Math.floor(_.y/S)-R),T=Math.floor((_.x+v-1)/j)+R,M=Math.floor((_.y+O-1)/S)+R;for(let s=k;s<=M;s++)for(let e=P;e<=T;e++)g.add(`${h}/${s}/${e}`)}d.forEach((e,t)=>{if(!g.has(t)){const e=d.get(t);(null==e||e.isResolved||e.isRejected)&&d.delete(t)}}),h.extent={xmin:i.xmin,ymin:i.ymin,xmax:i.xmax,ymax:i.ymax}}},2616:function(e,t,i){"use strict";i.d(t,"a",(function(){return d})),i.d(t,"b",(function(){return w}));i("e06a");var s=i("e92d"),r=i("38a4"),n=i("b2b2"),a=i("f4cc"),o=i("880d"),l=i("7f83"),c=i("3af1");const h=s["a"].getLogger("esri.views.2d.engine.flow.dataUtils"),u=9;async function d(e,t,i){const s=performance.now(),r=f(e,t),n=performance.now(),o=b(e,r,t.width,t.height),l=performance.now(),c=y(o,!0),u=performance.now(),d=g(c),p=performance.now();if(e.profile){const e={"_createFlowFieldFromData()":Math.round(n-s),"_getStreamlines()":Math.round(l-n),"createAnimatedLinesData()":Math.round(u-l),"createLinesMesh()":Math.round(p-u),"Total elapsed time":Math.round(p-s)};h.info("createStreamlinesMesh profile",e)}return await Promise.resolve(),Object(a["v"])(i),d}function f(e,t){const i=m(t.data,t.width,t.height,e.smoothing);return e.interpolate?(e,s)=>{const r=Math.floor(e),n=Math.floor(s);if(r<0||r>=t.width)return[0,0];if(n<0||n>=t.height)return[0,0];const a=e-r,o=s-n,l=r,c=n,h=r{const r=Math.round(e),n=Math.round(s);return r<0||r>=t.width||n<0||n>=t.height?[0,0]:[i[2*(n*t.width+r)+0],i[2*(n*t.width+r)+1]]}}function p(e,t,i,s,r,n,a,o,l){const c=[];let h=i,u=s,d=0,[f,p]=t(h,u);f*=e.velocityScale,p*=e.velocityScale;const b=Math.sqrt(f*f+p*p);let m,y;c.push({x:h,y:u,t:d,speed:b});for(let g=0;ge.maxTurnAngle)return c;if(e.mergeLines){const e=Math.round(h*l),t=Math.round(u*l);if(e<0||e>a-1||t<0||t>o-1)return c;const i=n[t*a+e];if(-1!==i&&i!==r)return c;n[t*a+e]=r}c.push({x:h,y:u,t:d,speed:f}),m=p,y=b}return c}function b(e,t,i,s){const r=[],n=new o["a"],a=1/Math.max(e.lineCollisionWidth,1),l=Math.round(i*a),c=Math.round(s*a),h=new Int32Array(l*c);for(let o=0;oe.sort-t.sort);for(const{x:o,y:d}of u)if(n.getFloat()=t)continue;const l=n[o+r];s+=l*e[2*(c*t+(i+o))+0],a+=l*e[2*(c*t+(i+o))+1]}o[2*(c*t+i)+0]=s,o[2*(c*t+i)+1]=a}const l=new Float32Array(e.length);for(let c=0;c=i)continue;const h=n[l+r];s+=h*o[2*((e+l)*t+c)+0],a+=h*o[2*((e+l)*t+c)+1]}l[2*(e*t+c)+0]=s,l[2*(e*t+c)+1]=a}return l}function y(e,t){const i=new o["a"],s=e.reduce((e,t)=>e+t.length,0),r=new Float32Array(4*s),n=new Array(e.length);let a=0,l=0;for(const o of e){const e=a;for(const t of o)r[4*a+0]=t.x,r[4*a+1]=t.y,r[4*a+2]=t.t,r[4*a+3]=t.speed,a++;n[l++]={startVertex:e,numberOfVertices:o.length,totalTime:o[o.length-1].t,timeSeed:t?i.getFloat():0}}return{lineVertices:r,lineDescriptors:n}}function g(e,t=10){const{lineVertices:i,lineDescriptors:s}=e;let r=0,n=0;for(const u of s)r+=2*u.numberOfVertices,n+=6*(u.numberOfVertices-1);const a=new Float32Array(r*u),o=new Uint32Array(n);let l=0,c=0;function h(){o[c++]=l-2,o[c++]=l,o[c++]=l-1,o[c++]=l,o[c++]=l+1,o[c++]=l-1}function d(e,t,i,s,r,n,o,c){const h=l*u;let d=0;a[h+d++]=e,a[h+d++]=t,a[h+d++]=1,a[h+d++]=i,a[h+d++]=n,a[h+d++]=o,a[h+d++]=s/2,a[h+d++]=r/2,a[h+d++]=c,l++,a[h+d++]=e,a[h+d++]=t,a[h+d++]=-1,a[h+d++]=i,a[h+d++]=n,a[h+d++]=o,a[h+d++]=-s/2,a[h+d++]=-r/2,a[h+d++]=c,l++}for(const u of s){const{totalTime:e,timeSeed:s}=u;let r=null,n=null,a=null,o=null,l=null,c=null;for(let f=0;f0){g=p-r,x=b-n;const i=Math.sqrt(g*g+x*x);if(g/=i,x/=i,f>1){let e=g+l,i=x+c;const s=Math.sqrt(e*e+i*i);e/=s,i/=s;const r=Math.min(1/(e*g+i*x),t);e*=r,i*=r,w=-i,_=e}else w=-x,_=g;null!==w&&null!==_&&(d(r,n,a,w,_,e,s,y),h())}r=p,n=b,a=m,l=g,c=x,o=y}d(r,n,a,-c,l,e,s,o)}return{vertexData:a,indexData:o}}function x(e,t){const i=t.pixels,{width:s,height:n}=t,a=new Float32Array(s*n*2);if("vector-uv"===e)for(let r=0;r=i||(g.data[2*(e*i+x+t)+0]=l.data[2*(e*l.width+t)+0],g.data[2*(e*i+x+t)+1]=l.data[2*(e*l.width+t)+1]);x+=l.width}return g}async function _(e,t,i,s,r,a){const o={requestProjectedLocalDirections:!0,signal:a};if(Object(n["k"])(r)&&(o.timeExtent=r),"imagery"===e.type){await e.load({signal:a});const r=e.rasterInfo.dataType,l=await e.fetchImage(t,i,s,o);return!l||Object(n["j"])(l.pixelData)||Object(n["j"])(l.pixelData.pixelBlock)?{data:new Float32Array(i*s*2),width:i,height:s}:x(r,l.pixelData.pixelBlock)}await e.load({signal:a});const l=e.rasterInfo.dataType,c=await e.fetchPixels(t,i,s,o);return!c||Object(n["j"])(c.pixelBlock)?{data:new Float32Array(i*s*2),width:i,height:s}:x(l,c.pixelBlock)}},"45a5":function(e,t,i){"use strict";i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return n}));var s=i("fa8a");const r=new s["a"]({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function n(e){return r.toJSON(e)}function a(e){const{bandCount:t,attributeTable:i,colormap:s,pixelType:r}=e.rasterInfo;return 1===t&&(null!=i||null!=s||"u8"===r||"s8"===r)}},"566d":function(e,t,i){"use strict";i.d(t,"a",(function(){return k}));var s=i("a4ee"),r=i("2c4f"),n=i("7d7d"),a=i("ce50"),o=i("477c"),l=i("59b2"),c=(i("b50f"),i("c120"),i("cea0"),i("d386")),h=i("00c0"),u=i("6a0ed");i("e92d"),i("2dd4");let d=class extends u["a"]{};d=Object(s["a"])([Object(c["a"])("esri.views.layers.support.ClipArea")],d);const f=d;var p;let b=p=class extends f{constructor(){super(...arguments),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new p({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}get version(){return(this._get("version")||0)+1}};Object(s["a"])([Object(l["b"])({type:[Number,String],json:{write:!0}})],b.prototype,"left",void 0),Object(s["a"])([Object(l["b"])({type:[Number,String],json:{write:!0}})],b.prototype,"right",void 0),Object(s["a"])([Object(l["b"])({type:[Number,String],json:{write:!0}})],b.prototype,"top",void 0),Object(s["a"])([Object(l["b"])({type:[Number,String],json:{write:!0}})],b.prototype,"bottom",void 0),Object(s["a"])([Object(l["b"])({readOnly:!0})],b.prototype,"version",null),b=p=Object(s["a"])([Object(c["a"])("esri.views.layers.support.ClipRect")],b);const m=b;i("e06a");var y,g=i("3760"),x=i("a9ab"),w=i("3af1"),_=i("1219");const v={base:g["a"],key:"type",typeMap:{extent:w["a"],polygon:_["a"]}};let O=y=class extends f{constructor(){super(...arguments),this.type="geometry",this.geometry=null}get version(){return(this._get("version")||0)+1}clone(){return new y({geometry:this.geometry.clone()})}};Object(s["a"])([Object(l["b"])({types:v,json:{read:x["a"],write:!0}})],O.prototype,"geometry",void 0),Object(s["a"])([Object(l["b"])({readOnly:!0})],O.prototype,"version",null),O=y=Object(s["a"])([Object(c["a"])("esri.views.layers.support.Geometry")],O);const j=O;let S=class extends f{constructor(){super(...arguments),this.type="path",this.path=[]}get version(){return(this._get("version")||0)+1}};Object(s["a"])([Object(l["b"])({type:[[[Number]]],json:{write:!0}})],S.prototype,"path",void 0),Object(s["a"])([Object(l["b"])({readOnly:!0})],S.prototype,"version",null),S=Object(s["a"])([Object(c["a"])("esri.views.layers.support.Path")],S);const R=S,P=r["a"].ofType({key:"type",base:f,typeMap:{rect:m,path:R,geometry:j}}),k=e=>{let t=class extends e{constructor(){super(...arguments),this.attached=!1,this.clips=new P,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1}initialize(){var e,t,i,s;const r=null==(e=null==(t=this.view)?void 0:t.spatialReferenceLocked)||e;(null==(i=this.view)?void 0:i.spatialReference)&&r&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new a["a"]("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new h["a"]),this.container.fadeTransitionEnabled=!0,this.container.opacity=0,this.container.clips=this.clips,this.handles.add([Object(o["e"])(()=>this.suspended,e=>{this.container&&(this.container.visible=!e),this.view&&!e&&this.updateRequested&&this.view.requestUpdate()},o["d"]),Object(o["e"])(()=>{var e,t;return null!=(e=null==(t=this.layer)?void 0:t.opacity)?e:1},e=>{this.container&&(this.container.opacity=e)},o["d"]),Object(o["e"])(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",e=>{this.container&&(this.container.blendMode=e)},o["d"]),Object(o["e"])(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,e=>{this.container&&(this.container.effect=e)},o["d"]),Object(o["b"])(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)})]),null!=(s=this.view)&&s.whenLayerView?this.view.whenLayerView(this.layer).then(e=>{e===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1}get spatialReferenceSupported(){var e;const t=null==(e=this.view)?void 0:e.spatialReference;return null==t||this.supportsSpatialReference(t)}get updating(){var e;return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!(null==(e=this.updatingHandles)||!e.updating))}get visibleAtCurrentScale(){return this.isVisibleAtScale(this.view.scale)}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.detach(),this.updateRequested=!1)}isVisibleAtScale(e){const t=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;if(!t)return!0;const{minScale:i,maxScale:s}=t;return(0===i||e<=i)&&(0===s||e>=s)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.suspended||this.view.requestUpdate())}processUpdate(e){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",e),this.updateRequested&&!this.suspended&&(this.updateRequested=!1,this.update(e))):this.updateRequested=!1}hitTest(e,t){return Promise.resolve(null)}supportsSpatialReference(e){return!0}canResume(){return!!this.spatialReferenceSupported&&!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const e=super.getSuspendInfo(),t=!this.spatialReferenceSupported,i=this.visibleAtCurrentScale;return t&&(e.spatialReferenceNotSupported=t),i&&(e.outsideScaleRange=i),e}};return Object(s["a"])([Object(l["b"])()],t.prototype,"attached",void 0),Object(s["a"])([Object(l["b"])({type:P,set(e){const t=Object(n["b"])(e,this._get("clips"),P);this._set("clips",t)}})],t.prototype,"clips",void 0),Object(s["a"])([Object(l["b"])()],t.prototype,"container",void 0),Object(s["a"])([Object(l["b"])()],t.prototype,"moving",void 0),Object(s["a"])([Object(l["b"])({readOnly:!0})],t.prototype,"spatialReferenceSupported",null),Object(s["a"])([Object(l["b"])({readOnly:!0})],t.prototype,"updateParameters",void 0),Object(s["a"])([Object(l["b"])()],t.prototype,"updateRequested",void 0),Object(s["a"])([Object(l["b"])()],t.prototype,"updating",null),Object(s["a"])([Object(l["b"])()],t.prototype,"view",void 0),Object(s["a"])([Object(l["b"])({readOnly:!0})],t.prototype,"visibleAtCurrentScale",null),t=Object(s["a"])([Object(c["a"])("esri.views.2d.layers.LayerView2D")],t),t}},6722:function(e,t,i){"use strict";i.d(t,"a",(function(){return c}));var s=i("c120"),r=i("c84e"),n=i("9a02"),a=i("6f75"),o=i("ec5e");const l=(e,t)=>e.key.level-t.key.level!=0?e.key.level-t.key.level:e.key.row-t.key.row!=0?e.key.row-t.key.row:e.key.col-t.key.col;class c extends n["a"]{constructor(e){super(),this._tileInfoView=e}get requiresDedicatedFBO(){return!1}renderChildren(e){this.sortChildren(l),this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:t}=e,i=super.createRenderParams(e);return i.requiredLevel=this._tileInfoView.getClosestInfoForScale(t.scale).level,i.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(t.scale),i}prepareRenderPasses(e){const t=super.prepareRenderPasses(e);return t.push(e.registerRenderPass({name:"stencil",brushes:[o["a"]],drawPhase:r["c"].DEBUG|r["c"].MAP|r["c"].HIGHLIGHT,target:()=>this.getStencilTarget()})),Object(s["a"])("esri-tiles-debug")&&t.push(e.registerRenderPass({name:"tileInfo",brushes:[a["a"]],drawPhase:r["c"].DEBUG,target:()=>this.children})),t}getStencilTarget(){return this.children}updateTransforms(e){for(const t of this.children){const i=this._tileInfoView.getTileResolution(t.key);t.setTransform(e,i)}}setStencilReference(e){let t=1;for(const i of this.children)i.stencilRef=t++}}},"6c7a":function(e,t,i){"use strict";i.d(t,"a",(function(){return c}));var s=i("a4ee"),r=i("e92d"),n=i("f4cc"),a=i("477c"),o=i("59b2"),l=(i("b50f"),i("c120"),i("cea0"),i("d386"));const c=e=>{let t=class extends e{initialize(){this.handles.add(Object(a["b"])(()=>this.layer,"refresh",e=>{this.doRefresh(e.dataChanged).catch(e=>{Object(n["m"])(e)||r["a"].getLogger(this.declaredClass).error(e)})}),"RefreshableLayerView")}};return Object(s["a"])([Object(o["b"])()],t.prototype,"layer",void 0),t=Object(s["a"])([Object(l["a"])("esri.layers.mixins.RefreshableLayerView")],t),t}},"72d8":function(e,t,i){"use strict";i.d(t,"a",(function(){return d}));var s=i("a4ee"),r=i("8d60"),n=i("ce50"),a=i("b2b2"),o=i("59b2"),l=(i("b50f"),i("c120"),i("cea0"),i("d386")),c=i("22f4"),h=i("b4e0"),u=i("ad73");const d=e=>{let t=class extends e{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return this.projectFullExtent(this.view.spatialReference)}get hasTilingEffects(){return this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment}get datumTransformation(){return Object(h["b"])(Object(a["t"])(this.layer.fullExtent),this.view.spatialReference,!0)}supportsSpatialReference(e){return!!this.projectFullExtent(e)}projectFullExtent(e){const t=Object(a["t"])(this.layer.fullExtent),i=Object(h["b"])(t,e,!1);return Object(h["h"])(t,e,i)}async fetchPopupFeatures(e,t){const{layer:i}=this;if(!e)return Promise.reject(new n["a"]("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:i}));const{popupEnabled:s}=i,o=Object(u["a"])(i,t);if(!s||!Object(a["k"])(o))throw new n["a"]("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:s,popupTemplate:o});const l=[],{value:c,magdirValue:h}=await i.identify(e,{timeExtent:this.timeExtent});let d="";if(c&&c.length){var f,p;d="imagery-tile"===i.type&&i.hasStandardTime()&&null!=c[0]?c.map(e=>i.getStandardTimeValue(e)).join(", "):c.join(", ");const e={ObjectId:0},t="Raster.ServicePixelValue";e[t]=this._formatAttributeValue(d,t);const s=null==(f=i.rasterInfo)||null==(p=f.attributeTable)?void 0:p.features;if(s&&s.length>0){const t=s.filter(e=>{const t=e.attributes.value||e.attributes.Value||e.attributes.VALUE;return String(t)===d});if(t.length>0){const i=t[0];if(i)for(const t in i.attributes)if(i.attributes.hasOwnProperty(t)){const s=this._rasterFieldPrefix+t;e[s]=this._formatAttributeValue(i.attributes[t],s)}}}const n=i.rasterInfo.dataType;"vector-magdir"!==n&&"vector-uv"!==n||(e["Raster.Magnitude"]=null==h?void 0:h[0],e["Raster.Direction"]=null==h?void 0:h[1]);const a=new r["a"](this.fullExtent.clone(),null,e);a.layer=i,a.sourceLayer=a.layer,l.push(a)}return l}_formatAttributeValue(e,t){if("string"==typeof e){const i=this.layer.popupTemplate&&this.layer.popupTemplate.fieldInfos,s=this._getFieldInfo(i,t),r=s&&s.format;if(r){let t,i;return e.trim().indexOf(",")>-1?(t=",",i=t+" ",this._formatDelimitedString(e,t,i,r)):e.trim().indexOf(" ")>-1?(t=i=" ",this._formatDelimitedString(e,t,i,r)):this._formatNumberFromString(e,r)}}return e}_getFieldInfo(e,t){if(!e||!e.length||!t)return;const i=t.toLowerCase();let s;return e.some(e=>!(!e.fieldName||e.fieldName.toLowerCase()!==i&&e.fieldName.toLowerCase()!==i.replace(/ /g,"_"))&&(s=e,!0)),s}_formatDelimitedString(e,t,i,s){return e&&t&&i&&s?e.trim().split(t).map(e=>this._formatNumberFromString(e,s)).join(i):e}_formatNumberFromString(e,t){if(!e||!t)return e;const i=Number(e);return isNaN(i)?e:t.format(i)}};return Object(s["a"])([Object(o["b"])()],t.prototype,"layer",void 0),Object(s["a"])([Object(o["b"])(c["a"])],t.prototype,"timeExtent",void 0),Object(s["a"])([Object(o["b"])()],t.prototype,"view",void 0),Object(s["a"])([Object(o["b"])()],t.prototype,"fullExtent",null),Object(s["a"])([Object(o["b"])()],t.prototype,"tileInfo",void 0),Object(s["a"])([Object(o["b"])({readOnly:!0})],t.prototype,"hasTilingEffects",null),t=Object(s["a"])([Object(l["a"])("esri.views.layers.ImageryTileLayerView")],t),t}},"870c":function(e,t,i){"use strict";i.d(t,"a",(function(){return Q}));var s=i("a4ee"),r=i("8d60"),n=i("9096"),a=i("477c"),o=i("59b2"),l=(i("b50f"),i("c120"),i("cea0"),i("d386")),c=i("2616"),h=i("c9ee"),u=i("c84e"),d=i("9a02");class f extends d["a"]{constructor(){super(...arguments),this.flowStyle=null}get requiresDedicatedFBO(){return!1}doRender(e){super.doRender(e)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"flow",brushes:[h["a"]],target:()=>this.children,drawPhase:u["c"].MAP});return[...super.prepareRenderPasses(e),t]}}i("e06a");var p=i("fc29"),b=i("e92d"),m=i("38a4"),y=i("b2b2"),g=i("f4cc"),x=i("4ae5");const w=b["a"].getLogger("esri.views.2d.engine.flow.FlowDisplayData");class _{constructor(e,t,i,s){this.state={name:"created"},this.flowStyle=e,this.extent=t,this.size=i,this.pixelRatio=s}async load(){const e=new AbortController;this.state={name:"loading",abortController:e};const t=await this.flowStyle.loadResources({extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},e.signal);this.state={name:"loaded",resources:t}}prepareForRendering(e){if("loaded"!==this.state.name)return void w.error("Only loaded resources can be attached.");const t=this.state.resources;t.prepareForRendering(e),this.state={name:"attached",resources:t}}destroy(){if("loading"===this.state.name)return this.state.abortController.abort(),void(this.state={name:"detached"});"attached"===this.state.name&&(this.state.resources.detach(),this.state={name:"detached"})}update(e){return!!this.flowStyle.areResourcesCompatible(e.flowStyle)&&(!(!this.extent.equals(e.extent)||this.size[0]!==e.size[0]||this.size[1]!==e.size[1]||this.pixelRatio!==e.pixelRatio)&&(this.flowStyle=e.flowStyle,!0))}}var v=i("1c92"),O=i("8c71"),j=i("7c4b");class S extends j["a"]{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(e){this._displayData=e,this.requestRender()}clear(){Object(y["k"])(this._displayData)&&(this._displayData.destroy(),this._displayData=null,this.requestRender())}setTransform(e){const{displayData:t}=this;if(Object(y["j"])(t))return;const i=t.extent.xmin,s=t.extent.ymax,r=[0,0];e.toScreen(r,[i,s]);const n=(t.extent.xmax-t.extent.xmin)/t.size[0]/e.resolution,a=Object(m["h"])(e.rotation),{dvs:o}=this.transforms;Object(v["k"])(o,[-1,1,0]),Object(v["d"])(o,o,[2/(e.size[0]*e.pixelRatio),-2/(e.size[1]*e.pixelRatio),1]),Object(v["c"])(o,o,[r[0],r[1],0]),Object(v["n"])(o,o,a),Object(v["d"])(o,o,[n*e.pixelRatio,n*e.pixelRatio,1])}_createTransforms(){return{dvs:Object(O["b"])()}}}var R=i("3af1");const P=1.15,k=b["a"].getLogger("esri.views.2d.engine.flow.FlowStrategy");let T=class extends p["a"]{constructor(e){super(e),this._flowDisplayObject=new S,this._loading=null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear(),this.flowContainer.removeAllChildren()}get updating(){return null!=this._loading}update(e){const{flowStyle:t}=this.flowContainer;if(Object(y["j"])(t))return void this._clear();const{extent:i,rotation:s,resolution:r,pixelRatio:n}=e.state,a=I(i,s);a.expand(P);const o=[Math.round((a.xmax-a.xmin)/r),Math.round((a.ymax-a.ymin)/r)],l=new _(t,a,o,n);if(Object(y["k"])(this._loading)){if(this._loading.update(l))return;this._loading.destroy(),this._loading=null}!Object(y["j"])(this._flowDisplayObject.displayData)&&this._flowDisplayObject.displayData.update(l)||(l.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},e=>{Object(g["m"])(e)||(k.error("A resource failed to load.",e),this._loading=null)}),this._loading=l)}_clear(){this._flowDisplayObject.clear(),Object(y["k"])(this._loading)&&(this._loading.destroy(),this._loading=null)}};Object(s["a"])([Object(o["b"])()],T.prototype,"_loading",void 0),Object(s["a"])([Object(o["b"])()],T.prototype,"flowContainer",void 0),Object(s["a"])([Object(o["b"])()],T.prototype,"updating",null),T=Object(s["a"])([Object(l["a"])("esri.views.2d.engine.flow.FlowStrategy")],T);const M=T;function I(e,t){const i=new x["a"]({x:(e.xmax+e.xmin)/2,y:(e.ymax+e.ymin)/2,spatialReference:e.spatialReference}),s=e.xmax-e.xmin,r=e.ymax-e.ymin,n=Math.abs(Math.cos(Object(m["h"])(t))),a=Math.abs(Math.sin(Object(m["h"])(t))),o=n*s+a*r,l=a*s+n*r,c=new R["a"]({xmin:i.x-o/2,ymin:i.y-l/2,xmax:i.x+o/2,ymax:i.y+l/2,spatialReference:e.spatialReference});return c.centerAt(i),c}var C=i("7ce4"),V=i("d17d"),D=i("0fa6"),A=i("3f3e");const z=new Map;z.set("a_positionAndSide",0),z.set("a_timeInfo",1),z.set("a_extrude",2),z.set("a_speed",3);const E={geometry:[new A["a"]("a_positionAndSide",3,V["k"].FLOAT,0,36),new A["a"]("a_timeInfo",3,V["k"].FLOAT,12,36),new A["a"]("a_extrude",2,V["k"].FLOAT,24,36),new A["a"]("a_speed",1,V["k"].FLOAT,32,36)]};class L{constructor(e,t,i){this.values=i,this._vertexData=e,this._indexData=t}prepareForRendering(e){const t=C["a"].createVertex(e,V["D"].STATIC_DRAW,this._vertexData),i=C["a"].createIndex(e,V["D"].STATIC_DRAW,this._indexData),s=new D["a"](e,z,E,{geometry:t},i);this.vertexBuffer=t,this.indexBuffer=i,this.vertexArray=s,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose(),this.vertexBuffer.dispose(),this.indexBuffer.dispose()}get locations(){return z}}var F=i("a915");function G(e){const t=q(e),i=U(t),s=2*i,r=Math.round(Object(F["g"])(e.maxPathLength)/s)+1,n=i,a=10,o=N(e),l=W(e),{flowSpeed:c,trailLength:h,density:u}=e;return{lineRenderWidth:t,segmentLength:s,verticesPerLine:r,lineCollisionWidth:n,lineSpacing:a,lineColor:o,lineOpacity:l,lineSpeed:c,fadeDuration:h,density:u,smoothing:Object(F["g"])(e.smoothing),velocityScale:"flow-from"===e.flowRepresentation?1:-1,minWeightThreshold:.001,minSpeedThreshold:.001,maxTurnAngle:1,mergeLines:!0,interpolate:!0,profile:!1}}function U(e){return"constant"===e.kind?e.value[0]:e.values[e.values.length-1]}function B(e){const t=e.toRgba();return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function q(e){if(!e.hasVisualVariables("size"))return{kind:"constant",value:[Object(F["g"])(e.trailWidth)]};const t=e.getVisualVariablesForType("size")[0],i=[],s=[];let r;if(t.stops){for(const e of t.stops)i.push(e.value),s.push(e.size);r=t.stops.length}else i.push(t.minDataValue,t.maxDataValue),s.push(t.minSize,t.maxSize),r=2;return{kind:"ramp",stops:i,values:s,count:r}}function N(e){if(!e.hasVisualVariables("color"))return{kind:"constant",value:B(e.color)};const t=e.getVisualVariablesForType("color")[0],i=[],s=[];for(const r of t.stops)i.push(r.value),Array.prototype.push.apply(s,B(r.color));return{kind:"ramp",stops:i,values:s,count:t.stops.length}}function W(e){if(!e.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const t=e.getVisualVariablesForType("opacity")[0],i=[],s=[];for(const r of t.stops)i.push(r.value),s.push(r.opacity);return{kind:"ramp",stops:i,values:s,count:t.stops.length}}class H{constructor(e,t,i,s){this._loadImagery=e,this._createStreamlinesMesh=t,this._timeExtent=s,this._rendererSettings=G(i)}get animated(){return this._rendererSettings.lineSpeed>0}get renderSettings(){return this._rendererSettings}areResourcesCompatible(e){let t=!0;return t=t&&e._loadImagery===this._loadImagery,t=t&&e._createStreamlinesMesh===this._createStreamlinesMesh,t=t&&e._rendererSettings.verticesPerLine===this._rendererSettings.verticesPerLine,t=t&&e._rendererSettings.segmentLength===this._rendererSettings.segmentLength,t=t&&e._rendererSettings.lineSpacing===this._rendererSettings.lineSpacing,t=t&&e._rendererSettings.density===this._rendererSettings.density,t=t&&e._rendererSettings.smoothing===this._rendererSettings.smoothing,t=t&&e._rendererSettings.velocityScale===this._rendererSettings.velocityScale,t=t&&e._rendererSettings.minWeightThreshold===this._rendererSettings.minWeightThreshold,t=t&&e._rendererSettings.minSpeedThreshold===this._rendererSettings.minSpeedThreshold,t=t&&e._rendererSettings.mergeLines===this._rendererSettings.mergeLines,t=t&&e._rendererSettings.velocityScale===this._rendererSettings.velocityScale,t=t&&e._rendererSettings.interpolate===this._rendererSettings.interpolate,t=t&&e._rendererSettings.lineColor.kind===this._rendererSettings.lineColor.kind,t=t&&e._rendererSettings.lineOpacity.kind===this._rendererSettings.lineOpacity.kind,t=t&&e._rendererSettings.lineRenderWidth.kind===this._rendererSettings.lineRenderWidth.kind,t&&this._rendererSettings.mergeLines&&(t=e._rendererSettings.lineCollisionWidth===this._rendererSettings.lineCollisionWidth),t&&e._timeExtent!==this._timeExtent&&(t=!(!Object(y["k"])(e._timeExtent)||!Object(y["k"])(this._timeExtent))&&e._timeExtent.equals(this._timeExtent)),t}async loadResources(e,t){const{extent:i,size:s}=e;Object(g["v"])(t);const r=await this._loadImagery(i,s[0],s[1],this._timeExtent,t),{vertexData:n,indexData:a}=await this._createStreamlinesMesh(this._rendererSettings,r,t);return new L(n,a,{lineColor:this._rendererSettings.lineColor,lineOpacity:this._rendererSettings.lineOpacity,lineRenderWidth:this._rendererSettings.lineRenderWidth})}}let J=class extends n["a"]{constructor(){super(...arguments),this._loadImagery=(e,t,i,s,r)=>Object(c["b"])(this.layer,e,t,i,s,r),this._createStreamlinesMesh=(e,t,i)=>this.layer.createStreamlinesMesh({flowData:t,rendererSettings:e},{signal:i}),this.attached=!1,this.container=null,this.layer=null,this.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this._strategy||this._strategy.updating}attach(){const{layer:e}=this,t=()=>{this._loadImagery=(t,i,s,r,n)=>Object(c["b"])(e,t,i,s,r,n),this._updateVisualization()};"multidimensionalDefinition"in e?this.handles.add(Object(a["e"])(()=>e.multidimensionalDefinition,t)):this.handles.add([Object(a["e"])(()=>e.mosaicRule,t),Object(a["e"])(()=>e.renderingRule,t),Object(a["e"])(()=>e.definitionExpression,t)]),this.container=new f,this._strategy=new M({flowContainer:this.container}),this._updateVisualization()}detach(){this._strategy.destroy(),this.container.removeAllChildren(),this.container=null,this.handles.removeAll()}update(e){e.stationary?this._strategy.update(e):this.layerView.requestUpdate()}hitTest(e){return new r["a"]({attributes:{},geometry:e.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){if("flow"!==this.layer.renderer.type)return;const e=new H(this._loadImagery,this._createStreamlinesMesh,this.layer.renderer,this.timeExtent);this.container.flowStyle=e,this.layerView.requestUpdate()}};Object(s["a"])([Object(o["b"])()],J.prototype,"_strategy",void 0),Object(s["a"])([Object(o["b"])()],J.prototype,"attached",void 0),Object(s["a"])([Object(o["b"])()],J.prototype,"container",void 0),Object(s["a"])([Object(o["b"])()],J.prototype,"layer",void 0),Object(s["a"])([Object(o["b"])()],J.prototype,"layerView",void 0),Object(s["a"])([Object(o["b"])()],J.prototype,"type",void 0),Object(s["a"])([Object(o["b"])()],J.prototype,"updating",null),Object(s["a"])([Object(o["b"])()],J.prototype,"timeExtent",void 0),J=Object(s["a"])([Object(l["a"])("esri.views.2d.engine.flow.FlowView2D")],J);const Q=J},"9a02":function(e,t,i){"use strict";i.d(t,"a",(function(){return k}));i("c120");var s=i("b2b2"),r=i("8c71"),n=i("3b1a"),a=i("00c0"),o=i("ce50"),l=i("e92d"),c=i("7c4b"),h=i("9812"),u=i("3349"),d=i("02f1"),f=i("6655"),p=i("8152"),b=i("d114"),m=i("7ce4"),y=i("d17d");const g=l["a"].getLogger("esri.views.2d.engine.webgl.Mesh2D"),x=e=>{switch(e.BYTES_PER_ELEMENT){case 1:return y["k"].UNSIGNED_BYTE;case 2:return y["k"].UNSIGNED_SHORT;case 4:return y["k"].UNSIGNED_INT;default:throw new o["a"]("Cannot get DataType of array")}},w=(e,t,i,s)=>{let r=0;for(let n=1;n0:r<0},_=({coords:e,lengths:t},i)=>{const s=[];for(let r=0,n=0;r({...i,[s]:m["a"].createVertex(e,t,this.vertices[s])}),{})),this._cache.vertexBuffers}}var O=i("0fa6");const j=l["a"].getLogger("esri.views.2d.engine.webgl.ClippingInfo"),S=e=>parseFloat(e)/100;class R extends c["a"]{constructor(e,t){super(),this._clip=t,this._cache={},this.stage=e,this._handle=t.watch("version",()=>this._invalidate()),this.ready()}static fromClipArea(e,t){return new R(e,t)}_destroyGL(){Object(s["k"])(this._cache.mesh)&&(this._cache.mesh.destroy(),this._cache.mesh=null),Object(s["k"])(this._cache.vao)&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL(),this._handle.remove()}getVAO(e,t,i,r){const[n,a]=t.size;if("geometry"!==this._clip.type&&this._lastWidth===n&&this._lastHeight===a||(this._lastWidth=n,this._lastHeight=a,this._destroyGL()),Object(s["j"])(this._cache.vao)){const s=this._createMesh(t,this._clip),n=s.getIndexBuffer(e),a=s.getVertexBuffers(e);this._cache.mesh=s,this._cache.vao=new O["a"](e,i,r,a,n)}return this._cache.vao}_createTransforms(){return{dvs:Object(r["b"])()}}_invalidate(){this._destroyGL(),this.requestRender()}_createScreenRect(e,t){const[i,s]=e.size,r="string"==typeof t.left?S(t.left)*i:t.left,n="string"==typeof t.right?S(t.right)*i:t.right,a="string"==typeof t.top?S(t.top)*s:t.top,o="string"==typeof t.bottom?S(t.bottom)*s:t.bottom,l=r,c=a;return{x:l,y:c,width:Math.max(i-n-l,0),height:Math.max(s-o-c,0)}}_createMesh(e,t){switch(t.type){case"rect":return v.fromRect(this._createScreenRect(e,t));case"path":return v.fromPath(t);case"geometry":return v.fromGeometry(e,t);default:return j.error(new o["a"]("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),v.fromRect({x:0,y:0,width:1,height:1})}}}var P=i("c84e");class k extends a["a"]{constructor(){super(...arguments),this.name=this.constructor.name}set clips(e){this._clips=e,this.children.forEach(t=>t.clips=e),this._updateClippingInfo()}_createTransforms(){return{dvs:Object(r["b"])()}}doRender(e){const t=this.createRenderParams(e),{painter:i,globalOpacity:s,profiler:r,drawPhase:n}=t,a=n===P["c"].LABEL||n===P["c"].HIGHLIGHT?1:s*this.computedOpacity;r.recordContainerStart(this.name),i.beforeRenderLayer(t,this._clippingInfos?255:0,a),this.updateTransforms(e.state),this.renderChildren(t),i.compositeLayer(t,a),r.recordContainerEnd()}renderChildren(e){Object(s["j"])(this._renderPasses)&&(this._renderPasses=this.prepareRenderPasses(e.painter));for(const i of this.children)i.beforeRender(e);for(const i of this._renderPasses)try{i.render(e)}catch(t){}for(const i of this.children)i.afterRender(e)}createRenderParams(e){return e.requireFBO=this.requiresDedicatedFBO,e}prepareRenderPasses(e){return[e.registerRenderPass({name:"clip",brushes:[n["a"].clip],target:()=>this._clippingInfos,drawPhase:P["c"].MAP|P["c"].LABEL|P["c"].LABEL_ALPHA|P["c"].DEBUG|P["c"].HIGHLIGHT})]}updateTransforms(e){for(const t of this.children)t.setTransform(e)}onAttach(){super.onAttach(),this._updateClippingInfo()}onDetach(){super.onDetach(),this._updateClippingInfo()}_updateClippingInfo(){if(Object(s["k"])(this._clippingInfos)&&(this._clippingInfos.forEach(e=>e.destroy()),this._clippingInfos=null),!this.stage)return;const e=this._clips;Object(s["k"])(e)&&e.length&&(this._clippingInfos=e.items.map(e=>R.fromClipArea(this.stage,e))),this.requestRender()}}},ad73:function(e,t,i){"use strict";i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return n}));var s=i("b2b2"),r=i("c1da");async function n(e,t=e.popupTemplate){if(!Object(s["k"])(t))return[];const i=await t.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:n}=t,{objectIdField:a,typeIdField:o,globalIdField:l,relationships:c}=e;if(i.includes("*"))return["*"];const h=n?await Object(r["n"])(e):[],u=Object(r["j"])(e.fieldsIndex,[...i,...h]);return o&&u.push(o),u&&a&&e.fieldsIndex.has(a)&&-1===u.indexOf(a)&&u.push(a),u&&l&&e.fieldsIndex.has(l)&&-1===u.indexOf(l)&&u.push(l),c&&c.forEach(t=>{const{keyField:i}=t;u&&i&&e.fieldsIndex.has(i)&&-1===u.indexOf(i)&&u.push(i)}),u}function a(e,t){return e.popupTemplate?e.popupTemplate:Object(s["k"])(t)&&t.defaultPopupTemplateEnabled&&Object(s["k"])(e.defaultPopupTemplate)?e.defaultPopupTemplate:null}},aebc:function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return te}));var s=i("a4ee"),r=i("8d60"),n=i("e92d"),a=i("f4cc"),o=i("477c"),l=i("3795"),c=i("59b2"),h=(i("b50f"),i("c120"),i("cea0"),i("d386")),u=i("870c"),d=i("566d"),f=i("b2b2"),p=i("9180"),b=i("a98b"),m=i("3b1a"),y=i("8c71"),g=i("f440"),x=i("e4b1");class w extends x["a"]{constructor(e,t,i,s,r,n=null){super(e,t,i,s,r),this.bitmap=new g["a"](n,null,null),this.bitmap.coordScale=[s,r],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}setTransform(e,t){super.setTransform(e,t),this.bitmap.transforms.dvs=this.transforms.dvs}_createTransforms(){return{dvs:Object(y["b"])(),tileMat3:Object(y["b"])()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}}var _=i("c84e"),v=i("6722");class O extends v["a"]{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(e){const t=this._getTileBounds(e),[i,s]=this._tileInfoView.tileInfo.size;return new w(e,t[0],t[3],i,s)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"imagery (tile)",brushes:[m["a"].raster],target:()=>this.children.map(e=>e.bitmap),drawPhase:_["c"].MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===_["c"].MAP&&super.doRender(e)}_getTileBounds(e){const t=this._tileInfoView.getTileBounds(Object(p["l"])(),e);if(this.isCustomTilingScheme&&e.world){const{tileInfo:i}=this._tileInfoView,s=Object(b["o"])(i.spatialReference);if(s){const{resolution:r}=i.lodAt(e.level),n=s/r%i.size[0],a=n?(i.size[0]-n)*r:0;t[0]-=a*e.world,t[2]-=a*e.world}}return t}}i("e06a");var j=i("9096"),S=i("4ae5"),R=i("3e27"),P=i("dff3"),k=i("218c"),T=i("9dee"),M=i("b4e0"),I=(i("3e7b"),i("018d")),C=(i("ae54"),i("07cd")),V=i("d302"),D=i("b2af"),A=i("3af1");const z=[0,0],E=n["a"].getLogger("esri.views.2d.layers.ImageryTileLayerView2D");let L=class extends j["a"]{constructor(){super(...arguments),this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=null,this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._globalUpdateRequested=!1,this.attached=!1,this.container=null,this.layer=null,this.timeExtent=null,this.redrawOrRefetch=Object(a["i"])((e,t)=>!this.previousLOD||this.layerView.suspended?Promise.resolve():e?this.doRefresh():this._redrawImage(t))}get useWebGLForProcessing(){var e;return null==(e=this._get("useWebGLForProcessing"))||e}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return null==this._get("useProgressiveUpdate")||this._get("useProgressiveUpdate")}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new V["a"]({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){var n;if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s=t.toJSON?t:A["a"].fromJSON(t);Object(k["h"])(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,(null==(n=this.previousLOD)?void 0:n.level)!==r.level&&(this.previousLOD=r,null==this._symbolizerParams||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()}));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._fetchQueue.updating||this._globalUpdateRequested||!(!this.updatingHandles||!this.updatingHandles.updating)}attach(){Object(D["a"])().supportsTextureFloat||(this.useWebGLForProcessing=!1),this._initializeTileInfo(),this._tileInfoView=new I["a"](this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new C["a"]({tileInfoView:this._tileInfoView,concurrency:e,process:(e,t)=>this._fetchTile1(e,t)});const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new V["a"]({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,Object(k["g"])(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(e){const t=this.container.createTile(e);return this._enqueueTileFetch(t),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",()=>{e.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(t&&Object(f["k"])(this._emptyTilePixelBlock))return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[i,s]=e,r=new R["a"]({width:i,height:s,pixels:[new Uint8Array(i*s)],mask:new Uint8Array(i*s),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=r),r}_fetchTile1(e,t){const i=!Object(f["j"])(t)&&t.signal,s=this.canUseWebGLForProcessing(),{layerView:r}=this,n=!r.tileInfo.isWrappable&&Object(f["k"])(Object(M["e"])(r.view.spatialReference)),a={allowPartialFill:!0,datumTransformation:r.datumTransformation,interpolation:s?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:s,signal:Object(f["t"])(i),srcResolution:this._srcResolutions[e.level],timeExtent:r.timeExtent,tileInfo:r.tileInfo,disableWrapAround:n};return this.fetchTile(e,a)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const e=this.layerView.view.spatialReference,t=new S["a"]({x:this.layerView.fullExtent.xmin,y:this.layerView.fullExtent.ymax,spatialReference:e}),{scales:i,srcResolutions:s,isCustomTilingScheme:r}=Object(M["a"])(this.layer.rasterInfo,e),n=P["a"].create({spatialReference:e,size:512,scales:i});(0===n.origin.x||n.origin.x>t.x)&&(n.origin=t),this._isCustomTilingScheme=r,this.layerView.set("tileInfo",n),this._srcResolutions=null!=s?s:[]}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.rasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key),{bandIds:s}=this.layer;let r=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length){r=!1;try{await this._redrawImage(this._abortController&&this._abortController.signal)}catch(i){Object(a["m"])(i)&&E.error(i)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&"rasterVF"!==this.type||this.layerView.hasTilingEffects||null!=this._symbolizerParams||this._updateSymbolizerParams();const n=this._tileInfoView.getTileCoords(z,e.key),o=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:t,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:r,bandIds:s,coords:n,resolution:o}),e.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(e)}catch(i){Object(a["m"])(i)||E.error(i)}this.layerView.requestUpdate()}}async _redrawImage(e){if(0===this.container.children.length)return;await this.updatingHandles.addPromise(this.layer.updateRenderer()),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(e):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const t=this.container.children.map(async e=>this.updateTileSymbolizerParameters(e,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await Object(a["j"])(t),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const t={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:e},i=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,t);if(!i||!i.pixelBlock)return;const s=this.layer.symbolizer.generateWebGLParameters({pixelBlock:Object(T["h"])(i.pixelBlock,this.layer.bandIds),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds});!this.canUseWebGLForProcessing()&&s&&"stretch"===s.type&&this.layer.renderer&&"raster-stretch"===this.layer.renderer.type&&(s.factor=s.factor.map(e=>255*e),s.outMin=Math.round(255*s.outMin),s.outMax=Math.round(255*s.outMax)),this._globalSymbolizerParams=s}_updateSymbolizerParams(){this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds})}_updateBlockCacheRegistry(e=!1){const{url:t,rasterInfo:i,raster:s}=this.layer,{multidimensionalDefinition:r}=this.layer.normalizeRasterFetchOptions({multidimensionalDefinition:this.layer.multidimensionalDefinition,timeExtent:this.layerView.timeExtent}),n=null!=i&&i.multidimensionalInfo?s.getSliceIndex(r):null,a=Object(k["d"])(t,n);if(a!==this._blockCacheRegistryUrl){if(null!=this._blockCacheRegistryUrl&&Object(k["g"])(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=Object(k["f"])(a,this.layer.raster.rasterInfo),e){const e=this._tileInfoView.getClosestInfoForScale(this.layerView.view.scale),t=this._srcResolutions[e.level];Object(k["h"])(a,this._blockCacheRegistryId,this.layerView.view.extent,this.layerView.view.resolution,t,this.layer.raster.ioConfig.sampling)}this._blockCacheRegistryUrl=a}}async doRefresh(){await this.updatingHandles.addPromise(this.layer.updateRenderer()),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._tileStrategy.tiles.forEach(t=>e.push(this._enqueueTileFetch(t))),await Object(a["j"])(e)}};Object(s["a"])([Object(c["b"])()],L.prototype,"_fetchQueue",void 0),Object(s["a"])([Object(c["b"])()],L.prototype,"_globalUpdateRequested",void 0),Object(s["a"])([Object(c["b"])()],L.prototype,"attached",void 0),Object(s["a"])([Object(c["b"])()],L.prototype,"container",void 0),Object(s["a"])([Object(c["b"])()],L.prototype,"layer",void 0),Object(s["a"])([Object(c["b"])()],L.prototype,"layerView",void 0),Object(s["a"])([Object(c["b"])()],L.prototype,"type",void 0),Object(s["a"])([Object(c["b"])()],L.prototype,"useWebGLForProcessing",null),Object(s["a"])([Object(c["b"])()],L.prototype,"useProgressiveUpdate",null),Object(s["a"])([Object(c["b"])()],L.prototype,"timeExtent",void 0),Object(s["a"])([Object(c["b"])()],L.prototype,"updating",null),L=Object(s["a"])([Object(h["a"])("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],L);var F=i("45a5");let G=class extends L{constructor(){super(...arguments),this.container=null,this.layer=null,this.type="raster"}attach(){super.attach(),this.container=new O(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){return this.useWebGLForProcessing&&this.layer.symbolizer.canRenderInWebGL&&!("majority"===this.layer.interpolation&&Object(F["a"])(this.layer))}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}async updateTileSource(e,t){const{bandIds:i}=this.layer,s=this._getLayerInterpolation(),r=this.canUseWebGLForProcessing(),{source:n,symbolizerParams:a,globalSymbolizerParams:o,suspended:l,coords:c,resolution:h}=t,{bitmap:u}=e;if([u.x,u.y]=c,u.resolution=h,n&&Object(f["k"])(n)&&Object(f["k"])(n.pixelBlock)){const e={extent:n.extent,pixelBlock:n.pixelBlock};if(u.rawPixelData=e,r)u.source=n.pixelBlock,u.isRendereredSource=!1;else{const t=await this.layer.applyRenderer(e,"stretch"===(null==o?void 0:o.type)?o:null);u.source=t,u.isRendereredSource=!0}u.symbolizerParameters=r?a:null,r?u.transformGrid||(u.transformGrid=n.transformGrid):u.transformGrid=null}else{const e=this.createEmptyTilePixelBlock();u.source=e,u.symbolizerParameters=r?a:null,u.transformGrid=null}u.bandIds=r?i:null,u.width=this._tileInfoView.tileInfo.size[0],u.height=this._tileInfoView.tileInfo.size[1],u.interpolation=s,u.suspended=l,u.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:i,global:s}=t,{bandIds:r}=this.layer,n=this._getLayerInterpolation(),a=this.canUseWebGLForProcessing(),{bitmap:o}=e,{rawPixelData:l}=o;!a&&Object(f["k"])(l)?(o.source=await this.layer.applyRenderer(l,"stretch"===(null==s?void 0:s.type)?s:null),o.isRendereredSource=!0):(o.isRendereredSource&&Object(f["k"])(l)&&(o.source=l.pixelBlock),o.isRendereredSource=!1),o.symbolizerParameters=a?s||i:null,o.bandIds=a?r:null,o.interpolation=n,o.suspended=!1}_getLayerInterpolation(){const e=this.layer.renderer.type;if("raster-colormap"===e||"unique-value"===e||"class-breaks"===e)return"nearest";const{interpolation:t}=this.layer,{renderer:i}=this.layer;return"raster-stretch"===i.type&&null!=i.colorRamp?"bilinear"===t||"cubic"===t?"bilinear":"nearest":t}};Object(s["a"])([Object(c["b"])()],G.prototype,"container",void 0),Object(s["a"])([Object(c["b"])()],G.prototype,"layer",void 0),Object(s["a"])([Object(c["b"])()],G.prototype,"type",void 0),G=Object(s["a"])([Object(h["a"])("esri.views.2d.layers.imagery.ImageryTileView2D")],G);const U=G;var B=i("19db"),q=i("3bc3"),N=i("1c92"),W=i("0722");class H extends x["a"]{constructor(e,t,i,s,r,n=null){super(e,t,i,s,r),this.tileData=new W["a"](n),this.tileData.coordScale=[s,r],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(e){this.tileData.stencilRef=e}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{dvs:Object(y["b"])(),tileMat3:Object(y["b"])()}}setTransform(e,t){super.setTransform(e,t);const i=t/(e.resolution*e.pixelRatio),s=this.transforms.tileMat3,[r,n]=this.tileData.offset,a=[this.x+r*t,this.y-n*t],[o,l]=e.toScreenNoRotation([0,0],a),{symbolTileSize:c}=this.tileData.symbolizerParameters,h=Math.round((this.width-this.tileData.offset[0])/c)*c,u=Math.round((this.height-this.tileData.offset[1])/c)*c,d=h/this.rangeX*i,f=u/this.rangeY*i;Object(N["o"])(s,d,0,0,0,f,0,o,l,1),Object(N["l"])(this.transforms.dvs,e.displayViewMat3,s),this.tileData.transforms.dvs=this.transforms.dvs}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}class J extends v["a"]{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(e){const t=this._tileInfoView.getTileBounds(Object(p["l"])(),e),[i,s]=this._tileInfoView.tileInfo.size;return new H(e,t[0],t[3],i,s)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"imagery (vf tile)",brushes:[q["a"]],target:()=>this.children.map(e=>e.tileData),drawPhase:_["c"].MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===_["c"].MAP&&this.symbolTypes.forEach(t=>{e.renderPass=t,super.doRender(e)})}}let Q=class extends L{constructor(){super(...arguments),this._handle=null,this.container=null,this.layer=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(e,t){t={...t,interpolation:"nearest",requestProjectedLocalDirections:!0};const i=await this.layer.fetchTile(e.level,e.row,e.col,t);return"vector-magdir"===this.layer.rasterInfo.dataType&&null!=i&&i.pixelBlock&&(i.pixelBlock=await this.layer.convertVectorFieldData(i.pixelBlock,t)),i}updateTileSource(e,t){const i=t.symbolizerParams,{tileData:s}=e;s.key=e.key,s.width=this._tileInfoView.tileInfo.size[0],s.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:r}=i,{source:n}=t;if(s.offset=this._getTileSymbolOffset(s.key,r),Object(f["k"])(n)&&Object(f["k"])(n.pixelBlock)){const e={extent:n.extent,pixelBlock:n.pixelBlock};s.rawPixelData=e,s.symbolizerParameters=i,s.source=this._sampleVectorFieldData(n.pixelBlock,i,s.offset)}else{const e=[Math.round((this._tileInfoView.tileInfo[0]-s.offset[0])/r),Math.round((this._tileInfoView.tileInfo[1]-s.offset[1])/r)],t=this.createEmptyTilePixelBlock(e);s.source=t,s.symbolizerParameters=i}return s.invalidateVAO(),Promise.resolve(null)}updateTileSymbolizerParameters(e,t){var i;const s=t.local,{symbolTileSize:r}=s,{tileData:n}=e;n.offset=this._getTileSymbolOffset(n.key,r);const a=n.symbolizerParameters.symbolTileSize;return n.symbolizerParameters=s,Object(f["k"])(null==(i=n.rawPixelData)?void 0:i.pixelBlock)&&a!==r&&(n.source=this._sampleVectorFieldData(n.rawPixelData.pixelBlock,n.symbolizerParameters,n.offset)),Promise.resolve(null)}attach(){super.attach(),this.container=new J(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=Object(o["e"])(()=>this.layer.renderer,e=>this._updateSymbolType(e))}detach(){super.detach(),this.container.removeAllChildren(),this._handle.remove(),this._handle=null}_getTileSymbolOffset(e,t){const i=e.col*this._tileInfoView.tileInfo.size[0]%t,s=e.row*this._tileInfoView.tileInfo.size[1]%t;return[i>t/2?t-i:-i,s>t/2?t-s:-s]}_sampleVectorFieldData(e,t,i){const{symbolTileSize:s}=t;return Object(B["g"])(e,"vector-uv",s,i)}_updateSymbolType(e){"vector-field"===e.type&&(this.container.symbolTypes="wind-barb"===e.style?["scalar","triangle"]:"simple-scalar"===e.style?["scalar"]:["triangle"])}};Object(s["a"])([Object(c["b"])()],Q.prototype,"container",void 0),Object(s["a"])([Object(c["b"])()],Q.prototype,"layer",void 0),Object(s["a"])([Object(c["b"])()],Q.prototype,"type",void 0),Q=Object(s["a"])([Object(h["a"])("esri.views.2d.layers.imagery.VectorFieldTileView2D")],Q);const Y=Q;var $=i("72d8"),X=i("365a"),K=i("6c7a");const Z=n["a"].getLogger("esri.views.2d.layers.ImageryTileLayerView2D");let ee=class extends(Object($["a"])(Object(K["a"])(Object(d["a"])(X["a"])))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}update(e){this.subview.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.handles.add([Object(l["e"])(this.layer,["bandIds","renderer","interpolation","multidimensionalDefinition"],(e,t,i)=>{const s="multidimensionalDefinition"===i,r="interpolation"===i&&("majority"===e||"majority"===t)&&Object(F["a"])(this.layer),n="renderer"===i&&t.type!==e.type;n&&this._updateSubview();const o=s||r||n;this.subview.redrawOrRefetch(o).catch(e=>{Object(a["m"])(e)||Z.error(e)}),this.notifyChange("updating")}),Object(o["e"])(()=>{var e;return null!=(e=this.layer.blendMode)?e:"normal"},e=>{this.subview.container.blendMode=e},o["d"]),Object(o["e"])(()=>{var e;return null!=(e=this.layer.effect)?e:null},e=>{this.subview.container.effect=e},o["d"]),Object(o["e"])(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch(!0).catch(e=>{Object(a["m"])(e)||Z.error(e)})},o["a"])],"attach")}detach(){var e;this.handles.remove("attach"),this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),null==(e=this.subview)||e.destroy(),this.subview=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}async hitTest(e,t){return[new r["a"]({attributes:{},geometry:e.clone()})]}doRefresh(){return this.subview.doRefresh()}_updateSubview(){const e="vector-field"===this.layer.renderer.type?"rasterVF":"flow"===this.layer.renderer.type?"flow":"raster";if(this.subview){var t;if(this.subview.type===e)return void this._attachSubview(this.subview);this._detachSubview(this.subview),null==(t=this.subview)||t.destroy(),this.subview=null}const{layer:i}=this;let s;s="rasterVF"===e?new Y({layer:i,layerView:this}):"flow"===e?new u["a"]({layer:i,layerView:this}):new U({layer:i,layerView:this}),"useWebGLForProcessing"in s&&(s.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in s&&(s.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in s&&(s.previousLOD=this.subview&&"previousLOD"in this.subview&&this.subview.previousLOD),this._attachSubview(s),this.subview=s,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0),e.container.blendMode=this.layer.blendMode,e.container.effect=this.layer.effect)}_detachSubview(e){null!=e&&e.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};Object(s["a"])([Object(c["b"])()],ee.prototype,"subview",void 0),Object(s["a"])([Object(c["b"])()],ee.prototype,"useWebGLForProcessing",null),Object(s["a"])([Object(c["b"])()],ee.prototype,"useProgressiveUpdate",null),ee=Object(s["a"])([Object(h["a"])("esri.views.2d.layers.ImageryTileLayerView2D")],ee);const te=ee},b4e0:function(e,t,i){"use strict";i.d(t,"a",(function(){return J})),i.d(t,"b",(function(){return _})),i.d(t,"c",(function(){return B})),i.d(t,"d",(function(){return G})),i.d(t,"e",(function(){return z})),i.d(t,"f",(function(){return F})),i.d(t,"g",(function(){return w})),i.d(t,"h",(function(){return D})),i.d(t,"i",(function(){return j})),i.d(t,"j",(function(){return v})),i.d(t,"k",(function(){return u})),i.d(t,"l",(function(){return W})),i.d(t,"m",(function(){return H}));i("e06a");var s=i("ce50"),r=i("b2b2"),n=i("8048"),a=i("9415"),o=i("8188"),l=i("3af1"),c=i("4ae5"),h=i("5996");function u(e,t,i){return!Object(o["b"])(e,t,i)}function d(e,t,i){const r=u(e,t,i);if(r&&!Object(o["h"])())throw new s["a"]("rasterprojectionhelper-project","projection engine is not loaded");return r}const f=function(e,t,i,s=0){if(1===i[0])return[0,0];let r=1,n=-1,a=1,o=-1;for(let m=0;me[m]?e[m]:r,n=n>e[m]?n:e[m],a=a>e[m+1]?e[m+1]:a,o=o>e[m+1]?o:e[m+1]);const{cols:l,rows:c}=t,h=(n-r)/l/i[0],u=(o-a)/c/i[1],d=2*s;let f=0,p=!1,b=[0,0];for(let m=0;mf&&(f=n+a,b=[n,a]),d&&f>d){p=!0;break}}if(p)break}return b},p={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},b=32,m=4,y=m,g=new Map,x=new Map;async function w(){if(Object(o["h"])())return null;await Object(o["i"])()}function _(e,t,i){return d(e.spatialReference,t)?i?Object(o["f"])(t,e.spatialReference,e):Object(o["f"])(e.spatialReference,t,e):null}function v(e,t,i,s=null){const a=e.spatialReference;if(a.equals(t))return e;d(a,t,s);const c=i.center,h=new l["a"]({xmin:c.x-e.x/2,xmax:c.x+e.x/2,ymin:c.y-e.y/2,ymax:c.y+e.y/2,spatialReference:a}),u=Object(o["m"])(h,t,s);if(Object(r["j"])(u))return null;const f={x:u.xmax-u.xmin,y:u.ymax-u.ymin},p=z(t);if(Object(r["k"])(p)&&f.x>=p){const i=Object(n["f"])(a)/Object(n["f"])(t);f.x=e.x*i,f.y=e.y*i}return f}function O(e,t=.01){return Object(n["f"])(e)?t/Object(n["f"])(e):0}function j(e,t,i=null,s=!0){const n=e.spatialReference;if(n.equals(t))return e;d(n,t,i);const a=Object(o["m"])(e,t,i);if(!s||!a)return a;const l=E(n,!0),c=E(t,!0),h=O(n);return h&&Object(r["k"])(l)&&Object(r["k"])(c)&&(a.x>0&&Math.abs(e.x-l[0])new c["a"](t[0],t[1],e.inSR));return Object(o["m"])(i,e.outSR,e.datumTransformation).map(e=>e?[e.x,e.y]:[NaN,NaN])}function P(e){const{inSR:t,outSR:i,datumTransformation:s}=e,n=T(t),{points:o,mask:l}=I(e,n);if(!t.isGeographic){const e=t.wkid?a["a"].coordsys(t.wkid):a["a"].fromString(t.isGeographic?a["b"].PE_TYPE_GEOGCS:a["b"].PE_TYPE_PROJCS,t.wkt);a["c"].projToGeog(e,o.length,o)}if(Object(r["k"])(s)&&s.steps.length&&s.steps.forEach(e=>{const t=e.wkid?a["a"].geogtran(e.wkid):a["a"].fromString(a["b"].PE_TYPE_GEOGTRAN,e.wkt);a["d"].geogToGeog(t,o.length,o,null,e.isInverse?a["b"].PE_TRANSFORM_2_TO_1:a["b"].PE_TRANSFORM_1_TO_2)}),!i.isGeographic){const e=T(i,!0),t=Object(r["k"])(e)&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];C(o,t);const s=i.wkid?a["a"].coordsys(i.wkid):a["a"].fromString(i.isGeographic?a["b"].PE_TYPE_GEOGCS:a["b"].PE_TYPE_PROJCS,i.wkt);a["c"].geogToProj(s,o.length,o)}let c=o;if(l&&o.length!==l.length){c=[];for(let e=0,t=0;e1===e.getInclusive()&&1===e.getKind());if(!o){if(o=r.find(e=>1===e.getInclusive()&&0===e.getKind()),!o)return null;n=!0}const l=s.isPannableRectangle(),c=o.getCoord();if(n)return{isEnvelope:n,isPannable:l,vertices:c,coef:null,bbox:[c[0][0]-t,c[0][1]-t,c[1][0]+t,c[1][1]+t]};let h=0;const u=[];let[d,f]=c[0],[p,b]=c[0];for(let a=0,m=c.length;ae?p:e,b=b>t?b:t}return{isEnvelope:!1,isPannable:l,vertices:c,coef:u,bbox:[d,f,p,b]}}function I(e,t){const i=[],{cols:s,rows:n,xres:a,yres:o,usePixelCenter:l}=e;let{xmin:c,ymax:h}=e;if(l&&(c+=a/2,h-=o/2),!Object(r["k"])(t)){for(let e=0;e=e&&s<=l;for(let e=0;e=r&&t<=d&&(i.push([s,t]),u[p]=1)}}return{points:i,mask:u}}const{coef:d}=t,f=[];for(let r=0;r=a&&e<=o){const r=s*e+n;t.push(r),i.push(l)}}let s=t;if(t.length>2){let e=2===i[0]?0:i[0],r=t[0];s=[];for(let n=1;ne-t)}else t[0]>t[1]&&(s=[t[1],t[0]]);f.push(s)}for(let r=0,p=0;r=r[0]&&e<=r[1]&&(i.push([e,s]),u[p]=1);else if(r.length>2){let t=!1;for(let i=0;i=r[i]&&e<=r[i+1]){t=!0;break}t&&(i.push([e,s]),u[p]=1)}}}return{points:i,mask:u}}function C(e,t){const[i,s]=t;for(let r=0;rs)&&(e[r]=[NaN,NaN])}}function V(e){const t=z(e[0].spatialReference);if(e.length<2||!Object(r["k"])(t))return e[0];let{xmin:i,xmax:s,ymin:n,ymax:a}=e[0];for(let r=1;rO(e.spatialReference)){const{xmin:t,xmax:i}=e;for(let s=0;s<=n;s++){const r=0===s?t:-a/2,o=s===n?i-a*s:a/2;c[s]=new l["a"]({xmin:r,xmax:o,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference})}}return V(c.map(e=>A(e,t,i,s)).filter(e=>!!e))}function A(e,t,i=null,s=!0,n=!0){const a=e.spatialReference;if(a.equals(t))return e;d(a,t,i);const l=Object(o["m"])(e,t,i);if(n&&t.isWebMercator&&l&&(l.ymax=Math.min(20037508.342787,l.ymax),l.ymin=Math.max(-20037508.342787,l.ymin),l.ymin>=l.ymax))return null;if(!s||!l)return l;const h=E(a,!0),u=E(t,!0);if(Object(r["j"])(h)||Object(r["j"])(u))return l;const f=O(a,.001),p=O(a,500),b=O(t,.001);if(Math.abs(l.xmin-u[0])p){l.xmin=u[0];const s=[];s.push(new c["a"](e.xmax,e.ymin,a)),s.push(new c["a"](e.xmax,(e.ymin+e.ymax)/2,a)),s.push(new c["a"](e.xmax,e.ymax,a));const r=s.map(e=>j(e,t,i)).filter(e=>!isNaN(null==e?void 0:e.x)).map(e=>e.x);l.xmax=Math.max.apply(null,r)}if(rp){l.xmax=u[1];const s=[];s.push(new c["a"](e.xmin,e.ymin,a)),s.push(new c["a"](e.xmin,(e.ymin+e.ymax)/2,a)),s.push(new c["a"](e.xmin,e.ymax,a));const r=s.map(e=>j(e,t,i)).filter(e=>!isNaN(null==e?void 0:e.x)).map(e=>e.x);l.xmin=Math.min.apply(null,r)}}else{const e=O(t,.001);Math.abs(l.xmin-u[0])0&&s.outofBoundPointCounty)&&(u(c,h,e.datumTransformation)&&(c.isGeographic||Object(r["k"])(T(c))),i=[m,m],s=q({...e,spacing:i}),n={cols:s.size[0]+1,rows:s.size[1]+1},o=f(s.offsets,n,i,y)),s.error=o,i[0]>1&&(s.coefficients=N(s.offsets,n,a)),e.includeGCSGrid&&!c.isGeographic&&!c.isWebMercator)if(h.isGeographic)s.gcsGrid={offsets:s.offsets,coefficients:s.coefficients,spacing:i};else{const t=T(c);if(Object(r["k"])(t)&&!t.isEnvelope){const t=U(c),r=D(e.projectedExtent,t),{offsets:o}=q({...e,srcBufferExtent:r,spacing:i}),l=N(o,n,a);s.gcsGrid={offsets:o,coefficients:l,spacing:i}}}return s}function q(e){const{projectedExtent:t,srcBufferExtent:i,pixelSize:s,datumTransformation:n,rasterTransform:a}=e,o=t.spatialReference,l=i.spatialReference;d(o,l);const{xmin:h,ymin:u,xmax:f,ymax:p}=t,y=z(l),g=Object(r["k"])(y)&&(e.hasWrapAround||"gcs-shift"===(null==a?void 0:a.type)),x=e.spacing||[b,b],w=x[0]*s.x,_=x[1]*s.y,v=1===x[0],j=Math.ceil((f-h)/w-.1/x[0])+(v?0:1),R=Math.ceil((p-u)/_-.1/x[1])+(v?0:1),P=S({cols:j,rows:R,xmin:h,ymax:p,xres:w,yres:_,inSR:o,outSR:l,datumTransformation:n,preferPE:x[0]<=m,usePixelCenter:v}),k=[];let T,M=0;const I=v?-1:NaN,{xmin:C,xmax:V,ymax:D,width:A,height:E}=i,L=O(l,500);for(let r=0;rV&&i[0]>y/2-L&&(i[0]-=y),!i||isNaN(i[0])||isNaN(i[1]))k.push(I),k.push(I),e.push(null),M++;else{if(a){const e=a.inverseTransform(new c["a"]({x:i[0],y:i[1],spatialReference:l}));i=[e.x,e.y]}e.push(i),r>0&&g&&T[t]&&i[0]=h)a=l.length,o=s/h>8;else{let e,t=u;for(let r=1;r<=l.length;r++){if(e=(l[r-1].x+l[r-1].y)/2,s<=e){s===e?a=r:"down"===i?(a=r-1,o=s/t>8):a="up"===i||s-t>e-s||s/t>2?r:r-1;break}t=e}}const d=0===a?n:l[a-1];return{pyramidLevel:a,pyramidResolution:new c["a"]({x:d.x,y:d.y,spatialReference:t.spatialReference}),excessiveReading:o}}const h=Math.log(e.x/n.x)/Math.LN2,u=Math.log(e.y/n.y)/Math.LN2,d=t.storageInfo.maximumPyramidLevel||0;a="down"===i?Math.floor(Math.min(h,u)):"up"===i?Math.ceil(Math.max(h,u)):Math.round((h+u)/2),a<0?a=0:a>d&&(o=a>d+3,a=d);const f=2**a;return{pyramidLevel:a,pyramidResolution:new c["a"]({x:f*t.nativePixelSize.x,y:f*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:o}}function J(e,t,i=512,s=!0){const{extent:r,spatialReference:a,pixelSize:o}=e,l=v(new c["a"]({x:o.x,y:o.y,spatialReference:a}),t,r);if(null==l)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const h=(l.x+l.y)/2,u=Object(n["f"])(t),d=h*u*96*39.37,f=t.isGeographic?256/i*295828763.7958547:256/i*591657527.591555;let p="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const b=D(r,t);p||s&&(t.isGeographic||t.isWebMercator)&&(p=b.xmin*b.xmax<0);let m,y=d;const g=1.001;if(p){y=f;const e=t.isGeographic?1341104507446289e-21:.29858214164761665,i=e*(96*u*39.37),s=t.isGeographic?4326:3857;m=v(new c["a"]({x:e,y:e,spatialReference:{wkid:s}}),a,b),m.x*=y/i,m.y*=y/i}else{m={x:o.x,y:o.y};const t=Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2);let i=0;for(;y=O;)y/=2,m.x/=2,m.y/=2,x.push(y),w.push({x:m.x,y:m.y});return{projectedPixelSize:l,scales:x,srcResolutions:w,isCustomTilingScheme:!p}}}}]); //# sourceMappingURL=chunk-0b4cc6fb.322f1edd.js.map