@arcgis/core 5.2.0-next.126 → 5.2.0-next.127

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 (220) hide show
  1. package/applications/Components/basemapToggleUtils.d.ts +53 -0
  2. package/applications/Components/basemapToggleUtils.js +2 -0
  3. package/arcgisGlobal.d.ts +1 -0
  4. package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
  5. package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/{e35eb93c0fb1f6de8db0.js → 00d9e41deecf5828975c.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{ab8a1140bf31f46f8ebf.js → 1262918b2161d79851c0.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{d3ef23923424ad8c5048.js → 1c2723f9630e7d597843.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{9ca98fffd43e63d5ade3.js → 1c33aa349beea9a3792f.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{54eeb4cac4fa092359ab.js → 2226c20c38e20713bcb5.js} +2 -2
  12. package/assets/esri/core/workers/chunks/{54eeb4cac4fa092359ab.js.LICENSE.txt → 2226c20c38e20713bcb5.js.LICENSE.txt} +2 -2
  13. package/assets/esri/core/workers/chunks/{fdbda3d2afea25142b86.js → 26995de0c18bef8db590.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{806f96ad09e882be41af.js → 2c7fc24649d91552e68a.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{4d18451e0ea6ca54101a.js → 2ebad7e588b26e74cefe.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{a8258636096416c837a2.js → 3b7dff15a0058ea29886.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{4716693eca44e8f89f5c.js → 3bf56c33876ba56c4b21.js} +1 -1
  18. package/assets/esri/core/workers/chunks/3c6ee445e49da0076ac1.js +1 -0
  19. package/assets/esri/core/workers/chunks/{5fe5ef5ccf480634d159.js → 50c29d10ec53f0e48e8a.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{56acda1eed3a013430e2.js → 58fb92775d668cfd295c.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{b013b70e40dfb6ce013e.js → 668ec0bdfb2095e90c9e.js} +1 -1
  22. package/assets/esri/core/workers/chunks/75879ae88fd87b089a87.js +1 -0
  23. package/assets/esri/core/workers/chunks/{24673aac70d6c949b6fa.js → 86d7a3ae672a51b75fcc.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{30604a29df320d7a4c6b.js → 88e11b645a1361f1bdbe.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{c692e583e87af58f6d91.js → 8b0d6205ceeec1ab446f.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{57ab87e70ef85b9405f9.js → 8cb216404a6254bc695c.js} +1 -0
  27. package/assets/esri/core/workers/chunks/{b96358d475dc98034aa4.js → a15ed056e7493ddf3b4c.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{25e212fe9a2ea37c9e81.js → a3a33ffa34f4d645ddfe.js} +1 -1
  29. package/assets/esri/core/workers/chunks/af0704494398f33aa315.js +1 -0
  30. package/assets/esri/core/workers/chunks/{ce1ccf9ec90b786591e5.js → b396c4b4bb144200acc7.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{97602019a1ccad22a03a.js → bbfb80a6983574007ce5.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{d5f72670634e73c0b53a.js → bcf2e5cf6b9c6d0442bb.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{17218d714cb07b607c2f.js → c35e9dee87937f483a3d.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{85739ed6af0f0a3cb302.js → c94bdfed831c775e04c0.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{2e3fd81653dc0d86456c.js → cfeba0ffb7fdc2a9af05.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{cb7cb7d57c4e7f76600f.js → dc92710a8fdfb9135e55.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{e1ae83ff3e0225708d4d.js → f479b4a4cee4bb2e046c.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{78abd6c42f39e6f6ffbb.js → f983296b6f4a62a911eb.js} +1 -1
  39. package/assets/esri/images/portal/gaussiansplatlayer16.png +0 -0
  40. package/assets/esri/images/portal/knowledgegraphlayer16.png +0 -0
  41. package/assets/esri/images/portal/propresentation16.png +0 -0
  42. package/assets/esri/images/portal/urbanproject16.png +0 -0
  43. package/assets/esri/images/support/loading-throb.gif +0 -0
  44. package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
  45. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-arabic.woff2 +0 -0
  46. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-cyrillic.woff2 +0 -0
  47. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-ext.woff2 +0 -0
  48. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-georgian.woff2 +0 -0
  49. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-greek.woff2 +0 -0
  50. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-hebrew.woff2 +0 -0
  51. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-math.woff2 +0 -0
  52. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-thai.woff2 +0 -0
  53. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-vietnamese.woff2 +0 -0
  54. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02.woff2 +0 -0
  55. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-arabic.woff2 +0 -0
  56. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-cyrillic.woff2 +0 -0
  57. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-ext.woff2 +0 -0
  58. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-georgian.woff2 +0 -0
  59. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-greek.woff2 +0 -0
  60. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-hebrew.woff2 +0 -0
  61. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-math.woff2 +0 -0
  62. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-thai.woff2 +0 -0
  63. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-vietnamese.woff2 +0 -0
  64. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7.woff2 +0 -0
  65. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-arabic.woff2 +0 -0
  66. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-cyrillic.woff2 +0 -0
  67. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-ext.woff2 +0 -0
  68. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-georgian.woff2 +0 -0
  69. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-greek.woff2 +0 -0
  70. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-hebrew.woff2 +0 -0
  71. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-math.woff2 +0 -0
  72. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-thai.woff2 +0 -0
  73. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-vietnamese.woff2 +0 -0
  74. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688.woff2 +0 -0
  75. package/assets/esri/themes/base/fonts/fonts/3ae1e25e-3aa6-4061-a016-a079159f9d65.woff2 +0 -0
  76. package/assets/esri/themes/base/fonts/fonts/41331c3c-3759-4462-8695-33c9a21b6a5b.woff2 +0 -0
  77. package/assets/esri/themes/base/fonts/fonts/94aa531e-7746-4df0-bb6e-349891f2eda5.woff2 +0 -0
  78. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-arabic.woff2 +0 -0
  79. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-cyrillic.woff2 +0 -0
  80. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-ext.woff2 +0 -0
  81. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-georgian.woff2 +0 -0
  82. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-greek.woff2 +0 -0
  83. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-hebrew.woff2 +0 -0
  84. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-math.woff2 +0 -0
  85. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-thai.woff2 +0 -0
  86. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-vietnamese.woff2 +0 -0
  87. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939.woff2 +0 -0
  88. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-cyrillic.woff2 +0 -0
  89. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-ext.woff2 +0 -0
  90. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-greek.woff2 +0 -0
  91. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-hebrew.woff2 +0 -0
  92. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-math.woff2 +0 -0
  93. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-vietnamese.woff2 +0 -0
  94. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d.woff2 +0 -0
  95. package/assets/esri/themes/base/fonts/fonts.scss +0 -0
  96. package/assets/esri/themes/base/icons/style.scss +0 -0
  97. package/assets/esri/themes/base/icons/variables.scss +0 -0
  98. package/assets/esri/themes/base/images/files/archive-32.svg +0 -0
  99. package/assets/esri/themes/base/images/files/cad-32.svg +0 -0
  100. package/assets/esri/themes/base/images/files/code-32.svg +0 -0
  101. package/assets/esri/themes/base/images/files/csv-32.svg +0 -0
  102. package/assets/esri/themes/base/images/files/excel-32.svg +0 -0
  103. package/assets/esri/themes/base/images/files/generic-32.svg +0 -0
  104. package/assets/esri/themes/base/images/files/gpx-32.svg +0 -0
  105. package/assets/esri/themes/base/images/files/image-32.svg +0 -0
  106. package/assets/esri/themes/base/images/files/pdf-32.svg +0 -0
  107. package/assets/esri/themes/base/images/files/report-32.svg +0 -0
  108. package/assets/esri/themes/base/images/files/sound-32.svg +0 -0
  109. package/assets/esri/themes/base/images/files/text-32.svg +0 -0
  110. package/assets/esri/themes/base/images/files/video-32.svg +0 -0
  111. package/assets/esri/themes/base/images/files/word-32.svg +0 -0
  112. package/assets/esri/themes/base/images/files/zip-32.svg +0 -0
  113. package/assets/esri/themes/base/images/loading-throb.gif +0 -0
  114. package/assets/esri/themes/base/widgets/_Bookmarks.scss +0 -0
  115. package/assets/esri/themes/base/widgets/_Tooltip.scss +37 -0
  116. package/assets/esri/themes/dark/main.css +1 -1
  117. package/assets/esri/themes/light/main.css +1 -1
  118. package/assets/esri/themes/light/view.css +1 -1
  119. package/assets/esri/views/interactive/tooltip/t9n/messages.en.json +1 -1
  120. package/chunks/GlobalIllumination.glsl.js +1 -0
  121. package/config.js +1 -1
  122. package/core/Accessor.d.ts +1 -1
  123. package/core/lang.js +1 -1
  124. package/kernel.js +1 -1
  125. package/layers/ParquetLayer.d.ts +21 -13
  126. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  127. package/layers/graphics/dehydratedFeatures.js +1 -1
  128. package/package.json +3 -3
  129. package/popup/FeatureContentCollection.d.ts +15 -25
  130. package/popup/FeatureContentCollection.js +1 -1
  131. package/support/revision.js +1 -1
  132. package/symbols/cim/callouts/calloutAnalysisUtils.js +2 -0
  133. package/symbols/cim/callouts/effects/BackgroundCallout.js +1 -1
  134. package/symbols/cim/callouts/effects/BalloonCallout.js +1 -1
  135. package/symbols/cim/callouts/effects/PointSymbolCallout.js +1 -1
  136. package/symbols/cim/callouts/effects/SimpleLineCallout.js +1 -1
  137. package/symbols/cim/callouts/effects/calloutUtils.js +1 -1
  138. package/symbols/cim/cimAnalyzer.js +1 -1
  139. package/views/2d/engine/webgl/ClipMesh.js +1 -1
  140. package/views/2d/engine/webgl/mesh/factories/CalloutMeshWriterCoordinator.js +1 -1
  141. package/views/2d/engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js +1 -1
  142. package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
  143. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  144. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  145. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  146. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
  147. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
  148. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
  149. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js +1 -1
  150. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
  151. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  152. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
  153. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  154. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js +1 -1
  155. package/views/2d/engine/webgl/shaderGraph/techniques/markers/ComputedMarkerParams.js +1 -1
  156. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  157. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/CalloutMeshWriterPolicy.js +1 -1
  158. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  159. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js +1 -1
  160. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  161. package/views/2d/engine/webgl/util/AnnotationMatcher.js +1 -1
  162. package/views/2d/engine/webgl/util/Matcher.js +1 -1
  163. package/views/2d/layers/LayerView2D.js +1 -1
  164. package/views/2d/layers/support/annodime/MatcherGeometryOverride.js +1 -1
  165. package/views/2d/layers/support/annodime/PrivateMatcherGeometryOverrideEffect.js +1 -1
  166. package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
  167. package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
  168. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  169. package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
  170. package/views/3d/analysis/LineOfSight/LineOfSightRootPlugin.js +1 -1
  171. package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
  172. package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
  173. package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +5 -3
  174. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  175. package/views/3d/analysis/Viewshed/ViewshedPlacementRootPlugin.js +1 -1
  176. package/views/3d/interactive/editingTools/manipulatedObjectUtils.js +1 -1
  177. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  178. package/views/3d/interactive/editingTools/tooltipUtils3D.js +1 -1
  179. package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
  180. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  181. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  182. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  183. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  184. package/views/3d/layers/support/FeatureMemory.js +2 -0
  185. package/views/3d/layers/support/FeatureTile.js +1 -1
  186. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  187. package/views/3d/layers/support/featureReference.js +1 -1
  188. package/views/3d/navigation/modes/GroundNavigationMode3D.js +1 -1
  189. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  190. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  191. package/views/3d/support/popupHitTest.js +1 -1
  192. package/views/3d/terrain/TerrainSurface.js +1 -1
  193. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  194. package/views/DOMContainer.d.ts +2 -2
  195. package/views/DOMContainer.js +1 -1
  196. package/views/PopupView.d.ts +1 -1
  197. package/views/interactive/tooltip/components/ElevationModeSelect.js +2 -0
  198. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  199. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  200. package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
  201. package/views/interactive/tooltip/infos/SketchTooltipInfo.js +1 -1
  202. package/views/support/hitTestSelectUtils.js +1 -1
  203. package/widgets/BasemapToggle/BasemapToggleViewModel.d.ts +1 -0
  204. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  205. package/widgets/BasemapToggle.js +1 -1
  206. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +9 -1
  207. package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +1 -0
  208. package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
  209. package/widgets/DirectionalPad.js +1 -1
  210. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  211. package/widgets/Editor/legacy/UpdateFeatureWorkflow.js +1 -1
  212. package/widgets/Editor/workflowUtils.js +1 -1
  213. package/widgets/Popup/types.d.ts +0 -7
  214. package/widgets/Popup.d.ts +7 -7
  215. package/widgets/TimeSlider/TimeSliderViewModel.d.ts +2 -0
  216. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  217. package/widgets/TimeSlider.js +1 -1
  218. package/assets/esri/core/workers/chunks/6c3535aa7250c08b9e5b.js +0 -1
  219. package/assets/esri/core/workers/chunks/dc52e036547612949d32.js +0 -1
  220. package/views/2d/engine/webgl/mesh/bufcut.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{CIMSymbolUnits as i}from"../../../../../../../symbols/cim/types.js";import{spritePadding as r,gradientTextureExternalPadding as s}from"../../../definitions.js";import{packBitset as o}from"../fill/meshWriterUtils.js";import{bitset as n}from"./gradientStrokeConstants.js";import{LineMeshWriter as a,LineVertexSpec as c}from"./LineMeshWriter.js";import{DataType as p}from"../../../../../../webgl/enums.js";const m={createComputedParams:t=>t,optionalAttributes:c.optionalAttributes,attributes:{...c.attributes,bitset:{type:p.UNSIGNED_BYTE,count:1,pack:({gradientMethod:t,gradientSizeUnits:e,gradientType:r})=>o([[n.isAlongLine,"alongline"===t.toLowerCase()],[n.isAbsoluteSize,e===i.Absolute],[n.isDiscrete,"discrete"===r.toLowerCase()]])},tlbr:{type:p.UNSIGNED_SHORT,count:4,pack:({sprite:t})=>{const{rect:e,width:i,height:o}=t,n=e.x+r+s,a=e.y+r;return[n,a,n+i-2*s,a+o]}},accumulatedDistance:{type:p.HALF_FLOAT,count:1,packTessellation:({distance:t,pathLength:e,distanceOffset:i})=>(i+t)/e},gradientSize:{type:p.HALF_FLOAT,count:1,pack:({gradientSize:e,gradientSizeUnits:r})=>r===i.Relative?e/100:t(e)},totalLength:{type:p.HALF_FLOAT,count:1,packTessellation:({pathLength:t})=>t},segmentDirection:{type:p.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:t,directionY:e})=>[t,e]}}};class l extends a{get _preventEffectClipping(){return!0}constructor(t,e,i,r){super(t,e,i,r),this.vertexSpec=m,this._tessellationOptions.textured=!0}_write(t,{target:i,effectGeometry:r}){const s=r??e.fromFeatureSetReaderCIM(i);if(!s)return;const{sprite:o}=this.evaluatedMeshParams;this._writeGeometry(t,i,s,o?.textureBinding)}}export{l as GradientStrokeMeshWriter,m as GradientStrokeVertexSpec};
2
+ import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{CIMSymbolUnits as i}from"../../../../../../../symbols/cim/types.js";import{spritePadding as r,gradientTextureExternalPadding as s}from"../../../definitions.js";import{packBitset as o}from"../fill/meshWriterUtils.js";import{bitset as n}from"./gradientStrokeConstants.js";import{LineMeshWriter as a,LineVertexSpec as c}from"./LineMeshWriter.js";import{DataType as p}from"../../../../../../webgl/enums.js";const m={createComputedParams:t=>t,optionalAttributes:c.optionalAttributes,attributes:{...c.attributes,bitset:{type:p.UNSIGNED_BYTE,count:1,pack:({gradientMethod:t,gradientSizeUnits:e,gradientType:r})=>o([[n.isAlongLine,"alongline"===t.toLowerCase()],[n.isAbsoluteSize,e===i.Absolute],[n.isDiscrete,"discrete"===r.toLowerCase()]])},tlbr:{type:p.UNSIGNED_SHORT,count:4,pack:({sprite:t})=>{const{rect:e,width:i,height:o}=t,n=e.x+r+s,a=e.y+r;return[n,a,n+i-2*s,a+o]}},accumulatedDistance:{type:p.HALF_FLOAT,count:1,packTessellation:({distance:t,pathLength:e,distanceOffset:i})=>(i+t)/e},gradientSize:{type:p.HALF_FLOAT,count:1,pack:({gradientSize:e,gradientSizeUnits:r})=>r===i.Relative?e/100:t(e)},totalLength:{type:p.HALF_FLOAT,count:1,packTessellation:({pathLength:t})=>t},segmentDirection:{type:p.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:t,directionY:e})=>[t,e]}}};class l extends a{get _preventEffectClipping(){return!0}constructor(t,e,i,r){super(t,e,i,r),this.vertexSpec=m,this._tessellationOptions.textured=!0}_write(t,{target:i,effect:r}){const s=r?.geometry??e.fromFeatureSetReaderCIM(i);if(!s)return;const{sprite:o}=this.evaluatedMeshParams;this._writeGeometry(t,i,s,o?.textureBinding)}}export{l as GradientStrokeMeshWriter,m as GradientStrokeVertexSpec};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{thinLineHalfWidthThreshold as s}from"../../../definitions.js";import{LineTessellation as i}from"../../../TurboLine.js";import{clipLinesMarshall as r}from"../../../mesh/templates/templateUtils.js";import{processLineCapInput as n,processLineJoinInput as o,packRounded as a,processColorInput as h,getMinMaxZoom as c}from"../fill/meshWriterUtils.js";import{MeshWriter as l}from"../mesh/MeshWriter.js";import{getLineClippingMargin as u}from"../mesh/utils.js";import{DataType as m}from"../../../../../../webgl/enums.js";class f{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0,this.pathLength=0,this.distanceOffset=0,this.lineLength=0}}const d={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:m.HALF_FLOAT,count:2,pack:({scaleInfo:t},{tileInfo:e})=>c(t,e)}},attributes:{id:{type:m.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:m.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:m.UNSIGNED_BYTE,count:1},color:{type:m.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>h(t)},offset:{type:m.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[a(t,16),a(e,16)]},normal:{type:m.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:t,normalY:e})=>[a(t,16),a(e,16)]},halfWidth:{type:m.HALF_FLOAT,count:1,pack:({width:e})=>t(.5*e)},referenceHalfWidth:{type:m.HALF_FLOAT,count:1,pack:({referenceWidth:e})=>t(.5*e)}}};class p{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0,this.pathLength=0,this.distanceOffset=0}}const _=65535;function x(t,e,i=0){const r=e&&t<s?0:Math.max(1,2*t+1);return Math.max(r,i)}class T extends l{getCalloutCollisionPadding(){return t(.5*this.evaluatedMeshParams.width)}get _effectRotation(){const{effectRotation:t,effectRotationType:e,useEffectOrigin:s,viewRotation:i}=this.evaluatedMeshParams;return null==t&&null==i?null:{value:t,type:e,useEffectOrigin:!!s,viewRotation:i}}constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=d,this._currentWrite=new p,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:_,textured:!1},this._tessParams=new f,this._initializeTessellator()}writeLineVertices(t,e,s){const i=this._getLines(e);null!=i&&this._writeVertices(t,s,i)}_initializeTessellator(){this._lineTessellator=new i(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(t,{target:s,effectGeometry:i}){const r=i??e.fromFeatureSetReaderCIM(s);r&&this._writeGeometry(t,s,r)}_writeGeometry(t,e,s,i){t.recordStart(this.instanceId,this.attributeLayout,i),this.writeLineVertices(t,s,e),t.recordEnd()}_getLines(t){return r(t,u(this.evaluatedMeshParams))}_writeVertices(e,s,i){const{_currentWrite:r,_tessellationOptions:a,evaluatedMeshParams:h}=this,{width:c,capType:l,joinType:u,miterLimit:m,hasSizeVV:f}=h,d=t(.5*c);a.halfWidth=d,a.capType=n(l),a.joinType=o(u),a.miterLimit=m;const p=!f;r.out=e,r.id=s.getDisplayId(),r.vertexCount=0,r.indexCount=0,r.vertexFrom=e.vertexCount(),r.vertexBounds=x(d,p,h.minPixelBuffer);for(const{line:t,start:n,pathLength:o}of i)a.initialDistance=n%_,r.pathLength=o,r.distanceOffset=Math.floor(n/_)*_,this._lineTessellator.tessellate(t,a,p)}_writeTesselatedVertex(t,e,s,i,r,n,o,a,h,c,l){const{out:u,id:m,vertexBounds:f,pathLength:d,distanceOffset:p}=this._currentWrite;return this.hasEffects&&u.recordBounds(t,e,f,f),this._tessParams.extrusionOffsetX=o,this._tessParams.extrusionOffsetY=a,this._tessParams.normalX=h,this._tessParams.normalY=c,this._tessParams.directionX=r,this._tessParams.directionY=n,this._tessParams.distance=l,this._tessParams.pathLength=d,this._tessParams.distanceOffset=p,this._writeVertex(u,m,t,e,this._tessParams),this._currentWrite.vertexFrom+this._currentWrite.vertexCount++}_writeTriangle(t,e,s){const{out:i}=this._currentWrite;i.indexEnsureSize(3),i.indexWrite(t),i.indexWrite(e),i.indexWrite(s),this._currentWrite.indexCount+=3}}export{T as LineMeshWriter,f as LineTessellationParams,d as LineVertexSpec,x as getLinePixelBufferSize};
2
+ import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{thinLineHalfWidthThreshold as s}from"../../../definitions.js";import{LineTessellation as i}from"../../../TurboLine.js";import{clipLinesMarshall as r}from"../../../mesh/templates/templateUtils.js";import{processLineCapInput as n,processLineJoinInput as o,packRounded as a,processColorInput as h,getMinMaxZoom as c}from"../fill/meshWriterUtils.js";import{MeshWriter as l}from"../mesh/MeshWriter.js";import{getLineClippingMargin as u}from"../mesh/utils.js";import{DataType as m}from"../../../../../../webgl/enums.js";class f{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0,this.pathLength=0,this.distanceOffset=0,this.lineLength=0}}const d={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:m.HALF_FLOAT,count:2,pack:({scaleInfo:t},{tileInfo:e})=>c(t,e)}},attributes:{id:{type:m.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:m.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:m.UNSIGNED_BYTE,count:1},color:{type:m.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>h(t)},offset:{type:m.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[a(t,16),a(e,16)]},normal:{type:m.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:t,normalY:e})=>[a(t,16),a(e,16)]},halfWidth:{type:m.HALF_FLOAT,count:1,pack:({width:e})=>t(.5*e)},referenceHalfWidth:{type:m.HALF_FLOAT,count:1,pack:({referenceWidth:e})=>t(.5*e)}}};class p{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0,this.pathLength=0,this.distanceOffset=0}}const _=65535;function x(t,e,i=0){const r=e&&t<s?0:Math.max(1,2*t+1);return Math.max(r,i)}class T extends l{getCalloutCollisionPadding(){return t(.5*this.evaluatedMeshParams.width)}getRenderedLineWidth(){return t(this.evaluatedMeshParams.width)}get _effectRotation(){const{effectRotation:t,effectRotationType:e,useEffectOrigin:s,viewRotation:i}=this.evaluatedMeshParams;return null==t&&null==i?null:{value:t,type:e,useEffectOrigin:!!s,viewRotation:i}}constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=d,this._currentWrite=new p,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:_,textured:!1},this._tessParams=new f,this._initializeTessellator()}writeLineVertices(t,e,s,i){const r=this._getLines(e,i);null!=r&&this._writeVertices(t,s,r)}_initializeTessellator(){this._lineTessellator=new i(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(t,{target:s,effect:i}){const r=i?.geometry??e.fromFeatureSetReaderCIM(s);r&&this._writeGeometry(t,s,r)}_writeGeometry(t,e,s,i){t.recordStart(this.instanceId,this.attributeLayout,i),this.writeLineVertices(t,s,e),t.recordEnd()}_getLines(t,e){return r(t,e??u(this.evaluatedMeshParams))}_writeVertices(e,s,i){const{_currentWrite:r,_tessellationOptions:a,evaluatedMeshParams:h}=this,{width:c,capType:l,joinType:u,miterLimit:m,hasSizeVV:f}=h,d=t(.5*c);a.halfWidth=d,a.capType=n(l),a.joinType=o(u),a.miterLimit=m;const p=!f;r.out=e,r.id=s.getDisplayId(),r.vertexCount=0,r.indexCount=0,r.vertexFrom=e.vertexCount(),r.vertexBounds=x(d,p,h.minPixelBuffer);for(const{line:t,start:n,pathLength:o}of i)a.initialDistance=n%_,r.pathLength=o,r.distanceOffset=Math.floor(n/_)*_,this._lineTessellator.tessellate(t,a,p)}_writeTesselatedVertex(t,e,s,i,r,n,o,a,h,c,l){const{out:u,id:m,vertexBounds:f,pathLength:d,distanceOffset:p}=this._currentWrite;return this.hasEffects&&u.recordBounds(t,e,f,f),this._tessParams.extrusionOffsetX=o,this._tessParams.extrusionOffsetY=a,this._tessParams.normalX=h,this._tessParams.normalY=c,this._tessParams.directionX=r,this._tessParams.directionY=n,this._tessParams.distance=l,this._tessParams.pathLength=d,this._tessParams.distanceOffset=p,this._writeVertex(u,m,t,e,this._tessParams),this._currentWrite.vertexFrom+this._currentWrite.vertexCount++}_writeTriangle(t,e,s){const{out:i}=this._currentWrite;i.indexEnsureSize(3),i.indexWrite(t),i.indexWrite(e),i.indexWrite(s),this._currentWrite.indexCount+=3}}export{T as LineMeshWriter,f as LineTessellationParams,d as LineVertexSpec,x as getLinePixelBufferSize};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{spritePadding as r}from"../../../definitions.js";import{packBitset as s}from"../fill/meshWriterUtils.js";import{LineMeshWriter as o,LineVertexSpec as i}from"./LineMeshWriter.js";import{bitsetGenericConsiderAlphaOnly as a,bitsetLineScaleDash as c,bitsetLineIsSdf as n}from"../shaders/constants.js";import{DataType as p}from"../../../../../../webgl/enums.js";const u={createComputedParams:t=>t,optionalAttributes:i.optionalAttributes,attributes:{...i.attributes,bitset:{type:p.UNSIGNED_BYTE,count:1,pack:({shouldSampleAlphaOnly:t,shouldScaleDash:e,isSDF:r})=>s([[a,t],[c,e],[n,r]])},tlbr:{type:p.UNSIGNED_SHORT,count:4,pack:({sprite:t})=>{const{rect:e,width:s,height:o}=t,i=e.x+r,a=e.y+r;return[i,a,i+s,a+o]}},accumulatedDistance:{type:p.UNSIGNED_SHORT,count:1,packTessellation:({distance:t})=>t},segmentDirection:{type:p.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:t,directionY:e})=>[t,e]},offsetAlongLine:{type:p.HALF_FLOAT,count:1,pack:({offsetAlongLine:e})=>t(e)},capType:{type:p.UNSIGNED_BYTE,count:1,pack:({capType:t})=>{switch(t){case"Butt":case"butt":default:return 0;case"Square":case"square":return 1;case"Round":case"round":return 2}}}}};class m extends o{constructor(t,e,r,s){super(t,e,r,s),this.vertexSpec=u,this._tessellationOptions.textured=!0}_write(t,{target:r,effectGeometry:s}){const o=s??e.fromFeatureSetReaderCIM(r);if(!o)return;const{sprite:i}=this.evaluatedMeshParams;this._writeGeometry(t,r,o,i?.textureBinding)}}export{m as TexturedLineMeshWriter,u as texturedLineVertexSpec};
2
+ import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{spritePadding as r}from"../../../definitions.js";import{packBitset as s}from"../fill/meshWriterUtils.js";import{LineMeshWriter as o,LineVertexSpec as i}from"./LineMeshWriter.js";import{bitsetGenericConsiderAlphaOnly as a,bitsetLineScaleDash as c,bitsetLineIsSdf as n}from"../shaders/constants.js";import{DataType as p}from"../../../../../../webgl/enums.js";const u={createComputedParams:t=>t,optionalAttributes:i.optionalAttributes,attributes:{...i.attributes,bitset:{type:p.UNSIGNED_BYTE,count:1,pack:({shouldSampleAlphaOnly:t,shouldScaleDash:e,isSDF:r})=>s([[a,t],[c,e],[n,r]])},tlbr:{type:p.UNSIGNED_SHORT,count:4,pack:({sprite:t})=>{const{rect:e,width:s,height:o}=t,i=e.x+r,a=e.y+r;return[i,a,i+s,a+o]}},accumulatedDistance:{type:p.UNSIGNED_SHORT,count:1,packTessellation:({distance:t})=>t},segmentDirection:{type:p.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:t,directionY:e})=>[t,e]},offsetAlongLine:{type:p.HALF_FLOAT,count:1,pack:({offsetAlongLine:e})=>t(e)},capType:{type:p.UNSIGNED_BYTE,count:1,pack:({capType:t})=>{switch(t){case"Butt":case"butt":default:return 0;case"Square":case"square":return 1;case"Round":case"round":return 2}}}}};class m extends o{constructor(t,e,r,s){super(t,e,r,s),this.vertexSpec=u,this._tessellationOptions.textured=!0}_write(t,{target:r,effect:s}){const o=s?.geometry??e.fromFeatureSetReaderCIM(r);if(!o)return;const{sprite:i}=this.evaluatedMeshParams;this._writeGeometry(t,r,o,i?.textureBinding)}}export{m as TexturedLineMeshWriter,u as texturedLineVertexSpec};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{applyParentTransform as e}from"../../../../../../../symbols/cim/utils.js";import{spritePadding as i}from"../../../definitions.js";class s{static from(t){return"width"in t?this.fromSimpleMeshParams(t):this.fromComplexMeshParams(t)}static fromSimpleMeshParams(e){const i=new s(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects),{type:h,width:o,height:a,angle:r,alignment:n,outlineSize:c,referenceSize:m,sprite:d,overrideOutlineColor:l}=e;return i.rawWidth=t(o),i.rawHeight=t(a),i.angle=r,i.alignment=n,i.outlineSize=t(c),i.referenceSize=t(m),i.overrideOutlineColor=l,i.offsetX=t(e.offsetX),i.offsetY=t(e.offsetY),"simple"!==h||d.sdf||(i.rawWidth=d.width,i.rawHeight=d.height),i._initializeSizeComputation(!1,e.hasSizeVV),i._captureBaseSizeState(),i._computeSize(),i._captureBaseComputedSize(),i}static fromComplexMeshParams(i){const h=new s(i.sprite,i.color,i.outlineColor,i.minPixelBuffer,i.placement,i.scaleInfo,i.effects);let{alignment:o,transforms:a,size:r,scaleX:n,anchorX:c,anchorY:m,angle:d,colorLocked:l,frameHeight:f,widthRatio:u,offsetX:p,offsetY:g,outlineSize:_,referenceSize:S,scaleFactor:z,sizeRatio:b,isAbsoluteAnchorPoint:C,rotateClockwise:w,scaleSymbolsProportionally:x,sprite:H}=i;if(a&&a.infos.length>0){const t=e(r,d,w,p,g,a);r=t.size,d=t.rotation,p=t.offsetX,g=t.offsetY,w=!1}z&&(r*=z,p*=z,g*=z);const W=n*(H.width/H.height);h.alignment=o,h.rawHeight=t(r),h.rawWidth=h.rawHeight*W,h.referenceSize=t(S),h.sizeRatio=b,h.sdfDecodeCoeff=(H.sdfDecodeCoeff??1)*b,h.angle=d,h.rotateClockwise=w,h.anchorX=c,h.anchorY=m,h.offsetX=t(p),h.offsetY=t(g),C&&r&&(H.sdf?h.anchorX=c/(r*u):h.anchorX=c/(r*W),h.anchorY=m/r);const X=x&&f?r/f:1;return h.outlineSize=0===_||isNaN(_)?0:t(_)*X,h.scaleSymbolsProportionally=x,h.colorLocked=l,h._initializeSizeComputation(!0,i.hasSizeVV),h._captureBaseSizeState(),h._computeSize(),h._captureBaseComputedSize(),h}constructor(t,e,i,s,h,o,a){this.sprite=t,this.color=e,this.outlineColor=i,this.minPixelBuffer=s,this.placement=h,this.scaleInfo=o,this.effects=a,this.rawWidth=0,this.rawHeight=0,this.angle=0,this.outlineSize=0,this.referenceSize=0,this.sizeRatio=1,this.sdfDecodeCoeff=1,this.alignment=0,this.scaleSymbolsProportionally=!1,this.overrideOutlineColor=!1,this.colorLocked=!1,this.anchorX=0,this.anchorY=0,this.computedWidth=0,this.computedHeight=0,this.texXmin=0,this.texYmin=0,this.texXmax=0,this.texYmax=0,this.offsetX=0,this.offsetY=0,this.rotateClockwise=!0,this._baseRawWidth=0,this._baseRawHeight=0,this._baseComputedWidth=0,this._baseComputedHeight=0,this._baseAnchorX=0,this._baseAnchorY=0,this._isCIM=!1,this._hasSizeVV=!1}applyPointSymbolCalloutBackgroundScale(t,e,i){if(!Number.isFinite(e)||!Number.isFinite(i)||e<=0||i<=0||this._baseComputedWidth<=0||this._baseComputedHeight<=0)return void this.resetSizeOverride();let s=this._baseComputedWidth,h=this._baseComputedHeight;switch(t){case 1:{const t=Math.max(e/this._baseComputedWidth,i/this._baseComputedHeight);s*=t,h*=t;break}case 2:case 4:s=e,h=i;break;case 3:{const t=Math.max(e-this._baseComputedWidth,i-this._baseComputedHeight);s+=t,h+=t;break}}this._applyComputedSizeTarget(s,h)}getPointSymbolCalloutBounds(t){const e=this.computedWidth,i=this.computedHeight,s=(t.xmin+t.xmax)/2+this.offsetX-this.anchorX*e,h=(t.ymin+t.ymax)/2+this.offsetY-this.anchorY*i;return{xmin:s-e/2,ymin:h-i/2,xmax:s+e/2,ymax:h+i/2}}resetSizeOverride(){this._restoreBaseSize(),this._computeSize()}get boundsInfo(){return{size:Math.max(this.computedHeight,this.computedWidth),offsetX:this.offsetX,offsetY:this.offsetY}}_initializeSizeComputation(t,e){this._isCIM=t,this._hasSizeVV=e}_captureBaseSizeState(){this._baseRawWidth=this.rawWidth,this._baseRawHeight=this.rawHeight,this._baseAnchorX=this.anchorX,this._baseAnchorY=this.anchorY}_captureBaseComputedSize(){this._baseComputedWidth=this.computedWidth,this._baseComputedHeight=this.computedHeight}_restoreBaseSize(){this.rawWidth=this._baseRawWidth,this.rawHeight=this._baseRawHeight,this.anchorX=this._baseAnchorX,this.anchorY=this._baseAnchorY}_applyComputedSizeTarget(t,e){const i=this._baseComputedWidth,s=this._baseComputedHeight;!Number.isFinite(t)||!Number.isFinite(e)||t<=0||e<=0||i<=0||s<=0?this.resetSizeOverride():(this._restoreBaseSize(),this.rawWidth*=t/i,this.rawHeight*=e/s,this._computeSize())}_computeSize(){const{sprite:t}=this,e=this._hasSizeVV,s=this._isCIM,a=!!t.sdf,r=t.sdfPaddingRatio??.5,{rawWidth:n,rawHeight:c,sizeRatio:m,outlineSize:d}=this,l=t.rect;let f=n*m,u=c*m,p=0,g=0;if(a){const i=1/(1-r);if(f*=i,u*=i,e)this.computedWidth=f,this.computedHeight=u;else{const e=s&&n>c?f:n,i=c,h=d+2*1;this.computedWidth=Math.min(e+h,f),this.computedHeight=Math.min(i+h,u);const o=Math.max(t.width,t.height)/Math.max(f,u);p=(this.computedWidth-f)*o,g=(this.computedHeight-u)*o}}else this.computedWidth=f*(l.width/t.width),this.computedHeight=u*(l.height/t.height),p=2*i,g=2*i;const _=l.x+i-p/2,S=l.y+i-g/2,z=_+t.width+p,b=S+t.height+g;this.texXmin=h(_),this.texYmin=h(S),this.texXmax=o(z),this.texYmax=o(b),this.computedWidth*=(this.texXmax-this.texXmin)/(z-_),this.computedHeight*=(this.texYmax-this.texYmin)/(b-S),this.anchorX*=f/this.computedWidth,this.anchorY*=u/this.computedHeight}}function h(t,e=1e-7){const i=Math.ceil(t);return i-t<e?i:Math.floor(t)}function o(t,e=1e-7){const i=Math.floor(t);return t-i<e?i:Math.ceil(t)}export{s as ComputedMarkerParams};
2
+ import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{applyParentTransform as e}from"../../../../../../../symbols/cim/utils.js";import{spritePadding as i}from"../../../definitions.js";class s{static from(t){return"width"in t?this.fromSimpleMeshParams(t):this.fromComplexMeshParams(t)}static fromSimpleMeshParams(e){const i=new s(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects),{type:h,width:o,height:a,angle:r,alignment:n,outlineSize:c,referenceSize:m,sprite:d,overrideOutlineColor:l}=e;return i.rawWidth=t(o),i.rawHeight=t(a),i.angle=r,i.alignment=n,i.outlineSize=t(c),i.referenceSize=t(m),i.overrideOutlineColor=l,i.offsetX=t(e.offsetX),i.offsetY=t(e.offsetY),"simple"!==h||d.sdf||(i.rawWidth=d.width,i.rawHeight=d.height),i._initializeSizeComputation(!1,e.hasSizeVV),i._captureBaseSizeState(),i._computeSize(),i._captureBaseComputedSize(),i}static fromComplexMeshParams(i){const h=new s(i.sprite,i.color,i.outlineColor,i.minPixelBuffer,i.placement,i.scaleInfo,i.effects);let{alignment:o,transforms:a,size:r,scaleX:n,anchorX:c,anchorY:m,angle:d,colorLocked:l,frameHeight:f,widthRatio:u,offsetX:p,offsetY:g,outlineSize:_,referenceSize:S,scaleFactor:z,sizeRatio:b,isAbsoluteAnchorPoint:C,rotateClockwise:w,scaleSymbolsProportionally:x,sprite:H}=i;if(a&&a.infos.length>0){const t=e(r,d,w,p,g,a);r=t.size,d=t.rotation,p=t.offsetX,g=t.offsetY,w=!1}z&&(r*=z,p*=z,g*=z);const X=n*(H.width/H.height);h.alignment=o,h.rawHeight=t(r),h.rawWidth=h.rawHeight*X,h.referenceSize=t(S),h.sizeRatio=b,h.sdfDecodeCoeff=(H.sdfDecodeCoeff??1)*b,h.angle=d,h.rotateClockwise=w,h.anchorX=c,h.anchorY=m,h.offsetX=t(p),h.offsetY=t(g),C&&r&&(H.sdf?h.anchorX=c/(r*u):h.anchorX=c/(r*X),h.anchorY=m/r);const W=x&&f?r/f:1;return h.outlineSize=0===_||isNaN(_)?0:t(_)*W,h.scaleSymbolsProportionally=x,h.colorLocked=l,h._initializeSizeComputation(!0,i.hasSizeVV),h._captureBaseSizeState(),h._computeSize(),h._captureBaseComputedSize(),h}constructor(t,e,i,s,h,o,a){this.sprite=t,this.color=e,this.outlineColor=i,this.minPixelBuffer=s,this.placement=h,this.scaleInfo=o,this.effects=a,this.rawWidth=0,this.rawHeight=0,this.angle=0,this.outlineSize=0,this.referenceSize=0,this.sizeRatio=1,this.sdfDecodeCoeff=1,this.alignment=0,this.scaleSymbolsProportionally=!1,this.overrideOutlineColor=!1,this.colorLocked=!1,this.anchorX=0,this.anchorY=0,this.computedWidth=0,this.computedHeight=0,this.texXmin=0,this.texYmin=0,this.texXmax=0,this.texYmax=0,this.offsetX=0,this.offsetY=0,this.rotateClockwise=!0,this._baseRawWidth=0,this._baseRawHeight=0,this._baseComputedWidth=0,this._baseComputedHeight=0,this._baseAnchorX=0,this._baseAnchorY=0,this._isCIM=!1,this._hasSizeVV=!1}applyPointSymbolCalloutBackgroundScale(t,e,i,s=0,h=1,o=1,a=!1){if(e+=2*s,i+=2*s,a&&(e+=s,i+=s),!Number.isFinite(e)||!Number.isFinite(i)||e<=0||i<=0||h<=0||o<=0||this._baseComputedWidth<=0||this._baseComputedHeight<=0)return void this.resetSizeOverride();let r=this._baseComputedWidth,n=this._baseComputedHeight;switch(t){case 1:{const t=e/(this._baseComputedWidth*h),s=i/(this._baseComputedHeight*o),c=a?Math.sqrt(t*t+s*s):Math.max(t,s);r*=c,n*=c;break}case 2:case 4:r=e,n=i;break;case 3:{const t=Math.max(e-this._baseComputedWidth,i-this._baseComputedHeight);r+=t,n+=t;break}}this._applyComputedSizeTarget(r,n),0!==t&&(this.anchorX=0,this.anchorY=0)}getPointSymbolCalloutBounds(t){const e=this.computedWidth,i=this.computedHeight,s=(t.xmin+t.xmax)/2+this.offsetX-this.anchorX*e,h=(t.ymin+t.ymax)/2+this.offsetY-this.anchorY*i;return{xmin:s-e/2,ymin:h-i/2,xmax:s+e/2,ymax:h+i/2}}resetSizeOverride(){this._restoreBaseSize(),this._computeSize()}get boundsInfo(){return{size:Math.max(this.computedHeight,this.computedWidth),offsetX:this.offsetX,offsetY:this.offsetY}}_initializeSizeComputation(t,e){this._isCIM=t,this._hasSizeVV=e}_captureBaseSizeState(){this._baseRawWidth=this.rawWidth,this._baseRawHeight=this.rawHeight,this._baseAnchorX=this.anchorX,this._baseAnchorY=this.anchorY}_captureBaseComputedSize(){this._baseComputedWidth=this.computedWidth,this._baseComputedHeight=this.computedHeight}_restoreBaseSize(){this.rawWidth=this._baseRawWidth,this.rawHeight=this._baseRawHeight,this.anchorX=this._baseAnchorX,this.anchorY=this._baseAnchorY}_applyComputedSizeTarget(t,e){const i=this._baseComputedWidth,s=this._baseComputedHeight;!Number.isFinite(t)||!Number.isFinite(e)||t<=0||e<=0||i<=0||s<=0?this.resetSizeOverride():(this._restoreBaseSize(),this.rawWidth*=t/i,this.rawHeight*=e/s,this._computeSize())}_computeSize(){const{sprite:t}=this,e=this._hasSizeVV,s=this._isCIM,a=!!t.sdf,r=t.sdfPaddingRatio??.5,{rawWidth:n,rawHeight:c,sizeRatio:m,outlineSize:d}=this,l=t.rect;let f=n*m,u=c*m,p=0,g=0;if(a){const i=1/(1-r);if(f*=i,u*=i,e)this.computedWidth=f,this.computedHeight=u;else{const e=s&&n>c?f:n,i=c,h=d+2*1;this.computedWidth=Math.min(e+h,f),this.computedHeight=Math.min(i+h,u);const o=Math.max(t.width,t.height)/Math.max(f,u);p=(this.computedWidth-f)*o,g=(this.computedHeight-u)*o}}else this.computedWidth=f*(l.width/t.width),this.computedHeight=u*(l.height/t.height),p=2*i,g=2*i;const _=l.x+i-p/2,S=l.y+i-g/2,z=_+t.width+p,b=S+t.height+g;this.texXmin=h(_),this.texYmin=h(S),this.texXmax=o(z),this.texYmax=o(b),this.computedWidth*=(this.texXmax-this.texXmin)/(z-_),this.computedHeight*=(this.texYmax-this.texYmin)/(b-S),this.anchorX*=f/this.computedWidth,this.anchorY*=u/this.computedHeight}}function h(t,e=1e-7){const i=Math.ceil(t);return i-t<e?i:Math.floor(t)}function o(t,e=1e-7){const i=Math.floor(t);return t-i<e?i:Math.ceil(t)}export{s as ComputedMarkerParams};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{identity as t,translate as o,rotate as r}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as a}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as s}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{GeometryCursor as i}from"../../../../../../../geometry/GeometryCursor.js";import{clipCursorToTileExtent as n}from"../../../../../../../symbols/cim/CIMEffects.js";import{maxTileCoordValue as l}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as c}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{packByteSqrt as u,processColorInput as m,getMinMaxZoom as d,getBitMask as f}from"../fill/meshWriterUtils.js";import{ComputedMarkerParams as h}from"./ComputedMarkerParams.js";import{MarkerConstants as p}from"./markerConstants.js";import{MeshWriter as y}from"../mesh/MeshWriter.js";import{DataType as P}from"../../../../../../webgl/enums.js";const g=3.14159265359/180,x=128/Math.PI;function M(e,t){return e%=t,Math.abs(e>=0?e:e+t)}function b(e){return M(e*x,256)}function k(e,s,i,n,l=!1){const c=a(),u=l?1:-1;return t(c),(s||i)&&o(c,c,[s,-i]),n&&r(c,c,u*g*-n),c}const C={createComputedParams:e=>h.from(e),optionalAttributes:{zoomRange:{type:P.HALF_FLOAT,count:2,pack:({scaleInfo:e},{tileInfo:t})=>d(e,t)}},attributes:{pos:{type:P.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:P.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:P.UNSIGNED_BYTE,count:1,pack:({sprite:e,alignment:t,scaleSymbolsProportionally:o,overrideOutlineColor:r,colorLocked:a})=>{let s=0;return e.sdf&&(s|=f(p.bitset.isSDF)),1===t&&(s|=f(p.bitset.isMapAligned)),o&&(s|=f(p.bitset.scaleSymbolsProportionally)),r&&(s|=f(p.bitset.overrideOutlineColor)),a&&(s|=f(p.bitset.colorLocked)),s}},offset:{type:P.HALF_FLOAT,count:2,packAlternating:{count:4,pack:({angle:e,computedWidth:t,computedHeight:o,anchorX:r,anchorY:a,offsetX:i,offsetY:n,rotateClockwise:l})=>{const c=k(0,i,n,-e,l),u=-(.5+r)*t,m=-(.5-a)*o,d=[u,m],f=[u+t,m],h=[u,m+o],p=[u+t,m+o];return s(d,d,c),s(f,f,c),s(h,h,c),s(p,p,c),[d,f,h,p]}}},textureUV:{type:P.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:e,texXmin:t,texYmax:o,texYmin:r})=>[[t,r],[e,r],[t,o],[e,o]]}},color:{type:P.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>m(e)},outlineColor:{type:P.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>m(e)},sizing:{type:P.UNSIGNED_BYTE,count:4,pack:({rawWidth:e,rawHeight:t,outlineSize:o,referenceSize:r})=>{const a=Math.max(e,t);return[u(a,128),u(o,128),u(r,128),0]}},placementAngle:{type:P.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:e})=>b(e)},sdfDecodeCoeff:{type:P.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:e})=>e}}};class v extends y{constructor(){super(...arguments),this.calloutRecordsUseLabelPhase=!1,this.vertexSpec=C}get _requiresPerFeaturePacking(){return null!=this._getPointSymbolCalloutMarkerEffect()}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}getLocalCalloutReferenceInfo(){const e=this.evaluatedMeshParams.boundsInfo;if(!e)return;const t=e.size/2;return{anchor:{x:0,y:0},bodyBounds:{xmin:e.offsetX-t,ymin:e.offsetY-t,xmax:e.offsetX+t,ymax:e.offsetY+t}}}getCalloutCollisionBounds(){if(!this._getPointSymbolCalloutMarkerEffect())return;const e=this._getReferencedCalloutReferenceInfo();return e?this.evaluatedMeshParams.getPointSymbolCalloutBounds(e.bodyBounds):void 0}_prepareEvaluatedMeshParams(e,t){const o=this._getPointSymbolCalloutMarkerEffect();if(!o)return;const r=this._getReferencedCalloutReferenceInfo();if(!r)return void e.resetSizeOverride();const a=r.bodyBounds.xmax-r.bodyBounds.xmin,s=r.bodyBounds.ymax-r.bodyBounds.ymin;e.applyPointSymbolCalloutBackgroundScale(o.backgroundScale,a,s)}_write(e,{target:t,effectGeometry:o,scaleFactor:r}){const a=this.evaluatedMeshParams.sprite?.textureBinding,s=t.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,a);const i=this.evaluatedMeshParams.minPixelBuffer,c=Math.max(this.evaluatedMeshParams.computedWidth,i),u=Math.max(this.evaluatedMeshParams.computedHeight,i),m=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,d=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,f=this.evaluatedMeshParams.offsetX+m,h=-this.evaluatedMeshParams.offsetY+d;if(null!=this.evaluatedMeshParams.placement){let a=null;if(null!=o){const e=Math.max(this.evaluatedMeshParams.computedWidth,this.evaluatedMeshParams.computedHeight);if(a=n(o,2*(e*(r??1)),!1),null===a)return}this._writePlacedMarkers(e,t,a,c,u)}else if(o?.nextPath()){o.nextPoint();const t=o.x,r=o.y;e.recordBounds(t+f,r+h,c,u),this._writeQuad(e,s,t,r)}else if("esriGeometryPolygon"===t.geometryType){const o=t.readCentroidForDisplay();if(!o)return;const[r,a]=o.coords;e.recordBounds(r+f,a+h,c,u),this._writeQuad(e,s,r,a)}else if("esriGeometryPoint"===t.geometryType){const o=t.readXForDisplay(),r=t.readYForDisplay();e.recordBounds(o+f,r+h,c,u),this._writeQuad(e,s,o,r)}else{const o=t.readGeometryForDisplay();o?.forEachVertex((t,o)=>{e.recordBounds(t+f,o+h,c,u),Math.abs(t)>l||Math.abs(o)>l||this._writeQuad(e,s,t,o)})}e.recordEnd()}_writePlacedMarkers(t,o,r,a,s){const n=r??i.fromFeatureSetReaderCIM(o);if(!n)return;const u=-1,m=c.getPlacement(n,u,this.evaluatedMeshParams.placement,e(1),t.id);if(!m)return;const d=o.getDisplayId();let f=m.next();const h=this.evaluatedMeshParams.offsetX,p=-this.evaluatedMeshParams.offsetY;for(;null!=f;){const e=f.tx,o=-f.ty;if(Math.abs(e)>l||Math.abs(o)>l){f=m.next();continue}const r=-f.getAngle();t.recordBounds(e+h,o+p,a,s),this._writeQuad(t,d,e,o,r),f=m.next()}}_writeQuad(e,t,o,r,a){const s=e.vertexCount(),i=null==a?null:{placementAngle:a};this._writeVertex(e,t,o,r,i),e.indexWrite(s+0),e.indexWrite(s+1),e.indexWrite(s+2),e.indexWrite(s+1),e.indexWrite(s+3),e.indexWrite(s+2)}_getPointSymbolCalloutMarkerEffect(){for(const{effect:e}of this.effectInfos??[])if("CIMPointSymbolCallout"===e.type&&"marker"===e.part)return e}}export{v as MarkerMeshWriter,C as MarkerVertexSpec};
2
+ import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{identity as t,translate as o,rotate as r}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as a}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as s}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{GeometryCursor as i}from"../../../../../../../geometry/GeometryCursor.js";import{clipCursorToTileExtent as n}from"../../../../../../../symbols/cim/CIMEffects.js";import{maxTileCoordValue as c}from"../../../../../../../symbols/cim/constants.js";import{CIMMarkerPlacementHelper as l}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{packByteSqrt as u,processColorInput as m,getMinMaxZoom as d,getBitMask as f}from"../fill/meshWriterUtils.js";import{ComputedMarkerParams as h}from"./ComputedMarkerParams.js";import{MarkerConstants as p}from"./markerConstants.js";import{MeshWriter as y}from"../mesh/MeshWriter.js";import{DataType as P}from"../../../../../../webgl/enums.js";const g=3.14159265359/180,x=128/Math.PI;function M(e,t){return e%=t,Math.abs(e>=0?e:e+t)}function b(e){return M(e*x,256)}function k(e,s,i,n,c=!1){const l=a(),u=c?1:-1;return t(l),(s||i)&&o(l,l,[s,-i]),n&&r(l,l,u*g*-n),l}const S={createComputedParams:e=>h.from(e),optionalAttributes:{zoomRange:{type:P.HALF_FLOAT,count:2,pack:({scaleInfo:e},{tileInfo:t})=>d(e,t)}},attributes:{pos:{type:P.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:P.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:P.UNSIGNED_BYTE,count:1,pack:({sprite:e,alignment:t,scaleSymbolsProportionally:o,overrideOutlineColor:r,colorLocked:a})=>{let s=0;return e.sdf&&(s|=f(p.bitset.isSDF)),1===t&&(s|=f(p.bitset.isMapAligned)),o&&(s|=f(p.bitset.scaleSymbolsProportionally)),r&&(s|=f(p.bitset.overrideOutlineColor)),a&&(s|=f(p.bitset.colorLocked)),s}},offset:{type:P.HALF_FLOAT,count:2,packAlternating:{count:4,pack:({angle:e,computedWidth:t,computedHeight:o,anchorX:r,anchorY:a,offsetX:i,offsetY:n,rotateClockwise:c})=>{const l=k(0,i,n,-e,c),u=-(.5+r)*t,m=-(.5-a)*o,d=[u,m],f=[u+t,m],h=[u,m+o],p=[u+t,m+o];return s(d,d,l),s(f,f,l),s(h,h,l),s(p,p,l),[d,f,h,p]}}},textureUV:{type:P.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:e,texXmin:t,texYmax:o,texYmin:r})=>[[t,r],[e,r],[t,o],[e,o]]}},color:{type:P.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>m(e)},outlineColor:{type:P.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>m(e)},sizing:{type:P.UNSIGNED_BYTE,count:4,pack:({rawWidth:e,rawHeight:t,outlineSize:o,referenceSize:r})=>{const a=Math.max(e,t);return[u(a,128),u(o,128),u(r,128),0]}},placementAngle:{type:P.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:e})=>b(e)},sdfDecodeCoeff:{type:P.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:e})=>e}}};class v extends y{constructor(){super(...arguments),this.calloutRecordsUseLabelPhase=!1,this.vertexSpec=S}get _requiresPerFeaturePacking(){return null!=this._getPointSymbolCalloutMarkerEffect()}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}getLocalCalloutReferenceInfo(){const e=this.evaluatedMeshParams.boundsInfo;if(!e)return;const t=e.size/2;return{anchor:{x:0,y:0},bodyBounds:{xmin:e.offsetX-t,ymin:e.offsetY-t,xmax:e.offsetX+t,ymax:e.offsetY+t},bodyBoundsUseReferenceScale:!0}}getCalloutCollisionBounds(e){if(this._getPointSymbolCalloutMarkerEffect())return this.evaluatedMeshParams.getPointSymbolCalloutBounds(e.bodyBounds)}_prepareEvaluatedMeshParams(t,o,r,a){const s=this._getPointSymbolCalloutMarkerEffect();if(!s)return;const i=a?.effect?.referenceBounds;if(!i)return void t.resetSizeOverride();const n=i.xmax-i.xmin,c=i.ymax-i.ymin;t.applyPointSymbolCalloutBackgroundScale(s.backgroundScale,n,c,e(s.gap??0),s.contentWidthRatio,s.contentHeightRatio,s.contentRequiresRadialFit)}_write(e,{target:t,effect:o,scaleFactor:r}){const a=o?.geometry,s=this.evaluatedMeshParams.sprite?.textureBinding,i=t.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,s);const l=this.evaluatedMeshParams.minPixelBuffer,u=Math.max(this.evaluatedMeshParams.computedWidth,l),m=Math.max(this.evaluatedMeshParams.computedHeight,l),d=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,f=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,h=this.evaluatedMeshParams.offsetX+d,p=-this.evaluatedMeshParams.offsetY+f;if(null!=this.evaluatedMeshParams.placement){let o=null;if(null!=a){const e=Math.max(this.evaluatedMeshParams.computedWidth,this.evaluatedMeshParams.computedHeight);if(o=n(a,2*(e*(r??1)),!1),null===o)return}this._writePlacedMarkers(e,t,o,u,m)}else if(a?.nextPath()){a.nextPoint();const t=a.x,o=a.y;e.recordBounds(t+h,o+p,u,m),this._writeQuad(e,i,t,o)}else if("esriGeometryPolygon"===t.geometryType){const o=t.readCentroidForDisplay();if(!o)return;const[r,a]=o.coords;e.recordBounds(r+h,a+p,u,m),this._writeQuad(e,i,r,a)}else if("esriGeometryPoint"===t.geometryType){const o=t.readXForDisplay(),r=t.readYForDisplay();e.recordBounds(o+h,r+p,u,m),this._writeQuad(e,i,o,r)}else{const o=t.readGeometryForDisplay();o?.forEachVertex((t,o)=>{e.recordBounds(t+h,o+p,u,m),Math.abs(t)>c||Math.abs(o)>c||this._writeQuad(e,i,t,o)})}e.recordEnd()}_writePlacedMarkers(t,o,r,a,s){const n=r??i.fromFeatureSetReaderCIM(o);if(!n)return;const u=-1,m=l.getPlacement(n,u,this.evaluatedMeshParams.placement,e(1),t.id);if(!m)return;const d=o.getDisplayId();let f=m.next();const h=this.evaluatedMeshParams.offsetX,p=-this.evaluatedMeshParams.offsetY;for(;null!=f;){const e=f.tx,o=-f.ty;if(Math.abs(e)>c||Math.abs(o)>c){f=m.next();continue}const r=-f.getAngle();t.recordBounds(e+h,o+p,a,s),this._writeQuad(t,d,e,o,r),f=m.next()}}_writeQuad(e,t,o,r,a){const s=e.vertexCount(),i=null==a?null:{placementAngle:a};this._writeVertex(e,t,o,r,i),e.indexWrite(s+0),e.indexWrite(s+1),e.indexWrite(s+2),e.indexWrite(s+1),e.indexWrite(s+3),e.indexWrite(s+2)}_getPointSymbolCalloutMarkerEffect(){for(const{effect:e}of this.effectInfos??[])if("CIMPointSymbolCallout"===e.type&&"marker"===e.part)return e}}export{v as MarkerMeshWriter,S as MarkerVertexSpec};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GeometryCursor as t}from"../../../../../../../geometry/GeometryCursor.js";import{autoSnap as e,contains as n,distance as o,inflateBounds as r,scaleMargins as i,createBalloonGeometry as s,createAccentBar as l,createLeaderPath as u}from"../../../../../../../symbols/cim/callouts/effects/calloutUtils.js";const a=96/72,f=1,c=16;class y{constructor(t){this._properties=t}augmentEffectExecutionContext(t){const e=this._hasCalloutEffects?this.getReferencedReferenceInfo()??I(this._properties.writer):null,n=this._hasCalloutEffects&&t.matcher&&t.target&&null!=t.tileKey?t.matcher.getCalloutAnchor(t.target,t.tileKey):null,o=t.scaleFactor??1;return{...t,relativeCalloutAnchor:e?.anchor??void 0,absoluteCalloutAnchor:n?{x:n.x,y:-n.y}:void 0,calloutBodyBounds:e?m(e.bodyBounds,o):void 0}}resolveEffectGeometry(e,n,o){const r=this._getReferencedEffectGeometry(e);return r||(this._hasCalloutEffects&&this._properties.getReferences()&&!o?t.fromJSON({x:0,y:0}):n)}getViewRotation(t){return this._hasCalloutEffects&&this._properties.getCollisionVisibility()?0:t}getCollisionBounds(t=1){const e=this.getReferencedReferenceInfo();if(!e)return;const n=m(e.collisionBodyBounds??e.bodyBounds,t);for(const o of this._properties.getEffects()??[]){if(!_(o)||"background"!==o.part||"CIMBackgroundCallout"!==o.type&&"CIMBalloonCallout"!==o.type)continue;const e=o.margin,r=a*t;return{xmin:n.xmin-(e?.left??0)*r,ymin:n.ymin-(e?.bottom??0)*r,xmax:n.xmax+(e?.right??0)*r,ymax:n.ymax+(e?.top??0)*r}}}getPartCollisionBounds(t=1){const e=this.getReferencedReferenceInfo();if(!e)return[];const n=m(e.bodyBounds,t),o=m(e.collisionBodyBounds??e.bodyBounds,t),r=S(n),i=S(o),s=e.anchor??r,l={x:s.x-(r.x-i.x),y:s.y-(r.y-i.y)},u=a*t,c=Math.max(f,this._properties.getCollisionPadding()),y=[];for(const a of this._properties.getEffects()??[])_(a)&&y.push(...x(a,o,l,u,c));return y}getReferenceInfo(){return I(this._properties.writer)}getReferencedReferenceInfo(){for(const t of this._properties.getReferences()??[]){const e=I(t);if(e)return e}}get _hasCalloutEffects(){return!!this._properties.getEffectInfos()?.some(({effect:t})=>_(t))}_getReferencedEffectGeometry(t){if(this._hasCalloutEffects)for(const e of this._properties.getReferences()??[]){if(!N(e))continue;const n=e.getCalloutEffectGeometry(t);if(n)return n}}}function m(t,e){return 1===e?t:{xmin:t.xmin*e,ymin:t.ymin*e,xmax:t.xmax*e,ymax:t.ymax*e}}function x(t,e,n,o,r){switch(t.type){case"CIMBackgroundCallout":return d(t,e,n,o,r);case"CIMBalloonCallout":return h(t,e,n,o,r);case"CIMPointSymbolCallout":return p(t,e,n,o,r);case"CIMSimpleLineCallout":return C(t,e,n,o,r)}}function d(t,e,n,o,s){const u=r(e,i(t.margin,o));return"background"===t.part?[]:"accent-bar"===t.part?B(l(u,n,(t.gap??0)*o,1),s):g(u,n,t,o,s)}function h(t,e,o,l,u){const a=r(e,i(t.margin,l));return B(s(a,o,t.balloonStyle,(t.leaderTolerance??0)*l,1),u,(t,e)=>!n(a,t)||!n(a,e))}function p(t,e,n,o,r){return"marker"===t.part?[]:g(e,n,t,o,r)}function g(t,r,i,s,l){return n(t,r)||o(e(t,r),r)<(i.leaderTolerance??0)*s?[]:B(u(t,r,i.lineStyle,(i.leaderOffset??0)*s,1),l)}function C(t,r,i,s,l){const u=!1===t.autoSnap?{x:r.xmin,y:r.ymin}:e(r,i);return n(r,i)||o(u,i)<(t.leaderTolerance??0)*s?[]:b(u,i,l)}function B(t,e,n=()=>!0){const o=[];for(t.reset();t.nextPath();){let r=null;for(;t.nextPoint();){const i={x:t.x,y:t.y};r&&n(r,i)&&o.push(...b(r,i,e)),r=i}}return t.reset(),o}function b(t,e,n){const o=e.x-t.x,r=e.y-t.y,i=0!==o&&0!==r?Math.ceil(Math.max(Math.abs(o),Math.abs(r))/c):1,s=[];for(let l=0;l<i;l++){const e=l/i,u=(l+1)/i,a=t.x+o*e,f=t.y+r*e,c=t.x+o*u,y=t.y+r*u;s.push({xmin:Math.min(a,c)-n,ymin:Math.min(f,y)-n,xmax:Math.max(a,c)+n,ymax:Math.max(f,y)+n})}return s}function I(t){return M(t)?E(t.getLocalCalloutReferenceInfo()):R(t.getBoundsInfo())}function M(t){return"getLocalCalloutReferenceInfo"in t&&"function"==typeof t.getLocalCalloutReferenceInfo}function N(t){return"getCalloutEffectGeometry"in t&&"function"==typeof t.getCalloutEffectGeometry}function _(t){return"CIMBackgroundCallout"===t.type||"CIMBalloonCallout"===t.type||"CIMPointSymbolCallout"===t.type||"CIMSimpleLineCallout"===t.type}function R(t){if(!G(t))return;const e=t.size/2,n={xmin:t.offsetX-e,ymin:t.offsetY-e,xmax:t.offsetX+e,ymax:t.offsetY+e};return{anchor:S(n),bodyBounds:n}}function E(t){if(!t||!k(t.bodyBounds))return;const e=t.anchor??S(t.bodyBounds),n=t.collisionBodyBounds;return v(e)?n&&k(n)?{anchor:e,bodyBounds:t.bodyBounds,collisionBodyBounds:n}:{anchor:e,bodyBounds:t.bodyBounds}:void 0}function S(t){return{x:(t.xmin+t.xmax)/2,y:(t.ymin+t.ymax)/2}}function G(t){return null!=t&&null!=t.offsetX&&!isNaN(t.offsetX)&&null!=t.offsetY&&!isNaN(t.offsetY)&&null!=t.size&&!isNaN(t.size)}function k(t){return!(null==t.xmin||isNaN(t.xmin)||null==t.ymin||isNaN(t.ymin)||null==t.xmax||isNaN(t.xmax)||null==t.ymax||isNaN(t.ymax))}function v(t){return null!=t.x&&!isNaN(t.x)&&null!=t.y&&!isNaN(t.y)}export{y as CalloutMeshWriterPolicy,I as getCalloutReferenceInfo,M as isLocalCalloutReferenceProvider};
2
+ import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{getBalloonBodyBounds as t,getBalloonCornerRadius as o,inflateBounds as n,scaleMargins as r,autoSnap as i,contains as l,distance as u,createBalloonGeometry as s,createAccentBar as a,createLeaderPath as c}from"../../../../../../../symbols/cim/callouts/effects/calloutUtils.js";const f=96/72,y=1,d=16;class m{constructor(e){this._properties=e}getEffectExecutionContextOverrides(e,t=!1){const o=this.getReferenceInfo(),n=p(e),r=o?.bodyBoundsUseReferenceScale?e.scaleFactor??1:1;return{scaleFactor:r,callout:{relativeAnchor:o?.anchor??void 0,relativeLayoutAnchor:o?.layoutAnchor??void 0,absoluteAnchor:n?{x:n.x,y:-n.y}:void 0,bodyBounds:o?x(o.bodyBounds,r):void 0,preserveInputGeometry:t}}}resolveEffectGeometry(t,o,n){const r=this._getReferencedEffectGeometry(t);return r?{geometry:r,preserveInputGeometry:!0}:{geometry:n?o:e.fromJSON({x:0,y:0}),preserveInputGeometry:!1}}getViewRotation(e){return this._properties.collisionVisibility?0:e}getCollisionBounds(e=1){const o=this.getReferenceInfo();if(!o)return;if(g(this._properties.writer))return this._properties.writer.getCalloutCollisionBounds(o,e);const n=o.bodyBoundsUseReferenceScale?e:1,r=x(o.collisionBodyBounds??o.bodyBounds,n);for(const i of this._properties.effects??[]){if(!O(i)||"background"!==i.part||"CIMBackgroundCallout"!==i.type&&"CIMBalloonCallout"!==i.type)continue;const e=i.margin,o=f*n,l={xmin:r.xmin-(e?.left??0)*o,ymin:r.ymin-(e?.bottom??0)*o,xmax:r.xmax+(e?.right??0)*o,ymax:r.ymax+(e?.top??0)*o};return"CIMBalloonCallout"===i.type?t(l,i.balloonStyle):l}}getCornerRadius(e=1){const t=this.getReferenceInfo();if(!t)return 0;const i=t.bodyBoundsUseReferenceScale?e:1,l=x(t.bodyBounds,i);for(const u of this._properties.effects??[])if(O(u)&&"background"===u.part&&"CIMBalloonCallout"===u.type)return o(n(l,r(u.margin,f*i)),u.balloonStyle);return 0}getPartCollisionBounds(e=1){const t=this.getReferenceInfo();if(!t)return[];if(h(this._properties.writer))return this._properties.writer.getCalloutPartCollisionBounds(e);const o=t.bodyBoundsUseReferenceScale?e:1,n=x(t.bodyBounds,o),r=x(t.collisionBodyBounds??t.bodyBounds,o),i=U(n),l=U(r),u=t.anchor??i,s=t.layoutAnchor??u,a={x:u.x-(i.x-l.x),y:u.y-(i.y-l.y)},c={x:s.x-(i.x-l.x),y:s.y-(i.y-l.y)},d=f*o,m=Math.max(y,C(this._properties.writer)),p=[];for(const f of this._properties.effects??[])O(f)&&p.push(...b(f,r,a,c,d,m));return p}getReferenceInfo(){return G(this._properties.reference)}getReferencedRotation(){const e=this._properties.reference;if(e&&E(e)){const t=e.getCalloutRotation();return null!=t&&Number.isFinite(t)?t:void 0}}_getReferencedEffectGeometry(e){const t=this._properties.reference;return t&&A(t)?t.getCalloutEffectGeometry(e)??void 0:void 0}}function x(e,t){return 1===t?e:{xmin:e.xmin*t,ymin:e.ymin*t,xmax:e.xmax*t,ymax:e.ymax*t}}function p(e){const{matcher:t,target:o,tileKey:n}=e;if(!t||!o||null==n||"function"!=typeof o.getObjectId||!("getMatcherGeometryOverride"in t)||"function"!=typeof t.getMatcherGeometryOverride)return null;const r=t;return r.getMatcherGeometryOverride(`${n}_${o.getObjectId()}`)?.absoluteCalloutAnchor??null}function C(e){return B(e)?e.getCalloutCollisionPadding():0}function g(e){return"getCalloutCollisionBounds"in e&&"function"==typeof e.getCalloutCollisionBounds}function h(e){return"getCalloutPartCollisionBounds"in e&&"function"==typeof e.getCalloutPartCollisionBounds}function B(e){return"getCalloutCollisionPadding"in e&&"function"==typeof e.getCalloutCollisionPadding}function b(e,t,o,n,r,i){switch(e.type){case"CIMBackgroundCallout":return I(e,t,o,n,r,i);case"CIMBalloonCallout":return M(e,t,o,n,r,i);case"CIMPointSymbolCallout":return R(e,t,o,n,r,i);case"CIMSimpleLineCallout":return v(e,t,o,n,r,i)}}function I(e,t,o,i,l,u){const s=n(t,r(e.margin,l));return"background"===e.part?[]:"accent-bar"===e.part?S(a(s,i,(e.gap??0)*l,1),u):N(s,o,i,e,l,u)}function M(e,t,o,i,l,u){const a=n(t,r(e.margin,l));return S(s(a,o,e.balloonStyle,(e.leaderTolerance??0)*l,1,null!=e.dartWidth?e.dartWidth*l:null,i),u,(e,t)=>L(e,o)||L(t,o))}function R(e,t,o,n,r,i){return"marker"===e.part?[]:N(t,o,n,e,r,i)}function N(e,t,o,n,r,s){return l(e,o)||u(i(e,o),o)<(n.leaderTolerance??0)*r?[]:S(c(e,o,n.lineStyle,(n.leaderOffset??0)*r,1,t),s)}function v(e,t,o,n,r,s){const a=!1===e.autoSnap?{x:t.xmin,y:t.ymin}:i(t,n);return l(t,n)||u(a,n)<(e.leaderTolerance??0)*r?[]:_(a,o,s)}function S(e,t,o=()=>!0){const n=[];for(e.reset();e.nextPath();){let r=null;for(;e.nextPoint();){const i={x:e.x,y:e.y};r&&o(r,i)&&n.push(..._(r,i,t)),r=i}}return e.reset(),n}function _(e,t,o){const n=t.x-e.x,r=t.y-e.y,i=0!==n&&0!==r?Math.ceil(Math.max(Math.abs(n),Math.abs(r))/d):1,l=[];for(let u=0;u<i;u++){const t=u/i,s=(u+1)/i,a=e.x+n*t,c=e.y+r*t,f=e.x+n*s,y=e.y+r*s;l.push({xmin:Math.min(a,f)-o,ymin:Math.min(c,y)-o,xmax:Math.max(a,f)+o,ymax:Math.max(c,y)+o})}return l}function G(e){return P(e)?w(e.getLocalCalloutReferenceInfo()):k(e.getBoundsInfo())}function P(e){return"getLocalCalloutReferenceInfo"in e&&"function"==typeof e.getLocalCalloutReferenceInfo}function A(e){return"getCalloutEffectGeometry"in e&&"function"==typeof e.getCalloutEffectGeometry}function E(e){return"getCalloutRotation"in e&&"function"==typeof e.getCalloutRotation}function O(e){return"CIMBackgroundCallout"===e.type||"CIMBalloonCallout"===e.type||"CIMPointSymbolCallout"===e.type||"CIMSimpleLineCallout"===e.type}function k(e){if(!j(e))return;const t=e.size/2,o={xmin:e.offsetX-t,ymin:e.offsetY-t,xmax:e.offsetX+t,ymax:e.offsetY+t};return{anchor:U(o),bodyBounds:o}}function w(e){if(!e||!X(e.bodyBounds))return;const t=e.anchor??U(e.bodyBounds),o=e.layoutAnchor??t,n=e.collisionBodyBounds;return Y(t)&&Y(o)?{anchor:t,...e.layoutAnchor?{layoutAnchor:o}:null,bodyBounds:e.bodyBounds,...n&&X(n)?{collisionBodyBounds:n}:null,...e.bodyBoundsUseReferenceScale?{bodyBoundsUseReferenceScale:!0}:null}:void 0}function U(e){return{x:(e.xmin+e.xmax)/2,y:(e.ymin+e.ymax)/2}}function L(e,t){return e.x===t.x&&e.y===t.y}function j(e){return null!=e&&null!=e.offsetX&&!isNaN(e.offsetX)&&null!=e.offsetY&&!isNaN(e.offsetY)&&null!=e.size&&!isNaN(e.size)}function X(e){return!(null==e.xmin||isNaN(e.xmin)||null==e.ymin||isNaN(e.ymin)||null==e.xmax||isNaN(e.xmax)||null==e.ymax||isNaN(e.ymax))}function Y(e){return null!=e.x&&!isNaN(e.x)&&null!=e.y&&!isNaN(e.y)}export{m as CalloutMeshWriterPolicy,G as getCalloutReferenceInfo,P as isLocalCalloutReferenceProvider};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{loadGeometryOperatorsForEffect as t,loadGeometryOperatorsForPlacement as i}from"../../../../../../../symbols/cim/CIMEffects.js";import{getEffectsInflateSize as s}from"../../../../../../../symbols/cim/utils.js";import{EffectHelper as r}from"../../../../../../../symbols/cim/effects/EffectHelper.js";import{CalloutMeshWriterPolicy as a}from"./CalloutMeshWriterPolicy.js";import{MeshWriterVertexPack as n}from"./MeshWriterVertexPack.js";const o=96/72;class c{constructor(e,t,i,s){this._instanceId=e,this._evaluator=t,this._enabledOptionalAttributes=i,this._viewParams=s,this._evaluator.evaluator=e=>this.vertexSpec.createComputedParams(e),this._calloutPolicy=new a({writer:this,getEffectInfos:()=>this.effectInfos,getEffects:()=>this.evaluatedMeshParams.effects,getReferences:()=>this._references,getCollisionVisibility:()=>!!this._evaluator.inputMeshParams.collisionVisibility,getCollisionPadding:()=>this.getCalloutCollisionPadding()})}get _vertexPack(){if(!this._cachedVertexPack){const e=n.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes);this._evaluator.hasDynamicProperties||this._requiresPerFeaturePacking||e.pack(this._evaluator.evaluatedMeshParams,this._viewParams),e.collisionVisibility=!!this._evaluator.inputMeshParams.collisionVisibility,this._cachedVertexPack=e}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get effectInfos(){return this._evaluator.inputMeshParams.effects?.effectInfos}get placementInfo(){return this._evaluator.inputMeshParams.placement}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}get _preventEffectClipping(){return!1}get _requiresPerFeaturePacking(){return!1}get _effectRotation(){return null}setReferences(e){this._references=e}getBoundsInfo(){return null}getCalloutReferenceInfo(){return this._calloutPolicy.getReferenceInfo()}getCalloutCollisionBounds(e=1){return this._calloutPolicy.getCollisionBounds(e)}getCalloutPartCollisionBounds(e=1){return this._calloutPolicy.getPartCollisionBounds(e)}getCalloutCollisionPadding(){return 0}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){for(const{effect:e}of this.effectInfos||[])await t(e);this.placementInfo&&await i(this.placementInfo.placement)}enqueueRequest(e,t,i){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(e,t,i)}write(e,t,i,s,r,a,n,o){this.ensurePacked(t,i,s);const c={target:i,options:s,level:r,viewExtent:a,matcher:o},l=e.id||"",u=this.evaluatedMeshParams.effects,f=this._createEffectExecutionContext(i,s,l,n,o);if(!u||0===u.length)return void this._write(e,c);const h=this.getEffectCursor(i,u,f,c);if(!h)return;let m;for(;m=h.next();)m.invertY(),this._write(e,{...c,effectGeometry:m,scaleFactor:n})}ensurePacked(e,t,i){if(!this._evaluator.hasDynamicProperties&&!this._requiresPerFeaturePacking)return;const s=this._evaluator.hasDynamicProperties?this._evaluator.evaluateMeshParams(e,t,i):this.evaluatedMeshParams;this._prepareEvaluatedMeshParams(s,t,i),this._vertexPack.pack(s,this._viewParams)}hasArcadeDependency(e){return this._evaluator.hasArcadeDependency(e)}_writeVertex(e,t,i,s,r){const a=this.evaluatedMeshParams;this._vertexPack.writeVertex(e,t,i,s,a,r)}_prepareEvaluatedMeshParams(e,t,i){}_createEffectExecutionContext(e,t,i,r,a){return this._calloutPolicy.augmentEffectExecutionContext({geomUnitsPerPoint:o,maxInflateSize:s(this.evaluatedMeshParams.effects),scale:t.$view.scale,spatialReference:e.metadata.outSpatialReference??e.metadata.spatialReference,preventClipping:this._preventEffectClipping,tileKey:i,scaleFactor:r,matcher:a,target:e})}_getReferencedCalloutReferenceInfo(){return this._calloutPolicy.getReferencedReferenceInfo()}getEffectCursor(t,i,s,a){null==s.scaleFactor&&(s={...s,scaleFactor:1});const n=null!=t.geometryType&&t.readGeometryForDisplay()?e.fromOptimizedCIM(t.readGeometryForDisplay().clone(),t.geometryType):null,o="esriGeometryPoint"===t.geometryType||"esriGeometryMultipoint"===t.geometryType,c=this._calloutPolicy.resolveEffectGeometry(a,n,o);if(!c)return;const u=e.fromOptimizedCIM(c.asOptimized(),c.geometryType);u.invertY();const f=r.executeEffects(i,u,s),h=this._effectRotation,m=h?.value,_=this._calloutPolicy.getViewRotation(h?.viewRotation);if((null==m||isNaN(m))&&(null==_||isNaN(_)))return f;const P=(null==m||isNaN(m)?0:"arithmetic"===h?.type?90-m:m)+(null==_||isNaN(_)?0:-_);if(0===P)return f;let p=null;return"esriGeometryPoint"===u.geometryType&&(u.reset(),u.nextPath()&&u.nextPoint()&&(p=[u.x,u.y]),u.reset()),new l(f,s,p,h?.useEffectOrigin??!1,-P*Math.PI/180)}}class l{constructor(e,t,i,s,r){this._cursor=e,this._executionContext=t,this._sourceOrigin=i,this._useEffectOrigin=s,this._cos=Math.cos(r),this._sin=Math.sin(r)}next(){this._executionContext.effectOrigin=null;const e=this._cursor.next();if(!e)return null;const t=(this._useEffectOrigin?this._executionContext.effectOrigin:null)??this._sourceOrigin;if(!t)return e;const[i,s]=t,r=e.clone();for(;r.nextPath();)for(;r.nextPoint();){const e=r.x-i,t=r.y-s;r.x=i+e*this._cos-t*this._sin,r.y=s+e*this._sin+t*this._cos}return r.reset(),r}}export{c as MeshWriter};
2
+ import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{loadGeometryOperatorsForEffect as t,loadGeometryOperatorsForPlacement as r}from"../../../../../../../symbols/cim/CIMEffects.js";import{getEffectsInflateSize as s}from"../../../../../../../symbols/cim/utils.js";import{EffectHelper as i}from"../../../../../../../symbols/cim/effects/EffectHelper.js";import{MeshWriterVertexPack as a}from"./MeshWriterVertexPack.js";const n=96/72;class o{constructor(e,t,r,s){this._instanceId=e,this._evaluator=t,this._enabledOptionalAttributes=r,this._viewParams=s,this._evaluator.evaluator=e=>this.vertexSpec.createComputedParams(e)}get _vertexPack(){if(!this._cachedVertexPack){const e=a.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes);this._evaluator.hasDynamicProperties||this._requiresPerFeaturePacking||e.pack(this._evaluator.evaluatedMeshParams,this._viewParams),e.collisionVisibility=!!this._evaluator.inputMeshParams.collisionVisibility,this._cachedVertexPack=e}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get effects(){return this.evaluatedMeshParams.effects}get collisionVisibility(){return!!this._evaluator.inputMeshParams.collisionVisibility}get effectClippingPadding(){return 0}get effectInfos(){return this._evaluator.inputMeshParams.effects?.effectInfos}get placementInfo(){return this._evaluator.inputMeshParams.placement}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}get _preventEffectClipping(){return!1}get _requiresPerFeaturePacking(){return!1}get _effectRotation(){return null}setReferences(e){this._references=e}getReference(e){return this._references?.get(e)}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){for(const{effect:e}of this.effectInfos||[])await t(e);this.placementInfo&&await r(this.placementInfo.placement)}enqueueRequest(e,t,r){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(e,t,r)}write(e,t,r,s,i,a,n,o,c={}){const u={target:r,options:s,level:i,viewExtent:a,scaleFactor:n,matcher:o,...c};this.ensurePacked(t,r,s,u);const l=e.id||"",f=this.evaluatedMeshParams.effects,h=this._createEffectExecutionContext(r,s,l,n,o,u.effect?.executionContext);if(!f||0===f.length)return void this._write(e,u);const m=this.getEffectCursor(r,f,h,u);if(!m)return;let p;for(;p=m.next();)p.invertY(),this._write(e,{...u,effect:{...u.effect,geometry:p},scaleFactor:n})}ensurePacked(e,t,r,s){if(!this._evaluator.hasDynamicProperties&&!this._requiresPerFeaturePacking)return;const i=this._evaluator.hasDynamicProperties?this._evaluator.evaluateMeshParams(e,t,r):this.evaluatedMeshParams;this._prepareEvaluatedMeshParams(i,t,r,s),this._vertexPack.pack(i,this._viewParams)}hasArcadeDependency(e){return this._evaluator.hasArcadeDependency(e)}_writeVertex(e,t,r,s,i){const a=this.evaluatedMeshParams;this._vertexPack.writeVertex(e,t,r,s,a,i)}_prepareEvaluatedMeshParams(e,t,r,s){}_createEffectExecutionContext(e,t,r,i,a,o){return{geomUnitsPerPoint:n,maxInflateSize:s(this.evaluatedMeshParams.effects),scale:t.$view.scale,spatialReference:e.metadata.outSpatialReference??e.metadata.spatialReference,preventClipping:this._preventEffectClipping,tileKey:r,scaleFactor:i,matcher:a,target:e,...o}}getEffectCursor(t,r,s,a){null==s.scaleFactor&&(s={...s,scaleFactor:1});const n=void 0!==a.effect?.inputGeometry?a.effect.inputGeometry:null!=t.geometryType&&t.readGeometryForDisplay()?e.fromOptimizedCIM(t.readGeometryForDisplay().clone(),t.geometryType):null;if(!n)return;const o=e.fromOptimizedCIM(n.asOptimized(),n.geometryType);o.invertY();const u=i.executeEffects(r,o,s),l=this._effectRotation,f=l?.value,h=null==f||isNaN(f)?a.effect?.rotation:f,m=a.effect?.viewRotation??l?.viewRotation;if((null==h||isNaN(h))&&(null==m||isNaN(m)))return u;const p=(null==h||isNaN(h)?0:null==f||isNaN(f)||"arithmetic"!==l?.type?h:90-h)+(null==m||isNaN(m)?0:-m);if(0===p)return u;let _=null;return"esriGeometryPoint"===o.geometryType&&(o.reset(),o.nextPath()&&o.nextPoint()&&(_=[o.x,o.y]),o.reset()),new c(u,s,_,l?.useEffectOrigin??!1,-p*Math.PI/180)}}class c{constructor(e,t,r,s,i){this._cursor=e,this._executionContext=t,this._sourceOrigin=r,this._useEffectOrigin=s,this._cos=Math.cos(i),this._sin=Math.sin(i)}next(){this._executionContext.effectOrigin=null;const e=this._cursor.next();if(!e)return null;const t=(this._useEffectOrigin?this._executionContext.effectOrigin:null)??this._sourceOrigin;if(!t)return e;const[r,s]=t,i=e.clone();for(;i.nextPath();)for(;i.nextPoint();){const e=i.x-r,t=i.y-s;i.x=r+e*this._cos-t*this._sin,i.y=s+e*this._sin+t*this._cos}return i.reset(),i}}export{o as MeshWriter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const e=new Set(["CIMSimpleLineCallout","CIMBackgroundCallout","CIMBalloonCallout","CIMPointSymbolCallout"]);function n(e){if(0===e.length)return[];const n=new Set(e.filter(t)),l=n.size>0?e.find(e=>!t(e)&&r(e)):void 0,c=e.find(e=>23===e.techniqueType&&!t(e))??l??e[0];if(n.size>0&&!l)throw new Error("InternalError: CIM callout symbol has no reference provider");return e.map(e=>{const t=[...e.references?.exports??[]],r=[...e.references?.dependencies??[]];return e===c&&o(t,"label-reference-symbol"),e===l&&o(t,"callout-body"),n.has(e)&&o(r,"callout-body"),{...e,references:{...e.references,...t.length?{exports:t}:null,...r.length?{dependencies:r}:null}}})}function t(n){const t=n.inputParams.effects;return"cim-effect-infos"===t?.type&&t.effectInfos.some(({effect:n})=>e.has(n.type))}function r(e){return 23===e.techniqueType||32===e.techniqueType}function o(e,n){e.includes(n)||e.push(n)}export{n as defineMeshWriterReferences};
2
+ const e=new Set(["CIMSimpleLineCallout","CIMBackgroundCallout","CIMBalloonCallout","CIMPointSymbolCallout"]);function n(e){if(0===e.length)return[];const n=new Set(e.filter(t)),o=n.size>0?e.find(e=>!t(e)&&32===e.techniqueType)??e.find(e=>!t(e)&&23===e.techniqueType):void 0,l=e.find(e=>23===e.techniqueType&&!t(e))??o??e[0];if(n.size>0&&!o)throw new Error("InternalError: CIM callout symbol has no reference provider");return e.map(e=>{const t=[...e.references?.exports??[]],c=[...e.references?.dependencies??[]];return e===l&&r(t,"label-reference-symbol"),e===o&&r(t,"callout-body"),n.has(e)&&r(c,"callout-body"),{...e,references:{...e.references,...t.length?{exports:t}:null,...c.length?{dependencies:c}:null}}})}function t(n){const t=n.inputParams.effects;return"cim-effect-infos"===t?.type&&t.effectInfos.some(({effect:n})=>e.has(n.type))}function r(e,n){e.includes(n)||e.push(n)}export{n as defineMeshWriterReferences};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clamp as t}from"../../../../../../../core/mathUtils.js";import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as o}from"../../../../../../../geometry/GeometryCursor.js";import{asCIMGeometryCursor as i}from"../../../../../../../symbols/cim/utils.js";import{CIMMarkerPlacementHelper as s}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{getXDirection as r,getYDirection as n}from"../../../alignmentUtils.js";import{labelU16ZoomPrecisionFactor as a,labelPlacementOffsetPadding as l,maxLineHeightRatio as f,minLineHeightRatio as c,maxTextLineWidth as h,minTextLineWidth as d,magicLabelLineHeight as u,packDegreesU8 as m}from"../../../definitions.js";import{shapeTextResource as p,shapeTextResourceForMultipoint as g}from"../../../mesh/templates/shapingUtils.js";import{processColorInput as y,getMinMaxZoom as x,packBitset as S}from"../fill/meshWriterUtils.js";import{MeshWriter as _}from"../mesh/MeshWriter.js";import{bitsetTextIsBackground as z,bitsetTextIsMapAligned as b}from"../shaders/constants.js";import{TextMeshTransformProps as M}from"./TextParams.js";import{DataType as R}from"../../../../../../webgl/enums.js";const P=28,B=[4,4],G=[16,4],L={topLeft:G,topRight:G,bottomLeft:G,bottomRight:G};function k(o){return null==o?h:t(e(o),d,h)}function C(e,o){return e/24*u*t(o,c,f)}const T=[4,2],v=[4,6],A={topLeft:T,topRight:T,bottomLeft:v,bottomRight:v},E={topLeft:T,topRight:v,bottomLeft:T,bottomRight:v},w={topLeft:v,topRight:v,bottomLeft:B,bottomRight:B},I={topLeft:B,topRight:B,bottomLeft:v,bottomRight:v},D={topLeft:v,topRight:B,bottomLeft:v,bottomRight:B},N={topLeft:B,topRight:v,bottomLeft:B,bottomRight:v};function U(t){return t.useBackgroundCallout?{backgroundColor:null,borderLineColor:null,borderLineSize:0}:{backgroundColor:t.boxBackgroundColor??t.backgroundColor??null,borderLineColor:t.boxBorderLineColor??t.borderLineColor??null,borderLineSize:t.boxBorderLineSize>0?t.boxBorderLineSize:t.borderLineWidth??0}}const H={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:R.UNSIGNED_SHORT,count:2,packPrecisionFactor:a,packTessellation:({minZoom:t,maxZoom:e})=>[t||0,e||P]},clipAngle:{type:R.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:t})=>O(t||0)},referenceSymbol:{type:R.BYTE,count:4,packTessellation:(t,o)=>{const i=t.isLineLabel||!t.referenceBounds,s=r(i?"center":o.horizontalAlignment),a=n(i?"middle":o.verticalAlignment),{offsetX:l,offsetY:f,size:c}=i?{offsetX:0,offsetY:0,size:0}:t.referenceBounds;return[e(l),-e(f),Math.round(e(c)),s+1<<2|a+1]}}},attributes:{pos:{type:R.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:R.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:R.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:t,mapAligned:e})=>S([[z,t],[b,!!e]])},offset:{type:R.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:t})=>{const{bottomLeft:e,bottomRight:o,topLeft:i,topRight:s}=t;return[i,s,e,o]}}},textureUV:{type:R.UNSIGNED_SHORT,count:2,packAlternating:{count:4,packTessellation:({texcoords:t})=>{const{bottomLeft:e,bottomRight:o,topLeft:i,topRight:s}=t;return[i,s,e,o]}}},color:{type:R.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:t})=>t},fontAndReferenceSize:{type:R.UNSIGNED_SHORT,count:4,packPrecisionFactor:4,packTessellation:({fontSize:t,sdfSize:o,sdfRadius:i},{referenceSize:s})=>[Math.round(e(t)),Math.round(e(s||t)),o,i]},outlineColor:{type:R.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>y(t)},haloColor:{type:R.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:t})=>y(t)},outlineAndHaloSize:{type:R.UNSIGNED_SHORT,count:2,packPrecisionFactor:4,packTessellation:({outlineSize:t,haloSize:o})=>[Math.round(e(t)),Math.round(e(o))]}}};class Y extends _{constructor(){super(...arguments),this.calloutRecordsUseLabelPhase=!1,this.vertexSpec=H,this._textMeshParamsPropsInitialized=!1,this._calloutEffectGeometry=null}getCalloutEffectGeometry(t){return this._calloutEffectGeometry}ensurePacked(t,e,o){super.ensurePacked(t,e,o),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new M(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}getLocalCalloutReferenceInfo(){return this._createLocalCalloutReferenceInfo(this._getShaping())}_createLocalCalloutReferenceInfo(t){if(!t)return;const e=t.boundsT,[o,i]=this._getReferenceSymbolOffset(),s={xmin:e.xmin,ymin:-e.ymax,xmax:e.xmax,ymax:-e.ymin};return{anchor:{x:0,y:0},bodyBounds:{xmin:s.xmin+o,ymin:s.ymin-i,xmax:s.xmax+o,ymax:s.ymax-i},collisionBodyBounds:s}}_getReferenceSymbolOffset(){if(!this._references)return[0,0];for(const t of this._references){const o=t.getBoundsInfo();if(!o)continue;const i=e(o.size)/2+l+e(this.evaluatedMeshParams.labelOffsetDistance??0);return[e(o.offsetX)+r(this.evaluatedMeshParams.horizontalAlignment)*i,-e(o.offsetY)+n(this.evaluatedMeshParams.verticalAlignment)*i]}return[0,0]}_write(t,{target:e,effectGeometry:o}){this._calloutEffectGeometry=null;const s=this._getShaping();if(!s)return;const r=1===this.evaluatedMeshParams.alignment,n=e.getDisplayId(),{placement:a}=this.evaluatedMeshParams;if(null!=a){if("PrivatePlacementMultipoint"!==a.type)this._writePlacedTextMarkers(t,e,s,i(o));else{const s=this._getMultipointShaping();s&&this._writeMultipointText(t,e,s,i(o))}return}if(o?.nextPath())return o.nextPoint(),this._setCalloutEffectGeometry(o.x,o.y),this._writeGlyphs(t,n,o.x,o.y,s,0,void 0,{mapAligned:r});if("esriGeometryPolygon"===e.geometryType){const o=e.readCentroidForDisplay();if(!o)return;const[i,a]=o.coords;return this._setCalloutEffectGeometry(i,a),this._writeGlyphs(t,n,i,a,s,0,void 0,{mapAligned:r})}if("esriGeometryMultipoint"===e.geometryType){const o=e.readGeometryForDisplay();return void o?.forEachVertex((e,o)=>{this._setCalloutEffectGeometry(e,o),this._writeGlyphs(t,n,e,o,s,0,void 0,{mapAligned:r})})}const l=e.readXForDisplay(),f=e.readYForDisplay();return this._setCalloutEffectGeometry(l,f),this._writeGlyphs(t,n,l,f,s,0,void 0,{mapAligned:r})}_writePlacedTextMarkers(t,i,r,n){const a=n??o.fromFeatureSetReaderCIM(i);if(!a)return;const l=-1,f=s.getPlacement(a,l,this.evaluatedMeshParams.placement,e(1),t.id);if(!f)return;const c=i.getDisplayId();let h=f.next();for(;null!=h;){const e=-h.getAngle(),o=h.tx,i=-h.ty;this._setCalloutEffectGeometry(o,i),this._writeGlyphs(t,c,o,i,r,e,void 0,{mapAligned:1===this.evaluatedMeshParams.alignment}),h=f.next()}}_writeMultipointText(t,i,r,n){const a=n??o.fromFeatureSetReaderCIM(i);if(!a)return;const l=-1,f=s.getPlacement(a,l,this.evaluatedMeshParams.placement,e(1),t.id);if(!f)return;const c=i.getDisplayId();let h=f.next(),d=0;for(;null!=h;){const e=h.tx,o=-h.ty,i=-h.getAngle();if(this._setCalloutEffectGeometry(e,o),d>=r.glyphs.length)break;this._writeGlyph(t,c,e,o,r,d,i,void 0,{mapAligned:1===this.evaluatedMeshParams.alignment}),h=f.next(),d++}}_setCalloutEffectGeometry(t,e){this._calloutEffectGeometry??=o.fromJSON({x:t,y:e})}_getShaping(o){const i=this._textMeshTransformProps,s=this.evaluatedMeshParams;if(!this._hasGlyphs(s.glyphs))return null;const r=e(i.fontSize),n=e(i.offsetX),a=e(i.offsetY),{sdfSize:l}=this._getDefaultGlyphMetrics(s.glyphs),h=k(s.lineWidth),d=C(l,s.lineHeightRatio),{backgroundColor:u,borderLineSize:m}=U(s);return p(s.glyphs,{scale:r/l,angle:i.postAngle,xOffset:n,yOffset:a,horizontalAlignment:s.horizontalAlignment,verticalAlignment:o||s.verticalAlignment,maxLineWidth:h,lineHeight:d,lineHeightRatio:t(s.lineHeightRatio,c,f),decoration:s.decoration,borderLineSizePx:e(m),hasBackground:!!u,useCIMAngleBehavior:s.useCIMAngleBehavior})}_getMultipointShaping(){const o=this._textMeshTransformProps,i=this.evaluatedMeshParams;if(!this._hasGlyphs(i.glyphs))return null;const s=e(o.fontSize),r=e(o.offsetX),n=e(o.offsetY),{sdfSize:a}=this._getDefaultGlyphMetrics(i.glyphs),l=k(i.lineWidth),h=C(a,i.lineHeightRatio),{backgroundColor:d,borderLineSize:u}=U(i);return g(i.glyphs,{scale:s/a,angle:o.postAngle,xOffset:r,yOffset:n,horizontalAlignment:i.horizontalAlignment,verticalAlignment:i.verticalAlignment,maxLineWidth:l,lineHeight:h,lineHeightRatio:t(i.lineHeightRatio,c,f),decoration:i.decoration,borderLineSizePx:e(u),hasBackground:!!d,useCIMAngleBehavior:i.useCIMAngleBehavior})}_hasGlyphs(t){return!!t&&("glyphs"===t.type?t.glyphs.length>0:t.runs.some(t=>t.glyphs.glyphs.length>0))}_getDefaultGlyphMetrics(t){if("glyphs"===t.type)return{sdfSize:t.sdfSize,sdfRadius:t.sdfRadius};const[e]=t.runs;return{sdfSize:e?.glyphs.sdfSize??24,sdfRadius:e?.glyphs.sdfRadius??8}}_writeGlyphs(t,o,i,s,r,n,a,l,f=!0){const c=this.evaluatedMeshParams,h=this._textMeshTransformProps,d=e(h.fontSize),u=h.haloSize,m=h.outlineSize,p=e(h.offsetX),g=e(h.offsetY),S=this._getDefaultGlyphMetrics(c.glyphs),_=y(c.color),[z,b]=x(c.scaleInfo,this.getTileInfo());0!==n&&r.setRotation(n);const M=r.bounds,R=i+M.x+p,P=s+M.y-g,B=2*(c.minPixelBuffer?c.minPixelBuffer/d:1),G=Math.max(M.width,M.height)*B;r.textBox&&(t.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding),f&&t.recordBounds(R,P,G,G),this._writeTextBox(t,o,i,s,r.textBox,a,l),t.recordEnd());for(const e of r.glyphs){t.recordStart(this.instanceId,this.attributeLayout,e.textureBinding),f&&t.recordBounds(R,P,G,G);const{texcoords:r,offsets:n}=e,c=e.fontSize??d;this._writeQuad(t,o,i,s,{texcoords:r,offsets:n,fontSize:c,haloSize:u,outlineSize:m,sdfSize:S.sdfSize,sdfRadius:S.sdfRadius,color:e.color?y(e.color):_,isBackground:!1,referenceBounds:a,minZoom:z,maxZoom:b,...l}),t.recordEnd()}0!==n&&r.setRotation(-n)}_writeGlyph(t,o,i,s,r,n,a,l,f,c=!0){const h=this.evaluatedMeshParams,d=this._textMeshTransformProps,u=e(d.fontSize),m=d.haloSize,p=d.outlineSize,g=e(d.offsetX),x=e(d.offsetY),S=this._getDefaultGlyphMetrics(h.glyphs),_=y(h.color);0!==a&&r.setRotation(a);const z=r.bounds,b=i+z.x+g,M=s+z.y-x,R=2*(h.minPixelBuffer?h.minPixelBuffer/u:1),P=Math.max(z.width,z.height)*R,B=r.glyphs[n];t.recordStart(this.instanceId,this.attributeLayout,B.textureBinding),c&&t.recordBounds(b,M,P,P);const{texcoords:G,offsets:L}=B,k=B.fontSize??u;this._writeQuad(t,o,i,s,{texcoords:G,offsets:L,fontSize:k,haloSize:m,outlineSize:p,sdfSize:S.sdfSize,sdfRadius:S.sdfRadius,color:B.color?y(B.color):_,isBackground:!1,referenceBounds:l,minZoom:0,maxZoom:30,...f}),t.recordEnd(),0!==a&&r.setRotation(-a)}_writeTextBox(t,e,o,i,s,r,n){const a=this.evaluatedMeshParams,{fontSize:l,haloSize:f,outlineSize:c}=this._textMeshTransformProps,{backgroundColor:h,borderLineColor:d,borderLineSize:u}=U(a),{sdfSize:m,sdfRadius:p}=this._getDefaultGlyphMetrics(a.glyphs),g=!!d&&u>0,x={isBackground:!0,fontSize:l,haloSize:f,outlineSize:c,referenceBounds:r,sdfSize:m,sdfRadius:p,...n};h&&(this._writeQuad(t,e,o,i,{texcoords:L,offsets:s.main,color:y(h),...x}),g||(this._writeQuad(t,e,o,i,{texcoords:w,offsets:s.top,color:y(h),...x}),this._writeQuad(t,e,o,i,{texcoords:I,offsets:s.bot,color:y(h),...x}),this._writeQuad(t,e,o,i,{texcoords:D,offsets:s.left,color:y(h),...x}),this._writeQuad(t,e,o,i,{texcoords:N,offsets:s.right,color:y(h),...x}))),g&&(this._writeQuad(t,e,o,i,{texcoords:A,offsets:s.top,color:y(d),...x}),this._writeQuad(t,e,o,i,{texcoords:A,offsets:s.bot,color:y(d),...x}),this._writeQuad(t,e,o,i,{texcoords:E,offsets:s.left,color:y(d),...x}),this._writeQuad(t,e,o,i,{texcoords:E,offsets:s.right,color:y(d),...x}))}_writeQuad(t,e,o,i,s){const r=t.vertexCount();this._writeVertex(t,e,o,i,s),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}}const O=t=>Math.round(t*m);export{Y as TextMeshWriter,H as TextVertexSpec,U as getTextBoxStyle,P as maxLabelZoom};
2
+ import{clamp as t}from"../../../../../../../core/mathUtils.js";import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as o}from"../../../../../../../geometry/GeometryCursor.js";import{asCIMGeometryCursor as i}from"../../../../../../../symbols/cim/utils.js";import{CIMMarkerPlacementHelper as s}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{getXDirection as r,getYDirection as n}from"../../../alignmentUtils.js";import{labelU16ZoomPrecisionFactor as a,maxLineHeightRatio as l,minLineHeightRatio as f,labelPlacementOffsetPadding as c,maxTextLineWidth as h,minTextLineWidth as d,magicLabelLineHeight as u,packDegreesU8 as m}from"../../../definitions.js";import{shapeTextResource as p,shapeTextResourceForMultipoint as g}from"../../../mesh/templates/shapingUtils.js";import{processColorInput as y,getMinMaxZoom as x,packBitset as S}from"../fill/meshWriterUtils.js";import{MeshWriter as _}from"../mesh/MeshWriter.js";import{bitsetTextIsBackground as z,bitsetTextIsMapAligned as b}from"../shaders/constants.js";import{TextMeshTransformProps as P}from"./TextParams.js";import{DataType as M}from"../../../../../../webgl/enums.js";const R=28,G=[4,4],T=[16,4],B={topLeft:T,topRight:T,bottomLeft:T,bottomRight:T};function L(o){return null==o?h:t(e(o),d,h)}function C(e,o){return e/24*u*t(o,f,l)}const k=[4,2],v=[4,6],A={topLeft:k,topRight:k,bottomLeft:v,bottomRight:v},E={topLeft:k,topRight:v,bottomLeft:k,bottomRight:v},I={topLeft:v,topRight:v,bottomLeft:G,bottomRight:G},w={topLeft:G,topRight:G,bottomLeft:v,bottomRight:v},D={topLeft:v,topRight:G,bottomLeft:v,bottomRight:G},N={topLeft:G,topRight:v,bottomLeft:G,bottomRight:v};function U(t){return t.useBackgroundCallout?{backgroundColor:null,borderLineColor:null,borderLineSize:0}:{backgroundColor:t.boxBackgroundColor??t.backgroundColor??null,borderLineColor:t.boxBorderLineColor??t.borderLineColor??null,borderLineSize:t.boxBorderLineSize>0?t.boxBorderLineSize:t.borderLineWidth??0}}const H={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:M.UNSIGNED_SHORT,count:2,packPrecisionFactor:a,packTessellation:({minZoom:t,maxZoom:e})=>[t||0,e||R]},clipAngle:{type:M.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:t})=>O(t||0)},referenceSymbol:{type:M.BYTE,count:4,packTessellation:(t,o)=>{const i=t.isLineLabel||!t.referenceBounds,s=r(i?"center":o.horizontalAlignment),a=n(i?"middle":o.verticalAlignment),{offsetX:l,offsetY:f,size:c}=i?{offsetX:0,offsetY:0,size:0}:t.referenceBounds;return[e(l),-e(f),Math.round(e(c)),s+1<<2|a+1]}}},attributes:{pos:{type:M.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:M.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:M.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:t,mapAligned:e})=>S([[z,t],[b,!!e]])},offset:{type:M.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:t})=>{const{bottomLeft:e,bottomRight:o,topLeft:i,topRight:s}=t;return[i,s,e,o]}}},textureUV:{type:M.UNSIGNED_SHORT,count:2,packAlternating:{count:4,packTessellation:({texcoords:t})=>{const{bottomLeft:e,bottomRight:o,topLeft:i,topRight:s}=t;return[i,s,e,o]}}},color:{type:M.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:t})=>t},fontAndReferenceSize:{type:M.UNSIGNED_SHORT,count:4,packPrecisionFactor:4,packTessellation:({fontSize:t,sdfSize:o,sdfRadius:i},{referenceSize:s})=>[Math.round(e(t)),Math.round(e(s||t)),o,i]},outlineColor:{type:M.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>y(t)},haloColor:{type:M.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:t})=>y(t)},outlineAndHaloSize:{type:M.UNSIGNED_SHORT,count:2,packPrecisionFactor:4,packTessellation:({outlineSize:t,haloSize:o})=>[Math.round(e(t)),Math.round(e(o))]}}};class Y extends _{constructor(){super(...arguments),this.calloutRecordsUseLabelPhase=!1,this.vertexSpec=H,this._textMeshParamsPropsInitialized=!1,this._calloutEffectGeometry=null}getCalloutEffectGeometry({target:t}){if("esriGeometryPoint"!==t.geometryType&&"esriGeometryMultipoint"!==t.geometryType)return this._calloutEffectGeometry;const e=t.readGeometryForDisplay();return e&&t.geometryType?o.fromOptimizedCIM(e.clone(),t.geometryType):null}getCalloutRotation(){return this._textMeshParamsPropsInitialized?this._textMeshTransformProps.postAngle:null}ensurePacked(t,e,o){this._calloutEffectGeometry=null,super.ensurePacked(t,e,o),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new P(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}getLocalCalloutReferenceInfo(){return this._createLocalCalloutReferenceInfo(this._getShaping(),void 0,!0,!0)}_createLocalCalloutReferenceInfo(t,o,i=!1,s=!1){if(!t)return;const r=t.boundsT,n=s?t.bounds:r,[a,l]=o?this._getReferenceSymbolOffset(o):[0,0],f=s?e(this._textMeshTransformProps.offsetX):0,c=s?e(this._textMeshTransformProps.offsetY):0,h={xmin:r.xmin,ymin:-r.ymax,xmax:r.xmax,ymax:-r.ymin};return{anchor:{x:0,y:0},bodyBounds:{xmin:n.xmin+a+f,ymin:-n.ymax-l+c,xmax:n.xmax+a+f,ymax:-n.ymin-l+c},collisionBodyBounds:h,...i?{bodyBoundsUseReferenceScale:!0}:null}}_getReferenceSymbolOffset(t){const o=e(t.size)/2+c;return[e(t.offsetX)+r(this.evaluatedMeshParams.horizontalAlignment)*o,-e(t.offsetY)+n(this.evaluatedMeshParams.verticalAlignment)*o]}_write(t,{target:e,effect:o}){this._calloutEffectGeometry=null;const s=o?.geometry,r=this._getShaping();if(!r)return;const n=1===this.evaluatedMeshParams.alignment,a=e.getDisplayId(),{placement:l}=this.evaluatedMeshParams;if(null!=l){if("PrivatePlacementMultipoint"!==l.type)this._writePlacedTextMarkers(t,e,r,i(s));else{const o=this._getMultipointShaping();o&&this._writeMultipointText(t,e,o,i(s))}return}if(s?.nextPath())return s.nextPoint(),this._setCalloutEffectGeometry(s.x,s.y),this._writeGlyphs(t,a,s.x,s.y,r,0,void 0,{mapAligned:n});if("esriGeometryPolygon"===e.geometryType){const o=e.readCentroidForDisplay();if(!o)return;const[i,s]=o.coords;return this._setCalloutEffectGeometry(i,s),this._writeGlyphs(t,a,i,s,r,0,void 0,{mapAligned:n})}if("esriGeometryMultipoint"===e.geometryType){const o=e.readGeometryForDisplay();return void o?.forEachVertex((e,o)=>{this._setCalloutEffectGeometry(e,o),this._writeGlyphs(t,a,e,o,r,0,void 0,{mapAligned:n})})}const f=e.readXForDisplay(),c=e.readYForDisplay();return this._setCalloutEffectGeometry(f,c),this._writeGlyphs(t,a,f,c,r,0,void 0,{mapAligned:n})}_writePlacedTextMarkers(t,i,r,n){const a=n??o.fromFeatureSetReaderCIM(i);if(!a)return;const l=-1,f=s.getPlacement(a,l,this.evaluatedMeshParams.placement,e(1),t.id);if(!f)return;const c=i.getDisplayId();let h=f.next();for(;null!=h;){const e=-h.getAngle(),o=h.tx,i=-h.ty;this._setCalloutEffectGeometry(o,i),this._writeGlyphs(t,c,o,i,r,e,void 0,{mapAligned:1===this.evaluatedMeshParams.alignment}),h=f.next()}}_writeMultipointText(t,i,r,n){const a=n??o.fromFeatureSetReaderCIM(i);if(!a)return;const l=-1,f=s.getPlacement(a,l,this.evaluatedMeshParams.placement,e(1),t.id);if(!f)return;const c=i.getDisplayId();let h=f.next(),d=0;for(;null!=h;){const e=h.tx,o=-h.ty,i=-h.getAngle();if(this._setCalloutEffectGeometry(e,o),d>=r.glyphs.length)break;this._writeGlyph(t,c,e,o,r,d,i,void 0,{mapAligned:1===this.evaluatedMeshParams.alignment}),h=f.next(),d++}}_setCalloutEffectGeometry(t,e){this._calloutEffectGeometry??=o.fromJSON({x:t,y:e})}_getShaping(o){const i=this._textMeshTransformProps,s=this.evaluatedMeshParams;if(!this._hasGlyphs(s.glyphs))return null;const r=e(i.fontSize),n=e(i.offsetX),a=e(i.offsetY),{sdfSize:c}=this._getDefaultGlyphMetrics(s.glyphs),h=L(s.lineWidth),d=C(c,s.lineHeightRatio),{backgroundColor:u,borderLineSize:m}=U(s);return p(s.glyphs,{scale:r/c,angle:i.postAngle,xOffset:n,yOffset:a,horizontalAlignment:s.horizontalAlignment,verticalAlignment:o||s.verticalAlignment,maxLineWidth:h,lineHeight:d,lineHeightRatio:t(s.lineHeightRatio,f,l),decoration:s.decoration,borderLineSizePx:e(m),hasBackground:!!u,useCIMAngleBehavior:s.useCIMAngleBehavior})}_getMultipointShaping(){const o=this._textMeshTransformProps,i=this.evaluatedMeshParams;if(!this._hasGlyphs(i.glyphs))return null;const s=e(o.fontSize),r=e(o.offsetX),n=e(o.offsetY),{sdfSize:a}=this._getDefaultGlyphMetrics(i.glyphs),c=L(i.lineWidth),h=C(a,i.lineHeightRatio),{backgroundColor:d,borderLineSize:u}=U(i);return g(i.glyphs,{scale:s/a,angle:o.postAngle,xOffset:r,yOffset:n,horizontalAlignment:i.horizontalAlignment,verticalAlignment:i.verticalAlignment,maxLineWidth:c,lineHeight:h,lineHeightRatio:t(i.lineHeightRatio,f,l),decoration:i.decoration,borderLineSizePx:e(u),hasBackground:!!d,useCIMAngleBehavior:i.useCIMAngleBehavior})}_hasGlyphs(t){return!!t&&("glyphs"===t.type?t.glyphs.length>0:t.runs.some(t=>t.glyphs.glyphs.length>0))}_getDefaultGlyphMetrics(t){if("glyphs"===t.type)return{sdfSize:t.sdfSize,sdfRadius:t.sdfRadius,sdfPadding:t.sdfPadding};const[e]=t.runs;return{sdfSize:e?.glyphs.sdfSize??24,sdfRadius:e?.glyphs.sdfRadius??8,sdfPadding:e?.glyphs.sdfPadding??3}}_writeGlyphs(t,o,i,s,r,n,a,l,f=!0){const c=this.evaluatedMeshParams,h=this._textMeshTransformProps,d=e(h.fontSize),u=h.haloSize,m=h.outlineSize,p=e(h.offsetX),g=e(h.offsetY),S=this._getDefaultGlyphMetrics(c.glyphs),_=y(c.color),[z,b]=x(c.scaleInfo,this.getTileInfo());0!==n&&r.setRotation(n);const P=r.bounds,M=i+P.x+p,R=s+P.y-g,G=2*(c.minPixelBuffer?c.minPixelBuffer/d:1),T=Math.max(P.width,P.height)*G;r.textBox&&(t.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding),f&&t.recordBounds(M,R,T,T),this._writeTextBox(t,o,i,s,r.textBox,a,l),t.recordEnd());for(const e of r.glyphs){t.recordStart(this.instanceId,this.attributeLayout,e.textureBinding),f&&t.recordBounds(M,R,T,T);const{texcoords:r,offsets:n}=e,c=e.fontSize??d;this._writeQuad(t,o,i,s,{texcoords:r,offsets:n,fontSize:c,haloSize:u,outlineSize:m,sdfSize:S.sdfSize,sdfRadius:S.sdfRadius,color:e.color?y(e.color):_,isBackground:!1,referenceBounds:a,minZoom:z,maxZoom:b,...l}),t.recordEnd()}0!==n&&r.setRotation(-n)}_writeGlyph(t,o,i,s,r,n,a,l,f,c=!0){const h=this.evaluatedMeshParams,d=this._textMeshTransformProps,u=e(d.fontSize),m=d.haloSize,p=d.outlineSize,g=e(d.offsetX),x=e(d.offsetY),S=this._getDefaultGlyphMetrics(h.glyphs),_=y(h.color);0!==a&&r.setRotation(a);const z=r.bounds,b=i+z.x+g,P=s+z.y-x,M=2*(h.minPixelBuffer?h.minPixelBuffer/u:1),R=Math.max(z.width,z.height)*M,G=r.glyphs[n];t.recordStart(this.instanceId,this.attributeLayout,G.textureBinding),c&&t.recordBounds(b,P,R,R);const{texcoords:T,offsets:B}=G,L=G.fontSize??u;this._writeQuad(t,o,i,s,{texcoords:T,offsets:B,fontSize:L,haloSize:m,outlineSize:p,sdfSize:S.sdfSize,sdfRadius:S.sdfRadius,color:G.color?y(G.color):_,isBackground:!1,referenceBounds:l,minZoom:0,maxZoom:30,...f}),t.recordEnd(),0!==a&&r.setRotation(-a)}_writeTextBox(t,e,o,i,s,r,n){const a=this.evaluatedMeshParams,{fontSize:l,haloSize:f,outlineSize:c}=this._textMeshTransformProps,{backgroundColor:h,borderLineColor:d,borderLineSize:u}=U(a),{sdfSize:m,sdfRadius:p}=this._getDefaultGlyphMetrics(a.glyphs),g=!!d&&u>0,x={isBackground:!0,fontSize:l,haloSize:f,outlineSize:c,referenceBounds:r,sdfSize:m,sdfRadius:p,...n};h&&(this._writeQuad(t,e,o,i,{texcoords:B,offsets:s.main,color:y(h),...x}),g||(this._writeQuad(t,e,o,i,{texcoords:I,offsets:s.top,color:y(h),...x}),this._writeQuad(t,e,o,i,{texcoords:w,offsets:s.bot,color:y(h),...x}),this._writeQuad(t,e,o,i,{texcoords:D,offsets:s.left,color:y(h),...x}),this._writeQuad(t,e,o,i,{texcoords:N,offsets:s.right,color:y(h),...x}))),g&&(this._writeQuad(t,e,o,i,{texcoords:A,offsets:s.top,color:y(d),...x}),this._writeQuad(t,e,o,i,{texcoords:A,offsets:s.bot,color:y(d),...x}),this._writeQuad(t,e,o,i,{texcoords:E,offsets:s.left,color:y(d),...x}),this._writeQuad(t,e,o,i,{texcoords:E,offsets:s.right,color:y(d),...x}))}_writeQuad(t,e,o,i,s){const r=t.vertexCount();this._writeVertex(t,e,o,i,s),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}}const O=t=>Math.round(t*m);export{Y as TextMeshWriter,H as TextVertexSpec,U as getTextBoxStyle,R as maxLabelZoom};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{OverrideHelper as t}from"../../../../../symbols/cim/OverrideHelper.js";import{FeatureMatcher as r,combineMeshWriterGroups as o}from"./Matcher.js";import{getCIMSymbols as s,getCIMSymbol as n}from"../../../layers/support/annodime/cimAnnotations.js";import{createDebugWriters as i}from"../../../layers/support/annodime/debugUtils.js";import{createAnnotationMatcherFeatureInfo as l,mixFeature as m}from"../../../layers/support/annodime/MatcherGeometryOverride.js";import{createTileObjectId as c}from"../../../layers/support/annodime/TileObjectId.js";import{hasSymbolFields as a,symbolFields as y}from"../../../layers/support/annodime/virtualFields.js";class u extends r{constructor(e,t){super(),this._context=e,this._symbolCollection=t,this._meshWriters=new Map,this._matcherGeometryOverrides=new Map,this._symbols=s(t)}static async fromAnnotationSchema(e,t){return new u(e,t.symbolCollection)}hasArcadeDependency(){return!1}doMatch(e,t,r){return this._meshWriters.get(c(r,e.getObjectId()))}async fetchResources(e,t,r,o){this._meshWriters.clear(),this._matcherGeometryOverrides.clear();const s=t.getCursor();for(;s.next();){const r=l(s);if(!r)continue;const n=m(s,r);if(!n)continue;const i=await this._createSymbolReference(s,n,r);if(!i)continue;const a=c(o,s.getObjectId());let y=this._meshWriters.get(a);y||(y=await this._createGroup(i,e,t.geometryType),this._meshWriters.set(a,y)),this._matcherGeometryOverrides.set(a,r.geometryOverride)}}async _createGroup(e,t,r){const s=await t.fetchMeshResourceImmediate({type:"mesh-request",symbolReference:e}),n=await b(this._context,s?.meshes||[]);if(has("esri-2d-annotation-dimension-debug")){const e=await i(this._context,t,r);return e.writers.length?o(n,e):n}return n}async _createSymbolReference(e,r,o){const s=this._getUnresolvedSymbolReference(o);if(!s)return null;p(s);const n=await t.resolveSymbolOverrides(s,r,e.metadata.outSpatialReference,null,e.geometryType);return n?{type:"CIMSymbolReference",symbol:n}:null}_getUnresolvedSymbolReference(t){const{annotationGraphic:r,annotationGeometryType:o}=t,{bloated:s,symbolID:n}=r;if(s||a(r))return this._getProcessedSymbolReference(t);if(null!=n){const t=this._symbols[n][o];return t?e(t.data):null}return null}_getProcessedSymbolReference(e){const{annotationGraphic:t,annotationGeometryType:r}=e,{bloated:o,symbol:s,symbolID:i}=t;let l=this._getRawSymbolReference(s,i);if(!l||!l.symbol)return null;if(o||(l=this._applySymbolFields(l,t)),!l.symbol||"CIMTextSymbol"!==l.symbol.type)return null;const{data:m}=n(l.symbol,r);return{type:"CIMSymbolReference",symbol:m.symbol,primitiveOverrides:[...l.primitiveOverrides||[],...m.primitiveOverrides||[]]}}_getRawSymbolReference(e,t){if(e&&null!=e.symbol&&"CIMTextSymbol"===e.symbol.type)return e;if(null!=t){const e=this._symbolCollection.find(e=>(e.iD??0)===t);if(e)return{type:"CIMSymbolReference",symbol:e.symbol}}return null}_applySymbolFields(t,r){if(!t.symbol||"CIMTextSymbol"!==t.symbol.type)return t;const o=e(t.symbol);for(const e of y)e.setOnSymbol(o,r);return{type:"CIMSymbolReference",symbol:o,primitiveOverrides:t.primitiveOverrides}}cleanup(e,t,r){const o=t.getObjectId(),s=c(r,o);this._matcherGeometryOverrides.delete(s),this._meshWriters.delete(s)}getMatcherGeometryOverride(e){return this._matcherGeometryOverrides.get(e)??null}getCalloutAnchor(e,t){return this._matcherGeometryOverrides.get(c(t,e.getObjectId()))?.absoluteCalloutAnchor??null}}function b(e,t){const r=t.map(e=>({...e}));return e.createMeshWriters(r)}function h(e){return e}function p(e){if(!e.symbol||!("symbolLayers"in e.symbol))return;const t=h({type:"PrivateMatcherGeometryOverrideEffect"});e.symbol.symbolLayers=(e.symbol.symbolLayers||[]).map(e=>({...e,effects:[t,...e.effects||[]]}))}export{u as AnnotationMatcher};
2
+ import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{OverrideHelper as t}from"../../../../../symbols/cim/OverrideHelper.js";import{FeatureMatcher as r,combineMeshWriterGroups as s}from"./Matcher.js";import{getCIMSymbols as o,getCIMSymbol as n}from"../../../layers/support/annodime/cimAnnotations.js";import{createDebugWriters as i}from"../../../layers/support/annodime/debugUtils.js";import{createAnnotationMatcherFeatureInfo as m,mixFeature as l}from"../../../layers/support/annodime/MatcherGeometryOverride.js";import{createTileObjectId as c}from"../../../layers/support/annodime/TileObjectId.js";import{hasSymbolFields as y,symbolFields as a}from"../../../layers/support/annodime/virtualFields.js";class b extends r{constructor(e,t){super(),this._context=e,this._symbolCollection=t,this._meshWriters=new Map,this._matcherGeometryOverrides=new Map,this._symbols=o(t)}static async fromAnnotationSchema(e,t){return new b(e,t.symbolCollection)}hasArcadeDependency(){return!1}doMatch(e,t,r){return this._meshWriters.get(c(r,e.getObjectId()))}async fetchResources(e,t,r,s){this._meshWriters.clear(),this._matcherGeometryOverrides.clear();const o=t.getCursor();for(;o.next();){const r=m(o);if(!r)continue;const n=l(o,r);if(!n)continue;const i=await this._createSymbolReference(o,n,r);if(!i)continue;const y=c(s,o.getObjectId());let a=this._meshWriters.get(y);a||(a=await this._createGroup(i,e,t.geometryType),this._meshWriters.set(y,a)),this._matcherGeometryOverrides.set(y,r.geometryOverride)}}async _createGroup(e,t,r){const o=await t.fetchMeshResourceImmediate({type:"mesh-request",symbolReference:e}),n=await u(this._context,o?.meshes||[]);if(has("esri-2d-annotation-dimension-debug")){const e=await i(this._context,t,r);return e.writers.length?s(n,e):n}return n}async _createSymbolReference(e,r,s){const o=this._getUnresolvedSymbolReference(s);if(!o)return null;f(o);const n=await t.resolveSymbolOverrides(o,r,e.metadata.outSpatialReference,null,e.geometryType);return n?{type:"CIMSymbolReference",symbol:n}:null}_getUnresolvedSymbolReference(t){const{annotationGraphic:r,annotationGeometryType:s}=t,{bloated:o,symbolID:n}=r;if(o||y(r))return this._getProcessedSymbolReference(t);if(null!=n){const t=this._symbols[n][s];return t?e(t.data):null}return null}_getProcessedSymbolReference(e){const{annotationGraphic:t,annotationGeometryType:r}=e,{bloated:s,symbol:o,symbolID:i}=t;let m=this._getRawSymbolReference(o,i);if(!m||!m.symbol)return null;if(s||(m=this._applySymbolFields(m,t)),!m.symbol||"CIMTextSymbol"!==m.symbol.type)return null;const{data:l}=n(m.symbol,r);return{type:"CIMSymbolReference",symbol:l.symbol,primitiveOverrides:[...m.primitiveOverrides||[],...l.primitiveOverrides||[]]}}_getRawSymbolReference(e,t){if(e&&null!=e.symbol&&"CIMTextSymbol"===e.symbol.type)return e;if(null!=t){const e=this._symbolCollection.find(e=>(e.iD??0)===t);if(e)return{type:"CIMSymbolReference",symbol:e.symbol}}return null}_applySymbolFields(t,r){if(!t.symbol||"CIMTextSymbol"!==t.symbol.type)return t;const s=e(t.symbol);for(const e of a)e.setOnSymbol(s,r);return{type:"CIMSymbolReference",symbol:s,primitiveOverrides:t.primitiveOverrides}}cleanup(e,t,r){const s=t.getObjectId(),o=c(r,s);this._matcherGeometryOverrides.delete(o),this._meshWriters.delete(o)}getMatcherGeometryOverride(e){return this._matcherGeometryOverrides.get(e)??null}}function u(e,t){const r=t.map(e=>({...e}));return e.createMeshWriters(r)}function p(e){return e}function f(e){if(!e.symbol||!("symbolLayers"in e.symbol))return;const t=p({type:"PrivateMatcherGeometryOverrideEffect"});e.symbol.symbolLayers=(e.symbol.symbolLayers||[]).map(e=>({...e,effects:[t,...e.effects||[]]}))}export{b as AnnotationMatcher};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- function e(e,t){if(e.length!==t.length)throw new Error("InternalError: mesh writer schemas and writers must have matching lengths");const n=new Map;for(let r=0;r<t.length;r++){const s=e[r];for(const e of t[r].references?.exports??[]){if(n.has(e)){if("label-reference-symbol"===e)continue;throw new Error(`InternalError: multiple mesh writers export the "${e}" reference type`)}n.set(e,s)}}const s=new Map;let o=!1;for(let l=0;l<t.length;l++){const i=e[l],c=[...(t[l].references?.dependencies??[]).map(e=>r(e,n)),...(t[l].references?.externalDependencies??[]).map(e=>({type:e,external:!0}))];s.set(i,c),o||=c.length>0}return{writers:e,dependencies:s,exports:n,requiresCoordination:o}}function t(...e){const t=[],r=new Map,n=new Map;let s=!1;for(const o of e){t.push(...o.writers),s||=o.requiresCoordination;for(const[e,t]of o.dependencies)r.set(e,t);for(const[e,t]of o.exports){if(n.has(e)){if("label-reference-symbol"===e)continue;throw new Error(`InternalError: multiple mesh writer groups export the "${e}" reference type`)}n.set(e,t)}}return{writers:t,dependencies:r,exports:n,requiresCoordination:s}}function r(e,t){const r=t.get(e);if(!r)throw new Error(`InternalError: no mesh writer exports the "${e}" reference type`);return{type:e,writer:r,external:!1}}class n{constructor(){this._defaultResult=null,this._backgroundFillResult=null}static async from(e,t){const r=new n;return r.setDefault(await e.createMeshWriters(t.meshes)),r}size(){return 1}getDefault(){return this._defaultResult}setDefault(e){this._defaultResult=e}getBackgroundFill(){return this._backgroundFillResult}setBackgroundFill(e){this._backgroundFillResult=e}hasArcadeDependency(e){return this._defaultResult?.writers.some(t=>t.hasArcadeDependency(e))??!1}match(e,r,n,s){const o=this.doMatch(e,r,s)||this.getDefault();if(o&&o.writers.length>0){const e=this.getBackgroundFill();if(e)return t(e,o)}return o}matchGroups(e,t,r,n){const s=this.match(e,t,r,n);return s?[s]:[]}cleanup(e,t,r,n,s){}getSortKey(e,t){return 0}getCalloutAnchor(e,t){return null}doMatch(e,t,r){return null}async fetchResources(e,t,r,n){}}export{n as FeatureMatcher,t as combineMeshWriterGroups,e as createMeshWriterGroup};
2
+ function e(e,t){if(e.length!==t.length)throw new Error("InternalError: mesh writer schemas and writers must have matching lengths");const n=new Map;for(let r=0;r<t.length;r++){const s=e[r];for(const e of t[r].references?.exports??[]){if(n.has(e)){if("label-reference-symbol"===e)continue;throw new Error(`InternalError: multiple mesh writers export the "${e}" reference type`)}n.set(e,s)}}const s=new Map;let o=!1;for(let l=0;l<t.length;l++){const i=e[l],c=[...(t[l].references?.dependencies??[]).map(e=>r(e,n)),...(t[l].references?.externalDependencies??[]).map(e=>({type:e,external:!0}))];s.set(i,c),o||=c.length>0}return{writers:e,dependencies:s,exports:n,requiresCoordination:o}}function t(...e){const t=[],r=new Map,n=new Map;let s=!1;for(const o of e){t.push(...o.writers),s||=o.requiresCoordination;for(const[e,t]of o.dependencies)r.set(e,t);for(const[e,t]of o.exports){if(n.has(e)){if("label-reference-symbol"===e)continue;throw new Error(`InternalError: multiple mesh writer groups export the "${e}" reference type`)}n.set(e,t)}}return{writers:t,dependencies:r,exports:n,requiresCoordination:s}}function r(e,t){const r=t.get(e);if(!r)throw new Error(`InternalError: no mesh writer exports the "${e}" reference type`);return{type:e,writer:r,external:!1}}class n{constructor(){this._defaultResult=null,this._backgroundFillResult=null}static async from(e,t){const r=new n;return r.setDefault(await e.createMeshWriters(t.meshes)),r}size(){return 1}getDefault(){return this._defaultResult}setDefault(e){this._defaultResult=e}getBackgroundFill(){return this._backgroundFillResult}setBackgroundFill(e){this._backgroundFillResult=e}hasArcadeDependency(e){return this._defaultResult?.writers.some(t=>t.hasArcadeDependency(e))??!1}match(e,r,n,s){const o=this.doMatch(e,r,s)||this.getDefault();if(o&&o.writers.length>0){const e=this.getBackgroundFill();if(e)return t(e,o)}return o}matchGroups(e,t,r,n){const s=this.match(e,t,r,n);return s?[s]:[]}cleanup(e,t,r,n,s){}getSortKey(e,t){return 0}doMatch(e,t,r){return null}async fetchResources(e,t,r,n){}}export{n as FeatureMatcher,t as combineMeshWriterGroups,e as createMeshWriterGroup};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{referenceSetter as i}from"../../../core/collectionUtils.js";import{deprecatedFunction as s}from"../../../core/deprecate.js";import r from"../../../core/Error.js";import"../../../core/has.js";import h from"../../../core/Logger.js";import{watch as o,syncAndInitial as a,sync as n}from"../../../core/reactiveUtils.js";import{property as l,subclass as p}from"../../../core/accessorSupport/decorators.js";import{isLinkChartView as c}from"../../../linkChart/guards.js";import{Container as g}from"../engine/Container.js";import{ClipMesh as d}from"../engine/webgl/ClipMesh.js";import{maxHighlightGroups as u}from"../engine/webgl/definitions.js";import{HighlightRegistry as f}from"./support/HighlightRegistry.js";import{createOrReuseHighlightGradient as m}from"./support/util.js";import y from"../../layers/support/ClipRect.js";import v from"../../layers/support/GeometryClipArea.js";import w from"../../layers/support/Path.js";import{defaultHighlightName as R}from"../../support/HighlightDefaults.js";import _ from"../../support/HighlightOptions.js";import{isInEffectiveScaleRange as S}from"../../support/layerViewUtils.js";const H=t.ofType({key:"type",base:null,typeMap:{rect:y,path:w,geometry:v}}),b=new(t.ofType(_)),j=y=>{const v=y;let w=class extends v{constructor(){super(...arguments),this._highlightRegistry=new f,this.attached=!1,this.clips=new H,this.highlights=null,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this._visibleAtCurrentScale=!0}initialize(){const e=this.view?.spatialReferenceLocked??!0,t=this.view?.spatialReference;t&&e&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new r("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new g),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([o(()=>this.suspended,e=>{this.container&&(this.container.visible=!e)},a),o(()=>this.updateSuspended,e=>{this.view&&!e&&this.updateRequested&&this.view.requestUpdate()},a),o(()=>this.layer?.opacity??1,e=>{this.container&&(this.container.opacity=e)},a),o(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",e=>{this.container&&(this.container.blendMode=e)},a),o(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,e=>{this.container&&(this.container.effect=e)},a),o(()=>this._effectiveHighlightOptions.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{this.container.highlightGradient=m(this.container.highlightGradient,this._effectiveHighlightOptions.items)},a),o(()=>this._getHighlightFilterGroups(),()=>this._onHighlightChange(),n),o(()=>this.clips.map(e=>e.version),async()=>{if(this.container&&this.view?.spatialReference){const e=this.view.spatialReference,t=await this._updatingHandles.addPromise(Promise.all(this.clips.items.map(t=>d.create(t,e))));for(const i of this.container.clips)i.destroy();this.container.clips=t.filter(e=>!!e)}},a),o(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:e,scaleRange:t})=>{const i=S(t,e);i!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=i)},a),o(()=>this.layer?.effectiveVisible,async e=>{this.container.requestDeclutter()})],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(e=>{e===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1;for(const e of this.container?.clips??[])e.destroy()}get highlightOptions(){return this._logHighlightOptionsDeprecation(),this.highlights?.find(({name:e})=>e===R)}set highlightOptions(e){if(this._logHighlightOptionsDeprecation(),!this.highlights){if(!e)return;this.highlights=new t([new _])}const i=this.highlights.find(({name:e})=>e===R);e?i?.assignFrom(e):(this.highlights.remove(i),0===this.highlights.length&&(this.highlights=null))}_logHighlightOptionsDeprecation(){s(h.getLogger(this),"`LayerView.highlightOptions` is deprecated in favor of View.highlights",{replacement:"View.highlights",version:"4.34",see:"https://arcg.is/inbTa1#highlights",warnOnce:!0})}get hasHighlight(){return this._highlightRegistry.size>0}get _effectiveHighlightOptions(){if(!this.view)return b;if(!this.highlights)return this.view.highlights;const e=this.view.highlights.clone();for(const t of this.highlights){const i=e.find(e=>e.name===t.name);i&&i.assignFrom(t)}return e}get highlightIds(){return this._highlightRegistry.highlightIds}get scheduler(){return this.view.scheduler}get spatialReferenceSupported(){const e=this.view?.spatialReference;return null==e||this.supportsSpatialReference(e)}get updating(){if(!this.spatialReferenceSupported)return!1;if(!this.attached)return!0;if(this.suspended)return!1;return this.updateRequested||this.isUpdating()||this._updatingHandles?.updating||this.container.transitioning}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(e){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",e),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(e))):this.updateRequested=!1}hitTest(e,t,i){return Promise.resolve(null)}supportsSpatialReference(e){return!0}canResume(){if(!this.spatialReferenceSupported)return!1;switch(this.layer?.type){case"link-chart":case"knowledge-graph-sublayer":case"graphics":break;default:if(c(this.view)&&!this.view.inGeographicLayout)return!1}return!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const e=super.getSuspendInfo(),t=!this.spatialReferenceSupported;return t&&(e.spatialReferenceNotSupported=t),e}addAttachHandles(e){this.addHandles(e,"attach")}_addHighlightFilter(e,t){return this._highlightRegistry.register(t,e)}_removeHighlight(e){this._highlightRegistry.unregister(e)}_onHighlightChange(){}_getHighlightFilterGroups(){const e=[];for(const{name:t,filters:i}of this._highlightRegistry.highlightGroups){const s=this._effectiveHighlightOptions.findIndex(e=>e.name===t);s<0||s>=u||e.push({order:s,filters:i})}return e}};return e([l()],w.prototype,"attached",void 0),e([l({type:H,set(e){const t=i(e,this._get("clips"),H);this._set("clips",t)}})],w.prototype,"clips",void 0),e([l()],w.prototype,"container",void 0),e([l({type:_})],w.prototype,"highlightOptions",null),e([l({type:t.ofType(_)})],w.prototype,"highlights",void 0),e([l()],w.prototype,"_effectiveHighlightOptions",null),e([l()],w.prototype,"moving",void 0),e([l({readOnly:!0})],w.prototype,"spatialReferenceSupported",null),e([l({readOnly:!0})],w.prototype,"updateParameters",void 0),e([l()],w.prototype,"updateRequested",void 0),e([l()],w.prototype,"updating",null),e([l()],w.prototype,"view",void 0),e([l()],w.prototype,"_visibleAtCurrentScale",void 0),e([l({readOnly:!0})],w.prototype,"visibleAtCurrentScale",null),w=e([p("esri.views.2d.layers.LayerView2D")],w),w};export{j as LayerView2D};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{referenceSetter as i}from"../../../core/collectionUtils.js";import{deprecatedFunction as s}from"../../../core/deprecate.js";import r from"../../../core/Error.js";import"../../../core/has.js";import h from"../../../core/Logger.js";import{watch as o,syncAndInitial as a,sync as n}from"../../../core/reactiveUtils.js";import{property as l,subclass as p}from"../../../core/accessorSupport/decorators.js";import{isLinkChartView as c}from"../../../linkChart/guards.js";import{Container as g}from"../engine/Container.js";import{ClipMesh as d}from"../engine/webgl/ClipMesh.js";import{maxHighlightGroups as u}from"../engine/webgl/definitions.js";import{HighlightRegistry as f}from"./support/HighlightRegistry.js";import{createOrReuseHighlightGradient as m}from"./support/util.js";import y from"../../layers/support/ClipRect.js";import v from"../../layers/support/GeometryClipArea.js";import w from"../../layers/support/Path.js";import{defaultHighlightName as R}from"../../support/HighlightDefaults.js";import _ from"../../support/HighlightOptions.js";import{isInEffectiveScaleRange as S}from"../../support/layerViewUtils.js";const H=t.ofType({key:"type",base:null,typeMap:{rect:y,path:w,geometry:v}}),b=new(t.ofType(_)),j=y=>{const v=y;let w=class extends v{constructor(){super(...arguments),this._highlightRegistry=new f,this.attached=!1,this.clips=new H,this.highlights=null,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this._visibleAtCurrentScale=!0}initialize(){const e=this.view?.spatialReferenceLocked??!0,t=this.view?.spatialReference;t&&e&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new r("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new g),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([o(()=>this.suspended,e=>{this.container&&(this.container.visible=!e)},a),o(()=>this.updateSuspended,e=>{this.view&&!e&&this.updateRequested&&this.view.requestUpdate()},a),o(()=>this.layer?.opacity??1,e=>{this.container&&(this.container.opacity=e)},a),o(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",e=>{this.container&&(this.container.blendMode=e)},a),o(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,e=>{this.container&&(this.container.effect=e)},a),o(()=>this._effectiveHighlightOptions.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{this.container.highlightGradient=m(this.container.highlightGradient,this._effectiveHighlightOptions.items)},a),o(()=>this._getHighlightFilterGroups(),()=>this._onHighlightChange(),n),o(()=>this.clips.map(e=>e.version),async()=>{if(this.container&&this.view?.spatialReference){const e=this.view.featuresTilingScheme,t=await this._updatingHandles.addPromise(Promise.all(this.clips.items.map(t=>d.create(t,e))));for(const i of this.container.clips)i.destroy();this.container.clips=t.filter(e=>!!e)}},a),o(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:e,scaleRange:t})=>{const i=S(t,e);i!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=i)},a),o(()=>this.layer?.effectiveVisible,async e=>{this.container.requestDeclutter()})],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(e=>{e===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1;for(const e of this.container?.clips??[])e.destroy()}get highlightOptions(){return this._logHighlightOptionsDeprecation(),this.highlights?.find(({name:e})=>e===R)}set highlightOptions(e){if(this._logHighlightOptionsDeprecation(),!this.highlights){if(!e)return;this.highlights=new t([new _])}const i=this.highlights.find(({name:e})=>e===R);e?i?.assignFrom(e):(this.highlights.remove(i),0===this.highlights.length&&(this.highlights=null))}_logHighlightOptionsDeprecation(){s(h.getLogger(this),"`LayerView.highlightOptions` is deprecated in favor of View.highlights",{replacement:"View.highlights",version:"4.34",see:"https://arcg.is/inbTa1#highlights",warnOnce:!0})}get hasHighlight(){return this._highlightRegistry.size>0}get _effectiveHighlightOptions(){if(!this.view)return b;if(!this.highlights)return this.view.highlights;const e=this.view.highlights.clone();for(const t of this.highlights){const i=e.find(e=>e.name===t.name);i&&i.assignFrom(t)}return e}get highlightIds(){return this._highlightRegistry.highlightIds}get scheduler(){return this.view.scheduler}get spatialReferenceSupported(){const e=this.view?.spatialReference;return null==e||this.supportsSpatialReference(e)}get updating(){if(!this.spatialReferenceSupported)return!1;if(!this.attached)return!0;if(this.suspended)return!1;return this.updateRequested||this.isUpdating()||this._updatingHandles?.updating||this.container.transitioning}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(e){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",e),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(e))):this.updateRequested=!1}hitTest(e,t,i){return Promise.resolve(null)}supportsSpatialReference(e){return!0}canResume(){if(!this.spatialReferenceSupported)return!1;switch(this.layer?.type){case"link-chart":case"knowledge-graph-sublayer":case"graphics":break;default:if(c(this.view)&&!this.view.inGeographicLayout)return!1}return!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const e=super.getSuspendInfo(),t=!this.spatialReferenceSupported;return t&&(e.spatialReferenceNotSupported=t),e}addAttachHandles(e){this.addHandles(e,"attach")}_addHighlightFilter(e,t){return this._highlightRegistry.register(t,e)}_removeHighlight(e){this._highlightRegistry.unregister(e)}_onHighlightChange(){}_getHighlightFilterGroups(){const e=[];for(const{name:t,filters:i}of this._highlightRegistry.highlightGroups){const s=this._effectiveHighlightOptions.findIndex(e=>e.name===t);s<0||s>=u||e.push({order:s,filters:i})}return e}};return e([l()],w.prototype,"attached",void 0),e([l({type:H,set(e){const t=i(e,this._get("clips"),H);this._set("clips",t)}})],w.prototype,"clips",void 0),e([l()],w.prototype,"container",void 0),e([l({type:_})],w.prototype,"highlightOptions",null),e([l({type:t.ofType(_)})],w.prototype,"highlights",void 0),e([l()],w.prototype,"_effectiveHighlightOptions",null),e([l()],w.prototype,"moving",void 0),e([l({readOnly:!0})],w.prototype,"spatialReferenceSupported",null),e([l({readOnly:!0})],w.prototype,"updateParameters",void 0),e([l()],w.prototype,"updateRequested",void 0),e([l()],w.prototype,"updating",null),e([l()],w.prototype,"view",void 0),e([l()],w.prototype,"_visibleAtCurrentScale",void 0),e([l({readOnly:!0})],w.prototype,"visibleAtCurrentScale",null),w=e([p("esri.views.2d.layers.LayerView2D")],w),w};export{j as LayerView2D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{rad2deg as e}from"../../../../../core/mathUtils.js";import t from"../../../../../geometry/Point.js";import{normalizeTransform as r,quantizeY as n,quantizeX as i}from"../../../../../geometry/support/quantizationUtils.js";import{convertToGeometry as o}from"../../../../../layers/graphics/featureConversionUtils.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{project as m}from"../../../../../layers/graphics/data/projectionSupport.js";import{DimensionRealFieldName as s,projectLinearDimensionPoints as u,normalizeExtensionAngle as y,angleFromXAxis as l}from"./dimensionUtils.js";import{getAttributeValue as p,parseElement as f,reprojectAndQuantize as c,quantizeYf as g,quantizeXf as d}from"./utils.js";import{featureFields as b}from"./virtualFields.js";function N(e){const t=e.readAttribute("element");if(!t)return null;const n=e.getInTransform()??e.getDisplayTransform();if(!n)throw new Error("Quantization transform is required to read annotation features.");if(!e.geometryType)return null;const i=e.metadata.outSpatialReference,o=e.metadata.attributeSpatialReference??e.metadata.spatialReference??i,a=r(n),m=f(t),{geometry:s}=m;if(!s)return null;const u=c(s,o,i,a);if(!u)return null;const y=h(m,o,i,a),l=T(m),p={annotationGeometryType:l,annotationGraphic:m,attributes:{},geometryOverride:{geometry:u,geometryType:g(l),absoluteCalloutAnchor:y}};for(const r of b)r.setOnFeature(p,m);function g(e){switch(e){case"line":return"esriGeometryPolyline";case"multipoint":return"esriGeometryMultipoint";case"point":return"esriGeometryPoint"}}return p}function h(e,r,n,i){const[o,a]=e.anchorPoint;if(!o?.trim()||!a?.trim())return;const s=Number(o),u=Number(a);if(!Number.isFinite(s)||!Number.isFinite(u))return;const y=m(new t({x:s,y:u,spatialReference:r}),r,n);return{x:d(i,y.x),y:g(i,y.y)}}function x(o){const f=o.getInTransform()??o.getDisplayTransform();if(!f)throw new Error("Quantization transform is required to read dimension features.");const c=o.geometryType;if(!c)return null;const g={...o.readAttributes()},d=o.metadata.outSpatialReference,b=o.metadata.attributeSpatialReference??o.metadata.spatialReference??d,N=r(f),h={x:Number(p(s.beginX,g)),y:Number(p(s.beginY,g)),spatialReference:b},x={x:Number(p(s.endX,g)),y:Number(p(s.endY,g)),spatialReference:b},w={x:Number(p(s.dimX,g)),y:Number(p(s.dimY,g)),spatialReference:b};if(isNaN(h.x)||isNaN(h.y)||isNaN(x.x)||isNaN(x.y))return console.error(`Feature with ${s.objectId}=${p(s.objectId,g)} is missing valid begin, end, or dimension points and will be skipped.`),null;(isNaN(w.x)||isNaN(w.y))&&(w.x=h.x,w.y=h.y);const T=m(new t(h),b,d),j=m(new t(x),b,d),R=m(new t(w),b,d),P=[T,j,R],_=j.x-T.x,E=j.y-T.y;let M=Math.PI/2;0!==_?M=Math.atan2(E,_):E<0&&(M=-Math.PI/2);let G=Math.sqrt(_*_+E*E);if(1===Number(p(s.dimType,g))){const e=u([T.x,T.y],[j.x,j.y],[R.x,R.y],y(p(s.extAngle,g)));if(e){const t=e.endDimensionPoint[0]-e.beginDimensionPoint[0],r=e.endDimensionPoint[1]-e.beginDimensionPoint[1];G=Math.sqrt(t*t+r*r),M=l([t,r])}}const I=p(s.textX,g),S=p(s.textY,g);if(null!=I&&null!=S){const e=new t({x:Number(I),y:Number(S),spatialReference:b}),r=m(e,b,d);P.push(r)}const D=P.map(e=>({x:i(N,e.x),y:n(N,e.y)})).flatMap(e=>[e.x,e.y]);return g.__SYSTEM_LENGTH__=G,g.__DIMENSION_ANGLE__=360-e(M),{attributes:g,geometryOverride:{geometry:new a([D.length],D),geometryType:c}}}function w(e,t){const{geometry:r,geometryType:n}=t.geometryOverride,i=o(r,n,!1,!1);return i?{attributes:{...e.readAttributes(),...t.attributes},centroid:null,geometry:i}:null}function T(e){if(e.geometry){if("custom-two-point"===e.geometry.type)return"line";if("custom-multipoint"===e.geometry.type)return"multipoint";if("geometry-bag"===e.geometry.type){if("custom-multipoint"===e.geometry.geometries[0].type)return"multipoint";throw new Error("Unable to determine geometry type from annotation graphic")}if("custom-point"===e.geometry.type)return"point";if("polyline"===e.geometry.type)return"line";if("point"===e.geometry.type)return"point";throw new Error("Unable to determine geometry type from annotation graphic")}throw new Error("Unable to determine geometry type from annotation graphic")}export{N as createAnnotationMatcherFeatureInfo,x as createDimensionMatcherFeatureInfo,T as getAnnotationGeometryType,w as mixFeature};
2
+ import{rad2deg as e}from"../../../../../core/mathUtils.js";import t from"../../../../../geometry/Point.js";import{normalizeTransform as r,quantizeY as n,quantizeX as i}from"../../../../../geometry/support/quantizationUtils.js";import{convertToGeometry as o}from"../../../../../layers/graphics/featureConversionUtils.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{project as m}from"../../../../../layers/graphics/data/projectionSupport.js";import{DimensionRealFieldName as s,projectLinearDimensionPoints as u,normalizeExtensionAngle as y,angleFromXAxis as p}from"./dimensionUtils.js";import{getAttributeValue as l,parseElement as f,reprojectAndQuantize as c,quantizeYf as g,quantizeXf as d}from"./utils.js";import{featureFields as b}from"./virtualFields.js";function N(e){const t=e.readAttribute("element");if(!t)return null;const n=e.getInTransform()??e.getDisplayTransform();if(!n)throw new Error("Quantization transform is required to read annotation features.");if(!e.geometryType)return null;const i=e.metadata.outSpatialReference,o=e.metadata.attributeSpatialReference??e.metadata.spatialReference??i,a=r(n),m=f(t),{geometry:s}=m;if(!s)return null;const u=c(s,o,i,a);if(!u)return null;const y=x(m,o,i,a),p=j(m),l={annotationGeometryType:p,annotationGraphic:m,attributes:{},geometryOverride:{geometry:u,geometryType:g(p),absoluteCalloutAnchor:y}};for(const r of b)r.setOnFeature(l,m);function g(e){switch(e){case"line":return"esriGeometryPolyline";case"multipoint":return"esriGeometryMultipoint";case"point":return"esriGeometryPoint"}}return l}function x(e,r,n,i){const[o,a]=e.anchorPoint,s=a?{x:Number(o),y:Number(a)}:h(o);if(!s||!Number.isFinite(s.x)||!Number.isFinite(s.y))return;const u=m(new t({...s,spatialReference:r}),r,n);return{x:d(i,u.x),y:g(i,u.y)}}function h(e){if(e?.trim())try{const t=JSON.parse(e);return"number"==typeof t?.x&&"number"==typeof t?.y?t:void 0}catch{return}}function w(o){const f=o.getInTransform()??o.getDisplayTransform();if(!f)throw new Error("Quantization transform is required to read dimension features.");const c=o.geometryType;if(!c)return null;const g={...o.readAttributes()},d=o.metadata.outSpatialReference,b=o.metadata.attributeSpatialReference??o.metadata.spatialReference??d,N=r(f),x={x:Number(l(s.beginX,g)),y:Number(l(s.beginY,g)),spatialReference:b},h={x:Number(l(s.endX,g)),y:Number(l(s.endY,g)),spatialReference:b},w={x:Number(l(s.dimX,g)),y:Number(l(s.dimY,g)),spatialReference:b};if(isNaN(x.x)||isNaN(x.y)||isNaN(h.x)||isNaN(h.y))return console.error(`Feature with ${s.objectId}=${l(s.objectId,g)} is missing valid begin, end, or dimension points and will be skipped.`),null;(isNaN(w.x)||isNaN(w.y))&&(w.x=x.x,w.y=x.y);const T=m(new t(x),b,d),j=m(new t(h),b,d),R=m(new t(w),b,d),P=[T,j,R],_=j.x-T.x,E=j.y-T.y;let M=Math.PI/2;0!==_?M=Math.atan2(E,_):E<0&&(M=-Math.PI/2);let S=Math.sqrt(_*_+E*E);if(1===Number(l(s.dimType,g))){const e=u([T.x,T.y],[j.x,j.y],[R.x,R.y],y(l(s.extAngle,g)));if(e){const t=e.endDimensionPoint[0]-e.beginDimensionPoint[0],r=e.endDimensionPoint[1]-e.beginDimensionPoint[1];S=Math.sqrt(t*t+r*r),M=p([t,r])}}const G=l(s.textX,g),I=l(s.textY,g);if(null!=G&&null!=I){const e=new t({x:Number(G),y:Number(I),spatialReference:b}),r=m(e,b,d);P.push(r)}const v=P.map(e=>({x:i(N,e.x),y:n(N,e.y)})).flatMap(e=>[e.x,e.y]);return g.__SYSTEM_LENGTH__=S,g.__DIMENSION_ANGLE__=360-e(M),{attributes:g,geometryOverride:{geometry:new a([v.length],v),geometryType:c}}}function T(e,t){const{geometry:r,geometryType:n}=t.geometryOverride,i=o(r,n,!1,!1);return i?{attributes:{...e.readAttributes(),...t.attributes},centroid:null,geometry:i}:null}function j(e){if(e.geometry){if("custom-two-point"===e.geometry.type)return"line";if("custom-multipoint"===e.geometry.type)return"multipoint";if("geometry-bag"===e.geometry.type){if("custom-multipoint"===e.geometry.geometries[0].type)return"multipoint";throw new Error("Unable to determine geometry type from annotation graphic")}if("custom-point"===e.geometry.type)return"point";if("polyline"===e.geometry.type)return"line";if("point"===e.geometry.type)return"point";throw new Error("Unable to determine geometry type from annotation graphic")}throw new Error("Unable to determine geometry type from annotation graphic")}export{N as createAnnotationMatcherFeatureInfo,w as createDimensionMatcherFeatureInfo,j as getAnnotationGeometryType,T as mixFeature};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GeometryCursor as t}from"../../../../../geometry/GeometryCursor.js";import{createTileObjectId as e}from"./TileObjectId.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(t,e,r){return new n(t,r)}}class n{constructor(t,e){this._cursor=t,this._context=e}next(){const r=this._cursor.next();if(!r||0===r.totalSize)return null;if(this._context.calloutBodyBounds)return r;const{matcher:n,target:o,tileKey:c}=this._context,s=n&&o&&null!=c?n.getMatcherGeometryOverride(e(c,o.getObjectId())):null;if(!s)return r;const i=t.fromOptimizedCIM(s.geometry.clone(),s.geometryType);return i.invertY(),i}}export{r as PrivateMatcherGeometryOverrideEffect};
2
+ import{GeometryCursor as t}from"../../../../../geometry/GeometryCursor.js";import{createTileObjectId as e}from"./TileObjectId.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(t,e,r){return new n(t,r)}}class n{constructor(t,e){this._cursor=t,this._context=e}next(){const r=this._cursor.next();if(!r||0===r.totalSize)return null;if(this._context.callout?.preserveInputGeometry)return r;const{matcher:n,target:o,tileKey:c}=this._context,s=n&&o&&null!=c?n.getMatcherGeometryOverride(e(c,o.getObjectId())):null;if(!s)return r;const i=t.fromOptimizedCIM(s.geometry.clone(),s.geometryType);return i.invertY(),i}}export{r as PrivateMatcherGeometryOverrideEffect};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import n from"../../../../analysis/LineOfSightAnalysisObserver.js";import e from"../../../../analysis/LineOfSightAnalysisTarget.js";import{length as o,normalize as t,scaleAndAdd as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as l,create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getConvertedElevation as u,absoluteHeightElevationInfo as s}from"../../../../support/elevationInfoUtils.js";function c(n){return n?.clone()??null}function a(n){return n?.clone()??null}function f(e,o=null){return m(e,o,()=>new n)}function p(n,o=null){return m(n,o,()=>new e)}function m(n,e,o){if(null==n)return null;const t=e??o();return t.position=n.position?.clone()??null,t.elevationInfo=n.elevationInfo?.clone()??null,t.feature=n.feature??null,t}function v(n,e,o=null){const t=e.clone();return t.z=u(n,e,o??s,s),t}function d(n,e,o,t=null){const r=v(e,o,t);try{return n.getMapPointIntersection(r)}catch{return null}}function I(n,e,o,t,{elevationInfo:r=null,preservedIntersection:l=null}={}){const i=l??d(o,n,t,r);return null!=i&&(g(n,e,i,{snappedMapPoint:t,elevationInfo:r}),!0)}function g(n,e,o,{snappedMapPoint:t=o.mapPoint,elevationInfo:r=null}={}){if(null==t)return e.position=null,e.elevationInfo=null,void(e.feature=null);const l=o.context,i=r?.clone(),u="graphic"===l?.type?l.graphic:null;if(e.elevationInfo=i,e.feature=u,"gaussian-splat"===l?.type){const l=v(n,t,r);return void(e.position=y(n,l,i,o.normal))}e.position=t.clone()}function y(n,e,c,a){const f=e.clone(),p=l(e.x,e.y,e.z??0);if(!n.renderCoordsHelper.toRenderCoords(p,e.spatialReference,p)||0===o(a))return f.z=u(n,f,s,c),f;const m=4,v=n.state.camera.computeScreenPixelSizeAt(p)*m,d=t(i(),a);r(p,p,d,v);const I=n.renderCoordsHelper.fromRenderCoords(p,f);return null==I?(f.z=u(n,f,s,c),f):(I.z=u(n,I,s,c),I)}export{y as getGaussianSplatOffsetPosition,f as restoreLineOfSightObserverState,p as restoreLineOfSightTargetState,c as snapshotLineOfSightObserverState,a as snapshotLineOfSightTargetState,I as updateLineOfSightItemFromAuthoredPoint,g as updateLineOfSightItemFromIntersection};
2
+ import n from"../../../../analysis/LineOfSightAnalysisObserver.js";import e from"../../../../analysis/LineOfSightAnalysisTarget.js";import{length as o,normalize as t,scaleAndAdd as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as r,create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getConvertedElevation as s,absoluteHeightElevationInfo as u}from"../../../../support/elevationInfoUtils.js";import c from"../../../../symbols/support/ElevationInfo.js";function a({view:n,point:e,sourceElevationInfo:o,mode:t,preserveZ:l=!1}){const r=o?.clone()??new c;r.mode=t;const i=e.clone();return l||(i.z=s(n,e,o??u,r)),{position:i,elevationInfo:r}}function f(n){return n?.clone()??null}function p(n){return n?.clone()??null}function m(e,o=null){return d(e,o,()=>new n)}function v(n,o=null){return d(n,o,()=>new e)}function d(n,e,o){if(null==n)return null;const t=e??o();return t.position=n.position?.clone()??null,t.elevationInfo=n.elevationInfo?.clone()??null,t.feature=n.feature??null,t}function I(n,e,o=null){const t=e.clone();return t.z=s(n,e,o??u,u),t}function g(n,e,o,t=null){const l=I(e,o,t);try{return n.getMapPointIntersection(l)}catch{return null}}function y(n,e,o,t,{elevationInfo:l=null,preservedIntersection:r=null}={}){const i=r??g(o,n,t,l);return null!=i&&(z(n,e,i,{snappedMapPoint:t,elevationInfo:l}),!0)}function z(n,e,o,{snappedMapPoint:t=o.mapPoint,elevationInfo:l=null}={}){if(null==t)return e.position=null,e.elevationInfo=null,void(e.feature=null);const r=o.context,i=l?.clone()??null;if(e.elevationInfo=i,e.feature="graphic"===r?.type?r.graphic:null,"gaussian-splat"===r?.type){const r=I(n,t,l);e.position=h(n,r,i,o.normal)}else e.position=t.clone()}function h(n,e,c,a){const f=e.clone(),p=r(e.x,e.y,e.z??0);if(!n.renderCoordsHelper.toRenderCoords(p,e.spatialReference,p)||0===o(a))return f.z=s(n,f,u,c),f;const m=4,v=n.state.camera.computeScreenPixelSizeAt(p)*m,d=t(i(),a);l(p,p,d,v);const I=n.renderCoordsHelper.fromRenderCoords(p,f);return null==I?(f.z=s(n,f,u,c),f):(I.z=s(n,I,u,c),I)}export{a as convertLineOfSightElevationMode,h as getGaussianSplatOffsetPosition,m as restoreLineOfSightObserverState,v as restoreLineOfSightTargetState,f as snapshotLineOfSightObserverState,p as snapshotLineOfSightTargetState,y as updateLineOfSightItemFromAuthoredPoint,z as updateLineOfSightItemFromIntersection};
@@ -1,2 +1,2 @@
1
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;this._syncSource="operations";try{null==e?this.item.position=t:m(this.view,this.item,this.intersector,t,{elevationInfo:this.item.elevationInfo,preservedIntersection:e.intersection})}finally{this._syncSource=null}null==e||e.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};
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{convertLineOfSightElevationMode as l,snapshotLineOfSightObserverState as c,snapshotLineOfSightTargetState as h,restoreLineOfSightObserverState as p,restoreLineOfSightTargetState as m,updateLineOfSightItemFromAuthoredPoint as d}from"./LineOfSightAuthoringUtils.js";import{EditGeometryOperations as u}from"../../../interactive/editGeometry/EditGeometryOperations.js";const y=Symbol("line-of-sight-item-operations");let f=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(y),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"on-the-ground"===this.elevationInfo.mode}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))}}}setElevationMode(t){const{position:e,elevationInfo:i}=this.item;if(null==e||t===this.elevationInfo.mode)return null;const o=l({view:this.view,point:e,sourceElevationInfo:i,mode:t,preserveZ:!0}),n=this.createUndoRecord();this._syncSource="operations";try{this.item.elevationInfo=o.elevationInfo,this.item.position=o.position}finally{this._syncSource=null}return this._syncOperationsFromItem(!1),n}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?c(this.item):h(this.item)}_restoreSnapshot(t){"observer"===this.itemType?p(t,this.item):m(t,this.item),this.destroyed||(this._syncOperationsFromItem(),this.emit("committed"))}_replaceOperations(t){this.removeHandles(y),this._operations=i(this._operations),this._operations=t,null!=t&&this.addHandles(t.data.on("change",()=>this._operationsGeometryChanged()),y)}_syncOperationsFromItem(t=!0){const{position:e}=this.item,i=this._operations;if("operations"!==this._syncSource){this._syncSource="item";try{if(null==e){if(null==i)return;this._replaceOperations(null)}else i?.data.geometry?.equals(e)||i?.trySetGeometry(e)||this._replaceOperations(u.fromGeometry(e,this.view.state.viewingMode));t?this._emitModifiedExternally():this.emit("committed")}finally{this._syncSource=null}}}_operationsGeometryChanged(){const t=this._operations?.data.geometry;if("item"===this._syncSource||"point"!==t?.type)return;const e=this._dragIntersectionContext;this._syncSource="operations";try{null==e?this.item.position=t:d(this.view,this.item,this.intersector,t,{elevationInfo:this.item.elevationInfo,preservedIntersection:e.intersection})}finally{this._syncSource=null}null==e||e.dragging||(this._dragIntersectionContext=null),this.emit("committed")}_emitModifiedExternally(){this.emit("modified-externally"),this.emit("committed")}};t([s({constructOnly:!0})],f.prototype,"analysisViewData",void 0),t([s({constructOnly:!0})],f.prototype,"intersector",void 0),t([s({constructOnly:!0})],f.prototype,"item",void 0),t([s({constructOnly:!0})],f.prototype,"itemType",void 0),t([s({constructOnly:!0})],f.prototype,"view",void 0),t([s()],f.prototype,"_operations",void 0),f=t([r("esri.views.3d.analysis.LineOfSight.LineOfSightItemManipulatedObject3D")],f);export{f as LineOfSightItemManipulatedObject3D};
@@ -1,2 +1,2 @@
1
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{initial as s}from"../../../../core/reactiveUtils.js";import{property as a,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import{create as p,fromPoints as c}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as u}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as d,LineOfSightTargetManipulator as h,LineOfSightTargetManipulatorState as m,getInteractiveLineOfSightTargetManipulatorState as v}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as g}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as _}from"../../interactive/editingTools/dragEventPipeline3D.js";import{connectTooltipToManipulatedObject as b}from"../../interactive/editingTools/tooltipUtils3D.js";import{mouseButtons as y}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as f,dragAtLocation as M,sceneSnappingAtLocation as j,dragManipulatedObject as V}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as I}from"../../../interactive/InteractiveToolBase.js";import{bindViewToolOptions as O}from"../../../interactive/options/bindViewToolOptions.js";import w from"../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as S}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as T}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as B,enterInputModeIfAvailable as R}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as H}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";const U=p();let x=class extends I{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 l,this._toolOptions=new w,this._interactionVisuals=null,this._grabbedManipulator=null,this._visualsManipulator=null,this._tooltipHandle=null,this._tooltipUndoRecord=null,this._tooltipInfo=new H({toolOptions:this._toolOptions,viewType:"3d"})}initialize(){const{view:t}=this;this._tooltip=B(()=>({view:t,options:this._toolOptions.tooltips})),this._interactionVisuals=new u({view:t}),this.addHandles([O(this._toolOptions,()=>t.options),this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(t=>({isTargetVisible:t.computationResult.isTargetVisible,isValid:t.computationResult.isValid,target:t.target})),grabbedManipulator:this._grabbedManipulator,interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),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}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(t){this._visualsManipulator=this._manipulatorByObject.get(t),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(t){if(this._manipulatorByObject.has(t))return;const i="observer"===t.itemType?new d(this.view,{deleting:!1,intersection:null,type:"observer"}):new h(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._visualsManipulator===i&&this.hideInteractionVisuals(),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 this._syncManipulators(),i}onInputEvent(t){"hold"===t.type&&null!=this._grabbedManipulator&&(this._visualsManipulator=this._grabbedManipulator,this._syncInteractionVisuals()),R(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===y.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.hideInteractionVisuals(),this._disconnectTooltip())}),i.events.on("drag",i=>{t.updateDragIntersection(i),"start"===i.action&&this.showInteractionVisuals(t)}),i.events.on("location-update",()=>this._syncInteractionVisuals()),this._createDragHandle(t,i)])}_createDragHandle(t,i){return f(i,(e,n,o,s)=>{const a=t.operations;if(null==a)return;let r=null;const{cancelSnapping:l,snappingStep:p}=T({snappingContext:new S({editGeometryOperations:a,elevationInfo:t.elevationInfo,pointer:s,visualizer:new g}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});o.next(t=>(r?.undo(null),r=null,t)).next(l);const c=a.data.allVerticesUnordered.at(0);n.next(i=>("start"===i.action&&(r=t.createUndoRecord()),{...i,snapOrigin:c?.pos})).next(M(this.view,i.elevationAlignedLocation)).next(_(this.view,a.data.geometry,t.elevationInfo,a.data.spatialReference)).next(j(this.view,t.elevationInfo)).next(...p).next(V(t)).next(t=>("end"===t.action&&null!=r&&(this.events.emit("record-undo",{record:r}),r=null),t))})}_connectTooltip(t){this._disconnectTooltip(),this._tooltipHandle=b(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==this._grabbedManipulator||this._grabbedManipulator===i),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?m.visible:m.occluded:m.undefined;i.state=this.interacting&&i.selected?v(o):o}_syncInteractionVisuals(){const t=this._interactionVisuals,i=this._visualsManipulator,e=this.visible&&this.analysisViewData.visible;if(null==t||null==i||!e)return void t?.hide();const n=[...this._manipulatorByObject.entries()].find(([t])=>"observer"===t.itemType)?.[1];if(null==n)return void t.hide();const o=i===n?null:c(n.renderLocation,i.renderLocation,U);t.update({target:i.renderLocation,lineVerticalPlaneSegment:o,visible:!0})}};t([a({constructOnly:!0})],x.prototype,"analysisViewData",void 0),t([a({constructOnly:!0})],x.prototype,"snappingManager",void 0),t([a({constructOnly:!0})],x.prototype,"view",void 0),t([a()],x.prototype,"automaticManipulatorSelection",void 0),t([a()],x.prototype,"removeIncompleteOnCancel",void 0),t([a()],x.prototype,"interacting",void 0),t([a()],x.prototype,"manipulatorsInteractive",void 0),t([a()],x.prototype,"_grabbedManipulator",void 0),t([a()],x.prototype,"updating",null),x=t([r("esri.views.3d.analysis.LineOfSight.LineOfSightItemTool")],x);export{x as LineOfSightItemTool};
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 o,removeMaybe as n}from"../../../../core/maybe.js";import{initial as s,watch as a}from"../../../../core/reactiveUtils.js";import{property as l,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as p}from"../../../../core/support/UpdatingHandles.js";import{create as c,fromPoints as u}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as d}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as h,LineOfSightTargetManipulator as m,LineOfSightTargetManipulatorState as _,getInteractiveLineOfSightTargetManipulatorState as v}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as g}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as b}from"../../interactive/editingTools/dragEventPipeline3D.js";import{connectTooltipToManipulatedObject as y}from"../../interactive/editingTools/tooltipUtils3D.js";import{mouseButtons as f}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as j,dragAtLocation as M,sceneSnappingAtLocation as O,dragManipulatedObject as V}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as I}from"../../../interactive/InteractiveToolBase.js";import{bindViewToolOptions as w}from"../../../interactive/options/bindViewToolOptions.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=c();let D=class extends I{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 p,this._toolOptions=new S,this._interactionVisuals=null,this._grabbedManipulator=null,this._visualsManipulator=null,this._tooltipHandle=null,this._tooltipObject=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 d({view:t}),this.addHandles([w(this._toolOptions,()=>t.options),this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(t=>({isTargetVisible:t.computationResult.isTargetVisible,isValid:t.computationResult.isValid,target:t.target})),grabbedManipulator:this._grabbedManipulator,interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),s),a(()=>this._tooltip.mode,t=>{"input"!==t&&null==this._grabbedManipulator&&this._disconnectTooltip()})]),this.finishToolCreation()}destroy(){this._disconnectTooltip(),this._tooltip=o(this._tooltip),this._interactionVisuals=o(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(t){this._visualsManipulator=this._manipulatorByObject.get(t),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(t){if(this._manipulatorByObject.has(t))return;const i="observer"===t.itemType?new h(this.view,{deleting:!1,intersection:null,type:"observer"}):new m(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._tooltipObject===t&&this._disconnectTooltip(),this._visualsManipulator===i&&this.hideInteractionVisuals(),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){null!=this._tooltipObject&&this._tooltipObject!==t&&this._disconnectTooltip();let i=!1;for(const[e,o]of this._manipulatorByObject){const n=e===t;o.selected=n,i||=n}return this._syncManipulators(),i}onInputEvent(t){"hold"===t.type&&null!=this._grabbedManipulator&&(this._visualsManipulator=this._grabbedManipulator,this._syncInteractionVisuals()),H(t,this._tooltip)}onManipulatorSelectionChanged(){[...this._manipulatorByObject.values()].some(t=>t.selected)||this.events.emit("selection-cleared")}_connectManipulator(t,i){const o=()=>this._syncManipulator(t,i);return e([t.on("committed",o),t.on("modified-externally",o),i.events.on("immediate-click",e=>{this.events.emit("select-item",{item:t.item}),e.button===f.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.hideInteractionVisuals(),"input"!==this._tooltip.mode&&this._disconnectTooltip())}),i.events.on("drag",i=>{t.updateDragIntersection(i),"start"===i.action&&this.showInteractionVisuals(t)}),i.events.on("location-update",()=>this._syncInteractionVisuals()),this._createDragHandle(t,i)])}_createDragHandle(t,i){return j(i,(e,o,n,s)=>{const a=t.operations;if(null==a)return;let l=null;const{cancelSnapping:r,snappingStep:p}=B({snappingContext:new T({editGeometryOperations:a,elevationInfo:t.elevationInfo,pointer:s,visualizer:new g}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});n.next(t=>(l?.undo(null),l=null,t)).next(r);const c=a.data.allVerticesUnordered.at(0);o.next(i=>("start"===i.action&&(l=t.createUndoRecord()),{...i,snapOrigin:c?.pos})).next(M(this.view,i.elevationAlignedLocation)).next(b(this.view,a.data.geometry,t.elevationInfo,a.data.spatialReference)).next(O(this.view,t.elevationInfo)).next(...p).next(V(t)).next(t=>("end"===t.action&&null!=l&&(this.events.emit("record-undo",{record:l}),l=null),t))})}_connectTooltip(t){this._disconnectTooltip(),this._tooltipObject=t,this._tooltipHandle=y(this._tooltip,t,()=>({activeTooltipInfo:this._tooltipInfo,onRecordUndo:t=>this.events.emit("record-undo",{record:t}),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=n(this._tooltipHandle),this._tooltipObject=null,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==this._grabbedManipulator||this._grabbedManipulator===i),null!=e&&(i.elevationAlignedLocation=e),"target"!==t.itemType)return;const o=this.analysisViewData.computations.find(i=>i.target===t.item),n=null!=o&&o.computationResult.isValid?o.computationResult.isTargetVisible?_.visible:_.occluded:_.undefined;i.state=this.interacting&&i.selected?v(n):n}_syncInteractionVisuals(){const t=this._interactionVisuals,i=this._visualsManipulator,e=this.visible&&this.analysisViewData.visible;if(null==t||null==i||!e)return void t?.hide();const o=[...this._manipulatorByObject.entries()].find(([t])=>"observer"===t.itemType)?.[1];if(null==o)return void t.hide();const n=i===o?null:u(o.renderLocation,i.renderLocation,x);t.update({target:i.renderLocation,lineVerticalPlaneSegment:n,visible:!0})}};t([l({constructOnly:!0})],D.prototype,"analysisViewData",void 0),t([l({constructOnly:!0})],D.prototype,"snappingManager",void 0),t([l({constructOnly:!0})],D.prototype,"view",void 0),t([l()],D.prototype,"automaticManipulatorSelection",void 0),t([l()],D.prototype,"removeIncompleteOnCancel",void 0),t([l()],D.prototype,"interacting",void 0),t([l()],D.prototype,"manipulatorsInteractive",void 0),t([l()],D.prototype,"_grabbedManipulator",void 0),t([l()],D.prototype,"updating",null),D=t([r("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 t}from"tslib";import e from"../../../../core/Accessor.js";import{isSome as o}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{when as i,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as a,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as s}from"../../../../support/elevationInfoUtils.js";import{createDrawTool as l}from"./lineOfSightPlacementUtils.js";import{createLineOfSightRootPluginConfiguration as d}from"./LineOfSightRootPlugin.js";import{Manipulator3D as p}from"../../interactive/Manipulator3D.js";const c=Symbol("hiddenManipulatorHandle");let h=class extends e{get active(){return!!this._drawTool?.active}get canRedo(){return this._drawTool?.canRedo??!1}get canUndo(){return this._drawTool?.canUndo??!1}get updating(){return this._drawTool?.updating??!1}get activeTooltipInfo(){return this._drawTool?.activeTooltipInfo??null}get tooltip(){return this._drawTool?.tooltip??null}constructor(t){super(t),this.visible=!0,this.observerPlacementElevationInfo=null,this.targetPlacementElevationInfo=null,this._drawTool=null,this._renderer=null,this._sessionStartedWithValidAnalysis=!1}initialize(){this.addHandles([i(()=>!this.active,()=>{this.analysisViewData.cursorTarget=null},n)])}destroy(){this._destroyDrawTool()}get _snapToSceneEnabled(){const t=this._effectiveElevationInfo.mode;return"relative-to-ground"!==t&&"on-the-ground"!==t&&null}get _placementElevationInfo(){return null==this.analysis.observer?this.observerPlacementElevationInfo:this.targetPlacementElevationInfo}get _effectiveElevationInfo(){return this._placementElevationInfo??s}continue(){if(this._drawTool?.active)return;this._sessionStartedWithValidAnalysis=this.analysis.valid;const{drawTool:t,renderer:e}=this._createDrawTool();this._drawTool=t,this._renderer=e,this.view.addAndActivateTool(t),t.begin([d({analysis:this.analysis,analysisViewData:this.analysisViewData,observerElevationInfo:this.observerPlacementElevationInfo,targetElevationInfo:this.targetPlacementElevationInfo,view:this.view})])}stop(){this._destroyDrawTool()}redo(){this._drawTool?.redo()}undo(){this._drawTool?.undo()}get testInfo(){}_createDrawTool(){return l({analysis:this.analysis,analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,getSnapToSceneEnabled:()=>this._snapToSceneEnabled,getSourceElevationInfo:()=>this._effectiveElevationInfo,getVisible:()=>this.visible,onCancel:t=>{t!==this._drawTool||this._sessionStartedWithValidAnalysis||null!=this.analysis.observer||(this.analysis.clear(),this.analysisViewData.cursorTarget=null),this._destroyDrawTool(t)},onComplete:t=>this._destroyDrawTool(t),onManipulatorCountChange:t=>this._hideManipulatorOnAppearance(t),shouldPreventVertexAdd:this.shouldPreventVertexAdd})}_destroyDrawTool(t=this._drawTool){if(null==t)return;const e=t===this._drawTool;this.view.activeTool===t&&(this.view.activeTool=null),this.view.tools.includes(t)&&this.view.tools.remove(t),t.destroy(),e&&(this._drawTool=null,this._renderer=null,this._sessionStartedWithValidAnalysis=!1)}_hideManipulatorOnAppearance(t){t.removeHandles(c),t.addHandles(t.manipulators.toArray().map(t=>t instanceof p?t.disableDisplay():null).filter(o),c)}};t([a({constructOnly:!0})],h.prototype,"view",void 0),t([a({constructOnly:!0})],h.prototype,"analysis",void 0),t([a({constructOnly:!0})],h.prototype,"analysisViewData",void 0),t([a({constructOnly:!0})],h.prototype,"parent",void 0),t([a({constructOnly:!0})],h.prototype,"shouldPreventVertexAdd",void 0),t([a({constructOnly:!0})],h.prototype,"snappingManager",void 0),t([a()],h.prototype,"visible",void 0),t([a()],h.prototype,"observerPlacementElevationInfo",void 0),t([a()],h.prototype,"targetPlacementElevationInfo",void 0),t([a()],h.prototype,"active",null),t([a()],h.prototype,"canRedo",null),t([a()],h.prototype,"canUndo",null),t([a()],h.prototype,"updating",null),t([a()],h.prototype,"activeTooltipInfo",null),t([a()],h.prototype,"tooltip",null),t([a()],h.prototype,"_drawTool",void 0),t([a()],h.prototype,"_renderer",void 0),h=t([r("esri.views.3d.analysis.LineOfSight.LineOfSightPlacementController")],h);export{h as LineOfSightPlacementController};
2
+ import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{isSome as o}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{when as i,syncAndInitial as n,watch as s}from"../../../../core/reactiveUtils.js";import{property as a,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as l}from"../../../../support/elevationInfoUtils.js";import{convertLineOfSightElevationMode as d}from"./LineOfSightAuthoringUtils.js";import{createDrawTool as v}from"./lineOfSightPlacementUtils.js";import{createLineOfSightRootPluginConfiguration as p}from"./LineOfSightRootPlugin.js";import{isLineOfSightTargetPlugin as h}from"./LineOfSightTargetPlugin.js";import{Manipulator3D as c}from"../../interactive/Manipulator3D.js";const u=Symbol("hiddenManipulatorHandle");let f=class extends e{get active(){return!!this._drawTool?.active}get canRedo(){return this._drawTool?.canRedo??!1}get canUndo(){return this._drawTool?.canUndo??!1}get updating(){return this._drawTool?.updating??!1}get activeTooltipInfo(){return this._drawTool?.activeTooltipInfo??null}get tooltip(){return this._drawTool?.tooltip??null}constructor(t){super(t),this.visible=!0,this.observerPlacementElevationInfo=null,this.targetPlacementElevationInfo=null,this._drawTool=null,this._renderer=null,this._observerSessionElevationInfo=null,this._targetSessionElevationInfo=null,this._sessionStartedWithValidAnalysis=!1}initialize(){this.addHandles([i(()=>!this.active,()=>{this.analysisViewData.cursorTarget=null},n),s(()=>this.activeTooltipInfo,t=>{t&&(t.elevationModeContext=this._elevationModeContext)},n)])}destroy(){this._destroyDrawTool()}get _snapToSceneEnabled(){const t=this._effectiveElevationInfo.mode;return"relative-to-ground"!==t&&"on-the-ground"!==t&&null}get _placementElevationInfo(){return null==this.analysis.observer?this._observerSessionElevationInfo:this._targetSessionElevationInfo}get _effectiveElevationInfo(){return this._placementElevationInfo??l}get _elevationModeContext(){const t=this;return{get mode(){return t._effectiveElevationInfo.mode},get disabled(){return!t._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:t=>this.setElevationMode(t)}}setElevationMode(t){const e=this._drawTool,o=e?.interactiveHandleManager?.focusedHandle,i=o?.outputMapPosition;if(!e||!o||!i||t===this._effectiveElevationInfo.mode)return;const n=e.activeTooltipInfo?.getConstraintFieldByName(o,"elevation"),s=!0===n?.locked,{position:a,elevationInfo:r}=d({view:this.view,point:i,sourceElevationInfo:this._placementElevationInfo,mode:t,preserveZ:s}),l=()=>{e.defaultZ=a.z,null==this.analysis.observer?this._observerSessionElevationInfo=r:this._targetSessionElevationInfo=r,o.inputMapPosition=a.clone(),o.selectedSnappingResult=null,o.outputMapPosition=a},v=e.mostDownstreamPlugin;h(v)?v.changeElevationMode(t,s,l):l(),this._renderer?.refresh()}continue(){if(this._drawTool?.active)return;this._sessionStartedWithValidAnalysis=this.analysis.valid,this._observerSessionElevationInfo=this.observerPlacementElevationInfo?.clone()??null,this._targetSessionElevationInfo=this.targetPlacementElevationInfo?.clone()??null;const{drawTool:t,renderer:e}=this._createDrawTool();this._drawTool=t,this._renderer=e,this.view.addAndActivateTool(t),t.begin([p({analysis:this.analysis,analysisViewData:this.analysisViewData,getObserverElevationInfo:()=>this._observerSessionElevationInfo,getTargetElevationInfo:()=>this._targetSessionElevationInfo,view:this.view})])}stop(){this._destroyDrawTool()}redo(){this._drawTool?.redo()}undo(){this._drawTool?.undo()}get testInfo(){}_createDrawTool(){return v({analysis:this.analysis,analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,getSnapToSceneEnabled:()=>this._snapToSceneEnabled,getSourceElevationInfo:()=>this._effectiveElevationInfo,getVisible:()=>this.visible,onCancel:t=>{t!==this._drawTool||this._sessionStartedWithValidAnalysis||null!=this.analysis.observer||(this.analysis.clear(),this.analysisViewData.cursorTarget=null),this._destroyDrawTool(t)},onComplete:t=>this._destroyDrawTool(t),onManipulatorCountChange:t=>this._hideManipulatorOnAppearance(t),shouldPreventVertexAdd:this.shouldPreventVertexAdd})}_destroyDrawTool(t=this._drawTool){if(null==t)return;const e=t===this._drawTool;this.view.activeTool===t&&(this.view.activeTool=null),this.view.tools.includes(t)&&this.view.tools.remove(t),t.destroy(),e&&(this._drawTool=null,this._renderer=null,this._sessionStartedWithValidAnalysis=!1)}_hideManipulatorOnAppearance(t){t.removeHandles(u),t.addHandles(t.manipulators.toArray().map(t=>t instanceof c?t.disableDisplay():null).filter(o),u)}};t([a({constructOnly:!0})],f.prototype,"view",void 0),t([a({constructOnly:!0})],f.prototype,"analysis",void 0),t([a({constructOnly:!0})],f.prototype,"analysisViewData",void 0),t([a({constructOnly:!0})],f.prototype,"parent",void 0),t([a({constructOnly:!0})],f.prototype,"shouldPreventVertexAdd",void 0),t([a({constructOnly:!0})],f.prototype,"snappingManager",void 0),t([a()],f.prototype,"visible",void 0),t([a()],f.prototype,"observerPlacementElevationInfo",void 0),t([a()],f.prototype,"targetPlacementElevationInfo",void 0),t([a()],f.prototype,"active",null),t([a()],f.prototype,"canRedo",null),t([a()],f.prototype,"canUndo",null),t([a()],f.prototype,"updating",null),t([a()],f.prototype,"activeTooltipInfo",null),t([a()],f.prototype,"tooltip",null),t([a()],f.prototype,"_drawTool",void 0),t([a()],f.prototype,"_renderer",void 0),t([a()],f.prototype,"_observerSessionElevationInfo",void 0),t([a()],f.prototype,"_targetSessionElevationInfo",void 0),t([a()],f.prototype,"_elevationModeContext",null),f=t([r("esri.views.3d.analysis.LineOfSight.LineOfSightPlacementController")],f);export{f as LineOfSightPlacementController};