@arcgis/core 4.27.0-next.20230331 → 4.27.0-next.20230401

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/arcade/featureset/actions/GroupBy.js +1 -1
  2. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  3. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  4. package/arcade/functions/featuresetbase.js +1 -1
  5. package/arcade/functions/featuresetstring.js +1 -1
  6. package/arcade/functions/string.js +1 -1
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/{c90fff7e28ba5b443b11.js → 1cdc14124617923b5c61.js} +1 -1
  9. package/assets/esri/core/workers/chunks/2dc876bf9edccddbb835.js +1 -0
  10. package/assets/esri/core/workers/chunks/44ee28b5488d0d62055a.js +1 -0
  11. package/assets/esri/core/workers/chunks/4c175664eb97689d66b0.js +1 -0
  12. package/assets/esri/core/workers/chunks/5a25079cd79e90757cb1.js +1 -0
  13. package/assets/esri/core/workers/chunks/619c65dd6416bad5e290.js +1 -0
  14. package/assets/esri/core/workers/chunks/61a843d4b8382d763d23.js +1 -0
  15. package/assets/esri/core/workers/chunks/{6b63deb4dd0c49cac65f.js → 67a147feb12c01885f3f.js} +1 -1
  16. package/assets/esri/core/workers/chunks/7cfb6223fb4ca9f30623.js +1 -0
  17. package/assets/esri/core/workers/chunks/{a0ad8b7ae269757626d7.js → 8d0c3b36971b6b3bde00.js} +1 -1
  18. package/assets/esri/core/workers/chunks/bbde77128b7f175a3b88.js +1 -0
  19. package/assets/esri/core/workers/chunks/d72c0c97cc4e30f1e4f2.js +1 -0
  20. package/assets/esri/core/workers/chunks/f5b6d2b8c8a333bbebdc.js +1 -0
  21. package/assets/esri/core/workers/chunks/{8980c5dc389c27368b73.js → f9f1bbd7930100e84e50.js} +1 -1
  22. package/chunks/languageUtils.js +1 -1
  23. package/interfaces.d.ts +8 -2
  24. package/layers/BaseTileLayer.js +1 -1
  25. package/layers/MapImageLayer.js +1 -1
  26. package/layers/TileLayer.js +1 -1
  27. package/layers/WMSLayer.js +1 -1
  28. package/layers/WMTSLayer.js +1 -1
  29. package/layers/WebTileLayer.js +1 -1
  30. package/layers/mixins/ArcGISImageService.js +1 -1
  31. package/layers/support/imageBitmapUtils.js +1 -1
  32. package/package.json +1 -1
  33. package/renderers/support/DictionaryLoader.js +1 -1
  34. package/support/revision.js +1 -1
  35. package/widgets/Expand.js +1 -1
  36. package/widgets/Popup/PopupViewModel.js +1 -1
  37. package/widgets/Popup/actionUtils.js +1 -1
  38. package/widgets/Popup.js +1 -1
  39. package/assets/esri/core/workers/chunks/096b05de593228ccca97.js +0 -1
  40. package/assets/esri/core/workers/chunks/2b2fd6e77c57a91f467e.js +0 -1
  41. package/assets/esri/core/workers/chunks/3f488f7a54f1713acd1d.js +0 -1
  42. package/assets/esri/core/workers/chunks/43df675c76723427f1bd.js +0 -1
  43. package/assets/esri/core/workers/chunks/4e08816d1614a14cd38a.js +0 -1
  44. package/assets/esri/core/workers/chunks/83c43913b440617dd06f.js +0 -1
  45. package/assets/esri/core/workers/chunks/91f939a322dafc0f9f77.js +0 -1
  46. package/assets/esri/core/workers/chunks/969bb94d5bdc9da114e2.js +0 -1
  47. package/assets/esri/core/workers/chunks/d0481c858627c7e79308.js +0 -1
  48. package/assets/esri/core/workers/chunks/f2b393c9490e48b9f1d6.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Color.js";import t from"../../request.js";import s from"../../core/Error.js";import o from"../../core/Logger.js";import i from"../../core/LRUCache.js";import{isAbortError as r}from"../../core/promiseUtils.js";import{numericHash as n}from"../../core/string.js";import{loadArcade as l,createDictionaryExpression as a}from"../../support/arcadeOnDemand.js";import c from"../../symbols/CIMSymbol.js";const m="esri.renderers.support.DictionaryLoader",f={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};class u{constructor(e,t,s){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new i(100),this._dictionaryPromise=null,this.url=e,this.config=t,this.fieldMap=s}getSymbolFields(){return this._symbolFields}async getSymbolAsync(t,s){let o;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(s));try{o=await this._dictionaryPromise}catch(p){if(r(p))return this._dictionaryPromise=null,null}const i={};if(this.fieldMap)for(const e of this._symbolFields){const s=this.fieldMap[e];if(s&&null!=t.attributes[s]){const o=""+t.attributes[s];i[e]=o}else i[e]=""}const l=o?.(i,s);if(!l||"string"!=typeof l)return null;const a=n(l).toString(),c=this._symbolCache.get(a);if(c)return c.catch((()=>{this._symbolCache.pop(a)})),c;const m=l.split(";"),f=[],u=[];for(const r of m)if(r)if(r.includes("po:")){const t=r.substr(3).split("|");if(3===t.length){const s=t[0],o=t[1];let i=t[2];if("DashTemplate"===o)i=i.split(" ").map((e=>Number(e)));else if("Color"===o){const t=new e(i).toRgba();i=[t[0],t[1],t[2],255*t[3]]}else i=Number(i);u.push({primitiveName:s,propertyName:o,value:i})}}else if(r.includes("|")){for(const e of r.split("|"))if(this._itemNames.has(e)){f.push(e);break}}else this._itemNames.has(r)&&f.push(r);const h=null==t.geometry||!t.geometry.hasZ&&"point"===t.geometry.type,y=this._cimPartsToCIMSymbol(f,u,h,s);return this._symbolCache.put(a,y,1),y}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void o.getLogger(m).error("no valid URL!");const i=t(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:null!=e?e.signal:null}),[{data:r}]=await Promise.all([i,l()]);if(!r)throw this._dictionaryPromise=null,new s("esri.renderers.DictionaryRenderer","Bad dictionary data!");const n=r.expression,c=r.authoringInfo;this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(r.itemsNames),this._symbolFields=c.symbol;const f={};if(this.config){const e=this.config;for(const t in e)f[t]=e[t]}if(c.configuration)for(const t of c.configuration)f.hasOwnProperty(t.name)||(f[t.name]=t.value);const u=[];if(null!=e&&e.fields&&this.fieldMap)for(const t of this._symbolFields){const s=this.fieldMap[t],o=e.fields.filter((e=>e.name===s));o.length>0&&u.push({...o[0],name:t})}const h=a(n,null!=e?e.spatialReference:null,u,f).then((e=>{const t={scale:0};return(s,o)=>{if(null==e)return null;const i=e.repurposeFeature({geometry:null,attributes:s});return t.scale=null!=o?o.scale??void 0:void 0,e.evaluate({$feature:i,$view:t})}})).catch((e=>(o.getLogger(m).error("Creating dictinoary expression failed:",e),null)));return this._dictionaryPromise=h,h}async _cimPartsToCIMSymbol(e,t,s,o){const i=new Array(e.length);for(let l=0;l<e.length;l++)i[l]=this._getSymbolPart(e[l],o);const r=await Promise.all(i),n=this.fieldMap;if(n)for(const l of r)h(l,n);return new c({data:this._combineSymbolParts(r,t,s)})}async _getSymbolPart(e,s){if(this._ongoingRequests.has(e))return this._ongoingRequests.get(e).then((e=>e.data));const o=this._refSymbolUrlTemplate.replace(/\{itemName\}/gi,e),i=t(o,{responseType:"json",query:{f:"json"},...s});this._ongoingRequests.set(e,i);try{return(await i).data}catch(r){throw this._ongoingRequests.delete(e),r}}_combineSymbolParts(e,t,s){if(!e||0===e.length)return null;const o={...e[0]};if(e.length>1){o.symbolLayers=[];for(const t of e){const e=t;o.symbolLayers.unshift(...e.symbolLayers)}}return s&&(o.callout=f),{type:"CIMSymbolReference",symbol:o,primitiveOverrides:t}}}function h(e,t){if(!e)return;const s=e.symbolLayers;if(!s)return;let o=s.length;for(;o--;){const e=s[o];if(e&&!1!==e.enable&&"CIMVectorMarker"===e.type)y(e,t)}}function y(e,t){const s=e.markerGraphics;if(s)for(const o of s){if(!o)continue;const e=o.symbol;if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":h(e,t);break;case"CIMTextSymbol":e.fieldMap=t}}}export{u as DictionaryLoader};
