@arcgis/core 5.0.0-next.121 → 5.0.0-next.123

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 (241) hide show
  1. package/applications/Components/SketchTooltipControls.d.ts +3 -2
  2. package/applications/Components/SketchTooltipControls.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/0184b4c0c92c76c60ab2.js +1 -0
  5. package/assets/esri/core/workers/chunks/{56a296cb5c1ae1ea5ab2.js → 08616877b58b518e7461.js} +1 -1
  6. package/assets/esri/core/workers/chunks/089cef7124173a5cd5f9.js +1 -0
  7. package/assets/esri/core/workers/chunks/{4d438627dd3509f65d5a.js → 0baa0d66003d23cc76a7.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0e216f0075fd531c3a2b.js +1 -0
  9. package/assets/esri/core/workers/chunks/{d5314786df52b6be5307.js → 0e6ffb02a929130ddb50.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{4cb702d574c100483226.js → 0e8b4543e895b615c254.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{ae0a555b047b11aa68eb.js → 1219b588f983b4f35033.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{41fe4d8fe97388498f73.js → 13512a23655258fa77f4.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{ee34f14bbfe619b85a80.js → 13e913aa5f5113fceb16.js} +1 -1
  14. package/assets/esri/core/workers/chunks/1458ef3857be3b76be95.js +1 -0
  15. package/assets/esri/core/workers/chunks/{d621cdd0aef6d77986f0.js → 1469e6d1d0d4e310b8f8.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{b9e90875943703486227.js → 15ba0296403dd4152b88.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{7595c52b1647f092c61a.js → 16abc548724e428c325a.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{dddcae86e434d93b10c0.js → 189e22df73414a1a3989.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{90aeef17af12cfbecb36.js → 1d124a55f6804be19e09.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{63831996ad82bd3b1ca9.js → 1e29a114c1cfe21121c4.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{153a9d087e0fe7072af4.js → 1ede5fa7a16839ed9444.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{6b1e1fb4e9010873c171.js → 1f30558e3ad6ac68bdb8.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{9c06b803912fcafa7f52.js → 24dd404612c35f6a3fc3.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{b6e155b42a4a423139e7.js → 27d1f8279df34d8b15b5.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{401af6d07c9f458ae067.js → 2c69d8bb1c950b95278d.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{22d12c309af9c19a1a48.js → 2c7e5b78d94e5850537b.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{120a5fa9b46084cd0c45.js → 2d376f82cdf020e1fca9.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{8c321c6bc344544ebb51.js → 2d52b137ee64469a46b2.js} +1 -1
  29. package/assets/esri/core/workers/chunks/2d67ab4927a968d5c8d4.js +1 -0
  30. package/assets/esri/core/workers/chunks/{5b3f2bad61a0d993bf16.js → 2e63e18df96e5a2461de.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{d4da3abbd3d88cd63cb9.js → 454150571b5b664b576a.js} +1 -1
  32. package/assets/esri/core/workers/chunks/4740d319f233b7f528fe.js +1 -0
  33. package/assets/esri/core/workers/chunks/{78ce6fcb72e97d3dc087.js → 499d594dc0d282dfe777.js} +1 -1
  34. package/assets/esri/core/workers/chunks/49d58bacb5b397246978.js +1 -0
  35. package/assets/esri/core/workers/chunks/4ba4aa6c75e3f8950e65.js +1 -0
  36. package/assets/esri/core/workers/chunks/{61ce373f00a0cad113ed.js → 4f2c29168c9de0b08741.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{5789898948cc0da78b8b.js → 552e5c413828e181f89a.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{5210bde0a05ab172ab28.js → 59f955c7d6b0589e7cc6.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{5fe0bed2a0a9f8eadb28.js → 5a347b1d87eb6f710136.js} +1 -1
  40. package/assets/esri/core/workers/chunks/5b97cdeb5949822fbef3.js +1 -0
  41. package/assets/esri/core/workers/chunks/{178c91fabf4a87bbb50b.js → 620d7cd0b0885122aa0f.js} +1 -1
  42. package/assets/esri/core/workers/chunks/6321680c8070dffa3b6c.js +1 -0
  43. package/assets/esri/core/workers/chunks/6997b4d5bcc9c4755375.js +1 -0
  44. package/assets/esri/core/workers/chunks/{b79cceeee3ed46f218a0.js → 69ab42b965bccc3bad4f.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{bb4c75479cfea67cf8a2.js → 6af14a0217077d9ab47f.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{672542d0435fbfd0647c.js → 6b3d8280a24f7a3aac40.js} +1 -1
  47. package/assets/esri/core/workers/chunks/6e0cfb76f9c2a9ec6530.js +1 -0
  48. package/assets/esri/core/workers/chunks/6e8989d61204b0b5ff52.js +1 -0
  49. package/assets/esri/core/workers/chunks/{3d78e9b3c97c0ce21d16.js → 7017c2e621236c7a7da4.js} +1 -1
  50. package/assets/esri/core/workers/chunks/7407a1e0cef508116a0b.js +1 -0
  51. package/assets/esri/core/workers/chunks/{da188d0e22ba1639928e.js → 75907e5d009b71ce723b.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{1ab4289195f5e46c6fe8.js → 78936c591fd49ff955a9.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{f0b8de5b3cfbe9223df6.js → 796f5265747ce8be910e.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{ac62411b9b4cf85a4722.js → 7a037fbfd91dd22e3bf0.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{50661f65a9c191f528bc.js → 7ee7529fcbd0d169047c.js} +1 -1
  56. package/assets/esri/core/workers/chunks/7f9b0ef7f9b3f3fd3df9.js +1 -0
  57. package/assets/esri/core/workers/chunks/804c31973f7d116523cb.js +1 -0
  58. package/assets/esri/core/workers/chunks/{82a446e8befe9d29c8f0.js → 822a115c7d718e4e3d2b.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{6789ddaa61e6d8f20d04.js → 8eea620f770576d18809.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{10c4f5afe14c0addc418.js → 9332db133a0925d522fe.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{bc87890d00d6dba979b2.js → 99c9f35a29f9f6c9e4ce.js} +1 -1
  62. package/assets/esri/core/workers/chunks/a4b422dbb6d3cb2505e1.js +1 -0
  63. package/assets/esri/core/workers/chunks/{455fbddd814e4681f0c0.js → a5e91cf150f6cf6a5d2a.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{eb4a2dc5efdb873a7f25.js → aef2832902b270f1a594.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{b5fc0a2480a229e8891a.js → b5f291e8ed7f7cac158d.js} +1 -1
  66. package/assets/esri/core/workers/chunks/bc32a4baeb0ecabb68cc.js +1 -0
  67. package/assets/esri/core/workers/chunks/bd05e68b00b9878d0266.js +1 -0
  68. package/assets/esri/core/workers/chunks/{9a43065e51df9c21c9fa.js → bdb4f216ae8881b98604.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{bf9b2aa2e67ca746ec7c.js → c15f0769a64863cccef0.js} +1 -1
  70. package/assets/esri/core/workers/chunks/c6e0ada6f2ad74fddfec.js +1 -0
  71. package/assets/esri/core/workers/chunks/cf09408cb7729126caae.js +1 -0
  72. package/assets/esri/core/workers/chunks/e0565849281ffbe8269e.js +1 -0
  73. package/assets/esri/core/workers/chunks/{4ef60a76eeca20bcafb1.js → e4f1e584f89ffb86206b.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{2889e782ed81bb05b9e5.js → e508f8e707eb3207cfcc.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{2216264b22a605a0f1ce.js → e60684918100666bb892.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{4550b7620932cd6de20e.js → e94448b371cd17d7a472.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{bb8530ade7c40a1ed7c4.js → eb9e913fe0dfcc71cf92.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{8f26e93eb539ee66c5ac.js → ec2dfd89e4ce6fda4971.js} +1 -1
  79. package/assets/esri/core/workers/chunks/ede1d1cc2f315a34f4ca.js +1 -0
  80. package/assets/esri/core/workers/chunks/{a5bd7e5d71cffde68f89.js → ee89564d11c077169b31.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{b3cc7f6d953bfbc3a70d.js → f62e37863a549f72093c.js} +1 -1
  82. package/assets/esri/core/workers/chunks/fc98b8351be567d3eb62.js +1 -0
  83. package/assets/esri/core/workers/chunks/{554f389f99db430b309c.js → ff961bb6d29ab3fe129d.js} +1 -1
  84. package/assets/esri/themes/base/widgets/_Attribution.scss +4 -2
  85. package/assets/esri/themes/dark/main.css +1 -1
  86. package/assets/esri/themes/light/main.css +1 -1
  87. package/assets/esri/themes/light/view.css +1 -1
  88. package/config.js +1 -1
  89. package/core/Logger.js +1 -1
  90. package/core/deprecate.js +1 -1
  91. package/core/has.js +1 -1
  92. package/core/types.d.ts +5 -0
  93. package/core/workers/workerFactory.js +1 -1
  94. package/editing/sharedTemplates/executor/builders/radialLines.js +1 -1
  95. package/editing/sharedTemplates/executor/builders/support/shapeUtils.js +1 -1
  96. package/geometry/projectionUtils.js +1 -1
  97. package/geometry/support/curves/curveUtils.js +1 -1
  98. package/kernel.js +1 -1
  99. package/layers/ImageryLayer.d.ts +1 -1
  100. package/layers/MapImageLayer.d.ts +1 -1
  101. package/layers/TileLayer.d.ts +1 -1
  102. package/layers/WebTileLayer.d.ts +1 -1
  103. package/layers/graphics/data/QueryEngineResult.js +1 -1
  104. package/layers/graphics/data/SnappingCandidate.js +1 -1
  105. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  106. package/layers/orientedImagery/transformations/utils.js +1 -1
  107. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  108. package/layers/support/ControlPointsGeoreference.d.ts +2 -2
  109. package/layers/support/ControlPointsGeoreference.js +1 -1
  110. package/layers/support/CornersGeoreference.d.ts +2 -2
  111. package/layers/support/CornersGeoreference.js +1 -1
  112. package/layers/support/ExtentAndRotationGeoreference.d.ts +2 -2
  113. package/layers/support/ExtentAndRotationGeoreference.js +1 -1
  114. package/layers/support/GeoreferenceBaseMixin.js +2 -0
  115. package/layers/support/mediaUtils.js +1 -1
  116. package/layers/support/relativeTimeQueryUtils.js +1 -1
  117. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  118. package/package.json +1 -1
  119. package/renderers/DotDensityRenderer.d.ts +43 -0
  120. package/renderers/DotDensityRenderer.js +1 -1
  121. package/rest/featureService/FeatureService.js +1 -1
  122. package/rest/print.js +1 -1
  123. package/rest/query/operations/pbfFlatFeatureSet.js +1 -1
  124. package/support/basemapUtils.js +1 -1
  125. package/support/revision.js +1 -1
  126. package/symbols/ExtrudeSymbol3DLayer.d.ts +20 -10
  127. package/symbols/FillSymbol3DLayer.d.ts +36 -16
  128. package/symbols/ObjectSymbol3DLayer.d.ts +28 -6
  129. package/symbols/PathSymbol3DLayer.d.ts +18 -6
  130. package/symbols/cim/CIMSymbolHelper.js +1 -1
  131. package/symbols/cim/rasterizingUtils.js +1 -1
  132. package/symbols/support/Symbol3DEmissive.d.ts +9 -9
  133. package/symbols/support/Symbol3DMaterial.d.ts +8 -8
  134. package/time/TimeExtent.d.ts +1 -1
  135. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  136. package/views/2d/interactive/SnappingVisualizer2D.js +1 -1
  137. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  138. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  139. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  140. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  141. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  142. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  143. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  144. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  145. package/views/2d/layers/features/sources/strategies/FeaturePagedTileLoadStrategy.js +1 -1
  146. package/views/2d/layers/features/sources/strategies/FeatureSnapshotLoadStrategy.js +1 -1
  147. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  148. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  149. package/views/2d/layers/support/RouteLayerWaypointVisualization.js +1 -1
  150. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  151. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  152. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  153. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  154. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  155. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  156. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  157. package/views/Attribution.js +1 -1
  158. package/views/DOMContainer.js +1 -1
  159. package/views/LinkChartView.d.ts +1 -1
  160. package/views/MapView.d.ts +1 -1
  161. package/views/SceneView.d.ts +1 -1
  162. package/views/View.d.ts +1 -1
  163. package/views/input/types.d.ts +1 -1
  164. package/views/interactive/keybindings.js +1 -1
  165. package/views/interactive/snapping/candidates/EdgeSnappingCandidate.js +1 -1
  166. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  167. package/views/interactive/snapping/featureSources/queryEngineUtils.js +1 -1
  168. package/views/interactive/snapping/featureSources/snappingCandidateElevationAlignment.js +1 -1
  169. package/views/interactive/snapping/featureSources/snappingCandidateElevationFilter.js +1 -1
  170. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  171. package/views/layers/FeatureLikeLayerView.js +1 -1
  172. package/views/layers/support/WhereClauseVisitor.js +1 -1
  173. package/views/ui/DefaultUI.d.ts +5 -12
  174. package/views/ui/DefaultUI.js +1 -1
  175. package/views/ui/types.d.ts +1 -1
  176. package/webscene/Glow.d.ts +5 -0
  177. package/webscene/SunLighting.d.ts +20 -2
  178. package/webscene/VirtualLighting.d.ts +20 -2
  179. package/widgets/Attribution/AttributionViewModel.d.ts +1 -1
  180. package/widgets/Attribution.d.ts +1 -1
  181. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  182. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  183. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +1 -1
  184. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  185. package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +2 -11
  186. package/widgets/BatchAttributeForm/inputs/TextElementInput.js +1 -1
  187. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  188. package/widgets/BatchAttributeForm/inputs/support/textElementInputUtils.js +2 -0
  189. package/widgets/BatchAttributeForm/templates/TextElementTemplate.js +1 -1
  190. package/widgets/BatchAttributeForm/templates/support/constants.js +2 -0
  191. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  192. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  193. package/widgets/BatchAttributeForm/templates/support/textElementTemplateUtils.js +2 -0
  194. package/widgets/Editor/components/Settings.js +1 -1
  195. package/widgets/Features/FeaturesViewModel.js +1 -1
  196. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  197. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  198. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  199. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  200. package/widgets/OrientedImageryViewer/services/TransformationService.js +1 -1
  201. package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
  202. package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
  203. package/widgets/OrientedImageryViewer/support/urlUtils.js +1 -1
  204. package/widgets/OrientedImageryViewer/utils.js +1 -1
  205. package/widgets/OrientedImageryViewer.js +1 -1
  206. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  207. package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
  208. package/widgets/Print/PrintViewModel.js +1 -1
  209. package/widgets/Sketch.js +1 -1
  210. package/widgets/TimeSlider/TimeSliderViewModel.d.ts +1 -2
  211. package/widgets/TimeSlider.d.ts +5 -6
  212. package/widgets/support/SketchTooltipControls.js +1 -1
  213. package/assets/esri/core/workers/chunks/00112f984698b31909d3.js +0 -1
  214. package/assets/esri/core/workers/chunks/0c8a676599821b9871c2.js +0 -1
  215. package/assets/esri/core/workers/chunks/2b7615cccbaeda1649f3.js +0 -1
  216. package/assets/esri/core/workers/chunks/2f0ea91afc9aa8ee9cad.js +0 -1
  217. package/assets/esri/core/workers/chunks/3a850b5e847b6b0ea53f.js +0 -1
  218. package/assets/esri/core/workers/chunks/449cf6ae6b6e6c2795e5.js +0 -1
  219. package/assets/esri/core/workers/chunks/4dcd5d5ea5875a08a7c7.js +0 -1
  220. package/assets/esri/core/workers/chunks/5058715f32ff026053a9.js +0 -1
  221. package/assets/esri/core/workers/chunks/529dbf16ffbbd39f3fa2.js +0 -1
  222. package/assets/esri/core/workers/chunks/58cf3d35771b87bd74e5.js +0 -1
  223. package/assets/esri/core/workers/chunks/652bb1b53782cdd3103c.js +0 -1
  224. package/assets/esri/core/workers/chunks/6acab23acf3b044f5215.js +0 -1
  225. package/assets/esri/core/workers/chunks/6c2a7bac3f8e32c83292.js +0 -1
  226. package/assets/esri/core/workers/chunks/6d26e5368e8952003669.js +0 -1
  227. package/assets/esri/core/workers/chunks/7cb6ccee9bcef449caea.js +0 -1
  228. package/assets/esri/core/workers/chunks/879e8439a513cb333b61.js +0 -1
  229. package/assets/esri/core/workers/chunks/98c3b7d8db53f0b12642.js +0 -1
  230. package/assets/esri/core/workers/chunks/a027da22acdaa6d6baa3.js +0 -1
  231. package/assets/esri/core/workers/chunks/a6006718fe22d9f2fa87.js +0 -1
  232. package/assets/esri/core/workers/chunks/b60337c471e2b855d02a.js +0 -1
  233. package/assets/esri/core/workers/chunks/bd1bbf1820e12d7a27f6.js +0 -1
  234. package/assets/esri/core/workers/chunks/c88101cb8301f095d037.js +0 -1
  235. package/assets/esri/core/workers/chunks/c9067667290e93407dd7.js +0 -1
  236. package/assets/esri/core/workers/chunks/e59c5bcf91984aa5be6d.js +0 -1
  237. package/assets/esri/core/workers/chunks/e71d08c6f545c2c70174.js +0 -1
  238. package/assets/esri/core/workers/chunks/f347dee99faa9ee5eef1.js +0 -1
  239. package/layers/support/GeoreferenceBase.d.ts +0 -4
  240. package/layers/support/GeoreferenceBase.js +0 -2
  241. package/widgets/BatchAttributeForm/inputs/support/textInputElementUtils.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import e from"../../../../../core/Error.js";import{hasTimeOptions as r}from"../../../../../layers/support/timeSupport.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as n,createLabelVVEvaluator as s}from"./labelingUtils.js";import{ExceedsLimitCache as a}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as p}from"../support/rendererUtils.js";function c(r){if(!("openPorts"in r))throw new e("featurelayer:source-not-supported","source is not supported")}class d{constructor(e){this.layer=e,this._cache=new a}openMessagePorts(){return c(this.layer.source),this.layer.source.openPorts()}getLabelingDeconflictionInfo(e){const r=this.layer,i=o(r,e)??n(r),a=t(r,e),l=[...r.labelingInfo||[],...a?.labelingInfo||[]];return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:i,labelingInfo:l}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return l(t,null,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:"timeExtent"in this.layer?this.layer.timeExtent:null,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:o,renderer:n,geometryType:s,labelingInfo:a,labelsVisible:l,orderBy:p,objectIdField:c}=this.layer,d="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:o.map(e=>e.toJSON()),renderer:n?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:s,labelingInfo:a,labelsVisible:l,objectIdField:c,orderBy:p??"default",trackInfo:d};return u(e,r,y,i)}get hasRequiredSupport(){return p(this.layer.renderer)}get timeOptions(){return r(this.layer)?this.layer:null}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){"trackGraphicOrigin"in this.layer&&(e.origin=this.layer.trackGraphicOrigin)}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:o}=r,n=r.fieldsIndex.toJSON(),s=i(r),a="timeInfo"in r?r.timeInfo?.toJSON():null,l=r.spatialReference.toJSON();c(r.source);const u=o,p=e.spatialReference.toJSON();return{type:"memory",orderByFields:u,outSpatialReference:p,metadata:{fieldsIndex:n,geometryType:s,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},timeInfo:a,spatialReference:l,outSpatialReference:p,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in r?r.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in r?r.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{d as InMemoryLayerAdapter};
2
+ import e from"../../../../../core/Error.js";import{hasTimeOptions as r}from"../../../../../layers/support/timeSupport.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as n,createLabelVVEvaluator as a}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as p}from"../support/rendererUtils.js";function c(r){if(!("openPorts"in r))throw new e("featurelayer:source-not-supported","source is not supported")}class d{constructor(e){this.layer=e,this._cache=new s}openMessagePorts(){return c(this.layer.source),this.layer.source.openPorts()}getLabelingDeconflictionInfo(e){const r=this.layer,i=o(r,e)??n(r),s=t(r,e),l=[...r.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:a(r.renderer)},deconflictionEnabled:i,labelingInfo:l}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return l(t,null,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:"timeExtent"in this.layer?this.layer.timeExtent:null,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:o,renderer:n,geometryType:a,labelingInfo:s,labelsVisible:l,orderBy:p,objectIdField:c}=this.layer,d="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:o.map(e=>e.toJSON()),renderer:n?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:a,labelingInfo:s,labelsVisible:l,objectIdField:c,orderBy:p??"default",trackInfo:d};return u(e,r,y,i)}get hasRequiredSupport(){return p(this.layer.renderer)}get timeOptions(){return r(this.layer)?this.layer:null}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){"trackGraphicOrigin"in this.layer&&(e.origin=this.layer.trackGraphicOrigin)}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:o}=r,n=r.fieldsIndex.toJSON(),a=i(r),s="timeInfo"in r?r.timeInfo?.toJSON():null,l=r.spatialReference.toJSON();c(r.source);const u=o,p=e.spatialReference.toJSON();return{type:"memory",orderByFields:u,outSpatialReference:p,metadata:{fieldsIndex:n,geometryType:a,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},timeInfo:s,spatialReference:l,outSpatialReference:p,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in r?r.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in r?r.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{d as InMemoryLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{sqlAnd as e}from"../../../../../core/sql.js";import{systemIsSpatialFieldName as r}from"../../../../../layers/knowledgeGraph/constants.js";import t from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveFeatureReduction as i}from"./featureReductionUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as a,getLayerDeconflictionEnabled as o,createLabelVVEvaluator as l}from"./labelingUtils.js";import{ExceedsLimitCache as n}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as p}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e,this._cache=new n}getLabelingDeconflictionInfo(e){const r=this.layer,t=a(r,e)??o(r);return[{vvEvaluators:{0:l(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return p(t,null,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:null,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,t){const{fields:s,renderer:a,geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:p}=this.layer,c={fields:s.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:i(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:"default"};return u(e,r,c,t)}get hasRequiredSupport(){return c(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>i(this.layer,e),()=>y(this.layer)]}hasFilters(e){return y(this.layer)}addFilters(i,s){if(y(this.layer)){const s=e(i?.where,`${r}=1`);if(!s)return i;i??=new t,i.where=s}return i}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}openMessagePorts(){return this.layer.source.openPorts()}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:i}=r,a=r.fieldsIndex.toJSON(),o=s(r),l=r.spatialReference.toJSON(),n=i,p=e.spatialReference.toJSON();return{type:"memory",orderByFields:n,outSpatialReference:p,metadata:{fieldsIndex:a,geometryType:o,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},spatialReference:l,outSpatialReference:p,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:r.timeInfo?.toJSON(),timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}function y(e){return"link-chart"===e.parentCompositeLayer.type&&"hidden"===e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode}export{d as KnowledgeGraphSublayerAdapter};
2
+ import{sqlAnd as e}from"../../../../../core/sql.js";import{systemIsSpatialFieldName as r}from"../../../../../layers/knowledgeGraph/constants.js";import t from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveFeatureReduction as i}from"./featureReductionUtils.js";import{getServiceGeometryType as o}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as a,getLayerDeconflictionEnabled as s,createLabelVVEvaluator as l}from"./labelingUtils.js";import{ExceedsLimitCache as n}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as p}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e,this._cache=new n}getLabelingDeconflictionInfo(e){const r=this.layer,t=a(r,e)??s(r);return[{vvEvaluators:{0:l(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return p(t,null,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:null,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,t){const{fields:o,renderer:a,geometryType:s,labelingInfo:l,labelsVisible:n,objectIdField:p}=this.layer,c={fields:o.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:i(this.layer,r),geometryType:s,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:"default"};return u(e,r,c,t)}get hasRequiredSupport(){return c(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>i(this.layer,e),()=>y(this.layer)]}hasFilters(e){return y(this.layer)}addFilters(i,o){if(y(this.layer)){const o=e(i?.where,`${r}=1`);if(!o)return i;i??=new t,i.where=o}return i}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}openMessagePorts(){return this.layer.source.openPorts()}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:i}=r,a=r.fieldsIndex.toJSON(),s=o(r),l=r.spatialReference.toJSON(),n=i,p=e.spatialReference.toJSON();return{type:"memory",orderByFields:n,outSpatialReference:p,metadata:{fieldsIndex:a,geometryType:s,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},spatialReference:l,outSpatialReference:p,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:r.timeInfo?.toJSON(),timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}function y(e){return"link-chart"===e.parentCompositeLayer.type&&"hidden"===e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode}export{d as KnowledgeGraphSublayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as o}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as u}from"../support/rendererUtils.js";class c{constructor(e){this.layer=e,this._cache=new s}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??a(r);return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:t,labelingInfo:r.labelingInfo}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return l(t,null,{definitionExpression:null,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,t,i){const{fields:a,renderer:o,geometryType:s,labelingInfo:l,labelsVisible:u,orderBy:c,objectIdField:p}=this.layer,d={fields:a.map(e=>e.toJSON()),renderer:o?.clone(),labelingInfoSource:this.layer.id,featureReduction:r(this.layer,t),geometryType:s,labelingInfo:l,labelsVisible:u,objectIdField:p,orderBy:c??"default"};return n(e,t,d,i)}get hasRequiredSupport(){return u(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>r(this.layer,e),()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.renderer]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:a}=i,o=i.fieldsIndex.toJSON(),s=t(i),l=i.timeInfo?.toJSON(),n=i.spatialReference.toJSON(),u=i.source.getSource(),c=this.layer.objectIdField,p=e(a);p.query.maxRecordCount=u.maxRecordCount;const d=r.spatialReference.toJSON();return{type:"ogc",source:u,orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:o,geometryType:s,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:l,spatialReference:n,outSpatialReference:d,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:p.query.maxRecordCount,supportsCompactGeometry:p.query.supportsCompactGeometry,supportsDefaultSpatialReference:p.query.supportsDefaultSpatialReference,supportsFormatPBF:p.query.supportsFormatPBF,supportsMaxRecordCountFactor:p.query.supportsMaxRecordCountFactor,supportsQuantization:p.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:p.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:p.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{c as OGCFeatureLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as o}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as u}from"../support/rendererUtils.js";class c{constructor(e){this.layer=e,this._cache=new s}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??a(r);return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:t,labelingInfo:r.labelingInfo}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return l(t,null,{definitionExpression:null,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,t,i){const{fields:a,renderer:o,geometryType:s,labelingInfo:l,labelsVisible:u,orderBy:c,objectIdField:p}=this.layer,d={fields:a.map(e=>e.toJSON()),renderer:o?.clone(),labelingInfoSource:this.layer.id,featureReduction:r(this.layer,t),geometryType:s,labelingInfo:l,labelsVisible:u,objectIdField:p,orderBy:c??"default"};return n(e,t,d,i)}get hasRequiredSupport(){return u(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>r(this.layer,e),()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.renderer]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:a}=i,o=i.fieldsIndex.toJSON(),s=t(i),l=i.timeInfo?.toJSON(),n=i.spatialReference.toJSON(),u=i.source.getSource(),c=this.layer.objectIdField,p=e(a);p.query.maxRecordCount=u.maxRecordCount;const d=r.spatialReference.toJSON();return{type:"ogc",source:u,orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:o,geometryType:s,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:l,spatialReference:n,outSpatialReference:d,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:p.query.maxRecordCount,tileMaxRecordCount:p.query.tileMaxRecordCount,supportsCompactGeometry:p.query.supportsCompactGeometry,supportsDefaultSpatialReference:p.query.supportsDefaultSpatialReference,supportsFormatPBF:p.query.supportsFormatPBF,supportsMaxRecordCountFactor:p.query.supportsMaxRecordCountFactor,supportsQuantization:p.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:p.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:p.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{c as OGCFeatureLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{addFloorFilter as i,hasFloorFilter as s}from"./floorFilterUtils.js";import{getServiceGeometryType as a}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as n}from"./labelingUtils.js";import{ExceedsLimitCache as p}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as d,createFeatureSourceSchema as c}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as y}from"../support/rendererUtils.js";class m{constructor(e){this.layer=e,this._cache=new p}getLabelingDeconflictionInfo(e){const r=this.layer,t=o(r,e)??l(r);return[{vvEvaluators:{0:n(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=null!=this.layer.editingInfo?.lastEditDate,s=this.layer.refreshInterval>0,a=!i&&s,o=d(t.isSourceHosted,a,this.layer.capabilities,t.metadata.geometryType,e.extent,this.layer.fullExtent);return c(t,o,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:s,renderer:a,geometryType:o,labelingInfo:l,labelsVisible:n,orderBy:p,objectIdField:d}=this.layer,c={fields:s.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:d,orderBy:p??"default"};return u(e,r,c,i)}get hasRequiredSupport(){return y(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return i(this.layer,e,r)}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.orderBy,()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>s(this.layer,e)?e.floors:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(t){const i=this.layer,{capabilities:s,globalIdField:o,orderBy:l}=i,n=i.fieldsIndex.toJSON(),p=a(i),d=i.timeInfo?.toJSON(),c=i.spatialReference.toJSON(),u=e(this.layer.parsedUrl);let y=this.layer.objectIdField;if(l?.length){const e=!l[0].valueExpression&&l[0].field;e&&(y=e)}const m=r(u.path),h=t.spatialReference.toJSON();return{type:"feature-service",source:u,isSourceHosted:m,orderByFields:y,outSpatialReference:h,metadata:{globalIdField:o,fieldsIndex:n,geometryType:p,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:d,spatialReference:c,outSpatialReference:h,timeReferenceUnknownClient:i.datesInUnknownTimezone,dateFieldsTimeZone:i.dateFieldsTimeZone,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:s.query.maxRecordCount,supportsCompactGeometry:s.query.supportsCompactGeometry,supportsDefaultSpatialReference:s.query.supportsDefaultSpatialReference,supportsFormatPBF:s.query.supportsFormatPBF,supportsMaxRecordCountFactor:s.query.supportsMaxRecordCountFactor,supportsQuantization:s.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:s.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:s.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{m as OrientedImageryLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{addFloorFilter as i,hasFloorFilter as a}from"./floorFilterUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as n}from"./labelingUtils.js";import{ExceedsLimitCache as d}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as c}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as y}from"../support/rendererUtils.js";class m{constructor(e){this.layer=e,this._cache=new d}getLabelingDeconflictionInfo(e){const r=this.layer,t=o(r,e)??l(r);return[{vvEvaluators:{0:n(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=null!=this.layer.editingInfo?.lastEditDate,a=this.layer.refreshInterval>0,s=!i&&a,o=p(t.isSourceHosted,s,this.layer.capabilities,t.metadata.geometryType,e.extent,this.layer.fullExtent);return c(t,o,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:a,renderer:s,geometryType:o,labelingInfo:l,labelsVisible:n,orderBy:d,objectIdField:p}=this.layer,c={fields:a.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:d??"default"};return u(e,r,c,i)}get hasRequiredSupport(){return y(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return i(this.layer,e,r)}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.orderBy,()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>a(this.layer,e)?e.floors:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(t){const i=this.layer,{capabilities:a,globalIdField:o,orderBy:l}=i,n=i.fieldsIndex.toJSON(),d=s(i),p=i.timeInfo?.toJSON(),c=i.spatialReference.toJSON(),u=e(this.layer.parsedUrl);let y=this.layer.objectIdField;if(l?.length){const e=!l[0].valueExpression&&l[0].field;e&&(y=e)}const m=r(u.path),h=t.spatialReference.toJSON();return{type:"feature-service",source:u,isSourceHosted:m,orderByFields:y,outSpatialReference:h,metadata:{globalIdField:o,fieldsIndex:n,geometryType:d,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:p,spatialReference:c,outSpatialReference:h,timeReferenceUnknownClient:i.datesInUnknownTimezone,dateFieldsTimeZone:i.dateFieldsTimeZone,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,tileMaxRecordCount:a.query.tileMaxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{m as OrientedImageryLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as r}from"../../../../../core/mathUtils.js";import{sqlAnd as t}from"../../../../../core/sql.js";import{isHostedAgolService as i}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{canConvertSqlRelativeTime as s,sqlRelativeTimeToAbsolute as l}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{createFeatureIdInfo as o}from"./featureServiceUtils.js";import{addFloorFilter as n,hasFloorFilter as u}from"./floorFilterUtils.js";import{getServiceGeometryType as p}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as y}from"./labelingUtils.js";import{ExceedsLimitCache as c}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as m,createFeatureSourceSchema as d}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as f}from"../schema/processor/SubtypeProcessorSchema.js";class h{constructor(e){this.layer=e,this._cache=new c}getLabelingDeconflictionInfo(e){const r=this.layer;return[{vvEvaluators:{},deconflictionEnabled:r.sublayers.some(e=>y(e)),labelingInfo:r.sublayers.toArray().filter(e=>!!e.labelingInfo).flatMap(e=>e.labelingInfo)}]}async createSourceSchema(e,r){const{definitionExpression:t,customParameters:i,gdbVersion:a,historicMoment:o,timeExtent:n,apiKey:u,displayFilterInfo:p}=this.layer,y=this._createServiceInfo(e),c=null!=this.layer.editingInfo?.lastEditDate,f=this.layer.refreshInterval>0,h=!c&&f,b=m(y.isSourceHosted,h,this.layer.capabilities,y.metadata.geometryType,e.extent,this.layer.fullExtent),g=s(t)?await l(t,this.layer.capabilities.query.relativeTimeBinWindow):t;return d(y,b,{definitionExpression:g,postQueryFilter:t!==g?{where:t}:null,queryScaleRanges:this.layer.sublayers.items.map(e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale})),displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:p,customParameters:i,gdbVersion:a,historicMoment:o,timeExtent:n,apiKey:u,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const i={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e,r)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${r}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null}))};return f(e,r,i,t)}addFilters(e,r){e=n(this.layer,e,r);const i=this.layer.sublayers.filter(e=>!b(e,r)).map(e=>e.subtypeCode);if(!i.length)return e;e??=new a;const s=`NOT ${this.layer.subtypeField} IN (${i.join(",")})`;return e.where=t(e.where,s),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>u(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.sublayers.map(({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:a,maxScale:s})=>({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:a,maxScale:s}))]}setGraphicOrigin(e){const r=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=r,e.origin=r?.graphicOrigin}_createServiceInfo(r){const{capabilities:t,datesInUnknownTimezone:a,dateFieldsTimeZone:s,editingInfo:l,globalIdField:n,objectIdField:u,subtypeField:y}=this.layer,c=this.layer.fieldsIndex.toJSON(),m=p(this.layer),d=this.layer.timeInfo?.toJSON(),f=this.layer.spatialReference.toJSON(),h=e(this.layer.parsedUrl),b=u,g=i(h.path),S=r.spatialReference.toJSON();return{type:"feature-service",source:h,isSourceHosted:g,orderByFields:b,outSpatialReference:S,metadata:{timeReferenceUnknownClient:a,dateFieldsTimeZone:s,subtypeField:y,globalIdField:n,fieldsIndex:c,geometryType:m,featureIdInfo:o(this.layer),timeInfo:d,spatialReference:f,outSpatialReference:S,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:l?.lastEditDate?.getTime()}}}}function b(e,t){return e.visible&&(0===e.minScale||r(t.scale,e.minScale)||t.scale<e.minScale)&&(0===e.maxScale||r(t.scale,e.maxScale)||t.scale>e.maxScale)}export{h as SubtypeGroupLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as r}from"../../../../../core/mathUtils.js";import{sqlAnd as t}from"../../../../../core/sql.js";import{isHostedAgolService as i}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{canConvertSqlRelativeTime as s,sqlRelativeTimeToAbsolute as l}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{createFeatureIdInfo as o}from"./featureServiceUtils.js";import{addFloorFilter as n,hasFloorFilter as u}from"./floorFilterUtils.js";import{getServiceGeometryType as y}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as p}from"./labelingUtils.js";import{ExceedsLimitCache as c}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as m,createFeatureSourceSchema as d}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as f}from"../schema/processor/SubtypeProcessorSchema.js";class h{constructor(e){this.layer=e,this._cache=new c}getLabelingDeconflictionInfo(e){const r=this.layer;return[{vvEvaluators:{},deconflictionEnabled:r.sublayers.some(e=>p(e)),labelingInfo:r.sublayers.toArray().filter(e=>!!e.labelingInfo).flatMap(e=>e.labelingInfo)}]}async createSourceSchema(e,r){const{definitionExpression:t,customParameters:i,gdbVersion:a,historicMoment:o,timeExtent:n,apiKey:u,displayFilterInfo:y}=this.layer,p=this._createServiceInfo(e),c=null!=this.layer.editingInfo?.lastEditDate,f=this.layer.refreshInterval>0,h=!c&&f,b=m(p.isSourceHosted,h,this.layer.capabilities,p.metadata.geometryType,e.extent,this.layer.fullExtent),g=s(t)?await l(this.layer.fieldsIndex,t,this.layer.capabilities.query.relativeTimeBinWindow):t;return d(p,b,{definitionExpression:g,postQueryFilter:t!==g?{where:t}:null,queryScaleRanges:this.layer.sublayers.items.map(e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale})),displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:y,customParameters:i,gdbVersion:a,historicMoment:o,timeExtent:n,apiKey:u,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const i={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e,r)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${r}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null}))};return f(e,r,i,t)}addFilters(e,r){e=n(this.layer,e,r);const i=this.layer.sublayers.filter(e=>!b(e,r)).map(e=>e.subtypeCode);if(!i.length)return e;e??=new a;const s=`NOT ${this.layer.subtypeField} IN (${i.join(",")})`;return e.where=t(e.where,s),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>u(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.sublayers.map(({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:a,maxScale:s})=>({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:a,maxScale:s}))]}setGraphicOrigin(e){const r=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=r,e.origin=r?.graphicOrigin}_createServiceInfo(r){const{capabilities:t,datesInUnknownTimezone:a,dateFieldsTimeZone:s,editingInfo:l,globalIdField:n,objectIdField:u,subtypeField:p}=this.layer,c=this.layer.fieldsIndex.toJSON(),m=y(this.layer),d=this.layer.timeInfo?.toJSON(),f=this.layer.spatialReference.toJSON(),h=e(this.layer.parsedUrl),b=u,g=i(h.path),S=r.spatialReference.toJSON();return{type:"feature-service",source:h,isSourceHosted:g,orderByFields:b,outSpatialReference:S,metadata:{timeReferenceUnknownClient:a,dateFieldsTimeZone:s,subtypeField:p,globalIdField:n,fieldsIndex:c,geometryType:m,featureIdInfo:o(this.layer),timeInfo:d,spatialReference:f,outSpatialReference:S,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:l?.lastEditDate?.getTime()}}}}function b(e,t){return e.visible&&(0===e.minScale||r(t.scale,e.minScale)||t.scale<e.minScale)&&(0===e.maxScale||r(t.scale,e.maxScale)||t.scale>e.maxScale)}export{h as SubtypeGroupLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import has from"../../../../../core/has.js";import{sqlAnd as e}from"../../../../../core/sql.js";import t from"../../../../../geometry/SpatialReference.js";import{getClauseForScaleRange as r}from"../../../../../layers/support/displayFilterUtils.js";import a from"../../../../../rest/support/Query.js";import i from"../../../../../time/TimeExtent.js";const s=4;function o(e){switch(e.type){case"object-id":case"unique-id-simple":return`${e.fieldName} ASC`;case"unique-id-composite":return`${e.fieldNames.join(",")} ASC`}}function n(e,r,a){const s=o(a.featureIdInfo);return{returnCentroid:"esriGeometryPolygon"===a.serviceGeometryType&&!e.queryMetadata.supportsCentroidOnDegeneratedQuantizedGeometry&&!e.queryMetadata.supportsDegeneratedQuantizedGeometry,returnGeometry:!0,timeReferenceUnknownClient:a.timeReferenceUnknownClient??void 0,outSpatialReference:t.fromJSON(e.outSpatialReference),orderByFields:"memory"===e.type?[]:[s],where:r.definitionExpression??"1=1",outFields:r.availableFields,multipatchOption:"esriGeometryMultiPatch"===a.serviceGeometryType?"xyFootprint":null,gdbVersion:r.gdbVersion,historicMoment:r.historicMoment?new Date(r.historicMoment):null,timeExtent:r.timeExtent?i.fromJSON(r.timeExtent):null}}class u{static create(e,t,r){const a=t.queryScaleRanges,i=t.displayFilterInfo;return new u(n(e,t,r),i,a,r.subtypeField,t.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,a,i,s,o){this._queryParams=e,this._displayFilter=t,this._queryScaleRanges=r,this._subtypeField=a,this._customParameters=i,this._geometryType=s,this._queryMetadata=o}get pageSize(){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const e=this._queryMetadata.supportsMaxRecordCountFactor?s:null,t=(this._queryMetadata.maxRecordCount??8e3)*(e??1);return Math.min(8e3,t)}get objectIdsQueryPageSize(){return this._queryMetadata?.maxRecordCount??2e3}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t,r){if(!t.getSize())return null;const a=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(a.outFields??[])[0])return null;a.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),r=[];for(const a of e)t.hasField(a)||r.push(a);if(0===r.length)return null;a.outFields=r}a.returnGeometry=!1,a.returnCentroid=!1,a.quantizationParameters=null,a.cacheHint=!0;const i={inner:a,customParameters:this._customParameters};if(has("esri-tiles-debug")&&null!=r){const e=r.chunkId.toString().replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,chunkId:e}:{chunkId:e}}return i}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new a({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(t,a){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const i=this.createQuery(a),o=i.inner;if(this._queryScaleRanges?.length){const r=this._queryScaleRanges.filter(e=>(!e.minScale||e.minScale>=t.maxScale)&&(!e.maxScale||e.maxScale<=t.minScale)).map(e=>e.subtypeCode);if(r.length){const t=`${this._subtypeField} IN (${r})`;o.where=e(o.where,t)}}if(this._displayFilter&&(o.where=e(o.where,r(this._displayFilter,t.minScale,t.maxScale))),o.quantizationParameters=a.quantizationParameters??t.getQuantizationParameters(),o.resultType="tile",o.geometry=t.hydratedExtent,this._queryMetadata.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(o.maxAllowableOffset=t.resolution*has("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(o.maxAllowableOffset=t.resolution,"esriGeometryPolyline"===this._geometryType&&(o.maxAllowableOffset*=has("feature-polyline-generalization-factor"))),o.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,o.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(o.maxRecordCountFactor=s),has("esri-tiles-debug")){const e=t.id.replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,tileId:e}:{tileId:e}}return i}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e,t){const r=this.pageSize;return this.createQuery({start:r*e,num:r,returnExceededLimitFeatures:!0,maxRecordCountFactor:s,quantizationParameters:t,cacheHint:!0})}createObjectIdsQuery(e){return this.createQuery({objectIds:e,outFields:["*"]})}}export{u as FeatureSourceQueryInfo};
2
+ import has from"../../../../../core/has.js";import{sqlAnd as e}from"../../../../../core/sql.js";import t from"../../../../../geometry/SpatialReference.js";import{getClauseForScaleRange as r}from"../../../../../layers/support/displayFilterUtils.js";import a from"../../../../../rest/support/Query.js";import i from"../../../../../time/TimeExtent.js";const s=4;function o(e){switch(e.type){case"object-id":case"unique-id-simple":return`${e.fieldName} ASC`;case"unique-id-composite":return`${e.fieldNames.join(",")} ASC`}}function n(e,r,a){const s=o(a.featureIdInfo);return{returnCentroid:"esriGeometryPolygon"===a.serviceGeometryType&&!e.queryMetadata.supportsCentroidOnDegeneratedQuantizedGeometry&&!e.queryMetadata.supportsDegeneratedQuantizedGeometry,returnGeometry:!0,timeReferenceUnknownClient:a.timeReferenceUnknownClient??void 0,outSpatialReference:t.fromJSON(e.outSpatialReference),orderByFields:"memory"===e.type?[]:[s],where:r.definitionExpression??"1=1",outFields:r.availableFields,multipatchOption:"esriGeometryMultiPatch"===a.serviceGeometryType?"xyFootprint":null,gdbVersion:r.gdbVersion,historicMoment:r.historicMoment?new Date(r.historicMoment):null,timeExtent:r.timeExtent?i.fromJSON(r.timeExtent):null}}class u{static create(e,t,r){const a=t.queryScaleRanges,i=t.displayFilterInfo;return new u(n(e,t,r),i,a,r.subtypeField,t.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,a,i,s,o){this._queryParams=e,this._displayFilter=t,this._queryScaleRanges=r,this._subtypeField=a,this._customParameters=i,this._geometryType=s,this._queryMetadata=o}getPageSize(e){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const t=this._queryMetadata.supportsMaxRecordCountFactor?s:null,r=((e?this._queryMetadata.tileMaxRecordCount:this._queryMetadata.maxRecordCount)??this._queryMetadata.maxRecordCount??2e3)*(t??1),a=has("featurelayer-query-max-page-size")??8e3;return Math.min(a,r)}get objectIdsQueryPageSize(){return this._queryMetadata?.maxRecordCount??2e3}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t,r){if(!t.getSize())return null;const a=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(a.outFields??[])[0])return null;a.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),r=[];for(const a of e)t.hasField(a)||r.push(a);if(0===r.length)return null;a.outFields=r}a.returnGeometry=!1,a.returnCentroid=!1,a.quantizationParameters=null,a.cacheHint=!0;const i={inner:a,customParameters:this._customParameters};if(has("esri-tiles-debug")&&null!=r){const e=r.chunkId.toString().replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,chunkId:e}:{chunkId:e}}return i}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new a({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(t,a){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const i=this.createQuery(a),o=i.inner;if(this._queryScaleRanges?.length){const r=this._queryScaleRanges.filter(e=>(!e.minScale||e.minScale>=t.maxScale)&&(!e.maxScale||e.maxScale<=t.minScale)).map(e=>e.subtypeCode);if(r.length){const t=`${this._subtypeField} IN (${r})`;o.where=e(o.where,t)}}if(this._displayFilter&&(o.where=e(o.where,r(this._displayFilter,t.minScale,t.maxScale))),o.quantizationParameters=a.quantizationParameters??t.getQuantizationParameters(),o.resultType="tile",o.geometry=t.hydratedExtent,this._queryMetadata.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(o.maxAllowableOffset=t.resolution*has("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(o.maxAllowableOffset=t.resolution,"esriGeometryPolyline"===this._geometryType&&(o.maxAllowableOffset*=has("feature-polyline-generalization-factor"))),o.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,o.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(o.maxRecordCountFactor=s),has("esri-tiles-debug")){const e=t.id.replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,tileId:e}:{tileId:e}}return i}createPagedTileQuery(e,t){const r=this.getPageSize(!0);return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e,t){const r=this.getPageSize(!1);return this.createQuery({start:r*e,num:r,returnExceededLimitFeatures:!0,maxRecordCountFactor:s,quantizationParameters:t,cacheHint:!0})}createObjectIdsQuery(e){return this.createQuery({objectIds:e,outFields:["*"]})}}export{u as FeatureSourceQueryInfo};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{handlesGroup as e}from"../../../../../../core/handleUtils.js";import has from"../../../../../../core/has.js";import{getOrCreateMapValue as t}from"../../../../../../core/MapUtils.js";import{throwIfAborted as o,isAbortError as s,onAbort as r}from"../../../../../../core/promiseUtils.js";import{AFeatureTileLoadStrategy as a}from"./AFeatureTileLoadStrategy.js";import{PagedTileSourceChunk as i}from"./chunks/PagedTileSourceChunk.js";import{FeatureSetReaderJSON as n}from"../../support/FeatureSetReaderJSON.js";class l{constructor(t,o){this.subscription=t,this._pages=new Set,this._controller=new AbortController,this._done=!1,this._handles=e([r(t.signal,()=>this._controller.abort()),r(o,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let e=-1;for(const t of this._pages.values())e=Math.max(e,t);return e+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(e,t){this._pages.add(e),this._done=this._done||t}}class c extends a{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const e of this._loadStates.values())e.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){const o=t(this._loadStates,e.key.id,()=>new l(e,this._options));for await(const t of this._fetchPages(o))this._addChunk(t)}unload(e){super.unload(e),this._loadStates.get(e.key.id)?.destroy(),this._loadStates.delete(e.key.id)}async*_fetchPages(e){let t;try{for await(const t of this._concurrentPageStream(e))o(e.options),0!==t.size()&&(yield t)}catch(r){t=r}if(t&&s(t)||(yield new i(n.empty(this.metadata),null,e.subscription.tile,-1,!0)),t)throw t}async*_concurrentPageStream(e){const t=has("featurelayer-query-tile-concurrency"),o=this._pageStreamAll(e),s=[];let r=!1,a=1;for(;!r;){const e=[];for(;!r&&s.length<a;){const t=o.next();if(!t.value){r=!0;break}const a=t.value;a.then(e=>{e.reader.exceededTransferLimit||(r=!0)}).catch(e=>{r=!0}).finally(()=>{s.splice(s.indexOf(a),1)}),s.push(a),e.push(a)}for(const t of e)yield t;s.length&&await Promise.race(s),a<t&&(a+=1)}}*_pageStreamAll(e){const t=Math.ceil(has("featurelayer-query-tile-max-features")/this._queryInfo.pageSize);for(let o=0;o<t;o++)yield this._downloadPage(o,e)}async _downloadPage(e,t){o(t.options);const s=t.subscription.tile,r=this._queryInfo.createPagedTileQuery(s,e),a=await this._fetch(r,t.options,{chunkId:`${s.id}-${e}`});return o(t.options),new i(a,r.inner.toJSON(),s,e,!1)}}export{c as FeaturePagedTileLoadStrategy};
2
+ import{handlesGroup as e}from"../../../../../../core/handleUtils.js";import has from"../../../../../../core/has.js";import{getOrCreateMapValue as t}from"../../../../../../core/MapUtils.js";import{throwIfAborted as o,isAbortError as s,onAbort as r}from"../../../../../../core/promiseUtils.js";import{AFeatureTileLoadStrategy as a}from"./AFeatureTileLoadStrategy.js";import{PagedTileSourceChunk as i}from"./chunks/PagedTileSourceChunk.js";import{FeatureSetReaderJSON as n}from"../../support/FeatureSetReaderJSON.js";class l{constructor(t,o){this.subscription=t,this._pages=new Set,this._controller=new AbortController,this._done=!1,this._handles=e([r(t.signal,()=>this._controller.abort()),r(o,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let e=-1;for(const t of this._pages.values())e=Math.max(e,t);return e+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(e,t){this._pages.add(e),this._done=this._done||t}}class c extends a{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const e of this._loadStates.values())e.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){const o=t(this._loadStates,e.key.id,()=>new l(e,this._options));for await(const t of this._fetchPages(o))this._addChunk(t)}unload(e){super.unload(e),this._loadStates.get(e.key.id)?.destroy(),this._loadStates.delete(e.key.id)}async*_fetchPages(e){let t;try{for await(const t of this._concurrentPageStream(e))o(e.options),0!==t.size()&&(yield t)}catch(r){t=r}if(t&&s(t)||(yield new i(n.empty(this.metadata),null,e.subscription.tile,-1,!0)),t)throw t}async*_concurrentPageStream(e){const t=has("featurelayer-query-tile-concurrency"),o=this._pageStreamAll(e),s=[];let r=!1,a=1;for(;!r;){const e=[];for(;!r&&s.length<a;){const t=o.next();if(!t.value){r=!0;break}const a=t.value;a.then(e=>{e.reader.exceededTransferLimit||(r=!0)}).catch(e=>{r=!0}).finally(()=>{s.splice(s.indexOf(a),1)}),s.push(a),e.push(a)}for(const t of e)yield t;s.length&&await Promise.race(s),a<t&&(a+=1)}}*_pageStreamAll(e){const t=Math.ceil(has("featurelayer-query-tile-max-features")/this._queryInfo.getPageSize(!0));for(let o=0;o<t;o++)yield this._downloadPage(o,e)}async _downloadPage(e,t){o(t.options);const s=t.subscription.tile,r=this._queryInfo.createPagedTileQuery(s,e),a=await this._fetch(r,t.options,{chunkId:`${s.id}-${e}`});return o(t.options),new i(a,r.inner.toJSON(),s,e,!1)}}export{c as FeaturePagedTileLoadStrategy};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import e from"../../../../../../core/Error.js";import has from"../../../../../../core/has.js";import{isAbortError as t,throwIfAborted as r}from"../../../../../../core/promiseUtils.js";import o from"../../../../../../rest/support/QuantizationParameters.js";import{AFeatureLoadStrategy as a}from"./AFeatureLoadStrategy.js";import{FeatureSnapshotSourceChunk as s}from"./chunks/FeatureSnapshotSourceChunk.js";import{FeatureSetReaderJSON as n}from"../../support/FeatureSetReaderJSON.js";class i extends a{constructor(e,t,r){super(e,t,r)}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}load(e){return null==this._promise&&(this._promise=this._download()),this._promise}unload(e){}async _download(){const e=this._schema.snapshotInfo.initialTolerance,t=e?new o({mode:"view",originPosition:"upper-left",tolerance:e}):null;await this._downloadStreaming(t),null!=t&&await this._downloadRefresh()}async _downloadStreaming(t){try{for await(const e of this._fetchPages(t))this.store.insert(e)}catch(r){throw new e("featurelayer-query","Encountered error when downloading data",{error:r})}}async _downloadRefresh(){try{const e=[];for await(const t of this._fetchPages(null))e.push(t);this.store.clear();for(const t of e)this.store.insert(t);this.store.refresh()}catch(t){throw new e("featurelayer-query","Encountered error when downloading data",{error:t})}}async*_fetchPages(e){let r;try{for await(const t of this._concurrentPageStream(e))0!==t.size()&&(yield t)}catch(o){r=o}if(r&&t(r)||(yield new s(n.empty(this.metadata),null,-1,!0)),r)throw r}async*_concurrentPageStream(e){const t=has("featurelayer-snapshot-concurrency"),r=this._pageStreamAll(e),o=[];let a=!1,s=1;for(;!a;){const e=[];for(;!a&&o.length<s;){const t=r.next();if(!t.value){a=!0;break}const s=t.value;s.then(e=>{e.reader.exceededTransferLimit||(a=!0)}).catch(e=>{a=!0}).finally(()=>{o.splice(o.indexOf(s),1)}),o.push(s),e.push(s)}for(const t of e)yield t;o.length&&await Promise.race(o),s<t&&(s+=1)}}*_pageStreamAll(e){const t=Math.ceil(this._schema.snapshotInfo.maxFeatureCount/this._queryInfo.pageSize);for(let r=0;r<t;r++)yield this._downloadPage(r,e)}async _downloadPage(e,t){r(this._options);const o=this._queryInfo.createPagedQuery(e,t),a=await this._fetch(o,this._options,{chunkId:e.toString()}),n=new s(a,o.inner.toJSON(),e,!1);return r(this._options),n}}export{i as FeatureSnapshotLoadStrategy};
2
+ import e from"../../../../../../core/Error.js";import has from"../../../../../../core/has.js";import{isAbortError as t,throwIfAborted as r}from"../../../../../../core/promiseUtils.js";import o from"../../../../../../rest/support/QuantizationParameters.js";import{AFeatureLoadStrategy as a}from"./AFeatureLoadStrategy.js";import{FeatureSnapshotSourceChunk as s}from"./chunks/FeatureSnapshotSourceChunk.js";import{FeatureSetReaderJSON as n}from"../../support/FeatureSetReaderJSON.js";class i extends a{constructor(e,t,r){super(e,t,r)}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}load(e){return null==this._promise&&(this._promise=this._download()),this._promise}unload(e){}async _download(){const e=this._schema.snapshotInfo.initialTolerance,t=e?new o({mode:"view",originPosition:"upper-left",tolerance:e}):null;await this._downloadStreaming(t),null!=t&&await this._downloadRefresh()}async _downloadStreaming(t){try{for await(const e of this._fetchPages(t))this.store.insert(e)}catch(r){throw new e("featurelayer-query","Encountered error when downloading data",{error:r})}}async _downloadRefresh(){try{const e=[];for await(const t of this._fetchPages(null))e.push(t);this.store.clear();for(const t of e)this.store.insert(t);this.store.refresh()}catch(t){throw new e("featurelayer-query","Encountered error when downloading data",{error:t})}}async*_fetchPages(e){let r;try{for await(const t of this._concurrentPageStream(e))0!==t.size()&&(yield t)}catch(o){r=o}if(r&&t(r)||(yield new s(n.empty(this.metadata),null,-1,!0)),r)throw r}async*_concurrentPageStream(e){const t=has("featurelayer-snapshot-concurrency"),r=this._pageStreamAll(e),o=[];let a=!1,s=1;for(;!a;){const e=[];for(;!a&&o.length<s;){const t=r.next();if(!t.value){a=!0;break}const s=t.value;s.then(e=>{e.reader.exceededTransferLimit||(a=!0)}).catch(e=>{a=!0}).finally(()=>{o.splice(o.indexOf(s),1)}),o.push(s),e.push(s)}for(const t of e)yield t;o.length&&await Promise.race(o),s<t&&(s+=1)}}*_pageStreamAll(e){const t=Math.ceil(this._schema.snapshotInfo.maxFeatureCount/this._queryInfo.getPageSize(!1));for(let r=0;r<t;r++)yield this._downloadPage(r,e)}async _downloadPage(e,t){r(this._options);const o=this._queryInfo.createPagedQuery(e,t),a=await this._fetch(o,this._options,{chunkId:e.toString()}),n=new s(a,o.inner.toJSON(),e,!1);return r(this._options),n}}export{i as FeatureSnapshotLoadStrategy};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{baseObjectMemory as r}from"../../../../../core/memoryEstimations.js";import s from"../../../../../core/pbf.js";import n from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as a}from"./FeatureSetCache.js";import{FeatureSetReader as i}from"./FeatureSetReader.js";import{parseHeader as h}from"./FeatureSetReaderPBFHeader.js";const o=268435455,d=128,u=128e3,c={small:{delta:new Int32Array(d),decoded:new Int32Array(d)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(u),decoded:new Int32Array(u)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function l(e,t){return t?e<=c.small64.delta.length?c.small64:(e<=c.large64.delta.length||(c.large64.delta=new Float64Array(Math.round(1.25*e)),c.large64.decoded=new Float64Array(Math.round(1.25*e))),c.large64):e<=c.small.delta.length?c.small:(e<=c.large.delta.length||(c.large.delta=new Int32Array(Math.round(1.25*e)),c.large.decoded=new Int32Array(Math.round(1.25*e))),c.large)}function _(t){try{const e=2,r=new s(new Uint8Array(t),new DataView(t));for(;r.next();){if(r.tag()===e)return g(r.getMessage());r.skip()}}catch(r){throw new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:r})}return null}function g(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function f(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function y(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class m extends i{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=_(e),a=h(n,"esriGeometryPoint"===s,t.featureIdInfo,r);return new m(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new m(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return r+(this._cache.geometry?.usedMemory??0)}get underlyingMemory(){return super.underlyingMemory+this._reader.usedMemory+this._header.usedMemory}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===o?null:new n([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===o)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new n([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new a(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=f(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=l(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),a=s.getLength(),i=s.pos()+a,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new n(o,h,this.hasZ,this.hasM)}_parseGeometryForDisplay(e){const r=2,s=3,a=e.asUnsafe(),i=a.getLength(),h=a.pos()+i,o=[],d=[];let u=0,c=0,_=null,g=0;const f="esriGeometryPolygon"===this.geometryType,m="esriGeometryPolyline"===this.geometryType,I=f?3:m?2:1,p=f||m;for(;a.pos()<h&&a.next();)switch(a.tag()){case r:{const e=a.getUInt32(),t=a.pos()+e;for(;a.pos()<t;){const e=a.getUInt32();o.push(e),u+=e}_=l(2*u,this._use64Bit).delta;break}case s:{a.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);t(_);for(const t of o){if(c+e*t>_.length){for(let e=0;e<t;e++)a.getSInt64(),a.getSInt64(),this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64();continue}let r=0,s=a.getSInt64(),n=a.getSInt64();this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64(),_[c++]=s,_[c++]=n,r+=1;for(let e=1;e<t;e++){const e=a.getSInt64(),t=a.getSInt64(),i=s+e,h=n+t;g+=-.5*(i-s)*(h+n),this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64(),0===e&&0===t||y(p,_[c-2],_[c-1],e,t)?(_[c-2]+=e,_[c-1]+=t):(_[c++]=e,_[c++]=t,r+=1),s=i,n=h}r>=I?d.push(r):c-=r*e}break}default:a.skip()}return this._cache.area=g,d.length?new n(d,_,this.hasZ,this.hasM):null!=_?this._createDeltaQuantizedExtrudedGeometry(_[0],_[1]):null}}export{m as FeatureSetReaderPBF};
2
+ import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{baseObjectMemory as r}from"../../../../../core/memoryEstimations.js";import s from"../../../../../core/pbf.js";import n from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as a}from"./FeatureSetCache.js";import{FeatureSetReader as i}from"./FeatureSetReader.js";import{parseHeader as h}from"./FeatureSetReaderPBFHeader.js";const o=268435455,d=128,u=128e3,c={small:{delta:new Int32Array(d),decoded:new Int32Array(d)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(u),decoded:new Int32Array(u)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function l(e,t){return t?e<=c.small64.delta.length?c.small64:(e<=c.large64.delta.length||(c.large64.delta=new Float64Array(Math.round(1.25*e)),c.large64.decoded=new Float64Array(Math.round(1.25*e))),c.large64):e<=c.small.delta.length?c.small:(e<=c.large.delta.length||(c.large.delta=new Int32Array(Math.round(1.25*e)),c.large.decoded=new Int32Array(Math.round(1.25*e))),c.large)}function _(t){try{const e=2,r=new s(new Uint8Array(t),new DataView(t));for(;r.next();){if(r.tag()===e)return g(r.getMessage());r.skip()}}catch(r){throw new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:r})}return null}function g(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function f(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function y(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class m extends i{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=_(e),a=h(n,"esriGeometryPoint"===s,t.featureIdInfo);return new m(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new m(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return r+(this._cache.geometry?.usedMemory??0)}get underlyingMemory(){return super.underlyingMemory+this._reader.usedMemory+this._header.usedMemory}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===o?null:new n([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===o)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new n([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new a(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=f(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=l(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),a=s.getLength(),i=s.pos()+a,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new n(o,h,this.hasZ,this.hasM)}_parseGeometryForDisplay(e){const r=2,s=3,a=e.asUnsafe(),i=a.getLength(),h=a.pos()+i,o=[],d=[];let u=0,c=0,_=null,g=0;const f="esriGeometryPolygon"===this.geometryType,m="esriGeometryPolyline"===this.geometryType,I=f?3:m?2:1,p=f||m;for(;a.pos()<h&&a.next();)switch(a.tag()){case r:{const e=a.getUInt32(),t=a.pos()+e;for(;a.pos()<t;){const e=a.getUInt32();o.push(e),u+=e}_=l(2*u,this._use64Bit).delta;break}case s:{a.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);t(_);for(const t of o){if(c+e*t>_.length){for(let e=0;e<t;e++)a.getSInt64(),a.getSInt64(),this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64();continue}let r=0,s=a.getSInt64(),n=a.getSInt64();this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64(),_[c++]=s,_[c++]=n,r+=1;for(let e=1;e<t;e++){const e=a.getSInt64(),t=a.getSInt64(),i=s+e,h=n+t;g+=-.5*(i-s)*(h+n),this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64(),0===e&&0===t||y(p,_[c-2],_[c-1],e,t)?(_[c-2]+=e,_[c-1]+=t):(_[c++]=e,_[c++]=t,r+=1),s=i,n=h}r>=I?d.push(r):c-=r*e}break}default:a.skip()}return this._cache.area=g,d.length?new n(d,_,this.hasZ,this.hasM):null!=_?this._createDeltaQuantizedExtrudedGeometry(_[0],_[1]):null}}export{m as FeatureSetReaderPBF};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{estimateNumberArrayMemory as e}from"../../../../../core/memoryEstimations.js";import{getFeatureIdInfoFieldNames as t}from"../../../../../layers/graphics/data/FeatureIdInfo.js";import s from"../../../../../layers/support/FieldsIndex.js";import{parseField as r,parseTransform as o}from"../../../../../rest/query/operations/pbfFeatureServiceParser.js";const n=268435455;class i{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.idFieldIndices=[],this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}get usedMemory(){let t=0;return t+=e(this.idFieldIndices),t+=e(this.offsets.attributes),t+=e(this.offsets.geometry),t+=e(this.centroid),this.displayIds&&(t+=e(this.displayIds)),this.groupIds&&(t+=e(this.groupIds)),t}}function a(e,a,c,f=!1){const d=9,u=12,p=13,g=15,h=e.asUnsafe(),l=h.pos(),m=new i;let y=0,I=0;const w=1,b=2,k=4,x=3;let A=null,L=!1;const F=[];for(;h.next();)switch(h.tag()){case u:A=h.processMessage(o);break;case d:if(m.exceededTransferLimit=h.getBool(),m.exceededTransferLimit){m.offsets.geometry=f?new Float64Array(8e3):new Int32Array(8e3),m.centroid=f?new Float64Array(16e3):new Int32Array(16e3);for(let e=0;e<m.centroid.length;e++)m.centroid[e]=n}break;case p:{const e=h.processMessage(r);e.index=y++,F.push(e);break}case g:{const e=h.getLength(),t=h.pos()+e;if(!m.exceededTransferLimit){const e=m.offsets.geometry,t=m.centroid;e.push(0),t.push(n),t.push(n)}!L&&m.exceededTransferLimit&&(L=!0,m.offsets.attributes=f?new Float64Array(8e3*y):new Uint32Array(8e3*y));let s=I*y;for(;h.pos()<t&&h.next();)switch(h.tag()){case w:{if(L)m.offsets.attributes[s++]=h.pos();else{m.offsets.attributes.push(h.pos())}const e=h.getLength();h.skipLen(e);break}case b:if(a){const e=h.getLength(),t=h.pos()+e;for(;h.pos()<t&&h.next();)switch(h.tag()){case x:{h.getUInt32();const e=h.getSInt64(),t=h.getSInt64();m.centroid[2*I]=e,m.centroid[2*I+1]=t;break}default:h.skip()}}else{m.offsets.geometry[I]=h.pos();const e=h.getLength();m.vertexCount+=e,h.skipLen(e)}break;case k:{const e=h.getLength(),t=h.pos()+e;for(;h.pos()<t&&h.next();)switch(h.tag()){case x:{h.getUInt32();const e=h.getSInt64(),t=h.getSInt64();m.centroid[2*I]=e,m.centroid[2*I+1]=t;break}default:h.skip()}break}default:h.skip()}I++,m.hasFeatures=!0;break}default:h.skip()}m.fields=new s(F),m.featureCount=I,m.fieldCount=y;const C=t(c);return m.idFieldIndices=Array.from(C,e=>m.fields.get(e)?.index),m.transform=A,m.displayIds=new Uint32Array(m.featureCount),m.groupIds=new Uint16Array(m.featureCount),h.move(l),m}export{i as FeatureSetHeader,a as parseHeader};
2
+ import{estimateNumberArrayMemory as e}from"../../../../../core/memoryEstimations.js";import{getFeatureIdInfoFieldNames as t}from"../../../../../layers/graphics/data/FeatureIdInfo.js";import s from"../../../../../layers/support/FieldsIndex.js";import{parseField as r,parseTransform as o}from"../../../../../rest/query/operations/pbfFeatureServiceParser.js";const n=268435455;class i{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.idFieldIndices=[],this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}get usedMemory(){let t=0;return t+=e(this.idFieldIndices),t+=e(this.offsets.attributes),t+=e(this.offsets.geometry),t+=e(this.centroid),this.displayIds&&(t+=e(this.displayIds)),this.groupIds&&(t+=e(this.groupIds)),t}}function a(e,a,c){const d=9,f=12,u=13,p=15,g=e.asUnsafe(),h=g.pos(),l=new i;let m=0,y=0;const I=1,k=2,b=4,x=3;let w=null;const L=[];for(;g.next();)switch(g.tag()){case f:w=g.processMessage(o);break;case d:l.exceededTransferLimit=g.getBool();break;case u:{const e=g.processMessage(r);e.index=m++,L.push(e);break}case p:{const e=g.getLength(),t=g.pos()+e,s=l.offsets.geometry,r=l.centroid;for(s.push(0),r.push(n),r.push(n);g.pos()<t&&g.next();)switch(g.tag()){case I:{l.offsets.attributes.push(g.pos());const e=g.getLength();g.skipLen(e);break}case k:if(a){const e=g.getLength(),t=g.pos()+e;for(;g.pos()<t&&g.next();)switch(g.tag()){case x:{g.getUInt32();const e=g.getSInt64(),t=g.getSInt64();l.centroid[2*y]=e,l.centroid[2*y+1]=t;break}default:g.skip()}}else{l.offsets.geometry[y]=g.pos();const e=g.getLength();l.vertexCount+=e,g.skipLen(e)}break;case b:{const e=g.getLength(),t=g.pos()+e;for(;g.pos()<t&&g.next();)switch(g.tag()){case x:{g.getUInt32();const e=g.getSInt64(),t=g.getSInt64();l.centroid[2*y]=e,l.centroid[2*y+1]=t;break}default:g.skip()}break}default:g.skip()}y++,l.hasFeatures=!0;break}default:g.skip()}l.fields=new s(L),l.featureCount=y,l.fieldCount=m;const C=t(c);return l.idFieldIndices=Array.from(C,e=>l.fields.get(e)?.index),l.transform=w,l.displayIds=new Uint32Array(l.featureCount),l.groupIds=new Uint16Array(l.featureCount),g.move(h),l}export{i as FeatureSetHeader,a as parseHeader};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../../Graphic.js";import{pointToCoordinate as i}from"../../../../arcade/functions/measures.js";import o from"../../../../core/Accessor.js";import{isSome as r}from"../../../../core/arrayUtils.js";import{getContrast as s}from"../../../../core/colorUtils.js";import{debounce as a,throwIfNotAbortError as n}from"../../../../core/promiseUtils.js";import{initial as p}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import{e as y}from"../../../../chunks/distanceOperator.js";import{load as d,execute as m}from"../../../../geometry/operators/projectOperator.js";import{g as u}from"../../../../chunks/proximityOperator.js";import g from"../../../../layers/GraphicsLayer.js";import f from"../../../../rest/support/Stop.js";import w from"../../../../symbols/SimpleLineSymbol.js";import v from"../../../../symbols/SimpleMarkerSymbol.js";import{ViewEventPriorities as _}from"../../../input/InputManager.js";const b=Symbol(),j=20;let L=class extends o{constructor(t){super(t),this._graphicsLayer=new g({listMode:"hide",internal:!0}),this._updatingHandles=new h,this._debouncedHandleClick=a(async t=>{const e=this._graphicsLayer.graphics.at(0);if("point"!==e?.geometry?.type)return;t.stopPropagation();const i=new f({geometry:e.geometry.clone(),locationType:"waypoint",symbol:this.waypointSymbol.clone()}),o=await this._getWaypointIndex(i);this.interaction.layer.stops.add(i,o),this.interaction.layer.stops.forEach(t=>t.sequence=null),this.interaction.addNetworkFeature(i)}),this._debouncedHandlePointerMove=a(async t=>{if(!this.interaction.enabled||!this.interaction.interactiveOptions.waypointAdditionEnabled||this.interaction.sketchActive||this.interaction.layer.stops.length<2||!this.interaction.layer.routeInfo?.geometry)return void this._clearWaypointManipulator();const{spatialReference:i}=this.view;await d();const o=m(this.interaction.layer.routeInfo?.geometry,i);if(!o)return void this._clearWaypointManipulator();const s=this.view.resolution*window.devicePixelRatio*j,{coordinate:a,distance:n,isEmpty:p}=u(o,this.view.toMap(t));if(p||n>s)return void this._clearWaypointManipulator();if(this.interaction.layer.stops.map(({geometry:t})=>t).filter(r).map(t=>m(t,i)).filter(r).some(t=>y(t,a)<s))return void this._clearWaypointManipulator();this.addHandles(this.view.acquireCursor("pointer","high"),b);const c=this._graphicsLayer.graphics.at(0);if(c)return void(c.geometry=a);const{waypointSymbol:l}=this,h=new e({geometry:a,symbol:l});this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.add(h)})}initialize(){this.view.map?.add(this._graphicsLayer),this._updatingHandles.add(()=>({enabled:this.interaction.enabled,graphic:this._graphicsLayer.graphics.at(0),symbol:this.waypointSymbol}),({enabled:t,graphic:e,symbol:i})=>{t?e&&(e.symbol=i):this._clearWaypointManipulator()},p),this.addHandles([this.view.on("click",t=>this._debouncedHandleClick(t).catch(n),_.TOOL),this.view.on("pointer-move",t=>this._debouncedHandlePointerMove(t).catch(n),_.TOOL)])}destroy(){this._graphicsLayer.removeFromParent(),this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.destroy(),this._updatingHandles.destroy()}get updating(){return!this._graphicsLayer.loaded||this._updatingHandles.updating}get waypointSymbol(){const t=this.interaction.layer.defaultSymbols.stops?.waypoint;if(t)return t;const{accentColor:e}=this.view.effectiveTheme;return new v({color:e,outline:new w({color:s(e),width:1.5}),size:10})}_clearWaypointManipulator(){this._graphicsLayer.graphics.destroyAll(),this.removeHandles(b)}async _getWaypointIndex(t){const{routeInfo:e,stops:o}=this.interaction.layer;if(2===o.length||!e?.geometry||!t.geometry)return 1;const{spatialReference:r}=this.view;await d();const s=m(e.geometry,r),a=m(t.geometry,r);if(!s||!a)return 1;const n=i(s,a)?.distanceAlong;if(!n)return 1;for(let p=1;p<o.length;p++){const t=o.at(p)?.geometry;if(!t)continue;const e=m(t,r);if(!e)continue;const a=i(s,e)?.distanceAlong;if(null!=a&&a>n)return p}return o.length-1}};t([c()],L.prototype,"interaction",void 0),t([c()],L.prototype,"updating",null),t([c()],L.prototype,"waypointSymbol",null),t([c()],L.prototype,"view",void 0),L=t([l("esri.views.2d.layers.support.RouteLayerWaypointVisualization")],L);export{L as RouteLayerWaypointVisualization};
2
+ import{__decorate as t}from"tslib";import e from"../../../../Graphic.js";import{pointToCoordinate as i}from"../../../../arcade/functions/measures.js";import o from"../../../../core/Accessor.js";import{isSome as r}from"../../../../core/arrayUtils.js";import{getContrast as s}from"../../../../core/colorUtils.js";import{debounce as a,throwIfNotAbortError as n}from"../../../../core/promiseUtils.js";import{initial as p}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import{e as y}from"../../../../chunks/distanceOperator.js";import{load as m,execute as d}from"../../../../geometry/operators/projectOperator.js";import{g as u}from"../../../../chunks/proximityOperator.js";import{normalizeCentralMeridian as g}from"../../../../geometry/support/normalizeUtils.js";import f from"../../../../layers/GraphicsLayer.js";import w from"../../../../rest/support/Stop.js";import v from"../../../../symbols/SimpleLineSymbol.js";import _ from"../../../../symbols/SimpleMarkerSymbol.js";import{ViewEventPriorities as b}from"../../../input/InputManager.js";const j=Symbol(),L=20;let S=class extends o{constructor(t){super(t),this._graphicsLayer=new f({listMode:"hide",internal:!0}),this._updatingHandles=new h,this._debouncedHandleClick=a(async t=>{const e=this._graphicsLayer.graphics.at(0);if("point"!==e?.geometry?.type)return;t.stopPropagation();const i=new w({geometry:e.geometry.clone(),locationType:"waypoint",symbol:this.waypointSymbol.clone()}),o=await this._getWaypointIndex(i);this.interaction.layer.stops.add(i,o),this.interaction.layer.stops.forEach(t=>t.sequence=null),this.interaction.addNetworkFeature(i)}),this._debouncedHandlePointerMove=a(async t=>{if(!this.interaction.enabled||!this.interaction.interactiveOptions.waypointAdditionEnabled||this.interaction.sketchActive||this.interaction.layer.stops.length<2||!this.interaction.layer.routeInfo?.geometry)return void this._clearWaypointManipulator();const{spatialReference:i}=this.view;await m();const o=d(this.interaction.layer.routeInfo.geometry,i);if(!o)return void this._clearWaypointManipulator();const s=this.view.resolution*window.devicePixelRatio*L,a=this.view.toMap(t),n=(await g(a))[0],{coordinate:p,distance:c,isEmpty:l}=u(o,n);if(l||c>s)return void this._clearWaypointManipulator();if(this.interaction.layer.stops.map(({geometry:t})=>t).filter(r).map(t=>d(t,i)).filter(r).some(t=>y(t,p)<s))return void this._clearWaypointManipulator();this.addHandles(this.view.acquireCursor("pointer","high"),j);const h=this._graphicsLayer.graphics.at(0);if(h)return void(h.geometry=p);const{waypointSymbol:f}=this,w=new e({geometry:p,symbol:f});this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.add(w)})}initialize(){this.view.map?.add(this._graphicsLayer),this._updatingHandles.add(()=>({enabled:this.interaction.enabled,graphic:this._graphicsLayer.graphics.at(0),symbol:this.waypointSymbol}),({enabled:t,graphic:e,symbol:i})=>{t?e&&(e.symbol=i):this._clearWaypointManipulator()},p),this.addHandles([this.view.on("click",t=>this._debouncedHandleClick(t).catch(n),b.TOOL),this.view.on("pointer-move",t=>this._debouncedHandlePointerMove(t).catch(n),b.TOOL)])}destroy(){this._graphicsLayer.removeFromParent(),this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.destroy(),this._updatingHandles.destroy()}get updating(){return!this._graphicsLayer.loaded||this._updatingHandles.updating}get waypointSymbol(){const t=this.interaction.layer.defaultSymbols.stops?.waypoint;if(t)return t;const{accentColor:e}=this.view.effectiveTheme;return new _({color:e,outline:new v({color:s(e),width:1.5}),size:10})}_clearWaypointManipulator(){this._graphicsLayer.graphics.destroyAll(),this.removeHandles(j)}async _getWaypointIndex(t){const{routeInfo:e,stops:o}=this.interaction.layer;if(2===o.length||!e?.geometry||!t.geometry)return 1;const{spatialReference:r}=this.view;await m();const s=d(e.geometry,r),a=d(t.geometry,r);if(!s||!a)return 1;const n=i(s,a)?.distanceAlong;if(!n)return 1;for(let p=1;p<o.length;p++){const t=o.at(p)?.geometry;if(!t)continue;const e=d(t,r);if(!e)continue;const a=i(s,e)?.distanceAlong;if(null!=a&&a>n)return p}return o.length-1}};t([c()],S.prototype,"interaction",void 0),t([c()],S.prototype,"updating",null),t([c()],S.prototype,"waypointSymbol",null),t([c()],S.prototype,"view",void 0),S=t([l("esri.views.2d.layers.support.RouteLayerWaypointVisualization")],S);export{S as RouteLayerWaypointVisualization};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{createTask as e}from"../../../../core/asyncUtils.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import{roundToNearest as s}from"../../../../core/mathUtils.js";import{removeMaybe as r,abortMaybe as a}from"../../../../core/maybe.js";import{throwIfAborted as n}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as d}from"../../../../core/reactiveUtils.js";import{createScreenPoint as h}from"../../../../core/screenUtils.js";import{throttle as p}from"../../../../core/throttle.js";import{convertTime as c}from"../../../../core/timeUtils.js";import{property as u,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{formatDuration as _}from"../../../../intl/duration.js";import{onLocaleChange as w}from"../../../../intl/locale.js";import{fetchMessageBundle as v}from"../../../../intl/messages.js";import{substitute as f}from"../../../../intl/substitute.js";let y=class extends o{constructor(t){super(t),this.throttleDelay=x,this._tooltipElement=g(),this._tooltipContentElement=D(),this._messagesTask=null,this._screenPoint=null,this._shadowDurationTask=null,this._shadowDuration=null,this._throttledUpdateShadowDuration=null,this._onPointerMove=({x:t,y:o})=>{const e=h(t,o);this._screenPoint=e,this._throttledUpdateShadowDuration?.(this.view,e)},this._updateShadowDuration=(t,o)=>{this._abortShadowDurationTask(),this._shadowDurationTask=e(async e=>{const{results:i,ground:s}=await t.hitTest(o);if(n(e),0===i.length&&!s.mapPoint)return void(this._shadowDuration=null);const r=await this.getDuration(o,e);n(e),this._shadowDuration=r})}}initialize(){this._tooltipElement.appendChild(this._tooltipContentElement);const t=()=>{this._messagesTask?.abort(),this._messagesTask=e(()=>v("esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis"))};t(),this.addHandles([w(t),l(()=>({enabled:this.isVisible(),surface:this.view.surface}),({enabled:t,surface:o})=>{t&&o?(o.appendChild(this._tooltipElement),this._startTracking(this.view)):(this.removeHandles(T),this._tooltipElement.remove())},d),l(()=>this._styles,t=>{Object.assign(this._tooltipElement.style,t)},d),l(()=>this._formattedText,t=>{this._tooltipContentElement.innerText=t},d),l(()=>this.throttleDelay,t=>{this._throttledUpdateShadowDuration=p(this._updateShadowDuration,t)},d),i(()=>{this._throttledUpdateShadowDuration=r(this._throttledUpdateShadowDuration)})])}destroy(){this._tooltipElement.remove()}get updating(){return null!=this._shadowDurationTask&&!this._shadowDurationTask?.finished||!0===this._throttledUpdateShadowDuration?.hasPendingUpdates()}get _formattedText(){const t=this._messagesTask?.value,o=this._shadowDuration;if(null==t||null==o)return"";const e=s(o,o<E?j:E);return f(t.shadowDuration,{duration:_(e)})}get _styles(){const t=this._screenPoint;return t&&this._formattedText?{display:"block",transform:`translate(${t.x}px, ${t.y}px)`}:{display:"none"}}_startTracking(t){if(this.hasHandles(T))return;const o=o=>{this.hasHandles(S)||(o&&this._onPointerMove(o),this.addHandles(t.on("pointer-move",this._onPointerMove),S))},e=()=>{this.removeHandles(S),this._abortShadowDurationTask(),this._screenPoint=null,this._shadowDuration=null};this.addHandles([t.on("pointer-enter",o),t.on("pointer-leave",e),t.on("pointer-down",e),t.on("pointer-up",o),t.on("pointer-drag",t=>{"end"===t.action?o(t):e()}),t.on("click",o=>{const e=h(o.x,o.y);this._screenPoint=e,this._updateShadowDuration(t,e)}),i(()=>this._abortShadowDurationTask())],T),o()}_abortShadowDurationTask(){this._shadowDurationTask=a(this._shadowDurationTask)}};function g(){const t=k(document.createElement("div"),{position:"absolute",top:"0",left:"0",pointerEvents:"none"});return t.style.setProperty("--tooltip-arrow-size","6px"),t.style.setProperty("--tooltip-background","var(--calcite-color-foreground-1)"),t.appendChild(b()),t}function D(){return k(document.createElement("div"),{color:"var(--calcite-color-text-1)",fontSize:"var(--calcite-font-size-sm)",position:"absolute",width:"max-content",transform:"translate(0, -100%)",insetInlineStart:"calc(var(--calcite-spacing-lg) * -1)",marginTop:"calc((var(--tooltip-arrow-size) * -1) - var(--calcite-spacing-xxs))",background:"var(--tooltip-background)",paddingInline:"var(--calcite-spacing-md)",paddingBlock:"var(--calcite-spacing-xs)",pointerEvents:"none",borderRadius:"var(--calcite-corner-radius-sm)"})}function b(){return k(document.createElement("div"),{display:"block",position:"absolute",width:"0",height:"0",bottom:"-1px",left:"50%",transform:"translate(-50%, 0)",borderTop:"var(--tooltip-arrow-size) solid var(--tooltip-background)",borderRight:"var(--tooltip-arrow-size) solid transparent",borderBottom:"var(--tooltip-arrow-size) solid transparent",borderLeft:"var(--tooltip-arrow-size) solid transparent",pointerEvents:"none"})}function k(t,o){return Object.assign(t.style,o),t}t([u()],y.prototype,"view",void 0),t([u()],y.prototype,"isVisible",void 0),t([u()],y.prototype,"getDuration",void 0),t([u()],y.prototype,"throttleDelay",void 0),t([u()],y.prototype,"updating",null),t([u()],y.prototype,"_messagesTask",void 0),t([u()],y.prototype,"_screenPoint",void 0),t([u()],y.prototype,"_shadowDurationTask",void 0),t([u()],y.prototype,"_shadowDuration",void 0),t([u()],y.prototype,"_throttledUpdateShadowDuration",void 0),t([u()],y.prototype,"_formattedText",null),t([u()],y.prototype,"_styles",null),y=t([m("esri.views.3d.analysis.ShadowCast.ShadowCastTooltip")],y);const T=Symbol("tracking"),S=Symbol("pointer"),x=300,j=c(1,"minutes","milliseconds"),E=c(15,"minutes","milliseconds");export{y as ShadowCastTooltip};
2
+ import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{createTask as s}from"../../../../core/asyncUtils.js";import{makeHandle as e}from"../../../../core/handleUtils.js";import{roundToNearest as i}from"../../../../core/mathUtils.js";import{removeMaybe as a,abortMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as n}from"../../../../core/promiseUtils.js";import{initial as l}from"../../../../core/reactiveUtils.js";import{createScreenPoint as d}from"../../../../core/screenUtils.js";import{throttle as h}from"../../../../core/throttle.js";import{convertTime as p}from"../../../../core/timeUtils.js";import{property as u,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as m}from"../../../../core/support/UpdatingHandles.js";import{formatDuration as _}from"../../../../intl/duration.js";import{onLocaleChange as w}from"../../../../intl/locale.js";import{fetchMessageBundle as g}from"../../../../intl/messages.js";import{substitute as v}from"../../../../intl/substitute.js";let f=class extends o{constructor(t){super(t),this.throttleDelay=x,this._tooltipElement=y(),this._tooltipContentElement=D(),this._updatingHandles=new m,this._messagesTask=null,this._screenPoint=null,this._shadowDurationTask=null,this.shadowDuration=null,this._throttledUpdateShadowDuration=null,this._onPointerMove=({x:t,y:o})=>{const s=d(t,o);this._screenPoint=s,this._throttledUpdateShadowDuration?.(this.view,s)},this._updateShadowDuration=(t,o)=>{this._abortShadowDurationTask(),this._shadowDurationTask=s(async s=>{const{results:e,ground:i}=await t.hitTest(o);if(n(s),0===e.length&&!i.mapPoint)return void(this.shadowDuration=null);const a=await this.getDuration(o,s);n(s),this.shadowDuration=a})}}initialize(){this._tooltipElement.appendChild(this._tooltipContentElement);const t=()=>{this._messagesTask?.abort(),this._messagesTask=s(()=>g("esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis"))};t(),this.addHandles([w(t),this._updatingHandles.add(()=>({enabled:this.isVisible(),surface:this.view.surface}),({enabled:t,surface:o})=>{t&&o?(o.appendChild(this._tooltipElement),this._startTracking(this.view)):(this.removeHandles(T),this._tooltipElement.remove())},l),this._updatingHandles.add(()=>this._styles,t=>{Object.assign(this._tooltipElement.style,t)},l),this._updatingHandles.add(()=>this._formattedText,t=>{this._tooltipContentElement.innerText=t},l),this._updatingHandles.add(()=>this.throttleDelay,t=>{this._throttledUpdateShadowDuration=h(this._updateShadowDuration,t)},l),e(()=>{this._throttledUpdateShadowDuration=a(this._throttledUpdateShadowDuration)})])}destroy(){this._updatingHandles.destroy(),this._tooltipElement.remove()}get updating(){return this._updatingHandles.updating||null!=this._shadowDurationTask&&!this._shadowDurationTask?.finished||null!=this._messagesTask&&!this._messagesTask?.finished||!0===this._throttledUpdateShadowDuration?.hasPendingUpdates()}get _formattedText(){const t=this._messagesTask?.value,o=this.shadowDuration;if(null==t||null==o)return"";const s=i(o,o<U?j:U);return v(t.shadowDuration,{duration:_(s)})}get _styles(){const t=this._screenPoint;return t&&this._formattedText?{display:"block",transform:`translate(${t.x}px, ${t.y}px)`}:{display:"none"}}_startTracking(t){if(this.hasHandles(T))return;const o=o=>{this.hasHandles(S)||(o&&this._onPointerMove(o),this.addHandles(t.on("pointer-move",this._onPointerMove),S))},s=()=>{this.removeHandles(S),this._abortShadowDurationTask(),this._screenPoint=null,this.shadowDuration=null};this.addHandles([t.on("pointer-enter",o),t.on("pointer-leave",s),t.on("pointer-down",s),t.on("pointer-up",o),t.on("pointer-drag",t=>{"end"===t.action?o(t):s()}),t.on("click",o=>{const s=d(o.x,o.y);this._screenPoint=s,this._updateShadowDuration(t,s)}),e(()=>this._abortShadowDurationTask())],T),o()}_abortShadowDurationTask(){this._shadowDurationTask=r(this._shadowDurationTask)}};function y(){const t=k(document.createElement("div"),{position:"absolute",top:"0",left:"0",pointerEvents:"none"});return t.style.setProperty("--tooltip-arrow-size","6px"),t.style.setProperty("--tooltip-background","var(--calcite-color-foreground-1)"),t.appendChild(b()),t}function D(){return k(document.createElement("div"),{color:"var(--calcite-color-text-1)",fontSize:"var(--calcite-font-size-sm)",position:"absolute",width:"max-content",transform:"translate(0, -100%)",insetInlineStart:"calc(var(--calcite-spacing-lg) * -1)",marginTop:"calc((var(--tooltip-arrow-size) * -1) - var(--calcite-spacing-xxs))",background:"var(--tooltip-background)",paddingInline:"var(--calcite-spacing-md)",paddingBlock:"var(--calcite-spacing-xs)",pointerEvents:"none",borderRadius:"var(--calcite-corner-radius-sm)"})}function b(){return k(document.createElement("div"),{display:"block",position:"absolute",width:"0",height:"0",bottom:"-1px",left:"50%",transform:"translate(-50%, 0)",borderTop:"var(--tooltip-arrow-size) solid var(--tooltip-background)",borderRight:"var(--tooltip-arrow-size) solid transparent",borderBottom:"var(--tooltip-arrow-size) solid transparent",borderLeft:"var(--tooltip-arrow-size) solid transparent",pointerEvents:"none"})}function k(t,o){return Object.assign(t.style,o),t}t([u()],f.prototype,"view",void 0),t([u()],f.prototype,"isVisible",void 0),t([u()],f.prototype,"getDuration",void 0),t([u()],f.prototype,"throttleDelay",void 0),t([u()],f.prototype,"updating",null),t([u()],f.prototype,"_messagesTask",void 0),t([u()],f.prototype,"_screenPoint",void 0),t([u()],f.prototype,"_shadowDurationTask",void 0),t([u()],f.prototype,"shadowDuration",void 0),t([u()],f.prototype,"_throttledUpdateShadowDuration",void 0),t([u()],f.prototype,"_formattedText",null),t([u()],f.prototype,"_styles",null),f=t([c("esri.views.3d.analysis.ShadowCast.ShadowCastTooltip")],f);const T=Symbol("tracking"),S=Symbol("pointer"),x=300,j=p(1,"minutes","milliseconds"),U=p(15,"minutes","milliseconds");export{f as ShadowCastTooltip};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{debounce as i}from"../../../../core/promiseUtils.js";import{createVolume as n}from"../../../../core/quantity.js";import{whenOnce as s,watch as a,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as u,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{e as c}from"../../../../chunks/earcut.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scaleAndAdd as d,sqrDist as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as g,clone as f,create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as _}from"../../../../core/support/UpdatingHandles.js";import v from"../../../../geometry/Multipoint.js";import{projectOrLoad as w}from"../../../../geometry/projectionUtils.js";import{e as b}from"../../../../chunks/containsOperator.js";import{e as j}from"../../../../chunks/convexHullOperator.js";import{e as E}from"../../../../chunks/simplifyOperator.js";import{e as R}from"../../../../chunks/unionOperator.js";import{computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as T}from"../../../../geometry/projection/projectBoundingRect.js";import{fromExtent as L,intersects as G,create as O,empty as x}from"../../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as D}from"../../../../geometry/support/DoubleArray.js";import{t as I}from"../../../../chunks/vec3.js";import H from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as M}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as V}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementInsufficientDataError as A,VolumeMeasurementPerimeterTooLargeError as P,VolumeMeasurementUnsupportedCoordinateSystemError as U,VolumeMeasurementUnsupportedLayerTransparencyError as k}from"./volumeMeasurementErrors.js";import{VolumeMeasurementRawResult as S}from"./VolumeMeasurementRawResult.js";import F from"./VolumeMeasurementResult.js";import{ElevationContext as W}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as N}from"../../support/ElevationProvider.js";import{polygonToRenderInfo as z}from"../../support/renderInfoUtils/polygon.js";import{IteratorPreorder as q}from"../../terrain/tileUtils.js";import{CutFillDepth as B,TargetGeometryRenderInfo as Z}from"../../webgl-engine/lib/CutFillDepth.js";import{isIntegratedMeshLayerView as J}from"../../../support/layerViewUtils.js";import{MeasurementWorkerHandle as K}from"../../../support/MeasurementWorkerHandle.js";let Q=class extends r{constructor(e){super(e),this._measurementWorkerHandle=new K,this._getElevationProvider=()=>this.view.elevationProvider,this.labelAnchors=null,this._updatingHandles=new _,this._rawResult=null,this._sufficientDataCoverage=!0,this._tileIterator=new q,this._intersectingObbs=[],this._intersectingTiles=[],this._debouncedUpdate=i(async(e,t,r,o)=>{if(!this._renderer.done)return;const{renderCoordsHelper:i}=this.view,n=new V({extent:t,localOrigin:r,renderCoordsHelper:i});this._renderer.update(n,o),this._determineDataCoverage(n);const[a]=await Promise.allSettled([this._measurementWorkerHandle.areaHorizontal(e,{returnLength:!0}),s(()=>this._renderer.done).then(()=>{this._updateLabelAnchors(n,this._renderer.getResults())})]);if(!this._enabled||!this._sufficientDataCoverage)return void(this._rawResult=null);const l=this._renderer.getResults();this._updateResult(n,l,"fulfilled"===a.status?a.value:null)}),this._determineDataCoverage=e=>{const{elevationAlignedGeometry:t}=this,{frustum:r}=this._renderer,{cameraDimensions:o}=e;t&&r&&(this._intersectingObbs.length=0,this._imLayerViewsAffectingMeasurement.forEach(e=>{this._findIntersectingObbs(e,r)}),this._intersectingObbs.length?this._sufficientDataCoverage=this._sufficientIntegratedMeshCoverage(t,o):(this._findIntersectingTerrainTiles(t),this._sufficientDataCoverage=this._sufficientTerrainCoverage(o)))}}initialize(){const e=this.view;this._renderer=new B({view:e}),this.addHandles([this._createElevationUpdateHandle(),a(()=>({projectedGeometry:this._projectedGeometry,localOrigin:this._localOrigin,targetGeometryRenderInfos:this._targetGeometryRenderInfos,enabled:this._enabled}),({projectedGeometry:e,localOrigin:t,targetGeometryRenderInfos:r,enabled:o})=>{const i=e?.extent;if(!(e&&i&&t&&r&&o))return this._rawResult=null,void(this._sufficientDataCoverage=!0);this._updatingHandles.addPromise(this._debouncedUpdate(e,i,t,r))},l)])}destroy(){this._updatingHandles.destroy(),this._renderer.destroy(),this._measurementWorkerHandle.destroy()}get _projectedGeometry(){const e=this.analysis.geometry;if(!e||!this.analysis.valid)return null;const t=E(e),r=w(t,this.view.spatialReference);return r.pending?(this._updatingHandles.addPromise(r.pending),null):(t&&!r.geometry&&M(this.analysis,e.spatialReference,o.getLogger(this)),r.geometry)}get _localOrigin(){const e=this._projectedGeometry?.extent;return e?g(e.center.x,e.center.y,0):null}get elevationAlignedGeometry(){const e=this._projectedGeometry;if(!e)return null;const t=e.clone();return X(this._getElevationProvider(),t),t}get targetGeometry(){const{elevationAlignedGeometry:e}=this;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings.forEach(e=>e.forEach(e=>e[2]=r)),o}get _targetGeometryRenderInfos(){const e=this.targetGeometry,t=this._projectedGeometry?.extent,r=this._localOrigin;if(!e||!t||!r)return null;const{elevationProvider:o,renderCoordsHelper:i}=this.view,n=z(e,o,i,W.fromElevationInfo(new H({mode:"absolute-height"}))),{polygons:s}=n;return s.map(e=>{const o=c(e.position,e.holeIndices,3),n=D(3*e.count),s=m(),a=m();return C(t.spatialReference,r,s,i.spatialReference),a[12]=-s[12],a[13]=-s[13],a[14]=-s[14],I(n,e.position,a),new Z(n,o)})}get updating(){return this._renderer.updating||this._updatingHandles.updating}get result(){const e=this._rawResult,{volume:t,area:r,length:o}=this.analysisViewData.effectiveDisplayUnits;return e?new F({measureType:this.analysis.measureType,rawResult:e,volumeUnit:t,areaUnit:r,lengthUnit:o}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError??this._insufficientDataError}get _imLayerViewsAffectingMeasurement(){return this.view.allLayerViews.filter(e=>J(e)).filter(e=>e.visible&&!e.suspended)}get _insufficientDataError(){return this._sufficientDataCoverage?null:new A}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){const{spatialReference:e,state:{isLocal:r}}=this.view;if(!r||!e.isWebMercator)return null;const o=this._perimeter,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new P:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeter,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new P:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new U:null}get _unsupportedLayerTransparencyError(){return this.view.map.ground&&this.view.map.ground.opacity<1?new k:null}get _perimeter(){if(!this._targetGeometryRenderInfos)return null;let e=null;for(const t of this._targetGeometryRenderInfos){const r=$(ee(t.positions));e=r?Math.max(e??0,r):e}return null!=e?e/this.view.renderCoordsHelper.unitInMeters:null}get _enabled(){return!(this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError)}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&t&&(T(e.extent,e.spatialReference,re,this.view.spatialReference),L(t,oe),G(re,oe)&&(this._getElevationProvider=()=>this.view.elevationProvider))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(e,t,r){const{unitInMeters:o}=this.view.renderCoordsHelper,{dimensions:{width:i,height:s},cameraNearFar:{near:a,far:l}}=e,u=i/t.width*(s/t.height),p=Y(t.cut.totalDepth,a,l)*u,c=Y(t.fill.totalDepth,a,l)*u,m=o**3;this._rawResult=new S({cutVolume:n(Math.abs(p*m),"cubic-meters"),fillVolume:n(c*m,"cubic-meters"),area:r?.area,perimeter:r?.length})}_updateLabelAnchors(e,t){const{dimensions:{width:r,height:o},cameraNearFar:{near:i,far:n},cameraPositionRenderSpace:s,northVector:a,eastVector:l,upVector:u}=e,p=e=>{const{labelDepth:p,labelCoords:c,totalDepth:m}=e,h=f(s);return 0!==m&&(d(h,h,l,r*(c[0]/t.width-.5)),d(h,h,a,o*(c[1]/t.height-.5))),d(h,h,u,-Y(p,i,n)),h};this.labelAnchors={cut:p(t.cut),fill:p(t.fill)}}_findIntersectingObbs(e,t){const r=this._intersectingObbs;"integrated-mesh-3d"===e.type&&e.getVisibleNodes().forEach(o=>{e.isNodeLoaded(o.index)&&o.geometryObbInRenderSR?.intersectsFrustum(t)&&r.push(o.geometryObbInRenderSR)}),"integrated-mesh-3dtiles"===e.type&&e.forEachVisibleComponentObject(({obb:e})=>{e.intersectsFrustum(t)&&r.push(e)})}_sufficientIntegratedMeshCoverage(e,t){const{renderCoordsHelper:r,spatialReference:o}=this.view,i=[],n=new v({spatialReference:o});if(this._intersectingObbs.forEach(e=>{if(te(e.radius,t)&&(e.getCorners(ne),n.points.length=0,ne.forEach(e=>{const t=r.fromRenderCoords(e,se,o);t&&n.addPoint([t[0],t[1]])}),n.points.length)){const e=j(n);"polygon"===e?.type&&i.push(e)}}),!i.length)return!1;const s=R(i);return!!s&&b(s,e)}_findIntersectingTerrainTiles(e){const{basemapTerrain:t}=this.view;if(this._intersectingTiles.length=0,!e.extent)return;L(e.extent,ie);const r=this._tileIterator;r.reset(t.rootTiles);for(let o=r.next();o;o=r.next())o.intersectsExtent(ie)?o.rendered&&this._intersectingTiles.push(o):r.skipSubtree()}_sufficientTerrainCoverage(e){const{basemapTerrain:{tilingScheme:t}}=this.view,r=256/t.pixelSize;return this._intersectingTiles.every(t=>te(t.radius*r,e))}};function X(e,t){t.hasZ=!0,t.rings.forEach(t=>t.forEach(t=>t[2]=N(e,t,"ground")??0))}function Y(e,t,r){return e*(r-t)+t}function $(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1],i[2]??0]),r?o+=h(r,i):r=[0,0,0],r[0]=i[0],r[1]=i[1],r[2]=i[2];return t&&r&&(o+=h(r,t)),Math.sqrt(o)}function*ee(e){const t=y();for(let r=0;r<e.length;r+=3)t[0]=e[r],t[1]=e[r+1],t[2]=e[r+2],yield t}e([u()],Q.prototype,"_projectedGeometry",null),e([u()],Q.prototype,"_localOrigin",null),e([u()],Q.prototype,"_getElevationProvider",void 0),e([u()],Q.prototype,"elevationAlignedGeometry",null),e([u()],Q.prototype,"targetGeometry",null),e([u()],Q.prototype,"_targetGeometryRenderInfos",null),e([u({constructOnly:!0})],Q.prototype,"analysis",void 0),e([u({constructOnly:!0})],Q.prototype,"analysisViewData",void 0),e([u({constructOnly:!0})],Q.prototype,"view",void 0),e([u()],Q.prototype,"updating",null),e([u()],Q.prototype,"result",null),e([u()],Q.prototype,"labelAnchors",void 0),e([u()],Q.prototype,"error",null),e([u()],Q.prototype,"_imLayerViewsAffectingMeasurement",null),e([u()],Q.prototype,"_insufficientDataError",null),e([u()],Q.prototype,"_perimeterTooLargeError",null),e([u()],Q.prototype,"_perimeterTooLargeLocalError",null),e([u()],Q.prototype,"_perimeterTooLargeGlobalError",null),e([u()],Q.prototype,"_unsupportedCoordinateSystemError",null),e([u()],Q.prototype,"_unsupportedLayerTransparencyError",null),e([u()],Q.prototype,"_perimeter",null),e([u()],Q.prototype,"_enabled",null),e([u()],Q.prototype,"_renderer",void 0),e([u({readOnly:!0})],Q.prototype,"_updatingHandles",void 0),e([u()],Q.prototype,"_rawResult",void 0),e([u()],Q.prototype,"_sufficientDataCoverage",void 0),Q=e([p("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],Q);const te=(e,t)=>e<(t.width+t.height)/2,re=x(),oe=x(),ie=O(),ne=new Array(8).fill(0).map(()=>y()),se=y();export{Q as VolumeMeasurementCutFillController};
2
+ import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{debounce as i}from"../../../../core/promiseUtils.js";import{createVolume as n}from"../../../../core/quantity.js";import{whenOnce as s,watch as a,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as u,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{e as c}from"../../../../chunks/earcut.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scaleAndAdd as d,sqrDist as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as g,clone as f,create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as _}from"../../../../core/support/UpdatingHandles.js";import v from"../../../../geometry/Multipoint.js";import{projectOrLoad as w}from"../../../../geometry/projectionUtils.js";import{e as b}from"../../../../chunks/containsOperator.js";import{e as j}from"../../../../chunks/convexHullOperator.js";import{e as E}from"../../../../chunks/simplifyOperator.js";import{e as R}from"../../../../chunks/unionOperator.js";import{computeTranslationToOriginAndRotation as C}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as T}from"../../../../geometry/projection/projectBoundingRect.js";import{fromExtent as G,intersects as L,create as O,empty as x}from"../../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as I}from"../../../../geometry/support/DoubleArray.js";import{t as D}from"../../../../chunks/vec3.js";import H from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as M}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as V}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementInsufficientDataError as A,VolumeMeasurementPerimeterTooLargeError as P,VolumeMeasurementUnsupportedCoordinateSystemError as U,VolumeMeasurementUnsupportedLayerTransparencyError as k}from"./volumeMeasurementErrors.js";import{VolumeMeasurementRawResult as S}from"./VolumeMeasurementRawResult.js";import F from"./VolumeMeasurementResult.js";import{ElevationContext as W}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as N}from"../../support/ElevationProvider.js";import{polygonToRenderInfo as z}from"../../support/renderInfoUtils/polygon.js";import{IteratorPreorder as q}from"../../terrain/tileUtils.js";import{CutFillDepth as B,TargetGeometryRenderInfo as Z}from"../../webgl-engine/lib/CutFillDepth.js";import{isIntegratedMeshLayerView as J}from"../../../support/layerViewUtils.js";import{MeasurementWorkerHandle as K}from"../../../support/MeasurementWorkerHandle.js";let Q=class extends r{constructor(e){super(e),this._measurementWorkerHandle=new K,this._getElevationProvider=()=>this.view.elevationProvider,this.labelAnchors=null,this._updatingHandles=new _,this._rawResult=null,this._sufficientDataCoverage=!0,this._tileIterator=new q,this._intersectingObbs=[],this._intersectingTiles=[],this._debouncedUpdate=i(async(e,t,r,o)=>{if(!this._renderer.done)return;const{renderCoordsHelper:i}=this.view,n=new V({extent:t,localOrigin:r,renderCoordsHelper:i});this._renderer.update(n,o),this._determineDataCoverage(n);const[a]=await Promise.allSettled([this._measurementWorkerHandle.areaHorizontal(e,{returnLength:!0}),s(()=>this._renderer.done).then(()=>{this._updateLabelAnchors(n,this._renderer.getResults())})]);if(this.error)return void(this._rawResult=null);const l=this._renderer.getResults();this._updateResult(n,l,"fulfilled"===a.status?a.value:null)}),this._determineDataCoverage=e=>{const{elevationAlignedGeometry:t}=this,{frustum:r}=this._renderer,{cameraDimensions:o}=e;t&&r&&(this._intersectingObbs.length=0,this._imLayerViewsAffectingMeasurement.forEach(e=>{this._findIntersectingObbs(e,r)}),this._intersectingObbs.length?this._sufficientDataCoverage=this._sufficientIntegratedMeshCoverage(t,o):(this._findIntersectingTerrainTiles(t),this._sufficientDataCoverage=this._sufficientTerrainCoverage(o)))}}initialize(){const e=this.view;this._renderer=new B({view:e}),this.addHandles([this._createElevationUpdateHandle(),a(()=>({projectedGeometry:this._projectedGeometry,localOrigin:this._localOrigin,targetGeometryRenderInfos:this._targetGeometryRenderInfos}),({projectedGeometry:e,localOrigin:t,targetGeometryRenderInfos:r})=>{const o=e?.extent;if(!(e&&o&&t&&r))return this._rawResult=null,void(this._sufficientDataCoverage=!0);this._updatingHandles.addPromise(this._debouncedUpdate(e,o,t,r))},l)])}destroy(){this._updatingHandles.destroy(),this._renderer.destroy(),this._measurementWorkerHandle.destroy()}get _projectedGeometry(){const e=this.analysis.geometry;if(!e||!this.analysis.valid)return null;const t=E(e),r=w(t,this.view.spatialReference);return r.pending?(this._updatingHandles.addPromise(r.pending),null):(t&&!r.geometry&&M(this.analysis,e.spatialReference,o.getLogger(this)),r.geometry)}get _localOrigin(){const e=this._projectedGeometry?.extent;return e?g(e.center.x,e.center.y,0):null}get elevationAlignedGeometry(){const e=this._projectedGeometry;if(!e)return null;const t=e.clone();return X(this._getElevationProvider(),t),t}get targetGeometry(){const{elevationAlignedGeometry:e}=this;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings.forEach(e=>e.forEach(e=>e[2]=r)),o}get _targetGeometryRenderInfos(){const e=this.targetGeometry,t=this._projectedGeometry?.extent,r=this._localOrigin;if(!e||!t||!r)return null;const{elevationProvider:o,renderCoordsHelper:i}=this.view,n=z(e,o,i,W.fromElevationInfo(new H({mode:"absolute-height"}))),{polygons:s}=n;return s.map(e=>{const o=c(e.position,e.holeIndices,3),n=I(3*e.count),s=m(),a=m();return C(t.spatialReference,r,s,i.spatialReference),a[12]=-s[12],a[13]=-s[13],a[14]=-s[14],D(n,e.position,a),new Z(n,o)})}get updating(){return this._renderer.updating||this._updatingHandles.updating}get result(){const e=this._rawResult,{volume:t,area:r,length:o}=this.analysisViewData.effectiveDisplayUnits;return e?new F({measureType:this.analysis.measureType,rawResult:e,volumeUnit:t,areaUnit:r,lengthUnit:o}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._perimeterTooLargeError??this._insufficientDataError}get _imLayerViewsAffectingMeasurement(){return this.view.allLayerViews.filter(e=>J(e)).filter(e=>e.visible&&!e.suspended)}get _insufficientDataError(){return this._sufficientDataCoverage?null:new A}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){const{spatialReference:e,state:{isLocal:r}}=this.view;if(!r||!e.isWebMercator)return null;const o=this._perimeter,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new P:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeter,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new P:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new U:null}get _unsupportedLayerTransparencyError(){return this.view.map.ground&&this.view.map.ground.opacity<1?new k:null}get _perimeter(){if(!this._targetGeometryRenderInfos)return null;let e=null;for(const t of this._targetGeometryRenderInfos){const r=$(ee(t.positions));e=r?Math.max(e??0,r):e}return null!=e?e/this.view.renderCoordsHelper.unitInMeters:null}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&t&&(T(e.extent,e.spatialReference,re,this.view.spatialReference),G(t,oe),L(re,oe)&&(this._getElevationProvider=()=>this.view.elevationProvider))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(e,t,r){const{unitInMeters:o}=this.view.renderCoordsHelper,{dimensions:{width:i,height:s},cameraNearFar:{near:a,far:l}}=e,u=i/t.width*(s/t.height),p=Y(t.cut.totalDepth,a,l)*u,c=Y(t.fill.totalDepth,a,l)*u,m=o**3;this._rawResult=new S({cutVolume:n(Math.abs(p*m),"cubic-meters"),fillVolume:n(c*m,"cubic-meters"),area:r?.area,perimeter:r?.length})}_updateLabelAnchors(e,t){const{dimensions:{width:r,height:o},cameraNearFar:{near:i,far:n},cameraPositionRenderSpace:s,northVector:a,eastVector:l,upVector:u}=e,p=e=>{const{labelDepth:p,labelCoords:c,totalDepth:m}=e,h=f(s);return 0!==m&&(d(h,h,l,r*(c[0]/t.width-.5)),d(h,h,a,o*(c[1]/t.height-.5))),d(h,h,u,-Y(p,i,n)),h};this.labelAnchors={cut:p(t.cut),fill:p(t.fill)}}_findIntersectingObbs(e,t){const r=this._intersectingObbs;"integrated-mesh-3d"===e.type&&e.getVisibleNodes().forEach(o=>{e.isNodeLoaded(o.index)&&o.geometryObbInRenderSR?.intersectsFrustum(t)&&r.push(o.geometryObbInRenderSR)}),"integrated-mesh-3dtiles"===e.type&&e.forEachVisibleComponentObject(({obb:e})=>{e.intersectsFrustum(t)&&r.push(e)})}_sufficientIntegratedMeshCoverage(e,t){const{renderCoordsHelper:r,spatialReference:o}=this.view,i=[],n=new v({spatialReference:o});if(this._intersectingObbs.forEach(e=>{if(te(e.radius,t)&&(e.getCorners(ne),n.points.length=0,ne.forEach(e=>{const t=r.fromRenderCoords(e,se,o);t&&n.addPoint([t[0],t[1]])}),n.points.length)){const e=j(n);"polygon"===e?.type&&i.push(e)}}),!i.length)return!1;const s=R(i);return!!s&&b(s,e)}_findIntersectingTerrainTiles(e){const{basemapTerrain:t}=this.view;if(this._intersectingTiles.length=0,!e.extent)return;G(e.extent,ie);const r=this._tileIterator;r.reset(t.rootTiles);for(let o=r.next();o;o=r.next())o.intersectsExtent(ie)?o.rendered&&this._intersectingTiles.push(o):r.skipSubtree()}_sufficientTerrainCoverage(e){const{basemapTerrain:{tilingScheme:t}}=this.view,r=256/t.pixelSize;return this._intersectingTiles.every(t=>te(t.radius*r,e))}};function X(e,t){t.hasZ=!0,t.rings.forEach(t=>t.forEach(t=>t[2]=N(e,t,"ground")??0))}function Y(e,t,r){return e*(r-t)+t}function $(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1],i[2]??0]),r?o+=h(r,i):r=[0,0,0],r[0]=i[0],r[1]=i[1],r[2]=i[2];return t&&r&&(o+=h(r,t)),Math.sqrt(o)}function*ee(e){const t=y();for(let r=0;r<e.length;r+=3)t[0]=e[r],t[1]=e[r+1],t[2]=e[r+2],yield t}e([u()],Q.prototype,"_projectedGeometry",null),e([u()],Q.prototype,"_localOrigin",null),e([u()],Q.prototype,"_getElevationProvider",void 0),e([u()],Q.prototype,"elevationAlignedGeometry",null),e([u()],Q.prototype,"targetGeometry",null),e([u()],Q.prototype,"_targetGeometryRenderInfos",null),e([u({constructOnly:!0})],Q.prototype,"analysis",void 0),e([u({constructOnly:!0})],Q.prototype,"analysisViewData",void 0),e([u({constructOnly:!0})],Q.prototype,"view",void 0),e([u()],Q.prototype,"updating",null),e([u()],Q.prototype,"result",null),e([u()],Q.prototype,"labelAnchors",void 0),e([u()],Q.prototype,"error",null),e([u()],Q.prototype,"_imLayerViewsAffectingMeasurement",null),e([u()],Q.prototype,"_insufficientDataError",null),e([u()],Q.prototype,"_perimeterTooLargeError",null),e([u()],Q.prototype,"_perimeterTooLargeLocalError",null),e([u()],Q.prototype,"_perimeterTooLargeGlobalError",null),e([u()],Q.prototype,"_unsupportedCoordinateSystemError",null),e([u()],Q.prototype,"_unsupportedLayerTransparencyError",null),e([u()],Q.prototype,"_perimeter",null),e([u()],Q.prototype,"_renderer",void 0),e([u({readOnly:!0})],Q.prototype,"_updatingHandles",void 0),e([u()],Q.prototype,"_rawResult",void 0),e([u()],Q.prototype,"_sufficientDataCoverage",void 0),Q=e([p("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],Q);const te=(e,t)=>e<(t.width+t.height)/2,re=x(),oe=x(),ie=O(),ne=new Array(8).fill(0).map(()=>y()),se=y();export{Q as VolumeMeasurementCutFillController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as i,fetchMessageBundle as s}from"../../../../intl.js";import{volumeMeasurementConfiguration as o}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import{equals as l}from"../../../../core/arrayUtils.js";import{cyclicalPI as n}from"../../../../core/Cyclical.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{formatDecimal as c,preferredVolumePrecision as u}from"../../../../core/quantityFormatUtils.js";import{watch as m,initial as d}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as h}from"../../../../core/units.js";import{property as p,subclass as g}from"../../../../core/accessorSupport/decorators.js";import{e as y}from"../../../../chunks/earcut.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f,normalize as v,subtract as j,cross as b,dot as L}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as C,fromValues as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as G}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as P}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as V}from"../../../../geometry/support/Indices.js";import{angleAroundAxis as R}from"../../../../geometry/support/vector.js";import{t as F}from"../../../../chunks/vec3.js";import A from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as x}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as O}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as D}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as M}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as U}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as S}from"../../layers/graphics/extrudeUtils.js";import{polygonToRenderInfo as E}from"../../support/renderInfoUtils/polygon.js";import{CutFillColor as B,VolumeGeometry as N}from"../../webgl-engine/lib/CutFillColor.js";import{createStipplePatternSimple as T}from"../../webgl-engine/materials/lineStippleUtils.js";let H=class extends r{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages}get hasUnsupportedError(){const{error:e}=this.analysisViewData;return!!e&&["unsupported-coordinate-system","unsupported-layer-transparency"].includes(e.name)}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._elevationContext=U.fromElevationInfo(new A({mode:"absolute-height"})),this._extrusionHeight=o.targetElevationRange,this._projectionLines=[]}initialize(){const{view:e}=this,i={view:e,isDecoration:!0},s=o,r={...i,width:s.geometryOutlineWidth};this._elevationAlignedGeometry=new D({...r,isDraped:!0,color:s.geometryOutlineColor.toUnitRGBA()}),this._targetGeometry=new D(r);const l={...i,attached:!0,width:s.projectionLineWidth,renderOccluded:4,polygonOffset:!0},n={...l,stipplePattern:T(s.projectionLineStippleSize)},a=s.cutProjectionLineColor.toUnitRGBA(),c=s.fillProjectionLineColor.toUnitRGBA();this._cutProjectionLines=new O({...l,color:a}),this._occludedCutProjectionLines=new O({...n,color:a}),this._fillProjectionLines=new O({...l,color:c}),this._occludedFillProjectionLines=new O({...n,color:c});const u={...i,attached:!0};this._cutVolumeLabel=new x({...u,distance:s.labelDistance}),this._fillVolumeLabel=new x({...u,distance:-s.labelDistance}),this._cutFillRenderNode=new B({view:e,cutColor:s.cutColor,fillColor:s.fillColor,borderColor:s.geometryOutlineColor}),this.addHandles([m(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},d),m(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i,this._cutFillRenderNode.measureType=i},d),m(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i),d),m(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor,hasResult:!!this.analysisViewData.result}),({interactive:e,accentColor:t,hasResult:i})=>{this._updateColors(e,t,i)},d),m(()=>this.analysisViewData.targetGeometry,()=>this._updateCutFillGeometry(),d),m(()=>this.visible&&!this.hasUnsupportedError,e=>this._updateCutFillVisibility(e),d),m(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{labelAnchors:s.labelAnchors,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i&&!!s.result}},e=>this._updateLabels(e)),m(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e),d),t(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=a(this._elevationAlignedGeometry),this._targetGeometry=a(this._targetGeometry),this._cutProjectionLines=a(this._cutProjectionLines),this._occludedCutProjectionLines=a(this._occludedCutProjectionLines),this._fillProjectionLines=a(this._fillProjectionLines),this._occludedFillProjectionLines=a(this._occludedFillProjectionLines),this._cutVolumeLabel=a(this._cutVolumeLabel),this._fillVolumeLabel=a(this._fillVolumeLabel),this._cutFillRenderNode.destroy()}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:s}=this.view,o=[],r=[],n=[],a=[],c=[],u=e.spatialReference;for(let m=0;m<e.rings.length;m++){const i=e.rings[m],d=i.length>1&&l(i[0],i[i.length-1]),h=i.length-(d?1:0),p=[];for(let e=0;e<h;++e){const o=i[e],r=f(C(),o[0],o[1],o[2]);s.toRenderCoords(r,u,r);const l=t.rings[m][e],n=f(C(),l[0],l[1],l[2]);s.toRenderCoords(n,u,n);const a=new M(r,n);p.push(a)}e.isClockwise(i)||p.reverse();const g=this.view.state.camera;for(let s=0;s<p.length;++s){const i=p[s],l=p[0===s?p.length-1:s-1],u=p[s===p.length-1?0:s+1],d=e.rings[m][s],h=t.rings[m][s],y=d[2]>h[2],_=new k(i,l,u,y);o.push(_),_.updateOccluded(g);const f=_.isOccluded;y?(f?n:r).push(i):(f?c:a).push(i)}}this._projectionLines=o,this._cutProjectionLines.setGeometryFromSegments(r),this._occludedCutProjectionLines.setGeometryFromSegments(n),this._fillProjectionLines.setGeometryFromSegments(a),this._occludedFillProjectionLines.setGeometryFromSegments(c)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let r=!1,l=!1;for(const n of this._projectionLines){n.updateOccluded(e)&&(r||=n.isCut,l||=!n.isCut);const a=n.isOccluded;(n.isCut?a?i:t:a?o:s).push(n.segment)}l&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),r&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,t,i){const{geometryOutlineColor:s,cutColor:r,fillColor:l,cutColorMuted:n,fillColorMuted:a,cutProjectionLineColor:c,fillProjectionLineColor:u}=o;if(this._cutFillRenderNode.cutColor=i?r:n,this._cutFillRenderNode.fillColor=i?l:a,e){const e=t.toUnitRGBA();this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillRenderNode.borderColor=t}else{this._targetGeometry.color=s.toUnitRGBA();const e=(i?c:n).toUnitRGBA();this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const t=(i?u:a).toUnitRGBA();this._fillProjectionLines.color=t,this._occludedFillProjectionLines.color=t,this._cutFillRenderNode.borderColor=s}}_updateLabels(e){const{effectiveDisplayUnits:t,labelAnchors:s,messages:o,unitsMessages:r,result:l,visible:n}=e;if(this._cutVolumeLabel.visible=n,this._fillVolumeLabel.visible=n,this._cutVolumeLabel.geometry=s?{type:"point",point:s.cut}:null,this._fillVolumeLabel.geometry=s?{type:"point",point:s.fill}:null,null==l||null==o||null==r)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const a=t.volume,c=i(o.labels.cut,{volume:I(r,l.cutVolume,a)}),u=i(o.labels.fill,{volume:I(r,l.fillVolume,a)});this._cutVolumeLabel.text=c,this._fillVolumeLabel.text=u}_updateCutFillVisibility(e){e?this._cutFillRenderNode.enable():this._cutFillRenderNode.disable()}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData;if(!t?.extent)return;const{center:i}=t.extent,s=w(i.x,i.y,0),o=C();e.toRenderCoords(s,t.spatialReference,o);const r=this._getExtrudedVolumes(t,this._extrusionHeight,s,o),l=this._getExtrudedVolumes(t,-this._extrusionHeight,s,o);this._cutFillRenderNode.updateGeometries(r,l,o)}_getExtrudedVolumes(e,t,i,s){const{renderCoordsHelper:o,spatialReference:r,elevationProvider:l}=this.view,n=C(),a=1===o.viewingMode;o.worldUpAtPosition(s,n);const c=E(e,l,o,this._elevationContext),{polygons:u,mapPositions:m,position:d}=c;return u.map(e=>{const s=e.count,l=y(e.mapPositions,e.holeIndices,3),c=l.length,u=6*s,h=V(u+c),p=V(c),g=P(3*u),f=P(3*u);S(d,m,l,e,g,null,f,null,h,p,t,n,a);const v=_(),j=_();if(G(r,i,v,o.spatialReference),j[12]=-v[12],j[13]=-v[13],j[14]=-v[14],F(g,g,j),"stockpile"===this.analysis.measureType)for(let t=0;t<f.length;t+=3)f[t]=n[0],f[t+1]=n[1],f[t+2]=n[2];return new N(g,p,h,f)})}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await s("esri/core/t9n/Units"),this.messages=await s("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function I(e,t,i){if(!t||!e)return null;const s=h(t.value,t.unit,i),o=u(s);return c(e,t,s,o)}e([p({constructOnly:!0})],H.prototype,"view",void 0),e([p({constructOnly:!0})],H.prototype,"analysis",void 0),e([p({constructOnly:!0})],H.prototype,"analysisViewData",void 0),e([p()],H.prototype,"unitsMessages",void 0),e([p()],H.prototype,"messages",void 0),e([p()],H.prototype,"loadingMessages",void 0),e([p({readOnly:!0})],H.prototype,"visible",null),e([p()],H.prototype,"updating",null),e([p()],H.prototype,"hasUnsupportedError",null),H=e([g("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],H);class k{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=C(),this._n2=C();const o=v(z,j(z,e.endRenderSpace,e.startRenderSpace));v(this._n1,b(this._n1,o,v(W,j(W,t.startRenderSpace,e.startRenderSpace)))),v(this._n2,b(this._n2,o,v(W,j(W,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=n.normalize(R(this._n1,this._n2,o))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){j(z,this.segment.startRenderSpace,e.eye);const t=L(this._n1,z)<0,i=L(this._n2,z)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const z=C(),W=C();export{H as VolumeMeasurementCutFillVisualization};
2
+ import{__decorate as e}from"tslib";import{onLocaleChange as t,substitute as i,fetchMessageBundle as s}from"../../../../intl.js";import{volumeMeasurementConfiguration as o}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import{equals as l}from"../../../../core/arrayUtils.js";import{cyclicalPI as n}from"../../../../core/Cyclical.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{formatDecimal as c,preferredVolumePrecision as u}from"../../../../core/quantityFormatUtils.js";import{watch as m,initial as d}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as h}from"../../../../core/units.js";import{property as p,subclass as g}from"../../../../core/accessorSupport/decorators.js";import{e as y}from"../../../../chunks/earcut.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f,normalize as v,subtract as j,cross as b,dot as L}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as C,fromValues as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as G}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as V}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as P}from"../../../../geometry/support/Indices.js";import{angleAroundAxis as R}from"../../../../geometry/support/vector.js";import{t as F}from"../../../../chunks/vec3.js";import A from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as x}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as M}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as O}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as D}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as U}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as S}from"../../layers/graphics/extrudeUtils.js";import{polygonToRenderInfo as E}from"../../support/renderInfoUtils/polygon.js";import{CutFillColor as B,VolumeGeometry as N}from"../../webgl-engine/lib/CutFillColor.js";import{createStipplePatternSimple as H}from"../../webgl-engine/materials/lineStippleUtils.js";let T=class extends r{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages}get hasUnsupportedError(){const{error:e}=this.analysisViewData;return!!e&&["unsupported-coordinate-system","unsupported-layer-transparency"].includes(e.name)}get _extrusionHeights(){const{renderCoordsHelper:e}=this.view,{labelAnchors:t,targetGeometry:i}=this.analysisViewData,{targetElevationRange:s}=o;if(!i||!t)return{cut:s,fill:-s};let r=-1/0;for(const o of i.rings)for(const e of o)r=Math.max(r,e[2]);const l=1,n=e.getAltitude(t.fill);return{cut:s,fill:Math.min(n-r,0)-l}}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._elevationContext=U.fromElevationInfo(new A({mode:"absolute-height"})),this._projectionLines=[]}initialize(){const{view:e}=this,i={view:e,isDecoration:!0},s=o,r={...i,width:s.geometryOutlineWidth};this._elevationAlignedGeometry=new O({...r,isDraped:!0,color:s.geometryOutlineColor.toUnitRGBA()}),this._targetGeometry=new O(r);const l={...i,attached:!0,width:s.projectionLineWidth,renderOccluded:4,polygonOffset:!0},n={...l,stipplePattern:H(s.projectionLineStippleSize)},a=s.cutProjectionLineColor.toUnitRGBA(),c=s.fillProjectionLineColor.toUnitRGBA();this._cutProjectionLines=new M({...l,color:a}),this._occludedCutProjectionLines=new M({...n,color:a}),this._fillProjectionLines=new M({...l,color:c}),this._occludedFillProjectionLines=new M({...n,color:c});const u={...i,attached:!0};this._cutVolumeLabel=new x({...u,distance:s.labelDistance}),this._fillVolumeLabel=new x({...u,distance:-s.labelDistance}),this._cutFillRenderNode=new B({view:e,cutColor:s.cutColor,fillColor:s.fillColor,borderColor:s.geometryOutlineColor}),this.addHandles([m(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},d),m(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i,this._cutFillRenderNode.measureType=i},d),m(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i),d),m(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor,hasResult:!!this.analysisViewData.result}),({interactive:e,accentColor:t,hasResult:i})=>{this._updateColors(e,t,i)},d),m(()=>[this.analysisViewData.targetGeometry,this._extrusionHeights],()=>this._updateCutFillGeometry(),d),m(()=>this.visible&&this.view.state.camera.aboveGround&&!this.hasUnsupportedError,e=>this._updateCutFillVisibility(e),d),m(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{labelAnchors:s.labelAnchors,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i&&!!s.result}},e=>this._updateLabels(e)),m(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e),d),t(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=a(this._elevationAlignedGeometry),this._targetGeometry=a(this._targetGeometry),this._cutProjectionLines=a(this._cutProjectionLines),this._occludedCutProjectionLines=a(this._occludedCutProjectionLines),this._fillProjectionLines=a(this._fillProjectionLines),this._occludedFillProjectionLines=a(this._occludedFillProjectionLines),this._cutVolumeLabel=a(this._cutVolumeLabel),this._fillVolumeLabel=a(this._fillVolumeLabel),this._cutFillRenderNode.destroy()}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:s}=this.view,o=[],r=[],n=[],a=[],c=[],u=e.spatialReference;for(let m=0;m<e.rings.length;m++){const i=e.rings[m],d=i.length>1&&l(i[0],i[i.length-1]),h=i.length-(d?1:0),p=[];for(let e=0;e<h;++e){const o=i[e],r=f(C(),o[0],o[1],o[2]);s.toRenderCoords(r,u,r);const l=t.rings[m][e],n=f(C(),l[0],l[1],l[2]);s.toRenderCoords(n,u,n);const a=new D(r,n);p.push(a)}e.isClockwise(i)||p.reverse();const g=this.view.state.camera;for(let s=0;s<p.length;++s){const i=p[s],l=p[0===s?p.length-1:s-1],u=p[s===p.length-1?0:s+1],d=e.rings[m][s],h=t.rings[m][s],y=d[2]>h[2],_=new k(i,l,u,y);o.push(_),_.updateOccluded(g);const f=_.isOccluded;y?(f?n:r).push(i):(f?c:a).push(i)}}this._projectionLines=o,this._cutProjectionLines.setGeometryFromSegments(r),this._occludedCutProjectionLines.setGeometryFromSegments(n),this._fillProjectionLines.setGeometryFromSegments(a),this._occludedFillProjectionLines.setGeometryFromSegments(c)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let r=!1,l=!1;for(const n of this._projectionLines){n.updateOccluded(e)&&(r||=n.isCut,l||=!n.isCut);const a=n.isOccluded;(n.isCut?a?i:t:a?o:s).push(n.segment)}l&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),r&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,t,i){const{geometryOutlineColor:s,cutColor:r,fillColor:l,cutColorMuted:n,fillColorMuted:a,cutProjectionLineColor:c,fillProjectionLineColor:u}=o;if(this._cutFillRenderNode.cutColor=i?r:n,this._cutFillRenderNode.fillColor=i?l:a,e){const e=t.toUnitRGBA();this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillRenderNode.borderColor=t}else{this._targetGeometry.color=s.toUnitRGBA();const e=(i?c:n).toUnitRGBA();this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const t=(i?u:a).toUnitRGBA();this._fillProjectionLines.color=t,this._occludedFillProjectionLines.color=t,this._cutFillRenderNode.borderColor=s}}_updateLabels(e){const{effectiveDisplayUnits:t,labelAnchors:s,messages:o,unitsMessages:r,result:l,visible:n}=e;if(this._cutVolumeLabel.visible=n,this._fillVolumeLabel.visible=n,this._cutVolumeLabel.geometry=s?{type:"point",point:s.cut}:null,this._fillVolumeLabel.geometry=s?{type:"point",point:s.fill}:null,null==l||null==o||null==r)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const a=t.volume,c=i(o.labels.cut,{volume:I(r,l.cutVolume,a)}),u=i(o.labels.fill,{volume:I(r,l.fillVolume,a)});this._cutVolumeLabel.text=c,this._fillVolumeLabel.text=u}_updateCutFillVisibility(e){e?this._cutFillRenderNode.enable():this._cutFillRenderNode.disable()}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData,{cut:i,fill:s}=this._extrusionHeights;if(!t?.extent)return;const{center:o}=t.extent,r=w(o.x,o.y,0),l=C();e.toRenderCoords(r,t.spatialReference,l);const n=this._getExtrudedVolumes(t,i,r,l),a=this._getExtrudedVolumes(t,s,r,l);this._cutFillRenderNode.updateGeometries(n,a,l)}_getExtrudedVolumes(e,t,i,s){const{renderCoordsHelper:o,spatialReference:r,elevationProvider:l}=this.view,n=C(),a=1===o.viewingMode;o.worldUpAtPosition(s,n);const c=E(e,l,o,this._elevationContext),{polygons:u,mapPositions:m,position:d}=c;return u.map(e=>{const s=e.count,l=y(e.mapPositions,e.holeIndices,3),c=l.length,u=6*s,h=P(u+c),p=P(c),g=V(3*u),f=V(3*u);S(d,m,l,e,g,null,f,null,h,p,t,n,a);const v=_(),j=_();if(G(r,i,v,o.spatialReference),j[12]=-v[12],j[13]=-v[13],j[14]=-v[14],F(g,g,j),"stockpile"===this.analysis.measureType)for(let t=0;t<f.length;t+=3)f[t]=n[0],f[t+1]=n[1],f[t+2]=n[2];return new N(g,p,h,f)})}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await s("esri/core/t9n/Units"),this.messages=await s("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function I(e,t,i){if(!t||!e)return null;const s=h(t.value,t.unit,i),o=u(s);return c(e,t,s,o)}e([p({constructOnly:!0})],T.prototype,"view",void 0),e([p({constructOnly:!0})],T.prototype,"analysis",void 0),e([p({constructOnly:!0})],T.prototype,"analysisViewData",void 0),e([p()],T.prototype,"unitsMessages",void 0),e([p()],T.prototype,"messages",void 0),e([p()],T.prototype,"loadingMessages",void 0),e([p({readOnly:!0})],T.prototype,"visible",null),e([p()],T.prototype,"updating",null),e([p()],T.prototype,"hasUnsupportedError",null),e([p()],T.prototype,"_extrusionHeights",null),T=e([g("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],T);class k{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=C(),this._n2=C();const o=v(z,j(z,e.endRenderSpace,e.startRenderSpace));v(this._n1,b(this._n1,o,v(W,j(W,t.startRenderSpace,e.startRenderSpace)))),v(this._n2,b(this._n2,o,v(W,j(W,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=n.normalize(R(this._n1,this._n2,o))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){j(z,this.segment.startRenderSpace,e.eye);const t=L(this._n1,z)<0,i=L(this._n2,z)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const z=C(),W=C();export{T as VolumeMeasurementCutFillVisualization};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import r from"../../../../core/Accessor.js";import t from"../../../../core/Error.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{throwIfAborted as o,createAbortError as i}from"../../../../core/promiseUtils.js";import{difference as a}from"../../../../core/SetUtils.js";import{parseWhereClause as u}from"../../../../core/sql.js";import{property as l,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{fromFeatureSetJSON as c}from"../../../../layers/graphics/dehydratedFeatures.js";import{canConvertSqlRelativeTime as y,sqlRelativeTimeToAbsolute as p}from"../../../../layers/support/relativeTimeQueryUtils.js";import{queueAutoPriority as d}from"../../../../request/queue.js";import{runQuery as h,executeQuery as m,executeQueryForCount as f}from"../../../../rest/query/operations/query.js";import{PBFDecoder as w}from"../../support/PBFDecoder.js";let F=class extends r{constructor(e){super(e)}get implicitFields(){const e=this.layer.outFields?.includes("*");if(!e)return new Set;const r=new Set(this.layerView.requiredFields),t=new Set(this.layerView.availableFields);return a(t,r)}async queryFeaturesDehydrated(e,r){const{layer:t}=this,s=t.capabilities,a=s?.query?.supportsFormatPBF,l=t.parsedUrl,n=y(e.where)?await p(e.where,s.query.relativeTimeBinWindow):e.where,d=e.where;let f;if(n!==e.where&&((e=e.clone()).where=n),a){null==this._decoder&&(this._decoder=new w(this.controller));const s={sourceSpatialReference:t.spatialReference?.toJSON()??null,applyTransform:!0,maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:v};f=await h(l,e,"pbf",this._createRequestOptions(r)).then(e=>(o(r),null!=this._decoder?this._decoder.invoke({buffer:e,options:s},r.signal):Promise.reject(i())))}else f=await m(l,e,t.spatialReference,this._createRequestOptions(r)).then(e=>c(e,{maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:v}));if(d&&e.where!==d){const e=await this.controller.schedule(()=>u(d,this.layer.fieldsIndex),r.signal);f.features=await this.controller.schedule(()=>f.features.filter(r=>e.testFeatureCompiled(r)),r.signal)}return f}queryFeatureCount(e,r){return f(this.layer.parsedUrl,e,this._createRequestOptions(r))}destroy(){this._decoder=s(this._decoder)}_createRequestOptions(e){return{...d,...e,query:{...this.layer.customParameters,token:this.layer.apiKey,...e?.query}}}};e([l({constructOnly:!0})],F.prototype,"layer",void 0),e([l({constructOnly:!0})],F.prototype,"layerView",void 0),e([l({constructOnly:!0})],F.prototype,"controller",void 0),e([l({readOnly:!0})],F.prototype,"implicitFields",null),F=e([n("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceQuery3D")],F);let q=class extends r{constructor(e){super(e)}queryFeaturesDehydrated(e,r){return this.layer.queryFeatures(e,r)}};e([l({constructOnly:!0})],q.prototype,"layer",void 0),q=e([n("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileOGCServiceQuery3D")],q);let g=class extends r{constructor(e){super(e)}queryFeaturesDehydrated(e,r){return this.layer.source.queryFeaturesJSON(e,r).then(c,t=>{if(t&&"query-features-json:unsupported"===t.name)return this.layer.queryFeatures(e,r);throw t})}queryFeatureCount(e,r){return this.layer.queryFeatureCount(e,r)}};function j(e,r){const{layer:s}=e;switch(s.type){case"feature":switch(s.source.type){case"feature-layer":return new F({layer:s,layerView:e,controller:r});case"memory":return new g({layer:s});case"csv":case"geojson":case"oriented-imagery":case"wfs":case"ogc-feature":case"parquet":break;default:s.source.type}break;case"catalog-footprint":return new F({layer:s,layerView:e,controller:r});case"csv":case"geojson":case"oriented-imagery":case"wfs":return new g({layer:s});case"ogc-feature":return new q({layer:s})}throw new t("feature-layer:unsupported",`Unsupported Feature layer type ${e.layer.type}:${e.layer.source.type}`)}e([l({constructOnly:!0})],g.prototype,"layer",void 0),g=e([n("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileClientQuery3D")],g);const v=1024;export{j as createFeatureTileQuery3D};
2
+ import{__decorate as e}from"tslib";import r from"../../../../core/Accessor.js";import t from"../../../../core/Error.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{throwIfAborted as o,createAbortError as i}from"../../../../core/promiseUtils.js";import{difference as a}from"../../../../core/SetUtils.js";import{parseWhereClause as u}from"../../../../core/sql.js";import{property as l,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{fromFeatureSetJSON as c}from"../../../../layers/graphics/dehydratedFeatures.js";import{canConvertSqlRelativeTime as y,sqlRelativeTimeToAbsolute as p}from"../../../../layers/support/relativeTimeQueryUtils.js";import{queueAutoPriority as d}from"../../../../request/queue.js";import{runQuery as h,executeQuery as m,executeQueryForCount as f}from"../../../../rest/query/operations/query.js";import{PBFDecoder as w}from"../../support/PBFDecoder.js";let F=class extends r{constructor(e){super(e)}get implicitFields(){const e=this.layer.outFields?.includes("*");if(!e)return new Set;const r=new Set(this.layerView.requiredFields),t=new Set(this.layerView.availableFields);return a(t,r)}async queryFeaturesDehydrated(e,r){const{layer:t}=this,s=t.capabilities,a=s?.query?.supportsFormatPBF,l=t.parsedUrl,n=y(e.where)?await p(t.fieldsIndex,e.where,s.query.relativeTimeBinWindow):e.where,d=e.where;let f;if(n!==e.where&&((e=e.clone()).where=n),a){null==this._decoder&&(this._decoder=new w(this.controller));const s={sourceSpatialReference:t.spatialReference?.toJSON()??null,applyTransform:!0,maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:v};f=await h(l,e,"pbf",this._createRequestOptions(r)).then(e=>(o(r),null!=this._decoder?this._decoder.invoke({buffer:e,options:s},r.signal):Promise.reject(i())))}else f=await m(l,e,t.spatialReference,this._createRequestOptions(r)).then(e=>c(e,{maxStringAttributeFields:this.implicitFields,maxStringAttributeLength:v}));if(d&&e.where!==d){const e=await this.controller.schedule(()=>u(d,this.layer.fieldsIndex),r.signal);f.features=await this.controller.schedule(()=>f.features.filter(r=>e.testFeatureCompiled(r)),r.signal)}return f}queryFeatureCount(e,r){return f(this.layer.parsedUrl,e,this._createRequestOptions(r))}destroy(){this._decoder=s(this._decoder)}_createRequestOptions(e){return{...d,...e,query:{...this.layer.customParameters,token:this.layer.apiKey,...e?.query}}}};e([l({constructOnly:!0})],F.prototype,"layer",void 0),e([l({constructOnly:!0})],F.prototype,"layerView",void 0),e([l({constructOnly:!0})],F.prototype,"controller",void 0),e([l({readOnly:!0})],F.prototype,"implicitFields",null),F=e([n("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceQuery3D")],F);let q=class extends r{constructor(e){super(e)}queryFeaturesDehydrated(e,r){return this.layer.queryFeatures(e,r)}};e([l({constructOnly:!0})],q.prototype,"layer",void 0),q=e([n("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileOGCServiceQuery3D")],q);let g=class extends r{constructor(e){super(e)}queryFeaturesDehydrated(e,r){return this.layer.source.queryFeaturesJSON(e,r).then(c,t=>{if(t&&"query-features-json:unsupported"===t.name)return this.layer.queryFeatures(e,r);throw t})}queryFeatureCount(e,r){return this.layer.queryFeatureCount(e,r)}};function j(e,r){const{layer:s}=e;switch(s.type){case"feature":switch(s.source.type){case"feature-layer":return new F({layer:s,layerView:e,controller:r});case"memory":return new g({layer:s});case"csv":case"geojson":case"oriented-imagery":case"wfs":case"ogc-feature":case"parquet":break;default:s.source.type}break;case"catalog-footprint":return new F({layer:s,layerView:e,controller:r});case"csv":case"geojson":case"oriented-imagery":case"wfs":return new g({layer:s});case"ogc-feature":return new q({layer:s})}throw new t("feature-layer:unsupported",`Unsupported Feature layer type ${e.layer.type}:${e.layer.source.type}`)}e([l({constructOnly:!0})],g.prototype,"layer",void 0),g=e([n("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileClientQuery3D")],g);const v=1024;export{j as createFeatureTileQuery3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{destroyMaybe as e}from"../../../../core/maybe.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{on as o}from"../../../../core/reactiveUtils.js";import{property as i,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{distance as n,exactEquals as a,copy as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../../geometry/Point.js";import{distanceToScale as h}from"../cameraUtils.js";import{PointOfInterest as p}from"./PointOfInterest.js";import{PropertiesPool as u}from"../../../support/PropertiesPool.js";import{Yield as m}from"../../../support/Yield.js";let _=class extends p{constructor(t){super(t),this._dirty=!1,this._propertiesPool=new u({location:()=>new c,renderLocation:()=>d()},this),this._estimatedSurfaceAltitude=0,this._elevationQueryController=null,this.renderLocation=d(),this._tmpPoint=new c}initialize(){if(this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.runTask(),this.map){const t=()=>this._setDirty();this.addHandles(o(()=>this.map?.ground?.layers,"change",t,{onListenerAdd:t,onListenerRemove:t}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=e(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool.get("location");return t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t}get scale(){const t=this._camera,e=n(t.eye,this.renderLocation),r={renderCoordsHelper:this.renderCoordsHelper,state:{camera:t}};return h(r,e)}get updating(){return this._dirty||null!=this._elevationQueryController}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const t=this._elevationQueryController;t&&(this._elevationQueryController=null,t.abort(),this.notifyChange("updating"))}get readyToRun(){return!this._elevationQueryController&&this._dirty}runTask(){if(this._cancelPendingRequest(),this._dirty=!1,this.notifyChange("updating"),!this.map?.ground)return this._updateSurfaceAltitude(0),m;const t=this.state.spatialReference;this._tmpPoint.spatialReference=t,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);const e=(this._tmpPoint.z??0)>f&&1===this.renderCoordsHelper.viewingMode&&(t.isWGS84||t.isWebMercator);let o=new AbortController;return this.map.ground.queryElevation(this._tmpPoint,{signal:o.signal,cache:this.cache,minDemResolution:e?g:0}).then(t=>this._updateSurfaceAltitude(t.geometry.z??0)).catch(t=>{r(t)||this._updateSurfaceAltitude(0)}).then(()=>{this._elevationQueryController===o&&(this._elevationQueryController=null,this.notifyChange("updating")),o=null}),this._elevationQueryController=o,m}_updateSurfaceAltitude(t){this._estimatedSurfaceAltitude!==t&&(this._estimatedSurfaceAltitude=t,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(y,this._estimatedSurfaceAltitude,this._camera.eye),a(this._get("renderLocation"),y)||(this._set("renderLocation",l(this._propertiesPool.get("renderLocation"),y)),this.notifyChange("renderLocation"))}};t([i({constructOnly:!0})],_.prototype,"scheduler",void 0),t([i({constructOnly:!0})],_.prototype,"cache",void 0),t([i({constructOnly:!0})],_.prototype,"map",void 0),t([i({constructOnly:!0})],_.prototype,"task",void 0),t([i()],_.prototype,"location",null),t([i()],_.prototype,"renderLocation",void 0),t([i()],_.prototype,"scale",null),t([i()],_.prototype,"updating",null),_=t([s("esri.views.3d.support.pointsOfInterest.CameraOnSurface")],_);const y=d(),f=1e5,g=1e6;export{_ as CameraOnSurface};
2
+ import{__decorate as t}from"tslib";import{destroyMaybe as e}from"../../../../core/maybe.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{on as i}from"../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{distance as n,exactEquals as a,copy as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../../geometry/Point.js";import{distanceToScale as h}from"../cameraUtils.js";import{PointOfInterest as p}from"./PointOfInterest.js";import{PropertiesPool as u}from"../../../support/PropertiesPool.js";import{Yield as m}from"../../../support/Yield.js";let _=class extends p{constructor(t){super(t),this._dirty=!1,this._propertiesPool=new u({location:()=>new c,renderLocation:()=>d()},this),this._estimatedSurfaceAltitude=0,this._elevationQueryController=null,this.renderLocation=d(),this._tmpPoint=new c}initialize(){if(this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.runTask(),this.map){const t=()=>this._setDirty();this.addHandles(i(()=>this.map?.ground?.layers,"change",t,{onListenerAdd:t,onListenerRemove:t}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=e(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const t=this._propertiesPool.get("location");return t.spatialReference=this.state.spatialReference,this.renderCoordsHelper.fromRenderCoords(this.renderLocation,t),t}get scale(){const t=this._camera,e=n(t.eye,this.renderLocation),r={renderCoordsHelper:this.renderCoordsHelper,state:{camera:t}};return h(r,e)}get updating(){return this._dirty||null!=this._elevationQueryController}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const t=this._elevationQueryController;t&&(this._elevationQueryController=null,t.abort(),this.notifyChange("updating"))}get readyToRun(){return!this._elevationQueryController&&this._dirty}runTask(){if(this._cancelPendingRequest(),this._dirty=!1,this.notifyChange("updating"),!this.map?.ground)return this._updateSurfaceAltitude(0),m;const t=this.state.spatialReference;this._tmpPoint.spatialReference=t,this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint);const e=(this._tmpPoint.z??0)>f&&1===this.renderCoordsHelper.viewingMode&&(t.isWGS84||t.isWebMercator);let i=new AbortController;return this.map.ground.queryElevation(this._tmpPoint,{signal:i.signal,cache:this.cache,minDemResolution:e?g:0}).then(t=>this._updateSurfaceAltitude(t.geometry.z??0)).catch(t=>{r(t)||this._updateSurfaceAltitude(0)}).finally(()=>{this._elevationQueryController===i&&(this._elevationQueryController=null,this.notifyChange("updating")),i=null}),this._elevationQueryController=i,this.notifyChange("updating"),m}_updateSurfaceAltitude(t){this._estimatedSurfaceAltitude!==t&&(this._estimatedSurfaceAltitude=t,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(y,this._estimatedSurfaceAltitude,this._camera.eye),a(this._get("renderLocation"),y)||(this._set("renderLocation",l(this._propertiesPool.get("renderLocation"),y)),this.notifyChange("renderLocation"))}};t([o({constructOnly:!0})],_.prototype,"scheduler",void 0),t([o({constructOnly:!0})],_.prototype,"cache",void 0),t([o({constructOnly:!0})],_.prototype,"map",void 0),t([o({constructOnly:!0})],_.prototype,"task",void 0),t([o()],_.prototype,"location",null),t([o()],_.prototype,"renderLocation",void 0),t([o()],_.prototype,"scale",null),t([o()],_.prototype,"updating",null),_=t([s("esri.views.3d.support.pointsOfInterest.CameraOnSurface")],_);const y=d(),f=1e5,g=1e6;export{_ as CameraOnSurface};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{exactEquals as e}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ComponentTechnique as s}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as t}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as i}from"../../../core/material/MaterialBase.js";import{isColor as o}from"../../../core/shaderLibrary/ShaderOutput.js";class a extends i{constructor(e,r,s,i,o){super(),this.parameters=e,this.key=o,this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this.hasEmissions=u(e,s,i),this.materialPass=n(e,s),this._configuration=new t(i.sphericalSR),this._initializeMaterialConfiguration(e,r,s,i)}destroy(){}acquireTechnique(e,r,t,i){const o=this._updateConfiguration(r,t);return e.get(s,o,i.layout)}_initializeMaterialConfiguration(e,r,s,t){const i=this._configuration;i.hasMetallicRoughnessTexture=null!=e.metallicRoughnessTexture,i.hasOcclusionTexture=null!=e.occlusionTexture,i.hasNormalTexture=null!=e.normalTexture,i.sphereDepthInterpolate=e.sphereDepthInterpolate&&i.spherical,i.ellipsoidMode=e.ellipsoidMode,i.doubleSidedMode=e.doubleSided?1:0,i.hasColorTexture=null!=e.baseColorTexture,i.cullFace=e.cullFace,i.alphaDiscardMode=e.alphaDiscardMode,i.hasVertexColors=r.hasVertexColors,i.textureCoordinateType=r.textureCoordinateType,i.shadeNormals=r.shadeNormals,i.normalType=r.hasNormals?1:2,i.hasPolygonOffset=e.polygonOffsetEnabled,i.hasModelRotationScale=r.hasModelRotationScale,i.componentDataType=s.componentDataType,i.emissionSource=c(e,s,t)}_updateConfiguration(e,r){const s=this._configuration,{identifier:t,output:i}=e,a=0===t;s.output=i,s.hasEmission=r.hasEmission&&a,s.renderOccluded=10===r.slot,s.oitPass=a?r.oitPass:0,s.terrainDepthTest=a&&r.terrainDepthTest,s.cullAboveTerrain=!!a&&r.cullAboveTerrain;const n=this.isIntegratedMesh?d(r)?h(r)?3:2:1:0;s.integratedMeshMode=n,s.pbrMode=3===n?4:this.usePBR?this.hasParametersFromSource?s.shadeNormals&&this.isIntegratedMesh?0:2:1:0,s.hasSlicePlane=null!=r.slicePlane&&this.slicePlaneEnabled,s.isGroundSlice=s.hasSlicePlane&&this.isGround;const{materialPass:l}=this;s.blendingEnabled=1===l||2===l||4===l||s.isGroundSlice,s.hasHighlightMixTexture=2===t&&null!=r.highlightMixTexture,s.snowCover=a&&r.snowCover>0,s.vertexDiscardMode=a&&2===l?e.transparent?2:1:0;const u=a&&o(i);return s.receiveAmbientOcclusion=u&&this.applySSAO&&null!=r.ssao?.getTexture(),s.hasOccludees=u&&r.hasOccludees,s.receiveShadows=u&&r.shadowMap.ready,s.screenSpaceReflections=u&&null!=r.ssr.lastFrameColor,s.cloudReflections=u&&null!=r.clouds.data?.cubeMap?.colorTexture,s}}function n(e,r){const{alphaDiscardMode:s,isIntegratedMesh:t,slicePlaneEnabled:i}=e,{transparent:o,opaqueOverride:a}=r,n=e.opacity<1,l=e.baseColor[3]<1;if(t)return n||i?4:3;if(n)return 1;if(0===a)return 0;if(l||0===s||3===s)return 1;switch(o){case 2:return 0;case 0:return 1;case 1:return 2}}function l(s){return null!=s.emissionTexture||!e(s.emissiveBaseColor,r)}function u(e,r,s){const t=l(e);return s.floatBufferBlendSupported&&2!==r.emissiveOverride&&(t||2!==r.emissiveSourceOverride)}function c(e,r,s){const t=null!=e.emissionTexture,{emissiveSourceOverride:i}=r,o=1===i,a=2===i,n=u(e,r,s),c=l(e);return n?c?a?t?4:2:o?t?5:7:6:o?7:6:0}function h(e){return null!=e.overlay?.getTexture(3)}function d(e){return null!=e.overlay?.getTexture(1)}export{a as ComponentMaterial,c as calculateEmissionSource,u as calculateHasEmissions,l as calculateHasEmissiveBase,n as computeMaterialPass};
2
+ import{exactEquals as e}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ComponentTechnique as t}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as s}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as i}from"../../../core/material/MaterialBase.js";import{isColor as o}from"../../../core/shaderLibrary/ShaderOutput.js";class a extends i{constructor(e,r,t,i,o){super(),this.parameters=e,this.key=o,this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this.hasEmissions=u(e,t,i),this.materialPass=n(e,t),this._configuration=new s(i.sphericalSR),this._initializeMaterialConfiguration(e,r,t,i)}destroy(){}acquireTechnique(e,r,s,i){const o=this._updateConfiguration(r,s);return e.get(t,o,i.layout)}_initializeMaterialConfiguration(e,r,t,s){const i=this._configuration;i.hasMetallicRoughnessTexture=null!=e.metallicRoughnessTexture,i.hasOcclusionTexture=null!=e.occlusionTexture,i.hasNormalTexture=null!=e.normalTexture,i.sphereDepthInterpolate=e.sphereDepthInterpolate&&i.spherical,i.ellipsoidMode=e.ellipsoidMode,i.doubleSidedMode=e.doubleSided?1:0,i.hasColorTexture=null!=e.baseColorTexture,i.cullFace=e.cullFace,i.alphaDiscardMode=e.alphaDiscardMode,i.hasVertexColors=r.hasVertexColors,i.textureCoordinateType=r.textureCoordinateType,i.shadeNormals=r.shadeNormals,i.normalType=r.hasNormals?1:2,i.hasPolygonOffset=e.polygonOffsetEnabled,i.hasModelRotationScale=r.hasModelRotationScale,i.componentDataType=t.componentDataType,i.emissionSource=c(e,t,s)}_updateConfiguration(e,r){const t=this._configuration,{identifier:s,output:i}=e,a=0===s;t.output=i,t.hasEmission=r.hasEmission&&a,t.renderOccluded=10===r.slot,t.oitPass=a?r.oitPass:0,t.terrainDepthTest=a&&r.terrainDepthTest,t.cullAboveTerrain=!!a&&r.cullAboveTerrain;const n=this.isIntegratedMesh?d(r)?h(r)?3:2:1:0;t.integratedMeshMode=n,t.pbrMode=3===n?4:this.usePBR?this.hasParametersFromSource?t.shadeNormals&&this.isIntegratedMesh?0:2:1:0,t.hasSlicePlane=null!=r.slicePlane&&this.slicePlaneEnabled,t.isGroundSlice=t.hasSlicePlane&&this.isGround;const{materialPass:l}=this;t.blendingEnabled=a&&(1===l||2===l&&e.transparent||4===l)||t.isGroundSlice,t.hasHighlightMixTexture=2===s&&null!=r.highlightMixTexture,t.snowCover=a&&r.snowCover>0,t.vertexDiscardMode=a&&2===l?e.transparent?2:1:0;const u=a&&o(i);return t.receiveAmbientOcclusion=u&&this.applySSAO&&null!=r.ssao?.getTexture(),t.hasOccludees=u&&r.hasOccludees,t.receiveShadows=u&&r.shadowMap.ready,t.screenSpaceReflections=u&&null!=r.ssr.lastFrameColor,t.cloudReflections=u&&null!=r.clouds.data?.cubeMap?.colorTexture,t}}function n(e,r){const{alphaDiscardMode:t,isIntegratedMesh:s,slicePlaneEnabled:i}=e,{transparent:o,opaqueOverride:a}=r,n=e.opacity<1,l=e.baseColor[3]<1;if(s)return n||i?4:3;if(n)return 1;if(0===a)return 0;if(l||0===t||3===t)return 1;switch(o){case 2:return 0;case 0:return 1;case 1:return 2}}function l(t){return null!=t.emissionTexture||!e(t.emissiveBaseColor,r)}function u(e,r,t){const s=l(e);return t.floatBufferBlendSupported&&2!==r.emissiveOverride&&(s||2!==r.emissiveSourceOverride)}function c(e,r,t){const s=null!=e.emissionTexture,{emissiveSourceOverride:i}=r,o=1===i,a=2===i,n=u(e,r,t),c=l(e);return n?c?a?s?4:2:o?s?5:7:6:o?7:6:0}function h(e){return null!=e.overlay?.getTexture(3)}function d(e){return null!=e.overlay?.getTexture(1)}export{a as ComponentMaterial,c as calculateEmissionSource,u as calculateHasEmissions,l as calculateHasEmissiveBase,n as computeMaterialPass};