@arcgis/core 4.24.0-next.20220329 → 4.24.0-next.20220401

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 (456) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/WebMap.js +1 -1
  3. package/WebScene.js +1 -1
  4. package/analysis/LineOfSightAnalysisObserver.js +1 -1
  5. package/analysis/LineOfSightAnalysisTarget.js +1 -1
  6. package/arcade/featureset/actions/Adapted.js +1 -1
  7. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  8. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  9. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  10. package/arcade/featureset/support/FeatureSet.js +1 -1
  11. package/arcade/featureset/support/RecentlyUsedCache.js +1 -1
  12. package/arcade/featureset/support/shared.js +1 -1
  13. package/arcade/functions/convertdirection.js +1 -1
  14. package/arcade/lib/character.js +1 -1
  15. package/arcade/lib/scanner.js +1 -1
  16. package/arcade/lib/tokenizer.js +1 -1
  17. package/arcade/request.js +1 -1
  18. package/arcade/treeAnalysis.js +1 -1
  19. package/assets/esri/core/workers/RemoteClient.js +1 -1
  20. package/assets/esri/core/workers/chunks/0bfedb1dbdff8205e468.js +1 -0
  21. package/assets/esri/core/workers/chunks/{5e472c89a38d6a42b84d.js → 0e29250c24a3a7b1ce13.js} +1 -1
  22. package/assets/esri/core/workers/chunks/0eb9c9477d36cd212f8b.js +1 -0
  23. package/assets/esri/core/workers/chunks/10779a256841c37f2429.js +1 -0
  24. package/assets/esri/core/workers/chunks/10a119889d1ab13402a3.js +1 -0
  25. package/assets/esri/core/workers/chunks/125b14c2ccd96d7c20c2.js +1 -0
  26. package/assets/esri/core/workers/chunks/23ec33a30db201e8b2c3.js +1 -0
  27. package/assets/esri/core/workers/chunks/2530e8ccf6e12787ce76.js +1 -0
  28. package/assets/esri/core/workers/chunks/2d9e97ba5b50aec4dd01.js +1 -0
  29. package/assets/esri/core/workers/chunks/365dc146398420f13f82.js +1 -0
  30. package/assets/esri/core/workers/chunks/3ae2827e8d55d6713d20.js +1 -0
  31. package/assets/esri/core/workers/chunks/3e3eebaa0844742db2f2.js +1 -0
  32. package/assets/esri/core/workers/chunks/3fd5b2d6eccd9098d492.js +1 -0
  33. package/assets/esri/core/workers/chunks/404f1d7bce014c7e6965.js +1 -0
  34. package/assets/esri/core/workers/chunks/411b7777bb5e943c156f.js +1 -0
  35. package/assets/esri/core/workers/chunks/{12ca192a5233bb2875d0.js → 4312902ab6e42fbe119b.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{4ef07f50da39f8607c1c.js → 44e95e87bd9e820aeb53.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{4d4c5e535d8b9ceb865a.js → 4810edf605838d07e5c5.js} +1 -1
  38. package/assets/esri/core/workers/chunks/4bce446391176a9d4588.js +1 -0
  39. package/assets/esri/core/workers/chunks/52a0e387073ea264e194.js +1 -0
  40. package/assets/esri/core/workers/chunks/560234694f3e53802aff.js +1 -0
  41. package/assets/esri/core/workers/chunks/5633710daeb3bbb79bcf.js +1 -0
  42. package/assets/esri/core/workers/chunks/5682039666f874836451.js +1 -0
  43. package/assets/esri/core/workers/chunks/6f01905936396fe87865.js +1 -0
  44. package/assets/esri/core/workers/chunks/6f7917da7166e8c6854b.js +1 -0
  45. package/assets/esri/core/workers/chunks/7388824eac8da01ea03d.js +1 -0
  46. package/assets/esri/core/workers/chunks/7745efef7d5119d0b087.js +1 -0
  47. package/assets/esri/core/workers/chunks/794b47764ebb0257ed41.js +1 -0
  48. package/assets/esri/core/workers/chunks/{da64dedf9270b64f42b2.js → 79bdb26244ec7b4472fe.js} +1 -1
  49. package/assets/esri/core/workers/chunks/79ec28b3e3c57fe026aa.js +1 -0
  50. package/assets/esri/core/workers/chunks/81e9d860a044acec74ce.js +1 -0
  51. package/assets/esri/core/workers/chunks/831dc0187f71e658550c.js +1 -0
  52. package/assets/esri/core/workers/chunks/86ad6b020c01850d9095.js +1 -0
  53. package/assets/esri/core/workers/chunks/{fb7397da8d4ec2ae4587.js → 87458fbf395338511662.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{1a859be598ad96bb4719.js → 8771296b537f366596c4.js} +18 -18
  55. package/assets/esri/core/workers/chunks/8958cd555f4887526e8b.js +1 -0
  56. package/assets/esri/core/workers/chunks/{e57b71ba70f088a3a052.js → 90dcd86cdef90099abfa.js} +1 -1
  57. package/assets/esri/core/workers/chunks/93067e27eea5844edc6c.js +1 -0
  58. package/assets/esri/core/workers/chunks/{9fbee2d9bf50c4c148c6.js → 9a146c9e9b4bf7fba88f.js} +1 -1
  59. package/assets/esri/core/workers/chunks/9b9821772b6cbe189fe0.js +1 -0
  60. package/assets/esri/core/workers/chunks/{6c4ce530b493c6f7c430.js → 9df2f9f7c28b31866be8.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{d0620ce99b620621d8bc.js → a0552044e123a3c51ddf.js} +1 -1
  62. package/assets/esri/core/workers/chunks/acc1a4acd57f5657e782.js +1 -0
  63. package/assets/esri/core/workers/chunks/b055ae7c54796751b64c.js +1 -0
  64. package/assets/esri/core/workers/chunks/{acc2cfb116fee7f82ae9.js → b26bd8fde2fc65bb67fb.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{9b45b94c4dbdc8d2c5fd.js → b34ba22c7a5adce8a7a2.js} +1 -1
  66. package/assets/esri/core/workers/chunks/b75665d0bf417c6ef24a.js +1 -0
  67. package/assets/esri/core/workers/chunks/bd50ec30688463b821d1.js +1 -0
  68. package/assets/esri/core/workers/chunks/c28f7ae4756ad1ba94bd.js +1 -0
  69. package/assets/esri/core/workers/chunks/c4f713959d4115b87c6c.js +1 -0
  70. package/assets/esri/core/workers/chunks/c58aa209492bd94b7aad.js +1 -0
  71. package/assets/esri/core/workers/chunks/{9b117097b7be0efd21d4.js → c59b0b58e24e6a60cf3e.js} +1 -1
  72. package/assets/esri/core/workers/chunks/c7bd5a4d318299388645.js +1 -0
  73. package/assets/esri/core/workers/chunks/c7cee13a962396b23a5e.js +1 -0
  74. package/assets/esri/core/workers/chunks/{3bbff5ea1ea0e955c592.js → cd3679fa86129ebabfdf.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{1a36dc0daffd536ea44d.js → cee7ce362860717713bf.js} +1 -1
  76. package/assets/esri/core/workers/chunks/cf463d6309f14df2f2fa.js +1 -0
  77. package/assets/esri/core/workers/chunks/{224c0e64160bdc170051.js → d076627bb7dadea89e89.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{fff4200bc61b82dd6193.js → d1d1c45243af614f2e74.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{1e0498dc9836658d9aba.js → d5fd12ea541c1a6b7fce.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{10322d990cda5aedf2f0.js → d6e32ca237ad9309c76a.js} +1 -1
  81. package/assets/esri/core/workers/chunks/e06ad3a3d71154fed654.js +1 -0
  82. package/assets/esri/core/workers/chunks/{7a77d4cd27c30f1a5cae.js → ee3387a43dfbb3df23e1.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{5d5fa2b1fc48a17eb9ab.js → f4fc165420d449e442b8.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{3d6d9906a534ddd8fa37.js → f5ee03f3fca7a75192de.js} +1 -1
  85. package/assets/esri/themes/base/widgets/_Daylight.scss +1 -1
  86. package/assets/esri/themes/base/widgets/_ElevationProfile.scss +1 -1
  87. package/assets/esri/themes/base/widgets/_Weather.scss +1 -1
  88. package/assets/esri/themes/base/widgets/_Widget.scss +12 -0
  89. package/assets/esri/themes/dark/main.css +1 -1
  90. package/assets/esri/themes/dark-blue/main.css +1 -1
  91. package/assets/esri/themes/dark-green/main.css +1 -1
  92. package/assets/esri/themes/dark-purple/main.css +1 -1
  93. package/assets/esri/themes/dark-red/main.css +1 -1
  94. package/assets/esri/themes/light/main.css +1 -1
  95. package/assets/esri/themes/light/view.css +1 -1
  96. package/assets/esri/themes/light-blue/main.css +1 -1
  97. package/assets/esri/themes/light-green/main.css +1 -1
  98. package/assets/esri/themes/light-purple/main.css +1 -1
  99. package/assets/esri/themes/light-red/main.css +1 -1
  100. package/chunks/ComponentShader.glsl.js +25 -25
  101. package/chunks/HighlightApply.glsl.js +36 -0
  102. package/chunks/HighlightBlur.glsl.js +26 -0
  103. package/chunks/HighlightDownsample.glsl.js +12 -0
  104. package/chunks/ImageMaterial.glsl.js +8 -8
  105. package/chunks/LineCallout.glsl.js +1 -1
  106. package/chunks/Pattern.glsl.js +2 -2
  107. package/chunks/SimpleAtmosphere.glsl.js +7 -7
  108. package/chunks/Stars.glsl.js +1 -1
  109. package/chunks/arcade.js +1 -1
  110. package/chunks/color.js +1 -1
  111. package/chunks/languageUtils.js +1 -1
  112. package/chunks/mat3.js +1 -1
  113. package/copyright.txt +2 -2
  114. package/core/AsyncUpdate.js +1 -1
  115. package/core/Evented.js +1 -1
  116. package/core/PooledArray.js +1 -1
  117. package/core/accessorSupport/diffUtils.js +1 -1
  118. package/core/accessorSupport/get.js +1 -1
  119. package/core/accessorSupport/read.js +1 -1
  120. package/core/accessorSupport/set.js +1 -1
  121. package/core/accessorSupport/tracking.js +1 -1
  122. package/core/accessorSupport/utils.js +1 -1
  123. package/core/arrayUtils.js +1 -1
  124. package/core/libs/gl-matrix-2/mat3.js +1 -1
  125. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  126. package/core/number.js +1 -1
  127. package/core/object.js +1 -1
  128. package/core/string.js +1 -1
  129. package/core/unitUtils.js +1 -1
  130. package/core/watchUtils.js +1 -1
  131. package/core/workers/RemoteClient.js +1 -1
  132. package/exports/csv.js +1 -1
  133. package/geometry/support/heightModelInfoUtils.js +1 -1
  134. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  135. package/geometry/support/normalizeUtils.js +1 -1
  136. package/identity/IdentityManagerBase.js +1 -1
  137. package/interfaces.d.ts +155 -20
  138. package/layers/ImageryLayer.js +1 -1
  139. package/layers/MapImageLayer.js +1 -1
  140. package/layers/RouteLayer.js +1 -1
  141. package/layers/SceneLayer.js +1 -1
  142. package/layers/SubtypeGroupLayer.js +1 -1
  143. package/layers/TileLayer.js +1 -1
  144. package/layers/VectorTileLayer.js +1 -1
  145. package/layers/WMSLayer.js +1 -1
  146. package/layers/WMTSLayer.js +1 -1
  147. package/layers/WebTileLayer.js +1 -1
  148. package/layers/graphics/data/AttributesBuilder.js +1 -1
  149. package/layers/graphics/data/QueryEngine.js +1 -1
  150. package/layers/graphics/editingSupport.js +1 -1
  151. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  152. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  153. package/layers/graphics/sources/support/inferenceUtils.js +1 -1
  154. package/layers/mixins/ArcGISCachedService.js +1 -1
  155. package/layers/mixins/ArcGISImageService.js +1 -1
  156. package/layers/ogc/ogcFeatureUtils.js +1 -1
  157. package/layers/support/ExportImageServiceParameters.js +1 -1
  158. package/layers/support/PixelBlock.js +1 -1
  159. package/layers/support/RasterJobHandler.js +1 -1
  160. package/layers/support/SpriteSource.js +1 -1
  161. package/layers/support/Sublayer.js +1 -1
  162. package/layers/support/TilemapCache.js +1 -1
  163. package/layers/support/WMTSSublayer.js +1 -1
  164. package/layers/support/arcgisLayerUrl.js +1 -1
  165. package/layers/support/fieldUtils.js +1 -1
  166. package/layers/support/kmlUtils.js +1 -1
  167. package/layers/support/layerUtils.js +1 -1
  168. package/layers/support/rasterDatasets/ImageAuxRaster.js +1 -1
  169. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  170. package/layers/support/rasterDatasets/RasterFactory.js +1 -1
  171. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  172. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  173. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  174. package/layers/support/rasterDatasets/xmlUtilities.js +1 -1
  175. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  176. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  177. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  178. package/layers/support/vectorTileLayerLoader.js +1 -1
  179. package/layers/support/wmsUtils.js +1 -1
  180. package/layers/support/wmtsUtils.js +1 -1
  181. package/libs/i3s/I3SModule.js +1 -1
  182. package/libs/vxl/VxlModule.js +1 -1
  183. package/package.json +1 -1
  184. package/portal/Portal.js +1 -1
  185. package/portal/PortalItem.js +1 -1
  186. package/portal/schemas/definitions.js +1 -1
  187. package/portal/support/layersLoader.js +1 -1
  188. package/portal/support/portalItemUtils.js +1 -1
  189. package/portal/support/portalLayers.js +1 -1
  190. package/renderers/support/AuthoringInfoVisualVariable.js +1 -1
  191. package/renderers/support/DictionaryLoader.js +1 -1
  192. package/renderers/support/RasterSymbolizer.js +1 -1
  193. package/renderers/support/numberUtils.js +1 -1
  194. package/renderers/support/rasterRendererHelper.js +1 -1
  195. package/renderers/support/utils.js +1 -1
  196. package/request.js +1 -1
  197. package/rest/imageService.js +1 -1
  198. package/rest/operations/find.js +1 -1
  199. package/rest/query/operations/query.js +1 -1
  200. package/rest/query/operations/queryRelatedRecords.js +1 -1
  201. package/rest/query/operations/queryTopFeatures.js +1 -1
  202. package/rest/support/DirectionLine.js +1 -1
  203. package/rest/support/DirectionPoint.js +1 -1
  204. package/rest/support/PointBarrier.js +1 -1
  205. package/rest/support/PolygonBarrier.js +1 -1
  206. package/rest/support/PolylineBarrier.js +1 -1
  207. package/rest/support/RouteInfo.js +1 -1
  208. package/rest/support/Stop.js +1 -1
  209. package/smartMapping/labels/clusters.js +1 -1
  210. package/smartMapping/popup/dotDensity.js +1 -1
  211. package/smartMapping/popup/support/clusterUtils.js +1 -1
  212. package/smartMapping/popup/support/utils.js +1 -1
  213. package/smartMapping/raster/support/utils.js +1 -1
  214. package/smartMapping/renderers/color.js +1 -1
  215. package/smartMapping/renderers/location.js +1 -1
  216. package/smartMapping/renderers/predominance.js +1 -1
  217. package/smartMapping/renderers/relationship.js +1 -1
  218. package/smartMapping/renderers/size.js +1 -1
  219. package/smartMapping/renderers/support/utils.js +1 -1
  220. package/smartMapping/renderers/type.js +1 -1
  221. package/smartMapping/renderers/univariateColorSize.js +1 -1
  222. package/smartMapping/statistics/summaryStatisticsForAge.js +1 -1
  223. package/smartMapping/statistics/support/ageUtils.js +1 -1
  224. package/smartMapping/statistics/support/utils.js +1 -1
  225. package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
  226. package/smartMapping/support/adapters/support/utils.js +1 -1
  227. package/smartMapping/support/utils.js +1 -1
  228. package/smartMapping/symbology/support/Theme.js +1 -1
  229. package/smartMapping/symbology/support/colorRamps.js +1 -1
  230. package/smartMapping/symbology/support/symbologyUtils.js +1 -1
  231. package/smartMapping/symbology/support/utils.js +1 -1
  232. package/statistics/utils.js +1 -1
  233. package/support/basemapDefinitions.js +1 -1
  234. package/support/basemapUtils.js +1 -1
  235. package/support/elevationInfoUtils.js +1 -1
  236. package/support/popupUtils.js +1 -1
  237. package/support/revision.js +1 -1
  238. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  239. package/symbols/cim/cimAnalyzer.js +1 -1
  240. package/symbols/cim/utils.js +1 -1
  241. package/symbols/support/previewSymbol3D.js +1 -1
  242. package/symbols/support/renderUtils.js +1 -1
  243. package/symbols/support/symbolLayerUtils.js +1 -1
  244. package/views/2d/engine/Bitmap.js +1 -1
  245. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  246. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  247. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  248. package/views/2d/engine/vectorTiles/TextShaping.js +1 -1
  249. package/views/2d/engine/vectorTiles/TileParser.js +1 -1
  250. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  251. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  252. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  253. package/views/2d/engine/webgl/Profiler.js +1 -1
  254. package/views/2d/engine/webgl/Utils.js +1 -1
  255. package/views/2d/engine/webgl/brushes/WGLGeometryBrush.js +1 -1
  256. package/views/2d/engine/webgl/definitions.js +1 -1
  257. package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
  258. package/views/2d/engine/webgl/effects/HittestEffectVTL.js +1 -1
  259. package/views/2d/engine/webgl/mesh/templates/WGLTemplateStore.js +1 -1
  260. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  261. package/views/2d/engine/webgl/util/Lock.js +1 -1
  262. package/views/2d/layers/RouteLayerView2D.js +1 -1
  263. package/views/2d/layers/features/schemaUtils.js +1 -1
  264. package/views/2d/layers/features/sources/SnapshotFeatureSource.js +1 -1
  265. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  266. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  267. package/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js +1 -1
  268. package/views/2d/layers/support/webStyleUtils.js +1 -1
  269. package/views/2d/support/Timeline.js +1 -1
  270. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  271. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  272. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  273. package/views/3d/analysis/Slice/SliceController.js +1 -1
  274. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  275. package/views/3d/environment/SceneViewAtmosphere.js +1 -1
  276. package/views/3d/environment/StarsTechnique.js +1 -1
  277. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  278. package/views/3d/glTF/loader.js +1 -1
  279. package/views/3d/interactive/analysisTools/lineOfSight/LineOfSightTool.js +1 -1
  280. package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
  281. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  282. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  283. package/views/3d/layers/I3SMeshView3D.js +1 -1
  284. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  285. package/views/3d/layers/LayerView3D.js +1 -1
  286. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  287. package/views/3d/layers/RouteLayerView3D.js +1 -1
  288. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  289. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  290. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  291. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  292. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  293. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  294. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  295. package/views/3d/layers/i3s/IDBMockCache.js +5 -0
  296. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  297. package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
  298. package/views/3d/state/ViewStateManager.js +1 -1
  299. package/views/3d/state/controllers/RotateController.js +1 -1
  300. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  301. package/views/3d/state/controllers/global/ZoomController.js +1 -1
  302. package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
  303. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  304. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  305. package/views/3d/support/HighlightOptions.js +1 -1
  306. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  307. package/views/3d/support/debugFlags.js +1 -1
  308. package/views/3d/support/orientedBoundingBox.js +1 -1
  309. package/views/3d/terrain/TerrainSurface.js +1 -1
  310. package/views/3d/webgl-engine/Stage.js +1 -1
  311. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  312. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  313. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +3 -3
  314. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +5 -5
  315. package/views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js +1 -1
  316. package/views/3d/webgl-engine/lib/HighlightHelper.js +1 -1
  317. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  318. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  319. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  320. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderParameters.js +1 -1
  321. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  322. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  323. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  324. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  325. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  326. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  327. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +5 -0
  328. package/views/3d/webgl-engine/shaders/HighlightApplyTechnique.js +5 -0
  329. package/views/3d/webgl-engine/shaders/HighlightBlur.glsl.js +5 -0
  330. package/views/3d/webgl-engine/shaders/HighlightBlurTechnique.js +5 -0
  331. package/views/3d/webgl-engine/shaders/HighlightDownsample.glsl.js +5 -0
  332. package/views/3d/webgl-engine/shaders/HighlightDownsampleTechnique.js +5 -0
  333. package/views/3d/webgl-engine/shaders/HighlightOptions.js +4 -0
  334. package/views/3d/webgl-engine/shaders/HighlightPassParameters.js +5 -0
  335. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  336. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  337. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  338. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  339. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +5 -7
  340. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +14 -14
  341. package/views/SceneView.js +1 -1
  342. package/views/draw/support/GraphicMover.js +1 -1
  343. package/views/input/InputHandler.js +1 -1
  344. package/views/input/InputManager.js +1 -1
  345. package/views/layers/ImageryTileLayerView.js +1 -1
  346. package/views/layers/MapImageLayerView.js +1 -1
  347. package/views/layers/TileLayerView.js +1 -1
  348. package/views/layers/support/popupUtils.js +1 -1
  349. package/views/support/DefaultsFromMap.js +1 -1
  350. package/views/support/Scheduler.js +1 -1
  351. package/views/support/screenshotUtils.js +1 -1
  352. package/views/ui/DefaultUI.js +1 -1
  353. package/views/webgl/ShaderTranspiler.js +1 -1
  354. package/webscene/Slide.js +1 -1
  355. package/webscene/spec-certification/spec.js +1 -1
  356. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  357. package/widgets/Attachments/support/attachmentUtils.js +1 -1
  358. package/widgets/Attachments.js +1 -1
  359. package/widgets/Attribution.js +1 -1
  360. package/widgets/BasemapLayerList.js +1 -1
  361. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  362. package/widgets/Bookmarks.js +1 -1
  363. package/widgets/BuildingExplorer/support/filterUtils.js +1 -1
  364. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  365. package/widgets/CoordinateConversion/support/coordinateConversionUtils.js +1 -1
  366. package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
  367. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  368. package/widgets/Directions/DirectionsViewModel.js +1 -1
  369. package/widgets/Directions.js +1 -1
  370. package/widgets/Editor/EditorViewModel.js +1 -1
  371. package/widgets/Editor/workflowUtils.js +1 -1
  372. package/widgets/Editor.js +1 -1
  373. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  374. package/widgets/Feature/FeatureMedia.js +1 -1
  375. package/widgets/Feature/support/featureUtils.js +1 -1
  376. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  377. package/widgets/FeatureForm/InputField.js +1 -1
  378. package/widgets/FeatureForm.js +1 -1
  379. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  380. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  381. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  382. package/widgets/FeatureTemplates.js +1 -1
  383. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  384. package/widgets/LayerList/ListItemPanel.js +1 -1
  385. package/widgets/LayerList.js +1 -1
  386. package/widgets/Legend/LegendViewModel.js +1 -1
  387. package/widgets/Legend/styles/Card.js +1 -1
  388. package/widgets/Legend/styles/Classic.js +1 -1
  389. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  390. package/widgets/Legend/support/colorRampUtils.js +1 -1
  391. package/widgets/Legend/support/relationshipRampUtils.js +1 -1
  392. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  393. package/widgets/Popup/PopupViewModel.js +1 -1
  394. package/widgets/Popup/actionUtils.js +1 -1
  395. package/widgets/Print/PrintViewModel.js +1 -1
  396. package/widgets/Print.js +1 -1
  397. package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
  398. package/widgets/Search/SearchViewModel.js +1 -1
  399. package/widgets/Search/support/layerSearchUtils.js +1 -1
  400. package/widgets/Slider.js +1 -1
  401. package/widgets/Swipe.js +1 -1
  402. package/widgets/TableList.js +1 -1
  403. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  404. package/widgets/TimeSlider.js +1 -1
  405. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  406. package/widgets/support/DatePicker.js +1 -1
  407. package/widgets/support/Popover.js +1 -1
  408. package/widgets/support/SnappingControls.js +1 -1
  409. package/widgets/support/TimePicker.js +1 -1
  410. package/widgets/support/timeWidgetUtils.js +1 -1
  411. package/assets/esri/core/workers/chunks/083a5d10f8e243641cb9.js +0 -1
  412. package/assets/esri/core/workers/chunks/0872812ce4d0ec8faf8f.js +0 -1
  413. package/assets/esri/core/workers/chunks/0bc26899780c33637746.js +0 -1
  414. package/assets/esri/core/workers/chunks/113362697da1b69deaed.js +0 -1
  415. package/assets/esri/core/workers/chunks/11a2f9708938eac98815.js +0 -1
  416. package/assets/esri/core/workers/chunks/11a45709b703be84caaf.js +0 -1
  417. package/assets/esri/core/workers/chunks/1c1294ff1ebbd8f774f7.js +0 -1
  418. package/assets/esri/core/workers/chunks/1c915cc9a9d5729b6f17.js +0 -1
  419. package/assets/esri/core/workers/chunks/31786756b3d44540f8c0.js +0 -1
  420. package/assets/esri/core/workers/chunks/36a6f34fe40785beff5d.js +0 -1
  421. package/assets/esri/core/workers/chunks/373c16f8b8093d001064.js +0 -1
  422. package/assets/esri/core/workers/chunks/382a331a592abb61267f.js +0 -1
  423. package/assets/esri/core/workers/chunks/3bf106fe34e3992032c4.js +0 -1
  424. package/assets/esri/core/workers/chunks/3dcec610f1c1497d87bc.js +0 -1
  425. package/assets/esri/core/workers/chunks/46495e726d8739260d44.js +0 -1
  426. package/assets/esri/core/workers/chunks/4a82a6a473b3d540d0be.js +0 -1
  427. package/assets/esri/core/workers/chunks/4b6719377a95ac10fa43.js +0 -1
  428. package/assets/esri/core/workers/chunks/4d2ef57ff3a5cfc1313f.js +0 -1
  429. package/assets/esri/core/workers/chunks/4fd2b8153d62592210a2.js +0 -1
  430. package/assets/esri/core/workers/chunks/56e6a1079269e2964b02.js +0 -1
  431. package/assets/esri/core/workers/chunks/5b4d9786c010d265346c.js +0 -1
  432. package/assets/esri/core/workers/chunks/604637e1c3937b376a0d.js +0 -1
  433. package/assets/esri/core/workers/chunks/60f83257e361f87fa6fd.js +0 -1
  434. package/assets/esri/core/workers/chunks/6d3f80be6fceb2c18b5d.js +0 -1
  435. package/assets/esri/core/workers/chunks/6f827a32646bab0a8777.js +0 -1
  436. package/assets/esri/core/workers/chunks/70bd2ab42e3801ef5974.js +0 -1
  437. package/assets/esri/core/workers/chunks/746222184b361b50d6ba.js +0 -1
  438. package/assets/esri/core/workers/chunks/7fb72b2d11e8d840f982.js +0 -1
  439. package/assets/esri/core/workers/chunks/85bb6a1a7704fcdcbec2.js +0 -1
  440. package/assets/esri/core/workers/chunks/8b4c76cebb100e6c06f8.js +0 -1
  441. package/assets/esri/core/workers/chunks/9586a6b320edb1922926.js +0 -1
  442. package/assets/esri/core/workers/chunks/99638697ffda9022ce92.js +0 -1
  443. package/assets/esri/core/workers/chunks/a9da1cb118ca62a9581d.js +0 -1
  444. package/assets/esri/core/workers/chunks/aaa41a5013eef713c032.js +0 -1
  445. package/assets/esri/core/workers/chunks/ac321f939dd488ff6ce4.js +0 -1
  446. package/assets/esri/core/workers/chunks/add6027a96398ecf69de.js +0 -1
  447. package/assets/esri/core/workers/chunks/b75206b46ba81606087c.js +0 -1
  448. package/assets/esri/core/workers/chunks/bf8456828e38a768eba3.js +0 -1
  449. package/assets/esri/core/workers/chunks/c0720d0d8adcba6738d4.js +0 -1
  450. package/assets/esri/core/workers/chunks/c5bb712d5cf8c05a4e13.js +0 -1
  451. package/assets/esri/core/workers/chunks/d343f05a3366f95e0494.js +0 -1
  452. package/assets/esri/core/workers/chunks/d8b1f00075983d769985.js +0 -1
  453. package/chunks/Highlight.glsl.js +0 -88
  454. package/views/3d/webgl-engine/shaders/Highlight.glsl.js +0 -5
  455. package/views/3d/webgl-engine/shaders/HighlightTechnique.js +0 -5
  456. package/views/3d/webgl-engine/shaders/HighlightTechniqueConfiguration.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import a from"../../core/Logger.js";import{abortMaybe as i,isSome as n,unwrap as s,isNone as l}from"../../core/maybe.js";import{createTask as r,isAborted as o}from"../../core/promiseUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{mayHaveHeightModelInfo as u,deriveHeightModelInfoFromLayer as c}from"../../geometry/support/heightModelInfoUtils.js";import{stringFromViewingMode as f,ViewingMode as h}from"../ViewingMode.js";import{projectWithEngineOrService as g}from"./projectionUtils.js";const y=a.getLogger("esri.views.support.DefaultsFromMap");y.level="info";let _=class extends t{constructor(e){super(e),this.required={tileInfo:!1,heightModelInfo:!1,extent:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.logDebugInformation=!1,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._debug("Aborting project extent task"),this._projectExtentTask.task=i(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return n(this.userSpatialReference)?this.userSpatialReference:s(this._spatialReferenceTask.spatialReference)}get extent(){return s(this._extentTask.extent)}get heightModelInfo(){return s(this._heightModelInfoTask.heightModelInfo)}get vcsWkid(){return s(this._heightModelInfoTask.vcsWkid)}get latestVcsWkid(){return s(this._heightModelInfoTask.latestVcsWkid)}get viewingMode(){return l(this.userSpatialReference)||this.userSpatialReference.equals(s(this._spatialReferenceTask.spatialReference))?s(this._spatialReferenceTask.viewingMode):null}get tileInfo(){return s(this._tileInfoTask.tileInfo)}get mapCollections(){var e,t,a,i;const s=null==(e=this.map)?void 0:e.call(this),l=[];return n(this.priorityCollection)&&l.push(this.priorityCollection),l.push({parent:null==s?void 0:s.basemap,layers:null==s||null==(t=s.basemap)?void 0:t.baseLayers},{layers:null==s?void 0:s.layers},{parent:null==s?void 0:s.ground,layers:null==s||null==(a=s.ground)?void 0:a.layers},{parent:null==s?void 0:s.basemap,layers:null==s||null==(i=s.basemap)?void 0:i.referenceLayers}),l}get _allLayers(){var e,t;const a=this._collectLayers(this.mapCollections);return this._debug("Collected",null!=(e=null==(t=a.layers)?void 0:t.length)?e:0,"layers, updating",a.updating),a}get _spatialReferenceTask(){var e;if(this.suspended)return null!=(e=this._get("_spatialReferenceTask"))?e:{updating:!1};const{layers:t,updating:a}=this._allLayers,i={candidates:null};for(const l of t)if(this._processSpatialReferenceCandidates(l,i),n(i.candidates)&&1===i.candidates.length)break;if(a&&(l(i.candidates)||1!==i.candidates.length))return{updating:!0};const s=this._pickSpatialReferenceCandidate(i.candidates);return this._debug("Finished spatial reference",n(s)?`${s.spatialReference.wkid}:${n(s.viewingMode)?f(s.viewingMode):"global/local"}`:"none available"),{spatialReference:n(s)?s.spatialReference:null,viewingMode:n(s)?s.viewingMode:null,updating:!1}}get _tileInfoTask(){var e,t,a,i,n,s,l,r;if(!this.required.tileInfo)return null!=(r=this._get("_tileInfoTask"))?r:{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const{layers:o,updating:p}=this._collectLayers([{parent:null==(e=this.map)||null==(t=e.call(this))?void 0:t.basemap,layers:null==(a=this.map)||null==(i=a.call(this))||null==(n=i.basemap)?void 0:n.baseLayers},{layers:null==(s=this.map)||null==(l=s.call(this))?void 0:l.layers}]);if(o&&o.length>0&&"tileInfo"in o[0]){const e=o[0].tileInfo;return{tileInfo:e&&e.spatialReference.equals(this.spatialReference)?e:null,updating:!1}}return{updating:p}}get _heightModelInfoTask(){var e,t;if(!this.required.heightModelInfo||this.suspended&&null!=(e=this._get("_heightModelInfoTask"))&&e.heightModelInfo)return null!=(t=this._get("_heightModelInfoTask"))?t:{updating:!1};const{layers:a,updating:i}=this._allLayers;for(const o of a){var n,s;if(this._debug("Considering",null!=(n=null!=(s=o.title)?s:o.id)?n:o.declaredClass,"for height model info"),u(o)){const e=c(o);var l,r;if(e)return this._debug("Derived height model info",e),{heightModelInfo:e,vcsWkid:null==(l=o.spatialReference)?void 0:l.vcsWkid,latestVcsWkid:null==(r=o.spatialReference)?void 0:r.latestVcsWkid,updating:!1}}this._debug("Layer does not support height models")}return this._debug("No height model info found,","updating",i),{updating:i}}get _extentCandidatesTask(){var e;if(this.suspended||!this.required.extent)return null!=(e=this._get("_extentCandidatesTask"))?e:{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const t=this._allLayers,a=t.updating,i=[];for(const l of t.layers){var s;const e="fullExtents"in l&&l.fullExtents||(n(l.fullExtent)?[l.fullExtent]:[]),t=this.requiresExtentInSpatialReference?null:e[0],a=null!=(s=e.find((e=>e.spatialReference.equals(this.spatialReference))))?s:t;if(a)return{candidates:[{extent:a,layer:l}],updating:!1};if(this._getSupportedSpatialReferences(l).length>0)for(const n of e)i.push({extent:n,layer:l})}return{candidates:i,updating:a}}get _extentTask(){const{candidates:e,updating:t}=this._extentCandidatesTask;if(t)return{updating:t};if(l(e)||0===e.length)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const a=this._pickExtentCandidate(e),s=this.spatialReference;return a.extent.equals(this._projectExtentTask.input)&&s.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:n(this._projectExtentTask.task)&&!this._projectExtentTask.task.finished}:(n(this._projectExtentTask.task)&&(this._debug("Aborting project extent task"),this._projectExtentTask.task=i(this._projectExtentTask.task)),this._debug("Starting project extent task for",a.extent),this._projectExtentTask={input:a.extent.clone(),output:null,spatialReference:s.clone(),task:r((async e=>{try{const t=await g(a.extent,s,a.layer.portalItem,e);this._debug("Project extent task finished",t),this._projectExtentTask={...this._projectExtentTask,task:null,output:t}}catch(t){if(o(e))return;this._projectExtentTask={...this._projectExtentTask,task:null}}}))},{updating:!0})}_processSpatialReferenceCandidates(e,t){var a;const i=this._getSupportedSpatialReferences(e);if(0!==i.length)if(this._debug("Spatial reference candidates from",null!=(a=e.title)?a:e.id,":",i.map((e=>`${e.spatialReference.wkid}:${n(e.viewingMode)?f(e.viewingMode):"global/local"}`)).join(", ")),l(t.candidates))t.candidates=i;else{const e=[],a=(e,t)=>n(e)?n(t)?e===t&&e:e:t;for(const n of t.candidates)for(const t of i){if(!n.spatialReference.equals(t.spatialReference))continue;const i=a(n.viewingMode,t.viewingMode);if(!1!==i){e.push({spatialReference:n.spatialReference,viewingMode:i});break}}e.length>0&&(t.candidates=e)}}_pickSpatialReferenceCandidate(e){const t=this.defaultSpatialReference;return l(e)||e.length<1?n(t)?{spatialReference:t,viewingMode:null}:null:(n(t)&&e.length>1&&e.some((({spatialReference:e})=>e.equals(t)))&&(e=e.filter((({spatialReference:e})=>e.equals(t)))),e.length>1&&e.some((({viewingMode:e})=>e!==h.Local))&&(e=e.filter((({viewingMode:e})=>e!==h.Local))),e[0])}_getSupportedSpatialReferences(e){const t="supportedSpatialReferences"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(0===t.length)return[];const a=[];for(const i of t){const t=this.getSpatialReferenceSupport({spatialReference:i,layer:e});if(n(t)){const e=n(t.constraints)?t.constraints:[{spatialReference:i,viewingMode:null}];for(const{spatialReference:t,viewingMode:i}of e)(!this.requiresExtentInSpatialReference||l(this.userSpatialReference)||t.equals(this.userSpatialReference))&&a.push({spatialReference:t,viewingMode:i})}}return a}_pickExtentCandidate(e){const t=this.spatialReference;return e.find((({extent:e})=>t.equals(e.spatialReference)))||e[0]}_collectLayers(e){var t;if("loaded"!==this._loadMaybe(null==(t=this.map)?void 0:t.call(this)))return{layers:[],updating:!0};const a={layers:[],preloading:-1,updating:!1};for(const i of e)if(this._collectCollection(i,a),a.preloading===this.sourcePreloadCount)break;return{layers:a.layers,updating:a.updating}}_collectCollection(e,t){if(e.layers){switch(this._loadMaybe(e.parent)){case"loading":return t.updating=!0,void++t.preloading;case"failed":return}for(const n of e.layers){switch(this._loadMaybe(n)){case"failed":continue;case"loading":t.updating=!0,++t.preloading;break;case"loaded":var a,i;if(!t.updating)this._debug("Considering layer",null!=(a=null!=(i=n.title)?i:n.id)?a:n.declaredClass),t.layers.push(n);"layers"in n&&this._collectCollection({layers:n.layers},t)}if(t.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return e&&"loadStatus"in e?"not-loaded"===e.loadStatus?(this._debug("Triggering load",null!=(t=null!=(a=e.title)?a:e.id)?t:e.declaredClass),e.load(),"loading"):e.loadStatus:"loaded";var t,a}_debug(...e){this.logDebugInformation&&y.info(...e)}};e([p()],_.prototype,"required",void 0),e([p({constructOnly:!0})],_.prototype,"map",void 0),e([p({constructOnly:!0})],_.prototype,"getSpatialReferenceSupport",void 0),e([p()],_.prototype,"defaultSpatialReference",void 0),e([p()],_.prototype,"userSpatialReference",void 0),e([p()],_.prototype,"sourcePreloadCount",void 0),e([p()],_.prototype,"priorityCollection",void 0),e([p()],_.prototype,"logDebugInformation",void 0),e([p()],_.prototype,"requiresExtentInSpatialReference",void 0),e([p()],_.prototype,"suspended",void 0),e([p({readOnly:!0})],_.prototype,"ready",null),e([p({readOnly:!0})],_.prototype,"heightModelInfoReady",null),e([p({readOnly:!0})],_.prototype,"spatialReference",null),e([p({readOnly:!0})],_.prototype,"extent",null),e([p({readOnly:!0})],_.prototype,"heightModelInfo",null),e([p({readOnly:!0})],_.prototype,"vcsWkid",null),e([p({readOnly:!0})],_.prototype,"latestVcsWkid",null),e([p({readOnly:!0})],_.prototype,"viewingMode",null),e([p({readOnly:!0})],_.prototype,"tileInfo",null),e([p({readOnly:!0})],_.prototype,"mapCollections",null),e([p({readOnly:!0})],_.prototype,"_allLayers",null),e([p({readOnly:!0})],_.prototype,"_spatialReferenceTask",null),e([p({readOnly:!0})],_.prototype,"_tileInfoTask",null),e([p({readOnly:!0})],_.prototype,"_heightModelInfoTask",null),e([p({readOnly:!0})],_.prototype,"_extentCandidatesTask",null),e([p()],_.prototype,"_extentTask",null),e([p()],_.prototype,"_projectExtentTask",void 0),_=e([d("esri.views.support.DefaultsFromMap")],_);export{_ as DefaultsFromMap};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{abortMaybe as a,isSome as n,unwrap as i,isNone as s}from"../../core/maybe.js";import{createTask as l,isAborted as r}from"../../core/promiseUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{supportsHeightModelInfo as u,deriveHeightModelInfoFromLayer as c}from"../../geometry/support/heightModelInfoUtils.js";import{ViewingMode as d}from"../ViewingMode.js";import{projectWithEngineOrService as f}from"./projectionUtils.js";let h=class extends t{constructor(e){super(e),this.required={tileInfo:!1,heightModelInfo:!1,extent:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=a(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return n(this.userSpatialReference)?this.userSpatialReference:i(this._spatialReferenceTask.spatialReference)}get extent(){return i(this._extentTask.extent)}get heightModelInfo(){return i(this._heightModelInfoTask.heightModelInfo)}get vcsWkid(){return i(this._heightModelInfoTask.vcsWkid)}get latestVcsWkid(){return i(this._heightModelInfoTask.latestVcsWkid)}get viewingMode(){return s(this.userSpatialReference)||this.userSpatialReference.equals(i(this._spatialReferenceTask.spatialReference))?i(this._spatialReferenceTask.viewingMode):null}get tileInfo(){return i(this._tileInfoTask.tileInfo)}get mapCollections(){var e,t,a,i;const s=null==(e=this.map)?void 0:e.call(this),l=[];return n(this.priorityCollection)&&l.push(this.priorityCollection),l.push({parent:null==s?void 0:s.basemap,layers:null==s||null==(t=s.basemap)?void 0:t.baseLayers},{layers:null==s?void 0:s.layers},{parent:null==s?void 0:s.ground,layers:null==s||null==(a=s.ground)?void 0:a.layers},{parent:null==s?void 0:s.basemap,layers:null==s||null==(i=s.basemap)?void 0:i.referenceLayers}),l}get _allLayers(){return this._collectLayers(this.mapCollections)}get _spatialReferenceTask(){var e;if(this.suspended)return null!=(e=this._get("_spatialReferenceTask"))?e:{updating:!1};const{layers:t,updating:a}=this._allLayers;let i=null;for(const s of t){const e=this._getSupportedSpatialReferences(s);if(e.length>0){const t=this._narrowDownSpatialReferenceCandidates(i,e);n(t)&&(i=t)}if(n(i)&&1===i.length)break}if(a&&(s(i)||1!==i.length))return{updating:!0};const l=this._pickSpatialReferenceCandidate(i);return{spatialReference:n(l)?l.spatialReference:null,viewingMode:n(l)?l.viewingMode:null,updating:!1}}get _tileInfoTask(){var e,t,a,n,i,s,l,r;if(!this.required.tileInfo)return null!=(r=this._get("_tileInfoTask"))?r:{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const{layers:o,updating:p}=this._collectLayers([{parent:null==(e=this.map)||null==(t=e.call(this))?void 0:t.basemap,layers:null==(a=this.map)||null==(n=a.call(this))||null==(i=n.basemap)?void 0:i.baseLayers},{layers:null==(s=this.map)||null==(l=s.call(this))?void 0:l.layers}]);if(o&&o.length>0&&"tileInfo"in o[0]){const e=o[0].tileInfo;return{tileInfo:e&&e.spatialReference.equals(this.spatialReference)?e:null,updating:!1}}return{updating:p}}get _heightModelInfoTask(){var e,t;if(!this.required.heightModelInfo||this.suspended&&null!=(e=this._get("_heightModelInfoTask"))&&e.heightModelInfo)return null!=(t=this._get("_heightModelInfoTask"))?t:{updating:!1};const{layers:a,updating:n}=this._allLayers;for(const l of a)if(u(l)){const e=c(l);var i,s;if(e)return{heightModelInfo:e,vcsWkid:null==(i=l.spatialReference)?void 0:i.vcsWkid,latestVcsWkid:null==(s=l.spatialReference)?void 0:s.latestVcsWkid,updating:!1}}return{updating:n}}get _extentCandidatesTask(){var e;if(this.suspended||!this.required.extent)return null!=(e=this._get("_extentCandidatesTask"))?e:{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const t=this._allLayers,a=t.updating,i=[];for(const l of t.layers){var s;const e="fullExtents"in l&&l.fullExtents||(n(l.fullExtent)?[l.fullExtent]:[]),t=this.requiresExtentInSpatialReference?null:e[0],a=null!=(s=e.find((e=>e.spatialReference.equals(this.spatialReference))))?s:t;if(a)return{candidates:[{extent:a,layer:l}],updating:!1};if(this._getSupportedSpatialReferences(l).length>0)for(const n of e)i.push({extent:n,layer:l})}return{candidates:i,updating:a}}get _extentTask(){const{candidates:e,updating:t}=this._extentCandidatesTask;if(t)return{updating:t};if(s(e)||0===e.length)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const i=this._pickExtentCandidate(e),o=this.spatialReference;return i.extent.equals(this._projectExtentTask.input)&&o.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:n(this._projectExtentTask.task)&&!this._projectExtentTask.task.finished}:(n(this._projectExtentTask.task)&&(this._projectExtentTask.task=a(this._projectExtentTask.task)),this._projectExtentTask={input:i.extent.clone(),output:null,spatialReference:o.clone(),task:l((async e=>{try{const t=await f(i.extent,o,i.layer.portalItem,e);this._projectExtentTask={...this._projectExtentTask,task:null,output:t}}catch(t){if(r(e))return;this._projectExtentTask={...this._projectExtentTask,task:null}}}))},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,t){if(s(e))return t;const a=[],i=(e,t)=>n(e)?n(t)?e===t&&e:e:t;for(const n of e)for(const e of t){if(!n.spatialReference.equals(e.spatialReference))continue;const t=i(n.viewingMode,e.viewingMode);if(!1!==t){a.push({spatialReference:n.spatialReference,viewingMode:t});break}}return a.length>0?a:null}_pickSpatialReferenceCandidate(e){const t=this.defaultSpatialReference;return s(e)||e.length<1?n(t)?{spatialReference:t,viewingMode:null}:null:(n(t)&&e.length>1&&e.some((({spatialReference:e})=>e.equals(t)))&&(e=e.filter((({spatialReference:e})=>e.equals(t)))),e.length>1&&e.some((({viewingMode:e})=>e!==d.Local))&&(e=e.filter((({viewingMode:e})=>e!==d.Local))),e[0])}_getSupportedSpatialReferences(e){const t="supportedSpatialReferences"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(0===t.length)return[];const a=[];for(const i of t){const t=this.getSpatialReferenceSupport({spatialReference:i,layer:e});if(n(t)){const e=n(t.constraints)?t.constraints:[{spatialReference:i,viewingMode:null}];for(const{spatialReference:t,viewingMode:n}of e)(!this.requiresExtentInSpatialReference||s(this.userSpatialReference)||t.equals(this.userSpatialReference))&&a.push({spatialReference:t,viewingMode:n})}}return a}_pickExtentCandidate(e){const t=this.spatialReference;return e.find((({extent:e})=>t.equals(e.spatialReference)))||e[0]}_collectLayers(e){var t;if("loaded"!==this._loadMaybe(null==(t=this.map)?void 0:t.call(this)))return{layers:[],updating:!0};const a={layers:[],preloading:-1,updating:!1};for(const n of e)if(this._collectCollection(n,a),a.preloading===this.sourcePreloadCount)break;return{layers:a.layers,updating:a.updating}}_collectCollection(e,t){if(e.layers){switch(this._loadMaybe(e.parent)){case"loading":return t.updating=!0,void++t.preloading;case"failed":return}for(const a of e.layers){switch(this._loadMaybe(a)){case"failed":continue;case"loading":t.updating=!0,++t.preloading;break;case"loaded":t.updating||t.layers.push(a),"layers"in a&&this._collectCollection({layers:a.layers},t)}if(t.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return e&&"loadStatus"in e?"not-loaded"===e.loadStatus?(e.title,e.load(),"loading"):e.loadStatus:"loaded"}};e([o()],h.prototype,"required",void 0),e([o({constructOnly:!0})],h.prototype,"map",void 0),e([o({constructOnly:!0})],h.prototype,"getSpatialReferenceSupport",void 0),e([o()],h.prototype,"defaultSpatialReference",void 0),e([o()],h.prototype,"userSpatialReference",void 0),e([o()],h.prototype,"sourcePreloadCount",void 0),e([o()],h.prototype,"priorityCollection",void 0),e([o()],h.prototype,"requiresExtentInSpatialReference",void 0),e([o()],h.prototype,"suspended",void 0),e([o({readOnly:!0})],h.prototype,"ready",null),e([o({readOnly:!0})],h.prototype,"heightModelInfoReady",null),e([o({readOnly:!0})],h.prototype,"spatialReference",null),e([o({readOnly:!0})],h.prototype,"extent",null),e([o({readOnly:!0})],h.prototype,"heightModelInfo",null),e([o({readOnly:!0})],h.prototype,"vcsWkid",null),e([o({readOnly:!0})],h.prototype,"latestVcsWkid",null),e([o({readOnly:!0})],h.prototype,"viewingMode",null),e([o({readOnly:!0})],h.prototype,"tileInfo",null),e([o({readOnly:!0})],h.prototype,"mapCollections",null),e([o({readOnly:!0})],h.prototype,"_allLayers",null),e([o({readOnly:!0})],h.prototype,"_spatialReferenceTask",null),e([o({readOnly:!0})],h.prototype,"_tileInfoTask",null),e([o({readOnly:!0})],h.prototype,"_heightModelInfoTask",null),e([o({readOnly:!0})],h.prototype,"_extentCandidatesTask",null),e([o()],h.prototype,"_extentTask",null),e([o()],h.prototype,"_projectExtentTask",void 0),h=e([p("esri.views.support.DefaultsFromMap")],h);export{h as DefaultsFromMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import s from"../../core/Handles.js";import r from"../../core/Logger.js";import{unwrapOr as i,removeMaybe as a,isNone as u,isSome as o}from"../../core/maybe.js";import n from"../../core/PerformanceSampler.js";import h from"../../core/PooledArray.js";import{isAborted as _,createAbortError as d,when as l}from"../../core/promiseUtils.js";import{watch as E,initial as c,when as T}from"../../core/reactiveUtils.js";import{Milliseconds as m}from"../../core/time.js";import{property as I}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{PromiseQueue as p}from"../../layers/support/PromiseQueue.js";import R from"./debugFlags.js";const A=r.getLogger("esri.views.support.Scheduler");function f(e){return new D.Scheduler({nowFunc:e})}var L;!function(e){e.RESOURCE_CONTROLLER="schedule",e.SLIDE="slide",e.STREAM_DATA_LOADER="stream loader",e.ELEVATION_QUERY="elevation query",e.TERRAIN_SURFACE="terrain",e.SURFACE_GEOMETRY_UPDATES="surface geometry updates",e.GRAPHICS_CORE="Graphics3D",e.I3S_CONTROLLER="I3S",e.POINT_CLOUD_LAYER="point cloud",e.FEATURE_TILE_FETCHER="feature fetcher",e.OVERLAY="overlay",e.STAGE="stage",e.GRAPHICS_DECONFLICTOR="graphics deconflictor",e.FILTER_VISIBILITY="Graphics3D filter visibility",e.SCALE_VISIBILITY="Graphics3D scale visibility",e.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",e.POINT_OF_INTEREST_FREQUENT="POI frequent",e.POINT_OF_INTEREST_INFREQUENT="POI infrequent",e.LABELER="labeler",e.FEATURE_QUERY_ENGINE="feature query",e.FEATURE_TILE_TREE="feature tile tree",e.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",e.ELEVATION_ALIGNMENT="elevation alignment",e.TEXT_TEXTURE_ATLAS="text texture atlas",e.TEXTURE_UNLOAD="texture unload",e.LINE_OF_SIGHT_TOOL="line of sight tool",e.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",e.ELEVATION_PROFILE="elevation profile",e.SNAPPING="snapping",e.SHADOW_ACCUMULATOR="shadow accumulator",e.CLOUDS_GENERATOR="cloud generator",e[e.TEST_PRIO=1]="TEST_PRIO"}(L||(L={}));const S=0,b=new Map([[L.RESOURCE_CONTROLLER,S],[L.SLIDE,S],[L.STREAM_DATA_LOADER,S],[L.ELEVATION_QUERY,S],[L.TERRAIN_SURFACE,1],[L.SURFACE_GEOMETRY_UPDATES,1],[L.GRAPHICS_CORE,2],[L.I3S_CONTROLLER,2],[L.POINT_CLOUD_LAYER,2],[L.FEATURE_TILE_FETCHER,2],[L.OVERLAY,4],[L.STAGE,4],[L.GRAPHICS_DECONFLICTOR,4],[L.FILTER_VISIBILITY,4],[L.SCALE_VISIBILITY,4],[L.FRUSTUM_VISIBILITY,4],[L.POINT_OF_INTEREST_FREQUENT,6],[L.POINT_OF_INTEREST_INFREQUENT,30],[L.LABELER,8],[L.FEATURE_QUERY_ENGINE,8],[L.FEATURE_TILE_TREE,16],[L.FEATURE_TILE_TREE_ACTIVE,S],[L.ELEVATION_ALIGNMENT,12],[L.TEXT_TEXTURE_ATLAS,12],[L.CLOUDS_GENERATOR,12],[L.TEXTURE_UNLOAD,12],[L.LINE_OF_SIGHT_TOOL,16],[L.LINE_OF_SIGHT_TOOL_INTERACTIVE,S],[L.SNAPPING,S],[L.SHADOW_ACCUMULATOR,30]]);function k(e){return b.has(e)?b.get(e):"number"==typeof e?e:1}var N;!function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(N||(N={}));const O=m(6.5),U=m(1),P=m(30),F=m(1e3/30),y=m(100),C=.9;var D,w;!function(r){let _=class extends t{constructor(e){super(e),this.updating=!0,this._microTaskQueued=!1,this.performanceInfo={total:new n("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=null,this._state=N.INTERACTING,this._tasks=new h,this._runQueue=new h,this._load=0,this._idleStateCallbacks=new h,this._idleUpdatesStartFired=!1,this._maxReschedule=M,this._forceTask=!1,this._debug=!1,this._debugHandle=E((()=>R.SCHEDULER_LOG_SLOW_TASKS),(e=>this._debug=e),c),this._budget=new l(e.nowFunc);for(const r of Object.keys(L))this.performanceInfo.tasks.set(L[r],new n(L[r]));let t;const s=this;this._test={get state(){return i(t,s._state)},set state(e){t=e},FRAME_SAFETY_BUDGET:O,INTERACTING_BUDGET:F,IDLE_BUDGET:y,get budget(){return s._budget.budget},usedBudget:0,setBudget:e=>s._budget=e,updateTask:e=>this._updateTask(e),getState:e=>this._getState(e),getRuntime:e=>this._getRuntime(e),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}destroy(){this._tasks.toArray().forEach((e=>e.remove())),this._tasks.clear(),a(this._debugHandle),this._microTaskQueued=!1,this.updating=!1}activate(){this._budget.done||this._microTaskQueued||(this._microTaskQueued=!0,queueMicrotask((()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.done||(this._maxReschedule=M,this._schedule(),this.frame()))})))}registerTask(e,t){const s=k(e),r=new d(this,e,t,s);return this._tasks.push(r),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new n(e)),r}registerIdleStateCallbacks(e,t){const s={idleBegin:e,idleEnd:t};this._idleStateCallbacks.push(s),this.state===N.IDLE&&this._idleUpdatesStartFired&&s.idleBegin();const r=this;return{remove:()=>this._removeIdleStateCallbacks(s),set idleBegin(e){r._idleUpdatesStartFired&&(s.idleEnd(),r._state===N.IDLE&&e()),s.idleBegin=e},set idleEnd(e){s.idleEnd=e}}}get now(){return this.nowFunc()}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==N.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll((e=>e.idleEnd()))))}get state(){return u(this._test.state)?this._state:this._test.state}updateBudget(e){this._test.usedBudget=0;let t=O,s=e.frameDuration,r=U;switch(this.state){case N.IDLE:t=m(0),s=m(Math.max(y,e.frameDuration)),r=P;break;case N.INTERACTING:s=m(Math.max(F,e.frameDuration));case N.ANIMATING:}return s=m(s-e.elapsedFrameTime-t),this.state!==N.IDLE&&s<U&&!this._forceTask?(this._forceTask=!0,!1):(s=m(Math.max(s,r)),this._budget.reset(s,this.state),this._maxReschedule=M,this._updateLoad(),this._schedule())}frame(){switch(this._forceTask=!1,this._microTaskQueued=!1,this.state){case N.IDLE:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll((e=>e.idleBegin()))),this._runIdle();break;case N.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset(m(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e)}_updateTask(e){this._tasks.forAll((t=>{t.name===e&&t.setPriority(e)}))}_getState(e){if(this._runQueue.some((t=>t.name===e)))return w.SCHEDULED;let t=w.IDLE;return this._tasks.forAll((s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t=w.READY:t!==w.READY&&(t=w.WAITING))})),t}_getRuntime(e){let t=0;return this._tasks.forAll((s=>{s.name===e&&(t+=s.runtime)})),t}_resetRuntimes(){this._tasks.forAll((e=>e.runtime=0))}_getRunning(){const e=new Map;if(this._tasks.forAll((t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)})),0===e.size)return null;let t="";return e.forEach(((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`})),t}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce(((e,t)=>t.needsUpdate?++e:e),0);this._load=this._load*C+e*(1-C)}_schedule(){if(this._maxReschedule<=0)return!1;for(this._runQueue.filterInPlace((e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1))),this._tasks.forAll((e=>{e.basePriority===S&&e.needsUpdate&&!this._runQueue.some((t=>t===e))&&this._runQueue.unshift(e)}));0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forAll((s=>{if(s.needsUpdate&&0!==s.schedulePriority&&s.basePriority!==S)if(e=!0,t=Math.max(t,s.basePriority),1===s.schedulePriority)s.schedulePriority=0,this._runQueue.push(s);else--s.schedulePriority})),!e)return this.updating=!1,!1;this._maxReschedule===M&&(this._maxReschedule=t),--this._maxReschedule}return this.updating=!0,!0}_run(){const e=this._budget.now();this._startFrameTaskTimes();do{for(;this._runQueue.length>0;){const s=this._budget.now(),r=this._runQueue.pop();this._budget.resetProgress();try{r.task.runTask(this._budget)}catch(t){A.error(`Exception in task "${r.name}"`,t)}r.schedulePriority=r.basePriority;const i=this._budget.now()-s;if(r.runtime+=i,this._frameTaskTimes.set(r.priority,this._frameTaskTimes.get(r.priority)+i),this._debug&&this._budget.elapsed>2*this._budget.budget&&console.log("Task",r.name,"used",this._budget.elapsed,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this.updating=this._tasks.some((e=>e.needsUpdate)),void this._recordFrameTaskTimes(this._budget.now()-e)}}while(this._schedule());this.updating=this._tasks.some((e=>e.needsUpdate)),this._recordFrameTaskTimes(this._budget.now()-e)}_startFrameTaskTimes(){for(const e of Object.keys(L))this._frameTaskTimes.set(L[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach(((e,t)=>this.performanceInfo.tasks.get(t).record(e))),this.performanceInfo.total.record(e)}get test(){return this._test}};e([I()],_.prototype,"updating",void 0),e([I()],_.prototype,"nowFunc",void 0),_=e([g("esri.views.support.Scheduler")],_),r.Scheduler=_;let d=class extends t{constructor(e,t,r,i){super({}),this._scheduler=e,this.name=t,this._basePriority=i,this.runtime=0,this._queue=new p,this._handles=new s,this.schedulePriority=this._basePriority,this.task=o(r)?r:this._queue,this._handles.add(T((()=>this.task.running),(()=>e.activate())))}get updating(){return this._queue.running}normalizeCtorArgs(){return{}}remove(){this.processQueue(G),this._scheduler.removeTask(this),this.schedule=Q.schedule,this.reschedule=Q.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){this.name=e;const t=k(e);this._basePriority!==S&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,t,s){return this._queue.push(e,t,s)}reschedule(e,t,s){return this._queue.unshift(e,t,s)}processQueue(e){this._queue.runTask(e)}};e([I({constructOnly:!0})],d.prototype,"task",void 0),e([I({readOnly:!0})],d.prototype,"updating",null),d=e([g("esri.views.support.SchedulerTask")],d);class l{constructor(e){this.now=e,this._begin=0,this._budget=0,this._state=N.IDLE,this._didWork=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&(this._didWork=!0),!0)}get done(){return this._didWork&&this.elapsed>=this._budget&&this._enabled}get budget(){return this._budget}madeProgress(){this._didWork=!0}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,t){this._begin=this.now(),this._budget=e,this._state=t,this._didWork=!1}get remaining(){return Math.max(this._budget-this.elapsed,0)}get elapsed(){return this.now()-this._begin}resetProgress(){this._didWork=!1}get hasProgressed(){return this._didWork}}r.Budget=l}(D||(D={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i"}(w||(w={}));const G=(()=>{const e=new D.Budget((()=>performance.now()));return e.enabled=!1,e})();class v{remove(){}processQueue(){}schedule(e,t,s){try{if(_(t)){const e=d();return s?Promise.resolve(s(e)):Promise.reject(e)}return l(e(G))}catch(r){return Promise.reject(r)}}reschedule(e,t,s){return this.schedule(e,t,s)}}const Q=new v,M=Number.MAX_SAFE_INTEGER;export{Q as ImmediateTask,N as State,L as TaskPriority,w as TaskState,k as getTaskPriority,f as newScheduler,G as noBudget,b as taskPriorities};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import s from"../../core/Handles.js";import r from"../../core/Logger.js";import{unwrapOr as i,removeMaybe as a,isNone as u,isSome as n}from"../../core/maybe.js";import o from"../../core/PerformanceSampler.js";import h from"../../core/PooledArray.js";import{isAborted as _,createAbortError as d,when as l}from"../../core/promiseUtils.js";import{watch as E,initial as c,when as T}from"../../core/reactiveUtils.js";import{Milliseconds as m}from"../../core/time.js";import{property as I}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{PromiseQueue as p}from"../../layers/support/PromiseQueue.js";import R from"./debugFlags.js";const A=r.getLogger("esri.views.support.Scheduler");function f(e){return new D.Scheduler({nowFunc:e})}var L;!function(e){e.RESOURCE_CONTROLLER="schedule",e.SLIDE="slide",e.STREAM_DATA_LOADER="stream loader",e.ELEVATION_QUERY="elevation query",e.TERRAIN_SURFACE="terrain",e.SURFACE_GEOMETRY_UPDATES="surface geometry updates",e.GRAPHICS_CORE="Graphics3D",e.I3S_CONTROLLER="I3S",e.POINT_CLOUD_LAYER="point cloud",e.FEATURE_TILE_FETCHER="feature fetcher",e.OVERLAY="overlay",e.STAGE="stage",e.GRAPHICS_DECONFLICTOR="graphics deconflictor",e.FILTER_VISIBILITY="Graphics3D filter visibility",e.SCALE_VISIBILITY="Graphics3D scale visibility",e.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",e.POINT_OF_INTEREST_FREQUENT="POI frequent",e.POINT_OF_INTEREST_INFREQUENT="POI infrequent",e.LABELER="labeler",e.FEATURE_QUERY_ENGINE="feature query",e.FEATURE_TILE_TREE="feature tile tree",e.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",e.ELEVATION_ALIGNMENT="elevation alignment",e.TEXT_TEXTURE_ATLAS="text texture atlas",e.TEXTURE_UNLOAD="texture unload",e.LINE_OF_SIGHT_TOOL="line of sight tool",e.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",e.ELEVATION_PROFILE="elevation profile",e.SNAPPING="snapping",e.SHADOW_ACCUMULATOR="shadow accumulator",e.CLOUDS_GENERATOR="cloud generator",e[e.TEST_PRIO=1]="TEST_PRIO"}(L||(L={}));const S=0,b=new Map([[L.RESOURCE_CONTROLLER,S],[L.SLIDE,S],[L.STREAM_DATA_LOADER,S],[L.ELEVATION_QUERY,S],[L.TERRAIN_SURFACE,1],[L.SURFACE_GEOMETRY_UPDATES,1],[L.GRAPHICS_CORE,2],[L.I3S_CONTROLLER,2],[L.POINT_CLOUD_LAYER,2],[L.FEATURE_TILE_FETCHER,2],[L.OVERLAY,4],[L.STAGE,4],[L.GRAPHICS_DECONFLICTOR,4],[L.FILTER_VISIBILITY,4],[L.SCALE_VISIBILITY,4],[L.FRUSTUM_VISIBILITY,4],[L.POINT_OF_INTEREST_FREQUENT,6],[L.POINT_OF_INTEREST_INFREQUENT,30],[L.LABELER,8],[L.FEATURE_QUERY_ENGINE,8],[L.FEATURE_TILE_TREE,16],[L.FEATURE_TILE_TREE_ACTIVE,S],[L.ELEVATION_ALIGNMENT,12],[L.TEXT_TEXTURE_ATLAS,12],[L.CLOUDS_GENERATOR,12],[L.TEXTURE_UNLOAD,12],[L.LINE_OF_SIGHT_TOOL,16],[L.LINE_OF_SIGHT_TOOL_INTERACTIVE,S],[L.SNAPPING,S],[L.SHADOW_ACCUMULATOR,30]]);function k(e){return b.has(e)?b.get(e):"number"==typeof e?e:1}var N;!function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(N||(N={}));const O=m(6.5),U=m(1),P=m(30),F=m(1e3/30),y=m(100),C=.9;var D,w;!function(r){let _=class extends t{constructor(e){super(e),this.updating=!0,this._microTaskQueued=!1,this.performanceInfo={total:new o("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=null,this._state=N.INTERACTING,this._tasks=new h,this._runQueue=new h,this._load=0,this._idleStateCallbacks=new h,this._idleUpdatesStartFired=!1,this._maxReschedule=M,this._forceTask=!1,this._debug=!1,this._debugHandle=E((()=>R.SCHEDULER_LOG_SLOW_TASKS),(e=>this._debug=e),c),this._budget=new l(e.nowFunc);for(const r of Object.keys(L))this.performanceInfo.tasks.set(L[r],new o(L[r]));let t;const s=this;this._test={get state(){return i(t,s._state)},set state(e){t=e},FRAME_SAFETY_BUDGET:O,INTERACTING_BUDGET:F,IDLE_BUDGET:y,get budget(){return s._budget.budget},usedBudget:0,setBudget:e=>s._budget=e,updateTask:e=>this._updateTask(e),getState:e=>this._getState(e),getRuntime:e=>this._getRuntime(e),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}destroy(){this._tasks.toArray().forEach((e=>e.remove())),this._tasks.clear(),a(this._debugHandle),this._microTaskQueued=!1,this.updating=!1}activate(){this._budget.done||this._microTaskQueued||(this._microTaskQueued=!0,queueMicrotask((()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.done||(this._maxReschedule=M,this._schedule(),this.frame()))})))}registerTask(e,t){const s=k(e),r=new d(this,e,t,s);return this._tasks.push(r),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new o(e)),r}registerIdleStateCallbacks(e,t){const s={idleBegin:e,idleEnd:t};this._idleStateCallbacks.push(s),this.state===N.IDLE&&this._idleUpdatesStartFired&&s.idleBegin();const r=this;return{remove:()=>this._removeIdleStateCallbacks(s),set idleBegin(e){r._idleUpdatesStartFired&&(s.idleEnd(),r._state===N.IDLE&&e()),s.idleBegin=e},set idleEnd(e){s.idleEnd=e}}}get now(){return this.nowFunc()}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==N.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll((e=>e.idleEnd()))))}get state(){return u(this._test.state)?this._state:this._test.state}updateBudget(e){this._test.usedBudget=0;let t=O,s=e.frameDuration,r=U;switch(this.state){case N.IDLE:t=m(0),s=m(Math.max(y,e.frameDuration)),r=P;break;case N.INTERACTING:s=m(Math.max(F,e.frameDuration));case N.ANIMATING:}return s=m(s-e.elapsedFrameTime-t),this.state!==N.IDLE&&s<U&&!this._forceTask?(this._forceTask=!0,!1):(s=m(Math.max(s,r)),this._budget.reset(s,this.state),this._maxReschedule=M,this._updateLoad(),this._schedule())}frame(){switch(this._forceTask=!1,this._microTaskQueued=!1,this.state){case N.IDLE:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll((e=>e.idleBegin()))),this._runIdle();break;case N.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset(m(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e)}_updateTask(e){this._tasks.forAll((t=>{t.name===e&&t.setPriority(e)}))}_getState(e){if(this._runQueue.some((t=>t.name===e)))return w.SCHEDULED;let t=w.IDLE;return this._tasks.forAll((s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t=w.READY:t!==w.READY&&(t=w.WAITING))})),t}_getRuntime(e){let t=0;return this._tasks.forAll((s=>{s.name===e&&(t+=s.runtime)})),t}_resetRuntimes(){this._tasks.forAll((e=>e.runtime=0))}_getRunning(){const e=new Map;if(this._tasks.forAll((t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)})),0===e.size)return null;let t="";return e.forEach(((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`})),t}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce(((e,t)=>t.needsUpdate?++e:e),0);this._load=this._load*C+e*(1-C)}_schedule(){if(this._maxReschedule<=0)return!1;for(this._runQueue.filterInPlace((e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1))),this._tasks.forAll((e=>{e.basePriority===S&&e.needsUpdate&&!this._runQueue.includes(e)&&this._runQueue.unshift(e)}));0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forAll((s=>{if(s.needsUpdate&&0!==s.schedulePriority&&s.basePriority!==S)if(e=!0,t=Math.max(t,s.basePriority),1===s.schedulePriority)s.schedulePriority=0,this._runQueue.push(s);else--s.schedulePriority})),!e)return this.updating=!1,!1;this._maxReschedule===M&&(this._maxReschedule=t),--this._maxReschedule}return this.updating=!0,!0}_run(){const e=this._budget.now();this._startFrameTaskTimes();do{for(;this._runQueue.length>0;){const s=this._budget.now(),r=this._runQueue.pop();this._budget.resetProgress();try{r.task.runTask(this._budget)}catch(t){A.error(`Exception in task "${r.name}"`,t)}r.schedulePriority=r.basePriority;const i=this._budget.now()-s;if(r.runtime+=i,this._frameTaskTimes.set(r.priority,this._frameTaskTimes.get(r.priority)+i),this._debug&&this._budget.elapsed>2*this._budget.budget&&console.log("Task",r.name,"used",this._budget.elapsed,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this.updating=this._tasks.some((e=>e.needsUpdate)),void this._recordFrameTaskTimes(this._budget.now()-e)}}while(this._schedule());this.updating=this._tasks.some((e=>e.needsUpdate)),this._recordFrameTaskTimes(this._budget.now()-e)}_startFrameTaskTimes(){for(const e of Object.keys(L))this._frameTaskTimes.set(L[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach(((e,t)=>this.performanceInfo.tasks.get(t).record(e))),this.performanceInfo.total.record(e)}get test(){return this._test}};e([I()],_.prototype,"updating",void 0),e([I()],_.prototype,"nowFunc",void 0),_=e([g("esri.views.support.Scheduler")],_),r.Scheduler=_;let d=class extends t{constructor(e,t,r,i){super({}),this._scheduler=e,this.name=t,this._basePriority=i,this.runtime=0,this._queue=new p,this._handles=new s,this.schedulePriority=this._basePriority,this.task=n(r)?r:this._queue,this._handles.add(T((()=>this.task.running),(()=>e.activate())))}get updating(){return this._queue.running}normalizeCtorArgs(){return{}}remove(){this.processQueue(G),this._scheduler.removeTask(this),this.schedule=Q.schedule,this.reschedule=Q.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){this.name=e;const t=k(e);this._basePriority!==S&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,t,s){return this._queue.push(e,t,s)}reschedule(e,t,s){return this._queue.unshift(e,t,s)}processQueue(e){this._queue.runTask(e)}};e([I({constructOnly:!0})],d.prototype,"task",void 0),e([I({readOnly:!0})],d.prototype,"updating",null),d=e([g("esri.views.support.SchedulerTask")],d);class l{constructor(e){this.now=e,this._begin=0,this._budget=0,this._state=N.IDLE,this._didWork=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&(this._didWork=!0),!0)}get done(){return this._didWork&&this.elapsed>=this._budget&&this._enabled}get budget(){return this._budget}madeProgress(){this._didWork=!0}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,t){this._begin=this.now(),this._budget=e,this._state=t,this._didWork=!1}get remaining(){return Math.max(this._budget-this.elapsed,0)}get elapsed(){return this.now()-this._begin}resetProgress(){this._didWork=!1}get hasProgressed(){return this._didWork}}r.Budget=l}(D||(D={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i"}(w||(w={}));const G=(()=>{const e=new D.Budget((()=>performance.now()));return e.enabled=!1,e})();class v{remove(){}processQueue(){}schedule(e,t,s){try{if(_(t)){const e=d();return s?Promise.resolve(s(e)):Promise.reject(e)}return l(e(G))}catch(r){return Promise.reject(r)}}reschedule(e,t,s){return this.schedule(e,t,s)}}const Q=new v,M=Number.MAX_SAFE_INTEGER;export{Q as ImmediateTask,N as State,L as TaskPriority,w as TaskState,k as getTaskPriority,f as newScheduler,G as noBudget,b as taskPriorities};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import{clamp as t}from"../../core/mathUtils.js";const i=2048,h=1.5,e=8;function n(i,h){const{format:e,quality:n,rotation:o,disableDecorations:a}=i||{},r=j(i,h.padding),l=y(i,{width:h.width-r.left-r.right,height:h.height-r.top-r.bottom}),{width:g,height:f}=p(i,l),u=D(e),d=v[u];return{format:u,quality:t(null!=n?n:d,0,100),area:l,width:g,height:f,rotation:o,disableDecorations:!!a,ignoreBackground:!(!i||!i.ignoreBackground),ignorePadding:!(!i||!i.ignorePadding)}}function o(t,i){const h=n(t,i),e=h.area,o=h.width/e.width,a=j(h,i.padding),r=a.left+a.right,l=a.top+a.bottom,g=i.width-r,f=i.height-l,u=Math.floor(g*o+r),d=Math.floor(f*o+l),c=t&&t.layers?t.layers:[],s=h.ignoreBackground,w=h.ignorePadding;return{framebufferWidth:u,framebufferHeight:d,region:{x:Math.floor(e.x*o)+a.left,y:Math.floor(e.y*o)+a.top,width:h.width,height:h.height},format:h.format,quality:h.quality,rotation:h.rotation,pixelRatio:o,layers:c,disableDecorations:h.disableDecorations,ignoreBackground:s,ignorePadding:w}}function a(t,i,h,e){e.premultipliedAlpha&&I(t),h.width=t.width,h.height=t.height;const n=h.getContext("2d");n.putImageData(t,0,0),e.flipY&&q(n);const o=n.getImageData(0,0,t.width,t.height),a=r(h,i);return h.width=0,h.height=0,{dataUrl:a,data:o}}function r(t,i){const h=C[i.format],e=i.quality/100;return t.toDataURL(h,e)}function l(i,h){const e=D(i),n=v[e];return{format:e,quality:t(null!=h?h:n,0,100)}}function g(t,i){return i/Math.max(t[0],t[1])}function f(t,i,h){if(!t||!i)throw new Error("Cannot construct image data without dimensions");if(m)try{return new ImageData(t,i)}catch(e){m=!1}return s(t,i,h)}function u(t,i,h,e){if(!i||!h)throw new Error("Cannot construct image data without dimensions");if(m)try{return new ImageData(t,i,h)}catch(o){m=!1}const n=s(i,h,e);return n.data.set(t,0),n}function d(t,i,h,e=0,n=0,o=t.width-e,a=t.height-n,r=!1){const{data:l}=t,{width:g,height:f,data:u}=i,d=o/g,c=a/f,s=Math.ceil(d/2),w=Math.ceil(c/2),m=t.width;for(let M=0;M<f;M++)for(let t=0;t<g;t++){const i=4*(t+(r?f-M-1:M)*g);let o=0,a=0,p=0,y=0,x=0,b=0;const j=(M+.5)*c;for(let r=Math.floor(M*c);r<(M+1)*c;r++){const i=Math.abs(j-(r+.5))/w,g=(t+.5)*d,f=i*i;for(let u=Math.floor(t*d);u<(t+1)*d;u++){const t=Math.abs(g-(u+.5))/s,i=Math.sqrt(f+t*t);if(i>=1)continue;let d=2*i*i*i-3*i*i+1;const c=4*(e+u+(n+r)*m);b+=d*l[c+3],a+=d,!h&&l[c+3]<255&&(d=d*l[c+3]/255),p+=d*l[c],y+=d*l[c+1],x+=d*l[c+2],o+=d}}u[i]=p/o,u[i+1]=y/o,u[i+2]=x/o,u[i+3]=b/a}return i}function c(t,n,o){if(!n)return t;const{framebufferWidth:a,framebufferHeight:r,pixelRatio:l,region:g}=t,f=j(t,o),u=f.left+f.right,d=f.top+f.bottom,c=a-u,s=r-d,w=Math.min(e,Math.min((i-u)/c,(i-d)/s));return w<h?t:{...t,framebufferWidth:Math.round(c*w)+u,framebufferHeight:Math.round(s*w)+d,pixelRatio:l*w,resample:{region:{x:Math.round((g.x-f.left)*w)+f.left,y:Math.round((g.y-f.top)*w)+f.top,width:Math.round(g.width*w),height:Math.round(g.height*w)},width:a,height:r}}}function s(t,i,h){return h||(h=M()),h.getContext("2d").createImageData(t,i)}let w=null,m=!0;function M(){return w||(w=document.createElement("canvas"),w.width=1,w.height=1),w}function p(t,i){if(!t)return i;const h=t.width,e=t.height;if(null!=h&&null!=e)return{width:Math.floor(h),height:Math.floor(e)};if(null==h&&null==e)return i;const n=i.width/i.height;return null==e?{width:Math.floor(h),height:Math.floor(h/n)}:{width:Math.floor(e*n),height:Math.floor(e)}}function y(t,i){const h={x:0,y:0,width:i.width,height:i.height};if(t&&t.area){null!=t.area.x&&(h.x=Math.floor(t.area.x)),null!=t.area.y&&(h.y=Math.floor(t.area.y));const e=null!=t.area.width?Math.floor(t.area.width):null,n=null!=t.area.height?Math.floor(t.area.height):null;if(h.width=i.width-h.x,h.height=i.height-h.y,null!=e&&null!=n)h.width=Math.min(h.width,e),h.height=Math.min(h.height,n);else if(null==e&&null!=n){const t=Math.min(h.width,e);h.height=t/h.width*h.height,h.width=t}else if(null!=e&&null==n){const t=Math.min(h.height,n);h.width=t/h.height*h.width,h.height=t}}return x(b(h,t),i)}function x(t,i){const h=Math.floor(Math.max(t.x,0)),e=Math.floor(Math.max(t.y,0)),n={x:h,y:e,width:Math.floor(Math.min(t.width,i.width-h)),height:Math.floor(Math.min(t.height,i.height-e))},o=n.width/n.height,a=t.width/t.height;if(a===o)return n;if(a>o){const t=Math.floor(n.width/a),i=n.height-t;return{x:n.x,y:Math.floor(n.y+i/2),width:n.width,height:t}}const r=Math.floor(n.height*a),l=n.width-r;return{x:Math.floor(n.x+l/2),y:n.y,width:r,height:n.height}}function b(t,i){if(!i||null==i.width||null==i.height)return t;const h=i.width/i.height,e=t.width/t.height;if(e===h)return t;if(e<h){const i=Math.floor(t.height*h);return t.x-=(i-t.width)/2,t.width=i,t}const n=Math.floor(t.width/h);return t.y-=(n-t.height)/2,t.height=n,t}function j(t,i){return!i||t&&t.ignorePadding?B:i}function D(t){switch(t){case"png":case"jpg":case"jpeg":return t;default:return k}}function q(t){t.save(),t.globalCompositeOperation="copy",t.scale(1,-1),t.translate(0,-t.canvas.height),t.drawImage(t.canvas,0,0),t.restore()}function I(t){const i=t.data,h=i.length;for(let e=0;e<h;e+=4){const t=i[e+3];if(t>0){const h=t/255;i[e+0]=i[e+0]/h,i[e+1]=i[e+1]/h,i[e+2]=i[e+2]/h}}}const C={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},P=98,k="png",v={png:100,jpg:P,jpeg:P},B={top:0,right:0,bottom:0,left:0};export{n as completeUserSettings,f as createEmptyImageData,a as encodeResult,l as getFormatAndQuality,g as getMaximumResolutionScale,d as resampleHermite,c as screenshotSuperSampleSettings,r as toDataUrl,o as toRenderSettings,u as wrapImageData};
5
+ import"../../core/has.js";import{clamp as t}from"../../core/mathUtils.js";const i=2048,h=1.5,e=8;function n(i,h){const{format:e,quality:n,rotation:o,disableDecorations:a}=i||{},r=j(i,h.padding),l=y(i,{width:h.width-r.left-r.right,height:h.height-r.top-r.bottom}),{width:g,height:f}=p(i,l),u=D(e),d=v[u];return{format:u,quality:t(null!=n?n:d,0,100),area:l,width:g,height:f,rotation:o,disableDecorations:!!a,ignoreBackground:!(!i||!i.ignoreBackground),ignorePadding:!(!i||!i.ignorePadding)}}function o(t,i){const h=n(t,i),e=h.area,o=h.width/e.width,a=j(h,i.padding),r=a.left+a.right,l=a.top+a.bottom,g=i.width-r,f=i.height-l,u=Math.floor(g*o+r),d=Math.floor(f*o+l),c=t&&t.layers?t.layers:[],s=h.ignoreBackground,w=h.ignorePadding;return{framebufferWidth:u,framebufferHeight:d,region:{x:Math.floor(e.x*o)+a.left,y:Math.floor(e.y*o)+a.top,width:h.width,height:h.height},format:h.format,quality:h.quality,rotation:h.rotation,pixelRatio:o,layers:c,disableDecorations:h.disableDecorations,ignoreBackground:s,ignorePadding:w}}function a(t,i,h,e){e.premultipliedAlpha&&I(t),h.width=t.width,h.height=t.height;const n=h.getContext("2d");n.putImageData(t,0,0),e.flipY&&q(n);const o=n.getImageData(0,0,t.width,t.height),a=r(h,i);return h.width=0,h.height=0,{dataUrl:a,data:o}}function r(t,i){const h=C[i.format],e=i.quality/100;return t.toDataURL(h,e)}function l(i,h){const e=D(i),n=v[e];return{format:e,quality:t(null!=h?h:n,0,100)}}function g(t,i){return i/Math.max(t[0],t[1])}function f(t,i,h){if(!t||!i)throw new Error("Cannot construct image data without dimensions");if(m)try{return new ImageData(t,i)}catch(e){m=!1}return s(t,i,h)}function u(t,i,h,e){if(!i||!h)throw new Error("Cannot construct image data without dimensions");if(m)try{return new ImageData(t,i,h)}catch(o){m=!1}const n=s(i,h,e);return n.data.set(t,0),n}function d(t,i,h,e=0,n=0,o=t.width-e,a=t.height-n,r=!1){const{data:l}=t,{width:g,height:f,data:u}=i,d=o/g,c=a/f,s=Math.ceil(d/2),w=Math.ceil(c/2),m=t.width;for(let M=0;M<f;M++)for(let t=0;t<g;t++){const i=4*(t+(r?f-M-1:M)*g);let o=0,a=0,p=0,y=0,x=0,b=0;const j=(M+.5)*c;for(let r=Math.floor(M*c);r<(M+1)*c;r++){const i=Math.abs(j-(r+.5))/w,g=(t+.5)*d,f=i*i;for(let u=Math.floor(t*d);u<(t+1)*d;u++){const t=Math.abs(g-(u+.5))/s,i=Math.sqrt(f+t*t);if(i>=1)continue;let d=2*i*i*i-3*i*i+1;const c=4*(e+u+(n+r)*m);b+=d*l[c+3],a+=d,!h&&l[c+3]<255&&(d=d*l[c+3]/255),p+=d*l[c],y+=d*l[c+1],x+=d*l[c+2],o+=d}}u[i]=p/o,u[i+1]=y/o,u[i+2]=x/o,u[i+3]=b/a}return i}function c(t,n,o){if(!n)return t;const{framebufferWidth:a,framebufferHeight:r,pixelRatio:l,region:g}=t,f=j(t,o),u=f.left+f.right,d=f.top+f.bottom,c=a-u,s=r-d,w=Math.min(e,Math.min((i-u)/c,(i-d)/s));return w<h?t:{...t,framebufferWidth:Math.round(c*w)+u,framebufferHeight:Math.round(s*w)+d,pixelRatio:l*w,resample:{region:{x:Math.round((g.x-f.left)*w)+f.left,y:Math.round((g.y-f.top)*w)+f.top,width:Math.round(g.width*w),height:Math.round(g.height*w)},width:a,height:r}}}function s(t,i,h){return h||(h=M()),h.getContext("2d").createImageData(t,i)}let w=null,m=!0;function M(){return w||(w=document.createElement("canvas"),w.width=1,w.height=1),w}function p(t,i){if(!t)return i;const h=t.width,e=t.height;if(null!=h&&null!=e)return{width:Math.floor(h),height:Math.floor(e)};if(null==h&&null==e)return i;const n=i.width/i.height;return null==e?{width:Math.floor(h),height:Math.floor(h/n)}:{width:Math.floor(e*n),height:Math.floor(e)}}function y(t,i){const h={x:0,y:0,width:i.width,height:i.height};if(t&&t.area){null!=t.area.x&&(h.x=Math.floor(t.area.x)),null!=t.area.y&&(h.y=Math.floor(t.area.y));const e=null!=t.area.width?Math.floor(t.area.width):null,n=null!=t.area.height?Math.floor(t.area.height):null;if(h.width=i.width-h.x,h.height=i.height-h.y,null!=e&&null!=n)h.width=Math.min(h.width,e),h.height=Math.min(h.height,n);else if(null==e&&null!=n){const t=Math.min(h.width,e);h.height=t/h.width*h.height,h.width=t}else if(null!=e&&null==n){const t=Math.min(h.height,n);h.width=t/h.height*h.width,h.height=t}}return x(b(h,t),i)}function x(t,i){const h=Math.floor(Math.max(t.x,0)),e=Math.floor(Math.max(t.y,0)),n={x:h,y:e,width:Math.floor(Math.min(t.width,i.width-h)),height:Math.floor(Math.min(t.height,i.height-e))},o=n.width/n.height,a=t.width/t.height;if(a===o)return n;if(a>o){const t=Math.floor(n.width/a),i=n.height-t;return{x:n.x,y:Math.floor(n.y+i/2),width:n.width,height:t}}const r=Math.floor(n.height*a),l=n.width-r;return{x:Math.floor(n.x+l/2),y:n.y,width:r,height:n.height}}function b(t,i){if(!i||null==i.width||null==i.height)return t;const h=i.width/i.height,e=t.width/t.height;if(e===h)return t;if(e<h){const i=Math.floor(t.height*h);return t.x-=(i-t.width)/2,t.width=i,t}const n=Math.floor(t.width/h);return t.y-=(n-t.height)/2,t.height=n,t}function j(t,i){return!i||t&&t.ignorePadding?B:i}function D(t){switch(t){case"png":case"jpg":case"jpeg":return t;default:return k}}function q(t){t.save(),t.globalCompositeOperation="copy",t.scale(1,-1),t.translate(0,-t.canvas.height),t.drawImage(t.canvas,0,0),t.restore()}function I(t){const i=t.data,h=i.length;for(let e=0;e<h;e+=4){const t=i[e+3];if(255!==t&&t>0){const h=255/t;i[e+0]=i[e+0]*h,i[e+1]=i[e+1]*h,i[e+2]=i[e+2]*h}}}const C={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},P=98,k="png",v={png:100,jpg:P,jpeg:P},B={top:0,right:0,bottom:0,left:0};export{n as completeUserSettings,f as createEmptyImageData,a as encodeResult,l as getFormatAndQuality,g as getMaximumResolutionScale,d as resampleHermite,c as screenshotSuperSampleSettings,r as toDataUrl,o as toRenderSettings,u as wrapImageData};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import"../../core/has.js";import o from"../../core/Logger.js";import{watch as e,initial as i}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/accessorSupport/ensureType.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import n from"./Component.js";import a from"./UI.js";import d from"../../widgets/Attribution.js";import p from"../../widgets/Compass.js";import c from"../../widgets/NavigationToggle.js";import m from"../../widgets/Zoom.js";const h="esri.views.ui.DefaultUI";function g(t){return t&&void 0!==t.view}o.getLogger(h);let u=class extends a{constructor(t){super(t),this._defaultPositionLookup={attribution:"manual",compass:"top-leading","navigation-toggle":"top-leading",zoom:"top-leading"},this.components=[]}initialize(){this._handles.add([e((()=>this.components),this._componentsWatcher.bind(this),i),e((()=>this.view),this._updateViewAwareWidgets.bind(this),i)])}_add(t,o,e,i){if("string"==typeof t&&this._defaultPositionLookup[t]){if(this._find(t))return;t=this._createComponent(t)}super._add(t,o,e,i)}_removeComponents(t){t.forEach((t=>{const o=this._find(t);o&&(this.remove(o),o.destroy())}))}_updateViewAwareWidgets(t){this.components.forEach((o=>{const e=this._find(o),i=e&&e.widget;g(i)&&(i.view=t)}))}_componentsWatcher(t,o){this._removeComponents(o),this._addComponents(t),this._adjustPadding(t)}_adjustPadding(t){if(-1===t.indexOf("attribution")&&!this._isOverridden("padding")){const{top:t}=this.padding;this.padding=t}}_addComponents(t){this.initialized&&t.forEach((t=>this.add(this._createComponent(t),this._defaultPositionLookup[t])))}_createComponent(t){const o=this._createWidget(t);if(o)return new n({id:t,node:o})}_createWidget(t){return"attribution"===t?this._createAttribution():"compass"===t?this._createCompass():"navigation-toggle"===t?this._createNavigationToggle():"zoom"===t?this._createZoom():void 0}_createAttribution(){return new d({view:this.view})}_createCompass(){return new p({view:this.view})}_createNavigationToggle(){return new c({view:this.view})}_createZoom(){return new m({view:this.view})}};t([s()],u.prototype,"components",void 0),u=t([r(h)],u);const _=u;export{_ as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import"../../core/has.js";import o from"../../core/Logger.js";import{watch as e,initial as i}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/accessorSupport/ensureType.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import n from"./Component.js";import a from"./UI.js";import d from"../../widgets/Attribution.js";import p from"../../widgets/Compass.js";import c from"../../widgets/NavigationToggle.js";import m from"../../widgets/Zoom.js";const h="esri.views.ui.DefaultUI";function u(t){return t&&void 0!==t.view}o.getLogger(h);let g=class extends a{constructor(t){super(t),this._defaultPositionLookup={attribution:"manual",compass:"top-leading","navigation-toggle":"top-leading",zoom:"top-leading"},this.components=[]}initialize(){this._handles.add([e((()=>this.components),this._componentsWatcher.bind(this),i),e((()=>this.view),this._updateViewAwareWidgets.bind(this),i)])}_add(t,o,e,i){if("string"==typeof t&&this._defaultPositionLookup[t]){if(this._find(t))return;t=this._createComponent(t)}super._add(t,o,e,i)}_removeComponents(t){t.forEach((t=>{const o=this._find(t);o&&(this.remove(o),o.destroy())}))}_updateViewAwareWidgets(t){this.components.forEach((o=>{const e=this._find(o),i=e&&e.widget;u(i)&&(i.view=t)}))}_componentsWatcher(t,o){this._removeComponents(o),this._addComponents(t),this._adjustPadding(t)}_adjustPadding(t){if(!t.includes("attribution")&&!this._isOverridden("padding")){const{top:t}=this.padding;this.padding=t}}_addComponents(t){this.initialized&&t.forEach((t=>this.add(this._createComponent(t),this._defaultPositionLookup[t])))}_createComponent(t){const o=this._createWidget(t);if(o)return new n({id:t,node:o})}_createWidget(t){return"attribution"===t?this._createAttribution():"compass"===t?this._createCompass():"navigation-toggle"===t?this._createNavigationToggle():"zoom"===t?this._createZoom():void 0}_createAttribution(){return new d({view:this.view})}_createCompass(){return new p({view:this.view})}_createNavigationToggle(){return new c({view:this.view})}_createZoom(){return new m({view:this.view})}};t([s()],g.prototype,"components",void 0),g=t([r(h)],g);const _=g;export{_ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import{isSome as e}from"../../core/maybe.js";import{ShaderType as t}from"./enums.js";import r from"./reservedWordsGLSL3.js";var a,o={exports:{}};void 0!==(a=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"])&&(o.exports=a);const n=o.exports;var i,l={exports:{}};i=l,function(e){var t=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];void 0!==t&&(i.exports=t)}();const s=l.exports;var c={exports:{}};!function(e){!function(t){var r=function(){return["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]}();void 0!==r&&(e.exports=r)}()}(c);const d=c.exports;var u=999,g=9999,p=0,f=1,_=2,h=3,x=4,m=5,y=6,w=7,M=8,v=9,T=10,b=11,P=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function E(){var e,t,r,a=0,o=0,i=u,l=[],c=[],E=1,C=0,k=0,D=!1,j=!1,F="";return function(e){return c=[],null!==e?S(e.replace?e.replace(/\r\n/g,"\n"):e):R()};function L(e){e.length&&c.push({type:P[i],data:e,position:k,line:E,column:C})}function S(t){var n;for(a=0,r=(F+=t).length;e=F[a],a<r;){switch(n=a,i){case p:a=I();break;case f:a=G();break;case _:a=A();break;case h:a=O();break;case x:a=H();break;case b:a=B();break;case m:a=N();break;case g:a=U();break;case v:a=X();break;case u:a=V()}if(n!==a)if("\n"===F[n])C=0,++E;else++C}return o+=a,F=F.slice(a),c}function R(e){return l.length&&L(l.join("")),i=T,L("(eof)"),c}function V(){return l=l.length?[]:l,"/"===t&&"*"===e?(k=o+a-1,i=p,t=e,a+1):"/"===t&&"/"===e?(k=o+a-1,i=f,t=e,a+1):"#"===e?(i=_,k=o+a,a):/\s/.test(e)?(i=v,k=o+a,a):(D=/\d/.test(e),j=/[^\w_]/.test(e),k=o+a,i=D?x:j?h:g,a)}function X(){return/[^\s]/g.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function A(){return"\r"!==e&&"\n"!==e||"\\"===t?(l.push(e),t=e,a+1):(L(l.join("")),i=u,a)}function G(){return A()}function I(){return"/"===e&&"*"===t?(l.push(e),L(l.join("")),i=u,a+1):(l.push(e),t=e,a+1)}function O(){if("."===t&&/\d/.test(e))return i=m,a;if("/"===t&&"*"===e)return i=p,a;if("/"===t&&"/"===e)return i=f,a;if("."===e&&l.length){for(;q(l););return i=m,a}if(";"===e||")"===e||"("===e){if(l.length)for(;q(l););return L(e),i=u,a+1}var r=2===l.length&&"="!==e;if(/[\w_\d\s]/.test(e)||r){for(;q(l););return i=u,a}return l.push(e),t=e,a+1}function q(e){for(var t,r,a=0;;){if(t=s.indexOf(e.slice(0,e.length+a).join("")),r=s[t],-1===t){if(a--+e.length>0)continue;r=e.slice(0,1).join("")}return L(r),k+=r.length,(l=l.slice(r.length)).length}}function B(){return/[^a-fA-F0-9]/.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function H(){return"."===e||/[eE]/.test(e)?(l.push(e),i=m,t=e,a+1):"x"===e&&1===l.length&&"0"===l[0]?(i=b,l.push(e),t=e,a+1):/[^\d]/.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function N(){return"f"===e&&(l.push(e),t=e,a+=1),/[eE]/.test(e)||"-"===e&&/[eE]/.test(t)?(l.push(e),t=e,a+1):/[^\d]/.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function U(){if(/[^\d\w_]/.test(e)){var r=l.join("");return i=n.indexOf(r)>-1?M:d.indexOf(r)>-1?w:y,L(l.join("")),i=u,a}return l.push(e),t=e,a+1}}function C(e){var t=E(),r=[];return r=(r=r.concat(t(e))).concat(t(null))}function k(e){return C(e)}function D(e){return e.map((e=>"eof"!==e.type?e.data:"")).join("")}const j=["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"];function F(e,t="100",r="300 es"){const a=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const o of e)if("preprocessor"===o.type){const e=a.exec(o.data);if(e){const a=e[1].replace(/\s\s+/g," ");if(a===r)return a;if(a===t)return o.data="#version "+r,t;throw new Error("unknown glsl version: "+a)}}return e.splice(0,0,{type:"preprocessor",data:"#version "+r},{type:"whitespace",data:"\n"}),null}function L(e,t){for(let r=t-1;r>=0;r--){const t=e[r];if("whitespace"!==t.type&&"block-comment"!==t.type){if("keyword"!==t.type)break;if("attribute"===t.data||"in"===t.data)return!0}}return!1}function S(e,t,r,a){a=a||r;for(const o of e)if("ident"===o.type&&o.data===r){a in t?t[a]++:t[a]=0;return S(e,t,a+"_"+t[a],a)}return r}function R(e,t,r="afterVersion"){function a(e,t){for(let r=t;r<e.length;r++){const t=e[r];if("operator"===t.type&&";"===t.data)return r}return null}function o(e){let t=-1,o=0,n=-1;for(let i=0;i<e.length;i++){const l=e[i];if("preprocessor"===l.type&&(l.data.match(/\#(if|ifdef|ifndef)\s+.+/)?++o:l.data.match(/\#endif\s*.*/)&&--o),"afterVersion"!==r&&"afterPrecision"!==r||"preprocessor"===l.type&&/^#version/.test(l.data)&&(n=Math.max(n,i)),"afterPrecision"===r&&"keyword"===l.type&&"precision"===l.data){const t=a(e,i);if(null===t)throw new Error("precision statement not followed by any semicolons!");n=Math.max(n,t)}t<n&&0===o&&(t=i)}return t+1}const n={data:"\n",type:"whitespace"},i=t=>t<e.length&&/[^\r\n]$/.test(e[t].data);let l=o(e);i(l-1)&&e.splice(l++,0,n);for(const s of t)e.splice(l++,0,s);i(l-1)&&i(l)&&e.splice(l,0,n)}function V(e,t,r,a="lowp"){R(e,[{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:a},{type:"whitespace",data:" "},{type:"keyword",data:r},{type:"whitespace",data:" "},{type:"ident",data:t},{type:"operator",data:";"}],"afterPrecision")}function X(e,t,r,a,o="lowp"){R(e,[{type:"keyword",data:"layout"},{type:"operator",data:"("},{type:"keyword",data:"location"},{type:"whitespace",data:" "},{type:"operator",data:"="},{type:"whitespace",data:" "},{type:"integer",data:a.toString()},{type:"operator",data:")"},{type:"whitespace",data:" "},{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:o},{type:"whitespace",data:" "},{type:"keyword",data:r},{type:"whitespace",data:" "},{type:"ident",data:t},{type:"operator",data:";"}],"afterPrecision")}function A(e,t){let r,a,o=-1;for(let n=t;n<e.length;n++){const t=e[n];if("operator"===t.type&&("["===t.data&&(r=n),"]"===t.data)){a=n;break}"integer"===t.type&&(o=parseInt(t.data,10))}return r&&a&&e.splice(r,a-r+1),o}function G(a,o){const n=q(a);if(e(n))return n;const i=k(a);if("300 es"===F(i,"100","300 es"))return a;let l=null,s=null;const c={},d={};for(let e=0;e<i.length;++e){const a=i[e];switch(a.type){case"keyword":o===t.VERTEX_SHADER&&"attribute"===a.data?a.data="in":"varying"===a.data&&(a.data=o===t.VERTEX_SHADER?"out":"in");break;case"builtin":if(/^texture(2D|Cube)(Proj)?(Lod|Grad)?(EXT)?$/.test(a.data.trim())&&(a.data=a.data.replace(/(2D|Cube|EXT)/g,"")),o===t.FRAGMENT_SHADER&&"gl_FragColor"===a.data&&(l||(l=S(i,c,"fragColor"),V(i,l,"vec4")),a.data=l),o===t.FRAGMENT_SHADER&&"gl_FragData"===a.data){const t=A(i,e+1),r=S(i,c,"fragData");X(i,r,"vec4",t,"mediump"),a.data=r}else o===t.FRAGMENT_SHADER&&"gl_FragDepthEXT"===a.data&&(s||(s=S(i,c,"gl_FragDepth")),a.data=s);break;case"ident":if(r.indexOf(a.data)>=0){if(o===t.VERTEX_SHADER&&L(i,e))throw new Error("attribute in vertex shader uses a name that is a reserved word in glsl 300 es");a.data in d||(d[a.data]=S(i,c,a.data)),a.data=d[a.data]}}}for(let e=i.length-1;e>=0;--e){const t=i[e];if("preprocessor"===t.type){const r=t.data.match(/\#extension\s+(.*)\:/);if(r&&r[1]&&j.indexOf(r[1].trim())>=0){const t=i[e+1];i.splice(e,t&&"whitespace"===t.type?2:1)}const a=t.data.match(/\#ifdef\s+(.*)/);a&&a[1]&&j.indexOf(a[1].trim())>=0&&(t.data="#if 1");const o=t.data.match(/\#ifndef\s+(.*)/);o&&o[1]&&j.indexOf(o[1].trim())>=0&&(t.data="#if 0")}}return B(a,D(i))}const I={enableCache:!1},O=new Map;function q(e){return I.enableCache?O.get(e):null}function B(e,t){return I.enableCache&&O.set(e,t),t}export{I as test,G as transpileShader};
5
+ import"../../core/has.js";import{isSome as e}from"../../core/maybe.js";import{ShaderType as t}from"./enums.js";import r from"./reservedWordsGLSL3.js";var a,o={exports:{}};void 0!==(a=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"])&&(o.exports=a);const n=o.exports;var i,l={exports:{}};i=l,function(e){var t=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];void 0!==t&&(i.exports=t)}();const s=l.exports;var c={exports:{}};!function(e){!function(t){var r=function(){return["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]}();void 0!==r&&(e.exports=r)}()}(c);const d=c.exports;var u=999,g=9999,p=0,f=1,_=2,h=3,x=4,m=5,y=6,w=7,M=8,v=9,T=10,b=11,P=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function E(){var e,t,r,a=0,o=0,i=u,l=[],c=[],E=1,C=0,k=0,D=!1,j=!1,F="";return function(e){return c=[],null!==e?S(e.replace?e.replace(/\r\n/g,"\n"):e):R()};function L(e){e.length&&c.push({type:P[i],data:e,position:k,line:E,column:C})}function S(t){var n;for(a=0,r=(F+=t).length;e=F[a],a<r;){switch(n=a,i){case p:a=I();break;case f:a=G();break;case _:a=A();break;case h:a=O();break;case x:a=H();break;case b:a=B();break;case m:a=N();break;case g:a=U();break;case v:a=X();break;case u:a=V()}if(n!==a)if("\n"===F[n])C=0,++E;else++C}return o+=a,F=F.slice(a),c}function R(e){return l.length&&L(l.join("")),i=T,L("(eof)"),c}function V(){return l=l.length?[]:l,"/"===t&&"*"===e?(k=o+a-1,i=p,t=e,a+1):"/"===t&&"/"===e?(k=o+a-1,i=f,t=e,a+1):"#"===e?(i=_,k=o+a,a):/\s/.test(e)?(i=v,k=o+a,a):(D=/\d/.test(e),j=/[^\w_]/.test(e),k=o+a,i=D?x:j?h:g,a)}function X(){return/[^\s]/g.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function A(){return"\r"!==e&&"\n"!==e||"\\"===t?(l.push(e),t=e,a+1):(L(l.join("")),i=u,a)}function G(){return A()}function I(){return"/"===e&&"*"===t?(l.push(e),L(l.join("")),i=u,a+1):(l.push(e),t=e,a+1)}function O(){if("."===t&&/\d/.test(e))return i=m,a;if("/"===t&&"*"===e)return i=p,a;if("/"===t&&"/"===e)return i=f,a;if("."===e&&l.length){for(;q(l););return i=m,a}if(";"===e||")"===e||"("===e){if(l.length)for(;q(l););return L(e),i=u,a+1}var r=2===l.length&&"="!==e;if(/[\w_\d\s]/.test(e)||r){for(;q(l););return i=u,a}return l.push(e),t=e,a+1}function q(e){for(var t,r,a=0;;){if(t=s.indexOf(e.slice(0,e.length+a).join("")),r=s[t],-1===t){if(a--+e.length>0)continue;r=e.slice(0,1).join("")}return L(r),k+=r.length,(l=l.slice(r.length)).length}}function B(){return/[^a-fA-F0-9]/.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function H(){return"."===e||/[eE]/.test(e)?(l.push(e),i=m,t=e,a+1):"x"===e&&1===l.length&&"0"===l[0]?(i=b,l.push(e),t=e,a+1):/[^\d]/.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function N(){return"f"===e&&(l.push(e),t=e,a+=1),/[eE]/.test(e)||"-"===e&&/[eE]/.test(t)?(l.push(e),t=e,a+1):/[^\d]/.test(e)?(L(l.join("")),i=u,a):(l.push(e),t=e,a+1)}function U(){if(/[^\d\w_]/.test(e)){var r=l.join("");return i=n.indexOf(r)>-1?M:d.indexOf(r)>-1?w:y,L(l.join("")),i=u,a}return l.push(e),t=e,a+1}}function C(e){var t=E(),r=[];return r=(r=r.concat(t(e))).concat(t(null))}function k(e){return C(e)}function D(e){return e.map((e=>"eof"!==e.type?e.data:"")).join("")}const j=["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"];function F(e,t="100",r="300 es"){const a=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const o of e)if("preprocessor"===o.type){const e=a.exec(o.data);if(e){const a=e[1].replace(/\s\s+/g," ");if(a===r)return a;if(a===t)return o.data="#version "+r,t;throw new Error("unknown glsl version: "+a)}}return e.splice(0,0,{type:"preprocessor",data:"#version "+r},{type:"whitespace",data:"\n"}),null}function L(e,t){for(let r=t-1;r>=0;r--){const t=e[r];if("whitespace"!==t.type&&"block-comment"!==t.type){if("keyword"!==t.type)break;if("attribute"===t.data||"in"===t.data)return!0}}return!1}function S(e,t,r,a){a=a||r;for(const o of e)if("ident"===o.type&&o.data===r){a in t?t[a]++:t[a]=0;return S(e,t,a+"_"+t[a],a)}return r}function R(e,t,r="afterVersion"){function a(e,t){for(let r=t;r<e.length;r++){const t=e[r];if("operator"===t.type&&";"===t.data)return r}return null}function o(e){let t=-1,o=0,n=-1;for(let i=0;i<e.length;i++){const l=e[i];if("preprocessor"===l.type&&(l.data.match(/\#(if|ifdef|ifndef)\s+.+/)?++o:l.data.match(/\#endif\s*.*/)&&--o),"afterVersion"!==r&&"afterPrecision"!==r||"preprocessor"===l.type&&/^#version/.test(l.data)&&(n=Math.max(n,i)),"afterPrecision"===r&&"keyword"===l.type&&"precision"===l.data){const t=a(e,i);if(null===t)throw new Error("precision statement not followed by any semicolons!");n=Math.max(n,t)}t<n&&0===o&&(t=i)}return t+1}const n={data:"\n",type:"whitespace"},i=t=>t<e.length&&/[^\r\n]$/.test(e[t].data);let l=o(e);i(l-1)&&e.splice(l++,0,n);for(const s of t)e.splice(l++,0,s);i(l-1)&&i(l)&&e.splice(l,0,n)}function V(e,t,r,a="lowp"){R(e,[{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:a},{type:"whitespace",data:" "},{type:"keyword",data:r},{type:"whitespace",data:" "},{type:"ident",data:t},{type:"operator",data:";"}],"afterPrecision")}function X(e,t,r,a,o="lowp"){R(e,[{type:"keyword",data:"layout"},{type:"operator",data:"("},{type:"keyword",data:"location"},{type:"whitespace",data:" "},{type:"operator",data:"="},{type:"whitespace",data:" "},{type:"integer",data:a.toString()},{type:"operator",data:")"},{type:"whitespace",data:" "},{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:o},{type:"whitespace",data:" "},{type:"keyword",data:r},{type:"whitespace",data:" "},{type:"ident",data:t},{type:"operator",data:";"}],"afterPrecision")}function A(e,t){let r,a,o=-1;for(let n=t;n<e.length;n++){const t=e[n];if("operator"===t.type&&("["===t.data&&(r=n),"]"===t.data)){a=n;break}"integer"===t.type&&(o=parseInt(t.data,10))}return r&&a&&e.splice(r,a-r+1),o}function G(a,o){const n=q(a);if(e(n))return n;const i=k(a);if("300 es"===F(i,"100","300 es"))return a;let l=null,s=null;const c={},d={};for(let e=0;e<i.length;++e){const a=i[e];switch(a.type){case"keyword":o===t.VERTEX_SHADER&&"attribute"===a.data?a.data="in":"varying"===a.data&&(a.data=o===t.VERTEX_SHADER?"out":"in");break;case"builtin":if(/^texture(2D|Cube)(Proj)?(Lod|Grad)?(EXT)?$/.test(a.data.trim())&&(a.data=a.data.replace(/(2D|Cube|EXT)/g,"")),o===t.FRAGMENT_SHADER&&"gl_FragColor"===a.data&&(l||(l=S(i,c,"fragColor"),V(i,l,"vec4")),a.data=l),o===t.FRAGMENT_SHADER&&"gl_FragData"===a.data){const t=A(i,e+1),r=S(i,c,"fragData");X(i,r,"vec4",t,"mediump"),a.data=r}else o===t.FRAGMENT_SHADER&&"gl_FragDepthEXT"===a.data&&(s||(s=S(i,c,"gl_FragDepth")),a.data=s);break;case"ident":if(r.includes(a.data)){if(o===t.VERTEX_SHADER&&L(i,e))throw new Error("attribute in vertex shader uses a name that is a reserved word in glsl 300 es");a.data in d||(d[a.data]=S(i,c,a.data)),a.data=d[a.data]}}}for(let e=i.length-1;e>=0;--e){const t=i[e];if("preprocessor"===t.type){const r=t.data.match(/\#extension\s+(.*)\:/);if(r&&r[1]&&j.includes(r[1].trim())){const t=i[e+1];i.splice(e,t&&"whitespace"===t.type?2:1)}const a=t.data.match(/\#ifdef\s+(.*)/);a&&a[1]&&j.includes(a[1].trim())&&(t.data="#if 1");const o=t.data.match(/\#ifndef\s+(.*)/);o&&o[1]&&j.includes(o[1].trim())&&(t.data="#if 0")}}return B(a,D(i))}const I={enableCache:!1},O=new Map;function q(e){return I.enableCache?O.get(e):null}function B(e,t){return I.enableCache&&O.set(e,t),t}export{I as test,G as transpileShader};
package/webscene/Slide.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import r from"../core/Collection.js";import{referenceSetter as s}from"../core/collectionUtils.js";import{JSONSupport as o}from"../core/JSONSupport.js";import a from"../core/Logger.js";import{isSome as l}from"../core/maybe.js";import{eachAlways as p,onAbortOrThrow as m,isAbortError as h,all as c}from"../core/promiseUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as g}from"../core/accessorSupport/ensureType.js";import{d as v}from"../chunks/vec3.js";import{c as b}from"../chunks/vec3f64.js";import w from"../layers/Layer.js";import{isOperationalLayer as f}from"../layers/mixins/OperationalLayer.js";import{ensureType as L,clonePreservingTiledLayers as j}from"../support/basemapUtils.js";import{moduloPositive as T}from"../views/3d/support/mathUtils.js";import{toCamera as _}from"../views/3d/support/viewpointUtils.js";import{TaskPriority as C}from"../views/support/Scheduler.js";import{SlideThumbnail as S}from"../webdoc/support/SlideThumbnail.js";import U from"./Lighting.js";import V from"./support/Description.js";import{SlideEnvironment as x}from"./support/SlideEnvironment.js";import D from"./support/SlideGround.js";import{SlideVisibleLayer as E}from"./support/SlideVisibleLayer.js";import I from"./support/Title.js";let k=0;const O=r.ofType(E),R=a.getLogger("esri.webscene.Slide");let A=class extends o{constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+k++,this.title=new I,this.description=new V,this.thumbnail=new S,this.viewpoint=null,this.basemap=null,this.ground=null,this.environment=new x,this.visibleLayers=new O}destroy(){this.visibleLayers.removeAll(),this.basemap=null,this.thumbnail&&this.thumbnail.destroy(),this.description=null,this.title=null,this.thumbnail=null}castTitle(e){return"string"==typeof e?new I({text:e}):g(I,e)}castDescription(e){return"string"==typeof e?new V({text:e}):g(V,e)}castThumbnail(e){return"string"==typeof e?new S({url:e}):g(S,e)}castBasemap(e){return L(e)}set visibleLayers(e){this._set("visibleLayers",s(e,this._get("visibleLayers"),O))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map((e=>{if("string"==typeof e)return{id:e};if(e instanceof w){const t=M(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:e.sublayerIds}:(R.warn('Invalid visible layer, expected { id }, Layer or "id"'),e)})):null}clone(){return new(0,this.constructor)({id:this.id,title:this.title.clone(),thumbnail:this.thumbnail.clone(),description:this.description&&this.description.clone()||null,viewpoint:this.viewpoint&&this.viewpoint.clone()||null,basemap:this.basemap&&this.basemap.clone()||null,ground:this.ground&&this.ground.clone()||null,visibleLayers:this.visibleLayers.clone(),environment:this.environment&&this.environment.clone()||null})}_updateVisibleLayersFrom(e){const t=[];return p(this._getLayers(e.map).map((i=>e.whenLayerView(i).then((e=>{if(e.visible){const n=M(i);t.push(new E({id:e.layer.id,sublayerIds:n}))}})))).toArray()).then((()=>{this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}))}updateFrom(e,t){return t={screenshot:{format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t&&t.screenshot}},e.when((()=>(this.viewpoint=e.viewpoint.clone(),this.environment.lighting=U.prototype.clone.apply(e.environment.lighting),this.basemap=e.map.basemap&&e.map.basemap.clone()||null,this.ground=e.map.ground?D.fromGround(e.map.ground):null,this._updateVisibleLayersFrom(e)))).then((()=>e.takeScreenshot(t.screenshot))).then((e=>(this.thumbnail=new S({url:e.dataUrl}),this)))}async applyTo(e,t){l(this._applyToController)&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=m(t,(()=>i.abort())),s=e.resourceController.scheduler.registerTask(C.SLIDE);let o=!1;t={animate:!0,...t,signal:this._applyToController.signal};const a=async()=>{await c([s.schedule((()=>o=this._setViewpointOfInterest(e,t))),s.schedule((()=>this._applyBasemap(e,t)),t.signal)]),await c([s.schedule((()=>this._applyLayerVisibility(e)),t.signal),s.schedule((()=>this._applyGround(e)),t.signal),s.schedule((()=>this._applyViewpoint(e,t)),t.signal)])},p=await n(e.addUpdatingPromise(a()));if(o&&(e.contentCamera=null),s.remove(),this._applyToController===i&&(this._applyToController=null),i=null,null==r||r.remove(),!1===p.ok)throw p.error;return this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(h(i))throw i}e.map.basemap=j(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_getLayers(e){const t=new r;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach((e=>{f(e)&&(t.add(e),"layers"in e&&this._collectLayers(e,t))}))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach((e=>{const t=this.visibleLayers.find((t=>t.id===e.id));e.visible=null!=t;const i=t&&t.sublayerIds,n=q(e);i&&n&&n.forEach((e=>e.visible=i.indexOf(e.id)>=0))}))}_setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t.ignoreViewpoint||!t.useDestinationCamera)return!1;const i=_(e,this.viewpoint);return e.contentCamera=i,l(i)}async _applyViewpoint(e,t){if(this.viewpoint&&!t.ignoreViewpoint){if(l(this.viewpoint.camera)&&(this.viewpoint.camera.fov=e.camera.fov),t.animate&&this.get("environment.lighting.date"))return void await this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(this.environment.lighting.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"sun"===e.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e)),e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,null!=this.environment.lighting.displayUTCOffset&&"sun"===e.environment.lighting.type&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);const n=e.goTo(this.viewpoint,t),r=()=>{i&&i.remove(),"sun"===e.environment.lighting.type&&(e.environment.lighting.cameraTrackingEnabled=!0)};return n.then((()=>{e.environment.applyLighting(this.environment.lighting.clone()),r()}),(e=>{throw r(),e}))}_getTime(e){return[e.getTime(),3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds()]}_setTime(e,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e){const t=new Date(e.environment.lighting.date.toString()),[i,n]=this._getTime(t),[r,s]=this._getTime(this.environment.lighting.date),o=G(n,s),a=e.renderCoordsHelper,p=b();a.toRenderCoords(e.camera.position,p);const m=b(),h=b();l(this.viewpoint.camera)&&a.toRenderCoords(this.viewpoint.camera.position,m);const c=new Date;return e.watch("camera",(t=>{a.toRenderCoords(t.position,h);const s=v(p,h),l=v(m,h);let u=0;s+l!==0&&(u=s/(s+l));const d=i+(r-i)*u,y=H(n,o*u);e.environment.lighting.date=this._setTime(c,d,y)}))}static createFrom(e,t){return(new this).updateFrom(e,t)}};function q(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function M(e){const t=q(e);if(t)return t.filter((e=>e.visible)).map((e=>e.id))}e([u({type:String,json:{write:{isRequired:!0}}})],A.prototype,"id",void 0),e([u({type:I,json:{default:()=>new I({text:""}),write:{isRequired:!0}}})],A.prototype,"title",void 0),e([d("title")],A.prototype,"castTitle",null),e([u({type:V,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],A.prototype,"description",void 0),e([d("description")],A.prototype,"castDescription",null),e([u({type:S,json:{default:()=>new S({url:""}),write:{isRequired:!0}}})],A.prototype,"thumbnail",void 0),e([d("thumbnail")],A.prototype,"castThumbnail",null),e([u({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],A.prototype,"viewpoint",void 0),e([u({type:t,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],A.prototype,"basemap",void 0),e([d("basemap")],A.prototype,"castBasemap",null),e([u({type:D,json:{write:!0}})],A.prototype,"ground",void 0),e([u({type:O,json:{write:{isRequired:!0}}})],A.prototype,"visibleLayers",null),e([d("visibleLayers")],A.prototype,"castVisibleLayers",null),e([u({type:x,json:{write:!0}})],A.prototype,"environment",void 0),A=e([y("esri.webscene.Slide")],A);const B=86400,F=43200;function G(e,t){let i=t-e;return i>F&&(i-=B),i<-F&&(i+=B),i}function H(e,t){return T(e+t,B)}const N=A;export{N as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import r from"../core/Collection.js";import{referenceSetter as s}from"../core/collectionUtils.js";import{JSONSupport as o}from"../core/JSONSupport.js";import a from"../core/Logger.js";import{isSome as l}from"../core/maybe.js";import{eachAlways as p,onAbortOrThrow as m,isAbortError as h,all as c}from"../core/promiseUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as g}from"../core/accessorSupport/ensureType.js";import{d as v}from"../chunks/vec3.js";import{c as b}from"../chunks/vec3f64.js";import w from"../layers/Layer.js";import{isOperationalLayer as f}from"../layers/mixins/OperationalLayer.js";import{ensureType as L,clonePreservingTiledLayers as j}from"../support/basemapUtils.js";import{moduloPositive as T}from"../views/3d/support/mathUtils.js";import{toCamera as _}from"../views/3d/support/viewpointUtils.js";import{TaskPriority as C}from"../views/support/Scheduler.js";import{SlideThumbnail as S}from"../webdoc/support/SlideThumbnail.js";import U from"./Lighting.js";import V from"./support/Description.js";import{SlideEnvironment as x}from"./support/SlideEnvironment.js";import D from"./support/SlideGround.js";import{SlideVisibleLayer as E}from"./support/SlideVisibleLayer.js";import I from"./support/Title.js";let k=0;const R=r.ofType(E),A=a.getLogger("esri.webscene.Slide");let O=class extends o{constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+k++,this.title=new I,this.description=new V,this.thumbnail=new S,this.viewpoint=null,this.basemap=null,this.ground=null,this.environment=new x,this.visibleLayers=new R}destroy(){this.visibleLayers.removeAll(),this.basemap=null,this.thumbnail&&this.thumbnail.destroy(),this.description=null,this.title=null,this.thumbnail=null}castTitle(e){return"string"==typeof e?new I({text:e}):g(I,e)}castDescription(e){return"string"==typeof e?new V({text:e}):g(V,e)}castThumbnail(e){return"string"==typeof e?new S({url:e}):g(S,e)}castBasemap(e){return L(e)}set visibleLayers(e){this._set("visibleLayers",s(e,this._get("visibleLayers"),R))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map((e=>{if("string"==typeof e)return{id:e};if(e instanceof w){const t=M(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:e.sublayerIds}:(A.warn('Invalid visible layer, expected { id }, Layer or "id"'),e)})):null}clone(){return new(0,this.constructor)({id:this.id,title:this.title.clone(),thumbnail:this.thumbnail.clone(),description:this.description&&this.description.clone()||null,viewpoint:this.viewpoint&&this.viewpoint.clone()||null,basemap:this.basemap&&this.basemap.clone()||null,ground:this.ground&&this.ground.clone()||null,visibleLayers:this.visibleLayers.clone(),environment:this.environment&&this.environment.clone()||null})}_updateVisibleLayersFrom(e){const t=[];return p(this._getLayers(e.map).map((i=>e.whenLayerView(i).then((e=>{if(e.visible){const n=M(i);t.push(new E({id:e.layer.id,sublayerIds:n}))}})))).toArray()).then((()=>{this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}))}updateFrom(e,t){return t={screenshot:{format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t&&t.screenshot}},e.when((()=>(this.viewpoint=e.viewpoint.clone(),this.environment.lighting=U.prototype.clone.apply(e.environment.lighting),this.basemap=e.map.basemap&&e.map.basemap.clone()||null,this.ground=e.map.ground?D.fromGround(e.map.ground):null,this._updateVisibleLayersFrom(e)))).then((()=>e.takeScreenshot(t.screenshot))).then((e=>(this.thumbnail=new S({url:e.dataUrl}),this)))}async applyTo(e,t){l(this._applyToController)&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=m(t,(()=>i.abort())),s=e.resourceController.scheduler.registerTask(C.SLIDE);let o=!1;t={animate:!0,...t,signal:this._applyToController.signal};const a=async()=>{await c([s.schedule((()=>o=this._setViewpointOfInterest(e,t))),s.schedule((()=>this._applyBasemap(e,t)),t.signal)]),await c([s.schedule((()=>this._applyLayerVisibility(e)),t.signal),s.schedule((()=>this._applyGround(e)),t.signal),s.schedule((()=>this._applyViewpoint(e,t)),t.signal)])},p=await n(e.addUpdatingPromise(a()));if(o&&(e.contentCamera=null),s.remove(),this._applyToController===i&&(this._applyToController=null),i=null,null==r||r.remove(),!1===p.ok)throw p.error;return this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(h(i))throw i}e.map.basemap=j(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_getLayers(e){const t=new r;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach((e=>{f(e)&&(t.add(e),"layers"in e&&this._collectLayers(e,t))}))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach((e=>{const t=this.visibleLayers.find((t=>t.id===e.id));e.visible=null!=t;const i=t&&t.sublayerIds,n=q(e);i&&n&&n.forEach((e=>e.visible=i.includes(e.id)))}))}_setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t.ignoreViewpoint||!t.useDestinationCamera)return!1;const i=_(e,this.viewpoint);return e.contentCamera=i,l(i)}async _applyViewpoint(e,t){if(this.viewpoint&&!t.ignoreViewpoint){if(l(this.viewpoint.camera)&&(this.viewpoint.camera.fov=e.camera.fov),t.animate&&this.get("environment.lighting.date"))return void await this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(this.environment.lighting.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"sun"===e.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e)),e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,null!=this.environment.lighting.displayUTCOffset&&"sun"===e.environment.lighting.type&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);const n=e.goTo(this.viewpoint,t),r=()=>{i&&i.remove(),"sun"===e.environment.lighting.type&&(e.environment.lighting.cameraTrackingEnabled=!0)};return n.then((()=>{e.environment.applyLighting(this.environment.lighting.clone()),r()}),(e=>{throw r(),e}))}_getTime(e){return[e.getTime(),3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds()]}_setTime(e,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e){const t=new Date(e.environment.lighting.date.toString()),[i,n]=this._getTime(t),[r,s]=this._getTime(this.environment.lighting.date),o=G(n,s),a=e.renderCoordsHelper,p=b();a.toRenderCoords(e.camera.position,p);const m=b(),h=b();l(this.viewpoint.camera)&&a.toRenderCoords(this.viewpoint.camera.position,m);const c=new Date;return e.watch("camera",(t=>{a.toRenderCoords(t.position,h);const s=v(p,h),l=v(m,h);let u=0;s+l!==0&&(u=s/(s+l));const d=i+(r-i)*u,y=H(n,o*u);e.environment.lighting.date=this._setTime(c,d,y)}))}static createFrom(e,t){return(new this).updateFrom(e,t)}};function q(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function M(e){const t=q(e);if(t)return t.filter((e=>e.visible)).map((e=>e.id))}e([u({type:String,json:{write:{isRequired:!0}}})],O.prototype,"id",void 0),e([u({type:I,json:{default:()=>new I({text:""}),write:{isRequired:!0}}})],O.prototype,"title",void 0),e([d("title")],O.prototype,"castTitle",null),e([u({type:V,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],O.prototype,"description",void 0),e([d("description")],O.prototype,"castDescription",null),e([u({type:S,json:{default:()=>new S({url:""}),write:{isRequired:!0}}})],O.prototype,"thumbnail",void 0),e([d("thumbnail")],O.prototype,"castThumbnail",null),e([u({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],O.prototype,"viewpoint",void 0),e([u({type:t,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],O.prototype,"basemap",void 0),e([d("basemap")],O.prototype,"castBasemap",null),e([u({type:D,json:{write:!0}})],O.prototype,"ground",void 0),e([u({type:R,json:{write:{isRequired:!0}}})],O.prototype,"visibleLayers",null),e([d("visibleLayers")],O.prototype,"castVisibleLayers",null),e([u({type:x,json:{write:!0}})],O.prototype,"environment",void 0),O=e([y("esri.webscene.Slide")],O);const B=86400,F=43200;function G(e,t){let i=t-e;return i>F&&(i-=B),i<-F&&(i+=B),i}function H(e,t){return T(e+t,B)}const N=O;export{N as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{json as t}from"../../portal/schemas/webScene.js";import{ScanContext as r,sorted as n}from"./utils.js";function s(e,t){if(t.properties){if("layerType"in t.properties)return t.properties.layerType.enum[0];if("type"in t.properties)return t.properties.type.enum[0]}switch(e){case"multipoint_geometry_schema.json":return"multipoint";case"point_geometry_schema.json":return"point";case"polyline_geometry_schema.json":return"polyline";case"polygon_geometry_schema.json":return"polygon";case"extent_schema.json":return"extent"}}function i(e){return"array"===e.type?`${i(e.items)}[]`:e.type}function a(e){const t={count:e.length,refsCount:0,typesCount:0,distinctTypes:[],type:null},r=new Set;for(const n in e){const s=e[n];s.$ref?t.refsCount++:s.type&&(t.typesCount++,r.add(i(s)))}return r.forEach((e=>t.distinctTypes.push(e))),t.distinctTypes.sort(),t.refsCount===t.count?t.type="refs":2===t.count&&t.refsCount>0&&1===t.distinctTypes.length&&"null"===t.distinctTypes[0]?t.type="refsAndNull":t.typesCount===t.count?(t.type="types",t.distinctTypes=t.distinctTypes):t.type="mix",t}function o(e){return"array"===e.type||!("properties"in e)}function c(e,t,r){if(!r.hasFilteredProperties)return`${e}--${t}`;return`${e}--${t}--${r.filteredPropertiesArray.join("/")}`}async function l(e,t,r,n,i){i.schemaStack.push(e);const a=s(e,r);if(n=n?n.replace("<?TYPE?>",a?`<${a}>`:""):null,o(r)){const s=i.currentClass?null:{type:e,name:e,id:`${e}--${t}`,typeValue:t,properties:[]};return s&&i.push(null,s),await L(r,n,i),i.schemaStack.pop(),s}const l=c(e,t,i),p="drawingInfo_schema.json"!==e&&"layer_schema.json"!==e&&i.seen.get(l);if(p&&n)return i.addProperty({name:n,type:p}),i.schemaStack.pop(),p;const u={type:e,name:e,id:l,typeValue:t,properties:[]};return n&&i.addProperty({name:n,type:u}),i.push(n,u),await L(r,"",i),i.schemaStack.pop(),i.pop()}async function p(e,t,r){const n=await r.requestSchema(e.$ref),s=R(n.schema);if(s){for(const e of s){const s={...n.schema};s.properties={...s.properties,type:{type:"string",enum:[e]}};const i=-1===t.indexOf("<?TYPE?>")?`${t}<?TYPE?>`:t;await l(n.schemaId,e,s,i,r)}return}const i="layer_schema.json"===n.schemaId&&r.schemaStack.length?r.schemaStack[r.schemaStack.length-1].replace(/_schema\.json/,""):null;await l(n.schemaId,i,n.schema,t,r)}function u(e,t){if(!h(e))return!1;const r=e.stack.map((e=>e.klass.type)).join("/");return/.*pointCloudLayer_schema\.json\/layerDefinition_schema\.json\/drawingInfo_schema\.json$/.test(r)&&"renderer"===t}function f(e,t){if(!h(e))return!1;const r=e.stack.map((e=>e.klass.type)).join("/");return/.*(imageServiceLayer|tiledImageServiceLayer)_schema\.json\/layerDefinition_schema\.json\/drawingInfo_schema\.json$/.test(r)&&"renderer"===t}function h(e){return e.currentClass&&"drawingInfo_schema.json"===e.currentClass.name}function m(e){switch(e.schemaStack[e.schemaStack.length-1]){case"operationalLayers_schema.json":case"elevationLayers_schema.json":case"baseMapLayer_schema.json":return!0}return!1}const y=/raster.*Renderer|vectorFieldRenderer/,d=/(uniqueValueRenderer|classBreaksRenderer|raster.*Renderer|vectorFieldRenderer)/,w=/(rasterUniqueValueRenderer|rasterClassBreaksRenderer)/;function j(e,t,r){if(h(r)){const n=u(r,t),s=f(r,t);return e.filter((e=>{if(/uniqueValueFromStyleRenderer_schema\.json$/.test(e.$ref))return!1;if(s)return d.test(e.$ref)&&!w.test(e.$ref);if(y.test(e.$ref))return!1;const t=/pointCloud.*Renderer/.test(e.$ref);return n===t}))}if(m(r)){const t=["kmlLayer","rasterDataElevationLayer","rasterDataLayer"];return e.filter((e=>!t.some((t=>e.$ref.replace(/.*\//,"")===`${t}_schema.json`))))}return e}async function $(e,t,r){await L(e.items,`${t}[]`,r)}async function g(e,t,r){for(const n in e.properties)if(("webscene_schema.json"!==r.currentClass.name||"tables"!==n&&"mapRangeInfo"!==n&&"widgets"!==n)&&("baseMap_schema.json"!==r.currentClass.name||"elevationLayers"!==n)){if(h(r)){const e=r.stack.map((e=>e.klass.type)).join("/");if(/imageServiceLayer|tiledImageServiceLayer/.test(e)&&"transparency"===n)continue}await r.withFilter(n,(async()=>{const s=t?`${t}.${n}`:n;await L(e.properties[n],s,r)}))}}function _(e,t="",r=new Set){for(const n of e)if("properties"in n)for(const e in n.properties){const s=n.properties[e],i=t?`${t}.${e}`:e,a=Object.keys(s);if(0===a.length||1===a.length&&"$ref"===a[0])r.add(i);else{if(1!==a.length||"allOf"!==a[0])throw new Error(`unexpected allOf filter construct: ${JSON.stringify(s)}`);r.add(i),_(s.allOf,i,r)}}return r}async function P(e,t,r){let n=null;for(const i of e.allOf)if("$ref"in i){if(n)throw new Error("Cannot process more than 1 ref in an allOf construct");n=i}else if(!("properties"in i))throw new Error("allOf construct only allows simple top-level property filters");const s=_(e.allOf);await r.addFilter(s,(()=>p(n,t,r)))}async function S(e,t,r){const s=a(e.oneOf);if("refs"!==s.type&&"refsAndNull"!==s.type)if("types"!==s.type)for(const n in e.oneOf){const s=`.oneOf[${n}]`;await L(e.oneOf[n],`${t}${s}`,r)}else r.addProperty({name:t,type:n(s.distinctTypes).join("|")});else{const n=j(e.oneOf,t,r);for(const e of n)if("null"===e.type);else{const s=`${t||""}`+(1!==n.length?"<?TYPE?>":"");await L(e,s,r)}}}function R(e){if("layerDefinition"===e.title)return null;const t=e.properties&&e.properties.type;return t&&t.enum?t.enum:null}async function k(e,t,r){await p(e,t,r)}async function O(e,t,r){let s="unknown";e.type&&(s=Array.isArray(e.type)?n(e.type).join("|"):e.type.replace(/ /g,"").split(",").join("|"));const i={name:t,type:s,default:e.default};e.enum&&(i.enum=n(e.enum).map((e=>"string"==typeof e?`"${e}"`:`${e}`)).join("|")),r.addProperty(i)}async function L(e,t,r){return"array"===e.type?$(e,t,r):"properties"in e?g(e,t,r):"allOf"in e?P(e,t,r):"oneOf"in e?S(e,t,r):"$ref"in e?k(e,t,r):O(e,t,r)}const C="#/definitions/";function T(e){return 0===e.indexOf(C)?e.slice(C.length):e}async function b(e,t){const r=await E.create(e,t);return l(`${e||"webscene"}_schema.json`,null,r.schemaRoot,null,r)}class E extends r{constructor(e,t,r){super(),this.definitions=e,this.schemaRoot=t,this.requestSchema=r,this.filteredProperties=null,this.schemaStack=[],this.requestSchema.bind(this)}get hasFilteredProperties(){return this.filteredProperties&&this.filteredProperties.size>0}get filteredPropertiesArray(){const e=[];return this.filteredProperties.forEach((t=>e.push(t))),e}async withFilter(e,t){if(!this.hasFilteredProperties)return t();if(!this.filteredProperties.has(e))return;const r=this.filteredProperties;this.filteredProperties=null;const n=e=>{this.filteredProperties||(this.filteredProperties=new Set),this.filteredProperties.add(e)};r.forEach((t=>{const r=t.split(".",2);r.length>1&&r[0]===e&&n(r[1])})),await t(),this.filteredProperties=r}async addFilter(e,t){const r=this.filteredProperties;this.filteredProperties=null;const n=e=>{this.filteredProperties||(this.filteredProperties=new Set),this.filteredProperties.add(e)};r&&r.forEach(n),e&&e.forEach(n);const s=await t();return this.filteredProperties=r,s}static async create(e,t){return t&&t.useRemoteSchema?E.createRemote(e,t.baseUrl):E.createLocal(e)}static createLocal(e){const r=e&&"webscene"!==e?t.definitions[`${e}_schema.json`]:t;return new E(t.definitions,r,E._getLocalSchemaRequest())}static async createRemote(e,t){const r=await E._getRemoteSchemaRequest(t),n=new E({},null,r),s=(await n.requestSchema(`${e||"webscene"}_schema.json`)).schema;return new E(n.definitions,s,r)}static _getLocalSchemaRequest(){return function(t){const r=T(t),n=this.definitions[r];return n?Promise.resolve({schemaId:r,schema:n}):Promise.reject(new e("spec-certification:spec-invalid-local-schema","Schema reference is not a local reference"))}}static async _getRemoteSchemaRequest(t){if(!t)return Promise.reject(new e("spec-certification:spec-missing-base-url","The base url of the remote schema directory must be specified when using a remote schema"));const r=E._getLocalSchemaRequest(),n=(await import("../../request.js")).default;return function(e){return r.call(this,e).catch((()=>n(`${t}/${e}`,{responseType:"json"}).then((t=>(this.definitions[T(e)]=t.data,{schemaId:e,schema:t.data})))))}}}const q=Object.keys(t.definitions).map((e=>e.replace(/_schema\.json$/,"")));export{b as scan,q as schemaDefinitions};
5
+ import e from"../../core/Error.js";import{json as t}from"../../portal/schemas/webScene.js";import{ScanContext as r,sorted as n}from"./utils.js";function s(e,t){if(t.properties){if("layerType"in t.properties)return t.properties.layerType.enum[0];if("type"in t.properties)return t.properties.type.enum[0]}switch(e){case"multipoint_geometry_schema.json":return"multipoint";case"point_geometry_schema.json":return"point";case"polyline_geometry_schema.json":return"polyline";case"polygon_geometry_schema.json":return"polygon";case"extent_schema.json":return"extent"}}function i(e){return"array"===e.type?`${i(e.items)}[]`:e.type}function a(e){const t={count:e.length,refsCount:0,typesCount:0,distinctTypes:[],type:null},r=new Set;for(const n in e){const s=e[n];s.$ref?t.refsCount++:s.type&&(t.typesCount++,r.add(i(s)))}return r.forEach((e=>t.distinctTypes.push(e))),t.distinctTypes.sort(),t.refsCount===t.count?t.type="refs":2===t.count&&t.refsCount>0&&1===t.distinctTypes.length&&"null"===t.distinctTypes[0]?t.type="refsAndNull":t.typesCount===t.count?(t.type="types",t.distinctTypes=t.distinctTypes):t.type="mix",t}function o(e){return"array"===e.type||!("properties"in e)}function c(e,t,r){if(!r.hasFilteredProperties)return`${e}--${t}`;return`${e}--${t}--${r.filteredPropertiesArray.join("/")}`}async function l(e,t,r,n,i){i.schemaStack.push(e);const a=s(e,r);if(n=n?n.replace("<?TYPE?>",a?`<${a}>`:""):null,o(r)){const s=i.currentClass?null:{type:e,name:e,id:`${e}--${t}`,typeValue:t,properties:[]};return s&&i.push(null,s),await L(r,n,i),i.schemaStack.pop(),s}const l=c(e,t,i),p="drawingInfo_schema.json"!==e&&"layer_schema.json"!==e&&i.seen.get(l);if(p&&n)return i.addProperty({name:n,type:p}),i.schemaStack.pop(),p;const u={type:e,name:e,id:l,typeValue:t,properties:[]};return n&&i.addProperty({name:n,type:u}),i.push(n,u),await L(r,"",i),i.schemaStack.pop(),i.pop()}async function p(e,t,r){const n=await r.requestSchema(e.$ref),s=R(n.schema);if(s){for(const e of s){const s={...n.schema};s.properties={...s.properties,type:{type:"string",enum:[e]}};const i=t.includes("<?TYPE?>")?t:`${t}<?TYPE?>`;await l(n.schemaId,e,s,i,r)}return}const i="layer_schema.json"===n.schemaId&&r.schemaStack.length?r.schemaStack[r.schemaStack.length-1].replace(/_schema\.json/,""):null;await l(n.schemaId,i,n.schema,t,r)}function u(e,t){if(!h(e))return!1;const r=e.stack.map((e=>e.klass.type)).join("/");return/.*pointCloudLayer_schema\.json\/layerDefinition_schema\.json\/drawingInfo_schema\.json$/.test(r)&&"renderer"===t}function f(e,t){if(!h(e))return!1;const r=e.stack.map((e=>e.klass.type)).join("/");return/.*(imageServiceLayer|tiledImageServiceLayer)_schema\.json\/layerDefinition_schema\.json\/drawingInfo_schema\.json$/.test(r)&&"renderer"===t}function h(e){return e.currentClass&&"drawingInfo_schema.json"===e.currentClass.name}function m(e){switch(e.schemaStack[e.schemaStack.length-1]){case"operationalLayers_schema.json":case"elevationLayers_schema.json":case"baseMapLayer_schema.json":return!0}return!1}const y=/raster.*Renderer|vectorFieldRenderer/,d=/(uniqueValueRenderer|classBreaksRenderer|raster.*Renderer|vectorFieldRenderer)/,w=/(rasterUniqueValueRenderer|rasterClassBreaksRenderer)/;function j(e,t,r){if(h(r)){const n=u(r,t),s=f(r,t);return e.filter((e=>{if(/uniqueValueFromStyleRenderer_schema\.json$/.test(e.$ref))return!1;if(s)return d.test(e.$ref)&&!w.test(e.$ref);if(y.test(e.$ref))return!1;const t=/pointCloud.*Renderer/.test(e.$ref);return n===t}))}if(m(r)){const t=["kmlLayer","rasterDataElevationLayer","rasterDataLayer"];return e.filter((e=>!t.some((t=>e.$ref.replace(/.*\//,"")===`${t}_schema.json`))))}return e}async function $(e,t,r){await L(e.items,`${t}[]`,r)}async function g(e,t,r){for(const n in e.properties)if(("webscene_schema.json"!==r.currentClass.name||"tables"!==n&&"mapRangeInfo"!==n&&"widgets"!==n)&&("baseMap_schema.json"!==r.currentClass.name||"elevationLayers"!==n)){if(h(r)){const e=r.stack.map((e=>e.klass.type)).join("/");if(/imageServiceLayer|tiledImageServiceLayer/.test(e)&&"transparency"===n)continue}await r.withFilter(n,(async()=>{const s=t?`${t}.${n}`:n;await L(e.properties[n],s,r)}))}}function _(e,t="",r=new Set){for(const n of e)if("properties"in n)for(const e in n.properties){const s=n.properties[e],i=t?`${t}.${e}`:e,a=Object.keys(s);if(0===a.length||1===a.length&&"$ref"===a[0])r.add(i);else{if(1!==a.length||"allOf"!==a[0])throw new Error(`unexpected allOf filter construct: ${JSON.stringify(s)}`);r.add(i),_(s.allOf,i,r)}}return r}async function P(e,t,r){let n=null;for(const i of e.allOf)if("$ref"in i){if(n)throw new Error("Cannot process more than 1 ref in an allOf construct");n=i}else if(!("properties"in i))throw new Error("allOf construct only allows simple top-level property filters");const s=_(e.allOf);await r.addFilter(s,(()=>p(n,t,r)))}async function S(e,t,r){const s=a(e.oneOf);if("refs"!==s.type&&"refsAndNull"!==s.type)if("types"!==s.type)for(const n in e.oneOf){const s=`.oneOf[${n}]`;await L(e.oneOf[n],`${t}${s}`,r)}else r.addProperty({name:t,type:n(s.distinctTypes).join("|")});else{const n=j(e.oneOf,t,r);for(const e of n)if("null"===e.type);else{const s=`${t||""}`+(1!==n.length?"<?TYPE?>":"");await L(e,s,r)}}}function R(e){if("layerDefinition"===e.title)return null;const t=e.properties&&e.properties.type;return t&&t.enum?t.enum:null}async function k(e,t,r){await p(e,t,r)}async function O(e,t,r){let s="unknown";e.type&&(s=Array.isArray(e.type)?n(e.type).join("|"):e.type.replace(/ /g,"").split(",").join("|"));const i={name:t,type:s,default:e.default};e.enum&&(i.enum=n(e.enum).map((e=>"string"==typeof e?`"${e}"`:`${e}`)).join("|")),r.addProperty(i)}async function L(e,t,r){return"array"===e.type?$(e,t,r):"properties"in e?g(e,t,r):"allOf"in e?P(e,t,r):"oneOf"in e?S(e,t,r):"$ref"in e?k(e,t,r):O(e,t,r)}const C="#/definitions/";function T(e){return 0===e.indexOf(C)?e.slice(C.length):e}async function b(e,t){const r=await E.create(e,t);return l(`${e||"webscene"}_schema.json`,null,r.schemaRoot,null,r)}class E extends r{constructor(e,t,r){super(),this.definitions=e,this.schemaRoot=t,this.requestSchema=r,this.filteredProperties=null,this.schemaStack=[],this.requestSchema.bind(this)}get hasFilteredProperties(){return this.filteredProperties&&this.filteredProperties.size>0}get filteredPropertiesArray(){const e=[];return this.filteredProperties.forEach((t=>e.push(t))),e}async withFilter(e,t){if(!this.hasFilteredProperties)return t();if(!this.filteredProperties.has(e))return;const r=this.filteredProperties;this.filteredProperties=null;const n=e=>{this.filteredProperties||(this.filteredProperties=new Set),this.filteredProperties.add(e)};r.forEach((t=>{const r=t.split(".",2);r.length>1&&r[0]===e&&n(r[1])})),await t(),this.filteredProperties=r}async addFilter(e,t){const r=this.filteredProperties;this.filteredProperties=null;const n=e=>{this.filteredProperties||(this.filteredProperties=new Set),this.filteredProperties.add(e)};r&&r.forEach(n),e&&e.forEach(n);const s=await t();return this.filteredProperties=r,s}static async create(e,t){return t&&t.useRemoteSchema?E.createRemote(e,t.baseUrl):E.createLocal(e)}static createLocal(e){const r=e&&"webscene"!==e?t.definitions[`${e}_schema.json`]:t;return new E(t.definitions,r,E._getLocalSchemaRequest())}static async createRemote(e,t){const r=await E._getRemoteSchemaRequest(t),n=new E({},null,r),s=(await n.requestSchema(`${e||"webscene"}_schema.json`)).schema;return new E(n.definitions,s,r)}static _getLocalSchemaRequest(){return function(t){const r=T(t),n=this.definitions[r];return n?Promise.resolve({schemaId:r,schema:n}):Promise.reject(new e("spec-certification:spec-invalid-local-schema","Schema reference is not a local reference"))}}static async _getRemoteSchemaRequest(t){if(!t)return Promise.reject(new e("spec-certification:spec-missing-base-url","The base url of the remote schema directory must be specified when using a remote schema"));const r=E._getLocalSchemaRequest(),n=(await import("../../request.js")).default;return function(e){return r.call(this,e).catch((()=>n(`${t}/${e}`,{responseType:"json"}).then((t=>(this.definitions[T(e)]=t.data,{schemaId:e,schema:t.data})))))}}}const q=Object.keys(t.definitions).map((e=>e.replace(/_schema\.json$/,"")));export{b as scan,q as schemaDefinitions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../analysis/AreaMeasurementAnalysis.js";import{isNone as s,isSome as i,unwrap as r}from"../../core/maybe.js";import{measurementAreaUnits as n}from"../../core/unitUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{defaultUnitPropertyMetadata as a}from"../../properties/defaultUnit.js";import u from"../../views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js";import{InteractiveAnalysisViewModel as p}from"../support/InteractiveAnalysisViewModel.js";let d=class extends p{constructor(t){super(t),this.analysis=null,this.supportedViewType="3d",this.unsupportedErrorMessage="AreaMeasurement3DViewModel is only supported in 3D views.",this._userUnitOptions=null,this._userUnit=null}initialize(){this.analysis.unit=this.unit}get state(){return this.disabled||!this.ready?"disabled":s(this.tool)?"ready":this.tool.state}get measurement(){if(s(this.tool)||this.disabled||this.tool.destroyed)return null;if(this.tool.measurementView.destroyed)return null;const t=this.tool.analysisView.analysisVisualization,e=t.viewData,i=e.measurementData,r=e.validMeasurement,n="euclidean"===e.mode,o=0===(n?i.intersectingSegments:i.geodesicIntersectingSegments).size,l=o?r?"available":"unavailable":"invalid";return{mode:n?"euclidean":"geodesic",area:{text:o&&r?t.areaLabel:null,state:l},perimeterLength:{text:o&&r?t.perimeterLengthLabel:null,state:l}}}set unitOptions(t){this._userUnitOptions=t,this._set("unitOptions",this._filteredOrAllUnits(this._userUnitOptions))}get unitOptions(){return this._filteredOrAllUnits(this._userUnitOptions)}set unit(t){this._userUnit=t?this._findSelectableUnit(t,this._userUnit):null,this.analysis.unit=this._userUnit}get unit(){return i(this._userUnit)?(this._userUnit=this._findSelectableUnit(this._userUnit,this.defaultUnit),this._userUnit):this._findSelectableUnit(this.defaultUnit)}clear(){this.removeTool(),this.analysis.geometry=null}constructAnalysis(){return new e}constructTool(){return new u({view:r(this.view),analysis:this.analysis,analysisView:r(this.analysisView),visible:this.visible})}_findSelectableUnit(t,e){const s=this.unitOptions;return-1!==s.indexOf(t)?t:i(e)?this._findSelectableUnit(e):s[0]}_filteredOrAllUnits(t){if(s(t))return n.slice();const e=t.filter((t=>-1!==n.indexOf(t)));return 0===e.length?n.slice():e}};t([o({type:e})],d.prototype,"analysis",void 0),t([o({readOnly:!0})],d.prototype,"state",null),t([o({readOnly:!0})],d.prototype,"measurement",null),t([o()],d.prototype,"unitOptions",null),t([o()],d.prototype,"unit",null),t([o(a)],d.prototype,"defaultUnit",void 0),t([o()],d.prototype,"_userUnit",void 0),d=t([l("esri.widgets.AreaMeasurement3D.AreaMeasurement3DViewModel")],d);const h=d;export{h as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../analysis/AreaMeasurementAnalysis.js";import{isNone as s,isSome as i,unwrap as r}from"../../core/maybe.js";import{measurementAreaUnits as n}from"../../core/unitUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{defaultUnitPropertyMetadata as a}from"../../properties/defaultUnit.js";import u from"../../views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js";import{InteractiveAnalysisViewModel as p}from"../support/InteractiveAnalysisViewModel.js";let d=class extends p{constructor(t){super(t),this.analysis=null,this.supportedViewType="3d",this.unsupportedErrorMessage="AreaMeasurement3DViewModel is only supported in 3D views.",this._userUnitOptions=null,this._userUnit=null}initialize(){this.analysis.unit=this.unit}get state(){return this.disabled||!this.ready?"disabled":s(this.tool)?"ready":this.tool.state}get measurement(){if(s(this.tool)||this.disabled||this.tool.destroyed)return null;if(this.tool.measurementView.destroyed)return null;const t=this.tool.analysisView.analysisVisualization,e=t.viewData,i=e.measurementData,r=e.validMeasurement,n="euclidean"===e.mode,o=0===(n?i.intersectingSegments:i.geodesicIntersectingSegments).size,l=o?r?"available":"unavailable":"invalid";return{mode:n?"euclidean":"geodesic",area:{text:o&&r?t.areaLabel:null,state:l},perimeterLength:{text:o&&r?t.perimeterLengthLabel:null,state:l}}}set unitOptions(t){this._userUnitOptions=t,this._set("unitOptions",this._filteredOrAllUnits(this._userUnitOptions))}get unitOptions(){return this._filteredOrAllUnits(this._userUnitOptions)}set unit(t){this._userUnit=t?this._findSelectableUnit(t,this._userUnit):null,this.analysis.unit=this._userUnit}get unit(){return i(this._userUnit)?(this._userUnit=this._findSelectableUnit(this._userUnit,this.defaultUnit),this._userUnit):this._findSelectableUnit(this.defaultUnit)}clear(){this.removeTool(),this.analysis.geometry=null}constructAnalysis(){return new e}constructTool(){return new u({view:r(this.view),analysis:this.analysis,analysisView:r(this.analysisView),visible:this.visible})}_findSelectableUnit(t,e){const s=this.unitOptions;return s.includes(t)?t:i(e)?this._findSelectableUnit(e):s[0]}_filteredOrAllUnits(t){if(s(t))return n.slice();const e=t.filter((t=>n.includes(t)));return 0===e.length?n.slice():e}};t([o({type:e})],d.prototype,"analysis",void 0),t([o({readOnly:!0})],d.prototype,"state",null),t([o({readOnly:!0})],d.prototype,"measurement",null),t([o()],d.prototype,"unitOptions",null),t([o()],d.prototype,"unit",null),t([o(a)],d.prototype,"defaultUnit",void 0),t([o()],d.prototype,"_userUnit",void 0),d=t([l("esri.widgets.AreaMeasurement3D.AreaMeasurement3DViewModel")],d);const h=d;export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{getAssetUrl as i}from"../../../assets.js";function e(i){const e=i.toLowerCase();return"image/bmp"===e||"image/emf"===e||"image/exif"===e||"image/gif"===e||"image/x-icon"===e||"image/jpeg"===e||"image/png"===e||"image/tiff"===e||"image/x-wmf"===e}function p(e){const p=i("esri/themes/base/images/files/");return e?"text/plain"===e?`${p}text-32.svg`:"application/pdf"===e?`${p}pdf-32.svg`:"text/csv"===e?`${p}csv-32.svg`:"application/gpx+xml"===e?`${p}gpx-32.svg`:"application/x-dwf"===e?`${p}cad-32.svg`:"application/postscript"===e||"application/json"===e||"text/xml"===e||"model/vrml"===e?`${p}code-32.svg`:"application/x-zip-compressed"===e||"application/x-7z-compressed"===e||"application/x-gzip"===e||"application/x-tar"===e||"application/x-gtar"===e||"application/x-bzip2"===e||"application/gzip"===e||"application/x-compress"===e||"application/x-apple-diskimage"===e||"application/x-rar-compressed"===e||"application/zip"===e?`${p}zip-32.svg`:-1!==e.indexOf("image/")?`${p}image-32.svg`:-1!==e.indexOf("audio/")?`${p}sound-32.svg`:-1!==e.indexOf("video/")?`${p}video-32.svg`:-1!==e.indexOf("msexcel")||-1!==e.indexOf("ms-excel")||-1!==e.indexOf("spreadsheetml")?`${p}excel-32.svg`:-1!==e.indexOf("msword")||-1!==e.indexOf("ms-word")||-1!==e.indexOf("wordprocessingml")?`${p}word-32.svg`:-1!==e.indexOf("powerpoint")||-1!==e.indexOf("presentationml")?`${p}report-32.svg`:`${p}generic-32.svg`:`${p}generic-32.svg`}export{p as getIconPath,e as isSupportedImage};
5
+ import{getAssetUrl as i}from"../../../assets.js";function e(i){const e=i.toLowerCase();return"image/bmp"===e||"image/emf"===e||"image/exif"===e||"image/gif"===e||"image/x-icon"===e||"image/jpeg"===e||"image/png"===e||"image/tiff"===e||"image/x-wmf"===e}function p(e){const p=i("esri/themes/base/images/files/");return e?"text/plain"===e?`${p}text-32.svg`:"application/pdf"===e?`${p}pdf-32.svg`:"text/csv"===e?`${p}csv-32.svg`:"application/gpx+xml"===e?`${p}gpx-32.svg`:"application/x-dwf"===e?`${p}cad-32.svg`:"application/postscript"===e||"application/json"===e||"text/xml"===e||"model/vrml"===e?`${p}code-32.svg`:"application/x-zip-compressed"===e||"application/x-7z-compressed"===e||"application/x-gzip"===e||"application/x-tar"===e||"application/x-gtar"===e||"application/x-bzip2"===e||"application/gzip"===e||"application/x-compress"===e||"application/x-apple-diskimage"===e||"application/x-rar-compressed"===e||"application/zip"===e?`${p}zip-32.svg`:e.includes("image/")?`${p}image-32.svg`:e.includes("audio/")?`${p}sound-32.svg`:e.includes("video/")?`${p}video-32.svg`:e.includes("msexcel")||e.includes("ms-excel")||e.includes("spreadsheetml")?`${p}excel-32.svg`:e.includes("msword")||e.includes("ms-word")||e.includes("wordprocessingml")?`${p}word-32.svg`:e.includes("powerpoint")||e.includes("presentationml")?`${p}report-32.svg`:`${p}generic-32.svg`:`${p}generic-32.svg`}export{p as getIconPath,e as isSupportedImage};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../chunks/tslib.es6.js";import e from"../core/Error.js";import{formatFileSize as s}from"../core/unitFormatUtils.js";import{on as i,init as a}from"../core/watchUtils.js";import{aliasOf as n}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as r}from"../core/accessorSupport/decorators/cast.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import m from"./Widget.js";import d from"./Attachments/AttachmentsViewModel.js";import{isSupportedImage as c,getIconPath as h}from"./Attachments/support/attachmentUtils.js";import{storeNode as u,discardNode as p,isRTL as b}from"./support/widgetUtils.js";import{messageBundle as g}from"./support/decorators/messageBundle.js";import"../core/Logger.js";import{tsx as _}from"./support/jsxFactory.js";const f={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},v={base:"esri-attachments",loaderContainer:"esri-attachments__loader-container",loader:"esri-attachments__loader",fadeIn:"esri-attachments--fade-in",container:"esri-attachments__container",containerList:"esri-attachments__container--list",containerPreview:"esri-attachments__container--preview",actions:"esri-attachments__actions",deleteButton:"esri-attachments__delete-button",addAttachmentButton:"esri-attachments__add-attachment-button",errorMessage:"esri-attachments__error-message",items:"esri-attachments__items",item:"esri-attachments__item",itemButton:"esri-attachments__item-button",itemMask:"esri-attachments__item-mask",itemMaskIcon:"esri-attachments__item-mask--icon",itemImage:"esri-attachments__image",itemImageResizable:"esri-attachments__image--resizable",itemLabel:"esri-attachments__label",itemFilename:"esri-attachments__filename",itemChevronIcon:"esri-attachments__item-chevron-icon",itemLink:"esri-attachments__item-link",itemLinkOverlay:"esri-attachments__item-link-overlay",itemLinkOverlayIcon:"esri-attachments__item-link-overlay-icon",itemEditIcon:"esri-attachments__item-edit-icon",itemAddIcon:"esri-attachments__item-add-icon",itemAddButton:"esri-attachments__item-add-button",formNode:"esri-attachments__form-node",fileFieldset:"esri-attachments__file-fieldset",fileLabel:"esri-attachments__file-label",fileName:"esri-attachments__file-name",fileInput:"esri-attachments__file-input",metadata:"esri-attachments__metadata",metadataFieldset:"esri-attachments__metadata-fieldset",progressBar:"esri-attachments__progress-bar",esriWidget:"esri-widget",esriButton:"esri-button",buttonDisabled:"esri-button--disabled",esriButtonSecondary:"esri-button--secondary",esriButtonTertiary:"esri-button--tertiary",esriButtonThird:"esri-button--third",esriButtonSmall:"esri-button--small",esriButtonHalf:"esri-button--half",empty:"esri-widget__content--empty",iconExternalLink:"esri-icon-link-external",iconEdit:"esri-icon-edit",iconRight:"esri-icon-right",iconLeft:"esri-icon-left",iconPlus:"esri-icon-plus"},y=window.CSS;let B=class extends m{constructor(t,e){super(t,e),this.abilities=null,this.displayType="auto",this.graphic=null,this.label=void 0,this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=new d,this.visibleElements={...f},this._supportsImageOrientation=y&&y.supports&&y.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}initialize(){this.own(i(this,"viewModel.attachmentInfos","change",(()=>this.scheduleRender())),a(this,"viewModel.mode",(()=>this._modeChanged())))}get effectiveDisplayType(){const{displayType:t}=this;return t&&"auto"!==t?t:this.viewModel.supportsResizeAttachments?"preview":"list"}castVisibleElements(t){return{...f,...t}}addAttachment(){const{_addAttachmentForm:t,viewModel:s}=this;return this._set("submitting",!0),this._set("error",null),s.addAttachment(t).then((t=>(this._set("submitting",!1),this._set("error",null),s.mode="view",t))).catch((t=>{throw this._set("submitting",!1),this._set("error",new e("attachments:add-attachment",this.messages.addErrorMessage,t)),t}))}deleteAttachment(t){const{viewModel:s}=this;return this._set("submitting",!0),this._set("error",null),s.deleteAttachment(t).then((t=>(this._set("submitting",!1),this._set("error",null),s.mode="view",t))).catch((t=>{throw this._set("submitting",!1),this._set("error",new e("attachments:delete-attachment",this.messages.deleteErrorMessage,t)),t}))}updateAttachment(){const{viewModel:t}=this,{_updateAttachmentForm:s}=this;return this._set("submitting",!0),this._set("error",null),t.updateAttachment(s).then((e=>(this._set("submitting",!1),this._set("error",null),t.mode="view",e))).catch((t=>{throw this._set("submitting",!1),this._set("error",new e("attachments:update-attachment",this.messages.updateErrorMessage,t)),t}))}render(){const{submitting:t,viewModel:e}=this,{state:s}=e;return _("div",{class:this.classes(v.base,v.esriWidget)},t?this.renderProgressBar():null,"loading"===s?this.renderLoading():this.renderAttachments(),this.renderErrorMessage())}renderErrorMessage(){const{error:t,visibleElements:e}=this;return t&&e.errorMessage?_("div",{key:"error-message",class:v.errorMessage},t.message):null}renderAttachments(){const{mode:t,activeAttachmentInfo:e}=this.viewModel;return"add"===t?this.renderAddForm():"edit"===t?this.renderDetailsForm(e):this.renderAttachmentContainer()}renderLoading(){return _("div",{class:v.loaderContainer,key:"loader"},_("div",{class:v.loader}))}renderProgressBar(){return this.visibleElements.progressBar?_("div",{class:v.progressBar,key:"progress-bar"}):null}renderAddForm(){const{submitting:t,selectedFile:e}=this,s=t||!e,i=this.visibleElements.cancelAddButton?_("button",{type:"button",bind:this,disabled:t,onclick:this._cancelForm,class:this.classes(v.esriButton,v.esriButtonTertiary,v.esriButtonSmall,v.esriButtonHalf,t&&v.buttonDisabled)},this.messages.cancel):null,a=this.visibleElements.addSubmitButton?_("button",{type:"submit",disabled:s,class:this.classes(v.esriButton,v.esriButtonSecondary,v.esriButtonSmall,v.esriButtonHalf,{[v.buttonDisabled]:s})},this.messages.add):null,n=e?_("span",{key:"file-name",class:v.fileName},e.name):null,r=_("form",{bind:this,afterCreate:u,afterRemoved:p,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},_("fieldset",{class:v.fileFieldset},n,_("label",{class:this.classes(v.fileLabel,v.esriButton,v.esriButtonSecondary)},e?this.messages.changeFile:this.messages.selectFile,_("input",{class:v.fileInput,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))),a,i);return _("div",{key:"add-form-container",class:v.formNode},r)}renderDetailsForm(t){const{visibleElements:e,viewModel:i,selectedFile:a,submitting:n}=this,{contentType:r,size:o,url:l}=t,{abilities:m}=i,d=n||!a,c=m.editing&&m.operations.delete&&e.deleteButton?_("button",{key:"delete-button",type:"button",disabled:n,bind:this,onclick:e=>this._submitDeleteAttachment(e,t),class:this.classes(v.esriButton,v.esriButtonSmall,v.esriButtonTertiary,v.deleteButton,{[v.buttonDisabled]:n})},this.messages.delete):null,h=m.editing&&m.operations.update&&e.updateButton?_("button",{disabled:d,key:"update-button",type:"submit",class:this.classes(v.esriButton,v.esriButtonSmall,v.esriButtonThird,{[v.buttonDisabled]:d})},this.messages.update):null,b=this.visibleElements.cancelUpdateButton?_("button",{disabled:n,key:"cancel-button",type:"button",bind:this,onclick:this._cancelForm,class:this.classes(v.esriButton,v.esriButtonSmall,v.esriButtonTertiary,v.esriButtonThird,{[v.buttonDisabled]:n})},this.messages.cancel):null,g=a?_("span",{key:"file-name",class:v.fileName},a.name):null,f=m.editing&&m.operations.update?_("fieldset",{key:"file",class:v.fileFieldset},g,_("label",{class:this.classes(v.fileLabel,v.esriButton,v.esriButtonSecondary)},this.messages.changeFile,_("input",{class:v.fileInput,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))):null,y=_("fieldset",{key:"size",class:v.metadataFieldset},_("label",null,s(this.messagesUnits,o))),B=_("fieldset",{key:"content-type",class:v.metadataFieldset},_("label",null,r)),A=_("form",{bind:this,afterCreate:u,afterRemoved:p,"data-node-ref":"_updateAttachmentForm",onsubmit:this._submitUpdateAttachment},_("div",{class:v.metadata},y,B),f,_("div",{class:v.actions},c,b,h));return _("div",{key:"edit-form-container",class:v.formNode},_("a",{class:v.itemLink,href:l,rel:"noreferrer",target:"_blank"},this.renderImageMask({attachmentInfo:t,size:400}),_("div",{class:v.itemLinkOverlay},_("span",{class:v.itemLinkOverlayIcon},_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32"},_("path",{d:"M28 13h1v16H3V3h16v1H4v24h24zm-5-9h4.293L15.646 15.638l.707.707L28 4.707V9h1V3h-6z"}),_("path",{fill:"none",d:"M0 0h32v32H0z"}))))),A)}renderImageMask({attachmentInfo:t,size:e}){const{supportsResizeAttachments:s}=this.viewModel,{contentType:i,name:a,url:n}=t,r=s&&c(i),o=this._getCSSTransform(t,r),l=o?{transform:o,"image-orientation":"none"}:{},m=-1===n.indexOf("?")?"?":"&",d=r?`${n}${m}w=${e}`:h(i),u={[v.itemMaskIcon]:!r},p={[v.itemImageResizable]:s};return _("div",{class:this.classes(u,v.itemMask)},_("img",{styles:l,alt:a,src:d,class:this.classes(p,v.itemImage)}))}renderAttachmentInfo({attachmentInfo:t,displayType:e}){const{viewModel:s}=this,{abilities:i}=s,{name:a,url:n}=t,r=this.renderImageMask({attachmentInfo:t,size:"list"===e?48:400}),o=i.editing?_("span",{"aria-hidden":"true",class:this.classes(v.itemChevronIcon,b(this.container)?v.iconLeft:v.iconRight)}):null,l=[r,_("label",{class:v.itemLabel},_("span",{class:v.itemFilename},a||this.messages.noTitle),o)],m=i.editing?_("button",{key:"details-button",bind:this,class:v.itemButton,title:this.messages.attachmentDetails,"aria-label":this.messages.attachmentDetails,"data-attachment-info-id":t.id,onclick:()=>this._startEditAttachment(t),type:"button"},l):_("a",{key:"details-link",class:v.itemButton,href:n,target:"_blank"},l);return _("li",{class:v.item,key:t},m)}renderAttachmentContainer(){const{effectiveDisplayType:t,viewModel:e,visibleElements:s}=this,{attachmentInfos:i,abilities:a}=e,n=i&&i.length,r={[v.containerList]:"preview"!==t,[v.containerPreview]:"preview"===t},o=a.editing&&a.operations.add&&s.addButton?_("button",{bind:this,onclick:()=>this._startAddAttachment(),class:this.classes(v.esriButton,v.esriButtonTertiary,v.addAttachmentButton),type:"button"},_("span",{"aria-hidden":"true",class:this.classes(v.itemAddIcon,v.iconPlus)}),this.messages.add):null,l=n?_("ul",{class:v.items},i.toArray().map((e=>this.renderAttachmentInfo({attachmentInfo:e,displayType:t})))):_("div",{class:v.empty},this.messages.noAttachments);return _("div",{key:"attachments-container",class:this.classes(v.container,r)},l,o)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(t){const e=t.target,s=e&&e.files&&e.files.item(0);this._set("selectedFile",s)}_submitDeleteAttachment(t,e){t.preventDefault(),this.deleteAttachment(e)}_submitAddAttachment(t){t.preventDefault(),this.addAttachment()}_submitUpdateAttachment(t){t.preventDefault(),this.updateAttachment()}_startEditAttachment(t){const{viewModel:e}=this;e.activeAttachmentInfo=t,e.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(t){t.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(t,e){const{orientationInfo:s}=t;return!this._supportsImageOrientation&&e&&s?[s.rotation?`rotate(${s.rotation}deg)`:"",s.mirrored?"scaleX(-1)":""].join(" "):""}};t([n("viewModel.abilities")],B.prototype,"abilities",void 0),t([o()],B.prototype,"displayType",void 0),t([o({readOnly:!0})],B.prototype,"effectiveDisplayType",null),t([n("viewModel.graphic")],B.prototype,"graphic",void 0),t([o({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],B.prototype,"label",void 0),t([o(),g("esri/widgets/Attachments/t9n/Attachments")],B.prototype,"messages",void 0),t([o(),g("esri/core/t9n/Units")],B.prototype,"messagesUnits",void 0),t([o({readOnly:!0})],B.prototype,"selectedFile",void 0),t([o({readOnly:!0})],B.prototype,"submitting",void 0),t([o({readOnly:!0})],B.prototype,"error",void 0),t([o({type:d})],B.prototype,"viewModel",void 0),t([o()],B.prototype,"visibleElements",void 0),t([r("visibleElements")],B.prototype,"castVisibleElements",null),B=t([l("esri.widgets.Attachments")],B);const A=B;export{A as default};
5
+ import{_ as t}from"../chunks/tslib.es6.js";import e from"../core/Error.js";import{formatFileSize as s}from"../core/unitFormatUtils.js";import{on as i,init as a}from"../core/watchUtils.js";import{aliasOf as n}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as r}from"../core/accessorSupport/decorators/cast.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import m from"./Widget.js";import d from"./Attachments/AttachmentsViewModel.js";import{isSupportedImage as c,getIconPath as h}from"./Attachments/support/attachmentUtils.js";import{storeNode as u,discardNode as p,isRTL as b}from"./support/widgetUtils.js";import{messageBundle as g}from"./support/decorators/messageBundle.js";import"../core/Logger.js";import{tsx as _}from"./support/jsxFactory.js";const f={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},v={base:"esri-attachments",loaderContainer:"esri-attachments__loader-container",loader:"esri-attachments__loader",fadeIn:"esri-attachments--fade-in",container:"esri-attachments__container",containerList:"esri-attachments__container--list",containerPreview:"esri-attachments__container--preview",actions:"esri-attachments__actions",deleteButton:"esri-attachments__delete-button",addAttachmentButton:"esri-attachments__add-attachment-button",errorMessage:"esri-attachments__error-message",items:"esri-attachments__items",item:"esri-attachments__item",itemButton:"esri-attachments__item-button",itemMask:"esri-attachments__item-mask",itemMaskIcon:"esri-attachments__item-mask--icon",itemImage:"esri-attachments__image",itemImageResizable:"esri-attachments__image--resizable",itemLabel:"esri-attachments__label",itemFilename:"esri-attachments__filename",itemChevronIcon:"esri-attachments__item-chevron-icon",itemLink:"esri-attachments__item-link",itemLinkOverlay:"esri-attachments__item-link-overlay",itemLinkOverlayIcon:"esri-attachments__item-link-overlay-icon",itemEditIcon:"esri-attachments__item-edit-icon",itemAddIcon:"esri-attachments__item-add-icon",itemAddButton:"esri-attachments__item-add-button",formNode:"esri-attachments__form-node",fileFieldset:"esri-attachments__file-fieldset",fileLabel:"esri-attachments__file-label",fileName:"esri-attachments__file-name",fileInput:"esri-attachments__file-input",metadata:"esri-attachments__metadata",metadataFieldset:"esri-attachments__metadata-fieldset",progressBar:"esri-attachments__progress-bar",esriWidget:"esri-widget",esriButton:"esri-button",buttonDisabled:"esri-button--disabled",esriButtonSecondary:"esri-button--secondary",esriButtonTertiary:"esri-button--tertiary",esriButtonThird:"esri-button--third",esriButtonSmall:"esri-button--small",esriButtonHalf:"esri-button--half",empty:"esri-widget__content--empty",iconExternalLink:"esri-icon-link-external",iconEdit:"esri-icon-edit",iconRight:"esri-icon-right",iconLeft:"esri-icon-left",iconPlus:"esri-icon-plus"},y=window.CSS;let B=class extends m{constructor(t,e){super(t,e),this.abilities=null,this.displayType="auto",this.graphic=null,this.label=void 0,this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=new d,this.visibleElements={...f},this._supportsImageOrientation=y&&y.supports&&y.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}initialize(){this.own(i(this,"viewModel.attachmentInfos","change",(()=>this.scheduleRender())),a(this,"viewModel.mode",(()=>this._modeChanged())))}get effectiveDisplayType(){const{displayType:t}=this;return t&&"auto"!==t?t:this.viewModel.supportsResizeAttachments?"preview":"list"}castVisibleElements(t){return{...f,...t}}addAttachment(){const{_addAttachmentForm:t,viewModel:s}=this;return this._set("submitting",!0),this._set("error",null),s.addAttachment(t).then((t=>(this._set("submitting",!1),this._set("error",null),s.mode="view",t))).catch((t=>{throw this._set("submitting",!1),this._set("error",new e("attachments:add-attachment",this.messages.addErrorMessage,t)),t}))}deleteAttachment(t){const{viewModel:s}=this;return this._set("submitting",!0),this._set("error",null),s.deleteAttachment(t).then((t=>(this._set("submitting",!1),this._set("error",null),s.mode="view",t))).catch((t=>{throw this._set("submitting",!1),this._set("error",new e("attachments:delete-attachment",this.messages.deleteErrorMessage,t)),t}))}updateAttachment(){const{viewModel:t}=this,{_updateAttachmentForm:s}=this;return this._set("submitting",!0),this._set("error",null),t.updateAttachment(s).then((e=>(this._set("submitting",!1),this._set("error",null),t.mode="view",e))).catch((t=>{throw this._set("submitting",!1),this._set("error",new e("attachments:update-attachment",this.messages.updateErrorMessage,t)),t}))}render(){const{submitting:t,viewModel:e}=this,{state:s}=e;return _("div",{class:this.classes(v.base,v.esriWidget)},t?this.renderProgressBar():null,"loading"===s?this.renderLoading():this.renderAttachments(),this.renderErrorMessage())}renderErrorMessage(){const{error:t,visibleElements:e}=this;return t&&e.errorMessage?_("div",{key:"error-message",class:v.errorMessage},t.message):null}renderAttachments(){const{mode:t,activeAttachmentInfo:e}=this.viewModel;return"add"===t?this.renderAddForm():"edit"===t?this.renderDetailsForm(e):this.renderAttachmentContainer()}renderLoading(){return _("div",{class:v.loaderContainer,key:"loader"},_("div",{class:v.loader}))}renderProgressBar(){return this.visibleElements.progressBar?_("div",{class:v.progressBar,key:"progress-bar"}):null}renderAddForm(){const{submitting:t,selectedFile:e}=this,s=t||!e,i=this.visibleElements.cancelAddButton?_("button",{type:"button",bind:this,disabled:t,onclick:this._cancelForm,class:this.classes(v.esriButton,v.esriButtonTertiary,v.esriButtonSmall,v.esriButtonHalf,t&&v.buttonDisabled)},this.messages.cancel):null,a=this.visibleElements.addSubmitButton?_("button",{type:"submit",disabled:s,class:this.classes(v.esriButton,v.esriButtonSecondary,v.esriButtonSmall,v.esriButtonHalf,{[v.buttonDisabled]:s})},this.messages.add):null,n=e?_("span",{key:"file-name",class:v.fileName},e.name):null,r=_("form",{bind:this,afterCreate:u,afterRemoved:p,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},_("fieldset",{class:v.fileFieldset},n,_("label",{class:this.classes(v.fileLabel,v.esriButton,v.esriButtonSecondary)},e?this.messages.changeFile:this.messages.selectFile,_("input",{class:v.fileInput,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))),a,i);return _("div",{key:"add-form-container",class:v.formNode},r)}renderDetailsForm(t){const{visibleElements:e,viewModel:i,selectedFile:a,submitting:n}=this,{contentType:r,size:o,url:l}=t,{abilities:m}=i,d=n||!a,c=m.editing&&m.operations.delete&&e.deleteButton?_("button",{key:"delete-button",type:"button",disabled:n,bind:this,onclick:e=>this._submitDeleteAttachment(e,t),class:this.classes(v.esriButton,v.esriButtonSmall,v.esriButtonTertiary,v.deleteButton,{[v.buttonDisabled]:n})},this.messages.delete):null,h=m.editing&&m.operations.update&&e.updateButton?_("button",{disabled:d,key:"update-button",type:"submit",class:this.classes(v.esriButton,v.esriButtonSmall,v.esriButtonThird,{[v.buttonDisabled]:d})},this.messages.update):null,b=this.visibleElements.cancelUpdateButton?_("button",{disabled:n,key:"cancel-button",type:"button",bind:this,onclick:this._cancelForm,class:this.classes(v.esriButton,v.esriButtonSmall,v.esriButtonTertiary,v.esriButtonThird,{[v.buttonDisabled]:n})},this.messages.cancel):null,g=a?_("span",{key:"file-name",class:v.fileName},a.name):null,f=m.editing&&m.operations.update?_("fieldset",{key:"file",class:v.fileFieldset},g,_("label",{class:this.classes(v.fileLabel,v.esriButton,v.esriButtonSecondary)},this.messages.changeFile,_("input",{class:v.fileInput,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))):null,y=_("fieldset",{key:"size",class:v.metadataFieldset},_("label",null,s(this.messagesUnits,o))),B=_("fieldset",{key:"content-type",class:v.metadataFieldset},_("label",null,r)),A=_("form",{bind:this,afterCreate:u,afterRemoved:p,"data-node-ref":"_updateAttachmentForm",onsubmit:this._submitUpdateAttachment},_("div",{class:v.metadata},y,B),f,_("div",{class:v.actions},c,b,h));return _("div",{key:"edit-form-container",class:v.formNode},_("a",{class:v.itemLink,href:l,rel:"noreferrer",target:"_blank"},this.renderImageMask({attachmentInfo:t,size:400}),_("div",{class:v.itemLinkOverlay},_("span",{class:v.itemLinkOverlayIcon},_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32"},_("path",{d:"M28 13h1v16H3V3h16v1H4v24h24zm-5-9h4.293L15.646 15.638l.707.707L28 4.707V9h1V3h-6z"}),_("path",{fill:"none",d:"M0 0h32v32H0z"}))))),A)}renderImageMask({attachmentInfo:t,size:e}){const{supportsResizeAttachments:s}=this.viewModel,{contentType:i,name:a,url:n}=t,r=s&&c(i),o=this._getCSSTransform(t,r),l=o?{transform:o,"image-orientation":"none"}:{},m=n.includes("?")?"&":"?",d=r?`${n}${m}w=${e}`:h(i),u={[v.itemMaskIcon]:!r},p={[v.itemImageResizable]:s};return _("div",{class:this.classes(u,v.itemMask)},_("img",{styles:l,alt:a,src:d,class:this.classes(p,v.itemImage)}))}renderAttachmentInfo({attachmentInfo:t,displayType:e}){const{viewModel:s}=this,{abilities:i}=s,{name:a,url:n}=t,r=this.renderImageMask({attachmentInfo:t,size:"list"===e?48:400}),o=i.editing?_("span",{"aria-hidden":"true",class:this.classes(v.itemChevronIcon,b(this.container)?v.iconLeft:v.iconRight)}):null,l=[r,_("label",{class:v.itemLabel},_("span",{class:v.itemFilename},a||this.messages.noTitle),o)],m=i.editing?_("button",{key:"details-button",bind:this,class:v.itemButton,title:this.messages.attachmentDetails,"aria-label":this.messages.attachmentDetails,"data-attachment-info-id":t.id,onclick:()=>this._startEditAttachment(t),type:"button"},l):_("a",{key:"details-link",class:v.itemButton,href:n,target:"_blank"},l);return _("li",{class:v.item,key:t},m)}renderAttachmentContainer(){const{effectiveDisplayType:t,viewModel:e,visibleElements:s}=this,{attachmentInfos:i,abilities:a}=e,n=i&&i.length,r={[v.containerList]:"preview"!==t,[v.containerPreview]:"preview"===t},o=a.editing&&a.operations.add&&s.addButton?_("button",{bind:this,onclick:()=>this._startAddAttachment(),class:this.classes(v.esriButton,v.esriButtonTertiary,v.addAttachmentButton),type:"button"},_("span",{"aria-hidden":"true",class:this.classes(v.itemAddIcon,v.iconPlus)}),this.messages.add):null,l=n?_("ul",{class:v.items},i.toArray().map((e=>this.renderAttachmentInfo({attachmentInfo:e,displayType:t})))):_("div",{class:v.empty},this.messages.noAttachments);return _("div",{key:"attachments-container",class:this.classes(v.container,r)},l,o)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(t){const e=t.target,s=e&&e.files&&e.files.item(0);this._set("selectedFile",s)}_submitDeleteAttachment(t,e){t.preventDefault(),this.deleteAttachment(e)}_submitAddAttachment(t){t.preventDefault(),this.addAttachment()}_submitUpdateAttachment(t){t.preventDefault(),this.updateAttachment()}_startEditAttachment(t){const{viewModel:e}=this;e.activeAttachmentInfo=t,e.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(t){t.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(t,e){const{orientationInfo:s}=t;return!this._supportsImageOrientation&&e&&s?[s.rotation?`rotate(${s.rotation}deg)`:"",s.mirrored?"scaleX(-1)":""].join(" "):""}};t([n("viewModel.abilities")],B.prototype,"abilities",void 0),t([o()],B.prototype,"displayType",void 0),t([o({readOnly:!0})],B.prototype,"effectiveDisplayType",null),t([n("viewModel.graphic")],B.prototype,"graphic",void 0),t([o({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],B.prototype,"label",void 0),t([o(),g("esri/widgets/Attachments/t9n/Attachments")],B.prototype,"messages",void 0),t([o(),g("esri/core/t9n/Units")],B.prototype,"messagesUnits",void 0),t([o({readOnly:!0})],B.prototype,"selectedFile",void 0),t([o({readOnly:!0})],B.prototype,"submitting",void 0),t([o({readOnly:!0})],B.prototype,"error",void 0),t([o({type:d})],B.prototype,"viewModel",void 0),t([o()],B.prototype,"visibleElements",void 0),t([r("visibleElements")],B.prototype,"castVisibleElements",null),B=t([l("esri.widgets.Attachments")],B);const A=B;export{A as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{on as t}from"../core/watchUtils.js";import{aliasOf as i}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import s from"./Widget.js";import n from"./Attribution/AttributionViewModel.js";import{accessibleHandler as p}from"./support/decorators/accessibleHandler.js";import{messageBundle as a}from"./support/decorators/messageBundle.js";import"../core/Logger.js";import{tsx as d}from"./support/jsxFactory.js";import"./support/widgetUtils.js";const c={base:"esri-attribution esri-widget",poweredBy:"esri-attribution__powered-by",sources:"esri-attribution__sources",open:"esri-attribution--open",sourcesOpen:"esri-attribution__sources--open",link:"esri-attribution__link",widgetIcon:"esri-icon-description",interactive:"esri-interactive"};let l=class extends s{constructor(e,t){super(e,t),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this.iconClass=c.widgetIcon,this.itemDelimiter=" | ",this.label=void 0,this.messages=null,this.view=null,this.viewModel=new n}initialize(){this.own(t(this,"viewModel.items","change",(()=>this.scheduleRender())))}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce(((e,t)=>(-1===e.indexOf(t.text)&&e.push(t.text),e)),[]).join(this.itemDelimiter)}render(){const e={[c.open]:this._isOpen};return d("div",{bind:this,class:this.classes(c.base,e),onclick:this._toggleState,onkeydown:this._toggleState},this.renderSourcesNode(),this.renderPoweredBy())}renderPoweredBy(){return d("div",{class:c.poweredBy},"Powered by"," ",d("a",{class:c.link,href:"http://www.esri.com/",target:"_blank",rel:"noreferrer"},"Esri"))}renderSourcesNode(){const e=this._isOpen,t=this._isInteractive,i=t?0:-1,{attributionText:r}=this,o=t?"button":void 0,s={[c.sourcesOpen]:e,[c.interactive]:t};return d("div",{afterCreate:this._afterSourcesNodeCreate,afterUpdate:this._afterSourcesNodeUpdate,bind:this,class:this.classes(c.sources,s),innerHTML:r,role:o,tabIndex:i})}_afterSourcesNodeCreate(e){this._prevSourceNodeHeight=e.clientWidth}_afterSourcesNodeUpdate(e){let t=!1;const{clientHeight:i,clientWidth:r,scrollWidth:o}=e,s=o>=r,n=this._attributionTextOverflowed!==s;if(this._attributionTextOverflowed=s,n&&(t=!0),this._isOpen){const e=i<this._prevSourceNodeHeight;this._prevSourceNodeHeight=i,e&&(this._isOpen=!1,t=!0)}t&&this.scheduleRender()}_toggleState(){this._isInteractive&&(this._isOpen=!this._isOpen)}};e([r()],l.prototype,"_isOpen",void 0),e([r()],l.prototype,"_isInteractive",null),e([r()],l.prototype,"_attributionTextOverflowed",void 0),e([r()],l.prototype,"_prevSourceNodeHeight",void 0),e([r({readOnly:!0,dependsOn:["viewModel.items.length","itemDelimiter"]})],l.prototype,"attributionText",null),e([r()],l.prototype,"iconClass",void 0),e([r()],l.prototype,"itemDelimiter",void 0),e([r({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],l.prototype,"label",void 0),e([r(),a("esri/widgets/Attribution/t9n/Attribution")],l.prototype,"messages",void 0),e([i("viewModel.view")],l.prototype,"view",void 0),e([r({type:n})],l.prototype,"viewModel",void 0),e([p()],l.prototype,"_toggleState",null),l=e([o("esri.widgets.Attribution")],l);const u=l;export{u as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{on as t}from"../core/watchUtils.js";import{aliasOf as i}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import s from"./Widget.js";import n from"./Attribution/AttributionViewModel.js";import{accessibleHandler as p}from"./support/decorators/accessibleHandler.js";import{messageBundle as a}from"./support/decorators/messageBundle.js";import"../core/Logger.js";import{tsx as d}from"./support/jsxFactory.js";import"./support/widgetUtils.js";const c={base:"esri-attribution esri-widget",poweredBy:"esri-attribution__powered-by",sources:"esri-attribution__sources",open:"esri-attribution--open",sourcesOpen:"esri-attribution__sources--open",link:"esri-attribution__link",widgetIcon:"esri-icon-description",interactive:"esri-interactive"};let l=class extends s{constructor(e,t){super(e,t),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this.iconClass=c.widgetIcon,this.itemDelimiter=" | ",this.label=void 0,this.messages=null,this.view=null,this.viewModel=new n}initialize(){this.own(t(this,"viewModel.items","change",(()=>this.scheduleRender())))}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce(((e,t)=>(e.includes(t.text)||e.push(t.text),e)),[]).join(this.itemDelimiter)}render(){const e={[c.open]:this._isOpen};return d("div",{bind:this,class:this.classes(c.base,e),onclick:this._toggleState,onkeydown:this._toggleState},this.renderSourcesNode(),this.renderPoweredBy())}renderPoweredBy(){return d("div",{class:c.poweredBy},"Powered by"," ",d("a",{class:c.link,href:"http://www.esri.com/",target:"_blank",rel:"noreferrer"},"Esri"))}renderSourcesNode(){const e=this._isOpen,t=this._isInteractive,i=t?0:-1,{attributionText:r}=this,o=t?"button":void 0,s={[c.sourcesOpen]:e,[c.interactive]:t};return d("div",{afterCreate:this._afterSourcesNodeCreate,afterUpdate:this._afterSourcesNodeUpdate,bind:this,class:this.classes(c.sources,s),innerHTML:r,role:o,tabIndex:i})}_afterSourcesNodeCreate(e){this._prevSourceNodeHeight=e.clientWidth}_afterSourcesNodeUpdate(e){let t=!1;const{clientHeight:i,clientWidth:r,scrollWidth:o}=e,s=o>=r,n=this._attributionTextOverflowed!==s;if(this._attributionTextOverflowed=s,n&&(t=!0),this._isOpen){const e=i<this._prevSourceNodeHeight;this._prevSourceNodeHeight=i,e&&(this._isOpen=!1,t=!0)}t&&this.scheduleRender()}_toggleState(){this._isInteractive&&(this._isOpen=!this._isOpen)}};e([r()],l.prototype,"_isOpen",void 0),e([r()],l.prototype,"_isInteractive",null),e([r()],l.prototype,"_attributionTextOverflowed",void 0),e([r()],l.prototype,"_prevSourceNodeHeight",void 0),e([r({readOnly:!0,dependsOn:["viewModel.items.length","itemDelimiter"]})],l.prototype,"attributionText",null),e([r()],l.prototype,"iconClass",void 0),e([r()],l.prototype,"itemDelimiter",void 0),e([r({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],l.prototype,"label",void 0),e([r(),a("esri/widgets/Attribution/t9n/Attribution")],l.prototype,"messages",void 0),e([i("viewModel.view")],l.prototype,"view",void 0),e([r({type:n})],l.prototype,"viewModel",void 0),e([p()],l.prototype,"_toggleState",null),l=e([o("esri.widgets.Attribution")],l);const u=l;export{u as default};