@arcgis/core 5.2.0-next.154 → 5.2.0-next.156

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 (240) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{d994bcf0a65d1c07160f.js → 0320cbd825f9a4222042.js} +1 -1
  3. package/assets/esri/core/workers/chunks/0590857215c547e63b51.js +1 -0
  4. package/assets/esri/core/workers/chunks/08fe248e412bb170210d.js +1 -0
  5. package/assets/esri/core/workers/chunks/0cb50bc2b2125c5fedf2.js +1 -0
  6. package/assets/esri/core/workers/chunks/1201b8c5852830836eac.js +1 -0
  7. package/assets/esri/core/workers/chunks/129e04d24ced77c9bb6d.js +1 -0
  8. package/assets/esri/core/workers/chunks/15e1117a706a98b17ad5.js +1 -0
  9. package/assets/esri/core/workers/chunks/164e74d586297946a717.js +1 -0
  10. package/assets/esri/core/workers/chunks/168a523bdc3653081f8a.js +1 -0
  11. package/assets/esri/core/workers/chunks/{6f4e6022a52de0c54aab.js → 172cfeb5f415e4662432.js} +1 -1
  12. package/assets/esri/core/workers/chunks/1aa4f5394a596e544aeb.js +1 -0
  13. package/assets/esri/core/workers/chunks/22b01fe31bbf0bdc48db.js +1 -0
  14. package/assets/esri/core/workers/chunks/27c2da2e779def2ee08b.js +1 -0
  15. package/assets/esri/core/workers/chunks/28b74bc77f7c13080074.js +1 -0
  16. package/assets/esri/core/workers/chunks/{481589c3eddad6e026ad.js → 369780276b2755361f7d.js} +1 -1
  17. package/assets/esri/core/workers/chunks/3914d96147642a9d4b01.js +1 -0
  18. package/assets/esri/core/workers/chunks/{731018c0deffc41ffc97.js → 3e3e076fa5e8d5d5f33f.js} +1 -1
  19. package/assets/esri/core/workers/chunks/43cf862577bf37344ff4.js +1 -0
  20. package/assets/esri/core/workers/chunks/4932773663469919d10a.js +1 -0
  21. package/assets/esri/core/workers/chunks/4996869b9cbd8c8ddcfa.js +1 -0
  22. package/assets/esri/core/workers/chunks/4c389472b8cdb0c55154.js +1 -0
  23. package/assets/esri/core/workers/chunks/4e4f747de424941a0bfa.js +1 -0
  24. package/assets/esri/core/workers/chunks/{eb815148ae65388dd733.js → 544070198d2ca556103a.js} +1 -1
  25. package/assets/esri/core/workers/chunks/5736feefa261589b6273.js +1 -0
  26. package/assets/esri/core/workers/chunks/{aeaaff7a4b1a99540f52.js → 5cb26bbaa08114aec5ce.js} +1 -1
  27. package/assets/esri/core/workers/chunks/5f4feca26102088ea565.js +1 -0
  28. package/assets/esri/core/workers/chunks/{407f1e8176f3b0af73b4.js → 66867e523cc82f8fe35b.js} +1 -1
  29. package/assets/esri/core/workers/chunks/6f73e41e14817acfaead.js +1 -0
  30. package/assets/esri/core/workers/chunks/{320e5942a098dd104366.js → 74137ffec5265628c33b.js} +1 -1
  31. package/assets/esri/core/workers/chunks/7446d0dfebf93e86c098.js +1 -0
  32. package/assets/esri/core/workers/chunks/{688f2dbf784e66082308.js → 74c866e0b66e61751861.js} +1 -1
  33. package/assets/esri/core/workers/chunks/7711ae5612f685078fc8.js +1 -0
  34. package/assets/esri/core/workers/chunks/{5116b569a8dbda4910c8.js → 784a2fba3e18286958d1.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{693873b3eb99fba58fa9.js → 78c4e43cfa1eda06b4d9.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{f6e62d2d279a328cbed7.js → 7bcedf479b07a4b4a234.js} +1 -1
  37. package/assets/esri/core/workers/chunks/81cad8d2f62a5f671c55.js +1 -0
  38. package/assets/esri/core/workers/chunks/{588e677f33df86a595bf.js → 820c8aaf3632edb0150c.js} +1 -1
  39. package/assets/esri/core/workers/chunks/842893e75696428d536f.js +1 -0
  40. package/assets/esri/core/workers/chunks/8e19629899a5becf8e19.js +1 -0
  41. package/assets/esri/core/workers/chunks/950d4578dc450467404c.js +1 -0
  42. package/assets/esri/core/workers/chunks/{68be3fb88ca61f82fb90.js → 95dbbddac6581b9d671f.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{a4162a8660bf763d542d.js → 967b4992b400517ee712.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{adf25e5ed99615b83c68.js → a62c12925303ff802c3d.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{900181f68449d8f82eeb.js → aa1ac7954e4f0fefe15b.js} +1 -1
  46. package/assets/esri/core/workers/chunks/ac24b4370dc7194a3107.js +1 -0
  47. package/assets/esri/core/workers/chunks/acdfd275dbf8533a67f3.js +1 -0
  48. package/assets/esri/core/workers/chunks/ace2e0a9d9013edd8624.js +1 -0
  49. package/assets/esri/core/workers/chunks/b1d5d236d5268fcbc74b.js +1 -0
  50. package/assets/esri/core/workers/chunks/b3007aedbf731dacaff1.js +1 -0
  51. package/assets/esri/core/workers/chunks/{53e2f2b922116a45fe8f.js → b573df59391ca41ee5a7.js} +1 -1
  52. package/assets/esri/core/workers/chunks/bac8c32665e982896ecc.js +1 -0
  53. package/assets/esri/core/workers/chunks/{f3da30d7300b92bd8bb0.js → befa32b9e7b3fbdd431e.js} +1 -1
  54. package/assets/esri/core/workers/chunks/c19f238b55ff2893f7c2.js +1 -0
  55. package/assets/esri/core/workers/chunks/c5ed67fdf261cbb1624b.js +1 -0
  56. package/assets/esri/core/workers/chunks/c72a904e01dc8c17d992.js +1 -0
  57. package/assets/esri/core/workers/chunks/d9b1aed88b205689cec6.js +1 -0
  58. package/assets/esri/core/workers/chunks/de6081df29183bf80787.js +1 -0
  59. package/assets/esri/core/workers/chunks/{c598b22f78ccc57f9d6d.js → dfd2dc5cdc97ffba8926.js} +1 -1
  60. package/assets/esri/core/workers/chunks/e1b7806ab3e1967b15f0.js +1 -0
  61. package/assets/esri/core/workers/chunks/e653c81ffb3d818645dd.js +1 -0
  62. package/assets/esri/core/workers/chunks/eaddffcc7004101fc230.js +1 -0
  63. package/assets/esri/core/workers/chunks/eb2652ec48faa78de3c5.js +1 -0
  64. package/assets/esri/core/workers/chunks/{c62738f84c914671b143.js → f4a7aa3cdbc0c429c359.js} +1 -1
  65. package/assets/esri/core/workers/chunks/fda83bcb8e40e8044c24.js +1 -0
  66. package/assets/esri/libs/pdfjs/wasm/openjpeg_nowasm_fallback.js +1 -0
  67. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -0
  68. package/assets/esri/themes/dark/main.css +1 -1
  69. package/assets/esri/themes/light/main.css +1 -1
  70. package/assets/esri/themes/light/view.css +1 -1
  71. package/assets/esri/widgets/support/uriUtils/t9n/messages.fr.json +1 -1
  72. package/config.d.ts +2 -0
  73. package/config.js +1 -1
  74. package/core/ObjectPool.js +1 -1
  75. package/core/PooledArray.js +1 -1
  76. package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
  77. package/geometry/support/buffer/BufferPool.js +1 -1
  78. package/geometry/support/coordsUtils.js +1 -1
  79. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  80. package/geometry/support/curves/mathUtils.js +1 -1
  81. package/interfaces.d.ts +18 -9
  82. package/kernel.js +1 -1
  83. package/layers/AnnotationFeatureLayer.d.ts +2 -2
  84. package/layers/AnnotationFeatureLayer.js +1 -1
  85. package/layers/CatalogLayer.d.ts +2 -2
  86. package/layers/CatalogLayer.js +1 -1
  87. package/layers/DimensionFeatureLayer.d.ts +2 -2
  88. package/layers/DimensionFeatureLayer.js +1 -1
  89. package/layers/FeatureLayer.d.ts +2 -2
  90. package/layers/FeatureLayer.js +1 -1
  91. package/layers/SubtypeGroupLayer.d.ts +2 -2
  92. package/layers/SubtypeGroupLayer.js +1 -1
  93. package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
  94. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +9 -9
  95. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
  96. package/layers/geospatialPDF/LGIDictMapFrame.js +1 -1
  97. package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
  98. package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
  99. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  100. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  101. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  102. package/layers/graphics/sources/parquet/FileProvider.js +1 -1
  103. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  104. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  105. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  106. package/layers/mixins/{FeatureLayerReload.d.ts → ReloadableLayer.d.ts} +5 -3
  107. package/layers/mixins/ReloadableLayer.js +2 -0
  108. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  109. package/layers/raster/datasets/BaseRaster.js +1 -1
  110. package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
  111. package/layers/raster/datasets/ImageAuxRaster.js +1 -1
  112. package/layers/raster/datasets/ImageServerRaster.js +1 -1
  113. package/layers/raster/datasets/MRFRaster.js +1 -1
  114. package/layers/raster/datasets/TIFFRaster.js +1 -1
  115. package/layers/raster/datasets/WCSRaster.js +1 -1
  116. package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
  117. package/layers/raster/formats/RasterCodec.js +1 -1
  118. package/layers/raster/formats/TiffDecoder.js +1 -1
  119. package/layers/raster/formats/Zlib.js +1 -1
  120. package/layers/support/RasterWorker.js +1 -1
  121. package/layers/support/fieldUtils.js +1 -1
  122. package/layers/support/vectorTileLayerLoader.js +1 -1
  123. package/package.json +2 -2
  124. package/popup/FeatureModel.js +1 -1
  125. package/popup/FeaturesModel.js +1 -1
  126. package/portal/schemas/definitions.js +1 -1
  127. package/request/process.js +1 -1
  128. package/request/types.d.ts +7 -0
  129. package/symbols/cim/cimAnalyzer.js +1 -1
  130. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  131. package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSource.js +1 -1
  132. package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSourceWorker.js +1 -1
  133. package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +2 -0
  134. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
  135. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
  136. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  137. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  138. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  139. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  140. package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
  141. package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
  142. package/views/3d/analysis/LineOfSight/{LineOfSightRootPlugin.js → LineOfSightPlacementRootPlugin.js} +1 -1
  143. package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
  144. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  145. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
  146. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  147. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  148. package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
  149. package/views/3d/support/MemoryController.js +1 -1
  150. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  151. package/views/3d/webgl-engine/effects/geometry/RenderOccluded.js +1 -1
  152. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  153. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  154. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  155. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  156. package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
  157. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  158. package/views/draw/DrawTool.js +1 -1
  159. package/views/draw/support/PluginContext.js +1 -1
  160. package/views/draw/support/managers/TooltipManager.js +1 -1
  161. package/views/draw/support/types.d.ts +5 -2
  162. package/webdoc/applicationProperties/SearchLayerField.d.ts +7 -1
  163. package/webdoc/applicationProperties/SearchLayerField.js +1 -1
  164. package/webdoc/applicationProperties/SearchTableField.d.ts +7 -1
  165. package/webdoc/applicationProperties/SearchTableField.js +1 -1
  166. package/webdoc/applicationProperties/searchMode.js +2 -0
  167. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  168. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  169. package/widgets/BatchAttributeForm.js +1 -1
  170. package/widgets/Editor/EditorViewModel.d.ts +10 -1
  171. package/widgets/Editor.d.ts +10 -1
  172. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  173. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  174. package/widgets/HistogramRangeSlider.d.ts +2 -2
  175. package/widgets/HistogramRangeSlider.js +1 -1
  176. package/widgets/Legend.d.ts +1 -0
  177. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  178. package/widgets/OrientedImageryViewer.js +2 -2
  179. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  180. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.d.ts +5 -2
  181. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  182. package/widgets/ScaleRangeSlider.js +1 -1
  183. package/widgets/Search/LayerSearchSource.d.ts +23 -1
  184. package/widgets/Search/LayerSearchSource.js +1 -1
  185. package/widgets/Search/support/layerSearchUtils.js +1 -1
  186. package/widgets/Search/types.d.ts +7 -0
  187. package/widgets/ValuePicker/ValuePickerBaseComponent.d.ts +5 -1
  188. package/widgets/ValuePicker/ValuePickerCollection.d.ts +2 -0
  189. package/widgets/ValuePicker/ValuePickerCombobox.d.ts +7 -1
  190. package/widgets/ValuePicker/ValuePickerLabel.d.ts +7 -1
  191. package/widgets/ValuePicker/ValuePickerSlider.d.ts +2 -0
  192. package/widgets/ValuePicker/ValuePickerSliderVisibleElements.d.ts +5 -1
  193. package/widgets/ValuePicker/ValuePickerVisibleElements.d.ts +5 -1
  194. package/widgets/ValuePicker/types.d.ts +2 -0
  195. package/widgets/support/forms/formUtils.js +1 -1
  196. package/widgets/support/forms/types.d.ts +1 -1
  197. package/assets/esri/core/workers/chunks/03261b9451e293a0fac8.js +0 -1
  198. package/assets/esri/core/workers/chunks/03afeefb9d16b6f1d844.js +0 -1
  199. package/assets/esri/core/workers/chunks/09b9a886363bc1197785.js +0 -1
  200. package/assets/esri/core/workers/chunks/0ad0484ffcbe4ad21bd3.js +0 -1
  201. package/assets/esri/core/workers/chunks/19743dedaa40446259ec.js +0 -1
  202. package/assets/esri/core/workers/chunks/1c65ab9ed611c322ce27.js +0 -1
  203. package/assets/esri/core/workers/chunks/1f339247b68b061ab0a4.js +0 -1
  204. package/assets/esri/core/workers/chunks/251921cd10ecfbc89451.js +0 -1
  205. package/assets/esri/core/workers/chunks/3252b1fae363bb0129a0.js +0 -1
  206. package/assets/esri/core/workers/chunks/408e81c8f1eff8a7b379.js +0 -1
  207. package/assets/esri/core/workers/chunks/4fc337240e7cddd0e988.js +0 -1
  208. package/assets/esri/core/workers/chunks/50036a323c2e7f155311.js +0 -1
  209. package/assets/esri/core/workers/chunks/55dcbf296d8d0092e473.js +0 -1
  210. package/assets/esri/core/workers/chunks/5732fdf6d8b87739aeea.js +0 -1
  211. package/assets/esri/core/workers/chunks/5924ec3167a2941ebb1f.js +0 -1
  212. package/assets/esri/core/workers/chunks/59b216b60464611742d4.js +0 -1
  213. package/assets/esri/core/workers/chunks/5bfea0c55aca826de536.js +0 -1
  214. package/assets/esri/core/workers/chunks/5fa1ec357c3ad1f91bc7.js +0 -1
  215. package/assets/esri/core/workers/chunks/60d3056a31d982c9cad0.js +0 -1
  216. package/assets/esri/core/workers/chunks/6558488ea96620439f34.js +0 -1
  217. package/assets/esri/core/workers/chunks/6aebf7cfd294e88bf926.js +0 -1
  218. package/assets/esri/core/workers/chunks/6b43bb78f9839ed43135.js +0 -1
  219. package/assets/esri/core/workers/chunks/6c83398cf586ecea0eb1.js +0 -1
  220. package/assets/esri/core/workers/chunks/7267b17de212207142c9.js +0 -1
  221. package/assets/esri/core/workers/chunks/7d1fd2df579a4b535e0e.js +0 -1
  222. package/assets/esri/core/workers/chunks/7e0cf70c0eb5a2ddfcec.js +0 -1
  223. package/assets/esri/core/workers/chunks/879b2de825c1dfc8849d.js +0 -1
  224. package/assets/esri/core/workers/chunks/912080c90b5cc2e817cf.js +0 -1
  225. package/assets/esri/core/workers/chunks/917f53833b853898facc.js +0 -1
  226. package/assets/esri/core/workers/chunks/937824bc7948f7bc7845.js +0 -1
  227. package/assets/esri/core/workers/chunks/a97d85774f9a417202df.js +0 -1
  228. package/assets/esri/core/workers/chunks/aff32980d91dab07dfb7.js +0 -1
  229. package/assets/esri/core/workers/chunks/b132ffa7e8bb461b6786.js +0 -1
  230. package/assets/esri/core/workers/chunks/b1b4066e8d1c0c9656e5.js +0 -1
  231. package/assets/esri/core/workers/chunks/b6ba66a05030d3815dfd.js +0 -1
  232. package/assets/esri/core/workers/chunks/bbec9d2e3b75a5c59681.js +0 -1
  233. package/assets/esri/core/workers/chunks/bf69024804ac51c8f733.js +0 -1
  234. package/assets/esri/core/workers/chunks/d938987344bce83cc660.js +0 -1
  235. package/assets/esri/core/workers/chunks/db1ab9b9c8bf5c7635d3.js +0 -1
  236. package/assets/esri/core/workers/chunks/e01aeac34474540f61ee.js +0 -1
  237. package/assets/esri/core/workers/chunks/e15ba90af0faf873b42d.js +0 -1
  238. package/assets/esri/core/workers/chunks/fd9663952d5a94f3a83f.js +0 -1
  239. package/layers/mixins/FeatureLayerReload.js +0 -2
  240. /package/views/3d/analysis/LineOfSight/{lineOfSightPlacementUtils.js → placementUtils.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{EventEmitter as t}from"../../../../core/Evented.js";import{handlesGroup as n}from"../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import i from"../../../../core/ReactiveMap.js";import{initial as a,watch as o,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{create as d,fromPoints as f}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as p}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as m,LineOfSightTargetManipulator as h,LineOfSightTargetManipulatorState as g,getInteractiveLineOfSightTargetManipulatorState as _}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as v}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as y}from"../../interactive/editingTools/dragEventPipeline3D.js";import{mouseButtons as b}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as x,dragAtLocation as S,sceneSnappingAtLocation as C,dragManipulatedObject as w}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as T}from"../../../interactive/InteractiveToolBase.js";import{SnappingContext as E}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{enterInputModeIfAvailable as O}from"../../../interactive/tooltip/tooltipCommonUtils.js";const k=d(),A=Symbol(`inactiveManipulatorDisplay`);let j=class extends T{get _manipulatorsToHide(){let e=this._manipulatorByObject.values();return this.view.tools.some(e=>e.hasGrabbedManipulators)||e.some(e=>e.grabbing)?e.filter(e=>!e.grabbing).toArray():[]}constructor(e){super(e),this.events=new t,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new i,this._updatingHandles=new u,this._interactionVisuals=null,this._grabbedManipulator=null,this._visualsManipulator=null}initialize(){let{view:e}=this;this._interactionVisuals=new p({view:e}),this.addHandles([this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(e=>({isTargetVisible:e.computationResult.isTargetVisible,isValid:e.computationResult.isValid,target:e.target})),grabbedManipulator:this._grabbedManipulator,interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),a),o(()=>this._manipulatorsToHide,e=>{let t=e.map(e=>e.disableDisplay());this.removeHandles(A),this.addHandles(t,A)},s)]),this.finishToolCreation()}destroy(){this.removeHandles(A),this._interactionVisuals=r(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(e){this._visualsManipulator=this._manipulatorByObject.get(e),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(e){if(this._manipulatorByObject.has(e))return;let t=e.item.type===`observer`?new m(this.view,{deleting:!1,intersection:null,type:`observer`}):new h(this.view,{deleting:!1,target:e.item,type:`target`});t.cursor=`move`,this._objectByItem.set(e.item,e),this._manipulatorByObject.set(e,t),this.manipulators.add(t),this.addHandles(this._connectManipulator(e,t),e),this._syncManipulator(e,t)}removeObject(e){let t=this._manipulatorByObject.get(e);t!=null&&(this._grabbedManipulator===t&&(this._grabbedManipulator=null),this._visualsManipulator===t&&this.hideInteractionVisuals(),this.removeHandles(e),this.removeHandles(e),this._objectByItem.delete(e.item),this._manipulatorByObject.delete(e),this.manipulators.remove(t),t.destroy())}getManipulator(e){let t=this._objectByItem.get(e);return t==null?null:this._manipulatorByObject.get(t)}hasManipulatorAt(e,t){for(let n of this._manipulatorByObject.values())if(n.consumesClicks&&n.intersectionDistance(e,t)!=null)return!0;return!1}selectObject(e){let t=!1;for(let[n,r]of this._manipulatorByObject){let i=n===e;r.selected=i,t||=i}return this._syncManipulators(),t}onInputEvent(e){e.type===`hold`&&this._grabbedManipulator!=null&&(this._visualsManipulator=this._grabbedManipulator,this._syncInteractionVisuals()),O(e,this.tooltip)}onManipulatorSelectionChanged(){[...this._manipulatorByObject.values()].some(e=>e.selected)||this.events.emit(`selection-cleared`)}_connectManipulator(e,t){let r=()=>this._syncManipulator(e,t);return n([e.on(`committed`,r),e.on(`modified-externally`,r),t.events.on(`immediate-click`,n=>{this.events.emit(`select-item`,{item:e.item}),n.button===b.Right&&t.metadata.type===`target`&&this.events.emit(`delete-item`,{target:t.metadata.target}),n.stopPropagation()}),t.events.on(`grab-changed`,({action:n})=>{n===`start`?(this.events.emit(`select-item`,{item:e.item}),this._grabbedManipulator=t):this._grabbedManipulator===t&&(this._grabbedManipulator=null,this.hideInteractionVisuals()),this._manipulatorByObject.set(e,t)}),t.events.on(`drag`,t=>{e.updateDragIntersection(t),t.action===`start`&&this.showInteractionVisuals(e)}),t.events.on(`location-update`,()=>this._syncInteractionVisuals()),this._createDragHandle(e,t)])}_createDragHandle(e,t){return x(t,(n,r,i,a)=>{let o=e.operations;if(o==null)return;let s=null,{cancelSnapping:c,snappingStep:l}=D({snappingContext:new E({editGeometryOperations:o,elevationInfo:e.elevationInfo,pointer:a,visualizer:new v}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});i.next(e=>(s?.undo(null),s=null,e)).next(c);let u=o.data.allVerticesUnordered.at(0);r.next(t=>(t.action===`start`&&(s=e.createUndoRecord()),{...t,snapOrigin:u?.pos})).next(S(this.view,t.elevationAlignedLocation)).next(y(this.view,o.data.geometry,e.elevationInfo,o.data.spatialReference)).next(C(this.view,e.elevationInfo)).next(...l).next(w(e)).next(e=>(e.action===`end`&&s!=null&&(this.events.emit(`record-undo`,{record:s}),s=null),e))})}_syncManipulators(){for(let[e,t]of this._manipulatorByObject)this._syncManipulator(e,t);this._syncInteractionVisuals()}_syncManipulator(e,t){let n=e.origin;if(t.available=this.visible&&e.visible&&n!=null,t.interactive=this.manipulatorsInteractive&&(this._grabbedManipulator==null||this._grabbedManipulator===t),n!=null&&(t.elevationAlignedLocation=n),e.item.type!==`target`)return;let r=this.analysisViewData.computations.find(t=>t.target===e.item),i=r==null||!r.computationResult.isValid?g.undefined:r.computationResult.isTargetVisible?g.visible:g.occluded;t.state=this.interacting&&t.selected?_(i):i}_syncInteractionVisuals(){let e=this._interactionVisuals,t=this._visualsManipulator,n=this.visible&&this.analysisViewData.visible;if(e==null||t==null||!n){e?.hide();return}let r=[...this._manipulatorByObject.entries()].find(([e])=>e.item.type===`observer`)?.[1];if(r==null){e.hide();return}let i=t===r?null:f(r.renderLocation,t.renderLocation,k);e.update({target:t.renderLocation,lineVerticalPlaneSegment:i,visible:!0})}};e([c({constructOnly:!0})],j.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],j.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],j.prototype,`view`,void 0),e([c({constructOnly:!0})],j.prototype,`tooltip`,void 0),e([c()],j.prototype,`automaticManipulatorSelection`,void 0),e([c()],j.prototype,`removeIncompleteOnCancel`,void 0),e([c()],j.prototype,`interacting`,void 0),e([c()],j.prototype,`manipulatorsInteractive`,void 0),e([c()],j.prototype,`_grabbedManipulator`,void 0),e([c()],j.prototype,`_manipulatorsToHide`,null),e([c()],j.prototype,`updating`,null),j=e([l(`esri.views.3d.analysis.LineOfSight.LineOfSightItemTool`)],j);export{j as LineOfSightItemTool};
2
+ import{__decorate as e}from"tslib";import{EventEmitter as t}from"../../../../core/Evented.js";import{handlesGroup as n}from"../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import i from"../../../../core/ReactiveMap.js";import{initial as a,watch as o,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{create as d,fromPoints as f}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as p}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as m,LineOfSightTargetManipulator as h,LineOfSightTargetManipulatorState as g,getInteractiveLineOfSightTargetManipulatorState as _}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as v}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as y}from"../../interactive/editingTools/dragEventPipeline3D.js";import{mouseButtons as b}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as x,dragAtLocation as S,sceneSnappingAtLocation as C,dragManipulatedObject as w}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as T}from"../../../interactive/InteractiveToolBase.js";import{SnappingContext as E}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{enterInputModeIfAvailable as O}from"../../../interactive/tooltip/tooltipCommonUtils.js";const k=d(),A=Symbol(`inactiveManipulatorDisplay`);let j=class extends T{get _manipulatorsToHide(){let e=this._manipulatorByObject.values();return this.view.tools.some(e=>e.hasGrabbedManipulators)||e.some(e=>e.grabbing)?e.filter(e=>!e.grabbing).toArray():[]}constructor(e){super(e),this.events=new t,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new i,this._updatingHandles=new u,this._interactionVisuals=null,this._grabbedManipulator=null,this._visualsManipulator=null}initialize(){let{view:e}=this;this._interactionVisuals=new p({view:e}),this.addHandles([this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(e=>({isTargetVisible:e.computationResult.isTargetVisible,isValid:e.computationResult.isValid,target:e.target})),grabbedManipulator:this._grabbedManipulator,interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),a),o(()=>this._manipulatorsToHide,e=>{let t=e.map(e=>e.disableDisplay());this.removeHandles(A),this.addHandles(t,A)},s)]),this.finishToolCreation()}destroy(){this.removeHandles(A),this._interactionVisuals=r(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(e){this._visualsManipulator=this._manipulatorByObject.get(e),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(e){if(this._manipulatorByObject.has(e))return;let t=e.item.type===`observer`?new m(this.view,{deleting:!1,intersection:null,type:`observer`}):new h(this.view,{deleting:!1,target:e.item,type:`target`});t.cursor=`move`,this._objectByItem.set(e.item,e),this._manipulatorByObject.set(e,t),this.manipulators.add(t),this.addHandles(this._connectManipulator(e,t),e),this._syncManipulator(e,t)}removeObject(e){let t=this._manipulatorByObject.get(e);t!=null&&(this._grabbedManipulator===t&&(this._grabbedManipulator=null),this._visualsManipulator===t&&this.hideInteractionVisuals(),this.removeHandles(e),this._objectByItem.delete(e.item),this._manipulatorByObject.delete(e),this.manipulators.remove(t),t.destroy())}getManipulator(e){let t=this._objectByItem.get(e);return t==null?null:this._manipulatorByObject.get(t)}hasManipulatorAt(e,t){for(let n of this._manipulatorByObject.values())if(n.consumesClicks&&n.intersectionDistance(e,t)!=null)return!0;return!1}selectObject(e){let t=!1;for(let[n,r]of this._manipulatorByObject){let i=n===e;r.selected=i,t||=i}return this._syncManipulators(),t}onInputEvent(e){e.type===`hold`&&this._grabbedManipulator!=null&&(this._visualsManipulator=this._grabbedManipulator,this._syncInteractionVisuals()),O(e,this.tooltip)}onManipulatorSelectionChanged(){[...this._manipulatorByObject.values()].some(e=>e.selected)||this.events.emit(`selection-cleared`)}_connectManipulator(e,t){let r=()=>this._syncManipulator(e,t);return n([e.on(`committed`,r),e.on(`modified-externally`,r),t.events.on(`immediate-click`,n=>{this.events.emit(`select-item`,{item:e.item}),n.button===b.Right&&t.metadata.type===`target`&&this.events.emit(`delete-item`,{target:t.metadata.target}),n.stopPropagation()}),t.events.on(`grab-changed`,({action:n})=>{n===`start`?(this.events.emit(`select-item`,{item:e.item}),this._grabbedManipulator=t):this._grabbedManipulator===t&&(this._grabbedManipulator=null,this.hideInteractionVisuals()),this._manipulatorByObject.set(e,t)}),t.events.on(`drag`,t=>{e.updateDragIntersection(t),t.action===`start`&&this.showInteractionVisuals(e)}),t.events.on(`location-update`,()=>this._syncInteractionVisuals()),this._createDragHandle(e,t)])}_createDragHandle(e,t){return x(t,(n,r,i,a)=>{let o=e.operations;if(o==null)return;let s=null,{cancelSnapping:c,snappingStep:l}=D({snappingContext:new E({editGeometryOperations:o,elevationInfo:e.elevationInfo,pointer:a,visualizer:new v}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});i.next(e=>(s?.undo(null),s=null,e)).next(c);let u=o.data.allVerticesUnordered.at(0);r.next(t=>(t.action===`start`&&(s=e.createUndoRecord()),{...t,snapOrigin:u?.pos})).next(S(this.view,t.elevationAlignedLocation)).next(y(this.view,o.data.geometry,e.elevationInfo,o.data.spatialReference)).next(C(this.view,e.elevationInfo)).next(...l).next(w(e)).next(e=>(e.action===`end`&&s!=null&&(this.events.emit(`record-undo`,{record:s}),s=null),e))})}_syncManipulators(){for(let[e,t]of this._manipulatorByObject)this._syncManipulator(e,t);this._syncInteractionVisuals()}_syncManipulator(e,t){let n=e.origin;if(t.available=this.visible&&e.visible&&n!=null,t.interactive=this.manipulatorsInteractive&&(this._grabbedManipulator==null||this._grabbedManipulator===t),n!=null&&(t.elevationAlignedLocation=n),e.item.type!==`target`)return;let r=this.analysisViewData.computations.find(t=>t.target===e.item),i=r==null||!r.computationResult.isValid?g.undefined:r.computationResult.isTargetVisible?g.visible:g.occluded;t.state=this.interacting&&t.selected?_(i):i}_syncInteractionVisuals(){let e=this._interactionVisuals,t=this._visualsManipulator,n=this.visible&&this.analysisViewData.visible;if(e==null||t==null||!n){e?.hide();return}let r=[...this._manipulatorByObject.entries()].find(([e])=>e.item.type===`observer`)?.[1];if(r==null){e.hide();return}let i=t===r?null:f(r.renderLocation,t.renderLocation,k);e.update({target:t.renderLocation,lineVerticalPlaneSegment:i,visible:!0})}};e([c({constructOnly:!0})],j.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],j.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],j.prototype,`view`,void 0),e([c({constructOnly:!0})],j.prototype,`tooltip`,void 0),e([c()],j.prototype,`automaticManipulatorSelection`,void 0),e([c()],j.prototype,`removeIncompleteOnCancel`,void 0),e([c()],j.prototype,`interacting`,void 0),e([c()],j.prototype,`manipulatorsInteractive`,void 0),e([c()],j.prototype,`_grabbedManipulator`,void 0),e([c()],j.prototype,`_manipulatorsToHide`,null),e([c()],j.prototype,`updating`,null),j=e([l(`esri.views.3d.analysis.LineOfSight.LineOfSightItemTool`)],j);export{j as LineOfSightItemTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{lineOfSightPlacementLeafPluginMarker as a}from"./LineOfSightPlacementLeafPlugin.js";import{PluginBase as o}from"../../../draw/plugins/PluginBase.js";var s,c;const l=Symbol(`line-of-sight-observer-vertex`),u=Symbol(`line-of-sight-observer-plugin-marker`);let d=class extends o{constructor(){super(...arguments),this[s]=!0,this[c]=!0,this.observer=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null}static{s=u,c=a}start(e){super.start(e),this.preservedIntersection=null;let{session:r,positionOfLastUserInput:i}=e,a=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??i:this.inputMapPosition??i;a&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&r.appendOrReplacePoint(l,a),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?a??void 0:void 0}),this.addHandles(t(()=>this._interactiveHandle?.outputMapPosition,e=>{e&&!this._isComplete&&this._session?.appendOrReplacePoint(l,e)},n),this._ownHandlesKey))}};e([r({constructOnly:!0})],d.prototype,`observer`,void 0),e([r()],d.prototype,`defaultCaptureMode`,void 0),e([r()],d.prototype,`inputMapPosition`,void 0),e([r()],d.prototype,`preservedIntersection`,void 0),e([r()],d.prototype,`_interactiveHandle`,void 0),d=e([i(`esri.views.3d.analysis.LineOfSight.LineOfSightObserverPlugin`)],d);function f(e){return!!e&&u in e}function p(e={}){return{uniqueId:Symbol(`line-of-sight-observer-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new d(e)}}export{d as LineOfSightObserverPlugin,p as createLineOfSightObserverPluginConfiguration,f as isLineOfSightObserverPlugin,u as lineOfSightObserverPluginMarker};
2
+ import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{lineOfSightPlacementLeafPluginMarker as a}from"./LineOfSightPlacementLeafPlugin.js";import{PluginBase as o}from"../../../draw/plugins/PluginBase.js";var s,c;const l=Symbol(`line-of-sight-observer-vertex`),u=Symbol(`line-of-sight-observer-plugin-marker`);let d=class extends o{constructor(){super(...arguments),this[s]=!0,this[c]=!0,this.observer=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null}static{s=u,c=a}start(e){super.start(e),this.preservedIntersection=null;let{session:r,positionOfLastUserInput:i}=e,a=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??i:this.inputMapPosition??i;a&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&r.appendOrReplacePoint(l,a),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?a??void 0:void 0},{elevationFieldProperties:{unlockOnVertexPlacement:!0}}),this.addHandles(t(()=>this._interactiveHandle?.outputMapPosition,e=>{e&&!this._isComplete&&this._session?.appendOrReplacePoint(l,e)},n),this._ownHandlesKey))}};e([r({constructOnly:!0})],d.prototype,`observer`,void 0),e([r()],d.prototype,`defaultCaptureMode`,void 0),e([r()],d.prototype,`inputMapPosition`,void 0),e([r()],d.prototype,`preservedIntersection`,void 0),e([r()],d.prototype,`_interactiveHandle`,void 0),d=e([i(`esri.views.3d.analysis.LineOfSight.LineOfSightObserverPlugin`)],d);function f(e){return!!e&&u in e}function p(e={}){return{uniqueId:Symbol(`line-of-sight-observer-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new d(e)}}export{d as LineOfSightObserverPlugin,p as createLineOfSightObserverPluginConfiguration,f as isLineOfSightObserverPlugin,u as lineOfSightObserverPluginMarker};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import{convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{createDrawTool as u}from"./lineOfSightPlacementUtils.js";import{createLineOfSightRootPluginConfiguration as d}from"./LineOfSightRootPlugin.js";import{isLineOfSightTargetPlugin as f}from"./LineOfSightTargetPlugin.js";import{Manipulator3D as p}from"../../interactive/Manipulator3D.js";const m=Symbol(`hiddenManipulatorHandle`);let h=class extends t{get active(){return!!this._drawTool?.active}get canRedo(){return this._drawTool?.canRedo??!1}get canUndo(){return this._drawTool?.canUndo??!1}get updating(){return this._drawTool?.updating??!1}get activeTooltipInfo(){return this._drawTool?.activeTooltipInfo??null}get tooltip(){return this._drawTool?.tooltip??null}constructor(e){super(e),this.visible=!0,this.observerPlacementElevationInfo=null,this.targetPlacementElevationInfo=null,this._drawTool=null,this._renderer=null,this._observerSessionElevationInfo=null,this._targetSessionElevationInfo=null,this._sessionStartedWithValidAnalysis=!1}initialize(){this.addHandles([r(()=>!this.active,()=>{this.analysisViewData.cursorTarget=null},i),a(()=>this.activeTooltipInfo,e=>{e&&(e.elevationModeContext=this._elevationModeContext)},i)])}destroy(){this._destroyDrawTool()}get _placementElevationInfo(){return this.analysis.observer==null?this._observerSessionElevationInfo:this._targetSessionElevationInfo}get _effectiveElevationInfo(){return this._placementElevationInfo??c}get _elevationModeContext(){let e=this;return{get mode(){return e._effectiveElevationInfo.mode},get disabled(){return!e._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:e=>this.setElevationMode(e)}}setElevationMode(e){let t=this._drawTool,n=t?.interactiveHandleManager?.focusedHandle,r=n?.outputMapPosition;if(!t||!n||!r||e===this._effectiveElevationInfo.mode)return;let i=t.activeTooltipInfo?.getConstraintFieldByName(n,`elevation`)?.locked===!0,{position:a,elevationInfo:o}=l({view:this.view,point:r,sourceElevationInfo:this._placementElevationInfo,mode:e,preserveZ:i}),s=()=>{t.defaultZ=a.z,this.analysis.observer==null?this._observerSessionElevationInfo=o:this._targetSessionElevationInfo=o,n.inputMapPosition=a.clone(),n.selectedSnappingResult=null,n.outputMapPosition=a},c=t.mostDownstreamPlugin;f(c)?c.changeElevationMode(e,i,s):s(),this._renderer?.refresh()}continue(){if(this._drawTool?.active)return;this._sessionStartedWithValidAnalysis=this.analysis.valid,this._observerSessionElevationInfo=this.observerPlacementElevationInfo?.clone()??null,this._targetSessionElevationInfo=this.targetPlacementElevationInfo?.clone()??null;let{drawTool:e,renderer:t}=this._createDrawTool();this._drawTool=e,this._renderer=t,this.view.addAndActivateTool(e),e.begin([d({analysis:this.analysis,analysisViewData:this.analysisViewData,getObserverElevationInfo:()=>this._observerSessionElevationInfo,getTargetElevationInfo:()=>this._targetSessionElevationInfo,view:this.view})])}stop(){this._destroyDrawTool()}redo(){this._drawTool?.redo()}undo(){this._drawTool?.undo()}get testInfo(){}_createDrawTool(){return u({analysis:this.analysis,analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,getSourceElevationInfo:()=>this._effectiveElevationInfo,getVisible:()=>this.visible,onCancel:e=>{e===this._drawTool&&!this._sessionStartedWithValidAnalysis&&this.analysis.observer==null&&(this.analysis.clear(),this.analysisViewData.cursorTarget=null),this._destroyDrawTool(e)},onComplete:e=>this._destroyDrawTool(e),onManipulatorCountChange:e=>this._hideManipulatorOnAppearance(e),shouldPreventVertexAdd:this.shouldPreventVertexAdd})}_destroyDrawTool(e=this._drawTool){if(e==null)return;let t=e===this._drawTool;this.view.activeTool===e&&(this.view.activeTool=null),this.view.tools.includes(e)&&this.view.tools.remove(e),e.destroy(),t&&(this._drawTool=null,this._renderer=null,this._sessionStartedWithValidAnalysis=!1)}_hideManipulatorOnAppearance(e){e.removeHandles(m),e.addHandles(e.manipulators.toArray().map(e=>e instanceof p?e.disableDisplay():null).filter(n),m)}};e([o({constructOnly:!0})],h.prototype,`view`,void 0),e([o({constructOnly:!0})],h.prototype,`analysis`,void 0),e([o({constructOnly:!0})],h.prototype,`analysisViewData`,void 0),e([o({constructOnly:!0})],h.prototype,`parent`,void 0),e([o({constructOnly:!0})],h.prototype,`shouldPreventVertexAdd`,void 0),e([o({constructOnly:!0})],h.prototype,`snappingManager`,void 0),e([o()],h.prototype,`visible`,void 0),e([o()],h.prototype,`observerPlacementElevationInfo`,void 0),e([o()],h.prototype,`targetPlacementElevationInfo`,void 0),e([o()],h.prototype,`active`,null),e([o()],h.prototype,`canRedo`,null),e([o()],h.prototype,`canUndo`,null),e([o()],h.prototype,`updating`,null),e([o()],h.prototype,`activeTooltipInfo`,null),e([o()],h.prototype,`tooltip`,null),e([o()],h.prototype,`_drawTool`,void 0),e([o()],h.prototype,`_renderer`,void 0),e([o()],h.prototype,`_observerSessionElevationInfo`,void 0),e([o()],h.prototype,`_targetSessionElevationInfo`,void 0),e([o()],h.prototype,`_elevationModeContext`,null),h=e([s(`esri.views.3d.analysis.LineOfSight.LineOfSightPlacementController`)],h);export{h as LineOfSightPlacementController};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import{convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{createLineOfSightPlacementRootPluginConfiguration as u}from"./LineOfSightPlacementRootPlugin.js";import{isLineOfSightTargetPlugin as d}from"./LineOfSightTargetPlugin.js";import{createDrawTool as f}from"./placementUtils.js";import{Manipulator3D as p}from"../../interactive/Manipulator3D.js";const m=Symbol(`hiddenManipulatorHandle`);let h=class extends t{get active(){return!!this._drawTool?.active}get canRedo(){return this._drawTool?.canRedo??!1}get canUndo(){return this._drawTool?.canUndo??!1}get updating(){return this._drawTool?.updating??!1}get activeTooltipInfo(){return this._drawTool?.activeTooltipInfo??null}get tooltip(){return this._drawTool?.tooltip??null}constructor(e){super(e),this.visible=!0,this.observerPlacementElevationInfo=null,this.targetPlacementElevationInfo=null,this._drawTool=null,this._renderer=null,this._observerSessionElevationInfo=null,this._targetSessionElevationInfo=null,this._sessionStartedWithValidAnalysis=!1}initialize(){this.addHandles([r(()=>!this.active,()=>{this.analysisViewData.cursorTarget=null},i),a(()=>this.activeTooltipInfo,e=>{e&&(e.elevationModeContext=this._elevationModeContext)},i)])}destroy(){this._destroyDrawTool()}get _placementElevationInfo(){return this.analysis.observer==null?this._observerSessionElevationInfo:this._targetSessionElevationInfo}get _effectiveElevationInfo(){return this._placementElevationInfo??c}get _elevationModeContext(){let e=this;return{get mode(){return e._effectiveElevationInfo.mode},get disabled(){return!e._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:e=>this.setElevationMode(e)}}setElevationMode(e){let t=this._drawTool,n=t?.interactiveHandleManager?.focusedHandle,r=n?.outputMapPosition;if(!t||!n||!r||e===this._effectiveElevationInfo.mode)return;let i=t.activeTooltipInfo?.getConstraintFieldByName(n,`elevation`)?.locked===!0,{position:a,elevationInfo:o}=l({view:this.view,point:r,sourceElevationInfo:this._placementElevationInfo,mode:e,preserveZ:i}),s=()=>{t.defaultZ=a.z,this.analysis.observer==null?this._observerSessionElevationInfo=o:this._targetSessionElevationInfo=o,n.inputMapPosition=a.clone(),n.selectedSnappingResult=null,n.outputMapPosition=a},c=t.mostDownstreamPlugin;d(c)?c.changeElevationMode(e,i,s):s(),this._renderer?.refresh()}continue(){if(this._drawTool?.active)return;this._sessionStartedWithValidAnalysis=this.analysis.valid,this._observerSessionElevationInfo=this.observerPlacementElevationInfo?.clone()??null,this._targetSessionElevationInfo=this.targetPlacementElevationInfo?.clone()??null;let{drawTool:e,renderer:t}=this._createDrawTool();this._drawTool=e,this._renderer=t,this.view.addAndActivateTool(e),e.begin([u({analysis:this.analysis,analysisViewData:this.analysisViewData,getObserverElevationInfo:()=>this._observerSessionElevationInfo,getTargetElevationInfo:()=>this._targetSessionElevationInfo,view:this.view})])}stop(){this._destroyDrawTool()}redo(){this._drawTool?.redo()}undo(){this._drawTool?.undo()}get testInfo(){}_createDrawTool(){return f({analysis:this.analysis,analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,getSourceElevationInfo:()=>this._effectiveElevationInfo,getVisible:()=>this.visible,onCancel:e=>{e===this._drawTool&&!this._sessionStartedWithValidAnalysis&&this.analysis.observer==null&&(this.analysis.clear(),this.analysisViewData.cursorTarget=null),this._destroyDrawTool(e)},onComplete:e=>this._destroyDrawTool(e),onManipulatorCountChange:e=>this._hideManipulatorOnAppearance(e),shouldPreventVertexAdd:this.shouldPreventVertexAdd})}_destroyDrawTool(e=this._drawTool){if(e==null)return;let t=e===this._drawTool;this.view.activeTool===e&&(this.view.activeTool=null),this.view.tools.includes(e)&&this.view.tools.remove(e),e.destroy(),t&&(this._drawTool=null,this._renderer=null,this._sessionStartedWithValidAnalysis=!1)}_hideManipulatorOnAppearance(e){e.removeHandles(m),e.addHandles(e.manipulators.toArray().map(e=>e instanceof p?e.disableDisplay():null).filter(n),m)}};e([o({constructOnly:!0})],h.prototype,`view`,void 0),e([o({constructOnly:!0})],h.prototype,`analysis`,void 0),e([o({constructOnly:!0})],h.prototype,`analysisViewData`,void 0),e([o({constructOnly:!0})],h.prototype,`shouldPreventVertexAdd`,void 0),e([o({constructOnly:!0})],h.prototype,`snappingManager`,void 0),e([o()],h.prototype,`visible`,void 0),e([o()],h.prototype,`observerPlacementElevationInfo`,void 0),e([o()],h.prototype,`targetPlacementElevationInfo`,void 0),e([o()],h.prototype,`active`,null),e([o()],h.prototype,`canRedo`,null),e([o()],h.prototype,`canUndo`,null),e([o()],h.prototype,`updating`,null),e([o()],h.prototype,`activeTooltipInfo`,null),e([o()],h.prototype,`tooltip`,null),e([o()],h.prototype,`_drawTool`,void 0),e([o()],h.prototype,`_renderer`,void 0),e([o()],h.prototype,`_observerSessionElevationInfo`,void 0),e([o()],h.prototype,`_targetSessionElevationInfo`,void 0),e([o()],h.prototype,`_elevationModeContext`,null),h=e([s(`esri.views.3d.analysis.LineOfSight.LineOfSightPlacementController`)],h);export{h as LineOfSightPlacementController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisObserver.js";import n from"../../../../analysis/LineOfSightAnalysisTarget.js";import r from"../../../../core/Collection.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{isPoint as s,isMultipoint as c}from"../../../../geometry/support/typeUtils.js";import{updateLineOfSightItemFromAuthoredPoint as l}from"./LineOfSightAuthoringUtils.js";import{isLineOfSightObserverPlugin as u,createLineOfSightObserverPluginConfiguration as d}from"./LineOfSightObserverPlugin.js";import{isLineOfSightPlacementLeafPlugin as f}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as p}from"./LineOfSightRayIntersector.js";import{isLineOfSightTargetPlugin as m,createLineOfSightTargetPluginConfiguration as h}from"./LineOfSightTargetPlugin.js";import{PluginBase as g}from"../../../draw/plugins/PluginBase.js";let _=class extends g{constructor(){super(...arguments),this._intersector=null,this._downstreamPlugin=null,this._initialObserver=null,this._operationObserver=null,this._initialTargets=new r,this._operationTargets=new r}initialize(){this._intersector=new p({view:this.view})}destroy(){this._intersector=i(this._intersector)}start(e){super.start(e),this._initialObserver=this.analysis.observer,this._operationObserver=this._initialObserver,y(this._initialTargets,this.analysis.targets.toArray()),this._operationTargets.removeAll(),e.session.appendOrReplacePart(null,[]),this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}beforeAttachPlugin(e){return{geometryType:`point`,useStandaloneSession:!0}}beforeComplete(){return{downstreamPluginCompletionMode:`cancel`}}attachPlugin(e){this._downstreamPlugin=e}afterUndoRedo(){this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}detachPlugin(e,r){if(this._downstreamPlugin===e&&(this._downstreamPlugin=null),m(e)&&this._clearCursorTarget(),r!==`complete`){this._syncAnalysisFromSession();return}let i=this._context?.getSession(e)?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`point`});if(!i||!s(i)){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._truncateItemsToSession();let a=f(e)?e.preservedIntersection:null;if(u(e)){let n=e.observer??this._operationObserver??new t;if(!this._intersector||!l(this.view,n,this._intersector,i,{elevationInfo:this.getObserverElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationObserver=n}else if(m(e)){let t=e.target??new n;if(!this._intersector||!l(this.view,t,this._intersector,i,{elevationInfo:this.getTargetElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationTargets.add(t)}this._appendCommittedPoint(i),this._syncAnalysisFromSession(),this._restartDownstreamPlugin(),this._clearCursorTarget()}_appendCommittedPoint(e){let t=this._session;t&&(t.appendOrReplacePoint(null,e),t.appendOrReplacePart(null,[]),t.automaticRestart=!1,t.groupGeometryChanges())}_clearCursorTarget(){this.analysisViewData.cursorTarget=i(this.analysisViewData.cursorTarget)}_truncateItemsToSession(){let e=this._getCommittedPointCount();this._initialObserver==null&&e===0&&(this._operationObserver=null),this._operationTargets.splice(this._getCommittedOperationTargetCount(e))}_restartDownstreamPlugin(){let e=this.analysis.observer==null,t=e?this._createObserverPluginConfiguration():this._createTargetPluginConfiguration();e&&u(this._downstreamPlugin)||!e&&m(this._downstreamPlugin)||this._context?.requestBeginDownstreamPlugin(t,{cancelExisting:!0})}_createObserverPluginConfiguration(e=null){return d({observer:e,defaultCaptureMode:e?`grabbable-object`:`capture-always`,inputMapPosition:e?.position??null})}_createTargetPluginConfiguration(e=null){return h({analysis:this.analysis,analysisViewData:this.analysisViewData,defaultCaptureMode:e?`grabbable-object`:`capture-always`,getElevationInfo:this.getTargetElevationInfo,inputMapPosition:e?.position??null,target:e,view:this.view})}_syncAnalysisFromSession(){let e=this._getCommittedPointCount(),t=this._getCommittedOperationTargetCount(e);this.analysis.observer=this._getActiveObserver(e),y(this.analysis.targets,this._initialTargets.toArray().concat(this._operationTargets.toArray().slice(0,t)))}_getActiveObserver(e){return this._initialObserver==null?e>0?this._operationObserver:null:this._operationObserver??null}_getCommittedOperationTargetCount(e){return Math.max(0,e-(this._initialObserver==null?Math.min(e,1):0))}_getCommittedPointCount(){let e=this._session?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`multipoint`});return e&&c(e)?e.points.length:0}};e([a({constructOnly:!0})],_.prototype,`analysis`,void 0),e([a({constructOnly:!0})],_.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],_.prototype,`view`,void 0),e([a({constructOnly:!0})],_.prototype,`getObserverElevationInfo`,void 0),e([a({constructOnly:!0})],_.prototype,`getTargetElevationInfo`,void 0),e([a()],_.prototype,`_intersector`,void 0),e([a()],_.prototype,`_downstreamPlugin`,void 0),_=e([o(`esri.views.3d.analysis.LineOfSight.LineOfSightRootPlugin`)],_);function v(e){return{uniqueId:Symbol(`line-of-sight-root-plugin`),kind:[`multipart`],geometryType:`multipoint`,hidden:!0,localizationKey:`line-of-sight-root`,icon:`point`,create:()=>new _(e)}}function y(e,t){let n=-1;for(let r=0;r<Math.min(e.length,t.length);r++)if(e.getItemAt(r)!==t[r]){n=r;break}if(n===-1){if(e.length===t.length)return;n=Math.min(e.length,t.length)}e.splice(n,e.length-n,...t.slice(n))}export{_ as LineOfSightRootPlugin,v as createLineOfSightRootPluginConfiguration};
2
+ import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisObserver.js";import n from"../../../../analysis/LineOfSightAnalysisTarget.js";import r from"../../../../core/Collection.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{isPoint as s,isMultipoint as c}from"../../../../geometry/support/typeUtils.js";import{updateLineOfSightItemFromAuthoredPoint as l}from"./LineOfSightAuthoringUtils.js";import{isLineOfSightObserverPlugin as u,createLineOfSightObserverPluginConfiguration as d}from"./LineOfSightObserverPlugin.js";import{isLineOfSightPlacementLeafPlugin as f}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as p}from"./LineOfSightRayIntersector.js";import{isLineOfSightTargetPlugin as m,createLineOfSightTargetPluginConfiguration as h}from"./LineOfSightTargetPlugin.js";import{PluginBase as g}from"../../../draw/plugins/PluginBase.js";let _=class extends g{constructor(){super(...arguments),this._intersector=null,this._downstreamPlugin=null,this._initialObserver=null,this._operationObserver=null,this._initialTargets=new r,this._operationTargets=new r}initialize(){this._intersector=new p({view:this.view})}destroy(){this._intersector=i(this._intersector)}start(e){super.start(e),this._initialObserver=this.analysis.observer,this._operationObserver=this._initialObserver,y(this._initialTargets,this.analysis.targets.toArray()),this._operationTargets.removeAll(),e.session.appendOrReplacePart(null,[]),this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}beforeAttachPlugin(e){return{geometryType:`point`,useStandaloneSession:!0}}beforeComplete(){return{downstreamPluginCompletionMode:`cancel`}}attachPlugin(e){this._downstreamPlugin=e}afterUndoRedo(){this._syncAnalysisFromSession(),this._restartDownstreamPlugin()}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}detachPlugin(e,r){if(this._downstreamPlugin===e&&(this._downstreamPlugin=null),m(e)&&this._clearCursorTarget(),r!==`complete`){this._syncAnalysisFromSession();return}let i=this._context?.getSession(e)?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`point`});if(!i||!s(i)){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._truncateItemsToSession();let a=f(e)?e.preservedIntersection:null;if(u(e)){let n=e.observer??this._operationObserver??new t;if(!this._intersector||!l(this.view,n,this._intersector,i,{elevationInfo:this.getObserverElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationObserver=n}else if(m(e)){let t=e.target??new n;if(!this._intersector||!l(this.view,t,this._intersector,i,{elevationInfo:this.getTargetElevationInfo(),preservedIntersection:a})){this._syncAnalysisFromSession(),this._restartDownstreamPlugin();return}this._operationTargets.add(t)}this._appendCommittedPoint(i),this._syncAnalysisFromSession(),this._restartDownstreamPlugin(),this._clearCursorTarget()}_appendCommittedPoint(e){let t=this._session;t&&(t.appendOrReplacePoint(null,e),t.appendOrReplacePart(null,[]),t.automaticRestart=!1,t.groupGeometryChanges())}_clearCursorTarget(){this.analysisViewData.cursorTarget=i(this.analysisViewData.cursorTarget)}_truncateItemsToSession(){let e=this._getCommittedPointCount();this._initialObserver==null&&e===0&&(this._operationObserver=null),this._operationTargets.splice(this._getCommittedOperationTargetCount(e))}_restartDownstreamPlugin(){let e=this.analysis.observer==null,t=e?this._createObserverPluginConfiguration():this._createTargetPluginConfiguration();e&&u(this._downstreamPlugin)||!e&&m(this._downstreamPlugin)||this._context?.requestBeginDownstreamPlugin(t,{cancelExisting:!0})}_createObserverPluginConfiguration(e=null){return d({observer:e,defaultCaptureMode:e?`grabbable-object`:`capture-always`,inputMapPosition:e?.position??null})}_createTargetPluginConfiguration(e=null){return h({analysis:this.analysis,analysisViewData:this.analysisViewData,defaultCaptureMode:e?`grabbable-object`:`capture-always`,getElevationInfo:this.getTargetElevationInfo,inputMapPosition:e?.position??null,target:e,view:this.view})}_syncAnalysisFromSession(){let e=this._getCommittedPointCount(),t=this._getCommittedOperationTargetCount(e);this.analysis.observer=this._getActiveObserver(e),y(this.analysis.targets,this._initialTargets.toArray().concat(this._operationTargets.toArray().slice(0,t)))}_getActiveObserver(e){return this._initialObserver==null?e>0?this._operationObserver:null:this._operationObserver??null}_getCommittedOperationTargetCount(e){return Math.max(0,e-(this._initialObserver==null?Math.min(e,1):0))}_getCommittedPointCount(){let e=this._session?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:`multipoint`});return e&&c(e)?e.points.length:0}};e([a({constructOnly:!0})],_.prototype,`analysis`,void 0),e([a({constructOnly:!0})],_.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],_.prototype,`view`,void 0),e([a({constructOnly:!0})],_.prototype,`getObserverElevationInfo`,void 0),e([a({constructOnly:!0})],_.prototype,`getTargetElevationInfo`,void 0),e([a()],_.prototype,`_intersector`,void 0),e([a()],_.prototype,`_downstreamPlugin`,void 0),_=e([o(`esri.views.3d.analysis.LineOfSight.LineOfSightPlacementRootPlugin`)],_);function v(e){return{uniqueId:Symbol(`line-of-sight-root-plugin`),kind:[`multipart`],geometryType:`multipoint`,hidden:!0,localizationKey:`line-of-sight-root`,icon:`point`,create:()=>new _(e)}}function y(e,t){let n=-1;for(let r=0;r<Math.min(e.length,t.length);r++)if(e.getItemAt(r)!==t[r]){n=r;break}if(n===-1){if(e.length===t.length)return;n=Math.min(e.length,t.length)}e.splice(n,e.length-n,...t.slice(n))}export{_ as LineOfSightPlacementRootPlugin,v as createLineOfSightPlacementRootPluginConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisTarget.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,sync as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{updateLineOfSightItemFromIntersection as s,updateLineOfSightItemFromAuthoredPoint as c,convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{lineOfSightPlacementLeafPluginMarker as u}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as d}from"./LineOfSightRayIntersector.js";import{PluginBase as f}from"../../../draw/plugins/PluginBase.js";var p,m;const h=Symbol(`line-of-sight-target-vertex`),g=Symbol(`line-of-sight-target-plugin-marker`);let _=class extends f{constructor(){super(...arguments),this[p]=!0,this[m]=!0,this.target=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null,this._intersector=null,this._changingElevationMode=!1}static{p=g,m=u}initialize(){this._intersector=new d({view:this.view})}destroy(){this._intersector=n(this._intersector)}start(e){super.start(e),this.preservedIntersection=null;let{positionOfLastUserInput:a,session:o}=e,l=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??a:this.inputMapPosition??a;l&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&o.appendOrReplacePoint(h,l);let u=this.defaultCaptureMode===`capture-always`&&l!=null;this._interactiveHandle&&this._clearCursorTarget(),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?l??void 0:void 0}),this.addHandles(r(()=>[this._interactiveHandle?.outputMapPosition,this.getElevationInfo()],([e,r])=>{if(!e||this._isComplete||this._changingElevationMode)return;let i=this.analysisViewData.cursorTarget??new t,a={elevationInfo:r},o=this._interactiveHandle?.screenPosition,l=o&&this._intersector?this._intersector.getScreenPointIntersection(o):null;if(this._session?.appendOrReplacePoint(h,e),u){u=!1,this._clearCursorTarget();return}if(l!=null){this.analysisViewData.cursorTarget=i,s(this.view,i,l,{...a,snappedMapPoint:e});return}if(o!=null&&this.preservedIntersection!=null){this.analysisViewData.cursorTarget=i,s(this.view,i,this.preservedIntersection,{...a,snappedMapPoint:e});return}if(o!=null){this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget);return}if(!this._intersector||!c(this.view,i,this._intersector,e,{...a,preservedIntersection:this.preservedIntersection})){this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget);return}this.analysisViewData.cursorTarget=i},i),this._ownHandlesKey))}changeElevationMode(e,t,n){let r=this.analysisViewData.cursorTarget,i=r?.position,a=i?l({view:this.view,point:i,sourceElevationInfo:r.elevationInfo,mode:e,preserveZ:t}):null;this._changingElevationMode=!0;try{n();let e=this._interactiveHandle?.outputMapPosition;e&&this._session?.appendOrReplacePoint(h,e),r&&a&&(r.position=a.position,r.elevationInfo=a.elevationInfo)}finally{this._changingElevationMode=!1}}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}_clearCursorTarget(){this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget)}};e([a({constructOnly:!0})],_.prototype,`analysis`,void 0),e([a({constructOnly:!0})],_.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],_.prototype,`view`,void 0),e([a({constructOnly:!0})],_.prototype,`target`,void 0),e([a({constructOnly:!0})],_.prototype,`getElevationInfo`,void 0),e([a()],_.prototype,`defaultCaptureMode`,void 0),e([a()],_.prototype,`inputMapPosition`,void 0),e([a()],_.prototype,`preservedIntersection`,void 0),e([a()],_.prototype,`_interactiveHandle`,void 0),e([a()],_.prototype,`_intersector`,void 0),_=e([o(`esri.views.3d.analysis.LineOfSight.LineOfSightTargetPlugin`)],_);function v(e){return!!e&&g in e}function y(e){return{uniqueId:Symbol(`line-of-sight-target-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new _(e)}}export{_ as LineOfSightTargetPlugin,y as createLineOfSightTargetPluginConfiguration,v as isLineOfSightTargetPlugin,g as lineOfSightTargetPluginMarker};
2
+ import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisTarget.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,sync as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{updateLineOfSightItemFromIntersection as s,updateLineOfSightItemFromAuthoredPoint as c,convertLineOfSightElevationMode as l}from"./LineOfSightAuthoringUtils.js";import{lineOfSightPlacementLeafPluginMarker as u}from"./LineOfSightPlacementLeafPlugin.js";import{LineOfSightRayIntersector as d}from"./LineOfSightRayIntersector.js";import{PluginBase as f}from"../../../draw/plugins/PluginBase.js";var p,m;const h=Symbol(`line-of-sight-target-vertex`),g=Symbol(`line-of-sight-target-plugin-marker`);let _=class extends f{constructor(){super(...arguments),this[p]=!0,this[m]=!0,this.target=null,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.preservedIntersection=null,this._interactiveHandle=null,this._intersector=null,this._changingElevationMode=!1}static{p=g,m=u}initialize(){this._intersector=new d({view:this.view})}destroy(){this._intersector=n(this._intersector)}start(e){super.start(e),this.preservedIntersection=null;let{positionOfLastUserInput:a,session:o}=e,l=this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??a:this.inputMapPosition??a;l&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&o.appendOrReplacePoint(h,l);let u=this.defaultCaptureMode===`capture-always`&&l!=null;this._interactiveHandle&&this._clearCursorTarget(),this._interactiveHandle||(this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:this.defaultCaptureMode,inputMapPosition:this.defaultCaptureMode===`grabbable-object`?l??void 0:void 0},{elevationFieldProperties:{unlockOnVertexPlacement:!0}}),this.addHandles(r(()=>[this._interactiveHandle?.outputMapPosition,this.getElevationInfo()],([e,r])=>{if(!e||this._isComplete||this._changingElevationMode)return;let i=this.analysisViewData.cursorTarget??new t,a={elevationInfo:r},o=this._interactiveHandle?.screenPosition,l=o&&this._intersector?this._intersector.getScreenPointIntersection(o):null;if(this._session?.appendOrReplacePoint(h,e),u){u=!1,this._clearCursorTarget();return}if(l!=null){this.analysisViewData.cursorTarget=i,s(this.view,i,l,{...a,snappedMapPoint:e});return}if(o!=null&&this.preservedIntersection!=null){this.analysisViewData.cursorTarget=i,s(this.view,i,this.preservedIntersection,{...a,snappedMapPoint:e});return}if(o!=null){this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget);return}if(!this._intersector||!c(this.view,i,this._intersector,e,{...a,preservedIntersection:this.preservedIntersection})){this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget);return}this.analysisViewData.cursorTarget=i},i),this._ownHandlesKey))}changeElevationMode(e,t,n){let r=this.analysisViewData.cursorTarget,i=r?.position,a=i?l({view:this.view,point:i,sourceElevationInfo:r.elevationInfo,mode:e,preserveZ:t}):null;this._changingElevationMode=!0;try{n();let e=this._interactiveHandle?.outputMapPosition;e&&this._session?.appendOrReplacePoint(h,e),r&&a&&(r.position=a.position,r.elevationInfo=a.elevationInfo)}finally{this._changingElevationMode=!1}}complete(){this._clearCursorTarget(),super.complete()}cancel(){this._clearCursorTarget()}_clearCursorTarget(){this.analysisViewData.cursorTarget=n(this.analysisViewData.cursorTarget)}};e([a({constructOnly:!0})],_.prototype,`analysis`,void 0),e([a({constructOnly:!0})],_.prototype,`analysisViewData`,void 0),e([a({constructOnly:!0})],_.prototype,`view`,void 0),e([a({constructOnly:!0})],_.prototype,`target`,void 0),e([a({constructOnly:!0})],_.prototype,`getElevationInfo`,void 0),e([a()],_.prototype,`defaultCaptureMode`,void 0),e([a()],_.prototype,`inputMapPosition`,void 0),e([a()],_.prototype,`preservedIntersection`,void 0),e([a()],_.prototype,`_interactiveHandle`,void 0),e([a()],_.prototype,`_intersector`,void 0),_=e([o(`esri.views.3d.analysis.LineOfSight.LineOfSightTargetPlugin`)],_);function v(e){return!!e&&g in e}function y(e){return{uniqueId:Symbol(`line-of-sight-target-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new _(e)}}export{_ as LineOfSightTargetPlugin,y as createLineOfSightTargetPluginConfiguration,v as isLineOfSightTargetPlugin,g as lineOfSightTargetPluginMarker};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{makeHandle as t}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import o from"../../../../symbols/support/ElevationInfo.js";import{LineOfSightEditTool as s}from"./LineOfSightEditTool.js";import{LineOfSightPlacementController as c}from"./LineOfSightPlacementController.js";import{LineOfSightRayIntersector as l}from"./LineOfSightRayIntersector.js";import{ExclusiveOperationManager as u}from"../../../analysis/ExclusiveOperationManager.js";import{ViewEventPriorities as d}from"../../../input/InputManager.js";import{AnalysisToolBase as f}from"../../../interactive/AnalysisToolBase.js";import{deactivateTool as p}from"../../../interactive/interactiveToolUtils.js";import{sketchKeys as m}from"../../../interactive/keybindings.js";import{acquire as h}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as g}from"../../../interactive/snapping/snappingUtils.js";const _={ready:`ready`,creating:`creating`,created:`created`};let v=class extends f{constructor(e){super(e),this._operationManager=new u,this._syncingActiveTool=!1,this.analysisViewData=null,this.removeIncompleteOnCancel=!1;let{snappingManager:t}=this._snappingManagerResult=h(e.view);this._editIntersector=new l({view:e.view}),this._editTool=new s({analysis:e.analysis,analysisViewData:e.analysisViewData,intersector:this._editIntersector,snappingManager:t,view:e.view}),this._placementController=new c({...e,parent:this,snappingManager:t,shouldPreventVertexAdd:(e,t)=>this._editTool.hasManipulatorAt(e,t)})}get active(){return this._editTool.active||this._placementController.active}get canRedo(){return this._activeUndoRedoComponent?.canRedo??!1}get canUndo(){return this._activeUndoRedoComponent?.canUndo??!1}get selectedItem(){return this._editTool.selectedItem}get state(){return this._placementController.active?_.creating:this.analysis.observer?.position==null?_.ready:_.created}get cursor(){return this._placementController.active?`crosshair`:null}get updating(){return this._editTool.updating||this._placementController.updating}initialize(){g(this),this.addHandles([this._snappingManagerResult,this.view.on(`key-down`,e=>this._onKeyDown(e),d.WIDGET),n(()=>({editable:this.editable,interactive:this.analysisViewData.interactive,placementActive:this._placementController.active,valid:this.analysis.valid,visible:this.visible}),()=>this._syncActiveTool(),r),n(()=>this.state===_.created,e=>{e?this.finishToolCreation():this._set(`created`,!1)},r),n(()=>this.analysisViewData.visible,e=>{this.visible=e},r),n(()=>this.editable,e=>{this.analysisViewData.editable=e},r)])}destroy(){this._operationManager.destroy(),this._editTool.stop(),this._placementController.stop(),this._editTool.destroy(),this._placementController.destroy(),this._editIntersector.destroy()}place(e){return this.analysisViewData.interactive=!0,this._operationManager.start(`place`,async(i,a)=>{let{elevationInfo:o}=e??{},s=o&&`observer`in o?o.observer:o,c=o&&`targets`in o?o.targets:o;this._placementController.observerPlacementElevationInfo=y(s),this._placementController.targetPlacementElevationInfo=y(c);let l=this.analysis.clone(),u=!1,d=!1,f=()=>{if(d)return;if(d=!0,this.stop(),!this.analysis.valid){this.analysis.clear(),i.reject();return}if(a.aborted||this.analysis.equals(l)){i.reject();return}let e=this.analysis.targets.at(-1);e!=null&&this._editTool.selectItem(e),i.resolve({})};i.handles.push(t(()=>this.stop()),n(()=>this._placementController.active,e=>{if(e){u=!0;return}u&&f()},r)),this.continue()},e)}activate(){this.view.focus(),this.analysisViewData.interactive=!0,this._syncActiveTool(),!this.analysis.valid&&!this._placementController.active&&this.continue()}deactivate(){this.onDeactivate()}continue(){this.analysisViewData.interactive=!0,this._placementController.continue()}stop(){this._placementController.stop(),this._placementController.observerPlacementElevationInfo=null,this._placementController.targetPlacementElevationInfo=null,this._syncActiveTool()}redo(){this._activeUndoRedoComponent?.redo()}undo(){this._activeUndoRedoComponent?.undo()}get testInfo(){}get snappingOptions(){return this._snappingManager.options}set snappingOptions(e){this._snappingManager.options=e}get _snappingManager(){return this._snappingManagerResult.snappingManager}onEditableChange(){this.analysisViewData.editable=this.editable,this._editTool.setEditableFlag(1,!0),this._editTool.setEditableFlag(0,this.editable),this._syncActiveTool()}_hideEditTool(){this._editTool.stop(),this._editTool.visible=!1}_onKeyDown(e){let t=e.key;t===m.undo&&this.canUndo?(e.stopPropagation(),this.undo()):t===m.redo&&this.canRedo?(e.stopPropagation(),this.redo()):m.delete.includes(t)&&!this.active?this._editTool.deleteSelectedItem()&&e.stopPropagation():t===m.cancel&&!this.active&&this._editTool.clearSelection()&&e.stopPropagation()}get _activeUndoRedoComponent(){return this.analysisViewData.interactive?this._placementController.active||!this._canActivateEditTool?this._placementController.active?this._placementController:null:this._editTool:null}get _canActivateEditTool(){return this.visible&&this.editable&&this.analysis.valid&&this.analysis.observer?.position!=null}_syncActiveTool(){if(!this._syncingActiveTool){this._syncingActiveTool=!0;try{let e=this.analysisViewData.interactive,t=this._canActivateEditTool;if(this._placementController.visible=this.visible&&e,this._editTool.manipulatorsInteractive=e&&!this._placementController.active,!e){this._placementController.stop(),this._hideEditTool(),this.analysisViewData.cursorTarget=null,p(this.view,this);return}if(!this.visible){this._editTool.stop(),this._editTool.visible=!0,p(this.view,this);return}if(this._placementController.active){this._editTool.stop(),this._editTool.visible=this.visible,p(this.view,this);return}if(!t){this._hideEditTool(),p(this.view,this);return}this._editTool.visible=!0,this.analysisViewData.cursorTarget=null,p(this.view,this)}finally{this._syncingActiveTool=!1}}}};e([i({constructOnly:!0})],v.prototype,`view`,void 0),e([i({constructOnly:!0})],v.prototype,`analysis`,void 0),e([i({constructOnly:!0})],v.prototype,`analysisViewData`,void 0),e([i()],v.prototype,`active`,null),e([i()],v.prototype,`canRedo`,null),e([i()],v.prototype,`canUndo`,null),e([i()],v.prototype,`selectedItem`,null),e([i()],v.prototype,`state`,null),e([i()],v.prototype,`cursor`,null),e([i()],v.prototype,`updating`,null),e([i()],v.prototype,`removeIncompleteOnCancel`,void 0),e([i()],v.prototype,`snappingOptions`,null),e([i()],v.prototype,`_canActivateEditTool`,null),v=e([a(`esri.views.3d.analysis.LineOfSight.LineOfSightTool`)],v);function y(e){if(e==null)return null;let{featureExpressionInfo:t,mode:n,offset:r,unit:i}=e;return new o({featureExpressionInfo:t,mode:n,offset:r,unit:i})}export{v as LineOfSightTool};
2
+ import{__decorate as e}from"tslib";import{makeHandle as t}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import o from"../../../../symbols/support/ElevationInfo.js";import{LineOfSightEditTool as s}from"./LineOfSightEditTool.js";import{LineOfSightPlacementController as c}from"./LineOfSightPlacementController.js";import{LineOfSightRayIntersector as l}from"./LineOfSightRayIntersector.js";import{ExclusiveOperationManager as u}from"../../../analysis/ExclusiveOperationManager.js";import{ViewEventPriorities as d}from"../../../input/InputManager.js";import{AnalysisToolBase as f}from"../../../interactive/AnalysisToolBase.js";import{deactivateTool as p}from"../../../interactive/interactiveToolUtils.js";import{sketchKeys as m}from"../../../interactive/keybindings.js";import{acquire as h}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as g}from"../../../interactive/snapping/snappingUtils.js";const _={ready:`ready`,creating:`creating`,created:`created`};let v=class extends f{constructor(e){super(e),this._operationManager=new u,this._syncingActiveTool=!1,this.analysisViewData=null,this.removeIncompleteOnCancel=!1;let{snappingManager:t}=this._snappingManagerResult=h(e.view);this._editIntersector=new l({view:e.view}),this._editTool=new s({analysis:e.analysis,analysisViewData:e.analysisViewData,intersector:this._editIntersector,snappingManager:t,view:e.view}),this._placementController=new c({...e,snappingManager:t,shouldPreventVertexAdd:(e,t)=>this._editTool.hasManipulatorAt(e,t)})}get active(){return this._editTool.active||this._placementController.active}get canRedo(){return this._activeUndoRedoComponent?.canRedo??!1}get canUndo(){return this._activeUndoRedoComponent?.canUndo??!1}get selectedItem(){return this._editTool.selectedItem}get state(){return this._placementController.active?_.creating:this.analysis.observer?.position==null?_.ready:_.created}get cursor(){return this._placementController.active?`crosshair`:null}get updating(){return this._editTool.updating||this._placementController.updating}initialize(){g(this),this.addHandles([this._snappingManagerResult,this.view.on(`key-down`,e=>this._onKeyDown(e),d.WIDGET),n(()=>({editable:this.editable,interactive:this.analysisViewData.interactive,placementActive:this._placementController.active,valid:this.analysis.valid,visible:this.visible}),()=>this._syncActiveTool(),r),n(()=>this.state===_.created,e=>{e?this.finishToolCreation():this._set(`created`,!1)},r),n(()=>this.analysisViewData.visible,e=>{this.visible=e},r),n(()=>this.editable,e=>{this.analysisViewData.editable=e},r)])}destroy(){this._operationManager.destroy(),this._editTool.stop(),this._placementController.stop(),this._editTool.destroy(),this._placementController.destroy(),this._editIntersector.destroy()}place(e){return this.analysisViewData.interactive=!0,this._operationManager.start(`place`,async(i,a)=>{let{elevationInfo:o}=e??{},s=o&&`observer`in o?o.observer:o,c=o&&`targets`in o?o.targets:o;this._placementController.observerPlacementElevationInfo=y(s),this._placementController.targetPlacementElevationInfo=y(c);let l=this.analysis.clone(),u=!1,d=!1,f=()=>{if(d)return;if(d=!0,this.stop(),!this.analysis.valid){this.analysis.clear(),i.reject();return}if(a.aborted||this.analysis.equals(l)){i.reject();return}let e=this.analysis.targets.at(-1);e!=null&&this._editTool.selectItem(e),i.resolve({})};i.handles.push(t(()=>this.stop()),n(()=>this._placementController.active,e=>{if(e){u=!0;return}u&&f()},r)),this.continue()},e)}activate(){this.view.focus(),this.analysisViewData.interactive=!0,this._syncActiveTool(),!this.analysis.valid&&!this._placementController.active&&this.continue()}deactivate(){this.onDeactivate()}continue(){this.analysisViewData.interactive=!0,this._placementController.continue()}stop(){this._placementController.stop(),this._placementController.observerPlacementElevationInfo=null,this._placementController.targetPlacementElevationInfo=null,this._syncActiveTool()}redo(){this._activeUndoRedoComponent?.redo()}undo(){this._activeUndoRedoComponent?.undo()}get testInfo(){}get snappingOptions(){return this._snappingManager.options}set snappingOptions(e){this._snappingManager.options=e}get _snappingManager(){return this._snappingManagerResult.snappingManager}onEditableChange(){this.analysisViewData.editable=this.editable,this._editTool.setEditableFlag(1,!0),this._editTool.setEditableFlag(0,this.editable),this._syncActiveTool()}_hideEditTool(){this._editTool.stop(),this._editTool.visible=!1}_onKeyDown(e){let t=e.key;t===m.undo&&this.canUndo?(e.stopPropagation(),this.undo()):t===m.redo&&this.canRedo?(e.stopPropagation(),this.redo()):m.delete.includes(t)&&!this.active?this._editTool.deleteSelectedItem()&&e.stopPropagation():t===m.cancel&&!this.active&&this._editTool.clearSelection()&&e.stopPropagation()}get _activeUndoRedoComponent(){return this.analysisViewData.interactive?this._placementController.active?this._placementController:this._canActivateEditTool?this._editTool:null:null}get _canActivateEditTool(){return this.visible&&this.editable&&this.analysis.valid&&this.analysis.observer?.position!=null}_syncActiveTool(){if(!this._syncingActiveTool){this._syncingActiveTool=!0;try{let e=this.analysisViewData.interactive,t=this._canActivateEditTool;if(this._placementController.visible=this.visible&&e,this._editTool.manipulatorsInteractive=e&&!this._placementController.active,!e){this._placementController.stop(),this._hideEditTool(),this.analysisViewData.cursorTarget=null,p(this.view,this);return}if(!this.visible){this._editTool.stop(),this._editTool.visible=!0,p(this.view,this);return}if(this._placementController.active){this._editTool.stop(),this._editTool.visible=this.visible,p(this.view,this);return}if(!t){this._hideEditTool(),p(this.view,this);return}this._editTool.visible=!0,this.analysisViewData.cursorTarget=null,p(this.view,this)}finally{this._syncingActiveTool=!1}}}};e([i({constructOnly:!0})],v.prototype,`view`,void 0),e([i({constructOnly:!0})],v.prototype,`analysis`,void 0),e([i({constructOnly:!0})],v.prototype,`analysisViewData`,void 0),e([i()],v.prototype,`active`,null),e([i()],v.prototype,`canRedo`,null),e([i()],v.prototype,`canUndo`,null),e([i()],v.prototype,`selectedItem`,null),e([i()],v.prototype,`state`,null),e([i()],v.prototype,`cursor`,null),e([i()],v.prototype,`updating`,null),e([i()],v.prototype,`removeIncompleteOnCancel`,void 0),e([i()],v.prototype,`snappingOptions`,null),e([i()],v.prototype,`_canActivateEditTool`,null),v=e([a(`esri.views.3d.analysis.LineOfSight.LineOfSightTool`)],v);function y(e){if(e==null)return null;let{featureExpressionInfo:t,mode:n,offset:r,unit:i}=e;return new o({featureExpressionInfo:t,mode:n,offset:r,unit:i})}export{v as LineOfSightTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{PluginBase as a}from"../../../draw/plugins/PluginBase.js";var o;const s=Symbol(`viewshed-placement-point-plugin-marker`);let c=class extends a{static{o=s}constructor(e){super(e),this[o]=!0,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.outputMapPosition=null,this.screenPosition=null,this.hasCommittedPoint=!1,this._vertexId=Symbol(`viewshed-placement-point-vertex`)}start(e){super.start(e);let{positionOfLastUserInput:t,session:n}=e,r=this._getInitialMapPoint(t);r&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&(n.appendOrReplacePoint(this._vertexId,r),this.outputMapPosition=r.clone()),this._ensureInteractiveHandle(e,r)}completeStep(){this.hasCommittedPoint=!0,this._context?.requestComplete()}_ensureInteractiveHandle(e,r){if(this._interactiveHandle)return;let{defaultCaptureMode:i}=this;this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:i,inputMapPosition:i===`grabbable-object`?r:void 0},{disableDefaultXYFields:this.step===`target`}),this.addHandles(t(()=>{let e=this._interactiveHandle;return{outputMapPosition:e?.outputMapPosition,screenPosition:e?.screenPosition}},({outputMapPosition:e,screenPosition:t})=>{this.outputMapPosition=e?.clone(),this.screenPosition=t,e&&!this._isComplete&&this._session?.appendOrReplacePoint(this._vertexId,e)},n),this._ownHandlesKey)}_getInitialMapPoint(e){return this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??e:this.inputMapPosition??e}};e([r({constructOnly:!0})],c.prototype,`step`,void 0),e([r()],c.prototype,`defaultCaptureMode`,void 0),e([r()],c.prototype,`inputMapPosition`,void 0),e([r()],c.prototype,`outputMapPosition`,void 0),e([r()],c.prototype,`screenPosition`,void 0),e([r()],c.prototype,`hasCommittedPoint`,void 0),e([r()],c.prototype,`_interactiveHandle`,void 0),c=e([i(`esri.views.3d.analysis.Viewshed.ViewshedPlacementPointPlugin`)],c);function l(e){return{uniqueId:Symbol(`viewshed-${e}-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new c({step:e})}}export{c as ViewshedPlacementPointPlugin,l as createViewshedPlacementPointPluginConfiguration};
2
+ import{__decorate as e}from"tslib";import{watch as t,sync as n}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{PluginBase as a}from"../../../draw/plugins/PluginBase.js";var o;const s=Symbol(`viewshed-placement-point-plugin-marker`);let c=class extends a{static{o=s}constructor(e){super(e),this[o]=!0,this.defaultCaptureMode=`capture-always`,this.inputMapPosition=null,this.outputMapPosition=null,this.screenPosition=null,this.hasCommittedPoint=!1,this._vertexId=Symbol(`viewshed-placement-point-vertex`)}start(e){super.start(e);let{positionOfLastUserInput:t,session:n}=e,r=this._getInitialMapPoint(t);r&&(this.defaultCaptureMode===`grabbable-object`||!this._interactiveHandle)&&(n.appendOrReplacePoint(this._vertexId,r),this.outputMapPosition=r.clone()),this._ensureInteractiveHandle(e,r)}completeStep(){this.hasCommittedPoint=!0,this._context?.requestComplete()}_ensureInteractiveHandle(e,r){if(this._interactiveHandle)return;let{defaultCaptureMode:i}=this;this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:i,inputMapPosition:i===`grabbable-object`?r:void 0},{disableDefaultXYFields:this.step===`target`,elevationFieldProperties:{unlockOnVertexPlacement:!0}}),this.addHandles(t(()=>{let e=this._interactiveHandle;return{outputMapPosition:e?.outputMapPosition,screenPosition:e?.screenPosition}},({outputMapPosition:e,screenPosition:t})=>{this.outputMapPosition=e?.clone(),this.screenPosition=t,e&&!this._isComplete&&this._session?.appendOrReplacePoint(this._vertexId,e)},n),this._ownHandlesKey)}_getInitialMapPoint(e){return this.defaultCaptureMode===`grabbable-object`?this.inputMapPosition??this._interactiveHandle?.outputMapPosition??e:this.inputMapPosition??e}};e([r({constructOnly:!0})],c.prototype,`step`,void 0),e([r()],c.prototype,`defaultCaptureMode`,void 0),e([r()],c.prototype,`inputMapPosition`,void 0),e([r()],c.prototype,`outputMapPosition`,void 0),e([r()],c.prototype,`screenPosition`,void 0),e([r()],c.prototype,`hasCommittedPoint`,void 0),e([r()],c.prototype,`_interactiveHandle`,void 0),c=e([i(`esri.views.3d.analysis.Viewshed.ViewshedPlacementPointPlugin`)],c);function l(e){return{uniqueId:Symbol(`viewshed-${e}-plugin`),kind:[`vertex`],geometryType:`point`,hidden:!0,localizationKey:`leaf-point-segment`,icon:`point`,create:()=>new c({step:e})}}export{c as ViewshedPlacementPointPlugin,l as createViewshedPlacementPointPluginConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as r,Cyclical as i}from"../../../../core/Cyclical.js";import{handlesGroup as a}from"../../../../core/handleUtils.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as c,syncAndInitial as l,initial as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{sub as p,len as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as _}from"../../../../core/support/UpdatingHandles.js";import{getFeatureReference as v}from"./placementUtils.js";import{viewshedToolManipulatorConfiguration as y}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as b,isSideHorizontal as x,flipSide as S}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedObserverManipulatedObject3D as C}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedScaleOrientManipulation as w}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as T}from"./viewshedToolManipulatorUtils.js";import{screenToMapAtSceneSurface as E}from"../../interactive/editingTools/dragEventPipeline3D.js";import{discRadiusSmall as D}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as O}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{createManipulatorDragEventPipeline as k,resetManipulatedObject as A,sceneSnappingAtLocation as j,dragManipulatedObject as M,sceneSnappingAtProjectedLocation as N,resetProperties as P}from"../../../interactive/dragEventPipeline.js";const F=Symbol(`dragHandles`);let I=class extends t{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._observerManipulatedObject=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._updatingHandles=new _,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new b({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new w({view:this.view,tool:this.parentTool}),this._observerManipulator=new T(this.view,this.parentTool),this._observerManipulatedObject=new C({view:this.view,subTool:this}),this.addHandles([c(()=>this.elevationAlignedObserverRenderSpace,e=>{e!=null&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},l),this._updatingHandles.add(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=o(90-e))},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace,operations:this._observerManipulatedObject.operations}},({viewshedComputedData:e,observer:t,operations:r},i)=>{this._grabbing&&t!==i?.observer||(this.removeHandles(F),e?.valid&&r!=null&&this.addHandles([this._buildObserverManipulatorDragPipeline(e),this._buildMoveManipulationDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(n),F))},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e,analysisViewData:t}=this,n=t.visible&&(e?.valid??!1),r=t.selectedViewshed===e?.viewshed,i=n&&r,a=e?.effectiveElevationInfo.mode;return{controlsAvailable:i,selected:r,visibleAndValid:n,zManipulationAvailable:i&&a!==`on-the-ground`}},({controlsAvailable:e,selected:t,visibleAndValid:n,zManipulationAvailable:r})=>{this._moveManipulation.available=e,this._moveManipulation.zManipulation.available=r,this._scaleOrientManipulation.available=e,this._observerManipulator.available=n,this._observerManipulator.collisionPriority=t?2:0,this._fieldOfViewManipulation.available=e},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;if(!e?.valid)return null;let{observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}=e;return{viewshedCompData:e,observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}},e=>{e!=null&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},u)]),this._forEachManipulator(e=>{this.addHandles([e.events.on(`grab-changed`,t=>{this._grabbing=t.action===`start`,t.action===`end`&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e.setInteractive(!this._grabbing)}),this.setInteractive(t=>t===e||!this._grabbing)}),e.events.on(`drag`,e=>{e.action===`start`&&this.parentTool.updateInteractionVisualsVisibility()})])})}destroy(){this._observerManipulatedObject=s(this._observerManipulatedObject),this._moveManipulation=s(this._moveManipulation),this._fieldOfViewManipulation=s(this._fieldOfViewManipulation),this._scaleOrientManipulation=s(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=s(this._observerManipulator),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){let t=this.viewshed;t!=null&&(t.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get observerManipulator(){return this._observerManipulator}get observerManipulatedObject(){return this._observerManipulatedObject}get moveInteractionState(){let{dragging:e,grabbing:t}=this._moveManipulation;return{dragging:e||this._observerManipulator.dragging,grabbing:t||this._observerManipulator.grabbing}}get scaleOrientInteractionState(){let{dragging:e,grabbing:t}=this._scaleOrientManipulation;return{dragging:e,grabbing:t}}setInteractive(e){let t=typeof e==`boolean`;this._observerManipulator.interactive=t?e:e(this._observerManipulator),this._forEachManipulation(n=>{n.interactive=t?e:n.someManipulator(e)})}hideInactiveManipulators(e){let t=[];return this._forEachManipulation(n=>{n.hasManipulator(e)?n!==this._moveManipulation&&t.push(a(n.mapManipulators(t=>t===e||n===this._fieldOfViewManipulation&&t.grabbing?null:t.disableDisplay?.()))):t.push(n.hideManipulators())}),this._observerManipulator!==e&&t.push(this._observerManipulator.disableDisplay()),a(t)}onManipulatorSelectionChanged(){this._someManipulatorSelected()||this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null)}hasManipulator(e){let t=!1;return this._forEachManipulator(n=>{t||=n===e}),t}_someManipulatorSelected(){return this._moveManipulation.selected||this._observerManipulator.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_createMoveManipulation(){return new O({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:D})}_buildObserverManipulatorDragPipeline(e){let{effectiveElevationInfo:t,viewshed:n}=e,r=this._observerManipulatedObject,i=r.operations;if(i==null)return null;let a=i.data.spatialReference;return k(this._observerManipulator,(e,o,s,c)=>{let{parentTool:l,view:u}=this,{intersector:d,snappingManager:f}=l,{geometry:p}=i.data;if(p.type!==`point`)return;let m=n.feature,h=A(r);s=s.next(e=>(n.feature=m,h(e)));let g=l.createObserverMoveSnappingPipeline(0,c,t,!0),_=o.next(E(u,p,t,a)).next(j(u,t));if(g!=null){let{snappingStep:e,cancelSnapping:t}=g;s.next(t),_=_.next(...e)}_.next(e=>(n.feature=v({intersector:d,snappingManager:f,screenPoint:e.screenEnd,view:u}),e)).next(M(r))})}_buildMoveManipulationDragPipeline(e){let{effectiveElevationInfo:t}=e,n=this._observerManipulatedObject,r=n.operations;return r==null?null:this._moveManipulation.createDragPipeline((e,r,i,a,o)=>{a=a.next(A(n));let s=this.parentTool.createObserverMoveSnappingPipeline(e,o,t);if(s!=null){let{snappingStep:e,cancelSnapping:r}=s;return a=a.next(r),i=i.next(N(this.view,t)).next(...e).next(M(n)),{steps:i,cancel:a}}return i=i.next(M(n)),{steps:i,cancel:a}},t,r.data.spatialReference,void 0)}_buildFOVDragPipeline(e){let t=0,n=0;return this._fieldOfViewManipulation.createDragPipeline((i,a,o)=>{if(e==null)return{steps:a,cancel:o};let s=e.viewshed,c=null;return o=o.next(P(s,[`horizontalFieldOfView`,`verticalFieldOfView`])),{steps:a.next(i=>{i.action===`start`&&(c=null,t=e.horizontalFieldOfView,n=e.verticalFieldOfView);let a=i.deltaAngle;if(c==null&&a!==0){let e=i.side===`bottom`||i.side===`left`?a>0:a<0;c=x(i.side)?t===0&&e||t===360&&!e:n===0&&e}let o=c?S(i.side):i.side,l=0;switch(o){case`left`:l=t/2-a;break;case`right`:l=t/2+a;break;case`top`:l=n+a*2;break;case`bottom`:l=n-a*2}return x(o)?(l=r.normalize(l),l=l>270?0:l>180?180:l,s.horizontalFieldOfView=l*2):s.verticalFieldOfView=l,i}),cancel:o}},e)}_buildScaleOrientDragPipeline(e){let t=0,n=0,i=(t,n)=>(r,i,a)=>{if(e==null)return{steps:i,cancel:a};let o=e.viewshed;return a=a.next(P(o,[t])),i=i.next(n(o,e)),{steps:i,cancel:a}};return a([this._scaleOrientManipulation.createHeadingDragPipeline(i(`heading`,(t,i)=>i=>(i.action===`start`&&(n=e.heading),t.heading=r.normalize(n+i.deltaAngle),i)),e),this._scaleOrientManipulation.createTiltDragPipeline(i(`tilt`,(n,r)=>r=>{r.action===`start`&&(t=e.tilt);let i=t+r.deltaAngle;return i<-90?i=180:i>270&&(i=0),n.tilt=R.clamp(i),r}),e),this._scaleOrientManipulation.createDistanceDragPipeline(i(`farDistance`,(e,t)=>n=>{let r=p(L,n.renderEnd,t.elevationAlignedObserverRenderSpace),i=m(r)*t.metersPerUnit;return e.farDistance=h(r,t.targetDirection)<0?y.scaleOrientMinDistance:i,n}),e)])}_forEachManipulator(e){this._forEachManipulation(t=>{t.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{observerManipulator:this._observerManipulator,moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData}}};e([d({constructOnly:!0})],I.prototype,`analysis`,void 0),e([d({constructOnly:!0})],I.prototype,`analysisViewData`,void 0),e([d({constructOnly:!0})],I.prototype,`parentTool`,void 0),e([d({constructOnly:!0,nonNullable:!0})],I.prototype,`view`,void 0),e([d()],I.prototype,`updating`,null),e([d()],I.prototype,`viewshed`,null),e([d()],I.prototype,`_grabbing`,void 0),e([d()],I.prototype,`grabbing`,null),e([d()],I.prototype,`viewshedComputedData`,void 0),e([d()],I.prototype,`observer`,null),e([d()],I.prototype,`elevationAlignedObserverRenderSpace`,null),I=e([f(`esri.views.3d.analysis.Viewshed.ViewshedSubTool`)],I);const L=g(),R=new i(0,180);export{I as ViewshedSubTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as r,Cyclical as i}from"../../../../core/Cyclical.js";import{handlesGroup as a}from"../../../../core/handleUtils.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as c,syncAndInitial as l,initial as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{sub as p,len as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as _}from"../../../../core/support/UpdatingHandles.js";import{getFeatureReference as v}from"./placementUtils.js";import{viewshedToolManipulatorConfiguration as y}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as b,isSideHorizontal as x,flipSide as S}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedObserverManipulatedObject3D as C}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedScaleOrientManipulation as w}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as T}from"./viewshedToolManipulatorUtils.js";import{screenToMapAtSceneSurface as E}from"../../interactive/editingTools/dragEventPipeline3D.js";import{discRadiusSmall as D}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as O}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{createManipulatorDragEventPipeline as k,resetManipulatedObject as A,sceneSnappingAtLocation as j,dragManipulatedObject as M,sceneSnappingAtProjectedLocation as N,resetProperties as P}from"../../../interactive/dragEventPipeline.js";const F=Symbol(`dragHandles`);let I=class extends t{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._observerManipulatedObject=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._updatingHandles=new _,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new b({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new w({view:this.view,tool:this.parentTool}),this._observerManipulator=new T(this.view,this.parentTool),this._observerManipulatedObject=new C({view:this.view,subTool:this}),this.addHandles([c(()=>this.elevationAlignedObserverRenderSpace,e=>{e!=null&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},l),this._updatingHandles.add(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=o(90-e))},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace,operations:this._observerManipulatedObject.operations}},({viewshedComputedData:e,observer:t,operations:r},i)=>{this._grabbing&&t!==i?.observer||(this.removeHandles(F),e?.valid&&r!=null&&this.addHandles([this._buildObserverManipulatorDragPipeline(e),this._buildMoveManipulationDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(n),F))},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e,analysisViewData:t}=this,n=t.visible&&(e?.valid??!1),r=t.selectedViewshed===e?.viewshed,i=n&&r,a=e?.effectiveElevationInfo.mode;return{controlsAvailable:i,selected:r,visibleAndValid:n,zManipulationAvailable:i&&a!==`on-the-ground`}},({controlsAvailable:e,selected:t,visibleAndValid:n,zManipulationAvailable:r})=>{this._moveManipulation.available=e,this._moveManipulation.zManipulation.available=r,this._scaleOrientManipulation.available=e,this._observerManipulator.available=n,this._observerManipulator.collisionPriority=t?2:0,this._fieldOfViewManipulation.available=e},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;if(!e?.valid)return null;let{observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}=e;return{viewshedCompData:e,observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}},e=>{e!=null&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},u)]),this._forEachManipulator(e=>{this.addHandles([e.events.on(`grab-changed`,t=>{this._grabbing=t.action===`start`,t.action===`end`&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e.setInteractive(!this._grabbing)}),this.setInteractive(t=>t===e||!this._grabbing)}),e.events.on(`drag`,e=>{e.action===`start`&&this.parentTool.updateInteractionVisualsVisibility()})])})}destroy(){this._observerManipulatedObject=s(this._observerManipulatedObject),this._moveManipulation=s(this._moveManipulation),this._fieldOfViewManipulation=s(this._fieldOfViewManipulation),this._scaleOrientManipulation=s(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=s(this._observerManipulator),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){let t=this.viewshed;t!=null&&(t.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get observerManipulator(){return this._observerManipulator}get observerManipulatedObject(){return this._observerManipulatedObject}get moveInteractionState(){let{dragging:e,grabbing:t}=this._moveManipulation;return{dragging:e||this._observerManipulator.dragging,grabbing:t||this._observerManipulator.grabbing}}get scaleOrientInteractionState(){let{dragging:e,grabbing:t}=this._scaleOrientManipulation;return{dragging:e,grabbing:t}}setInteractive(e){let t=typeof e==`boolean`;this._observerManipulator.interactive=t?e:e(this._observerManipulator),this._forEachManipulation(n=>{n.interactive=t?e:n.someManipulator(e)})}hideInactiveManipulators(e){let t=[];return this._forEachManipulation(n=>{n.hasManipulator(e)?n!==this._moveManipulation&&t.push(a(n.mapManipulators(t=>t===e||n===this._fieldOfViewManipulation&&t.grabbing?null:t.disableDisplay?.()))):t.push(n.hideManipulators())}),this._observerManipulator!==e&&t.push(this._observerManipulator.disableDisplay()),a(t)}onManipulatorSelectionChanged(){this._someManipulatorSelected()||this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null)}hasManipulator(e){let t=!1;return this._forEachManipulator(n=>{t||=n===e}),t}_someManipulatorSelected(){return this._moveManipulation.selected||this._observerManipulator.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_createMoveManipulation(){return new O({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:D})}_buildObserverManipulatorDragPipeline(e){let{effectiveElevationInfo:t,viewshed:n}=e,r=this._observerManipulatedObject,i=r.operations;if(i==null)return null;let a=i.data.spatialReference;return k(this._observerManipulator,(e,o,s,c)=>{let{parentTool:l,view:u}=this,{intersector:d,snappingManager:f}=l,{geometry:p}=i.data;if(p.type!==`point`)return;let m=n.feature,h=A(r);s=s.next(e=>(n.feature=m,h(e)));let g=l.createObserverMoveSnappingPipeline(0,c,t,!0),_=o.next(E(u,p,t,a)).next(j(u,t));if(g!=null){let{snappingStep:e,cancelSnapping:t}=g;s.next(t),_=_.next(...e)}_.next(e=>(n.feature=v({intersector:d,snappingManager:f,screenPoint:e.screenEnd,view:u}),e)).next(M(r))})}_buildMoveManipulationDragPipeline(e){let{effectiveElevationInfo:t}=e,n=this._observerManipulatedObject,r=n.operations;return r==null?null:this._moveManipulation.createDragPipeline((e,r,i,a,o)=>{a=a.next(A(n));let s=this.parentTool.createObserverMoveSnappingPipeline(e,o,t);if(s!=null){let{snappingStep:e,cancelSnapping:n}=s;a=a.next(n),i=i.next(N(this.view,t)).next(...e)}return i=i.next(M(n)),{steps:i,cancel:a}},t,r.data.spatialReference,void 0)}_buildFOVDragPipeline(e){let t=0,n=0;return this._fieldOfViewManipulation.createDragPipeline((i,a,o)=>{let s=e.viewshed,c=null;return o=o.next(P(s,[`horizontalFieldOfView`,`verticalFieldOfView`])),{steps:a.next(i=>{i.action===`start`&&(c=null,t=e.horizontalFieldOfView,n=e.verticalFieldOfView);let a=i.deltaAngle;if(c==null&&a!==0){let e=i.side===`bottom`||i.side===`left`?a>0:a<0;c=x(i.side)?t===0&&e||t===360&&!e:n===0&&e}let o=c?S(i.side):i.side,l=0;switch(o){case`left`:l=t/2-a;break;case`right`:l=t/2+a;break;case`top`:l=n+a*2;break;case`bottom`:l=n-a*2}return x(o)?(l=r.normalize(l),l=l>270?0:l>180?180:l,s.horizontalFieldOfView=l*2):s.verticalFieldOfView=l,i}),cancel:o}},e)}_buildScaleOrientDragPipeline(e){let t=0,n=0,i=(t,n)=>(r,i,a)=>{let o=e.viewshed;return a=a.next(P(o,[t])),i=i.next(n(o,e)),{steps:i,cancel:a}};return a([this._scaleOrientManipulation.createHeadingDragPipeline(i(`heading`,(t,i)=>i=>(i.action===`start`&&(n=e.heading),t.heading=r.normalize(n+i.deltaAngle),i)),e),this._scaleOrientManipulation.createTiltDragPipeline(i(`tilt`,(n,r)=>r=>{r.action===`start`&&(t=e.tilt);let i=t+r.deltaAngle;return i<-90?i=180:i>270&&(i=0),n.tilt=R.clamp(i),r}),e),this._scaleOrientManipulation.createDistanceDragPipeline(i(`farDistance`,(e,t)=>n=>{let r=p(L,n.renderEnd,t.elevationAlignedObserverRenderSpace),i=m(r)*t.metersPerUnit;return e.farDistance=h(r,t.targetDirection)<0?y.scaleOrientMinDistance:i,n}),e)])}_forEachManipulator(e){this._forEachManipulation(t=>{t.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{observerManipulator:this._observerManipulator,moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData}}};e([d({constructOnly:!0})],I.prototype,`analysis`,void 0),e([d({constructOnly:!0})],I.prototype,`analysisViewData`,void 0),e([d({constructOnly:!0})],I.prototype,`parentTool`,void 0),e([d({constructOnly:!0,nonNullable:!0})],I.prototype,`view`,void 0),e([d()],I.prototype,`updating`,null),e([d()],I.prototype,`viewshed`,null),e([d()],I.prototype,`_grabbing`,void 0),e([d()],I.prototype,`grabbing`,null),e([d()],I.prototype,`viewshedComputedData`,void 0),e([d()],I.prototype,`observer`,null),e([d()],I.prototype,`elevationAlignedObserverRenderSpace`,null),I=e([f(`esri.views.3d.analysis.Viewshed.ViewshedSubTool`)],I);const L=g(),R=new i(0,180);export{I as ViewshedSubTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{detachToolFromView as c}from"./toolLifecycleUtils.js";import{ViewshedEditTool as l}from"./ViewshedEditTool.js";import{ViewshedPlacementController as u}from"./ViewshedPlacementController.js";import{newToolIntersector as d}from"../../../interactive/ToolIntersector.js";import{acquire as f}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as p}from"../../../interactive/snapping/snappingUtils.js";let m=class extends t{constructor(e){super(e),this._editTool=null,this._updatingHandles=new s}initialize(){let{view:e}=this,t=d(e.state.viewingMode);this._snappingManagerResult=f(e),this.addHandles(this._snappingManagerResult),this._placementController=new u({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e,callbacks:{cancelTool:()=>{e.activeTool!=null&&(e.activeTool=null)},findViewshedComputedData:e=>this._findViewshedComputedData(e),isToolDestroyed:()=>this.destroyed,setSelectedViewshed:e=>{this.analysisViewData.selectedViewshed=e}}}),p(this),this.addHandles([r(()=>({creationState:this._placementController.creationState,interactive:this.analysisViewData.interactive}),({creationState:n,interactive:r})=>{if(!r){this._placementController.cancelPlaceOperation(),this._destroyEditTool();return}if(n!=null){this._destroyEditTool();return}this._editTool||(this._editTool=new l({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e}),e.tools.add(this._editTool))},i),this._updatingHandles.add(()=>e.activeTool,e=>{e!=null&&e!==this._editTool&&this._placementController.creationState==null&&(this.analysisViewData.selectedViewshed=null)})])}destroy(){this._destroyEditTool(),n(this._placementController),this._updatingHandles.destroy()}get selectedViewshedComputedData(){return this._editTool?.selectedViewshedComputedData}get stagedViewshed(){return this._placementController.stagedViewshed}get active(){return this._placementController.active||(this._editTool?.active??!1)}get updating(){return this._updatingHandles.updating||this._placementController.updating||!!this._editTool?.updating}get creating(){return this._placementController.creationState!=null}get snappingOptions(){return this._snappingManager.options}set snappingOptions(e){this._snappingManager.options=e}get _snappingManager(){return this._snappingManagerResult.snappingManager}async place(e,t){if(this.analysisViewData.interactive=!0,this._destroyEditTool(),await this._placementController.startPlaceOperation(e,t),e===`single`)return{}}_findViewshedComputedData(e){return this.analysisViewData.viewshedComputedDataHandles?.find(t=>t.viewshedComputedData.viewshed===e)?.viewshedComputedData}_destroyEditTool(){let e=this._editTool;this._editTool=null,e!=null&&(c(this.view,e),n(e))}get test(){}};e([a({constructOnly:!0})],m.prototype,`view`,void 0),e([a({constructOnly:!0})],m.prototype,`analysis`,void 0),e([a({constructOnly:!0})],m.prototype,`analysisViewData`,void 0),e([a()],m.prototype,`_placementController`,void 0),e([a()],m.prototype,`_editTool`,void 0),e([a()],m.prototype,`_snappingManagerResult`,void 0),e([a()],m.prototype,`selectedViewshedComputedData`,null),e([a()],m.prototype,`stagedViewshed`,null),e([a()],m.prototype,`active`,null),e([a()],m.prototype,`updating`,null),e([a()],m.prototype,`creating`,null),e([a()],m.prototype,`snappingOptions`,null),m=e([o(`esri.views.3d.analysis.Viewshed.ViewshedTool`)],m);const h=m;export{h as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{detachToolFromView as c}from"./toolLifecycleUtils.js";import{ViewshedEditTool as l}from"./ViewshedEditTool.js";import{ViewshedPlacementController as u}from"./ViewshedPlacementController.js";import{newToolIntersector as d}from"../../../interactive/ToolIntersector.js";import{acquire as f}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as p}from"../../../interactive/snapping/snappingUtils.js";let m=class extends t{constructor(e){super(e),this._editTool=null,this._updatingHandles=new s}initialize(){let{view:e}=this,t=d(e.state.viewingMode);this._snappingManagerResult=f(e),this.addHandles(this._snappingManagerResult),this._placementController=new u({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e,callbacks:{cancelTool:()=>{e.activeTool!=null&&(e.activeTool=null)},findViewshedComputedData:e=>this._findViewshedComputedData(e),setSelectedViewshed:e=>{this.analysisViewData.selectedViewshed=e}}}),p(this),this.addHandles([r(()=>({creationState:this._placementController.creationState,interactive:this.analysisViewData.interactive}),({creationState:n,interactive:r})=>{if(!r){this._placementController.cancelPlaceOperation(),this._destroyEditTool();return}if(n!=null){this._destroyEditTool();return}this._editTool||(this._editTool=new l({analysis:this.analysis,analysisViewData:this.analysisViewData,intersector:t,snappingManager:this._snappingManager,view:e}),e.tools.add(this._editTool))},i),this._updatingHandles.add(()=>e.activeTool,e=>{e!=null&&e!==this._editTool&&this._placementController.creationState==null&&(this.analysisViewData.selectedViewshed=null)})])}destroy(){this._destroyEditTool(),n(this._placementController),this._updatingHandles.destroy()}get selectedViewshedComputedData(){return this._editTool?.selectedViewshedComputedData}get stagedViewshed(){return this._placementController.stagedViewshed}get active(){return this._placementController.active||(this._editTool?.active??!1)}get updating(){return this._updatingHandles.updating||this._placementController.updating||!!this._editTool?.updating}get creating(){return this._placementController.creationState!=null}get snappingOptions(){return this._snappingManager.options}set snappingOptions(e){this._snappingManager.options=e}get _snappingManager(){return this._snappingManagerResult.snappingManager}async place(e,t){if(this.analysisViewData.interactive=!0,this._destroyEditTool(),await this._placementController.startPlaceOperation(e,t),e===`single`)return{}}_findViewshedComputedData(e){return this.analysisViewData.viewshedComputedDataHandles?.find(t=>t.viewshedComputedData.viewshed===e)?.viewshedComputedData}_destroyEditTool(){let e=this._editTool;this._editTool=null,e!=null&&(c(this.view,e),n(e))}get test(){}};e([a({constructOnly:!0})],m.prototype,`view`,void 0),e([a({constructOnly:!0})],m.prototype,`analysis`,void 0),e([a({constructOnly:!0})],m.prototype,`analysisViewData`,void 0),e([a()],m.prototype,`_placementController`,void 0),e([a()],m.prototype,`_editTool`,void 0),e([a()],m.prototype,`_snappingManagerResult`,void 0),e([a()],m.prototype,`selectedViewshedComputedData`,null),e([a()],m.prototype,`stagedViewshed`,null),e([a()],m.prototype,`active`,null),e([a()],m.prototype,`updating`,null),e([a()],m.prototype,`creating`,null),e([a()],m.prototype,`snappingOptions`,null),m=e([o(`esri.views.3d.analysis.Viewshed.ViewshedTool`)],m);const h=m;export{h as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as o}from"../../../../core/support/UpdatingHandles.js";import{getGraphicEffectiveElevationInfo as s}from"../../../../support/elevationInfoUtils.js";import{getGraphicAttachmentOrigin as c}from"../manipulatorUtils.js";import{createGraphicGeometryUndoRecord as l}from"./undoRecords.js";import{GraphicState as u}from"../../layers/graphics/GraphicState.js";import{GraphicManipulator as d}from"../../../interactive/GraphicManipulator.js";import{EditGeometryOperations as f}from"../../../interactive/editGeometry/EditGeometryOperations.js";const p=Symbol();let m=class extends t{get operations(){return this._operations}get updating(){return this._updatingHandles.updating}get elevationInfo(){return s(this.graphic)}get visible(){return this._graphicState.displaying}get isDraped(){return this._graphicState.isDraped}get origin(){return c(this.view,this.graphic)}constructor(e){super(e),this._updatingHandles=new o}destroy(){this._operations=n(this._operations),this._updatingHandles.destroy()}initialize(){this._graphicState=new u({graphic:this.graphic}),this._graphicState.on(`changed`,()=>this.emit(`committed`)),this.addHandles(this.view.trackGraphicState(this._graphicState)),this.addHandles(this._updatingHandles.add(()=>this.graphic.geometry,e=>{if(e!==this._operations?.data.geometry){if(!e||e?.type===`multipoint`||e?.type===`extent`){n(this._operations),this.removeHandles(p),this._operations=null;return}if(this._operations?.trySetGeometry(e))this.emit(`modified-externally`);else{n(this._operations),this.removeHandles(p);let t=f.fromGeometry(e,this.view.state.viewingMode);this._operations=t,this.addHandles(t.data.on(`change`,()=>this.graphic.geometry=t.data.geometry),p)}}},r))}createManipulator(e){return new d({view:this.view,graphic:this.graphic,...e})}maskOccludee(){return this.view.maskOccludee(this.graphic)}endInteraction(){this.graphic.geometry?.type===`mesh`&&this.graphic.notifyMeshTransformChanged()}toMap(e){return this.view.toMap(e,{include:[this.graphic]})}createUndoRecord(){let{graphic:{geometry:e}}=this;return l(e)}};e([i({constructOnly:!0})],m.prototype,`view`,void 0),e([i({constructOnly:!0})],m.prototype,`graphic`,void 0),e([i()],m.prototype,`_operations`,void 0),e([i()],m.prototype,`operations`,null),e([i()],m.prototype,`updating`,null),m=e([a(`esri.views.3d.interactive.editingTools.ManipulatedObject3DGraphic`)],m);export{m as ManipulatedObject3DGraphic};
2
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../core/Evented.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as o}from"../../../../core/support/UpdatingHandles.js";import{ringNeedsClosure as s,closeRings as c}from"../../../../geometry/support/coordsUtils.js";import{getGraphicEffectiveElevationInfo as l}from"../../../../support/elevationInfoUtils.js";import{getGraphicAttachmentOrigin as u}from"../manipulatorUtils.js";import{createGraphicGeometryUndoRecord as d}from"./undoRecords.js";import{GraphicState as f}from"../../layers/graphics/GraphicState.js";import{GraphicManipulator as p}from"../../../interactive/GraphicManipulator.js";import{EditGeometryOperations as m}from"../../../interactive/editGeometry/EditGeometryOperations.js";const h=Symbol();let g=class extends t{get operations(){return this._operations}get updating(){return this._updatingHandles.updating}get elevationInfo(){return l(this.graphic)}get visible(){return this._graphicState.displaying}get isDraped(){return this._graphicState.isDraped}get origin(){return u(this.view,this.graphic)}constructor(e){super(e),this._updatingHandles=new o}destroy(){this._operations=n(this._operations),this._updatingHandles.destroy()}initialize(){this._graphicState=new f({graphic:this.graphic}),this._graphicState.on(`changed`,()=>this.emit(`committed`)),this.addHandles(this.view.trackGraphicState(this._graphicState)),this.addHandles(this._updatingHandles.add(()=>this.graphic.geometry,e=>{let t=this._operations?.data.geometry;if(e!==t){if(!e||e?.type===`multipoint`||e?.type===`extent`){n(this._operations),this.removeHandles(h),this._operations=null;return}if(e.type===`polygon`&&e.rings.some(s)&&(e=e.clone(),c(e)),this._operations?.trySetGeometry(e))this.emit(`modified-externally`);else{n(this._operations),this.removeHandles(h);let t=m.fromGeometry(e,this.view.state.viewingMode);this._operations=t,this.addHandles(t.data.on(`change`,()=>this.graphic.geometry=t.data.geometry),h)}}},r))}createManipulator(e){return new p({view:this.view,graphic:this.graphic,...e})}maskOccludee(){return this.view.maskOccludee(this.graphic)}endInteraction(){this.graphic.geometry?.type===`mesh`&&this.graphic.notifyMeshTransformChanged()}toMap(e){return this.view.toMap(e,{include:[this.graphic]})}createUndoRecord(){let{graphic:{geometry:e}}=this;return d(e)}};e([i({constructOnly:!0})],g.prototype,`view`,void 0),e([i({constructOnly:!0})],g.prototype,`graphic`,void 0),e([i()],g.prototype,`_operations`,void 0),e([i()],g.prototype,`operations`,null),e([i()],g.prototype,`updating`,null),g=e([a(`esri.views.3d.interactive.editingTools.ManipulatedObject3DGraphic`)],g);export{g as ManipulatedObject3DGraphic};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import n from"../../../core/Logger.js";import{MemCacheStorage as r,MemCache as i}from"../../../core/MemCache.js";import{addFrameTask as a}from"../../../core/scheduling.js";import{Milliseconds as o}from"../../../core/time.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import{getLyr3DWasm as l}from"../layers/Lyr3DWasm.js";import{isMemoryManagedView as u}from"./MemoryManagedView.js";import{makeBudget as d}from"../../support/Scheduler.js";function f(e){return new h({view:e})}const p=.1,m=1.3;let h=class extends t{constructor(e){super(e),this._quality=1,this._usedMemory=0,this._updating=!1,this._stableQuality=0,this._downscaleMemoryUsed=0,this._canFastRecover=!1,this._predictedMemory=0,this._cacheStorage=new r,this._warnMemoryUsage=null,this._numQualityChanges=0,this._maxMemory=750,this._additionalCacheMemory=0,this.addHandles(a({prepare:()=>this._updateMemory()}))}destroy(){this._cacheStorage.destroy()}get maxMemory(){return this._maxMemory}set maxMemory(e){e==null||e<=0||(this._stableQuality=0,this._canFastRecover=!1,this._maxMemory<e&&this._updateQuality(1),this._maxMemory=e)}get additionalCacheMemory(){return this._additionalCacheMemory}set additionalCacheMemory(e){e!=null&&(this._additionalCacheMemory=e)}get memoryFactor(){return this._quality}get updating(){return this._updating}get usedMemory(){return this._usedMemory}get usedCacheMemory(){return this._cacheStorage.size}newCache(e,t,n){return new i(e,this._cacheStorage,t,n)}resetStableQuality(){this._stableQuality=0}disableMemCache(){this.additionalCacheMemory=-4096}update(){if(this._predictedMemory<=0&&!this._updating)return;let e=this._layersUpdating();if(this._predictedMemory<.6&&this._canFastRecover)this._downscaleMemoryUsed=0,this._stableQuality=0,this._canFastRecover=!1,this._updateQuality(1);else if(e){if(this._predictedMemory>1.1||this._usedMemory>1){if(this._stableQuality>0)this._downscaleMemoryUsed=0,this._updateQuality(this._stableQuality);else if(this._quality>p&&this._downscaleMemoryUsed<this._usedMemory){if(this._compactAndUpdate())return;this._updateQuality(this._quality/m),this._downscaleMemoryUsed=this._usedMemory,this._canFastRecover=!1}}}else if(this._downscaleMemoryUsed=0,this._usedMemory>1){if(this._compactAndUpdate())return;this._stableQuality=0,this._canFastRecover=!1,e=this._updateQuality(this._quality/m),this._downscaleMemoryUsed=this._predictedMemory}else this._stableQuality!==this._quality&&(this._usedMemory<.75&&this._quality<1?(this._stableQuality=this._quality,e=this._updateQuality(this._quality+.05)):this._quality<1&&(this._canFastRecover=!0));this._updating=e}_compactAndUpdate(){let e=d(o(100)),t=this.view.stage.compact(e);return this.view.overlayManager.renderer.compact(e)||t}_updateQuality(e){return e=Math.min(Math.max(e,p),1),e!==this._quality&&(this._quality=e,++this._numQualityChanges,!0)}_layersUpdating(){return this.view.allLayerViews.some(e=>!!e.updating)}_updateMemory(){if(!this.view?.updating||this.view.destroyed||this.view.destroying)return;this.view.stage?.renderer?.tick();let e=this.view.stage?.renderer?.usedMemory,t=(this.view.basemapTerrain?.usedMemory??0)+(e?e.fbos+e.edges+e.plugins+e.clouds:0)+this.view.deconflictor?.usedMemory+this.view.labeler?.usedMemory+(l(this.view)?.lyr3DInternalMemoryBytes??0),r=0;this.view.allLayerViews&&this.view.allLayerViews.forEach(e=>{if(u(e)){let n=e.ignoresMemoryFactor?this._quality:1;t+=e.usedMemory*n,r+=e.unloadedMemory*n}});let i=this._warnMemoryUsage==null||Math.round(t*10)!==Math.round(this._warnMemoryUsage*10),a=this.maxMemory*1048576;if(t>a&&i){this._warnMemoryUsage=t;let e=e=>(e/1048576).toLocaleString(void 0,{maximumFractionDigits:1})+` MB`,i=Math.round(this._quality*100);n.getLogger(this).warn(`Memory Limit exceeded! Limit: ${e(a)} Current: ${e(t)} Projected: ${e(t+r)} Quality: ${i}%`)}this._usedMemory=t/a,this._predictedMemory=(t+r)/a;let o=a-t;this._cacheStorage.maxSize=Math.max(0,o+this.additionalCacheMemory*1048576)}get test(){}};e([s({constructOnly:!0})],h.prototype,`view`,void 0),e([s()],h.prototype,`maxMemory`,null),e([s()],h.prototype,`_quality`,void 0),e([s()],h.prototype,`_usedMemory`,void 0),e([s()],h.prototype,`_updating`,void 0),e([s()],h.prototype,`_stableQuality`,void 0),e([s()],h.prototype,`_maxMemory`,void 0),e([s()],h.prototype,`_additionalCacheMemory`,void 0),h=e([c(`esri.views.3d.support.MemoryController`)],h);export{p as minQuality,f as newMemoryController};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import n from"../../../core/Logger.js";import{MemCacheStorage as r,MemCache as i}from"../../../core/MemCache.js";import{addFrameTask as a}from"../../../core/scheduling.js";import{Milliseconds as o}from"../../../core/time.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import{getLyr3DWasm as l}from"../layers/Lyr3DWasm.js";import{isMemoryManagedView as u}from"./MemoryManagedView.js";import{makeBudget as d}from"../../support/Scheduler.js";function f(e){return new _({view:e})}const p=.1,m=1.3,h=-4096,g=!!has(`esri-tests-disable-memory-pools`);let _=class extends t{constructor(e){super(e),this._quality=1,this._usedMemory=0,this._updating=!1,this._stableQuality=0,this._downscaleMemoryUsed=0,this._canFastRecover=!1,this._predictedMemory=0,this._cacheStorage=new r,this._warnMemoryUsage=null,this._numQualityChanges=0,this._maxMemory=g?4096:750,this._additionalCacheMemory=g?h:0,this.addHandles(a({prepare:()=>this._updateMemory()}))}destroy(){this._cacheStorage.destroy()}get maxMemory(){return this._maxMemory}set maxMemory(e){e==null||e<=0||g||(this._stableQuality=0,this._canFastRecover=!1,this._maxMemory<e&&this._updateQuality(1),this._maxMemory=e)}get additionalCacheMemory(){return this._additionalCacheMemory}set additionalCacheMemory(e){e!=null&&!g&&(this._additionalCacheMemory=e)}get memoryFactor(){return this._quality}get updating(){return this._updating}get usedMemory(){return this._usedMemory}get usedCacheMemory(){return this._cacheStorage.size}newCache(e,t,n){return new i(e,this._cacheStorage,t,n)}resetStableQuality(){this._stableQuality=0}disableMemCache(){this.additionalCacheMemory=h}update(){if(this._predictedMemory<=0&&!this._updating)return;let e=this._layersUpdating();if(this._predictedMemory<.6&&this._canFastRecover)this._downscaleMemoryUsed=0,this._stableQuality=0,this._canFastRecover=!1,this._updateQuality(1);else if(e){if(this._predictedMemory>1.1||this._usedMemory>1){if(this._stableQuality>0)this._downscaleMemoryUsed=0,this._updateQuality(this._stableQuality);else if(this._quality>p&&this._downscaleMemoryUsed<this._usedMemory){if(this._compactAndUpdate())return;this._updateQuality(this._quality/m),this._downscaleMemoryUsed=this._usedMemory,this._canFastRecover=!1}}}else if(this._downscaleMemoryUsed=0,this._usedMemory>1){if(this._compactAndUpdate())return;this._stableQuality=0,this._canFastRecover=!1,e=this._updateQuality(this._quality/m),this._downscaleMemoryUsed=this._predictedMemory}else this._stableQuality!==this._quality&&(this._usedMemory<.75&&this._quality<1?(this._stableQuality=this._quality,e=this._updateQuality(this._quality+.05)):this._quality<1&&(this._canFastRecover=!0));this._updating=e}_compactAndUpdate(){let e=d(o(100)),t=this.view.stage.compact(e);return this.view.overlayManager.renderer.compact(e)||t}_updateQuality(e){return e=Math.min(Math.max(e,p),1),e!==this._quality&&(this._quality=e,++this._numQualityChanges,!0)}_layersUpdating(){return this.view.allLayerViews.some(e=>!!e.updating)}_updateMemory(){if(!this.view?.updating||this.view.destroyed||this.view.destroying)return;this.view.stage?.renderer?.tick();let e=this.view.stage?.renderer?.usedMemory,t=(this.view.basemapTerrain?.usedMemory??0)+(e?e.fbos+e.edges+e.plugins+e.clouds:0)+this.view.deconflictor?.usedMemory+this.view.labeler?.usedMemory+(l(this.view)?.lyr3DInternalMemoryBytes??0),r=0;this.view.allLayerViews&&this.view.allLayerViews.forEach(e=>{if(u(e)){let n=e.ignoresMemoryFactor?this._quality:1;t+=e.usedMemory*n,r+=e.unloadedMemory*n}});let i=this._warnMemoryUsage==null||Math.round(t*10)!==Math.round(this._warnMemoryUsage*10),a=this.maxMemory*1048576;if(t>a&&i){this._warnMemoryUsage=t;let e=e=>(e/1048576).toLocaleString(void 0,{maximumFractionDigits:1})+` MB`,i=Math.round(this._quality*100);n.getLogger(this).warn(`Memory Limit exceeded! Limit: ${e(a)} Current: ${e(t)} Projected: ${e(t+r)} Quality: ${i}%`)}this._usedMemory=t/a,this._predictedMemory=(t+r)/a;let o=a-t;this._cacheStorage.maxSize=Math.max(0,o+this.additionalCacheMemory*1048576)}get test(){}};e([s({constructOnly:!0})],_.prototype,`view`,void 0),e([s()],_.prototype,`maxMemory`,null),e([s()],_.prototype,`_quality`,void 0),e([s()],_.prototype,`_usedMemory`,void 0),e([s()],_.prototype,`_updating`,void 0),e([s()],_.prototype,`_stableQuality`,void 0),e([s()],_.prototype,`_maxMemory`,void 0),e([s()],_.prototype,`_additionalCacheMemory`,void 0),_=e([c(`esri.views.3d.support.MemoryController`)],_);export{p as minQuality,f as newMemoryController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{removeUnordered as e}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{isPromiseLike as t,createAbortError as n}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{getEmissions as i}from"./emissive/emissions.js";import{DepthRange as a}from"../lib/DepthRange.js";class o{constructor(e){this.context=e,this._renderPlugins=[],this._slots=[],this._version=r(0);for(let e=0;e<20;++e)this._slots[e]=[]}destroy(){this._renderPlugins.forEach(e=>e.destroy()),this._renderPlugins.length=0}get plugins(){return this._renderPlugins}add(e,r){let i=()=>{if(r?.aborted)throw e.uninitializeRenderContext(),n();this._renderPlugins.push(e),e.produces.forEach((t,n)=>this._slots[n].push(e)),this.context.requestRender(),this._version.value++},a=e.initializeRenderContext(this.context,r);if(t(a))return a.then(i);i()}remove(t){e(this._renderPlugins,t),t.uninitializeRenderContext();for(let e=0;e<this._slots.length;++e)this._slots[e]=this._slots[e].filter(e=>e!==t);this.context.requestRender(),this._version.value++}sortTestsTransparentOrderedSlots(e){if(process.env.NODE_ENV===`test`&&this._renderPlugins.some(e=>e.testsTransparentRenderOrder!==0))for(let t of e)this._slots[t].sort((e,t)=>(e.testsTransparentRenderOrder??0)-(t.testsTransparentRenderOrder??0))}prepareRender(){this._renderPlugins.forEach(e=>e.prepareRender?.(this.context.renderContext))}updateAnimation(e){let t=!1;return this._renderPlugins.forEach(n=>t=n.updateAnimation?.(e)||t),t}precompile(...e){++this.context.techniques.precompiling;let t=this.context.renderContext.bind.slot;for(let t of e)this.context.renderContext.bind.slot=t,this._forEachRender(()=>{});this.context.renderContext.bind.slot=t,--this.context.techniques.precompiling}render(...e){for(let t of e)this.context.renderContext.bind.slot=t,this._forEachRender((e,t)=>e.render(this.context.renderContext,t))}_forEachRender(e){let t=this.context.renderContext.bind.slot,n=this.context.renderContext.output;this._slots[t].forEach(r=>{if(!r.produces.get(t)?.(n)||r.isDecoration&&!this.context.renderContext.bind.decorations)return;let i=r.acquireTechniques(this.context.renderContext);i&&e(r,i)})}queryDepthRange(e){return this._renderPlugins.reduce((t,n)=>t.union(n.queryDepthRange?.(e)),new a)}get updating(){return this._version.value>=0&&this._renderPlugins.some(e=>e.readyToRun)}produces(e,...t){return t.some(t=>this._slots[t].some(n=>{let r=n.produces.get(t);return r?r(e):!1}))}hasHighlight(e){return s.some(t=>this._slots[t].some(t=>t.hasHighlight(e)))}get hasDecorations(){return this._renderPlugins.some(e=>e.isDecoration)}get hasOccludees(){return this._renderPlugins.some(e=>e.hasOccludees)}get emissions(){return i(this._renderPlugins)}get renderOccludedFlags(){return this._renderPlugins.reduce((e,t)=>e|(t.renderOccludedFlags??0),0)}get usedMemory(){return this._renderPlugins.reduce((e,t)=>t.material?e:e+(t.usedMemory??0),0)}get test(){}}const s=[2,4,18,12,13,14];export{o as RenderPluginManager};
2
+ import{remove as e}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{isPromiseLike as t,createAbortError as n}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{getEmissions as i}from"./emissive/emissions.js";import{DepthRange as a}from"../lib/DepthRange.js";class o{constructor(e){this.context=e,this._renderPlugins=[],this._slots=[],this._version=r(0);for(let e=0;e<20;++e)this._slots[e]=[]}destroy(){this._renderPlugins.forEach(e=>e.destroy()),this._renderPlugins.length=0}get plugins(){return this._renderPlugins}add(e,r){let i=()=>{if(r?.aborted)throw e.uninitializeRenderContext(),n();this._renderPlugins.push(e),e.produces.forEach((t,n)=>this._slots[n].push(e)),this.context.requestRender(),this._version.value++},a=e.initializeRenderContext(this.context,r);if(t(a))return a.then(i);i()}remove(t){e(this._renderPlugins,t),t.uninitializeRenderContext();for(let e=0;e<this._slots.length;++e)this._slots[e]=this._slots[e].filter(e=>e!==t);this.context.requestRender(),this._version.value++}sortTestsTransparentOrderedSlots(e){if(process.env.NODE_ENV===`test`&&this._renderPlugins.some(e=>e.testsTransparentRenderOrder!==0))for(let t of e)this._slots[t].sort((e,t)=>(e.testsTransparentRenderOrder??0)-(t.testsTransparentRenderOrder??0))}prepareRender(){this._renderPlugins.forEach(e=>e.prepareRender?.(this.context.renderContext))}updateAnimation(e){let t=!1;return this._renderPlugins.forEach(n=>t=n.updateAnimation?.(e)||t),t}precompile(...e){++this.context.techniques.precompiling;let t=this.context.renderContext.bind.slot;for(let t of e)this.context.renderContext.bind.slot=t,this._forEachRender(()=>{});this.context.renderContext.bind.slot=t,--this.context.techniques.precompiling}render(...e){for(let t of e)this.context.renderContext.bind.slot=t,this._forEachRender((e,t)=>e.render(this.context.renderContext,t))}_forEachRender(e){let t=this.context.renderContext.bind.slot,n=this.context.renderContext.output;this._slots[t].forEach(r=>{if(!r.produces.get(t)?.(n)||r.isDecoration&&!this.context.renderContext.bind.decorations)return;let i=r.acquireTechniques(this.context.renderContext);i&&e(r,i)})}queryDepthRange(e){return this._renderPlugins.reduce((t,n)=>t.union(n.queryDepthRange?.(e)),new a)}get updating(){return this._version.value>=0&&this._renderPlugins.some(e=>e.readyToRun)}produces(e,...t){return t.some(t=>this._slots[t].some(n=>{let r=n.produces.get(t);return r?r(e):!1}))}hasHighlight(e){return s.some(t=>this._slots[t].some(t=>t.hasHighlight(e)))}get hasDecorations(){return this._renderPlugins.some(e=>e.isDecoration)}get hasOccludees(){return this._renderPlugins.some(e=>e.hasOccludees)}get emissions(){return i(this._renderPlugins)}get renderOccludedFlags(){return this._renderPlugins.reduce((e,t)=>e|(t.renderOccludedFlags??0),0)}get usedMemory(){return this._renderPlugins.reduce((e,t)=>t.material?e:e+(t.usedMemory??0),0)}get test(){}}const s=[2,4,18,12,13,14];export{o as RenderPluginManager};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../../core/PooledArray.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as i}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as a}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{Blit as s}from"../blit/Blit.js";import{DepthStencilAttachment as c}from"../../../../webgl/enums.js";let l=class extends o{constructor(e){super(e),this.consumes={required:[a.OCCLUDED]},this.produces=a.OCCLUDED,this._blit=new s(e.view.stage.renderView.techniques,2)}precompile(){let e=this.view.stage.renderer;e.plugins.plugins.forEach(t=>{e.precompileSlots(t,9,11),t.material&&e.precompileOccludedSlots(t,f)})}render(){let e=this.input;return this._renderOccludedAndTransparentStencil(e),this._renderOccludedComposite(e),e}_renderOccludedAndTransparentStencil(e){let t=this.view.stage.renderer,n=u;this._acquirePlugins(n,8),n.length!==0&&(t.renderSlots(n,10),this._renderAndComposite(e,e.getAttachment(c),.5,()=>t.renderSlots(n,11),!1,!1),n.clear())}_renderOccludedComposite(e){let t=this.view.stage.renderer,n=u,r=this._acquirePlugins(n,p);if(n.length===0)return;let i=this._getDepthStencilAttachment(e),a=i.clearStencil;for(let o of f)r&o&&(this._renderAndComposite(e,i.depth,o===16?1:.5,()=>t.renderOccludedSlots(n,o),!0,a),a=!1);i.release(),n.clear()}_acquirePlugins(e,t){let n=this.view.stage.renderer;e.clear();let r=0,i=!1;for(let a of n.plugins.plugins){let n=a.renderOccludedFlags&t;r|=n,n&&(e.push(a),i||=a.testsTransparentRenderOrder!==0)}return i&&e.sort((e,t)=>e.testsTransparentRenderOrder-t.testsTransparentRenderOrder),r}_renderAndComposite(e,t,n,r,a,o){let s=this.renderingContext,{width:c,height:l}=e.fbo,u=this.fboCache.acquire(c,l,`tmp color`);u.attachDepth(t),s.bindFramebuffer(u.fbo),s.clearFramebuffer(i,a,o),r(),u.detachDepth(),this._blit.blend(u,e,this.bindParameters,n),u.release()}_getDepthStencilAttachment(e){let{width:t,height:n}=e.fbo;if(!this.view.stage.renderer.occludedRequiresIntegratedMeshStencil){let e=this.fboCache.acquireDepth(14,t,n,`retained stencil`);return{depth:e,release:()=>e.release(),clearStencil:!0}}let r=this.fboCache.acquire(t,n,`retained stencil`,14);return this.renderingContext.blitFramebuffer(e.fbo,r.fbo,1024),{depth:r.getAttachment(c),release:()=>r.release(),clearStencil:!1}}};e([n()],l.prototype,`consumes`,void 0),e([n()],l.prototype,`produces`,void 0),l=e([r(`esri.views.3d.webgl-engine.effects.geometry.RenderOccluded`)],l);const u=new t;function d(){u.prune()}const f=[4,2,16],p=f.reduce((e,t)=>e|t,0);export{l as RenderOccluded,d as cleanupRenderOccluded};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/PooledArray.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as i}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as a}from"../../../webgl.js";import o from"../../../webgl/RenderNode.js";import{Blit as s}from"../blit/Blit.js";import{DepthStencilAttachment as c}from"../../../../webgl/enums.js";let l=class extends o{constructor(e){super(e),this.consumes={required:[a.OCCLUDED]},this.produces=a.OCCLUDED,this._blit=new s(e.view.stage.renderView.techniques,2)}precompile(){let e=this.view.stage.renderer;e.plugins.plugins.forEach(t=>{e.precompileSlots(t,9,11),t.material&&e.precompileOccludedSlots(t,f)})}render(){let e=this.input;return this._renderOccludedAndTransparentStencil(e),this._renderOccludedComposite(e),e}_renderOccludedAndTransparentStencil(e){let t=this.view.stage.renderer,n=u;this._acquirePlugins(n,8),n.length!==0&&(t.renderSlots(n,10),this._renderAndComposite(e,e.getAttachment(c),.5,()=>t.renderSlots(n,11),!1,!1),n.clear())}_renderOccludedComposite(e){let t=this.view.stage.renderer,n=u,r=this._acquirePlugins(n,p);if(n.length===0)return;let i=this._getDepthStencilAttachment(e),a=i.clearStencil;for(let o of f)r&o&&(this._renderAndComposite(e,i.depth,o===16?1:.5,()=>t.renderOccludedSlots(n,o),!0,a),a=!1);i.release(),n.clear()}_acquirePlugins(e,t){let n=this.view.stage.renderer;e.clear();let r=0,i=!1;for(let a of n.plugins.plugins){let n=a.renderOccludedFlags&t;r|=n,n&&(e.push(a),i||=a.testsTransparentRenderOrder!==0)}return i&&(process.env.NODE_ENV===`test`?e.stableSort((e,t)=>e.testsTransparentRenderOrder-t.testsTransparentRenderOrder):e.sort((e,t)=>e.testsTransparentRenderOrder-t.testsTransparentRenderOrder)),r}_renderAndComposite(e,t,n,r,a,o){let s=this.renderingContext,{width:c,height:l}=e.fbo,u=this.fboCache.acquire(c,l,`tmp color`);u.attachDepth(t),s.bindFramebuffer(u.fbo),s.clearFramebuffer(i,a,o),r(),u.detachDepth(),this._blit.blend(u,e,this.bindParameters,n),u.release()}_getDepthStencilAttachment(e){let{width:t,height:n}=e.fbo;if(!this.view.stage.renderer.occludedRequiresIntegratedMeshStencil){let e=this.fboCache.acquireDepth(14,t,n,`retained stencil`);return{depth:e,release:()=>e.release(),clearStencil:!0}}let r=this.fboCache.acquire(t,n,`retained stencil`,14);return this.renderingContext.blitFramebuffer(e.fbo,r.fbo,1024),{depth:r.getAttachment(c),release:()=>r.release(),clearStencil:!1}}};e([n()],l.prototype,`consumes`,void 0),e([n()],l.prototype,`produces`,void 0),l=e([r(`esri.views.3d.webgl-engine.effects.geometry.RenderOccluded`)],l);const u=new t;function d(){u.prune()}const f=[4,2,16],p=f.reduce((e,t)=>e|t,0);export{l as RenderOccluded,d as cleanupRenderOccluded};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{floatSubArray as e}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as t}from"../../../../geometry/support/HalfFloatArray.js";import{newIndexArray as n,compactIndices as r}from"../../../../geometry/support/Indices.js";import{newShortArray as i}from"../../../../geometry/support/ShortArray.js";import{pathNumProfilesPerJoin as a}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{compressNormal as o,encodeInt16 as s}from"./Normals.js";import{PathEvaluator as c}from"./PathEvaluator.js";import{encodePathVertexInfo as l}from"./PathVertexInfo.js";class u{constructor(r,o,s,l,u){this.path=r,this.profile=o,this.extruder=s,this.cap=l,this._extrusionVertexCount=0,this._extrusionFrameCount=0;let d=this.path.vertices.length-2;this.numExtrusionProfiles=a*d+2,this.numVerticesTotal=o.vertices.length*this.numExtrusionProfiles,this.numExtrusionFrames=this.path.vertices.length;let f=this.cap.numVertices;this.startCapVertexBufferStart=this.numVerticesTotal,this.numVerticesTotal+=f,this.endCapVertexBufferStart=this.numVerticesTotal,this.numVerticesTotal+=f,this.profileRightAxes=i(this.numExtrusionFrames*2),this.profileUpAxes=i(this.numExtrusionFrames*2);let p=u===1;this.profileRotationFrameUpAxes=p?i(this.numExtrusionFrames*2):null,this.pathMaxStretchDistances=t(this.numExtrusionFrames),this.profileRotations=i(this.numExtrusionFrames),this.framePositionIndices=n(this.numExtrusionFrames),this.pathVertexInfos=new Uint32Array(this.numVerticesTotal),this.positions=e(r.positions,r.offset,r.vertices.length*3),this._rebuildGeometry(),this._buildTopology(),this.evaluator=new c(this,o,s,l.type,u)}emitVertexDescriptor(e){let t=this._extrusionVertexCount;this.pathVertexInfos[t]=l(e),++this._extrusionVertexCount}emitExtrusionFrame(e,t){let{frame:n,rotationFrameUp:r,rotationAngle:i,maxStretchDistance:a}=e,c=this._extrusionFrameCount;return o(this.profileRightAxes,c,n.right[0],n.right[1],n.right[2]),o(this.profileUpAxes,c,n.up[0],n.up[1],n.up[2]),this.profileRotations[c]=s(i/Math.PI),this.profileRotationFrameUpAxes&&o(this.profileRotationFrameUpAxes,c,r[0],r[1],r[2]),this.pathMaxStretchDistances[c]=a,this.framePositionIndices[c]=t,this._extrusionFrameCount++}_rebuildGeometry(){this._extrusionVertexCount=0,this._extrusionFrameCount=0;let{vertices:e}=this.path,{profile:t}=this;this._updatePositions();for(let t=0;t<e.length;++t)this.emitExtrusionFrame(e[t],t);for(let e=0;e<t.vertices.length;++e)this.emitVertexDescriptor({frameIndex:0,sourceIndex:e,subdivision:0,type:1,capSide:0});let n=(e,t,n)=>{this.emitVertexDescriptor({frameIndex:e,sourceIndex:t,subdivision:n,type:0,capSide:0})};for(let t=1;t<e.length-1;++t)this.extruder.extrude(t,this.profile,n);let r=e.length-1;for(let e=0;e<t.vertices.length;++e)this.emitVertexDescriptor({frameIndex:r,sourceIndex:e,subdivision:0,type:1,capSide:1});this.cap.rebuildCapGeometry((e,t,n)=>this.emitVertexDescriptor({frameIndex:0,sourceIndex:e,subdivision:t,type:n,capSide:0})),this.cap.rebuildCapGeometry((e,t,n)=>this.emitVertexDescriptor({frameIndex:r,sourceIndex:e,subdivision:t,type:n,capSide:1}))}_updatePositions(){let{positions:e,offset:t,vertices:n}=this.path;if(!Array.isArray(e))return;let r=n.length*3,i=this.positions;for(let n=0;n<r;++n)i[n]=e[t+n]}_buildTopology(){let e=this.profile.vertices.length,t=this.profile.numSegments,n=this.numExtrusionProfiles-1,i=e*(this.numExtrusionProfiles-1),a=[],o=(e,t,n)=>{a.push(e),a.push(t),a.push(n)};for(let r=0;r<t;++r){let t=this.profile.indices[r*2],i=this.profile.indices[r*2+1];for(let r=0;r<n;++r){let n=r*e+t,a=(r+1)*e+t,s=(r+1)*e+i,c=r*e+i;o(n,a,s),o(n,s,c)}}this.cap.buildTopology(o,0,this.startCapVertexBufferStart,0),this.cap.buildTopology(o,1,this.endCapVertexBufferStart,i),this.vertexIndices=r(a)}onPathChanged(){this._rebuildGeometry()}}export{u as PathBuilder};
2
+ import{floatSubArray as e}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as t}from"../../../../geometry/support/HalfFloatArray.js";import{newIndexArray as n}from"../../../../geometry/support/Indices.js";import{newShortArray as r}from"../../../../geometry/support/ShortArray.js";import{pathNumProfilesPerJoin as i,pathNumJoinSubdivisions as a}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{compressNormal as o,encodeInt16 as s}from"./Normals.js";import{PathEvaluator as c}from"./PathEvaluator.js";import{encodePathVertexInfo as l}from"./PathVertexInfo.js";class u{constructor(o,s,l,u,d){this.path=o,this.profile=s,this.extruder=l,this.cap=u,this._extrusionVertexCount=0,this._extrusionFrameCount=0;let f=this.path.vertices.length-2;this.numExtrusionProfiles=i*f+2,this.numVerticesTotal=s.vertices.length*this.numExtrusionProfiles,this.numExtrusionFrames=this.path.vertices.length;let p=this.cap.numVertices;this.startCapGeometryVertexOffset=this.numVerticesTotal,this.numVerticesTotal+=p,this.endCapGeometryVertexOffset=this.numVerticesTotal,this.numVerticesTotal+=p,this.profileRightAxes=r(this.numExtrusionFrames*2),this.profileUpAxes=r(this.numExtrusionFrames*2);let m=d===1;this.profileRotationFrameUpAxes=m?r(this.numExtrusionFrames*2):null,this.pathMaxStretchDistances=t(this.numExtrusionFrames),this.profileRotations=r(this.numExtrusionFrames),this.framePositionIndices=n(this.numExtrusionFrames),this.pathVertexInfos=new Uint32Array(this.numVerticesTotal),this.positions=e(o.positions,o.offset,o.vertices.length*3);let h=l.join===2;this._numJoinTriangles=s.joinTriangleBudgets[d][l.join];let g=2*s.numSegments*(h?a:1);this._compressed=this._numJoinTriangles<g;let _=2*s.numSegments*(f+1)+this._numJoinTriangles*f;this.vertexIndices=n(_*3+2*this.cap.numIndices,this.numVerticesTotal),this._rebuildGeometry(),this._buildTopology(),this.evaluator=new c(this,s,l,u.type,d)}emitVertexDescriptor(e){let t=this._extrusionVertexCount;this.pathVertexInfos[t]=l(e),++this._extrusionVertexCount}emitExtrusionFrame(e,t){let{frame:n,rotationFrameUp:r,rotationAngle:i,maxStretchDistance:a}=e,c=this._extrusionFrameCount;return o(this.profileRightAxes,c,n.right[0],n.right[1],n.right[2]),o(this.profileUpAxes,c,n.up[0],n.up[1],n.up[2]),this.profileRotations[c]=s(i/Math.PI),this.profileRotationFrameUpAxes&&o(this.profileRotationFrameUpAxes,c,r[0],r[1],r[2]),this.pathMaxStretchDistances[c]=a,this.framePositionIndices[c]=t,this._extrusionFrameCount++}_rebuildGeometry(){this._extrusionVertexCount=0,this._extrusionFrameCount=0;let{vertices:e}=this.path,{profile:t}=this;this._updatePositions();for(let t=0;t<e.length;++t)this.emitExtrusionFrame(e[t],t);for(let e=0;e<t.vertices.length;++e)this.emitVertexDescriptor({frameIndex:0,sourceIndex:e,subdivision:0,type:1,capSide:0});let n=(e,t,n)=>{this.emitVertexDescriptor({frameIndex:e,sourceIndex:t,subdivision:n,type:0,capSide:0})};for(let t=1;t<e.length-1;++t)this.extruder.extrude(t,this.profile,n);let r=e.length-1;for(let e=0;e<t.vertices.length;++e)this.emitVertexDescriptor({frameIndex:r,sourceIndex:e,subdivision:0,type:1,capSide:1});this.cap.rebuildCapGeometry((e,t,n)=>this.emitVertexDescriptor({frameIndex:0,sourceIndex:e,subdivision:t,type:n,capSide:0})),this.cap.rebuildCapGeometry((e,t,n)=>this.emitVertexDescriptor({frameIndex:r,sourceIndex:e,subdivision:t,type:n,capSide:1}))}_updatePositions(){let{positions:e,offset:t,vertices:n}=this.path;if(!Array.isArray(e))return;let r=n.length*3,i=this.positions;for(let n=0;n<r;++n)i[n]=e[t+n]}_buildTopology(){let e=this.profile.vertices.length*(this.numExtrusionProfiles-1),{vertexIndices:t}=this,n=0,r=(e,r,i)=>{t[n++]=e,t[n++]=r,t[n++]=i};this.extruder.buildTopology(this.path,this.profile,0,this.profileRotationFrameUpAxes!=null,this._compressed,this._numJoinTriangles,(e,t)=>{for(let n=0;n<this.profile.numSegments;++n){let i=this.profile.indices[n*2],a=this.profile.indices[n*2+1];r(e+i,t+i,t+a),r(e+i,t+a,e+a)}},r),this.cap.buildTopology(r,0,this.startCapGeometryVertexOffset,0),this.cap.buildTopology(r,1,this.endCapGeometryVertexOffset,e)}onPathChanged(){this._rebuildGeometry(),this._buildTopology()}}export{u as PathBuilder};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{pathNumRoundCapExtrusionSubdivisions as e}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";class t{constructor(){this.numVertices=0,this.numIndices=0,this.type=0}rebuildCapGeometry(){}buildTopology(){}}class n{constructor(e,t){this._profile=e,this.type=t}get numVertices(){return this._profile.vertices.length}get numIndices(){return this._profile.numSegments*3}rebuildCapGeometry(e){let t=this._profile;for(let n=0;n<t.vertices.length;++n)e(n,0,2)}buildTopology(e,t,n){let r=this._profile,i=n+r.indices[0],a=t===1;for(let t=1;t<r.numSegments;++t){let o=r.indices[t*2],s=r.indices[t*2+1],c=n+o,l=n+s;a?e(l,c,i):e(i,c,l)}}}class r{constructor(e,t){this._profile=e,this._breakNormals=t,this.type=3}get numVertices(){let t=this._profile.vertices.length*(e-1)+this._profile.poles.length;return this._breakNormals&&(t+=this._profile.vertices.length),t}get numIndices(){let t=0,n=this._profile;t+=n.numSegments*2*(e-1);for(let e=0;e<n.numSegments;++e){let r=n.indices[e*2],i=n.indices[e*2+1];n.poleIndices[r]===n.poleIndices[i]?t+=1:t+=2}return t*3}rebuildCapGeometry(t){let n=this._profile;for(let e=0;e<n.poles.length;++e)t(e,0,2);if(this._breakNormals)for(let e=0;e<n.vertices.length;++e)t(e,0,1);for(let r=0;r<e-1;++r)for(let e=0;e<n.vertices.length;++e)t(e,r,3)}buildTopology(t,n,r,i){let a=this._profile,o=this._breakNormals?r+a.poles.length:i,s=this._breakNormals?r+a.poles.length+a.vertices.length:r+a.poles.length,c=n===1;for(let n=0;n<a.numSegments;++n){let i=a.indices[n*2],l=a.indices[n*2+1],u=r+a.poleIndices[i],d=r+a.poleIndices[l],f=o+i,p=o+l;for(let n=0;n<e-1;++n){let e=s+n*a.vertices.length+i,r=s+n*a.vertices.length+l;c?(t(e,p,f),t(p,e,r)):(t(f,p,e),t(r,e,p)),f=e,p=r}c?(t(u,p,f),u!==d&&t(u,d,p)):(t(f,p,u),u!==d&&t(p,d,u))}}}export{t as NoCapBuilder,r as RoundCapBuilder,n as TriangulationCapBuilder};
2
+ import{pathNumRoundCapExtrusionSubdivisions as e}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";class t{constructor(){this.numVertices=0,this.numIndices=0,this.type=0}rebuildCapGeometry(){}buildTopology(){}}class n{constructor(e,t){this._profile=e,this.type=t}get numVertices(){return this._profile.vertices.length}get numIndices(){return(this._profile.numSegments-1)*3}rebuildCapGeometry(e){let t=this._profile;for(let n=0;n<t.vertices.length;++n)e(n,0,2)}buildTopology(e,t,n){let r=this._profile,i=n+r.indices[0],a=t===1;for(let t=1;t<r.numSegments;++t){let o=r.indices[t*2],s=r.indices[t*2+1],c=n+o,l=n+s;a?e(l,c,i):e(i,c,l)}}}class r{constructor(e,t){this._profile=e,this._breakNormals=t,this.type=3}get numVertices(){let t=this._profile.vertices.length*(e-1)+this._profile.poles.length;return this._breakNormals&&(t+=this._profile.vertices.length),t}get numIndices(){let t=0,n=this._profile;t+=n.numSegments*2*(e-1);for(let e=0;e<n.numSegments;++e){let r=n.indices[e*2],i=n.indices[e*2+1];n.poleIndices[r]===n.poleIndices[i]?t+=1:t+=2}return t*3}rebuildCapGeometry(t){let n=this._profile;for(let e=0;e<n.poles.length;++e)t(e,0,2);if(this._breakNormals)for(let e=0;e<n.vertices.length;++e)t(e,0,1);for(let r=0;r<e-1;++r)for(let e=0;e<n.vertices.length;++e)t(e,r,3)}buildTopology(t,n,r,i){let a=this._profile,o=this._breakNormals?r+a.poles.length:i,s=this._breakNormals?r+a.poles.length+a.vertices.length:r+a.poles.length,c=n===1;for(let n=0;n<a.numSegments;++n){let i=a.indices[n*2],l=a.indices[n*2+1],u=r+a.poleIndices[i],d=r+a.poleIndices[l],f=o+i,p=o+l;for(let n=0;n<e-1;++n){let e=s+n*a.vertices.length+i,r=s+n*a.vertices.length+l;c?(t(e,p,f),t(p,e,r)):(t(f,p,e),t(r,e,p)),f=e,p=r}c?(t(u,p,f),u!==d&&t(u,d,p)):(t(f,p,u),u!==d&&t(p,d,u))}}}export{t as NoCapBuilder,r as RoundCapBuilder,n as TriangulationCapBuilder};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{reciprocalClamped as e}from"../../../../core/mathUtils.js";import{set as t}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{setAxisAngle as r}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{multiply as a,copy as o,length as s,scale as c,set as l,dot as u,add as d,subtract as f,normalize as p,transformMat2 as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_X as h,ZEROS as g,create as _}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as v,set as y,transformQuat as b,dot as x,scale as S,add as C,normalize as w}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{pathNumJoinSubdivisions as E,pathNumRoundCapExtrusionSubdivisions as D}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{decodeInt16 as O,decompressNormal as k}from"./Normals.js";import{PathFrame2D as A}from"./PathFrame2D.js";import{decodePathVertexInfo as j}from"./PathVertexInfo.js";class M{constructor(e,t,n,r,i){this.builder=e,this.profile=t,this.extruder=n,this.capType=r,this.upVectorAlignment=i}evaluateVertexPosition(e,t,n,r){let{framePositionIndices:i,positions:f}=this.builder,p=Y;this._evaluateExtrudedVertex(p,n);let m=U,h=0,g=p.frameIndex,_=p.frame.right,b=p.frame.up,x=i[g]*3,S=a(W,p.profileVertex,t);if(p.isCap)v(m,b,_),h=p.capPositionOffset*t[0];else{let e=G,n=K;o(e,p.rotationRight);let r=p.maxDistance;a(e,e,t);let i=s(e);i>0?c(e,e,1/i):l(e,0,0);let f=u(S,e);if(Math.abs(f)>r){l(n,-e[1],e[0]);let t=u(S,n);c(e,e,r*Math.sign(f)),c(n,n,t),d(S,e,n)}y(m,0,0,0)}let C=_[0]*S[0]+b[0]*S[1],w=_[1]*S[0]+b[1]*S[1],T=_[2]*S[0]+b[2]*S[1],E=r*3;e[E]=f[x]+C+m[0]*h,e[E+1]=f[x+1]+w+m[1]*h,e[E+2]=f[x+2]+T+m[2]*h}_evaluateExtrudedVertex(e,t){let{profileRotations:n,profileUpAxes:i,profileRightAxes:a,profileRotationFrameUpAxes:s,pathMaxStretchDistances:l,pathVertexInfos:m}=this.builder,{extruder:_,profile:v,upVectorAlignment:y}=this,{cutoffAngle:x,join:S}=_,C=N[y],w=this.upVectorAlignment===1,T=j(m[t]),A=T.frameIndex;e.frameIndex=A;let M=O(n[A])*Math.PI,I=l[A];switch(k(e.frame.right,a,A),k(e.frame.up,i,A),e.maxDistance=0,T.type){case 0:{e.isCap=!1;let t=v.vertices[T.sourceIndex],n=Math.abs(M)>=x,i=w?k(q,s,A):e.frame.up,a=s==null?h:F(B,e.frame,i),c=u(t,a)*M>=0;if(n&&c){o(e.profileVertex,t);let n=S===2?(-.5+T.subdivision/E)*M:(-.5+Math.floor(T.subdivision/2))*M;n!==0&&(r(J,i,n),w&&b(e.frame.up,e.frame.up,J),b(e.frame.right,e.frame.right,J))}else{let n=C(R,t,M,a);o(e.profileVertex,n)}o(e.rotationRight,c?g:a),e.maxDistance=c?0:I;break}case 1:{e.isCap=!0;let t=v.vertices[T.sourceIndex];switch(o(e.profileVertex,t),this.capType){case 0:case 1:case 3:e.capPositionOffset=0;break;case 2:e.capPositionOffset=P(T)?.5:-.5}break}case 2:{e.isCap=!0;let t=P(T)?1:-1;switch(this.capType){case 1:case 2:{let n=v.vertices[T.sourceIndex],r=this.capType===2?t*.5:0;o(e.profileVertex,n),e.capPositionOffset=r;break}case 3:{let n=t*.5,r=v.poles[T.sourceIndex],i=r.position;r.normal,o(e.profileVertex,i),e.capPositionOffset=n;break}}break}case 3:{e.isCap=!0;let t=(P(T)?1:-1)*.5,n=(1-(T.subdivision+1)/D)*Math.PI*.5,r=Math.sin(n),i=Math.cos(n),a=v.poleIndices[T.sourceIndex],s=v.poles[a],l=s.position,u=s.normal,m=v.vertices[T.sourceIndex];f(R,m,l),c(R,R,r),u?(d(R,R,l),o(e.profileVertex,R),e.capPositionOffset=t*i):(p(L,R),c(L,L,r),d(R,R,l),o(e.profileVertex,R),e.capPositionOffset=t*i);break}default:T.type}}}const N={0:(t,n,r)=>{if(Math.abs(r)<=0)return n;let i=e(Math.cos(.5*r));return l(t,(1+(i-1))*n[0],n[1])},1:(n,r,i,a)=>{if(Math.abs(i)===0)return r;let o=e(Math.cos(.5*i)),s=t(z,1+(o-1)*a[0]*a[0],(o-1)*a[0]*a[1],(o-1)*a[0]*a[1],1+(o-1)*a[1]*a[1]);return m(n,r,s)}};function P(e){return e.capSide===1}function F(e,t,n){let r=x(n,t.up),i=x(n,t.right);return S(V,t.up,-i),S(H,t.right,r),C(V,V,H),w(V,V),I(e,t,V),e}function I(e,t,n){l(e,x(n,t.right),x(n,t.up))}const L=_(),R=_(),z=n(),B=_(),V=T(),H=T(),U=T(),W=_(),G=_(),K=_(),q=T(),J=i(),Y={profileVertex:_(),rotationRight:_(),maxDistance:0,capPositionOffset:0,isCap:!1,frame:new A,frameIndex:0};export{M as PathEvaluator};
2
+ import{reciprocalClamped as e}from"../../../../core/mathUtils.js";import{set as t}from"../../../../core/libs/gl-matrix-2/math/mat2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat2f64.js";import{setAxisAngle as r}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{multiply as a,copy as o,length as s,scale as c,set as l,dot as u,add as d,subtract as f,normalize as p,transformMat2 as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as h,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{cross as _,set as v,transformQuat as y}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{pathNumJoinSubdivisions as x,pathNumRoundCapExtrusionSubdivisions as S}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{decodeInt16 as C,decompressNormal as w}from"./Normals.js";import{PathFrame2D as T}from"./PathFrame2D.js";import{constructPathRotationRight as E,isOuterJoinVertex as D}from"./pathGeometryUtils.js";import{decodePathVertexInfo as O}from"./PathVertexInfo.js";class k{constructor(e,t,n,r,i){this.builder=e,this.profile=t,this.extruder=n,this.capType=r,this.upVectorAlignment=i}evaluateVertexPosition(e,t,n,r){let{framePositionIndices:i,positions:f}=this.builder,p=H;this._evaluateExtrudedVertex(p,n);let m=I,h=0,g=p.frameIndex,y=p.frame.right,b=p.frame.up,x=i[g]*3,S=a(L,p.profileVertex,t);if(p.isCap)_(m,b,y),h=p.capPositionOffset*t[0];else{let e=R,n=z;o(e,p.rotationRight);let r=p.maxDistance;a(e,e,t);let i=s(e);i>0?c(e,e,1/i):l(e,0,0);let f=u(S,e);if(Math.abs(f)>r){l(n,-e[1],e[0]);let t=u(S,n);c(e,e,r*Math.sign(f)),c(n,n,t),d(S,e,n)}v(m,0,0,0)}let C=y[0]*S[0]+b[0]*S[1],w=y[1]*S[0]+b[1]*S[1],T=y[2]*S[0]+b[2]*S[1],E=r*3;e[E]=f[x]+C+m[0]*h,e[E+1]=f[x+1]+w+m[1]*h,e[E+2]=f[x+2]+T+m[2]*h}_evaluateExtrudedVertex(e,t){let{profileRotations:n,profileUpAxes:i,profileRightAxes:a,profileRotationFrameUpAxes:s,pathMaxStretchDistances:l,pathVertexInfos:u}=this.builder,{extruder:m,profile:g,upVectorAlignment:_}=this,{cutoffAngle:v,join:b}=m,T=A[_],k=this.upVectorAlignment===1,P=O(u[t]),I=P.frameIndex;e.frameIndex=I;let L=C(n[I])*Math.PI,R=l[I];switch(w(e.frame.right,a,I),w(e.frame.up,i,I),e.maxDistance=0,P.type){case 0:{e.isCap=!1;let t=g.vertices[P.sourceIndex],n=Math.abs(L)>=v,i=k?w(B,s,I):e.frame.up,a=E(F,e.frame,i,k),c=D(t,a,L);if(n&&c){o(e.profileVertex,t);let n=b===2?(-.5+P.subdivision/x)*L:(-.5+Math.floor(P.subdivision/2))*L;n!==0&&(r(V,i,n),k&&y(e.frame.up,e.frame.up,V),y(e.frame.right,e.frame.right,V))}else{let n=T(N,t,L,a);o(e.profileVertex,n)}o(e.rotationRight,c?h:a),e.maxDistance=c?0:R;break}case 1:{e.isCap=!0;let t=g.vertices[P.sourceIndex];switch(o(e.profileVertex,t),this.capType){case 0:case 1:case 3:e.capPositionOffset=0;break;case 2:e.capPositionOffset=j(P)?.5:-.5}break}case 2:{e.isCap=!0;let t=j(P)?1:-1;switch(this.capType){case 1:case 2:{let n=g.vertices[P.sourceIndex],r=this.capType===2?t*.5:0;o(e.profileVertex,n),e.capPositionOffset=r;break}case 3:{let n=t*.5,r=g.poles[P.sourceIndex],i=r.position;r.normal,o(e.profileVertex,i),e.capPositionOffset=n;break}}break}case 3:{e.isCap=!0;let t=(j(P)?1:-1)*.5,n=(1-(P.subdivision+1)/S)*Math.PI*.5,r=Math.sin(n),i=Math.cos(n),a=g.poleIndices[P.sourceIndex],s=g.poles[a],l=s.position,u=s.normal,m=g.vertices[P.sourceIndex];f(N,m,l),c(N,N,r),u?(d(N,N,l),o(e.profileVertex,N),e.capPositionOffset=t*i):(p(M,N),c(M,M,r),d(N,N,l),o(e.profileVertex,N),e.capPositionOffset=t*i);break}default:P.type}}}const A={0:(t,n,r)=>{if(Math.abs(r)<=0)return n;let i=e(Math.cos(.5*r));return l(t,(1+(i-1))*n[0],n[1])},1:(n,r,i,a)=>{if(Math.abs(i)===0)return r;let o=e(Math.cos(.5*i)),s=t(P,1+(o-1)*a[0]*a[0],(o-1)*a[0]*a[1],(o-1)*a[0]*a[1],1+(o-1)*a[1]*a[1]);return m(n,r,s)}};function j(e){return e.capSide===1}const M=g(),N=g(),P=n(),F=g(),I=b(),L=g(),R=g(),z=g(),B=b(),V=i(),H={profileVertex:g(),rotationRight:g(),maxDistance:0,capPositionOffset:0,isCap:!1,frame:new T,frameIndex:0};export{k as PathEvaluator};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{pathNumProfilesPerJoin as e}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";class t{constructor(e){this.join=e,this.cutoffAngle=this.join===0?.8*Math.PI:0}extrude(t,n,r){for(let i=0;i<e;++i)for(let e=0;e<n.vertices.length;++e)r(t,e,i)}}export{t as PathExtruder};
2
+ import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{pathNumProfilesPerJoin as t,pathNumJoinSubdivisions as n}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{constructPathRotationRight as r,needsJoinSubdivisions as i}from"./pathGeometryUtils.js";class a{constructor(e){this.join=e,this.cutoffAngle=this.join===0?.8*Math.PI:0}extrude(e,n,r){for(let i=0;i<t;++i)for(let t=0;t<n.vertices.length;++t)r(e,t,i)}buildTopology(e,t,n,r,i,a,o,s){i?this._buildCompressedTopology(e,t,n,r,a,o,s):this._buildFixedTopology(e,t,n,o)}_buildCompressedTopology(e,r,i,a,o,s,c){let l=r.vertices.length,u=this.join===2?n:1,d=Array(l).fill(!1),f=i;for(let i=1;i<e.vertices.length-1;++i){let p=l*(1+(i-1)*t);s(f,p),this._classifyJoinVertices(e.vertices[i],r,a,d);let m=o-r.indices.reduce((e,t)=>e+(d[t]?0:u),0);this._emitCompressedJoinTopology(r,p,d,c);for(let e=0;e<m;++e)c(p,p,p);f=p+n*l}let p=l*(1+(e.vertices.length-2)*t);s(f,p)}_buildFixedTopology(e,r,i,a){let o=r.vertices.length,s=this.join===2,c=+!s,l=s?n:2,u=i;for(let r=1;r<e.vertices.length-1;++r){let e=o*(1+(r-1)*t);a(u,e);for(let t=c;t<l;++t){let n=e+t*o;a(n,n+o)}u=e+n*o}let d=o*(1+(e.vertices.length-2)*t);a(u,d)}_classifyJoinVertices(e,t,n,a){let s=e.rotationAngle,c=r(o,e.frame,e.rotationFrameUp,n);for(let e=0;e<a.length;++e){let n=t.vertices[e];a[e]=!i(n,c,s)}}_emitCompressedJoinTopology(e,t,r,i){let a=e.vertices.length,o=this.join===2,s=+!o,c=o?n:2;for(let n=0;n<e.numSegments;++n){let o=e.indices[n*2],l=e.indices[n*2+1];if(!(r[o]&&r[l]))for(let e=s;e<c;++e){let n=t+e*a,s=n+a,c=n+o,u=s+o,d=s+l,f=n+l;r[o]||i(c,u,d),r[l]||i(c,d,f)}}}}const o=e();export{a as PathExtruder};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{estimateNumberArrayMemory as e}from"../../../../core/memoryEstimations.js";import{fromValues as t,clone as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{pathNumCircleProfileSubdivisions as r}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";const i=r,a={0:{indexCount:i*2,poleCount:1,vertexCount:i},1:{indexCount:8,poleCount:4,vertexCount:8}};class o{constructor(e){this.type=e,this.vertices=[],this.normals=[],this.indices=[],this.poles=[],this.poleIndices=[]}addVertex(e,t){return this.vertices.push(n(e)),this.normals.push(n(t)),this.vertices.length-1}addPole(e,t=null){return this.poles.push({position:n(e),normal:t?n(t):null}),this.poles.length-1}addSegment(e,t=null){this.indices.push(e.v0),this.indices.push(e.v1),t&&(this.poleIndices.push(t.v0),this.poleIndices.push(t.v1))}get numSegments(){return this.indices.length/2}translate(e,t){for(let n of this.vertices)n[0]+=e,n[1]+=t;for(let n of this.poles)n.position[0]+=e,n.position[1]+=t}get usedMemory(){return this.vertices.length*e(this.vertices[0])*2+e(this.indices)}}const s={top:[0,-.5],bottom:[0,.5]};function c(e){let n=.5,i=r,a=new o(0),c={v0:0,v1:0};a.addPole(t(0,0));for(let e=0;e<i;++e){let r=e*2*Math.PI/i,o=Math.cos(r),s=Math.sin(r),c=t(o*n,s*n),l=t(o,s);a.addVertex(c,l)}for(let e=0;e<i-1;++e){let t={v0:e,v1:e+1};a.addSegment(t,c)}let l={v0:i-1,v1:0};if(a.addSegment(l,c),e!==`center`){let t=s[e];a.translate(t[0],t[1])}return a}const l={center:c(`center`),top:c(`top`),bottom:c(`bottom`)},u={center:d(`center`),top:d(`top`),bottom:d(`bottom`)};function d(e){let n=new o(1),r=t(-.5,-.5),i=t(.5,-.5),a=t(.5,.5),c=t(-.5,.5),l=t(0,-1),u=t(1,0),d=t(0,1),f=t(-1,0);if(n.addPole(t(0,.5),d),n.addPole(t(0,.5)),n.addPole(t(0,-.5)),n.addPole(t(0,-.5),l),n.addVertex(r,l),n.addVertex(i,l),n.addSegment({v0:0,v1:1},{v0:3,v1:3}),n.addVertex(i,u),n.addVertex(a,u),n.addSegment({v0:2,v1:3},{v0:2,v1:1}),n.addVertex(a,d),n.addVertex(c,d),n.addSegment({v0:4,v1:5},{v0:0,v1:0}),n.addVertex(c,f),n.addVertex(r,f),n.addSegment({v0:6,v1:7},{v0:1,v1:2}),e!==`center`){let t=s[e];n.translate(t[0],t[1])}return n}export{o as PathProfile,l as circleProfiles,a as pathProfileUniformLayout,u as quadProfiles};
2
+ import{cyclical2PI as e}from"../../../../core/Cyclical.js";import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{exactEquals as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as r,clone as i,UNIT_X as a,ZEROS as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{pathNumJoinSubdivisions as s,pathNumCircleProfileSubdivisions as c}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{needsJoinSubdivisions as l,classificationTolerance as u}from"./pathGeometryUtils.js";const d=Math.acos(-2*u),f=c,p={0:{indexCount:f*2,poleCount:1,vertexCount:f},1:{indexCount:8,poleCount:4,vertexCount:8}};class m{constructor(e){this.type=e,this.vertices=[],this.normals=[],this.indices=[],this.poles=[],this.poleIndices=[],this.joinTriangleBudgets={0:{0:0,1:0,2:0},1:{0:0,1:0,2:0}}}addVertex(e,t){return this.vertices.push(i(e)),this.normals.push(i(t)),this.vertices.length-1}addPole(e,t=null){return this.poles.push({position:i(e),normal:t?i(t):null}),this.poles.length-1}addSegment(e,t=null){this.indices.push(e.v0),this.indices.push(e.v1),t&&(this.poleIndices.push(t.v0),this.poleIndices.push(t.v1))}get numSegments(){return this.indices.length/2}translate(e,t){for(let n of this.vertices)n[0]+=e,n[1]+=t;for(let n of this.poles)n.position[0]+=e,n.position[1]+=t}get usedMemory(){return this.vertices.length*t(this.vertices[0])*2+t(this.indices)}}const h={top:[0,-.5],bottom:[0,.5]};function g(e){let t=.5,n=c,i=new m(0),a={v0:0,v1:0};i.addPole(r(0,0));for(let e=0;e<n;++e){let a=e*2*Math.PI/n,o=Math.cos(a),s=Math.sin(a),c=r(o*t,s*t),l=r(o,s);i.addVertex(c,l)}for(let e=0;e<n-1;++e){let t={v0:e,v1:e+1};i.addSegment(t,a)}let o={v0:n-1,v1:0};if(i.addSegment(o,a),e!==`center`){let t=h[e];i.translate(t[0],t[1])}return b(i,2)}const _={center:g(`center`),top:g(`top`),bottom:g(`bottom`)},v={center:y(`center`),top:y(`top`),bottom:y(`bottom`)};function y(e){let t=new m(1),n=r(-.5,-.5),i=r(.5,-.5),a=r(.5,.5),o=r(-.5,.5),s=r(0,-1),c=r(1,0),l=r(0,1),u=r(-1,0);if(t.addPole(r(0,.5),l),t.addPole(r(0,.5)),t.addPole(r(0,-.5)),t.addPole(r(0,-.5),s),t.addVertex(n,s),t.addVertex(i,s),t.addSegment({v0:0,v1:1},{v0:3,v1:3}),t.addVertex(i,c),t.addVertex(a,c),t.addSegment({v0:2,v1:3},{v0:2,v1:1}),t.addVertex(a,l),t.addVertex(o,l),t.addSegment({v0:4,v1:5},{v0:0,v1:0}),t.addVertex(o,u),t.addVertex(n,u),t.addSegment({v0:6,v1:7},{v0:1,v1:2}),e!==`center`){let n=h[e];t.translate(n[0],n[1])}return b(t,1)}function b(e,t){let n=x(e,t),r=S(e,t);return e.joinTriangleBudgets={0:{0:n,1:n,2:s*n},1:{0:r,1:r,2:s*r}},e}function x(e,t){let n=0,r=0;for(let i=0;i<e.vertices.length;++i){let o=e.vertices[i];n+=l(o,a,1)?t:0,r+=l(o,a,-1)?t:0}return Math.max(n,r)}function S(t,r){let i=[],a=0;for(let s=0;s<t.vertices.length;++s){let c=t.vertices[s];if(n(c,o))continue;let l=Math.atan2(c[1],c[0]),u=e.normalize(l-d,0,!0),f=e.normalize(l+d,0,!0);i.push({angle:u,diff:r},{angle:f,diff:-r}),u>f&&(a+=r)}i.sort((e,t)=>e.angle-t.angle||t.diff-e.diff);let s=a;for(let e of i)a+=e.diff,s=Math.max(s,a);return s}export{m as PathProfile,_ as circleProfiles,p as pathProfileUniformLayout,v as quadProfiles};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{copy as e,set as t,add as n,length as r,normalize as i,cross as a}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as s,fromPositionAndNormal as c,intersectRay as l}from"../../../../geometry/support/plane.js";import{wrap as u}from"../../../../geometry/support/ray.js";import{makeOrthoBasisDirUpFallback as d}from"./GeometryUtil.js";function f(f,m){let h=null,g=f.vertices.length,_=.99619469809,v=o(),y=o(),b=o(),x=o(),S=o(),C=o(),w=s(),T=f.vertices[0];e(y,m),t(v,0,1,0),d(T.vRight,y,v,v,b,y,_),e(T.frame.up,y),e(T.frame.right,b);let E=f.positions,D=f.offset;h=T;for(let o=1;o<g;++o){T=f.vertices[o],n(S,T.vLeft,T.vRight);let s=r(S);s>0?(s=1/Math.sqrt(s),S[0]*=s,S[1]*=s,S[2]*=s):(S[0]=T.vRight[0],S[1]=T.vRight[1],S[2]=T.vRight[2]),C[0]=E[D]+h.frame.up[0],C[1]=E[D+1]+h.frame.up[1],C[2]=E[D+2]+h.frame.up[2],D+=3;let m=t(p,E[D],E[D+1],E[D+2]);c(m,S,w),l(w,u(C,T.vLeft),x)?(x[0]-=E[D],x[1]-=E[D+1],x[2]-=E[D+2],i(y,x),a(b,S,y),i(b,b)):d(S,h.frame.up,h.frame.right,v,b,y,_),e(T.frame.up,y),e(T.frame.right,b),h=T}}const p=o();export{f as computeMinimumRotationTangentFrame};
2
+ import{set as e,exactEquals as t,dot as n,length as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as i}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{dot as a,scale as o,add as s,normalize as c,copy as l,set as u,length as d,cross as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,fromPositionAndNormal as h,intersectRay as g}from"../../../../geometry/support/plane.js";import{wrap as _}from"../../../../geometry/support/ray.js";import{makeOrthoBasisDirUpFallback as v}from"./GeometryUtil.js";function y(e,t){let n=null,r=e.vertices.length,i=.99619469809,a=p(),o=p(),y=p(),b=p(),x=p(),S=p(),C=m(),T=e.vertices[0];l(o,t),u(a,0,1,0),v(T.vRight,o,a,a,y,o,i),l(T.frame.up,o),l(T.frame.right,y);let E=e.positions,D=e.offset;n=T;for(let t=1;t<r;++t){T=e.vertices[t],s(x,T.vLeft,T.vRight);let r=d(x);r>0?(r=1/Math.sqrt(r),x[0]*=r,x[1]*=r,x[2]*=r):(x[0]=T.vRight[0],x[1]=T.vRight[1],x[2]=T.vRight[2]),S[0]=E[D]+n.frame.up[0],S[1]=E[D+1]+n.frame.up[1],S[2]=E[D+2]+n.frame.up[2],D+=3;let p=u(w,E[D],E[D+1],E[D+2]);h(p,x,C),g(C,_(S,T.vLeft),b)?(b[0]-=E[D],b[1]-=E[D+1],b[2]-=E[D+2],c(o,b),f(y,x,o),c(y,y)):v(x,n.frame.up,n.frame.right,a,y,o,i),l(T.frame.up,o),l(T.frame.right,y),n=T}}const b=.001;function x(t,n,r,i){if(!i)return e(t,1,0);let l=a(r,n.up),u=a(r,n.right);return o(w,n.right,l),o(T,n.up,-u),s(w,w,T),c(w,w),e(t,a(w,n.right),a(w,n.up))}function S(e,t,i,a=0){return n(e,t)*Math.sign(i)>=-a*r(e)}function C(e,n,r){return r!==0&&!t(e,i)&&S(e,n,r,b)}const w=p(),T=p();export{b as classificationTolerance,y as computeMinimumRotationTangentFrame,x as constructPathRotationRight,S as isOuterJoinVertex,C as needsJoinSubdivisions};