(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-20e837a3"],{2650:function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return z}));var a=i("a4ee"),r=i("2eab"),l=i("ce50"),s=i("9096"),n=i("b2b2"),o=i("e694"),c=i("f4cc"),h=i("e041"),p=i("59b2"),u=(i("b50f"),i("c120"),i("1a3e")),b=i("afcf"),d=i("d386"),f=i("09db"),v=i("5996"),m=i("a6a3"),y=i("f46e"),O=i("b485"),j=i("303f"),g=i("3d59"),_=i("997b"),w=i("8b28"),S=i("b911"),T=i("0db5"),A=i("8e17"),L=i("5a62"),D=i("d409"),C=i("54b4"),$=i("22f4"),k=i("e9d0");const P=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let x=class extends(Object(_["a"])(Object(D["a"])(Object(L["a"])(Object(S["a"])(Object(T["a"])(Object(O["a"])(Object(j["a"])(Object(g["a"])(Object(o["a"])(Object(s["b"])(Object(A["a"])(Object(y["a"])(Object(w["a"])(m["a"])))))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=Object(n["k"])(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(c["u"]).then(()=>this._fetchService(t))),Promise.resolve(this)}get attributionDataUrl(){var e;const t=null==(e=this.parsedUrl)?void 0:e.path.toLowerCase();return t&&this._getDefaultAttribution(this._getMapName(t))}readSpatialReference(e,t){return(e=e||t.tileInfo&&t.tileInfo.spatialReference)&&v["a"].fromJSON(e)}writeSublayers(e,t,i,a){if(!this.loaded||!e)return;const r=e.slice().reverse().flatten(({sublayers:e})=>e&&e.toArray().reverse()).toArray(),l=[],s={writeSublayerStructure:!1,...a};r.forEach(e=>{const t=e.write({},s);l.push(t)}),l.some(e=>Object.keys(e).length>1)&&(t.layers=l)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl.path)}castTileServers(e){return Array.isArray(e)?e.map(e=>Object(h["M"])(e).path):null}fetchTile(e,t,i,a={}){const{signal:l}=a,s=this.getTileUrl(e,t,i),n={responseType:"image",signal:l,query:{...this.refreshParameters}};return Object(r["default"])(s,n).then(e=>e.data)}getTileUrl(e,t,i){const a=!this.tilemapCache&&this.supportsBlankTile,r=Object(h["G"])({...this.parsedUrl.query,blankTile:!a&&null,...this.customParameters,token:this.apiKey}),l=this.tileServers;return`${l&&l.length?l[t%l.length]:this.parsedUrl.path}/tile/${e}/${t}/${i}${r?"?"+r:""}`}_fetchService(e){return new Promise((t,i)=>{if(this.sourceJSON){if(null!=this.sourceJSON.bandCount&&null!=this.sourceJSON.pixelSizeX)throw new l["a"]("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void t({data:this.sourceJSON})}if(!this.parsedUrl)throw new l["a"]("tile-layer:undefined-url","layer's url is not defined");const a=Object(C["e"])(this.parsedUrl.path);if(Object(n["k"])(a)&&"ImageServer"===a.serverType)throw new l["a"]("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");Object(r["default"])(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t,i)}).then(t=>{if(t.ssl&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t.data,this.read(t.data,{origin:"service",url:this.parsedUrl}),10.1===this.version&&!Object(C["c"])(this.url))return this._fetchServerVersion(this.url,e).then(e=>{this.read({currentVersion:e})}).catch(()=>{})})}_fetchServerVersion(e,t){if(!Object(C["b"])(e))return Promise.reject();const i=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return Object(r["default"])(i,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t}).then(e=>{if(e.data&&e.data.currentVersion)return e.data.currentVersion;throw new l["a"]("tile-layer:version-not-available")})}_getMapName(e){const t=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/mapserver/i);return t&&t[2]}_getDefaultAttribution(e){if(!e)return;let t;e=e.toLowerCase();for(let i=0,a=P.length;i-1)return Object(h["C"])("//static.arcgis.com/attribution/"+t)}_getDefaultTileServers(e){const t=-1!==e.search(/^(?:https?:)?\/\/server\.arcgisonline\.com/i),i=-1!==e.search(/^(?:https?:)?\/\/services\.arcgisonline\.com/i);return t||i?[e,e.replace(t?/server\.arcgisonline/i:/services\.arcgisonline/i,t?"services.arcgisonline":"server.arcgisonline")]:[]}get hasOverriddenFetchTile(){return!this.fetchTile.__isDefault__}};Object(a["a"])([Object(p["b"])({readOnly:!0})],x.prototype,"attributionDataUrl",null),Object(a["a"])([Object(p["b"])({type:["show","hide","hide-children"]})],x.prototype,"listMode",void 0),Object(a["a"])([Object(p["b"])({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],x.prototype,"isReference",void 0),Object(a["a"])([Object(p["b"])({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],x.prototype,"operationalLayerType",void 0),Object(a["a"])([Object(p["b"])({type:Boolean})],x.prototype,"resampling",void 0),Object(a["a"])([Object(p["b"])()],x.prototype,"sourceJSON",void 0),Object(a["a"])([Object(p["b"])({type:v["a"]})],x.prototype,"spatialReference",void 0),Object(a["a"])([Object(b["a"])("spatialReference",["spatialReference","tileInfo"])],x.prototype,"readSpatialReference",null),Object(a["a"])([Object(p["b"])({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],x.prototype,"path",void 0),Object(a["a"])([Object(p["b"])({readOnly:!0})],x.prototype,"sublayers",void 0),Object(a["a"])([Object(f["a"])("sublayers",{layers:{type:[k["a"]]}})],x.prototype,"writeSublayers",null),Object(a["a"])([Object(p["b"])({json:{read:!1,write:!1}})],x.prototype,"popupEnabled",void 0),Object(a["a"])([Object(p["b"])()],x.prototype,"tileServers",null),Object(a["a"])([Object(u["a"])("tileServers")],x.prototype,"castTileServers",null),Object(a["a"])([Object(p["b"])({readOnly:!0,json:{read:!1}})],x.prototype,"type",void 0),Object(a["a"])([Object(p["b"])($["n"])],x.prototype,"url",void 0),x=Object(a["a"])([Object(d["a"])("esri.layers.TileLayer")],x),x.prototype.fetchTile.__isDefault__=!0;const z=x},9651:function(e,t,i){"use strict";i.d(t,"a",(function(){return A}));var a,r=i("a4ee"),l=i("2eab"),s=i("fc29"),n=i("f0b9"),o=i("ce50"),c=i("9096"),h=i("e92d"),p=i("c24e"),u=i("8a44"),b=i("f4cc"),d=i("477c"),f=i("5815"),v=i("e041"),m=i("59b2"),y=i("b50f"),O=(i("c120"),i("1a3e")),j=i("d386"),g=i("7ffa");class _{constructor(){this.location={left:0,top:0,width:0,height:0},this._allAvailability="unknown",this.byteSize=40}getAvailability(e,t){if("unknown"!==this._allAvailability)return this._allAvailability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),a=i%8,r=i>>3,l=this._tileAvailabilityBitSet;return r<0||r>l.length?"unknown":l[r]&1<e.data).catch(e=>{if(e&&e.details&&422===e.details.httpStatus)return{location:{top:a,left:r,width:s,height:n},valid:!0,data:Object(y["c"])(s*n,0)};throw e}).then(e=>{if(e.location&&(e.location.top!==a||e.location.left!==r||e.location.width!==s||e.location.height!==n))throw new o["a"]("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:a,left:r,width:s,height:n}});return _.fromJSON(e)})}static fromJSON(e){_._validateJSON(e);const t=new _;return t.location=Object.freeze(Object(g["a"])(e.location)),t._updateFromData(e.data),Object.freeze(t)}static _validateJSON(e){if(!e||!e.location)throw new o["a"]("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new o["a"]("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new o["a"]("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new o["a"]("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new o["a"]("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}}function w(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function S(e){let t;if("vector-tile"===e.service.type)t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;else{const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}const i=e.service.query;return i&&(t=`${t}?${i}`),t}const T=h["a"].getLogger("esri.layers.support.TilemapCache");let A=a=class extends(Object(c["b"])(s["a"])){constructor(e){super(e),this._pendingTilemapRequests={},this._availableLevels={},this.levels=5,this.cacheByteSize=2*n["a"].MEGABYTES,this.request=l["default"],this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new p["a"](this.cacheByteSize),this.handles.add([this.watch(["layer.parsedUrl","layer.tileServers?","layer.apiKey?","layer.customParameters?"],()=>this._initializeTilemapDefinition()),Object(d["e"])(()=>{var e,t;return null==(e=this.layer)||null==(t=e.tileInfo)?void 0:t.lods},e=>this._initializeAvailableLevels(e),d["d"])]),this._initializeTilemapDefinition()}castLevels(e){return e<=2?(T.error("Minimum levels for Tilemap is 3, but got ",e),3):e}get size(){return 1<{Object(b["q"])(s,()=>t(Object(b["e"])()));const i=w(r);let l=this._pendingTilemapRequests[i];if(!l){l=_.fromDefinition(r,a).then(e=>(this._tilemapCache.put(i,e,e.byteSize),e));const e=()=>delete this._pendingTilemapRequests[i];this._pendingTilemapRequests[i]=l,l.then(e,e)}l.then(e,t)})}getAvailability(e,t,i){if(!this._availableLevels[e])return"unavailable";const a=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return a?a.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,a){return this._availableLevels[e]?this.fetchTilemap(e,t,i,a).catch(e=>e).then(a=>{if(a instanceof _){const r=a.getAvailability(t,i);return"unavailable"===r?Promise.reject(new o["a"]("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})):r}if(Object(b["m"])(a))throw a;return"unknown"}):Promise.reject(new o["a"]("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`))}fetchAvailabilityUpsample(e,t,i,a,r){a.level=e,a.row=t,a.col=i;const l=this.layer.tileInfo;l.updateTileInfo(a);const s=this.fetchAvailability(e,t,i,r).catch(e=>{if(Object(b["m"])(e))throw e;if(l.upsampleTile(a))return this.fetchAvailabilityUpsample(a.level,a.row,a.col,a);throw e});return this._fetchAvailabilityUpsamplePrefetch(a.id,e,t,i,r,s),s}async _fetchAvailabilityUpsamplePrefetch(e,t,i,r,l,s){if(!this._prefetchingEnabled)return;const n="prefetch-"+e;if(this.handles.has(n))return;const o=new AbortController;s.then(()=>o.abort(),()=>o.abort());let c=!1;const h={remove(){c||(c=!0,o.abort())}};if(this.handles.add(h,n),await Object(f["d"])(10,o.signal).catch(()=>{}),c||(c=!0,this.handles.remove(n)),Object(b["n"])(o))return;const p={id:e,level:t,row:i,col:r},u={...l,signal:o.signal},d=this.layer.tileInfo;for(let b=0;a._prefetches.length{a._prefetches.removeUnordered(e)};e.then(t,t)}}_initializeTilemapDefinition(){var e;if(!this.layer.parsedUrl)return;const{parsedUrl:t,apiKey:i,customParameters:a}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:t.path,query:Object(v["G"])({...t.query,...a,token:null!=i?i:null==(e=t.query)?void 0:e.token}),tileServers:this.layer.tileServers,request:this.request,type:this.layer.type},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,a){a.level=e,a.row=t-t%this.size,a.col=i-i%this.size;const r=w(a);return this._tilemapCache.get(r)}_initializeAvailableLevels(e){this._availableLevels={},e&&e.forEach(e=>this._availableLevels[e.level]=!0)}get test(){const e=this;return{get prefetchingEnabled(){return e._prefetchingEnabled},set prefetchingEnabled(t){e._prefetchingEnabled=t},hasTilemap:(t,i,a)=>!!e._tilemapFromCache(t,i,a,e._tmpTilemapDefinition)}}};A._maxPrefetch=4,A._prefetches=new u["a"]({initialSize:a._maxPrefetch}),Object(r["a"])([Object(m["b"])({constructOnly:!0,type:Number})],A.prototype,"levels",void 0),Object(r["a"])([Object(O["a"])("levels")],A.prototype,"castLevels",null),Object(r["a"])([Object(m["b"])({readOnly:!0,type:Number})],A.prototype,"size",null),Object(r["a"])([Object(m["b"])({constructOnly:!0,type:Number})],A.prototype,"cacheByteSize",void 0),Object(r["a"])([Object(m["b"])({constructOnly:!0})],A.prototype,"layer",void 0),Object(r["a"])([Object(m["b"])({constructOnly:!0})],A.prototype,"request",void 0),A=a=Object(r["a"])([Object(j["a"])("esri.layers.support.TilemapCache")],A)},ab68:function(e,t,i){"use strict";i.d(t,"a",(function(){return l})),i.d(t,"b",(function(){return r}));var a=i("dff3");const r={type:a["a"],json:{origins:{service:{read:{source:["tileInfo","minScale","maxScale","minLOD","maxLOD"],reader:l}}}}};function l(e,t,i,r){if(!e)return null;const{minScale:l,maxScale:s,minLOD:n,maxLOD:o}=t;if(null!=n&&null!=o)return r&&r.ignoreMinMaxLOD?a["a"].fromJSON(e):a["a"].fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=n&&e<=o)});if(0!==l&&0!==s){const t=e=>Math.round(1e4*e)/1e4,i=l?t(l):1/0,r=s?t(s):-1/0;return a["a"].fromJSON({...e,lods:e.lods.filter(e=>{const a=t(e.scale);return a<=i&&a>=r})})}return a["a"].fromJSON(e)}},b485:function(e,t,i){"use strict";i.d(t,"a",(function(){return h}));var a=i("a4ee"),r=(i("e06a"),i("59b2")),l=(i("b50f"),i("c120"),i("cea0"),i("afcf")),s=i("d386"),n=i("ab68"),o=i("9651"),c=i("5996");const h=e=>{let t=class extends e{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(e,t){return t.capabilities&&t.capabilities.indexOf("Tilemap")>-1?new o["a"]({layer:this}):null}};return Object(a["a"])([Object(r["b"])({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),Object(a["a"])([Object(r["b"])()],t.prototype,"minScale",void 0),Object(a["a"])([Object(l["a"])("service","minScale")],t.prototype,"readMinScale",null),Object(a["a"])([Object(r["b"])()],t.prototype,"maxScale",void 0),Object(a["a"])([Object(l["a"])("service","maxScale")],t.prototype,"readMaxScale",null),Object(a["a"])([Object(r["b"])({type:c["a"]})],t.prototype,"spatialReference",void 0),Object(a["a"])([Object(r["b"])({readOnly:!0})],t.prototype,"supportsBlankTile",null),Object(a["a"])([Object(r["b"])(n["b"])],t.prototype,"tileInfo",void 0),Object(a["a"])([Object(r["b"])()],t.prototype,"tilemapCache",void 0),Object(a["a"])([Object(l["a"])("service","tilemapCache",["capabilities"])],t.prototype,"readTilemapCache",null),Object(a["a"])([Object(r["b"])()],t.prototype,"version",void 0),t=Object(a["a"])([Object(s["a"])("esri.layers.mixins.ArcGISCachedService")],t),t}}}]); //# sourceMappingURL=chunk-20e837a3.fa0e26c5.js.map