5
+ import e from"../../Color.js";import t from"../../request.js";import s from"../../core/Error.js";import"../../core/has.js";import o from"../../core/Logger.js";import i from"../../core/LRUCache.js";import{isAbortError as r}from"../../core/promiseUtils.js";import{numericHash as n}from"../../core/string.js";import{loadArcade as l,createDictionaryExpression as a}from"../../support/arcadeOnDemand.js";import c from"../../symbols/CIMSymbol.js";const m="esri.renderers.support.DictionaryLoader",f={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};class u{constructor(e,t,s){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new i(100),this._dictionaryPromise=null,this.url=e,this.config=t,this.fieldMap=s}getSymbolFields(){return this._symbolFields}async getSymbolAsync(t,s){let o;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(s));try{o=await this._dictionaryPromise}catch(p){if(r(p))return this._dictionaryPromise=null,null}const i={};if(this.fieldMap)for(const e of this._symbolFields){const s=this.fieldMap[e];i[e]=s?""+t.attributes[s]:""}let l=null;try{l=o?.(i,s)}catch(g){return null}if(!l||"string"!=typeof l)return null;const a=n(l).toString(),c=this._symbolCache.get(a);if(c)return c.catch((()=>{this._symbolCache.pop(a)})),c;const m=l.split(";"),f=[],u=[];for(const r of m)if(r)if(r.includes("po:")){const t=r.substr(3).split("|");if(3===t.length){const s=t[0],o=t[1];let i=t[2];if("DashTemplate"===o)i=i.split(" ").map((e=>Number(e)));else if("Color"===o){const t=new e(i).toRgba();i=[t[0],t[1],t[2],255*t[3]]}else i=Number(i);u.push({primitiveName:s,propertyName:o,value:i})}}else if(r.includes("|")){for(const e of r.split("|"))if(this._itemNames.has(e)){f.push(e);break}}else this._itemNames.has(r)&&f.push(r);const h=null==t.geometry||!t.geometry.hasZ&&"point"===t.geometry.type,y=this._cimPartsToCIMSymbol(f,u,h,s);return this._symbolCache.put(a,y,1),y}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void o.getLogger(m).error("no valid URL!");const i=t(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:null!=e?e.signal:null}),[{data:r}]=await Promise.all([i,l()]);if(!r)throw this._dictionaryPromise=null,new s("esri.renderers.DictionaryRenderer","Bad dictionary data!");const n=r.expression,c=r.authoringInfo;this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(r.itemsNames),this._symbolFields=c.symbol;const f={};if(this.config){const e=this.config;for(const t in e)f[t]=e[t]}if(c.configuration)for(const t of c.configuration)f.hasOwnProperty(t.name)||(f[t.name]=t.value);const u=[];if(null!=e&&e.fields&&this.fieldMap)for(const t of this._symbolFields){const s=this.fieldMap[t],o=e.fields.filter((e=>e.name===s));o.length>0&&u.push({...o[0],name:t,type:"esriFieldTypeString"})}const h=a(n,null!=e?e.spatialReference:null,u,f).then((e=>{const t={scale:0};return(s,o)=>{if(null==e)return null;const i=e.repurposeFeature({geometry:null,attributes:s});return t.scale=null!=o?o.scale??void 0:void 0,e.evaluate({$feature:i,$view:t})}})).catch((e=>(o.getLogger(m).error("Creating dictinoary expression failed:",e),null)));return this._dictionaryPromise=h,h}async _cimPartsToCIMSymbol(e,t,s,o){const i=new Array(e.length);for(let l=0;l<e.length;l++)i[l]=this._getSymbolPart(e[l],o);const r=await Promise.all(i),n=this.fieldMap;if(n)for(const l of r)h(l,n);return new c({data:this._combineSymbolParts(r,t,s)})}async _getSymbolPart(e,s){if(this._ongoingRequests.has(e))return this._ongoingRequests.get(e).then((e=>e.data));const o=this._refSymbolUrlTemplate.replace(/\{itemName\}/gi,e),i=t(o,{responseType:"json",query:{f:"json"},...s});this._ongoingRequests.set(e,i);try{return(await i).data}catch(r){throw this._ongoingRequests.delete(e),r}}_combineSymbolParts(e,t,s){if(!e||0===e.length)return null;const o={...e[0]};if(e.length>1){o.symbolLayers=[];for(const t of e){const e=t;o.symbolLayers.unshift(...e.symbolLayers)}}return s&&(o.callout=f),{type:"CIMSymbolReference",symbol:o,primitiveOverrides:t}}}function h(e,t){if(!e)return;const s=e.symbolLayers;if(!s)return;let o=s.length;for(;o--;){const e=s[o];if(e&&!1!==e.enable&&"CIMVectorMarker"===e.type)y(e,t)}}function y(e,t){const s=e.markerGraphics;if(s)for(const o of s){if(!o)continue;const e=o.symbol;if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":h(e,t);break;case"CIMTextSymbol":e.fieldMap=t}}}export{u as DictionaryLoader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- const c="20230331",d="95d98ca95ca93087cf520dd5bcc23f00329d8520";export{c as buildDate,d as commitHash};
5
+ const e="20230401",f="2b01f4621408e625fbe8d2a085509b5cf3f07e19";export{e as buildDate,f as commitHash};
package/widgets/Expand.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import n from"./Widget.js";import s from"./Expand/ExpandViewModel.js";import{loadCalciteComponents as r}from"./support/componentsUtils.js";import{isWidget as i,hasDomNode as a}from"./support/widget.js";import{tsx as d}from"./support/jsxFactory.js";import{messageBundle as l}from"./support/decorators/messageBundle.js";import{accessibleHandler as p}from"./support/decorators/accessibleHandler.js";const c="esri-expand",u={base:`${c} esri-widget`,modeAuto:`${c}--auto`,modeDrawer:`${c}--drawer`,modeFloating:`${c}--floating`,container:`${c}__container`,containerExpanded:`${c}__container--expanded`,panel:`${c}__panel`,button:"esri-widget--button",text:"esri-icon-font-fallback-text",icon:"esri-collapse__icon",iconExpanded:`${c}__icon--expanded`,iconNumber:`${c}__icon-number`,iconNumberExpanded:`${c}__icon-number--expanded`,expandIcon:"esri-icon-expand",collapseIcon:"esri-icon-collapse",content:`${c}__content`,contentExpanded:`${c}__content--expanded`,expandMask:`${c}__mask`,expandMaskExpanded:`${c}__mask--expanded`};let h=class extends n{constructor(e,t){super(e,t),this.closeOnEsc=!0,this.collapseIcon=null,this.collapseTooltip="",this.content="",this.expandIcon=null,this.expandTooltip="",this.iconClass=null,this.icon=null,this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode="auto",this.viewModel=new s,this._handleKeyDown=e=>{const{closeOnEsc:t,_toggleButtonEl:o,expanded:n}=this;if(!n||!t||e.target===o||"Escape"!==e.key)return;("function"==typeof t?t(e):t)&&(this.expanded=!1,o?.focus())}}loadDependencies(){return r({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js")})}get contentId(){return`${this.id}_controls_content`}get expandTitle(){const{expanded:e,messagesCommon:t,collapseTooltip:o,expandTooltip:n}=this;return(e?o||t?.collapse:n||t?.expand)??""}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIconClass(){return u.collapseIcon}set collapseIconClass(e){this._overrideIfSome("collapseIconClass",e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIconClass(){return i(this.content)?this.content.iconClass:u.expandIcon}set expandIconClass(e){this._overrideIfSome("expandIconClass",e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}toggle(){this.viewModel.expanded=!this.viewModel.expanded}render(){const{mode:e}=this,t={[u.modeAuto]:"auto"===e,[u.modeDrawer]:"drawer"===e,[u.modeFloating]:"floating"===e};return d("div",{class:this.classes(u.base,t),onkeydown:this._handleKeyDown},this._renderMask(),this._renderContainer())}_renderContainer(){const{expanded:e}=this,t={[u.containerExpanded]:e};return d("div",{class:this.classes(u.container,t)},this._renderPanel(),this._renderContent())}_renderMask(){const{expanded:e}=this,t={[u.expandMaskExpanded]:e};return d("div",{bind:this,onclick:this._toggle,class:this.classes(u.expandMask,t)})}_renderBadgeNumber(){const{expanded:e,iconNumber:t}=this;return t&&!e?d("span",{key:"expand__icon-number",class:u.iconNumber},t):null}_renderPanelNumber(){const{iconNumber:e,expanded:t}=this;return e&&t?d("span",{key:"expand__expand-icon-number",class:this.classes(u.iconNumber,u.iconNumberExpanded)},e):null}_renderIcon(){const e=(this.expanded?this.collapseIcon:this.expandIcon)??"";return d("calcite-icon",{key:"icon",icon:e,scale:"s"})}_renderLegacyIcon(){const{collapseIconClass:e,expandIconClass:t,expanded:o}=this,n={[u.iconExpanded]:o};return null!=t&&(n[t]=!o),null!=e&&(n[e]=e===t||o),d("span",{key:"legacy-icon","aria-hidden":"true",class:this.classes(u.icon,n)})}_renderTitle(){return d("span",{class:u.text},this.expandTitle)}_renderExpandButton(){const{expanded:e,expandTitle:t,expandIcon:o,collapseIcon:n,contentId:s}=this;return d("div",{afterCreate:this._storeToggleButtonEl,"aria-controls":s,"aria-expanded":e?"true":"false",bind:this,class:u.button,onclick:this._toggle,onkeydown:this._toggle,role:"button",tabindex:"0",title:t},this._renderBadgeNumber(),!e&&null!=o||e&&null!=n?this._renderIcon():this._renderLegacyIcon(),this._renderTitle())}_renderPanel(){return d("div",{class:u.panel},this._renderExpandButton(),this._renderPanelNumber())}_renderContent(){const{expanded:e,contentId:t,content:o}=this,n={[u.contentExpanded]:e},s={id:t,role:"region",class:this.classes(u.content,n)};return"string"==typeof o?d("div",{key:"content__string",innerHTML:o,...s}):i(o)?d("div",{key:"content__widget",...s},o.render()):o instanceof HTMLElement?d("div",{key:"content__html-element",bind:o,afterCreate:this._attachToNode,...s}):a(o)?d("div",{key:"content__node",bind:o.domNode,afterCreate:this._attachToNode,...s}):null}_toggle(){this.toggle()}_attachToNode(e){const t=this;e.appendChild(t)}_storeToggleButtonEl(e){this._toggleButtonEl=e}};e([t({readOnly:!0})],h.prototype,"contentId",null),e([t({readOnly:!0})],h.prototype,"expandTitle",null),e([t()],h.prototype,"autoCollapse",null),e([t()],h.prototype,"closeOnEsc",void 0),e([t()],h.prototype,"collapseIconClass",null),e([t()],h.prototype,"collapseIcon",void 0),e([t()],h.prototype,"collapseTooltip",void 0),e([t()],h.prototype,"content",void 0),e([t()],h.prototype,"expanded",null),e([t()],h.prototype,"expandIconClass",null),e([t()],h.prototype,"expandIcon",void 0),e([t()],h.prototype,"expandTooltip",void 0),e([t()],h.prototype,"group",null),e([t()],h.prototype,"iconClass",void 0),e([t()],h.prototype,"icon",void 0),e([t()],h.prototype,"iconNumber",void 0),e([t()],h.prototype,"label",null),e([t(),l("esri/widgets/Expand/t9n/Expand")],h.prototype,"messages",void 0),e([t(),l("esri/t9n/common")],h.prototype,"messagesCommon",void 0),e([t()],h.prototype,"mode",void 0),e([t()],h.prototype,"view",null),e([t({type:s})],h.prototype,"viewModel",void 0),e([p()],h.prototype,"_toggle",null),h=e([o("esri.widgets.Expand")],h);const x=h;export{x as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import n from"./Widget.js";import s from"./Expand/ExpandViewModel.js";import{loadCalciteComponents as r}from"./support/componentsUtils.js";import{isWidget as i,hasDomNode as a}from"./support/widget.js";import{tsx as d}from"./support/jsxFactory.js";import{messageBundle as l}from"./support/decorators/messageBundle.js";import{accessibleHandler as p}from"./support/decorators/accessibleHandler.js";const c="esri-expand",u={base:`${c} esri-widget`,modeAuto:`${c}--auto`,modeDrawer:`${c}--drawer`,modeFloating:`${c}--floating`,container:`${c}__container`,containerExpanded:`${c}__container--expanded`,panel:`${c}__panel`,button:"esri-widget--button",text:"esri-icon-font-fallback-text",icon:"esri-collapse__icon",iconExpanded:`${c}__icon--expanded`,iconNumber:`${c}__icon-number`,iconNumberExpanded:`${c}__icon-number--expanded`,expandIcon:"esri-icon-expand",collapseIcon:"esri-icon-collapse",content:`${c}__content`,contentExpanded:`${c}__content--expanded`,expandMask:`${c}__mask`,expandMaskExpanded:`${c}__mask--expanded`};let h=class extends n{constructor(e,t){super(e,t),this.closeOnEsc=!0,this.collapseIcon=null,this.collapseTooltip="",this.content="",this.expandTooltip="",this.iconClass=null,this.icon=null,this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode="auto",this.viewModel=new s,this._handleKeyDown=e=>{const{closeOnEsc:t,_toggleButtonEl:o,expanded:n}=this;if(!n||!t||e.target===o||"Escape"!==e.key)return;("function"==typeof t?t(e):t)&&(this.expanded=!1,o?.focus())}}loadDependencies(){return r({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js")})}get contentId(){return`${this.id}_controls_content`}get expandTitle(){const{expanded:e,messagesCommon:t,collapseTooltip:o,expandTooltip:n}=this;return(e?o||t?.collapse:n||t?.expand)??""}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIconClass(){return u.collapseIcon}set collapseIconClass(e){this._overrideIfSome("collapseIconClass",e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIconClass(){return i(this.content)?this.content.iconClass:u.expandIcon}set expandIconClass(e){this._overrideIfSome("expandIconClass",e)}get expandIcon(){return i(this.content)?this.content.icon:void 0}set expandIcon(e){this._overrideIfSome("expandIcon",e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}toggle(){this.viewModel.expanded=!this.viewModel.expanded}render(){const{mode:e}=this,t={[u.modeAuto]:"auto"===e,[u.modeDrawer]:"drawer"===e,[u.modeFloating]:"floating"===e};return d("div",{class:this.classes(u.base,t),onkeydown:this._handleKeyDown},this._renderMask(),this._renderContainer())}_renderContainer(){const{expanded:e}=this,t={[u.containerExpanded]:e};return d("div",{class:this.classes(u.container,t)},this._renderPanel(),this._renderContent())}_renderMask(){const{expanded:e}=this,t={[u.expandMaskExpanded]:e};return d("div",{bind:this,onclick:this._toggle,class:this.classes(u.expandMask,t)})}_renderBadgeNumber(){const{expanded:e,iconNumber:t}=this;return t&&!e?d("span",{key:"expand__icon-number",class:u.iconNumber},t):null}_renderPanelNumber(){const{iconNumber:e,expanded:t}=this;return e&&t?d("span",{key:"expand__expand-icon-number",class:this.classes(u.iconNumber,u.iconNumberExpanded)},e):null}_renderIcon(){const e=(this.expanded?this.collapseIcon:this.expandIcon)??"";return d("calcite-icon",{key:"icon",icon:e,scale:"s"})}_renderLegacyIcon(){const{collapseIconClass:e,expandIconClass:t,expanded:o}=this,n={[u.iconExpanded]:o};return null!=t&&(n[t]=!o),null!=e&&(n[e]=e===t||o),d("span",{key:"legacy-icon","aria-hidden":"true",class:this.classes(u.icon,n)})}_renderTitle(){return d("span",{class:u.text},this.expandTitle)}_renderExpandButton(){const{expanded:e,expandTitle:t,expandIcon:o,collapseIcon:n,contentId:s}=this;return d("div",{afterCreate:this._storeToggleButtonEl,"aria-controls":s,"aria-expanded":e?"true":"false",bind:this,class:u.button,onclick:this._toggle,onkeydown:this._toggle,role:"button",tabindex:"0",title:t},this._renderBadgeNumber(),!e&&null!=o||e&&null!=n?this._renderIcon():this._renderLegacyIcon(),this._renderTitle())}_renderPanel(){return d("div",{class:u.panel},this._renderExpandButton(),this._renderPanelNumber())}_renderContent(){const{expanded:e,contentId:t,content:o}=this,n={[u.contentExpanded]:e},s={id:t,role:"region",class:this.classes(u.content,n)};return"string"==typeof o?d("div",{key:"content__string",innerHTML:o,...s}):i(o)?d("div",{key:"content__widget",...s},o.render()):o instanceof HTMLElement?d("div",{key:"content__html-element",bind:o,afterCreate:this._attachToNode,...s}):a(o)?d("div",{key:"content__node",bind:o.domNode,afterCreate:this._attachToNode,...s}):null}_toggle(){this.toggle()}_attachToNode(e){const t=this;e.appendChild(t)}_storeToggleButtonEl(e){this._toggleButtonEl=e}};e([t({readOnly:!0})],h.prototype,"contentId",null),e([t({readOnly:!0})],h.prototype,"expandTitle",null),e([t()],h.prototype,"autoCollapse",null),e([t()],h.prototype,"closeOnEsc",void 0),e([t()],h.prototype,"collapseIconClass",null),e([t()],h.prototype,"collapseIcon",void 0),e([t()],h.prototype,"collapseTooltip",void 0),e([t()],h.prototype,"content",void 0),e([t()],h.prototype,"expanded",null),e([t()],h.prototype,"expandIconClass",null),e([t()],h.prototype,"expandIcon",null),e([t()],h.prototype,"expandTooltip",void 0),e([t()],h.prototype,"group",null),e([t()],h.prototype,"iconClass",void 0),e([t()],h.prototype,"icon",void 0),e([t()],h.prototype,"iconNumber",void 0),e([t()],h.prototype,"label",null),e([t(),l("esri/widgets/Expand/t9n/Expand")],h.prototype,"messages",void 0),e([t(),l("esri/t9n/common")],h.prototype,"messagesCommon",void 0),e([t()],h.prototype,"mode",void 0),e([t()],h.prototype,"view",null),e([t({type:s})],h.prototype,"viewModel",void 0),e([p()],h.prototype,"_toggle",null),h=e([o("esri.widgets.Expand")],h);const x=h;export{x as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../Graphic.js";import"../../symbols.js";import s from"../../core/Collection.js";import i from"../../core/Error.js";import r from"../../core/Handles.js";import o from"../../core/Logger.js";import{watch as a,when as n,sync as l}from"../../core/reactiveUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{geographicToWebMercator as c}from"../../geometry/support/webMercatorUtils.js";import d from"../../layers/Layer.js";import{fallbackObjectIDAttribute as p}from"../../layers/LayerConstants.js";import g from"../../support/actions/ActionBase.js";import f from"../../support/actions/ActionButton.js";import m from"../../support/actions/ActionToggle.js";import{getDisplayedSymbol as y}from"../../symbols/support/symbolUtils.js";import{ViewEventPriorities as w}from"../../views/input/InputManager.js";import{highlightsSupported as F}from"../../views/support/layerViewUtils.js";import v from"../Feature/FeatureViewModel.js";import{zoomToFeature as _,zoomToClusteredFeatures as b,browseClusteredFeatures as C}from"./actions.js";import{triggerAction as P,isClusterFeature as E,getSelectedTarget as A,removeClusteredFeaturesForBrowsing as V,displayClusterExtent as M,browseAggregateFeatures as j,getPointFromGeometry as L}from"./actionUtils.js";import O from"../support/AnchorElementViewModel.js";import{GoToMixin as T}from"../support/GoTo.js";import I from"../../symbols/SimpleFillSymbol.js";import x from"../../geometry/Point.js";const S=s.ofType({key:"type",defaultKeyValue:"button",base:g,typeMap:{button:f,toggle:m}}),B=()=>[_.clone()],R=()=>[b.clone(),C.clone()];let G=class extends(T(O)){get isLoadingFeature(){return this.featureViewModels.some((e=>e.waitingForContent))}constructor(e){super(e),this._handles=new r,this._pendingPromises=new Set,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this.featurePage=null,this.actions=new S,this.activeFeature=null,this.defaultPopupTemplateEnabled=!1,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.featuresPerPage=20,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new t({symbol:new I({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}initialize(){this._handles.add([a((()=>[this.autoOpenEnabled,this.view]),(()=>this._autoOpenEnabledChange())),this.on("view-change",(()=>this._autoClose())),a((()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view]),(()=>this._highlightSelectedFeature())),a((()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view]),(()=>this._highlightActiveFeature())),a((()=>this.view?.animation?.state),(e=>this._animationStateChange(e))),a((()=>this.location),(e=>this._locationChange(e))),a((()=>this.selectedFeature),(e=>this._selectedFeatureChange(e))),a((()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage]),(()=>this._selectedFeatureIndexChange())),a((()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels]),(()=>this._setGraphicOnFeatureViewModels())),a((()=>this.featureViewModels),(()=>this._featureViewModelsChange())),this.on("trigger-action",(e=>P({event:e,view:this.view}))),n((()=>!this.waitingForResult),(()=>this._waitingForResultChange()),l),a((()=>[this.features,this.view?.map,this.view?.spatialReference]),(()=>this._updateFeatureVMs())),a((()=>this.view?.scale),(()=>this._viewScaleChange())),n((()=>!this.visible),(()=>this.browseClusterEnabled=!1)),a((()=>this.browseClusterEnabled),(e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing()))])}destroy(){this._cancelFetchingFeatures(),this._handles.destroy(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new S;e.removeAll();const{actions:t,defaultActions:s,defaultPopupTemplateEnabled:i,includeDefaultActions:r,selectedFeature:o}=this,a=r?s.concat(t):t,n=o&&("function"==typeof o.getEffectivePopupTemplate&&o.getEffectivePopupTemplate(i)||o.popupTemplate),l=n&&n.actions,h=n&&n.overwriteActions?l:l?l.concat(a):a;return h&&h.filter(Boolean).forEach((t=>e.add(t))),e}get defaultActions(){const e=this._get("defaultActions")||new S;return e.removeAll(),e.addMany(E(this.selectedFeature)?R():B()),e}get featureCount(){return this.features.length}get features(){return this._get("features")||[]}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:s,promiseCount:i,selectedFeatureIndex:r}=this,o=i&&t.length;o&&s&&-1===r?this.selectedFeatureIndex=0:o&&-1!==r||(this.selectedFeatureIndex=t.length?0:-1)}get location(){return this._get("location")||null}set location(e){let t=e;const s=this.view?.spatialReference?.isWebMercator;e&&e?.spatialReference?.isWGS84&&s&&(t=c(e)),this._set("location",t)}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);const t=t=>{this._pendingPromises.has(e)&&this._updateFeatures(t),this._updatePendingPromises(e)},s=()=>this._updatePendingPromises(e);e.then(t,s)})),this.notifyChange("pendingPromisesCount")}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return 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.activeFeature=null,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=A(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new i("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:s}=this;if(!s||!e)throw new i("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:s});return s.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:s}=t;delete t.fetchFeatures,s&&this._setFetchFeaturesPromises(t.location);const i=["actionsMenuOpen","collapsed","featureMenuOpen"];for(const r of i)delete t[r];this.set(t)}triggerAction(e){const t=this.allActions.getItemAt(e);t&&!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(){V(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;"2d"===e?.type?E(t)?(await M(this),await j(this)):o.getLogger(this.declaredClass).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):o.getLogger(this.declaredClass).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}_animationStateChange(e){this.zoomToLocation||(_.disabled="waiting-for-target"===e)}_clearBrowsedClusterGraphics(){const e=this.view?.graphics;e&&(e.remove(this.selectedClusterBoundaryFeature),this._selectedClusterFeature&&e.remove(this._selectedClusterFeature)),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(E(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:s}=this;s&&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:s,featuresPerPage:i,featureViewModels:r}=this;if(null===s)return;const o=((s-1)*i+t)%t,a=o+i;r.slice(o,a).forEach(((t,s)=>{t&&!t.graphic&&(t.graphic=e[o+s])}))}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:s,view:i}=this;if(e&&i){if(this.browseClusterEnabled){if(this._selectedClusterFeature&&(i.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),E(e))return;return e.symbol=await y(e),this._selectedClusterFeature=e,void i.graphics.add(this._selectedClusterFeature)}!s&&t||!e.geometry?s&&!e.geometry&&this.centerAtLocation().then((()=>{const e=i.center?.clone();e&&(this.location=e)})):this.location=L(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:s}=e,i=Promise.resolve(t),r=s.map((e=>e.promise));this.promises=[i,...r]}))}_destroyFeatureVMs(){this.featureViewModels.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:s}=this;if(E(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t||!t.length)return;const i=s.slice(0),r=[];t.forEach(((t,s)=>{if(!t)return;let o=null;if(i.some(((e,s)=>(e&&e.graphic===t&&(o=e,i.splice(s,1)),!!o))),o)r[s]=o;else{const i=new v({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:this.view?.spatialReference,graphic:t===e?t:null,map:this.view?.map,view:this.view});r[s]=i}})),i.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",r)}_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:s}=this;if(t.remove(e),s&&this.view){const s=this.view.on("click",(e=>{"mouse"===e.pointerType&&0!==e.button||this._fetchFeaturesAndOpen(e)}),w.WIDGET);t.add(s,e)}}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null,this.notifyChange("waitingForResult")}_fetchFeaturesWithController(e,t){this._cancelFetchingFeatures();const s=new AbortController,{signal:i}=s;this._fetchFeaturesController=s,this.notifyChange("waitingForResult");const r=this.fetchFeatures(e,{signal:i,event:t});return r.catch((()=>{})).then((()=>{this._fetchFeaturesController=null,this.notifyChange("waitingForResult")})),r}_fetchFeaturesAndOpen(e){const{screenPoint:t,mapPoint:s}=e,{view:i}=this;this._fetchFeaturesWithController(t,e).then((e=>{const{clientOnlyGraphics:t,promisesPerLayerView:r,location:o}=e,a=[Promise.resolve(t),...r.map((e=>e.promise))];return i?.popup?.open({location:o||s,promises:a}),e}))}_updatePendingPromises(e){e&&this._pendingPromises.has(e)&&(this._pendingPromises.delete(e),this.notifyChange("pendingPromisesCount"))}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:s}=e;return s&&"layer"in s&&s.layer?s.layer:"map-notes"===s?.type||"subtype-group"===s?.type?s:t}_getHighlightTarget(e,t){const s="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||p:null,i=e.attributes;return i&&s&&i[s]||e}async _highlightActiveFeature(){const e="highlight-active-feature";this._handles.remove(e);const{highlightEnabled:t,view:s,activeFeature:i,visible:r}=this;if(!(i&&s&&t&&r))return;const o=this._getHighlightLayer(i);if(!(o&&o instanceof d))return;const a=this._getLayerView(s,o);this._highlightActiveFeaturePromise=a;const n=await a;if(!(n&&F(n)&&this._highlightActiveFeaturePromise===a&&this.activeFeature&&this.highlightEnabled))return;const l=n.highlight(this._getHighlightTarget(i,o));this._handles.add(l,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this._handles.remove(e);const{selectedFeature:t,highlightEnabled:s,view:i,visible:r}=this;if(!(t&&i&&s&&r))return;const o=this._getHighlightLayer(t);if(!(o&&o instanceof d))return;const a=this._getLayerView(i,o);this._highlightSelectedFeaturePromise=a;const n=await a;if(!(n&&F(n)&&this._highlightSelectedFeaturePromise===a&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const l=n.highlight(this._getHighlightTarget(t,o));this._handles.add(l,e)}_updateFeatures(e){const{features:t}=this;if(!e||!e.length)return;if(!t.length)return void(this.features=e);const s=e.filter((e=>!t.includes(e)));this.features=t.concat(s)}};e([h()],G.prototype,"featurePage",void 0),e([h()],G.prototype,"isLoadingFeature",null),e([h({type:S})],G.prototype,"actions",void 0),e([h({readOnly:!0})],G.prototype,"active",null),e([h()],G.prototype,"activeFeature",void 0),e([h({readOnly:!0})],G.prototype,"allActions",null),e([h({type:Boolean})],G.prototype,"defaultPopupTemplateEnabled",void 0),e([h()],G.prototype,"autoCloseEnabled",void 0),e([h()],G.prototype,"autoOpenEnabled",void 0),e([h()],G.prototype,"browseClusterEnabled",void 0),e([h()],G.prototype,"content",void 0),e([h({type:S,readOnly:!0})],G.prototype,"defaultActions",null),e([h({readOnly:!0})],G.prototype,"featureCount",null),e([h()],G.prototype,"features",null),e([h()],G.prototype,"featuresPerPage",void 0),e([h()],G.prototype,"featureViewModelAbilities",void 0),e([h({readOnly:!0})],G.prototype,"featureViewModels",void 0),e([h()],G.prototype,"highlightEnabled",void 0),e([h()],G.prototype,"includeDefaultActions",void 0),e([h({type:x})],G.prototype,"location",null),e([h({readOnly:!0})],G.prototype,"pendingPromisesCount",null),e([h({readOnly:!0})],G.prototype,"selectedClusterBoundaryFeature",void 0),e([h({readOnly:!0})],G.prototype,"waitingForResult",null),e([h({readOnly:!0})],G.prototype,"promiseCount",null),e([h()],G.prototype,"promises",null),e([h({value:null,readOnly:!0})],G.prototype,"selectedFeature",null),e([h({value:-1})],G.prototype,"selectedFeatureIndex",null),e([h({readOnly:!0})],G.prototype,"selectedFeatureViewModel",null),e([h({readOnly:!0})],G.prototype,"state",null),e([h()],G.prototype,"title",void 0),e([h()],G.prototype,"updateLocationEnabled",void 0),e([h()],G.prototype,"view",void 0),e([h()],G.prototype,"visible",void 0),e([h()],G.prototype,"zoomFactor",void 0),e([h()],G.prototype,"zoomToLocation",void 0),e([h()],G.prototype,"centerAtLocation",null),G=e([u("esri.widgets.Popup.PopupViewModel")],G);const z=G;export{z as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../Graphic.js";import"../../symbols.js";import i from"../../core/Collection.js";import s from"../../core/Error.js";import r from"../../core/Handles.js";import o from"../../core/Logger.js";import{watch as a,when as n,sync as l}from"../../core/reactiveUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{geographicToWebMercator as c}from"../../geometry/support/webMercatorUtils.js";import d from"../../layers/Layer.js";import{fallbackObjectIDAttribute as p}from"../../layers/LayerConstants.js";import g from"../../support/actions/ActionBase.js";import f from"../../support/actions/ActionButton.js";import m from"../../support/actions/ActionToggle.js";import{getDisplayedSymbol as y}from"../../symbols/support/symbolUtils.js";import{ViewEventPriorities as w}from"../../views/input/InputManager.js";import{highlightsSupported as F}from"../../views/support/layerViewUtils.js";import v from"../Feature/FeatureViewModel.js";import{zoomToFeature as _,zoomToClusteredFeatures as b,browseClusteredFeatures as C}from"./actions.js";import{triggerAction as P,isClusterFeature as E,getSelectedTarget as M,removeClusteredFeaturesForBrowsing as A,displayClusterExtent as V,browseAggregateFeatures as j,getPointFromGeometry as L}from"./actionUtils.js";import O from"../support/AnchorElementViewModel.js";import{GoToMixin as T}from"../support/GoTo.js";import I from"../../symbols/SimpleFillSymbol.js";import x from"../../geometry/Point.js";const S=i.ofType({key:"type",defaultKeyValue:"button",base:g,typeMap:{button:f,toggle:m}}),B=()=>[_.clone()],R=()=>[b.clone(),C.clone()];let G=class extends(T(O)){get isLoadingFeature(){return this.featureViewModels.some((e=>e.waitingForContent))}constructor(e){super(e),this._handles=new r,this._pendingPromises=new Set,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this.featurePage=null,this.actions=new S,this.activeFeature=null,this.defaultPopupTemplateEnabled=!1,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new t({symbol:new I({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}initialize(){this._handles.add([a((()=>[this.autoOpenEnabled,this.view]),(()=>this._autoOpenEnabledChange())),this.on("view-change",(()=>this._autoClose())),a((()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view]),(()=>this._highlightSelectedFeature())),a((()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view]),(()=>this._highlightActiveFeature())),a((()=>this.view?.animation?.state),(e=>this._animationStateChange(e))),a((()=>this.location),(e=>this._locationChange(e))),a((()=>this.selectedFeature),(e=>this._selectedFeatureChange(e))),a((()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage]),(()=>this._selectedFeatureIndexChange())),a((()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels]),(()=>this._setGraphicOnFeatureViewModels())),a((()=>this.featureViewModels),(()=>this._featureViewModelsChange())),this.on("trigger-action",(e=>P({event:e,viewModel:this,view:this.view}))),n((()=>!this.waitingForResult),(()=>this._waitingForResultChange()),l),a((()=>[this.features,this.view?.map,this.view?.spatialReference]),(()=>this._updateFeatureVMs())),a((()=>this.view?.scale),(()=>this._viewScaleChange())),n((()=>!this.visible),(()=>this.browseClusterEnabled=!1)),a((()=>this.browseClusterEnabled),(e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing()))])}destroy(){this._cancelFetchingFeatures(),this._handles.destroy(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new S;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:s,includeDefaultActions:r,selectedFeature:o}=this,a=r?i.concat(t):t,n=o&&("function"==typeof o.getEffectivePopupTemplate&&o.getEffectivePopupTemplate(s)||o.popupTemplate),l=n&&n.actions,h=n&&n.overwriteActions?l:l?l.concat(a):a;return h&&h.filter(Boolean).forEach((t=>e.add(t))),e}get defaultActions(){const e=this._get("defaultActions")||new S;return e.removeAll(),e.addMany(E(this.selectedFeature)?R():B()),e}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:r}=this,o=s&&t.length;o&&i&&-1===r?this.selectedFeatureIndex=0:o&&-1!==r||(this.selectedFeatureIndex=t.length?0:-1)}get location(){return this._get("location")||null}set location(e){let t=e;const i=this.view?.spatialReference?.isWebMercator;e&&e?.spatialReference?.isWGS84&&i&&(t=c(e)),this._set("location",t)}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);const t=t=>{this._pendingPromises.has(e)&&this._updateFeatures(t),this._updatePendingPromises(e)},i=()=>this._updatePendingPromises(e);e.then(t,i)})),this.notifyChange("pendingPromisesCount")}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return 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.activeFeature=null,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=M(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new s("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new s("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});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);const s=["actionsMenuOpen","collapsed"];for(const r of s)delete t[r];this.set(t)}triggerAction(e){const t=this.allActions.getItemAt(e);t&&!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(){A(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;"2d"===e?.type?E(t)?(await V(this),await j(this)):o.getLogger(this.declaredClass).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):o.getLogger(this.declaredClass).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}_animationStateChange(e){this.zoomToLocation||(_.disabled="waiting-for-target"===e)}_clearBrowsedClusterGraphics(){const e=this.view?.graphics;e&&(e.remove(this.selectedClusterBoundaryFeature),this._selectedClusterFeature&&e.remove(this._selectedClusterFeature)),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(E(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_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:r}=this;if(null===i)return;const o=((i-1)*s+t)%t,a=o+s;r.slice(o,a).forEach(((t,i)=>{t&&!t.graphic&&(t.graphic=e[o+i])}))}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:s}=this;if(e&&s){if(this.browseClusterEnabled){if(this._selectedClusterFeature&&(s.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),E(e))return;return e.symbol=await y(e),this._selectedClusterFeature=e,void s.graphics.add(this._selectedClusterFeature)}!i&&t||!e.geometry?i&&!e.geometry&&this.centerAtLocation().then((()=>{const e=s.center?.clone();e&&(this.location=e)})):this.location=L(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),r=i.map((e=>e.promise));this.promises=[s,...r]}))}_destroyFeatureVMs(){this.featureViewModels.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i}=this;if(E(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t||!t.length)return;const s=i.slice(0),r=[];t.forEach(((t,i)=>{if(!t)return;let o=null;if(s.some(((e,i)=>(e&&e.graphic===t&&(o=e,s.splice(i,1)),!!o))),o)r[i]=o;else{const s=new v({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:this.view?.spatialReference,graphic:t===e?t:null,map:this.view?.map,view:this.view});r[i]=s}})),s.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",r)}_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)}),w.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=new AbortController,{signal:s}=i;this._fetchFeaturesController=i,this.notifyChange("waitingForResult");const r=this.fetchFeatures(e,{signal:s,event:t});return r.catch((()=>{})).then((()=>{this._fetchFeaturesController=null,this.notifyChange("waitingForResult")})),r}_fetchFeaturesAndOpen(e){const{screenPoint:t,mapPoint:i}=e,{view:s}=this;this._fetchFeaturesWithController(t,e).then((e=>{const{clientOnlyGraphics:t,promisesPerLayerView:r,location:o}=e,a=[Promise.resolve(t),...r.map((e=>e.promise))];return s?.popup?.open({location:o||i,promises:a}),e}))}_updatePendingPromises(e){e&&this._pendingPromises.has(e)&&(this._pendingPromises.delete(e),this.notifyChange("pendingPromisesCount"))}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:i}=e;return i&&"layer"in i&&i.layer?i.layer:"map-notes"===i?.type||"subtype-group"===i?.type?i:t}_getHighlightTarget(e,t){const i="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||p:null,s=e.attributes;return s&&i&&s[i]||e}async _highlightActiveFeature(){const e="highlight-active-feature";this._handles.remove(e);const{highlightEnabled:t,view:i,activeFeature:s,visible:r}=this;if(!(s&&i&&t&&r))return;const o=this._getHighlightLayer(s);if(!(o&&o instanceof d))return;const a=this._getLayerView(i,o);this._highlightActiveFeaturePromise=a;const n=await a;if(!(n&&F(n)&&this._highlightActiveFeaturePromise===a&&this.activeFeature&&this.highlightEnabled))return;const l=n.highlight(this._getHighlightTarget(s,o));this._handles.add(l,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this._handles.remove(e);const{selectedFeature:t,highlightEnabled:i,view:s,visible:r}=this;if(!(t&&s&&i&&r))return;const o=this._getHighlightLayer(t);if(!(o&&o instanceof d))return;const a=this._getLayerView(s,o);this._highlightSelectedFeaturePromise=a;const n=await a;if(!(n&&F(n)&&this._highlightSelectedFeaturePromise===a&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const l=n.highlight(this._getHighlightTarget(t,o));this._handles.add(l,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=>!t.includes(e)));this.features=t.concat(i)}};e([h()],G.prototype,"featurePage",void 0),e([h()],G.prototype,"isLoadingFeature",null),e([h({type:S})],G.prototype,"actions",void 0),e([h({readOnly:!0})],G.prototype,"active",null),e([h()],G.prototype,"activeFeature",void 0),e([h({readOnly:!0})],G.prototype,"allActions",null),e([h({type:Boolean})],G.prototype,"defaultPopupTemplateEnabled",void 0),e([h()],G.prototype,"autoCloseEnabled",void 0),e([h()],G.prototype,"autoOpenEnabled",void 0),e([h()],G.prototype,"browseClusterEnabled",void 0),e([h()],G.prototype,"content",void 0),e([h({type:S,readOnly:!0})],G.prototype,"defaultActions",null),e([h({readOnly:!0})],G.prototype,"featureCount",null),e([h()],G.prototype,"features",null),e([h()],G.prototype,"featuresPerPage",void 0),e([h()],G.prototype,"featureMenuOpen",void 0),e([h()],G.prototype,"featureViewModelAbilities",void 0),e([h({readOnly:!0})],G.prototype,"featureViewModels",void 0),e([h()],G.prototype,"highlightEnabled",void 0),e([h()],G.prototype,"includeDefaultActions",void 0),e([h({type:x})],G.prototype,"location",null),e([h({readOnly:!0})],G.prototype,"pendingPromisesCount",null),e([h({readOnly:!0})],G.prototype,"selectedClusterBoundaryFeature",void 0),e([h({readOnly:!0})],G.prototype,"waitingForResult",null),e([h({readOnly:!0})],G.prototype,"promiseCount",null),e([h()],G.prototype,"promises",null),e([h({value:null,readOnly:!0})],G.prototype,"selectedFeature",null),e([h({value:-1})],G.prototype,"selectedFeatureIndex",null),e([h({readOnly:!0})],G.prototype,"selectedFeatureViewModel",null),e([h({readOnly:!0})],G.prototype,"state",null),e([h()],G.prototype,"title",void 0),e([h()],G.prototype,"updateLocationEnabled",void 0),e([h()],G.prototype,"view",void 0),e([h()],G.prototype,"visible",void 0),e([h()],G.prototype,"zoomFactor",void 0),e([h()],G.prototype,"zoomToLocation",void 0),e([h()],G.prototype,"centerAtLocation",null),G=e([u("esri.widgets.Popup.PopupViewModel")],G);const z=G;export{z as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import t from"../../core/Logger.js";import{throwIfNotAbortError as r}from"../../core/promiseUtils.js";import{zoomToFeature as n,zoomToClusteredFeatures as o,browseClusteredFeatures as i,removeSelectedFeature as a}from"./actions.js";const s="esri.widgets.Popup.PopupViewModel",c=t.getLogger(s),u=t=>{const{event:s,view:c}=t,{action:u}=s,l=c&&c.popup;if(!u)return Promise.reject(new e("trigger-action:missing-arguments","Event has no action"));if(!l)return Promise.reject(new e("trigger-action:missing-arguments","view.popup is missing"));const{disabled:d,id:g}=u;if(!g)return Promise.reject(new e("trigger-action:invalid-action","action.id is missing"));if(d)return Promise.reject(new e("trigger-action:invalid-action","Action is disabled"));if(g===n.id)return w(l.viewModel).catch(r);if(g===o.id)return f(l.viewModel);if(g===i.id)return l.featureMenuOpen=!l.featureMenuOpen,l.viewModel.browseClusterEnabled=!l.viewModel.browseClusterEnabled,Promise.resolve();if(l.viewModel.browseClusterEnabled=!1,g===a.id){l.close();const{selectedFeature:t}=l;if(!t)return Promise.reject(new e(`trigger-action:${a.id}`,"selectedFeature is required",{selectedFeature:t}));const{sourceLayer:r}=t;return r?r.remove(t):c.graphics.remove(t),Promise.resolve()}return Promise.resolve()};function l(e){const{selectedFeature:t,location:r,view:n}=e;if(!n)return null;if("3d"===n.type)return t??r??null;return e.get("selectedFeature.geometry")||r}function d(e){return!!e&&e.isAggregate&&"cluster"===e.sourceLayer?.featureReduction?.type}async function g(e,t){if("3d"!==t?.type||!e||"esri.Graphic"!==e.declaredClass)return!0;const r=t.getViewForGraphic(e);if(r&&"whenGraphicBounds"in r){let t;try{t=await r.whenGraphicBounds(e,{useViewElevation:!0})}catch(n){}return!t||!t.boundingBox||t.boundingBox[0]===t.boundingBox[3]&&t.boundingBox[1]===t.boundingBox[4]&&t.boundingBox[2]===t.boundingBox[5]}return!0}async function w(t){const{location:r,selectedFeature:o,view:i,zoomFactor:a}=t,s=l(t);if(!i||!s){const t=new e("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:s,view:i});throw c.error(t),t}const u=i.scale/a,d=t.selectedFeature?.geometry,w=d??r,f=null!=w&&"point"===w.type&&await g(o,i);n.active=!0,n.disabled=!0;try{await t.zoomTo({target:{target:s,scale:f?u:void 0}})}catch(p){const t=new e("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:o});c.error(t)}finally{n.active=!1,n.disabled=!1,t.zoomToLocation=null,f&&(t.location=w)}}async function f(t){const{selectedFeature:r,view:n}=t;if("2d"!==n?.type){const t=new e("zoomToCluster:invalid-view","View must be 2d MapView.",{view:n});throw c.error(t),t}if(!r||!d(r)){const t=new e("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:r});throw c.error(t),t}const[i,a]=await v(n,r);o.active=!0,o.disabled=!0;const{extent:s}=await i.queryExtent(a);await t.zoomTo({target:s}),o.active=!1,o.disabled=!1}async function p(e){const{view:t,selectedFeature:r}=e;if(!t||!r)return;const[n,o]=await v(t,r),{extent:i}=await n.queryExtent(o);e.selectedClusterBoundaryFeature.geometry=i,t.graphics.add(e.selectedClusterBoundaryFeature)}async function m(e){const{selectedFeature:t,view:r}=e;if(!r||!t)return;const[n,o]=await v(r,t);i.active=!0,i.disabled=!0;const{features:a}=await n.queryFeatures(o);i.active=!1,i.disabled=!1,r.popup?.open({features:[t].concat(a),featureMenuOpen:!0})}async function v(e,t){const r=await e.whenLayerView(t.sourceLayer),n=r.createQuery(),o=t.getObjectId();return n.aggregateIds=null!=o?[o]:[],[r,n]}function y(e){const t=e.features.filter((e=>d(e)));t.length&&(e.features=t)}function h(e){if(null==e)return null;switch(e.type){case"point":return e;case"extent":return e.center;case"polygon":return e.centroid;case"multipoint":case"polyline":return e.extent?.center;default:return null}}export{m as browseAggregateFeatures,p as displayClusterExtent,h as getPointFromGeometry,l as getSelectedTarget,d as isClusterFeature,y as removeClusteredFeaturesForBrowsing,u as triggerAction,f as zoomToClusterExtent,w as zoomToLocation};
5
+ import e from"../../core/Error.js";import t from"../../core/Logger.js";import{throwIfNotAbortError as r}from"../../core/promiseUtils.js";import{zoomToFeature as n,zoomToClusteredFeatures as o,browseClusteredFeatures as i,removeSelectedFeature as a}from"./actions.js";const c="esri.widgets.Popup.PopupViewModel",s=t.getLogger(c),u=t=>{const{event:c,view:s,viewModel:u}=t,{action:l}=c;if(!l)return Promise.reject(new e("trigger-action:missing-arguments","Event has no action"));const{disabled:d,id:g}=l;if(!g)return Promise.reject(new e("trigger-action:invalid-action","action.id is missing"));if(d)return Promise.reject(new e("trigger-action:invalid-action","Action is disabled"));if(g===n.id)return w(u).catch(r);if(g===o.id)return f(u);if(g===i.id)return u.featureMenuOpen=!u.featureMenuOpen,u.browseClusterEnabled=!u.browseClusterEnabled,Promise.resolve();if(u.browseClusterEnabled=!1,g===a.id){u.visible=!1;const{selectedFeature:t}=u;if(!t)return Promise.reject(new e(`trigger-action:${a.id}`,"selectedFeature is required",{selectedFeature:t}));const{sourceLayer:r}=t;return r?r.remove(t):s?.graphics.remove(t),Promise.resolve()}return Promise.resolve()};function l(e){const{selectedFeature:t,location:r,view:n}=e;if(!n)return null;if("3d"===n.type)return t??r??null;return e.get("selectedFeature.geometry")||r}function d(e){return!!e&&e.isAggregate&&"cluster"===e.sourceLayer?.featureReduction?.type}async function g(e,t){if("3d"!==t?.type||!e||"esri.Graphic"!==e.declaredClass)return!0;const r=t.getViewForGraphic(e);if(r&&"whenGraphicBounds"in r){let t;try{t=await r.whenGraphicBounds(e,{useViewElevation:!0})}catch(n){}return!t||!t.boundingBox||t.boundingBox[0]===t.boundingBox[3]&&t.boundingBox[1]===t.boundingBox[4]&&t.boundingBox[2]===t.boundingBox[5]}return!0}async function w(t){const{location:r,selectedFeature:o,view:i,zoomFactor:a}=t,c=l(t);if(!i||!c){const t=new e("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:c,view:i});throw s.error(t),t}const u=i.scale/a,d=t.selectedFeature?.geometry,w=d??r,f=null!=w&&"point"===w.type&&await g(o,i);n.active=!0,n.disabled=!0;try{await t.zoomTo({target:{target:c,scale:f?u:void 0}})}catch(m){const t=new e("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:o});s.error(t)}finally{n.active=!1,n.disabled=!1,t.zoomToLocation=null,f&&(t.location=w)}}async function f(t){const{selectedFeature:r,view:n}=t;if("2d"!==n?.type){const t=new e("zoomToCluster:invalid-view","View must be 2d MapView.",{view:n});throw s.error(t),t}if(!r||!d(r)){const t=new e("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:r});throw s.error(t),t}const[i,a]=await v(n,r);o.active=!0,o.disabled=!0;const{extent:c}=await i.queryExtent(a);await t.zoomTo({target:c}),o.active=!1,o.disabled=!1}async function m(e){const{view:t,selectedFeature:r}=e;if(!t||!r)return;const[n,o]=await v(t,r),{extent:i}=await n.queryExtent(o);e.selectedClusterBoundaryFeature.geometry=i,t.graphics.add(e.selectedClusterBoundaryFeature)}async function p(e){const{selectedFeature:t,view:r}=e;if(!r||!t)return;const[n,o]=await v(r,t);i.active=!0,i.disabled=!0;const{features:a}=await n.queryFeatures(o);i.active=!1,i.disabled=!1,e?.open({features:[t].concat(a),featureMenuOpen:!0})}async function v(e,t){const r=await e.whenLayerView(t.sourceLayer),n=r.createQuery(),o=t.getObjectId();return n.aggregateIds=null!=o?[o]:[],[r,n]}function y(e){const t=e.features.filter((e=>d(e)));t.length&&(e.features=t)}function h(e){if(null==e)return null;switch(e.type){case"point":return e;case"extent":return e.center;case"polygon":return e.centroid;case"multipoint":case"polyline":return e.extent?.center;default:return null}}export{p as browseAggregateFeatures,m as displayClusterExtent,h as getPointFromGeometry,l as getSelectedTarget,d as isClusterFeature,y as removeClusteredFeaturesForBrowsing,u as triggerAction,f as zoomToClusterExtent,w as zoomToLocation};
package/widgets/Popup.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{eventKey as i}from"../core/events.js";import o from"../core/Handles.js";import n from"../core/Logger.js";import{watch as s,when as r,on as l,whenOnce as a,initial as c}from"../core/reactiveUtils.js";import{throttle as u}from"../core/throttle.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{cast as h}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import g from"./Feature.js";import m from"./Spinner.js";import v from"./Widget.js";import{CSS as f}from"./Feature/resources.js";import{FeatureContentMixin as _}from"./Feature/support/FeatureContentMixin.js";import{getPointFromGeometry as w}from"./Popup/actionUtils.js";import{CSS as b}from"./Popup/css.js";import M from"./Popup/PopupViewModel.js";import{loadCalciteComponents as y}from"./support/componentsUtils.js";import{Heading as A}from"./support/Heading.js";import{accessibleHandler as k}from"./support/decorators/accessibleHandler.js";import{messageBundle as F}from"./support/decorators/messageBundle.js";import{vmEvent as C}from"./support/decorators/vmEvent.js";import{tsx as I}from"./support/jsxFactory.js";import{isRTL as O,storeNode as x,cssTransition as E}from"./support/widgetUtils.js";import{isDarkTheme as N}from"../support/themeUtils.js";import{substitute as P}from"../intl/substitute.js";const T="selected-index",B=0,D="popup-spinner",L={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},S="esri-popup";function R(e,t){return void 0===t?`${S}__${e}`:`${S}__${e}-${t}`}const V={closeButton:!0,featureNavigation:!0};let U=class extends(_(v)){constructor(e,i){super(e,i),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 o,this._pointerOffsetInPx=16,this._spinner=null,this._feature=null,this._featureMenuIntersectionObserverNode=null,this._featureMenuViewportNode=null,this._rootFlowItemNode=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._displaySpinnerThrottled=u((()=>this._displaySpinner()),B),this._exitRelatedRecordsActions=new WeakMap,this._featureSelectionActions=new WeakMap,this._flowItems=new t,this.alignment="auto",this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.featureMenuOpen=!1,this.headingLevel=2,this.maxInlineActions=3,this.messages=null,this.messagesCommon=null,this.spinnerEnabled=!0,this.viewModel=new M,this.visibleElements={...V},this._handleOpenRelatedFeature=e=>{this._openRelatedFeature(e)},this._addSelectedFeatureIndexHandle(),this.addHandles([s((()=>this.viewModel?.screenLocation),(()=>this._positionContainer())),s((()=>[this.viewModel?.active,this.dockEnabled]),(()=>this._toggleScreenLocationEnabled())),s((()=>this.viewModel?.screenLocation),((e,t)=>{!!e!=!!t&&this.reposition()})),s((()=>[this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment]),(()=>this.reposition())),s((()=>this.spinnerEnabled),(e=>this._spinnerEnabledChange(e))),s((()=>this.viewModel?.view?.size),((e,t)=>this._updateDockEnabledForViewSize(e,t))),s((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),s((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),s((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),s((()=>this.selectedFeatureWidget),(()=>this._destroyFlowItemWidgets())),s((()=>[this.selectedFeatureWidget?.viewModel?.title,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setTitleFromFeatureWidget())),s((()=>[this.selectedFeatureWidget?.viewModel?.content,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setContentFromFeatureWidget())),r((()=>!this.collapsed),(()=>{"xsmall"===this.viewModel?.view?.widthBreakpoint&&this.viewModel.active&&this.collapseEnabled&&this.viewModel.centerAtLocation()})),l((()=>this.viewModel?.allActions),"change",(()=>this._watchActions())),s((()=>this.viewModel?.allActions),(()=>this._watchActions()),c),s((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop())),l((()=>this._flowItems),"change",(()=>{this.notifyChange("_activeFlowItemWidget"),this.scheduleRender()})),s((()=>[this._activeFlowItemWidget?.viewModel?.state,this._activeFlowItemWidget?.viewModel?.title]),(()=>this.scheduleRender()))])}loadDependencies(){return y({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}destroy(){this._destroyFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._handles?.destroy(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect()}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(){const{selectedFeatureWidget:e,viewModel:t}=this;if(!e)return!!t?.content;const i=e.viewModel;if(i?.waitingForContent||"error"===i?.state)return!0;const o=i?.content;return Array.isArray(o)?!!o.length:!!o}get featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&null!=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()}get _activeFlowItemWidget(){const{_flowItems:e}=this;return e.getItemAt(e.length-1)||null}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}set actionsMenuOpen(e){this._set("actionsMenuOpen",!!e)}get actionsMenuOpen(){return!!this.viewModel.active&&this._get("actionsMenuOpen")}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get autoOpenEnabled(){return this.viewModel.autoOpenEnabled}set autoOpenEnabled(e){this.viewModel.autoOpenEnabled=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||L}set dockOptions(e){const t={...L},i=this.viewModel?.view?.breakpoints,o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const n={...t,...e},s={...t.breakpoint,...o},{breakpoint:r}=n;"object"==typeof r?n.breakpoint={...s,...r}:r&&(n.breakpoint=s),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,visibleElements:t,headingLevel:i,_flowItems:o}=this,{selectedFeatureViewModel:n}=this.viewModel,s={...t,title:!1};return n?(e?(e.viewModel=n,e.visibleElements=s):this._feature=new g({flowItems:o,headingLevel:i+1,viewModel:n,visibleElements:s}),this._feature):null}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}castVisibleElements(e){return{...V,...e}}blur(){const{active:e}=this.viewModel;e||n.getLogger(this.declaredClass).warn("Popup can only be blurred when currently active."),this.visibleElements.closeButton?this._blurClose=!0:this._blurContainer=!0,this.scheduleRender()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||n.getLogger(this.declaredClass).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){this._handles.remove(T);const t=!!e&&!!e.featureMenuOpen,i=!!e&&!!e.actionsMenuOpen,o={collapsed:!!e&&!!e.collapsed,actionsMenuOpen:i,featureMenuOpen:t};"xsmall"===this.viewModel?.view?.widthBreakpoint&&(o.collapsed=!0),this.set(o),this.viewModel.open(e),this._shouldFocus(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{actionsMenuOpen:e,dockEnabled:t,featureMenuVisible:i,dividedActions:o,currentAlignment:n,currentDockPosition:s}=this,{active:r}=this.viewModel,{menuActions:l}=o,a=r&&l.length>1&&e,c=r&&t,u=r&&!t,d=this.selectedFeature?.layer?.title,h=this.selectedFeature?.layer?.id,p={[b.alignTopCenter]:"top-center"===n,[b.alignBottomCenter]:"bottom-center"===n,[b.alignTopLeft]:"top-left"===n,[b.alignBottomLeft]:"bottom-left"===n,[b.alignTopRight]:"top-right"===n,[b.alignBottomRight]:"bottom-right"===n,[b.isDocked]:c,[b.shadow]:u,[b.isDockedTopLeft]:"top-left"===s,[b.isDockedTopCenter]:"top-center"===s,[b.isDockedTopRight]:"top-right"===s,[b.isDockedBottomLeft]:"bottom-left"===s,[b.isDockedBottomCenter]:"bottom-center"===s,[b.isDockedBottomRight]:"bottom-right"===s,[b.isFeatureMenuOpen]:i,[b.isActionsMenuOpen]:a};return I("div",{class:this.classes(b.base,p),role:"presentation","data-layer-title":d,"data-layer-id":h,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},r?[this.renderMainContainer(),this.renderPointer()]:null)}renderLoadingIcon(){return I("span",{"aria-hidden":"true",class:this.classes(b.icon,b.iconLoading,b.rotating)})}renderNavigationLoading(){const{messagesCommon:e}=this;return this.viewModel.pendingPromisesCount?I("div",{key:R("loading-container"),role:"presentation",class:b.loadingContainer,"aria-label":e.loading,title:e.loading},this.renderLoadingIcon()):null}renderPreviousIcon(){const e=O(this.container),t={[b.iconRightTriangleArrow]:e,[b.paginationPreviousIconRTL]:e,[b.iconLeftTriangleArrow]:!e,[b.paginationPreviousIconLTR]:!e};return I("span",{"aria-hidden":"true",class:this.classes(b.icon,t)})}renderPreviousButton(){const{messages:e}=this;return I("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:this.classes(b.button,b.paginationPrevious),"aria-label":e.previous,title:e.previous},this.renderPreviousIcon())}renderNextIcon(){const e=O(this.container),t={[b.iconLeftTriangleArrow]:e,[b.paginationNextIconRTL]:e,[b.iconRightTriangleArrow]:!e,[b.paginationNextIconLTR]:!e};return I("span",{"aria-hidden":"true",class:this.classes(b.icon,t)})}renderNextButton(){const{messages:e}=this;return I("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:this.classes(b.button,b.paginationNext),"aria-label":e.next,title:e.next},this.renderNextIcon())}renderFeatureMenuButton(){const{featureMenuOpen:e,featureMenuId:t,messagesCommon:i}=this,{featureCount:o,selectedFeatureIndex:n}=this.viewModel;return I("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:this.classes(b.button,b.featureMenuButton),"aria-haspopup":"true","aria-controls":t,"aria-expanded":e.toString(),"aria-label":i.menu,title:i.menu},this._getPageText(o,n))}renderNavigationButtons(){return this.featureNavigationVisible?[this.renderPreviousButton(),this.renderNavigationLoading()||this.renderFeatureMenuButton(),this.renderNextButton()]:[]}renderDockIcon(){const{dockEnabled:e}=this,t=this._wouldDockTo(),i={[b.iconUndock]:e,[b.iconDock]:!e,[b.iconDockToRight]:!e&&("top-right"===t||"bottom-right"===t),[b.iconDockToLeft]:!e&&("top-left"===t||"bottom-left"===t),[b.iconDockToTop]:!e&&"top-center"===t,[b.iconDockToBottom]:!e&&"bottom-center"===t};return I("span",{"aria-hidden":"true",class:this.classes(i,b.icon)})}renderDockButton(){const{dockEnabled:e,messages:t}=this,i=this.viewModel?.view?.widthBreakpoint,o=e?t.undock:t.dock;return"xsmall"!==i&&this.dockOptions?.buttonEnabled?I("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(b.button,b.buttonDock)},this.renderDockIcon()):null}renderTitle(){const{title:e}=this.viewModel,{titleId:t,collapsible:i,contentCollapsed:o,messagesCommon:n}=this,s={[b.headerContainerButton]:i},r=I(A,{level:this.headingLevel,class:b.headerTitle,innerHTML:e??""}),l=i?I("button",{key:`${e}--collapsible`,id:t,title:o?n.expand:n.collapse,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(b.headerContainer,s),"aria-expanded":o?"false":"true",onclick:this._toggleCollapsed,type:"button"},r,I("calcite-icon",{class:b.collapseIcon,key:"collapse-icon",icon:o?"chevron-down":"chevron-up",scale:"m"})):I("div",{key:e??"title",id:t,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(b.headerContainer,s)},r);return e?l:null}renderCloseIcon(){return I("span",{"aria-hidden":"true",class:this.classes(b.icon,b.iconClose)})}renderCloseButton(){const{visibleElements:e,messagesCommon:t}=this;return e.closeButton?I("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:b.button,"aria-label":t.close,title:t.close,afterCreate:this._closeButtonNodeUpdated,afterUpdate:this._closeButtonNodeUpdated},this.renderCloseIcon()):null}renderHeader(){return I("header",{class:b.header},this.renderTitle(),I("div",{class:b.headerButtons},this.renderDockButton(),this.renderCloseButton()))}renderContentContainer(){const{contentId:e,hasContent:t,contentCollapsed:i,_flowItems:o}=this,{content:n}=this.viewModel,s=o.toArray(),r={[b.contentHasFlows]:!!s.length};return t&&!i?I("div",{key:n??"content",enterAnimation:this._createFeatureUpdatedAnimation(),id:e,class:this.classes(b.content,r)},I("calcite-flow",{bind:this},I("calcite-flow-item",{bind:this,"data-node-ref":"_rootFlowItemNode",afterCreate:x,key:"root-flow-item",onCalciteFlowItemBack:this._handleBackClick},this.renderContent()),s.map((e=>this.renderFlowItem(e)))),s.map((e=>this.renderFlowItemTooltips(e)))):null}renderFlowItem(e){const{messages:t}=this,i=N(),o="graphic"in e&&!e.isTable;return I("calcite-flow-item",{bind:this,class:this.classes({[b.calciteThemeDark]:!i,[b.calciteThemeLight]:i}),heading:e.title??"",description:this._getFlowItemDescription(e),onCalciteFlowItemBack:this._handleBackClick,key:`flow-item-${e.viewModel.uid}`},I("calcite-action",{class:b.actionExit,icon:"move-up",label:t?.exitRelatedRecords,text:t?.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:t=>this._storeExitRelatedRecordsAction(e,t),onclick:this._destroyFlowItemWidgets}),o?I("calcite-action",{class:b.actionSelectFeature,icon:"zoom-to-object",label:t?.selectFeature,text:t?.selectFeature,slot:"header-actions-end",bind:this,afterCreate:t=>this._storeFeatureSelectionAction(e,t),onclick:()=>this._handleOpenRelatedFeature(e)}):null,I("div",{class:this.classes(b.contentFlowItem,{[b.calciteThemeDark]:i,[b.calciteThemeLight]:!i})},e.render()))}renderFlowItemTooltips(e){const{messages:t,_exitRelatedRecordsActions:i,_featureSelectionActions:o}=this,n=N(),s=o.get(e);return[I("calcite-tooltip",{class:this.classes({[b.calciteThemeDark]:!n,[b.calciteThemeLight]:n}),key:`exit-related-records-tooltip-${e.viewModel.uid}`,label:t?.exitRelatedRecords,overlayPositioning:"fixed",referenceElement:i.get(e),placement:"top"},t?.exitRelatedRecords),s?I("calcite-tooltip",{class:this.classes({[b.calciteThemeDark]:!n,[b.calciteThemeLight]:n}),key:`select-related-record-tooltip-${e.viewModel.uid}`,label:t?.selectFeature,overlayPositioning:"fixed",referenceElement:s,placement:"top"},t?.selectFeature):null]}renderActionsMenuButton(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o,messagesCommon:n}=this,s=i?n.close:n.open,{menuActions:r}=o;return r.length?I("div",{key:R("actions-menu-button"),class:this.classes(b.button,b.actionsMenuButton),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":s,title:s},I("span",{"aria-hidden":"true",class:b.iconActionsMenu})):null}renderMenuActions(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o}=this,{menuActions:n}=o;return n.length&&i?I("ul",{id:e,role:"menu","aria-labelledby":t,key:R("actions"),class:b.actions,bind:this,onkeyup:this._handleActionMenuKeyup,afterCreate:this._actionsMenuNodeUpdated,afterUpdate:this._actionsMenuNodeUpdated},n.toArray().map((e=>this.renderAction({action:e,type:"menu-item"})))):null}renderInlineActions(){const{inlineActions:e}=this.dividedActions;return e.length?e.toArray().map((e=>this.renderAction({action:e,type:"inline"}))):[]}renderInlineActionsContainer(){const{inlineActions:e,menuActions:t}=this.dividedActions,i=!!e.length,o=!!t.length;return i||o?I("div",{key:"inline-actions-container","data-inline-actions":i.toString(),"data-menu-actions":o.toString(),class:b.inlineActionsContainer},this.renderInlineActions(),this.renderActionsMenuButton(),this.renderMenuActions()):null}renderNavigation(){return this.featureNavigationVisible?I("section",{key:R("navigation"),class:this.classes(b.navigation)},this.renderNavigationButtons()):null}renderFooter(){const{featureNavigationVisible:e,dividedActions:t}=this,{inlineActions:i,menuActions:o}=t,n=!!i.length,s=!!o.length,r={[b.footerHasPagination]:e,[b.footerHasActions]:n,[b.footerHasActionsMenu]:s};return e||n?I("div",{key:R("feature-buttons"),class:this.classes(b.footer,r)},this.renderInlineActionsContainer(),this.renderNavigation()):null}renderFeatureMenuContainer(){const{messages:e}=this,{featureViewModels:t,isLoadingFeature:i}=this.viewModel,o=P(e.selectedFeatures,{total:t.length});return I("section",{key:R("menu"),class:b.featureMenu},I("strong",{class:b.featureMenuHeader},o),I("nav",{bind:this,class:b.featureMenuViewport,"data-node-ref":"_featureMenuViewportNode",afterCreate:x},this.renderFeatureMenu(),I("div",{class:b.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),i?I("div",{class:b.featureMenuLoader},this.renderLoadingIcon()):null))}renderPointer(){return this.dockEnabled?null:I("div",{key:R("pointer"),class:b.pointer,role:"presentation"},I("div",{class:this.classes(b.pointerDirection,b.shadow)}))}renderMainContainer(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i,titleId:o,contentId:n,collapsible:s,hasContent:r,contentCollapsed:l,visibleElements:a}=this,{title:c}=this.viewModel,u="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,h={[b.shadow]:e,[b.isCollapsible]:s,[b.isCollapsed]:l};return I("div",{class:this.classes(b.main,b.widget,h),tabIndex:a.closeButton?void 0:-1,role:"dialog","aria-labelledby":c?o:"","aria-describedby":r&&!l?n:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},u?this.renderFooter():null,u?this.renderFeatureMenuContainer():null,this.renderHeader(),this.renderContentContainer(),d?this.renderFooter():null,d?this.renderFeatureMenuContainer():null)}renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?I("div",{class:f.contentNode,key:e,innerHTML:e}):this.renderNodeContent(e):null}renderActionText(e){return I("span",{key:"text",class:b.actionText},e)}renderActionIcon(e){const t=this._getActionClass(e),i=this._getActionImage(e),o={[b.iconLoading]:e.active,[b.rotating]:e.active,[b.icon]:!!t,[b.actionImage]:!e.active&&!!i};return t&&(o[t]=!e.active),I("span",{key:"icon","aria-hidden":"true",class:this.classes(b.icon,o),styles:this._getIconStyles(i)})}renderAction(e){const{action:t,type:i}=e,o=this._getActionTitle(t),n={[b.action]:"toggle"!==t.type,[b.actionToggle]:"toggle"===t.type,[b.actionToggleOn]:"toggle"===t.type&&t.value,[b.buttonDisabled]:t.disabled},s=[this.renderActionIcon(t),this.renderActionText(o)],r="menu-item"===i?I("li",{key:t.uid,role:"menuitem",tabIndex:0,title:o,"aria-label":o,class:this.classes(b.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s):I("div",{key:t.uid,role:"button",tabIndex:0,title:o,"aria-label":o,class:this.classes(b.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s);return t.visible?r:null}renderFeatureMenuItem(e,t){const{messages:i,messagesCommon:o}=this,{selectedFeatureIndex:n,selectedFeatureViewModel:s}=this.viewModel,r=e===s,l={[b.featureMenuSelected]:r},a=r?I("span",{key:R(`feature-menu-selected-feature-${n}`),title:i.selectedFeature,"aria-label":i.selectedFeature,class:b.iconCheckMark}):null,c=I("span",{innerHTML:e.title||o.untitled});return I("li",{role:"menuitem",tabIndex:-1,key:R(`feature-menu-feature-${n}`),class:this.classes(l,b.featureMenuItem),bind:this,"data-feature-index":t,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature},I("span",{class:b.featureMenuTitle},c,a))}renderFeatureMenu(){const{featureMenuId:e}=this,{featureViewModels:t}=this.viewModel;return t.length>1?I("ol",{class:b.featureMenuList,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}_storeFeatureSelectionAction(e,t){this._featureSelectionActions.set(e,t),this.scheduleRender()}_storeExitRelatedRecordsAction(e,t){this._exitRelatedRecordsActions.set(e,t),this.scheduleRender()}_getFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description??""}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=w(i);this.open({features:[t],location:null!=o?o:void 0})}_destroyFlowItemWidgets(){this._flowItems.removeAll().forEach((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_handleBackClick(){const e=this._flowItems.pop();e&&(this._exitRelatedRecordsActions.delete(e),this._featureSelectionActions.delete(e),"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:n}=e,s=i?.attributes,r=e.title??"",l="zoom-to-feature"===n?P(r,{messages:t}):"remove-selected-feature"===n?P(r,{messages:o}):"zoom-to-clustered-features"===n||"browse-clustered-features"===n?P(r,{messages:t}):e.title;return l&&s?P(l,s):l??""}_getActionClass(e){const{selectedFeature:t}=this,i=t?.attributes,{className:o,image:n}=e,s=n||o?o:b.iconDefaultAction;return s&&i?P(s,i):s??""}_getActionImage(e){const{selectedFeature:t}=this,i=t?.attributes,{image:o}=e;return o&&i?P(o,i):o??""}_createFeatureUpdatedAnimation(){return E("enter",b.hasFeatureUpdated)}_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(s((()=>[e.uid,e.active,e.className,e.disabled,e.id,e.title,e.image,e.visible]),(()=>this.scheduleRender())),t)}))}_divideActions(){const{allActions:e}=this.viewModel,i=e.filter((e=>e.visible)),o=this._getInlineActionCount(),n=null===o,s=0===o;return{inlineActions:n?i.slice(0):s?new t:i.slice(0,o),menuActions:n?new t:s?i.slice(0):i.slice(o)}}_featureMenuOpenChanged(e){e?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0}_actionsMenuOpenChanged(e){e?this._focusFirstAction=!0:this._focusActionsMenuButton=!0}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this;e&&(this.viewModel.title="error"===e.viewModel?.state?t.errorMessage:e.viewModel?.title||"")}_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"===i(e)&&(e.stopPropagation(),this._focusFeatureMenuButton=!0,this.featureMenuOpen=!1,this.scheduleRender())}_handleActionMenuKeyup(e){"Escape"===i(e)&&(e.stopPropagation(),this._focusActionsMenuButton=!0,this.actionsMenuOpen=!1,this.scheduleRender())}_setActiveFeature(e){const{viewModel:t}=this,i=j(e.currentTarget);t.activeFeature=t.features[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_handleFeatureMenuItemKeyup(e){const t=i(e),{_featureMenuNode:o}=this,n=j(e.currentTarget);if(!o)return;const s=o.querySelectorAll("li"),r=s.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();s[s.length-1].focus()}else{e.stopPropagation();s[0].focus()}else{e.stopPropagation();s[(n+1+r)%r].focus()}else{e.stopPropagation();s[(n-1+r)%r].focus()}}_handleActionMenuItemKeyup(e){const t=i(e),{_actionsMenuNode:o}=this,n=e.currentTarget.dataset.actionUid,{menuActions:s}=this.dividedActions,r=s.findIndex((e=>e.uid===n));if(!o)return;const l=o.querySelectorAll("li"),a=l.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();l[l.length-1].focus()}else{e.stopPropagation();l[0].focus()}else{e.stopPropagation();l[(r+1+a)%a].focus()}else{e.stopPropagation();l[(r-1+a)%a].focus()}}_handleMainKeyup(e){const t=i(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&&t?e.show({location:t}):e.hide()}_getIconStyles(e){return{"background-image":e?`url(${e})`:""}}async _shouldFocus(e){e?.shouldFocus&&(await a((()=>!0===this.viewModel?.active)),this.focus())}_addSelectedFeatureIndexHandle(){const e=s((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this._handles.add(e,T)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this;i&&e!==t&&-1!==e&&(this._destroyFlowItemWidgets(),this.actionsMenuOpen=!1,this.featureMenuOpen=!1,this._mainContainerNode&&(this._mainContainerNode.scrollTop=0),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_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:o,side:n,view:s}=e;if(isNaN(i)||isNaN(t)||!s||!o)return!1;const r=s.padding;return"right"===n&&o.x+i/2>s.width-r.right||("left"===n&&o.x-i/2<r.left||("top"===n&&o.y-t<r.top||"bottom"===n&&o.y+t>s.height-r.bottom))}_calculateAutoAlignment(e){if("auto"!==e)return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:o,viewModel:n}=this,{screenLocation:s,view:r}=n;if(null==s||!r||!i)return"top-center";if(!this._isScreenLocationWithinView(s,r))return this._get("currentAlignment")||"top-center";function l(e){return parseInt(e.replace(/[^-\d\.]/g,""),10)}const a=o?window.getComputedStyle(o,null):null,c=a?l(a.getPropertyValue("max-height")):0,u=a?l(a.getPropertyValue("height")):0,{height:d,width:h}=i.getBoundingClientRect(),p=h+t,g=Math.max(d,c,u)+t,m=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"right",view:r}),v=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"left",view:r}),f=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"top",view:r}),_=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"bottom",view:r});return v?f?"bottom-right":"top-right":m?f?"bottom-left":"top-left":f?_?"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 O(this.container)&&t.reverse(),e.replace(/leading/gi,t[0]).replace(/trailing/gi,t[1])}_callDockPosition(e){return"function"==typeof e?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_wouldDockTo(){return this.dockEnabled?null:this._getDockPosition()}_calculateAutoDockPosition(e){if("auto"!==e)return e;const t=this.viewModel?.view,i=O(this.container)?"top-left":"top-right";if(!t)return i;const o=t.padding||{left:0,right:0,top:0,bottom:0},n=t.width-o.left-o.right,{breakpoints:s}=t;return s&&n<=s.xsmall?"bottom-center":i}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!this._containerNode)return;const{screenLocation:t}=this.viewModel,{width:i}=this._containerNode.getBoundingClientRect(),o=this._calculatePositionStyle(t,i);o&&Object.assign(this._containerNode.style,o)}_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,o){const{currentAlignment:n,_pointerOffsetInPx:s}=this;if(!i)return;const{padding:r}=i,l=o/2,a=i.height-t,c=i.width-e;return"bottom-center"===n?{top:t+s-r.top,left:e-l-r.left}:"top-left"===n?{bottom:a+s-r.bottom,right:c+s-r.right}:"bottom-left"===n?{top:t+s-r.top,right:c+s-r.right}:"top-right"===n?{bottom:a+s-r.bottom,left:e+s-r.left}:"bottom-right"===n?{top:t+s-r.top,left:e+s-r.left}:"top-center"===n?{bottom:a+s-r.bottom,left:e-l-r.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(null==e||!t)return;const n=this._calculateFullWidth(t),s=this._calculateAlignmentPosition(e.x,e.y,o,n);return s?{top:void 0!==s.top?`${s.top}px`:"auto",left:void 0!==s.left?`${s.left}px`:"auto",bottom:void 0!==s.bottom?`${s.bottom}px`:"auto",right:void 0!==s.right?`${s.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[o,n]=e,[s,r]=t,{width:l=0,height:a=0}=i??{};return o<=l&&s>l||o>l&&s<=l||n<=a&&r>a||n>a&&r<=a}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,n=i.top+i.bottom,s=[],r=[];s[0]=e[0]-o,s[1]=e[1]-n,r[0]=t[0]-o,r[1]=t[1]-n;const{dockOptions:l}=this,a=l.breakpoint;this._dockingThresholdCrossed(s,r,a)&&this._setDockEnabledForViewSize(l),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");if(t.length){t[0].focus()}}_actionsMenuNodeUpdated(e){if(this._actionsMenuNode=e,!e||!this._focusFirstAction)return;this._focusFirstAction=!1;const t=e.querySelectorAll("li");if(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){const t=e.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:n}=i;if(isNaN(o)||isNaN(n))return!1;if(!t)return!1;const s=t.hasOwnProperty("width")&&o<=(t.width??0),r=t.hasOwnProperty("height")&&n<=(t.height??0);return s||r}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}_getPageText(e,t){return this.featureNavigationVisible?P(this.messages.pageText,{index:t+1,total:e}):null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t&&t.ui&&t.ui.remove(e,D),e.destroy(),this._spinner=null)}_createSpinner(e){e&&(this._spinner=new m({view:e}),e.ui.add(this._spinner,{key:D,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.dataset.actionUid,{allActions:i}=this.viewModel,o=i.findIndex((e=>e.uid===t)),n=i.getItemAt(o);n&&"toggle"===n.type&&(n.value=!n.value),this.actionsMenuOpen=!1,this.viewModel.triggerAction(o)}_selectFeature(e){const t=j(e.currentTarget);null==t||isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuButton=!0,this.scheduleRender()}_next(){this.next()}_previous(){this.previous()}};function j(e){return e?.["data-feature-index"]}e([d({readOnly:!0})],U.prototype,"actionsMenuId",null),e([d({readOnly:!0})],U.prototype,"actionsMenuButtonId",null),e([d({readOnly:!0})],U.prototype,"featureMenuId",null),e([d({readOnly:!0})],U.prototype,"titleId",null),e([d({readOnly:!0})],U.prototype,"contentId",null),e([d({readOnly:!0})],U.prototype,"hasContent",null),e([d({readOnly:!0})],U.prototype,"featureNavigationVisible",null),e([d({readOnly:!0})],U.prototype,"collapsible",null),e([d({readOnly:!0})],U.prototype,"featureMenuVisible",null),e([d({readOnly:!0})],U.prototype,"contentCollapsed",null),e([d({readOnly:!0})],U.prototype,"dividedActions",null),e([d({readOnly:!0,dependsOn:["_flowItems.length"]})],U.prototype,"_activeFlowItemWidget",null),e([d()],U.prototype,"actions",null),e([d()],U.prototype,"actionsMenuOpen",null),e([d()],U.prototype,"alignment",void 0),e([d()],U.prototype,"autoCloseEnabled",null),e([d()],U.prototype,"autoOpenEnabled",null),e([d()],U.prototype,"defaultPopupTemplateEnabled",null),e([d()],U.prototype,"content",null),e([d()],U.prototype,"collapsed",void 0),e([d()],U.prototype,"collapseEnabled",void 0),e([d({readOnly:!0})],U.prototype,"currentAlignment",null),e([d({readOnly:!0})],U.prototype,"currentDockPosition",null),e([d()],U.prototype,"dockOptions",null),e([d()],U.prototype,"dockEnabled",void 0),e([d({readOnly:!0})],U.prototype,"featureCount",null),e([d()],U.prototype,"featureMenuOpen",void 0),e([d()],U.prototype,"features",null),e([d()],U.prototype,"goToOverride",null),e([d()],U.prototype,"headingLevel",void 0),e([d()],U.prototype,"highlightEnabled",null),e([d()],U.prototype,"location",null),e([d()],U.prototype,"label",null),e([d()],U.prototype,"maxInlineActions",void 0),e([d(),F("esri/widgets/Popup/t9n/Popup")],U.prototype,"messages",void 0),e([d(),F("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([d()],U.prototype,"promises",null),e([d({readOnly:!0})],U.prototype,"selectedFeature",null),e([d()],U.prototype,"selectedFeatureIndex",null),e([d({readOnly:!0})],U.prototype,"selectedFeatureWidget",null),e([d()],U.prototype,"spinnerEnabled",void 0),e([d()],U.prototype,"title",null),e([d()],U.prototype,"updateLocationEnabled",null),e([d()],U.prototype,"view",null),e([d({type:M}),C(["triggerAction","trigger-action"])],U.prototype,"viewModel",void 0),e([d()],U.prototype,"visible",null),e([d()],U.prototype,"visibleElements",void 0),e([h("visibleElements")],U.prototype,"castVisibleElements",null),e([k()],U.prototype,"_close",null),e([k()],U.prototype,"_toggleDockEnabled",null),e([k()],U.prototype,"_toggleFeatureMenu",null),e([k()],U.prototype,"_toggleActionsMenu",null),e([k()],U.prototype,"_triggerAction",null),e([k()],U.prototype,"_selectFeature",null),e([k()],U.prototype,"_next",null),e([k()],U.prototype,"_previous",null),U=e([p("esri.widgets.Popup")],U);const W=U;export{W as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{eventKey as i}from"../core/events.js";import o from"../core/Handles.js";import n from"../core/Logger.js";import{watch as s,when as r,on as l,whenOnce as a,initial as c}from"../core/reactiveUtils.js";import{throttle as u}from"../core/throttle.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{cast as h}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import g from"./Feature.js";import m from"./Spinner.js";import f from"./Widget.js";import{CSS as v}from"./Feature/resources.js";import{FeatureContentMixin as _}from"./Feature/support/FeatureContentMixin.js";import{getPointFromGeometry as w}from"./Popup/actionUtils.js";import{CSS as b}from"./Popup/css.js";import M from"./Popup/PopupViewModel.js";import{loadCalciteComponents as y}from"./support/componentsUtils.js";import{Heading as A}from"./support/Heading.js";import{accessibleHandler as k}from"./support/decorators/accessibleHandler.js";import{messageBundle as F}from"./support/decorators/messageBundle.js";import{vmEvent as C}from"./support/decorators/vmEvent.js";import{tsx as I}from"./support/jsxFactory.js";import{isRTL as O,storeNode as x,cssTransition as E}from"./support/widgetUtils.js";import{isDarkTheme as N}from"../support/themeUtils.js";import{substitute as P}from"../intl/substitute.js";const T="selected-index",B=0,D="popup-spinner",L={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},S="esri-popup";function R(e,t){return void 0===t?`${S}__${e}`:`${S}__${e}-${t}`}const V={closeButton:!0,featureNavigation:!0};let U=class extends(_(f)){constructor(e,i){super(e,i),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 o,this._pointerOffsetInPx=16,this._spinner=null,this._feature=null,this._featureMenuIntersectionObserverNode=null,this._featureMenuViewportNode=null,this._rootFlowItemNode=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._displaySpinnerThrottled=u((()=>this._displaySpinner()),B),this._exitRelatedRecordsActions=new WeakMap,this._featureSelectionActions=new WeakMap,this._flowItems=new t,this.alignment="auto",this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.headingLevel=2,this.maxInlineActions=3,this.messages=null,this.messagesCommon=null,this.spinnerEnabled=!0,this.viewModel=new M,this.visibleElements={...V},this._handleOpenRelatedFeature=e=>{this._openRelatedFeature(e)},this._addSelectedFeatureIndexHandle(),this.addHandles([s((()=>this.viewModel?.screenLocation),(()=>this._positionContainer())),s((()=>[this.viewModel?.active,this.dockEnabled]),(()=>this._toggleScreenLocationEnabled())),s((()=>this.viewModel?.screenLocation),((e,t)=>{!!e!=!!t&&this.reposition()})),s((()=>[this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment]),(()=>this.reposition())),s((()=>this.spinnerEnabled),(e=>this._spinnerEnabledChange(e))),s((()=>this.viewModel?.view?.size),((e,t)=>this._updateDockEnabledForViewSize(e,t))),s((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),s((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),s((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),s((()=>this.selectedFeatureWidget),(()=>this._destroyFlowItemWidgets())),s((()=>[this.selectedFeatureWidget?.viewModel?.title,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setTitleFromFeatureWidget())),s((()=>[this.selectedFeatureWidget?.viewModel?.content,this.selectedFeatureWidget?.viewModel?.state]),(()=>this._setContentFromFeatureWidget())),r((()=>!this.collapsed),(()=>{"xsmall"===this.viewModel?.view?.widthBreakpoint&&this.viewModel.active&&this.collapseEnabled&&this.viewModel.centerAtLocation()})),l((()=>this.viewModel?.allActions),"change",(()=>this._watchActions())),s((()=>this.viewModel?.allActions),(()=>this._watchActions()),c),s((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop())),l((()=>this._flowItems),"change",(()=>{this.notifyChange("_activeFlowItemWidget"),this.scheduleRender()})),s((()=>[this._activeFlowItemWidget?.viewModel?.state,this._activeFlowItemWidget?.viewModel?.title]),(()=>this.scheduleRender()))])}loadDependencies(){return y({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}destroy(){this._destroyFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._handles?.destroy(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect()}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(){const{selectedFeatureWidget:e,viewModel:t}=this;if(!e)return!!t?.content;const i=e.viewModel;if(i?.waitingForContent||"error"===i?.state)return!0;const o=i?.content;return Array.isArray(o)?!!o.length:!!o}get featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&null!=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()}get _activeFlowItemWidget(){const{_flowItems:e}=this;return e.getItemAt(e.length-1)||null}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}set actionsMenuOpen(e){this._set("actionsMenuOpen",!!e)}get actionsMenuOpen(){return!!this.viewModel.active&&this._get("actionsMenuOpen")}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get autoOpenEnabled(){return this.viewModel.autoOpenEnabled}set autoOpenEnabled(e){this.viewModel.autoOpenEnabled=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||L}set dockOptions(e){const t={...L},i=this.viewModel?.view?.breakpoints,o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const n={...t,...e},s={...t.breakpoint,...o},{breakpoint:r}=n;"object"==typeof r?n.breakpoint={...s,...r}:r&&(n.breakpoint=s),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,visibleElements:t,headingLevel:i,_flowItems:o}=this,{selectedFeatureViewModel:n}=this.viewModel,s={...t,title:!1};return n?(e?(e.viewModel=n,e.visibleElements=s):this._feature=new g({flowItems:o,headingLevel:i+1,viewModel:n,visibleElements:s}),this._feature):null}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}castVisibleElements(e){return{...V,...e}}blur(){const{active:e}=this.viewModel;e||n.getLogger(this.declaredClass).warn("Popup can only be blurred when currently active."),this.visibleElements.closeButton?this._blurClose=!0:this._blurContainer=!0,this.scheduleRender()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||n.getLogger(this.declaredClass).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){this._handles.remove(T);const t=!!e&&!!e.featureMenuOpen,i=!!e&&!!e.actionsMenuOpen,o={collapsed:!!e&&!!e.collapsed,actionsMenuOpen:i,featureMenuOpen:t};"xsmall"===this.viewModel?.view?.widthBreakpoint&&(o.collapsed=!0),this.set(o),this.viewModel.open(e),this._shouldFocus(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{actionsMenuOpen:e,dockEnabled:t,featureMenuVisible:i,dividedActions:o,currentAlignment:n,currentDockPosition:s}=this,{active:r}=this.viewModel,{menuActions:l}=o,a=r&&l.length>1&&e,c=r&&t,u=r&&!t,d=this.selectedFeature?.layer?.title,h=this.selectedFeature?.layer?.id,p={[b.alignTopCenter]:"top-center"===n,[b.alignBottomCenter]:"bottom-center"===n,[b.alignTopLeft]:"top-left"===n,[b.alignBottomLeft]:"bottom-left"===n,[b.alignTopRight]:"top-right"===n,[b.alignBottomRight]:"bottom-right"===n,[b.isDocked]:c,[b.shadow]:u,[b.isDockedTopLeft]:"top-left"===s,[b.isDockedTopCenter]:"top-center"===s,[b.isDockedTopRight]:"top-right"===s,[b.isDockedBottomLeft]:"bottom-left"===s,[b.isDockedBottomCenter]:"bottom-center"===s,[b.isDockedBottomRight]:"bottom-right"===s,[b.isFeatureMenuOpen]:i,[b.isActionsMenuOpen]:a};return I("div",{class:this.classes(b.base,p),role:"presentation","data-layer-title":d,"data-layer-id":h,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},r?[this.renderMainContainer(),this.renderPointer()]:null)}renderLoadingIcon(){return I("span",{"aria-hidden":"true",class:this.classes(b.icon,b.iconLoading,b.rotating)})}renderNavigationLoading(){const{messagesCommon:e}=this;return this.viewModel.pendingPromisesCount?I("div",{key:R("loading-container"),role:"presentation",class:b.loadingContainer,"aria-label":e.loading,title:e.loading},this.renderLoadingIcon()):null}renderPreviousIcon(){const e=O(this.container),t={[b.iconRightTriangleArrow]:e,[b.paginationPreviousIconRTL]:e,[b.iconLeftTriangleArrow]:!e,[b.paginationPreviousIconLTR]:!e};return I("span",{"aria-hidden":"true",class:this.classes(b.icon,t)})}renderPreviousButton(){const{messages:e}=this;return I("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:this.classes(b.button,b.paginationPrevious),"aria-label":e.previous,title:e.previous},this.renderPreviousIcon())}renderNextIcon(){const e=O(this.container),t={[b.iconLeftTriangleArrow]:e,[b.paginationNextIconRTL]:e,[b.iconRightTriangleArrow]:!e,[b.paginationNextIconLTR]:!e};return I("span",{"aria-hidden":"true",class:this.classes(b.icon,t)})}renderNextButton(){const{messages:e}=this;return I("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:this.classes(b.button,b.paginationNext),"aria-label":e.next,title:e.next},this.renderNextIcon())}renderFeatureMenuButton(){const{featureMenuOpen:e,featureMenuId:t,messagesCommon:i}=this,{featureCount:o,selectedFeatureIndex:n}=this.viewModel;return I("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:this.classes(b.button,b.featureMenuButton),"aria-haspopup":"true","aria-controls":t,"aria-expanded":e.toString(),"aria-label":i.menu,title:i.menu},this._getPageText(o,n))}renderNavigationButtons(){return this.featureNavigationVisible?[this.renderPreviousButton(),this.renderNavigationLoading()||this.renderFeatureMenuButton(),this.renderNextButton()]:[]}renderDockIcon(){const{dockEnabled:e}=this,t=this._wouldDockTo(),i={[b.iconUndock]:e,[b.iconDock]:!e,[b.iconDockToRight]:!e&&("top-right"===t||"bottom-right"===t),[b.iconDockToLeft]:!e&&("top-left"===t||"bottom-left"===t),[b.iconDockToTop]:!e&&"top-center"===t,[b.iconDockToBottom]:!e&&"bottom-center"===t};return I("span",{"aria-hidden":"true",class:this.classes(i,b.icon)})}renderDockButton(){const{dockEnabled:e,messages:t}=this,i=this.viewModel?.view?.widthBreakpoint,o=e?t.undock:t.dock;return"xsmall"!==i&&this.dockOptions?.buttonEnabled?I("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(b.button,b.buttonDock)},this.renderDockIcon()):null}renderTitle(){const{title:e}=this.viewModel,{titleId:t,collapsible:i,contentCollapsed:o,messagesCommon:n}=this,s={[b.headerContainerButton]:i},r=I(A,{level:this.headingLevel,class:b.headerTitle,innerHTML:e??""}),l=i?I("button",{key:`${e}--collapsible`,id:t,title:o?n.expand:n.collapse,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(b.headerContainer,s),"aria-expanded":o?"false":"true",onclick:this._toggleCollapsed,type:"button"},r,I("calcite-icon",{class:b.collapseIcon,key:"collapse-icon",icon:o?"chevron-down":"chevron-up",scale:"m"})):I("div",{key:e??"title",id:t,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(b.headerContainer,s)},r);return e?l:null}renderCloseIcon(){return I("span",{"aria-hidden":"true",class:this.classes(b.icon,b.iconClose)})}renderCloseButton(){const{visibleElements:e,messagesCommon:t}=this;return e.closeButton?I("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:b.button,"aria-label":t.close,title:t.close,afterCreate:this._closeButtonNodeUpdated,afterUpdate:this._closeButtonNodeUpdated},this.renderCloseIcon()):null}renderHeader(){return I("header",{class:b.header},this.renderTitle(),I("div",{class:b.headerButtons},this.renderDockButton(),this.renderCloseButton()))}renderContentContainer(){const{contentId:e,hasContent:t,contentCollapsed:i,_flowItems:o}=this,{content:n}=this.viewModel,s=o.toArray(),r={[b.contentHasFlows]:!!s.length};return t&&!i?I("div",{key:n??"content",enterAnimation:this._createFeatureUpdatedAnimation(),id:e,class:this.classes(b.content,r)},I("calcite-flow",{bind:this},I("calcite-flow-item",{bind:this,"data-node-ref":"_rootFlowItemNode",afterCreate:x,key:"root-flow-item",onCalciteFlowItemBack:this._handleBackClick},this.renderContent()),s.map((e=>this.renderFlowItem(e)))),s.map((e=>this.renderFlowItemTooltips(e)))):null}renderFlowItem(e){const{messages:t}=this,i=N(),o="graphic"in e&&!e.isTable;return I("calcite-flow-item",{bind:this,class:this.classes({[b.calciteThemeDark]:!i,[b.calciteThemeLight]:i}),heading:e.title??"",description:this._getFlowItemDescription(e),onCalciteFlowItemBack:this._handleBackClick,key:`flow-item-${e.viewModel.uid}`},I("calcite-action",{class:b.actionExit,icon:"move-up",label:t?.exitRelatedRecords,text:t?.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:t=>this._storeExitRelatedRecordsAction(e,t),onclick:this._destroyFlowItemWidgets}),o?I("calcite-action",{class:b.actionSelectFeature,icon:"zoom-to-object",label:t?.selectFeature,text:t?.selectFeature,slot:"header-actions-end",bind:this,afterCreate:t=>this._storeFeatureSelectionAction(e,t),onclick:()=>this._handleOpenRelatedFeature(e)}):null,I("div",{class:this.classes(b.contentFlowItem,{[b.calciteThemeDark]:i,[b.calciteThemeLight]:!i})},e.render()))}renderFlowItemTooltips(e){const{messages:t,_exitRelatedRecordsActions:i,_featureSelectionActions:o}=this,n=N(),s=o.get(e);return[I("calcite-tooltip",{class:this.classes({[b.calciteThemeDark]:!n,[b.calciteThemeLight]:n}),key:`exit-related-records-tooltip-${e.viewModel.uid}`,label:t?.exitRelatedRecords,overlayPositioning:"fixed",referenceElement:i.get(e),placement:"top"},t?.exitRelatedRecords),s?I("calcite-tooltip",{class:this.classes({[b.calciteThemeDark]:!n,[b.calciteThemeLight]:n}),key:`select-related-record-tooltip-${e.viewModel.uid}`,label:t?.selectFeature,overlayPositioning:"fixed",referenceElement:s,placement:"top"},t?.selectFeature):null]}renderActionsMenuButton(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o,messagesCommon:n}=this,s=i?n.close:n.open,{menuActions:r}=o;return r.length?I("div",{key:R("actions-menu-button"),class:this.classes(b.button,b.actionsMenuButton),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":s,title:s},I("span",{"aria-hidden":"true",class:b.iconActionsMenu})):null}renderMenuActions(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:o}=this,{menuActions:n}=o;return n.length&&i?I("ul",{id:e,role:"menu","aria-labelledby":t,key:R("actions"),class:b.actions,bind:this,onkeyup:this._handleActionMenuKeyup,afterCreate:this._actionsMenuNodeUpdated,afterUpdate:this._actionsMenuNodeUpdated},n.toArray().map((e=>this.renderAction({action:e,type:"menu-item"})))):null}renderInlineActions(){const{inlineActions:e}=this.dividedActions;return e.length?e.toArray().map((e=>this.renderAction({action:e,type:"inline"}))):[]}renderInlineActionsContainer(){const{inlineActions:e,menuActions:t}=this.dividedActions,i=!!e.length,o=!!t.length;return i||o?I("div",{key:"inline-actions-container","data-inline-actions":i.toString(),"data-menu-actions":o.toString(),class:b.inlineActionsContainer},this.renderInlineActions(),this.renderActionsMenuButton(),this.renderMenuActions()):null}renderNavigation(){return this.featureNavigationVisible?I("section",{key:R("navigation"),class:this.classes(b.navigation)},this.renderNavigationButtons()):null}renderFooter(){const{featureNavigationVisible:e,dividedActions:t}=this,{inlineActions:i,menuActions:o}=t,n=!!i.length,s=!!o.length,r={[b.footerHasPagination]:e,[b.footerHasActions]:n,[b.footerHasActionsMenu]:s};return e||n?I("div",{key:R("feature-buttons"),class:this.classes(b.footer,r)},this.renderInlineActionsContainer(),this.renderNavigation()):null}renderFeatureMenuContainer(){const{messages:e}=this,{featureViewModels:t,isLoadingFeature:i}=this.viewModel,o=P(e.selectedFeatures,{total:t.length});return I("section",{key:R("menu"),class:b.featureMenu},I("strong",{class:b.featureMenuHeader},o),I("nav",{bind:this,class:b.featureMenuViewport,"data-node-ref":"_featureMenuViewportNode",afterCreate:x},this.renderFeatureMenu(),I("div",{class:b.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),i?I("div",{class:b.featureMenuLoader},this.renderLoadingIcon()):null))}renderPointer(){return this.dockEnabled?null:I("div",{key:R("pointer"),class:b.pointer,role:"presentation"},I("div",{class:this.classes(b.pointerDirection,b.shadow)}))}renderMainContainer(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i,titleId:o,contentId:n,collapsible:s,hasContent:r,contentCollapsed:l,visibleElements:a}=this,{title:c}=this.viewModel,u="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,h={[b.shadow]:e,[b.isCollapsible]:s,[b.isCollapsed]:l};return I("div",{class:this.classes(b.main,b.widget,h),tabIndex:a.closeButton?void 0:-1,role:"dialog","aria-labelledby":c?o:"","aria-describedby":r&&!l?n:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},u?this.renderFooter():null,u?this.renderFeatureMenuContainer():null,this.renderHeader(),this.renderContentContainer(),d?this.renderFooter():null,d?this.renderFeatureMenuContainer():null)}renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?I("div",{class:v.contentNode,key:e,innerHTML:e}):this.renderNodeContent(e):null}renderActionText(e){return I("span",{key:"text",class:b.actionText},e)}renderActionIcon(e){const t=this._getActionClass(e),i=this._getActionImage(e),o={[b.iconLoading]:e.active,[b.rotating]:e.active,[b.icon]:!!t,[b.actionImage]:!e.active&&!!i};return t&&(o[t]=!e.active),I("span",{key:"icon","aria-hidden":"true",class:this.classes(b.icon,o),styles:this._getIconStyles(i)})}renderAction(e){const{action:t,type:i}=e,o=this._getActionTitle(t),n={[b.action]:"toggle"!==t.type,[b.actionToggle]:"toggle"===t.type,[b.actionToggleOn]:"toggle"===t.type&&t.value,[b.buttonDisabled]:t.disabled},s=[this.renderActionIcon(t),this.renderActionText(o)],r="menu-item"===i?I("li",{key:t.uid,role:"menuitem",tabIndex:0,title:o,"aria-label":o,class:this.classes(b.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s):I("div",{key:t.uid,role:"button",tabIndex:0,title:o,"aria-label":o,class:this.classes(b.button,n),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},s);return t.visible?r:null}renderFeatureMenuItem(e,t){const{messages:i,messagesCommon:o}=this,{selectedFeatureIndex:n,selectedFeatureViewModel:s}=this.viewModel,r=e===s,l={[b.featureMenuSelected]:r},a=r?I("span",{key:R(`feature-menu-selected-feature-${n}`),title:i.selectedFeature,"aria-label":i.selectedFeature,class:b.iconCheckMark}):null,c=I("span",{innerHTML:e.title||o.untitled});return I("li",{role:"menuitem",tabIndex:-1,key:R(`feature-menu-feature-${n}`),class:this.classes(l,b.featureMenuItem),bind:this,"data-feature-index":t,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature},I("span",{class:b.featureMenuTitle},c,a))}renderFeatureMenu(){const{featureMenuId:e}=this,{featureViewModels:t}=this.viewModel;return t.length>1?I("ol",{class:b.featureMenuList,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}_storeFeatureSelectionAction(e,t){this._featureSelectionActions.set(e,t),this.scheduleRender()}_storeExitRelatedRecordsAction(e,t){this._exitRelatedRecordsActions.set(e,t),this.scheduleRender()}_getFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description??""}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=w(i);this.open({features:[t],location:null!=o?o:void 0})}_destroyFlowItemWidgets(){this._flowItems.removeAll().forEach((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_handleBackClick(){const e=this._flowItems.pop();e&&(this._exitRelatedRecordsActions.delete(e),this._featureSelectionActions.delete(e),"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:n}=e,s=i?.attributes,r=e.title??"",l="zoom-to-feature"===n?P(r,{messages:t}):"remove-selected-feature"===n?P(r,{messages:o}):"zoom-to-clustered-features"===n||"browse-clustered-features"===n?P(r,{messages:t}):e.title;return l&&s?P(l,s):l??""}_getActionClass(e){const{selectedFeature:t}=this,i=t?.attributes,{className:o,image:n}=e,s=n||o?o:b.iconDefaultAction;return s&&i?P(s,i):s??""}_getActionImage(e){const{selectedFeature:t}=this,i=t?.attributes,{image:o}=e;return o&&i?P(o,i):o??""}_createFeatureUpdatedAnimation(){return E("enter",b.hasFeatureUpdated)}_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(s((()=>[e.uid,e.active,e.className,e.disabled,e.id,e.title,e.image,e.visible]),(()=>this.scheduleRender())),t)}))}_divideActions(){const{allActions:e}=this.viewModel,i=e.filter((e=>e.visible)),o=this._getInlineActionCount(),n=null===o,s=0===o;return{inlineActions:n?i.slice(0):s?new t:i.slice(0,o),menuActions:n?new t:s?i.slice(0):i.slice(o)}}_featureMenuOpenChanged(e){e?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0}_actionsMenuOpenChanged(e){e?this._focusFirstAction=!0:this._focusActionsMenuButton=!0}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this;e&&(this.viewModel.title="error"===e.viewModel?.state?t.errorMessage:e.viewModel?.title||"")}_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"===i(e)&&(e.stopPropagation(),this._focusFeatureMenuButton=!0,this.featureMenuOpen=!1,this.scheduleRender())}_handleActionMenuKeyup(e){"Escape"===i(e)&&(e.stopPropagation(),this._focusActionsMenuButton=!0,this.actionsMenuOpen=!1,this.scheduleRender())}_setActiveFeature(e){const{viewModel:t}=this,i=j(e.currentTarget);t.activeFeature=t.features[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_handleFeatureMenuItemKeyup(e){const t=i(e),{_featureMenuNode:o}=this,n=j(e.currentTarget);if(!o)return;const s=o.querySelectorAll("li"),r=s.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();s[s.length-1].focus()}else{e.stopPropagation();s[0].focus()}else{e.stopPropagation();s[(n+1+r)%r].focus()}else{e.stopPropagation();s[(n-1+r)%r].focus()}}_handleActionMenuItemKeyup(e){const t=i(e),{_actionsMenuNode:o}=this,n=e.currentTarget.dataset.actionUid,{menuActions:s}=this.dividedActions,r=s.findIndex((e=>e.uid===n));if(!o)return;const l=o.querySelectorAll("li"),a=l.length;if("ArrowUp"!==t)if("ArrowDown"!==t)if("Home"!==t)if("End"!==t);else{e.stopPropagation();l[l.length-1].focus()}else{e.stopPropagation();l[0].focus()}else{e.stopPropagation();l[(r+1+a)%a].focus()}else{e.stopPropagation();l[(r-1+a)%a].focus()}}_handleMainKeyup(e){const t=i(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&&t?e.show({location:t}):e.hide()}_getIconStyles(e){return{"background-image":e?`url(${e})`:""}}async _shouldFocus(e){e?.shouldFocus&&(await a((()=>!0===this.viewModel?.active)),this.focus())}_addSelectedFeatureIndexHandle(){const e=s((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this._handles.add(e,T)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this;i&&e!==t&&-1!==e&&(this._destroyFlowItemWidgets(),this.actionsMenuOpen=!1,this.featureMenuOpen=!1,this._mainContainerNode&&(this._mainContainerNode.scrollTop=0),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_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:o,side:n,view:s}=e;if(isNaN(i)||isNaN(t)||!s||!o)return!1;const r=s.padding;return"right"===n&&o.x+i/2>s.width-r.right||("left"===n&&o.x-i/2<r.left||("top"===n&&o.y-t<r.top||"bottom"===n&&o.y+t>s.height-r.bottom))}_calculateAutoAlignment(e){if("auto"!==e)return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:o,viewModel:n}=this,{screenLocation:s,view:r}=n;if(null==s||!r||!i)return"top-center";if(!this._isScreenLocationWithinView(s,r))return this._get("currentAlignment")||"top-center";function l(e){return parseInt(e.replace(/[^-\d\.]/g,""),10)}const a=o?window.getComputedStyle(o,null):null,c=a?l(a.getPropertyValue("max-height")):0,u=a?l(a.getPropertyValue("height")):0,{height:d,width:h}=i.getBoundingClientRect(),p=h+t,g=Math.max(d,c,u)+t,m=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"right",view:r}),f=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"left",view:r}),v=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"top",view:r}),_=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:s,side:"bottom",view:r});return f?v?"bottom-right":"top-right":m?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 O(this.container)&&t.reverse(),e.replace(/leading/gi,t[0]).replace(/trailing/gi,t[1])}_callDockPosition(e){return"function"==typeof e?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_wouldDockTo(){return this.dockEnabled?null:this._getDockPosition()}_calculateAutoDockPosition(e){if("auto"!==e)return e;const t=this.viewModel?.view,i=O(this.container)?"top-left":"top-right";if(!t)return i;const o=t.padding||{left:0,right:0,top:0,bottom:0},n=t.width-o.left-o.right,{breakpoints:s}=t;return s&&n<=s.xsmall?"bottom-center":i}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!this._containerNode)return;const{screenLocation:t}=this.viewModel,{width:i}=this._containerNode.getBoundingClientRect(),o=this._calculatePositionStyle(t,i);o&&Object.assign(this._containerNode.style,o)}_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,o){const{currentAlignment:n,_pointerOffsetInPx:s}=this;if(!i)return;const{padding:r}=i,l=o/2,a=i.height-t,c=i.width-e;return"bottom-center"===n?{top:t+s-r.top,left:e-l-r.left}:"top-left"===n?{bottom:a+s-r.bottom,right:c+s-r.right}:"bottom-left"===n?{top:t+s-r.top,right:c+s-r.right}:"top-right"===n?{bottom:a+s-r.bottom,left:e+s-r.left}:"bottom-right"===n?{top:t+s-r.top,left:e+s-r.left}:"top-center"===n?{bottom:a+s-r.bottom,left:e-l-r.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(null==e||!t)return;const n=this._calculateFullWidth(t),s=this._calculateAlignmentPosition(e.x,e.y,o,n);return s?{top:void 0!==s.top?`${s.top}px`:"auto",left:void 0!==s.left?`${s.left}px`:"auto",bottom:void 0!==s.bottom?`${s.bottom}px`:"auto",right:void 0!==s.right?`${s.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[o,n]=e,[s,r]=t,{width:l=0,height:a=0}=i??{};return o<=l&&s>l||o>l&&s<=l||n<=a&&r>a||n>a&&r<=a}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,n=i.top+i.bottom,s=[],r=[];s[0]=e[0]-o,s[1]=e[1]-n,r[0]=t[0]-o,r[1]=t[1]-n;const{dockOptions:l}=this,a=l.breakpoint;this._dockingThresholdCrossed(s,r,a)&&this._setDockEnabledForViewSize(l),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");if(t.length){t[0].focus()}}_actionsMenuNodeUpdated(e){if(this._actionsMenuNode=e,!e||!this._focusFirstAction)return;this._focusFirstAction=!1;const t=e.querySelectorAll("li");if(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){const t=e.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:n}=i;if(isNaN(o)||isNaN(n))return!1;if(!t)return!1;const s=t.hasOwnProperty("width")&&o<=(t.width??0),r=t.hasOwnProperty("height")&&n<=(t.height??0);return s||r}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}_getPageText(e,t){return this.featureNavigationVisible?P(this.messages.pageText,{index:t+1,total:e}):null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t&&t.ui&&t.ui.remove(e,D),e.destroy(),this._spinner=null)}_createSpinner(e){e&&(this._spinner=new m({view:e}),e.ui.add(this._spinner,{key:D,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.dataset.actionUid,{allActions:i}=this.viewModel,o=i.findIndex((e=>e.uid===t)),n=i.getItemAt(o);n&&"toggle"===n.type&&(n.value=!n.value),this.actionsMenuOpen=!1,this.viewModel.triggerAction(o)}_selectFeature(e){const t=j(e.currentTarget);null==t||isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuButton=!0,this.scheduleRender()}_next(){this.next()}_previous(){this.previous()}};function j(e){return e?.["data-feature-index"]}e([d({readOnly:!0})],U.prototype,"actionsMenuId",null),e([d({readOnly:!0})],U.prototype,"actionsMenuButtonId",null),e([d({readOnly:!0})],U.prototype,"featureMenuId",null),e([d({readOnly:!0})],U.prototype,"titleId",null),e([d({readOnly:!0})],U.prototype,"contentId",null),e([d({readOnly:!0})],U.prototype,"hasContent",null),e([d({readOnly:!0})],U.prototype,"featureNavigationVisible",null),e([d({readOnly:!0})],U.prototype,"collapsible",null),e([d({readOnly:!0})],U.prototype,"featureMenuVisible",null),e([d({readOnly:!0})],U.prototype,"contentCollapsed",null),e([d({readOnly:!0})],U.prototype,"dividedActions",null),e([d({readOnly:!0,dependsOn:["_flowItems.length"]})],U.prototype,"_activeFlowItemWidget",null),e([d()],U.prototype,"actions",null),e([d()],U.prototype,"actionsMenuOpen",null),e([d()],U.prototype,"alignment",void 0),e([d()],U.prototype,"autoCloseEnabled",null),e([d()],U.prototype,"autoOpenEnabled",null),e([d()],U.prototype,"defaultPopupTemplateEnabled",null),e([d()],U.prototype,"content",null),e([d()],U.prototype,"collapsed",void 0),e([d()],U.prototype,"collapseEnabled",void 0),e([d({readOnly:!0})],U.prototype,"currentAlignment",null),e([d({readOnly:!0})],U.prototype,"currentDockPosition",null),e([d()],U.prototype,"dockOptions",null),e([d()],U.prototype,"dockEnabled",void 0),e([d({readOnly:!0})],U.prototype,"featureCount",null),e([d()],U.prototype,"featureMenuOpen",null),e([d()],U.prototype,"features",null),e([d()],U.prototype,"goToOverride",null),e([d()],U.prototype,"headingLevel",void 0),e([d()],U.prototype,"highlightEnabled",null),e([d()],U.prototype,"location",null),e([d()],U.prototype,"label",null),e([d()],U.prototype,"maxInlineActions",void 0),e([d(),F("esri/widgets/Popup/t9n/Popup")],U.prototype,"messages",void 0),e([d(),F("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([d()],U.prototype,"promises",null),e([d({readOnly:!0})],U.prototype,"selectedFeature",null),e([d()],U.prototype,"selectedFeatureIndex",null),e([d({readOnly:!0})],U.prototype,"selectedFeatureWidget",null),e([d()],U.prototype,"spinnerEnabled",void 0),e([d()],U.prototype,"title",null),e([d()],U.prototype,"updateLocationEnabled",null),e([d()],U.prototype,"view",null),e([d({type:M}),C(["triggerAction","trigger-action"])],U.prototype,"viewModel",void 0),e([d()],U.prototype,"visible",null),e([d()],U.prototype,"visibleElements",void 0),e([h("visibleElements")],U.prototype,"castVisibleElements",null),e([k()],U.prototype,"_close",null),e([k()],U.prototype,"_toggleDockEnabled",null),e([k()],U.prototype,"_toggleFeatureMenu",null),e([k()],U.prototype,"_toggleActionsMenu",null),e([k()],U.prototype,"_triggerAction",null),e([k()],U.prototype,"_selectFeature",null),e([k()],U.prototype,"_next",null),e([k()],U.prototype,"_previous",null),U=e([p("esri.widgets.Popup")],U);const W=U;export{W as default};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2462],{38171:(e,t,s)=>{s.d(t,{Z:()=>f});var r=s(43697),n=s(66577),i=s(51773),l=s(9790),o=s(2368),a=s(96674),u=s(99001),h=s(5600),c=(s(75215),s(67676),s(80442),s(52011)),d=s(33955);function p(e){if(null==e)return null;const t={};for(const s in e){const r=e[s];r&&(t[s]=r.toJSON())}return 0!==Object.keys(t).length?t:null}let m=class extends((0,o.J)(a.wq)){constructor(...e){super(...e),this.isAggregate=!1,this.layer=null,this.popupTemplate=null,this.sourceLayer=null,Object.defineProperty(this,"uid",{value:(0,u.D)(),configurable:!0})}normalizeCtorArgs(e,t,s,r){return e&&!e.declaredClass?e:{geometry:e,symbol:t,attributes:s,popupTemplate:r}}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),this._notifyLayer("geometry",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;for(const t of[this.sourceLayer,this.layer])if(t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const s=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",s,t,e)}else this.attributes={[e]:t},this._notifyLayer("attributes",void 0,t,e)}getObjectId(){return this.sourceLayer&&"objectIdField"in this.sourceLayer&&this.sourceLayer.objectIdField?this.getAttribute(this.sourceLayer.objectIdField):null}toJSON(){return{aggregateGeometries:p(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:{...this.attributes},popupTemplate:this.popupTemplate&&this.popupTemplate.toJSON()}}notifyGeometryChanged(){this._notifyLayer("geometry",this.geometry,this.geometry)}notifyMeshTransformChanged(){null!=this.geometry&&"mesh"===this.geometry.type&&this._notifyLayer("transform",this.geometry.transform,this.geometry.transform)}_notifyLayer(e,t,s,r){if(!this.layer||!("graphicChanged"in this.layer))return;const n={graphic:this,property:e,oldValue:t,newValue:s};"attributes"===e&&(n.attributeName=r),this.layer.graphicChanged(n)}};(0,r._)([(0,h.Cb)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const s in e){const r=(0,d.im)(e[s]);r&&(t[s]=r)}return 0!==Object.keys(t).length?t:null}}})],m.prototype,"aggregateGeometries",null),(0,r._)([(0,h.Cb)({value:null})],m.prototype,"attributes",null),(0,r._)([(0,h.Cb)({value:null,types:n.qM,json:{read:d.im}})],m.prototype,"geometry",null),(0,r._)([(0,h.Cb)({type:Boolean})],m.prototype,"isAggregate",void 0),(0,r._)([(0,h.Cb)({clonable:"reference"})],m.prototype,"layer",void 0),(0,r._)([(0,h.Cb)({type:i.Z})],m.prototype,"popupTemplate",void 0),(0,r._)([(0,h.Cb)({clonable:"reference"})],m.prototype,"sourceLayer",void 0),(0,r._)([(0,h.Cb)({value:null,types:l.LB})],m.prototype,"symbol",null),(0,r._)([(0,h.Cb)({type:Boolean,value:!0})],m.prototype,"visible",null),m=(0,r._)([(0,c.j)("esri.Graphic")],m),(m||(m={})).generateUID=u.D;const f=m},92835:(e,t,s)=>{s.d(t,{Z:()=>f});var r,n=s(43697),i=s(96674),l=s(70586),o=s(35463),a=s(5600),u=(s(75215),s(67676),s(80442),s(71715)),h=s(52011),c=s(30556);let d=r=class extends i.wq{static get allTime(){return p}static get empty(){return m}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?e.getTime():null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?e.getTime():null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=null!=this.start?this.start.getTime():this.start,s=null!=this.end?this.end.getTime():this.end,r=null!=e.start?e.start.getTime():e.start,n=null!=e.end?e.end.getTime():e.end;return t===r&&s===n}expandTo(e){if(this.isEmpty||this.isAllTime)return this.clone();const t=(0,l.yw)(this.start,(t=>(0,o.JE)(t,e))),s=(0,l.yw)(this.end,(t=>{const s=(0,o.JE)(t,e);return t.getTime()===s.getTime()?s:(0,o.Nm)(s,1,e)}));return new r({start:t,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return r.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,s=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,i=e.end?.getTime()??1/0;let l,o;if(n>=t&&n<=s?l=n:t>=n&&t<=i&&(l=t),s>=n&&s<=i?o=s:i>=t&&i<=s&&(o=i),null!=l&&null!=o&&!isNaN(l)&&!isNaN(o)){const e=new r;return e.start=l===-1/0?null:new Date(l),e.end=o===1/0?null:new Date(o),e}return r.empty}offset(e,t){if(this.isEmpty||this.isAllTime)return this.clone();const s=new r,{start:n,end:i}=this;return null!=n&&(s.start=(0,o.Nm)(n,e,t)),null!=i&&(s.end=(0,o.Nm)(i,e,t)),s}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return p.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,s=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:s})}};(0,n._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,n._)([(0,u.r)("end")],d.prototype,"readEnd",null),(0,n._)([(0,c.c)("end")],d.prototype,"writeEnd",null),(0,n._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,n._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,n._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,n._)([(0,u.r)("start")],d.prototype,"readStart",null),(0,n._)([(0,c.c)("start")],d.prototype,"writeStart",null),d=r=(0,n._)([(0,h.j)("esri.TimeExtent")],d);const p=new d,m=new d({start:void 0,end:void 0}),f=d},84552:(e,t,s)=>{s.d(t,{Z:()=>d});var r=s(43697),n=s(2368),i=s(96674),l=s(35463),o=s(5600),a=(s(75215),s(67676),s(80442),s(36030)),u=s(52011),h=s(78981);let c=class extends((0,n.J)(i.wq)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,l.rJ)(this.value,this.unit,"milliseconds")}};(0,r._)([(0,a.J)(h.v,{nonNullable:!0})],c.prototype,"unit",void 0),(0,r._)([(0,o.Cb)({type:Number,json:{write:!0},nonNullable:!0})],c.prototype,"value",void 0),c=(0,r._)([(0,u.j)("esri.TimeInterval")],c);const d=c},5732:(e,t,s)=>{s.d(t,{c:()=>r});var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}},46791:(e,t,s)=>{s.d(t,{Z:()=>N});var r,n=s(43697),i=s(3894),l=s(32448),o=s(22974),a=s(70586),u=s(71143);!function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"}(r||(r={}));var h,c=s(1654),d=s(75215),p=s(58971),m=s(5600),f=s(52421),y=s(52011),g=s(10661);const b=new u.Z(class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}},void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1})),_=()=>{};function v(e){return e?e instanceof A?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function w(e){if(e&&e.length)return e[0]}function x(e,t,s,r){const n=Math.min(e.length-s,t.length-r);let i=0;for(;i<n&&e[s+i]===t[r+i];)i++;return i}function C(e,t,s,r){t&&t.forEach(((t,n,i)=>{e.push(t),C(e,s.call(r,t,n,i),s,r)}))}const E=new Set,I=new Set,S=new Set,O=new Map;let T=0,A=h=class extends l.Z.EventedAccessor{static isCollection(e){return null!=e&&e instanceof h}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new g.s,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:T++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof h?{items:e}:e:{}}destroy(){this._removeAllRaw()}*[Symbol.iterator](){yield*this.items}get items(){return(0,p.it)(this._observable),this._items}set items(e){this._emitBeforeChanges(r.ADD)||(this._splice(0,this.length,v(e)),this._emitAfterChanges(r.ADD))}hasEventListener(e){return"change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e)}on(e,t){if("change"===e){const e=this._chgListeners,s={removed:!1,callback:t};return e.push(s),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),{remove(){this.remove=_,s.removed=!0,e.splice(e.indexOf(s),1)}}}return this._emitter.on(e,t)}once(e,t){const s=this.on(e,t);return{remove(){s.remove()}}}add(e,t){if((0,p.it)(this._observable),this._emitBeforeChanges(r.ADD))return this;const s=this.getNextIndex(t??null);return this._splice(s,0,[e]),this._emitAfterChanges(r.ADD),this}addMany(e,t=this._items.length){if((0,p.it)(this._observable),!e||!e.length)return this;if(this._emitBeforeChanges(r.ADD))return this;const s=this.getNextIndex(t);return this._splice(s,0,v(e)),this._emitAfterChanges(r.ADD),this}at(e){if((0,p.it)(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return[];const e=this._removeAllRaw();return this._emitAfterChanges(r.REMOVE),e}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return(0,p.it)(this._observable),this._createNewInstance({items:this._items.map(o.d9)})}concat(...e){(0,p.it)(this._observable);const t=e.map(v);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return;const s=(0,a.j0)(this._splice(0,this.length)),n=s.length;for(let r=0;r<n;r++)e.call(t,s[r],r,s);this._emitAfterChanges(r.REMOVE)}every(e,t){return(0,p.it)(this._observable),this._items.every(e,t)}filter(e,t){let s;return(0,p.it)(this._observable),s=2===arguments.length?this._items.filter(e,t):this._items.filter(e),this._createNewInstance({items:s})}find(e,t){return(0,p.it)(this._observable),this._items.find(e,t)}findIndex(e,t){return(0,p.it)(this._observable),this._items.findIndex(e,t)}flatten(e,t){(0,p.it)(this._observable);const s=[];return C(s,this,e,t),new h(s)}forEach(e,t){return(0,p.it)(this._observable),this._items.forEach(e,t)}getItemAt(e){return(0,p.it)(this._observable),this._items[e]}getNextIndex(e){(0,p.it)(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return(0,p.it)(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return(0,p.it)(this._observable),this._items.indexOf(e,t)}join(e=","){return(0,p.it)(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return(0,p.it)(this._observable),this._items.lastIndexOf(e,t)}map(e,t){(0,p.it)(this._observable);const s=this._items.map(e,t);return new h({items:s})}reorder(e,t=this.length-1){(0,p.it)(this._observable);const s=this.indexOf(e);if(-1!==s){if(t<0?t=0:t>=this.length&&(t=this.length-1),s!==t){if(this._emitBeforeChanges(r.MOVE))return e;this._splice(s,1),this._splice(t,0,[e]),this._emitAfterChanges(r.MOVE)}return e}}pop(){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return;const e=w(this._splice(this.length-1,1));return this._emitAfterChanges(r.REMOVE),e}push(...e){return(0,p.it)(this._observable),this._emitBeforeChanges(r.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(r.ADD)),this.length}reduce(e,t){(0,p.it)(this._observable);const s=this._items;return 2===arguments.length?s.reduce(e,t):s.reduce(e)}reduceRight(e,t){(0,p.it)(this._observable);const s=this._items;return 2===arguments.length?s.reduceRight(e,t):s.reduceRight(e)}remove(e){return(0,p.it)(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if((0,p.it)(this._observable),e<0||e>=this.length||this._emitBeforeChanges(r.REMOVE))return;const t=w(this._splice(e,1));return this._emitAfterChanges(r.REMOVE),t}removeMany(e){if((0,p.it)(this._observable),!e||!e.length||this._emitBeforeChanges(r.REMOVE))return[];const t=e instanceof h?e.toArray():e,s=this._items,n=[],i=t.length;for(let e=0;e<i;e++){const r=t[e],i=s.indexOf(r);if(i>-1){const r=1+x(t,s,e+1,i+1),l=this._splice(i,r);l&&l.length>0&&n.push.apply(n,l),e+=r-1}}return this._emitAfterChanges(r.REMOVE),n}reverse(){if((0,p.it)(this._observable),this._emitBeforeChanges(r.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(r.MOVE),this}shift(){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return;const e=w(this._splice(0,1));return this._emitAfterChanges(r.REMOVE),e}slice(e=0,t=this.length){return(0,p.it)(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return(0,p.it)(this._observable),this._items.some(e,t)}sort(e){if((0,p.it)(this._observable),!this.length||this._emitBeforeChanges(r.MOVE))return this;const t=(0,a.j0)(this._splice(0,this.length));return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(r.MOVE),this}splice(e,t,...s){(0,p.it)(this._observable);const n=(t?r.REMOVE:0)|(s.length?r.ADD:0);if(this._emitBeforeChanges(n))return[];const i=this._splice(e,t,s)||[];return this._emitAfterChanges(n),i}toArray(){return(0,p.it)(this._observable),this._items.slice()}toJSON(){return(0,p.it)(this._observable),this.toArray()}toLocaleString(){return(0,p.it)(this._observable),this._items.toLocaleString()}toString(){return(0,p.it)(this._observable),this._items.toString()}unshift(...e){return(0,p.it)(this._observable),!e.length||this._emitBeforeChanges(r.ADD)||(this._splice(0,0,e),this._emitAfterChanges(r.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,s){const r=this._items,n=this.itemType;let i,l;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._timer=(0,c.Os)((()=>this._dispatchChange()))),t){if(l=r.splice(e,t),this.hasEventListener("before-remove")){const t=b.acquire();t.target=this,t.cancellable=!0;for(let s=0,n=l.length;s<n;s++)i=l[s],t.reset(i),this.emit("before-remove",t),t.defaultPrevented&&(l.splice(s,1),r.splice(e,0,i),e+=1,s-=1,n-=1);b.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=b.acquire();e.target=this,e.cancellable=!1;const t=l.length;for(let s=0;s<t;s++)e.reset(l[s]),this.emit("after-remove",e);b.release(e)}}if(s&&s.length){if(n){const e=[];for(const t of s){const s=n.ensureType(t);null==s&&null!=t||e.push(s)}s=e}const t=this.hasEventListener("before-add"),i=this.hasEventListener("after-add"),l=e===this.length;if(t||i){const n=b.acquire();n.target=this,n.cancellable=!0;const o=b.acquire();o.target=this,o.cancellable=!1;for(const a of s)t?(n.reset(a),this.emit("before-add",n),n.defaultPrevented||(l?r.push(a):r.splice(e++,0,a),this._set("length",r.length),i&&(o.reset(a),this.emit("after-add",o)))):(l?r.push(a):r.splice(e++,0,a),this._set("length",r.length),o.reset(a),this.emit("after-add",o));b.release(o),b.release(n)}else{if(l)for(const e of s)r.push(e);else r.splice(e,0,...s);this._set("length",r.length)}}return(s&&s.length||l&&l.length)&&this._notifyChangeEvent(s,l),l}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const s=b.acquire();s.target=this,s.cancellable=!0,s.type=e,this.emit("before-changes",s),t=s.defaultPrevented,b.release(s)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=b.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),b.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),!this._notifications)return;const e=this._notifications;this._notifications=null;for(const t of e){const e=t.changes;E.clear(),I.clear(),S.clear();for(const{added:t,removed:s}of e){if(t)if(0===S.size&&0===I.size)for(const e of t)E.add(e);else for(const e of t)I.has(e)?(S.add(e),I.delete(e)):S.has(e)||E.add(e);if(s)if(0===S.size&&0===E.size)for(const e of s)I.add(e);else for(const e of s)E.has(e)?E.delete(e):(S.delete(e),I.add(e))}const s=i.Z.acquire();E.forEach((e=>{s.push(e)}));const r=i.Z.acquire();I.forEach((e=>{r.push(e)}));const n=this._items,l=t.items,o=i.Z.acquire();if(S.forEach((e=>{l.indexOf(e)!==n.indexOf(e)&&o.push(e)})),t.listeners&&(s.length||r.length||o.length)){const e={target:this,added:s,removed:r,moved:o},n=t.listeners.length;for(let s=0;s<n;s++){const r=t.listeners[s];r.removed||r.callback.call(this,e)}}i.Z.release(s),i.Z.release(r),i.Z.release(o)}E.clear(),I.clear(),S.clear()}};A.ofType=e=>{if(!e)return h;if(O.has(e))return O.get(e);let t=null;if("function"==typeof e)t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const s in e.typeMap){const r=e.typeMap[s].prototype.declaredClass;t?t+=` | ${r}`:t=r}let s=class extends h{};return(0,n._)([(0,f.c)({Type:e,ensureType:"function"==typeof e?(0,d.se)(e):(0,d.N7)(e)})],s.prototype,"itemType",void 0),s=(0,n._)([(0,y.j)(`esri.core.Collection<${t}>`)],s),O.set(e,s),s},(0,n._)([(0,m.Cb)()],A.prototype,"length",void 0),(0,n._)([(0,m.Cb)()],A.prototype,"items",null),A=h=(0,n._)([(0,y.j)("esri.core.Collection")],A);const N=A},57435:(e,t,s)=>{s.d(t,{Z:()=>u});var r=s(43697),n=s(46791),i=(s(20102),s(92604),s(26258),s(87538)),l=s(5600),o=s(52011);let a=class extends n.Z{constructor(e){super(e),this.getCollections=null}initialize(){this.own((0,i.EH)((()=>this._refresh())))}destroy(){this.getCollections=null}_refresh(){const e=null!=this.getCollections?this.getCollections():null;if(null==e)return void this.removeAll();let t=0;for(const s of e)null!=s&&(t=this._processCollection(t,s));this.splice(t,this.length)}_createNewInstance(e){return new n.Z(e)}_processCollection(e,t){if(!t)return e;const s=this.itemFilterFunction??(e=>!!e);for(const r of t)if(r){if(s(r)){const t=this.indexOf(r,e);t>=0?t!==e&&this.reorder(r,e):this.add(r,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(r);if(Array.isArray(t))for(const s of t)e=this._processCollection(e,s);else e=this._processCollection(e,t)}}return e}};(0,r._)([(0,l.Cb)()],a.prototype,"getCollections",void 0),(0,r._)([(0,l.Cb)()],a.prototype,"getChildrenFunction",void 0),(0,r._)([(0,l.Cb)()],a.prototype,"itemFilterFunction",void 0),a=(0,r._)([(0,o.j)("esri.core.CollectionFlattener")],a);const u=a},3920:(e,t,s)=>{s.d(t,{p:()=>u,r:()=>h});var r=s(43697),n=s(15923),i=s(61247),l=s(5600),o=s(52011),a=s(72762);const u=e=>{let t=class extends e{constructor(){super(...arguments),this._handles=new i.Z,this._updatingHandles=new a.t}destroy(){this.destroyed||(this._handles.destroy(),this._updatingHandles.destroy())}get handles(){return this._handles}get updatingHandles(){return this._updatingHandles}};return(0,r._)([(0,l.Cb)({readOnly:!0})],t.prototype,"handles",null),(0,r._)([(0,l.Cb)({readOnly:!0})],t.prototype,"updatingHandles",null),t=(0,r._)([(0,o.j)("esri.core.HandleOwner")],t),t};let h=class extends(u(n.Z)){};h=(0,r._)([(0,o.j)("esri.core.HandleOwner")],h)},52421:(e,t,s)=>{function r(e){return(t,s)=>{t[s]=e}}s.d(t,{c:()=>r})},17445:(e,t,s)=>{s.d(t,{N1:()=>d,YP:()=>a,Z_:()=>f,gx:()=>u,nn:()=>y,on:()=>c,tX:()=>g});var r=s(91460),n=s(50758),i=s(70586),l=s(95330),o=s(26258);function a(e,t,s={}){return h(e,t,s,p)}function u(e,t,s={}){return h(e,t,s,m)}function h(e,t,s={},r){let n=null;const l=s.once?(e,s)=>{r(e)&&((0,i.hw)(n),t(e,s))}:(e,s)=>{r(e)&&t(e,s)};if(n=(0,o.aQ)(e,l,s.sync,s.equals),s.initial){const t=e();l(t,t)}return n}function c(e,t,s,l={}){let o=null,u=null,h=null;function c(){o&&u&&(u.remove(),l.onListenerRemove?.(o),o=null,u=null)}function d(e){l.once&&l.once&&(0,i.hw)(h),s(e)}const p=a(e,((e,s)=>{c(),(0,r.vT)(e)&&(o=e,u=(0,r.on)(e,t,d),l.onListenerAdd?.(e))}),{sync:l.sync,initial:!0});return h=(0,n.kB)((()=>{p.remove(),c()})),h}function d(e,t){return function(e,t,s){if((0,l.Hc)(s))return Promise.reject((0,l.zE)());const r=e();if(t?.(r))return Promise.resolve(r);let o=null;function a(){o=(0,i.hw)(o)}return new Promise(((r,i)=>{o=(0,n.AL)([(0,l.fu)(s,(()=>{a(),i((0,l.zE)())})),h(e,(e=>{a(),r(e)}),{sync:!1,once:!0},t??p)])}))}(e,m,t)}function p(e){return!0}function m(e){return!!e}s(87538);const f={sync:!0},y={initial:!0},g={sync:!0,initial:!0}},72762:(e,t,s)=>{s.d(t,{t:()=>h});var r=s(43697),n=s(15923),i=s(61247),l=s(17445),o=s(1654),a=s(5600),u=s(52011);let h=class extends n.Z{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._handles=new i.Z,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll(),this._handles.destroy()}add(e,t,s={}){return this._installWatch(e,t,s,l.YP)}addWhen(e,t,s={}){return this._installWatch(e,t,s,l.gx)}addOnCollectionChange(e,t,{initial:s=!1,final:r=!1}={}){const n=++this._handleId;return this._handles.add([(0,l.on)(e,"after-changes",this._createSyncUpdatingCallback(),l.Z_),(0,l.on)(e,"change",t,{onListenerAdd:s?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:r?e=>t({added:[],removed:e.toArray()}):void 0})],n),{remove:()=>this._handles.remove(n)}}addPromise(e){if(null==e)return e;const t=++this._handleId;this._handles.add({remove:()=>{this._pendingPromises.delete(e)&&(0!==this._pendingPromises.size||this._handles.has(c)||this._set("updating",!1))}},t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this._handles.remove(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this._handles.removeAll(),this._set("updating",!1)}_installWatch(e,t,s={},r){const n=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,n);const i=r(e,t,s);return this._handles.add(i,n),{remove:()=>this._handles.remove(n)}}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),r=(0,l.YP)(e,s,{sync:!0,equals:()=>!1});return this._handles.add(r,t),r}_createSyncUpdatingCallback(){return()=>{this._handles.remove(c),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this._handles.add((0,o.Os)((()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this._handles.remove(c))})),c)}}};(0,r._)([(0,a.Cb)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,r._)([(0,u.j)("esri.core.support.WatchUpdatingTracking")],h);const c=-42},35463:(e,t,s)=>{s.d(t,{JE:()=>l,Nm:()=>i,rJ:()=>o}),s(80442);const r={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},n={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function i(e,t,s){const r=new Date(e.getTime());if(t&&s){const e=n[s],{getter:i,setter:l,multiplier:o}=e;if("months"===s){const e=function(e,t){const s=new Date(e,t+1,1);return s.setDate(0),s.getDate()}(r.getFullYear(),r.getMonth()+t);r.getDate()>e&&r.setDate(e)}r[l](r[i]()+t*o)}return r}function l(e,t){switch(t){case"milliseconds":return new Date(e.getTime());case"seconds":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());case"minutes":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes());case"hours":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate());case"weeks":return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case"months":return new Date(e.getFullYear(),e.getMonth(),1);case"years":return new Date(e.getFullYear(),0,1);case"decades":return new Date(e.getFullYear()-e.getFullYear()%10,0,1);case"centuries":return new Date(e.getFullYear()-e.getFullYear()%100,0,1);default:return new Date}}function o(e,t,s){return 0===e?0:e*r[t]/r[s]}},91040:(e,t,s)=>{s.d(t,{yZ:()=>i});var r=s(67900);const n=96;function i(e,t){const s=t||e.extent,i=e.width,l=(0,r.c9)(s&&s.spatialReference);return s&&i?s.width/i*l*r.hd*n:0}},25906:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Ce});var r=s(43697),n=s(68773),i=s(38171),l=s(51773),o=s(3172),a=s(46791),u=s(57435),h=s(35454),c=s(22974),d=s(16453),p=s(95330),m=s(17445),f=s(17452),y=s(5600),g=s(75215),b=s(71715),_=s(52011),v=s(30556),w=s(76169),x=s(6570),C=s(82971),E=s(91040),I=s(8744),S=s(87085),O=s(71612),T=s(38009),A=s(16859),N=s(34760),F=s(72965),M=s(28294),L=s(52162),D=s(66677),R=s(21506),j=s(15923),P=s(3920),U=s(67676);s(80442);const Z={visible:"visibleSublayers"};let q=class extends((0,P.p)(j.Z)){constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.handles.remove("layer"),e&&this.handles.add([e.sublayers.on("change",(()=>this.notifyChange("visibleSublayers"))),e.on("wms-sublayer-update",(e=>this.notifyChange(Z[e.propertyName])))],"layer"))}get layers(){return this.visibleSublayers.filter((({name:e})=>e)).map((({name:e})=>e)).join()}get version(){this.commitProperty("layers");const e=this.layer;return e&&e.commitProperty("imageTransparency"),(this._get("version")||0)+1}get visibleSublayers(){const{layer:e,scale:t}=this,s=e?.sublayers,r=[],n=e=>{const{minScale:s,maxScale:i,sublayers:l,visible:o}=e;o&&(0===t||(0===s||t<=s)&&(0===i||t>=i))&&(l?l.forEach(n):r.push(e))};return s?.forEach(n),r}toJSON(){const{layer:e,layers:t}=this,{imageFormat:s,imageTransparency:r,version:n}=e;return{format:s,request:"GetMap",service:"WMS",styles:"",transparent:r?"TRUE":"FALSE",version:n,layers:t}}};(0,r._)([(0,y.Cb)()],q.prototype,"layer",null),(0,r._)([(0,y.Cb)({readOnly:!0})],q.prototype,"layers",null),(0,r._)([(0,y.Cb)({type:Number})],q.prototype,"scale",void 0),(0,r._)([(0,y.Cb)({readOnly:!0})],q.prototype,"version",null),(0,r._)([(0,y.Cb)({readOnly:!0})],q.prototype,"visibleSublayers",null),q=(0,r._)([(0,_.j)("esri.layers.support.ExportWMSImageParameters")],q);var V,B=s(90082),k=s(10699),H=s(90578);let W=0,J=V=class extends((0,k.IG)(d.w)){constructor(e){super(e),this.dimensions=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.addHandles([(0,m.on)((()=>this.sublayers),"after-add",(({item:e})=>{e.parent=this,e.layer=this.layer}),m.Z_),(0,m.on)((()=>this.sublayers),"after-remove",(({item:e})=>{e.layer=e.parent=null}),m.Z_),(0,m.YP)((()=>this.sublayers),((e,t)=>{if(t)for(const e of t)e.layer=e.parent=null;if(e)for(const t of e)t.parent=this,t.layer=this.layer}),m.Z_)])}get description(){return this._get("description")}set description(e){this._set("description",e)}get fullExtent(){return this._get("fullExtent")}set fullExtent(e){this._set("fullExtent",e)}readExtent(e,t){return(e=t.extent)?x.Z.fromJSON(e):null}get id(){return this._get("id")??W++}set id(e){this._set("id",e)}readLegendUrl(e,t){return t?.legendUrl??t?.legendURL??null}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get name(){return this._get("name")}set name(e){this._set("name",e)}castSublayers(e){return(0,g.se)(a.Z.ofType(V),e)}get title(){return this._get("title")}set title(e){this._set("title",e)}get visible(){return this._get("visible")}set visible(e){this._setAndNotifyLayer("visible",e)}clone(){const e=new V;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(e.fullExtents=this.fullExtents?.map((e=>e.clone()))??null),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(e.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("name")&&(e.name=this.name),this.hasOwnProperty("parent")&&(e.parent=this.parent),this.hasOwnProperty("queryable")&&(e.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(e.sublayers=this.sublayers&&this.sublayers.map((e=>e.clone()))),this.hasOwnProperty("spatialReferences")&&(e.spatialReferences=this.spatialReferences?.map((e=>e))),this.hasOwnProperty("visible")&&(e.visible=this.visible),this.hasOwnProperty("title")&&(e.title=this.title),e}_setAndNotifyLayer(e,t){const s=this.layer;this._get(e)!==t&&(this._set(e,t),s&&s.emit("wms-sublayer-update",{propertyName:e,id:this.id}))}};(0,r._)([(0,y.Cb)()],J.prototype,"description",null),(0,r._)([(0,y.Cb)({readOnly:!0})],J.prototype,"dimensions",void 0),(0,r._)([(0,y.Cb)({value:null})],J.prototype,"fullExtent",null),(0,r._)([(0,b.r)("fullExtent",["extent"])],J.prototype,"readExtent",null),(0,r._)([(0,y.Cb)()],J.prototype,"fullExtents",void 0),(0,r._)([(0,y.Cb)({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],J.prototype,"id",null),(0,r._)([(0,y.Cb)({type:String,json:{origins:{"web-document":{read:{source:["legendUrl","legendURL"]},write:{target:"legendUrl",ignoreOrigin:!0}}},read:{source:"legendURL"},write:{ignoreOrigin:!0}}})],J.prototype,"legendUrl",void 0),(0,r._)([(0,b.r)(["web-document"],"legendUrl")],J.prototype,"readLegendUrl",null),(0,r._)([(0,y.Cb)({value:!0,type:Boolean,json:{read:{source:"showLegend"},write:{target:"showLegend"},origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],J.prototype,"legendEnabled",void 0),(0,r._)([(0,y.Cb)()],J.prototype,"layer",void 0),(0,r._)([(0,y.Cb)()],J.prototype,"maxScale",void 0),(0,r._)([(0,y.Cb)()],J.prototype,"minScale",void 0),(0,r._)([(0,y.Cb)({readOnly:!0})],J.prototype,"effectiveScaleRange",null),(0,r._)([(0,y.Cb)({type:String,value:null,json:{read:{source:"name"},write:{ignoreOrigin:!0}}})],J.prototype,"name",null),(0,r._)([(0,y.Cb)()],J.prototype,"parent",void 0),(0,r._)([(0,y.Cb)({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],J.prototype,"popupEnabled",void 0),(0,r._)([(0,y.Cb)({type:Boolean,json:{write:{ignoreOrigin:!0}}})],J.prototype,"queryable",void 0),(0,r._)([(0,y.Cb)()],J.prototype,"sublayers",void 0),(0,r._)([(0,H.p)("sublayers")],J.prototype,"castSublayers",null),(0,r._)([(0,y.Cb)({type:[Number],json:{read:{source:"spatialReferences"}}})],J.prototype,"spatialReferences",void 0),(0,r._)([(0,y.Cb)({type:String,value:null,json:{write:{ignoreOrigin:!0}}})],J.prototype,"title",null),(0,r._)([(0,y.Cb)({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],J.prototype,"visible",null),J=V=(0,r._)([(0,_.j)("esri.layers.support.WMSSublayer")],J);const Y=J;var G=s(20102);const $={84:4326,83:4269,27:4267};function z(e){if(!e)return null;const t={idCounter:-1};"string"==typeof e&&(e=(new DOMParser).parseFromString(e,"text/xml"));const s=e.documentElement;if("ServiceExceptionReport"===s.nodeName){const e=Array.prototype.slice.call(s.childNodes).map((e=>e.textContent)).join("\r\n");throw new G.Z("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",e)}const r=ee("Capability",s),n=ee("Service",s),i=r&&ee("Request",r);if(!r||!n||!i)return null;const l=ee("Layer",r);if(!l)return null;const o="WMS_Capabilities"===s.nodeName||"WMT_MS_Capabilities"===s.nodeName?s.getAttribute("version"):"1.3.0",a=se("Title",n,"")||se("Name",n,""),u=se("AccessConstraints",n,""),h=/^none$/i.test(u)?"":u,c=se("Abstract",n,""),d=parseInt(se("MaxWidth",n,"5000"),10),p=parseInt(se("MaxHeight",n,"5000"),10),m=ie(i,"GetMap"),f=ne(i,"GetMap"),y=oe(l,o,t);if(!y)return null;let g,b=0;const _=Array.prototype.slice.call(r.childNodes),v=y.sublayers??[],w=e=>{null!=e&&v.push(e)};_.forEach((e=>{"Layer"===e.nodeName&&(0===b?g=e:1===b?(y.name&&(y.name="",w(oe(g,o,t))),w(oe(e,o,t))):w(oe(e,o,t)),b++)}));let C=y.sublayers,E=y.extent;const I=y.fullExtents??[];if(C||(C=[]),0===C.length&&C.push(y),!E){const e=new x.Z(C[0].extent);y.extent=e.toJSON(),E=y.extent}const S=y.spatialReferences.length>0?y.spatialReferences:X(y),O=ne(i,"GetFeatureInfo"),T=O?ie(i,"GetFeatureInfo"):null,A=Q(C),N=y.minScale||0,F=y.maxScale||0,M=y.dimensions??[],L=A.reduce(((e,t)=>e.concat(t.dimensions??[])),[]),D=M.concat(L).filter(ue);let R=null;if(D.length){const e=D.map((e=>{const{extent:t}=e;return function(e){return Array.isArray(e)&&e.length>0&&e[0]instanceof Date}(t)?t.map((e=>e.getTime())):t?.map((e=>[e.min.getTime(),e.max.getTime()]))})).flat(2).filter(U.pC);R={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...e),Math.max(...e)]}}return{copyright:h,description:c,dimensions:M,extent:E,fullExtents:I,featureInfoFormats:T,featureInfoUrl:O,mapUrl:f,maxWidth:d,maxHeight:p,maxScale:F,minScale:N,layers:A,spatialReferences:S,supportedImageFormatTypes:m,timeInfo:R,title:a,version:o}}function X(e){if(e.spatialReferences.length>0)return e.spatialReferences;if(e.sublayers)for(const t of e.sublayers){const e=X(t);if(e.length>0)return e}return[]}function Q(e){let t=[];for(const s of e)t.push(s),s.sublayers?.length&&(t=t.concat(Q(s.sublayers)),delete s.sublayers);return t}function K(e,t,s){return t.getAttribute(e)??s}function ee(e,t){for(let s=0;s<t.childNodes.length;s++){const r=t.childNodes[s];if(ae(r)&&r.nodeName===e)return r}return null}function te(e,t){if(null==t)return[];const s=[];for(let r=0;r<t.childNodes.length;r++){const n=t.childNodes[r];ae(n)&&n.nodeName===e&&s.push(n)}return s}function se(e,t,s){return ee(e,t)?.textContent??s}function re(e,t,s){if(!e)return null;const r=parseFloat(e.getAttribute("minx")),n=parseFloat(e.getAttribute("miny")),i=parseFloat(e.getAttribute("maxx")),l=parseFloat(e.getAttribute("maxy"));let o,a,u,h;s?(o=isNaN(n)?-Number.MAX_VALUE:n,a=isNaN(r)?-Number.MAX_VALUE:r,u=isNaN(l)?Number.MAX_VALUE:l,h=isNaN(i)?Number.MAX_VALUE:i):(o=isNaN(r)?-Number.MAX_VALUE:r,a=isNaN(n)?-Number.MAX_VALUE:n,u=isNaN(i)?Number.MAX_VALUE:i,h=isNaN(l)?Number.MAX_VALUE:l);const c=new C.Z({wkid:t});return new x.Z({xmin:o,ymin:a,xmax:u,ymax:h,spatialReference:c})}function ne(e,t){const s=ee(t,e);if(s){const e=ee("DCPType",s);if(e){const t=ee("HTTP",e);if(t){const e=ee("Get",t);if(e){let t=function(e,t,s,r){const n=ee("OnlineResource",s);return n?K("xlink:href",n,null):null}(0,0,e);if(t)return t.indexOf("&")===t.length-1&&(t=t.substring(0,t.length-1)),function(e,t){const s=[],r=(0,f.mN)(e);for(const e in r.query)r.query.hasOwnProperty(e)&&(t.includes(e.toLowerCase())||s.push(e+"="+r.query[e]));return r.path+(s.length?"?"+s.join("&"):"")}(t,["service","request"])}}}}return null}function ie(e,t){const s=te("Operation",e);if(!s.length)return te("Format",ee(t,e)).map((({textContent:e})=>e)).filter(U.pC);const r=[];for(const e of s)if(e.getAttribute("name")===t){const t=te("Format",e);for(const{textContent:e}of t)null!=e&&r.push(e)}return r}function le(e,t,s){const r=ee(t,e);if(!r)return s;const{textContent:n}=r;if(null==n||""===n)return s;const i=Number(n);return isNaN(i)?s:i}function oe(e,t,s){if(!e)return null;const r={id:s.idCounter++,fullExtents:[],parentLayerId:null,queryable:"1"===e.getAttribute("queryable"),spatialReferences:[],sublayers:null},n=ee("LatLonBoundingBox",e),i=ee("EX_GeographicBoundingBox",e);let l=null;n&&(l=re(n,4326)),i&&(l=new x.Z(0,0,0,0,new C.Z({wkid:4326})),l.xmin=parseFloat(se("westBoundLongitude",i,"0")),l.ymin=parseFloat(se("southBoundLatitude",i,"0")),l.xmax=parseFloat(se("eastBoundLongitude",i,"0")),l.ymax=parseFloat(se("northBoundLatitude",i,"0"))),n||i||(l=new x.Z(-180,-90,180,90,new C.Z({wkid:4326}))),r.minScale=le(e,"MaxScaleDenominator",0),r.maxScale=le(e,"MinScaleDenominator",0);const o=["1.0.0","1.1.0","1.1.1"].includes(t)?"SRS":"CRS";return Array.prototype.slice.call(e.childNodes).forEach((e=>{if("Name"===e.nodeName)r.name=e.textContent||"";else if("Title"===e.nodeName)r.title=e.textContent||"";else if("Abstract"===e.nodeName)r.description=e.textContent||"";else if("BoundingBox"===e.nodeName){const s=e.getAttribute(o);if(s&&0===s.indexOf("EPSG:")){const r=parseInt(s.substring(5),10);0===r||isNaN(r)||l||(l="1.3.0"===t?re(e,r,(0,L.A)(r)):re(e,r))}const n=s&&s.indexOf(":");if(n&&n>-1){let i=parseInt(s.substring(n+1,s.length),10);0===i||isNaN(i)||(i=$[i]??i);const l="1.3.0"===t?re(e,i,(0,L.A)(i)):re(e,i);l&&r.fullExtents&&r.fullExtents.push(l)}}else if(e.nodeName===o)(e.textContent?.split(" ")??[]).forEach((e=>{const t=e.includes(":")?parseInt(e.split(":")[1],10):parseInt(e,10);if(0!==t&&!isNaN(t)){const e=$[t]??t;r.spatialReferences.includes(e)||r.spatialReferences.push(e)}}));else if("Style"!==e.nodeName||r.legendURL){if("Layer"===e.nodeName){const n=oe(e,t,s);n&&(n.parentLayerId=r.id,r.sublayers||(r.sublayers=[]),r.sublayers.push(n))}}else{const t=ee("LegendURL",e);if(t){const e=ee("OnlineResource",t);e&&(r.legendURL=e.getAttribute("xlink:href"))}}})),r.extent=l?.toJSON(),r.dimensions=te("Dimension",e).filter((e=>e.getAttribute("name")&&e.getAttribute("units")&&e.textContent)).map((e=>{const t=e.getAttribute("name"),s=e.getAttribute("units"),r=e.textContent,n=e.getAttribute("unitSymbol")??void 0,i=e.getAttribute("default")??void 0,l="0"!==K("default",e,"0"),o="0"!==K("nearestValue",e,"0"),a="0"!==K("current",e,"0");return ue({name:t,units:s})?{name:"time",units:"ISO8601",extent:de(r),default:de(i),multipleValues:l,nearestValue:o,current:a}:function(e){return/^elevation$/i.test(e.name)&&/^(epsg|crs):\d+$/i.test(e.units)}({name:t,units:s})?{name:"elevation",units:s,extent:he(r),unitSymbol:n,default:he(i),multipleValues:l,nearestValue:o}:{name:t,units:s,extent:ce(r),unitSymbol:n,default:ce(i),multipleValues:l,nearestValue:o}})),r}function ae(e){return e.nodeType===Node.ELEMENT_NODE}function ue(e){return/^time$/i.test(e.name)&&/^iso8601$/i.test(e.units)}function he(e){if(!e)return;const t=e.includes("/"),s=e.split(",");return t?s.map((e=>{const t=e.split("/");return t.length<2?null:{min:parseFloat(t[0]),max:parseFloat(t[1]),resolution:t.length>=3&&"0"!==t[2]?parseFloat(t[2]):void 0}})).filter(U.pC):s.map((e=>parseFloat(e)))}function ce(e){if(!e)return;const t=e.includes("/"),s=e.split(",");return t?s.map((e=>{const t=e.split("/");return t.length<2?null:{min:t[0],max:t[1],resolution:t.length>=3&&"0"!==t[2]?t[2]:void 0}})).filter(U.pC):s}function de(e){if(!e)return;const t=e.includes("/"),s=e.split(",");return t?s.map((e=>{const t=e.split("/");return t.length<2?null:{min:new Date(t[0]),max:new Date(t[1]),resolution:t.length>=3&&"0"!==t[2]?pe(t[2]):void 0}})).filter(U.pC):s.map((e=>new Date(e)))}function pe(e){const t=e.match(/(?:p(\d+y|\d+(?:.|,)\d+y)?(\d+m|\d+(?:.|,)\d+m)?(\d+d|\d+(?:.|,)\d+d)?)?(?:t(\d+h|\d+(?:.|,)\d+h)?(\d+m|\d+(?:.|,)\d+m)?(\d+s|\d+(?:.|,)\d+s)?)?/i);return t?{years:me(t[1]),months:me(t[2]),days:me(t[3]),hours:me(t[4]),minutes:me(t[5]),seconds:me(t[6])}:null}function me(e){if(!e)return 0;const t=e.match(/(?:\d+(?:.|,)\d+|\d+)/);if(!t)return 0;const s=t[0].replace(",",".");return Number(s)}function fe(e){return e.toISOString().replace(/\.[0-9]{3}/,"")}const ye=new Set([102100,3857,102113,900913]),ge=new Set([3395,54004]),be=new h.X({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function _e(e){return"text/html"===e}function ve(e){return"text/plain"===e}let we=class extends((0,O.h)((0,M.n)((0,N.Q)((0,F.M)((0,T.q)((0,A.I)((0,d.R)(S.Z)))))))){constructor(...e){super(...e),this.allSublayers=new u.Z({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.url=null,this.version=null,this.addHandles([(0,m.on)((()=>this.sublayers),"after-add",(({item:e})=>{e.parent=e.layer=this}),m.Z_),(0,m.on)((()=>this.sublayers),"after-remove",(({item:e})=>{e.layer=e.parent=null}),m.Z_),(0,m.YP)((()=>this.sublayers),((e,t)=>{if(t)for(const e of t)e.layer=e.parent=null;if(e)for(const t of e)t.parent=t.layer=this}),m.Z_)])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(p.r9).then((()=>this._fetchService(t)))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const s=t.extent;return s?new x.Z({xmin:s[0][0],ymin:s[0][1],xmax:s[1][0],ymax:s[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return null==this.featureInfoFormats?null:this.featureInfoFormats.find(_e)??this.featureInfoFormats.find(ve)??null}set featureInfoFormat(e){null==e?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(_e(e)||ve(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,t){const s=t.supportedImageFormatTypes;return s&&s.includes("image/png")?"image/png":s&&s[0]}readSpatialReferenceFromItemOrDocument(e,t){return new C.Z(t.spatialReferences[0])}writeSpatialReferences(e,t){const s=this.spatialReference?.wkid;e&&s?(t.spatialReferences=e.filter((e=>e!==s)),t.spatialReferences.unshift(s)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,s){return xe(t.layers,s,t.visibleLayers)}readSublayers(e,t,s){return xe(t.layers,s)}writeSublayers(e,t,s,r){t.layers=[];const n=new Map,i=e.flatten((({sublayers:e})=>e??[]));for(const e of i)if("number"==typeof e.parent?.id){const t=n.get(e.parent.id);null!=t?t.push(e.id):n.set(e.parent.id,[e.id])}for(const e of i){const s={sublayer:e,...r},i=e.write({parentLayerId:"number"==typeof e.parent?.id?e.parent.id:-1},s);if(n.has(e.id)&&(i.sublayerIds=n.get(e.id)),!e.sublayers&&e.name){const r=e.write({},s);delete r.id,t.layers.push(r)}}t.visibleLayers=i.filter((({visible:e,sublayers:t})=>e&&!t)).map((({name:e})=>e)).toArray()}createExportImageParameters(e,t,s,r){const n=r?.pixelRatio??1,i=(0,E.yZ)({extent:e,width:t})*n,l=new q({layer:this,scale:i}),{xmin:o,ymin:a,xmax:u,ymax:h,spatialReference:c}=e,d=function(e,t){let s=e.wkid;return null==t?s:(null!=s&&t.includes(s)||!e.latestWkid||(s=e.latestWkid),null!=s&&ye.has(s)?t.find((e=>ye.has(e)))||t.find((e=>ge.has(e)))||102100:s)}(c,this.spatialReferences),p="1.3.0"===this.version&&(0,L.A)(d)?`${a},${o},${h},${u}`:`${o},${a},${u},${h}`,m=l.toJSON();return{bbox:p,["1.3.0"===this.version?"crs":"srs"]:null==d||isNaN(d)?void 0:"EPSG:"+d,...m}}async fetchImage(e,t,s,r){const n=this.mapUrl,i=this.createExportImageParameters(e,t,s,r);if(!i.layers){const e=document.createElement("canvas");return e.width=t,e.height=s,e}const l=r?.timeExtent?.start,a=r?.timeExtent?.end,u=null!=l&&null!=a?l.getTime()===a.getTime()?fe(l):`${fe(l)}/${fe(a)}`:void 0,h={responseType:"image",query:this._mixCustomParameters({width:t,height:s,...i,time:u,...this.refreshParameters}),signal:r?.signal};return(0,o.default)(n??"",h).then((e=>e.data))}async fetchImageBitmap(e,t,s,r){const n=this.mapUrl??"",i=this.createExportImageParameters(e,t,s,r);if(!i.layers){const e=document.createElement("canvas");return e.width=t,e.height=s,e}const l=r?.timeExtent?.start,a=r?.timeExtent?.end,u=null!=l&&null!=a?l.getTime()===a.getTime()?fe(l):`${fe(l)}/${fe(a)}`:void 0,h={responseType:"blob",query:this._mixCustomParameters({width:t,height:s,...i,time:u,...this.refreshParameters}),signal:r?.signal},{data:c}=await(0,o.default)(n,h);return(0,B.g)(c,n)}fetchFeatureInfo(e,t,s,r,n){const i=(0,E.yZ)({extent:e,width:t}),l=function(e){const t=e.filter((e=>e.popupEnabled&&e.name&&e.queryable));return t.length?t.map((({name:e})=>e)).join():null}(new q({layer:this,scale:i}).visibleSublayers);if(null==this.featureInfoUrl||null==l)return Promise.resolve([]);if(null==this.fetchFeatureInfoFunction&&null==this.featureInfoFormat)return Promise.resolve([]);const o="1.3.0"===this.version?{I:r,J:n}:{x:r,y:n},a={query_layers:l,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:s,...o},u={...this.createExportImageParameters(e,t,s),...a},h=this._mixCustomParameters(u);return null!=this.fetchFeatureInfoFunction?this.fetchFeatureInfoFunction(h):this._defaultFetchFeatureInfoFunction((0,f.fl)(this.featureInfoUrl,h))}findSublayerById(e){return this.allSublayers.find((t=>t.id===e))}findSublayerByName(e){return this.allSublayers.find((t=>t.name===e))}serviceSupportsSpatialReference(e){return(0,D.G)(this.url)||null!=this.spatialReferences&&this.spatialReferences.some((t=>{const s=900913===t?C.Z.WebMercator:new C.Z({wkid:t});return(0,I.fS)(s,e)}))}_defaultFetchFeatureInfoFunction(e){const t=document.createElement("iframe");t.src=(0,f.qg)(e),t.style.border="none",t.style.margin="0",t.style.width="100%",t.setAttribute("sandbox","");const s=new l.Z({title:this.title,content:t}),r=new i.Z({sourceLayer:this,popupTemplate:s});return Promise.resolve([r])}async _fetchService(e){if(!this.resourceInfo){const{path:t,query:s}=this.parsedUrl??{};s?.service&&(s.SERVICE=s.service,delete s.service),s?.request&&(s.REQUEST=s.request,delete s.request);const{data:r}=await(0,o.default)(t??"",{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...s,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=z(r)}if(this.parsedUrl){const e=new f.R9(this.parsedUrl.path),{httpsDomains:t}=n.Z.request;"https"!==e.scheme||e.port&&"443"!==e.port||!e.host||t.includes(e.host)||t.push(e.host)}this.read(this.resourceInfo,{origin:"service"})}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const s in t)e[s.toLowerCase()]=t[s];return e}};function xe(e,t,s){e=e??[];const r=new Map;e.every((e=>null==e.id))&&(e=(0,c.d9)(e)).forEach(((e,t)=>e.id=t));for(const n of e){const e=new Y;e.read(n,t),s&&!s.includes(e.name)&&(e.visible=!1),r.set(e.id,e)}const n=[];for(const t of e){const e=null!=t.id?r.get(t.id):null;if(e)if(null!=t.parentLayerId&&t.parentLayerId>=0){const s=r.get(t.parentLayerId);if(!s)continue;s.sublayers||(s.sublayers=new a.Z),s.sublayers.push(e)}else n.push(e)}return n}(0,r._)([(0,y.Cb)({readOnly:!0})],we.prototype,"allSublayers",void 0),(0,r._)([(0,y.Cb)({json:{type:Object,write:!0}})],we.prototype,"customParameters",void 0),(0,r._)([(0,y.Cb)({json:{type:Object,write:!0}})],we.prototype,"customLayerParameters",void 0),(0,r._)([(0,y.Cb)({type:String,json:{write:!0}})],we.prototype,"copyright",void 0),(0,r._)([(0,y.Cb)()],we.prototype,"description",void 0),(0,r._)([(0,y.Cb)({readOnly:!0})],we.prototype,"dimensions",void 0),(0,r._)([(0,y.Cb)({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],we.prototype,"fullExtent",void 0),(0,r._)([(0,b.r)(["web-document","portal-item"],"fullExtent",["extent"])],we.prototype,"readFullExtentFromItemOrMap",null),(0,r._)([(0,v.c)(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],we.prototype,"writeFullExtent",null),(0,r._)([(0,y.Cb)()],we.prototype,"fullExtents",void 0),(0,r._)([(0,y.Cb)({type:String,json:{write:{ignoreOrigin:!0}}})],we.prototype,"featureInfoFormat",null),(0,r._)([(0,y.Cb)({type:[String],readOnly:!0})],we.prototype,"featureInfoFormats",void 0),(0,r._)([(0,y.Cb)({type:String,json:{write:{ignoreOrigin:!0}}})],we.prototype,"featureInfoUrl",void 0),(0,r._)([(0,y.Cb)()],we.prototype,"fetchFeatureInfoFunction",void 0),(0,r._)([(0,y.Cb)({type:String,json:{origins:{"web-document":{default:"image/png",type:be.jsonValues,read:{reader:be.read,source:"format"},write:{writer:be.write,target:"format"}}}}})],we.prototype,"imageFormat",void 0),(0,r._)([(0,b.r)("imageFormat",["supportedImageFormatTypes"])],we.prototype,"readImageFormat",null),(0,r._)([(0,y.Cb)({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],we.prototype,"imageMaxHeight",void 0),(0,r._)([(0,y.Cb)({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],we.prototype,"imageMaxWidth",void 0),(0,r._)([(0,y.Cb)()],we.prototype,"imageTransparency",void 0),(0,r._)([(0,y.Cb)(R.rn)],we.prototype,"legendEnabled",void 0),(0,r._)([(0,y.Cb)({type:["show","hide","hide-children"]})],we.prototype,"listMode",void 0),(0,r._)([(0,y.Cb)({type:String,json:{write:{ignoreOrigin:!0}}})],we.prototype,"mapUrl",void 0),(0,r._)([(0,y.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],we.prototype,"isReference",void 0),(0,r._)([(0,y.Cb)({type:["WMS"]})],we.prototype,"operationalLayerType",void 0),(0,r._)([(0,y.Cb)()],we.prototype,"resourceInfo",void 0),(0,r._)([(0,y.Cb)({type:C.Z,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],we.prototype,"spatialReference",void 0),(0,r._)([(0,b.r)(["web-document","portal-item"],"spatialReference",["spatialReferences"])],we.prototype,"readSpatialReferenceFromItemOrDocument",null),(0,r._)([(0,y.Cb)({type:[g.z8],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],we.prototype,"spatialReferences",void 0),(0,r._)([(0,v.c)(["web-document","portal-item"],"spatialReferences")],we.prototype,"writeSpatialReferences",null),(0,r._)([(0,y.Cb)({type:a.Z.ofType(Y),json:{write:{target:"layers",overridePolicy(e,t,s){if(function(e,t){return e.some((e=>{for(const s in e)if((0,w.d)(e,s,null,t))return!0;return!1}))}(this.allSublayers,s))return{ignoreOrigin:!0}}}}})],we.prototype,"sublayers",void 0),(0,r._)([(0,b.r)(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],we.prototype,"readSublayersFromItemOrMap",null),(0,r._)([(0,b.r)("service","sublayers",["layers"])],we.prototype,"readSublayers",null),(0,r._)([(0,v.c)("sublayers",{layers:{type:[Y]},visibleLayers:{type:[String]}})],we.prototype,"writeSublayers",null),(0,r._)([(0,y.Cb)({json:{read:!1},readOnly:!0,value:"wms"})],we.prototype,"type",void 0),(0,r._)([(0,y.Cb)(R.HQ)],we.prototype,"url",void 0),(0,r._)([(0,y.Cb)({type:String,json:{write:{ignoreOrigin:!0}}})],we.prototype,"version",void 0),we=(0,r._)([(0,_.j)("esri.layers.WMSLayer")],we);const Ce=we},34760:(e,t,s)=>{s.d(t,{Q:()=>g});var r=s(43697),n=s(92604),i=s(95330),l=s(5600),o=(s(75215),s(67676),s(80442),s(52011)),a=s(46791),u=(s(20102),s(26258),s(87538));const h=new a.Z,c=new WeakMap;function d(e){return null!=e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function p(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:p(t,e%t):0}let m=0,f=0;function y(){const e=Date.now();for(const t of h)t.refreshInterval&&e-(c.get(t)??0)+5>=6e4*t.refreshInterval&&(c.set(t,e),t.refresh(e))}(0,u.EH)((()=>{const e=Date.now();let t=0;for(const s of h)t=p(Math.round(6e4*s.refreshInterval),t),s.refreshInterval?c.get(s)||c.set(s,e):c.delete(s);if(t!==f){if(f=t,clearInterval(m),0===f)return void(m=0);m=setInterval(y,f)}}));const g=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,i.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{this.destroyed||function(e){d(e)&&h.push(e)}(this)}),(()=>{}))}destroy(){d(this)&&h.includes(this)&&h.remove(this)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,i.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{n.Z.getLogger(this.declaredClass).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}};return(0,r._)([(0,l.Cb)({type:Number,cast:e=>e>=.1?e:e<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,r._)([(0,l.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,r._)([(0,l.Cb)()],t.prototype,"refreshParameters",null),t=(0,r._)([(0,o.j)("esri.layers.mixins.RefreshableLayer")],t),t}},28294:(e,t,s)=>{s.d(t,{n:()=>d});var r=s(43697),n=s(92835),i=s(84552),l=s(5600),o=(s(75215),s(67676),s(80442),s(71715)),a=s(52011),u=s(35671),h=s(76259),c=s(78981);const d=e=>{let t=class extends e{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(e,t){const s=t.timeInfo.exportOptions;if(!s)return null;const r=s.timeOffset,n=c.v.fromJSON(s.timeOffsetUnits);return r&&n?new i.Z({value:r,unit:n}):null}set timeInfo(e){(0,u.UF)(e,this.fieldsIndex),this._set("timeInfo",e)}};return(0,r._)([(0,l.Cb)({type:n.Z,json:{write:!1}})],t.prototype,"timeExtent",void 0),(0,r._)([(0,l.Cb)({type:i.Z})],t.prototype,"timeOffset",void 0),(0,r._)([(0,o.r)("service","timeOffset",["timeInfo.exportOptions"])],t.prototype,"readOffset",null),(0,r._)([(0,l.Cb)({value:null,type:h.Z,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],t.prototype,"timeInfo",null),(0,r._)([(0,l.Cb)({type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation"},origins:{"web-scene":{read:!1,write:!1}}}})],t.prototype,"useViewTime",void 0),t=(0,r._)([(0,a.j)("esri.layers.mixins.TemporalLayer")],t),t}},52162:(e,t,s)=>{s.d(t,{A:()=>n});const r=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function n(e){return null!=e&&r.some((([t,s])=>e>=t&&e<=s))}},76259:(e,t,s)=>{s.d(t,{Z:()=>f});var r=s(43697),n=s(92835),i=s(84552),l=s(2368),o=s(96674),a=s(5600),u=(s(75215),s(67676),s(80442),s(71715)),h=s(52011),c=s(30556),d=s(80216);function p(e,t){return i.Z.fromJSON({value:e,unit:t})}let m=class extends((0,l.J)(o.wq)){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeReference=null,this.trackIdField=null,this.useTime=!0}readFullTimeExtent(e,t){if(!t.timeExtent||!Array.isArray(t.timeExtent)||2!==t.timeExtent.length)return null;const s=new Date(t.timeExtent[0]),r=new Date(t.timeExtent[1]);return new n.Z({start:s,end:r})}writeFullTimeExtent(e,t){e&&null!=e.start&&null!=e.end?t.timeExtent=[e.start.getTime(),e.end.getTime()]:t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?p(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?p(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};(0,r._)([(0,a.Cb)({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],m.prototype,"cumulative",void 0),(0,r._)([(0,a.Cb)({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],m.prototype,"endField",void 0),(0,r._)([(0,a.Cb)({type:n.Z,json:{write:{enabled:!0,allowNull:!0}}})],m.prototype,"fullTimeExtent",void 0),(0,r._)([(0,u.r)("fullTimeExtent",["timeExtent"])],m.prototype,"readFullTimeExtent",null),(0,r._)([(0,c.c)("fullTimeExtent")],m.prototype,"writeFullTimeExtent",null),(0,r._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],m.prototype,"hasLiveData",void 0),(0,r._)([(0,a.Cb)({type:i.Z,json:{write:{enabled:!0,allowNull:!0}}})],m.prototype,"interval",void 0),(0,r._)([(0,u.r)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],m.prototype,"readInterval",null),(0,r._)([(0,c.c)("interval")],m.prototype,"writeInterval",null),(0,r._)([(0,a.Cb)({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],m.prototype,"startField",void 0),(0,r._)([(0,a.Cb)({type:d.Z,json:{write:{enabled:!0,allowNull:!0}}})],m.prototype,"timeReference",void 0),(0,r._)([(0,a.Cb)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],m.prototype,"trackIdField",void 0),(0,r._)([(0,a.Cb)({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],m.prototype,"useTime",void 0),m=(0,r._)([(0,h.j)("esri.layers.support.TimeInfo")],m);const f=m},90082:(e,t,s)=>{s.d(t,{g:()=>n});var r=s(20102);async function n(e,t){try{return await createImageBitmap(e)}catch(e){throw new r.Z("request:server",`Unable to load ${t}`,{url:t,error:e})}}},78981:(e,t,s)=>{s.d(t,{v:()=>r});const r=(0,s(35454).w)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})}}]);