@arcgis/core 5.1.0-next.21 → 5.1.0-next.23

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 (183) hide show
  1. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +1 -0
  2. package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.d.ts +1 -0
  3. package/analysis/VolumeMeasurement/VolumeMeasurementInputUnits.d.ts +1 -0
  4. package/analysis/VolumeMeasurementAnalysis.d.ts +3 -2
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/03d11c7056fea763cbac.js +1 -0
  7. package/assets/esri/core/workers/chunks/05e5b9082c0a396df7e5.js +1 -0
  8. package/assets/esri/core/workers/chunks/08445fcba84ed7c23b3f.js +1 -0
  9. package/assets/esri/core/workers/chunks/0c706cdff6eac940eaab.js +1 -0
  10. package/assets/esri/core/workers/chunks/10a8612e7b2c74a8ce9a.js +1 -0
  11. package/assets/esri/core/workers/chunks/{2ddb8bb00b3af83ebd7c.js → 14792047c5519dd89828.js} +1 -1
  12. package/assets/esri/core/workers/chunks/1a1e57267306c07e5bdb.js +1 -0
  13. package/assets/esri/core/workers/chunks/1bb5aa1e3693e0c68b18.js +1 -0
  14. package/assets/esri/core/workers/chunks/1cd091fa567fc4026356.js +1 -0
  15. package/assets/esri/core/workers/chunks/{3ed7f19f77a11fa4d047.js → 2063b49607a03f7718ee.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{74a6d840813ac29b0bda.js → 209acb3ad16c99bb506c.js} +1 -1
  17. package/assets/esri/core/workers/chunks/21decfc1e477fb769204.js +1 -0
  18. package/assets/esri/core/workers/chunks/21e04705cad9fef1b01b.js +1 -0
  19. package/assets/esri/core/workers/chunks/23cb0611abe1031c513c.js +1 -0
  20. package/assets/esri/core/workers/chunks/285f3b07de852bfc1604.js +1 -0
  21. package/assets/esri/core/workers/chunks/2c61a53962093a331225.js +1 -0
  22. package/assets/esri/core/workers/chunks/2ecfd6edab796194bf88.js +1 -0
  23. package/assets/esri/core/workers/chunks/2f23af31b1190754ce13.js +1 -0
  24. package/assets/esri/core/workers/chunks/31eb59eae4c89b76e302.js +1 -0
  25. package/assets/esri/core/workers/chunks/3e61e7805dc6ff284831.js +1 -0
  26. package/assets/esri/core/workers/chunks/4150774059d67a8def74.js +1 -0
  27. package/assets/esri/core/workers/chunks/416c57df61fbd193078b.js +1 -0
  28. package/assets/esri/core/workers/chunks/46d28a0c20263012faff.js +1 -0
  29. package/assets/esri/core/workers/chunks/{43c8b1473695574c663e.js → 4754610760f3f634adf9.js} +2 -2
  30. package/assets/esri/core/workers/chunks/{f5cebeaad3e7d87d7997.js → 4fc6dd1423075e145b29.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{3861644c06cfebe8f40c.js → 527547fa10d52cb3a7b1.js} +2 -2
  32. package/assets/esri/core/workers/chunks/5480d4cc342a2669a8ab.js +1 -0
  33. package/assets/esri/core/workers/chunks/{e8495c655a0a4f534636.js → 551fee27bf3abf0c41fd.js} +1 -1
  34. package/assets/esri/core/workers/chunks/576995021660e8b34705.js +1 -0
  35. package/assets/esri/core/workers/chunks/57e375d8a8db9fa57193.js +1 -0
  36. package/assets/esri/core/workers/chunks/5cbc12545f42a32fb960.js +1 -0
  37. package/assets/esri/core/workers/chunks/61ebbae0773fccc1f2bf.js +1 -0
  38. package/assets/esri/core/workers/chunks/63c297b6b7438f49e7ee.js +1 -0
  39. package/assets/esri/core/workers/chunks/{53f8c1d56ef3b24d2226.js → 6c853fd89f0e9f102c6e.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{946698d9cefffdb63082.js → 6e32e7b2ea2ea1a1fc04.js} +1 -1
  41. package/assets/esri/core/workers/chunks/6f12854c5846edfe3239.js +1 -0
  42. package/assets/esri/core/workers/chunks/{b586f1021a27c5e1551a.js → 7189e03cc24f5c10865a.js} +2 -2
  43. package/assets/esri/core/workers/chunks/7c417d2bf432e4055b3d.js +30 -0
  44. package/assets/esri/core/workers/chunks/8021cb732f8136d87048.js +1 -0
  45. package/assets/esri/core/workers/chunks/84124c1a41a96192f81c.js +1 -0
  46. package/assets/esri/core/workers/chunks/845bbd82ddacbb62ad28.js +1 -0
  47. package/assets/esri/core/workers/chunks/868c8a152cb1452b9a94.js +1 -0
  48. package/assets/esri/core/workers/chunks/879ce85c50b0348056b2.js +1 -0
  49. package/assets/esri/core/workers/chunks/87a7d405a0b9a541d7f2.js +1 -0
  50. package/assets/esri/core/workers/chunks/9522430d34d29c1ffb1a.js +1 -0
  51. package/assets/esri/core/workers/chunks/9647f3983f955da21093.js +1 -0
  52. package/assets/esri/core/workers/chunks/9694b4b85168a38ca24b.js +1 -0
  53. package/assets/esri/core/workers/chunks/{83d913dab3c2b0d6a7cc.js → 9736299a4ac0e21f08a7.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{e7bee85f28d7ec03825a.js → 973e3743cb7fdaa27f80.js} +1 -1
  55. package/assets/esri/core/workers/chunks/9b2d0d36ee6c04c347df.js +1 -0
  56. package/assets/esri/core/workers/chunks/{2662750d5761ed2d0eb7.js → 9e7eea56e96f012f9ff4.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{3f812b0a28afb47aaaf0.js → a35d1be700ebd3109397.js} +2 -2
  58. package/assets/esri/core/workers/chunks/a4a4ce33de6432ba4dc3.js +1 -0
  59. package/assets/esri/core/workers/chunks/{aece665144aed2065ffc.js → a78ac951c00f090d9024.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{0debabe324c873066885.js → aa3bdfd00f666c6cc521.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{db5bbc240a1b8cd5af52.js → abc2471cfa9430ca5645.js} +1 -1
  62. package/assets/esri/core/workers/chunks/b2a67fe89f6505498bc3.js +1 -0
  63. package/assets/esri/core/workers/chunks/b4254fcb2051c873f2ba.js +1 -0
  64. package/assets/esri/core/workers/chunks/{a53fa34681efff8fc024.js → b859d98fa1c39f8e4099.js} +1 -1
  65. package/assets/esri/core/workers/chunks/c09bc36347e8eb9fff00.js +1 -0
  66. package/assets/esri/core/workers/chunks/c2cda93905f0a49a6931.js +1 -0
  67. package/assets/esri/core/workers/chunks/{3d0aa5f2db79c022243e.js → c794f7be868e53ca4a8c.js} +1 -1
  68. package/assets/esri/core/workers/chunks/cada79c174027f7a0df8.js +1 -0
  69. package/assets/esri/core/workers/chunks/d10c65cde3565d399275.js +1 -0
  70. package/assets/esri/core/workers/chunks/d44217de4c73475f9c66.js +1 -0
  71. package/assets/esri/core/workers/chunks/d587b7842091affdaac3.js +1 -0
  72. package/assets/esri/core/workers/chunks/d70678598f4080adfb39.js +1 -0
  73. package/assets/esri/core/workers/chunks/dad9c25f1b7cacf7b052.js +1 -0
  74. package/assets/esri/core/workers/chunks/{0facd2c143a04cc7c4ff.js → deee88e3f1641c6ef5db.js} +1 -1
  75. package/assets/esri/core/workers/chunks/e063cce778944fe97dd3.js +1 -0
  76. package/assets/esri/core/workers/chunks/e37e7ae2de974cef9a90.js +1 -0
  77. package/assets/esri/core/workers/chunks/e44ed205f74df34adb8b.js +1 -0
  78. package/assets/esri/core/workers/chunks/e6220c1fa887e21ffbbd.js +1 -0
  79. package/assets/esri/core/workers/chunks/{13d1cb50232ae761425b.js → eaeb95be8d4032513247.js} +2 -2
  80. package/assets/esri/core/workers/chunks/{93515f52d9b5fa12bd04.js → eb4934d3a3b82316c7c6.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{bfeab15d7ac9a2559fe5.js → f1c1f7583fa13dff9b5c.js} +1 -1
  82. package/assets/esri/core/workers/chunks/f27bbb4e26297d3c68de.js +1 -0
  83. package/assets/esri/core/workers/chunks/f4480636a910eaa4c531.js +1 -0
  84. package/assets/esri/core/workers/chunks/{5b991b0d4ca257291cb0.js → f5c5a9e771074f780fc8.js} +1 -1
  85. package/assets/esri/core/workers/chunks/f82a95c46f0d579d5bf5.js +1 -0
  86. package/assets/esri/core/workers/chunks/fb3a42cdd0d3105ec551.js +1 -0
  87. package/config.js +1 -1
  88. package/core/MultiOriginJSONSupport.d.ts +1 -1
  89. package/core/ReadOnlyMultiOriginJSONSupport.d.ts +5 -4
  90. package/geometry/FlatGeometry.js +1 -1
  91. package/kernel.js +1 -1
  92. package/layers/FeatureLayer.d.ts +7 -9
  93. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  94. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  95. package/layers/graphics/data/QueryEngineResult.js +1 -1
  96. package/layers/raster/datasets/MRFRaster.js +1 -1
  97. package/layers/support/SceneModification.js +1 -1
  98. package/package.json +2 -2
  99. package/renderers/VectorFieldRenderer.js +1 -1
  100. package/support/revision.js +1 -1
  101. package/symbols/cim/SDFHelper.js +1 -1
  102. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  103. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.d.ts +1 -0
  104. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementResult.d.ts +1 -0
  105. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +1 -0
  106. package/views/3d/layers/Lyr3DWorker.js +1 -1
  107. package/views/3d/layers/SceneLayerWorkerHandle.js +1 -1
  108. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  109. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  110. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  111. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
  112. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  113. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  114. package/views/SelectionManager.d.ts +9 -9
  115. package/views/SelectionManager.js +1 -1
  116. package/views/layers/FeatureLikeLayerView.d.ts +24 -24
  117. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  118. package/widgets/Editor/workflowUtils.js +1 -1
  119. package/widgets/FeatureTemplates.d.ts +1 -1
  120. package/widgets/FeatureTemplates.js +1 -1
  121. package/widgets/Sketch/support/sketchUtils.js +1 -1
  122. package/assets/esri/core/workers/chunks/026c00ee272c64e53daf.js +0 -1
  123. package/assets/esri/core/workers/chunks/0883c4e63424d6746ada.js +0 -1
  124. package/assets/esri/core/workers/chunks/0987cb20148f65222b44.js +0 -1
  125. package/assets/esri/core/workers/chunks/0a1f88cf16bcbb53b371.js +0 -1
  126. package/assets/esri/core/workers/chunks/0ca405ca26676137a4be.js +0 -1
  127. package/assets/esri/core/workers/chunks/0ce968c89c35535da63e.js +0 -1
  128. package/assets/esri/core/workers/chunks/144c719d5ba9e3a30961.js +0 -1
  129. package/assets/esri/core/workers/chunks/1503ca177e2466ec0e87.js +0 -1
  130. package/assets/esri/core/workers/chunks/1597d7b380d510ff5252.js +0 -1
  131. package/assets/esri/core/workers/chunks/1880c3b293cdfa804625.js +0 -1
  132. package/assets/esri/core/workers/chunks/1bea32b02d35ddb9b118.js +0 -1
  133. package/assets/esri/core/workers/chunks/1d78ec98eef7fef08f86.js +0 -1
  134. package/assets/esri/core/workers/chunks/1e6271524602e159dbad.js +0 -1
  135. package/assets/esri/core/workers/chunks/1f96d597ba736e088168.js +0 -1
  136. package/assets/esri/core/workers/chunks/26e41b08efe77d247409.js +0 -1
  137. package/assets/esri/core/workers/chunks/297b58f29c496923e1f3.js +0 -1
  138. package/assets/esri/core/workers/chunks/2a2a9fa62969644ea200.js +0 -1
  139. package/assets/esri/core/workers/chunks/2b296378d21e4e3c11d4.js +0 -1
  140. package/assets/esri/core/workers/chunks/2cbcf34cf896a438999b.js +0 -1
  141. package/assets/esri/core/workers/chunks/394b645d51e7bf799382.js +0 -1
  142. package/assets/esri/core/workers/chunks/50ab9a3f8bbb268fae59.js +0 -1
  143. package/assets/esri/core/workers/chunks/5b2dd164dd84fd1ca4f7.js +0 -1
  144. package/assets/esri/core/workers/chunks/62c228ca16fdc7a2c695.js +0 -1
  145. package/assets/esri/core/workers/chunks/639202a461b17840a13f.js +0 -1
  146. package/assets/esri/core/workers/chunks/693d269637135047a0c4.js +0 -1
  147. package/assets/esri/core/workers/chunks/6a14ec2d2de6778a4e7a.js +0 -1
  148. package/assets/esri/core/workers/chunks/6d3467997b5d01630b08.js +0 -1
  149. package/assets/esri/core/workers/chunks/6dfcb0c804e63e87e311.js +0 -1
  150. package/assets/esri/core/workers/chunks/778ab9e4c3928b0d7d74.js +0 -1
  151. package/assets/esri/core/workers/chunks/8012fdc49a7a10982f78.js +0 -1
  152. package/assets/esri/core/workers/chunks/85e0fd618625a639387f.js +0 -1
  153. package/assets/esri/core/workers/chunks/86465d4bb185d7460087.js +0 -1
  154. package/assets/esri/core/workers/chunks/87e7378b242debbfd575.js +0 -1
  155. package/assets/esri/core/workers/chunks/90b19e60c056f32623e7.js +0 -1
  156. package/assets/esri/core/workers/chunks/9461f7225c42cf15a114.js +0 -1
  157. package/assets/esri/core/workers/chunks/978649cb6df99ee728be.js +0 -1
  158. package/assets/esri/core/workers/chunks/9f5f4da954228d876219.js +0 -1
  159. package/assets/esri/core/workers/chunks/a2323c957c8b2fe225b4.js +0 -1
  160. package/assets/esri/core/workers/chunks/a36a33f43610c3cd985b.js +0 -1
  161. package/assets/esri/core/workers/chunks/a381932eef77f4d80292.js +0 -1
  162. package/assets/esri/core/workers/chunks/b089947c9a492c96ca27.js +0 -1
  163. package/assets/esri/core/workers/chunks/b6e4c35b76379088035c.js +0 -1
  164. package/assets/esri/core/workers/chunks/b96dce64bdd7487e862a.js +0 -1
  165. package/assets/esri/core/workers/chunks/c4a78ab84186c7be599a.js +0 -1
  166. package/assets/esri/core/workers/chunks/c9d600dc6b6b5aafff1c.js +0 -1
  167. package/assets/esri/core/workers/chunks/ca33847a997ccfe8ddc2.js +0 -1
  168. package/assets/esri/core/workers/chunks/cca19c9564be2d02a277.js +0 -1
  169. package/assets/esri/core/workers/chunks/ccc2f2b3db008d8a495f.js +0 -1
  170. package/assets/esri/core/workers/chunks/d9f900975ac915a0f24f.js +0 -1
  171. package/assets/esri/core/workers/chunks/dd5d66f067e2386e0514.js +0 -1
  172. package/assets/esri/core/workers/chunks/eb4ffb72c9360062141c.js +0 -1
  173. package/assets/esri/core/workers/chunks/ebae903845643d60b44a.js +0 -1
  174. package/assets/esri/core/workers/chunks/ebb0372e8da0f75c09dd.js +0 -1
  175. package/assets/esri/core/workers/chunks/f349f64f683620bdf9b5.js +0 -30
  176. package/assets/esri/core/workers/chunks/f6fb87092bdf6bbf0769.js +0 -1
  177. package/assets/esri/core/workers/chunks/f76c2b09e6ba9d107898.js +0 -1
  178. package/assets/esri/core/workers/chunks/fcf962f3dec6b5440983.js +0 -1
  179. /package/assets/esri/core/workers/chunks/{43c8b1473695574c663e.js.LICENSE.txt → 4754610760f3f634adf9.js.LICENSE.txt} +0 -0
  180. /package/assets/esri/core/workers/chunks/{3861644c06cfebe8f40c.js.LICENSE.txt → 527547fa10d52cb3a7b1.js.LICENSE.txt} +0 -0
  181. /package/assets/esri/core/workers/chunks/{b586f1021a27c5e1551a.js.LICENSE.txt → 7189e03cc24f5c10865a.js.LICENSE.txt} +0 -0
  182. /package/assets/esri/core/workers/chunks/{3f812b0a28afb47aaaf0.js.LICENSE.txt → a35d1be700ebd3109397.js.LICENSE.txt} +0 -0
  183. /package/assets/esri/core/workers/chunks/{13d1cb50232ae761425b.js.LICENSE.txt → eaeb95be8d4032513247.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clone as t}from"../../../../core/lang.js";import{getMetersPerVerticalUnitForSR as e}from"../../../../core/units.js";import{e as r}from"../../../../chunks/earcut.js";import{normalFromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as o,invertOrIdentity as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as l,sub as c,cross as m,add as p,normalize as h,transformMat4 as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ONES as u,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as y}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as f,fromBuffer as b,intersectsClippingArea as _}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as x}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as j,getZeroIndexArray as S}from"../../../../geometry/support/Indices.js";import{t as w}from"../../../../chunks/vec3.js";import{SnappingCandidateVertex as P,SnappingCandidateEdge as v}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as C}from"../../../../renderers/support/renderingInfoUtils.js";import{needsElevationUpdates3D as E,SampleElevationInfo as A}from"./elevationAlignmentUtils.js";import{extrudePolygon as D}from"./extrudeUtils.js";import{Object3DEdgeState as I,Graphics3DObject3DGraphicLayer as U}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as z}from"./Graphics3DSymbolLayer.js";import{computeCentroid as M}from"./graphicUtils.js";import{geometryAsPolygon as O}from"./polygonUtils.js";import{createMaterial as L}from"../support/edgeUtils.js";import{encodeNaNUInt8 as G}from"../support/symbolColorUtils.js";import{debugFlags as V}from"../../support/debugFlags.js";import{SamplePosition as T}from"../../support/ElevationProvider.js";import{polygonToRenderInfo as B}from"../../support/renderInfoUtils/polygon.js";import{Attribute as F}from"../../webgl-engine/lib/Attribute.js";import{Geometry as R}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as H}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as N,compressNormal as W}from"../../webgl-engine/lib/Normals.js";import{Object3D as k}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as q}from"../../webgl-engine/materials/DefaultMaterial.js";const Z=["polygon","extent"];class J extends z{constructor(t,e,r,s){super(t,e,r,s,$(e)),this.ensureDrapedStatus(!1)}async doLoad(){const t=this.symbolLayer,e=t?.material,r=this.symbolLayer.material?.color?.a,s=this.needsDrivenTransparentPass||null!=r&&1!==r,i=e?.emissive,o=("color"===i?.source?i?.strength:void 0)??0,n=!this._hasDrivenColorOrOpacity&&(null==r||0===r),a={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,ambient:u,diffuse:u,opacity:n?0:1,layerOpacity:this._getLayerOpacity(),drivenOpacity:s,hasSymbolColors:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:t.castShadows,emissiveStrengthFromSymbol:o,emissiveSource:1,offsetTransparentBackfaces:!0,normalType:1},l=new q(a,this._context),c=new q({...a,cullFace:2},this._context);this._materials[0]=l,this._materials[1]=c,this._updateTransparentDepedentMaterialParameters()}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(t){const e=t.graphic;if(!this._validateGeometry(e.geometry,Z,this.symbolLayer.type))return null;const r=this._getDrivenUInt8ColorWithNaNSupport(t.renderingInfo,this._materialColor,!1);G(r,r);const s=this.createElevationContextForGraphic(e);return this._createAs3DShape(e,t.renderingInfo,r,s,e.uid)}layerOpacityChanged(t,e){const r=this._getLayerOpacity();this._materials[0]?.setParameters({layerOpacity:r}),this._materials[1]?.setParameters({layerOpacity:r}),this._updateTransparentDepedentMaterialParameters(),t?.forEach(t=>e(t)?.layerOpacityChanged(r,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(t,e){return this.updateGraphics3DGraphicElevationInfo(t,e,E)}slicePlaneEnabledChanged(t,e){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),t?.forEach(t=>{const r=e(t);null!=r&&r.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){const t={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[0]?.setParameters(t),this._materials[1]?.setParameters(t),!0}_getExtrusionSize(t){let e;return e=t.size&&this._drivenProperties.size?C(t.size.output,2)??0:this._getSymbolSize(),e/=this._context.renderCoordsHelper.unitInMeters,e}applyRendererDiff(t,e){return this._drivenPropertiesChanged(e)?0:1}async queryForSnapping(r,s,i,o){const n=this._getExtrusionSize(i)*this._context.renderCoordsHelper.unitInMeters/e(s),{objectId:a,target:l}=r,c=t(l);switch(c.z=(c.z??0)+n,r.type){case"edge":{const{start:e,end:s}=r,i=t(e),o=t(s);return i.z=(i.z??0)+n,o.z=(o.z??0)+n,[new v(a,c,1/0,i,o)]}case"vertex":return[new P(a,c,1/0),new v(a,l,1/0,l,c)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(t,e,n,l,c){const m=O(t.geometry);if(null==m)return null;if(0===m.rings.length||!m.rings.some(t=>t.length>0))return this._logGeometryValidationWarnings(m.rings,"rings","ExtrudeSymbol3DLayer"),null;const p=B(m,this._context.elevationProvider,this._context.renderCoordsHelper,l);this._logGeometryCreationWarnings(p,m.rings,"rings","ExtrudeSymbol3DLayer");const h=M(m);if(null==h)return null;const d=new Array,u=new Array,S=f(),P=a(),v=g(),C=1===this._context.renderCoordsHelper.viewingMode;C||this._context.renderCoordsHelper.worldUpAtPosition(null,v),y(m.spatialReference,[h.x,h.y,0],P,this._context.renderCoordsHelper.spatialReference);const A=a();o(A,P);const z=i();s(z,A);const{polygons:G,mapPositions:V,position:T}=p,F=new Map,R=this._materials[0];for(const s of G){const t=s.count;if(this._context.clippingExtent&&(b(s.mapPositions,S),!_(S,this._context.clippingExtent)))continue;const i=r(s.mapPositions,s.holeIndices,3);if(0===i.length)continue;const o=i.length,a=6*t,l=j(a+o),m=j(o),p=x(3*a),h=x(3*a),g=x(3*a),y=x(a),f=this._getExtrusionSize(e);D(T,V,i,s,p,g,h,y,l,m,f,v,C),w(p,p,A);const E=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:c,layerViewUid:this._context.layerViewUid}),I=new at(p,g,N(h),y),U=K(R,l,l.length-m.length,I,n,E),z=t,M=t,O=2*s.count,L=new lt(z,M,O,o/3);Y(U,L,P),F.set(U,L),d.push(U,K(this._materials[1],m,0,I,n,E)),u.push(I.heights)}if(0===d.length)return null;const H=new k({geometries:d,layerViewUid:this._context.layerViewUid,graphicUid:c,isElevationSource:!0});H.transformation=P;const W=L(this.symbolLayer,{opacity:this._getLayerOpacity()}),q=W?new I(this._materials[0],W,this._context.slicePlaneEnabled):null,Z=new U(this,H,null,(t,e,r,s,i)=>X(t,e,r,s,i,u,F),l,q);return Z.alignedSampledElevation=p.sampledElevation,Z.needsElevationUpdates=E(l.mode),Z}get _materialColor(){return this.symbolLayer.material?.color}_updateTransparentDepedentMaterialParameters(){const t=this._materials[0];t&&t.setParameters({cullFace:t.transparent?0:2})}}function K(t,e,r,s,i,o){const n=S(e.length),a=[["position",new F(s.positions,e,3,!0)],["normalCompressed",new F(s.normals,e,2,!0)],["symbolColor",new F(i,n,4,!0)]];return new R(t,a,s.elevation,0,o,r)}const Q=g();function X(t,e,r,s,i,o,c){const m=t.stageObject,p=m.geometries,h=p.length,u="absolute-height"!==e.mode;let g=0;const y=m.transformation,f=n(a(),y);for(let n=0;n<h;n+=2){const t=p[n];if(!H(t))continue;const e=t.getMutableAttribute("position").data,a=o[n/2],h=new T(t.mapPositions),b=e.length/3;let _=!1,x=0;{let t=0;for(let o=0;o<b;o++){Q[0]=e[t],Q[1]=e[t+1],Q[2]=e[t+2],s(h,rt),u&&(x+=rt.sampledElevation),V.TESTS_DISABLE_OPTIMIZATIONS?(l(tt,h.array[h.offset],h.array[h.offset+1],rt.z+a[t/3]),null!=r&&i.toRenderCoords(tt,r,tt),d(tt,tt,f)):(l(tt,e[t],e[t+1],e[t+2]),d(tt,tt,y),i.setAltitude(tt,rt.z+a[t/3]),d(tt,tt,f)),e[t]=tt[0],e[t+1]=tt[1],e[t+2]=tt[2];const o=st/i.unitInMeters;(Math.abs(Q[0]-e[t])>=o||Math.abs(Q[1]-e[t+1])>=o||Math.abs(Q[2]-e[t+2])>=o)&&(_=!0),h.offset+=3,t+=3}}if(_){const e=c.get(t);e&&Y(t,e,y),m.geometryVertexAttributeUpdated(p[n],"normalCompressed"),t.invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(p[n],"position"),p[n+1].invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(p[n+1],"position")}g+=x/b}return g/h}function Y(t,e,r){const s=t.getMutableAttribute("position"),i=t.getMutableAttribute("normalCompressed").data,o=s.data,n=t.attributes.get("position").indices,{topVertexStart:a,topVertexCount:u,topFaceStart:g,topFaceCount:y}=e,f=g+y,b=a+u,_=it,x=ot,j=nt,S=et,w=tt;l(w,0,0,0);const P=(t,e)=>{const s=3*t;l(e,o[s+0],o[s+1],o[s+2]),d(e,e,r)};for(let l=g;l<f;++l){const t=3*l;P(n[t+0],_[0]),P(n[t+1],_[1]),P(n[t+2],_[2]),c(x,_[1],_[0]),c(j,_[2],_[0]),m(S,x,j),p(w,w,S)}h(w,w);for(let l=a;l<b;++l){const t=w[0],e=w[1],r=w[2];W(i,l,t,e,r)}}function $(t){return 1===(t.material?.color?.a??0)}const tt=g(),et=g(),rt=new A,st=.01,it=[g(),g(),g()],ot=g(),nt=g();class at{constructor(t,e,r,s){this.positions=t,this.elevation=e,this.normals=r,this.heights=s}}class lt{constructor(t,e,r,s){this.topVertexStart=t,this.topVertexCount=e,this.topFaceStart=r,this.topFaceCount=s}}export{J as Graphics3DExtrudeSymbolLayer};
2
+ import{clone as t}from"../../../../core/lang.js";import{getMetersPerVerticalUnitForSR as e}from"../../../../core/units.js";import{e as r}from"../../../../chunks/earcut.js";import{normalFromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as o,invertOrIdentity as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as l,sub as c,cross as m,add as p,normalize as h,transformMat4 as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ONES as u,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as f,ZEROS as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as b}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as _,fromBuffer as x,intersectsClippingArea as S}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as j}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as w,getZeroIndexArray as v}from"../../../../geometry/support/Indices.js";import{t as C}from"../../../../chunks/vec3.js";import{SnappingCandidateVertex as P,SnappingCandidateEdge as E}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as I}from"../../../../renderers/support/renderingInfoUtils.js";import{needsElevationUpdates3D as A,SampleElevationInfo as D}from"./elevationAlignmentUtils.js";import{extrudePolygon as U}from"./extrudeUtils.js";import{Object3DEdgeState as M,Graphics3DObject3DGraphicLayer as O}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as z}from"./Graphics3DSymbolLayer.js";import{computeCentroid as L}from"./graphicUtils.js";import{geometryAsPolygon as G}from"./polygonUtils.js";import{createMaterial as V}from"../support/edgeUtils.js";import{encodeNaNUInt8 as B}from"../support/symbolColorUtils.js";import{debugFlags as T}from"../../support/debugFlags.js";import{SamplePosition as R}from"../../support/ElevationProvider.js";import{polygonToRenderInfo as F}from"../../support/renderInfoUtils/polygon.js";import{Attribute as H}from"../../webgl-engine/lib/Attribute.js";import{Geometry as N}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as W}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as k,compressNormal as q}from"../../webgl-engine/lib/Normals.js";import{Object3D as Z}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as J}from"../../webgl-engine/materials/DefaultMaterial.js";const K=["polygon","extent"];class Q extends z{constructor(t,e,r,s){super(t,e,r,s,rt(e)),this.ensureDrapedStatus(!1)}async doLoad(){const t=this.symbolLayer,e=t?.material,r=this.symbolLayer.material?.color?.a,s=this._hasDrivenColorOrOpacity,i=this.needsDrivenTransparentPass||s&&null!=r&&r<1,o=e?.emissive,n=("color"===o?.source?o?.strength:void 0)??0,a=!s&&(null==r||0===r),l=s?f:this._materialColor?.toUnitRGBA()??y,c={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,useIndexing:!0,ambient:u,diffuse:u,externalColor:l,opacity:a?0:1,layerOpacity:this._getLayerOpacity(),drivenOpacity:i,hasSymbolColors:s,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:t.castShadows,emissiveStrengthFromSymbol:n,emissiveSource:1,offsetTransparentBackfaces:!0,normalType:1},m=new J(c,this._context),p=new J({...c,cullFace:2},this._context);this._materials[0]=m,this._materials[1]=p,this._updateTransparentDepedentMaterialParameters()}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(t){const e=t.graphic;if(!this._validateGeometry(e.geometry,K,this.symbolLayer.type))return null;const r=this._getDrivenUInt8ColorWithNaNSupport(t.renderingInfo,this._materialColor,!1);B(r,r);const s=this.createElevationContextForGraphic(e);return this._createAs3DShape(e,t.renderingInfo,r,s,e.uid)}layerOpacityChanged(t,e){const r=this._getLayerOpacity();this._materials[0]?.setParameters({layerOpacity:r}),this._materials[1]?.setParameters({layerOpacity:r}),this._updateTransparentDepedentMaterialParameters(),t?.forEach(t=>e(t)?.layerOpacityChanged(r,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(t,e){return this.updateGraphics3DGraphicElevationInfo(t,e,A)}slicePlaneEnabledChanged(t,e){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),t?.forEach(t=>{const r=e(t);null!=r&&r.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){const t={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[0]?.setParameters(t),this._materials[1]?.setParameters(t),!0}_getExtrusionSize(t){let e;return e=t.size&&this._drivenProperties.size?I(t.size.output,2)??0:this._getSymbolSize(),e/=this._context.renderCoordsHelper.unitInMeters,e}applyRendererDiff(t,e){return this._drivenPropertiesChanged(e)?0:1}async queryForSnapping(r,s,i,o){const n=this._getExtrusionSize(i)*this._context.renderCoordsHelper.unitInMeters/e(s),{objectId:a,target:l}=r,c=t(l);switch(c.z=(c.z??0)+n,r.type){case"edge":{const{start:e,end:s}=r,i=t(e),o=t(s);return i.z=(i.z??0)+n,o.z=(o.z??0)+n,[new E(a,c,1/0,i,o)]}case"vertex":return[new P(a,c,1/0),new E(a,l,1/0,l,c)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(t,e,n,l,c){const m=G(t.geometry);if(null==m)return null;if(0===m.rings.length||!m.rings.some(t=>t.length>0))return this._logGeometryValidationWarnings(m.rings,"rings","ExtrudeSymbol3DLayer"),null;const p=F(m,this._context.elevationProvider,this._context.renderCoordsHelper,l);this._logGeometryCreationWarnings(p,m.rings,"rings","ExtrudeSymbol3DLayer");const h=L(m);if(null==h)return null;const d=new Array,u=new Array,f=_(),y=a(),v=g(),P=1===this._context.renderCoordsHelper.viewingMode;P||this._context.renderCoordsHelper.worldUpAtPosition(null,v),b(m.spatialReference,[h.x,h.y,0],y,this._context.renderCoordsHelper.spatialReference);const E=a();o(E,y);const I=i();s(I,E);const{polygons:D,mapPositions:z,position:B}=p,T=new Map,R=this._materials[0];for(const s of D){const t=s.count;if(this._context.clippingExtent&&(x(s.mapPositions,f),!S(f,this._context.clippingExtent)))continue;const i=r(s.mapPositions,s.holeIndices,3);if(0===i.length)continue;const o=i.length,a=6*t,l=w(a+o),m=w(o),p=j(3*a),h=j(3*a),g=j(3*a),b=j(a),_=this._getExtrusionSize(e);U(B,z,i,s,p,g,h,b,l,m,_,v,P),C(p,p,E);const I=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:c,layerViewUid:this._context.layerViewUid}),A=new mt(p,g,k(h),b),D=X(R,l,l.length-m.length,A,n,I),M=t,O=t,L=2*s.count,G=new pt(M,O,L,o/3);et(D,G,y),T.set(D,G),d.push(D,X(this._materials[1],m,0,A,n,I)),u.push(A.heights)}if(0===d.length)return null;const H=new Z({geometries:d,layerViewUid:this._context.layerViewUid,graphicUid:c,isElevationSource:!0});H.transformation=y;const N=V(this.symbolLayer,{opacity:this._getLayerOpacity()}),W=N?new M(this._materials[0],N,this._context.slicePlaneEnabled):null,q=new O(this,H,null,(t,e,r,s,i)=>tt(t,e,r,s,i,u,T),l,W);return q.alignedSampledElevation=p.sampledElevation,q.needsElevationUpdates=A(l.mode),q}get _materialColor(){return this.symbolLayer.material?.color}_updateTransparentDepedentMaterialParameters(){const t=this._materials[0];t&&t.setParameters({cullFace:t.transparent?0:2})}}function X(t,e,r,s,i,o){const{attributeIndices:n,drawIndices:a}=Y(e),l=[["position",new H(s.positions,n,3,!0)],["normalCompressed",new H(s.normals,n,2,!0)]];if(t.parameters.hasSymbolColors){const t=v(n.length);l.push(["symbolColor",new H(i,t,4,!0)])}return new N(t,l,s.elevation,0,o,r,null,a)}function Y(t){const e=new Array,r=new Map,s=new Array;for(let i=0;i<t.length;++i){const o=t[i];let n=r.get(o);null==n&&(n=e.length,e.push(o),r.set(o,n)),s.push(n)}return{attributeIndices:e,drawIndices:s}}const $=g();function tt(t,e,r,s,i,o,c){const m=t.stageObject,p=m.geometries,h=p.length,u="absolute-height"!==e.mode;let g=0;const f=m.transformation,y=n(a(),f);for(let n=0;n<h;n+=2){const t=p[n];if(!W(t))continue;const e=t.getMutableAttribute("position").data,a=o[n/2],h=new R(t.mapPositions),b=e.length/3;let _=!1,x=0;{let t=0;for(let o=0;o<b;o++){$[0]=e[t],$[1]=e[t+1],$[2]=e[t+2],s(h,ot),u&&(x+=ot.sampledElevation),T.TESTS_DISABLE_OPTIMIZATIONS?(l(st,h.array[h.offset],h.array[h.offset+1],ot.z+a[t/3]),null!=r&&i.toRenderCoords(st,r,st),d(st,st,y)):(l(st,e[t],e[t+1],e[t+2]),d(st,st,f),i.setAltitude(st,ot.z+a[t/3]),d(st,st,y)),e[t]=st[0],e[t+1]=st[1],e[t+2]=st[2];const o=nt/i.unitInMeters;(Math.abs($[0]-e[t])>=o||Math.abs($[1]-e[t+1])>=o||Math.abs($[2]-e[t+2])>=o)&&(_=!0),h.offset+=3,t+=3}}if(_){const e=c.get(t);e&&et(t,e,f),m.geometryVertexAttributeUpdated(p[n],"normalCompressed"),t.invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(p[n],"position"),p[n+1].invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(p[n+1],"position")}g+=x/b}return g/h}function et(t,e,r){const s=t.getMutableAttribute("position"),i=t.getMutableAttribute("normalCompressed").data,o=s.data,n=t.primitivePositionIndices,{topVertexStart:a,topVertexCount:u,topFaceStart:g,topFaceCount:f}=e,y=g+f,b=a+u,_=at,x=lt,S=ct,j=it,w=st;l(w,0,0,0);const v=(t,e)=>{const s=3*t;l(e,o[s+0],o[s+1],o[s+2]),d(e,e,r)};for(let l=g;l<y;++l){const t=3*l;v(n[t+0],_[0]),v(n[t+1],_[1]),v(n[t+2],_[2]),c(x,_[1],_[0]),c(S,_[2],_[0]),m(j,x,S),p(w,w,j)}h(w,w);for(let l=a;l<b;++l){const t=w[0],e=w[1],r=w[2];q(i,l,t,e,r)}}function rt(t){return 1===(t.material?.color?.a??0)}const st=g(),it=g(),ot=new D,nt=.01,at=[g(),g(),g()],lt=g(),ct=g();class mt{constructor(t,e,r,s){this.positions=t,this.elevation=e,this.normals=r,this.heights=s}}class pt{constructor(t,e,r,s){this.topVertexStart=t,this.topVertexCount=e,this.topFaceStart=r,this.topFaceCount=s}}export{Q as Graphics3DExtrudeSymbolLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{getMetersPerUnitForSR as e}from"../../../../core/units.js";import{e as t}from"../../../../chunks/earcut.js";import{set as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as i,create as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scale as n}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{toRadian as s}from"../../../../core/libs/gl-matrix-2/math/common.js";import{fromBuffer as a,intersectsClippingArea as l,empty as c,expandWithAABB as h,create as p}from"../../../../geometry/support/aaBoundingBox.js";import{empty as m,expandPointInPlace as u,create as d}from"../../../../geometry/support/aaBoundingRect.js";import{newFloatArray as g,floatSubArray as y}from"../../../../geometry/support/FloatArray.js";import{perVertexElevationAligner as f}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as v,needsElevationUpdates2D as x}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as _}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as b}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as w}from"./Graphics3DSymbolLayer.js";import{geometryAsPolygon as D,createWaterGeometry as S,PolygonCreationDataBase as C}from"./polygonUtils.js";import{polygonToRenderInfo as G,polygonToRenderInfoDraped as j}from"../../support/renderInfoUtils/polygon.js";import{Object3D as P}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as L}from"../../webgl-engine/lib/RenderGeometry.js";import{Parameters as O,WaterMaterial as A}from"../../webgl-engine/materials/WaterMaterial.js";import{wavePresets as E}from"../../webgl-engine/materials/internal/waterMaterialUtils.js";const T=["polyline","polygon","extent"];class U extends w{static{this.unitSizeOfTexture=100}static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,r,i){super(e,t,r,i)}async doLoad(){}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,T,this.symbolLayer.type))return null;const r=this.createElevationContextForGraphic(t);return this.ensureDrapedStatus("on-the-ground"===r.mode),this.ensureMaterial(),this.draped?this._createAsOverlay(t):this._createAs3DShape(t,r,t.uid)}ensureMaterial(){if(this._materials[0])return;const e=new O,t=this.symbolLayer.color.toUnitRGBA();t[3]*=this._getLayerOpacity(),e.color=t,e.transparent=t[3]<1||this.needsDrivenTransparentPass,e.waveDirection=null!=this.symbolLayer.waveDirection?B(this.symbolLayer.waveDirection):i(0,0);const r=this.symbolLayer.waveStrength+"-"+this.symbolLayer.waterbodySize,o=E[r];e.waveStrength=o.waveStrength,e.waveTextureRepeat=o.textureRepeat,e.waveVelocity=o.waveVelocity,e.flowStrength=o.perturbationStrength,e.hasSlicePlane=this._context.slicePlaneEnabled,e.draped=this.draped,this._materials[0]=new A(e,this._context)}layerOpacityChanged(){if(null==this._materials[0])return;const e=this._materials[0].parameters.color,t=this.symbolLayer.color.a*this._getLayerOpacity(),r=t<1||this.needsDrivenTransparentPass;this._materials[0].setParameters({color:[e[0],e[1],e[2],t],transparent:r})}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,o=v(U.elevationModeChangeTypes,r,i);if(1!==o)return o;const n=x(i);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>n)}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}get needsDrivenTransparentPass(){return!1}_createAs3DShape(e,t,r){const i=D(e.geometry);if(null==i)return null;const o=G(i,this._context.elevationProvider,this._context.renderCoordsHelper,t),n=o.position.length/3,s=g(2*n);M(s,o.mapPositions,n,this._context.elevationProvider.spatialReference);const a=new W(o,s,this._context.layerViewUid,e.uid);if(a.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(a),this._create3DShapeGeometries(a),this._logGeometryCreationWarnings(a.renderData,i.rings,"rings","WaterSymbol3DLayer"),0===a.outGeometries.length)return null;const l=new P({geometries:a.outGeometries,castShadow:!1,layerViewUid:this._context.layerViewUid,graphicUid:r}),c=new b(this,l,null,f,t);return c.alignedSampledElevation=a.renderData.sampledElevation,c.needsElevationUpdates=x(t.mode),c}_create3DShapeGeometries(e){const r=e.renderData.polygons,i=e.uvCoords;for(const{count:o,index:n,position:s,mapPositions:c,holeIndices:h}of r){if(null!=this._context.clippingExtent&&(a(c,I),!l(I,this._context.clippingExtent)))continue;const r=t(c,h,3);if(0===r.length)continue;const p=y(i,2*n,2*o),m=S({material:this._materials[0],indices:r,mapPositions:c,attributeData:{position:s,uv0:p}},e.olidColor);e.outGeometries.push(m)}}_createAsOverlay(e){const t=D(e.geometry);if(null==t)return null;this._materials[0].renderPriority=this._renderPriority;const r=j(t,this._context.overlaySR),i=r.position.length/3,o=g(2*i);M(o,r.position,i,this._context.overlaySR);const n=new F(r,o,this._context.layerViewUid,e.uid);return n.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(n),n.outBoundingBox=c(),this._createAsOverlayWater(n),this._logGeometryCreationWarnings(n.renderData,t.rings,"rings","WaterSymbol3DLayer"),0===n.outGeometries.length?null:new _(this,n.outGeometries,n.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayWater(e){const r=e.uvCoords,i=e.renderData.polygons;for(const{position:o,holeIndices:n,index:s,count:c}of i){if(a(o,I),!l(I,this._context.clippingExtent))continue;h(e.outBoundingBox,I);const i=t(o,n,3);if(0===i.length)continue;const p=y(r,2*s,2*c),m=S({material:this._materials[0],indices:i,attributeData:{position:o,uv0:p}},e.olidColor);e.outGeometries.push(new L(m,e))}}test(){return{...super.test(),create3DShape:e=>this._createAs3DShape(e.graphic,e.elevationContext,e.graphicUid),ensureMaterial:()=>this.ensureMaterial()}}}function B(e){const t=o(),r=s(e);return t[0]=Math.sin(r),t[1]=Math.cos(r),t}function M(t,i,o,s){const a=e(s);m(V);for(let e=0;e<o;e++)r(z,i[3*e],i[3*e+1]),u(V,z);n(V,V,a);const l=V[0]%U.unitSizeOfTexture,c=V[1]%U.unitSizeOfTexture;R[0]=V[0]-l,R[1]=V[1]-c;for(let e=0;e<o;e++)t[2*e]=(i[3*e]*a-R[0])/U.unitSizeOfTexture,t[2*e+1]=(i[3*e+1]*a-R[1])/U.unitSizeOfTexture}const R=o(),V=d(),z=o(),I=p();class W extends C{constructor(e,t,r,i){super(e,r,i),this.uvCoords=t}}class F extends C{constructor(e,t,r,i){super(e,r,i),this.uvCoords=t}}export{U as Graphics3DWaterSymbolLayer,B as headingVectorFromAngle};
2
+ import{getMetersPerUnitForSR as e}from"../../../../core/units.js";import{e as t}from"../../../../chunks/earcut.js";import{set as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as i,create as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scale as n}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{toRadian as s}from"../../../../core/libs/gl-matrix-2/math/common.js";import{fromBuffer as a,intersectsClippingArea as l,empty as c,expandWithAABB as h,create as p}from"../../../../geometry/support/aaBoundingBox.js";import{empty as m,expandPointInPlace as u,create as d}from"../../../../geometry/support/aaBoundingRect.js";import{newFloatArray as g,floatSubArray as y}from"../../../../geometry/support/FloatArray.js";import{perVertexElevationAligner as f}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as x,needsElevationUpdates2D as v}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as _}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as b}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as w}from"./Graphics3DSymbolLayer.js";import{geometryAsPolygon as D,createWaterGeometry as S,PolygonCreationDataBase as C}from"./polygonUtils.js";import{polygonToRenderInfo as G,polygonToRenderInfoDraped as j}from"../../support/renderInfoUtils/polygon.js";import{Object3D as P}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as L}from"../../webgl-engine/lib/RenderGeometry.js";import{Parameters as O,WaterMaterial as A}from"../../webgl-engine/materials/WaterMaterial.js";import{wavePresets as E}from"../../webgl-engine/materials/internal/waterMaterialUtils.js";const T=["polyline","polygon","extent"];class U extends w{static{this.unitSizeOfTexture=100}static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,r,i){super(e,t,r,i)}async doLoad(){}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,T,this.symbolLayer.type))return null;const r=this.createElevationContextForGraphic(t);return this.ensureDrapedStatus("on-the-ground"===r.mode),this.ensureMaterial(),this.draped?this._createAsOverlay(t):this._createAs3DShape(t,r,t.uid)}ensureMaterial(){if(this._materials[0])return;const e=new O,t=this.symbolLayer.color.toUnitRGBA();t[3]*=this._getLayerOpacity(),e.color=t,e.transparent=t[3]<1||this.needsDrivenTransparentPass,e.waveDirection=null!=this.symbolLayer.waveDirection?B(this.symbolLayer.waveDirection):i(0,0);const r=this.symbolLayer.waveStrength+"-"+this.symbolLayer.waterbodySize,o=E[r];e.waveStrength=o.waveStrength,e.waveTextureRepeat=o.textureRepeat,e.waveVelocity=o.waveVelocity,e.flowStrength=o.perturbationStrength,e.hasSlicePlane=this._context.slicePlaneEnabled,e.draped=this.draped,e.useIndexing=!0,this._materials[0]=new A(e,this._context)}layerOpacityChanged(){if(null==this._materials[0])return;const e=this._materials[0].parameters.color,t=this.symbolLayer.color.a*this._getLayerOpacity(),r=t<1||this.needsDrivenTransparentPass;this._materials[0].setParameters({color:[e[0],e[1],e[2],t],transparent:r})}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,o=x(U.elevationModeChangeTypes,r,i);if(1!==o)return o;const n=v(i);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>n)}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}get needsDrivenTransparentPass(){return!1}_createAs3DShape(e,t,r){const i=D(e.geometry);if(null==i)return null;const o=G(i,this._context.elevationProvider,this._context.renderCoordsHelper,t),n=o.position.length/3,s=g(2*n);M(s,o.mapPositions,n,this._context.elevationProvider.spatialReference);const a=new W(o,s,this._context.layerViewUid,e.uid);if(a.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(a),this._create3DShapeGeometries(a),this._logGeometryCreationWarnings(a.renderData,i.rings,"rings","WaterSymbol3DLayer"),0===a.outGeometries.length)return null;const l=new P({geometries:a.outGeometries,castShadow:!1,layerViewUid:this._context.layerViewUid,graphicUid:r}),c=new b(this,l,null,f,t);return c.alignedSampledElevation=a.renderData.sampledElevation,c.needsElevationUpdates=v(t.mode),c}_create3DShapeGeometries(e){const r=e.renderData.polygons,i=e.uvCoords;for(const{count:o,index:n,position:s,mapPositions:c,holeIndices:h}of r){if(null!=this._context.clippingExtent&&(a(c,z),!l(z,this._context.clippingExtent)))continue;const r=t(c,h,3);if(0===r.length)continue;const p=y(i,2*n,2*o),m=S({material:this._materials[0],indices:r,mapPositions:c,attributeData:{position:s,uv0:p}},e.olidColor);e.outGeometries.push(m)}}_createAsOverlay(e){const t=D(e.geometry);if(null==t)return null;this._materials[0].renderPriority=this._renderPriority;const r=j(t,this._context.overlaySR),i=r.position.length/3,o=g(2*i);M(o,r.position,i,this._context.overlaySR);const n=new F(r,o,this._context.layerViewUid,e.uid);return n.olidColor=this._context.stage.renderView?.getObjectAndLayerIdColor(n),n.outBoundingBox=c(),this._createAsOverlayWater(n),this._logGeometryCreationWarnings(n.renderData,t.rings,"rings","WaterSymbol3DLayer"),0===n.outGeometries.length?null:new _(this,n.outGeometries,n.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayWater(e){const r=e.uvCoords,i=e.renderData.polygons;for(const{position:o,holeIndices:n,index:s,count:c}of i){if(a(o,z),!l(z,this._context.clippingExtent))continue;h(e.outBoundingBox,z);const i=t(o,n,3);if(0===i.length)continue;const p=y(r,2*s,2*c),m=S({material:this._materials[0],indices:i,attributeData:{position:o,uv0:p}},e.olidColor);e.outGeometries.push(new L(m,e))}}test(){return{...super.test(),create3DShape:e=>this._createAs3DShape(e.graphic,e.elevationContext,e.graphicUid),ensureMaterial:()=>this.ensureMaterial()}}}function B(e){const t=o(),r=s(e);return t[0]=Math.sin(r),t[1]=Math.cos(r),t}function M(t,i,o,s){const a=e(s);m(I);for(let e=0;e<o;e++)r(V,i[3*e],i[3*e+1]),u(I,V);n(I,I,a);const l=I[0]%U.unitSizeOfTexture,c=I[1]%U.unitSizeOfTexture;R[0]=I[0]-l,R[1]=I[1]-c;for(let e=0;e<o;e++)t[2*e]=(i[3*e]*a-R[0])/U.unitSizeOfTexture,t[2*e+1]=(i[3*e+1]*a-R[1])/U.unitSizeOfTexture}const R=o(),I=d(),V=o(),z=p();class W extends C{constructor(e,t,r,i){super(e,r,i),this.uvCoords=t}}class F extends C{constructor(e,t,r,i){super(e,r,i),this.uvCoords=t}}export{U as Graphics3DWaterSymbolLayer,B as headingVectorFromAngle};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{e as t}from"../../../../chunks/earcut.js";import e from"../../../../geometry/Extent.js";import o from"../../../../geometry/Polygon.js";import{getContinuousIndexArray as r,getZeroIndexArray as i}from"../../../../geometry/support/Indices.js";import{leastSignificantAxis as n}from"../../../../geometry/support/polygonUtils.js";import{Attribute as a}from"../../webgl-engine/lib/Attribute.js";import{Geometry as u}from"../../webgl-engine/lib/Geometry.js";function s(e,o,r){const i=(o.length>0?o[0]:e.length/3)-1,a=n(e,i,r);if(2!==a){e=e.slice();for(let t=0;t<e.length;t+=3)e[t+a]=e[t+2]}return t(e,o,3)}function l(t){const e=t.attributeData.position.length/3,o=r(e),n=[["position",new a(t.attributeData.position,o,3,!0)]],{boundingRect:s}=t.attributeData,l=null!=s,c=l?[0]:i(e);return null!=t.attributeData.colorFeature?n.push(["colorFeatureAttribute",new a([t.attributeData.colorFeature],c,1,!0)]):t.attributeData.color&&n.push(["color",new a(t.attributeData.color,c,4,!0)]),t.attributeData.uvMapSpace&&n.push(["uvMapSpace",new a(t.attributeData.uvMapSpace,o,4,!0)]),l&&n.push(["boundingRect",new a(s,c,9,!0)]),new u(t.material,n,t.mapPositions,0,t.attributeData.olidColor,void 0,void 0,t.indices)}function c(t,e=null){const o=[["position",new a(t.attributeData.position,t.indices,3,!0)],["uv0",new a(t.attributeData.uv0,t.indices,2,!0)]];return new u(t.material,o,t.mapPositions,0,e)}function p(t){switch(t.type){case"extent":if(t instanceof e)return o.fromExtent(t);break;case"polygon":return t}return null}class m{constructor(t,e,o){this.renderData=t,this.layerViewUid=e,this.graphicUid=o,this.outGeometries=new Array}}export{m as PolygonCreationDataBase,l as createColorGeometry,s as createIndices3D,c as createWaterGeometry,p as geometryAsPolygon};
2
+ import{e as t}from"../../../../chunks/earcut.js";import e from"../../../../geometry/Extent.js";import o from"../../../../geometry/Polygon.js";import{getContinuousIndexArray as i,getZeroIndexArray as r}from"../../../../geometry/support/Indices.js";import{leastSignificantAxis as a}from"../../../../geometry/support/polygonUtils.js";import{Attribute as n}from"../../webgl-engine/lib/Attribute.js";import{Geometry as u}from"../../webgl-engine/lib/Geometry.js";function s(e,o,i){const r=(o.length>0?o[0]:e.length/3)-1,n=a(e,r,i);if(2!==n){e=e.slice();for(let t=0;t<e.length;t+=3)e[t+n]=e[t+2]}return t(e,o,3)}function l(t){const e=t.attributeData.position.length/3,o=i(e),a=[["position",new n(t.attributeData.position,o,3,!0)]],{boundingRect:s}=t.attributeData,l=null!=s,p=l?[0]:r(e);return null!=t.attributeData.colorFeature?a.push(["colorFeatureAttribute",new n([t.attributeData.colorFeature],p,1,!0)]):t.attributeData.color&&a.push(["color",new n(t.attributeData.color,p,4,!0)]),t.attributeData.uvMapSpace&&a.push(["uvMapSpace",new n(t.attributeData.uvMapSpace,o,4,!0)]),l&&a.push(["boundingRect",new n(s,p,9,!0)]),new u(t.material,a,t.mapPositions,0,t.attributeData.olidColor,void 0,void 0,t.indices)}function p(t,e=null){const o=t.attributeData.position.length/3,r=i(o),a=[["position",new n(t.attributeData.position,r,3,!0)],["uv0",new n(t.attributeData.uv0,r,2,!0)]];return new u(t.material,a,t.mapPositions,0,e,void 0,void 0,t.indices)}function c(t){switch(t.type){case"extent":if(t instanceof e)return o.fromExtent(t);break;case"polygon":return t}return null}class m{constructor(t,e,o){this.renderData=t,this.layerViewUid=e,this.graphicUid=o,this.outGeometries=new Array}}export{m as PolygonCreationDataBase,l as createColorGeometry,s as createIndices3D,p as createWaterGeometry,c as geometryAsPolygon};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as o}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/FocusAreaColor.glsl.js";import{makePipelineState as t,defaultColorWrite as c}from"../../../../webgl/renderState.js";let a=class extends s{constructor(){super(...arguments),this.shader=new o(i,()=>import("./FocusAreaColor.glsl.js"))}initializePipeline(){return t({colorWrite:c})}};a=e([r("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaColorTechnique")],a);export{a as FocusAreaColorTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ReloadableShader as o}from"../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/FocusAreaColor.glsl.js";import{makePipelineState as t,defaultColorWrite as c}from"../../../../webgl/renderState.js";let a=class extends s{constructor(){super(...arguments),this.shader=new o(i,()=>import("./FocusAreaColor.glsl.js")),this.ignoreUnused=!0}initializePipeline(){return t({colorWrite:c})}};a=e([r("esri.views.3d.webgl-engine.effects.focusArea.FocusAreaColorTechnique")],a);export{a as FocusAreaColorTechnique};
@@ -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{equals as r,binaryIndexOf as s}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import n from"../../../../../core/Logger.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as o,destroyMaybe as a}from"../../../../../core/maybe.js";import{isAbortError as l,onAbortOrThrow as c}from"../../../../../core/promiseUtils.js";import{property as d,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as u,transpose as g,invert as m}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as _,copy as b,sub as y,dot as w}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as j,clone as O}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as E}from"../../../../../core/support/UpdatingHandles.js";import{c as v}from"../../../../../chunks/vec32.js";import{TwoVectorPosition as x}from"../../core/util/TwoVectorPosition.js";import{Attribute as M}from"../Attribute.js";import{GridLocalOriginFactory as T}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as R}from"../localOriginHelper.js";import{LocalOriginManager as C}from"../LocalOriginManager.js";import{Object3D as A}from"../Object3D.js";import{VertexArrayObject as P}from"../VertexArrayObject.js";import{VertexLayout as D,glVertexLayout as L,edgeViewTextureLayout as S,EdgeInputBufferLayout as k,RegularEdgeInstancesGLLayout as U,SilhouetteEdgeInstancesGLLayout as q}from"./bufferLayouts.js";import{EdgeRenderer as H,lineWidthFractionFactor as B,extensionLengthOffset as V}from"./EdgeRenderer.js";import{EdgePassParameters as I}from"./EdgeShaderParameters.js";import{EdgeWorkerHandle as F}from"./EdgeWorkerHandle.js";import{LegacyTransform as N,isLegacyTransform as z}from"./LegacyTransform.js";import{generateStrokesTexture as W}from"./strokes.js";import{determineRendererType as G,determineEdgeTransparency as K,determineObjectTransparency as J,fillComponentBufferIndices as Q}from"./util.js";import{BufferManager as X}from"../TextureBackedBuffer/BufferManager.js";import{VertexBuffer as Y}from"../../../../webgl/VertexBuffer.js";const Z=128;let $=class extends t{constructor(e){super(e),this._updatingHandles=new E,this._objectEntries=new Map,this._pendingDeletions=new Map,this._renderers=new Map,this._gpuMemoryUsage=0,this._workerAbort=new AbortController,this._tmpModelPosition=j(),this._localOrigins=new C(new T(e.renderSR));const t=D.createBuffer(4);for(let r=0;r<4;r++)t.sideness.set(r,0,0===r||3===r?0:1),t.sideness.set(r,1,0===r||1===r?0:1);this._vertexBuffer=new Y(e.rctx,L,t.buffer)}initialize(){this._workerHandle=new F(this.schedule),this._componentColorManager=new X(this.rctx,S)}destroy(){this.destroyed||(this._objectEntries.forEach(e=>this._discardObjectEntry(e)),this._objectEntries.clear(),this._pendingDeletions.forEach(e=>this._discardObjectEntry(e)),this._pendingDeletions.clear(),this._strokesTexture=o(this._strokesTexture),this._componentColorManager=a(this._componentColorManager),this._workerAbort.abort(),this._workerHandle.destroy(),this._vertexBuffer.dispose(),this._renderers.clear(),this._updatingHandles.destroy(),this._set("schedule",pe))}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,t,r,s,n,i,o){if(this.hasObject(e))return this._getObjectMemoryUsage(e);let a;const l=new re(null,new Promise(e=>a=e),e.obb.center,e.obb.radius);this._objectEntries.set(e,l);const c=await this._updatingHandles.addPromise(this._addComponentGeometry(e.transform,l,t,r,s,n,i,o));return this.setNeedsRender(),a(),c}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void n.getLogger(this).warn("Attempt to add an object to a destroyed instance");const i=new AbortController;let o;const{center:a,radius:c}=e.boundingVolumeWorldSpace.bounds,d=new re(i,new Promise(e=>o=e),a,c),h=this._objectEntries.get(e);h&&(this._pendingDeletions.has(e)?this._discardObjectEntry(h):this._pendingDeletions.set(e,h)),this._objectEntries.set(e,d);try{const n=new Array;if(e.geometries.length>1&&te(e))n.push(this._addObjectMergedGeometries(e,d,t,r,s));else for(const i of e.geometries)i.material.supportsEdges&&n.push(this._addGeometry(e,d,i,t,r,s));await this._updatingHandles.addPromise(Promise.all(n)),this._removePendingDeletion(e)}catch(u){l(u)?this._discardObjectEntry(d):this._removePendingDeletion(e)}finally{this.setNeedsRender(),o()}}removeObject(e){const t=this._objectEntries.get(e);this._objectEntries.delete(e),this._discardObjectEntry(t),this._removePendingDeletion(e)}_removePendingDeletion(e){const t=this._pendingDeletions.get(e);this._pendingDeletions.delete(e),this._discardObjectEntry(t)}async _getObjectEntry(e){const t=this._objectEntries.get(e);if(!t)throw new Error("no object");return await t.loaded,null==t.loaded?null:t}fastUpdateObject3DEdgesTransform(e){if(this.destroyed)return!1;const t=this._objectEntries.get(e);if(!t)return!1;const{geometries:r}=e,{renderables:s}=t;if(0===r.length||0===s.length)return!0;if(s.length>1)return!1;const[n]=s,i=n.transform;if(!(i instanceof N))return!1;const[o]=r;if(o.localOrigin!==i.origin.origin)return!1;const a=p(),l=this._computeModelTransformWithLocalOrigin(e,o,a);return n.transform=new N(a,l),this.setNeedsRender(),!0}_discardObjectEntry(e){e&&(e.abort?.abort(),e.renderables.length&&(e.renderables.forEach(e=>this._removeRenderable(e)),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._objectEntries.has(e)}async updateAllComponentOpacities(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(null==r)return;const s=Array.isArray(t)?e=>t[e]:()=>t;r.renderables.forEach(e=>{const{meta:t,buffer:r}=e.components,n=t.length,i=r.textureBuffer.getScalarField("opacity");for(let o=0;o<n;o++){const e=s(o),r=t[o],n=r.index;r.material.opacity=e,i.set(n,e)}this._updateTransparency(e)}),this.setNeedsRender()}async _getObjectMemoryUsage(e){const t=await this._getObjectEntry(e);return t?t.renderables.reduce((e,t)=>e+t.statistics.gpuMemoryUsage,0):0}async updateAllComponentMaterials(e,t,r,s){const n=e instanceof A,i=G(t),o=H.getKey(i,r,n),a=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=a&&(a.renderables.forEach(e=>{if(o!==e.rendererKey){const t=this._renderers.get(e.rendererKey),s=this._acquireRenderer(i,r,n);t.removeRenderable(e),--t.refCount,e.rendererKey=o,s.addRenderable(e)}if(Array.isArray(t))for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];else e.components.meta[0].material=t;s&&ae(e.components),this._updateTransparency(e)}),this.setNeedsRender())}async updateAllVerticalOffsets(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&this._updateAllVerticalOffsets(r,t)}_updateAllVerticalOffsets(e,t){e.renderables.forEach(e=>{const r=e.components.meta;for(let s=0;s<r.length;s++)e.components.meta[s].verticalOffset=t?.[s]??0;ae(e.components)}),this.setNeedsRender()}async updateObjectVisibility(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));r&&(r.renderables.forEach(e=>e.visible=t),this.setNeedsRender())}render(e,t){if(null==this._componentColorManager)return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=j(),n=new x;let i=0,o=0;if(this._renderers.forEach(r=>{0!==r.refCount?(++this.techniques.precompiling,r.forEachRenderable(t=>{t.visible&&(i+=t.statistics.averageEdgeLength,o++,t.regular&&r.acquireTechnique(e,!1),t.silhouette&&r.acquireTechnique(e,!0))},t),--this.techniques.precompiling):this._renderers.delete(r.key)}),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),0===o)return;const a=new I(40*i/o,t);_(s,r[3],r[7],r[11]),n.set(s),b(a.transformWorldFromViewTH,n.high),b(a.transformWorldFromViewTL,n.low),u(a.transformViewFromCameraRelativeRS,e.camera.viewMatrix),g(fe,a.transformViewFromCameraRelativeRS),m(a.transformNormalViewFromGlobal,fe),this._updateObjectCameraDistances(e),this._renderers.forEach(t=>{le(t,e,a),ce(t,e,a)})}_updateTransparency(e){const t=K(e.components.meta),r=J(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){e.getCombinedShaderTransformation(t,r);const s=null!=t.localOrigin?this._localOrigins.register(t.localOrigin):this._localOrigins.acquire(_(this._tmpModelPosition,r[12],r[13],r[14]));return t.localOrigin=s.origin,R(s.origin.vec3,r),s}_createComponentBuffers(e){if(null==this._componentColorManager)return null;const t=new Array,r=this._componentColorManager.getBuffer(e.length),s=r.acquireIndices(e.length);for(let i=0;i<e.length;i++){const r=e[i],n=s[i];t.push({index:n,verticalOffset:0,material:r})}const n=new se(r,t);return ae(n),n}_extractEdges(e,t,r,s,n,i,o=i.length){return o<Z&&(n=!0),this._workerHandle.process({data:r,indices:i,indicesLength:o,writerSettings:t,skipDeduplicate:s},e,n)}_createRenderable(e,t,r,s,n){const i=t=>new ne(new P(this.rctx,new Map([["vertices",this._vertexBuffer],["instances",0===t?new Y(this.rctx,U,e.regular.instancesData.buffer):new Y(this.rctx,q,e.silhouette.instancesData.buffer)]])),0===t?e.regular.lodInfo:e.silhouette.lodInfo),o=e.regular.lodInfo.lengths.length>0?i(0):null,a=e.silhouette.lodInfo.lengths.length>0?i(1):null,l=(o?.vao.usedMemory??0)+(a?.vao.usedMemory??0);return new ie(o,a,{gpuMemoryUsage:l,externalMemoryUsage:n,averageEdgeLength:e.averageEdgeLength},r,K(t.meta),J(t.meta),t,s)}async _addGeometry(e,t,r,s,n,i){if(r.edgeIndicesLength<=0)return;const o=r.attributes.get("position"),a=p(),l=this._computeModelTransformWithLocalOrigin(e,r,a),c=new me(o,a,l);return this._addPositionData(t,c,r.edgeIndicesLength,s,n,i)}async _addPositionData(e,t,r,s,n,i=!1){if(null==e.loaded)return;const o=this._createComponentBuffers([s]);if(null==o)return;const a=this._acquireRenderer(s.type,n,!0),{modelTransform:l,origin:c}=t,d=t.position.indices,h=t.position,u=h.data.length/h.size,g=k.createBuffer(u);for(let p=0;p<u;p++)g.position.set(p,0,h.data[p*h.size]),g.position.set(p,1,h.data[p*h.size+1]),g.position.set(p,2,h.data[p*h.size+2]);Q(o.meta,[0,g.componentIndex.count],g.componentIndex);const m=await this._updatingHandles.addPromise(this._extractEdges(e.abort?.signal||this._workerAbort.signal,a.writerSettings,g,!1,i,d,r));if(null==e.loaded)return;const f=this._createRenderable(m,o,new N(l,c),a.key,!1);e.renderables.push(f),a.addRenderable(f),this._gpuMemoryUsage+=f.statistics.gpuMemoryUsage}async _addComponentGeometry(e,t,r,s,n,i,o,a){if(null==t.loaded)return 0;const l=this._createComponentBuffers(i);if(null==l)return 0;const c=G(i),d=this._acquireRenderer(c,o||!1,!1),h=k.createBuffer(r.length/3);v(h.position.typedBuffer,r,h.position.typedBufferStride,3),Q(l.meta,n,h.componentIndex,s);const u=!0,g=d.writerSettings,m=await this._updatingHandles.addPromise(this._extractEdges(this._workerAbort.signal,g,h,u,!1,s));if(null==t.loaded)return 0;const f=this._createRenderable(m,l,e,d.key,!0);return t.renderables.push(f),d.addRenderable(f),this._updateAllVerticalOffsets(t,a),f.statistics.gpuMemoryUsage}async _addObjectMergedGeometries(e,t,r,s,n){const i=new Map;let o=0,a=0,l=null;const c=e.geometries.filter(e=>{if(e.edgeIndicesLength<=0||!e.material.supportsEdges)return!1;!l&&e.localOrigin&&(l=e);const t=e.positionAttribute;return a+=t.data.length/t.size,o+=e.edgeIndicesLength,!0});if(0===c.length)return;const d=a>=65536?Uint32Array:Uint16Array,h=o?new d(o):null,u=[];let g=0;c.forEach(e=>{const t=e.attributes.get("position"),r=t.indices;let s=i.get(t.data);if(null==s){s=u.length/3;for(let e=0;e<t.data.length;e+=t.size)u.push(t.data[e]),u.push(t.data[e+1]),u.push(t.data[e+2]);i.set(t.data,s)}for(let n=0;n<e.edgeIndicesLength;n++)h[g++]=s+r[n]});const m=l||e.geometries[0],f=p(),_=this._computeModelTransformWithLocalOrigin(e,m,f);for(let p=0;p<e.geometries.length;p++)e.geometries[p].localOrigin=_.origin;const b=new me(new M(u,h,3),f,_);await this._updatingHandles.addPromise(this._addPositionData(t,b,h.length,r,s,n))}_acquireRenderer(e,t,r){const s=H.getKey(e,t,r);let n=this._renderers.get(s);return null==this._strokesTexture&&(this._strokesTexture=W(this.rctx)),n||(n=new H(this.rctx,this.techniques,{type:e,hasSlicePlane:t,strokesTexture:this._strokesTexture,legacy:r,spherical:1===this.viewingMode}),this._renderers.set(s,n)),++n.refCount,n}_removeRenderable(e){ee(e.regular),ee(e.silhouette);const t=this._renderers.get(e.rendererKey);if(t){t.removeRenderable(e),--t.refCount,z(e.transform)&&this._localOrigins.release(e.transform.origin),this._gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=j(),n=e=>{y(s,e.center,t);const n=w(s,r),i=e.radius,o=n<-i?1/0:n<i?0:n-i;e.renderables.forEach(e=>e.distanceToCamera=o)};this._objectEntries.forEach(n),this._pendingDeletions.forEach(n)}get test(){}};function ee(e){e?.vao&&(e.vao.buffer("instances")?.dispose(),e.vao.disposeVAOOnly(),e.vao=null)}function te(e){let t=null,s=null;for(const n of e.geometries){if(n.material.supportsEdges){if(t){if(!r(t,n.transformation))return!1}else t=n.transformation;if(s||null==n.localOrigin){if(null!=s?.localOrigin&&null!=n.localOrigin&&s.localOrigin.id!==n.localOrigin.id)return!1}else s=n}}return!0}e([d({constructOnly:!0})],$.prototype,"rctx",void 0),e([d({constructOnly:!0})],$.prototype,"renderSR",void 0),e([d({constructOnly:!0})],$.prototype,"viewingMode",void 0),e([d({constructOnly:!0})],$.prototype,"techniques",void 0),e([d({constructOnly:!0})],$.prototype,"setNeedsRender",void 0),e([d({constructOnly:!0})],$.prototype,"schedule",void 0),e([d({readOnly:!0})],$.prototype,"_updatingHandles",void 0),e([d({readOnly:!0})],$.prototype,"updating",null),$=e([h("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],$);class re{constructor(e,t,r,s){this.abort=e,this.radius=s,this.renderables=new Array;const n=e?c(e.signal,()=>e.abort()):null;this.loaded=t,this.loaded.then(()=>{null!=this.loaded&&(this.loaded=!0),this.abort=null,n?.remove()}),this.center=O(r)}}class se{constructor(e,t){this.buffer=e,this.meta=t}}class ne{constructor(e,t){this.vao=e,this.lod=t}}class ie{constructor(e,t,r,s,n,i,o,a){this.regular=e,this.silhouette=t,this.statistics=r,this.transform=s,this.edgeTransparency=n,this.objectTransparency=i,this.components=o,this.rendererKey=a,this.distanceToCamera=0,this.visible=!0}}class oe extends ie{}function ae(e){const{meta:t,buffer:r}=e,s=r.textureBuffer,n=s.getVec4Field("color"),o=s.getScalarField("lineWidth"),a=s.getScalarField("extensionLength"),l=s.getScalarField("materialType"),c=s.getScalarField("opacity"),d=s.getScalarField("elevationOffset");for(let h=0;h<t.length;h++){const e=t[h].material,r=t[h].index,s=i(Math.round(e.size*B),0,255),u=i(e.extensionLength,-V,255-V)+V;n.setArray(r,e.color),o.set(r,s),a.set(r,u),l.set(r,e.type),c.set(r,e.opacity),d.set(r,t[h].verticalOffset)}}function le(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable(i=>{if(!de(i)||!i.visible)return;s??=e.acquireTechnique(t,!1),n??=e.rctx.bindTechnique(s,t,r);const a=ge(i.regular.lod.lengths,i.distanceToCamera,o);e.renderRegularEdges(n,i,r,t,a)},i)}function ce(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable(i=>{if(!ue(i)||!i.visible)return;s??=e.acquireTechnique(t,!0),n??=e.rctx.bindTechnique(s,t,r);const a=ge(i.silhouette.lod.lengths,i.distanceToCamera,o);e.renderSilhouetteEdges(n,i,r,t,a)},i)}function de(e){return null!=e.regular}class he extends ie{}function ue(e){return null!=e.silhouette}function ge(e,t,r){const n=t*r,i=s(e,n,!0);return-1===i?n<e[0]?e.length:0:e.length-i}class me{constructor(e,t,r){this.position=e,this.modelTransform=t,this.origin=r}}const fe=f(),pe=()=>Promise.reject();export{$ as EdgeView,oe as RegularRenderable,ie as Renderable,he as SilhouetteRenderable};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{equals as r,binaryIndexOf as s}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import n from"../../../../../core/Logger.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as o,destroyMaybe as a}from"../../../../../core/maybe.js";import{isAbortError as c,onAbortOrThrow as l}from"../../../../../core/promiseUtils.js";import{property as d,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as u,transpose as g,invert as m}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as _,copy as b,sub as y,dot as w}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as j,clone as O}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as E}from"../../../../../core/support/UpdatingHandles.js";import{c as v}from"../../../../../chunks/vec32.js";import{TwoVectorPosition as x}from"../../core/util/TwoVectorPosition.js";import{Attribute as M}from"../Attribute.js";import{GridLocalOriginFactory as T}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as R}from"../localOriginHelper.js";import{LocalOriginManager as C}from"../LocalOriginManager.js";import{Object3D as A}from"../Object3D.js";import{VertexArrayObject as P}from"../VertexArrayObject.js";import{VertexLayout as D,glVertexLayout as L,edgeViewTextureLayout as S,EdgeInputBufferLayout as k,RegularEdgeInstancesGLLayout as U,SilhouetteEdgeInstancesGLLayout as q}from"./bufferLayouts.js";import{EdgeRenderer as H,lineWidthFractionFactor as B,extensionLengthOffset as V}from"./EdgeRenderer.js";import{EdgePassParameters as I}from"./EdgeShaderParameters.js";import{EdgeWorkerHandle as F}from"./EdgeWorkerHandle.js";import{LegacyTransform as z,isLegacyTransform as N}from"./LegacyTransform.js";import{generateStrokesTexture as W}from"./strokes.js";import{determineRendererType as G,determineEdgeTransparency as K,determineObjectTransparency as J,fillComponentBufferIndices as Q}from"./util.js";import{BufferManager as X}from"../TextureBackedBuffer/BufferManager.js";import{VertexBuffer as Y}from"../../../../webgl/VertexBuffer.js";const Z=128;let $=class extends t{constructor(e){super(e),this._updatingHandles=new E,this._objectEntries=new Map,this._pendingDeletions=new Map,this._renderers=new Map,this._gpuMemoryUsage=0,this._workerAbort=new AbortController,this._tmpModelPosition=j(),this._localOrigins=new C(new T(e.renderSR));const t=D.createBuffer(4);for(let r=0;r<4;r++)t.sideness.set(r,0,0===r||3===r?0:1),t.sideness.set(r,1,0===r||1===r?0:1);this._vertexBuffer=new Y(e.rctx,L,t.buffer)}initialize(){this._workerHandle=new F(this.schedule),this._componentColorManager=new X(this.rctx,S)}destroy(){this.destroyed||(this._objectEntries.forEach(e=>this._discardObjectEntry(e)),this._objectEntries.clear(),this._pendingDeletions.forEach(e=>this._discardObjectEntry(e)),this._pendingDeletions.clear(),this._strokesTexture=o(this._strokesTexture),this._componentColorManager=a(this._componentColorManager),this._workerAbort.abort(),this._workerHandle.destroy(),this._vertexBuffer.dispose(),this._renderers.clear(),this._updatingHandles.destroy(),this._set("schedule",pe))}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,t,r,s,n,i,o){if(this.hasObject(e))return this._getObjectMemoryUsage(e);let a;const c=new re(null,new Promise(e=>a=e),e.obb.center,e.obb.radius);this._objectEntries.set(e,c);const l=await this._updatingHandles.addPromise(this._addComponentGeometry(e.transform,c,t,r,s,n,i,o));return this.setNeedsRender(),a(),l}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void n.getLogger(this).warn("Attempt to add an object to a destroyed instance");const i=new AbortController;let o;const{center:a,radius:l}=e.boundingVolumeWorldSpace.bounds,d=new re(i,new Promise(e=>o=e),a,l),h=this._objectEntries.get(e);h&&(this._pendingDeletions.has(e)?this._discardObjectEntry(h):this._pendingDeletions.set(e,h)),this._objectEntries.set(e,d);try{const n=new Array;if(e.geometries.length>1&&te(e))n.push(this._addObjectMergedGeometries(e,d,t,r,s));else for(const i of e.geometries)i.material.supportsEdges&&n.push(this._addGeometry(e,d,i,t,r,s));await this._updatingHandles.addPromise(Promise.all(n)),this._removePendingDeletion(e)}catch(u){c(u)?this._discardObjectEntry(d):this._removePendingDeletion(e)}finally{this.setNeedsRender(),o()}}removeObject(e){const t=this._objectEntries.get(e);this._objectEntries.delete(e),this._discardObjectEntry(t),this._removePendingDeletion(e)}_removePendingDeletion(e){const t=this._pendingDeletions.get(e);this._pendingDeletions.delete(e),this._discardObjectEntry(t)}async _getObjectEntry(e){const t=this._objectEntries.get(e);if(!t)throw new Error("no object");return await t.loaded,null==t.loaded?null:t}fastUpdateObject3DEdgesTransform(e){if(this.destroyed)return!1;const t=this._objectEntries.get(e);if(!t)return!1;const{geometries:r}=e,{renderables:s}=t;if(0===r.length||0===s.length)return!0;if(s.length>1)return!1;const[n]=s,i=n.transform;if(!(i instanceof z))return!1;const[o]=r;if(o.localOrigin!==i.origin.origin)return!1;const a=p(),c=this._computeModelTransformWithLocalOrigin(e,o,a);return n.transform=new z(a,c),this.setNeedsRender(),!0}_discardObjectEntry(e){e&&(e.abort?.abort(),e.renderables.length&&(e.renderables.forEach(e=>this._removeRenderable(e)),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._objectEntries.has(e)}async updateAllComponentOpacities(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(null==r)return;const s=Array.isArray(t)?e=>t[e]:()=>t;r.renderables.forEach(e=>{const{meta:t,buffer:r}=e.components,n=t.length,i=r.textureBuffer.getScalarField("opacity");for(let o=0;o<n;o++){const e=s(o),r=t[o],n=r.index;r.material.opacity=e,i.set(n,e)}this._updateTransparency(e)}),this.setNeedsRender()}async _getObjectMemoryUsage(e){const t=await this._getObjectEntry(e);return t?t.renderables.reduce((e,t)=>e+t.statistics.gpuMemoryUsage,0):0}async updateAllComponentMaterials(e,t,r,s){const n=e instanceof A,i=G(t),o=H.getKey(i,r,n),a=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=a&&(a.renderables.forEach(e=>{if(o!==e.rendererKey){const t=this._renderers.get(e.rendererKey),s=this._acquireRenderer(i,r,n);t.removeRenderable(e),--t.refCount,e.rendererKey=o,s.addRenderable(e)}if(Array.isArray(t))for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];else e.components.meta[0].material=t;s&&ae(e.components),this._updateTransparency(e)}),this.setNeedsRender())}async updateAllVerticalOffsets(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&this._updateAllVerticalOffsets(r,t)}_updateAllVerticalOffsets(e,t){e.renderables.forEach(e=>{const r=e.components.meta;for(let s=0;s<r.length;s++)e.components.meta[s].verticalOffset=t?.[s]??0;ae(e.components)}),this.setNeedsRender()}async updateObjectVisibility(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));r&&(r.renderables.forEach(e=>e.visible=t),this.setNeedsRender())}render(e,t){if(null==this._componentColorManager)return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=j(),n=new x;let i=0,o=0;if(this._renderers.forEach(r=>{0!==r.refCount?(++this.techniques.precompiling,r.forEachRenderable(t=>{t.visible&&(i+=t.statistics.averageEdgeLength,o++,t.regular&&r.acquireTechnique(e,!1),t.silhouette&&r.acquireTechnique(e,!0))},t),--this.techniques.precompiling):this._renderers.delete(r.key)}),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),0===o)return;const a=new I(40*i/o,t);_(s,r[3],r[7],r[11]),n.set(s),b(a.transformWorldFromViewTH,n.high),b(a.transformWorldFromViewTL,n.low),u(a.transformViewFromCameraRelativeRS,e.camera.viewMatrix),g(fe,a.transformViewFromCameraRelativeRS),m(a.transformNormalViewFromGlobal,fe),this._updateObjectCameraDistances(e),this._renderers.forEach(t=>{ce(t,e,a),le(t,e,a)})}_updateTransparency(e){const t=K(e.components.meta),r=J(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){e.getCombinedShaderTransformation(t,r);const s=null!=t.localOrigin?this._localOrigins.register(t.localOrigin):this._localOrigins.acquire(_(this._tmpModelPosition,r[12],r[13],r[14]));return t.localOrigin=s.origin,R(s.origin.vec3,r),s}_createComponentBuffers(e){if(null==this._componentColorManager)return null;const t=new Array,r=this._componentColorManager.getBuffer(e.length),s=r.acquireIndices(e.length);for(let i=0;i<e.length;i++){const r=e[i],n=s[i];t.push({index:n,verticalOffset:0,material:r})}const n=new se(r,t);return ae(n),n}_extractEdges(e,t,r,s,n,i,o=i.length){return o<Z&&(n=!0),this._workerHandle.process({data:r,indices:i,indicesLength:o,writerSettings:t,skipDeduplicate:s},e,n)}_createRenderable(e,t,r,s,n){const i=t=>new ne(new P(this.rctx,new Map([["vertices",this._vertexBuffer],["instances",0===t?new Y(this.rctx,U,e.regular.instancesData.buffer):new Y(this.rctx,q,e.silhouette.instancesData.buffer)]])),0===t?e.regular.lodInfo:e.silhouette.lodInfo),o=e.regular.lodInfo.lengths.length>0?i(0):null,a=e.silhouette.lodInfo.lengths.length>0?i(1):null,c=(o?.vao.usedMemory??0)+(a?.vao.usedMemory??0);return new ie(o,a,{gpuMemoryUsage:c,externalMemoryUsage:n,averageEdgeLength:e.averageEdgeLength},r,K(t.meta),J(t.meta),t,s)}async _addGeometry(e,t,r,s,n,i){if(r.edgeIndicesLength<=0)return;const o=r.positionAttribute,a=r.primitivePositionIndices,c=a===o.indices?o:new M(o.data,a,o.size,!1,o.stride),l=p(),d=this._computeModelTransformWithLocalOrigin(e,r,l),h=new me(c,l,d);return this._addPositionData(t,h,r.edgeIndicesLength,s,n,i)}async _addPositionData(e,t,r,s,n,i=!1){if(null==e.loaded)return;const o=this._createComponentBuffers([s]);if(null==o)return;const a=this._acquireRenderer(s.type,n,!0),{modelTransform:c,origin:l}=t,d=t.position.indices,h=t.position,u=h.data.length/h.size,g=k.createBuffer(u);for(let p=0;p<u;p++)g.position.set(p,0,h.data[p*h.size]),g.position.set(p,1,h.data[p*h.size+1]),g.position.set(p,2,h.data[p*h.size+2]);Q(o.meta,[0,g.componentIndex.count],g.componentIndex);const m=await this._updatingHandles.addPromise(this._extractEdges(e.abort?.signal||this._workerAbort.signal,a.writerSettings,g,!1,i,d,r));if(null==e.loaded)return;const f=this._createRenderable(m,o,new z(c,l),a.key,!1);e.renderables.push(f),a.addRenderable(f),this._gpuMemoryUsage+=f.statistics.gpuMemoryUsage}async _addComponentGeometry(e,t,r,s,n,i,o,a){if(null==t.loaded)return 0;const c=this._createComponentBuffers(i);if(null==c)return 0;const l=G(i),d=this._acquireRenderer(l,o||!1,!1),h=k.createBuffer(r.length/3);v(h.position.typedBuffer,r,h.position.typedBufferStride,3),Q(c.meta,n,h.componentIndex,s);const u=!0,g=d.writerSettings,m=await this._updatingHandles.addPromise(this._extractEdges(this._workerAbort.signal,g,h,u,!1,s));if(null==t.loaded)return 0;const f=this._createRenderable(m,c,e,d.key,!0);return t.renderables.push(f),d.addRenderable(f),this._updateAllVerticalOffsets(t,a),f.statistics.gpuMemoryUsage}async _addObjectMergedGeometries(e,t,r,s,n){const i=new Map;let o=0,a=0,c=null;const l=e.geometries.filter(e=>{if(e.edgeIndicesLength<=0||!e.material.supportsEdges)return!1;!c&&e.localOrigin&&(c=e);const t=e.positionAttribute;return a+=t.data.length/t.size,o+=e.edgeIndicesLength,!0});if(0===l.length)return;const d=a>=65536?Uint32Array:Uint16Array,h=o?new d(o):null,u=[];let g=0;l.forEach(e=>{const t=e.positionAttribute,r=e.primitivePositionIndices;let s=i.get(t.data);if(null==s){s=u.length/3;for(let e=0;e<t.data.length;e+=t.size)u.push(t.data[e]),u.push(t.data[e+1]),u.push(t.data[e+2]);i.set(t.data,s)}for(let n=0;n<e.edgeIndicesLength;n++)h[g++]=s+r[n]});const m=c||e.geometries[0],f=p(),_=this._computeModelTransformWithLocalOrigin(e,m,f);for(let p=0;p<e.geometries.length;p++)e.geometries[p].localOrigin=_.origin;const b=new me(new M(u,h,3),f,_);await this._updatingHandles.addPromise(this._addPositionData(t,b,h.length,r,s,n))}_acquireRenderer(e,t,r){const s=H.getKey(e,t,r);let n=this._renderers.get(s);return null==this._strokesTexture&&(this._strokesTexture=W(this.rctx)),n||(n=new H(this.rctx,this.techniques,{type:e,hasSlicePlane:t,strokesTexture:this._strokesTexture,legacy:r,spherical:1===this.viewingMode}),this._renderers.set(s,n)),++n.refCount,n}_removeRenderable(e){ee(e.regular),ee(e.silhouette);const t=this._renderers.get(e.rendererKey);if(t){t.removeRenderable(e),--t.refCount,N(e.transform)&&this._localOrigins.release(e.transform.origin),this._gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=j(),n=e=>{y(s,e.center,t);const n=w(s,r),i=e.radius,o=n<-i?1/0:n<i?0:n-i;e.renderables.forEach(e=>e.distanceToCamera=o)};this._objectEntries.forEach(n),this._pendingDeletions.forEach(n)}get test(){}};function ee(e){e?.vao&&(e.vao.buffer("instances")?.dispose(),e.vao.disposeVAOOnly(),e.vao=null)}function te(e){let t=null,s=null;for(const n of e.geometries){if(n.material.supportsEdges){if(t){if(!r(t,n.transformation))return!1}else t=n.transformation;if(s||null==n.localOrigin){if(null!=s?.localOrigin&&null!=n.localOrigin&&s.localOrigin.id!==n.localOrigin.id)return!1}else s=n}}return!0}e([d({constructOnly:!0})],$.prototype,"rctx",void 0),e([d({constructOnly:!0})],$.prototype,"renderSR",void 0),e([d({constructOnly:!0})],$.prototype,"viewingMode",void 0),e([d({constructOnly:!0})],$.prototype,"techniques",void 0),e([d({constructOnly:!0})],$.prototype,"setNeedsRender",void 0),e([d({constructOnly:!0})],$.prototype,"schedule",void 0),e([d({readOnly:!0})],$.prototype,"_updatingHandles",void 0),e([d({readOnly:!0})],$.prototype,"updating",null),$=e([h("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],$);class re{constructor(e,t,r,s){this.abort=e,this.radius=s,this.renderables=new Array;const n=e?l(e.signal,()=>e.abort()):null;this.loaded=t,this.loaded.then(()=>{null!=this.loaded&&(this.loaded=!0),this.abort=null,n?.remove()}),this.center=O(r)}}class se{constructor(e,t){this.buffer=e,this.meta=t}}class ne{constructor(e,t){this.vao=e,this.lod=t}}class ie{constructor(e,t,r,s,n,i,o,a){this.regular=e,this.silhouette=t,this.statistics=r,this.transform=s,this.edgeTransparency=n,this.objectTransparency=i,this.components=o,this.rendererKey=a,this.distanceToCamera=0,this.visible=!0}}class oe extends ie{}function ae(e){const{meta:t,buffer:r}=e,s=r.textureBuffer,n=s.getVec4Field("color"),o=s.getScalarField("lineWidth"),a=s.getScalarField("extensionLength"),c=s.getScalarField("materialType"),l=s.getScalarField("opacity"),d=s.getScalarField("elevationOffset");for(let h=0;h<t.length;h++){const e=t[h].material,r=t[h].index,s=i(Math.round(e.size*B),0,255),u=i(e.extensionLength,-V,255-V)+V;n.setArray(r,e.color),o.set(r,s),a.set(r,u),c.set(r,e.type),l.set(r,e.opacity),d.set(r,t[h].verticalOffset)}}function ce(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable(i=>{if(!de(i)||!i.visible)return;s??=e.acquireTechnique(t,!1),n??=e.rctx.bindTechnique(s,t,r);const a=ge(i.regular.lod.lengths,i.distanceToCamera,o);e.renderRegularEdges(n,i,r,t,a)},i)}function le(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable(i=>{if(!ue(i)||!i.visible)return;s??=e.acquireTechnique(t,!0),n??=e.rctx.bindTechnique(s,t,r);const a=ge(i.silhouette.lod.lengths,i.distanceToCamera,o);e.renderSilhouetteEdges(n,i,r,t,a)},i)}function de(e){return null!=e.regular}class he extends ie{}function ue(e){return null!=e.silhouette}function ge(e,t,r){const n=t*r,i=s(e,n,!0);return-1===i?n<e[0]?e.length:0:e.length-i}class me{constructor(e,t,r){this.position=e,this.modelTransform=t,this.origin=r}}const fe=f(),pe=()=>Promise.reject();export{$ as EdgeView,oe as RegularRenderable,ie as Renderable,he as SilhouetteRenderable};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{exactEquals as e,set as r,copy as t,normalize as s,subtract as i,length as a,scale as o,dot as n,transformMat3 as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as u,create as c,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{is3DGeometryOutputMRT as m,isShadowLike as p,isColor as d}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as f}from"../lib/GLTextureMaterial.js";import{Material as T}from"../lib/Material.js";import{intersectTriangleGeometry as x}from"../lib/RayIntersections.js";import{getVerticalOffsetObject3D as g}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as v}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as S}from"./internal/MaterialUtil.js";import{getLayout as b,DefaultMaterialPassParameters as M,DefaultMaterialTechnique as O}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as C}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as w}from"../shaders/RealisticTreeTechnique.js";import{alphaCutoff as y}from"../../../../webscene/support/AlphaCutoff.js";class R extends T{constructor(e,r){super(e,P),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>(m(e)||p(e))&&!this.transparent],[4,e=>(m(e)||p(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>(m(e)||p(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=b(this.parameters),this._configuration=new C(r.spherical)}isVisibleForOutput(e){return 3!==e&&5!==e&&4!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:r,opacity:t,externalColor:s}=this.parameters;return e*("replace"===r?1:t)*("ignore"===r||isNaN(s[3])?1:s[3])>=y}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,r){const{parameters:t,_configuration:s}=this,{treeRendering:i,doubleSided:a,doubleSidedType:o}=t;return super.getConfiguration(e,r,this._configuration),s.hasNormalTexture=t.hasNormalTexture,s.hasColorTexture=t.hasColorTexture,s.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,s.hasOcclusionTexture=t.hasOcclusionTexture,s.hasVertexTangents=!i&&t.hasVertexTangents,s.instanced=t.instanced,s.instancedDoublePrecision=t.instancedDoublePrecision,s.hasVVColor=!!t.vvColor,s.hasVVSize=!!t.vvSize,s.hasVerticalOffset=null!=t.verticalOffset,s.hasScreenSizePerspective=null!=t.screenSizePerspective,s.hasSlicePlane=t.hasSlicePlane,s.alphaDiscardMode=t.textureAlphaMode,s.normalType=i?0:t.normalType,s.transparent=this.transparent,s.writeDepth=t.writeDepth,s.customDepthTest=t.customDepthTest??0,s.hasOccludees=r.hasOccludees,s.cullFace=t.hasSlicePlane?0:t.cullFace,s.cullAboveTerrain=r.cullAboveTerrain,s.hasModelTransformation=!i&&null!=t.modelTransformation,s.hasVertexColors=t.hasVertexColors,s.hasSymbolColors=t.hasSymbolColors,s.doubleSidedMode=i?2:a&&"normal"===o?1:a&&"winding-order"===o?2:0,s.instancedFeatureAttribute=t.instancedFeatureAttribute,s.instancedColor=t.instancedColor,d(e)?(s.terrainDepthTest=r.terrainDepthTest,s.receiveShadows=t.receiveShadows,s.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=r.ssao):(s.terrainDepthTest=!1,s.receiveShadows=s.receiveAmbientOcclusion=!1),s.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,s.pbrMode=t.usePBR?t.isSchematic?2:1:0,s.emissionSource=t.emissionSource,s.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),s.enableOffset=r.enableOffset,s.snowCover=r.snowCover>0,s.hasColorTextureTransform=!!t.colorTextureTransformMatrix,s.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,s.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,s.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,s.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix,s}intersect(e,u,c,h,m,p){if(null!=this.parameters.verticalOffset){const e=c.camera;r(N,u[12],u[13],u[14]);let p=null;switch(c.viewingMode){case 1:p=s(_,N);break;case 2:p=t(_,I)}const d=i(z,N,e.eye),f=a(d),T=o(d,d,1/f);let x=null;this.parameters.screenSizePerspective&&(x=n(p,T));const g=S(e,f,this.parameters.verticalOffset,x??0,this.parameters.screenSizePerspective,null);o(p,p,g),l(B,p,c.transform.inverseRotation),h=i(A,h,B),m=i(V,m,B)}x(e,c,h,m,g(c.verticalOffset),p)}createGLMaterial(e){return new D(e)}createBufferWriter(){return new v(this._layout)}get transparent(){return j(this.parameters)}}class D extends f{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const s=e.camera.viewInverseTransposeMatrix;return r(t.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?w:O,e)}}class P extends M{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function j(e){const{drivenOpacity:r,opacity:t,externalColor:s,layerOpacity:i,texture:a,textureId:o,textureAlphaMode:n,colorMixMode:l}=e,u=s[3];return r||t<1&&"replace"!==l||u<1&&"ignore"!==l||i<1||(null!=a||null!=o)&&1!==n&&2!==n&&"replace"!==l}const A=c(),V=c(),I=h(0,0,1),_=c(),B=c(),N=c(),z=c();export{D as DefaultGLMaterial,R as DefaultMaterial,P as DefaultMaterialParameters,j as isTransparent};
2
+ import{exactEquals as e,set as r,copy as t,normalize as s,subtract as i,length as a,scale as o,dot as n,transformMat3 as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as u,create as c,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{is3DGeometryOutputMRT as m,isShadowLike as p,isColor as d}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as f}from"../lib/GLTextureMaterial.js";import{Material as T}from"../lib/Material.js";import{intersectTriangleGeometry as x}from"../lib/RayIntersections.js";import{getVerticalOffsetObject3D as g}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as v}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as S}from"./internal/MaterialUtil.js";import{getLayout as b,DefaultMaterialPassParameters as M,DefaultMaterialTechnique as O}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as C}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as w}from"../shaders/RealisticTreeTechnique.js";import{alphaCutoff as y}from"../../../../webscene/support/AlphaCutoff.js";class R extends T{constructor(e,r){super(e,P),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>(m(e)||p(e))&&!this.transparent],[4,e=>(m(e)||p(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>(m(e)||p(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=b(this.parameters),this._configuration=new C(r.spherical)}isVisibleForOutput(e){return 3!==e&&5!==e&&4!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:r,opacity:t,externalColor:s}=this.parameters;return e*("replace"===r?1:t)*("ignore"===r||isNaN(s[3])?1:s[3])>=y}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,r){const{parameters:t,_configuration:s}=this,{treeRendering:i,doubleSided:a,doubleSidedType:o}=t;return super.getConfiguration(e,r,this._configuration),s.hasNormalTexture=t.hasNormalTexture,s.hasColorTexture=t.hasColorTexture,s.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,s.hasOcclusionTexture=t.hasOcclusionTexture,s.hasVertexTangents=!i&&t.hasVertexTangents,s.instanced=t.instanced,s.instancedDoublePrecision=t.instancedDoublePrecision,s.hasVVColor=!!t.vvColor,s.hasVVSize=!!t.vvSize,s.hasVerticalOffset=null!=t.verticalOffset,s.hasScreenSizePerspective=null!=t.screenSizePerspective,s.hasSlicePlane=t.hasSlicePlane,s.alphaDiscardMode=t.textureAlphaMode,s.normalType=i?0:t.normalType,s.transparent=this.transparent,s.writeDepth=t.writeDepth,s.customDepthTest=t.customDepthTest??0,s.hasOccludees=r.hasOccludees,s.cullFace=t.hasSlicePlane?0:t.cullFace,s.cullAboveTerrain=r.cullAboveTerrain,s.hasModelTransformation=!i&&null!=t.modelTransformation,s.hasVertexColors=t.hasVertexColors,s.hasSymbolColors=t.hasSymbolColors,s.doubleSidedMode=i?2:a&&"normal"===o?1:a&&"winding-order"===o?2:0,s.instancedFeatureAttribute=t.instancedFeatureAttribute,s.instancedColor=t.instancedColor,d(e)?(s.terrainDepthTest=r.terrainDepthTest,s.receiveShadows=t.receiveShadows,s.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=r.ssao):(s.terrainDepthTest=!1,s.receiveShadows=s.receiveAmbientOcclusion=!1),s.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,s.pbrMode=t.usePBR?t.isSchematic?2:1:0,s.emissionSource=t.emissionSource,s.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),s.enableOffset=r.enableOffset,s.snowCover=r.snowCover>0,s.hasColorTextureTransform=!!t.colorTextureTransformMatrix,s.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,s.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,s.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,s.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix,s}intersect(e,u,c,h,m,p){if(null!=this.parameters.verticalOffset){const e=c.camera;r(N,u[12],u[13],u[14]);let p=null;switch(c.viewingMode){case 1:p=s(_,N);break;case 2:p=t(_,V)}const d=i(z,N,e.eye),f=a(d),T=o(d,d,1/f);let x=null;this.parameters.screenSizePerspective&&(x=n(p,T));const g=S(e,f,this.parameters.verticalOffset,x??0,this.parameters.screenSizePerspective,null);o(p,p,g),l(B,p,c.transform.inverseRotation),h=i(A,h,B),m=i(I,m,B)}x(e,c,h,m,g(c.verticalOffset),p)}createGLMaterial(e){return new D(e)}createBufferWriter(){return new v(this._layout)}get transparent(){return j(this.parameters)}}class D extends f{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const s=e.camera.viewInverseTransposeMatrix;return r(t.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?w:O,e)}}class P extends M{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function j(e){const{drivenOpacity:r,opacity:t,externalColor:s,layerOpacity:i,texture:a,textureId:o,textureAlphaMode:n,colorMixMode:l}=e,u=s[3];return r||t<1&&"replace"!==l||u<1&&"ignore"!==l||i<1||(null!=a||null!=o)&&1!==n&&2!==n&&"replace"!==l}const A=c(),I=c(),V=h(0,0,1),_=c(),B=c(),N=c(),z=c();export{D as DefaultGLMaterial,R as DefaultMaterial,P as DefaultMaterialParameters,j as isTransparent};
@@ -132,7 +132,7 @@ export default class SelectionManager extends EventedAccessor {
132
132
  * @param layer - The selectable layer to which to add the selection. This must be a layer with object IDs in the [sources](#sources).
133
133
  * @param selection - An array of features, ie. [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to add to the current selection.
134
134
  */
135
- add(layer: SelectableLayerWithObjectIds, selection: ObjectId[]): void;
135
+ add(layer: SelectableLayerWithObjectIds, selection: ObjectId[] | Graphic[]): void;
136
136
  /**
137
137
  * Adds features to the current selection. It does not replace the existing selection.
138
138
  *
@@ -174,20 +174,20 @@ export default class SelectionManager extends EventedAccessor {
174
174
  /**
175
175
  * Removes the provided features from the current selection for the provided layer.
176
176
  *
177
- * @param target - The selectable layer from which to remove the selection. This must be a layer with graphics in the [sources](#sources).
177
+ * @param layer - The selectable layer from which to remove the selection. This must be a layer with graphics in the [sources](#sources).
178
178
  * @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) to remove from the current selection.
179
179
  */
180
- remove(target: GraphicsLayer, selection: Graphic[]): void;
180
+ remove(layer: GraphicsLayer, selection: Graphic[]): void;
181
181
  /**
182
- * @param target - The selectable layer from which to remove the selection. This must be a layer with object IDs in the [sources](#sources).
182
+ * @param layer - The selectable layer from which to remove the selection. This must be a layer with object IDs in the [sources](#sources).
183
183
  * @param selection - An array of features, ie. [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to remove from the current selection.
184
184
  */
185
- remove(target: SelectableLayerWithObjectIds, selection: ObjectId[]): void;
185
+ remove(layer: SelectableLayerWithObjectIds, selection: ObjectId[] | Graphic[]): void;
186
186
  /**
187
- * @param target - The selectable layer from which to remove the selection. This must be a layer in the [sources](#sources). It can be a layer with graphics or object IDs.
187
+ * @param layer - The selectable layer from which to remove the selection. This must be a layer in the [sources](#sources). It can be a layer with graphics or object IDs.
188
188
  * @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) or [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to remove from the current selection.
189
189
  */
190
- remove(target: SelectableLayer, selection: SelectionIdentifier[]): void;
190
+ remove(layer: SelectableLayer, selection: SelectionIdentifier[]): void;
191
191
  /**
192
192
  * Replaces the current selection for the provided layer with the provided features.
193
193
  *
@@ -199,7 +199,7 @@ export default class SelectionManager extends EventedAccessor {
199
199
  * @param layer - The selectable layer for which to replace the selection. This must be a layer with object IDs in the [sources](#sources).
200
200
  * @param selection - An array of features, ie. [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to set as the current selection.
201
201
  */
202
- replace(layer: SelectableLayerWithObjectIds, selection: ObjectId[]): void;
202
+ replace(layer: SelectableLayerWithObjectIds, selection: ObjectId[] | Graphic[]): void;
203
203
  /**
204
204
  * @param layer - The selectable layer for which to replace the selection. This must be a layer in the [sources](#sources). It can be a layer with graphics or object IDs.
205
205
  * @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) or [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to set as the current selection.
@@ -233,7 +233,7 @@ export default class SelectionManager extends EventedAccessor {
233
233
  * @param layer - The selectable layer for which to toggle the selection. This must be a layer with object IDs in the [sources](#sources).
234
234
  * @param selection - An array of features, ie. [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to toggle within the current selection.
235
235
  */
236
- toggle(layer: SelectableLayerWithObjectIds, selection: ObjectId[]): void;
236
+ toggle(layer: SelectableLayerWithObjectIds, selection: ObjectId[] | Graphic[]): void;
237
237
  /**
238
238
  * @param layer - The selectable layer for which to toggle the selection. This must be a layer in the [sources](#sources). It can be a layer with graphics or object IDs.
239
239
  * @param selection - An array of features, ie. [Graphic[]](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) or [ObjectId](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ObjectId)[] to toggle within the current selection.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t,difference as s}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{deprecatedProperty as n,deprecatedFunction as r}from"../core/deprecate.js";import{EventedAccessor as l}from"../core/Evented.js";import{makeHandle as a}from"../core/handleUtils.js";import c from"../core/Logger.js";import{getOrCreateMapValue as h}from"../core/MapUtils.js";import{destroyMaybe as d}from"../core/maybe.js";import p from"../core/ReactiveMap.js";import{watch as g,initial as u,on as f}from"../core/reactiveUtils.js";import{addMany as y,symmetricDifference as m}from"../core/SetUtils.js";import{property as _,subclass as w}from"../core/accessorSupport/decorators.js";import{UpdatingHandles as v}from"../core/support/UpdatingHandles.js";import{getGraphicLayer as S}from"../graphic/graphicOriginUtils.js";import{isSubtypeSublayer as M,isSubtypeGroupLayer as E,isKnowledgeGraphLayer as b,isMapImageLayer as j}from"../layers/support/layerUtils.js";import H from"../rest/support/Query.js";import{isISelectableLayerWithObjectIds as L,isISelectableLayerViewWithObjectIds as V,isISelectableLayer as C,isISelectableLayerView as I,isTableLayer as U,isISelectableLayerViewWithHighlights as F,isISelectableLayerWithGraphics as O,isISelectableLayerBaseWithEditing as z}from"./support/selectionUtils.js";let T=class extends l{constructor(e){super(e),this._layerEditHandles=new i,this._selectionMap=new p,this._sources=new i,this._trashCan=[],this._updatingHandles=new v,this._vizTaskId=0,this.highlightEnabled=!0,this.highlightName="default",this.layerViewMap=new WeakMap,this.view=null}initialize(){this.addHandles([g(()=>[this.view,this.highlightEnabled],()=>{this._refreshVisualization()}),g(()=>this.view,e=>{e?.when().then(()=>this.syncSources())},u),f(()=>this.sources,"change",e=>{const t=this._selectionMap,s=[];for(const i of e.removed){const e=t.get(i);e&&(t.delete(i),e.highlightHandle?.remove(),s.push({layer:i,selection:[],added:[],removed:[...e.selection]}))}this._refreshListeners(),s.length&&this._onSelectionChange(s)},{onListenerAdd:()=>this._refreshListeners()})])}destroy(){this.clear(),this._layerEditHandles.destroyAll(),this._updatingHandles.destroy(),d(this._layerEditHandles),d(this._sources)}get count(){let e=0;for(const t of this._selectionMap.values())e+=t.selection.length;return e}get hasSelection(){return this.count>0}get selections(){return Array.from(this._selectionMap.entries()).map(e=>{const[t,s]=e;return{layer:t,selection:[...s.selection]}})}get showHighlight(){return this.highlightEnabled}set showHighlight(e){n(c.getLogger(this),"showHighlight",{replacement:"highlightEnabled"}),this.highlightEnabled=e}get sources(){return this._sources}set sources(e){o(e,this._sources)}get updating(){return this._updatingHandles.updating}add(e,t){const s=new Set;y(s,this._selectionMap.get(e)?.selection);for(const i of t)s.add(i);this._setSelection(e,Array.from(s))}clear(){const e=this._selectionMap.values();this._trashCan.push(...e);const t=[];for(const[s,i]of this._selectionMap.entries())t.push({layer:s,added:[],removed:[...i.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(t)}getSelection(e){return this._selectionMap.get(e)?.selection}syncSources(){const e=new Set,t=this.view?.map;if(!t)return;const s=t=>{b(t)?(t.layers?.forEach(s),t.tables?.forEach(s)):j(t)?(t.sublayers?.forEach(s),t.subtables?.forEach(s)):E(t)?t.sublayers?.forEach(s):C(t)&&e.add(t)};t.allLayers.forEach(s),t.allTables.forEach(s),this.sources=[...e]}async getSelectedFeatures(e,s={},i="layerView"){const{view:o,selections:n}=this;if(!o&&"layerView"===i)return c.getLogger(this).warn("Cannot query layer views without a view."),[];const r=n.map(async t=>{const{layer:n,selection:r}=t;if(r.length&&L(n)&&(!e||e.includes(n))){if(o&&"layerView"===i&&!n.isTable){const e=await this._findLayerView(n);if(V(e))return N(e,r,s)}return N(n,r,s)}}).filter(t);return(await Promise.all(r)).filter(t)}updateSelection(e){const t=new Map;for(const[s,n]of this._selectionMap)t.set(s,new Set(n.selection));let i=!1;const o=e.current.concat(e.added);for(const s of o){const e=S(s);if(C(e)&&this.sources.includes(e)){const o=h(t,e,()=>new Set),n=L(e)?s.getObjectId():s;null!=n&&(o.add(n),i=!0)}}for(const s of e.removed){const e=S(s);if(C(e)&&this.sources.includes(e)){const o=t.get(e),n=L(e)?s.getObjectId():s;n&&o&&(o.delete(n),i=!0)}}if(i){const{_selectionMap:e,_trashCan:i}=this,o=[];for(const[n,r]of t){const t=e.get(n),l=Array.from(r);void 0!==t&&i.push(t),e.set(n,{selection:l}),o.push({layer:n,selection:l,...s(void 0!==t?t.selection:[],l)})}this._onSelectionChange(o)}}setSelection(e,t){r(c.getLogger(this),"SelectionManager.setSelection is deprecated. Use SelectionManager.replace instead.",{replacement:"SelectionManager.replace",warnOnce:!0}),this.replace(e,t)}appendToSelection(e,t){r(c.getLogger(this),"SelectionManager.appendToSelection is deprecated. Use SelectionManager.add instead.",{replacement:"SelectionManager.add",warnOnce:!0}),this.add(e,t)}remove(e,t){const s=this._selectionMap.get(e);if(!s)return;const i=[];for(const o of s.selection)t.includes(o)||i.push(o);this._setSelection(e,i)}replace(e,t){this._setSelection(e,t)}removeFromSelection(e,t){r(c.getLogger(this),"SelectionManager.removeFromSelection is deprecated. Use SelectionManager.remove instead.",{replacement:"SelectionManager.remove",warnOnce:!0}),this.remove(e,t)}toggle(e,t){const s=this._selectionMap.get(e);if(!s||0===s.selection.length)return void this._setSelection(e,t);const i=new Set(s.selection),o=new Set(t),n=m(i,o);this._setSelection(e,Array.from(n))}toggleInSelection(e,t){r(c.getLogger(this),"SelectionManager.toggleInSelection is deprecated. Use SelectionManager.toggle instead.",{replacement:"SelectionManager.toggle",warnOnce:!0}),this.toggle(e,t)}async _findLayerView(e){const t=this.layerViewMap.get(e);if(t||!this.view)return t;const s=M(e)&&e.parent?e.parent:e,i=await this.view.whenLayerView(s).catch(()=>{});return I(i)?(this.layerViewMap.set(e,i),i.addHandles(a(()=>this.layerViewMap.delete(e))),i):void 0}_onSelectionChange(e){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:e})}async _refreshVisualization(){await this._updatingHandles.addPromise(this._updateVisualization())}async _updateVisualization(){for(this._vizTaskId++;this._trashCan.length>0;){const e=this._trashCan.pop();e?.highlightHandle?.remove()}const{_selectionMap:e,highlightName:t,sources:s}=this,i=this.view&&this.highlightEnabled,o=this._vizTaskId;for(const n of s){const s=e.get(n);if(s?.highlightHandle?.remove(),i&&s?.selection.length&&!U(n)){const e=await this._findLayerView(n);if(F(e)&&o===this._vizTaskId){const i=s.selection;s.highlightHandle=e.highlight(i,{name:t})}}}}_refreshListeners(){this._layerEditHandles.destroyAll();const e=new Set(this.sources.map(e=>M(e)?e.parent:e));for(const t of e)C(t)&&(O(t)?this._layerEditHandles.push(t.graphics.on("change",e=>this._onGraphicsLayerEdit(t,e))):z(t)&&this._layerEditHandles.push(t.on("edits",e=>this._onLayerEdit(t,e))))}_onLayerEdit(e,t){if(E(e))this._onParentLayerEdit(e,t);else if(t.deletedFeatures.length&&this._selectionMap.has(e)){const s=[];t.deletedFeatures.forEach(({error:e,objectId:t})=>{null!=t&&null==e&&s.push(t)}),this.remove(e,s)}}_onGraphicsLayerEdit(e,t){const{removed:s}=t;s.length&&this._selectionMap.has(e)&&this.remove(e,s)}_onParentLayerEdit(e,t){const{deletedFeatures:s,edits:i,updatedFeatures:o}=t;if(i?.updateFeatures?.forEach(t=>{const s=t.getObjectId()??t.attributes[e.objectIdField];if(null==s)return;if(o.find(e=>e.objectId===s)?.error)return;const i=e.findSublayerForFeature(t);if(!C(i))return;const n=e.sublayers.find(e=>!(!C(e)||!this.getSelection(e)?.includes(s)));C(n)&&n!==i&&(this.remove(n,[s]),this.add(i,[s]))}),s.length){const t=[];s.forEach(({error:e,objectId:s})=>{null!=s&&null==e&&t.push(s)}),e.sublayers.forEach(e=>{C(e)&&this._selectionMap.has(e)&&this.remove(e,t)})}}_setSelection(e,t){if(!this.sources.includes(e))throw new Error(`Cannot set selection on layer ${e.title} because it is not in 'sources'`);const i=this._selectionMap.get(e);if(!i||!A(i,{selection:t})){i&&this._trashCan.push(i),this._selectionMap.set(e,{selection:[...t]});const o=i?s(i.selection,t):{};this._onSelectionChange([{layer:e,selection:[...t],...o}])}}};e([_()],T.prototype,"_layerEditHandles",void 0),e([_()],T.prototype,"_selectionMap",void 0),e([_()],T.prototype,"_sources",void 0),e([_()],T.prototype,"_updatingHandles",void 0),e([_({readOnly:!0,nonNullable:!0})],T.prototype,"count",null),e([_({readOnly:!0,nonNullable:!0})],T.prototype,"hasSelection",null),e([_()],T.prototype,"highlightEnabled",void 0),e([_()],T.prototype,"highlightName",void 0),e([_()],T.prototype,"layerViewMap",void 0),e([_({readOnly:!0,nonNullable:!0})],T.prototype,"selections",null),e([_()],T.prototype,"showHighlight",null),e([_()],T.prototype,"sources",null),e([_()],T.prototype,"updating",null),e([_()],T.prototype,"view",void 0),T=e([w("esri.views.SelectionManager")],T);const A=(e,t)=>{if(null==e&&null==t)return!0;if(null!=e&&null==t||null==e&&null!=t)return!1;if(null!=e&&null!=t&&null!=e.selection&&null!=t.selection){const s=[...e.selection],i=[...t.selection];if(s.length!==i.length)return!1;s.sort(),i.sort();for(let e=0;e<s.length;e++)if(s[e]!==i[e])return!1}return!0},N=async(e,t,s={})=>e.queryFeatures(new H({...s,objectIds:t})).then(t=>({data:t,layer:I(e)?e.layer:e})),k=T;export{k as default};
2
+ import{__decorate as e}from"tslib";import{isSome as t,difference as s}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{deprecatedProperty as n,deprecatedFunction as r}from"../core/deprecate.js";import{EventedAccessor as a}from"../core/Evented.js";import{makeHandle as l}from"../core/handleUtils.js";import c from"../core/Logger.js";import{getOrCreateMapValue as h}from"../core/MapUtils.js";import{destroyMaybe as d}from"../core/maybe.js";import p from"../core/ReactiveMap.js";import{watch as u,initial as g,on as f}from"../core/reactiveUtils.js";import{addMany as m,symmetricDifference as y}from"../core/SetUtils.js";import{property as _,subclass as w}from"../core/accessorSupport/decorators.js";import{UpdatingHandles as v}from"../core/support/UpdatingHandles.js";import{getGraphicLayer as S}from"../graphic/graphicOriginUtils.js";import{isSubtypeSublayer as M,isSubtypeGroupLayer as E,isKnowledgeGraphLayer as b,isMapImageLayer as j}from"../layers/support/layerUtils.js";import H from"../rest/support/Query.js";import{isGraphic as L}from"../support/graphicInstanceUtils.js";import{isISelectableLayerWithObjectIds as V,isISelectableLayerViewWithObjectIds as U,isISelectableLayer as C,isISelectableLayerView as I,isTableLayer as F,isISelectableLayerViewWithHighlights as z,isISelectableLayerWithGraphics as O,isISelectableLayerBaseWithEditing as T}from"./support/selectionUtils.js";let A=class extends a{constructor(e){super(e),this._layerEditHandles=new i,this._selectionMap=new p,this._sources=new i,this._trashCan=[],this._updatingHandles=new v,this._vizTaskId=0,this.highlightEnabled=!0,this.highlightName="default",this.layerViewMap=new WeakMap,this.view=null}initialize(){this.addHandles([u(()=>[this.view,this.highlightEnabled],()=>{this._refreshVisualization()}),u(()=>this.view,e=>{e?.when().then(()=>this.syncSources())},g),f(()=>this.sources,"change",e=>{const t=this._selectionMap,s=[];for(const i of e.removed){const e=t.get(i);e&&(t.delete(i),e.highlightHandle?.remove(),s.push({layer:i,selection:[],added:[],removed:[...e.selection]}))}this._refreshListeners(),s.length&&this._onSelectionChange(s)},{onListenerAdd:()=>this._refreshListeners()})])}destroy(){this.clear(),this._layerEditHandles.destroyAll(),this._updatingHandles.destroy(),d(this._layerEditHandles),d(this._sources)}get count(){let e=0;for(const t of this._selectionMap.values())e+=t.selection.length;return e}get hasSelection(){return this.count>0}get selections(){return Array.from(this._selectionMap.entries()).map(e=>{const[t,s]=e;return{layer:t,selection:[...s.selection]}})}get showHighlight(){return this.highlightEnabled}set showHighlight(e){n(c.getLogger(this),"showHighlight",{replacement:"highlightEnabled"}),this.highlightEnabled=e}get sources(){return this._sources}set sources(e){o(e,this._sources)}get updating(){return this._updatingHandles.updating}add(e,t){const s=new Set;m(s,this._selectionMap.get(e)?.selection);for(const i of t)s.add(N(e,i));this._setSelection(e,Array.from(s))}clear(){const e=this._selectionMap.values();this._trashCan.push(...e);const t=[];for(const[s,i]of this._selectionMap.entries())t.push({layer:s,added:[],removed:[...i.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(t)}getSelection(e){return this._selectionMap.get(e)?.selection}syncSources(){const e=new Set,t=this.view?.map;if(!t)return;const s=t=>{b(t)?(t.layers?.forEach(s),t.tables?.forEach(s)):j(t)?(t.sublayers?.forEach(s),t.subtables?.forEach(s)):E(t)?t.sublayers?.forEach(s):C(t)&&e.add(t)};t.allLayers.forEach(s),t.allTables.forEach(s),this.sources=[...e]}async getSelectedFeatures(e,s={},i="layerView"){const{view:o,selections:n}=this;if(!o&&"layerView"===i)return c.getLogger(this).warn("Cannot query layer views without a view."),[];const r=n.map(async t=>{const{layer:n,selection:r}=t;if(r.length&&V(n)&&(!e||e.includes(n))){if(o&&"layerView"===i&&!n.isTable){const e=await this._findLayerView(n);if(U(e))return P(e,r,s)}return P(n,r,s)}}).filter(t);return(await Promise.all(r)).filter(t)}updateSelection(e){const t=new Map;for(const[s,n]of this._selectionMap)t.set(s,new Set(n.selection));let i=!1;const o=e.current.concat(e.added);for(const s of o){const e=S(s);if(C(e)&&this.sources.includes(e)){const o=h(t,e,()=>new Set),n=N(e,s);null!=n&&(o.add(n),i=!0)}}for(const s of e.removed){const e=S(s);if(C(e)&&this.sources.includes(e)){const o=t.get(e),n=N(e,s);n&&o&&(o.delete(n),i=!0)}}if(i){const{_selectionMap:e,_trashCan:i}=this,o=[];for(const[n,r]of t){const t=e.get(n),a=Array.from(r);void 0!==t&&i.push(t),e.set(n,{selection:a}),o.push({layer:n,selection:a,...s(void 0!==t?t.selection:[],a)})}this._onSelectionChange(o)}}setSelection(e,t){r(c.getLogger(this),"SelectionManager.setSelection is deprecated. Use SelectionManager.replace instead.",{replacement:"SelectionManager.replace",warnOnce:!0}),this.replace(e,t)}appendToSelection(e,t){r(c.getLogger(this),"SelectionManager.appendToSelection is deprecated. Use SelectionManager.add instead.",{replacement:"SelectionManager.add",warnOnce:!0}),this.add(e,t)}remove(e,t){const s=this._selectionMap.get(e);if(!s)return;const i=[],o=new Set(t.map(t=>N(e,t)));for(const n of s.selection)o.has(n)||i.push(n);this._setSelection(e,i)}replace(e,t){this._setSelection(e,t.map(t=>N(e,t)))}removeFromSelection(e,t){r(c.getLogger(this),"SelectionManager.removeFromSelection is deprecated. Use SelectionManager.remove instead.",{replacement:"SelectionManager.remove",warnOnce:!0}),this.remove(e,t)}toggle(e,t){const s=this._selectionMap.get(e),i=t.map(t=>N(e,t));if(!s||0===s.selection.length)return void this._setSelection(e,i);const o=new Set(s.selection),n=new Set(i),r=y(o,n);this._setSelection(e,Array.from(r))}toggleInSelection(e,t){r(c.getLogger(this),"SelectionManager.toggleInSelection is deprecated. Use SelectionManager.toggle instead.",{replacement:"SelectionManager.toggle",warnOnce:!0}),this.toggle(e,t)}async _findLayerView(e){const t=this.layerViewMap.get(e);if(t||!this.view)return t;const s=M(e)&&e.parent?e.parent:e,i=await this.view.whenLayerView(s).catch(()=>{});return I(i)?(this.layerViewMap.set(e,i),i.addHandles(l(()=>this.layerViewMap.delete(e))),i):void 0}_onSelectionChange(e){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:e})}async _refreshVisualization(){await this._updatingHandles.addPromise(this._updateVisualization())}async _updateVisualization(){for(this._vizTaskId++;this._trashCan.length>0;){const e=this._trashCan.pop();e?.highlightHandle?.remove()}const{_selectionMap:e,highlightName:t,sources:s}=this,i=this.view&&this.highlightEnabled,o=this._vizTaskId;for(const n of s){const s=e.get(n);if(s?.highlightHandle?.remove(),i&&s?.selection.length&&!F(n)){const e=await this._findLayerView(n);if(z(e)&&o===this._vizTaskId){const i=s.selection;s.highlightHandle=e.highlight(i,{name:t})}}}}_refreshListeners(){this._layerEditHandles.destroyAll();const e=new Set(this.sources.map(e=>M(e)?e.parent:e));for(const t of e)C(t)&&(O(t)?this._layerEditHandles.push(t.graphics.on("change",e=>this._onGraphicsLayerEdit(t,e))):T(t)&&this._layerEditHandles.push(t.on("edits",e=>this._onLayerEdit(t,e))))}_onLayerEdit(e,t){if(E(e))this._onParentLayerEdit(e,t);else if(t.deletedFeatures.length&&this._selectionMap.has(e)){const s=[];t.deletedFeatures.forEach(({error:e,objectId:t})=>{null!=t&&null==e&&s.push(t)}),this.remove(e,s)}}_onGraphicsLayerEdit(e,t){const{removed:s}=t;s.length&&this._selectionMap.has(e)&&this.remove(e,s)}_onParentLayerEdit(e,t){const{deletedFeatures:s,edits:i,updatedFeatures:o}=t;if(i?.updateFeatures?.forEach(t=>{const s=t.getObjectId()??t.attributes[e.objectIdField];if(null==s)return;if(o.find(e=>e.objectId===s)?.error)return;const i=e.findSublayerForFeature(t);if(!C(i))return;const n=e.sublayers.find(e=>!(!C(e)||!this.getSelection(e)?.includes(s)));C(n)&&n!==i&&(this.remove(n,[s]),this.add(i,[s]))}),s.length){const t=[];s.forEach(({error:e,objectId:s})=>{null!=s&&null==e&&t.push(s)}),e.sublayers.forEach(e=>{C(e)&&this._selectionMap.has(e)&&this.remove(e,t)})}}_setSelection(e,t){if(!this.sources.includes(e))throw new Error(`Cannot set selection on layer ${e.title} because it is not in 'sources'`);const i=this._selectionMap.get(e);if(!i||!k(i,{selection:t})){i&&this._trashCan.push(i),this._selectionMap.set(e,{selection:[...t]});const o=i?s(i.selection,t):{};this._onSelectionChange([{layer:e,selection:[...t],...o}])}}};e([_()],A.prototype,"_layerEditHandles",void 0),e([_()],A.prototype,"_selectionMap",void 0),e([_()],A.prototype,"_sources",void 0),e([_()],A.prototype,"_updatingHandles",void 0),e([_({readOnly:!0,nonNullable:!0})],A.prototype,"count",null),e([_({readOnly:!0,nonNullable:!0})],A.prototype,"hasSelection",null),e([_()],A.prototype,"highlightEnabled",void 0),e([_()],A.prototype,"highlightName",void 0),e([_()],A.prototype,"layerViewMap",void 0),e([_({readOnly:!0,nonNullable:!0})],A.prototype,"selections",null),e([_()],A.prototype,"showHighlight",null),e([_()],A.prototype,"sources",null),e([_()],A.prototype,"updating",null),e([_()],A.prototype,"view",void 0),A=e([w("esri.views.SelectionManager")],A);const N=(e,t)=>{if(V(e)&&L(t)){const e=t.getObjectId();if(null!=e)return e}return t},k=(e,t)=>{if(null==e&&null==t)return!0;if(null!=e&&null==t||null==e&&null!=t)return!1;if(null!=e&&null!=t&&null!=e.selection&&null!=t.selection){const s=[...e.selection],i=[...t.selection];if(s.length!==i.length)return!1;s.sort(),i.sort();for(let e=0;e<s.length;e++)if(s[e]!==i[e])return!1}return!0},P=async(e,t,s={})=>e.queryFeatures(new H({...s,objectIds:t})).then(t=>({data:t,layer:I(e)?e.layer:e})),q=A;export{q as default};
@@ -574,20 +574,20 @@ export default abstract class FeatureLikeLayerView extends LayerView {
574
574
  * >
575
575
  * > **Notes**
576
576
  * >
577
- * > Attribute values used in attribute queries executed against LayerViews are case sensitive.
578
- * > Ensure the fields being queried are included in the [availableFields](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#availableFields) list; otherwise, the query may fail or return incomplete results.
579
- * > To get an extent of all the features in a layer rather than only those currently available on the client,
577
+ * > - Attribute values used in attribute queries executed against LayerViews are case sensitive.
578
+ * > - Ensure the fields being queried are included in the [availableFields](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#availableFields) list; otherwise, the query may fail or return incomplete results.
579
+ * > - To get an extent of all the features in a layer rather than only those currently available on the client,
580
580
  * > check the [hasAllFeatures](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#hasAllFeatures) property on the LayerView.
581
581
  * > If `hasAllFeatures` is `true`, then `queryExtent()` on the LayerView returns an `extent` based on all features available in the layer
582
582
  * > that satisfy the query, not just those currently loaded on the client.
583
583
  * > Otherwise, use `queryExtent()` on the Layer to get the extent based on all features available in the layer that satisfy the query.
584
- * > Spatial queries can be performed on quantized geometries within the LayerView. The resolution of these geometries is
584
+ * > - Spatial queries can be performed on quantized geometries within the LayerView. The resolution of these geometries is
585
585
  * > only as precise as the scale [View2D.resolution](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#resolution) of the view.
586
586
  * > Geometries returned from any LayerView query will match the view's scale resolution.
587
587
  * > To retrieve feature geometries at full resolution, first check the LayerView's [hasFullGeometries](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#hasFullGeometries) property. If it is `true`,
588
588
  * > use the `queryExtent()` method on the LayerView; otherwise, use the `queryExtent()` method on the Layer.
589
- * > Spatial queries have the same limitations as those listed in the [projectOperator](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/projectOperator/) documentation.
590
- * > Spatial queries are not currently supported if the layerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/references/core/geometry/SpatialReference/):
589
+ * > - Spatial queries have the same limitations as those listed in the [projectOperator](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/projectOperator/) documentation.
590
+ * > - Spatial queries are not currently supported if the layerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/references/core/geometry/SpatialReference/):
591
591
  * > - GDM 2000 (4742) – Malaysia
592
592
  * > - Gusterberg (Ferro) (8042) – Austria/Czech Republic
593
593
  * > - ISN2016 (8086) - Iceland
@@ -631,20 +631,20 @@ export default abstract class FeatureLikeLayerView extends LayerView {
631
631
  * >
632
632
  * > **Notes**
633
633
  * >
634
- * > Attribute values used in attribute queries executed against LayerViews are case sensitive.
635
- * > Ensure the fields being queried are included in the [availableFields](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#availableFields) list; otherwise, the query may fail or return incomplete results.
636
- * > To get a count of all features in a layer rather than only those currently available on the client,
634
+ * > - Attribute values used in attribute queries executed against LayerViews are case sensitive.
635
+ * > - Ensure the fields being queried are included in the [availableFields](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#availableFields) list; otherwise, the query may fail or return incomplete results.
636
+ * > - To get a count of all features in a layer rather than only those currently available on the client,
637
637
  * > check the [hasAllFeatures](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#hasAllFeatures) property on the LayerView.
638
638
  * > If `hasAllFeatures` is `true`, then `queryFeatureCount()` on the LayerView returns the count of all features from the entire dataset
639
639
  * > that satisfy the query, not just those currently loaded on the client.
640
640
  * > Otherwise, use `queryFeatureCount()` on the layer to get the count based on all features available in the layer that satisfy the query.
641
- * > Spatial queries can be performed on quantized geometries within the LayerView. The resolution of these geometries is
641
+ * > - Spatial queries can be performed on quantized geometries within the LayerView. The resolution of these geometries is
642
642
  * > only as precise as the scale [View2D.resolution](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#resolution) of the view.
643
643
  * > Geometries returned from any LayerView query will match the view's scale resolution.
644
644
  * > To retrieve feature geometries at full resolution, first check the LayerView's [hasFullGeometries](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#hasFullGeometries) property. If it is `true`,
645
645
  * > use the `queryFeatureCount()` method on the LayerView; otherwise, use the `queryFeatureCount()` method on the Layer.
646
- * > Spatial queries have the same limitations as those listed in the [projectOperator](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/projectOperator/) documentation.
647
- * > Spatial queries are not currently supported if the layerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/references/core/geometry/SpatialReference/):
646
+ * > - Spatial queries have the same limitations as those listed in the [projectOperator](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/projectOperator/) documentation.
647
+ * > - Spatial queries are not currently supported if the layerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/references/core/geometry/SpatialReference/):
648
648
  * > - GDM 2000 (4742) – Malaysia
649
649
  * > - Gusterberg (Ferro) (8042) – Austria/Czech Republic
650
650
  * > - ISN2016 (8086) - Iceland
@@ -684,19 +684,19 @@ export default abstract class FeatureLikeLayerView extends LayerView {
684
684
  * >
685
685
  * > **Notes**
686
686
  * >
687
- * > Attribute values used in attribute queries executed against LayerViews are case sensitive.
688
- * > Ensure the fields being queried are included in the [availableFields](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#availableFields) list; otherwise, the query may fail or return incomplete results.
689
- * > To execute a query against all features in a layer rather than only those currently available on the client, check the [hasAllFeatures](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#hasAllFeatures)
687
+ * > - Attribute values used in attribute queries executed against LayerViews are case sensitive.
688
+ * > - Ensure the fields being queried are included in the [availableFields](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#availableFields) list; otherwise, the query may fail or return incomplete results.
689
+ * > - To execute a query against all features in a layer rather than only those currently available on the client, check the [hasAllFeatures](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#hasAllFeatures)
690
690
  * > property on the LayerView. If `hasAllFeatures` is `true`, then `queryFeatures()` on the LayerView returns all features from the entire dataset
691
691
  * > that satisfy the query, not just those currently loaded on the client.
692
692
  * > Otherwise, use `queryFeatures()` on the layer to query against all features available in the layer that satisfy the query.
693
- * > Spatial queries can be performed on quantized geometries within the LayerView. The resolution of these geometries is
693
+ * > - Spatial queries can be performed on quantized geometries within the LayerView. The resolution of these geometries is
694
694
  * > only as precise as the scale [View2D.resolution](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#resolution) of the view.
695
695
  * > Geometries returned from any LayerView query will match the view's scale resolution.
696
696
  * > To retrieve feature geometries at full resolution, first check the LayerView's [hasFullGeometries](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#hasFullGeometries) property. If it is `true`,
697
697
  * > use the `queryFeatures()` method on the LayerView; otherwise, use the `queryFeatures()` method on the Layer.
698
- * > Spatial queries have the same limitations as those listed in the [projectOperator](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/projectOperator/) documentation.
699
- * > Spatial queries are not currently supported if the FeatureLayerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/references/core/geometry/SpatialReference/):
698
+ * > - Spatial queries have the same limitations as those listed in the [projectOperator](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/projectOperator/) documentation.
699
+ * > - Spatial queries are not currently supported if the FeatureLayerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/references/core/geometry/SpatialReference/):
700
700
  * > - GDM 2000 (4742) – Malaysia
701
701
  * > - Gsterberg (Ferro) (8042) – Austria/Czech Republic
702
702
  * > - ISN2016 (8086) - Iceland
@@ -763,21 +763,21 @@ export default abstract class FeatureLikeLayerView extends LayerView {
763
763
  * >
764
764
  * > **Notes**
765
765
  * >
766
- * > Attribute values used in attribute queries executed against LayerViews are case sensitive.
767
- * > Ensure the fields being queried are included in the [availableFields](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#availableFields) list; otherwise,
766
+ * > - Attribute values used in attribute queries executed against LayerViews are case sensitive.
767
+ * > - Ensure the fields being queried are included in the [availableFields](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#availableFields) list; otherwise,
768
768
  * > the query may fail or return incomplete results.
769
- * > To execute a query against all features in a layer rather than only those currently available on the client,
769
+ * > - To execute a query against all features in a layer rather than only those currently available on the client,
770
770
  * > check the [hasAllFeatures](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#hasAllFeatures) property on the LayerView.
771
771
  * > If `hasAllFeatures` is `true`, then `queryObjectIds()` on the LayerView returns all features from the entire dataset
772
772
  * > that satisfy the query, not just those currently loaded on the client.
773
773
  * > Otherwise, use `queryObjectIds()` on the layer to query against all features available in the layer that satisfy the query.
774
- * > Spatial queries can be performed on quantized geometries within the LayerView. The resolution of these geometries is
774
+ * > - Spatial queries can be performed on quantized geometries within the LayerView. The resolution of these geometries is
775
775
  * > only as precise as the scale [View2D.resolution](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#resolution) of the view.
776
776
  * > Geometries returned from any LayerView query will match the view's scale resolution.
777
777
  * > To retrieve feature geometries at full resolution, first check the LayerView's [hasFullGeometries](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLikeLayerView/#hasFullGeometries) property. If it is `true`,
778
778
  * > use the `queryObjectIds()` method on the LayerView; otherwise, use the `queryObjectIds()` method on the Layer.
779
- * > Spatial queries have the same limitations as those listed in the [projectOperator](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/projectOperator/) documentation.
780
- * > Spatial queries are not currently supported if the layerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/references/core/geometry/SpatialReference/):
779
+ * > - Spatial queries have the same limitations as those listed in the [projectOperator](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/projectOperator/) documentation.
780
+ * > - Spatial queries are not currently supported if the layerView has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/references/core/geometry/SpatialReference/):
781
781
  * > - GDM 2000 (4742) – Malaysia
782
782
  * > - Gusterberg (Ferro) (8042) – Austria/Czech Republic
783
783
  * > - ISN2016 (8086) - Iceland