@arcgis/core 5.2.0-next.75 → 5.2.0-next.76

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 (355) hide show
  1. package/arcgisGlobal.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/013c9cc198736a72f7f2.js +1 -0
  4. package/assets/esri/core/workers/chunks/0194244a3f437ad74045.js +1 -0
  5. package/assets/esri/core/workers/chunks/{4dcd4a052b40047a9230.js → 08cac27df6c216ae1995.js} +1 -1
  6. package/assets/esri/core/workers/chunks/08ec5461af74356e7570.js +1 -0
  7. package/assets/esri/core/workers/chunks/0909816f13d25cacf250.js +1 -0
  8. package/assets/esri/core/workers/chunks/0933203eee15ea50e123.js +1 -0
  9. package/assets/esri/core/workers/chunks/{5e1d84e97de0e662aaa9.js → 1142f8e9c80207d6bdae.js} +1 -1
  10. package/assets/esri/core/workers/chunks/16929524565a677db4dc.js +1 -0
  11. package/assets/esri/core/workers/chunks/16a04fc184728d66e6e1.js +1 -0
  12. package/assets/esri/core/workers/chunks/177c3b23c1cbd4737049.js +1 -0
  13. package/assets/esri/core/workers/chunks/1a467da4c0b33f655199.js +1 -0
  14. package/assets/esri/core/workers/chunks/1ef28d4457c8c943ad19.js +1 -0
  15. package/assets/esri/core/workers/chunks/{2b93888e61ca638490cf.js → 20b54e7872d967f3be32.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{5f31b375971ab067121e.js → 21f763694a41968ac21a.js} +1 -1
  17. package/assets/esri/core/workers/chunks/230925079cee040a8d77.js +1 -0
  18. package/assets/esri/core/workers/chunks/257f1e8316877f611e11.js +1 -0
  19. package/assets/esri/core/workers/chunks/270ed3070d118edb3f37.js +1 -0
  20. package/assets/esri/core/workers/chunks/2e7c830b5b1fe406169f.js +1 -0
  21. package/assets/esri/core/workers/chunks/315031323e11a18154e3.js +1 -0
  22. package/assets/esri/core/workers/chunks/393f79843d5a78c1cc37.js +1 -0
  23. package/assets/esri/core/workers/chunks/3b5c5356353f1a2303a0.js +1 -0
  24. package/assets/esri/core/workers/chunks/{99e3aa4832ed87474ab4.js → 44857a76be2c0ac65bb9.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{3e2b4e734aa20a308f3e.js → 46e56fac44e0fd26ba1d.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{4491dc227c28e2ab4f8e.js → 484b251fbcbffcb58323.js} +1 -1
  27. package/assets/esri/core/workers/chunks/48e2d0bfb62e1f4f2ad9.js +1 -0
  28. package/assets/esri/core/workers/chunks/4945d6b0ca1812864185.js +1 -0
  29. package/assets/esri/core/workers/chunks/{7f2f2a92dce3f68e579b.js → 4b54444c04fbd6f42c18.js} +1 -1
  30. package/assets/esri/core/workers/chunks/4c82f5f23004f905a18f.js +1 -0
  31. package/assets/esri/core/workers/chunks/4f8ce5887102971bfa34.js +2 -0
  32. package/assets/esri/core/workers/chunks/{186bedc377cc97731ca2.js → 532e3a59888e4cc13bd3.js} +2 -2
  33. package/assets/esri/core/workers/chunks/53eed0941a39b56cc034.js +1 -0
  34. package/assets/esri/core/workers/chunks/56e6d8c4a9ed893ce951.js +1 -0
  35. package/assets/esri/core/workers/chunks/57159bcac86d660dcceb.js +1 -0
  36. package/assets/esri/core/workers/chunks/58026fc30d8a0ded4102.js +1 -0
  37. package/assets/esri/core/workers/chunks/59598023c0aea62a6297.js +1 -0
  38. package/assets/esri/core/workers/chunks/5bf2ce280ea35ea4c96b.js +1 -0
  39. package/assets/esri/core/workers/chunks/5fd2aa0be03dfb494efa.js +1 -0
  40. package/assets/esri/core/workers/chunks/619aa1381296172ff47b.js +1 -0
  41. package/assets/esri/core/workers/chunks/62f37d1075390a177ae9.js +1 -0
  42. package/assets/esri/core/workers/chunks/65d1e338612e59063eba.js +1 -0
  43. package/assets/esri/core/workers/chunks/680dd7b7638465eb33de.js +1 -0
  44. package/assets/esri/core/workers/chunks/6c740c411b085d2d08c4.js +1 -0
  45. package/assets/esri/core/workers/chunks/{b14961a9f1f40028f141.js → 6c982779d6d47ec99899.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{0eb35e09765fd74eb698.js → 6e45ecf359bce3417f5d.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{a52c88e2d837b525ff6c.js → 71ee7c51d2c60a180f1e.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{ad1d06a91121ebfe9162.js → 755b2d883fba90c4e688.js} +2 -2
  49. package/assets/esri/core/workers/chunks/{6b783f440c4a5d36e879.js → 75fc0b1db8e2e3fd2458.js} +1 -1
  50. package/assets/esri/core/workers/chunks/79429c8be5da85713200.js +1 -0
  51. package/assets/esri/core/workers/chunks/7b470d6ad182548b9e95.js +1 -0
  52. package/assets/esri/core/workers/chunks/7d8eb4dbea1916320f74.js +1 -0
  53. package/assets/esri/core/workers/chunks/83e54166ba634ec2bd89.js +1717 -0
  54. package/assets/esri/core/workers/chunks/87eaed6fdabd482d142e.js +1 -0
  55. package/assets/esri/core/workers/chunks/88d5541679e77117bf03.js +1 -0
  56. package/assets/esri/core/workers/chunks/894ebc64b698e5d7604b.js +1 -0
  57. package/assets/esri/core/workers/chunks/{67f54586156d1ab80257.js → 8b980c6b92cc4ea68ede.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{4046bd65d7d0677f4600.js → 8d9a7fa14489897780d3.js} +1 -1
  59. package/assets/esri/core/workers/chunks/8e225dd0319672103561.js +1 -0
  60. package/assets/esri/core/workers/chunks/9199300ffd225a1bbef1.js +1 -0
  61. package/assets/esri/core/workers/chunks/{5ba3a30b7cbfa9e3aa62.js → 94b9a61b4dbb83425a78.js} +1 -1
  62. package/assets/esri/core/workers/chunks/98613fded899c59f34a4.js +1 -0
  63. package/assets/esri/core/workers/chunks/{6743d726e45e7b660505.js → 9c3e6325dc60bcaf44d7.js} +1 -1
  64. package/assets/esri/core/workers/chunks/9e1392a0c608a13ab036.js +1 -0
  65. package/assets/esri/core/workers/chunks/{7a24cc0f3b4eff2bdb8e.js → 9e2e4d197a7a57c2a691.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{d03e7be74c57c3dbf003.js → a014c17fc210620da738.js} +2 -2
  67. package/assets/esri/core/workers/chunks/{8302bffd28cc6720e0fe.js → a19be304219808268039.js} +2 -2
  68. package/assets/esri/core/workers/chunks/{53d165b4f30fd64e5d8a.js → a4e4fa4dd1a122bbf7cd.js} +1 -1
  69. package/assets/esri/core/workers/chunks/a5240c8a47842138f31f.js +1 -0
  70. package/assets/esri/core/workers/chunks/a69c10bfd632a5546b34.js +1 -0
  71. package/assets/esri/core/workers/chunks/a7727a2377470d586ff9.js +1 -0
  72. package/assets/esri/core/workers/chunks/a91c1d782346a9c7e1ef.js +1 -0
  73. package/assets/esri/core/workers/chunks/{6cd6d0cfd313f0475d98.js → ac59218847e5ef4c4160.js} +1 -1
  74. package/assets/esri/core/workers/chunks/ac87be2210f868524996.js +1 -0
  75. package/assets/esri/core/workers/chunks/aed16c3e26652960ad3f.js +1 -0
  76. package/assets/esri/core/workers/chunks/{43713bc6f7eea07259d0.js → b084829a3fd709dc47a8.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{05f6887805d92da03122.js → b24fc7eeda580ef020d2.js} +1 -1
  78. package/assets/esri/core/workers/chunks/b37a20c5c4a4686257d4.js +1 -0
  79. package/assets/esri/core/workers/chunks/{43a65cab888d43954564.js → b4abf82b8ac974a55ae1.js} +1 -1
  80. package/assets/esri/core/workers/chunks/b950ddafba8125c84a5b.js +1 -0
  81. package/assets/esri/core/workers/chunks/bab5f4b2424b487b87ac.js +1 -0
  82. package/assets/esri/core/workers/chunks/{0d3b2d9a19383bb63f0a.js → bad2c7219e95750906e1.js} +1 -1
  83. package/assets/esri/core/workers/chunks/bbc6b270d2032189107c.js +1 -0
  84. package/assets/esri/core/workers/chunks/bc6e488f5fbd50f9f3d0.js +1 -0
  85. package/assets/esri/core/workers/chunks/bd7d87d175ba933ab2ce.js +1 -0
  86. package/assets/esri/core/workers/chunks/{1c49c9472167a2e0c923.js → c17dda6fadb8bfad0d51.js} +1 -1
  87. package/assets/esri/core/workers/chunks/c1e5ffe9a251be5a0744.js +1 -0
  88. package/assets/esri/core/workers/chunks/ca6652c6304ad0e37e8f.js +1 -0
  89. package/assets/esri/core/workers/chunks/{762be5d3e6aeaea33f74.js → cef02ed3942c010da2e8.js} +1 -1
  90. package/assets/esri/core/workers/chunks/d520d407043bc52e5410.js +1 -0
  91. package/assets/esri/core/workers/chunks/da0ef984509057ec8507.js +1 -0
  92. package/assets/esri/core/workers/chunks/dbdd96e558936955acdb.js +1 -0
  93. package/assets/esri/core/workers/chunks/de927b1460bc384f5b87.js +1 -0
  94. package/assets/esri/core/workers/chunks/de9a1cce70581920f248.js +1 -0
  95. package/assets/esri/core/workers/chunks/dff932682d6386a861ce.js +1 -0
  96. package/assets/esri/core/workers/chunks/{2c31648a4b95275516ee.js → e227eb44cd139fe2bc1b.js} +1 -1
  97. package/assets/esri/core/workers/chunks/e4e5a171a4874c5af4a4.js +1 -0
  98. package/assets/esri/core/workers/chunks/{ddb92c815d17c67a45e6.js → e5d114f2b57d2b8e2f1c.js} +1 -1
  99. package/assets/esri/core/workers/chunks/e89e6eea380ca2c13b64.js +1 -0
  100. package/assets/esri/core/workers/chunks/e9d352d030dcad1619a6.js +1 -0
  101. package/assets/esri/core/workers/chunks/{3de6e54b6ed0feae1940.js → eae51e827f629ab37207.js} +1 -1
  102. package/assets/esri/core/workers/chunks/eee1fd629619021ea279.js +1 -0
  103. package/assets/esri/core/workers/chunks/{b6cd165d0e58598f28a5.js → ef47a5da641cb0d33fdf.js} +1 -1
  104. package/assets/esri/core/workers/chunks/f35e749bb5be39880cbe.js +1 -0
  105. package/assets/esri/core/workers/chunks/{3dff36f6de181d9dcdc5.js → f40e4433e7608d0962a6.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{d1c7c877edc6948f3801.js → f4aa6e90200f61e623e5.js} +1 -1
  107. package/assets/esri/core/workers/chunks/{36ec5b84e551ab08b24a.js → ff578f0ca68d652fece5.js} +1 -1
  108. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  109. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  110. package/assets/esri/libs/text/pkg/bundle_bg.wasm +0 -0
  111. package/chunks/HeatmapDensity.glsl.js +5 -5
  112. package/chunks/bundle2.js +1 -1
  113. package/chunks/lyr3DMain.js +1 -1
  114. package/chunks/lyr3DWorker.js +1 -1
  115. package/config.js +1 -1
  116. package/geometry/geometryEngine.js +1 -1
  117. package/geometry/support/centroid.js +1 -1
  118. package/geometry/support/extentUtils.js +1 -1
  119. package/geometry/support/frustum.js +1 -1
  120. package/kernel.js +1 -1
  121. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  122. package/layers/graphics/data/QueryEngineResult.js +1 -1
  123. package/layers/graphics/data/projectionSupport.js +1 -1
  124. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  125. package/package.json +2 -2
  126. package/support/revision.js +1 -1
  127. package/symbols/cim/animationUtils.js +1 -1
  128. package/symbols/cim/cimAnalyzer.js +1 -1
  129. package/symbols/cim/effects/EffectCircularSector.js +1 -1
  130. package/views/2d/engine/BitmapTile.js +1 -1
  131. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  132. package/views/2d/engine/flow/styles/Particles.js +1 -1
  133. package/views/2d/engine/flow/styles/Streamlines.js +1 -1
  134. package/views/2d/engine/imagery/RasterTile.js +1 -1
  135. package/views/2d/engine/imagery/RasterVFTile.js +1 -1
  136. package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
  137. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  138. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  139. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  140. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  141. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  142. package/views/2d/engine/webgl/Painter.js +1 -1
  143. package/views/2d/engine/webgl/RenderingDevice.js +1 -1
  144. package/views/2d/engine/webgl/TileContainer.js +1 -1
  145. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  146. package/views/2d/engine/webgl/animations/infos.js +1 -1
  147. package/views/2d/engine/webgl/animations/instructions.js +1 -1
  148. package/views/2d/engine/webgl/normalizedTileUtils.js +1 -1
  149. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  150. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  151. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  152. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
  153. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
  154. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  155. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  156. package/views/2d/engine/webgl/shaderGraph/techniques/bitmap/BitmapTechnique.js +1 -1
  157. package/views/2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js +1 -1
  158. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPointShader.js +1 -1
  159. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  160. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  161. package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
  162. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  163. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  164. package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
  165. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  166. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
  167. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  168. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  169. package/views/2d/engine/webgl/shaderGraph/techniques/flow/FlowTechnique.js +1 -1
  170. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  171. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  172. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  173. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
  174. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  175. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  176. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  177. package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
  178. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
  179. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  180. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  181. package/views/2d/engine/webgl/shaderGraph/techniques/raster/VectorFieldTechnique.js +1 -1
  182. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  183. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitmapShader.js +1 -1
  184. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js +1 -1
  185. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
  186. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
  187. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientFillShader.js +1 -1
  188. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
  189. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
  190. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  191. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  192. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader.js +1 -1
  193. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
  194. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/Tile.js +1 -1
  195. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js +1 -1
  196. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileInfo.js +1 -1
  197. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js +1 -1
  198. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js +1 -1
  199. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  200. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
  201. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/MagDirShader.js +1 -1
  202. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/ScalarShader.js +1 -1
  203. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderBackground.js +1 -1
  204. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderCircle.js +1 -1
  205. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderFill.js +1 -1
  206. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderIcon.js +1 -1
  207. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderLine.js +1 -1
  208. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderOutline.js +1 -1
  209. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderText.js +1 -1
  210. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  211. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  212. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +1 -1
  213. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileStencilTechnique.js +1 -1
  214. package/views/2d/engine/webgl/shaderGraph/techniques/utility/DebugOverlayTechnique.js +1 -1
  215. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
  216. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
  217. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
  218. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
  219. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
  220. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  221. package/views/2d/engine/webgl/shaderGraph/types.js +2 -0
  222. package/views/2d/engine/webgl/shaderGraph/uniformBufferUtils.js +2 -0
  223. package/views/2d/layers/MediaLayerView2D.js +1 -1
  224. package/views/2d/layers/TileLayerView2D.js +1 -1
  225. package/views/2d/layers/support/DisplayGL.js +1 -1
  226. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  227. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  228. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  229. package/views/3d/layers/MediaLayerView3D.js +1 -1
  230. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  231. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  232. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  233. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  234. package/views/3d/support/GaussianSplatWorkerHandle.js +1 -1
  235. package/views/3d/support/flow/geometryUtils.js +1 -1
  236. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  237. package/views/3d/support/renderInfoUtils/line.js +1 -1
  238. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  239. package/views/3d/terrain/DrapedZ.js +2 -0
  240. package/views/3d/terrain/OverlayRenderer.js +1 -1
  241. package/views/3d/terrain/TileCompositor.js +1 -1
  242. package/views/3d/webgl/RenderCamera.js +1 -1
  243. package/views/3d/webgl/RenderNode.js +1 -1
  244. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +2 -2
  245. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +2 -2
  246. package/views/3d/webgl-engine/lib/PositionReader.js +1 -1
  247. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  248. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +1 -1
  249. package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
  250. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  251. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  252. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  253. package/views/3d/webgl-engine/shaders/HeatmapDensity.glsl.js +1 -1
  254. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  255. package/views/VideoView.js +1 -1
  256. package/views/webgl/RenderingContext.js +1 -1
  257. package/views/webgl/UniformBufferLayout.js +1 -1
  258. package/views/webgl/UniformBufferObject.js +1 -1
  259. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +20 -6
  260. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  261. package/widgets/BatchAttributeForm/inputs/support/MultipleChoiceController.d.ts +100 -0
  262. package/widgets/BatchAttributeForm/inputs/support/MultipleChoiceController.js +2 -0
  263. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  264. package/widgets/BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js +1 -1
  265. package/widgets/BatchAttributeForm.js +1 -1
  266. package/widgets/OrientedImageryViewer.js +1 -1
  267. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  268. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  269. package/widgets/UtilityNetworkTrace/support/ResultAreaHandler.js +1 -1
  270. package/assets/esri/core/workers/chunks/02dd79beb13eff6be85e.js +0 -1
  271. package/assets/esri/core/workers/chunks/0823961e5d0bdedbf8cf.js +0 -2
  272. package/assets/esri/core/workers/chunks/0aedeb837399d3f92e4a.js +0 -1
  273. package/assets/esri/core/workers/chunks/0bf644f93c180a2bc2f8.js +0 -705
  274. package/assets/esri/core/workers/chunks/0daaa89de339e8ea4b81.js +0 -1
  275. package/assets/esri/core/workers/chunks/1119a33245138e7b3914.js +0 -1
  276. package/assets/esri/core/workers/chunks/12234a63d3fa4bc25e7e.js +0 -1
  277. package/assets/esri/core/workers/chunks/1cf8fb704c48ac3d3b15.js +0 -1
  278. package/assets/esri/core/workers/chunks/2435ef7d11f8dbb920b7.js +0 -256
  279. package/assets/esri/core/workers/chunks/2791f3fe16ca5ee2f39a.js +0 -1
  280. package/assets/esri/core/workers/chunks/27f574acf52f2c8bc2c9.js +0 -1
  281. package/assets/esri/core/workers/chunks/2d45daacec0d5ed38782.js +0 -1
  282. package/assets/esri/core/workers/chunks/2ea3ca68cfa4d34e8f3b.js +0 -1
  283. package/assets/esri/core/workers/chunks/2f81047790c4890ae625.js +0 -1
  284. package/assets/esri/core/workers/chunks/3235e14fedb19dd94807.js +0 -1
  285. package/assets/esri/core/workers/chunks/32f5112c848efec6c33b.js +0 -1
  286. package/assets/esri/core/workers/chunks/3bc2943035391b44d4cf.js +0 -29
  287. package/assets/esri/core/workers/chunks/3c32471785bc8570e41c.js +0 -1
  288. package/assets/esri/core/workers/chunks/4295822fa6ef743c76f1.js +0 -1
  289. package/assets/esri/core/workers/chunks/42d5ed44111bea77ec71.js +0 -1462
  290. package/assets/esri/core/workers/chunks/46873badbd6ce8ff4e1e.js +0 -1
  291. package/assets/esri/core/workers/chunks/4710f21b138a2c9a0345.js +0 -1
  292. package/assets/esri/core/workers/chunks/4b5bd0c9a55ea2998601.js +0 -1
  293. package/assets/esri/core/workers/chunks/4c2794687aea172775a0.js +0 -1
  294. package/assets/esri/core/workers/chunks/4d9bde9f66817a92ceca.js +0 -1
  295. package/assets/esri/core/workers/chunks/4fe2cca405180af23364.js +0 -1
  296. package/assets/esri/core/workers/chunks/519af918050b47f93516.js +0 -1
  297. package/assets/esri/core/workers/chunks/5600fc334d20c4f0c83d.js +0 -1
  298. package/assets/esri/core/workers/chunks/5627f562dea8bae2f346.js +0 -1
  299. package/assets/esri/core/workers/chunks/5bf4ab72b9634b06cc5d.js +0 -1
  300. package/assets/esri/core/workers/chunks/5e3d5347223f0111f40f.js +0 -1
  301. package/assets/esri/core/workers/chunks/6f58cb9dffe8016397a2.js +0 -1
  302. package/assets/esri/core/workers/chunks/6fc3553c52af6ace926d.js +0 -1
  303. package/assets/esri/core/workers/chunks/7aaa051b51a8e34bbfb0.js +0 -1
  304. package/assets/esri/core/workers/chunks/7dc5aedc964eacd1be5a.js +0 -1
  305. package/assets/esri/core/workers/chunks/7f91e45156bbe88f9a62.js +0 -1
  306. package/assets/esri/core/workers/chunks/8a48a6760c33ed50b650.js +0 -1
  307. package/assets/esri/core/workers/chunks/8d21e2dabc5165f1c8ca.js +0 -1
  308. package/assets/esri/core/workers/chunks/903e1cd8b76eff19ebdf.js +0 -1
  309. package/assets/esri/core/workers/chunks/917c11cb40a7742d7f98.js +0 -1
  310. package/assets/esri/core/workers/chunks/91d133c04ca764d74934.js +0 -1
  311. package/assets/esri/core/workers/chunks/92c4464b67fce6cea134.js +0 -1
  312. package/assets/esri/core/workers/chunks/947f1ea4dbc3e3419ecc.js +0 -1
  313. package/assets/esri/core/workers/chunks/9482a6d7baa24bbf5693.js +0 -1
  314. package/assets/esri/core/workers/chunks/96cec8a02ca96175d602.js +0 -1
  315. package/assets/esri/core/workers/chunks/9902fcd2070c8eb6d043.js +0 -1
  316. package/assets/esri/core/workers/chunks/9b76c8974424a1908e86.js +0 -1
  317. package/assets/esri/core/workers/chunks/9be6827e5756031a56c1.js +0 -1
  318. package/assets/esri/core/workers/chunks/9cff18e6f751d1b3085e.js +0 -1
  319. package/assets/esri/core/workers/chunks/a101152066dd56259619.js +0 -1
  320. package/assets/esri/core/workers/chunks/a2a2c7e274fb32fecffa.js +0 -1
  321. package/assets/esri/core/workers/chunks/a3bf8aa81ee398da5b52.js +0 -1
  322. package/assets/esri/core/workers/chunks/a7a7d3289d4ca95f545f.js +0 -1
  323. package/assets/esri/core/workers/chunks/abb6c76d5dba3559a68e.js +0 -1
  324. package/assets/esri/core/workers/chunks/afeeb11b39e140303b5a.js +0 -1
  325. package/assets/esri/core/workers/chunks/b1a175b3b2d1a7ddde8e.js +0 -1
  326. package/assets/esri/core/workers/chunks/b78f509fd8e95f728178.js +0 -1
  327. package/assets/esri/core/workers/chunks/b858adff7043683fe41c.js +0 -1
  328. package/assets/esri/core/workers/chunks/be1d2c3a61e6447fbbc7.js +0 -1
  329. package/assets/esri/core/workers/chunks/c02ae1d40c1fe95ae6c5.js +0 -1
  330. package/assets/esri/core/workers/chunks/c1189316d24fb4cdb2a0.js +0 -1
  331. package/assets/esri/core/workers/chunks/c53b2be005721591e29b.js +0 -1
  332. package/assets/esri/core/workers/chunks/c82ab4f0908290e70ee9.js +0 -1
  333. package/assets/esri/core/workers/chunks/cc5ec6e99aa09342c704.js +0 -1
  334. package/assets/esri/core/workers/chunks/cd892c9603710d6130a9.js +0 -1
  335. package/assets/esri/core/workers/chunks/d021775cf747556660a5.js +0 -1
  336. package/assets/esri/core/workers/chunks/d633e98b0dfa0490e4de.js +0 -1
  337. package/assets/esri/core/workers/chunks/d79ce047afbc034f6008.js +0 -1
  338. package/assets/esri/core/workers/chunks/d8eca13c127b443141b7.js +0 -1
  339. package/assets/esri/core/workers/chunks/dbc9249dae41096d750d.js +0 -1
  340. package/assets/esri/core/workers/chunks/eb1a86159dbc098f06fe.js +0 -1
  341. package/assets/esri/core/workers/chunks/ec1841e6e498d54012eb.js +0 -1
  342. package/assets/esri/core/workers/chunks/ed1de8b7406269e217b9.js +0 -29
  343. package/assets/esri/core/workers/chunks/ee9eb381e675d2d01260.js +0 -1
  344. package/assets/esri/core/workers/chunks/f2ab8e49c7f17f488aa8.js +0 -1
  345. package/assets/esri/core/workers/chunks/f43a0edf58941e2ac78e.js +0 -1
  346. package/assets/esri/core/workers/chunks/f78acff510ca615d42e4.js +0 -1
  347. package/assets/esri/core/workers/chunks/f7a5c4d22a24e1ac433c.js +0 -1
  348. package/chunks/geometryEngineBase.js +0 -2
  349. package/geometry/geometryAdapters/json.js +0 -2
  350. package/geometry/geometryEngineJSON.js +0 -2
  351. /package/assets/esri/core/workers/chunks/{0823961e5d0bdedbf8cf.js.LICENSE.txt → 4f8ce5887102971bfa34.js.LICENSE.txt} +0 -0
  352. /package/assets/esri/core/workers/chunks/{186bedc377cc97731ca2.js.LICENSE.txt → 532e3a59888e4cc13bd3.js.LICENSE.txt} +0 -0
  353. /package/assets/esri/core/workers/chunks/{ad1d06a91121ebfe9162.js.LICENSE.txt → 755b2d883fba90c4e688.js.LICENSE.txt} +0 -0
  354. /package/assets/esri/core/workers/chunks/{d03e7be74c57c3dbf003.js.LICENSE.txt → a014c17fc210620da738.js.LICENSE.txt} +0 -0
  355. /package/assets/esri/core/workers/chunks/{8302bffd28cc6720e0fe.js.LICENSE.txt → a19be304219808268039.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{subtract as e,length as t,scale as f}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isOrthoNormal as r,hasIdentityRotation as i}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as n,BufferViewVec4f as s,BufferViewFloat as c,BufferViewVec2i16 as l,BufferViewVec2f16 as d,BufferViewVec2f as u,BufferViewVec3f as a}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as p}from"../../lib/Util.js";function g(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c)i[f]=o[r[c]],f+=n}function y(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l)n[f]=r[i[l]],f+=s;else for(let l=0;l<c;++l){const e=r[i[l]];for(let t=0;t<o;t++)n[f]=e,f+=s}}function B(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c)i[f]=o[r[c]],f+=n}function h(e,t,f){const{data:o,stride:r,indices:i}=e,n=i.length;for(let s=0;s<n;++s)t.set(f+s,o[r*i[s]])}function b(e,t,f){const{data:o,stride:r,indices:i}=e,n=i.length;for(let s=0;s<n;++s)t.set(f+s,o[r*i[s]])}function m(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=2*r[c];i[f]=o[e],i[f+1]=o[e+1],f+=n}}function v(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l){const e=3*i[l];n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],f+=s}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<o;++t)n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],f+=s}}function S(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l){const e=4*i[l];n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],n[f+3]=r[e+3],f+=s}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<o;++t)n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],n[f+3]=r[e+3],f+=s}}function F(e,t,f){const o=e.typedBuffer,r=e.typedBufferStride,i=e.elementCount;t*=r;for(let n=0;n<f;++n){for(let e=0;e<i;++e)o[t+e]=0;t+=r}}function z(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=9*r[c];for(let t=0;t<9;++t)i[f+t]=o[e+t];f+=n}}function w(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=16*r[c];for(let t=0;t<16;++t)i[f+t]=o[e+t];f+=n}}function k(e,t,f,o,r=1){if(!t)return void v(e,f,o,r);const{data:n,indices:s}=e,c=f.typedBuffer,l=f.typedBufferStride,d=s.length,u=t[0],a=t[1],p=t[2],g=t[4],y=t[5],B=t[6],h=t[8],b=t[9],m=t[10],S=t[12],F=t[13],z=t[14];o*=l;let w=0,k=0,N=0;const $=i(t)?e=>{w=n[e]+S,k=n[e+1]+F,N=n[e+2]+z}:e=>{const t=n[e],f=n[e+1],o=n[e+2];w=u*t+g*f+h*o+S,k=a*t+y*f+b*o+F,N=p*t+B*f+m*o+z};if(1===r)for(let i=0;i<d;++i)$(3*s[i]),c[o]=w,c[o+1]=k,c[o+2]=N,o+=l;else for(let i=0;i<d;++i){$(3*s[i]);for(let e=0;e<r;++e)c[o]=w,c[o+1]=k,c[o+2]=N,o+=l}}function N(e,t,f,o,n=1){if(!t)return void v(e,f,o,n);const{data:s,indices:c}=e,l=t,d=f.typedBuffer,u=f.typedBufferStride,a=c.length,p=l[0],g=l[1],y=l[2],B=l[4],h=l[5],b=l[6],m=l[8],S=l[9],F=l[10],z=!r(l),w=1e-6,k=1-w;o*=u;let N=0,$=0,x=0;const M=i(l)?e=>{N=s[e],$=s[e+1],x=s[e+2]}:e=>{const t=s[e],f=s[e+1],o=s[e+2];N=p*t+B*f+m*o,$=g*t+h*f+S*o,x=y*t+b*f+F*o};if(1===n)if(z)for(let r=0;r<a;++r){M(3*c[r]);const e=N*N+$*$+x*x;if(e<k&&e>w){const t=1/Math.sqrt(e);d[o]=N*t,d[o+1]=$*t,d[o+2]=x*t}else d[o]=N,d[o+1]=$,d[o+2]=x;o+=u}else for(let r=0;r<a;++r)M(3*c[r]),d[o]=N,d[o+1]=$,d[o+2]=x,o+=u;else for(let r=0;r<a;++r){if(M(3*c[r]),z){const e=N*N+$*$+x*x;if(e<k&&e>w){const t=1/Math.sqrt(e);N*=t,$*=t,x*=t}}for(let e=0;e<n;++e)d[o]=N,d[o+1]=$,d[o+2]=x,o+=u}}function $(e,t,f,o,i=1){if(!t)return void S(e,f,o,i);const{data:n,indices:s}=e,c=t,l=f.typedBuffer,d=f.typedBufferStride,u=s.length,a=c[0],p=c[1],g=c[2],y=c[4],B=c[5],h=c[6],b=c[8],m=c[9],v=c[10],F=!r(c),z=1e-6,w=1-z;if(o*=d,1===i)for(let r=0;r<u;++r){const e=4*s[r],t=n[e],f=n[e+1],i=n[e+2],c=n[e+3];let u=a*t+y*f+b*i,S=p*t+B*f+m*i,k=g*t+h*f+v*i;if(F){const e=u*u+S*S+k*k;if(e<w&&e>z){const t=1/Math.sqrt(e);u*=t,S*=t,k*=t}}l[o]=u,l[o+1]=S,l[o+2]=k,l[o+3]=c,o+=d}else for(let r=0;r<u;++r){const e=4*s[r],t=n[e],f=n[e+1],c=n[e+2],u=n[e+3];let S=a*t+y*f+b*c,k=p*t+B*f+m*c,N=g*t+h*f+v*c;if(F){const e=S*S+k*k+N*N;if(e<w&&e>z){const t=1/Math.sqrt(e);S*=t,k*=t,N*=t}}for(let r=0;r<i;++r)l[o]=S,l[o+1]=k,l[o+2]=N,l[o+3]=u,o+=d}}function x(e,t,f,o,r=1){const{data:i,indices:n}=e,s=f.typedBuffer,c=f.typedBufferStride,l=n.length;if(o*=c,t===i.length&&4===t){s[o]=i[0],s[o+1]=i[1],s[o+2]=i[2],s[o+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,n=e[o/=4];o+=t;const d=l*r;for(let f=1;f<d;++f)e[o]=n,o+=t;return}if(1!==r)if(4!==t)for(let d=0;d<l;++d){const e=3*n[d];for(let t=0;t<r;++t)s[o]=i[e],s[o+1]=i[e+1],s[o+2]=i[e+2],s[o+3]=255,o+=c}else for(let d=0;d<l;++d){const e=4*n[d];for(let t=0;t<r;++t)s[o]=i[e],s[o+1]=i[e+1],s[o+2]=i[e+2],s[o+3]=i[e+3],o+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*n[e];s[o]=i[t],s[o+1]=i[t+1],s[o+2]=i[t+2],s[o+3]=i[t+3],o+=c}return}for(let e=0;e<l;++e){const t=3*n[e];s[o]=i[t],s[o+1]=i[t+1],s[o+2]=i[t+2],s[o+3]=255,o+=c}}}function M(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length,c=o[0];f*=n;for(let l=0;l<s;++l)i[f]=c,f+=n}function j(o,r,i,n){e(q,o,r);const s=Math.max(Math.sqrt(t(q)),1e-4);f(q,q,1/s),i[n++]=q[0],i[n++]=q[1],i[n++]=q[2],i[n++]=s}const q=o();function A(e,t,f,o,r=1){const i=t.typedBuffer,n=t.typedBufferStride;if(o*=n,1===r)for(let s=0;s<f;++s)i[o]=e[0],i[o+1]=e[1],i[o+2]=e[2],i[o+3]=e[3],o+=n;else for(let s=0;s<f;++s)for(let t=0;t<r;++t)i[o]=e[0],i[o+1]=e[1],i[o+2]=e[2],i[o+3]=e[3],o+=n}function C(e,t,f,o,r,i){const{buffer:s,offset:c}=i;for(const l of f.fields.keys()){const f=e.get(l),i=f?.indices;if(f&&i)U(l,f,o,r,s,c);else if("olidColor"===l&&null!=t){const f=e.get("position")?.indices;if(f){const e=f.length;A(t,s.getField(l,n),e,c)}}}}function U(e,t,f,o,r,i){switch(e){case"position":{p(3===t.size);const o=r.getField(e,a);p(!!o,`No buffer view for ${e}`),k(t,f,o,i);break}case"normal":{p(3===t.size);const f=r.getField(e,a);p(!!f,`No buffer view for ${e}`),N(t,o,f,i);break}case"normalCompressed":case"profileRight":case"profileUp":{p(2===t.size);const f=r.getField(e,l);p(!!f,`No buffer view for ${e}`),m(t,f,i);break}case"uv0":{p(2===t.size);const f=r.getField(e,d)??r.getField(e,u);p(!!f,`No buffer view for ${e}`),m(t,f,i);break}case"uvi":{p(2===t.size);const f=r.getField(e,l);p(!!f,`No buffer view for ${e}`),m(t,f,i);break}case"color":case"symbolColor":{const f=r.getField(e,n);p(!!f,`No buffer view for ${e}`),p(3===t.size||4===t.size),x(t,t.size,f,i);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const f=r.getField(e,c)??r.getField(e,c);p(!!f,`No buffer view for ${e}`),p(1===t.size),M(t,f,i);break}case"tangent":{p(4===t.size);const o=r.getField(e,s);p(!!o,`No buffer view for ${e}`),$(t,f,o,i);break}}}function D(e,t,f,o){const{data:r,stride:i,size:n,indices:s}=e;p(1===n,"Index should be 1D");const c=s.length;for(let l=0;l<c;++l){const e=r[i*s[l]];t.set(f+l,o+e)}}function I(e,t,f,o){for(let r=0;r<o;++r)e.set(t+r,f)}export{U as writeAttribute,C as writeAttributes,y as writeBufferFloat,g as writeBufferFloat16,B as writeBufferInt16,z as writeBufferMat3f,w as writeBufferMat4f,h as writeBufferUint32,b as writeBufferUint8,m as writeBufferVec2,v as writeBufferVec3,S as writeBufferVec4,F as writeBufferZeros,x as writeColor,I as writeConstTextureElementIndex,j as writeDeltaF16Vector,N as writeNormal,A as writeOlidColor,k as writePosition,$ as writeTangent,D as writeTextureElementIndex,M as writeVVFeatureAttribute};
