@geoscene/core 4.29.5 → 4.29.7

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 (139) hide show
  1. package/arcade/serviceAreaMetaData.js +1 -1
  2. package/assets/geoscene/core/workers/RemoteClient.js +1 -1
  3. package/assets/geoscene/core/workers/chunks/02a8f0cc511b810d29dd.js +1 -1
  4. package/assets/geoscene/core/workers/chunks/0b2f4079142b4c2a4ddf.js +1 -1
  5. package/assets/geoscene/core/workers/chunks/26f1ec6ce2720bcc1202.js +1 -1
  6. package/assets/geoscene/core/workers/chunks/348bcc57b99a975902a8.js +1 -1
  7. package/assets/geoscene/core/workers/chunks/54c8eea3a70e92842c6a.js +1 -1
  8. package/assets/geoscene/core/workers/chunks/5db9739e00f15613d1ea.js +1 -1
  9. package/assets/geoscene/core/workers/chunks/71fed2917f4bee173836.js +1 -1
  10. package/assets/geoscene/core/workers/chunks/851de06c5980b9b7362a.js +1 -1
  11. package/assets/geoscene/core/workers/chunks/9d8ce7eec9d80a038477.js +1 -1
  12. package/assets/geoscene/core/workers/chunks/b139cf91bc148aa84419.js +1 -1
  13. package/assets/geoscene/core/workers/chunks/c527692694688a5b3b07.js +2 -4
  14. package/assets/geoscene/core/workers/chunks/c556644bb0cf88770939.js +1 -1
  15. package/assets/geoscene/core/workers/chunks/cf3d5bd2c9115a3e0b79.js +1 -1
  16. package/assets/geoscene/core/workers/chunks/eceaa46f622f6fa31128.js +1 -1
  17. package/assets/geoscene/core/workers/chunks/f59b5ea05caca8a1a398.js +1 -1
  18. package/assets/geoscene/core/workers/chunks/f60e5dd0e712cf32f782.js +1 -1
  19. package/assets/geoscene/images/basemap/gray.jpg +0 -0
  20. package/assets/geoscene/themes/base/widgets/_BasemapGallery.scss +0 -1
  21. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace.json +1 -1
  22. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ar.json +1 -1
  23. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bg.json +1 -1
  24. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bs.json +1 -1
  25. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ca.json +1 -1
  26. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_cs.json +1 -1
  27. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_da.json +1 -1
  28. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_de.json +1 -1
  29. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_el.json +1 -1
  30. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_en.json +1 -1
  31. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_es.json +1 -1
  32. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_et.json +1 -1
  33. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fi.json +1 -1
  34. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fr.json +1 -1
  35. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_he.json +1 -1
  36. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hr.json +1 -1
  37. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hu.json +1 -1
  38. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_id.json +1 -1
  39. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_it.json +1 -1
  40. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ja.json +1 -1
  41. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ko.json +1 -1
  42. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lt.json +1 -1
  43. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lv.json +1 -1
  44. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nb.json +1 -1
  45. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nl.json +1 -1
  46. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pl.json +1 -1
  47. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-BR.json +1 -1
  48. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-PT.json +1 -1
  49. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ro.json +1 -1
  50. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ru.json +1 -1
  51. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sk.json +1 -1
  52. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sl.json +1 -1
  53. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sr.json +1 -1
  54. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sv.json +1 -1
  55. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_th.json +1 -1
  56. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_tr.json +1 -1
  57. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_uk.json +1 -1
  58. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_vi.json +1 -1
  59. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-CN.json +1 -1
  60. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-HK.json +1 -1
  61. package/assets/geoscene/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-TW.json +1 -1
  62. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology.json +1 -1
  63. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ar.json +1 -1
  64. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_bg.json +1 -1
  65. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_bs.json +1 -1
  66. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ca.json +1 -1
  67. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_cs.json +1 -1
  68. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_da.json +1 -1
  69. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_de.json +1 -1
  70. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_el.json +1 -1
  71. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_en.json +1 -1
  72. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_es.json +1 -1
  73. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_et.json +1 -1
  74. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_fi.json +1 -1
  75. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_fr.json +1 -1
  76. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_he.json +1 -1
  77. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_hr.json +1 -1
  78. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_hu.json +1 -1
  79. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_id.json +1 -1
  80. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_it.json +1 -1
  81. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ja.json +1 -1
  82. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ko.json +1 -1
  83. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_lt.json +1 -1
  84. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_lv.json +1 -1
  85. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_nb.json +1 -1
  86. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_nl.json +1 -1
  87. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pl.json +1 -1
  88. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pt-BR.json +1 -1
  89. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pt-PT.json +1 -1
  90. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ro.json +1 -1
  91. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ru.json +1 -1
  92. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sk.json +1 -1
  93. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sl.json +1 -1
  94. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sr.json +1 -1
  95. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sv.json +1 -1
  96. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_th.json +1 -1
  97. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_tr.json +1 -1
  98. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_uk.json +1 -1
  99. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_vi.json +1 -1
  100. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-CN.json +1 -1
  101. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-HK.json +1 -1
  102. package/assets/geoscene/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-TW.json +1 -1
  103. package/chunks/HUDMaterial.glsl.js +0 -1
  104. package/chunks/persistableUrlUtils.js +1 -1
  105. package/config.js +1 -1
  106. package/copyright.txt +1 -1
  107. package/core/devEnvironmentUtils.js +1 -1
  108. package/core/urlUtils.js +1 -1
  109. package/identity/IdentityManagerBase.js +1 -1
  110. package/identity/IdentityModal.js +1 -1
  111. package/layers/TileLayer.js +1 -1
  112. package/layers/VectorTileLayer.js +1 -1
  113. package/layers/support/arcgisLayerUrl.js +1 -1
  114. package/layers/support/arcgisLayers.js +1 -1
  115. package/package.json +1 -1
  116. package/portal/schemas/definitions.js +1 -1
  117. package/portal/support/urlUtils.js +1 -1
  118. package/request.js +1 -1
  119. package/rest/support/PlacesParameters.js +1 -1
  120. package/smartMapping/support/utils.js +1 -1
  121. package/support/BasemapStyle.js +1 -1
  122. package/support/apiKeyUtils.js +1 -1
  123. package/support/basemapDefinitions.js +1 -1
  124. package/support/basemapUtils.js +1 -1
  125. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  126. package/views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js +0 -2
  127. package/widgets/Editor/EditorViewModel.js +1 -1
  128. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  129. package/widgets/Search/support/layerSearchUtils.js +1 -1
  130. package/assets/geoscene/core/workers/chunks/0af5d2f792b83f7dd0aa.js.LICENSE.txt +0 -5
  131. package/assets/geoscene/core/workers/chunks/5015d4fccf4854b9da1e.js.LICENSE.txt +0 -10
  132. package/assets/geoscene/core/workers/chunks/54c8eea3a70e92842c6a.js.LICENSE.txt +0 -16
  133. package/assets/geoscene/core/workers/chunks/804267fca0627d277286.js.LICENSE.txt +0 -5
  134. package/assets/geoscene/core/workers/chunks/87c4848dd48119fd75f9.js.LICENSE.txt +0 -5
  135. package/assets/geoscene/core/workers/chunks/8ec7475f19f8979dfaae.js.LICENSE.txt +0 -5
  136. package/assets/geoscene/core/workers/chunks/904b3e9c98e5de220650.js.LICENSE.txt +0 -11
  137. package/assets/geoscene/core/workers/chunks/c1f78653c70f6bde65b3.js.LICENSE.txt +0 -5
  138. package/assets/geoscene/core/workers/chunks/da21d31db537be097da9.js.LICENSE.txt +0 -5
  139. package/assets/geoscene/core/workers/chunks/e742cd41ab9b164ad974.js.LICENSE.txt +0 -5
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[0],{5e4:(e,r,t)=>{t.r(r),t.d(r,{default:()=>j});var s,i=t(41948),a=t(2600),l=t(20744),n=t(79152),o=t(26496),c=t(10860),p=t(28176),u=t(1580),h=t(33392),d=(t(72052),t(9456),t(33600)),y=t(12552),f=t(18996),_=t(56156),v=t(81436),g=t(38724),m=t(54664),S=t(50864),q=t(16660),T=t(25216),b=t(28584),w=t(66576),O=t(98768),W=t(26916),R=t(3116),C=t(49664),U=t(48212),k=t(21488),P=t(80428),A=t(84632);const G=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let L=s=class extends((0,T.W)((0,R.I)((0,C.s)((0,m.k)((0,S.I)((0,w.Y)((0,O.K)((0,q.u)((0,o.U)((0,W.G)((0,g.C)((0,b.G)(v.c))))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(c.CE).then((()=>this._fetchService(r)))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo?.spatialReference)&&_.c.fromJSON(e)}writeSublayers(e,r,t,s){if(!this.loaded||!e)return;const i=e.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).toArray(),a=[],l={writeSublayerStructure:!1,...s};i.forEach((e=>{const r=e.write({},l);a.push(r)})),a.some((e=>Object.keys(e).length>1))&&(r.layers=a)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(e){return Array.isArray(e)?e.map((e=>(0,p.as)(e).path)):null}fetchTile(e,r,t,s={}){const{signal:i}=s,l=this.getTileUrl(e,r,t),n={responseType:"image",signal:i,query:{...this.refreshParameters}};return(0,a.c)(l,n).then((e=>e.data))}async fetchImageBitmapTile(e,r,t,i={}){const{signal:l}=i;if(this.fetchTile!==s.prototype.fetchTile){const s=await this.fetchTile(e,r,t,i);return(0,P.G)(s,e,r,t,l)}const n=this.getTileUrl(e,r,t),o={responseType:"blob",signal:l,query:{...this.refreshParameters}},{data:c}=await(0,a.c)(n,o);return(0,P.G)(c,e,r,t,l)}getTileUrl(e,r,t){const s=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,i=(0,p.GK)({...this.parsedUrl?.query,blankTile:!s&&null,...this.customParameters,token:this.apiKey}),a=this.tileServers;return`${a&&a.length?a[r%a.length]:this.parsedUrl?.path}/tile/${e}/${r}/${t}${i?"?"+i:""}`}loadAll(){return(0,n.A)(this,(e=>{e(this.allSublayers)}))}_fetchService(e){return new Promise(((r,t)=>{if(this.sourceJSON){if(null!=this.sourceJSON.bandCount&&null!=this.sourceJSON.pixelSizeX)throw new l.c("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void r({data:this.sourceJSON})}if(!this.parsedUrl)throw new l.c("tile-layer:undefined-url","layer's url is not defined");const s=(0,U.K0)(this.parsedUrl.path);if(null!=s&&"ImageServer"===s.serverType)throw new l.c("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");(0,a.c)(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,t)})).then((r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),10.1===this.version&&!(0,U.Wq)(t))return this._fetchServerVersion(t,e).then((e=>{this.read({currentVersion:e})})).catch((()=>{}))}))}_fetchServerVersion(e,r){if(!(0,U.YB)(e))return Promise.reject();const t=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return(0,a.c)(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then((e=>{if(e.data&&e.data.currentVersion)return e.data.currentVersion;throw new l.c("tile-layer:version-not-available")}))}_getMapName(e){const r=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/mapserver/i);return r?r[2]:void 0}_getDefaultAttribution(e){if(null==e)return null;let r;e=e.toLowerCase();for(let t=0,s=G.length;t<s;t++)if(r=G[t],r.toLowerCase().includes(e))return(0,p.WM)("//static.arcgis.com/attribution/"+r);return null}_getDefaultTileServers(e){if(null==e)return[];const r=-1!==e.search(/^(?:https?:)?\/\/server\.arcgisonline\.com/i),t=-1!==e.search(/^(?:https?:)?\/\/services\.arcgisonline\.com/i);return r||t?[e,e.replace(r?/server\.arcgisonline/i:/services\.arcgisonline/i,r?"services.arcgisonline":"server.arcgisonline")]:[]}get hasOverriddenFetchTile(){return!this.fetchTile[M]}};(0,i._)([(0,u.qq)({readOnly:!0})],L.prototype,"attributionDataUrl",null),(0,i._)([(0,u.qq)({type:["show","hide","hide-children"]})],L.prototype,"listMode",void 0),(0,i._)([(0,u.qq)({json:{read:!0,write:!0}})],L.prototype,"blendMode",void 0),(0,i._)([(0,u.qq)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],L.prototype,"isReference",void 0),(0,i._)([(0,u.qq)({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],L.prototype,"operationalLayerType",void 0),(0,i._)([(0,u.qq)({type:Boolean})],L.prototype,"resampling",void 0),(0,i._)([(0,u.qq)()],L.prototype,"sourceJSON",void 0),(0,i._)([(0,u.qq)({type:_.c})],L.prototype,"spatialReference",void 0),(0,i._)([(0,d.E)("spatialReference",["spatialReference","tileInfo"])],L.prototype,"readSpatialReference",null),(0,i._)([(0,u.qq)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],L.prototype,"path",void 0),(0,i._)([(0,u.qq)({readOnly:!0})],L.prototype,"sublayers",void 0),(0,i._)([(0,f.G)("sublayers",{layers:{type:[A.c]}})],L.prototype,"writeSublayers",null),(0,i._)([(0,u.qq)({json:{read:!1,write:!1}})],L.prototype,"popupEnabled",void 0),(0,i._)([(0,u.qq)()],L.prototype,"tileServers",null),(0,i._)([(0,h.W)("tileServers")],L.prototype,"castTileServers",null),(0,i._)([(0,u.qq)({readOnly:!0,json:{read:!1}})],L.prototype,"type",void 0),(0,i._)([(0,u.qq)(k.qW)],L.prototype,"url",void 0),L=s=(0,i._)([(0,y.c)("geoscene.layers.TileLayer")],L);const M=Symbol("default-fetch-tile");L.prototype.fetchTile[M]=!0;const j=L}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[0],{5e4:(e,r,t)=>{t.r(r),t.d(r,{default:()=>j});var s,i=t(41948),a=t(2600),l=t(20744),n=t(79152),o=t(26496),c=t(10860),p=t(28176),u=t(1580),h=t(33392),d=(t(72052),t(9456),t(33600)),y=t(12552),f=t(18996),_=t(56156),v=t(81436),g=t(38724),m=t(54664),S=t(50864),q=t(16660),T=t(25216),b=t(28584),w=t(66576),O=t(98768),W=t(26916),R=t(3116),C=t(49664),U=t(48212),k=t(21488),P=t(80428),A=t(84632);const G=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let L=s=class extends((0,T.W)((0,R.I)((0,C.s)((0,m.k)((0,S.I)((0,w.Y)((0,O.K)((0,q.u)((0,o.U)((0,W.G)((0,g.C)((0,b.G)(v.c))))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(c.CE).then((()=>this._fetchService(r)))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo?.spatialReference)&&_.c.fromJSON(e)}writeSublayers(e,r,t,s){if(!this.loaded||!e)return;const i=e.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).toArray(),a=[],l={writeSublayerStructure:!1,...s};i.forEach((e=>{const r=e.write({},l);a.push(r)})),a.some((e=>Object.keys(e).length>1))&&(r.layers=a)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(e){return Array.isArray(e)?e.map((e=>(0,p.as)(e).path)):null}fetchTile(e,r,t,s={}){const{signal:i}=s,l=this.getTileUrl(e,r,t),n={responseType:"image",signal:i,query:{...this.refreshParameters}};return(0,a.c)(l,n).then((e=>e.data))}async fetchImageBitmapTile(e,r,t,i={}){const{signal:l}=i;if(this.fetchTile!==s.prototype.fetchTile){const s=await this.fetchTile(e,r,t,i);return(0,P.G)(s,e,r,t,l)}const n=this.getTileUrl(e,r,t),o={responseType:"blob",signal:l,query:{...this.refreshParameters}},{data:c}=await(0,a.c)(n,o);return(0,P.G)(c,e,r,t,l)}getTileUrl(e,r,t){const s=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,i=(0,p.GK)({...this.parsedUrl?.query,blankTile:!s&&null,...this.customParameters,token:this.apiKey}),a=this.tileServers;return`${a&&a.length?a[r%a.length]:this.parsedUrl?.path}/tile/${e}/${r}/${t}${i?"?"+i:""}`}loadAll(){return(0,n.A)(this,(e=>{e(this.allSublayers)}))}_fetchService(e){return new Promise(((r,t)=>{if(this.sourceJSON){if(null!=this.sourceJSON.bandCount&&null!=this.sourceJSON.pixelSizeX)throw new l.c("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void r({data:this.sourceJSON})}if(!this.parsedUrl)throw new l.c("tile-layer:undefined-url","layer's url is not defined");const s=(0,U.K0)(this.parsedUrl.path);if(null!=s&&"ImageServer"===s.serverType)throw new l.c("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");(0,a.c)(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,t)})).then((r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),10.1===this.version&&!(0,U.Wq)(t))return this._fetchServerVersion(t,e).then((e=>{this.read({currentVersion:e})})).catch((()=>{}))}))}_fetchServerVersion(e,r){if(!(0,U.YB)(e))return Promise.reject();const t=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return(0,a.c)(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then((e=>{if(e.data&&e.data.currentVersion)return e.data.currentVersion;throw new l.c("tile-layer:version-not-available")}))}_getMapName(e){return void 0}_getDefaultAttribution(e){return null;let r;e=e.toLowerCase();for(let t=0,s=G.length;t<s;t++)if(r=G[t],r.toLowerCase().includes(e))return(0,p.WM)("//static.Grcgis.cn/attribution/"+r);return null}_getDefaultTileServers(e){if(null==e)return[];const r=-1!==e.search(/^(?:https?:)?\/\/server\.arcgisonline\.com/i),t=-1!==e.search(/^(?:https?:)?\/\/services\.arcgisonline\.com/i);return r||t?[e,e.replace(r?/server\.arcgisonline/i:/services\.arcgisonline/i,r?"services.arcgisonline":"server.arcgisonline")]:[]}get hasOverriddenFetchTile(){return!this.fetchTile[M]}};(0,i._)([(0,u.qq)({readOnly:!0})],L.prototype,"attributionDataUrl",null),(0,i._)([(0,u.qq)({type:["show","hide","hide-children"]})],L.prototype,"listMode",void 0),(0,i._)([(0,u.qq)({json:{read:!0,write:!0}})],L.prototype,"blendMode",void 0),(0,i._)([(0,u.qq)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],L.prototype,"isReference",void 0),(0,i._)([(0,u.qq)({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],L.prototype,"operationalLayerType",void 0),(0,i._)([(0,u.qq)({type:Boolean})],L.prototype,"resampling",void 0),(0,i._)([(0,u.qq)()],L.prototype,"sourceJSON",void 0),(0,i._)([(0,u.qq)({type:_.c})],L.prototype,"spatialReference",void 0),(0,i._)([(0,d.E)("spatialReference",["spatialReference","tileInfo"])],L.prototype,"readSpatialReference",null),(0,i._)([(0,u.qq)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],L.prototype,"path",void 0),(0,i._)([(0,u.qq)({readOnly:!0})],L.prototype,"sublayers",void 0),(0,i._)([(0,f.G)("sublayers",{layers:{type:[A.c]}})],L.prototype,"writeSublayers",null),(0,i._)([(0,u.qq)({json:{read:!1,write:!1}})],L.prototype,"popupEnabled",void 0),(0,i._)([(0,u.qq)()],L.prototype,"tileServers",null),(0,i._)([(0,h.W)("tileServers")],L.prototype,"castTileServers",null),(0,i._)([(0,u.qq)({readOnly:!0,json:{read:!1}})],L.prototype,"type",void 0),(0,i._)([(0,u.qq)(k.qW)],L.prototype,"url",void 0),L=s=(0,i._)([(0,y.c)("geoscene.layers.TileLayer")],L);const M=Symbol("default-fetch-tile");L.prototype.fetchTile[M]=!0;const j=L}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3652],{8472:(e,t,n)=>{function r(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(l)||null!=t.match(a)?e.replace("static.arcgis.com","staticdev.geoscene.cn"):null!=t.match(s)||null!=t.match(i)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}n.d(t,{OM:()=>r,Ur:()=>o});const l=/^devext.geoscene.cn$/,s=/^qaext.geoscene.cn$/,a=/^[\w-]*\.mapsdevext.geoscene.cn$/,i=/^[\w-]*\.mapsqa.geoscene.cn$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,l,s,/^jsapps.esri.com$/,a,i]},56672:(e,t,n)=>{n.d(t,{g1:()=>l,sf:()=>o});var r=n(9456);const o=()=>!!(0,r.c)("enable-feature:force-wosr"),l=()=>!!(0,r.c)("enable-feature:SceneLayer-editing");((e="i3s-patching")=>{switch(r.c.add("enable-i3s-patching",!1,!0,!0),r.c.add("enable-feature:direct-3d-object-feature-layer-display",!1,!0,!0),r.c.add("enable-feature:SceneLayer-editing",!0,!0,!0),e){case"feature-layer-view":r.c.add("enable-feature:direct-3d-object-feature-layer-display",!0,!0,!0);break;case"i3s-patching":r.c.add("enable-i3s-patching",!0,!0,!0)}})("i3s-patching")},36210:(e,t,n)=>{n.d(t,{h4:()=>D,GA:()=>S,cx:()=>C});var r=n(17988),o=n(20744),l=n(71068),s=n(41528),a=n(91744),i=n(57908),c=n(7432),m=n(79756),u=n(49736),y=n(76060),f=n(47472),b=n(52032),p=n(22148),d=n(28652),h=n(86896);const g={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function w(e,t=g){if(!e)return{symbol:null};const{retainId:n=g.retainId,ignoreDrivers:l=g.ignoreDrivers,hasLabelingContext:s=g.hasLabelingContext,retainCIM:w=g.retainCIM}=t;let S=null;if((0,r._8)(e)||e instanceof a.c)S=e.clone();else if("cim"===e.type){const t=e.data?.symbol?.type;if("CIMPointSymbol"!==t)return{error:new o.c("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${t||"unknown"}' is unsupported in 3D`,{symbol:e})};S=w?e.clone():i.c.fromCIMSymbol(e)}else if(e instanceof c.c)S=m.c.fromSimpleLineSymbol(e);else if(e instanceof u.c)S=i.c.fromSimpleMarkerSymbol(e);else if(e instanceof y.c)S=i.c.fromPictureMarkerSymbol(e);else if(e instanceof f.c)S=t.geometryType&&"mesh"===t.geometryType?b.c.fromSimpleFillSymbol(e):p.c.fromSimpleFillSymbol(e);else{if(!(e instanceof d.c))return{error:new o.c("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${e.type||e.declaredClass}' is unsupported in 3D`,{symbol:e})};S=s?h.c.fromTextSymbol(e):i.c.fromTextSymbol(e)}return n&&S&&"cim"!==S.type&&(S.id=e.id),l&&(0,r._8)(S)&&S.symbolLayers.forEach((e=>e.ignoreDrivers=!0)),{symbol:S}}function S(e,t,n,r){const o=v(e,{},{context:r,isLabelSymbol:!1});null!=o&&(t[n]=o)}function C(e,t,n,r){const o=v(e,{},{context:r,isLabelSymbol:!0});null!=o&&(t[n]=o)}function $(e){return e instanceof s.c||e instanceof a.c}function v(e,t,n){if(null==e)return null;const{context:r,isLabelSymbol:s}=n,a=r?.origin,i=r?.messages;if("web-scene"===a&&!$(e)){const n=w(e,{retainCIM:!0,hasLabelingContext:s});return null!=n.symbol?n.symbol.write(t,r):(i?.push(new o.c("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported in scenes. Use 3D symbology instead when working with WebScene and SceneView`,{symbol:e,context:r,error:n.error})),null)}return("web-map"===a||"portal-item"===a&&!(0,l.iL)(r?.layer))&&$(e)?(i?.push(new o.c("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported in web maps and portal items. Use 2D symbology and CIMSymbol instead when working with MapView`,{symbol:e,context:r})),null):e.write(t,r)}function D(e,t){return(0,r.GM)(e,null,t)}},68984:(e,t,n)=>{n.d(t,{W8:()=>b,sj:()=>y,uY:()=>f,wR:()=>h,yo:()=>u});var r=n(2600),o=n(20744),l=n(10860),s=n(28176),a=n(54872),i=n(30872),c=n(56672);let m={};function u(e,t,n){return null!=e?.styleUrl?async function(e,t){try{return{data:(await b(e,t)).data,baseUrl:(0,s.iu)(e),styleUrl:e}}catch(e){return(0,l.CE)(e),null}}(e.styleUrl,n):null!=e?.styleName?function(e,t,n){const r=null!=t.portal?t.portal:a.c.getDefault();let l;const s=`${r.url} - ${r.user&&r.user.username} - ${e}`;return m[s]||(m[s]=function(e,t,n){return t.load(n).then((()=>{const r=new i.c({disableExtraQuery:!0,query:`owner:${p} AND type:${d} AND typekeywords:"${e}"`});return t.queryItems(r,n)})).then((({results:t})=>{let r=null;const l=e.toLowerCase();if(t&&Array.isArray(t))for(const e of t){const t=e.typeKeywords?.some((e=>e.toLowerCase()===l));if(t&&e.type===d&&e.owner===p){r=e;break}}if(!r)throw new o.c("symbolstyleutils:style-not-found",`The style '${e}' could not be found`,{styleName:e});return r.load(n)}))}(e,r,n).then((e=>(l=e,e.fetchData()))).then((t=>({data:t,baseUrl:l.itemUrl??"",styleName:e})))),m[s]}(e.styleName,t,n):Promise.reject(new o.c("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function y(e){return null===e||"CIMSymbolReference"===e.type?e:{type:"CIMSymbolReference",symbol:e}}function f(e,t,n=["gltf"]){if("cimRef"===t)return e.cimRef;if(e.formatInfos&&!(0,c.sf)())for(const t of n){const n=e.formatInfos.find((e=>e.type===t));if(n)return n.href}return e.webRef}function b(e,t){const n={responseType:"json",query:{f:"json"},...t};return(0,r.c)((0,s.k7)(e),n)}const p="esri_en",d="Style",h="https://links.geoscene.cn/geoscene/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json"},63652:(e,t,n)=>{n.d(t,{resolveWebStyleSymbol:()=>f});var r=n(17988),o=n(8472),l=n(20744),s=n(28176),a=n(54872),i=n(91952),c=n(36210),m=n(33560),u=n(68984),y=n(95944);function f(e,t,n,f){const b=e.name;return null==b?Promise.reject(new l.c("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference")):e.styleName&&"Esri2DPointSymbolsStyle"===e.styleName?function(e,t,n){const r=u.wR.replaceAll(/\{SymbolName\}/gi,e),o=null!=t.portal?t.portal:a.c.getDefault();return(0,u.W8)(r,n).then((e=>{const t=(0,u.sj)(e.data);return(0,c.h4)(t,{portal:o,url:(0,s.as)((0,s.iu)(r)),origin:"portal-item"})}))}(b,t,f):(0,u.yo)(e,t,f).then((e=>function(e,t,n,f,b,p){const d=null!=n?.portal?n.portal:a.c.getDefault(),h={portal:d,url:(0,s.as)(e.baseUrl),origin:"portal-item"},g=function(e,t){return t.items.find((t=>t.name===e))}(t,e.data);if(!g){const e=`The symbol name '${t}' could not be found`;return Promise.reject(new l.c("symbolstyleutils:symbol-name-not-found",e,{symbolName:t}))}let w=(0,i.f)(b(g,f),h),S=g.thumbnail?.href??null;const C=g.thumbnail?.imageData;(0,o.OM)()&&(w=(0,o.Ur)(w)??"",S=(0,o.Ur)(S));const $={portal:d,url:(0,s.as)((0,s.iu)(w)),origin:"portal-item"};return(0,u.W8)(w,p).then((o=>{const l="cimRef"===f?(0,u.sj)(o.data):o.data,s=(0,c.h4)(l,$);if(s&&(0,r._8)(s)){if(S){const e=(0,i.f)(S,h);s.thumbnail=new y.u({url:e})}else C&&(s.thumbnail=new y.u({url:`data:image/png;base64,${C}`}));e.styleUrl?s.styleOrigin=new m.c({portal:n.portal,styleUrl:e.styleUrl,name:t}):e.styleName&&(s.styleOrigin=new m.c({portal:n.portal,styleName:e.styleName,name:t}))}return s}))}(e,b,t,n,u.uY,f)))}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3652],{8472:(e,t,n)=>{function r(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(l)||null!=t.match(a)?e.replace("static.geoscene.cn","staticdev.geoscene.cn"):null!=t.match(s)||null!=t.match(i)?e.replace("static.geoscene.cn","staticqa.geoscene.cn"):e:e}n.d(t,{OM:()=>r,Ur:()=>o});const l=/^devext.geoscene.cn$/,s=/^qaext.geoscene.cn$/,a=/^[\w-]*\.mapsdevext.geoscene.cn$/,i=/^[\w-]*\.mapsqa.geoscene.cn$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.geoscene.cn$/,l,s,/^jsapps.geoscene.cn$/,a,i]},56672:(e,t,n)=>{n.d(t,{g1:()=>l,sf:()=>o});var r=n(9456);const o=()=>!!(0,r.c)("enable-feature:force-wosr"),l=()=>!!(0,r.c)("enable-feature:SceneLayer-editing");((e="i3s-patching")=>{switch(r.c.add("enable-i3s-patching",!1,!0,!0),r.c.add("enable-feature:direct-3d-object-feature-layer-display",!1,!0,!0),r.c.add("enable-feature:SceneLayer-editing",!0,!0,!0),e){case"feature-layer-view":r.c.add("enable-feature:direct-3d-object-feature-layer-display",!0,!0,!0);break;case"i3s-patching":r.c.add("enable-i3s-patching",!0,!0,!0)}})("i3s-patching")},36210:(e,t,n)=>{n.d(t,{h4:()=>D,GA:()=>S,cx:()=>C});var r=n(17988),o=n(20744),l=n(71068),s=n(41528),a=n(91744),i=n(57908),c=n(7432),m=n(79756),u=n(49736),y=n(76060),f=n(47472),b=n(52032),p=n(22148),d=n(28652),h=n(86896);const g={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function w(e,t=g){if(!e)return{symbol:null};const{retainId:n=g.retainId,ignoreDrivers:l=g.ignoreDrivers,hasLabelingContext:s=g.hasLabelingContext,retainCIM:w=g.retainCIM}=t;let S=null;if((0,r._8)(e)||e instanceof a.c)S=e.clone();else if("cim"===e.type){const t=e.data?.symbol?.type;if("CIMPointSymbol"!==t)return{error:new o.c("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${t||"unknown"}' is unsupported in 3D`,{symbol:e})};S=w?e.clone():i.c.fromCIMSymbol(e)}else if(e instanceof c.c)S=m.c.fromSimpleLineSymbol(e);else if(e instanceof u.c)S=i.c.fromSimpleMarkerSymbol(e);else if(e instanceof y.c)S=i.c.fromPictureMarkerSymbol(e);else if(e instanceof f.c)S=t.geometryType&&"mesh"===t.geometryType?b.c.fromSimpleFillSymbol(e):p.c.fromSimpleFillSymbol(e);else{if(!(e instanceof d.c))return{error:new o.c("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${e.type||e.declaredClass}' is unsupported in 3D`,{symbol:e})};S=s?h.c.fromTextSymbol(e):i.c.fromTextSymbol(e)}return n&&S&&"cim"!==S.type&&(S.id=e.id),l&&(0,r._8)(S)&&S.symbolLayers.forEach((e=>e.ignoreDrivers=!0)),{symbol:S}}function S(e,t,n,r){const o=v(e,{},{context:r,isLabelSymbol:!1});null!=o&&(t[n]=o)}function C(e,t,n,r){const o=v(e,{},{context:r,isLabelSymbol:!0});null!=o&&(t[n]=o)}function $(e){return e instanceof s.c||e instanceof a.c}function v(e,t,n){if(null==e)return null;const{context:r,isLabelSymbol:s}=n,a=r?.origin,i=r?.messages;if("web-scene"===a&&!$(e)){const n=w(e,{retainCIM:!0,hasLabelingContext:s});return null!=n.symbol?n.symbol.write(t,r):(i?.push(new o.c("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported in scenes. Use 3D symbology instead when working with WebScene and SceneView`,{symbol:e,context:r,error:n.error})),null)}return("web-map"===a||"portal-item"===a&&!(0,l.iL)(r?.layer))&&$(e)?(i?.push(new o.c("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported in web maps and portal items. Use 2D symbology and CIMSymbol instead when working with MapView`,{symbol:e,context:r})),null):e.write(t,r)}function D(e,t){return(0,r.GM)(e,null,t)}},68984:(e,t,n)=>{n.d(t,{W8:()=>b,sj:()=>y,uY:()=>f,wR:()=>h,yo:()=>u});var r=n(2600),o=n(20744),l=n(10860),s=n(28176),a=n(54872),i=n(30872),c=n(56672);let m={};function u(e,t,n){return null!=e?.styleUrl?async function(e,t){try{return{data:(await b(e,t)).data,baseUrl:(0,s.iu)(e),styleUrl:e}}catch(e){return(0,l.CE)(e),null}}(e.styleUrl,n):null!=e?.styleName?function(e,t,n){const r=null!=t.portal?t.portal:a.c.getDefault();let l;const s=`${r.url} - ${r.user&&r.user.username} - ${e}`;return m[s]||(m[s]=function(e,t,n){return t.load(n).then((()=>{const r=new i.c({disableExtraQuery:!0,query:`owner:${p} AND type:${d} AND typekeywords:"${e}"`});return t.queryItems(r,n)})).then((({results:t})=>{let r=null;const l=e.toLowerCase();if(t&&Array.isArray(t))for(const e of t){const t=e.typeKeywords?.some((e=>e.toLowerCase()===l));if(t&&e.type===d&&e.owner===p){r=e;break}}if(!r)throw new o.c("symbolstyleutils:style-not-found",`The style '${e}' could not be found`,{styleName:e});return r.load(n)}))}(e,r,n).then((e=>(l=e,e.fetchData()))).then((t=>({data:t,baseUrl:l.itemUrl??"",styleName:e})))),m[s]}(e.styleName,t,n):Promise.reject(new o.c("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function y(e){return null===e||"CIMSymbolReference"===e.type?e:{type:"CIMSymbolReference",symbol:e}}function f(e,t,n=["gltf"]){if("cimRef"===t)return e.cimRef;if(e.formatInfos&&!(0,c.sf)())for(const t of n){const n=e.formatInfos.find((e=>e.type===t));if(n)return n.href}return e.webRef}function b(e,t){const n={responseType:"json",query:{f:"json"},...t};return(0,r.c)((0,s.k7)(e),n)}const p="esri_en",d="Style",h="https://links.geoscene.cn/geoscene/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json"},63652:(e,t,n)=>{n.d(t,{resolveWebStyleSymbol:()=>f});var r=n(17988),o=n(8472),l=n(20744),s=n(28176),a=n(54872),i=n(91952),c=n(36210),m=n(33560),u=n(68984),y=n(95944);function f(e,t,n,f){const b=e.name;return null==b?Promise.reject(new l.c("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference")):e.styleName&&"Esri2DPointSymbolsStyle"===e.styleName?function(e,t,n){const r=u.wR.replaceAll(/\{SymbolName\}/gi,e),o=null!=t.portal?t.portal:a.c.getDefault();return(0,u.W8)(r,n).then((e=>{const t=(0,u.sj)(e.data);return(0,c.h4)(t,{portal:o,url:(0,s.as)((0,s.iu)(r)),origin:"portal-item"})}))}(b,t,f):(0,u.yo)(e,t,f).then((e=>function(e,t,n,f,b,p){const d=null!=n?.portal?n.portal:a.c.getDefault(),h={portal:d,url:(0,s.as)(e.baseUrl),origin:"portal-item"},g=function(e,t){return t.items.find((t=>t.name===e))}(t,e.data);if(!g){const e=`The symbol name '${t}' could not be found`;return Promise.reject(new l.c("symbolstyleutils:symbol-name-not-found",e,{symbolName:t}))}let w=(0,i.f)(b(g,f),h),S=g.thumbnail?.href??null;const C=g.thumbnail?.imageData;(0,o.OM)()&&(w=(0,o.Ur)(w)??"",S=(0,o.Ur)(S));const $={portal:d,url:(0,s.as)((0,s.iu)(w)),origin:"portal-item"};return(0,u.W8)(w,p).then((o=>{const l="cimRef"===f?(0,u.sj)(o.data):o.data,s=(0,c.h4)(l,$);if(s&&(0,r._8)(s)){if(S){const e=(0,i.f)(S,h);s.thumbnail=new y.u({url:e})}else C&&(s.thumbnail=new y.u({url:`data:image/png;base64,${C}`}));e.styleUrl?s.styleOrigin=new m.c({portal:n.portal,styleUrl:e.styleUrl,name:t}):e.styleName&&(s.styleOrigin=new m.c({portal:n.portal,styleName:e.styleName,name:t}))}return s}))}(e,b,t,n,u.uY,f)))}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8616,6236],{48212:(e,r,t)=>{t.d(r,{Ab:()=>E,Ej:()=>d,K0:()=>f,M9:()=>p,Wq:()=>S,YB:()=>c,_2:()=>m,oR:()=>y,q_:()=>v,wn:()=>w});var n=t(28176),s=t(91952);const l={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer"},i=Object.values(l),u=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${i.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),o=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${i.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),a=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function c(e){return!!u.test(e)}function f(e){if(null==e)return null;const r=(0,n.as)(e),t=r?.path.match(u)||r?.path.match(o);if(!t)return null;const[,s,i,a,c]=t,f=i.indexOf("/");return{title:p(-1!==f?i.slice(f+1):i),serverType:l[a.toLowerCase()],sublayer:null!=c&&""!==c?parseInt(c,10):null,url:{path:s}}}function d(e){const r=(0,n.as)(e).path.match(a);return r?{serviceUrl:r[1],sublayerId:Number(r[2])}:null}function p(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function v(e,r){const t=[];if(e){const r=f(e);null!=r&&r.title&&t.push(r.title)}if(r){const e=p(r);t.push(e)}if(2===t.length){if(t[0].toLowerCase().includes(t[1].toLowerCase()))return t[0];if(t[1].toLowerCase().includes(t[0].toLowerCase()))return t[1]}return t.join(" - ")}function S(e){if(!e)return!1;const r=(e=e.toLowerCase()).includes(".arcgis.com/"),t=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return r&&t}function y(e,r){return e?(0,n.ai)((0,n.kN)(e,r)):e}function m(e){let{url:r}=e;if(!r)return{url:r};r=(0,n.kN)(r,e.logger);const t=(0,n.as)(r),s=f(t.path);let l;if(null!=s)null!=s.sublayer&&null==e.layer.layerId&&(l=s.sublayer),r=s.url.path;else if(e.nonStandardUrlAllowed){const e=d(t.path);null!=e&&(r=e.serviceUrl,l=e.sublayerId)}return{url:(0,n.ai)(r),layerId:l}}function w(e,r,t,l,i){(0,s.w)(r,l,"url",i),l.url&&null!=e.layerId&&(l.url=(0,n.kn)(l.url,t,e.layerId.toString()))}function E(e){if(!e)return!1;const r=e.toLowerCase(),t=r.includes("/services/"),n=r.includes("/mapserver/wmsserver"),s=r.includes("/imageserver/wmsserver"),l=r.includes("/wmsserver");return t&&(n||s||l)}},46940:(e,r,t)=>{t.d(r,{CI:()=>d,KI:()=>a,O2:()=>i,_S:()=>u,mU:()=>o,oj:()=>c,qk:()=>f});var n=t(60074),s=t(56156),l=t(29120);function i(e,r){if(!u(e,r)){const t=e.typeKeywords;t?t.push(r):e.typeKeywords=[r]}}function u(e,r){return!!e.typeKeywords?.includes(r)}function o(e){return u(e,f.HOSTED_SERVICE)}function a(e,r){const t=e.typeKeywords;if(t){const e=t.indexOf(r);e>-1&&t.splice(e,1)}}async function c(e){const r=e.clone().normalize();let t;if(r.length>1)for(const e of r)t?e.width>t.width&&(t=e):t=e;else t=r[0];return async function(e){const r=e.spatialReference;if(r.isWGS84)return e.clone();if(r.isWebMercator)return(0,l.aq)(e);const t=s.c.WGS84;return await(0,n.initializeProjection)(r,t),(0,n.project)(e,t)}(t)}const f={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"GeoScene API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery",GROUP_LAYER_MAP:"Map"};function d(e){const{portal:r,isOrgItem:t,itemControl:n}=e,s=r.user?.privileges;let l=!s||s.includes("features:user:edit"),i=!!t&&!!s?.includes("features:user:fullEdit");const u="update"===n||"admin"===n;return u?i=l=!0:i&&(l=!0),{features:{edit:l,fullEdit:i},content:{updateItem:u}}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8616,6236],{48212:(e,r,t)=>{t.d(r,{Ab:()=>E,Ej:()=>d,K0:()=>f,M9:()=>p,Wq:()=>S,YB:()=>c,_2:()=>m,oR:()=>y,q_:()=>v,wn:()=>w});var n=t(28176),s=t(91952);const l={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer"},i=Object.values(l),u=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${i.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),o=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${i.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),a=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function c(e){return!!u.test(e)}function f(e){if(null==e)return null;const r=(0,n.as)(e),t=r?.path.match(u)||r?.path.match(o);if(!t)return null;const[,s,i,a,c]=t,f=i.indexOf("/");return{title:p(-1!==f?i.slice(f+1):i),serverType:l[a.toLowerCase()],sublayer:null!=c&&""!==c?parseInt(c,10):null,url:{path:s}}}function d(e){const r=(0,n.as)(e).path.match(a);return r?{serviceUrl:r[1],sublayerId:Number(r[2])}:null}function p(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function v(e,r){const t=[];if(e){const r=f(e);null!=r&&r.title&&t.push(r.title)}if(r){const e=p(r);t.push(e)}if(2===t.length){if(t[0].toLowerCase().includes(t[1].toLowerCase()))return t[0];if(t[1].toLowerCase().includes(t[0].toLowerCase()))return t[1]}return t.join(" - ")}function S(e){if(!e)return!1;const r=(e=e.toLowerCase()).includes(".Grcgis.cn/"),t=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return r&&t}function y(e,r){return e?(0,n.ai)((0,n.kN)(e,r)):e}function m(e){let{url:r}=e;if(!r)return{url:r};r=(0,n.kN)(r,e.logger);const t=(0,n.as)(r),s=f(t.path);let l;if(null!=s)null!=s.sublayer&&null==e.layer.layerId&&(l=s.sublayer),r=s.url.path;else if(e.nonStandardUrlAllowed){const e=d(t.path);null!=e&&(r=e.serviceUrl,l=e.sublayerId)}return{url:(0,n.ai)(r),layerId:l}}function w(e,r,t,l,i){(0,s.w)(r,l,"url",i),l.url&&null!=e.layerId&&(l.url=(0,n.kn)(l.url,t,e.layerId.toString()))}function E(e){if(!e)return!1;const r=e.toLowerCase(),t=r.includes("/services/"),n=r.includes("/mapserver/wmsserver"),s=r.includes("/imageserver/wmsserver"),l=r.includes("/wmsserver");return t&&(n||s||l)}},46940:(e,r,t)=>{t.d(r,{CI:()=>d,KI:()=>a,O2:()=>i,_S:()=>u,mU:()=>o,oj:()=>c,qk:()=>f});var n=t(60074),s=t(56156),l=t(29120);function i(e,r){if(!u(e,r)){const t=e.typeKeywords;t?t.push(r):e.typeKeywords=[r]}}function u(e,r){return!!e.typeKeywords?.includes(r)}function o(e){return u(e,f.HOSTED_SERVICE)}function a(e,r){const t=e.typeKeywords;if(t){const e=t.indexOf(r);e>-1&&t.splice(e,1)}}async function c(e){const r=e.clone().normalize();let t;if(r.length>1)for(const e of r)t?e.width>t.width&&(t=e):t=e;else t=r[0];return async function(e){const r=e.spatialReference;if(r.isWGS84)return e.clone();if(r.isWebMercator)return(0,l.aq)(e);const t=s.c.WGS84;return await(0,n.initializeProjection)(r,t),(0,n.project)(e,t)}(t)}const f={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"GeoScene API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery",GROUP_LAYER_MAP:"Map"};function d(e){const{portal:r,isOrgItem:t,itemControl:n}=e,s=r.user?.privileges;let l=!s||s.includes("features:user:edit"),i=!!t&&!!s?.includes("features:user:fullEdit");const u="update"===n||"admin"===n;return u?i=l=!0:i&&(l=!0),{features:{edit:l,fullEdit:i},content:{updateItem:u}}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5752,8528],{25228:(e,t,s)=>{s.d(t,{c:()=>f});var i,n=s(41948),r=s(40504),o=s(94360),a=s(1580),l=(s(9456),s(66360),s(72052),s(33600)),u=s(12552),h=s(18996),c=s(28484);let d=i=class extends r.am{static get allTime(){return p}static get empty(){return _}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,s=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,n=e.end?.getTime()??e.end;return t===i&&s===n}expandTo(e,t=c.OX){if(this.isEmpty||this.isAllTime)return this.clone();let s=this.start;s&&(s=(0,o.aU)(s,e,t));let n=this.end;if(n){const s=(0,o.aU)(n,e,t);n=n.getTime()===s.getTime()?s:(0,o.g1)(s,1,e,t)}return new i({start:s,end:n})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,s=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let o,a;if(n>=t&&n<=s?o=n:t>=n&&t<=r&&(o=t),s>=n&&s<=r?a=s:r>=t&&r<=s&&(a=r),null!=o&&null!=a&&!isNaN(o)&&!isNaN(a)){const e=new i;return e.start=o===-1/0?null:new Date(o),e.end=a===1/0?null:new Date(a),e}return i.empty}offset(e,t,s=c.OX){if(this.isEmpty||this.isAllTime)return this.clone();const n=new i,{start:r,end:a}=this;return null!=r&&(n.start=(0,o.g1)(r,e,t,s)),null!=a&&(n.end=(0,o.g1)(a,e,t,s)),n}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return p.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,s=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:s})}};(0,n._)([(0,a.qq)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,n._)([(0,l.E)("end")],d.prototype,"readEnd",null),(0,n._)([(0,h.G)("end")],d.prototype,"writeEnd",null),(0,n._)([(0,a.qq)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,n._)([(0,a.qq)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,n._)([(0,a.qq)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,n._)([(0,l.E)("start")],d.prototype,"readStart",null),(0,n._)([(0,h.G)("start")],d.prototype,"writeStart",null),d=i=(0,n._)([(0,u.c)("geoscene.TimeExtent")],d);const p=new d,_=new d({start:void 0,end:void 0}),f=d},8528:(e,t,s)=>{s.d(t,{c:()=>i,g:()=>n});var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},80424:(e,t,s)=>{var i;s.d(t,{M:()=>i}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(i||(i={}))},3856:(e,t,s)=>{s.d(t,{m:()=>c,q:()=>h});var i=s(41948),n=s(43780),r=(s(9456),s(62088)),o=(s(66360),s(70680)),a=s(71448),l=s(20916),u=s(12552);const h=e=>{let t=class extends e{clone(){const e=(0,l.m6)(this);(0,o.EN)(e,"unable to clone instance of non-accessor class");const t=e.metadata,s=e.store,i={},n=new Map;for(const e in t){const o=t[e],l=s?.originOf(e),u=o.clonable;if(o.readOnly||!1===u||l!==a.sT.USER&&l!==a.sT.DEFAULTS&&l!==a.sT.WEB_MAP&&l!==a.sT.WEB_SCENE)continue;const h=this[e];let c=null;c="function"==typeof u?u(h):"reference"===u?h:(0,r.gx)(h),null!=h&&null==c||(l===a.sT.DEFAULTS?n.set(e,c):i[e]=c)}const u=new(0,Object.getPrototypeOf(this).constructor)(i);if(n.size){const e=(0,l.m6)(u)?.store;if(e)for(const[t,s]of n)e.set(t,s,a.sT.DEFAULTS)}return u}};return t=(0,i._)([(0,u.c)("geoscene.core.Clonable")],t),t};let c=class extends(h(n.c)){};c=(0,i._)([(0,u.c)("geoscene.core.Clonable")],c)},11004:(e,t,s)=>{s.d(t,{o:()=>n});var i=s(74452);class n{constructor(e,t){this._storage=new i.kB,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,s=1){this._storage.put(this,e,t,s,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},74452:(e,t,s)=>{s.d(t,{ML:()=>o,kB:()=>a});var i,n,r=s(24680);(n=i||(i={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class o{constructor(e,t,s){this.name=e,this._storage=t,this.id=l+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),s&&(this._storage.registerRemoveFunc(this.id,s),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,s,i=0){this._storage.put(this,e,t,s,i)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,s){this._storage.updateSize(this,e,t,s)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new r.c,this._users=new r.c}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const s=this._db.get(e.id+t);return s?.size??0}put(e,t,s,n,r){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==s&&this._notifyRemove(t,o.entry,o.size,i.ALL)),n>this._maxSize)return void this._notifyRemove(t,s,n,i.ALL);if(void 0===s)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,s,0,i.ALL);const a=1+Math.max(r,-4)- -3;this._db.set(t,new u(s,n,a)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t,s,n){t=e.id+t;const r=this._db.get(t);if(r&&r.entry===s){for(this._size-=r.size,e.size-=r.size;n>this._maxSize;){const e=this._notifyRemove(t,s,n,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);n=e}r.size=n,this._size+=n,e.size+=n,this._checkSize()}}pop(e,t){t=e.id+t;const s=this._db.get(t);if(s)return this._size-=s.size,e.size-=s.size,this._db.delete(t),++this._hit,s.entry;++this._miss}get(e,t){t=e.id+t;const s=this._db.get(t);if(void 0!==s)return this._db.delete(t),s.lives=s.lifetime,this._db.set(t,s),++this._hit,s.entry;++this._miss}peek(e,t){const s=this._db.get(e.id+t);return s?++this._hit:++this._miss,s?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},s=new Array;this._db.forEach(((e,i)=>{const n=e.lifetime;s[n]=(s[n]||0)+e.size,this._users.forAll((s=>{const{id:n,name:r}=s;if(i.startsWith(n)){const s=t[r]||0;t[r]=s+e.size}}))}));const i={};this._users.forAll((e=>{const s=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[s]||0;t[s]=n,i[s]=Math.round(100*e.hitRate)+"%"}else i[s]="0%"}));const n=Object.keys(t);n.sort(((e,s)=>t[s]-t[e])),n.forEach((s=>e[s]=Math.round(t[s]/2**20)+"MB / "+i[s]));for(let t=s.length-1;t>=0;--t){const i=s[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,s)=>{s.startsWith(t)&&(this._size-=e.size,this._db.delete(s),this._notifyRemove(s,e.entry,e.size,i.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,i.ALL))),this._users.forAll((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,s,i){let n;return this._removeFuncs.some((r=>{if(e.startsWith(r[0])){const e=r[1](t,i,s);return"number"==typeof e&&(n=e),!0}return!1})),n}_checkSize(){this._users.forAll((e=>this._checkSizeLimits(e))),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const s=e?.id;let i=!0;for(;i;){i=!1;for(const[n,r]of this._db)if(0===r.lifetime&&(!s||n.startsWith(s))){if(this._purgeItem(n,r,e),t.size<=.9*t.maxSize)return;i||=this._db.has(n)}}for(const[i,n]of this._db)if((!s||i.startsWith(s))&&(this._purgeItem(i,n,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,s=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,s&&(s.size-=t.size);const n=this._notifyRemove(e,t.entry,t.size,i.SOME);null!=n&&n>0&&(this._size+=n,s&&(s.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let l=0;class u{constructor(e,t,s){this.entry=e,this.size=t,this.lifetime=s,this.lives=s}}},3024:(e,t,s)=>{s.d(t,{U:()=>o});var i=s(92400),n=s(24680),r=s(85304);class o{constructor(e=9,t){this._compareMinX=h,this._compareMinY=c,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),v.prune(),w.prune(),E.prune(),x.prune()}all(e){this._all(this._data,e)}search(e,t){let s=this._data;const i=this._toBBox;if(m(e,s))for(v.clear();s;){for(let n=0,r=s.children.length;n<r;n++){const r=s.children[n],o=s.leaf?i(r):r;m(e,o)&&(s.leaf?t(r):g(e,o)?this._all(r,t):v.push(r))}s=v.pop()}}collides(e){let t=this._data;const s=this._toBBox;if(!m(e,t))return!1;for(v.clear();t;){for(let i=0,n=t.children.length;i<n;i++){const n=t.children[i],r=t.leaf?s(n):n;if(m(e,r)){if(t.leaf||g(e,r))return!0;v.push(n)}}t=v.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new I([]),this}remove(e){if(!e)return this;let t,s=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(E.clear(),x.clear();s||E.length>0;){if(s||(s=E.pop(),n=E.data[E.length-1],r=x.pop()??0,o=!0),s.leaf&&(t=(0,i.IP)(s.children,e,s.children.length,s.indexHint),-1!==t))return s.children.splice(t,1),E.push(s),this._condense(E),this;o||s.leaf||!g(s,a)?n?(r++,s=n.children[r],o=!1):s=null:(E.push(s),x.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let s=e;for(w.clear();s;){if(!0===s.leaf)for(const e of s.children)t(e);else w.pushArray(s.children);s=w.pop()??null}}_build(e,t,s,i){const n=s-t+1;let r=this._maxEntries;if(n<=r){const i=new I(e.slice(t,s+1));return a(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(i-1)));const o=new T([]);o.height=i;const l=Math.ceil(n/r),u=l*Math.ceil(Math.sqrt(r));y(e,t,s,u,this._compareMinX);for(let n=t;n<=s;n+=u){const t=Math.min(n+u-1,s);y(e,n,t,l,this._compareMinY);for(let s=n;s<=t;s+=l){const n=Math.min(s+l-1,t);o.children.push(this._build(e,s,n,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,s,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=d(o),l=_(e,o)-a;l<n?(n=l,i=a<i?a:i,s=o):l===n&&a<i&&(i=a,s=o)}t=s||t.children[0]}return t}_insert(e,t,s){const i=this._toBBox,n=s?e:i(e);E.clear();const r=this._chooseSubtree(n,this._data,t,E);for(r.children.push(e),u(r,n);t>=0&&E.data[t].children.length>this._maxEntries;)this._split(E,t),t--;this._adjustParentBBoxes(n,E,t)}_split(e,t){const s=e.data[t],i=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,i);const r=this._chooseSplitIndex(s,n,i);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=s.children.splice(r,s.children.length-r),l=s.leaf?new I(o):new T(o);l.height=s.height,a(s,this._toBBox),a(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(s,l)}_splitRoot(e,t){this._data=new T([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,s){let i,n,r;i=n=1/0;for(let o=t;o<=s-t;o++){const t=l(e,0,o,this._toBBox),a=l(e,o,s,this._toBBox),u=f(t,a),h=d(t)+d(a);u<i?(i=u,r=o,n=h<n?h:n):u===i&&h<n&&(n=h,r=o)}return r}_chooseSplitAxis(e,t,s){const i=e.leaf?this._compareMinX:h,n=e.leaf?this._compareMinY:c;this._allDistMargin(e,t,s,i)<this._allDistMargin(e,t,s,n)&&e.children.sort(i)}_allDistMargin(e,t,s,i){e.children.sort(i);const n=this._toBBox,r=l(e,0,t,n),o=l(e,s-t,s,n);let a=p(r)+p(o);for(let i=t;i<s-t;i++){const t=e.children[i];u(r,e.leaf?n(t):t),a+=p(r)}for(let i=s-t-1;i>=t;i--){const t=e.children[i];u(o,e.leaf?n(t):t),a+=p(o)}return a}_adjustParentBBoxes(e,t,s){for(let i=s;i>=0;i--)u(t.data[i],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const s=e.data[t];if(0===s.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,i.IP)(r,s,r.length,n.indexHint),1)}else this.clear();else a(s,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){l(e,0,e.children.length,t,e)}function l(e,t,s,i,n){n||(n=new I([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<s;o++)r=e.children[o],u(n,e.leaf?i(r):r);return n}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function c(e,t){return e.minY-t.minY}function d(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(e){return e.maxX-e.minX+(e.maxY-e.minY)}function _(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function f(e,t){const s=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-s)*Math.max(0,r-i)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function m(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function y(e,t,s,i,n){const o=[t,s];for(;o.length;){const t=o.pop(),s=o.pop();if(t-s<=i)continue;const a=s+Math.ceil((t-s)/i/2)*i;(0,r.q)(e,a,s,t,n),o.push(s,a,a,t)}}const v=new n.c,w=new n.c,E=new n.c,x=new n.c({deallocator:void 0});class b{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class S extends b{constructor(){super(...arguments),this.height=1,this.indexHint=new i.is}}class I extends S{constructor(e){super(),this.children=e,this.leaf=!0}}class T extends S{constructor(e){super(),this.children=e,this.leaf=!1}}},57896:(e,t,s)=>{s.d(t,{Eq:()=>d,KG:()=>m,_8:()=>g,_I:()=>u,aE:()=>l,du:()=>f,on:()=>c}),s(40196),s(2952);var i=s(60976),n=s(38912),r=s(70680),o=s(10860),a=s(37176);function l(e,t,s={}){return h(e,t,s,p)}function u(e,t,s={}){return h(e,t,s,_)}function h(e,t,s={},i){let n=null;const o=s.once?(e,s)=>{i(e)&&((0,r.oR)(n),t(e,s))}:(e,s)=>{i(e)&&t(e,s)};if(n=(0,a.M9)(e,o,s.sync,s.equals),s.initial){const t=e();o(t,t)}return n}function c(e,t,s,o={}){let a=null,u=null,h=null;function c(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function d(e){o.once&&o.once&&(0,r.oR)(h),s(e)}const p=l(e,((e,s)=>{c(),(0,i.sh)(e)&&(a=e,u=(0,i.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return h=(0,n.uU)((()=>{p.remove(),c()})),h}function d(e,t){return function(e,t,s){if((0,o.wv)(s))return Promise.reject((0,o.Uh)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function l(){a=(0,r.oR)(a)}return new Promise(((i,r)=>{a=(0,n.Ip)([(0,o.wD)(s,(()=>{l(),r((0,o.Uh)())})),h(e,(e=>{l(),i(e)}),{sync:!1,once:!0},t??p)])}))}(e,_,t)}function p(e){return!0}function _(e){return!!e}s(41168);const f={sync:!0},g={initial:!0},m={sync:!0,initial:!0}},60936:(e,t,s)=>{s.d(t,{A:()=>h});var i=s(41948),n=s(43780),r=s(38912),o=s(57896),a=s(66168),l=s(1580),u=s(12552);let h=class extends n.c{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o.aE)}addWhen(e,t,s={}){return this._installWatch(e,t,s,o._I)}addOnCollectionChange(e,t,{initial:s=!1,final:i=!1}={}){const n=++this._handleId;return this.addHandles([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.du),(0,o.on)(e,"change",t,{onListenerAdd:s?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:i?e=>t({added:[],removed:e.toArray()}):void 0})],n),(0,r.uU)((()=>this.removeHandles(n)))}addPromise(e){if(null==e)return e;const t=++this._handleId;this.addHandles((0,r.uU)((()=>{this._pendingPromises.delete(e)&&(0!==this._pendingPromises.size||this.hasHandles(c)||this._set("updating",!1))})),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},i){const n=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,n);const o=i(e,t,s);return this.addHandles(o,n),(0,r.uU)((()=>this.removeHandles(n)))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),i=(0,o.aE)(e,s,{sync:!0,equals:()=>!1});return this.addHandles(i,t),i}_createSyncUpdatingCallback(){return()=>{this.removeHandles(c),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles((0,a.Ow)((()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(c))})),c)}}};(0,i._)([(0,l.qq)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,i._)([(0,u.c)("geoscene.core.support.UpdatingHandles")],h);const c=-42},6904:(e,t,s)=>{s.d(t,{c:()=>a});var i=s(9456),n=s(3024),r=s(83372);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.U(9,(0,i.c)("geoscene-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,i)=>{e[t++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.FZ)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},9107:(e,t,s)=>{s.d(t,{c:()=>_});var i=s(92400),n=s(20744),r=s(77860),o=s(66360),a=s(77048),l=s(83372),u=s(97088),h=s(6904),c=s(83624),d=s(51752);const p=(0,a.Su)();class _{constructor(e){this.geometryInfo=e,this._boundsStore=new h.c,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.c,this.featureAdapter=d.u}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,s,i,n]=this.fullBounds;return{xmin:t,ymin:s,xmax:i,ymax:n,spatialReference:(0,c.C6)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map((e=>this._upsert(e)));return this._emitChanged(),t.filter(i.G6)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.Qv)(p,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.c.getLogger("geoscene.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.C_)(null!=i?i:(0,l.Su)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.c.getLogger("geoscene.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:i,attributes:r}=e;for(const e in r)s.attributes[e]=r[e];return i&&(s.geometry=i,this._boundsStore.set(t,(0,u.C_)((0,l.Su)(),i,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},600:(e,t,s)=>{s.d(t,{c:()=>g});var i,n=s(41948),r=s(14628),o=s(40504),a=s(1580),l=s(53368),u=(s(72052),s(9456),s(9968)),h=s(33600),c=s(12552),d=s(89812),p=s(36408);const _=new r.O({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let f=i=class extends o.am{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let s=null;try{s=t?JSON.parse(t):null}catch(e){}return s?.value??null}readValueType(e,{description:t}){let s=null;try{s=t?JSON.parse(t):null}catch(e){}return s?_.fromJSON(s.fieldValueType):null}clone(){return new i({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,n._)([(0,a.qq)({type:String,json:{write:!0}})],f.prototype,"alias",void 0),(0,n._)([(0,a.qq)({type:[String,Number],json:{write:{allowNull:!0}}})],f.prototype,"defaultValue",void 0),(0,n._)([(0,a.qq)()],f.prototype,"description",void 0),(0,n._)([(0,h.E)("description")],f.prototype,"readDescription",null),(0,n._)([(0,a.qq)({types:d.i2,json:{read:{reader:d.h4},write:!0}})],f.prototype,"domain",void 0),(0,n._)([(0,a.qq)({type:Boolean,json:{write:!0}})],f.prototype,"editable",void 0),(0,n._)([(0,a.qq)({type:l.Ab,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],f.prototype,"length",void 0),(0,n._)([(0,a.qq)({type:String,json:{write:!0}})],f.prototype,"name",void 0),(0,n._)([(0,a.qq)({type:Boolean,json:{write:!0}})],f.prototype,"nullable",void 0),(0,n._)([(0,u.G)(p.M)],f.prototype,"type",void 0),(0,n._)([(0,a.qq)()],f.prototype,"valueType",void 0),(0,n._)([(0,h.E)("valueType",["description"])],f.prototype,"readValueType",null),(0,n._)([(0,a.qq)({type:Boolean,json:{read:!1}})],f.prototype,"visible",void 0),f=i=(0,n._)([(0,c.c)("geoscene.layers.support.Field")],f);const g=f},22108:(e,t,s)=>{s.d(t,{c:()=>h});var i,n=s(41948),r=s(40504),o=s(1580),a=s(53368),l=(s(72052),s(9456),s(12552));let u=i=class extends r.am{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new i({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n._)([(0,o.qq)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"cols",void 0),(0,n._)([(0,o.qq)({type:a.Ab,json:{write:!0}})],u.prototype,"level",void 0),(0,n._)([(0,o.qq)({type:String,json:{write:!0}})],u.prototype,"levelValue",void 0),(0,n._)([(0,o.qq)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"origin",void 0),(0,n._)([(0,o.qq)({type:Number,json:{write:!0}})],u.prototype,"resolution",void 0),(0,n._)([(0,o.qq)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"rows",void 0),(0,n._)([(0,o.qq)({type:Number,json:{write:!0}})],u.prototype,"scale",void 0),u=i=(0,n._)([(0,l.c)("geoscene.layers.support.LOD")],u);const h=u},87576:(e,t,s)=>{s.d(t,{c:()=>S});var i,n=s(41948),r=s(14628),o=s(40504),a=s(24296),l=s(1580),u=s(53368),h=(s(72052),s(9456),s(33600)),c=s(12552),d=s(18996),p=s(67776),_=s(56156),f=s(83372),g=s(60544),m=s(29120),y=s(22108),v=s(11712);const w=new r.O({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let E=i=class extends o.am{static create(e={}){const{resolutionFactor:t=1,scales:s,size:n=256,spatialReference:r=_.c.WebMercator,numLODs:o=24}=e;if(!(0,g.U3)(r)){const e=[];if(s)for(let t=0;t<s.length;t++){const i=s[t];e.push(new y.c({level:t,scale:i,resolution:i}))}else{let t=5e-4;for(let s=o-1;s>=0;s--)e.unshift(new y.c({level:s,scale:t,resolution:t})),t*=2}return new i({dpi:96,lods:e,origin:new p.c(0,0,r),size:[n,n],spatialReference:r})}const l=(0,g.Nq)(r),u=e.origin?new p.c({x:e.origin.x,y:e.origin.y,spatialReference:r}):new p.c(l?{x:l.origin[0],y:l.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),h=1/(39.37*(0,a.k8)(r)*96),c=[];if(s)for(let e=0;e<s.length;e++){const t=s[e],i=t*h;c.push(new y.c({level:e,scale:t,resolution:i}))}else{let e=(0,g.Eb)(r)?512/n*591657527.5917094:256/n*591657527.591555;const s=Math.ceil(o/t);c.push(new y.c({level:0,scale:e,resolution:e*h}));for(let i=1;i<s;i++){const s=e/2**t,n=s*h;c.push(new y.c({level:i,scale:s,resolution:n})),e=s}}return new i({dpi:96,lods:c,origin:u,size:[n,n],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const s=(0,g.Nq)(e);return e.isWrappable&&!!s&&Math.abs(s.origin[0]-t.x)<=s.dx}return!1}readOrigin(e,t){return p.c.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,s=0;const i=[],n=this._levelToLOD={};e&&(t=-1/0,s=1/0,e.forEach((e=>{i.push(e.scale),t=e.scale>t?e.scale:t,s=e.scale<s?e.scale:s,n[e.level]=e}))),this._set("scales",i),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const s=Math.floor(e),i=s+1;return t[s]/(t[s]/t[i])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let i=0;for(;i<s;i++){const s=t[i],n=t[i+1];if(s<=e)return i;if(n===e)return i+1;if(s>e&&n<e)return i+Math.log(s/e)/Math.log(s/n)}return i}snapScale(e,t=.95){const s=this.scaleToZoom(e);return s%Math.floor(s)>=t?this.zoomToScale(Math.ceil(s)):this.zoomToScale(Math.floor(s))}tileAt(e,t,s,i){const n=this.lodAt(e);if(!n)return null;let r,o;if("number"==typeof t)r=t,o=s;else if((0,g.yK)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,i=s;else{const e=(0,m.yU)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,i=s}const a=n.resolution*this.size[0],l=n.resolution*this.size[1];return i||(i=new v.g(null,0,0,0,(0,f.Su)())),i.level=e,i.row=Math.floor((this.origin.y-o)/l+.001),i.col=Math.floor((r-this.origin.x)/a+.001),this.updateTileInfo(i),i}updateTileInfo(e,t=i.ExtrapolateOptions.NONE){let s=this.lodAt(e.level);if(!s&&t===i.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(s=t)}if(!s)return;const n=e.level-s.level,r=s.resolution*this.size[0]/2**n,o=s.resolution*this.size[1]/2**n;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,f.Su)()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const s=this.lodAt(t.level);if(null==s)return null;const{resolution:i}=s,n=i*this.size[0],r=i*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+n,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return i.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const s=[],n=this.lods.length;for(let e=0;e<n;e++){const i=this.lods[e],n=i.resolution*t;s.push(new y.c({level:i.level,scale:i.scale,resolution:n}))}return new i({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;s<e.length;s++){const i=e[s];this._upsampleLevels[i.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/i.resolution:0},t=i}}};var x,b;(0,n._)([(0,l.qq)({type:Number,json:{write:!0}})],E.prototype,"compressionQuality",void 0),(0,n._)([(0,l.qq)({type:Number,json:{write:!0}})],E.prototype,"dpi",void 0),(0,n._)([(0,l.qq)({type:String,json:{read:w.read,write:w.write,origins:{"web-scene":{read:!1,write:!1}}}})],E.prototype,"format",void 0),(0,n._)([(0,l.qq)({readOnly:!0})],E.prototype,"isWrappable",null),(0,n._)([(0,l.qq)({type:p.c,json:{write:!0}})],E.prototype,"origin",void 0),(0,n._)([(0,h.E)("origin")],E.prototype,"readOrigin",null),(0,n._)([(0,l.qq)({type:[y.c],value:null,json:{write:!0}})],E.prototype,"lods",null),(0,n._)([(0,l.qq)({readOnly:!0})],E.prototype,"scales",void 0),(0,n._)([(0,l.qq)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],E.prototype,"size",void 0),(0,n._)([(0,h.E)("size",["rows","cols"])],E.prototype,"readSize",null),(0,n._)([(0,d.G)("size",{cols:{type:u.Ab},rows:{type:u.Ab}})],E.prototype,"writeSize",null),(0,n._)([(0,l.qq)({type:_.c,json:{write:!0}})],E.prototype,"spatialReference",void 0),E=i=(0,n._)([(0,c.c)("geoscene.layers.support.TileInfo")],E),x=E||(E={}),(b=x.ExtrapolateOptions||(x.ExtrapolateOptions={}))[b.NONE=0]="NONE",b[b.POWER_OF_TWO=1]="POWER_OF_TWO";const S=E},11712:(e,t,s)=>{s.d(t,{g:()=>i});class i{constructor(e,t,s,i,n=void 0){this.id=e,this.level=t,this.row=s,this.col=i,this.extent=n}}},48212:(e,t,s)=>{s.d(t,{Ab:()=>v,Ej:()=>d,K0:()=>c,M9:()=>p,Wq:()=>f,YB:()=>h,_2:()=>m,oR:()=>g,q_:()=>_,wn:()=>y});var i=s(28176),n=s(91952);const r={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer"},o=Object.values(r),a=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),l=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function h(e){return!!a.test(e)}function c(e){if(null==e)return null;const t=(0,i.as)(e),s=t?.path.match(a)||t?.path.match(l);if(!s)return null;const[,n,o,u,h]=s,c=o.indexOf("/");return{title:p(-1!==c?o.slice(c+1):o),serverType:r[u.toLowerCase()],sublayer:null!=h&&""!==h?parseInt(h,10):null,url:{path:n}}}function d(e){const t=(0,i.as)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function p(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function _(e,t){const s=[];if(e){const t=c(e);null!=t&&t.title&&s.push(t.title)}if(t){const e=p(t);s.push(e)}if(2===s.length){if(s[0].toLowerCase().includes(s[1].toLowerCase()))return s[0];if(s[1].toLowerCase().includes(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function f(e){if(!e)return!1;const t=(e=e.toLowerCase()).includes(".arcgis.com/"),s=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return t&&s}function g(e,t){return e?(0,i.ai)((0,i.kN)(e,t)):e}function m(e){let{url:t}=e;if(!t)return{url:t};t=(0,i.kN)(t,e.logger);const s=(0,i.as)(t),n=c(s.path);let r;if(null!=n)null!=n.sublayer&&null==e.layer.layerId&&(r=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=d(s.path);null!=e&&(t=e.serviceUrl,r=e.sublayerId)}return{url:(0,i.ai)(t),layerId:r}}function y(e,t,s,r,o){(0,n.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,i.kn)(r.url,s,e.layerId.toString()))}function v(e){if(!e)return!1;const t=e.toLowerCase(),s=t.includes("/services/"),i=t.includes("/mapserver/wmsserver"),n=t.includes("/imageserver/wmsserver"),r=t.includes("/wmsserver");return s&&(i||n||r)}},89812:(e,t,s)=>{s.d(t,{h4:()=>S,i2:()=>b}),s(9456);var i,n=s(41948),r=s(62088),o=s(1580),a=(s(66360),s(9968)),l=s(12552),u=s(40504);s(72052);let h=i=class extends u.am{constructor(e){super(e),this.name=null,this.code=null}clone(){return new i({name:this.name,code:this.code})}};(0,n._)([(0,o.qq)({type:String,json:{write:!0}})],h.prototype,"name",void 0),(0,n._)([(0,o.qq)({type:[String,Number],json:{write:!0}})],h.prototype,"code",void 0),h=i=(0,n._)([(0,l.c)("geoscene.layers.support.CodedValue")],h);const c=new(s(14628).O)({inherited:"inherited",codedValue:"coded-value",range:"range"});let d=class extends u.am{constructor(e){super(e),this.name=null,this.type=null}};(0,n._)([(0,o.qq)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,n._)([(0,a.G)(c)],d.prototype,"type",void 0),d=(0,n._)([(0,l.c)("geoscene.layers.support.Domain")],d);const p=d;var _;let f=_=class extends p{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const s=String(e);this.codedValues.some((e=>(String(e.code)===s&&(t=e.name),!!t)))}return t}clone(){return new _({codedValues:(0,r.ct)(this.codedValues),name:this.name})}};(0,n._)([(0,o.qq)({type:[h],json:{write:!0}})],f.prototype,"codedValues",void 0),(0,n._)([(0,a.G)({codedValue:"coded-value"})],f.prototype,"type",void 0),f=_=(0,n._)([(0,l.c)("geoscene.layers.support.CodedValueDomain")],f);const g=f;var m;s(20744);let y=m=class extends p{constructor(e){super(e),this.type="inherited"}clone(){return new m}};(0,n._)([(0,a.G)({inherited:"inherited"})],y.prototype,"type",void 0),y=m=(0,n._)([(0,l.c)("geoscene.layers.support.InheritedDomain")],y);const v=y;var w;let E=w=class extends p{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new w({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,n._)([(0,o.qq)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,s){t[s]=[this.minValue||0,e]}}}})],E.prototype,"maxValue",void 0),(0,n._)([(0,o.qq)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,s){t[s]=[e,this.maxValue||0]}}}})],E.prototype,"minValue",void 0),(0,n._)([(0,a.G)({range:"range"})],E.prototype,"type",void 0),E=w=(0,n._)([(0,l.c)("geoscene.layers.support.RangeDomain")],E);const x=E,b={key:"type",base:p,typeMap:{range:E,"coded-value":g,inherited:v}};function S(e){if(!e?.type)return null;switch(e.type){case"range":return x.fromJSON(e);case"codedValue":return g.fromJSON(e);case"inherited":return v.fromJSON(e)}return null}},12780:(e,t,s)=>{s.d(t,{s:()=>r});var i=s(24296),n=s(67932);const r={unknown:1,inches:(0,i.ck)(1,"meters","inches"),feet:(0,i.ck)(1,"meters","feet"),"us-feet":(0,i.ck)(1,"meters","us-feet"),yards:(0,i.ck)(1,"meters","yards"),miles:(0,i.ck)(1,"meters","miles"),"nautical-miles":(0,i.ck)(1,"meters","nautical-miles"),millimeters:(0,i.ck)(1,"meters","millimeters"),centimeters:(0,i.ck)(1,"meters","centimeters"),decimeters:(0,i.ck)(1,"meters","decimeters"),meters:(0,i.ck)(1,"meters","meters"),kilometers:(0,i.ck)(1,"meters","kilometers"),"decimal-degrees":1/(0,i.M9)(1,"meters",n.ug.radius)}},21012:(e,t,s)=>{s.d(t,{M:()=>n});var i=s(37924);function n(e,t,s){if(!s?.features||!s.hasZ)return;const n=(0,i.O)(s.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of s.features)n(e.geometry)}},27136:(e,t,s)=>{s.d(t,{c:()=>w});var i,n=s(41948),r=s(14628),o=s(40504),a=s(70680),l=s(1580),u=(s(9456),s(66360),s(72052),s(33600)),h=s(12552),c=s(18996),d=s(564);let p=i=class extends o.am{constructor(e){super(e)}async collectRequiredFields(e,t){return(0,d.AN)(e,t,this.expression)}clone(){return new i({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,n._)([(0,l.qq)({type:String,json:{write:!0}})],p.prototype,"expression",void 0),(0,n._)([(0,l.qq)({type:String,json:{write:!0}})],p.prototype,"title",void 0),p=i=(0,n._)([(0,h.c)("geoscene.layers.support.FeatureExpressionInfo")],p);const _=p;var f,g=s(35764);const m=(0,r.w)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),y=new r.O({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let v=f=class extends o.am{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return null!=e?e:t.featureExpression&&0===t.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,s,i){t[s]=e.write({},i),"0"===e.expression&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new f({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,a.O4)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,n._)([(0,l.qq)({type:_,json:{write:!0}})],v.prototype,"featureExpressionInfo",void 0),(0,n._)([(0,u.E)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],v.prototype,"readFeatureExpressionInfo",null),(0,n._)([(0,c.G)("featureExpressionInfo",{featureExpressionInfo:{type:_},"featureExpression.value":{type:[0]}})],v.prototype,"writeFeatureExpressionInfo",null),(0,n._)([(0,l.qq)({type:m.apiValues,nonNullable:!0,json:{type:m.jsonValues,read:m.read,write:{writer:m.write,isRequired:!0}}})],v.prototype,"mode",null),(0,n._)([(0,l.qq)({type:Number,json:{write:!0}})],v.prototype,"offset",void 0),(0,n._)([(0,l.qq)({type:g.eA,json:{type:String,read:y.read,write:y.write}})],v.prototype,"unit",null),v=f=(0,n._)([(0,h.c)("geoscene.layers.support.ElevationInfo")],v);const w=v},35764:(e,t,s)=>{s.d(t,{QV:()=>n,eA:()=>r});var i=s(12780);function n(e){return 1/(i.s[e]||1)}const r=function(){const e=Object.keys(i.s);return e.sort(),e}()},25476:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Ee});var i=s(41948),n=(s(60708),s(77860)),r=s(10860),o=s(57896),a=s(1580),l=(s(9456),s(66360)),u=(s(72052),s(12552)),h=s(60936),c=s(56156),d=s(9107),p=s(47302),_=s(87576),f=s(95776),g=s(27136),m=s(11004),y=s(86916),v=s(24296),w=s(35764);function E(e=!1,t){if(e){const{elevationInfo:e,alignPointsInFeatures:s}=t;return new b(e,s)}return new x}class x{async alignCandidates(e,t,s){return e}notifyElevationSourceChange(){}}class b{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new m.o(1024),this._cacheVersion=0}async alignCandidates(e,t,s){const i=this._elevationInfo;return null==i||"absolute-height"!==i.mode||i.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,s):(this._alignAbsoluteElevationCandidates(e,t,i),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,t,s){const{offset:i,unit:n}=s;if(null==i)return;const r=(0,v.gl)(t),o=i*((0,w.QV)(n??"meters")/r);for(const t of e)switch(t.type){case"edge":t.start.z+=o,t.end.z+=o;continue;case"vertex":t.target.z+=o;continue}}async _alignComputedElevationCandidates(e,t,s){const i=new Map;for(const t of e)(0,y.wJ)(i,t.objectId,T).push(t);const[n,o,a]=this._prepareQuery(i,t),l=await this._alignPointsInFeatures(n,s);if((0,r.wp)(s),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,s);this._applyCacheAndResponse(n,l,o);const{drapedObjectIds:u,failedObjectIds:h}=l,c=[];for(const t of e){const{objectId:e}=t;u.has(e)&&"edge"===t.type&&(t.draped=!0),h.has(e)||c.push(t)}return c}_prepareQuery(e,t){const s=[],i=[];for(const[t,n]of e){const e=[];for(const s of n)this._addToQueriesOrCachedResult(t,s.target,e,i),"edge"===s.type&&(this._addToQueriesOrCachedResult(t,s.start,e,i),this._addToQueriesOrCachedResult(t,s.end,e,i));0!==e.length&&s.push({objectId:t,points:e})}return[{spatialReference:t.toJSON(),pointsInFeatures:s},i,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const n=I(e,t),r=this._alignmentsCache.get(n);null==r?s.push(t):i.push(new S(t,r))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},n){for(const e of n)e.apply();let r=0;const o=this._alignmentsCache;for(const{objectId:n,points:a}of e.pointsInFeatures){if(i.has(n)){r+=a.length;continue}const e=!s.has(n);for(const s of a){const i=I(n,s),a=t[r++];s.z=a,e&&o.put(i,a,1)}}}}class S{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}}function I(e,{x:t,y:s,z:i,spatialReference:n}){return`${e}-${t}-${s}-${i??0}}-wkid:${n?.wkid}`}function T(){return[]}class F{filter(e,t){return t}notifyElevationSourceChange(){}}class C{filter(e,t){const{point:s,distance:i}=e,{z:n}=s;if(null==n)return t;if(0===t.length)return t;const r=function(e){return"number"==typeof e?{x:e,y:e,z:e}:e}(i),o=this._updateCandidatesTo3D(t,s,r).filter(q);return o.sort(R),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":z(i,t,s);continue;case"vertex":A(i,t,s);continue}return e}}function q(e){return e.distance<=1}function O(e=!1){return e?new C:new F}function z(e,t,{x:s,y:i,z:n}){const{start:r,end:o,target:a}=e;e.draped||function(e,t,s,i){const n=i.x-s.x,r=i.y-s.y,o=i.z-s.z,a=n*n+r*r+o*o,l=(t.x-s.x)*n+(t.y-s.y)*r+o*(t.z-s.z),u=Math.min(1,Math.max(0,l/a)),h=s.x+n*u,c=s.y+r*u,d=s.z+o*u;e.x=h,e.y=c,e.z=d}(a,t,r,o);const l=(t.x-a.x)/s,u=(t.y-a.y)/i,h=(t.z-a.z)/n;e.distance=Math.sqrt(l*l+u*u+h*h)}function A(e,t,{x:s,y:i,z:n}){const{target:r}=e,o=(t.x-r.x)/s,a=(t.y-r.y)/i,l=(t.z-r.z)/n,u=Math.sqrt(o*o+a*a+l*l);e.distance=u}function R(e,t){return e.distance-t.distance}var M=s(62088),B=s(88264);function N(e=!1,t){return e?new j(t):new P}class P{async fetch(){return[]}notifySymbologyChange(){}}class j{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new m.o(1024),this._cacheVersion=0}async fetch(e,t){if(0===e.length)return[];const s=[],i=[],n=this._candidatesCache;for(const t of e){const e=H(t),r=n.get(e);if(r)for(const e of r)i.push((0,M.ct)(e));else s.push(t),n.put(e,[],1)}if(0===s.length)return i;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(s,t);if((0,r.wp)(t),o!==this._cacheVersion)return this.fetch(e,t);const u=[],{length:h}=a;for(let e=0;e<h;++e){const t=a[e],i=H(s[l[e]]),r=n.get(i);r.push(t),n.put(i,r,r.length),u.push((0,M.ct)(t))}return i.concat(u)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function H(e){switch(e.type){case"vertex":{const{objectId:t,target:s}=e,i=`${t}-vertex-${s.x}-${s.y}-${s.z??0}`;return(0,B.sV)(i).toString()}case"edge":{const{objectId:t,start:s,end:i}=e,n=`${t}-edge-${s.x}-${s.y}-${s.z??0}-to-${i.x}-${i.y}-${i.z??0}`;return(0,B.sV)(n).toString()}default:return""}}var D=s(43780),k=s(92400);let U=class extends D.c{constructor(){super(...arguments),this.updating=!1,this._pending=[]}push(e,t){this._pending.push({promise:e,callback:t}),1===this._pending.length&&this._process()}_process(){if(!this._pending.length)return void(this.updating=!1);this.updating=!0;const e=this._pending[0];e.promise.then((t=>e.callback(t))).catch((()=>{})).then((()=>{this._pending.shift(),this._process()}))}};(0,i._)([(0,a.qq)()],U.prototype,"updating",void 0),U=(0,i._)([(0,u.c)("geoscene.core.AsyncSequence")],U);var L,V=s(40196),Y=s(38912),X=s(33456),G=s(95247),W=s(83372),J=s(97088),$=s(48212),Q=s(87280),Z=s(32848);class K{constructor(e,t){this.data=e,this.resolution=t,this.state={type:L.CREATED},this.alive=!0}process(e){switch(this.state.type){case L.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case L.FETCH_COUNT:break;case L.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case L.FETCH_FEATURES:break;case L.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case L.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case L.CREATED:case L.FETCH_COUNT:return 0;case L.FETCHED_COUNT:return this.state.featureCount;case L.FETCH_FEATURES:return this.state.previous.featureCount;case L.FETCHED_FEATURES:return this.state.features.length;case L.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case L.CREATED:return"created";case L.FETCH_COUNT:return"fetch-count";case L.FETCHED_COUNT:return"fetched-count";case L.FETCH_FEATURES:return"fetch-features";case L.FETCHED_FEATURES:return"fetched-features";case L.DONE:return"done"}}_gotoFetchCount(e,t){return{type:L.FETCH_COUNT,previous:e,task:(0,V.kn)((async e=>{const s=await(0,V.SO)(t.fetchCount(this,e));this.state.type===L.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,s.ok?s.value:1/0))}))}}_gotoFetchedCount(e,t){return{type:L.FETCHED_COUNT,featureCount:t,previous:e}}_gotoFetchFeatures(e,t){return{type:L.FETCH_FEATURES,previous:e,task:(0,V.kn)((async s=>{const i=await(0,V.SO)(t.fetchFeatures(this,e.featureCount,s));this.state.type===L.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,i.ok?i.value:[]))}))}}_gotoFetchedFeatures(e,t){return{type:L.FETCHED_FEATURES,previous:e,features:t}}_goToDone(e,t){return t.finish(this,e.features),{type:L.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:L.CREATED},e.type){case L.CREATED:case L.FETCHED_COUNT:case L.FETCHED_FEATURES:case L.DONE:break;case L.FETCH_COUNT:case L.FETCH_FEATURES:e.task.abort()}}intersects(e){return null==e||!this.data.extent||((0,W.ER)(e,ee),(0,W.K0)(this.data.extent,ee))}}!function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"}(L||(L={}));const ee=(0,W.Su)();let te=class extends D.c{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),s=(0,X.SQ)(e,this._mandatoryOutFields);(0,X.yK)(s,t)||(this._set("outFields",s),(0,X.Cs)(s,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new h.A,this._pendingEdits=new U,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add((()=>this._configuration),(()=>this.refresh())),this._updatingHandles.add((()=>this.tilesOfInterest),((e,t)=>{(0,k.yK)(e,t,(({id:e},{id:t})=>e===t))||this._process()}),o.du),this.addHandles((0,o._I)((()=>!this.suspended),(()=>this._process())))}destroy(){this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this._pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,e]of this._pendingTiles)e.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this._updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this._pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!(0,$.Wq)(this.url))return;const e=(0,V.kn)((async e=>{try{const t=await(0,Z.A7)(this.url,new f.c({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=G.c.fromJSON(t.data?.extent)}catch(e){(0,r.CE)(e),l.c.getLogger(this).warn("Failed to fetch data extent",e)}}));this._updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.addHandles((0,Y.uU)((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this._pendingTiles)e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:s}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=s,e.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],i=this.store.process(s,((e,t)=>this._verifyTileComplexity(e,t)),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,s)=>this._fetchFeatures(e,t,s),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<ne}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const s=this.tileSize*t;return e*(re/(s*s))<oe}_ensureFetchAllCounts(e){let t=!0;for(const[,s]of this._pendingTiles)s.state.type<L.FETCHED_COUNT&&this._updatingHandles.addPromise(s.process(e)),s.state.type<=L.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const s=new K(e,t);return this._pendingTiles.set(e.id,s),s}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:ie,signal:t})}async _fetchFeatures(e,t,s){let i=0;const n=[];let r=0,o=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,i,o),{features:u,exceededTransferLimit:h}=await this._queryFeatures(a,s);l&&(i+=a.num),r+=u.length;for(const e of u)n.push(e);if(o=t-r,!l||!h||o<=0)return n}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,s=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let i=null;if(this.store.featureStore.forEach((n=>{e===n.attributes[t]&&(i=n.objectId??n.attributes[s])})),null==i)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Z.aA)(this.url,e,new Q.g({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,J.w3)(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Z.EL)(this.url,e,s,{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,J.ui)(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),s=null!=e?.data?this.store.getAttributesForTile(e?.data?.id):null,i=(0,X.SQ)((0,X.o1)(this.outFields,s??new Set),this._mandatoryOutFields);return t.outFields=Array.from(i),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new f.c({returnZ:this.hasZ,returnM:!1,geometry:null!=this.tileInfo&&null!=e?(0,W.WU)(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return null!=s&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:n,tileMaxRecordCount:r,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?f.c.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||n)&&r?r:o||se);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/u)),e.num=Math.min(s,e.maxRecordCountFactor*u)):e.num=Math.min(s,u),!0}};(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"url",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"objectIdField",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"globalIdField",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"capabilities",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"sourceSpatialReference",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"spatialReference",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"store",void 0),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"_minimumVerticesPerFeature",null),(0,i._)([(0,a.qq)()],te.prototype,"_mandatoryOutFields",null),(0,i._)([(0,a.qq)()],te.prototype,"outFields",null),(0,i._)([(0,a.qq)()],te.prototype,"suspended",void 0),(0,i._)([(0,a.qq)()],te.prototype,"filter",null),(0,i._)([(0,a.qq)()],te.prototype,"customParameters",null),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"_configuration",null),(0,i._)([(0,a.qq)()],te.prototype,"tileInfo",null),(0,i._)([(0,a.qq)()],te.prototype,"tileSize",null),(0,i._)([(0,a.qq)()],te.prototype,"tilesOfInterest",void 0),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"updating",null),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"availability",void 0),(0,i._)([(0,a.qq)()],te.prototype,"hasZ",null),te=(0,i._)([(0,u.c)("geoscene.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],te);const se=2e3,ie=6e5,ne=1e6,re=25,oe=1;var ae=s(33184),le=s(80424),ue=s(6904),he=s(11712);class ce{constructor(){this._store=new Map,this._byteSize=0}set(e,t){this.delete(e),this._store.set(e,t),this._byteSize+=t.byteSize}delete(e){const t=this._store.get(e);return!!this._store.delete(e)&&(null!=t&&(this._byteSize-=t.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,t){for(const[s,i]of this._store){if(this._byteSize<=e)break;this.delete(s),t(i)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const t=this._store.get(e);t&&(this._store.delete(e),this._store.set(e,t))}}let de=class extends D.c{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*le.M.MEGABYTES,this._tileBounds=new ue.c,this._tiles=new ce,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=(0,W.Su)()}add(e,t){for(const e of t)this._referenceFeature(e.objectId);const s=this.featureStore.upsertMany(t),i=s.map((e=>new Set(Object.keys(e.attributes)))).reduce(((e,t)=>(0,X.WR)(e,t)),new Set(Object.keys(s[0]?.attributes??[])));this._addTileStorage(e,new Set(s.map((e=>e.objectId))),function(e){return e.reduce(((e,t)=>e+function(e){return 32+function(e){if(null==e)return 0;const t=(0,ae.qC)(e.lengths,4);return 32+(0,ae.qC)(e.coords,8)+t}(e.geometry)+(0,ae.aC)(e.attributes)}(t)),0)}(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,(e=>this._removeTileStorage(e)))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s,i){const n=e.id;this._tiles.set(n,new pe(e,t,s,i)),this._tileBounds.set(n,e.extent),this._tileFeatureCounts.set(n,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const s of e.objectIds)this._unreferenceFeature(s)===ye.REMOVED&&t.push(s);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,t]of this._tiles){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){const i=(await t(e,s)).features,{hasZ:n,hasM:r}=this.featureStore;for(const e of i){const t=(0,J.C_)(this._tmpBoundingRect,e.geometry,n,r);null!=t&&this._tileBounds.forEachInBounds(t,(t=>{const s=this._tiles.get(t);this.featureStore.add(e);const i=e.objectId;s.objectIds.has(i)||(s.objectIds.add(i),this._referenceFeature(i),this._tileFeatureCounts.set(s.data.id,s.objectIds.size))}))}}process(e,t=(()=>!0),s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!(0,W.K0)((0,W.ER)(this.extent,this._tmpBoundingRect),e.extent))return new fe(e);const i=this.getAttributesForTile(e.id);if((0,X.Cs)(s,i))return new fe(e);const n=this._createTileTree(e,this.tileInfo);return this._simplify(n,t,null,0,1),this._collectMissingTiles(e,n,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map((({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0})))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const n=this._tileFeatureCounts.get(e.id);if(null!=n)return n;const r=await(0,Z.WE)(t,s,i);return this._tileFeatureCounts.set(e.id,r.data.count),r.data.count}_createTileTree(e,t){const s=new _e(e.level,e.row,e.col);return t.updateTileInfo(s,_.c.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,(i=>{const n=this._tiles.get(i)?.data;n&&this._tilesAreRelated(e,n)&&this._populateChildren(s,n,t,this._tileFeatureCounts.get(n.id)||0)})),s}_tilesAreRelated(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,n=s?t:e,r=1<<n.level-i.level;return Math.floor(n.row/r)===i.row&&Math.floor(n.col/r)===i.col}_populateChildren(e,t,s,i){const n=t.level-e.level-1;if(n<0)return void(e.isLeaf=!0);const r=t.row>>n,o=t.col>>n,a=e.row<<1,l=o-(e.col<<1)+(r-a<<1),u=e.children[l];if(null!=u)this._populateChildren(u,t,s,i);else{const n=new _e(e.level+1,r,o);s.updateTileInfo(n,_.c.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=n,this._populateChildren(n,t,s,i)}}_simplify(e,t,s,i,n){const r=n*n;if(e.isLeaf)return t(this.getFeatureCount(e),n)?0:(this._remove(e),null!=s&&(s.children[i]=null),r);const o=n/2,a=o*o;let l=0;for(let s=0;s<e.children.length;s++){const i=e.children[s];l+=null!=i?this._simplify(i,t,e,s,o):a}return 0===l?this._mergeChildren(e):1-l/r<me&&(this._purge(e),null!=s&&(s.children[i]=null),l=r),l}_mergeChildren(e){const t=new Set;let s,i=0;this._forEachLeaf(e,(e=>{const n=this._tiles.get(e.id);if(n){s=s?(0,X.WR)(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const e of n.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}})),this._addTileStorage(e,t,i,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const n=new ge(s,e,this.extent);return this._collectMissingTilesRecurse(t,n,1,i),n.info}_collectMissingTilesRecurse(e,t,s,i){const n=this.getAttributesForTile(e.id),r=n&&!(0,X.Cs)(i,n);if(r&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(r||t.addMissing(e.level,e.row,e.col,s));const o=s/2;for(let s=0;s<e.children.length;s++){const n=e.children[s];null==n?t.addMissing(e.level+1,(e.row<<1)+((2&s)>>1),(e.col<<1)+(1&s),o):this._collectMissingTilesRecurse(n,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?ye.ADDED:ye.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),ye.REMOVED):(t>0&&this._refCounts.set(e,t),ye.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map((e=>`${e.data.id}:[${Array.from(e.objectIds)}]`)),featureReferences:Array.from(this._refCounts.keys()).map((e=>`${e}:${this._refCounts.get(e)}`))}}};(0,i._)([(0,a.qq)({constructOnly:!0})],de.prototype,"featureStore",void 0),(0,i._)([(0,a.qq)()],de.prototype,"tileInfo",void 0),(0,i._)([(0,a.qq)()],de.prototype,"extent",void 0),(0,i._)([(0,a.qq)()],de.prototype,"maximumByteSize",void 0),de=(0,i._)([(0,u.c)("geoscene.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],de);class pe{constructor(e,t,s,i){this.data=e,this.objectIds=t,this.byteSize=s,this.attributeKeys=i}}class _e{constructor(e,t,s){this.level=e,this.row=t,this.col=s,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class fe{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,W.wd)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class ge{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new fe(t),null!=s&&(this._extent=(0,W.ER)(s))}addMissing(e,t,s,i){const n=new he.g(null,e,t,s);this._tileInfo.updateTileInfo(n,_.c.ExtrapolateOptions.POWER_OF_TWO),null==n.extent||null!=this._extent&&!(0,W.K0)(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:i}),this.info.coveredArea-=(0,W.wd)(n.extent))}}const me=.18751;var ye;!function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"}(ye||(ye={}));var ve=s(6704);let we=class extends n.c.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=(0,r.qG)(),this._elevationAligner=E(),this._elevationFilter=O(),this._symbologyCandidatesFetcher=N(),this._updatingHandles=new h.A,this._editsUpdatingHandles=new h.A,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(e,t)=>{const s={query:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return(0,r.wp)(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return(0,r.wp)(t),i}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:n}=e.serviceInfo,{hasZ:r}=e,a=c.c.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new d.c({...e.serviceInfo,hasZ:r,hasM:!1}),this._queryEngine=new p.U({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:n,hasZ:r,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new te({store:new de({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:c.c.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const l="3d"===e.configuration.viewType;return this._elevationAligner=E(l,{elevationInfo:null!=e.elevationInfo?g.c.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=O(l),this.addHandles([(0,o.aE)((()=>this._featureFetcher.availability),(e=>this.emit("notify-availability",{availability:e})),o.du),(0,o.aE)((()=>this.updating),(()=>this._notifyUpdating()))]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),xe}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),this._featureFetcher.suspended=e,xe}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),this._featureFetcher.outFields=new Set(e??[]),xe}async fetchCandidates(e,t){await this._whenSetup.promise,(0,r.wp)(t);const s=function(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:s,spatialRel:i,where:n,timeExtent:r,objectIds:o}=e.filter,a={geometry:e.filter.geometry?(0,ve.h4)(e.filter.geometry):void 0,distance:t,units:s,spatialRel:i,timeExtent:r,objectIds:o,where:n??"1=1"};return{...e,query:a}}(e),i=t?.signal,n=await this._queryEngine.executeQueryForSnapping(s,i);(0,r.wp)(i);const o=await this._elevationAligner.alignCandidates(n.candidates,c.c.fromJSON(e.point.spatialReference)??c.c.WGS84,i);(0,r.wp)(i);const a=await this._symbologyCandidatesFetcher.fetch(o,i);(0,r.wp)(i);const l=0===a.length?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(s,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?_.c.fromJSON(e.tileInfo):null,xe}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),this._featureFetcher.refresh(),xe}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),await(0,o.Eq)((()=>!this.updatingExcludingEdits),t),(0,r.wp)(t),xe}async getDebugInfo(e,t){return(0,r.wp)(t),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(e,t){this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t);const s=(0,r.qG)();return this._pendingApplyEdits.set(e.id,s),this._featureFetcher.applyEdits(s.promise),this._editsUpdatingHandles.addPromise(s.promise),xe}async endApplyEdits(e,t){const s=this._pendingApplyEdits.get(e.id);return s&&s.resolve(e.edits),(0,r.wp)(t),xe}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),xe}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),xe}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=N(e,this._getSymbologyCandidates),xe}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?f.c.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};(0,i._)([(0,a.qq)({readOnly:!0})],we.prototype,"updating",null),(0,i._)([(0,a.qq)({readOnly:!0})],we.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.qq)()],we.prototype,"_isInitializing",void 0),we=(0,i._)([(0,u.c)("geoscene.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],we);const Ee=we,xe={result:{}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5752,8528],{25228:(e,t,s)=>{s.d(t,{c:()=>f});var i,n=s(41948),r=s(40504),o=s(94360),a=s(1580),l=(s(9456),s(66360),s(72052),s(33600)),u=s(12552),h=s(18996),c=s(28484);let d=i=class extends r.am{static get allTime(){return p}static get empty(){return _}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,s=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,n=e.end?.getTime()??e.end;return t===i&&s===n}expandTo(e,t=c.OX){if(this.isEmpty||this.isAllTime)return this.clone();let s=this.start;s&&(s=(0,o.aU)(s,e,t));let n=this.end;if(n){const s=(0,o.aU)(n,e,t);n=n.getTime()===s.getTime()?s:(0,o.g1)(s,1,e,t)}return new i({start:s,end:n})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,s=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let o,a;if(n>=t&&n<=s?o=n:t>=n&&t<=r&&(o=t),s>=n&&s<=r?a=s:r>=t&&r<=s&&(a=r),null!=o&&null!=a&&!isNaN(o)&&!isNaN(a)){const e=new i;return e.start=o===-1/0?null:new Date(o),e.end=a===1/0?null:new Date(a),e}return i.empty}offset(e,t,s=c.OX){if(this.isEmpty||this.isAllTime)return this.clone();const n=new i,{start:r,end:a}=this;return null!=r&&(n.start=(0,o.g1)(r,e,t,s)),null!=a&&(n.end=(0,o.g1)(a,e,t,s)),n}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return p.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,s=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:s})}};(0,n._)([(0,a.qq)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,n._)([(0,l.E)("end")],d.prototype,"readEnd",null),(0,n._)([(0,h.G)("end")],d.prototype,"writeEnd",null),(0,n._)([(0,a.qq)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,n._)([(0,a.qq)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,n._)([(0,a.qq)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,n._)([(0,l.E)("start")],d.prototype,"readStart",null),(0,n._)([(0,h.G)("start")],d.prototype,"writeStart",null),d=i=(0,n._)([(0,u.c)("geoscene.TimeExtent")],d);const p=new d,_=new d({start:void 0,end:void 0}),f=d},8528:(e,t,s)=>{s.d(t,{c:()=>i,g:()=>n});var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},80424:(e,t,s)=>{var i;s.d(t,{M:()=>i}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(i||(i={}))},3856:(e,t,s)=>{s.d(t,{m:()=>c,q:()=>h});var i=s(41948),n=s(43780),r=(s(9456),s(62088)),o=(s(66360),s(70680)),a=s(71448),l=s(20916),u=s(12552);const h=e=>{let t=class extends e{clone(){const e=(0,l.m6)(this);(0,o.EN)(e,"unable to clone instance of non-accessor class");const t=e.metadata,s=e.store,i={},n=new Map;for(const e in t){const o=t[e],l=s?.originOf(e),u=o.clonable;if(o.readOnly||!1===u||l!==a.sT.USER&&l!==a.sT.DEFAULTS&&l!==a.sT.WEB_MAP&&l!==a.sT.WEB_SCENE)continue;const h=this[e];let c=null;c="function"==typeof u?u(h):"reference"===u?h:(0,r.gx)(h),null!=h&&null==c||(l===a.sT.DEFAULTS?n.set(e,c):i[e]=c)}const u=new(0,Object.getPrototypeOf(this).constructor)(i);if(n.size){const e=(0,l.m6)(u)?.store;if(e)for(const[t,s]of n)e.set(t,s,a.sT.DEFAULTS)}return u}};return t=(0,i._)([(0,u.c)("geoscene.core.Clonable")],t),t};let c=class extends(h(n.c)){};c=(0,i._)([(0,u.c)("geoscene.core.Clonable")],c)},11004:(e,t,s)=>{s.d(t,{o:()=>n});var i=s(74452);class n{constructor(e,t){this._storage=new i.kB,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,s=1){this._storage.put(this,e,t,s,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},74452:(e,t,s)=>{s.d(t,{ML:()=>o,kB:()=>a});var i,n,r=s(24680);(n=i||(i={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class o{constructor(e,t,s){this.name=e,this._storage=t,this.id=l+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),s&&(this._storage.registerRemoveFunc(this.id,s),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,s,i=0){this._storage.put(this,e,t,s,i)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,s){this._storage.updateSize(this,e,t,s)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new r.c,this._users=new r.c}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const s=this._db.get(e.id+t);return s?.size??0}put(e,t,s,n,r){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==s&&this._notifyRemove(t,o.entry,o.size,i.ALL)),n>this._maxSize)return void this._notifyRemove(t,s,n,i.ALL);if(void 0===s)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,s,0,i.ALL);const a=1+Math.max(r,-4)- -3;this._db.set(t,new u(s,n,a)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t,s,n){t=e.id+t;const r=this._db.get(t);if(r&&r.entry===s){for(this._size-=r.size,e.size-=r.size;n>this._maxSize;){const e=this._notifyRemove(t,s,n,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);n=e}r.size=n,this._size+=n,e.size+=n,this._checkSize()}}pop(e,t){t=e.id+t;const s=this._db.get(t);if(s)return this._size-=s.size,e.size-=s.size,this._db.delete(t),++this._hit,s.entry;++this._miss}get(e,t){t=e.id+t;const s=this._db.get(t);if(void 0!==s)return this._db.delete(t),s.lives=s.lifetime,this._db.set(t,s),++this._hit,s.entry;++this._miss}peek(e,t){const s=this._db.get(e.id+t);return s?++this._hit:++this._miss,s?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},s=new Array;this._db.forEach(((e,i)=>{const n=e.lifetime;s[n]=(s[n]||0)+e.size,this._users.forAll((s=>{const{id:n,name:r}=s;if(i.startsWith(n)){const s=t[r]||0;t[r]=s+e.size}}))}));const i={};this._users.forAll((e=>{const s=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[s]||0;t[s]=n,i[s]=Math.round(100*e.hitRate)+"%"}else i[s]="0%"}));const n=Object.keys(t);n.sort(((e,s)=>t[s]-t[e])),n.forEach((s=>e[s]=Math.round(t[s]/2**20)+"MB / "+i[s]));for(let t=s.length-1;t>=0;--t){const i=s[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,s)=>{s.startsWith(t)&&(this._size-=e.size,this._db.delete(s),this._notifyRemove(s,e.entry,e.size,i.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,i.ALL))),this._users.forAll((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,s,i){let n;return this._removeFuncs.some((r=>{if(e.startsWith(r[0])){const e=r[1](t,i,s);return"number"==typeof e&&(n=e),!0}return!1})),n}_checkSize(){this._users.forAll((e=>this._checkSizeLimits(e))),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const s=e?.id;let i=!0;for(;i;){i=!1;for(const[n,r]of this._db)if(0===r.lifetime&&(!s||n.startsWith(s))){if(this._purgeItem(n,r,e),t.size<=.9*t.maxSize)return;i||=this._db.has(n)}}for(const[i,n]of this._db)if((!s||i.startsWith(s))&&(this._purgeItem(i,n,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,s=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,s&&(s.size-=t.size);const n=this._notifyRemove(e,t.entry,t.size,i.SOME);null!=n&&n>0&&(this._size+=n,s&&(s.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let l=0;class u{constructor(e,t,s){this.entry=e,this.size=t,this.lifetime=s,this.lives=s}}},3024:(e,t,s)=>{s.d(t,{U:()=>o});var i=s(92400),n=s(24680),r=s(85304);class o{constructor(e=9,t){this._compareMinX=h,this._compareMinY=c,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),v.prune(),w.prune(),E.prune(),x.prune()}all(e){this._all(this._data,e)}search(e,t){let s=this._data;const i=this._toBBox;if(m(e,s))for(v.clear();s;){for(let n=0,r=s.children.length;n<r;n++){const r=s.children[n],o=s.leaf?i(r):r;m(e,o)&&(s.leaf?t(r):g(e,o)?this._all(r,t):v.push(r))}s=v.pop()}}collides(e){let t=this._data;const s=this._toBBox;if(!m(e,t))return!1;for(v.clear();t;){for(let i=0,n=t.children.length;i<n;i++){const n=t.children[i],r=t.leaf?s(n):n;if(m(e,r)){if(t.leaf||g(e,r))return!0;v.push(n)}}t=v.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new I([]),this}remove(e){if(!e)return this;let t,s=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(E.clear(),x.clear();s||E.length>0;){if(s||(s=E.pop(),n=E.data[E.length-1],r=x.pop()??0,o=!0),s.leaf&&(t=(0,i.IP)(s.children,e,s.children.length,s.indexHint),-1!==t))return s.children.splice(t,1),E.push(s),this._condense(E),this;o||s.leaf||!g(s,a)?n?(r++,s=n.children[r],o=!1):s=null:(E.push(s),x.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let s=e;for(w.clear();s;){if(!0===s.leaf)for(const e of s.children)t(e);else w.pushArray(s.children);s=w.pop()??null}}_build(e,t,s,i){const n=s-t+1;let r=this._maxEntries;if(n<=r){const i=new I(e.slice(t,s+1));return a(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(i-1)));const o=new T([]);o.height=i;const l=Math.ceil(n/r),u=l*Math.ceil(Math.sqrt(r));y(e,t,s,u,this._compareMinX);for(let n=t;n<=s;n+=u){const t=Math.min(n+u-1,s);y(e,n,t,l,this._compareMinY);for(let s=n;s<=t;s+=l){const n=Math.min(s+l-1,t);o.children.push(this._build(e,s,n,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,s,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=d(o),l=_(e,o)-a;l<n?(n=l,i=a<i?a:i,s=o):l===n&&a<i&&(i=a,s=o)}t=s||t.children[0]}return t}_insert(e,t,s){const i=this._toBBox,n=s?e:i(e);E.clear();const r=this._chooseSubtree(n,this._data,t,E);for(r.children.push(e),u(r,n);t>=0&&E.data[t].children.length>this._maxEntries;)this._split(E,t),t--;this._adjustParentBBoxes(n,E,t)}_split(e,t){const s=e.data[t],i=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,i);const r=this._chooseSplitIndex(s,n,i);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=s.children.splice(r,s.children.length-r),l=s.leaf?new I(o):new T(o);l.height=s.height,a(s,this._toBBox),a(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(s,l)}_splitRoot(e,t){this._data=new T([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,s){let i,n,r;i=n=1/0;for(let o=t;o<=s-t;o++){const t=l(e,0,o,this._toBBox),a=l(e,o,s,this._toBBox),u=f(t,a),h=d(t)+d(a);u<i?(i=u,r=o,n=h<n?h:n):u===i&&h<n&&(n=h,r=o)}return r}_chooseSplitAxis(e,t,s){const i=e.leaf?this._compareMinX:h,n=e.leaf?this._compareMinY:c;this._allDistMargin(e,t,s,i)<this._allDistMargin(e,t,s,n)&&e.children.sort(i)}_allDistMargin(e,t,s,i){e.children.sort(i);const n=this._toBBox,r=l(e,0,t,n),o=l(e,s-t,s,n);let a=p(r)+p(o);for(let i=t;i<s-t;i++){const t=e.children[i];u(r,e.leaf?n(t):t),a+=p(r)}for(let i=s-t-1;i>=t;i--){const t=e.children[i];u(o,e.leaf?n(t):t),a+=p(o)}return a}_adjustParentBBoxes(e,t,s){for(let i=s;i>=0;i--)u(t.data[i],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const s=e.data[t];if(0===s.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,i.IP)(r,s,r.length,n.indexHint),1)}else this.clear();else a(s,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){l(e,0,e.children.length,t,e)}function l(e,t,s,i,n){n||(n=new I([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<s;o++)r=e.children[o],u(n,e.leaf?i(r):r);return n}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function c(e,t){return e.minY-t.minY}function d(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(e){return e.maxX-e.minX+(e.maxY-e.minY)}function _(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function f(e,t){const s=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-s)*Math.max(0,r-i)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function m(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function y(e,t,s,i,n){const o=[t,s];for(;o.length;){const t=o.pop(),s=o.pop();if(t-s<=i)continue;const a=s+Math.ceil((t-s)/i/2)*i;(0,r.q)(e,a,s,t,n),o.push(s,a,a,t)}}const v=new n.c,w=new n.c,E=new n.c,x=new n.c({deallocator:void 0});class b{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class S extends b{constructor(){super(...arguments),this.height=1,this.indexHint=new i.is}}class I extends S{constructor(e){super(),this.children=e,this.leaf=!0}}class T extends S{constructor(e){super(),this.children=e,this.leaf=!1}}},57896:(e,t,s)=>{s.d(t,{Eq:()=>d,KG:()=>m,_8:()=>g,_I:()=>u,aE:()=>l,du:()=>f,on:()=>c}),s(40196),s(2952);var i=s(60976),n=s(38912),r=s(70680),o=s(10860),a=s(37176);function l(e,t,s={}){return h(e,t,s,p)}function u(e,t,s={}){return h(e,t,s,_)}function h(e,t,s={},i){let n=null;const o=s.once?(e,s)=>{i(e)&&((0,r.oR)(n),t(e,s))}:(e,s)=>{i(e)&&t(e,s)};if(n=(0,a.M9)(e,o,s.sync,s.equals),s.initial){const t=e();o(t,t)}return n}function c(e,t,s,o={}){let a=null,u=null,h=null;function c(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function d(e){o.once&&o.once&&(0,r.oR)(h),s(e)}const p=l(e,((e,s)=>{c(),(0,i.sh)(e)&&(a=e,u=(0,i.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return h=(0,n.uU)((()=>{p.remove(),c()})),h}function d(e,t){return function(e,t,s){if((0,o.wv)(s))return Promise.reject((0,o.Uh)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function l(){a=(0,r.oR)(a)}return new Promise(((i,r)=>{a=(0,n.Ip)([(0,o.wD)(s,(()=>{l(),r((0,o.Uh)())})),h(e,(e=>{l(),i(e)}),{sync:!1,once:!0},t??p)])}))}(e,_,t)}function p(e){return!0}function _(e){return!!e}s(41168);const f={sync:!0},g={initial:!0},m={sync:!0,initial:!0}},60936:(e,t,s)=>{s.d(t,{A:()=>h});var i=s(41948),n=s(43780),r=s(38912),o=s(57896),a=s(66168),l=s(1580),u=s(12552);let h=class extends n.c{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o.aE)}addWhen(e,t,s={}){return this._installWatch(e,t,s,o._I)}addOnCollectionChange(e,t,{initial:s=!1,final:i=!1}={}){const n=++this._handleId;return this.addHandles([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.du),(0,o.on)(e,"change",t,{onListenerAdd:s?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:i?e=>t({added:[],removed:e.toArray()}):void 0})],n),(0,r.uU)((()=>this.removeHandles(n)))}addPromise(e){if(null==e)return e;const t=++this._handleId;this.addHandles((0,r.uU)((()=>{this._pendingPromises.delete(e)&&(0!==this._pendingPromises.size||this.hasHandles(c)||this._set("updating",!1))})),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},i){const n=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,n);const o=i(e,t,s);return this.addHandles(o,n),(0,r.uU)((()=>this.removeHandles(n)))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),i=(0,o.aE)(e,s,{sync:!0,equals:()=>!1});return this.addHandles(i,t),i}_createSyncUpdatingCallback(){return()=>{this.removeHandles(c),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles((0,a.Ow)((()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(c))})),c)}}};(0,i._)([(0,l.qq)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,i._)([(0,u.c)("geoscene.core.support.UpdatingHandles")],h);const c=-42},6904:(e,t,s)=>{s.d(t,{c:()=>a});var i=s(9456),n=s(3024),r=s(83372);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.U(9,(0,i.c)("geoscene-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,i)=>{e[t++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.FZ)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},9107:(e,t,s)=>{s.d(t,{c:()=>_});var i=s(92400),n=s(20744),r=s(77860),o=s(66360),a=s(77048),l=s(83372),u=s(97088),h=s(6904),c=s(83624),d=s(51752);const p=(0,a.Su)();class _{constructor(e){this.geometryInfo=e,this._boundsStore=new h.c,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.c,this.featureAdapter=d.u}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,s,i,n]=this.fullBounds;return{xmin:t,ymin:s,xmax:i,ymax:n,spatialReference:(0,c.C6)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map((e=>this._upsert(e)));return this._emitChanged(),t.filter(i.G6)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.Qv)(p,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.c.getLogger("geoscene.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.C_)(null!=i?i:(0,l.Su)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.c.getLogger("geoscene.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:i,attributes:r}=e;for(const e in r)s.attributes[e]=r[e];return i&&(s.geometry=i,this._boundsStore.set(t,(0,u.C_)((0,l.Su)(),i,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},600:(e,t,s)=>{s.d(t,{c:()=>g});var i,n=s(41948),r=s(14628),o=s(40504),a=s(1580),l=s(53368),u=(s(72052),s(9456),s(9968)),h=s(33600),c=s(12552),d=s(89812),p=s(36408);const _=new r.O({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let f=i=class extends o.am{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let s=null;try{s=t?JSON.parse(t):null}catch(e){}return s?.value??null}readValueType(e,{description:t}){let s=null;try{s=t?JSON.parse(t):null}catch(e){}return s?_.fromJSON(s.fieldValueType):null}clone(){return new i({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,n._)([(0,a.qq)({type:String,json:{write:!0}})],f.prototype,"alias",void 0),(0,n._)([(0,a.qq)({type:[String,Number],json:{write:{allowNull:!0}}})],f.prototype,"defaultValue",void 0),(0,n._)([(0,a.qq)()],f.prototype,"description",void 0),(0,n._)([(0,h.E)("description")],f.prototype,"readDescription",null),(0,n._)([(0,a.qq)({types:d.i2,json:{read:{reader:d.h4},write:!0}})],f.prototype,"domain",void 0),(0,n._)([(0,a.qq)({type:Boolean,json:{write:!0}})],f.prototype,"editable",void 0),(0,n._)([(0,a.qq)({type:l.Ab,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],f.prototype,"length",void 0),(0,n._)([(0,a.qq)({type:String,json:{write:!0}})],f.prototype,"name",void 0),(0,n._)([(0,a.qq)({type:Boolean,json:{write:!0}})],f.prototype,"nullable",void 0),(0,n._)([(0,u.G)(p.M)],f.prototype,"type",void 0),(0,n._)([(0,a.qq)()],f.prototype,"valueType",void 0),(0,n._)([(0,h.E)("valueType",["description"])],f.prototype,"readValueType",null),(0,n._)([(0,a.qq)({type:Boolean,json:{read:!1}})],f.prototype,"visible",void 0),f=i=(0,n._)([(0,c.c)("geoscene.layers.support.Field")],f);const g=f},22108:(e,t,s)=>{s.d(t,{c:()=>h});var i,n=s(41948),r=s(40504),o=s(1580),a=s(53368),l=(s(72052),s(9456),s(12552));let u=i=class extends r.am{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new i({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n._)([(0,o.qq)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"cols",void 0),(0,n._)([(0,o.qq)({type:a.Ab,json:{write:!0}})],u.prototype,"level",void 0),(0,n._)([(0,o.qq)({type:String,json:{write:!0}})],u.prototype,"levelValue",void 0),(0,n._)([(0,o.qq)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"origin",void 0),(0,n._)([(0,o.qq)({type:Number,json:{write:!0}})],u.prototype,"resolution",void 0),(0,n._)([(0,o.qq)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"rows",void 0),(0,n._)([(0,o.qq)({type:Number,json:{write:!0}})],u.prototype,"scale",void 0),u=i=(0,n._)([(0,l.c)("geoscene.layers.support.LOD")],u);const h=u},87576:(e,t,s)=>{s.d(t,{c:()=>S});var i,n=s(41948),r=s(14628),o=s(40504),a=s(24296),l=s(1580),u=s(53368),h=(s(72052),s(9456),s(33600)),c=s(12552),d=s(18996),p=s(67776),_=s(56156),f=s(83372),g=s(60544),m=s(29120),y=s(22108),v=s(11712);const w=new r.O({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let E=i=class extends o.am{static create(e={}){const{resolutionFactor:t=1,scales:s,size:n=256,spatialReference:r=_.c.WebMercator,numLODs:o=24}=e;if(!(0,g.U3)(r)){const e=[];if(s)for(let t=0;t<s.length;t++){const i=s[t];e.push(new y.c({level:t,scale:i,resolution:i}))}else{let t=5e-4;for(let s=o-1;s>=0;s--)e.unshift(new y.c({level:s,scale:t,resolution:t})),t*=2}return new i({dpi:96,lods:e,origin:new p.c(0,0,r),size:[n,n],spatialReference:r})}const l=(0,g.Nq)(r),u=e.origin?new p.c({x:e.origin.x,y:e.origin.y,spatialReference:r}):new p.c(l?{x:l.origin[0],y:l.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),h=1/(39.37*(0,a.k8)(r)*96),c=[];if(s)for(let e=0;e<s.length;e++){const t=s[e],i=t*h;c.push(new y.c({level:e,scale:t,resolution:i}))}else{let e=(0,g.Eb)(r)?512/n*591657527.5917094:256/n*591657527.591555;const s=Math.ceil(o/t);c.push(new y.c({level:0,scale:e,resolution:e*h}));for(let i=1;i<s;i++){const s=e/2**t,n=s*h;c.push(new y.c({level:i,scale:s,resolution:n})),e=s}}return new i({dpi:96,lods:c,origin:u,size:[n,n],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const s=(0,g.Nq)(e);return e.isWrappable&&!!s&&Math.abs(s.origin[0]-t.x)<=s.dx}return!1}readOrigin(e,t){return p.c.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,s=0;const i=[],n=this._levelToLOD={};e&&(t=-1/0,s=1/0,e.forEach((e=>{i.push(e.scale),t=e.scale>t?e.scale:t,s=e.scale<s?e.scale:s,n[e.level]=e}))),this._set("scales",i),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const s=Math.floor(e),i=s+1;return t[s]/(t[s]/t[i])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let i=0;for(;i<s;i++){const s=t[i],n=t[i+1];if(s<=e)return i;if(n===e)return i+1;if(s>e&&n<e)return i+Math.log(s/e)/Math.log(s/n)}return i}snapScale(e,t=.95){const s=this.scaleToZoom(e);return s%Math.floor(s)>=t?this.zoomToScale(Math.ceil(s)):this.zoomToScale(Math.floor(s))}tileAt(e,t,s,i){const n=this.lodAt(e);if(!n)return null;let r,o;if("number"==typeof t)r=t,o=s;else if((0,g.yK)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,i=s;else{const e=(0,m.yU)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,i=s}const a=n.resolution*this.size[0],l=n.resolution*this.size[1];return i||(i=new v.g(null,0,0,0,(0,f.Su)())),i.level=e,i.row=Math.floor((this.origin.y-o)/l+.001),i.col=Math.floor((r-this.origin.x)/a+.001),this.updateTileInfo(i),i}updateTileInfo(e,t=i.ExtrapolateOptions.NONE){let s=this.lodAt(e.level);if(!s&&t===i.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(s=t)}if(!s)return;const n=e.level-s.level,r=s.resolution*this.size[0]/2**n,o=s.resolution*this.size[1]/2**n;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,f.Su)()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const s=this.lodAt(t.level);if(null==s)return null;const{resolution:i}=s,n=i*this.size[0],r=i*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+n,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return i.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const s=[],n=this.lods.length;for(let e=0;e<n;e++){const i=this.lods[e],n=i.resolution*t;s.push(new y.c({level:i.level,scale:i.scale,resolution:n}))}return new i({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;s<e.length;s++){const i=e[s];this._upsampleLevels[i.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/i.resolution:0},t=i}}};var x,b;(0,n._)([(0,l.qq)({type:Number,json:{write:!0}})],E.prototype,"compressionQuality",void 0),(0,n._)([(0,l.qq)({type:Number,json:{write:!0}})],E.prototype,"dpi",void 0),(0,n._)([(0,l.qq)({type:String,json:{read:w.read,write:w.write,origins:{"web-scene":{read:!1,write:!1}}}})],E.prototype,"format",void 0),(0,n._)([(0,l.qq)({readOnly:!0})],E.prototype,"isWrappable",null),(0,n._)([(0,l.qq)({type:p.c,json:{write:!0}})],E.prototype,"origin",void 0),(0,n._)([(0,h.E)("origin")],E.prototype,"readOrigin",null),(0,n._)([(0,l.qq)({type:[y.c],value:null,json:{write:!0}})],E.prototype,"lods",null),(0,n._)([(0,l.qq)({readOnly:!0})],E.prototype,"scales",void 0),(0,n._)([(0,l.qq)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],E.prototype,"size",void 0),(0,n._)([(0,h.E)("size",["rows","cols"])],E.prototype,"readSize",null),(0,n._)([(0,d.G)("size",{cols:{type:u.Ab},rows:{type:u.Ab}})],E.prototype,"writeSize",null),(0,n._)([(0,l.qq)({type:_.c,json:{write:!0}})],E.prototype,"spatialReference",void 0),E=i=(0,n._)([(0,c.c)("geoscene.layers.support.TileInfo")],E),x=E||(E={}),(b=x.ExtrapolateOptions||(x.ExtrapolateOptions={}))[b.NONE=0]="NONE",b[b.POWER_OF_TWO=1]="POWER_OF_TWO";const S=E},11712:(e,t,s)=>{s.d(t,{g:()=>i});class i{constructor(e,t,s,i,n=void 0){this.id=e,this.level=t,this.row=s,this.col=i,this.extent=n}}},48212:(e,t,s)=>{s.d(t,{Ab:()=>v,Ej:()=>d,K0:()=>c,M9:()=>p,Wq:()=>f,YB:()=>h,_2:()=>m,oR:()=>g,q_:()=>_,wn:()=>y});var i=s(28176),n=s(91952);const r={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer"},o=Object.values(r),a=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),l=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function h(e){return!!a.test(e)}function c(e){if(null==e)return null;const t=(0,i.as)(e),s=t?.path.match(a)||t?.path.match(l);if(!s)return null;const[,n,o,u,h]=s,c=o.indexOf("/");return{title:p(-1!==c?o.slice(c+1):o),serverType:r[u.toLowerCase()],sublayer:null!=h&&""!==h?parseInt(h,10):null,url:{path:n}}}function d(e){const t=(0,i.as)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function p(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function _(e,t){const s=[];if(e){const t=c(e);null!=t&&t.title&&s.push(t.title)}if(t){const e=p(t);s.push(e)}if(2===s.length){if(s[0].toLowerCase().includes(s[1].toLowerCase()))return s[0];if(s[1].toLowerCase().includes(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function f(e){if(!e)return!1;const t=(e=e.toLowerCase()).includes(".Grcgis.cn/"),s=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return t&&s}function g(e,t){return e?(0,i.ai)((0,i.kN)(e,t)):e}function m(e){let{url:t}=e;if(!t)return{url:t};t=(0,i.kN)(t,e.logger);const s=(0,i.as)(t),n=c(s.path);let r;if(null!=n)null!=n.sublayer&&null==e.layer.layerId&&(r=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=d(s.path);null!=e&&(t=e.serviceUrl,r=e.sublayerId)}return{url:(0,i.ai)(t),layerId:r}}function y(e,t,s,r,o){(0,n.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,i.kn)(r.url,s,e.layerId.toString()))}function v(e){if(!e)return!1;const t=e.toLowerCase(),s=t.includes("/services/"),i=t.includes("/mapserver/wmsserver"),n=t.includes("/imageserver/wmsserver"),r=t.includes("/wmsserver");return s&&(i||n||r)}},89812:(e,t,s)=>{s.d(t,{h4:()=>S,i2:()=>b}),s(9456);var i,n=s(41948),r=s(62088),o=s(1580),a=(s(66360),s(9968)),l=s(12552),u=s(40504);s(72052);let h=i=class extends u.am{constructor(e){super(e),this.name=null,this.code=null}clone(){return new i({name:this.name,code:this.code})}};(0,n._)([(0,o.qq)({type:String,json:{write:!0}})],h.prototype,"name",void 0),(0,n._)([(0,o.qq)({type:[String,Number],json:{write:!0}})],h.prototype,"code",void 0),h=i=(0,n._)([(0,l.c)("geoscene.layers.support.CodedValue")],h);const c=new(s(14628).O)({inherited:"inherited",codedValue:"coded-value",range:"range"});let d=class extends u.am{constructor(e){super(e),this.name=null,this.type=null}};(0,n._)([(0,o.qq)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,n._)([(0,a.G)(c)],d.prototype,"type",void 0),d=(0,n._)([(0,l.c)("geoscene.layers.support.Domain")],d);const p=d;var _;let f=_=class extends p{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const s=String(e);this.codedValues.some((e=>(String(e.code)===s&&(t=e.name),!!t)))}return t}clone(){return new _({codedValues:(0,r.ct)(this.codedValues),name:this.name})}};(0,n._)([(0,o.qq)({type:[h],json:{write:!0}})],f.prototype,"codedValues",void 0),(0,n._)([(0,a.G)({codedValue:"coded-value"})],f.prototype,"type",void 0),f=_=(0,n._)([(0,l.c)("geoscene.layers.support.CodedValueDomain")],f);const g=f;var m;s(20744);let y=m=class extends p{constructor(e){super(e),this.type="inherited"}clone(){return new m}};(0,n._)([(0,a.G)({inherited:"inherited"})],y.prototype,"type",void 0),y=m=(0,n._)([(0,l.c)("geoscene.layers.support.InheritedDomain")],y);const v=y;var w;let E=w=class extends p{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new w({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,n._)([(0,o.qq)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,s){t[s]=[this.minValue||0,e]}}}})],E.prototype,"maxValue",void 0),(0,n._)([(0,o.qq)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,s){t[s]=[e,this.maxValue||0]}}}})],E.prototype,"minValue",void 0),(0,n._)([(0,a.G)({range:"range"})],E.prototype,"type",void 0),E=w=(0,n._)([(0,l.c)("geoscene.layers.support.RangeDomain")],E);const x=E,b={key:"type",base:p,typeMap:{range:E,"coded-value":g,inherited:v}};function S(e){if(!e?.type)return null;switch(e.type){case"range":return x.fromJSON(e);case"codedValue":return g.fromJSON(e);case"inherited":return v.fromJSON(e)}return null}},12780:(e,t,s)=>{s.d(t,{s:()=>r});var i=s(24296),n=s(67932);const r={unknown:1,inches:(0,i.ck)(1,"meters","inches"),feet:(0,i.ck)(1,"meters","feet"),"us-feet":(0,i.ck)(1,"meters","us-feet"),yards:(0,i.ck)(1,"meters","yards"),miles:(0,i.ck)(1,"meters","miles"),"nautical-miles":(0,i.ck)(1,"meters","nautical-miles"),millimeters:(0,i.ck)(1,"meters","millimeters"),centimeters:(0,i.ck)(1,"meters","centimeters"),decimeters:(0,i.ck)(1,"meters","decimeters"),meters:(0,i.ck)(1,"meters","meters"),kilometers:(0,i.ck)(1,"meters","kilometers"),"decimal-degrees":1/(0,i.M9)(1,"meters",n.ug.radius)}},21012:(e,t,s)=>{s.d(t,{M:()=>n});var i=s(37924);function n(e,t,s){if(!s?.features||!s.hasZ)return;const n=(0,i.O)(s.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of s.features)n(e.geometry)}},27136:(e,t,s)=>{s.d(t,{c:()=>w});var i,n=s(41948),r=s(14628),o=s(40504),a=s(70680),l=s(1580),u=(s(9456),s(66360),s(72052),s(33600)),h=s(12552),c=s(18996),d=s(564);let p=i=class extends o.am{constructor(e){super(e)}async collectRequiredFields(e,t){return(0,d.AN)(e,t,this.expression)}clone(){return new i({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,n._)([(0,l.qq)({type:String,json:{write:!0}})],p.prototype,"expression",void 0),(0,n._)([(0,l.qq)({type:String,json:{write:!0}})],p.prototype,"title",void 0),p=i=(0,n._)([(0,h.c)("geoscene.layers.support.FeatureExpressionInfo")],p);const _=p;var f,g=s(35764);const m=(0,r.w)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),y=new r.O({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let v=f=class extends o.am{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return null!=e?e:t.featureExpression&&0===t.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,s,i){t[s]=e.write({},i),"0"===e.expression&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new f({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,a.O4)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,n._)([(0,l.qq)({type:_,json:{write:!0}})],v.prototype,"featureExpressionInfo",void 0),(0,n._)([(0,u.E)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],v.prototype,"readFeatureExpressionInfo",null),(0,n._)([(0,c.G)("featureExpressionInfo",{featureExpressionInfo:{type:_},"featureExpression.value":{type:[0]}})],v.prototype,"writeFeatureExpressionInfo",null),(0,n._)([(0,l.qq)({type:m.apiValues,nonNullable:!0,json:{type:m.jsonValues,read:m.read,write:{writer:m.write,isRequired:!0}}})],v.prototype,"mode",null),(0,n._)([(0,l.qq)({type:Number,json:{write:!0}})],v.prototype,"offset",void 0),(0,n._)([(0,l.qq)({type:g.eA,json:{type:String,read:y.read,write:y.write}})],v.prototype,"unit",null),v=f=(0,n._)([(0,h.c)("geoscene.layers.support.ElevationInfo")],v);const w=v},35764:(e,t,s)=>{s.d(t,{QV:()=>n,eA:()=>r});var i=s(12780);function n(e){return 1/(i.s[e]||1)}const r=function(){const e=Object.keys(i.s);return e.sort(),e}()},25476:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Ee});var i=s(41948),n=(s(60708),s(77860)),r=s(10860),o=s(57896),a=s(1580),l=(s(9456),s(66360)),u=(s(72052),s(12552)),h=s(60936),c=s(56156),d=s(9107),p=s(47302),_=s(87576),f=s(95776),g=s(27136),m=s(11004),y=s(86916),v=s(24296),w=s(35764);function E(e=!1,t){if(e){const{elevationInfo:e,alignPointsInFeatures:s}=t;return new b(e,s)}return new x}class x{async alignCandidates(e,t,s){return e}notifyElevationSourceChange(){}}class b{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new m.o(1024),this._cacheVersion=0}async alignCandidates(e,t,s){const i=this._elevationInfo;return null==i||"absolute-height"!==i.mode||i.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,s):(this._alignAbsoluteElevationCandidates(e,t,i),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,t,s){const{offset:i,unit:n}=s;if(null==i)return;const r=(0,v.gl)(t),o=i*((0,w.QV)(n??"meters")/r);for(const t of e)switch(t.type){case"edge":t.start.z+=o,t.end.z+=o;continue;case"vertex":t.target.z+=o;continue}}async _alignComputedElevationCandidates(e,t,s){const i=new Map;for(const t of e)(0,y.wJ)(i,t.objectId,T).push(t);const[n,o,a]=this._prepareQuery(i,t),l=await this._alignPointsInFeatures(n,s);if((0,r.wp)(s),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,s);this._applyCacheAndResponse(n,l,o);const{drapedObjectIds:u,failedObjectIds:h}=l,c=[];for(const t of e){const{objectId:e}=t;u.has(e)&&"edge"===t.type&&(t.draped=!0),h.has(e)||c.push(t)}return c}_prepareQuery(e,t){const s=[],i=[];for(const[t,n]of e){const e=[];for(const s of n)this._addToQueriesOrCachedResult(t,s.target,e,i),"edge"===s.type&&(this._addToQueriesOrCachedResult(t,s.start,e,i),this._addToQueriesOrCachedResult(t,s.end,e,i));0!==e.length&&s.push({objectId:t,points:e})}return[{spatialReference:t.toJSON(),pointsInFeatures:s},i,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const n=I(e,t),r=this._alignmentsCache.get(n);null==r?s.push(t):i.push(new S(t,r))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},n){for(const e of n)e.apply();let r=0;const o=this._alignmentsCache;for(const{objectId:n,points:a}of e.pointsInFeatures){if(i.has(n)){r+=a.length;continue}const e=!s.has(n);for(const s of a){const i=I(n,s),a=t[r++];s.z=a,e&&o.put(i,a,1)}}}}class S{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}}function I(e,{x:t,y:s,z:i,spatialReference:n}){return`${e}-${t}-${s}-${i??0}}-wkid:${n?.wkid}`}function T(){return[]}class F{filter(e,t){return t}notifyElevationSourceChange(){}}class C{filter(e,t){const{point:s,distance:i}=e,{z:n}=s;if(null==n)return t;if(0===t.length)return t;const r=function(e){return"number"==typeof e?{x:e,y:e,z:e}:e}(i),o=this._updateCandidatesTo3D(t,s,r).filter(q);return o.sort(R),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":z(i,t,s);continue;case"vertex":A(i,t,s);continue}return e}}function q(e){return e.distance<=1}function O(e=!1){return e?new C:new F}function z(e,t,{x:s,y:i,z:n}){const{start:r,end:o,target:a}=e;e.draped||function(e,t,s,i){const n=i.x-s.x,r=i.y-s.y,o=i.z-s.z,a=n*n+r*r+o*o,l=(t.x-s.x)*n+(t.y-s.y)*r+o*(t.z-s.z),u=Math.min(1,Math.max(0,l/a)),h=s.x+n*u,c=s.y+r*u,d=s.z+o*u;e.x=h,e.y=c,e.z=d}(a,t,r,o);const l=(t.x-a.x)/s,u=(t.y-a.y)/i,h=(t.z-a.z)/n;e.distance=Math.sqrt(l*l+u*u+h*h)}function A(e,t,{x:s,y:i,z:n}){const{target:r}=e,o=(t.x-r.x)/s,a=(t.y-r.y)/i,l=(t.z-r.z)/n,u=Math.sqrt(o*o+a*a+l*l);e.distance=u}function R(e,t){return e.distance-t.distance}var M=s(62088),B=s(88264);function N(e=!1,t){return e?new j(t):new P}class P{async fetch(){return[]}notifySymbologyChange(){}}class j{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new m.o(1024),this._cacheVersion=0}async fetch(e,t){if(0===e.length)return[];const s=[],i=[],n=this._candidatesCache;for(const t of e){const e=H(t),r=n.get(e);if(r)for(const e of r)i.push((0,M.ct)(e));else s.push(t),n.put(e,[],1)}if(0===s.length)return i;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(s,t);if((0,r.wp)(t),o!==this._cacheVersion)return this.fetch(e,t);const u=[],{length:h}=a;for(let e=0;e<h;++e){const t=a[e],i=H(s[l[e]]),r=n.get(i);r.push(t),n.put(i,r,r.length),u.push((0,M.ct)(t))}return i.concat(u)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function H(e){switch(e.type){case"vertex":{const{objectId:t,target:s}=e,i=`${t}-vertex-${s.x}-${s.y}-${s.z??0}`;return(0,B.sV)(i).toString()}case"edge":{const{objectId:t,start:s,end:i}=e,n=`${t}-edge-${s.x}-${s.y}-${s.z??0}-to-${i.x}-${i.y}-${i.z??0}`;return(0,B.sV)(n).toString()}default:return""}}var D=s(43780),k=s(92400);let U=class extends D.c{constructor(){super(...arguments),this.updating=!1,this._pending=[]}push(e,t){this._pending.push({promise:e,callback:t}),1===this._pending.length&&this._process()}_process(){if(!this._pending.length)return void(this.updating=!1);this.updating=!0;const e=this._pending[0];e.promise.then((t=>e.callback(t))).catch((()=>{})).then((()=>{this._pending.shift(),this._process()}))}};(0,i._)([(0,a.qq)()],U.prototype,"updating",void 0),U=(0,i._)([(0,u.c)("geoscene.core.AsyncSequence")],U);var L,V=s(40196),Y=s(38912),X=s(33456),G=s(95247),W=s(83372),J=s(97088),$=s(48212),Q=s(87280),Z=s(32848);class K{constructor(e,t){this.data=e,this.resolution=t,this.state={type:L.CREATED},this.alive=!0}process(e){switch(this.state.type){case L.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case L.FETCH_COUNT:break;case L.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case L.FETCH_FEATURES:break;case L.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case L.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case L.CREATED:case L.FETCH_COUNT:return 0;case L.FETCHED_COUNT:return this.state.featureCount;case L.FETCH_FEATURES:return this.state.previous.featureCount;case L.FETCHED_FEATURES:return this.state.features.length;case L.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case L.CREATED:return"created";case L.FETCH_COUNT:return"fetch-count";case L.FETCHED_COUNT:return"fetched-count";case L.FETCH_FEATURES:return"fetch-features";case L.FETCHED_FEATURES:return"fetched-features";case L.DONE:return"done"}}_gotoFetchCount(e,t){return{type:L.FETCH_COUNT,previous:e,task:(0,V.kn)((async e=>{const s=await(0,V.SO)(t.fetchCount(this,e));this.state.type===L.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,s.ok?s.value:1/0))}))}}_gotoFetchedCount(e,t){return{type:L.FETCHED_COUNT,featureCount:t,previous:e}}_gotoFetchFeatures(e,t){return{type:L.FETCH_FEATURES,previous:e,task:(0,V.kn)((async s=>{const i=await(0,V.SO)(t.fetchFeatures(this,e.featureCount,s));this.state.type===L.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,i.ok?i.value:[]))}))}}_gotoFetchedFeatures(e,t){return{type:L.FETCHED_FEATURES,previous:e,features:t}}_goToDone(e,t){return t.finish(this,e.features),{type:L.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:L.CREATED},e.type){case L.CREATED:case L.FETCHED_COUNT:case L.FETCHED_FEATURES:case L.DONE:break;case L.FETCH_COUNT:case L.FETCH_FEATURES:e.task.abort()}}intersects(e){return null==e||!this.data.extent||((0,W.ER)(e,ee),(0,W.K0)(this.data.extent,ee))}}!function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"}(L||(L={}));const ee=(0,W.Su)();let te=class extends D.c{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),s=(0,X.SQ)(e,this._mandatoryOutFields);(0,X.yK)(s,t)||(this._set("outFields",s),(0,X.Cs)(s,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new h.A,this._pendingEdits=new U,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add((()=>this._configuration),(()=>this.refresh())),this._updatingHandles.add((()=>this.tilesOfInterest),((e,t)=>{(0,k.yK)(e,t,(({id:e},{id:t})=>e===t))||this._process()}),o.du),this.addHandles((0,o._I)((()=>!this.suspended),(()=>this._process())))}destroy(){this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this._pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,e]of this._pendingTiles)e.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this._updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this._pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!(0,$.Wq)(this.url))return;const e=(0,V.kn)((async e=>{try{const t=await(0,Z.A7)(this.url,new f.c({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=G.c.fromJSON(t.data?.extent)}catch(e){(0,r.CE)(e),l.c.getLogger(this).warn("Failed to fetch data extent",e)}}));this._updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.addHandles((0,Y.uU)((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this._pendingTiles)e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:s}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=s,e.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],i=this.store.process(s,((e,t)=>this._verifyTileComplexity(e,t)),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,s)=>this._fetchFeatures(e,t,s),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<ne}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const s=this.tileSize*t;return e*(re/(s*s))<oe}_ensureFetchAllCounts(e){let t=!0;for(const[,s]of this._pendingTiles)s.state.type<L.FETCHED_COUNT&&this._updatingHandles.addPromise(s.process(e)),s.state.type<=L.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const s=new K(e,t);return this._pendingTiles.set(e.id,s),s}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:ie,signal:t})}async _fetchFeatures(e,t,s){let i=0;const n=[];let r=0,o=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,i,o),{features:u,exceededTransferLimit:h}=await this._queryFeatures(a,s);l&&(i+=a.num),r+=u.length;for(const e of u)n.push(e);if(o=t-r,!l||!h||o<=0)return n}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,s=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let i=null;if(this.store.featureStore.forEach((n=>{e===n.attributes[t]&&(i=n.objectId??n.attributes[s])})),null==i)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Z.aA)(this.url,e,new Q.g({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,J.w3)(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Z.EL)(this.url,e,s,{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,J.ui)(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),s=null!=e?.data?this.store.getAttributesForTile(e?.data?.id):null,i=(0,X.SQ)((0,X.o1)(this.outFields,s??new Set),this._mandatoryOutFields);return t.outFields=Array.from(i),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new f.c({returnZ:this.hasZ,returnM:!1,geometry:null!=this.tileInfo&&null!=e?(0,W.WU)(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return null!=s&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:n,tileMaxRecordCount:r,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?f.c.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||n)&&r?r:o||se);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/u)),e.num=Math.min(s,e.maxRecordCountFactor*u)):e.num=Math.min(s,u),!0}};(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"url",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"objectIdField",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"globalIdField",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"capabilities",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"sourceSpatialReference",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"spatialReference",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"store",void 0),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"_minimumVerticesPerFeature",null),(0,i._)([(0,a.qq)()],te.prototype,"_mandatoryOutFields",null),(0,i._)([(0,a.qq)()],te.prototype,"outFields",null),(0,i._)([(0,a.qq)()],te.prototype,"suspended",void 0),(0,i._)([(0,a.qq)()],te.prototype,"filter",null),(0,i._)([(0,a.qq)()],te.prototype,"customParameters",null),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"_configuration",null),(0,i._)([(0,a.qq)()],te.prototype,"tileInfo",null),(0,i._)([(0,a.qq)()],te.prototype,"tileSize",null),(0,i._)([(0,a.qq)()],te.prototype,"tilesOfInterest",void 0),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"updating",null),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"availability",void 0),(0,i._)([(0,a.qq)()],te.prototype,"hasZ",null),te=(0,i._)([(0,u.c)("geoscene.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],te);const se=2e3,ie=6e5,ne=1e6,re=25,oe=1;var ae=s(33184),le=s(80424),ue=s(6904),he=s(11712);class ce{constructor(){this._store=new Map,this._byteSize=0}set(e,t){this.delete(e),this._store.set(e,t),this._byteSize+=t.byteSize}delete(e){const t=this._store.get(e);return!!this._store.delete(e)&&(null!=t&&(this._byteSize-=t.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,t){for(const[s,i]of this._store){if(this._byteSize<=e)break;this.delete(s),t(i)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const t=this._store.get(e);t&&(this._store.delete(e),this._store.set(e,t))}}let de=class extends D.c{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*le.M.MEGABYTES,this._tileBounds=new ue.c,this._tiles=new ce,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=(0,W.Su)()}add(e,t){for(const e of t)this._referenceFeature(e.objectId);const s=this.featureStore.upsertMany(t),i=s.map((e=>new Set(Object.keys(e.attributes)))).reduce(((e,t)=>(0,X.WR)(e,t)),new Set(Object.keys(s[0]?.attributes??[])));this._addTileStorage(e,new Set(s.map((e=>e.objectId))),function(e){return e.reduce(((e,t)=>e+function(e){return 32+function(e){if(null==e)return 0;const t=(0,ae.qC)(e.lengths,4);return 32+(0,ae.qC)(e.coords,8)+t}(e.geometry)+(0,ae.aC)(e.attributes)}(t)),0)}(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,(e=>this._removeTileStorage(e)))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s,i){const n=e.id;this._tiles.set(n,new pe(e,t,s,i)),this._tileBounds.set(n,e.extent),this._tileFeatureCounts.set(n,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const s of e.objectIds)this._unreferenceFeature(s)===ye.REMOVED&&t.push(s);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,t]of this._tiles){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){const i=(await t(e,s)).features,{hasZ:n,hasM:r}=this.featureStore;for(const e of i){const t=(0,J.C_)(this._tmpBoundingRect,e.geometry,n,r);null!=t&&this._tileBounds.forEachInBounds(t,(t=>{const s=this._tiles.get(t);this.featureStore.add(e);const i=e.objectId;s.objectIds.has(i)||(s.objectIds.add(i),this._referenceFeature(i),this._tileFeatureCounts.set(s.data.id,s.objectIds.size))}))}}process(e,t=(()=>!0),s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!(0,W.K0)((0,W.ER)(this.extent,this._tmpBoundingRect),e.extent))return new fe(e);const i=this.getAttributesForTile(e.id);if((0,X.Cs)(s,i))return new fe(e);const n=this._createTileTree(e,this.tileInfo);return this._simplify(n,t,null,0,1),this._collectMissingTiles(e,n,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map((({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0})))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const n=this._tileFeatureCounts.get(e.id);if(null!=n)return n;const r=await(0,Z.WE)(t,s,i);return this._tileFeatureCounts.set(e.id,r.data.count),r.data.count}_createTileTree(e,t){const s=new _e(e.level,e.row,e.col);return t.updateTileInfo(s,_.c.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,(i=>{const n=this._tiles.get(i)?.data;n&&this._tilesAreRelated(e,n)&&this._populateChildren(s,n,t,this._tileFeatureCounts.get(n.id)||0)})),s}_tilesAreRelated(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,n=s?t:e,r=1<<n.level-i.level;return Math.floor(n.row/r)===i.row&&Math.floor(n.col/r)===i.col}_populateChildren(e,t,s,i){const n=t.level-e.level-1;if(n<0)return void(e.isLeaf=!0);const r=t.row>>n,o=t.col>>n,a=e.row<<1,l=o-(e.col<<1)+(r-a<<1),u=e.children[l];if(null!=u)this._populateChildren(u,t,s,i);else{const n=new _e(e.level+1,r,o);s.updateTileInfo(n,_.c.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=n,this._populateChildren(n,t,s,i)}}_simplify(e,t,s,i,n){const r=n*n;if(e.isLeaf)return t(this.getFeatureCount(e),n)?0:(this._remove(e),null!=s&&(s.children[i]=null),r);const o=n/2,a=o*o;let l=0;for(let s=0;s<e.children.length;s++){const i=e.children[s];l+=null!=i?this._simplify(i,t,e,s,o):a}return 0===l?this._mergeChildren(e):1-l/r<me&&(this._purge(e),null!=s&&(s.children[i]=null),l=r),l}_mergeChildren(e){const t=new Set;let s,i=0;this._forEachLeaf(e,(e=>{const n=this._tiles.get(e.id);if(n){s=s?(0,X.WR)(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const e of n.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}})),this._addTileStorage(e,t,i,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const n=new ge(s,e,this.extent);return this._collectMissingTilesRecurse(t,n,1,i),n.info}_collectMissingTilesRecurse(e,t,s,i){const n=this.getAttributesForTile(e.id),r=n&&!(0,X.Cs)(i,n);if(r&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(r||t.addMissing(e.level,e.row,e.col,s));const o=s/2;for(let s=0;s<e.children.length;s++){const n=e.children[s];null==n?t.addMissing(e.level+1,(e.row<<1)+((2&s)>>1),(e.col<<1)+(1&s),o):this._collectMissingTilesRecurse(n,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?ye.ADDED:ye.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),ye.REMOVED):(t>0&&this._refCounts.set(e,t),ye.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map((e=>`${e.data.id}:[${Array.from(e.objectIds)}]`)),featureReferences:Array.from(this._refCounts.keys()).map((e=>`${e}:${this._refCounts.get(e)}`))}}};(0,i._)([(0,a.qq)({constructOnly:!0})],de.prototype,"featureStore",void 0),(0,i._)([(0,a.qq)()],de.prototype,"tileInfo",void 0),(0,i._)([(0,a.qq)()],de.prototype,"extent",void 0),(0,i._)([(0,a.qq)()],de.prototype,"maximumByteSize",void 0),de=(0,i._)([(0,u.c)("geoscene.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],de);class pe{constructor(e,t,s,i){this.data=e,this.objectIds=t,this.byteSize=s,this.attributeKeys=i}}class _e{constructor(e,t,s){this.level=e,this.row=t,this.col=s,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class fe{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,W.wd)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class ge{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new fe(t),null!=s&&(this._extent=(0,W.ER)(s))}addMissing(e,t,s,i){const n=new he.g(null,e,t,s);this._tileInfo.updateTileInfo(n,_.c.ExtrapolateOptions.POWER_OF_TWO),null==n.extent||null!=this._extent&&!(0,W.K0)(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:i}),this.info.coveredArea-=(0,W.wd)(n.extent))}}const me=.18751;var ye;!function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"}(ye||(ye={}));var ve=s(6704);let we=class extends n.c.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=(0,r.qG)(),this._elevationAligner=E(),this._elevationFilter=O(),this._symbologyCandidatesFetcher=N(),this._updatingHandles=new h.A,this._editsUpdatingHandles=new h.A,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(e,t)=>{const s={query:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return(0,r.wp)(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return(0,r.wp)(t),i}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:n}=e.serviceInfo,{hasZ:r}=e,a=c.c.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new d.c({...e.serviceInfo,hasZ:r,hasM:!1}),this._queryEngine=new p.U({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:n,hasZ:r,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new te({store:new de({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:c.c.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const l="3d"===e.configuration.viewType;return this._elevationAligner=E(l,{elevationInfo:null!=e.elevationInfo?g.c.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=O(l),this.addHandles([(0,o.aE)((()=>this._featureFetcher.availability),(e=>this.emit("notify-availability",{availability:e})),o.du),(0,o.aE)((()=>this.updating),(()=>this._notifyUpdating()))]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),xe}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),this._featureFetcher.suspended=e,xe}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),this._featureFetcher.outFields=new Set(e??[]),xe}async fetchCandidates(e,t){await this._whenSetup.promise,(0,r.wp)(t);const s=function(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:s,spatialRel:i,where:n,timeExtent:r,objectIds:o}=e.filter,a={geometry:e.filter.geometry?(0,ve.h4)(e.filter.geometry):void 0,distance:t,units:s,spatialRel:i,timeExtent:r,objectIds:o,where:n??"1=1"};return{...e,query:a}}(e),i=t?.signal,n=await this._queryEngine.executeQueryForSnapping(s,i);(0,r.wp)(i);const o=await this._elevationAligner.alignCandidates(n.candidates,c.c.fromJSON(e.point.spatialReference)??c.c.WGS84,i);(0,r.wp)(i);const a=await this._symbologyCandidatesFetcher.fetch(o,i);(0,r.wp)(i);const l=0===a.length?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(s,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?_.c.fromJSON(e.tileInfo):null,xe}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),this._featureFetcher.refresh(),xe}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),await(0,o.Eq)((()=>!this.updatingExcludingEdits),t),(0,r.wp)(t),xe}async getDebugInfo(e,t){return(0,r.wp)(t),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(e,t){this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t);const s=(0,r.qG)();return this._pendingApplyEdits.set(e.id,s),this._featureFetcher.applyEdits(s.promise),this._editsUpdatingHandles.addPromise(s.promise),xe}async endApplyEdits(e,t){const s=this._pendingApplyEdits.get(e.id);return s&&s.resolve(e.edits),(0,r.wp)(t),xe}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),xe}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),xe}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=N(e,this._getSymbologyCandidates),xe}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?f.c.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};(0,i._)([(0,a.qq)({readOnly:!0})],we.prototype,"updating",null),(0,i._)([(0,a.qq)({readOnly:!0})],we.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.qq)()],we.prototype,"_isInitializing",void 0),we=(0,i._)([(0,u.c)("geoscene.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],we);const Ee=we,xe={result:{}}}}]);