@arcgis/core 5.2.0-next.79 → 5.2.0-next.80

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 (192) hide show
  1. package/WebScene.js +1 -1
  2. package/arcgisGlobal.d.ts +8 -0
  3. package/assets/components/assets/input-date-picker/t9n/messages.ar.json +1 -1
  4. package/assets/components/assets/input-date-picker/t9n/messages.bg.json +1 -1
  5. package/assets/components/assets/input-date-picker/t9n/messages.bs.json +1 -1
  6. package/assets/components/assets/input-date-picker/t9n/messages.ca.json +1 -1
  7. package/assets/components/assets/input-date-picker/t9n/messages.cs.json +1 -1
  8. package/assets/components/assets/input-date-picker/t9n/messages.da.json +1 -1
  9. package/assets/components/assets/input-date-picker/t9n/messages.de.json +1 -1
  10. package/assets/components/assets/input-date-picker/t9n/messages.el.json +1 -1
  11. package/assets/components/assets/input-date-picker/t9n/messages.es.json +1 -1
  12. package/assets/components/assets/input-date-picker/t9n/messages.et.json +1 -1
  13. package/assets/components/assets/input-date-picker/t9n/messages.fi.json +1 -1
  14. package/assets/components/assets/input-date-picker/t9n/messages.fr.json +1 -1
  15. package/assets/components/assets/input-date-picker/t9n/messages.he.json +1 -1
  16. package/assets/components/assets/input-date-picker/t9n/messages.hr.json +1 -1
  17. package/assets/components/assets/input-date-picker/t9n/messages.hu.json +1 -1
  18. package/assets/components/assets/input-date-picker/t9n/messages.id.json +1 -1
  19. package/assets/components/assets/input-date-picker/t9n/messages.it.json +1 -1
  20. package/assets/components/assets/input-date-picker/t9n/messages.ja.json +1 -1
  21. package/assets/components/assets/input-date-picker/t9n/messages.ko.json +1 -1
  22. package/assets/components/assets/input-date-picker/t9n/messages.lt.json +1 -1
  23. package/assets/components/assets/input-date-picker/t9n/messages.lv.json +1 -1
  24. package/assets/components/assets/input-date-picker/t9n/messages.nl.json +1 -1
  25. package/assets/components/assets/input-date-picker/t9n/messages.no.json +1 -1
  26. package/assets/components/assets/input-date-picker/t9n/messages.pl.json +1 -1
  27. package/assets/components/assets/input-date-picker/t9n/messages.pt-BR.json +1 -1
  28. package/assets/components/assets/input-date-picker/t9n/messages.pt-PT.json +1 -1
  29. package/assets/components/assets/input-date-picker/t9n/messages.ro.json +1 -1
  30. package/assets/components/assets/input-date-picker/t9n/messages.ru.json +1 -1
  31. package/assets/components/assets/input-date-picker/t9n/messages.sk.json +1 -1
  32. package/assets/components/assets/input-date-picker/t9n/messages.sl.json +1 -1
  33. package/assets/components/assets/input-date-picker/t9n/messages.sr.json +1 -1
  34. package/assets/components/assets/input-date-picker/t9n/messages.sv.json +1 -1
  35. package/assets/components/assets/input-date-picker/t9n/messages.th.json +1 -1
  36. package/assets/components/assets/input-date-picker/t9n/messages.tr.json +1 -1
  37. package/assets/components/assets/input-date-picker/t9n/messages.uk.json +1 -1
  38. package/assets/components/assets/input-date-picker/t9n/messages.vi.json +1 -1
  39. package/assets/components/assets/input-date-picker/t9n/messages.zh-CN.json +1 -1
  40. package/assets/components/assets/input-date-picker/t9n/messages.zh-HK.json +1 -1
  41. package/assets/components/assets/input-date-picker/t9n/messages.zh-TW.json +1 -1
  42. package/assets/components/assets/input-time-picker/t9n/messages.ar.json +1 -1
  43. package/assets/components/assets/input-time-picker/t9n/messages.bg.json +1 -1
  44. package/assets/components/assets/input-time-picker/t9n/messages.bs.json +1 -1
  45. package/assets/components/assets/input-time-picker/t9n/messages.ca.json +1 -1
  46. package/assets/components/assets/input-time-picker/t9n/messages.cs.json +1 -1
  47. package/assets/components/assets/input-time-picker/t9n/messages.da.json +1 -1
  48. package/assets/components/assets/input-time-picker/t9n/messages.de.json +1 -1
  49. package/assets/components/assets/input-time-picker/t9n/messages.el.json +1 -1
  50. package/assets/components/assets/input-time-picker/t9n/messages.es.json +1 -1
  51. package/assets/components/assets/input-time-picker/t9n/messages.et.json +1 -1
  52. package/assets/components/assets/input-time-picker/t9n/messages.fi.json +1 -1
  53. package/assets/components/assets/input-time-picker/t9n/messages.fr.json +1 -1
  54. package/assets/components/assets/input-time-picker/t9n/messages.he.json +1 -1
  55. package/assets/components/assets/input-time-picker/t9n/messages.hr.json +1 -1
  56. package/assets/components/assets/input-time-picker/t9n/messages.hu.json +1 -1
  57. package/assets/components/assets/input-time-picker/t9n/messages.id.json +1 -1
  58. package/assets/components/assets/input-time-picker/t9n/messages.it.json +1 -1
  59. package/assets/components/assets/input-time-picker/t9n/messages.ja.json +1 -1
  60. package/assets/components/assets/input-time-picker/t9n/messages.ko.json +1 -1
  61. package/assets/components/assets/input-time-picker/t9n/messages.lt.json +1 -1
  62. package/assets/components/assets/input-time-picker/t9n/messages.lv.json +1 -1
  63. package/assets/components/assets/input-time-picker/t9n/messages.nl.json +1 -1
  64. package/assets/components/assets/input-time-picker/t9n/messages.no.json +1 -1
  65. package/assets/components/assets/input-time-picker/t9n/messages.pl.json +1 -1
  66. package/assets/components/assets/input-time-picker/t9n/messages.pt-BR.json +1 -1
  67. package/assets/components/assets/input-time-picker/t9n/messages.pt-PT.json +1 -1
  68. package/assets/components/assets/input-time-picker/t9n/messages.ro.json +1 -1
  69. package/assets/components/assets/input-time-picker/t9n/messages.ru.json +1 -1
  70. package/assets/components/assets/input-time-picker/t9n/messages.sk.json +1 -1
  71. package/assets/components/assets/input-time-picker/t9n/messages.sl.json +1 -1
  72. package/assets/components/assets/input-time-picker/t9n/messages.sr.json +1 -1
  73. package/assets/components/assets/input-time-picker/t9n/messages.sv.json +1 -1
  74. package/assets/components/assets/input-time-picker/t9n/messages.th.json +1 -1
  75. package/assets/components/assets/input-time-picker/t9n/messages.tr.json +1 -1
  76. package/assets/components/assets/input-time-picker/t9n/messages.uk.json +1 -1
  77. package/assets/components/assets/input-time-picker/t9n/messages.vi.json +1 -1
  78. package/assets/components/assets/input-time-picker/t9n/messages.zh-CN.json +1 -1
  79. package/assets/components/assets/input-time-picker/t9n/messages.zh-HK.json +1 -1
  80. package/assets/components/assets/input-time-picker/t9n/messages.zh-TW.json +1 -1
  81. package/assets/components/assets/input-time-zone/t9n/messages.de.json +1 -1
  82. package/assets/esri/core/workers/RemoteClient.js +1 -1
  83. package/assets/esri/core/workers/chunks/{c69cf08da4e4c2c824ee.js → 0179949495c87466b428.js} +12 -12
  84. package/assets/esri/core/workers/chunks/{ef803fb25741e9f2a0a1.js → 04105d83556409489835.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{040a73b2a23577e1eabd.js → 24729603dcdbd95fd01e.js} +1 -1
  86. package/assets/esri/core/workers/chunks/2b0558c1716425974563.js +2 -0
  87. package/assets/esri/core/workers/chunks/{ac2ba5c3d613d7d5183a.js → 2b3f76e03b7a28fc4453.js} +1 -1
  88. package/assets/esri/core/workers/chunks/345510a95e893fa8040a.js +1 -0
  89. package/assets/esri/core/workers/chunks/{57e26a86d46e02c89c4f.js → 55dda957c79fb285185f.js} +1 -1
  90. package/assets/esri/core/workers/chunks/5d8d2145533a52efb7b9.js +1 -0
  91. package/assets/esri/core/workers/chunks/5f553da48d0ccbbfcd3c.js +2 -0
  92. package/assets/esri/core/workers/chunks/{cd74de12005834244a47.js → 626a715fdec93e188e0c.js} +1 -1
  93. package/assets/esri/core/workers/chunks/6529b5cc3ac6baa29fff.js +2 -0
  94. package/assets/esri/core/workers/chunks/7253a439c98200e3e748.js +1 -0
  95. package/assets/esri/core/workers/chunks/{4115bab15c19b4f5ae08.js → 7529c0fcfb83998e63db.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{b37a20c5c4a4686257d4.js → 8a3289e15e0ce92e3813.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{b82763e9401b16121f8d.js → 995a433936fc90d41634.js} +2 -2
  98. package/assets/esri/core/workers/chunks/9f1211d2267fb7673c4d.js +1 -0
  99. package/assets/esri/core/workers/chunks/{385b23d4bd5275031fb6.js → cada52d719c35d40958a.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{f703bc002c732d1c045d.js → cfdbc48f58433a3d5fc3.js} +1 -1
  101. package/assets/esri/core/workers/chunks/{83556c9f6f85c2a46779.js → d8da31bfe2bc4174e5aa.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{8762da315cf5086167c3.js → e9e4b27ba06a29e6340c.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{05663093b1d2a268b953.js → ebb722118a220c92efc3.js} +1 -1
  104. package/assets/esri/core/workers/chunks/ee63c693f2539f3bfa17.js +2 -0
  105. package/assets/esri/core/workers/chunks/ef9489d1dccb817460bb.js +2 -0
  106. package/assets/esri/core/workers/chunks/f086c6d229fb34a9d7f9.js +1 -0
  107. package/assets/esri/core/workers/chunks/{507b7f4c276b60ffe9d5.js → f4bae61869df1877fd3f.js} +1 -1
  108. package/chunks/Component.glsl.js +4 -4
  109. package/chunks/{FocusAreaColor.glsl.js → FocusArea.glsl.js} +1 -1
  110. package/chunks/HUDMaterial.glsl.js +5 -5
  111. package/chunks/Terrain.glsl.js +4 -4
  112. package/config.js +1 -1
  113. package/kernel.js +1 -1
  114. package/layers/list/BasemapItemCollection.d.ts +81 -0
  115. package/layers/list/BasemapItemCollection.js +2 -0
  116. package/layers/list/CatalogItemCollection.d.ts +76 -0
  117. package/layers/list/CatalogItemCollection.js +2 -0
  118. package/layers/list/Item.d.ts +262 -0
  119. package/layers/list/Item.js +2 -0
  120. package/layers/list/ItemPanel.d.ts +75 -0
  121. package/layers/list/ItemPanel.js +2 -0
  122. package/layers/list/LayerItemCollection.d.ts +106 -0
  123. package/layers/list/LayerItemCollection.js +2 -0
  124. package/layers/list/TableItem.d.ts +136 -0
  125. package/layers/list/TableItem.js +2 -0
  126. package/layers/list/TableItemCollection.d.ts +115 -0
  127. package/layers/list/TableItemCollection.js +2 -0
  128. package/layers/list/TableItemPanel.d.ts +74 -0
  129. package/layers/list/TableItemPanel.js +2 -0
  130. package/layers/list/support/layerListUtils.js +2 -0
  131. package/layers/list/types.d.ts +55 -0
  132. package/package.json +4 -4
  133. package/support/revision.js +1 -1
  134. package/views/3d/FocusAreasView.js +1 -1
  135. package/views/3d/analysis/LineOfSight/LineOfSightConfiguration.js +1 -1
  136. package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +2 -0
  137. package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +2 -0
  138. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +2 -0
  139. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  140. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  141. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementController.js +2 -0
  142. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  143. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementVisualization.js +2 -0
  144. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  145. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  146. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  147. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  148. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  149. package/views/3d/interactive/editingTools/reshape/isSupportedObject.js +1 -1
  150. package/views/3d/interactive/editingTools/reshape/reshapeTooltipUtils3D.js +1 -1
  151. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  152. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  153. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  154. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  155. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +16 -7
  156. package/views/3d/webgl-engine/effects/focusArea/{FocusAreaColor.glsl.js → FocusArea.glsl.js} +1 -1
  157. package/views/3d/webgl-engine/effects/focusArea/FocusArea.js +2 -0
  158. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.js +1 -1
  159. package/views/3d/webgl-engine/effects/focusArea/FocusAreaTechnique.js +2 -0
  160. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  161. package/views/3d/webgl-engine/lib/CutFill.js +2 -0
  162. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  163. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  164. package/views/3d/webgl.js +1 -1
  165. package/webscene/support/schemaValidator.js +1 -1
  166. package/webscene/version.js +2 -0
  167. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  168. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  169. package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
  170. package/assets/esri/core/workers/chunks/06c8547521ce9c97b258.js +0 -2
  171. package/assets/esri/core/workers/chunks/09653bd2a31d293a10d9.js +0 -2
  172. package/assets/esri/core/workers/chunks/17e9324a02b69733307a.js +0 -2
  173. package/assets/esri/core/workers/chunks/20b9bc8d5cbe9a18a644.js +0 -1
  174. package/assets/esri/core/workers/chunks/29a20a37e7837142fa6b.js +0 -2
  175. package/assets/esri/core/workers/chunks/81cd0cb9ae1371765d32.js +0 -1
  176. package/assets/esri/core/workers/chunks/95956d62591d689f1135.js +0 -1
  177. package/assets/esri/core/workers/chunks/b2812279662f1a5f8d06.js +0 -1
  178. package/assets/esri/core/workers/chunks/fdd4f78facec6387cdb0.js +0 -1
  179. package/assets/esri/core/workers/chunks/ffd5285c7b2c83208f87.js +0 -2
  180. package/views/3d/analysis/LineOfSight/LineOfSightAggregateManipulatedObject3D.js +0 -2
  181. package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +0 -2
  182. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +0 -2
  183. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +0 -2
  184. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +0 -2
  185. package/views/3d/webgl-engine/effects/focusArea/FocusAreaVisualization.js +0 -2
  186. package/views/3d/webgl-engine/lib/CutFillVisualization.js +0 -2
  187. /package/assets/esri/core/workers/chunks/{09653bd2a31d293a10d9.js.LICENSE.txt → 2b0558c1716425974563.js.LICENSE.txt} +0 -0
  188. /package/assets/esri/core/workers/chunks/{17e9324a02b69733307a.js.LICENSE.txt → 5f553da48d0ccbbfcd3c.js.LICENSE.txt} +0 -0
  189. /package/assets/esri/core/workers/chunks/{06c8547521ce9c97b258.js.LICENSE.txt → 6529b5cc3ac6baa29fff.js.LICENSE.txt} +0 -0
  190. /package/assets/esri/core/workers/chunks/{b82763e9401b16121f8d.js.LICENSE.txt → 995a433936fc90d41634.js.LICENSE.txt} +0 -0
  191. /package/assets/esri/core/workers/chunks/{ffd5285c7b2c83208f87.js.LICENSE.txt → ee63c693f2539f3bfa17.js.LICENSE.txt} +0 -0
  192. /package/assets/esri/core/workers/chunks/{29a20a37e7837142fa6b.js.LICENSE.txt → ef9489d1dccb817460bb.js.LICENSE.txt} +0 -0
@@ -0,0 +1,115 @@
1
+ import type WebMap from "../../WebMap.js";
2
+ import type WebScene from "../../WebScene.js";
3
+ import type Collection from "../../core/Collection.js";
4
+ import type Layer from "../Layer.js";
5
+ import type TableItem from "./TableItem.js";
6
+ import type Sublayer from "../support/Sublayer.js";
7
+ import type { ReadonlyCollection } from "../../core/Collection.js";
8
+ import type { EventedAccessor } from "../../core/Evented.js";
9
+ import type { Action, State } from "./types.js";
10
+
11
+ export interface TableItemCollectionProperties extends Partial<Pick<TableItemCollection, "checkPublishStatusEnabled" | "listItemCreatedFunction" | "listModeDisabled" | "map" | "tables">> {}
12
+
13
+ /** Event object passed to a table list item creation callback. */
14
+ export interface TableItemModifierEvent {
15
+ /** The table list item being created. */
16
+ item: TableItem;
17
+ }
18
+
19
+ /**
20
+ * Function used to customize table list items during creation.
21
+ *
22
+ * @param event - The event containing the table list item being created.
23
+ */
24
+ export type TableItemModifier = (event: TableItemModifierEvent) => void;
25
+
26
+ export interface TableItemCollectionEvents {
27
+ /**
28
+ * Emitted when an [action](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionButton/) or
29
+ * [action toggle](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionToggle/) is triggered in a table list.
30
+ *
31
+ * @see [@trigger-action](https://developers.arcgis.com/javascript/latest/references/core/layers/list/TableItemCollection/#event-trigger-action)
32
+ */
33
+ "trigger-action": TableItemCollectionTriggerActionEvent;
34
+ }
35
+
36
+ /**
37
+ * The event object for the `trigger-action` event in the table list.
38
+ *
39
+ * @see [@trigger-action](https://developers.arcgis.com/javascript/latest/references/core/layers/list/TableItemCollection/#event-trigger-action)
40
+ */
41
+ export interface TableItemCollectionTriggerActionEvent {
42
+ /** The action clicked by the user. */
43
+ action: Action;
44
+ /** An item associated with the action. */
45
+ item: TableItem;
46
+ }
47
+
48
+ /**
49
+ * Provides list orchestration logic for table-list workflows.
50
+ *
51
+ * @since 5.2
52
+ */
53
+ export default class TableItemCollection extends EventedAccessor {
54
+ /**
55
+ * @deprecated
56
+ * Do not directly reference this property.
57
+ * Use EventNames and EventTypes helpers from \@arcgis/core/Evented
58
+ */
59
+ "@eventTypes": TableItemCollectionEvents;
60
+ constructor(properties?: TableItemCollectionProperties);
61
+ /**
62
+ * Whether to provide an indication if a layer is being published.
63
+ * The [TableItem.publishing](https://developers.arcgis.com/javascript/latest/references/core/layers/list/TableItem/#publishing) property
64
+ * is `false` when `checkPublishStatusEnabled` is `false`.
65
+ *
66
+ * @default false
67
+ * @since 5.2
68
+ */
69
+ accessor checkPublishStatusEnabled: boolean;
70
+ /**
71
+ * Specifies a function that accesses each [TableItem](https://developers.arcgis.com/javascript/latest/references/core/layers/list/TableItem/).
72
+ * Each list item can be modified according to its modifiable properties.
73
+ *
74
+ * @since 5.2
75
+ */
76
+ accessor listItemCreatedFunction: TableItemModifier | null | undefined;
77
+ /**
78
+ * Specifies whether to ignore the [Layer.listMode](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#listMode) property of layers.
79
+ *
80
+ * @default false
81
+ * @since 5.2
82
+ * @see [Layer.listMode](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#listMode)
83
+ */
84
+ accessor listModeDisabled: boolean;
85
+ /** Reference to the map containing tables. */
86
+ accessor map: WebMap | WebScene | null | undefined;
87
+ /**
88
+ * The view model's state.
89
+ *
90
+ * @default "disabled"
91
+ */
92
+ get state(): State;
93
+ /** The collection of [TableItem](https://developers.arcgis.com/javascript/latest/references/core/layers/list/TableItem/)s in the list. */
94
+ get tableItems(): Collection<TableItem>;
95
+ /**
96
+ * A collection of [Layer](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/) instances that are tables.
97
+ *
98
+ * @since 5.2
99
+ */
100
+ accessor tables: ReadonlyCollection<Layer | Sublayer> | null | undefined;
101
+ /**
102
+ * The total number of [tableItems](https://developers.arcgis.com/javascript/latest/references/core/layers/list/TableItemCollection/#tableItems) in the list.
103
+ *
104
+ * @since 5.2
105
+ */
106
+ get totalItems(): number;
107
+ /**
108
+ * Triggers the [@trigger-action](https://developers.arcgis.com/javascript/latest/references/core/layers/list/TableItemCollection/#event-trigger-action) event and executes
109
+ * the given [action](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionButton/) or [action toggle](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionToggle/).
110
+ *
111
+ * @param action - The action to execute.
112
+ * @param item - An item associated with the action.
113
+ */
114
+ triggerAction(action: Action, item: TableItem): void;
115
+ }
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as t}from"tslib";import e from"../../core/Collection.js";import{EventedAccessor as s}from"../../core/Evented.js";import{watch as i,initial as l}from"../../core/reactiveUtils.js";import{property as o,subclass as a}from"../../core/accessorSupport/decorators.js";import r from"./TableItem.js";import{findLayerListMode as d}from"./support/layerListUtils.js";const m={map:"map",layerListMode:"layer-list-mode"},n="hide",h=e.ofType(r);let c=class extends s{constructor(t){super(t),this.checkPublishStatusEnabled=!1,this.listItemCreatedFunction=null,this.listModeDisabled=!1,this.tableItems=new h,this.map=null}initialize(){this.addHandles([i(()=>[this.tables?.toArray(),this.map?.allTables.toArray()],()=>this._compileList(),l),i(()=>[this.map?.loaded,this.listItemCreatedFunction,this.checkPublishStatusEnabled,this.listModeDisabled],()=>this._recompileList())],m.map)}destroy(){this._removeAllItems(),this.map=null,this.tables=null}get tables(){return this.map?.allTables}set tables(t){this._overrideIfSome("tables",t)}get state(){const{map:t,tables:e}=this;if(!t)return e?"ready":"disabled";const s=t.loadStatus;return"string"==typeof s?"loaded"===s?"ready":"loading"===s?"loading":"disabled":"ready"}get totalItems(){return this.tableItems.length}triggerAction(t,e){t&&!t.disabled&&this.emit("trigger-action",{action:t,item:e})}_removeAllItems(){this.tableItems.destroyAll()}_getViewableTables(t){return t?this.listModeDisabled?t:t.filter(t=>d(t)!==n):void 0}_watchTablesListMode(t){this.removeHandles(m.layerListMode),t&&!this.listModeDisabled&&this.addHandles(i(()=>t.filter(t=>"listMode"in t).map(t=>t.listMode).toArray(),()=>this._compileList()),m.layerListMode)}_compileList(){const{tables:t}=this;this._watchTablesListMode(t);const e=this._getViewableTables(t);e?.length?(this._createNewItems(e),this._removeItems(e),this._sortItems(e)):this._removeAllItems()}_createNewItems(t){const{tableItems:e,listItemCreatedFunction:s,checkPublishStatusEnabled:i}=this;t.forEach(t=>{e.some(e=>e.layer===t)||e.add(new r({checkPublishStatusEnabled:i,layer:t,listItemCreatedFunction:s}))})}_removeItems(t){const{tableItems:e}=this;e.forEach(s=>{if(!s)return;const i=t?.find(t=>s.layer===t);i||(e.remove(s),s.destroy())})}_sortItems(t){const{tableItems:e}=this;e.sort((e,s)=>{const i=t.indexOf(e.layer),l=t.indexOf(s.layer);return i>l?-1:i<l?1:0})}_recompileList(){this._removeAllItems(),this._compileList()}};t([o()],c.prototype,"checkPublishStatusEnabled",void 0),t([o()],c.prototype,"listItemCreatedFunction",void 0),t([o({nonNullable:!0})],c.prototype,"listModeDisabled",void 0),t([o({type:h,readOnly:!0})],c.prototype,"tableItems",void 0),t([o()],c.prototype,"tables",null),t([o()],c.prototype,"map",void 0),t([o({readOnly:!0})],c.prototype,"state",null),t([o()],c.prototype,"totalItems",null),c=t([a("esri.layers.list.TableItemCollection")],c);const p=c;export{p as default};
@@ -0,0 +1,74 @@
1
+ import type Accessor from "../../core/Accessor.js";
2
+ import type TableItem from "./TableItem.js";
3
+ import type { IdentifiableMixin, IdentifiableMixinProperties } from "../../core/Identifiable.js";
4
+
5
+ export interface TableItemPanelProperties extends IdentifiableMixinProperties, Partial<Pick<TableItemPanel, "content" | "disabled" | "flowEnabled" | "icon" | "image" | "listItem" | "open" | "title" | "visible">> {}
6
+
7
+ /**
8
+ * The content associated with a table list item panel.
9
+ *
10
+ * @see [content](https://developers.arcgis.com/javascript/latest/references/core/layers/list/TableItemPanel/#content)
11
+ */
12
+ export type TableItemPanelContent = "legend" | HTMLElement | string;
13
+
14
+ /**
15
+ * Defines one or more content values for a table list item panel.
16
+ *
17
+ * @see [content](https://developers.arcgis.com/javascript/latest/references/core/layers/list/TableItemPanel/#content)
18
+ */
19
+ export type TableItemPanelContents = TableItemPanelContent | TableItemPanelContent[];
20
+
21
+ /**
22
+ * Generic state container for table-list panel data.
23
+ *
24
+ * This class does not render UI. It stores panel state that can be consumed by separate view components.
25
+ *
26
+ * @since 5.2
27
+ */
28
+ export default class TableItemPanel extends TableItemPanelSuperclass {
29
+ constructor(properties?: TableItemPanelProperties);
30
+ /** The content metadata associated with the panel. */
31
+ accessor content: TableItemPanelContents | null | undefined;
32
+ /**
33
+ * If `true`, panel interactions are disabled.
34
+ *
35
+ * @default false
36
+ */
37
+ accessor disabled: boolean;
38
+ /**
39
+ * Indicates if a consumer UI should display this panel in a flow/drill-in mode.
40
+ *
41
+ * @default false
42
+ * @since 5.2
43
+ */
44
+ accessor flowEnabled: boolean;
45
+ /**
46
+ * Icon identifier that can represent the panel in a consumer UI.
47
+ *
48
+ * @since 5.2
49
+ */
50
+ accessor icon: string | null | undefined;
51
+ /** URL or data URI used by consumer UIs to represent the panel. */
52
+ accessor image: string | null | undefined;
53
+ /** The parent table list item associated with this panel. */
54
+ accessor listItem: TableItem | null | undefined;
55
+ /**
56
+ * Indicates whether the panel is open.
57
+ *
58
+ * @default false
59
+ */
60
+ accessor open: boolean;
61
+ /**
62
+ * The title of the panel.
63
+ *
64
+ * @default ""
65
+ */
66
+ accessor title: string;
67
+ /**
68
+ * Indicates whether consumer UIs should show this panel.
69
+ *
70
+ * @default true
71
+ */
72
+ accessor visible: boolean;
73
+ }
74
+ declare const TableItemPanelSuperclass: typeof Accessor & typeof IdentifiableMixin
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as t}from"tslib";import o from"../../core/Accessor.js";import{IdentifiableMixin as e}from"../../core/Identifiable.js";import{property as i,subclass as s}from"../../core/accessorSupport/decorators.js";let r=class extends(e(o)){constructor(t){super(t),this.content=null,this.disabled=!1,this.flowEnabled=!1,this.icon=null,this.image=null,this.listItem=null,this.open=!1,this.title="",this.visible=!0}};t([i()],r.prototype,"content",void 0),t([i()],r.prototype,"disabled",void 0),t([i()],r.prototype,"flowEnabled",void 0),t([i()],r.prototype,"icon",void 0),t([i()],r.prototype,"image",void 0),t([i()],r.prototype,"listItem",void 0),t([i()],r.prototype,"open",void 0),t([i()],r.prototype,"title",void 0),t([i()],r.prototype,"visible",void 0),r=t([s("esri.layers.list.TableItemPanel")],r);const l=r;export{l as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ const i="hide";function n(i){return i?.listMode??void 0}function l(i){return null!=i&&"minScale"in i&&null!=i.minScale?i.minScale:void 0}function e(i){return null!=i&&"maxScale"in i&&null!=i.maxScale?i.maxScale:void 0}function t(i){if(!i)return"inherited";const n=c(s(i)?i.layer:i);return null!=n?n?"independent":"inherited":"visibilityMode"in i&&null!=i.visibilityMode?i.visibilityMode:"independent"}function r(i){if(i&&(!("type"in i)||"wmts"!==i.type))return"sublayers"in i?"sublayers":"layers"in i?"layers":void 0}function u(l){return n(l)!==i}function a(i,n){if(!i||null==n||isNaN(n))return!1;const t=l(i),r=e(i),u=null!=t&&!isNaN(t)&&t>0&&n>t,a=null!=r&&!isNaN(r)&&r>0&&n<r;return u||a}function o(i){const n=i?.layer;return n&&"layers"in n?n.layers:null}function s(i){return null!=i&&"layer"in i&&null!=i.layer}function c(i){const n=y(i);return null!=n&&"supportsSublayerVisibility"in n?n.supportsSublayerVisibility:void 0}function y(i){return i&&"capabilities"in i&&null!=i.capabilities&&"exportMap"in i.capabilities?i.capabilities.exportMap:void 0}export{u as canDisplayLayer,n as findLayerListMode,e as findLayerMaxScale,l as findLayerMinScale,t as findLayerVisibilityMode,o as getItemLayers,r as getNormalizedChildLayerProperty,a as isLayerOutsideScaleRange,s as isSublayer};
@@ -0,0 +1,55 @@
1
+ import type Item from "./Item.js";
2
+ import type ActionButton from "../../support/actions/ActionButton.js";
3
+ import type ActionToggle from "../../support/actions/ActionToggle.js";
4
+
5
+ /**
6
+ * Specifies the style of the visibility toggle displayed by list UIs.
7
+ *
8
+ * @since 5.2
9
+ */
10
+ export type VisibilityAppearance = "default" | "checkbox";
11
+
12
+ /**
13
+ * A function used to filter which [Item](https://developers.arcgis.com/javascript/latest/references/core/layers/list/Item/) objects are included.
14
+ *
15
+ * @param item - The list item to evaluate for inclusion.
16
+ * @since 5.2
17
+ */
18
+ export type FilterPredicate = (item: Item) => boolean;
19
+
20
+ /**
21
+ * A function for customizing a list item as it is created.
22
+ *
23
+ * @param event - The event containing the list item to customize.
24
+ * @since 5.2
25
+ */
26
+ export type ItemModifier = (event: ItemModifierEvent) => void;
27
+
28
+ /**
29
+ * Event object passed to [ItemModifier](https://developers.arcgis.com/javascript/latest/references/core/layers/list/types/#ItemModifier).
30
+ * Provides access to the list item being created.
31
+ *
32
+ * @since 5.2
33
+ */
34
+ export interface ItemModifierEvent {
35
+ /**
36
+ * The list item instance being created.
37
+ *
38
+ * @since 5.2
39
+ */
40
+ item: Item;
41
+ }
42
+
43
+ /**
44
+ * An action element that can be associated with a list item.
45
+ *
46
+ * @since 5.2
47
+ */
48
+ export type Action = ActionButton | ActionToggle;
49
+
50
+ /**
51
+ * Describes the current state of list item processing.
52
+ *
53
+ * @since 5.2
54
+ */
55
+ export type State = "ready" | "loading" | "disabled";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.2.0-next.79",
3
+ "version": "5.2.0-next.80",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -20,11 +20,11 @@
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
22
  "@amcharts/amcharts5": "~5.20.2",
23
- "@arcgis/toolkit": "^5.2.0-next.73",
23
+ "@arcgis/toolkit": "^5.2.0-next.75",
24
24
  "@esri/arcgis-html-sanitizer": "~4.1.0",
25
- "@esri/calcite-components": "^5.2.0-next.43",
25
+ "@esri/calcite-components": "^5.2.0-next.50",
26
26
  "@vaadin/grid": "~25.2.8",
27
- "@zip.js/zip.js": "~2.8.34",
27
+ "@zip.js/zip.js": "~2.8.51",
28
28
  "luxon": "~3.7.2",
29
29
  "marked": "~18.0.9",
30
30
  "tslib": "^2.8.1"
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const a="20260817",e="4960538a94a621a7e0ea2f966fa057959e3a2952";export{a as buildDate,e as commitHash};
2
+ const c="20260818",a="c91f9b0c0f75fa3a2ab449092831863cd253ece3";export{c as buildDate,a as commitHash};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import s from"../../core/Accessor.js";import{equals as t}from"../../core/arrayUtils.js";import r from"../../core/Collection.js";import o from"../../core/Error.js";import i from"../../core/Logger.js";import{mapCollection as n}from"../../core/mapCollectionUtils.js";import{isPromiseLike as a}from"../../core/promiseUtils.js";import{watch as l,initial as u}from"../../core/reactiveUtils.js";import{property as m,subclass as c}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as p}from"../../core/support/UpdatingHandles.js";import d from"../../geometry/Point.js";import{polygonToVolume as f}from"./focusAreaUtils.js";import{ElevationContext as h}from"./layers/graphics/ElevationContext.js";import{FocusAreaMask as g}from"./webgl-engine/effects/focusArea/FocusAreaMask.js";import{FocusAreaOutlineItem as w}from"./webgl-engine/effects/focusArea/FocusAreaOutlineItem.js";import{FocusAreaVisualization as y}from"./webgl-engine/effects/focusArea/FocusAreaVisualization.js";let v=class extends s{get updating(){return this._updatingHandles.updating||!!this._outlineMap?.some(e=>e.updating)}constructor(e){super(e),this._updatingHandles=new p,this._elevationContext=new h,this._previousVolumes=new Map,this._outlineMap=new r}initialize(){this.addHandles([l(()=>({volumes:this.volumes,ready:this.view.groundView?.ready}),({volumes:e,ready:s})=>{this._previousVolumes=e,s&&(0!==e.size&&this._mask?.updateGeometries(),this._ensureRenderNodes())},u)]),this._outlineMap=n(()=>this.areas?.areas,e=>new w({area:e,view:this.view}),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.destroy(),this._updatingHandles.destroy()}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter(({enabled:e})=>e)??[]}get style(){return this.areas?.style??"bright"}get polygons(){return this.enabledAreas.reduce((e,s)=>e.concat(s.geometries.toArray()),new Array)}containsGeometry(e){if(0===this.polygons.length)return!0;const s=new d(e);return this.polygons.some(e=>e.contains(s))}get volumes(){const e=this.polygons,s=this._previousVolumes;if(!this.view.renderCoordsHelper||t(Array.from(s?.keys()??[]),e))return s??new Map;const r=new Map;for(const t of e){const e=s?.get(t);if(e)r.set(t,e);else try{const e=f(t,this.view,this._elevationContext);if(null==e)continue;if(a(e)){this._updatingHandles.consumePromise(e);continue}r.set(t,e)}catch(n){i.getLogger(this).error(new o("focusareasview:projection-failed","Failed to project focus area geometry to view spatial reference",{geometry:t,error:n}))}}return r}_ensureRenderNodes(){if(this.view.stage)if(0===this.volumes.size){const{_mask:e,_visualization:s}=this;this._mask=this._visualization=null,s?.fadeOut(()=>{e?.destroy(),s?.destroy()})}else this._mask??=new g({focusAreasView:this}),this._visualization??=new y({focusAreasView:this}),this.view.stage.renderView.requestRender()}};e([m()],v.prototype,"updating",null),e([m({readOnly:!0})],v.prototype,"volumes",null),e([m({constructOnly:!0})],v.prototype,"view",void 0),v=e([c("esri.views.3d.FocusAreasView")],v);export{v as FocusAreasView};
2
+ import{__decorate as e}from"tslib";import s from"../../core/Accessor.js";import{equals as t}from"../../core/arrayUtils.js";import r from"../../core/Collection.js";import o from"../../core/Error.js";import i from"../../core/Logger.js";import{mapCollection as n}from"../../core/mapCollectionUtils.js";import{isPromiseLike as a}from"../../core/promiseUtils.js";import{watch as l,initial as u}from"../../core/reactiveUtils.js";import{property as m,subclass as c}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as p}from"../../core/support/UpdatingHandles.js";import d from"../../geometry/Point.js";import{polygonToVolume as f}from"./focusAreaUtils.js";import{ElevationContext as h}from"./layers/graphics/ElevationContext.js";import{FocusArea as g}from"./webgl-engine/effects/focusArea/FocusArea.js";import{FocusAreaMask as w}from"./webgl-engine/effects/focusArea/FocusAreaMask.js";import{FocusAreaOutlineItem as y}from"./webgl-engine/effects/focusArea/FocusAreaOutlineItem.js";let v=class extends s{get updating(){return this._updatingHandles.updating||!!this._outlineMap?.some(e=>e.updating)}constructor(e){super(e),this._updatingHandles=new p,this._elevationContext=new h,this._previousVolumes=new Map,this._outlineMap=new r}initialize(){this.addHandles([l(()=>({volumes:this.volumes,ready:this.view.groundView?.ready}),({volumes:e,ready:s})=>{this._previousVolumes=e,s&&(0!==e.size&&this._mask?.updateGeometries(),this._ensureRenderNodes())},u)]),this._outlineMap=n(()=>this.areas?.areas,e=>new y({area:e,view:this.view}),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.destroy(),this._updatingHandles.destroy()}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter(({enabled:e})=>e)??[]}get style(){return this.areas?.style??"bright"}get polygons(){return this.enabledAreas.reduce((e,s)=>e.concat(s.geometries.toArray()),new Array)}containsGeometry(e){if(0===this.polygons.length)return!0;const s=new d(e);return this.polygons.some(e=>e.contains(s))}get volumes(){const e=this.polygons,s=this._previousVolumes;if(!this.view.renderCoordsHelper||t(Array.from(s?.keys()??[]),e))return s??new Map;const r=new Map;for(const t of e){const e=s?.get(t);if(e)r.set(t,e);else try{const e=f(t,this.view,this._elevationContext);if(null==e)continue;if(a(e)){this._updatingHandles.consumePromise(e);continue}r.set(t,e)}catch(n){i.getLogger(this).error(new o("focusareasview:projection-failed","Failed to project focus area geometry to view spatial reference",{geometry:t,error:n}))}}return r}_ensureRenderNodes(){if(this.view.stage)if(0===this.volumes.size){const{_mask:e,_visualization:s}=this;this._mask=this._visualization=null,s?.fadeOut(()=>{e?.destroy(),s?.destroy()})}else this._mask??=new w({focusAreasView:this}),this._visualization??=new g({focusAreasView:this}),this.view.stage.renderView.requestRender()}};e([m()],v.prototype,"updating",null),e([m({readOnly:!0})],v.prototype,"volumes",null),e([m({constructOnly:!0})],v.prototype,"view",void 0),v=e([c("esri.views.3d.FocusAreasView")],v);export{v as FocusAreasView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import o from"../../../../Color.js";import{multiplyOpacityToUnitRGBA as n,getContrast as t}from"../../../../core/colorUtils.js";class r{constructor(){this.glowWidth=8,this.innerWidth=.75}}const e=new r;function s(o){const n=o.accentColor;return{glowColor:n,innerColor:t(n),globalAlpha:.75*n.a}}class i{constructor(){this.size=.5}}const c=new i;function l(o){return n(o.accentColor,.75)}function h(o){return n(o.accentColor,.75)}class u{constructor(){this.size=.5,this.visibleColor=new o([3,252,111,.75]),this.occludedColor=new o([252,3,69,.75]),this.undefinedColor=new o([127,127,127,.75])}}const d=new u;class w{constructor(){this.innerWidth=2,this.outerWidth=8,this.visibleInnerColor=new o([3,252,111,1]),this.visibleOuterColor=new o([3,252,111,.15]),this.occludedInnerColor=new o([252,3,69,1]),this.occludedOuterColor=new o([252,3,69,.1]),this.undefinedInnerColor=new o([255,255,255,1]),this.undefinedOuterColor=new o([127,127,127,.2])}}const C=new w;export{h as getInteractiveTargetRGBA,s as getLaserLineColors,l as getObserverRGBA,e as laserLineConfiguration,C as lineOfSightConfiguration,c as observerConfiguration,d as targetConfiguration};
2
+ import o from"../../../../Color.js";import{getContrast as n,multiplyOpacityToUnitRGBA as t}from"../../../../core/colorUtils.js";class r{constructor(){this.glowWidth=8,this.innerWidth=.75}}const e=new r;function s(o){const t=o.accentColor;return{glowColor:t,innerColor:n(t),globalAlpha:.75*t.a}}class i{constructor(){this.size=.5}}const c=new i;function l(o){return t(o.accentColor,.75)}function h(o){return t(o.accentColor,.75)}class u{constructor(){this.size=.5,this.visibleColor=new o([3,252,111,.75]),this.occludedColor=new o([252,3,69,.75]),this.undefinedColor=new o([127,127,127,.75])}}const d=new u;class w{constructor(){this.innerWidth=2,this.outerWidth=8,this.visibleInnerColor=new o([3,252,111,1]),this.visibleOuterColor=new o([3,252,111,.15]),this.occludedInnerColor=new o([252,3,69,1]),this.occludedOuterColor=new o([252,3,69,.1]),this.undefinedInnerColor=new o([255,255,255,1]),this.undefinedOuterColor=new o([127,127,127,.2])}}const C=new w;export{h as getInteractiveTargetRGBA,s as getLaserLineColors,l as getObserverRGBA,e as laserLineConfiguration,C as lineOfSightConfiguration,c as observerConfiguration,d as targetConfiguration};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{watch as i,initial as s}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{snapshotLineOfSightTargetState as l,restoreLineOfSightTargetState as r}from"./LineOfSightAuthoringUtils.js";import{LineOfSightItemManipulatedObject3D as a}from"./LineOfSightItemManipulatedObject3D.js";import{LineOfSightItemTool as h}from"./LineOfSightItemTool.js";import{discRadiusSmall as c}from"../../interactive/editingTools/manipulations/config.js";import{MoveTool3D as m}from"../../interactive/editingTools/move/MoveTool3D.js";import d from"../../../interactive/options/InteractiveToolOptions.js";let u=class extends e{get visible(){return this._get("visible")??!0}set visible(t){this._set("visible",t),this._itemTool.visible=t,this._moveTool.visible=t}get manipulatorsInteractive(){return this._get("manipulatorsInteractive")??!0}set manipulatorsInteractive(t){this._set("manipulatorsInteractive",t),this._itemTool.manipulatorsInteractive=t}constructor(t){super(t),this._selectedItem=null,this._objectByItem=new Map,this._undoStack=[],this._redoStack=[],this._itemTool=new h({analysisViewData:t.analysisViewData,snappingManager:t.snappingManager,view:t.view}),this._moveTool=new m({enableVisualElements:!1,manipulatorRadius:c,snappingManager:t.snappingManager,toolOptions:new d({tooltips:{enabled:!0}}),view:t.view})}initialize(){this.view.tools.add(this._itemTool),this.view.tools.add(this._moveTool),this._itemTool.visible=this.visible,this._moveTool.visible=this.visible,this._itemTool.manipulatorsInteractive=this.manipulatorsInteractive,this.addHandles([i(()=>({observer:this.analysis.observer,targets:this.analysis.targets.toArray()}),({observer:t,targets:e})=>this._syncObjects(t,e),s),this._itemTool.events.on("select-item",({item:t})=>this._setSelectedItem(t)),this._itemTool.events.on("selection-cleared",()=>{if(this._moveTool.hasFocusedManipulators){const t=null==this._selectedItem?null:this._objectByItem.get(this._selectedItem);this._itemTool.selectObject(t)}else this._setSelectedItem(null)}),this._itemTool.events.on("delete-item",({target:t})=>this._deleteTarget(t)),this._itemTool.events.on("record-undo",({record:t})=>this._recordHistory(_([t]))),this._moveTool.events.on("record-undo",({updates:t})=>this._recordHistory(_(t))),this._moveTool.events.on("move-start",({objects:t})=>{const e=t.at(0);null!=e&&this._itemTool.startMoveInteraction(e)}),this._moveTool.events.on("move-stop",()=>this._itemTool.stopMoveInteraction())])}destroy(){this.stop(),this.view.tools.remove(this._itemTool),this.view.tools.remove(this._moveTool),this._itemTool.destroy(),this._moveTool.destroy();for(const t of this._objectByItem.values())this.removeHandles(t),t.destroy();this._objectByItem.clear(),this._undoStack.length=0,this._redoStack.length=0}get active(){return this._itemTool.active||this._moveTool.active}get canRedo(){return this._redoStack.length>0}get canUndo(){return this._undoStack.length>0}get hasSelection(){return null!=this._selectedItem}get updating(){return this._itemTool.updating||this._moveTool.updating}get laserLineVisualElement(){return this._itemTool.laserLineVisualElement}selectItem(t){return!!this._objectByItem.has(t)&&(this._setSelectedItem(t),!0)}clearSelection(){this._setSelectedItem(null)}getObserverManipulator(){const t=this.analysis.observer,e=null==t?null:this._itemTool.getManipulator(t);return null!=e&&v(e)?e:null}getTargetManipulator(t){const e=this._itemTool.getManipulator(t);return null!=e&&p(e)?e:null}hasManipulatorAt(t,e){return this._itemTool.hasManipulatorAt(t,e)}redo(){const t=this._redoStack.pop();null!=t&&(t.redo()?(this._undoStack.push(t),this._notifyHistoryChanged()):this._redoStack.push(t))}setEditableFlag(t,e){this._itemTool.setEditableFlag(t,e),this._moveTool.setEditableFlag(t,e)}stop(){this.view.activeTool!==this._itemTool&&this.view.activeTool!==this._moveTool||(this.view.activeTool=null),this._itemTool.stopMoveInteraction(),this.snappingManager.doneSnapping(),this.clearSelection()}undo(){const t=this._undoStack.pop();null!=t&&(t.undo(),this._redoStack.push(t),this._notifyHistoryChanged())}_syncObjects(t,e){const i=new Set(null==t?e:[t,...e]);for(const[s,o]of this._objectByItem)i.has(s)||(this._selectedItem===s&&this._setSelectedItem(null),this.removeHandles(o),this._itemTool.removeObject(o),this._objectByItem.delete(s),o.destroy());null!=t&&this._ensureObject(t,"observer");for(const s of e)this._ensureObject(s,"target");this._setSelectedItem(this._selectedItem)}_ensureObject(t,e){if(this._objectByItem.has(t))return;const i=new a({analysisViewData:this.analysisViewData,intersector:this.intersector,item:t,itemType:e,view:this.view});this._objectByItem.set(t,i),this._itemTool.addObject(i),this.addHandles(i.on("modified-externally",()=>{this._selectedItem===t&&this._setSelectedItem(t)}),i)}_setSelectedItem(t){const e=null==t?null:this._objectByItem.get(t);this._selectedItem=null==e?null:t,this._itemTool.selectObject(e),this._moveTool.objects.removeAll(),null!=e&&this._moveTool.objects.add(e),this._itemTool.interacting=null!=this._selectedItem}_deleteTarget(t){if(this.analysis.targets.length<=1)return;const e=this.analysis.targets.indexOf(t);if(e<0)return;const i=l(t),s=this._selectedItem===t;this.analysis.targets.remove(t),this._recordHistory({undo:()=>{r(i,t),this.analysis.targets.add(t,Math.min(e,this.analysis.targets.length)),s&&this._setSelectedItem(t)},redo:()=>!(this.analysis.targets.includes(t)&&this.analysis.targets.length<=1)&&(this.analysis.targets.remove(t),this._selectedItem===t&&this._setSelectedItem(null),!0)})}_recordHistory(t){this._undoStack.push(t),this._redoStack.length=0,this._notifyHistoryChanged()}_notifyHistoryChanged(){this.notifyChange("canUndo"),this.notifyChange("canRedo")}};function _(t){return{undo:()=>{for(let e=t.length-1;e>=0;e--)t[e].undo(null)},redo:()=>{for(const e of t)e.redo(null);return!0}}}function v(t){return"observer"===t.metadata.type}function p(t){return"target"===t.metadata.type}t([o({constructOnly:!0})],u.prototype,"analysisViewData",void 0),t([o({constructOnly:!0})],u.prototype,"analysis",void 0),t([o({constructOnly:!0})],u.prototype,"intersector",void 0),t([o({constructOnly:!0})],u.prototype,"snappingManager",void 0),t([o({constructOnly:!0})],u.prototype,"view",void 0),t([o()],u.prototype,"visible",null),t([o()],u.prototype,"manipulatorsInteractive",null),t([o()],u.prototype,"active",null),t([o()],u.prototype,"canRedo",null),t([o()],u.prototype,"canUndo",null),t([o()],u.prototype,"updating",null),u=t([n("esri.views.3d.analysis.LineOfSight.LineOfSightEditTool")],u);export{u as LineOfSightEditTool};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as t}from"tslib";import{EventedAccessor as e}from"../../../../core/Evented.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as o,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as s,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as a}from"../../../../support/elevationInfoUtils.js";import{snapshotLineOfSightObserverState as l,snapshotLineOfSightTargetState as c,restoreLineOfSightObserverState as h,restoreLineOfSightTargetState as p,updateLineOfSightItemFromAuthoredPoint as m}from"./LineOfSightAuthoringUtils.js";import{EditGeometryOperations as d}from"../../../interactive/editGeometry/EditGeometryOperations.js";const u=Symbol("line-of-sight-item-operations");let y=class extends e{constructor(t){super(t),this._operations=null,this._dragIntersectionContext=null,this._syncSource=null}initialize(){this.addHandles([o(()=>{const{elevationInfo:t,feature:e,position:i}=this.item;return{elevationInfo:t,elevationMode:t?.mode,elevationOffset:t?.offset,elevationUnit:t?.unit,feature:e,position:i,positionCoordinates:i?.toArray(),spatialReference:i?.spatialReference}},()=>this._syncOperationsFromItem(),n),o(()=>{const{origin:t}=this;return{origin:t,originCoordinates:t?.toArray(),spatialReference:t?.spatialReference}},()=>this.emit("committed"),n)])}destroy(){this.removeHandles(u),this._operations=i(this._operations),this._dragIntersectionContext=null}get operations(){return this._operations}get elevationInfo(){return this.item.elevationInfo??a}get visible(){return this.analysisViewData.visible&&null!=this.origin}get isDraped(){return!1}get origin(){return"observer"===this.itemType?this.analysisViewData.elevationAlignedObserver:this.analysisViewData.computations.find(t=>t.target===this.item)?.elevationAlignedTargetLocation??null}get updating(){return!1}toMap(t){return this.intersector.getScreenPointIntersection(t)?.mapPoint}createUndoRecord(){let t=this._snapshotState(),e=null;return{undo:()=>{e=this._snapshotState(),this._restoreSnapshot(t)},redo:()=>{null!=e&&(t=this._snapshotState(),this._restoreSnapshot(e))}}}updateDragIntersection(t){"cancel"!==t.action?this._dragIntersectionContext={dragging:"end"!==t.action,intersection:this.intersector.getScreenPointIntersection(t.screenPoint)}:this._dragIntersectionContext=null}_snapshotState(){return"observer"===this.itemType?l(this.item):c(this.item)}_restoreSnapshot(t){"observer"===this.itemType?h(t,this.item):p(t,this.item),this.destroyed||(this._syncOperationsFromItem(),this.emit("committed"))}_replaceOperations(t){this.removeHandles(u),this._operations=i(this._operations),this._operations=t,null!=t&&this.addHandles(t.data.on("change",()=>this._operationsGeometryChanged()),u)}_syncOperationsFromItem(){const{position:t}=this.item,e=this._operations;if("operations"!==this._syncSource){this._syncSource="item";try{if(null==t){if(null==e)return;this._replaceOperations(null)}else e?.data.geometry?.equals(t)||e?.trySetGeometry(t)||this._replaceOperations(d.fromGeometry(t,this.view.state.viewingMode));this._emitModifiedExternally()}finally{this._syncSource=null}}}_operationsGeometryChanged(){const t=this._operations?.data.geometry;if("item"===this._syncSource||"point"!==t?.type)return;const e=this._dragIntersectionContext?.intersection??null;this._syncSource="operations";try{m(this.view,this.item,this.intersector,t,{elevationInfo:this.item.elevationInfo,preservedIntersection:e,sourceElevationInfo:this.elevationInfo})}finally{this._syncSource=null}null==this._dragIntersectionContext||this._dragIntersectionContext.dragging||(this._dragIntersectionContext=null),this.emit("committed")}_emitModifiedExternally(){this.emit("modified-externally"),this.emit("committed")}};t([s({constructOnly:!0})],y.prototype,"analysisViewData",void 0),t([s({constructOnly:!0})],y.prototype,"intersector",void 0),t([s({constructOnly:!0})],y.prototype,"item",void 0),t([s({constructOnly:!0})],y.prototype,"itemType",void 0),t([s({constructOnly:!0})],y.prototype,"view",void 0),t([s()],y.prototype,"_operations",void 0),y=t([r("esri.views.3d.analysis.LineOfSight.LineOfSightItemManipulatedObject3D")],y);export{y as LineOfSightItemManipulatedObject3D};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as t}from"tslib";import{EventEmitter as i}from"../../../../core/Evented.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{destroyMaybe as n,removeMaybe as o}from"../../../../core/maybe.js";import{watch as a,initial as s}from"../../../../core/reactiveUtils.js";import{property as r,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../geometry/Point.js";import{create as u,fromPoints as d}from"../../../../geometry/support/lineSegment.js";import{clonePoint as m}from"../../../../layers/graphics/hydratedFeatures.js";import{LineOfSightInteractionVisuals as h}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as v,LineOfSightTargetManipulator as g,LineOfSightTargetManipulatorState as _,getInteractiveLineOfSightTargetManipulatorState as y}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as b}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as f}from"../../interactive/editingTools/dragEventPipeline3D.js";import{connectTooltipToManipulatedObject as j}from"../../interactive/editingTools/tooltipUtils3D.js";import{mouseButtons as I}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as O,dragAtLocation as M,sceneSnappingAtLocation as V}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as w}from"../../../interactive/InteractiveToolBase.js";import S from"../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as T}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as B}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as R,enterInputModeIfAvailable as H}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as U}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";const x=u();let D=class extends w{constructor(t){super(t),this.events=new i,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new Map,this._updatingHandles=new c,this._toolOptions=new S({tooltips:{enabled:!0}}),this._interactionVisuals=null,this._grabbedManipulator=null,this._moveInteractionObject=null,this._tooltipHandle=null,this._tooltipUndoRecord=null,this._tooltipInfo=new U({toolOptions:this._toolOptions,viewType:"3d"})}initialize(){const{view:t}=this;this._tooltip=R(()=>({view:t,options:this._toolOptions.tooltips})),this._interactionVisuals=new h({view:t}),this.addHandles([a(()=>({computations:this.analysisViewData.computations.toArray().map(t=>({isTargetVisible:t.computationResult.isTargetVisible,isValid:t.computationResult.isValid,target:t.target})),interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),s),a(()=>this._grabbedManipulator,()=>this._syncInteractionVisuals(),s)]),this.finishToolCreation()}destroy(){this._disconnectTooltip(),this._tooltip=n(this._tooltip),this._interactionVisuals=n(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}startMoveInteraction(t){this._moveInteractionObject=t,this._syncInteractionVisuals()}stopMoveInteraction(){this._moveInteractionObject=null,this._syncInteractionVisuals()}addObject(t){if(this._manipulatorByObject.has(t))return;const i="observer"===t.itemType?new v(this.view,{deleting:!1,intersection:null,type:"observer"}):new g(this.view,{deleting:!1,target:t.item,type:"target"});i.cursor="move",this._objectByItem.set(t.item,t),this._manipulatorByObject.set(t,i),this.manipulators.add(i),this.addHandles(this._connectManipulator(t,i),t),this._syncManipulator(t,i)}removeObject(t){const i=this._manipulatorByObject.get(t);null!=i&&(this._grabbedManipulator===i&&(this._grabbedManipulator=null,this._disconnectTooltip()),this.removeHandles(t),this.manipulators.remove(i),i.destroy(),this._objectByItem.delete(t.item),this._manipulatorByObject.delete(t))}getManipulator(t){const i=this._objectByItem.get(t);return null==i?null:this._manipulatorByObject.get(i)}hasManipulatorAt(t,i){for(const e of this._manipulatorByObject.values())if(e.consumesClicks&&null!=e.intersectionDistance(t,i))return!0;return!1}selectObject(t){let i=!1;for(const[e,n]of this._manipulatorByObject){const o=e===t;n.selected=o,i||=o}return i}onInputEvent(t){H(t,this._tooltip)}onManipulatorSelectionChanged(){[...this._manipulatorByObject.values()].some(t=>t.selected)||this.events.emit("selection-cleared")}_connectManipulator(t,i){const n=()=>this._syncManipulator(t,i);return e([t.on("committed",n),t.on("modified-externally",n),i.events.on("immediate-click",e=>{this.events.emit("select-item",{item:t.item}),e.button===I.Right&&"target"===i.metadata.type&&this.events.emit("delete-item",{target:i.metadata.target}),e.stopPropagation()}),i.events.on("grab-changed",({action:e})=>{"start"===e?(this.events.emit("select-item",{item:t.item}),this._grabbedManipulator=i,this._connectTooltip(t)):this._grabbedManipulator===i&&(this._grabbedManipulator=null,this._disconnectTooltip())}),i.events.on("drag",i=>t.updateDragIntersection(i)),i.events.on("location-update",()=>this._syncInteractionVisuals()),this._createDragHandle(t,i)])}_createDragHandle(t,i){return O(i,(e,n,o,a)=>{const s=t.operations;if(null==s)return;let r=null;const{cancelSnapping:l,snappingStep:c}=B({snappingContext:new T({editGeometryOperations:s,elevationInfo:t.elevationInfo,pointer:a,visualizer:new b}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});o.next(t=>(r?.undo(null),r=null,t)).next(l);const u=s.data.allVerticesUnordered.at(0);n.next(i=>("start"===i.action&&(r=t.createUndoRecord()),{...i,snapOrigin:u?.pos})).next(M(this.view,i.elevationAlignedLocation)).next(f(this.view,s.data.geometry,t.elevationInfo,s.data.spatialReference)).next(V(this.view,t.elevationInfo)).next(...c).next(t=>(s.trySetGeometry(m(t.mapEnd,new p),"start"===t.action?0:1),"end"===t.action&&null!=r&&(this.events.emit("record-undo",{record:r}),r=null),t))})}_connectTooltip(t){this._disconnectTooltip(),this._tooltipHandle=j(this._tooltip,t,()=>({activeTooltipInfo:this._tooltipInfo,callbacks:{onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._tooltipUndoRecord=t.createUndoRecord()},onMove:()=>{},onMoveStop:()=>{null!=this._tooltipUndoRecord&&(this.events.emit("record-undo",{record:this._tooltipUndoRecord}),this._tooltipUndoRecord=null)},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}},toolOptions:this._toolOptions}))}_disconnectTooltip(){this._tooltipHandle=o(this._tooltipHandle),this._tooltipUndoRecord=null,this._tooltip.clear()}_syncManipulators(){for(const[t,i]of this._manipulatorByObject)this._syncManipulator(t,i);this._syncInteractionVisuals()}_syncManipulator(t,i){const e=t.origin;if(i.available=this.visible&&t.visible&&null!=e,i.interactive=this.manipulatorsInteractive,null!=e&&(i.elevationAlignedLocation=e),"target"!==t.itemType)return;const n=this.analysisViewData.computations.find(i=>i.target===t.item),o=null!=n&&n.computationResult.isValid?n.computationResult.isTargetVisible?_.visible:_.occluded:_.undefined;i.state=this.interacting?y(o):o}_syncInteractionVisuals(){const t=this._grabbedManipulator??(null==this._moveInteractionObject?null:this._manipulatorByObject.get(this._moveInteractionObject)),i=[...this._manipulatorByObject.entries()].find(([t])=>"observer"===t.itemType)?.[1];null!=this._interactionVisuals&&null!=t&&null!=i&&(this.active||null!=this._moveInteractionObject)&&this.visible&&this.analysisViewData.visible?this._interactionVisuals.update({target:t.renderLocation,lineVerticalPlaneSegment:t===i?null:d(i.renderLocation,t.renderLocation,x),visible:!0}):this._interactionVisuals?.hide()}};t([r({constructOnly:!0})],D.prototype,"analysisViewData",void 0),t([r({constructOnly:!0})],D.prototype,"snappingManager",void 0),t([r({constructOnly:!0})],D.prototype,"view",void 0),t([r()],D.prototype,"automaticManipulatorSelection",void 0),t([r()],D.prototype,"removeIncompleteOnCancel",void 0),t([r()],D.prototype,"interacting",void 0),t([r()],D.prototype,"manipulatorsInteractive",void 0),t([r()],D.prototype,"_grabbedManipulator",void 0),t([r()],D.prototype,"updating",null),D=t([l("esri.views.3d.analysis.LineOfSight.LineOfSightItemTool")],D);export{D as LineOfSightItemTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{makeHandle as t}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as i,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import a from"../../../../symbols/support/ElevationInfo.js";import{LineOfSightPlacementController as r}from"./LineOfSightPlacementController.js";import{LineOfSightRayIntersector as l}from"./LineOfSightRayIntersector.js";import{LineOfSightReshapeTool3D as p}from"./LineOfSightReshapeTool3D.js";import{ExclusiveOperationManager as h}from"../../../analysis/ExclusiveOperationManager.js";import{ViewEventPriorities as c}from"../../../input/InputManager.js";import{AnalysisToolBase as v}from"../../../interactive/AnalysisToolBase.js";import{deactivevateTool as d}from"../../../interactive/interactiveToolUtils.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{acquire as u}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as y}from"../../../interactive/snapping/snappingUtils.js";const m={ready:"ready",creating:"creating",created:"created"};let g=class extends v{constructor(e){super(e),this._operationManager=new h,this._syncingActiveTool=!1,this.analysisViewData=null,this.removeIncompleteOnCancel=!1;const{snappingManager:t}=this._snappingManagerResult=u(e.view);this._reshapeIntersector=new l({view:e.view}),this._reshapeTool=new p({analysis:e.analysis,analysisViewData:e.analysisViewData,intersector:this._reshapeIntersector,snappingManager:t,view:e.view}),this._placementController=new r({...e,parent:this,snappingManager:t,shouldPreventVertexAdd:(e,t)=>this._reshapeTool.hasManipulatorAt(e,t)})}get active(){return this._reshapeTool.active||this._placementController.active}get canRedo(){return this._activeUndoRedoComponent?.canRedo??!1}get canUndo(){return this._activeUndoRedoComponent?.canUndo??!1}get state(){return this._placementController.active?m.creating:null!=this.analysis.observer?.position?m.created:m.ready}get cursor(){return this._placementController.active?"crosshair":null}get updating(){return this._reshapeTool.updating||this._placementController.updating}initialize(){y(this),this.addHandles([this._snappingManagerResult,this.view.on("key-down",e=>this._onKeyDown(e),c.WIDGET),i(()=>({editable:this.editable,interactive:this.analysisViewData.interactive,placementActive:this._placementController.active,valid:this.analysis.valid,visible:this.visible}),()=>this._syncActiveTool(),s),i(()=>this.state===m.created,e=>{e?this.finishToolCreation():this._set("created",!1)},s),i(()=>this.analysisViewData.visible,e=>{this.visible=e},s),i(()=>{const{analysis:e}=this,{observer:t,targets:i}=e;return{observer:t,observerPosition:t?.position,observerElevationInfo:t?.elevationInfo,observerFeature:t?.feature,targets:i.toArray().map(e=>[e,e.position,e.elevationInfo,e.feature])}},()=>this._syncItemsFromAnalysis(),s),i(()=>this.editable,e=>{this.analysisViewData.editable=e},s)])}destroy(){this._operationManager.destroy(),this._reshapeTool.stop(),this._placementController.stop(),this._reshapeTool.destroy(),this._placementController.destroy(),this._reshapeIntersector.destroy()}place(e){return this.analysisViewData.interactive=!0,this._operationManager.start("place",async(o,n)=>{const{elevationInfo:a}=e??{},r=a&&"observer"in a?a.observer:a,l=a&&"targets"in a?a.targets:a;this._placementController.observerPlacementElevationInfo=f(r),this._placementController.targetPlacementElevationInfo=f(l);const p=this.analysis.clone();let h=!1,c=!1;const v=()=>{if(!c){if(c=!0,this.stop(),!this.analysis.valid)return this.analysis.clear(),void o.reject();n.aborted||this.analysis.equals(p)?o.reject():o.resolve({})}};o.handles.push(t(()=>this.stop()),i(()=>this._placementController.active,e=>{e?h=!0:h&&v()},s)),this.continue()},e)}activate(){this.view.focus(),this.analysisViewData.interactive=!0,this._syncActiveTool(),this.analysis.valid||this._placementController.active||this.continue()}deactivate(){this.onDeactivate()}continue(){this.analysisViewData.interactive=!0,this._placementController.continue()}stop(){this._placementController.stop(),this._placementController.observerPlacementElevationInfo=null,this._placementController.targetPlacementElevationInfo=null,this._syncActiveTool()}redo(){this._activeUndoRedoComponent?.redo()}undo(){this._activeUndoRedoComponent?.undo()}get testInfo(){}get snappingOptions(){return this._snappingManager.options}set snappingOptions(e){this._snappingManager.options=e}get _snappingManager(){return this._snappingManagerResult.snappingManager}onEditableChange(){this.analysisViewData.editable=this.editable,this._reshapeTool.setEditableFlag(1,!0),this._reshapeTool.setEditableFlag(0,this.editable),this._syncActiveTool()}_hideReshapeTool(){this._reshapeTool.stop(),this._reshapeTool.visible=!1}_onKeyDown(e){const t=e.key;t===_.undo&&this.canUndo?(e.stopPropagation(),this.undo()):t===_.redo&&this.canRedo?(e.stopPropagation(),this.redo()):t===_.cancel&&!this.active&&this._reshapeTool.hasSelection&&this._reshapeTool.clearSelection()}get _activeUndoRedoComponent(){return this.analysisViewData.interactive?this._placementController.active||!this._canActivateReshapeTool?this._placementController.active?this._placementController:null:this._reshapeTool:null}get _canActivateReshapeTool(){return this.visible&&this.editable&&this.analysis.valid&&null!=this.analysis.observer?.position}_syncActiveTool(){if(!this._syncingActiveTool){this._syncingActiveTool=!0;try{const e=this.analysisViewData.interactive,t=this._canActivateReshapeTool;if(this._placementController.visible=this.visible&&e,this._reshapeTool.isParentToolInteracting=e&&this._placementController.active,this._reshapeTool.manipulatorsInteractive=e&&!this._placementController.active,!e)return this._placementController.stop(),this._hideReshapeTool(),this.analysisViewData.cursorTarget=null,void d(this.view,this);if(this._placementController.active)return this._reshapeTool.stop(),this._reshapeTool.visible=this.visible,void d(this.view,this);if(!t)return this._hideReshapeTool(),void d(this.view,this);if(this._reshapeTool.visible=!0,this.analysisViewData.cursorTarget=null,!this._reshapeTool.active&&!this._reshapeTool.hasSelection){const e=this.analysis.targets.at(-1);null!=e&&this._reshapeTool.applySelection({type:"target",target:e})}d(this.view,this)}finally{this._syncingActiveTool=!1}}}_syncItemsFromAnalysis(){this._syncActiveTool()}};function f(e){if(null==e)return null;const{featureExpressionInfo:t,mode:i,offset:s,unit:o}=e;return new a({featureExpressionInfo:t,mode:i,offset:s,unit:o})}e([o({constructOnly:!0})],g.prototype,"view",void 0),e([o({constructOnly:!0})],g.prototype,"analysis",void 0),e([o({constructOnly:!0})],g.prototype,"analysisViewData",void 0),e([o()],g.prototype,"active",null),e([o()],g.prototype,"canRedo",null),e([o()],g.prototype,"canUndo",null),e([o()],g.prototype,"state",null),e([o()],g.prototype,"cursor",null),e([o()],g.prototype,"updating",null),e([o()],g.prototype,"removeIncompleteOnCancel",void 0),e([o()],g.prototype,"snappingOptions",null),e([o()],g.prototype,"_canActivateReshapeTool",null),g=e([n("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],g);export{g as LineOfSightTool};
2
+ import{__decorate as t}from"tslib";import{makeHandle as e}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{watch as i,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as n,subclass as s}from"../../../../core/accessorSupport/decorators.js";import a from"../../../../symbols/support/ElevationInfo.js";import{LineOfSightEditTool as l}from"./LineOfSightEditTool.js";import{LineOfSightPlacementController as r}from"./LineOfSightPlacementController.js";import{LineOfSightRayIntersector as c}from"./LineOfSightRayIntersector.js";import{ExclusiveOperationManager as h}from"../../../analysis/ExclusiveOperationManager.js";import{ViewEventPriorities as p}from"../../../input/InputManager.js";import{AnalysisToolBase as d}from"../../../interactive/AnalysisToolBase.js";import{deactivevateTool as v}from"../../../interactive/interactiveToolUtils.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{acquire as u}from"../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as m}from"../../../interactive/snapping/snappingUtils.js";const g={ready:"ready",creating:"creating",created:"created"};let y=class extends d{constructor(t){super(t),this._operationManager=new h,this._syncingActiveTool=!1,this.analysisViewData=null,this.removeIncompleteOnCancel=!1;const{snappingManager:e}=this._snappingManagerResult=u(t.view);this._editIntersector=new c({view:t.view}),this._editTool=new l({analysis:t.analysis,analysisViewData:t.analysisViewData,intersector:this._editIntersector,snappingManager:e,view:t.view}),this._placementController=new r({...t,parent:this,snappingManager:e,shouldPreventVertexAdd:(t,e)=>this._editTool.hasManipulatorAt(t,e)})}get active(){return this._editTool.active||this._placementController.active}get canRedo(){return this._activeUndoRedoComponent?.canRedo??!1}get canUndo(){return this._activeUndoRedoComponent?.canUndo??!1}get state(){return this._placementController.active?g.creating:null!=this.analysis.observer?.position?g.created:g.ready}get cursor(){return this._placementController.active?"crosshair":null}get updating(){return this._editTool.updating||this._placementController.updating}initialize(){m(this),this.addHandles([this._snappingManagerResult,this.view.on("key-down",t=>this._onKeyDown(t),p.WIDGET),i(()=>({editable:this.editable,interactive:this.analysisViewData.interactive,placementActive:this._placementController.active,valid:this.analysis.valid,visible:this.visible}),()=>this._syncActiveTool(),o),i(()=>this.state===g.created,t=>{t?this.finishToolCreation():this._set("created",!1)},o),i(()=>this.analysisViewData.visible,t=>{this.visible=t},o),i(()=>this.editable,t=>{this.analysisViewData.editable=t},o)])}destroy(){this._operationManager.destroy(),this._editTool.stop(),this._placementController.stop(),this._editTool.destroy(),this._placementController.destroy(),this._editIntersector.destroy()}place(t){return this.analysisViewData.interactive=!0,this._operationManager.start("place",async(n,s)=>{const{elevationInfo:a}=t??{},l=a&&"observer"in a?a.observer:a,r=a&&"targets"in a?a.targets:a;this._placementController.observerPlacementElevationInfo=f(l),this._placementController.targetPlacementElevationInfo=f(r);const c=this.analysis.clone();let h=!1,p=!1;const d=()=>{if(!p){if(p=!0,this.stop(),!this.analysis.valid)return this.analysis.clear(),void n.reject();s.aborted||this.analysis.equals(c)?n.reject():n.resolve({})}};n.handles.push(e(()=>this.stop()),i(()=>this._placementController.active,t=>{t?h=!0:h&&d()},o)),this.continue()},t)}activate(){this.view.focus(),this.analysisViewData.interactive=!0,this._syncActiveTool(),this.analysis.valid||this._placementController.active||this.continue()}deactivate(){this.onDeactivate()}continue(){this.analysisViewData.interactive=!0,this._placementController.continue()}stop(){this._placementController.stop(),this._placementController.observerPlacementElevationInfo=null,this._placementController.targetPlacementElevationInfo=null,this._syncActiveTool()}redo(){this._activeUndoRedoComponent?.redo()}undo(){this._activeUndoRedoComponent?.undo()}get testInfo(){}get snappingOptions(){return this._snappingManager.options}set snappingOptions(t){this._snappingManager.options=t}get _snappingManager(){return this._snappingManagerResult.snappingManager}onEditableChange(){this.analysisViewData.editable=this.editable,this._editTool.setEditableFlag(1,!0),this._editTool.setEditableFlag(0,this.editable),this._syncActiveTool()}_hideEditTool(){this._editTool.stop(),this._editTool.visible=!1}_onKeyDown(t){const e=t.key;e===_.undo&&this.canUndo?(t.stopPropagation(),this.undo()):e===_.redo&&this.canRedo?(t.stopPropagation(),this.redo()):e===_.cancel&&!this.active&&this._editTool.hasSelection&&this._editTool.clearSelection()}get _activeUndoRedoComponent(){return this.analysisViewData.interactive?this._placementController.active||!this._canActivateEditTool?this._placementController.active?this._placementController:null:this._editTool:null}get _canActivateEditTool(){return this.visible&&this.editable&&this.analysis.valid&&null!=this.analysis.observer?.position}_syncActiveTool(){if(!this._syncingActiveTool){this._syncingActiveTool=!0;try{const t=this.analysisViewData.interactive,e=this._canActivateEditTool;if(this._placementController.visible=this.visible&&t,this._editTool.manipulatorsInteractive=t&&!this._placementController.active,!t)return this._placementController.stop(),this._hideEditTool(),this.analysisViewData.cursorTarget=null,void v(this.view,this);if(this._placementController.active)return this._editTool.stop(),this._editTool.visible=this.visible,void v(this.view,this);if(!e)return this._hideEditTool(),void v(this.view,this);if(this._editTool.visible=!0,this.analysisViewData.cursorTarget=null,!this._editTool.active&&!this._editTool.hasSelection){const t=this.analysis.targets.at(-1);null!=t&&this._editTool.selectItem(t)}v(this.view,this)}finally{this._syncingActiveTool=!1}}}};function f(t){if(null==t)return null;const{featureExpressionInfo:e,mode:i,offset:o,unit:n}=t;return new a({featureExpressionInfo:e,mode:i,offset:o,unit:n})}t([n({constructOnly:!0})],y.prototype,"view",void 0),t([n({constructOnly:!0})],y.prototype,"analysis",void 0),t([n({constructOnly:!0})],y.prototype,"analysisViewData",void 0),t([n()],y.prototype,"active",null),t([n()],y.prototype,"canRedo",null),t([n()],y.prototype,"canUndo",null),t([n()],y.prototype,"state",null),t([n()],y.prototype,"cursor",null),t([n()],y.prototype,"updating",null),t([n()],y.prototype,"removeIncompleteOnCancel",void 0),t([n()],y.prototype,"snappingOptions",null),t([n()],y.prototype,"_canActivateEditTool",null),y=t([s("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],y);export{y as LineOfSightTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import i from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as a,Cyclical as n}from"../../../../core/Cyclical.js";import{handlesGroup as r}from"../../../../core/handleUtils.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as l}from"../../../../core/maybe.js";import{watch as s,syncAndInitial as p,initial as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{sub as h,len as v,dot as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as M}from"../../../../core/support/UpdatingHandles.js";import{tryProject as m}from"../../../../geometry/projectionUtils.js";import{getZForElevationMode as f}from"../../../../support/elevationInfoUtils.js";import{viewshedToolManipulatorConfiguration as _}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as w,isSideHorizontal as O,flipSide as V}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedObserverManipulatedObject3D as D}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedScaleOrientManipulation as y}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as j}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as S}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as x}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{createManipulatorDragEventPipeline as C,resetManipulatedObject as T,sceneSnappingAtLocation as A,dragManipulatedObject as F,sceneSnappingAtProjectedLocation as P,resetProperties as H}from"../../../interactive/dragEventPipeline.js";const z=Symbol("dragHandles");let E=class extends i{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._observerManipulatedObject=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._updatingHandles=new M,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new w({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new y({view:this.view,tool:this.parentTool}),this._observerManipulator=new j(this.view,this.parentTool),this._observerManipulatedObject=new D({view:this.view,subTool:this}),this.addHandles([s(()=>this.elevationAlignedObserverRenderSpace,e=>{null!=e&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},p),this._updatingHandles.add(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=o(90-e))},u),this._updatingHandles.add(()=>{const{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace,operations:this._observerManipulatedObject.operations}},({viewshedComputedData:e,observer:i,operations:a},n)=>{this._grabbing&&i!==n?.observer||(this.removeHandles(z),e?.valid&&null!=a&&this.addHandles([this._buildObserverManipulatorDragPipeline(e),this._buildMoveManipulationDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(t),z))},u),this._updatingHandles.add(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},u),this._updatingHandles.add(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},u),this._updatingHandles.add(()=>{const{viewshedComputedData:e,analysisViewData:i}=this,t=i.visible&&(e?.valid??!1),a=i.selectedViewshed===e?.viewshed,n=t&&a,r=e?.effectiveElevationInfo.mode;return{controlsAvailable:n,selected:a,visibleAndValid:t,zManipulationAvailable:n&&"on-the-ground"!==r}},({controlsAvailable:e,selected:i,visibleAndValid:t,zManipulationAvailable:a})=>{this._moveManipulation.available=e,this._moveManipulation.zManipulation.available=a,this._scaleOrientManipulation.available=e,this._observerManipulator.available=t,this._observerManipulator.collisionPriority=i?2:0,this._fieldOfViewManipulation.available=e},u),this._updatingHandles.add(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const{observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}=e;return{viewshedCompData:e,observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}},e=>{null!=e&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},u)]);const e=e=>{this.addHandles([e.events.on("grab-changed",i=>{this._grabbing="start"===i.action,"end"===i.action&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e._setInteractive(!this._grabbing)}),this._setInteractive(i=>i===e||!this._grabbing)}),e.events.on("drag",e=>{"start"===e.action&&this.parentTool.updateInteractionVisualsVisibility()})])};this._forEachManipulator(e)}destroy(){this._observerManipulatedObject=l(this._observerManipulatedObject),this._moveManipulation=l(this._moveManipulation),this._fieldOfViewManipulation=l(this._fieldOfViewManipulation),this._scaleOrientManipulation=l(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=l(this._observerManipulator),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){const i=this.viewshed;null!=i&&(i.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get observerManipulator(){return this._observerManipulator}get observerManipulatedObject(){return this._observerManipulatedObject}get moveInteractionState(){const{dragging:e,grabbing:i}=this._moveManipulation;return{dragging:e||this._observerManipulator.dragging,grabbing:i||this._observerManipulator.grabbing}}get scaleOrientInteractionState(){const{dragging:e,grabbing:i}=this._scaleOrientManipulation;return{dragging:e,grabbing:i}}_setInteractive(e){const i="boolean"==typeof e;this._observerManipulator.interactive=i?e:e(this._observerManipulator),this._forEachManipulation(t=>{t.interactive=i?e:t.someManipulator(e)})}onManipulatorSelectionChanged(){if(!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null)}}hasManipulator(e){let i=!1;return this._forEachManipulator(t=>{i=i||t===e}),i}_someManipulatorSelected(){return this._moveManipulation.selected||this._observerManipulator.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_createMoveManipulation(){return new x({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:S})}_buildObserverManipulatorDragPipeline(e){const{effectiveElevationInfo:i}=e,t=this._observerManipulatedObject,a=t.operations;if(null==a)return null;const n=a.data.spatialReference;return C(this._observerManipulator,(e,r,o,l)=>{let s=null;o=o.next(T(t));const p=this.parentTool.createObserverMoveSnappingPipeline(0,l,i,!0);let u=r.next(e=>{if("start"===e.action){const e=a.data.geometry;s="point"===e.type?e.clone():null}const t=this.view.toMap(e.screenEnd,{excludeLabels:!0});if(null==s||null==t)return null;t.z=f(t,this.view,i);const r=m(t,n);return null==r?null:{...e,mapStart:s,mapEnd:r}}).next(A(this.view,i));if(null!=p){const{snappingStep:e,cancelSnapping:i}=p;o.next(i),u=u.next(...e)}u.next(F(t))})}_buildMoveManipulationDragPipeline(e){const{effectiveElevationInfo:i}=e,t=this._observerManipulatedObject,a=t.operations;return null==a?null:this._moveManipulation.createDragPipeline((e,a,n,r,o)=>{r=r.next(T(t));const l=this.parentTool.createObserverMoveSnappingPipeline(e,o,i);if(null!=l){const{snappingStep:e,cancelSnapping:a}=l;return r=r.next(a),{steps:n=n.next(P(this.view,i)).next(...e).next(F(t)),cancel:r}}return{steps:n=n.next(F(t)),cancel:r}},i,a.data.spatialReference,void 0)}_buildFOVDragPipeline(e){let i=0,t=0;return this._fieldOfViewManipulation.createDragPipeline((n,r,o)=>{if(null==e)return{steps:r,cancel:o};const l=e.viewshed;let s=null;o=o.next(H(l,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:r.next(n=>{"start"===n.action&&(s=null,i=e.horizontalFieldOfView,t=e.verticalFieldOfView);const r=n.deltaAngle;if(null==s&&0!==r){const e="bottom"===n.side||"left"===n.side?r>0:r<0;s=O(n.side)?0===i&&e||360===i&&!e:0===t&&e}const o=s?V(n.side):n.side;let p=0;switch(o){case"left":p=i/2-r;break;case"right":p=i/2+r;break;case"top":p=t+2*r;break;case"bottom":p=t-2*r}return O(o)?(p=a.normalize(p),p=p>270?0:p>180?180:p,l.horizontalFieldOfView=2*p):l.verticalFieldOfView=p,n}),cancel:o}},e)}_buildScaleOrientDragPipeline(e){let i=0,t=0;const n=(i,t)=>(a,n,r)=>{if(null==e)return{steps:n,cancel:r};const o=e.viewshed;return r=r.next(H(o,[i])),{steps:n=n.next(t(o,e)),cancel:r}};return r([this._scaleOrientManipulation.createHeadingDragPipeline(n("heading",(i,n)=>n=>("start"===n.action&&(t=e.heading),i.heading=a.normalize(t+n.deltaAngle),n)),e),this._scaleOrientManipulation.createTiltDragPipeline(n("tilt",(t,a)=>a=>{"start"===a.action&&(i=e.tilt);let n=i+a.deltaAngle;return n<-90?n=180:n>270&&(n=0),t.tilt=R.clamp(n),a}),e),this._scaleOrientManipulation.createDistanceDragPipeline(n("farDistance",(e,i)=>t=>{const a=h(I,t.renderEnd,i.elevationAlignedObserverRenderSpace),n=v(a)*i.metersPerUnit,r=b(a,i.targetDirection)<0?_.scaleOrientMinDistance:n;return e.farDistance=r,t}),e)])}_forEachManipulator(e){this._forEachManipulation(i=>{i.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{observerManipulator:this._observerManipulator,moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData}}};e([d({constructOnly:!0})],E.prototype,"analysis",void 0),e([d({constructOnly:!0})],E.prototype,"analysisViewData",void 0),e([d({constructOnly:!0})],E.prototype,"parentTool",void 0),e([d({constructOnly:!0,nonNullable:!0})],E.prototype,"view",void 0),e([d()],E.prototype,"updating",null),e([d()],E.prototype,"viewshed",null),e([d()],E.prototype,"_grabbing",void 0),e([d()],E.prototype,"grabbing",null),e([d()],E.prototype,"viewshedComputedData",void 0),e([d()],E.prototype,"observer",null),e([d()],E.prototype,"elevationAlignedObserverRenderSpace",null),E=e([c("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],E);const I=g(),R=new n(0,180);export{E as ViewshedSubTool};
2
+ import{__decorate as e}from"tslib";import i from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as a,Cyclical as n}from"../../../../core/Cyclical.js";import{handlesGroup as r}from"../../../../core/handleUtils.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as l}from"../../../../core/maybe.js";import{watch as s,syncAndInitial as p,initial as d}from"../../../../core/reactiveUtils.js";import{property as u,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{sub as c,len as v,dot as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as M}from"../../../../core/support/UpdatingHandles.js";import{viewshedToolManipulatorConfiguration as m}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as _,isSideHorizontal as f,flipSide as w}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedObserverManipulatedObject3D as O}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedScaleOrientManipulation as V}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as D}from"./viewshedToolManipulatorUtils.js";import{screenToMapAtSceneSurface as y}from"../../interactive/editingTools/dragEventPipeline3D.js";import{discRadiusSmall as j}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as S}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{createManipulatorDragEventPipeline as x,resetManipulatedObject as C,sceneSnappingAtLocation as T,dragManipulatedObject as A,sceneSnappingAtProjectedLocation as F,resetProperties as P}from"../../../interactive/dragEventPipeline.js";const H=Symbol("dragHandles");let z=class extends i{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._observerManipulatedObject=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._updatingHandles=new M,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new _({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new V({view:this.view,tool:this.parentTool}),this._observerManipulator=new D(this.view,this.parentTool),this._observerManipulatedObject=new O({view:this.view,subTool:this}),this.addHandles([s(()=>this.elevationAlignedObserverRenderSpace,e=>{null!=e&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},p),this._updatingHandles.add(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=o(90-e))},d),this._updatingHandles.add(()=>{const{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace,operations:this._observerManipulatedObject.operations}},({viewshedComputedData:e,observer:i,operations:a},n)=>{this._grabbing&&i!==n?.observer||(this.removeHandles(H),e?.valid&&null!=a&&this.addHandles([this._buildObserverManipulatorDragPipeline(e),this._buildMoveManipulationDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(t),H))},d),this._updatingHandles.add(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},d),this._updatingHandles.add(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},d),this._updatingHandles.add(()=>{const{viewshedComputedData:e,analysisViewData:i}=this,t=i.visible&&(e?.valid??!1),a=i.selectedViewshed===e?.viewshed,n=t&&a,r=e?.effectiveElevationInfo.mode;return{controlsAvailable:n,selected:a,visibleAndValid:t,zManipulationAvailable:n&&"on-the-ground"!==r}},({controlsAvailable:e,selected:i,visibleAndValid:t,zManipulationAvailable:a})=>{this._moveManipulation.available=e,this._moveManipulation.zManipulation.available=a,this._scaleOrientManipulation.available=e,this._observerManipulator.available=t,this._observerManipulator.collisionPriority=i?2:0,this._fieldOfViewManipulation.available=e},d),this._updatingHandles.add(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const{observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}=e;return{viewshedCompData:e,observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:n}},e=>{null!=e&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},d)]);const e=e=>{this.addHandles([e.events.on("grab-changed",i=>{this._grabbing="start"===i.action,"end"===i.action&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e._setInteractive(!this._grabbing)}),this._setInteractive(i=>i===e||!this._grabbing)}),e.events.on("drag",e=>{"start"===e.action&&this.parentTool.updateInteractionVisualsVisibility()})])};this._forEachManipulator(e)}destroy(){this._observerManipulatedObject=l(this._observerManipulatedObject),this._moveManipulation=l(this._moveManipulation),this._fieldOfViewManipulation=l(this._fieldOfViewManipulation),this._scaleOrientManipulation=l(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=l(this._observerManipulator),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){const i=this.viewshed;null!=i&&(i.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get observerManipulator(){return this._observerManipulator}get observerManipulatedObject(){return this._observerManipulatedObject}get moveInteractionState(){const{dragging:e,grabbing:i}=this._moveManipulation;return{dragging:e||this._observerManipulator.dragging,grabbing:i||this._observerManipulator.grabbing}}get scaleOrientInteractionState(){const{dragging:e,grabbing:i}=this._scaleOrientManipulation;return{dragging:e,grabbing:i}}_setInteractive(e){const i="boolean"==typeof e;this._observerManipulator.interactive=i?e:e(this._observerManipulator),this._forEachManipulation(t=>{t.interactive=i?e:t.someManipulator(e)})}onManipulatorSelectionChanged(){if(!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null)}}hasManipulator(e){let i=!1;return this._forEachManipulator(t=>{i=i||t===e}),i}_someManipulatorSelected(){return this._moveManipulation.selected||this._observerManipulator.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_createMoveManipulation(){return new S({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:j})}_buildObserverManipulatorDragPipeline(e){const{effectiveElevationInfo:i}=e,t=this._observerManipulatedObject,a=t.operations;if(null==a)return null;const n=a.data.spatialReference;return x(this._observerManipulator,(e,r,o,l)=>{const s=a.data.geometry;if("point"!==s.type)return;o=o.next(C(t));const p=this.parentTool.createObserverMoveSnappingPipeline(0,l,i,!0);let d=r.next(y(this.view,s,i,n)).next(T(this.view,i));if(null!=p){const{snappingStep:e,cancelSnapping:i}=p;o.next(i),d=d.next(...e)}d.next(A(t))})}_buildMoveManipulationDragPipeline(e){const{effectiveElevationInfo:i}=e,t=this._observerManipulatedObject,a=t.operations;return null==a?null:this._moveManipulation.createDragPipeline((e,a,n,r,o)=>{r=r.next(C(t));const l=this.parentTool.createObserverMoveSnappingPipeline(e,o,i);if(null!=l){const{snappingStep:e,cancelSnapping:a}=l;return r=r.next(a),{steps:n=n.next(F(this.view,i)).next(...e).next(A(t)),cancel:r}}return{steps:n=n.next(A(t)),cancel:r}},i,a.data.spatialReference,void 0)}_buildFOVDragPipeline(e){let i=0,t=0;return this._fieldOfViewManipulation.createDragPipeline((n,r,o)=>{if(null==e)return{steps:r,cancel:o};const l=e.viewshed;let s=null;o=o.next(P(l,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:r.next(n=>{"start"===n.action&&(s=null,i=e.horizontalFieldOfView,t=e.verticalFieldOfView);const r=n.deltaAngle;if(null==s&&0!==r){const e="bottom"===n.side||"left"===n.side?r>0:r<0;s=f(n.side)?0===i&&e||360===i&&!e:0===t&&e}const o=s?w(n.side):n.side;let p=0;switch(o){case"left":p=i/2-r;break;case"right":p=i/2+r;break;case"top":p=t+2*r;break;case"bottom":p=t-2*r}return f(o)?(p=a.normalize(p),p=p>270?0:p>180?180:p,l.horizontalFieldOfView=2*p):l.verticalFieldOfView=p,n}),cancel:o}},e)}_buildScaleOrientDragPipeline(e){let i=0,t=0;const n=(i,t)=>(a,n,r)=>{if(null==e)return{steps:n,cancel:r};const o=e.viewshed;return r=r.next(P(o,[i])),{steps:n=n.next(t(o,e)),cancel:r}};return r([this._scaleOrientManipulation.createHeadingDragPipeline(n("heading",(i,n)=>n=>("start"===n.action&&(t=e.heading),i.heading=a.normalize(t+n.deltaAngle),n)),e),this._scaleOrientManipulation.createTiltDragPipeline(n("tilt",(t,a)=>a=>{"start"===a.action&&(i=e.tilt);let n=i+a.deltaAngle;return n<-90?n=180:n>270&&(n=0),t.tilt=I.clamp(n),a}),e),this._scaleOrientManipulation.createDistanceDragPipeline(n("farDistance",(e,i)=>t=>{const a=c(E,t.renderEnd,i.elevationAlignedObserverRenderSpace),n=v(a)*i.metersPerUnit,r=b(a,i.targetDirection)<0?m.scaleOrientMinDistance:n;return e.farDistance=r,t}),e)])}_forEachManipulator(e){this._forEachManipulation(i=>{i.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{observerManipulator:this._observerManipulator,moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData}}};e([u({constructOnly:!0})],z.prototype,"analysis",void 0),e([u({constructOnly:!0})],z.prototype,"analysisViewData",void 0),e([u({constructOnly:!0})],z.prototype,"parentTool",void 0),e([u({constructOnly:!0,nonNullable:!0})],z.prototype,"view",void 0),e([u()],z.prototype,"updating",null),e([u()],z.prototype,"viewshed",null),e([u()],z.prototype,"_grabbing",void 0),e([u()],z.prototype,"grabbing",null),e([u()],z.prototype,"viewshedComputedData",void 0),e([u()],z.prototype,"observer",null),e([u()],z.prototype,"elevationAlignedObserverRenderSpace",null),z=e([h("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],z);const E=g(),I=new n(0,180);export{z as ViewshedSubTool};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/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,isPromiseLike as n}from"../../../../core/promiseUtils.js";import{createVolume as s}from"../../../../core/quantity.js";import a from"../../../../core/ReactiveMap.js";import{whenOnce as l}from"../../../../core/reactiveUtils.js";import{property as u,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{runUntracked as m}from"../../../../core/accessorSupport/tracking.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxes as h}from"../../../../core/libs/gl-matrix-2/math/quat.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{sqrDist as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{scaleAndAdd as y,scale as _,set as v,negate as w}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b,fromValues as j,clone as E}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as x}from"../../../../core/support/UpdatingHandles.js";import R from"../../../../geometry/Multipoint.js";import{projectOrLoad as C}from"../../../../geometry/projectionUtils.js";import{e as L}from"../../../../chunks/containsOperator.js";import{e as O}from"../../../../chunks/convexHullOperator.js";import{e as T}from"../../../../chunks/simplifyOperator.js";import{e as V}from"../../../../chunks/unionOperator.js";import{computeTranslationToOriginAndRotation as G}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as H}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as M,create as D,fromExtent as I,intersects as P}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as U}from"../../../../geometry/support/coordinateSystem.js";import{isClockwise as k}from"../../../../geometry/support/coordsUtils.js";import{newDoubleArray as S}from"../../../../geometry/support/DoubleArray.js";import{t as A}from"../../../../chunks/vec3.js";import B from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as F}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as W}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementInsufficientDataError as z,VolumeMeasurementPerimeterTooLargeError as q,VolumeMeasurementUnsupportedCoordinateSystemError as N,VolumeMeasurementUnsupportedLayerTransparencyError as Z}from"./volumeMeasurementErrors.js";import{VolumeMeasurementRawResult as J}from"./VolumeMeasurementRawResult.js";import K from"./VolumeMeasurementResult.js";import{ElevationContext as Q}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as X}from"../../support/ElevationProvider.js";import{Obb as Y}from"../../support/orientedBoundingBox.js";import{polygonToRenderInfoElevationAligned as $}from"../../support/renderInfoUtils/polygon.js";import{IteratorPreorder as ee}from"../../terrain/tileUtils.js";import{CutFillComputation as te,TargetGeometryRenderInfo as re}from"../../webgl-engine/lib/CutFillComputation.js";import{GeometryWorkerHandle as oe}from"../../../support/GeometryWorkerHandle.js";import{isIntegratedMeshLayerView as ie}from"../../../support/layerViewUtils.js";let ne=class extends r{constructor(e){super(e),this._measurementWorkerHandle=new oe,this.depthExtremaPositions=null,this.analysisObb=null,this._updatingHandles=new x,this._rawResult=null,this._sufficientDataCoverage=!0,this._tileIterator=new ee,this._intersectingObbsByLayerView=new a,this._intersectingTiles=[],this._debouncedUpdate=i(async(e,t,r,o)=>{if(!this._computation.done)return;const{renderCoordsHelper:i}=this.view,n=new W({extent:t,localOrigin:r,renderCoordsHelper:i});this._computation.update(n,o),this._determineDataCoverage(n,e);const[s]=await Promise.allSettled([this._measurementWorkerHandle.areaHorizontal(e,{returnLength:!0}),l(()=>this._computation.done).then(()=>{this._updateDepthExtremaPositions(n,this._computation.result)})]);if(this.error)return void(this._rawResult=null);const a=this._computation.result;this._updateResult(n,a,"fulfilled"===s.status?s.value:null)}),this._determineDataCoverage=(e,t)=>{const{frustum:r}=this._computation,{cameraDimensions:o}=e;t.extent&&r&&(this._intersectingObbsByLayerView.clear(),this._imLayerViewsAffectingMeasurement.forEach(e=>{this._findIntersectingObbs(e,r)}),this._intersectingObbsByLayerView.size>0?this._sufficientDataCoverage=this._sufficientIntegratedMeshCoverage(t,o):(this._findIntersectingTerrainTiles(t.extent),this._sufficientDataCoverage=this._sufficientTerrainCoverage(o)))}}initialize(){const e=this.view;this._computation=new te({view:e}),this.addHandles([this._createElevationUpdateHandle(),this._updatingHandles.add(()=>({localOrigin:this._localOrigin,targetGeometryRenderInfo:this._targetGeometryRenderInfo}),({localOrigin:e,targetGeometryRenderInfo:t})=>{const r=this._projectedGeometry,o=r?.extent;if(!(r&&o&&e&&t))return this._rawResult=null,this.depthExtremaPositions=null,this.analysisObb=null,void(this._sufficientDataCoverage=!0);this._updatingHandles.consumePromise(this._debouncedUpdate(r,o,e,t))})])}destroy(){this._updatingHandles.destroy(),this._computation.destroy(),this._measurementWorkerHandle.destroy()}get _projectedGeometry(){const e=this.analysis.geometry;if(!e||!this.analysis.valid)return null;const t=T(e),r=C(t,this.view.spatialReference);return r.pending?(this._updatingHandles.consumePromise(r.pending),null):(t&&!r.geometry&&F(this.analysis,e.spatialReference,o.getLogger(this)),r.geometry)}get _localOrigin(){const e=this._projectedGeometry?.extent;return e?j(e.center.x,e.center.y,0):null}get elevationAlignedGeometry(){const e=this._projectedGeometry;return e?m(()=>{const t=e.clone();return se(this.view.elevationProvider,t),t}):null}get targetGeometry(){const{elevationAlignedGeometry:e}=this;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.viewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings.forEach(e=>e.forEach(e=>e[2]=r)),o}get _targetGeometryRenderInfo(){const e=this.targetGeometry,t=this._localOrigin;if(!e||!t)return null;const{elevationProvider:r,renderCoordsHelper:o}=this.view,i=$(e,r,o,Q.fromElevationInfo(new B({mode:"absolute-height"})));if(n(i))return this._updatingHandles.consumePromise(i),null;if(null==i)return null;const{positions:s,polygonIndices:a,vertexCount:l}=i,u=S(3*l),p=c(),m=c();return G(e.spatialReference,t,p,o.spatialReference),m[12]=-p[12],m[13]=-p[13],m[14]=-p[14],A(u,s,m),new re(u,a)}get updating(){return this._computation.updating||this._updatingHandles.updating}get result(){const e=this._rawResult,{volume:t,area:r,length:o}=this.viewData.effectiveDisplayUnits;return e&&!this.error?new K({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=>ie(e)).filter(e=>e.visible&&!e.suspended)}get _insufficientDataError(){return this._sufficientDataCoverage?null:new z}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._perimeterForError,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new q:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeterForError,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new q:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new N:null}get _unsupportedLayerTransparencyError(){const e=this.view.map.ground&&this.view.map.ground.opacity<1,t=this._intersectingObbsByLayerView.size>0;return this._intersectingObbsByLayerView.keys().some(e=>e.fullOpacity<1)||e&&!t?new Z:null}get _perimeterForError(){const e=this._projectedGeometry;if(null==e)return null;let t=null;for(const r of e.rings){if(!k(r))continue;const e=ue(pe(r));t=e?Math.max(t??0,e):t}return null!=t?t*e.spatialReference.metersPerUnit:null}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&t&&(H(e.extent,e.spatialReference,ce,this.view.spatialReference),I(t,he),P(ce,he)&&this.notifyChange("elevationAlignedGeometry"))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(e,t,r){if(!t)return;const{unitInMeters:o}=this.view.renderCoordsHelper,{dimensions:{width:i,height:n},cameraNearFar:{near:a,far:l}}=e,u=i/t.width*(n/t.height),p=ae(t.cut.totalDepth,a,l)*u,m=ae(t.fill.totalDepth,a,l)*u,c=o**3;this._rawResult=new J({cutVolume:s(Math.abs(p*c),"cubic-meters"),fillVolume:s(m*c,"cubic-meters"),area:r?.area,perimeter:r?.length})}_updateDepthExtremaPositions(e,t){if(!t)return;const{dimensions:{width:r,height:o},cameraNearFar:{near:i,far:n},cameraPositionRenderSpace:s,northVector:a,eastVector:l,upVector:u}=e,p=e=>{const{depthExtremum:p,depthExtremumCoords:[m,c],totalDepth:h}=e,d=E(s);return 0!==h&&(y(d,d,l,r*(m/t.width-.5)),y(d,d,a,o*(c/t.height-.5))),y(d,d,u,-ae(p,i,n)),d},m={cut:p(t.cut),fill:p(t.fill)};this.depthExtremaPositions=m,this.analysisObb=le(e,m)}_findIntersectingObbs(e,t){const r=[];"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)}),r.length>0&&this._intersectingObbsByLayerView.set(e,r)}_sufficientIntegratedMeshCoverage(e,t){const{renderCoordsHelper:r,spatialReference:o}=this.view,i=[],n=new R({spatialReference:o});if(this._intersectingObbsByLayerView.forEach(e=>{e.forEach(e=>{if(me(e.radius,t)&&(e.getCorners(be),n.points.length=0,be.forEach(e=>{const t=r.fromRenderCoords(e,je,o);t&&n.addPoint([t[0],t[1]])}),n.points.length)){const e=O(n);"polygon"===e?.type&&i.push(e)}})}),!i.length)return!1;const s=V(i);return!!s&&L(s,e)}_findIntersectingTerrainTiles(e){const{basemapTerrain:t}=this.view;this._intersectingTiles.length=0,I(e,de);const r=this._tileIterator;r.reset(t.rootTiles);for(let o=r.next();o;o=r.next())o.intersectsExtent(de)?o.rendered&&this._intersectingTiles.push(o):r.skipSubtree()}_sufficientTerrainCoverage(e){const{basemapTerrain:{tilingScheme:t}}=this.view;if(!this._intersectingTiles.length)return!1;const r=256/t.pixelSize;return this._intersectingTiles.every(t=>me(t.radius*r,e))}};function se(e,t){t.hasZ=!0,t.rings.forEach(t=>t.forEach(t=>t[2]=X(e,t,"ground")??0))}function ae(e,t,r){return e*(r-t)+t}function le(e,t){const{boundingRect:r,eastVector:o,northVector:i,upVector:n}=e;U(t.cut,o,i,n,fe),U(t.fill,o,i,n,ge);const s=.5*(r[0]+r[2]),a=.5*(r[1]+r[3]),l=Math.min(fe[2],ge[2]),u=Math.max(fe[2],ge[2]),p=.5*(l+u);return _(ye,o,s),y(ye,ye,i,a),y(ye,ye,n,p),v(_e,.5*(r[2]-r[0]),.5*(r[3]-r[1]),.5*(u-l)),w(ve,n),new Y(ye,_e,h(we,ve,o,i))}function ue(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1]]),r?o+=f(r,i):r=[0,0],r[0]=i[0],r[1]=i[1];return t&&r&&(o+=f(r,t)),Math.sqrt(o)}function*pe(e){const t=g();for(let r=0;r<e.length;r++)t[0]=e[r][0],t[1]=e[r][1],yield t}e([u()],ne.prototype,"_projectedGeometry",null),e([u()],ne.prototype,"_localOrigin",null),e([u()],ne.prototype,"elevationAlignedGeometry",null),e([u()],ne.prototype,"targetGeometry",null),e([u()],ne.prototype,"_targetGeometryRenderInfo",null),e([u({constructOnly:!0})],ne.prototype,"analysis",void 0),e([u({constructOnly:!0})],ne.prototype,"viewData",void 0),e([u({constructOnly:!0})],ne.prototype,"view",void 0),e([u()],ne.prototype,"updating",null),e([u()],ne.prototype,"result",null),e([u()],ne.prototype,"depthExtremaPositions",void 0),e([u()],ne.prototype,"analysisObb",void 0),e([u()],ne.prototype,"error",null),e([u()],ne.prototype,"_imLayerViewsAffectingMeasurement",null),e([u()],ne.prototype,"_insufficientDataError",null),e([u()],ne.prototype,"_perimeterTooLargeError",null),e([u()],ne.prototype,"_perimeterTooLargeLocalError",null),e([u()],ne.prototype,"_perimeterTooLargeGlobalError",null),e([u()],ne.prototype,"_unsupportedCoordinateSystemError",null),e([u()],ne.prototype,"_unsupportedLayerTransparencyError",null),e([u()],ne.prototype,"_perimeterForError",null),e([u()],ne.prototype,"_computation",void 0),e([u({readOnly:!0})],ne.prototype,"_updatingHandles",void 0),e([u()],ne.prototype,"_rawResult",void 0),e([u()],ne.prototype,"_sufficientDataCoverage",void 0),ne=e([p("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementController")],ne);const me=(e,t)=>e<(t.width+t.height)/2,ce=M(),he=M(),de=D(),fe=b(),ge=b(),ye=b(),_e=b(),ve=b(),we=d(),be=new Array(8).fill(0).map(()=>b()),je=b();export{ne as VolumeMeasurementController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import s from"../../../../core/Accessor.js";import{makeHandle as a}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{ignoreAbortErrors as i,isAborted as r}from"../../../../core/promiseUtils.js";import{pausable as o,sync as h,watch as n,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as c,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import m from"../../../../layers/GraphicsLayer.js";import y from"../../../../symbols/SimpleFillSymbol.js";import{isPolygon as u,isPolygonGraphic as g}from"./volumeMeasurementGeometryUtils.js";import{VolumeMeasurementShiftTool as _}from"./VolumeMeasurementShiftTool.js";import{ExclusiveOperationManager as k}from"../../../analysis/ExclusiveOperationManager.js";import{makeAllLayerSnappingOptions as G}from"../../../interactive/snapping/allLayerSnapping.js";import w from"../../../../widgets/Sketch/SketchViewModel.js";let v=class extends s{constructor(e){super(e),this._updatingHandles=new d,this._operationManager=new k,this._onUndoRedo=()=>{this._updateGeometryFromSketchGraphic()}}initialize(){const{analysis:e,analysisViewData:t,view:s}=this;this._graphicsLayer=new m({listMode:"hide",internal:!0,elevationInfo:{mode:"on-the-ground"}});const a=G(s,{selfEnabled:!0,excludeInternal:!0});this._externalGeometryChangeHandle=o(()=>this.analysis.geometry,()=>this._ensureUpdatedSketchGraphic(),h),this._sketchViewModel=new w({layer:this._graphicsLayer,view:s,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"move"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polygonSymbol:this._polygonSymbol,snappingOptions:a.options}),this.addHandles([this._sketchViewModel.on(["undo","redo"],this._onUndoRedo),n(()=>({map:s.map,internalGraphicsLayer:this._graphicsLayer,state:this.state}),({map:e,internalGraphicsLayer:t,state:s})=>{switch(S(e,t),s){case"idle":case"reshaping-disabled":this._operationManager.stop(),this._graphicsLayer.removeAll(),this._ensureUpdatedSketchGraphic();break;case"reshaping":i(this._startReshape());break;case"awaiting-sketch":this.analysisViewData.interactive=!0}},l),a,this._externalGeometryChangeHandle]),this._shiftTool=new _({analysis:e,view:s,analysisViewData:t}),this.addHandles(this._shiftTool.on("record-undo",e=>{const t=this._sketchViewModel.activeComponent;"reshape-3d"===t?.type&&t.recordUndo(e.apply,e.undo)})),s.tools.add(this._shiftTool),this.addHandles({remove:()=>s.tools.remove(this._shiftTool)})}destroy(){this._operationManager.destroy(),this._sketchViewModel.destroy();const e=this._graphicsLayer;this.view.map.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),this._updateGeometryFromSketchGraphic())}get state(){const{geometry:e}=this.analysis,{interactive:t,visible:s}=this.analysisViewData;return s?this._sketchViewModel.createGraphic?this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch":e?t?"reshaping":"reshaping-disabled":"idle":"idle"}get updating(){return this._sketchViewModel.updating||this._shiftTool.updating||this._updatingHandles.updating}get _polygonSymbol(){return new y({color:[0,0,0,0],outline:{color:[0,0,0,0]}})}place(e){return this._operationManager.start("place",async t=>{const s=this.analysis.clone();this._ensureUpdatedSketchGraphic();const i=this._sketchViewModel.on("create",e=>{switch(e.state){case"start":this._graphicsLayer.removeAll(),this.sketchGraphic=e.graphic;break;case"active":this._updateGeometryFromSketchGraphic();break;case"complete":this._updateGeometryFromSketchGraphic(),t.stop();break;case"cancel":t.stop()}});t.handles.push(i,a(()=>(i.remove(),this._sketchViewModel.cancel(),this._updateGeometryFromSketchGraphic(),this.analysis.valid?r(e)||s.equals(this.analysis)?t.reject():void t.resolve({}):(this._clearGeometry(),t.reject())))),await this._updatingHandles.addPromise(this._sketchViewModel.create("polygon"))},e)}_startReshape(){return this._operationManager.start("reshape",async e=>{const t=()=>{const e=this._ensureUpdatedSketchGraphic();return e?(this._graphicsLayer.removeAll(),this._graphicsLayer.add(e),this._updatingHandles.addPromise(this._sketchViewModel.update(e,{tool:"reshape"}))):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;const s=this._sketchViewModel.on("update",s=>{this._updateGeometryFromSketchGraphic(),"complete"===s.state&&("reshaping"===this.state?i(t()):e.resolve())});e.handles.push(s,a(()=>{s.remove(),this._sketchViewModel.cancel(),e.resolve()})),await t()})}_ensureUpdatedSketchGraphic(){const{geometry:e}=this.analysis;return u(e)?(this.sketchGraphic??=new t({geometry:e,symbol:this._polygonSymbol}),this.sketchGraphic.geometry=e,this.sketchGraphic):(this.sketchGraphic=null,null)}_clearGeometry(){this.sketchGraphic=null,this.analysis.geometry=null}_updateGeometryFromSketchGraphic(){this._externalGeometryChangeHandle.pause();const e=this.sketchGraphic;this.analysis.geometry=g(e)?e.geometry:null,this._externalGeometryChangeHandle.resume()}get test(){}};e([c({constructOnly:!0})],v.prototype,"analysisViewData",void 0),e([c({constructOnly:!0})],v.prototype,"view",void 0),e([c({constructOnly:!0})],v.prototype,"analysis",void 0),e([c()],v.prototype,"sketchGraphic",null),e([c({nonNullable:!0})],v.prototype,"state",null),e([c()],v.prototype,"updating",null),e([c()],v.prototype,"_polygonSymbol",null),v=e([p("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementTool")],v);const f=v;function S(e,t){t&&(t.removeFromParent(),e?.add(t))}export{f as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../../Graphic.js";import s from"../../../../core/Accessor.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{ignoreAbortErrors as a,isAborted as r}from"../../../../core/promiseUtils.js";import{pausable as o,sync as h,watch as n,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{property as c,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import m from"../../../../layers/GraphicsLayer.js";import y from"../../../../symbols/SimpleFillSymbol.js";import{isPolygon as u,isPolygonGraphic as g}from"./volumeMeasurementGeometryUtils.js";import{VolumeMeasurementShiftTool as _}from"./VolumeMeasurementShiftTool.js";import{ExclusiveOperationManager as k}from"../../../analysis/ExclusiveOperationManager.js";import{makeAllLayerSnappingOptions as G}from"../../../interactive/snapping/allLayerSnapping.js";import v from"../../../../widgets/Sketch/SketchViewModel.js";let w=class extends s{constructor(e){super(e),this._updatingHandles=new d,this._operationManager=new k,this._onUndoRedo=()=>{this._updateGeometryFromSketchGraphic()}}initialize(){const{analysis:e,viewData:t,view:s}=this;this._graphicsLayer=new m({listMode:"hide",internal:!0,elevationInfo:{mode:"on-the-ground"}});const i=G(s,{selfEnabled:!0,excludeInternal:!0});this._externalGeometryChangeHandle=o(()=>this.analysis.geometry,()=>this._ensureUpdatedSketchGraphic(),h),this._sketchViewModel=new v({layer:this._graphicsLayer,view:s,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"move"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polygonSymbol:this._polygonSymbol,snappingOptions:i.options}),this.addHandles([this._sketchViewModel.on(["undo","redo"],this._onUndoRedo),n(()=>({map:s.map,internalGraphicsLayer:this._graphicsLayer,state:this.state}),({map:e,internalGraphicsLayer:t,state:s})=>{switch(S(e,t),s){case"idle":case"reshaping-disabled":this._operationManager.stop(),this._graphicsLayer.removeAll(),this._ensureUpdatedSketchGraphic();break;case"reshaping":a(this._startReshape());break;case"awaiting-sketch":this.viewData.interactive=!0}},l),i,this._externalGeometryChangeHandle]),this._shiftTool=new _({analysis:e,view:s,analysisViewData:t}),this.addHandles(this._shiftTool.on("record-undo",e=>{const t=this._sketchViewModel.activeComponent;"reshape-3d"===t?.type&&t.recordUndo(e.apply,e.undo)})),s.tools.add(this._shiftTool),this.addHandles({remove:()=>s.tools.remove(this._shiftTool)})}destroy(){this._operationManager.destroy(),this._sketchViewModel.destroy();const e=this._graphicsLayer;this.view.map.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),this._updateGeometryFromSketchGraphic())}get state(){const{geometry:e}=this.analysis,{interactive:t,visible:s}=this.viewData;return s?this._sketchViewModel.createGraphic?this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch":e?t?"reshaping":"reshaping-disabled":"idle":"idle"}get updating(){return this._sketchViewModel.updating||this._shiftTool.updating||this._updatingHandles.updating}get _polygonSymbol(){return new y({color:[0,0,0,0],outline:{color:[0,0,0,0]}})}place(e){return this._operationManager.start("place",async t=>{const s=this.analysis.clone();this._ensureUpdatedSketchGraphic();const a=this._sketchViewModel.on("create",e=>{switch(e.state){case"start":this._graphicsLayer.removeAll(),this.sketchGraphic=e.graphic;break;case"active":this._updateGeometryFromSketchGraphic();break;case"complete":this._updateGeometryFromSketchGraphic(),t.stop();break;case"cancel":t.stop()}});t.handles.push(a,i(()=>(a.remove(),this._sketchViewModel.cancel(),this._updateGeometryFromSketchGraphic(),this.analysis.valid?r(e)||s.equals(this.analysis)?t.reject():void t.resolve({}):(this._clearGeometry(),t.reject())))),await this._updatingHandles.addPromise(this._sketchViewModel.create("polygon"))},e)}_startReshape(){return this._operationManager.start("reshape",async e=>{const t=()=>{const e=this._ensureUpdatedSketchGraphic();return e?(this._graphicsLayer.removeAll(),this._graphicsLayer.add(e),this._updatingHandles.addPromise(this._sketchViewModel.update(e,{tool:"reshape"}))):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;const s=this._sketchViewModel.on("update",s=>{this._updateGeometryFromSketchGraphic(),"complete"===s.state&&("reshaping"===this.state?a(t()):e.resolve())});e.handles.push(s,i(()=>{s.remove(),this._sketchViewModel.cancel(),e.resolve()})),await t()})}_ensureUpdatedSketchGraphic(){const{geometry:e}=this.analysis;return u(e)?(this.sketchGraphic??=new t({geometry:e,symbol:this._polygonSymbol}),this.sketchGraphic.geometry=e,this.sketchGraphic):(this.sketchGraphic=null,null)}_clearGeometry(){this.sketchGraphic=null,this.analysis.geometry=null}_updateGeometryFromSketchGraphic(){this._externalGeometryChangeHandle.pause();const e=this.sketchGraphic;this.analysis.geometry=g(e)?e.geometry:null,this._externalGeometryChangeHandle.resume()}get test(){}};e([c({constructOnly:!0})],w.prototype,"viewData",void 0),e([c({constructOnly:!0})],w.prototype,"view",void 0),e([c({constructOnly:!0})],w.prototype,"analysis",void 0),e([c()],w.prototype,"sketchGraphic",null),e([c({nonNullable:!0})],w.prototype,"state",null),e([c()],w.prototype,"updating",null),e([c()],w.prototype,"_polygonSymbol",null),w=e([p("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementTool")],w);const f=w;function S(e,t){t&&(t.removeFromParent(),e?.add(t))}export{f as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/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 n from"../../../../core/Accessor.js";import{equals as r}from"../../../../core/arrayUtils.js";import{cyclicalPI as l}from"../../../../core/Cyclical.js";import{destroyMaybe as a}from"../../../../core/maybe.js";import{isPromiseLike as c}from"../../../../core/promiseUtils.js";import{preferredVolumePrecision as u,formatDecimal as d}from"../../../../core/quantityFormatUtils.js";import{initial as m}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{create as v}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as _,normalize as y,subtract as f,cross as j,dot as b}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as L,fromValues as w}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as C}from"../../../../core/support/UpdatingHandles.js";import{computeTranslationToOriginAndRotation as G}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{angleAroundAxis as P}from"../../../../geometry/support/vector.js";import{t as V}from"../../../../chunks/vec3.js";import x from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as O}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as R}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 A}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as H}from"../../layers/graphics/extrudeUtils.js";import{polygonToRenderInfoElevationAligned as U}from"../../support/renderInfoUtils/polygon.js";import{CutFill as F,VolumeGeometry as E}from"../../webgl-engine/lib/CutFill.js";import{createStipplePatternSimple as S}from"../../webgl-engine/materials/lineStippleUtils.js";let z=class extends n{get visible(){return this.viewData.visible&&null!=this.viewData.elevationAlignedGeometry&&null!=this.viewData.targetGeometry}get inView(){return this.viewData.analysisObb?.intersectsFrustum(this.view.frustum)??!1}get updating(){return this.loadingMessages||this._updatingHandles.updating}get hasUnsupportedError(){const{error:e}=this.viewData;return!!e&&["unsupported-coordinate-system","unsupported-layer-transparency"].includes(e.name)}get _extrusionHeights(){const{renderCoordsHelper:e}=this.view,{depthExtremaPositions:t,targetGeometry:i}=this.viewData,{targetElevationRange:s}=o;if(!i||!t)return{cut:s,fill:-s};let n=-1/0;for(const o of i.rings)for(const e of o)n=Math.max(n,e[2]);const r=1,l=e.getAltitude(t.fill);return{cut:s,fill:Math.min(l-n,0)-r}}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._updatingHandles=new C,this._elevationContext=A.fromElevationInfo(new x({mode:"absolute-height"})),this._projectionLines=[]}initialize(){const{view:e}=this,i={view:e,isDecoration:!0},s=o,n={...i,width:s.geometryOutlineWidth};this._elevationAlignedGeometry=new D({...n,isDraped:!0,color:s.geometryOutlineColor.toUnitRGBA()}),this._targetGeometry=new D(n);const r={...i,attached:!0,width:s.projectionLineWidth,renderOccluded:4,polygonOffset:3},l={...r,stipplePattern:S(s.projectionLineStippleSize)},a=s.cutProjectionLineColor.toUnitRGBA(),c=s.fillProjectionLineColor.toUnitRGBA();this._cutProjectionLines=new R({...r,color:a}),this._occludedCutProjectionLines=new R({...l,color:a}),this._fillProjectionLines=new R({...r,color:c,renderOccluded:8}),this._occludedFillProjectionLines=new R({...l,color:c});const u={...i,attached:!0};this._cutVolumeLabel=new O({...u,distance:s.labelDistance}),this._fillVolumeLabel=new O({...u,distance:-s.labelDistance}),this._visualization=new F({view:e,cutColor:s.cutColor,fillColor:s.fillColor,borderColor:s.geometryOutlineColor}),this.addHandles([this._updatingHandles.add(()=>({elevationAlignedGeometry:this.viewData.elevationAlignedGeometry,targetGeometry:this.viewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},m),this._updatingHandles.add(()=>({interactive:this.viewData.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._visualization.measureType=i},m),this._updatingHandles.add(()=>({elevationAlignedGeometry:this.viewData.elevationAlignedGeometry,targetGeometry:this.viewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i),m),this._updatingHandles.add(()=>({interactive:this.viewData.interactive,accentColor:this.view.effectiveTheme.accentColor,hasResult:!!this.viewData.result}),({interactive:e,accentColor:t,hasResult:i})=>{this._updateColors(e,t,i)},m),this._updatingHandles.add(()=>[this.viewData.targetGeometry,this.inView,this._extrusionHeights,this._polygonRenderInfo],()=>this._updateCutFillGeometry(),m),this._updatingHandles.add(()=>this.visible&&this.inView&&this.view.state.camera.aboveGround&&!this.hasUnsupportedError,e=>this._updateCutFillVisibility(e),m),this._updatingHandles.add(()=>{const{messages:e,unitsMessages:t,visible:i,viewData:s}=this;return{depthExtremaPositions:s.depthExtremaPositions,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i&&!!s.result}},e=>this._updateLabels(e)),this._updatingHandles.add(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e),m),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._visualization.destroy(),this._updatingHandles.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=[],n=[],l=[],a=[],c=[],u=e.spatialReference;for(let d=0;d<e.rings.length;d++){const i=e.rings[d],m=i.length>1&&r(i[0],i[i.length-1]),h=i.length-(m?1:0),p=[];for(let e=0;e<h;++e){const o=i[e],n=_(L(),o[0],o[1],o[2]);s.toRenderCoords(n,u,n);const r=t.rings[d][e],l=_(L(),r[0],r[1],r[2]);s.toRenderCoords(l,u,l);const a=new M(n,l);p.push(a)}const g=this.view.state.camera;for(let e=0;e<p.length;++e){const s=p[e],r=p[0===e?p.length-1:e-1],u=p[e===p.length-1?0:e+1],m=i[e],h=t.rings[d][e],v=m[2]>h[2],_=new I(s,r,u,v);o.push(_),_.updateOccluded(g);const y=_.isOccluded;v?(y?l:n).push(s):(y?c:a).push(s)}}this._projectionLines=o,this._cutProjectionLines.setGeometryFromSegments(n),this._occludedCutProjectionLines.setGeometryFromSegments(l),this._fillProjectionLines.setGeometryFromSegments(a),this._occludedFillProjectionLines.setGeometryFromSegments(c)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let n=!1,r=!1;for(const l of this._projectionLines){l.updateOccluded(e)&&(n||=l.isCut,r||=!l.isCut);const a=l.isOccluded;(l.isCut?a?i:t:a?o:s).push(l.segment)}r&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),n&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,t,i){const{geometryOutlineColor:s,cutColor:n,fillColor:r,cutColorMuted:l,fillColorMuted:a,cutProjectionLineColor:c,fillProjectionLineColor:u}=o;if(this._visualization.cutColor=i?n:l,this._visualization.fillColor=i?r: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._visualization.borderColor=t}else{this._targetGeometry.color=s.toUnitRGBA();const e=(i?c:l).toUnitRGBA();this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const t=(i?u:a).toUnitRGBA();this._fillProjectionLines.color=t,this._occludedFillProjectionLines.color=t,this._visualization.borderColor=s}}_updateLabels(e){const{effectiveDisplayUnits:t,depthExtremaPositions:s,messages:o,unitsMessages:n,result:r,visible:l}=e;if(this._cutVolumeLabel.visible=l,this._fillVolumeLabel.visible=l,this._cutVolumeLabel.geometry=s?{type:"point",point:s.cut}:null,this._fillVolumeLabel.geometry=s?{type:"point",point:s.fill}:null,null==r||null==o||null==n)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const a=t.volume,c=i(o.labels.cut,{volume:B(n,r.cutVolume,a)}),u=i(o.labels.fill,{volume:B(n,r.fillVolume,a)});this._cutVolumeLabel.text=c,this._fillVolumeLabel.text=u}_updateCutFillVisibility(e){e?this._visualization.enable():this._visualization.disable()}get _polygonRenderInfo(){const{renderCoordsHelper:e,elevationProvider:t}=this.view,{targetGeometry:i}=this.viewData;if(null==i)return null;const s=U(i,t,e,this._elevationContext,{outlineOutput:"tessellated-indices"});return c(s)?(this._updatingHandles.consumePromise(s),null):s}_updateCutFillGeometry(){const{view:e,viewData:t,inView:i}=this,{renderCoordsHelper:s}=e,{targetGeometry:o}=t,{cut:n,fill:r}=this._extrusionHeights;if(!o?.extent||!i)return;const{center:l}=o.extent,a=w(l.x,l.y,0),c=L();s.toRenderCoords(a,o.spatialReference,c);const u=this._getExtrudedVolume(n,a,c),d=this._getExtrudedVolume(r,a,c);null!=u&&null!=d&&this._visualization.updateGeometries(u,d,c)}_getExtrudedVolume(e,t,i){const{renderCoordsHelper:s,spatialReference:o}=this.view,n=L(),r=1===s.viewingMode;s.worldUpAtPosition(i,n);const{_polygonRenderInfo:l}=this;if(null==l)return null;const a=H(l,{height:e,worldUp:n,spherical:r,requireElevation:!1,requireNormals:!0,requireSizes:!1});if(null==a)return null;const c=v(),u=v();if(G(o,t,c,s.spatialReference),u[12]=-c[12],u[13]=-c[13],u[14]=-c[14],V(a.vertices,a.vertices,u),"stockpile"===this.analysis.measureType)for(let d=0;d<a.normals.length;d+=3)a.normals[d]=n[0],a.normals[d+1]=n[1],a.normals[d+2]=n[2];return new E(a.vertices,a.bottomIndices,a.indices,a.normals)}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 B(e,t,i){if(!t||!e)return null;const s=h(t.value,t.unit,i),o=u(s);return d(e,t,s,o)}e([p({constructOnly:!0})],z.prototype,"view",void 0),e([p({constructOnly:!0})],z.prototype,"analysis",void 0),e([p({constructOnly:!0})],z.prototype,"viewData",void 0),e([p()],z.prototype,"unitsMessages",void 0),e([p()],z.prototype,"messages",void 0),e([p()],z.prototype,"loadingMessages",void 0),e([p({readOnly:!0})],z.prototype,"_updatingHandles",void 0),e([p({readOnly:!0})],z.prototype,"visible",null),e([p()],z.prototype,"inView",null),e([p()],z.prototype,"updating",null),e([p()],z.prototype,"hasUnsupportedError",null),e([p()],z.prototype,"_extrusionHeights",null),e([p()],z.prototype,"_polygonRenderInfo",null),z=e([g("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementVisualization")],z);class I{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=L(),this._n2=L();const o=y(T,f(T,e.endRenderSpace,e.startRenderSpace));y(this._n1,j(this._n1,o,y(q,f(q,t.startRenderSpace,e.startRenderSpace)))),y(this._n2,j(this._n2,o,y(q,f(q,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=l.normalize(P(this._n1,this._n2,o))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){f(T,this.segment.startRenderSpace,e.eye);const t=b(this._n1,T)<0,i=b(this._n2,T)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const T=L(),q=L();export{z as VolumeMeasurementVisualization};