@arcgis/core 4.33.0-next.20250209 → 4.33.0-next.20250211

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 (279) hide show
  1. package/AttributeBinsGraphic.js +1 -1
  2. package/Graphic.js +1 -1
  3. package/Ground.js +1 -1
  4. package/WebMap.js +1 -1
  5. package/WebScene.js +1 -1
  6. package/arcade/ArcadeModuleResolver.js +1 -1
  7. package/arcade/featureset/actions/Adapted.js +1 -1
  8. package/arcade/featureset/support/FeatureSet.js +1 -1
  9. package/arcade/featureset/support/Guid.js +1 -1
  10. package/arcade/featureset/support/cache.js +1 -1
  11. package/assets/esri/core/workers/RemoteClient.js +1 -1
  12. package/assets/esri/core/workers/chunks/{d31f7598629f7cc50233.js → 004853abf357f865b4fa.js} +1 -1
  13. package/assets/esri/core/workers/chunks/00e374e3b4781c4f9a3e.js +1 -0
  14. package/assets/esri/core/workers/chunks/{746c964cf07e4306f21f.js → 03f51ea011ffbcfb7c7d.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{ad3e692681b50bd1acc2.js → 03fac4c79641603d8cba.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{0167cf867d8e46c818b0.js → 09260bbe1fd6ce5a53e6.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{d1718ad93e3271b0525e.js → 0e4350fda5328862f2fb.js} +1 -1
  18. package/assets/esri/core/workers/chunks/12199e8abf377ffc27cd.js +1 -0
  19. package/assets/esri/core/workers/chunks/1a286d43daa3b811c30d.js +1 -0
  20. package/assets/esri/core/workers/chunks/{e5e3b6d00d27b5bb354f.js → 1d282700e76285a1684c.js} +1 -1
  21. package/assets/esri/core/workers/chunks/2130e0c8d2410c87f880.js +1 -0
  22. package/assets/esri/core/workers/chunks/2530e5d1f438db8a7b5c.js +1 -0
  23. package/assets/esri/core/workers/chunks/{dfaf1da323906ee60549.js → 2876419a32537e24b7da.js} +1 -1
  24. package/assets/esri/core/workers/chunks/2b733e8043659466e194.js +1 -0
  25. package/assets/esri/core/workers/chunks/311c85bd94d5fb28e272.js +1 -0
  26. package/assets/esri/core/workers/chunks/33c6fd524711efd8ef13.js +1 -0
  27. package/assets/esri/core/workers/chunks/{594d923400fd74881833.js → 35392bf8f21005ad6170.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{de1f3c4b8000c2d73013.js → 39dca492cc5f089e1609.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{5b85f9da022742f602e2.js → 3c8e5b5fb52611e30ed6.js} +1 -1
  30. package/assets/esri/core/workers/chunks/491effb2c681493cc3a6.js +1 -0
  31. package/assets/esri/core/workers/chunks/{e93dea6b112ce8e2779b.js → 4b47549614d53ce1e384.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{369a2b8484a8807bde38.js → 4be5e453fe54f5631659.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{2971266a49226e769360.js → 5e5045add6567588b90a.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{5721557a1d8eab23a55b.js → 5eceedac9b2b4d1ef133.js} +1 -1
  35. package/assets/esri/core/workers/chunks/6a9a1cd8134a903dd05a.js +1 -0
  36. package/assets/esri/core/workers/chunks/6c9bb00f33649ab59dab.js +314 -0
  37. package/assets/esri/core/workers/chunks/7485588bd24217669578.js +1 -0
  38. package/assets/esri/core/workers/chunks/74e0116ae84def626c87.js +1 -0
  39. package/assets/esri/core/workers/chunks/{c4374b6bc5c8dc6435c7.js → 7c81e08fc8a67dcd9dad.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{433576983754f690bcc7.js → 7e3b374f906441cd7fb0.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{8c32cee395da0a7b9a8e.js → 80d3aa3f27ad5b2b969b.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{de4384b5833a60e88e31.js → 84c1c3336011a1b79669.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{9d61590c4d21c7421925.js → 88a34690480d3658bad8.js} +1 -1
  44. package/assets/esri/core/workers/chunks/8939479cd433cc53f6c1.js +1 -0
  45. package/assets/esri/core/workers/chunks/{28dd172faa85080511c5.js → 8a2f3ce46eeac853b3a9.js} +1 -1
  46. package/assets/esri/core/workers/chunks/8b6580329e1e35ea4190.js +1 -0
  47. package/assets/esri/core/workers/chunks/8bfeef7cffe1e65c9dab.js +1 -0
  48. package/assets/esri/core/workers/chunks/{b44cf0e4c2f93408cabc.js → 9205115bdb5bc03d0c02.js} +1 -1
  49. package/assets/esri/core/workers/chunks/92d76d59113b4139befe.js +1 -0
  50. package/assets/esri/core/workers/chunks/9421ae38fdf986b9b107.js +1 -0
  51. package/assets/esri/core/workers/chunks/99c136b800e5fc7e04f4.js +1 -0
  52. package/assets/esri/core/workers/chunks/{d339dee99c4820b63f39.js → 9b74635d80d029498da1.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{c2336d1f5b2b7bf6e7a7.js → 9bd6a4bf8150a6f618ea.js} +1 -1
  54. package/assets/esri/core/workers/chunks/9e7895e8201127ffe0a8.js +1 -0
  55. package/assets/esri/core/workers/chunks/{15e08e8a8a72b177d74c.js → a38cb1fff519bad8abe3.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{7b367bb0ed9c218ca595.js → a52690a27f8732739c02.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{cdd8983cf3a301805680.js → a52c282609a7e9c8ca9e.js} +1 -1
  58. package/assets/esri/core/workers/chunks/a56b3dffd9f38973f350.js +1 -0
  59. package/assets/esri/core/workers/chunks/a9274c9132e7a2691abb.js +1 -0
  60. package/assets/esri/core/workers/chunks/b253cf42e53f957b4b4e.js +1 -0
  61. package/assets/esri/core/workers/chunks/b50176897ffadc53573e.js +1 -0
  62. package/assets/esri/core/workers/chunks/{c26ffbff1115e76bcb0f.js → baee20c14763bef80b09.js} +1 -1
  63. package/assets/esri/core/workers/chunks/c3dc355d0f8d89b9b7b8.js +1 -0
  64. package/assets/esri/core/workers/chunks/c77ade444aa2f3f2b599.js +1 -0
  65. package/assets/esri/core/workers/chunks/c7927c2d5414f19defd5.js +1 -0
  66. package/assets/esri/core/workers/chunks/ca6180e572e69540c183.js +1 -0
  67. package/assets/esri/core/workers/chunks/{16f82e9d98371431b46d.js → cc085918c63da416e59d.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{8e90c5fee4ad7c7275dc.js → cccd215b0a4890551957.js} +1 -1
  69. package/assets/esri/core/workers/chunks/ce88224af357957dd83a.js +1 -0
  70. package/assets/esri/core/workers/chunks/{07c5f3fc475c57f5a7a7.js → cf00df122df3db3b0c23.js} +1 -1
  71. package/assets/esri/core/workers/chunks/d074c916b414432a7b6a.js +1 -0
  72. package/assets/esri/core/workers/chunks/d342c56558f164e9e786.js +1 -0
  73. package/assets/esri/core/workers/chunks/{3c591f76e7d6204b7780.js → d3f7ff03ab5b40062d89.js} +1 -1
  74. package/assets/esri/core/workers/chunks/e03e237e7e6ffc8b7f0d.js +1 -0
  75. package/assets/esri/core/workers/chunks/{0b62871b89dcb4c70457.js → e21941260bae30061c2c.js} +1 -1
  76. package/assets/esri/core/workers/chunks/e6633f0326a44477f630.js +1 -0
  77. package/assets/esri/core/workers/chunks/e71b780d1e6a32f303b7.js +1 -0
  78. package/assets/esri/core/workers/chunks/eac28b0f6fccfabcc3ca.js +1 -0
  79. package/assets/esri/core/workers/chunks/{01c3507d78398baaf61b.js → eb0ce7937813d1be1284.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{f198f4ba7d3d52882d98.js → efded84870064c3d8210.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{c8a0089e080140db9076.js → f285ed5425b31123d2bc.js} +1 -1
  82. package/assets/esri/core/workers/chunks/f4ba823c8acd60c7c82d.js +1 -0
  83. package/core/Accessor.js +1 -1
  84. package/core/Collection.js +1 -1
  85. package/core/Logger.js +1 -1
  86. package/core/ObjectPool.js +1 -1
  87. package/core/RandomLCG.js +1 -1
  88. package/core/XHRAdapter.js +1 -1
  89. package/core/accessorSupport/watch.js +1 -1
  90. package/core/pbf.js +1 -1
  91. package/core/sql/UnknownTimeZone.js +1 -1
  92. package/core/workers/RemoteClient.js +1 -1
  93. package/geometry/SpatialReference.js +1 -1
  94. package/geometry/support/MeshGeoreferencedVertexSpace.js +1 -1
  95. package/geometry/support/MeshTexture.js +1 -1
  96. package/geometry/support/MeshTransform.js +1 -1
  97. package/geometry/support/buffer/BufferPool.js +1 -1
  98. package/geometry/support/buffer/BufferView.js +1 -1
  99. package/geometry/support/buffer/internals/Mat3.js +1 -1
  100. package/geometry/support/buffer/internals/Mat4.js +1 -1
  101. package/geometry/support/buffer/internals/Scalar.js +1 -1
  102. package/geometry/support/buffer/internals/Vec2.js +1 -1
  103. package/geometry/support/buffer/internals/Vec3.js +1 -1
  104. package/geometry/support/buffer/internals/Vec4.js +1 -1
  105. package/geometry/support/meshUtils/exporters/gltf/glb.js +1 -1
  106. package/identity/OAuthInfo.js +1 -1
  107. package/interfaces.d.ts +7 -1
  108. package/layers/mixins/EditBusLayer.js +1 -1
  109. package/layers/mixins/PublishableLayer.js +1 -1
  110. package/layers/support/AggregateField.js +1 -1
  111. package/layers/support/CodedValueDomain.js +1 -1
  112. package/layers/support/Field.js +1 -1
  113. package/layers/support/ImageElement.js +1 -1
  114. package/layers/support/InheritedDomain.js +1 -1
  115. package/layers/support/LOD.js +1 -1
  116. package/layers/support/LabelClass.js +1 -1
  117. package/layers/support/LabelExpressionInfo.js +1 -1
  118. package/layers/support/OrderByInfo.js +1 -1
  119. package/layers/support/PurgeOptions.js +1 -1
  120. package/layers/support/RangeDomain.js +1 -1
  121. package/layers/support/Sublayer.js +1 -1
  122. package/layers/support/TileInfo.js +1 -1
  123. package/layers/support/TilemapCache.js +1 -1
  124. package/layers/support/VideoElement.js +1 -1
  125. package/layers/support/source/DataLayerSource.js +1 -1
  126. package/package.json +1 -1
  127. package/portal/Portal.js +1 -1
  128. package/rest/support/AttachmentQuery.js +1 -1
  129. package/rest/support/ClosestFacilityParameters.js +1 -1
  130. package/rest/support/DirectionLine.js +1 -1
  131. package/rest/support/DirectionPoint.js +1 -1
  132. package/rest/support/JobInfo.js +1 -1
  133. package/rest/support/NetworkFeatureSet.js +1 -1
  134. package/rest/support/PointBarrier.js +1 -1
  135. package/rest/support/PolygonBarrier.js +1 -1
  136. package/rest/support/PolylineBarrier.js +1 -1
  137. package/rest/support/Query.js +1 -1
  138. package/rest/support/RelationshipQuery.js +1 -1
  139. package/rest/support/RouteInfo.js +1 -1
  140. package/rest/support/RouteParameters.js +1 -1
  141. package/rest/support/ServiceAreaParameters.js +1 -1
  142. package/rest/support/Stop.js +1 -1
  143. package/rest/support/TopFeaturesQuery.js +1 -1
  144. package/support/revision.js +1 -1
  145. package/symbols/ExtrudeSymbol3DLayer.js +1 -1
  146. package/symbols/FillSymbol3DLayer.js +1 -1
  147. package/symbols/IconSymbol3DLayer.js +1 -1
  148. package/symbols/LineSymbol3DLayer.js +1 -1
  149. package/symbols/ObjectSymbol3DLayer.js +1 -1
  150. package/symbols/PathSymbol3DLayer.js +1 -1
  151. package/symbols/TextSymbol3DLayer.js +1 -1
  152. package/symbols/WaterSymbol3DLayer.js +1 -1
  153. package/symbols/cim/OverrideHelper.js +1 -1
  154. package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
  155. package/symbols/cim/effects/EffectArrow.js +1 -1
  156. package/symbols/cim/effects/EffectBuffer.js +1 -1
  157. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  158. package/symbols/cim/effects/EffectCut.js +1 -1
  159. package/symbols/cim/effects/EffectDashes.js +1 -1
  160. package/symbols/cim/effects/EffectDonut.js +1 -1
  161. package/symbols/cim/effects/EffectJog.js +1 -1
  162. package/symbols/cim/effects/EffectMove.js +1 -1
  163. package/symbols/cim/effects/EffectOffset.js +1 -1
  164. package/symbols/cim/effects/EffectReverse.js +1 -1
  165. package/symbols/cim/effects/EffectRotate.js +1 -1
  166. package/symbols/cim/effects/EffectScale.js +1 -1
  167. package/symbols/cim/effects/EffectWave.js +1 -1
  168. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  169. package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
  170. package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
  171. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  172. package/symbols/cim/placements/PlacementOnLine.js +1 -1
  173. package/symbols/cim/placements/PlacementOnVertices.js +1 -1
  174. package/symbols/cim/placements/PlacementPolygonCenter.js +1 -1
  175. package/symbols/support/ElevationInfo.js +1 -1
  176. package/time/TimeExtent.js +1 -1
  177. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  178. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  179. package/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js +1 -1
  180. package/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js +1 -1
  181. package/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js +1 -1
  182. package/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js +1 -1
  183. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  184. package/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js +1 -1
  185. package/views/2d/engine/vectorTiles/style/StyleDefinition.js +1 -1
  186. package/views/2d/engine/webgl/DisplayEntity.js +1 -1
  187. package/views/2d/engine/webgl/DisplayRecord.js +1 -1
  188. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  189. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode.js +1 -1
  190. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  191. package/views/2d/layers/features/FeatureStoreQueryAdapter.js +1 -1
  192. package/views/2d/tiling/TileCoverage.js +1 -1
  193. package/views/2d/tiling/TileKey.js +1 -1
  194. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  195. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  196. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  197. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  198. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  199. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  200. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  201. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  202. package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
  203. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  204. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  205. package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
  206. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandEncoder.js +1 -1
  207. package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
  208. package/views/3d/state/Frustum.js +1 -1
  209. package/views/3d/support/DisplayQualityProfile.js +1 -1
  210. package/views/3d/terrain/TerrainSurface.js +1 -1
  211. package/views/3d/terrain/TextureFader.js +1 -1
  212. package/views/3d/terrain/TilingScheme.js +1 -1
  213. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  214. package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
  215. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  216. package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
  217. package/views/SceneView.js +1 -1
  218. package/views/View.js +1 -1
  219. package/views/View2D.js +1 -1
  220. package/views/draw/DrawAction.js +1 -1
  221. package/views/draw/drawSurfaces.js +1 -1
  222. package/views/input/BrowserEventSource.js +1 -1
  223. package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
  224. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  225. package/views/support/imageReprojection.js +1 -1
  226. package/views/webgl/FramebufferObject.js +1 -1
  227. package/views/webgl/ShaderBuilder.js +1 -1
  228. package/views/webgl/Texture.js +1 -1
  229. package/webscene/Environment.js +1 -1
  230. package/webscene/SunLighting.js +1 -1
  231. package/webscene/VirtualLighting.js +1 -1
  232. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  233. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  234. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  235. package/widgets/Feature/FeatureViewModel.js +1 -1
  236. package/widgets/LayerList/LayerListItem.js +1 -1
  237. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  238. package/widgets/ScaleRangeSlider/ScaleRanges.js +1 -1
  239. package/widgets/Search/SearchViewModel.js +1 -1
  240. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  241. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  242. package/widgets/Widget.js +1 -1
  243. package/widgets/support/forms/expressions/FormExpressionArcadeExecutor.js +1 -1
  244. package/assets/esri/core/workers/chunks/00e0c53d89e074399f04.js +0 -1
  245. package/assets/esri/core/workers/chunks/12d6baeffd55a98a7c75.js +0 -1
  246. package/assets/esri/core/workers/chunks/207c040b0e42358a5389.js +0 -1
  247. package/assets/esri/core/workers/chunks/21c12edc0632eb911e73.js +0 -1
  248. package/assets/esri/core/workers/chunks/24c94f97a76646d415ae.js +0 -1
  249. package/assets/esri/core/workers/chunks/2611adb4f328f95ee508.js +0 -1
  250. package/assets/esri/core/workers/chunks/26a2bd432e7a1b3870c3.js +0 -1
  251. package/assets/esri/core/workers/chunks/2def7db73a776e759dae.js +0 -1
  252. package/assets/esri/core/workers/chunks/2ff63a71213f618377d6.js +0 -1
  253. package/assets/esri/core/workers/chunks/44abd2cd17aae3299ede.js +0 -1
  254. package/assets/esri/core/workers/chunks/4b56c0c109e10d7409b8.js +0 -1
  255. package/assets/esri/core/workers/chunks/5660f13d78e9e4240034.js +0 -1
  256. package/assets/esri/core/workers/chunks/568bcf809fcfd4d9c713.js +0 -1
  257. package/assets/esri/core/workers/chunks/5e889a675cbaff03ad5a.js +0 -1
  258. package/assets/esri/core/workers/chunks/61795bde00f2e16d04f1.js +0 -1
  259. package/assets/esri/core/workers/chunks/62a1d60ad4bf6469c4dd.js +0 -1
  260. package/assets/esri/core/workers/chunks/6ea02ff25f051c08e6c3.js +0 -1
  261. package/assets/esri/core/workers/chunks/7bf08823f861628144a1.js +0 -1
  262. package/assets/esri/core/workers/chunks/86149b4a5a148744c7d1.js +0 -1
  263. package/assets/esri/core/workers/chunks/9b2fab133786e5d47631.js +0 -1
  264. package/assets/esri/core/workers/chunks/9bfb091cec7eed6c8111.js +0 -1
  265. package/assets/esri/core/workers/chunks/a2409d4921c02614169a.js +0 -1
  266. package/assets/esri/core/workers/chunks/b1baf39daf5725404be5.js +0 -1
  267. package/assets/esri/core/workers/chunks/b43d88b6e7dc4ab13599.js +0 -1
  268. package/assets/esri/core/workers/chunks/b9d9a1dc3c5d799e2685.js +0 -1
  269. package/assets/esri/core/workers/chunks/c1970657a287ec96001e.js +0 -1
  270. package/assets/esri/core/workers/chunks/cc75bbfd779f409943a3.js +0 -1
  271. package/assets/esri/core/workers/chunks/d35efcbe439500bf18bc.js +0 -1
  272. package/assets/esri/core/workers/chunks/d599ba865da87b487b1b.js +0 -1
  273. package/assets/esri/core/workers/chunks/da1157e288dbc6ba842a.js +0 -1
  274. package/assets/esri/core/workers/chunks/ddc30044f61a2c2df3fe.js +0 -1
  275. package/assets/esri/core/workers/chunks/e37e5d2e233d7f6ccd52.js +0 -314
  276. package/assets/esri/core/workers/chunks/f14b318bab5efcf43419.js +0 -1
  277. package/assets/esri/core/workers/chunks/f29715459ecd46180829.js +0 -1
  278. package/assets/esri/core/workers/chunks/f4e48bbdbc9da10ec71a.js +0 -1
  279. package/assets/esri/core/workers/chunks/f62f657f9fef28f492e0.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../Color.js";import{toLCH as e,toRGB as r,toLAB as s}from"../../../../../core/colorUtils.js";import{GeometryType as n}from"../../../../../geometry/support/TileClipper.js";import{unitBezier as a}from"../../../unitBezier.js";import{interpolate as o}from"../GeometryUtils.js";import{valueType as i,stringType as l,objectType as u,numberType as c,booleanType as h,colorType as p,typeToString as g,arrayType as f,getType as w,matchType as m,valueToString as y}from"./types.js";class _{constructor(t){this._parent=t,this._vars={}}add(t,e){this._vars[t]=e}get(t){return this._vars[t]?this._vars[t]:this._parent?this._parent.get(t):null}}class v{constructor(){this.type=i}static parse(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new v}evaluate(t,e){return t?.id}}class b{constructor(){this.type=l}static parse(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new b}evaluate(t,e){if(!t)return null;switch(t.type){case n.Point:return"Point";case n.LineString:return"LineString";case n.Polygon:return"Polygon";default:return null}}}class d{constructor(){this.type=u}static parse(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new d}evaluate(t,e){return t?.values}}class x{constructor(){this.type=c}static parse(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new x}evaluate(t,e){return e}}class E{constructor(t,e,r){this._lhs=t,this._rhs=e,this._compare=r,this.type=h}static parse(t,e,r){if(3!==t.length&&4!==t.length)throw new Error(`"${t[0]}" expects 2 or 3 arguments`);if(4===t.length)throw new Error(`"${t[0]}" collator not supported`);return new E(pt(t[1],e),pt(t[2],e),r)}evaluate(t,e){return this._compare(this._lhs.evaluate(t,e),this._rhs.evaluate(t,e))}}class $ extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t===e))}}class M extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t!==e))}}class k extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t<e))}}class A extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t<=e))}}class j extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t>e))}}class q extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t>=e))}}class N{constructor(t){this._arg=t,this.type=h}static parse(t,e){if(2!==t.length)throw new Error('"!" expects 1 argument');return new N(pt(t[1],e))}evaluate(t,e){return!this._arg.evaluate(t,e)}}class C{constructor(t){this._args=t,this.type=h}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new C(r)}evaluate(t,e){for(const r of this._args)if(!r.evaluate(t,e))return!1;return!0}}class R{constructor(t){this._args=t,this.type=h}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new R(r)}evaluate(t,e){for(const r of this._args)if(r.evaluate(t,e))return!0;return!1}}class z{constructor(t){this._args=t,this.type=h}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new z(r)}evaluate(t,e){for(const r of this._args)if(r.evaluate(t,e))return!1;return!0}}class I{constructor(t,e,r){this.type=t,this._args=e,this._fallback=r}static parse(t,e,r){if(t.length<4)throw new Error('"case" expects at least 3 arguments');if(t.length%2==1)throw new Error('"case" expects an odd number of arguments');let s;const n=[];for(let o=1;o<t.length-1;o+=2){const a=pt(t[o],e),i=pt(t[o+1],e,r);s||(s=i.type),n.push({condition:a,output:i})}const a=pt(t[t.length-1],e,r);return s||(s=a.type),new I(s,n,a)}evaluate(t,e){for(const r of this._args)if(r.condition.evaluate(t,e))return r.output.evaluate(t,e);return this._fallback.evaluate(t,e)}}class L{constructor(t,e){this.type=t,this._args=e}static parse(t,e){if(t.length<2)throw new Error('"coalesce" expects at least 1 argument');let r;const s=[];for(let n=1;n<t.length;n++){const a=pt(t[n],e);r||(r=a.type),s.push(a)}return new L(r,s)}evaluate(t,e){for(const r of this._args){const s=r.evaluate(t,e);if(null!==s)return s}return null}}class U{constructor(t,e,r,s,n){this.type=t,this._input=e,this._labels=r,this._outputs=s,this._fallback=n}static parse(t,e){if(t.length<3)throw new Error('"match" expects at least 3 arguments');if(t.length%2==0)throw new Error('"case" expects an even number of arguments');let r;const s=pt(t[1],e),n=[],a={};let o;for(let i=2;i<t.length-1;i+=2){let s=t[i];Array.isArray(s)||(s=[s]);for(const t of s){const e=typeof t;if("string"!==e&&"number"!==e)throw new Error('"match" requires string or number literal as labels');if(o){if(e!==o)throw new Error('"match" requires labels to have the same type')}else o=e;a[t]=n.length}const l=pt(t[i+1],e);r||(r=l.type),n.push(l)}return new U(r,s,a,n,pt(t[t.length-1],e))}evaluate(t,e){const r=this._input.evaluate(t,e);return(this._outputs[this._labels[r]]||this._fallback).evaluate(t,e)}}class P{constructor(t,e,r,s,n){this._operator=t,this.type=e,this.interpolation=r,this.input=s,this._stops=n}static parse(t,e,r){const s=t[0];if(t.length<5)throw new Error(`"${s}" expects at least 4 arguments`);const n=t[1];if(!Array.isArray(n)||0===n.length)throw new Error(`"${n}" is not a valid interpolation`);switch(n[0]){case"linear":if(1!==n.length)throw new Error("Linear interpolation cannot have parameters");break;case"exponential":if(2!==n.length||"number"!=typeof n[1])throw new Error("Exponential interpolation requires one numeric argument");break;case"cubic-bezier":if(5!==n.length)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");for(let t=1;t<5;t++){const e=n[t];if("number"!=typeof e||e<0||e>1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${t[0]}" unknown interpolation type "${n[0]}"`)}if(t.length%2!=1)throw new Error(`"${s}" expects an even number of arguments`);const a=pt(t[2],e,c);let o;"interpolate-hcl"===s||"interpolate-lab"===s?o=p:r&&"value"!==r.kind&&(o=r);const i=[];for(let l=3;l<t.length;l+=2){const r=t[l];if("number"!=typeof r)throw new Error(`"${s}" requires stop inputs as literal numbers`);if(i.length&&i[i.length-1][0]>=r)throw new Error(`"${s}" requires strictly ascending stop inputs`);const n=pt(t[l+1],e,o);o||(o=n.type),i.push([r,n])}if(o&&o!==p&&o!==c&&("array"!==o.kind||o.itemType!==c))throw new Error(`"${s}" cannot interpolate type ${g(o)}`);return new P(s,o,n,a,i)}evaluate(n,a){const i=this._stops;if(1===i.length)return i[0][1].evaluate(n,a);const l=this.input.evaluate(n,a);if(l<=i[0][0])return i[0][1].evaluate(n,a);if(l>=i[i.length-1][0])return i[i.length-1][1].evaluate(n,a);let u=0;for(;++u<i.length&&!(l<i[u][0]););const c=i[u-1][0],h=i[u][0],p=P.interpolationRatio(this.interpolation,l,c,h),f=i[u-1][1].evaluate(n,a),w=i[u][1].evaluate(n,a);if("interpolate"===this._operator){if("array"===this.type.kind&&Array.isArray(f)&&Array.isArray(w))return f.map(((t,e)=>o(t,w[e],p)));if("color"===this.type.kind&&f instanceof t&&w instanceof t){const e=new t(f),r=new t(w);return new t([o(e.r,r.r,p),o(e.g,r.g,p),o(e.b,r.b,p),o(e.a,r.a,p)])}if("number"===this.type.kind&&"number"==typeof f&&"number"==typeof w)return o(f,w,p);throw new Error(`"${this._operator}" cannot interpolate type ${g(this.type)}`)}if("interpolate-hcl"===this._operator){const s=e(f),n=e(w),a=n.h-s.h,i=r({h:s.h+p*(a>180||a<-180?a-360*Math.round(a/360):a),c:o(s.c,n.c,p),l:o(s.l,n.l,p)});return new t({a:o(f.a,w.a,p),...i})}if("interpolate-lab"===this._operator){const e=s(f),n=s(w),a=r({l:o(e.l,n.l,p),a:o(e.a,n.a,p),b:o(e.b,n.b,p)});return new t({a:o(f.a,w.a,p),...a})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(t,e){const r=this._stops;if(1===r.length)return 0;if(t>=r[r.length-1][0])return 0;let s=0;for(;++s<r.length&&!(t<r[s][0]););const n=r[s-1][0],a=r[s][0];return P.interpolationRatio(this.interpolation,e,n,a)}getInterpolationRange(t){const e=this._stops;if(1===e.length){const t=e[0][0];return[t,t]}const r=e[e.length-1][0];if(t>=r)return[r,r];let s=0;for(;++s<e.length&&!(t<e[s][0]););return[e[s-1][0],e[s][0]]}static interpolationRatio(t,e,r,s){let n=0;if("linear"===t[0])n=P._exponentialInterpolationRatio(e,1,r,s);else if("exponential"===t[0])n=P._exponentialInterpolationRatio(e,t[1],r,s);else if("cubic-bezier"===t[0]){n=a(t[1],t[2],t[3],t[4])(P._exponentialInterpolationRatio(e,1,r,s),1e-5)}return n<0?n=0:n>1&&(n=1),n}static _exponentialInterpolationRatio(t,e,r,s){const n=s-r;if(0===n)return 0;const a=t-r;return 1===e?a/n:(e**a-1)/(e**n-1)}}class S{constructor(t,e,r){this.type=t,this._input=e,this._stops=r}static parse(t,e){if(t.length<5)throw new Error('"step" expects at least 4 arguments');if(t.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=pt(t[1],e,c);let s;const n=[];n.push([-1/0,pt(t[2],e)]);for(let a=3;a<t.length;a+=2){const r=t[a];if("number"!=typeof r)throw new Error('"step" requires stop inputs as literal numbers');if(n.length&&n[n.length-1][0]>=r)throw new Error('"step" requires strictly ascending stop inputs');const o=pt(t[a+1],e);s||(s=o.type),n.push([r,o])}return new S(s,r,n)}evaluate(t,e){const r=this._stops;if(1===r.length)return r[0][1].evaluate(t,e);const s=this._input.evaluate(t,e);let n=0;for(;++n<r.length&&!(s<r[n][0]););return this._stops[n-1][1].evaluate(t,e)}}class B{constructor(t,e){this.type=t,this._output=e}static parse(t,e,r){if(t.length<4)throw new Error('"let" expects at least 3 arguments');if(t.length%2==1)throw new Error('"let" expects an odd number of arguments');const s=new _(e);for(let a=1;a<t.length-1;a+=2){const r=t[a];if("string"!=typeof r)throw new Error(`"let" requires a string to define variable names - found ${r}`);s.add(r,pt(t[a+1],e))}const n=pt(t[t.length-1],s,r);return new B(n.type,n)}evaluate(t,e){return this._output.evaluate(t,e)}}class T{constructor(t,e){this.type=t,this.output=e}static parse(t,e,r){if(2!==t.length||"string"!=typeof t[1])throw new Error('"var" requires just one literal string argument');const s=e.get(t[1]);if(!s)throw new Error(`${t[1]} must be defined before being used in a "var" expression`);return new T(r||i,s)}evaluate(t,e){return this.output.evaluate(t,e)}}class O{constructor(t,e,r){this.type=t,this._index=e,this._array=r}static parse(t,e){if(3!==t.length)throw new Error('"at" expects 2 arguments');const r=pt(t[1],e,c),s=pt(t[2],e);return new O(s.type.itemType,r,s)}evaluate(t,e){const r=this._index.evaluate(t,e),s=this._array.evaluate(t,e);if(r<0||r>=s.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return s[r]}}class F{constructor(t,e){this._key=t,this._obj=e,this.type=i}static parse(t,e){let r,s;switch(t.length){case 2:return r=pt(t[1],e),new F(r);case 3:return r=pt(t[1],e),s=pt(t[2],e),new F(r,s);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);if(this._obj){return this._obj.evaluate(t,e)[r]}return t?.values[r]}}class G{constructor(t,e){this._key=t,this._obj=e,this.type=h}static parse(t,e){let r,s;switch(t.length){case 2:return r=pt(t[1],e),new G(r);case 3:return r=pt(t[1],e),s=pt(t[2],e),new G(r,s);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);if(this._obj){return r in this._obj.evaluate(t,e)}return!!t?.values[r]}}class V{constructor(t,e){this._key=t,this._vals=e,this.type=h}static parse(t,e){if(3!==t.length)throw new Error('"in" expects 2 arguments');return new V(pt(t[1],e),pt(t[2],e))}evaluate(t,e){const r=this._key.evaluate(t,e);return this._vals.evaluate(t,e).includes(r)}}class D{constructor(t,e,r){this._item=t,this._array=e,this._from=r,this.type=c}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=pt(t[1],e),s=pt(t[2],e);if(4===t.length){const n=pt(t[3],e,c);return new D(r,s,n)}return new D(r,s)}evaluate(t,e){const r=this._item.evaluate(t,e),s=this._array.evaluate(t,e);if(this._from){const n=this._from.evaluate(t,e);if(n!==Math.floor(n))throw new Error('"index-of" index must be an integer');return s.indexOf(r,n)}return s.indexOf(r)}}class H{constructor(t){this._arg=t,this.type=c}static parse(t,e){if(2!==t.length)throw new Error('"length" expects 2 arguments');const r=pt(t[1],e);return new H(r)}evaluate(t,e){const r=this._arg.evaluate(t,e);if("string"==typeof r)return r.length;if(Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}}class J{constructor(t,e,r,s){this.type=t,this._array=e,this._from=r,this._to=s}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=pt(t[1],e),s=pt(t[2],e,c);if(s.type!==c)throw new Error('"slice" index must return a number');if(4===t.length){const n=pt(t[3],e,c);if(n.type!==c)throw new Error('"slice" index must return a number');return new J(r.type,r,s,n)}return new J(r.type,r,s)}evaluate(t,e){const r=this._array.evaluate(t,e);if(!Array.isArray(r)&&"string"!=typeof r)throw new Error('"slice" input must be an array or a string');const s=this._from.evaluate(t,e);if(s<0||s>=r.length)throw new Error('"slice" index out of bounds');if(s!==Math.floor(s))throw new Error('"slice" index must be an integer');if(this._to){const n=this._to.evaluate(t,e);if(n<0||n>=r.length)throw new Error('"slice" index out of bounds');if(n!==Math.floor(n))throw new Error('"slice" index must be an integer');return r.slice(s,n)}return r.slice(s)}}class K{constructor(){this.type=h}static parse(t){if(1!==t.length)throw new Error('"has-id" expects no arguments');return new K}evaluate(t,e){return void 0!==t?.id}}class Q{constructor(t,e){this._args=t,this._calculate=e,this.type=c}static parse(t,e,r){const s=t.slice(1).map((t=>pt(t,e)));return new Q(s,r)}evaluate(t,e){let r;return this._args&&(r=this._args.map((r=>r.evaluate(t,e)))),this._calculate(r)}}class W extends Q{static parse(t,e){switch(t.length){case 2:return Q.parse(t,e,(t=>-t[0]));case 3:return Q.parse(t,e,(t=>t[0]-t[1]));default:throw new Error('"-" expects 1 or 2 arguments')}}}class X extends Q{static parse(t,e){return Q.parse(t,e,(t=>{let e=1;for(const r of t)e*=r;return e}))}}class Y extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,(t=>t[0]/t[1]));throw new Error('"/" expects 2 arguments')}}class Z extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,(t=>t[0]%t[1]));throw new Error('"%" expects 2 arguments')}}class tt extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,(t=>t[0]**t[1]));throw new Error('"^" expects 1 or 2 arguments')}}class et extends Q{static parse(t,e){return Q.parse(t,e,(t=>{let e=0;for(const r of t)e+=r;return e}))}}class rt{constructor(t,e){this._args=t,this._calculate=e,this.type=c}static parse(t,e){const r=t.slice(1).map((t=>pt(t,e)));return new rt(r,rt.ops[t[0]])}evaluate(t,e){let r;return this._args&&(r=this._args.map((r=>r.evaluate(t,e)))),this._calculate(r)}}rt.ops={abs:t=>Math.abs(t[0]),acos:t=>Math.acos(t[0]),asin:t=>Math.asin(t[0]),atan:t=>Math.atan(t[0]),ceil:t=>Math.ceil(t[0]),cos:t=>Math.cos(t[0]),e:()=>Math.E,floor:t=>Math.floor(t[0]),ln:t=>Math.log(t[0]),ln2:()=>Math.LN2,log10:t=>Math.log(t[0])/Math.LN10,log2:t=>Math.log(t[0])/Math.LN2,max:t=>Math.max(...t),min:t=>Math.min(...t),pi:()=>Math.PI,round:t=>Math.round(t[0]),sin:t=>Math.sin(t[0]),sqrt:t=>Math.sqrt(t[0]),tan:t=>Math.tan(t[0])};class st{constructor(t){this._args=t,this.type=l}static parse(t,e){return new st(t.slice(1).map((t=>pt(t,e))))}evaluate(t,e){return this._args.map((r=>r.evaluate(t,e))).join("")}}class nt{constructor(t,e){this._arg=t,this._calculate=e,this.type=l}static parse(t,e){if(2!==t.length)throw new Error(`${t[0]} expects 1 argument`);const r=pt(t[1],e);return new nt(r,nt.ops[t[0]])}evaluate(t,e){return this._calculate(this._arg.evaluate(t,e))}}nt.ops={downcase:t=>t.toLowerCase(),upcase:t=>t.toUpperCase()};class at{constructor(t){this._args=t,this.type=p}static parse(t,e){if(4!==t.length)throw new Error('"rgb" expects 3 arguments');const r=t.slice(1).map((t=>pt(t,e)));return new at(r)}evaluate(e,r){const s=this._validate(this._args[0].evaluate(e,r)),n=this._validate(this._args[1].evaluate(e,r)),a=this._validate(this._args[2].evaluate(e,r));return new t({r:s,g:n,b:a})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}}class ot{constructor(t){this._args=t,this.type=p}static parse(t,e){if(5!==t.length)throw new Error('"rgba" expects 4 arguments');const r=t.slice(1).map((t=>pt(t,e)));return new ot(r)}evaluate(e,r){const s=this._validate(this._args[0].evaluate(e,r)),n=this._validate(this._args[1].evaluate(e,r)),a=this._validate(this._args[2].evaluate(e,r)),o=this._validateAlpha(this._args[3].evaluate(e,r));return new t({r:s,g:n,b:a,a:o})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}_validateAlpha(t){if("number"!=typeof t||t<0||t>1)throw new Error(`${t}: invalid alpha color component`);return t}}class it{constructor(t){this._color=t,this.type=f(c,4)}static parse(t,e){if(2!==t.length)throw new Error('"to-rgba" expects 1 argument');const r=pt(t[1],e);return new it(r)}evaluate(e,r){return new t(this._color.evaluate(e,r)).toRgba()}}class lt{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0];if(t.length<2)throw new Error(`${r} expects at least one argument`);let s,n=1;if("array"===r){if(t.length>2){switch(t[1]){case"string":s=l;break;case"number":s=c;break;case"boolean":s=h;break;default:throw new Error('"array" type argument must be string, number or boolean')}n++}else s=i;let e;if(t.length>3){if(e=t[2],null!==e&&("number"!=typeof e||e<0||e!==Math.floor(e)))throw new Error('"array" length argument must be a positive integer literal');n++}s=f(s,e)}else switch(r){case"string":s=l;break;case"number":s=c;break;case"boolean":s=h;break;case"object":s=u}const a=[];for(;n<t.length;n++){const r=pt(t[n],e);a.push(r)}return new lt(s,a)}evaluate(t,e){let r;for(const s of this._args){const n=s.evaluate(t,e);if(r=w(n),m(r,this.type))return n}throw new Error(`Expected ${g(this.type)} but got ${g(r)}`)}}class ut{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0],s=ut.types[r];if(s===h||s===l){if(2!==t.length)throw new Error(`${r} expects one argument`)}else if(t.length<2)throw new Error(`${r} expects at least one argument`);const n=[];for(let a=1;a<t.length;a++){const r=pt(t[a],e);n.push(r)}return new ut(s,n)}evaluate(e,r){if(this.type===h)return Boolean(this._args[0].evaluate(e,r));if(this.type===l)return y(this._args[0].evaluate(e,r));if(this.type===c){for(const t of this._args){const s=Number(t.evaluate(e,r));if(!isNaN(s))return s}return null}if(this.type===p){for(const s of this._args)try{const n=ut.toColor(s.evaluate(e,r));if(n instanceof t)return n}catch{}return null}}static toBoolean(t){return Boolean(t)}static toString(t){return y(t)}static toNumber(t){const e=Number(t);if(isNaN(e))throw new Error(`"${t}" is not a number`);return e}static toColor(e){if(e instanceof t)return e;if("string"==typeof e){const r=t.fromString(e);if(r)return r;throw new Error(`"${e}" is not a color`)}if(Array.isArray(e))return t.fromArray(e);throw new Error(`"${e}" is not a color`)}}ut.types={"to-boolean":h,"to-color":p,"to-number":c,"to-string":l};class ct{constructor(t){this._val=t,this.type=w(t)}static parse(t){if(2!==t.length)throw new Error('"literal" expects 1 argument');return new ct(t[1])}evaluate(t,e){return this._val}}class ht{constructor(t){this._arg=t,this.type=l}static parse(t,e){if(2!==t.length)throw new Error('"typeof" expects 1 argument');return new ht(pt(t[1],e))}evaluate(t,e){return g(w(this._arg.evaluate(t,e)))}}function pt(t,e,r){const s=typeof t;if("string"===s||"boolean"===s||"number"===s||null===t){if(r)switch(r.kind){case"string":"string"!==s&&(t=ut.toString(t));break;case"number":"number"!==s&&(t=ut.toNumber(t));break;case"color":t=ut.toColor(t)}t=["literal",t]}if(!Array.isArray(t)||0===t.length)throw new Error("Expression must be a non empty array");const n=t[0];if("string"!=typeof n)throw new Error("First element of expression must be a string");const a=gt[n];if(void 0===a)throw new Error(`Invalid expression operator "${n}"`);if(!a)throw new Error(`Unimplemented expression operator "${n}"`);return a.parse(t,e,r)}const gt={array:lt,boolean:lt,collator:null,format:null,image:null,literal:ct,number:lt,"number-format":null,object:lt,string:lt,"to-boolean":ut,"to-color":ut,"to-number":ut,"to-string":ut,typeof:ht,accumulated:null,"feature-state":null,"geometry-type":b,id:v,"line-progress":null,properties:d,at:O,get:F,has:G,in:V,"index-of":D,length:H,slice:J,"!":N,"!=":M,"<":k,"<=":A,"==":$,">":j,">=":q,all:C,any:R,case:I,coalesce:L,match:U,within:null,interpolate:P,"interpolate-hcl":P,"interpolate-lab":P,step:S,let:B,var:T,concat:st,downcase:nt,"is-supported-script":null,"resolved-locale":null,upcase:nt,rgb:at,rgba:ot,"to-rgba":it,"-":W,"*":X,"/":Y,"%":Z,"^":tt,"+":et,abs:rt,acos:rt,asin:rt,atan:rt,ceil:rt,cos:rt,e:rt,floor:rt,ln:rt,ln2:rt,log10:rt,log2:rt,max:rt,min:rt,pi:rt,round:rt,sin:rt,sqrt:rt,tan:rt,zoom:x,"heatmap-density":null,"has-id":K,none:z};export{C as ALL,R as ANY,et as Add,lt as Assert,O as At,rt as Calculate,I as Case,L as Coalesce,ut as Coerce,st as Concat,Y as Div,$ as EQ,q as GE,j as GT,b as GeomType,F as Get,G as Has,K as HasID,v as ID,V as In,D as IndexOf,P as Interpolate,A as LE,k as LT,H as Length,B as Let,ct as Literal,U as Match,Z as Mod,X as Mul,M as NE,z as NONE,N as NOT,tt as Pow,d as Properties,at as Rgb,ot as Rgba,J as Slice,S as Step,nt as String,W as Sub,it as ToRgba,ht as TypeOf,T as Var,x as Zoom,pt as createExpression,gt as ops};
5
+ import t from"../../../../../Color.js";import{toLCH as e,toRGB as r,toLAB as s}from"../../../../../core/colorUtils.js";import{GeometryType as n}from"../../../../../geometry/support/TileClipper.js";import{unitBezier as a}from"../../../unitBezier.js";import{interpolate as o}from"../GeometryUtils.js";import{numberType as i,booleanType as l,colorType as u,stringType as c,valueToString as h,valueType as p,objectType as g,typeToString as f,arrayType as w,getType as m,matchType as y}from"./types.js";class _{constructor(t){this._parent=t,this._vars={}}add(t,e){this._vars[t]=e}get(t){return this._vars[t]?this._vars[t]:this._parent?this._parent.get(t):null}}class v{constructor(){this.type=p}static parse(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new v}evaluate(t,e){return t?.id}}class b{constructor(){this.type=c}static parse(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new b}evaluate(t,e){if(!t)return null;switch(t.type){case n.Point:return"Point";case n.LineString:return"LineString";case n.Polygon:return"Polygon";default:return null}}}class d{constructor(){this.type=g}static parse(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new d}evaluate(t,e){return t?.values}}class x{constructor(){this.type=i}static parse(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new x}evaluate(t,e){return e}}class E{constructor(t,e,r){this._lhs=t,this._rhs=e,this._compare=r,this.type=l}static parse(t,e,r){if(3!==t.length&&4!==t.length)throw new Error(`"${t[0]}" expects 2 or 3 arguments`);if(4===t.length)throw new Error(`"${t[0]}" collator not supported`);return new E(pt(t[1],e),pt(t[2],e),r)}evaluate(t,e){return this._compare(this._lhs.evaluate(t,e),this._rhs.evaluate(t,e))}}class $ extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t===e))}}class M extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t!==e))}}class k extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t<e))}}class A extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t<=e))}}class j extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t>e))}}class q extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t>=e))}}class N{constructor(t){this._arg=t,this.type=l}static parse(t,e){if(2!==t.length)throw new Error('"!" expects 1 argument');return new N(pt(t[1],e))}evaluate(t,e){return!this._arg.evaluate(t,e)}}class C{constructor(t){this._args=t,this.type=l}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new C(r)}evaluate(t,e){for(const r of this._args)if(!r.evaluate(t,e))return!1;return!0}}class R{constructor(t){this._args=t,this.type=l}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new R(r)}evaluate(t,e){for(const r of this._args)if(r.evaluate(t,e))return!0;return!1}}class z{constructor(t){this._args=t,this.type=l}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new z(r)}evaluate(t,e){for(const r of this._args)if(r.evaluate(t,e))return!1;return!0}}class I{constructor(t,e,r){this.type=t,this._args=e,this._fallback=r}static parse(t,e,r){if(t.length<4)throw new Error('"case" expects at least 3 arguments');if(t.length%2==1)throw new Error('"case" expects an odd number of arguments');let s;const n=[];for(let o=1;o<t.length-1;o+=2){const a=pt(t[o],e),i=pt(t[o+1],e,r);s||(s=i.type),n.push({condition:a,output:i})}const a=pt(t[t.length-1],e,r);return s||(s=a.type),new I(s,n,a)}evaluate(t,e){for(const r of this._args)if(r.condition.evaluate(t,e))return r.output.evaluate(t,e);return this._fallback.evaluate(t,e)}}class L{constructor(t,e){this.type=t,this._args=e}static parse(t,e){if(t.length<2)throw new Error('"coalesce" expects at least 1 argument');let r;const s=[];for(let n=1;n<t.length;n++){const a=pt(t[n],e);r||(r=a.type),s.push(a)}return new L(r,s)}evaluate(t,e){for(const r of this._args){const s=r.evaluate(t,e);if(null!==s)return s}return null}}class U{constructor(t,e,r,s,n){this.type=t,this._input=e,this._labels=r,this._outputs=s,this._fallback=n}static parse(t,e){if(t.length<3)throw new Error('"match" expects at least 3 arguments');if(t.length%2==0)throw new Error('"case" expects an even number of arguments');let r;const s=pt(t[1],e),n=[],a={};let o;for(let i=2;i<t.length-1;i+=2){let s=t[i];Array.isArray(s)||(s=[s]);for(const t of s){const e=typeof t;if("string"!==e&&"number"!==e)throw new Error('"match" requires string or number literal as labels');if(o){if(e!==o)throw new Error('"match" requires labels to have the same type')}else o=e;a[t]=n.length}const l=pt(t[i+1],e);r||(r=l.type),n.push(l)}return new U(r,s,a,n,pt(t[t.length-1],e))}evaluate(t,e){const r=this._input.evaluate(t,e);return(this._outputs[this._labels[r]]||this._fallback).evaluate(t,e)}}class P{constructor(t,e,r,s,n){this._operator=t,this.type=e,this.interpolation=r,this.input=s,this._stops=n}static parse(t,e,r){const s=t[0];if(t.length<5)throw new Error(`"${s}" expects at least 4 arguments`);const n=t[1];if(!Array.isArray(n)||0===n.length)throw new Error(`"${n}" is not a valid interpolation`);switch(n[0]){case"linear":if(1!==n.length)throw new Error("Linear interpolation cannot have parameters");break;case"exponential":if(2!==n.length||"number"!=typeof n[1])throw new Error("Exponential interpolation requires one numeric argument");break;case"cubic-bezier":if(5!==n.length)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");for(let t=1;t<5;t++){const e=n[t];if("number"!=typeof e||e<0||e>1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${t[0]}" unknown interpolation type "${n[0]}"`)}if(t.length%2!=1)throw new Error(`"${s}" expects an even number of arguments`);const a=pt(t[2],e,i);let o;"interpolate-hcl"===s||"interpolate-lab"===s?o=u:r&&"value"!==r.kind&&(o=r);const l=[];for(let i=3;i<t.length;i+=2){const r=t[i];if("number"!=typeof r)throw new Error(`"${s}" requires stop inputs as literal numbers`);if(l.length&&l[l.length-1][0]>=r)throw new Error(`"${s}" requires strictly ascending stop inputs`);const n=pt(t[i+1],e,o);o||(o=n.type),l.push([r,n])}if(o&&o!==u&&o!==i&&("array"!==o.kind||o.itemType!==i))throw new Error(`"${s}" cannot interpolate type ${f(o)}`);return new P(s,o,n,a,l)}evaluate(n,a){const i=this._stops;if(1===i.length)return i[0][1].evaluate(n,a);const l=this.input.evaluate(n,a);if(l<=i[0][0])return i[0][1].evaluate(n,a);if(l>=i[i.length-1][0])return i[i.length-1][1].evaluate(n,a);let u=0;for(;++u<i.length&&!(l<i[u][0]););const c=i[u-1][0],h=i[u][0],p=P.interpolationRatio(this.interpolation,l,c,h),g=i[u-1][1].evaluate(n,a),w=i[u][1].evaluate(n,a);if("interpolate"===this._operator){if("array"===this.type.kind&&Array.isArray(g)&&Array.isArray(w))return g.map(((t,e)=>o(t,w[e],p)));if("color"===this.type.kind&&g instanceof t&&w instanceof t){const e=new t(g),r=new t(w);return new t([o(e.r,r.r,p),o(e.g,r.g,p),o(e.b,r.b,p),o(e.a,r.a,p)])}if("number"===this.type.kind&&"number"==typeof g&&"number"==typeof w)return o(g,w,p);throw new Error(`"${this._operator}" cannot interpolate type ${f(this.type)}`)}if("interpolate-hcl"===this._operator){const s=e(g),n=e(w),a=n.h-s.h,i=r({h:s.h+p*(a>180||a<-180?a-360*Math.round(a/360):a),c:o(s.c,n.c,p),l:o(s.l,n.l,p)});return new t({a:o(g.a,w.a,p),...i})}if("interpolate-lab"===this._operator){const e=s(g),n=s(w),a=r({l:o(e.l,n.l,p),a:o(e.a,n.a,p),b:o(e.b,n.b,p)});return new t({a:o(g.a,w.a,p),...a})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(t,e){const r=this._stops;if(1===r.length)return 0;if(t>=r[r.length-1][0])return 0;let s=0;for(;++s<r.length&&!(t<r[s][0]););const n=r[s-1][0],a=r[s][0];return P.interpolationRatio(this.interpolation,e,n,a)}getInterpolationRange(t){const e=this._stops;if(1===e.length){const t=e[0][0];return[t,t]}const r=e[e.length-1][0];if(t>=r)return[r,r];let s=0;for(;++s<e.length&&!(t<e[s][0]););return[e[s-1][0],e[s][0]]}static interpolationRatio(t,e,r,s){let n=0;if("linear"===t[0])n=P._exponentialInterpolationRatio(e,1,r,s);else if("exponential"===t[0])n=P._exponentialInterpolationRatio(e,t[1],r,s);else if("cubic-bezier"===t[0]){n=a(t[1],t[2],t[3],t[4])(P._exponentialInterpolationRatio(e,1,r,s),1e-5)}return n<0?n=0:n>1&&(n=1),n}static _exponentialInterpolationRatio(t,e,r,s){const n=s-r;if(0===n)return 0;const a=t-r;return 1===e?a/n:(e**a-1)/(e**n-1)}}class S{constructor(t,e,r){this.type=t,this._input=e,this._stops=r}static parse(t,e){if(t.length<5)throw new Error('"step" expects at least 4 arguments');if(t.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=pt(t[1],e,i);let s;const n=[];n.push([-1/0,pt(t[2],e)]);for(let a=3;a<t.length;a+=2){const r=t[a];if("number"!=typeof r)throw new Error('"step" requires stop inputs as literal numbers');if(n.length&&n[n.length-1][0]>=r)throw new Error('"step" requires strictly ascending stop inputs');const o=pt(t[a+1],e);s||(s=o.type),n.push([r,o])}return new S(s,r,n)}evaluate(t,e){const r=this._stops;if(1===r.length)return r[0][1].evaluate(t,e);const s=this._input.evaluate(t,e);let n=0;for(;++n<r.length&&!(s<r[n][0]););return this._stops[n-1][1].evaluate(t,e)}}class B{constructor(t,e){this.type=t,this._output=e}static parse(t,e,r){if(t.length<4)throw new Error('"let" expects at least 3 arguments');if(t.length%2==1)throw new Error('"let" expects an odd number of arguments');const s=new _(e);for(let a=1;a<t.length-1;a+=2){const r=t[a];if("string"!=typeof r)throw new Error(`"let" requires a string to define variable names - found ${r}`);s.add(r,pt(t[a+1],e))}const n=pt(t[t.length-1],s,r);return new B(n.type,n)}evaluate(t,e){return this._output.evaluate(t,e)}}class T{constructor(t,e){this.type=t,this.output=e}static parse(t,e,r){if(2!==t.length||"string"!=typeof t[1])throw new Error('"var" requires just one literal string argument');const s=e.get(t[1]);if(!s)throw new Error(`${t[1]} must be defined before being used in a "var" expression`);return new T(r||p,s)}evaluate(t,e){return this.output.evaluate(t,e)}}class O{constructor(t,e,r){this.type=t,this._index=e,this._array=r}static parse(t,e){if(3!==t.length)throw new Error('"at" expects 2 arguments');const r=pt(t[1],e,i),s=pt(t[2],e);return new O(s.type.itemType,r,s)}evaluate(t,e){const r=this._index.evaluate(t,e),s=this._array.evaluate(t,e);if(r<0||r>=s.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return s[r]}}class F{constructor(t,e){this._key=t,this._obj=e,this.type=p}static parse(t,e){let r,s;switch(t.length){case 2:return r=pt(t[1],e),new F(r);case 3:return r=pt(t[1],e),s=pt(t[2],e),new F(r,s);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);if(this._obj){return this._obj.evaluate(t,e)[r]}return t?.values[r]}}class G{constructor(t,e){this._key=t,this._obj=e,this.type=l}static parse(t,e){let r,s;switch(t.length){case 2:return r=pt(t[1],e),new G(r);case 3:return r=pt(t[1],e),s=pt(t[2],e),new G(r,s);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);if(this._obj){return r in this._obj.evaluate(t,e)}return!!t?.values[r]}}class V{constructor(t,e){this._key=t,this._vals=e,this.type=l}static parse(t,e){if(3!==t.length)throw new Error('"in" expects 2 arguments');return new V(pt(t[1],e),pt(t[2],e))}evaluate(t,e){const r=this._key.evaluate(t,e);return this._vals.evaluate(t,e).includes(r)}}class D{constructor(t,e,r){this._item=t,this._array=e,this._from=r,this.type=i}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=pt(t[1],e),s=pt(t[2],e);if(4===t.length){const n=pt(t[3],e,i);return new D(r,s,n)}return new D(r,s)}evaluate(t,e){const r=this._item.evaluate(t,e),s=this._array.evaluate(t,e);if(this._from){const n=this._from.evaluate(t,e);if(n!==Math.floor(n))throw new Error('"index-of" index must be an integer');return s.indexOf(r,n)}return s.indexOf(r)}}class H{constructor(t){this._arg=t,this.type=i}static parse(t,e){if(2!==t.length)throw new Error('"length" expects 2 arguments');const r=pt(t[1],e);return new H(r)}evaluate(t,e){const r=this._arg.evaluate(t,e);if("string"==typeof r)return r.length;if(Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}}class J{constructor(t,e,r,s){this.type=t,this._array=e,this._from=r,this._to=s}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=pt(t[1],e),s=pt(t[2],e,i);if(s.type!==i)throw new Error('"slice" index must return a number');if(4===t.length){const n=pt(t[3],e,i);if(n.type!==i)throw new Error('"slice" index must return a number');return new J(r.type,r,s,n)}return new J(r.type,r,s)}evaluate(t,e){const r=this._array.evaluate(t,e);if(!Array.isArray(r)&&"string"!=typeof r)throw new Error('"slice" input must be an array or a string');const s=this._from.evaluate(t,e);if(s<0||s>=r.length)throw new Error('"slice" index out of bounds');if(s!==Math.floor(s))throw new Error('"slice" index must be an integer');if(this._to){const n=this._to.evaluate(t,e);if(n<0||n>=r.length)throw new Error('"slice" index out of bounds');if(n!==Math.floor(n))throw new Error('"slice" index must be an integer');return r.slice(s,n)}return r.slice(s)}}class K{constructor(){this.type=l}static parse(t){if(1!==t.length)throw new Error('"has-id" expects no arguments');return new K}evaluate(t,e){return void 0!==t?.id}}class Q{constructor(t,e){this._args=t,this._calculate=e,this.type=i}static parse(t,e,r){const s=t.slice(1).map((t=>pt(t,e)));return new Q(s,r)}evaluate(t,e){let r;return this._args&&(r=this._args.map((r=>r.evaluate(t,e)))),this._calculate(r)}}class W extends Q{static parse(t,e){switch(t.length){case 2:return Q.parse(t,e,(t=>-t[0]));case 3:return Q.parse(t,e,(t=>t[0]-t[1]));default:throw new Error('"-" expects 1 or 2 arguments')}}}class X extends Q{static parse(t,e){return Q.parse(t,e,(t=>{let e=1;for(const r of t)e*=r;return e}))}}class Y extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,(t=>t[0]/t[1]));throw new Error('"/" expects 2 arguments')}}class Z extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,(t=>t[0]%t[1]));throw new Error('"%" expects 2 arguments')}}class tt extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,(t=>t[0]**t[1]));throw new Error('"^" expects 1 or 2 arguments')}}class et extends Q{static parse(t,e){return Q.parse(t,e,(t=>{let e=0;for(const r of t)e+=r;return e}))}}class rt{constructor(t,e){this._args=t,this._calculate=e,this.type=i}static{this.ops={abs:t=>Math.abs(t[0]),acos:t=>Math.acos(t[0]),asin:t=>Math.asin(t[0]),atan:t=>Math.atan(t[0]),ceil:t=>Math.ceil(t[0]),cos:t=>Math.cos(t[0]),e:()=>Math.E,floor:t=>Math.floor(t[0]),ln:t=>Math.log(t[0]),ln2:()=>Math.LN2,log10:t=>Math.log(t[0])/Math.LN10,log2:t=>Math.log(t[0])/Math.LN2,max:t=>Math.max(...t),min:t=>Math.min(...t),pi:()=>Math.PI,round:t=>Math.round(t[0]),sin:t=>Math.sin(t[0]),sqrt:t=>Math.sqrt(t[0]),tan:t=>Math.tan(t[0])}}static parse(t,e){const r=t.slice(1).map((t=>pt(t,e)));return new rt(r,rt.ops[t[0]])}evaluate(t,e){let r;return this._args&&(r=this._args.map((r=>r.evaluate(t,e)))),this._calculate(r)}}class st{constructor(t){this._args=t,this.type=c}static parse(t,e){return new st(t.slice(1).map((t=>pt(t,e))))}evaluate(t,e){return this._args.map((r=>r.evaluate(t,e))).join("")}}class nt{constructor(t,e){this._arg=t,this._calculate=e,this.type=c}static{this.ops={downcase:t=>t.toLowerCase(),upcase:t=>t.toUpperCase()}}static parse(t,e){if(2!==t.length)throw new Error(`${t[0]} expects 1 argument`);const r=pt(t[1],e);return new nt(r,nt.ops[t[0]])}evaluate(t,e){return this._calculate(this._arg.evaluate(t,e))}}class at{constructor(t){this._args=t,this.type=u}static parse(t,e){if(4!==t.length)throw new Error('"rgb" expects 3 arguments');const r=t.slice(1).map((t=>pt(t,e)));return new at(r)}evaluate(e,r){const s=this._validate(this._args[0].evaluate(e,r)),n=this._validate(this._args[1].evaluate(e,r)),a=this._validate(this._args[2].evaluate(e,r));return new t({r:s,g:n,b:a})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}}class ot{constructor(t){this._args=t,this.type=u}static parse(t,e){if(5!==t.length)throw new Error('"rgba" expects 4 arguments');const r=t.slice(1).map((t=>pt(t,e)));return new ot(r)}evaluate(e,r){const s=this._validate(this._args[0].evaluate(e,r)),n=this._validate(this._args[1].evaluate(e,r)),a=this._validate(this._args[2].evaluate(e,r)),o=this._validateAlpha(this._args[3].evaluate(e,r));return new t({r:s,g:n,b:a,a:o})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}_validateAlpha(t){if("number"!=typeof t||t<0||t>1)throw new Error(`${t}: invalid alpha color component`);return t}}class it{constructor(t){this._color=t,this.type=w(i,4)}static parse(t,e){if(2!==t.length)throw new Error('"to-rgba" expects 1 argument');const r=pt(t[1],e);return new it(r)}evaluate(e,r){return new t(this._color.evaluate(e,r)).toRgba()}}class lt{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0];if(t.length<2)throw new Error(`${r} expects at least one argument`);let s,n=1;if("array"===r){if(t.length>2){switch(t[1]){case"string":s=c;break;case"number":s=i;break;case"boolean":s=l;break;default:throw new Error('"array" type argument must be string, number or boolean')}n++}else s=p;let e;if(t.length>3){if(e=t[2],null!==e&&("number"!=typeof e||e<0||e!==Math.floor(e)))throw new Error('"array" length argument must be a positive integer literal');n++}s=w(s,e)}else switch(r){case"string":s=c;break;case"number":s=i;break;case"boolean":s=l;break;case"object":s=g}const a=[];for(;n<t.length;n++){const r=pt(t[n],e);a.push(r)}return new lt(s,a)}evaluate(t,e){let r;for(const s of this._args){const n=s.evaluate(t,e);if(r=m(n),y(r,this.type))return n}throw new Error(`Expected ${f(this.type)} but got ${f(r)}`)}}class ut{static{this.types={"to-boolean":l,"to-color":u,"to-number":i,"to-string":c}}constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0],s=ut.types[r];if(s===l||s===c){if(2!==t.length)throw new Error(`${r} expects one argument`)}else if(t.length<2)throw new Error(`${r} expects at least one argument`);const n=[];for(let a=1;a<t.length;a++){const r=pt(t[a],e);n.push(r)}return new ut(s,n)}evaluate(e,r){if(this.type===l)return Boolean(this._args[0].evaluate(e,r));if(this.type===c)return h(this._args[0].evaluate(e,r));if(this.type===i){for(const t of this._args){const s=Number(t.evaluate(e,r));if(!isNaN(s))return s}return null}if(this.type===u){for(const s of this._args)try{const n=ut.toColor(s.evaluate(e,r));if(n instanceof t)return n}catch{}return null}}static toBoolean(t){return Boolean(t)}static toString(t){return h(t)}static toNumber(t){const e=Number(t);if(isNaN(e))throw new Error(`"${t}" is not a number`);return e}static toColor(e){if(e instanceof t)return e;if("string"==typeof e){const r=t.fromString(e);if(r)return r;throw new Error(`"${e}" is not a color`)}if(Array.isArray(e))return t.fromArray(e);throw new Error(`"${e}" is not a color`)}}class ct{constructor(t){this._val=t,this.type=m(t)}static parse(t){if(2!==t.length)throw new Error('"literal" expects 1 argument');return new ct(t[1])}evaluate(t,e){return this._val}}class ht{constructor(t){this._arg=t,this.type=c}static parse(t,e){if(2!==t.length)throw new Error('"typeof" expects 1 argument');return new ht(pt(t[1],e))}evaluate(t,e){return f(m(this._arg.evaluate(t,e)))}}function pt(t,e,r){const s=typeof t;if("string"===s||"boolean"===s||"number"===s||null===t){if(r)switch(r.kind){case"string":"string"!==s&&(t=ut.toString(t));break;case"number":"number"!==s&&(t=ut.toNumber(t));break;case"color":t=ut.toColor(t)}t=["literal",t]}if(!Array.isArray(t)||0===t.length)throw new Error("Expression must be a non empty array");const n=t[0];if("string"!=typeof n)throw new Error("First element of expression must be a string");const a=gt[n];if(void 0===a)throw new Error(`Invalid expression operator "${n}"`);if(!a)throw new Error(`Unimplemented expression operator "${n}"`);return a.parse(t,e,r)}const gt={array:lt,boolean:lt,collator:null,format:null,image:null,literal:ct,number:lt,"number-format":null,object:lt,string:lt,"to-boolean":ut,"to-color":ut,"to-number":ut,"to-string":ut,typeof:ht,accumulated:null,"feature-state":null,"geometry-type":b,id:v,"line-progress":null,properties:d,at:O,get:F,has:G,in:V,"index-of":D,length:H,slice:J,"!":N,"!=":M,"<":k,"<=":A,"==":$,">":j,">=":q,all:C,any:R,case:I,coalesce:L,match:U,within:null,interpolate:P,"interpolate-hcl":P,"interpolate-lab":P,step:S,let:B,var:T,concat:st,downcase:nt,"is-supported-script":null,"resolved-locale":null,upcase:nt,rgb:at,rgba:ot,"to-rgba":it,"-":W,"*":X,"/":Y,"%":Z,"^":tt,"+":et,abs:rt,acos:rt,asin:rt,atan:rt,ceil:rt,cos:rt,e:rt,floor:rt,ln:rt,ln2:rt,log10:rt,log2:rt,max:rt,min:rt,pi:rt,round:rt,sin:rt,sqrt:rt,tan:rt,zoom:x,"heatmap-density":null,"has-id":K,none:z};export{C as ALL,R as ANY,et as Add,lt as Assert,O as At,rt as Calculate,I as Case,L as Coalesce,ut as Coerce,st as Concat,Y as Div,$ as EQ,q as GE,j as GT,b as GeomType,F as Get,G as Has,K as HasID,v as ID,V as In,D as IndexOf,P as Interpolate,A as LE,k as LT,H as Length,B as Let,ct as Literal,U as Match,Z as Mod,X as Mul,M as NE,z as NONE,N as NOT,tt as Pow,d as Properties,at as Rgb,ot as Rgba,J as Slice,S as Step,nt as String,W as Sub,it as ToRgba,ht as TypeOf,T as Var,x as Zoom,pt as createExpression,gt as ops};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{VTLMaterial as r}from"./VTLMaterial.js";import{DataType as t}from"../../../../webgl/enums.js";import{VertexElementDescriptor as e}from"../../../../webgl/VertexElementDescriptor.js";class T extends r{constructor(r){super(r)}geometryInfo(){return T.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return T.ATTRIBUTES}attributesInfo(){return T.ATTRIBUTES_INFO}}T.ATTRIBUTES=[],T.GEOMETRY_LAYOUT=[new e("a_pos",2,t.BYTE,0,2)],T.ATTRIBUTES_INFO={};export{T as VTLBackgroundMaterial};
5
+ import{VTLMaterial as t}from"./VTLMaterial.js";import{DataType as r}from"../../../../webgl/enums.js";import{VertexElementDescriptor as e}from"../../../../webgl/VertexElementDescriptor.js";class s extends t{static{this.ATTRIBUTES=[]}static{this.GEOMETRY_LAYOUT=[new e("a_pos",2,r.BYTE,0,2)]}static{this.ATTRIBUTES_INFO={}}constructor(t){super(t)}geometryInfo(){return s.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return s.ATTRIBUTES}attributesInfo(){return s.ATTRIBUTES_INFO}}export{s as VTLBackgroundMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{EncodingType as r}from"./enums.js";import{VTLMaterial as e}from"./VTLMaterial.js";import{DataType as c}from"../../../../webgl/enums.js";import{VertexElementDescriptor as o}from"../../../../webgl/VertexElementDescriptor.js";class t extends e{constructor(r){super(r)}geometryInfo(){return t.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return t.ATTRIBUTES}attributesInfo(){return t.ATTRIBUTES_INFO}}t.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"],t.GEOMETRY_LAYOUT=[new o("a_pos",2,c.SHORT,0,4)],t.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:r.R8_UNSIGNED},"circle-color":{name:"color",type:r.R8G8B8A8_COLOR},"circle-opacity":{name:"opacity",type:r.R8_UNSIGNED,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:r.R8_UNSIGNED,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:r.R8G8B8A8_COLOR},"circle-stroke-opacity":{name:"stroke_opacity",type:r.R8_UNSIGNED,precisionFactor:100},"circle-blur":{name:"blur",type:r.R8_UNSIGNED,precisionFactor:32}};export{t as VTLCircleMaterial};
5
+ import{EncodingType as r}from"./enums.js";import{VTLMaterial as e}from"./VTLMaterial.js";import{DataType as t}from"../../../../webgl/enums.js";import{VertexElementDescriptor as c}from"../../../../webgl/VertexElementDescriptor.js";class o extends e{static{this.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"]}static{this.GEOMETRY_LAYOUT=[new c("a_pos",2,t.SHORT,0,4)]}static{this.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:r.R8_UNSIGNED},"circle-color":{name:"color",type:r.R8G8B8A8_COLOR},"circle-opacity":{name:"opacity",type:r.R8_UNSIGNED,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:r.R8_UNSIGNED,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:r.R8G8B8A8_COLOR},"circle-stroke-opacity":{name:"stroke_opacity",type:r.R8_UNSIGNED,precisionFactor:100},"circle-blur":{name:"blur",type:r.R8_UNSIGNED,precisionFactor:32}}}constructor(r){super(r)}geometryInfo(){return o.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return o.ATTRIBUTES}attributesInfo(){return o.ATTRIBUTES_INFO}}export{o as VTLCircleMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{EncodingType as o}from"./enums.js";import{VTLMaterial as t}from"./VTLMaterial.js";import{DataType as r}from"../../../../webgl/enums.js";import{VertexElementDescriptor as e}from"../../../../webgl/VertexElementDescriptor.js";class l extends t{constructor(o){super(o)}geometryInfo(){return l.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return l.ATTRIBUTES}attributesInfo(){return l.ATTRIBUTES_INFO}}l.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"],l.GEOMETRY_LAYOUT=[new e("a_pos",2,r.SHORT,0,4)],l.ATTRIBUTES_INFO={"fill-color":{name:"color",type:o.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:o.R8_UNSIGNED,precisionFactor:100},"fill-pattern":{name:"tlbr",type:o.R16G16B16A16_PATTERN,isOptional:!0}};class T extends t{constructor(o,t){super(o),this._usefillColor=t}geometryInfo(){return T.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return this._usefillColor?T.ATTRIBUTES_FILL:T.ATTRIBUTES_OUTLINE}attributesInfo(){return this._usefillColor?T.ATTRIBUTES_INFO_FILL:T.ATTRIBUTES_INFO_OUTLINE}}T.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"],T.ATTRIBUTES_FILL=["fill-color","fill-opacity"],T.GEOMETRY_LAYOUT=[new e("a_pos",2,r.SHORT,0,8),new e("a_offset",2,r.BYTE,4,8),new e("a_xnormal",2,r.BYTE,6,8)],T.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:o.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:o.R8_UNSIGNED,precisionFactor:100}},T.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:o.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:o.R8_UNSIGNED,precisionFactor:100}};export{l as VTLFillMaterial,T as VTLOutlineMaterial};
5
+ import{EncodingType as t}from"./enums.js";import{VTLMaterial as o}from"./VTLMaterial.js";import{DataType as i}from"../../../../webgl/enums.js";import{VertexElementDescriptor as r}from"../../../../webgl/VertexElementDescriptor.js";class e extends o{static{this.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"]}static{this.GEOMETRY_LAYOUT=[new r("a_pos",2,i.SHORT,0,4)]}static{this.ATTRIBUTES_INFO={"fill-color":{name:"color",type:t.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:t.R8_UNSIGNED,precisionFactor:100},"fill-pattern":{name:"tlbr",type:t.R16G16B16A16_PATTERN,isOptional:!0}}}constructor(t){super(t)}geometryInfo(){return e.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return e.ATTRIBUTES}attributesInfo(){return e.ATTRIBUTES_INFO}}class l extends o{static{this.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"]}static{this.ATTRIBUTES_FILL=["fill-color","fill-opacity"]}static{this.GEOMETRY_LAYOUT=[new r("a_pos",2,i.SHORT,0,8),new r("a_offset",2,i.BYTE,4,8),new r("a_xnormal",2,i.BYTE,6,8)]}static{this.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:t.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:t.R8_UNSIGNED,precisionFactor:100}}}static{this.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:t.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:t.R8_UNSIGNED,precisionFactor:100}}}constructor(t,o){super(t),this._usefillColor=o}geometryInfo(){return l.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return this._usefillColor?l.ATTRIBUTES_FILL:l.ATTRIBUTES_OUTLINE}attributesInfo(){return this._usefillColor?l.ATTRIBUTES_INFO_FILL:l.ATTRIBUTES_INFO_OUTLINE}}export{e as VTLFillMaterial,l as VTLOutlineMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{EncodingType as e}from"./enums.js";import{VTLMaterial as t}from"./VTLMaterial.js";import{DataType as r}from"../../../../webgl/enums.js";import{VertexElementDescriptor as n}from"../../../../webgl/VertexElementDescriptor.js";class i extends t{constructor(e){super(e)}geometryInfo(){return i.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return i.ATTRIBUTES}attributesInfo(){return i.ATTRIBUTES_INFO}}i.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"],i.GEOMETRY_LAYOUT=[new n("a_pos",2,r.SHORT,0,16),new n("a_extrude_offset",4,r.BYTE,4,16),new n("a_dir_normal",4,r.BYTE,8,16),new n("a_accumulatedDistance",2,r.UNSIGNED_SHORT,12,16)],i.ATTRIBUTES_INFO={"line-width":{name:"width",type:e.R8_UNSIGNED,precisionFactor:2},"line-gap-width":{name:"gap_width",type:e.R8_UNSIGNED,precisionFactor:2},"line-offset":{name:"offset",type:e.R8_SIGNED,precisionFactor:2},"line-color":{name:"color",type:e.R8G8B8A8_COLOR},"line-opacity":{name:"opacity",type:e.R8_UNSIGNED,precisionFactor:100},"line-blur":{name:"blur",type:e.R8_UNSIGNED,precisionFactor:4},"line-pattern":{name:"tlbr",type:e.R16G16B16A16_PATTERN,isOptional:!0},"line-dasharray":{name:"tlbr",type:e.R16G16B16A16_DASHARRAY,isOptional:!0}};export{i as VTLLineMaterial};
5
+ import{EncodingType as e}from"./enums.js";import{VTLMaterial as t}from"./VTLMaterial.js";import{DataType as i}from"../../../../webgl/enums.js";import{VertexElementDescriptor as r}from"../../../../webgl/VertexElementDescriptor.js";class n extends t{static{this.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"]}static{this.GEOMETRY_LAYOUT=[new r("a_pos",2,i.SHORT,0,16),new r("a_extrude_offset",4,i.BYTE,4,16),new r("a_dir_normal",4,i.BYTE,8,16),new r("a_accumulatedDistance",2,i.UNSIGNED_SHORT,12,16)]}static{this.ATTRIBUTES_INFO={"line-width":{name:"width",type:e.R8_UNSIGNED,precisionFactor:2},"line-gap-width":{name:"gap_width",type:e.R8_UNSIGNED,precisionFactor:2},"line-offset":{name:"offset",type:e.R8_SIGNED,precisionFactor:2},"line-color":{name:"color",type:e.R8G8B8A8_COLOR},"line-opacity":{name:"opacity",type:e.R8_UNSIGNED,precisionFactor:100},"line-blur":{name:"blur",type:e.R8_UNSIGNED,precisionFactor:4},"line-pattern":{name:"tlbr",type:e.R16G16B16A16_PATTERN,isOptional:!0},"line-dasharray":{name:"tlbr",type:e.R16G16B16A16_DASHARRAY,isOptional:!0}}}constructor(e){super(e)}geometryInfo(){return n.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return n.ATTRIBUTES}attributesInfo(){return n.ATTRIBUTES_INFO}}export{n as VTLLineMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../MemoryBuffer.js";import{EncodingType as e,AttributeStatus as n}from"./enums.js";import{DataType as o}from"../../../../webgl/enums.js";import{VertexElementDescriptor as s}from"../../../../webgl/VertexElementDescriptor.js";class r{constructor(t){this._locations=new Map,this._key=t}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._layout||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return 0===this._locations.size&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layout||this._buildAttributesInfo(),this._layout}getEncodingInfos(){return this._propertyEncodingInfo||this._buildAttributesInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildAttributesInfo(),this._uniforms}getShaderHeader(){return this._shaderHeader||this._buildAttributesInfo(),this._shaderHeader}getShaderMain(){return this._shaderMain||this._buildAttributesInfo(),this._shaderMain}setDataUniforms(t,e,n,o,s){const r=this.getUniforms();for(const i of r){const{name:r,type:a,getValue:c}=i,u=c(n,e,o,s);if(null!==u)switch(a){case"float":t.setUniform1f(r,u);break;case"vec2":t.setUniform2fv(r,u);break;case"vec4":t.setUniform4fv(r,u)}}}encodeAttributes(t,n,o,s){const r=this.attributesInfo(),i=this.getEncodingInfos(),a=[];let c=0,u=0;for(const _ of Object.keys(i)){const l=i[_],{type:f,precisionFactor:h,isLayout:d}=r[_],y=d?o.getLayoutProperty(_):o.getPaintProperty(_),m=y.interpolator?.getInterpolationRange(n);let E=0;for(const o of l){const{offset:r,bufferElementsToAdd:i}=o;if(i>0){for(let t=0;t<i;t++)a.push(0);c+=u,u=o.bufferElementsToAdd}const _=s??y.getValue(m?m[E]:n,t);switch(f){case e.R8_SIGNED:case e.R8_UNSIGNED:a[c]|=this._encodeByte(_*(h||1),8*r);break;case e.R16_SIGNED:case e.R16_UNSIGNED:a[c]|=this._encodeShort(_*(h||1),8*r);break;case e.R8G8_SIGNED:case e.R8G8_UNSIGNED:a[c]|=this._encodeByte(_*(h||1),8*r),a[c]|=this._encodeByte(_*(h||1),8*r+8);break;case e.R16G16_SIGNED:case e.R16G16_UNSIGNED:a[c]|=this._encodeShort(_*(h||1),8*r),a[c]|=this._encodeShort(_*(h||1),8*r+16);break;case e.R8G8B8A8_SIGNED:case e.R8G8B8A8_UNSIGNED:a[c]|=this._encodeByte(_*(h||1),8*r),a[c]|=this._encodeByte(_*(h||1),8*r+8),a[c]|=this._encodeByte(_*(h||1),8*r+16),a[c]|=this._encodeByte(_*(h||1),8*r+24);break;case e.R8G8B8A8_COLOR:a[c]=this._encodeColor(_);break;case e.R16G16B16A16_DASHARRAY:case e.R16G16B16A16_PATTERN:this._encodePattern(c,a,_);break;default:throw new Error("Unsupported encoding type")}E++}}return a}getAtributeState(t){let e=0;const n=3+2*t;return e|=this._bit(n),e|=this._bit(n+1)<<1,e}_buildAttributesInfo(){const t=[],e={},s={};let i=-1;const a=this.attributesInfo(),c=this.attributes();let u=-1;for(const o of c){u++;const c=this.getAtributeState(u);if(c===n.UNIFORM||c===n.UNUSED)continue;const _=a[o],l=[];e[o]=l;const f=_.type;for(let e=0;e<c;e++){const{dataType:e,bytesPerElement:n,count:o,normalized:a}=r._encodingInfo[f],c=n*o,u=`${e}-${!0===a}`;let _=s[u],h=0;if(!_||_.count+o>4)i++,_={dataIndex:i,count:0,offset:0},4!==o&&(s[u]=_),t.push({location:-1,name:"a_data_"+i,count:o,type:e,normalized:a}),h=Math.ceil(Math.max(c/4,1));else{const e=t[_.dataIndex];e.count+=o;h=Math.ceil(Math.max(e.count*n/4,1))-Math.ceil(Math.max(_.offset/4,1))}l.push({dataIndex:_.dataIndex,offset:_.offset,bufferElementsToAdd:h}),_.offset+=c,_.count+=o}}for(const n of t)switch(n.type){case o.BYTE:case o.UNSIGNED_BYTE:n.count=4;break;case o.SHORT:case o.UNSIGNED_SHORT:n.count+=n.count%2}this._buildVertexBufferLayout(t);let _=0;const l=this._layout.get("geometry");for(const n of l)this._locations.set(n.name,_++);const f=this._layout.get("opacity");if(f)for(const n of f)this._locations.set(n.name,_++);this._buildShaderInfo(t,e),this._propertyEncodingInfo=e}_buildVertexBufferLayout(t){const e=new Map,n=this.geometryInfo();let o=n[0].stride;if(0===t.length)e.set("geometry",n);else{const r=[];let a=o;for(const e of t)o+=i(e.type)*e.count;for(const t of n)r.push(new s(t.name,t.count,t.type,t.offset,o,t.normalized));for(const e of t)r.push(new s(e.name,e.count,e.type,a,o,e.normalized)),a+=i(e.type)*e.count;e.set("geometry",r)}const r=this.opacityInfo();r&&e.set("opacity",r),this._layout=e,this._stride=o}_buildShaderInfo(t,o){let s="\n",i="\n";const c=[];for(const e of t)s+=`attribute ${this._getType(e.count)} ${e.name};\n`;const u=this.attributes(),_=this.attributesInfo();let l=-1;for(const f of u){l++;const{name:t,type:u,precisionFactor:h,isLayout:d}=_[f],y=h&&1!==h?" * "+1/h:"",{bytesPerElement:m,count:E}=r._encodingInfo[u],I=t=>`a_data_${t.dataIndex}${a(E,t.offset,m)}`;switch(this.getAtributeState(l)){case n.UNIFORM:{const n=this._getType(E),o=`u_${t}`;c.push({name:o,type:n,getValue:(t,n,o,s)=>{const r=d?t.getLayoutValue(f,n):t.getPaintValue(f,n);if(u===e.R16G16B16A16_DASHARRAY){const e=t.getDashKey(r,t.getLayoutValue("line-cap",n)),o=s.getMosaicItemPosition(e,!1);if(null==o)return null;const{tl:i,br:a}=o;return[i[0],a[1],a[0],i[1]]}if(u===e.R16G16B16A16_PATTERN){const t=s.getMosaicItemPosition(r,!f.includes("line-"));if(null==t)return null;const{tl:e,br:n}=t;return[e[0],n[1],n[0],e[1]]}if(u===e.R8G8B8A8_COLOR){const t=r[3];return[t*r[0],t*r[1],t*r[2],t]}return r}}),s+=`uniform ${n} ${o};\n`,i+=`${n} ${t} = ${o};\n`}break;case n.DATA_DRIVEN:{const e=I(o[f][0]);i+=`${this._getType(E)} ${t} = ${e}${y};\n`}break;case n.INTERPOLATED_DATA_DRIVEN:{const e=`u_t_${t}`;c.push({name:e,type:"float",getValue:(t,e,n,o)=>(d?t.getLayoutProperty(f):t.getPaintProperty(f)).interpolator.interpolationUniformValue(n,e)}),s+=`uniform float ${e};\n`;const n=I(o[f][0]),r=I(o[f][1]);i+=`${this._getType(E)} ${t} = mix(${n}${y}, ${r}${y}, ${e});\n`}}}this._shaderHeader=s,this._shaderMain=i,this._uniforms=c}_bit(t){return(this._key&1<<t)>>t}_getType(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4"}throw new Error("Invalid count")}_encodeColor(e){const n=255*e[3];return t.i8888to32(e[0]*n,e[1]*n,e[2]*n,n)}_encodePattern(t,e,n){if(!n?.rect)return;const o=2,s=n.rect,r=n.width,i=n.height;e[t]=this._encodeShort(s.x+o,0),e[t]|=this._encodeShort(s.y+o+i,16),e[t+1]=this._encodeShort(s.x+o+r,0),e[t+1]|=this._encodeShort(s.y+o,16)}_encodeByte(t,e){return(255&t)<<e}_encodeShort(t,e){return(65535&t)<<e}}r._encodingInfo={[e.R8_SIGNED]:{dataType:o.BYTE,bytesPerElement:1,count:1,normalized:!1},[e.R8_UNSIGNED]:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:1,normalized:!1},[e.R16_SIGNED]:{dataType:o.SHORT,bytesPerElement:2,count:1,normalized:!1},[e.R16_UNSIGNED]:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:1,normalized:!1},[e.R8G8_SIGNED]:{dataType:o.BYTE,bytesPerElement:1,count:2,normalized:!1},[e.R8G8_UNSIGNED]:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:2,normalized:!1},[e.R16G16_SIGNED]:{dataType:o.SHORT,bytesPerElement:2,count:2,normalized:!1},[e.R16G16_UNSIGNED]:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:2,normalized:!1},[e.R8G8B8A8_SIGNED]:{dataType:o.BYTE,bytesPerElement:1,count:4,normalized:!1},[e.R8G8B8A8_UNSIGNED]:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:4,normalized:!1},[e.R8G8B8A8_COLOR]:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:4,normalized:!0},[e.R16G16B16A16_DASHARRAY]:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:4,normalized:!1},[e.R16G16B16A16_PATTERN]:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:4,normalized:!1}};const i=t=>{switch(t){case o.FLOAT:case o.INT:case o.UNSIGNED_INT:return 4;case o.SHORT:case o.UNSIGNED_SHORT:case o.HALF_FLOAT:return 2;case o.BYTE:case o.UNSIGNED_BYTE:return 1}},a=(t,e,n)=>{const o=e/n;if(1===t)switch(o){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(2===t)switch(o){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(3===t)switch(o){case 0:return".xyz";case 1:return".yzw"}return""};export{r as VTLMaterial};
5
+ import t from"../MemoryBuffer.js";import{EncodingType as e,AttributeStatus as n}from"./enums.js";import{DataType as o}from"../../../../webgl/enums.js";import{VertexElementDescriptor as s}from"../../../../webgl/VertexElementDescriptor.js";class r{constructor(t){this._locations=new Map,this._key=t}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._layout||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return 0===this._locations.size&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layout||this._buildAttributesInfo(),this._layout}getEncodingInfos(){return this._propertyEncodingInfo||this._buildAttributesInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildAttributesInfo(),this._uniforms}getShaderHeader(){return this._shaderHeader||this._buildAttributesInfo(),this._shaderHeader}getShaderMain(){return this._shaderMain||this._buildAttributesInfo(),this._shaderMain}setDataUniforms(t,e,n,o,s){const r=this.getUniforms();for(const i of r){const{name:r,type:a,getValue:c}=i,u=c(n,e,o,s);if(null!==u)switch(a){case"float":t.setUniform1f(r,u);break;case"vec2":t.setUniform2fv(r,u);break;case"vec4":t.setUniform4fv(r,u)}}}encodeAttributes(t,n,o,s){const r=this.attributesInfo(),i=this.getEncodingInfos(),a=[];let c=0,u=0;for(const _ of Object.keys(i)){const h=i[_],{type:l,precisionFactor:f,isLayout:d}=r[_],y=d?o.getLayoutProperty(_):o.getPaintProperty(_),m=y.interpolator?.getInterpolationRange(n);let E=0;for(const o of h){const{offset:r,bufferElementsToAdd:i}=o;if(i>0){for(let t=0;t<i;t++)a.push(0);c+=u,u=o.bufferElementsToAdd}const _=s??y.getValue(m?m[E]:n,t);switch(l){case e.R8_SIGNED:case e.R8_UNSIGNED:a[c]|=this._encodeByte(_*(f||1),8*r);break;case e.R16_SIGNED:case e.R16_UNSIGNED:a[c]|=this._encodeShort(_*(f||1),8*r);break;case e.R8G8_SIGNED:case e.R8G8_UNSIGNED:a[c]|=this._encodeByte(_*(f||1),8*r),a[c]|=this._encodeByte(_*(f||1),8*r+8);break;case e.R16G16_SIGNED:case e.R16G16_UNSIGNED:a[c]|=this._encodeShort(_*(f||1),8*r),a[c]|=this._encodeShort(_*(f||1),8*r+16);break;case e.R8G8B8A8_SIGNED:case e.R8G8B8A8_UNSIGNED:a[c]|=this._encodeByte(_*(f||1),8*r),a[c]|=this._encodeByte(_*(f||1),8*r+8),a[c]|=this._encodeByte(_*(f||1),8*r+16),a[c]|=this._encodeByte(_*(f||1),8*r+24);break;case e.R8G8B8A8_COLOR:a[c]=this._encodeColor(_);break;case e.R16G16B16A16_DASHARRAY:case e.R16G16B16A16_PATTERN:this._encodePattern(c,a,_);break;default:throw new Error("Unsupported encoding type")}E++}}return a}getAtributeState(t){let e=0;const n=3+2*t;return e|=this._bit(n),e|=this._bit(n+1)<<1,e}static{this._encodingInfo={[e.R8_SIGNED]:{dataType:o.BYTE,bytesPerElement:1,count:1,normalized:!1},[e.R8_UNSIGNED]:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:1,normalized:!1},[e.R16_SIGNED]:{dataType:o.SHORT,bytesPerElement:2,count:1,normalized:!1},[e.R16_UNSIGNED]:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:1,normalized:!1},[e.R8G8_SIGNED]:{dataType:o.BYTE,bytesPerElement:1,count:2,normalized:!1},[e.R8G8_UNSIGNED]:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:2,normalized:!1},[e.R16G16_SIGNED]:{dataType:o.SHORT,bytesPerElement:2,count:2,normalized:!1},[e.R16G16_UNSIGNED]:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:2,normalized:!1},[e.R8G8B8A8_SIGNED]:{dataType:o.BYTE,bytesPerElement:1,count:4,normalized:!1},[e.R8G8B8A8_UNSIGNED]:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:4,normalized:!1},[e.R8G8B8A8_COLOR]:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:4,normalized:!0},[e.R16G16B16A16_DASHARRAY]:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:4,normalized:!1},[e.R16G16B16A16_PATTERN]:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:4,normalized:!1}}}_buildAttributesInfo(){const t=[],e={},s={};let i=-1;const a=this.attributesInfo(),c=this.attributes();let u=-1;for(const o of c){u++;const c=this.getAtributeState(u);if(c===n.UNIFORM||c===n.UNUSED)continue;const _=a[o],h=[];e[o]=h;const l=_.type;for(let e=0;e<c;e++){const{dataType:e,bytesPerElement:n,count:o,normalized:a}=r._encodingInfo[l],c=n*o,u=`${e}-${!0===a}`;let _=s[u],f=0;if(!_||_.count+o>4)i++,_={dataIndex:i,count:0,offset:0},4!==o&&(s[u]=_),t.push({location:-1,name:"a_data_"+i,count:o,type:e,normalized:a}),f=Math.ceil(Math.max(c/4,1));else{const e=t[_.dataIndex];e.count+=o;f=Math.ceil(Math.max(e.count*n/4,1))-Math.ceil(Math.max(_.offset/4,1))}h.push({dataIndex:_.dataIndex,offset:_.offset,bufferElementsToAdd:f}),_.offset+=c,_.count+=o}}for(const n of t)switch(n.type){case o.BYTE:case o.UNSIGNED_BYTE:n.count=4;break;case o.SHORT:case o.UNSIGNED_SHORT:n.count+=n.count%2}this._buildVertexBufferLayout(t);let _=0;const h=this._layout.get("geometry");for(const n of h)this._locations.set(n.name,_++);const l=this._layout.get("opacity");if(l)for(const n of l)this._locations.set(n.name,_++);this._buildShaderInfo(t,e),this._propertyEncodingInfo=e}_buildVertexBufferLayout(t){const e=new Map,n=this.geometryInfo();let o=n[0].stride;if(0===t.length)e.set("geometry",n);else{const r=[];let a=o;for(const e of t)o+=i(e.type)*e.count;for(const t of n)r.push(new s(t.name,t.count,t.type,t.offset,o,t.normalized));for(const e of t)r.push(new s(e.name,e.count,e.type,a,o,e.normalized)),a+=i(e.type)*e.count;e.set("geometry",r)}const r=this.opacityInfo();r&&e.set("opacity",r),this._layout=e,this._stride=o}_buildShaderInfo(t,o){let s="\n",i="\n";const c=[];for(const e of t)s+=`attribute ${this._getType(e.count)} ${e.name};\n`;const u=this.attributes(),_=this.attributesInfo();let h=-1;for(const l of u){h++;const{name:t,type:u,precisionFactor:f,isLayout:d}=_[l],y=f&&1!==f?" * "+1/f:"",{bytesPerElement:m,count:E}=r._encodingInfo[u],I=t=>`a_data_${t.dataIndex}${a(E,t.offset,m)}`;switch(this.getAtributeState(h)){case n.UNIFORM:{const n=this._getType(E),o=`u_${t}`;c.push({name:o,type:n,getValue:(t,n,o,s)=>{const r=d?t.getLayoutValue(l,n):t.getPaintValue(l,n);if(u===e.R16G16B16A16_DASHARRAY){const e=t.getDashKey(r,t.getLayoutValue("line-cap",n)),o=s.getMosaicItemPosition(e,!1);if(null==o)return null;const{tl:i,br:a}=o;return[i[0],a[1],a[0],i[1]]}if(u===e.R16G16B16A16_PATTERN){const t=s.getMosaicItemPosition(r,!l.includes("line-"));if(null==t)return null;const{tl:e,br:n}=t;return[e[0],n[1],n[0],e[1]]}if(u===e.R8G8B8A8_COLOR){const t=r[3];return[t*r[0],t*r[1],t*r[2],t]}return r}}),s+=`uniform ${n} ${o};\n`,i+=`${n} ${t} = ${o};\n`}break;case n.DATA_DRIVEN:{const e=I(o[l][0]);i+=`${this._getType(E)} ${t} = ${e}${y};\n`}break;case n.INTERPOLATED_DATA_DRIVEN:{const e=`u_t_${t}`;c.push({name:e,type:"float",getValue:(t,e,n,o)=>(d?t.getLayoutProperty(l):t.getPaintProperty(l)).interpolator.interpolationUniformValue(n,e)}),s+=`uniform float ${e};\n`;const n=I(o[l][0]),r=I(o[l][1]);i+=`${this._getType(E)} ${t} = mix(${n}${y}, ${r}${y}, ${e});\n`}}}this._shaderHeader=s,this._shaderMain=i,this._uniforms=c}_bit(t){return(this._key&1<<t)>>t}_getType(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4"}throw new Error("Invalid count")}_encodeColor(e){const n=255*e[3];return t.i8888to32(e[0]*n,e[1]*n,e[2]*n,n)}_encodePattern(t,e,n){if(!n?.rect)return;const o=2,s=n.rect,r=n.width,i=n.height;e[t]=this._encodeShort(s.x+o,0),e[t]|=this._encodeShort(s.y+o+i,16),e[t+1]=this._encodeShort(s.x+o+r,0),e[t+1]|=this._encodeShort(s.y+o,16)}_encodeByte(t,e){return(255&t)<<e}_encodeShort(t,e){return(65535&t)<<e}}const i=t=>{switch(t){case o.FLOAT:case o.INT:case o.UNSIGNED_INT:return 4;case o.SHORT:case o.UNSIGNED_SHORT:case o.HALF_FLOAT:return 2;case o.BYTE:case o.UNSIGNED_BYTE:return 1}},a=(t,e,n)=>{const o=e/n;if(1===t)switch(o){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(2===t)switch(o){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(3===t)switch(o){case 0:return".xyz";case 1:return".yzw"}return""};export{r as VTLMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{EncodingType as o}from"./enums.js";import{VTLMaterial as t}from"./VTLMaterial.js";import{DataType as e}from"../../../../webgl/enums.js";import{VertexElementDescriptor as r}from"../../../../webgl/VertexElementDescriptor.js";const a=[new r("a_pos",2,e.SHORT,0,16),new r("a_vertexOffset",2,e.SHORT,4,16),new r("a_texAngleRange",4,e.UNSIGNED_BYTE,8,16),new r("a_levelInfo",4,e.UNSIGNED_BYTE,12,16)],n=[new r("a_opacityInfo",1,e.UNSIGNED_BYTE,0,1)];class i extends t{constructor(o){super(o)}geometryInfo(){return a}opacityInfo(){return n}attributes(){return i.ATTRIBUTES}attributesInfo(){return i.ATTRIBUTES_INFO}}i.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"],i.ATTRIBUTES_INFO={"icon-color":{name:"color",type:o.R8G8B8A8_COLOR},"icon-opacity":{name:"opacity",type:o.R8_UNSIGNED,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:o.R8G8B8A8_COLOR},"icon-halo-width":{name:"halo_width",type:o.R8_UNSIGNED,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:o.R8_UNSIGNED,precisionFactor:4},"icon-size":{name:"size",type:o.R8_UNSIGNED,precisionFactor:32,isLayout:!0}};class c extends t{constructor(o){super(o)}geometryInfo(){return a}opacityInfo(){return n}attributes(){return c.ATTRIBUTES}attributesInfo(){return c.ATTRIBUTES_INFO}}c.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"],c.ATTRIBUTES_INFO={"text-color":{name:"color",type:o.R8G8B8A8_COLOR},"text-opacity":{name:"opacity",type:o.R8_UNSIGNED,precisionFactor:100},"text-halo-color":{name:"halo_color",type:o.R8G8B8A8_COLOR},"text-halo-width":{name:"halo_width",type:o.R8_UNSIGNED,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:o.R8_UNSIGNED,precisionFactor:4},"text-size":{name:"size",type:o.R8_UNSIGNED,isLayout:!0}};export{i as VTLIconMaterial,c as VTLTextMaterial};
5
+ import{EncodingType as t}from"./enums.js";import{VTLMaterial as o}from"./VTLMaterial.js";import{DataType as e}from"../../../../webgl/enums.js";import{VertexElementDescriptor as r}from"../../../../webgl/VertexElementDescriptor.js";const i=[new r("a_pos",2,e.SHORT,0,16),new r("a_vertexOffset",2,e.SHORT,4,16),new r("a_texAngleRange",4,e.UNSIGNED_BYTE,8,16),new r("a_levelInfo",4,e.UNSIGNED_BYTE,12,16)],a=[new r("a_opacityInfo",1,e.UNSIGNED_BYTE,0,1)];class n extends o{static{this.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"]}static{this.ATTRIBUTES_INFO={"icon-color":{name:"color",type:t.R8G8B8A8_COLOR},"icon-opacity":{name:"opacity",type:t.R8_UNSIGNED,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:t.R8G8B8A8_COLOR},"icon-halo-width":{name:"halo_width",type:t.R8_UNSIGNED,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:t.R8_UNSIGNED,precisionFactor:4},"icon-size":{name:"size",type:t.R8_UNSIGNED,precisionFactor:32,isLayout:!0}}}constructor(t){super(t)}geometryInfo(){return i}opacityInfo(){return a}attributes(){return n.ATTRIBUTES}attributesInfo(){return n.ATTRIBUTES_INFO}}class c extends o{static{this.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"]}static{this.ATTRIBUTES_INFO={"text-color":{name:"color",type:t.R8G8B8A8_COLOR},"text-opacity":{name:"opacity",type:t.R8_UNSIGNED,precisionFactor:100},"text-halo-color":{name:"halo_color",type:t.R8G8B8A8_COLOR},"text-halo-width":{name:"halo_width",type:t.R8_UNSIGNED,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:t.R8_UNSIGNED,precisionFactor:4},"text-size":{name:"size",type:t.R8_UNSIGNED,isLayout:!0}}}constructor(t){super(t)}geometryInfo(){return i}opacityInfo(){return a}attributes(){return c.ATTRIBUTES}attributesInfo(){return c.ATTRIBUTES_INFO}}export{n as VTLIconMaterial,c as VTLTextMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{CapType as e,JoinType as t}from"../../../../../symbols/cim/enums.js";var a,i,n,l,u,m,o,r,p;!function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.FILL=1]="FILL",e[e.LINE=2]="LINE",e[e.SYMBOL=3]="SYMBOL",e[e.CIRCLE=4]="CIRCLE"}(a||(a={})),function(e){e[e.VISIBLE=0]="VISIBLE",e[e.NONE=1]="NONE"}(i||(i={})),function(e){e[e.POINT=0]="POINT",e[e.LINE=1]="LINE",e[e.LINE_CENTER=2]="LINE_CENTER"}(n||(n={})),function(e){e[e.MAP=0]="MAP",e[e.VIEWPORT=1]="VIEWPORT",e[e.AUTO=2]="AUTO"}(l||(l={})),function(e){e[e.AUTO=0]="AUTO",e[e.LEFT=1]="LEFT",e[e.CENTER=2]="CENTER",e[e.RIGHT=3]="RIGHT"}(u||(u={})),function(e){e[e.CENTER=0]="CENTER",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.TOP=3]="TOP",e[e.BOTTOM=4]="BOTTOM",e[e.TOP_LEFT=5]="TOP_LEFT",e[e.TOP_RIGHT=6]="TOP_RIGHT",e[e.BOTTOM_LEFT=7]="BOTTOM_LEFT",e[e.BOTTOM_RIGHT=8]="BOTTOM_RIGHT"}(m||(m={})),function(e){e[e.NONE=0]="NONE",e[e.UPPERCASE=1]="UPPERCASE",e[e.LOWERCASE=2]="LOWERCASE"}(o||(o={})),function(e){e[e.MAP=0]="MAP",e[e.VIEWPORT=1]="VIEWPORT"}(r||(r={})),function(e){e[e.HORIZONTAL=0]="HORIZONTAL",e[e.VERTICAL=1]="VERTICAL"}(p||(p={}));class f{}f.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:i.VISIBLE}},f.fillLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:i.VISIBLE}},f.lineLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:i.VISIBLE},"line-cap":{type:"enum",values:["butt","round","square"],default:e.BUTT},"line-join":{type:"enum",values:["bevel","round","miter"],default:t.MITER},"line-miter-limit":{type:"number",default:2},"line-round-limit":{type:"number",default:1.05}},f.symbolLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:i.VISIBLE},"symbol-avoid-edges":{type:"boolean",default:!1},"symbol-placement":{type:"enum",values:["point","line","line-center"],default:n.POINT},"symbol-sort-key":{type:"number",default:-1},"symbol-spacing":{type:"number",minimum:1,default:250},"icon-allow-overlap":{type:"boolean",default:!1},"icon-anchor":{type:"enum",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:m.CENTER},"icon-ignore-placement":{type:"boolean",default:!1},"icon-image":{type:"string"},"icon-keep-upright":{type:"boolean",default:!1},"icon-offset":{type:"array",value:"number",length:2,default:[0,0]},"icon-optional":{type:"boolean",default:!1},"icon-padding":{type:"number",minimum:0,default:2},"icon-rotate":{type:"number",default:0},"icon-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:l.AUTO},"icon-size":{type:"number",minimum:0,default:1},"text-allow-overlap":{type:"boolean",default:!1},"text-anchor":{type:"enum",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:m.CENTER},"text-field":{type:"string"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"]},"text-ignore-placement":{type:"boolean",default:!1},"text-justify":{type:"enum",values:["auto","left","center","right"],default:u.CENTER},"text-keep-upright":{type:"boolean",default:!0},"text-letter-spacing":{type:"number",default:0},"text-line-height":{type:"number",default:1.2},"text-max-angle":{type:"number",minimum:0,default:45},"text-max-width":{type:"number",minimum:0,default:10},"text-offset":{type:"array",value:"number",length:2,default:[0,0]},"text-optional":{type:"boolean",default:!1},"text-padding":{type:"number",minimum:0,default:2},"text-rotate":{type:"number",default:0},"text-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:l.AUTO},"text-size":{type:"number",minimum:0,default:16},"text-transform":{type:"enum",values:["none","uppercase","lowercase"],default:o.NONE},"text-writing-mode":{type:"array",value:"enum",values:["horizontal","vertical"],default:[p.HORIZONTAL]}},f.circleLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:i.VISIBLE}},f.backgroundPaintDefinition={"background-color":{type:"color",default:[0,0,0,1]},"background-opacity":{type:"number",minimum:0,maximum:1,default:1},"background-pattern":{type:"string"}},f.fillPaintDefinition={"fill-antialias":{type:"boolean",default:!0},"fill-color":{type:"color",default:[0,0,0,1]},"fill-opacity":{type:"number",minimum:0,maximum:1,default:1},"fill-outline-color":{type:"color",default:[0,0,0,0]},"fill-pattern":{type:"string"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0]},"fill-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP}},f.linePaintDefinition={"line-blur":{type:"number",minimum:0,default:0},"line-color":{type:"color",default:[0,0,0,1]},"line-dasharray":{type:"array",value:"number",default:[]},"line-gap-width":{type:"number",minimum:0,default:0},"line-offset":{type:"number",default:0},"line-opacity":{type:"number",minimum:0,maximum:1,default:1},"line-pattern":{type:"string"},"line-translate":{type:"array",value:"number",length:2,default:[0,0]},"line-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP},"line-width":{type:"number",minimum:0,default:1}},f.symbolPaintDefinition={"icon-color":{type:"color",default:[0,0,0,1]},"icon-halo-blur":{type:"number",minimum:0,default:0},"icon-halo-color":{type:"color",default:[0,0,0,0]},"icon-halo-width":{type:"number",minimum:0,default:0},"icon-opacity":{type:"number",minimum:0,maximum:1,default:1},"icon-translate":{type:"array",value:"number",length:2,default:[0,0]},"icon-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP},"text-color":{type:"color",default:[0,0,0,1]},"text-halo-blur":{type:"number",minimum:0,default:0},"text-halo-color":{type:"color",default:[0,0,0,0]},"text-halo-width":{type:"number",minimum:0,default:0},"text-opacity":{type:"number",minimum:0,maximum:1,default:1},"text-translate":{type:"array",value:"number",length:2,default:[0,0]},"text-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP}},f.rasterPaintDefinition={"raster-opacity":{type:"number",minimum:0,maximum:1,default:1},"raster-hue-rotate":{type:"number",default:0},"raster-brightness-min":{type:"number",minimum:0,maximum:1,default:0},"raster-brightness-max":{type:"number",minimum:0,maximum:1,default:1},"raster-saturation":{type:"number",minimum:-1,maximum:1,default:0},"raster-contrast":{type:"number",minimum:-1,maximum:1,default:0},"raster-fade-duration":{type:"number",minimum:0,default:300}},f.circlePaintDefinition={"circle-blur":{type:"number",minimum:0,default:0},"circle-color":{type:"color",default:[0,0,0,1]},"circle-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-radius":{type:"number",minimum:0,default:5},"circle-stroke-color":{type:"color",default:[0,0,0,1]},"circle-stroke-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-stroke-width":{type:"number",minimum:0,default:0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0]},"circle-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP}};export{l as RotationAlignment,f as StyleDefinition,a as StyleLayerType,m as SymbolAnchor,n as SymbolPlacement,u as TextJustification,o as TextTransform,p as TextWritingMode,r as TranslateAnchor,i as Visibility};
5
+ import{CapType as e,JoinType as t}from"../../../../../symbols/cim/enums.js";var i,a,n,l,u,m,o,r,p;!function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.FILL=1]="FILL",e[e.LINE=2]="LINE",e[e.SYMBOL=3]="SYMBOL",e[e.CIRCLE=4]="CIRCLE"}(i||(i={})),function(e){e[e.VISIBLE=0]="VISIBLE",e[e.NONE=1]="NONE"}(a||(a={})),function(e){e[e.POINT=0]="POINT",e[e.LINE=1]="LINE",e[e.LINE_CENTER=2]="LINE_CENTER"}(n||(n={})),function(e){e[e.MAP=0]="MAP",e[e.VIEWPORT=1]="VIEWPORT",e[e.AUTO=2]="AUTO"}(l||(l={})),function(e){e[e.AUTO=0]="AUTO",e[e.LEFT=1]="LEFT",e[e.CENTER=2]="CENTER",e[e.RIGHT=3]="RIGHT"}(u||(u={})),function(e){e[e.CENTER=0]="CENTER",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.TOP=3]="TOP",e[e.BOTTOM=4]="BOTTOM",e[e.TOP_LEFT=5]="TOP_LEFT",e[e.TOP_RIGHT=6]="TOP_RIGHT",e[e.BOTTOM_LEFT=7]="BOTTOM_LEFT",e[e.BOTTOM_RIGHT=8]="BOTTOM_RIGHT"}(m||(m={})),function(e){e[e.NONE=0]="NONE",e[e.UPPERCASE=1]="UPPERCASE",e[e.LOWERCASE=2]="LOWERCASE"}(o||(o={})),function(e){e[e.MAP=0]="MAP",e[e.VIEWPORT=1]="VIEWPORT"}(r||(r={})),function(e){e[e.HORIZONTAL=0]="HORIZONTAL",e[e.VERTICAL=1]="VERTICAL"}(p||(p={}));class f{static{this.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.VISIBLE}}}static{this.fillLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.VISIBLE}}}static{this.lineLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.VISIBLE},"line-cap":{type:"enum",values:["butt","round","square"],default:e.BUTT},"line-join":{type:"enum",values:["bevel","round","miter"],default:t.MITER},"line-miter-limit":{type:"number",default:2},"line-round-limit":{type:"number",default:1.05}}}static{this.symbolLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.VISIBLE},"symbol-avoid-edges":{type:"boolean",default:!1},"symbol-placement":{type:"enum",values:["point","line","line-center"],default:n.POINT},"symbol-sort-key":{type:"number",default:-1},"symbol-spacing":{type:"number",minimum:1,default:250},"icon-allow-overlap":{type:"boolean",default:!1},"icon-anchor":{type:"enum",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:m.CENTER},"icon-ignore-placement":{type:"boolean",default:!1},"icon-image":{type:"string"},"icon-keep-upright":{type:"boolean",default:!1},"icon-offset":{type:"array",value:"number",length:2,default:[0,0]},"icon-optional":{type:"boolean",default:!1},"icon-padding":{type:"number",minimum:0,default:2},"icon-rotate":{type:"number",default:0},"icon-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:l.AUTO},"icon-size":{type:"number",minimum:0,default:1},"text-allow-overlap":{type:"boolean",default:!1},"text-anchor":{type:"enum",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:m.CENTER},"text-field":{type:"string"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"]},"text-ignore-placement":{type:"boolean",default:!1},"text-justify":{type:"enum",values:["auto","left","center","right"],default:u.CENTER},"text-keep-upright":{type:"boolean",default:!0},"text-letter-spacing":{type:"number",default:0},"text-line-height":{type:"number",default:1.2},"text-max-angle":{type:"number",minimum:0,default:45},"text-max-width":{type:"number",minimum:0,default:10},"text-offset":{type:"array",value:"number",length:2,default:[0,0]},"text-optional":{type:"boolean",default:!1},"text-padding":{type:"number",minimum:0,default:2},"text-rotate":{type:"number",default:0},"text-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:l.AUTO},"text-size":{type:"number",minimum:0,default:16},"text-transform":{type:"enum",values:["none","uppercase","lowercase"],default:o.NONE},"text-writing-mode":{type:"array",value:"enum",values:["horizontal","vertical"],default:[p.HORIZONTAL]}}}static{this.circleLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.VISIBLE}}}static{this.backgroundPaintDefinition={"background-color":{type:"color",default:[0,0,0,1]},"background-opacity":{type:"number",minimum:0,maximum:1,default:1},"background-pattern":{type:"string"}}}static{this.fillPaintDefinition={"fill-antialias":{type:"boolean",default:!0},"fill-color":{type:"color",default:[0,0,0,1]},"fill-opacity":{type:"number",minimum:0,maximum:1,default:1},"fill-outline-color":{type:"color",default:[0,0,0,0]},"fill-pattern":{type:"string"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0]},"fill-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP}}}static{this.linePaintDefinition={"line-blur":{type:"number",minimum:0,default:0},"line-color":{type:"color",default:[0,0,0,1]},"line-dasharray":{type:"array",value:"number",default:[]},"line-gap-width":{type:"number",minimum:0,default:0},"line-offset":{type:"number",default:0},"line-opacity":{type:"number",minimum:0,maximum:1,default:1},"line-pattern":{type:"string"},"line-translate":{type:"array",value:"number",length:2,default:[0,0]},"line-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP},"line-width":{type:"number",minimum:0,default:1}}}static{this.symbolPaintDefinition={"icon-color":{type:"color",default:[0,0,0,1]},"icon-halo-blur":{type:"number",minimum:0,default:0},"icon-halo-color":{type:"color",default:[0,0,0,0]},"icon-halo-width":{type:"number",minimum:0,default:0},"icon-opacity":{type:"number",minimum:0,maximum:1,default:1},"icon-translate":{type:"array",value:"number",length:2,default:[0,0]},"icon-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP},"text-color":{type:"color",default:[0,0,0,1]},"text-halo-blur":{type:"number",minimum:0,default:0},"text-halo-color":{type:"color",default:[0,0,0,0]},"text-halo-width":{type:"number",minimum:0,default:0},"text-opacity":{type:"number",minimum:0,maximum:1,default:1},"text-translate":{type:"array",value:"number",length:2,default:[0,0]},"text-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP}}}static{this.rasterPaintDefinition={"raster-opacity":{type:"number",minimum:0,maximum:1,default:1},"raster-hue-rotate":{type:"number",default:0},"raster-brightness-min":{type:"number",minimum:0,maximum:1,default:0},"raster-brightness-max":{type:"number",minimum:0,maximum:1,default:1},"raster-saturation":{type:"number",minimum:-1,maximum:1,default:0},"raster-contrast":{type:"number",minimum:-1,maximum:1,default:0},"raster-fade-duration":{type:"number",minimum:0,default:300}}}static{this.circlePaintDefinition={"circle-blur":{type:"number",minimum:0,default:0},"circle-color":{type:"color",default:[0,0,0,1]},"circle-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-radius":{type:"number",minimum:0,default:5},"circle-stroke-color":{type:"color",default:[0,0,0,1]},"circle-stroke-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-stroke-width":{type:"number",minimum:0,default:0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0]},"circle-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP}}}}export{l as RotationAlignment,f as StyleDefinition,i as StyleLayerType,m as SymbolAnchor,n as SymbolPlacement,u as TextJustification,o as TextTransform,p as TextWritingMode,r as TranslateAnchor,a as Visibility};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"./DisplayRecord.js";import{serializeList as r,deserializeList as i}from"./util/serializationUtils.js";class s{constructor(t,r){this.id=t,this.sortKey=r,this.records=[]}serialize(t){return t.push(this.id),t.writeF32(this.sortKey),r(t,this.records),t}static deserialize(r){const e=r.readInt32(),o=r.readF32(),a=new s(e,o);return a.records=i(r,t)??[],a}}s.byteSizeHint=2*Uint32Array.BYTES_PER_ELEMENT+t.byteSizeHint;export{s as default};
5
+ import t from"./DisplayRecord.js";import{serializeList as i,deserializeList as r}from"./util/serializationUtils.js";class s{static{this.byteSizeHint=2*Uint32Array.BYTES_PER_ELEMENT+t.byteSizeHint}constructor(t,i){this.id=t,this.sortKey=i,this.records=[]}serialize(t){return t.push(this.id),t.writeF32(this.sortKey),i(t,this.records),t}static deserialize(i){const e=i.readInt32(),o=i.readF32(),a=new s(e,o);return a.records=r(i,t)??[],a}}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/4.33/esri/copyright.txt for details.
4
4
  */
5
- class t{constructor(t,e,s,r,i,h,n){this.instanceId=t,this.textureKey=e,this.indexStart=s,this.indexCount=r,this.vertexStart=i,this.vertexCount=h,this.overlaps=n}updateBaseOffsets(t){this.vertexStart+=t.vertexFrom,this.indexStart+=t.indexFrom}clone(){return new t(this.instanceId,this.textureKey,this.indexStart,this.indexCount,this.vertexStart,this.vertexCount,this.overlaps)}static write(t,e,s,r,i,h,n,a){t.push(e),t.push(s),t.push(r),t.push(i),t.push(h),t.push(n),t.push(a)}serialize(t){return t.push(this.instanceId),t.push(this.textureKey),t.push(this.indexStart),t.push(this.indexCount),t.push(this.vertexStart),t.push(this.vertexCount),t.push(this.overlaps),t}static deserialize(e){const s=e.readInt32(),r=e.readInt32(),i=e.readInt32(),h=e.readInt32(),n=e.readInt32(),a=e.readInt32(),u=e.readInt32();return new t(s,r,i,h,n,a,u)}}t.byteSizeHint=7*Uint32Array.BYTES_PER_ELEMENT;export{t as default};
5
+ class t{static{this.byteSizeHint=7*Uint32Array.BYTES_PER_ELEMENT}constructor(t,e,s,i,r,h,n){this.instanceId=t,this.textureKey=e,this.indexStart=s,this.indexCount=i,this.vertexStart=r,this.vertexCount=h,this.overlaps=n}updateBaseOffsets(t){this.vertexStart+=t.vertexFrom,this.indexStart+=t.indexFrom}clone(){return new t(this.instanceId,this.textureKey,this.indexStart,this.indexCount,this.vertexStart,this.vertexCount,this.overlaps)}static write(t,e,s,i,r,h,n,a){t.push(e),t.push(s),t.push(i),t.push(r),t.push(h),t.push(n),t.push(a)}serialize(t){return t.push(this.instanceId),t.push(this.textureKey),t.push(this.indexStart),t.push(this.indexCount),t.push(this.vertexStart),t.push(this.vertexCount),t.push(this.overlaps),t}static deserialize(e){const s=e.readInt32(),i=e.readInt32(),r=e.readInt32(),h=e.readInt32(),n=e.readInt32(),a=e.readInt32(),u=e.readInt32();return new t(s,i,r,h,n,a,u)}}export{t as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{numericHash as r}from"../../../../../core/string.js";import{Float as o,Int as n,Vec4 as s,Vec2 as i}from"./graph/glsl.js";import{GlslShaderWriter as p}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as a}from"./graph/ShaderGraphContext.js";import{setReachableUids as u}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as c}from"./typed/TypedShaderProgram.js";import{ShaderBuilder as y}from"../../../../webgl/ShaderBuilder.js";function d(t){return new t}function f(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function h(t,e){return(r,o)=>{f(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const l=t=>(e,r)=>{f(e,"builtins",{builtin:t,propertyKey:r})},m=t=>(e,r,o)=>{f(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},g=t=>(e,r)=>{f(e,"uniforms",{typeCtor:t,propertyKey:r})},_=t=>(e,r)=>{f(e,"options",{typeCtor:t,propertyKey:r})},K=(t,e)=>{f(t,"defines",{propertyKey:e})};function x(t){return(e,r)=>{f(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const b=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class C{}C.builtins=[],t([b("gl_VertexID",n)],C.prototype,"glVertexID",void 0);class I{}class v{}v.builtins=[],t([b("gl_FragCoord",s)],v.prototype,"glFragCoord",void 0),t([b("gl_PointCoord",i)],v.prototype,"glPointCoord",void 0);class w{}t([l("gl_FragDepth")],w.prototype,"glFragDepth",void 0);class P{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class j{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&0===t.parameterIndex));if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&1===t.parameterIndex))}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"fragment"===t.propertyKey));if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map((([t,e])=>`${t}.${e}`)).join("."),o=r(e),n=this.computeAttributes;this._locationInfo={hash:o,stringHash:e,locations:t,computeAttributeMap:n}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i}=this._generateShaders(t,e,r,o);return new c(n,s,this.renamedLocationsMap,this.locationInfo,i,this.transformFeedbackBindings)}catch(n){return new c("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find((e=>e.propertyKey===t));if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find((e=>e.propertyKey===t));if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getShaderKey(t,e,r,o){const n=Object.keys(t).map((e=>`${e}.${t[e]}`)).join("."),s=Object.keys(r).map((t=>`${t}.${r[t]}`)).join("."),i=Object.keys(o).map((t=>`${t}.${o[t]}`)).join("."),p=Object.keys(e).filter((t=>this.optionPropertyKeys.has(t)&&e[t])).join(".");return`${this.constructor.name}.${n}.${s}.${i}.${p}`}_generateShaders(t,e,r,o){const n=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n);const s=this._hydrateVertexInput(o),i=this._injectPackPrecisionFactor(s,t),c=this._hydrateComputeInput(),y=c&&this._injectComputePackPrecisionFactor(c,t),d=this.vertex(i,y),f=this._hydrateFragmentInput(d),h=this.fragment(f),l=new Set;for(const p in h){const t=h[p];u(l,t)}const m=this._getVertexInputBuiltins(),g=a.createVertex({...s,...c},d,m,n,this.transformFeedbackBindings,l);(new p).write(g);const _=this._getFragmentInputBuiltins(h);_.set("glPointCoord","gl_PointCoord");const K=a.createFragment(f,h,_,n,g,this.transformFeedbackBindings);(new p).write(K);const x=this._createShaderBuilder(g,K),b=x.generate("vertex"),C=x.generate("fragment");return this.logShader&&(console.log(b),console.log(C)),{vertex:b,fragment:C,uniformBindings:n}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=d(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce(((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:d(r.typeCtor)}),{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=d(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce(((t,e)=>({...t,[e.propertyKey]:d(e.typeCtor)})),{})}_injectPackPrecisionFactor(t,e){const r={};for(const n in t){const s=t[n],i=e[n];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);r[n]=s.divide(new o(i))}else r[n]=s}return r}_injectComputePackPrecisionFactor(t,e){const r={},n=new Map;for(const o in this.computeAttributes)for(const t of this.computeAttributes[o]??[])n.set(t,o);for(const s in t){const i=t[s],p=n.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);r[s]=i.divide(new o(a))}else r[s]=i}return r}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of v.builtins){const t=d(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new y;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{I as ComputeVertexInput,v as FragmentInput,w as FragmentOutput,j as GraphShaderModule,P as UniformGroup,C as VertexInput,l as builtin,K as define,m as input,h as location,_ as option,x as transformFeedback,g as uniform};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{numericHash as r}from"../../../../../core/string.js";import{Float as o,Int as n,Vec4 as s,Vec2 as i}from"./graph/glsl.js";import{GlslShaderWriter as p}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as a}from"./graph/ShaderGraphContext.js";import{setReachableUids as u}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as c}from"./typed/TypedShaderProgram.js";import{ShaderBuilder as y}from"../../../../webgl/ShaderBuilder.js";function d(t){return new t}function h(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function f(t,e){return(r,o)=>{h(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const l=t=>(e,r)=>{h(e,"builtins",{builtin:t,propertyKey:r})},m=t=>(e,r,o)=>{h(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},g=t=>(e,r)=>{h(e,"uniforms",{typeCtor:t,propertyKey:r})},_=t=>(e,r)=>{h(e,"options",{typeCtor:t,propertyKey:r})},K=(t,e)=>{h(t,"defines",{propertyKey:e})};function x(t){return(e,r)=>{h(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const b=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class C{static{this.builtins=[]}}t([b("gl_VertexID",n)],C.prototype,"glVertexID",void 0);class I{}class v{static{this.builtins=[]}}t([b("gl_FragCoord",s)],v.prototype,"glFragCoord",void 0),t([b("gl_PointCoord",i)],v.prototype,"glPointCoord",void 0);class w{}t([l("gl_FragDepth")],w.prototype,"glFragDepth",void 0);class P{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class j{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&0===t.parameterIndex));if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&1===t.parameterIndex))}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"fragment"===t.propertyKey));if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map((([t,e])=>`${t}.${e}`)).join("."),o=r(e),n=this.computeAttributes;this._locationInfo={hash:o,stringHash:e,locations:t,computeAttributeMap:n}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i}=this._generateShaders(t,e,r,o);return new c(n,s,this.renamedLocationsMap,this.locationInfo,i,this.transformFeedbackBindings)}catch(n){return new c("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find((e=>e.propertyKey===t));if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find((e=>e.propertyKey===t));if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getShaderKey(t,e,r,o){const n=Object.keys(t).map((e=>`${e}.${t[e]}`)).join("."),s=Object.keys(r).map((t=>`${t}.${r[t]}`)).join("."),i=Object.keys(o).map((t=>`${t}.${o[t]}`)).join("."),p=Object.keys(e).filter((t=>this.optionPropertyKeys.has(t)&&e[t])).join(".");return`${this.constructor.name}.${n}.${s}.${i}.${p}`}_generateShaders(t,e,r,o){const n=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n);const s=this._hydrateVertexInput(o),i=this._injectPackPrecisionFactor(s,t),c=this._hydrateComputeInput(),y=c&&this._injectComputePackPrecisionFactor(c,t),d=this.vertex(i,y),h=this._hydrateFragmentInput(d),f=this.fragment(h),l=new Set;for(const p in f){const t=f[p];u(l,t)}const m=this._getVertexInputBuiltins(),g=a.createVertex({...s,...c},d,m,n,this.transformFeedbackBindings,l);(new p).write(g);const _=this._getFragmentInputBuiltins(f);_.set("glPointCoord","gl_PointCoord");const K=a.createFragment(h,f,_,n,g,this.transformFeedbackBindings);(new p).write(K);const x=this._createShaderBuilder(g,K),b=x.generate("vertex"),C=x.generate("fragment");return this.logShader&&(console.log(b),console.log(C)),{vertex:b,fragment:C,uniformBindings:n}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=d(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce(((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:d(r.typeCtor)}),{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=d(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce(((t,e)=>({...t,[e.propertyKey]:d(e.typeCtor)})),{})}_injectPackPrecisionFactor(t,e){const r={};for(const n in t){const s=t[n],i=e[n];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);r[n]=s.divide(new o(i))}else r[n]=s}return r}_injectComputePackPrecisionFactor(t,e){const r={},n=new Map;for(const o in this.computeAttributes)for(const t of this.computeAttributes[o]??[])n.set(t,o);for(const s in t){const i=t[s],p=n.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);r[s]=i.divide(new o(a))}else r[s]=i}return r}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of v.builtins){const t=d(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new y;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{I as ComputeVertexInput,v as FragmentInput,w as FragmentOutput,j as GraphShaderModule,P as UniformGroup,C as VertexInput,l as builtin,K as define,m as input,f as location,_ as option,x as transformFeedback,g as uniform};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- function t(t){return t.split(" ").map(((t,e)=>e>0?t.charAt(0).toUpperCase()+t.slice(1):t)).join("")}function e(t,e){const s=[];for(s.push(e);s.length;){const e=s.pop();if("object"==typeof e&&!t.has(e.uid)){t.add(e.uid);for(const t of e.children)s.push(t)}}}class s{constructor(){this.uid=s.NodeCount++,this._debugName=null,this._isMutable=!1,this.isImplicit=!1}get isMutable(){return this._isMutable}setMutable(){return this._isMutable=!0,this}setDebugName(e){return e=t(e),this._debugName=e,this.isImplicit&&this.children[0]instanceof s&&this.children[0].setDebugName(e),this}get debugInfo(){return{name:this._debugName??""}}cloneInto(t){t._debugName=this._debugName,t._isMutable=this._isMutable,t.isImplicit=this.isImplicit,t.uid=this.uid}}function i(t){return"object"==typeof t?t.clone():t}s.NodeCount=0;class r extends s{constructor(){super(...arguments),this.shaderType="primitive-node"}}class n extends s{constructor(t){super(),this.child=t,this.shaderType="scope-node"}get children(){return[this.child]}clone(){const t=new n(i(this.child));return this.cloneInto(t),t}}class h extends s{constructor(t){super(),this.text=t,this.shaderType="text-node"}get children(){return[]}clone(){const t=new h(this.text);return this.cloneInto(t),t}}class o extends s{constructor(t,e,s){super(),this.property=t,this.target=e,this.returnType=s,this.shaderType="property-access-node"}get children(){const t=[this.target];return"string"!=typeof this.property&&t.push(this.property),t}clone(){const t=new o(this.property,i(this.target),this.returnType);return this.cloneInto(t),t}}class c extends s{constructor(t,e,s,i){super(),this.x=t,this.y=e,this.target=s,this.returnType=i,this.shaderType="property-access-2d-node"}get children(){return[this.target,this.x,this.y]}clone(){const t=new c(this.x,this.y,i(this.target),this.returnType);return this.cloneInto(t),t}}class u extends s{constructor(t,e,s){super(),this.condition=t,this.ifTrue=e,this.ifFalse=s,this.shaderType="condition-node"}get children(){return[this.condition,this.ifTrue,this.ifFalse]}clone(){const t=i(this.ifTrue),e=this.ifFalse?i(this.ifFalse):null,s=new u(this.condition,t,e);return this.cloneInto(s),s}}class p extends s{constructor(t,e,s,i){super(),this.captureList=t,this.returnType=e,this.generator=i,this.shaderType="block-node",s&&(this.subgraph=new n(s))}get children(){return Object.keys(this.captureList).map((t=>this.captureList[t])).concat(this.subgraph??[])}clone(){const t={};for(const s in this.captureList)t[s]=i(this.captureList[s]);const e=new p(t,this.returnType,this.subgraph?i(this.subgraph.child):this.subgraph,this.generator);return this.cloneInto(e),e}}class a extends s{constructor(t,e,s,i,r,n=!1){super(),this.token=t,this._children=e,this.isInfix=s,this.isPropertyAccess=i,this.returnType=r,this.isTernary=n,this.shaderType="function-node"}get children(){return this._children}clone(){const t=new a(this.token,this._children.map(i),this.isInfix,this.isPropertyAccess,this.returnType,this.isTernary);return this.cloneInto(t),t}}export{p as ShaderBlockNode,u as ShaderConditionNode,a as ShaderFunctionNode,s as ShaderNode,r as ShaderPrimitiveNode,c as ShaderPropertyAccess2DNode,o as ShaderPropertyAccessNode,n as ShaderScopeNode,h as ShaderTextNode,i as cloneShaderNode,e as setReachableUids};
5
+ function t(t){return t.split(" ").map(((t,e)=>e>0?t.charAt(0).toUpperCase()+t.slice(1):t)).join("")}function e(t,e){const s=[];for(s.push(e);s.length;){const e=s.pop();if("object"==typeof e&&!t.has(e.uid)){t.add(e.uid);for(const t of e.children)s.push(t)}}}class s{constructor(){this.uid=s.NodeCount++,this._debugName=null,this._isMutable=!1,this.isImplicit=!1}static{this.NodeCount=0}get isMutable(){return this._isMutable}setMutable(){return this._isMutable=!0,this}setDebugName(e){return e=t(e),this._debugName=e,this.isImplicit&&this.children[0]instanceof s&&this.children[0].setDebugName(e),this}get debugInfo(){return{name:this._debugName??""}}cloneInto(t){t._debugName=this._debugName,t._isMutable=this._isMutable,t.isImplicit=this.isImplicit,t.uid=this.uid}}function i(t){return"object"==typeof t?t.clone():t}class r extends s{constructor(){super(...arguments),this.shaderType="primitive-node"}}class n extends s{constructor(t){super(),this.child=t,this.shaderType="scope-node"}get children(){return[this.child]}clone(){const t=new n(i(this.child));return this.cloneInto(t),t}}class h extends s{constructor(t){super(),this.text=t,this.shaderType="text-node"}get children(){return[]}clone(){const t=new h(this.text);return this.cloneInto(t),t}}class c extends s{constructor(t,e,s){super(),this.property=t,this.target=e,this.returnType=s,this.shaderType="property-access-node"}get children(){const t=[this.target];return"string"!=typeof this.property&&t.push(this.property),t}clone(){const t=new c(this.property,i(this.target),this.returnType);return this.cloneInto(t),t}}class o extends s{constructor(t,e,s,i){super(),this.x=t,this.y=e,this.target=s,this.returnType=i,this.shaderType="property-access-2d-node"}get children(){return[this.target,this.x,this.y]}clone(){const t=new o(this.x,this.y,i(this.target),this.returnType);return this.cloneInto(t),t}}class u extends s{constructor(t,e,s){super(),this.condition=t,this.ifTrue=e,this.ifFalse=s,this.shaderType="condition-node"}get children(){return[this.condition,this.ifTrue,this.ifFalse]}clone(){const t=i(this.ifTrue),e=this.ifFalse?i(this.ifFalse):null,s=new u(this.condition,t,e);return this.cloneInto(s),s}}class p extends s{constructor(t,e,s,i){super(),this.captureList=t,this.returnType=e,this.generator=i,this.shaderType="block-node",s&&(this.subgraph=new n(s))}get children(){return Object.keys(this.captureList).map((t=>this.captureList[t])).concat(this.subgraph??[])}clone(){const t={};for(const s in this.captureList)t[s]=i(this.captureList[s]);const e=new p(t,this.returnType,this.subgraph?i(this.subgraph.child):this.subgraph,this.generator);return this.cloneInto(e),e}}class a extends s{constructor(t,e,s,i,r,n=!1){super(),this.token=t,this._children=e,this.isInfix=s,this.isPropertyAccess=i,this.returnType=r,this.isTernary=n,this.shaderType="function-node"}get children(){return this._children}clone(){const t=new a(this.token,this._children.map(i),this.isInfix,this.isPropertyAccess,this.returnType,this.isTernary);return this.cloneInto(t),t}}export{p as ShaderBlockNode,u as ShaderConditionNode,a as ShaderFunctionNode,s as ShaderNode,r as ShaderPrimitiveNode,o as ShaderPropertyAccess2DNode,c as ShaderPropertyAccessNode,n as ShaderScopeNode,h as ShaderTextNode,i as cloneShaderNode,e as setReachableUids};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../../chunks/tslib.es6.js";import{ShaderPrimitiveNode as e,cloneShaderNode as n,ShaderPropertyAccessNode as r,ShaderPropertyAccess2DNode as c,ShaderBlockNode as i,ShaderScopeNode as u,ShaderConditionNode as s,ShaderFunctionNode as o}from"./ShaderGraphNode.js";var l,h,a,f,p,d,w,y,m,v,b,x,I,g;function E(t){switch(t.type){case"uint":return _;case"uvec2":return C;case"uvec3":return X;case"uvec4":return Y;default:throw new Error("Found unexpected type")}}function $(t){switch(t.type){case"float":return G;case"vec2":return H;case"vec3":return A;case"vec4":return V;default:throw new Error("Found unexpected type")}}function z(t){switch(t.type){case"int":return _;case"ivec2":return C;case"ivec3":return X;case"ivec4":return Y;default:throw new Error("Found unexpected type")}}function T(t){switch(t.type){case"float":return W;case"vec2":return Z;case"vec3":return tt;case"vec4":return et;default:throw new Error("Found unexpected type")}}function N(t){switch(t.type){case"bool":case"float":case"int":case"uint":return J;case"bvec2":case"vec2":case"ivec2":case"uvec2":return K;case"bvec3":case"vec3":case"ivec3":case"uvec3":return L;case"bvec4":case"vec4":case"ivec4":case"uvec4":return Q;default:throw new Error("Unable to handle type")}}function D(t){switch(t.type){case"bool":case"bvec2":case"bvec3":case"bvec4":return J;case"float":case"vec2":case"vec3":case"vec4":return _;case"int":case"ivec2":case"ivec3":case"ivec4":return W;case"uint":case"uvec2":case"uvec3":case"uvec4":return G;default:throw new Error("Unable to handle type")}}function F(t){switch(t.type){case"float":case"int":case"uint":case"bool":case"sampler2D":return 1;case"vec2":case"ivec2":case"uvec2":case"bvec2":return 2;case"vec3":case"ivec3":case"uvec3":case"bvec3":return 3;case"vec4":case"ivec4":case"uvec4":case"bvec4":case"mat2":return 4;case"mat3":return 9;case"mat4":return 16;case"array":case"array-2d":return t.size*F(t.elementType)}}function k(t){const e=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const n of e)if(n.includes(t))return n.map((t=>it[t]));throw new Error("Unable to find type family")}function M(t){return new Proxy(t,{get(e,n){if("constructor"===n)return new Proxy(e.constructor,{construct:(t,e,n)=>M(new t(...e))});if(n in e)return e[n];if("string"==typeof n){const e=k(t.type);return dt(t,n,e[n.length-1])}}})}function S(t){return new Proxy(t,{construct:(t,e,n)=>M(new t(...e))})}function j(t){return new Proxy(t,{get(e,n){if(n in e)return e[n];if("string"==typeof n){const e=parseInt(n,10);if(!isNaN(e))return dt(t,`[${e}]`,t.elementType.constructor)}}})}function R(t){return new Proxy(t,{construct:(t,e,n)=>j(new t(...e))})}class P extends Error{}let B=l=class extends e{constructor(t,e){super(),this.elementType=t,this.size=e,this.children=[],this.type="array"}clone(){const t=new l(this.elementType,this.size);return super.cloneInto(t),t}get(t,e){const n=new W(t),r=null!=e?new W(e):null;if(null!=r){return wt(this,n,r,D(this.elementType.constructor))}return dt(this,n,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(t,e,n){return Et(this,t,e,n)}glslFindIndex(t,e,n){return $t(this,t,e,n)}static ofType(t,e){const n={construct:(n,r)=>new l(new t,e)};return new Proxy(l,n)}};B.type="array",B=l=t([R],B);class q extends e{constructor(t,e,n,r=!1){super(),this.elementType=t,this.xSize=e,this.ySize=n,this.isRowMajor=r,this.children=[],this.type="array-2d"}clone(){const t=new q(this.elementType,this.xSize,this.ySize,this.isRowMajor);return super.cloneInto(t),t}get size(){return this.xSize*this.ySize}get(t,e){return this.isRowMajor?this._getRowMajor(t,e):this._getColumnMajor(t,e)}_getColumnMajor(t,e){const n=new W(t);return dt(this,new W(e).add(n.multiply(this.xSize)),this.elementType.constructor)}_getRowMajor(t,e){const n=new W(t),r=new W(e);return dt(this,n.add(r.multiply(this.ySize)),this.elementType.constructor)}static ofType(t,e,n,r=!1){return new Proxy(B,{construct:(c,i)=>new q(new t,e,n,r)})}}q.type="array-2d";class U extends e{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}clone(){const t=new U;return t.children=this.children.map(n),super.cloneInto(t),t}}U.type="sampler2D";class _ extends e{constructor(t){super(),this.type="float",this.children=[t]}clone(){const t=new _(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return Dt(this,"number"==typeof t?O(t,_):t)}divide(t){return Ft(this,"number"==typeof t?O(t,_):t)}add(t){return kt(this,"number"==typeof t?O(t,_):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,_):t)}}_.type="float";let C=h=class extends e{constructor(t,e){super(),this.type="vec2",this.children=[t,e].filter((t=>null!=t))}clone(){const t=new h(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",_)}get 1(){return dt(this,"[1]",_)}get 2(){throw new P}get 3(){throw new P}multiply(t){return Dt(this,"number"==typeof t?O(t,_):t)}divide(t){return Ft(this,"number"==typeof t?O(t,_):t)}add(t){return kt(this,"number"==typeof t?O(t,_):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,_):t)}};C.type="vec2",C=h=t([S],C);let X=a=class extends e{constructor(t,e,n){super(),this.type="vec3",this.children=[t,e,n].filter((t=>null!=t))}get 0(){return dt(this,"[0]",_)}get 1(){return dt(this,"[1]",_)}get 2(){return dt(this,"[2]",_)}get 3(){throw new P}clone(){const t=new a(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}multiply(t){return Dt(this,"number"==typeof t?O(t,_):t)}divide(t){return Ft(this,"number"==typeof t?O(t,_):t)}add(t){return kt(this,"number"==typeof t?O(t,_):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,_):t)}};X.type="vec3",X=a=t([S],X);let Y=f=class extends e{constructor(t,e,n,r){super(),this.type="vec4",this.children=[t,e,n,r].filter((t=>null!=t))}clone(){const t=new f(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",_)}get 1(){return dt(this,"[1]",_)}get 2(){return dt(this,"[2]",_)}get 3(){return dt(this,"[3]",_)}multiply(t){return Dt(this,"number"==typeof t?O(t,_):t)}divide(t){return Ft(this,"number"==typeof t?O(t,_):t)}add(t){return kt(this,"number"==typeof t?O(t,_):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,_):t)}};Y.type="vec4",Y=f=t([S],Y);let G=p=class extends e{constructor(t){super(),this.type="uint",this.children=[t]}clone(){const t=new p(n(this.children[0]));return super.cloneInto(t),t}};G.type="uint",G=p=t([S],G);let H=d=class extends e{constructor(t,e){super(),this.type="uvec2",this.children=[t,e].filter((t=>null!=t))}clone(){const t=new d(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};H.type="uvec2",H=d=t([S],H);let A=w=class extends e{constructor(t,e,n){super(),this.type="uvec3",this.children=[t,e,n].filter((t=>null!=t))}clone(){const t=new w(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};A.type="uvec3",A=w=t([S],A);let V=y=class extends e{constructor(t,e,n,r){super(),this.type="uvec4",this.children=[t,e,n,r].filter((t=>null!=t))}clone(){const t=new y(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};V.type="uvec4",V=y=t([S],V);class J extends e{constructor(t){super(),this.type="bool",this.children=[t]}and(t){return Lt(this,t)}or(t){return At(this,t)}xor(t){return Jt(this,t)}clone(){const t=new J(n(this.children[0]));return super.cloneInto(t),t}}J.type="bool";let K=m=class extends e{constructor(t,e){super(),this.type="bvec2",this.children=[t,e].filter((t=>null!=t))}all(){return te(this)}any(){return ee(this)}clone(){const t=new m(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};K.type="bvec2",K=m=t([S],K);let L=v=class extends e{constructor(t,e,n){super(),this.type="bvec3",this.children=[t,e,n].filter((t=>null!=t))}all(){return te(this)}any(){return ee(this)}clone(){const t=new v(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};function O(t,e){if("number"==typeof t){return new e(t)}return t}L.type="bvec3",L=v=t([S],L);let Q=b=class extends e{constructor(t,e,n,r){super(),this.type="bvec4",this.children=[t,e,n,r].filter((t=>null!=t))}all(){return te(this)}any(){return ee(this)}clone(){const t=new b(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};Q.type="bvec4",Q=b=t([S],Q);class W extends e{constructor(t){super(),this.type="int",this.children=[t]}multiply(t){return Dt(this,O(t,W))}add(t){return kt(this,O(t,W))}subtract(t){return Mt(this,O(t,W))}divide(t){return Ft(this,O(t,W))}clone(){const t=new W(n(this.children[0]));return super.cloneInto(t),t}}W.type="int";let Z=x=class extends e{constructor(t,e){super(),this.type="ivec2",this.children=[t,e].filter((t=>null!=t))}clone(){const t=new x(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};Z.type="ivec2",Z=x=t([S],Z);let tt=I=class extends e{constructor(t,e,n){super(),this.type="ivec3",this.children=[t,e,n].filter((t=>null!=t))}clone(){const t=new I(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};tt.type="ivec3",tt=I=t([S],tt);let et=g=class extends e{constructor(t,e,n,r){super(),this.type="ivec4",this.children=[t,e,n,r].filter((t=>null!=t))}clone(){const t=new g(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};et.type="ivec4",et=g=t([S],et);class nt extends e{constructor(t,e,n,r){super(),this.type="mat2",this.children=[t,e,n,r]}clone(){const t=new nt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get(t,e){return wt(this,new W(t),new W(e),_)}multiply(t){return Dt(this,t)}}nt.type="mat2";class rt extends e{static identity(){return new rt(1,0,0,0,1,0,0,0,1)}static fromRotation(t){const e=un(t),n=oe(t);return new rt(n,e,0,xt(e),n,0,0,0,1)}constructor(t,e,n,r,c,i,u,s,o){super(),this.type="mat3",this.children=[t,e,n,r,c,i,u,s,o]}add(t){return kt(this,t)}multiply(t){return Dt(this,t)}get(t,e){return wt(this,new W(t),new W(e),_)}clone(){const t=new rt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]));return super.cloneInto(t),t}}rt.type="mat3";class ct extends e{static identity(){return new ct(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(t,e,n,r,c,i,u,s,o,l,h,a,f,p,d,w){super(),this.type="mat4",this.children=[t,e,n,r,c,i,u,s,o,l,h,a,f,p,d,w]}static fromColumns(t,e,n,r){return new ct(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,n.x,n.y,n.z,n.w,r.x,r.y,r.z,r.w)}multiply(t){return Dt(this,t)}get(t,e){return wt(this,new W(t),new W(e),_)}clone(){const t=new ct(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]),n(this.children[9]),n(this.children[10]),n(this.children[11]),n(this.children[12]),n(this.children[13]),n(this.children[14]),n(this.children[15]));return super.cloneInto(t),t}}ct.type="mat4";const it={float:_,vec2:C,vec3:X,vec4:Y,int:W,ivec2:Z,ivec3:tt,ivec4:et,uint:G,uvec2:H,uvec3:A,uvec4:V,bool:J,bvec2:K,bvec3:L,bvec4:Q},ut=(...t)=>new W(...t),st=(...t)=>new _(...t),ot=(...t)=>new C(...t),lt=(...t)=>new X(...t),ht=(...t)=>new Y(...t),at=(...t)=>new nt(...t),ft=(...t)=>new rt(...t),pt=(...t)=>new ct(...t);function dt(t,e,n){const c=new n(new r(e,t,n));return c.isImplicit=!0,c}function wt(t,e,n,r){const i=new r(new c(e,n,t,r));return i.isImplicit=!0,i}function yt(t,e,n,r=null){if(r){const c=new r,i=new r(new o(t,[e,n],!0,!1,c));return i.isImplicit=!0,i}if("float"===e.type||"int"===e.type){const r=new n.constructor(new o(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}if(("mat2"===e.type||"mat3"===e.type||"mat4"===e.type)&&"float"!==n.type){const r=new n.constructor(new o(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}const c=new e.constructor(new o(t,[e,n],!0,!1,e.constructor));return c.isImplicit=!0,c}function mt(t,e,n=e.constructor){const r=new n(new o(t,[e],!1,!1,n));return r.isImplicit=!0,r}function vt(t,e,n,r=e.constructor){const c=new r(new o(t,[e,n],!1,!1,r));return c.isImplicit=!0,c}function bt(t,e,n,r,c=e.constructor){const i=new c(new o(t,[e,n,r],!1,!1,c));return i.isImplicit=!0,i}function xt(t){return Dt(t,st(-1))}function It(t,e,n,r){return new e(new i(t,e,n,r))}function gt(t,e){const n="function"==typeof t?t():t,r=new n.constructor(new u(n).setDebugName(e));return r.isImplicit=!0,r}function Et(t,e,n=0,r=t.size){const c=new W(n).setMutable().setDebugName("FindIndexIterator"),i=e(t.get(c)).setDebugName("FindIndexPredicate"),u=It({iter:c},W,i,(({out:t,iter:e,subgraph:n})=>`\n${t} = -1;\n\nfor (; ${e} < ${r}; ${e}++) {\n\n${n.body}\n\n if (${n.varName}) {\n ${t} = ${e};\n break;\n }\n\n}\n`)).setDebugName("FindIndexBlock");return u}function $t(t,e,n=0,r=t.size){const c=It({array:t},W,null,(({out:t,array:c})=>`\n${t} = -1;\nfor (int i = ${n}; i < ${r}; i++) {\n bool condition;\n ${e({array:c,i:"i",out:"condition"})}\n if (condition) {\n ${t} = i;\n break;\n }\n}\n`)).setDebugName("GlslFindIndexBlock");return c}function zt(t,e,n){const r="function"==typeof e?e():e,c="function"==typeof n?n():n,i=new r.constructor(new s(t,r,c));return i.isImplicit=!0,i}function Tt(...t){const e=t.map((([t,e])=>"function"==typeof e?[t,e()]:[t,e])),n=e[0][1].constructor,r=e.findIndex((t=>!0===t[0]));if(-1===r)throw new Error("A cond must have a fallthrough case with `true`/; ");const c=e.slice(0,r),i=e[r][1],u=new n(c.reduceRight(((t,e)=>zt(e[0],e[1],t)),i));return u.isImplicit=!0,u}function Nt(t,e){const n=new e.constructor(new s(t,e,null));return n.isImplicit=!0,n}function Dt(t,e){return yt("*",t,e)}function Ft(t,e){return yt("/",t,e)}function kt(t,e){return yt("+",t,e)}function Mt(t,e){return yt("-",t,e)}function St(t,e){return yt("%",t,e)}function jt(t,e){return yt("<<",t,e)}function Rt(t,e){return yt(">>",t,e)}function Pt(t,e){return yt("&",t,e)}function Bt(t,e){return yt("|",t,e)}function qt(t,e){return yt("^",t,e)}function Ut(t){return mt("~",t)}function _t(t,e){return yt("==",t,e,J)}function Ct(t,e){return yt("!=",t,e,J)}function Xt(t,e){return yt("<",t,e,J)}function Yt(t,e){return yt("<=",t,e,J)}function Gt(t,e){return yt(">",t,e,J)}function Ht(t,e){return yt(">=",t,e,J)}function At(...t){return t.length<=1?t[0]:t.slice(1).reduce(((t,e)=>Vt(t,e)),t[0])}function Vt(t,e){return yt("||",t,e,J)}function Jt(...t){return t.length<=1?t[0]:t.slice(1).reduce(((t,e)=>Kt(t,e)),t[0])}function Kt(t,e){return yt("^^",t,e,J)}function Lt(...t){return t.length<=1?t[0]:t.slice(1).reduce(((t,e)=>Ot(t,e)),t[0])}function Ot(t,e){return yt("&&",t,e,J)}function Qt(t){return mt("abs",t)}function Wt(t){return mt("acos",t)}function Zt(t){return mt("acosh",t)}function te(t){return mt("all",t,J)}function ee(t){return mt("any",t,J)}function ne(t){return mt("asin",t)}function re(t){return mt("asinh",t)}function ce(t,e){return null==e?mt("atan",t):vt("atan",t,e,t.constructor)}function ie(t){return mt("atanh",t)}function ue(t){return mt("ceil",t)}function se(t,e,n){return bt("clamp",t,e,n,t.constructor)}function oe(t){return mt("cos",t)}function le(t){return mt("cosh",t)}function he(t,e){return vt("cross",t,e,t.constructor)}function ae(t){return mt("dFdX",t)}function fe(t){return mt("dFdY",t)}function pe(t){return mt("degrees",t)}function de(t){return mt("determinant",t,_)}function we(t,e){return vt("distance",t,e,_)}function ye(t,e){return vt("dot",t,e,_)}function me(t,e){return vt("equal",t,e,N(t))}function ve(t,e){return vt("greaterThan",t,e,N(t))}function be(t,e){return vt("greaterThanEqual",t,e,N(t))}function xe(t){return mt("exp",t)}function Ie(t){return mt("exp2",t)}function ge(t,e,n){return bt("faceforward",t,e,n)}function Ee(t){return mt("floatBitsToInt",t,T(t))}function $e(t){return mt("floatBitsToUint",t,$(t))}function ze(t){return mt("floor",t)}function Te(t){return mt("fract",t)}function Ne(t){return mt("fwidth",t)}function De(t){return mt("intBitsToFloat",t,z(t))}function Fe(t){return mt("uintBitsToFloat",t,E(t))}function ke(t){return mt("inverse",t,_)}function Me(t){return mt("inversesqrt",t)}function Se(t){return mt("isinf",t,N(t))}function je(t){return mt("isnan",t,N(t))}function Re(t){return mt("length",t,_)}function Pe(t,e){return vt("lessThan",t,e,N(t))}function Be(t,e){return vt("lessThanEqual",t,e,N(t))}function qe(t){return mt("log",t)}function Ue(t){return mt("log2",t)}function _e(t,e){return vt("matrixCompMult",t,e)}function Ce(t,e){return vt("max",t,e)}function Xe(t,e){return vt("min",t,e)}function Ye(t,e,n){return bt("mix",t,e,n)}function Ge(t,e){return vt("mod",t,e)}function He(t,e){throw new Error("modf not implemented")}function Ae(t){return mt("normalize",t)}function Ve(t){return"bool"===t.type?mt("!",t):mt("not",t)}function Je(t,e){return vt("notEqual",t,e,N(t))}function Ke(t,e){throw new Error("Impl type?")}function Le(t){return mt("packHalf2x16",t,G)}function Oe(t){return mt("packUnorm2x16",t,G)}function Qe(t){return mt("packSnorm2x16",t,G)}function We(t,e){return vt("pow",t,e)}function Ze(t){return mt("radians",t)}function tn(t,e){return vt("reflect",t,e)}function en(t,e,n){return bt("refract",t,e,n)}function nn(t){return mt("round",t)}function rn(t){return mt("roundEven",t)}function cn(t){return mt("sign",t)}function un(t){return mt("sin",t)}function sn(t){return mt("sinh",t)}function on(t,e,n){return bt("smoothstep",t,e,n)}function ln(t){return mt("sqrt",t)}function hn(t,e){return vt("step",t,e,e.constructor)}function an(t){return mt("tan",t)}function fn(t){return mt("tanh",t)}function pn(t,e,n){return bt("texelFetch",t,e,n,Y)}function dn(t,e,n,r){throw new Error("Impl type")}function wn(t,e,n){throw new Error("Impl type")}function yn(t,e){return vt("texture",t,e,Y)}function mn(t,e,n,r){throw new Error("Impl type")}function vn(t,e,n,r,c){throw new Error("Impl type")}function bn(t,e,n){throw new Error("Impl type")}function xn(t,e,n,r){throw new Error("Impl type")}function In(t,e,n,r){throw new Error("Impl type")}function gn(t,e,n){throw new Error("Impl type")}function En(t,e,n,r){throw new Error("Impl type")}function $n(t,e,n,r,c){throw new Error("Impl type")}function zn(t,e,n){throw new Error("Impl type")}function Tn(t,e,n,r){throw new Error("Impl type")}function Nn(t,e,n,r){throw new Error("Impl type")}function Dn(t,e){throw new Error("Impl type")}function Fn(t){return mt("transpose",t)}function kn(t){return mt("trunc",t)}function Mn(t){return mt("unpackHalf2x16",t,C)}function Sn(t){return mt("unpackUnorm2x16",t,C)}function jn(t){return mt("unpackSnorm2x16",t,C)}function Rn(t,e){const{initialValue:n,xRange:r,yRange:c,callback:i}=e,[u,s]=r,[o,l]=c,h=new W(0).setMutable().setDebugName("iterX"),a=new W(0).setMutable().setDebugName("iterY"),f=n.setMutable().setDebugName("accumulator"),p=i(f,t.get(h,a),h,a).setDebugName("callback"),d=It({iterX:h,iterY:a,accumulator:f},n.constructor,p,(({out:t,iterX:e,iterY:n,accumulator:r,subgraph:c})=>`\nfor (${n} = ${o}; ${n} < ${l}; ${n}++) {\n for (${e} = ${u}; ${e} < ${s}; ${e}++) {\n\n ${c.body}\n\n ${r} = ${c.varName};\n }\n}\n${t} = ${r};\n`)).setDebugName("reduce2DBody");return d}export{K as BVec2,L as BVec3,Q as BVec4,J as Bool,B as FixedArray,q as FixedArray2D,_ as Float,Z as IVec2,tt as IVec3,et as IVec4,W as Int,nt as Mat2,rt as Mat3,ct as Mat4,U as Sampler2D,G as UInt,H as UVec2,A as UVec3,V as UVec4,C as Vec2,X as Vec3,Y as Vec4,Vt as _or,Kt as _xor,Qt as abs,Wt as acos,Zt as acosh,kt as add,te as all,Lt as and,ee as any,ne as asin,re as asinh,ce as atan,ie as atanh,Pt as bitAnd,Ut as bitNot,Bt as bitOr,Rt as bitRShift,jt as bitShift,qt as bitXor,It as block,ue as ceil,se as clamp,Tt as cond,oe as cos,le as cosh,he as cross,ae as dFdx,fe as dFdy,dt as definePropertyAccess,wt as definePropertyAccess2D,pe as degrees,de as determinant,we as distance,Ft as divide,ye as dot,_t as equal,me as equalComponent,xe as exp,Ie as exp2,ge as faceforward,Et as findIndex,st as float,Ee as floatBitsToInt,$e as floatBitsToUint,ze as floor,Te as fract,Ne as fwidth,F as getTypeElementLengthForType,$t as glslFindIndex,Gt as greaterThan,ve as greaterThanComponent,Ht as greaterThanEqual,be as greaterThanEqualComponent,zt as ifElse,ut as int,De as intBitsToFloat,St as intMod,ke as inverse,Me as inversesqrt,Se as isinf,je as isnan,Re as length,Xt as lessThan,Pe as lessThanComponent,Yt as lessThanEqual,Be as lessThanEqualComponent,qe as log,Ue as log2,at as mat2,ft as mat3,pt as mat4,_e as matrixCompMult,Ce as max,Xe as min,Ye as mix,Ge as mod,He as modf,Dt as multiply,gt as namedScope,xt as negate,Ae as normalize,Ve as not,Ct as notEqual,Je as notEqualComponent,At as or,Ke as outerProduct,Le as packHalf2x16,Qe as packSnorm2x16,Oe as packUnorm2x16,We as pow,Ze as radians,Rn as reduce2D,tn as reflect,en as refract,nn as round,rn as roundEven,cn as sign,un as sin,sn as sinh,on as smoothstep,ln as sqrt,hn as step,Mt as subtract,an as tan,fn as tanh,pn as texelFetch,dn as texelFetchOffset,wn as texture,yn as texture2D,mn as textureGrad,vn as textureGradOffset,bn as textureLod,xn as textureLodOffset,In as textureOffset,gn as textureProj,En as textureProjGrad,$n as textureProjGradOffset,zn as textureProjLod,Tn as textureProjLodOffset,Nn as textureProjOffset,Dn as textureSize,T as transformFloatToInt,$ as transformFloatToUInt,z as transformIntToFloat,N as transformTypeToBooleanType,E as transformUIntToFloat,Fn as transpose,kn as trunc,Fe as uintBitsToFloat,Mn as unpackHalf2x16,jn as unpackSnorm2x16,Sn as unpackUnorm2x16,ot as vec2,lt as vec3,ht as vec4,Nt as when,Jt as xor};
5
+ import{_ as t}from"../../../../../../chunks/tslib.es6.js";import{ShaderPrimitiveNode as e,cloneShaderNode as n,ShaderPropertyAccessNode as r,ShaderPropertyAccess2DNode as c,ShaderFunctionNode as i,ShaderBlockNode as s,ShaderScopeNode as u,ShaderConditionNode as o}from"./ShaderGraphNode.js";var h,l,a,f,p,d,w,y,m,v,b,x,I,g;function E(t){switch(t.type){case"uint":return _;case"uvec2":return C;case"uvec3":return X;case"uvec4":return Y;default:throw new Error("Found unexpected type")}}function $(t){switch(t.type){case"float":return G;case"vec2":return H;case"vec3":return A;case"vec4":return V;default:throw new Error("Found unexpected type")}}function z(t){switch(t.type){case"int":return _;case"ivec2":return C;case"ivec3":return X;case"ivec4":return Y;default:throw new Error("Found unexpected type")}}function T(t){switch(t.type){case"float":return W;case"vec2":return Z;case"vec3":return tt;case"vec4":return et;default:throw new Error("Found unexpected type")}}function N(t){switch(t.type){case"bool":case"float":case"int":case"uint":return J;case"bvec2":case"vec2":case"ivec2":case"uvec2":return K;case"bvec3":case"vec3":case"ivec3":case"uvec3":return L;case"bvec4":case"vec4":case"ivec4":case"uvec4":return Q;default:throw new Error("Unable to handle type")}}function D(t){switch(t.type){case"bool":case"bvec2":case"bvec3":case"bvec4":return J;case"float":case"vec2":case"vec3":case"vec4":return _;case"int":case"ivec2":case"ivec3":case"ivec4":return W;case"uint":case"uvec2":case"uvec3":case"uvec4":return G;default:throw new Error("Unable to handle type")}}function F(t){switch(t.type){case"float":case"int":case"uint":case"bool":case"sampler2D":return 1;case"vec2":case"ivec2":case"uvec2":case"bvec2":return 2;case"vec3":case"ivec3":case"uvec3":case"bvec3":return 3;case"vec4":case"ivec4":case"uvec4":case"bvec4":case"mat2":return 4;case"mat3":return 9;case"mat4":return 16;case"array":case"array-2d":return t.size*F(t.elementType)}}function k(t){const e=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const n of e)if(n.includes(t))return n.map((t=>it[t]));throw new Error("Unable to find type family")}function M(t){return new Proxy(t,{get(e,n){if("constructor"===n)return new Proxy(e.constructor,{construct:(t,e,n)=>M(new t(...e))});if(n in e)return e[n];if("string"==typeof n){const e=k(t.type);return dt(t,n,e[n.length-1])}}})}function S(t){return new Proxy(t,{construct:(t,e,n)=>M(new t(...e))})}function j(t){return new Proxy(t,{get(e,n){if(n in e)return e[n];if("string"==typeof n){const e=parseInt(n,10);if(!isNaN(e))return dt(t,`[${e}]`,t.elementType.constructor)}}})}function R(t){return new Proxy(t,{construct:(t,e,n)=>j(new t(...e))})}class P extends Error{}let B=class extends e{static{h=this}static{this.type="array"}constructor(t,e){super(),this.elementType=t,this.size=e,this.children=[],this.type="array"}clone(){const t=new h(this.elementType,this.size);return super.cloneInto(t),t}get(t,e){const n=new W(t),r=null!=e?new W(e):null;if(null!=r){return wt(this,n,r,D(this.elementType.constructor))}return dt(this,n,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(t,e,n){return Et(this,t,e,n)}glslFindIndex(t,e,n){return $t(this,t,e,n)}static ofType(t,e){const n={construct:(n,r)=>new h(new t,e)};return new Proxy(h,n)}};B=h=t([R],B);class q extends e{static{this.type="array-2d"}constructor(t,e,n,r=!1){super(),this.elementType=t,this.xSize=e,this.ySize=n,this.isRowMajor=r,this.children=[],this.type="array-2d"}clone(){const t=new q(this.elementType,this.xSize,this.ySize,this.isRowMajor);return super.cloneInto(t),t}get size(){return this.xSize*this.ySize}get(t,e){return this.isRowMajor?this._getRowMajor(t,e):this._getColumnMajor(t,e)}_getColumnMajor(t,e){const n=new W(t);return dt(this,new W(e).add(n.multiply(this.xSize)),this.elementType.constructor)}_getRowMajor(t,e){const n=new W(t),r=new W(e);return dt(this,n.add(r.multiply(this.ySize)),this.elementType.constructor)}static ofType(t,e,n,r=!1){return new Proxy(B,{construct:(c,i)=>new q(new t,e,n,r)})}}class U extends e{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}static{this.type="sampler2D"}clone(){const t=new U;return t.children=this.children.map(n),super.cloneInto(t),t}}class _ extends e{static{this.type="float"}constructor(t){super(),this.type="float",this.children=[t]}clone(){const t=new _(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return Dt(this,"number"==typeof t?O(t,_):t)}divide(t){return Ft(this,"number"==typeof t?O(t,_):t)}add(t){return kt(this,"number"==typeof t?O(t,_):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,_):t)}}let C=class extends e{static{l=this}static{this.type="vec2"}constructor(t,e){super(),this.type="vec2",this.children=[t,e].filter((t=>null!=t))}clone(){const t=new l(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",_)}get 1(){return dt(this,"[1]",_)}get 2(){throw new P}get 3(){throw new P}multiply(t){return Dt(this,"number"==typeof t?O(t,_):t)}divide(t){return Ft(this,"number"==typeof t?O(t,_):t)}add(t){return kt(this,"number"==typeof t?O(t,_):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,_):t)}};C=l=t([S],C);let X=class extends e{static{a=this}static{this.type="vec3"}constructor(t,e,n){super(),this.type="vec3",this.children=[t,e,n].filter((t=>null!=t))}get 0(){return dt(this,"[0]",_)}get 1(){return dt(this,"[1]",_)}get 2(){return dt(this,"[2]",_)}get 3(){throw new P}clone(){const t=new a(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}multiply(t){return Dt(this,"number"==typeof t?O(t,_):t)}divide(t){return Ft(this,"number"==typeof t?O(t,_):t)}add(t){return kt(this,"number"==typeof t?O(t,_):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,_):t)}};X=a=t([S],X);let Y=class extends e{static{f=this}static{this.type="vec4"}constructor(t,e,n,r){super(),this.type="vec4",this.children=[t,e,n,r].filter((t=>null!=t))}clone(){const t=new f(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",_)}get 1(){return dt(this,"[1]",_)}get 2(){return dt(this,"[2]",_)}get 3(){return dt(this,"[3]",_)}multiply(t){return Dt(this,"number"==typeof t?O(t,_):t)}divide(t){return Ft(this,"number"==typeof t?O(t,_):t)}add(t){return kt(this,"number"==typeof t?O(t,_):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,_):t)}};Y=f=t([S],Y);let G=class extends e{static{p=this}static{this.type="uint"}constructor(t){super(),this.type="uint",this.children=[t]}clone(){const t=new p(n(this.children[0]));return super.cloneInto(t),t}};G=p=t([S],G);let H=class extends e{static{d=this}static{this.type="uvec2"}constructor(t,e){super(),this.type="uvec2",this.children=[t,e].filter((t=>null!=t))}clone(){const t=new d(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};H=d=t([S],H);let A=class extends e{static{w=this}static{this.type="uvec3"}constructor(t,e,n){super(),this.type="uvec3",this.children=[t,e,n].filter((t=>null!=t))}clone(){const t=new w(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};A=w=t([S],A);let V=class extends e{static{y=this}static{this.type="uvec4"}constructor(t,e,n,r){super(),this.type="uvec4",this.children=[t,e,n,r].filter((t=>null!=t))}clone(){const t=new y(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};V=y=t([S],V);class J extends e{static{this.type="bool"}constructor(t){super(),this.type="bool",this.children=[t]}and(t){return Lt(this,t)}or(t){return At(this,t)}xor(t){return Jt(this,t)}clone(){const t=new J(n(this.children[0]));return super.cloneInto(t),t}}let K=class extends e{static{m=this}static{this.type="bvec2"}constructor(t,e){super(),this.type="bvec2",this.children=[t,e].filter((t=>null!=t))}all(){return te(this)}any(){return ee(this)}clone(){const t=new m(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};K=m=t([S],K);let L=class extends e{static{v=this}static{this.type="bvec3"}constructor(t,e,n){super(),this.type="bvec3",this.children=[t,e,n].filter((t=>null!=t))}all(){return te(this)}any(){return ee(this)}clone(){const t=new v(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};function O(t,e){if("number"==typeof t){return new e(t)}return t}L=v=t([S],L);let Q=class extends e{static{b=this}static{this.type="bvec4"}constructor(t,e,n,r){super(),this.type="bvec4",this.children=[t,e,n,r].filter((t=>null!=t))}all(){return te(this)}any(){return ee(this)}clone(){const t=new b(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};Q=b=t([S],Q);class W extends e{static{this.type="int"}constructor(t){super(),this.type="int",this.children=[t]}multiply(t){return Dt(this,O(t,W))}add(t){return kt(this,O(t,W))}subtract(t){return Mt(this,O(t,W))}divide(t){return Ft(this,O(t,W))}clone(){const t=new W(n(this.children[0]));return super.cloneInto(t),t}}let Z=class extends e{static{x=this}static{this.type="ivec2"}constructor(t,e){super(),this.type="ivec2",this.children=[t,e].filter((t=>null!=t))}clone(){const t=new x(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};Z=x=t([S],Z);let tt=class extends e{static{I=this}static{this.type="ivec3"}constructor(t,e,n){super(),this.type="ivec3",this.children=[t,e,n].filter((t=>null!=t))}clone(){const t=new I(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};tt=I=t([S],tt);let et=class extends e{static{g=this}static{this.type="ivec4"}constructor(t,e,n,r){super(),this.type="ivec4",this.children=[t,e,n,r].filter((t=>null!=t))}clone(){const t=new g(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};et=g=t([S],et);class nt extends e{static{this.type="mat2"}constructor(t,e,n,r){super(),this.type="mat2",this.children=[t,e,n,r]}clone(){const t=new nt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get(t,e){return wt(this,new W(t),new W(e),_)}multiply(t){return Dt(this,t)}}class rt extends e{static{this.type="mat3"}static identity(){return new rt(1,0,0,0,1,0,0,0,1)}static fromRotation(t){const e=sn(t),n=oe(t);return new rt(n,e,0,xt(e),n,0,0,0,1)}constructor(t,e,n,r,c,i,s,u,o){super(),this.type="mat3",this.children=[t,e,n,r,c,i,s,u,o]}add(t){return kt(this,t)}multiply(t){return Dt(this,t)}get(t,e){return wt(this,new W(t),new W(e),_)}clone(){const t=new rt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]));return super.cloneInto(t),t}}class ct extends e{static{this.type="mat4"}static identity(){return new ct(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(t,e,n,r,c,i,s,u,o,h,l,a,f,p,d,w){super(),this.type="mat4",this.children=[t,e,n,r,c,i,s,u,o,h,l,a,f,p,d,w]}static fromColumns(t,e,n,r){return new ct(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,n.x,n.y,n.z,n.w,r.x,r.y,r.z,r.w)}multiply(t){return Dt(this,t)}get(t,e){return wt(this,new W(t),new W(e),_)}clone(){const t=new ct(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]),n(this.children[9]),n(this.children[10]),n(this.children[11]),n(this.children[12]),n(this.children[13]),n(this.children[14]),n(this.children[15]));return super.cloneInto(t),t}}const it={float:_,vec2:C,vec3:X,vec4:Y,int:W,ivec2:Z,ivec3:tt,ivec4:et,uint:G,uvec2:H,uvec3:A,uvec4:V,bool:J,bvec2:K,bvec3:L,bvec4:Q},st=(...t)=>new W(...t),ut=(...t)=>new _(...t),ot=(...t)=>new C(...t),ht=(...t)=>new X(...t),lt=(...t)=>new Y(...t),at=(...t)=>new nt(...t),ft=(...t)=>new rt(...t),pt=(...t)=>new ct(...t);function dt(t,e,n){const c=new n(new r(e,t,n));return c.isImplicit=!0,c}function wt(t,e,n,r){const i=new r(new c(e,n,t,r));return i.isImplicit=!0,i}function yt(t,e,n,r=null){if(r){const c=new r,s=new r(new i(t,[e,n],!0,!1,c));return s.isImplicit=!0,s}if("float"===e.type||"int"===e.type){const r=new n.constructor(new i(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}if(("mat2"===e.type||"mat3"===e.type||"mat4"===e.type)&&"float"!==n.type){const r=new n.constructor(new i(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}const c=new e.constructor(new i(t,[e,n],!0,!1,e.constructor));return c.isImplicit=!0,c}function mt(t,e,n=e.constructor){const r=new n(new i(t,[e],!1,!1,n));return r.isImplicit=!0,r}function vt(t,e,n,r=e.constructor){const c=new r(new i(t,[e,n],!1,!1,r));return c.isImplicit=!0,c}function bt(t,e,n,r,c=e.constructor){const s=new c(new i(t,[e,n,r],!1,!1,c));return s.isImplicit=!0,s}function xt(t){return Dt(t,ut(-1))}function It(t,e,n,r){return new e(new s(t,e,n,r))}function gt(t,e){const n="function"==typeof t?t():t,r=new n.constructor(new u(n).setDebugName(e));return r.isImplicit=!0,r}function Et(t,e,n=0,r=t.size){const c=new W(n).setMutable().setDebugName("FindIndexIterator"),i=e(t.get(c)).setDebugName("FindIndexPredicate"),s=It({iter:c},W,i,(({out:t,iter:e,subgraph:n})=>`\n${t} = -1;\n\nfor (; ${e} < ${r}; ${e}++) {\n\n${n.body}\n\n if (${n.varName}) {\n ${t} = ${e};\n break;\n }\n\n}\n`)).setDebugName("FindIndexBlock");return s}function $t(t,e,n=0,r=t.size){const c=It({array:t},W,null,(({out:t,array:c})=>`\n${t} = -1;\nfor (int i = ${n}; i < ${r}; i++) {\n bool condition;\n ${e({array:c,i:"i",out:"condition"})}\n if (condition) {\n ${t} = i;\n break;\n }\n}\n`)).setDebugName("GlslFindIndexBlock");return c}function zt(t,e,n){const r="function"==typeof e?e():e,c="function"==typeof n?n():n,i=new r.constructor(new o(t,r,c));return i.isImplicit=!0,i}function Tt(...t){const e=t.map((([t,e])=>"function"==typeof e?[t,e()]:[t,e])),n=e[0][1].constructor,r=e.findIndex((t=>!0===t[0]));if(-1===r)throw new Error("A cond must have a fallthrough case with `true`/; ");const c=e.slice(0,r),i=e[r][1],s=new n(c.reduceRight(((t,e)=>zt(e[0],e[1],t)),i));return s.isImplicit=!0,s}function Nt(t,e){const n=new e.constructor(new o(t,e,null));return n.isImplicit=!0,n}function Dt(t,e){return yt("*",t,e)}function Ft(t,e){return yt("/",t,e)}function kt(t,e){return yt("+",t,e)}function Mt(t,e){return yt("-",t,e)}function St(t,e){return yt("%",t,e)}function jt(t,e){return yt("<<",t,e)}function Rt(t,e){return yt(">>",t,e)}function Pt(t,e){return yt("&",t,e)}function Bt(t,e){return yt("|",t,e)}function qt(t,e){return yt("^",t,e)}function Ut(t){return mt("~",t)}function _t(t,e){return yt("==",t,e,J)}function Ct(t,e){return yt("!=",t,e,J)}function Xt(t,e){return yt("<",t,e,J)}function Yt(t,e){return yt("<=",t,e,J)}function Gt(t,e){return yt(">",t,e,J)}function Ht(t,e){return yt(">=",t,e,J)}function At(...t){return t.length<=1?t[0]:t.slice(1).reduce(((t,e)=>Vt(t,e)),t[0])}function Vt(t,e){return yt("||",t,e,J)}function Jt(...t){return t.length<=1?t[0]:t.slice(1).reduce(((t,e)=>Kt(t,e)),t[0])}function Kt(t,e){return yt("^^",t,e,J)}function Lt(...t){return t.length<=1?t[0]:t.slice(1).reduce(((t,e)=>Ot(t,e)),t[0])}function Ot(t,e){return yt("&&",t,e,J)}function Qt(t){return mt("abs",t)}function Wt(t){return mt("acos",t)}function Zt(t){return mt("acosh",t)}function te(t){return mt("all",t,J)}function ee(t){return mt("any",t,J)}function ne(t){return mt("asin",t)}function re(t){return mt("asinh",t)}function ce(t,e){return null==e?mt("atan",t):vt("atan",t,e,t.constructor)}function ie(t){return mt("atanh",t)}function se(t){return mt("ceil",t)}function ue(t,e,n){return bt("clamp",t,e,n,t.constructor)}function oe(t){return mt("cos",t)}function he(t){return mt("cosh",t)}function le(t,e){return vt("cross",t,e,t.constructor)}function ae(t){return mt("dFdX",t)}function fe(t){return mt("dFdY",t)}function pe(t){return mt("degrees",t)}function de(t){return mt("determinant",t,_)}function we(t,e){return vt("distance",t,e,_)}function ye(t,e){return vt("dot",t,e,_)}function me(t,e){return vt("equal",t,e,N(t))}function ve(t,e){return vt("greaterThan",t,e,N(t))}function be(t,e){return vt("greaterThanEqual",t,e,N(t))}function xe(t){return mt("exp",t)}function Ie(t){return mt("exp2",t)}function ge(t,e,n){return bt("faceforward",t,e,n)}function Ee(t){return mt("floatBitsToInt",t,T(t))}function $e(t){return mt("floatBitsToUint",t,$(t))}function ze(t){return mt("floor",t)}function Te(t){return mt("fract",t)}function Ne(t){return mt("fwidth",t)}function De(t){return mt("intBitsToFloat",t,z(t))}function Fe(t){return mt("uintBitsToFloat",t,E(t))}function ke(t){return mt("inverse",t,_)}function Me(t){return mt("inversesqrt",t)}function Se(t){return mt("isinf",t,N(t))}function je(t){return mt("isnan",t,N(t))}function Re(t){return mt("length",t,_)}function Pe(t,e){return vt("lessThan",t,e,N(t))}function Be(t,e){return vt("lessThanEqual",t,e,N(t))}function qe(t){return mt("log",t)}function Ue(t){return mt("log2",t)}function _e(t,e){return vt("matrixCompMult",t,e)}function Ce(t,e){return vt("max",t,e)}function Xe(t,e){return vt("min",t,e)}function Ye(t,e,n){return bt("mix",t,e,n)}function Ge(t,e){return vt("mod",t,e)}function He(t,e){throw new Error("modf not implemented")}function Ae(t){return mt("normalize",t)}function Ve(t){return"bool"===t.type?mt("!",t):mt("not",t)}function Je(t,e){return vt("notEqual",t,e,N(t))}function Ke(t,e){throw new Error("Impl type?")}function Le(t){return mt("packHalf2x16",t,G)}function Oe(t){return mt("packUnorm2x16",t,G)}function Qe(t){return mt("packSnorm2x16",t,G)}function We(t,e){return vt("pow",t,e)}function Ze(t){return mt("radians",t)}function tn(t,e){return vt("reflect",t,e)}function en(t,e,n){return bt("refract",t,e,n)}function nn(t){return mt("round",t)}function rn(t){return mt("roundEven",t)}function cn(t){return mt("sign",t)}function sn(t){return mt("sin",t)}function un(t){return mt("sinh",t)}function on(t,e,n){return bt("smoothstep",t,e,n)}function hn(t){return mt("sqrt",t)}function ln(t,e){return vt("step",t,e,e.constructor)}function an(t){return mt("tan",t)}function fn(t){return mt("tanh",t)}function pn(t,e,n){return bt("texelFetch",t,e,n,Y)}function dn(t,e,n,r){throw new Error("Impl type")}function wn(t,e,n){throw new Error("Impl type")}function yn(t,e){return vt("texture",t,e,Y)}function mn(t,e,n,r){throw new Error("Impl type")}function vn(t,e,n,r,c){throw new Error("Impl type")}function bn(t,e,n){throw new Error("Impl type")}function xn(t,e,n,r){throw new Error("Impl type")}function In(t,e,n,r){throw new Error("Impl type")}function gn(t,e,n){throw new Error("Impl type")}function En(t,e,n,r){throw new Error("Impl type")}function $n(t,e,n,r,c){throw new Error("Impl type")}function zn(t,e,n){throw new Error("Impl type")}function Tn(t,e,n,r){throw new Error("Impl type")}function Nn(t,e,n,r){throw new Error("Impl type")}function Dn(t,e){throw new Error("Impl type")}function Fn(t){return mt("transpose",t)}function kn(t){return mt("trunc",t)}function Mn(t){return mt("unpackHalf2x16",t,C)}function Sn(t){return mt("unpackUnorm2x16",t,C)}function jn(t){return mt("unpackSnorm2x16",t,C)}function Rn(t,e){const{initialValue:n,xRange:r,yRange:c,callback:i}=e,[s,u]=r,[o,h]=c,l=new W(0).setMutable().setDebugName("iterX"),a=new W(0).setMutable().setDebugName("iterY"),f=n.setMutable().setDebugName("accumulator"),p=i(f,t.get(l,a),l,a).setDebugName("callback"),d=It({iterX:l,iterY:a,accumulator:f},n.constructor,p,(({out:t,iterX:e,iterY:n,accumulator:r,subgraph:c})=>`\nfor (${n} = ${o}; ${n} < ${h}; ${n}++) {\n for (${e} = ${s}; ${e} < ${u}; ${e}++) {\n\n ${c.body}\n\n ${r} = ${c.varName};\n }\n}\n${t} = ${r};\n`)).setDebugName("reduce2DBody");return d}export{K as BVec2,L as BVec3,Q as BVec4,J as Bool,B as FixedArray,q as FixedArray2D,_ as Float,Z as IVec2,tt as IVec3,et as IVec4,W as Int,nt as Mat2,rt as Mat3,ct as Mat4,U as Sampler2D,G as UInt,H as UVec2,A as UVec3,V as UVec4,C as Vec2,X as Vec3,Y as Vec4,Vt as _or,Kt as _xor,Qt as abs,Wt as acos,Zt as acosh,kt as add,te as all,Lt as and,ee as any,ne as asin,re as asinh,ce as atan,ie as atanh,Pt as bitAnd,Ut as bitNot,Bt as bitOr,Rt as bitRShift,jt as bitShift,qt as bitXor,It as block,se as ceil,ue as clamp,Tt as cond,oe as cos,he as cosh,le as cross,ae as dFdx,fe as dFdy,dt as definePropertyAccess,wt as definePropertyAccess2D,pe as degrees,de as determinant,we as distance,Ft as divide,ye as dot,_t as equal,me as equalComponent,xe as exp,Ie as exp2,ge as faceforward,Et as findIndex,ut as float,Ee as floatBitsToInt,$e as floatBitsToUint,ze as floor,Te as fract,Ne as fwidth,F as getTypeElementLengthForType,$t as glslFindIndex,Gt as greaterThan,ve as greaterThanComponent,Ht as greaterThanEqual,be as greaterThanEqualComponent,zt as ifElse,st as int,De as intBitsToFloat,St as intMod,ke as inverse,Me as inversesqrt,Se as isinf,je as isnan,Re as length,Xt as lessThan,Pe as lessThanComponent,Yt as lessThanEqual,Be as lessThanEqualComponent,qe as log,Ue as log2,at as mat2,ft as mat3,pt as mat4,_e as matrixCompMult,Ce as max,Xe as min,Ye as mix,Ge as mod,He as modf,Dt as multiply,gt as namedScope,xt as negate,Ae as normalize,Ve as not,Ct as notEqual,Je as notEqualComponent,At as or,Ke as outerProduct,Le as packHalf2x16,Qe as packSnorm2x16,Oe as packUnorm2x16,We as pow,Ze as radians,Rn as reduce2D,tn as reflect,en as refract,nn as round,rn as roundEven,cn as sign,sn as sin,un as sinh,on as smoothstep,hn as sqrt,ln as step,Mt as subtract,an as tan,fn as tanh,pn as texelFetch,dn as texelFetchOffset,wn as texture,yn as texture2D,mn as textureGrad,vn as textureGradOffset,bn as textureLod,xn as textureLodOffset,In as textureOffset,gn as textureProj,En as textureProjGrad,$n as textureProjGradOffset,zn as textureProjLod,Tn as textureProjLodOffset,Nn as textureProjOffset,Dn as textureSize,T as transformFloatToInt,$ as transformFloatToUInt,z as transformIntToFloat,N as transformTypeToBooleanType,E as transformUIntToFloat,Fn as transpose,kn as trunc,Fe as uintBitsToFloat,Mn as unpackHalf2x16,jn as unpackSnorm2x16,Sn as unpackUnorm2x16,ot as vec2,ht as vec3,lt as vec4,Nt as when,Jt as xor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- class t{getObjectId(t){return t.getObjectId()}getAttributes(t){return t.readAttributes()}getAttribute(t,e){return t.readAttribute(e)}getAttributeAsTimestamp(t,e){return t.readAttributeAsTimestamp(e)}cloneWithGeometry(t,e){return t}getGeometry(t){return t.readGeometryWorldSpace()}getCentroid(t,e){return t.readCentroidForDisplay()}}t.Shared=new t;export{t as FeatureStoreQueryAdapter};
5
+ class t{static{this.Shared=new t}getObjectId(t){return t.getObjectId()}getAttributes(t){return t.readAttributes()}getAttribute(t,e){return t.readAttribute(e)}getAttributeAsTimestamp(t,e){return t.readAttributeAsTimestamp(e)}cloneWithGeometry(t,e){return t}getGeometry(t){return t.readGeometryWorldSpace()}getCentroid(t,e){return t.readCentroidForDisplay()}}export{t as FeatureStoreQueryAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import o from"../../../core/ObjectPool.js";import l from"./TileKey.js";class s{constructor(){this.spans=[]}acquire(o){this.lodInfo=o}release(){this.lodInfo=null,this.spans.length=0}*keys(){const o=this.lodInfo;for(const{row:s,colFrom:e,colTo:r}of this.spans)for(let t=e;t<=r;t++){const e=o.getWorldForColumn(t);yield new l(o.level,s,o.normalizeCol(t),e)}}forEach(o,l){const{spans:s,lodInfo:e}=this,{level:r}=e;if(0!==s.length)for(const{row:t,colFrom:n,colTo:c}of s)for(let s=n;s<=c;s++)o.call(l,r,t,e.normalizeCol(s),e.getWorldForColumn(s))}}s.pool=new o(s);export{s as default};
5
+ import o from"../../../core/ObjectPool.js";import l from"./TileKey.js";class s{constructor(){this.spans=[]}static{this.pool=new o(s)}acquire(o){this.lodInfo=o}release(){this.lodInfo=null,this.spans.length=0}*keys(){const o=this.lodInfo;for(const{row:s,colFrom:t,colTo:e}of this.spans)for(let r=t;r<=e;r++){const t=o.getWorldForColumn(r);yield new l(o.level,s,o.normalizeCol(r),t)}}forEach(o,l){const{spans:s,lodInfo:t}=this,{level:e}=t;if(0!==s.length)for(const{row:r,colFrom:n,colTo:c}of s)for(let s=n;s<=c;s++)o.call(l,e,r,t.normalizeCol(s),t.getWorldForColumn(s))}}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/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../core/ObjectPool.js";class e{static getId(t,e,l,o){return"object"==typeof t?`${t.level}/${t.row}/${t.col}/${t.world}`:`${t}/${e}/${l}/${o}`}constructor(t,e,l,o){this.set(t,e,l,o)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(t){this.set(t)}get hash(){const t=4095&this.row,e=4095&this.col,l=63&this.level;return(3&this.world)<<30|e<<22|t<<8|l}acquire(t,e,l,o){this.set(t,e,l,o)}contains(t){const e=t.level-this.level;return e>=0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}containsChild(t){const e=t.level-this.level;return e>0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new e(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,e,l,o){if(null==t)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof t)this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if("string"==typeof t){const[e,l,o,s]=t.split("/");this.level=parseFloat(e),this.row=parseFloat(l),this.col=parseFloat(o),this.world=parseFloat(s)}else this.level=+t,this.row=+e,this.col=+l,this.world=+o||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new e(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(t,e,l){const o=this.clone();return o.col+=t,o.row+=e,l.normalizeKey(o),o}getChildKeys(){const t=this.level+1,l=this.row<<1,o=this.col<<1,s=this.world;return[new e(t,l,o,s),new e(t,l,o+1,s),new e(t,l+1,o,s),new e(t,l+1,o+1,s)]}compareRowMajor(t){return this.row<t.row?-1:this.row>t.row?1:this.col<t.col?-1:this.col>t.col?1:0}}e.pool=new t(e,null,null,25,50);export{e as default};
5
+ import t from"../../../core/ObjectPool.js";class e{static{this.pool=new t(e,null,null,25,50)}static getId(t,e,l,o){return"object"==typeof t?`${t.level}/${t.row}/${t.col}/${t.world}`:`${t}/${e}/${l}/${o}`}constructor(t,e,l,o){this.set(t,e,l,o)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(t){this.set(t)}get hash(){const t=4095&this.row,e=4095&this.col,l=63&this.level;return(3&this.world)<<30|e<<22|t<<8|l}acquire(t,e,l,o){this.set(t,e,l,o)}contains(t){const e=t.level-this.level;return e>=0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}containsChild(t){const e=t.level-this.level;return e>0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new e(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,e,l,o){if(null==t)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof t)this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if("string"==typeof t){const[e,l,o,s]=t.split("/");this.level=parseFloat(e),this.row=parseFloat(l),this.col=parseFloat(o),this.world=parseFloat(s)}else this.level=+t,this.row=+e,this.col=+l,this.world=+o||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new e(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(t,e,l){const o=this.clone();return o.col+=t,o.row+=e,l.normalizeKey(o),o}getChildKeys(){const t=this.level+1,l=this.row<<1,o=this.col<<1,s=this.world;return[new e(t,l,o,s),new e(t,l,o+1,s),new e(t,l+1,o,s),new e(t,l+1,o+1,s)]}compareRowMajor(t){return this.row<t.row?-1:this.row>t.row?1:this.col<t.col?-1:this.col>t.col?1:0}}export{e as default};