@arcgis/core 4.34.0-next.13 → 4.34.0-next.15

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 (147) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/0512ee54f2259a437fdb.js +1 -0
  3. package/assets/esri/core/workers/chunks/{3145218abe59b5e99ff8.js → 05f2133f05f86266d8c7.js} +1 -1
  4. package/assets/esri/core/workers/chunks/0f81a2deb656e8b28eae.js +1 -0
  5. package/assets/esri/core/workers/chunks/{ad4f65d764654c70a117.js → 0f8f217aaf42eb1b9699.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{74276044cb75b51967f2.js → 10eb89a93c8e31f03c95.js} +1 -1
  7. package/assets/esri/core/workers/chunks/15d3193576f93586674c.js +1 -0
  8. package/assets/esri/core/workers/chunks/{369978472cc9ee6a00b5.js → 1f559f1e7f0bc0f4bf20.js} +5 -5
  9. package/assets/esri/core/workers/chunks/243eb8a317333ec2715b.js +1 -0
  10. package/assets/esri/core/workers/chunks/273beed633cc37416ad7.js +1 -0
  11. package/assets/esri/core/workers/chunks/{63852887b3f07d50f7c9.js → 2ad538440cfb3ab94787.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{aaa564c84ee8ea36fbb4.js → 49a57dc1e6d1048fa949.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{e7589c39b13295af8f1d.js → 604f8094992bb642378b.js} +1 -1
  14. package/assets/esri/core/workers/chunks/6975929fa91c81c8afc0.js +1 -0
  15. package/assets/esri/core/workers/chunks/{0eeb0dce918e4827309a.js → 70e5848aa372475fc8fa.js} +1 -1
  16. package/assets/esri/core/workers/chunks/7716a9fb380d66ba7292.js +1 -0
  17. package/assets/esri/core/workers/chunks/77ad62ed93f713a909f0.js +1 -0
  18. package/assets/esri/core/workers/chunks/7b9eec0090f48e9cdaf1.js +1 -0
  19. package/assets/esri/core/workers/chunks/{3b63edcd34f832ac7bd8.js → 7c6b9e2c1dada4668c01.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{0b21651eb93efe9ce089.js → 7f14d6cb754c7e94748c.js} +83 -83
  21. package/assets/esri/core/workers/chunks/{af0d7a7cbbaad47a49c6.js → 802c6b1a6cb9264b8e4f.js} +1 -1
  22. package/assets/esri/core/workers/chunks/8865bd8f196556441ce3.js +1 -0
  23. package/assets/esri/core/workers/chunks/8b1842f0f94c18652d4e.js +1 -0
  24. package/assets/esri/core/workers/chunks/932808e485f305b6a26a.js +1 -0
  25. package/assets/esri/core/workers/chunks/93c145a738b3f6cf4ee4.js +1 -0
  26. package/assets/esri/core/workers/chunks/9d779891d51d196aa8c8.js +1 -0
  27. package/assets/esri/core/workers/chunks/{6cbe8205a4e0f62da519.js → a5a27e2e9b91fbe12da9.js} +1 -1
  28. package/assets/esri/core/workers/chunks/aeac889d95f34b6d3b72.js +1 -0
  29. package/assets/esri/core/workers/chunks/d0876a713079c669995a.js +1 -0
  30. package/assets/esri/core/workers/chunks/{d5f770302dc686e55ba7.js → daffceecdc71e74d2629.js} +1 -1
  31. package/assets/esri/core/workers/chunks/e980a81c4d1e05f07141.js +1 -0
  32. package/assets/esri/core/workers/chunks/{998819aade3898f52414.js → ec49e2849766402ad5c7.js} +1 -1
  33. package/assets/esri/core/workers/chunks/fa3edfbdaa3b716a3a10.js +1 -0
  34. package/assets/esri/core/workers/chunks/fa5715ca3ce95d005b0a.js +1 -0
  35. package/assets/esri/themes/base/widgets/_SelectionList.scss +31 -28
  36. package/assets/esri/themes/dark/main.css +1 -1
  37. package/assets/esri/themes/light/main.css +1 -1
  38. package/assets/esri/themes/light/view.css +1 -1
  39. package/chunks/chartUtilsAm5.js +1 -1
  40. package/config.js +1 -1
  41. package/core/accessorSupport/utils.js +1 -1
  42. package/core/object.js +1 -1
  43. package/editing/sharedTemplates/executor/builders/bufferPolygonToPolygon.js +1 -1
  44. package/interfaces.d.ts +28 -10
  45. package/intl/date.js +1 -1
  46. package/intl/duration.js +1 -1
  47. package/intl/locale.js +1 -1
  48. package/intl/messages.js +1 -1
  49. package/intl/number.js +1 -1
  50. package/intl.d.ts +1 -0
  51. package/intl.js +1 -1
  52. package/kernel.js +1 -1
  53. package/layers/CatalogLayer.js +1 -1
  54. package/layers/FeatureLayer.js +1 -1
  55. package/layers/GeoJSONLayer.js +1 -1
  56. package/layers/WFSLayer.js +1 -1
  57. package/layers/graphics/data/QueryEngineResult.js +1 -1
  58. package/layers/graphics/data/queryValidationUtils.js +1 -1
  59. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  60. package/layers/support/featureLayerUtils.js +1 -1
  61. package/layers/support/rasterDatasets/covJSONParser.js +1 -1
  62. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  63. package/package.json +1 -1
  64. package/renderers/support/DictionaryScriptEvaluator.js +1 -1
  65. package/rest/networks/circuits/support/CircuitVerifyResult.js +1 -1
  66. package/rest/support/DateBinTimeInterval.js +1 -1
  67. package/rest/support/DateBinUtils.js +5 -0
  68. package/smartMapping/renderers/size.js +1 -1
  69. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  70. package/smartMapping/support/adapters/support/utils.js +1 -1
  71. package/support/ArcadeExpression.js +1 -1
  72. package/support/revision.js +1 -1
  73. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  74. package/views/2d/engine/vectorTiles/style/StyleProperty.js +1 -1
  75. package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
  76. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  77. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  78. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  79. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  80. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  81. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  82. package/views/3d/camera/intersectionUtils.js +1 -1
  83. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  84. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  85. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  86. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +2 -2
  87. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  88. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  89. package/views/analysis/analysisViewUtils.js +1 -1
  90. package/views/layers/BuildingSceneLayerView.js +1 -1
  91. package/views/layers/PointCloudLayerView.js +1 -1
  92. package/views/layers/SceneLayerView.js +1 -1
  93. package/views/ui/UI.js +1 -1
  94. package/webscene/Slide.js +1 -1
  95. package/widgets/Directions/DirectionsVisibleElements.js +1 -1
  96. package/widgets/Directions.js +1 -1
  97. package/widgets/Editor/EditorViewModel.js +1 -1
  98. package/widgets/Editor/UpdateFeatureWorkflowData.js +1 -1
  99. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  100. package/widgets/Editor/UpdateWorkflow.js +1 -1
  101. package/widgets/Editor.js +1 -1
  102. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  103. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  104. package/widgets/FeatureTable.js +1 -1
  105. package/widgets/Features/FeaturesViewModel.js +1 -1
  106. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  107. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  108. package/widgets/OrientedImageryViewer/components/NavigationNode.js +1 -1
  109. package/widgets/OrientedImageryViewer/components/NavigationSettings.js +1 -1
  110. package/widgets/OrientedImageryViewer/components/NavigationUI.js +1 -1
  111. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +5 -0
  112. package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +1 -1
  113. package/widgets/OrientedImageryViewer/components/NavigationUIViewModel.js +1 -1
  114. package/widgets/OrientedImageryViewer/components/imageNavigationUtils.js +1 -1
  115. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
  116. package/widgets/OrientedImageryViewer.js +1 -1
  117. package/widgets/PanoramicViewer.js +1 -1
  118. package/widgets/Print/PrintViewModel.js +1 -1
  119. package/widgets/Print.js +1 -1
  120. package/widgets/ScaleRangeSlider/scalePreviewUtils.js +1 -1
  121. package/widgets/Search.js +1 -1
  122. package/widgets/support/SelectionList/FeatureItem.js +1 -1
  123. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  124. package/widgets/support/SelectionList/LayerItem.js +1 -1
  125. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  126. package/widgets/support/SelectionList.js +1 -1
  127. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  128. package/widgets/support/timeWidgetUtils.js +1 -1
  129. package/assets/esri/core/workers/chunks/18011c691e0aca4144dd.js +0 -1
  130. package/assets/esri/core/workers/chunks/183a7dec68c8ba6eb3d6.js +0 -1
  131. package/assets/esri/core/workers/chunks/2ddb776434a93b8d9e63.js +0 -1
  132. package/assets/esri/core/workers/chunks/3916879b9ca8c6979011.js +0 -1
  133. package/assets/esri/core/workers/chunks/3cbc498388fb1931a9f8.js +0 -1
  134. package/assets/esri/core/workers/chunks/4079e307a0fce4516aa4.js +0 -1
  135. package/assets/esri/core/workers/chunks/4088f4c25a09932a3eb1.js +0 -1
  136. package/assets/esri/core/workers/chunks/467cacb501b0417bb4df.js +0 -1
  137. package/assets/esri/core/workers/chunks/49089731ecfe7e8bb2f6.js +0 -1
  138. package/assets/esri/core/workers/chunks/4e0bae3671fe1c7efa76.js +0 -1
  139. package/assets/esri/core/workers/chunks/5df4f2315fae82030e87.js +0 -1
  140. package/assets/esri/core/workers/chunks/72ea996b03932c0f004f.js +0 -1
  141. package/assets/esri/core/workers/chunks/a1a42b0d7cd47b647f8a.js +0 -1
  142. package/assets/esri/core/workers/chunks/a622ed3f182648ab3ff6.js +0 -1
  143. package/assets/esri/core/workers/chunks/a693cd3af2e995972252.js +0 -1
  144. package/assets/esri/core/workers/chunks/c8856370bae65d9eeb2b.js +0 -1
  145. package/assets/esri/core/workers/chunks/cd4fb107489594c57438.js +0 -1
  146. package/assets/esri/core/workers/chunks/d28d874c1337b69fedc0.js +0 -1
  147. package/assets/esri/core/workers/chunks/ec922f876e1465d36045.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.34/esri/copyright.txt for details.
4
4
  */
5
- import{getAssetUrl as e}from"../../assets.js";import{getLocaleParts as n}from"../../intl/locale.js";const s="en-wo";var r;!function(e){e.ar="ar",e.bg="bg",e.cs="cs",e.da="da",e.de="de",e.el="el",e.en="en",e.es="es",e.et="et",e.fi="fi",e.fr="fr",e.is="is",e.it="it",e.ja="ja",e.ko="ko",e.lt="lt",e.lv="lv",e.nl="nl",e.nn="nn",e.pl="pl",e.pt="pt",e.ro="ro",e.ru="ru",e.sk="sk",e.sv="sv",e.th="th",e.zh="zh"}(r||(r={}));const t={ae:r.en,ar:r.es,at:r.de,au:r.en,be:r.nl,bg:r.bg,bo:r.es,br:r.pt,ca:r.en,ch:r.de,ci:r.fr,cl:r.es,cn:r.zh,co:r.es,cr:r.es,cz:r.cs,de:r.de,dk:r.da,ee:r.et,eg:r.en,es:r.es,fi:r.fi,fr:r.fr,gb:r.en,gl:r.da,gr:r.el,gt:r.es,hk:r.en,id:r.en,ie:r.en,il:r.en,in:r.en,iq:r.ar,is:r.is,it:r.it,jp:r.ja,ke:r.en,kr:r.ko,kw:r.ar,li:r.de,lt:r.lt,lu:r.en,lv:r.lv,ma:r.fr,mg:r.fr,ml:r.fr,mo:r.en,mx:r.es,my:r.en,ni:r.es,nl:r.nl,no:r.nn,nz:r.en,pe:r.es,pl:r.pl,pr:r.es,pt:r.pt,ro:r.ro,ru:r.ru,rw:r.en,se:r.sv,sg:r.en,sk:r.sk,sr:r.nl,sv:r.es,th:r.th,tn:r.fr,tw:r.zh,us:r.en,ve:r.es,vi:r.en,wo:r.en,za:r.en},l=new Set(["ar-iq","ar-kw","bg-bg","cs-cz","da-dk","da-gl","de-at","de-ch","de-de","de-li","el-gr","en-ae","en-au","en-ca","en-eg","en-gb","en-hk","en-id","en-ie","en-il","en-in","en-iq","en-ke","en-lu","en-mo","en-my","en-nz","en-rw","en-sg","en-us","en-vi","en-wo","en-za","es-ar","es-bo","es-cl","es-co","es-cr","es-es","es-gt","es-mx","es-ni","es-pe","es-pr","es-sv","es-ve","et-ee","fi-fi","fr-ci","fr-fr","fr-ma","fr-mg","fr-ml","fr-tn","is-is","it-it","ja-jp","ko-kr","lt-lt","lv-lv","nl-be","nl-nl","nl-sr","nn-no","pl-pl","pt-br","pt-pt","ro-ro","ru-ru","sk-sk","sv-se","th-th","zh-cn","zh-tw"]);function i(e){return e.toLowerCase()}function a(n){return`url(${e(`esri/widgets/ScaleRangeSlider/images/scalePreview/${n}.jpg`)})`}function o(e){e=i(e);const r=`${n()?.language??"en"}-${e}`,o=`${t[e]}-${e}`;return a(l.has(r)?r:l.has(o)?o:s)}function c(e){const n=5,s=5;if(e<0||e>=n*s)return;return`-${128*(e%n)}px -${128*Math.floor(e/s)}px`}export{s as fallbackSpriteSheetFileName,o as getScalePreviewSource,c as getScalePreviewSpriteBackgroundPosition};
5
+ import{getAssetUrl as e}from"../../assets.js";import{getLocaleLanguage as n}from"../../intl/locale.js";const s="en-wo";var r;!function(e){e.ar="ar",e.bg="bg",e.cs="cs",e.da="da",e.de="de",e.el="el",e.en="en",e.es="es",e.et="et",e.fi="fi",e.fr="fr",e.is="is",e.it="it",e.ja="ja",e.ko="ko",e.lt="lt",e.lv="lv",e.nl="nl",e.nn="nn",e.pl="pl",e.pt="pt",e.ro="ro",e.ru="ru",e.sk="sk",e.sv="sv",e.th="th",e.zh="zh"}(r||(r={}));const t={ae:r.en,ar:r.es,at:r.de,au:r.en,be:r.nl,bg:r.bg,bo:r.es,br:r.pt,ca:r.en,ch:r.de,ci:r.fr,cl:r.es,cn:r.zh,co:r.es,cr:r.es,cz:r.cs,de:r.de,dk:r.da,ee:r.et,eg:r.en,es:r.es,fi:r.fi,fr:r.fr,gb:r.en,gl:r.da,gr:r.el,gt:r.es,hk:r.en,id:r.en,ie:r.en,il:r.en,in:r.en,iq:r.ar,is:r.is,it:r.it,jp:r.ja,ke:r.en,kr:r.ko,kw:r.ar,li:r.de,lt:r.lt,lu:r.en,lv:r.lv,ma:r.fr,mg:r.fr,ml:r.fr,mo:r.en,mx:r.es,my:r.en,ni:r.es,nl:r.nl,no:r.nn,nz:r.en,pe:r.es,pl:r.pl,pr:r.es,pt:r.pt,ro:r.ro,ru:r.ru,rw:r.en,se:r.sv,sg:r.en,sk:r.sk,sr:r.nl,sv:r.es,th:r.th,tn:r.fr,tw:r.zh,us:r.en,ve:r.es,vi:r.en,wo:r.en,za:r.en},l=new Set(["ar-iq","ar-kw","bg-bg","cs-cz","da-dk","da-gl","de-at","de-ch","de-de","de-li","el-gr","en-ae","en-au","en-ca","en-eg","en-gb","en-hk","en-id","en-ie","en-il","en-in","en-iq","en-ke","en-lu","en-mo","en-my","en-nz","en-rw","en-sg","en-us","en-vi","en-wo","en-za","es-ar","es-bo","es-cl","es-co","es-cr","es-es","es-gt","es-mx","es-ni","es-pe","es-pr","es-sv","es-ve","et-ee","fi-fi","fr-ci","fr-fr","fr-ma","fr-mg","fr-ml","fr-tn","is-is","it-it","ja-jp","ko-kr","lt-lt","lv-lv","nl-be","nl-nl","nl-sr","nn-no","pl-pl","pt-br","pt-pt","ro-ro","ru-ru","sk-sk","sv-se","th-th","zh-cn","zh-tw"]);function i(e){return e.toLowerCase()}function a(n){return`url(${e(`esri/widgets/ScaleRangeSlider/images/scalePreview/${n}.jpg`)})`}function o(e){e=i(e);const r=`${n()??"en"}-${e}`,o=`${t[e]}-${e}`;return a(l.has(r)?r:l.has(o)?o:s)}function c(e){const n=5,s=5;if(e<0||e>=n*s)return;return`-${128*(e%n)}px -${128*Math.floor(e/s)}px`}export{s as fallbackSpriteSheetFileName,o as getScalePreviewSource,c as getScalePreviewSpriteBackgroundPosition};
package/widgets/Search.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.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{deprecateWidget as t,deprecatedPropertyValue as o}from"../core/deprecate.js";import s from"../core/Logger.js";import{destroyMaybe as r,abortMaybe as i}from"../core/maybe.js";import{ignoreAbortErrors as l,isAbortError as n}from"../core/promiseUtils.js";import{watch as a,initial as c}from"../core/reactiveUtils.js";import{waitAnimationFrame as u}from"../core/scheduling.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import p from"./Widget.js";import{css as g}from"./Search/css.js";import m from"./Search/SearchResultRenderer.js";import v from"./Search/SearchViewModel.js";import{loadCalciteComponents as _}from"./support/componentsUtils.js";import{globalCss as w}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as S}from"./support/decorators/messageBundle.js";import{vmEvent as M}from"./support/decorators/vmEvent.js";import{tsx as b}from"./support/jsxFactory.js";import{substitute as y}from"../intl/substitute.js";let C=class extends p{constructor(e,o){super(e,o),this._currentLocationValue=`${this.id}-search-use-current-location`,this._autocompleteNode=null,this._focusAbortController=null,this._searchResultRenderer=new m,this._suggestController=null,this._searchController=null,this._lastSearchTerm="",this._locateFailed=!1,this._showNoResults=!1,this.disabled=!1,this.messages=null,this.messagesCommon=null,this.viewModel=new v,this._renderSearchResultsContent=()=>this._searchResultRenderer,t(s.getLogger(this),"Search","arcgis-search",{version:"4.33"}),this.addHandles([a((()=>this.viewModel),(e=>this._searchResultRenderer.viewModel=e),c),a((()=>this.viewModel.results),(()=>this._searchResultRenderer.showMoreResultsOpen=!1)),a((()=>this.viewModel?.defaultPopupTemplate),(e=>{e&&(e.content=this._renderSearchResultsContent)}),c)])}loadDependencies(){return _({autocomplete:()=>import("@esri/calcite-components/dist/components/calcite-autocomplete"),"autocomplete-item-group":()=>import("@esri/calcite-components/dist/components/calcite-autocomplete-item-group"),"autocomplete-item":()=>import("@esri/calcite-components/dist/components/calcite-autocomplete-item"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._cancelQueries(),this._searchResultRenderer=r(this._searchResultRenderer),this._focusAbortController?.abort()}get _isDisabled(){const{state:e}=this.viewModel;return"disabled"===e||"loading"===e||this.disabled}get _showCurrentLocation(){return this.locationEnabled&&!this.searchTerm?.trim()}get _effectiveActiveMenu(){const{activeMenu:e}=this;return this._isDisabled?"none":"warning"===e?"suggestion":e}get activeMenu(){return"none"}set activeMenu(e){"warning"===e&&o(s.getLogger(this),"activeMenu","warning",{replacement:"Use the value 'suggestion' instead",version:"4.32",warnOnce:!0}),this._overrideIfSome("activeMenu",e)}get activeSource(){return this.viewModel?.activeSource}get activeSourceIndex(){return this.viewModel.activeSourceIndex}set activeSourceIndex(e){this.viewModel.activeSourceIndex=e}get allPlaceholder(){return this.viewModel.allPlaceholder}set allPlaceholder(e){this.viewModel.allPlaceholder=e}get allSources(){return this.viewModel.allSources}get autoNavigate(){return this.viewModel.autoNavigate}set autoNavigate(e){this.viewModel.autoNavigate=e}get autoSelect(){return this.viewModel.autoSelect}set autoSelect(e){this.viewModel.autoSelect=e}get defaultSources(){return this.viewModel.defaultSources}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"search"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultSources(){return this.viewModel.includeDefaultSources}set includeDefaultSources(e){this.viewModel.includeDefaultSources=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get locationEnabled(){return this.viewModel.locationEnabled}set locationEnabled(e){this.viewModel.locationEnabled=e}get maxResults(){return this.viewModel.maxResults}set maxResults(e){this.viewModel.maxResults=e}get maxSuggestions(){return this.viewModel.maxSuggestions}set maxSuggestions(e){this.viewModel.maxSuggestions=e}get minSuggestCharacters(){return this.viewModel.minSuggestCharacters}set minSuggestCharacters(e){this.viewModel.minSuggestCharacters=e}get popupEnabled(){return this.viewModel.popupEnabled}set popupEnabled(e){this.viewModel.popupEnabled=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get portal(){return this.viewModel?.portal}set portal(e){this.viewModel&&(this.viewModel.portal=e)}get resultGraphic(){return this.viewModel.resultGraphic}set resultGraphic(e){this.viewModel.resultGraphic=e}get resultGraphicEnabled(){return this.viewModel.resultGraphicEnabled}set resultGraphicEnabled(e){this.viewModel.resultGraphicEnabled=e}get results(){return this.viewModel.results}get searchAllEnabled(){return this.viewModel.searchAllEnabled}set searchAllEnabled(e){this.viewModel.searchAllEnabled=e}get searchTerm(){return this.viewModel.searchTerm}set searchTerm(e){this.viewModel.searchTerm=e}get selectedResult(){return this.viewModel.selectedResult}get sources(){return this.viewModel.sources}set sources(e){this.viewModel.sources=e}get suggestions(){return this.viewModel.suggestions}get suggestionsEnabled(){return this.viewModel.suggestionsEnabled}set suggestionsEnabled(e){this.viewModel.suggestionsEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}clear(){this._locateFailed=!1,this.viewModel.clear()}focus(){this._handleFocus(),this._emitFocus()}blur(){this._autocompleteNode?.blur(),this._emitBlur()}async search(e){this._cancelQueries();const t=new AbortController,{signal:o}=t;this._searchController=t;try{const s=await this.viewModel.search(e,{signal:o});if(this._searchController!==t)return;return s?.numResults||(this._showNoResults=!0,this.activeMenu="suggestion"),this._searchController=null,s}catch(s){if(this._searchController!==t)return;return void(this._searchController=null)}}async suggest(e){this._cancelSuggest();const t=new AbortController,{signal:o}=t;this._suggestController=t;try{const s=await this.viewModel.suggest(e,null,{signal:o});if(this._suggestController!==t)return;return this._suggestController=null,s?.numResults&&(this.activeMenu="suggestion",this._scrollToTopSuggestion()),s}catch(s){return this._suggestController!==t||(this._suggestController=null),null}}render(){return b("div",{class:this.classes(g.base,w.widget)},b("div",{class:g.container},this._renderSourcesMenu(),this._renderForm()))}_handleInputKeydown(e){"Tab"===e.key&&this._cancelSuggest()}_emitFocus(){this.emit("search-focus")}_emitBlur(){this.emit("search-blur")}async _handleFocus(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const e=this._focusAbortController.signal;await l(u(e)),this._autocompleteNode?.setFocus()}_renderSourcesMenu(){const{messages:e,_isDisabled:t,_effectiveActiveMenu:o}=this,{allSources:s,searchAllEnabled:r}=this.viewModel;return s.length>1?b("calcite-dropdown",{bind:this,class:g.dropdown,disabled:t,open:"source"===o,overlayPositioning:"fixed",onCalciteDropdownClose:this._handleSourceClose,onCalciteDropdownOpen:this._handleSourceOpen,onCalciteDropdownSelect:this._handleSourceSelect},b("calcite-button",{appearance:"outline-fill",iconStart:"caret-down",kind:"neutral",label:e.searchIn,slot:"trigger"}),b("calcite-dropdown-group",{groupTitle:e.searchIn},r?this._renderSource(v.ALL_INDEX):null,s.map(((e,t)=>this._renderSource(t))).toArray())):null}_renderUseCurrentLocation(){const{_currentLocationValue:e}=this;return b("calcite-autocomplete-item",{heading:this.messages.useCurrentLocation,iconStart:"gps-on",key:e,value:e})}_handleAutocompleteCreate(e){this._autocompleteNode=e}_handleCalciteAutocompleteTextInput(e){const t=e.target.inputValue;t!==this.viewModel.searchTerm&&(this.viewModel.searchTerm=t,t||this.clear(),this.suggest())}_handleAutocompleteOpen(){this.activeMenu="suggestion"}_handleAutocompleteClose(){"suggestion"===this.activeMenu&&(this.activeMenu="none")}_handleCalciteAutocompleteChange(e){const t=e.target.value;if(t===this._currentLocationValue)return void this._useCurrentLocation();const o=JSON.parse(t),s=this.viewModel.suggestions?.find((({sourceIndex:e})=>e===o.sourceIndex))?.results?.find((({key:e})=>`${e}`==`${o.key}`));s&&this.search(s)}_renderAutocomplete(){const{_effectiveActiveMenu:e,messages:t,_isDisabled:o}=this,{maxInputLength:s,placeholder:r,searchTerm:i,state:l}=this.viewModel,n=this.label??t.searchButtonTitle??"";return b("calcite-autocomplete",{afterCreate:this._handleAutocompleteCreate,autocomplete:"off",bind:this,class:g.autocomplete,disabled:o,icon:this.icon,inputValue:i,label:n,loading:"searching"===l,maxLength:s,name:this.id,onblur:this._emitBlur,onfocus:this._emitFocus,onkeydown:this._handleInputKeydown,open:"suggestion"===e,overlayPositioning:"fixed",placeholder:r,title:i?"":r,onCalciteAutocompleteChange:this._handleCalciteAutocompleteChange,onCalciteAutocompleteClose:this._handleAutocompleteClose,onCalciteAutocompleteOpen:this._handleAutocompleteOpen,onCalciteAutocompleteTextChange:this._handleCalciteAutocompleteTextInput,onCalciteAutocompleteTextInput:this._handleCalciteAutocompleteTextInput},this._renderSuggestions(),this._renderNotices())}_renderForm(){return b("form",{bind:this,class:g.form,disabled:this._isDisabled,key:g.form,onsubmit:this._formSubmit,role:"search"},this._renderAutocomplete())}_renderSuggestGroup(e){return e.results?.map((e=>this._renderSuggestion(e)))}_renderSuggestions(){const{suggestions:e}=this.viewModel;return this._showNoResults?null:this._showCurrentLocation?this._renderUseCurrentLocation():e?.map((e=>this._renderSuggestResults(e)))}_renderSuggestResults(e){const{allSources:t,activeSourceIndex:o}=this.viewModel,{sourceIndex:s}=e,r=e.results?.length,i=t.length>1&&o===v.ALL_INDEX,l=this._getSourceName(s);return r&&i?b("calcite-autocomplete-item-group",{heading:l,key:`suggestion-group-${l}-${s}`},this._renderSuggestGroup(e)):this._renderSuggestGroup(e)}_renderSuggestion({key:e,sourceIndex:t,text:o}){const s={key:e,sourceIndex:t};return b("calcite-autocomplete-item",{heading:o??this.messages.untitledResult,key:`suggestion_${e}`,value:JSON.stringify(s)})}_renderSource(e){const t=this._getSourceName(e);return b("calcite-dropdown-item",{"data-source-index":`${e}`,key:`source-${t}-${e}`,selected:e===this.viewModel.activeSourceIndex},t)}_renderNoResultsWarning(e){const{messages:t}=this,o=e?y(t.noResultsFoundForValue,{value:`"${e}"`}):t.noResultsFound;return b("calcite-notice",{icon:"exclamation-mark-triangle",key:"no-results-warning",kind:"warning",open:!0,slot:"content-bottom"},b("div",{slot:"title"},t.noResults),b("div",{slot:"message"},o))}_renderLocateError(){return b("calcite-notice",{icon:"exclamation-mark-circle",key:"locate-warning",kind:"danger",open:!0,slot:"content-bottom"},b("div",{slot:"message"},this.messages.locateError))}_renderNotices(){return this._locateFailed?this._renderLocateError():this._showNoResults?this._renderNoResultsWarning(this._lastSearchTerm??this.viewModel.searchTerm):null}async _useCurrentLocation(){this._cancelQueries();const e=new AbortController,{signal:t}=e;this._searchController=e;try{await this.viewModel.searchNearby({signal:t})}catch(o){n(o)||(this._locateFailed=!0,this.activeMenu="suggestion")}finally{this._searchController=null}}_handleSourceOpen(){this.activeMenu="source"}_handleSourceClose(){"source"===this.activeMenu&&(this.activeMenu="none")}_handleSourceSelect(e){const t=e.target.selectedItems[0].getAttribute("data-source-index");t&&(this.viewModel.activeSourceIndex=parseInt(t,10))}_cancelSuggest(){this.activeMenu="none",this._locateFailed=!1,this._showNoResults=!1,this._suggestController=i(this._suggestController)}_cancelQueries(){this._cancelSuggest(),this._searchController=i(this._searchController)}_scrollToTopSuggestion(){this._autocompleteNode?.scrollContentTo({top:0})}_formSubmit(e){e.preventDefault(),this.activeMenu="none",this._lastSearchTerm=this.searchTerm,this.searchTerm&&this.search()}_getSourceName(e){const{messages:t}=this,{allSources:o}=this.viewModel,s=o.at(e);return e===v.ALL_INDEX?t.all:s?.name||t.untitledSource}};e([h()],C.prototype,"_locateFailed",void 0),e([h()],C.prototype,"_showNoResults",void 0),e([h()],C.prototype,"_isDisabled",null),e([h()],C.prototype,"_showCurrentLocation",null),e([h()],C.prototype,"_effectiveActiveMenu",null),e([h()],C.prototype,"activeMenu",null),e([h({readOnly:!0})],C.prototype,"activeSource",null),e([h()],C.prototype,"activeSourceIndex",null),e([h()],C.prototype,"allPlaceholder",null),e([h({readOnly:!0})],C.prototype,"allSources",null),e([h()],C.prototype,"autoNavigate",null),e([h()],C.prototype,"autoSelect",null),e([h({readOnly:!0})],C.prototype,"defaultSources",null),e([h()],C.prototype,"disabled",void 0),e([h()],C.prototype,"goToOverride",null),e([h()],C.prototype,"icon",null),e([h()],C.prototype,"includeDefaultSources",null),e([h()],C.prototype,"label",null),e([h()],C.prototype,"locationEnabled",null),e([h()],C.prototype,"maxResults",null),e([h()],C.prototype,"maxSuggestions",null),e([h(),S("esri/widgets/Search/t9n/Search")],C.prototype,"messages",void 0),e([h(),S("esri/t9n/common")],C.prototype,"messagesCommon",void 0),e([h()],C.prototype,"minSuggestCharacters",null),e([h()],C.prototype,"popupEnabled",null),e([h()],C.prototype,"popupTemplate",null),e([h()],C.prototype,"portal",null),e([h()],C.prototype,"resultGraphic",null),e([h()],C.prototype,"resultGraphicEnabled",null),e([h({readOnly:!0})],C.prototype,"results",null),e([h()],C.prototype,"searchAllEnabled",null),e([h()],C.prototype,"searchTerm",null),e([h({readOnly:!0})],C.prototype,"selectedResult",null),e([h()],C.prototype,"sources",null),e([h({readOnly:!0})],C.prototype,"suggestions",null),e([h()],C.prototype,"suggestionsEnabled",null),e([h()],C.prototype,"view",null),e([M(["search-complete","search-clear","search-start","select-result","suggest-start","suggest-complete"]),h({type:v})],C.prototype,"viewModel",void 0),C=e([d("esri.widgets.Search")],C);const f=C;export{f as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{deprecateWidget as t,deprecatedPropertyValue as o}from"../core/deprecate.js";import s from"../core/Logger.js";import{destroyMaybe as r,abortMaybe as i}from"../core/maybe.js";import{ignoreAbortErrors as l,isAbortError as n}from"../core/promiseUtils.js";import{watch as a,initial as c}from"../core/reactiveUtils.js";import{waitAnimationFrame as u}from"../core/scheduling.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import p from"./Widget.js";import{css as g}from"./Search/css.js";import m from"./Search/SearchResultRenderer.js";import v from"./Search/SearchViewModel.js";import{loadCalciteComponents as _}from"./support/componentsUtils.js";import{globalCss as w}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as S}from"./support/decorators/messageBundle.js";import{vmEvent as M}from"./support/decorators/vmEvent.js";import{tsx as b}from"./support/jsxFactory.js";import{substitute as y}from"../intl/substitute.js";let C=class extends p{constructor(e,o){super(e,o),this._currentLocationValue=`${this.id}-search-use-current-location`,this._autocompleteNode=null,this._focusAbortController=null,this._searchResultRenderer=new m,this._suggestController=null,this._searchController=null,this._lastSearchTerm="",this._locateFailed=!1,this._showNoResults=!1,this.disabled=!1,this.messages=null,this.messagesCommon=null,this.viewModel=new v,this._renderSearchResultsContent=()=>this._searchResultRenderer,t(s.getLogger(this),"Search","arcgis-search",{version:"4.33"}),this.addHandles([a((()=>this.viewModel),(e=>this._searchResultRenderer.viewModel=e),c),a((()=>this.viewModel.results),(()=>this._searchResultRenderer.showMoreResultsOpen=!1)),a((()=>this.viewModel?.defaultPopupTemplate),(e=>{e&&(e.content=this._renderSearchResultsContent)}),c)])}loadDependencies(){return _({autocomplete:()=>import("@esri/calcite-components/dist/components/calcite-autocomplete"),"autocomplete-item-group":()=>import("@esri/calcite-components/dist/components/calcite-autocomplete-item-group"),"autocomplete-item":()=>import("@esri/calcite-components/dist/components/calcite-autocomplete-item"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._cancelQueries(),this._searchResultRenderer=r(this._searchResultRenderer),this._focusAbortController?.abort()}get _isDisabled(){const{state:e}=this.viewModel;return"disabled"===e||"loading"===e||this.disabled}get _showCurrentLocation(){return this.locationEnabled&&!this.searchTerm?.trim()}get _effectiveActiveMenu(){const{activeMenu:e}=this;return this._isDisabled?"none":"warning"===e?"suggestion":e}get activeMenu(){return"none"}set activeMenu(e){"warning"===e&&o(s.getLogger(this),"activeMenu","warning",{replacement:"Use the value 'suggestion' instead",version:"4.32",warnOnce:!0}),this._overrideIfSome("activeMenu",e)}get activeSource(){return this.viewModel?.activeSource}get activeSourceIndex(){return this.viewModel.activeSourceIndex}set activeSourceIndex(e){this.viewModel.activeSourceIndex=e}get allPlaceholder(){return this.viewModel.allPlaceholder}set allPlaceholder(e){this.viewModel.allPlaceholder=e}get allSources(){return this.viewModel.allSources}get autoNavigate(){return this.viewModel.autoNavigate}set autoNavigate(e){this.viewModel.autoNavigate=e}get autoSelect(){return this.viewModel.autoSelect}set autoSelect(e){this.viewModel.autoSelect=e}get defaultSources(){return this.viewModel.defaultSources}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"search"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultSources(){return this.viewModel.includeDefaultSources}set includeDefaultSources(e){this.viewModel.includeDefaultSources=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get locationEnabled(){return this.viewModel.locationEnabled}set locationEnabled(e){this.viewModel.locationEnabled=e}get maxResults(){return this.viewModel.maxResults}set maxResults(e){this.viewModel.maxResults=e}get maxSuggestions(){return this.viewModel.maxSuggestions}set maxSuggestions(e){this.viewModel.maxSuggestions=e}get minSuggestCharacters(){return this.viewModel.minSuggestCharacters}set minSuggestCharacters(e){this.viewModel.minSuggestCharacters=e}get popupEnabled(){return this.viewModel.popupEnabled}set popupEnabled(e){this.viewModel.popupEnabled=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get portal(){return this.viewModel?.portal}set portal(e){this.viewModel&&(this.viewModel.portal=e)}get resultGraphic(){return this.viewModel.resultGraphic}set resultGraphic(e){this.viewModel.resultGraphic=e}get resultGraphicEnabled(){return this.viewModel.resultGraphicEnabled}set resultGraphicEnabled(e){this.viewModel.resultGraphicEnabled=e}get results(){return this.viewModel.results}get searchAllEnabled(){return this.viewModel.searchAllEnabled}set searchAllEnabled(e){this.viewModel.searchAllEnabled=e}get searchTerm(){return this.viewModel.searchTerm}set searchTerm(e){this.viewModel.searchTerm=e}get selectedResult(){return this.viewModel.selectedResult}get sources(){return this.viewModel.sources}set sources(e){this.viewModel.sources=e}get suggestions(){return this.viewModel.suggestions}get suggestionsEnabled(){return this.viewModel.suggestionsEnabled}set suggestionsEnabled(e){this.viewModel.suggestionsEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}clear(){this._locateFailed=!1,this.viewModel.clear()}focus(){this._handleFocus(),this._emitFocus()}blur(){this._autocompleteNode?.blur(),this._emitBlur()}async search(e){this._cancelQueries();const t=new AbortController,{signal:o}=t;this._searchController=t;try{const s=await this.viewModel.search(e,{signal:o});if(this._searchController!==t)return;return s?.numResults||(this._showNoResults=!0,this.activeMenu="suggestion"),this._searchController=null,s}catch(s){if(this._searchController!==t)return;return void(this._searchController=null)}}async suggest(e){this._cancelSuggest();const t=new AbortController,{signal:o}=t;this._suggestController=t;try{const s=await this.viewModel.suggest(e,null,{signal:o});if(this._suggestController!==t)return;return this._suggestController=null,s?.numResults&&(this.activeMenu="suggestion",this._scrollToTopSuggestion()),s}catch(s){return this._suggestController!==t||(this._suggestController=null),null}}render(){return b("div",{class:this.classes(g.base,w.widget)},b("div",{class:g.container},this._renderSourcesMenu(),this._renderForm()))}_handleInputKeydown(e){"Tab"===e.key&&this._cancelSuggest()}_emitFocus(){this.emit("search-focus")}_emitBlur(){this.emit("search-blur")}async _handleFocus(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const e=this._focusAbortController.signal;await l(u(e)),this._autocompleteNode?.setFocus()}_renderSourcesMenu(){const{messages:e,_isDisabled:t,_effectiveActiveMenu:o}=this,{allSources:s,searchAllEnabled:r}=this.viewModel;return s.length>1?b("calcite-dropdown",{bind:this,class:g.dropdown,disabled:t,open:"source"===o,overlayPositioning:"fixed",onCalciteDropdownClose:this._handleSourceClose,onCalciteDropdownOpen:this._handleSourceOpen,onCalciteDropdownSelect:this._handleSourceSelect},b("calcite-button",{appearance:"outline-fill",iconStart:"caret-down",kind:"neutral",label:e.searchIn,slot:"trigger"}),b("calcite-dropdown-group",{groupTitle:e.searchIn},r?this._renderSource(v.ALL_INDEX):null,s.map(((e,t)=>this._renderSource(t))).toArray())):null}_renderUseCurrentLocation(){const{_currentLocationValue:e}=this;return b("calcite-autocomplete-item",{heading:this.messages.useCurrentLocation,iconStart:"gps-on",key:e,value:e})}_handleAutocompleteCreate(e){this._autocompleteNode=e}_handleCalciteAutocompleteTextInput(e){const t=e.target.inputValue;t!==this.viewModel.searchTerm&&(this.viewModel.searchTerm=t,t||this.clear(),this.suggest())}_handleAutocompleteOpen(){this.activeMenu="suggestion"}_handleAutocompleteClose(){"suggestion"===this.activeMenu&&(this.activeMenu="none")}_handleCalciteAutocompleteChange(e){const t=e.target.value;if(t===this._currentLocationValue)return void this._useCurrentLocation();const o=JSON.parse(t),s=this.viewModel.suggestions?.find((({sourceIndex:e})=>e===o.sourceIndex))?.results?.find((({key:e})=>`${e}`==`${o.key}`));s&&this.search(s)}_renderAutocomplete(){const{_effectiveActiveMenu:e,messages:t,_isDisabled:o}=this,{maxInputLength:s,placeholder:r,searchTerm:i,state:l}=this.viewModel,n=this.label??t.searchButtonTitle??"";return b("calcite-autocomplete",{afterCreate:this._handleAutocompleteCreate,autocomplete:"off",bind:this,class:g.autocomplete,disabled:o,icon:this.icon||!1,inputValue:i,label:n,loading:"searching"===l,maxLength:s,name:this.id,onblur:this._emitBlur,onfocus:this._emitFocus,onkeydown:this._handleInputKeydown,open:"suggestion"===e,overlayPositioning:"fixed",placeholder:r,title:i?"":r,onCalciteAutocompleteChange:this._handleCalciteAutocompleteChange,onCalciteAutocompleteClose:this._handleAutocompleteClose,onCalciteAutocompleteOpen:this._handleAutocompleteOpen,onCalciteAutocompleteTextChange:this._handleCalciteAutocompleteTextInput,onCalciteAutocompleteTextInput:this._handleCalciteAutocompleteTextInput},this._renderSuggestions(),this._renderNotices())}_renderForm(){return b("form",{bind:this,class:g.form,disabled:this._isDisabled,key:g.form,onsubmit:this._formSubmit,role:"search"},this._renderAutocomplete())}_renderSuggestGroup(e){return e.results?.map((e=>this._renderSuggestion(e)))}_renderSuggestions(){const{suggestions:e}=this.viewModel;return this._showNoResults?null:this._showCurrentLocation?this._renderUseCurrentLocation():e?.map((e=>this._renderSuggestResults(e)))}_renderSuggestResults(e){const{allSources:t,activeSourceIndex:o}=this.viewModel,{sourceIndex:s}=e,r=e.results?.length,i=t.length>1&&o===v.ALL_INDEX,l=this._getSourceName(s);return r&&i?b("calcite-autocomplete-item-group",{heading:l,key:`suggestion-group-${l}-${s}`},this._renderSuggestGroup(e)):this._renderSuggestGroup(e)}_renderSuggestion({key:e,sourceIndex:t,text:o}){const s={key:e,sourceIndex:t};return b("calcite-autocomplete-item",{heading:o??this.messages.untitledResult,key:`suggestion_${e}`,value:JSON.stringify(s)})}_renderSource(e){const t=this._getSourceName(e);return b("calcite-dropdown-item",{"data-source-index":`${e}`,key:`source-${t}-${e}`,selected:e===this.viewModel.activeSourceIndex},t)}_renderNoResultsWarning(e){const{messages:t}=this,o=e?y(t.noResultsFoundForValue,{value:`"${e}"`}):t.noResultsFound;return b("calcite-notice",{icon:"exclamation-mark-triangle",key:"no-results-warning",kind:"warning",open:!0,slot:"content-bottom"},b("div",{slot:"title"},t.noResults),b("div",{slot:"message"},o))}_renderLocateError(){return b("calcite-notice",{icon:"exclamation-mark-circle",key:"locate-warning",kind:"danger",open:!0,slot:"content-bottom"},b("div",{slot:"message"},this.messages.locateError))}_renderNotices(){return this._locateFailed?this._renderLocateError():this._showNoResults?this._renderNoResultsWarning(this._lastSearchTerm??this.viewModel.searchTerm):null}async _useCurrentLocation(){this._cancelQueries();const e=new AbortController,{signal:t}=e;this._searchController=e;try{await this.viewModel.searchNearby({signal:t})}catch(o){n(o)||(this._locateFailed=!0,this.activeMenu="suggestion")}finally{this._searchController=null}}_handleSourceOpen(){this.activeMenu="source"}_handleSourceClose(){"source"===this.activeMenu&&(this.activeMenu="none")}_handleSourceSelect(e){const t=e.target.selectedItems[0].getAttribute("data-source-index");t&&(this.viewModel.activeSourceIndex=parseInt(t,10))}_cancelSuggest(){this.activeMenu="none",this._locateFailed=!1,this._showNoResults=!1,this._suggestController=i(this._suggestController)}_cancelQueries(){this._cancelSuggest(),this._searchController=i(this._searchController)}_scrollToTopSuggestion(){this._autocompleteNode?.scrollContentTo({top:0})}_formSubmit(e){e.preventDefault(),this.activeMenu="none",this._lastSearchTerm=this.searchTerm,this.searchTerm&&this.search()}_getSourceName(e){const{messages:t}=this,{allSources:o}=this.viewModel,s=o.at(e);return e===v.ALL_INDEX?t.all:s?.name||t.untitledSource}};e([h()],C.prototype,"_locateFailed",void 0),e([h()],C.prototype,"_showNoResults",void 0),e([h()],C.prototype,"_isDisabled",null),e([h()],C.prototype,"_showCurrentLocation",null),e([h()],C.prototype,"_effectiveActiveMenu",null),e([h()],C.prototype,"activeMenu",null),e([h({readOnly:!0})],C.prototype,"activeSource",null),e([h()],C.prototype,"activeSourceIndex",null),e([h()],C.prototype,"allPlaceholder",null),e([h({readOnly:!0})],C.prototype,"allSources",null),e([h()],C.prototype,"autoNavigate",null),e([h()],C.prototype,"autoSelect",null),e([h({readOnly:!0})],C.prototype,"defaultSources",null),e([h()],C.prototype,"disabled",void 0),e([h()],C.prototype,"goToOverride",null),e([h()],C.prototype,"icon",null),e([h()],C.prototype,"includeDefaultSources",null),e([h()],C.prototype,"label",null),e([h()],C.prototype,"locationEnabled",null),e([h()],C.prototype,"maxResults",null),e([h()],C.prototype,"maxSuggestions",null),e([h(),S("esri/widgets/Search/t9n/Search")],C.prototype,"messages",void 0),e([h(),S("esri/t9n/common")],C.prototype,"messagesCommon",void 0),e([h()],C.prototype,"minSuggestCharacters",null),e([h()],C.prototype,"popupEnabled",null),e([h()],C.prototype,"popupTemplate",null),e([h()],C.prototype,"portal",null),e([h()],C.prototype,"resultGraphic",null),e([h()],C.prototype,"resultGraphicEnabled",null),e([h({readOnly:!0})],C.prototype,"results",null),e([h()],C.prototype,"searchAllEnabled",null),e([h()],C.prototype,"searchTerm",null),e([h({readOnly:!0})],C.prototype,"selectedResult",null),e([h()],C.prototype,"sources",null),e([h({readOnly:!0})],C.prototype,"suggestions",null),e([h()],C.prototype,"suggestionsEnabled",null),e([h()],C.prototype,"view",null),e([M(["search-complete","search-clear","search-start","select-result","suggest-start","suggest-complete"]),h({type:v})],C.prototype,"viewModel",void 0),C=e([d("esri.widgets.Search")],C);const f=C;export{f 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{fetchThumbnail as r}from"../symbolPreviewUtils.js";import o from"./ItemBase.js";let s=class extends o{constructor(t){super(t),this._title=null,this._thumbnail=null,this.graphic=null,this.layer=null,this.layerItem=null,this.thumbnailSize=24}get key(){return`${this.layer.id}:${this.objectId??this.graphic.uid}`}get metadata(){const{layerItem:t}=this;return{parentTitle:t.title??void 0,groupTitle:t.groupLayerItem?.title??void 0}}get objectId(){return this.graphic.getObjectId()}get title(){return this._title??this.objectId?.toString()}get thumbnail(){return this._thumbnail??void 0}async fetchThumbnail(){return this._thumbnail=await r(this.graphic,this.layer,{maxSize:this.thumbnailSize})}async sync(t){t.push(this._setFeatureTitle())}async _setFeatureTitle(){const{graphic:t,key:e,layer:i,viewModel:r}=this,o=r.featureTitleMap.get(e)||(i?.getFeatureTitle?await i.getFeatureTitle(t,{fetchMissingFields:!1}):null);o&&r.featureTitleMap.set(e,o),this._title=o}};t([e()],s.prototype,"_title",void 0),t([e()],s.prototype,"_thumbnail",void 0),t([e()],s.prototype,"graphic",void 0),t([e()],s.prototype,"key",null),t([e()],s.prototype,"layer",void 0),t([e()],s.prototype,"layerItem",void 0),t([e()],s.prototype,"metadata",null),t([e()],s.prototype,"objectId",null),t([e()],s.prototype,"title",null),t([e()],s.prototype,"thumbnail",null),t([e()],s.prototype,"thumbnailSize",void 0),s=t([i("esri.widgets.support.SelectionList.FeatureItem")],s);const l=s;export{l as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{isSome as e}from"../../../core/arrayUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{fetchThumbnail as l}from"../symbolPreviewUtils.js";import s from"./ItemBase.js";let o=class extends s{constructor(t){super(t),this._title=null,this._thumbnail=null,this.graphic=null,this.layer=null,this.layerItem=null,this.thumbnailSize=24}get _filterTerms(){return[this.title,this.layerItem.title,this.layerItem.groupLayerItem?.title].filter(e)}get key(){return`${this.layer.id}:${this.objectId??this.graphic.uid}`}get objectId(){return this.graphic.getObjectId()}get title(){return this._title??this.objectId?.toString()}get thumbnail(){return this._thumbnail??void 0}get thumbnailKey(){return`${this.key}-${this.graphic.uid}`}get visible(){const{_filterTerms:t,viewModel:{activeLayerItem:e,filterText:i}}=this;if(e&&e.layer!==this.layer)return!1;if(null==i||""===i||!t.length)return!0;const r=new RegExp(i,"iu");return t.some((t=>r.test(t)))}async fetchThumbnail(){return this._thumbnail=await l(this.graphic,this.layer,{maxSize:this.thumbnailSize})}async sync(t){t.push(this._setFeatureTitle())}async _setFeatureTitle(){const{graphic:t,key:e,layer:i,viewModel:r}=this,l=r.featureTitleMap.get(e)||(i?.getFeatureTitle?await i.getFeatureTitle(t,{fetchMissingFields:!1}):null);l&&r.featureTitleMap.set(e,l),this._title=l}};t([i()],o.prototype,"_filterTerms",null),t([i()],o.prototype,"_title",void 0),t([i()],o.prototype,"_thumbnail",void 0),t([i()],o.prototype,"graphic",void 0),t([i()],o.prototype,"key",null),t([i()],o.prototype,"layer",void 0),t([i()],o.prototype,"layerItem",void 0),t([i()],o.prototype,"objectId",null),t([i()],o.prototype,"title",null),t([i()],o.prototype,"thumbnail",null),t([i()],o.prototype,"thumbnailKey",null),t([i()],o.prototype,"thumbnailSize",void 0),t([i()],o.prototype,"visible",null),o=t([r("esri.widgets.support.SelectionList.FeatureItem")],o);const a=o;export{a 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../core/has.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import s from"./ItemBase.js";let o=class extends s{constructor(e){super(e),this.items=[],this.layer=null}get layers(){const{layer:e}=this;return"group"===e.type?e.layers.toArray().reverse():"subtype-group"===e.type?e.sublayers.toArray().reverse():[]}get maxVisibleFeatureCountExceeded(){return this.items.some((e=>e.maxVisibleFeatureCountExceeded))}get total(){return this.items.reduce(((e,r)=>e+r.total),0)}async sync({controller:e,promises:r}){const{layers:t,viewModel:s}=this;this.items=s.layersToItems({controller:e,groupLayerItem:this,layers:t,promises:r})}};e([r()],o.prototype,"items",void 0),e([r()],o.prototype,"layer",void 0),e([r()],o.prototype,"layers",null),e([r()],o.prototype,"maxVisibleFeatureCountExceeded",null),e([r()],o.prototype,"total",null),o=e([t("esri.widgets.support.SelectionList.GroupLayerItem")],o);const a=o;export{a as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../core/has.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import s from"./ItemBase.js";let o=class extends s{constructor(e){super(e),this.items=[],this.layer=null}get layers(){const{layer:e}=this;return"group"===e.type?e.layers.toArray().reverse():"subtype-group"===e.type?e.sublayers.toArray().reverse():[]}get maxVisibleFeatureCountExceeded(){return this.items.some((e=>e.maxVisibleFeatureCountExceeded))}get total(){return this.items.reduce(((e,t)=>e+t.total),0)}get visible(){return this.items.some((e=>e.visible))}get visibleTotal(){return this.items.reduce(((e,t)=>e+t.visibleTotal),0)}async sync({controller:e,promises:t}){const{layers:r,viewModel:s}=this;this.items=s.layersToItems({controller:e,groupLayerItem:this,layers:r,promises:t})}};e([t()],o.prototype,"items",void 0),e([t()],o.prototype,"layer",void 0),e([t()],o.prototype,"layers",null),e([t()],o.prototype,"maxVisibleFeatureCountExceeded",null),e([t()],o.prototype,"total",null),e([t()],o.prototype,"visible",null),e([t()],o.prototype,"visibleTotal",null),o=e([r("esri.widgets.support.SelectionList.GroupLayerItem")],o);const i=o;export{i 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.34/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/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import o from"./FeatureItem.js";import s from"./ItemBase.js";import{getSuggestedQueryOutFields as a}from"../Selector2D/selectorUtils.js";let i=class extends s{constructor(e){super(e),this._onChangeController=null,this.featureItems=[],this.groupLayerItem=null,this.layer=null}get effectiveObjectIds(){return this.objectIds.slice(0,this.maxVisibleFeatureCountPerLayer)}get maxVisibleFeatureCountExceeded(){return this.objectIds.length>this.viewModel.maxVisibleFeatureCountPerLayer}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}get objectIds(){return this.viewModel.effectiveSelectionManager?.getSelection(this.layer)??[]}get total(){return this.objectIds.length}cancel(){this._onChangeController?.abort()}async sync({controller:e,promises:t}){this.cancel();const r=this.featureItems.slice(),o=new Map(r.map((e=>[e.objectId,e]))),s=this.effectiveObjectIds.slice(),a=[],i=[];for(const n of s){const e=o.get(n);e?(a.push(e),t.push(e.sync(t))):i.push(n)}if(this._onChangeController=e,i.length>0){const r=await this._createFeatureItems(i,e);for(const e of r)a.push(e),t.push(e.sync(t))}e.signal.aborted||(this.featureItems=a)}async _createFeatureItems(e,t){const{layer:r,layerView:s,viewModel:i}=this,n=new Map;if(s){const r=s.createQuery();r.objectIds=e,r.outFields=["*"],r.returnGeometry=!0;const o=await s.queryFeatures(r,t);for(const e of o.features){const t=e.getObjectId();null!=t&&n.set(t,e)}}if(t.signal.aborted)return[];const l=e.filter((e=>!n.has(e)));if(l.length){const{view:e}=this,o=r.createQuery();o.objectIds=l,o.outSpatialReference=e?.spatialReference,o.outFields=e?a(r,e,!0):["*"],o.returnGeometry=!0;const s=await r.queryFeatures(o,t);for(const t of s.features){const e=t.getObjectId();null!=e&&n.set(e,t)}}return Array.from(n.values()).map((e=>new o({graphic:e,layer:r,layerItem:this,viewModel:i})))}};e([t()],i.prototype,"_onChangeController",void 0),e([t()],i.prototype,"effectiveObjectIds",null),e([t()],i.prototype,"featureItems",void 0),e([t()],i.prototype,"groupLayerItem",void 0),e([t()],i.prototype,"layer",void 0),e([t()],i.prototype,"maxVisibleFeatureCountExceeded",null),e([t()],i.prototype,"maxVisibleFeatureCountPerLayer",null),e([t()],i.prototype,"objectIds",null),e([t()],i.prototype,"total",null),i=e([r("esri.widgets.support.SelectionList.LayerItem")],i);const n=i;export{n as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import o from"./FeatureItem.js";import s from"./ItemBase.js";import{getSuggestedQueryOutFields as i}from"../Selector2D/selectorUtils.js";let a=class extends s{constructor(e){super(e),this._onChangeController=null,this.featureItems=[],this.groupLayerItem=null,this.layer=null}get effectiveObjectIds(){return this.objectIds.slice(0,this.maxVisibleFeatureCountPerLayer)}get maxVisibleFeatureCountExceeded(){const{viewModel:e}=this;return this.objectIds.length>e.maxVisibleFeatureCountPerLayer&&this.visibleTotal===e.maxVisibleFeatureCountPerLayer}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}get objectIds(){return this.viewModel.effectiveSelectionManager?.getSelection(this.layer)??[]}get total(){return this.objectIds.length}get visible(){return this.featureItems.some((e=>e.visible))}get visibleTotal(){let e=0;return this.featureItems.forEach((t=>t.visible&&e++)),e}cancel(){this._onChangeController?.abort()}async sync({controller:e,promises:t}){this.cancel();const r=this.featureItems.slice(),o=new Map(r.map((e=>[e.objectId,e]))),s=this.effectiveObjectIds.slice(),i=[],a=[];for(const l of s){const e=o.get(l);e?(i.push(e),t.push(e.sync(t))):a.push(l)}if(this._onChangeController=e,a.length>0){const r=await this._createFeatureItems(a,e);for(const e of r)i.push(e),t.push(e.sync(t))}e.signal.aborted||(this.featureItems=i)}async _createFeatureItems(e,t){const{layer:r,layerView:s,viewModel:a}=this,l=new Map;if(s){const r=s.createQuery();r.objectIds=e,r.outFields=["*"],r.returnGeometry=!0;const o=await s.queryFeatures(r,t);for(const e of o.features){const t=e.getObjectId();null!=t&&l.set(t,e)}}if(t.signal.aborted)return[];const n=e.filter((e=>!l.has(e)));if(n.length){const{view:e}=this,o=r.createQuery();o.objectIds=n,o.outSpatialReference=e?.spatialReference,o.outFields=e?i(r,e,!0):["*"],o.returnGeometry=!0;const s=await r.queryFeatures(o,t);for(const t of s.features){const e=t.getObjectId();null!=e&&l.set(e,t)}}return Array.from(l.values()).map((e=>new o({graphic:e,layer:r,layerItem:this,viewModel:a})))}};e([t()],a.prototype,"_onChangeController",void 0),e([t()],a.prototype,"effectiveObjectIds",null),e([t()],a.prototype,"featureItems",void 0),e([t()],a.prototype,"groupLayerItem",void 0),e([t()],a.prototype,"layer",void 0),e([t()],a.prototype,"maxVisibleFeatureCountExceeded",null),e([t()],a.prototype,"maxVisibleFeatureCountPerLayer",null),e([t()],a.prototype,"objectIds",null),e([t()],a.prototype,"total",null),e([t()],a.prototype,"visible",null),e([t()],a.prototype,"visibleTotal",null),a=e([r("esri.widgets.support.SelectionList.LayerItem")],a);const l=a;export{l 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import o from"../../../core/Logger.js";import{removeMaybe as r}from"../../../core/maybe.js";import{ignoreAbortErrors as i,debounce as s}from"../../../core/promiseUtils.js";import{watch as a,on as l}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as p,isSubtypeSublayer as g}from"../../../layers/support/layerUtils.js";import{isSelectableLayer as y}from"../../../views/support/selectionUtils.js";import{goTo as m}from"../goToUtils.js";import u from"./GroupLayerItem.js";import f from"./LayerItem.js";import{computeEffectiveCount as d,getNestedLayerItems as v,isLayerItem as S,isGroupLayerItem as I,getNestedFeatureItems as C}from"./selectionListUtils.js";const b=100;let _=class extends t{constructor(e){super(e),this._groupItemCache=new Map,this._hoverHighlightHandle=null,this._layerItemCache=new Map,this._allLayerItems=null,this._onChangeAbortController=null,this._updatingHandles=new h,this.featureTitleMap=new Map,this.filterText=void 0,this.layer=null,this.maxVisibleFeatureCountPerLayer=500,this.selectionManager=null,this._onSelectionChangeController=async()=>{this._cancelOnSelectionChange();const e=new AbortController;this._onChangeAbortController=e,await this._updatingHandles.addPromise(i(this._onSelectionChange(e))),this._onChangeAbortController===e&&(this._onChangeAbortController=null);const t=this.layer&&this.effectiveSelectionManager?.getSelection(this.layer);t?.length||(this.layer=null)},this._cancelOnSelectionChange=()=>this._onChangeAbortController?.abort(),this._onSelectionChangeDebounced=s(this._onSelectionChangeController,b)}initialize(){this.addHandles([a((()=>[this.view,this.effectiveSelectionManager]),(()=>this._onSelectionChangeDebounced())),l((()=>this.effectiveSelectionManager?.sources),"change",(()=>this._onSelectionChangeDebounced())),l((()=>this.effectiveSelectionManager),"selection-change",(()=>this._onSelectionChangeDebounced()))])}destroy(){this.removeTemporaryHighlight(),this._updatingHandles.destroy()}get activeLayerItem(){const{layer:e}=this;return e&&this.layerItems.find((t=>t.layer===e))}get allLayerItems(){return this._allLayerItems??[]}get effectiveCount(){return d(this.allLayerItems)}get effectiveSelectionManager(){return this.selectionManager??this.view?.selectionManager}get isUpdating(){return!(!this._onChangeAbortController&&!this._updatingHandles.updating)}get layerItems(){return v(this.allLayerItems)}get layerViewMap(){const e=new Map,{view:t}=this;if(!t)return e;for(const o of t.allLayerViews)if(e.set(o.layer.id,o),p(o.layer))for(const t of o.layer.sublayers)e.set(t.id,o);return e}get maxVisibleFeatureCountExceeded(){return this.allLayerItems.some((e=>e.maxVisibleFeatureCountExceeded))}get selectionSources(){const e=this.effectiveSelectionManager,t=new Set;if(e?.sources)for(const o of e.sources)t.add(o);return t}get state(){const{view:e}=this;return e?e.ready?this.effectiveSelectionManager?"ready":"error":"loading":"disabled"}get viewLayersAndTables(){const{view:e}=this;return e?.map?[...e.map.layers.toArray().reverse(),...e.map.tables.toArray().reverse()]:[]}get visibleLayerCount(){const{effectiveSelectionManager:e}=this;return e&&0!==e.count?1===e.count||this.activeLayerItem?1:this.layerItems.length:0}get visibleFeatureCount(){const{activeLayerItem:e}=this;if(e)return e.maxVisibleFeatureCountExceeded?e.maxVisibleFeatureCountPerLayer:e.total;let t=0;for(const o of this.layerItems)t+=o.maxVisibleFeatureCountExceeded?o.maxVisibleFeatureCountPerLayer:o.total;return t}addTemporaryHighlight({graphic:e,layerView:t}){this.removeTemporaryHighlight(),t&&e&&(this._hoverHighlightHandle=t.highlight(e,{name:"temporary"}))}clear(){this.effectiveSelectionManager?.clear()}deselectFeatureItem(e){const t=e.graphic.getObjectId();null!=t&&this.effectiveSelectionManager?.removeFromSelection(e.layer,[t])}deselectGroupItem(e){e.items.forEach((e=>{S(e)?this.deselectLayerItem(e):this.deselectGroupItem(e)}))}deselectLayerItem(e){this.effectiveSelectionManager?.setSelection(e.layer,[])}deselectItem(e){I(e)?this.deselectGroupItem(e):S(e)?this.deselectLayerItem(e):this.deselectFeatureItem(e)}goToItem(e){S(e)||I(e)?this._goTo(C([e]).map((e=>e.graphic))):this._goTo(e.graphic)}layersToItems(e){const{controller:t,groupLayerItem:o,layers:r,promises:i}=e,{_groupItemCache:s,_layerItemCache:a,effectiveSelectionManager:l,viewLayersAndTables:n}=this,c=r??n;if(!l)return[];const h=[];for(const p of c)switch(p.type){case"subtype-group":case"group":{const e=s.get(p),o=e??new u({layer:p,viewModel:this});e||s.set(p,o),i.push(o.sync({controller:t,promises:i})),h.push(o)}break;default:if(y(p)||g(p)){const e=p,r=l.getSelection(e);if(!r?.length)continue;const s=a.get(e),n=s??new f({groupLayerItem:o,layer:e,viewModel:this});s||a.set(e,n),i.push(n.sync({controller:t,promises:i})),h.push(n)}}return h}removeFromSelection(e){this.effectiveSelectionManager?.removeFromSelection(e.layer,e.objectIds)}removeTemporaryHighlight(){this._hoverHighlightHandle=r(this._hoverHighlightHandle)}selectSingleFeatureItem(e){const t=e.objectId;if(null!=t&&this.effectiveSelectionManager)for(const{layer:o}of this.effectiveSelectionManager.selections)this.setSelection({layer:o,objectIds:o===e.layer?[t]:[]})}selectSingleGroupItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:o}of this.effectiveSelectionManager.selections)this.setSelection({layer:t,objectIds:t.parent===e.layer?o:[]})}selectSingleItem(e){I(e)?this.selectSingleGroupItem(e):S(e)?this.selectSingleLayerItem(e):this.selectSingleFeatureItem(e)}selectSingleLayerItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:o}of this.effectiveSelectionManager.selections)this.setSelection({layer:t,objectIds:t===e.layer?o:[]})}setSelection(e){this.effectiveSelectionManager?.setSelection(e.layer,e.objectIds)}async _goTo(e){const{view:t}=this;if(t)try{await m(t,e)}catch(r){"AbortError"!==r.name&&o.getLogger(this).warn("Failed to go to feature(s)",r)}}async _onSelectionChange(e){try{this.removeTemporaryHighlight();const t=[],o=this.layersToItems({controller:e,promises:t});t.length>0&&await Promise.all(t),this._onChangeAbortController===e&&(this._allLayerItems=o)}catch(t){o.getLogger(this).warn("Failed updating selection",t)}}};e([n()],_.prototype,"_groupItemCache",void 0),e([n()],_.prototype,"_hoverHighlightHandle",void 0),e([n()],_.prototype,"_layerItemCache",void 0),e([n()],_.prototype,"_allLayerItems",void 0),e([n()],_.prototype,"_onChangeAbortController",void 0),e([n()],_.prototype,"activeLayerItem",null),e([n()],_.prototype,"allLayerItems",null),e([n()],_.prototype,"effectiveCount",null),e([n()],_.prototype,"effectiveSelectionManager",null),e([n()],_.prototype,"featureTitleMap",void 0),e([n()],_.prototype,"filterText",void 0),e([n()],_.prototype,"isUpdating",null),e([n()],_.prototype,"layer",void 0),e([n()],_.prototype,"layerItems",null),e([n()],_.prototype,"layerViewMap",null),e([n()],_.prototype,"maxVisibleFeatureCountExceeded",null),e([n()],_.prototype,"maxVisibleFeatureCountPerLayer",void 0),e([n()],_.prototype,"selectionManager",void 0),e([n()],_.prototype,"selectionSources",null),e([n()],_.prototype,"state",null),e([n()],_.prototype,"view",void 0),e([n()],_.prototype,"viewLayersAndTables",null),e([n()],_.prototype,"visibleLayerCount",null),e([n()],_.prototype,"visibleFeatureCount",null),_=e([c("esri.widgets.support.SelectionList.SelectionListViewModel")],_);const L=_;export{L as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import r from"../../../core/Logger.js";import{removeMaybe as o}from"../../../core/maybe.js";import{ignoreAbortErrors as i,debounce as s}from"../../../core/promiseUtils.js";import{watch as l,on as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as p,isSubtypeSublayer as g}from"../../../layers/support/layerUtils.js";import{isSelectableLayer as m}from"../../../views/support/selectionUtils.js";import{goTo as y}from"../goToUtils.js";import u from"./GroupLayerItem.js";import f from"./LayerItem.js";import{computeEffectiveCount as d,getNestedLayerItems as v,isLayerItem as I,isGroupLayerItem as S,getNestedFeatureItems as C}from"./selectionListUtils.js";const b=100;let _=class extends t{constructor(e){super(e),this._groupItemCache=new Map,this._hoverHighlightHandle=null,this._layerItemCache=new Map,this._allLayerItems=null,this._onChangeAbortController=null,this._updatingHandles=new h,this.featureTitleMap=new Map,this.filterText=void 0,this.layer=null,this.maxVisibleFeatureCountPerLayer=500,this.selectionManager=null,this._onSelectionChangeController=async()=>{this._cancelOnSelectionChange();const e=new AbortController;this._onChangeAbortController=e,await this._updatingHandles.addPromise(i(this._generateListItems(e))),this._onChangeAbortController===e&&(this._onChangeAbortController=null);const t=this.layer&&this.effectiveSelectionManager?.getSelection(this.layer);t?.length||(this.layer=null)},this._cancelOnSelectionChange=()=>this._onChangeAbortController?.abort(),this._onSelectionChangeDebounced=s(this._onSelectionChangeController,b)}initialize(){this.addHandles([l((()=>[this.view,this.effectiveSelectionManager]),(()=>this._onSelectionChange())),a((()=>this.effectiveSelectionManager?.sources),"change",(()=>this._onSelectionChange())),a((()=>this.effectiveSelectionManager),"selection-change",(()=>this._onSelectionChange()))])}destroy(){this.removeTemporaryHighlight(),this._updatingHandles.destroy()}get activeLayerItem(){const{layer:e}=this;return e&&this.layerItems.find((t=>t.layer===e))}get allLayerItems(){return this._allLayerItems??[]}get effectiveCount(){return d(this.allLayerItems)}get effectiveSelectionManager(){return this.selectionManager??this.view?.selectionManager}get isUpdating(){return!(!this._onChangeAbortController&&!this._updatingHandles.updating)}get layerItems(){return v(this.allLayerItems)}get layerViewMap(){const e=new Map,{view:t}=this;if(!t)return e;for(const r of t.allLayerViews)if(e.set(r.layer.id,r),p(r.layer))for(const t of r.layer.sublayers)e.set(t.id,r);return e}get maxVisibleFeatureCountExceeded(){return this.allLayerItems.some((e=>e.maxVisibleFeatureCountExceeded))}get state(){const{view:e}=this;return e?e.ready?this.effectiveSelectionManager?"ready":"error":"loading":"disabled"}get viewLayersAndTables(){const{view:e}=this;return e?.map?[...e.map.layers.toArray().reverse(),...e.map.tables.toArray().reverse()]:[]}get visibleFeatureCount(){return this.activeLayerItem?.visibleTotal??this.visibleFeatureItems.length}get visibleFeatureItems(){return this.layerItems.flatMap((e=>e.featureItems.filter((e=>e.visible))))}get visibleLayerCount(){const{effectiveSelectionManager:e}=this;return e&&0!==e.count?1===e.count||this.activeLayerItem?1:this.layerItems.filter((e=>e.visible)).length:0}addTemporaryHighlight({graphic:e,layerView:t}){this.removeTemporaryHighlight(),t&&e&&(this._hoverHighlightHandle=t.highlight(e,{name:"temporary"}))}clear(){this.effectiveSelectionManager?.clear()}deselectFeatureItem(e){const t=e.graphic.getObjectId();null!=t&&this.effectiveSelectionManager?.removeFromSelection(e.layer,[t])}deselectGroupItem(e){e.items.forEach((e=>{I(e)?this.deselectLayerItem(e):this.deselectGroupItem(e)}))}deselectLayerItem(e){this.effectiveSelectionManager?.setSelection(e.layer,[])}deselectItem(e){S(e)?this.deselectGroupItem(e):I(e)?this.deselectLayerItem(e):this.deselectFeatureItem(e)}goToItem(e){I(e)||S(e)?this._goTo(C([e]).map((e=>e.graphic))):this._goTo(e.graphic)}layersToItems(e){const{controller:t,groupLayerItem:r,layers:o,promises:i}=e,{_groupItemCache:s,_layerItemCache:l,effectiveSelectionManager:a,viewLayersAndTables:n}=this,c=o??n;if(!a)return[];const h=[];for(const p of c)switch(p.type){case"subtype-group":case"group":{const e=s.get(p),r=e??new u({layer:p,viewModel:this});e||s.set(p,r),i.push(r.sync({controller:t,promises:i})),h.push(r)}break;default:if(m(p)||g(p)){const e=p,o=a.getSelection(e);if(!o?.length)continue;const s=l.get(e),n=s??new f({groupLayerItem:r,layer:e,viewModel:this});s||l.set(e,n),i.push(n.sync({controller:t,promises:i})),h.push(n)}}return h}removeFromSelection(e){this.effectiveSelectionManager?.removeFromSelection(e.layer,e.objectIds)}removeTemporaryHighlight(){this._hoverHighlightHandle=o(this._hoverHighlightHandle)}selectSingleFeatureItem(e){const t=e.objectId;if(null!=t&&this.effectiveSelectionManager)for(const{layer:r}of this.effectiveSelectionManager.selections)this.setSelection({layer:r,objectIds:r===e.layer?[t]:[]})}selectSingleGroupItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:r}of this.effectiveSelectionManager.selections)this.setSelection({layer:t,objectIds:t.parent===e.layer?r:[]})}selectSingleItem(e){S(e)?this.selectSingleGroupItem(e):I(e)?this.selectSingleLayerItem(e):this.selectSingleFeatureItem(e)}selectSingleLayerItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:r}of this.effectiveSelectionManager.selections)this.setSelection({layer:t,objectIds:t===e.layer?r:[]})}setSelection(e){this.effectiveSelectionManager?.setSelection(e.layer,e.objectIds)}async _goTo(e){const{view:t}=this;if(t)try{await y(t,e)}catch(o){"AbortError"!==o.name&&r.getLogger(this).warn("Failed to go to feature(s)",o)}}async _generateListItems(e){try{this.removeTemporaryHighlight();const t=[],r=this.layersToItems({controller:e,promises:t});t.length>0&&await Promise.all(t),this._onChangeAbortController===e&&(this._allLayerItems=r)}catch(t){r.getLogger(this).warn("Failed updating selection",t)}}_onSelectionChange(){i(this._onSelectionChangeDebounced())}};e([n()],_.prototype,"_groupItemCache",void 0),e([n()],_.prototype,"_hoverHighlightHandle",void 0),e([n()],_.prototype,"_layerItemCache",void 0),e([n()],_.prototype,"_allLayerItems",void 0),e([n()],_.prototype,"_onChangeAbortController",void 0),e([n()],_.prototype,"activeLayerItem",null),e([n()],_.prototype,"allLayerItems",null),e([n()],_.prototype,"effectiveCount",null),e([n()],_.prototype,"effectiveSelectionManager",null),e([n()],_.prototype,"featureTitleMap",void 0),e([n()],_.prototype,"filterText",void 0),e([n()],_.prototype,"isUpdating",null),e([n()],_.prototype,"layer",void 0),e([n()],_.prototype,"layerItems",null),e([n()],_.prototype,"layerViewMap",null),e([n()],_.prototype,"maxVisibleFeatureCountExceeded",null),e([n()],_.prototype,"maxVisibleFeatureCountPerLayer",void 0),e([n()],_.prototype,"selectionManager",void 0),e([n()],_.prototype,"state",null),e([n()],_.prototype,"view",void 0),e([n()],_.prototype,"viewLayersAndTables",null),e([n()],_.prototype,"visibleFeatureCount",null),e([n()],_.prototype,"visibleFeatureItems",null),e([n()],_.prototype,"visibleLayerCount",null),_=e([c("esri.widgets.support.SelectionList.SelectionListViewModel")],_);const L=_;export{L 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{isSome as t}from"../../core/arrayUtils.js";import{on as i,watch as s}from"../../core/reactiveUtils.js";import{throttle as o}from"../../core/throttle.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import n from"../Widget.js";import{loadCalciteComponents as a}from"./componentsUtils.js";import{globalCss as c}from"./globalCss.js";import{storeNode as m}from"./widgetUtils.js";import{messageBundle as d}from"./decorators/messageBundle.js";import{tsx as h}from"./jsxFactory.js";import{isGroupLayerItem as u,isLayerItem as p,isFeatureItem as y}from"./SelectionList/selectionListUtils.js";import v from"./SelectionList/SelectionListViewModel.js";import f from"./SelectionList/VisibleElements.js";import{formatNumber as g}from"../../intl/number.js";import{substitute as I}from"../../intl/substitute.js";const b="esri-selection-list",_=`${b}__list-item`,C={base:b,container:`${b}__container`,notice:`${b}__notice`,layerDropdown:`${b}__layer-dropdown`,listItemFeature:`${_}__feature`,listItemFeatureIcon:`${_}__feature-icon`,listItemIcon:`${_}__icon`,itemCount:`${b}__item-count`,totalCount:`${b}__total-count`};let w=class extends n{constructor(e,t){super(e,t),this._filteredFeatureInfo=null,this._iconIntersectionObserver=new IntersectionObserver(((e,t)=>{e.forEach((async e=>{if(e.isIntersecting){const i=e.target;if(this._hasIcon(i))return void t.unobserve(i);const s=this._getListItem(i);if(!s)return;this._setHasIcon(i,!0);const o=await s.fetchThumbnail().catch((()=>(this._setHasIcon(i,!1),null)));if(null==o)return;i.appendChild(o)}}))})),this._itemWithOpenMenu=null,this._list=null,this.displayMode="group",this.hightlightOnHoverEnabled=!1,this.itemActionConfigs=null,this.menuScale="m",this.messages=null,this.messagesCommon=null,this.onListItemSelect=null,this.scale="s",this.viewModel=new v,this.visibleElements=new f,this._afterItemCreate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},this._syncVisibleCountsThrottled=o((()=>this._syncVisibleCounts()),100),this.clear=this.clear.bind(this),this.collapseItems=this.collapseItems.bind(this),this.removeTemporaryHighlight=this.removeTemporaryHighlight.bind(this),this._filterPredicate=this._filterPredicate.bind(this)}initialize(){this.addHandles([i((()=>this.effectiveSelectionManager),"selection-change",(()=>{this._closeItemMenu(),this._syncVisibleCountsThrottled()})),s((()=>this.hightlightOnHoverEnabled),(e=>{e||this.removeTemporaryHighlight()})),s((()=>this._visibleCountsParameters),(()=>this._syncVisibleCountsThrottled()))])}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}get _filterIsActive(){const{filterText:e}=this;return!(!this._list||null==e||""===e)}get _visibleCountsParameters(){return{count:this.effectiveCount,filterText:this.filterText,layer:this.layer}}get activeLayerItem(){return this.viewModel.activeLayerItem}get allLayerItems(){return this.viewModel.allLayerItems}get effectiveCount(){return this.viewModel.effectiveCount}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get featureTitleMap(){return this.viewModel.featureTitleMap}get filterText(){return this.viewModel.filterText}set filterText(e){this.viewModel.filterText=e}get filteredFeatureItems(){return this._filteredFeatureInfo?.featureItems}get icon(){return"selection"}set icon(e){this._overrideIfSome("icon",e)}get isUpdating(){return this.viewModel.isUpdating}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layerItems(){return this.viewModel.layerItems}get layerViewMap(){return this.viewModel.layerViewMap}get maxVisibleFeatureCountExceeded(){return this.viewModel.maxVisibleFeatureCountExceeded}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}set maxVisibleFeatureCountPerLayer(e){this.viewModel.maxVisibleFeatureCountPerLayer=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get selectionSources(){return this.viewModel.selectionSources}get state(){return this.viewModel.state}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewLayersAndTables(){return this.viewModel.viewLayersAndTables}get visibleFeatureCount(){return this._filteredFeatureInfo?.featureItems.length??this.viewModel.visibleFeatureCount}get visibleLayerCount(){return this._filteredFeatureInfo?.layerCount??this.viewModel.visibleLayerCount}addTemporaryHighlight(e){this.viewModel.addTemporaryHighlight(e)}clear(){this.viewModel.clear()}deselectFeatureItem(e){this.viewModel.deselectFeatureItem(e)}deselectGroupItem(e){this.viewModel.deselectGroupItem(e)}deselectLayerItem(e){this.viewModel.deselectLayerItem(e)}deselectItem(e){this.viewModel.deselectItem(e)}collapseItems(){this._list?.filteredItems.forEach((e=>e.expanded=!1))}goToItem(e){this.viewModel.goToItem(e)}removeFromSelection(e){this.viewModel.removeFromSelection(e)}removeTemporaryHighlight(){this.viewModel.removeTemporaryHighlight()}selectSingleFeatureItem(e){this.viewModel.selectSingleFeatureItem(e)}selectSingleGroupItem(e){this.viewModel.selectSingleGroupItem(e)}selectSingleItem(e){this.viewModel.selectSingleItem(e)}selectSingleLayerItem(e){this.viewModel.selectSingleLayerItem(e)}setSelection(e){this.viewModel.setSelection(e)}render(){return h("div",{class:this.classes(C.base,c.widget,c.panel)},h("calcite-flow",null,h("calcite-flow-item",{class:C.container,heading:this.visibleElements.header?this.messages.selection:void 0,loading:"loading"===this.state,overlayPositioning:"fixed",scale:this.scale,selected:!0},h("calcite-panel",{overlayPositioning:"fixed",scale:this.scale},this._renderLayerFilter(),this._renderList()),this._renderTotalChip(),this._renderMenuActions())))}_renderTotalChip(){const{visibleElements:e}=this;if(!e.totalCount||!e.header)return;const{effectiveCount:t}=this,i=g(t),s=I(this.messages.selectionCount,{count:i});return h("calcite-chip",{appearance:"outline",class:C.totalCount,closable:t>0,closed:0===t,icon:this.maxVisibleFeatureCountExceeded?"exclamation-mark-triangle":void 0,label:i,scale:this.scale,slot:"header-actions-end",title:s,onCalciteChipClose:this.clear},i)}_renderMenuActions(){const{visibleElements:e}=this;if(!e.header||!e.menu)return;const{menuScale:t}=this,i=0===this.effectiveCount;return[h("calcite-action",{disabled:i,icon:"reset",key:"clear-action",onclick:this.clear,scale:t,slot:"header-menu-actions",text:this.messagesCommon.clear,textEnabled:!0}),h("calcite-action",{disabled:i,icon:"folders",key:"collapse-action",onclick:this.collapseItems,scale:t,slot:"header-menu-actions",text:this.messages.collapseAll,textEnabled:!0})]}_renderLayerFilter(){const{layerItems:e,messages:t}=this;if(!(0===this.effectiveCount||e.length<2)&&this.visibleElements.layerFilter)return h("calcite-combobox",{class:C.layerDropdown,clearDisabled:!0,label:t.filterByLayer,overlayPositioning:"fixed",placeholder:t.filterByLayer,scale:this.scale,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.filterText=void 0;const t=e.selectedItems[0]?.value??void 0;this.layer="all-layers"===t?void 0:t}},h("calcite-combobox-item",{heading:I(t.allLayersCount,{count:e.length}),icon:"layers",key:"all-layers",selected:null==this.layer,value:"all-layers"}),this.layerItems.map((e=>this._renderLayerFilterItem(e))))}_renderLayerFilterItem(e){const t=e.title||this.messages.untitledLayer;return h("calcite-combobox-item",{heading:t,icon:e.iconName,key:e.key,selected:e.layer===this.layer,value:e.layer})}_renderList(){const{messages:e}=this,t=!!(this.visibleElements.filter&&this.effectiveCount>0);return h("calcite-list",{afterCreate:m,bind:this,"data-node-ref":"_list",displayMode:"nested",filterEnabled:t,filterPlaceholder:e.filter,filterPredicate:this._filterPredicate,filterText:this.filterText,interactionMode:"interactive",label:e.widgetLabel,loading:this.isUpdating,scale:this.scale,selectionMode:"none",onCalciteListFilter:e=>this.filterText=e.target.filterText||void 0},this._renderListContent(this.allLayerItems),this._renderFilterNotice())}_renderListContent(e){return this.activeLayerItem?this._renderLayerItem(this.activeLayerItem):e.map((e=>u(e)?this._renderGroupItem(e):p(e)?this._renderLayerItem(e):null)).filter(t)}_renderFilterNotice(){const{visibleElements:e}=this;if(e.filter&&e.filterNotice)return h("calcite-notice",{icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale,slot:"filter-no-results"},h("div",{slot:"message"},this.messages.noMatchingFeatures))}_renderItemCount(e){if(!this.visibleElements.itemCount||this._filterIsActive)return;const{messages:t}=this,i=g(e.total),s=I(t.selectionCount,{count:i});return e.maxVisibleFeatureCountExceeded?h("span",{class:C.itemCount,slot:"content-end",title:s},h("calcite-icon",{icon:"exclamation-mark-triangle",scale:"s",title:t.tooManyFeatures}),`${g(this.maxVisibleFeatureCountPerLayer)}+`):h("span",{class:C.itemCount,slot:"content-end",title:s},i)}_renderItemActions(e){if(!this.visibleElements.itemMenus)return;const{messages:t,messagesCommon:i}=this,s=this._itemWithOpenMenu===e,o=y(e),l=p(e),r=u(e),n=o?t.deselectFeature:l?t.deselectLayer:t.deselectGroup;return[h("calcite-dropdown",{open:s,overlayPositioning:"fixed",scale:this.menuScale,slot:"actions-end",width:"m",onCalciteDropdownClose:()=>this._closeItemMenu(e),onCalciteDropdownOpen:()=>{this._itemWithOpenMenu=e}},h("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:this.scale,slot:"trigger",text:i.menu,textEnabled:!1}),s?h("calcite-dropdown-group",{selectionMode:"none"},h("calcite-dropdown-item",{iconStart:"layer-zoom-to",onCalciteDropdownItemSelect:()=>this.goToItem(e)},t.zoomTo),h("calcite-dropdown-item",{iconStart:"selection-filter",onCalciteDropdownItemSelect:()=>this.selectSingleItem(e)},o?t.onlySelectFeature:t.onlySelectThis),h("calcite-dropdown-item",{iconStart:"selection-x",onCalciteDropdownItemSelect:()=>this.deselectItem(e)},n),this.itemActionConfigs?.map((t=>{if(!t.type||"feature"===t.type&&o||"layer"===t.type&&l||"group"===t.type&&r)return h("calcite-dropdown-item",{iconStart:t.icon??void 0,onCalciteDropdownItemSelect:()=>t.callback({item:e})},t.label)}))):void 0)]}_renderGroupItem(e){const t=e.title||this.messages.untitledLayer;if(0===e.total)return;const{displayMode:i}=this;if("layer"===i||"feature"===i)return this._renderListContent(e.items);const{visibleElements:s}=this;return h("calcite-list-item",{afterCreate:this._syncVisibleCountsThrottled,afterRemoved:this._syncVisibleCountsThrottled,bind:this,closable:!!s.itemCloseActions,"data-type":"group",expanded:!0,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:t,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemActions(e),this._renderListContent(e.items))}_renderLayerItem(e){const{messages:t}=this,i=e.title||t.untitledLayer;if(0===e.total)return;if("feature"===this.displayMode)return this._renderItems(e.featureItems);const{visibleElements:s}=this;return h("calcite-list-item",{afterCreate:this._syncVisibleCountsThrottled,afterRemoved:this._syncVisibleCountsThrottled,bind:this,closable:!!s.itemCloseActions,"data-type":"layer",expanded:!0,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:i,scale:this.scale,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemCount(e),this._renderItemActions(e),this._renderItems(e.featureItems),e.maxVisibleFeatureCountExceeded?h("calcite-notice",{class:C.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale},h("div",{slot:"message"},t.tooManyFeatures)):void 0)}_renderItems(e){return e.map((e=>this._renderItem(e)))}_renderItem(e){const{hightlightOnHoverEnabled:t,messages:i,visibleElements:s}=this,o=e.title||i.untitledFeature,l=s.itemIcons&&"feature"!==this.displayMode;return h("calcite-list-item",{afterCreate:this._syncVisibleCountsThrottled,afterRemoved:this._syncVisibleCountsThrottled,bind:this,class:l?C.listItemFeatureIcon:C.listItemFeature,closable:!!s.itemCloseActions,"data-item":e,"data-type":"feature",key:e.key,label:o,metadata:e.metadata,name:o,onblur:t?()=>this.removeTemporaryHighlight():void 0,onfocus:t?()=>this.addTemporaryHighlight(e):void 0,onpointerenter:t?()=>this.addTemporaryHighlight(e):void 0,onpointerleave:t?()=>this.removeTemporaryHighlight():void 0,scale:this.scale,value:o,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemIcon(e),this._renderItemActions(e))}_renderItemIcon(e){if(this.visibleElements.itemIcons)return h("div",{class:C.listItemIcon,key:"content-start",slot:"content-start"},h("span",{afterCreate:this._afterItemCreate,afterRemoved:this._afterItemRemoved,"data-has-icon":!1,"data-item":e,key:"icon"}))}_getListItem(e){return e?.["data-item"]}_hasIcon(e){return!!e?.["data-has-icon"]}_setHasIcon(e,t){e&&(e["data-has-icon"]=t)}_onListItemSelect(e,t){t.stopPropagation(),this._closeItemMenu(),this.onListItemSelect?.({item:e})}_closeItemMenu(e){e&&e!==this._itemWithOpenMenu||(this._itemWithOpenMenu=null)}_syncVisibleCounts(){this._filteredFeatureInfo=this._getFilteredFeatureInfo()}_getFilteredFeatureInfo(){const{_list:e}=this;if(!e||!this._filterIsActive)return;const t=[];let i=0;return e.filteredItems.forEach((e=>{switch(e.getAttribute("data-type")){case"feature":{const i=this._getListItem(e);i&&t.push(i);break}case"layer":i++}})),{featureItems:t,layerCount:i}}_filterPredicate(e){const t=this._list?.filterText;if(null==t||""===t)return!0;const i=[e.value],s=e.metadata;return null!=s?.parentTitle&&i.push(s.parentTitle),null!=s?.groupTitle&&i.push(s.groupTitle),i.some((e=>new RegExp(t,"iu").test(e)))}};e([l()],w.prototype,"_filteredFeatureInfo",void 0),e([l()],w.prototype,"_filterIsActive",null),e([l()],w.prototype,"_itemWithOpenMenu",void 0),e([l()],w.prototype,"_list",void 0),e([l()],w.prototype,"_visibleCountsParameters",null),e([l()],w.prototype,"activeLayerItem",null),e([l()],w.prototype,"allLayerItems",null),e([l()],w.prototype,"displayMode",void 0),e([l()],w.prototype,"effectiveCount",null),e([l()],w.prototype,"effectiveSelectionManager",null),e([l()],w.prototype,"featureTitleMap",null),e([l()],w.prototype,"filterText",null),e([l()],w.prototype,"filteredFeatureItems",null),e([l()],w.prototype,"hightlightOnHoverEnabled",void 0),e([l()],w.prototype,"icon",null),e([l()],w.prototype,"itemActionConfigs",void 0),e([l()],w.prototype,"isUpdating",null),e([l()],w.prototype,"label",null),e([l()],w.prototype,"layer",null),e([l()],w.prototype,"layerItems",null),e([l()],w.prototype,"layerViewMap",null),e([l()],w.prototype,"maxVisibleFeatureCountExceeded",null),e([l()],w.prototype,"maxVisibleFeatureCountPerLayer",null),e([l()],w.prototype,"menuScale",void 0),e([l(),d("esri/widgets/support/SelectionList/t9n/SelectionList")],w.prototype,"messages",void 0),e([l(),d("esri/t9n/common")],w.prototype,"messagesCommon",void 0),e([l()],w.prototype,"onListItemSelect",void 0),e([l()],w.prototype,"scale",void 0),e([l()],w.prototype,"selectionManager",null),e([l()],w.prototype,"selectionSources",null),e([l()],w.prototype,"state",null),e([l()],w.prototype,"view",null),e([l()],w.prototype,"viewLayersAndTables",null),e([l()],w.prototype,"viewModel",void 0),e([l()],w.prototype,"visibleFeatureCount",null),e([l()],w.prototype,"visibleLayerCount",null),e([l({type:f,nonNullable:!0})],w.prototype,"visibleElements",void 0),w=e([r("esri.widgets.support.SelectionList")],w);const M=w;export{M as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{isSome as t}from"../../core/arrayUtils.js";import{on as i,watch as s}from"../../core/reactiveUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import n from"../Widget.js";import{loadCalciteComponents as r}from"./componentsUtils.js";import{globalCss as a}from"./globalCss.js";import{storeNode as c}from"./widgetUtils.js";import{messageBundle as m}from"./decorators/messageBundle.js";import{tsx as d}from"./jsxFactory.js";import{isGroupLayerItem as p,isLayerItem as h,isFeatureItem as u}from"./SelectionList/selectionListUtils.js";import v from"./SelectionList/SelectionListViewModel.js";import y from"./SelectionList/VisibleElements.js";import{formatNumber as g}from"../../intl/number.js";import{substitute as I}from"../../intl/substitute.js";const f="esri-selection-list",b=`${f}__list-item`,w={base:f,container:`${f}__container`,flowItem:`${f}__flow-item`,layerDropdown:`${f}__layer-dropdown`,listItemFeature:`${b}__feature`,listItemFeatureIcon:`${b}__feature-icon`,listItemIcon:`${b}__icon`,itemCount:`${f}__item-count`,notice:`${f}__notice`,panel:`${f}__panel`,totalCount:`${f}__total-count`};let _=class extends n{constructor(e,t){super(e,t),this._iconIntersectionObserver=new IntersectionObserver(((e,t)=>{e.forEach((async e=>{if(e.isIntersecting){const i=e.target;if(this._hasIcon(i))return void t.unobserve(i);const s=this._getListItem(i);if(!s)return;this._setHasIcon(i,!0);const o=s.thumbnail??await s.fetchThumbnail().catch((()=>(this._setHasIcon(i,!1),null)));if(null==o)return;i.appendChild(o)}}))})),this._itemWithOpenMenu=null,this._list=null,this.displayMode="group",this.hightlightOnHoverEnabled=!1,this.itemActionConfigs=null,this.menuScale="m",this.messages=null,this.messagesCommon=null,this.onListItemSelect=null,this.scale="s",this.viewModel=new v,this.visibleElements=new y,this._afterItemCreate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},this.clear=this.clear.bind(this),this.collapseItems=this.collapseItems.bind(this),this.removeTemporaryHighlight=this.removeTemporaryHighlight.bind(this)}initialize(){this.addHandles([i((()=>this.effectiveSelectionManager),"selection-change",(()=>this._closeItemMenu())),s((()=>this.hightlightOnHoverEnabled),(e=>{e||this.removeTemporaryHighlight()}))])}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return r({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}get activeLayerItem(){return this.viewModel.activeLayerItem}get allLayerItems(){return this.viewModel.allLayerItems}get effectiveCount(){return this.viewModel.effectiveCount}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get featureTitleMap(){return this.viewModel.featureTitleMap}get filterText(){return this.viewModel.filterText}set filterText(e){this.viewModel.filterText=e}get icon(){return"selection"}set icon(e){this._overrideIfSome("icon",e)}get isUpdating(){return this.viewModel.isUpdating}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layerItems(){return this.viewModel.layerItems}get layerViewMap(){return this.viewModel.layerViewMap}get maxVisibleFeatureCountExceeded(){return this.viewModel.maxVisibleFeatureCountExceeded}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}set maxVisibleFeatureCountPerLayer(e){this.viewModel.maxVisibleFeatureCountPerLayer=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get state(){return this.viewModel.state}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewLayersAndTables(){return this.viewModel.viewLayersAndTables}get visibleFeatureCount(){return this.viewModel.visibleFeatureCount}get visibleFeatureItems(){return this.viewModel.visibleFeatureItems}get visibleLayerCount(){return this.viewModel.visibleLayerCount}addTemporaryHighlight(e){this.viewModel.addTemporaryHighlight(e)}clear(){this.viewModel.clear()}deselectFeatureItem(e){this.viewModel.deselectFeatureItem(e)}deselectGroupItem(e){this.viewModel.deselectGroupItem(e)}deselectLayerItem(e){this.viewModel.deselectLayerItem(e)}deselectItem(e){this.viewModel.deselectItem(e)}collapseItems(){this._list?.filteredItems.forEach((e=>e.expanded=!1))}goToItem(e){this.viewModel.goToItem(e)}removeFromSelection(e){this.viewModel.removeFromSelection(e)}removeTemporaryHighlight(){this.viewModel.removeTemporaryHighlight()}selectSingleFeatureItem(e){this.viewModel.selectSingleFeatureItem(e)}selectSingleGroupItem(e){this.viewModel.selectSingleGroupItem(e)}selectSingleItem(e){this.viewModel.selectSingleItem(e)}selectSingleLayerItem(e){this.viewModel.selectSingleLayerItem(e)}setSelection(e){this.viewModel.setSelection(e)}render(){return d("div",{class:this.classes(w.base,a.widget,a.panel)},d("calcite-flow",null,d("calcite-flow-item",{class:w.flowItem,heading:this.visibleElements.header?this.messages.selection:void 0,loading:"loading"===this.state,overlayPositioning:"fixed",scale:this.scale,selected:!0},d("calcite-panel",{class:w.panel,overlayPositioning:"fixed",scale:this.scale},d("div",{class:w.container},this._renderActiveLayerDropdown(),this._renderFilterInput(),this._renderList(),this._renderFilterNotice())),this._renderTotalChip(),this._renderMenuActions())))}_renderTotalChip(){const{visibleElements:e}=this;if(!e.totalCount||!e.header)return;const{effectiveCount:t}=this,i=g(t),s=I(this.messages.selectionCount,{count:i});return d("calcite-chip",{appearance:"outline",class:w.totalCount,closable:t>0,closed:0===t,icon:this.maxVisibleFeatureCountExceeded?"exclamation-mark-triangle":void 0,label:i,scale:this.scale,slot:"header-actions-end",title:s,onCalciteChipClose:this.clear},i)}_renderMenuActions(){const{visibleElements:e}=this;if(!e.header||!e.menu)return;const{menuScale:t}=this,i=0===this.effectiveCount;return[d("calcite-action",{disabled:i,icon:"reset",key:"clear-action",onclick:this.clear,scale:t,slot:"header-menu-actions",text:this.messagesCommon.clear,textEnabled:!0}),d("calcite-action",{disabled:i,icon:"folders",key:"collapse-action",onclick:this.collapseItems,scale:t,slot:"header-menu-actions",text:this.messages.collapseAll,textEnabled:!0})]}_renderActiveLayerDropdown(){const{layerItems:e,messages:t}=this;if(!(0===this.effectiveCount||e.length<2)&&this.visibleElements.layerFilter)return d("calcite-combobox",{class:w.layerDropdown,clearDisabled:!0,label:t.filterByLayer,overlayPositioning:"fixed",placeholder:t.filterByLayer,scale:this.scale,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.filterText=void 0;const t=e.selectedItems[0]?.value??void 0;this.layer="all-layers"===t?void 0:t}},d("calcite-combobox-item",{heading:I(t.allLayersCount,{count:e.length}),icon:"layers",key:"all-layers",selected:null==this.layer,value:"all-layers"}),this.layerItems.map((e=>this._renderActiveLayerDropdownItem(e))))}_renderFilterInput(){if(this.visibleElements.filter&&0!==this.effectiveCount)return d("calcite-input",{clearable:!0,icon:"search",placeholder:this.messages.filter,scale:this.scale,value:this.filterText,onCalciteInputInput:({target:{value:e}})=>{this.filterText=e}})}_renderActiveLayerDropdownItem(e){const t=e.title||this.messages.untitledLayer;return d("calcite-combobox-item",{heading:t,icon:e.iconName,key:e.key,selected:e.layer===this.layer,value:e.layer})}_renderList(){const{messages:e}=this;if(0!==this.visibleFeatureCount)return d("calcite-list",{afterCreate:c,bind:this,"data-node-ref":"_list",displayMode:"nested",interactionMode:"interactive",label:e.widgetLabel,loading:this.isUpdating,scale:this.scale,selectionMode:"none"},this._renderListContent(this.allLayerItems))}_renderListContent(e){return this.activeLayerItem?this._renderLayerItem(this.activeLayerItem):e.map((e=>p(e)?this._renderGroupItem(e):h(e)?this._renderLayerItem(e):null)).filter(t)}_renderFilterNotice(){const{visibleElements:e}=this;if(!("disabled"===this.state||this.visibleFeatureCount>0)&&e.filter&&e.filterNotice)return d("calcite-notice",{class:w.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale,width:"full"},d("div",{slot:"message"},this.messages.noMatchingFeatures))}_renderItemCount(e){if(!this.visibleElements.itemCount)return;const{messages:t}=this,i=g(e.total),s=g(e.visibleTotal),o=I(t.selectionCount,{count:i});return e.maxVisibleFeatureCountExceeded?d("span",{class:w.itemCount,slot:"content-end",title:o},d("calcite-icon",{icon:"exclamation-mark-triangle",scale:"s",title:t.tooManyFeatures}),`${g(this.maxVisibleFeatureCountPerLayer)}+`):d("span",{class:w.itemCount,slot:"content-end",title:o},s)}_renderItemActions(e){if(!this.visibleElements.itemMenus)return;const{messages:t,messagesCommon:i}=this,s=this._itemWithOpenMenu===e,o=u(e),l=h(e),n=p(e),r=o?t.deselectFeature:l?t.deselectLayer:t.deselectGroup;return[d("calcite-dropdown",{open:s,overlayPositioning:"fixed",scale:this.menuScale,slot:"actions-end",width:"m",onCalciteDropdownClose:()=>this._closeItemMenu(e),onCalciteDropdownOpen:()=>{this._itemWithOpenMenu=e}},d("calcite-action",{appearance:"transparent",icon:"ellipsis",scale:this.scale,slot:"trigger",text:i.menu,textEnabled:!1}),s?d("calcite-dropdown-group",{selectionMode:"none"},d("calcite-dropdown-item",{iconStart:"layer-zoom-to",onCalciteDropdownItemSelect:()=>this.goToItem(e)},t.zoomTo),d("calcite-dropdown-item",{iconStart:"selection-filter",onCalciteDropdownItemSelect:()=>this.selectSingleItem(e)},o?t.onlySelectFeature:t.onlySelectThis),d("calcite-dropdown-item",{iconStart:"selection-x",onCalciteDropdownItemSelect:()=>this.deselectItem(e)},r),this.itemActionConfigs?.map((t=>{if(!t.type||"feature"===t.type&&o||"layer"===t.type&&l||"group"===t.type&&n)return d("calcite-dropdown-item",{iconStart:t.icon??void 0,onCalciteDropdownItemSelect:()=>t.callback({item:e})},t.label)}))):void 0)]}_renderGroupItem(e){const t=e.title||this.messages.untitledLayer;if(0===e.visibleTotal)return;const{displayMode:i}=this;if("layer"===i||"feature"===i)return this._renderListContent(e.items);const{visibleElements:s}=this;return d("calcite-list-item",{bind:this,closable:!!s.itemCloseActions,"data-type":"group",expanded:!0,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:t,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemActions(e),this._renderListContent(e.items))}_renderLayerItem(e){if(0===e.visibleTotal||!e.visible)return;if("feature"===this.displayMode)return this._renderItems(e.featureItems);const{messages:t,visibleElements:i}=this,s=e.title||t.untitledLayer;return d("calcite-list-item",{bind:this,closable:!!i.itemCloseActions,"data-type":"layer",expanded:!0,iconStart:i.itemIcons?e.iconName:void 0,key:e.key,label:s,scale:this.scale,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemCount(e),this._renderItemActions(e),this._renderItems(e.featureItems),e.maxVisibleFeatureCountExceeded?d("calcite-notice",{class:w.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale},d("div",{slot:"message"},t.tooManyFeatures)):void 0)}_renderItems(e){return e.map((e=>this._renderItem(e)))}_renderItem(e){if(!e.visible)return;const{hightlightOnHoverEnabled:t,messages:i,visibleElements:s}=this,o=e.title||i.untitledFeature,l=s.itemIcons&&"feature"!==this.displayMode;return d("calcite-list-item",{bind:this,class:l?w.listItemFeatureIcon:w.listItemFeature,closable:!!s.itemCloseActions,"data-item":e,"data-type":"feature",key:e.key,label:o,name:o,onblur:t?()=>this.removeTemporaryHighlight():void 0,onfocus:t?()=>this.addTemporaryHighlight(e):void 0,onpointerenter:t?()=>this.addTemporaryHighlight(e):void 0,onpointerleave:t?()=>this.removeTemporaryHighlight():void 0,scale:this.scale,value:o,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemIcon(e),this._renderItemActions(e))}_renderItemIcon(e){if(this.visibleElements.itemIcons)return d("div",{class:w.listItemIcon,key:"content-start",slot:"content-start"},d("span",{afterCreate:this._afterItemCreate,afterRemoved:this._afterItemRemoved,"data-has-icon":!1,"data-item":e,key:e.thumbnailKey}))}_getListItem(e){return e?.["data-item"]}_hasIcon(e){return!!e?.["data-has-icon"]}_setHasIcon(e,t){e&&(e["data-has-icon"]=t)}_onListItemSelect(e,t){t.stopPropagation(),this._closeItemMenu(),this.onListItemSelect?.({item:e})}_closeItemMenu(e){e&&e!==this._itemWithOpenMenu||(this._itemWithOpenMenu=null)}};e([o()],_.prototype,"_itemWithOpenMenu",void 0),e([o()],_.prototype,"_list",void 0),e([o()],_.prototype,"activeLayerItem",null),e([o()],_.prototype,"allLayerItems",null),e([o()],_.prototype,"displayMode",void 0),e([o()],_.prototype,"effectiveCount",null),e([o()],_.prototype,"effectiveSelectionManager",null),e([o()],_.prototype,"featureTitleMap",null),e([o()],_.prototype,"filterText",null),e([o()],_.prototype,"hightlightOnHoverEnabled",void 0),e([o()],_.prototype,"icon",null),e([o()],_.prototype,"itemActionConfigs",void 0),e([o()],_.prototype,"isUpdating",null),e([o()],_.prototype,"label",null),e([o()],_.prototype,"layer",null),e([o()],_.prototype,"layerItems",null),e([o()],_.prototype,"layerViewMap",null),e([o()],_.prototype,"maxVisibleFeatureCountExceeded",null),e([o()],_.prototype,"maxVisibleFeatureCountPerLayer",null),e([o()],_.prototype,"menuScale",void 0),e([o(),m("esri/widgets/support/SelectionList/t9n/SelectionList")],_.prototype,"messages",void 0),e([o(),m("esri/t9n/common")],_.prototype,"messagesCommon",void 0),e([o()],_.prototype,"onListItemSelect",void 0),e([o()],_.prototype,"scale",void 0),e([o()],_.prototype,"selectionManager",null),e([o()],_.prototype,"state",null),e([o()],_.prototype,"view",null),e([o()],_.prototype,"viewLayersAndTables",null),e([o()],_.prototype,"viewModel",void 0),e([o({type:y,nonNullable:!0})],_.prototype,"visibleElements",void 0),e([o()],_.prototype,"visibleFeatureCount",null),e([o()],_.prototype,"visibleFeatureItems",null),e([o()],_.prototype,"visibleLayerCount",null),_=e([l("esri.widgets.support.SelectionList")],_);const C=_;export{C 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../Graphic.js";import o from"../../../core/Accessor.js";import s from"../../../core/Clonable.js";import r from"../../../core/Collection.js";import i from"../../../core/Identifiable.js";import{ignoreAbortErrors as a,debounce as n}from"../../../core/promiseUtils.js";import c from"../../../core/ReactiveMap.js";import{watch as l,initial as u}from"../../../core/reactiveUtils.js";import{sqlIn as y}from"../../../core/sql.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{queryAllJSON as p}from"../../../layers/support/featureQueryAll.js";import{isSubtypeSublayer as m,isSubtypeGroupLayer as g}from"../../../layers/support/layerUtils.js";import b from"../../../rest/networks/support/NetworkElement.js";import w from"../../../rest/support/FeatureSet.js";import _ from"../../../rest/support/Query.js";import{featureUtilityNetworkFields as A}from"../../Feature/FeatureUtilityNetworkAssociations/resources.js";import{findUtilityNetwork as C}from"../../Feature/support/featureUtils.js";import{getFeatureTitle as f}from"./utils/getFeatureTitle.js";const F=100;let I=class extends(s.ClonableMixin(i.IdentifiableMixin(o))){constructor(t){super(t),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.source="popup",this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,this._queryOpenAssociationType=async()=>{this.activeAssociationType&&await this._queryDebounced(this.activeAssociationType)},this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._queryController=async t=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await a(this._query(t)),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await a(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=n(this._queryController,F),this._queryFeatureCountDebounced=n(this._queryFeatureCountController,F)}initialize(){this.addHandles([l((()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery]),(()=>this.refresh()),u),l((()=>this.activeAssociationType),(t=>this._queryDebounced(t)),u)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&"string"==typeof this.globalId}get canQuery(){const t=this.layer?.capabilities?.query;return!!this.associationTypes&&"string"==typeof this.globalId&&!!t?.supportsPagination}set displayCount(t){const e=0,o=3;this._set("displayCount",Math.max(t??o,e))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:t}=this;return t?.globalIdField}get activeAssociationType(){return this._get("activeAssociationType")}set activeAssociationType(t){t&&!this.associationTypes.includes(t)||this._set("activeAssociationType",t)}get state(){const{_queryAbortController:t,_queryFeatureCountAbortController:e,_queryPageAbortController:o,canQuery:s,_loaded:r,canLoad:i,source:a}=this;return e||i&&!r?"loading":t||o?"querying":!s||"popup"===a&&0===this.featureCount?"disabled":"ready"}get utilityNetwork(){const{layer:t,map:e}=this;if(!t?.loaded||!e)return null;const o=m(t)?t.parent:t;return C(e,o)}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new r}get structureAssociations(){return this._get("structureAssociations")||new r}get contentAssociations(){return this._get("contentAssociations")||new r}get containerAssociations(){return this._get("containerAssociations")||new r}get connectivityAssociations(){return this._get("connectivityAssociations")||new r}get associationFeatures(){return this._get("associationFeatures")||new c}get associationViewModels(){return this._get("associationViewModels")||new Map}async refresh(){await this._queryFeatureCountDebounced(),await this._queryOpenAssociationType()}getFeatureCountForAssociationType(t){switch(t){case"attachment":return this.attachmentsFeatureCount;case"structure":return this.structureFeatureCount;case"content":return this.contentFeatureCount;case"container":return this.containerFeatureCount;case"connectivity":return this.connectivityFeatureCount}}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach((t=>t.destroyAll()))}async _loadUtiltyNetworks(){const t=this.map;if(!t)return;await Promise.allSettled(t.utilityNetworks?.map((async t=>{await t.load()}))??[]);const e=this.utilityNetwork;if(e){const o=t=>{if("layerId"in t&&e.isUtilityLayer(t)){const o=e.getSourceIdByLayerId(t.layerId);null!==o&&this.networkSourceIdsInUse.add(o)}};this._set("networkSourceIdsInUse",new Set),t.allLayers.forEach(o),t.allTables.forEach(o)}}async _findLayersBySourceId(t){const{utilityNetwork:e,map:o}=this,s=t=>{const o=t;if(!t.url)return!1;if(o.layerId===r){return t.url.replace(/\/\d+$/,"")===e?.featureServiceUrl}return!1};await(e?.load());const r=e.getLayerIdBySourceId(t),i=o.allLayers.filter(s),a=o.allTables.filter(s),n=i.concat(a).toArray();return await Promise.allSettled(n.map((t=>t.load()))),n}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach((t=>t.removeAll())),this.associationFeatures.clear()}_getAssociationsByType(t){switch(t){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}async _queryLayer(t,e,o,s,r){const i=this._getFeatureQueryWhereClause(t,e,o,s),a=new _({where:i,outFields:["*"],cacheHint:this.supportsCacheHint}),n=w.fromJSON(await p(t,a,r));return n.features.forEach((e=>{e.layer=e.sourceLayer=g(t)?t.findSublayerForFeature(e):t})),n.features}async _createAssociationFeatureObjects(t,e,o,s,r,i){if(0===t.length)return[];const a=new Map;for(const[c,l]of e){const t=await this._findLayersBySourceId(c);for(const e of t){(await this._queryLayer(e,l,s,r,i)).forEach((t=>{if("popup"===this.source?t.layer&&t.getEffectivePopupTemplate():!!t.layer){const o=a.get(t.attributes[e.globalIdField])??[];o.push(t),a.set(t.attributes[e.globalIdField],o)}}))}}const n=[];return await Promise.all(t.toArray().map((async t=>{const{fromNetworkElement:e,toNetworkElement:s}=t,r=e.globalId===o?s:e,i=a.get(r.globalId)??[];await Promise.all(i.map((async e=>{const o=this.utilityNetwork?.getTerminalById(r?.terminalId)?.name,s=e.sourceLayer&&"getFeatureTitle"in e.sourceLayer?await e.sourceLayer.getFeatureTitle(e):f(e);n.push({title:s,feature:e,association:t,terminalName:o})})))}))),n}_parseFeatureObjects(t,e){t.forEach((t=>{const o=t?.feature,s=o.layer,i=e.get(s)??new r;i.add(t),e.set(s,i)}))}async _queryAssociations(t){const{layer:e,globalId:o,associationTypes:s,utilityNetwork:r,canQuery:i}=this;if(await Promise.allSettled([e?.load(),r?.load()]),this._clearAssociations(),!(i&&e&&s&&r&&o))return;const a=m(e)?e.parent:e,n=new b({globalId:o,networkSourceId:r.getSourceIdByLayerId(a.layerId)}),c=new Set;s.forEach((t=>{switch(t.type){case"attachment":case"structure":c.add("attachment");break;case"container":case"content":c.add("containment");break;case"connectivity":c.add("connectivity"),c.add("junction-junction-connectivity"),c.add("junction-edge-from-connectivity"),c.add("junction-edge-midspan-connectivity"),c.add("junction-edge-to-connectivity")}}));const l=await(r?.queryAssociations({elements:[n],types:Array.from(c)},{signal:t?.signal})),u=new Map,y=new Map;s.forEach((t=>{y.set(t.type,t),u.set(t.type,[])})),l.forEach((t=>{const{toNetworkElement:e,fromNetworkElement:s}=t;switch(t.associationType){case"connectivity":case"junction-junction-connectivity":case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"connectivity",y))break;u.get("connectivity")?.push(e.globalId)}else{if(this._shouldDiscardNetworkElement(s,"connectivity",y))break;u.get("connectivity")?.push(s.globalId)}this.connectivityAssociations.add(t);break;case"containment":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"content",y))break;u.get("content")?.push(e.globalId),this.contentAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(s,"container",y))break;u.get("container")?.push(s.globalId),this.containerAssociations.add(t)}break;case"attachment":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"attachment",y))break;u.get("attachment")?.push(e.globalId),this.attachmentsAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(s,"structure",y))break;u.get("structure")?.push(s.globalId),this.structureAssociations.add(t)}}}));const d=s.map((async e=>{const{associatedNetworkSourceId:o,associatedAssetGroup:s,associatedAssetType:r}=e,i=u.get(e.type),a=null!=s?await this._countAssociatedFeatures(o,i,s,r,t):i.length;switch(e.type){case"attachment":this._set("attachmentsFeatureCount",a);break;case"structure":this._set("structureFeatureCount",a);break;case"content":this._set("contentFeatureCount",a);break;case"container":this._set("containerFeatureCount",a);break;case"connectivity":this._set("connectivityFeatureCount",a)}}));await Promise.allSettled(d)}async _countAssociatedFeatureCount(t,e,o,s,r){const i=this._getFeatureQueryWhereClause(t,e,o,s);return t.queryFeatureCount({where:i,outFields:["*"],returnGeometry:!1},{signal:r?.signal})}async _countAssociatedFeatures(t,e,o,s,r){if(0===e.length)return 0;const i=(await this._findLayersBySourceId(t)).map((async t=>this._countAssociatedFeatureCount(t,e,o,s,r)));return(await Promise.all(i)).reduce(((t,e)=>t+e),0)}async _queryAssociatedFeatures(t,e){const{layer:o,globalId:s,associationTypes:r,utilityNetwork:i,canQuery:a,associationFeatures:n}=this;if(await Promise.allSettled([o?.load(),i?.load()]),!(a&&o&&r&&i))return;const c=this._getAssociationsByType(t.type),{associatedAssetGroup:l,associatedAssetType:u}=t,y=new Map;c.forEach((t=>{const{fromNetworkElement:e,toNetworkElement:o}=t,{networkSourceId:r,elementGlobalId:i}=e.globalId===s?{networkSourceId:o.networkSourceId,elementGlobalId:o.globalId}:{networkSourceId:e.networkSourceId,elementGlobalId:e.globalId},a=y.get(r)||[];a.push(i),y.set(r,a)}));const d=await this._createAssociationFeatureObjects(c,y,s,l,u,e);this._parseFeatureObjects(d,n)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:t,canQuery:e}=this;e?(await this._queryAssociations(t),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(t){if(!t)return;await this._loadUtiltyNetworks();const{_queryAbortController:e}=this;this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),0!==this.featureCount&&(this.destroyed||await this._queryAssociatedFeatures(t,{signal:e?.signal}))}_shouldDiscardNetworkElement(t,e,o){if(!t)return!1;const{networkSourceIdsInUse:s}=this,{networkSourceId:r}=t,i=o.get(e)?.associatedNetworkSourceId,a=s.has(r);return null!=i&&i!==r||!a}_getFeatureQueryWhereClause(t,e,o,s){const r=t.globalIdField,i=t.fieldsIndex.get(A.assetGroup),a=t.fieldsIndex.get(A.assetType),n=null!=o,c=null!=s;return[r?y(r,e):null,n?`(${i?.name} = ${o})`:null,n&&c?`(${a?.name} = ${s})`:null].filter(Boolean).join(" AND ")}};t([d()],I.prototype,"_loaded",void 0),t([d()],I.prototype,"_queryAbortController",void 0),t([d()],I.prototype,"_queryPageAbortController",void 0),t([d()],I.prototype,"_queryFeatureCountAbortController",void 0),t([d({readOnly:!0})],I.prototype,"supportsCacheHint",null),t([d({readOnly:!0})],I.prototype,"canLoad",null),t([d({readOnly:!0})],I.prototype,"canQuery",null),t([d()],I.prototype,"networkSourceIdsInUse",void 0),t([d({constructOnly:!0})],I.prototype,"source",void 0),t([d()],I.prototype,"description",void 0),t([d({value:3})],I.prototype,"displayCount",null),t([d({type:e})],I.prototype,"graphic",void 0),t([d()],I.prototype,"layer",void 0),t([d()],I.prototype,"map",void 0),t([d({readOnly:!0})],I.prototype,"objectId",null),t([d({readOnly:!0})],I.prototype,"objectIdField",null),t([d({readOnly:!0})],I.prototype,"globalId",null),t([d({readOnly:!0})],I.prototype,"globalIdField",null),t([d()],I.prototype,"featureCount",void 0),t([d()],I.prototype,"associationTypes",void 0),t([d()],I.prototype,"activeAssociationType",null),t([d()],I.prototype,"showAllEnabled",void 0),t([d()],I.prototype,"state",null),t([d()],I.prototype,"title",void 0),t([d({readOnly:!0})],I.prototype,"utilityNetwork",null),t([d({readOnly:!0})],I.prototype,"attachmentsFeatureCount",void 0),t([d({readOnly:!0})],I.prototype,"structureFeatureCount",void 0),t([d({readOnly:!0})],I.prototype,"attachmentsAssociations",null),t([d({readOnly:!0})],I.prototype,"structureAssociations",null),t([d({readOnly:!0})],I.prototype,"contentFeatureCount",void 0),t([d({readOnly:!0})],I.prototype,"containerFeatureCount",void 0),t([d({readOnly:!0})],I.prototype,"contentAssociations",null),t([d({readOnly:!0})],I.prototype,"containerAssociations",null),t([d({readOnly:!0})],I.prototype,"connectivityFeatureCount",void 0),t([d({readOnly:!0})],I.prototype,"connectivityAssociations",null),t([d({readOnly:!0})],I.prototype,"associationFeatures",null),t([d({readOnly:!0})],I.prototype,"associationViewModels",null),I=t([h("esri.widgets.support.UtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],I);export{I as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../Graphic.js";import o from"../../../core/Accessor.js";import r from"../../../core/Clonable.js";import s from"../../../core/Collection.js";import i from"../../../core/Identifiable.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{ignoreAbortErrors as n,debounce as c}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveMap.js";import{watch as u,initial as y}from"../../../core/reactiveUtils.js";import{sqlIn as d}from"../../../core/sql.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{queryAllJSON as m}from"../../../layers/support/featureQueryAll.js";import{isSubtypeSublayer as g,isSubtypeGroupLayer as _}from"../../../layers/support/layerUtils.js";import b from"../../../rest/networks/support/NetworkElement.js";import w from"../../../rest/support/FeatureSet.js";import A from"../../../rest/support/Query.js";import{featureUtilityNetworkFields as F}from"../../Feature/FeatureUtilityNetworkAssociations/resources.js";import{findUtilityNetwork as f}from"../../Feature/support/featureUtils.js";import{getFeatureTitle as C}from"./utils/getFeatureTitle.js";const I=100;let v=class extends(r.ClonableMixin(i.IdentifiableMixin(o))){constructor(t){super(t),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.source="popup",this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,this._queryOpenAssociationType=async()=>{this.activeAssociationType&&await this._queryDebounced(this.activeAssociationType)},this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._queryController=async t=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await n(this._query(t)),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await n(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=c(this._queryController,I),this._queryFeatureCountDebounced=c(this._queryFeatureCountController,I)}initialize(){this.addHandles([u((()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery]),(()=>this.refresh()),y),u((()=>this.activeAssociationType),(t=>this._queryDebounced(t)),y)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&"string"==typeof this.globalId}get canQuery(){const t=this.layer?.capabilities?.query;return!!this.associationTypes&&"string"==typeof this.globalId&&!!t?.supportsPagination}set displayCount(t){const e=0,o=3;this._set("displayCount",Math.max(t??o,e))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:t}=this;return t?.globalIdField}get activeAssociationType(){return this._get("activeAssociationType")}set activeAssociationType(t){t&&!this.associationTypes.includes(t)||this._set("activeAssociationType",t)}get state(){const{_queryAbortController:t,_queryFeatureCountAbortController:e,_queryPageAbortController:o,canQuery:r,_loaded:s,canLoad:i,source:a}=this;return e||i&&!s?"loading":t||o?"querying":!r||"popup"===a&&0===this.featureCount?"disabled":"ready"}get utilityNetwork(){const{layer:t,map:e}=this;if(!t?.loaded||!e)return null;const o=g(t)?t.parent:t;return f(e,o)}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new s}get structureAssociations(){return this._get("structureAssociations")||new s}get contentAssociations(){return this._get("contentAssociations")||new s}get containerAssociations(){return this._get("containerAssociations")||new s}get connectivityAssociations(){return this._get("connectivityAssociations")||new s}get associationFeatures(){return this._get("associationFeatures")||new l}get associationViewModels(){return this._get("associationViewModels")||new Map}async refresh(){await this._queryFeatureCountDebounced(),await this._queryOpenAssociationType()}getFeatureCountForAssociationType(t){switch(t){case"attachment":return this.attachmentsFeatureCount;case"structure":return this.structureFeatureCount;case"content":return this.contentFeatureCount;case"container":return this.containerFeatureCount;case"connectivity":return this.connectivityFeatureCount}}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach((t=>t.destroyAll()))}async _loadUtiltyNetworks(){const t=this.map;if(!t)return;await Promise.allSettled(t.utilityNetworks?.map((async t=>{await t.load()}))??[]);const e=this.utilityNetwork;if(e){const o=t=>{if("layerId"in t&&e.isUtilityLayer(t)){const o=e.getSourceIdByLayerId(t.layerId);null!==o&&this.networkSourceIdsInUse.add(o)}};this._set("networkSourceIdsInUse",new Set),t.allLayers.forEach(o),t.allTables.forEach(o)}}async _findLayersBySourceId(t){const{utilityNetwork:e,map:o}=this,r=t=>{const o=t;if(!t.url)return!1;if(o.layerId===s){return t.url.replace(/\/\d+$/,"")===e?.featureServiceUrl}return!1};await(e?.load());const s=e.getLayerIdBySourceId(t),i=o.allLayers.filter(r),a=o.allTables.filter(r),n=i.concat(a).toArray();return await Promise.allSettled(n.map((t=>t.load()))),n}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach((t=>t.removeAll())),this.associationFeatures.clear()}_getAssociationsByType(t){switch(t){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}async _queryLayer(t,e,o,r,s){const i=this._getFeatureQueryWhereClause(t,e,o,r),a=new A({where:i,outFields:["*"],cacheHint:this.supportsCacheHint}),n=w.fromJSON(await m(t,a,s));return n.features.forEach((e=>{e.layer=e.sourceLayer=_(t)?t.findSublayerForFeature(e):t})),n.features}async _createAssociationFeatureObjects(t,e,o,r,s,i){if(0===t.length)return[];const a=new Map;for(const[c,l]of e){const t=await this._findLayersBySourceId(c);for(const e of t){(await this._queryLayer(e,l,r,s,i)).forEach((t=>{if("popup"===this.source?t.layer&&t.getEffectivePopupTemplate():!!t.layer){const o=a.get(t.attributes[e.globalIdField])??[];o.push(t),a.set(t.attributes[e.globalIdField],o)}}))}}const n=[];return await Promise.all(t.toArray().map((async t=>{const{fromNetworkElement:e,toNetworkElement:r}=t,s=e.globalId===o?r:e,i=a.get(s.globalId)??[];await Promise.all(i.map((async e=>{const o=this.utilityNetwork?.getTerminalById(s?.terminalId)?.name,r=e.sourceLayer&&"getFeatureTitle"in e.sourceLayer?await e.sourceLayer.getFeatureTitle(e):C(e);n.push({title:r,feature:e,association:t,terminalName:o})})))}))),n}_parseFeatureObjects(t,e){const o=new Map;t.forEach((t=>{const e=t?.feature,r=e.layer;a(o,r,(()=>new s)).add(t)}));for(const[r,s]of o)this._sortFeatureObjectsByTitle(s),e.set(r,s)}_sortFeatureObjectsByTitle(t){t.sort(this._compareByFeatureTitle)}_compareByFeatureTitle(t,e){return t.title.localeCompare(e.title,void 0,{numeric:!0})}async _queryAssociations(t){const{layer:e,globalId:o,associationTypes:r,utilityNetwork:s,canQuery:i}=this;if(await Promise.allSettled([e?.load(),s?.load()]),this._clearAssociations(),!(i&&e&&r&&s&&o))return;const a=g(e)?e.parent:e,n=new b({globalId:o,networkSourceId:s.getSourceIdByLayerId(a.layerId)}),c=new Set;r.forEach((t=>{switch(t.type){case"attachment":case"structure":c.add("attachment");break;case"container":case"content":c.add("containment");break;case"connectivity":c.add("connectivity"),c.add("junction-junction-connectivity"),c.add("junction-edge-from-connectivity"),c.add("junction-edge-midspan-connectivity"),c.add("junction-edge-to-connectivity")}}));const l=await(s?.queryAssociations({elements:[n],types:Array.from(c)},{signal:t?.signal})),u=new Map,y=new Map;r.forEach((t=>{y.set(t.type,t),u.set(t.type,[])})),l.forEach((t=>{const{toNetworkElement:e,fromNetworkElement:r}=t;switch(t.associationType){case"connectivity":case"junction-junction-connectivity":case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":if(r?.globalId===o){if(this._shouldDiscardNetworkElement(e,"connectivity",y))break;u.get("connectivity")?.push(e.globalId)}else{if(this._shouldDiscardNetworkElement(r,"connectivity",y))break;u.get("connectivity")?.push(r.globalId)}this.connectivityAssociations.add(t);break;case"containment":if(r?.globalId===o){if(this._shouldDiscardNetworkElement(e,"content",y))break;u.get("content")?.push(e.globalId),this.contentAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(r,"container",y))break;u.get("container")?.push(r.globalId),this.containerAssociations.add(t)}break;case"attachment":if(r?.globalId===o){if(this._shouldDiscardNetworkElement(e,"attachment",y))break;u.get("attachment")?.push(e.globalId),this.attachmentsAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(r,"structure",y))break;u.get("structure")?.push(r.globalId),this.structureAssociations.add(t)}}}));const d=r.map((async e=>{const{associatedNetworkSourceId:o,associatedAssetGroup:r,associatedAssetType:s}=e,i=u.get(e.type),a=null!=r?await this._countAssociatedFeatures(o,i,r,s,t):i.length;switch(e.type){case"attachment":this._set("attachmentsFeatureCount",a);break;case"structure":this._set("structureFeatureCount",a);break;case"content":this._set("contentFeatureCount",a);break;case"container":this._set("containerFeatureCount",a);break;case"connectivity":this._set("connectivityFeatureCount",a)}}));await Promise.allSettled(d)}async _countAssociatedFeatureCount(t,e,o,r,s){const i=this._getFeatureQueryWhereClause(t,e,o,r);return t.queryFeatureCount({where:i,outFields:["*"],returnGeometry:!1},{signal:s?.signal})}async _countAssociatedFeatures(t,e,o,r,s){if(0===e.length)return 0;const i=(await this._findLayersBySourceId(t)).map((async t=>this._countAssociatedFeatureCount(t,e,o,r,s)));return(await Promise.all(i)).reduce(((t,e)=>t+e),0)}async _queryAssociatedFeatures(t,e){const{layer:o,globalId:r,associationTypes:s,utilityNetwork:i,canQuery:a,associationFeatures:n}=this;if(await Promise.allSettled([o?.load(),i?.load()]),!(a&&o&&s&&i))return;const c=this._getAssociationsByType(t.type),{associatedAssetGroup:l,associatedAssetType:u}=t,y=new Map;c.forEach((t=>{const{fromNetworkElement:e,toNetworkElement:o}=t,{networkSourceId:s,elementGlobalId:i}=e.globalId===r?{networkSourceId:o.networkSourceId,elementGlobalId:o.globalId}:{networkSourceId:e.networkSourceId,elementGlobalId:e.globalId},a=y.get(s)||[];a.push(i),y.set(s,a)}));const d=await this._createAssociationFeatureObjects(c,y,r,l,u,e);this._parseFeatureObjects(d,n)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:t,canQuery:e}=this;e?(await this._queryAssociations(t),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(t){if(!t)return;await this._loadUtiltyNetworks();const{_queryAbortController:e}=this;this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),0!==this.featureCount&&(this.destroyed||await this._queryAssociatedFeatures(t,{signal:e?.signal}))}_shouldDiscardNetworkElement(t,e,o){if(!t)return!1;const{networkSourceIdsInUse:r}=this,{networkSourceId:s}=t,i=o.get(e)?.associatedNetworkSourceId,a=r.has(s);return null!=i&&i!==s||!a}_getFeatureQueryWhereClause(t,e,o,r){const s=t.globalIdField,i=t.fieldsIndex.get(F.assetGroup),a=t.fieldsIndex.get(F.assetType),n=null!=o,c=null!=r;return[s?d(s,e):null,n?`(${i?.name} = ${o})`:null,n&&c?`(${a?.name} = ${r})`:null].filter(Boolean).join(" AND ")}};t([h()],v.prototype,"_loaded",void 0),t([h()],v.prototype,"_queryAbortController",void 0),t([h()],v.prototype,"_queryPageAbortController",void 0),t([h()],v.prototype,"_queryFeatureCountAbortController",void 0),t([h({readOnly:!0})],v.prototype,"supportsCacheHint",null),t([h({readOnly:!0})],v.prototype,"canLoad",null),t([h({readOnly:!0})],v.prototype,"canQuery",null),t([h()],v.prototype,"networkSourceIdsInUse",void 0),t([h({constructOnly:!0})],v.prototype,"source",void 0),t([h()],v.prototype,"description",void 0),t([h({value:3})],v.prototype,"displayCount",null),t([h({type:e})],v.prototype,"graphic",void 0),t([h()],v.prototype,"layer",void 0),t([h()],v.prototype,"map",void 0),t([h({readOnly:!0})],v.prototype,"objectId",null),t([h({readOnly:!0})],v.prototype,"objectIdField",null),t([h({readOnly:!0})],v.prototype,"globalId",null),t([h({readOnly:!0})],v.prototype,"globalIdField",null),t([h()],v.prototype,"featureCount",void 0),t([h()],v.prototype,"associationTypes",void 0),t([h()],v.prototype,"activeAssociationType",null),t([h()],v.prototype,"showAllEnabled",void 0),t([h()],v.prototype,"state",null),t([h()],v.prototype,"title",void 0),t([h({readOnly:!0})],v.prototype,"utilityNetwork",null),t([h({readOnly:!0})],v.prototype,"attachmentsFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"structureFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"attachmentsAssociations",null),t([h({readOnly:!0})],v.prototype,"structureAssociations",null),t([h({readOnly:!0})],v.prototype,"contentFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"containerFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"contentAssociations",null),t([h({readOnly:!0})],v.prototype,"containerAssociations",null),t([h({readOnly:!0})],v.prototype,"connectivityFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"connectivityAssociations",null),t([h({readOnly:!0})],v.prototype,"associationFeatures",null),t([h({readOnly:!0})],v.prototype,"associationViewModels",null),v=t([p("esri.widgets.support.UtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],v);export{v 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{offsetDate as t,convertTime as e}from"../../core/timeUtils.js";import{formatDate as o,getDateTimeFormatter as n}from"../../intl/date.js";import{getLocaleParts as s}from"../../intl/locale.js";import{S as i}from"../../chunks/SunCalc.js";import{css as l}from"../Slider/css.js";import{globalCss as f}from"./globalCss.js";const m={hour:"numeric",minute:"numeric",timeZone:"UTC"},r={hour:"numeric",timeZone:"UTC"};function u(t,e){const n=O(t,e);let s=o(n,m);return 0!==t&&"00:00"===s&&(s="24:00"),"tick"===e&&s.includes(" ")&&(s=o(n,r),s=s.replace(":00","")),s}function c({tickElement:t,labelElement:e,tickClasses:o=[],onClick:n}){t&&e&&(t.classList.add(...o,f.primaryTick),e.classList.add(...o,f.primaryTickLabel),a(e),n&&(e.onclick=t.onclick=()=>n()))}function z(t){if(!t)return;const e=s(),o=e?.language??"",n=e?.region??"";t.querySelectorAll(`.${l.tickLabelElement}`).forEach((t=>{a(t)}));const i=["ar","bg","el","en","ko"].includes(o)||"zh"===o&&["HK","TW"].includes(n);t.style.paddingBlockEnd=i?"42px":"28px"}function a(t){t.classList.toggle(f.primaryTickLabelKeepAll,"ko"===s()?.language)}function g({tickElement:t,tickClasses:e=[],onClick:o}){t&&(t.classList.add(...e,f.secondaryTick),o&&(t.onclick=()=>o()))}function h(){return n(r).formatToParts(O(0,"value")).some((({type:t})=>"dayPeriod"===t))}function O(t,o){if("tick"===o){const o=Math.round(e(t,"minutes","hours"));return new Date(e(o,"hours","milliseconds"))}return new Date(6e4*t)}function T(e,o,n,s){if(null==o||null==n)return null;const l=i.getTimes(e,o,n),f=l.sunrise,m=l.sunset,r=t(e,s,"hours"),u=t(f,s,"hours"),c=t(m,s,"hours");if(r.getUTCDate()!==u.getUTCDate()||r.getUTCDate()!==c.getUTCDate()){const t=r.getTime()-u.getTime()>0?1:-1;f.setUTCDate(f.getUTCDate()+t),m.setUTCDate(m.getUTCDate()+t)}return{sunrise:f,sunset:m}}function C(t){return[{utcOffset:-12,short:"UTC-12",long:t.timezoneDateline},{utcOffset:-11,short:"UTC-11",long:t.timezoneSamoa},{utcOffset:-10,short:t.timezoneHAST,long:t.timezoneHawaii},{utcOffset:-9,short:t.timezoneAKST,long:t.timezoneAlaska},{utcOffset:-8,short:t.timezonePST,long:t.timezoneBaja},{utcOffset:-7,short:t.timezoneMST,long:t.timezoneMountain},{utcOffset:-7,short:t.timezoneMST,long:t.timezoneLaPaz},{utcOffset:-7,short:t.timezoneMST,long:t.timezoneArizona},{utcOffset:-6,short:t.timezoneCST,long:t.timezoneSaskatchewan},{utcOffset:-6,short:t.timezoneCST,long:t.timezoneCentralAmerica},{utcOffset:-6,short:t.timezoneCST,long:t.timezoneCentralTime},{utcOffset:-6,short:t.timezoneCST,long:t.timezoneMexico},{utcOffset:-5,short:t.timezoneEST,long:t.timezoneEasternUS},{utcOffset:-5,short:t.timezoneEST,long:t.timezoneLima},{utcOffset:-5,short:t.timezoneEST,long:t.timezoneIndiana},{utcOffset:-4,short:null,long:t.timezoneAtlantic},{utcOffset:-4,short:null,long:t.timezoneCuiaba},{utcOffset:-4,short:null,long:t.timezoneSantiago},{utcOffset:-4,short:null,long:t.timezoneManaus},{utcOffset:-4,short:null,long:t.timezoneAsuncion},{utcOffset:-3,short:null,long:t.timezoneBrasilia},{utcOffset:-3,short:null,long:t.timezoneGreenland},{utcOffset:-3,short:null,long:t.timezoneMontevideo},{utcOffset:-3,short:null,long:t.timezoneCayenne},{utcOffset:-3,short:null,long:t.timezoneBuenosAires},{utcOffset:-2,short:null,long:t.timezoneMidAtlantic},{utcOffset:-1,short:null,long:t.timezoneAzores},{utcOffset:-1,short:null,long:t.timezoneCaboVerde},{utcOffset:0,short:null,long:t.timezoneDublin},{utcOffset:0,short:null,long:t.timezoneReykjavik},{utcOffset:0,short:null,long:t.timezoneCasablanca},{utcOffset:1,short:t.timezoneCET,long:t.timezoneBelgrade},{utcOffset:1,short:t.timezoneCET,long:t.timezoneSarajevo},{utcOffset:1,short:t.timezoneCET,long:t.timezoneBrussels},{utcOffset:1,short:t.timezoneCET,long:t.timezoneWCAfrica},{utcOffset:1,short:t.timezoneCET,long:t.timezoneAmsterdam},{utcOffset:1,short:t.timezoneCET,long:t.timezoneWindhoek},{utcOffset:2,short:t.timezoneEET,long:t.timezoneMinsk},{utcOffset:2,short:t.timezoneEET,long:t.timezoneCairo},{utcOffset:2,short:t.timezoneEET,long:t.timezoneHelsinki},{utcOffset:2,short:t.timezoneEET,long:t.timezoneAthens},{utcOffset:2,short:t.timezoneEET,long:t.timezoneJerusalem},{utcOffset:2,short:t.timezoneEET,long:t.timezoneAmman},{utcOffset:2,short:t.timezoneEET,long:t.timezoneBeirut},{utcOffset:2,short:t.timezoneEET,long:t.timezoneHarare},{utcOffset:2,short:t.timezoneEET,long:t.timezoneDamascus},{utcOffset:2,short:t.timezoneEET,long:t.timezoneIstanbul},{utcOffset:3,short:t.timezoneMSK,long:t.timezoneKuwait},{utcOffset:3,short:t.timezoneMSK,long:t.timezoneBaghdad},{utcOffset:3,short:t.timezoneMSK,long:t.timezoneNairobi},{utcOffset:3,short:t.timezoneMSK,long:t.timezoneKaliningrad},{utcOffset:4,short:t.timezoneGST,long:t.timezoneMoscow},{utcOffset:4,short:t.timezoneGST,long:t.timezoneMuscat},{utcOffset:4,short:t.timezoneGST,long:t.timezoneBaku},{utcOffset:4,short:t.timezoneGST,long:t.timezoneYerevan},{utcOffset:4,short:t.timezoneGST,long:t.timezoneTbilisi},{utcOffset:4,short:t.timezoneGST,long:t.timezonePortLouis},{utcOffset:5,short:null,long:t.timezoneTashkent},{utcOffset:5,short:null,long:t.timezoneIslamabad},{utcOffset:6,short:null,long:t.timezoneEkaterinburg},{utcOffset:6,short:null,long:t.timezoneAstana},{utcOffset:6,short:null,long:t.timezoneDhaka},{utcOffset:7,short:t.timezoneICT,long:t.timezoneNovosibirsk},{utcOffset:7,short:t.timezoneICT,long:t.timezoneBangkok},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneKrasnoyarsk},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneBeijing},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneSingapore},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneTaipei},{utcOffset:8,short:t.timezoneCCT,long:t.timezonePerth},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneUlaanbaatar},{utcOffset:9,short:t.timezoneJST,long:t.timezoneIrkutsk},{utcOffset:9,short:t.timezoneJST,long:t.timezoneSeoul},{utcOffset:9,short:t.timezoneJST,long:t.timezoneOsaka},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneYakutsk},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneCanberra},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneBrisbane},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneHobart},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneGuam},{utcOffset:11,short:null,long:t.timezoneVladivostok},{utcOffset:11,short:null,long:t.timezoneSolomon},{utcOffset:12,short:t.timezoneNZST,long:t.timezoneMagadan},{utcOffset:12,short:t.timezoneNZST,long:t.timezoneFiji},{utcOffset:12,short:t.timezoneNZST,long:t.timezoneAuckland},{utcOffset:12,short:t.timezoneNZST,long:t.timezoneNukualofa}].map((({utcOffset:t,short:e,long:o})=>{const n=t>0?`UTC+${t}`:t<0?`UTC${t}`:"GMT";return e?{utcOffset:t,short:e,shortWithUTC:`${n} (${e})`,long:o}:{utcOffset:t,short:n,shortWithUTC:n,long:o}}))}export{z as adjustTimeSliderForLocale,u as formatSliderLabel,T as getSunriseAndSunsetTimes,C as getTimezoneInfos,c as onPrimaryTickCreated,g as onSecondaryTickCreated,m as timeStringFormattingOptions,h as useAmPm};
5
+ import{offsetDate as t,convertTime as e}from"../../core/timeUtils.js";import{formatDate as o,getDateTimeFormatter as n}from"../../intl/date.js";import{getLocaleParts as s,getLocaleLanguage as i}from"../../intl/locale.js";import{S as l}from"../../chunks/SunCalc.js";import{css as f}from"../Slider/css.js";import{globalCss as m}from"./globalCss.js";const r={hour:"numeric",minute:"numeric",timeZone:"UTC"},u={hour:"numeric",timeZone:"UTC"};function c(t,e){const n=T(t,e);let s=o(n,r);return 0!==t&&"00:00"===s&&(s="24:00"),"tick"===e&&s.includes(" ")&&(s=o(n,u),s=s.replace(":00","")),s}function z({tickElement:t,labelElement:e,tickClasses:o=[],onClick:n}){t&&e&&(t.classList.add(...o,m.primaryTick),e.classList.add(...o,m.primaryTickLabel),g(e),n&&(e.onclick=t.onclick=()=>n()))}function a(t){if(!t)return;const e=s(),o=e?.language??"",n=e?.region??"";t.querySelectorAll(`.${f.tickLabelElement}`).forEach((t=>{g(t)}));const i=["ar","bg","el","en","ko"].includes(o)||"zh"===o&&["HK","TW"].includes(n);t.style.paddingBlockEnd=i?"42px":"28px"}function g(t){t.classList.toggle(m.primaryTickLabelKeepAll,"ko"===i())}function h({tickElement:t,tickClasses:e=[],onClick:o}){t&&(t.classList.add(...e,m.secondaryTick),o&&(t.onclick=()=>o()))}function O(){return n(u).formatToParts(T(0,"value")).some((({type:t})=>"dayPeriod"===t))}function T(t,o){if("tick"===o){const o=Math.round(e(t,"minutes","hours"));return new Date(e(o,"hours","milliseconds"))}return new Date(6e4*t)}function C(e,o,n,s){if(null==o||null==n)return null;const i=l.getTimes(e,o,n),f=i.sunrise,m=i.sunset,r=t(e,s,"hours"),u=t(f,s,"hours"),c=t(m,s,"hours");if(r.getUTCDate()!==u.getUTCDate()||r.getUTCDate()!==c.getUTCDate()){const t=r.getTime()-u.getTime()>0?1:-1;f.setUTCDate(f.getUTCDate()+t),m.setUTCDate(m.getUTCDate()+t)}return{sunrise:f,sunset:m}}function S(t){return[{utcOffset:-12,short:"UTC-12",long:t.timezoneDateline},{utcOffset:-11,short:"UTC-11",long:t.timezoneSamoa},{utcOffset:-10,short:t.timezoneHAST,long:t.timezoneHawaii},{utcOffset:-9,short:t.timezoneAKST,long:t.timezoneAlaska},{utcOffset:-8,short:t.timezonePST,long:t.timezoneBaja},{utcOffset:-7,short:t.timezoneMST,long:t.timezoneMountain},{utcOffset:-7,short:t.timezoneMST,long:t.timezoneLaPaz},{utcOffset:-7,short:t.timezoneMST,long:t.timezoneArizona},{utcOffset:-6,short:t.timezoneCST,long:t.timezoneSaskatchewan},{utcOffset:-6,short:t.timezoneCST,long:t.timezoneCentralAmerica},{utcOffset:-6,short:t.timezoneCST,long:t.timezoneCentralTime},{utcOffset:-6,short:t.timezoneCST,long:t.timezoneMexico},{utcOffset:-5,short:t.timezoneEST,long:t.timezoneEasternUS},{utcOffset:-5,short:t.timezoneEST,long:t.timezoneLima},{utcOffset:-5,short:t.timezoneEST,long:t.timezoneIndiana},{utcOffset:-4,short:null,long:t.timezoneAtlantic},{utcOffset:-4,short:null,long:t.timezoneCuiaba},{utcOffset:-4,short:null,long:t.timezoneSantiago},{utcOffset:-4,short:null,long:t.timezoneManaus},{utcOffset:-4,short:null,long:t.timezoneAsuncion},{utcOffset:-3,short:null,long:t.timezoneBrasilia},{utcOffset:-3,short:null,long:t.timezoneGreenland},{utcOffset:-3,short:null,long:t.timezoneMontevideo},{utcOffset:-3,short:null,long:t.timezoneCayenne},{utcOffset:-3,short:null,long:t.timezoneBuenosAires},{utcOffset:-2,short:null,long:t.timezoneMidAtlantic},{utcOffset:-1,short:null,long:t.timezoneAzores},{utcOffset:-1,short:null,long:t.timezoneCaboVerde},{utcOffset:0,short:null,long:t.timezoneDublin},{utcOffset:0,short:null,long:t.timezoneReykjavik},{utcOffset:0,short:null,long:t.timezoneCasablanca},{utcOffset:1,short:t.timezoneCET,long:t.timezoneBelgrade},{utcOffset:1,short:t.timezoneCET,long:t.timezoneSarajevo},{utcOffset:1,short:t.timezoneCET,long:t.timezoneBrussels},{utcOffset:1,short:t.timezoneCET,long:t.timezoneWCAfrica},{utcOffset:1,short:t.timezoneCET,long:t.timezoneAmsterdam},{utcOffset:1,short:t.timezoneCET,long:t.timezoneWindhoek},{utcOffset:2,short:t.timezoneEET,long:t.timezoneMinsk},{utcOffset:2,short:t.timezoneEET,long:t.timezoneCairo},{utcOffset:2,short:t.timezoneEET,long:t.timezoneHelsinki},{utcOffset:2,short:t.timezoneEET,long:t.timezoneAthens},{utcOffset:2,short:t.timezoneEET,long:t.timezoneJerusalem},{utcOffset:2,short:t.timezoneEET,long:t.timezoneAmman},{utcOffset:2,short:t.timezoneEET,long:t.timezoneBeirut},{utcOffset:2,short:t.timezoneEET,long:t.timezoneHarare},{utcOffset:2,short:t.timezoneEET,long:t.timezoneDamascus},{utcOffset:2,short:t.timezoneEET,long:t.timezoneIstanbul},{utcOffset:3,short:t.timezoneMSK,long:t.timezoneKuwait},{utcOffset:3,short:t.timezoneMSK,long:t.timezoneBaghdad},{utcOffset:3,short:t.timezoneMSK,long:t.timezoneNairobi},{utcOffset:3,short:t.timezoneMSK,long:t.timezoneKaliningrad},{utcOffset:4,short:t.timezoneGST,long:t.timezoneMoscow},{utcOffset:4,short:t.timezoneGST,long:t.timezoneMuscat},{utcOffset:4,short:t.timezoneGST,long:t.timezoneBaku},{utcOffset:4,short:t.timezoneGST,long:t.timezoneYerevan},{utcOffset:4,short:t.timezoneGST,long:t.timezoneTbilisi},{utcOffset:4,short:t.timezoneGST,long:t.timezonePortLouis},{utcOffset:5,short:null,long:t.timezoneTashkent},{utcOffset:5,short:null,long:t.timezoneIslamabad},{utcOffset:6,short:null,long:t.timezoneEkaterinburg},{utcOffset:6,short:null,long:t.timezoneAstana},{utcOffset:6,short:null,long:t.timezoneDhaka},{utcOffset:7,short:t.timezoneICT,long:t.timezoneNovosibirsk},{utcOffset:7,short:t.timezoneICT,long:t.timezoneBangkok},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneKrasnoyarsk},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneBeijing},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneSingapore},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneTaipei},{utcOffset:8,short:t.timezoneCCT,long:t.timezonePerth},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneUlaanbaatar},{utcOffset:9,short:t.timezoneJST,long:t.timezoneIrkutsk},{utcOffset:9,short:t.timezoneJST,long:t.timezoneSeoul},{utcOffset:9,short:t.timezoneJST,long:t.timezoneOsaka},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneYakutsk},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneCanberra},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneBrisbane},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneHobart},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneGuam},{utcOffset:11,short:null,long:t.timezoneVladivostok},{utcOffset:11,short:null,long:t.timezoneSolomon},{utcOffset:12,short:t.timezoneNZST,long:t.timezoneMagadan},{utcOffset:12,short:t.timezoneNZST,long:t.timezoneFiji},{utcOffset:12,short:t.timezoneNZST,long:t.timezoneAuckland},{utcOffset:12,short:t.timezoneNZST,long:t.timezoneNukualofa}].map((({utcOffset:t,short:e,long:o})=>{const n=t>0?`UTC+${t}`:t<0?`UTC${t}`:"GMT";return e?{utcOffset:t,short:e,shortWithUTC:`${n} (${e})`,long:o}:{utcOffset:t,short:n,shortWithUTC:n,long:o}}))}export{a as adjustTimeSliderForLocale,c as formatSliderLabel,C as getSunriseAndSunsetTimes,S as getTimezoneInfos,z as onPrimaryTickCreated,h as onSecondaryTickCreated,r as timeStringFormattingOptions,O as useAmPm};