@arcgis/core 5.0.0-next.63 → 5.0.0-next.65

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 (598) hide show
  1. package/Ground.d.ts +2 -1
  2. package/Ground.js +1 -1
  3. package/WebDocument2D.js +1 -1
  4. package/WebLinkChart.js +1 -1
  5. package/WebMap.d.ts +1 -1
  6. package/WebMap.js +1 -1
  7. package/WebScene.d.ts +1 -1
  8. package/WebScene.js +1 -1
  9. package/applications/KnowledgeStudio/dataModelVisualization.d.ts +18 -0
  10. package/applications/KnowledgeStudio/dataModelVisualization.js +5 -0
  11. package/applications/MapViewer/templateUtils.d.ts +2 -2
  12. package/applications/Urban/LineImagePattern3D.d.ts +8 -0
  13. package/applications/Urban/LineImagePattern3D.js +5 -0
  14. package/applications/Urban/imagePatternUtils.d.ts +23 -0
  15. package/applications/Urban/imagePatternUtils.js +5 -0
  16. package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
  17. package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
  18. package/assets/esri/core/workers/RemoteClient.js +1 -1
  19. package/assets/esri/core/workers/chunks/{61707c22b029c2a7a397.js → 049c125085028ffdd0dd.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{0bd73a66baea2f52e8a6.js → 07639f406b71bb49ffd6.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{df0e5570174bf0942d7a.js → 0d9e1ccc3ba8b5ed3287.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{4404b6f931f681cca342.js → 0e5cd0cf6ab7cb37d723.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{a624dd283d264dce35a8.js → 0f5693541111fcae0c2f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{f56906c443ce8ff68a27.js → 13d61d34e55c80e4ecdf.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{28b235b56a83c498d73f.js → 168ec8fca2702617a543.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{831b8282380844a7c4d5.js → 1967239713b58dccfd81.js} +1 -1
  27. package/assets/esri/core/workers/chunks/1b838638e66e82d76cf3.js +1 -0
  28. package/assets/esri/core/workers/chunks/{2209550b6510e25da375.js → 226acd251ad7d7ee3b57.js} +1 -1
  29. package/assets/esri/core/workers/chunks/22dd5cecc7e2d4d0baf8.js +316 -0
  30. package/assets/esri/core/workers/chunks/2402d305a77fef4694a0.js +1 -0
  31. package/assets/esri/core/workers/chunks/{893a5ab0c2df9262efd8.js → 251eb6e00f99a816d55c.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{e47535f795b15608a6cb.js → 27f096c434f049b8df01.js} +1 -1
  33. package/assets/esri/core/workers/chunks/29b09db309ff75fb3e97.js +1 -0
  34. package/assets/esri/core/workers/chunks/{bef2a70d382515b3c84e.js → 310f3268582e61cd86da.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{02cf735176f286a48dd2.js → 3371935a4fd6346d3a17.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{36d15c35fbbd4dedd5cb.js → 3c3d311b88f5400951ef.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{cf3a9ead26629f3508b3.js → 3c4f8597f602779174f1.js} +1 -1
  38. package/assets/esri/core/workers/chunks/43d28c6509c21b8917a8.js +1 -0
  39. package/assets/esri/core/workers/chunks/{951e3c911a3486b1e609.js → 45b898367b6224dda46f.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{57302b92e9899cce4ba3.js → 4785cd108e2dec6e1697.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{153ff2ceefccd946498b.js → 47bfe8dd5d2bac4307ac.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{2abc205f81f26fc4852b.js → 49a1b7f700b8a42de817.js} +4 -4
  43. package/assets/esri/core/workers/chunks/4d6d962d25aa836f53ee.js +1 -0
  44. package/assets/esri/core/workers/chunks/{454c15367cccbf63af7a.js → 4e9a8fce55cad841c731.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{b93f2bd6429879f92143.js → 536c492fdda30f2f1288.js} +1 -1
  46. package/assets/esri/core/workers/chunks/5cee6c3ff23fb93f857a.js +1 -0
  47. package/assets/esri/core/workers/chunks/6035daa65fc3ebf86515.js +1 -0
  48. package/assets/esri/core/workers/chunks/62b28f73f814413c10fc.js +1 -0
  49. package/assets/esri/core/workers/chunks/{0bc01d71ed1ab8c3af3c.js → 6599cc702a46f81a5634.js} +1 -1
  50. package/assets/esri/core/workers/chunks/6925f09d44cc38480d53.js +1 -0
  51. package/assets/esri/core/workers/chunks/{72e3a48aa365542b0689.js → 6a782e8475bff4d56dbc.js} +1 -1
  52. package/assets/esri/core/workers/chunks/6ba3c2b9f699d94d62b8.js +1 -0
  53. package/assets/esri/core/workers/chunks/{f44f358db5c56d5bbc0c.js → 7306b5b66e738a281d83.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{2da13c2269ab90281143.js → 7694abe44d55dae8872d.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{2b34a010f76e5f289868.js → 7bf491b468cd74a4166c.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{05ab54b81c366e98138f.js → 7d8664aeff66e34138bd.js} +1 -1
  57. package/assets/esri/core/workers/chunks/822ef6a043c7e147b4b6.js +1 -0
  58. package/assets/esri/core/workers/chunks/878010ca23da0bca9405.js +1 -0
  59. package/assets/esri/core/workers/chunks/892157696e8f9e38c472.js +1 -0
  60. package/assets/esri/core/workers/chunks/{d2abfcb0c8bf894c7f72.js → 8dca61f8ba6689379f86.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{bce81df760f5e34c01d7.js → 964de713042f52d71e42.js} +1 -1
  62. package/assets/esri/core/workers/chunks/990341f7c47bd656c782.js +1 -0
  63. package/assets/esri/core/workers/chunks/9d6945cda99d14af83ac.js +1 -0
  64. package/assets/esri/core/workers/chunks/{5180b15f1a865756a02e.js → a3836f6a93924ee4816e.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{d13b2ce8a89938b0472b.js → a6dcd13c792b6538ac50.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{522a6787d9e0f520ac79.js → a893f8db2477cf677ac8.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{983356eb4fd0a0dcf3fd.js → abc236e99b52be1c83b9.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{b11c0e80e583f2b7c5de.js → ac83c2999a3d2ffb4356.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{5873c7b65d0fb04998fb.js → acea42d268b53ceb2bfd.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{8628bf45a33af786cd49.js → b65fcfde62d49de1fa54.js} +1 -1
  71. package/assets/esri/core/workers/chunks/ba7f57788847cc0f68df.js +1 -0
  72. package/assets/esri/core/workers/chunks/{12f700b932a241e59071.js → bcf612eabe7577540953.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{75e9759290f0f67b2128.js → bf06250be7a7a36306b1.js} +1 -1
  74. package/assets/esri/core/workers/chunks/c3007b916ba933137709.js +1 -0
  75. package/assets/esri/core/workers/chunks/c9f868f85d740ee32715.js +1 -0
  76. package/assets/esri/core/workers/chunks/cc5c1887e6d7079e5fe3.js +1 -0
  77. package/assets/esri/core/workers/chunks/ce8f075c814a8378c00c.js +1 -0
  78. package/assets/esri/core/workers/chunks/{f91e63d7842c427c7f72.js → d30cfc5fa302cc08d862.js} +1 -1
  79. package/assets/esri/core/workers/chunks/d3325ed8d224e2350db7.js +1 -0
  80. package/assets/esri/core/workers/chunks/{1800994523d7cdfb73af.js → de71db3b0fb947b13c97.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{ff7df6fb78fa2c0e9247.js → df92239eefff04471a0b.js} +1 -1
  82. package/assets/esri/core/workers/chunks/e69255e38ff200dda14b.js +1 -0
  83. package/assets/esri/core/workers/chunks/ee2ca25048a920e43743.js +1 -0
  84. package/assets/esri/core/workers/chunks/{609919428305d8c8c243.js → f9370830051865a3435b.js} +1 -1
  85. package/assets/esri/core/workers/chunks/fc00d7278b43df813c54.js +1 -0
  86. package/assets/esri/themes/base/widgets/_UtilityNetworkAssociations.scss +7 -18
  87. package/assets/esri/themes/dark/main.css +1 -1
  88. package/assets/esri/themes/light/main.css +1 -1
  89. package/assets/esri/themes/light/view.css +1 -1
  90. package/chunks/RibbonLine.glsl.js +99 -61
  91. package/chunks/libtess-f32.js +5 -0
  92. package/chunks/libtess-f64.js +5 -0
  93. package/config.js +1 -1
  94. package/core/Version.d.ts +1 -1
  95. package/core/Version.js +1 -1
  96. package/core/has.js +1 -1
  97. package/core/workers/registry.js +1 -1
  98. package/core/workers/workerFactory.js +1 -1
  99. package/form/elements/inputs/SwitchInput.d.ts +2 -1
  100. package/geometry/Mesh.d.ts +2 -1
  101. package/geometry/Mesh.js +1 -1
  102. package/geometry/libtess.js +1 -1
  103. package/geometry/support/MeshVertexAttributes.d.ts +1 -1
  104. package/geometry/support/MeshVertexAttributes.js +1 -1
  105. package/geometry/support/meshUtils/convertMeshVertexSpace.js +1 -1
  106. package/geometry/support/meshUtils/elevation.js +1 -1
  107. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  108. package/geometry/support/meshUtils/merge.js +1 -1
  109. package/geometry/support/meshUtils/primitives.js +1 -1
  110. package/ground/NavigationConstraint.d.ts +1 -1
  111. package/ground/NavigationConstraint.js +1 -1
  112. package/interfaces.d.ts +163 -158
  113. package/kernel.js +1 -1
  114. package/layers/BaseElevationLayer.d.ts +1 -1
  115. package/layers/ElevationLayer.d.ts +1 -1
  116. package/layers/ElevationLayer.js +1 -1
  117. package/layers/FeatureLayer.d.ts +1 -5
  118. package/layers/Layer.d.ts +1 -2
  119. package/layers/ParquetLayer.js +1 -1
  120. package/layers/SceneLayer.js +1 -1
  121. package/layers/knowledgeGraph/dataModelVisualizationUtils.d.ts +11 -0
  122. package/layers/knowledgeGraph/dataModelVisualizationUtils.js +5 -0
  123. package/layers/mixins/ArcGISMapService.js +1 -1
  124. package/layers/mixins/BlendLayer.d.ts +1 -1
  125. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  126. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  127. package/layers/raster/formats/RasterCodec.js +1 -1
  128. package/layers/raster/functions/ColormapToRGBFunction.js +1 -1
  129. package/layers/raster/functions/surfaceUtils.js +1 -1
  130. package/layers/support/CodedValue.d.ts +1 -1
  131. package/layers/support/CodedValue.js +1 -1
  132. package/layers/support/CodedValueDomain.d.ts +2 -1
  133. package/layers/support/CodedValueDomain.js +1 -1
  134. package/layers/support/ElevationTileData.d.ts +1 -1
  135. package/layers/support/ElevationTileData.js +1 -1
  136. package/layers/support/FeatureReduction.d.ts +1 -1
  137. package/layers/support/FeatureReduction.js +1 -1
  138. package/layers/support/FeatureReductionBinning.d.ts +1 -1
  139. package/layers/support/FeatureReductionBinning.js +1 -1
  140. package/layers/support/FeatureReductionSelection.d.ts +1 -1
  141. package/layers/support/FeatureReductionSelection.js +1 -1
  142. package/layers/support/KMLMapImage.d.ts +1 -1
  143. package/layers/support/KMLMapImage.js +1 -1
  144. package/layers/support/ParquetGeometryEncodingBase.d.ts +1 -1
  145. package/layers/support/ParquetGeometryEncodingBase.js +1 -1
  146. package/layers/support/ParquetGeometryEncodingLocation.d.ts +1 -1
  147. package/layers/support/ParquetGeometryEncodingLocation.js +1 -1
  148. package/layers/support/ParquetGeometryEncodingWkb.d.ts +1 -1
  149. package/layers/support/ParquetGeometryEncodingWkb.js +1 -1
  150. package/layers/support/PixelBlock.d.ts +1 -1
  151. package/layers/support/PixelBlock.js +1 -1
  152. package/layers/support/SimpleBandStatistics.d.ts +1 -1
  153. package/layers/support/SimpleBandStatistics.js +1 -1
  154. package/layers/support/Sublayer.js +1 -1
  155. package/layers/support/featureLayerUtils.js +1 -1
  156. package/layers/support/featureReductionUtils.js +1 -1
  157. package/layers/support/source/DataLayerSource.d.ts +6 -3
  158. package/layers/support/source/DataLayerSource.js +1 -1
  159. package/layers/support/source/MapLayerSource.d.ts +1 -1
  160. package/layers/support/source/MapLayerSource.js +1 -1
  161. package/layers/support/source/QueryTableDataSource.d.ts +1 -1
  162. package/layers/support/source/QueryTableDataSource.js +1 -1
  163. package/layers/support/source/RasterDataSource.d.ts +1 -1
  164. package/layers/support/source/RasterDataSource.js +1 -1
  165. package/layers/support/source/TableDataSource.d.ts +1 -1
  166. package/layers/support/source/TableDataSource.js +1 -1
  167. package/layers/support/source/types.d.ts +1 -1
  168. package/layers/types.d.ts +7 -1
  169. package/package.json +1 -1
  170. package/popup/content/MediaContent.d.ts +2 -2
  171. package/popup/content/types.d.ts +9 -0
  172. package/portal/Portal.d.ts +3 -3
  173. package/portal/PortalGroup.d.ts +1 -1
  174. package/portal/PortalItem.d.ts +2 -2
  175. package/portal/PortalItemResource.d.ts +1 -1
  176. package/portal/PortalQueryParams.d.ts +1 -1
  177. package/portal/PortalUser.d.ts +5 -5
  178. package/portal/schemas/definitions.js +1 -1
  179. package/portal/support/resourceUtils.d.ts +1 -1
  180. package/renderers/HeatmapRenderer.d.ts +2 -1
  181. package/renderers/HeatmapRenderer.js +1 -1
  182. package/renderers/PieChartRenderer.d.ts +2 -1
  183. package/renderers/PieChartRenderer.js +1 -1
  184. package/renderers/support/AuthoringInfo.d.ts +2 -1
  185. package/renderers/support/AuthoringInfo.js +1 -1
  186. package/renderers/support/AuthoringInfoClassBreakInfo.d.ts +1 -1
  187. package/renderers/support/AuthoringInfoClassBreakInfo.js +1 -1
  188. package/renderers/support/AuthoringInfoFieldInfo.d.ts +3 -2
  189. package/renderers/support/AuthoringInfoFieldInfo.js +1 -1
  190. package/renderers/support/DictionaryScriptEvaluator.js +1 -1
  191. package/renderers/support/HeatmapLegendOptions.d.ts +1 -1
  192. package/renderers/support/HeatmapLegendOptions.js +1 -1
  193. package/renderers/support/OthersCategory.d.ts +1 -1
  194. package/renderers/support/OthersCategory.js +1 -1
  195. package/rest/featureService/types.d.ts +1 -1
  196. package/rest/knowledgeGraph/wasmInterface/wasmToDataModelFactories.js +1 -1
  197. package/rest/support/ArealUnit.d.ts +1 -1
  198. package/rest/support/BaseImageMeasureResultValue.d.ts +1 -1
  199. package/rest/support/BaseImageMeasureResultValue.js +1 -1
  200. package/rest/support/BufferParameters.d.ts +1 -1
  201. package/rest/support/ClosestFacilityParameters.d.ts +1 -1
  202. package/rest/support/DataLayer.d.ts +1 -1
  203. package/rest/support/DensifyParameters.d.ts +1 -1
  204. package/rest/support/DirectionLine.d.ts +1 -1
  205. package/rest/support/DirectionPoint.d.ts +1 -1
  206. package/rest/support/DirectionsString.d.ts +1 -1
  207. package/rest/support/DistanceParameters.d.ts +1 -1
  208. package/rest/support/GPMessage.d.ts +1 -1
  209. package/rest/support/ImageAreaParameters.d.ts +1 -1
  210. package/rest/support/ImageAreaResult.d.ts +4 -2
  211. package/rest/support/ImageAreaResult.js +1 -1
  212. package/rest/support/ImageDistanceResult.d.ts +4 -2
  213. package/rest/support/ImageDistanceResult.js +1 -1
  214. package/rest/support/ImageHeightResult.d.ts +2 -1
  215. package/rest/support/ImageHeightResult.js +1 -1
  216. package/rest/support/ImageMeasureResultAngleValue.d.ts +3 -2
  217. package/rest/support/ImageMeasureResultAngleValue.js +1 -1
  218. package/rest/support/ImageMeasureResultAreaValue.d.ts +3 -2
  219. package/rest/support/ImageMeasureResultAreaValue.js +1 -1
  220. package/rest/support/ImageMeasureResultLengthValue.d.ts +4 -3
  221. package/rest/support/ImageMeasureResultLengthValue.js +1 -1
  222. package/rest/support/JobInfo.d.ts +1 -1
  223. package/rest/support/LinearUnit.d.ts +1 -1
  224. package/rest/support/LocateSetting.d.ts +1 -1
  225. package/rest/support/NAMessage.d.ts +1 -1
  226. package/rest/support/NetworkAttribute.d.ts +1 -1
  227. package/rest/support/OffsetParameters.d.ts +1 -1
  228. package/rest/support/PointBarrier.d.ts +1 -1
  229. package/rest/support/PolygonBarrier.d.ts +1 -1
  230. package/rest/support/PolylineBarrier.d.ts +1 -1
  231. package/rest/support/RouteParameters.d.ts +1 -1
  232. package/rest/support/ServiceAreaParameters.d.ts +1 -1
  233. package/rest/support/Stop.d.ts +1 -1
  234. package/rest/support/TravelMode.d.ts +1 -1
  235. package/smartMapping/renderers/pieChart.js +1 -1
  236. package/smartMapping/renderers/relationship.js +1 -1
  237. package/smartMapping/renderers/univariateColorSize.js +1 -1
  238. package/smartMapping/support/adapters/support/utils.js +1 -1
  239. package/support/revision.js +1 -1
  240. package/support/tests/meshUtils.js +1 -1
  241. package/symbols/ExtrudeSymbol3DLayer.d.ts +2 -1
  242. package/symbols/ExtrudeSymbol3DLayer.js +1 -1
  243. package/symbols/FillSymbol3DLayer.d.ts +4 -2
  244. package/symbols/FillSymbol3DLayer.js +1 -1
  245. package/symbols/IconSymbol3DLayer.d.ts +23 -4
  246. package/symbols/IconSymbol3DLayer.js +1 -1
  247. package/symbols/LineSymbol3DLayer.d.ts +2 -1
  248. package/symbols/LineSymbol3DLayer.js +1 -1
  249. package/symbols/ObjectSymbol3DLayer.d.ts +6 -3
  250. package/symbols/ObjectSymbol3DLayer.js +1 -1
  251. package/symbols/PathSymbol3DLayer.d.ts +2 -1
  252. package/symbols/PathSymbol3DLayer.js +1 -1
  253. package/symbols/TextSymbol3DLayer.d.ts +21 -3
  254. package/symbols/TextSymbol3DLayer.js +1 -1
  255. package/symbols/patterns/LinePattern3D.js +1 -1
  256. package/symbols/support/IconSymbol3DLayerResource.d.ts +1 -1
  257. package/symbols/support/IconSymbol3DLayerResource.js +1 -1
  258. package/symbols/support/ObjectSymbol3DLayerResource.d.ts +1 -1
  259. package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
  260. package/symbols/support/OccludedVisibility.d.ts +27 -0
  261. package/symbols/support/Symbol3DAnchorPosition2D.d.ts +1 -1
  262. package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
  263. package/symbols/support/Symbol3DAnchorPosition3D.d.ts +1 -1
  264. package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
  265. package/symbols/support/Symbol3DFillMaterial.d.ts +3 -2
  266. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  267. package/symbols/support/Symbol3DHalo.d.ts +1 -1
  268. package/symbols/support/Symbol3DHalo.js +1 -1
  269. package/symbols/support/Symbol3DIconOutline.d.ts +1 -1
  270. package/symbols/support/Symbol3DIconOutline.js +1 -1
  271. package/symbols/support/Symbol3DMaterial.d.ts +1 -1
  272. package/symbols/support/Symbol3DMaterial.js +1 -1
  273. package/symbols/support/Symbol3DOutline.d.ts +1 -1
  274. package/symbols/support/Symbol3DOutline.js +1 -1
  275. package/symbols/support/Symbol3DTextBackground.d.ts +1 -1
  276. package/symbols/support/Symbol3DTextBackground.js +1 -1
  277. package/symbols/support/previewSymbol3D.js +1 -1
  278. package/symbols/support/primitives.js +5 -0
  279. package/symbols/support/types.d.ts +2 -0
  280. package/symbols/support/utils.js +1 -1
  281. package/views/2d/analysis/AnalysisView2D.d.ts +2 -2
  282. package/views/2d/analysis/AnalysisView2D.js +1 -1
  283. package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +1 -1
  284. package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +1 -1
  285. package/views/2d/analysis/DistanceMeasurementAnalysisView2D.d.ts +1 -1
  286. package/views/2d/analysis/DistanceMeasurementAnalysisView2D.js +1 -1
  287. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +1 -1
  288. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  289. package/views/2d/engine/Bitmap.js +1 -1
  290. package/views/2d/engine/Container.js +1 -1
  291. package/views/2d/engine/DisplayObject.js +1 -1
  292. package/views/2d/engine/brushes.js +1 -1
  293. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  294. package/views/2d/engine/vectorTiles/GlyphMosaic.js +1 -1
  295. package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
  296. package/views/2d/engine/vectorTiles/TileParser.js +1 -1
  297. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  298. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  299. package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
  300. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  301. package/views/2d/engine/webgl/ClipMesh.js +5 -0
  302. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  303. package/views/2d/engine/webgl/Overlay.js +1 -1
  304. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  305. package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
  306. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  307. package/views/2d/engine/webgl/WGLContainer.js +1 -1
  308. package/views/2d/engine/webgl/animations/store/AnimationStore.js +1 -1
  309. package/views/2d/engine/webgl/brushes/WGLBrushTileDebugInfo.js +1 -1
  310. package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
  311. package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
  312. package/views/2d/engine/webgl/meshing/SimpleMesh.js +1 -1
  313. package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
  314. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  315. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  316. package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
  317. package/views/2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js +5 -0
  318. package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +1 -1
  319. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  320. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  321. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  322. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  323. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  324. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  325. package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
  326. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  327. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
  328. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  329. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  330. package/views/2d/engine/webgl/shaderGraph/techniques/grid/GridTechnique.js +1 -1
  331. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
  332. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  333. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  334. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  335. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
  336. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  337. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  338. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  339. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
  340. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
  341. package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
  342. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  343. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  344. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  345. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  346. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ClipShader.js +5 -0
  347. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  348. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  349. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  350. package/views/2d/engine/webgl/textureUtils.js +1 -1
  351. package/views/2d/layers/KMLLayerView2D.js +1 -1
  352. package/views/2d/layers/LayerView2D.js +1 -1
  353. package/views/2d/layers/MediaLayerView2D.js +1 -1
  354. package/views/2d/layers/TileLayerView2D.js +1 -1
  355. package/views/2d/layers/features/FeatureContainer.js +1 -1
  356. package/views/2d/layers/features/RenderState.js +1 -1
  357. package/views/2d/webglDeps.js +1 -1
  358. package/views/3d/analysis/AnalysisView3D.d.ts +2 -2
  359. package/views/3d/analysis/AnalysisView3D.js +1 -1
  360. package/views/3d/analysis/AreaMeasurementAnalysisView3D.d.ts +1 -1
  361. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  362. package/views/3d/analysis/DimensionAnalysisView3D.d.ts +1 -1
  363. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  364. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.d.ts +1 -1
  365. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  366. package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +1 -1
  367. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  368. package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +1 -1
  369. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  370. package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +1 -1
  371. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  372. package/views/3d/analysis/SliceAnalysisView3D.d.ts +1 -1
  373. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  374. package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +1 -1
  375. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  376. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  377. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +1 -1
  378. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  379. package/views/3d/constraints/AltitudeConstraint.d.ts +1 -1
  380. package/views/3d/constraints/AltitudeConstraint.js +1 -1
  381. package/views/3d/constraints/ClipDistanceConstraint.d.ts +1 -1
  382. package/views/3d/constraints/ClipDistanceConstraint.js +1 -1
  383. package/views/3d/constraints/Constraints.d.ts +7 -4
  384. package/views/3d/constraints/Constraints.js +1 -1
  385. package/views/3d/constraints/TiltConstraint.d.ts +1 -1
  386. package/views/3d/constraints/TiltConstraint.js +1 -1
  387. package/views/3d/environment/LocalAtmosphere.js +1 -1
  388. package/views/3d/environment/MarsAtmosphere.js +1 -1
  389. package/views/3d/glTF/internal/Resource.js +1 -1
  390. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  391. package/views/3d/interactive/editingTools/reshape/reshapeTooltipUtils3D.js +1 -1
  392. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  393. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  394. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  395. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  396. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  397. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  398. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  399. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  400. package/views/3d/layers/graphics/pipeline/symbolization/IconSymbolLayerRenderer.js +1 -1
  401. package/views/3d/layers/graphics/pipeline/symbolization/ObjectSymbolLayerRenderer.js +1 -1
  402. package/views/3d/layers/graphics/pipeline/symbolization/factoryUtils.js +1 -1
  403. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  404. package/views/3d/layers/i3s/meshUtils.js +1 -1
  405. package/views/3d/layers/support/MediaLayerInteractionOptions.d.ts +3 -2
  406. package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
  407. package/views/3d/layers/support/MediaLayerInteractionReshapeOptions.d.ts +1 -1
  408. package/views/3d/layers/support/MediaLayerInteractionReshapeOptions.js +1 -1
  409. package/views/3d/support/engineContent/marker.js +1 -1
  410. package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
  411. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  412. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  413. package/views/3d/terrain/OverlayRenderer.js +1 -1
  414. package/views/3d/terrain/TileCompositor.js +1 -1
  415. package/views/3d/terrain/TileRenderer.js +1 -1
  416. package/views/3d/webgl/ManagedColorAttachment.d.ts +2 -2
  417. package/views/3d/webgl/ManagedColorAttachment.js +1 -1
  418. package/views/3d/webgl/ManagedDepthAttachment.d.ts +2 -2
  419. package/views/3d/webgl/ManagedDepthAttachment.js +1 -1
  420. package/views/3d/webgl/ManagedDepthTexture.js +1 -1
  421. package/views/3d/webgl/ManagedFBO.d.ts +8 -6
  422. package/views/3d/webgl/ManagedFBO.js +1 -1
  423. package/views/3d/webgl/ManagedFBOAttachment.d.ts +2 -2
  424. package/views/3d/webgl/ManagedFBOAttachment.js +1 -1
  425. package/views/3d/webgl/ManagedFBOResource.d.ts +1 -1
  426. package/views/3d/webgl/ManagedFBOResource.js +1 -1
  427. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  428. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  429. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +55 -23
  430. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  431. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  432. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  433. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  434. package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
  435. package/views/3d/webgl-engine/lib/DDSUtil.js +1 -1
  436. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  437. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  438. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  439. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  440. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
  441. package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
  442. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  443. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  444. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  445. package/views/3d/webgl-engine/materials/lineStippleUtils.js +1 -1
  446. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  447. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  448. package/views/DOMContainer.d.ts +1 -2
  449. package/views/MapView.d.ts +10 -15
  450. package/views/PopupView.d.ts +6 -6
  451. package/views/SceneView.d.ts +3 -4
  452. package/views/SceneView.js +1 -1
  453. package/views/VideoView.js +1 -1
  454. package/views/View.d.ts +11 -13
  455. package/views/View2D.d.ts +37 -37
  456. package/views/analysis/AnalysisView.d.ts +1 -1
  457. package/views/analysis/AnalysisView.js +1 -1
  458. package/views/draw/{input/CursorUpdateEvent.d.ts → CursorUpdateEvent.d.ts} +1 -1
  459. package/views/draw/{input/CursorUpdateEvent.js → CursorUpdateEvent.js} +1 -1
  460. package/views/draw/{input/DrawCompleteEvent.d.ts → DrawCompleteEvent.d.ts} +1 -1
  461. package/views/draw/{input/DrawCompleteEvent.js → DrawCompleteEvent.js} +1 -1
  462. package/views/draw/DrawGraphicTool.js +1 -1
  463. package/views/draw/MultipointDrawAction.d.ts +4 -4
  464. package/views/draw/MultipointDrawAction.js +1 -1
  465. package/views/draw/PointDrawAction.d.ts +2 -2
  466. package/views/draw/PointDrawAction.js +1 -1
  467. package/views/draw/PolygonDrawAction.d.ts +4 -4
  468. package/views/draw/PolygonDrawAction.js +1 -1
  469. package/views/draw/PolylineDrawAction.d.ts +4 -4
  470. package/views/draw/PolylineDrawAction.js +1 -1
  471. package/views/draw/SegmentDrawAction.d.ts +3 -3
  472. package/views/draw/SegmentDrawAction.js +1 -1
  473. package/views/draw/{input/VertexAddEvent.d.ts → VertexAddEvent.d.ts} +1 -1
  474. package/views/draw/{input/VertexAddEvent.js → VertexAddEvent.js} +1 -1
  475. package/views/draw/{input/VertexRemoveEvent.d.ts → VertexRemoveEvent.d.ts} +1 -1
  476. package/views/draw/VertexRemoveEvent.js +5 -0
  477. package/views/draw/support/Reshape.js +1 -1
  478. package/views/draw/support/reshapeTooltipUtils.js +1 -1
  479. package/views/draw/support/tooltipUtils.js +1 -1
  480. package/views/interactive/sketch/Units.d.ts +3 -0
  481. package/views/layers/HighlightLayerViewMixin.d.ts +1 -3
  482. package/views/layers/ImageryLayerViewMixin.d.ts +1 -3
  483. package/views/layers/KMLLayerView.d.ts +1 -1
  484. package/views/layers/MediaLayerViewMixin.d.ts +3 -2
  485. package/views/layers/MediaLayerViewMixin.js +1 -1
  486. package/views/support/GeodesicMeasurementWorker.js +5 -0
  487. package/views/support/GeodesicMeasurementWorkerHandle.js +5 -0
  488. package/views/support/HighlightOptions.d.ts +0 -1
  489. package/views/support/TextureCompressionHelper.js +1 -1
  490. package/views/support/automaticAreaMeasurementUtils.js +1 -1
  491. package/views/support/imageReprojection.js +1 -1
  492. package/views/types.d.ts +1 -1
  493. package/views/webgl/FramebufferObject.js +1 -1
  494. package/views/webgl/RenderingContext.js +1 -1
  495. package/views/webgl/Texture.js +1 -1
  496. package/views/webgl/rasterUtils.js +1 -1
  497. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  498. package/views/webgl/textureTracer.js +5 -0
  499. package/webdoc/support/SlideThumbnail.d.ts +1 -1
  500. package/webdoc/support/SlideThumbnail.js +1 -1
  501. package/webmap/Bookmark.d.ts +2 -1
  502. package/webmap/Bookmark.js +1 -1
  503. package/webmap/Version.d.ts +2 -2
  504. package/webmap/Version.js +1 -1
  505. package/webmap/utils.js +1 -1
  506. package/webscene/Slide.d.ts +6 -3
  507. package/webscene/Slide.js +1 -1
  508. package/webscene/Version.d.ts +2 -2
  509. package/webscene/Version.js +1 -1
  510. package/webscene/spec-certification/api.js +1 -1
  511. package/webscene/support/SlideEnvironment.d.ts +1 -1
  512. package/webscene/support/SlideEnvironment.js +1 -1
  513. package/webscene/support/SlideVisibleLayer.d.ts +1 -1
  514. package/webscene/support/SlideVisibleLayer.js +1 -1
  515. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.d.ts +1 -1
  516. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  517. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.d.ts +1 -1
  518. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  519. package/widgets/BatchAttributeForm/VisibleElements.d.ts +1 -1
  520. package/widgets/BatchAttributeForm/VisibleElements.js +1 -1
  521. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  522. package/widgets/BatchAttributeForm.d.ts +2 -1
  523. package/widgets/BatchAttributeForm.js +1 -1
  524. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  525. package/widgets/Bookmarks.js +1 -1
  526. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.d.ts +1 -1
  527. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  528. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.d.ts +1 -1
  529. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  530. package/widgets/Editor.js +1 -1
  531. package/widgets/FeatureTable/ActionColumn.d.ts +1 -1
  532. package/widgets/FeatureTable/AttachmentsColumn.d.ts +1 -1
  533. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +2 -2
  534. package/widgets/FeatureTable/FieldColumn.d.ts +1 -1
  535. package/widgets/FeatureTable/Grid/Column.d.ts +1 -1
  536. package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +1 -1
  537. package/widgets/FeatureTable/support/FieldColumnTemplate.d.ts +1 -1
  538. package/widgets/FeatureTable/support/GroupColumnTemplate.d.ts +1 -1
  539. package/widgets/FeatureTable/support/TableTemplate.d.ts +1 -1
  540. package/widgets/FeatureTable/support/{interfaces.d.ts → types.d.ts} +1 -1
  541. package/widgets/FeatureTable.d.ts +2 -2
  542. package/widgets/LineOfSight/LineOfSightViewModel.d.ts +1 -1
  543. package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
  544. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  545. package/widgets/PanoramicViewer/support/importUtils.js +1 -1
  546. package/widgets/Print/PrintViewModel.d.ts +1 -1
  547. package/widgets/Sketch/CreateToolVisibilityMap.d.ts +1 -1
  548. package/widgets/Sketch/CreateToolVisibilityMap.js +1 -1
  549. package/widgets/Sketch/SelectionToolVisibilityMap.d.ts +1 -1
  550. package/widgets/Sketch/SelectionToolVisibilityMap.js +1 -1
  551. package/widgets/Sketch/VisibleElements.d.ts +5 -3
  552. package/widgets/Sketch/VisibleElements.js +1 -1
  553. package/widgets/Sketch.d.ts +2 -1
  554. package/widgets/Sketch.js +1 -1
  555. package/widgets/Slice/SliceViewModel.d.ts +1 -1
  556. package/widgets/Slice/SliceViewModel.js +1 -1
  557. package/widgets/UtilityNetworkAssociations.js +1 -1
  558. package/widgets/support/AnalysisViewModel.d.ts +1 -1
  559. package/widgets/support/AnalysisViewModel.js +1 -1
  560. package/widgets/support/InteractiveToolViewModel.d.ts +1 -1
  561. package/widgets/support/InteractiveToolViewModel.js +1 -1
  562. package/assets/esri/core/libs/libtess/libtess.wasm +0 -0
  563. package/assets/esri/core/workers/chunks/00e407d262c49890afa8.js +0 -1
  564. package/assets/esri/core/workers/chunks/19db60a3b4b09d445bd1.js +0 -1
  565. package/assets/esri/core/workers/chunks/1e55f152b60145f33b61.js +0 -1
  566. package/assets/esri/core/workers/chunks/294acaaebfedb05fe81e.js +0 -1
  567. package/assets/esri/core/workers/chunks/31eda00e6842005d0ec8.js +0 -1
  568. package/assets/esri/core/workers/chunks/3d49c6427120edc8eac9.js +0 -1
  569. package/assets/esri/core/workers/chunks/404229f10aef5ac23c87.js +0 -1
  570. package/assets/esri/core/workers/chunks/4278b35fb6fd578c403e.js +0 -1
  571. package/assets/esri/core/workers/chunks/46b63a65484b102e9ccb.js +0 -1
  572. package/assets/esri/core/workers/chunks/4f03d19a70dca6c507be.js +0 -316
  573. package/assets/esri/core/workers/chunks/5686220aed9a74dbd2b1.js +0 -1
  574. package/assets/esri/core/workers/chunks/5a2933ae19345b7d5aa7.js +0 -1
  575. package/assets/esri/core/workers/chunks/5e9fdd4eff7189f45932.js +0 -1
  576. package/assets/esri/core/workers/chunks/67a45faa80316f43c51b.js +0 -1
  577. package/assets/esri/core/workers/chunks/68ee11589de0da7fed08.js +0 -1
  578. package/assets/esri/core/workers/chunks/82ced9254b27707522ef.js +0 -1
  579. package/assets/esri/core/workers/chunks/bb5373ff7cdad7270095.js +0 -1
  580. package/assets/esri/core/workers/chunks/bddaa83fcb9fdb1e1856.js +0 -1
  581. package/assets/esri/core/workers/chunks/d048e4926e78458afa3e.js +0 -1
  582. package/assets/esri/core/workers/chunks/d199deff988eaefe18b4.js +0 -1
  583. package/assets/esri/core/workers/chunks/d77f56576a49a998164a.js +0 -1
  584. package/assets/esri/core/workers/chunks/dae09fb8da0faa6dede4.js +0 -1
  585. package/assets/esri/core/workers/chunks/e16e88de4e93b0f48b2c.js +0 -1
  586. package/chunks/libtess-asm.js +0 -5
  587. package/chunks/libtess.js +0 -5
  588. package/layers/BlendMode.d.ts +0 -2
  589. package/layers/LayerListMode.d.ts +0 -2
  590. package/layers/LayerType.d.ts +0 -2
  591. package/popup/content/support/mediaInfoTypes.d.ts +0 -7
  592. package/support/modeUtils.d.ts +0 -2
  593. package/views/SelectionManager.d.ts +0 -1
  594. package/views/draw/input/VertexRemoveEvent.js +0 -5
  595. package/views/webgl/Texture.d.ts +0 -6
  596. /package/portal/{interfaces.d.ts → types.d.ts} +0 -0
  597. /package/rest/support/{interfaces.d.ts → types.d.ts} +0 -0
  598. /package/views/draw/{input/VertexUpdateEvent.js → VertexUpdateEvent.js} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import e from"../../core/Logger.js";import{disposeMaybe as t}from"../../core/maybe.js";import{BufferObject as r}from"./BufferObject.js";import{webglDebugEnabled as i}from"./checkWebGLError.js";import{ResourceType as s,ColorAttachment0 as n,PixelType as h,StencilAttachment as o,SizedDepthStencilFormat as c,DepthStencilAttachment as a,SizedDepthFormat as u,DepthAttachment as f}from"./enums.js";import{Renderbuffer as l}from"./Renderbuffer.js";import{Texture as d}from"./Texture.js";const _=()=>e.getLogger("esri.views.webgl.FramebufferObject");class m{constructor(e,t,r){if(this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(s.FramebufferObject,this),null!=t){const r=E(e,t);null!=r&&(this._colorAttachments.set(n,r),p(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(n)}if(null!=r)if(x(r))this._depthStencilTexture=p(r)?r:new d(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const t=T(r)?r:new l(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}dispose(){const{_colorAttachments:e,_glName:t}=this;if(0===e.size&&!this._depthStencilBuffer&&!this._depthStencilTexture&&!t)return;const{_context:r}=this,i=r.getBoundFramebufferObject();e.forEach((e,t)=>this.detachColorTexture(t)?.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),r.gl.deleteFramebuffer(t),this._glName=null,r.bindFramebuffer(i===this?null:i),r.instanceCounter.decrement(s.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){const e=this._colorAttachments.get(n);return p(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(n)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(n)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((e,[t,r])=>e+r.usedMemory,this.depthStencil?.usedMemory??0)}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&p(t)?t:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(e,t=n){if(!e)return;this._validateColorAttachmentPoint(t);const{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=n){const t=this._colorAttachments.get(e);if(!t)return;const r=p(t);return this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{if(r)this._framebufferTexture2D(null,e);else{const t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}setColorTextureTarget(e,t=n,r=0){const i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,0,r):this._framebufferTexture2D(i.glName,t,e,36160,0))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041===r||6402===r?34041!==r||i===h.UNSIGNED_INT_24_8?6402!==r||i===h.UNSIGNED_INT||i===h.UNSIGNED_SHORT?(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,A(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{this._framebufferTexture2D(null,A(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){const{_context:t}=this,r=t.getBoundFramebufferObject();t.bindFramebuffer(this);const{gl:i}=t,s=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,s,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){const{_context:t}=this;t.temporaryBindFramebufferObject(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,s,n,h){(e<0||t<0||s<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const o=h.descriptor;3553!==h.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==o?.width||null==o?.height||e+r>this.width||t+i>this.height||s+r>o.width||n+i>o.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,a=c.bindTexture(h,d.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,s,n,e,t,r,i),c.bindTexture(a,d.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,s,n,h){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),h||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,s,n,h)}async readPixelsAsync(e,t,i,s,n,h,o){const{gl:c}=this._context,a=r.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(a);const u=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),c.readPixels(e,t,i,s,n,h,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(u),await a.getSubDataAsync(o),a.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};if(F(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(F(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),i())){const{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){const{gl:t}=this._context;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach((t,r)=>{if(p(t)){const i=D(t);35866===i?this._framebufferTextureLayer(t.glName,r,e,0,0):this._framebufferTexture2D(t.glName,r,i,e)}else if(T(t)){const i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const t=A(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,D(this._depthStencilTexture),e)}if(i()){t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=n,r=3553,i=36160,s=0){this._context.gl.framebufferTexture2D(i,t,r,e,s)}_framebufferTextureLayer(e,t=n,r=36160,i=0,s=0){this._context.gl.framebufferTextureLayer(r,t,e,i,s)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=t(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,A(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=t(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),F(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){F(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case u.DEPTH_COMPONENT16:case u.DEPTH_COMPONENT24:case u.DEPTH_COMPONENT32F:return f;case c.DEPTH24_STENCIL8:case c.DEPTH32F_STENCIL8:return a;case 36168:return o;default:return n}}_validateColorAttachmentPoint(t){if(-1===m._MAX_COLOR_ATTACHMENTS){const{gl:e}=this._context;m._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}const r=t-n;r+1>m._MAX_COLOR_ATTACHMENTS&&e.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${r+1}. Implementation supports up to ${m._MAX_COLOR_ATTACHMENTS} color attachments`)}}function p(e){return 1===S(e)}function T(e){return 2===S(e)}function x(e){return p(e)||b(e)}function b(e){return 0===S(e)}function g(e){return 3===S(e)||null!=e&&"samples"in e}function S(e){return null!=e&&"type"in e?e.type:null}function E(e,t){return p(t)||T(t)?t:b(t)?new d(e,t):g(t)?new l(e,t):null}function F(e,t){const r=Math.max(e.width,e.height);if(r>t){_().warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function D(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function A(e){return 6402===e?f:a}export{m as FramebufferObject,F as ensureAttachmentMaxSize};
5
+ import"../../core/has.js";import e from"../../core/Logger.js";import{disposeMaybe as t}from"../../core/maybe.js";import{BufferObject as r}from"./BufferObject.js";import{webglDebugEnabled as i}from"./checkWebGLError.js";import{ResourceType as s,ColorAttachment0 as n,PixelType as h,StencilAttachment as o,SizedDepthStencilFormat as c,DepthStencilAttachment as a,SizedDepthFormat as u,DepthAttachment as f}from"./enums.js";import{Renderbuffer as l}from"./Renderbuffer.js";import d from"./Texture.js";const _=()=>e.getLogger("esri.views.webgl.FramebufferObject");class m{constructor(e,t,r){if(this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(s.FramebufferObject,this),null!=t){const r=E(e,t);null!=r&&(this._colorAttachments.set(n,r),p(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(n)}if(null!=r)if(x(r))this._depthStencilTexture=p(r)?r:new d(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const t=T(r)?r:new l(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}dispose(){const{_colorAttachments:e,_glName:t}=this;if(0===e.size&&!this._depthStencilBuffer&&!this._depthStencilTexture&&!t)return;const{_context:r}=this,i=r.getBoundFramebufferObject();e.forEach((e,t)=>this.detachColorTexture(t)?.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),r.gl.deleteFramebuffer(t),this._glName=null,r.bindFramebuffer(i===this?null:i),r.instanceCounter.decrement(s.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){const e=this._colorAttachments.get(n);return p(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(n)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(n)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((e,[t,r])=>e+r.usedMemory,this.depthStencil?.usedMemory??0)}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&p(t)?t:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(e,t=n){if(!e)return;this._validateColorAttachmentPoint(t);const{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=n){const t=this._colorAttachments.get(e);if(!t)return;const r=p(t);return this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{if(r)this._framebufferTexture2D(null,e);else{const t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}setColorTextureTarget(e,t=n,r=0){const i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,0,r):this._framebufferTexture2D(i.glName,t,e,36160,0))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041===r||6402===r?34041!==r||i===h.UNSIGNED_INT_24_8?6402!==r||i===h.UNSIGNED_INT||i===h.UNSIGNED_SHORT?(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,A(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{this._framebufferTexture2D(null,A(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){const{_context:t}=this,r=t.getBoundFramebufferObject();t.bindFramebuffer(this);const{gl:i}=t,s=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,s,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){const{_context:t}=this;t.temporaryBindFramebufferObject(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,s,n,h){(e<0||t<0||s<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const o=h.descriptor;3553!==h.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==o?.width||null==o?.height||e+r>this.width||t+i>this.height||s+r>o.width||n+i>o.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,a=c.bindTexture(h,d.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,s,n,e,t,r,i),c.bindTexture(a,d.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,s,n,h){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),h||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,s,n,h)}async readPixelsAsync(e,t,i,s,n,h,o){const{gl:c}=this._context,a=r.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(a);const u=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),c.readPixels(e,t,i,s,n,h,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(u),await a.getSubDataAsync(o),a.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};if(F(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(F(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),i())){const{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){const{gl:t}=this._context;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach((t,r)=>{if(p(t)){const i=D(t);35866===i?this._framebufferTextureLayer(t.glName,r,e,0,0):this._framebufferTexture2D(t.glName,r,i,e)}else if(T(t)){const i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const t=A(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,D(this._depthStencilTexture),e)}if(i()){t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=n,r=3553,i=36160,s=0){this._context.gl.framebufferTexture2D(i,t,r,e,s)}_framebufferTextureLayer(e,t=n,r=36160,i=0,s=0){this._context.gl.framebufferTextureLayer(r,t,e,i,s)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=t(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,A(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=t(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),F(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){F(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case u.DEPTH_COMPONENT16:case u.DEPTH_COMPONENT24:case u.DEPTH_COMPONENT32F:return f;case c.DEPTH24_STENCIL8:case c.DEPTH32F_STENCIL8:return a;case 36168:return o;default:return n}}_validateColorAttachmentPoint(t){if(-1===m._MAX_COLOR_ATTACHMENTS){const{gl:e}=this._context;m._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}const r=t-n;r+1>m._MAX_COLOR_ATTACHMENTS&&e.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${r+1}. Implementation supports up to ${m._MAX_COLOR_ATTACHMENTS} color attachments`)}}function p(e){return 1===S(e)}function T(e){return 2===S(e)}function x(e){return p(e)||b(e)}function b(e){return 0===S(e)}function g(e){return 3===S(e)||null!=e&&"samples"in e}function S(e){return null!=e&&"type"in e?e.type:null}function E(e,t){return p(t)||T(t)?t:b(t)?new d(e,t):g(t)?new l(e,t):null}function F(e,t){const r=Math.max(e.width,e.height);if(r>t){_().warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function D(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function A(e){return 6402===e?f:a}export{m as FramebufferObject,F as ensureAttachmentMaxSize};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../core/has.js";import{disposeMaybe as t}from"../../core/maybe.js";import{after as e}from"../../core/promiseUtils.js";import{Milliseconds as s}from"../../core/time.js";import{webglDebugEnabled as i,checkWebGLError as a,getErrorMessage as r}from"./checkWebGLError.js";import{ContextState as n}from"./ContextState.js";import{DrawBufferBack as l,DrawBufferNone as h,ColorAttachment0 as f,baseTextureUnit as o,ResourceType as u,PrimitiveType as c}from"./enums.js";import{InstanceCounter as d}from"./InstanceCounter.js";import{Parameters as _}from"./Parameters.js";import{ProgramCache as b}from"./ProgramCache.js";import{StateTracker as g}from"./renderState.js";import{Texture as p}from"./Texture.js";import{WebGLDriverTest as m}from"./WebGLDriverTest.js";import{Capabilities as B}from"./capabilities/Capabilities.js";let F=class{constructor(t,e){this.gl=t,this.instanceCounter=new d,this._programCache=new b(this),this._transformFeedbackRequestInfo=null,this._state=new n,this._numOfDrawCalls=0,this._numOfTriangles=0,this._options=e,this.configure(e)}configure(e){this._options=e,this._capabilities=new B(this.gl,e),this._parameters=new _(this.gl,this._capabilities,e),p.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const s=this.gl.getParameter(this.gl.VIEWPORT);this._state=new n,this._state.viewport={x:s[0],y:s[1],width:s[2],height:s[3]},this._stateTracker=new g({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const e=t.color;this.setBlendColor(e.r,e.g,e.b,e.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const e=t.function;this.setStencilFunction(e.func,e.ref,e.mask);const s=t.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)},setDrawBuffers:t=>{if(t)this.setDrawBuffers(t.buffers);else{const{drawFramebuffer:t}=this._state;null===t?this.setDrawBuffers([l]):0===t.colorAttachments.length?this.setDrawBuffers([h]):this.setDrawBuffers([f])}}}),this.enforceState(),t(this._driverTest),this._driverTest=new m(this)}updateOptions(t){this._options={...this._options,...t},this._parameters=new _(this.gl,this._capabilities,this._options)}dispose(){this._driverTest=t(this._driverTest),this._programCache=t(this._programCache),this.bindVAO(null),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663),this._state.textureUnitMap.length=0,this._state=null,this._capabilities=null,this._stateTracker=null,i()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}get programCache(){return this._programCache}setPipelineState(t){this._stateTracker.setPipeline(t)}setBlendingEnabled(t){this._state.blend!==t&&(!0===t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=t,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(t,e){for(let s=0;s<t.length;++s)this._state.textureUnitMap[t[s]]=null;e>=0&&(this._state.activeTexture=e)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(t,e,s,i){t===this._state.blendColor.r&&e===this._state.blendColor.g&&s===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(t,e,s,i),this._state.blendColor.r=t,this._state.blendColor.g=e,this._state.blendColor.b=s,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(t,e){t===this._state.blendFunction.srcRGB&&e===this._state.blendFunction.dstRGB||(this.gl.blendFunc(t,e),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=e,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(t,e,s,i){this._state.blendFunction.srcRGB===t&&this._state.blendFunction.srcAlpha===s&&this._state.blendFunction.dstRGB===e&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(t,e,s,i),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=s,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(t){this._state.blendEquation.mode!==t&&(this.gl.blendEquation(t),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(t,e){this._state.blendEquation.mode===t&&this._state.blendEquation.modeAlpha===e||(this.gl.blendEquationSeparate(t,e),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setColorMask(t,e,s,i){this._state.colorMask.r===t&&this._state.colorMask.g===e&&this._state.colorMask.b===s&&this._state.colorMask.a===i||(this.gl.colorMask(t,e,s,i),this._state.colorMask.r=t,this._state.colorMask.g=e,this._state.colorMask.b=s,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(t,e,s,i){this._state.clearColor.r===t&&this._state.clearColor.g===e&&this._state.clearColor.b===s&&this._state.clearColor.a===i||(this.gl.clearColor(t,e,s,i),this._state.clearColor.r=t,this._state.clearColor.g=e,this._state.clearColor.b=s,this._state.clearColor.a=i)}setFaceCullingEnabled(t){this._state.faceCulling!==t&&(!0===t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=t,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(t){this._state.polygonOffsetFill!==t&&(!0===t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=t,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(t,e){this._state.polygonOffset[0]===t&&this._state.polygonOffset[1]===e||(this._state.polygonOffset[0]=t,this._state.polygonOffset[1]=e,this.gl.polygonOffset(t,e),this._stateTracker.invalidatePolygonOffset())}setCullFace(t){this._state.cullFace!==t&&(this.gl.cullFace(t),this._state.cullFace=t,this._stateTracker.invalidateCulling())}setFrontFace(t){this._state.frontFace!==t&&(this.gl.frontFace(t),this._state.frontFace=t,this._stateTracker.invalidateCulling())}setScissorTestEnabled(t){this._state.scissorTest!==t&&(!0===t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=t)}setScissorRect(t,e,s,i){this._state.scissorRect.x===t&&this._state.scissorRect.y===e&&this._state.scissorRect.width===s&&this._state.scissorRect.height===i||(this.gl.scissor(t,e,s,i),this._state.scissorRect.x=t,this._state.scissorRect.y=e,this._state.scissorRect.width=s,this._state.scissorRect.height=i)}setDepthTestEnabled(t){this._state.depthTest!==t&&(!0===t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=t,this._stateTracker.invalidateDepthTest())}setClearDepth(t){this._state.clearDepth!==t&&(this.gl.clearDepth(t),this._state.clearDepth=t)}setDepthFunction(t){this._state.depthFunction!==t&&(this.gl.depthFunc(t),this._state.depthFunction=t,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(t){this._state.depthWrite!==t&&(this.gl.depthMask(t),this._state.depthWrite=t,this._stateTracker.invalidateDepthWrite())}setDepthRange(t,e){this._state.depthRange.zNear===t&&this._state.depthRange.zFar===e||(this.gl.depthRange(t,e),this._state.depthRange.zNear=t,this._state.depthRange.zFar=e,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(t){this._state.stencilTest!==t&&(!0===t?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=t,this._stateTracker.invalidateStencilTest())}setClearStencil(t){t!==this._state.clearStencil&&(this.gl.clearStencil(t),this._state.clearStencil=t)}setStencilFunction(t,e,s){this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===e&&this._state.stencilFunction.mask===s||(this.gl.stencilFunc(t,e,s),this._state.stencilFunction.face=1032,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=e,this._state.stencilFunction.mask=s,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(t,e,s,i){this._state.stencilFunction.face===t&&this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(t,e,s,i),this._state.stencilFunction.face=t,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(t){this._state.stencilWriteMask!==t&&(this.gl.stencilMask(t),this._state.stencilWriteMask=t,this._stateTracker.invalidateStencilWrite())}setStencilOp(t,e,s){1032===this._state.stencilOperation.face&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===e&&this._state.stencilOperation.zPass===s||(this.gl.stencilOp(t,e,s),this._state.stencilOperation.face=1032,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=e,this._state.stencilOperation.zPass=s,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(t,e,s,i){this._state.stencilOperation.face===t&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(t,e,s,i),this._state.stencilOperation.face=t,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(t,e=!1){const s=this._state.activeTexture;return t>=0&&(e||t!==this._state.activeTexture)&&(this.gl.activeTexture(o+t),this._state.activeTexture=t),s}setDrawBuffers(t){const{drawFramebuffer:e}=this._state,s=null===e,i=s?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(e);if(i?.length!==t.length||!i.every((e,s)=>e===t[s]))if(t.length>this.parameters.maxDrawBuffers)console.error("Setting more active draw buffers than GL.MAX_DRAW_BUFFERS allows.");else{if(s){if(t.length>1)return void console.error("The default framebuffer can only have one active draw buffer.");if(t[0]!==l&&t[0]!==h)return void console.error("The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers.")}s||!t.includes(l)?(this.gl.drawBuffers(t),s?this._state.drawBuffers.defaultFramebuffer=t:this._state.drawBuffers.fbos.set(e,t),this._stateTracker.invalidateDrawBuffers()):console.error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTi or GL.NONE as draw buffers.")}}clear(t,e=255){if(t){if(16384&t){const t=this._state.drawFramebuffer?.colorAttachments;t&&this.setDrawBuffers(t),this.setColorMask(!0,!0,!0,!0)}256&t&&this.setDepthWriteEnabled(!0),1024&t&&this.setStencilWriteMask(e),this.gl.clear(t)}}clearFramebuffer(t,e=!1,s=!1){let i=0;if(t){const e=1e-13,s=Math.max(e,t[3]);this.setClearColor(t[0],t[1],t[2],s),i|=16384}e&&(i|=256),!1===s?s=0:(!0===s&&(s=255),i|=1024),i&&this.clear(i,s)}clearBuffer(t,e,s=6144,i=void 0){this.gl.clearBufferfv(s,t,e,i)}clearBufferInteger(t,e,s=6144,i=void 0){this.gl.clearBufferiv(s,t,e,i)}clearBufferUnsignedInteger(t,e,s=6144,i=void 0){this.gl.clearBufferuiv(s,t,e,i)}drawArrays(t,e,s){if(this._transformFeedbackRequestInfo){if(t!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(null==this._state.program?.hasTransformFeedbackVaryings)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(i()&&(this._numOfDrawCalls++,this._numOfTriangles+=x(t,s),has("enable-feature:webgl-debug:textureReadWrite"))){const t=this._state.textureUnitMap;for(let e=0;e<t.length;e++){const s=t[e];if(null!=s&&s===this._state.drawFramebuffer?.colorTexture)throw new Error(`Detected readWrite. Texture already bound at index ${e}`)}}this.gl.drawArrays(t,e,s),a(this.gl)}drawArraysInstanced(t,e,s,i){this.gl.drawArraysInstanced(t,e,s,i),a(this.gl)}drawElements(t,e,s,a){if(this._transformFeedbackRequestInfo)throw new Error("Cannot called drawElements during a transform feedback request");if(i()&&(this._numOfDrawCalls++,this._numOfTriangles+=x(t,e)),this.gl.drawElements(t,e,s,a),i()){const i=r(this.gl);if(i){const r=this.getBoundVAO(),n=r?.indexBuffer,l=r?.buffers,h={indexBuffer:n,vertexBuffers:l},f={mode:t,count:e,type:s,offset:a},o=n?.size??0,u=a+e,c=o<u?`. Buffer is too small. Attempted to draw index ${u} of ${o}`:"";console.error(`drawElements: ${i}${c}`,{args:f,vao:h})}}}drawElementsInstanced(t,e,s,i,r){this.gl.drawElementsInstanced(t,e,s,i,r),a(this.gl)}logInfo(){i()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}resetInfo(){i()&&(this._numOfDrawCalls=0,this._numOfTriangles=0)}get capabilities(){return this._capabilities}setViewport(t,e,s,i){s=Math.max(Math.round(s),1),i=Math.max(Math.round(i),1);const a=this._state.viewport;a.x===t&&a.y===e&&a.width===s&&a.height===i||(a.x=t,a.y=e,a.width=s,a.height=i,this.gl.viewport(t,e,s,i))}setViewport4fv(t){this.setViewport(t[0],t[1],t[2],t[3])}restoreViewport({x:t,y:e,width:s,height:i}){this.setViewport(t,e,s,i)}getViewport(){const t=this._state.viewport;return{x:t.x,y:t.y,width:t.width,height:t.height}}useProgram(t){this._state.program!==t&&(this._state.program?.stop(),this._state.program=t,this.gl.useProgram(t?.glName??null))}bindTexture(t,e,s=!1){(e>=this.parameters.maxTextureImageUnits||e<0)&&console.error("Input texture unit is out of range of available units!");const i=this._state.textureUnitMap[e];return null==t?.glName?(null!=i&&(this.setActiveTexture(e,s),this.gl.bindTexture(i.descriptor.target,null)),this._state.textureUnitMap[e]=null,i):s||i!==t?(this.setActiveTexture(e,s),this.gl.bindTexture(t.descriptor.target,t.glName),t.applyChanges(),this._state.textureUnitMap[e]=t,i):(t.isDirty&&(this.setActiveTexture(e,s),t.applyChanges()),i)}unbindTexture(t){if(null!=t)for(let e=0;e<this.parameters.maxTextureImageUnits;e++)this._state.textureUnitMap[e]===t&&(this.bindTexture(null,e),this._state.textureUnitMap[e]=null)}bindFramebuffer(t,e=!1){if(e||this._state.readFramebuffer!==t||this._state.drawFramebuffer!==t){if(this._stateTracker.invalidateDrawBuffers(),null==t)return this.gl.bindFramebuffer(36160,null),void(this._state.readFramebuffer=this._state.drawFramebuffer=null);t.initializeAndBind(36160),this._state.readFramebuffer=t,this._state.drawFramebuffer=t}}bindFramebufferSeparate(t,e,s=!1){const i=36008===e,a=i?this._state.readFramebuffer:this._state.drawFramebuffer;(s||a!==t)&&(null==t?this.gl.bindFramebuffer(e,null):t.initializeAndBind(e),i?this._state.readFramebuffer=t??null:(this._stateTracker.invalidateDrawBuffers(),this._state.drawFramebuffer=t??null))}blitFramebuffer(t,e,s=16384,i=9728,a=0,r=0,n=t.width,l=t.height,h=0,f=0,o=e.width,u=e.height){this.bindFramebufferSeparate(t,36008,!0),this.bindFramebufferSeparate(e,36009,!0),this.gl.blitFramebuffer(a,r,n,l,h,f,o,u,s,i)}bindBuffer(t,e){if(t)switch(e??=t.bufferType,e){case 34962:this._state.vertexBuffer=T(this.gl,t,e,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=T(this.gl,t,e,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=T(this.gl,t,e,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=T(this.gl,t,e,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=T(this.gl,t,e,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=T(this.gl,t,e,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=T(this.gl,t,e,this._state.copyWriteBuffer);break;case 35982:this._state.transformFeedbackBuffer=T(this.gl,t,e,this._state.transformFeedbackBuffer)}}bindRenderbuffer(t){const e=this.gl;t||(e.bindRenderbuffer(e.RENDERBUFFER,null),this._state.renderbuffer=null),this._state.renderbuffer!==t&&(e.bindRenderbuffer(e.RENDERBUFFER,t.glName),this._state.renderbuffer=t)}_getBufferBinding(t,e){if(e>=this.parameters.maxUniformBufferBindings||e<0)return console.error("Uniform buffer binding point is out of range!"),null;const s=35345===t?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let i=s[e];return null==i&&(i={buffer:null,offset:0,size:0},s[e]=i),i}bindBufferBase(t,e,s){const i=this._getBufferBinding(t,e);null!=i&&(i.buffer===s&&0===i.offset&&0===i.size||(this.gl.bindBufferBase(t,e,s?s.glName:null),i.buffer=s,i.offset=0,i.size=0))}bindBufferRange(t,e,s,i,a){const r=this._getBufferBinding(t,e);null!=r&&(r.buffer===s&&r.offset===i&&r.size===a||(i%this._parameters.uniformBufferOffsetAlignment===0?(this.gl.bindBufferRange(t,e,s.glName,i,a),r.buffer=s,r.offset=i,r.size=a):console.error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(t,e,s,a){null!=e?(i()&&(a??e.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),e.initialize(),void 0!==s&&void 0!==a?this.bindBufferRange(35345,t,e.buffer,s,a):this.bindBufferBase(35345,t,e.buffer)):this.bindBufferBase(35345,t,null)}unbindUBO(t){for(let e=0,s=this._state.uniformBufferBindingPoints.length;e<s;e++){const s=this._state.uniformBufferBindingPoints[e];null!=s&&s.buffer===t.buffer&&this.bindBufferBase(35345,e,null)}}unbindBuffer(t){switch(t){case 34962:this._state.vertexBuffer=T(this.gl,null,t,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=T(this.gl,null,t,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=T(this.gl,null,t,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=T(this.gl,null,t,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=T(this.gl,null,t,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=T(this.gl,null,t,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=T(this.gl,null,t,this._state.copyWriteBuffer)}}bindVAO(t,e){if(null==t)return this._state.vertexArrayObject?.unbind(),void(this._state.vertexArrayObject=null);this._state.vertexArrayObject!==t&&(t.bind(e),this._state.vertexArrayObject=t)}bindTransformFeedback(t){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,t.glName)}beginTransformFeedback(t,e){if(this._transformFeedbackRequestInfo)throw new Error("Already in a transform feedback request");const{gl:s}=this;s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,t.glName),s.beginTransformFeedback(e),this._transformFeedbackRequestInfo={primitiveType:e}}endTransformFeedback(){if(!this._transformFeedbackRequestInfo)throw new Error("Not in a transform feedback request");const{gl:t}=this;t.endTransformFeedback(),t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null),this._transformFeedbackRequestInfo=null}async clientWaitAsync(t=s(10)){const{gl:i}=this,a=i.fenceSync(37143,0);if(!a)throw new Error("Client wait failed, could not create sync object");let r;this.instanceCounter.increment(u.Sync,a),i.flush();do{await e(t),r=i.clientWaitSync(a,0,0)}while(37147===r);if(this.instanceCounter.decrement(u.Sync,a),i.deleteSync(a),37149===r)throw new Error("Client wait failed")}getBoundFramebufferObject(t=36160){return 36008===t?this._state.readFramebuffer:this._state.drawFramebuffer}temporaryBindFramebufferObject(t,e,s=!1){const i=this.getBoundFramebufferObject();try{this.bindFramebuffer(t,s),e()}finally{this.bindFramebuffer(i,s)}}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null),this.bindVAO(null),this.bindFramebuffer(null,!0),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663);for(let t=0;t<this.parameters.maxTextureImageUnits;++t)this.bindTexture(null,t);this.setBlendingEnabled(!1),this.setBlendFunction(1,0),this.setBlendEquation(32774),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(1029),this.setFrontFace(2305),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(513),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(519,0,0),this.setStencilOp(7680,7680,7680),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setDrawBuffers([l]),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){const{gl:t}=this;t.bindVertexArray(null);for(let s=0;s<this.parameters.maxVertexAttributes;s++)t.disableVertexAttribArray(s);this._state.vertexBuffer?t.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):t.bindBuffer(34962,null),this._state.indexBuffer?t.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):t.bindBuffer(34963,null),this._state.uniformBuffer?t.bindBuffer(this._state.uniformBuffer.bufferType,this._state.uniformBuffer.glName):t.bindBuffer(35345,null);for(let s=0;s<this._parameters.maxUniformBufferBindings;s++){const e=this._state.uniformBufferBindingPoints[s];if(null!=e){const{buffer:i,offset:a,size:r}=e;null!==i?0===a&&0===r?t.bindBufferBase(35345,s,i.glName):t.bindBufferRange(35345,s,i.glName,a,r):t.bindBufferBase(35345,s,null)}}if(this._state.pixelPackBuffer?t.bindBuffer(this._state.pixelPackBuffer.bufferType,this._state.pixelPackBuffer.glName):t.bindBuffer(35051,null),this._state.pixelUnpackBuffer?t.bindBuffer(this._state.pixelUnpackBuffer.bufferType,this._state.pixelUnpackBuffer.glName):t.bindBuffer(35052,null),this._state.copyReadBuffer?t.bindBuffer(this._state.copyReadBuffer.bufferType,this._state.copyReadBuffer.glName):t.bindBuffer(36662,null),this._state.copyWriteBuffer?t.bindBuffer(this._state.copyWriteBuffer.bufferType,this._state.copyWriteBuffer.glName):t.bindBuffer(36663,null),t.bindFramebuffer(36008,null),t.readBuffer(t.BACK),this._state.readFramebuffer&&(t.bindFramebuffer(36008,this._state.readFramebuffer.glName),t.readBuffer(f)),t.bindFramebuffer(36009,this._state.drawFramebuffer?.glName??null),null===this._state.drawFramebuffer){const e=this._state.drawBuffers.defaultFramebuffer;t.drawBuffers(e??[l])}else{const e=this._state.drawBuffers.fbos.get(this._state.drawFramebuffer);t.drawBuffers(e??[f])}if(this._state.vertexArrayObject){const t=this._state.vertexArrayObject;this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null),this.bindVAO(t)}t.useProgram(this._state.program?.glName??null),t.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a),t.bindRenderbuffer(t.RENDERBUFFER,this._state.renderbuffer?.glName??null),!0===this._state.blend?t.enable(this.gl.BLEND):t.disable(this.gl.BLEND),t.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha),t.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha),t.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a),t.clearDepth(this._state.clearDepth),t.clearStencil(this._state.clearStencil),t.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a),t.cullFace(this._state.cullFace),t.depthFunc(this._state.depthFunction),t.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar),!0===this._state.depthTest?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),t.depthMask(this._state.depthWrite),t.frontFace(this._state.frontFace),t.lineWidth(1),!0===this._state.faceCulling?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),t.polygonOffset(this._state.polygonOffset[0],this._state.polygonOffset[1]),!0===this._state.polygonOffsetFill?t.enable(t.POLYGON_OFFSET_FILL):t.disable(t.POLYGON_OFFSET_FILL),t.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height),!0===this._state.scissorTest?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST),t.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask),t.stencilOpSeparate(this._state.stencilOperation.face,this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass),!0===this._state.stencilTest?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),t.stencilMask(this._state.stencilWriteMask);for(let s=0;s<this.parameters.maxTextureImageUnits;s++){t.activeTexture(o+s),t.bindTexture(3553,null),t.bindTexture(34067,null),t.bindTexture(32879,null),t.bindTexture(35866,null);const e=this._state.textureUnitMap[s];null!=e&&t.bindTexture(e.descriptor.target,e.glName)}t.activeTexture(o+this._state.activeTexture);const e=this._state.viewport;t.viewport(e.x,e.y,e.width,e.height),this.resetInfo()}};function T(t,e,s,i){return e?i!==e&&t.bindBuffer(s,e.glName):t.bindBuffer(s,null),e}function x(t,e){switch(t){case c.POINTS:return 2*e;case c.TRIANGLES:return e/3;case c.TRIANGLE_STRIP:case c.TRIANGLE_FAN:return e-2;default:return 0}}export{F as RenderingContext};
5
+ import has from"../../core/has.js";import{disposeMaybe as t}from"../../core/maybe.js";import{after as e}from"../../core/promiseUtils.js";import{Milliseconds as s}from"../../core/time.js";import{webglDebugEnabled as i,checkWebGLError as a,getErrorMessage as r}from"./checkWebGLError.js";import{ContextState as n}from"./ContextState.js";import{DrawBufferBack as l,DrawBufferNone as h,ColorAttachment0 as f,baseTextureUnit as o,ResourceType as u,PrimitiveType as c}from"./enums.js";import{InstanceCounter as d}from"./InstanceCounter.js";import{Parameters as _}from"./Parameters.js";import{ProgramCache as b}from"./ProgramCache.js";import{StateTracker as g}from"./renderState.js";import p from"./Texture.js";import{WebGLDriverTest as m}from"./WebGLDriverTest.js";import{Capabilities as B}from"./capabilities/Capabilities.js";let F=class{constructor(t,e){this.gl=t,this.instanceCounter=new d,this._programCache=new b(this),this._transformFeedbackRequestInfo=null,this._state=new n,this._numOfDrawCalls=0,this._numOfTriangles=0,this._options=e,this.configure(e)}configure(e){this._options=e,this._capabilities=new B(this.gl,e),this._parameters=new _(this.gl,this._capabilities,e),p.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const s=this.gl.getParameter(this.gl.VIEWPORT);this._state=new n,this._state.viewport={x:s[0],y:s[1],width:s[2],height:s[3]},this._stateTracker=new g({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const e=t.color;this.setBlendColor(e.r,e.g,e.b,e.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const e=t.function;this.setStencilFunction(e.func,e.ref,e.mask);const s=t.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)},setDrawBuffers:t=>{if(t)this.setDrawBuffers(t.buffers);else{const{drawFramebuffer:t}=this._state;null===t?this.setDrawBuffers([l]):0===t.colorAttachments.length?this.setDrawBuffers([h]):this.setDrawBuffers([f])}}}),this.enforceState(),t(this._driverTest),this._driverTest=new m(this)}updateOptions(t){this._options={...this._options,...t},this._parameters=new _(this.gl,this._capabilities,this._options)}dispose(){this._driverTest=t(this._driverTest),this._programCache=t(this._programCache),this.bindVAO(null),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663),this._state.textureUnitMap.length=0,this._state=null,this._capabilities=null,this._stateTracker=null,i()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}get programCache(){return this._programCache}setPipelineState(t){this._stateTracker.setPipeline(t)}setBlendingEnabled(t){this._state.blend!==t&&(!0===t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=t,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(t,e){for(let s=0;s<t.length;++s)this._state.textureUnitMap[t[s]]=null;e>=0&&(this._state.activeTexture=e)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(t,e,s,i){t===this._state.blendColor.r&&e===this._state.blendColor.g&&s===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(t,e,s,i),this._state.blendColor.r=t,this._state.blendColor.g=e,this._state.blendColor.b=s,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(t,e){t===this._state.blendFunction.srcRGB&&e===this._state.blendFunction.dstRGB||(this.gl.blendFunc(t,e),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=e,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(t,e,s,i){this._state.blendFunction.srcRGB===t&&this._state.blendFunction.srcAlpha===s&&this._state.blendFunction.dstRGB===e&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(t,e,s,i),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=s,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(t){this._state.blendEquation.mode!==t&&(this.gl.blendEquation(t),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(t,e){this._state.blendEquation.mode===t&&this._state.blendEquation.modeAlpha===e||(this.gl.blendEquationSeparate(t,e),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setColorMask(t,e,s,i){this._state.colorMask.r===t&&this._state.colorMask.g===e&&this._state.colorMask.b===s&&this._state.colorMask.a===i||(this.gl.colorMask(t,e,s,i),this._state.colorMask.r=t,this._state.colorMask.g=e,this._state.colorMask.b=s,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(t,e,s,i){this._state.clearColor.r===t&&this._state.clearColor.g===e&&this._state.clearColor.b===s&&this._state.clearColor.a===i||(this.gl.clearColor(t,e,s,i),this._state.clearColor.r=t,this._state.clearColor.g=e,this._state.clearColor.b=s,this._state.clearColor.a=i)}setFaceCullingEnabled(t){this._state.faceCulling!==t&&(!0===t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=t,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(t){this._state.polygonOffsetFill!==t&&(!0===t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=t,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(t,e){this._state.polygonOffset[0]===t&&this._state.polygonOffset[1]===e||(this._state.polygonOffset[0]=t,this._state.polygonOffset[1]=e,this.gl.polygonOffset(t,e),this._stateTracker.invalidatePolygonOffset())}setCullFace(t){this._state.cullFace!==t&&(this.gl.cullFace(t),this._state.cullFace=t,this._stateTracker.invalidateCulling())}setFrontFace(t){this._state.frontFace!==t&&(this.gl.frontFace(t),this._state.frontFace=t,this._stateTracker.invalidateCulling())}setScissorTestEnabled(t){this._state.scissorTest!==t&&(!0===t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=t)}setScissorRect(t,e,s,i){this._state.scissorRect.x===t&&this._state.scissorRect.y===e&&this._state.scissorRect.width===s&&this._state.scissorRect.height===i||(this.gl.scissor(t,e,s,i),this._state.scissorRect.x=t,this._state.scissorRect.y=e,this._state.scissorRect.width=s,this._state.scissorRect.height=i)}setDepthTestEnabled(t){this._state.depthTest!==t&&(!0===t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=t,this._stateTracker.invalidateDepthTest())}setClearDepth(t){this._state.clearDepth!==t&&(this.gl.clearDepth(t),this._state.clearDepth=t)}setDepthFunction(t){this._state.depthFunction!==t&&(this.gl.depthFunc(t),this._state.depthFunction=t,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(t){this._state.depthWrite!==t&&(this.gl.depthMask(t),this._state.depthWrite=t,this._stateTracker.invalidateDepthWrite())}setDepthRange(t,e){this._state.depthRange.zNear===t&&this._state.depthRange.zFar===e||(this.gl.depthRange(t,e),this._state.depthRange.zNear=t,this._state.depthRange.zFar=e,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(t){this._state.stencilTest!==t&&(!0===t?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=t,this._stateTracker.invalidateStencilTest())}setClearStencil(t){t!==this._state.clearStencil&&(this.gl.clearStencil(t),this._state.clearStencil=t)}setStencilFunction(t,e,s){this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===e&&this._state.stencilFunction.mask===s||(this.gl.stencilFunc(t,e,s),this._state.stencilFunction.face=1032,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=e,this._state.stencilFunction.mask=s,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(t,e,s,i){this._state.stencilFunction.face===t&&this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(t,e,s,i),this._state.stencilFunction.face=t,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(t){this._state.stencilWriteMask!==t&&(this.gl.stencilMask(t),this._state.stencilWriteMask=t,this._stateTracker.invalidateStencilWrite())}setStencilOp(t,e,s){1032===this._state.stencilOperation.face&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===e&&this._state.stencilOperation.zPass===s||(this.gl.stencilOp(t,e,s),this._state.stencilOperation.face=1032,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=e,this._state.stencilOperation.zPass=s,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(t,e,s,i){this._state.stencilOperation.face===t&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(t,e,s,i),this._state.stencilOperation.face=t,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(t,e=!1){const s=this._state.activeTexture;return t>=0&&(e||t!==this._state.activeTexture)&&(this.gl.activeTexture(o+t),this._state.activeTexture=t),s}setDrawBuffers(t){const{drawFramebuffer:e}=this._state,s=null===e,i=s?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(e);if(i?.length!==t.length||!i.every((e,s)=>e===t[s]))if(t.length>this.parameters.maxDrawBuffers)console.error("Setting more active draw buffers than GL.MAX_DRAW_BUFFERS allows.");else{if(s){if(t.length>1)return void console.error("The default framebuffer can only have one active draw buffer.");if(t[0]!==l&&t[0]!==h)return void console.error("The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers.")}s||!t.includes(l)?(this.gl.drawBuffers(t),s?this._state.drawBuffers.defaultFramebuffer=t:this._state.drawBuffers.fbos.set(e,t),this._stateTracker.invalidateDrawBuffers()):console.error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTi or GL.NONE as draw buffers.")}}clear(t,e=255){if(t){if(16384&t){const t=this._state.drawFramebuffer?.colorAttachments;t&&this.setDrawBuffers(t),this.setColorMask(!0,!0,!0,!0)}256&t&&this.setDepthWriteEnabled(!0),1024&t&&this.setStencilWriteMask(e),this.gl.clear(t)}}clearFramebuffer(t,e=!1,s=!1){let i=0;if(t){const e=1e-13,s=Math.max(e,t[3]);this.setClearColor(t[0],t[1],t[2],s),i|=16384}e&&(i|=256),!1===s?s=0:(!0===s&&(s=255),i|=1024),i&&this.clear(i,s)}clearBuffer(t,e,s=6144,i=void 0){this.gl.clearBufferfv(s,t,e,i)}clearBufferInteger(t,e,s=6144,i=void 0){this.gl.clearBufferiv(s,t,e,i)}clearBufferUnsignedInteger(t,e,s=6144,i=void 0){this.gl.clearBufferuiv(s,t,e,i)}drawArrays(t,e,s){if(this._transformFeedbackRequestInfo){if(t!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(null==this._state.program?.hasTransformFeedbackVaryings)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(i()&&(this._numOfDrawCalls++,this._numOfTriangles+=x(t,s),has("enable-feature:webgl-debug:textureReadWrite"))){const t=this._state.textureUnitMap;for(let e=0;e<t.length;e++){const s=t[e];if(null!=s&&s===this._state.drawFramebuffer?.colorTexture)throw new Error(`Detected readWrite. Texture already bound at index ${e}`)}}this.gl.drawArrays(t,e,s),a(this.gl)}drawArraysInstanced(t,e,s,i){this.gl.drawArraysInstanced(t,e,s,i),a(this.gl)}drawElements(t,e,s,a){if(this._transformFeedbackRequestInfo)throw new Error("Cannot called drawElements during a transform feedback request");if(i()&&(this._numOfDrawCalls++,this._numOfTriangles+=x(t,e)),this.gl.drawElements(t,e,s,a),i()){const i=r(this.gl);if(i){const r=this.getBoundVAO(),n=r?.indexBuffer,l=r?.buffers,h={indexBuffer:n,vertexBuffers:l},f={mode:t,count:e,type:s,offset:a},o=n?.size??0,u=a+e,c=o<u?`. Buffer is too small. Attempted to draw index ${u} of ${o}`:"";console.error(`drawElements: ${i}${c}`,{args:f,vao:h})}}}drawElementsInstanced(t,e,s,i,r){this.gl.drawElementsInstanced(t,e,s,i,r),a(this.gl)}logInfo(){i()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}resetInfo(){i()&&(this._numOfDrawCalls=0,this._numOfTriangles=0)}get capabilities(){return this._capabilities}setViewport(t,e,s,i){s=Math.max(Math.round(s),1),i=Math.max(Math.round(i),1);const a=this._state.viewport;a.x===t&&a.y===e&&a.width===s&&a.height===i||(a.x=t,a.y=e,a.width=s,a.height=i,this.gl.viewport(t,e,s,i))}setViewport4fv(t){this.setViewport(t[0],t[1],t[2],t[3])}restoreViewport({x:t,y:e,width:s,height:i}){this.setViewport(t,e,s,i)}getViewport(){const t=this._state.viewport;return{x:t.x,y:t.y,width:t.width,height:t.height}}useProgram(t){this._state.program!==t&&(this._state.program?.stop(),this._state.program=t,this.gl.useProgram(t?.glName??null))}bindTexture(t,e,s=!1){(e>=this.parameters.maxTextureImageUnits||e<0)&&console.error("Input texture unit is out of range of available units!");const i=this._state.textureUnitMap[e];return null==t?.glName?(null!=i&&(this.setActiveTexture(e,s),this.gl.bindTexture(i.descriptor.target,null)),this._state.textureUnitMap[e]=null,i):s||i!==t?(this.setActiveTexture(e,s),this.gl.bindTexture(t.descriptor.target,t.glName),t.applyChanges(),this._state.textureUnitMap[e]=t,i):(t.isDirty&&(this.setActiveTexture(e,s),t.applyChanges()),i)}unbindTexture(t){if(null!=t)for(let e=0;e<this.parameters.maxTextureImageUnits;e++)this._state.textureUnitMap[e]===t&&(this.bindTexture(null,e),this._state.textureUnitMap[e]=null)}bindFramebuffer(t,e=!1){if(e||this._state.readFramebuffer!==t||this._state.drawFramebuffer!==t){if(this._stateTracker.invalidateDrawBuffers(),null==t)return this.gl.bindFramebuffer(36160,null),void(this._state.readFramebuffer=this._state.drawFramebuffer=null);t.initializeAndBind(36160),this._state.readFramebuffer=t,this._state.drawFramebuffer=t}}bindFramebufferSeparate(t,e,s=!1){const i=36008===e,a=i?this._state.readFramebuffer:this._state.drawFramebuffer;(s||a!==t)&&(null==t?this.gl.bindFramebuffer(e,null):t.initializeAndBind(e),i?this._state.readFramebuffer=t??null:(this._stateTracker.invalidateDrawBuffers(),this._state.drawFramebuffer=t??null))}blitFramebuffer(t,e,s=16384,i=9728,a=0,r=0,n=t.width,l=t.height,h=0,f=0,o=e.width,u=e.height){this.bindFramebufferSeparate(t,36008,!0),this.bindFramebufferSeparate(e,36009,!0),this.gl.blitFramebuffer(a,r,n,l,h,f,o,u,s,i)}bindBuffer(t,e){if(t)switch(e??=t.bufferType,e){case 34962:this._state.vertexBuffer=T(this.gl,t,e,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=T(this.gl,t,e,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=T(this.gl,t,e,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=T(this.gl,t,e,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=T(this.gl,t,e,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=T(this.gl,t,e,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=T(this.gl,t,e,this._state.copyWriteBuffer);break;case 35982:this._state.transformFeedbackBuffer=T(this.gl,t,e,this._state.transformFeedbackBuffer)}}bindRenderbuffer(t){const e=this.gl;t||(e.bindRenderbuffer(e.RENDERBUFFER,null),this._state.renderbuffer=null),this._state.renderbuffer!==t&&(e.bindRenderbuffer(e.RENDERBUFFER,t.glName),this._state.renderbuffer=t)}_getBufferBinding(t,e){if(e>=this.parameters.maxUniformBufferBindings||e<0)return console.error("Uniform buffer binding point is out of range!"),null;const s=35345===t?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let i=s[e];return null==i&&(i={buffer:null,offset:0,size:0},s[e]=i),i}bindBufferBase(t,e,s){const i=this._getBufferBinding(t,e);null!=i&&(i.buffer===s&&0===i.offset&&0===i.size||(this.gl.bindBufferBase(t,e,s?s.glName:null),i.buffer=s,i.offset=0,i.size=0))}bindBufferRange(t,e,s,i,a){const r=this._getBufferBinding(t,e);null!=r&&(r.buffer===s&&r.offset===i&&r.size===a||(i%this._parameters.uniformBufferOffsetAlignment===0?(this.gl.bindBufferRange(t,e,s.glName,i,a),r.buffer=s,r.offset=i,r.size=a):console.error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(t,e,s,a){null!=e?(i()&&(a??e.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),e.initialize(),void 0!==s&&void 0!==a?this.bindBufferRange(35345,t,e.buffer,s,a):this.bindBufferBase(35345,t,e.buffer)):this.bindBufferBase(35345,t,null)}unbindUBO(t){for(let e=0,s=this._state.uniformBufferBindingPoints.length;e<s;e++){const s=this._state.uniformBufferBindingPoints[e];null!=s&&s.buffer===t.buffer&&this.bindBufferBase(35345,e,null)}}unbindBuffer(t){switch(t){case 34962:this._state.vertexBuffer=T(this.gl,null,t,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=T(this.gl,null,t,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=T(this.gl,null,t,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=T(this.gl,null,t,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=T(this.gl,null,t,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=T(this.gl,null,t,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=T(this.gl,null,t,this._state.copyWriteBuffer)}}bindVAO(t,e){if(null==t)return this._state.vertexArrayObject?.unbind(),void(this._state.vertexArrayObject=null);this._state.vertexArrayObject!==t&&(t.bind(e),this._state.vertexArrayObject=t)}bindTransformFeedback(t){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,t.glName)}beginTransformFeedback(t,e){if(this._transformFeedbackRequestInfo)throw new Error("Already in a transform feedback request");const{gl:s}=this;s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,t.glName),s.beginTransformFeedback(e),this._transformFeedbackRequestInfo={primitiveType:e}}endTransformFeedback(){if(!this._transformFeedbackRequestInfo)throw new Error("Not in a transform feedback request");const{gl:t}=this;t.endTransformFeedback(),t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null),this._transformFeedbackRequestInfo=null}async clientWaitAsync(t=s(10)){const{gl:i}=this,a=i.fenceSync(37143,0);if(!a)throw new Error("Client wait failed, could not create sync object");let r;this.instanceCounter.increment(u.Sync,a),i.flush();do{await e(t),r=i.clientWaitSync(a,0,0)}while(37147===r);if(this.instanceCounter.decrement(u.Sync,a),i.deleteSync(a),37149===r)throw new Error("Client wait failed")}getBoundFramebufferObject(t=36160){return 36008===t?this._state.readFramebuffer:this._state.drawFramebuffer}temporaryBindFramebufferObject(t,e,s=!1){const i=this.getBoundFramebufferObject();try{this.bindFramebuffer(t,s),e()}finally{this.bindFramebuffer(i,s)}}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null),this.bindVAO(null),this.bindFramebuffer(null,!0),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663);for(let t=0;t<this.parameters.maxTextureImageUnits;++t)this.bindTexture(null,t);this.setBlendingEnabled(!1),this.setBlendFunction(1,0),this.setBlendEquation(32774),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(1029),this.setFrontFace(2305),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(513),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(519,0,0),this.setStencilOp(7680,7680,7680),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setDrawBuffers([l]),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){const{gl:t}=this;t.bindVertexArray(null);for(let s=0;s<this.parameters.maxVertexAttributes;s++)t.disableVertexAttribArray(s);this._state.vertexBuffer?t.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):t.bindBuffer(34962,null),this._state.indexBuffer?t.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):t.bindBuffer(34963,null),this._state.uniformBuffer?t.bindBuffer(this._state.uniformBuffer.bufferType,this._state.uniformBuffer.glName):t.bindBuffer(35345,null);for(let s=0;s<this._parameters.maxUniformBufferBindings;s++){const e=this._state.uniformBufferBindingPoints[s];if(null!=e){const{buffer:i,offset:a,size:r}=e;null!==i?0===a&&0===r?t.bindBufferBase(35345,s,i.glName):t.bindBufferRange(35345,s,i.glName,a,r):t.bindBufferBase(35345,s,null)}}if(this._state.pixelPackBuffer?t.bindBuffer(this._state.pixelPackBuffer.bufferType,this._state.pixelPackBuffer.glName):t.bindBuffer(35051,null),this._state.pixelUnpackBuffer?t.bindBuffer(this._state.pixelUnpackBuffer.bufferType,this._state.pixelUnpackBuffer.glName):t.bindBuffer(35052,null),this._state.copyReadBuffer?t.bindBuffer(this._state.copyReadBuffer.bufferType,this._state.copyReadBuffer.glName):t.bindBuffer(36662,null),this._state.copyWriteBuffer?t.bindBuffer(this._state.copyWriteBuffer.bufferType,this._state.copyWriteBuffer.glName):t.bindBuffer(36663,null),t.bindFramebuffer(36008,null),t.readBuffer(t.BACK),this._state.readFramebuffer&&(t.bindFramebuffer(36008,this._state.readFramebuffer.glName),t.readBuffer(f)),t.bindFramebuffer(36009,this._state.drawFramebuffer?.glName??null),null===this._state.drawFramebuffer){const e=this._state.drawBuffers.defaultFramebuffer;t.drawBuffers(e??[l])}else{const e=this._state.drawBuffers.fbos.get(this._state.drawFramebuffer);t.drawBuffers(e??[f])}if(this._state.vertexArrayObject){const t=this._state.vertexArrayObject;this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null),this.bindVAO(t)}t.useProgram(this._state.program?.glName??null),t.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a),t.bindRenderbuffer(t.RENDERBUFFER,this._state.renderbuffer?.glName??null),!0===this._state.blend?t.enable(this.gl.BLEND):t.disable(this.gl.BLEND),t.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha),t.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha),t.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a),t.clearDepth(this._state.clearDepth),t.clearStencil(this._state.clearStencil),t.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a),t.cullFace(this._state.cullFace),t.depthFunc(this._state.depthFunction),t.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar),!0===this._state.depthTest?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),t.depthMask(this._state.depthWrite),t.frontFace(this._state.frontFace),t.lineWidth(1),!0===this._state.faceCulling?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),t.polygonOffset(this._state.polygonOffset[0],this._state.polygonOffset[1]),!0===this._state.polygonOffsetFill?t.enable(t.POLYGON_OFFSET_FILL):t.disable(t.POLYGON_OFFSET_FILL),t.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height),!0===this._state.scissorTest?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST),t.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask),t.stencilOpSeparate(this._state.stencilOperation.face,this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass),!0===this._state.stencilTest?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),t.stencilMask(this._state.stencilWriteMask);for(let s=0;s<this.parameters.maxTextureImageUnits;s++){t.activeTexture(o+s),t.bindTexture(3553,null),t.bindTexture(34067,null),t.bindTexture(32879,null),t.bindTexture(35866,null);const e=this._state.textureUnitMap[s];null!=e&&t.bindTexture(e.descriptor.target,e.glName)}t.activeTexture(o+this._state.activeTexture);const e=this._state.viewport;t.viewport(e.x,e.y,e.width,e.height),this.resetInfo()}};function T(t,e,s,i){return e?i!==e&&t.bindBuffer(s,e.glName):t.bindBuffer(s,null),e}function x(t,e){switch(t){case c.POINTS:return 2*e;case c.TRIANGLES:return e/3;case c.TRIANGLE_STRIP:case c.TRIANGLE_FAN:return e-2;default:return 0}}export{F as RenderingContext};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../core/Error.js";import has from"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{hasValue as r}from"../../core/object.js";import{throwIfAborted as s,isAbortError as o}from"../../core/promiseUtils.js";import{checkWebGLError as a}from"./checkWebGLError.js";import{ResourceType as n,CompressedTextureFormat as p}from"./enums.js";import{estimateMemory as l}from"./TextureDescriptor.js";import{isCompressedData as m,deriveInternalFormat as h,isTexImageSource as d,is3DTarget as c,validateTexture as _,isCompressedFormat as u,getDimensions as g,calcMipmapLevels as x,isSizedPixelFormat as T,isSizedDepthFormat as M,isSizedDepthStencilFormat as b}from"./textureUtils.js";import{ValidatedTextureDescriptor as f}from"./ValidatedTextureDescriptor.js";const w=null,D=!!has("esri-tests-disable-gpu-memory-measurements"),E=()=>e.getLogger("esri/views/webgl/Texture");class A{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,i=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=i;else{const r=f.validate(e,i);if(!r)throw new t("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return D?0:l(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(n.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=i,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!m(t)&&this._descriptor.internalFormat&&r(p,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!m(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(e,i,r,s,o,a,n=0){a||E().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||E().error("An attempt to update uninitialized texture!");const p=this._descriptor;p.internalFormat=h(p);const{context:l,pixelFormat:c,dataType:_,target:u,isImmutable:g}=p;if(g&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");const x=l.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES,!0);(i<0||r<0||i+s>p.width||r+o>p.height)&&E().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=l;n&&(s&&o||E().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),T.pixelStorei(T.UNPACK_SKIP_ROWS,n)),d(a)?T.texSubImage2D(u,e,i,r,s,o,c,_,a):m(a)?T.compressedTexSubImage2D(u,e,i,r,s,o,p.internalFormat,a.levels[e]):T.texSubImage2D(u,e,i,r,s,o,c,_,a),n&&T.pixelStorei(T.UNPACK_SKIP_ROWS,0),l.bindTexture(x,A.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,i,r,s,o,a,n,p){p||E().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||E().error("An attempt to update an uninitialized texture!");const l=this._descriptor;l.internalFormat=h(l);const{context:d,pixelFormat:_,dataType:u,isImmutable:g,target:x}=l;if(g&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");c(x)||E().warn("Attempting to set 3D texture data on a non-3D texture");const T=d.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),(i<0||r<0||s<0||i+o>l.width||r+a>l.height||s+n>l.depth)&&E().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=d;if(m(p))p=p.levels[e],M.compressedTexSubImage3D(x,e,i,r,s,o,a,n,l.internalFormat,p);else{const t=p;M.texSubImage3D(x,e,i,r,s,o,a,n,_,u,t)}d.bindTexture(T,A.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,_(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const i=this._descriptor.context.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(i,A.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,_(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,_(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),_(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=i(this._compressionAbortController)}_setData(e,i){const r=this._descriptor,s=r.context?.gl;if(!s)return;a(s),this.hasWebGLTextureObject||(this._glName=s.createTexture(),r.context.instanceCounter.increment(n.Texture,this)),_(r);const o=r.context.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),a(s);const p=i??r.target,l=c(p);if(d(e))this._setDataFromTexImageSource(e,p);else{const{width:i,height:o,depth:n}=r;if(null==i||null==o)throw new t("texture:missing-size","Width and height must be specified!");if(l&&null==n)throw new t("texture:missing-depth","Depth must be specified!");if(r.internalFormat=h(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(p,r.internalFormat,r.hasMipmap,i,o,n),m(e)){if(!u(r.internalFormat))throw new t("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,p)}else this._texImage(p,0,r.internalFormat,i,o,n,e),a(s),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),a(s),r.context.bindTexture(o,A.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=h(r);const s=c(e),{width:o,height:n,depth:p}=g(t);r.width&&r.height,r.width||(r.width=o),r.height||(r.height=n),s&&r.depth,s&&(r.depth=p),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,o,n,p),this._texImage(e,0,r.internalFormat,o,n,p,t),a(i),r.hasMipmap&&(this.generateMipmap(),a(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,p=x(i,s,o,a),l=Math.min(p,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,l),this._forEachMipmapLevel((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)},l)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!T(i)&&!M(i)&&!b(i))throw new t("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const p=r?x(e,s,o,a):1;if(c(e)){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");n.texStorage3D(e,p,i,s,o,a)}else n.texStorage2D(e,p,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=c(e),{isImmutable:m,pixelFormat:h,dataType:d}=this._descriptor;if(m){if(null!=n){const r=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texSubImage3D(e,i,0,0,0,s,o,a,h,d,r)}else p.texSubImage2D(e,i,0,0,s,o,h,d,r)}}else{const m=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texImage3D(e,i,r,s,o,a,0,h,d,m)}else p.texImage2D(e,i,r,s,o,0,h,d,m)}}_compressedTexImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=c(e);if(this._descriptor.isImmutable){if(null!=n)if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else p.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexImage3D(e,i,r,s,o,a,0,n)}else p.compressedTexImage2D(e,i,r,s,o,0,n)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:a,preMultiplyAlpha:n,hasMipmap:p}=this._descriptor,l=this._descriptor.compress?.compressionTracker,m=this._descriptor.compress?.compressionCallback,{compressedTextureETC:h,compressedTextureS3TC:d}=r.capabilities;if(!A.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!h&&!d)return;this.abortCompression();const c=new AbortController;let _;this._compressionAbortController=c,l?.increment();try{t instanceof Uint8Array?_=t.buffer:(_=await createImageBitmap(t,{imageOrientation:a?"flipY":"none"}),s(c));const r={data:_,width:e,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:n,hasMipmap:p,hasETC:!!h,hasS3TC:!!d},o=await A.compressionWorkerHandle.invoke(r,c.signal,1);if(s(c),o.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=o.internalFormat,this._setData(o.compressedTexture),m?.(t-this.usedMemory)}}catch(u){o(u)||E().error("Texture compression failed!")}finally{l?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),_ instanceof ImageBitmap&&_.close()}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:o,hasMipmap:a,target:n}=this._descriptor;const p=32879===n;if(null==r||null==s||p&&null==o)throw new t("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,o),a&&(1!==r||1!==s||p&&1!==o)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),p&&(o=Math.max(1,o>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),a(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}export{A as Texture,w as tracer};
5
+ import t from"../../core/Error.js";import has from"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{hasValue as r}from"../../core/object.js";import{throwIfAborted as s,isAbortError as o}from"../../core/promiseUtils.js";import{checkWebGLError as a}from"./checkWebGLError.js";import{ResourceType as n,CompressedTextureFormat as p}from"./enums.js";import{estimateMemory as l}from"./TextureDescriptor.js";import{isCompressedData as m,deriveInternalFormat as h,isTexImageSource as d,is3DTarget as c,validateTexture as _,isCompressedFormat as u,getDimensions as g,calcMipmapLevels as x,isSizedPixelFormat as T,isSizedDepthFormat as M,isSizedDepthStencilFormat as b}from"./textureUtils.js";import{ValidatedTextureDescriptor as f}from"./ValidatedTextureDescriptor.js";const w=!!has("esri-tests-disable-gpu-memory-measurements"),D=()=>e.getLogger("esri/views/webgl/Texture");class E{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,i=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=i;else{const r=f.validate(e,i);if(!r)throw new t("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return w?0:l(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(n.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=i,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!m(t)&&this._descriptor.internalFormat&&r(p,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!m(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(e,i,r,s,o,a,n=0){a||D().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||D().error("An attempt to update uninitialized texture!");const p=this._descriptor;p.internalFormat=h(p);const{context:l,pixelFormat:c,dataType:_,target:u,isImmutable:g}=p;if(g&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");const x=l.bindTexture(this,E.TEXTURE_UNIT_FOR_UPDATES,!0);(i<0||r<0||i+s>p.width||r+o>p.height)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=l;n&&(s&&o||D().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),T.pixelStorei(T.UNPACK_SKIP_ROWS,n)),d(a)?T.texSubImage2D(u,e,i,r,s,o,c,_,a):m(a)?T.compressedTexSubImage2D(u,e,i,r,s,o,p.internalFormat,a.levels[e]):T.texSubImage2D(u,e,i,r,s,o,c,_,a),n&&T.pixelStorei(T.UNPACK_SKIP_ROWS,0),l.bindTexture(x,E.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,i,r,s,o,a,n,p){p||D().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||D().error("An attempt to update an uninitialized texture!");const l=this._descriptor;l.internalFormat=h(l);const{context:d,pixelFormat:_,dataType:u,isImmutable:g,target:x}=l;if(g&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");c(x)||D().warn("Attempting to set 3D texture data on a non-3D texture");const T=d.bindTexture(this,E.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(E.TEXTURE_UNIT_FOR_UPDATES),(i<0||r<0||s<0||i+o>l.width||r+a>l.height||s+n>l.depth)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=d;if(m(p))p=p.levels[e],M.compressedTexSubImage3D(x,e,i,r,s,o,a,n,l.internalFormat,p);else{const t=p;M.texSubImage3D(x,e,i,r,s,o,a,n,_,u,t)}d.bindTexture(T,E.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,_(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const i=this._descriptor.context.bindTexture(this,E.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(E.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(i,E.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,_(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,_(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),_(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=i(this._compressionAbortController)}_setData(e,i){const r=this._descriptor,s=r.context?.gl;if(!s)return;a(s),this.hasWebGLTextureObject||(this._glName=s.createTexture(),r.context.instanceCounter.increment(n.Texture,this)),_(r);const o=r.context.bindTexture(this,E.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(E.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),a(s);const p=i??r.target,l=c(p);if(d(e))this._setDataFromTexImageSource(e,p);else{const{width:i,height:o,depth:n}=r;if(null==i||null==o)throw new t("texture:missing-size","Width and height must be specified!");if(l&&null==n)throw new t("texture:missing-depth","Depth must be specified!");if(r.internalFormat=h(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(p,r.internalFormat,r.hasMipmap,i,o,n),m(e)){if(!u(r.internalFormat))throw new t("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,p)}else this._texImage(p,0,r.internalFormat,i,o,n,e),a(s),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),a(s),r.context.bindTexture(o,E.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=h(r);const s=c(e),{width:o,height:n,depth:p}=g(t);r.width&&r.height,r.width||(r.width=o),r.height||(r.height=n),s&&r.depth,s&&(r.depth=p),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,o,n,p),this._texImage(e,0,r.internalFormat,o,n,p,t),a(i),r.hasMipmap&&(this.generateMipmap(),a(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,p=x(i,s,o,a),l=Math.min(p,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,l),this._forEachMipmapLevel((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)},l)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!T(i)&&!M(i)&&!b(i))throw new t("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const p=r?x(e,s,o,a):1;if(c(e)){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");n.texStorage3D(e,p,i,s,o,a)}else n.texStorage2D(e,p,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=c(e),{isImmutable:m,pixelFormat:h,dataType:d}=this._descriptor;if(m){if(null!=n){const r=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texSubImage3D(e,i,0,0,0,s,o,a,h,d,r)}else p.texSubImage2D(e,i,0,0,s,o,h,d,r)}}else{const m=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texImage3D(e,i,r,s,o,a,0,h,d,m)}else p.texImage2D(e,i,r,s,o,0,h,d,m)}}_compressedTexImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=c(e);if(this._descriptor.isImmutable){if(null!=n)if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else p.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexImage3D(e,i,r,s,o,a,0,n)}else p.compressedTexImage2D(e,i,r,s,o,0,n)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:a,preMultiplyAlpha:n,hasMipmap:p}=this._descriptor,l=this._descriptor.compress?.compressionTracker,m=this._descriptor.compress?.compressionCallback,{compressedTextureETC:h,compressedTextureS3TC:d}=r.capabilities;if(!E.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!h&&!d)return;this.abortCompression();const c=new AbortController;let _;this._compressionAbortController=c,l?.increment();try{t instanceof Uint8Array?_=t.buffer:(_=await createImageBitmap(t,{imageOrientation:a?"flipY":"none"}),s(c));const r={data:_,width:e,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:n,hasMipmap:p,hasETC:!!h,hasS3TC:!!d},o=await E.compressionWorkerHandle.invoke(r,c.signal,1);if(s(c),o.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=o.internalFormat,this._setData(o.compressedTexture),m?.(t-this.usedMemory)}}catch(u){o(u)||D().error("Texture compression failed!")}finally{l?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),_ instanceof ImageBitmap&&_.close()}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:o,hasMipmap:a,target:n}=this._descriptor;const p=32879===n;if(null==r||null==s||p&&null==o)throw new t("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,o),a&&(1!==r||1!==s||p&&1!==o)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),p&&(o=Math.max(1,o>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),a(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}export{E 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ZEROS as e}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{SizedPixelFormat as t,PixelType as n}from"./enums.js";import{Texture as a}from"./Texture.js";import{TextureDescriptor as r}from"./TextureDescriptor.js";function u(e,u,i="nearest",o=!1){const s=!(o&&"u8"===u.pixelType),m=s?n.FLOAT:n.UNSIGNED_BYTE,l=null==u.pixels||0===u.pixels.length?null:s?u.getAsRGBAFloat():u.getAsRGBA(),c=e.capabilities.textureFloatLinear,f=new r(u.width,u.height);return f.internalFormat=s?t.RGBA32F:6408,f.samplingMode=!c||"bilinear"!==i&&"cubic"!==i?9728:9729,f.dataType=m,f.wrapMode=33071,new a(e,f,l)}function i(e,u){const{spacing:i,offsets:o,coefficients:s,size:[m,l]}=u,c=i[0]>1,f=new r(c?4*m:m,l);f.internalFormat=t.RGBA32F,f.dataType=n.FLOAT,f.samplingMode=9728,f.wrapMode=33071;const p=new Float32Array(c?m*l*16:2*o.length);if(c&&null!=s)for(let t=0,n=0;t<s.length;t++)p[n++]=s[t],t%3==2&&(p[n++]=1);else for(let t=0;t<l;t++)for(let e=0;e<m;e++){const n=4*(t*m+e),a=2*(e*l+t);p[n]=o[a],p[n+1]=o[a+1],p[n+3]=-1===o[a]?0:1}return new a(e,f,p)}function o(e,t){const n=new r(t.length/4,1);return n.internalFormat=6408,n.samplingMode=9728,n.wrapMode=33071,new a(e,n,t)}function s(e,t,u){const i=new r(u[0],u[1]);return i.internalFormat=6406,i.pixelFormat=6406,i.dataType=n.UNSIGNED_BYTE,i.samplingMode=9728,i.wrapMode=33071,new a(e,i,t)}function m(t,n,a,r=1,u=!0){return{u_flipY:u,u_applyTransform:!!t,u_opacity:r,u_transformSpacing:t?t.spacing:e,u_transformGridSize:t?t.size:e,u_targetImageSize:n,u_srcImageSize:a}}function l(e,t){return{u_colormapOffset:t||0,u_colormapMaxIndex:e?e.length/4-1:0}}function c(e){return{u_bandCount:e.bandCount,u_minOutput:e.minOutput,u_maxOutput:e.maxOutput,u_minCutOff:e.minCutOff,u_maxCutOff:e.maxCutOff,u_factor:e.factor,u_useGamma:e.useGamma,u_gamma:e.gamma,u_gammaCorrection:e.gammaCorrection}}function f(e){return{u_hillshadeType:e.hillshadeType,u_sinZcosAs:e.sinZcosAs,u_sinZsinAs:e.sinZsinAs,u_cosZs:e.cosZs,u_weights:e.weights,u_factor:e.factor,u_minValue:e.minValue,u_maxValue:e.maxValue}}export{o as createColormapTexture,s as createPixelMaskTexture,u as createRasterTexture,i as createTransformTexture,l as getColormapUniforms,m as getCommonUniforms,f as getShadedReliefUniforms,c as getStretchUniforms};
5
+ import{ZEROS as e}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{SizedPixelFormat as t,PixelType as n}from"./enums.js";import a from"./Texture.js";import{TextureDescriptor as r}from"./TextureDescriptor.js";function u(e,u,i="nearest",o=!1){const s=!(o&&"u8"===u.pixelType),m=s?n.FLOAT:n.UNSIGNED_BYTE,l=null==u.pixels||0===u.pixels.length?null:s?u.getAsRGBAFloat():u.getAsRGBA(),c=e.capabilities.textureFloatLinear,f=new r(u.width,u.height);return f.internalFormat=s?t.RGBA32F:6408,f.samplingMode=!c||"bilinear"!==i&&"cubic"!==i?9728:9729,f.dataType=m,f.wrapMode=33071,new a(e,f,l)}function i(e,u){const{spacing:i,offsets:o,coefficients:s,size:[m,l]}=u,c=i[0]>1,f=new r(c?4*m:m,l);f.internalFormat=t.RGBA32F,f.dataType=n.FLOAT,f.samplingMode=9728,f.wrapMode=33071;const p=new Float32Array(c?m*l*16:2*o.length);if(c&&null!=s)for(let t=0,n=0;t<s.length;t++)p[n++]=s[t],t%3==2&&(p[n++]=1);else for(let t=0;t<l;t++)for(let e=0;e<m;e++){const n=4*(t*m+e),a=2*(e*l+t);p[n]=o[a],p[n+1]=o[a+1],p[n+3]=-1===o[a]?0:1}return new a(e,f,p)}function o(e,t){const n=new r(t.length/4,1);return n.internalFormat=6408,n.samplingMode=9728,n.wrapMode=33071,new a(e,n,t)}function s(e,t,u){const i=new r(u[0],u[1]);return i.internalFormat=6406,i.pixelFormat=6406,i.dataType=n.UNSIGNED_BYTE,i.samplingMode=9728,i.wrapMode=33071,new a(e,i,t)}function m(t,n,a,r=1,u=!0){return{u_flipY:u,u_applyTransform:!!t,u_opacity:r,u_transformSpacing:t?t.spacing:e,u_transformGridSize:t?t.size:e,u_targetImageSize:n,u_srcImageSize:a}}function l(e,t){return{u_colormapOffset:t||0,u_colormapMaxIndex:e?e.length/4-1:0}}function c(e){return{u_bandCount:e.bandCount,u_minOutput:e.minOutput,u_maxOutput:e.maxOutput,u_minCutOff:e.minCutOff,u_maxCutOff:e.maxCutOff,u_factor:e.factor,u_useGamma:e.useGamma,u_gamma:e.gamma,u_gammaCorrection:e.gammaCorrection}}function f(e){return{u_hillshadeType:e.hillshadeType,u_sinZcosAs:e.sinZcosAs,u_sinZsinAs:e.sinZsinAs,u_cosZs:e.cosZs,u_weights:e.weights,u_factor:e.factor,u_minValue:e.minValue,u_maxValue:e.maxValue}}export{o as createColormapTexture,s as createPixelMaskTexture,u as createRasterTexture,i as createTransformTexture,l as getColormapUniforms,m as getCommonUniforms,f as getShadedReliefUniforms,c as getStretchUniforms};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{PrimitiveType as e,PixelType as r}from"./enums.js";import{FramebufferObject as t}from"./FramebufferObject.js";import{Texture as i}from"./Texture.js";import{TextureDescriptor as o}from"./TextureDescriptor.js";import{VertexArrayObject as n}from"./VertexArrayObject.js";import{Pos2usLocations as s,Pos2us as a}from"./VertexAttributeLayouts.js";import{VertexBuffer as p}from"./VertexBuffer.js";import{WebGLDriverTestModule as m}from"./WebGLDriverTestModule.js";class u extends m{constructor(e){super(),this._rctx=e;const r="\n precision highp float;\n\n attribute vec2 position;\n varying vec2 v_uv;\n\n void main() {\n v_uv = position;\n gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0);\n }\n ",t="\n precision highp float;\n\n varying vec2 v_uv;\n\n uniform sampler2D u_texture;\n\n void main() {\n gl_FragColor = texture2D(u_texture, v_uv);\n }\n ";this._program=e.programCache.acquire(r,t,s)}dispose(){super.dispose()}_test(s){const m=this._rctx;if(!m.gl)return s.dispose(),!0;const u=new o(1);u.wrapMode=33071,u.samplingMode=9728;const d=new t(m,u),g=new p(m,a,new Uint16Array([0,0,1,0,0,1,1,1])),f=new n(m,g),l=new o;l.samplingMode=9729,l.wrapMode=33071;const v=new i(m,l,c);m.useProgram(s),m.bindTexture(v,0),s.setUniform1i("u_texture",0);const w=m.getBoundFramebufferObject(),{x:h,y:x,width:b,height:_}=m.getViewport();m.bindFramebuffer(d),m.setViewport(0,0,1,1),m.setClearColor(0,0,0,0),m.setBlendingEnabled(!1),m.clear(16384),m.bindVAO(f),m.drawArrays(e.TRIANGLE_STRIP,0,4);const j=new Uint8Array(4);return d.readPixels(0,0,1,1,6408,r.UNSIGNED_BYTE,j),f.dispose(),d.dispose(),v.dispose(),m.setViewport(h,x,b,_),m.bindFramebuffer(w),255!==j[0]}}const c=new Image;c.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",c.width=5,c.height=5,c.decode();export{u as SVGPremultipliedAlpha};
5
+ import{PrimitiveType as e,PixelType as r}from"./enums.js";import{FramebufferObject as t}from"./FramebufferObject.js";import i from"./Texture.js";import{TextureDescriptor as o}from"./TextureDescriptor.js";import{VertexArrayObject as n}from"./VertexArrayObject.js";import{Pos2usLocations as s,Pos2us as a}from"./VertexAttributeLayouts.js";import{VertexBuffer as p}from"./VertexBuffer.js";import{WebGLDriverTestModule as m}from"./WebGLDriverTestModule.js";class u extends m{constructor(e){super(),this._rctx=e;const r="\n precision highp float;\n\n attribute vec2 position;\n varying vec2 v_uv;\n\n void main() {\n v_uv = position;\n gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0);\n }\n ",t="\n precision highp float;\n\n varying vec2 v_uv;\n\n uniform sampler2D u_texture;\n\n void main() {\n gl_FragColor = texture2D(u_texture, v_uv);\n }\n ";this._program=e.programCache.acquire(r,t,s)}dispose(){super.dispose()}_test(s){const m=this._rctx;if(!m.gl)return s.dispose(),!0;const u=new o(1);u.wrapMode=33071,u.samplingMode=9728;const d=new t(m,u),g=new p(m,a,new Uint16Array([0,0,1,0,0,1,1,1])),f=new n(m,g),l=new o;l.samplingMode=9729,l.wrapMode=33071;const v=new i(m,l,c);m.useProgram(s),m.bindTexture(v,0),s.setUniform1i("u_texture",0);const w=m.getBoundFramebufferObject(),{x:h,y:x,width:b,height:_}=m.getViewport();m.bindFramebuffer(d),m.setViewport(0,0,1,1),m.setClearColor(0,0,0,0),m.setBlendingEnabled(!1),m.clear(16384),m.bindVAO(f),m.drawArrays(e.TRIANGLE_STRIP,0,4);const j=new Uint8Array(4);return d.readPixels(0,0,1,1,6408,r.UNSIGNED_BYTE,j),f.dispose(),d.dispose(),v.dispose(),m.setViewport(h,x,b,_),m.bindFramebuffer(w),255!==j[0]}}const c=new Image;c.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",c.width=5,c.height=5,c.decode();export{u as SVGPremultipliedAlpha};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ const l=null;export{l as tracer};
@@ -2,7 +2,7 @@ import type { JSONSupport, JSONSupportMixinProperties } from "../../core/JSONSup
2
2
 
3
3
  export interface SlideThumbnailProperties extends JSONSupportMixinProperties, Partial<Pick<SlideThumbnail, "url">> {}
4
4
 
5
- export abstract class SlideThumbnail extends JSONSupport {
5
+ export default abstract class SlideThumbnail extends JSONSupport {
6
6
  /**
7
7
  * The URI pointing to the thumbnail image representing
8
8
  * the slide.
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{isHTTPSProtocol as e,isDataProtocol as o}from"../../core/urlUtils.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";var u;let l=u=class extends t{constructor(){super(...arguments),this.url=""}destroy(){this.url=""}get isSecureUrl(){return e(this.url)}get isDataURI(){return o(this.url)}clone(){return new u({url:this.url})}};r([s({type:String,json:{write:{isRequired:!0}}})],l.prototype,"url",void 0),r([s()],l.prototype,"isSecureUrl",null),r([s()],l.prototype,"isDataURI",null),l=u=r([i("esri.webdoc.support.SlideThumbnail")],l);export{l as SlideThumbnail};
5
+ import{__decorate as r}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{isHTTPSProtocol as e,isDataProtocol as o}from"../../core/urlUtils.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";var u;let l=u=class extends t{constructor(){super(...arguments),this.url=""}destroy(){this.url=""}get isSecureUrl(){return e(this.url)}get isDataURI(){return o(this.url)}clone(){return new u({url:this.url})}};r([s({type:String,json:{write:{isRequired:!0}}})],l.prototype,"url",void 0),r([s()],l.prototype,"isSecureUrl",null),r([s()],l.prototype,"isDataURI",null),l=u=r([i("esri.webdoc.support.SlideThumbnail")],l);const p=l;export{p as default};
@@ -1,8 +1,9 @@
1
1
  import type Viewpoint from "../Viewpoint.js";
2
2
  import type TimeExtent from "../time/TimeExtent.js";
3
+ import type SlideThumbnail from "../webdoc/support/SlideThumbnail.js";
3
4
  import type { IdentifiableMixin, IdentifiableMixinProperties } from "../core/Identifiable.js";
4
5
  import type { JSONSupport, JSONSupportMixinProperties } from "../core/JSONSupport.js";
5
- import type { SlideThumbnail, SlideThumbnailProperties } from "../webdoc/support/SlideThumbnail.js";
6
+ import type { SlideThumbnailProperties } from "../webdoc/support/SlideThumbnail.js";
6
7
  import type { TimeExtentProperties } from "../time/TimeExtent.js";
7
8
  import type { ViewpointProperties } from "../Viewpoint.js";
8
9
 
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../Viewpoint.js";import o from"../core/Error.js";import{IdentifiableMixin as r}from"../core/Identifiable.js";import{JSONSupport as i}from"../core/JSONSupport.js";import{clone as n}from"../core/lang.js";import p from"../core/Logger.js";import{property as s,cast as m,subclass as a}from"../core/accessorSupport/decorators.js";import{ensureType as l}from"../core/accessorSupport/ensureType.js";import{SlideThumbnail as u}from"../webdoc/support/SlideThumbnail.js";import{timeExtent as c}from"../webdoc/support/timeProperties.js";import{reader as w}from"../core/accessorSupport/decorators/reader.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";var d;let y=d=class extends(r(i)){constructor(t){super(t),this.name=null,this.thumbnail=new u,this.timeExtent=null}castThumbnail(t){return"string"==typeof t?new u({url:t}):l(u,t)}set viewpoint(t){const{targetGeometry:e,scale:o}=t;null!=e&&"point"===e.type&&null==o&&p.getLogger(this).warn("Bookmark.viewpoint should include 'scale' when its targetGeometry is a point.",t),this._set("viewpoint",t)}readViewpoint(t,o){const{extent:r,viewpoint:i}=o;return e.fromJSON(i||{targetGeometry:r})}writeViewpoint(t,e,r,i){if(!t)return;const{targetGeometry:n}=t;if(null!=n&&"extent"!==n.type){const t="Bookmark.viewpoint cannot be written to JSON when the viewpoint's targetGeometry is not an extent.";return void(i?.messages?i.messages.push(new o("property:unsupported",t)):p.getLogger(this).error(t))}null!=n&&(e.extent=n.toJSON()),e[r]=t.toJSON()}clone(){return new d(n({name:this.name,thumbnail:this.thumbnail,timeExtent:this.timeExtent,viewpoint:this.viewpoint}))}};t([s({type:String,nonNullable:!0,json:{write:{isRequired:!0}}})],y.prototype,"name",void 0),t([s({type:u,json:{write:{overridePolicy:t=>({enabled:!(!t||!t.url)})}}})],y.prototype,"thumbnail",void 0),t([m("thumbnail")],y.prototype,"castThumbnail",null),t([s(c)],y.prototype,"timeExtent",void 0),t([s({type:e,nonNullable:!0,json:{write:!0}})],y.prototype,"viewpoint",null),t([w("viewpoint",["extent","viewpoint"])],y.prototype,"readViewpoint",null),t([h("viewpoint")],y.prototype,"writeViewpoint",null),y=d=t([a("esri.webmap.Bookmark")],y);const f=y;export{f as default};
5
+ import{__decorate as t}from"tslib";import e from"../Viewpoint.js";import o from"../core/Error.js";import{IdentifiableMixin as r}from"../core/Identifiable.js";import{JSONSupport as i}from"../core/JSONSupport.js";import{clone as n}from"../core/lang.js";import p from"../core/Logger.js";import{property as s,cast as m,subclass as a}from"../core/accessorSupport/decorators.js";import{ensureType as l}from"../core/accessorSupport/ensureType.js";import u from"../webdoc/support/SlideThumbnail.js";import{timeExtent as c}from"../webdoc/support/timeProperties.js";import{reader as w}from"../core/accessorSupport/decorators/reader.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";var d;let y=d=class extends(r(i)){constructor(t){super(t),this.name=null,this.thumbnail=new u,this.timeExtent=null}castThumbnail(t){return"string"==typeof t?new u({url:t}):l(u,t)}set viewpoint(t){const{targetGeometry:e,scale:o}=t;null!=e&&"point"===e.type&&null==o&&p.getLogger(this).warn("Bookmark.viewpoint should include 'scale' when its targetGeometry is a point.",t),this._set("viewpoint",t)}readViewpoint(t,o){const{extent:r,viewpoint:i}=o;return e.fromJSON(i||{targetGeometry:r})}writeViewpoint(t,e,r,i){if(!t)return;const{targetGeometry:n}=t;if(null!=n&&"extent"!==n.type){const t="Bookmark.viewpoint cannot be written to JSON when the viewpoint's targetGeometry is not an extent.";return void(i?.messages?i.messages.push(new o("property:unsupported",t)):p.getLogger(this).error(t))}null!=n&&(e.extent=n.toJSON()),e[r]=t.toJSON()}clone(){return new d(n({name:this.name,thumbnail:this.thumbnail,timeExtent:this.timeExtent,viewpoint:this.viewpoint}))}};t([s({type:String,nonNullable:!0,json:{write:{isRequired:!0}}})],y.prototype,"name",void 0),t([s({type:u,json:{write:{overridePolicy:t=>({enabled:!(!t||!t.url)})}}})],y.prototype,"thumbnail",void 0),t([m("thumbnail")],y.prototype,"castThumbnail",null),t([s(c)],y.prototype,"timeExtent",void 0),t([s({type:e,nonNullable:!0,json:{write:!0}})],y.prototype,"viewpoint",null),t([w("viewpoint",["extent","viewpoint"])],y.prototype,"readViewpoint",null),t([h("viewpoint")],y.prototype,"writeViewpoint",null),y=d=t([a("esri.webmap.Bookmark")],y);const f=y;export{f as default};
@@ -1,3 +1,3 @@
1
- import type { Version as CoreVersion } from "../core/Version.js";
1
+ import type CoreVersion from "../core/Version.js";
2
2
 
3
- export abstract class Version extends CoreVersion {}
3
+ export default abstract class Version extends CoreVersion {}
package/webmap/Version.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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{Version as r}from"../core/Version.js";class s extends r{constructor(r,s){super(r,s,"webmap")}}export{s as Version};
5
+ import e from"../core/Version.js";class r extends e{constructor(e,r){super(e,r,"webmap")}}export{r as default};
package/webmap/utils.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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{Version as e}from"./Version.js";function r(e){return null!=e&&"object"==typeof e&&"declaredClass"in e&&"esri.WebMap"===e.declaredClass}const n=new e(2,36);export{n as currentVersion,r as isWebMap};
5
+ import e from"./Version.js";function r(e){return null!=e&&"object"==typeof e&&"declaredClass"in e&&"esri.WebMap"===e.declaredClass}const n=new e(2,36);export{n as currentVersion,r as isWebMap};
@@ -3,23 +3,26 @@ import type Viewpoint from "../Viewpoint.js";
3
3
  import type Collection from "../core/Collection.js";
4
4
  import type TimeExtent from "../time/TimeExtent.js";
5
5
  import type SceneView from "../views/SceneView.js";
6
+ import type SlideThumbnail from "../webdoc/support/SlideThumbnail.js";
6
7
  import type Description from "./support/Description.js";
7
8
  import type SlideElements from "./support/SlideElements.js";
9
+ import type SlideEnvironment from "./support/SlideEnvironment.js";
8
10
  import type SlideGround from "./support/SlideGround.js";
11
+ import type SlideVisibleLayer from "./support/SlideVisibleLayer.js";
9
12
  import type Title from "./support/Title.js";
10
13
  import type { BasemapProperties } from "../Basemap.js";
11
14
  import type { ClonableMixin, ClonableMixinProperties } from "../core/Clonable.js";
12
15
  import type { EventedMixin, EventedMixinProperties } from "../core/Evented.js";
13
16
  import type { JSONSupport, JSONSupportMixinProperties } from "../core/JSONSupport.js";
14
17
  import type { GoToOptions3D, UserSettings as ScreenshotUserSettings } from "../views/types.js";
15
- import type { SlideThumbnail, SlideThumbnailProperties } from "../webdoc/support/SlideThumbnail.js";
18
+ import type { SlideThumbnailProperties } from "../webdoc/support/SlideThumbnail.js";
16
19
  import type { DescriptionProperties } from "./support/Description.js";
17
- import type { SlideEnvironment, SlideEnvironmentProperties } from "./support/SlideEnvironment.js";
18
- import type { SlideVisibleLayerProperties, SlideVisibleLayer } from "./support/SlideVisibleLayer.js";
20
+ import type { SlideVisibleLayerProperties } from "./support/SlideVisibleLayer.js";
19
21
  import type { TitleProperties } from "./support/Title.js";
20
22
  import type { ViewpointProperties } from "../Viewpoint.js";
21
23
  import type { SlideGroundProperties } from "./support/SlideGround.js";
22
24
  import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
25
+ import type { SlideEnvironmentProperties } from "./support/SlideEnvironment.js";
23
26
  import type { TimeExtentProperties } from "../time/TimeExtent.js";
24
27
  import type { SlideElementsProperties } from "./support/SlideElements.js";
25
28
 
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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import{ClonableMixin as r}from"../core/Clonable.js";import s from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{EventedMixin as a}from"../core/Evented.js";import{JSONSupport as l}from"../core/JSONSupport.js";import p from"../core/Logger.js";import{moduloPositive as m}from"../core/mathUtils.js";import{destroyMaybe as h,removeMaybe as c}from"../core/maybe.js";import{onAbortOrThrow as d,createAbortError as u,isAbortError as y}from"../core/promiseUtils.js";import{whenOnce as g,when as b}from"../core/reactiveUtils.js";import{Milliseconds as v,Seconds as w}from"../core/time.js";import{property as f,cast as T,subclass as _}from"../core/accessorSupport/decorators.js";import{ensureType as j}from"../core/accessorSupport/ensureType.js";import{s as L}from"../chunks/vec32.js";import{create as C}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import E from"../layers/Layer.js";import{basemapEnsureType as S,clonePreservingTiledLayers as A}from"../support/basemapEnsureType.js";import{TaskPriority as k}from"../views/support/Scheduler.js";import{SlideThumbnail as V}from"../webdoc/support/SlideThumbnail.js";import{timeExtent as U}from"../webdoc/support/timeProperties.js";import F from"./SunLighting.js";import x from"./VirtualLighting.js";import I from"./support/Description.js";import R from"./support/SlideElements.js";import{SlideEnvironment as D}from"./support/SlideEnvironment.js";import O from"./support/SlideGround.js";import{SlideVisibleLayer as P}from"./support/SlideVisibleLayer.js";import q from"./support/Title.js";let M=0;const N=s.ofType(P),B=["caption","cover","none"];let G=class extends(r(a(l))){constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+M++,this.hidden=!1,this.viewpoint=null,this.ground=null,this.layout="caption",this.enabledFocusAreas=null,this.environment=new D,this.timeExtent=null,this.elements=new R,this.title=new q,this.description=new I,this.thumbnail=new V,this.visibleLayers=new N}destroy(){this.visibleLayers.removeAll(),this.enabledFocusAreas=null,this.basemap=null,this.thumbnail=h(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null,this.elements.destroy()}get title(){return this._get("title")}set title(e){e="string"==typeof e?new q({text:e}):j(q,e),this._set("title",e)}get description(){return this._get("description")}set description(e){e="string"==typeof e?new I({text:e}):j(I,e),this._set("description",e)}get thumbnail(){return this._get("thumbnail")}set thumbnail(e){e="string"==typeof e?new V({url:e}):j(V,e),this._set("thumbnail",e)}get basemap(){return this._get("basemap")}set basemap(e){this._set("basemap",S(e))}set visibleLayers(e){this._set("visibleLayers",o(e,this._get("visibleLayers"),N))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map(e=>{if("string"==typeof e)return{id:e};if(e instanceof E){const t=J(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:"sublayerIds"in e?e.sublayerIds:void 0}:(p.getLogger(this).warn('Invalid visible layer, expected { id }, Layer or "id"'),e)}):null}async _updateVisibleLayers(e){const t=[];await Promise.allSettled(this._getLayers(e.map).map(i=>e.whenLayerView(i).then(e=>{if(e.visible){const n=J(i);t.push(new P({id:e.layer.id,sublayerIds:n}))}})).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}async updateFrom(e,t){const i={format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};await e.when(),this.viewpoint=e.viewpoint.clone(),this.environment.lighting="virtual"===e.environment.lighting.type?x.prototype.clone.apply(e.environment.lighting):F.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this.enabledFocusAreas=new s(e.focusAreasView?.enabledAreas.map(({id:e})=>e)??[]),this.basemap=e.map.basemap?.clone()||null,this.ground=e.map.ground?O.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this.elements.analyses.updateFrom(e),await this._updateVisibleLayers(e);const n=await e.takeScreenshot(i);return this.thumbnail=new V({url:n.dataUrl}),this}async applyTo(e,t){this.emit("apply-slide-start"),null!=this._applyToController&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=d(t,()=>i?.abort()),s=()=>{this._applyToController===i&&(this._applyToController=null),i=null,r?.remove()};try{await g(()=>e.ready,i.signal)}catch(h){throw s(),h}if(i.signal.aborted)throw s(),this.emit("apply-slide-cancel"),u();const o=e.resourceController.scheduler.registerTask(k.SLIDE);let a=!1;const l={animate:!0,...t,signal:this._applyToController.signal},p=async()=>{await Promise.all([o.schedule(async()=>a=await this._setViewpointOfInterest(e,l)),o.schedule(()=>this._applyBasemap(e,l),l.signal),o.schedule(()=>this._loadLayersWithSublayerVisibility(e))]),await Promise.all([o.schedule(()=>this._applyLayerVisibility(e),l.signal),o.schedule(()=>this._applyFocusAreaEnabled(e.map?.focusAreas.areas)),o.schedule(()=>this._applyGround(e),l.signal),o.schedule(()=>this.elements.analyses.applyTo(e),l.signal),o.schedule(()=>this._applyViewpoint(e,l),l.signal),o.schedule(()=>e.timeExtent=this.timeExtent?.clone()??null,l.signal),o.schedule(()=>e.environment.weather=this.environment.weather.clone())])},m=await n(e.addUpdatingPromise(p()));if(a&&(e.contentCamera=null),o.remove(),s(),!1===m.ok)throw this.emit("apply-slide-cancel"),m.error;return this.emit("apply-slide-complete"),this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(y(i))throw i}e.map.basemap=A(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_applyFocusAreaEnabled(e){if(e&&this.enabledFocusAreas)for(const t of e)t.enabled=this.enabledFocusAreas.includes(t.id)}_getLayers(e){const t=new s;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach(e=>{e.persistenceEnabled&&(t.add(e),"layers"in e&&this._collectLayers(e,t))})}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map(e=>{const t=this.visibleLayers.find(t=>t.id===e.id)?.sublayerIds;return t?e.load():null}))}_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?.sublayerIds,n=H(e);i&&n&&n.forEach(e=>e.visible=i.includes(e.id))})}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;const{toCameraAsync:i}=await import("../views/3d/support/viewpointUtils.js"),n=await i(e,this.viewpoint);return e.contentCamera=n,null!=n}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){const i=this.environment.lighting;if(t.animate&&"sun"===i.type&&i.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(i.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;"virtual"!==e.environment.lighting.type&&"virtual"!==this.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,"virtual"===this.environment.lighting.type||"virtual"===e.environment.lighting.type?(e.environment.applyLighting(this.environment.lighting.clone()),"virtual"!==e.environment.lighting.type&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):null!=this.environment.lighting.displayUTCOffset&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);return e.goTo(this.viewpoint,t).then(()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())}).catch(t=>{throw null==e.animation&&this._applyCachedCameraTrackingEnabled(e),t}).finally(()=>{c(i)})}_applyCachedCameraTrackingEnabled(e){null!=e.environment.cachedCameraTrackingEnabled&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[v(e.getTime()),w(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,t,i){const n=new Date(t.date.toString()),[r,s]=this._getTime(n),[o,a]=this._getTime(i.date),l=Q(s,a),p=e.renderCoordsHelper,m=C();p.toRenderCoords(e.camera.position,m);const h=C(),c=C();null!=this.viewpoint.camera&&p.toRenderCoords(this.viewpoint.camera.position,h);const d=new Date;return b(()=>e.camera,e=>{p.toRenderCoords(e.position,c);const i=L(m,c),n=L(h,c);let a=0;i+n!==0&&(a=i/(i+n));const u=r+(o-r)*a,y=X(s,w(l*a));t.date=this._setTime(d,u,y)})}write(e,t){const i=super.write(e,t);return i?.elements&&0===Object.keys(i.elements).length&&delete i.elements,i}static createFrom(e,t){return(new this).updateFrom(e,t)}};e([f({type:String,json:{write:{isRequired:!0}}})],G.prototype,"id",void 0),e([f({type:q,useTypeForAutocast:!1,json:{default:()=>new q({text:""}),write:{isRequired:!0}}})],G.prototype,"title",null),e([f({type:I,useTypeForAutocast:!1,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],G.prototype,"description",null),e([f({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],G.prototype,"hidden",void 0),e([f({type:V,useTypeForAutocast:!1,json:{default:()=>new V({url:""}),write:{isRequired:!0}}})],G.prototype,"thumbnail",null),e([f({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],G.prototype,"viewpoint",void 0),e([f({type:t,useTypeForAutocast:!1,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],G.prototype,"basemap",null),e([f({type:O,json:{write:!0}})],G.prototype,"ground",void 0),e([f({type:B,json:{write:!0,default:"caption"},nonNullable:!0})],G.prototype,"layout",void 0),e([f({type:N,json:{write:{isRequired:!0}}})],G.prototype,"visibleLayers",null),e([T("visibleLayers")],G.prototype,"castVisibleLayers",null),e([f({type:s.ofType(String),json:{write:!0},clonable:e=>e?new s(e.items):null})],G.prototype,"enabledFocusAreas",void 0),e([f({type:D,json:{write:!0}})],G.prototype,"environment",void 0),e([f(U)],G.prototype,"timeExtent",void 0),e([f({type:R,nonNullable:!0,json:{write:!0}})],G.prototype,"elements",void 0),G=e([_("esri.webscene.Slide")],G);const W=G;function H(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function J(e){const t=H(e);if(t)return t.filter(e=>e.visible).map(e=>e.id)}const z=w(86400),K=w(43200);function Q(e,t){let i=t-e;return i>K&&(i-=z),i<-K&&(i+=z),w(i)}function X(e,t){return w(m(e+t,z))}export{W as default};
5
+ import{__decorate as e}from"tslib";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import{ClonableMixin as r}from"../core/Clonable.js";import s from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{EventedMixin as a}from"../core/Evented.js";import{JSONSupport as l}from"../core/JSONSupport.js";import p from"../core/Logger.js";import{moduloPositive as m}from"../core/mathUtils.js";import{destroyMaybe as h,removeMaybe as c}from"../core/maybe.js";import{onAbortOrThrow as d,createAbortError as u,isAbortError as y}from"../core/promiseUtils.js";import{whenOnce as g,when as b}from"../core/reactiveUtils.js";import{Milliseconds as v,Seconds as w}from"../core/time.js";import{property as f,cast as T,subclass as _}from"../core/accessorSupport/decorators.js";import{ensureType as j}from"../core/accessorSupport/ensureType.js";import{s as L}from"../chunks/vec32.js";import{create as C}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import E from"../layers/Layer.js";import{basemapEnsureType as S,clonePreservingTiledLayers as A}from"../support/basemapEnsureType.js";import{TaskPriority as k}from"../views/support/Scheduler.js";import V from"../webdoc/support/SlideThumbnail.js";import{timeExtent as U}from"../webdoc/support/timeProperties.js";import F from"./SunLighting.js";import x from"./VirtualLighting.js";import I from"./support/Description.js";import R from"./support/SlideElements.js";import D from"./support/SlideEnvironment.js";import O from"./support/SlideGround.js";import P from"./support/SlideVisibleLayer.js";import q from"./support/Title.js";let M=0;const N=s.ofType(P),B=["caption","cover","none"];let G=class extends(r(a(l))){constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+M++,this.hidden=!1,this.viewpoint=null,this.ground=null,this.layout="caption",this.enabledFocusAreas=null,this.environment=new D,this.timeExtent=null,this.elements=new R,this.title=new q,this.description=new I,this.thumbnail=new V,this.visibleLayers=new N}destroy(){this.visibleLayers.removeAll(),this.enabledFocusAreas=null,this.basemap=null,this.thumbnail=h(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null,this.elements.destroy()}get title(){return this._get("title")}set title(e){e="string"==typeof e?new q({text:e}):j(q,e),this._set("title",e)}get description(){return this._get("description")}set description(e){e="string"==typeof e?new I({text:e}):j(I,e),this._set("description",e)}get thumbnail(){return this._get("thumbnail")}set thumbnail(e){e="string"==typeof e?new V({url:e}):j(V,e),this._set("thumbnail",e)}get basemap(){return this._get("basemap")}set basemap(e){this._set("basemap",S(e))}set visibleLayers(e){this._set("visibleLayers",o(e,this._get("visibleLayers"),N))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map(e=>{if("string"==typeof e)return{id:e};if(e instanceof E){const t=J(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:"sublayerIds"in e?e.sublayerIds:void 0}:(p.getLogger(this).warn('Invalid visible layer, expected { id }, Layer or "id"'),e)}):null}async _updateVisibleLayers(e){const t=[];await Promise.allSettled(this._getLayers(e.map).map(i=>e.whenLayerView(i).then(e=>{if(e.visible){const n=J(i);t.push(new P({id:e.layer.id,sublayerIds:n}))}})).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}async updateFrom(e,t){const i={format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};await e.when(),this.viewpoint=e.viewpoint.clone(),this.environment.lighting="virtual"===e.environment.lighting.type?x.prototype.clone.apply(e.environment.lighting):F.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this.enabledFocusAreas=new s(e.focusAreasView?.enabledAreas.map(({id:e})=>e)??[]),this.basemap=e.map.basemap?.clone()||null,this.ground=e.map.ground?O.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this.elements.analyses.updateFrom(e),await this._updateVisibleLayers(e);const n=await e.takeScreenshot(i);return this.thumbnail=new V({url:n.dataUrl}),this}async applyTo(e,t){this.emit("apply-slide-start"),null!=this._applyToController&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=d(t,()=>i?.abort()),s=()=>{this._applyToController===i&&(this._applyToController=null),i=null,r?.remove()};try{await g(()=>e.ready,i.signal)}catch(h){throw s(),h}if(i.signal.aborted)throw s(),this.emit("apply-slide-cancel"),u();const o=e.resourceController.scheduler.registerTask(k.SLIDE);let a=!1;const l={animate:!0,...t,signal:this._applyToController.signal},p=async()=>{await Promise.all([o.schedule(async()=>a=await this._setViewpointOfInterest(e,l)),o.schedule(()=>this._applyBasemap(e,l),l.signal),o.schedule(()=>this._loadLayersWithSublayerVisibility(e))]),await Promise.all([o.schedule(()=>this._applyLayerVisibility(e),l.signal),o.schedule(()=>this._applyFocusAreaEnabled(e.map?.focusAreas.areas)),o.schedule(()=>this._applyGround(e),l.signal),o.schedule(()=>this.elements.analyses.applyTo(e),l.signal),o.schedule(()=>this._applyViewpoint(e,l),l.signal),o.schedule(()=>e.timeExtent=this.timeExtent?.clone()??null,l.signal),o.schedule(()=>e.environment.weather=this.environment.weather.clone())])},m=await n(e.addUpdatingPromise(p()));if(a&&(e.contentCamera=null),o.remove(),s(),!1===m.ok)throw this.emit("apply-slide-cancel"),m.error;return this.emit("apply-slide-complete"),this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(y(i))throw i}e.map.basemap=A(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_applyFocusAreaEnabled(e){if(e&&this.enabledFocusAreas)for(const t of e)t.enabled=this.enabledFocusAreas.includes(t.id)}_getLayers(e){const t=new s;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach(e=>{e.persistenceEnabled&&(t.add(e),"layers"in e&&this._collectLayers(e,t))})}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map(e=>{const t=this.visibleLayers.find(t=>t.id===e.id)?.sublayerIds;return t?e.load():null}))}_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?.sublayerIds,n=H(e);i&&n&&n.forEach(e=>e.visible=i.includes(e.id))})}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;const{toCameraAsync:i}=await import("../views/3d/support/viewpointUtils.js"),n=await i(e,this.viewpoint);return e.contentCamera=n,null!=n}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){const i=this.environment.lighting;if(t.animate&&"sun"===i.type&&i.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(i.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;"virtual"!==e.environment.lighting.type&&"virtual"!==this.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,"virtual"===this.environment.lighting.type||"virtual"===e.environment.lighting.type?(e.environment.applyLighting(this.environment.lighting.clone()),"virtual"!==e.environment.lighting.type&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):null!=this.environment.lighting.displayUTCOffset&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);return e.goTo(this.viewpoint,t).then(()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())}).catch(t=>{throw null==e.animation&&this._applyCachedCameraTrackingEnabled(e),t}).finally(()=>{c(i)})}_applyCachedCameraTrackingEnabled(e){null!=e.environment.cachedCameraTrackingEnabled&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[v(e.getTime()),w(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,t,i){const n=new Date(t.date.toString()),[r,s]=this._getTime(n),[o,a]=this._getTime(i.date),l=Q(s,a),p=e.renderCoordsHelper,m=C();p.toRenderCoords(e.camera.position,m);const h=C(),c=C();null!=this.viewpoint.camera&&p.toRenderCoords(this.viewpoint.camera.position,h);const d=new Date;return b(()=>e.camera,e=>{p.toRenderCoords(e.position,c);const i=L(m,c),n=L(h,c);let a=0;i+n!==0&&(a=i/(i+n));const u=r+(o-r)*a,y=X(s,w(l*a));t.date=this._setTime(d,u,y)})}write(e,t){const i=super.write(e,t);return i?.elements&&0===Object.keys(i.elements).length&&delete i.elements,i}static createFrom(e,t){return(new this).updateFrom(e,t)}};e([f({type:String,json:{write:{isRequired:!0}}})],G.prototype,"id",void 0),e([f({type:q,useTypeForAutocast:!1,json:{default:()=>new q({text:""}),write:{isRequired:!0}}})],G.prototype,"title",null),e([f({type:I,useTypeForAutocast:!1,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],G.prototype,"description",null),e([f({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],G.prototype,"hidden",void 0),e([f({type:V,useTypeForAutocast:!1,json:{default:()=>new V({url:""}),write:{isRequired:!0}}})],G.prototype,"thumbnail",null),e([f({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],G.prototype,"viewpoint",void 0),e([f({type:t,useTypeForAutocast:!1,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],G.prototype,"basemap",null),e([f({type:O,json:{write:!0}})],G.prototype,"ground",void 0),e([f({type:B,json:{write:!0,default:"caption"},nonNullable:!0})],G.prototype,"layout",void 0),e([f({type:N,json:{write:{isRequired:!0}}})],G.prototype,"visibleLayers",null),e([T("visibleLayers")],G.prototype,"castVisibleLayers",null),e([f({type:s.ofType(String),json:{write:!0},clonable:e=>e?new s(e.items):null})],G.prototype,"enabledFocusAreas",void 0),e([f({type:D,json:{write:!0}})],G.prototype,"environment",void 0),e([f(U)],G.prototype,"timeExtent",void 0),e([f({type:R,nonNullable:!0,json:{write:!0}})],G.prototype,"elements",void 0),G=e([_("esri.webscene.Slide")],G);const W=G;function H(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function J(e){const t=H(e);if(t)return t.filter(e=>e.visible).map(e=>e.id)}const z=w(86400),K=w(43200);function Q(e,t){let i=t-e;return i>K&&(i-=z),i<-K&&(i+=z),w(i)}function X(e,t){return w(m(e+t,z))}export{W as default};
@@ -1,3 +1,3 @@
1
- import type { Version as CoreVersion } from "../core/Version.js";
1
+ import type CoreVersion from "../core/Version.js";
2
2
 
3
- export abstract class Version extends CoreVersion {}
3
+ export default abstract class Version extends CoreVersion {}
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{Version as e}from"../core/Version.js";class s extends e{constructor(e,s){super(e,s,"webscene")}get supportsGround(){return this.greaterEqual(1,8)}get supportsVisibleElevationLayersInSlides(){return this.lessThan(1,8)}}export{s as Version};
5
+ import e from"../core/Version.js";class s extends e{constructor(e,s){super(e,s,"webscene")}get supportsGround(){return this.greaterEqual(1,8)}get supportsVisibleElevationLayersInSlides(){return this.lessThan(1,8)}}export{s 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__addDisposableResource as e,__disposeResources as t}from"tslib";import r from"../../Basemap.js";import n from"../../Ground.js";import a from"../../WebScene.js";import"../../core/has.js";import{isLongFormType as s,Null as l,Integer as y}from"../../core/accessorSupport/ensureType.js";import{isCollection as o}from"../../core/accessorSupport/extensions/serializableProperty/type.js";import i from"../../layers/GroupLayer.js";import p from"../../layers/KMLLayer.js";import{typeModuleMap as u}from"../../layers/mixins/operationalLayerModuleMap.js";import{supportedTypes as c}from"../../layers/mixins/operationalLayers.js";import f from"../../layers/support/Sublayer.js";import{JoinTableDataSourceClass as m,DataLayerSource as d}from"../../layers/support/source/DataLayerSource.js";import{MapLayerSource as b}from"../../layers/support/source/MapLayerSource.js";import w from"../InitialViewProperties.js";import{ScanContext as j,sorted as N}from"./utils.js";import{webSceneAnalysisRegistry as g}from"../support/analysisUtils.js";import v from"../support/SlideElements.js";async function T(r){const n={stack:[],error:void 0,hasError:!1};try{const t=e(n,new j,!1);return await P(null,{typeName:"json",type:r},void 0,t)}catch(a){n.error=a,n.hasError=!0}finally{t(n)}}async function q(e,t,r,n){switch(t.typeName){case"array":await R(e,t,r,n);break;case"union":await M(e,t,r,n);break;case"json":await P(e,t,r,n);break;case"native":await h(e,t,r,n);break;case"enum":await k(e,t,r,n)}}async function h(e,t,r,n){const a=r??t;n.addProperty({name:e,type:O(n,t),default:a.default,required:a.isRequired,nullable:a.nullable})}async function k(e,t,r,n){const a=r??t;n.currentClass?.typeValue&&"type"===e?n.addProperty({name:e,type:"string",enum:`"${n.currentClass.typeValue}"`,default:a.default,required:a.isRequired,nullable:a.nullable}):n.addProperty({name:e,type:O(n,t),enum:N(t.values).map(e=>"string"==typeof e?`"${e}"`:`${e}`).join("|"),default:a.default,required:a.isRequired,nullable:a.nullable})}async function R(e,t,r,n){t.elementType.isRequired=t.isRequired,await q(`${e}[]`,t.elementType,r??t.elementType,n)}function S(e,t){if("json"===e.typeName){const t=e.type.__accessorMetadata__,r=t?.type,n=r&&U(r),a=n?.type,s=a||r?.type;if(s&&Array.isArray(s)&&1===s.length&&"string"==typeof s[0])return a?s[0]:D(r,s[0])}return t}async function M(e,t,r,n){const a=[],s=r??t;for(const l of t.types)if("native"!==l.type.typeName&&t.key){const a=`${e}<${S(l.type,l.value)}>`;await q(a,l.type,r??t,n)}else a.push(l.type);if(a.length){const t=N(a.map(e=>O(n,e)));n.addProperty({type:t.join("|"),name:e,default:s.default,required:s.isRequired,nullable:s.nullable})}}async function C(e,t){return e.type===a&&"layers"===t?_("web-scene/operational-layers","operational-layers"):e.type===a&&"tables"===t?_("web-scene/tables","tables"):e.type!==r||"baseLayers"!==t&&"baseMapLayers"!==t?e.type===r&&"groundLayers"===t?_("web-scene/basemap-ground-layers","basemap-ground-layers"):e.type===r&&"elevationLayers"===t||e.type===n&&"layers"===t?_("web-scene/ground","ground"):e.type===i&&"layers"===t?_("web-scene/operational-layers","operational-layers",e=>e!==i):e.type!==v&&e.type!==w||"analyses"!==t?e.type!==m||"leftTableSource"!==t&&"rightTableSource"!==t?null:V({},{key:"type",base:null,typeMap:{"data-layer":d,"map-layer":b}}):{typeName:"array",elementType:{typeName:"union",key:"type",types:await Promise.all(Object.entries(g).map(async([e,t])=>({type:{typeName:"json",type:await t()},value:e})))}}:_("web-scene/basemap-base-layers","basemap-base-layers")}async function L(e,t,r){const n=I(r),a=await C(e,t);return a?(a.isRequired=n.isRequired,a.nullable=n.nullable,a.default=n.default,a):n}async function P(e,t,r,n){const a=t.type.__accessorMetadata__,s=n.getDeclaredClass(t.type);if(!a)return e&&n.addProperty({name:e,type:"unknown"}),null;let l=s,y=null;t.layerContainerType&&(l+=`--${t.layerContainerType}`);const o=e?.match(/<([^>]+)>$/);o&&(l+=`--${o[1]}`,y=o[1]);const i=r??t;t.type===f&&(l+=`--${n.currentClass?.name}`,y=n.currentClass?.name);const p=n.seen.get(l);if(p&&e)return n.addProperty({name:e,type:p,required:i.isRequired,default:i.default,nullable:i.nullable}),p;const u={type:t.type,name:s,id:l,properties:[]};e&&(n.addProperty({name:e,type:u,required:i.isRequired,default:i.default,nullable:i.nullable}),u.typeValue=y),n.push(e,u);for(const c in a){const e=a[c],r=F(e);if(!r?.enabled)continue;if(r.layerContainerTypes&&t.layerContainerType&&!r.layerContainerTypes.includes(t.layerContainerType))continue;if(t.type===f){const e="esri/layers/TileLayer"===n.stack[n.stack.length-2].klass.name;if(e&&f.test.isMapImageLayerOverridePolicy(r.overridePolicy)||!e&&f.test.isTileImageLayerOverridePolicy(r.overridePolicy))continue}const s=r.target;if("string"==typeof s||null==s){const r=await L(t,c,e);if(!r)continue;await q("string"==typeof s?s:c,r,void 0,n)}else await $(t,s,n)}return n.pop()}async function $(e,t,r){for(const n in t){let a=await C(e,n);if(!a){const e=t[n];a=e.types?V({default:e.default,write:e},e.types):J(e.type),a.default=e.default,a.isRequired=e.isRequired,a.nullable=e.allowNull,a=E(a)}await q(n,a,void 0,r)}}async function _(e,t,r){const n={typeName:"union",key:"layerType",types:[]};for(const a in c[e]){if("web-scene/operational-layers"===e&&"ArcGISTiledElevationServiceLayer"===a)continue;const s=await u[a]();s&&(r&&!r(s)||s!==p&&n.types.push({type:{typeName:"json",layerContainerType:t,type:s},value:a}))}if(0===n.types.length)return null;return{typeName:"array",elementType:1===n.types.length?n.types[0].type:n}}function O(e,t){switch(t.typeName){case"array":return`${O(e,t.elementType)}[]`;case"union":return`${N(t.types.map(t=>O(e,t.type))).join(" | ")}`;case"native":switch(t.type){case Number:return"number";case y:return"integer";case String:return"string";case Boolean:return"boolean";case Object:return"object";default:return"unknown"}case"json":return e.getDeclaredClass(t.type);case"enum":return"string"}}function A(e){const t=e.prototype.itemType?.Type;if(!t)return{typeName:"array",elementType:{typeName:"native",type:null}};if("function"==typeof t)return{typeName:"array",elementType:J(t)};if(t.typeMap){const e=[];for(const r in t.typeMap){const n=t.typeMap[r];e.push({type:J(n),value:K(n)?null:r})}return{typeName:"array",elementType:{typeName:"union",key:"string"==typeof t.key?t.key:"type",types:e}}}}function x(e){if("json"!==e.typeName)return null;const t=e.type.__accessorMetadata__,r=t?.type,n=r&&U(r),a=n?.type,s=a||r?.type;return s&&Array.isArray(s)&&"string"==typeof s[0]?a||r.type.map(e=>D(r,e)):null}function E(e){if("array"===e.typeName)return e.elementType=E(e.elementType),e;const t=x(e);return t?{typeName:"union",key:"type",nullable:e.nullable,isRequired:e.isRequired,types:t.map(t=>({value:t,type:e}))}:e}function I(e){const t=U(e);return t?.types?V(t,t.types):!t?.type&&e.types?V(t,e.types):E(G(e))}function V(e,t){if(Array.isArray(t))return{typeName:"array",elementType:V(e,t[0])};const r=[];for(const n in t.typeMap){const e=t.typeMap[n];r.push({type:J(e),value:K(e)?null:n})}return{typeName:"union",key:"string"==typeof t.key?t.key:"type",types:r,nullable:e?.write?.allowNull,isRequired:e?.write?.isRequired,default:e?.default}}function B(e){return null!=e&&e.isJSONMapWriter}function D(e,t){const r=F(e);if(r&&B(r.writer)){const e={value:""};return r.writer?.(t,e,"value"),e.value}return t}function G(e){const t=U(e),r=F(e),n=t?.type,a=J(n||e.type);return void 0!==t?.default&&"function"!=typeof t.default&&(a.default=D(e,t.default)),r?.allowNull&&(a.nullable=!0),r?.isRequired&&(a.isRequired=!0),a}function J(e){if(!e)return{typeName:"native",type:null};if(s(e))return W(e);if(Array.isArray(e)){if("string"==typeof e[0]||"number"==typeof e[0])return{typeName:"enum",values:e};if(e.length>1){const t=[];let r;for(const n of e)n!==l?t.push({type:J(n),value:null}):r=!0;return 1===t.length?{...t[0].type,nullable:r}:{typeName:"union",key:null,types:t,nullable:r}}return{typeName:"array",elementType:J(e[0])}}return o(e)?A(e):K(e)?{typeName:"native",type:e}:z(e)?{typeName:"json",type:e}:{typeName:"native",type:null}}function W(e){switch(e.type){case"native":return{typeName:"native",type:e.value};case"array":return{typeName:"array",elementType:J(e.value)};case"one-of":return{typeName:"union",key:null,types:e.values.map(e=>({type:W(e),value:null}))}}}function z(e){let t=e;for(;t;){if(t.prototype&&("esri.core.JSONSupport"===t.prototype.declaredClass||"esri.core.MultiOriginJSONSupport"===t.prototype.declaredClass))return!0;t=Object.getPrototypeOf(t)}return!1}function K(e){return e===String||e===Boolean||e===Number||e===y||e===Object||e===l}function U(e){if(!e.json)return null;const t=e.json.origins,r=e.json,n=t?.["web-scene"],a=t?.["web-document"];return n||a||r||null}function F(e){if(!e.json)return null;const t=e.json.origins,r=e.json.write,n=t?.["web-scene"]?.write,a=t?.["web-document"]?.write;return n||a||r||null}export{T as scan};
5
+ import{__addDisposableResource as e,__disposeResources as t}from"tslib";import r from"../../Basemap.js";import n from"../../Ground.js";import a from"../../WebScene.js";import"../../core/has.js";import{isLongFormType as s,Null as l,Integer as y}from"../../core/accessorSupport/ensureType.js";import{isCollection as o}from"../../core/accessorSupport/extensions/serializableProperty/type.js";import i from"../../layers/GroupLayer.js";import p from"../../layers/KMLLayer.js";import{typeModuleMap as u}from"../../layers/mixins/operationalLayerModuleMap.js";import{supportedTypes as c}from"../../layers/mixins/operationalLayers.js";import f from"../../layers/support/Sublayer.js";import{JoinTableDataSourceClass as m,DataLayerSource as d}from"../../layers/support/source/DataLayerSource.js";import b from"../../layers/support/source/MapLayerSource.js";import w from"../InitialViewProperties.js";import{ScanContext as j,sorted as N}from"./utils.js";import{webSceneAnalysisRegistry as g}from"../support/analysisUtils.js";import v from"../support/SlideElements.js";async function T(r){const n={stack:[],error:void 0,hasError:!1};try{const t=e(n,new j,!1);return await P(null,{typeName:"json",type:r},void 0,t)}catch(a){n.error=a,n.hasError=!0}finally{t(n)}}async function q(e,t,r,n){switch(t.typeName){case"array":await R(e,t,r,n);break;case"union":await M(e,t,r,n);break;case"json":await P(e,t,r,n);break;case"native":await h(e,t,r,n);break;case"enum":await k(e,t,r,n)}}async function h(e,t,r,n){const a=r??t;n.addProperty({name:e,type:O(n,t),default:a.default,required:a.isRequired,nullable:a.nullable})}async function k(e,t,r,n){const a=r??t;n.currentClass?.typeValue&&"type"===e?n.addProperty({name:e,type:"string",enum:`"${n.currentClass.typeValue}"`,default:a.default,required:a.isRequired,nullable:a.nullable}):n.addProperty({name:e,type:O(n,t),enum:N(t.values).map(e=>"string"==typeof e?`"${e}"`:`${e}`).join("|"),default:a.default,required:a.isRequired,nullable:a.nullable})}async function R(e,t,r,n){t.elementType.isRequired=t.isRequired,await q(`${e}[]`,t.elementType,r??t.elementType,n)}function S(e,t){if("json"===e.typeName){const t=e.type.__accessorMetadata__,r=t?.type,n=r&&U(r),a=n?.type,s=a||r?.type;if(s&&Array.isArray(s)&&1===s.length&&"string"==typeof s[0])return a?s[0]:D(r,s[0])}return t}async function M(e,t,r,n){const a=[],s=r??t;for(const l of t.types)if("native"!==l.type.typeName&&t.key){const a=`${e}<${S(l.type,l.value)}>`;await q(a,l.type,r??t,n)}else a.push(l.type);if(a.length){const t=N(a.map(e=>O(n,e)));n.addProperty({type:t.join("|"),name:e,default:s.default,required:s.isRequired,nullable:s.nullable})}}async function C(e,t){return e.type===a&&"layers"===t?_("web-scene/operational-layers","operational-layers"):e.type===a&&"tables"===t?_("web-scene/tables","tables"):e.type!==r||"baseLayers"!==t&&"baseMapLayers"!==t?e.type===r&&"groundLayers"===t?_("web-scene/basemap-ground-layers","basemap-ground-layers"):e.type===r&&"elevationLayers"===t||e.type===n&&"layers"===t?_("web-scene/ground","ground"):e.type===i&&"layers"===t?_("web-scene/operational-layers","operational-layers",e=>e!==i):e.type!==v&&e.type!==w||"analyses"!==t?e.type!==m||"leftTableSource"!==t&&"rightTableSource"!==t?null:V({},{key:"type",base:null,typeMap:{"data-layer":d,"map-layer":b}}):{typeName:"array",elementType:{typeName:"union",key:"type",types:await Promise.all(Object.entries(g).map(async([e,t])=>({type:{typeName:"json",type:await t()},value:e})))}}:_("web-scene/basemap-base-layers","basemap-base-layers")}async function L(e,t,r){const n=I(r),a=await C(e,t);return a?(a.isRequired=n.isRequired,a.nullable=n.nullable,a.default=n.default,a):n}async function P(e,t,r,n){const a=t.type.__accessorMetadata__,s=n.getDeclaredClass(t.type);if(!a)return e&&n.addProperty({name:e,type:"unknown"}),null;let l=s,y=null;t.layerContainerType&&(l+=`--${t.layerContainerType}`);const o=e?.match(/<([^>]+)>$/);o&&(l+=`--${o[1]}`,y=o[1]);const i=r??t;t.type===f&&(l+=`--${n.currentClass?.name}`,y=n.currentClass?.name);const p=n.seen.get(l);if(p&&e)return n.addProperty({name:e,type:p,required:i.isRequired,default:i.default,nullable:i.nullable}),p;const u={type:t.type,name:s,id:l,properties:[]};e&&(n.addProperty({name:e,type:u,required:i.isRequired,default:i.default,nullable:i.nullable}),u.typeValue=y),n.push(e,u);for(const c in a){const e=a[c],r=F(e);if(!r?.enabled)continue;if(r.layerContainerTypes&&t.layerContainerType&&!r.layerContainerTypes.includes(t.layerContainerType))continue;if(t.type===f){const e="esri/layers/TileLayer"===n.stack[n.stack.length-2].klass.name;if(e&&f.test.isMapImageLayerOverridePolicy(r.overridePolicy)||!e&&f.test.isTileImageLayerOverridePolicy(r.overridePolicy))continue}const s=r.target;if("string"==typeof s||null==s){const r=await L(t,c,e);if(!r)continue;await q("string"==typeof s?s:c,r,void 0,n)}else await $(t,s,n)}return n.pop()}async function $(e,t,r){for(const n in t){let a=await C(e,n);if(!a){const e=t[n];a=e.types?V({default:e.default,write:e},e.types):J(e.type),a.default=e.default,a.isRequired=e.isRequired,a.nullable=e.allowNull,a=E(a)}await q(n,a,void 0,r)}}async function _(e,t,r){const n={typeName:"union",key:"layerType",types:[]};for(const a in c[e]){if("web-scene/operational-layers"===e&&"ArcGISTiledElevationServiceLayer"===a)continue;const s=await u[a]();s&&(r&&!r(s)||s!==p&&n.types.push({type:{typeName:"json",layerContainerType:t,type:s},value:a}))}if(0===n.types.length)return null;return{typeName:"array",elementType:1===n.types.length?n.types[0].type:n}}function O(e,t){switch(t.typeName){case"array":return`${O(e,t.elementType)}[]`;case"union":return`${N(t.types.map(t=>O(e,t.type))).join(" | ")}`;case"native":switch(t.type){case Number:return"number";case y:return"integer";case String:return"string";case Boolean:return"boolean";case Object:return"object";default:return"unknown"}case"json":return e.getDeclaredClass(t.type);case"enum":return"string"}}function A(e){const t=e.prototype.itemType?.Type;if(!t)return{typeName:"array",elementType:{typeName:"native",type:null}};if("function"==typeof t)return{typeName:"array",elementType:J(t)};if(t.typeMap){const e=[];for(const r in t.typeMap){const n=t.typeMap[r];e.push({type:J(n),value:K(n)?null:r})}return{typeName:"array",elementType:{typeName:"union",key:"string"==typeof t.key?t.key:"type",types:e}}}}function x(e){if("json"!==e.typeName)return null;const t=e.type.__accessorMetadata__,r=t?.type,n=r&&U(r),a=n?.type,s=a||r?.type;return s&&Array.isArray(s)&&"string"==typeof s[0]?a||r.type.map(e=>D(r,e)):null}function E(e){if("array"===e.typeName)return e.elementType=E(e.elementType),e;const t=x(e);return t?{typeName:"union",key:"type",nullable:e.nullable,isRequired:e.isRequired,types:t.map(t=>({value:t,type:e}))}:e}function I(e){const t=U(e);return t?.types?V(t,t.types):!t?.type&&e.types?V(t,e.types):E(G(e))}function V(e,t){if(Array.isArray(t))return{typeName:"array",elementType:V(e,t[0])};const r=[];for(const n in t.typeMap){const e=t.typeMap[n];r.push({type:J(e),value:K(e)?null:n})}return{typeName:"union",key:"string"==typeof t.key?t.key:"type",types:r,nullable:e?.write?.allowNull,isRequired:e?.write?.isRequired,default:e?.default}}function B(e){return null!=e&&e.isJSONMapWriter}function D(e,t){const r=F(e);if(r&&B(r.writer)){const e={value:""};return r.writer?.(t,e,"value"),e.value}return t}function G(e){const t=U(e),r=F(e),n=t?.type,a=J(n||e.type);return void 0!==t?.default&&"function"!=typeof t.default&&(a.default=D(e,t.default)),r?.allowNull&&(a.nullable=!0),r?.isRequired&&(a.isRequired=!0),a}function J(e){if(!e)return{typeName:"native",type:null};if(s(e))return W(e);if(Array.isArray(e)){if("string"==typeof e[0]||"number"==typeof e[0])return{typeName:"enum",values:e};if(e.length>1){const t=[];let r;for(const n of e)n!==l?t.push({type:J(n),value:null}):r=!0;return 1===t.length?{...t[0].type,nullable:r}:{typeName:"union",key:null,types:t,nullable:r}}return{typeName:"array",elementType:J(e[0])}}return o(e)?A(e):K(e)?{typeName:"native",type:e}:z(e)?{typeName:"json",type:e}:{typeName:"native",type:null}}function W(e){switch(e.type){case"native":return{typeName:"native",type:e.value};case"array":return{typeName:"array",elementType:J(e.value)};case"one-of":return{typeName:"union",key:null,types:e.values.map(e=>({type:W(e),value:null}))}}}function z(e){let t=e;for(;t;){if(t.prototype&&("esri.core.JSONSupport"===t.prototype.declaredClass||"esri.core.MultiOriginJSONSupport"===t.prototype.declaredClass))return!0;t=Object.getPrototypeOf(t)}return!1}function K(e){return e===String||e===Boolean||e===Number||e===y||e===Object||e===l}function U(e){if(!e.json)return null;const t=e.json.origins,r=e.json,n=t?.["web-scene"],a=t?.["web-document"];return n||a||r||null}function F(e){if(!e.json)return null;const t=e.json.origins,r=e.json.write,n=t?.["web-scene"]?.write,a=t?.["web-document"]?.write;return n||a||r||null}export{T as scan};
@@ -13,7 +13,7 @@ export interface SlideEnvironmentProperties extends JSONSupportMixinProperties,
13
13
  lighting?: (SunLightingProperties & { type?: "sun" }) | (VirtualLightingProperties & { type: "virtual" });
14
14
  }
15
15
 
16
- export abstract class SlideEnvironment extends SlideEnvironmentSuperclass {
16
+ export default abstract class SlideEnvironment extends SlideEnvironmentSuperclass {
17
17
  /**
18
18
  * Settings
19
19
  * for defining the lighting of the scene.
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{ClonableMixin as r}from"../../core/Clonable.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as t,subclass as i}from"../../core/accessorSupport/decorators.js";import s from"../../views/3d/environment/SunnyWeather.js";import{weatherTypes as n}from"../../views/3d/environment/weather.js";import{lightingTypes as p}from"../lightingTypes.js";import m from"../SunLighting.js";let l=class extends(r(o)){constructor(){super(...arguments),this.lighting=new m,this.weather=new s}};e([t({types:{...p,defaultKeyValue:"sun"},json:{write:!0}})],l.prototype,"lighting",void 0),e([t({types:n,json:{write:!0}})],l.prototype,"weather",void 0),l=e([i("esri.webscene.support.SlideEnvironment")],l);export{l as SlideEnvironment};
5
+ import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../../core/Clonable.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as r,subclass as s}from"../../core/accessorSupport/decorators.js";import i from"../../views/3d/environment/SunnyWeather.js";import{weatherTypes as n}from"../../views/3d/environment/weather.js";import{lightingTypes as p}from"../lightingTypes.js";import m from"../SunLighting.js";let a=class extends(t(o)){constructor(){super(...arguments),this.lighting=new m,this.weather=new i}};e([r({types:{...p,defaultKeyValue:"sun"},json:{write:!0}})],a.prototype,"lighting",void 0),e([r({types:n,json:{write:!0}})],a.prototype,"weather",void 0),a=e([s("esri.webscene.support.SlideEnvironment")],a);const l=a;export{l as default};
@@ -3,7 +3,7 @@ import type { JSONSupport, JSONSupportMixinProperties } from "../../core/JSONSup
3
3
 
4
4
  export interface SlideVisibleLayerProperties extends JSONSupportMixinProperties, ClonableMixinProperties, Partial<Pick<SlideVisibleLayer, "id" | "sublayerIds">> {}
5
5
 
6
- export abstract class SlideVisibleLayer extends SlideVisibleLayerSuperclass {
6
+ export default abstract class SlideVisibleLayer extends SlideVisibleLayerSuperclass {
7
7
  /**
8
8
  * The ID of a [Layer#id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id)
9
9
  * in the [WebScene#layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) or [Ground#layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers)
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import{ClonableMixin as o}from"../../core/Clonable.js";import{JSONSupport as e}from"../../core/JSONSupport.js";import{property as s,subclass as t}from"../../core/accessorSupport/decorators.js";import{Integer as p}from"../../core/accessorSupport/ensureType.js";let i=class extends(o(e)){constructor(r){super(r),this.id="",this.sublayerIds=null}};r([s({type:String,json:{write:!0}})],i.prototype,"id",void 0),r([s({type:[p],json:{name:"subLayerIds",write:!0}})],i.prototype,"sublayerIds",void 0),i=r([t("esri.webscene.support.SlideVisibleLayer")],i);export{i as SlideVisibleLayer};
5
+ import{__decorate as r}from"tslib";import{ClonableMixin as o}from"../../core/Clonable.js";import{JSONSupport as e}from"../../core/JSONSupport.js";import{property as s,subclass as t}from"../../core/accessorSupport/decorators.js";import{Integer as p}from"../../core/accessorSupport/ensureType.js";let i=class extends(o(e)){constructor(r){super(r),this.id="",this.sublayerIds=null}};r([s({type:String,json:{write:!0}})],i.prototype,"id",void 0),r([s({type:[p],json:{name:"subLayerIds",write:!0}})],i.prototype,"sublayerIds",void 0),i=r([t("esri.webscene.support.SlideVisibleLayer")],i);const c=i;export{c as default};