2
+ import{subtract as e,length as t,scale as f}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isOrthoNormal as r,hasIdentityRotation as i}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as n,BufferViewVec4f as s,BufferViewFloat as c,BufferViewVec2i16 as l,BufferViewVec2f16 as d,BufferViewVec2f as u,BufferViewVec3f as a}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as p}from"../../lib/Util.js";function g(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c)i[f]=o[r[c]],f+=n}function y(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l)n[f]=r[i[l]],f+=s;else for(let l=0;l<c;++l){const e=r[i[l]];for(let t=0;t<o;t++)n[f]=e,f+=s}}function B(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c)i[f]=o[r[c]],f+=n}function h(e,t,f){const{data:o,stride:r,indices:i}=e,n=i.length;for(let s=0;s<n;++s)t.set(f+s,o[r*i[s]])}function b(e,t,f){const{data:o,stride:r,indices:i}=e,n=i.length;for(let s=0;s<n;++s)t.set(f+s,o[r*i[s]])}function m(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=2*r[c];i[f]=o[e],i[f+1]=o[e+1],f+=n}}function v(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l){const e=3*i[l];n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],f+=s}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<o;++t)n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],f+=s}}function S(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l){const e=4*i[l];n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],n[f+3]=r[e+3],f+=s}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<o;++t)n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],n[f+3]=r[e+3],f+=s}}function F(e,t,f){const o=e.typedBuffer,r=e.typedBufferStride,i=e.elementCount;t*=r;for(let n=0;n<f;++n){for(let e=0;e<i;++e)o[t+e]=0;t+=r}}function z(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=9*r[c];for(let t=0;t<9;++t)i[f+t]=o[e+t];f+=n}}function w(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=16*r[c];for(let t=0;t<16;++t)i[f+t]=o[e+t];f+=n}}function k(e,t,f,o,r=1){if(!t)return void v(e,f,o,r);const{data:n,indices:s}=e,c=f.typedBuffer,l=f.typedBufferStride,d=s.length,u=t[0],a=t[1],p=t[2],g=t[4],y=t[5],B=t[6],h=t[8],b=t[9],m=t[10],S=t[12],F=t[13],z=t[14];o*=l;let w=0,k=0,N=0;const $=i(t)?e=>{w=n[e]+S,k=n[e+1]+F,N=n[e+2]+z}:e=>{const t=n[e],f=n[e+1],o=n[e+2];w=u*t+g*f+h*o+S,k=a*t+y*f+b*o+F,N=p*t+B*f+m*o+z};if(1===r)for(let i=0;i<d;++i)$(3*s[i]),c[o]=w,c[o+1]=k,c[o+2]=N,o+=l;else for(let i=0;i<d;++i){$(3*s[i]);for(let e=0;e<r;++e)c[o]=w,c[o+1]=k,c[o+2]=N,o+=l}}function N(e,t,f,o){if(!t)return void m(e,f,o);const{data:r,indices:n}=e,s=f.typedBuffer,c=f.typedBufferStride,l=n.length,d=t[0],u=t[1],a=t[4],p=t[5],g=t[12],y=t[13];o*=c;let B=0,h=0;const b=i(t)?e=>{B=r[e]+g,h=r[e+1]+y}:e=>{const t=r[e],f=r[e+1];B=d*t+a*f+g,h=u*t+p*f+y};for(let i=0;i<l;++i)b(2*n[i]),s[o]=B,s[o+1]=h,o+=c}function $(e,t,f,o,n=1){if(!t)return void v(e,f,o,n);const{data:s,indices:c}=e,l=t,d=f.typedBuffer,u=f.typedBufferStride,a=c.length,p=l[0],g=l[1],y=l[2],B=l[4],h=l[5],b=l[6],m=l[8],S=l[9],F=l[10],z=!r(l),w=1e-6,k=1-w;o*=u;let N=0,$=0,x=0;const M=i(l)?e=>{N=s[e],$=s[e+1],x=s[e+2]}:e=>{const t=s[e],f=s[e+1],o=s[e+2];N=p*t+B*f+m*o,$=g*t+h*f+S*o,x=y*t+b*f+F*o};if(1===n)if(z)for(let r=0;r<a;++r){M(3*c[r]);const e=N*N+$*$+x*x;if(e<k&&e>w){const t=1/Math.sqrt(e);d[o]=N*t,d[o+1]=$*t,d[o+2]=x*t}else d[o]=N,d[o+1]=$,d[o+2]=x;o+=u}else for(let r=0;r<a;++r)M(3*c[r]),d[o]=N,d[o+1]=$,d[o+2]=x,o+=u;else for(let r=0;r<a;++r){if(M(3*c[r]),z){const e=N*N+$*$+x*x;if(e<k&&e>w){const t=1/Math.sqrt(e);N*=t,$*=t,x*=t}}for(let e=0;e<n;++e)d[o]=N,d[o+1]=$,d[o+2]=x,o+=u}}function x(e,t,f,o,i=1){if(!t)return void S(e,f,o,i);const{data:n,indices:s}=e,c=t,l=f.typedBuffer,d=f.typedBufferStride,u=s.length,a=c[0],p=c[1],g=c[2],y=c[4],B=c[5],h=c[6],b=c[8],m=c[9],v=c[10],F=!r(c),z=1e-6,w=1-z;if(o*=d,1===i)for(let r=0;r<u;++r){const e=4*s[r],t=n[e],f=n[e+1],i=n[e+2],c=n[e+3];let u=a*t+y*f+b*i,S=p*t+B*f+m*i,k=g*t+h*f+v*i;if(F){const e=u*u+S*S+k*k;if(e<w&&e>z){const t=1/Math.sqrt(e);u*=t,S*=t,k*=t}}l[o]=u,l[o+1]=S,l[o+2]=k,l[o+3]=c,o+=d}else for(let r=0;r<u;++r){const e=4*s[r],t=n[e],f=n[e+1],c=n[e+2],u=n[e+3];let S=a*t+y*f+b*c,k=p*t+B*f+m*c,N=g*t+h*f+v*c;if(F){const e=S*S+k*k+N*N;if(e<w&&e>z){const t=1/Math.sqrt(e);S*=t,k*=t,N*=t}}for(let r=0;r<i;++r)l[o]=S,l[o+1]=k,l[o+2]=N,l[o+3]=u,o+=d}}function M(e,t,f,o,r=1){const{data:i,indices:n}=e,s=f.typedBuffer,c=f.typedBufferStride,l=n.length;if(o*=c,t===i.length&&4===t){s[o]=i[0],s[o+1]=i[1],s[o+2]=i[2],s[o+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,n=e[o/=4];o+=t;const d=l*r;for(let f=1;f<d;++f)e[o]=n,o+=t;return}if(1!==r)if(4!==t)for(let d=0;d<l;++d){const e=3*n[d];for(let t=0;t<r;++t)s[o]=i[e],s[o+1]=i[e+1],s[o+2]=i[e+2],s[o+3]=255,o+=c}else for(let d=0;d<l;++d){const e=4*n[d];for(let t=0;t<r;++t)s[o]=i[e],s[o+1]=i[e+1],s[o+2]=i[e+2],s[o+3]=i[e+3],o+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*n[e];s[o]=i[t],s[o+1]=i[t+1],s[o+2]=i[t+2],s[o+3]=i[t+3],o+=c}return}for(let e=0;e<l;++e){const t=3*n[e];s[o]=i[t],s[o+1]=i[t+1],s[o+2]=i[t+2],s[o+3]=255,o+=c}}}function j(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length,c=o[0];f*=n;for(let l=0;l<s;++l)i[f]=c,f+=n}function q(o,r,i,n){e(A,o,r);const s=Math.max(Math.sqrt(t(A)),1e-4);f(A,A,1/s),i[n++]=A[0],i[n++]=A[1],i[n++]=A[2],i[n++]=s}const A=o();function C(e,t,f,o,r=1){const i=t.typedBuffer,n=t.typedBufferStride;if(o*=n,1===r)for(let s=0;s<f;++s)i[o]=e[0],i[o+1]=e[1],i[o+2]=e[2],i[o+3]=e[3],o+=n;else for(let s=0;s<f;++s)for(let t=0;t<r;++t)i[o]=e[0],i[o+1]=e[1],i[o+2]=e[2],i[o+3]=e[3],o+=n}function U(e,t,f,o,r,i){const{buffer:s,offset:c}=i;for(const l of f.fields.keys()){const f=e.get(l),i=f?.indices;if(f&&i)D(l,f,o,r,s,c);else if("olidColor"===l&&null!=t){const f=e.get("position")?.indices;if(f){const e=f.length;C(t,s.getField(l,n),e,c)}}}}function D(e,t,f,o,r,i){switch(e){case"position":{p(3===t.size);const o=r.getField(e,a);p(!!o,`No buffer view for ${e}`),k(t,f,o,i);break}case"normal":{p(3===t.size);const f=r.getField(e,a);p(!!f,`No buffer view for ${e}`),$(t,o,f,i);break}case"normalCompressed":case"profileRight":case"profileUp":{p(2===t.size);const f=r.getField(e,l);p(!!f,`No buffer view for ${e}`),m(t,f,i);break}case"uv0":{p(2===t.size);const f=r.getField(e,d)??r.getField(e,u);p(!!f,`No buffer view for ${e}`),m(t,f,i);break}case"uvi":{p(2===t.size);const f=r.getField(e,l);p(!!f,`No buffer view for ${e}`),m(t,f,i);break}case"color":case"symbolColor":{const f=r.getField(e,n);p(!!f,`No buffer view for ${e}`),p(3===t.size||4===t.size),M(t,t.size,f,i);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const f=r.getField(e,c)??r.getField(e,c);p(!!f,`No buffer view for ${e}`),p(1===t.size),j(t,f,i);break}case"tangent":{p(4===t.size);const o=r.getField(e,s);p(!!o,`No buffer view for ${e}`),x(t,f,o,i);break}}}function I(e,t,f,o){const{data:r,stride:i,size:n,indices:s}=e;p(1===n,"Index should be 1D");const c=s.length;for(let l=0;l<c;++l){const e=r[i*s[l]];t.set(f+l,o+e)}}function R(e,t,f,o){for(let r=0;r<o;++r)e.set(t+r,f)}export{D as writeAttribute,U as writeAttributes,y as writeBufferFloat,g as writeBufferFloat16,B as writeBufferInt16,z as writeBufferMat3f,w as writeBufferMat4f,h as writeBufferUint32,b as writeBufferUint8,m as writeBufferVec2,v as writeBufferVec3,S as writeBufferVec4,F as writeBufferZeros,M as writeColor,R as writeConstTextureElementIndex,q as writeDeltaF16Vector,$ as writeNormal,C as writeOlidColor,k as writePosition,N as writePosition2d,x as writeTangent,I as writeTextureElementIndex,j as writeVVFeatureAttribute};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/HeatmapDensity.glsl.js";
2
+ import"../../terrain/DrapedZ.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/HeatmapDensity.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{glLayout as t}from"../../support/buffer/glUtil.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{MaterialParameters as n}from"../lib/Material.js";import{H as a}from"../../../../chunks/HeatmapDensity.glsl.js";import{PrimitiveType as p}from"../../../webgl/enums.js";import{makePipelineState as l,defaultColorWrite as c,add as m}from"../../../webgl/renderState.js";class u extends n{constructor(){super(...arguments),this.searchRadius=128,this.resolutionForScale=0}}let d=class extends o{constructor(e,r){super(e,r,t(h).concat(t(r.isAttributeDriven?b:f))),this.shader=new i(a,()=>import("./HeatmapDensity.glsl.js")),this.primitiveType=p.TRIANGLE_STRIP}initializePipeline(){return l({blending:m,colorWrite:c,depthTest:null,depthWrite:null})}destroy(){super.destroy()}};d=e([r("esri.views.3d.webgl-engine.shaders.HeatmapDensityTechnique")],d);const h=s().vec2i8("uv0"),f=s().vec3f("position"),b=f.clone().f32("featureAttribute");export{u as HeatmapDensityPassParameters,d as HeatmapDensityTechnique,b as attributeDrivenInstanceLayout,h as baseLayout,f as instanceLayout};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{glLayout as t}from"../../support/buffer/glUtil.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{MaterialParameters as n}from"../lib/Material.js";import{H as a}from"../../../../chunks/HeatmapDensity.glsl.js";import{PrimitiveType as p}from"../../../webgl/enums.js";import{makePipelineState as l,defaultColorWrite as c,add as m}from"../../../webgl/renderState.js";class u extends n{constructor(){super(...arguments),this.searchRadius=128,this.resolutionForScale=0}}let d=class extends o{constructor(e,r){super(e,r,t(h).concat(t(r.isAttributeDriven?b:f))),this.shader=new i(a,()=>import("./HeatmapDensity.glsl.js")),this.primitiveType=p.TRIANGLE_STRIP}initializePipeline(){return l({blending:m,colorWrite:c,depthTest:null,depthWrite:null})}destroy(){super.destroy()}};d=e([r("esri.views.3d.webgl-engine.shaders.HeatmapDensityTechnique")],d);const h=s().vec2i8("uv0"),f=s().vec2f("position"),b=f.clone().f32("featureAttribute");export{u as HeatmapDensityPassParameters,d as HeatmapDensityTechnique,b as attributeDrivenInstanceLayout,h as baseLayout,f as instanceLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import{EventedMixin as o}from"../core/Evented.js";import{destroyMaybe as r}from"../core/maybe.js";import{EsriPromiseMixin as a}from"../core/Promise.js";import{watch as n,syncAndInitial as p,whenOnce as l,when as h}from"../core/reactiveUtils.js";import{property as d,cast as m,subclass as c}from"../core/accessorSupport/decorators.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import{create as y,fromValues as u}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import f from"../geometry/Extent.js";import w from"../geometry/Point.js";import v from"../geometry/SpatialReference.js";import{load as j,execute as _}from"../geometry/operators/projectOperator.js";import b from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as C}from"../layers/support/MediaElementView.js";import S from"../layers/support/TileInfo.js";import V from"../layers/support/VideoElement.js";import{DOMContainer as M}from"./DOMContainer.js";import{Viewport2DBaseMixin as x}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as R}from"./Viewport2DMixin.js";import D from"./2d/AnimationManager.js";import z from"./2d/MapViewConstraints.js";import"./2d/engine/Stage.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"../core/RandomLCG.js";import"../core/has.js";import"../core/Logger.js";import"./2d/engine/transitions/FadeTransition.js";import"./webgl/BufferObject.js";import"./webgl/FramebufferObject.js";import"./webgl/Program.js";import"./webgl/Renderbuffer.js";import"./webgl/Texture.js";import"./webgl/enums.js";import"./webgl/Util.js";import"./2d/engine/webgl/meshing/definitions.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"../core/Collection.js";import"../core/mathUtils.js";import"../core/units.js";import"../geometry/Geometry.js";import"../geometry/ellipsoidUtils.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"../geometry/spatialReferenceEllipsoidUtils.js";import"../geometry/operators/support/GeographicTransformation.js";import"../geometry/projection/projectors.js";import"../geometry/support/spatialReferenceUtils.js";import"../geometry/support/normalizeUtils.js";import{Container as P}from"./2d/engine/Container.js";import"./2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/GpuMeshState.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/Tile.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"./2d/layers/support/util.js";import T from"./2d/navigation/MapViewNavigation.js";import"../request.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"../core/urlUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import"../geometry/support/Ellipsoid.js";import{ViewStateManager as G}from"./2d/ViewStateManager.js";import E from"./2d/engine/webgl/Overlay.js";import O from"./2d/engine/webgl/OverlayContainer.js";import q from"./navigation/Navigation.js";import U from"./ui/DefaultUI.js";import H from"./ui/video/DefaultUIVideo.js";const F=new t("#000");let I;async function k(){const[,{ParentStage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);I=e}const A=.01,L=["feature","geojson","csv","stream","ogc-feature","catalog","wfs","parquet","graphics","group"];let N=class extends(R(x(M(o(a(s)))))){constructor(e){super(e),this._isValid=!1,this._readyCycleForced=!1,this._prevZoomEnabled=!1,this._prevRotationEnabled=!1,this.stage=null,this.childStage=null,this._operationalDataView=null,this.operationalDataVisible=!1,this.map=null,this.navigation=new q,this.ready=!1,this.spatialReference=new v({wkid:0}),this.stateManager=new G({constraints:new z({view:this,minScale:1,maxScale:A})}),this.type="2d",this.ui=new H,this.view2dType="video",this.addHandles([n(()=>this.preconditionsReady,e=>e?this._startup():this._teardown()),n(()=>this.videoSize,([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}),n(()=>this.size,e=>{this._operationalDataView&&this._operationalDataView.stateManager.resize(e[0],e[1])}),n(()=>[this.layer?.frameEffect,this._effectsContainer],()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)},p)])}initialize(){this._prevZoomEnabled="zoom"===this.navigation.actionMap.mouseWheel&&this.ui.components.includes("zoom"),this._prevRotationEnabled="rotate"===this.navigation.actionMap.dragSecondary&&this.ui.components.includes("compass"),this.addHandles([n(()=>[this.operationalDataVisible,this.childStage],()=>{this.childStage&&(this.childStage.videoScreenRenderer.visible=this.operationalDataVisible),this.operationalDataVisible&&(this.scale=1,this.rotation=0),this.navigation&&(this._prevZoomEnabled&&(this.navigation.actionMap.mouseWheel=this.operationalDataVisible?"none":"zoom",this.navigation.actionMap.dragPrimary=this.operationalDataVisible?"none":"pan",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"zoom"!==e):[...new Set([...this.ui.components,"zoom"])])),this._prevRotationEnabled&&(this.navigation.actionMap.dragSecondary=this.operationalDataVisible?"none":"rotate",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"compass"!==e):[...new Set([...this.ui.components,"compass"])])))},p)]),this.addResolvingPromise(k().then(()=>(this._isValid=!0,l(()=>this.ready))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=r(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get layer(){return this._get("layer")}set layer(e){e!==this._get("layer")&&(this.constructed&&!this.destroyed&&(this._forceReadyCycle(),this.addResolvingPromise(l(()=>this.ready))),this._set("layer",e))}get preconditionsReady(){return!(!this._isValid||this._readyCycleForced||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,o=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,o]:o<=t?[e,o]:[s,t]:i>=1?o<=t?[e,o]:[s,t]:s<=e?[s,t]:[e,o]}async hitTest(e,t){if(!this._operationalDataView||!this._operationalDataView.ready)return{screenPoint:e,results:[]};const i=this._operationalDataView.videoToMap(e);if(!i)return{screenPoint:e,results:[]};const s=this._operationalDataView.state.toScreen(y(),i);return this._operationalDataView.hitTest({x:s[0],y:s[1]},t)}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference);const t={renderingOptions:this.renderingOptions,backgroundColor:F,groundControlPoints:()=>this._groundControlPoints(),getSize:()=>this.videoSize},i=new I(this._getOrCreateRenderCanvas(),t);this.stage=i,this._prepareStage(this.stage),this.childStage=i.childStage,this._prepareChildStage(this.childStage);const s=new D({view:this});this._set("animationManager",s);const o=new T({view:this,animationManager:s});this._set("mapViewNavigation",o),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.frameTask?.stop(),this.stationaryManager?.clear(),this.stage?.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer?.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager?.ready&&this.stateManager.teardown()}_getViewpoint(){return new i({targetGeometry:new w({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([n(()=>this.stationary,t=>e.stationary=t,p),n(()=>this.state.id,()=>e.state=this.state,p),n(()=>this.renderingOptions,t=>e.renderingOptions=t,p)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new C({element:new V({video:this.layer?.videoElement,georeference:new b({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new E(this._videoElementView);this._overlayContainer=new O,this._overlayContainer.addChild(t),this._effectsContainer=new P,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);const i=document.createElement("div");i.classList.add("esri-video-poster"),this.container?.classList.add("esri-video-view"),this.container?.appendChild(i)}_prepareChildStage(e){this.addHandles([n(()=>this.map,async t=>{if(!t)return;const{default:i}=await(import("./video/VideoOperationalDataView.js"));this._operationalDataView=new i({stage:e,layerViewFilter:e=>new Set(L).has(e.type),width:this.size[0],height:this.size[1],map:t,groundControlPoints:()=>this._groundControlPoints(),getVideoResolution:()=>u(this.layer?.videoWidth||0,this.layer?.videoHeight||0),getSize:()=>this.size}),l(()=>this._operationalDataView?.ready).then(()=>{e.videoScreenRenderer.visible=this.operationalDataVisible})},p),n(()=>this.layer?.groundControlPoints,async()=>{if(!this.layer?.groundControlPoints||!e.state)return;const t=this.layer.groundControlPoints,i=t?.length;if(!i)return;await j();const s=new Array(i),o=e.state.spatialReference;for(let e=0;e<i;e++){const{lat:i,lon:r}=t[e];s[e]=_(new w(r,i),o)}let r=1/0,a=1/0,n=-1/0,p=-1/0;for(const e of s)r=Math.min(r,e.x),a=Math.min(a,e.y),n=Math.max(n,e.x),p=Math.max(p,e.y);const l=f.fromJSON({xmin:r,ymin:a,xmax:n,ymax:p,spatialReference:o});await(this._operationalDataView?.goTo(l,{animate:!1}).catch(()=>{}))},p)])}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let o=t;o>A;o/=2)i.push(o);i.push(A);const{lods:s}=S.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,o=i*e.scale/2,r=e.targetGeometry.clone();return r.x=Math.max(s,Math.min(t-s,r.x)),r.y=Math.max(o,Math.min(i-o,r.y)),e.targetGeometry=r,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}_forceReadyCycle(){this.ready&&(h(()=>this.destroyed||!1===this.preconditionsReady,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}_groundControlPoints(){return this.layer?.groundControlPoints}};e([d()],N.prototype,"_overlayContainer",void 0),e([d()],N.prototype,"_isValid",void 0),e([d()],N.prototype,"_readyCycleForced",void 0),e([d()],N.prototype,"_effectsContainer",void 0),e([d()],N.prototype,"constraintsInfo",null),e([d()],N.prototype,"operationalDataVisible",void 0),e([d()],N.prototype,"layer",null),e([d()],N.prototype,"map",void 0),e([d({type:q,nonNullable:!0})],N.prototype,"navigation",void 0),e([d({readOnly:!0})],N.prototype,"preconditionsReady",null),e([d({readOnly:!0})],N.prototype,"ready",void 0),e([d({readOnly:!0})],N.prototype,"rendering",null),e([d()],N.prototype,"scale",null),e([d()],N.prototype,"spatialReference",void 0),e([d()],N.prototype,"stateManager",void 0),e([d()],N.prototype,"type",void 0),e([d(),m(e=>e instanceof U?e:g(H,e))],N.prototype,"ui",void 0),e([d({readOnly:!0})],N.prototype,"videoSize",null),e([d({readOnly:!0})],N.prototype,"view2dType",void 0),N=e([c("esri.views.VideoView")],N);const W=N;export{W as default};
2
+ import{__decorate as e}from"tslib";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import{EventedMixin as o}from"../core/Evented.js";import{destroyMaybe as r}from"../core/maybe.js";import{EsriPromiseMixin as a}from"../core/Promise.js";import{watch as n,syncAndInitial as p,whenOnce as l,when as h}from"../core/reactiveUtils.js";import{property as d,cast as m,subclass as c}from"../core/accessorSupport/decorators.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import{create as y,fromValues as u}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import f from"../geometry/Extent.js";import w from"../geometry/Point.js";import v from"../geometry/SpatialReference.js";import{load as j,execute as _}from"../geometry/operators/projectOperator.js";import b from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as C}from"../layers/support/MediaElementView.js";import S from"../layers/support/TileInfo.js";import V from"../layers/support/VideoElement.js";import{DOMContainer as M}from"./DOMContainer.js";import{Viewport2DBaseMixin as x}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as R}from"./Viewport2DMixin.js";import D from"./2d/AnimationManager.js";import z from"./2d/MapViewConstraints.js";import"./2d/engine/Stage.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"../core/RandomLCG.js";import"../core/has.js";import"../core/Logger.js";import"./2d/engine/transitions/FadeTransition.js";import"./webgl/BufferObject.js";import"./webgl/FramebufferObject.js";import"./webgl/Program.js";import"./webgl/Renderbuffer.js";import"./webgl/Texture.js";import"./webgl/enums.js";import"./webgl/Util.js";import"./2d/engine/webgl/meshing/definitions.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"../core/Collection.js";import"../core/mathUtils.js";import"../core/units.js";import"../geometry/Geometry.js";import"../geometry/ellipsoidUtils.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"../geometry/spatialReferenceEllipsoidUtils.js";import"../geometry/operators/support/GeographicTransformation.js";import"../geometry/projection/projectors.js";import"../geometry/support/spatialReferenceUtils.js";import"../geometry/support/normalizeUtils.js";import{Container as P}from"./2d/engine/Container.js";import"./2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/GpuMeshState.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"./webgl/UniformBufferLayout.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"./2d/layers/support/util.js";import T from"./2d/navigation/MapViewNavigation.js";import"../request.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"../core/urlUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import"../geometry/support/Ellipsoid.js";import{ViewStateManager as E}from"./2d/ViewStateManager.js";import G from"./2d/engine/webgl/Overlay.js";import O from"./2d/engine/webgl/OverlayContainer.js";import q from"./navigation/Navigation.js";import U from"./ui/DefaultUI.js";import H from"./ui/video/DefaultUIVideo.js";const F=new t("#000");let k;async function A(){const[,{ParentStage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);k=e}const I=.01,L=["feature","geojson","csv","stream","ogc-feature","catalog","wfs","parquet","graphics","group"];let N=class extends(R(x(M(o(a(s)))))){constructor(e){super(e),this._isValid=!1,this._readyCycleForced=!1,this._prevZoomEnabled=!1,this._prevRotationEnabled=!1,this.stage=null,this.childStage=null,this._operationalDataView=null,this.operationalDataVisible=!1,this.map=null,this.navigation=new q,this.ready=!1,this.spatialReference=new v({wkid:0}),this.stateManager=new E({constraints:new z({view:this,minScale:1,maxScale:I})}),this.type="2d",this.ui=new H,this.view2dType="video",this.addHandles([n(()=>this.preconditionsReady,e=>e?this._startup():this._teardown()),n(()=>this.videoSize,([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}),n(()=>this.size,e=>{this._operationalDataView&&this._operationalDataView.stateManager.resize(e[0],e[1])}),n(()=>[this.layer?.frameEffect,this._effectsContainer],()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)},p)])}initialize(){this._prevZoomEnabled="zoom"===this.navigation.actionMap.mouseWheel&&this.ui.components.includes("zoom"),this._prevRotationEnabled="rotate"===this.navigation.actionMap.dragSecondary&&this.ui.components.includes("compass"),this.addHandles([n(()=>[this.operationalDataVisible,this.childStage],()=>{this.childStage&&(this.childStage.videoScreenRenderer.visible=this.operationalDataVisible),this.operationalDataVisible&&(this.scale=1,this.rotation=0),this.navigation&&(this._prevZoomEnabled&&(this.navigation.actionMap.mouseWheel=this.operationalDataVisible?"none":"zoom",this.navigation.actionMap.dragPrimary=this.operationalDataVisible?"none":"pan",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"zoom"!==e):[...new Set([...this.ui.components,"zoom"])])),this._prevRotationEnabled&&(this.navigation.actionMap.dragSecondary=this.operationalDataVisible?"none":"rotate",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"compass"!==e):[...new Set([...this.ui.components,"compass"])])))},p)]),this.addResolvingPromise(A().then(()=>(this._isValid=!0,l(()=>this.ready))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=r(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get layer(){return this._get("layer")}set layer(e){e!==this._get("layer")&&(this.constructed&&!this.destroyed&&(this._forceReadyCycle(),this.addResolvingPromise(l(()=>this.ready))),this._set("layer",e))}get preconditionsReady(){return!(!this._isValid||this._readyCycleForced||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,o=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,o]:o<=t?[e,o]:[s,t]:i>=1?o<=t?[e,o]:[s,t]:s<=e?[s,t]:[e,o]}async hitTest(e,t){if(!this._operationalDataView||!this._operationalDataView.ready)return{screenPoint:e,results:[]};const i=this._operationalDataView.videoToMap(e);if(!i)return{screenPoint:e,results:[]};const s=this._operationalDataView.state.toScreen(y(),i);return this._operationalDataView.hitTest({x:s[0],y:s[1]},t)}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference);const t={renderingOptions:this.renderingOptions,backgroundColor:F,groundControlPoints:()=>this._groundControlPoints(),getSize:()=>this.videoSize},i=new k(this._getOrCreateRenderCanvas(),t);this.stage=i,this._prepareStage(this.stage),this.childStage=i.childStage,this._prepareChildStage(this.childStage);const s=new D({view:this});this._set("animationManager",s);const o=new T({view:this,animationManager:s});this._set("mapViewNavigation",o),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.frameTask?.stop(),this.stationaryManager?.clear(),this.stage?.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer?.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager?.ready&&this.stateManager.teardown()}_getViewpoint(){return new i({targetGeometry:new w({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([n(()=>this.stationary,t=>e.stationary=t,p),n(()=>this.state.id,()=>e.state=this.state,p),n(()=>this.renderingOptions,t=>e.renderingOptions=t,p)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new C({element:new V({video:this.layer?.videoElement,georeference:new b({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new G(this._videoElementView);this._overlayContainer=new O,this._overlayContainer.addChild(t),this._effectsContainer=new P,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);const i=document.createElement("div");i.classList.add("esri-video-poster"),this.container?.classList.add("esri-video-view"),this.container?.appendChild(i)}_prepareChildStage(e){this.addHandles([n(()=>this.map,async t=>{if(!t)return;const{default:i}=await(import("./video/VideoOperationalDataView.js"));this._operationalDataView=new i({stage:e,layerViewFilter:e=>new Set(L).has(e.type),width:this.size[0],height:this.size[1],map:t,groundControlPoints:()=>this._groundControlPoints(),getVideoResolution:()=>u(this.layer?.videoWidth||0,this.layer?.videoHeight||0),getSize:()=>this.size}),l(()=>this._operationalDataView?.ready).then(()=>{e.videoScreenRenderer.visible=this.operationalDataVisible})},p),n(()=>this.layer?.groundControlPoints,async()=>{if(!this.layer?.groundControlPoints||!e.state)return;const t=this.layer.groundControlPoints,i=t?.length;if(!i)return;await j();const s=new Array(i),o=e.state.spatialReference;for(let e=0;e<i;e++){const{lat:i,lon:r}=t[e];s[e]=_(new w(r,i),o)}let r=1/0,a=1/0,n=-1/0,p=-1/0;for(const e of s)r=Math.min(r,e.x),a=Math.min(a,e.y),n=Math.max(n,e.x),p=Math.max(p,e.y);const l=f.fromJSON({xmin:r,ymin:a,xmax:n,ymax:p,spatialReference:o});await(this._operationalDataView?.goTo(l,{animate:!1}).catch(()=>{}))},p)])}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let o=t;o>I;o/=2)i.push(o);i.push(I);const{lods:s}=S.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,o=i*e.scale/2,r=e.targetGeometry.clone();return r.x=Math.max(s,Math.min(t-s,r.x)),r.y=Math.max(o,Math.min(i-o,r.y)),e.targetGeometry=r,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}_forceReadyCycle(){this.ready&&(h(()=>this.destroyed||!1===this.preconditionsReady,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}_groundControlPoints(){return this.layer?.groundControlPoints}};e([d()],N.prototype,"_overlayContainer",void 0),e([d()],N.prototype,"_isValid",void 0),e([d()],N.prototype,"_readyCycleForced",void 0),e([d()],N.prototype,"_effectsContainer",void 0),e([d()],N.prototype,"constraintsInfo",null),e([d()],N.prototype,"operationalDataVisible",void 0),e([d()],N.prototype,"layer",null),e([d()],N.prototype,"map",void 0),e([d({type:q,nonNullable:!0})],N.prototype,"navigation",void 0),e([d({readOnly:!0})],N.prototype,"preconditionsReady",null),e([d({readOnly:!0})],N.prototype,"ready",void 0),e([d({readOnly:!0})],N.prototype,"rendering",null),e([d()],N.prototype,"scale",null),e([d()],N.prototype,"spatialReference",void 0),e([d()],N.prototype,"stateManager",void 0),e([d()],N.prototype,"type",void 0),e([d(),m(e=>e instanceof U?e:g(H,e))],N.prototype,"ui",void 0),e([d({readOnly:!0})],N.prototype,"videoSize",null),e([d({readOnly:!0})],N.prototype,"view2dType",void 0),N=e([c("esri.views.VideoView")],N);const W=N;export{W as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../core/has.js";import t from"../../core/Logger.js";import{disposeMaybe as e}from"../../core/maybe.js";import{after as s}from"../../core/promiseUtils.js";import{Milliseconds as i}from"../../core/time.js";import{webglDebugEnabled as a,checkWebGLError as r,getErrorMessage as n,webglValidateShadersEnabled as l}from"./checkWebGLError.js";import{ContextState as h}from"./ContextState.js";import{DrawBufferNone as f,DrawBufferBack as o,baseTextureUnit as u,ResourceType as c,ColorAttachment0 as d,PrimitiveType as _}from"./enums.js";import{InstanceCounter as b}from"./InstanceCounter.js";import{Parameters as g}from"./Parameters.js";import{ProgramCache as p}from"./ProgramCache.js";import{StateTracker as m}from"./renderState.js";import B from"./Texture.js";import{WebGLDriverTest as F}from"./WebGLDriverTest.js";import{Capabilities as T}from"./capabilities/Capabilities.js";const x=()=>t.getLogger("esri.views.webgl.RenderingContext");let w=class{constructor(t,e){this.gl=t,this.instanceCounter=new b,this._programCache=new p(this),this._transformFeedbackRequestInfo=null,this._state=new h,this._numOfDrawCalls=0,this._numOfTriangles=0,this._options=e,this.configure(e)}configure(t){this._options=t,this._capabilities=new T(this.gl,t),this._parameters=new g(this.gl,this._capabilities,t),B.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const s=this.gl.getParameter(this.gl.VIEWPORT);this._state=new h,this._state.viewport={x:s[0],y:s[1],width:s[2],height:s[3]},this._stateTracker=new m({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const e=t.color;this.setBlendColor(e.r,e.g,e.b,e.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const{ref:e,readMask:s,stencilFront:i,stencilBack:a}=t;i.compare===a.compare?this.setStencilFunction(i.compare,e,s):(this.setStencilFunctionSeparate(1028,i.compare,e,s),this.setStencilFunctionSeparate(1029,a.compare,e,s)),i.fail===a.fail&&i.zFail===a.zFail&&i.zPass===a.zPass?this.setStencilOp(i.fail,i.zFail,i.zPass):(this.setStencilOpSeparate(1028,i.fail,i.zFail,i.zPass),this.setStencilOpSeparate(1029,a.fail,a.zFail,a.zPass))}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)}}),this.enforceState(),e(this._driverTest),this._driverTest=new F(this)}updateOptions(t){this._options={...this._options,...t},this._parameters=new g(this.gl,this._capabilities,this._options)}dispose(){this._driverTest=e(this._driverTest),this._programCache=e(this._programCache),this.bindVAO(null),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663),this._state.textureUnitMap.length=0,this._state.textureUnitSamplerMap.length=0,this._state=null,this._capabilities=null,this._stateTracker=null;const t=a()&&this.instanceCounter.resourceInformation;t&&console.log(t)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}get programCache(){return this._programCache}setPipelineState(t){this._stateTracker.setPipeline(t)}getPipelineState(){return this._stateTracker.getPipelineState()}setBlendingEnabled(t){this._state.blend!==t&&(!0===t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=t,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(t,e){for(let s=0;s<t.length;++s){const e=t[s];this._state.textureUnitMap[e]=null,this._state.textureUnitSamplerMap[e]=null}e>=0&&(this._state.activeTexture=e)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(t,e,s,i){t===this._state.blendColor.r&&e===this._state.blendColor.g&&s===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(t,e,s,i),this._state.blendColor.r=t,this._state.blendColor.g=e,this._state.blendColor.b=s,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(t,e){t===this._state.blendFunction.srcRGB&&e===this._state.blendFunction.dstRGB||(this.gl.blendFunc(t,e),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=e,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(t,e,s,i){this._state.blendFunction.srcRGB===t&&this._state.blendFunction.srcAlpha===s&&this._state.blendFunction.dstRGB===e&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(t,e,s,i),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=s,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(t){this._state.blendEquation.mode!==t&&(this.gl.blendEquation(t),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(t,e){this._state.blendEquation.mode===t&&this._state.blendEquation.modeAlpha===e||(this.gl.blendEquationSeparate(t,e),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setColorMask(t,e,s,i){this._state.colorMask.r===t&&this._state.colorMask.g===e&&this._state.colorMask.b===s&&this._state.colorMask.a===i||(this.gl.colorMask(t,e,s,i),this._state.colorMask.r=t,this._state.colorMask.g=e,this._state.colorMask.b=s,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(t,e,s,i){this._state.clearColor.r===t&&this._state.clearColor.g===e&&this._state.clearColor.b===s&&this._state.clearColor.a===i||(this.gl.clearColor(t,e,s,i),this._state.clearColor.r=t,this._state.clearColor.g=e,this._state.clearColor.b=s,this._state.clearColor.a=i)}setFaceCullingEnabled(t){this._state.faceCulling!==t&&(!0===t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=t,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(t){this._state.polygonOffsetFill!==t&&(!0===t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=t,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(t,e){this._state.polygonOffset[0]===t&&this._state.polygonOffset[1]===e||(this._state.polygonOffset[0]=t,this._state.polygonOffset[1]=e,this.gl.polygonOffset(t,e),this._stateTracker.invalidatePolygonOffset())}setCullFace(t){this._state.cullFace!==t&&(this.gl.cullFace(t),this._state.cullFace=t,this._stateTracker.invalidateCulling())}setFrontFace(t){this._state.frontFace!==t&&(this.gl.frontFace(t),this._state.frontFace=t,this._stateTracker.invalidateCulling())}setScissorTestEnabled(t){this._state.scissorTest!==t&&(!0===t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=t)}setScissorRect(t,e,s,i){this._state.scissorRect.x===t&&this._state.scissorRect.y===e&&this._state.scissorRect.width===s&&this._state.scissorRect.height===i||(this.gl.scissor(t,e,s,i),this._state.scissorRect.x=t,this._state.scissorRect.y=e,this._state.scissorRect.width=s,this._state.scissorRect.height=i)}setDepthTestEnabled(t){this._state.depthTest!==t&&(!0===t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=t,this._stateTracker.invalidateDepthTest())}setClearDepth(t){this._state.clearDepth!==t&&(this.gl.clearDepth(t),this._state.clearDepth=t)}setDepthFunction(t){this._state.depthFunction!==t&&(this.gl.depthFunc(t),this._state.depthFunction=t,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(t){this._state.depthWrite!==t&&(this.gl.depthMask(t),this._state.depthWrite=t,this._stateTracker.invalidateDepthWrite())}setDepthRange(t,e){this._state.depthRange.zNear===t&&this._state.depthRange.zFar===e||(this.gl.depthRange(t,e),this._state.depthRange.zNear=t,this._state.depthRange.zFar=e,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(t){this._state.stencilTest!==t&&(!0===t?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=t,this._stateTracker.invalidateStencilTest())}setClearStencil(t){t!==this._state.clearStencil&&(this.gl.clearStencil(t),this._state.clearStencil=t)}setStencilFunction(t,e,s){1032===this._state.stencilFunction.face&&this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===e&&this._state.stencilFunction.mask===s||(this.gl.stencilFunc(t,e,s),this._state.stencilFunction.face=1032,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=e,this._state.stencilFunction.mask=s,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(t,e,s,i){this._state.stencilFunction.face===t&&this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(t,e,s,i),this._state.stencilFunction.face=t,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(t){this._state.stencilWriteMask!==t&&(this.gl.stencilMask(t),this._state.stencilWriteMask=t,this._stateTracker.invalidateStencilWrite())}setStencilOp(t,e,s){1032===this._state.stencilOperation.face&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===e&&this._state.stencilOperation.zPass===s||(this.gl.stencilOp(t,e,s),this._state.stencilOperation.face=1032,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=e,this._state.stencilOperation.zPass=s,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(t,e,s,i){this._state.stencilOperation.face===t&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(t,e,s,i),this._state.stencilOperation.face=t,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(t,e=!1){const s=this._state.activeTexture;return t>=0&&(e||t!==this._state.activeTexture)&&(this.gl.activeTexture(u+t),this._state.activeTexture=t),s}setDrawBuffers(t){const e=this.drawBuffers;if(e.length===t.length&&e.every((e,s)=>e===t[s]))return e;if(t.length>this.parameters.maxDrawBuffers)return x().error(`Setting more active draw buffers (${t.length}) than GL.MAX_DRAW_BUFFERS allows ( ${this.parameters.maxDrawBuffers}).`),e;const s=this._state.drawFramebuffer,i=null===s;if(i){if(t.length>1)return x().error(`The default framebuffer can only have 1 active draw buffer but was requested with ${t.length}.`),e;if(t[0]!==o&&t[0]!==f)return x().error(`The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers but got ${t[0]}`),e}else if(t.includes(o))return x().error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTx or GL.NONE as draw buffers."),e;return this.gl.drawBuffers(t),r(this.gl),i?this._state.drawBuffers.defaultFramebuffer=t:this._state.drawBuffers.fbos.set(s,t),e}get drawBuffers(){const t=this._state.drawFramebuffer;return null===t?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(t)??[]}clear(t,e=255){t&&(16384&t&&this.setColorMask(!0,!0,!0,!0),256&t&&this.setDepthWriteEnabled(!0),1024&t&&this.setStencilWriteMask(e),this.gl.clear(t))}clearFramebuffer(t,e=!1,s=!1){let i=0;if(t){const e=1e-13,s=Math.max(e,t[3]);this.setClearColor(t[0],t[1],t[2],s),i|=16384}e&&(i|=256),!1===s?s=0:(!0===s&&(s=255),i|=1024),i&&this.clear(i,s)}clearBuffer(t,e,s=6144,i){this.gl.clearBufferfv(s,t,e,i)}clearBufferInteger(t,e,s=6144,i){this.gl.clearBufferiv(s,t,e,i)}clearBufferUnsignedInteger(t,e,s=6144,i){this.gl.clearBufferuiv(s,t,e,i)}drawArrays(t,e,s){if(this._transformFeedbackRequestInfo){if(t!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(null==this._state.program?.hasTransformFeedbackVaryings)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(a()&&(this._numOfDrawCalls++,this._numOfTriangles+=k(t,s),has("enable-feature:webgl-debug:textureReadWrite"))){const t=this._state.textureUnitMap;for(let e=0;e<t.length;e++){const s=t[e];if(null!=s&&s===this._state.drawFramebuffer?.colorTexture)throw new Error(`Detected readWrite. Texture already bound at index ${e}`)}}this.gl.drawArrays(t,e,s),r(this.gl)}drawArraysInstanced(t,e,s,i){this.gl.drawArraysInstanced(t,e,s,i),r(this.gl)}drawElements(t,e,s,i){if(this._transformFeedbackRequestInfo)throw new Error("Cannot called drawElements during a transform feedback request");if(a()&&(this._numOfDrawCalls++,this._numOfTriangles+=k(t,e)),this.gl.drawElements(t,e,s,i),a()){const a=n(this.gl);if(a){const r=this.getBoundVAO(),n=r?.indexBuffer,l=r?.buffers,h={indexBuffer:n,vertexBuffers:l},f={mode:t,count:e,type:s,offset:i},o=n?.size??0,u=i+e,c=o<u?`. Buffer is too small. Attempted to draw index ${u} of ${o}`:"";x().error(`drawElements: ${a}${c}`,{args:f,vao:h})}}}drawElementsInstanced(t,e,s,i,a){this.gl.drawElementsInstanced(t,e,s,i,a),r(this.gl)}logInfo(){a()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}resetInfo(){a()&&(this._numOfDrawCalls=0,this._numOfTriangles=0)}get capabilities(){return this._capabilities}setViewport(t,e,s,i){s=Math.max(Math.round(s),1),i=Math.max(Math.round(i),1);const a=this._state.viewport;a.x===t&&a.y===e&&a.width===s&&a.height===i||(a.x=t,a.y=e,a.width=s,a.height=i,this.gl.viewport(t,e,s,i))}setViewport4fv(t){this.setViewport(t[0],t[1],t[2],t[3])}restoreViewport({x:t,y:e,width:s,height:i}){this.setViewport(t,e,s,i)}getViewport(){const t=this._state.viewport;return{x:t.x,y:t.y,width:t.width,height:t.height}}useProgram(t){if(this._state.program!==t){if(t&&null==t.glName&&l())throw new Error("Attempting to use disposed or invalid Program");this._state.program?.stop(),this._state.program=t,this.gl.useProgram(t?.glName??null)}}bindTexture(t,e,s=!1,i=null){(e>=this.parameters.maxTextureImageUnits||e<0)&&x().error(`Input texture unit (${e}) is out of range of available units (0...${this.parameters.maxTextureImageUnits})\n `);const a=this._state.textureUnitMap[e],r=this._state.textureUnitSamplerMap[e],{gl:n}=this;return null==t?.glName?(null!=a&&(this.setActiveTexture(e,s),n.bindTexture(a.descriptor.target,null)),this._state.textureUnitMap[e]=null,null!=r&&(this._state.textureUnitSamplerMap[e]=null,n.bindSampler(e,null)),a):(r!==i&&(n.bindSampler(e,i?.glName??null),this._state.textureUnitSamplerMap[e]=i),s||a!==t?(this.setActiveTexture(e,s),n.bindTexture(t.descriptor.target,t.glName),t.applyChanges(),this._state.textureUnitMap[e]=t,a):(t.isDirty&&(this.setActiveTexture(e,s),t.applyChanges()),a))}unbindTexture(t){if(null!=t)for(let e=0;e<this.parameters.maxTextureImageUnits;e++)this._state.textureUnitMap[e]===t&&(this.bindTexture(null,e),this._state.textureUnitMap[e]=null)}bindFramebuffer(t,e=!1){const s=E(t);if(e||this._state.readFramebuffer!==t||this._state.drawFramebuffer!==t){if(null==t)return this.gl.bindFramebuffer(36160,null),this._state.readFramebuffer=this._state.drawFramebuffer=null,void this.setDrawBuffers(s);t.initializeAndBind(36160),this._state.readFramebuffer=t,this._state.drawFramebuffer=t,this.setDrawBuffers(s)}else this.setDrawBuffers(s)}bindFramebufferSeparate(t,e,s=!1){const i=36008===e,a=i?this._state.readFramebuffer:this._state.drawFramebuffer;(s||a!==t)&&(null==t?this.gl.bindFramebuffer(e,null):t.initializeAndBind(e),i?this._state.readFramebuffer=t??null:(this._state.drawFramebuffer=t??null,this.setDrawBuffers(E(t))))}blitFramebuffer(t,e,s=16384,i=9728,a=0,r=0,n=t.width,l=t.height,h=0,f=0,o=e.width,u=e.height){this.bindFramebufferSeparate(t,36008,!0),this.bindFramebufferSeparate(e,36009,!0),this.gl.blitFramebuffer(a,r,n,l,h,f,o,u,s,i)}bindBuffer(t,e){if(t)switch(e??=t.bufferType,e){case 34962:this._state.vertexBuffer=S(this.gl,t,e,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=S(this.gl,t,e,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=S(this.gl,t,e,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=S(this.gl,t,e,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=S(this.gl,t,e,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=S(this.gl,t,e,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=S(this.gl,t,e,this._state.copyWriteBuffer);break;case 35982:this._state.transformFeedbackBuffer=S(this.gl,t,e,this._state.transformFeedbackBuffer)}}bindRenderbuffer(t){const e=this.gl;t||(e.bindRenderbuffer(e.RENDERBUFFER,null),this._state.renderbuffer=null),this._state.renderbuffer!==t&&(e.bindRenderbuffer(e.RENDERBUFFER,t.glName),this._state.renderbuffer=t)}_getBufferBinding(t,e){if(e>=this.parameters.maxUniformBufferBindings||e<0)return x().error(`Uniform buffer binding point (${e}) is out of range (0...${this.parameters.maxUniformBufferBindings})\n `),null;const s=35345===t?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let i=s[e];return null==i&&(i={buffer:null,offset:0,size:0},s[e]=i),i}bindBufferBase(t,e,s){const i=this._getBufferBinding(t,e);null!=i&&(i.buffer===s&&0===i.offset&&0===i.size||(this.gl.bindBufferBase(t,e,s?s.glName:null),i.buffer=s,i.offset=0,i.size=0))}bindBufferRange(t,e,s,i,a){const r=this._getBufferBinding(t,e);null!=r&&(r.buffer===s&&r.offset===i&&r.size===a||(i%this._parameters.uniformBufferOffsetAlignment===0?(this.gl.bindBufferRange(t,e,s.glName,i,a),r.buffer=s,r.offset=i,r.size=a):x().error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(t,e,s,i){null!=e?(a()&&(i??e.byteLength)>this._parameters.maxUniformBlockSize&&x().error("Attempting to bind more data than the maximum uniform block size"),e.initialize(),void 0!==s&&void 0!==i?this.bindBufferRange(35345,t,e.buffer,s,i):this.bindBufferBase(35345,t,e.buffer)):this.bindBufferBase(35345,t,null)}unbindUBO(t){for(let e=0,s=this._state.uniformBufferBindingPoints.length;e<s;e++){const s=this._state.uniformBufferBindingPoints[e];null!=s&&s.buffer===t.buffer&&this.bindBufferBase(35345,e,null)}}unbindBuffer(t){switch(t){case 34962:this._state.vertexBuffer=S(this.gl,null,t,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=S(this.gl,null,t,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=S(this.gl,null,t,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=S(this.gl,null,t,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=S(this.gl,null,t,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=S(this.gl,null,t,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=S(this.gl,null,t,this._state.copyWriteBuffer)}}bindVAO(t,e){if(null==t)return this._state.vertexArrayObject?.unbind(),void(this._state.vertexArrayObject=null);this._state.vertexArrayObject!==t&&(t.bind(e),this._state.vertexArrayObject=t)}bindTransformFeedback(t){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,t.glName)}beginTransformFeedback(t,e){if(this._transformFeedbackRequestInfo)throw new Error("Already in a transform feedback request");const{gl:s}=this;s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,t.glName),s.beginTransformFeedback(e),this._transformFeedbackRequestInfo={primitiveType:e}}endTransformFeedback(){if(!this._transformFeedbackRequestInfo)throw new Error("Not in a transform feedback request");const{gl:t}=this;t.endTransformFeedback(),t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null),this._transformFeedbackRequestInfo=null}async clientWaitAsync(t=i(10),e){const{gl:a}=this,r=a.fenceSync(37143,0);if(!r)throw new Error("Client wait failed, could not create sync object");this.instanceCounter.increment(c.Sync,r),a.flush();try{let i;do{await s(t,null,e),i=a.clientWaitSync(r,0,0)}while(37147===i);if(37149===i)throw new Error("Client wait failed")}finally{this.instanceCounter.decrement(c.Sync,r),a.deleteSync(r)}}get boundFramebuffer(){return this._state.drawFramebuffer}temporaryBindFramebuffer(t,e,s=!1){const i=this.boundFramebuffer,a={...this._state.viewport};try{this.bindFramebuffer(t,s),t&&this.setViewport(0,0,t.width,t.height),e()}finally{this.bindFramebuffer(i,s),t&&this.setViewport(a.x,a.y,a.width,a.height)}}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null),this.bindVAO(null),this.bindFramebuffer(null,!0),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663);for(let t=0;t<this.parameters.maxTextureImageUnits;++t)this.bindTexture(null,t);this.setBlendingEnabled(!1),this.setBlendFunction(1,0),this.setBlendEquation(32774),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(1029),this.setFrontFace(2305),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(513),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(519,0,0),this.setStencilOp(7680,7680,7680),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){const{gl:t}=this;t.bindVertexArray(null);for(let s=0;s<this.parameters.maxVertexAttributes;s++)t.disableVertexAttribArray(s);this._state.vertexBuffer?t.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):t.bindBuffer(34962,null),this._state.indexBuffer?t.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):t.bindBuffer(34963,null),this._state.uniformBuffer?t.bindBuffer(this._state.uniformBuffer.bufferType,this._state.uniformBuffer.glName):t.bindBuffer(35345,null);for(let s=0;s<this._parameters.maxUniformBufferBindings;s++){const e=this._state.uniformBufferBindingPoints[s];if(null!=e){const{buffer:i,offset:a,size:r}=e;null!==i?0===a&&0===r?t.bindBufferBase(35345,s,i.glName):t.bindBufferRange(35345,s,i.glName,a,r):t.bindBufferBase(35345,s,null)}}if(this._state.pixelPackBuffer?t.bindBuffer(this._state.pixelPackBuffer.bufferType,this._state.pixelPackBuffer.glName):t.bindBuffer(35051,null),this._state.pixelUnpackBuffer?t.bindBuffer(this._state.pixelUnpackBuffer.bufferType,this._state.pixelUnpackBuffer.glName):t.bindBuffer(35052,null),this._state.copyReadBuffer?t.bindBuffer(this._state.copyReadBuffer.bufferType,this._state.copyReadBuffer.glName):t.bindBuffer(36662,null),this._state.copyWriteBuffer?t.bindBuffer(this._state.copyWriteBuffer.bufferType,this._state.copyWriteBuffer.glName):t.bindBuffer(36663,null),t.bindFramebuffer(36008,null),t.readBuffer(t.BACK),this._state.readFramebuffer&&(t.bindFramebuffer(36008,this._state.readFramebuffer.glName),t.readBuffer(d)),t.bindFramebuffer(36009,this._state.drawFramebuffer?.glName??null),null===this._state.drawFramebuffer){const e=this._state.drawBuffers.defaultFramebuffer;t.drawBuffers(e??[o])}else{const e=this._state.drawBuffers.fbos.get(this._state.drawFramebuffer);t.drawBuffers(e??[d])}if(this._state.vertexArrayObject){const t=this._state.vertexArrayObject;this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null),this.bindVAO(t)}t.useProgram(this._state.program?.glName??null),t.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a),t.bindRenderbuffer(t.RENDERBUFFER,this._state.renderbuffer?.glName??null),!0===this._state.blend?t.enable(this.gl.BLEND):t.disable(this.gl.BLEND),t.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha),t.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha),t.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a),t.clearDepth(this._state.clearDepth),t.clearStencil(this._state.clearStencil),t.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a),t.cullFace(this._state.cullFace),t.depthFunc(this._state.depthFunction),t.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar),!0===this._state.depthTest?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),t.depthMask(this._state.depthWrite),t.frontFace(this._state.frontFace),t.lineWidth(1),!0===this._state.faceCulling?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),t.polygonOffset(this._state.polygonOffset[0],this._state.polygonOffset[1]),!0===this._state.polygonOffsetFill?t.enable(t.POLYGON_OFFSET_FILL):t.disable(t.POLYGON_OFFSET_FILL),t.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height),!0===this._state.scissorTest?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST),t.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask),t.stencilOpSeparate(this._state.stencilOperation.face,this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass),!0===this._state.stencilTest?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),t.stencilMask(this._state.stencilWriteMask);for(let s=0;s<this.parameters.maxTextureImageUnits;s++){t.activeTexture(u+s),t.bindTexture(3553,null),t.bindTexture(34067,null),t.bindTexture(32879,null),t.bindTexture(35866,null),t.bindSampler(s,null);const e=this._state.textureUnitMap[s];null!=e&&t.bindTexture(e.descriptor.target,e.glName);const i=this._state.textureUnitSamplerMap[s];null!=i&&t.bindSampler(s,i?.glName)}t.activeTexture(u+this._state.activeTexture);const e=this._state.viewport;t.viewport(e.x,e.y,e.width,e.height),this.resetInfo()}};function S(t,e,s,i){return e?i!==e&&t.bindBuffer(s,e.glName):t.bindBuffer(s,null),e}function k(t,e){switch(t){case _.POINTS:return 2*e;case _.TRIANGLES:return e/3;case _.TRIANGLE_STRIP:case _.TRIANGLE_FAN:return e-2;default:return 0}}function E(t){return t?t.colorAttachments.length>0?t.colorAttachments:[f]:[o]}export{w as RenderingContext,E as getFramebufferDrawBuffers};
2
+ import has from"../../core/has.js";import t from"../../core/Logger.js";import{disposeMaybe as e}from"../../core/maybe.js";import{after as s}from"../../core/promiseUtils.js";import{Milliseconds as i}from"../../core/time.js";import{webglDebugEnabled as a,checkWebGLError as r,getErrorMessage as n,webglValidateShadersEnabled as l}from"./checkWebGLError.js";import{ContextState as h}from"./ContextState.js";import{baseTextureUnit as f,DrawBufferBack as o,DrawBufferNone as u,ResourceType as c,ColorAttachment0 as d,PrimitiveType as _}from"./enums.js";import{InstanceCounter as b}from"./InstanceCounter.js";import{Parameters as g}from"./Parameters.js";import{ProgramCache as p}from"./ProgramCache.js";import{StateTracker as m}from"./renderState.js";import B from"./Texture.js";import{WebGLDriverTest as F}from"./WebGLDriverTest.js";import{Capabilities as T}from"./capabilities/Capabilities.js";const x=()=>t.getLogger("esri.views.webgl.RenderingContext");let w=class{constructor(t,e){this.gl=t,this.instanceCounter=new b,this._programCache=new p(this),this._transformFeedbackRequestInfo=null,this._state=new h,this._numOfDrawCalls=0,this._numOfTriangles=0,this._options=e,this.configure(e)}configure(t){this._options=t,this._capabilities=new T(this.gl,t),this._parameters=new g(this.gl,this._capabilities,t),B.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const s=this.gl.getParameter(this.gl.VIEWPORT);this._state=new h,this._state.viewport={x:s[0],y:s[1],width:s[2],height:s[3]},this._stateTracker=new m({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const e=t.color;this.setBlendColor(e.r,e.g,e.b,e.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const{ref:e,readMask:s,stencilFront:i,stencilBack:a}=t;i.compare===a.compare?this.setStencilFunction(i.compare,e,s):(this.setStencilFunctionSeparate(1028,i.compare,e,s),this.setStencilFunctionSeparate(1029,a.compare,e,s)),i.fail===a.fail&&i.zFail===a.zFail&&i.zPass===a.zPass?this.setStencilOp(i.fail,i.zFail,i.zPass):(this.setStencilOpSeparate(1028,i.fail,i.zFail,i.zPass),this.setStencilOpSeparate(1029,a.fail,a.zFail,a.zPass))}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)}}),this.enforceState(),e(this._driverTest),this._driverTest=new F(this)}updateOptions(t){this._options={...this._options,...t},this._parameters=new g(this.gl,this._capabilities,this._options)}dispose(){this._driverTest=e(this._driverTest),this._programCache=e(this._programCache),this.bindVAO(null),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this.bindUniformBufferBindingPoints([]),this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663),this._state.textureUnitMap.length=0,this._state.textureUnitSamplerMap.length=0,this._state=null,this._capabilities=null,this._stateTracker=null;const t=a()&&this.instanceCounter.resourceInformation;t&&console.log(t)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}get programCache(){return this._programCache}setPipelineState(t){this._stateTracker.setPipeline(t)}getPipelineState(){return this._stateTracker.getPipelineState()}setBlendingEnabled(t){this._state.blend!==t&&(!0===t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=t,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(t,e){for(let s=0;s<t.length;++s){const e=t[s];this._state.textureUnitMap[e]=null,this._state.textureUnitSamplerMap[e]=null}e>=0&&(this._state.activeTexture=e)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(t,e,s,i){t===this._state.blendColor.r&&e===this._state.blendColor.g&&s===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(t,e,s,i),this._state.blendColor.r=t,this._state.blendColor.g=e,this._state.blendColor.b=s,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(t,e){t===this._state.blendFunction.srcRGB&&e===this._state.blendFunction.dstRGB||(this.gl.blendFunc(t,e),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=e,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(t,e,s,i){this._state.blendFunction.srcRGB===t&&this._state.blendFunction.srcAlpha===s&&this._state.blendFunction.dstRGB===e&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(t,e,s,i),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=s,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(t){this._state.blendEquation.mode!==t&&(this.gl.blendEquation(t),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(t,e){this._state.blendEquation.mode===t&&this._state.blendEquation.modeAlpha===e||(this.gl.blendEquationSeparate(t,e),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setColorMask(t,e,s,i){this._state.colorMask.r===t&&this._state.colorMask.g===e&&this._state.colorMask.b===s&&this._state.colorMask.a===i||(this.gl.colorMask(t,e,s,i),this._state.colorMask.r=t,this._state.colorMask.g=e,this._state.colorMask.b=s,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(t,e,s,i){this._state.clearColor.r===t&&this._state.clearColor.g===e&&this._state.clearColor.b===s&&this._state.clearColor.a===i||(this.gl.clearColor(t,e,s,i),this._state.clearColor.r=t,this._state.clearColor.g=e,this._state.clearColor.b=s,this._state.clearColor.a=i)}setFaceCullingEnabled(t){this._state.faceCulling!==t&&(!0===t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=t,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(t){this._state.polygonOffsetFill!==t&&(!0===t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=t,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(t,e){this._state.polygonOffset[0]===t&&this._state.polygonOffset[1]===e||(this._state.polygonOffset[0]=t,this._state.polygonOffset[1]=e,this.gl.polygonOffset(t,e),this._stateTracker.invalidatePolygonOffset())}setCullFace(t){this._state.cullFace!==t&&(this.gl.cullFace(t),this._state.cullFace=t,this._stateTracker.invalidateCulling())}setFrontFace(t){this._state.frontFace!==t&&(this.gl.frontFace(t),this._state.frontFace=t,this._stateTracker.invalidateCulling())}setScissorTestEnabled(t){this._state.scissorTest!==t&&(!0===t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=t)}setScissorRect(t,e,s,i){this._state.scissorRect.x===t&&this._state.scissorRect.y===e&&this._state.scissorRect.width===s&&this._state.scissorRect.height===i||(this.gl.scissor(t,e,s,i),this._state.scissorRect.x=t,this._state.scissorRect.y=e,this._state.scissorRect.width=s,this._state.scissorRect.height=i)}setDepthTestEnabled(t){this._state.depthTest!==t&&(!0===t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=t,this._stateTracker.invalidateDepthTest())}setClearDepth(t){this._state.clearDepth!==t&&(this.gl.clearDepth(t),this._state.clearDepth=t)}setDepthFunction(t){this._state.depthFunction!==t&&(this.gl.depthFunc(t),this._state.depthFunction=t,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(t){this._state.depthWrite!==t&&(this.gl.depthMask(t),this._state.depthWrite=t,this._stateTracker.invalidateDepthWrite())}setDepthRange(t,e){this._state.depthRange.zNear===t&&this._state.depthRange.zFar===e||(this.gl.depthRange(t,e),this._state.depthRange.zNear=t,this._state.depthRange.zFar=e,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(t){this._state.stencilTest!==t&&(!0===t?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=t,this._stateTracker.invalidateStencilTest())}setClearStencil(t){t!==this._state.clearStencil&&(this.gl.clearStencil(t),this._state.clearStencil=t)}setStencilFunction(t,e,s){1032===this._state.stencilFunction.face&&this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===e&&this._state.stencilFunction.mask===s||(this.gl.stencilFunc(t,e,s),this._state.stencilFunction.face=1032,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=e,this._state.stencilFunction.mask=s,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(t,e,s,i){this._state.stencilFunction.face===t&&this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(t,e,s,i),this._state.stencilFunction.face=t,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(t){this._state.stencilWriteMask!==t&&(this.gl.stencilMask(t),this._state.stencilWriteMask=t,this._stateTracker.invalidateStencilWrite())}setStencilOp(t,e,s){1032===this._state.stencilOperation.face&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===e&&this._state.stencilOperation.zPass===s||(this.gl.stencilOp(t,e,s),this._state.stencilOperation.face=1032,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=e,this._state.stencilOperation.zPass=s,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(t,e,s,i){this._state.stencilOperation.face===t&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(t,e,s,i),this._state.stencilOperation.face=t,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(t,e=!1){const s=this._state.activeTexture;return t>=0&&(e||t!==this._state.activeTexture)&&(this.gl.activeTexture(f+t),this._state.activeTexture=t),s}setDrawBuffers(t){const e=this.drawBuffers;if(e.length===t.length&&e.every((e,s)=>e===t[s]))return e;if(t.length>this.parameters.maxDrawBuffers)return x().error(`Setting more active draw buffers (${t.length}) than GL.MAX_DRAW_BUFFERS allows ( ${this.parameters.maxDrawBuffers}).`),e;const s=this._state.drawFramebuffer,i=null===s;if(i){if(t.length>1)return x().error(`The default framebuffer can only have 1 active draw buffer but was requested with ${t.length}.`),e;if(t[0]!==o&&t[0]!==u)return x().error(`The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers but got ${t[0]}`),e}else if(t.includes(o))return x().error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTx or GL.NONE as draw buffers."),e;return this.gl.drawBuffers(t),r(this.gl),i?this._state.drawBuffers.defaultFramebuffer=t:this._state.drawBuffers.fbos.set(s,t),e}get drawBuffers(){const t=this._state.drawFramebuffer;return null===t?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(t)??[]}clear(t,e=255){t&&(16384&t&&this.setColorMask(!0,!0,!0,!0),256&t&&this.setDepthWriteEnabled(!0),1024&t&&this.setStencilWriteMask(e),this.gl.clear(t))}clearFramebuffer(t,e=!1,s=!1){let i=0;if(t){const e=1e-13,s=Math.max(e,t[3]);this.setClearColor(t[0],t[1],t[2],s),i|=16384}e&&(i|=256),!1===s?s=0:(!0===s&&(s=255),i|=1024),i&&this.clear(i,s)}clearBuffer(t,e,s=6144,i){this.gl.clearBufferfv(s,t,e,i)}clearBufferInteger(t,e,s=6144,i){this.gl.clearBufferiv(s,t,e,i)}clearBufferUnsignedInteger(t,e,s=6144,i){this.gl.clearBufferuiv(s,t,e,i)}drawArrays(t,e,s){if(this._transformFeedbackRequestInfo){if(t!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(null==this._state.program?.hasTransformFeedbackVaryings)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(a()&&(this._numOfDrawCalls++,this._numOfTriangles+=k(t,s),has("enable-feature:webgl-debug:textureReadWrite"))){const t=this._state.textureUnitMap;for(let e=0;e<t.length;e++){const s=t[e];if(null!=s&&s===this._state.drawFramebuffer?.colorTexture)throw new Error(`Detected readWrite. Texture already bound at index ${e}`)}}this.gl.drawArrays(t,e,s),r(this.gl)}drawArraysInstanced(t,e,s,i){this.gl.drawArraysInstanced(t,e,s,i),r(this.gl)}drawElements(t,e,s,i){if(this._transformFeedbackRequestInfo)throw new Error("Cannot called drawElements during a transform feedback request");if(a()&&(this._numOfDrawCalls++,this._numOfTriangles+=k(t,e)),this.gl.drawElements(t,e,s,i),a()){const a=n(this.gl);if(a){const r=this.getBoundVAO(),n=r?.indexBuffer,l=r?.buffers,h={indexBuffer:n,vertexBuffers:l},f={mode:t,count:e,type:s,offset:i},o=n?.size??0,u=i+e,c=o<u?`. Buffer is too small. Attempted to draw index ${u} of ${o}`:"";x().error(`drawElements: ${a}${c}`,{args:f,vao:h})}}}drawElementsInstanced(t,e,s,i,a){this.gl.drawElementsInstanced(t,e,s,i,a),r(this.gl)}logInfo(){a()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}resetInfo(){a()&&(this._numOfDrawCalls=0,this._numOfTriangles=0)}get capabilities(){return this._capabilities}setViewport(t,e,s,i){s=Math.max(Math.round(s),1),i=Math.max(Math.round(i),1);const a=this._state.viewport;a.x===t&&a.y===e&&a.width===s&&a.height===i||(a.x=t,a.y=e,a.width=s,a.height=i,this.gl.viewport(t,e,s,i))}setViewport4fv(t){this.setViewport(t[0],t[1],t[2],t[3])}restoreViewport({x:t,y:e,width:s,height:i}){this.setViewport(t,e,s,i)}getViewport(){const t=this._state.viewport;return{x:t.x,y:t.y,width:t.width,height:t.height}}useProgram(t){if(this._state.program!==t){if(t&&null==t.glName&&l())throw new Error("Attempting to use disposed or invalid Program");this._state.program?.stop(),this._state.program=t,this.gl.useProgram(t?.glName??null)}}bindTexture(t,e,s=!1,i=null){(e>=this.parameters.maxTextureImageUnits||e<0)&&x().error(`Input texture unit (${e}) is out of range of available units (0...${this.parameters.maxTextureImageUnits})\n `);const a=this._state.textureUnitMap[e],r=this._state.textureUnitSamplerMap[e],{gl:n}=this;return null==t?.glName?(null!=a&&(this.setActiveTexture(e,s),n.bindTexture(a.descriptor.target,null)),this._state.textureUnitMap[e]=null,null!=r&&(this._state.textureUnitSamplerMap[e]=null,n.bindSampler(e,null)),a):(r!==i&&(n.bindSampler(e,i?.glName??null),this._state.textureUnitSamplerMap[e]=i),s||a!==t?(this.setActiveTexture(e,s),n.bindTexture(t.descriptor.target,t.glName),t.applyChanges(),this._state.textureUnitMap[e]=t,a):(t.isDirty&&(this.setActiveTexture(e,s),t.applyChanges()),a))}unbindTexture(t){if(null!=t)for(let e=0;e<this.parameters.maxTextureImageUnits;e++)this._state.textureUnitMap[e]===t&&(this.bindTexture(null,e),this._state.textureUnitMap[e]=null)}bindFramebuffer(t,e=!1){const s=E(t);if(e||this._state.readFramebuffer!==t||this._state.drawFramebuffer!==t){if(null==t)return this.gl.bindFramebuffer(36160,null),this._state.readFramebuffer=this._state.drawFramebuffer=null,void this.setDrawBuffers(s);t.initializeAndBind(36160),this._state.readFramebuffer=t,this._state.drawFramebuffer=t,this.setDrawBuffers(s)}else this.setDrawBuffers(s)}bindFramebufferSeparate(t,e,s=!1){const i=36008===e,a=i?this._state.readFramebuffer:this._state.drawFramebuffer;(s||a!==t)&&(null==t?this.gl.bindFramebuffer(e,null):t.initializeAndBind(e),i?this._state.readFramebuffer=t??null:(this._state.drawFramebuffer=t??null,this.setDrawBuffers(E(t))))}blitFramebuffer(t,e,s=16384,i=9728,a=0,r=0,n=t.width,l=t.height,h=0,f=0,o=e.width,u=e.height){this.bindFramebufferSeparate(t,36008,!0),this.bindFramebufferSeparate(e,36009,!0),this.gl.blitFramebuffer(a,r,n,l,h,f,o,u,s,i)}bindBuffer(t,e){if(t)switch(e??=t.bufferType,e){case 34962:this._state.vertexBuffer=S(this.gl,t,e,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=S(this.gl,t,e,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=S(this.gl,t,e,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=S(this.gl,t,e,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=S(this.gl,t,e,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=S(this.gl,t,e,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=S(this.gl,t,e,this._state.copyWriteBuffer);break;case 35982:this._state.transformFeedbackBuffer=S(this.gl,t,e,this._state.transformFeedbackBuffer)}}bindRenderbuffer(t){const e=this.gl;t||(e.bindRenderbuffer(e.RENDERBUFFER,null),this._state.renderbuffer=null),this._state.renderbuffer!==t&&(e.bindRenderbuffer(e.RENDERBUFFER,t.glName),this._state.renderbuffer=t)}_getBufferBinding(t,e){if(e>=this.parameters.maxUniformBufferBindings||e<0)return x().error(`Uniform buffer binding point (${e}) is out of range (0...${this.parameters.maxUniformBufferBindings})\n `),null;const s=35345===t?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let i=s[e];return null==i&&(i={buffer:null,offset:0,size:0},s[e]=i),i}bindBufferBase(t,e,s){const i=this._getBufferBinding(t,e);null!=i&&(i.buffer===s&&0===i.offset&&0===i.size||(this.gl.bindBufferBase(t,e,s?s.glName:null),35345===t?this._state.uniformBuffer=s:this._state.transformFeedbackBuffer=s,i.buffer=s,i.offset=0,i.size=0))}bindBufferRange(t,e,s,i,a){const r=this._getBufferBinding(t,e);null!=r&&(r.buffer===s&&r.offset===i&&r.size===a||(i%this._parameters.uniformBufferOffsetAlignment===0?(this.gl.bindBufferRange(t,e,s.glName,i,a),this._state.uniformBuffer=s,r.buffer=s,r.offset=i,r.size=a):x().error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUniformBufferBindingPoints(t){const e=this._state.uniformBufferBindingPoints,s=Math.max(e.length,t.length);e.length=0;for(let i=0;i<s;i++){const s=t[i];if(null!=s?.buffer){const{buffer:t,offset:e,size:a}=s;0===e&&0===a?this.gl.bindBufferBase(35345,i,t.glName):this.gl.bindBufferRange(35345,i,t.glName,e,a),this._state.uniformBuffer=t}else this.gl.bindBufferBase(35345,i,null),this._state.uniformBuffer=null;i<t.length&&(e[i]=s?{buffer:s.buffer,offset:s.offset,size:s.size}:{buffer:null,offset:0,size:0})}}bindUBO(t,e,s,i){null!=e?(a()&&(i??e.byteLength)>this._parameters.maxUniformBlockSize&&x().error("Attempting to bind more data than the maximum uniform block size"),e.initialize(),void 0!==s&&void 0!==i?this.bindBufferRange(35345,t,e.buffer,s,i):this.bindBufferBase(35345,t,e.buffer)):this.bindBufferBase(35345,t,null)}unbindUBO(t){for(let e=0,s=this._state.uniformBufferBindingPoints.length;e<s;e++){const s=this._state.uniformBufferBindingPoints[e];null!=s&&s.buffer===t.buffer&&this.bindBufferBase(35345,e,null)}}unbindBuffer(t){switch(t){case 34962:this._state.vertexBuffer=S(this.gl,null,t,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=S(this.gl,null,t,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=S(this.gl,null,t,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=S(this.gl,null,t,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=S(this.gl,null,t,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=S(this.gl,null,t,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=S(this.gl,null,t,this._state.copyWriteBuffer)}}bindVAO(t,e){if(null==t)return this._state.vertexArrayObject?.unbind(),void(this._state.vertexArrayObject=null);this._state.vertexArrayObject!==t&&(t.bind(e),this._state.vertexArrayObject=t)}bindTransformFeedback(t){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,t.glName)}beginTransformFeedback(t,e){if(this._transformFeedbackRequestInfo)throw new Error("Already in a transform feedback request");const{gl:s}=this;s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,t.glName),s.beginTransformFeedback(e),this._transformFeedbackRequestInfo={primitiveType:e}}endTransformFeedback(){if(!this._transformFeedbackRequestInfo)throw new Error("Not in a transform feedback request");const{gl:t}=this;t.endTransformFeedback(),t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null),this._transformFeedbackRequestInfo=null}async clientWaitAsync(t=i(10),e){const{gl:a}=this,r=a.fenceSync(37143,0);if(!r)throw new Error("Client wait failed, could not create sync object");this.instanceCounter.increment(c.Sync,r),a.flush();try{let i;do{await s(t,null,e),i=a.clientWaitSync(r,0,0)}while(37147===i);if(37149===i)throw new Error("Client wait failed")}finally{this.instanceCounter.decrement(c.Sync,r),a.deleteSync(r)}}get boundFramebuffer(){return this._state.drawFramebuffer}get uniformBufferBindingPoints(){return this._state.uniformBufferBindingPoints.map(t=>t?{buffer:t.buffer,offset:t.offset,size:t.size}:t)}temporaryBindFramebuffer(t,e,s=!1){const i=this.boundFramebuffer,a={...this._state.viewport};try{this.bindFramebuffer(t,s),t&&this.setViewport(0,0,t.width,t.height),e()}finally{this.bindFramebuffer(i,s),t&&this.setViewport(a.x,a.y,a.width,a.height)}}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null),this.bindVAO(null),this.bindFramebuffer(null,!0),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this.bindUniformBufferBindingPoints([]),this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663);for(let t=0;t<this.parameters.maxTextureImageUnits;++t)this.bindTexture(null,t);this.setBlendingEnabled(!1),this.setBlendFunction(1,0),this.setBlendEquation(32774),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(1029),this.setFrontFace(2305),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(513),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(519,0,0),this.setStencilOp(7680,7680,7680),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){const{gl:t}=this;t.bindVertexArray(null);for(let s=0;s<this.parameters.maxVertexAttributes;s++)t.disableVertexAttribArray(s);this._state.vertexBuffer?t.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):t.bindBuffer(34962,null),this._state.indexBuffer?t.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):t.bindBuffer(34963,null);for(let s=0;s<this._parameters.maxUniformBufferBindings;s++){const e=this._state.uniformBufferBindingPoints[s];if(null!=e){const{buffer:i,offset:a,size:r}=e;null!==i?0===a&&0===r?t.bindBufferBase(35345,s,i.glName):t.bindBufferRange(35345,s,i.glName,a,r):t.bindBufferBase(35345,s,null)}}if(this._state.uniformBuffer?t.bindBuffer(this._state.uniformBuffer.bufferType,this._state.uniformBuffer.glName):t.bindBuffer(35345,null),this._state.pixelPackBuffer?t.bindBuffer(this._state.pixelPackBuffer.bufferType,this._state.pixelPackBuffer.glName):t.bindBuffer(35051,null),this._state.pixelUnpackBuffer?t.bindBuffer(this._state.pixelUnpackBuffer.bufferType,this._state.pixelUnpackBuffer.glName):t.bindBuffer(35052,null),this._state.copyReadBuffer?t.bindBuffer(this._state.copyReadBuffer.bufferType,this._state.copyReadBuffer.glName):t.bindBuffer(36662,null),this._state.copyWriteBuffer?t.bindBuffer(this._state.copyWriteBuffer.bufferType,this._state.copyWriteBuffer.glName):t.bindBuffer(36663,null),t.bindFramebuffer(36008,null),t.readBuffer(t.BACK),this._state.readFramebuffer&&(t.bindFramebuffer(36008,this._state.readFramebuffer.glName),t.readBuffer(d)),t.bindFramebuffer(36009,this._state.drawFramebuffer?.glName??null),null===this._state.drawFramebuffer){const e=this._state.drawBuffers.defaultFramebuffer;t.drawBuffers(e??[o])}else{const e=this._state.drawBuffers.fbos.get(this._state.drawFramebuffer);t.drawBuffers(e??[d])}if(this._state.vertexArrayObject){const t=this._state.vertexArrayObject;this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null),this.bindVAO(t)}t.useProgram(this._state.program?.glName??null),t.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a),t.bindRenderbuffer(t.RENDERBUFFER,this._state.renderbuffer?.glName??null),!0===this._state.blend?t.enable(this.gl.BLEND):t.disable(this.gl.BLEND),t.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha),t.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha),t.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a),t.clearDepth(this._state.clearDepth),t.clearStencil(this._state.clearStencil),t.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a),t.cullFace(this._state.cullFace),t.depthFunc(this._state.depthFunction),t.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar),!0===this._state.depthTest?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),t.depthMask(this._state.depthWrite),t.frontFace(this._state.frontFace),t.lineWidth(1),!0===this._state.faceCulling?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),t.polygonOffset(this._state.polygonOffset[0],this._state.polygonOffset[1]),!0===this._state.polygonOffsetFill?t.enable(t.POLYGON_OFFSET_FILL):t.disable(t.POLYGON_OFFSET_FILL),t.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height),!0===this._state.scissorTest?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST),t.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask),t.stencilOpSeparate(this._state.stencilOperation.face,this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass),!0===this._state.stencilTest?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),t.stencilMask(this._state.stencilWriteMask);for(let s=0;s<this.parameters.maxTextureImageUnits;s++){t.activeTexture(f+s),t.bindTexture(3553,null),t.bindTexture(34067,null),t.bindTexture(32879,null),t.bindTexture(35866,null),t.bindSampler(s,null);const e=this._state.textureUnitMap[s];null!=e&&t.bindTexture(e.descriptor.target,e.glName);const i=this._state.textureUnitSamplerMap[s];null!=i&&t.bindSampler(s,i?.glName)}t.activeTexture(f+this._state.activeTexture);const e=this._state.viewport;t.viewport(e.x,e.y,e.width,e.height),this.resetInfo()}};function S(t,e,s,i){return e?i!==e&&t.bindBuffer(s,e.glName):t.bindBuffer(s,null),e}function k(t,e){switch(t){case _.POINTS:return 2*e;case _.TRIANGLES:return e/3;case _.TRIANGLE_STRIP:case _.TRIANGLE_FAN:return e-2;default:return 0}}function E(t){return t?t.colorAttachments.length>0?t.colorAttachments:[u]:[o]}export{w as RenderingContext,E as getFramebufferDrawBuffers};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../core/Logger.js";import{STD140_LAYOUT as e}from"./storageLayouts.js";function a(t,e){return t+(e-t%e)%e}const r=(()=>{const t=new ArrayBuffer(2),e=new Uint8Array(t),a=new Uint16Array(t);return e[0]=170,e[1]=187,48042===a[0]})(),n=4,i=()=>t.getLogger("esri.views.webgl.UniformBufferLayout");class s{constructor(t){this._layout=new Map,this.byteLength=this._buildLayout(t),this.array=new ArrayBuffer(this.byteLength),this.arrayView32=new Float32Array(this.array),this._dataView=new DataView(this.array)}setValues(t,e){t.forEach((t,a)=>this.setValue(a,t,e))}setValue(t,a,r){if(!this._layout.has(t))return void i().warn("Trying to set an unrecognized layout array member!");let s=this.byteLength/n,o=0;const{type:h,offset:y,arrayLength:u}=this._layout.get(t),{numberType:l,elementLength:f,elementCount:g,arrayStride:m}=e[h],w="number"!=typeof a,c=u*g,_=c*f;if((w?"byteLength"in a?a.byteLength/n:a.length:1)!==_&&i().warn("Attempting to set layout array member value with the wrong length!"),w)for(let e=0;e<c;e++)for(let t=0;t<f;t++){const r=y+e*m+t*n,i=e*f+t;if(this._setData(r,a[i],l)){const t=r/n;s=Math.min(s,t),o=Math.max(o,t+1)}}else if(this._setData(y,a,l)){const t=y/n;s=Math.min(s,t),o=Math.max(o,t+1)}r&&(r.from=Math.min(s,r.from),r.to=Math.max(o,r.to))}_setData(t,e,a){switch(a){case"Int32":if(e!==this._dataView.getInt32(t,r))return this._dataView.setInt32(t,e,r),!0;break;case"Uint32":if(e!==this._dataView.getUint32(t,r))return this._dataView.setUint32(t,e,r),!0;break;case"Float32":if(e!==this._dataView.getFloat32(t,r))return this._dataView.setFloat32(t,e,r),!0}return!1}_buildLayout(t){let r=0;for(const{name:i,type:s,count:o}of t){const{elementLength:t,elementCount:h,elementAlignment:y,arrayStride:u,arrayAlignment:l}=e[s],f=o??1,g=f*h,m=g>1,w=m?l:y,c=m?g*u:t*n;r=a(r,w),this._layout.set(i,{type:s,offset:r,arrayLength:f}),r+=c,m&&(r=a(r,w))}return a(r,4*n)}}export{s as UniformBufferLayout};
2
+ import t from"../../core/Logger.js";import{STD140_LAYOUT as e}from"./storageLayouts.js";function a(t,e){return t+(e-t%e)%e}const r=(()=>{const t=new ArrayBuffer(2),e=new Uint8Array(t),a=new Uint16Array(t);return e[0]=170,e[1]=187,48042===a[0]})(),n=4,i=()=>t.getLogger("esri.views.webgl.UniformBufferLayout");function o(t){return t.length>0&&"number"!=typeof t[0]}function s(t,e,a){if(!o(t))return t[e];const r=Math.floor(e/a);return t[r][e-r*a]}class h{constructor(t){this._layout=new Map,this.byteLength=this._buildLayout(t),this.array=new ArrayBuffer(this.byteLength),this.arrayView32=new Float32Array(this.array),this._dataView=new DataView(this.array)}setValues(t,e){t.forEach((t,a)=>this.setValue(a,t,e))}setValue(t,a,r){if(!this._layout.has(t))return void i().warn("Trying to set an unrecognized layout array member!");let h=this.byteLength/n,u=0;const{type:l,offset:y,arrayLength:f}=this._layout.get(t),{numberType:g,elementLength:m,elementCount:c,arrayStride:w}=e[l],_="number"!=typeof a,b=f*c,d=c*m,L=b*m;if((_?o(a)?a.length*a[0].length:a.length:1)!==L&&i().warn("Attempting to set layout array member value with the wrong length!"),_)for(let e=0;e<b;e++)for(let t=0;t<m;t++){const r=y+e*w+t*n,i=e*m+t;if(this._setData(r,s(a,i,d),g)){const t=r/n;h=Math.min(h,t),u=Math.max(u,t+1)}}else if(this._setData(y,a,g)){const t=y/n;h=Math.min(h,t),u=Math.max(u,t+1)}r&&(r.from=Math.min(h,r.from),r.to=Math.max(u,r.to))}_setData(t,e,a){switch(a){case"Int32":{const a=0|e;if(a!==this._dataView.getInt32(t,r))return this._dataView.setInt32(t,a,r),!0;break}case"Uint32":{const a=e>>>0;if(a!==this._dataView.getUint32(t,r))return this._dataView.setUint32(t,a,r),!0;break}case"Float32":{const a=Math.fround(e);if(a!==this._dataView.getFloat32(t,r))return this._dataView.setFloat32(t,a,r),!0;break}}return!1}_buildLayout(t){let r=0;for(const{name:i,type:o,count:s}of t){const{elementLength:t,elementCount:h,elementAlignment:u,arrayStride:l,arrayAlignment:y}=e[o],f=s??1,g=f*h,m=g>1,c=m?y:u,w=m?g*l:t*n;r=a(r,c),this._layout.set(i,{type:o,offset:r,arrayLength:f}),r+=w,m&&(r=a(r,c))}return a(r,4*n)}}export{h as UniformBufferLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{disposeMaybe as t}from"../../core/maybe.js";import{BufferObject as i}from"./BufferObject.js";import{UniformBufferLayout as e}from"./UniformBufferLayout.js";class s{constructor(t,i,s=35048){this._context=t,this._usage=s,this._dirtyRange={from:1/0,to:-1},this._initialized=!1,this._data=new e(i)}get byteLength(){return this._data.byteLength}initialize(){this._initialized||(this.buffer=i.createUniform(this._context,this._usage,this._data.array),this._resetDirtyRange(),this._initialized=!0)}dispose(){this._context.unbindUBO(this),this.buffer=t(this.buffer)}set(t){this._data.setValues(t,this._dirtyRange)}setUniform(t,i){this._data.setValue(t,i,this._dirtyRange)}upload(){this.initialize();const{from:t,to:i}=this._dirtyRange;i>-1&&t<i&&(this.buffer.setSubData(this._data.arrayView32,t,t,i),this._resetDirtyRange())}_resetDirtyRange(){this._dirtyRange.from=1/0,this._dirtyRange.to=-1}}export{s as UniformBufferObject};
2
+ import{disposeMaybe as t}from"../../core/maybe.js";import{BufferObject as i}from"./BufferObject.js";import{UniformBufferLayout as e}from"./UniformBufferLayout.js";class s{constructor(t,i,s=35048){this._context=t,this._usage=s,this._dirtyRange={from:1/0,to:-1},this._initialized=!1,this._data=new e(i)}get byteLength(){return this._data.byteLength}initialize(){this._initialized||(this.buffer=i.createUniform(this._context,this._usage,this._data.array),this._resetDirtyRange(),this._initialized=!0)}dispose(){this._context.unbindUBO(this),this.buffer=t(this.buffer)}set(t){this._data.setValues(t,this._dirtyRange)}setUniform(t,i){this._data.setValue(t,i,this._dirtyRange)}upload(){this.initialize();const{from:t,to:i}=this._dirtyRange;i>-1&&t<i&&(this.buffer.setData(this._data.arrayView32),this._resetDirtyRange())}_resetDirtyRange(){this._dirtyRange.from=1/0,this._dirtyRange.to=-1}}export{s as UniformBufferObject};
@@ -2,16 +2,15 @@ import type Graphic from "../../../Graphic.js";
2
2
  import type Field from "../../../layers/support/Field.js";
3
3
  import type EditableInput from "./EditableInput.js";
4
4
  import type GroupInput from "./GroupInput.js";
5
+ import type MultipleChoiceController from "./support/MultipleChoiceController.js";
5
6
  import type { Input } from "../../../form/elements/inputs.js";
6
7
  import type { FieldValue } from "../../../layers/support/fieldUtils.js";
7
8
  import type { DomainUnion as Domain } from "../../../layers/support/types.js";
8
9
  import type { EditableInputProperties } from "./EditableInput.js";
10
+ import type { MultipleChoiceOtherChoiceRenderState } from "./support/MultipleChoiceController.js";
9
11
  import type { FieldInputDataTypes } from "../../support/forms/types.js";
10
12
 
11
- export interface FieldInputProperties extends EditableInputProperties {}
12
-
13
- /** Represents the current render state for inline multiple-choice "Other" controls. */
14
- export interface MultipleChoiceOtherChoiceRenderState {}
13
+ export interface FieldInputProperties extends EditableInputProperties, Partial<Pick<FieldInput, "multipleChoiceController">> {}
15
14
 
16
15
  /**
17
16
  * This is a read-only support class that represents a [field element](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/) in a [BatchAttributeForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/).
@@ -70,7 +69,13 @@ export default class FieldInput extends EditableInput<any> {
70
69
  get maxLength(): number;
71
70
  /** The minimum length of the input. If no length is specified, the value is `-1`. */
72
71
  get minLength(): number;
73
- /** The checked state derived from the current other-choice values across all features. */
72
+ /** @internal */
73
+ accessor multipleChoiceController: MultipleChoiceController | null;
74
+ /**
75
+ * The checked state derived from the current other-choice values across all features.
76
+ *
77
+ * @deprecated Since 5.2.
78
+ */
74
79
  get multipleChoiceOtherChoiceCheckboxState(): {
75
80
  checked: boolean;
76
81
  indeterminate: boolean;
@@ -90,12 +95,14 @@ export default class FieldInput extends EditableInput<any> {
90
95
  /**
91
96
  * Returns the explicit inline other-choice checked state, if one has been stored.
92
97
  *
98
+ * @deprecated Since 5.2.
93
99
  * @returns The explicit checked state, or `undefined` if the state has not been set.
94
100
  */
95
101
  getExplicitMultipleChoiceOtherChoiceCheckedState(): boolean | undefined;
96
102
  /**
97
103
  * Returns the current render state for inline multiple-choice "Other" controls.
98
104
  *
105
+ * @deprecated Since 5.2.
99
106
  * @param otherOptionLabel - The fallback label to use when the input does not define a custom other-choice label.
100
107
  * @returns The current render state for the inline other-choice controls.
101
108
  */
@@ -103,14 +110,21 @@ export default class FieldInput extends EditableInput<any> {
103
110
  /**
104
111
  * Indicates whether an explicit inline other-choice checked state has been stored.
105
112
  *
113
+ * @deprecated Since 5.2.
106
114
  * @returns `true` if an explicit checked state has been stored; otherwise, `false`.
107
115
  */
108
116
  hasExplicitMultipleChoiceOtherChoiceCheckedState(): boolean;
109
- /** Initializes the explicit inline other-choice checked state from the current feature values when it has not been set yet. */
117
+ /**
118
+ * Initializes the explicit inline other-choice checked state from the current
119
+ * feature values when it has not been set yet.
120
+ *
121
+ * @deprecated Since 5.2.
122
+ */
110
123
  initializeExplicitMultipleChoiceOtherChoiceCheckedState(): void;
111
124
  /**
112
125
  * Stores the explicit inline other-choice checked state.
113
126
  *
127
+ * @deprecated Since 5.2.
114
128
  * @param isChecked - Indicates whether the inline other-choice checkbox is checked.
115
129
  */
116
130
  setExplicitMultipleChoiceOtherChoiceCheckedState(isChecked: boolean): void;
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as i}from"../../../core/MapUtils.js";import l from"../../../core/ReactiveMap.js";import{property as r,subclass as o}from"../../../core/accessorSupport/decorators.js";import{isMultipleChoiceInput as n}from"../../../form/elements/inputs/inputUtils.js";import a from"../../../layers/support/CodedValue.js";import s from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as u,validateDomainValue as h,dateTimeFieldValuesToNumericRange as p,isDomainValidForField as c}from"../../../layers/support/domainUtils.js";import{getFieldRange as m,isDateOnlyField as d,isTimeOnlyField as f,isTimestampOffsetField as C}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as g}from"../../../layers/support/layerUtils.js";import y from"../../../layers/support/RangeDomain.js";import{isNumber as x}from"../../../support/guards.js";import b from"./EditableInput.js";import{getFieldInputDataType as v,visibilityCodeToBoolean as O,differentValuesString as F,isFieldInputWithShowNoValueOptionInput as V}from"./support/inputUtils.js";import{otherChoiceCheckedPlaceholderValue as M,multipleChoiceOtherChoiceCheckedStateByExpressionsManager as _}from"./support/multipleChoiceInputUtils.js";import{timeResolutionToStepMap as S}from"../../support/dateUtils.js";import{valuesAreEquivalent as E,isEmptyValue as w,getMaxLength as k,getMinLength as D,dateIsValid as N,validateFormValue as T}from"../../support/forms/formUtils.js";let L=class extends b{constructor(e){super(e),this.getExternalErrorForFeature=null,this.getFieldValueOptionsForFeature=null,this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return"batch-attribute-form-validation::features-have-different-errors";const t=e[0];for(const i of e)if(i.error!==t.error)return"batch-attribute-form-validation::features-have-different-errors";return t.error}get dataType(){return v(this.field)}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get label(){const{label:e}=this.template,t=this._computeStringLiteralText(e);if(t)return t;const{field:i,layers:l}=this;if(1===l.length){const e=l[0];if(g(e)){const t=e.getFieldAlias(i.name);if(null!=t&&""!==t)return t}}return i.alias||i.name}get effectiveVisible(){return O(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if("visible"!==e)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return"hidden:visibility-expression:all-features"===i?"hidden:group-visibility-expression:all-features":"hidden:visibility-expression:some-features"===i?"hidden:group-visibility-expression:some-features":e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>E(i.getAttribute(e),t))}get field(){return this.template.field}get fieldName(){return this.field.name}get input(){return this.template.input}get multipleChoiceInput(){const{input:e}=this;return e&&n(e)?e:null}get multipleChoiceChoices(){const{multipleChoiceInput:e}=this;if(!e)return null;const t=new Map;for(const i of e.choices)t.has(i.value)||t.set(i.value,i);return Array.from(t.values())}get multipleChoiceValues(){return this.multipleChoiceChoices?.map(e=>e.value)??null}get multipleChoiceOtherChoiceFieldName(){return this.multipleChoiceInput?.otherChoice?.fieldName??null}get multipleChoiceOtherChoiceHint(){return this.multipleChoiceInput?.otherChoice?.hint??""}get multipleChoiceOtherChoiceLabel(){return this.multipleChoiceInput?.otherChoice?.label??null}get hasMultipleChoiceOtherChoiceField(){const{multipleChoiceOtherChoiceFieldName:e}=this;return!!e&&this.layers.every(t=>null!=t.getField(e))}get shouldShowMultipleChoiceOtherChoice(){return null!=this.multipleChoiceInput?.otherChoice&&this.hasMultipleChoiceOtherChoiceField}set shouldShowMultipleChoiceOtherChoice(e){this._overrideIfSome("shouldShowMultipleChoiceOtherChoice",e)}get multipleChoiceOtherChoiceValue(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return null;const t=this.features.map(t=>t.getAttribute(e));if(0===t.length)return null;const[i]=t;return t.every(e=>e===i)?i:F}get multipleChoiceOtherChoiceMaxLength(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return;let t;for(const i of this.layers){const l=i.getField(e)?.length;null==l||l<0||(t=null==t?l:Math.min(t,l))}return t}getMultipleChoiceOtherChoiceRenderState(e){const t=this.errors?.some(e=>"input-validation-error::cannot-be-empty"===e.error),{multipleChoiceOtherChoiceFieldName:i,shouldShowMultipleChoiceOtherChoice:l,multipleChoiceOtherChoiceValue:r}=this,o=this._getMultipleChoiceOtherChoiceCheckboxState(),n=o.checked&&t?"invalid":"idle";return{fieldName:i,hint:this.multipleChoiceOtherChoiceHint,label:this.multipleChoiceOtherChoiceLabel??e,shouldShow:l,checkboxState:o,value:r,normalizedValue:r===M?"":r,maxLength:this.multipleChoiceOtherChoiceMaxLength,status:n}}get multipleChoiceOtherChoiceCheckboxState(){const e=this.multipleChoiceOtherChoiceFieldName;if(!e)return{checked:!1,indeterminate:!1};const t=this.features.map(t=>t.getAttribute(e));return{checked:t.length>0&&t.every(e=>!w(e)),indeterminate:t.some(e=>!w(e))&&t.some(e=>w(e))}}initializeExplicitMultipleChoiceOtherChoiceCheckedState(){this.hasExplicitMultipleChoiceOtherChoiceCheckedState()||this.setExplicitMultipleChoiceOtherChoiceCheckedState(this.multipleChoiceOtherChoiceCheckboxState.checked)}hasExplicitMultipleChoiceOtherChoiceCheckedState(){return void 0!==this.getExplicitMultipleChoiceOtherChoiceCheckedState()}getExplicitMultipleChoiceOtherChoiceCheckedState(){const e=this._multipleChoiceOtherChoiceCheckedStateKey;if(e)return this._multipleChoiceOtherChoiceCheckedStateStore.get(e)}setExplicitMultipleChoiceOtherChoiceCheckedState(e){const t=this._multipleChoiceOtherChoiceCheckedStateKey;t&&this._multipleChoiceOtherChoiceCheckedStateStore.set(t,e)}stashMultipleChoiceOtherChoiceDraftValueForFeatures(e,t){const i=this.multipleChoiceOtherChoiceFieldName;if(i)for(const l of e)l.stashAttribute(i,t)}setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e){const t=this.multipleChoiceOtherChoiceFieldName;if(t)for(const i of e)i.stashAttribute(t,i.getAttribute(t))}getMultipleChoiceOtherChoiceDraftValue(e){const t=this.multipleChoiceOtherChoiceFieldName;if(t)return e.getStashedAttribute(t)}get invalidFeatures(){return this.errors.map(e=>e.feature)}get _multipleChoiceOtherChoiceCheckedStateKey(){return null!=this.multipleChoiceOtherChoiceFieldName?this.template.elementId:null}get _multipleChoiceOtherChoiceCheckedStateStore(){const e=this.expressionsManager;return e?i(_,e,()=>new l):new l}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this;return!this.required&&(!V(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this;return V(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return"date"===this.dataType&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const{input:e}=this;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}get inputType(){return this.input?.type}get maxLength(){return k({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return D({dataType:this.dataType,field:this.field,input:this.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=u(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?m(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get timeResolution(){const e=this.input;if(e&&("timestampoffset-picker"===e.type||"time-picker"===e.type))return e.timeResolution??"minutes"}get timeStep(){return null!=this.timeResolution?S.get(this.timeResolution):void 0}get valid(){return 0===this.errors.length||!this.editable}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:F}get valueIsOutOfDomain(){const{domain:e,value:t,field:i}=this;return!(!e||null==t)&&null!==h(i,t,e)}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?"hidden:no-domain-in-common":this._baseVisibilityCode:"hidden:field-definition"}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}get codedValueOptions(){const{getFieldValueOptionsForFeature:e}=this;if(1===this.features.length&&e){const t=this.features.at(0);return e({domain:this.domain??void 0,feature:t,fieldName:this.fieldName,layer:t.layer})}const t=this.codedValueDomainOptions,{value:i}=this,l=null==i||i===F||t.some(e=>e.value===i)?[]:[{name:`${i}`,value:i}];return{recommended:t,other:[],unsupported:l,containsEmptyOption:!1}}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const l of this.features){if(null==i.getExpressionExecutorsForLayer(l.layer)?.requiredExpression)continue;t=!1;const r=this._lookupEvaluatedExpression(l,"required");"success"===r?.status?e=e||!0===r.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const{input:e}=this;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"timestampoffset-picker"!==t||(i=p(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:l}=e;i={max:null!=t&&N(t)?t.getTime():null,min:null!=l&&N(l)?l.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:l}=this;if("date"!==this.dataType)return{};if(!l)return this._fieldShouldHaveDomain?{}:e;const r=u(i,l);if(!r)return e;const{max:o,min:n,rawMax:a,rawMin:s}=e,{type:h}=t.field;if("date"===h){const{max:e,min:t}=r;return{max:x(o)&&(null===e||null!=e&&o<=e)?o:e??null,min:x(n)&&(null===t||null!=t&&n>=t)?n:t??null}}if("date-only"===h||"time-only"===h||"timestamp-offset"===h){const{max:e,min:t,rawMax:i,rawMin:l}=r,u=x(o)&&a&&(null==e||o<e),h=x(n)&&s&&(null==t||n>t);return{max:u?o:e,min:h?n:t,rawMax:u?a:i,rawMin:h?s:l}}return{}}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:l,range:r}=this,o=[],{multipleChoiceInput:n}=this;for(const a of this.features){const{layer:s}=a,u=s.getField(t)??this.field,h=s.getFieldDomain(t,{feature:a.plainGraphic}),p=this.calculateDomain([h]),c=p&&"coded-value"!==p.type?p:null,m=this._requiredForFeature(a),d=a.getAttribute(t);let f=T(d,{dataType:e,domain:c,field:u,maxLength:i,minLength:l,multipleChoice:n,range:r,required:m})??this.getExternalErrorForFeature?.(a,t);if(!f&&n){const{otherChoice:e}=n,{multipleChoiceOtherChoiceFieldName:t,multipleChoiceOtherChoiceValue:i,shouldShowMultipleChoiceOtherChoice:l}=this,r=this._getMultipleChoiceOtherChoiceCheckboxState();if(l&&e&&t&&r.checked){const e=s.getField(t),l=i===M?null:i;if(e){const t=v(e);f=T(l,{dataType:t,domain:e.domain,field:e,maxLength:k({dataType:t,field:e,input:null}),minLength:D({dataType:t,field:e,input:null}),multipleChoice:null,range:{max:void 0,min:void 0},required:!0})}}}f&&o.push({error:f,feature:a.source})}return o}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_getMultipleChoiceOtherChoiceCheckboxState(){const{shouldShowMultipleChoiceOtherChoice:e,multipleChoiceOtherChoiceCheckboxState:t}=this,i=e?t:{checked:!1,indeterminate:!1},l=e?this.getExplicitMultipleChoiceOtherChoiceCheckedState():void 0;return void 0===l?i:{checked:l,indeterminate:!1}}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&c(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let l=null;switch(t?.type){case"range":l=this._intersectRangeDomains(e);break;case"coded-value":l=this._intersectCodedValueDomains(e)}return l}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const o of e)for(const[e,i]of t){o.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let l=t;if(i){l=new Map;for(const[e,r]of i)t.has(e)&&l.set(e,r)}const r=Array.from(l.entries()).map(([e,t])=>new a({code:e,name:t}));return r.length?new s({codedValues:r}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let l=1;l<e.length;l++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[l])}if(t&&!c(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof y){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:l}=this;return d(l)||f(l)||C(l)?p(l,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new y,l=this._getMinMaxFromRangeDomain(e),r=this._getMinMaxFromRangeDomain(t),{field:o}=this,n=this._getValidRangeValue(l.min,-1/0),a=this._getValidRangeValue(l.max,1/0),s=this._getValidRangeValue(r.min,-1/0),u=this._getValidRangeValue(r.max,1/0);return i.minValue=Math.max(n,s),i.maxValue=Math.min(a,u),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((d(o)||f(o)||C(o))&&(i.minValue=Number(l.min)>Number(r.min)?l.rawMin:r.rawMin,i.maxValue=Number(l.max)<Number(r.max)?l.rawMax:r.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return x(e)?e:t}};e([r()],L.prototype,"dataType",null),e([r()],L.prototype,"domain",null),e([r()],L.prototype,"distinctValues",null),e([r()],L.prototype,"editable",null),e([r()],L.prototype,"label",null),e([r()],L.prototype,"effectiveVisible",null),e([r()],L.prototype,"effectiveVisibilityCode",null),e([r()],L.prototype,"errors",null),e([r()],L.prototype,"featuresHaveSameValue",null),e([r()],L.prototype,"field",null),e([r()],L.prototype,"fieldName",null),e([r()],L.prototype,"getExternalErrorForFeature",void 0),e([r()],L.prototype,"getFieldValueOptionsForFeature",void 0),e([r()],L.prototype,"group",void 0),e([r()],L.prototype,"input",null),e([r()],L.prototype,"multipleChoiceInput",null),e([r()],L.prototype,"multipleChoiceChoices",null),e([r()],L.prototype,"multipleChoiceValues",null),e([r()],L.prototype,"multipleChoiceOtherChoiceFieldName",null),e([r()],L.prototype,"multipleChoiceOtherChoiceHint",null),e([r()],L.prototype,"multipleChoiceOtherChoiceLabel",null),e([r()],L.prototype,"hasMultipleChoiceOtherChoiceField",null),e([r()],L.prototype,"shouldShowMultipleChoiceOtherChoice",null),e([r()],L.prototype,"multipleChoiceOtherChoiceValue",null),e([r()],L.prototype,"multipleChoiceOtherChoiceMaxLength",null),e([r()],L.prototype,"multipleChoiceOtherChoiceCheckboxState",null),e([r()],L.prototype,"invalidFeatures",null),e([r()],L.prototype,"_multipleChoiceOtherChoiceCheckedStateStore",null),e([r()],L.prototype,"isSubtypeField",null),e([r()],L.prototype,"showNoValueOptionEnabled",null),e([r()],L.prototype,"showNoValueLabel",null),e([r()],L.prototype,"includeTime",null),e([r()],L.prototype,"includeTimeOffset",null),e([r({readOnly:!0})],L.prototype,"inputType",null),e([r()],L.prototype,"maxLength",null),e([r()],L.prototype,"minLength",null),e([r()],L.prototype,"range",null),e([r()],L.prototype,"required",null),e([r()],L.prototype,"timeResolution",null),e([r()],L.prototype,"timeStep",null),e([r({readOnly:!0})],L.prototype,"type",void 0),e([r()],L.prototype,"userHasChangedValue",void 0),e([r()],L.prototype,"valid",null),e([r()],L.prototype,"value",null),e([r()],L.prototype,"valueIsOutOfDomain",null),e([r()],L.prototype,"visibilityCode",null),e([r()],L.prototype,"codedValueDomainOptions",null),e([r()],L.prototype,"codedValueOptions",null),e([r()],L.prototype,"_evaluatedRequiredExpression",null),e([r()],L.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([r()],L.prototype,"_allDomains",null),e([r()],L.prototype,"_fieldShouldHaveDomain",null),e([r()],L.prototype,"_dateFormRange",null),e([r()],L.prototype,"_dateRange",null),L=e([o("esri.widgets.BatchAttributeForm.inputs.FieldInput")],L);const R=L;export{R as default};
2
+ import{__decorate as e}from"tslib";import{isSome as t}from"../../../core/arrayUtils.js";import{property as i,subclass as l}from"../../../core/accessorSupport/decorators.js";import{isMultipleChoiceInput as r}from"../../../form/elements/inputs/inputUtils.js";import n from"../../../layers/support/CodedValue.js";import o from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as a,validateDomainValue as s,dateTimeFieldValuesToNumericRange as u,isDomainValidForField as p}from"../../../layers/support/domainUtils.js";import{getFieldRange as d,isDateOnlyField as m,isTimeOnlyField as h,isTimestampOffsetField as c}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as f}from"../../../layers/support/layerUtils.js";import y from"../../../layers/support/RangeDomain.js";import{isNumber as g}from"../../../support/guards.js";import x from"./EditableInput.js";import{getFieldInputDataType as b,visibilityCodeToBoolean as v,isFieldInputWithShowNoValueOptionInput as C,differentValuesString as V}from"./support/inputUtils.js";import F from"./support/MultipleChoiceController.js";import{otherChoiceCheckedPlaceholderValue as _}from"./support/multipleChoiceInputUtils.js";import{timeResolutionToStepMap as E}from"../../support/dateUtils.js";import{valuesAreEquivalent as M,getMaxLength as w,getMinLength as D,dateIsValid as O,validateFormValue as S}from"../../support/forms/formUtils.js";let k=class extends x{constructor(e){super(e),this.getExternalErrorForFeature=null,this.getFieldValueOptionsForFeature=null,this.group=null,this.multipleChoiceController=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}initialize(){this.input&&r(this.input)&&(this.multipleChoiceController=new F({fieldInput:this}))}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return"batch-attribute-form-validation::features-have-different-errors";const t=e[0];for(const i of e)if(i.error!==t.error)return"batch-attribute-form-validation::features-have-different-errors";return t.error}get dataType(){return b(this.field)}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get label(){const{label:e}=this.template,t=this._computeStringLiteralText(e);if(t)return t;const{field:i,layers:l}=this;if(1===l.length){const e=l[0];if(f(e)){const t=e.getFieldAlias(i.name);if(null!=t&&""!==t)return t}}return i.alias||i.name}get effectiveVisible(){return v(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if("visible"!==e)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return"hidden:visibility-expression:all-features"===i?"hidden:group-visibility-expression:all-features":"hidden:visibility-expression:some-features"===i?"hidden:group-visibility-expression:some-features":e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>M(i.getAttribute(e),t))}get field(){return this.template.field}get fieldName(){return this.field.name}get input(){return this.template.input}get invalidFeatures(){return this.errors.map(e=>e.feature)}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this;return!this.required&&(!C(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this;return C(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return"date"===this.dataType&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const{input:e}=this;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}get inputType(){return this.input?.type}get maxLength(){return w({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return D({dataType:this.dataType,field:this.field,input:this.input})}get multipleChoiceOtherChoiceCheckboxState(){return this.multipleChoiceController?.otherChoiceCheckboxState??{checked:!1,indeterminate:!1}}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=a(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?d(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get timeResolution(){const e=this.input;if(e&&("timestampoffset-picker"===e.type||"time-picker"===e.type))return e.timeResolution??"minutes"}get timeStep(){return null!=this.timeResolution?E.get(this.timeResolution):void 0}get valid(){return 0===this.errors.length||!this.editable}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:V}get valueIsOutOfDomain(){const{domain:e,value:t,field:i}=this;return!(!e||null==t)&&null!==s(i,t,e)}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?"hidden:no-domain-in-common":this._baseVisibilityCode:"hidden:field-definition"}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}getExplicitMultipleChoiceOtherChoiceCheckedState(){return this.multipleChoiceController?.getExplicitOtherChoiceCheckedState()}getMultipleChoiceOtherChoiceRenderState(e){const t=this.multipleChoiceController?.otherChoiceRenderState;return t?{...t,label:t.label??e}:{fieldName:void 0,hint:"",label:e,shouldShow:!1,checkboxState:{checked:!1,indeterminate:!1},value:null,normalizedValue:null,maxLength:void 0,status:"idle"}}hasExplicitMultipleChoiceOtherChoiceCheckedState(){return this.multipleChoiceController?.hasExplicitOtherChoiceCheckedState()??!1}initializeExplicitMultipleChoiceOtherChoiceCheckedState(){this.multipleChoiceController?.initializeExplicitOtherChoiceCheckedState()}setExplicitMultipleChoiceOtherChoiceCheckedState(e){this.multipleChoiceController?.setExplicitOtherChoiceCheckedState(e)}get codedValueOptions(){const{getFieldValueOptionsForFeature:e}=this;if(1===this.features.length&&e){const t=this.features.at(0);return e({domain:this.domain??void 0,feature:t,fieldName:this.fieldName,layer:t.layer})}const t=this.codedValueDomainOptions,{value:i}=this,l=null==i||i===V||t.some(e=>e.value===i)?[]:[{name:`${i}`,value:i}];return{recommended:t,other:[],unsupported:l,containsEmptyOption:!1}}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const l of this.features){if(null==i.getExpressionExecutorsForLayer(l.layer)?.requiredExpression)continue;t=!1;const r=this._lookupEvaluatedExpression(l,"required");"success"===r?.status?e=e||!0===r.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const{input:e}=this;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"timestampoffset-picker"!==t||(i=u(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:l}=e;i={max:null!=t&&O(t)?t.getTime():null,min:null!=l&&O(l)?l.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:l}=this;if("date"!==this.dataType)return{};if(!l)return this._fieldShouldHaveDomain?{}:e;const r=a(i,l);if(!r)return e;const{max:n,min:o,rawMax:s,rawMin:u}=e,{type:p}=t.field;if("date"===p){const{max:e,min:t}=r;return{max:g(n)&&(null===e||null!=e&&n<=e)?n:e??null,min:g(o)&&(null===t||null!=t&&o>=t)?o:t??null}}if("date-only"===p||"time-only"===p||"timestamp-offset"===p){const{max:e,min:t,rawMax:i,rawMin:l}=r,a=g(n)&&s&&(null==e||n<e),p=g(o)&&u&&(null==t||o>t);return{max:a?n:e,min:p?o:t,rawMax:a?s:i,rawMin:p?u:l}}return{}}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:l,range:r}=this,n=[],o=this.multipleChoiceController?.input;for(const a of this.features){const{layer:s}=a,u=s.getField(t)??this.field,p=s.getFieldDomain(t,{feature:a.plainGraphic}),d=this.calculateDomain([p]),m=d&&"coded-value"!==d.type?d:null,h=this._requiredForFeature(a),c=a.getAttribute(t);let f=S(c,{dataType:e,domain:m,field:u,maxLength:i,minLength:l,multipleChoice:o,range:r,required:h})??this.getExternalErrorForFeature?.(a,t);if(!f&&o&&this.multipleChoiceController){const{multipleChoiceController:e}=this,{otherChoice:t}=o,i=e.otherChoiceFieldName,l=e.shouldShowOtherChoice,r=e.otherChoiceEffectiveCheckboxState;if(l&&t&&i&&r.checked){const e=s.getField(i),t=a.getAttribute(i),l=t===_?null:t;if(e){const t=b(e);f=S(l,{dataType:t,domain:e.domain,field:e,maxLength:w({dataType:t,field:e,input:null}),minLength:D({dataType:t,field:e,input:null}),multipleChoice:null,range:{max:void 0,min:void 0},required:!0})}}}f&&n.push({error:f,feature:a.source})}return n}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&p(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let l=null;switch(t?.type){case"range":l=this._intersectRangeDomains(e);break;case"coded-value":l=this._intersectCodedValueDomains(e)}return l}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const n of e)for(const[e,i]of t){n.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let l=t;if(i){l=new Map;for(const[e,r]of i)t.has(e)&&l.set(e,r)}const r=Array.from(l.entries()).map(([e,t])=>new n({code:e,name:t}));return r.length?new o({codedValues:r}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let l=1;l<e.length;l++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[l])}if(t&&!p(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof y){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:l}=this;return m(l)||h(l)||c(l)?u(l,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new y,l=this._getMinMaxFromRangeDomain(e),r=this._getMinMaxFromRangeDomain(t),{field:n}=this,o=this._getValidRangeValue(l.min,-1/0),a=this._getValidRangeValue(l.max,1/0),s=this._getValidRangeValue(r.min,-1/0),u=this._getValidRangeValue(r.max,1/0);return i.minValue=Math.max(o,s),i.maxValue=Math.min(a,u),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((m(n)||h(n)||c(n))&&(i.minValue=Number(l.min)>Number(r.min)?l.rawMin:r.rawMin,i.maxValue=Number(l.max)<Number(r.max)?l.rawMax:r.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return g(e)?e:t}};e([i()],k.prototype,"dataType",null),e([i()],k.prototype,"domain",null),e([i()],k.prototype,"distinctValues",null),e([i()],k.prototype,"editable",null),e([i()],k.prototype,"label",null),e([i()],k.prototype,"effectiveVisible",null),e([i()],k.prototype,"effectiveVisibilityCode",null),e([i()],k.prototype,"errors",null),e([i()],k.prototype,"featuresHaveSameValue",null),e([i()],k.prototype,"field",null),e([i()],k.prototype,"fieldName",null),e([i()],k.prototype,"getExternalErrorForFeature",void 0),e([i()],k.prototype,"getFieldValueOptionsForFeature",void 0),e([i()],k.prototype,"group",void 0),e([i()],k.prototype,"input",null),e([i()],k.prototype,"multipleChoiceController",void 0),e([i()],k.prototype,"invalidFeatures",null),e([i()],k.prototype,"isSubtypeField",null),e([i()],k.prototype,"showNoValueOptionEnabled",null),e([i()],k.prototype,"showNoValueLabel",null),e([i()],k.prototype,"includeTime",null),e([i()],k.prototype,"includeTimeOffset",null),e([i({readOnly:!0})],k.prototype,"inputType",null),e([i()],k.prototype,"maxLength",null),e([i()],k.prototype,"minLength",null),e([i()],k.prototype,"multipleChoiceOtherChoiceCheckboxState",null),e([i()],k.prototype,"range",null),e([i()],k.prototype,"required",null),e([i()],k.prototype,"timeResolution",null),e([i()],k.prototype,"timeStep",null),e([i({readOnly:!0})],k.prototype,"type",void 0),e([i()],k.prototype,"userHasChangedValue",void 0),e([i()],k.prototype,"valid",null),e([i()],k.prototype,"value",null),e([i()],k.prototype,"valueIsOutOfDomain",null),e([i()],k.prototype,"visibilityCode",null),e([i()],k.prototype,"codedValueDomainOptions",null),e([i()],k.prototype,"codedValueOptions",null),e([i()],k.prototype,"_evaluatedRequiredExpression",null),e([i()],k.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([i()],k.prototype,"_allDomains",null),e([i()],k.prototype,"_fieldShouldHaveDomain",null),e([i()],k.prototype,"_dateFormRange",null),e([i()],k.prototype,"_dateRange",null),k=e([l("esri.widgets.BatchAttributeForm.inputs.FieldInput")],k);const T=k;export{T as default};
@@ -0,0 +1,100 @@
1
+ import type Accessor from "../../../../core/Accessor.js";
2
+ import type MultipleChoiceInput from "../../../../form/elements/inputs/MultipleChoiceInput.js";
3
+ import type Choice from "../../../../form/elements/inputs/multipleChoice/Choice.js";
4
+ import type FieldInput from "../FieldInput.js";
5
+ import type { FieldValue } from "../../../../layers/support/fieldUtils.js";
6
+
7
+ /**
8
+ * Represents the current render state for inline multiple-choice "Other" controls.
9
+ *
10
+ * @internal
11
+ */
12
+ export interface MultipleChoiceOtherChoiceRenderState {}
13
+
14
+ /** @internal */
15
+ export interface MultipleChoiceSelectionState {}
16
+
17
+ /** @internal */
18
+ export interface MultipleChoiceCheckboxState {}
19
+
20
+ /**
21
+ * Represents a field input with a multiple-choice input.
22
+ *
23
+ * @internal
24
+ */
25
+ export type FieldInputWithMultipleChoice = FieldInput;
26
+
27
+ /**
28
+ * Manages state and computes values for multiple-choice inputs in BatchAttributeForm field inputs.
29
+ *
30
+ * @internal
31
+ */
32
+ export default abstract class MultipleChoiceController extends Accessor {
33
+ /**
34
+ * The configured multiple-choice choices with duplicate values removed.
35
+ *
36
+ * @internal
37
+ */
38
+ get choices(): Choice[];
39
+ /**
40
+ * The configured multiple-choice input for this field.
41
+ *
42
+ * @internal
43
+ */
44
+ get input(): MultipleChoiceInput;
45
+ /**
46
+ * The current render state for inline multiple-choice "Other" controls.
47
+ *
48
+ * @internal
49
+ */
50
+ get otherChoiceRenderState(): MultipleChoiceOtherChoiceRenderState;
51
+ /**
52
+ * Derives all configured choice checkbox states and the select-all state in a single pass.
53
+ *
54
+ * @internal
55
+ */
56
+ get selectionState(): MultipleChoiceSelectionState;
57
+ /**
58
+ * The configured multiple-choice values with duplicates removed.
59
+ *
60
+ * @internal
61
+ */
62
+ get values(): string[];
63
+ /**
64
+ * Computes the updated delimited value for a single feature after a choice toggle.
65
+ *
66
+ * @param options - The choice toggle details.
67
+ * @returns The updated field value.
68
+ * @internal
69
+ */
70
+ getUpdatedValueForFeature(options: {
71
+ choiceValue: string;
72
+ currentValue: FieldValue;
73
+ isChecked: boolean;
74
+ }): FieldValue;
75
+ /**
76
+ * Computes the updated shared field value from a checkbox interaction.
77
+ *
78
+ * @param options - The checkbox interaction details.
79
+ * @returns The updated field value.
80
+ * @internal
81
+ */
82
+ getValueFromCheckboxChange(options: {
83
+ choiceValue: string;
84
+ isChecked: boolean;
85
+ isSelectAllCheckbox?: boolean;
86
+ }): FieldValue;
87
+ /**
88
+ * Initializes the explicit inline other-choice checked state from the current feature values when it has not been set yet.
89
+ *
90
+ * @internal
91
+ */
92
+ initializeExplicitOtherChoiceCheckedState(): void;
93
+ /**
94
+ * Stores the explicit inline other-choice checked state.
95
+ *
96
+ * @param isChecked - Whether the explicit other-choice input is checked.
97
+ * @internal
98
+ */
99
+ setExplicitOtherChoiceCheckedState(isChecked: boolean): void;
100
+ }
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{getOrCreateMapValue as o}from"../../../../core/MapUtils.js";import i from"../../../../core/ReactiveMap.js";import{property as h,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{differentValuesString as c}from"./inputUtils.js";import{otherChoiceCheckedPlaceholderValue as l,splitMultipleChoiceValue as s,multipleChoiceOtherChoiceCheckedStateByExpressionsManager as n,getUpdatedMultipleChoiceValueForFeature as u}from"./multipleChoiceInputUtils.js";import{isEmptyValue as a,valuesAreEquivalent as d}from"../../../support/forms/formUtils.js";let C=class extends t{constructor(e){super(e)}get choices(){const e=new Map;for(const t of this.input.choices)e.has(t.value)||e.set(t.value,t);return Array.from(e.values())}get hasOtherChoiceField(){const{otherChoiceFieldName:e}=this,{layers:t}=this.fieldInput;return!!e&&t.every(t=>null!=t.getField(e))}get input(){return this.fieldInput.input}get otherChoice(){return this.input.otherChoice}get otherChoiceCheckboxState(){const e=this.otherChoiceFieldName;if(!e)return{checked:!1,indeterminate:!1};let t=!1,o=!1,i=0;for(const r of this.fieldInput.features)i+=1,a(r.getAttribute(e))?o=!0:t=!0;const h=i>0&&!o;return{checked:h,indeterminate:!h&&t}}get otherChoiceEffectiveCheckboxState(){const e=this.shouldShowOtherChoice,t=e?this.otherChoiceCheckboxState:{checked:!1,indeterminate:!1},o=e?this.getExplicitOtherChoiceCheckedState():void 0;return void 0===o?t:{checked:o,indeterminate:!1}}get otherChoiceFieldName(){return this.otherChoice?.fieldName??null}get otherChoiceHint(){return this.otherChoice?.hint??""}get otherChoiceLabel(){return this.otherChoice?.label??null}get otherChoiceMaxLength(){const{otherChoiceFieldName:e}=this;if(!e||!this.shouldShowOtherChoice)return;let t;for(const o of this.fieldInput.layers){const i=o.getField(e)?.length;null==i||i<0||(t=null==t?i:Math.min(t,i))}return t}get otherChoiceRenderState(){const e=this.otherChoiceFieldName??void 0,t=this.shouldShowOtherChoice,o=this.otherChoiceValue,i=this.otherChoiceEffectiveCheckboxState,h=this.fieldInput.errors?.some(e=>"input-validation-error::cannot-be-empty"===e.error),r=i.checked&&h?"invalid":"idle";return{fieldName:e,hint:this.otherChoiceHint,label:this.otherChoiceLabel,shouldShow:t,checkboxState:i,value:o,normalizedValue:o===l?"":o,maxLength:this.otherChoiceMaxLength,status:r}}get otherChoiceValue(){const{otherChoiceFieldName:e}=this;if(!e||!this.shouldShowOtherChoice)return null;const t=Iterator.from(this.fieldInput.features),o=t.next().value?.getAttribute(e)??null;for(const i of t)if(!d(i.getAttribute(e),o))return c;return o}get selectionState(){const{choiceDelimiter:e}=this.input,t=this.values,o=new Map;if(null==e||!t.length)return{checkboxStatesByValue:o,selectAllState:{checked:!1,indeterminate:!1}};const i=this.fieldInput.features.length,h=new Map;for(const l of t)h.set(l,0);for(const l of this.fieldInput.features){const t=l.getAttribute(this.fieldInput.fieldName),o=new Set(s(t,e));for(const e of o){const t=h.get(e);null!=t&&h.set(e,t+1)}}let r=i>0,c=!1;for(const[l,s]of h){const e=i>0&&s===i?{checked:!0,indeterminate:!1}:s>0?{checked:!1,indeterminate:!0}:{checked:!1,indeterminate:!1};o.set(l,e),(e.checked||e.indeterminate)&&(c=!0),e.checked||(r=!1)}return{checkboxStatesByValue:o,selectAllState:{checked:r,indeterminate:!r&&c}}}get shouldShowOtherChoice(){return null!=this.otherChoice&&this.hasOtherChoiceField}set shouldShowOtherChoice(e){this._overrideIfSome("shouldShowOtherChoice",e)}get values(){return this.choices.map(e=>e.value)}get _otherChoiceCheckedStateKey(){return null!=this.otherChoiceFieldName?this.fieldInput.template.elementId:null}get _otherChoiceCheckedStateStore(){const e=this.fieldInput.expressionsManager;return e?o(n,e,()=>new i):new i}getCheckboxState(e){return this.selectionState.checkboxStatesByValue.get(e)??{checked:!1,indeterminate:!1}}getExplicitOtherChoiceCheckedState(){const e=this._otherChoiceCheckedStateKey;if(e)return this._otherChoiceCheckedStateStore.get(e)}getOtherChoiceDraftValue(e){const t=this.otherChoiceFieldName;if(t)return e.getStashedAttribute(t)}getUpdatedValueForFeature({choiceValue:e,currentValue:t,isChecked:o}){return u({configuredChoiceValues:this.values,multipleChoiceInput:this.input,choiceValue:e,currentValue:t,isChecked:o})}getValueFromCheckboxChange({choiceValue:e,isChecked:t,isSelectAllCheckbox:o=!1}){const{choiceDelimiter:i}=this.input,h=this.values;if(o){return this.selectionState.selectAllState.checked?null:h.length>0?h.join(i):null}const r=s(this.fieldInput.value,i).filter(e=>e!==c),l=new Set(r);t?l.add(e):l.delete(e);const n=h.filter(e=>l.has(e));return n.length?n.join(i):null}hasExplicitOtherChoiceCheckedState(){return void 0!==this.getExplicitOtherChoiceCheckedState()}initializeExplicitOtherChoiceCheckedState(){this.hasExplicitOtherChoiceCheckedState()||this.setExplicitOtherChoiceCheckedState(this.otherChoiceCheckboxState.checked)}setExplicitOtherChoiceCheckedState(e){const t=this._otherChoiceCheckedStateKey;t&&this._otherChoiceCheckedStateStore.set(t,e)}setOtherChoiceDraftValuesFromFeatures(e){const t=this.otherChoiceFieldName;if(t)for(const o of e)o.stashAttribute(t,o.getAttribute(t))}stashOtherChoiceDraftValueForFeatures(e,t){const o=this.otherChoiceFieldName;if(o)for(const i of e)i.stashAttribute(o,t)}};e([h()],C.prototype,"choices",null),e([h({constructOnly:!0})],C.prototype,"fieldInput",void 0),e([h()],C.prototype,"hasOtherChoiceField",null),e([h()],C.prototype,"input",null),e([h()],C.prototype,"otherChoice",null),e([h()],C.prototype,"otherChoiceCheckboxState",null),e([h()],C.prototype,"otherChoiceEffectiveCheckboxState",null),e([h()],C.prototype,"otherChoiceFieldName",null),e([h()],C.prototype,"otherChoiceHint",null),e([h()],C.prototype,"otherChoiceLabel",null),e([h()],C.prototype,"otherChoiceMaxLength",null),e([h()],C.prototype,"otherChoiceRenderState",null),e([h()],C.prototype,"otherChoiceValue",null),e([h()],C.prototype,"selectionState",null),e([h()],C.prototype,"shouldShowOtherChoice",null),e([h()],C.prototype,"values",null),e([h()],C.prototype,"_otherChoiceCheckedStateStore",null),C=e([r("esri.widgets.BatchAttributeForm.inputs.support.MultipleChoiceController")],C);const p=C;export{p as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Error.js";import t from"../AttachmentElementInput.js";import s from"../BatchFormInputs.js";import r from"../FieldInput.js";import n from"../GroupInput.js";import o from"../RelationshipElementInput.js";import p from"../TextElementInput.js";import a from"../UtilityNetworkAssociationsElementInput.js";import{hashGroupElementTemplateWithoutChildren as i}from"../../templates/support/hashElementTemplate.js";import{isFieldElementTemplate as l,isGroupElementTemplate as u,isRelationshipElementTemplate as m,isTextElementTemplate as f,isAttachmentElementTemplate as c,isUtilityNetworkAssociationsElementTemplate as h}from"../../templates/support/templateUtils.js";function g(e,t){const r=new s({inputs:e.elements.map(e=>w(e,t)),template:e});return F(r),r}function I(e,t,s){const r=g(t,s),{mergedInputs:n}=d(e.inputs,r.inputs,e.staleInputs);e.template=t,e.inputs=n,F(e)}function d(e,t,s){const r=new Set,n=[],o=new Map(e.map(e=>[y(e),e]));for(const p of t){const e=y(p);r.add(e);const t=o.get(e);if(t){x(t,p),n.push(t),p.destroy();continue}const a=s.get(e);a?(x(a,p),n.push(a),s.delete(e),p.destroy()):n.push(p)}for(const p of e){const e=y(p);r.has(e)||s.set(e,p)}return{mergedInputs:n}}function x(e,t){if(e.features=t.features,e.existsInAllLayers=t.existsInAllLayers,"group"!==e.type||"group"!==t.type)return;const{mergedInputs:s}=d(e.inputs,t.inputs,e.staleInputs);e.inputs=s;for(const r of s)r.group=e}function y(e){return"group"===e.type?i(e.template):e.template.elementId}function F(e){const t=e.allFieldInputs,s=new Set(t.map(e=>e.fieldName));for(const r of t){const e=r.multipleChoiceOtherChoiceFieldName;if(!e)continue;const t=r.layers[0]?.getField(e)?.name??e;s.has(t)&&(r.shouldShowMultipleChoiceOtherChoice=!1)}}function w(s,i){const{allFeatures:g,expressionsManager:I,getFieldValueOptionsForFeature:d,getExternalErrorForFeature:x,map:y}=i,F=new Set(s.layers),j=g.filter(e=>F.has(e.layer)),A=j.length===g.length;if(l(s))return new r({existsInAllLayers:A,features:j,template:s,expressionsManager:I,getExternalErrorForFeature:x,getFieldValueOptionsForFeature:d});if(u(s)){const e=s.elements.map(e=>w(e,i));return new n({existsInAllLayers:A,features:j,inputs:e,template:s,expressionsManager:I})}if(m(s))return new o({existsInAllLayers:A,features:j,map:y,template:s,expressionsManager:I});if(f(s))return new p({existsInAllLayers:A,features:j,template:s,expressionsManager:I});if(c(s))return new t({existsInAllLayers:A,features:j,template:s,expressionsManager:I});if(h(s))return new a({existsInAllLayers:A,features:j,template:s,expressionsManager:I,map:y});throw new e("batch-attribute-form:unsupported-element-template","The type of form element template provided is not supported")}export{g as createBatchFormInputsFromBatchFormTemplate,I as mergeBatchFormInputsFromNewTemplate};
2
+ import e from"../../../../core/Error.js";import t from"../AttachmentElementInput.js";import s from"../BatchFormInputs.js";import r from"../FieldInput.js";import n from"../GroupInput.js";import o from"../RelationshipElementInput.js";import p from"../TextElementInput.js";import a from"../UtilityNetworkAssociationsElementInput.js";import{hashGroupElementTemplateWithoutChildren as i}from"../../templates/support/hashElementTemplate.js";import{isFieldElementTemplate as l,isGroupElementTemplate as u,isRelationshipElementTemplate as m,isTextElementTemplate as f,isAttachmentElementTemplate as c,isUtilityNetworkAssociationsElementTemplate as g}from"../../templates/support/templateUtils.js";function h(e,t){const r=new s({inputs:e.elements.map(e=>w(e,t)),template:e});return F(r),r}function I(e,t,s){const r=h(t,s),{mergedInputs:n}=d(e.inputs,r.inputs,e.staleInputs);e.template=t,e.inputs=n,F(e)}function d(e,t,s){const r=new Set,n=[],o=new Map(e.map(e=>[y(e),e]));for(const p of t){const e=y(p);r.add(e);const t=o.get(e);if(t){x(t,p),n.push(t),p.destroy();continue}const a=s.get(e);a?(x(a,p),n.push(a),s.delete(e),p.destroy()):n.push(p)}for(const p of e){const e=y(p);r.has(e)||s.set(e,p)}return{mergedInputs:n}}function x(e,t){if(e.features=t.features,e.existsInAllLayers=t.existsInAllLayers,"group"!==e.type||"group"!==t.type)return;const{mergedInputs:s}=d(e.inputs,t.inputs,e.staleInputs);e.inputs=s;for(const r of s)r.group=e}function y(e){return"group"===e.type?i(e.template):e.template.elementId}function F(e){const t=e.allFieldInputs,s=new Set(t.map(e=>e.fieldName));for(const r of t){const e=r.multipleChoiceController,t=e?.otherChoiceFieldName;if(!t)continue;const n=r.layers[0]?.getField(t)?.name??t;s.has(n)&&(e.shouldShowOtherChoice=!1)}}function w(s,i){const{allFeatures:h,expressionsManager:I,getFieldValueOptionsForFeature:d,getExternalErrorForFeature:x,map:y}=i,F=new Set(s.layers),j=h.filter(e=>F.has(e.layer)),A=j.length===h.length;if(l(s))return new r({existsInAllLayers:A,features:j,template:s,expressionsManager:I,getExternalErrorForFeature:x,getFieldValueOptionsForFeature:d});if(u(s)){const e=s.elements.map(e=>w(e,i));return new n({existsInAllLayers:A,features:j,inputs:e,template:s,expressionsManager:I})}if(m(s))return new o({existsInAllLayers:A,features:j,map:y,template:s,expressionsManager:I});if(f(s))return new p({existsInAllLayers:A,features:j,template:s,expressionsManager:I});if(c(s))return new t({existsInAllLayers:A,features:j,template:s,expressionsManager:I});if(g(s))return new a({existsInAllLayers:A,features:j,template:s,expressionsManager:I,map:y});throw new e("batch-attribute-form:unsupported-element-template","The type of form element template provided is not supported")}export{h as createBatchFormInputsFromBatchFormTemplate,I as mergeBatchFormInputsFromNewTemplate};