1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6178,8355],{88355:function(e,t,i){i.r(t);var s,n=i(36663),r=(i(39994),i(67134)),o=i(61681),a=i(13802),l=(i(7283),i(81977)),c=i(66645),h=i(39835),d=i(3466),u=(i(12173),i(51876),i(78668)),p=i(49004),m=i(14685),f=i(18302),g=i(58811),y=i(68309),v=i(81577),_=i(63592),b=i(486),w=i(2725),C=i(4e4);let M=0;const I=a.Z.getLogger("esri.Basemap");let T=s=class extends((0,p.eC)(y.Z)){constructor(e){super(e),this.id=null,this.portalItem=null,this.spatialReference=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+M++,this.baseLayers=new f.Z,this.referenceLayers=new f.Z;const t=e=>{e.parent&&e.parent!==this&&"remove"in e.parent&&e.parent.remove(e),e.parent=this,"elevation"===e.type&&I.error(`Layer '${e.title}, id:${e.id}' of type '${e.type}' is not supported as a basemap layer and will therefore be ignored.`)},i=e=>{e.parent=null};this.baseLayers.on("after-add",(e=>t(e.item))),this.referenceLayers.on("after-add",(e=>t(e.item))),this.baseLayers.on("after-remove",(e=>i(e.item))),this.referenceLayers.on("after-remove",(e=>i(e.item)))}initialize(){this.when().catch((e=>{I.error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)})),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){var e;const t=this.baseLayers.removeAll();for(const s of t)s.destroy();const i=this.referenceLayers.removeAll();for(const s of i)s.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),null==(e=this.portalItem)||e.destroy(),this.portalItem=null}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set baseLayers(e){this._set("baseLayers",(0,g.Z)(e,this._get("baseLayers")))}_writeBaseLayers(e,t,i){const s=[];e?(i={...i,layerContainerType:"basemap"},this.baseLayers.forEach((e=>{const t=(0,C.Nw)(e,i.webmap?i.webmap.getLayerJSONFromResourceInfo(e):null,i);(0,o.pC)(t)&&s.push(t)})),this.referenceLayers.forEach((e=>{const t=(0,C.Nw)(e,i.webmap?i.webmap.getLayerJSONFromResourceInfo(e):null,i);(0,o.pC)(t)&&(t.isReference=!0,s.push(t))})),t.baseMapLayers=s):t.baseMapLayers=s}set referenceLayers(e){this._set("referenceLayers",(0,g.Z)(e,this._get("referenceLayers")))}writeTitle(e,t){t.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return(0,_.GZ)(this,(e=>{e(this.baseLayers,this.referenceLayers)}))}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.slice(),referenceLayers:this.referenceLayers.slice()};return this.loaded&&(e.loadStatus="loaded"),new s({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}write(e,t){return e=e||{},t&&t.origin||(t={origin:"web-map",...t}),super.write(e,t),!this.loaded&&this.resourceInfo&&this.resourceInfo.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map((e=>{const t=(0,r.d9)(e);return t.url&&(0,d.oC)(t.url)&&(t.url=`https:${t.url}`),t.templateUrl&&(0,d.oC)(t.templateUrl)&&(t.templateUrl=`https:${t.templateUrl}`),t}))),e}async _loadFromSource(e){const{resourceInfo:t,portalItem:i}=this;(0,u.k_)(e);const s=[];if(t){const i=t.context?t.context.url:null;if(s.push(this._loadLayersFromJSON(t.data,i,e)),t.data.id&&!t.data.title){const e=t.data.id;s.push((0,w.g)(e).then((e=>{e&&this.read({title:e},t.context)})))}}else i&&s.push(this._loadFromItem(i,e));await Promise.all(s)}async _loadLayersFromJSON(e,t,s){const n=this.resourceInfo&&this.resourceInfo.context,r=this.portalItem&&this.portalItem.portal||n&&n.portal||null,o=n&&"web-scene"===n.origin?"web-scene":"web-map",{populateOperationalLayers:a}=await i.e(6008).then(i.bind(i,96008)),l=[];if((0,u.k_)(s),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const i={context:{origin:o,url:t,portal:r,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},s=a(this.baseLayers,e.baseMapLayers.filter((e=>!e.isReference)),i);l.push(s);const n=a(this.referenceLayers,e.baseMapLayers.filter((e=>e.isReference)),i);l.push(n)}await(0,u.as)(l)}async _loadFromItem(e,t){const i=await e.load(t),s=await i.fetchData("json",t),n=(0,d.mN)(e.itemUrl);return this._set("resourceInfo",{data:s.baseMap,context:{origin:"web-map",portal:e.portal||v.Z.getDefault(),url:n}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:s.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:"portal-item",portal:e.portal||v.Z.getDefault(),url:n}),this._loadLayersFromJSON(this.resourceInfo.data,n,t)}static fromId(e){const t=w.s[e];return t?s.fromJSON(t):null}};(0,n._)([(0,l.Cb)({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(e,t,i,s){this._writeBaseLayers(e,t,s)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:f.Z}},writer(e,t,i,s){this._writeBaseLayers(e,t,s)}}}}}})],T.prototype,"baseLayers",null),(0,n._)([(0,l.Cb)({type:String,json:{origins:{"web-scene":{write:!0}}}})],T.prototype,"id",void 0),(0,n._)([(0,l.Cb)({type:b.default})],T.prototype,"portalItem",void 0),(0,n._)([(0,l.Cb)()],T.prototype,"referenceLayers",null),(0,n._)([(0,l.Cb)({readOnly:!0})],T.prototype,"resourceInfo",void 0),(0,n._)([(0,l.Cb)({type:m.Z})],T.prototype,"spatialReference",void 0),(0,n._)([(0,l.Cb)()],T.prototype,"thumbnailUrl",void 0),(0,n._)([(0,l.Cb)({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],T.prototype,"title",void 0),(0,n._)([(0,h.c)("title")],T.prototype,"writeTitle",null),T=s=(0,n._)([(0,c.j)("esri.Basemap")],T);var x=T;t.default=x},9435:function(e,t,i){i.d(t,{Z:function(){return B}});var s,n=i(36663),r=(i(39994),i(13802)),o=i(81977),a=i(69236),l=i(66645),c=(i(3466),i(12173),i(51876),i(36900)),h=i(31355),d=i(88355),u=i(27755),p=i(67134),m=i(7283),f=i(39835),g=i(70375),y=i(78668),v=i(49004),_=i(18302),b=i(30936),w=i(78621),
1C=i(58811),M=i(68309),I=i(63592),T=i(79438);let x=s=class extends v.wq{constructor(e){super(e),this.type="none"}clone(){return new s({type:this.type})}};var k;(0,n._)([(0,T.J)({none:"none",stayAbove:"stay-above"})],x.prototype,"type",void 0),x=s=(0,n._)([(0,l.j)("esri.ground.NavigationConstraint")],x);const S=r.Z.getLogger("esri.Ground");let P=k=class extends((0,v.eC)(M.Z)){constructor(e){super(e),this.opacity=1,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new _.Z;const t=e=>{e.parent&&e.parent!==this&&"remove"in e.parent&&e.parent.remove(e),e.parent=this,"elevation"!==e.type&&"base-elevation"!==e.type&&S.error(`Layer '${e.title}, id:${e.id}' of type '${e.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)};this.layers.on("after-add",(e=>t(e.item))),this.layers.on("after-remove",(e=>(e=>{e.parent=null})(e.item)))}initialize(){this.when().catch((e=>{S.error("#load()","Failed to load ground",e)})),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.layers.removeAll();for(const t of e)t.destroy();this.layers.destroy()}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set layers(e){this._set("layers",(0,C.Z)(e,this._get("layers")))}writeLayers(e,t,i,s){const n=[];e?(s={...s,layerContainerType:"ground"},e.forEach((e=>{if("write"in e){const t={};(0,u.sM)(e)().write(t,s)&&n.push(t)}else s&&s.messages&&s.messages.push(new g.Z("layer:unsupported",`Layers (${e.title}, ${e.id}) of type '${e.declaredClass}' cannot be persisted in the ground`,{layer:e}))})),t.layers=n):t.layers=n}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return(0,I.GZ)(this,(e=>{e(this.layers)}))}async queryElevation(e,t){await this.load({signal:null==t?void 0:t.signal});const{ElevationQuery:s}=await i.e(8777).then(i.bind(i,58777));(0,y.k_)(t);const n=new s,r=this.layers.filter(L).toArray();return n.queryAll(r,e,t)}async createElevationSampler(e,t){await this.load({signal:null==t?void 0:t.signal});const{ElevationQuery:s}=await i.e(8777).then(i.bind(i,58777));(0,y.k_)(t);const n=new s,r=this.layers.filter(L).toArray();return n.createSamplerAll(r,e,t)}clone(){const e={opacity:this.opacity,surfaceColor:(0,p.d9)(this.surfaceColor),navigationConstraint:(0,p.d9)(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(e.loadStatus="loaded"),new k({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}_loadFromSource(e){const t=this.resourceInfo;return t?this._loadLayersFromJSON(t.data,t.context,e):Promise.resolve(null)}_loadLayersFromJSON(e,t,s){const n=t&&t.origin||"web-scene",r=t&&t.portal||null,o=t&&t.url||null;return i.e(6008).then(i.bind(i,96008)).then((({populateOperationalLayers:t})=>{(0,y.k_)(s);const i=[];if(e.layers&&Array.isArray(e.layers)){const s={context:{origin:n,url:o,portal:r,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};i.push(t(this.layers,e.layers,s))}return(0,y.as)(i)})).then((()=>{}))}};function L(e){return"elevation"===e.type||function(e){return e&&"createElevationSampler"in e}(e)}(0,n._)([(0,o.Cb)({json:{read:!1}})],P.prototype,"layers",null),(0,n._)([(0,f.c)("layers")],P.prototype,"writeLayers",null),(0,n._)([(0,o.Cb)({readOnly:!0})],P.prototype,"resourceInfo",void 0),(0,n._)([(0,o.Cb)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:m.z8,read:{reader:w.b,source:"transparency"},write:{writer:(e,t)=>{t.transparency=(0,w.a)(e)},target:"transparency"}}})],P.prototype,"opacity",void 0),(0,n._)([(0,o.Cb)({type:b.Z,json:{type:[m.z8],write:(e,t)=>{t.surfaceColor=e.toJSON().slice(0,3)}}})],P.prototype,"surfaceColor",void 0),(0,n._)([(0,o.Cb)({type:x,json:{write:!0}})],P.prototype,"navigationConstraint",void 0),P=k=(0,n._)([(0,l.j)("esri.Ground")],P);var E=P,A=i(81739),F=i(2725);const V=r.Z.getLogger("esri.support.basemapUtils");function O(e,t){var i;let s;if("string"==typeof e){if(!(e in F.s)){const t=Object.keys(F.s).map((e=>`"${e}"`)).join(", ");return V.warn(`Unable to find basemap definition for: ${e}. Try one of these: ${t}`),null}t&&(s=t[e]),s||(s=d.default.fromId(e),t&&(t[e]=s))}else s=(0,m.se)(d.default,e);return null!=(i=s)&&i.destroyed&&(V.warn("The provided basemap is already destroyed",{basemap:s}),s=null),s}
1const R=r.Z.getLogger("esri.support.groundUtils"),D={"world-elevation":{id:"worldElevation",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"},"world-topobathymetry":{id:"worldTopoBathymetry",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/TopoBathy3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"}};var j=i(67302),Z=i(98234);const N=r.Z.getLogger("esri.Map");let z=class extends((0,Z.Q)((0,j.K)(h.Z.EventedMixin(c.Z)))){constructor(e){super(e),this.allLayers=new A.Z({root:this,rootCollectionNames:["basemap.baseLayers","ground.layers","layers","basemap.referenceLayers"],getChildrenFunction:e=>e.layers}),this.allTables=this._createTablesFlattener(this),this.basemap=null,this.ground=new E,this._basemapCache={}}destroy(){var e,t;this.allLayers.destroy(),this.allTables.destroy(),null==(e=this.ground)||e.destroy(),null==(t=this.basemap)||t.destroy(),function(e){for(const t in e){const i=e[t];!1===(null==i?void 0:i.destroyed)&&i.destroy(),delete e[t]}}(this._basemapCache),this._basemapCache=null}castBasemap(e){return O(e,this._basemapCache)}castGround(e){return function(e){let t;"string"==typeof e?e in D?t=new E({resourceInfo:{data:{layers:[D[e]]}}}):R.warn(`Unable to find ground definition for: ${e}. Try "world-elevation"`):t=(0,m.se)(E,e);return t}(e)||(N.error("Map.ground may not be set to null or undefined"),this._get("ground"))}findLayerById(e){return this.allLayers.find((t=>t.id===e))}findTableById(e){return this.allTables.find((t=>t.id===e))}_createTablesFlattener(e){return new A.Z({root:e,rootCollectionNames:["tables","layers"],getChildrenFunction:e=>e&&"group"===e.type?this._createTablesFlattener(e):null,itemFilterFunction:e=>this._isMapOrGroupLayer(e.parent)&&e.parent.tables.includes(e)})}_isMapOrGroupLayer(e){return e&&(e===this||this._isGroupLayer(e))}_isGroupLayer(e){return e&&"group"===e.type}};(0,n._)([(0,o.Cb)({readOnly:!0,dependsOn:[]})],z.prototype,"allLayers",void 0),(0,n._)([(0,o.Cb)({readOnly:!0})],z.prototype,"allTables",void 0),(0,n._)([(0,o.Cb)({type:d.default})],z.prototype,"basemap",void 0),(0,n._)([(0,a.p)("basemap")],z.prototype,"castBasemap",null),(0,n._)([(0,o.Cb)({type:E,nonNullable:!0})],z.prototype,"ground",void 0),(0,n._)([(0,a.p)("ground")],z.prototype,"castGround",null),z=(0,n._)([(0,l.j)("esri.Map")],z);var B=z},88346:function(e,t,i){i.d(t,{Z:function(){return M}});var s,n=i(36663),r=(i(39994),i(61681)),o=(i(13802),i(81977)),a=i(69236),l=i(66645),c=(i(3466),i(12173),i(51876),i(49004)),h=i(53736),d=i(91957),u=i(7283),p=i(34248),m=i(39835),f=i(86566),g=i(19431),y=i(35369);let v=s=class extends c.wq{constructor(...e){super(...e),this.position=new f.Z([0,0,0]),this.heading=0,this.tilt=0,this.fov=55}normalizeCtorArgs(e,t,i,s){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=i&&(n.tilt=i),null!=s&&(n.fov=s),n}return e}writePosition(e,t,i,s){const n=e.clone();n.x=(0,u.q9)(e.x||0),n.y=(0,u.q9)(e.y||0),n.z=e.hasZ?(0,u.q9)(e.z||0):e.z,t[i]=n.write(null,s)}readPosition(e,t){const i=new f.Z;return i.read(e,t),i.x=(0,u.q9)(i.x||0),i.y=(0,u.q9)(i.y||0),i.z=i.hasZ?(0,u.q9)(i.z||0):i.z,i}equals(e){return!!e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)}clone(){return new s({position:this.position.clone(),heading:this.heading,tilt:this.tilt,fov:this.fov})}};(0,n._)([(0,o.Cb)({type:f.Z,json:{write:{isRequired:!0}}})],v.prototype,"position",void 0),(0,n._)([(0,m.c)("position")],v.prototype,"writePosition",null),(0,n._)([(0,p.r)("position")],v.prototype,"readPosition",null),(0,n._)([(0,o.Cb)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,a.p)((e=>y.LU.normalize((0,u.q9)(e))))],v.prototype,"heading",void 0),(0,n._)([(0,o.Cb)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,a.p)((e=>(0,g.uZ)((0,u.q9)(e),-180,180)))],v.prototype,"tilt",void 0),(0,n._)([(0,o.Cb)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],v.prototype,"fov",void 0),v=s=(0,n._)([(0,l.j)("esri.Camera")],v);var _,b=v;let w=_=class extends c.wq{constructor(e){super(e),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(e){return(e%=360)<0&&(e+=360),e}clone(){return new _({rotation:this.rotation,scale:this.scale,targetGeometry:(0,r.pC)(this.targetGeometry)?this.targetGeometry.clone():null,camera:(0,r.pC)(this.camera)?this.camera.clone():null})}};function C(){return{enabled:!this.camera}}(0,n._)([(0,o.Cb)({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:C}}}}})],w.prototype,"rotation",void 0),(0,n._)([(0,a.p)("rotation")],w.prototype,"castRotation",null),(0,n._)([(0,o.Cb)({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:C}}}}})],w.prototype,"scale",void 0),(0,n._)([(0,o.Cb)({types:d.qM,json:{read:h.im,write:!0,origins:{"web-scene":{read:h.im,write:{overridePolicy:C}}}}})],w.prototype,"targetGeometry",void 0),(0,n._)([(0,o.Cb)({type:b,json:{write:!0}})],w.prototype,"camera",void 0),w=_=(0,n._)([(0,l.j)("esri.Viewpoint")],w);var M=w},69114:function(e,t,i){function s(){return[1,0,0,1,0,0]}i.d(t,{c:function(){return s}});Object.freeze({__proto__:null,create:s,clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5]]},fromValues:function(e,t,i,s,n,r){return[e,t,i,s,n,r]},createView:function(e,t){return new Float64Array(e,t,6)}})},1662:function(e,t,i){i.d(t,{a:function(){return a},c:function(){return c},i:function(){return r},j:function(){return h},m:function(){return o},n:function(){return d},r:function(){return l},s:function(){return n}});var s=i(93011);function n(e,t,i,s,n,r,o,a,l,c){return e[0]=t,e[1]=i,e[2]=s,e[3]=n,e[4]=r,e[5]=o,e[6]=a,e[7]=l,e[8]=c,e}function r(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function o(e,t,i){const s=t[0],n=t[1],r=t[2],o=t[3],a=t[4],l=t[5],c=t[6],h=t[7],d=t[8],u=i[0],p=i[1],m=i[2],f=i[3],g=i[4],y=i[5],v=i[6],_=i[7],b=i[8];return e[0]=u*s+p*o+m*c,e[1]=u*n+p*a+m*h,e[2]=u*r+p*l+m*d,e[3]=f*s+g*o+y*c,e[4]=f*n+g*a+y*h,e[5]=f*r+g*l+y*d,e[6]=v*s+_*o+b*c,e[7]=v*n+_*a+b*h,e[8]=v*r+_*l+b*d,e}function a(e,t,i){const s=t[0],n=t[1],r=t[2],o=t[3],a=t[4],l=t[5],c=t[6],h=t[7],d=t[8],u=i[0],p=i[1];return e[0]=s,e[1]=n,e[2]=r,e[3]=o,e[4]=a,e[5]=l,e[6]=u*s+p*o+c,e[7]=u*n+p*a+h,e[8]=u*r+p*l+d,e}function l(e,t,i){const s=t[0],n=t[1],r=t[2],o=t[3],a=t[4],l=t[5],c=t[6],h=t[7],d=t[8],u=Math.sin(i),p=Math.cos(i);return e[0]=p*s+u*o,e[1]=p*n+u*a,e[2]=p*r+u*l,e[3]=p*o-u*s,e[4]=p*a-u*n,e[5]=p*l-u*r,e[6]=c,e[7]=h,e[8]=d,e}function c(e,t,i){const s=i[0],n=i[1],r=i[2];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e[6]=r*t[6],e[7]=r*t[7],e[8]=r*t[8],e}function h(e,t,i){const s=i[0],n=i[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e}function d(e,t){const i=t[0],s=t[1],n=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],d=t[9],u=t[10],p=t[11],m=t[12],f=t[13],g=t[14],y=t[15],v=i*a-s*o,_=i*l-n*o,b=i*c-r*o,w=s*l-n*a,C=s*c-r*a,M=n*c-r*l,I=h*f-d*m,T=h*g-u*m,x=h*y-p*m,k=d*g-u*f,S=d*y-p*f,P=u*y-p*g;let L=v*P-_*S+b*k+w*x-C*T+M*I;return L?(L=1/L,e[0]=(a*P-l*S+c*k)*L,e[1]=(l*x-o*P-c*T)*L,e[2]=(o*S-a*x+c*I)*L,e[3]=(n*S-s*P-r*k)*L,e[4]=(i*P-n*x+r*T)*L,e[5]=(s*x-i*S-r*I)*L,e[6]=(f*M-g*C+y*w)*L,e[7]=(g*b-m*M-y*_)*L,e[8]=(m*C-f*b+y*v)*L,e):null}function u(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e}const p=o,m=u;Object.freeze({__proto__:null,fromMat4:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},set:n,identity:r,transpose:function(e,t){if(e===t){const i=t[1],s=t[2],n=t[5];e[1]=t[3],e[2]=t[6],e[3]=i,e[5]=t[7],e[6]=s,e[7]=n}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},invert:function(e,t){const i=t[0],s=t[1],n=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],d=h*o-a*c,u=-h*r+a*l,p=c*r-o*l;let m=i*d+s*u+n*p;return m?(m=1/m,e[0]=d*m,e[1]=(-h*s+n*c)*m,e[2]=(a*s-n*o)*m,e[3]=u*m,e[4]=(h*i-n*l)*m,e[5]=(-a*i+n*r)*m,e[6]=p*m,e[7]=(-c*i+s*l)*m,e[8]=(o*i-s*r)*m,e):null},adjoint:function(e,t){const i=t[0],s=t[1],n=t[2],r=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8];return e[0]=o*h-a*c,e[1]=n*c-s*h,e[2]=s*a-n*o,e[3]=a*l-r*h,e[4]=i*h-n*l,e[5]=n*r-i*a,e[6]=r*c-o*l,e[7]=s*l-i*c,e[8]=i*o-s*r,e},determinant:function(e){const t=e[0],i=e[1],s=e[2],n=e[3],r=e[4],o=e[5],a=e[6],l=e[7],c=e[8];return t*(c*r-o*l)+i*(-c*n+o*a)+s*(l*n-r*a)},multiply:o,translate:a,rotate:l,scale:c,scaleByVec2:h,fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},fromRotation:function(e,t){const i=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=i,e[2]=0,e[3]=-i,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat2d:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},fromQuat:function(e,t){const i=t[0],s=t[1],n=t[2],r=t[3],o=i+i,a=s+s,l=n+n,c=i*o,h=s*o,d=s*a,u=n*o,p=n*a,m=n*l,f=r*o,g=r*a,y=r*l;return e[0]=1-d-m,e[3]=h-y,e[6]=u+g,e[1]=h+y,e[4]=1-c-m,e[7]=p-f,e[2]=u-g,e[5]=p+f,e[8]=1-c-d,e},normalFromMat4Legacy:function(e,t){const i=t[0],s=t[1],n=t[2],r=t[4],o=t[5],a=t[6],l=t[8],c=t[9],h=t[10],d=h*o-a*c,u=-h*r+a*l,p=c*r-o*l,m=i*d+s*u+n*p;if(!m)return null;const f=1/m;return e[0]=d*f,e[1]=(-h*s+n*c)*f,e[2]=(a*s-n*o)*f,e[3]=u*f,e[4]=(h*i-n*l)*f,e[5]=(-a*i+n*r)*f,e[6]=p*f,e[7]=(-c*i+s*l)*f,e[8]=(o*i-s*r)*f,e},normalFromMat4:d,projection:function(e,t,i){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/i,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},str:function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)},add:function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e},subtract:u,multiplyScalar:function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e},multiplyScalarAndAdd:function(e,t,i,s){return e[0]=t[0]+i[0]*s,e[1]=t[1]+i[1]*s,e[2]=t[2]+i[2]*s,e[3]=t[3]+i[3]*s,e[4]=t[4]+i[4]*s,e[5]=t[5]+i[5]*s,e[6]=t[6]+i[6]*s,e[7]=t[7]+i[7]*s,e[8]=t[8]+i[8]*s,e},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},equals:function(e,t){const i=e[0],n=e[1],r=e[2],o=e[3],a=e[4],l=e[5],c=e[6],h=e[7],d=e[8],u=t[0],p=t[1],m=t[2],f=t[3],g=t[4],y=t[5],v=t[6],_=t[7],b=t[8];return Math.abs(i-u)<=s.E*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(n-p)<=s.E*M
1ath.max(1,Math.abs(n),Math.abs(p))&&Math.abs(r-m)<=s.E*Math.max(1,Math.abs(r),Math.abs(m))&&Math.abs(o-f)<=s.E*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-g)<=s.E*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(l-y)<=s.E*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(c-v)<=s.E*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(h-_)<=s.E*Math.max(1,Math.abs(h),Math.abs(_))&&Math.abs(d-b)<=s.E*Math.max(1,Math.abs(d),Math.abs(b))},mul:p,sub:m})},19710:function(e,t,i){function s(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function n(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}i.d(t,{a:function(){return n},c:function(){return s}});Object.freeze({__proto__:null,create:s,clone:n,fromValues:function(e,t,i,s,n,r,o,a,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=i,c[3]=s,c[4]=n,c[5]=r,c[6]=o,c[7]=a,c[8]=l,c},createView:function(e,t){return new Float32Array(e,t,9)}})},69666:function(e,t,i){function s(){return[0,0]}function n(e,t){return[e,t]}function r(e,t){return new Float64Array(e,t,2)}function o(){return[0,0]}function a(){return n(1,1)}function l(){return n(1,0)}function c(){return n(0,1)}i.d(t,{a:function(){return s},c:function(){return r},f:function(){return n}});const h=[0,0],d=a(),u=l(),p=c();Object.freeze({__proto__:null,create:s,clone:function(e){return[e[0],e[1]]},fromValues:n,fromArray:function(e){const t=[0,0],i=Math.min(2,e.length);for(let s=0;s<i;++s)t[s]=e[s];return t},createView:r,zeros:o,ones:a,unitX:l,unitY:c,ZEROS:h,ONES:d,UNIT_X:u,UNIT_Y:p})},81739:function(e,t,i){var s=i(36663),n=i(81977),r=i(66645),o=i(18302),a=i(44584);let l=class extends o.Z{constructor(e){super(e),this._handles=new a.Z,this.root=null}initialize(){this._handles.add(this.rootCollectionNames.map((e=>this.watch("root."+e,(()=>this.updateCollections()),!0)))),this.updateCollections()}destroy(){this.root=null,this.refresh(),this._handles.destroy(),this._handles=null}updateCollections(){this._collections=this.rootCollectionNames.map((e=>this.get("root."+e))).filter((e=>null!=e)),this.refresh()}refresh(){const e=this._handles;e.remove("collections");const t=new Array;let i=0;for(const s of this._collections)i=this._processCollection(t,i,s);this.splice(i,this.length);for(const s of t)e.add(s.on("after-changes",(()=>this.refresh())),"collections")}_createNewInstance(e){return new o.Z(e)}_processCollection(e,t,i){return i?(e.push(i),i.forEach((i=>{if(i){if(!this.itemFilterFunction||this.itemFilterFunction(i)){const e=this.indexOf(i,t);e>=0?e!==t&&this.reorder(i,t):this.add(i,t),++t}this.getChildrenFunction&&(t=this._processCollection(e,t,this.getChildrenFunction(i)))}})),t):t}};(0,s._)([(0,n.Cb)()],l.prototype,"rootCollectionNames",void 0),(0,s._)([(0,n.Cb)()],l.prototype,"root",void 0),(0,s._)([(0,n.Cb)()],l.prototype,"getChildrenFunction",void 0),(0,s._)([(0,n.Cb)()],l.prototype,"itemFilterFunction",void 0),l=(0,s._)([(0,r.j)("esri.core.CollectionFlattener")],l);var c=l;t.Z=c},53280:function(e,t,i){i.d(t,{r:function(){return h},p:function(){return c}});var s=i(36663),n=i(81977),r=i(66645),o=i(36900),a=i(44584),l=i(73216);const c=e=>{let t=class extends e{destroy(){this.destroyed||(this.handles.destroy(),this.updatingHandles.destroy())}get handles(){return this._get("handles")||new a.Z}get updatingHandles(){return this._get("updatingHandles")||new l.t}};return(0,s._)([(0,n.Cb)({readOnly:!0})],t.prototype,"handles",null),(0,s._)([(0,n.Cb)({readOnly:!0})],t.prototype,"updatingHandles",null),t=(0,s._)([(0,r.j)("esri.core.HandleOwner")],t),t};let h=class extends(c(o.Z)){};h=(0,s._)([(0,r.j)("esri.core.HandleOwner")],h)},58713:function(e,t,i){var s=i(61681);t.Z=class{constructor(e=(e=>e.values().next().value)){this._peeker=e,this._items=new Set}get length(){return this._items.size}clear(){this._items.clear()}peek(){if(0!==this._items.size)return this._peeker(this._items)}push(e){this.contains(e)||this._items.add(e)}contains(e){return this._items.has(e)}pop(){if(0===this.length)return;const e=this.peek();return this._items.delete((0,s.j0)(e)),e}remove(e){this._items.delete(e)}
1filter(e){return this._items.forEach((t=>{e(t)||this._items.delete(t)})),this}}},63592:function(e,t,i){i.d(t,{GZ:function(){return a},wF:function(){return l}});var s=i(61681),n=i(18302),r=i(68309),o=i(67979);async function a(e,t){return await e.load(),l(e,t)}async function l(e,t){const i=[],a=(...e)=>{for(const t of e)(0,s.Wi)(t)||(Array.isArray(t)?a(...t):n.Z.isCollection(t)?t.forEach((e=>a(e))):r.Z.isLoadable(t)&&i.push(t))};t(a);let l=null;if(await(0,o.UI)(i,(async e=>{!1!==(await(0,o.q6)(function(e){return"loadAll"in e&&"function"==typeof e.loadAll}(e)?e.loadAll():e.load())).ok||l||(l=e)})),l)throw l.loadError;return e}},618:function(e,t,i){function s(e,t,i,s){let n=null,r=1e3;"number"==typeof t?(r=t,s=i):(n=null!=t?t:null,r=i);let o,a=0;const l=()=>{a=0,e.apply(s,o)},c=(...e)=>{n&&n.apply(s,e),o=e,r?a||(a=setTimeout(l,r)):l()};return c.remove=()=>{a&&(clearTimeout(a),a=0)},c.forceUpdate=()=>{a&&(clearTimeout(a),l())},c.hasPendingUpdates=()=>!!a,c}i.d(t,{P:function(){return s}})},57714:function(e,t,i){i.d(t,{X:function(){return h},O:function(){return c}});var s=i(3466),n=i(88256),r=i(11509),o=i(72635),a=i(18382);function l(e){const t=e.toJSON();return t.attachmentTypes&&(t.attachmentTypes=t.attachmentTypes.join(",")),t.keywords&&(t.keywords=t.keywords.join(",")),t.globalIds&&(t.globalIds=t.globalIds.join(",")),t.objectIds&&(t.objectIds=t.objectIds.join(",")),t.size&&(t.size=t.size.join(",")),t}function c(e,t){const i={};for(const r of e){const{parentObjectId:e,parentGlobalId:a,attachmentInfos:l}=r;for(const r of l){const{id:l}=r,c=(0,s.qg)((0,n.Dp)(`${t}/${e}/attachments/${l}`)),h=o.Z.fromJSON(r);h.set({url:c,parentObjectId:e,parentGlobalId:a}),i[e]?i[e].push(h):i[e]=[h]}}return i}function h(e,t,i){let s={query:(0,a.A)({...e.query,f:"json",...l(t)})};return i&&(s={...i,...s,query:{...i.query,...s.query}}),(0,r.default)(e.path+"/queryAttachments",s)}},72635:function(e,t,i){i.d(t,{Z:function(){return u}});var s,n=i(36663),r=(i(39994),i(13802),i(7283)),o=i(81977),a=i(66645),l=(i(3466),i(12173),i(51876),i(49004));function c(e){const{exifInfo:t,exifName:i,tagName:s}=e;if(!t||!i||!s)return null;const n=t.find((e=>e.name===i));return n?function(e){const{tagName:t,tags:i}=e;if(!i||!t)return null;const s=i.find((e=>e.name===t));return s&&s.value||null}({tagName:s,tags:n.tags}):null}const h={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let d=s=class extends l.wq{constructor(e){super(e),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:e}=this,t=c({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:e});return h[t]||null}clone(){return new s({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};(0,n._)([(0,o.Cb)({type:String})],d.prototype,"contentType",void 0),(0,n._)([(0,o.Cb)()],d.prototype,"exifInfo",void 0),(0,n._)([(0,o.Cb)({readOnly:!0})],d.prototype,"orientationInfo",null),(0,n._)([(0,o.Cb)({type:r.z8})],d.prototype,"id",void 0),(0,n._)([(0,o.Cb)({type:String})],d.prototype,"globalId",void 0),(0,n._)([(0,o.Cb)({type:String})],d.prototype,"keywords",void 0),(0,n._)([(0,o.Cb)({type:String})],d.prototype,"name",void 0),(0,n._)([(0,o.Cb)({json:{read:!1}})],d.prototype,"parentGlobalId",void 0),(0,n._)([(0,o.Cb)({json:{read:!1}})],d.prototype,"parentObjectId",void 0),(0,n._)([(0,o.Cb)({type:r.z8})],d.prototype,"size",void 0),(0,n._)([(0,o.Cb)({json:{read:!1}})],d.prototype,"url",void 0),d=s=(0,n._)([(0,a.j)("esri.layers.support.AttachmentInfo")],d);var u=d},94449:function(e,t,i){i.d(t,{JN:function(){return d},$o:function(){return u}});var s=i(36663),n=(i(39994),i(13802)),r=(i(7283),i(81977)),o=i(66645),a=(i(3466),i(12173),i(51876),i(18302)),l=i(58811),c=i(80085);const h=a.Z.ofType(c.Z);n.Z.getLogger("esri.support.GraphicsCollection");let d=class extends h{constructor(e){super(e),this.on("before-add",(e=>{e.item||e.preventDefault()})),this.on("after-add",(e=>this._own(e.item))),this.on("after-remove",(({item:e})=>{e.layer=null}))}destroy(){this._unownAll()}get owner(){return this._get("owner")}set owner(e){e!==this._get("owner")&&(this._unownAll(),this._set("owner",e),this._ownAll())}_createNewInstance(e){return new h(e)}
1_ownAll(){this.items.forEach((e=>this._own(e)))}_own(e){e.layer&&"remove"in e.layer&&e.layer!==this.owner&&e.layer.remove(e),e.layer=this.owner}_unownAll(){this.items.forEach((e=>this._unown(e)))}_unown(e){e.layer===this.owner&&(e.layer=null)}};(0,s._)([(0,r.Cb)()],d.prototype,"owner",null),d=(0,s._)([(0,o.j)("esri.support.GraphicsCollection")],d);const u=(e="graphics")=>({type:d,cast:l.R,set(t){const i=(0,l.Z)(t,this._get(e),d);i.owner=this,this._set(e,i)}});var p=d;t.ZP=p},67302:function(e,t,i){i.d(t,{K:function(){return m}});var s=i(36663),n=(i(39994),i(13802)),r=(i(7283),i(81977)),o=i(66645),a=(i(3466),i(12173),i(51876),i(78668)),l=i(18302),c=i(58811),h=i(76136);function d(e){return e&&"group"===e.type}function u(e,t,i){let s,n;if(e)for(let r=0,o=e.length;r<o;r++){if(s=e.getItemAt(r),s[t]===i)return s;if(d(s)&&(n=u(s.layers,t,i),n))return n}}const p=n.Z.getLogger("esri.support.LayersMixin"),m=e=>{let t=class extends e{constructor(...e){super(...e),this.layers=new l.Z;const t=e=>{e.parent=this,this.layerAdded(e),"elevation"!==e.type&&"base-elevation"!==e.type||p.error(`Layer 'title:${e.title}, id:${e.id}' of type '${e.type}' is not supported as an operational layer and will therefore be ignored.`)},i=e=>{e.parent=null,this.layerRemoved(e)};this.layers.on("before-add",(e=>(e=>{e.parent&&"remove"in e.parent&&e.parent.remove(e)})(e.item))),this.layers.on("after-add",(e=>t(e.item))),this.layers.on("after-remove",(e=>i(e.item)))}destroy(){const e=this.layers.removeAll();for(const t of e)this.layerRemoved(t),t.destroy();this.layers.destroy()}set layers(e){this._set("layers",(0,c.Z)(e,this._get("layers")))}add(e,t){const i=this.layers;t=i.getNextIndex(t),e instanceof h.Z?e.parent===this?this.reorder(e,t):i.add(e,t):(0,a.y8)(e)?e.then((e=>{this.destroyed||this.add(e,t)})):p.error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(e,t){const i=this.layers;t=i.getNextIndex(t),e.slice().forEach((e=>{e.parent!==this?(i.add(e,t),t+=1):this.reorder(e,t)}))}findLayerById(e){return u(this.layers,"id",e)}findLayerByUid(e){return u(this.layers,"uid",e)}remove(e){return this.layers.remove(e)}removeMany(e){return this.layers.removeMany(e)}removeAll(){return this.layers.removeAll()}reorder(e,t){return this.layers.reorder(e,t)}layerAdded(e){}layerRemoved(e){}};return(0,s._)([(0,r.Cb)()],t.prototype,"layers",null),t=(0,s._)([(0,o.j)("esri.support.LayersMixin")],t),t}},98234:function(e,t,i){i.d(t,{Q:function(){return p}});var s=i(36663),n=(i(39994),i(13802)),r=(i(7283),i(81977)),o=i(66645),a=(i(3466),i(12173),i(51876),i(18302)),l=i(58811);const c="esri.support.TablesMixin",h=n.Z.getLogger(c);function d(e){return e&&"group"===e.type}function u(e,t,i){if(e)for(let s=0,n=e.length;s<n;s++){const n=e.getItemAt(s);if(n[t]===i)return n;if(d(n)){const e=u(n.tables,t,i);if(e)return e}}}const p=e=>{let t=class extends e{constructor(...e){super(...e),this.tables=new a.Z,this.tables.on("after-add",(e=>{const t=e.item;t.parent&&t.parent!==this&&"tables"in t.parent&&t.parent.tables.remove(t),t.parent=this,"feature"!==t.type&&h.error(`Layer 'title:${t.title}, id:${t.id}' of type '${t.type}' is not supported as a table and will therefore be ignored.`)})),this.tables.on("after-remove",(e=>{e.item.parent=null}))}destroy(){const e=this.tables.removeAll();for(const t of e)t.destroy();this.tables.destroy()}set tables(e){this._set("tables",(0,l.Z)(e,this._get("tables")))}findTableById(e){return u(this.tables,"id",e)}findTableByUid(e){return u(this.tables,"uid",e)}};return(0,s._)([(0,r.Cb)()],t.prototype,"tables",null),t=(0,s._)([(0,o.j)(c)],t),t}},2725:function(e,t,i){i.d(t,{s:function(){return o},g:function(){return r}});var s=i(60720),n=i(36567);async function r(e){if(!e)return;const t=e.indexOf("-vector")>-1?e.slice(0,e.indexOf("-vector")):e,i=await(0,s.ME)("esri/t9n/basemaps");return i[e]||i[t]}const o={streets:{id:"streets",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/streets.jpg")},baseMapLayers:[{id:"streets-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Street Map",showLegend:!1,visibility:!0,opacity:1}]},satellite:{id:"satellite",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Boundaries and Places",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},topo:{id:"topo",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/topo.jpg")},baseMapLayers:[{id:"topo-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Topo Map",showLegend:!1,visibility:!0,opacity:1}]},gray:{id:"gray",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/gray.jpg")},baseMapLayers:[{id:"gray-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Light Gray Base",showLegend:!1,visibility:!0,opacity:1},{id:"gray-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Light Gray Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},"dark-gray":{id:"dark-gray",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/dark-gray.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Dark Gray Base",showLegend:!1,visibility:!0,opacity:1},{id:"dark-gray-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Dark Gray Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},"national-geographic":{id:"national-geographic",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/national-geographic.jpg")},baseMapLayers:[{id:"national-geographic-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer",title:"NatGeo World Map",showLegend:!1,layerType:"ArcGISTiledMapServiceLayer",visibility:!0,opacity:1}]},osm:{id:"osm",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},"gray-vector":{id:"gray-vector",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167
1d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},"streets-vector":{id:"streets-vector",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},"topo-vector":{id:"topo-vector",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},"streets-night-vector":{id:"streets-night-vector",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",get thumbnailUrl(){return(0,n.V)("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"arcgis-imagery":{get thumbnailUrl(){return(0,n.V)("esri/images/basemap/hybrid.jpg")},title:"Imagery Hybrid",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-imagery-standard":{get thumbnailUrl(){return(0,n.V)("esri/images/basemap/satellite.jpg")},title:"Imagery",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"}]},"arcgis-imagery-labels":{title:"Hybrid [Reference]",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-light-gray":{get thumbnailUrl(){return(0,n.V)("esri/images/basemap/gray-vector.jpg")},title:"Light Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Base",title:"Light Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Labels",title:"Light Gray Canvas Labels",isReference:!0}]},"arcgis-dark-gray":{get thumbnailUrl(){return(0,n.V)("esri/images/basemap/dark-gray.jpg")},title:"Dark Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Base",title:"Dark Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Labels",title:"Dark Gray Canvas Labels",isReference:!0}]},"arcgis-navigation":{get thumbnailUrl(){return(0,n.V)("esri/images/basemap/streets-navigation.jpg")},title:"Navigation",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Navigation",title:"World Navigation Map"}]},"arcgis-navigation-night":{title:"Navigation (Dark Mode)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:NavigationNight",title:"World Navigation Map (Dark Mode)"}]},"arcgis-streets":{get thumbnailUrl(){return(0,n.V)("esri/images/basemap/streets-vector.jpg")},title:"Streets",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Streets",title:"World Street Map"}]},"arcgis-streets-night":{get thumbnailUrl(){return(0,n.V)("esri/images/basemap/streets-night.jpg")},title:"Streets (Night)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsNight",title:"World Street Map (Night)"}]},"arcgis-streets-relief":{get thumbnailUrl(){return(0,n.V)("esri/images/basemap/streets-relief.jpg")},title:"Streets (with Relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsRelief:Base",title:"World Street Map (with Relief)"}]}
1,"arcgis-topographic":{get thumbnailUrl(){return(0,n.V)("esri/images/basemap/topo.jpg")},title:"Topographic",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Topographic:Base",title:"World Topographic Map"}]},"arcgis-oceans":{get thumbnailUrl(){return(0,n.V)("esri/images/basemap/oceans.jpg")},title:"Oceans",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Base",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Oceans:Labels",title:"World Ocean Reference",isReference:!0}]},"osm-standard":{title:"OpenStreetMap",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Standard",title:"OpenStreetMap"}]},"osm-standard-relief":{title:"OpenStreetMap (with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StandardRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-streets":{title:"OpenStreetMap (Streets)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Streets",title:"OpenStreetMap (Streets)"}]},"osm-streets-relief":{title:"OpenStreetMap (Streets with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StreetsRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-light-gray":{title:"OpenStreetMap (Light Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Base",title:"OSM (Light Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Labels",title:"OSM (Light Gray Reference)",isReference:!0}]},"osm-dark-gray":{title:"OpenStreetMap (Dark Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Base",title:"OSM (Dark Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Labels",title:"OSM (Dark Gray Reference)",isReference:!0}]},"arcgis-terrain":{title:"Terrain with Labels",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Base",title:"World Terrain Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Detail",title:"World Terrain Reference",isReference:!0}]},"arcgis-community":{title:"Community",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Community",title:"Community"}]},"arcgis-charted-territory":{title:"Charted Territory",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ChartedTerritory:Base",title:"Charted Territory"}]},"arcgis-colored-pencil":{title:"Colored Pencil",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ColoredPencil",title:"Colored Pencil"}]},"arcgis-nova":{title:"Nova",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Nova",title:"Nova"}]},"arcgis-modern-antique":{title:"Modern Antique",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ModernAntique:
1Base",title:"Modern Antique"}]},"arcgis-midcentury":{title:"Mid-Century",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Midcentury",title:"Mid-Century"}]},"arcgis-newspaper":{title:"Newspaper",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Newspaper",title:"Newspaper"}]},"arcgis-hillshade-light":{title:"Hillshade",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}]},"arcgis-hillshade-dark":{title:"Hillshade (Dark)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade (Dark)",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer"}]}}},97500:function(e,t,i){i.d(t,{iW:function(){return h},kW:function(){return r},FW:function(){return l},PI:function(){return o}});var s=i(30936),n=i(60789);function r(e){const t=(0,n.be)(e);if("CIMTextSymbol"===t.type)return t.height;let i=0;if(t.symbolLayers)for(const s of t.symbolLayers)(0,n.zL)(s)&&s.size>i?i=s.size:(0,n.yL)(s)&&s.width>i?i=s.width:(0,n.k5)(s);return i}function o(e,t,i){const s=(0,n.be)(e),o=r(e);0!==o?a(s,t/o,!1,i):function(e,t){if("CIMTextSymbol"!==e.type){if(e.symbolLayers)for(const i of e.symbolLayers)switch(i.type){case"CIMPictureMarker":case"CIMVectorMarker":i.size=t;break;case"CIMPictureStroke":case"CIMSolidStroke":i.width=t}}else e.height=t}(s,t)}function a(e,t,i,s){if("CIMTextSymbol"!==e.type){if(i&&e.effects)for(const i of e.effects)c(i,t);if(e.symbolLayers)for(const i of e.symbolLayers)switch(i.type){case"CIMPictureMarker":case"CIMVectorMarker":l(i,t,s);break;case"CIMPictureStroke":case"CIMSolidStroke":null!=s&&s.preserveOutlineWidth||(i.width*=t);break;case"CIMPictureFill":i.height*=t,i.offsetX*=t,i.offsetY*=t;break;case"CIMHatchFill":a(i.lineSymbol,t,!0,{...s,preserveOutlineWidth:!1}),i.offsetX*=t,i.offsetY*=t,i.separation*=t}}else e.height*=t}function l(e,t,i){if(e.markerPlacement&&function(e,t){switch((0,n.gJ)(e)&&(e.offset*=t),e.type){case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineSameSize":if(e.customEndingOffset*=t,e.offsetAlongLine*=t,e.placementTemplate&&e.placementTemplate.length){const i=e.placementTemplate.map((e=>e*t));e.placementTemplate=i}break;case"CIMMarkerPlacementAlongLineVariableSize":if(e.maxRandomOffset*=t,e.placementTemplate&&e.placementTemplate.length){const i=e.placementTemplate.map((e=>e*t));e.placementTemplate=i}break;case"CIMMarkerPlacementOnLine":e.startPointOffset*=t;break;case"CIMMarkerPlacementAtExtremities":e.offsetAlongLine*=t;break;case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementOnVertices":break;case"CIMMarkerPlacementAtRatioPositions":e.beginPosition*=t,e.endPosition*=t;break;case"CIMMarkerPlacementPolygonCenter":e.offsetX*=t,e.offsetY*=t;break;case"CIMMarkerPlacementInsidePolygon":e.offsetX*=t,e.offsetY*=t,e.stepX*=t,e.stepY*=t}}(e.markerPlacement,t),e.offsetX*=t,e.offsetY*=t,e.anchorPoint&&"Absolute"===e.anchorPointUnits&&(e.anchorPoint={x:e.anchorPoint.x*t,y:e.anchorPoint.y*t}),e.size*=t,"CIMVectorMarker"===e.type&&e.markerGraphics)for(const s of e.markerGraphics)e.scaleSymbolsProportionally||a(s.symbol,t,!0,i)}function c(e,t){switch(e.type){case"CIMGeometricEffectArrow":case"CIMGeometricEffectDonut":e.width*=t;break;case"CIMGeometricEffectBuffer":e.size*=t;break;case"CIMGeometricEffectCut":e.beginCut*=t,e.endCut*=t,e.middleCut*=t;break;case"CIMGeometricEffectDashes":if(e.customEndingOffset*=t,e.offsetAlongLine*=t,e.dashTemplate&&e.dashTemplate.length){const i=e.dashTemplate.map((e=>e*t));e.dashTemplate=i}break;case"CIMGeometricEffectExtension":case"CIMGeometricEffectJog":case"CIMGeometricEffectRadial":e.length*=t;break;case"CIMGeometricEffectMove":e.offsetX*=t,e.offsetY*=t;break;case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":e.offset*=t;break;case"CIMGeometricEffectRegularPolygon":e.radius*=t;break;case"CIMGeometricEffectTaperedPolygon":e.fromWidth*=t,e.length*=t,e.toWidth*=t;break;case"CIMGeometricEffectWave":e.amplitude*=t,e.period*=t}}function h(e){const t=[];return d((0,n.be)(e),t),t.length?new s.Z((0,n.NO)(t[0])):null}function d(e,t){let i;i="CIMTextSymbol"===e.type?e.symbol:e;const s="CIMPolygonSymbol"===e.type;if(i.symbolLayers)for(const r of i.symbolLayers)if(!(r.colorLocked||s&&((0,n.yL)(r)||(0,n.zL)(r)&&r.markerPlacement&&(0,n.gJ)(r.markerPlacement))))switch(r.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":break;case"CIMVectorMarker":r.markerGraphics.forEach((e=>{d(e.symbol,t)}));break;case"CIMSolidStroke":case"CIMSolidFill":u(t,r.color);break;case"CIMHatchFill":d(r.lineSymbol,t)}}function u(e,t){for(const i of e)if(i.join(".")===t.join("."))return;e.push(t)}},89298:function(e,t,i){i.d(t,{Ne:function(){return y},_M:function(){return p},Od:function(){return m},mx:function(){return f}});var s=i(30936),n=i(95550),r=i(11509),o=i(36567),a=i(77234),l=i(97500);
1const c="picture-fill",h="simple-fill",d="simple-marker",u=new a.Z(1e3);function p(e){const t=e.style;let i=null;if(e)switch(e.type){case d:"cross"!==t&&"x"!==t&&(i=e.color);break;case h:"solid"===t?i=e.color:"none"!==t&&(i={type:"pattern",x:0,y:0,src:(0,o.V)(`esri/symbols/patterns/${t}.png`),width:5,height:5});break;case c:i={type:"pattern",src:e.url,width:(0,n.F2)(e.width)*e.xscale,height:(0,n.F2)(e.height)*e.yscale,x:(0,n.F2)(e.xoffset),y:(0,n.F2)(e.yoffset)};break;case"text":i=e.color;break;case"cim":i=(0,l.iW)(e)}return i}function m(e,t){const i=e+"-"+t;return void 0!==u.get(i)?Promise.resolve(u.get(i)):(0,r.default)(e,{responseType:"image"}).then((e=>{const s=e.data,n=s.naturalWidth,r=s.naturalHeight,o=document.createElement("canvas");o.width=n,o.height=r;const a=o.getContext("2d");a.fillStyle=t,a.fillRect(0,0,n,r),a.globalCompositeOperation="destination-in",a.drawImage(s,0,0);const l=o.toDataURL();return u.put(i,l),l}))}function f(e){if(!e)return null;let t;switch(e.type){case h:case c:case d:t=f(e.outline);break;case"simple-line":{const i=(0,n.F2)(e.width);"none"!==e.style&&0!==i&&(t={color:e.color,style:g(e.style),width:i,cap:e.cap,join:"miter"===e.join?(0,n.F2)(e.miterLimit):e.join});break}default:t=null}return t}const g=function(){const e={};return function(t){if(e[t])return e[t];const i=t.replace(/-/g,"");return e[t]=i,i}}(),y=new s.Z([128,128,128])},59672:function(e,t,i){i.d(t,{tb:function(){return f},BR:function(){return w},e3:function(){return b},nf:function(){return p},YW:function(){return u}});var s=i(39994),n=i(61681),r=i(30936),o=i(57403),a=i(79185),l=i(67979),c=i(8909);i(89298);const h=/\/resource\/(.*?)\.svg$/,d=new r.Z("white");function u(e){if(!e||!e.symbolLayers)return!1;switch(e.type){case"point-3d":return e.symbolLayers.some((e=>"object"===e.type));case"line-3d":return e.symbolLayers.some((e=>"path"===e.type));case"polygon-3d":return e.symbolLayers.some((e=>"object"===e.type||"extrude"===e.type));default:return!1}}function p(e,t){const i=t.resource.href;return!(0,s.Z)("esri-canvas-svg-support")&&e.styleOrigin&&h.test(i)?i.replace(h,"/resource/png/$1.png"):i}function m(e,t){if(null==t)return e;const i=e.toRgba();return i[3]=i[3]*t,new r.Z(i)}function f(e,t,i){e&&(t||null!=i)&&(t&&(t=new r.Z(t)),(0,a.dU)(e)?function(e,t,i){const s=e.symbolLayers;if(!s)return;const r=e=>{const s=(0,n.pC)(e)?e:null;return m(t=t||s||null!=i&&d,i)};s.forEach((e=>{if("object"!==e.type||null==e.resource.href||t)if("water"===e.type)e.color=r(e.color);else{const t=(0,n.pC)(e.material)?e.material.color:null,s=r(t);(0,n.Wi)(e.material)?e.material=new o.Z({color:s}):e.material.color=s,null!=i&&"outline"in e&&(0,n.pC)(e.outline)&&(0,n.pC)(e.outline.color)&&(e.outline.color=m(e.outline.color,i))}}))}(e,t,i):(0,a.cT)(e)&&function(e,t,i){(t=t||e.color)&&(e.color=m(t,i)),null!=i&&"outline"in e&&e.outline&&e.outline.color&&(e.outline.color=m(e.outline.color,i))}(e,t,i))}async function g(e,t){const s=e.symbolLayers;s&&await(0,l.Ed)(s,(async e=>async function(e,t){switch(e.type){case"extrude":!function(e,t){e.size="number"==typeof t[2]?t[2]:0}(e,t);break;case"icon":case"line":case"text":!function(e,t){const i=y(t);(0,n.pC)(i)&&(e.size=i)}(e,t);break;case"path":!function(e,t){const i=v(t,c.O,[e.width,void 0,e.height]);e.width=_(t[0],e.width,1,i),e.height=_(t[2],e.height,1,i)}(e,t);break;case"object":await async function(e,t){const{resourceSize:s,symbolSize:n}=await async function(e){const t=await Promise.all([i.e(9351),i.e(3868)]).then(i.bind(i,13868)),s=await t.computeObjectLayerResourceSize(e,10),{width:n,height:r,depth:o}=e,a=[n,o,r];let l=1;for(let i=0;i<3;i++)if(null!=a[i]){l=a[i]/s[i];break}for(let i=0;i<3;i++)null==a[i]&&(a[i]=s[i]*l);return{resourceSize:s,symbolSize:a}}(e),r=v(t,s,n);e.width=_(t[0],n[0],s[0],r),e.depth=_(t[1],n[1],s[1],r),e.height=_(t[2],n[2],s[2],r)}(e,t)}}(e,t)))}function y(e){for(const t of e)if("number"==typeof t)return t;return null}function v(e,t,i){for(let s=0;s<3;s++){const n=e[s];switch(n){case"symbol-value":return null!=i[s]?i[s]/t[s]:1;case"proportional":break;default:if(n&&t[s])return n/t[s]}}return 1}function _(e,t,i,s){switch(e){case"proportional":return i*s;case"symbol-value":return null!=t?t:i;default:return e}}async function b(e,t){if(e&&t)return(0,a.dU)(e)?g(e,t):void((0,a.cT)(e)&&function(e,t){const i=y(t);
1if(!(0,n.Wi)(i))switch(e.type){case"simple-marker":e.size=i;break;case"picture-marker":{const t=e.width/e.height;t>1?(e.width=i,e.height=i*t):(e.width=i*t,e.height=i);break}case"simple-line":e.width=i;break;case"text":e.font.size=i}}(e,t))}function w(e,t,i){if(e&&null!=t)if((0,a.dU)(e)){const s=e.symbolLayers;s&&s.forEach((e=>{if(e&&"object"===e.type)switch(i){case"tilt":e.tilt=t;break;case"roll":e.roll=t;break;default:e.heading=t}}))}else(0,a.cT)(e)&&("simple-marker"!==e.type&&"picture-marker"!==e.type&&"text"!==e.type||(e.angle=t))}},23277:function(e,t,i){i.d(t,{Z:function(){return D}});var s=i(36663),n=i(39994),r=i(61681),o=(i(13802),i(7283),i(81977)),a=i(66645),l=(i(3466),i(12173),i(51876),i(41017)),c=i(6095),h=i(27746),d=i(40304),u=i(14755),p=i(84238),m=i(57714);var f=i(28500);var g=i(91772);i(91957);async function y(e,t,i){const s=(0,p.en)(e),n={...i},r=h.Z.from(t),{data:o}=await(0,f.executeQuery)(s,r,r.sourceSpatialReference,n);return o}var v=i(27755),_=i(12065),b=i(2037);function w(e,t){return t}function C(e,t,i,s){switch(i){case 0:return x(e,t+s,0);case 1:return"lowerLeft"===e.originPosition?x(e,t+s,1):function({translate:e,scale:t},i,s){return e[s]-i*t[s]}(e,t+s,1)}}function M(e,t,i,s){return 2===i?x(e,t,2):C(e,t,i,s)}function I(e,t,i,s){return 2===i?x(e,t,3):C(e,t,i,s)}function T(e,t,i,s){return 3===i?x(e,t,3):M(e,t,i,s)}function x({translate:e,scale:t},i,s){return e[s]+i*t[s]}class k{constructor(e){this.options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this.previousCoordinate=[0,0],this.transform=null,this.applyTransform=w,this.lengths=[],this.currentLengthIndex=0,this.toAddInCurrentPath=0,this.vertexDimension=0,this.coordinateBuffer=null,this.coordinateBufferPtr=0,this.AttributesConstructor=function(){}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this.options.applyTransform&&(e.transform=null),this.AttributesConstructor=function(){},this.coordinateBuffer=null,this.lengths.length=0,!e.hasZ)return;const t=(0,b.k)(e.geometryType,this.options.sourceSpatialReference,e.spatialReference);if(t)for(const i of e.features)t(i.geometry)}createSpatialReference(){return{}}addField(e,t){e.fields.push(t);const i=e.fields.map((e=>e.name));this.AttributesConstructor=function(){for(const e of i)this[e]=null}}addFeature(e,t){e.features.push(t)}prepareFeatures(e){switch(this.transform=e.transform,this.options.applyTransform&&e.transform&&(this.applyTransform=this.deriveApplyTransform(e)),this.vertexDimension=2,e.hasZ&&this.vertexDimension++,e.hasM&&this.vertexDimension++,e.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,t,i)=>this.addCoordinatePoint(e,t,i),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,t,i)=>this.addCoordinatePolygon(e,t,i),this.createGeometry=e=>this.createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,t,i)=>this.addCoordinatePolyline(e,t,i),this.createGeometry=e=>this.createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,t,i)=>this.addCoordinateMultipoint(e,t,i),this.createGeometry=e=>this.createMultipointGeometry(e);break;default:(0,v.Bg)(e.geometryType)}}createFeature(){return this.lengths.length=0,this.currentLengthIndex=0,this.previousCoordinate[0]=0,this.previousCoordinate[1]=0,this.coordinateBuffer=null,this.coordinateBufferPtr=0,{attributes:new this.AttributesConstructor}}allocateCoordinates(){}addLength(e,t,i){0===this.lengths.length&&(this.toAddInCurrentPath=t),this.lengths.push(t)}addQueryGeometry(e,t){const{queryGeometry:i,queryGeometryType:s}=t,n=(0,_.$g)(i.clone(),i,!1,!1,this.transform),r=(0,_.di)(n,s,!1,!1);e.queryGeometryType=s,e.queryGeometry={...r}}createPointGeometry(e){const t={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(t.z=0),e.hasM&&(t.m=0),t}addCoordinatePoint(e,t,i){switch(t=this.applyTransform(this.transform,t,i,0),i){case 0:e.x=t;break;case 1:e.y=t;break;case 2:"z"in e?e.z=t:e.m=t;break;case 3:e.m=t}}transformPathLikeValue(e,t){let i=0;return t<=1&&(i=this.previousCoordinate[t],this.previousCoordinate[t]+=e),this.applyTransform(this.transform,e,t,i)}addCoordinatePolyline(e,t,i){this.dehydratedAddPointsCoordinate(e.paths,t,i)}addCoordinatePolygon(e,t,i){this.dehydratedAddPointsCoordinate(e.rings,t,i)}addCoordinateMultipoint(e,t,i){0===i&&e.points.push([]);const s=this.transformPathLikeValue(t,i);e.points[e.points.length-1].push(s)}createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}dehydratedAddPointsCoordinate(e,t,i){0===i&&0==this.toAddInCurrentPath--&&(e.push([]),this.toAddInCurrentPath=this.lengths[++this.currentLengthIndex]-1,this.previousCoordinate[0]=0,this.previousCoordinate[1]=0);const s=this.transformPathLikeValue(t,i),n=e[e.length-1];0===i&&(this.coordinateBufferPtr=0,this.coordinateBuffer=new Array(this.vertexDimension),n.push(this.coordinateBuffer)),this.coordinateBuffer[this.coordinateBufferPtr++]=s}deriveApplyTransform(e){const{hasZ:t,hasM:i}=e;return t&&i?T:t?M:i?I:C}}async function S(e,t,i){const s=(0,p.en)(e),n={...i},r=h.Z.from(t),o=!r.quantizationParameters,{data:a}=await(0,f.executeQueryPBF)(s,r,new k({sourceSpatialReference:r.sourceSpatialReference,applyTransform:o}),n);return a}var P=i(11509),L=i(18382);function E(e,t){const i=e.toJSON();return i.objectIds&&(i.objectIds=i.objectIds.join(",")),i.orderByFields&&(i.orderByFields=i.orderByFields.join(",")),!i.outFields||null!=t&&t.returnCountOnly?delete i.outFields:-1!==i.outFields.indexOf("*")?i.outFields="*":i.outFields=i.outFields.join(","),i.outSpatialReference&&(i.outSR=i.outSR.wkid||JSON.stringify(i.outSR.toJSON()),delete i.outSpatialReference),i.dynamicDataSource&&(i.layer=JSON.stringify({source:i.dynamicDataSource}),delete i.dynamicDataSource),i}async function A(e,t,i={},s){const n=(0,L.A)({...e.query,f:"json",...s,...E(t,s)});return(0,P.default)(e.path+"/queryRelatedRecords",{...i,query:{...i.query,...n}})}async function F(e,t,i){t=d.Z.from(t);return async function(e,t,i){const s=await A(e,t,i),n=s.data,r=n.geometryType,o=n.spatialReference,a={};for(const l of n.relatedRecordGroups){const e={fields:void 0,objectIdFieldName:void 0,geometryType:r,spatialReference:o,hasZ:!!n.hasZ,hasM:!!n.hasM,features:l.relatedRecords};if(null!=l.objectId)a[l.objectId]=e;else for(const t in l)l.hasOwnProperty(t)&&"relatedRecords"!==t&&(a[l[t]]=e)}return{...s,data:a}}((0,p.en)(e),t,i).then((e=>{const t=e.data,i={};return Object.keys(t).forEach((e=>i[e]=l.default.fromJSON(t[e]))),i}))}async function V(e,t,i){t=d.Z.from(t);return async function(e,t,i){const s=await A(e,t,i,{returnCountOnly:!0}),n=s.data,r={};for(const o of n.relatedRecordGroups)null!=o.objectId&&(r[o.objectId]=o.count);return{...s,data:r}}((0,p.en)(e),t,{...i}).then((e=>e.data))}var O=i(42964);let R=class extends O.Z{constructor(e){super(e),this.dynamicDataSource=null,this.format="json",this.gdbVersion=null,this.sourceSpatialReference=null}execute(e,t){return this.executeJSON(e,t).then((e=>l.default.fromJSON(e)))}async executeJSON(e,t){var i;const s={...this.requestOptions,...t},r=this._normalizeQuery(e),o=null!=(null==(i=e.outStatistics)?void 0:i[0]),a=(0,n.Z)("featurelayer-pbf-statistics"),l=!o||a;let c;if("pbf"===this.format&&l)try{c=await S(this.url,r,s)}catch(h){if("query:parsing-pbf"!==h.name)throw h;this.format="json"}return"json"!==this.format&&l||(c=await y(this.url,r,s)),this._normalizeFields(c.fields),c}executeForCount(e,t){const i={...this.requestOptions,...t},s=this._normalizeQuery(e);return async function(e,t,i){const s=(0,p.en)(e);return(0,f.executeQueryForCount)(s,h.Z.from(t),{...i}).then((e=>e.data.count))}(this.url,s,i)}executeForExtent(e,t){const i={...this.requestOptions,...t},s=this._normalizeQuery(e);return async function(e,t,i){const s=(0,p.en)(e);return(0,f.executeQueryForExtent)(s,h.Z.from(t),{...i}).then((e=>({count:e.data.count,extent:g.Z.fromJSON(e.data.extent)})))}(this.url,s,i)}executeForIds(e,t){const i={...this.requestOptions,...t},s=this._normalizeQuery(e);return async function(e,t,i){const s=(0,p.en)(e);return(0,f.executeQueryForIds)(s,h.Z.from(t),{...i}).then((e=>e.data.objectIds))}(this.url,s,i)}executeRelationshipQuery(e,t){e=d.Z.from(e);const i={...this.requestOptions,...t};return(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),F(this.url,e,i)}executeRelationshipQueryForCount(e,t){e=d.Z.from(e);const i={...this.requestOptions,...t};return(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),V(this.url,e,i)}executeAttachmentQuery(e,t){const i={...this.requestOptions,...t};return async function(e,t,i){const s=(0,p.en)(e);return(0,m.X)(s,u.Z.from(t),{...i}).then((e=>(0,m.O)(e.data.attachmentGroups,s.path)))}(this.url,e,i)}_normalizeQuery(e){const t=h.Z.from(e);if(t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,!this.gdbVersion&&!this.dynamicDataSource)return t;const i=t===e?t.clone():t;return i.gdbVersion=e.gdbVersion||this.gdbVersion,i.dynamicDataSource=e.dynamicDataSource?c.n.from(e.dynamicDataSource):this.dynamicDataSource,i}_normalizeFields(e){if((0,r.pC)(this.fieldsIndex)&&(0,r.pC)(e))for(const t of e){const e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}};(0,s._)([(0,o.Cb)({type:c.n})],R.prototype,"dynamicDataSource",void 0),(0,s._)([(0,o.Cb)()],R.prototype,"fieldsIndex",void 0),(0,s._)([(0,o.Cb)()],R.prototype,"format",void 0),(0,s._)([(0,o.Cb)()],R.prototype,"gdbVersion",void 0),(0,s._)([(0,o.Cb)()],R.prototype,"sourceSpatialReference",void 0),R=(0,s._)([(0,a.j)("esri.tasks.QueryTask")],R);var D=R},45479:function(e,t,i){i.d(t,{T:function(){return s}});class s{constructor(){this._names=new Map}begin(e){this._names.has(e)||(this._names.set(e,!1),(e=>-1!==e.indexOf("Brush"))(e)&&this.record("Esri.FirstDraw"),performance.mark(`Esri.${e}.Start`))}end(e){this._names.has(e)&&!this._names.get(e)&&(this._names.set(e,!0),performance.mark(`Esri.${e}.End`))}record(e){this._names.has(e)||(this._names.set(e,!0),performance.mark(`Esri.${e}`))}}},88782:function(e,t,i){var s=i(34596);
1class n{constructor(){this.spans=[]}acquire(e){this.lodInfo=e}release(){this.lodInfo=null,this.spans.length=0}forEach(e,t){const{spans:i,lodInfo:s}=this,{level:n}=s;if(0!==i.length)for(const{row:r,colFrom:o,colTo:a}of i)for(let i=o;i<=a;i++)e.call(t,n,r,s.normalizeCol(i),s.getWorldForColumn(i))}}n.pool=new s.Z(n),t.Z=n},63941:function(e,t,i){i.d(t,{Z:function(){return f}});var s=i(35925),n=i(87241);function r(e,t){return[e,t]}function o(e,t,i){return e[0]=t,e[1]=i,e}const a=new n.Z("0/0/0/0");class l{constructor(e,t,i,s,n,r,o,a,l,c,h,d){this.level=e,this.resolution=t,this.scale=i,this.origin=s,this.first=n,this.last=r,this.size=o,this.norm=a,this.worldStart=l,this.worldEnd=c,this.worldSize=h,this.wrap=d}static create(e,t,i){const n=(0,s.C5)(e.spatialReference),a=r(e.origin.x,e.origin.y),c=r(e.size[0]*t.resolution,e.size[1]*t.resolution),h=r(-1/0,-1/0),d=r(1/0,1/0),u=r(1/0,1/0);let p,m,f,g;return i&&(o(h,Math.max(0,Math.floor((i.xmin-a[0])/c[0])),Math.max(0,Math.floor((a[1]-i.ymax)/c[1]))),o(d,Math.max(0,Math.floor((i.xmax-a[0])/c[0])),Math.max(0,Math.floor((a[1]-i.ymin)/c[1]))),o(u,d[0]-h[0]+1,d[1]-h[1]+1)),e.isWrappable?(p=r(Math.ceil(Math.round((n.valid[1]-n.valid[0])/t.resolution)/e.size[0]),u[1]),m=r(Math.floor((n.origin[0]-a[0])/c[0]),h[1]),f=r(p[0]+m[0]-1,d[1]),g=!0):(m=h,f=d,p=u,g=!1),new l(t.level,t.resolution,t.scale,a,h,d,u,c,m,f,p,g)}normalizeCol(e){if(!this.wrap)return e;const t=this.worldSize[0];return e<0?t-1-Math.abs((e+1)%t):e%t}denormalizeCol(e,t){return this.wrap?this.worldSize[0]*t+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){return this.origin[0]+e*this.norm[0]}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,t,i=!1){a.set(t);const s=i?a.col:this.denormalizeCol(a.col,a.world),n=a.row;return function(e,t,i,s,n){e[0]=t,e[1]=i,e[2]=s,e[3]=n}(e,this.getXForColumn(s),this.getYForRow(n+1),this.getXForColumn(s+1),this.getYForRow(n)),e}getTileCoords(e,t,i=!1){a.set(t);const s=i?a.col:this.denormalizeCol(a.col,a.world);return Array.isArray(e)?o(e,this.getXForColumn(s),this.getYForRow(a.row)):(e.x=this.getXForColumn(s),e.y=this.getYForRow(a.row)),e}}var c=l,h=i(88782);var d=class{constructor(e,t,i){this.row=e,this.colFrom=t,this.colTo=i}};const u=new n.Z("0/0/0/0");class p{constructor(e,t,i,s,n,r,o,a){this.x=e,this.ymin=t,this.ymax=i,this.invM=s,this.leftAdjust=n,this.rightAdjust=r,this.leftBound=o,this.rightBound=a}static create(e,t){e[1]>t[1]&&([e,t]=[t,e]);const[i,s]=e,[n,r]=t,o=n-i,a=r-s,l=0!==a?o/a:0,c=(Math.ceil(s)-s)*l,h=(Math.floor(s)-s)*l;return new p(i,Math.floor(s),Math.ceil(r),l,o<0?c:h,o<0?h:c,o<0?n:i,o<0?i:n)}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}}const m=[[0,0],[0,0],[0,0],[0,0]];var f=class{constructor(e,t){this.tileInfo=e,this.fullExtent=t,this.scales=[],this._lodInfos=null,this._infoByScale={},this._infoByLevel={};const i=e.lods.slice();i.sort((function(e,t){return t.scale-e.scale}));const s=this._lodInfos=i.map((i=>c.create(e,i,t)));i.forEach(((e,t)=>{this._infoByLevel[e.level]=s[t],this._infoByScale[e.scale]=s[t],this.scales[t]=e.scale}),this),this._wrap=e.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(e){return this._infoByLevel["number"==typeof e?e:e.level]}getTileBounds(e,t,i=!1){u.set(t);const s=this._infoByLevel[u.level];return s?s.getTileBounds(e,u,i):e}getTileCoords(e,t,i=!1){u.set(t);const s=this._infoByLevel[u.level];return s?s.getTileCoords(e,u,i):e}getTileCoverage(e,t=192,i="closest"){const s="closest"===i?this.getClosestInfoForScale(e.scale):this.getSmallestInfoForScale(e.scale),n=h.Z.pool.acquire(s),r=this._wrap;let o,a,l,c=1/0,u=-1/0;const f=n.spans;m[0][0]=m[0][1]=m[1][1]=m[3][0]=-t,m[1][0]=m[2][0]=e.size[0]+t,m[2][1]=m[3][1]=e.size[1]+t;for(const h of m)e.toMap(h,h),h[0]=s.getColumnForX(h[0]),h[1]=s.getRowForY(h[1]);const g=[];let y=3;for(let h=0;h<4;h++){if(m[h][1]===m[y][1]){y=h;continue}const e=p.create(m[h],m[y]);c=Math.min(e.ymin,c),u=Math.max(e.ymax,u),void 0===g[e.ymin]&&(g[e.ymin]=[]),g[e.ymin].push(e),y=h}if(null==c||null==u||u-c>100)return null;let v=[];for(o=c;o<u;){null!=g[o]&&(v=v.concat(g[o])),a=1/0,l=-1/0;for(let e=v.length-1;e>=0;e--){const t=v[e];a=Math.min(a,t.getLeftCol()),l=Math.max(l,t.getRightCol())}if(a=Math.floor(a),l=Math.floor(l),o>=s.first[1]&&o<=s.last[1])if(r)if(s.size[0]<s.worldSize[0]){const e=Math.floor(l/s.worldSize[0]);for(let t=Math.floor(a/s.worldSize[0]);t<=e;t++)f.push(new d(o,Math.max(s.getFirstColumnForWorld(t),a),Math.min(s.getLastColumnForWorld(t),l)))}else f.push(new d(o,a,l));else a>s.last[0]||l<s.first[0]||(a=Math.max(a,s.first[0]),l=Math.min(l,s.last[0]),f.push(new d(o,a,l)));o+=1;for(let e=v.length-1;e>=0;e--){const t=v[e];t.ymax>=o?t.incrRow():v.splice(e,1)}}return n}getTileParentId(e){u.set(e);const t=this._infoByLevel[u.level],i=this._lodInfos.indexOf(t)-1;return i<0?null:(this._getTileIdAtLOD(u,this._lodInfos[i],u),u.id)}getTileResolution(e){const t=this._infoByLevel["object"==typeof e?e.level:e];return t?t.resolution:-1}getTileScale(e){const t=this._infoByLevel[e.level];return t?t.scale:-1}intersects(e,t){u.set(t);const i=this._infoByLevel[u.level],s=e.lodInfo;if(s.resolution>i.resolution){this._getTileIdAtLOD(u,s,u);const t=s.denormalizeCol(u.col,u.world);for(const i of e.spans)if(i.row===u.row&&i.colFrom<=t&&i.colTo>=t)return!0}if(s.resolution<i.resolution){const[t,n,r,o]=e.spans.reduce(((e,t)=>(e[0]=Math.min(e[0],t.row),e[1]=Math.max(e[1],t.row),e[2]=Math.min(e[2],t.colFrom),e[3]=Math.max(e[3],t.colTo),e)),[1/0,-1/0,1/0,-1/0]),a=i.denormalizeCol(u.col,u.world),l=s.getColumnForX(i.getXForColumn(a)),c=s.getRowForY(i.getYForRow(u.row)),h=s.getColumnForX(i.getXForColumn(a+1))-1,d=s.getRowForY(i.getYForRow(u.row+1))-1;return!(l>o||h<r||c>n||d<t)}const n=s.denormalizeCol(u.col,u.world);return e.spans.some((e=>e.row===u.row&&e.colFrom<=n&&e.colTo>=n))}normalizeBounds(e,t,i){if(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this._wrap){const t=(0,s.C5)(this.tileInfo.spatialReference),n=-i*(t.valid[1]-t.valid[0]);e[0]+=n,e[2]+=n}return e}getSmallestInfoForScale(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e];if(e>t[0])return this._infoByScale[t[0]];for(let i=1;i<t.length-1;i++)if(e>t[i]+1e-6)return this._infoByScale[t[i-1]];return this._infoByScale[t[t.length-1]]}getClosestInfoForScale(e){const t=this.scales;return this._infoByScale[e]||(e=t.reduce(((t,i)=>Math.abs(i-e)<Math.abs(t-e)?i:t),t[0])),this._infoByScale[e]}scaleToLevel(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e].level;for(let i=t.length-1;i>=0;i--)if(e<t[i])return i===t.length-1?this._infoByScale[t[t.length-1]].level:this._infoByScale[t[i]].level+(t[i]-e)/(t[i]-t[i+1]);return this._infoByScale[t[0]].level}scaleToZoom(e){return this.tileInfo.scaleToZoom(e)}_getTileIdAtLOD(e,t,i){const s=this._infoByLevel[i.level];return e.set(i),t.resolution<s.resolution?null:(t.resolution===s.resolution||(e.level=t.level,e.col=Math.floor(i.col*s.resolution/t.resolution+.01),e.row=Math.floor(i.row*s.resolution/t.resolution+.01)),e)}}},87241:function(e,t,i){var s=i(34596);
1class n{constructor(e,t,i,s){this.set(e,t,i,s)}static getId(e,t,i,s){return"object"==typeof e?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${i}/${s}`}get key(){return this}get id(){return this.toString()}set id(e){this.set(e)}acquire(e,t,i,s){this.set(e,t,i,s)}contains(e){const t=e.level-this.level;return this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new n(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,i,s){if(null==e)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof e)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if("string"==typeof e){const[t,i,s,n]=e.split("/");this.level=parseFloat(t),this.row=parseFloat(i),this.col=parseFloat(s),this.world=parseFloat(n)}else this.level=+e,this.row=+t,this.col=+i,this.world=+s||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new n(this.level-1,this.row>>1,this.col>>1,this.world)}getChildKeys(){const e=this.level+1,t=this.row<<1,i=this.col<<1,s=this.world;return[new n(e,t,i,s),new n(e,t,i+1,s),new n(e,t+1,i,s),new n(e,t+1,i+1,s)]}compareRowMajor(e){return this.row<e.row?-1:this.row>e.row?1:this.col<e.col?-1:this.col>e.col?1:0}}n.pool=new s.Z(n,null,null,25,50),t.Z=n},50590:function(e,t,i){function s(e,t,i,s){const n=3*e,r=3*(i-e)-n,o=1-n-r,a=3*t,l=3*(s-t)-a,c=1-a-l;function h(e){return((o*e+r)*e+n)*e}function d(e){return(3*o*e+2*r)*e+n}return function(e,t=1e-6){return function(e){return((c*e+l)*e+a)*e}(function(e,t){let i,s,n,r,o,a;for(n=e,a=0;a<8;a++){if(r=h(n)-e,Math.abs(r)<t)return n;if(o=d(n),Math.abs(o)<1e-6)break;n-=r/o}if(i=0,s=1,n=e,n<i)return i;if(n>s)return s;for(;i<s;){if(r=h(n),Math.abs(r-e)<t)return n;e>r?i=n:s=n,n=.5*(s-i)+i}return n}(e,t))}}i.d(t,{LI:function(){return r},Qc:function(){return o},n_:function(){return s}});const n=/^cubic-bezier\((.*)\)/,r={};function o(e){let t=r[e]||null;if(!t){const i=n.exec(e);if(i){const e=i[1].split(",").map((e=>parseFloat(e.trim())));4!==e.length||e.some((e=>isNaN(e)))||(t=s.apply(s,e))}}return t}r.ease=s(.25,.1,.25,1),r.linear=s(0,0,1,1),r.easeIn=r["ease-in"]=s(.42,0,1,1),r.easeOut=r["ease-out"]=s(0,0,.58,1),r.easeInOut=r["ease-in-out"]=s(.42,0,.58,1)},69050:function(e,t,i){i.d(t,{H4:function(){return G},dI:function(){return B},o2:function(){return W},JG:function(){return S},km:function(){return z},EK:function(){return T},ni:function(){return P},bk:function(){return L},Rb:function(){return R},Dq:function(){return A},uG:function(){return V},Ck:function(){return D},Jp:function(){return j},L2:function(){return N},ut:function(){return Z},gG:function(){return X},SI:function(){return U},$H:function(){return H},YQ:function(){return q},UZ:function(){return Y},Hy:function(){return K},qf:function(){return E},Rx:function(){return ee}});var s=i(61681),n=i(35925),r=i(14685),o=i(20031),a=i(14260),l=i(39536),c=i(86566),h=i(91772),d=i(18302),u=i(93011),p=i(88346),m=i(17321),f=i(69666),g=i(55709),y=i(40278),v=i(69114);const _=39.37,b=180/Math.PI;function w(e,t,i,s){return s&&i&&!s.equals(i)&&(0,l.Q8)(s,i)&&s.isWebMercator?s.isWebMercator?function(e,t){let i=t[1];return i>89.99999?i=89.99999:i<-89.99999&&(i=-89.99999),i=Math.sin((0,u.t)(i)),(0,g.s)(e,(0,u.t)(t[0])*a.sv.radius,.5*a.sv.radius*Math.log((1+i)/(1-i)))}(e,t):function(e,t,i){const s=(0,u.a)(t[0]/a.sv.radius);return(0,g.s)(e,i?s:s-360*Math.floor((s+180)/360),(0,u.a)(.5*Math.PI-2*Math.atan(Math.exp(-1*t[1]/a.sv.radius))))}(e,t):(0,g.c)(e,t)}function C(e){return e.wkid?e:e.spatialReference||r.Z.WGS84}function M(e,t){return t.type?(0,g.s)(e,t.x,t.y):(0,g.c)(e,t)}function I(e){return(0,m.c9)(e)}function T(e,t){return Math.max(e.width/t[0],e.height/t[1])*function(e){return(0,n.JY)(e)?I(e)*_*96:1}(e.spatialReference)}async function x(e,t,i,n){let r,a;if(!e)return null;if(Array.isArray(e)&&!e.length)return null;if(d.Z.isCollection(e)&&(e=e.toArray()),Array.isArray(e)&&e.length&&"object"==typeof e[0]){const r=e.every((e=>"attributes"in e)),o=e.some((e=>!e.geometry));let a=e;if(r&&o&&t&&t.allLayerViews){const i=new Map;for(const t of e){const e=t.layer,s=i.get(e)||[],n=t.attributes[e.objectIdField];null!=n&&s.push(n),i.set(e,s)}const n=[];
1i.forEach(((e,i)=>{const s=t.allLayerViews.find((e=>e.layer.id===i.id));if("queryFeatures"in s){const t=i.createQuery();t.objectIds=e,t.returnGeometry=!0,n.push(s.queryFeatures(t))}}));const r=await Promise.all(n),o=[];for(const e of r)if(e&&e.features&&e.features.length)for(const t of e.features)(0,s.pC)(t.geometry)&&o.push(t.geometry);a=o}for(const e of a)n=await x(e,t,i,n);return n}if(Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1])r=new c.Z(e);else if(e instanceof o.Z)r=e;else if("geometry"in e)if(e.geometry)r=e.geometry;else if(e.layer){const i=e.layer,n=t.allLayerViews.find((e=>e.layer.id===i.id));if("queryFeatures"in n){const t=i.createQuery();t.objectIds=[e.attributes[i.objectIdField]],t.returnGeometry=!0;const o=await n.queryFeatures(t);r=(0,s.U2)(o,"features",0,"geometry")}}if((0,s.Wi)(r))return null;if(a="point"===r.type?new h.Z({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y,spatialReference:r.spatialReference}):r.extent,!a)return null;const u=(0,l.Q8)(a,i);if(!a.spatialReference.equals(i)&&u)a=(0,l.iV)(a,i);else if(!u)return null;return n?n.union(a):a.clone()}async function k(e,t){if(!e||!t)return new p.Z({targetGeometry:new c.Z,scale:0,rotation:0});let i=t.spatialReference;const{constraints:n,padding:r,viewpoint:o,size:a}=t,d=[r?a[0]-r.left-r.right:a[0],r?a[1]-r.top-r.bottom:a[1]];let u=null;e instanceof p.Z?u=e:e.viewpoint?u=e.viewpoint:e.target&&"esri.Viewpoint"===e.target.declaredClass&&(u=e.target);let m=null;u&&u.targetGeometry?m=u.targetGeometry:e instanceof h.Z?m=e:(e||e&&("center"in e||"extent"in e||"target"in e))&&(m=await x(e.center,t,i)||await x(e.extent,t,i)||await x(e.target,t,i)||await x(e,t,i)),!m&&o&&o.targetGeometry?m=o.targetGeometry:!m&&t.extent&&(m=t.extent);const g=C(m);if(i||(i=C(t.spatialReference||t.extent||m)),!(0,l.Q8)(m,i)&&g&&!g.equals(i))return null;const y=M((0,f.a)(),m.center?m.center:m),v=new c.Z(w(y,y,g,i),i);let _=null;_=u&&(0,s.pC)(u.targetGeometry)&&"point"===u.targetGeometry.type?u.scale:e.hasOwnProperty("scale")&&e.scale?e.scale:e.hasOwnProperty("zoom")&&-1!==e.zoom&&n&&n.effectiveLODs?n.zoomToScale(e.zoom):Array.isArray(m)||"point"===m.type||"extent"===m.type&&0===m.width&&0===m.height?t.extent&&(0,l.Q8)(t.extent,i)?T((0,l.iV)(t.extent,i),d):t.extent?T(t.extent,d):o.scale:(0,l.Q8)(m.extent,i)?T((0,l.iV)(m.extent,i),d):T(m.extent,d);const b=function(e){if(e&&(!Array.isArray(e)||"number"!=typeof e[0])&&("object"==typeof e||Array.isArray(e)&&"object"==typeof e[0])){if("layer"in e&&e.layer&&e.layer.minScale&&e.layer.maxScale){const t=e.layer;return{min:t.minScale,max:t.maxScale}}if(Array.isArray(e)&&e.length&&e.every((e=>"layer"in e))){let t=0,i=0;for(const s of e){const e=s.layer;e&&e.minScale&&e.maxScale&&(t=e.minScale<t?e.minScale:t,i=e.maxScale>i?e.maxScale:i)}return t&&i?{min:t,max:i}:null}}}(e);b&&(b.min&&b.min>_?_=b.min:b.max&&b.max<_&&(_=b.max));let I=0;u?I=u.rotation:e.hasOwnProperty("rotation")?I=e.rotation:o&&(I=o.rotation);let k=new p.Z({targetGeometry:v,scale:_,rotation:I});return n&&(k=n.fit(k),n.constrainByGeometry(k),n.rotationEnabled||(k.rotation=I)),k}function S(e,t){const i=e.targetGeometry,s=t.targetGeometry;return i.x=s.x,i.y=s.y,i.spatialReference=s.spatialReference,e.scale=t.scale,e.rotation=t.rotation,e}function P(e,t,i){return i?(0,g.s)(e,.5*(t[0]-i.right+i.left),.5*(t[1]-i.bottom+i.top)):(0,g.a)(e,t,.5)}const L=function(){const e=(0,f.a)();return function(t,i,s){const n=i.targetGeometry;M(e,n);const r=.5*V(i);return t.xmin=e[0]-r*s[0],t.ymin=e[1]-r*s[1],t.xmax=e[0]+r*s[0],t.ymax=e[1]+r*s[1],t.spatialReference=n.spatialReference,t}}();function E(e,t,i,s,n){return W(e,t,i.center),e.scale=T(i,s),n&&n.constraints&&n.constraints.constrain(e),e}const A=function(){const e=(0,f.a)();return function(t,i,s){return(0,g.b)(t,function(e,t){return(0,g.a)(e,t,.5)}(t,i),P(e,i,s))}}(),F=function(){const e=(0,v.c)(),t=(0,f.a)();return function(i,s,n,r){const o=V(s),a=O(s);return(0,g.s)(t,o,o),(0,y.f)(e,t),(0,y.r)(e,e,a),(0,y.t)(e,e,A(t,n,r)),(0,y.t)(e,e,[0,r.top-r.bottom]),(0,g.s)(i,e[4],e[5])}}();function V(e){return e.scale*function(e){return(0,s.pC)(e)&&(0,n.JY)(e.spatialReference)?1/(I(e.spatialReference)*_*96):1}(e.targetGeometry)}function O(e){return(0,u.t)(e.rotation)||0}const R=function(){const e=(0,f.a)(),t=(0,f.a)(),i=(0,f.a)();return function(s,n,r,o,a,l){return(0,g.n)(e,n),(0,g.a)(t,r,.5*l),(0,g.s)(i,1/o*l,-1/o*l),(0,y.i)(s),(0,y.t)(s,s,t),a&&(0,y.r)(s,s,a),(0,y.s)(s,s,i),(0,y.t)(s,s,e),s}}(),D=function(){const e=(0,f.a)();return function(t,i,s,n){const r=V(i),o=O(i);return M(e,i.targetGeometry),R(t,e,s,r,o,n)}}(),j=function(){const e=(0,f.a)();return function(t,i,s,n){const r=V(i);return M(e,i.targetGeometry),R(t,e,s,r,0,n)}}();function Z(e){if(e.isWrappable){const t=(0,n.C5)(e);return t.valid[1]-t.valid[0]}return 0}function N(e,t){return Math.round(Z(e)/t)}function z(e,t){return k(e,t)}const B=function(){const e=(0,f.a)(),t=(0,f.a)(),i=[0,0,0];return function(s,n,r){(0,g.d)(e,s,n),(0,g.e)(e,e),(0,g.d)(t,s,r),(0,g.e)(t,t),(0,g.f)(i,e,t);let o=Math.acos((0,g.g)(e,t)/((0,g.l)(e)*(0,g.l)(t)))*b;return i[2]<0&&(o=-o),isNaN(o)&&(o=0),o}}(),G=function(){const e=(0,f.a)();return function(t,i,s,n){const r=t.targetGeometry;return S(t,i),F(e,i,s,n),r.x+=e[0],r.y+=e[1],t}}(),W=(function(){const e=(0,f.a)()}(),function(){const e=(0,f.a)();return function(t,i,s){S(t,i);const n=t.targetGeometry,r=C(s),o=C(n);return M(e,s),w(e,e,r,o),n.x=e[0],n.y=e[1],t}}());const U=function(){const e=(0,f.a)();return function(t,i,s,n,r){r||(r="center"),(0,g.b)(e,s,n),(0,g.a)(e,e,.5);const o=e[0],a=e[1];switch(r){case"center":(0,g.s)(e,0,0);break;case"left":(0,g.s)(e,-o,0);break;case"top":(0,g.s)(e,0,a);break;case"right":(0,g.s)(e,o,0);break;case"bottom":(0,g.s)(e,0,-a);break;case"top-left":(0,g.s)(e,-o,a);break;case"bottom-left":(0,g.s)(e,-o,-a);break;case"top-right":(0,g.s)(e,o,a);break;case"bottom-right":(0,g.s)(e,o,-a)}return ee(t,i,e),t}}();function H(e,t,i){return S(e,t),e.rotation+=i,e}function q(e,t,i){return S(e,t),e.rotation=i,e}const $=function(){const e=(0,f.a)();return function(t,i,s,n,r){return S(t,i),isNaN(s)||0===s||(Q(e,n,i,r),t.scale=i.scale*s,J(e,e,t,r),ee(t,t,(0,g.s)(e,e[0]-n[0],n[1]-e[1]))),t}}();function K(e,t,i){return S(e,t),e.scale=i,e}const Y=function(){const e=(0,f.a)();return function(t,i,s,n,r,o){return S(t,i),isNaN(s)||0===s||(Q(e,r,i,o),t.scale=i.scale*s,t.rotation+=n,J(e,e,t,o),ee(t,t,(0,g.s)(e,e[0]-r[0],r[1]-e[1]))),t}}(),X=function(){const e=(0,f.a)(),t=(0,f.a)();return function(i,s,n,r,o,a,l){return A(t,a,l),(0,g.h)(e,o,t),r?Y(i,s,n,r,e,a):$(i,s,n,e,a)}}(),Q=function(){const e=(0,v.c)();return function(t,i,s,n){return(0,g.t)(t,i,function(e,t,i,s){return D(e,t,i,s),(0,y.a)(e,e)}(e,s,n,1))}}(),J=function(){const e=(0,v.c)();return function(t,i,s,n){return(0,g.t)(t,i,D(e,s,n,1))}}(),ee=function(){const e=(0,f.a)(),t=(0,v.c)();return function(i,s,n){S(i,s);const r=V(s),o=i.targetGeometry;return(0,y.b)(t,O(s)),(0,y.s)(t,t,(0,f.f)(r,r)),(0,g.t)(e,n,t),o.x+=e[0],o.y+=e[1],i}}()}
1,35369:function(e,t,i){i.d(t,{jE:function(){return o},LU:function(){return h},tB:function(){return a}});var s=i(19431),n=i(8909),r=i(6766);function o(e,t){const i=(0,r.l)(e),n=(0,s.Kt)(e[2]/i),o=Math.atan2(e[1]/i,e[0]/i);return(0,r.s)(t,i,n,o),t}function a(e,t,i){const s=i[0]-t[0],n=i[1]-t[1],r=i[2]-t[2];let o=s*s+n*n+r*r;return o?(o=1/Math.sqrt(o),e[0]=s*o,e[1]=n*o,e[2]=r*o,e):(e[0]=0,e[1]=0,e[2]=0,e)}class l{constructor(e,t){this.min=e,this.max=t,this.range=t-e}ndiff(e,t=0){return Math.ceil((e-t)/this.range)*this.range+t}_normalize(e,t,i,s=0,n=!1){return(i-=s)<e?i+=this.ndiff(e-i):i>t&&(i-=this.ndiff(i-t)),n&&i===t&&(i=e),i+s}normalize(e,t=0,i=!1){return this._normalize(this.min,this.max,e,t,i)}clamp(e,t=0){return(0,s.uZ)(e-t,this.min,this.max)+t}monotonic(e,t,i){return e<t?t:t+this.ndiff(e-t,i)}minimalMonotonic(e,t,i){return this._normalize(e,e+this.range,t,i)}center(e,t,i){return t=this.monotonic(e,t,i),this.normalize((e+t)/2,i)}diff(e,t,i){return this.monotonic(e,t,i)-e}shortestSignedDiff(e,t){e=this.normalize(e);const i=(t=this.normalize(t))-e,s=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(i)<Math.abs(s)?i:s}contains(e,t,i){return t=this.minimalMonotonic(e,t),(i=this.minimalMonotonic(e,i))>e&&i<t}}(0,n.c)(),(0,n.c)();function c(e){for(const t in e){const i=e[t];i instanceof Function&&(e[t]=i.bind(e))}return e}c(new l(0,2*Math.PI)),c(new l(-Math.PI,Math.PI));const h=c(new l(0,360));(0,n.c)(),(0,n.c)(),(0,n.c)()},79984:function(e,t,i){i.d(t,{Z:function(){return Ed}});var s,n=i(36663),r=i(39994),o=i(61681),a=i(13802),l=(i(7283),i(81977)),c=i(66645),h=i(70375),d=(i(3466),i(12173),i(51876),i(18302)),u=i(80085),p=i(81739),m=i(15071),f=i(67134),g=i(49004),y=i(30936);let v=s=class extends g.wq{constructor(e){super(e),this.color=new y.Z([0,0,0,1])}clone(){return new s((0,f.d9)({color:this.color}))}};(0,n._)([(0,l.Cb)({type:y.Z,json:{write:!0}})],v.prototype,"color",void 0),v=s=(0,n._)([(0,c.j)("esri.webmap.background.ColorBackground")],v);var _=v,b=i(15249),w=i(994),C=i(50904),M=i(44584);const I={widthBreakpoint:{getValue(e){const t=e.viewSize[0],i=e.breakpoints,s=this.values;return t<=i.xsmall?s.xsmall:t<=i.small?s.small:t<=i.medium?s.medium:t<=i.large?s.large:s.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(e){const t=e.viewSize[1],i=e.breakpoints,s=this.values;return t<=i.xsmall?s.xsmall:t<=i.small?s.small:t<=i.medium?s.medium:t<=i.large?s.large:s.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(e){const t=e.viewSize,i=t[0],s=t[1],n=this.values;return s>=i?n.portrait:n.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},T={xsmall:544,small:768,medium:992,large:1200};function x(e,t){return t?I[e].valueToClassName[t].split(" "):[]}const k=e=>{let t=class extends e{constructor(...e){super(...e),this._breakpointsHandles=new M.Z,this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=T}initialize(){this._breakpointsHandles.add((0,m.S1)(this,["breakpoints","size"],this._updateClassNames))}destroy(){this.destroyed||(this._removeActiveClassNames(),this._breakpointsHandles.destroy(),this._breakpointsHandles=null)}set breakpoints(e){if(e===this._get("breakpoints"))return;const t=function(e){const t=e;return t&&t.xsmall<t.small&&t.small<t.medium&&t.medium<t.large}(e);if(!t){const e=JSON.stringify(T,null,2);console.warn("provided breakpoints are not valid, using defaults:"+e)}e=t?e:T,this._set("breakpoints",{...e})}_updateClassNames(){if(!this.container)return;const e=C.Z.acquire(),t=C.Z.acquire();let i,s=!1;for(i in I){const n=this[i],r=I[i].getValue({viewSize:this.size,breakpoints:this.breakpoints});
1n!==r&&(s=!0,this[i]=r,x(i,n).forEach((e=>t.push(e))),x(i,r).forEach((t=>e.push(t))))}s&&(this._applyClassNameChanges(e,t),C.Z.release(e),C.Z.release(t))}_applyClassNameChanges(e,t){const i=this.container;i&&(t.forEach((e=>i.classList.remove(e))),e.forEach((e=>i.classList.add(e))))}_removeActiveClassNames(){const e=this.container;if(!e)return;let t;for(t in I)x(t,this[t]).forEach((t=>e.classList.remove(t)))}};return(0,n._)([(0,l.Cb)()],t.prototype,"breakpoints",null),(0,n._)([(0,l.Cb)()],t.prototype,"orientation",void 0),(0,n._)([(0,l.Cb)()],t.prototype,"widthBreakpoint",void 0),(0,n._)([(0,l.Cb)()],t.prototype,"heightBreakpoint",void 0),t=(0,n._)([(0,c.j)("esri.views.BreakpointsOwner")],t),t};var S=i(17262),P=i(59183),L=i(36900),E=i(73216),A=(i(56803),i(96017));let F=class extends L.Z{constructor(){super(...arguments),this.items=new d.Z,this._watchUpdatingTracking=new E.t,this._callbacks=new Map,this._projector=(0,A.E)(),this._hiddenProjector=(0,A.E)()}get needsRender(){return this.items.length>0}initialize(){const e=document.createElement("div");e.className="esri-overlay-surface",this._set("surface",e),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),e.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(this.items,(e=>{e.added.map((e=>{const t=()=>e.render();this._callbacks.set(e,t),this._projector.append(this.surface,t)})),e.removed.map((e=>{const t=this._projector.detach(this._callbacks.get(e));this.surface.removeChild(t.domNode),this._callbacks.delete(e)}))}))}addItem(e){this.items.add(e)}removeItem(e){this.items.remove(e)}destroy(){this.items.removeAll(),this._callbacks.forEach((e=>this._projector.detach(e))),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(e){const t=this._hiddenSurface,i=this._hiddenProjector;let s=null;const n=()=>(s=e.render(),s);i.append(t,n),i.renderNow();const r={left:0,top:0,right:0,bottom:0};if(s&&s.domNode){const e=s.domNode.getBoundingClientRect();r.left=e.left,r.top=e.top,r.right=e.right,r.bottom=e.bottom}for(i.detach(n);t.firstChild;)t.removeChild(t.firstChild);return r}overlaps(e,t){const i=this.computeBoundingRect(e),s=this.computeBoundingRect(t);return Math.max(i.left,s.left)<=Math.min(i.right,s.right)&&Math.max(i.top,s.top)<=Math.min(i.bottom,s.bottom)}get hasVisibleItems(){return this.items.some((e=>e.visible))}renderCanvas(e){if(!this.items.some((e=>e.visible)))return;const t=e.getContext("2d");t.save(),t.font=`10px ${getComputedStyle(this.surface).fontFamily}`,this.items.forEach((e=>{t.save(),e.renderCanvas(t),t.restore()})),t.restore()}};(0,n._)([(0,l.Cb)({readOnly:!0})],F.prototype,"surface",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],F.prototype,"items",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],F.prototype,"needsRender",null),(0,n._)([(0,l.Cb)({readOnly:!0})],F.prototype,"_watchUpdatingTracking",void 0),(0,n._)([(0,l.Cb)({readOnly:!0,aliasOf:"_watchUpdatingTracking.updating"})],F.prototype,"updating",void 0),F=(0,n._)([(0,c.j)("esri.views.overlay.ViewOverlay")],F);var V=F,O=i(42730),R=i(69236),D=i(59801),j=i(49546),Z=i(61547),N=(i(30538),i(618)),z=i(90079);function B(){return function(e,t){if(!e[t])throw new TypeError(`Cannot auto bind undefined function '${t}'`);return{value:G(e[t])}}}function G(e){return function(t,...i){!function(e){const{type:t}=e;return e instanceof KeyboardEvent||"keyup"===t||"keydown"===t||"keypress"===t}(t)?e.call(this,t,...i):"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),t.target.click())}}var W=i(34236);var U=i(38748),H=i(16792),q=i(44993);const $=e=>{let t=class extends e{constructor(){super(...arguments),this.renderNodeContent=e=>(0,q.Qd)(e)&&!e.destroyed?(0,U.j)("div",{key:e},e.render()):e instanceof HTMLElement?(0,U.j)("div",{key:e,bind:e,afterCreate:this._attachToNode}):(0,q.o)(e)?(0,U.j)("div",{key:e,bind:e.domNode,afterCreate:this._attachToNode}):null}_attachToNode(e){e.appendChild(this)}};return t=(0,n._)([(0,c.j)("esri.widgets.Feature.ContentMixin")],t),t};var K=i(21130),Y=i(25741),X=i(19431);i(17321);const Q=["B","kB","MB","GB","TB"];var J=i(14755),ee=i(72635),te=i(53280),ie=i(14845),se=i(72057),ne=i(10222);const re=a.Z.getLogger("esri.widgets.Feature.support.featureUtils"),oe=/href=(""|'')/gi,ae=/(\{([^\{\r\n]+)\})/g,le=/\'/g,ce=/^\s*expression\//i,he=/(\n)/gi,de=/[\u00A0-\u9999<>
1\&]/gim,ue=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/gi,pe=/^(?:mailto:|tel:)/,me="relationships/",fe=(0,se.Ze)("short-date-short-time");function ge(e){if(!(0,o.Wi)(e))return e.get("sourceLayer")||e.get("layer")}async function ye(e,t){return"function"==typeof e?e.call(null,t):e}function ve(e=""){if(e)return!pe.test(e.trim().toLowerCase())}function _e(e,t){if(!function(e){return ce.test(e)}(t)||!e)return null;const i=t.replace(ce,"").toLowerCase();let s;return e.some((e=>e.name.toLowerCase()===i&&(s=e,!0))),s}function be(e,t){const i=_e(t,null==e?void 0:e.fieldName);return i?i.title||null:e?e.label||e.fieldName:null}function we(e,t){const i=Ce(t,e);return i?i.name:e}function Ce(e,t){return e&&"function"==typeof e.getField?e.getField(t):null}function Me(e){return`${e}`.trim()}function Ie({attributes:e,globalAttributes:t,layer:i,text:s,fieldInfoMap:n}){return s?Te({formattedAttributes:t,template:Se(s,{...t,...e},i),fieldInfoMap:n}):""}function Te({formattedAttributes:e,template:t,fieldInfoMap:i}){return Me(function(e){return e.replace(oe,"")}((0,K.gx)((0,K.gx)(t,(e=>function(e,t){const i=t.get(e.toLowerCase());return`{${i&&i.fieldName||e}}`}(e,i))),e)))}function xe(e,t=!1){const i={...e};
1return Object.keys(i).forEach((e=>function(e,t,i=!1){const s=t[e];if("string"==typeof s){const n="%27",r=(i?encodeURIComponent(s):s).replace(le,n);t[e]=r}}(e,i,t))),i}function ke(e,t){return e.replace(ae,((e,i,s)=>{const n=Ce(t,s);return n?`{${n.name}}`:i}))}function Se(e,t,i){const s=ke(e,i);return s?s.replace(ue,((e,i,s)=>function(e,t,i){const s=(t=Me(t))&&"{"!==t[0];return(0,K.gx)(e,xe(i,s))}(e,i||s,t))):s}function Pe(e,t){const i=t.fieldInfos,s=t.fieldName,n=Le(i,s),r=null==n?void 0:n.clone(),o=t.preventPlacesFormatting,a=Ce(t.layer,s);if(r&&a&&"date"===a.type){const e=r.format||new ne.Z;e.dateFormat=e.dateFormat||"short-date-short-time",r.format=e}const l=r&&r.format;return"string"==typeof(e=function(e,t){if("string"==typeof e&&t&&null==t.dateFormat&&(null!=t.places||null!=t.digitSeparator)){const t=Number(e);if(!isNaN(t))return t}return e}(e,l))||null==e||null==l?e:o?(0,Y.uf)(e,{...(0,Y.sh)(l),minimumFractionDigits:0,maximumFractionDigits:20}):l.format(e)}function Le(e,t){if(!e||!e.length||!t)return;const i=t.toLowerCase();let s;return e.some((e=>!(!e.fieldName||e.fieldName.toLowerCase()!==i)&&(s=e,!0))),s}function Ee(e){const t=[];if(!e)return t;const{fieldInfos:i,content:s}=e;return i&&t.push(...i),s&&Array.isArray(s)?(s.forEach((e=>{if("fields"===e.type){const i=e&&e.fieldInfos;i&&t.push(...i)}})),t):t}function Ae(e){return e.replace(de,(e=>`&#${e.charCodeAt(0)};`))}function Fe(e){return"string"==typeof e?e.replace(he,'<br class="esri-text-new-line" />'):e}function Ve(e){const{value:t,fieldName:i,fieldInfos:s,fieldInfoMap:n,layer:r,graphic:o}=e;if(null==t)return"";const a=function({fieldName:e,value:t,graphic:i,layer:s}){if(De(e))return null;if(!s||"function"!=typeof s.getFieldDomain)return null;const n=s.getFieldDomain(e,{feature:i});return n&&"coded-value"===n.type?n.getName(t):null}({fieldName:i,value:t,graphic:o,layer:r});if(a)return a;const l=function({fieldName:e,graphic:t,layer:i}){if(De(e))return null;if(!i||"function"!=typeof i.getFeatureType)return null;const{typeIdField:s}=i;if(!s||e!==s)return null;const n=i.getFeatureType(t);return n?n.name:null}({fieldName:i,graphic:o,layer:r});if(l)return l;if(n.get(i.toLowerCase()))return Pe(t,{fieldInfos:s,fieldName:i,layer:r});const c=r&&r.fieldsIndex;return c&&c.isDateField(i)?(0,se.p6)(t,fe):Fe(t)}function Oe({fieldInfos:e,attributes:t,layer:i,graphic:s,fieldInfoMap:n,relatedInfos:r}){const o={...t};return null==r||r.forEach((e=>function(e,t){e&&t&&(t.relatedFeatures&&t.relatedFeatures&&t.relatedFeatures.forEach((i=>je({attributes:e,graphic:i,relatedInfo:t}))),t.relatedStatsFeatures&&t.relatedStatsFeatures&&t.relatedStatsFeatures.forEach((i=>je({attributes:e,graphic:i,relatedInfo:t}))))}(o,e))),Object.keys(o).forEach((t=>{const r=o[t];o[t]=Ve({fieldName:t,fieldInfos:e,fieldInfoMap:n,layer:i,value:r,graphic:s})})),o}async function Re({graphic:e,popupTemplate:t,layer:i,spatialReference:s},n){if(!i||!t)return;const{returnGeometry:r}=t;"function"==typeof i.load&&await i.load(n);const o=e.attributes[i.objectIdField];if(null==o)return;const a=[o],l=await t.getRequiredFields(i.fields),c=(0,ie.R9)(l,e),d=c?[]:l;if(c&&!r)return;const u=await async function(e,t){const{layer:i,graphic:s,outFields:n,objectIds:r,returnGeometry:o,spatialReference:a}=e,l=r[0];if("number"!=typeof l&&"string"!=typeof l){const e="Could not query required fields for the specified feature. The feature's ID is invali
1d.",t={layer:i,graphic:s,objectId:l,requiredFields:n},r=new h.Z("layer-query-features-invalid-objectid",e,t);throw re.warn(e,t),r}if("function"!=typeof i.queryFeatures){const e="The specified layer does not support the method 'queryFeatures'. The following fields will not be available.",t={layer:i,graphic:s,requiredFields:n},r=new h.Z("layer-query-features-unsupported",e,t);throw re.warn(e,t),r}const c=i.createQuery();return c.objectIds=r,c.outFields=n,c.returnGeometry=!!o,c.outSpatialReference=a,(await i.queryFeatures(c,t)).features[0]}({layer:i,graphic:e,outFields:d,objectIds:a,returnGeometry:r,spatialReference:s},n);u&&(u.geometry&&(e.geometry=u.geometry),u.attributes&&(e.attributes={...e.attributes,...u.attributes}))}function De(e=""){return!!e&&-1!==e.indexOf(me)}function je({attributes:e,graphic:t,relatedInfo:i}){e&&t&&i&&Object.keys(t.attributes).forEach((s=>{const n=function(e){return e?`${me}${e.layerId}/${e.fieldName}`:""}({layerId:i.relation.id.toString(),fieldName:s});e[n]=t.attributes[s]}))}const Ze={editing:!1,operations:{add:!0,update:!0,delete:!0}},Ne=d.Z.ofType(ee.Z);let ze=class extends te.r{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.abilities={...Ze},this.activeAttachmentInfo=null,this.attachmentInfos=new Ne,this.graphic=null,this.mode="view",this.handles.add([(0,m.S1)(this,"graphic",(()=>this._graphicChanged()))])}destroy(){this._attachmentLayer=null,this.graphic=null}castAbilities(e){return{...Ze,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){return this.get("graphic.layer.capabilities.operations.supportsResizeAttachments")||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:t}=this;if(!e||"function"!=typeof e.queryAttachments)throw new h.Z("invalid-layer","getAttachments(): A valid layer is required.");const i=this._getFeatureId(),s=new J.Z({objectIds:[i],returnMetadata:!0}),n=[],r=e.queryAttachments(s).then((e=>e[i]||n)).catch((()=>n));this._getAttachmentsPromise=r,this.notifyChange("state");const o=await r;return t.removeAll(),o.length&&t.addMany(o),this._getAttachmentsPromise=null,this.notifyChange("state"),o}async addAttachment(e){const{_attachmentLayer:t,attachmentInfos:i,graphic:s,abilities:n}=this;if(!e)throw new h.Z("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!n.operations.add)throw new h.Z("invalid-abilities","addAttachment(): add abilities are required.");if(!t||"function"!=typeof t.addAttachment)throw new h.Z("invalid-layer","addAttachment(): A valid layer is required.");const r=t.addAttachment(s,e).then((e=>this._queryAttachment(e.objectId))),o=await r;return i.add(o),o}async deleteAttachment(e){const{_attachmentLayer:t,attachmentInfos:i,graphic:s,abilities:n}=this;if(!e)throw new h.Z("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!n.operations.delete)throw new h.Z("invalid-abilities","deleteAttachment(): delete abilities are required.");if(!t||"function"!=typeof t.deleteAttachments)throw new h.Z("invalid-layer","deleteAttachment(): A valid layer is required.");const r=t.deleteAttachments(s,[e.id]).then((()=>e)),o=await r;return i.remove(o),o}async updateAttachment(e,t=this.activeAttachmentInfo){const{_attachmentLayer:i,attachmentInfos:s,graphic:n,abilities:r}=this;if(!e)throw new h.Z("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!t)throw new h.Z("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:t});if(!r.operations.update)throw new h.Z("invalid-abilities","updateAttachment(): Update abilities are required.");const o=s.findIndex((e=>e===t));if(!i||"function"!=typeof i.updateAttachment)throw new h.Z("invalid-layer","updateAttachment(): A valid layer is required.");const a=i.updateAttachment(n,t.id,e).then((e=>this._queryAttachment(e.objectId))),l=await a;return s.splice(o,1,l),l}async _queryAttachment(e){if(!e)throw new h.Z("invalid-attachment-id","Could not query attachment.");const{_attachmentLayer:t}=this,i=this._getFeatureId(),s=new J.Z({objectIds:[i],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return t.queryAttachments(s).then((e=>e[i][0]))}_getFeatureId(){const{_attachmentLayer:e,graphic:t}=this;if(!e||!t)return null;const{objectIdField:i}=e,{attributes:s}=t;return s&&s[i]}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch((()=>{})))}_setAttachmentLayer(){const{graphic:e}=this,t=ge(e);this._attachmentLayer=t?"scene"===t.type&&(0,o.pC)(t.associatedLayer)?t.associatedLayer:t:null}};(0,n._)([(0,l.Cb)()],ze.prototype,"abilities",void 0),(0,n._)([(0,R.p)("abilities")],ze.prototype,"castAbilities",null),(0,n._)([(0,l.Cb)()],ze.prototype,"activeAttachmentInfo",void 0),(0,n._)([(0,l.Cb)({readOnly:!0,t
1ype:Ne})],ze.prototype,"attachmentInfos",void 0),(0,n._)([(0,l.Cb)({type:u.Z})],ze.prototype,"graphic",void 0),(0,n._)([(0,l.Cb)()],ze.prototype,"mode",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],ze.prototype,"state",null),(0,n._)([(0,l.Cb)({readOnly:!0})],ze.prototype,"supportsResizeAttachments",null),ze=(0,n._)([(0,c.j)("esri.widgets.Attachments.AttachmentsViewModel")],ze);var Be=ze,Ge=i(36567);const We={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},Ue="esri-attachments",He="esri-attachments__loader-container",qe="esri-attachments__loader",$e="esri-attachments__container",Ke="esri-attachments__container--list",Ye="esri-attachments__container--preview",Xe="esri-attachments__actions",Qe="esri-attachments__delete-button",Je="esri-attachments__add-attachment-button",et="esri-attachments__error-message",tt="esri-attachments__items",it="esri-attachments__item",st="esri-attachments__item-button",nt="esri-attachments__item-mask",rt="esri-attachments__item-mask--icon",ot="esri-attachments__image",at="esri-attachments__image--resizable",lt="esri-attachments__label",ct="esri-attachments__filename",ht="esri-attachments__item-chevron-icon",dt="esri-attachments__item-link",ut="esri-attachments__item-link-overlay",pt="esri-attachments__item-link-overlay-icon",mt="esri-attachments__item-add-icon",ft="esri-attachments__form-node",gt="esri-attachments__file-fieldset",yt="esri-attachments__file-label",vt="esri-attachments__file-name",_t="esri-attachments__file-input",bt="esri-attachments__metadata",wt="esri-attachments__metadata-fieldset",Ct="esri-attachments__progress-bar",Mt="esri-widget",It="esri-button",Tt="esri-button--disabled",xt="esri-button--secondary",kt="esri-button--tertiary",St="esri-button--third",Pt="esri-button--small",Lt="esri-button--half",Et="esri-widget__content--empty",At="esri-icon-right",Ft="esri-icon-left",Vt="esri-icon-plus",Ot=window.CSS;let Rt=class extends H.Z{constructor(e,t){super(e,t),this.abilities=null,this.displayType="list",this.graphic=null,this.label=void 0,this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=new Be,this.visibleElements={...We},this._supportsImageOrientation=Ot&&Ot.supports&&Ot.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}initialize(){this.own((0,m.on)(this,"viewModel.attachmentInfos","change",(()=>this.scheduleRender())),(0,m.S1)(this,"viewModel.mode",(()=>this._modeChanged())))}castVisibleElements(e){return{...We,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.addAttachment(e).then((e=>(this._set("submitting",!1),this._set("error",null),t.mode="view",e))).catch((e=>{throw this._set("submitting",!1),this._set("error",new h.Z("attachments:add-attachment",this.messages.addErrorMessage,e)),e}))}deleteAttachment(e){const{viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.deleteAttachment(e).then((e=>(this._set("submitting",!1),this._set("error",null),t.mode="view",e))).catch((e=>{throw this._set("submitting",!1),this._set("error",new h.Z("attachments:delete-attachment",this.messages.deleteErrorMessage,e)),e}))}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:t}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(t).then((t=>(this._set("submitting",!1),this._set("error",null),e.mode="view",t))).catch((e=>{throw this._set("submitting",!1),this._set("error",new h.Z("attachments:update-attachment",this.messages.updateErrorMessage,e)),e}))}
1render(){const{submitting:e,viewModel:t}=this,{state:i}=t;return(0,U.j)("div",{class:this.classes(Ue,Mt)},e?this.renderProgressBar():null,"loading"===i?this.renderLoading():this.renderAttachments(),this.renderErrorMessage())}renderErrorMessage(){const{error:e,visibleElements:t}=this;return e&&t.errorMessage?(0,U.j)("div",{key:"error-message",class:et},e.message):null}renderAttachments(){const{mode:e,activeAttachmentInfo:t}=this.viewModel;return"add"===e?this.renderAddForm():"edit"===e?this.renderDetailsForm(t):this.renderAttachmentContainer()}renderLoading(){return(0,U.j)("div",{class:He,key:"loader"},(0,U.j)("div",{class:qe}))}renderProgressBar(){return this.visibleElements.progressBar?(0,U.j)("div",{class:Ct,key:"progress-bar"}):null}renderAddForm(){const{submitting:e,selectedFile:t}=this,i=e||!t,s=this.visibleElements.cancelAddButton?(0,U.j)("button",{type:"button",bind:this,disabled:e,onclick:this._cancelForm,class:this.classes(It,kt,Pt,Lt,e&&Tt)},this.messages.cancel):null,n=this.visibleElements.addSubmitButton?(0,U.j)("button",{type:"submit",disabled:i,class:this.classes(It,xt,Pt,Lt,{[Tt]:i})},this.messages.add):null,r=t?(0,U.j)("span",{key:"file-name",class:vt},t.name):null,o=(0,U.j)("form",{bind:this,afterCreate:z.Se,afterRemoved:z.pV,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},(0,U.j)("fieldset",{class:gt},r,(0,U.j)("label",{class:this.classes(yt,It,xt)},t?this.messages.changeFile:this.messages.selectFile,(0,U.j)("input",{class:_t,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))),n,s);return(0,U.j)("div",{key:"add-form-container",class:ft},o)}renderDetailsForm(e){const{visibleElements:t,viewModel:i,selectedFile:s,submitting:n}=this,{contentType:r,size:o,url:a}=e,{abilities:l}=i,c=n||!s,h=l.editing&&l.operations.delete&&t.deleteButton?(0,U.j)("button",{key:"delete-button",type:"button",disabled:n,bind:this,onclick:t=>this._submitDeleteAttachment(t,e),class:this.classes(It,Pt,kt,Qe,{[Tt]:n})},this.messages.delete):null,d=l.editing&&l.operations.update&&t.updateButton?(0,U.j)("button",{disabled:c,key:"update-button",type:"submit",class:this.classes(It,Pt,St,{[Tt]:c})},this.messages.update):null,u=this.visibleElements.cancelUpdateButton?(0,U.j)("button",{disabled:n,key:"cancel-button",type:"button",bind:this,onclick:this._cancelForm,class:this.classes(It,Pt,kt,St,{[Tt]:n})},this.messages.cancel):null,p=s?(0,U.j)("span",{key:"file-name",class:vt},s.name):null,m=l.editing&&l.operations.update?(0,U.j)("fieldset",{key:"file",class:gt},p,(0,U.j)("label",{class:this.classes(yt,It,xt)},this.messages.changeFile,(0,U.j)("input",{class:_t,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))):null,f=(0,U.j)("fieldset",{key:"size",class:wt},(0,U.j)("label",null,function(e,t){let i=0===t?0:Math.floor(Math.log(t)/Math.log(1024));i=(0,X.uZ)(i,0,Q.length-1);const s=(0,Y.uf)(t/1024**i,{maximumFractionDigits:2});return(0,K.gx)(e.units.bytes[Q[i]],{fileSize:s})}(this.messagesUnits,o))),g=(0,U.j)("fieldset",{key:"content-type",class:wt},(0,U.j)("label",null,r)),y=(0,U.j)("form",{bind:this,afterCreate:z.Se,afterRemoved:z.pV,"data-node-ref":"_updateAttachmentForm",onsubmit:this._submitUpdateAttachment},(0,U.j)("div",{class:bt},f,g),m,(0,U.j)("div",{class:Xe},h,u,d));return(0,U.j)("div",{key:"edit-form-container",class:ft},(0,U.j)("a",{class:dt,href:a,rel:"noreferrer",target:"_blank"},this.renderImageMask({attachmentInfo:e,size:400}),(0,U.j)("div",{class:ut},(0,U.j)("span",{class:pt},(0,U.j)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32"},(0,U.j)("path",{d:"M28 13h1v16H3V3h16v1H4v24h24zm-5-9h4.293L15.646 15.638l.707.707L28 4.707V9h1V3h-6z"}),(0,U.j)("path",{fill:"none",d:"M0 0h32v32H0z"}))))),y)}renderImageMask({attachmentInfo:e,size:t}){const{supportsResizeAttachments:i}=this.viewModel,{contentType:s,name:n,url:r}=e,o=i&&function(e){const t=e.toLowerCase();return"image/bmp"===t||"image/emf"===t||"image/exif"===t||"image/gif"===t||"image/x-icon"===t||"image/jpeg"===t||"image/png"===t||"image/tiff"===t||"image/x-wmf"===t}(s),a=this._getCSSTransform(e,o),l=a?{transform:a,"image-orientation":"none"}:{},c=-1===r.indexOf("?")?"?":"&",h=o?`${r}${c}w=${t}`:function(e){const t=(0,Ge.V)("esri/themes/base/images/files/");return e?"text/plain"===e?`${t}text-32.svg`:"application/pdf"===e?`${t}pdf-32.svg`:"text/csv"===e?`${t}csv-32.svg`:"application/gpx+xml"===e?`${t}gpx-32.svg`:"application/x-dwf"===e?`${t}cad-32.svg`:"application/postscript"===e||"application/json"===e||"text/xml"===e||"model/vrml"===e?`${t}code-32.svg`:"application/x-zip-compressed"===e||"application/x-7z-compressed"===e||"application/x-gzip"===e||"application/x-tar"===e||"application/x-gtar"===e||"application/x-bzip2"===e||"application/gzip"===e||"application/x-compress"===e||"application/x-apple-diskimage"===e||"application/x-rar-compressed"===e||"application/zip"===e?`${t}zip-32.svg`:-1!==e.indexOf("image/")?`${t}image-32.svg`:-1!==e.indexOf("audio/")?`${t}sound-32.svg`:-1!==e.indexOf("video/")?`${t}video-32.svg`:-1!==e.indexOf("msexcel")||-1!==e.indexOf("ms-excel")||-1!==e.indexOf("spreadsheetml")?`${t}excel-32.svg`:-1!==e.indexOf("msword")||-1!==e.indexOf("ms-word")||-1!==e.indexOf("wordprocessingml")?`${t}word-32.svg`:-1!==e.indexOf("powerpoint")||-1!==e.indexOf("presentationml")?`${t}report-32.svg`:`${t}generic-32.svg`:`${t}generic-32.svg`}(s),d={[rt]:!o},u={[at]:i};return(0,U.j)("div",{class:this.classes(d,nt)},(0,U.j)("img",{styles:l,alt:n,src:h,class:this.classes(u,ot)}))}renderAttachmentInfo({attachmentInfo:e,displayType:t}){const{viewModel:i}=this,{abilities:s}=i,{name:n,url:r}=e,o=this.renderImageMask({attachmentInfo:e,size:"list"===t?48:400}),a=s.editing?(0,U.j)("span",{"aria-hidden":"true",class:this.classes(ht,(0,z.dZ)()?Ft:At)}):null,l=[o,(0,U.j)("label",{class:lt},(0,U.j)("span",{class:ct},n||this.messages.noTitle),a)],c=s.editing?(0,U.j)("button",{key:"details-button",bind:this,class:st,title:this.messages.attachmentDetails,"aria-label":this.messages.attachmentDetails,"data-attachment-info-id":e.id,onclick:()=>this._startEditAttachment(e),type:"button"},l):(0,U.j)("a",{key:"details-link",class:st,href:r,target:"_blank"},l);return(0,U.j)("li",{class:it,key:e},c)}
1renderAttachmentContainer(){const{displayType:e,viewModel:t,visibleElements:i}=this,{attachmentInfos:s,abilities:n}=t,r=s&&s.length,o={[Ke]:"preview"!==e,[Ye]:"preview"===e},a=n.editing&&n.operations.add&&i.addButton?(0,U.j)("button",{bind:this,onclick:()=>this._startAddAttachment(),class:this.classes(It,kt,Je),type:"button"},(0,U.j)("span",{"aria-hidden":"true",class:this.classes(mt,Vt)}),this.messages.add):null,l=r?(0,U.j)("ul",{class:tt},s.toArray().map((t=>this.renderAttachmentInfo({attachmentInfo:t,displayType:e})))):(0,U.j)("div",{class:Et},this.messages.noAttachments);return(0,U.j)("div",{key:"attachments-container",class:this.classes($e,o)},l,a)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){const t=e.target,i=t&&t.files&&t.files.item(0);this._set("selectedFile",i)}_submitDeleteAttachment(e,t){e.preventDefault(),this.deleteAttachment(t)}_submitAddAttachment(e){e.preventDefault(),this.addAttachment()}_submitUpdateAttachment(e){e.preventDefault(),this.updateAttachment()}_startEditAttachment(e){const{viewModel:t}=this;t.activeAttachmentInfo=e,t.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e,t){const{orientationInfo:i}=e;return!this._supportsImageOrientation&&t&&i?[i.rotation?`rotate(${i.rotation}deg)`:"",i.mirrored?"scaleX(-1)":""].join(" "):""}};(0,n._)([(0,O.B)("viewModel.abilities")],Rt.prototype,"abilities",void 0),(0,n._)([(0,l.Cb)()],Rt.prototype,"displayType",void 0),(0,n._)([(0,O.B)("viewModel.graphic")],Rt.prototype,"graphic",void 0),(0,n._)([(0,l.Cb)({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],Rt.prototype,"label",void 0),(0,n._)([(0,l.Cb)(),(0,W.H)("esri/widgets/Attachments/t9n/Attachments")],Rt.prototype,"messages",void 0),(0,n._)([(0,l.Cb)(),(0,W.H)("esri/core/t9n/Units")],Rt.prototype,"messagesUnits",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Rt.prototype,"selectedFile",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Rt.prototype,"submitting",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Rt.prototype,"error",void 0),(0,n._)([(0,l.Cb)({type:Be})],Rt.prototype,"viewModel",void 0),(0,n._)([(0,l.Cb)()],Rt.prototype,"visibleElements",void 0),(0,n._)([(0,R.p)("visibleElements")],Rt.prototype,"castVisibleElements",null),Rt=(0,n._)([(0,c.j)("esri.widgets.Attachments")],Rt);var Dt=Rt;let jt=class extends Be{constructor(e){super(e),this.description=null,this.title=null}};(0,n._)([(0,l.Cb)()],jt.prototype,"description",void 0),(0,n._)([(0,l.Cb)()],jt.prototype,"title",void 0),jt=(0,n._)([(0,c.j)("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],jt);var Zt=jt;const Nt="esri-feature-element-info",zt="esri-feature-element-info__title",Bt="esri-feature-element-info__description";let Gt=class extends H.Z{constructor(e,t){super(e,t),this.description=null,this.title=null}render(){return(0,U.j)("div",{class:Nt},this.renderTitle(),this.renderDescription())}renderTitle(){const{title:e}=this;return e?(0,U.j)("h2",{key:"title",class:zt},e):null}renderDescription(){const{description:e}=this;return e?(0,U.j)("div",{key:"description",class:Bt},e):null}};(0,n._)([(0,l.Cb)()],Gt.prototype,"description",void 0),(0,n._)([(0,l.Cb)()],Gt.prototype,"title",void 0),Gt=(0,n._)([(0,c.j)("esri.widgets.Feature.support.FeatureElementInfo")],Gt);var Wt=Gt;const Ut="esri-feature-attachments";let Ht=class extends H.Z{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new Dt,this.description=null,this.displayType=null,this.graphic=null,this.title=null,this.viewModel=new Zt}initialize(){this._featureElementInfo=new Wt,(0,m.S1)(this,["viewModel.description","viewModel.title"],(()=>this._setupFeatureElementInfo())),(0,m.S1)(this,"viewModel.graphic",(e=>this.attachmentsWidget.graphic=e))}destroy(){this.attachmentsWidget.destroy(),this._featureElementInfo.destroy()}render(){var e;const{attachmentsWidget:t}=this;return(0,U.j)("div",{class:Ut},null==(e=this._featureElementInfo)?void 0:e.render(),null==t?void 0:t.render())}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo.set({description:e,title:t})}};(0,n._)([(0,l.Cb)({readOnly:!0})],Ht.prototype,"attachmentsWidget",void 0),(0,n._)([(0,O.B)("viewModel.description")],Ht.prototype,"description",void 0),(0,n._)([(0,O.B)("attachmentsWidget.dis
1playType")],Ht.prototype,"displayType",void 0),(0,n._)([(0,O.B)("viewModel.graphic")],Ht.prototype,"graphic",void 0),(0,n._)([(0,O.B)("viewModel.title")],Ht.prototype,"title",void 0),(0,n._)([(0,l.Cb)({type:Zt})],Ht.prototype,"viewModel",void 0),Ht=(0,n._)([(0,c.j)("esri.widgets.Feature.FeatureAttachments")],Ht);var qt=Ht;let $t=class extends((0,te.p)(L.Z)){constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.handles.add((0,m.S1)(this,"creator",(e=>{this._destroyContent(),this._createContent(e)})))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:t,destroyer:i}=this;e&&(ye(i,{graphic:t}).catch((()=>null)),this._set("created",null))}async _createContent(e){const{graphic:t}=this,i=ye(e,{graphic:t}).catch((()=>null));this._loadingPromise=i,this.notifyChange("state");const s=await i;i===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",s))}};(0,n._)([(0,l.Cb)({readOnly:!0})],$t.prototype,"created",void 0),(0,n._)([(0,l.Cb)()],$t.prototype,"creator",void 0),(0,n._)([(0,l.Cb)()],$t.prototype,"destroyer",void 0),(0,n._)([(0,l.Cb)({type:u.Z})],$t.prototype,"graphic",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],$t.prototype,"state",null),$t=(0,n._)([(0,c.j)("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],$t);var Kt=$t;const Yt="esri-feature-content",Xt="esri-feature-content__loader-container",Qt="esri-feature-content__loader";let Jt=class extends H.Z{constructor(e,t){super(e,t),this.creator=null,this.graphic=null,this.viewModel=null,this._addTargetToAnchors=e=>{Array.from(e.querySelectorAll("a")).forEach((e=>{ve(e.href)&&!e.hasAttribute("target")&&e.setAttribute("target","_blank")}))}}renderLoading(){return(0,U.j)("div",{class:Xt,key:"loader"},(0,U.j)("div",{class:Qt}))}renderCreated(){var e;const t=null==(e=this.viewModel)?void 0:e.created;return t?t instanceof HTMLElement?(0,U.j)("div",{key:t,bind:t,afterCreate:this._attachToNode}):(0,q.Qd)(t)?(0,U.j)("div",{key:t},!t.destroyed&&t.render()):(0,U.j)("div",{key:t,innerHTML:t,afterCreate:this._addTargetToAnchors}):null}render(){var e;const t=null==(e=this.viewModel)?void 0:e.state;return(0,U.j)("div",{class:Yt},"loading"===t?this.renderLoading():this.renderCreated())}_attachToNode(e){e.appendChild(this)}};(0,n._)([(0,O.B)("viewModel.creator")],Jt.prototype,"creator",void 0),(0,n._)([(0,O.B)("viewModel.graphic")],Jt.prototype,"graphic",void 0),(0,n._)([(0,l.Cb)({type:Kt})],Jt.prototype,"viewModel",void 0),Jt=(0,n._)([(0,c.j)("esri.widgets.Feature.FeatureContent")],Jt);var ei=Jt,ti=i(78213),ii=i(18228);let si=class extends L.Z{constructor(e){super(e),this.attributes=null,this.expressionInfos=null,this.description=null,this.fieldInfos=null,this.title=null}get formattedFieldInfos(){const{expressionInfos:e,fieldInfos:t}=this,i=[];return null==t||t.forEach((t=>{if(t.hasOwnProperty("visible")&&!t.visible)return;const s=t.clone();s.label=be(s,e),i.push(s)})),i}};(0,n._)([(0,l.Cb)()],si.prototype,"attributes",void 0),(0,n._)([(0,l.Cb)({type:[ii.Z]})],si.prototype,"expressionInfos",void 0),(0,n._)([(0,l.Cb)()],si.prototype,"description",void 0),(0,n._)([(0,l.Cb)({type:[ti.Z]})],si.prototype,"fieldInfos",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],si.prototype,"formattedFieldInfos",null),(0,n._)([(0,l.Cb)()],si.prototype,"title",void 0),si=(0,n._)([(0,c.j)("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],si);var ni=si;const ri=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Laserfische"},{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];function oi(e,t){if("string"!=typeof t||!t)return t;const i=function(e){let t=null;return ri.some((i=>(i.pattern.test(e)&&(t=i),!!t))),t}(t);if(!i)return t;const s=t.match(i.pattern),n=s&&s[2],r=(0,K.gx)((0,K.gx)(i.label,{messages:e,hierPart:n}),{appName:i.appName}),o=i.target?` target="${i.target}"`:"",a="_blank"===i.target?' rel="noreferrer"':"";return t.replace(i.pattern,`<a${o} href="$1"${a}>${r}</a>`)}const ai="esri-feature-fields",li="esri-feature-fields__field-header",ci="esri-feature-fields__field-data",hi="esri-feature-fields__field-data--date",di="esri-widget__table";let ui=class extends H.Z{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attributes=null,this.description=null,this.expressionInfos=null,this.fieldInfos=null,this.title=null,this.viewModel=new ni,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new Wt,(0,m.S1)(this,["viewModel.description","viewModel.title"],(()=>this._setupFeatureElementInfo()))}destroy(){this._featureElementInfo.destroy()}renderFieldInfo(e,t){const{attributes:i}=this.viewModel,s=e.fieldName,n=e.label||s,r=i?null==i[s]?"":i[s]:"",o=!(!e.format||!e.format.dateFormat),a="number"!=typeof r||o?oi(this.messagesURIUtils,r):this._forceLTR(r),l={[hi
1]:o};return(0,U.j)("tr",{key:`fields-element-info-row-${s}-${t}`},(0,U.j)("th",{key:`fields-element-info-row-header-${s}-${t}`,class:li,innerHTML:n}),(0,U.j)("td",{key:`fields-element-info-row-data-${s}-${t}`,class:this.classes(ci,l),innerHTML:a}))}renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e.length?(0,U.j)("table",{class:di,summary:this.messages.fieldsSummary},(0,U.j)("tbody",null,e.map(((e,t)=>this.renderFieldInfo(e,t))))):null}render(){var e;return(0,U.j)("div",{class:ai},null==(e=this._featureElementInfo)?void 0:e.render(),this.renderFields())}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo.set({description:e,title:t})}_forceLTR(e){return`‎${e}`}};(0,n._)([(0,O.B)("viewModel.attributes")],ui.prototype,"attributes",void 0),(0,n._)([(0,O.B)("viewModel.description")],ui.prototype,"description",void 0),(0,n._)([(0,O.B)("viewModel.expressionInfos")],ui.prototype,"expressionInfos",void 0),(0,n._)([(0,O.B)("viewModel.fieldInfos")],ui.prototype,"fieldInfos",void 0),(0,n._)([(0,O.B)("viewModel.title")],ui.prototype,"title",void 0),(0,n._)([(0,l.Cb)({type:ni})],ui.prototype,"viewModel",void 0),(0,n._)([(0,l.Cb)(),(0,W.H)("esri/widgets/Feature/t9n/Feature")],ui.prototype,"messages",void 0),(0,n._)([(0,l.Cb)(),(0,W.H)("esri/widgets/support/t9n/uriUtils")],ui.prototype,"messagesURIUtils",void 0),ui=(0,n._)([(0,c.j)("esri.widgets.Feature.FeatureFields")],ui);var pi=ui,mi=i(94268),fi=i(78668),gi=i(11509),yi=i(33223),vi=i(27746),_i=i(40304),bi=i(23277);const wi=a.Z.getLogger("esri.widgets.Feature.support.relatedFeatureUtils"),Ci=new Map;function Mi(e){if(!De(e))return null;const[t,i]=e.split("/").slice(1);return{layerId:t,fieldName:i}}function Ii(e,t){const i=function(e,t){if(!t.relationships)return null;let i=null;const{relationships:s}=t;return s.some((t=>t.id===parseInt(e,10)&&(i=t,!0))),i}(e,t);if(!i)return;const s=`${t.url}/${i.relatedTableId}`;return{url:s,queryTask:new bi.Z({url:s,sourceSpatialReference:t.spatialReference}),relation:i,relatedFields:[],outStatistics:[]}}async function Ti(e,t,i,s){const n=i.layerId.toString(),{layerInfo:r,queryTask:o,relation:a,relatedFields:l,outStatistics:c}=t,h=function({originRelationship:e,relationships:t,layerId:i}){let s;return t&&t.some((t=>(`${t.relatedTableId}`===i&&t.id===e.id&&(s=t),!!s))),s}({originRelationship:a,relationships:r.relationships,layerId:n});if(h.relationshipTableId&&h.keyFieldInRelationshipTable){const t=(await function(e,t,i,s){const n=new _i.Z;return n.outFields=["*"],n.relationshipId="number"==typeof t.id?t.id:parseInt(t.id,10),n.objectIds=[e.attributes[i.objectIdField]],i.queryRelatedFeatures(n,s)}(e,h,i,s))[e.attributes[i.objectIdField]];if(!t)return null;const n=t.features.map((e=>e.attributes[r.objectIdField]));if((null==c?void 0:c.length)>0&&r.supportsStatistics){const e=new vi.Z;e.where=function(e,t,i){let s=0;const n=[];for(;s<t.length;)n.push(`${e} IN (${t.slice(s,i+s)})`),s+=i;return n.join(" OR ")}(r.objectIdField,n,1e3),e.outFields=l,e.outStatistics=c;const i={features:Promise.resolve(t),statsFeatures:o.execute(e)};return(0,fi.as)(i)}}const d=null==h?void 0:h.keyField;if(d){const i=(0,ie.H7)((0,ie.rz)(r.fields,d)),n=function(e,t){const i=t.toLowerCase();for(const s in e)if(s.toLowerCase()===i)return e[s];return null}(e.attributes,a.keyField),l=i?`${d}=${n}`:`${d}='${n}'`,c=o.execute(new vi.Z({where:l,outFields:t.relatedFields}),s),h=t.outStatistics&&t.outStatistics.length>0&&r.supportsStatistics?o.execute(new vi.Z({where:l,outFields:t.relatedFields,outStatistics:t.outStatistics}),s):null,u={features:c};return h&&(u.statsFeatures=h),(0,fi.as)(u)}return null}function xi({relatedInfos:e,layer:t},i){const s={};return e.forEach(((e,n)=>{const{relation:r}=e;if(!r){const e=new h.Z("relation-required","A relation is required on a layer to retrieve related records.");throw wi.error(e),e}const{relatedTableId:o}=r;if("number"!=typeof o){const e=new h.Z("A related table ID is required on a layer to retrieve related records.");throw wi.error(e),e}const a=`${t.url}/${o}`,l=Ci.get(a),c=l||function(e,t){return(0,gi.default)(e,{query:{f:"json"},signal:t&&t.signal})}(a,i);l||Ci.set(a,c),s[n]=c})),(0,fi.as)(s)}let ki=class extends L.Z{constructor(e){super(e),this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}setActiveMedia(e){this._setContentElementMedia(e)}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}_setContentElementMedia(e){const{formattedMediaInfoCount:t}=this,i=(e+t)%t;this.activeMediaInfoIndex=i}
1_pageContentElementMedia(e){const{activeMediaInfoIndex:t}=this,i=t+e;this._setContentElementMedia(i)}_formatMediaInfos(){const{attributes:e,mediaInfos:t,formattedAttributes:i,fieldInfoMap:s,layer:n}=this;return null==t?void 0:t.map((t=>{if(!t)return null;if(t.title=Ie({attributes:e,fieldInfoMap:s,globalAttributes:i,layer:n,text:t.title}),t.caption=Ie({attributes:e,fieldInfoMap:s,globalAttributes:i,layer:n,text:t.caption}),t.altText=Ie({attributes:e,fieldInfoMap:s,globalAttributes:i,layer:n,text:t.altText}),"image"===t.type){const{value:e}=t;return this._setImageValue({value:e,formattedAttributes:i,layer:n}),t.value.sourceURL?t:void 0}if("pie-chart"===t.type||"line-chart"===t.type||"column-chart"===t.type||"bar-chart"===t.type){const{value:s}=t;return this._setChartValue({value:s,chartType:t.type,attributes:e,formattedAttributes:i,layer:n}),t}return null})).filter(Boolean)}_setImageValue(e){const{fieldInfoMap:t}=this,{value:i,formattedAttributes:s,layer:n}=e,{linkURL:r,sourceURL:o}=i;if(o){const e=ke(o,n);i.sourceURL=Te({formattedAttributes:s,template:e,fieldInfoMap:t})}if(r){const e=ke(r,n);i.linkURL=Te({formattedAttributes:s,template:e,fieldInfoMap:t})}}_setChartValue(e){const{value:t,attributes:i,formattedAttributes:s,chartType:n,layer:r}=e,{popupTemplate:o,relatedInfos:a}=this,{fields:l,normalizeField:c}=t;if(t.fields=function(e,t){return e&&e.map((e=>we(e,t)))}(l,r),c&&(t.normalizeField=we(c,r)),!l.some((e=>!!(null!=s[e]||De(e)&&a.size))))return;const h=null==o?void 0:o.fieldInfos;l.forEach((e=>{if(De(e))return void(t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:h,fieldName:e,formattedAttributes:s,chartType:n,value:t})]);const r=this._getChartOption({value:t,attributes:i,chartType:n,formattedAttributes:s,fieldName:e,fieldInfos:h});t.series.push(r)}))}_getRelatedChartInfos(e){var t;const{fieldInfos:i,fieldName:s,formattedAttributes:n,chartType:r,value:o}=e,a=[],l=Mi(s),{layerId:c,fieldName:h}=l,d=null==(t=this.relatedInfos)?void 0:t.get(c.toString());if(!d)return a;const{relatedFeatures:u,relation:p}=d;if(!p||!u)return a;const{cardinality:m}=p;return u.forEach((e=>{const{attributes:t}=e;t&&Object.keys(t).forEach((e=>{e===h&&a.push(this._getChartOption({value:o,attributes:t,formattedAttributes:n,fieldName:s,chartType:r,relatedFieldName:e,fieldInfos:i}))}))})),"one-to-many"===m||"many-to-many"===m?a:[a[0]]}_getTooltip({label:e,value:t,chartType:i}){return"pie-chart"===i?e:`${e}: ${t}`}_getChartOption(e){var t;const{value:i,attributes:s,formattedAttributes:n,fieldName:r,relatedFieldName:o,fieldInfos:a,chartType:l}=e,{layer:c}=this,{normalizeField:h,tooltipField:d}=i,u=h?De(h)?s[Mi(h).fieldName]:s[h]:null,p=o&&void 0!==s[o]?s[o]:void 0!==s[r]?s[r]:n[r],m=void 0===p?null:p&&u?p/u:p,f=new mi.Z({value:m});if(De(r)){const e=Mi(r),t=Mi(d),i=t?t.fieldName:null,n=Pe(m,{fieldInfos:a,fieldName:o,layer:c,preventPlacesFormatting:!!u}),h=e?e.label||e.fieldName:o,p=i&&void 0!==s[i]?s[i]:h;return f.tooltip=this._getTooltip({label:p,value:n,chartType:l}),f}const g=Le(a,r),y=we(r,c),v=d&&void 0!==n[d]?n[d]:be(g||new ti.Z({fieldName:y}),null==(t=this.popupTemplate)?void 0:t.expressionInfos),_=n[y];return f.tooltip=this._getTooltip({label:v,value:_,chartType:l}),f}};(0,n._)([(0,l.Cb)()],ki.prototype,"activeMediaInfoIndex",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],ki.prototype,"activeMediaInfo",null),(0,n._)([(0,l.Cb)()],ki.prototype,"attributes",void 0),(0,n._)([(0,l.Cb)()],ki.prototype,"description",void 0),(0,n._)([(0,l.Cb)()],ki.prototype,"fieldInfoMap",void 0),(0,n._)([(0,l.Cb)()],ki.prototype,"formattedAttributes",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],ki.prototype,"formattedMediaInfos",null),(0,n._)([(0,l.Cb)()],ki.prototype,"layer",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],ki.prototype,"formattedMediaInfoCount",null),(0,n._)([(0,l.Cb)()],ki.prototype,"mediaInfos",void 0),(0,n._)([(0,l.Cb)()],ki.prototype,"popupTemplate",void 0),(0,n._)([(0,l.Cb)()],ki.prototype,"relatedInfos",void 0),(0,n._)([(0,l.Cb)()],ki.prototype,"title",void 0),ki=(0,n._)([(0,c.j)("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],ki);var Si=ki,Pi=Si,Li=i(8108),Ei=["#ffffff","#858585","#ffbebe","#ffebbe","#ffebaf","#ffffbe","#e9ffbe","#d3ffbe","#beffe8","#bee8ff","#bed2ff","#e8beff","#ffbee8","#ebebeb","#707070","#ff7f7f","#ffa77f","#ffd37f","#ffff73","#d1ff73","#a3ff73","#73ffdf","#73dfff","#73b2ff","#df73ff","#ff73df","#d6d6d6","#5c5c5c","#ff0000","#ff5500","#ffaa00","#ffff00","#aaff00","#55ff00","#00ffc5","#00c5ff","#0070ff","#c500ff","#ff00c
15","#c2c2c2","#474747","#e60000","#e64c00","#e69800","#e6e600","#98e600","#4ce600","#00e6a9","#00a9e6","#005ce6","#a900e6","#e600a9","#adadad","#242424","#a80000","#a83800","#a87000","#a8a800","#70a800","#38a800","#00a884","#0084a8","#004da8","#8400a8","#a80084","#999999","#1a1a1a","#730000","#732600","#734c00","#737300","#4c7300","#267300","#00734c","#004c73","#002673","#4c0073","#73004"],Ai=[].concat(Ei.slice(30,39),Ei.slice(28,30).reverse()),Fi=[{name:"default",colors:Ai},{name:"cat-dark",colors:["#ed5151","#149ece","#a7c636","#9e559c","#fc921f","#ffde3e","#f789d8","#b7814a","#3caf99","#6b6bd6","#b54779","#7f7f7f"]},{name:"tropical-bliss",colors:["#fce138","#ff9399","#fcd27e","#f1983c","#a553b7","#b1a9d0","#6ecffc","#4c81cd","#fc6f84","#fc3e5a","#6af689","#48885c"]},{name:"desert-blooms",colors:["#102432","#144d59","#ffc730","#ed9310","#a64f1b","#661510","#d9351a","#b31515","#4a0932","#8c213f","#18382e","#2c6954"]},{name:"under-the-sea",colors:["#bf9727","#607100","#00734c","#704489","#01acca","#024e76","#f09100","#ea311f","#c6004b","#7570b3","#666666","#333333"]},{name:"vibrant-rainbow",colors:["#fffb00","#f5cb11","#9fd40c","#46e39c","#32b8a6","#7ff2fa","#ac08cc","#dd33ff","#eb7200","#e8a784","#bf2e2e","#6c7000"]},{name:"ocean-bay",colors:["#191921","#11495c","#78b1c2","#454f4b","#8f8f82","#9be0c0","#87b051","#f7ec88","#ebdcc1","#dbb658","#c43541","#75351e"]},{name:"prairie-summer",colors:["#332424","#751555","#d47013","#d68989","#211173","#82aad6","#7bfaeb","#6ec9a8","#6b6408","#eada40","#ccc54a","#1fc235"]},{name:"pastel-chalk",colors:["#fffd99","#f5e6a4","#c1d48c","#b8e3d0","#a0b8b5","#cbf7fa","#d791f2","#dfc1eb","#f2b983","#e8c4b2","#bf8e8e","#94995c"]},{name:"seq-yellow-orange-red-bright",colors:["#910000","#b1260b","#c0370f","#e05919","#ef6a1d","#ff7b22","#ffa143","#ffb454","#ffda74","#ffed85"]},{name:"seq-reds-bright",colors:["#57453b","#7b4238","#9f4036","#c23d33","#d7483c","#ec5244","#f3696c","#f9816c","#ffc4ae","#fff0dc"]},{name:"seq-purples-bright",colors:["#4e465c","#5a4a78","#695291","#775baa","#8663c3","#946bdc","#aa89e8","#c1a6f3","#d7c4ff","#e6e1ff"]},{name:"seq-blues-bright",colors:["#404d54","#435c6c","#48799d","#4b88b6","#4d96ce","#50a5e7","#74bbed","#98d0f3","#bce6f9","#e6faff"]},{name:"seq-greens-bright",colors:["#39544c","#386757","#368165","#359b73","#33b581","#4bc392","#64d2a2","#7ce0b3","#cbf6d9","#f4ffea"]},{name:"seq-browns-bright",colors:["#524834","#715b38","#8f6e3c","#ae8140","#cc9444","#eba748","#eeb664","#f0c47f","#f9e0b7","#fff8eb"]}];const Vi="en-us",Oi=new Map([["ar",()=>Promise.all([i.e(9351),i.e(6185)]).then(i.bind(i,16185)).then((function(e){return e.a}))],["bs-ba",()=>Promise.all([i.e(9351),i.e(7653)]).then(i.bind(i,57653)).then((function(e){return e.b}))],["ca-es",()=>Promise.all([i.e(9351),i.e(6441)]).then(i.bind(i,16441)).then((function(e){return e.c}))],["cs-cz",()=>Promise.all([i.e(9351),i.e(5515)]).then(i.bind(i,15515)).then((function(e){return e.c}))],["da-dk",()=>Promise.all([i.e(9351),i.e(2601)]).then(i.bind(i,2601)).then((function(e){return e.d}))],["de-de",()=>Promise.all([i.e(9351),i.e(3625)]).then(i.bind(i,33625)).then((function(e){return e.d}))],["de-ch",()=>Promise.all([i.e(9351),i.e(124)]).then(i.bind(i,30124)).then((function(e){return e.d}))],["el-gr",()=>Promise.all([i.e(9351),i.e(8229)]).then(i.bind(i,88229)).then((function(e){return e.e}))],["en-us",()=>Promise.all([i.e(9351),i.e(2329)]).then(i.bind(i,32329)).then((function(e){return e.e}))],["en-ca",()=>Promise.all([i.e(9351),i.e(3814)]).then(i.bind(i,43814)).then((function(e){return e.e}))],["es-es",()=>Promise.all([i.e(9351),i.e(990)]).then(i.bind(i,80990)).then((function(e){return e.e}))],["et-ee",()=>Promise.all([i.e(9351),i.e(7303)]).then(i.bind(i,17303)).then((function(e){return e.e}))],["fi-fi",()=>Promise.all([i.e(9351),i.e(2705)]).then(i.bind(i,2705)).then((function(e){return e.f}))],["fr-fr",()=>Promise.all([i.e(9351),i.e(791)]).then(i.bind(i,10791)).then((function(e){return e.f}))],["he-il",()=>Promise.all([i.e(9351),i.e(4049)]).then(i.bind(i,44049)).then((function(e){return e.h}))],["hr-hr",()=>Promise.all([i.e(9351),i.e(7946)]).then(i.bind(i,47946)).then((function(e){return e.h}))],["hu-hu",()=>Promise.all([i.e(9351),i.e(4669)]).then(i.bind(i,54669)).then((function(e){return e.h}))],["id-id",()=>Promise.all([i.e(9351),i.e(8243)]).then(i.bind(i,48243)).then((function(e){return e.i}))],["it-it",()=>Promise.all([i.e(9351),i.e(412)]).then(i.bind(i,20412)).then((function(e){return e.i}))],["ja-jp",()=>Promise.all([i.e(9351),i.e(3433)]).then(i.bind(i,53433)).then((function(e){return e.j}))],["ko-kr",()=>Promise.all([i.e(9351),i.e(9457)]).then(i.bind(i,29457)).then((function(e){return e.k}))],["lt-lt",()=>Promise.all([i.e(9351),i.e(6829)]).then(i.bind(i,56829)).then((function(e){return e.l}))],["lv-lv",()=>Promise.all([i.e(9351),i.e(9341)]).then(i.bind(i,39434)).then((function(e){return e.l}))],["nb-no",()=>Promise.all([i.e(9351),i.e(7660)]).then(i.bind(i,17660)).then((function(e){return e.n}))],["nl-nl",()=>Promise.all([i.e(9351),i.e(9547)]).then(i.bind(i,99547)).then((function(e){return e.n}))],["pl-pl",()=>Promise.all([i.e(9351),i.e(17)]).then(i.bind(i,17)).then((function(e){return e.p}))],["pt-br",()=>Promise.all([i.e(9351),i.e(4783)]).then(i.bind(i,97578)).then((function(e){return e.p}))],["pt-pt",()=>Promise.all([i.e(9351),i.e(3399)]).then(i.bind(i,63399)).then((function(e){return e.p}))],["ro-ro",()=>Promise.all([i.e(9351),i.e(5134)]).then(i.bind(i,55134)).then((function(e){return e.r}))],["ru-ru",()=>Promise.all([i.e(9351),i.e(134)]).then(i.bind(i,40134)).then((function(e){return e.r}))],["sk-sk",()=>Promise.all([i.e(9351),i.e(8718)]).then(i.bind(i,98718)).then((function(e){return e.s}))],["sl-sl",()=>Promise.all([i.e(9351),i.e(1352)]).then(i.bind(i,21352)).then((function(e){return e.s}))],["sr-rs",()=>Promise.all([i.e(9351),i.e(6802)]).then(i.bind(i,86802)).then((function(e){return e.s}))],["sv-se",()=>Promise.all([i.e(9351),i.e(1810)]).then(i.bind(i,51810)).then((function(e){return e.s}))],["th-th",()=>Promise.all([i.e(9351),i.e(4287)]).then(i.bind(i,84287)).then((function(e){return e.t}))],["tr-tr",()=>Promise.all([i.e(9351),i.e(8385)]).then(i.bind(i,28385)).then((function(e){return e.t}))],["uk-ua",()=>
1Promise.all([i.e(9351),i.e(3040)]).then(i.bind(i,43040)).then((function(e){return e.u}))],["vi-vn",()=>Promise.all([i.e(9351),i.e(1489)]).then(i.bind(i,51489)).then((function(e){return e.v}))],["zh-cn",()=>Promise.all([i.e(9351),i.e(5266)]).then(i.bind(i,15266)).then((function(e){return e.z}))],["zh-hk",()=>Promise.all([i.e(9351),i.e(9794)]).then(i.bind(i,99794)).then((function(e){return e.z}))],["zh-tw",()=>Promise.all([i.e(9351),i.e(9794)]).then(i.bind(i,99794)).then((function(e){return e.z}))]]);function Ri(e){return e?Oi.has(e.toLowerCase())?e.toLowerCase():function(e){const t=e.split("-")[0].toLowerCase();let i=null;for(const s of Oi.keys())if(s.startsWith(t)){i=s;break}return i}(e)||Vi:Vi}let Di,ji;const Zi="esri-feature-media",Ni="esri-feature-media__container",zi="esri-feature-media__item-container",Bi="esri-feature-media__item",Gi="esri-feature-media__item-title",Wi="esri-feature-media__item-caption",Ui="esri-feature-media__previous",Hi="esri-feature-media__previous-icon",qi="esri-feature-media__previous-icon--rtl",$i="esri-feature-media__next",Ki="esri-feature-media__next-icon",Yi="esri-feature-media__next-icon--rtl",Xi="esri-feature-media__chart",Qi="esri-feature-media__button",Ji="esri-feature-media__icon",es="esri-icon-left-triangle-arrow",ts="esri-icon-right-triangle-arrow",is=.05,ss=.95;let ns=class extends H.Z{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this.attributes=null,this.activeMediaInfoIndex=null,this.description=null,this.fieldInfoMap=null,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null,this.viewModel=new Pi,this.messages=null}initialize(){this._featureElementInfo=new Wt,this.own((0,m.S1)(this,["viewModel.activeMediaInfo","viewModel.activeMediaInfoIndex"],(()=>this._setupMediaRefreshTimer())),(0,m.S1)(this,["viewModel.description","viewModel.title"],(()=>this._setupFeatureElementInfo())))}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo.destroy()}render(){var e;return(0,U.j)("div",{bind:this,class:Zi,onkeyup:this._handleMediaKeyup},null==(e=this._featureElementInfo)?void 0:e.render(),this.renderMedia())}renderMedia(){const{formattedMediaInfoCount:e}=this.viewModel;return e?(0,U.j)("div",{key:"media-element-container",class:Ni},this.renderMediaPageButton("previous"),this.renderMediaInfo(),this.renderMediaPageButton("next")):null}renderImageMediaInfo(e){const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:s}=this.viewModel,{value:n,refreshInterval:r,altText:o,title:a,type:l}=e,{sourceURL:c,linkURL:h}=n,d=ve(h)?"_blank":"_self",u="_blank"===d?"noreferrer":"",p=r?t:null,m=p?p.timestamp:0,f=p?p.sourceURL:c,g=(0,U.j)("img",{alt:o||a,key:`media-${l}-${i}-${s}-${m}`,src:f});return(h?(0,U.j)("a",{title:a,href:h,rel:u,target:d},g):null)||g}renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return(0,U.j)("div",{key:`media-${e.type}-${t}-${i}`,bind:this,class:Xi,afterCreate:this._getChartDependencies})}renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this.renderImageMediaInfo(e):-1!==e.type.indexOf("chart")?this.renderChartMediaInfo(e):null:null}renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel,t=e.title?(0,U.j)("div",{key:"media-title",class:Gi,innerHTML:e.title}):null,i=e.caption?(0,U.j)("div",{key:"media-caption",class:Wi,innerHTML:e.caption}):null;return(0,U.j)("div",{key:"media-container",class:zi},(0,U.j)("div",{key:"media-item-container",class:Bi},this.renderMediaInfoType()),t,i)}renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,s=t?this.classes(Qi,Ui):this.classes(Qi,$i),n=t?this.classes(Ji,Hi,es):this.classes(Ji,Ki,ts),r=t?this.classes(Ji,qi,ts):this.classes(Ji,Yi,es),o=t?"media-previous":"media-next",a=t?this._previous:this._next;return(0,U.j)("button",{type:"button",key:o,title:i,"aria-label":i,tabIndex:0,class:s,bind:this,onclick:a},(0,U.j)("span",{"aria-hidden":"true",class:n}),(0,U.j)("span",{"aria-hidden":"true",class:r}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}async _getChartDependencies(e){const t=await async function(e=(0,Li.Kd)()){if(e=Ri(e),Di&&e===ji)return Di;Di=Promise.all([i.e(8192),i.e(9351)]).then(i.bind(i,20182)).then((function(e){return e.i})),ji=e;try{const[t,i]=await Promise.all([Di,Oi.get(ji)()]);ji===e&&(t.am4core.options.defaultLocale=i.default),t.am4core.options.suppressWarnings=!0,t.am4core.options.autoDispose=!0}catch{return Di=null,ji=null,null}return Di}(),{activeMediaInfo:s}=this.viewModel;this._renderChart({chartDiv:e,mediaInfo:s,chartsModule:t})}_handleMediaKeyup(e){const t=(0,j.kK)(e);"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_renderChart(e){const{chartsModule:t,chartDiv:i,mediaInfo:s}=e,{value:n,type:r}=s,{am4core:o}=t,a=function(e,t="default"){const i=Fi.find((e=>e.name===t));return i?i.colors.map((t=>e.color(t))):null}(o);(0,z.$o)()&&o.useTheme(t.am4themes_dark),o.useTheme(t.am4themes_animated),o.useTheme((function(e){e instanceof o.C
1olorSet&&a&&(e.list=a)}));const l="pie-chart"===r?this._createPieChart(e):this._createXYChart(e);i.setAttribute("aria-label",s.altText||s.title),l.data=n.series.map((e=>({tooltip:e.tooltip,value:e.value}))).filter((e=>"pie-chart"!==r||e.value>0))}_customizeChartTooltip(e,t){e.label.wrap=!0,e.label.maxWidth=200,e.autoTextColor=!1,e.getFillFromObject=!1,e.label.fill=t.color("#ffffff"),e.background.fill=t.color({r:0,g:0,b:0,a:.7})}_createPieChart(e){const{chartDiv:t,chartsModule:i}=e,{am4core:s,am4charts:n}=i,r=s.create(t,n.PieChart);r.rtl=(0,z.dZ)();const o=r.series.push(new n.PieSeries);return o.labels.template.disabled=!0,o.ticks.template.disabled=!0,o.dataFields.value="value",o.dataFields.category="tooltip",this._customizeChartTooltip(o.tooltip,s),r}_getMinSeriesValue(e){let t=0;return e.forEach((e=>t=Math.min(e.value,t))),t}_createColumnChart(e,t){const{chartsModule:i,mediaInfo:s}=t,{value:n}=s,{am4core:r,am4charts:o}=i,a=e.xAxes.push(new o.CategoryAxis);a.dataFields.category="tooltip",a.renderer.labels.template.disabled=!0,this._customizeChartTooltip(a.tooltip,r),a.tooltip.events.on("sizechanged",(()=>{a.tooltip.dy=-a.tooltip.contentHeight}));const l=e.yAxes.push(new o.ValueAxis),c=l.renderer.labels.template;l.renderer.minLabelPosition=is,l.renderer.maxLabelPosition=ss,l.min=this._getMinSeriesValue(n.series),this._customizeChartTooltip(l.tooltip,r),c.wrap=!0;const h=e.series.push(new o.ColumnSeries);h.dataFields.valueY="value",h.dataFields.categoryX="tooltip",e.cursor=new o.XYCursor,
1n.series.length>15&&(e.scrollbarX=new r.Scrollbar)}_createBarChart(e,t){const{chartsModule:i,mediaInfo:s}=t,{value:n}=s,{am4core:r,am4charts:o}=i,a=e.yAxes.push(new o.CategoryAxis);a.dataFields.category="tooltip",a.renderer.inversed=!0,a.renderer.labels.template.disabled=!0,this._customizeChartTooltip(a.tooltip,r),a.tooltip.events.on("sizechanged",(()=>{a.tooltip.dx=a.tooltip.contentWidth}));const l=e.xAxes.push(new o.ValueAxis),c=l.renderer.labels.template;l.renderer.minLabelPosition=is,l.renderer.maxLabelPosition=ss,l.min=this._getMinSeriesValue(n.series),this._customizeChartTooltip(l.tooltip,r),c.wrap=!0;const h=e.series.push(new o.ColumnSeries);h.dataFields.valueX="value",h.dataFields.categoryY="tooltip",e.cursor=new o.XYCursor,n.series.length>15&&(e.scrollbarY=new r.Scrollbar)}_createLineChart(e,t){const{chartsModule:i,mediaInfo:s}=t,{value:n}=s,{am4core:r,am4charts:o}=i,a=e.xAxes.push(new o.CategoryAxis);a.dataFields.category="tooltip",a.renderer.labels.template.disabled=!0,this._customizeChartTooltip(a.tooltip,r),a.tooltip.events.on("sizechanged",(()=>{a.tooltip.dy=-a.tooltip.contentHeight}));const l=e.yAxes.push(new o.ValueAxis),c=l.renderer.labels.template;l.renderer.minLabelPosition=is,l.renderer.maxLabelPosition=ss,l.min=this._getMinSeriesValue(n.series),this._customizeChartTooltip(l.tooltip,r),c.wrap=!0;const h=e.series.push(new o.LineSeries);h.dataFields.categoryX="tooltip",h.dataFields.valueY="value",e.cursor=new o.XYCursor,
1n.series.length>15&&(e.scrollbarX=new r.Scrollbar)}_createXYChart(e){const{chartDiv:t,chartsModule:i,mediaInfo:s}=e,{type:n}=s,{am4core:r,am4charts:o}=i,a=r.create(t,o.XYChart);return a.rtl=(0,z.dZ)(),"column-chart"===n&&this._createColumnChart(a,e),"bar-chart"===n&&this._createBarChart(a,e),"line-chart"===n&&this._createLineChart(a,e),a}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:this._getImageSource(e,t)},this.scheduleRender()}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e&&"image"===e.type&&e.refreshInterval&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e;if(!t)return;const s=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const n=setInterval((()=>{this._updateMediaInfoTimestamp(i.sourceURL)}),s);this._refreshTimer=n}_getImageSource(e,t){const i=-1!==e.indexOf("?")?"&":"?",[s,n=""]=e.split("#");return`${s}${i}timestamp=${t}${n?"#":""}${n}`}};(0,n._)([(0,O.B)("viewModel.attributes")],ns.prototype,"attributes",void 0),(0,n._)([(0,O.B)("viewModel.activeMediaInfoIndex")],ns.prototype,"activeMediaInfoIndex",void 0),(0,n._)([(0,O.B)("viewModel.description")],ns.prototype,"description",void 0),(0,n._)([(0,O.B)("viewModel.fieldInfoMap")],ns.prototype,"fieldInfoMap",void 0),(0,n._)([(0,O.B)("viewModel.layer")],ns.prototype,"layer",void 0),(0,n._)([(0,O.B)("viewModel.mediaInfos")],ns.prototype,"mediaInfos",void 0),(0,n._)([(0,O.B)("viewModel.popupTemplate")],ns.prototype,"popupTemplate",void 0),(0,n._)([(0,O.B)("viewModel.relatedInfos")],ns.prototype,"relatedInfos",void 0),(0,n._)([(0,O.B)("viewModel.title")],ns.prototype,"title",void 0),(0,n._)([(0,l.Cb)({type:Pi})],ns.prototype,"viewModel",void 0),(0,n._)([(0,l.Cb)(),(0,W.H)("esri/widgets/Feature/t9n/Feature")],ns.prototype,"messages",void 0),ns=(0,n._)([(0,c.j)("esri.widgets.Feature.FeatureMedia")],ns);var rs=ns,os=i(58106),as=i(26273);const ls=["$datastore","$map","$layer","$aggregatedfeatures"],cs=a.Z.getLogger("esri.widgets.Feature.support.arcadeFeatureUtils");async function hs({graphic:e,view:t}){const{isAggregate:i,layer:s}=e;if(!i||!s||"2d"!==(null==t?void 0:t.type))return[];const n=await t.whenLayerView(s);if(!n.createQuery||!n.queryFeatures)return[];const r=n.createQuery();r.aggregateIds=[e.getObjectId()];const{features:o}=await n.queryFeatures(r);return o}async function ds({expressionAttributes:e,info:t,arcadeUtils:i,spatialReference:s,map:n,graphic:r,view:o}){const a=`expression/${t.name}`,l=i.createSyntaxTree(t.expression),c=ls.filter((e=>i.hasVariable(l,e)));await i.loadScriptDependencies(l,!0,c);const h=i.getViewInfo({spatialReference:s}),d=i.createExecContext(r,h);d.useAsync=!0,function({aggregatedFeatures:e,arcadeUtils:t,featureSetVars:i,context:s,viewInfo:n,map:r,graphic:o}){i.forEach((i=>{const a=i.toLowerCase(),l={map:r,spatialReference:n.sr};if("$map"===a&&(s.vars[a]=t.convertMapToFeatureSetCollection(l)),"$layer"===a&&(s.vars[a]=t.convertFeatureLayerToFeatureSet(o.sourceLayer,n.sr)),"$datastore"===a&&(s.vars[a]=t.convertServiceUrlToWorkspace(o.sourceLayer.url,n.sr)),"$aggregatedfeatures"===a){const i=o.layer,{fields:r,objectIdField:l,geometryType:c,spatialReference:h,displayField:d}=i,u=new as.default({fields:r,objectIdField:l,geometryType:c,spatialReference:h,displayField:d,..."feature"===i.type?{templates:i.templates,typeIdField:i.typeIdField,types:i.types}:null,source:e});s.vars[a]=t.convertFeatureLayerToFeatureSet(u,n.sr)}}))}({aggregatedFeatures:await hs({graphic:r,view:o}),arcadeUtils:i,featureSetVars:c,context:d,viewInfo:h,map:n,graphic:r});const u=i.createFunction(l,d),p=await i.executeAsyncFunction(u,d).catch((e=>cs.error("arcade-execution-error",{error:e,graphic:r,expressionInfo:t})));e[a]="string"==typeof p?Fe(Ae(p)):Array.isArray(p)?function(e){return`<ul class="esri-widget__list">${e.map((e=>`<li>${"string"==typeof e?Fe(Ae(e)):e}</li>`)).join("")}</ul>`}(p):p&&"esri.arcade.Dictionary"===p.declaredClass?function(e){return`<table class="esri-widget__table">${e.keys().map((t=>{const i=e.field(t);return`<tr><th>${t}</th><td>${"string"==typeof i?Fe(Ae(i)):i}</td></tr>`})).join("")}</table>`}
1(p):p}async function us({popupTemplate:e,spatialReference:t,graphic:s,map:n,view:r}){const o=e.expressionInfos,a=[],l={};if(!o||!o.length)return l;const c=await Promise.all([i.e(9351),i.e(4799)]).then(i.bind(i,44799));for(const i of o)a.push(ds({expressionAttributes:l,info:i,arcadeUtils:c,spatialReference:t,map:n,graphic:s,view:r}));return await(0,fi.as)(a),l}const ps="esri.widgets.FeatureViewModel",ms=a.Z.getLogger(ps);let fs=class extends L.Z{constructor(e){super(e),this._handles=new M.Z,this._featureAbortController=null,this.graphicChangedThrottled=(0,N.P)(this.graphicChanged,1,this),this.content=null,this.contentViewModels=[],this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.relatedInfos=new Map,this.title="",this.view=null,this._handles.add((0,m.S1)(this,["graphic","_effectivePopupTemplate"],(()=>this.graphicChangedThrottled())))}destroy(){this._clear(),this._cancelFeatureQuery(),this._handles.destroy(),this._handles=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return(0,o.pC)(this.graphic)?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return function(e,t){const i=new Map;return e&&e.forEach((e=>{const s=we(e.fieldName,t);e.fieldName=s,i.set(s.toLowerCase(),e)})),i}(Ee(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return ge(this.graphic)}set graphic(e){this._set("graphic",e?e.clone():null)}get spatialReference(){return this.get("view.spatialReference")||null}set spatialReference(e){void 0!==e?this._override("spatialReference",e):this._clearOverride("spatialReference")}get map(){return this.get("view.map")||null}set map(e){void 0!==e?this._override("map",e):this._clearOverride("map")}get waitingForContent(){return!!this._featureAbortController}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof Pi&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof Pi&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof Pi&&t.previous()}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async graphicChanged(){this._cancelFeatureQuery(),this._clear();const{graphic:e}=this;if(!e)return;const t=(0,fi.yi)();this._featureAbortController=t;try{await this._queryFeature({signal:t.signal})}catch(i){ms.error("error","error loading popupTemplate for graphic",{error:i,graphic:e})}this._featureAbortController===t&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:e}=this;e&&e.abort(),this._featureAbortController=null}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.map(((e,t)=>"attachments"===e.type?this._compileAttachments(e,t):"custom"===e.type?this._compileCustom(e,t):"fields"===e.type?this._compileFields(e,t):"media"===e.type?this._compileMedia(e,t):"text"===e.type?this._compileText(e,t):void 0)):"string"==typeof e?this._compileText(new os.Z({text:e}),0).text:e}_destroyContentViewModels(){this.contentViewModels.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("contentViewModels",[])}_compileAttachments(e,t){const{graphic:i}=this,{description:s,title:n}=e;return this.contentViewModels[t]=new Zt({graphic:i,...this._compileTitleAndDesc({title:n,description:s})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:s,destroyer:n}=e;return this.contentViewModels[t]=new Kt({graphic:i,creator:s,destroyer:n}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:s,graphic:n,formattedAttributes:r}=this,{attributes:o}=n,a=r.global;return{title:Ie({attributes:o,fieldInfoMap:i,globalAttributes:a,layer:s,text:e}),description:Ie({attributes:o,fieldInfoMap:i,globalAttributes:a,layer:s,text:t})}}_compileFields(e,t){const{_effectivePopupTemplate:i,formattedAttributes:s}=this,n=e.clone(),r=(null==e?void 0:e.fieldInfos)||(null==i?void 0:i.fieldInfos),o=null==i?void 0:i.expressionInfos,a={...s.global,...s.content[t]},{description:l,title:c}=n,h=new ni({attributes:a,expressionInfos:o,fieldInfos:r,...this._compileTitleAndDesc({title:c,description:l})});return this.contentViewModels[t]=h,n.fieldInfos=h.formattedFieldInfos.slice(0),n}_compileMedia(e,t){const{graphic:i,_fieldInfoMap:s,_effectivePopupTemplate:n,relatedInfos:r,_sourceLayer:o}=this,{attributes:a}=i,l=this.formattedAttributes.global,c=e.clone(),{description:h,mediaInfos:d,title:u}=c,p=new Pi({activeMediaInfoIndex:c.activeMediaInfoIndex||0,attributes:a,layer:o,fieldInfoMap:s,formattedAttributes:l,mediaInfos:d,popupTemplate:n,relatedInfos:r,...this._compileTitleAndDesc({title:u,description:h})});return c.mediaInfos=p.formattedMediaInfos.slice(0),this.contentViewModels[t]=p,c}_compileText(e,t){const i=e.clone(),{graphic:s,_fieldInfoMap:n,_sourceLayer:r}=this;if(i&&i.text){const{attributes:e}=s,t=this.formattedAttributes.global;i.text=Ie({attributes:e,fieldInfoMap:n,globalAttributes:t,layer:r,text:i.text})}return this.contentViewModels[t]=new Kt({graphic:s,creator:i.text}),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i}=this;if(!e)return;const{lastEditInfoEnabled:s}=e,n=null==t?void 0:t.editFieldsInfo;return s&&n?function(e,t){const{creatorField:i,creationDateField:s,editorField:n,editDateField:r}=e;if(!t)return;const o=t[r];if("number"==typeof o){const e=t[n];return{type:"edit",date:(0,se.p6)(o,fe),user:e}}const a=t[s];if("number"==typeof a){const e=t[i];return{type:"create",date:(0,se.p6)(a,fe),user:e}}return null}(n,i.attributes):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:s}=this,{attributes:n}=s;return Ie({attributes:n,fieldInfoMap:t,globalAttributes:this.formattedAttributes.global,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return ye(null==e?void 0:e.title,{graphic:t})}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return ye(null==e?void 0:e.content,{graphic:t})}async _queryFeature(e){const{_featureAbortController:t,_sourceLayer:i,graphic:s,_effectivePopupTemplate:n,spatialReference:r,map:o,view:a}=this,{content:{value:l},title:{value:c}}=await(0,fi.as)({content:this._getContent(),title:this._getTitle()});if(t!==this._featureAbortController||!s)return;const{expressionAttributes:{value:h}}=await(0,fi.as)({checkForRelatedFeatures:this._checkForRelatedFeatures(e),expressionAttributes:us({popupTemplate:this._effectivePopupTemplate,spatialReference:r,graphic:s,map:o,view:a}),queryUpdatedFeature:Re({graphic:s,popupTemplate:n,layer:i,spatialReference:r},e)});t===this._featureAbortController&&s&&(this._set("formattedAttributes",this._createFormattedAttributes(l,h)),this._set("title",this._compileTitle(c)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(l)||null))}_createFormattedAttributes(e,t){const{_effectivePopupTemplate:i,graphic:s,relatedInfos:n,_sourceLayer:r,_fieldInfoMap:o}=this,a=null==i?void 0:i.fieldInfos,l={...s.attributes,...t}
1,c={global:Oe({fieldInfos:a,graphic:s,attributes:l,layer:r,fieldInfoMap:o,relatedInfos:n}),content:[]};return Array.isArray(e)&&e.forEach(((e,t)=>{"fields"===e.type&&e.fieldInfos&&(c.content[t]=Oe({fieldInfos:e.fieldInfos,graphic:s,attributes:l,layer:r,fieldInfoMap:o,relatedInfos:n}))})),c}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,Ee(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:s,_sourceLayer:n}=this;s.clear();const r=(0,o.pC)(n.associatedLayer)?await n.associatedLayer.load(i):n;if(!r)return;const a=t.filter((e=>e&&De(e.fieldName)));if(!a||!a.length)return;t.forEach((e=>this._configureRelatedInfo(e,r)));const l=await xi({relatedInfos:s,layer:r},i);Object.keys(l).forEach((e=>{var t;const i=s.get(e.toString()),n=null==(t=l[e])?void 0:t.value;i&&n&&(i.layerInfo=n.data)}));const c=await function({graphic:e,relatedInfos:t,layer:i},s){const n={};return t.forEach(((t,r)=>{t.layerInfo&&(n[r]=Ti(e,t,i,s))})),(0,fi.as)(n)}({graphic:e,relatedInfos:s,layer:r},i);Object.keys(c).forEach((e=>{var t;!function(e,t){if(!t)return;if(!e)return;const{features:i,statsFeatures:s}=e,n=i&&i.value;t.relatedFeatures=n?n.features:[];const r=s&&s.value;t.relatedStatsFeatures=r?r.features:[]}(null==(t=c[e])?void 0:t.value,s.get(e.toString()))}))}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,s=Mi(e.fieldName);if(!s)return;const{layerId:n,fieldName:r}=s;if(!n)return;const o=i.get(n.toString())||Ii(n,t);o&&(function({relatedInfo:e,fieldName:t,fieldInfo:i}){if(e.relatedFields.push(t),i.statisticType){const s=new yi.Z({statisticType:i.statisticType,onStatisticField:t,outStatisticFieldName:t});e.outStatistics.push(s)}}({relatedInfo:o,fieldName:r,fieldInfo:e}),this.relatedInfos.set(n,o))}};(0,n._)([(0,l.Cb)()],fs.prototype,"_featureAbortController",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],fs.prototype,"_effectivePopupTemplate",null),(0,n._)([(0,l.Cb)({readOnly:!0})],fs.prototype,"_fieldInfoMap",null),(0,n._)([(0,l.Cb)({readOnly:!0})],fs.prototype,"_sourceLayer",null),(0,n._)([(0,l.Cb)({readOnly:!0})],fs.prototype,"content",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],fs.prototype,"contentViewModels",void 0),(0,n._)([(0,l.Cb)({type:Boolean})],fs.prototype,"defaultPopupTemplateEnabled",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],fs.prototype,"formattedAttributes",void 0),(0,n._)([(0,l.Cb)({type:u.Z,value:null})],fs.prototype,"graphic",null),(0,n._)([(0,l.Cb)({readOnly:!0})],fs.prototype,"lastEditInfo",void 0),(0,n._)([(0,l.Cb)()],fs.prototype,"relatedInfos",void 0),(0,n._)([(0,l.Cb)()],fs.prototype,"spatialReference",null),(0,n._)([(0,l.Cb)({readOnly:!0})],fs.prototype,"title",void 0),(0,n._)([(0,l.Cb)()],fs.prototype,"map",null),(0,n._)([(0,l.Cb)({readOnly:!0})],fs.prototype,"waitingForContent",null),(0,n._)([(0,l.Cb)()],fs.prototype,"view",void 0),fs=(0,n._)([(0,c.j)(ps)],fs);var gs=fs;const ys="esri-icon-loading-indicator esri-rotating",vs="esri-widget",_s="esri-feature",bs="esri-feature__size-container",ws="esri-feature__title",Cs="esri-feature__main-container",Ms="esri-feature__content-element",Is="esri-feature__text",Ts="esri-feature__last-edited-info",xs="esri-feature__loading-container",ks="esri-feature__loading-spinner",Ss={title:!0,content:!0,lastEditedInfo:!0};let Ps=class extends($(H.Z)){constructor(e,t){super(e,t),this._contentWidgets=[],this.graphic=null,this.defaultPopupTemplateEnabled=!1,this.label=void 0,this.messages=null,this.messagesURIUtils=null,this.spatialReference=null,this.title=null,this.visibleElements={...Ss},this.map=null,this.view=null,this.viewModel=new gs}initialize(){this.own((0,m.S1)(this,"viewModel.contentViewModels",(()=>this._setupContentWidgets())))}destroy(){this._destroyContentWidgets()}castVisibleElements(e){return{...Ss,...e}}render(){const{waitingForContent:e}=this.viewModel;return(0,U.j)("div",{class:this.classes(_s,vs)},(0,U.j)("div",{class:bs},this.renderTitle(),e?this.renderLoading():this.renderContentContainer()))}setActiveMedia(e,t){this.viewModel.setActiveMedia(e,t)}nextMedia(e){this.viewModel.nextMedia(e)}previousMedia(e){this.viewModel.previousMedia(e)}
1renderLoading(){return(0,U.j)("div",{key:"loading-container",class:xs},(0,U.j)("span",{class:this.classes(ys,ks)}))}renderContentContainer(){const{visibleElements:e}=this;return e.content?(0,U.j)("div",{class:Cs},[this.renderContent(),this.renderLastEditInfo()]):null}renderTitle(){const{visibleElements:e,title:t}=this;return e.title?(0,U.j)("h4",{class:ws,innerHTML:t}):null}renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?(0,U.j)("div",{key:`${t}-content-elements`},e.map(this.renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:(0,U.j)("div",{key:`${t}-content`},e.render())}return this.renderNodeContent(e)}renderContentElement(e,t){const{visibleElements:i}=this;if("boolean"!=typeof i.content&&!i.content[e.type])return null;switch(e.type){case"attachments":return this.renderAttachments(t);case"custom":return this.renderCustom(e,t);case"fields":return this.renderFields(t);case"media":return this.renderMedia(t);case"text":return this.renderText(e,t);default:return null}}renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:i,attachmentInfos:s}=t.viewModel;return"loading"===i||s.length>0?(0,U.j)("div",{key:this._buildKey("attachments-element",e),class:this.classes(Ms)},t.render()):null}renderCustom(e,t){const{creator:i}=e,s=this._contentWidgets[t];return!s||s.destroyed?null:i?(0,U.j)("div",{key:this._buildKey("custom-element",t),class:Ms},s.render()):null}renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:(0,U.j)("div",{key:this._buildKey("fields-element",e),class:Ms},t.render())}renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:(0,U.j)("div",{key:this._buildKey("media-element",e),class:Ms},t.render())}renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:i}=this.viewModel;if(!i||!e.lastEditedInfo)return null;const{date:s,user:n}=i,r="edit"===i.type?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,o=(0,Z.n)(r,{date:s,user:n});return(0,U.j)("div",{key:"edit-info-element",class:this.classes(Ts,Ms)},o)}renderText(e,t){const i=e.text,s=this._contentWidgets[t];return!s||s.destroyed?null:i?(0,U.j)("div",{key:this._buildKey("text-element",t),class:this.classes(Ms,Is)},s.render()):null}_buildKey(e,...t){return`${e}__${this.get("viewModel.graphic.uid")||"0"}-${t.join("-")}`}_destroyContentWidgets(){this._contentWidgets.forEach((e=>{e.viewModel=null,e&&!e.destroyed&&e.destroy()})),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const e=this.get("viewModel.content"),{contentViewModels:t}=this.viewModel;if(Array.isArray(e))e.forEach(((e,i)=>{"attachments"===e.type&&(this._contentWidgets[i]=new qt({displayType:e.displayType,viewModel:t[i]})),"fields"===e.type&&(this._contentWidgets[i]=new pi({viewModel:t[i]})),"media"===e.type&&(this._contentWidgets[i]=new rs({viewModel:t[i]})),"text"===e.type&&(this._contentWidgets[i]=new ei({viewModel:t[i]})),"custom"===e.type&&(this._contentWidgets[i]=new ei({viewModel:t[i]}))}),this);else{const e=t[0];e&&!e.destroyed&&(this._contentWidgets[0]=new ei({viewModel:e}))}this.scheduleRender()}};(0,n._)([(0,O.B)("viewModel.graphic")],Ps.prototype,"graphic",void 0),(0,n._)([(0,O.B)("viewModel.defaultPopupTemplateEnabled")],Ps.prototype,"defaultPopupTemplateEnabled",void 0),(0,n._)([(0,l.Cb)({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],Ps.prototype,"label",void 0),(0,n._)([(0,l.Cb)(),(0,W.H)("esri/widgets/Feature/t9n/Feature")],Ps.prototype,"messages",void 0),(0,n._)([(0,l.Cb)(),(0,W.H)("esri/widgets/support/t9n/uriUtils")],Ps.prototype,"messagesURIUtils",void 0),(0,n._)([(0,O.B)("viewModel.spatialReference")],Ps.prototype,"spatialReference",void 0),(0,n._)([(0,O.B)("viewModel.title")],Ps.prototype,"title",void 0),(0,n._)([(0,l.Cb)()],Ps.prototype,"visibleElements",void 0),(0,n._)([(0,R.p)("visibleElements")],Ps.prototype,"castVisibleElements",null),(0,n._)([(0,O.B)("viewModel.map")],Ps.prototype,"map",void 0),(0,n._)([(0,O.B)("viewModel.view")],Ps.prototype,"view",void 0),(0,n._)([(0,l.Cb)({type:gs})],Ps.prototype,"viewModel",void 0),Ps=(0,n._)([(0,c.j)("esri.widgets.Feature")],Ps);var Ls=Ps,Es=i(31355);
1let As=class extends Es.Z.EventedAccessor{constructor(e){super(e),this._anchorHandles=new M.Z,this.location=null,this.screenLocation=null,this.screenLocationEnabled=!1,this.view=null,this._anchorHandles.add([(0,m.YP)(this,["screenLocationEnabled","location","view.size","view.stationary"],(()=>this._updateScreenPointAndHandle())),(0,m.YP)(this,["view","view.ready"],(()=>this._wireUpView()))])}destroy(){this.view=null,this._anchorHandles&&this._anchorHandles.destroy(),this._anchorHandles=null,this._viewpointHandle=null}_wireUpView(){const e="view";if(this._anchorHandles.remove(e),this._viewpointHandle=null,!this.get("view.ready"))return;this._setScreenLocation();const{view:t}=this,i="3d"===t.type?"camera":"viewpoint",s=(0,m.Wy)(t,i,(()=>this._viewpointChange()));this._anchorHandles.add(s,e),this._viewpointHandle=s,this._toggleWatchingViewpoint()}_viewpointChange(){this._setScreenLocation(),this.emit("view-change")}_updateScreenPointAndHandle(){this._setScreenLocation(),this._toggleWatchingViewpoint()}_toggleWatchingViewpoint(){const{_viewpointHandle:e,location:t,screenLocationEnabled:i}=this;e&&(t&&i?e.resume():e.pause())}_setScreenLocation(){const{location:e,view:t,screenLocationEnabled:i}=this,s=this.get("view.ready"),n=i&&s&&(0,o.pC)(e)?t.toScreen(e):null;this._set("screenLocation",n)}};(0,n._)([(0,l.Cb)()],As.prototype,"location",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],As.prototype,"screenLocation",void 0),(0,n._)([(0,l.Cb)()],As.prototype,"screenLocationEnabled",void 0),(0,n._)([(0,l.Cb)()],As.prototype,"view",void 0),As=(0,n._)([(0,c.j)("esri.widgets.support.AnchorElementViewModel")],As);var Fs=As;let Vs=class extends Fs{constructor(e){super(e),this.visible=!1}};(0,n._)([(0,l.Cb)()],Vs.prototype,"visible",void 0),Vs=(0,n._)([(0,c.j)("esri.widgets.CompassViewModel")],Vs);var Os=Vs;const Rs="esri-spinner",Ds="esri-spinner--start",js="esri-spinner--finish";let Zs=class extends H.Z{constructor(e,t){super(e,t),this._animationDelay=500,this._animationPromise=null,this.location=null,this.view=null,this.viewModel=new Os,this.visible=!1}initialize(){this.own([(0,m.YP)(this,"visible",(e=>this._visibleChange(e)))])}destroy(){this._animationPromise=null}show(e){const{location:t,promise:i}=e;t&&(this.viewModel.location=t),this.visible=!0;i&&i.catch((()=>{})).then((()=>this.hide()))}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:t}=this.viewModel,i=!!t,s={[Ds]:e&&i,[js]:!e&&i},n=this._getPositionStyles();return(0,U.j)("div",{class:this.classes(Rs,s),styles:n})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const t=(0,fi.e4)(this._animationDelay);this._animationPromise=t,t.catch((()=>{})).then((()=>{this._animationPromise===t&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)}))}_getPositionStyles(){const{screenLocation:e,view:t}=this.viewModel;if(!t||(0,o.Wi)(e))return{};const{padding:i}=t;return{left:e.x-i.left+"px",top:e.y-i.top+"px"}}};(0,n._)([(0,O.B)("viewModel.location")],Zs.prototype,"location",void 0),(0,n._)([(0,O.B)("viewModel.view")],Zs.prototype,"view",void 0),(0,n._)([(0,l.Cb)({type:Os})],Zs.prototype,"viewModel",void 0),(0,n._)([(0,O.B)("viewModel.visible")],Zs.prototype,"visible",void 0),Zs=(0,n._)([(0,c.j)("esri.widgets.Spinner")],Zs);var Ns=Zs,zs=i(39536),Bs=i(86566),Gs=(i(91957),i(83258)),Ws=i(97837),Us=i(15600),Hs=i(43411),qs=(i(79185),i(76136)),$s=i(30879),Ks=i(59672);function Ys(e){return e&&"opacity"in e?e.opacity*Ys(e.parent):1}var Xs=i(58713);const Qs=(0,r.Z)("mac")?"Meta":"Ctrl",Js={8:"Backspace",9:"Tab",13:"Enter",27:"Escape",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete"};for(let Ad=48;Ad<58;Ad++)Js[Ad]=String.fromCharCode(Ad);for(let Ad=1;Ad<25;Ad++)Js[111+Ad]=`F${Ad}`;for(let Ad=65;Ad<91;Ad++)Js[Ad]=[String.fromCharCode(Ad+32),String.fromCharCode(Ad)];function en(e){switch(e){case"Ctrl":case"Alt":case"Shift":case"Meta":case"Primary":return!0}return!1}class tn{constructor(e,t=[]){this.eventType=e,this.keyModifiers=t}matches(e){if(e.type!==this.eventType)return!1;if(0===this.keyModifiers.length)return!0;const t=e.modifiers;for(const i of this.keyModifiers)if(!t.has(i))return!1;return!0}}const sn=a.Z.getLogger("esri.views.input.InputHandler");class nn{constructor(e){this._manager=null,this._incoming={},this._outgoing={},this._incomingEventMatches=null,this._incomingEventTypes=null,this._outgoingEventTypes=null,this._hasSideEffects=e}get incomingEventMatches(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(const e in this._incoming){const t=this._incoming[e];for(const e of t)this._incomingEventMatches.push(e.match)}}return this._incomingEventMatches}get incomingEventTypes(){return this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map((e=>e.eventType))),this._incomingEventTypes}get outgoingEventTypes(){return this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing)),this._outgoingEventTypes}get hasSideEffects(){return this._hasSideEffects}get hasPendingInputs(){return!1}onInstall(e){this._manager?sn.error("This InputHandler has already been registered with an InputManager"):(e.setEventCallback((e=>this._handleEvent(e))),e.setUninstallCallback((()=>this._onUninstall())),this._manager=e)}onUninstall(){}registerIncoming(e,t,i){let s;"function"==typeof t?(i=t,s=[]):s=t||[];const n="string"==typeof e?new tn(e,s):e,r=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},o=e=>{const t=this._incoming[e.match.eventType];
1if(t){const i=t.indexOf(e);t.splice(i,1),r(),this._manager&&this._manager.updateDependencies()}},a=new rn(n,i,{onPause:o,onRemove:o,onResume:e=>{const t=this._incoming[e.match.eventType];t&&-1===t.indexOf(e)&&(t.push(e),r(),this._manager&&this._manager.updateDependencies())}});let l=this._incoming[n.eventType];return l||(l=[],this._incoming[n.eventType]=l),l.push(a),r(),this._manager&&this._manager.updateDependencies(),a}registerOutgoing(e){if(this._outgoing[e])throw Error("There is already a callback registered for this outgoing InputEvent: "+e);const t=new on(e,{onEmit:(e,t,i,s)=>{this._manager.emit(e.eventType,t,i,s)},onRemove:e=>{delete this._outgoing[e.eventType],this._manager.updateDependencies()}});return this._outgoing[e]=t,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),t}startCapturingPointer(e){this._manager.setPointerCapture(e,!0)}stopCapturingPointer(e){this._manager.setPointerCapture(e,!1)}refreshHasPendingInputs(){this._manager.refreshHasPendingInputs()}_onUninstall(){this._manager?(this.onUninstall(),this._manager=null):sn.error("This InputHandler is not registered with an InputManager")}_handleEvent(e){const t=this._incoming[e.type];if(t)for(const i of t)if(i.match.matches(e)&&(i.callback(e),e.shouldStopPropagation()))break}}class rn{constructor(e,t,i){this.match=e,this._callback=t,this._handler=i}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}}class on{constructor(e,t){this.eventType=e,this._removed=!1,this._handler=t}emit(e,t,i){this._removed||this._handler.onEmit(this,e,t,i)}remove(){this._removed=!0,this._handler.onRemove(this)}}class an extends nn{constructor(e){super(!0),this._onChange=e,this._value="mouse",this.registerIncoming("pointer-down",(e=>{const t="touch"===e.data.native.pointerType;this._setValue(t?"touch":"mouse")})),this._moveHandler=this.registerIncoming("pointer-move",(e=>{const t="touch"===e.data.native.pointerType;this._setValue(t?"touch":"mouse")})),this._moveHandler.pause()}_setValue(e){e!==this._value&&("touch"===e?this._moveHandler.resume():this._moveHandler.pause(),this._value=e,this._onChange(e))}}const ln=a.Z.getLogger("esri.views.input.InputManager");let cn=class extends L.Z{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._currentPropagation=null,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=Qs,this.latestPointerType="mouse",this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const e=Object.keys(this._nameToGroup);for(const t of e)this.uninstallHandlers(t);this.eventSource=null,this._currentPropagation=null}get hasPendingInputs(){return this._handlers.some((e=>e.handler.hasPendingInputs))}installHandlers(e,t,i=dn.INTERNAL){if(this._nameToGroup[e])return void ln.error("There is already an InputHandler group registered under the name `"+e+"`");if(0===t.length)return void ln.error("Can't register a group of zero handlers");const s={name:e,handlers:t.map((e=>({handler:e,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null})))};this._nameToGroup[e]=s;for(let n=s.handlers.length-1;n>=0;n--){const e=s.handlers[n];this._handlers.push(e),e.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(t,i,s,n,r)=>{this._emitInputEvent(e.priorityIndex+1,t,i,s,r,n)},setPointerCapture:(t,i)=>{this._setPointerCapture(s,e,t,i)},setEventCallback:t=>{e.eventCallback=t},setUninstallCallback:t=>{e.uninstallCallback=t},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(e){const t=this._nameToGroup[e];t?(t.handlers.forEach((e=>{e.removed=!0,e.uninstallCallback()})),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):ln.error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return void 0!==this._nameToGroup[e]}updateDependencies(){const e=new Set,t=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const e=this._handlers[i];e.priorityIndex=i,this._handlersPriority.push(e)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const s=this._handlersPriority[i];s.priorityIndex=i;let n=s.handler.hasSideEffects;if(!n)for(const t of s.handler.outgoingEventTypes)if(e.has(t)){n=!0;break}if(n)for(const i of s.handler.incomingEventMatches){e.add(i.eventType);for(const e of i.keyModifiers)en(e)||t.add(e)}s.active=n}this._sourceEvents=e,this._keyModifiers=t,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointerType(e){this._set("latestPointerType",e)}_onEventReceived(e,t){if("pointer-capture-lost"===e){const e=t;this._pointerCaptures.delete(e.native.pointerId)}this._updateKeyModifiers(e,t);const i=null!=this.test.timestamp?this.test.timestamp:t.native?t.native.timestamp:void 0,s=t.native?t.native.cancelable:void 0;this._emitInputEventFromSource(e,t,i,s)}_updateKeyModifiers(e,t){if(!t)return;let i=!1;const s=()=>
1{if(!i){const e=new Set;this._activeKeyModifiers.forEach((t=>{e.add(t)})),this._activeKeyModifiers=e,i=!0}},n=(e,t)=>{t&&!this._activeKeyModifiers.has(e)?(s(),this._activeKeyModifiers.add(e)):!t&&this._activeKeyModifiers.has(e)&&(s(),this._activeKeyModifiers.delete(e))};if("key-down"===e||"key-up"===e){const i=t.key;this._keyModifiers.has(i)&&n(i,"key-down"===e)}const r=t.native;n("Alt",!(!r||!r.altKey)),n("Ctrl",!(!r||!r.ctrlKey)),n("Shift",!(!r||!r.shiftKey)),n("Meta",!(!r||!r.metaKey)),n("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerTypeHandler=new an((e=>this._setLatestPointerType(e))),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,dn.INTERNAL),this.installHandlers("input-manager-logic",[this._latestPointerTypeHandler],dn.INTERNAL)}_setPointerCapture(e,t,i,s){const n=e.name+"-"+t.priorityIndex,r=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,r),s?(r.add(n),1===r.size&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):r.has(n)&&(r.delete(n),0===r.size&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter((e=>!e.removed)),this.updateDependencies()}_emitInputEventFromSource(e,t,i,s){this._emitInputEvent(0,e,t,i,s)}_emitInputEvent(e,t,i,s,n,r){const o=void 0!==s?s:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),a=void 0!==n&&n,l={event:new hn(t,i,o,r||this._activeKeyModifiers,a),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(l):this._doNewPropagation(l)}_doNewPropagation(e){this._currentPropagation={events:new Xs.Z,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){const e=this._currentPropagation;if(e){for(;this._currentPropagation.events.length>0;){const{event:t,priorityIndex:i}=this._currentPropagation.events.pop(),s=t.data&&t.data.eventId;if(null==s||!this._stoppedPropagationEventIds.has(s))for(e.currentHandler=this._handlersPriority[i];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!t.shouldStopPropagation()&&e.currentHandler.eventCallback(t),t.shouldStopPropagation()){null!=s&&this._stoppedPropagationEventIds.add(s);break}if(t.shouldPausePropagation((()=>this._continuePropagation())))return void this._pausePropagation({event:t,priorityIndex:e.currentHandler.priorityIndex+1})}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null}}_pausePropagation(e){const t=new Xs.Z;for(t.push(e);this._currentPropagation.events.length;)t.push(this._currentPropagation.events.pop());this._currentPropagation.events=t,this._currentPropagation.currentHandler=null}_compareHandlerPriority(e,t){if(e.handler.hasSideEffects!==t.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==t.groupPriority)return e.groupPriority>t.groupPriority?-1:1;for(const i of e.handler.incomingEventMatches)for(const e of t.handler.incomingEventMatches){if(i.eventType!==e.eventType)continue;const t=i.keyModifiers.filter((t=>-1!==e.keyModifiers.indexOf(t)));if(t.length===i.keyModifiers.length!==(t.length===e.keyModifiers.length))return i.keyModifiers.length>e.keyModifiers.length?-1:1}return e.priorityIndex>t.priorityIndex?-1:1}_sortHandlersPriority(e){const t=[];for(const i of e){let e=0;for(;e<t.length&&this._compareHandlerPriority(i,t[e])>=0;)e++;t.splice(e,0,i)}return t}get debug(){const e=e=>{const t=this._setPointerCapture;this._setPointerCapture=()=>{},e(),this._setPointerCapture=t};return{injectEvent:(t,i)=>{e((()=>{this._onEventReceived(t,i)}))},disablePointerCapture:e}}};(0,n._)([(0,l.Cb)({readOnly:!0})],cn.prototype,"hasPendingInputs",null),(0,n._)([(0,l.Cb)()],cn.prototype,"eventSource",void 0),(0,n._)([(0,l.Cb)()],cn.prototype,"recognizers",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],cn.prototype,"latestPointerType",void 0),cn=(0,n._)([(0,c.j)("esri.views.input.InputManager")],cn);class hn{constructor(e,t,i,s,n){this.type=e,this.data=t,this.timestamp=i,this.modifiers=s,this.cancelable=n,this._propagationState=0,this._resumeCallback=null}stopPropagation(){this._propagationState|=1}shouldStopPropagation(){return 0!=(1&this._propagationState)}async(e){this._propagationState|=2;const t=(e,t)=>{this._propagationState&=-3;const i=this._resumeCallback;if(this._resumeCallback=null,i&&i(),t)throw e;return e};return("function"==typeof e?e():e).then((e=>t(e,!1)),(e=>t(e,!0)))}
1shouldPausePropagation(e){return!!(2&this._propagationState)&&(this._resumeCallback=e,!0)}preventDefault(){this.data.native.preventDefault()}}const dn={DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};const un="esri-icon-zoom-in-magnifying-glass",pn="esri-icon-trash",mn="esri-icon-table",fn=new Ws.Z({id:"zoom-to-feature",title:"{messages.zoom}",className:un}),gn=new Ws.Z({id:"remove-selected-feature",title:"{messages.remove}",className:pn}),yn=new Ws.Z({id:"zoom-to-clustered-features",title:"{messages.zoom}",className:un}),vn=new Ws.Z({id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:mn}),_n=a.Z.getLogger("esri.widgets.Popup.PopupViewModel"),bn=function(e){const{event:t,view:i}=e,{action:s}=t,n=i&&i.popup;if(!s)return Promise.reject(new h.Z("trigger-action:missing-arguments","Event has no action"));if(!n)return Promise.reject(new h.Z("trigger-action:missing-arguments","view.popup is missing"));const{disabled:r,id:o}=s;if(!o)return Promise.reject(new h.Z("trigger-action:invalid-action","action.id is missing"));if(r)return Promise.reject(new h.Z("trigger-action:invalid-action","Action is disabled"));if(o===fn.id)return async function(e){const{location:t,selectedFeature:i,view:s,zoomFactor:n}=e,r=wn(e);if(!r){const e=new h.Z("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:r,view:s});return _n.error(e),Promise.reject(e)}const o=s.scale/n,a=e.get("selectedFeature.geometry")||t,l=a&&"point"===a.type&&function(e,t){if("3d"!==(null==t?void 0:t.type)||!e||"esri.Graphic"!==e.declaredClass)return!0;const i=t.getViewForGraphic(e);if(i&&"whenGraphicBounds"in i){let t=!1;return i.whenGraphicBounds(e,{useViewElevation:!0}).then((e=>{t=!e||!e.boundingBox||e.boundingBox[0]===e.boundingBox[3]&&e.boundingBox[1]===e.boundingBox[4]&&e.boundingBox[2]===e.boundingBox[5]})).catch((()=>{const t=new h.Z("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:e});_n.error(t)})),t}return!0}(i,s);fn.active=!0,fn.disabled=!0,await e.view.goTo({target:r,scale:l?o:void 0}),fn.active=!1,fn.disabled=!1,e.zoomToLocation=null,l&&(e.location=a)}(n.viewModel);if(o===yn.id)return async function(e){const{selectedFeature:t,view:i}=e;if("2d"!==(null==i?void 0:i.type)){const e=new h.Z("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw _n.error(e),e}if(!t.isAggregate){const e=new h.Z("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:t});throw _n.error(e),e}const s=t.sourceLayer,n=await i.whenLayerView(s),r=n.createQuery();r.aggregateIds=[t.getObjectId()],yn.active=!0,yn.disabled=!0;const{extent:o}=await n.queryExtent(r);await i.goTo({target:o}),yn.active=!1,yn.disabled=!1}(n.viewModel);if(n.viewModel.browseClusterEnabled=!1,o===vn.id&&(n.featureMenuOpen=!0,n.viewModel.browseClusterEnabled=!0),o===gn.id){n.close();const{selectedFeature:e}=n;if(!e)return Promise.reject(new h.Z(`trigger-action:${gn.id}`,"selectedFeature is required",{selectedFeature:e}));const{sourceLayer:t}=e;return t?t.remove(e):i.graphics.remove(e),Promise.resolve()}return Promise.resolve()};function wn(e){const{selectedFeature:t,location:i,view:s}=e;return s?"3d"===s.type?t||i:e.get("selectedFeature.geometry")||i:null}const Cn=e=>{let t=class extends e{constructor(...e){super(...e),this.goToOverride=null,this.view=null}callGoTo(e){const{view:t}=this;return this.goToOverride?this.goToOverride(t,e):t.goTo(e.target,e.options)}};return(0,n._)([(0,l.Cb)()],t.prototype,"goToOverride",void 0),(0,n._)([(0,l.Cb)()],t.prototype,"view",void 0),t=(0,n._)([(0,c.j)("esri.widgets.support.GoTo")],t),t},Mn=d.Z.ofType({key:"type",defaultKeyValue:"button",base:Gs.Z,typeMap:{button:Ws.Z,toggle:Us.Z}}),In="esri.widgets.Popup.PopupViewModel",Tn=a.Z.getLogger(In);let xn=class extends(Cn(Fs)){constructor(e){super(e),this._handles=new M.Z,this._pendingPromises=new Set,this._fetchFeaturesController=null,this._selectedClusterFeature=null,this.featurePage=null,this.featuresPerPage=20,this.actions=new Mn,this.defaultPopupTemplateEnabled=!1,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new u.Z({symbol
1:new Hs.Z({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null}get isLoadingFeature(){return this.featureViewModels.some((e=>e.waitingForContent))}initialize(){this._handles.add([(0,m.S1)(this,["autoOpenEnabled","view"],(()=>this._autoOpenEnabledChange())),this.on("view-change",(()=>this._autoClose())),(0,m.YP)(this,["highlightEnabled","selectedFeature","visible","view"],(()=>this._highlightFeature())),(0,m.YP)(this,"view.animation.state",(e=>this._animationStateChange(e))),(0,m.YP)(this,"location",(e=>this._locationChange(e))),(0,m.YP)(this,"selectedFeature",(e=>this._selectedFeatureChange(e))),(0,m.YP)(this,["selectedFeatureIndex","featureCount","featuresPerPage"],(()=>this._selectedFeatureIndexChange())),(0,m.YP)(this,["featurePage","selectedFeatureIndex","featureCount","featuresPerPage, featureViewModels"],(()=>this._setGraphicOnFeatureViewModels())),(0,m.YP)(this,"featureViewModels",(()=>this._featureViewModelsChange())),this.on("trigger-action",(e=>bn({event:e,view:this.view}))),(0,m.Nj)(this,"waitingForResult",(()=>this._waitingForResultChange())),(0,m.YP)(this,["features","view","view.map","view.spatialReference"],(()=>this._updateFeatureVMs())),(0,m.YP)(this,["view.scale"],this._viewScaleChange),(0,m.Nj)(this,"visible",(()=>this.browseClusterEnabled=!1)),(0,m.YP)(this,"browseClusterEnabled",(e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing()))])}destroy(){this._cancelFetchingFeatures(),this._handles.destroy(),this._handles=null,this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new Mn;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:s,includeDefaultActions:n,selectedFeature:r}=this,o=n?i.concat(t):t,a=r&&("function"==typeof r.getEffectivePopupTemplate&&r.getEffectivePopupTemplate(s)||r.popupTemplate),l=a&&a.actions,c=a&&a.overwriteActions?l:l?l.concat(o):o;return c&&c.filter(Boolean).forEach((t=>e.add(t))),e}get defaultActions(){var e;const t=this._get("defaultActions")||new Mn;return t.removeAll(),t.addMany(null!=(e=this.selectedFeature)&&e.isAggregate?[yn.clone(),vn.clone()]:[fn.clone()]),t}get featureCount(){return this.features.length}get features(){return this._get("features")||[]}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:s,selectedFeatureIndex:n}=this,r=s&&t.length;r&&i&&-1===n?this.selectedFeatureIndex=0:r&&-1!==n||(this.selectedFeatureIndex=t.length?0:-1)}get location(){return this._get("location")||null}set location(e){const t=this.get("view.spatialReference.isWebMercator");e&&e.get("spatialReference.isWGS84")&&t&&(e=(0,zs.$)(e)),this._set("location",e)}get pendingPromisesCount(){return this._pendingPromises.size}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||0!==this.featureCount)}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){if(this._pendingPromises.clear(),this.features=[],!Array.isArray(e)||!e.length)return this._set("promises",[]),void this.notifyChange("pendingPromisesCount");this._set("promises",e),(e=e.slice(0)).forEach((e=>{this._pendingPromises.add(e);e.then((t=>{this._pendingPromises.has(e)&&this._updateFeatures(t),this._updatePendingPromises(e)}),(()=>this._updatePendingPromises(e)))})),this.notifyChange("pendingPromisesCount")}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;return-1===t?null:e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get state(){return this.get("view.ready")?"ready":"disabled"}centerAtLocation(){const{view:e}=this,t=wn(this);if(!t){const i=new h.Z("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e});return Tn.error(i),Promise.reject(i)}return this.callGoTo({target:{target:t,scale:e.scale}})}clear(){this.set({promises:[],features:[],content:null,title:null,location:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e){const t=new h.Z("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return Tn.error(t),Promise.reject(t)}return i.fetchPopupFeatures(e,{event:t&&t.event,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t&&t.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:i}=t;delete t.fetchFeatures,i&&this._setFetchFeaturesPromises(t.location),this.set(t)}triggerAction(e){const t=this.allActions.getItemAt(e);
1t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex=this.selectedFeatureIndex+1,this}previous(){return this.selectedFeatureIndex=this.selectedFeatureIndex-1,this}disableClusterBrowsing(){(function(e){e.features=e.features.filter((e=>e.isAggregate))})(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){await async function(e){const{selectedFeature:t,view:i}=e;if("2d"!==(null==i?void 0:i.type)){const e=new h.Z("displayClusterExtent:invalid-view","View must be 2d MapView.",{view:i});throw _n.error(e),e}if(!t.isAggregate){const e=new h.Z("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:t});throw _n.error(e),e}const s=t.sourceLayer,n=await i.whenLayerView(s),r=n.createQuery();r.aggregateIds=[t.getObjectId()];const{extent:o}=await n.queryExtent(r);e.selectedClusterBoundaryFeature.geometry=o,i.graphics.add(e.selectedClusterBoundaryFeature)}(this),await async function(e){const{selectedFeature:t,view:i}=e;if("2d"!==(null==i?void 0:i.type)){const e=new h.Z("browseAggregateFeatures:invalid-view","View must be 2d MapView.",{view:i});throw _n.error(e),e}if(!t.isAggregate){const e=new h.Z("browseAggregateFeatures:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:t});throw _n.error(e),e}const s=t.sourceLayer,n=await i.whenLayerView(s),r=n.createQuery();r.aggregateIds=[t.getObjectId()],vn.active=!0,vn.disabled=!0;const{features:o}=await n.queryFeatures(r);vn.active=!1,vn.disabled=!1,e.features=[t].concat(o)}(this)}_animationStateChange(e){this.zoomToLocation||(fn.disabled="waiting-for-target"===e)}_clearBrowsedClusterGraphics(){var e;const t=null==(e=this.view)?void 0:e.graphics;t&&(t.remove(this.selectedClusterBoundaryFeature),t.remove(this._selectedClusterFeature)),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){var e;(null!=(e=this.selectedFeature)&&e.isAggregate||this.browseClusterEnabled)&&(this.browseClusterEnabled=!1,this.visible=!1)}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i}=this;i&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:s,featureViewModels:n}=this;if(null===i)return;const r=((i-1)*s+t)%t,o=r+s;n.slice(r,o).forEach(((t,i)=>{t&&!t.graphic&&(t.graphic=e[r+i])}))}async _selectedFeatureChange(e){if(!e)return;const{location:t,updateLocationEnabled:s,view:n}=this;if(this.browseClusterEnabled){if(this._selectedClusterFeature&&(n.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),e.isAggregate)return;return e.symbol=await async function(e,t){if(!e)return;const s=Ys(e.layer||e.sourceLayer);if((0,o.pC)(e.symbol)&&(!(0,o.pC)(t)||!0!==t.ignoreGraphicSymbol)){const i="web-style"===e.symbol.type?await e.symbol.fetchSymbol((0,o.pC)(t)?t.abortOptions:null):e.symbol.clone();return(0,Ks.tb)(i,null,s),i}const n=(0,o.pC)(t)&&t.renderer||e.get("layer.renderer")||e.get("sourceLayer.renderer");let r=await n.getSymbolAsync(e,t);if(!r)return;if(r="web-style"===r.type?await r.fetchSymbol((0,o.pC)(t)?t.abortOptions:null):r.clone(),!("visualVariables"in n)||"visualVariables"in n&&!n.visualVariables||"visualVariables"in n&&n.visualVariables&&!n.visualVariables.length)return r;if(n.arcadeRequiredForVisualVariables&&((0,o.Wi)(t)||(0,o.Wi)(t.arcade))){const e={...(0,o.Wg)(t)};e.arcade=await(0,$s.LC)(),t=e}const a=await Promise.resolve().then(i.bind(i,36496)),l=[],c=[],h=[],d=[];for(const i of n.visualVariables)switch(i.type){case"color":l.push(i);break;case"opacity":c.push(i);break;case"rotation":d.push(i);break;case"size":i.target||h.push(i)}const u=!!l.length&&l[l.length-1],p=u?a.getColor(u,e,t):null,m=!!c.length&&c[c.length-1];let f=m?a.getOpacity(m,e,t):null;if(null!=s&&(f=null!=f?f*s:s),(0,Ks.tb)(r,p,f),h.length){const i=a.getAllSizes(h,e,t);await(0,Ks.e3)(r,i)}for(const i of d)(0,Ks.BR)(r,a.getRotationAngle(i,e,t),i.axis);return r}(e),this._selectedClusterFeature=e,void n.graphics.add(this._selectedClusterFeature)}!s&&t||!e.geometry?s&&!e.geometry&&this.centerAtLocation().then((()=>{this.location=n.center.clone()})):this.location=(0,o.Wg)(this._getPointFromGeometry(e.geometry))}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}_setFetchFeaturesPromises(e){return this._fetchFeaturesWithController(this._getScreenPoint(e||this.location)).then((e=>{const{clientOnlyGraphics:t,promisesPerLayerView:i}=e,s=Promise.resolve(t),n=i.map((e=>e.promise));this.promises=[s,...n]}))}
1_destroyFeatureVMs(){this.featureViewModels.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i}=this;if(null!=e&&e.isAggregate||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t||!t.length)return;const s=i.slice(0),n=[];t.forEach(((t,i)=>{if(!t)return;let r=null;if(s.some(((e,i)=>(e&&e.graphic===t&&(r=e,s.splice(i,1)),!!r))),r)n[i]=r;else{var o,a;const s=new gs({defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:null==(o=this.view)?void 0:o.spatialReference,graphic:t===e?t:null,map:null==(a=this.view)?void 0:a.map,view:this.view});n[i]=s}})),s.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",n)}_getScreenPoint(e){const{view:t}=this;return t&&e&&"function"==typeof t.toScreen?t.toScreen(e):null}_autoOpenEnabledChange(){const e="auto-fetch-features",{_handles:t,autoOpenEnabled:i}=this;if(t.remove(e),i&&this.view){const i=this.view.on("click",(e=>{"mouse"===e.pointerType&&0!==e.button||this._fetchFeaturesAndOpen(e)}),dn.WIDGET);t.add(i,e)}}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null,this.notifyChange("waitingForResult")}_fetchFeaturesWithController(e,t){this._cancelFetchingFeatures();const i=(0,fi.yi)(),{signal:s}=i;this._fetchFeaturesController=i,this.notifyChange("waitingForResult");const n=this.fetchFeatures(e,{signal:s,event:t});return n.catch((()=>{})).then((()=>{this._fetchFeaturesController=null,this.notifyChange("waitingForResult")})),n}_fetchFeaturesAndOpen(e){const{screenPoint:t,mapPoint:i}=e,{view:s}=this;this._fetchFeaturesWithController(t,e).then((e=>{const{clientOnlyGraphics:t,promisesPerLayerView:n,location:r}=e,o=[Promise.resolve(t),...n.map((e=>e.promise))];return s.popup.open({location:r||i,promises:o}),e}))}_updatePendingPromises(e){e&&this._pendingPromises.has(e)&&(this._pendingPromises.delete(e),this.notifyChange("pendingPromisesCount"))}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}_getPointFromGeometry(e){return(0,o.Wi)(e)?null:"point"===e.type?e:"extent"===e.type?e.center:"polygon"===e.type?e.centroid:"multipoint"===e.type||"polyline"===e.type?e.extent.center:null}
1async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}async _highlightFeature(){const e="highlight";this._handles.remove(e);const{selectedFeature:t,highlightEnabled:i,view:s,visible:n}=this;if(!(t&&s&&i&&n))return;let{layer:r,sourceLayer:o}=t;if(!(r&&r instanceof qs.Z))return;"map-notes"===(null==o?void 0:o.type)&&(r=o);const a=this._getLayerView(s,r);this._highlightPromise=a;const l=await a;if(!(l&&function(e){return e&&"function"==typeof e.highlight}(l)&&this._highlightPromise===a&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const c="objectIdField"in r&&r.objectIdField,h=t.attributes,d=h&&c&&h[c],u=l.highlight(d||t);this._handles.add(u,e)}_updateFeatures(e){const{features:t}=this;if(!e||!e.length)return;if(!t.length)return void(this.features=e);const i=e.filter((e=>-1===t.indexOf(e)));this.features=t.concat(i)}};(0,n._)([(0,l.Cb)()],xn.prototype,"featurePage",void 0),(0,n._)([(0,l.Cb)()],xn.prototype,"featuresPerPage",void 0),(0,n._)([(0,l.Cb)()],xn.prototype,"isLoadingFeature",null),(0,n._)([(0,l.Cb)({type:Mn})],xn.prototype,"actions",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],xn.prototype,"active",null),(0,n._)([(0,l.Cb)({readOnly:!0})],xn.prototype,"allActions",null),(0,n._)([(0,l.Cb)({type:Boolean})],xn.prototype,"defaultPopupTemplateEnabled",void 0),(0,n._)([(0,l.Cb)()],xn.prototype,"autoCloseEnabled",void 0),(0,n._)([(0,l.Cb)()],xn.prototype,"autoOpenEnabled",void 0),(0,n._)([(0,l.Cb)()],xn.prototype,"browseClusterEnabled",void 0),(0,n._)([(0,l.Cb)()],xn.prototype,"content",void 0),(0,n._)([(0,l.Cb)({type:Mn,readOnly:!0})],xn.prototype,"defaultActions",null),(0,n._)([(0,l.Cb)({readOnly:!0})],xn.prototype,"featureCount",null),(0,n._)([(0,l.Cb)()],xn.prototype,"features",null),(0,n._)([(0,l.Cb)({readOnly:!0})],xn.prototype,"featureViewModels",void 0),(0,n._)([(0,l.Cb)()],xn.prototype,"highlightEnabled",void 0),(0,n._)([(0,l.Cb)()],xn.prototype,"includeDefaultActions",void 0),(0,n._)([(0,l.Cb)({type:Bs.Z})],xn.prototype,"location",null),(0,n._)([(0,l.Cb)({readOnly:!0})],xn.prototype,"pendingPromisesCount",null),(0,n._)([(0,l.Cb)({readOnly:!0})],xn.prototype,"selectedClusterBoundaryFeature",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],xn.prototype,"waitingForResult",null),(0,n._)([(0,l.Cb)({readOnly:!0})],xn.prototype,"promiseCount",null),(0,n._)([(0,l.Cb)()],xn.prototype,"promises",null),(0,n._)([(0,l.Cb)({value:null,readOnly:!0})],xn.prototype,"selectedFeature",null),(0,n._)([(0,l.Cb)({value:-1})],xn.prototype,"selectedFeatureIndex",null),(0,n._)([(0,l.Cb)({readOnly:!0})],xn.prototype,"selectedFeatureViewModel",null),(0,n._)([(0,l.Cb)({readOnly:!0})],xn.prototype,"state",null),(0,n._)([(0,l.Cb)()],xn.prototype,"title",void 0),(0,n._)([(0,l.Cb)()],xn.prototype,"updateLocationEnabled",void 0),(0,n._)([(0,l.Cb)()],xn.prototype,"view",void 0),(0,n._)([(0,l.Cb)()],xn.prototype,"visible",void 0),(0,n._)([(0,l.Cb)()],xn.prototype,"zoomFactor",void 0),(0,n._)([(0,l.Cb)()],xn.prototype,"zoomToLocation",void 0),(0,n._)([(0,l.Cb)()],xn.prototype,"centerAtLocation",null),xn=(0,n._)([(0,c.j)(In)],xn);var kn=xn;const Sn="selected-index",Pn="popup-spinner",Ln="esri-icon-left-triangle-arrow",En="esri-icon-right-triangle-arrow",An="esri-icon-maximize",Fn="esri-icon-dock-bottom",Vn="esri-icon-dock-left",On="esri-icon-dock-right",Rn="esri-icon-close",Dn="esri-icon-minimize",jn="esri-icon-check-mark",Zn="esri-icon-loading-indicator",Nn="esri-icon-default-action",zn="esri-icon-handle-horizontal",Bn="esri-rotating",Gn="esri-popup",Wn="esri-widget",Un="esri-popup__main-container",Hn="esri-popup__loading-container",qn="esri-popup--is-collapsible",$n="esri-popup--is-collapsed",Kn="esri-popup--shadow",Yn="esri-popup--is-docked",Xn="esri-popup--is-docked-top-left",Qn="esri-popup--is-docked-top-center",Jn="esri-popup--is-docked-top-right",er="esri-popup--is-docked-bottom-left",tr="esri-popup--is-docked-bottom-center",ir="esri-popup--is-docked-bottom-right",sr="esri-popup--aligned-top-center",nr="esri-popup--aligned-bottom-center",rr="esri-popup--aligned-top-left",or="esri-popup--aligned-bottom-left",ar="esri-popup--aligned-top-right",lr="esri-popup--aligned-bottom-right",cr="esri-popup--feature-menu-open",hr="esri-popup--actions-menu-open",dr="esri-popup--feature-updated",ur="esri-popup__header",pr="esri-popup__header-buttons",mr="esri-popup__header-container",fr="esri-popup__header-container--button",gr="esri-popup__header-title",yr="esri-popup__content",vr="esri-popup__footer",_r="esri-popup__footer--has-pagination",br="esri-popup__footer--has-actions",wr="esri-popup__footer--has-actions-menu",Cr="esri-popup__button",Mr="esri-popup__button--disabled",Ir="esri-popup__button--dock",Tr="esri-popup__icon",xr="esri-popup__icon--dock-icon",kr="esri-popup__inline-actions-container",Sr="esri-popup__actions-menu-button",Pr="esri-popup__actions",Lr="esri-popup__action",Er="esri-popup__action-image",Ar="esri-popup__action-text",Fr="esri-popup__action-toggle",Vr="esri-popup__action-toggle--on",Or="esri-popup__pointer",Rr="esri-popup__pointer-direction",Dr="esri-popup__navigation",jr="esri-popup__pagination-previous",Zr="esri-popup__pagination-next",Nr="esri-popup__pagination-previous-icon",zr="esri-popup__pagination-previous-icon--rtl",Br="esri-popup__pagination-next-icon",Gr="esri-popup__pagination-next-icon--rtl",Wr="esri-popup__feature-menu",Ur="esri-popup__feature-menu-list",Hr="esri-popup__feature-menu-item",qr="esri-popup__feature-menu-viewport",$r="esri-popup__feature-menu-header",Kr="esri-popup__feature-menu-item--selected",Yr="esri-popup__feature-menu-button",Xr="esri-popup__feature-menu-title",Qr="esri-popup__feature-menu-observer",Jr="esri-popup__feature-menu-loader",eo={buttonEnabled:!0,position:"auto",breakpoint:{width:544}};function to(e,t){return void 0===t?`esri-popup__${e}`:`esri-popup__${e}-${t}`}const io="esri.widgets.Popup",so=a.Z.getLogger(io),no={closeButton:!0,featureNavigation:!0};let ro=class extends($(H.Z)){constructor(e,t){super(e,t),this._blurClose=!1,this._blurContainer=!1,this._containerNode=null,this._mainContainerNode=null,this._featureMenuNode=null,this._actionsMenuNode=null,this._focusClose=!1,this._focusContainer=!1,this._focusDockButton=!1,this._focusFeatureMenuButton=!1,this._focusActionsMenuButton=!1,this._focusFirstFeature=!1,this._focusFirstAction=!1,this._handles=new M.Z,this._pointerOffsetInPx=16,this._spinner=null,this._feature=null,this._featureMenuIntersectionObserverCallback=([e])=>{null!=e&&e.isIntersecting&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback),this._displaySpinnerThrottled=(0,N.P)((()=>this._displaySpinner()),0),this.actions=null,this.alignment="auto",this.autoCloseEnabled=null,this.autoOpenEnabled=null,this.defaultPopupTemplateEnabled=null,this.content=null,this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.featureCount=null,this.featureMenuOpen=!1,this.features=null,this.goToOverride=null,this.highlightEnabled=null,this.location=null,this.label=void 0,this.maxInlineActions=3,this.messages=null,this.messagesCommon=null,this.promises=null,this.selectedFeature=null,this.selectedFeatureIndex=null,this.spinnerEnabled=!0,this.title=null,this.updateLocationEnabled=null,this.view=null,this.viewModel=new kn,this.visible=null,this.visibleElements={...no},this._addSelectedFeatureIndexHandle(),this.own([(0,m.YP)(this,"viewModel.screenLocation",(()=>this._positionContainer())),(0,m.YP)(this,["viewModel.active","dockEnabled"],(()=>this._toggleScreenLocationEnabled())),(0,m.YP)(this,"viewModel.screenLocation",((e,t)=>
1{!!e!=!!t&&this.reposition()})),(0,m.YP)(this,["viewModel.view.padding","viewModel.view.size","viewModel.active","viewModel.location","alignment"],(()=>this.reposition())),(0,m.YP)(this,"spinnerEnabled",(e=>this._spinnerEnabledChange(e))),(0,m.YP)(this,"viewModel.view.size",((e,t)=>this._updateDockEnabledForViewSize(e,t))),(0,m.YP)(this,"viewModel.view",((e,t)=>this._viewChange(e,t))),(0,m.YP)(this,"viewModel.view.ready",((e,t)=>this._viewReadyChange(e,t))),(0,m.YP)(this,["viewModel.waitingForResult","viewModel.location"],(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),(0,m.YP)(this,"selectedFeatureWidget.viewModel.title",(e=>this._setTitleFromFeatureWidget(e))),(0,m.YP)(this,["selectedFeatureWidget.viewModel.content","selectedFeatureWidget.viewModel.waitingForContent"],(()=>this._setContentFromFeatureWidget())),(0,m.Nj)(this,"collapsed",(()=>{var e,t;"xsmall"===(null==(e=this.viewModel)||null==(t=e.view)?void 0:t.widthBreakpoint)&&this.viewModel.active&&this.collapseEnabled&&this.viewModel.centerAtLocation()})),(0,m.on)(this,"viewModel.allActions","change",(()=>this._watchActions())),(0,m.S1)(this,"viewModel.allActions",(()=>this._watchActions())),(0,m.YP)(this,"viewModel.featureViewModels",(()=>this._featureMenuViewportScrollTop()))])}destroy(){var e,t;this._destroySelectedFeatureWidget(),this._destroySpinner(),null==(e=this._handles)||e.destroy(),this._unobserveFeatureMenuObserver(),null==(t=this._featureMenuIntersectionObserver)||t.disconnect(),this._handles=null}get actionsMenuId(){return`${this.id}-actions-menu`}get actionsMenuButtonId(){return`${this.id}-actions-menu-button`}get featureMenuId(){return`${this.id}-feature-menu`}get titleId(){return`${this.id}-popup-title`}get contentId(){return`${this.id}-popup-content`}get hasContent(){var e,t,i,s,n;return!!(this.selectedFeatureWidget?(null==(e=this.selectedFeatureWidget)||null==(t=e.viewModel)?void 0:t.waitingForContent)||(null==(i=this.selectedFeatureWidget)||null==(s=i.viewModel)?void 0:s.content):null==(n=this.viewModel)?void 0:n.content)}get featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get collapsible(){return!!(this.collapseEnabled&&this.viewModel.title&&this.hasContent)}get featureMenuVisible(){return this.featureNavigationVisible&&this.featureMenuOpen}get contentCollapsed(){return this.collapsible&&!this.featureMenuVisible&&this.collapsed}get dividedActions(){return this._divideActions()}set actionsMenuOpen(e){this._set("actionsMenuOpen",!!e)}get actionsMenuOpen(){return!!this.viewModel.active&&this._get("actionsMenuOpen")}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||eo}set dockOptions(e){const t={...eo},i=this.get("viewModel.view.breakpoints"),s={};i&&(s.width=i.xsmall,s.height=i.xsmall);const n={...t,...e},r={...t.breakpoint,...s},{breakpoint:o}=n;!0===o?n.breakpoint=r:"object"==typeof o&&(n.breakpoint={...r,...o}),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}set featureNavigationEnabled(e){(0,D.Mr)(so,"featureNavigationEnabled",{replacement:"visibleElements.featureNavigation",version:"4.15"}),this.visibleElements={...this.visibleElements,featureNavigation:e}}get selectedFeatureWidget(){const{_feature:e,visibleElements:t}=this,{selectedFeatureViewModel:i}=this.viewModel,s={...t,title:!1};return i?(e?(e.viewModel=i,e.visibleElements=s):this._feature=new Ls({viewModel:i,visibleElements:s}),this._feature):null}castVisibleElements(e){return{...no,...e}}blur(){const{active:e}=this.viewModel;e||so.warn("Popup can only be blurred when currently active."),this.visibleElements.closeButton?this._blurClose=!0:this._blurContainer=!0,this.scheduleRender()}clear(){this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||so.warn("Popup can only be focused when currently active."),this.visibleElements.closeButton?this._focusClose=!0:this._focusContainer=!0,this.scheduleRender()}next(){return this.viewModel.next()}open(e){var t,i;this._handles.remove(Sn);const s=!!e&&!!e.featureMenuOpen,n=!!e&&!!e.actionsMenuOpen,r={collapsed:!!e&&!!e.collapsed,actionsMenuOpen:n,featureMenuOpen:s};"xsmall"===(null==(t=this.viewModel)||null==(i=t.view)?void 0:i.widthBreakpoint)&&(r.collapsed=!0),this.set(r),this.viewModel.open(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){this.viewModel.triggerAction(e)}render(){var e,t,i,s;const{actionsMenuOpen:n,dockEnabled:r,featureMenuVisible:o,dividedActions:a,currentAlignment:l,currentDockPosition:c}=this,{active:h}=this.viewModel,{menuActions:d}=a,u=h&&d.length>1&&n,p=h&&r,m=h&&!r,f=null==(e=this.selectedFeature)||null==(t=e.layer)?void 0:t.t
1itle,g=null==(i=this.selectedFeature)||null==(s=i.layer)?void 0:s.id,y={[sr]:"top-center"===l,[nr]:"bottom-center"===l,[rr]:"top-left"===l,[or]:"bottom-left"===l,[ar]:"top-right"===l,[lr]:"bottom-right"===l,[Yn]:p,[Kn]:m,[Xn]:"top-left"===c,[Qn]:"top-center"===c,[Jn]:"top-right"===c,[er]:"bottom-left"===c,[tr]:"bottom-center"===c,[ir]:"bottom-right"===c,[cr]:o,[hr]:u};return(0,U.j)("div",{class:this.classes(Gn,y),role:"presentation","data-layer-title":f,"data-layer-id":g,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},h?[this.renderMainContainer(),this.renderPointer()]:null)}renderLoadingIcon(){return(0,U.j)("span",{"aria-hidden":"true",class:this.classes(Tr,Zn,Bn)})}renderNavigationLoading(){const{messagesCommon:e}=this;return this.viewModel.pendingPromisesCount?(0,U.j)("div",{key:to("loading-container"),role:"presentation",class:Hn,"aria-label":e.loading,title:e.loading},this.renderLoadingIcon()):null}renderPreviousIcon(){const e=(0,z.dZ)(),t={[En]:e,[zr]:e,[Ln]:!e,[Nr]:!e};return(0,U.j)("span",{"aria-hidden":"true",class:this.classes(Tr,t)})}renderPreviousButton(){const{messages:e}=this;return(0,U.j)("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:this.classes(Cr,jr),"aria-label":e.previous,title:e.previous},this.renderPreviousIcon())}renderNextIcon(){const e=(0,z.dZ)(),t={[Ln]:e,[Gr]:e,[En]:!e,[Br]:!e};return(0,U.j)("span",{"aria-hidden":"true",class:this.classes(Tr,t)})}renderNextButton(){const{messages:e}=this;return(0,U.j)("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:this.classes(Cr,Zr),"aria-label":e.next,title:e.next},this.renderNextIcon())}renderFeatureMenuButton(){const{featureMenuOpen:e,featureMenuId:t,messagesCommon:i}=this,{featureCount:s,selectedFeatureIndex:n}=this.viewModel;return(0,U.j)("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:this.classes(Cr,Yr),"aria-haspopup":"true","aria-controls":t,"aria-expanded":e.toString(),"aria-label":i.menu,title:i.menu},this._getPageText(s,n))}renderNavigationButtons(){return this.featureNavigationVisible?[this.renderPreviousButton(),this.renderNavigationLoading()||this.renderFeatureMenuButton(),this.renderNextButton()]:null}renderDockIcon(){const{dockEnabled:e}=this,t=this._wouldDockTo(),i={[Dn]:e,[xr]:!e,[On]:!e&&("top-right"===t||"bottom-right"===t),[Vn]:!e&&("top-left"===t||"bottom-left"===t),[An]:!e&&"top-center"===t,[Fn]:!e&&"bottom-center"===t};return(0,U.j)("span",{"aria-hidden":"true",class:this.classes(i,Tr)})}renderDockButton(){var e,t,i;const{dockEnabled:s,messages:n}=this,r=null==(e=this.viewModel)||null==(t=e.view)?void 0:t.widthBreakpoint,o=s?n.undock:n.dock;return"xsmall"!==r&&null!=(i=this.dockOptions)&&i.buttonEnabled?(0,U.j)("div",{role:"button","aria-label":o,title:o,tabIndex:0,bind:this,onclick:this._toggleDockEnabled,onkeydown:this._toggleDockEnabled,afterCreate:this._focusDockButtonNode,afterUpdate:this._focusDockButtonNode,class:this.classes(Cr,Ir)},this.renderDockIcon()):null}renderTitle(){const{title:e}=this.viewModel,{titleId:t,collapsible:i,contentCollapsed:s,messagesCommon:n}=this,r={[fr]:i},o=(0,U.j)("h2",{class:gr,innerHTML:e}),a=i?(0,U.j)("button",{key:`${e}--collapsible`,id:t,title:s?n.expand:n.collapse,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(mr,r),"aria-expanded":s?"false":"true",onclick:this._toggleCollapsed},o):(0,U.j)("div",{key:e,id:t,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(mr,r)},o);return e?a:null}renderCloseIcon(){return(0,U.j)("span",{"aria-hidden":"true",class:this.classes(Tr,Rn)})}renderCloseButton(){const{visibleElements:e,messagesCommon:t}=this;return e.closeButton?(0,U.j)("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:Cr,"aria-label":t.close,title:t.close,afterCreate:this._closeButtonNodeUpdated,afterUpdate:this._closeButtonNodeUpdated},this.renderCloseIcon()):null}renderHeader(){return(0,U.j)("header",{class:ur},this.renderTitle(),(0,U.j)("div",{class:pr},this.renderDockButton(),this.renderCloseButton()))}renderContentContainer(){const{contentId:e,hasContent:t,contentCollapsed:i}=this,{content:s}=this.viewModel;return t&&!i?(0,U.j)("article",{key:s,enterAnimation:this._createFeatureUpdatedAnimation(),id:e,class:yr},this.renderContent()):null}renderActionsMenuButton(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:s,messagesCommon:n}=this,r=i?n.close:n.open,{menuActions:o}=s;return o.length?(0,U.j)("div",{key:to("actions-menu-button"),class:this.classes(Cr,Sr),role:"button",id:t,"aria-haspopup":"true","aria-controls":i?e:null,tabIndex:0,bind:this,onclick:this._toggleActionsMenu,onkeydown:this._toggleActionsMenu,afterCreate:this._focusActionsMenuButtonNode,afterUpdate:this._focusActionsMenuButtonNode,"aria-label":r,title:r},(0,U.j)("span",{"aria-hidden":"true",class:zn})):null}renderMenuActions(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:s}=this,{menuActions:n,inlineActions:r}=s;return n.length&&i?(0,U.j)("ul",{id:e,role:"menu","aria-labelledby":t,key:to("actions"),class:Pr,bind:this,onkeyup:this._handleActionMenuKeyup,afterCreate:this._actionsMenuNodeUpdated,afterUpdate:this._actionsMenuNodeUpdated},n.toArray().map(((e,t)=>this.renderAction({action:e,index:t+r.length,type:"menu-item"})))):null}renderInlineActions(){const{inlineActions:e}=this.dividedActions;return!!e.length&&e.toArray().map(((e,t)=>this.renderAction({action:e,index:t,type:"inline"})))}renderInlineActionsContainer(){const{inlineActions:e,menuActions:t}=this.dividedActions,i=!!e.length,s=!!t.length;return i||s?(0,U.j)("div",{key:"inline-actions-container","data-inline-actions":i.toString(),"data-menu-actions":s.toString(),class:kr},this.renderInlineActions(),this.renderActionsMenuButton(),this.renderMenuActions()):null}renderNavigation(){return this.featureNavigationVisible?(0,U.j)("section",{key:to("navigation"),class:this.classes(Dr)},this.renderNavigationButtons()):null}renderFooter(){const{featureNavigationVisible:e,dividedActions:t}=this,{inlineActions:i,menuActions:s}=t,n=!!i.length,r=!!s.length,o={[_r]:e,[br]:n,[wr]:r};return e||n?(0,U.j)("div",{key:to("feature-buttons"),class:this.classes(vr,o)},this.renderInlineActionsContainer(),this.renderNavigation()):null}renderFeatureMenuContainer(){const{messages:e}=this,{featureViewModels:t,isLoadingFeature:i}=this.viewModel,s=(0,Z.n)(e.selectedFeatures,{total:t.length});return(0,U.j)("section",{key:to("menu"),class:Wr},(0,U.j)("h2",{class:$r},s),(0,U.j)("nav",{bind:this,class:qr,"data-node-ref":"_featureMenuViewportNode",afterCreate:z.Se},this.renderFeatureMenu(),(0,U.j)("div",{class:Qr,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),i?(0,U.j)("div",{class:Jr},this.renderLoadingIcon()):null))}renderPointer(){return this.dockEnabled?null:(0,U.j)("div",{key:to("pointer"),class:Or,role:"presentation"},(0,U.j)("div",{class:this.classes(Rr,Kn)}))}renderMainContainer(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i,titleId:s,contentId:n,collapsible:r,hasContent:o,contentCollapsed:a,visibleElements:l}=this,{title:c}=this.viewModel,h="bottom-left"===t||"bottom-center"===t||"bottom-right"===t||"top-left"===i||"top-center"===i||"top-right"===i,d="top-left"===t||"top-center"===t||"top-right"===t||"bottom-left"===i||"bottom-center"===i||"bottom-right"===i,u={[Kn]:e,[qn]:r,[$n]:a};return(0,U.j)("div",{class:this.classes(Un,Wn,u),tabIndex:l.closeButton?null:-1,role:"dialog","aria-labelledby":c?s:"","aria-describedby":o&&!a?n:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},h?this.renderFooter():null,h?this.renderFeatureMenuContainer():null,this.renderHeader(),this.renderContentContainer(),d?this.renderFooter():null,d?this.renderFeatureMenuContainer():null)}renderContent(){var e;const t=null==(e=this.viewModel)?void 0:e.content;return t?"string"==typeof t?(0,U.j)("div",{key:t,innerHTML:t}):this.renderNodeContent(t):null}renderActionText(e){return(0,U.j)("span",{key:"text",class:Ar},e)}renderActionIcon(e){const t=this._getActionClass(e),i=this._getActionImage(e),s={[Zn]:e.active,[Bn]:e.active,[Tr]:!!t,[Er]:!e.active&&!!i};return t&&(s[t]=!e.active),(0,U.j)("span",{key:"icon","aria-hidden":"true",class:this.classes(Tr,s),styles:this._getIconStyles(i)})}renderAction(e){const{action:t,index:i,type:s}=e,n=this._getActionTitle(t),r={[Lr]:"toggle"!==t.type,[Fr]:"toggle"===t.type,[Vr]:"toggle"===t.type&&t.value,[Mr]:t.disabled},o=[this.renderActionIcon(t),this.renderActionText(n)],a="menu-item"===s?(0,U.j)("li",{key:t.uid,role:"menuitem",tabIndex:0,title:n,"aria-label":n,class:this.classes(Cr,r),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-index":i,onclick:this._triggerAction,onkeydown:this._triggerAction},o):(0,U.j)("div",{key:t.uid,role:"button",tabIndex:0,title:n,"aria-label":n,class:this.classes(Cr,r),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-index":i,onclick:this._triggerAction,onkeydown:this._triggerAction},o);return t.visible?a:null}renderFeatureMenuItem(e,t){const{messages:i,messagesCommon:s}=this,{selectedFeatureIndex:n,selectedFeatureViewModel:r}=this.viewModel,o=e===r,a={[Kr]:o},l=o?(0,U.j)("span",{key:to(`feature-menu-selected-feature-${n}`),title:i.selectedFeature,"aria-label":i.selectedFeature,class:jn}):null,c=(0,U.j)("span",{innerHTML:e.title||s.untitled});return(0,U.j)("li",{role:"menuitem",tabIndex:-1,key:to(`feature-menu-feature-${n}`),class:this.classes(a,Hr),bind:this,"data-feature-index":t,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature},(0,U.j)("span",{class:Xr},c,l))}renderFeatureMenu(){const{featureMenuId:e}=this,{featureViewModels:t}=this.viewModel;return t.length>
11?(0,U.j)("ol",{class:Ur,id:e,bind:this,afterCreate:this._featureMenuNodeUpdated,afterUpdate:this._featureMenuNodeUpdated,onkeyup:this._handleFeatureMenuKeyup,role:"menu"},t.filter((e=>!!e.graphic)).map(((e,t)=>this.renderFeatureMenuItem(e,t)))):null}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:s}=this,{id:n}=e,r=null==i?void 0:i.attributes,o="zoom-to-feature"===n?(0,Z.n)(e.title,{messages:t}):"remove-selected-feature"===n?(0,Z.n)(e.title,{messages:s}):"zoom-to-clustered-features"===n||"browse-clustered-features"===n?(0,Z.n)(e.title,{messages:t}):e.title;return o&&r?(0,Z.n)(o,r):o}_getActionClass(e){const{selectedFeature:t}=this,i=null==t?void 0:t.attributes,{className:s,image:n}=e,r=n||s?s:Nn;return r&&i?(0,Z.n)(r,i):r}_getActionImage(e){const{selectedFeature:t}=this,i=null==t?void 0:t.attributes,{image:s}=e;return s&&i?(0,Z.n)(s,i):s}_createFeatureUpdatedAnimation(){return(0,z.vU)("enter",dr)}_getInlineActionCount(){const{maxInlineActions:e,featureNavigationVisible:t}=this;if("number"!=typeof e)return null;const i=Math.round(e);return Math.max(t?i-1:i,0)}_watchActions(){const{allActions:e}=this.viewModel;this.notifyChange("dividedActions");const t="actions";this._handles.remove(t),e&&e.forEach((e=>{this._handles.add((0,m.YP)(e,["active","className","disabled","id","title","image","visible"],(()=>this.scheduleRender())),t)}))}_divideActions(){const{allActions:e}=this.viewModel,t=this._getInlineActionCount(),i=null===t,s=0===t;return{inlineActions:i?e.slice(0):s?new d.Z:e.slice(0,t),menuActions:i?new d.Z:s?e.slice(0):e.slice(t)}}_featureMenuOpenChanged(e){e?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0}_actionsMenuOpenChanged(e){e?this._focusFirstAction=!0:this._focusActionsMenuButton=!0}_setTitleFromFeatureWidget(e){const{selectedFeatureWidget:t}=this;t&&(this.viewModel.title=e||"")}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_handleFeatureMenuKeyup(e){"Escape"===(0,j.kK)(e)&&(e.stopPropagation(),this._focusFeatureMenuButton=!0,this.featureMenuOpen=!1,this.scheduleRender())}_handleActionMenuKeyup(e){"Escape"===(0,j.kK)(e)&&(e.stopPropagation(),this._focusActionsMenuButton=!0,this.actionsMenuOpen=!1,this.scheduleRender())}_handleFeatureMenuItemKeyup(e){const t=(0,j.kK)(e),{_featureMenuNode:i}=this,s=e.currentTarget["data-feature-index"];if(!i)return;const n=i.querySelectorAll("li"),r=n.length;"ArrowUp"!==t?"ArrowDown"!==t?"Home"!==t?"End"!==t||(e.stopPropagation(),n[n.length-1].focus()):(e.stopPropagation(),n[0].focus()):(e.stopPropagation(),n[(s+1+r)%r].focus()):(e.stopPropagation(),n[(s-1+r)%r].focus())}_handleActionMenuItemKeyup(e){const t=(0,j.kK)(e),{_actionsMenuNode:i}=this,s=e.currentTarget["data-action-index"];if(!i)return;const n=i.querySelectorAll("li"),r=n.length;"ArrowUp"!==t?"ArrowDown"!==t?"Home"!==t?"End"!==t||(e.stopPropagation(),n[n.length-1].focus()):(e.stopPropagation(),n[0].focus()):(e.stopPropagation(),n[(s+1+r)%r].focus()):(e.stopPropagation(),n[(s-1+r)%r].focus())}_handleMainKeyup(e){const t=(0,j.kK)(e);"ArrowLeft"===t&&(e.stopPropagation(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.next())}_spinnerEnabledChange(e){if(this._destroySpinner(),!e)return;const t=this.get("viewModel.view");this._createSpinner(t)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i?e.show({location:t}):e.hide()}_getIconStyles(e){return{"background-image":e?`url(${e})`:""}}_addSelectedFeatureIndexHandle(){const e=(0,m.YP)(this,"viewModel.selectedFeatureIndex",((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this._handles.add(e,Sn)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this;i&&e!==t&&-1!==e&&(this.actionsMenuOpen=!1,this.featureMenuOpen=!1)}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,e&&!e.destroyed&&e.destroy()),this._feature=null}_isScreenLocationWithinView(e,t){return e.x>-1&&e.y>-1&&e.x<=t.width&&e.y<=t.height}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:s,side:n,view:r}=e;if(isNaN(i)||isNaN(t)||!r||!s)return!1;const o=r.padding;return"right"===n&&s.x+i/2>r.width-o.right||"left"===n&&s.x-i/2<o.left||"top"===n&&s.y-t<o.top||"bottom"===n&&s.y+t>r.height-o.bottom}_calculateAutoAlignment(e){if("auto"!==e)return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:s,viewModel:n}=this,{screenLocation:r,view:a}=n;if((0,o.Wi)(r)||!a||!i)return"top-center";if(!this._isScreenLocationWithinView(r,a))return this._get("currentAlignment")||"top-center";function l(e){return parseInt(e.replace(/[^-\d\.]/g,""),10)}const c=s?window.getComputedStyle(s,null):null,h=c?l(c.getPropertyValue("max-height")):0,d=c?l(c.getPropertyValue("height")):0,{height:u,width:p}=i.getBoundingClientRect(),m=p+t,f=Math.max(u,h,d)+t,g=this._isOutsideView({popupHeight:f,popupWidth:m,screenLocation:r,side:"right",view:a}),y=this._isOutsideView({popupHeight:f,popupWidth:m,screenLocation:r,side:"left",view:a}),v=this._isOutsideView({popupHeight:f,popupWidth:m,screenLocation:r,side:"top",view:a}),_=this._isOutsideView({popupHeight:f,popupWidth:m,screenLocation:r,side:"bottom",view:a});return y?v?"bottom-right":"top-right":g?v?"bottom-left":"top-left":v?_?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return"function"==typeof e?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return(0,z.dZ)()&&t.reverse(),e.replace(/leading/gi,t[0]).replace(/trailing/gi,t[1])}_callDockPosition(e){return"function"==typeof e?e.call(this):e}_getDockPosition(){var e;return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(null==(e=this.dockOptions)?void 0:e.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_wouldDockTo(){return this.dockEnabled?null:this._getDockPosition()}_calculateAutoDockPosition(e){var t;if("auto"!==e)return e;const i=null==(t=this.viewModel)?void 0:t.view,s=(0,z.dZ)()?"top-left":"top-right";if(!i)return s;const n=i.padding||{left:0,right:0,top:0,bottom:0}
1,r=i.width-n.left-n.right,{breakpoints:o}=i;return o&&r<=o.xsmall?"bottom-center":s}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!e)return;const{screenLocation:t}=this.viewModel,{width:i}=e.getBoundingClientRect(),s=this._calculatePositionStyle(t,i);s&&(e.style.top=s.top,e.style.left=s.left,e.style.bottom=s.bottom,e.style.right=s.right)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:i}=this;return"top-left"===t||"bottom-left"===t||"top-right"===t||"bottom-right"===t?e+i:e}_calculateAlignmentPosition(e,t,i,s){const{currentAlignment:n,_pointerOffsetInPx:r}=this,o=s/2,a=i.height-t,l=i.width-e,{padding:c}=this.view;return"bottom-center"===n?{top:t+r-c.top,left:e-o-c.left}:"top-left"===n?{bottom:a+r-c.bottom,right:l+r-c.right}:"bottom-left"===n?{top:t+r-c.top,right:l+r-c.right}:"top-right"===n?{bottom:a+r-c.bottom,left:e+r-c.left}:"bottom-right"===n?{top:t+r-c.top,left:e+r-c.left}:"top-center"===n?{bottom:a+r-c.bottom,left:e-o-c.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:s}=this;if(!s)return;if(i)return{left:"",top:"",right:"",bottom:""};if((0,o.Wi)(e)||!t)return;const n=this._calculateFullWidth(t),r=this._calculateAlignmentPosition(e.x,e.y,s,n);return r?{top:void 0!==r.top?`${r.top}px`:"auto",left:void 0!==r.left?`${r.left}px`:"auto",bottom:void 0!==r.bottom?`${r.bottom}px`:"auto",right:void 0!==r.right?`${r.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){if(e){const e=this.get("viewModel.view");this._wireUpView(e)}else t&&(this.close(),this.clear())}_wireUpView(e){if(this._destroySpinner(),!e)return;const{spinnerEnabled:t}=this;t&&this._createSpinner(e),this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[s,n]=e,[r,o]=t,{width:a,height:l}=i;return s<=a&&r>a||s>a&&r<=a||n<=l&&o>l||n>l&&o<=l}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},s=i.left+i.right,n=i.top+i.bottom,r=[],o=[];r[0]=e[0]-s,r[1]=e[1]-n,o[0]=t[0]-s,o[1]=t[1]-n;const{dockOptions:a}=this,l=a.breakpoint;this._dockingThresholdCrossed(r,o,l)&&this._setDockEnabledForViewSize(a),this._setCurrentDockPosition()}_focusDockButtonNode(e){this._focusDockButton&&(this._focusDockButton=!1,e.focus())}_closeButtonNodeUpdated(e){return this._focusClose?(this._focusClose=!1,void e.focus()):this._blurClose?(this._blurClose=!1,void e.blur()):void 0}_mainContainerNodeUpdated(e){return this._mainContainerNode=e,this._focusContainer?(this._focusContainer=!1,void e.focus()):this._blurContainer?(this._blurContainer=!1,void e.blur()):void 0}_featureMenuNodeUpdated(e){if(this._featureMenuNode=e,!e||!this._focusFirstFeature)return;this._focusFirstFeature=!1;const t=e.querySelectorAll("li");t.length&&t[0].focus()}_actionsMenuNodeUpdated(e){if(this._actionsMenuNode=e,!e||!this._focusFirstAction)return;this._focusFirstAction=!1;const t=e.querySelectorAll("li");t.length&&t[0].focus()}_focusFeatureMenuButtonNode(e){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton=!1,e.focus())}_focusActionsMenuButtonNode(e){this._focusActionsMenuButton&&(this._focusActionsMenuButton=!1,e.focus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&(this._featureMenuViewportNode.scrollTop=0)}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){var t,i;const s=e.breakpoint,n=null==(t=this.viewModel)||null==(i=t.view)?void 0:i.ui;if(!n)return!1;const{width:r,height:o}=n;if(isNaN(r)||isNaN(o))return!1;const a=s.hasOwnProperty("width")&&r<=s.width,l=s.hasOwnProperty("height")&&o<=s.height;return a||l}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}_getPageText(e,t){return this.featureNavigationVisible?(0,Z.n)(this.messages.pageText,{index:t+1,total:e}):null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t&&t.ui&&t.ui.remove(this._spinner,Pn),e.destroy(),this._spinner=null)}_createSpinner(e){e&&(this._spinner=new Ns({view:e}),e.ui.add(this._spinner,{key:Pn,position:"manual"}))}_toggleCollapsed(){this.collapsed=!this.collapsed}_close(){this.close(),this.view&&this.view.focus()}_toggleDockEnabled(){this.dockEnabled=!this.dockEnabled,this._focusDockButton=!0,this.scheduleRender()}_toggleFeatureMenu(){const e=!this.featureMenuOpen;this._featureMenuOpenChanged(e),this.actionsMenuOpen=!1,this.featureMenuOpen=e}_toggleActionsMenu(){const e=!this.actionsMenuOpen;this._actionsMenuOpenChanged(e),this.featureMenuOpen=!1,this.actionsMenuOpen=e}_triggerAction(e){const t=e.currentTarget["data-action-index"],i=this.viewModel.allActions.getItemAt(t);i&&"toggle"===i.type&&(i.value=!i.value),this.actionsMenuOpen=!1,this.viewModel.triggerAction(t)}
1_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuButton=!0,this.scheduleRender()}_next(){this.next()}_previous(){this.previous()}};(0,n._)([(0,l.Cb)({readOnly:!0})],ro.prototype,"actionsMenuId",null),(0,n._)([(0,l.Cb)({readOnly:!0})],ro.prototype,"actionsMenuButtonId",null),(0,n._)([(0,l.Cb)({readOnly:!0})],ro.prototype,"featureMenuId",null),(0,n._)([(0,l.Cb)({readOnly:!0})],ro.prototype,"titleId",null),(0,n._)([(0,l.Cb)({readOnly:!0})],ro.prototype,"contentId",null),(0,n._)([(0,l.Cb)({readOnly:!0})],ro.prototype,"hasContent",null),(0,n._)([(0,l.Cb)({readOnly:!0})],ro.prototype,"featureNavigationVisible",null),(0,n._)([(0,l.Cb)({readOnly:!0})],ro.prototype,"collapsible",null),(0,n._)([(0,l.Cb)({readOnly:!0})],ro.prototype,"featureMenuVisible",null),(0,n._)([(0,l.Cb)({readOnly:!0})],ro.prototype,"contentCollapsed",null),(0,n._)([(0,l.Cb)({readOnly:!0})],ro.prototype,"dividedActions",null),(0,n._)([(0,O.B)("viewModel.actions")],ro.prototype,"actions",void 0),(0,n._)([(0,l.Cb)()],ro.prototype,"actionsMenuOpen",null),(0,n._)([(0,l.Cb)()],ro.prototype,"alignment",void 0),(0,n._)([(0,O.B)("viewModel.autoCloseEnabled")],ro.prototype,"autoCloseEnabled",void 0),(0,n._)([(0,O.B)("viewModel.autoOpenEnabled")],ro.prototype,"autoOpenEnabled",void 0),(0,n._)([(0,O.B)("viewModel.defaultPopupTemplateEnabled")],ro.prototype,"defaultPopupTemplateEnabled",void 0),(0,n._)([(0,O.B)("viewModel.content")],ro.prototype,"content",void 0),(0,n._)([(0,l.Cb)()],ro.prototype,"collapsed",void 0),(0,n._)([(0,l.Cb)()],ro.prototype,"collapseEnabled",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],ro.prototype,"currentAlignment",null),(0,n._)([(0,l.Cb)({readOnly:!0})],ro.prototype,"currentDockPosition",null),(0,n._)([(0,l.Cb)()],ro.prototype,"dockOptions",null),(0,n._)([(0,l.Cb)()],ro.prototype,"dockEnabled",void 0),(0,n._)([(0,O.B)("viewModel.featureCount")],ro.prototype,"featureCount",void 0),(0,n._)([(0,l.Cb)()],ro.prototype,"featureMenuOpen",void 0),(0,n._)([(0,O.B)("viewModel.features")],ro.prototype,"features",void 0),(0,n._)([(0,l.Cb)()],ro.prototype,"featureNavigationEnabled",null),(0,n._)([(0,O.B)("viewModel.goToOverride")],ro.prototype,"goToOverride",void 0),(0,n._)([(0,O.B)("viewModel.highlightEnabled")],ro.prototype,"highlightEnabled",void 0),(0,n._)([(0,O.B)("viewModel.location")],ro.prototype,"location",void 0),(0,n._)([(0,l.Cb)({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],ro.prototype,"label",void 0),(0,n._)([(0,l.Cb)()],ro.prototype,"maxInlineActions",void 0),(0,n._)([(0,l.Cb)(),(0,W.H)("esri/widgets/Popup/t9n/Popup")],ro.prototype,"messages",void 0),(0,n._)([(0,l.Cb)(),(0,W.H)("esri/t9n/common")],ro.prototype,"messagesCommon",void 0),(0,n._)([(0,O.B)("viewModel.promises")],ro.prototype,"promises",void 0),(0,n._)([(0,O.B)("viewModel.selectedFeature")],ro.prototype,"selectedFeature",void 0),(0,n._)([(0,O.B)("viewModel.selectedFeatureIndex")],ro.prototype,"selectedFeatureIndex",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],ro.prototype,"selectedFeatureWidget",null),(0,n._)([(0,l.Cb)()],ro.prototype,"spinnerEnabled",void 0),(0,n._)([(0,O.B)("viewModel.title")],ro.prototype,"title",void 0),(0,n._)([(0,O.B)("viewModel.updateLocationEnabled")],ro.prototype,"updateLocationEnabled",void 0),(0,n._)([(0,O.B)("viewModel.view")],ro.prototype,"view",void 0),(0,n._)([(0,l.Cb)({type:kn}),function(e){return t=>{t.hasOwnProperty("_delegatedEventNames")||(t._delegatedEventNames=t._delegatedEventNames?t._delegatedEventNames.slice():[]);const i=t._delegatedEventNames,s=Array.isArray(e)?e:function(e){return e.split(",").map((e=>e.trim()))}(e);i.push(...s)}}(["triggerAction","trigger-action"])],ro.prototype,"viewModel",void 0),(0,n._)([(0,O.B)("viewModel.visible")],ro.prototype,"visible",void 0),(0,n._)([(0,l.Cb)()],ro.prototype,"visibleElements",void 0),(0,n._)([(0,R.p)("visibleElements")],ro.prototype,"castVisibleElements",null),(0,n._)([B()],ro.prototype,"_close",null),(0,n._)([B()],ro.prototype,"_toggleDockEnabled",null),(0,n._)([B()],ro.prototype,"_toggleFeatureMenu",null),(0,n._)([B()],ro.prototype,"_toggleActionsMenu",null),(0,n._)([B()],ro.prototype,"_triggerAction",null),(0,n._)([B()],ro.prototype,"_selectFeature",null),(0,n._)([B()],ro.prototype,"_next",null),(0,n._)([B()],ro.prototype,"_previous",null),ro=(0,n._)([(0,c.j)(io)],ro);var oo=ro;const ao=[0,0];function lo(e){e&&((0,P.cS)(e),e.parentNode&&e.parentNode.removeChild(e))}const co=750,ho=e=>{let t=class extends e{constructor(...e){super(...e),this._freqInfo={freq:16,time:co},this._overlayRenderTaskHandle=null,this.height=0,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.handles.add([this.watch("cursor",(e=>{const t=this.surface;t&&t.setAttribute("data-cursor",e)})),this.watch("interacting",(e=>{const t=this.surface;t&&t.setAttribute("data-interacting",e.toString())}))])}initialize(){this.handles.add(this.watch("ui",((e,t)=>
1this._handleUIChange(e,t)))),this._wireUI(this.ui),this.handles.add([this.on("focus",(()=>this.notifyChange("focused"))),this.on("blur",(()=>this.notifyChange("focused")))])}destroy(){this.destroyed||(this.ui&&(this.ui.destroy(),this.ui=null),this.popup&&!this.popup.destroyed&&this.popup.destroy(),this.container=null)}set container(e){const t=this._get("container");if(t===e)return;const i="dom-size";if(this.handles.remove(i),this._stopMeasuring(),t&&(t.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay.destroy(),this._set("overlay",null),lo(this.root),this._set("root",null),(0,P.YD)(this.userContent,t),lo(this.userContent),this._set("userContent",null)),e){e.classList.add("esri-view");const t=document.createElement("div");t.className="esri-view-user-storage",(0,P.YD)(e,t),e.appendChild(t),this._set("userContent",t);const s=document.createElement("div");s.className="esri-view-root",e.insertBefore(s,e.firstChild),this._set("root",s);const n=document.createElement("div");n.className="esri-view-surface",n.setAttribute("role","application"),n.tabIndex=0,s.appendChild(n),this._set("surface",n);const r=new V;s.appendChild(r.surface),this._set("overlay",r),r.watch("needsRender",(e=>{e&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=(0,S.A)({render:()=>{this.overlay.render()}}):this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null)})),this.forceDOMReadyCycle(),this.handles.add((0,m.S1)(this,"size",(e=>{const[t,i]=e,s="esri-view-surface--inset-outline";t>=document.body.clientWidth||i>=document.body.clientHeight?n.classList.add(s):n.classList.remove(s)})),i),this._set("container",e),this._startMeasuring()}else this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),this._set("container",null)}get focused(){const e=document.activeElement===this.surface;return document.hasFocus()&&e}get popup(){return this._get("popup")||new oo({view:this})}set popup(e){const t=this._get("popup");t&&t!==e&&t.destroy(),this._set("popup",e)}get size(){return[this.width,this.height]}blur(){this.surface&&this.surface.blur()}focus(){this.surface&&this.surface.focus()}pageToContainer(e,t,i){const s=this.position;return e-=s[0],t-=s[1],i?(i[0]=e,i[1]=t):i=[e,t],i}containerToPage(e,t,i){const s=this.position;return e+=s[0],t+=s[1],i?(i[0]=e,i[1]=t):i=[e,t],i}_handleUIChange(e,t){t&&(this.handles.remove("ui"),t.destroy()),e&&this._wireUI(e),this._set("ui",e)}_wireUI(e){this.handles.remove("ui"),e&&(e.view=this,this.handles.add([(0,m.S1)(this,"root",(t=>{e.container=t?function(e){const t=document.createElement("div");return e.appendChild(t),t}(t):null})),(0,m.S1)(this,"popup",((t,i)=>{const s="popup";i&&e.remove(i,s),t&&(t.view=e.view,e.add(t,{key:s,position:"manual"}))}))],"ui"))}_stopMeasuring(){this.handles.remove("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const e=this._freqInfo;e.freq=16,e.time=co,this.handles.add([(()=>{const t=()=>{e.freq=16,e.time=co};return window.addEventListener("resize",t),{remove(){window.removeEventListener("resize",t)}}})(),(0,S.A)({prepare:e=>{const t=this._measure(),i=this._freqInfo;if(i.time+=e.deltaTime,t&&(i.freq=16,this._get("resizing")||this._set("resizing",!0)),i.time<i.freq)return;i.time=0;const s=this._position();i.freq=s||t?16:Math.min(co,2*i.freq),!t&&i.freq>=512&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const e=this.container,t=e?e.clientWidth:0,i=e?e.clientHeight:0;if(0===t||0===i)return this.suspended||this._set("suspended",!0),!1;const s=this.width,n=this.height;return t===s&&i===n?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",t),this._set("height",i),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:s,oldHeight:n,width:t,height:i}),!0)}_position(){const e=this.container,t=this.position,i=function(e){const t=(e.ownerDocument||window.document).defaultView,i=e.getBoundingClientRect();return ao[0]=i.left+t.pageXOffset,ao[1]=i.top+t.pageYOffset,ao}(e);return(!t||i[0]!==t[0]||i[1]!==t[1])&&(this._set("position",[i[0],i[1]]),!0)}forceDOMReadyCycle(){}};return(0,n._)([(0,l.Cb)({value:null,cast:e=>(0,P.L7)(e)})],t.prototype,"container",null),(0,n._)([(0,l.Cb)({readOnly:!0})],t.prototype,"focused",null),(0,n._)([(0,l.Cb)({readOnly:!0})],t.prototype,"height",void 0),(0,n._)([(0,l.Cb)({type:oo})],t.prototype,"popup",null),(0,n._)([(0,l.Cb)({type:V})],t.prototype,"overlay",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],t.prototype,"position",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],t.prototype,"resizing",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],t.prototype,"root",void 0),(0,n._)([(0,l.Cb)({value:null,readOnly:!0})],t.prototype,"size",null),(0,n._)([(0,l.Cb)({readOnly:!0})],t.prototype,"surface",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],t.prototype,"suspended",void 0),(0,n._)([(0,l.Cb)()],t.prototype,"ui",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],t.prototype,"userContent",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],t.prototype,"width",void 0),(0,n._)([(0,l.Cb)()],t.prototype,"widthBreakpoint",void 0),t=(0,n._)([(0,c.j)("esri.views.DOMContainer")],t),t};var uo=i(95550);function po(e){return(0,uo.vW)(e.x,e.y)}function mo(e,t){const i=(e instanceof HTMLElement?e:e.surface).getBoundingClientRect();return(0,uo.vW)(t.clientX-i.left,t.clientY-i.top)}function fo(e,t){return t instanceof Event?mo(e,t):po(t)}function go(e){if(e instanceof Event)return!0;
1if("object"==typeof e&&"type"in e)switch(e.type){case"click":case"double-click":case"pointer-down":case"pointer-drag":case"pointer-enter":case"pointer-leave":case"pointer-up":case"pointer-move":case"immediate-click":case"immediate-double-click":case"hold":case"drag":case"mouse-wheel":return!0;default:return!1}return!1}var yo=i(14685),vo=i(91772),_o=i(88346),bo=i(81590),wo=(i(87241),i(7753));const Co=e=>{let t=class extends e{async fetchPopupFeatures(e,t){await this.when();const{location:i,queryArea:s,layerViewsAndGraphics:n,clientOnlyGraphics:r}=await this._prepareFetchPopupFeatures(e,t),o=Promise.resolve(r),a=this._queryLayerPopupFeatures({queryArea:s,layerViewsAndGraphics:n,options:t}),l=a.map((e=>e.promise));return{location:i,clientOnlyGraphics:r,allGraphicsPromise:(0,fi.WW)([o,...l]).then(wo.xH),promisesPerLayerView:a}}_queryLayerPopupFeatures({queryArea:e,layerViewsAndGraphics:t,options:i}){return t.map((({layerView:t,graphics:s})=>{const n={clientGraphics:s,event:(0,o.pC)(i)?i.event:null,signal:(0,o.pC)(i)?i.signal:null,defaultPopupTemplateEnabled:!!(0,o.pC)(i)&&!!i.defaultPopupTemplateEnabled},r=t.fetchPopupFeatures(e,n);return{layerView:t,promise:r}}))}_isValidPopupGraphic(e,t){return e&&!!e.getEffectivePopupTemplate((0,o.pC)(t)&&t.defaultPopupTemplateEnabled)}async _prepareFetchPopupFeatures(e,t){const{clientGraphics:i,queryArea:s,location:n}=await this._popupHitTestGraphics(e,t),r=this._getFetchPopupLayerViews(),{layerViewsAndGraphics:o,clientOnlyGraphics:a}=this._graphicsPerFetchPopupLayerView(i,r);return{clientOnlyGraphics:a,layerViewsAndGraphics:o,queryArea:s,location:n}}async _popupHitTestGraphics(e,t){const{results:i,mapPoint:s}=await this.popupHitTest(e),n=i.filter((e=>this._isValidPopupGraphic(e.graphic,t))),r=n.length?n[0].mapPoint:null;return{clientGraphics:n.map((e=>e.graphic)),queryArea:s,location:s||r}}_getFetchPopupLayerViews(){const e=[];return this.allLayerViews.forEach((t=>{this._isValidPopupLayerView(t)&&e.push(t)})),(0,o.pC)(this.graphicsView)&&this._isValidPopupLayerView(this.graphicsView)&&e.push(this.graphicsView),e.reverse()}_isValidPopupLayerView(e){return(0,o.pC)(e)&&(!("layer"in e)||!e.suspended)&&"fetchPopupFeatures"in e}_graphicsPerFetchPopupLayerView(e,t){const i=[],s=new Map,n=t.map((e=>{const t=[];return"layer"in e?s.set(e.layer,t):s.set(e.graphics,t),{layerView:e,graphics:t}}));for(const r of e){const e=s.get(r.layer)||null;e?e.push(r):i.push(r)}return{layerViewsAndGraphics:n,clientOnlyGraphics:i}}};return t=(0,n._)([(0,c.j)("esri.views.PopupView")],t),t};var Mo=i(35925),Io=i(64189),To=i(68309),xo=i(9435),ko=i(37956),So=i(64307),Po=i(94449);let Lo=class extends L.Z{constructor(e){super(e),this.view=null,this.baseLayerViews=new d.Z,this.referenceLayerViews=new d.Z,this._loadingHandle=(0,m.S1)(this,"view.map.basemap",(e=>{e&&e.load().catch((()=>{}))}))}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null)}get suspended(){return!this.view||this.view.suspended}get updating(){return(!this.view||!this.view.suspended)&&!(!(this.view&&this.view.map&&this.view.map.basemap)||this.view.map.basemap.loaded)}};function Eo(e,t){for(const[i,s]of e)if(t(s,i))return!0;return!1}(0,n._)([(0,l.Cb)({constructOnly:!0})],Lo.prototype,"view",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Lo.prototype,"baseLayerViews",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Lo.prototype,"referenceLayerViews",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Lo.prototype,"suspended",null),(0,n._)([(0,l.Cb)({type:Boolean,readOnly:!0})],Lo.prototype,"updating",null),Lo=(0,n._)([(0,c.j)("esri.views.BasemapView")],Lo);const Ao=a.Z.getLogger("esri.views.LayerViewManager");class Fo{constructor(e,t,i){this.layer=e,this.view=t,this.layerViewImporter=i,this._controller=(0,fi.yi)(),this._deferred=(0,fi.dD)(),this._started=!1,this.done=!1,(0,fi.fu)(this._controller.signal,(()=>{const t=new h.Z("cancelled:layerview-create","layerview creation cancelled",{layer:e});this._deferred.reject(t)}))}get promise(){return this._deferred.promise}destroy(){this._controller.abort();const{layerView:e}=this;if(!e)return;const{layer:t,view:i}=this;t.emit("layerview-destroy",{view:i,layerView:e}),i.emit("layerview-destroy",{layer:t,layerView:e}),this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null}
1async start(){if(this._started)return;this._started=!0;const{_controller:{signal:e},layer:t,view:i}=this;this._map=i.map;try{var s,n;let a,l;if(await t.load({signal:e}),"prefetchResources"in t&&await t.prefetchResources({signal:e}),t.createLayerView)a=await t.createLayerView(i,{signal:e});else{if(!this.layerViewImporter.hasLayerViewModule(t))throw new h.Z("layer:view-not-supported","No layerview implementation was found");const s=await this.layerViewImporter.importLayerView(t);(0,fi.k_)(e),a="default"in s?new s.default({layer:t,view:i}):new s({layer:t,view:i})}const c=()=>{l=(0,o.hw)(l),a.destroy(),a.layer=null,a.parent=null,a.view=null,this.done=!0};l=(0,fi.fu)(e,c),(0,fi.k_)(e);try{await a.when()}catch(r){throw c(),r}if(!(null==(s=this._map)||null==(n=s.allLayers)?void 0:n.includes(t)))return c(),void this._deferred.reject(new h.Z("view:no-layerview-for-layer","The layer has been removed from the map",{layer:t}));this.layerView=a,t.emit("layerview-create",{view:i,layerView:a}),i.emit("layerview-create",{layer:t,layerView:a}),this.done=!0,this._deferred.resolve(a)}catch(r){t.emit("layerview-create-error",{view:i,error:r}),i.emit("layerview-create-error",{layer:t,error:r}),this.done=!0,this._deferred.reject(new h.Z("layerview:create-error","layerview creation failed",{layer:t,error:r}))}}}let Vo=class extends te.r{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._watchUpdatingTracking=new E.t,this.supportsGround=!0,this._preloadLayerViewModules=()=>{var e;const t=null==(e=this.view.map)?void 0:e.allLayers;if(t)for(const i of t)this.layerViewImporter.hasLayerViewModule(i)&&this.layerViewImporter.importLayerView(i)},this._reschedule=()=>((0,o.Wi)(this._workPromise)&&(this._workPromise=(0,fi.dD)()),this.handles.remove("reschedule"),this.handles.add((0,S.Os)(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{var e,t,i;const s=this.view.map;if(this._map!==s&&(this.clear(),this._map=s),(0,o.Wi)(this._workPromise))return void this.notifyChange("updating");this.handles.remove("reschedule"),this.handles.remove("collection-change");const n=new p.Z({root:this,rootCollectionNames:this._rootCollectionNames,getChildrenFunction:e=>e.layers});if(!n)return this._workPromise.resolve(),void(this._workPromise=null);for(const o of n)this._createLayerView(o);this._refreshCollections();for(const[o,l]of this._layerLayerViewInfoMap)n.includes(o)||(this._layerLayerViewInfoMap.delete(l.layer),l.destroy());const r=n.filter((e=>"group"===e.type)).map((e=>e.layers)),a=[null==s||null==(e=s.ground)?void 0:e.layers,null==s||null==(t=s.basemap)?void 0:t.baseLayers,null==s||null==(i=s.basemap)?void 0:i.referenceLayers,null==s?void 0:s.layers,...r].filter((e=>!!e));this.handles.add(a.map((e=>this._watchUpdatingTracking.addOnCollectionChange(e,this._reschedule))),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.handles.add([(0,m.on)(this,"view.map.allLayers","change",this._preloadLayerViewModules,this._preloadLayerViewModules),(0,m.S1)(this.view,["map.basemap","map.ground","map.layers","ready"],this._reschedule,!0)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),this._watchUpdatingTracking.destroy(),this._map=null}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return!(!(0,o.pC)(this._workPromise)&&!this._watchUpdatingTracking.updating)||Eo(this._layerLayerViewInfoMap,(e=>!e.done))}clear(){if(!this.destroyed){for(const e of this._layerLayerViewInfoMap.values())e.destroy();this._layerLayerViewInfoMap.clear(),this._refreshCollections()}}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e))throw new h.Z("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e});return this._layerLayerViewInfoMap.get(e).promise}_refreshCollections(){for(const[e,t]of this._layersToLayerViews)this._populateLayerViewsOwners(this.get(e),this.get(t),this.view);this.notifyChange("updating")}_populateLayerViewsOwners(e,t,i){if(!e||!t)return void(t&&t.removeAll());let s=0;for(const n of e){const e=this._layerLayerViewInfoMap.get(n);if(!e||!e.layerView)continue;const r=e.layerView;r.layer=n,r.parent=i,t.getItemAt(s)!==r&&t.splice(s,0,r),n.layers&&this._populateLayerViewsOwners(n.layers,r.layerViews,r),s+=1}s<t.length&&t.splice(s,t.length)}_createLayerView(e){if(this._layerLayerViewInfoMap.has(e))return this.view.ready&&this._layerLayerViewInfoMap.get(e).start(),void this.notifyChange("updating");e.load().catch((()=>{})),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const t=new Fo(e,this.view,this.layerViewImporter);t.promise.then((()=>this._refreshCollections()),(t=>{var i,s;t&&((0,fi.D_)(t)||"cancelled:layerview-create"===t.name)||Ao.error(`Failed to create layerview for layer title:'${null!=(i=e.title)?i:"no title"}', id:'${null!=(s=e.id)?s:"no id"}' of type '${e.type}'.`,{layer:e,error:t}),this._refreshCollections()})),this._layerLayerViewInfoMap.set(e,t),this.view.ready&&t.start(),this.notifyChange("updating")}};(0,n._)([(0,l.Cb)()],Vo.prototype,"_workPromise",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Vo.prototype,"_watchUpdatingTracking",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Vo.prototype,"_layersToLayerViews",null),(0,n._)([(0,l.Cb)({readOnly:!0})],Vo.prototype,"_rootCollectionNames",null),(0,n._)([(0,l.Cb)()],Vo.prototype,"layerViewImporter",void 0),(0,n._)([(0,l.Cb)()],Vo.prototype,"supportsGround",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Vo.prototype,"updating",null),(0,n._)([(0,l.Cb)({constructOnly:!0})],Vo.prototype,"view",void 0),Vo=(0,n._)([(0,c.j)("esri.views.LayerViewManager")],Vo);var Oo=Vo;let Ro=class extends L.Z{constructor(e){super(e),this.factor=1.5,this.offset=(0,uo.vW)(0,0),this.position=null,this.size=120,this.maskUrl=null,this.maskEnabled=!0,this.overlayUrl=null,this.overlayEnabled=!0,this.visible=!0}get version(){return this.commitProperty("factor"),this.commitProperty("offset"),this.commitProperty("position"),this.commitProperty("visible"),this.commitProperty("size"),this.commitProperty("maskUrl"),this.commitProperty("maskEnabled"),this.commitProperty("overlayUrl"),this.commitProperty("overlayEnabled"),(this._get("version")||0)+1}};(0,n._)([(0,l.Cb)({type:Number})],Ro.prototype,"factor",void 0),(0,n._)([(0,l.Cb)({nonNullable:!0})],Ro.prototype,"offset",void 0),(0,n._)([(0,l.Cb)()],Ro.prototype,"position",void 0),(0,n._)([(0,l.Cb)({type:Number,range:{min:0}})],Ro.prototype,"size",void 0),(0,n._)([(0,l.Cb)()],Ro.prototype,"maskUrl",void 0),(0,n._)([(0,l.Cb)()],Ro.prototype,"maskEnabled",void 0),(0,n._)([(0,l.Cb)()],Ro.prototype,"overlayUrl",void 0),(0,n._)([(0,l.Cb)()],Ro.prototype,"overlayEnabled",void 0),(0,n._)([(0,l.Cb)({readOnly:!0}
1)],Ro.prototype,"version",null),(0,n._)([(0,l.Cb)({type:Boolean})],Ro.prototype,"visible",void 0),Ro=(0,n._)([(0,c.j)("esri.views.Magnifier")],Ro);var Do=Ro,jo=i(55068);let Zo=class extends Es.Z.EventedAccessor{constructor(){super(...arguments),this._handles=new M.Z,this._currentTick=0}initialize(){this._handles.add([this.view.allLayerViews.on("after-changes",(()=>{this.notifyChange("tickInterval"),this._handles.remove("layerViewsUpdating"),this._handles.add(this._getLayerViewHandles(),"layerViewsUpdating")})),this.watch("tickInterval",(()=>this._restartTicking())),this.watch("view.ready",(()=>this._restartTicking()))]),this._restartTicking()}destroy(){this._handles&&(this._handles.destroy(),this._handles=null,this._intervalID&&clearInterval(this._intervalID),this._currentTick=0)}get tickInterval(){const e=this.view.allLayerViews.filter((e=>(0,jo.NE)(e)));return this._getCommonInterval(e)}_restartTicking(){this._currentTick=0,this._intervalID&&clearInterval(this._intervalID),this.get("view.ready")&&this.tickInterval&&(this._intervalID=setInterval((()=>{const e=Date.now();this._currentTick+=this.tickInterval,this.view.allLayerViews.forEach((t=>{if((0,jo.NE)(t)){const i=Math.round(6e4*t.refreshInterval),s=this._currentTick%i==0,n=e-t.refreshTimestamp<5400;i&&s&&!n&&(t.refresh(e),this.emit("refresh",{layerView:t,timestamp:e,trigger:"interval"}))}}))}),this.tickInterval))}_getLayerViewHandles(){const e=[],t=()=>this.notifyChange("tickInterval");return this.view.allLayerViews.forEach((i=>{(0,jo.NE)(i)&&i.layer&&e.push(i.watch("refreshInterval",t),i.layer.on("refresh",(()=>{const e=Date.now();i.refresh(e),this.emit("refresh",{layerView:i,timestamp:e,trigger:"layer-refresh"})})))})),e}_getCommonInterval(e){const t=(e,i)=>isNaN(e)||isNaN(i)?0:i<=0?e:t(i,e%i);return e.toArray().reduce(((e,i)=>t(Math.round(6e4*i.refreshInterval),e)),0)}};(0,n._)([(0,l.Cb)()],Zo.prototype,"view",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Zo.prototype,"tickInterval",null),Zo=(0,n._)([(0,c.j)("esri.views.RefreshManager")],Zo);var No=Zo;const zo=["click","double-click","immediate-click","immediate-double-click","hold","drag","key-down","key-up","pointer-down","pointer-move","pointer-up","pointer-drag","mouse-wheel","pointer-enter","pointer-leave","gamepad","focus","blur"],Bo={};function Go(e){return!!Bo[e]}zo.forEach((e=>{Bo[e]=!0}));class Wo{constructor(e){this.handlers=new Map,this.counter=0,this.handlerCounts=new Map,this.view=e,this.inputManager=null}connect(e){e&&this.disconnect(),this.inputManager=e,this.handlers.forEach((({handler:e,priority:t},i)=>this.inputManager.installHandlers(i,[e],t)))}disconnect(){this.inputManager&&this.handlers.forEach(((e,t)=>this.inputManager.uninstallHandlers(t))),this.inputManager=null}destroy(){this.disconnect(),this.handlers.clear(),this.view=null}on(e,t,i,s){const n=Array.isArray(e)?e:e.split(",");if(!function(e){for(const t of e)if(!Go(t))return!1;return!0}(n))return n.some(Go)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;let r,o;Array.isArray(t)?o=t:(r=t,o=[]),"function"==typeof i?r=i:s=i,s=null!=s?s:dn.DEFAULT;const a=this.createUniqueGroupName(),l=new Uo(this.view,n,o,r);this.handlers.set(a,{handler:l,priority:s});for(const c of n){const e=this.handlerCounts.get(c)||0;this.handlerCounts.set(c,e+1)}return this.inputManager&&this.inputManager.installHandlers(a,[l],s),{remove:()=>this.removeHandler(a,n)}}hasHandler(e){return!!this.handlerCounts.get(e)}removeHandler(e,t){if(this.handlers.has(e)){this.handlers.delete(e);for(const e of t){const t=this.handlerCounts.get(e);void 0===t?console.error("Trying to remove handler for event that has no handlers registered: ",e):1===t?this.handlerCounts.delete(e):this.handlerCounts.set(e,t-1)}}this.inputManager&&this.inputManager.uninstallHandlers(e)}createUniqueGroupName(){return this.counter+=1,`viewEvents_${this.counter}`}}class Uo extends nn{constructor(e,t,i,s){super(!0),this.view=e;for(const n of t)switch(n){case"click":this.registerIncoming("click",i,(e=>s(this.wrapClick(e))));break;case"double-click":this.registerIncoming("double-click",i,(e=>s(this.wrapDoubleClick(e))));break;case"immediate-click":this.registerIncoming("immediate-click",i,(e=>s(this.wrapImmediateClick(e))));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",i,(e=>s(this.wrapImmediateDoubleClick(e))));break;case"hold":this.registerIncoming("hold",i,(e=>s(this.wrapHold(e))));break;case"drag":this.registerIncoming("drag",i,(e=>{const t=this.wrapDrag(e);t&&s(t)}));break;case"key-down":this.registerIncoming("key-down",i,(e=>s(this.wrapKeyDown(e))));break;case"key-up":this.registerIncoming("key-up",i,(e=>s(this.wrapKeyUp(e))));break;case"pointer-down":this.registerIncoming("pointer-down",i,(e=>s(this.wrapPointer(e,"pointer-down"))));break;case"pointer-move":this.registerIncoming("pointer-move",i,(e=>s(this.wrapPointer(e,"pointer-move"))));break;case"pointer-up":this.registerIncoming("pointer-up",i,(e=>s(this.wrapPointer(e,"pointer-up"))));break;case"pointer-drag":this.registerIncoming("pointer-drag",i,(e=>
1s(this.wrapPointerDrag(e))));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",i,(e=>s(this.wrapMouseWheel(e))));break;case"pointer-enter":this.registerIncoming("pointer-enter",i,(e=>s(this.wrapPointer(e,"pointer-enter"))));break;case"pointer-leave":this.registerIncoming("pointer-leave",i,(e=>s(this.wrapPointer(e,"pointer-leave"))));break;case"gamepad":this.registerIncoming("gamepad",i,(e=>{s(this.wrapGamepad(e))}));break;case"focus":this.registerIncoming("focus",i,(e=>{s(this.wrapFocus(e))}));break;case"blur":this.registerIncoming("blur",i,(e=>{s(this.wrapBlur(e))}))}}wrapFocus(e){return{type:"focus",timestamp:e.timestamp,native:e.data.native,cancelable:e.cancelable,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}wrapBlur(e){return{type:"blur",timestamp:e.timestamp,native:e.data.native,cancelable:e.cancelable,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}wrapClick(e){const{pointerType:t,button:i,buttons:s,x:n,y:r,native:o,eventId:a}=e.data,{cancelable:l,timestamp:c}=e;return{type:"click",pointerType:t,button:i,buttons:s,x:n,y:r,native:o,timestamp:c,screenPoint:(0,uo.vW)(n,r),mapPoint:this.getMapPoint(n,r),eventId:a,cancelable:l,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}wrapDoubleClick(e){const{pointerType:t,button:i,buttons:s,x:n,y:r,native:o,eventId:a}=e.data,{cancelable:l,timestamp:c}=e;return{type:"double-click",pointerType:t,button:i,buttons:s,x:n,y:r,native:o,timestamp:c,mapPoint:this.getMapPoint(n,r),eventId:a,cancelable:l,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}wrapImmediateClick(e){const{pointerType:t,button:i,buttons:s,x:n,y:r,native:o,eventId:a}=e.data,l=o.pointerId,{cancelable:c,timestamp:h}=e;return{type:"immediate-click",pointerId:l,pointerType:t,button:i,buttons:s,x:n,y:r,native:o,timestamp:h,mapPoint:this.getMapPoint(n,r),eventId:a,cancelable:c,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}wrapImmediateDoubleClick(e){const{pointerType:t,button:i,buttons:s,x:n,y:r,native:o,eventId:a}=e.data,l=o.pointerId,{cancelable:c,timestamp:h}=e;return{type:"immediate-double-click",pointerId:l,pointerType:t,button:i,buttons:s,x:n,y:r,native:o,timestamp:h,mapPoint:this.getMapPoint(n,r),eventId:a,cancelable:c,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}wrapHold(e){const{pointerType:t,button:i,buttons:s,x:n,y:r,native:o}=e.data,{cancelable:a,timestamp:l}=e;return{type:"hold",pointerType:t,button:i,buttons:s,x:n,y:r,native:o,timestamp:l,mapPoint:this.getMapPoint(n,r),cancelable:a,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}getMapPoint(e,t){return this.view.toMap((0,uo.vW)(e,t),{exclude:[]})}wrapDrag(e){const t=e.data,{x:i,y:s}=t.center,{action:n,pointerType:r,button:o}=t;if("start"===n&&(this.latestDragStart=t),!this.latestDragStart)return;const a=t.pointer.native,l=t.buttons,{cancelable:c,timestamp:h}=e,d={x:this.latestDragStart.center.x,y:this.latestDragStart.center.y};return"end"===n&&(this.latestDragStart=void 0),{type:"drag",action:n,x:i,y:s,origin:d,pointerType:r,button:o,buttons:l,radius:t.radius,angle:(0,X.BV)(t.angle),native:a,timestamp:h,cancelable:c,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}wrapKeyDown(e){const{key:t,repeat:i,native:s}=e.data,{cancelable:n,timestamp:r}=e;return{type:"key-down",key:t,repeat:i,native:s,timestamp:r,cancelable:n,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}wrapKeyUp(e){const{key:t,native:i}=e.data,{cancelable:s,timestamp:n}=e;return{type:"key-up",key:t,native:i,timestamp:n,cancelable:s,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}wrapPointer(e,t){const{x:i,y:s,button:n,buttons:r,native:o,eventId:a}=e.data,l=o.pointerId,c=o.pointerType,{cancelable:h,timestamp:d}=e;return{type:t,x:i,y:s,pointerId:l,pointerType:c,button:n,buttons:r,native:o,timestamp:d,eventId:a,cancelable:h,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}wrapPointerDrag(e){const{x:t,y:i,buttons:s,native:n,eventId:r}=e.data.currentEvent,{button:o}=e.data.startEvent,a=e.data.startEvent.native.pointerId,l=e.data.startEvent.native.pointerType,c=e.data.action,h={x:e.data.startEvent.x,y:e.data.startEvent.y},{cancelable:d,timestamp:u}=e;return{type:"pointer-drag",x:t,y:i,pointerId:a,pointerType:l,button:o,buttons:s,action:c,origin:h,native:n,timestamp:u,eventId:r,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}wrapMouseWheel(e){const{cancelable:t,data:i,timestamp:s}=e,{x:n,y:r,deltaY:o,native:a}=i;return{type:"mouse-wheel",x:n,y:r,deltaY:o,native:a,timestamp:s,cancelable:t,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}wrapGamepad(e){const{action:t,state:i,device:s}=e.data,{cancelable:n,timestamp:r}=e,{buttons:o,axes:a}=i;return{type:"gamepad",device:s,timestamp:r,action:t,buttons:o,axes:a,cancelable:n,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}}function Ho(e,t){const i=e.view;i&&(t&&i.ready&&i.activeTool!==e?(i.activeTool=e,function(e){return e&&"focus"in e}(i)&&i.focus()):t||i.activeTool!==e||(i.activeTool=null))}function qo(e){return!1!==e.visible&&!1!==e.editable&&(null==e.hasEditableFlag||e.hasEditableFlag(1))}function $o(e){return(0,o.Wi)(e)?{}:"function"==typeof e?e():e}function Ko(e){return"mouse"===e}function Yo(e){return"mouse"!==e.pointerType||0===e.button}function Xo(e){return!!e.native.shiftKey}const Qo={manipulator:null,tool:null};var Jo=class{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._revertToActiveTool=null,this._cursor=null}
1get cursor(){return this._cursor}handleInputEvent(e,t){const i=()=>e.stopPropagation();switch(e.type){case"pointer-move":Ko(e.pointerType)&&this._pointerLocations.set(e.pointerId,{x:e.x,y:e.y,pointerType:e.pointerType});break;case"drag":this._grabbedManipulators.size>0&&(this._stopDrag=!0),this._stopDrag&&(i(),"end"===e.action&&(this._stopDrag=!1));break;case"pointer-down":{if(!Yo(e)||Xo(e))break;const s=po(e),n=this._intersect(s,e.pointerType,t.forEachTool);if((0,o.Wi)(n))break;const r=this._findToolAndManipulatorByKey(n,t.forEachTool,Qo),a=(0,o.yw)(r,(e=>e.manipulator)),l=(0,o.yw)(r,(e=>e.tool));!((0,o.pC)(a)&&(0,o.pC)(l)&&a.interactive)||a.grabbable&&a.grabbableForEvent(e)||!a.grabbing||a.dragging||this._ungrabManipulatorBeforeDragging(a,l,e),(0,o.pC)(a)&&a.interactive&&a.grabbable&&a.grabbableForEvent(e)&&!a.grabbing&&(this._grabbedManipulators.set(e.pointerId,{key:n,start:s}),1===this._grabbedManipulators.size&&(this._revertToActiveTool=t.activeTool,t.setActiveTool(n.tool)),a.grabbing=!0,a.events.emit("grab-changed",{action:"start",screenPoint:s}),i());break}case"pointer-up":this._handlePointerEnd(e,t);break;case"pointer-drag":{if(!Yo(e))break;const s=this._grabbedManipulators.get(e.pointerId),n=this._draggedManipulators.get(e.pointerId),r=(0,o.yw)(s||n,(({key:e})=>e)),a=this._findManipulatorByKey(r,t.forEachTool);if((0,o.Wi)(a))break;const l=po(e);l.x=(0,X.uZ)(l.x,0,t.view.width),l.y=(0,X.uZ)(l.y,0,t.view.height);const c=(0,o.Wg)(s||n).start;switch(e.action){case"start":case"update":"update"!==e.action&&1!==this._grabbedManipulators.size||(a.dragging=!0,n?a.events.emit("drag",{action:"update",start:c,screenPoint:l}):a.events.emit("drag",{action:"start",start:c,screenPoint:l,pointerType:e.pointerType}),this._draggedManipulators.set(e.pointerId,{key:(0,o.Wg)(r),start:c}));break;case"end":a.dragging=!1,n&&a.events.emit("drag",{action:"end",start:c,screenPoint:l}),this._draggedManipulators.delete(e.pointerId),this._handlePointerEnd(e,t)}i();break}case"immediate-click":{const s=po(e),n=this._intersect(s,e.pointerType,t.forEachTool),r=this._findToolAndManipulatorByKey(n,t.forEachTool,Qo);if(Xo(e)||t.forEachTool((e=>{if((!(0,o.pC)(r)||r.tool!==e||!e.selectionManagementDisabled)&&e.manipulators){let t=!1;e.manipulators.forEach((({manipulator:e})=>{e.selected&&(e.selected=!1,t=!0)})),t&&e.manipulatorSelectionChanged&&e.manipulatorSelectionChanged()}})),(0,o.Wi)(r))break;const{manipulator:a,tool:l}=r;if(!a.interactive)break;a.selectable&&!l.selectionManagementDisabled&&(a.selected=!a.selected,l.manipulatorSelectionChanged&&l.manipulatorSelectionChanged());const c=e.native.shiftKey;a.events.emit("immediate-click",{screenPoint:s,button:e.button,pointerType:e.pointerType,shiftKey:c,stopPropagation:i});break}case"click":{const s=po(e),n=this._intersect(s,e.pointerType,t.forEachTool),r=this._findManipulatorByKey(n,t.forEachTool);if((0,o.Wi)(r)||!r.interactive)break;const a=e.native.shiftKey;r.events.emit(e.type,{screenPoint:s,button:e.button,pointerType:e.pointerType,shiftKey:a}),i();break}case"double-click":{const s=po(e),n=this._intersect(s,e.pointerType,t.forEachTool),r=this._findManipulatorByKey(n,t.forEachTool);if((0,o.Wi)(r)||!r.interactive)break;const a=e.native.shiftKey;r.events.emit("double-click",{screenPoint:s,button:e.button,pointerType:e.pointerType,shiftKey:a,stopPropagation:i});break}case"immediate-double-click":{const s=po(e),n=this._intersect(s,e.pointerType,t.forEachTool),r=this._findManipulatorByKey(n,t.forEachTool);if((0,o.Wi)(r)||!r.interactive)break;const a=e.native.shiftKey;r.events.emit("immediate-double-click",{screenPoint:s,button:e.button,pointerType:e.pointerType,shiftKey:a,stopPropagation:i});break}}this._updateCursor(t.forEachTool)}_ungrabManipulatorBeforeDragging(e,t,i){e.grabbing=!1,e.events.emit("grab-changed",{action:"end",screenPoint:po(i)}),this._grabbedManipulators.forEach((({key:i},s)=>{i.tool===t&&t.manipulators.findById(i.manipulatorId)===e&&this._grabbedManipulators.delete(s)}))}_handlePointerEnd(e,t){const i=(0,o.yw)(this._grabbedManipulators.get(e.pointerId),(({key:e})=>e)),s=this._findManipulatorByKey(i,t.forEachTool);if((0,o.pC)(s)&&!s.dragging){const n=(0,o.pC)(t.creatingTool)&&t.creatingTool===(0,o.Wg)(i).tool;1!==this._grabbedManipulators.size||0!==this._draggedManipulators.size||n||(t.setActiveTool(this._revertToActiveTool),this._revertToActiveTool=null),s.grabbing&&(s.grabbing=!1,s.events.emit("grab-changed",{action:"end",screenPoint:po(e)})),this._grabbedManipulators.delete(e.pointerId)}}_cursorFromMap(e,t){let i=null;return Eo(e,(({key:e})=>{const s=this._findManipulatorByKey(e,t);return!!((0,o.pC)(s)&&s.interactive&&"cursor"in s&&s.cursor)&&(i=s.cursor,!0)})),i}_updateCursor(e){this._grabbedManipulators.size>0?this._cursor=this._cursorFromMap(this._grabbedManipulators,e)||"grabbing":this._hoveredManipulators.size>0?this._cursor=this._cursorFromMap(this._hoveredManipulators,e)||"pointer":this._cursor=null}clearPointers(e,t,i=!0,s){const n=t=>t.tool===e&&((0,o.Wi)(s)||t.manipulatorId===s);
1this._grabbedManipulators.forEach((({key:e},i)=>{if(n(e)){this._grabbedManipulators.delete(i);const s=this._findManipulatorByKey(e,t);(0,o.pC)(s)&&(s.grabbing=!1,s.events.emit("grab-changed",{action:"end",screenPoint:null}))}})),this._draggedManipulators.forEach((({key:e},i)=>{if(n(e)){this._draggedManipulators.delete(i);const s=this._findManipulatorByKey(e,t);(0,o.pC)(s)&&(s.dragging=!1,s.events.emit("drag",{action:"cancel"}))}})),i&&this._hoveredManipulators.forEach((({key:e},i)=>{if(n(e)){this._hoveredManipulators.delete(i);const s=this._findManipulatorByKey(e,t);(0,o.pC)(s)&&(s.hovering=!1)}})),this._updateCursor(t)}_intersect(e,t,i){let s=null;return i((i=>{if(null==i.manipulators||!qo(i))return!1;const n=i.manipulators.intersect(e,t);return!(0,o.Wi)(n)&&(s={manipulatorId:n.id,tool:i},!0)})),s}updateHoveredStateFromKnownPointers(e){this._pointerLocations.forEach(((t,i)=>{this._updateHoveredStateForPointerAtScreenPosition((0,uo.vW)(t.x,t.y),i,t.pointerType,e)}))}handleHoverEvent(e,t){"pointer-up"!==e.type&&"immediate-click"!==e.type&&"pointer-move"!==e.type||!Ko(e.pointerType)||this._updateHoveredStateForPointerAtScreenPosition(po(e),e.pointerId,e.pointerType,t)}_updateHoveredStateForPointerAtScreenPosition(e,t,i,s){const n=this._intersect(e,i,s);let r=this._findManipulatorByKey(n,s);
1const a=(0,o.yw)(this._hoveredManipulators.get(t),(({key:e})=>e)),l=this._findManipulatorByKey(a,s);(0,o.pC)(r)&&!r.interactive&&(r=null),l!==r&&((0,o.pC)(l)&&(l.hovering=!1),(0,o.pC)(r)?(r.hovering=!0,this._hoveredManipulators.set(t,{key:(0,o.Wg)(n)})):this._hoveredManipulators.delete(t),this._updateCursor(s))}_findManipulatorByKey(e,t){return this._findToolAndManipulatorByKey(e,t,Qo)?Qo.manipulator:null}_findToolAndManipulatorByKey(e,t,i){return(0,o.Wi)(e)?null:(i.tool=null,i.manipulator=null,t((t=>{if(t!==e.tool||null==t.manipulators||!qo(t))return!1;const s=t.manipulators.findById(e.manipulatorId);return!!(0,o.pC)(s)&&(i.manipulator=s,i.tool=t,!0)})),i.manipulator?i:null)}};const ea=a.Z.getLogger("esri.views.ToolViewManager"),ta="manipulators",ia="tools";let sa=class extends L.Z{constructor(e){super(e),this._handles=new M.Z,this._creatingTool=null,this._manipulatorState=new Jo,this.tools=function(){const e=new d.Z;return e.on("after-add",(e=>{const t=e.item;t.view&&t.view.ready&&t.attach()})),e.on("after-remove",(e=>{const t=e.item;Ho(t,!1),t.destroyed||t.detach()})),e}(),this.cursor=null,this._forEachTool=e=>{if(!(0,o.pC)(this._creatingTool)||!e(this._creatingTool))for(const t of this.tools.items)if(e(t))return}}initialize(){this._handles.add([this.view.on(zo,(e=>{this._handleInputEvent(e)}),dn.TOOL),this.tools.on("before-add",(e=>{const t=e.item;null==t||this.tools.includes(t)?e.preventDefault():null==t.created||t.created||(ea.error("tools","Tool can not be added to view before it has been created"),e.preventDefault())})),this.tools.on("before-remove",(({item:e})=>{this._manipulatorState.clearPointers(e,this._forEachTool)})),this.tools.on("change",(()=>{this._refreshToolWatchers()}))])}destroy(){this._forEachTool((e=>e.destroy())),this._handles.destroy(),this._handles=null}set activeTool(e){!(0,o.pC)(e)||this.view.ready?(function(e,t,i){const s=e.activeTool;t!==s&&((0,o.pC)(s)&&s.deactivate&&s.deactivate(),i(t),(0,o.pC)(t)&&t.activate&&t.activate())}(this,e,(t=>{this._set("activeTool",t),this._removeIncompleteTools(e),this._forEachTool((e=>{const t=(0,o.Wi)(this.activeTool)||e===this.activeTool;e.setEditableFlag&&e.setEditableFlag(1,t);const i=qo(e);!(0,o.Wi)(this.activeTool)&&i||this._manipulatorState.clearPointers(e,this._forEachTool,!i)})),this._updateCursor()})),this._creatingTool!==e&&this._rejectCreatingTool()):ea.error("#activeTool=","cannot set active tool while view is not ready")}async createTool(e,t,i){await this.view.whenReady();const s="Tool creation was interrupted by another tool being created";if((0,fi.Hc)(i))throw(0,fi.zE)(s);const n=new e({...$o(t),view:this.view}),r=(0,fi.fu)(i,(()=>this.activeTool=null));return this._rejectCreatingTool(s),this._creatingTool=n,n.attach(),this._refreshToolWatchers(),Ho(n,!0),await n.when(),(0,o.pC)(r)&&r.remove(),this._creatingTool=null,this.tools.add(n),n instanceof L.Z&&null!=n.completed&&(0,m.N1)(n,"completed").then((()=>{Ho(n,!1)})),n}attach(){this._forEachTool((e=>e.attach())),"3d"===this.view.type?this._handles.add([this.view.state.watch("camera",(()=>{this.forEachManipulator((e=>{null!=e.onViewChange&&e.onViewChange()}))})),this.view.elevationProvider.on("elevation-change",(e=>{this.forEachManipulator((t=>{null!=t.onElevationChange&&t.onElevationChange(e)}))}))],ta):this._handles.add(this.view.watch("extent",(()=>{this.forEachManipulator((e=>{null!=e.onViewChange&&e.onViewChange()}))})))}detach(){this.activeTool=null,this._forEachTool((e=>{e.detach(),e.destroy()})),this.tools.removeAll(),this._handles.remove(ta)}forEachManipulator(e){this._forEachTool((t=>{t.manipulators&&t.manipulators.forEach((({manipulator:i})=>e(i,t)))}))}_handleInputEvent(e){let t=!1;const i={...e,stopPropagation:()=>{t=!0,e.stopPropagation()}};(0,o.pC)(this.activeTool)?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(i):this._forEachTool((e=>{!t&&!1!==e.visible&&e.handleInputEvent&&e.handleInputEvent(i)})),!t&&"key-down"===e.type&&"Escape"===e.key&&this.activeTool&&(e.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(i,{forEachTool:this._forEac
1hTool,activeTool:this.activeTool,setActiveTool:e=>{this.activeTool=e},creatingTool:this._creatingTool,view:this.view}),!t&&(0,o.pC)(this.activeTool)&&this.activeTool.handleInputEventAfter&&this.activeTool.handleInputEventAfter(i),this._manipulatorState.handleHoverEvent(i,this._forEachTool),this._updateCursor()}_refreshToolWatchers(){this._handles.remove(ia),this._forEachTool((e=>{if(e instanceof L.Z){const t=(0,m.YP)(e,["cursor","visible","editable"],(()=>{qo(e)||this._manipulatorState.clearPointers(e,this._forEachTool),this._updateCursor()}));this._handles.add(t,ia)}e.manipulators&&this._handles.add(e.manipulators.on("change",(t=>{t.removed.forEach((({id:t})=>{this._manipulatorState.clearPointers(e,this._forEachTool,!0,t)})),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})),ia)})),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateCursor(){let e=null;this._forEachTool((t=>null!=t.cursor&&!1!==t.visible&&(e=t.cursor,!0))),e||(e=this._manipulatorState.cursor),this._get("cursor")!==e&&this._set("cursor",e)}_rejectCreatingTool(e){const t=this._creatingTool;(0,o.Wi)(t)||(this._manipulatorState.clearPointers(t,this._forEachTool),t.rejectCreation&&t.rejectCreation((0,fi.zE)(e)),t.destroy(),this._creatingTool=null,this._refreshToolWatchers())}_removeIncompleteTools(e){this.tools.filter((t=>((0,o.Wi)(e)||t!==e)&&null!=t.completed&&!t.completed)).forEach((e=>{this.tools.remove(e)}))}};(0,n._)([(0,l.Cb)({constructOnly:!0,nonNullable:!0})],sa.prototype,"view",void 0),(0,n._)([(0,l.Cb)({value:null})],sa.prototype,"activeTool",null),(0,n._)([(0,l.Cb)({readOnly:!0,type:d.Z})],sa.prototype,"tools",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],sa.prototype,"cursor",void 0),sa=(0,n._)([(0,c.j)("esri.views.ToolViewManager")],sa);var na=sa;class ra{constructor(e,t,i){this.analysis=e,this.viewFactory=t,this.controllerFactory=i,this._promise=(0,fi.dD)(),this.analysisView=null,this.analysisController=null,this._load()}destroy(){(0,o.pC)(this.analysisView)&&this.analysisView.destroy(),(0,o.pC)(this.analysisController)&&this.analysisController.destroy()}get promise(){return this._promise.promise}async _load(){let e=!1;(0,o.pC)(this.viewFactory)?this.analysisView=await this.viewFactory(this.analysis):e=!0,(0,o.pC)(this.controllerFactory)?this.analysisController=await this.controllerFactory(this.analysis):e=!0,e?this._promise.reject("no view/controller factories available for analysis"):this._promise.resolve((0,o.Wg)(this.analysisView))}}let oa=class extends L.Z{constructor(e){super(e),this._items=new Map,this.analyses=new d.Z}initialize(){this.analyses.on("after-add",(e=>{const t=e.item;this._items.set(t,this._createItem(t))})),this.analyses.on("after-remove",(e=>{const t=e.item,i=this._getItem(t);(0,o.pC)(i)&&(i.destroy(),this._items.delete(t))}))}async whenAnalysisView(e){return this._items.has(e)?this._items.get(e).promise:(0,fi.d1)(new h.Z("view:no-analysisview-for-analysis","No analysis view has been found for the analysis"))}getAnalysisView(e){const t=this._items.get(e);return t?t.analysisView:null}_createItem(e){return new ra(e,this.viewFactory,this.controllerFactory)}_getItem(e){return this._items.get(e)}};(0,n._)([(0,l.Cb)({type:d.Z})],oa.prototype,"analyses",void 0),(0,n._)([(0,l.Cb)()],oa.prototype,"viewFactory",void 0),(0,n._)([(0,l.Cb)()],oa.prototype,"controllerFactory",void 0),oa=(0,n._)([(0,c.j)("esri.views.3d.interactive.graphics.AnalysisManager")],oa);let aa=class extends L.Z{constructor(e){super(),this.nativeIndex=null,this._detectedDeviceType="unknown","standard"===e.mapping?this._detectedDeviceType="standard":la.test(e.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=e.index}get native(){return(navigator.getGamepads?navigator.getGamepads():[])[this.nativeIndex]}get deviceType(){return this._detectedDeviceType}get axisThreshold(){return ca[this.deviceType]}};(0,n._)([(0,l.Cb)({nonNullable:!0,readOnly:!0})],aa.prototype,"nativeIndex",void 0),(0,n._)([(0,l.Cb)({type:String,readOnly:!0})],aa.prototype,"deviceType",null),(0,n._)([(0,l.Cb)({type:Number,readOnly:!0})],aa.prototype,"axisThreshold",null),aa=(0,n._)([(0,c.j)("esri.views.input.gamepad.GamepadInputDevice")],aa);
1const la=new RegExp("^(3dconnexion|space(mouse|navigator|pilot|explorer))","i"),ca={standard:.15,spacemouse:.025,unknown:0};var ha=aa;let da=class extends L.Z{constructor(...e){super(...e),this.devices=new d.Z,this.enabledFocusMode="document"}};(0,n._)([(0,l.Cb)({type:d.Z.ofType(ha),readOnly:!0})],da.prototype,"devices",void 0),(0,n._)([(0,l.Cb)({type:["document","view","none"]})],da.prototype,"enabledFocusMode",void 0),da=(0,n._)([(0,c.j)("esri.views.input.gamepad.GamepadSettings")],da);var ua=da;let pa=class extends L.Z{constructor(){super(...arguments),this.gamepad=new ua}};(0,n._)([(0,l.Cb)({readOnly:!0})],pa.prototype,"gamepad",void 0),pa=(0,n._)([(0,c.j)("esri.views.input.Input")],pa);var ma=pa;let fa=class extends L.Z{constructor(e){super(e),this.enabled=!0,this.device=null,this.mode="pan",this.tiltDirection="forward-down",this.velocityFactor=1}};(0,n._)([(0,l.Cb)({type:Boolean,nonNullable:!0})],fa.prototype,"enabled",void 0),(0,n._)([(0,l.Cb)({type:ha})],fa.prototype,"device",void 0),(0,n._)([(0,l.Cb)({type:["pan","zoom"],nonNullable:!0})],fa.prototype,"mode",void 0),(0,n._)([(0,l.Cb)({type:["forward-down","forward-up"],nonNullable:!0})],fa.prototype,"tiltDirection",void 0),(0,n._)([(0,l.Cb)({type:Number,nonNullable:!0})],fa.prototype,"velocityFactor",void 0),fa=(0,n._)([(0,c.j)("esri.views.navigation.gamepad.GamepadSettings")],fa);var ga=fa;let ya=class extends L.Z{constructor(e){super(e),this.browserTouchPanEnabled=!0,this.gamepad=new ga,this.momentumEnabled=!0,this.mouseWheelZoomEnabled=!0}};(0,n._)([(0,l.Cb)({type:Boolean})],ya.prototype,"browserTouchPanEnabled",void 0),(0,n._)([(0,l.Cb)({type:ga,nonNullable:!0})],ya.prototype,"gamepad",void 0),(0,n._)([(0,l.Cb)({type:Boolean})],ya.prototype,"momentumEnabled",void 0),(0,n._)([(0,l.Cb)({type:Boolean})],ya.prototype,"mouseWheelZoomEnabled",void 0),ya=(0,n._)([(0,c.j)("esri.views.navigation.Navigation")],ya);var va=ya,_a=i(20692);function ba(e){const t=e.url&&(0,_a.Qc)(e.url);return null==(e.spatialReference&&e.spatialReference.vcsWkid)&&(0,o.pC)(t)&&"ImageServer"===t.serverType||!wa(e)||!e.heightModelInfo?Ma(e)?So.Z.deriveUnitFromSR(Ta,e.spatialReference):null:e.heightModelInfo}function wa(e){return"heightModelInfo"in e}function Ca(e){if("unknown"===e.type||!("capabilities"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"ogc-feature":return!0;default:return!1}}function Ma(e){return Ca(e)?!!(e.capabilities&&e.capabilities.data&&e.capabilities.data.supportsZ):Ia(e)}function Ia(e){switch(e.type){case"building-scene":case"elevation":case"integrated-mesh":case"point-cloud":case"scene":return!0;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"csv":case"geojson":case"feature":case"geo-rss":case"graphics":case"group":case"imagery":case"imagery-tile":case"kml":case"map-image":case"map-notes":case"ogc-feature":case"open-street-map":case"route":case"stream":case"tile":case"unknown":case"unsupported":case"vector-tile":case"wcs":case"web-tile":case"wms":case"wmts":case null:return!1}return!1}const Ta=new So.Z({heightModel:"gravity-related-height"});var xa;const ka=a.Z.getLogger("esri.views.support.DefaultsFromMap");let Sa=xa=class extends L.Z{constructor(){super(...arguments),this._handles=new M.Z,this._waitTask=null,this._extentProjectController=null,this._spatialReferenceCandidates=null,this._extentCandidates=null,this.logDebugInformation=!1,this.isSpatialReferenceDone=!1,this.isTileInfoDone=!1,this.isHeightModelInfoSearching=!1,this.spatialReference=null,this.extent=null,this.heightModelInfo=null,this.vcsWkid=null,this.latestVcsWkid=null,this.mapCollectionPaths=xa.DefaultMapCollectionPaths.slice(),this.tileInfo=null}initialize(){this.watch("mapCollectionPaths",(()=>{this._running&&(this.reset(),this.start())}))}destroy(){this._set("view",null),this._handles&&(this._handles.destroy(),this._handles=null),this._cancelLoading()}get _running(){return!!(this._handles&&this._handles.size>0)}reset(){this._handles.removeAll(),this._set("isSpatialReferenceDone",!1),this._set("isTileInfoDone",!1),this._set("isHeightModelInfoSearching",!1),this._set("spatialReference",null),this._set("extent",null),this._set("heightModelInfo",null),this._set("vcsWkid",null),this._set("latestVcsWkid",null),this._set("tileInfo",null),this._spatialReferenceCandidates=null,this._extentCandidates=null}start(){this._handles.removeAll();const e=this._updateLayerChange.bind(this);for(const t of this.mapCollectionPaths)this._handles.add((0,m.on)(this.view,`map.${t}`,"change",e,e,e,!0));this._handles.add((0,m.gx)(this,"isSpatialReferenceDone",(()=>this._updateTileInfo()),!0))}_ownerNameFromCollectionName(e){const t=e.lastIndexOf(".");return-1===t?"view":"view."+e.slice(0,t)}_ensureLoadedOwnersFromCollectionName(e){const t=this._ownerNameFromCollectionName(e).split(".");let i;for(let s=0;s<t.length&&(i=this.get(t.slice(0,s+1).join(".")),i);s++)if(i.load&&!i.isFulfilled())return{collectionName:e,owner:null,loading:i.load().catch((()=>{}))};return{collectionName:e,owner:i}}_cancelLoading(){this._waitTask=null,this._extentProjectController&&(this._extentProjectController.abort(),this._extentProjectController=null)}_updateWhen(e){let t=!0,i=!1;const s=e.catch((()=>{})).then((()=>{t?i=!0:s===this._waitTask&&this._update()}));return t=!1,i||(this._waitTask=s),i}_updateLayerChange(){this.isSpatialReferenceDone&&!this.spatialReference&&this._set("isSpatialReferenceDone",!1),this._update()}
1_update(){if(this._cancelLoading(),this.view){if(!this.isSpatialReferenceDone){this._debugLog("Starting search for spatial reference...");const e=this._processMapCollections((e=>this._processSpatialReferenceSource(e)));if(this._debugLog(`Search ended with status '${La(e)}'`),0!==e){let e=null,t=this._spatialReferenceCandidates;if(!t||t.length<1?(e=this.defaultSpatialReference,this._debugLog(`No spatial reference found, locking to default (${Pa(e)})`)):(this.defaultSpatialReference&&t.length>1&&t.findIndex((e=>e.equals(this.defaultSpatialReference)))>-1&&(t=[this.defaultSpatialReference]),e=t[0],this._debugLog(`Locking to ${Pa(e)}`)),this._set("spatialReference",e),e)if(this.extent)this._set("isSpatialReferenceDone",!0);else{const t=this.logDebugInformation;this.logDebugInformation=!1,this._processMapCollections((t=>this._findExtent(t,e))),this.logDebugInformation=t,this._projectExtentCandidate().catch((()=>{})).then((()=>this._set("isSpatialReferenceDone",!0)))}else this._set("isSpatialReferenceDone",!0)}}if(null==this.heightModelInfo&&this.view.isHeightModelInfoRequired){this._debugLog("Starting search for height model info...");const e=this._processMapCollections((e=>this._processHeightModelInfoSource(e)),(e=>function(e){return null!=e.layers||Ia(e)||Ca(e)||wa(e)}(e)));this._debugLog(`Search ended with status ${La(e)}`),this._set("isHeightModelInfoSearching",0===e)}this._updateTileInfo()}}_processMapCollections(e,t){this._preloadMapCollections(t);let i=2;return this._forAllMapCollectionSources((e=>{if(2!==i)return!1;const{collectionName:t}=e;return this._debugLog(`Processing collection ${t}...`),!(e.loading&&!this._updateWhen(e.loading))||(this._debugLog(`Collection ${e.collectionName} owner is loading -> wait`),i=0,!1)}),(s=>2===i&&(null==t||t(s)?!s.load||s.isFulfilled()||this._updateWhen(s.load())?!((!s.load||s.isResolved())&&e(s))||(i=1,!1):(this._debugLog(`Source ${s.id} is loading -> wait`),i=0,!1):(this._debugLog(`Source ${s.id} is skipped due to predicate`),!1)))),i}_preloadMapCollections(e){let t=10;const i=this.logDebugInformation;this.logDebugInformation=!1,this._forAllMapCollectionSources((()=>!0),(s=>0!==t&&(!(null!=e&&!e(s))&&(s.load&&!s.isFulfilled()&&(this.logDebugInformation=i,this._debugLog(`Pre-loading source ${s.id}`),this.logDebugInformation=!1,s.load().catch((()=>{})),t--),!0)))),this.logDebugInformation=i}_forAllMapCollectionSources(e,t){for(const i of this.mapCollectionPaths){const s=`map.${i}`,n=this._ensureLoadedOwnersFromCollectionName(s);if(!1===e(n))continue;const r=n.owner;if(!r||r.isRejected&&r.isRejected()){this._debugLog(`Collection ${s} owner is invalid or rejected -> skip`);continue}const o=this.view.get(s);o?this._forEachSource(o,t):this._debugLog(`Collection ${s} does not exist -> skip`)}}_forEachSource(e,t){for(const i of e.items)!1!==t(i)&&"layers"in i&&i.layers&&this._forEachSource(i.layers,t)}_processSpatialReferenceSource(e){let t=this._getSupportedSpatialReferences(e);return 0!==t.length&&(this._spatialReferenceCandidates?(t=(0,wo.wf)(t,this._spatialReferenceCandidates,((e,t)=>e.equals(t))),t.length>0?this._spatialReferenceCandidates=t:this._debugLog(`Layer ${e.id} is ignored because its supported spatial\n references are not compatible with the previous candidates`)):this._spatialReferenceCandidates=t,1===this._spatialReferenceCandidates.length)}_findExtent(e,t){const i="fullExtents"in e&&e.fullExtents||(e.fullExtent?[e.fullExtent]:[]),s=i.find((e=>e.spatialReference.equals(t)));if(s)return this._set("extent",s),!0;if(this._getSupportedSpatialReferences(e).length>0){const t=i.map((t=>({extent:t,layer:e}))),s=this._extentCandidates||[];this._extentCandidates=s.concat(t)}return!1}async _projectExtentCandidate(){if(!this._extentCandidates||!this._extentCandidates.length)return;const e=this.spatialReference,t=this._extentCandidates.find((t=>(0,zs.Q8)(t.extent.spatialReference,e)));if(t)this._set("extent",(0,zs.iV)(t.extent,e));else{const t=this._extentCandidates[0];this._extentProjectController=(0,fi.yi)();const s=await i.e(8060).then(i.bind(i,8060));try{const i=await s.projectGeometry(t.extent,e,t.layer.portalItem,this._extentProjectController.signal);this._set("extent",i)}catch{}this._extentProjectController=null}}
1_getSupportedSpatialReferences(e){const t="supportedSpatialReferences"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(0===t.length)return this._debugLog(`Layer ${e.id} is ignored because it does not have any spatial references`),[];const i=t.filter((t=>this.view.isSpatialReferenceSupported(t,e,(e=>this._debugLog(e)))));return 0===i.length?this._debugLog(`Layer ${e.id} has spatial references but none of them are supported (or layer doesn't require locking)`):this._debugLog(`Layer ${e.id} has spatial references. Resulting candidate set: ${i.map(Pa).join(", ")}`),i}_processHeightModelInfoSource(e){const t=ba(e);return!!t&&(this._set("heightModelInfo",t),this._set("isHeightModelInfoSearching",!1),e.spatialReference&&(this._set("vcsWkid",e.spatialReference.vcsWkid),this._set("latestVcsWkid",e.spatialReference.latestVcsWkid)),!0)}_updateTileInfo(){if(null!=this.tileInfo)return;if(!this.view.isTileInfoRequired())return void this._set("isTileInfoDone",!0);if(!this.isSpatialReferenceDone)return;const e=this.get("view.map");if(!e)return void this._debugLog("updateTileInfo: no map");const t=e.basemap,i=e.get("layers.0");let s=null;if(t&&"failed"!==t.loadStatus){if(!t.loaded)return this._updateWhen(t.load()),void this._debugLog("updateTileInfo: basemap still loading");const e=t&&t.get("baseLayers.0");if(e&&"failed"!==e.loadStatus){if(!e.loaded)return this._updateWhen(e.load()),void this._debugLog("updateTileInfo: first basemap layer still loading");s="tileInfo"in e&&e.tileInfo}else{if(!i||"failed"===i.loadStatus)return this._debugLog("updateTileInfo: no tileInfo"),void this._set("isTileInfoDone",!0);if(!i.loaded)return this._updateWhen(i.load()),void this._debugLog("updateTileInfo: first operational layer still loading");s="tileInfo"in i&&i.tileInfo}}else if(i&&"failed"!==i.loadStatus){if(!i.loaded)return this._updateWhen(i.load()),void this._debugLog("updateTileInfo: first operational layer still loading");s="tileInfo"in i&&i.tileInfo}s&&!s.spatialReference.equals(this.spatialReference)&&(s=null),this._debugLog(`updateTileInfo: setting ${s}`),this._set("tileInfo",s),this._set("isTileInfoDone",!0)}_debugLog(e){this.logDebugInformation&&ka.info(e)}};function Pa(e){return e?JSON.stringify(e.toJSON()):"undefined"}function La(e){switch(e){case 0:return"Waiting";case 1:return"Found";case 2:return"Exhausted"}}Sa.DefaultMapCollectionPaths=["basemap.baseLayers","layers","ground.layers","basemap.referenceLayers"],(0,n._)([(0,l.Cb)()],Sa.prototype,"logDebugInformation",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Sa.prototype,"isSpatialReferenceDone",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Sa.prototype,"isTileInfoDone",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Sa.prototype,"isHeightModelInfoSearching",void 0),(0,n._)([(0,l.Cb)({constructOnly:!0})],Sa.prototype,"view",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Sa.prototype,"spatialReference",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Sa.prototype,"extent",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Sa.prototype,"heightModelInfo",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Sa.prototype,"vcsWkid",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Sa.prototype,"latestVcsWkid",void 0),(0,n._)([(0,l.Cb)()],Sa.prototype,"mapCollectionPaths",void 0),(0,n._)([(0,l.Cb)()],Sa.prototype,"defaultSpatialReference",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Sa.prototype,"tileInfo",void 0),Sa=xa=(0,n._)([(0,c.j)("esri.views.support.DefaultsFromMap")],Sa);var Ea,Aa=Sa;const Fa=a.Z.getLogger("esri.views.View");let Va=Ea=class extends((0,te.p)(Es.Z.EventedMixin((0,Io.v)(L.Z)))){constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.allLayerViews=new p.Z({root:this,rootCollectionNames:["basemapView.baseLayerViews","groundView?.layerViews","layerViews","basemapView.referenceLayerViews"],getChildrenFunction:e=>e.layerViews}),this.animation=null,this.basemapView=null,this.defaultsFromMap=new Aa({view:this}),this.fatalError=null,this.extent=null,this.graphics=new Po.ZP,this.navigating=!1,this.layerViews=new d.Z,this.magnifier=new Do,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.renderContext=null,this.input=new ma,this.navigation=new va,this.layerViewManager=null,this.refreshManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new Wo(this),this.persistableViewModels=new d.Z,this._isValid=!1,this._readyCycleForced=!1,this.handles.add(this.watch("preconditionsReady",(e=>{e?(this._currentSpatialReference=this.spatialReference,Ea.views.add(this)):(this._currentSpatialReference=null,Ea.views.remove(this)),this.notifyChange("spatialReference"),!e&&this.ready?(this.layerViewManager.clear(),this.toolViewManager.detach(),this._teardown()):e&&!this.ready&&(this._startup(),this.toolViewManager.attach())}),!0))}initialize(){let e;this.addResolvingPromise(this.validate().then((()=>(this._isValid=!0,(0,m.N1)(this,"ready"))))),this.basemapView=new Lo({view:this}),this.layerViewManager=new Oo({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.refreshManager=new No({view:this}),this.toolViewManager=new na({view:this}),this.analysisManager=new oa({viewFactory:e=>this.createAnalysisView(e),controllerFactory:e=>this.createAnalysisController(e)}),this._resetInitialViewPropertiesFromContent(),(0,m.S1)(this.defaultsFromMap,"isSpatialReferenceDone",(t=>{const i=!!(this.map&&this.map.allLayers.length>0);if(t&&!this.spatialReference&&i||!e){if(t&&!this.spatialReference&&i&&!e){const t=e=(0,fi.e4)(this.spatialReferenceWarningDelay);e.then((()=>{t===e&&Fa.warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}
1)).catch((()=>{}))}}else e=null}),!0)}destroy(){if(this.destroyed)return;this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics.destroy(),this.graphics=null,this.handles.remove("defaultsFromMap"),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),this.toolViewManager.destroy(),this.toolViewManager=null,this.refreshManager.destroy(),this.refreshManager=null,this.layerViewManager.destroy(),this.layerViewManager=null,this.basemapView.destroy(),this.basemapView=null,this.invalidate(),this._emitter.clear(),this.handles.removeAll();const e=this.map;this.map=null,null==e||e.destroy()}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return Fa.error("#toMap()","Not implemented on this instance of View"),null}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get preconditionsReady(){return!!(!this.fatalError&&this._isValid&&!this._readyCycleForced&&this.map&&(!To.Z.isLoadable(this.map)||this.map.loaded)&&0!==this.width&&0!==this.height&&this.spatialReference&&this.isSpatialReferenceSupported(this.spatialReference)&&(this._currentSpatialReference||!this.initialExtentRequired||this.initialExtent||this.defaultsFromMap&&this.defaultsFromMap.isSpatialReferenceDone)&&this.defaultsFromMap&&this.defaultsFromMap.isTileInfoDone)}set map(e){var t;e!==this._get("map")&&(null!=(t=e)&&t.destroyed&&(Fa.warn("#map","The provided map is already destroyed",{map:e}),e=null),To.Z.isLoadable(e)&&e.load().catch((()=>{})),this.initialized&&(this.forceReadyCycle(),this._resetInitialViewPropertiesFromContent()),this._set("map",e))}get spatialReference(){let e=this._userSpatialReference||this._currentSpatialReference||this.getDefaultSpatialReference()||null;return e&&this.isHeightModelInfoRequired&&this.defaultsFromMap&&(e=e.clone(),e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid),e}set spatialReference(e){this._userSpatialReference=e,this._set("spatialReference",e)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get initialExtent(){return this.defaultsFromMap&&this.defaultsFromMap.extent}get cursor(){const e=this.toolViewManager?this.toolViewManager.cursor:null;return(0,o.pC)(e)?e:this._cursor||"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}whenLayerView(e){return this.layerViewManager.whenLayerView(e)}getAnalysisView(e){return this.analysisManager.getAnalysisView(e)}whenAnalysisView(e){return this.analysisManager.whenAnalysisView(e)}getDefaultSpatialReference(){return this.get("defaultsFromMap.spatialReference")}getDefaultHeightModelInfo(){return this.get("map.supportsHeightModelInfo")&&this.get("map.heightModelInfo")||this.get("defaultsFromMap.heightModelInfo")||null}importLayerView(e){throw new h.Z("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async createAnalysisView(e){throw new h.Z("createAnalysisView() not implemented")}async createAnalysisController(e){throw new h.Z("createAnalysisController() not implemented")}async validate(){}invalidate(){this._isValid=!1}isSpatialReferenceSupported(e,t,i){return!0}isTileInfoRequired(){return!1}when(e,t){return this.isResolved()&&!this.ready&&Fa.warn("#when()",'Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use watchUtils.whenOnce(view, "ready").then(...) instead.'),super.when(e,t)}forceReadyCycle(){this.ready&&(this._readyCycleForced=!0,(0,m.OY)(this,"preconditionsReady",(()=>this._readyCycleForced=!1)))}createTool(e,t,i){return this.toolViewManager.createTool(e,t,i)}tryFatalErrorRecovery(){this.fatalError=null}_resetInitialViewPropertiesFromContent(){if(!this.defaultsFromMap)return;const e=()=>this.defaultsFromMap&&this.defaultsFromMap.start();this.defaultsFromMap.reset(),this._currentSpatialReference=null,this.notifyChange("spatialReference"),this.handles.remove("defaultsFromMap"),this.handles.add([(0,m.YP)(this,"spatialReference",((t,i)=>{(0,Mo.fS)(t,i)||e()})),(0,m.YP)(this,"initialExtentRequired",e),(0,S.Os)(e)],"defaultsFromMap")}};Va.views=new d.Z,(0,n._)([(0,O.B)("toolViewManager.activeTool")],Va.prototype,"activeTool",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Va.prototype,"allLayerViews",void 0),(0,n._)([(0,l.Cb)()],Va.prototype,"animation",void 0),(0,n._)([(0,l.Cb)()],Va.prototype,"basemapView",void 0),(0,n._)([(0,l.Cb)()],Va.prototype,"defaultsFromMap",void 0),(0,n._)([(0,l.Cb)()],Va.prototype,"fatalError",void 0),(0,n._)([(0,l.Cb)({type:vo.Z})],Va.prototype,"extent",void 0),(0,n._)([(0,l.Cb)((0,Po.$o)())],Va.prototype,"graphics",void 0),(0,n._)([(0,l.Cb)({readOnly:!0,t
1ype:So.Z,dependsOn:["map.heightModelInfo?","defaultsFromMap.heightModelInfo"]})],Va.prototype,"heightModelInfo",null),(0,n._)([(0,l.Cb)({readOnly:!0})],Va.prototype,"interacting",null),(0,n._)([(0,l.Cb)({readOnly:!0})],Va.prototype,"navigating",void 0),(0,n._)([(0,l.Cb)({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_currentSpatialReference","initialExtentRequired","initialExtent","defaultsFromMap.isSpatialReferenceDone","defaultsFromMap.isTileInfoDone"]})],Va.prototype,"preconditionsReady",null),(0,n._)([(0,l.Cb)({type:d.Z,readOnly:!0})],Va.prototype,"layerViews",void 0),(0,n._)([(0,l.Cb)({type:Do})],Va.prototype,"magnifier",void 0),(0,n._)([(0,l.Cb)({value:null,type:xo.Z})],Va.prototype,"map",null),(0,n._)([(0,l.Cb)()],Va.prototype,"padding",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Va.prototype,"ready",void 0),(0,n._)([(0,l.Cb)({type:yo.Z})],Va.prototype,"spatialReference",null),(0,n._)([(0,l.Cb)()],Va.prototype,"spatialReferenceWarningDelay",void 0),(0,n._)([(0,l.Cb)()],Va.prototype,"stationary",null),(0,n._)([(0,l.Cb)({readOnly:!0})],Va.prototype,"supportsGround",void 0),(0,n._)([(0,l.Cb)({type:ko.Z})],Va.prototype,"timeExtent",void 0),(0,n._)([(0,O.B)("toolViewManager.tools")],Va.prototype,"tools",void 0),(0,n._)([(0,l.Cb)()],Va.prototype,"toolViewManager",void 0),(0,n._)([(0,O.B)("analysisManager.analyses")],Va.prototype,"analyses",void 0),(0,n._)([(0,l.Cb)()],Va.prototype,"analysisManager",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Va.prototype,"type",void 0),(0,n._)([(0,l.Cb)({type:Number})],Va.prototype,"scale",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Va.prototype,"updating",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Va.prototype,"initialExtentRequired",void 0),(0,n._)([(0,l.Cb)({readOnly:!0,type:vo.Z})],Va.prototype,"initialExtent",null),(0,n._)([(0,l.Cb)()],Va.prototype,"cursor",null),(0,n._)([(0,l.Cb)()],Va.prototype,"renderContext",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Va.prototype,"input",void 0),(0,n._)([(0,l.Cb)({type:va,nonNullable:!0})],Va.prototype,"navigation",void 0),(0,n._)([(0,l.Cb)()],Va.prototype,"layerViewManager",void 0),(0,n._)([(0,l.Cb)()],Va.prototype,"width",void 0),(0,n._)([(0,l.Cb)()],Va.prototype,"height",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Va.prototype,"resizing",void 0),(0,n._)([(0,l.Cb)({value:null,readOnly:!0})],Va.prototype,"size",null),(0,n._)([(0,l.Cb)({readOnly:!0})],Va.prototype,"suspended",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Va.prototype,"viewEvents",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Va.prototype,"persistableViewModels",void 0),(0,n._)([(0,l.Cb)()],Va.prototype,"_isValid",void 0),(0,n._)([(0,l.Cb)()],Va.prototype,"_readyCycleForced",void 0),(0,n._)([(0,l.Cb)()],Va.prototype,"_currentSpatialReference",void 0),Va=Ea=(0,n._)([(0,c.j)("esri.views.View")],Va);var Oa=Va;let Ra=class extends Io.D{constructor(e){super(e),this.state="running",this.target=null}initialize(){this.addResolvingPromise(new Promise(((e,t)=>this._dfd={resolve:e,reject:t})))}get done(){return"finished"===this.state||"stopped"===this.state}stop(){"stopped"!==this.state&&"finished"!==this.state&&(this._set("state","stopped"),this._dfd.reject(new h.Z("ViewAnimation stopped")))}finish(){"stopped"!==this.state&&"finished"!==this.state&&(this._set("state","finished"),this._dfd.resolve())}update(e,t){t||(t=(0,fi.y8)(e)?"waiting-for-target":"running"),this._set("target",e),this._set("state",t)}};(0,n._)([(0,l.Cb)({readOnly:!0})],Ra.prototype,"done",null),(0,n._)([(0,l.Cb)({readOnly:!0,type:String})],Ra.prototype,"state",void 0),(0,n._)([(0,l.Cb)()],Ra.prototype,"target",void 0),Ra=(0,n._)([(0,c.j)("esri.views.ViewAnimation")],Ra),function(e){e.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(Ra||(Ra={}));var Da=Ra,ja=i(69050),Za=i(50590);class Na{constructor(e,t,i,s){const n=e.targetGeometry,r=t.targetGeometry;s?"string"==typeof s&&(s=(0,Za.Qc)(s)||Za.LI.ease):s=Za.LI.ease,this.easing=s,this.duration=i,this.sCenterX=n.x,this.sCenterY=n.y,this.sScale=e.scale,this.sRotation=e.rotation,this.tCenterX=r.x,this.tCenterY=r.y,this.tScale=t.scale,this.tRotation=t.rotation,this.dCenterX=this.tCenterX-this.sCenterX,this.dCenterY=this.tCenterY-this.sCenterY,this.dScale=this.tScale-this.sScale,this.dRotation=this.tRotation-this.sRotation,this.dRotation>180?this.dRotation-=360:this.dRotation<-180&&(this.dRotation+=360)}applyRatio(e,t){const i=this.easing(t);let s,n,r,o;t>=1?(s=this.tCenterX,n=this.tCenterY,r=this.tRotation,o=this.tScale):(s=this.sCenterX+i*this.dCenterX,n=this.sCenterY+i*this.dCenterY,r=this.sRotation+i*this.dRotation,o=this.sScale+i*this.dScale),e.targetGeometry.x=s,e.targetGeometry.y=n,e.scale=o,e.rotation=r}}let za=class extends L.Z{constructor(e){super(e),this.duration=200,this.transition=null,this.easing=Za.LI.ease,this.view=null,this.viewpoint=null,this.viewpoint=new _o.Z({targetGeometry:new Bs.Z,scale:0,rotation:0}),this._updateTask=(0,S.A)({postRender:this._postRender.bind(this)}),this._updateTask.pause()}destroy(){this._updateTask.remove(),this._updateTask=null}animate(e,t,i){this.stop();const s=this.viewpoint;(0,ja.JG)(s,t),this.transition=new Na(this.viewpoint,e.target,i&&i.duration||this.duration,i&&i.easing||this.easing);const n=()=>{this.animation===e&&this._updateTask&&("finished"===e.state&&(this.transition.applyRatio(this.viewpoint,1),this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())),this.animation=null,this.updateFunction=null)};return e.when(n,n),this._startTime=performance.now(),this._updateTask.resume(),this.animation=e,e}animateContinous(e,t){this.stop(),this.updateFunction=t,this.viewpoint=e;const i=new Da({target:e.clone()}),s=()=>{this.animation===i&&this._updateTask&&(this.animation=null,this.updateFunction=null)};return i.when(s,s),this._startTime=performance.now(),this._updateTask.resume(),this.animation=i,i}stop(){this.animation&&(this.animation.stop(),this.animation=null,this.updateFunction=null)}_postRender(e){const t=this.animation;if(t&&t.state!==Da.State.STOPPED){if(this.updateFunction)this.updateFunction(this.viewpoint,e.deltaTime);else{const e=(performance.now()-this._startTime)/this.transition.duration,t=e>=1;this.transition.applyRatio(this.viewpoint,e),t&&this.animation.finish()}this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())}else this._updateTask.pause()}};(0,n._)([(0,l.Cb)()],za.prototype,"animation",void 0),(0,n._)([(0,l.Cb)()],za.prototype,"duration",void 0),(0,n._)([(0,l.Cb)()],za.prototype,"transition",void 0),(0,n._)([(0,l.Cb)()],za.prototype,"easing",void 0),(0,n._)([(0,l.Cb)()],za.prototype,"view",void 0),(0,n._)([(0,l.Cb)()],za.prototype,"viewpoint",void 0),za=(0,n._)([(0,c.j)("esri.views.2d.AnimationManager")],za);var Ba=za;var Ga=class{constructor(e){this.view=e,this._frameTaskHandle=null,this._updateRequested=!1,this.stationary=!0,this.updateEnabled=!0,this.animationInProgress=!1,this.prepare=()=>{this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions},this.update=()=>{if(this._updateRequested=!1,!this.updateEnabled)return;const{basemapView:e,graphicsView:t,labelManager:i,layerViews:s,state:{id:n}}=this.view;
1e.baseLayerViews.forEach(this._updateLayerView,this),s.forEach(this._updateLayerView,this),e.referenceLayerViews.forEach(this._updateLayerView,this),(0,o.pC)(i)&&(i.lastUpdateId!==n&&(i.viewChange(),i.lastUpdateId=n),i.updateRequested&&i.processUpdate(this._updateParameters)),(0,o.pC)(t)&&(t.lastUpdateId!==n&&(t.viewChange(),t.lastUpdateId=n),t.updateRequested&&t.processUpdate(this._updateParameters)),this.animationInProgress||this._updateRequested||this._frameTaskHandle.pause()}}destroy(){this.stop()}start(){this.stationary=this.view.stationary,this._updateParameters={state:this.view.state,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:this.view.renderingOptions},this._stationaryHandle=this.view.watch("stationary",(e=>{this.stationary=e,this.requestFrame()})),this._frameTaskHandle=(0,S.A)(this)}stop(){this._frameTaskHandle&&(this._stationaryHandle.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0,this.animationInProgress=!1)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(e){const t=this.view.state,i=e.lastUpdateId;null!=i&&(this.stationary||e.moving)||(e.moving=!0,e.moveStart()),i!==t.id&&e.viewChange(),this.stationary&&e.moving&&(e.moving=!1,e.moveEnd()),e.lastUpdateId=t.id,e.updateRequested&&e.processUpdate(this._updateParameters),"layerViews"in e&&e.layerViews.forEach(this._updateLayerView,this)}};function Wa(){return Promise.all([Promise.all([i.e(9351),i.e(2828),i.e(123)]).then(i.bind(i,40123)),Promise.all([i.e(9351),i.e(2828),i.e(8953)]).then(i.bind(i,88953))])}const Ua=()=>Wa().then((()=>Promise.all([i.e(9351),i.e(3242)]).then(i.bind(i,83242)))),Ha=()=>Wa().then((()=>Promise.all([i.e(9351),i.e(3213)]).then(i.bind(i,3213)))),qa={"base-dynamic":()=>Wa().then((()=>Promise.all([i.e(9351),i.e(6782)]).then(i.bind(i,6782)))),"base-tile":Ua,"bing-maps":Ua,csv:Ha,"geo-rss":()=>Wa().then((()=>Promise.all([i.e(9351),i.e(2738)]).then(i.bind(i,42738)))),feature:Ha,geojson:Ha,graphics:()=>Wa().then((()=>Promise.all([i.e(9351),i.e(4372)]).then(i.bind(i,14372)))),group:()=>Wa().then((()=>Promise.all([i.e(9351),i.e(4266)]).then(i.bind(i,54266)))),imagery:()=>Wa().then((()=>Promise.all([i.e(9351),i.e(1329),i.e(7237)]).then(i.bind(i,97237)))),"imagery-tile":()=>Wa().then((()=>Promise.all([i.e(9351),i.e(1329),i.e(3369)]).then(i.bind(i,83369)))),kml:()=>Wa().then((()=>Promise.all([i.e(9351),i.e(2052)]).then(i.bind(i,22052)))),"map-image":()=>Wa().then((()=>Promise.all([i.e(9351),i.e(9772)]).then(i.bind(i,89772)))),"map-notes":()=>Wa().then((()=>Promise.all([i.e(9351),i.e(6857)]).then(i.bind(i,96857)))),"ogc-feature":()=>Wa().then((()=>Promise.all([i.e(9351),i.e(3213),i.e(1675)]).then(i.bind(i,91675)))),"open-street-map":Ua,route:()=>Wa().then((()=>Promise.all([i.e(9351),i.e(9431)]).then(i.bind(i,79431)))),stream:()=>Wa().then((()=>Promise.all([i.e(9351),i.e(3213),i.e(4473)]).then(i.bind(i,14473)))),tile:Ua,"vector-tile":()=>Wa().then((()=>Promise.all([i.e(9351),i.e(3043),i.e(7696)]).then(i.bind(i,67696)))),wcs:()=>Wa().then((()=>Promise.all([i.e(9351),i.e(1329),i.e(3369)]).then(i.bind(i,83369)))),"web-tile":Ua,wms:()=>Wa().then((()=>Promise.all([i.e(9351),i.e(3255)]).then(i.bind(i,23255)))),wmts:()=>Wa().then((()=>Promise.all([i.e(9351),i.e(4568)]).then(i.bind(i,84568)))),"base-elevation":null,"building-scene":null,elevation:null,"integrated-mesh":null,"point-cloud":null,scene:null,unknown:null,unsupported:null};const $a=e=>(0,o.pC)(qa[e.type]),Ka=e=>{const t=qa[e.type];if(!(0,o.pC)(t))throw function(e){const t=e.declaredClass?e.declaredClass.slice(e.declaredClass.lastIndexOf(".")+1):"Unknown",i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new h.Z(`${i}:view-not-supported`,`${t} is not supported in 2D`)}(e);return t(e)};var Ya,Xa=i(89542),Qa=i(13054),Ja=i(27127),el=i(56060),tl=i(38028),il=i(55709);const sl=a.Z.getLogger("esri.views.MapView");let nl=Ya=class extends L.Z{constructor(e){super(e),this.geometry=null,this.spatialReference=null}get normalizedGeometry(){return this.geometry&&this.spatialReference?this.spatialReference.equals(this.geometry.spatialReference)?this.geometry:(0,zs.Q8)(this.geometry,this.spatialReference)?(0,zs.iV)(this.geometry,this.spatialReference):(0,el.kR)()?(0,el.iV)(this.geometry,this.spatialReference):(sl.error("#constraints.geometry","unsupported coordinate system. The source geometry cannot be projected to the view's coordinate system. The projection engine cannot be loaded.",{geometry:this.geometry}),null):null}constrain(e,t){if(!this.normalizedGeometry)return e;const i=e.targetGeometry;if("extent"===this.normalizedGeometry.type?(0,Ja.aV)(this.normalizedGeometry,i):(0,Ja.CI)(this.normalizedGeometry,i))return e;const{coordinate:s}=function(e,t){const{spatialReference:i}=t,s=[t.x,t.y];let n=Number.POSITIVE_INFINITY,r=0,o=0;const a=[0,0],l="extent"===e.type?[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]:e.rings;for(const c of l)for(let e=0;e<c.length-1;e++){(0,tl.Tx)(a,s,c,e);const t=(0,il.i)(s,a);t<n&&(n=t,r=a[0],o=a[1])}return{coordinate:new Bs.Z({x:r,y:o,spatialReference:i}),distance:n}}(this.normalizedGeometry,i);return s?(e.targetGeometry=s,e):e}clone(){var e,t;return new Ya({geometry:null==(e=this.geometry)?void 0:e.clone(),spatialReference:null==(t=this.spatialReference)?void 0:t.clone()})}};var rl;(0,n._)([(0,l.Cb)({constructOnly:!0})],nl.prototype,"geometry",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],nl.prototype,"normalizedGeometry",null),(0,n._)([(0,l.Cb)({constructOnly:!0})],nl.prototype,"spatialReference",void 0),nl=Ya=(0,n._)([(0,c.j)("esri.views.2d.constraints.GeometryConstraint")],nl);let ol=rl=class extends L.Z{constructor(){super(...arguments),this.enabled=!0,this.rotationEnabled=!0}constrain(e,t){return this.enabled&&t?(this.rotationEnabled||(e.rotation=t.rotation),e):e}clone(){return new rl({enabled:this.enabled,rotationEnabled:this.rotationEnabled})}};(0,n._)([(0,l.Cb)()],ol.prototype,"enabled",void 0),(0,n._)([(0,l.Cb)()],ol.prototype,"rotationEnabled",void 0),ol=rl=(0,n._)([(0,c.j)("esri.views.2d.constraints.RotationConstraint")],ol);var al,ll=ol;let cl=al=class extends L.Z{constructor(e){super(e),this._lodByScale={},this._scales=[],this.effectiveLODs=null,this.effectiveMinZoom=-1,this.effectiveMaxZoom=-1,this.effectiveMinScale=0,this.effectiveMaxScale=0,this.lods=null,this.minZoom=-1,this.maxZoom=-1,this.minScale=0,this.maxScale=0,this.snapToZoom=!0}initialize(){let e,{lods:t,minScale:i,maxScale:s,minZoom:n,maxZoom:r}=this,o=-1,a=-1,l=!1,c=!1;if(0!==i&&0!==s&&i<s&&([i,s]=[s,i]),!t||!t.length)return this._set("effectiveMinScale",i),void this._set("effectiveMaxScale",s);t=t.map((e=>e.clone())),t.sort(((e,t)=>t.scale-e.scale)),t.forEach(((e,t)=>e.level=t));for(const h of t)!l&&i>0&&i>=h.scale&&(o=h.level,l=!0),!c&&s>0&&s>=h.scale&&(a=e?e.level:-1,c=!0),e=h;-1===n&&(n=0===i?0:o),-1===r&&(r=0===s?t.length-1:a),n=Math.max(n,0),n=Math.min(n,t.length-1),r=M
1ath.max(r,0),r=Math.min(r,t.length-1),n>r&&([n,r]=[r,n]),i=t[n].scale,s=t[r].scale,t.splice(0,n),t.splice(r-n+1,t.length),t.forEach(((e,t)=>{this._lodByScale[e.scale]=e,this._scales[t]=e.scale})),this._set("effectiveLODs",t),this._set("effectiveMinZoom",n),this._set("effectiveMaxZoom",r),this._set("effectiveMinScale",i),this._set("effectiveMaxScale",s)}constrain(e,t){if(t&&e.scale===t.scale)return e;const i=this.effectiveMinScale,s=this.effectiveMaxScale,n=e.targetGeometry,r=t&&t.targetGeometry,o=0!==s&&e.scale<s,a=0!==i&&e.scale>i;if(o||a){const o=a?i:s;if(r){const i=(o-t.scale)/(e.scale-t.scale);n.x=r.x+(n.x-r.x)*i,n.y=r.y+(n.y-r.y)*i}e.scale=o}return this.snapToZoom&&this.effectiveLODs&&(e.scale=this._getClosestScale(e.scale)),e}fit(e){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(e,null);const t=this.scaleToZoom(e.scale),i=Math.abs(t-Math.floor(t));return e.scale=this.zoomToScale(i>.99?Math.round(t):Math.floor(t)),e}zoomToScale(e){if(!this.effectiveLODs)return 0;e-=this.effectiveMinZoom,e=Math.max(0,e);const t=this._scales;if(e<=0)return t[0];if(e>=t.length)return t[t.length-1];const i=Math.round(e-.5),s=Math.round(e);return t[s]+(s-e)*(t[i]-t[s])}scaleToZoom(e){if(!this.effectiveLODs)return-1;const t=this._scales;let i,s;if(e>=t[0])return this.effectiveMinZoom;if(e<=t[t.length-1])return this.effectiveMaxZoom;for(let n=0;n<t.length-1;n++){if(i=t[n],s=t[n+1],s===e)return n+this.effectiveMinZoom+1;if(i>e&&s<e)return n+this.effectiveMinZoom+1-(e-s)/(i-s)}}snapToClosestScale(e){if(!this.effectiveLODs)return e;const t=this.scaleToZoom(e);return this.zoomToScale(Math.round(t))}snapToNextScale(e,t=.5){if(!this.effectiveLODs)return e*t;const i=Math.round(this.scaleToZoom(e));return this.zoomToScale(i+1)}snapToPreviousScale(e,t=2){if(!this.effectiveLODs)return e*t;const i=Math.round(this.scaleToZoom(e));return this.zoomToScale(i-1)}clone(){return new al({lods:this.lods,minZoom:this.minZoom,maxZoom:this.maxZoom,minScale:this.minScale,maxScale:this.maxScale})}_getClosestScale(e){return this._lodByScale[e]||(e=this._scales.reduce(((t,i)=>Math.abs(i-e)<=Math.abs(t-e)?i:t),this._scales[0])),this._lodByScale[e].scale}};(0,n._)([(0,l.Cb)({readOnly:!0})],cl.prototype,"effectiveLODs",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],cl.prototype,"effectiveMinZoom",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],cl.prototype,"effectiveMaxZoom",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],cl.prototype,"effectiveMinScale",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],cl.prototype,"effectiveMaxScale",void 0),(0,n._)([(0,l.Cb)({type:[Qa.Z]})],cl.prototype,"lods",void 0),(0,n._)([(0,l.Cb)()],cl.prototype,"minZoom",void 0),(0,n._)([(0,l.Cb)()],cl.prototype,"maxZoom",void 0),(0,n._)([(0,l.Cb)()],cl.prototype,"minScale",void 0),(0,n._)([(0,l.Cb)()],cl.prototype,"maxScale",void 0),(0,n._)([(0,l.Cb)()],cl.prototype,"snapToZoom",void 0),cl=al=(0,n._)([(0,c.j)("esri.views.2d.constraints.ZoomConstraint")],cl);var hl=cl;const dl={base:null,key:"type",typeMap:{extent:vo.Z,polygon:Xa.Z}};let ul=class extends Es.Z.EventedAccessor{constructor(){super(...arguments),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0}initialize(){this.watch(["_zoom","_rotation"],this.emit.bind(this,"update"),!0)}destroy(){this.view=null,this._set("_zoom",null),this._set("_rotation",null)}set geometry(e){e?this._set("geometry",e):this._set("geometry",null)}get _defaultLODs(){const e=this.get("view.defaultsFromMap.tileInfo"),t=this.get("view.spatialReference");return e&&t&&e.spatialReference.equals(t)?e.lods:null}get _geometry(){return new nl({geometry:this.geometry,spatialReference:this.view.spatialReference})}get _rotation(){return new ll({rotationEnabled:this.rotationEnabled})}get _zoom(){return new hl({lods:this.lods||this._defaultLODs,minZoom:this.minZoom,maxZoom:this.maxZoom,minScale:this.minScale,maxScale:this.maxScale,snapToZoom:this.snapToZoom})}canZoomInTo(e){const t=this.effectiveMaxScale;return 0===t||e>=t}canZoomOutTo(e){const t=this.effectiveMinScale;return 0===t||e<=t}constrain(e,t){return this._zoom.constrain(e,t),this._rotation.constrain(e,t),this._geometry.constrain(e,t),e}constrainByGeometry(e){return this._geometry.constrain(e)}fit(e){return this._zoom.fit(e)}zoomToScale(e){return this._zoom.zoomToScale(e)}scaleToZoom(e){return this._zoom.scaleToZoom(e)}snapScale(e){return this._zoom.snapToClosestScale(e)}snapToNextScale(e){return this._zoom.snapToNextScale(e)}snapToPreviousScale(e){return this._zoom.snapToPreviousScale(e)}};(0,n._)([(0,l.Cb)({readOnly:!0,aliasOf:"_zoom.effectiveLODs"})],ul.prototype,"effectiveLODs",void 0),(0,n._)([(0,l.Cb)({readOnly:!0,aliasOf:"_zoom.effectiveMinScale"})],ul.prototype,"effectiveMinScale",void 0),(0,n._)([(0,l.Cb)({readOnly:!0,aliasOf:"_zoom.effectiveMaxScale"})],ul.prototype,"effectiveMaxScale",void 0),(0,n._)([(0,l.Cb)({readOnly:!0,aliasOf:"_zoom.effectiveMinZoom"})],ul.prototype,"effectiveMinZoom",void 0),(0,n._)([(0,l.Cb)({readOnly:!0,aliasOf:"_zoom.effectiveMaxZoom"})],ul.prototype,"effectiveMaxZoom",void 0),(0,n._)([(0,l.Cb)({types:dl,value:null})],ul.prototype,"geometry",null),(0,n._)([(0,l.Cb)({type:[Qa.Z]})],ul.prototype,"lods",void 0),(0,n._)([(0,l.Cb)()],ul.prototype,"minScale",void 0),(0,n._)([(0,l.Cb)()],ul.prototype,"maxScale",void 0),(0,n._)([(0,l.Cb)()],ul.prototype,"minZoom",void 0),(0,n._)([(0,l.Cb)()],ul.prototype,"maxZoom",void 0),(0,n._)([(0,l.Cb)()],ul.prototype,"rotationEnabled",void 0),(0,n._)([(0,l.Cb)()],ul.prototype,"snapToZoom",void 0),(0,n._)([(0,l.Cb)()],ul.prototype,"view",void 0),(0,n._)([(0,l.Cb)()],ul.prototype,"_defaultLODs",null),(0,n._)([(0,l.Cb)({type:nl})],ul.prototype,"_geometry",null),(0,n._)([(0,l.Cb)({type:ll})],ul.prototype,"_rotation",null),(0,n._)([(0,l.Cb)({readOnly:!0,t
1ype:hl})],ul.prototype,"_zoom",null),ul=(0,n._)([(0,c.j)("esri.views.2d.MapViewConstraints")],ul);var pl,ml=ul,fl=i(69666),gl=i(93011),yl=i(1662),vl=i(40278),_l=i(69114),bl=i(59566),wl=i(19710),Cl=i(55542);function Ml(e){return function(e){return e instanceof Float32Array&&e.length>=2}(e)||function(e){return Array.isArray(e)&&e.length>=2}(e)}const Il=[0,0];let Tl=pl=class extends g.wq{constructor(...e){super(...e),this._viewpoint2D={center:(0,fl.a)(),rotation:0,scale:0,spatialReference:null},this.center=[0,0],this.extent=new vo.Z,this.id=0,this.inverseTransform=(0,_l.c)(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=(0,_l.c)(),this.transformNoRotation=(0,_l.c)(),this.displayMat3=(0,wl.c)(),this.displayViewMat3=(0,wl.c)(),this.viewMat3=(0,wl.c)(),this.viewMat2d=(0,bl.c)(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(e){this._set("pixelRatio",e),this._update()}set size(e){this._set("size",e),this._update()}set viewpoint(e){if(e){const t=this._viewpoint2D,i=e.targetGeometry;t.center[0]=i.x,t.center[1]=i.y,t.rotation=e.rotation,t.scale=e.scale,t.spatialReference=i.spatialReference}this._update()}copy(e){const t=this.size,i=this.viewpoint;return i&&t?(this.viewpoint=(0,ja.JG)(i,e.viewpoint),this._set("size",(0,il.c)(t,e.size))):(this.viewpoint=e.viewpoint.clone(),this._set("size",[e.size[0],e.size[1]])),this._set("pixelRatio",e.pixelRatio),this}clone(){return new pl({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(e,t,i){return Ml(t)?(0,il.t)(e,t,this.inverseTransform):(Il[0]=t,Il[1]=i,(0,il.t)(e,Il,this.inverseTransform))}toScreen(e,t,i){return Ml(t)?(0,il.t)(e,t,this.transform):(Il[0]=t,Il[1]=i,(0,il.t)(e,Il,this.transform))}toScreenNoRotation(e,t,i){return Ml(t)?(0,il.t)(e,t,this.transformNoRotation):(Il[0]=t,Il[1]=i,(0,il.t)(e,Il,this.transformNoRotation))}getScreenTransform(e,t){const{center:i}=this._viewpoint2D,s=this._get("pixelRatio")||1,n=this._get("size");return(0,ja.Rb)(e,i,n,t,0,s),e}_update(){const{center:e,spatialReference:t,scale:i,rotation:s}=this._viewpoint2D,n=this._get("pixelRatio")||1,r=this._get("size"),o=new _o.Z({targetGeometry:new Bs.Z(e[0],e[1],t),scale:i,rotation:s});if(this._set("viewpoint",o),!r||!t||!i)return;this.resolution=(0,ja.uG)(o),this.rotation=s,this.scale=i,this.spatialReference=t,(0,il.c)(this.center,e);const a=0!==r[0]?2/r[0]:0,l=0!==r[1]?-2/r[1]:0;(0,yl.s)(this.displayMat3,a,0,0,0,l,0,-1,1,1);const c=(0,yl.i)(this.viewMat3),h=(0,Cl.f)(r[0]/2,r[1]/2),d=(0,Cl.f)(-r[0]/2,-r[1]/2),u=(0,gl.t)(s);(0,yl.a)(c,c,h),(0,yl.r)(c,c,u),(0,yl.a)(c,c,d),(0,yl.m)(this.displayViewMat3,this.displayMat3,c);const p=(0,vl.i)(this.viewMat2d);return(0,vl.t)(p,p,h),(0,vl.r)(p,p,u),(0,vl.t)(p,p,d),(0,ja.bk)(this.extent,o,r),(0,ja.Ck)(this.transform,o,r,n),(0,vl.a)(this.inverseTransform,this.transform),(0,ja.Jp)(this.transformNoRotation,o,r,n),this.worldScreenWidth=(0,ja.L2)(this.spatialReference,this.resolution),this._set("id",this.id+1),this}};(0,n._)([(0,l.Cb)({readOnly:!0})],Tl.prototype,"id",void 0),(0,n._)([(0,l.Cb)({value:1,json:{write:!0}})],Tl.prototype,"pixelRatio",null),(0,n._)([(0,l.Cb)({json:{write:!0}})],Tl.prototype,"size",null),(0,n._)([(0,l.Cb)({type:_o.Z,json:{write:!0}})],Tl.prototype,"viewpoint",null),Tl=pl=(0,n._)([(0,c.j)("esri.views.2d.ViewState")],Tl);var xl=Tl;let kl=class extends L.Z{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}};(0,n._)([(0,l.Cb)()],kl.prototype,"left",void 0),(0,n._)([(0,l.Cb)()],kl.prototype,"top",void 0),(0,n._)([(0,l.Cb)()],kl.prototype,"right",void 0),(0,n._)([(0,l.Cb)()],kl.prototype,"bottom",void 0),kl=(0,n._)([(0,c.j)("esri.views.2d.PaddedViewState.Padding")],kl);let Sl=class extends xl{constructor(...e){super(...e),this.paddedViewState=new xl,this._updateContent=(()=>{const e=(0,fl.a)();return()=>{const t=this._get("size"),i=this._get("padding");if(!t||!i)return;const s=this.paddedViewState;(0,il.s)(e,i.left+i.right,i.top+i.bottom),(0,il.d)(e,t,e),(0,il.c)(s.size,e);const n=s.viewpoint;n&&(this.viewpoint=n)}})(),this.watch(["size","padding"],this._updateContent,!0),this.padding=new kl,this.size=[0,0]}set padding(e){this._set("padding",e||new kl)}set viewpoint(e){if(e){const t=e.clone();this.paddedViewState.viewpoint=e,(0,ja.H4)(t,e,this._get("size"),this._get("padding"));const i=this._viewpoint2D,s=t.targetGeometry;i.center[0]=s.x,i.center[1]=s.y,i.rotation=t.rotation,i.scale=t.scale,i.spatialReference=s.spatialReference,this._update()}}};(0,n._)([(0,l.Cb)()],Sl.prototype,"paddedViewState",void 0),(0,n._)([(0,l.Cb)({type:kl})],Sl.prototype,"padding",null),(0,n._)([(0,l.Cb)()],Sl.prototype,"viewpoint",null),Sl=(0,n._)([(0,c.j)("esri.views.2d.PaddedViewState")],Sl);var Pl=Sl,Ll=(i(48899),i(63941)),El=(i(17224),i(98086),i(45479));const Al=a.Z.getLogger("esri.views.MapView");let Fl=class extends(Co(Oa)){constructor(e){super(e),this._stationaryTimer=null,this.frameTask=new Ga(this),this.featuresTilingScheme=null,this.fullOpacity=1,this.graphicsView=null,this.initialExtent=null,this.labelManager=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.resizeAlign="center",this.supportsGround=!1,this.timeline=new El.T,this.type="2d",this.constraints=new ml,this.padding={top:0,right:0,bottom:0,left:0};const t=this.handles,i=()=>this.notifyChange("updating");t.add([this.watch("viewpoint",(()=>{this._lastStationaryEventTimestamp=performance.now(),this._flipStationary(160)}),!0),this.on("resize",(e=>this._resizeHandler(e))),this.watch("animationManager.animation",(e=>{this.animation=e})),this.allLayerViews.on("change",(()=>
1{i(),t.remove("map-view-base-layerViewsUpdating"),t.add(this.allLayerViews.map((e=>e.watch("updating",i))),"map-view-base-layerViewsUpdating")}))],"map-view-base")}destroy(){this.destroyed||(this._set("preconditionsReady",!1),this._gotoTask=this.frameTask=null)}set animation(e){const t=this._get("animation");if(e===t)return;if(t&&t.stop(),!e||e.isFulfilled())return void this._set("animation",null);this._set("animation",e),this.frameTask.animationInProgress=!0;const i=()=>{e===this._get("animation")&&(this._set("animation",null),this.frameTask.requestFrame()),this.frameTask.animationInProgress=!1};e.when(i,i)}get center(){if(!this.ready)return this._get("center");const{center:e,spatialReference:t}=this.state.paddedViewState;return new Bs.Z({x:e[0],y:e[1],spatialReference:t})}set center(e){if(null==e)return;if(!this._normalizeInput(e))return void Al.error("#center",`incompatible spatialReference ${JSON.stringify(e.spatialReference)} with view's spatialReference ${JSON.stringify(this.spatialReference)}`);if(!this.ready)return this._set("center",e),void this.notifyChange("initialExtentRequired");const t=this.viewpoint;(0,ja.o2)(t,t,e),this.viewpoint=t}set constraints(e){const t=this._get("constraints");t&&(this.handles.remove("map-view-base-constraints"),t.destroy()),this._set("constraints",e),e&&(e.view=this,this.ready&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint)),this.handles.add(e.on("update",(()=>{this.ready&&this.state&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint))})),"map-view-base-constraints"))}get extent(){return this.ready?this.state.paddedViewState.extent.clone():this._get("extent")}set extent(e){if(null==e)return;const t=this._normalizeInput(e);if(!t)return void Al.error("#center",`incompatible spatialReference ${JSON.stringify(e.spatialReference)} with view's spatialReference ${JSON.stringify(this.spatialReference)}`);if(!t.width||!t.height)return void Al.error("#extent","invalid extent size");if(!this.ready)return this._set("extent",t),this._set("center",null),this._set("viewpoint",null),this._set("scale",0),this._set("zoom",-1),void this.notifyChange("initialExtentRequired");const i=this.viewpoint;(0,ja.qf)(i,i,t,this.size,{constraints:this.constraints}),this.viewpoint=i}get initialExtentRequired(){const{extent:e,center:t,scale:i,viewpoint:s,zoom:n}=this;return!this.get("map.initialViewProperties.viewpoint")&&!e&&(!t||0===i&&-1===n)&&!s}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(e){this.ready?(this.state.padding=e,this._set("padding",this.state.padding)):this._set("padding",e)}get resolution(){return this.state?this.state.resolution:0}get rotation(){return this.ready?this.state.rotation:this._get("rotation")}set rotation(e){if(isNaN(e))return;if(!this.ready)return void this._set("rotation",e);const t=this.viewpoint;(0,ja.YQ)(t,t,e),this.viewpoint=t}get scale(){return this.ready?this.state.scale:this._get("scale")}set scale(e){if(!e||isNaN(e))return;if(!this.ready){this._set("scale",e),this._set("zoom",-1);const t=this._get("extent");return t&&(this._set("extent",null),this._set("center",t.center)),void this.notifyChange("initialExtentRequired")}const t=this.viewpoint;(0,ja.Hy)(t,t,e),this.viewpoint=t}get stationary(){return!(this.animation||this.navigating||this._get("resizing")||this._stationaryTimer)}get updating(){return!this.destroyed&&(!0===this.get("layerViewManager.updating")||!0===this.get("labelManager.updating")||!0===this.get("graphicsView.updating")||this.allLayerViews.some((e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)))}get viewpoint(){if(!this.ready)return this._get("viewpoint");const e=this.state.paddedViewState;return e&&e.viewpoint.clone()}set viewpoint(e){if(null==e)return;const t=this._normalizeInput(e);if(!t)return void(!e.scale||isNaN(e.scale)?Al.error("#viewpoint",`invalid scale value of ${e.scale}`):(0,o.Wi)(e.targetGeometry)?Al.error("#viewpoint","geometry not defined"):Al.error("#viewpoint",`incompatible spatialReference ${JSON.stringify(e.targetGeometry.spatialReference)} with view's spatialReference ${JSON.stringify(this.spatialReference)}`));if(!this.ready)return this._set("viewpoint",t),this._set("extent",null),this._set("center",null),this._set("zoom",-1),this._set("scale",0),void this.notifyChange("initialExtentRequired");const i=new _o.Z({targetGeometry:new Bs.Z,scale:0,rotation:0});(0,ja.JG)(i,t),this.constraints.constrain(i,this.state.paddedViewState.viewpoint),this.state.viewpoint=i,this.frameTask.requestFrame(),this._set("viewpoint",i)}get zoom(){return this.ready?this.constraints.scaleToZoom(this.scale):this._get("zoom")}set zoom(e){if(null==e)return;if(!this.ready){this.notifyChange("initialExtentRequired"),this._set("zoom",e),this._set("scale",0);const t=this._get("extent");t&&(this._set("extent",null),this._set("center",t.center))}if(!this.constraints.effectiveLODs)return;const t=this.viewpoint;(0,ja.Hy)(t,t,this.constraints.zoomToScale(e)),this.viewpoint=t,this._set("zoom",this.constraints.scaleToZoom(this.scale))}goTo(e,t){if(e)return this.animation&&(this.animation=null),this._createAnimation(),(0,m.LR)(this,"ready",t&&t.signal).then((()=>{const i={animate:!0,...t},s=(0,ja.km)(e,this);return this.animation.update(s),this._gotoTask={},i.animate?this._gotoAnimated(s,i):this._gotoImmediate(s,i)}));Al.error("#goTo()","target cannot be null or undefined")}
1hitTest(e){return Promise.reject("Should be implemented by subclasses")}popupHitTest(e){return this.hitTest(e).then((t=>({...t,mapPoint:this.toMap(e)})))}toMap(e){if(!this.ready)return null;const[t,i]=this.state.toMap([0,0],[e.x,e.y]),s=this.spatialReference;return new Bs.Z({x:t,y:i,spatialReference:s})}isTileInfoRequired(){return!0}toScreen(e){if(!this.ready)return null;const t=this._normalizeInput(e),i=[t.x,t.y];return this.state.toScreen(i,i),(0,uo.vW)(i[0],i[1])}pixelSizeAt(){return this.ready?this.state.resolution:(Al.error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}getDefaultSpatialReference(){return this.get("map.initialViewProperties.spatialReference")||this.get("defaultsFromMap.spatialReference")||null}isSpatialReferenceSupported(e,t){return!(!t&&!this._get("ready"))||null!==this._getDefaultViewpoint()}importLayerView(e){return Ka(e)}hasLayerViewModule(e){return $a(e)}_createAnimation(){return this.animation&&!this.animation.done||(this.animation=new Da),this.animation}_cancellableGoTo(e,t,i){const s=()=>e===this._gotoTask,n=i.then((()=>{s()&&(this.animation=null)})).catch((e=>{throw s()&&(this.animation=null,t.done||(t.stop(),this.frameTask.animationInProgress=!1)),e})),r=new Promise((e=>e(n)));return t.when().catch((()=>{s()&&r.cancel&&r.cancel()})),r}_gotoImmediate(e,t){const i=this._gotoTask,s=this.animation,n=e.then((e=>{if((0,fi.k_)(t),i!==this._gotoTask)throw new h.Z("view:goto-interrupted","Goto was interrupted");this.viewpoint=s.target=e,s.finish()}));return this._cancellableGoTo(i,s,n)}_gotoAnimated(e,t){const i=this._gotoTask,s=this.animation,n=e.then((e=>{if((0,fi.k_)(t),i!==this._gotoTask)throw new h.Z("view:goto-interrupted","Goto was interrupted");return s.update(e),this.animationManager.animate(s,this.viewpoint,t),s.when().then((()=>{}),(()=>{}))}));return this._cancellableGoTo(i,s,n)}_resizeHandler(e){const t=this.state;if(!t)return;let i=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.concat();t.size=[e.width,e.height],(0,ja.SI)(i,i,s,this.state.paddedViewState.size,this.resizeAlign),i=this.constraints.constrain(i,null),this.state.viewpoint=i}_startup(){const e=this._getDefaultViewpoint();this.constraints.view=this,this.constraints.fit(e),this._set("animationManager",new Ba({view:this})),this._set("state",new Pl({padding:this._get("padding"),size:this.size,viewpoint:e})),this._set("featuresTilingScheme",new Ll.Z(bo.Z.create({spatialReference:this.spatialReference,size:512}))),this._set("ready",!0),this.frameTask&&this.frameTask.start()}_teardown(){this.frameTask&&this.frameTask.stop(),this._set("ready",!1),this._stationaryTimer&&(clearTimeout(this._stationaryTimer),this._stationaryTimer=null);const{center:[e,t],spatialReference:i,rotation:s,scale:n}=this.state.paddedViewState,r=new Bs.Z({x:e,y:t,spatialReference:i});this._set("viewpoint",null),this._set("extent",null),this._set("center",r),this._set("zoom",-1),this._set("rotation",s),this._set("scale",n),this._set("spatialReference",i),this.constraints.view=null,this.animationManager.destroy(),this._set("animationManager",null),this._set("state",null),this.animation=null}_flipStationary(e){return null!==this._stationaryTimer||(this._stationaryTimer=setTimeout((()=>{this._stationaryTimer=null;const e=performance.now()-this._lastStationaryEventTimestamp;e<160&&(this._stationaryTimer=this._flipStationary(e))}),e)),this._stationaryTimer}_normalizeInput(e,t=this.spatialReference){const i=e&&e.targetGeometry||e;return t?i?t.equals(i.spatialReference)?e:(0,zs.Q8)(i,t)?function(e){return e&&"esri.Viewpoint"===e.declaredClass}(e)?(e.targetGeometry=(0,zs.iV)(i,t),e):(0,zs.iV)(i,t):null:null:e}_getDefaultViewpoint(){const e=this.constraints,t={zoom:this._get("zoom"),scale:this._get("scale"),center:this._normalizeInput(this._get("center")),extent:this._normalizeInput(this._get("extent")),rotation:this._get("rotation"),viewpoint:this._normalizeInput(this._get("viewpoint")),spatialReference:this._userSpatialReference};e.effectiveLODs?-1!==t.zoom&&(t.scale=e.zoomToScale(t.zoom)):t.zoom=-1;let i=null,s=null,n=0;const r=t.viewpoint&&t.viewpoint.rotation,a=t.viewpoint&&t.viewpoint.targetGeometry;(0,o.pC)(a)&&("extent"===a.type?i=a:"point"===a.type&&(s=a,n=t.viewpoint.scale));const l=this._normalizeInput(this.get("map.initialViewProperties.viewpoint.targetGeometry.extent")),c=this._normalizeInput(this.initialExtent),h=t.extent||i||l||c,d=t.center||s||h&&h.center,u=this.get("map.initialViewProperties.viewpoint.scale"),p=t.scale||n||u||h&&(0,ja.EK)(h,this.size),m=this.get("map.initialViewProperties.viewpoint.rotation"),f=t.rotation||r||m||0;return d&&p?new _o.Z({targetGeometry:d,scale:p,rotation:f}):null}};(0,n._)([(0,l.Cb)()],Fl.prototype,"_stationaryTimer",void 0),(0,n._)([(0,l.Cb)()],Fl.prototype,"animation",null),(0,n._)([(0,l.Cb)({readOnly:!0})],Fl.prototype,"animationManager",void 0),(0,n._)([(0,l.Cb)({value:null,type:Bs.Z,dependsOn:["state.id","ready"]})],Fl.prototype,"center",null),(0,n._)([(0,l.Cb)({type:ml})],Fl.prototype,"constraints",null),(0,n._)([(0,l.Cb)({value:null,type:vo.Z,dependsOn:["state.id","ready"]})],Fl.prototype,"extent",null),(0,n._)([(0,l.Cb)({readOnly:!0})],Fl.prototype,"featuresTilingScheme",void 0),(0,n._)([(0,l.Cb)()],Fl.prototype,"fullOpacity",void 0),(0,n._)([(0,l.Cb)()],Fl.prototype,"graphicsView",void 0),(0,n._)([(0,l.Cb)({type:vo.Z})],Fl.prototype,"initialExtent",void 0),(0,n._)([(0,l.Cb)({depen
1dsOn:["map.initialViewProperties?.viewpoint"]})],Fl.prototype,"initialExtentRequired",null),(0,n._)([(0,l.Cb)()],Fl.prototype,"labelManager",void 0),(0,n._)([(0,l.Cb)({value:{top:0,right:0,bottom:0,left:0},cast:e=>({top:0,right:0,bottom:0,left:0,...e})})],Fl.prototype,"padding",null),(0,n._)([(0,l.Cb)({type:Object})],Fl.prototype,"renderingOptions",void 0),(0,n._)([(0,l.Cb)()],Fl.prototype,"resizeAlign",void 0),(0,n._)([(0,l.Cb)({readOnly:!0,dependsOn:["state.id"]})],Fl.prototype,"resolution",null),(0,n._)([(0,l.Cb)({value:0,type:Number,dependsOn:["state.id","ready"]})],Fl.prototype,"rotation",null),(0,n._)([(0,l.Cb)({value:0,type:Number,dependsOn:["state.id","ready"]})],Fl.prototype,"scale",null),(0,n._)([(0,l.Cb)({type:yo.Z,dependsOn:["map.initialViewProperties?.spatialReference","defaultsFromMap.isSpatialReferenceDone"]})],Fl.prototype,"spatialReference",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Fl.prototype,"state",void 0),(0,n._)([(0,l.Cb)({dependsOn:["animation","navigating","resizing","_stationaryTimer"]})],Fl.prototype,"stationary",null),(0,n._)([(0,l.Cb)({readOnly:!0})],Fl.prototype,"supportsGround",void 0),(0,n._)([(0,l.Cb)({type:El.T,readOnly:!0})],Fl.prototype,"timeline",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Fl.prototype,"type",void 0),(0,n._)([(0,l.Cb)({readOnly:!0,dependsOn:["layerViewManager.updating","labelManager.updating","graphicsView?.updating"]})],Fl.prototype,"updating",null),(0,n._)([(0,l.Cb)({value:null,type:_o.Z,dependsOn:["state.id","ready"]})],Fl.prototype,"viewpoint",null),(0,n._)([(0,l.Cb)({value:-1,dependsOn:["state.id"]})],Fl.prototype,"zoom",null),Fl=(0,n._)([(0,c.j)("esri.views.MapViewBase")],Fl);var Vl=Fl;function Ol(e,t){switch(t){case"primary":return"touch"===e.pointerType||0===e.button;case"secondary":return"touch"!==e.pointerType&&2===e.button;case"tertiary":return"touch"!==e.pointerType&&1===e.button}}class Rl extends nn{constructor(e,t){super(!0),this.view=e,this.registerIncoming("double-click",t,(e=>this._handleDoubleClick(e,t)))}_handleDoubleClick(e,t){Ol(e.data,"primary")&&(e.stopPropagation(),t?this.view.mapViewNavigation.zoomOut([e.data.x,e.data.y]):this.view.mapViewNavigation.zoomIn([e.data.x,e.data.y]))}}class Dl extends nn{constructor(e,t,i){super(!0),this.view=e,this.pointerType=t,this.registerIncoming("double-tap-drag",i,(e=>this._handleDoubleTapDrag(e)))}_handleDoubleTapDrag(e){const{data:t}=e,{pointerType:i}=t;if(i!==this.pointerType)return;e.stopPropagation();const{action:s,delta:n}=t,{view:r}=this,{mapViewNavigation:o}=r;switch(s){case"begin":{const{scale:e}=r;this._startScale=e,this._currentScale=e,this._previousDelta=n,o.begin();break}case"update":{if(this._previousDelta.y===n.y)return;this._previousDelta=n;const e=1.015**n.y,t=this._startScale*e,i=t/this._currentScale;o.setViewpointImmediate(i),this._currentScale=t;break}case"end":{const{constraints:e}=r,{effectiveLODs:t,snapToZoom:i}=e;if(!i||!t)return void o.end();const s=e.snapScale(this._currentScale),a=(n.y>0?Math.max(s,e.snapToPreviousScale(this._startScale)):Math.min(s,e.snapToNextScale(this._startScale)))/this._currentScale;o.zoom(a);break}}}}class jl{constructor(e){this.callbacks=e,this.currentCount=0,this.callbacks.condition||(this.callbacks.condition=()=>!0)}handle(e){const t=e.data,i=t.pointers.size;switch(t.action){case"start":this.currentCount=i,this.emitStart(e);break;case"added":this.emitEnd(this.previousEvent),this.currentCount=i,this.emitStart(e);break;case"update":this.emitUpdate(e);break;case"removed":this.startEvent&&this.emitEnd(this.previousEvent),this.currentCount=i,this.emitStart(e);break;case"end":this.emitEnd(e),this.currentCount=0}this.previousEvent=e}emitStart(e){this.startEvent=e,this.callbacks.condition(this.currentCount,e)&&this.callbacks.start(this.currentCount,e,this.startEvent)}emitUpdate(e){this.callbacks.condition(this.currentCount,e)&&this.callbacks.update(this.currentCount,e,this.startEvent)}emitEnd(e){this.callbacks.condition(this.currentCount,e)&&this.callbacks.end(this.currentCount,e,this.startEvent),this.startEvent=null}}class Zl extends nn{constructor(e,t,i){super(!0),this.view=e,this.pointerAction=t,this.registerIncoming("drag",i,(e=>this._handleDrag(e))),this.registerIncoming("pointer-down",(()=>this.stopMomentumNavigation()));const s=this.view.mapViewNavigation;this.dragEventSeparator=new jl({start:(e,t)=>{s.pan.begin(this.view,t.data),t.stopPropagation()},update:(e,t)=>
1{s.pan.update(this.view,t.data),t.stopPropagation()},end:(e,t)=>{s.pan.end(this.view,t.data),t.stopPropagation()},condition:(e,t)=>1===e&&Ol(t.data,this.pointerAction)})}_handleDrag(e){const t=this.view.mapViewNavigation;t.pinch.zoomMomentum||t.pinch.rotateMomentum?this.stopMomentumNavigation():this.dragEventSeparator.handle(e)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}}class Nl extends nn{constructor(e,t,i){super(!0),this.view=e,this.pointerAction=t;const s=this.view.mapViewNavigation;this.dragEventSeparator=new jl({start:(e,t)=>{s.rotate.begin(this.view,t.data),t.stopPropagation()},update:(e,t)=>{s.rotate.update(this.view,t.data),t.stopPropagation()},end:(e,t)=>{s.rotate.end(),t.stopPropagation()},condition:(e,t)=>1===e&&Ol(t.data,this.pointerAction)}),this.registerIncoming("drag",i,(e=>this.dragEventSeparator.handle(e)))}}var zl=i(6766);function Bl(e){let t=e*e;return e<0&&(t*=-1),t}class Gl extends nn{constructor(e){super(!0),this.view=e,this.frameTask=null,this.watchHandles=new M.Z,this.currentDevice=null,this.transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this.handle=this.registerIncoming("gamepad",(e=>this.handleEvent(e))),this.handle.pause()}onInstall(e){super.onInstall(e),this.watchHandles.add([(0,m.S1)(this.view.navigation.gamepad,"enabled",(e=>{e?(this.handle.resume(),this.frameTask||(this.frameTask=(0,S.A)({update:e=>this.frameUpdate(e.deltaTime)}))):(this.handle.pause(),this.frameTask&&(this.frameTask.remove(),this.frameTask=null))}))])}onUninstall(){this.watchHandles.removeAll(),this.frameTask&&(this.frameTask.remove(),this.frameTask=null),super.onUninstall()}handleEvent(e){const t=this.view.navigation.gamepad.device;t&&e.data.device!==t||this.currentDevice&&this.currentDevice!==e.data.device||("end"===e.data.action?(this.currentDevice=null,function(e){e.translation[0]=0,e.translation[1]=0,e.translation[2]=0,e.heading=0,e.tilt=0}(this.transformation)):(this.currentDevice=e.data.device,function(e,t,i){const s=i,n=e.state,r=e.device,o="forward-down"===t.tiltDirection?1:-1;"standard"===r.deviceType?(s.translation[0]=Bl(n.axes[0]),s.translation[1]=Bl(n.axes[1]),s.translation[2]=Bl(n.buttons[7])-Bl(n.buttons[6]),s.heading=Bl(n.axes[2]),s.tilt=Bl(n.axes[3])):"spacemouse"===r.deviceType&&(s.translation[0]=1.2*Bl(n.axes[0]),s.translation[1]=1.2*Bl(n.axes[1]),s.translation[2]=2*-Bl(n.axes[2]),s.heading=1.2*Bl(n.axes[5]),s.tilt=1.2*Bl(n.axes[3])),s.tilt*=o,(0,zl.a)(s.translation,s.translation,1)}(e.data,this.view.navigation.gamepad,this.transformation)))}frameUpdate(e){const t=this.transformation;if(function(e){return 0===e.translation[0]&&0===e.translation[1]&&0===e.translation[2]&&0===e.heading&&0===e.tilt&&0===e.zoom}(t))return;const i=this.view.viewpoint.clone(),s=this.view.navigation.gamepad.velocityFactor,n=Ul*s*e;(0,ja.Rx)(i,i,[t.translation[0]*n,-t.translation[1]*n]);const r=1+t.translation[2]*Hl*e,o=this.view.constraints.rotationEnabled?-t.heading*Wl*e:0,a=this.view.size,l=[a[0]/2,a[1]];(0,ja.UZ)(i,i,r,o,l,a);const c=this.view.constraints.constrain(i,this.view.viewpoint);this.view.viewpoint=c}}const Wl=.06,Ul=.7,Hl=6e-4;class ql extends nn{constructor(e,t,i){super(!0),this.view=e,this.keys=t,this._pressed=!1,this._keyMap={[t.left]:"left",[t.right]:"right",[t.up]:"up",[t.down]:"down"},this.registerIncoming("key-down",i,(e=>this._handleKeyDown(e))),this.registerIncoming("key-up",i,(e=>this._handleKeyUp(e))),this.registerIncoming("blur",i,(()=>this._handleBlur()))}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleBlur(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,t){const i=this._keyMap[e.data.key];if(this._pressed=null!=i,this._pressed){if(t)switch(this.view.mapViewNavigation.begin(),i){case"left":this.view.mapViewNavigation.continousPanLeft();break;case"right":this.view.mapViewNavigation.continousPanRight();break;case"up":this.view.mapViewNavigation.continousPanUp();break;case"down":this.view.mapViewNavigation.continousPanDown()}else this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}}class $l extends nn{constructor(e,t,i){super(!0),this.view=e,this.keys=t,this._pressed=!1,this._keyToDirection={[t.clockwiseOption1]:"clockwise",[t.clockwiseOption2]:"clockwise",[t.counterClockwiseOption1]:"counterClockwise",[t.counterClockwiseOption2]:"counterClockwise",[t.resetOption1]:"reset",[t.resetOption2]:"reset"},this.registerIncoming("key-down",i,(e=>this._handleKeyDown(e))),this.registerIncoming("key-up",i,(e=>this._handleKeyUp(e))),this.registerIncoming("blur",i,(()=>this._handleBlur()))}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleBlur(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,t){const i=e.modifiers;if(i.size>0&&!i.has("Shift")||!this.view.constraints.rotationEnabled)return;const s=this._keyToDirection[e.data.key];if(this._pressed=null!=s,this._pressed){if(t)switch(this.view.mapViewNavigation.begin(),s){case"clockwise":this.view.mapViewNavigation.continousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}}class Kl extends nn{constructor(e,t,i){super(!0),this.view=e,this.keys=t,this._keysToZoomAction={},this.registerIncoming("key-down",i,(e=>this._handleKeyDown(e))),t.zoomIn.forEach((e=>this._keysToZoomAction[e]=0)),t.zoomOut.forEach((e=>this._keysToZoomAction[e]=1))}_handleKeyDown(e){this._handleKey(e)}_handleKey(e){const t=e.modifiers;if(t.size>0&&!t.has("Shift"))return;const{key:i}=e.data;if(!(i in this._keysToZoomAction))return;const s=this._keysToZoomAction[i],{mapViewNavigation:n}=this.view;let r=null;switch(s){case 0:r=n.zoomIn();break;case 1:r=n.zoomOut();break;default:return}n.begin(),r.then((()=>n.end())),e.stopPropagation()}}class Yl extends nn{constructor(e,t){super(!0),this.view=e,this._canZoom=!0,this.registerIncoming("mouse-wheel",t,(e=>this._handleMouseWheel(e)))}_handleMouseWheel(e){if(!this.view.navigation.mouseWheelZoomEnabled)return;if(e.preventDefault(),e.stopPropagation(),!this._canZoom)return;const t=this.view.mapViewNavigation,{x:i,y:s,deltaY:n}=e.data,r=1/.6**(1/60*n),o=t.zoom(r,[i,s]);o&&(this._canZoom=!1,o.catch((()=>{})).then((()=>{this._canZoom=!0,t.end()})))}}class Xl extends nn{constructor(e){super(!0),this.view=e,this.registerIncoming("drag",(e=>this._handleDrag(e))),this.registerIncoming("pointer-down",(()=>this.stopMomentumNavigation()));const t=this.view.mapViewNavigation;this.dragEventSeparator=new jl({start:(e,i)=>{t.pinch.begin(this.view,i.data),i.stopPropagation()},update:(e,i)=>{t.pinch.update(this.view,i.data),i.stopPropagation()},end:(e,i)=>{t.pinch.end(this.view),i.stopPropagation()},condition:e=>e>=2})}_handleDrag(e){this.dragEventSeparator.handle(e)}stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}}function Ql(e){const t=e.native;return t?{buttons:t.buttons.map((e=>e.pressed?e.value?e.value:1:0)),axes:t.axes.map((t=>function(e,t){const i=Math.abs(e);return i<t?0:(0,X.Xx)(e)*(i-t)/(1-t)}(t,e.axisThreshold)))}:{buttons:[],axes:[]}}class Jl{constructor(e,t){this.element=e,this.input=t,this._hasEventListeners=!1,this.onConnectGamepad=e=>{this.connectGamepad(e.gamepad)},this.onDisconnectGamepad=e=>{const t=e.gamepad,i=t.index,s=this.inputDevices[i];s&&(this.emitGamepadEvent(t,Ql(s),!1),this.inputDevices.splice(i,1),this.latestUpdate.splice(i,1),this.input.gamepad.devices.remove(s),this.ensurePollingState())},this.frameTask=null,this.latestUpdate=new Array,this.inputDevices=new Array,this.callback=null;const i="getGamepads"in window.navigator,s=window.isSecureContext;this.supported=i&&s,this.supported&&(this.forEachGamepad(this.connectGamepad),window.addEventListener("gamepadconnected",this.onConnectGamepad),window.addEventListener("gamepaddisconnected",this.onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this.onConnectGamepad),window.removeEventListener("gamepaddisconnected",this.onDisconnectGamepad))}set hasEventListeners(e){this._hasEventListeners!==e&&(this._hasEventListeners=e,this.ensurePollingState())}get eventsEnabled(){return this.supported&&this.inputDevices.length>0&&this._hasEventListeners}set onEvent(e){this.callback=e}connectGamepad(e){const t=new ha(e);"unknown"!==t.deviceType&&(this.inputDevices[e.index]=t,this.input.gamepad.devices.add(t)),this.ensurePollingState()}ensurePollingState(){this.eventsEnabled?this.startPolling():this.stopPolling()}startPolling(){null==this.frameTask&&(this.frameTask=(0,S.A)({update:()=>this.readGamepadState()}))}stopPolling(){null!=this.frameTask&&(this.frameTask.remove(),this.frameTask=null,this.latestUpdate=new Array)}readGamepadState(){const e=document.hasFocus(),t=this.element.contains(document.activeElement),i="document"===this.input.gamepad.enabledFocusMode&&!e||"view"===this.input.gamepad.enabledFocusMode&&!t;this.forEachGamepad((e=>{const t=this.inputDevices[e.index];if(!t)return;const s=this.latestUpdate[e.index],n=Ql(t),r=i||function(e){for(let t=0;t<e.axes.length;t++)if(0!==e.axes[t])return!1;for(let t=0;t<e.buttons.length;t++)if(0!==e.buttons[t])return!1;return!0}(n);if(s){if(s.timestamp===e.timestamp)return;if(!s.active&&r)return;if(function(e,t){if(e.axes.length!==t.axes.length)return!1;if(e.buttons.length!==t.buttons.length)return!1;for(let i=0;i<e.axes.length;i++)if(e.axes[i]!==t.axes[i])return!1;for(let i=0;i<e.buttons.length;i++)if(e.buttons[i]!==t.buttons[i])return!1;return!0}(s.state,n))return}this.emitGamepadEvent(e,n,!r)}))}forEachGamepad(e){const t=window.navigator.getGamepads();for(let i=0;i<t.length;i++){const s=t[i];this.validate(s)&&e(s)}}emitGamepadEvent(e,t,i){const s=this.latestUpdate[e.index],n=s&&s.active;if(!n&&!i)return;const r=!n&&i?"start":n&&i?"update":"end";this.latestUpdate[e.index]={timestamp:e.timestamp,state:t,active:i},this.callback&&this.callback({device:this.inputDevices[e.index],state:t,action:r})}validate(e){if(!e)return!1;if(!e.connected)return!1;for(let t=0;t<e.axes.length;t++)if(isNaN(e.axes[t]))return!1;return!0}}const ec=(0,r.Z)("trident"),tc=(0,r.Z)("edge"),ic=(0,r.Z)("chrome"),sc=(0,r.Z)("ff"),nc=(0,r.Z)("safari"),rc="esri-view-surface--touch-none",oc="esri-view-surface--touch-pan";class ac{constructor(e,t){this.input=t,this._active={},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._element=e,e.getAttribute("tabindex")||e.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter"
1:this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),this._gamepadSource=new Jl(e,this.input),this._gamepadSource.onEvent=e=>this._callback("gamepad",e)}destroy(){this._callback=null,this.activeEvents=null,this._activePointerCaptures.forEach((e=>{this._releasePointerCaptureSafe(e)})),this._gamepadSource&&(this._gamepadSource.destroy(),this._gamepadSource=null),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(e){this._browserTouchPanningEnabled=e,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(e){this._callback=e}set activeEvents(e){for(const t in this._active)if(!e||!e.has(t)){const e=this._active[t];this._element.removeEventListener(lc[t],e),delete this._active[t]}e&&e.forEach((e=>{if(!this._active[e]&&lc[e]){const t=(this._eventHandlers[e]||this._handleDefault).bind(this,e);this._element.addEventListener(lc[e],t),this._active[e]=t}})),this._gamepadSource.hasEventListeners=e&&e.has("gamepad")}setPointerCapture(e,t){t?(this._element.setPointerCapture(e.pointerId),this._activePointerCaptures.add(e.pointerId)):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?rc:oc),this._element.classList.add(this._browserTouchPanningEnabled?oc:rc)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(rc),this._element.classList.remove(oc),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch(t){}}_updateNormalizedPointerLikeEvent(e,t){const i=mo(this._element,e);return ac.test.disableSubpixelCoordinates&&(i.x=Math.round(i.x),i.y=Math.round(i.y)),t.x=i.x,t.y=i.y,t}
1_handleKey(e,t){const i=function(e){if(void 0!==e.key)return(0,j.kK)(e);const t=Js[e.keyCode];return Array.isArray(t)?e.shiftKey?t[1]:t[0]:t}(t);i&&"key-up"===e&&this._keyDownState.delete(i);const s={native:t,key:i,repeat:i&&this._keyDownState.has(i)};i&&"key-down"===e&&this._keyDownState.add(s.key),this._callback(e,s)}_handlePointer(e,t){const i=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});this._callback(e,i)}_handlePointerPreventDefault(e,t){const i=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});t.preventDefault(),this._callback(e,i)}_handleMouseWheel(e,t){let i=t.deltaY;switch(t.deltaMode){case 0:(ec||tc)&&(i=i/document.documentElement.clientHeight*600);break;case 1:i*=30;break;case 2:i*=900}ec||tc?i*=.7:ic||nc?i*=.6:sc&&(i*=1.375);const s=Math.abs(i);if(s>100){const e=.02;i=i/s*200/(1+Math.exp(-e*(s-100)))}const n=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,deltaY:i});this._callback(e,n)}_handlePointerCaptureLost(e,t){this._activePointerCaptures.delete(t.pointerId),this._handleDefault(e,t)}_handleDefault(e,t){const i={native:t};t.preventDefault(),this._callback(e,i)}_preventAltKeyDefault(e){"Alt"===e.key&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}}ac.test={disableSubpixelCoordinates:!1};const lc={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};class cc extends nn{constructor(){super(!0),this.registerIncoming("context-menu",(e=>{e.data.native.preventDefault()}))}}var hc=i(18234);function dc(e,t){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)}const uc=250,pc=10,mc=350,fc=35;class gc extends nn{constructor(e=uc,t=pc,i=mc,s=fc,n=hc.Z){super(!1),this.maximumDoubleClickDelay=e,this.maximumDoubleClickDistance=t,this.maximumDoubleTouchDelay=i,this.maximumDoubleTouchDistance=s,this._clock=n,this._pointerState=new Map,this._click=this.registerOutgoing("click"),this._doubleClick=this.registerOutgoing("double-click"),this.registerIncoming("immediate-click",this._handleImmediateClick.bind(this)),this.registerIncoming("pointer-drag",this._handlePointerDrag.bind(this)),this.registerIncoming("drag",this._handleDrag.bind(this))}onUninstall(){this._pointerState.forEach((e=>{null!=e.doubleClickTimeout&&(e.doubleClickTimeout.remove(),e.doubleClickTimeout=null)}))}get hasPendingInputs(){return Eo(this._pointerState,(e=>null!=e.doubleClickTimeout))}_pointerId(e){const t=e.native;return"mouse"===t.pointerType?`${t.pointerId}:${t.button}`:`${t.pointerType}`}_handleImmediateClick(e){const t=e.data,i=this._pointerId(t),s=this._pointerState.get(i);if(s){const n="touch"===t.native.pointerType?this.maximumDoubleTouchDistance:this.maximumDoubleClickDistance;dc(s.event.data,t)>n?(this._clearDoubleClickTimeout(i,!0),this._startClick(e)):(this._clearDoubleClickTimeout(i,!1),this._doubleClick.emit(s.event.data,void 0,s.event.modifiers))}else this._startClick(e)}_startClick(e){const t=this._pointerId(e.data),i="touch"===e.data.native.pointerType?this.maximumDoubleTouchDelay:this.maximumDoubleClickDelay;this._pointerState.set(t,{event:e,doubleClickTimeout:this._clock.setTimeout((()=>this._doubleClickTimeoutExceeded(t)),i)}),this.refreshHasPendingInputs()}_handlePointerDrag(e){const t=this._pointerId(e.data.currentEvent);this._clearDoubleClickTimeout(t,!0)}_handleDrag(e){const t=this._pointerId(e.data.pointer);this._clearDoubleClickTimeout(t,!0)}_clearDoubleClickTimeout(e,t){const i=this._pointerState.get(e);i&&(i.doubleClickTimeout.remove(),i.doubleClickTimeout=null,t&&this._doubleClickTimeoutExceeded(e),this._pointerState.delete(e),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(e){const t=this._pointerState.get(e);this._click.emit(t.event.data,void 0,t.event.modifiers),t.doubleClickTimeout=null,this._pointerState.delete(e),this.refreshHasPendingInputs()}}class yc extends nn{constructor(e=uc,t=pc,i=mc,s=fc,n=hc.Z){super(!1),this.maximumDoubleClickDelay=e,this.maximumDoubleClickDistance=t,this.maximumDoubleTouchDelay=i,this.maximumDoubleTouchDistance=s,this._clock=n,this._doubleTapDragReady=!1,this._doubleTapDragActive=!1,this._dragStartCenter=(0,uo.vW)(0,0),this._pointerState=new Map,this._doubleTapDrag=this.registerOutgoing("double-tap-drag"),this._dragEventSeparator=new jl({start:(e,t)=>this._dragStart(e,t),update:(e,t)=>
1this._dragUpdate(t),end:(e,t)=>this._dragEnd(t)}),this.registerIncoming("drag",(e=>this._dragEventSeparator.handle(e))),this.registerIncoming("pointer-down",(e=>this._handlePointerDown(e))),this.registerIncoming("pointer-up",(()=>this._handlePointerUp()))}onUninstall(){this._pointerState.forEach((e=>{null!=e.doubleTapTimeout&&(e.doubleTapTimeout.remove(),e.doubleTapTimeout=null)}))}get hasPendingInputs(){return Eo(this._pointerState,(e=>null!=e.doubleTapTimeout))}_clearPointerDown(e){const t=this._pointerState.get(e);t&&(t.doubleTapTimeout.remove(),t.doubleTapTimeout=null,this._pointerState.delete(e),this.refreshHasPendingInputs())}_createDoubleTapDragData(e,t,i){const{button:s,buttons:n,pointer:r,pointers:o,pointerType:a,timestamp:l}=i;return{action:e,delta:t,button:s,buttons:n,pointer:r,pointers:o,pointerType:a,timestamp:l}}_dragStart(e,t){if(!this._doubleTapDragReady||1!==e)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:i,modifiers:s}=t,{center:n}=i;this._dragStartCenter=n;const r=this._createDoubleTapDragData("begin",(0,uo.vW)(0,0),i);this._doubleTapDrag.emit(r,void 0,s),t.stopPropagation()}_dragUpdate(e){if(!this._doubleTapDragActive)return;const{data:t,modifiers:i}=e,{center:s}=t,n=(0,uo.vW)(s.x-this._dragStartCenter.x,s.y-this._dragStartCenter.y),r=this._createDoubleTapDragData("update",n,t);this._doubleTapDrag.emit(r,void 0,i),e.stopPropagation()}_dragEnd(e){if(!this._doubleTapDragActive)return;const{data:t,modifiers:i}=e,{center:s}=t,n=(0,uo.vW)(s.x-this._dragStartCenter.x,s.y-this._dragStartCenter.y),r=this._createDoubleTapDragData("end",n,t);this._doubleTapDrag.emit(r,void 0,i),this._doubleTapDragActive=!1,e.stopPropagation()}_handlePointerDown(e){const{data:t}=e,i=this._pointerId(t),s=this._pointerState.get(i),{pointerType:n}=t.native;if(s){const r="touch"===n?this.maximumDoubleTouchDistance:this.maximumDoubleClickDistance;this._clearPointerDown(i),dc(s.event.data,t)>r?this._storePointerDown(e):this._doubleTapDragReady=!0}else this._storePointerDown(e)}_handlePointerUp(){this._doubleTapDragReady=!1}_pointerId(e){const{native:t}=e,{pointerId:i,button:s,pointerType:n}=t;return"mouse"===n?`${i}:${s}`:`${n}`}_storePointerDown(e){const{data:t}=e,{pointerType:i}=t.native,s=this._pointerId(t),n="touch"===i?this.maximumDoubleTouchDelay:this.maximumDoubleClickDelay,r=this._clock.setTimeout((()=>this._clearPointerDown(s)),n);this._pointerState.set(s,{event:e,doubleTapTimeout:r}),this.refreshHasPendingInputs()}}var vc,_c=i(22082);class bc extends nn{constructor(e){super(!1),this.navigationTouch=e,this.startStateModifiers=new Set,this.activePointerMap=new Map,this.isDragging=!1,this.isCurrentDragSuppressed=!1,this.drag=this.registerOutgoing("drag"),this.registerIncoming("pointer-drag",this.handlePointerDrag.bind(this)),this.registerIncoming("pointer-up",this.handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-capture-lost",this.handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-cancel",this.handlePointerUpAndPointerLost.bind(this))}createPayload(e,t,i,s){return{action:e,pointerType:this.pointerType,button:this.mouseButton,buttons:t.buttons,timestamp:s,pointers:Mc(this.activePointerMap),pointer:t,angle:i.angle,radius:i.radius,center:i.center}}addPointer(e){const t=e.native.pointerId,i=Cc(this.activePointerMap).angle,s={event:e,initialAngle:0,lastAngle:0};this.activePointerMap.set(t,s);const n=Ic(s,wc(this.activePointerMap));s.initialAngle=n,s.lastAngle=n,this.updatePointerAngles(i)}updatePointer(e){if(e&&null==e.x&&null==e.y)return;const t=e.native.pointerId,i=this.activePointerMap.get(t);i?i.event=e:this.addPointer(e)}removePointer(e){const t=Cc(this.activePointerMap).angle;this.activePointerMap.delete(e),this.updatePointerAngles(t)}updatePointerAngles(e){const t=Cc(this.activePointerMap);this.activePointerMap.forEach((i=>{i.initialAngle=Ic(i,t)-e,i.lastAngle=Ic(i,t)-e}))}emitEvent(e,t,i){const s=Cc(this.activePointerMap);this.drag.emit(this.createPayload(e,t,s,i),void 0,this.startStateModifiers)}handlePointerUpAndPointerLost(e){const t=e.data.native.pointerId,i=(0,_c.HA)(e.timestamp);this.activePointerMap.get(t)&&(1===this.activePointerMap.size?(this.updatePointer(e.data),!this.isCurrentDragSuppressed&&this.emitEvent("end",e.data,i),this.isDragging=!1,this.isCurrentDragSuppressed=!1,this.removePointer(t)):(this.removePointer(t),this.emitEvent("removed",e.data,(0,_c.HA)(e.timestamp))))}handlePointerDrag(e){const t=e.data,i=t.currentEvent,s=(0,_c.HA)(e.timestamp);switch(t.action){case"start":case"update":this.isDragging?this.activePointerMap.has(i.native.pointerId)?(this.updatePointer(i),!this.isCurrentDragSuppressed&&this.emitEvent("update",i,s)):(this.addPointer(i),this.emitEvent("added",i,s),this.isCurrentDragSuppressed=this.isSuppressed):(this.updatePointer(i),this.pointerType=e.data.startEvent.pointerType,this.mouseButton=e.data.startEvent.button,this.startStateModifiers=e.modifiers,this.isDragging=!0,this.isCurrentDragSuppressed=this.isSuppressed,!this.isCurrentDragSuppressed&&this.emitEvent("start",i,s))}}get isSuppressed(){return this.navigationTouch&&!this.navigationTouch.browserTouchPanEnabled&&"touch"===this.pointerType&&1===this.activePointerMap.size}}function wc(e){const t=[];return e.forEach((e=>{t.push((0,uo.vW)(e.event.x,e.event.y))})),function(e,t){if(t?(t.radius=0,t.center.x=0,t.center.y=0):t={radius:0,center:(0,uo.vW)()},0===e.length)return t;if(1===e.length)return t.center.x=e[0].x,t.center.y=e[0].y,t;if(2===e.length){const[i,s]=e,[n,r]=[s.x-i.x,s.y-i.y];return t.radius=Math.sqrt(n*n+r*r)/2,t.center.x=(i.x+s.x)/2,t.center.y=(i.y+s.y)/2,t}let i=0,s=0;for(let _=0;_<e.length;_++)i+=e[_].x,s+=e[_].y;i/=e.length,s/=e.length;const n=e.map((e=>e.x-i)),r=e.map((e=>e.y-s));let o=0,a=0,l=0,c=0,h=0,d=0,u=0;for(let _=0;_<n.length;_++){const e=n[_],t=r[_],i=e*e,s=t*t;o+=i,a+=s,l+=e*t,c+=i*e,h+=s*t,d+=e*s,u+=t*i}const p=.5*(c+d),m=.5*(h+u),f=o*a-l*l,g=(p*a-m*l)/f,y=(o*m-l*p)/f,v=(0,uo.vW)(g+i,y+s);return{radius:Math.sqrt(g*g+y*y+(o+a)/e.length),center:v}}(t)}function Cc(e){const t=wc(e);let i=0;return e.forEach((e=>{let s=Ic(e,t),n=s-e.lastAngle;
1for(;n>Math.PI;)n-=2*Math.PI;for(;n<-Math.PI;)n+=2*Math.PI;s=e.lastAngle+n,e.lastAngle=s;const r=s-e.initialAngle;i+=r})),i/=e.size||1,{angle:i,radius:t.radius,center:t.center}}function Mc(e){const t=new Map;return e.forEach(((e,i)=>t.set(i,e.event))),t}function Ic(e,t){const i=e.event,s=i.x-t.center.x,n=i.y-t.center.y;return Math.atan2(n,s)}!function(e){e[e.Left=0]="Left",e[e.Middle=1]="Middle",e[e.Right=2]="Right",e[e.Back=3]="Back",e[e.Forward=4]="Forward",e[e.Undefined=-1]="Undefined"}(vc||(vc={}));class Tc extends nn{constructor(e=uc,t=pc,i=mc,s=fc,n=hc.Z){super(!1),this.maximumDoubleClickDelay=e,this.maximumDoubleClickDistance=t,this.maximumDoubleTouchDelay=i,this.maximumDoubleTouchDistance=s,this._clock=n,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing("immediate-double-click"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",(e=>{this._handlePointerLoss(e,"pointer-up")})),this.registerIncoming("pointer-capture-lost",(e=>{this._handlePointerLoss(e,"pointer-capture-lost")})),this.registerIncoming("pointer-cancel",(e=>{this._handlePointerLoss(e,"pointer-cancel")}))}onUninstall(){this._pointerState.forEach((e=>{e.immediateDoubleClick&&e.immediateDoubleClick.timeoutHandle.remove()})),super.onUninstall()}_handlePointerDown(e){const t=e.data,i=this._pointerId(t);if(!this._pointerState.has(i)){const e={downButton:t.native.button,immediateDoubleClick:null};this._pointerState.set(i,e),this.startCapturingPointer(t.native)}}_handlePointerLoss(e,t){const i=e.data,s=this._pointerId(i),n=this._pointerState.get(s);if(n&&"pointer-up"===t&&n.downButton===i.native.button){const t=n.immediateDoubleClick;if(t){t.timeoutHandle.remove();const s="touch"===e.data.native.pointerType?this.maximumDoubleTouchDistance:this.maximumDoubleClickDistance;dc(t,e.data)>s?this._startImmediateDoubleClick(e,n):(this._immediateDoubleClick.emit(e.data,void 0,t.modifiers),this._removeState(i))}else this._startImmediateDoubleClick(e,n)}}_startImmediateDoubleClick(e,t){const i="touch"===e.data.native.pointerType?this.maximumDoubleTouchDelay:this.maximumDoubleClickDelay;t.immediateDoubleClick={x:e.data.x,y:e.data.y,modifiers:e.modifiers,timeoutHandle:this._clock.setTimeout((()=>this._removeState(e.data)),i)}}_pointerId(e){const t=e.native;return"mouse"===t.pointerType?`${t.pointerId}:${t.button}`:`${t.pointerType}`}_removeState(e){const t=this._pointerId(e);this._pointerState.delete(t),this.stopCapturingPointer(e.native),this.refreshHasPendingInputs()}}const xc=300,kc=1.5,Sc=6,Pc=6,Lc=500;class Ec extends nn{constructor(e=xc,t=kc,i=Sc,s=Pc,n=Lc,r=hc.Z){super(!1),this.maximumClickDelay=e,this.movementUntilMouseDrag=t,this.movementUntilPenDrag=i,this.movementUntilTouchDrag=s,this.holdDelay=n,this._clock=r,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing("pointer-drag"),this._immediateClick=this.registerOutgoing("immediate-click"),this._pointerHold=this.registerOutgoing("hold"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",(e=>{this._handlePointerLoss(e,"pointer-up")})),this.registerIncoming("pointer-capture-lost",(e=>{this._handlePointerLoss(e,"pointer-capture-lost")})),this.registerIncoming("pointer-cancel",(e=>{this._handlePointerLoss(e,"pointer-cancel")})),this._moveHandle=this.registerIncoming("pointer-move",this._handlePointerMove.bind(this)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach((e=>{null!=e.holdTimeout&&(e.holdTimeout.remove(),e.holdTimeout=null)})),super.onUninstall()}_handlePointerDown(e){const t=e.data,i=t.native.pointerId;let s=null;0===this._pointerState.size&&(s=this._clock.setTimeout((()=>{const t=this._pointerState.get(i);if(t){if(!t.isDragging){const i=t.previousEvent;this._pointerHold.emit(i,void 0,e.modifiers),t.holdEmitted=!0}t.holdTimeout=null}}),this.holdDelay));const n={startEvent:t,previousEvent:t,startTimestamp:e.timestamp,isDragging:!1,downButton:t.native.button,holdTimeout:s,modifiers:new Set};this._pointerState.set(i,n),this.startCapturingPointer(t.native),this._moveHandle.resume(),this._pointerState.size>1&&this.startDragging(e)}_createPointerDragData(e,t,i){return{action:e,startEvent:t.startEvent,previousEvent:t.previousEvent,currentEvent:i}}_handlePointerMove(e){const t=e.data,i=t.native.pointerId,s=this._pointerState.get(i);s&&(s.isDragging?this._pointerDrag.emit(this._createPointerDragData("update",s,t),void 0,s.modifiers):function(e,t){const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}(t,s.startEvent)>this._getDragThreshold(t.native.pointerType)&&this.startDragging(e),s.previousEvent=t)}_getDragThreshold(e){switch(e){case"touch":return this.movementUntilTouchDrag;case"pen":return this.movementUntilPenDrag;default:return this.movementUntilMouseDrag}}startDragging(e){const t=e.data,i=t.native.pointerId;this._pointerState.forEach((s=>{null!=s.holdTimeout&&(s.holdTimeout.remove(),s.holdTimeout=null),s.isDragging||(s.modifiers=e.modifiers,s.isDragging=!0,i===s.startEvent.native.pointerId?this._pointerDrag.emit(this._createPointerDragData("start",s,t)):this._pointerDrag.emit(this._createPointerDragData("start",s,s.previousEvent),e.timestamp))}))}_handlePointerLoss(e,t){const i=e.data,s=i.native.pointerId,n=this._pointerState.get(s);n&&(null!=n.holdTimeout&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging?this._pointerDrag.emit(this._createPointerDragData("end",n,"pointer-up"===t?i:n.previousEvent),void 0,n.modifiers):"pointer-up"===t&&n.downButton===i.native.button&&e.timestamp-n.startTimestamp<=this.maximumClickDelay&&!n.holdEmitted&&this._immediateClick.emit(i),this._pointerState.delete(s),this.stopCapturingPointer(i.native),0===this._pointerState.size&&this._moveHandle.pause())}}const Ac="Ctrl",Fc={left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},Vc={zoomIn:["=","+"],zoomOut:["-","_"]},Oc={clockwiseOption1:"a",clockwiseOption2:"A",counterClockwiseOption1:"d",counterClockwiseOption2:"D",resetOption1:"n",resetOption2:"N"};let Rc=class extends L.Z{constructor(){super(...arguments),this._handles=new M.Z}initialize(){this._handles.add([(0,m.PA)(this.view,"ready",(()=>this._disconnect())),(0,m.gx)(this.view,"ready",(()=>this._connect()))])}destroy(){this._handles&&(this._handles.removeAll(),this._handles=null),this._disconnect()}_disconnect(){this._inputManager&&(this.view.viewEvents.disconnect(),this._inputManager.destroy(),this._inputManager=null,this._source.destroy(),this._source=null)}_connect(){const e=this.view.surface,t=new ac(e,this.view.input),i=[new Tc,new Ec,new gc,new bc(this.view.navigation),new yc],s=new cn({eventSource:t,recognizers:i});s.installHandlers("prevent-context-menu",[new cc],dn.INTERNAL),s.installHandlers("navigation",[new Xl(this.view),new Gl(this.view),new Yl(this.view),new Rl(this.view),new Rl(this.view,[Ac]),new Zl(this.view,"primary"),new ql(this.view,Fc),new Kl(this.view,Vc),new $l(this.view,Oc),new Nl(this.view,"secondary"),new Dl(this.view,"touch")],dn.INTERNAL),this.view.viewEvents.connect(s),this._source=t,this._inputManager=s,(0,m.S1)(this.view.navigation,"browserTouchPanEnabled",(e=>{this._source.browserTouchPanningEnabled=!e}))}get test(){return{inputManager:this._inputManager}}};(0,n._)([(0,l.Cb)()],Rc.prototype,"view",void 0),Rc=(0,n._)([(0,c.j)("esri.views.2d.input.MapViewInputManager")],Rc);var Dc=Rc;let jc=0,Zc=class extends L.Z{constructor(){super(...arguments),this.color=new y.Z([0,255,255]),this.haloOpacity=1,this.fillOpacity=.25}get version(){return jc++}};(0,n._)([(0,l.Cb)({readOnly:!0}
1)],Zc.prototype,"version",null),(0,n._)([(0,l.Cb)({type:y.Z})],Zc.prototype,"color",void 0),(0,n._)([(0,l.Cb)({type:y.Z})],Zc.prototype,"haloColor",void 0),(0,n._)([(0,l.Cb)()],Zc.prototype,"haloOpacity",void 0),(0,n._)([(0,l.Cb)()],Zc.prototype,"fillOpacity",void 0),Zc=(0,n._)([(0,c.j)("esri.views.2d.support.HighlightOptions")],Zc);var Nc=Zc,zc=i(35119);const Bc={checkMajorWebPerformanceCaveat:!0};const Gc="esri-component";let Wc=class extends L.Z{constructor(){super(...arguments),this.widget=null}destroy(){this.widget&&this.widget.destroy(),this.node=null}get id(){return this.get("widget.id")||this.get("node.id")}set node(e){const t=this._get("node");e!==t&&(e&&e.classList.add(Gc),t&&t.classList.remove(Gc),this._set("node",e))}castNode(e){return e?"string"==typeof e||function(e){return e&&"nodeType"in e}(e)?(this._set("widget",null),(0,P.L7)(e)):(function(e){return e&&"function"==typeof e.render}(e)&&!e.domNode&&(e.domNode=document.createElement("div")),this._set("widget",e),e.domNode):(this._set("widget",null),null)}};(0,n._)([(0,l.Cb)({dependsOn:[]})],Wc.prototype,"id",null),(0,n._)([(0,l.Cb)()],Wc.prototype,"node",null),(0,n._)([(0,R.p)("node")],Wc.prototype,"castNode",null),(0,n._)([(0,l.Cb)({readOnly:!0})],Wc.prototype,"widget",void 0),Wc=(0,n._)([(0,c.j)("esri.views.ui.Component")],Wc);var Uc=Wc;const Hc={left:0,top:0,bottom:0,right:0},qc={bottom:30,top:15,right:15,left:15},$c="manual",Kc="esri-ui",Yc="esri-ui-corner",Xc="esri-ui-inner-container",Qc="esri-ui-manual-container",Jc="esri-ui-corner-container",eh="esri-ui-top-left",th="esri-ui-top-right",ih="esri-ui-bottom-left",sh="esri-ui-bottom-right";function nh(e){return"object"!=typeof e||e instanceof Uc||"declaredClass"in e||!("component"in e||"index"in e||"position"in e)?null:e}function rh(e,{top:t,bottom:i,left:s,right:n}){e.style.top=t,e.style.bottom=i,e.style.left=s,e.style.right=n}let oh=class extends Es.Z.EventedAccessor{constructor(e){super(e),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentToKey=new Map,this._handles=new M.Z,this.view=null,this._initContainers()}initialize(){this._handles.add([(0,m.S1)(this,"view.padding, container",this._applyViewPadding.bind(this)),(0,m.S1)(this,"padding",this._applyUIPadding.bind(this))])}destroy(){this.container=null;for(const e of this._components)e.destroy();this._components.length=0,this._handles.destroy(),this._componentToKey.clear()}set container(e){const t=this._get("container");e!==t&&(e&&(e.classList.add(Kc),this._attachContainers(e)),t&&(t.classList.remove(Kc),rh(t,{top:"",bottom:"",left:"",right:""}),(0,P.cS)(t)),this._set("container",e))}get height(){const e=this.get("view.height")||0;if(0===e)return e;const t=this._getViewPadding(),i=t.top+t.bottom;return Math.max(e-i,0)}get padding(){return this._get("padding")}set padding(e){e?this._override("padding",e):this._clearOverride("padding")}castPadding(e){return"number"==typeof e?{bottom:e,top:e,right:e,left:e}:{...qc,...e}}get width(){const e=this.get("view.width")||0;if(0===e)return e;const t=this._getViewPadding(),i=t.left+t.right;return Math.max(e-i,0)}add(e,t){let i,s;if(Array.isArray(e))return void e.forEach((e=>this.add(e,t)));const n=nh(e);n&&({index:i,position:t,component:e,key:s}=n),t&&"object"==typeof t&&({index:i,key:s,position:t}=t),!e||t&&!this._isValidPosition(t)||this._add(e,t,i,s)}remove(e,t){if(!e)return;if(Array.isArray(e))return e.map((e=>this.remove(e,t)));const i=this._find(e);if(i){const s=this._componentToKey;if(s.has(e)&&s.get(e)!==t)return;const n=this._components.indexOf(i);return i.node.parentNode&&i.node.parentNode.removeChild(i.node),this._componentToKey.delete(e),this._components.splice(n,1)[0]}}empty(e){return Array.isArray(e)?e.map((e=>this.empty(e))).reduce(((e,t)=>e.concat(t))):(e=e||$c)===$c?Array.prototype.slice.call(this._manualContainer.children).filter((e=>!e.classList.contains(Yc))).map((e=>this.remove(e))):this._isValidPosition(e)?Array.prototype.slice.call(this._cornerNameToContainerLookup[e].children).map(this.remove,this):null}move(e,t){if(Array.isArray(e)&&e.forEach((e=>this.move(e,t))),!e)return;let i;const s=nh(e)||nh(t);if(s&&(i=s.index,t=s.position,e=s.component||e),t&&!this._isValidPosition(t))return;const n=this.remove(e);n&&this.add(n,{position:t,index:i})}find(e){if(!e)return null;const t=this._findById(e);return t&&(t.widget||t.node)}getPosition(e){for(const t in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[t].contains(e))return t;return null}_add(e,t,i,s){e instanceof Uc||(e=new Uc({node:e})),this._place({component:e,position:t,index:i}),this._components.push(e),s&&this._componentToKey.set(e,s)}
1_find(e){return e?e instanceof Uc?this._findByComponent(e):"string"==typeof e?this._findById(e):this._findByNode(e.domNode||e):null}_getViewPadding(){return this.get("view.padding")||Hc}_attachContainers(e){e.appendChild(this._innerContainer),e.appendChild(this._manualContainer)}_initContainers(){const e=document.createElement("div");e.classList.add(Xc),e.classList.add(Jc);const t=document.createElement("div");t.classList.add(Xc),t.classList.add(Qc);const i=document.createElement("div");i.classList.add(eh),i.classList.add(Yc),e.appendChild(i);const s=document.createElement("div");s.classList.add(th),s.classList.add(Yc),e.appendChild(s);const n=document.createElement("div");n.classList.add(ih),n.classList.add(Yc),e.appendChild(n);const r=document.createElement("div");r.classList.add(sh),r.classList.add(Yc),e.appendChild(r),this._innerContainer=e,this._manualContainer=t;const o=(0,z.dZ)();this._cornerNameToContainerLookup={"top-left":i,"top-right":s,"bottom-left":n,"bottom-right":r,"top-leading":o?s:i,"top-trailing":o?i:s,"bottom-leading":o?r:n,"bottom-trailing":o?n:r},this._positionNameToContainerLookup={manual:t,...this._cornerNameToContainerLookup}}_isValidPosition(e){return!!this._positionNameToContainerLookup[e]}_place(e){const t=e.component,i=e.position||$c,s=e.index,n=this._positionNameToContainerLookup[i],r=s>-1;if(function(e){return e&&!e._started&&"function"==typeof e.postMixInProperties&&"function"==typeof e.buildRendering&&"function"==typeof e.postCreate&&"function"==typeof e.startup}(t.widget)&&t.widget.startup(),!r)return void n.appendChild(t.node);const o=Array.prototype.slice.call(n.children);0!==s?s>=o.length?n.appendChild(t.node):(0,P.Vt)(t.node,o[s]):n.firstChild?(0,P.Vt)(t.node,n.firstChild):n.appendChild(t.node)}_applyViewPadding(){const e=this.container;e&&rh(e,this._toPxPosition(this._getViewPadding()))}_applyUIPadding(){const e=this._innerContainer;e&&rh(e,this._toPxPosition(this.padding))}_toPxPosition(e){return{top:this._toPxUnit(e.top),left:this._toPxUnit(e.left),right:this._toPxUnit(e.right),bottom:this._toPxUnit(e.bottom)}}_toPxUnit(e){return 0===e?"0":e+"px"}_findByComponent(e){let t,i=null;return this._components.some((s=>(t=s===e,t&&(i=s),t))),i}_findById(e){let t,i=null;return this._components.some((s=>(t=s.id===e,t&&(i=s),t))),i}_findByNode(e){let t,i=null;return this._components.some((s=>(t=s.node===e,t&&(i=s),t))),i}};(0,n._)([(0,l.Cb)()],oh.prototype,"container",null),(0,n._)([(0,l.Cb)()],oh.prototype,"height",null),(0,n._)([(0,l.Cb)({value:qc})],oh.prototype,"padding",null),(0,n._)([(0,R.p)("padding")],oh.prototype,"castPadding",null),(0,n._)([(0,l.Cb)()],oh.prototype,"view",void 0),(0,n._)([(0,l.Cb)()],oh.prototype,"width",null),oh=(0,n._)([(0,c.j)("esri.views.ui.UI")],oh);var ah=oh,lh=i(67979);function ch(e,t){return e&&"copyright"in e&&(!t||"function"==typeof e.originOf&&"user"===e.originOf("copyright"))}function hh(e,t,i){i&&t&&(e.find((e=>e.layerView===t&&e.text===i))||e.push({text:i,layerView:t}))}const dh=[];let uh=class extends te.r{constructor(e){super(e),this.clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.handles.remove("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new d.Z,this.view=null,this._allLayerViewsChange=e=>{this.handles.remove("suspension");const t=this.get("view.allLayerViews");t&&this.handles.add(t.map((e=>e.watch(["suspended","attributionVisible"],this._updateAttributionItems))),"suspension"),e&&e.removed&&e.removed.forEach((e=>{this._pendingAttributions.delete(e),this._fetchedAttributionData.delete(e)})),this._updateAttributionItems()},this._updateAttributionItems=()=>{const e=this.get("view.allLayerViews");dh.length=0,e?(e.forEach((e=>{if(e.suspended||!e.get("layer.attributionVisible"))return;const t=e.layer;if(ch(t,"user"))return void hh(dh,e,t.copyright);if(t.hasAttributionData){if(this._fetchedAttributionData.has(e)){const i=this._fetchedAttributionData.get(e);return void(i?hh(dh,e,this._getDynamicAttribution(i,this.view,t)):ch(t)&&hh(dh,e,t.copyright))}return void this._fetchAttributionData(e)}const i=t.get("portalItem.accessInformation");hh(dh,e,i||t.copyright)})),function(e,t){return e.length!==t.length||e.some(((e,i)=>e.text!==t[i].text))}(this.items,dh)&&(this.items.removeAll(),this.items.addMany(dh)),dh.length=0,this.notifyChange("state")):this.clear()},this.handles.add([(0,m.on)(this,"view.allLayerViews","change",this._allLayerViewsChange,this._allLayerViewsChange,this.clear),(0,m.Z4)(this,"view.stationary",(()=>this._updateAttributionItems()))])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.get("view.ready")?this._pendingAttributions.size>0?"loading":"ready":"disabled"}
1async _fetchAttributionData(e){if(this._pendingAttributions.has(e))return;this._pendingAttributions.add(e);const t=await(0,lh.q6)(e.layer.fetchAttributionData());if(this._pendingAttributions.has(e)){const i=t.ok?this._createContributionIndex(t.value,function(e){return"bing-maps"===e.type}(e.layer)):null;this._pendingAttributions.delete(e),this._fetchedAttributionData.set(e,i)}this._updateAttributionItems()}_createContributionIndex(e,t){const i=e.contributors,s={};if(!i)return s;for(let n=0;n<i.length;n++){const e=i[n],r=e.coverageAreas;if(!r)return;for(const i of r){const r=i.bbox,o=i.zoomMin-(t&&i.zoomMin?1:0),a=i.zoomMax-(t&&i.zoomMax?1:0),l={xmin:r[1],ymin:r[0],xmax:r[3],ymax:r[2],spatialReference:yo.Z.WGS84},c={extent:(0,zs.$)(l),attribution:e.attribution||"",score:null!=i.score?i.score:100,id:n};for(let e=o;e<=a;e++)s[e]=s[e]||[],s[e].push(c)}}return s.maxKey=Math.max.apply(null,Object.keys(s)),s}_getDynamicAttribution(e,t,i){const{extent:s,scale:n}=t;let r=i.tileInfo.scaleToZoom(n);if(r=Math.min(e.maxKey,Math.round(r)),!s||null==r||r<=-1)return"";const o=e[r],a=(0,zs.iV)(s.center.clone().normalize(),t.spatialReference),l={};return o?o.filter((e=>{const t=!l[e.id]&&a&&(0,Ja.aV)(e.extent,a);return t&&(l[e.id]=!0),t})).sort(((e,t)=>t.score-e.score||e.objectId-t.objectId)).map((e=>e.attribution)).join(", "):""}};(0,n._)([(0,l.Cb)({readOnly:!0,type:d.Z})],uh.prototype,"items",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],uh.prototype,"state",null),(0,n._)([(0,l.Cb)()],uh.prototype,"view",void 0),uh=(0,n._)([(0,c.j)("esri.widgets.Attribution.AttributionViewModel")],uh);var ph=uh;const mh="esri-attribution esri-widget",fh="esri-widget__anchor",gh="esri-attribution__powered-by",yh="esri-attribution__sources",vh="esri-attribution--open",_h="esri-attribution__sources--open",bh="esri-attribution__link",wh="esri-icon-description",Ch="esri-interactive";let Mh=class extends H.Z{constructor(e,t){super(e,t),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this.iconClass=wh,this.itemDelimiter=" | ",this.label=void 0,this.messages=null,this.view=null,this.viewModel=new ph}initialize(){this.own((0,m.on)(this,"viewModel.items","change",(()=>this.scheduleRender())))}get attributionText(){return this.viewModel.items.reduce(((e,t)=>(-1===e.indexOf(t.text)&&e.push(t.text),e)),[]).join(this.itemDelimiter)}render(){const e={[vh]:this._isOpen};return(0,U.j)("div",{bind:this,class:this.classes(mh,e),onclick:this._toggleState,onkeydown:this._toggleState},this.renderSourcesNode(),this.renderPoweredBy())}renderPoweredBy(){return(0,U.j)("div",{class:gh},"Powered by"," ",(0,U.j)("a",{class:this.classes(bh,fh),href:"http://www.esri.com/",target:"_blank",rel:"noreferrer"},"Esri"))}renderSourcesNode(){const e=this._isOpen,t=this._isInteractive(),i=t?0:-1,{attributionText:s}=this,n=t?"button":void 0,r={[_h]:e,[Ch]:t};return(0,U.j)("div",{afterCreate:this._afterSourcesNodeCreate,afterUpdate:this._afterSourcesNodeUpdate,bind:this,class:this.classes(yh,r),innerHTML:s,role:n,tabIndex:i})}_afterSourcesNodeCreate(e){this._prevSourceNodeHeight=e.clientWidth}_afterSourcesNodeUpdate(e){let t=!1;const{clientHeight:i,clientWidth:s,scrollWidth:n}=e,r=n>=s,o=this._attributionTextOverflowed!==r;if(this._attributionTextOverflowed=r,o&&(t=!0),this._isOpen){const e=i<this._prevSourceNodeHeight;this._prevSourceNodeHeight=i,e&&(this._isOpen=!1,t=!0)}t&&this.scheduleRender()}_toggleState(){this._isInteractive()&&(this._isOpen=!this._isOpen)}_isInteractive(){return this._isOpen||this._attributionTextOverflowed}};(0,n._)([(0,l.Cb)({readOnly:!0,dependsOn:["viewModel.items.length","itemDelimiter"]})],Mh.prototype,"attributionText",null),(0,n._)([(0,l.Cb)()],Mh.prototype,"iconClass",void 0),(0,n._)([(0,l.Cb)()],Mh.prototype,"itemDelimiter",void 0),(0,n._)([(0,l.Cb)({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],Mh.prototype,"label",void 0),(0,n._)([(0,l.Cb)(),(0,W.H)("esri/widgets/Attribution/t9n/Attribution")],Mh.prototype,"messages",void 0),(0,n._)([(0,O.B)("viewModel.view")],Mh.prototype,"view",void 0),(0,n._)([(0,l.Cb)({type:ph})],Mh.prototype,"viewModel",void 0),(0,n._)([B()],Mh.prototype,"_toggleState",null),Mh=(0,n._)([(0,c.j)("esri.widgets.Attribution")],Mh);var Ih=Mh;let Th=class extends(Cn(L.Z)){constructor(e){super(e),this._handles=new M.Z,this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this._handles.add((0,m.S1)(this,"view",this._updateRotationWatcher))}destroy(){this._handles.destroy(),this._handles=null,this.view=null}get canShowNorth(){const e=this.get("view.spatialReference");return!(!e||!e.isWebMercator&&!e.isGeographic)}get state(){return this.get("view.ready")?this.canShowNorth?"compass":"rotation":"disabled"}reset(){if(!this.get("view.ready"))return;const e={};"2d"===this.view.type?e.rotation=0:e.heading=0,this.callGoTo({target:e})}_updateForRotation(e){null!=e&&(this.orientation={z:e})}_updateForCamera(e){if(!e)return;const t=-e.heading;this.orientation={x:0,y:0,z:t}}_updateRotationWatcher(e){this._handles.removeAll(),e&&("2d"===e.type?this._handles.add((0,m.S1)(this,"view.rotation",this._updateForRotation)):this._handles.add((0,m.S1)(this,"view.camera",this._updateForCamera)))}};(0,n._)([(0,l.Cb)({readOnly:!0})],Th.prototype,"canShowNorth",null),(0,n._)([(0,l.Cb)()],Th.prototype,"orientation",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Th.prototype,"state",null),(0,n._)([(0,l.Cb)()],Th.prototype,"view",void 0),Th=(0,n._)([(0,c.j)("esri.widgets.CompassViewModel")],Th);var xh=Th;const kh="esri-compass esri-widget--button esri-widget",Sh="esri-icon-font-fallback-text",Ph="esri-compass__icon",Lh="esri-icon-dial",Eh="esri-icon-compass",Ah="esri-icon-locate-circled",Fh="esri-interactive",Vh="esri-disabled";let Oh=class extends H.Z{constructor(e,t){super(e,t),this.goToOverride=null,this.iconClass=Ah,this.label=void 0,this.messages=null,this.view=null,this.viewModel=new xh}reset(){return this.viewModel.reset()}render(){const{orientation:e,state:t}=this.viewModel,i="disabled"===t,s="compass"===("rotation"===t?"rotation":"compass"),n=i?-1:0,r={[Vh]:i,[Fh]:!i},o={[Eh]:s,[Lh]:!s},{messages:a}=this;return(0,U.j)("div",{bind:this,class:this.classes(kh,r),onclick:this._reset,onkeydown:this._reset,role:"button",tabIndex:n,"aria-label":a.reset,title:a.reset},(0,U.j)("span",{"aria-hidden":"true",class:this.classes(Ph,o),styles:this._toRotationTransform(e)}
1),(0,U.j)("span",{class:Sh},a.reset))}_reset(){this.viewModel.reset()}_toRotationTransform(e){return{transform:`rotateZ(${e.z}deg)`}}};(0,n._)([(0,O.B)("viewModel.goToOverride")],Oh.prototype,"goToOverride",void 0),(0,n._)([(0,l.Cb)()],Oh.prototype,"iconClass",void 0),(0,n._)([(0,l.Cb)({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],Oh.prototype,"label",void 0),(0,n._)([(0,l.Cb)(),(0,W.H)("esri/widgets/Compass/t9n/Compass")],Oh.prototype,"messages",void 0),(0,n._)([(0,O.B)("viewModel.view")],Oh.prototype,"view",void 0),(0,n._)([(0,l.Cb)({type:xh})],Oh.prototype,"viewModel",void 0),(0,n._)([B()],Oh.prototype,"_reset",null),Oh=(0,n._)([(0,c.j)("esri.widgets.Compass")],Oh);var Rh=Oh;let Dh=class extends L.Z{constructor(e){super(e),this._handles=new M.Z,this.navigationMode="pan",this.view=null}initialize(){this._handles.add((0,m.gx)(this,"view.inputManager",this._setNavigationMode.bind(this)))}destroy(){this._handles.destroy(),this._handles=null,this.view=null}get state(){return this.get("view.ready")&&"3d"===this.view.type?"ready":"disabled"}toggle(){"disabled"!==this.state&&(this.navigationMode="pan"!==this.navigationMode?"pan":"rotate",this._setNavigationMode())}_setNavigationMode(){this.get("view.inputManager").primaryDragAction="pan"===this.navigationMode?"pan":"rotate"}};(0,n._)([(0,l.Cb)({readOnly:!0})],Dh.prototype,"state",null),(0,n._)([(0,l.Cb)()],Dh.prototype,"navigationMode",void 0),(0,n._)([(0,l.Cb)()],Dh.prototype,"view",void 0),Dh=(0,n._)([(0,c.j)("esri.widgets.NavigationToggleViewModel")],Dh);var jh=Dh;const Zh="esri-navigation-toggle esri-widget",Nh="esri-navigation-toggle__button esri-widget--button",zh="esri-navigation-toggle__button--active",Bh="esri-navigation-toggle__button--pan",Gh="esri-navigation-toggle__button--rotate",Wh="esri-navigation-toggle--horizontal",Uh="esri-icon-rotate",Hh="esri-icon-pan",qh="esri-icon-pan2",$h="esri-disabled";let Kh=class extends H.Z{constructor(e,t){super(e,t),this.iconClass=qh,this.label=void 0,this.messages=null,this.view=null,this.viewModel=new jh}set layout(e){"horizontal"!==e&&(e="vertical"),this._set("layout",e)}toggle(){return this.viewModel.toggle()}render(){const e="disabled"===this.get("viewModel.state"),t="pan"===this.get("viewModel.navigationMode"),i={[$h]:e,[Wh]:"horizontal"===this.layout},s={[zh]:t},n={[zh]:!t},r=e?-1:0,o=this.messages.toggle;return(0,U.j)("div",{bind:this,class:this.classes(Zh,i),onclick:this._toggle,onkeydown:this._toggle,tabIndex:r,"aria-label":o,title:o},(0,U.j)("div",{class:this.classes(Nh,Bh,s)},(0,U.j)("span",{class:Hh})),(0,U.j)("div",{class:this.classes(Nh,Gh,n)},(0,U.j)("span",{class:Uh})))}_toggle(){this.toggle()}};(0,n._)([(0,l.Cb)()],Kh.prototype,"iconClass",void 0),(0,n._)([(0,l.Cb)({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],Kh.prototype,"label",void 0),(0,n._)([(0,l.Cb)({value:"vertical"})],Kh.prototype,"layout",null),(0,n._)([(0,l.Cb)(),(0,W.H)("esri/widgets/NavigationToggle/t9n/NavigationToggle")],Kh.prototype,"messages",void 0),(0,n._)([(0,O.B)("viewModel.view")],Kh.prototype,"view",void 0),(0,n._)([(0,l.Cb)({type:jh})],Kh.prototype,"viewModel",void 0),(0,n._)([B()],Kh.prototype,"_toggle",null),Kh=(0,n._)([(0,c.j)("esri.widgets.NavigationToggle")],Kh);var Yh=Kh;const Xh="esri-widget--button esri-widget",Qh="esri-disabled",Jh="esri-interactive",ed="esri-icon-font-fallback-text",td="esri-icon";let id=class extends H.Z{constructor(){super(...arguments),this.enabled=!0,this.iconClass="",this.title=""}render(){const e=this.enabled?0:-1,t={[Qh]:!this.enabled,[Jh]:this.enabled},i={[this.iconClass]:!!this.iconClass};return(0,U.j)("div",{bind:this,class:this.classes(Xh,t),onclick:this._triggerAction,onkeydown:this._triggerAction,role:"button",tabIndex:e,title:this.title},(0,U.j)("span",{"aria-hidden":"true",role:"presentation",class:this.classes(td,i)}),(0,U.j)("span",{class:ed},this.title))}_triggerAction(){this.action.call(this)}};(0,n._)([(0,l.Cb)()],id.prototype,"action",void 0),(0,n._)([(0,l.Cb)()],id.prototype,"enabled",void 0),(0,n._)([(0,l.Cb)()],id.prototype,"iconClass",void 0),(0,n._)([(0,l.Cb)()],id.prototype,"title",void 0),(0,n._)([B()],id.prototype,"_triggerAction",null),id=(0,n._)([(0,c.j)("esri.widgets.IconButton")],id);var sd=id;let nd=class extends L.Z{get canZoomIn(){if(!this.get("view.ready"))return!1;const e=this.get("view.animation.target.scale")||this.get("view.scale"),t=this.get("view.constraints.effectiveMaxScale");return 0===t||e>t}
1get canZoomOut(){if(!this.get("view.ready"))return!1;const e=this.get("view.animation.target.scale")||this.get("view.scale"),t=this.get("view.constraints.effectiveMinScale");return 0===t||e<t}};(0,n._)([(0,l.Cb)({readOnly:!0})],nd.prototype,"canZoomIn",null),(0,n._)([(0,l.Cb)({readOnly:!0})],nd.prototype,"canZoomOut",null),(0,n._)([(0,l.Cb)()],nd.prototype,"view",void 0),nd=(0,n._)([(0,c.j)("esri.widgets.Zoom.ZoomConditions2D")],nd);var rd=nd;let od=class extends L.Z{get canZoomIn(){return!!this.get("view.ready")}get canZoomOut(){return!!this.get("view.ready")}};(0,n._)([(0,l.Cb)({readOnly:!0})],od.prototype,"canZoomIn",null),(0,n._)([(0,l.Cb)({readOnly:!0})],od.prototype,"canZoomOut",null),(0,n._)([(0,l.Cb)()],od.prototype,"view",void 0),od=(0,n._)([(0,c.j)("esri.widgets.Zoom.ZoomConditions3D")],od);var ad=od;let ld=class extends L.Z{constructor(e){super(e),this.canZoomIn=!1,this.canZoomOut=!1}destroy(){this.view=null}get state(){return this.get("view.ready")?"ready":"disabled"}set view(e){e?"2d"===e.type?this._zoomConditions=new rd({view:e}):"3d"===e.type&&(this._zoomConditions=new ad({view:e})):this._zoomConditions=null,this._set("view",e)}zoomIn(){if(!this.canZoomIn)return;const e=this.view;"2d"===e.type?e.mapViewNavigation.zoomIn():(0,fi.R8)(e.goTo({zoomFactor:2}))}zoomOut(){if(!this.canZoomOut)return;const e=this.view;"2d"===e.type?e.mapViewNavigation.zoomOut():(0,fi.R8)(e.goTo({zoomFactor:.5}))}};(0,n._)([(0,l.Cb)()],ld.prototype,"_zoomConditions",void 0),(0,n._)([(0,l.Cb)({aliasOf:"_zoomConditions.canZoomIn",readOnly:!0})],ld.prototype,"canZoomIn",void 0),(0,n._)([(0,l.Cb)({aliasOf:"_zoomConditions.canZoomOut",readOnly:!0})],ld.prototype,"canZoomOut",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],ld.prototype,"state",null),(0,n._)([(0,l.Cb)()],ld.prototype,"view",null),ld=(0,n._)([(0,c.j)("esri.widgets.Zoom.ZoomViewModel")],ld);var cd=ld;const hd="esri-zoom esri-widget",dd="esri-zoom--horizontal",ud="esri-icon-plus",pd="esri-icon-minus",md="esri-icon-zoom-in-magnifying-glass";let fd=class extends H.Z{constructor(e,t){super(e,t),this.iconClass=md,this.label=void 0,this.messages=null,this.view=null,this.viewModel=new cd}initialize(){this._zoomInButton=new sd({action:this.zoomIn.bind(this),iconClass:ud}),this._zoomOutButton=new sd({action:this.zoomOut.bind(this),iconClass:pd})}destroy(){this._zoomInButton.destroy(),this._zoomOutButton.destroy(),this._zoomInButton=null,this._zoomOutButton=null}set layout(e){"horizontal"!==e&&(e="vertical"),this._set("layout",e)}render(){const e=this.viewModel,t={[dd]:"horizontal"===this.layout};return this._zoomInButton.enabled="ready"===e.state&&e.canZoomIn,this._zoomOutButton.enabled="ready"===e.state&&e.canZoomOut,this._zoomInButton.title=this.messages.zoomIn,this._zoomOutButton.title=this.messages.zoomOut,(0,U.j)("div",{class:this.classes(hd,t)},this._zoomInButton.render(),this._zoomOutButton.render())}zoomIn(){return this.viewModel.zoomIn()}zoomOut(){return this.viewModel.zoomOut()}};(0,n._)([(0,l.Cb)()],fd.prototype,"iconClass",void 0),(0,n._)([(0,l.Cb)({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],fd.prototype,"label",void 0),(0,n._)([(0,l.Cb)({value:"vertical"})],fd.prototype,"layout",null),(0,n._)([(0,l.Cb)(),(0,W.H)("esri/widgets/Zoom/t9n/Zoom")],fd.prototype,"messages",void 0),(0,n._)([(0,O.B)("viewModel.view")],fd.prototype,"view",void 0),(0,n._)([(0,l.Cb)({type:cd})],fd.prototype,"viewModel",void 0),fd=(0,n._)([(0,c.j)("esri.widgets.Zoom")],fd);var gd=fd;const yd="esri.views.ui.DefaultUI";a.Z.getLogger(yd);let vd=class extends ah{constructor(e){super(e),this._defaultPositionLookup={attribution:"manual",compass:"top-leading","navigation-toggle":"top-leading",zoom:"top-leading"},this.components=[]}initialize(){this._handles.add([(0,m.S1)(this,"components",this._componentsWatcher.bind(this)),(0,m.S1)(this,"view",this._updateViewAwareWidgets.bind(this))])}_add(e,t,i,s){if("string"==typeof e&&this._defaultPositionLookup[e]){if(this._find(e))return;e=this._createComponent(e)}super._add(e,t,i,s)}_removeComponents(e){e.forEach((e=>{const t=this._find(e);t&&(this.remove(t),t.destroy())}))}
1_updateViewAwareWidgets(e){this.components.forEach((t=>{const i=this._find(t),s=i&&i.widget;(function(e){return e&&void 0!==e.view})(s)&&(s.view=e)}))}_componentsWatcher(e,t){this._removeComponents(t),this._addComponents(e),this._adjustPadding(e)}_adjustPadding(e){if(-1===e.indexOf("attribution")&&!this._isOverridden("padding")){const{top:e}=this.padding;this.padding=e}}_addComponents(e){this.initialized&&e.forEach((e=>this.add(this._createComponent(e),this._defaultPositionLookup[e])))}_createComponent(e){const t=this._createWidget(e);if(t)return new Uc({id:e,node:t})}_createWidget(e){return"attribution"===e?this._createAttribution():"compass"===e?this._createCompass():"navigation-toggle"===e?this._createNavigationToggle():"zoom"===e?this._createZoom():void 0}_createAttribution(){return new Ih({view:this.view})}_createCompass(){return new Rh({view:this.view})}_createNavigationToggle(){return new Yh({view:this.view})}_createZoom(){return new gd({view:this.view})}};(0,n._)([(0,l.Cb)()],vd.prototype,"components",void 0),vd=(0,n._)([(0,c.j)(yd)],vd);var _d=vd;let bd=class extends _d{constructor(e){super(e),this.components=["attribution","zoom"]}};(0,n._)([(0,l.Cb)()],bd.prototype,"components",void 0),bd=(0,n._)([(0,c.j)("esri.views.ui.2d.DefaultUI2D")],bd);var wd=bd;const Cd=a.Z.getLogger("esri.views.MapView");let Md,Id,Td,xd,kd,Sd;function Pd(e,t,i){if(e)if(Array.isArray(e)||d.Z.isCollection(e)){if(0===e.length)return;e.forEach((e=>Pd(e,t,i)))}else!function(e){return e instanceof u.Z}(e)?i.add(e):t.add(e)}let Ld=class extends(k(ho(Vl))){constructor(e){super(e),this._magnifierView=null,this._stage=null,this._resolveWhenReady=[],this.rootLayerViews=new p.Z({root:this,rootCollectionNames:["basemapView.baseLayerViews","layerViews","basemapView.referenceLayerViews"],getChildrenFunction:e=>null}),this.floors=new d.Z,this.graphicsView=null,this.highlightOptions=new Nc,this.inputManager=new Dc({view:this}),this.mapViewNavigation=null,this.supersampleScreenhotsEnabled=!0,this.ui=new wd,this.rendering=!1,(0,b.j2)()}destroy(){this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get background(){return this.get("map.initialViewProperties.background")||null}set background(e){void 0===e?this._clearOverride("background"):this._override("background",e)}get textureManager(){return this._stage.painter.textureManager}get navigating(){return!(!this.mapViewNavigation||!this.mapViewNavigation.interacting)}toMap(e){if(go(e)){const t=fo(this,e);return super.toMap(t)}return super.toMap(e)}hitTest(e,t){const i=go(e)?fo(this,e):e;if(!this.ready||isNaN(i.x)||isNaN(i.y))return Promise.resolve({screenPoint:i,results:[]});const s=this.toMap(i),n=[this.graphicsView];n.push.apply(n,this.allLayerViews.toArray().reverse());const r=new Set,o=new Set,a=new Set,l=new Set;return t&&(Pd(t&&t.include,r,a),Pd(t&&t.exclude,o,l)),Promise.all(n.map((e=>!e||!e.hitTest||a.size>0&&!e.layer||a.size>0&&e.layer&&!a.has(e.layer)||l.size>0&&e.layer&&l.has(e.layer)?null:e.hitTest(i.x,i.y)))).then((e=>({screenPoint:i,results:e.filter((e=>null!=e&&(!(r.size>0)||r.has(e))&&(!(o.size>0)||!o.has(e)))).map((e=>({mapPoint:s,graphic:e})))})))}takeScreenshot(e){return this.ready?this._stage.takeScreenshot((0,w.uz)(e,this),this.allLayerViews):Promise.reject("Map view cannot be used before it is ready")}on(e,t,i,s){return this.inputManager&&this.viewEvents.on(e,t,i,s)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){this.graphicsView&&this.graphicsView.graphicUpdateHandler(e)}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}forceDOMReadyCycle(){this.forceReadyCycle()}validate(){let e=function(e){e={...Bc,...e};const t=(0,zc.Z)();return t.available?e.checkMajorWebPerformanceCaveat&&t.majorPerformanceCaveat?new h.Z("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist."):t.supportsHighPrecisionFragment?t.supportsVertexS
1haderSamplers?t.supportsElementIndexUint?t.supportsStandardDerivatives?t.supportsInstancedArrays?null:new h.Z("webgl:instanced-arrays-required","WebGL support for instanced rendering is required but not supported."):new h.Z("webgl:standard-derivatives-required","WebGL support for standard derivatives is required but not supported."):new h.Z("webgl:element-index-uint-required","WebGL support for uint vertex indices is required but not supported."):new h.Z("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):new h.Z("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."):new h.Z("webgl:required","WebGL is required but not supported.")}({checkMajorWebPerformanceCaveat:!1});return(0,r.Z)("safari")&&(0,r.Z)("safari")<9&&(e=new h.Z("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:(0,r.Z)("safari")})),(0,o.pC)(e)?(Cd.warn("#validate()",e.message),Promise.reject(e)):async function(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:s,MapViewNavigation:n,MagnifierView2D:r,Stage:o}]=await Promise.all([Promise.all([i.e(9351),i.e(2828),i.e(123)]).then(i.bind(i,40123)),Promise.all([i.e(9351),i.e(2828),i.e(8953)]).then(i.bind(i,88953))]);Id=e,Td=t,xd=s,kd=n,Sd=r,Md=o}()}_startup(){this.timeline.begin("MapView Startup"),super._startup(),this.graphics.owner=this;const e={disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},t=new Md(this.surface,{canvas:this.renderCanvas,supersampleScreenshots:this.supersampleScreenhotsEnabled,contextOptions:e,renderingOptions:this.renderingOptions,timeline:this.timeline}),i=new Id({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Td(this.featuresTilingScheme)}),s=new kd({view:this,animationManager:this.animationManager}),n=new xd({view:this});this._magnifierView=new Sd,this._magnifierView.magnifier=this.magnifier,this._stage=t,this.frameTask.graphicsView=i,this._set("graphicsView",i),this._set("mapViewNavigation",s),this._set("labelManager",n),this.handles.add([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),t.on("post-render",(()=>this._set("rendering",t.renderRequested))),t.on("will-render",(()=>this._set("rendering",t.renderRequested))),t.on("webgl-error",(e=>this.fatalError=e.error)),(0,m.S1)(this,"stationary",(e=>t.stationary=e),!0),(0,m.S1)(this,"state.id",(()=>t.state=this.state),!0),(0,m.S1)(this,"background",(e=>{t.background=e,this._magnifierView.background=e}),!0),(0,m.S1)(this,"magnifier",(e=>this._magnifierView.magnifier=e),!0),(0,m.S1)(this,"renderingOptions",(e=>t.renderingOptions=e),!0),(0,m.S1)(this,"highlightOptions",(()=>t.highlightOptions=this.highlightOptions),!0)],"map-view"),t.state=this.state,this._updateStageChildren();const r=this._resolveWhenReady;this._resolveWhenReady=[],r.forEach((e=>e(this))),this.timeline.end("MapView Startup")}_teardown(){this.handles.remove("map-view"),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._stage.destroy(),this.graphicsView.destroy(),this.mapViewNavigation.destroy(),this._stage=null,this._set("graphicsView",null),this._magnifierView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,super._teardown()}_updateStageChildren(){this._stage.removeAllChildren(),this.rootLayerViews.forEach((e=>{this._stage.addChild(e.container)}));const e=this.graphicsView;this._stage.addChild(e.container),this._stage.addChild(this._magnifierView)}};(0,n._)([(0,l.Cb)({type:_})],Ld.prototype,"background",null),(0,n._)([(0,l.Cb)()],Ld.prototype,"floors",void 0),(0,n._)([(0,l.Cb)()],Ld.prototype,"graphicsView",void 0),(0,n._)([(0,l.Cb)({type:Nc})],Ld.prototype,"highlightOptions",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Ld.prototype,"inputManager",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Ld.prototype,"textureManager",null),(0,n._)([(0,l.Cb)({readOnly:!0})],Ld.prototype,"mapViewNavigation",void 0),(0,n._)([(0,l.Cb)({type:Boolean})],Ld.prototype,"navigating",null),(0,n._)([(0,l.Cb)({type:Boolean,constructOnly:!0})],Ld.prototype,"supersampleScreenhotsEnabled",void 0),(0,n._)([(0,l.Cb)({type:wd})],Ld.prototype,"ui",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],Ld.prototype,"rendering",void 0),(0,n._)([(0,l.Cb)({constructOnly:!0})],Ld.prototype,"renderCanvas",void 0),(0,n._)([(0,l.Cb)({constructOnly:!0})],Ld.prototype,"deactivatedWebGLExtensions",void 0),(0,n._)([(0,l.Cb)({constructOnly:!0})],Ld.prototype,"debugWebGLExtensions",void 0),Ld=(0,n._)([(0,c.j)("esri.views.MapView")],Ld);var Ed=Ld},55068:function(e,t,i){i.d(t,{yc:function(){return l},NE:function(){return c}});var s=i(36663),n=(i(39994),i(13802),i(7283),i(81977)),r=i(42730),o=i(66645),a=(i(3466),i(12173),i(51876),i(78668));const l=e=>{let t=class extends e{constructor(){super(...arguments),this.refreshTimestamp=null,this.refreshDebounced=(0,a.Ds)((async(e,t)=>{let i;"number"==typeof e?i=e:(i=Date.now(),t=e),this._set("refreshTimestamp",i),this.doRefresh&&await this.doRefresh(t)}),2e3)}refresh(e=Date.now()){this._set("refreshTimestamp",e),this.doRefresh&&this.doRefresh()}};return(0,s._)([(0,n.Cb)()],t.prototype,"layer",void 0),(0,s._)([(0,r.B)("layer.refreshInterval")],t.prototype,"refreshInterval",void 0),(0,s._)([(0,n.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),t=(0,s._)([(0,o.j)("esri.layers.mixins.RefreshableLayerView")],t),t};function c(e){return"refresh"in e}},37034:function(e,t,i){var s,n=i(36663),r=(i(39994),i(67134)),o=(i(13802),i(7283),i(81977)),a=i(25709),l=i(66645),c=i(39835),h=(i(3466),i(12173),i(51876),i(49004)),d=i(53736),u=i(91957),p=i(37956),m=i(27746);const f=new a.Xn({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),g=new a.Xn({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let y=s=class extends h.wq{constructor(e){super(e),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.hiddenIds=new Set,this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null,this.enabled=!1}writeWhere(e,t){t.where=e||"1=1"}enable(){this._set("enabled",!0)}createQuery(e={}){const{where:t,geometry:i,spatialRelationship:s,timeExtent:n,objectIds:o,units:a,distance:l}=this;return new m.Z({geometry:(0,r.d9)(i),objectIds:(0,r.d9)(o),spatialRelationship:s,timeExtent:(0,r.d9)(n),where:t,units:a,distance:l,...e})}clone(){const{where:e,geometry:t,spatialRelationship:i,hiddenIds:n,timeExtent:o,objectIds:a,units:l,distance:c}=this,h=new Set;
1return n.forEach((e=>h.add(e))),new s({geometry:(0,r.d9)(t),hiddenIds:h,objectIds:(0,r.d9)(a),spatialRelationship:i,timeExtent:(0,r.d9)(o),where:e,units:l,distance:c})}};(0,n._)([(0,o.Cb)({type:String})],y.prototype,"where",void 0),(0,n._)([(0,c.c)("where")],y.prototype,"writeWhere",null),(0,n._)([(0,o.Cb)({types:u.qM,json:{read:d.im,write:!0}})],y.prototype,"geometry",void 0),(0,n._)([(0,o.Cb)({type:String,json:{read:{source:"spatialRel",reader:f.read},write:{target:"spatialRel",writer:f.write}}})],y.prototype,"spatialRelationship",void 0),(0,n._)([(0,o.Cb)({json:{write:(e,t,i)=>t[i]=Array.from(e),read:e=>new Set(e)}})],y.prototype,"hiddenIds",void 0),(0,n._)([(0,o.Cb)({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],y.prototype,"distance",void 0),(0,n._)([(0,o.Cb)({type:[Number],json:{write:!0}})],y.prototype,"objectIds",void 0),(0,n._)([(0,o.Cb)({type:String,json:{read:g.read,write:{writer:g.write,overridePolicy(e){return{enabled:e&&this.distance>0}}}}})],y.prototype,"units",void 0),(0,n._)([(0,o.Cb)({type:p.Z,json:{write:!0}})],y.prototype,"timeExtent",void 0),(0,n._)([(0,o.Cb)({readOnly:!0})],y.prototype,"enabled",void 0),y=s=(0,n._)([(0,l.j)("esri.views.layers.support.FeatureFilter")],y);var v=y;t.Z=v},99542:function(e,t,i){i.d(t,{e:function(){return l}});var s=i(61681),n=i(78668),r=i(17262),o=i(58713);class a{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class l{constructor(e){this._deferreds=new Map,this._controllers=new Map,this._processingItems=new Map,this._isPaused=!1,this._schedule=null,this._task=null,this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new o.Z(e.peeker),this.process=e.process;const t=e.scheduler;e.task&&(0,s.pC)(t)&&(this._task=t.registerTask(e.task,(e=>this.update(e)),(()=>this.needsUpdate())))}destroy(){this.clear(),this._schedule&&(this._schedule.remove(),this._schedule=null),this._task&&(this._task.remove(),this._task=null)}get length(){return this._processingItems.size+this._queue.length}abort(e){const t=this._controllers.get(e);t&&t.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach((t=>e.push(t))),this._controllers.clear(),e.forEach((e=>e.abort())),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach(((t,i)=>e(i)))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._isPaused||(this._isPaused=!0,this._cancelNext())}push(e,t){const i=this.get(e);if(i)return i;const r=(0,n.yi)();let o=null;t&&(o=(0,n.fu)(t,(()=>r.abort())));const a=()=>{l.remove(),(0,s.pC)(o)&&o.remove(),this._deferreds.delete(e),this._controllers.delete(e),this._queue.remove(e),this._processingItems.delete(e),this._scheduleNext()},l=(0,n.$F)(r.signal,(()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),a(),c.reject((0,n.zE)())})),c=(0,n.dD)();return this._deferreds.set(e,c),this._controllers.set(e,r),c.promise.then(a,a),this._queue.push(e),this._scheduleNext(),c.promise}reset(){const e=[];this._processingItems.forEach((t=>e.push(t))),this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._isPaused&&(this._isPaused=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}needsUpdate(){return!this._isPaused&&this._queue.length>0&&this._processingItems.size<this.concurrency}update(e){for(;!e.done&&this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop()),e.madeProgress()}_scheduleNext(){this._task||this._isPaused||this._schedule||(this._schedule=(0,r.Os)((()=>{this._schedule=null,this._next()})))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if((0,s.Wi)(e))return;let t;const i=(0,n.yi)(),r=new a(e,i);this._processingItems.set(e,r);try{t=this.process(e,i.signal)}catch(o){this._processError(r,o)}(0,n.y8)(t)?(r.promise=t,t.then((e=>this._processResult(r,e)),(e=>this._processError(r,e)))):this._processResult(r,t)}get test(){return{update:e=>this.update(e)}}}},73216:function(e,t,i){i.d(t,{t:function(){return p}});var s=i(36663),n=i(61681),r=i(51777),o=i(81977),a=i(66645),l=i(17262),c=i(63235),h=i(36900),d=i(44584),u=i(15071);let p=class extends h.Z{constructor(){super(...arguments),this.updating=!1,this.handleId=0,this.handles=new d.Z,this.scheduleHandleId=0,this.pendingPromises=new Set}destroy(){this.removeAll(),this.handles.destroy()}
1add(e,t,i,s=0){const n=0!=(1&s),r=++this.handleId;n||this.installSyncUpdatingWatch(e,t,r);const o=0!=(2&s)?(0,u.S1)(e,t,i,n):e.watch(t,i,n);return this.handles.add(o,r),{remove:()=>{this.handles.remove(r)}}}addOnCollectionPropertyChange(e,t,i,s=0){const n=0!=(2&s),r=++this.handleId;return this.handles.add([(0,u.on)(e,t,"after-changes",this.createSyncUpdatingCallback()),(0,u.on)(e,t,"change",i,n?e=>{i({added:e.items,removed:[],moved:[],target:e})}:void 0)],r),{remove:()=>{this.handles.remove(r)}}}addOnCollectionChange(e,t,i=0){const s=0!=(2&i),n=++this.handleId;return this.handles.add([e.on("after-changes",this.createSyncUpdatingCallback()),e.on("change",t)],n),s&&t({added:e.items,removed:[],moved:[],target:e}),{remove:()=>{this.handles.remove(n)}}}addPromise(e){if((0,n.Wi)(e))return e;const t=++this.handleId;this.handles.add({remove:()=>{this.pendingPromises.delete(e)&&(0!==this.pendingPromises.size||this.handles.has(m)||this._set("updating",!1))}},t),this.pendingPromises.add(e),this._set("updating",!0);const i=()=>this.handles.remove(t);return e.then(i,i),e}removeAll(){this.pendingPromises.clear(),this.handles.removeAll(),this._set("updating",!1)}installSyncUpdatingWatch(e,t,i){const s=this.createSyncUpdatingCallback(),n=(0,c.U5)((()=>(0,r.$z)(e,t)),s);return this.handles.add(n,i),n}createSyncUpdatingCallback(){return()=>{this.handles.remove(m),++this.scheduleHandleId;const e=this.scheduleHandleId;this._get("updating")||this._set("updating",!0),this.handles.add((0,l.Os)((()=>{e===this.scheduleHandleId&&(this._set("updating",this.pendingPromises.size>0),this.handles.remove(m))})),m)}}};(0,s._)([(0,o.Cb)({readOnly:!0})],p.prototype,"updating",void 0),p=(0,s._)([(0,a.j)("esri.views.support.WatchUpdatingTracking")],p);const m=-42},994:function(e,t,i){i.d(t,{r7:function(){return a},gH:function(){return o},TT:function(){return l},$3:function(){return c},uz:function(){return r}});i(39994);var s=i(19431);function n(e,t){const{format:i,quality:n,rotation:r,disableDecorations:o}=e||{},a=p(e,t.padding),l=function(e,t){const i={x:0,y:0,width:t.width,height:t.height};if(e&&e.area){null!=e.area.x&&(i.x=Math.floor(e.area.x)),null!=e.area.y&&(i.y=Math.floor(e.area.y));const s=null!=e.area.width?Math.floor(e.area.width):null,n=null!=e.area.height?Math.floor(e.area.height):null;if(i.width=t.width-i.x,i.height=t.height-i.y,null!=s&&null!=n)i.width=Math.min(i.width,s),i.height=Math.min(i.height,n);else if(null==s&&null!=n){const e=Math.min(i.width,s);i.height=e/i.width*i.height,i.width=e}else if(null!=s&&null==n){const e=Math.min(i.height,n);i.width=e/i.height*i.width,i.height=e}}return function(e,t){const i=Math.floor(Math.max(e.x,0)),s=Math.floor(Math.max(e.y,0)),n={x:i,y:s,width:Math.floor(Math.min(e.width,t.width-i)),height:Math.floor(Math.min(e.height,t.height-s))},r=n.width/n.height,o=e.width/e.height;if(o===r)return n;if(o>r){const e=Math.floor(n.width/o),t=n.height-e;return{x:n.x,y:Math.floor(n.y+t/2),width:n.width,height:e}}const a=Math.floor(n.height*o),l=n.width-a;return{x:Math.floor(n.x+l/2),y:n.y,width:a,height:n.height}}(function(e,t){if(!t||null==t.width||null==t.height)return e;const i=t.width/t.height,s=e.width/e.height;if(s===i)return e;if(s<i){const t=Math.floor(e.height*i);return e.x-=(t-e.width)/2,e.width=t,e}const n=Math.floor(e.width/i);return e.y-=(n-e.height)/2,e.height=n,e}(i,e),t)}(e,{width:t.width-a.left-a.right,height:t.height-a.top-a.bottom}),{width:c,height:h}=function(e,t){if(!e)return t;const i=e.width,s=e.height;if(null!=i&&null!=s)return{width:Math.floor(i),height:Math.floor(s)};if(null==i&&null==s)return t;const n=t.width/t.height;return null==s?{width:Math.floor(i),height:Math.floor(i/n)}:{width:Math.floor(s*n),height:Math.floor(s)}}(e,l),d=function(e){switch(e){case"png":case"jpg":case"jpeg":return e;default:return f}}(i),u=g[d];return{format:d,quality:(0,s.uZ)(null!=n?n:u,0,100),area:l,width:c,height:h,rotation:r,disableDecorations:!!o,ignoreBackground:!(!e||!e.ignoreBackground),ignorePadding:!(!e||!e.ignorePadding)}}function r(e,t){const i=n(e,t),s=i.area,r=i.width/s.width,o=p(i,t.padding),a=o.left+o.right,l=o.top+o.bottom,c=t.width-a,h=t.height-l,d=Math.floor(c*r+a),u=Math.floor(h*r+l),m=e&&e.layers?e.layers:[],f=i.ignoreBackgroun
1d,g=i.ignorePadding;return{framebufferWidth:d,framebufferHeight:u,region:{x:Math.floor(s.x*r)+o.left,y:Math.floor(s.y*r)+o.top,width:i.width,height:i.height},format:i.format,quality:i.quality,rotation:i.rotation,pixelRatio:r,layers:m,disableDecorations:i.disableDecorations,ignoreBackground:f,ignorePadding:g}}function o(e,t,i,s){s.premultipliedAlpha&&function(e){const t=e.data,i=t.length;for(let s=0;s<i;s+=4){const e=t[s+3];if(e>0){const i=e/255;t[s+0]=t[s+0]/i,t[s+1]=t[s+1]/i,t[s+2]=t[s+2]/i}}}(e),i.width=e.width,i.height=e.height;const n=i.getContext("2d");n.putImageData(e,0,0),s.flipY&&function(e){e.save(),e.globalCompositeOperation="copy",e.scale(1,-1),e.translate(0,-e.canvas.height),e.drawImage(e.canvas,0,0),e.restore()}(n);const r=n.getImageData(0,0,e.width,e.height),o=function(e,t){const i=m[t.format],s=t.quality/100;return e.toDataURL(i,s)}(i,t);return i.width=0,i.height=0,{dataUrl:o,data:r}}function a(e,t,i){if(!e||!t)throw new Error("Cannot construct image data without dimensions");if(u)try{return new ImageData(e,t)}catch(s){u=!1}return h(e,t,i)}function l(e,t,i,s=0,n=0,r=e.width-s,o=e.height-n,a=!1){const{data:l}=e,{width:c,height:h,data:d}=t,u=r/c,p=o/h,m=Math.ceil(u/2),f=Math.ceil(p/2),g=e.width;for(let y=0;y<h;y++)for(let e=0;e<c;e++){const t=4*(e+(a?h-y-1:y)*c);let r=0,o=0,v=0,_=0,b=0,w=0;const C=(y+.5)*p;for(let a=Math.floor(y*p);a<(y+1)*p;a++){const t=Math.abs(C-(a+.5))/f,c=(e+.5)*u,h=t*t;for(let d=Math.floor(e*u);d<(e+1)*u;d++){const e=Math.abs(c-(d+.5))/m,t=Math.sqrt(h+e*e);if(t>=1)continue;let u=2*t*t*t-3*t*t+1;const p=4*(s+d+(n+a)*g);w+=u*l[p+3],o+=u,!i&&l[p+3]<255&&(u=u*l[p+3]/255),v+=u*l[p],_+=u*l[p+1],b+=u*l[p+2],r+=u}}d[t]=v/r,d[t+1]=_/r,d[t+2]=b/r,d[t+3]=w/o}return t}function c(e,t,i){if(!t)return e;const{framebufferWidth:s,framebufferHeight:n,pixelRatio:r,region:o}=e,a=p(e,i),l=a.left+a.right,c=a.top+a.bottom,h=s-l,d=n-c,u=Math.min(8,Math.min((2048-l)/h,(2048-c)/d));return u<1.5?e:{...e,framebufferWidth:Math.round(h*u)+l,framebufferHeight:Math.round(d*u)+c,pixelRatio:r*u,resample:{region:{x:Math.round((o.x-a.left)*u)+a.left,y:Math.round((o.y-a.top)*u)+a.top,width:Math.round(o.width*u),height:Math.round(o.height*u)},width:s,height:n}}}function h(e,t,i){return i||(d||(d=document.createElement("canvas"),d.width=1,d.height=1),i=d),i.getContext("2d").createImageData(e,t)}let d=null,u=!0;function p(e,t){return!t||e&&e.ignorePadding?y:t}const m={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},f="png",g={png:100,jpg:98,jpeg:98},y={top:0,right:0,bottom:0,left:0}},35119:function(e,t,i){var s=i(36172);let n;t.Z=function(){return n||(n=function(){const e={available:!1,version:0,majorPerformanceCaveat:!1,maxTextureSize:0,supportsHighPrecisionFragment:!1,supportsVertexShaderSamplers:!1,supportsElementIndexUint:!1,supportsStandardDerivatives:!1,supportsInstancedArrays:!1,supportsTextureFloat:!1,supportsColorBufferFloat:!1};if(void 0===typeof WebGLRenderingContext)return e;const t=document.createElement("canvas");if(!t)return e;let i=(0,s.k)(t,{failIfMajorPerformanceCaveat:!0},"webgl");if(i||(i=(0,s.k)(t,{},"webgl"),i&&(e.majorPerformanceCaveat=!0)),!i)return e;const n=i.getParameter(i.VERSION);if(!n)return e;const r=n.match(/^WebGL\s+([\d.]*)/);if(r){const t=parseFloat(r[1]);e.available=t>=.94;const s=i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT);s&&(e.supportsHighPrecisionFragment=s.precision>0),e.supportsVertexShaderSamplers=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,e.supportsElementIndexUint=null!==i.getExtension("OES_element_index_uint"),e.supportsStandardDerivatives=null!==i.getExtension("OES_standard_derivatives"),e.supportsInstancedArrays=null!==i.getExtension("ANGLE_instanced_arrays"),e.supportsTextureFloat=null!==i.getExtension("OES_texture_float"),e.supportsColorBufferFloat=null!==i.getExtension("WEBGL_color_buffer_float")&&null!==i.getExtension("EXT_float_blend")}return e.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),e.ver
1sion=function(){if(void 0===typeof WebGL2RenderingContext)return!1;const e=document.createElement("canvas");return!!e&&!!(0,s.k)(e,{},"webgl2")}()?2:1,e}()),n}},36172:function(e,t,i){function s(e,t={},i){if(!window.WebGLRenderingContext)return r(e,o),null;return n(e,t,i)||(r(e,a),null)}function n(e,t={},i){let s;switch(i){case"webgl":default:s=["webgl","experimental-webgl","webkit-3d","moz-webgl"];break;case"webgl2":s=["webgl2"]}let n=null;for(const o of s){try{n=e.getContext(o,t)}catch(r){}if(n)break}return n}function r(e,t){const i=e.parentNode;i&&(i.innerHTML='<table style="background-color: #8CE; width: 100%; height: 100%;"><tr><td align="center"><div style="display: table-cell; vertical-align: middle;"><div style="">'+t+"</div></div></td></tr></table>")}i.d(t,{k:function(){return n},s:function(){return s}});const o='This page requires a browser that supports WebGL.<br/><a href="http://get.webgl.org">Click here to upgrade your browser.</a>',a='It doesn\'t appear your computer can support WebGL.<br/><a href="http://get.webgl.org/troubleshooting/">Click here for more information.</a>'},4e4:function(e,t,i){i.d(t,{Nw:function(){return m}});var s=i(67134),n=i(86745),r=i(61681),o=i(64626),a=i(70375);const l=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile"]),c=new Set(["csv","feature","geo-rss","group","imagery","imagery-tile","kml","map-image","map-notes","tile","unknown","unsupported","vector-tile","web-tile"]);function h(e){return!("feature"!==e.type||e.url||!e.source||"memory"!==e.source.type)}function d(e,t){if(t.restrictedWebMapWriting){const i=function(e){return"basemap"===e.layerContainerType?l:"operational-layers"===e.layerContainerType?c:null}(t);return!(0,r.pC)(i)||i.has(e.type)&&!h(e)}return!0}function u(e,t){"maxScale"in e&&(t.maxScale=(0,o.k)(e.maxScale)),"minScale"in e&&(t.minScale=(0,o.k)(e.minScale))}function p(e,t){if(function(e,t){if(h(e)){const i=(0,n.hS)("featureCollection.layers",t),s=i&&i[0]&&i[0].layerDefinition;s&&u(e,s)}else"stream"===e.type?u(e,t.layerDefinition=t.layerDefinition||{}):"group"!==e.type&&u(e,t)}(e,t),"blendMode"in e&&(t.blendMode=e.blendMode,"normal"===t.blendMode&&delete t.blendMode),t.opacity=(0,o.k)(e.opacity),t.title=e.title||"Layer",t.visibility=e.visible,"legendEnabled"in e&&"wmts"!==e.type)if(h(e)){const i=t.featureCollection;i&&(i.showLegend=e.legendEnabled)}else t.showLegend=e.legendEnabled}function m(e,t,i){if(!("write"in e)||!e.write)return i&&i.messages&&i.messages.push(new a.Z("layer:unsupported",`Layers (${e.title}, ${e.id}) of type '${e.declaredClass}' cannot be persisted`,{layer:e})),null;if(d(e,i)){const t={};return e.write(t,i)?t:null}return(0,r.pC)(t)&&p(e,t=(0,s.d9)(t)),t}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.