@arcgis/core 5.1.0-next.77 → 5.1.0-next.79

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 (589) hide show
  1. package/analysis/ElevationProfile/ElevationProfileGroup.d.ts +74 -0
  2. package/analysis/ElevationProfile/ElevationProfileGroup.js +2 -0
  3. package/analysis/ElevationProfileAnalysis.d.ts +29 -14
  4. package/analysis/ElevationProfileAnalysis.js +1 -1
  5. package/analysis/ShadowCast/DiscreteOptions.d.ts +33 -6
  6. package/analysis/ShadowCast/DiscreteOptions.js +1 -1
  7. package/analysis/ShadowCast/MinDurationOptions.d.ts +6 -4
  8. package/analysis/ShadowCast/TotalDurationOptions.d.ts +33 -6
  9. package/analysis/ShadowCast/TotalDurationOptions.js +1 -1
  10. package/analysis/ShadowCast/colorStopsUtils.js +2 -0
  11. package/analysis/ShadowCastAnalysis.d.ts +24 -1
  12. package/analysis/ShadowCastAnalysis.js +1 -1
  13. package/analysis/Viewshed.d.ts +27 -0
  14. package/analysis/Viewshed.js +1 -1
  15. package/analysis/ViewshedAnalysis.js +1 -1
  16. package/applications/Components/OrientedImageryViewer/ImageViewer/utils.d.ts +34 -0
  17. package/applications/Components/OrientedImageryViewer/ImageViewer/utils.js +2 -0
  18. package/arcade/FunctionWrapper.js +1 -1
  19. package/arcade/arcadeAsyncRuntime.js +1 -1
  20. package/arcade/arcadeCompiler.js +1 -1
  21. package/arcade/arcadeRuntime.js +1 -1
  22. package/arcade/compilerUtils.js +1 -1
  23. package/arcade/debug.d.ts +139 -0
  24. package/arcade/debug.js +2 -0
  25. package/arcade/featureSetCollection.js +1 -1
  26. package/arcade/featureSetUtils.js +1 -1
  27. package/arcade/featureset/actions/GroupBy.js +1 -1
  28. package/arcade/featureset/actions/OrderBy.js +1 -1
  29. package/arcade/functions/featuresetstring.js +1 -1
  30. package/arcade/languageUtils.js +1 -1
  31. package/arcade.d.ts +46 -2
  32. package/arcade.js +1 -1
  33. package/assets/esri/core/workers/RemoteClient.js +1 -1
  34. package/assets/esri/core/workers/chunks/{1c7183551f5269bdcf13.js → 01bd1b86ba899c6aa4c0.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{1f8ccf96069ac3a40c3d.js → 01ee18782a50279f907e.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{34ea3ed78041437a8fc8.js → 022067e807905cabeaa1.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{537fe2522dff1e6ce03b.js → 052cdc7aaa803b5873f0.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{8d75f6f27c1c17c33992.js → 056fd7847caaff2c9514.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{8acee3fba488f202f82f.js → 05c3146d87d917606193.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{75d5ea0da181f9e7425f.js → 0aebcbf41cb193e76809.js} +11 -11
  41. package/assets/esri/core/workers/chunks/{54023458195549f66215.js → 0b77c124b743067e4155.js} +1 -1
  42. package/assets/esri/core/workers/chunks/10408183681fd6c7b4ed.js +2 -0
  43. package/assets/esri/core/workers/chunks/17acbf40e7c1cb42d9bd.js +1 -0
  44. package/assets/esri/core/workers/chunks/{baeb96aef03d4c566af7.js → 1f53620f82cc7c3daabe.js} +1 -1
  45. package/assets/esri/core/workers/chunks/2387613b855771a3e537.js +1 -0
  46. package/assets/esri/core/workers/chunks/283d39dfb1625b5a74db.js +1 -0
  47. package/assets/esri/core/workers/chunks/{7595ceba529ed01c7590.js → 2c87c3112a43db8624f6.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{13e60f19f436b8d683ae.js → 3c9482764c9e4f8bcbb0.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{5e1b847b116d21908a54.js → 3e37019eee1c49d2bf64.js} +1 -1
  50. package/assets/esri/core/workers/chunks/45c83eb7c2a06166e3b0.js +1 -0
  51. package/assets/esri/core/workers/chunks/48acd146bf0241d87647.js +1 -0
  52. package/assets/esri/core/workers/chunks/5818f1f526577068d6ca.js +2 -0
  53. package/assets/esri/core/workers/chunks/5b6f2bfdcdd207d8ae42.js +1 -0
  54. package/assets/esri/core/workers/chunks/{330b47ac0759c3c35cc5.js → 5ccc325d83cec4f5ccdb.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{30e710ec4d22c43d4e7e.js → 5cffc7b49966201eccdb.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{1a87e9bbd85ba29b1514.js → 5da2051f548c2942e01a.js} +1 -1
  57. package/assets/esri/core/workers/chunks/5ec66e39e53c11e75179.js +2 -0
  58. package/assets/esri/core/workers/chunks/{0b1454a77a6a682541dc.js.LICENSE.txt → 5ec66e39e53c11e75179.js.LICENSE.txt} +9 -1
  59. package/assets/esri/core/workers/chunks/5f6fd20a7f4e80eafa25.js +1 -0
  60. package/assets/esri/core/workers/chunks/{abc06d10c7ac8ba5b0e4.js → 67ec1694d6e18b7c234c.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{32e22d6eee9fed1f70b0.js → 6d696beddcc5fbed5875.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{f590b60fca607d66001a.js → 716a4d7e8b908b81870b.js} +1 -1
  63. package/assets/esri/core/workers/chunks/71fe127734f33d020a44.js +1 -0
  64. package/assets/esri/core/workers/chunks/7cdd0492b2191df95102.js +2 -0
  65. package/assets/esri/core/workers/chunks/7cea68257d24ffd205bb.js +1 -0
  66. package/assets/esri/core/workers/chunks/7e530e635325dba07864.js +1 -0
  67. package/assets/esri/core/workers/chunks/{6b66fc32451433129a88.js → 8508f238d99021e87f71.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{bc75ab48f4c7609ef09d.js → 85d3475667c503ec4fc6.js} +1 -1
  69. package/assets/esri/core/workers/chunks/8f6f5dad52747d252aac.js +596 -0
  70. package/assets/esri/core/workers/chunks/{d950d5c2844206502ff0.js → 992cd87ba0ab6346f692.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{73c87eb9bd8f0f848481.js → 9c11e1fe785e1385fdb1.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{5ed8d8b5336c81fbcda3.js → 9d216e30d04ea21fc8a2.js} +1 -1
  73. package/assets/esri/core/workers/chunks/a54aa93b6012a2597f82.js +1 -0
  74. package/assets/esri/core/workers/chunks/{cf14b3a44705dacefac4.js → a9b5ce00323cd5574bf7.js} +1 -1
  75. package/assets/esri/core/workers/chunks/ae6b3dfe5f757df539d6.js +1 -0
  76. package/assets/esri/core/workers/chunks/b14c4c3f295970f731ab.js +1 -0
  77. package/assets/esri/core/workers/chunks/{c70df6ed190f9ebcf6aa.js → bf2c202dec5ab7bc770b.js} +1 -1
  78. package/assets/esri/core/workers/chunks/c1d4110aa494a1dba3c4.js +1 -0
  79. package/assets/esri/core/workers/chunks/{9d6491f996eeb0c646ed.js → c442916805975744dd92.js} +1 -1
  80. package/assets/esri/core/workers/chunks/dacc2e5fa462495ed1cc.js +2 -0
  81. package/assets/esri/core/workers/chunks/f227b34cce6843df0fb6.js +1 -0
  82. package/assets/esri/core/workers/chunks/{dda2cb5c073d1e65f14f.js → f43d628d47eec7d530c7.js} +1 -1
  83. package/assets/esri/core/workers/chunks/f7531aa69a87814c60d1.js +1 -0
  84. package/assets/esri/core/workers/chunks/{bf8f603848bad4a7deb4.js → fb100935fd8948d779f5.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{88b480a1d1fb01778798.js → fb9e3e7cd532ac4353f1.js} +25 -30
  86. package/assets/esri/core/workers/chunks/fc6ca7ffb9f1b875059c.js +1 -0
  87. package/assets/esri/core/workers/chunks/{14eb2cc8e2ad6d8d03fd.js → ffc4f3406ce383b9bd88.js} +1 -1
  88. package/assets/esri/themes/base/_core.scss +2 -0
  89. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +6 -0
  90. package/assets/esri/themes/base/widgets/_PluginSettingsControls.scss +29 -0
  91. package/assets/esri/themes/dark/main.css +1 -1
  92. package/assets/esri/themes/light/main.css +1 -1
  93. package/assets/esri/themes/light/view.css +1 -1
  94. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  95. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  96. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  97. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  98. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  99. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  100. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  101. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  102. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  103. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  104. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  105. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  106. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  107. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  108. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  109. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  110. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  111. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  112. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  113. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  114. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  115. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  116. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  117. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  118. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  119. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  120. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  121. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  122. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  123. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  124. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  125. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  126. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  127. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  128. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  129. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  130. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  131. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  132. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  133. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  134. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  135. package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
  136. package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
  137. package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
  138. package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
  139. package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
  140. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  141. package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
  142. package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
  143. package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
  144. package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
  145. package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
  146. package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
  147. package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
  148. package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
  149. package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
  150. package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
  151. package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
  152. package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
  153. package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
  154. package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
  155. package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
  156. package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
  157. package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
  158. package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
  159. package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
  160. package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
  161. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
  162. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
  163. package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
  164. package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
  165. package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
  166. package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
  167. package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
  168. package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
  169. package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
  170. package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
  171. package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
  172. package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
  173. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
  174. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
  175. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
  176. package/chunks/ImageMaterial.glsl.js +7 -5
  177. package/chunks/SlicePlaneMaterial.glsl.js +21 -13
  178. package/chunks/arcade.js +1 -1
  179. package/chunks/languageUtils.js +1 -1
  180. package/config.js +1 -1
  181. package/core/MapUtils.js +1 -1
  182. package/core/arrayUtils.js +1 -1
  183. package/core/types.d.ts +28 -0
  184. package/form/elements/inputs/MultipleChoiceInput.d.ts +2 -2
  185. package/form/elements/inputs/MultipleChoiceInput.js +1 -1
  186. package/geometry/operators/types.d.ts +2 -2
  187. package/interfaces.d.ts +4 -7
  188. package/kernel.js +1 -1
  189. package/layers/ImageryLayer.d.ts +7 -1
  190. package/layers/ImageryLayer.js +1 -1
  191. package/layers/ImageryTileLayer.d.ts +7 -1
  192. package/layers/ImageryTileLayer.js +1 -1
  193. package/layers/IntegratedMeshLayer.d.ts +18 -14
  194. package/layers/SceneLayer.d.ts +35 -1
  195. package/layers/SceneLayer.js +1 -1
  196. package/layers/WCSLayer.d.ts +7 -1
  197. package/layers/WCSLayer.js +1 -1
  198. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  199. package/layers/save/imageryUtils.js +1 -1
  200. package/layers/scene/ModelFileInfo.d.ts +29 -0
  201. package/layers/scene/ModelFileInfo.js +2 -0
  202. package/layers/scene/ModelInfo.d.ts +38 -0
  203. package/layers/scene/ModelInfo.js +2 -0
  204. package/layers/scene/modelQuerySupport.js +2 -0
  205. package/layers/scene/types.d.ts +14 -0
  206. package/layers/support/infoFor3D.js +1 -1
  207. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  208. package/layers/types.d.ts +13 -1
  209. package/layers/video/VideoController.js +1 -1
  210. package/networks/UnitIdentifierManager.d.ts +15 -15
  211. package/networks/UnitIdentifierManager.js +1 -1
  212. package/networks/support/jsonTypes.d.ts +125 -13
  213. package/package.json +4 -4
  214. package/popup/Features.d.ts +1 -7
  215. package/popup/Features.js +1 -1
  216. package/popup/actions.js +1 -1
  217. package/renderers/visualVariables/support/ColorStop.js +1 -1
  218. package/rest/networks/unitIdentifiers/reserve.js +2 -0
  219. package/rest/networks/unitIdentifiers/support/ReserveParameters.js +2 -0
  220. package/rest/networks/unitIdentifiers/support/ResizeParameters.js +1 -1
  221. package/rest/networks/unitIdentifiers/support/UnitQueryResult.js +1 -1
  222. package/support/arcadeUtils.js +1 -1
  223. package/support/revision.js +1 -1
  224. package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +1 -1
  225. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +5 -1
  226. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  227. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  228. package/views/2d/engine/flow/styles/Particles.js +1 -1
  229. package/views/2d/engine/flow/styles/Streamlines.js +1 -1
  230. package/views/2d/engine/vectorTiles/Placement.js +1 -1
  231. package/views/2d/engine/vectorTiles/TextShaping.js +1 -1
  232. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  233. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  234. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  235. package/views/2d/engine/webgl/GlyphSource.js +1 -1
  236. package/views/2d/engine/webgl/Overlay.js +1 -1
  237. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  238. package/views/2d/engine/webgl/RenderingDevice.js +1 -1
  239. package/views/2d/engine/webgl/TextureManager.js +1 -1
  240. package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
  241. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  242. package/views/2d/engine/webgl/shaderGraph/GLSLShaderModule.js +1 -1
  243. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  244. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  245. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueProgramCache.js +1 -1
  246. package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
  247. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  248. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  249. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  250. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimationUniformInfo.js +1 -1
  251. package/views/2d/engine/webgl/shaderGraph/techniques/bitmap/BitmapTechnique.js +1 -1
  252. package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
  253. package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +1 -1
  254. package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +1 -1
  255. package/views/2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js +1 -1
  256. package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +1 -1
  257. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPointShader.js +1 -1
  258. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
  259. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  260. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  261. package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
  262. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  263. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  264. package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
  265. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  266. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
  267. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  268. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  269. package/views/2d/engine/webgl/shaderGraph/techniques/flow/FlowTechnique.js +1 -1
  270. package/views/2d/engine/webgl/shaderGraph/techniques/grid/GridTechnique.js +1 -1
  271. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  272. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  273. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  274. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
  275. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  276. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  277. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  278. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  279. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
  280. package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
  281. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
  282. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  283. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  284. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  285. package/views/2d/engine/webgl/shaderGraph/techniques/raster/VectorFieldTechnique.js +1 -1
  286. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/AspectTechnique.js +1 -1
  287. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BandArithmeticTechnique.js +1 -1
  288. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BaseRasterProcessorTechnique.js +1 -1
  289. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ColormapToRGBTechnique.js +1 -1
  290. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CompositeBandTechnique.js +1 -1
  291. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ComputeChangeTechnique.js +1 -1
  292. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ContrastBrightnessTechnique.js +1 -1
  293. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ConvolutionTechnique.js +1 -1
  294. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CurvatureTechnique.js +1 -1
  295. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ExtractBandTechnique.js +1 -1
  296. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/FocalStatisticsTechnique.js +1 -1
  297. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/GrayscaleTechnique.js +1 -1
  298. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/HillshadeTechnique.js +1 -1
  299. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/LocalTechnique.js +1 -1
  300. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/MaskTechnique.js +1 -1
  301. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/NDVITechnique.js +1 -1
  302. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/RemapTechnique.js +1 -1
  303. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
  304. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ShadedReliefTechnique.js +1 -1
  305. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SlopeTechnique.js +1 -1
  306. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SpectralConversionTechnique.js +1 -1
  307. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/StretchTechnique.js +1 -1
  308. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  309. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitmapShader.js +1 -1
  310. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js +1 -1
  311. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlitShader.js +1 -1
  312. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +1 -1
  313. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlurShader.js +1 -1
  314. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js +1 -1
  315. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
  316. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
  317. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js +1 -1
  318. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/EntityStorage.js +1 -1
  319. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientFillShader.js +1 -1
  320. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
  321. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
  322. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapResolveShader.js +1 -1
  323. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  324. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js +1 -1
  325. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/MosaicInfo.js +1 -1
  326. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js +1 -1
  327. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OverlayShader.js +1 -1
  328. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader.js +1 -1
  329. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternOutlineFillShader.js +1 -1
  330. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ShaderHittest.js +1 -1
  331. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsDiffShader.js +1 -1
  332. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsMinMaxSumShader.js +1 -1
  333. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsStdDevShader.js +1 -1
  334. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsSumOfSquaredDiffShader.js +1 -1
  335. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
  336. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js +1 -1
  337. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js +1 -1
  338. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowImageryShader.js +1 -1
  339. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowUtils.js +1 -1
  340. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  341. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
  342. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterHighlightShader.js +1 -1
  343. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerLUTShader.js +1 -1
  344. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerShadedReliefShader.js +1 -1
  345. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerStretchShader.js +1 -1
  346. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterXYBandHighlightShader.js +1 -1
  347. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/lut.js +1 -1
  348. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
  349. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/BaseRasterProcessorShader.js +1 -1
  350. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ColormapToRGBShader.js +1 -1
  351. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ConvolutionShader.js +1 -1
  352. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
  353. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/FocalStatisticsShader.js +1 -1
  354. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/HillshadeShader.js +1 -1
  355. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MultiRasterMixin.js +1 -1
  356. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ShadedReliefShader.js +1 -1
  357. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
  358. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/projection.js +1 -1
  359. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/stretch.js +1 -1
  360. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderBackground.js +1 -1
  361. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderFill.js +1 -1
  362. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderIcon.js +1 -1
  363. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderLine.js +1 -1
  364. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderText.js +1 -1
  365. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vvUtils.js +1 -1
  366. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  367. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  368. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +1 -1
  369. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileStencilTechnique.js +1 -1
  370. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
  371. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
  372. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
  373. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
  374. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
  375. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  376. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  377. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  378. package/views/2d/layers/BaseLayerView2D.d.ts +3 -3
  379. package/views/2d/layers/BaseLayerViewGL2D.d.ts +3 -3
  380. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  381. package/views/2d/layers/TileLayerView2D.js +1 -1
  382. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  383. package/views/2d/layers/features/FeatureContainer.js +1 -1
  384. package/views/2d/support/clippingUtils.js +1 -1
  385. package/views/2d/support/hitTestUtils.js +1 -1
  386. package/views/3d/FocusAreasView.js +1 -1
  387. package/views/3d/StencilGeometry.js +2 -0
  388. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  389. package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +5 -1
  390. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  391. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  392. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  393. package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
  394. package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
  395. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  396. package/views/3d/analysis/Viewshed/ViewshedShapeVisualElement.js +1 -1
  397. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  398. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  399. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  400. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  401. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  402. package/views/3d/focusAreaUtils.js +2 -0
  403. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  404. package/views/3d/layers/I3SMeshView3D.js +1 -1
  405. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  406. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  407. package/views/3d/layers/IntegratedMeshNormals.js +1 -1
  408. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  409. package/views/3d/layers/SceneLayerView3D.js +1 -1
  410. package/views/3d/layers/SceneLayerWorker.js +1 -1
  411. package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
  412. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  413. package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
  414. package/views/3d/layers/support/TemporalSceneLayerView.js +1 -1
  415. package/views/3d/terrain/ElevationData.js +1 -1
  416. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  417. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  418. package/views/3d/webgl-engine/collections/Component/Renderable.js +1 -1
  419. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +1 -5
  420. package/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js +1 -5
  421. package/views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js +16 -21
  422. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  423. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
  424. package/views/3d/webgl-engine/effects/atmosphere/LocalAtmosphere.js +1 -1
  425. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  426. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  427. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  428. package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
  429. package/views/3d/webgl-engine/effects/clouds/CloudsTechnique.js +1 -1
  430. package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
  431. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  432. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  433. package/views/3d/webgl-engine/effects/focusArea/focusAreaMaskUtils.js +2 -0
  434. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  435. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  436. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  437. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  438. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  439. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  440. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +1 -1
  441. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  442. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
  443. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  444. package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
  445. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  446. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  447. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  448. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  449. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  450. package/views/3d/webgl-engine/lib/Compositor.js +1 -1
  451. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
  452. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
  453. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  454. package/views/3d/webgl-engine/lib/Material.js +1 -1
  455. package/views/3d/webgl-engine/lib/Normals.js +1 -1
  456. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  457. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  458. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  459. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  460. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  461. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  462. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  463. package/views/3d/webgl-engine/shaders/BlackLevelLightSoftCompression.glsl.js +5 -1
  464. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  465. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  466. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  467. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  468. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  469. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  470. package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
  471. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +10 -10
  472. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  473. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  474. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  475. package/views/VideoView.js +1 -1
  476. package/views/View2D.js +1 -1
  477. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  478. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  479. package/views/analysis/ElevationProfile/ElevationProfileIndicatorPointVisualization.js +1 -1
  480. package/views/analysis/ElevationProfile/ElevationProfileResult.d.ts +6 -4
  481. package/views/draw/DrawTool.js +1 -1
  482. package/views/draw/plugins/BezierSegmentPlugin.js +1 -1
  483. package/views/draw/plugins/FreehandSegmentPlugin.js +1 -1
  484. package/views/draw/support/GraphicMover.js +1 -1
  485. package/views/draw/support/PluginContext.js +1 -1
  486. package/views/draw/support/Reshape.js +1 -1
  487. package/views/draw/support/editingSessionUtils.js +1 -1
  488. package/views/draw/support/types.d.ts +21 -0
  489. package/views/draw/support/types.js +1 -1
  490. package/views/types.d.ts +2 -2
  491. package/views/webgl/FramebufferObject.js +1 -1
  492. package/widgets/BatchAttributeForm/css.js +1 -1
  493. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  494. package/widgets/BatchAttributeForm/inputs/GroupInput.d.ts +2 -1
  495. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.d.ts +54 -0
  496. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +2 -0
  497. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  498. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  499. package/widgets/BatchAttributeForm/inputs/types.d.ts +4 -3
  500. package/widgets/BatchAttributeForm/templates/AttachmentElementTemplate.js +1 -1
  501. package/widgets/BatchAttributeForm/templates/RelationshipElementTemplate.js +2 -0
  502. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  503. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  504. package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
  505. package/widgets/BatchAttributeForm.js +1 -1
  506. package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +21 -1
  507. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  508. package/widgets/CoordinateConversion/support/Format.js +1 -1
  509. package/widgets/CoordinateConversion/support/coordinateConversionUtils.js +1 -1
  510. package/widgets/CoordinateConversion.d.ts +21 -1
  511. package/widgets/CoordinateConversion.js +1 -1
  512. package/widgets/Daylight/DaylightViewModel.js +1 -1
  513. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  514. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  515. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  516. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  517. package/widgets/Editor/components/Settings.js +1 -1
  518. package/widgets/Editor/support/SketchController.js +1 -1
  519. package/widgets/Editor/workflowUtils.js +1 -1
  520. package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
  521. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  522. package/widgets/ElevationProfile/support/ElevationProfileView.js +1 -1
  523. package/widgets/ElevationProfile/support/ElevationProfileView2D.js +1 -1
  524. package/widgets/ElevationProfile/support/ElevationProfileView3D.js +1 -1
  525. package/widgets/ElevationProfile/support/InputRepresentation2D.js +1 -1
  526. package/widgets/ElevationProfile/support/InputRepresentation3D.js +1 -1
  527. package/widgets/ElevationProfile/support/ProfileLine2D.js +1 -1
  528. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  529. package/widgets/FeatureForm/FieldInput.js +1 -1
  530. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  531. package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
  532. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  533. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.d.ts +5 -5
  534. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
  535. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  536. package/widgets/OrientedImageryViewer/constants.js +1 -1
  537. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  538. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +2 -0
  539. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +2 -0
  540. package/widgets/OrientedImageryViewer/types.d.ts +10 -0
  541. package/widgets/OrientedImageryViewer.d.ts +17 -2
  542. package/widgets/OrientedImageryViewer.js +1 -1
  543. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  544. package/widgets/Sketch/SketchViewModel.js +1 -1
  545. package/widgets/Sketch/support/PluginManager.js +1 -1
  546. package/widgets/Sketch/support/SettingsManager.js +2 -0
  547. package/widgets/Sketch.js +1 -1
  548. package/widgets/Slider/SliderViewModel.d.ts +2 -1
  549. package/widgets/Slider/SliderViewModel.js +1 -1
  550. package/widgets/Slider.js +1 -1
  551. package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.js +1 -1
  552. package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.js +1 -1
  553. package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.js +1 -1
  554. package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
  555. package/widgets/support/ContingentValuesManager.js +1 -1
  556. package/widgets/support/PluginSettingsControls.js +2 -0
  557. package/widgets/support/SnappingControls.js +1 -1
  558. package/widgets/support/forms/formUtils.js +1 -1
  559. package/widgets/types.d.ts +1 -1
  560. package/analysis/ElevationProfile/elevationProfileLineTypes.js +0 -2
  561. package/assets/esri/core/workers/chunks/003476e950bd27a2f884.js +0 -596
  562. package/assets/esri/core/workers/chunks/07aca5ecad659d55e795.js +0 -2
  563. package/assets/esri/core/workers/chunks/07eff82916681fcff069.js +0 -1
  564. package/assets/esri/core/workers/chunks/0b1454a77a6a682541dc.js +0 -2
  565. package/assets/esri/core/workers/chunks/3697e51e1e4cf442f39a.js +0 -1
  566. package/assets/esri/core/workers/chunks/3cce9dad8ee0e4971d50.js +0 -1
  567. package/assets/esri/core/workers/chunks/68a313155ddc29bd024d.js +0 -1
  568. package/assets/esri/core/workers/chunks/751609831b283903ba48.js +0 -1
  569. package/assets/esri/core/workers/chunks/7540f7df86620f067b5a.js +0 -1
  570. package/assets/esri/core/workers/chunks/76e34f81bb4a7b0e694c.js +0 -1
  571. package/assets/esri/core/workers/chunks/7bacdd65a6cc4d284e0a.js +0 -2
  572. package/assets/esri/core/workers/chunks/7e97684e851274efd11f.js +0 -1
  573. package/assets/esri/core/workers/chunks/85aac8539996372f1ee8.js +0 -1
  574. package/assets/esri/core/workers/chunks/99c161fecae710b53b40.js +0 -1
  575. package/assets/esri/core/workers/chunks/99d298d0039c536fcf3e.js +0 -1
  576. package/assets/esri/core/workers/chunks/9aaf78b831f8739bc127.js +0 -1
  577. package/assets/esri/core/workers/chunks/bfe575da727ce7c8d331.js +0 -2
  578. package/assets/esri/core/workers/chunks/cb45e5d4a4ef82cda583.js +0 -1
  579. package/assets/esri/core/workers/chunks/e262c4864dc06c43b380.js +0 -1
  580. package/assets/esri/core/workers/chunks/ea59b81299acaf0d85ee.js +0 -1
  581. package/assets/esri/core/workers/chunks/ef0eae13408cbf83a64f.js +0 -1
  582. package/assets/esri/core/workers/chunks/f09a41ad239d467d9438.js +0 -2
  583. package/assets/esri/core/workers/chunks/f6912532aae1638cbe8f.js +0 -1
  584. package/rest/networks/unitIdentifiers/insertGap.js +0 -2
  585. package/rest/networks/unitIdentifiers/support/InsertGapParameters.js +0 -2
  586. /package/assets/esri/core/workers/chunks/{7bacdd65a6cc4d284e0a.js.LICENSE.txt → 10408183681fd6c7b4ed.js.LICENSE.txt} +0 -0
  587. /package/assets/esri/core/workers/chunks/{f09a41ad239d467d9438.js.LICENSE.txt → 5818f1f526577068d6ca.js.LICENSE.txt} +0 -0
  588. /package/assets/esri/core/workers/chunks/{bfe575da727ce7c8d331.js.LICENSE.txt → 7cdd0492b2191df95102.js.LICENSE.txt} +0 -0
  589. /package/assets/esri/core/workers/chunks/{07aca5ecad659d55e795.js.LICENSE.txt → dacc2e5fa462495ed1cc.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{estimateNumberArrayMemory as i}from"../../../core/memoryEstimations.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{initial as o,watch as a,sync as n}from"../../../core/reactiveUtils.js";import{generateUID as l}from"../../../core/uid.js";import{property as d,subclass as u}from"../../../core/accessorSupport/decorators.js";import{set as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as p,create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as g}from"../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as m}from"../../../geometry/projection/projectVectorToVector.js";import{extentContainsCoords3D as y,extentContainsCoords2D as f}from"../../../geometry/support/contains.js";import{newDoubleArray as _,doubleArrayFrom as b}from"../../../geometry/support/DoubleArray.js";import{getGeometryZScaler as v}from"../../../geometry/support/zscale.js";import{fallbackObjectIDAttribute as I}from"../../../layers/LayerConstants.js";import{estimateSize as x}from"../../../layers/graphics/dehydratedFeatures.js";import{ImmutableDehydratedPoint as E}from"../../../layers/graphics/dehydratedPoint.js";import{hydrateGraphic as w}from"../../../layers/graphics/hydratedFeatures.js";import O from"../../../layers/graphics/controllers/I3SOnDemandController.js";import j from"../../../layers/support/FeatureFilter.js";import N from"../../../rest/support/Query.js";import{isBasemapLayerView as C}from"../../../support/basemapUtils.js";import{isGraphic as D}from"../../../support/graphicInstanceUtils.js";import{I3SPointsWorkerHandle as F}from"./I3SPointsWorkerHandle.js";import{LayerView3D as S}from"./LayerView3D.js";import{Graphics3DFeatureProcessor as G}from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as A}from"./graphics/QueryEngine.js";import{QueryEngineContext as V}from"./graphics/QueryEngineContext.js";import{createInteractiveEditSession as P,normalizeEditResultsEvent as L,processAttributeEdits as R}from"./i3s/featureEditing.js";import{getCachedAttributeValue as H}from"./i3s/I3SBinaryReader.js";import{I3SGraphicsMap as M}from"./i3s/I3SGraphicsMap.js";import{I3SOverrides as U}from"./i3s/I3SOverrides.js";import{checkRecyclable as Q,checkSpatialReferences as q,containsDraco as T,whenGraphicAttributes as B}from"./i3s/I3SUtil.js";import{attributeLookup as k}from"./support/attributeUtils.js";import{DefinitionExpressionSceneLayerView as z}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as W}from"./support/fieldProperties.js";import{normalizeHighlightTarget as K,emptyHighlightHandle as Z,isObjectId as $}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as Y}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as J}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as X}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as ee}from"./support/TemporalSceneLayerView.js";import{debugFlags as te}from"../support/debugFlags.js";import{compute as re}from"../support/orientedBoundingBox.js";import{updatingProgress as ie}from"../support/updatingProperties.js";import{Vertices as se}from"../webgl-engine/lib/Attribute.js";import oe from"../../layers/SceneLayerView.js";import{hasPopupTemplate as ae}from"../../layers/support/popupUtils.js";import{getHighlightName as ne}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as le,isInEffectiveScaleRange as de}from"../../support/layerViewUtils.js";import{TaskPriority as ue}from"../../support/Scheduler.js";const he=W();class pe{constructor(e,t,r,i){this.graphics=e,this.featureIds=t,this.attributeInfo=r,this.node=i}get usedMemory(){return this.graphics.reduce((e,t)=>x(t)+e,i(this.featureIds)+1024)}}let ce=class extends(ee(z(J(S(oe))))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this._pendingEditsQueue=Promise.resolve(),this.loadedGraphics=new M((e,t,r)=>fe(e,t,r),e=>this.processor.graphicsCore.recreateGraphics(e),this.logError),this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}tryRecycleWith(e,t){return e.url===this.layer.url&&this._i3sOverrides.isEmpty?e.load(t).then(()=>{s(t),Q(this.layer,e,this._i3sOverrides),this.layer=e,this._i3sOverrides.destroy();const i=this.view.resourceController?.memoryController;this._i3sOverrides=new U({view:this.view,layer:e,memoryController:i}),r(this._queryEngine),this._setupQueryEngine(),this.processor.resetObjectStates()}):null}initialize(){this.addResolvingPromise(this.layer.indexInfo);const e=this.view.resourceController?.memoryController;this._i3sOverrides=new U({view:this.view,layer:this.layer,memoryController:e}),q(this.layer,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new X({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,e=>this._rangeInfosChanged(e),o),this._updatingHandles.add(()=>this.layer.renderer,(e,t)=>this._rendererChange(e,t)),this._updatingHandles.add(()=>[this.parsedDefinitionExpression,this.layer.excludeObjectIds],()=>this._filterChange()),this._set("processor",new G({owner:this,preferredUpdatePolicy:0,scaleVisibilityEnabled:!le(),filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on("invalidate-elevation",({extent:e,spatialReference:t})=>this._controller.updateElevationChanged(e,t)),this.supportsHeightUnitConversion&&(this._verticalScale=v("point",this.layer.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.when()),this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`),this._controller=new O({layerView:this}),T(this.layer.geometryDefinitions)&&(this._workerHandle=new F(e=>this.view.resourceController.immediate.schedule(e))),this.addHandles(this.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))),this.addHandles([this.layer.on("edits",e=>{const t=this._pendingEditsQueue.then(()=>this._handleEdits(e)).then();this._pendingEditsQueue=t,this._updatingHandles.consumePromise(t)}),a(()=>te.I3S_TREE_SHOW_TILES,e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then(({I3STreeDebugger:t})=>{!this._treeDebugger&&te.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))})}else e||!this._treeDebugger||te.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)},o)]),this.when(()=>{this._setupQueryEngine(),this._updatingHandles.add(()=>this.availableFields,()=>this._queryEngine?.clear(),n),this._updatingHandles.add(()=>this.maximumNumberOfFeatures,e=>this._controller.featureTarget=e,o),this._updatingHandles.add(()=>this.suspended,e=>{e&&this._removeAllNodeData()})})}destroy(){this._treeDebugger=r(this._treeDebugger),this._i3sOverrides=r(this._i3sOverrides),this._set("processor",r(this.processor)),this._controller=r(this._controller),this._queryEngine=r(this._queryEngine),this._workerHandle=r(this._workerHandle),this._memCache=r(this._memCache),this.loadedGraphics.clear(),this._fieldsHelper=r(this._fieldsHelper)}get i3slayer(){return this.layer}get layerViewUid(){return this.uid}get updatingProgressValue(){return this._controller?.updatingProgress??1}get visibleAtCurrentScale(){return le()?de(this.layer.effectiveScaleRange,this.view.scale):!this.processor?.scaleVisibilitySuspended}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){const e=this.processor?.graphicsCore?.displayFeatureLimit;return e?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached)}get _excludeObjectIds(){return new Set(this.layer.excludeObjectIds)}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.pointLoDFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){return!this.suspended&&!!this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}get _graphicOrigin(){return this.layer.graphicOrigin}async whenGraphicAttributes(e,t){return B(this.layer,e,this._getObjectIdField(),t,()=>[...this.loadedGraphics.nodes()])}getHit(e){if(!this.loadedGraphics)return null;const t=w(this.loadedGraphics.find(t=>t.uid===e),this.layer,this._graphicOrigin),r=this._getObjectIdField();return null==t?.attributes?.[r]?null:{type:"graphic",graphic:t,layer:t.layer}}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e,t){const r=ne(t),i=this.layer.objectIdField,s=K(e);if(0===s.length)return Z;if(D(s[0])){const e=s;if(null!=k(this.layer.fieldsIndex,e[0].attributes,i)){const t=e.map(e=>k(this.layer.fieldsIndex,e.attributes,i));return this.processor.highlightByObjectIds(t,i,r)}return this.processor.highlightByGraphics(e,r)}return $(s[0])?this.processor.highlightByObjectIds(s,i,r):Z}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return P(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};null==this._workerHandle&&(this._workerHandle=new F(e=>this.view.resourceController.immediate.schedule(e)));const i=await this._workerHandle.invoke(r,t);if(null==i)throw new Error("Failed to decompress Draco point data");return{positionData:i.positions,featureIds:i.featureIds}}async addNode(e,r,i){if(!ye(r)&&!me(r))throw new Error;if(this.loadedGraphics.hasNode(e.index))return void t.getLogger(this).error("I3S node "+e.id+" already added");const s=null!=this.layer.fullExtent?be(this.layer.fullExtent.clone(),.5):null,{featureIds:o,pointPositions:a}=ye(r)?await this._extractBinaryPointPositions(e,r,i):this._extractLegacyPointPositions(r),n=new Array;this._validatePositions(e,o,a,s,n);const l=this._controller.crsVertex,d=this.view.spatialReference;g(a,l,0,a,d,0,o.length);const u=ye(r)?e.level:0,h=this._createGraphics(o,a,e.index,u),p=new pe(h,o,r.attributeDataInfo,e);if(await this._i3sOverrides.applyAttributeOverrides(p.featureIds,r.attributeDataInfo,i),e.numFeatures=p.graphics.length,this._updateNodeMemory(e),_e(p),n.length>0&&(this._computeObb(e,n,l),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(p);if(null!=this._verticalScale)for(const t of p.graphics)this._verticalScale(t.geometry);const c=this.view.stage.renderView.olidRenderHelper;if(c){const e=C(this.view,this.uid);for(let t=0;t<p.featureIds.length;t++){const r=p.featureIds[t];c.setUidToObjectAndLayerId(r,p.graphics[t].uid,this.layer.id,this.uid,this.layer.popupEnabled&&!e&&ae(this.layer,this.view.popup?.defaultPopupTemplateEnabled),p.node.resources.attributes,t)}}this.loadedGraphics.addNode(e.index,p),this._controller.updateLoadStatus(e.index,!0),this._filterNode(p),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,r){const i=this._controller.crsIndex,s=i.isGeographic?this.view.renderSpatialReference:i;g(t,r,0,t,s,0),e.serviceObbInIndexSR=re(new se(t,3)),i.isGeographic&&(m(e.serviceObbInIndexSR.center,s,Ie,i),e.serviceObbInIndexSR.center=Ie)}isNodeLoaded(e){return this.loadedGraphics.hasNode(e)}isNodeReloading(){return!1}updateNodeState(){}getNodeComponentHandle(){}async _extractBinaryPointPositions(e,t,r){const i=await this._decompressBinaryPointData(t,r),s=i.positionData,o=3,a=s.length/o,n=_(3*a),l=null!=e.serviceObbInIndexSR?e.serviceObbInIndexSR.center:p,d=Math.abs(l[2])*2**-20;for(let u=0;u<a;u++){const e=u*o;n[e]=s[e]+l[0],n[e+1]=s[e+1]+l[1],n[e+2]=s[e+2]+l[2],Math.abs(n[e+2])<d&&(n[e+2]=0)}return{featureIds:i.featureIds?b(i.featureIds):[],pointPositions:n}}_extractLegacyPointPositions(e){const t=e.pointData.length,r=_(3*t),i=new Array;for(let s=0;s<t;s++){const t=e.pointData[s],o=t.featureDataPosition,a=o.length,n=t.geometries?.[0]??ve[a],l=t.featureIds[0];if("Embedded"!==n.type||"points"!==n.params.type||a<2||a>3)continue;const d=n.params.vertexAttributes?.position??[0,0,0],u=3*i.length;r[u]=o[0]+d[0],r[u+1]=o[1]+d[1],r[u+2]=3===a?o[2]+d[2]:NaN,i.push(l)}return{featureIds:i,pointPositions:r}}_validatePositions(e,r,i,s,o){if(null==s&&e.serviceObbInIndexSR)return;const a=r.length,n=3;for(let l=0;l<a;l++){const r=l*n;h(Ie,i[r],i[r+1],i[r+2]);const a=!Number.isNaN(i[2]);null==s||(a?y(s,Ie):f(s,Ie))||(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++),e.serviceObbInIndexSR||o.push(Ie[0],Ie[1],Ie[2])}}_createGraphics(e,t,r,i){const s=e.length,o=3,a=this._getObjectIdField(),n=this.processor.graphicsCore,d=new Array,u=this.view.spatialReference;for(let h=0;h<s;h++){const s=e[h],p={};null!=s&&(p[a]=s);const c=s??l(),g=h*o,m=isNaN(t[g+2])?void 0:t[g+2],y=new E(u,t[g],t[g+1],m),f=this.loadedGraphics.get(c);if(null!=f)(null==f.level||f.level<i)&&(xe.property="geometry",xe.graphic=f,xe.oldValue=f.geometry,xe.newValue=y,f.geometry=y,f.level=i,n.graphicUpdateHandler(xe),Ee()),d.push(f);else{const e=l();d.push({objectId:c,uid:e,geometry:y,attributes:p,visible:!0,nodeIndex:r,level:i})}}return d}_updateNodeMemory(e){e.memory=4096+(e.numFeatures??0)*this.processor.graphicsCore.usedMemoryPerGraphic}_cacheNodeData(e){this._memCache.put(this._getMemCacheKey(e.node),e)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode((e,t)=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)}),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this.loadedGraphics.getNode(e);return null==t?null:(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeNode(e),this._treeDebugger&&this._treeDebugger.update(),t)}async loadCachedNodeData(e){return this._memCache?.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,r,i,s){this.loadedGraphics.hasNode(e.index)?t.getLogger(this).error("I3S node "+e.id+" already added"):(await this._i3sOverrides.applyAttributeOverrides(r.featureIds,i,s),r.attributeInfo=i,this.loadedGraphics.addNode(e.index,r),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),_e(r),this._filterNode(r),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this.loadedGraphics.forEachNode(t=>e.push(t.node.id)),e.sort()}getVisibleNodes(){const e=new Array;return this.loadedGraphics.forEachNode(t=>e.push(t.node)),e}getLoadedNodeIndices(e){this.loadedGraphics.forEachNode((t,r)=>e.push(r))}getLoadedAttributes(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this.loadedGraphics.getNode(e);null!=r?.attributeInfo&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const i=this.loadedGraphics.getNode(e);null!=i&&(await this._i3sOverrides.applyAttributeOverrides(i.featureIds,t,r),i.attributeInfo=t,this._attributeValuesChanged(i))}_attributeValuesChanged(e){_e(e),this._filterNode(e);const{processor:t}=this,{graphicsCore:r}=t;if(r.labelsEnabled){const t=e.node.index,i=new Array;e.graphics.forEach(e=>e.nodeIndex===t&&i.push(e.uid)),r.updateLabelingInfo(i)}t.refreshFilter()}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||I}_getGlobalIdField(){return this.layer.globalIdField}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,i=new Set;let s,o;e?(await e.collectRequiredFields(i,r),s=Array.from(i).sort()):s=[],i.clear(),t?(await t.collectRequiredFields(i,r),o=Array.from(i).sort()):o=[],s.length===o.length&&s.every((e,t)=>s[t]===o[t])||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&t.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this.loadedGraphics.forEachNode(e=>this._filterNode(e))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression,r=this._excludeObjectIds,i=this._getObjectIdField();for(const s of e.graphics){const e=s.visible,o=this._evaluateClause(t,s),a=!r.has(s.attributes[i]);s.visible=o&&a,e!==s.visible&&(xe.graphic=s,xe.property="visible",xe.oldValue=e,xe.newValue=s.visible,this.processor.graphicsCore.graphicUpdateHandler(xe),Ee())}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return this.filter?.createQuery(e)??new N(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():N.from(e))}_setupQueryEngine(){const{layer:e,view:t,hasM:r,hasZ:i}=this,{spatialReference:s,resourceController:o}=t,a=new V(s,e,o,()=>this.processor.featureStore,i,r,()=>this.availableFields);this._queryEngine=new A({context:a,priority:ue.FEATURE_QUERY_ENGINE})}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}async _handleEdits(e){const t=this._attributeEditingContext,r=await L(t,e);R(t,r)}get _attributeEditingContext(){const e=this._getObjectIdField(),t=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,globalIdField:t,forEachNode:e=>this.loadedGraphics.forEachNode(t=>e(t.node,t.featureIds)),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,i)=>{this._setAttributeData(t,r);const s=this.loadedGraphics.getNode(t);if(null!=i){const t=this.loadedGraphics.get(i.attributes[e]);null!=t&&this.processor.graphicsCore.recreateGraphics([t])}else null!=s&&this.processor.graphicsCore.recreateGraphics(s.graphics)},clearMemCache:()=>{}}}get performanceInfo(){return new Y(this.usedMemory,this.loadedGraphics.length,-1,this.maximumNumberOfFeatures,this.loadedGraphics.nodeCount,this.processor.graphicsCore.performanceInfo)}get test(){}};e([d()],ce.prototype,"processor",void 0),e([d({type:j})],ce.prototype,"filter",void 0),e([d()],ce.prototype,"loadedGraphics",void 0),e([d()],ce.prototype,"i3slayer",null),e([d()],ce.prototype,"layerViewUid",null),e([d()],ce.prototype,"_controller",void 0),e([d()],ce.prototype,"updating",void 0),e([d()],ce.prototype,"suspended",void 0),e([d(ie)],ce.prototype,"updatingProgress",void 0),e([d()],ce.prototype,"updatingProgressValue",null),e([d({readOnly:!0})],ce.prototype,"visibleAtCurrentScale",null),e([d(he.requiredFields)],ce.prototype,"requiredFields",null),e([d(he.availableFields)],ce.prototype,"availableFields",void 0),e([d()],ce.prototype,"_fieldsHelper",void 0),e([d({type:Number})],ce.prototype,"maximumNumberOfFeatures",null),e([d({readOnly:!0})],ce.prototype,"maximumNumberOfFeaturesExceeded",null),e([d()],ce.prototype,"_excludeObjectIds",null),e([d({readOnly:!0})],ce.prototype,"lodFactor",null),e([d({readOnly:!0})],ce.prototype,"hasM",null),e([d({readOnly:!0})],ce.prototype,"hasZ",null),e([d()],ce.prototype,"contentVisible",null),e([d({readOnly:!0})],ce.prototype,"legendEnabled",null),e([d()],ce.prototype,"_graphicOrigin",null),ce=e([u("esri.views.3d.layers.SceneLayerGraphicsView3D")],ce);const ge=ce;function me(e){return"pointData"in e}function ye(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function fe(e,t,r){const i=t.attributeInfo;if(null==i?.loadedAttributes||null==i.attributeData)return!1;let s=!1;for(const{name:o}of i.loadedAttributes)if(i.attributeData[o]){const t=H(i.attributeData[o],r);t!==e.attributes[o]&&(e.attributes[o]=t,s=!0)}return s}function _e(e){const t=e.attributeInfo;if(null==t?.loadedAttributes||null==t.attributeData)return;const r=e.node.index;for(let i=0;i<e.graphics.length;i++){const s=e.graphics[i];if(s.nodeIndex===r){s.attributes||(s.attributes={});for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(s.attributes[e]=H(t.attributeData[e],i))}}}function be(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,null!=e.zmin&&null!=e.zmax&&(e.zmin-=t,e.zmax+=t),null!=e.mmin&&null!=e.mmax&&(e.mmin-=t,e.mmax+=t),e}const ve={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},Ie=c(),xe={graphic:null,property:null,oldValue:null,newValue:null};function Ee(){xe.graphic=null,xe.property=null,xe.oldValue=null,xe.newValue=null}export{ge as default};
2
+ import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{estimateNumberArrayMemory as i}from"../../../core/memoryEstimations.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{initial as o,watch as a,sync as n}from"../../../core/reactiveUtils.js";import{generateUID as l}from"../../../core/uid.js";import{property as d,subclass as u}from"../../../core/accessorSupport/decorators.js";import{set as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as p,create as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as g}from"../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as m}from"../../../geometry/projection/projectVectorToVector.js";import{extentContainsCoords3D as y,extentContainsCoords2D as f}from"../../../geometry/support/contains.js";import{newDoubleArray as _,doubleArrayFrom as b}from"../../../geometry/support/DoubleArray.js";import{getGeometryZScaler as v}from"../../../geometry/support/zscale.js";import{fallbackObjectIDAttribute as I}from"../../../layers/LayerConstants.js";import{estimateSize as x}from"../../../layers/graphics/dehydratedFeatures.js";import{ImmutableDehydratedPoint as E}from"../../../layers/graphics/dehydratedPoint.js";import{hydrateGraphic as w}from"../../../layers/graphics/hydratedFeatures.js";import O from"../../../layers/graphics/controllers/I3SOnDemandController.js";import j from"../../../layers/support/FeatureFilter.js";import N from"../../../rest/support/Query.js";import{isBasemapLayerView as C}from"../../../support/basemapUtils.js";import{isGraphic as D}from"../../../support/graphicInstanceUtils.js";import{I3SPointsWorkerHandle as F}from"./I3SPointsWorkerHandle.js";import{LayerView3D as S}from"./LayerView3D.js";import{Graphics3DFeatureProcessor as G}from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as A}from"./graphics/QueryEngine.js";import{QueryEngineContext as V}from"./graphics/QueryEngineContext.js";import{createInteractiveEditSession as P,normalizeEditResultsEvent as L,processAttributeEdits as R}from"./i3s/featureEditing.js";import{getCachedAttributeValue as H}from"./i3s/I3SBinaryReader.js";import{I3SGraphicsMap as M}from"./i3s/I3SGraphicsMap.js";import{I3SOverrides as U}from"./i3s/I3SOverrides.js";import{checkRecyclable as Q,checkSpatialReferences as q,containsDraco as T,whenGraphicAttributes as B}from"./i3s/I3SUtil.js";import{attributeLookup as k}from"./support/attributeUtils.js";import{DefinitionExpressionSceneLayerView as z}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as W}from"./support/fieldProperties.js";import{normalizeHighlightTarget as K,emptyHighlightHandle as Z,isObjectId as $}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as Y}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as J}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as X}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as ee}from"./support/TemporalSceneLayerView.js";import{debugFlags as te}from"../support/debugFlags.js";import{compute as re}from"../support/orientedBoundingBox.js";import{updatingProgress as ie}from"../support/updatingProperties.js";import{Vertices as se}from"../webgl-engine/lib/Attribute.js";import oe from"../../layers/SceneLayerView.js";import{hasPopupTemplate as ae}from"../../layers/support/popupUtils.js";import{getHighlightName as ne}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as le,isInEffectiveScaleRange as de}from"../../support/layerViewUtils.js";import{TaskPriority as ue}from"../../support/Scheduler.js";const he=W();class pe{constructor(e,t,r,i){this.graphics=e,this.featureIds=t,this.attributeInfo=r,this.node=i}get usedMemory(){return this.graphics.reduce((e,t)=>x(t)+e,i(this.featureIds)+1024)}}let ce=class extends(ee(z(J(S(oe))))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this._pendingEditsQueue=Promise.resolve(),this.loadedGraphics=new M((e,t,r)=>fe(e,t,r),e=>this.processor.graphicsCore.recreateGraphics(e),this.logError),this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}tryRecycleWith(e,t){return e.url===this.layer.url&&this._i3sOverrides.isEmpty?e.load(t).then(()=>{s(t),Q(this.layer,e,this._i3sOverrides),this.layer=e,this._i3sOverrides.destroy();const i=this.view.resourceController?.memoryController;this._i3sOverrides=new U({view:this.view,layer:e,memoryController:i}),r(this._queryEngine),this._setupQueryEngine(),this.processor.resetObjectStates()}):null}initialize(){this.addResolvingPromise(this.layer.indexInfo);const e=this.view.resourceController?.memoryController;this._i3sOverrides=new U({view:this.view,layer:this.layer,memoryController:e}),q(this.layer,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new X({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,e=>this._rangeInfosChanged(e),o),this._updatingHandles.add(()=>this.layer.renderer,(e,t)=>this._rendererChange(e,t)),this._updatingHandles.add(()=>[this.parsedDefinitionExpression,this.layer.excludeObjectIds],()=>this._filterChange()),this._set("processor",new G({owner:this,preferredUpdatePolicy:0,scaleVisibilityEnabled:!le(),filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on("invalidate-elevation",({extent:e,spatialReference:t})=>this._controller.updateElevationChanged(e,t)),this.supportsHeightUnitConversion&&(this._verticalScale=v("point",this.layer.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.when()),this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`),this._controller=new O({layerView:this}),T(this.layer.geometryDefinitions)&&(this._workerHandle=new F(e=>this.view.resourceController.immediate.schedule(e))),this.addHandles(this.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))),this.addHandles([this.layer.on("edits",e=>{const t=this._pendingEditsQueue.then(()=>this._handleEdits(e)).then();this._pendingEditsQueue=t,this._updatingHandles.consumePromise(t)}),a(()=>te.I3S_TREE_SHOW_TILES,e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then(({I3STreeDebugger:t})=>{!this._treeDebugger&&te.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))})}else e||!this._treeDebugger||te.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)},o)]),this.when(()=>{this._setupQueryEngine(),this._updatingHandles.add(()=>this.availableFields,()=>this._queryEngine?.clear(),n),this._updatingHandles.add(()=>this.maximumNumberOfFeatures,e=>this._controller.featureTarget=e,o),this._updatingHandles.add(()=>this.suspended,e=>{e&&this._removeAllNodeData()})})}destroy(){this._treeDebugger=r(this._treeDebugger),this._i3sOverrides=r(this._i3sOverrides),this._set("processor",r(this.processor)),this._controller=r(this._controller),this._queryEngine=r(this._queryEngine),this._workerHandle=r(this._workerHandle),this._memCache=r(this._memCache),this.loadedGraphics.clear(),this._fieldsHelper=r(this._fieldsHelper)}get layerViewUid(){return this.uid}get updatingProgressValue(){return this._controller?.updatingProgress??1}get visibleAtCurrentScale(){return le()?de(this.layer.effectiveScaleRange,this.view.scale):!this.processor?.scaleVisibilitySuspended}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){const e=this.processor?.graphicsCore?.displayFeatureLimit;return e?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached)}get _excludeObjectIds(){return new Set(this.layer.excludeObjectIds)}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.pointLoDFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){return!this.suspended&&!!this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.layer?.legendEnabled}get _graphicOrigin(){return this.layer.graphicOrigin}async whenGraphicAttributes(e,t){return B(this.layer,e,this._getObjectIdField(),t,()=>[...this.loadedGraphics.nodes()])}getHit(e){if(!this.loadedGraphics)return null;const t=w(this.loadedGraphics.find(t=>t.uid===e),this.layer,this._graphicOrigin),r=this._getObjectIdField();return null==t?.attributes?.[r]?null:{type:"graphic",graphic:t,layer:t.layer}}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e,t){const r=ne(t),i=this.layer.objectIdField,s=K(e);if(0===s.length)return Z;if(D(s[0])){const e=s;if(null!=k(this.layer.fieldsIndex,e[0].attributes,i)){const t=e.map(e=>k(this.layer.fieldsIndex,e.attributes,i));return this.processor.highlightByObjectIds(t,i,r)}return this.processor.highlightByGraphics(e,r)}return $(s[0])?this.processor.highlightByObjectIds(s,i,r):Z}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return P(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};null==this._workerHandle&&(this._workerHandle=new F(e=>this.view.resourceController.immediate.schedule(e)));const i=await this._workerHandle.invoke(r,t);if(null==i)throw new Error("Failed to decompress Draco point data");return{positionData:i.positions,featureIds:i.featureIds}}async addNode(e,r,i){if(!ye(r)&&!me(r))throw new Error;if(this.loadedGraphics.hasNode(e.index))return void t.getLogger(this).error("I3S node "+e.id+" already added");const s=null!=this.layer.fullExtent?be(this.layer.fullExtent.clone(),.5):null,{featureIds:o,pointPositions:a}=ye(r)?await this._extractBinaryPointPositions(e,r,i):this._extractLegacyPointPositions(r),n=new Array;this._validatePositions(e,o,a,s,n);const l=this._controller.crsVertex,d=this.view.spatialReference;g(a,l,0,a,d,0,o.length);const u=ye(r)?e.level:0,h=this._createGraphics(o,a,e.index,u),p=new pe(h,o,r.attributeDataInfo,e);if(await this._i3sOverrides.applyAttributeOverrides(p.featureIds,r.attributeDataInfo,i),e.numFeatures=p.graphics.length,this._updateNodeMemory(e),_e(p),n.length>0&&(this._computeObb(e,n,l),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(p);if(null!=this._verticalScale)for(const t of p.graphics)this._verticalScale(t.geometry);const c=this.view.stage.renderView.olidRenderHelper;if(c){const e=C(this.view,this.uid);for(let t=0;t<p.featureIds.length;t++){const r=p.featureIds[t];c.setUidToObjectAndLayerId(r,p.graphics[t].uid,this.layer.id,this.uid,this.layer.popupEnabled&&!e&&ae(this.layer,this.view.popup?.defaultPopupTemplateEnabled),p.node.resources.attributes,t)}}this.loadedGraphics.addNode(e.index,p),this._controller.updateLoadStatus(e.index,!0),this._filterNode(p),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,r){const i=this._controller.crsIndex,s=i.isGeographic?this.view.renderSpatialReference:i;g(t,r,0,t,s,0),e.serviceObbInIndexSR=re(new se(t,3)),i.isGeographic&&(m(e.serviceObbInIndexSR.center,s,Ie,i),e.serviceObbInIndexSR.center=Ie)}isNodeLoaded(e){return this.loadedGraphics.hasNode(e)}isNodeReloading(){return!1}updateNodeState(){}getNodeComponentHandle(){}async _extractBinaryPointPositions(e,t,r){const i=await this._decompressBinaryPointData(t,r),s=i.positionData,o=3,a=s.length/o,n=_(3*a),l=null!=e.serviceObbInIndexSR?e.serviceObbInIndexSR.center:p,d=Math.abs(l[2])*2**-20;for(let u=0;u<a;u++){const e=u*o;n[e]=s[e]+l[0],n[e+1]=s[e+1]+l[1],n[e+2]=s[e+2]+l[2],Math.abs(n[e+2])<d&&(n[e+2]=0)}return{featureIds:i.featureIds?b(i.featureIds):[],pointPositions:n}}_extractLegacyPointPositions(e){const t=e.pointData.length,r=_(3*t),i=new Array;for(let s=0;s<t;s++){const t=e.pointData[s],o=t.featureDataPosition,a=o.length,n=t.geometries?.[0]??ve[a],l=t.featureIds[0];if("Embedded"!==n.type||"points"!==n.params.type||a<2||a>3)continue;const d=n.params.vertexAttributes?.position??[0,0,0],u=3*i.length;r[u]=o[0]+d[0],r[u+1]=o[1]+d[1],r[u+2]=3===a?o[2]+d[2]:NaN,i.push(l)}return{featureIds:i,pointPositions:r}}_validatePositions(e,r,i,s,o){if(null==s&&e.serviceObbInIndexSR)return;const a=r.length,n=3;for(let l=0;l<a;l++){const r=l*n;h(Ie,i[r],i[r+1],i[r+2]);const a=!Number.isNaN(i[2]);null==s||(a?y(s,Ie):f(s,Ie))||(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++),e.serviceObbInIndexSR||o.push(Ie[0],Ie[1],Ie[2])}}_createGraphics(e,t,r,i){const s=e.length,o=3,a=this._getObjectIdField(),n=this.processor.graphicsCore,d=new Array,u=this.view.spatialReference;for(let h=0;h<s;h++){const s=e[h],p={};null!=s&&(p[a]=s);const c=s??l(),g=h*o,m=isNaN(t[g+2])?void 0:t[g+2],y=new E(u,t[g],t[g+1],m),f=this.loadedGraphics.get(c);if(null!=f)(null==f.level||f.level<i)&&(xe.property="geometry",xe.graphic=f,xe.oldValue=f.geometry,xe.newValue=y,f.geometry=y,f.level=i,n.graphicUpdateHandler(xe),Ee()),d.push(f);else{const e=l();d.push({objectId:c,uid:e,geometry:y,attributes:p,visible:!0,nodeIndex:r,level:i})}}return d}_updateNodeMemory(e){e.memory=4096+(e.numFeatures??0)*this.processor.graphicsCore.usedMemoryPerGraphic}_cacheNodeData(e){this._memCache.put(this._getMemCacheKey(e.node),e)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode((e,t)=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)}),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this.loadedGraphics.getNode(e);return null==t?null:(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeNode(e),this._treeDebugger&&this._treeDebugger.update(),t)}async loadCachedNodeData(e){return this._memCache?.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,r,i,s){this.loadedGraphics.hasNode(e.index)?t.getLogger(this).error("I3S node "+e.id+" already added"):(await this._i3sOverrides.applyAttributeOverrides(r.featureIds,i,s),r.attributeInfo=i,this.loadedGraphics.addNode(e.index,r),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),_e(r),this._filterNode(r),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this.loadedGraphics.forEachNode(t=>e.push(t.node.id)),e.sort()}getVisibleNodes(){const e=new Array;return this.loadedGraphics.forEachNode(t=>e.push(t.node)),e}getLoadedNodeIndices(e){this.loadedGraphics.forEachNode((t,r)=>e.push(r))}getLoadedAttributes(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this.loadedGraphics.getNode(e);null!=r?.attributeInfo&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const i=this.loadedGraphics.getNode(e);null!=i&&(await this._i3sOverrides.applyAttributeOverrides(i.featureIds,t,r),i.attributeInfo=t,this._attributeValuesChanged(i))}_attributeValuesChanged(e){_e(e),this._filterNode(e);const{processor:t}=this,{graphicsCore:r}=t;if(r.labelsEnabled){const t=e.node.index,i=new Array;e.graphics.forEach(e=>e.nodeIndex===t&&i.push(e.uid)),r.updateLabelingInfo(i)}t.refreshFilter()}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||I}_getGlobalIdField(){return this.layer.globalIdField}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,i=new Set;let s,o;e?(await e.collectRequiredFields(i,r),s=Array.from(i).sort()):s=[],i.clear(),t?(await t.collectRequiredFields(i,r),o=Array.from(i).sort()):o=[],s.length===o.length&&s.every((e,t)=>s[t]===o[t])||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&t.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this.loadedGraphics.forEachNode(e=>this._filterNode(e))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression,r=this._excludeObjectIds,i=this._getObjectIdField();for(const s of e.graphics){const e=s.visible,o=this._evaluateClause(t,s),a=!r.has(s.attributes[i]);s.visible=o&&a,e!==s.visible&&(xe.graphic=s,xe.property="visible",xe.oldValue=e,xe.newValue=s.visible,this.processor.graphicsCore.graphicUpdateHandler(xe),Ee())}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return this.filter?.createQuery(e)??new N(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():N.from(e))}_setupQueryEngine(){const{layer:e,view:t,hasM:r,hasZ:i}=this,{spatialReference:s,resourceController:o}=t,a=new V(s,e,o,()=>this.processor.featureStore,i,r,()=>this.availableFields);this._queryEngine=new A({context:a,priority:ue.FEATURE_QUERY_ENGINE})}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}async _handleEdits(e){const t=this._attributeEditingContext,r=await L(t,e);R(t,r)}get _attributeEditingContext(){const e=this._getObjectIdField(),t=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,globalIdField:t,forEachNode:e=>this.loadedGraphics.forEachNode(t=>e(t.node,t.featureIds)),attributeStorageInfo:this.layer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,i)=>{this._setAttributeData(t,r);const s=this.loadedGraphics.getNode(t);if(null!=i){const t=this.loadedGraphics.get(i.attributes[e]);null!=t&&this.processor.graphicsCore.recreateGraphics([t])}else null!=s&&this.processor.graphicsCore.recreateGraphics(s.graphics)},clearMemCache:()=>{}}}get performanceInfo(){return new Y(this.usedMemory,this.loadedGraphics.length,-1,this.maximumNumberOfFeatures,this.loadedGraphics.nodeCount,this.processor.graphicsCore.performanceInfo)}get test(){}};e([d()],ce.prototype,"processor",void 0),e([d({type:j})],ce.prototype,"filter",void 0),e([d()],ce.prototype,"loadedGraphics",void 0),e([d()],ce.prototype,"layerViewUid",null),e([d()],ce.prototype,"_controller",void 0),e([d()],ce.prototype,"updating",void 0),e([d()],ce.prototype,"suspended",void 0),e([d(ie)],ce.prototype,"updatingProgress",void 0),e([d()],ce.prototype,"updatingProgressValue",null),e([d({readOnly:!0})],ce.prototype,"visibleAtCurrentScale",null),e([d(he.requiredFields)],ce.prototype,"requiredFields",null),e([d(he.availableFields)],ce.prototype,"availableFields",void 0),e([d()],ce.prototype,"_fieldsHelper",void 0),e([d({type:Number})],ce.prototype,"maximumNumberOfFeatures",null),e([d({readOnly:!0})],ce.prototype,"maximumNumberOfFeaturesExceeded",null),e([d()],ce.prototype,"_excludeObjectIds",null),e([d({readOnly:!0})],ce.prototype,"lodFactor",null),e([d({readOnly:!0})],ce.prototype,"hasM",null),e([d({readOnly:!0})],ce.prototype,"hasZ",null),e([d()],ce.prototype,"contentVisible",null),e([d({readOnly:!0})],ce.prototype,"legendEnabled",null),e([d()],ce.prototype,"_graphicOrigin",null),ce=e([u("esri.views.3d.layers.SceneLayerGraphicsView3D")],ce);const ge=ce;function me(e){return"pointData"in e}function ye(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function fe(e,t,r){const i=t.attributeInfo;if(null==i?.loadedAttributes||null==i.attributeData)return!1;let s=!1;for(const{name:o}of i.loadedAttributes)if(i.attributeData[o]){const t=H(i.attributeData[o],r);t!==e.attributes[o]&&(e.attributes[o]=t,s=!0)}return s}function _e(e){const t=e.attributeInfo;if(null==t?.loadedAttributes||null==t.attributeData)return;const r=e.node.index;for(let i=0;i<e.graphics.length;i++){const s=e.graphics[i];if(s.nodeIndex===r){s.attributes||(s.attributes={});for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(s.attributes[e]=H(t.attributeData[e],i))}}}function be(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,null!=e.zmin&&null!=e.zmax&&(e.zmin-=t,e.zmax+=t),null!=e.mmin&&null!=e.mmax&&(e.mmin-=t,e.mmax+=t),e}const ve={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},Ie=c(),xe={graphic:null,property:null,oldValue:null,newValue:null};function Ee(){xe.graphic=null,xe.property=null,xe.oldValue=null,xe.newValue=null}export{ge as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import i from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveSet.js";import{initial as n}from"../../../core/reactiveUtils.js";import{property as o,subclass as a}from"../../../core/accessorSupport/decorators.js";import d from"../../../core/sql/WhereClause.js";import u from"../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as h}from"../../../layers/support/floorFilterUtils.js";import p from"../../../rest/support/Query.js";import{isNumber as y}from"../../../support/guards.js";import{I3SMeshView3D as c}from"./I3SMeshView3D.js";import{LayerView3D as g}from"./LayerView3D.js";import{createInteractiveEditSession as f,normalizeEditResultsEvent as m,processGeometryEdits as _,processAttributeEdits as F}from"./i3s/featureEditing.js";import{createGetFeatureExtent as v}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as w}from"./i3s/I3SMeshViewFilter.js";import{I3SOverrides as b}from"./i3s/I3SOverrides.js";import{I3SQueryEngine as j}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as I,I3SQueryFeature as S}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as E}from"./i3s/I3SQueryFeatureStore.js";import{checkRecyclable as O,getIndexCrs as H,objectIdFilter as x}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as C}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as Q}from"./support/fieldProperties.js";import{PopupSceneLayerView as V}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as R}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as q}from"./support/TemporalSceneLayerView.js";import{updatingProgress as L}from"../support/updatingProperties.js";import A from"../../layers/SceneLayerView.js";import{hasPopupTemplate as D}from"../../layers/support/popupUtils.js";import{isInEffectiveScaleRange as G}from"../../support/layerViewUtils.js";import{TaskPriority as U}from"../../support/Scheduler.js";const P=Q();let M=class extends(c(q(C(V(g(A)))))){constructor(){super(...arguments),this.type="scene-layer-3d",this.viewFilter=null,this._setVisibilityHiddenObjectIds=new l,this.progressiveLoadFactor=1,this._elevationContext=2,this._supportsLabeling=!0,this._pendingEditsQueue=Promise.resolve(),this._interactiveEditingSessions=new Map,this._queryEngine=null}get i3slayer(){return this.layer}tryRecycleWith(e,t){return e.url===this.layer.url&&this.i3sOverrides.isEmpty?e.load(t).then(()=>{s(t),O(this.layer,e,this.i3sOverrides),this.layer=e,this.i3sOverrides.destroy();const i=this.view.resourceController?.memoryController;this.i3sOverrides=new b({view:this.view,layer:e,memoryController:i}),this.resetHighlights()}):null}get layerPopupEnabledAndHasTemplate(){return this.layer.popupEnabled&&D(this.layer,this.view.popup?.defaultPopupTemplateEnabled)}get filter(){return this._get("filter")}set filter(e){this._set("filter",w.checkSupport(e)?e:null)}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get _floorFilterClause(){const e=h(this);return null!=e?d.create(e,{fieldsIndex:this.layer.fieldsIndex}):null}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds.toArray();return e.length?e.sort((e,t)=>e-t):null}get _setVisibilityHiddenObjectIdsSorted(){return this._setVisibilityHiddenObjectIds.size?Array.from(this._setVisibilityHiddenObjectIds).sort((e,t)=>e-t):null}get lodFactor(){return this.view?.qualitySettings?.sceneService?.objectLoDFactor??1}get lodCrossfadeUncoveredDuration(){return this.view?.qualitySettings?.fadeDuration??0}get updatingProgressValue(){return this._controller?.updatingProgress??0}get visibleAtCurrentScale(){return G(this.i3slayer.effectiveScaleRange,this.view.scale)}get _graphicOrigin(){return this.layer.graphicOrigin}initialize(){this._fieldsHelper=new R({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,e=>this._rangeInfosChanged(e),n),this._updatingHandles.add(()=>this.layer.renderer,e=>this._updatingHandles.addPromise(this._rendererChange(e)),n);const e=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,e),this._updatingHandles.add(()=>this.mergedFilter,e),this._updatingHandles.add(()=>this._floorFilterClause,e),this._updatingHandles.add(()=>this._excludeObjectIdsSorted,e),this._updatingHandles.add(()=>this._setVisibilityHiddenObjectIdsSorted,e),this._updatingHandles.add(()=>this.viewFilter?.sortedObjectIds,e),this._updatingHandles.add(()=>this.viewFilter?.parsedWhereClause,e),this._updatingHandles.add(()=>this.getTimeFilterDependencies(),e),this._updatingHandles.add(()=>[this.viewFilter?.parsedGeometry,this.mergedFilter?.spatialRelationship,this.layer.filter?.spatialRelationship],()=>this._geometryFilterChange()),this._updatingHandles.add(()=>({layerViewFilter:this.mergedFilter,layerFilter:this.layerFilter}),({layerViewFilter:e,layerFilter:t})=>{if(null==e&&null==t)return void this._set("viewFilter",null);const i=this.viewFilter;if(i)return i.viewFilter=e,i.layerFilter=t,void this._filterChange();this._set("viewFilter",new w({layerFilter:t,viewFilter:e,layerFieldsIndex:this.layer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,t)=>this.addSqlFilter(e,t,this.logError),addTimeFilter:(e,t)=>this.addTimeFilter(e,t)}))},n),this.i3sOverrides.is3DOFL&&this._updatingHandles.add(()=>this.i3sOverrides.sortedGeometryChangedObjectIds,e),this.addHandles(this.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))),this.addHandles(this.layer.on("edits",e=>{const t=this._pendingEditsQueue.then(()=>this._handleEdits(e)).then();this._pendingEditsQueue=t,this._updatingHandles.consumePromise(t)}))}destroy(){this._fieldsHelper=r(this._fieldsHelper)}_rangeInfosChanged(e){null!=e&&e.length>0&&i.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}createQuery(){const e={outFields:["*"],returnGeometry:!0,returnZ:!0,outSpatialReference:this.view.spatialReference};return this.mergedFilter?.createQuery(e)??new p(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t?.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t?.signal).then(e=>{if(!e?.features)return e;const t=this.layer,i=this._graphicOrigin;for(const r of e.features)r.layer=t,r.sourceLayer=t,r.origin=i;return e})}async queryObjectIds(e,t){return(await this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t?.signal)).filter(y)}_ensureQueryEngine(){return this._queryEngine??=this._createQueryEngine(),this._queryEngine}_createQueryEngine(){const e=v(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new j({layerView:this,priority:U.FEATURE_QUERY_ENGINE,spatialIndex:new E({featureAdapter:new I({objectIdField:this.layer.objectIdField,attributeStorageInfo:this.layer.attributeStorageInfo??[],getFeatureExtent:e}),forAllFeatures:(e,t)=>this._forAllFeatures((t,i,r)=>e(new S(t,i,r)),t,2),getFeatureExtent:e,sourceSpatialReference:H(this.layer),viewSpatialReference:this.view.spatialReference})})}createInteractiveEditSession(e){return f(this._attributeEditingContext,e)}_createLayerGraphic(e){return new t({attributes:e,layer:this.layer,sourceLayer:this.layer,origin:this._graphicOrigin})}getFilters(){const e=super.getFilters();this.i3sOverrides.is3DOFL&&this.i3sOverrides.sortedGeometryChangedObjectIds.length>0&&e.push((e,t)=>{t.node.index>=0&&x(this.i3sOverrides.sortedGeometryChangedObjectIds,!1,e)});const t=this._setVisibilityHiddenObjectIdsSorted;null!=t&&e.push(e=>x(t,!1,e));const i=this._excludeObjectIdsSorted;return null!=i&&e.push(e=>x(i,!1,e)),this._floorFilterClause&&this.addSqlFilter(e,this._floorFilterClause,this.logError),this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),null!=this.viewFilter&&this.viewFilter.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}setVisibility(e,t){t?this._setVisibilityHiddenObjectIds.delete(e):this._setVisibilityHiddenObjectIds.add(e)}isUpdating(){return super.isUpdating()||!!this._fieldsHelper?.updating||this.layerFilterUpdating||null!=this.viewFilter&&this.viewFilter.updating||null!=this.i3sOverrides&&this.i3sOverrides.updating}_ensureQuery(e){return this._validateQuery(this._addDefinitionExpressionToQuery(null==e?this.createQuery():p.from(e)))}_validateQuery(e){return e.outSpatialReference&&!e.outSpatialReference.equals(this.view.spatialReference)&&(i.getLogger(this).warn("query: outSpatialReference different from the view's spatial reference is not supported"),e.outSpatialReference=this.view.spatialReference),e.returnGeometry&&(e.returnZ=!0),e.returnCentroid=!1,e}get _attributeEditingContext(){return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:this._getObjectIdField(),globalIdField:this._getGlobalIdField(),forEachNode:e=>this._forAllNodes(t=>null!=t?e(t.node,t.featureIds):null),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this.i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(e,t)=>this.setAttributeData(e,t),clearMemCache:()=>this.clearMemCache()}}async _handleEdits(e){const t=this._attributeEditingContext,i=await m(t,e);_(t,i),F(t,i)}get hasGeometryFilter(){return null!=this.viewFilter?.parsedGeometry}computeNodeFiltering(e){const t=this.viewFilter;return null==t||!this.view.spatialReference||t.isMBSGeometryVisible(e,this.view.spatialReference,this._controller.crsIndex)?0:1}};e([o()],M.prototype,"i3slayer",null),e([o(L)],M.prototype,"updatingProgress",void 0),e([o({type:u})],M.prototype,"filter",null),e([o({readOnly:!0})],M.prototype,"viewFilter",void 0),e([o(P.requiredFields)],M.prototype,"requiredFields",null),e([o(P.availableFields)],M.prototype,"availableFields",void 0),e([o()],M.prototype,"_fieldsHelper",void 0),e([o()],M.prototype,"_floorFilterClause",null),e([o()],M.prototype,"_excludeObjectIdsSorted",null),e([o()],M.prototype,"_setVisibilityHiddenObjectIds",void 0),e([o()],M.prototype,"_setVisibilityHiddenObjectIdsSorted",null),e([o()],M.prototype,"lodFactor",null),e([o()],M.prototype,"updatingProgressValue",null),e([o({readOnly:!0})],M.prototype,"visibleAtCurrentScale",null),e([o()],M.prototype,"_graphicOrigin",null),M=e([a("esri.views.3d.layers.SceneLayerView3D")],M);const T=M;export{T as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import i from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveSet.js";import{initial as n}from"../../../core/reactiveUtils.js";import{property as o,subclass as a}from"../../../core/accessorSupport/decorators.js";import d from"../../../core/sql/WhereClause.js";import u from"../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as h}from"../../../layers/support/floorFilterUtils.js";import p from"../../../rest/support/Query.js";import{isNumber as c}from"../../../support/guards.js";import{I3SMeshView3D as y}from"./I3SMeshView3D.js";import{LayerView3D as g}from"./LayerView3D.js";import{createInteractiveEditSession as f,normalizeEditResultsEvent as m,processGeometryEdits as _,processAttributeEdits as F}from"./i3s/featureEditing.js";import{createGetFeatureExtent as v}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as w}from"./i3s/I3SMeshViewFilter.js";import{I3SOverrides as b}from"./i3s/I3SOverrides.js";import{I3SQueryEngine as j}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as I,I3SQueryFeature as S}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as E}from"./i3s/I3SQueryFeatureStore.js";import{checkRecyclable as O,getIndexCrs as H,objectIdFilter as x}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as C}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as Q}from"./support/fieldProperties.js";import{PopupSceneLayerView as V}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as R}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as q}from"./support/TemporalSceneLayerView.js";import{updatingProgress as L}from"../support/updatingProperties.js";import A from"../../layers/SceneLayerView.js";import{hasPopupTemplate as D}from"../../layers/support/popupUtils.js";import{isInEffectiveScaleRange as G}from"../../support/layerViewUtils.js";import{TaskPriority as U}from"../../support/Scheduler.js";const P=Q();let M=class extends(y(q(C(V(g(A)))))){constructor(){super(...arguments),this.type="scene-layer-3d",this.viewFilter=null,this._setVisibilityHiddenObjectIds=new l,this.progressiveLoadFactor=1,this._elevationContext=2,this._supportsLabeling=!0,this._pendingEditsQueue=Promise.resolve(),this._interactiveEditingSessions=new Map,this._queryEngine=null}tryRecycleWith(e,t){return e.url===this.layer.url&&this.i3sOverrides.isEmpty?e.load(t).then(()=>{s(t),O(this.layer,e,this.i3sOverrides),this.layer=e,this.i3sOverrides.destroy();const i=this.view.resourceController?.memoryController;this.i3sOverrides=new b({view:this.view,layer:e,memoryController:i}),this.resetHighlights()}):null}get layerPopupEnabledAndHasTemplate(){return this.layer.popupEnabled&&D(this.layer,this.view.popup?.defaultPopupTemplateEnabled)}get filter(){return this._get("filter")}set filter(e){this._set("filter",w.checkSupport(e)?e:null)}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get _floorFilterClause(){const e=h(this);return null!=e?d.create(e,{fieldsIndex:this.layer.fieldsIndex}):null}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds.toArray();return e.length?e.sort((e,t)=>e-t):null}get _setVisibilityHiddenObjectIdsSorted(){return this._setVisibilityHiddenObjectIds.size?Array.from(this._setVisibilityHiddenObjectIds).sort((e,t)=>e-t):null}get lodFactor(){return this.view?.qualitySettings?.sceneService?.objectLoDFactor??1}get lodCrossfadeUncoveredDuration(){return this.view?.qualitySettings?.fadeDuration??0}get updatingProgressValue(){return this._controller?.updatingProgress??0}get visibleAtCurrentScale(){return G(this.layer.effectiveScaleRange,this.view.scale)}get _graphicOrigin(){return this.layer.graphicOrigin}initialize(){this._fieldsHelper=new R({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,e=>this._rangeInfosChanged(e),n),this._updatingHandles.add(()=>this.layer.renderer,e=>this._updatingHandles.addPromise(this._rendererChange(e)),n);const e=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,e),this._updatingHandles.add(()=>this.mergedFilter,e),this._updatingHandles.add(()=>this._floorFilterClause,e),this._updatingHandles.add(()=>this._excludeObjectIdsSorted,e),this._updatingHandles.add(()=>this._setVisibilityHiddenObjectIdsSorted,e),this._updatingHandles.add(()=>this.viewFilter?.sortedObjectIds,e),this._updatingHandles.add(()=>this.viewFilter?.parsedWhereClause,e),this._updatingHandles.add(()=>this.getTimeFilterDependencies(),e),this._updatingHandles.add(()=>[this.viewFilter?.parsedGeometry,this.mergedFilter?.spatialRelationship,this.layer.filter?.spatialRelationship],()=>this._geometryFilterChange()),this._updatingHandles.add(()=>({layerViewFilter:this.mergedFilter,layerFilter:this.layerFilter}),({layerViewFilter:e,layerFilter:t})=>{if(null==e&&null==t)return void this._set("viewFilter",null);const i=this.viewFilter;if(i)return i.viewFilter=e,i.layerFilter=t,void this._filterChange();this._set("viewFilter",new w({layerFilter:t,viewFilter:e,layerFieldsIndex:this.layer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,t)=>this.addSqlFilter(e,t,this.logError),addTimeFilter:(e,t)=>this.addTimeFilter(e,t)}))},n),this.i3sOverrides.is3DOFL&&this._updatingHandles.add(()=>this.i3sOverrides.sortedGeometryChangedObjectIds,e),this.addHandles(this.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))),this.addHandles(this.layer.on("edits",e=>{const t=this._pendingEditsQueue.then(()=>this._handleEdits(e)).then();this._pendingEditsQueue=t,this._updatingHandles.consumePromise(t)}))}destroy(){this._fieldsHelper=r(this._fieldsHelper)}_rangeInfosChanged(e){null!=e&&e.length>0&&i.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}createQuery(){const e={outFields:["*"],returnGeometry:!0,returnZ:!0,outSpatialReference:this.view.spatialReference};return this.mergedFilter?.createQuery(e)??new p(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t?.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t?.signal).then(e=>{if(!e?.features)return e;const t=this.layer,i=this._graphicOrigin;for(const r of e.features)r.layer=t,r.sourceLayer=t,r.origin=i;return e})}async queryObjectIds(e,t){return(await this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t?.signal)).filter(c)}_ensureQueryEngine(){return this._queryEngine??=this._createQueryEngine(),this._queryEngine}_createQueryEngine(){const e=v(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new j({layerView:this,priority:U.FEATURE_QUERY_ENGINE,spatialIndex:new E({featureAdapter:new I({objectIdField:this.layer.objectIdField,attributeStorageInfo:this.layer.attributeStorageInfo??[],getFeatureExtent:e}),forAllFeatures:(e,t)=>this._forAllFeatures((t,i,r)=>e(new S(t,i,r)),t,2),getFeatureExtent:e,sourceSpatialReference:H(this.layer),viewSpatialReference:this.view.spatialReference})})}createInteractiveEditSession(e){return f(this._attributeEditingContext,e)}_createLayerGraphic(e){return new t({attributes:e,layer:this.layer,sourceLayer:this.layer,origin:this._graphicOrigin})}getFilters(){const e=super.getFilters();this.i3sOverrides.is3DOFL&&this.i3sOverrides.sortedGeometryChangedObjectIds.length>0&&e.push((e,t)=>{t.node.index>=0&&x(this.i3sOverrides.sortedGeometryChangedObjectIds,!1,e)});const t=this._setVisibilityHiddenObjectIdsSorted;null!=t&&e.push(e=>x(t,!1,e));const i=this._excludeObjectIdsSorted;return null!=i&&e.push(e=>x(i,!1,e)),this._floorFilterClause&&this.addSqlFilter(e,this._floorFilterClause,this.logError),this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),null!=this.viewFilter&&this.viewFilter.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}setVisibility(e,t){t?this._setVisibilityHiddenObjectIds.delete(e):this._setVisibilityHiddenObjectIds.add(e)}isUpdating(){return super.isUpdating()||!!this._fieldsHelper?.updating||this.layerFilterUpdating||null!=this.viewFilter&&this.viewFilter.updating||null!=this.i3sOverrides&&this.i3sOverrides.updating}_ensureQuery(e){return this._validateQuery(this._addDefinitionExpressionToQuery(null==e?this.createQuery():p.from(e)))}_validateQuery(e){return e.outSpatialReference&&!e.outSpatialReference.equals(this.view.spatialReference)&&(i.getLogger(this).warn("query: outSpatialReference different from the view's spatial reference is not supported"),e.outSpatialReference=this.view.spatialReference),e.returnGeometry&&(e.returnZ=!0),e.returnCentroid=!1,e}get _attributeEditingContext(){return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:this._getObjectIdField(),globalIdField:this._getGlobalIdField(),forEachNode:e=>this._forAllNodes(t=>null!=t?e(t.node,t.featureIds):null),attributeStorageInfo:this.layer.attributeStorageInfo??[],i3sOverrides:this.i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(e,t)=>this.setAttributeData(e,t),clearMemCache:()=>this.clearMemCache()}}async _handleEdits(e){const t=this._attributeEditingContext,i=await m(t,e);_(t,i),F(t,i)}get hasGeometryFilter(){return null!=this.viewFilter?.parsedGeometry}computeNodeFiltering(e){const t=this.viewFilter;return null==t||!this.view.spatialReference||t.isMBSGeometryVisible(e,this.view.spatialReference,this._controller.crsIndex)?0:1}};e([o(L)],M.prototype,"updatingProgress",void 0),e([o({type:u})],M.prototype,"filter",null),e([o({readOnly:!0})],M.prototype,"viewFilter",void 0),e([o(P.requiredFields)],M.prototype,"requiredFields",null),e([o(P.availableFields)],M.prototype,"availableFields",void 0),e([o()],M.prototype,"_fieldsHelper",void 0),e([o()],M.prototype,"_floorFilterClause",null),e([o()],M.prototype,"_excludeObjectIdsSorted",null),e([o()],M.prototype,"_setVisibilityHiddenObjectIds",void 0),e([o()],M.prototype,"_setVisibilityHiddenObjectIdsSorted",null),e([o()],M.prototype,"lodFactor",null),e([o()],M.prototype,"updatingProgressValue",null),e([o({readOnly:!0})],M.prototype,"visibleAtCurrentScale",null),e([o()],M.prototype,"_graphicOrigin",null),M=e([a("esri.views.3d.layers.SceneLayerView3D")],M);const T=M;export{T as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{hasScaling as e}from"../../../core/mathUtils.js";import{fromMat4 as r}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import o from"../../../geometry/SpatialReference.js";import{ensurePackedMat4f64 as n,ensurePackedArray as s}from"../../../geometry/support/DoubleArray.js";import i from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import a from"../../../geometry/support/MeshLocalVertexSpace.js";import{b as f,n as c}from"../../../chunks/vec3.js";import{get as l,cleanup as u}from"../../../libs/i3s/I3SModule.js";import{addNormals as m}from"./IntegratedMeshNormals.js";import{TransformedGeometry as p,TransformedData as y}from"./SceneLayerWorkerHandle.js";async function d(e){E=await M();const r=[e.geometryBuffer];return{result:U(E,e,r),transferList:r}}async function h(e){E=await M();const r=[e.geometryBuffer],{geometryBuffer:t}=e,o=t.byteLength,n=E._malloc(o),s=new Uint8Array(E.HEAPU8.buffer,n,o);s.set(new Uint8Array(t));const i=E.dracoDecompressPointCloudData(n,s.byteLength);if(E._free(n),i.error.length>0)throw new Error(`i3s.wasm: ${i.error}`);const a=i.featureIds?.length>0?i.featureIds.slice():null,f=i.positions.slice();return a&&r.push(a.buffer),r.push(f.buffer),{result:{positions:f,featureIds:a},transferList:r}}async function g(e){await M(),P(e);const r={buffer:e.buffer};return{result:r,transferList:[r.buffer]}}async function b(e){await M(),S(e)}async function w(e){E=await M(),E.setLegacySchema(e.context,e.jsonSchema)}async function j(e){const{localMatrix:r,origin:t,positions:f,vertexSpace:c}=e,l=o.fromJSON(e.inSpatialReference),u=o.fromJSON(e.outSpatialReference),m=r?n(r):void 0,p=s(t);let y;const[{projectBuffer:d},{initializeProjection:h}]=await Promise.all([import("../../../geometry/projection/projectBuffer.js"),import("../../../geometry/projectionUtils.js")]);await h(l,u);const g=[0,0,0];if(!d(p,l,0,g,u,0))throw new Error("Failed to project");if("georeferenced"===c.type&&null==c.origin){if(y=new Float64Array(f.length),!d(f,l,0,y,u,0,y.length/3))throw new Error("Failed to project")}else{const e="georeferenced"===c.type?i.fromJSON(c):a.fromJSON(c),{projectMeshVertexPositions:r}=await import("../../../geometry/support/meshUtils/projectMeshVertexPositions.js"),t=r({vertexAttributes:{position:f},transform:m?{localMatrix:m}:void 0,vertexSpace:e,spatialReference:l},u);if(!t)throw new Error("Failed to project");y=t}const b=y.length,[w,j,A]=g;for(let o=0;o<b;o+=3)y[o]-=w,y[o+1]-=j,y[o+2]-=A;return{result:{projected:y,original:f,projectedOrigin:g},transferList:[y.buffer,f.buffer]}}async function A({normalMatrix:r,normals:t}){const o=new Float32Array(t.length);return f(o,t,r),e(r)&&c(o,o),{result:{transformed:o,original:t},transferList:[o.buffer,t.buffer]}}function x(e){_(e)}let L,E;function S(e){if(!E)return;const r=e.modifications,t=E._malloc(8*r.length),o=new Float64Array(E.HEAPU8.buffer,t,r.length);for(let n=0;n<r.length;++n)o[n]=r[n];E.setModifications(e.context,t,r.length,e.isGeodetic),E._free(t)}function U(e,o,n){const{context:s,globalTrafo:i,mbs:a,obbData:f,layouts:c,needNormals:l,computeNormals:u,elevationOffset:d,geometryBuffer:h,geometryDescriptor:g,indexToVertexProjector:b,vertexToRenderProjector:w,normalReferenceFrame:j}=o,A=e._malloc(h.byteLength),x=33,L=e._malloc(x*Float64Array.BYTES_PER_ELEMENT),E=new Uint8Array(e.HEAPU8.buffer,A,h.byteLength);E.set(new Uint8Array(h));const S=new Float64Array(e.HEAPU8.buffer,L,x);v(S,[NaN,NaN,NaN],0);let U=3;v(S,i,U),U+=16,v(S,a.center,U),U+=3,S[U++]=a.radius,f&&v(S,f,U++);const N={isDraco:!1,isLegacy:!1,color:c.some(e=>e.some(e=>"color"===e.name)),normal:l&&c.some(e=>e.some(e=>"normalCompressed"===e.name)),uv0:c.some(e=>e.some(e=>"uv0"===e.name)),uvRegion:c.some(e=>e.some(e=>"uvRegion"===e.name)),featureIndex:g.featureIndex},P=e.process(s,!!f,A,E.byteLength,g,N,L,d,b,w,j);if(e._free(L),e._free(A),P.error.length>0)throw new Error(`i3s.wasm: ${P.error}`);if(P.discarded)return null;const _=P.componentOffsets.length>0?P.componentOffsets.slice():null,I=P.featureIds.length>0?P.featureIds.slice():null,M=P.anchorIds.length>0?Array.from(P.anchorIds):null,F=P.anchors.length>0?Array.from(P.anchors):null,O=1===P.indicesType?new Uint16Array(P.indices.buffer,P.indices.byteOffset,P.indices.byteLength/2).slice():new Uint32Array(P.indices.buffer,P.indices.byteOffset,P.indices.byteLength/4).slice(),B=c[0].slice(),R=r(t(),i),T=m(P.interleavedVertedData,O,B,u&&!N.normal,R),D=P.positions.slice(),{buffer:H,byteOffset:V,byteLength:J}=P.positionIndices,C=1===P.positionIndicesType?new Uint16Array(H,V,J/2).slice():new Uint32Array(H,V,J/4).slice(),k=new p(B,T.data,T.indices,P.hasColors,P.hasModifications,{data:D,indices:C});return I&&n.push(I.buffer),_&&n.push(_.buffer),n.push(T.data),n.push(T.indices.buffer),n.push(D.buffer),n.push(C.buffer),new y(_,I,M,F,k,i,P.obb)}function N(e){return 0===e?0:1===e?1:2===e?2:3}function P(e){if(!E)return;const{context:r,buffer:t}=e,o=E._malloc(t.byteLength),n=t.byteLength/Float64Array.BYTES_PER_ELEMENT,s=new Float64Array(E.HEAPU8.buffer,o,n),i=new Float64Array(t);s.set(i),E.filterOBBs(r,o,n),i.set(s),E._free(o)}function _(e){0===E?.destroy(e)&&(E=null,L=null,u())}function v(e,r,t){for(let o=0;o<r.length;++o)e[o+t]=r[o]}async function I(){E||await M()}async function M(){return E||(E=await(L??=l())),E}const F={transform:(e,r)=>E&&U(E,e,r),destroy:_};export{x as destroyContext,h as dracoDecompressPointCloudData,g as filterObbsForModifications,P as filterObbsForModificationsSync,I as initialize,N as interpretObbModificationResults,d as process,j as project,w as setLegacySchema,b as setModifications,S as setModificationsSync,F as test,A as transformNormals};
2
+ import{hasScaling as e}from"../../../core/mathUtils.js";import{fromMat4 as r}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import o from"../../../geometry/SpatialReference.js";import{ensurePackedMat4f64 as n,ensurePackedArray as s}from"../../../geometry/support/DoubleArray.js";import i from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import a from"../../../geometry/support/MeshLocalVertexSpace.js";import{b as f,n as c}from"../../../chunks/vec3.js";import{get as l,cleanup as u}from"../../../libs/i3s/I3SModule.js";import{processNormals as m}from"./IntegratedMeshNormals.js";import{TransformedGeometry as p,TransformedData as y}from"./SceneLayerWorkerHandle.js";async function d(e){E=await M();const r=[e.geometryBuffer];return{result:U(E,e,r),transferList:r}}async function h(e){E=await M();const r=[e.geometryBuffer],{geometryBuffer:t}=e,o=t.byteLength,n=E._malloc(o),s=new Uint8Array(E.HEAPU8.buffer,n,o);s.set(new Uint8Array(t));const i=E.dracoDecompressPointCloudData(n,s.byteLength);if(E._free(n),i.error.length>0)throw new Error(`i3s.wasm: ${i.error}`);const a=i.featureIds?.length>0?i.featureIds.slice():null,f=i.positions.slice();return a&&r.push(a.buffer),r.push(f.buffer),{result:{positions:f,featureIds:a},transferList:r}}async function g(e){await M(),P(e);const r={buffer:e.buffer};return{result:r,transferList:[r.buffer]}}async function b(e){await M(),S(e)}async function w(e){E=await M(),E.setLegacySchema(e.context,e.jsonSchema)}async function j(e){const{localMatrix:r,origin:t,positions:f,vertexSpace:c}=e,l=o.fromJSON(e.inSpatialReference),u=o.fromJSON(e.outSpatialReference),m=r?n(r):void 0,p=s(t);let y;const[{projectBuffer:d},{initializeProjection:h}]=await Promise.all([import("../../../geometry/projection/projectBuffer.js"),import("../../../geometry/projectionUtils.js")]);await h(l,u);const g=[0,0,0];if(!d(p,l,0,g,u,0))throw new Error("Failed to project");if("georeferenced"===c.type&&null==c.origin){if(y=new Float64Array(f.length),!d(f,l,0,y,u,0,y.length/3))throw new Error("Failed to project")}else{const e="georeferenced"===c.type?i.fromJSON(c):a.fromJSON(c),{projectMeshVertexPositions:r}=await import("../../../geometry/support/meshUtils/projectMeshVertexPositions.js"),t=r({vertexAttributes:{position:f},transform:m?{localMatrix:m}:void 0,vertexSpace:e,spatialReference:l},u);if(!t)throw new Error("Failed to project");y=t}const b=y.length,[w,j,A]=g;for(let o=0;o<b;o+=3)y[o]-=w,y[o+1]-=j,y[o+2]-=A;return{result:{projected:y,original:f,projectedOrigin:g},transferList:[y.buffer,f.buffer]}}async function A({normalMatrix:r,normals:t}){const o=new Float32Array(t.length);return f(o,t,r),e(r)&&c(o,o),{result:{transformed:o,original:t},transferList:[o.buffer,t.buffer]}}function x(e){_(e)}let L,E;function S(e){if(!E)return;const r=e.modifications,t=E._malloc(8*r.length),o=new Float64Array(E.HEAPU8.buffer,t,r.length);for(let n=0;n<r.length;++n)o[n]=r[n];E.setModifications(e.context,t,r.length,e.isGeodetic),E._free(t)}function U(e,o,n){const{context:s,globalTrafo:i,mbs:a,obbData:f,layouts:c,needNormals:l,computeNormals:u,elevationOffset:d,geometryBuffer:h,geometryDescriptor:g,indexToVertexProjector:b,vertexToRenderProjector:w,normalReferenceFrame:j}=o,A=e._malloc(h.byteLength),x=33,L=e._malloc(x*Float64Array.BYTES_PER_ELEMENT),E=new Uint8Array(e.HEAPU8.buffer,A,h.byteLength);E.set(new Uint8Array(h));const S=new Float64Array(e.HEAPU8.buffer,L,x);v(S,[NaN,NaN,NaN],0);let U=3;v(S,i,U),U+=16,v(S,a.center,U),U+=3,S[U++]=a.radius,f&&v(S,f,U++);const N={isDraco:!1,isLegacy:!1,color:c.some(e=>e.some(e=>"color"===e.name)),normal:l&&c.some(e=>e.some(e=>"normalCompressed"===e.name)),uv0:c.some(e=>e.some(e=>"uv0"===e.name)),uvRegion:c.some(e=>e.some(e=>"uvRegion"===e.name)),featureIndex:g.featureIndex},P=e.process(s,!!f,A,E.byteLength,g,N,L,d,b,w,j);if(e._free(L),e._free(A),P.error.length>0)throw new Error(`i3s.wasm: ${P.error}`);if(P.discarded)return null;const _=P.componentOffsets.length>0?P.componentOffsets.slice():null,I=P.featureIds.length>0?P.featureIds.slice():null,M=P.anchorIds.length>0?Array.from(P.anchorIds):null,F=P.anchors.length>0?Array.from(P.anchors):null,O=1===P.indicesType?new Uint16Array(P.indices.buffer,P.indices.byteOffset,P.indices.byteLength/2).slice():new Uint32Array(P.indices.buffer,P.indices.byteOffset,P.indices.byteLength/4).slice(),B=c[0].slice(),R=r(t(),i),T=m(P.interleavedVertedData,O,B,u&&!N.normal,R),D=P.positions.slice(),{buffer:H,byteOffset:V,byteLength:J}=P.positionIndices,C=1===P.positionIndicesType?new Uint16Array(H,V,J/2).slice():new Uint32Array(H,V,J/4).slice(),k=new p(B,T.data,T.indices,P.hasColors,P.hasModifications,{data:D,indices:C});return I&&n.push(I.buffer),_&&n.push(_.buffer),n.push(T.data),n.push(T.indices.buffer),n.push(D.buffer),n.push(C.buffer),new y(_,I,M,F,k,i,P.obb)}function N(e){return 0===e?0:1===e?1:2===e?2:3}function P(e){if(!E)return;const{context:r,buffer:t}=e,o=E._malloc(t.byteLength),n=t.byteLength/Float64Array.BYTES_PER_ELEMENT,s=new Float64Array(E.HEAPU8.buffer,o,n),i=new Float64Array(t);s.set(i),E.filterOBBs(r,o,n),i.set(s),E._free(o)}function _(e){0===E?.destroy(e)&&(E=null,L=null,u())}function v(e,r,t){for(let o=0;o<r.length;++o)e[o+t]=r[o]}async function I(){E||await M()}async function M(){return E||(E=await(L??=l())),E}const F={transform:(e,r)=>E&&U(E,e,r),destroy:_};export{x as destroyContext,h as dracoDecompressPointCloudData,g as filterObbsForModifications,P as filterObbsForModificationsSync,I as initialize,N as interpretObbModificationResults,d as process,j as project,w as setLegacySchema,b as setModifications,S as setModificationsSync,F as test,A as transformNormals};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as s,sync as n}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import o from"../../../../geometry/Extent.js";import{fallbackObjectIDAttribute as u}from"../../../../layers/LayerConstants.js";import{QueryEngine as y}from"../../../../layers/graphics/data/QueryEngine.js";import l from"../../../../layers/support/FieldsIndex.js";import c from"../../../../rest/support/FeatureSet.js";import d from"../../../../rest/support/Query.js";const p=y;let h=class extends t{constructor(e){super(e)}initialize(){this.addHandles(this.layerView.on("visible-geometry-changed",()=>this.spatialIndex.events.emit("changed"))),this.addHandles(s(()=>this.layerView.availableFields,()=>this._dataQueryEngineInstance=r(this._dataQueryEngineInstance),n))}destroy(){this._dataQueryEngineInstance=r(this._dataQueryEngineInstance),this._set("layerView",null)}get spatialReference(){return this.layerView.view.spatialReference}get layer(){return this.layerView.i3slayer}get defaultQueryJSON(){return new d({outSpatialReference:this.spatialReference}).toJSON()}get _dataQueryEngine(){return this._ensureDataQueryEngine()}async executeQueryForCount(e,t){return this._dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(e),t)}async executeQueryForExtent(e,t){const{count:r,extent:s}=await this._dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(e),t);return{count:r,extent:o.fromJSON(s)}}async executeQueryForIds(e,t){return this._dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(e),t)}async executeQuery(e,t){const r=this._ensureQueryJSON(e),s=await this._dataQueryEngine.executeQuery(r,t);if(e?.returnGeometry){const{processQueryGeometries:e}=await import("./I3SQueryResultGeometry.js");return e(this.layerView,s)}return c.fromJSON(s)}_ensureQueryJSON(e){return null==e?this.defaultQueryJSON:e.toJSON()}_ensureDataQueryEngine(){if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance;const e=this.layer.objectIdField||u,t="esriGeometryPolygon",r=this.layer.fieldsIndex?.toJSON()||new l([]),s=this.layerView.view.resourceController.scheduler,n=this.spatialReference.toJSON(),i=this.priority,a=this.spatialIndex,o=this.layerView.availableFields??[];return this._dataQueryEngineInstance=new p({hasZ:!0,hasM:!1,geometryType:t,fieldsIndex:r,timeInfo:null,spatialReference:n,featureIdInfo:{type:"object-id",fieldName:e},featureStore:a,scheduler:s,priority:i,availableFields:o}),this._dataQueryEngineInstance}};e([i({constructOnly:!0})],h.prototype,"layerView",void 0),e([i({constructOnly:!0})],h.prototype,"priority",void 0),e([i({constructOnly:!0})],h.prototype,"spatialIndex",void 0),e([i()],h.prototype,"spatialReference",null),e([i()],h.prototype,"layer",null),e([i()],h.prototype,"defaultQueryJSON",null),h=e([a("esri.views.3d.layers.i3s.I3SQueryEngine")],h);export{h as I3SQueryEngine};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as s,sync as n}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import o from"../../../../geometry/Extent.js";import{fallbackObjectIDAttribute as u}from"../../../../layers/LayerConstants.js";import{QueryEngine as y}from"../../../../layers/graphics/data/QueryEngine.js";import l from"../../../../layers/support/FieldsIndex.js";import c from"../../../../rest/support/FeatureSet.js";import d from"../../../../rest/support/Query.js";const p=y;let h=class extends t{constructor(e){super(e)}initialize(){this.addHandles(this.layerView.on("visible-geometry-changed",()=>this.spatialIndex.events.emit("changed"))),this.addHandles(s(()=>this.layerView.availableFields,()=>this._dataQueryEngineInstance=r(this._dataQueryEngineInstance),n))}destroy(){this._dataQueryEngineInstance=r(this._dataQueryEngineInstance),this._set("layerView",null)}get spatialReference(){return this.layerView.view.spatialReference}get layer(){return this.layerView.layer}get defaultQueryJSON(){return new d({outSpatialReference:this.spatialReference}).toJSON()}get _dataQueryEngine(){return this._ensureDataQueryEngine()}async executeQueryForCount(e,t){return this._dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(e),t)}async executeQueryForExtent(e,t){const{count:r,extent:s}=await this._dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(e),t);return{count:r,extent:o.fromJSON(s)}}async executeQueryForIds(e,t){return this._dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(e),t)}async executeQuery(e,t){const r=this._ensureQueryJSON(e),s=await this._dataQueryEngine.executeQuery(r,t);if(e?.returnGeometry){const{processQueryGeometries:e}=await import("./I3SQueryResultGeometry.js");return e(this.layerView,s)}return c.fromJSON(s)}_ensureQueryJSON(e){return null==e?this.defaultQueryJSON:e.toJSON()}_ensureDataQueryEngine(){if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance;const e=this.layer.objectIdField||u,t="esriGeometryPolygon",r=this.layer.fieldsIndex?.toJSON()||new l([]),s=this.layerView.view.resourceController.scheduler,n=this.spatialReference.toJSON(),i=this.priority,a=this.spatialIndex,o=this.layerView.availableFields??[];return this._dataQueryEngineInstance=new p({hasZ:!0,hasM:!1,geometryType:t,fieldsIndex:r,timeInfo:null,spatialReference:n,featureIdInfo:{type:"object-id",fieldName:e},featureStore:a,scheduler:s,priority:i,availableFields:o}),this._dataQueryEngineInstance}};e([i({constructOnly:!0})],h.prototype,"layerView",void 0),e([i({constructOnly:!0})],h.prototype,"priority",void 0),e([i({constructOnly:!0})],h.prototype,"spatialIndex",void 0),e([i()],h.prototype,"spatialReference",null),e([i()],h.prototype,"layer",null),e([i()],h.prototype,"defaultQueryJSON",null),h=e([a("esri.views.3d.layers.i3s.I3SQueryEngine")],h);export{h as I3SQueryEngine};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../request.js";import{binaryIndexOf as t}from"../../../../core/arrayUtils.js";import r from"../../../../core/Error.js";import has from"../../../../core/has.js";import{invert as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as i,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as l}from"../../../../geometry/projectionUtils.js";import c from"../../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../../geometry/projection/projectVectorToVector.js";import{create as f,empty as p,expandPointInPlace as m,intersects as d}from"../../../../geometry/support/aaBoundingRect.js";import{fetchFeaturePopupFeatures as h}from"../../../../layers/support/featurePopupQueryUtils.js";import y from"../../../../rest/support/Query.js";import{readBinaryAttribute as g,getCachedAttributeValue as b}from"./I3SBinaryReader.js";import{computeGlobalTransformation as w}from"./I3SProjectionUtil.js";import{createSolidEdgeMaterial as v,createMaterialFromEdges as x}from"../support/edgeUtils.js";import{parseColorMixMode as S}from"../support/symbolColorUtils.js";import{Obb as M,compute as R}from"../../support/orientedBoundingBox.js";import{emissiveStrengthDefault as j}from"../../webgl-engine/core/shaderLibrary/output/Emissions.glsl.js";import{spatialReferenceIncompatibleError as I}from"../../../support/layerViewUtils.js";function T(e){return e?parseInt(e.slice(e.lastIndexOf("/")+1),10):void 0}function k(e){if(has("disable-feature:i3s-draco")||!e)return!1;for(const t of e)for(const e of t.geometryBuffers)if("draco"===e.compressedAttributes?.encoding)return!0;return!1}function U(e,t,r,o){r.traverse(t,t=>{const r=t.serviceMbsInIndexSR;return 0!==(null!=r&&L(e,r))&&(o(t),!0)})}function W(e,t,r){let o=0,n=0;for(let i=0;i<t.length&&o<e.length;i++)e[o]===t[i]&&(r(i)&&(e[n]=e[o],n++),o++);e.length=n}function C(e,r,o){let n=0,i=0;for(;n<o.length;){t(e,o[n])>=0===r&&(o[i]=o[n],i++),n++}o.length=i}function A(e,t){if(0===t.rotationScale[1]&&0===t.rotationScale[2]&&0===t.rotationScale[3]&&0===t.rotationScale[5]&&0===t.rotationScale[6]&&0===t.rotationScale[7])return K[0]=(e[0]-t.position[0])/t.rotationScale[0],K[1]=(e[1]-t.position[1])/t.rotationScale[4],K[2]=(e[2]-t.position[0])/t.rotationScale[0],K[3]=(e[3]-t.position[1])/t.rotationScale[4],K}const K=f();function L(e,t){const r=t.center[0],o=t.center[1],n=t.radius,i=e[0]-r,s=r-e[2],a=e[1]-o,l=o-e[3],c=Math.max(i,s,0),u=Math.max(a,l,0),f=c*c+u*u;if(f>n*n)return 0;if(f>0)return 1;return-Math.max(i,s,a,l)>n?3:2}function q(e,t,r){const o=[],n=r?.missingFields,i=r?.originalFields;let s=!1;for(const a of e){const e=t.get(a);e?(i?.push(a),o.push(e.name),a!==e.name&&(s=!0)):n?.push(a)}return r&&"hasMismatchedCasing"in r&&(r.hasMismatchedCasing=s),o}async function F(e,t,o,n,i,s){if(0===t.length)return[];const a=e.attributeStorageInfo;if(null!=e.associatedLayer)try{return await B(e.associatedLayer,t,n,s)}catch(l){if(e.associatedLayer.loaded)throw l}if(a){const r=G(e,t,o,i),l=e.parsedUrl.path;return await Promise.allSettled(r.map(t=>O(l,a,t.node,t.indices,n,e.apiKey,e.customParameters,s).then(e=>{for(let r=0;r<t.graphics.length;r++){const o=t.graphics[r],n=e[r];if(o.attributes)for(const e in o.attributes)e in n||(n[e]=o.attributes[e]);o.attributes=n}}))),t}throw new r("scenelayer:no-attribute-source","This scene layer does not have a source for attributes available")}function G({globalIdField:e},t,r,o){const n=new Map,i=[],s=o();for(const a of t){const t=a.attributes?.[r],o=null==t?a.getGlobalId():void 0;for(let r=0;r<s.length;r++){const l=s[r],c=P(l,t,e,o);if(c<0)continue;let u=n.get(l.node);u||(u={node:l.node,indices:[],graphics:[]},i.push(u),n.set(l.node,u)),u.indices.push(c),u.graphics.push(a);for(let e=r;e>0;e--)s[e]=s[e-1];s[0]=l;break}}return i}function P(e,t,r,o){if(null!=t&&"number"==typeof t)return e.featureIds.indexOf(t);if(null==o||null==r)return-1;const n=e.attributeInfo?.attributeData?.[r];return n?n.indexOf(o):-1}async function B(e,t,r,o){const n=[],i={hasMismatchedCasing:!1,originalFields:n},s=q(r,e.fieldsIndex,i),a=new y({outFields:[...s]});if(await h(e,t,a,{updateSourceAttributes:!0,...o}),!i.hasMismatchedCasing)return t;for(let l=0;l<t.length;l++){const e=t[l];if(e.attributes)for(let t=0;t<n.length;t++){const r=n[t],o=s[t];o in e.attributes&&(e.attributes[r]=e.attributes[o],delete e.attributes[o])}}return t}function O(e,t,r,o,n,i,s,a){return E(e,t,r.resources.attributes,o,n,i,s,a)}async function E(t,r,o,n,i,s,a,l){const c=[];for(const e of r)if(e&&i.includes(e.name)){const r=`${t}/nodes/${o}/attributes/${e.key}/0`;c.push({url:r,storageInfo:e})}const u=await Promise.allSettled(c.map(t=>e(t.url,{responseType:"array-buffer",query:{...a,token:s},signal:l?.signal}).then(e=>g(t.storageInfo,e.data)))),f=[];for(const e of n){const t={};for(let r=0;r<u.length;r++){const o=u[r];if("fulfilled"===o.status){const n=o.value;t[c[r].storageInfo.name]=b(n,e)}}f.push(t)}return f}function V(e){const t=e.store,o=t.indexCRS||t.geographicCRS,n=void 0===o?t.indexWKT:void 0;if(n){if(!e.spatialReference)throw new r("layerview:no-store-spatial-reference-wkt-index-and-no-layer-spatial-reference","Found indexWKT in the scene layer store but no layer spatial reference",{});if(n!==e.spatialReference.wkt)throw new r("layerview:store-spatial-reference-wkt-index-incompatible","The indexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const i=o?new c(T(o)):e.spatialReference;return i.equals(e.spatialReference)?e.spatialReference:i}function $(e){const t=e.store,o=t.vertexCRS||t.projectedCRS,n=void 0===o?t.vertexWKT:void 0;if(n){if(!e.spatialReference)throw new r("layerview:no-store-spatial-reference-wkt-vertex-and-no-layer-spatial-reference","Found vertexWKT in the scene layer store but no layer spatial reference",{});if(n!==e.spatialReference.wkt)throw new r("layerview:store-spatial-reference-wkt-vertex-incompatible","The vertexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const i=o?new c(T(o)):e.spatialReference;return i.equals(e.spatialReference)?e.spatialReference:i}function z(e,t,r){if(!l(e,t))throw I("scene layer",e?.wkid,t?.wkid);if("local"===r&&!D(e,t))throw I("scene layer",e?.wkid,t?.wkid)}function Q(e,t,o){if(e.serviceUpdateTimeStamp?.lastUpdate!==t.serviceUpdateTimeStamp?.lastUpdate||!o.isEmpty||e.associatedLayer?.url!==t.associatedLayer?.url)throw new r("layerview:recycle-failed","Could not recycle layerview")}function D(e,t){return e.equals(t)||e.isWGS84&&t.isWebMercator||e.isWebMercator&&t.isWGS84}function Z(e,t,r){const o=V(e),n=$(e);z(o,t,r),z(n,t,r)}function H(e){return(null==e.geometryType||"triangles"===e.geometryType)&&((null==e.topology||"PerAttributeArray"===e.topology)&&null!=e.vertexAttributes?.position)}function J(e){if(null==e.store?.defaultGeometrySchema||!H(e.store.defaultGeometrySchema))throw new r("scenelayer:unsupported-geometry-schema","The geometry schema of this scene layer is not supported.",{url:e.parsedUrl.path})}function N(e,t){Z(e,t.spatialReference,t.viewingMode)}function X(e){return null!=e.geometryType&&"points"===e.geometryType&&((null==e.topology||"PerAttributeArray"===e.topology)&&((null==e.encoding||""===e.encoding||"lepcc-xyz"===e.encoding)&&null!=e.vertexAttributes?.position))}function Y(e){if(null==e.store?.defaultGeometrySchema||!X(e.store.defaultGeometrySchema))throw new r("pointcloud:unsupported-geometry-schema","The geometry schema of this point cloud scene layer is not supported.",{})}function _(e,t){z(e.spatialReference,t.spatialReference,t.viewingMode)}function ee(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type}function te(e){return"mesh-3d"===e.type}function re(e){if(null==e||!ee(e))return!0;if(("unique-value"===e.type||"class-breaks"===e.type)&&null==e.defaultSymbol)return!0;const t=e.symbols;if(0===t.length)return!0;for(const r of t){if(!te(r)||0===r.symbolLayers.length)return!0;for(const e of r.symbolLayers.items)if("fill"!==e.type||null==e.material?.color||"replace"!==e.material.colorMixMode)return!0}return!1}const oe=v({color:[0,0,0,0],opacity:0});class ne{constructor(){this.edgeMaterial=null,this.material=null,this.castShadows=!0}}function ie(e){const t=new ne;let r=!1,o=!1;for(const n of e.symbolLayers.items)if("fill"===n.type&&n.enabled){const e=n.material,i=n.edges;if(null!=e&&!r){const o=e.color,i=S(e.colorMixMode),s={strength:e.emissive?.strength??j,source:"color"===e.emissive?.source?1:0};t.material=null!=o?{color:[o.r/255,o.g/255,o.b/255],alpha:o.a,colorMixMode:i,emissive:s}:{color:[1,1,1],alpha:1,colorMixMode:1,emissive:s},t.castShadows=n.castShadows,r=!0}null==i||o||(t.edgeMaterial=x(i,{}),o=!0)}return t.material||(t.material={color:[1,1,1],alpha:1,colorMixMode:1,emissive:{strength:j,source:0}}),t}function se(e,t){return(0|e)+(0|t)|0}function ae(e,t,r,n,a,l,c){if(!l||0===l.length||null==t||!e.serviceMbsInIndexSR)return null;const f=w(e.serviceMbsInIndexSR,a,"none",r,t);o(de,f);let h=null;const y=()=>{if(!h)if(h=le,p(ue),null!=e.serviceObbInIndexSR){e.serviceObbInIndexSR.transform(fe,r,t,a,c),fe.getCorners(h);for(const e of h)i(e,e,de),m(ue,e)}else{const o=e.serviceMbsInIndexSR;if(!o)return;const n=o.radius;u(o.center,r,pe,t),i(pe,pe,de),pe[2]+=a;for(let e=0;e<8;++e){const t=1&e?n:-n,r=2&e?n:-n,o=4&e?n:-n,i=h[e];s(i,[pe[0]+t,pe[1]+r,pe[2]+o]),m(ue,i)}}};let g=1/0,b=-1/0;const v=e=>{if("replace"!==e.type)return;const r=e.geometry;if(!r?.hasZ)return;p(ce);const o=r.spatialReference||n,s=r.rings.reduce((e,r)=>r.reduce((e,r)=>(u(r,o,pe,t),i(pe,pe,de),m(ce,pe),Math.min(pe[2],e)),e),1/0);y(),d(ue,ce)&&(g=Math.min(g,s),b=Math.max(b,s))};if(l.forEach(e=>v(e)),g===1/0)return null;const x=(e,t,r)=>{i(pe,r,f),e[t]=pe[0],e[t+1]=pe[1],e[t+2]=pe[2],t+=24,r[2]=g,i(pe,r,f),e[t]=pe[0],e[t+1]=pe[1],e[t+2]=pe[2],t+=24,r[2]=b,i(pe,r,f),e[t]=pe[0],e[t+1]=pe[1],e[t+2]=pe[2]};for(let o=0;o<8;++o)x(me.data,3*o,h[o]);return R(me)}const le=[a(),a(),a(),a(),a(),a(),a(),a()],ce=f(),ue=f(),fe=new M,pe=a(),me={data:new Array(72),size:3,exclusive:!0,stride:3},de=n();export{ne as SymbolInfo,se as addWraparound,_ as checkPointCloudLayerCompatibleWithView,Y as checkPointCloudLayerValid,Q as checkRecyclable,N as checkSceneLayerCompatibleWithView,J as checkSceneLayerValid,z as checkSpatialReference,Z as checkSpatialReferences,ae as computeVisibilityObb,k as containsDraco,T as extractWkid,W as filterInPlace,q as findFieldsCaseInsensitive,U as findIntersectingNodes,A as getClipRect,V as getIndexCrs,ie as getSymbolInfo,$ as getVertexCrs,L as intersectBoundingRectWithMbs,D as isSupportedLocalModeProjection,C as objectIdFilter,E as queryAttributesFromCachedAttributesId,re as rendererNeedsTextures,oe as transparentEdgeMaterial,F as whenGraphicAttributes};
2
+ import e from"../../../../request.js";import{binaryIndexOf as t}from"../../../../core/arrayUtils.js";import r from"../../../../core/Error.js";import has from"../../../../core/has.js";import{invert as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as i,copy as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as l}from"../../../../geometry/projectionUtils.js";import c from"../../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../../geometry/projection/projectVectorToVector.js";import{create as f,empty as p,expandPointInPlace as m,intersects as d}from"../../../../geometry/support/aaBoundingRect.js";import{fetchFeaturePopupFeatures as h}from"../../../../layers/support/featurePopupQueryUtils.js";import y from"../../../../rest/support/Query.js";import{readBinaryAttribute as g,getCachedAttributeValue as b}from"./I3SBinaryReader.js";import{computeGlobalTransformation as w}from"./I3SProjectionUtil.js";import{createSolidEdgeMaterial as v,createMaterialFromEdges as x}from"../support/edgeUtils.js";import{parseColorMixMode as S}from"../support/symbolColorUtils.js";import{Obb as M,compute as R}from"../../support/orientedBoundingBox.js";import{emissiveStrengthDefault as j}from"../../webgl-engine/core/shaderLibrary/output/Emissions.glsl.js";import{spatialReferenceIncompatibleError as I}from"../../../support/layerViewUtils.js";function T(e){return e?parseInt(e.slice(e.lastIndexOf("/")+1),10):void 0}function k(e){if(has("disable-feature:i3s-draco")||!e)return!1;for(const t of e)for(const e of t.geometryBuffers)if("draco"===e.compressedAttributes?.encoding)return!0;return!1}function U(e,t,r,o){r.traverse(t,t=>{const r=t.serviceMbsInIndexSR;return 0!==(null!=r&&L(e,r))&&(o(t),!0)})}function W(e,t,r){let o=0,n=0;for(let i=0;i<t.length&&o<e.length;i++)e[o]===t[i]&&(r(i)&&(e[n]=e[o],n++),o++);e.length=n}function C(e,r,o){let n=0,i=0;for(;n<o.length;){t(e,o[n])>=0===r&&(o[i]=o[n],i++),n++}o.length=i}function A(e,t){if(0===t.rotationScale[1]&&0===t.rotationScale[2]&&0===t.rotationScale[3]&&0===t.rotationScale[5]&&0===t.rotationScale[6]&&0===t.rotationScale[7])return K[0]=(e[0]-t.position[0])/t.rotationScale[0],K[1]=(e[1]-t.position[1])/t.rotationScale[4],K[2]=(e[2]-t.position[0])/t.rotationScale[0],K[3]=(e[3]-t.position[1])/t.rotationScale[4],K}const K=f();function L(e,t){const r=t.center[0],o=t.center[1],n=t.radius,i=e[0]-r,s=r-e[2],a=e[1]-o,l=o-e[3],c=Math.max(i,s,0),u=Math.max(a,l,0),f=c*c+u*u;if(f>n*n)return 0;if(f>0)return 1;return-Math.max(i,s,a,l)>n?3:2}function q(e,t,r){const o=new Array,n=r?.missingFields,i=r?.originalFields;let s=!1;for(const a of e){const e=t?.get(a);e?(i?.push(a),o.push(e.name),a!==e.name&&(s=!0)):n?.push(a)}return r&&"hasMismatchedCasing"in r&&(r.hasMismatchedCasing=s),o}async function F(e,t,o,n,i,s){if(0===t.length)return[];const a=e.attributeStorageInfo;if(null!=e.associatedLayer)try{return await B(e.associatedLayer,t,n,s)}catch(l){if(e.associatedLayer.loaded)throw l}if(a){const r=G(e,t,o,i),l=e.parsedUrl.path;return await Promise.allSettled(r.map(t=>O(l,a,t.node,t.indices,n,e.apiKey,e.customParameters,s).then(e=>{for(let r=0;r<t.graphics.length;r++){const o=t.graphics[r],n=e[r];if(o.attributes)for(const e in o.attributes)e in n||(n[e]=o.attributes[e]);o.attributes=n}}))),t}throw new r("scenelayer:no-attribute-source","This scene layer does not have a source for attributes available")}function G({globalIdField:e},t,r,o){const n=new Map,i=[],s=o();for(const a of t){const t=a.attributes?.[r],o=null==t?a.getGlobalId():void 0;for(let r=0;r<s.length;r++){const l=s[r],c=P(l,t,e,o);if(c<0)continue;let u=n.get(l.node);u||(u={node:l.node,indices:[],graphics:[]},i.push(u),n.set(l.node,u)),u.indices.push(c),u.graphics.push(a);for(let e=r;e>0;e--)s[e]=s[e-1];s[0]=l;break}}return i}function P(e,t,r,o){if(null!=t&&"number"==typeof t)return e.featureIds.indexOf(t);if(null==o||null==r)return-1;const n=e.attributeInfo?.attributeData?.[r];return n?n.indexOf(o):-1}async function B(e,t,r,o){const n=[],i={hasMismatchedCasing:!1,originalFields:n},s=q(r,e.fieldsIndex,i),a=new y({outFields:[...s]});if(await h(e,t,a,{updateSourceAttributes:!0,...o}),!i.hasMismatchedCasing)return t;for(let l=0;l<t.length;l++){const e=t[l];if(e.attributes)for(let t=0;t<n.length;t++){const r=n[t],o=s[t];o in e.attributes&&(e.attributes[r]=e.attributes[o],delete e.attributes[o])}}return t}function O(e,t,r,o,n,i,s,a){return E(e,t,r.resources.attributes,o,n,i,s,a)}async function E(t,r,o,n,i,s,a,l){const c=[];for(const e of r)if(e&&i.includes(e.name)){const r=`${t}/nodes/${o}/attributes/${e.key}/0`;c.push({url:r,storageInfo:e})}const u=await Promise.allSettled(c.map(t=>e(t.url,{responseType:"array-buffer",query:{...a,token:s},signal:l?.signal}).then(e=>g(t.storageInfo,e.data)))),f=[];for(const e of n){const t={};for(let r=0;r<u.length;r++){const o=u[r];if("fulfilled"===o.status){const n=o.value;t[c[r].storageInfo.name]=b(n,e)}}f.push(t)}return f}function V(e){const t=e.store,o=t.indexCRS||t.geographicCRS,n=void 0===o?t.indexWKT:void 0;if(n){if(!e.spatialReference)throw new r("layerview:no-store-spatial-reference-wkt-index-and-no-layer-spatial-reference","Found indexWKT in the scene layer store but no layer spatial reference",{});if(n!==e.spatialReference.wkt)throw new r("layerview:store-spatial-reference-wkt-index-incompatible","The indexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const i=o?new c(T(o)):e.spatialReference;return i.equals(e.spatialReference)?e.spatialReference:i}function $(e){const t=e.store,o=t.vertexCRS||t.projectedCRS,n=void 0===o?t.vertexWKT:void 0;if(n){if(!e.spatialReference)throw new r("layerview:no-store-spatial-reference-wkt-vertex-and-no-layer-spatial-reference","Found vertexWKT in the scene layer store but no layer spatial reference",{});if(n!==e.spatialReference.wkt)throw new r("layerview:store-spatial-reference-wkt-vertex-incompatible","The vertexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const i=o?new c(T(o)):e.spatialReference;return i.equals(e.spatialReference)?e.spatialReference:i}function z(e,t,r){if(!l(e,t))throw I("scene layer",e?.wkid,t?.wkid);if("local"===r&&!D(e,t))throw I("scene layer",e?.wkid,t?.wkid)}function Q(e,t,o){if(e.serviceUpdateTimeStamp?.lastUpdate!==t.serviceUpdateTimeStamp?.lastUpdate||!o.isEmpty||e.associatedLayer?.url!==t.associatedLayer?.url)throw new r("layerview:recycle-failed","Could not recycle layerview")}function D(e,t){return e.equals(t)||e.isWGS84&&t.isWebMercator||e.isWebMercator&&t.isWGS84}function Z(e,t,r){const o=V(e),n=$(e);z(o,t,r),z(n,t,r)}function H(e){return(null==e.geometryType||"triangles"===e.geometryType)&&((null==e.topology||"PerAttributeArray"===e.topology)&&null!=e.vertexAttributes?.position)}function J(e){if(null==e.store?.defaultGeometrySchema||!H(e.store.defaultGeometrySchema))throw new r("scenelayer:unsupported-geometry-schema","The geometry schema of this scene layer is not supported.",{url:e.parsedUrl.path})}function N(e,t){Z(e,t.spatialReference,t.viewingMode)}function X(e){return null!=e.geometryType&&"points"===e.geometryType&&((null==e.topology||"PerAttributeArray"===e.topology)&&((null==e.encoding||""===e.encoding||"lepcc-xyz"===e.encoding)&&null!=e.vertexAttributes?.position))}function Y(e){if(null==e.store?.defaultGeometrySchema||!X(e.store.defaultGeometrySchema))throw new r("pointcloud:unsupported-geometry-schema","The geometry schema of this point cloud scene layer is not supported.",{})}function _(e,t){z(e.spatialReference,t.spatialReference,t.viewingMode)}function ee(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type}function te(e){return"mesh-3d"===e.type}function re(e){if(null==e||!ee(e))return!0;if(("unique-value"===e.type||"class-breaks"===e.type)&&null==e.defaultSymbol)return!0;const t=e.symbols;if(0===t.length)return!0;for(const r of t){if(!te(r)||0===r.symbolLayers.length)return!0;for(const e of r.symbolLayers.items)if("fill"!==e.type||null==e.material?.color||"replace"!==e.material.colorMixMode)return!0}return!1}const oe=v({color:[0,0,0,0],opacity:0});class ne{constructor(){this.edgeMaterial=null,this.material=null,this.castShadows=!0}}function ie(e){const t=new ne;let r=!1,o=!1;for(const n of e.symbolLayers.items)if("fill"===n.type&&n.enabled){const e=n.material,i=n.edges;if(null!=e&&!r){const o=e.color,i=S(e.colorMixMode),s={strength:e.emissive?.strength??j,source:"color"===e.emissive?.source?1:0};t.material=null!=o?{color:[o.r/255,o.g/255,o.b/255],alpha:o.a,colorMixMode:i,emissive:s}:{color:[1,1,1],alpha:1,colorMixMode:1,emissive:s},t.castShadows=n.castShadows,r=!0}null==i||o||(t.edgeMaterial=x(i,{}),o=!0)}return t.material||(t.material={color:[1,1,1],alpha:1,colorMixMode:1,emissive:{strength:j,source:0}}),t}function se(e,t){return(0|e)+(0|t)|0}function ae(e,t,r,n,a,l,c){if(!l||0===l.length||null==t||!e.serviceMbsInIndexSR)return null;const f=w(e.serviceMbsInIndexSR,a,"none",r,t);o(de,f);let h=null;const y=()=>{if(!h)if(h=le,p(ue),null!=e.serviceObbInIndexSR){e.serviceObbInIndexSR.transform(fe,r,t,a,c),fe.getCorners(h);for(const e of h)i(e,e,de),m(ue,e)}else{const o=e.serviceMbsInIndexSR;if(!o)return;const n=o.radius;u(o.center,r,pe,t),i(pe,pe,de),pe[2]+=a;for(let e=0;e<8;++e){const t=1&e?n:-n,r=2&e?n:-n,o=4&e?n:-n,i=h[e];s(i,[pe[0]+t,pe[1]+r,pe[2]+o]),m(ue,i)}}};let g=1/0,b=-1/0;const v=e=>{if("replace"!==e.type)return;const r=e.geometry;if(!r?.hasZ)return;p(ce);const o=r.spatialReference||n,s=r.rings.reduce((e,r)=>r.reduce((e,r)=>(u(r,o,pe,t),i(pe,pe,de),m(ce,pe),Math.min(pe[2],e)),e),1/0);y(),d(ue,ce)&&(g=Math.min(g,s),b=Math.max(b,s))};if(l.forEach(e=>v(e)),g===1/0)return null;const x=(e,t,r)=>{i(pe,r,f),e[t]=pe[0],e[t+1]=pe[1],e[t+2]=pe[2],t+=24,r[2]=g,i(pe,r,f),e[t]=pe[0],e[t+1]=pe[1],e[t+2]=pe[2],t+=24,r[2]=b,i(pe,r,f),e[t]=pe[0],e[t+1]=pe[1],e[t+2]=pe[2]};for(let o=0;o<8;++o)x(me.data,3*o,h[o]);return R(me)}const le=[a(),a(),a(),a(),a(),a(),a(),a()],ce=f(),ue=f(),fe=new M,pe=a(),me={data:new Array(72),size:3,exclusive:!0,stride:3},de=n();export{ne as SymbolInfo,se as addWraparound,_ as checkPointCloudLayerCompatibleWithView,Y as checkPointCloudLayerValid,Q as checkRecyclable,N as checkSceneLayerCompatibleWithView,J as checkSceneLayerValid,z as checkSpatialReference,Z as checkSpatialReferences,ae as computeVisibilityObb,k as containsDraco,T as extractWkid,W as filterInPlace,q as findFieldsCaseInsensitive,U as findIntersectingNodes,A as getClipRect,V as getIndexCrs,ie as getSymbolInfo,$ as getVertexCrs,L as intersectBoundingRectWithMbs,D as isSupportedLocalModeProjection,C as objectIdFilter,E as queryAttributesFromCachedAttributesId,re as rendererNeedsTextures,oe as transparentEdgeMaterial,F as whenGraphicAttributes};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as r}from"tslib";import i from"../../../../core/Logger.js";import{property as e,subclass as s}from"../../../../core/accessorSupport/decorators.js";import n from"../../../../core/sql/WhereClause.js";import{findFieldsCaseInsensitive as o}from"../i3s/I3SUtil.js";const t=t=>{const l=t;let d=class extends l{constructor(){super(...arguments),this._definitionExpressionErrors=0,this._maxDefinitionExpressionErrors=20,this.logError=r=>{this._definitionExpressionErrors<this._maxDefinitionExpressionErrors&&i.getLogger(this).error("Error while evaluating definitionExpression: "+r),this._definitionExpressionErrors++,this._definitionExpressionErrors===this._maxDefinitionExpressionErrors&&i.getLogger(this).error("Further errors are ignored")}}get parsedDefinitionExpression(){if(!this.i3slayer?.definitionExpression)return null;try{const r=n.create(this.i3slayer.definitionExpression,{fieldsIndex:this.i3slayer.fieldsIndex});if(!r.isStandardized)return i.getLogger(this).error("definitionExpression is using non standard function"),null;const e=[],s=r.fieldNames;return o(s,this.i3slayer.fieldsIndex,{missingFields:e}),e.length>0?(i.getLogger(this).error(`definitionExpression references unknown fields: ${e.join(", ")}`),null):(this._definitionExpressionErrors=0,r)}catch(r){return i.getLogger(this).error("Failed to parse definitionExpression: "+r),null}}get definitionExpressionFields(){return this.parsedDefinitionExpression?this.parsedDefinitionExpression.fieldNames:[]}_evaluateClause(r,i){if(null==r)return!0;try{return r.testFeature(i)}catch(e){return this.logError(e),!1}}_addDefinitionExpressionToQuery(r){if(!this.parsedDefinitionExpression)return r;const i=this.i3slayer.definitionExpression,e=r.clone();return e.where?e.where=`(${i}) AND (${e.where})`:e.where=i,e}};return r([e({readOnly:!0})],d.prototype,"parsedDefinitionExpression",null),r([e({readOnly:!0})],d.prototype,"definitionExpressionFields",null),d=r([s("esri.views.3d.layers.support.DefinitionExpressionSceneLayerView")],d),d};export{t as DefinitionExpressionSceneLayerView};
2
+ import{__decorate as r}from"tslib";import e from"../../../../core/Logger.js";import{property as i,subclass as s}from"../../../../core/accessorSupport/decorators.js";import n from"../../../../core/sql/WhereClause.js";import{findFieldsCaseInsensitive as o}from"../i3s/I3SUtil.js";const t=t=>{const l=t;let d=class extends l{constructor(){super(...arguments),this._definitionExpressionErrors=0,this._maxDefinitionExpressionErrors=20,this.logError=r=>{this._definitionExpressionErrors<this._maxDefinitionExpressionErrors&&e.getLogger(this).error("Error while evaluating definitionExpression: "+r),this._definitionExpressionErrors++,this._definitionExpressionErrors===this._maxDefinitionExpressionErrors&&e.getLogger(this).error("Further errors are ignored")}}get parsedDefinitionExpression(){if(!this.layer?.definitionExpression)return null;try{const r=n.create(this.layer.definitionExpression,{fieldsIndex:this.layer.fieldsIndex});if(!r.isStandardized)return e.getLogger(this).error("definitionExpression is using non standard function"),null;const i=[],s=r.fieldNames;return o(s,this.layer.fieldsIndex,{missingFields:i}),i.length>0?(e.getLogger(this).error(`definitionExpression references unknown fields: ${i.join(", ")}`),null):(this._definitionExpressionErrors=0,r)}catch(r){return e.getLogger(this).error("Failed to parse definitionExpression: "+r),null}}get definitionExpressionFields(){return this.parsedDefinitionExpression?this.parsedDefinitionExpression.fieldNames:[]}_evaluateClause(r,e){if(null==r)return!0;try{return r.testFeature(e)}catch(i){return this.logError(i),!1}}_addDefinitionExpressionToQuery(r){if(!this.parsedDefinitionExpression)return r;const e=this.layer.definitionExpression,i=r.clone();return i.where?i.where=`(${e}) AND (${i.where})`:i.where=e,i}};return r([i({readOnly:!0})],d.prototype,"parsedDefinitionExpression",null),r([i({readOnly:!0})],d.prototype,"definitionExpressionFields",null),d=r([s("esri.views.3d.layers.support.DefinitionExpressionSceneLayerView")],d),d};export{t as DefinitionExpressionSceneLayerView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{property as e,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{getTimeOperator as i}from"../../../../layers/graphics/data/timeSupport.js";import n from"../../../../layers/support/FeatureFilter.js";import{combineTimeExtent as s}from"../../../../layers/support/timeSupport.js";import{getCachedAttributeValue as l}from"../i3s/I3SBinaryReader.js";import{filterInPlace as o}from"../i3s/I3SUtil.js";const u=i=>{const l=i;let o=class extends l{get timeExtent(){return s(this.i3slayer,this.view?.timeExtent,this._get("timeExtent"))}get mergedFilter(){const{filter:t,timeExtent:e}=this;if(null==e)return t;const r=t?.clone()??new n;return null!=e&&(r.timeExtent=r.timeExtent?.intersection(e)??e),r}getTimeFilterDependencies(){const{timeInfo:t}=this.i3slayer;if(null==t)return[];const{startField:e,endField:r}=t;return[e,r]}addTimeFilter(t,e){if(null==e)return;const{timeInfo:r}=this.i3slayer;if(null==r)return;const{startField:i,endField:n,useTime:s}=r;if(!s||null==i&&null==n)return;const l=r.toJSON(),o=e.toJSON();t.push((t,e)=>a(t,e,l,o))}};return t([e({readOnly:!0})],o.prototype,"timeExtent",null),t([e()],o.prototype,"mergedFilter",null),o=t([r("esri.views.3d.layers.support.TemporalSceneLayerView")],o),o};function a(t,e,r,n){const s=e.attributeInfo?.attributeData;if(null==s)return;const{startTimeField:l,endTimeField:u}=r;if(!!(null!=l&&null==s[l]||null!=u&&null==s[u]))return;const a=i(r,n,new m(s));if(null==a)return;const{featureIds:p}=e;o(t,p,a)}class m{constructor(t){this.attributeData=t}getAttribute(t,e){return l(this.attributeData[e],t)}getAttributeAsTimestamp(t,e){const r=this.getAttribute(t,e);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}}export{u as TemporalSceneLayerView};
2
+ import{__decorate as t}from"tslib";import{property as e,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{getTimeOperator as i}from"../../../../layers/graphics/data/timeSupport.js";import n from"../../../../layers/support/FeatureFilter.js";import{combineTimeExtent as s}from"../../../../layers/support/timeSupport.js";import{getCachedAttributeValue as l}from"../i3s/I3SBinaryReader.js";import{filterInPlace as o}from"../i3s/I3SUtil.js";const u=i=>{const l=i;let o=class extends l{get timeExtent(){return s(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get mergedFilter(){const{filter:t,timeExtent:e}=this;if(null==e)return t;const r=t?.clone()??new n;return null!=e&&(r.timeExtent=r.timeExtent?.intersection(e)??e),r}getTimeFilterDependencies(){const{timeInfo:t}=this.layer;if(null==t)return[];const{startField:e,endField:r}=t;return[e,r]}addTimeFilter(t,e){if(null==e)return;const{timeInfo:r}=this.layer;if(null==r)return;const{startField:i,endField:n,useTime:s}=r;if(!s||null==i&&null==n)return;const l=r.toJSON(),o=e.toJSON();t.push((t,e)=>a(t,e,l,o))}};return t([e({readOnly:!0})],o.prototype,"timeExtent",null),t([e()],o.prototype,"mergedFilter",null),o=t([r("esri.views.3d.layers.support.TemporalSceneLayerView")],o),o};function a(t,e,r,n){const s=e.attributeInfo?.attributeData;if(null==s)return;const{startTimeField:l,endTimeField:u}=r;if(!!(null!=l&&null==s[l]||null!=u&&null==s[u]))return;const a=i(r,n,new m(s));if(null==a)return;const{featureIds:p}=e;o(t,p,a)}class m{constructor(t){this.attributeData=t}getAttribute(t,e){return l(this.attributeData[e],t)}getAttributeAsTimestamp(t,e){const r=this.getAttribute(t,e);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}}export{u as TemporalSceneLayerView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clamp as t}from"../../../core/mathUtils.js";import{ElevationSamplerData as a}from"../../../layers/support/ElevationSamplerData.js";import{bilerp as o}from"../support/mathUtils.js";import{elevationNoDataValue as i}from"./TerrainConst.js";class e{constructor(t,o,i){this.type="elevation",this.level=t[0],this.i=t[1],this.j=t[2],this.extent=o,this.samplerData=new a(i,o)}computeMinMaxValue(t,a,e,s){s.minElevation=1/0,s.maxElevation=-1/0,s.hasNoDataValues=!1;const l=t-this.level;if(l<=0)return s;const r=2**l;if(!(Math.floor(a/r)===this.i&&Math.floor(e/r)===this.j))return s;let n=1/0,h=-1/0;const f=this.samplerData.data.width,m=this.samplerData.data.values,u=.5*i;let c=(f-1)/r,p=(e-this.j*r)*c,M=(a-this.i*r)*c;if(c<1){const t=Math.floor(p),a=Math.floor(M),i=t+a*f,e=m[i],l=m[i+1],r=m[i+f],n=m[i+f+1];if(e+l+r+n<u){const i=p-t,h=M-a,f=o(e,l,r,n,i,h),m=o(e,l,r,n,i+c,h),u=o(e,l,r,n,i,h+c),v=o(e,l,r,n,i+c,h+c);return s.minElevation=Math.min(f,m,u,v),s.maxElevation=Math.max(f,m,u,v),s}p=t,M=a,c=1}else p=Math.floor(p),M=Math.floor(M),c=Math.ceil(c);for(let o=p;o<=p+c;o++)for(let t=M;t<=M+c;t++){const a=m[o+t*f];a<u?(n=Math.min(n,a),h=Math.max(h,a)):s.hasNoDataValues=!0}return s.minElevation=n,s.maxElevation=h,s}}const s=.5*i;function l(a,o,i){if(null==i)return null;for(const e of i){if(!e)continue;const i=e.safeWidth;let l=t(e.dy*(e.y1-o),0,i),r=t(e.dx*(a-e.x0),0,i);const n=Math.floor(l),h=Math.floor(r),f=e.data.width,m=n*f+h,u=e.data.values,c=u[m],p=u[m+1],M=m+f,v=u[M],x=u[M+1];if(c+v+p+x<s){l-=n,r-=h;const t=c+(p-c)*r;return t+(v+(x-v)*r-t)*l}}return null}export{e as ElevationData,l as sampleElevation};
2
+ import{clamp as t}from"../../../core/mathUtils.js";import{ElevationSamplerData as a}from"../../../layers/support/ElevationSamplerData.js";import{bilerp as o}from"../support/mathUtils.js";import{elevationNoDataValue as i}from"./TerrainConst.js";class n{constructor(t,o,i){this.type="elevation",this.level=t[0],this.i=t[1],this.j=t[2],this.extent=o,this.samplerData=new a(i,o)}computeMinMaxValue(t,a,n,e){e.minElevation=1/0,e.maxElevation=-1/0,e.hasNoDataValues=!1;const l=t-this.level;if(l<=0)return e;const r=2**l;if(!(Math.floor(a/r)===this.i&&Math.floor(n/r)===this.j))return e;let s=1/0,h=-1/0;const f=this.samplerData.data.width,u=this.samplerData.data.values,m=.5*i;let c=(f-1)/r,p=(n-this.j*r)*c,M=(a-this.i*r)*c;if(c<1){const t=Math.floor(p),a=Math.floor(M),i=t+a*f,n=u[i],l=u[i+1],r=u[i+f],s=u[i+f+1];if(n+l+r+s<m){const i=p-t,h=M-a,f=o(n,l,r,s,i,h),u=o(n,l,r,s,i+c,h),m=o(n,l,r,s,i,h+c),v=o(n,l,r,s,i+c,h+c);return e.minElevation=Math.min(f,u,m,v),e.maxElevation=Math.max(f,u,m,v),e}p=t,M=a,c=1}else p=Math.floor(p),M=Math.floor(M),c=Math.ceil(c);for(let o=p;o<=p+c;o++)for(let t=M;t<=M+c;t++){const a=u[o+t*f];a<m?(s=Math.min(s,a),h=Math.max(h,a)):e.hasNoDataValues=!0}return e.minElevation=s,e.maxElevation=h,e}}const e=.5*i;function l(t,a,o){if(null==o)return null;for(const i of o){if(!i)continue;const o=r(t,a,i);if(null!=o)return o}return null}function r(a,o,i){const n=i.safeWidth;let l=t(i.dy*(i.y1-o),0,n),r=t(i.dx*(a-i.x0),0,n);const s=Math.floor(l),h=Math.floor(r),f=i.data.width,u=s*f+h,m=i.data.values,c=m[u],p=m[u+1],M=u+f,v=m[M],x=m[M+1];if(c+v+p+x<e){l-=s,r-=h;const t=c+(p-c)*r;return t+(v+(x-v)*r-t)*l}return null}export{n as ElevationData,l as sampleElevation,r as sampleSingleElevation};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clamp as t,isPowerOfTwo as e}from"../../../core/mathUtils.js";import{maxUint16 as n}from"../../../core/typedArrayUtil.js";import{empty as o}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as s}from"../../../geometry/support/aaBoundingRect.js";import{sampleElevation as r}from"./ElevationData.js";import{PatchGeometryLUT as i}from"./PatchGeometryLUT.js";import{zeroToFour as a,neighborTileIfLoadedOrSelf as c}from"./PatchRenderData.js";import{internalAssert as l,enableTerrainInternalChecks as u,neighborEdgeIndices as d,almostEquals as f}from"./terrainUtils.js";import{isCornerNeighbor as m}from"./Tile.js";import{compareTilesByLij as g}from"./tileUtils.js";import{compressNormal as h}from"../webgl-engine/lib/Normals.js";const p=65536;function x(t,e){const{tile:n,geometry:s,geometryState:r}=t,{extentInRadians:i,surface:a}=n,{isWebMercator:c,renderer:l}=a,{numVerticesPerSide:u,wireframe:d}=r,f=u-1,m=(u-2)**2,g=c&&(2===e||3===e),h=c&&(1===e||3===e),p=((g?1:0)+(h?1:0))*mt*u,x=ut(r),S=m+p+4*x,v=l.tileGeometryCache.acquire(S);s.numVerticesPerSide=u,s.vertexAttributes=v,s.maxEdgeVertexCount=x;const{boundingBox:V}=s;o(V);const B=P(t);ot.update(f,i,B),y(t),s.poleVerticesStartIndex=m;const b=M(t,g,h);s.edgeVerticesStartIndex=m+p,Q(t),I(t),W(s,b,d),t.intersectionData=null}function M(t,e,o){const{tile:s,localOrigin:r,geometry:i}=t,{extent:a,ellipsoid:c}=s,{boundingBox:l,numVerticesPerSide:u,vertexAttributes:d,poleVerticesStartIndex:f}=i,m=u-1,g=r[0],p=r[1],x=r[2],M=c.radius,y=a[1],S=a[3],v=[];let V=f;const I=(t,e)=>{const o=e*u;lt(-g,-p,t*M-x,l),v.push(new et(1===t,o,1===t?0:2,V,mt));const s=C(-1===t?y:S,M),r=t*Math.PI/2-s,i=.99*(1===t?1:-1),a=M+0,{position:c,uv0:f}=d,{typedBuffer:I,typedBufferStride:B}=d.normalCompressed;for(let u=1;u<=mt;++u){const t=s+r*(u/mt),e=Math.cos(t),o=Math.sin(t);for(let s=0;s<=m;s++){const t=s/m,r=ot.sinLonLUT[s],u=ot.cosLonLUT[s]*e,d=r*e,M=o,y=u*a-g,S=d*a-p,v=M*a-x;lt(y,S,v,l),c.setValues(V,y,S,v),f.setValues(V,Math.round(t*n),Math.round(i*n)),h(I,V,u,d,M,B),++V}}};return e&&I(-1,0),o&&I(1,m),v}function y(t){const{tile:e}=t;if(!e.intersectsClippingArea)return;const{geometry:o,geometryState:s,localOrigin:i}=t,{numVerticesPerSide:a,samplerData:c}=s,l=a-2,u=a-1,{vertexAttributes:d,boundingBox:f}=o,{position:m,uv0:g}=d,{typedBuffer:p,typedBufferStride:x}=d.normalCompressed,{extent:M}=e,y=M[0],S=M[2],v=M[1],V=M[3],I=e.ellipsoid.radius,B=i[0],b=i[1],C=i[2],L=m.typedBuffer,A=m.typedBufferStride,P=1/u;let D=0;if(1<=l){const t=P,e=v*(1-t)+V*t,o=ot.sinLatLUT[1],s=ot.cosLatLUT[1];for(let i=1;i<=l;i++){const a=i*P,l=y*(1-a)+S*a,u=ot.sinLonLUT[i],d=ot.cosLonLUT[i],m=I+r(l,e,c),h=m*d*s-B,p=m*u*s-b,x=m*o-C;lt(h,p,x,f);const M=(i-1)*A;L[M]=h,L[M+1]=p,L[M+2]=x,g.setValues(i-1,Math.round(a*n),Math.round(t*n))}}for(let E=1;E<=l;E++){const t=E*P,e=v*(1-t)+V*t,o=ot.sinLatLUT[E],s=ot.cosLatLUT[E],i=E+1,a=i*P,d=v*(1-a)+V*a,m=ot.sinLatLUT[i],M=ot.cosLatLUT[i],T=ot.sinLonLUT[0],O=ot.cosLonLUT[0],R=I+r(y,e,c);let U=O*s*R-B,w=T*s*R-b,N=o*R-C;const j=D*A;let F=L[j],q=L[j+1],W=L[j+2];for(let V=1;V<=l;V++){const t=V*P,i=y*(1-t)+S*t,T=ot.sinLonLUT[V],O=ot.cosLonLUT[V];let R=0,j=0,k=0;if(V<l){const t=(D+1)*A;R=L[t],j=L[t+1],k=L[t+2]}else{const t=ot.sinLonLUT[u],n=ot.cosLonLUT[u],i=I+r(S,e,c);R=n*s*i-B,j=t*s*i-b,k=o*i-C}const z=U,G=w,H=N;U=F,w=q,N=W,F=R,q=j,W=k;const J=R-z,K=j-G,Q=k-H;let X=0,Y=0,Z=0;if(E>1){const t=(D-l)*A;X=L[t],Y=L[t+1],Z=L[t+2]}else{const t=ot.sinLatLUT[0],e=ot.cosLatLUT[0],n=I+r(i,v,c);X=O*e*n-B,Y=T*e*n-b,Z=t*n-C}const $=I+r(i,d,c),_=O*M*$-B,tt=T*M*$-b,et=m*$-C;if(E<l){const e=D+l,o=e*A;L[o]=_,L[o+1]=tt,L[o+2]=et,lt(_,tt,et,f),g.setValues(e,Math.round(t*n),Math.round(a*n))}const nt=X-_,st=Y-tt,rt=Z-et;let it=O*s,at=T*s,ct=o;ct*ct<.999&&(it=Q*st-K*rt,at=J*rt-Q*nt,ct=K*nt-J*st);const ut=1/Math.sqrt(it*it+at*at+ct*ct);h(p,D,it*ut,at*ut,ct*ut,x),++D}}}function S(t){t.tile.intersectsClippingArea&&(I(t),_(t),t.intersectionData=null)}function v(t){t.tile.intersectsClippingArea&&(X(t),I(t),_(t),tt(t),t.intersectionData=null)}function V(t){t.tile.intersectsClippingArea&&(b(t),B(t,!0),_(t),t.intersectionData=null)}function I(t){t.tile.intersectsClippingArea&&(b(t),B(t))}function B(t,o=!1){const{geometry:s,geometryState:i,tile:a,localOrigin:m}=t,{level:h,extent:p,extentInRadians:x,ellipsoid:M}=a,y=M.radius,S=x[0],v=x[2],V=x[1],I=x[3],{samplerData:B}=i,b=p[0],C=p[2],L=p[1],A=p[3],D=P(t),{boundingBox:E,vertexAttributes:T}=s,O=m[0],R=m[1],U=m[2],{position:w,uv0:N}=T,j=w.typedBuffer,F=w.typedBufferStride;for(let P=0;P<4;++P){const m=1===P||3===P,x=i.edgeResolutions[P];l(e(x));const M=x+1,T=c(a,i.edgePeerNeighbors[P]);if(it(a,T,P)){Y(t,P,T);continue}const w=null!=T;l(!w||T.level===a.level),l(!w||g(a,T)<=0);const q=T?.renderData,W=q?.geometryState;if(u){const t=a.surface;if(!T&&t&&!t.updatingRootTiles){const e=d[P],n=a.findNeighborTile(e,t=>t.loaded||t.leaf||t.level===a.level);n?n.intersectsClippingArea&&(l(!n.loaded),l(!n.leaf),l(n.level===h)):l(null==t?.rootTiles||!a.shouldHaveNeighbor(e))}}const k=1===P?p[2]:p[0],z=T?.extent,G=z&&m?1===P?z[0]:z[2]:k,H=0===P?p[3]:p[1],J=1===P?1:0,K=0===P?1:0,Q=1===P?v:S,X=0===P?I:V,Z=Math.sin(Q),$=Math.cos(Q),_=Math.sin(X),tt=Math.cos(X),et=W?.samplerData,nt=w?(t,e,n)=>.5*(r(t,e,B)+r(n,e,et)):(t,e,n)=>r(t,e,B),ot=s.outerEdgesOffsetAndLength[2*P+0],st=o&&M>3?M-3:1,rt=null!=B&&B.some(t=>null!=t),at=null!=et&&et.some(t=>null!=t),ct=rt||at,ut=1/x,dt=ot;l(!z||f(z[2]-z[0],p[2]-p[0]));(()=>{const t=1===P?-1:3===P?1:0,e=0===P?-1:2===P?1:0,o=(p[2]-p[0])*ut,i=t*o,a=e*o,c=m?t*((v-S)*ut):0,l=m?0:e*ut,u=K,d=m?Q+c:Q,f=m?Math.sin(d):Z,g=m?Math.cos(d):$,h=m?Q-c:Q,x=m?Math.sin(h):Z,V=m?Math.cos(h):$,I=m?X:D(u+l),T=m?_:Math.sin(I),q=m?tt:Math.cos(I),W=m?X:D(u-l),z=m?_:Math.sin(W),Y=m?tt:Math.cos(W);let ot=0,rt=0,it=0;{const t=0*ut,e=m?k:b*(1-t)+C*t,n=m?G:e,o=m?L*(1-t)+A*t:H,s=m?Q:S*(1-t)+v*t,r=m?Z:Math.sin(s),i=m?$:Math.cos(s),a=m?D(t):X,c=m?Math.sin(a):_,l=m?Math.cos(a):tt,u=y+nt(e,o,n);ot=i*l*u,rt=r*l*u,it=c*u}let at=0,ft=0,mt=0;{const t=1*ut,e=m?k:b*(1-t)+C*t,n=m?G:e,o=m?L*(1-t)+A*t:H,s=m?Q:S*(1-t)+v*t,r=m?Z:Math.sin(s),i=m?$:Math.cos(s),a=m?D(t):X,c=m?Math.sin(a):_,l=m?Math.cos(a):tt,u=y+nt(e,o,n);at=i*l*u,ft=r*l*u,mt=c*u}for(let p=1;p<M-1;p+=st){let t=0,e=0,o=0;{const n=(p+1)*ut,s=m?k:b*(1-n)+C*n,r=m?G:s,i=m?L*(1-n)+A*n:H,a=m?Q:S*(1-n)+v*n,c=m?Z:Math.sin(a),l=m?$:Math.cos(a),u=m?D(n):X,d=m?Math.sin(u):_,f=m?Math.cos(u):tt,g=y+nt(s,i,r);t=l*f*g,e=c*f*g,o=d*g}const c=t,l=e,u=o,d=at,h=ft,M=mt;at=c,ft=l,mt=u;{const t=dt+p,e=t*F,o=d-O,s=h-R,r=M-U;j[e]=o,j[e+1]=s,j[e+2]=r,lt(o,s,r,E);const i=p*ut,a=m?J:i,c=m?i:K;N.setValues(t,Math.round(a*n),Math.round(c*n))}const I=ot,W=rt,st=it;ot=d,rt=h,it=M;const gt=d,ht=h,pt=M,xt=1/Math.sqrt(gt*gt+ht*ht+pt*pt),Mt=pt*xt;let yt=0,St=0,vt=0;if(ct&&Mt*Mt<.999){let t=0,e=0,n=0;{const o=0===P?-1:1;t=o*(c-I),e=o*(l-W),n=o*(u-st)}{const o=p*ut,s=m?k:b*(1-o)+C*o,c=m?G:s,l=m?L*(1-o)+A*o:H,u=m?Q:S*(1-o)+v*o,d=m?Z:Math.sin(u),h=m?$:Math.cos(u),M=m?D(o):X,I=m?Math.sin(M):_,E=m?Math.cos(M):tt;let O=gt,R=ht,U=pt;if(w){const t=y+r(c-i,l-a,et),e=m?E:Y;O=(m?V:h)*e*t,R=(m?x:d)*e*t,U=(m?I:z)*t}{const o=y+r(s+i,l+a,B),c=m?E:q,u=(m?g:h)*c*o,p=(m?f:d)*c*o,x=(m?I:T)*o;w||(O=2*gt-u,R=2*ht-p,U=2*pt-x);const M=3===P?-1:1,S=M*(O-u),v=M*(R-p),V=M*(U-x);yt=n*v-e*V,St=t*V-n*S,vt=e*S-t*v;const b=1/Math.sqrt(yt*yt+St*St+vt*vt);yt*=b,St*=b,vt*=b}}}else yt=gt*xt,St=ht*xt,vt=pt*xt;s.setEdgeNormalFromValues(P,p,yt,St,vt)}})()}}function b(t){Z(t)}function C(t,e){return Math.PI/2-2*Math.atan(Math.exp(-t/e))}function L(t,e,n,o){return C(t*(1-o)+e*o,n)}function A(t,e,n){return t*(1-n)+e*n}function P(t){const{tile:e}=t;if(e.surface.isWebMercator){const t=e.extent,n=e.ellipsoid.radius;return e=>L(t[1],t[3],n,e)}const n=e.extentInRadians;return t=>A(n[1],n[3],t)}function D(t,e){const{tile:n,geometryState:s,geometry:r}=t,{extent:i,surface:a}=n,{wireframe:c}=s,l=i[0],u=i[1],d=i[2]-l,f=i[3]-u,{numVerticesPerSide:m,clippingArea:g}=s,h=null!=g?Math.max(0,(g[0]-l)/d):0,p=null!=g?Math.max(0,(g[1]-u)/f):0,x=null!=g?Math.min(1,(g[2]-l)/d):1,M=null!=g?Math.min(1,(g[3]-u)/f):1,y=(m-2)**2,S=ut(s),v=y+4*S,V=a.renderer.tileGeometryCache.acquire(v),{boundingBox:I}=r;o(I),r.numVerticesPerSide=m,r.vertexAttributes=V,r.maxEdgeVertexCount=S,r.minu=h,r.minv=p,r.maxu=x,r.maxv=M,E(t),r.edgeVerticesStartIndex=y,Q(t),U(t),W(r,[],c),t.intersectionData=null}function E(e){const o=e.tile;if(!o.intersectsClippingArea)return;const{geometry:s,geometryState:i,localOrigin:a}=e,{samplerData:c,clippingArea:l,numVerticesPerSide:u}=i,{surface:d,extent:f,ellipsoid:m}=o,{isWebMercatorOnPlateCarree:g}=d,p=null!=l?l:st,x=f[0],M=f[1],y=f[2],S=f[3],v=Math.max(x,p[0]),V=Math.min(y,p[2]),I=Math.max(M,p[1]),B=Math.min(S,p[3]),b=m.radius,C=o.horizontalScale,L=u-1,A=u-2,{minu:P,minv:D,maxu:E,maxv:T,boundingBox:O,vertexAttributes:R}=s,{position:U,uv0:w}=R,{typedBuffer:N,typedBufferStride:j}=R.normalCompressed,F=a[0],q=a[1],W=a[2],k=U.typedBuffer,z=U.typedBufferStride;let G=0;const H=t(M,I,B),J=g?(Math.PI/2-2*Math.atan(Math.exp(-H/b)))*b:H*C,K=1/L,Q=t(M*(1-K)+S*K,I,B);let X=J,Y=g?(Math.PI/2-2*Math.atan(Math.exp(-Q/b)))*b:Q*C;for(let Z=1;Z<=A;Z++){const e=Z/L,o=t(M*(1-e)+S*e,I,B),s=t(e,D,T),i=Y,a=(Z-1)/L,l=t(M*(1-a)+S*a,I,B),u=X,d=(Z+1)/L,f=t(M*(1-d)+S*d,I,B),m=g?(Math.PI/2-2*Math.atan(Math.exp(-f/b)))*b:f*C,p=t(d,D,T);X=Y,Y=m;const R=t(x,v,V);let U=R*C,H=r(R,o,c);const J=1/L,K=t(J,P,E),Q=t(x*(1-K)+y*K,v,V);let $=K,_=Q,tt=Q*C,et=r(Q,o,c);if(1===Z){const e=tt-F,o=X-q,r=et-W,i=0*z;k[i]=e,k[i+1]=o,k[i+2]=r,lt(e,o,r,O);const a=t(J,P,E);w.setValues(G,Math.round(a*n),Math.round(s*n))}for(let g=1;g<=A;g++){const e=tt,a=et,d=(g+1)/L,M=t(d,P,E),S=t(x*(1-d)+y*d,v,V),I=_;_=S;{const t=G+1,e=t*z;if(1===Z||g===A){const a=S*C,l=r(S,o,c);if(1===Z&&g<A){const o=a-F,r=i-q,c=l-W;k[e]=o,k[e+1]=r,k[e+2]=c,lt(o,r,c,O),w.setValues(t,Math.round(M*n),Math.round(s*n))}tt=a,et=l}else tt=k[e]+F,et=k[e+2]+W}const B=tt,b=et,D=U,T=H;U=e,H=a;const R=(G-A)*z,J=1===Z?r(I,l,c):k[R+2]+W,K=r(I,f,c);if(Z<A){const t=G+A,o=t*z,s=e-F,r=m-q,i=K-W;k[o]=s,k[o+1]=r,k[o+2]=i,lt(s,r,i,O);const a=$;$=M,w.setValues(t,Math.round(a*n),Math.round(p*n))}{const t=B-D,e=u-m,n=e*(b-T),o=t*(J-K),s=-e*t,r=n*n+o*o+s*s;if(0===r)h(N,G,0,0,1,j);else{const t=1/Math.sqrt(r);h(N,G,n*t,o*t,s*t,j)}}++G}}}function T(t,e){t.tile.intersectsClippingArea&&(N(t),w(t,!0),_(t),t.intersectionData=null)}function O(t,e){t.tile.intersectsClippingArea&&(X(t),U(t),_(t),tt(t),t.intersectionData=null)}function R(t,e){t.tile.intersectsClippingArea&&(U(t),_(t),t.intersectionData=null)}function U(t,e){t.tile.intersectsClippingArea&&(N(t),w(t,!1))}function w(n,o){const{geometry:s,geometryState:i,localOrigin:a}=n,f=n.tile,{surface:m,extent:h}=f,{clippingArea:p,samplerData:x}=i,M=null!=p?p:st,y=h[0],S=h[2],v=h[1],V=h[3],I=[V>M[3],S>M[2],v<M[1],y<M[0]],B=f.horizontalScale,b=q(m.isWebMercatorOnPlateCarree,f.ellipsoid.radius,B),{minu:C,minv:L,maxu:A,maxv:P,boundingBox:D}=s,E=Math.max(y,M[0]),T=Math.min(S,M[2]),O=Math.max(v,M[1]),R=Math.min(V,M[3]),U=a[0],w=a[1],N=a[2];for(let j=0;j<4;++j){const a=1===j||3===j,h=i.edgeResolutions[j];l(e(h));const p=h+1,M=I[j],F=c(f,i.edgePeerNeighbors[j]);if(!M&&it(f,F,j)){Y(n,j,F);continue}const q=null!=F&&!M,W=F?.renderData,k=W?.geometryState;if(u&&(l(!q||F.level===f.level),l(!q||g(f,F)<=0),f&&!F&&!m.updatingRootTiles)){const t=d[j],e=f.findNeighborTile(t,t=>t.loaded||t.leaf||t.level===f.level);m.updatingRootTiles||(e?e.intersectsClippingArea&&(l(!e.loaded),l(!e.leaf),l(e.level===f.level)):l(null==m?.rootTiles||!f.shouldHaveNeighbor(t)))}const z=t(1===j?S:y,E,T),G=t(0===j?V:v,O,R),H=k?.samplerData,J=o&&p>3?p-3:1,K=t(1===j?1:0,C,A),Q=t(0===j?1:0,L,P),X=q?(t,e)=>.5*(r(t,e,H)+r(t,e,x)):(t,e)=>r(t,e,x),Z=(S-y)/h,$=a?1===j?Z:-Z:0,_=a?0:0===j?Z:-Z,tt=-$,et=-_;let nt=0,ot=0,st=0;{const e=0/h,n=a?z:t(y*(1-e)+S*e,E,T),o=a?t(v*(1-e)+V*e,O,R):G,s=X(n,o);nt=n*B,ot=b(o),st=s}let rt=0,at=0,ct=0;{const e=1/h,n=a?z:t(y*(1-e)+S*e,E,T),o=a?t(v*(1-e)+V*e,O,R):G,s=X(n,o);rt=n*B,at=b(o),ct=s}for(let e=1;e<p-1;e+=J){const n=e/h,o=rt,i=at,c=ct;{const r=a?K:t(n,C,A),l=a?t(n,L,P):Q,u=o-U,d=i-w,f=c-N;lt(o,d,f,D),s.setEdgeVertexFromValuesRawPositionUV(j,e,u,d,f,r,l)}{const n=(e+1)/h,o=a?z:t(y*(1-n)+S*n,E,T),s=a?t(v*(1-n)+V*n,O,R):G,r=X(o,s);rt=o*B,at=b(s),ct=r}const l=rt,u=ct,d=nt,f=ot,m=st;nt=o,ot=i,st=c;let g=0,p=0,M=0;if(a){const e=at-i,s=u-c,a=f-i,l=m-c,d=t(v*(1-n)+V*n,O,R),h=z+tt,y=h*B-o,S=r(h,d,x)-c,I=3===j?-1:1;if(g=I*(-a+e)*S,p=I*y*(-l+s),M=-I*y*(-a+e),q){const t=z+$,n=t*B-o;g=(-a+e)*(S-(r(t,d,H)-c)),p=(y-n)*(-l+s),M=-(y-n)*(-a+e)}}else{const e=l-o,s=u-c,a=d-o,f=m-c,h=t(y*(1-n)+S*n,E,T),v=G+et,V=r(h,v,x)-c,I=b(v)-i,B=2===j?-1:1;if(g=B*I*(-f+s),p=B*(-a+e)*V,M=-B*I*(-a+e),q){const t=h,n=G+_,o=b(n)-i;g=(-I+o)*(-f+s),p=(-a+e)*(-V+(r(t,n,H)-c)),M=-(-I+o)*(-a+e)}}const I=1/Math.sqrt(g*g+p*p+M*M);s.setEdgeNormalFromValues(j,e,g*I,p*I,M*I)}}}function N(t,e){Z(t)}function j(t,e){return(Math.PI/2-2*Math.atan(Math.exp(-t/e)))*e}function F(t,e){return t*e}function q(t,e,n){return t?t=>j(t,e):t=>F(t,n)}function W(t,e,n){const{numVerticesPerSide:o,vertexAttributes:s,maxEdgeVertexCount:r}=t,i=o-1,c=s.count,l=2*(o-3)*(o-3),u=4*(i+r-3),d=a.reduce((e,n)=>e+(i+t.getEdgeCount(n)-3),0),f=e.reduce((t,e)=>t+i*(2*(e.latitudeResolution-1)+1),0),m=3*(n?2:1),g=(l+u+f)*m,h=c>=p?new Uint32Array(g):new Uint16Array(g);for(let a=0;a<g;++a)h[a]=0;t.indices=h,t.indexCount=(l+d+f)*m,t.poleIndicesStartIndex=l*m,t.edgeIndicesStartIndex=(l+f)*m,n?(H(t),J(t,e),K(t)):(k(t),z(t,e),G(t))}function k(t){const{numVerticesPerSide:e,indices:n,vertexAttributes:o}=t,{position:s}=o,{typedBuffer:r,typedBufferStride:i}=s,a=e-2,c=e-3,l=0,u=e-3;let d=0;for(let f=0;f<c;++f){const t=f*a;for(let e=l;e<u;++e){const o=t+e,s=o+1,c=s+a,l=c-1;dt(o,s,c,l,i,r)?(n[d]=o,n[d+1]=s,n[d+2]=c,n[d+3]=c,n[d+4]=l,n[d+5]=o):(n[d]=o,n[d+1]=s,n[d+2]=l,n[d+3]=l,n[d+4]=s,n[d+5]=c),d+=6}}}function z(t,e){const{numVerticesPerSide:n,indices:o,poleIndicesStartIndex:s}=t,r=n-1;let i=s;for(const a of e){const e=a.isNorth?1:2,s=a.isNorth?2:1,c=a.isNorth?3:4,l=a.isNorth?4:3;let u=t.getEdgeVertexIndex(a.connectedOuterEdgeOffset,0),d=1;for(let t=0;t<a.latitudeResolution;++t){const f=0===t?a.rowOffset:u+n;for(let n=0;n<r;n++){const r=f+n;o[i]=u,o[i+e]=u+1,o[i+s]=r,t<a.latitudeResolution-1?(o[i+c]=u+1,o[i+l]=r+1,o[i+5]=r,i+=6):i+=3,u+=d}u=f,d=1}}}function G(t){const{indices:e,numVerticesPerSide:n,edgeIndicesStartIndex:o}=t,s=n-1,r=s-2;let i=o;for(let a=0;a<4;++a){const n=ct[a];let o=0,c=0;const u=t.getEdgeCount(a),d=n.count;l(d===s-1);const f=1===a||2===a,m=f?1:2,g=f?2:1,h=t.getEdgeFirstVertexIndex(a),p=1,x=n.vertex0Index,M=n.stride;for(;o<u-1||c<d-1;){const t=x+c*M,n=h+o*p,a=o<u-1,l=c<d-1,f=a&&(!l||(a?0+s*(o+.5)/(u-1):0)<=(l?1+r*(c+.5)/(d-1):0));f?++o:++c;const y=f?n+p:t+M;e[i]=t,e[i+m]=n,e[i+g]=y,i+=3}}t.indexCount=i}function H(t){const{indices:e,numVerticesPerSide:n,vertexAttributes:o}=t,{position:s}=o,{typedBuffer:r,typedBufferStride:i}=s,a=n-2;let c=0;for(let l=0;l<n-3;++l){const t=l*a;for(let o=0;o<n-3;++o){const n=l*a+o,s=n+1,u=s+a,d=u-1,f=t+o,m=f+1,g=m+a;dt(f,m,g,g-1,i,r)?(ft(e,c,n,s,u),c+=6,ft(e,c,u,d,n)):(ft(e,c,n,s,d),c+=6,ft(e,c,d,u,s)),c+=6}}}function J(t,e){const{indices:n,numVerticesPerSide:o,poleIndicesStartIndex:s}=t,r=o-1;let i=s;for(const a of e){const e=a.connectedOuterEdgeOffset;let s=t.getEdgeVertexIndex(e,0),c=1;for(let t=0;t<a.latitudeResolution;++t){const e=0===t?a.rowOffset:s+o;for(let o=0;o<r;o++)ft(n,i,s,s+1,e+o),i+=6,t<a.latitudeResolution-1&&(ft(n,i,s+1,e+o+1,e+o),i+=6),s+=c;s=e,c=1}}}function K(t){const{indices:e,numVerticesPerSide:n,edgeIndicesStartIndex:o}=t,s=n-1,r=s-2;let i=o;for(let a=0;a<4;++a){const n=ct[a];let o=0,c=0;const u=t.getEdgeCount(a),d=n.count;l(d===s-1);const f=1===a||2===a,m=f?1:3,g=f?3:1,h=t.getEdgeFirstVertexIndex(a),p=1,x=n.vertex0Index,M=n.stride;for(;o<u-1||c<d-1;){const t=x+c*M,n=h+o*p,a=o<u-1,l=c<d-1,f=a&&(!l||(a?0+s*(o+.5)/(u-1):0)<=(l?1+r*(c+.5)/(d-1):0));f?++o:++c;const y=f?n+p:t+M;e[i]=t,e[i+m]=n,e[i+m+1]=n,e[i+g]=y,e[i+g+1]=y,e[i+5]=t,i+=6}}t.indexCount=i}function Q(t){const{geometry:e,geometryState:n}=t,{edgeResolutions:o}=n,{numVerticesPerSide:s,edgeVerticesStartIndex:r}=e,i=s-2;let a=r;for(let c=0;c<4;++c){{const t=0===c||2===c,e=(0===c?i-1:0)*i+(1===c?i-1:0),n=(t?0:1)*i+(t?1:0),o=ct[c];o.vertex0Index=e,o.stride=n,o.count=i}{const t=o[c]+1;e.outerEdgesOffsetAndLength[2*c+0]=a,e.outerEdgesOffsetAndLength[2*c+1]=t,a+=t}}}function X(t){Q(t),t.geometryState.wireframe?K(t.geometry):G(t.geometry)}function Y(o,s,r){const{geometryState:i,geometry:a,tile:c,localOrigin:u}=o,d=1===s||3===s,f=i.edgeResolutions[s];l(e(f));const m=f+1,{boundingBox:g,minu:h,minv:p,maxu:x,maxv:M,vertexAttributes:y}=a,S=t(1===s?1:0,h,x),v=t(0===s?1:0,p,M),V=r.renderData,I=V.geometryState,B=V.geometry,b=(s+2)%4,C=B.getEdgeCount(b),L=c.getNeighborEdgeStartVertexIndex(s,r)*f,A=f*2**(c.level-r.level);l(I.edgeResolutions[b]===A),l(C-1===A);const P=V.localOrigin[0]-u[0],D=V.localOrigin[1]-u[1],E=V.localOrigin[2]-u[2],T=a.getEdgeFirstVertexIndex(s),{position:O,uv0:R}=y,U=O.typedBuffer,w=O.typedBufferStride,N=y.normalCompressed,j=N.typedBuffer,F=N.typedBufferStride,q=B.vertexAttributes,W=B.getEdgeFirstVertexIndex(b),k=q.position.typedBuffer,z=q.position.typedBufferStride,G=q.normalCompressed.typedBuffer,H=q.normalCompressed.typedBufferStride;for(let e=1;e<m-1;++e){const o=T+e,s=W+(L+e),r=o*w,i=s*z,a=k[i]+P,c=k[i+1]+D,l=k[i+2]+E;U[r]=a,U[r+1]=c,U[r+2]=l,lt(a,c,l,g);const u=o*F,m=s*H;j[u]=G[m],j[u+1]=G[m+1];const y=e/f,V=d?S:t(y,h,x),I=d?t(y,p,M):v;R.setValues(o,Math.round(V*n),Math.round(I*n))}}function Z(e){const{geometry:o,geometryState:s,localOrigin:i}=e,{clippingArea:a,samplerData:c}=s,{minu:u,minv:d,maxu:f,maxv:m,boundingBox:h,vertexAttributes:p}=o,x=e.tile,{surface:M,ellipsoid:y,extent:S,extentInRadians:v,horizontalScale:V}=x,I="local"===M.view?.viewingMode,B=y.radius;let b=0,C=0,L=0;const A=(t,e,n)=>{const o=v[0===e?1:3],s=v[0===t?0:2],r=Math.cos(o),i=Math.sin(o),a=Math.sin(s),c=Math.cos(s),l=B+n;b=c*r*l,C=a*r*l,L=i*l},D=I?(()=>{const e=a,n=null!=e&&(S[3]>e[3]||S[2]>e[2]||S[1]<e[1]||S[0]<e[0]),o=q(M.isWebMercatorOnPlateCarree,B,V);return(s,r,i)=>{const a=0===s?S[0]:S[2],c=0===r?S[1]:S[3],l=n?t(a,e[0],e[2]):a,u=n?t(c,e[1],e[3]):c,d=i;b=l*V,C=o(u),L=d}})():A;let E=0,T=0,O=0,R=0,U=0,w=0,N=0,j=0,F=0;const W=I&&M.isWebMercatorOnPlateCarree,k=(t,e,n,o,s)=>{let r=0,i=0,a=0;if(I){const t=e*V,s=W?(Math.PI/2-2*Math.atan(Math.exp(-n/B)))*B:n*V;r=t-b,i=s-C,a=o-L}else{const s=P(t),c=t.tile,l=c.extent,u=c.extentInRadians,d=(e-l[0])/(l[2]-l[0]),f=(n-l[1])/(l[3]-l[1]),m=u[0]*(1-d)+u[2]*d,g=s(f),h=Math.cos(g),p=Math.sin(g),x=Math.sin(m),M=Math.cos(m),y=B+o;r=M*h*y-b,i=x*h*y-C,a=p*y-L}switch(s){case 0:N+=r,j+=i,F+=a;break;case 1:R-=r,U-=i,w-=a;break;case 2:N-=r,j-=i,F-=a;break;case 3:R+=r,U+=i,w+=a}},z=a??st,G=S[0],H=S[2],J=S[1],K=S[3],Q=[K>z[3],H>z[2],J<z[1],G<z[0]],X=Math.max(G,z[0]),Y=Math.min(H,z[2]),Z=Math.max(J,z[1]),_=Math.min(K,z[3]),tt=t=>Math.max(z[0],Math.min(z[2],t)),et=t=>Math.max(z[1],Math.min(z[3],t)),ot=t=>{const e=s.cornerNeighborCornerTiles;E=0,T=0,O=1,R=0,U=0,w=0,N=0,j=0,F=0;let n=1/0;for(let s=0;s<4;++s){const o=e[4*t+s];n=Math.min(n,o?.level??1/0)}for(let s=0;s<4;++s){const o=e[4*t+s];rt[s]=o?.level===n?o:null}let o=1,i=0;for(let s=0;s<4;++s){const t=rt[s];t&&(o=Math.max(o,t?.renderData.geometryState.numVerticesPerSide),i=t.extent[2]-t.extent[0])}const a=i,c=o;l(c>1);const u=a/c;for(let s=0;s<4;++s){const t=rt[(s+3)%4],e=rt[s%4];if(!t&&!e)continue;const n=0===s?1:1===s?2:2===s?3:0,o=0===s?2:1===s?3:2===s?0:1;if(t&&e){const i=nt[s][0]*u,a=nt[s][1]*u,c=t.extent,l=tt(c[0===n||1===n?2:0]+i),d=et(c[0===n||3===n?3:1]+a),f=e.extent,m=tt(f[0===o||1===o?2:0]+i),g=et(f[0===o||3===o?3:1]+a),h=t.renderData,p=e.renderData,x=r(l,d,h.geometryState.samplerData),M=r(m,g,p.geometryState.samplerData);k(h,l,d,.5*(x+M),s)}else{const i=t??e,a=t?n:o,c=i.extent,l=nt[s],d=tt(c[0===a||1===a?2:0]+l[0]*u),f=et(c[0===a||3===a?3:1]+l[1]*u),m=i.renderData,g=r(d,f,m.geometryState.samplerData);k(m,d,f,g,s)}}if(!I){const t=Math.sqrt(b*b+C*C+L*L);E=b/t,T=C/t,O=L/t}if(I||O*O<.999){const t=Math.sqrt(R*R+U*U+w*w);R/=t,U/=t,w/=t;const e=Math.sqrt(N*N+j*j+F*F);N/=e,j/=e,F/=e,E=w*j-U*F,T=R*F-w*N,O=U*N-R*j;const n=1/Math.sqrt(E*E+T*T+O*O);E*=n,T*=n,O*=n}},it=s.cornerNeighborCornerTiles;for(let P=0;P<4;++P){const e=P,a=(P+1)%4,M=0===P||1===P?1:0,y=0===P||3===P?1:0,S=t(M,u,f),v=t(y,d,m),V=o.getEdgeFirstVertexIndex(e),I=o.getEdgeCount(e),B=0===P||3===P?I-1:0,A=o.getEdgeFirstVertexIndex(a),R=o.getEdgeCount(a),U=0===P||1===P?R-1:0;let w=-1;for(let t=0;t<4;++t){const e=it[4*P+t],n=it[4*P+w];e&&(-1===w||g(n,e)>0)&&(w=t)}const N=w,j=it[4*P+N];if(j!==x){const t=x.level-j.level,e=2**t,o=[j.lij[0]+t,j.lij[1]*e,j.lij[2]*e],r=[o[1]+e===x.lij[1],0===P&&(1===N||0===N&&j!==it[4*P+3])||1===P&&(0===N||1===N&&j!==it[4*P+2]),o[1]===x.lij[1]+1,2===P&&(3===N||2===N&&j!==it[4*P+1])||3===P&&(2===N||3===N&&j!==it[4*P+0])],a=r.reduce((t,e)=>t+(e?1:0),0);l(1===a||2===a);let c=-1,u=-1;const d=j.renderData;if(1===a){const t=r.findIndex(t=>t);l(0<=t&&t<=3),c=(t+2)%4;const e=s.edgeResolutions[t];u=x.getNeighborEdgeStartVertexIndex(t,j)*e+e*(0===t&&0===P||1===t&&0===P||2===t&&1===P||3===t&&3===P?1:0)}else{l(r[1]||r[3]),c=r[1]?3:1;const t=d.geometryState.edgeResolutions[c];u=0===P||3===P?0:t}const f=d.geometry;{const t=V+B,e=A+U,o=f.getEdgeFirstVertexIndex(c)+u,s=f.vertexAttributes,r=d.localOrigin,a=s.position,l=a.typedBuffer,m=o*a.typedBufferStride,g=l[m]+r[0]-i[0],x=l[m+1]+r[1]-i[1],M=l[m+2]+r[2]-i[2];lt(g,x,M,h);const y=p.position,I=y.typedBuffer,b=t*y.typedBufferStride;I[b]=g,I[b+1]=x,I[b+2]=M;const C=e*y.typedBufferStride;I[C]=g,I[C+1]=x,I[C+2]=M;const L=p.uv0;L.setValues(t,Math.round(S*n),Math.round(v*n)),L.setValues(e,Math.round(S*n),Math.round(v*n));{const n=s.normalCompressed.typedBuffer,r=o*s.normalCompressed.typedBufferStride,i=p.normalCompressed,a=i.typedBuffer;{const e=t*i.typedBufferStride;a[e]=n[r],a[e+1]=n[r+1]}{const t=e*i.typedBufferStride;a[t]=n[r],a[t+1]=n[r+1]}}}}else{const n=Q[e],s=Q[a];let l;if(n||s){const e=t(G*(1-M)+H*M,X,Y),n=t(J*(1-y)+K*y,Z,_);l=r(e,n,c)}else l=$(it,P);D(M,y,l),ot(P);const u=b-i[0],d=C-i[1],f=L-i[2];lt(u,d,f,h),o.setEdgeVertexFromValuesRawPositionUVNormal(e,B,u,d,f,S,v,E,T,O),o.setEdgeVertexFromValuesRawPositionUVNormal(a,U,u,d,f,S,v,E,T,O)}}for(let t=0;t<4;++t)rt[t]=null}function $(t,e){const n=4*e,o=a.reduce((e,o)=>Math.min(e,t[n+o]?.level??1/0),1/0);u&&(l(!t[n+0]||!t[n+2]||m(t[n+0],t[n+2],5)),l(!t[n+1]||!t[n+3]||m(t[n+1],t[n+3],7)));let s=0,i=0;for(let a=0;a<4;++a){const e=t[n+a];if(e?.level===o){const t=0===a||1===a,n=0===a||3===a,o=e.extent,c=o[t?0:2],l=o[n?1:3],u=e.renderData?.geometryState?.samplerData;i+=r(c,l,u),s++}}const c=s?i/s:0;return l(null!=c),c}function _(t){const{vao:e,geometry:n}=t,{vertexAttributes:o,edgeVerticesStartIndex:s}=n,r=o.position.typedBuffer;e.buffer()?.setSubData(r,s,s,r.length)}function tt(t){const{vao:e,geometry:n}=t,{indices:o,indexCount:s,edgeIndicesStartIndex:r}=n;e.indexBuffer.setSubData(o,r,r,s)}class et{constructor(t,e,n,o,s){this.isNorth=t,this.connectedRowOffset=e,this.connectedOuterEdgeOffset=n,this.rowOffset=o,this.latitudeResolution=s}}const nt=[[0,1],[1,0],[0,-1],[-1,0]],ot=new i,st=s(-1/0,-1/0,1/0,1/0),rt=[null,null,null,null];function it(t,e,n){if(!e)return!1;const o=g(t,e);return o>0||0===o&&n>=2}class at{constructor(){this.vertex0Index=0,this.stride=1,this.count=0}getVertexIndex(t){return l(0<=t&&t<this.count),this.vertex0Index+this.stride*t}}const ct=[new at,new at,new at,new at];function lt(t,e,n,o){t<o[0]?o[0]=t:t>o[3]&&(o[3]=t),e<o[1]?o[1]=e:e>o[4]&&(o[4]=e),n<o[2]?o[2]=n:n>o[5]&&(o[5]=n)}function ut(t){const{edgeResolutions:e,numVerticesPerSide:n}=t,o=1+Math.max(...e);return Math.max(n,o)}function dt(t,e,n,o,s,r){const i=t*s,a=r[i],c=r[i+1],l=r[i+2],u=e*s,d=r[u],f=r[u+1],m=r[u+2],g=n*s,h=r[g],p=r[g+1],x=r[g+2],M=o*s,y=r[M],S=r[M+1],v=r[M+2];return(d-y)*(d-y)+(f-S)*(f-S)+(m-v)*(m-v)>(a-h)*(a-h)+(c-p)*(c-p)+(l-x)*(l-x)}function ft(t,e,n,o,s){t[e]=n,t[e+1]=o,t[e+2]=o,t[e+3]=s,t[e+4]=s,t[e+5]=n}const mt=6;export{D as createPlanarGlobePatch,x as createSphericalGlobePatch,V as updateCornerSpherical,T as updateCornersPlanar,O as updateEdgeElevationsAndResolutionsPlanar,v as updateEdgeElevationsAndResolutionsSpherical,R as updateEdgesAndCornersPlanar,S as updateEdgesAndCornersSpherical};
2
+ import{clamp as t,isPowerOfTwo as e}from"../../../core/mathUtils.js";import{maxUint16 as n}from"../../../core/typedArrayUtil.js";import{empty as o}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as s}from"../../../geometry/support/aaBoundingRect.js";import{sampleElevation as r,sampleSingleElevation as i}from"./ElevationData.js";import{PatchGeometryLUT as a}from"./PatchGeometryLUT.js";import{zeroToFour as c,neighborTileIfLoadedOrSelf as l}from"./PatchRenderData.js";import{maxPatchTesselation as u,elevationNoDataValue as d}from"./TerrainConst.js";import{internalAssert as f,enableTerrainInternalChecks as m,neighborEdgeIndices as g,almostEquals as h}from"./terrainUtils.js";import{isCornerNeighbor as p}from"./Tile.js";import{compareTilesByLij as x}from"./tileUtils.js";import{compressNormal as M}from"../webgl-engine/lib/Normals.js";const y=65536;function S(t,e){const{tile:n,geometry:s,geometryState:r}=t,{extentInRadians:i,surface:a}=n,{isWebMercator:c,renderer:l}=a,{numVerticesPerSide:u,wireframe:d}=r,f=u-1,m=(u-2)**2,g=c&&(2===e||3===e),h=c&&(1===e||3===e),p=((g?1:0)+(h?1:0))*Ct*u,x=Vt(r),M=m+p+4*x,y=l.tileGeometryCache.acquire(M);s.numVerticesPerSide=u,s.vertexAttributes=y,s.maxEdgeVertexCount=x;const{boundingBox:S}=s;o(S);const B=R(t);ut.update(f,i,B),v(t),s.poleVerticesStartIndex=m;const V=L(t,g,h);s.edgeVerticesStartIndex=m+p,et(t),A(t),Q(s,V,d),t.intersectionData=null}function L(t,e,o){const{tile:s,localOrigin:r,geometry:i}=t,{extent:a,ellipsoid:c}=s,{boundingBox:l,numVerticesPerSide:u,vertexAttributes:d,poleVerticesStartIndex:f}=i,m=u-1,g=r[0],h=r[1],p=r[2],x=c.radius,y=a[1],S=a[3],L=[];let v=f;const B=(t,e)=>{const o=e*u;Bt(-g,-h,t*x-p,l),L.push(new ct(1===t,o,1===t?0:2,v,Ct));const s=E(-1===t?y:S,x),r=t*Math.PI/2-s,i=.99*(1===t?1:-1),a=x+0,{position:c,uv0:f}=d,{typedBuffer:B,typedBufferStride:V}=d.normalCompressed;for(let u=1;u<=Ct;++u){const t=s+r*(u/Ct),e=Math.cos(t),o=Math.sin(t);for(let s=0;s<=m;s++){const t=s/m,r=ut.sinLonLUT[s],u=ut.cosLonLUT[s]*e,d=r*e,x=o,y=u*a-g,S=d*a-h,L=x*a-p;Bt(y,S,L,l),c.setValues(v,y,S,L),f.setValues(v,Math.round(t*n),Math.round(i*n)),M(B,v,u,d,x,V),++v}}};return e&&B(-1,0),o&&B(1,m),L}function v(t){const e=t.geometryState.samplerData,n=1===e?.length?e[0]:null;n?B(t,n):V(t)}function B(t,e){const{tile:n}=t;if(!n.intersectsClippingArea)return;const{geometry:o,geometryState:s,localOrigin:r}=t,{numVerticesPerSide:i}=s,a=i-2,c=i-1,{vertexAttributes:l,boundingBox:u}=o,{position:d,uv0:f}=l,{typedBuffer:m,typedBufferStride:g}=l.normalCompressed,{extent:h}=n,p=n.ellipsoid.radius,x=r[0],y=r[1],S=r[2],L=d.typedBuffer,v=d.typedBufferStride,B=f.typedBuffer,V=f.typedBufferStride;I(c,h,e);let C=0;const T=e.data.values;if(1<=a){const t=ft[1],e=ut.sinLatLUT[1],n=ut.cosLatLUT[1];for(let o=1;o<=a;o++){const s=ut.sinLonLUT[o],r=ut.cosLonLUT[o],i=p+b(o,1,T),a=i*r*n-x,c=i*s*n-y,l=i*e-S;Bt(a,c,l,u);const d=(o-1)*v;L[d]=a,L[d+1]=c,L[d+2]=l;const f=(o-1)*V;B[f]=ft[o],B[f+1]=t}}for(let I=1;I<=a;I++){const t=ut.sinLatLUT[I],e=ut.cosLatLUT[I],n=I+1,o=ft[n],s=ut.sinLatLUT[n],r=ut.cosLatLUT[n],i=ut.sinLonLUT[0],l=ut.cosLonLUT[0],d=p+b(0,I,T);let f=l*e*d-x,h=i*e*d-y,U=t*d-S;const A=C*v;let P=L[A],D=L[A+1],E=L[A+2];for(let w=1;w<=a;w++){const i=ut.sinLonLUT[w],l=ut.cosLonLUT[w];let d=0,A=0,O=0;if(w<a){const t=(C+1)*v;d=L[t],A=L[t+1],O=L[t+2]}else{const n=ut.sinLonLUT[c],o=ut.cosLonLUT[c],s=p+b(c,I,T);d=o*e*s-x,A=n*e*s-y,O=t*s-S}const R=f,N=h,j=U;f=P,h=D,U=E,P=d,D=A,E=O;const F=d-R,q=A-N,W=O-j;let k=0,z=0,G=0;if(I>1){const t=(C-a)*v;k=L[t],z=L[t+1],G=L[t+2]}else{const t=ut.sinLatLUT[0],e=ut.cosLatLUT[0],n=p+b(w,0,T);k=l*e*n-x,z=i*e*n-y,G=t*n-S}const H=p+b(w,n,T),J=l*r*H-x,K=i*r*H-y,Q=s*H-S;if(I<a){const t=C+a,e=t*v;L[e]=J,L[e+1]=K,L[e+2]=Q,Bt(J,K,Q,u);const n=t*V;B[n]=ft[w],B[n+1]=o}const X=k-J,Y=z-K,Z=G-Q;let $=l*e,_=i*e,tt=t;tt*tt<.999&&($=W*Y-q*Z,_=F*Z-W*X,tt=q*X-F*Y);const et=1/Math.sqrt($*$+_*_+tt*tt);M(m,C,$*et,_*et,tt*et,g),++C}}}function V(t){const{tile:e}=t;if(!e.intersectsClippingArea)return;const{geometry:o,geometryState:s,localOrigin:i}=t,{numVerticesPerSide:a,samplerData:c}=s,l=a-2,u=a-1,{vertexAttributes:d,boundingBox:f}=o,{position:m,uv0:g}=d,{typedBuffer:h,typedBufferStride:p}=d.normalCompressed,{extent:x}=e,y=x[0],S=x[2],L=x[1],v=x[3],B=e.ellipsoid.radius,V=i[0],I=i[1],b=i[2],C=m.typedBuffer,T=m.typedBufferStride,U=1/u;let A=0;if(1<=l){const t=U,e=L*(1-t)+v*t,o=ut.sinLatLUT[1],s=ut.cosLatLUT[1];for(let i=1;i<=l;i++){const a=i*U,l=y*(1-a)+S*a,u=ut.sinLonLUT[i],d=ut.cosLonLUT[i],m=B+r(l,e,c),h=m*d*s-V,p=m*u*s-I,x=m*o-b;Bt(h,p,x,f);const M=(i-1)*T;C[M]=h,C[M+1]=p,C[M+2]=x,g.setValues(i-1,Math.round(a*n),Math.round(t*n))}}for(let P=1;P<=l;P++){const t=P*U,e=L*(1-t)+v*t,o=ut.sinLatLUT[P],s=ut.cosLatLUT[P],i=P+1,a=i*U,d=L*(1-a)+v*a,m=ut.sinLatLUT[i],x=ut.cosLatLUT[i],D=ut.sinLonLUT[0],E=ut.cosLonLUT[0],w=B+r(y,e,c);let O=E*s*w-V,R=D*s*w-I,N=o*w-b;const j=A*T;let F=C[j],q=C[j+1],W=C[j+2];for(let v=1;v<=l;v++){const t=v*U,i=y*(1-t)+S*t,D=ut.sinLonLUT[v],E=ut.cosLonLUT[v];let w=0,j=0,k=0;if(v<l){const t=(A+1)*T;w=C[t],j=C[t+1],k=C[t+2]}else{const t=ut.sinLonLUT[u],n=ut.cosLonLUT[u],i=B+r(S,e,c);w=n*s*i-V,j=t*s*i-I,k=o*i-b}const z=O,G=R,H=N;O=F,R=q,N=W,F=w,q=j,W=k;const J=w-z,K=j-G,Q=k-H;let X=0,Y=0,Z=0;if(P>1){const t=(A-l)*T;X=C[t],Y=C[t+1],Z=C[t+2]}else{const t=ut.sinLatLUT[0],e=ut.cosLatLUT[0],n=B+r(i,L,c);X=E*e*n-V,Y=D*e*n-I,Z=t*n-b}const $=B+r(i,d,c),_=E*x*$-V,tt=D*x*$-I,et=m*$-b;if(P<l){const e=A+l,o=e*T;C[o]=_,C[o+1]=tt,C[o+2]=et,Bt(_,tt,et,f),g.setValues(e,Math.round(t*n),Math.round(a*n))}const nt=X-_,ot=Y-tt,st=Z-et;let rt=E*s,it=D*s,at=o;at*at<.999&&(rt=Q*ot-K*st,it=J*st-Q*nt,at=K*nt-J*ot);const ct=1/Math.sqrt(rt*rt+it*it+at*at);M(h,A,rt*ct,it*ct,at*ct,p),++A}}}function I(e,o,s){const r=o[0],i=o[2],a=o[1],c=o[3],l=1/e,{dx:u,dy:d,x0:f,y1:m,safeWidth:g}=s,h=s.data.width;for(let p=0;p<=e;p++){const e=p*l,o=t(u*(r*(1-e)+i*e-f),0,g),s=Math.floor(o);mt[p]=s,pt[p]=o-s;const x=t(d*(m-(a*(1-e)+c*e)),0,g),M=Math.floor(x);gt[p]=M*h,ht[p]=(M+1)*h,xt[p]=x-M,ft[p]=Math.round(e*n)}}function b(t,e,n){const o=mt[t],s=pt[t],r=gt[e],i=ht[e],a=xt[e],c=r+o,l=n[c],u=n[c+1],d=n[i+o],f=n[i+o+1];if(l+d+u+f>=dt)return 0;const m=l+(u-l)*s;return m+(d+(f-d)*s-m)*a}function C(t){t.tile.intersectsClippingArea&&(A(t),it(t),t.intersectionData=null)}function T(t){t.tile.intersectsClippingArea&&(nt(t),A(t),it(t),at(t),t.intersectionData=null)}function U(t){t.tile.intersectsClippingArea&&(D(t),P(t,!0),it(t),t.intersectionData=null)}function A(t){t.tile.intersectsClippingArea&&(D(t),P(t))}function P(t,o=!1){const{geometry:s,geometryState:a,tile:c,localOrigin:u}=t,{level:d,extent:p,extentInRadians:y,ellipsoid:S}=c,L=S.radius,v=y[0],B=y[2],V=y[1],I=y[3],{samplerData:b}=a,C=p[0],T=p[2],U=p[1],A=p[3],P=R(t),{boundingBox:D,vertexAttributes:E}=s,w=u[0],O=u[1],N=u[2],{position:j,uv0:F}=E,q=j.typedBuffer,W=j.typedBufferStride,k=F.typedBuffer,z=F.typedBufferStride,{typedBuffer:G,typedBufferStride:H}=E.normalCompressed,J=1===b?.length?b[0]:null,K=(t,e,n)=>J?i(t,e,J)??0:r(t,e,b)??0;for(let R=0;R<4;++R){const u=1===R||3===R,y=a.edgeResolutions[R];f(e(y));const S=y+1,E=l(c,a.edgePeerNeighbors[R]);if(St(c,E,R)){ot(t,R,E);continue}const j=null!=E;f(!j||E.level===c.level),f(!j||x(c,E)<=0);const F=E?.renderData,Q=F?.geometryState;if(m){const t=c.surface;if(!E&&t&&!t.updatingRootTiles){const e=g[R],n=c.findNeighborTile(e,t=>t.loaded||t.leaf||t.level===c.level);n?n.intersectsClippingArea&&(f(!n.loaded),f(!n.leaf),f(n.level===d)):f(null==t?.rootTiles||!c.shouldHaveNeighbor(e))}}const X=1===R?p[2]:p[0],Y=E?.extent,Z=Y&&u?1===R?Y[0]:Y[2]:X,$=0===R?p[3]:p[1],_=1===R?1:0,tt=0===R?1:0,et=1===R?B:v,nt=0===R?I:V,st=Math.sin(et),rt=Math.cos(et),it=Math.sin(nt),at=Math.cos(nt),ct=Q?.samplerData,lt=1===ct?.length?ct[0]:null,ut=(t,e,n)=>lt?i(n,e,lt)??0:r(n,e,ct)??0,dt=j?(t,e,n)=>.5*(K(t,e)+ut(t,e,n)):K,ft=s.outerEdgesOffsetAndLength[2*R+0],mt=o&&S>3?S-3:1,gt=null!=J||null!=b&&b.some(t=>null!=t),ht=null!=lt||null!=ct&&ct.some(t=>null!=t),pt=gt||ht,xt=1/y,Mt=n*xt,yt=_*n,Lt=tt*n,vt=ft;f(!Y||h(Y[2]-Y[0],p[2]-p[0]));(()=>{const t=1===R?-1:3===R?1:0,e=0===R?-1:2===R?1:0,n=(p[2]-p[0])*xt,o=t*n,s=e*n,a=u?t*((B-v)*xt):0,c=u?0:e*xt,l=tt,d=u?et+a:et,f=u?Math.sin(d):st,m=u?Math.cos(d):rt,g=u?et-a:et,h=u?Math.sin(g):st,x=u?Math.cos(g):rt,y=u?nt:P(l+c),V=u?it:Math.sin(y),I=u?at:Math.cos(y),E=u?nt:P(l-c),F=u?it:Math.sin(E),K=u?at:Math.cos(E);let Q=0,Y=0,_=0;{const t=0*xt,e=u?X:C*(1-t)+T*t,n=u?Z:e,o=u?U*(1-t)+A*t:$,s=u?et:v*(1-t)+B*t,r=u?st:Math.sin(s),i=u?rt:Math.cos(s),a=u?P(t):nt,c=u?Math.sin(a):it,l=u?Math.cos(a):at,d=L+dt(e,o,n);Q=i*l*d,Y=r*l*d,_=c*d}let ot=0,ut=0,ft=0;{const t=1*xt,e=u?X:C*(1-t)+T*t,n=u?Z:e,o=u?U*(1-t)+A*t:$,s=u?et:v*(1-t)+B*t,r=u?st:Math.sin(s),i=u?rt:Math.cos(s),a=u?P(t):nt,c=u?Math.sin(a):it,l=u?Math.cos(a):at,d=L+dt(e,o,n);ot=i*l*d,ut=r*l*d,ft=c*d}for(let p=1;p<S-1;p+=mt){let t=0,e=0,n=0;{const o=(p+1)*xt,s=u?X:C*(1-o)+T*o,r=u?Z:s,i=u?U*(1-o)+A*o:$,a=u?et:v*(1-o)+B*o,c=u?st:Math.sin(a),l=u?rt:Math.cos(a),d=u?P(o):nt,f=u?Math.sin(d):it,m=u?Math.cos(d):at,g=L+dt(s,i,r);t=l*m*g,e=c*m*g,n=f*g}const a=t,c=e,l=n,d=ot,g=ut,y=ft;ot=a,ut=c,ft=l;{const t=vt+p,e=t*W,n=d-w,o=g-O,s=y-N;q[e]=n,q[e+1]=o,q[e+2]=s,Bt(n,o,s,D);const r=Math.round(p*Mt),i=t*z;k[i]=u?yt:r,k[i+1]=u?r:Lt}const S=Q,E=Y,tt=_;Q=d,Y=g,_=y;const mt=d,gt=g,ht=y,St=1/Math.sqrt(mt*mt+gt*gt+ht*ht),Vt=ht*St;let It=0,bt=0,Ct=0;if(pt&&Vt*Vt<.999){let t=0,e=0,n=0;{const o=0===R?-1:1;t=o*(a-S),e=o*(c-E),n=o*(l-tt)}{const a=p*xt,c=u?X:C*(1-a)+T*a,l=u?Z:c,d=u?U*(1-a)+A*a:$,g=u?et:v*(1-a)+B*a,M=u?st:Math.sin(g),y=u?rt:Math.cos(g),S=u?P(a):nt,D=u?Math.sin(S):it,E=u?Math.cos(S):at;let w=mt,O=gt,N=ht;if(j){const t=l-o,e=d-s,n=L+(lt?i(t,e,lt)??0:r(t,e,ct)??0),a=u?E:K;w=(u?x:y)*a*n,O=(u?h:M)*a*n,N=(u?D:F)*n}{const a=c+o,l=d+s,g=L+(J?i(a,l,J)??0:r(a,l,b)??0),h=u?E:I,p=(u?m:y)*h*g,x=(u?f:M)*h*g,S=(u?D:V)*g;j||(w=2*mt-p,O=2*gt-x,N=2*ht-S);const v=3===R?-1:1,B=v*(w-p),C=v*(O-x),T=v*(N-S);It=n*C-e*T,bt=t*T-n*B,Ct=e*B-t*C;const U=1/Math.sqrt(It*It+bt*bt+Ct*Ct);It*=U,bt*=U,Ct*=U}}}else It=mt*St,bt=gt*St,Ct=ht*St;M(G,vt+p,It,bt,Ct,H)}})()}}function D(t){st(t)}function E(t,e){return Math.PI/2-2*Math.atan(Math.exp(-t/e))}function w(t,e,n,o){return E(t*(1-o)+e*o,n)}function O(t,e,n){return t*(1-n)+e*n}function R(t){const{tile:e}=t;if(e.surface.isWebMercator){const t=e.extent,n=e.ellipsoid.radius;return e=>w(t[1],t[3],n,e)}const n=e.extentInRadians;return t=>O(n[1],n[3],t)}function N(t,e){const{tile:n,geometryState:s,geometry:r}=t,{extent:i,surface:a}=n,{wireframe:c}=s,l=i[0],u=i[1],d=i[2]-l,f=i[3]-u,{numVerticesPerSide:m,clippingArea:g}=s,h=null!=g?Math.max(0,(g[0]-l)/d):0,p=null!=g?Math.max(0,(g[1]-u)/f):0,x=null!=g?Math.min(1,(g[2]-l)/d):1,M=null!=g?Math.min(1,(g[3]-u)/f):1,y=(m-2)**2,S=Vt(s),L=y+4*S,v=a.renderer.tileGeometryCache.acquire(L),{boundingBox:B}=r;o(B),r.numVerticesPerSide=m,r.vertexAttributes=v,r.maxEdgeVertexCount=S,r.minu=h,r.minv=p,r.maxu=x,r.maxv=M,j(t),r.edgeVerticesStartIndex=y,et(t),k(t),Q(r,[],c),t.intersectionData=null}function j(e){const o=e.tile;if(!o.intersectsClippingArea)return;const{geometry:s,geometryState:a,localOrigin:c}=e,{samplerData:l,clippingArea:u,numVerticesPerSide:d}=a,{surface:f,extent:m,ellipsoid:g}=o,{isWebMercatorOnPlateCarree:h}=f,p=null!=u?u:Mt,x=m[0],y=m[1],S=m[2],L=m[3],v=Math.max(x,p[0]),B=Math.min(S,p[2]),V=Math.max(y,p[1]),I=Math.min(L,p[3]),b=g.radius,C=o.horizontalScale,T=d-1,U=d-2,{minu:A,minv:P,maxu:D,maxv:E,boundingBox:w,vertexAttributes:O}=s,{position:R,uv0:N}=O,{typedBuffer:j,typedBufferStride:F}=O.normalCompressed,q=c[0],W=c[1],k=c[2],z=R.typedBuffer,G=R.typedBufferStride;let H=0;const J=t(y,V,I),K=h?(Math.PI/2-2*Math.atan(Math.exp(-J/b)))*b:J*C,Q=1/T,X=t(y*(1-Q)+L*Q,V,I);let Y=K,Z=h?(Math.PI/2-2*Math.atan(Math.exp(-X/b)))*b:X*C;const $=1===l?.length?l[0]:null,_=$?(t,e)=>i(t,e,$)??0:(t,e)=>r(t,e,l)??0;for(let r=1;r<=U;r++){const e=r/T,o=t(y*(1-e)+L*e,V,I),s=t(e,P,E),i=Z,a=(r-1)/T,c=t(y*(1-a)+L*a,V,I),l=Y,u=(r+1)/T,d=t(y*(1-u)+L*u,V,I),f=h?(Math.PI/2-2*Math.atan(Math.exp(-d/b)))*b:d*C,m=t(u,P,E);Y=Z,Z=f;const g=t(x,v,B);let p=g*C,O=_(g,o);const R=1/T,J=t(R,A,D),K=t(x*(1-J)+S*J,v,B);let Q=J,X=K,$=K*C,tt=_(K,o);if(1===r){const e=$-q,o=Y-W,r=tt-k,i=0*G;z[i]=e,z[i+1]=o,z[i+2]=r,Bt(e,o,r,w);const a=t(R,A,D);N.setValues(H,Math.round(a*n),Math.round(s*n))}for(let h=1;h<=U;h++){const e=$,a=tt,u=(h+1)/T,g=t(u,A,D),y=t(x*(1-u)+S*u,v,B),L=X;X=y;{const t=H+1,e=t*G;if(1===r||h===U){const a=y*C,c=_(y,o);if(1===r&&h<U){const o=a-q,r=i-W,l=c-k;z[e]=o,z[e+1]=r,z[e+2]=l,Bt(o,r,l,w),N.setValues(t,Math.round(g*n),Math.round(s*n))}$=a,tt=c}else $=z[e]+q,tt=z[e+2]+k}const V=$,I=tt,b=p,P=O;p=e,O=a;const E=(H-U)*G,R=1===r?_(L,c):z[E+2]+k,J=_(L,d);if(r<U){const t=H+U,o=t*G,s=e-q,r=f-W,i=J-k;z[o]=s,z[o+1]=r,z[o+2]=i,Bt(s,r,i,w);const a=Q;Q=g,N.setValues(t,Math.round(a*n),Math.round(m*n))}{const t=V-b,e=l-f,n=e*(I-P),o=t*(R-J),s=-e*t,r=n*n+o*o+s*s;if(0===r)M(j,H,0,0,1,F);else{const t=1/Math.sqrt(r);M(j,H,n*t,o*t,s*t,F)}}++H}}}function F(t,e){t.tile.intersectsClippingArea&&(G(t),z(t,!0),it(t),t.intersectionData=null)}function q(t,e){t.tile.intersectsClippingArea&&(nt(t),k(t),it(t),at(t),t.intersectionData=null)}function W(t,e){t.tile.intersectsClippingArea&&(k(t),it(t),t.intersectionData=null)}function k(t,e){t.tile.intersectsClippingArea&&(G(t),z(t,!1))}function z(n,o){const{geometry:s,geometryState:a,localOrigin:c}=n,u=n.tile,{surface:d,extent:h}=u,{clippingArea:p,samplerData:M}=a,y=null!=p?p:Mt,S=h[0],L=h[2],v=h[1],B=h[3],V=[B>y[3],L>y[2],v<y[1],S<y[0]],I=u.horizontalScale,b=K(d.isWebMercatorOnPlateCarree,u.ellipsoid.radius,I),{minu:C,minv:T,maxu:U,maxv:A,boundingBox:P}=s,D=Math.max(S,y[0]),E=Math.min(L,y[2]),w=Math.max(v,y[1]),O=Math.min(B,y[3]),R=c[0],N=c[1],j=c[2],F=1===M?.length?M[0]:void 0,q=F?(t,e)=>i(t,e,F)??0:(t,e)=>r(t,e,M)??0;for(let W=0;W<4;++W){const c=1===W||3===W,h=a.edgeResolutions[W];f(e(h));const p=h+1,y=V[W],F=l(u,a.edgePeerNeighbors[W]);if(!y&&St(u,F,W)){ot(n,W,F);continue}const k=null!=F&&!y,z=F?.renderData,G=z?.geometryState;if(m&&(f(!k||F.level===u.level),f(!k||x(u,F)<=0),u&&!F&&!d.updatingRootTiles)){const t=g[W],e=u.findNeighborTile(t,t=>t.loaded||t.leaf||t.level===u.level);d.updatingRootTiles||(e?e.intersectsClippingArea&&(f(!e.loaded),f(!e.leaf),f(e.level===u.level)):f(null==d?.rootTiles||!u.shouldHaveNeighbor(t)))}const H=t(1===W?L:S,D,E),J=t(0===W?B:v,w,O),K=G?.samplerData,Q=o&&p>3?p-3:1,X=t(1===W?1:0,C,U),Y=t(0===W?1:0,T,A),Z=1===K?.length?K[0]:null,$=(t,e)=>Z?i(t,e,Z)??0:r(t,e,K)??0,_=k?(t,e)=>.5*($(t,e)+q(t,e)):q,tt=(L-S)/h,et=c?1===W?tt:-tt:0,nt=c?0:0===W?tt:-tt,st=-et,rt=-nt;let it=0,at=0,ct=0;{const e=0/h,n=c?H:t(S*(1-e)+L*e,D,E),o=c?t(v*(1-e)+B*e,w,O):J,s=_(n,o);it=n*I,at=b(o),ct=s}let lt=0,ut=0,dt=0;{const e=1/h,n=c?H:t(S*(1-e)+L*e,D,E),o=c?t(v*(1-e)+B*e,w,O):J,s=_(n,o);lt=n*I,ut=b(o),dt=s}for(let e=1;e<p-1;e+=Q){const n=e/h,o=lt,i=ut,a=dt;{const r=c?X:t(n,C,U),l=c?t(n,T,A):Y,u=o-R,d=i-N,f=a-j;Bt(o,d,f,P),s.setEdgeVertexFromValuesRawPositionUV(W,e,u,d,f,r,l)}{const n=(e+1)/h,o=c?H:t(S*(1-n)+L*n,D,E),s=c?t(v*(1-n)+B*n,w,O):J,r=_(o,s);lt=o*I,ut=b(s),dt=r}const l=lt,u=dt,d=it,f=at,m=ct;it=o,at=i,ct=a;let g=0,p=0,x=0;if(c){const e=ut-i,s=u-a,c=f-i,l=m-a,d=t(v*(1-n)+B*n,w,O),h=H+st,y=h*I-o,S=r(h,d,M)-a,L=3===W?-1:1;if(g=L*(-c+e)*S,p=L*y*(-l+s),x=-L*y*(-c+e),k){const t=H+et,n=t*I-o;g=(-c+e)*(S-(r(t,d,K)-a)),p=(y-n)*(-l+s),x=-(y-n)*(-c+e)}}else{const e=l-o,s=u-a,c=d-o,f=m-a,h=t(S*(1-n)+L*n,D,E),y=J+rt,v=r(h,y,M)-a,B=b(y)-i,V=2===W?-1:1;if(g=V*B*(-f+s),p=V*(-c+e)*v,x=-V*B*(-c+e),k){const t=h,n=J+nt,o=b(n)-i;g=(-B+o)*(-f+s),p=(-c+e)*(-v+(r(t,n,K)-a)),x=-(-B+o)*(-c+e)}}const y=1/Math.sqrt(g*g+p*p+x*x);s.setEdgeNormalFromValues(W,e,g*y,p*y,x*y)}}}function G(t,e){st(t)}function H(t,e){return(Math.PI/2-2*Math.atan(Math.exp(-t/e)))*e}function J(t,e){return t*e}function K(t,e,n){return t?t=>H(t,e):t=>J(t,n)}function Q(t,e,n){const{numVerticesPerSide:o,vertexAttributes:s,maxEdgeVertexCount:r}=t,i=o-1,a=s.count,l=2*(o-3)*(o-3),u=4*(i+r-3),d=c.reduce((e,n)=>e+(i+t.getEdgeCount(n)-3),0),f=e.reduce((t,e)=>t+i*(2*(e.latitudeResolution-1)+1),0),m=3*(n?2:1),g=(l+u+f)*m,h=a>=y?new Uint32Array(g):new Uint16Array(g);for(let c=0;c<g;++c)h[c]=0;t.indices=h,t.indexCount=(l+d+f)*m,t.poleIndicesStartIndex=l*m,t.edgeIndicesStartIndex=(l+f)*m,n?($(t),_(t,e),tt(t)):(X(t),Y(t,e),Z(t))}function X(t){const{numVerticesPerSide:e,indices:n,vertexAttributes:o}=t,{position:s}=o,{typedBuffer:r,typedBufferStride:i}=s,a=e-2,c=e-3,l=0,u=e-3;let d=0;for(let f=0;f<c;++f){const t=f*a;for(let e=l;e<u;++e){const o=t+e,s=o+1,c=s+a,l=c-1;It(o,s,c,l,i,r)?(n[d]=o,n[d+1]=s,n[d+2]=c,n[d+3]=c,n[d+4]=l,n[d+5]=o):(n[d]=o,n[d+1]=s,n[d+2]=l,n[d+3]=l,n[d+4]=s,n[d+5]=c),d+=6}}}function Y(t,e){const{numVerticesPerSide:n,indices:o,poleIndicesStartIndex:s}=t,r=n-1;let i=s;for(const a of e){const e=a.isNorth?1:2,s=a.isNorth?2:1,c=a.isNorth?3:4,l=a.isNorth?4:3;let u=t.getEdgeVertexIndex(a.connectedOuterEdgeOffset,0),d=1;for(let t=0;t<a.latitudeResolution;++t){const f=0===t?a.rowOffset:u+n;for(let n=0;n<r;n++){const r=f+n;o[i]=u,o[i+e]=u+1,o[i+s]=r,t<a.latitudeResolution-1?(o[i+c]=u+1,o[i+l]=r+1,o[i+5]=r,i+=6):i+=3,u+=d}u=f,d=1}}}function Z(t){const{indices:e,numVerticesPerSide:n,edgeIndicesStartIndex:o}=t,s=n-1,r=s-2;let i=o;for(let a=0;a<4;++a){const n=vt[a];let o=0,c=0;const l=t.getEdgeCount(a),u=n.count;f(u===s-1);const d=1===a||2===a,m=d?1:2,g=d?2:1,h=t.getEdgeFirstVertexIndex(a),p=1,x=n.vertex0Index,M=n.stride;for(;o<l-1||c<u-1;){const t=x+c*M,n=h+o*p,a=o<l-1,d=c<u-1,f=a&&(!d||(a?0+s*(o+.5)/(l-1):0)<=(d?1+r*(c+.5)/(u-1):0));f?++o:++c;const y=f?n+p:t+M;e[i]=t,e[i+m]=n,e[i+g]=y,i+=3}}t.indexCount=i}function $(t){const{indices:e,numVerticesPerSide:n,vertexAttributes:o}=t,{position:s}=o,{typedBuffer:r,typedBufferStride:i}=s,a=n-2;let c=0;for(let l=0;l<n-3;++l){const t=l*a;for(let o=0;o<n-3;++o){const n=l*a+o,s=n+1,u=s+a,d=u-1,f=t+o,m=f+1,g=m+a;It(f,m,g,g-1,i,r)?(bt(e,c,n,s,u),c+=6,bt(e,c,u,d,n)):(bt(e,c,n,s,d),c+=6,bt(e,c,d,u,s)),c+=6}}}function _(t,e){const{indices:n,numVerticesPerSide:o,poleIndicesStartIndex:s}=t,r=o-1;let i=s;for(const a of e){const e=a.connectedOuterEdgeOffset;let s=t.getEdgeVertexIndex(e,0),c=1;for(let t=0;t<a.latitudeResolution;++t){const e=0===t?a.rowOffset:s+o;for(let o=0;o<r;o++)bt(n,i,s,s+1,e+o),i+=6,t<a.latitudeResolution-1&&(bt(n,i,s+1,e+o+1,e+o),i+=6),s+=c;s=e,c=1}}}function tt(t){const{indices:e,numVerticesPerSide:n,edgeIndicesStartIndex:o}=t,s=n-1,r=s-2;let i=o;for(let a=0;a<4;++a){const n=vt[a];let o=0,c=0;const l=t.getEdgeCount(a),u=n.count;f(u===s-1);const d=1===a||2===a,m=d?1:3,g=d?3:1,h=t.getEdgeFirstVertexIndex(a),p=1,x=n.vertex0Index,M=n.stride;for(;o<l-1||c<u-1;){const t=x+c*M,n=h+o*p,a=o<l-1,d=c<u-1,f=a&&(!d||(a?0+s*(o+.5)/(l-1):0)<=(d?1+r*(c+.5)/(u-1):0));f?++o:++c;const y=f?n+p:t+M;e[i]=t,e[i+m]=n,e[i+m+1]=n,e[i+g]=y,e[i+g+1]=y,e[i+5]=t,i+=6}}t.indexCount=i}function et(t){const{geometry:e,geometryState:n}=t,{edgeResolutions:o}=n,{numVerticesPerSide:s,edgeVerticesStartIndex:r}=e,i=s-2;let a=r;for(let c=0;c<4;++c){{const t=0===c||2===c,e=(0===c?i-1:0)*i+(1===c?i-1:0),n=(t?0:1)*i+(t?1:0),o=vt[c];o.vertex0Index=e,o.stride=n,o.count=i}{const t=o[c]+1;e.outerEdgesOffsetAndLength[2*c+0]=a,e.outerEdgesOffsetAndLength[2*c+1]=t,a+=t}}}function nt(t){et(t),t.geometryState.wireframe?tt(t.geometry):Z(t.geometry)}function ot(o,s,r){const{geometryState:i,geometry:a,tile:c,localOrigin:l}=o,u=1===s||3===s,d=i.edgeResolutions[s];f(e(d));const m=d+1,{boundingBox:g,minu:h,minv:p,maxu:x,maxv:M,vertexAttributes:y}=a,S=t(1===s?1:0,h,x),L=t(0===s?1:0,p,M),v=r.renderData,B=v.geometryState,V=v.geometry,I=(s+2)%4,b=V.getEdgeCount(I),C=c.getNeighborEdgeStartVertexIndex(s,r)*d,T=d*2**(c.level-r.level);f(B.edgeResolutions[I]===T),f(b-1===T);const U=v.localOrigin[0]-l[0],A=v.localOrigin[1]-l[1],P=v.localOrigin[2]-l[2],D=a.getEdgeFirstVertexIndex(s),{position:E,uv0:w}=y,O=E.typedBuffer,R=E.typedBufferStride,N=y.normalCompressed,j=N.typedBuffer,F=N.typedBufferStride,q=V.vertexAttributes,W=V.getEdgeFirstVertexIndex(I),k=q.position.typedBuffer,z=q.position.typedBufferStride,G=q.normalCompressed.typedBuffer,H=q.normalCompressed.typedBufferStride;for(let e=1;e<m-1;++e){const o=D+e,s=W+(C+e),r=o*R,i=s*z,a=k[i]+U,c=k[i+1]+A,l=k[i+2]+P;O[r]=a,O[r+1]=c,O[r+2]=l,Bt(a,c,l,g);const f=o*F,m=s*H;j[f]=G[m],j[f+1]=G[m+1];const y=e/d,v=u?S:t(y,h,x),B=u?t(y,p,M):L;w.setValues(o,Math.round(v*n),Math.round(B*n))}}function st(e){const{geometry:o,geometryState:s,localOrigin:i}=e,{clippingArea:a,samplerData:c}=s,{minu:l,minv:u,maxu:d,maxv:m,boundingBox:g,vertexAttributes:h}=o,p=e.tile,{surface:M,ellipsoid:y,extent:S,extentInRadians:L,horizontalScale:v}=p,B="local"===M.view?.viewingMode,V=y.radius;let I=0,b=0,C=0;const T=(t,e,n)=>{const o=L[0===e?1:3],s=L[0===t?0:2],r=Math.cos(o),i=Math.sin(o),a=Math.sin(s),c=Math.cos(s),l=V+n;I=c*r*l,b=a*r*l,C=i*l},U=B?(()=>{const e=a,n=null!=e&&(S[3]>e[3]||S[2]>e[2]||S[1]<e[1]||S[0]<e[0]),o=K(M.isWebMercatorOnPlateCarree,V,v);return(s,r,i)=>{const a=0===s?S[0]:S[2],c=0===r?S[1]:S[3],l=n?t(a,e[0],e[2]):a,u=n?t(c,e[1],e[3]):c,d=i;I=l*v,b=o(u),C=d}})():T;let A=0,P=0,D=0,E=0,w=0,O=0,N=0,j=0,F=0;const q=B&&M.isWebMercatorOnPlateCarree,W=(t,e,n,o,s)=>{let r=0,i=0,a=0;if(B){const t=e*v,s=q?(Math.PI/2-2*Math.atan(Math.exp(-n/V)))*V:n*v;r=t-I,i=s-b,a=o-C}else{const s=R(t),c=t.tile,l=c.extent,u=c.extentInRadians,d=(e-l[0])/(l[2]-l[0]),f=(n-l[1])/(l[3]-l[1]),m=u[0]*(1-d)+u[2]*d,g=s(f),h=Math.cos(g),p=Math.sin(g),x=Math.sin(m),M=Math.cos(m),y=V+o;r=M*h*y-I,i=x*h*y-b,a=p*y-C}switch(s){case 0:N+=r,j+=i,F+=a;break;case 1:E-=r,w-=i,O-=a;break;case 2:N-=r,j-=i,F-=a;break;case 3:E+=r,w+=i,O+=a}},k=a??Mt,z=S[0],G=S[2],H=S[1],J=S[3],Q=[J>k[3],G>k[2],H<k[1],z<k[0]],X=Math.max(z,k[0]),Y=Math.min(G,k[2]),Z=Math.max(H,k[1]),$=Math.min(J,k[3]),_=t=>Math.max(k[0],Math.min(k[2],t)),tt=t=>Math.max(k[1],Math.min(k[3],t)),et=t=>{const e=s.cornerNeighborCornerTiles;A=0,P=0,D=1,E=0,w=0,O=0,N=0,j=0,F=0;let n=1/0;for(let s=0;s<4;++s){const o=e[4*t+s];n=Math.min(n,o?.level??1/0)}for(let s=0;s<4;++s){const o=e[4*t+s];yt[s]=o?.level===n?o:null}let o=1,i=0;for(let s=0;s<4;++s){const t=yt[s];t&&(o=Math.max(o,t?.renderData.geometryState.numVerticesPerSide),i=t.extent[2]-t.extent[0])}const a=i,c=o;f(c>1);const l=a/c;for(let s=0;s<4;++s){const t=yt[(s+3)%4],e=yt[s%4];if(!t&&!e)continue;const n=0===s?1:1===s?2:2===s?3:0,o=0===s?2:1===s?3:2===s?0:1;if(t&&e){const i=lt[s][0]*l,a=lt[s][1]*l,c=t.extent,u=_(c[0===n||1===n?2:0]+i),d=tt(c[0===n||3===n?3:1]+a),f=e.extent,m=_(f[0===o||1===o?2:0]+i),g=tt(f[0===o||3===o?3:1]+a),h=t.renderData,p=e.renderData,x=r(u,d,h.geometryState.samplerData),M=r(m,g,p.geometryState.samplerData);W(h,u,d,.5*(x+M),s)}else{const i=t??e,a=t?n:o,c=i.extent,u=lt[s],d=_(c[0===a||1===a?2:0]+u[0]*l),f=tt(c[0===a||3===a?3:1]+u[1]*l),m=i.renderData,g=r(d,f,m.geometryState.samplerData);W(m,d,f,g,s)}}if(!B){const t=Math.sqrt(I*I+b*b+C*C);A=I/t,P=b/t,D=C/t}if(B||D*D<.999){const t=Math.sqrt(E*E+w*w+O*O);E/=t,w/=t,O/=t;const e=Math.sqrt(N*N+j*j+F*F);N/=e,j/=e,F/=e,A=O*j-w*F,P=E*F-O*N,D=w*N-E*j;const n=1/Math.sqrt(A*A+P*P+D*D);A*=n,P*=n,D*=n}},nt=s.cornerNeighborCornerTiles;for(let R=0;R<4;++R){const e=R,a=(R+1)%4,M=0===R||1===R?1:0,y=0===R||3===R?1:0,S=t(M,l,d),L=t(y,u,m),v=o.getEdgeFirstVertexIndex(e),B=o.getEdgeCount(e),V=0===R||3===R?B-1:0,T=o.getEdgeFirstVertexIndex(a),E=o.getEdgeCount(a),w=0===R||1===R?E-1:0;let O=-1;for(let t=0;t<4;++t){const e=nt[4*R+t],n=nt[4*R+O];e&&(-1===O||x(n,e)>0)&&(O=t)}const N=O,j=nt[4*R+N];if(j!==p){const t=p.level-j.level,e=2**t,o=[j.lij[0]+t,j.lij[1]*e,j.lij[2]*e],r=[o[1]+e===p.lij[1],0===R&&(1===N||0===N&&j!==nt[4*R+3])||1===R&&(0===N||1===N&&j!==nt[4*R+2]),o[1]===p.lij[1]+1,2===R&&(3===N||2===N&&j!==nt[4*R+1])||3===R&&(2===N||3===N&&j!==nt[4*R+0])],a=r.reduce((t,e)=>t+(e?1:0),0);f(1===a||2===a);let c=-1,l=-1;const u=j.renderData;if(1===a){const t=r.findIndex(t=>t);f(0<=t&&t<=3),c=(t+2)%4;const e=s.edgeResolutions[t];l=p.getNeighborEdgeStartVertexIndex(t,j)*e+e*(0===t&&0===R||1===t&&0===R||2===t&&1===R||3===t&&3===R?1:0)}else{f(r[1]||r[3]),c=r[1]?3:1;const t=u.geometryState.edgeResolutions[c];l=0===R||3===R?0:t}const d=u.geometry;{const t=v+V,e=T+w,o=d.getEdgeFirstVertexIndex(c)+l,s=d.vertexAttributes,r=u.localOrigin,a=s.position,f=a.typedBuffer,m=o*a.typedBufferStride,p=f[m]+r[0]-i[0],x=f[m+1]+r[1]-i[1],M=f[m+2]+r[2]-i[2];Bt(p,x,M,g);const y=h.position,B=y.typedBuffer,I=t*y.typedBufferStride;B[I]=p,B[I+1]=x,B[I+2]=M;const b=e*y.typedBufferStride;B[b]=p,B[b+1]=x,B[b+2]=M;const C=h.uv0;C.setValues(t,Math.round(S*n),Math.round(L*n)),C.setValues(e,Math.round(S*n),Math.round(L*n));{const n=s.normalCompressed.typedBuffer,r=o*s.normalCompressed.typedBufferStride,i=h.normalCompressed,a=i.typedBuffer;{const e=t*i.typedBufferStride;a[e]=n[r],a[e+1]=n[r+1]}{const t=e*i.typedBufferStride;a[t]=n[r],a[t+1]=n[r+1]}}}}else{const n=Q[e],s=Q[a];let l;if(n||s){const e=t(z*(1-M)+G*M,X,Y),n=t(H*(1-y)+J*y,Z,$);l=r(e,n,c)}else l=rt(nt,R);U(M,y,l),et(R);const u=I-i[0],d=b-i[1],f=C-i[2];Bt(u,d,f,g),o.setEdgeVertexFromValuesRawPositionUVNormal(e,V,u,d,f,S,L,A,P,D),o.setEdgeVertexFromValuesRawPositionUVNormal(a,w,u,d,f,S,L,A,P,D)}}for(let t=0;t<4;++t)yt[t]=null}function rt(t,e){const n=4*e,o=c.reduce((e,o)=>Math.min(e,t[n+o]?.level??1/0),1/0);m&&(f(!t[n+0]||!t[n+2]||p(t[n+0],t[n+2],5)),f(!t[n+1]||!t[n+3]||p(t[n+1],t[n+3],7)));let s=0,i=0;for(let c=0;c<4;++c){const e=t[n+c];if(e?.level===o){const t=0===c||1===c,n=0===c||3===c,o=e.extent,a=o[t?0:2],l=o[n?1:3],u=e.renderData?.geometryState?.samplerData;i+=r(a,l,u),s++}}const a=s?i/s:0;return f(null!=a),a}function it(t){const{vao:e,geometry:n}=t,{vertexAttributes:o,edgeVerticesStartIndex:s}=n,r=o.position.typedBuffer;e.buffer()?.setSubData(r,s,s,r.length)}function at(t){const{vao:e,geometry:n}=t,{indices:o,indexCount:s,edgeIndicesStartIndex:r}=n;e.indexBuffer.setSubData(o,r,r,s)}class ct{constructor(t,e,n,o,s){this.isNorth=t,this.connectedRowOffset=e,this.connectedOuterEdgeOffset=n,this.rowOffset=o,this.latitudeResolution=s}}const lt=[[0,1],[1,0],[0,-1],[-1,0]],ut=new a,dt=.5*d,ft=new Uint16Array(u+1),mt=new Int32Array(u+1),gt=new Int32Array(u+1),ht=new Int32Array(u+1),pt=new Float64Array(u+1),xt=new Float64Array(u+1),Mt=s(-1/0,-1/0,1/0,1/0),yt=[null,null,null,null];function St(t,e,n){if(!e)return!1;const o=x(t,e);return o>0||0===o&&n>=2}class Lt{constructor(){this.vertex0Index=0,this.stride=1,this.count=0}getVertexIndex(t){return f(0<=t&&t<this.count),this.vertex0Index+this.stride*t}}const vt=[new Lt,new Lt,new Lt,new Lt];function Bt(t,e,n,o){t<o[0]?o[0]=t:t>o[3]&&(o[3]=t),e<o[1]?o[1]=e:e>o[4]&&(o[4]=e),n<o[2]?o[2]=n:n>o[5]&&(o[5]=n)}function Vt(t){const{edgeResolutions:e,numVerticesPerSide:n}=t,o=1+Math.max(...e);return Math.max(n,o)}function It(t,e,n,o,s,r){const i=t*s,a=r[i],c=r[i+1],l=r[i+2],u=e*s,d=r[u],f=r[u+1],m=r[u+2],g=n*s,h=r[g],p=r[g+1],x=r[g+2],M=o*s,y=r[M],S=r[M+1],L=r[M+2];return(d-y)*(d-y)+(f-S)*(f-S)+(m-L)*(m-L)>(a-h)*(a-h)+(c-p)*(c-p)+(l-x)*(l-x)}function bt(t,e,n,o,s){t[e]=n,t[e+1]=o,t[e+2]=o,t[e+3]=s,t[e+4]=s,t[e+5]=n}const Ct=6;export{N as createPlanarGlobePatch,S as createSphericalGlobePatch,U as updateCornerSpherical,F as updateCornersPlanar,q as updateEdgeElevationsAndResolutionsPlanar,T as updateEdgeElevationsAndResolutionsSpherical,W as updateEdgesAndCornersPlanar,C as updateEdgesAndCornersSpherical};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{isColorHighlightOrOLID as e}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(t){super(),this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.polygonOffset=0,this.vertexPositionRotationType=1,this.vertexNormalRotationType=0,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveGlobalIllumination=!1,this.receiveShadows=!0,this.hasShadowHighlights=!1,this.transparent=!0,this.screenSpaceReflections=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.enableOITOffset=!1,this.sphereDepthInterpolate=!1,this.writeDepth=!0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0,this.sphericalSR=t.sphericalSR,this.useFloatBlend=t.useFloatBlend}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&e(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}t([o()],s.prototype,"useFloatBlend",void 0),t([o({count:12})],s.prototype,"output",void 0),t([o({count:3})],s.prototype,"textureCoordinateType",void 0),t([o({count:2})],s.prototype,"componentDataType",void 0),t([o({count:3})],s.prototype,"cullFace",void 0),t([o({count:3})],s.prototype,"vertexDiscardMode",void 0),t([o({count:3})],s.prototype,"doubleSidedMode",void 0),t([o({count:4})],s.prototype,"alphaDiscardMode",void 0),t([o({count:4})],s.prototype,"integratedMeshMode",void 0),t([o({count:7})],s.prototype,"pbrMode",void 0),t([o({count:3})],s.prototype,"normalType",void 0),t([o({count:8})],s.prototype,"emissionSource",void 0),t([o({count:3})],s.prototype,"shadeNormals",void 0),t([o({count:5})],s.prototype,"polygonOffset",void 0),t([o({count:2})],s.prototype,"vertexPositionRotationType",void 0),t([o({count:2})],s.prototype,"vertexNormalRotationType",void 0),t([o()],s.prototype,"hasEmission",void 0),t([o()],s.prototype,"hasVertexColors",void 0),t([o()],s.prototype,"hasSlicePlane",void 0),t([o()],s.prototype,"isGroundSlice",void 0),t([o()],s.prototype,"hasColorTexture",void 0),t([o()],s.prototype,"hasHighlightMixTexture",void 0),t([o()],s.prototype,"receiveAmbientOcclusion",void 0),t([o()],s.prototype,"receiveGlobalIllumination",void 0),t([o()],s.prototype,"receiveShadows",void 0),t([o()],s.prototype,"hasShadowHighlights",void 0),t([o()],s.prototype,"transparent",void 0),t([o()],s.prototype,"screenSpaceReflections",void 0),t([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),t([o()],s.prototype,"hasOcclusionTexture",void 0),t([o()],s.prototype,"hasNormalTexture",void 0),t([o()],s.prototype,"hasOccludees",void 0),t([o()],s.prototype,"terrainDepthTest",void 0),t([o()],s.prototype,"cullAboveTerrain",void 0),t([o()],s.prototype,"hasNormalTextureTransform",void 0),t([o()],s.prototype,"cloudReflections",void 0),t([o()],s.prototype,"snowCover",void 0),t([o()],s.prototype,"renderOccluded",void 0),t([o()],s.prototype,"enableOITOffset",void 0),t([o()],s.prototype,"sphereDepthInterpolate",void 0);export{s as ComponentTechniqueConfiguration};
2
+ import{__decorate as t}from"tslib";import{isColorHighlightOrOLID as e}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(t){super(),this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.polygonOffset=0,this.vertexPositionRotationType=1,this.vertexNormalRotationType=0,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.receiveAmbientOcclusion=!0,this.receiveGlobalIllumination=!1,this.receiveShadows=!0,this.hasShadowHighlights=!1,this.transparent=!0,this.screenSpaceReflections=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.enableOITOffset=!1,this.sphereDepthInterpolate=!1,this.writeDepth=!0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0,this.sphericalSR=t.sphericalSR,this.useFloatBlend=t.useFloatBlend}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&e(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}t([o()],s.prototype,"useFloatBlend",void 0),t([o({count:12})],s.prototype,"output",void 0),t([o({count:3})],s.prototype,"textureCoordinateType",void 0),t([o({count:2})],s.prototype,"componentDataType",void 0),t([o({count:3})],s.prototype,"cullFace",void 0),t([o({count:3})],s.prototype,"vertexDiscardMode",void 0),t([o({count:3})],s.prototype,"doubleSidedMode",void 0),t([o({count:4})],s.prototype,"alphaDiscardMode",void 0),t([o({count:4})],s.prototype,"integratedMeshMode",void 0),t([o({count:7})],s.prototype,"pbrMode",void 0),t([o({count:3})],s.prototype,"normalType",void 0),t([o({count:8})],s.prototype,"emissionSource",void 0),t([o({count:3})],s.prototype,"shadeNormals",void 0),t([o({count:5})],s.prototype,"polygonOffset",void 0),t([o({count:2})],s.prototype,"vertexPositionRotationType",void 0),t([o({count:2})],s.prototype,"vertexNormalRotationType",void 0),t([o()],s.prototype,"hasEmission",void 0),t([o()],s.prototype,"hasVertexColors",void 0),t([o()],s.prototype,"hasSlicePlane",void 0),t([o()],s.prototype,"isGroundSlice",void 0),t([o()],s.prototype,"hasColorTexture",void 0),t([o()],s.prototype,"hasHighlightMixTexture",void 0),t([o()],s.prototype,"emissionDimmingPass",void 0),t([o()],s.prototype,"receiveAmbientOcclusion",void 0),t([o()],s.prototype,"receiveGlobalIllumination",void 0),t([o()],s.prototype,"receiveShadows",void 0),t([o()],s.prototype,"hasShadowHighlights",void 0),t([o()],s.prototype,"transparent",void 0),t([o()],s.prototype,"screenSpaceReflections",void 0),t([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),t([o()],s.prototype,"hasOcclusionTexture",void 0),t([o()],s.prototype,"hasNormalTexture",void 0),t([o()],s.prototype,"hasOccludees",void 0),t([o()],s.prototype,"terrainDepthTest",void 0),t([o()],s.prototype,"cullAboveTerrain",void 0),t([o()],s.prototype,"hasNormalTextureTransform",void 0),t([o()],s.prototype,"cloudReflections",void 0),t([o()],s.prototype,"snowCover",void 0),t([o()],s.prototype,"renderOccluded",void 0),t([o()],s.prototype,"enableOITOffset",void 0),t([o()],s.prototype,"sphereDepthInterpolate",void 0);export{s as ComponentTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- class t{constructor(t,a,e,r){this._material=t,this._drawParameters=a,this.geometry=e,this.meta=r}get material(){return this._material}destroy(){this._material.destroy(),this._drawParameters.destroy(),this.geometry.destroy()}get drawParameters(){return this._drawParameters}updateMaterial(t){this._material=t}get opacity(){return this.drawParameters.opacity}updateOpacity(t){const{_drawParameters:a}=this;t!==a.opacity&&(a.opacity=t)}updateComponentParametersUniform(t){this._drawParameters.updateComponentParameters(t,null)}updateComponentParametersVarying(t,a){this._drawParameters.updateComponentParameters(t,a)}}class a{constructor(t){this.gpuMemoryEstimate=t,this.cameraDepthSquared=.5}}export{t as Renderable,a as RenderableMeta};
2
+ class t{constructor(t,a,e,r){this._material=t,this._drawParameters=a,this.geometry=e,this.meta=r}get material(){return this._material}destroy(){this._material.destroy(),this._drawParameters.destroy(),this.geometry.destroy()}get drawParameters(){return this._drawParameters}updateMaterial(t){this._material=t}get opacity(){return this.drawParameters.opacity}updateOpacity(t){this._drawParameters.opacity=t}updateComponentParametersUniform(t){this._drawParameters.updateComponentParameters(t,null)}updateComponentParametersVarying(t,a){this._drawParameters.updateComponentParameters(t,a)}}class a{constructor(t){this.gpuMemoryEstimate=t,this.cameraDepthSquared=.5}}export{t as Renderable,a as RenderableMeta};
@@ -1,6 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isColor as e}from"../ShaderOutput.js";import{VertexTextureCoordinates as r}from"../attributes/VertexTextureCoordinates.glsl.js";import{glsl as t}from"../../shaderModules/glsl.js";import{Texture2DDrawUniform as o}from"../../shaderModules/Texture2DDrawUniform.js";function u(u,a){const s=a.hasColorTexture&&(e(a.output)||1!==a.alphaDiscardMode);s&&(u.include(r,a),u.fragment.uniforms.add(new o("baseColorTexture",e=>e.texture,e=>e.textureSampler))),u.fragment.code.add(t`
3
- vec4 readBaseColorTexture() {
4
- return ${s?"textureLookup(baseColorTexture, vuv0)":"vec4(1.0)"};
5
- }
6
- `)}export{u as ReadBaseColorTexture};
2
+ import{isColor as e}from"../ShaderOutput.js";import{VertexTextureCoordinates as r}from"../attributes/VertexTextureCoordinates.glsl.js";import{glsl as o}from"../../shaderModules/glsl.js";import{Texture2DDrawUniform as t}from"../../shaderModules/Texture2DDrawUniform.js";function u(u,a){a.hasColorTexture&&(e(a.output)||1!==a.alphaDiscardMode)?(u.include(r,a),u.fragment.uniforms.add(new t("baseColorTexture",e=>e.texture,e=>e.textureSampler)).code.add(o`vec4 readBaseColorTexture() { return textureLookup(baseColorTexture, vuv0); }`)):u.fragment.code.add(o`vec4 readBaseColorTexture() { return vec4(1.0); }`)}export{u as ReadBaseColorTexture};
@@ -1,6 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{FloatDrawUniform as o}from"../../shaderModules/FloatDrawUniform.js";import{FloatPassUniform as t}from"../../shaderModules/FloatPassUniform.js";import{glsl as r,If as e}from"../../shaderModules/glsl.js";import{alphaCutoff as a}from"../../../../../../webscene/support/AlphaCutoff.js";function f(o,r){l(o,r,new t("textureAlphaCutoff",o=>o.textureAlphaCutoff))}function s(t,r){l(t,r,new o("textureAlphaCutoff",o=>o.textureAlphaCutoff))}function l(o,t,f){const s=o.fragment,l=t.alphaDiscardMode,u=0===l;2!==l&&3!==l||s.uniforms.add(f),s.code.add(r`
3
- void discardOrAdjustAlpha(inout vec4 color) {
4
- ${1===l?"color.a = 1.0;":`if (color.a < ${u?r.float(a):"textureAlphaCutoff"}) {\n discard;\n } ${e(2===l,"else { color.a = 1.0; }")}`}
5
- }
6
- `)}export{s as DiscardOrAdjustAlphaDraw,f as DiscardOrAdjustAlphaPass};
2
+ import{FloatDrawUniform as a}from"../../shaderModules/FloatDrawUniform.js";import{FloatPassUniform as o}from"../../shaderModules/FloatPassUniform.js";import{alphaCutoff as d}from"../../../shaders/alphaCutoff.glsl.js";function e(a,d){t(a,d,new o("textureAlphaCutoff",a=>a.textureAlphaCutoff))}function r(o,d){t(o,d,new a("textureAlphaCutoff",a=>a.textureAlphaCutoff))}function t(a,o,e){const r=a.fragment;switch(r.code.add("void discardOrAdjustAlpha(inout vec4 color) {"),o.alphaDiscardMode){case 1:r.code.add("color.a = 1.0;");break;case 0:r.include(d),r.code.add("if (color.a < alphaCutoff) discard;");break;case 3:r.uniforms.add(e).code.add("if (color.a < textureAlphaCutoff) discard;");break;case 2:r.uniforms.add(e).code.add("\n if (color.a < textureAlphaCutoff) discard;\n color.a = 1.0;\n ");break;case 4:break;default:o.alphaDiscardMode}r.code.add("}")}export{r as DiscardOrAdjustAlphaDraw,e as DiscardOrAdjustAlphaPass};
@@ -1,19 +1,17 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{ColorConversion as e}from"./ColorConversion.glsl.js";import{glsl as t}from"../../shaderModules/glsl.js";function i(i){i.include(e),i.code.add(t`
2
+ import{ColorConversion as t}from"./ColorConversion.glsl.js";import{glsl as e}from"../../shaderModules/glsl.js";function n(n){n.include(t),n.code.add(e`
3
3
  vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
4
- // workaround for artifacts in macOS using Intel Iris Pro
5
- // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
6
- vec3 internalMixed = internalColor * textureColor;
7
- vec3 allMixed = internalMixed * externalColor;
8
-
9
- if (mode == ${t.int(1)}) {
10
- return allMixed;
4
+ if (mode == ${e.int(3)}) {
5
+ return externalColor;
11
6
  }
12
- if (mode == ${t.int(2)}) {
7
+
8
+ vec3 internalMixed = internalColor * textureColor;
9
+ if (mode == ${e.int(2)}) {
13
10
  return internalMixed;
14
11
  }
15
- if (mode == ${t.int(3)}) {
16
- return externalColor;
12
+
13
+ if (mode == ${e.int(1)}) {
14
+ return internalMixed * externalColor;
17
15
  }
18
16
 
19
17
  // tint (or something invalid)
@@ -24,19 +22,16 @@ import{ColorConversion as e}from"./ColorConversion.glsl.js";import{glsl as t}fro
24
22
  }
25
23
 
26
24
  float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {
27
- // workaround for artifacts in macOS using Intel Iris Pro
28
- // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
29
- float internalMixed = internalOpacity * textureOpacity;
30
- float allMixed = internalMixed * externalOpacity;
25
+ if (mode == ${e.int(3)}) {
26
+ return externalOpacity;
27
+ }
31
28
 
32
- if (mode == ${t.int(2)}) {
29
+ float internalMixed = internalOpacity * textureOpacity;
30
+ if (mode == ${e.int(2)}) {
33
31
  return internalMixed;
34
32
  }
35
- if (mode == ${t.int(3)}) {
36
- return externalOpacity;
37
- }
38
33
 
39
34
  // multiply or tint (or something invalid)
40
- return allMixed;
35
+ return internalMixed * externalOpacity;
41
36
  }
42
- `)}export{i as MixExternalColor};
37
+ `)}export{n as MixExternalColor};