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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/Ground.js +1 -1
  2. package/arcgisGlobal.d.ts +2 -0
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/0148cb611bf7c8c5fe8a.js +1 -0
  5. package/assets/esri/core/workers/chunks/{deb5b1d772ca407654d4.js → 0acc754907395e83bbc6.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{bcb06a0643b4c83535ee.js → 1302bf9718747cd9fdd9.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{956432c9d45940983bc2.js → 1b42d163ef22e3565bb7.js} +1 -1
  8. package/assets/esri/core/workers/chunks/1b551ef3d84d9c1e93f9.js +1 -0
  9. package/assets/esri/core/workers/chunks/{4adad3312caa24af98ac.js → 1c38ce72160d5a4e4b3d.js} +1 -1
  10. package/assets/esri/core/workers/chunks/1c3b087fbf2d102376fc.js +1 -0
  11. package/assets/esri/core/workers/chunks/{9b3813e39992b1b99941.js → 1e46703cb566c25458ad.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{015cb790262a59857c5f.js → 1f135269aea3931e11b2.js} +1 -1
  13. package/assets/esri/core/workers/chunks/23279303cd7698314c56.js +1 -0
  14. package/assets/esri/core/workers/chunks/{4bf2cc4d092601ff2b86.js → 24673aac70d6c949b6fa.js} +1 -1
  15. package/assets/esri/core/workers/chunks/24cf91aeab53a897e951.js +1 -0
  16. package/assets/esri/core/workers/chunks/26bc509a031788bfa678.js +1 -0
  17. package/assets/esri/core/workers/chunks/2ae6deade655fdbc28de.js +1 -0
  18. package/assets/esri/core/workers/chunks/{37cf4ca2083cd3b6002e.js → 2c7bb5c9751524687002.js} +1 -1
  19. package/assets/esri/core/workers/chunks/2c8957f9c7610805208c.js +1 -0
  20. package/assets/esri/core/workers/chunks/{a3c1a5a5c5cbf27b376d.js → 2d592c935571de80a2e2.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{a917a1df8270860dc514.js → 2f52ad525744b8793d49.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{6efc5873747b9cd44fb9.js → 323451ef52d0c2805f1d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/37ae52c71bf9c70fbb92.js +1 -0
  24. package/assets/esri/core/workers/chunks/38890ac5917942374ab8.js +1 -0
  25. package/assets/esri/core/workers/chunks/3e33d953e41b281a120b.js +1 -0
  26. package/assets/esri/core/workers/chunks/3e52351e06d85bf9bedd.js +1 -0
  27. package/assets/esri/core/workers/chunks/{fbc5f275c4e5e6bfffaa.js → 462fd57af8ed7921d6ba.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{1846296be959e28c42bb.js → 475906b079f4f1ddacf2.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{ea49721fdd2172d1c799.js → 48a2f68e06a2e90b77d0.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{b6ca73c1384f07b30b74.js → 4bb8432d99a39733368f.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{c44cbe04efddbbbaec13.js → 4f58e0322707f63f5bf2.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{0e9f54d7f158195bd203.js → 59cd139712d919e6a738.js} +1 -1
  33. package/assets/esri/core/workers/chunks/59d5247ac4075b024244.js +1 -0
  34. package/assets/esri/core/workers/chunks/5afc12671a9a1bb6c56c.js +1 -0
  35. package/assets/esri/core/workers/chunks/5b9f3c4f65412c66316f.js +1 -0
  36. package/assets/esri/core/workers/chunks/{be3421ffb5b391bca02e.js → 5d35e0c2665f5e625ee9.js} +1 -1
  37. package/assets/esri/core/workers/chunks/5e70bfb9d6235a87b87a.js +1 -0
  38. package/assets/esri/core/workers/chunks/6006bd8a5ed945fa2776.js +1 -0
  39. package/assets/esri/core/workers/chunks/618927cfcb93dd1d92fd.js +1 -0
  40. package/assets/esri/core/workers/chunks/6709d24867d275b33d24.js +1 -0
  41. package/assets/esri/core/workers/chunks/68e24fa3f564c2a5c9fd.js +1 -0
  42. package/assets/esri/core/workers/chunks/{fd5e61cb6f936eadcfe3.js → 724ea2e2843e6dac0a90.js} +1 -1
  43. package/assets/esri/core/workers/chunks/7441d121f00ce747c08e.js +1 -0
  44. package/assets/esri/core/workers/chunks/{e86f83a6514a35255f64.js → 781fa83e8063b8f685dc.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{a005efcde3ca9def4e6b.js → 78c1b75b1a8937eaa3cd.js} +1 -1
  46. package/assets/esri/core/workers/chunks/793b072519ded0dc6f34.js +1 -0
  47. package/assets/esri/core/workers/chunks/{1086f190f94c715bbfe4.js → 7994fce5f36963aadc51.js} +1 -1
  48. package/assets/esri/core/workers/chunks/7adee504107cb9ad8563.js +1 -0
  49. package/assets/esri/core/workers/chunks/7efc45858ebd3fd3302e.js +1 -0
  50. package/assets/esri/core/workers/chunks/7ff536284942c5284a16.js +1 -0
  51. package/assets/esri/core/workers/chunks/813dd84933b407c8fe86.js +1 -0
  52. package/assets/esri/core/workers/chunks/8daeac785af725c3ebdf.js +1 -0
  53. package/assets/esri/core/workers/chunks/{3ab25279aaa30f035038.js → 8daed13400d9e63e65ae.js} +1 -1
  54. package/assets/esri/core/workers/chunks/9020bd7a0e488d55ef14.js +1 -0
  55. package/assets/esri/core/workers/chunks/{cf7c06702babd6fa88b4.js → 9af36ee6a0df224859bc.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{452d069ba7ad6759b558.js → 9c46c7f00d42f5c02b26.js} +1 -1
  57. package/assets/esri/core/workers/chunks/a3ab53b534e2872131be.js +1 -0
  58. package/assets/esri/core/workers/chunks/{fa3f824c874f29d24953.js → aa6b2cc8f6f5627891c1.js} +1 -1
  59. package/assets/esri/core/workers/chunks/ac7af417ebf7721d7400.js +1 -0
  60. package/assets/esri/core/workers/chunks/aed479c14d93955f4798.js +1 -0
  61. package/assets/esri/core/workers/chunks/{60c61f34733063730386.js → b013b70e40dfb6ce013e.js} +1 -1
  62. package/assets/esri/core/workers/chunks/b22de8bf4a4a739bc36d.js +1 -0
  63. package/assets/esri/core/workers/chunks/b39cd78d2d97bef9909e.js +1 -0
  64. package/assets/esri/core/workers/chunks/b5f50955c1eee55b67d1.js +1 -0
  65. package/assets/esri/core/workers/chunks/bdf012e591a8476db467.js +1 -0
  66. package/assets/esri/core/workers/chunks/{daf7b647bd960d8bad56.js → be52c319a0a81ce1ba36.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{89edaa1ffa566908ebca.js → ca5a4f62b09cc8579dc0.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{fbb390c0d92d1536fce3.js → ce1ccf9ec90b786591e5.js} +1 -1
  69. package/assets/esri/core/workers/chunks/cf0bed7ae27021fd7b05.js +1 -0
  70. package/assets/esri/core/workers/chunks/cf6f671823fa6c2a9a5e.js +1 -0
  71. package/assets/esri/core/workers/chunks/{39c5e0f6262f69a62c66.js → d25210574168ead2f813.js} +1 -1
  72. package/assets/esri/core/workers/chunks/d3378c479052d566317c.js +1 -0
  73. package/assets/esri/core/workers/chunks/d3ef23923424ad8c5048.js +1 -0
  74. package/assets/esri/core/workers/chunks/{46388b86d1b10e6121bd.js → d507d7d7a7282fc38e8d.js} +1 -1
  75. package/assets/esri/core/workers/chunks/dc0816f064be576a2fa6.js +1 -0
  76. package/assets/esri/core/workers/chunks/{d9b761104ab6e4acaf91.js → dd4ecf81250cc001d040.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{ab60f3bc18b5ea504f70.js → e0eb89a935509ba34d9b.js} +1 -1
  78. package/assets/esri/core/workers/chunks/e10fe4c77b8dc4492092.js +1 -0
  79. package/assets/esri/core/workers/chunks/e4e1db4e9e5f13167401.js +1 -0
  80. package/assets/esri/core/workers/chunks/e5ee64e2fb5bfcb716d8.js +1 -0
  81. package/assets/esri/core/workers/chunks/{e755075ac2e02e881fad.js → e6637f9176566382ed3e.js} +1 -1
  82. package/assets/esri/core/workers/chunks/e6dc68c4bd8eddb168d1.js +1 -0
  83. package/assets/esri/core/workers/chunks/eb780f2dafa14f776166.js +1 -0
  84. package/assets/esri/core/workers/chunks/{d9d5f50af047ee7af129.js → eb7f45736c852725b0bb.js} +89 -58
  85. package/assets/esri/core/workers/chunks/ed31ec586b754241474d.js +1 -0
  86. package/assets/esri/core/workers/chunks/f38d11be766043413659.js +1 -0
  87. package/assets/esri/libs/pdfjs/pdf.worker.mjs +63075 -0
  88. package/assets/esri/libs/pdfjs/wasm/jbig2.wasm +0 -0
  89. package/assets/esri/libs/pdfjs/wasm/openjpeg.wasm +0 -0
  90. package/assets/esri/libs/pdfjs/wasm/qcms_bg.wasm +0 -0
  91. package/assets/esri/libs/pdfjs/wasm/quickjs-eval.wasm +0 -0
  92. package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.en.json +1 -1
  93. package/chunks/CloudsComposition.glsl.js +2 -2
  94. package/chunks/GlobalIllumination.glsl.js +42 -13
  95. package/chunks/GlobalIlluminationBlur.glsl.js +1 -1
  96. package/config.js +1 -1
  97. package/core/arrayUtils.js +1 -1
  98. package/core/workers/registry.js +1 -1
  99. package/geometry/support/geometryUtils.js +1 -1
  100. package/geometry/support/heightModelInfoUtils.js +1 -1
  101. package/geometry/support/meshUtils/elevation.js +1 -1
  102. package/kernel.js +1 -1
  103. package/layers/GeospatialPDFLayer.d.ts +40 -0
  104. package/layers/GeospatialPDFLayer.js +2 -0
  105. package/layers/IntegratedMeshLayer.js +1 -1
  106. package/layers/geospatialPDF/GeospatialPDFFrame.js +2 -0
  107. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +5 -0
  108. package/layers/geospatialPDF/GeospatialPDFParserUtils.js +2 -0
  109. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +2 -0
  110. package/layers/geospatialPDF/LGIDictMapFrame.js +2 -0
  111. package/layers/geospatialPDF/Projection.js +2 -0
  112. package/layers/geospatialPDF/ViewportMeasureFrame.js +2 -0
  113. package/layers/geospatialPDF/renderExtentUtils.js +2 -0
  114. package/layers/geospatialPDF/sharedUtils.js +2 -0
  115. package/layers/mixins/ArcGISImageService.js +1 -1
  116. package/layers/raster/datasets/GeospatialPDFRaster.js +2 -0
  117. package/layers/support/ElevationQuery.js +1 -1
  118. package/layers/support/LabelClass.js +1 -1
  119. package/layers/support/layersLoader.js +1 -1
  120. package/layers/types.d.ts +1 -1
  121. package/package.json +4 -4
  122. package/portal/PortalItem.js +1 -1
  123. package/portal/support/portalLayers.js +1 -1
  124. package/support/revision.js +1 -1
  125. package/symbols/cim/OverrideHelper.js +1 -1
  126. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  127. package/views/2d/input/MapViewInputManager.js +1 -1
  128. package/views/2d/input/handlers/KeyPan.js +1 -1
  129. package/views/2d/input/handlers/KeyRotate.js +1 -1
  130. package/views/2d/layerViewModuleImportUtils.js +1 -1
  131. package/views/2d/layers/GeospatialPDFLayerView2D.js +2 -0
  132. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  133. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  134. package/views/2d/layers/support/annodime/virtualFields.js +1 -1
  135. package/views/2d/types.d.ts +2 -0
  136. package/views/3d/GroundView3D.js +1 -1
  137. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  138. package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
  139. package/views/3d/layerViewModuleImportUtils.js +1 -1
  140. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  141. package/views/3d/layers/GeospatialPDFLayerView3D.js +2 -0
  142. package/views/3d/layers/I3SMeshView3D.js +1 -1
  143. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  144. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  145. package/views/3d/layers/LayerView3D.js +1 -1
  146. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  147. package/views/3d/layers/i3s/Intersector.js +1 -1
  148. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  149. package/views/3d/support/GroundAndIMSurface.js +1 -1
  150. package/views/3d/support/hitTest.js +1 -1
  151. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  152. package/views/3d/types.d.ts +2 -0
  153. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  154. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +8 -6
  155. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +2 -2
  156. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +1 -1
  157. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +6 -6
  158. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  159. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  160. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  161. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  162. package/views/SceneView.d.ts +31 -0
  163. package/views/SceneView.js +1 -1
  164. package/views/View.d.ts +35 -0
  165. package/views/View.js +1 -1
  166. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
  167. package/views/analysis/ElevationProfile/elevationProfileQuerySourceUtils.js +1 -1
  168. package/views/interactive/options/ViewOptions.d.ts +98 -0
  169. package/views/interactive/options/ViewOptions.js +2 -0
  170. package/views/interactive/support/Units.d.ts +10 -2
  171. package/views/interactive/support/Units.js +1 -1
  172. package/views/layers/FeatureLikeLayerView.d.ts +27 -5
  173. package/views/layers/GraphicsLayerView.d.ts +25 -2
  174. package/views/layers/ImageryTileLayerView.js +1 -1
  175. package/views/selection/types.d.ts +1 -1
  176. package/views/support/DefaultsFromMap.js +1 -1
  177. package/views/types.d.ts +9 -3
  178. package/widgets/ElevationProfile/ElevationProfileLineGround.js +1 -1
  179. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +8 -2
  180. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  181. package/widgets/support/SelectionToolbar/VisibleElements.d.ts +8 -1
  182. package/widgets/support/SelectionToolbar/VisibleElements.js +1 -1
  183. package/widgets/support/SelectionToolbar.d.ts +7 -1
  184. package/widgets/support/SelectionToolbar.js +1 -1
  185. package/assets/esri/core/workers/chunks/01ca17092545d72be7b6.js +0 -1
  186. package/assets/esri/core/workers/chunks/0b727d7bf3e36e146725.js +0 -1
  187. package/assets/esri/core/workers/chunks/0bd067a5c0bac96caeb5.js +0 -1
  188. package/assets/esri/core/workers/chunks/0ff13f7a18b0123d253e.js +0 -1
  189. package/assets/esri/core/workers/chunks/114bc14c49176f64a2c5.js +0 -1
  190. package/assets/esri/core/workers/chunks/173417fe995e9bfc49d8.js +0 -1
  191. package/assets/esri/core/workers/chunks/2cf571d968118b6bdde0.js +0 -1
  192. package/assets/esri/core/workers/chunks/43436c7ccc6baefc885d.js +0 -1
  193. package/assets/esri/core/workers/chunks/445b0ca1b70730c9a2e6.js +0 -1
  194. package/assets/esri/core/workers/chunks/48d3da636be15581fd7d.js +0 -1
  195. package/assets/esri/core/workers/chunks/501df20cdd09384f6ee2.js +0 -1
  196. package/assets/esri/core/workers/chunks/50ae209237f104735a30.js +0 -1
  197. package/assets/esri/core/workers/chunks/54f9062526c2002b7fd7.js +0 -1
  198. package/assets/esri/core/workers/chunks/56b7ac280bf0be938c14.js +0 -1
  199. package/assets/esri/core/workers/chunks/61bcbafd676804ce3e1d.js +0 -1
  200. package/assets/esri/core/workers/chunks/63f7141c71f29dbe8270.js +0 -1
  201. package/assets/esri/core/workers/chunks/726ca458b98bb4334431.js +0 -1
  202. package/assets/esri/core/workers/chunks/75410a4de76e67ed5da4.js +0 -1
  203. package/assets/esri/core/workers/chunks/85780f4fa4b5509f864e.js +0 -1
  204. package/assets/esri/core/workers/chunks/862754d2d659528fe884.js +0 -1
  205. package/assets/esri/core/workers/chunks/8675ab3c4dec2f13b9c6.js +0 -1
  206. package/assets/esri/core/workers/chunks/8a103b6e9534516421e2.js +0 -1
  207. package/assets/esri/core/workers/chunks/917dec9c004218c58950.js +0 -1
  208. package/assets/esri/core/workers/chunks/91a51d959ee5c6123c46.js +0 -1
  209. package/assets/esri/core/workers/chunks/91f451b98e0f696043df.js +0 -1
  210. package/assets/esri/core/workers/chunks/99ebc99e8d1bca105b5e.js +0 -1
  211. package/assets/esri/core/workers/chunks/9d92e6f0beed9a8580fa.js +0 -1
  212. package/assets/esri/core/workers/chunks/a42505b978d54d36d3b6.js +0 -1
  213. package/assets/esri/core/workers/chunks/a70c59129ea808857d07.js +0 -1
  214. package/assets/esri/core/workers/chunks/a86a4e550a92f770d6d5.js +0 -1
  215. package/assets/esri/core/workers/chunks/b45ebb1b64ee7314375e.js +0 -1
  216. package/assets/esri/core/workers/chunks/b5b30c8447a0f967fa79.js +0 -1
  217. package/assets/esri/core/workers/chunks/baa8bce361a2677533ec.js +0 -1
  218. package/assets/esri/core/workers/chunks/c70a32ac0fa49f4493ca.js +0 -1
  219. package/assets/esri/core/workers/chunks/cf1106eda10f3cccb1bd.js +0 -1
  220. package/assets/esri/core/workers/chunks/d1b5be1aeab16d36d4b1.js +0 -1
  221. package/assets/esri/core/workers/chunks/d38252956c3d9e2168f7.js +0 -1
  222. package/assets/esri/core/workers/chunks/d6130cd8a20d24dd9d3c.js +0 -1
  223. package/assets/esri/core/workers/chunks/da161f8cbe1cfc5fcf7c.js +0 -1
  224. package/assets/esri/core/workers/chunks/da5b3421a984cb94fd58.js +0 -1
  225. package/assets/esri/core/workers/chunks/e52f30dfb7c82491a7f2.js +0 -1
  226. package/assets/esri/core/workers/chunks/e88eee4c2fc4229c2a8b.js +0 -1
  227. package/assets/esri/core/workers/chunks/f75e57d3e02f9828b049.js +0 -1
  228. package/assets/esri/core/workers/chunks/f774e5b94710ccee1af0.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{getAssetUrl as t}from"../assets.js";import i from"../core/Error.js";import{JSONSupportMixin as r}from"../core/JSONSupport.js";import{clone as o,fixJson as s}from"../core/lang.js";import{Loadable as a}from"../core/Loadable.js";import{isDataProtocol as n,makeAbsolute as l}from"../core/urlUtils.js";import{property as p,subclass as c}from"../core/accessorSupport/decorators.js";import{ensureClass as d}from"../core/accessorSupport/ensureType.js";import u from"../geometry/Extent.js";import m from"./Portal.js";import h from"./PortalItemResource.js";import g from"./PortalRating.js";import{a as y}from"../chunks/persistableUrlUtils.js";import{reader as w}from"../core/accessorSupport/decorators/reader.js";var v;const f=new Set(["3DTiles Service","CSV","Feature Collection","Feature Service","Feed","GeoJson","Group Layer","Image Service","KML","Knowledge Graph Layer","Map Service","Media Layer","Scene Service","Stream Service","Video Service","Vector Tile Service","WCS","WFS","WMS","WMTS"]),b=new Set(["KML","GeoJson","CSV"]);let k=v=class extends(r(a)){static from(e){return d(v,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.classification=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return"Feature Service"===e||"Feature Collection"===e?i=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":"Image Service"===e?i=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?i="Scene Layer":"Video Service"===e?i="Video Layer":"Scene Package"===e?i="Scene Layer Package":"Stream Service"===e?i="Feature Layer":"Geoprocessing Service"===e?i=t.includes("Web Tool")?"Tool":"Geoprocessing Service":"Geoenrichment Service"===e?i="GeoEnrichment Service":"Geocoding Service"===e?i="Locator":"Microsoft Powerpoint"===e?i="Microsoft PowerPoint":"GeoJson"===e?i="GeoJSON":"Globe Service"===e?i="Globe Layer":"Vector Tile Service"===e?i="Tile Layer":"netCDF"===e?i="NetCDF":"Map Service"===e?i=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e?.toLowerCase().includes("add in")?i=e.replaceAll(/(add in)/gi,"Add-In"):"datastore catalog service"===e?i="Big Data File Share":"Compact Tile Package"===e?i="Tile Package (tpkx)":"Raster function template"===e?i="Raster Function Template":"OGCFeatureServer"===e?i="OGC Feature Layer":"web mapping application"===e&&t.includes("configurableApp")?i="Instant App":"Insights Page"===e?i="Insights Report":"Excalibur Imagery Project"===e?i="Excalibur Project":"3DTiles Service"===e?i="3D tiles layer":"3DTiles Package"===e&&(i="3D tiles package"),i}readExtent(e){return e&&e.length?new u(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type?.toLowerCase()||"",i=this.typeKeywords||[],r="esri/images/portal/",o="16";let s,a=!1,n=!1,l=!1,p=!1,c=!1,d=!1,u=!1,m=!1;return e.indexOf("service")>0||"feature collection"===e||"kml"===e||"wms"===e||"wmts"===e||"wfs"===e?(a=i.includes("Hosted Service"),"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(n=i.includes("Table"),l=i.includes("Route Layer"),p=i.includes("Markup"),c=i.includes("Spatiotemporal"),d=i.includes("UtilityNetwork"),s=c&&n?"spatiotemporaltable":n?"table":l?"routelayer":p?"markup":c?"spatiotemporal":d?"utilitynetwork":a?"featureshosted":"features"):"map service"===e||"wms"===e||"wmts"===e?(c=i.includes("Spatiotemporal"),u=i.includes("Relational"),s=c||u?"mapimages":a||i.includes("Tiled")||"wmts"===e?"maptiles":"mapimages"):s="scene service"===e?i.includes("Line")?"sceneweblayerline":i.includes("3DObject")?"sceneweblayermultipatch":i.includes("Point")?"sceneweblayerpoint":i.includes("IntegratedMesh")?"sceneweblayermesh":i.includes("PointCloud")?"sceneweblayerpointcloud":i.includes("Polygon")?"sceneweblayerpolygon":i.includes("Building")?"sceneweblayerbuilding":i.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":"image service"===e?i.includes("Elevation 3D Layer")?"elevationlayer":i.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"video service"===e?i.includes("Live Stream")?"livestreamvideolayer":"videolayer":"geoprocessing service"===e?i.includes("Web Tool")?"tool":"layers":"geodata service"===e?"geodataservice":"3dtiles service"===e?i.includes("3DObject")?"3dobjecttileslayer":i.includes("IntegratedMesh")?"integratedmeshtileslayer":i.includes("GaussianSplat")?"gaussiansplatlayer":"3dtileslayer":"layers"):"web map"===e||"cityengine web scene"===e?s="maps":"web scene"===e?s=i.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":"web mapping application"===e&&i.includes("configurableApp")?s="instantapps":"web mapping application"===e||"mobile application"===e||"application"===e||"operation view"===e||"desktop application"===e?s="apps":"map document"===e||"map package"===e||"published map"===e||"scene document"===e||"globe document"===e||"basemap package"===e||"mobile basemap package"===e||"mobile map package"===e||"project package"===e||"project template"===e||"pro map"===e||"layout"===e||"layer"===e&&i.includes("ArcGIS Pro")||"explorer map"===e&&i.indexOf("Explorer Document")?s="mapsgray":"service definition"===e||"shapefile"===e||"cad drawing"===e||"geojson"===e||"netcdf"===e||"administrative report"===e?s="datafiles":"360 vr experience"===e?s="360vr":"explorer add in"===e||"desktop add in"===e||"windows viewer add in"===e||"windows viewer configuration"===e?s="appsgray":"arcgis pro add in"===e||"arcgis pro configuration"===e?s="addindesktop":"pdf"===e?s="pdf":"microsoft word"===e?s="word":"microsoft excel"===e?s="excel":"microsoft powerpoint"===e?s="ppt":"rule package"===e||"file geodatabase"===e||"sqlite geodatabase"===e||"csv collection"===e||"kml collection"===e||"windows mobile package"===e||"map template"===e||"desktop application template"===e||"gml"===e||"arcpad package"===e||"code sample"===e||"document link"===e||"earth configuration"===e||"operations dashboard add in"===e||"rules package"===e||"workflow manager package"===e||"explorer map"===e&&i.includes("Explorer Mapping Application")||i.includes("Document")?s="datafilesgray":"network analysis service"===e||"geoprocessing service"===e||"geodata service"===e||"geometry service"===e||"geoprocessing package"===e||"locator package"===e||"geoprocessing sample"===e||"workflow manager service"===e?s="toolsgray":"layer"===e||"layer package"===e||"explorer layer"===e?s="layersgray":"analysis model"===e?s="analysismodel":"scene package"===e?s="scenepackage":"3dtiles package"===e?s="3dtileslayerpackage":"3dtiles service"===e?s="3dtileslayer":"mobile scene package"===e?s="mobilescenepackage":"tile package"===e||"compact tile package"===e?s="tilepackage":"task file"===e?s="taskfile":"report template"===e?s="report-template":"statistical data collection"===e?s="statisticaldatacollection":"insights workbook"===e?s="workbook":"insights model"===e?s="insightsmodel":"insights page"===e?s="insightspage":"insights theme"===e?s="insightstheme":"hub initiative"===e?s="hubinitiative":"hub page"===e?s="hubpage":"hub site application"===e?s="hubsite":"hub event"===e?s="hubevent":"hub project"===e?s="hubproject":"relational database connection"===e?s="relationaldatabaseconnection":"big data file share"===e?s="datastorecollection":"image collection"===e?s="imagecollection":"desktop style"===e?s="desktopstyle":"style"===e?s=i.includes("Dictionary")?"dictionarystyle":"style":"dashboard"===e?s="dashboard":"raster function template"===e?s="rasterprocessingtemplate":"vector tile package"===e?s="vectortilepackage":"ortho mapping project"===e?s="orthomappingproject":"ortho mapping template"===e?s="orthomappingtemplate":"solution"===e?s="solutions":"geopackage"===e?s="geopackage":"deep learning package"===e?s="deeplearningpackage":"real time analytic"===e?s="realtimeanalytics":"reality mapping project"===e?s="realitymappingproject":"big data analytic"===e?s="bigdataanalytics":"feed"===e?s="feed":"excalibur imagery project"===e?s="excaliburimageryproject":"notebook"===e?s="notebook":"storymap"===e?s="storymap":"survey123 add in"===e?s="survey123addin":"mission"===e?s="mission":"mission report"===e?s="missionreport":"mission template"===e?s="missiontemplate":"quickcapture project"===e?s="quickcaptureproject":"pro report"===e?s="proreport":"pro report template"===e?s="proreporttemplate":"urban model"===e?s="urbanmodel":"urban project"===e?s="urbanproject":"web experience"===e?s="experiencebuilder":"web experience template"===e?s="webexperiencetemplate":"experience builder widget"===e?s="experiencebuilderwidget":"experience builder widget package"===e?s="experiencebuilderwidgetpackage":"workflow"===e?s="workflow":"kernel gateway connection"===e?s="kernelgatewayconnection":"insights script"===e?s="insightsscript":"hub initiative template"===e?s="hubinitiativetemplate":"storymap theme"===e?s="storymaptheme":"knowledge graph"===e?s="knowledgegraph":"knowledge graph layer"===e?s="knowledgegraphlayer":"knowledge studio project"===e?s="knowledgestudio":"native application"===e?s="nativeapp":"native application installer"===e?s="nativeappinstaller":"web link chart"===e?s="linkchart":"knowledge graph web investigation"===e?s="investigation":"ogcfeatureserver"===e?s="features":"pro presentation"===e?s="propresentation":"pro project"===e?s="proproject":"insights workbook package"===e?s="insightsworkbookpackage":"apache parquet"===e?s="apacheparquet":"notebook code snippet library"===e?s="notebookcodesnippets":"suitability model"===e?s="suitabilitymodel":"esri classifier definition"===e?s="classifierdefinition":"esri classification schema"===e?s="classificationschema":"insights data engineering workbook"===e?s="dataengineeringworkbook":"insights data engineering model"===e?s="dataengineeringmodel":"deep learning studio project"===e?s="deeplearningproject":"discussion"===e?s="discussion":"allsource project"===e?s="allsourceproject":"api key"===e?s="apikey":"data pipeline"===e?s="datapipelines":"group layer"===e?(m=i.includes("Map"),s=m?"layergroup2d":"layergroup"):s="media layer"===e?"onlinemedialayer":"form"===e?i.includes("Survey123")?"survey":"datafilesgray":"csv"===e?"csv":"image"===e?"image":"xr experience"===e?"xrexperience":"maps",s?t(r+s+o+".png"):null}get isLayer(){return null!=this.type&&f.has(this.type)}get itemCdnUrl(){return y(this.itemUrl)}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get loaded(){return super.loaded}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){const e=this.portal?.restUrl;if(!e)return null;const t=this.owner||this.portal?.user?.id;if(!t)return null;return`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`}load(e){const t=this.portal??(this.portal=m.getDefault()),i=t.load(e).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:null!=e?e.signal:null,query:{token:this.apiKey}}):{}).then(e=>{this.sourceJSON=e,this.read(e)});return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}},i=e instanceof g?e.rating:e;return null==i||isNaN(i)||"number"!=typeof e||(t.query.rating=i),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new g({rating:i,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:o(this.applicationProxies),avgRating:this.avgRating,categories:o(this.categories),classification:o(this.classification),created:o(this.created),culture:this.culture,description:this.description,extent:o(this.extent),groupCategories:o(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:o(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:o(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:o(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:o(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new v({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const t of["tags","typeKeywords","categories"])e[t]=e[t]?.join(", ");for(const t of["extent","classification"]){const i=e[t];i&&(e[t]=JSON.stringify(i))}return e}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return this.portal.request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return null!=t.rating?(t.created=new Date(t.created),new g(t)):null}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},v)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(e=>(this.applicationProxies&&!Object.hasOwn(e,"appProxies")&&(this.applicationProxies=null),this.sourceJSON=e,this.read(e),this))}update(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e?.data,i={method:"post"};i.query=this.createPostQuery();for(const e in i.query)null===i.query[e]&&(i.query[e]="");return i.query.clearEmptyFields=!0,null!=t&&("string"==typeof t?i.query.text=t:"object"==typeof t&&(i.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,i).then(()=>this.reload())}):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new i("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:r}=this;await t.signIn();const{copyResources:o,folder:s,tags:a,title:n}=e||{},l={method:"post",query:{copyPrivateResources:"all"===o,folder:"string"==typeof s?s:s?.id,includeResources:!!o,tags:a?.join(","),title:n}},{itemId:p}=await t.request(`${r}/copy`,l);return new v({id:p,portal:t})}updateThumbnail(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e.thumbnail,i=e.filename,r={method:"post"};if("string"==typeof t)n(t)?r.query={data:t}:r.query={url:l(t)},null!=i&&(r.query.filename=i);else{const e=new FormData;null!=i?e.append("file",t,i):e.append("file",t),r.body=e}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then(()=>this.reload())}):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:i}=await(import("./support/resourceUtils.js"));return i(this,e,t)}async addResource(e,t,i){const{addOrUpdateResources:r}=await(import("./support/resourceUtils.js"));return e.portalItem=this,await r(this,[{resource:e,content:t,compress:i?.compress,access:i?.access}],"add",i),e}async removeResource(e,t){const{removeResource:r}=await(import("./support/resourceUtils.js"));if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new i("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await(import("./support/resourceUtils.js"));return t(this,e)}resourceFromPath(e){return new h({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:o(this.categories),classification:o(this.classification),created:this.created?.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:o(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:o(this.typeKeywords),url:this.url};return s(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new v({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};e([p({type:["private","shared","org","public"]})],k.prototype,"access",void 0),e([p()],k.prototype,"accessInformation",void 0),e([p({type:String})],k.prototype,"apiKey",void 0),e([p({json:{read:{source:"appProxies"}}})],k.prototype,"applicationProxies",void 0),e([p()],k.prototype,"avgRating",void 0),e([p()],k.prototype,"categories",void 0),e([p()],k.prototype,"classification",void 0),e([p({type:Date})],k.prototype,"created",void 0),e([p()],k.prototype,"culture",void 0),e([p()],k.prototype,"description",void 0),e([p({readOnly:!0})],k.prototype,"displayName",null),e([p({type:u})],k.prototype,"extent",void 0),e([w("extent")],k.prototype,"readExtent",null),e([p()],k.prototype,"groupCategories",void 0),e([p({readOnly:!0})],k.prototype,"iconUrl",null),e([p()],k.prototype,"id",void 0),e([p({readOnly:!0})],k.prototype,"isLayer",null),e([p({type:Boolean,readOnly:!0})],k.prototype,"isOrgItem",void 0),e([p()],k.prototype,"itemControl",void 0),e([p({readOnly:!0})],k.prototype,"itemPageUrl",null),e([p({readOnly:!0})],k.prototype,"itemUrl",null),e([p()],k.prototype,"licenseInfo",void 0),e([p({type:Date})],k.prototype,"modified",void 0),e([p()],k.prototype,"name",void 0),e([p()],k.prototype,"numComments",void 0),e([p()],k.prototype,"numRatings",void 0),e([p()],k.prototype,"numViews",void 0),e([p()],k.prototype,"owner",void 0),e([p()],k.prototype,"ownerFolder",void 0),e([p({type:m})],k.prototype,"portal",void 0),e([p()],k.prototype,"screenshots",void 0),e([p()],k.prototype,"size",void 0),e([p()],k.prototype,"snippet",void 0),e([p()],k.prototype,"sourceJSON",void 0),e([p({type:String})],k.prototype,"sourceUrl",void 0),e([p({type:String})],k.prototype,"spatialReference",void 0),e([p()],k.prototype,"tags",void 0),e([p()],k.prototype,"thumbnail",void 0),e([p({readOnly:!0})],k.prototype,"thumbnailUrl",null),e([p()],k.prototype,"title",void 0),e([p()],k.prototype,"type",void 0),e([p()],k.prototype,"typeKeywords",void 0),e([p({type:String,json:{read(e,t){if(b.has(t.type)){const t=this.portal?.restUrl;e||=t&&this.id?`${t}/content/items/${this.id}/data`:null}return e}}})],k.prototype,"url",void 0),e([p({readOnly:!0})],k.prototype,"userItemUrl",null),k=v=e([c("esri.portal.PortalItem")],k);export{k as default};
2
+ import{__decorate as e}from"tslib";import{getAssetUrl as t}from"../assets.js";import i from"../core/Error.js";import{JSONSupportMixin as r}from"../core/JSONSupport.js";import{clone as o,fixJson as s}from"../core/lang.js";import{Loadable as a}from"../core/Loadable.js";import{isDataProtocol as n,makeAbsolute as l}from"../core/urlUtils.js";import{property as p,subclass as c}from"../core/accessorSupport/decorators.js";import{ensureClass as d}from"../core/accessorSupport/ensureType.js";import u from"../geometry/Extent.js";import m from"./Portal.js";import h from"./PortalItemResource.js";import g from"./PortalRating.js";import{a as y}from"../chunks/persistableUrlUtils.js";import{reader as w}from"../core/accessorSupport/decorators/reader.js";var v;const f=new Set(["3DTiles Service","CSV","Feature Collection","Feature Service","Feed","GeoJson","Group Layer","Image Service","KML","Knowledge Graph Layer","Map Service","Media Layer","PDF","Scene Service","Stream Service","Video Service","Vector Tile Service","WCS","WFS","WMS","WMTS"]),b=new Set(["KML","GeoJson","CSV","PDF"]);let k=v=class extends(r(a)){static from(e){return d(v,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.classification=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return"Feature Service"===e||"Feature Collection"===e?i=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":"Image Service"===e?i=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?i="Scene Layer":"Video Service"===e?i="Video Layer":"Scene Package"===e?i="Scene Layer Package":"Stream Service"===e?i="Feature Layer":"Geoprocessing Service"===e?i=t.includes("Web Tool")?"Tool":"Geoprocessing Service":"Geoenrichment Service"===e?i="GeoEnrichment Service":"Geocoding Service"===e?i="Locator":"Microsoft Powerpoint"===e?i="Microsoft PowerPoint":"GeoJson"===e?i="GeoJSON":"Globe Service"===e?i="Globe Layer":"Vector Tile Service"===e?i="Tile Layer":"netCDF"===e?i="NetCDF":"Map Service"===e?i=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e?.toLowerCase().includes("add in")?i=e.replaceAll(/(add in)/gi,"Add-In"):"datastore catalog service"===e?i="Big Data File Share":"Compact Tile Package"===e?i="Tile Package (tpkx)":"Raster function template"===e?i="Raster Function Template":"OGCFeatureServer"===e?i="OGC Feature Layer":"web mapping application"===e&&t.includes("configurableApp")?i="Instant App":"Insights Page"===e?i="Insights Report":"Excalibur Imagery Project"===e?i="Excalibur Project":"3DTiles Service"===e?i="3D tiles layer":"3DTiles Package"===e&&(i="3D tiles package"),i}readExtent(e){return e&&e.length?new u(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type?.toLowerCase()||"",i=this.typeKeywords||[],r="esri/images/portal/",o="16";let s,a=!1,n=!1,l=!1,p=!1,c=!1,d=!1,u=!1,m=!1;return e.indexOf("service")>0||"feature collection"===e||"kml"===e||"wms"===e||"wmts"===e||"wfs"===e?(a=i.includes("Hosted Service"),"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(n=i.includes("Table"),l=i.includes("Route Layer"),p=i.includes("Markup"),c=i.includes("Spatiotemporal"),d=i.includes("UtilityNetwork"),s=c&&n?"spatiotemporaltable":n?"table":l?"routelayer":p?"markup":c?"spatiotemporal":d?"utilitynetwork":a?"featureshosted":"features"):"map service"===e||"wms"===e||"wmts"===e?(c=i.includes("Spatiotemporal"),u=i.includes("Relational"),s=c||u?"mapimages":a||i.includes("Tiled")||"wmts"===e?"maptiles":"mapimages"):s="scene service"===e?i.includes("Line")?"sceneweblayerline":i.includes("3DObject")?"sceneweblayermultipatch":i.includes("Point")?"sceneweblayerpoint":i.includes("IntegratedMesh")?"sceneweblayermesh":i.includes("PointCloud")?"sceneweblayerpointcloud":i.includes("Polygon")?"sceneweblayerpolygon":i.includes("Building")?"sceneweblayerbuilding":i.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":"image service"===e?i.includes("Elevation 3D Layer")?"elevationlayer":i.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"video service"===e?i.includes("Live Stream")?"livestreamvideolayer":"videolayer":"geoprocessing service"===e?i.includes("Web Tool")?"tool":"layers":"geodata service"===e?"geodataservice":"3dtiles service"===e?i.includes("3DObject")?"3dobjecttileslayer":i.includes("IntegratedMesh")?"integratedmeshtileslayer":i.includes("GaussianSplat")?"gaussiansplatlayer":"3dtileslayer":"layers"):"web map"===e||"cityengine web scene"===e?s="maps":"web scene"===e?s=i.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":"web mapping application"===e&&i.includes("configurableApp")?s="instantapps":"web mapping application"===e||"mobile application"===e||"application"===e||"operation view"===e||"desktop application"===e?s="apps":"map document"===e||"map package"===e||"published map"===e||"scene document"===e||"globe document"===e||"basemap package"===e||"mobile basemap package"===e||"mobile map package"===e||"project package"===e||"project template"===e||"pro map"===e||"layout"===e||"layer"===e&&i.includes("ArcGIS Pro")||"explorer map"===e&&i.indexOf("Explorer Document")?s="mapsgray":"service definition"===e||"shapefile"===e||"cad drawing"===e||"geojson"===e||"netcdf"===e||"administrative report"===e?s="datafiles":"360 vr experience"===e?s="360vr":"explorer add in"===e||"desktop add in"===e||"windows viewer add in"===e||"windows viewer configuration"===e?s="appsgray":"arcgis pro add in"===e||"arcgis pro configuration"===e?s="addindesktop":"pdf"===e?s="pdf":"microsoft word"===e?s="word":"microsoft excel"===e?s="excel":"microsoft powerpoint"===e?s="ppt":"rule package"===e||"file geodatabase"===e||"sqlite geodatabase"===e||"csv collection"===e||"kml collection"===e||"windows mobile package"===e||"map template"===e||"desktop application template"===e||"gml"===e||"arcpad package"===e||"code sample"===e||"document link"===e||"earth configuration"===e||"operations dashboard add in"===e||"rules package"===e||"workflow manager package"===e||"explorer map"===e&&i.includes("Explorer Mapping Application")||i.includes("Document")?s="datafilesgray":"network analysis service"===e||"geoprocessing service"===e||"geodata service"===e||"geometry service"===e||"geoprocessing package"===e||"locator package"===e||"geoprocessing sample"===e||"workflow manager service"===e?s="toolsgray":"layer"===e||"layer package"===e||"explorer layer"===e?s="layersgray":"analysis model"===e?s="analysismodel":"scene package"===e?s="scenepackage":"3dtiles package"===e?s="3dtileslayerpackage":"3dtiles service"===e?s="3dtileslayer":"mobile scene package"===e?s="mobilescenepackage":"tile package"===e||"compact tile package"===e?s="tilepackage":"task file"===e?s="taskfile":"report template"===e?s="report-template":"statistical data collection"===e?s="statisticaldatacollection":"insights workbook"===e?s="workbook":"insights model"===e?s="insightsmodel":"insights page"===e?s="insightspage":"insights theme"===e?s="insightstheme":"hub initiative"===e?s="hubinitiative":"hub page"===e?s="hubpage":"hub site application"===e?s="hubsite":"hub event"===e?s="hubevent":"hub project"===e?s="hubproject":"relational database connection"===e?s="relationaldatabaseconnection":"big data file share"===e?s="datastorecollection":"image collection"===e?s="imagecollection":"desktop style"===e?s="desktopstyle":"style"===e?s=i.includes("Dictionary")?"dictionarystyle":"style":"dashboard"===e?s="dashboard":"raster function template"===e?s="rasterprocessingtemplate":"vector tile package"===e?s="vectortilepackage":"ortho mapping project"===e?s="orthomappingproject":"ortho mapping template"===e?s="orthomappingtemplate":"solution"===e?s="solutions":"geopackage"===e?s="geopackage":"deep learning package"===e?s="deeplearningpackage":"real time analytic"===e?s="realtimeanalytics":"reality mapping project"===e?s="realitymappingproject":"big data analytic"===e?s="bigdataanalytics":"feed"===e?s="feed":"excalibur imagery project"===e?s="excaliburimageryproject":"notebook"===e?s="notebook":"storymap"===e?s="storymap":"survey123 add in"===e?s="survey123addin":"mission"===e?s="mission":"mission report"===e?s="missionreport":"mission template"===e?s="missiontemplate":"quickcapture project"===e?s="quickcaptureproject":"pro report"===e?s="proreport":"pro report template"===e?s="proreporttemplate":"urban model"===e?s="urbanmodel":"urban project"===e?s="urbanproject":"web experience"===e?s="experiencebuilder":"web experience template"===e?s="webexperiencetemplate":"experience builder widget"===e?s="experiencebuilderwidget":"experience builder widget package"===e?s="experiencebuilderwidgetpackage":"workflow"===e?s="workflow":"kernel gateway connection"===e?s="kernelgatewayconnection":"insights script"===e?s="insightsscript":"hub initiative template"===e?s="hubinitiativetemplate":"storymap theme"===e?s="storymaptheme":"knowledge graph"===e?s="knowledgegraph":"knowledge graph layer"===e?s="knowledgegraphlayer":"knowledge studio project"===e?s="knowledgestudio":"native application"===e?s="nativeapp":"native application installer"===e?s="nativeappinstaller":"web link chart"===e?s="linkchart":"knowledge graph web investigation"===e?s="investigation":"ogcfeatureserver"===e?s="features":"pro presentation"===e?s="propresentation":"pro project"===e?s="proproject":"insights workbook package"===e?s="insightsworkbookpackage":"apache parquet"===e?s="apacheparquet":"notebook code snippet library"===e?s="notebookcodesnippets":"suitability model"===e?s="suitabilitymodel":"esri classifier definition"===e?s="classifierdefinition":"esri classification schema"===e?s="classificationschema":"insights data engineering workbook"===e?s="dataengineeringworkbook":"insights data engineering model"===e?s="dataengineeringmodel":"deep learning studio project"===e?s="deeplearningproject":"discussion"===e?s="discussion":"allsource project"===e?s="allsourceproject":"api key"===e?s="apikey":"data pipeline"===e?s="datapipelines":"group layer"===e?(m=i.includes("Map"),s=m?"layergroup2d":"layergroup"):s="media layer"===e?"onlinemedialayer":"form"===e?i.includes("Survey123")?"survey":"datafilesgray":"csv"===e?"csv":"image"===e?"image":"xr experience"===e?"xrexperience":"maps",s?t(r+s+o+".png"):null}get isLayer(){return null!=this.type&&f.has(this.type)}get itemCdnUrl(){return y(this.itemUrl)}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get loaded(){return super.loaded}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){const e=this.portal?.restUrl;if(!e)return null;const t=this.owner||this.portal?.user?.id;if(!t)return null;return`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`}load(e){const t=this.portal??(this.portal=m.getDefault()),i=t.load(e).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:null!=e?e.signal:null,query:{token:this.apiKey}}):{}).then(e=>{this.sourceJSON=e,this.read(e)});return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}},i=e instanceof g?e.rating:e;return null==i||isNaN(i)||"number"!=typeof e||(t.query.rating=i),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new g({rating:i,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:o(this.applicationProxies),avgRating:this.avgRating,categories:o(this.categories),classification:o(this.classification),created:o(this.created),culture:this.culture,description:this.description,extent:o(this.extent),groupCategories:o(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:o(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:o(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:o(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:o(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new v({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const t of["tags","typeKeywords","categories"])e[t]=e[t]?.join(", ");for(const t of["extent","classification"]){const i=e[t];i&&(e[t]=JSON.stringify(i))}return e}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return this.portal.request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return null!=t.rating?(t.created=new Date(t.created),new g(t)):null}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},v)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(e=>(this.applicationProxies&&!Object.hasOwn(e,"appProxies")&&(this.applicationProxies=null),this.sourceJSON=e,this.read(e),this))}update(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e?.data,i={method:"post"};i.query=this.createPostQuery();for(const e in i.query)null===i.query[e]&&(i.query[e]="");return i.query.clearEmptyFields=!0,null!=t&&("string"==typeof t?i.query.text=t:"object"==typeof t&&(i.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,i).then(()=>this.reload())}):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new i("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:r}=this;await t.signIn();const{copyResources:o,folder:s,tags:a,title:n}=e||{},l={method:"post",query:{copyPrivateResources:"all"===o,folder:"string"==typeof s?s:s?.id,includeResources:!!o,tags:a?.join(","),title:n}},{itemId:p}=await t.request(`${r}/copy`,l);return new v({id:p,portal:t})}updateThumbnail(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e.thumbnail,i=e.filename,r={method:"post"};if("string"==typeof t)n(t)?r.query={data:t}:r.query={url:l(t)},null!=i&&(r.query.filename=i);else{const e=new FormData;null!=i?e.append("file",t,i):e.append("file",t),r.body=e}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then(()=>this.reload())}):Promise.reject(new i("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:i}=await(import("./support/resourceUtils.js"));return i(this,e,t)}async addResource(e,t,i){const{addOrUpdateResources:r}=await(import("./support/resourceUtils.js"));return e.portalItem=this,await r(this,[{resource:e,content:t,compress:i?.compress,access:i?.access}],"add",i),e}async removeResource(e,t){const{removeResource:r}=await(import("./support/resourceUtils.js"));if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new i("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await(import("./support/resourceUtils.js"));return t(this,e)}resourceFromPath(e){return new h({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:o(this.categories),classification:o(this.classification),created:this.created?.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:o(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:o(this.typeKeywords),url:this.url};return s(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new v({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};e([p({type:["private","shared","org","public"]})],k.prototype,"access",void 0),e([p()],k.prototype,"accessInformation",void 0),e([p({type:String})],k.prototype,"apiKey",void 0),e([p({json:{read:{source:"appProxies"}}})],k.prototype,"applicationProxies",void 0),e([p()],k.prototype,"avgRating",void 0),e([p()],k.prototype,"categories",void 0),e([p()],k.prototype,"classification",void 0),e([p({type:Date})],k.prototype,"created",void 0),e([p()],k.prototype,"culture",void 0),e([p()],k.prototype,"description",void 0),e([p({readOnly:!0})],k.prototype,"displayName",null),e([p({type:u})],k.prototype,"extent",void 0),e([w("extent")],k.prototype,"readExtent",null),e([p()],k.prototype,"groupCategories",void 0),e([p({readOnly:!0})],k.prototype,"iconUrl",null),e([p()],k.prototype,"id",void 0),e([p({readOnly:!0})],k.prototype,"isLayer",null),e([p({type:Boolean,readOnly:!0})],k.prototype,"isOrgItem",void 0),e([p()],k.prototype,"itemControl",void 0),e([p({readOnly:!0})],k.prototype,"itemPageUrl",null),e([p({readOnly:!0})],k.prototype,"itemUrl",null),e([p()],k.prototype,"licenseInfo",void 0),e([p({type:Date})],k.prototype,"modified",void 0),e([p()],k.prototype,"name",void 0),e([p()],k.prototype,"numComments",void 0),e([p()],k.prototype,"numRatings",void 0),e([p()],k.prototype,"numViews",void 0),e([p()],k.prototype,"owner",void 0),e([p()],k.prototype,"ownerFolder",void 0),e([p({type:m})],k.prototype,"portal",void 0),e([p()],k.prototype,"screenshots",void 0),e([p()],k.prototype,"size",void 0),e([p()],k.prototype,"snippet",void 0),e([p()],k.prototype,"sourceJSON",void 0),e([p({type:String})],k.prototype,"sourceUrl",void 0),e([p({type:String})],k.prototype,"spatialReference",void 0),e([p()],k.prototype,"tags",void 0),e([p()],k.prototype,"thumbnail",void 0),e([p({readOnly:!0})],k.prototype,"thumbnailUrl",null),e([p()],k.prototype,"title",void 0),e([p()],k.prototype,"type",void 0),e([p()],k.prototype,"typeKeywords",void 0),e([p({type:String,json:{read(e,t){if(b.has(t.type)){const t=this.portal?.restUrl;e||=t&&this.id?`${t}/content/items/${this.id}/data`:null}return e}}})],k.prototype,"url",void 0),e([p({readOnly:!0})],k.prototype,"userItemUrl",null),k=v=e([c("esri.portal.PortalItem")],k);export{k as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../core/Error.js";import{findAssociatedFeatureService as a}from"../../layers/support/associatedFeatureServiceUtils.js";import{getLayerModuleTypeStrict as r}from"../../layers/support/fetchService.js";import{LayerLoadContext as t}from"../../layers/support/LayerLoadContext.js";import{layersLoaderMap as s}from"../../layers/support/layersLoader.js";import{sceneServiceLayerTypeToClassName as n,applyPreferredHostToPortalItem as c,getPreferredHost as o}from"../../layers/support/layerUtils.js";import i from"../PortalItem.js";import{getFirstLayerOrTable as u,getNumLayersAndTables as l,preprocessFSItemData as y,getLayerOrTable as m,layerTypeToLayerModuleType as p,populateSceneServiceItemData as f}from"./loadUtils.js";import{hasTypeKeyword as d}from"./portalItemUtils.js";async function w(e){let{portalItem:a}=e;!a||a instanceof i||(a=new i(a));const r=await L(a);return new(0,r.constructor)({portalItem:a,...r.properties})}async function L(e){await e.load();const a=new t;return N(await S(e,a))}async function S(a,r){switch(a.type){case"3DTiles Service":return a.typeKeywords.includes("3DObject")?F():a.typeKeywords.includes("GaussianSplat")?b():P();case"CSV":return K();case"Feature Collection":return M(a);case"Feature Service":return v(a,r);case"Feed":return x();case"GeoJson":return G();case"Group Layer":return J();case"Image Service":return g(a,r);case"KML":return V();case"Knowledge Graph Layer":return W();case"Map Service":return h(a,r);case"Media Layer":return k();case"Scene Service":return I(a,r);case"Stream Service":return j();case"Video Service":return T(a,r);case"Vector Tile Service":return C();case"WCS":return U();case"WFS":return $();case"WMS":return D();case"WMTS":return O();default:throw new e("portal:unknown-item-type","Unknown item type '${type}'",{type:a.type})}}async function N(e){const a=e.className,r=s[a];return{constructor:await r(),properties:e.properties}}async function h(e,a){return await A(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function v(e,a){const r=await E(e,a);if("object"==typeof r){const{sourceJSON:e,className:a}=r,t={sourceJSON:e};return null!=r.id&&(t.layerId=r.id),{className:a||"FeatureLayer",properties:t}}return{className:"GroupLayer"}}async function I(e,r){const t=await E(e,r,async()=>{try{if(!e.url)return[];const{serverUrl:t}=await a(e.url,{sceneLayerItem:e}),s=await r.fetchServiceMetadata(t);return s?.tables??[]}catch{return[]}});if("object"==typeof t){const a={};let s;if(null!=t.id?(a.layerId=t.id,s=`${e.url}/layers/${t.id}`):s=e.url,e.typeKeywords?.length)for(const r of Object.keys(n))if(e.typeKeywords.includes(r))return{className:n[r]};const c=await r.fetchServiceMetadata(s,{customParameters:await r.fetchCustomParameters(e,e=>u(e)?.customParameters)});return{className:n[c?.layerType]||"SceneLayer",properties:a}}if(!1===t){const a=await r.fetchServiceMetadata(e.url);if("Voxel"===a?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}async function M(e){await e.load();const a=d(e,"Map Notes"),r=d(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if(d(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===l(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function g(e,a){await e.load();const r=e.typeKeywords?.map(e=>e.toLowerCase())??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await a.fetchItemData(e),s=t?.layerType;if("ArcGISTiledImageServiceLayer"===s)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===s)return{className:"ImageryLayer"};const n=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),c=n.cacheType?.toLowerCase(),o=n.capabilities?.toLowerCase().includes("tilesonly"),i=n.tileInfo?.format?.toLowerCase()??"",u=null==c&&["jpg","jpeg","png","png8","png24","png32","mixed"].includes(i);return"map"===c||u||o?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function j(){return{className:"StreamLayer"}}async function T(e,a){return"object"==typeof await E(e,a)?{className:"VideoLayer"}:{className:"GroupLayer"}}function C(){return{className:"VectorTileLayer"}}function G(){return{className:"GeoJSONLayer"}}function P(){return{className:"IntegratedMesh3DTilesLayer"}}function b(){return{className:"GaussianSplatLayer"}}function F(){return{className:"UnsupportedLayer"}}function K(){return{className:"CSVLayer"}}function V(){return{className:"KMLLayer"}}function W(){return{className:"KnowledgeGraphLayer"}}function U(){return{className:"WCSLayer"}}function $(){return{className:"WFSLayer"}}function D(){return{className:"WMSLayer"}}function O(){return{className:"WMTSLayer"}}function x(){return{className:"StreamLayer"}}function J(){return{className:"GroupLayer"}}function k(){return{className:"MediaLayer"}}async function A(e,a){const{tileInfo:r}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return r}async function E(a,t,s){const{url:n,type:i}=a,d="Feature Service"===i;if(!n)return{};if(/\/\d+$/.test(n)){if(d){const s=await t.fetchServiceMetadata(n,{customParameters:await t.fetchCustomParameters(a,e=>u(e)?.customParameters)});c(a,o());const{id:i,type:l}=s,y=r(l);if(!y)throw new e("from-portal-item:unsupported",`'${n}' has unsupported type: '${l}'`);return{id:i,className:y,sourceJSON:s}}return{}}if("Video Service"===i){const e=await t.fetchServiceMetadata(n);return!((e.layers?.length??0)>1)&&{}}await a.load();let w=await t.fetchItemData(a);if(d){const{data:r,preferredHost:s}=await y(w,n,t);if(0===l(r))throw new e("from-portal-item:no-data",`The feature service '${n}' does not have any supported layers or tables`);c(a,s);const o=R(r);if("object"==typeof o){const e=m(r,o.id);return{id:o.id,className:p(e?.layerType)}}return o}"Scene Service"===i&&(w=await f(a,w,t));if(l(w)>0)return R(w);const L=await t.fetchServiceMetadata(n);return s&&(L.tables=await s()),R(L)}function R(e){return 1===l(e)&&{id:u(e)?.id}}export{w as fromItem,S as selectLayerClassPath};
2
+ import e from"../../core/Error.js";import{findAssociatedFeatureService as a}from"../../layers/support/associatedFeatureServiceUtils.js";import{getLayerModuleTypeStrict as r}from"../../layers/support/fetchService.js";import{LayerLoadContext as t}from"../../layers/support/LayerLoadContext.js";import{layersLoaderMap as s}from"../../layers/support/layersLoader.js";import{sceneServiceLayerTypeToClassName as n,applyPreferredHostToPortalItem as c,getPreferredHost as o}from"../../layers/support/layerUtils.js";import i from"../PortalItem.js";import{getFirstLayerOrTable as u,getNumLayersAndTables as l,preprocessFSItemData as y,getLayerOrTable as m,layerTypeToLayerModuleType as p,populateSceneServiceItemData as f}from"./loadUtils.js";import{hasTypeKeyword as d}from"./portalItemUtils.js";async function w(e){let{portalItem:a}=e;!a||a instanceof i||(a=new i(a));const r=await L(a);return new(0,r.constructor)({portalItem:a,...r.properties})}async function L(e){await e.load();const a=new t;return S(await N(e,a))}async function N(a,r){switch(a.type){case"3DTiles Service":return a.typeKeywords.includes("3DObject")?b():a.typeKeywords.includes("GaussianSplat")?F():P();case"CSV":return K();case"Feature Collection":return M(a);case"Feature Service":return v(a,r);case"Feed":return J();case"GeoJson":return C();case"Group Layer":return k();case"Image Service":return g(a,r);case"KML":return D();case"Knowledge Graph Layer":return W();case"Map Service":return h(a,r);case"Media Layer":return A();case"PDF":return V();case"Scene Service":return I(a,r);case"Stream Service":return j();case"Video Service":return T(a,r);case"Vector Tile Service":return G();case"WCS":return U();case"WFS":return $();case"WMS":return O();case"WMTS":return x();default:throw new e("portal:unknown-item-type","Unknown item type '${type}'",{type:a.type})}}async function S(e){const a=e.className,r=s[a];return{constructor:await r(),properties:e.properties}}async function h(e,a){return await E(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function v(e,a){const r=await R(e,a);if("object"==typeof r){const{sourceJSON:e,className:a}=r,t={sourceJSON:e};return null!=r.id&&(t.layerId=r.id),{className:a||"FeatureLayer",properties:t}}return{className:"GroupLayer"}}async function I(e,r){const t=await R(e,r,async()=>{try{if(!e.url)return[];const{serverUrl:t}=await a(e.url,{sceneLayerItem:e}),s=await r.fetchServiceMetadata(t);return s?.tables??[]}catch{return[]}});if("object"==typeof t){const a={};let s;if(null!=t.id?(a.layerId=t.id,s=`${e.url}/layers/${t.id}`):s=e.url,e.typeKeywords?.length)for(const r of Object.keys(n))if(e.typeKeywords.includes(r))return{className:n[r]};const c=await r.fetchServiceMetadata(s,{customParameters:await r.fetchCustomParameters(e,e=>u(e)?.customParameters)});return{className:n[c?.layerType]||"SceneLayer",properties:a}}if(!1===t){const a=await r.fetchServiceMetadata(e.url);if("Voxel"===a?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}async function M(e){await e.load();const a=d(e,"Map Notes"),r=d(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if(d(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===l(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function g(e,a){await e.load();const r=e.typeKeywords?.map(e=>e.toLowerCase())??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await a.fetchItemData(e),s=t?.layerType;if("ArcGISTiledImageServiceLayer"===s)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===s)return{className:"ImageryLayer"};const n=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),c=n.cacheType?.toLowerCase(),o=n.capabilities?.toLowerCase().includes("tilesonly"),i=n.tileInfo?.format?.toLowerCase()??"",u=null==c&&["jpg","jpeg","png","png8","png24","png32","mixed"].includes(i);return"map"===c||u||o?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function j(){return{className:"StreamLayer"}}async function T(e,a){return"object"==typeof await R(e,a)?{className:"VideoLayer"}:{className:"GroupLayer"}}function G(){return{className:"VectorTileLayer"}}function C(){return{className:"GeoJSONLayer"}}function P(){return{className:"IntegratedMesh3DTilesLayer"}}function F(){return{className:"GaussianSplatLayer"}}function b(){return{className:"UnsupportedLayer"}}function K(){return{className:"CSVLayer"}}function V(){return{className:"GeospatialPDFLayer"}}function D(){return{className:"KMLLayer"}}function W(){return{className:"KnowledgeGraphLayer"}}function U(){return{className:"WCSLayer"}}function $(){return{className:"WFSLayer"}}function O(){return{className:"WMSLayer"}}function x(){return{className:"WMTSLayer"}}function J(){return{className:"StreamLayer"}}function k(){return{className:"GroupLayer"}}function A(){return{className:"MediaLayer"}}async function E(e,a){const{tileInfo:r}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return r}async function R(a,t,s){const{url:n,type:i}=a,d="Feature Service"===i;if(!n)return{};if(/\/\d+$/.test(n)){if(d){const s=await t.fetchServiceMetadata(n,{customParameters:await t.fetchCustomParameters(a,e=>u(e)?.customParameters)});c(a,o());const{id:i,type:l}=s,y=r(l);if(!y)throw new e("from-portal-item:unsupported",`'${n}' has unsupported type: '${l}'`);return{id:i,className:y,sourceJSON:s}}return{}}if("Video Service"===i){const e=await t.fetchServiceMetadata(n);return!((e.layers?.length??0)>1)&&{}}await a.load();let w=await t.fetchItemData(a);if(d){const{data:r,preferredHost:s}=await y(w,n,t);if(0===l(r))throw new e("from-portal-item:no-data",`The feature service '${n}' does not have any supported layers or tables`);c(a,s);const o=H(r);if("object"==typeof o){const e=m(r,o.id);return{id:o.id,className:p(e?.layerType)}}return o}"Scene Service"===i&&(w=await f(a,w,t));if(l(w)>0)return H(w);const L=await t.fetchServiceMetadata(n);return s&&(L.tables=await s()),H(L)}function H(e){return 1===l(e)&&{id:u(e)?.id}}export{w as fromItem,N as selectLayerClassPath};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const a="20260924",e="a18b1d03a3aea0ff86a60ab5ea1a03f39dae2617";export{a as buildDate,e as revision};
2
+ const d="20260926",f="c89bf1de885b54a1f586c98abd58f9f5a1d37d55";export{d as buildDate,f as revision};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../Color.js";import{isRGB as r}from"../../core/colorUtils.js";import{clone as i}from"../../core/lang.js";import s from"../../layers/support/FieldsIndex.js";import{createRendererExpression as t}from"../../support/ArcadeExpression.js";import{normalizeDashEffectTemplate as o}from"./dashUtils.js";import{toLowerCaseProps as a,normalizePrimitiveOverrideProps as c,attributesToFields as l,analyzeTextParts as n,assignTextValuesFromFeature as p,uncapitalize as f}from"./utils.js";import m from"../../views/2d/arcade/callExpressionWithFeature.js";const y=e=>{if(!e)return[0,0,0,0];const{r,g:i,b:s,a:t}=e;return[r,i,s,255*t]};class v{static findApplicableOverrides(e,r,i){if(e&&r){if(e.primitiveName){let s=!1;for(const r of i)if(r.primitiveName===e.primitiveName){s=!0;break}if(!s)for(const t of r)t.primitiveName===e.primitiveName&&i.push(t)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const s of e.effects)v.findApplicableOverrides(s,r,i);if(e.symbolLayers)for(const s of e.symbolLayers)v.findApplicableOverrides(s,r,i);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(e.effects)for(const s of e.effects)v.findApplicableOverrides(s,r,i);if(e.markerPlacement&&v.findApplicableOverrides(e.markerPlacement,r,i),"CIMVectorMarker"===e.type){if(e.markerGraphics)for(const s of e.markerGraphics)v.findApplicableOverrides(s,r,i),v.findApplicableOverrides(s.symbol,r,i)}else"CIMCharacterMarker"===e.type?v.findApplicableOverrides(e.symbol,r,i):"CIMHatchFill"===e.type?v.findApplicableOverrides(e.lineSymbol,r,i):"CIMPictureMarker"===e.type&&v.findApplicableOverrides(e.animatedSymbolProperties,r,i)}}}static findEffectOverrides(e,r){if(!e)return null;if("CIMGeometricEffectDashes"===e.type&&o(e),!r||!e.primitiveName)return{type:"cim-effect-param",effect:e,overrides:[]};const i=a(e),s=e.primitiveName,t=[];for(const o of r)o.primitiveName===s&&t.push(a(o));return{type:"cim-effect-param",effect:i,overrides:c(t)}}static async resolveSymbolOverrides(e,r,t,o,a,c,n){if(!e?.symbol)return null;let{symbol:p,primitiveOverrides:f}=e;const m=!!f;if(!m&&!o)return p;p=i(p),f=i(f);let y=!0;if(r||(r={attributes:{}},y=!1),m){if(y||(f=f.filter(e=>!e.valueExpressionInfo?.expression.includes("$feature"))),n||(f=f.filter(e=>!e.valueExpressionInfo?.expression.includes("$view"))),f.length>0){const e=l(r.attributes),i={spatialReference:t,fields:e,geometryType:a};await v.createRenderExpressions(f,i),v.evaluateOverrides(f,r,a??"esriGeometryPoint",c,n,new s(e))}v.applyOverrides(p,f)}return o&&v.applyDictionaryTextOverrides(p,r,o,null),p}static{this._expressionToRenderExpression=new Map}static async createRenderExpressions(e,r){const i=[];for(const s of e){const e=s.valueExpressionInfo;if(!e||v._expressionToRenderExpression.has(e.expression))continue;const o=t(e.expression,r.spatialReference);i.push(o),o.then(r=>v._expressionToRenderExpression.set(e.expression,r))}i.length>0&&await Promise.all(i)}static evaluateOverrides(e,i,s,t,o,a){const c={$view:{scale:o?.scale}};for(const l of e){l.value&&"object"==typeof l.value&&r(l.value)&&("Color"===l.propertyName||"StrokeColor"===l.propertyName)&&(l.value=y(l.value));const e=l.valueExpressionInfo;if(!e)continue;const o=v._expressionToRenderExpression.get(e.expression);o&&(l.value=m(o,i,c,s,a,t))}}static applyDictionaryTextOverrides(e,r,i,s,t="Normal"){if(e?.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const o=e.symbolLayers;if(!o)return;for(const a of o)a&&"CIMVectorMarker"===a.type&&v.applyDictionaryTextOverrides(a,r,i,s,"CIMTextSymbol"===e.type?e.textCase:t)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return;for(const e of t)e&&v.applyDictionaryTextOverrides(e,r,i,s)}break;case"CIMMarkerGraphic":{const o=e.textString;if(o&&o.includes("[")){const a=n(o,i);e.textString=p(r,a,s,t)}}}}static applyOverrides(e,r,i,s){if(e.primitiveName)for(const t of r)if(t.primitiveName===e.primitiveName){const r=f(t.propertyName);if(s&&s.push({cim:e,nocapPropertyName:r,value:e[r]}),i){let r=!1;for(const s of i)s.primitiveName===e.primitiveName&&(r=!0);r||i.push(t)}null!=t.value&&(e[r]=t.value)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const t of e.effects)v.applyOverrides(t,r,i,s);if(e.symbolLayers)for(const t of e.symbolLayers)v.applyOverrides(t,r,i,s);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const t of e.effects)v.applyOverrides(t,r,i,s);if("CIMVectorMarker"===e.type&&e.markerGraphics)for(const t of e.markerGraphics)v.applyOverrides(t,r,i,s),v.applyOverrides(t.symbol,r,i,s)}}static restoreOverrides(e){for(const r of e)r.cim[r.nocapPropertyName]=r.value}static buildOverrideKey(e){let r="";for(const i of e)void 0!==i.value&&(r+=`${i.primitiveName}${i.propertyName}${JSON.stringify(i.value)}`);return r}static toValue(r,i){if("DashTemplate"===r)return i.split(" ").map(e=>Number(e));if("Color"===r){const r=new e(i).toRgba();return r[3]*=255,r}return i}}export{v as OverrideHelper};
2
+ import e from"../../Color.js";import{isRGB as r}from"../../core/colorUtils.js";import{clone as i}from"../../core/lang.js";import t from"../../layers/support/FieldsIndex.js";import{createRendererExpression as s}from"../../support/ArcadeExpression.js";import{normalizeDashEffectTemplate as o}from"./dashUtils.js";import{toLowerCaseProps as a,normalizePrimitiveOverrideProps as c,attributesToFields as l,analyzeTextParts as n,assignTextValuesFromFeature as p,uncapitalize as f}from"./utils.js";import m from"../../views/2d/arcade/callExpressionWithFeature.js";const y=e=>{if(!e)return[0,0,0,0];const{r,g:i,b:t,a:s}=e;return[r,i,t,255*s]};class v{static findApplicableOverrides(e,r,i){if(e&&r){if(e.primitiveName){let t=!1;for(const r of i)if(r.primitiveName===e.primitiveName){t=!0;break}if(!t)for(const s of r)s.primitiveName===e.primitiveName&&i.push(s)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const t of e.effects)v.findApplicableOverrides(t,r,i);if(e.symbolLayers)for(const t of e.symbolLayers)v.findApplicableOverrides(t,r,i);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(e.effects)for(const t of e.effects)v.findApplicableOverrides(t,r,i);if(e.markerPlacement&&v.findApplicableOverrides(e.markerPlacement,r,i),"CIMVectorMarker"===e.type){if(e.markerGraphics)for(const t of e.markerGraphics)v.findApplicableOverrides(t,r,i),v.findApplicableOverrides(t.symbol,r,i)}else"CIMCharacterMarker"===e.type?v.findApplicableOverrides(e.symbol,r,i):"CIMHatchFill"===e.type?v.findApplicableOverrides(e.lineSymbol,r,i):"CIMPictureMarker"===e.type&&v.findApplicableOverrides(e.animatedSymbolProperties,r,i)}}}static findEffectOverrides(e,r){if(!e)return null;if("CIMGeometricEffectDashes"===e.type&&o(e),!r||!e.primitiveName)return{type:"cim-effect-param",effect:e,overrides:[]};const i=a(e),t=e.primitiveName,s=[];for(const o of r)o.primitiveName===t&&s.push(a(o));return{type:"cim-effect-param",effect:i,overrides:c(s)}}static async resolveSymbolOverrides(e,r,s,o,a,c,n){if(!e?.symbol)return null;let{symbol:p,primitiveOverrides:f}=e;const m=!!f;if(!m&&!o)return p;p=i(p),f=i(f);let y=!0;if(r||(r={attributes:{}},y=!1),m){if(y||(f=f.filter(e=>!e.valueExpressionInfo?.expression.includes("$feature"))),n||(f=f.filter(e=>!e.valueExpressionInfo?.expression.includes("$view"))),f.length>0){const e=l(r.attributes),i={spatialReference:s,fields:e,geometryType:a};await v.createRenderExpressions(f,i),v.evaluateOverrides(f,r,a??"esriGeometryPoint",c,n,new t(e))}v.applyOverrides(p,f)}return o&&v.applyDictionaryTextOverrides(p,r,o,null),p}static{this._expressionToRenderExpression=new Map}static async createRenderExpressions(e,r){const i=[];for(const t of e){const e=t.valueExpressionInfo;if(!e||v._expressionToRenderExpression.has(e.expression))continue;const o=s(e.expression,r.spatialReference);i.push(o),o.then(r=>v._expressionToRenderExpression.set(e.expression,r))}i.length>0&&await Promise.all(i)}static evaluateOverrides(e,i,t,s,o,a){const c={$view:{scale:o?.scale}};for(const l of e){l.value&&"object"==typeof l.value&&r(l.value)&&("Color"===l.propertyName||"StrokeColor"===l.propertyName)&&(l.value=y(l.value));const e=l.valueExpressionInfo;if(!e)continue;const o=v._expressionToRenderExpression.get(e.expression);o&&(l.value=m(o,i,c,t,a,s),l.value=this.toValue(l.propertyName,l.value))}}static applyDictionaryTextOverrides(e,r,i,t,s="Normal"){if(e?.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const o=e.symbolLayers;if(!o)return;for(const a of o)a&&"CIMVectorMarker"===a.type&&v.applyDictionaryTextOverrides(a,r,i,t,"CIMTextSymbol"===e.type?e.textCase:s)}break;case"CIMVectorMarker":{const s=e.markerGraphics;if(!s)return;for(const e of s)e&&v.applyDictionaryTextOverrides(e,r,i,t)}break;case"CIMMarkerGraphic":{const o=e.textString;if(o&&o.includes("[")){const a=n(o,i);e.textString=p(r,a,t,s)}}}}static applyOverrides(e,r,i,t){if(e.primitiveName)for(const s of r)if(s.primitiveName===e.primitiveName){const r=f(s.propertyName);if(t&&t.push({cim:e,nocapPropertyName:r,value:e[r]}),i){let r=!1;for(const t of i)t.primitiveName===e.primitiveName&&(r=!0);r||i.push(s)}null!=s.value&&(e[r]=s.value)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const s of e.effects)v.applyOverrides(s,r,i,t);if(e.symbolLayers)for(const s of e.symbolLayers)v.applyOverrides(s,r,i,t);break;case"CIMTextSymbol":v.applyOverrides(e.symbol,r,i,t);break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const s of e.effects)v.applyOverrides(s,r,i,t);if("CIMVectorMarker"===e.type&&e.markerGraphics)for(const s of e.markerGraphics)v.applyOverrides(s,r,i,t),v.applyOverrides(s.symbol,r,i,t)}}static restoreOverrides(e){for(const r of e)r.cim[r.nocapPropertyName]=r.value}static buildOverrideKey(e){let r="";for(const i of e)void 0!==i.value&&(r+=`${i.primitiveName}${i.propertyName}${JSON.stringify(i.value)}`);return r}static toValue(r,i){if(null==i)return null;if("DashTemplate"===r)return i.split(" ").map(e=>Number(e));if("Color"===r||"StrokeColor"===r){const r=new e(i).toRgba();return r[3]*=255,r}return i}}export{v as OverrideHelper};
@@ -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{fromRotation as e,multiply as n,translate as i,rotate as o}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as s}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as h,set as r}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as l,getYAnchorDirection as c}from"../../alignmentUtils.js";import{magicLabelLineHeight as d}from"../../definitions.js";import f from"../../Rect.js";import g from"../../collisions/BoundingBox.js";const u=22,m=4,p=2,y=u-6,x=Math.PI/180,w=8,b=1.5;class M{static fromGlyph(t,e,n,i,o){const{mosaicItem:s,rect:h,shaping:r,code:a}=n,l=s.rect;return new M({width:0===a?h.width:l.width*i,height:0===a?h.height:l.height*i,x:i*(t+r.xOffset+h.left),y:i*(e+r.yOffset-h.top),textureBinding:s.textureBinding,texcoords:{topLeft:[l.x,l.y],topRight:[l.x+l.width,l.y],bottomLeft:[l.x,l.y+l.height],bottomRight:[l.x+l.width,l.y+l.height]},fontSize:o?.fontSize,color:o?.color})}constructor(t){this._rotationT=s(),this._transform=s(),this._angle=0,this._bounds=null,this.width=t.width,this.height=t.height,this.x=t.x,this.y=t.y,this.textureBinding=t.textureBinding,this.texcoords=t.texcoords,this.fontSize=t.fontSize,this.color=t.color}set angle(t){this._angle=t,e(this._rotationT,-t),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){const{x:t,y:i,width:o,height:r}=this,a=e(s(),-this.angle),l=n(s(),a,this._transform);this._offsets={topLeft:h([0,0],[t,i],l),topRight:h([0,0],[t+o,i],l),bottomLeft:h([0,0],[t,i+r],l),bottomRight:h([0,0],[t+o,i+r],l)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){const t=this.offsets;let e=1/0,n=1/0,i=-1/0,o=-1/0;for(const[l,c]of[t.topLeft,t.topRight,t.bottomLeft,t.bottomRight])e=Math.min(e,l),n=Math.min(n,c),i=Math.max(i,l),o=Math.max(o,c);const s=i-e,h=o-n,r=e+s/2,a=n+h/2;this._bounds=new g(r,a,s,h)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}}const _=(t,e)=>({code:0,mosaicItem:{rect:new f(0,0,11,8),sdf:!0,page:0,textureBinding:e},rect:{height:4,width:t,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function A(e){return"underline"===e?t(p):0}function v(t,e,n,i,o){switch(t){case"underline":return(n??o?.baseline??u)+m+A(t)/e;case"line-through":return i??o?.midline??y;default:return 0}}function z(t,e){return t.forEach(t=>h(t,t,e)),{topLeft:t[0],topRight:t[1],bottomLeft:t[2],bottomRight:t[3]}}class B{constructor(t,e,n,i){this._rotation=0,this._decorate(t,e,n,i),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=0!==n.angle,this._transform=this._createGlyphTransform(this.bounds,n),this._borderLineSizePx=n.borderLineSizePx,(n.borderLineSizePx||n.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const o of t)o.setTransform(this._transform)}setRotation(t){if(0===t&&0===this._rotation)return;this._rotation=t;const i=this._transform,o=e(s(),t);n(i,o,i);for(const e of this.glyphs)e.setTransform(this._transform)}_decorate(t,e,n,i){if(!n.decoration||"none"===n.decoration||!t.length)return;const o=n.scale,s=t[0].textureBinding;for(const h of e){const e=h.scale??o,r=v(n.decoration,e,h.baseline,h.midline,i),a=h.startX*e,l=h.startY*e,c=(h.width+h.glyphWidthEnd)*e;t.push(M.fromGlyph(a,l+r*e,_(c,s),1))}}shapeBackground(t){const e=this._borderLineSizePx||0,n=(b+e)/2,i=this._borderLineSizePx?n:0,{xmin:o,ymin:s,xmax:h,ymax:r,x:a,y:l,width:c,height:d}=this.bounds,f=[o-w,s-w],u=[h+w,s-w],m=[o-w,r+w],p=[h+w,r+w],y=z([[f[0]-n,f[1]-n],[u[0]+n,u[1]-n],[f[0]+i,f[1]+i],[u[0]-i,u[1]+i]],t),x=z([[m[0]+i,m[1]-i],[p[0]-i,p[1]-i],[m[0]-n,m[1]+n],[p[0]+n,p[1]+n]],t),M=z([[f[0]-n,f[1]-n],[f[0]+i,f[1]+i],[m[0]-n,m[1]+n],[m[0]+i,m[1]-i]],t),_=z([[u[0]-i,u[1]+i],[u[0]+n,u[1]-n],[p[0]-i,p[1]-i],[p[0]+n,p[1]+n]],t),A={main:z([f,u,m,p],t),top:y,bot:x,left:M,right:_};return[new g(a,l,c+2*n,d+2*n),A]}get boundsT(){const t=this.bounds,e=r(a(),t.x,t.y);if(h(e,e,this._transform),this._hasRotation){const n=Math.max(t.width,t.height);return new g(e[0],e[1],n,n)}return new g(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,n=1/0,i=0,o=0;for(const r of t)e=Math.min(e,r.offsets.topLeft[0]),n=Math.min(n,r.offsets.topLeft[1]),i=Math.max(i,r.offsets.bottomRight[0]),o=Math.max(o,r.offsets.bottomRight[1]);const s=i-e,h=o-n;return new g(e+s/2,n+h/2,s,h)}_createGlyphTransform(t,e){const n=x*e.angle,h=s(),l=a();return i(h,h,r(l,e.xOffset,-e.yOffset)),e.useCIMAngleBehavior?o(h,h,n):(i(h,h,r(l,t.x,t.y)),o(h,h,n),i(h,h,r(l,-t.x,-t.y))),h}}class L{constructor(t,e,n,i,o,s){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,n)),this.end=Math.max(0,Math.max(e,n)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].rect.width),this.width=i,this.yMin=o,this.yMax=s}}const R=t=>10===t,S=t=>32===t;function X(t,e,n){const i=new Array,o=1/n.scale,s=n.maxLineWidth*o,h=e?t.length-1:0,r=e?-1:t.length,a=e?-1:1;let l=h,c=0,d=0,f=l,g=f,u=0,m=1/0,p=0;for(;l!==r;){const{code:e,rect:n,shaping:o}=t[l],r=Math.abs(n.top);if(R(e)||S(e)||(m=Math.min(m,r),p=Math.max(p,r+n.height)),R(e))l!==h&&(i.push(new L(t,f,l-a,c,m===1/0?0:m,p)),m=1/0,p=0),c=0,f=l+a,g=l+a,d=0;else if(S(e))g=l+a,d=0,u=o.xAdvance,c+=o.xAdvance;else if(c>s){if(g!==f){const e=g-2*a;c-=u,i.push(new L(t,f,e,c-d,m,p)),m=1/0,p=0,f=g,c=d}else i.push(new L(t,f,l-a,c,m,p)),m=1/0,p=0,f=l,g=l,c=0;c+=o.xAdvance,d+=o.xAdvance}else c+=o.xAdvance,d+=o.xAdvance;l+=a}const y=new L(t,f,l-a,c,m,p);return y.start>=0&&y.end<t.length&&i.push(y),i}function O(t,e){let n=0;for(let s=0;s<t.length;s++){const{width:e}=t[s];n=Math.max(e,n)}const i="underline"===e.decoration?m:0,o=t[0].yMin;return{x:0,y:o,height:t[t.length-1].yMax+e.lineHeight*(t.length-1)+i-o,width:n}}function W(t,e,n){let i=0;for(let o=e;o<n;o++)S(t[o].code)&&!R(t[o+1].code)&&i++;return i}function E(t,e){const n=e.scale,i=new Array,o=t.sdfPadding,{faceInfo:s,glyphs:h,isRightToLeft:r}=t,a="justify"===e.horizontalAlignment||"Justify"===e.horizontalAlignment,d=X(h,r,e),f=d.length?O(d,e):{y:0,height:0,width:0},g=a?r?1:-1:l(e.horizontalAlignment),m=c(e.verticalAlignment),p=2===m?1:0,y=p?0:m-1,x=s?.baseline??u,w=d.length>1,b=p?w?-f.y-f.height:-x:-f.y+y*(f.height/2);for(let l=0;l<d.length;l++){const{start:s,end:r,width:c}=d[l],u=a&&l<d.length-1?W(h,s,r):0,m=u>0?(f.width-c)/u:0;let p=-1*(g+1)*((m>0?f.width:c)/2)-o;const y=(t.isRightToLeft?d.length-1-l:l)*e.lineHeight+b-o;d[l].startX=p,d[l].startY=y;for(let t=s;t<=r;t++){const e=h[t];if(R(e.code))continue;const o=M.fromGlyph(p,y,e,n);p+=e.shaping.xAdvance,m>0&&S(e.code)&&(p+=m),i.push(o)}}return new B(i,d,e,s)}function H(t,e){const n=e.scale,{faceInfo:i,glyphs:o}=t,s=o.reduce((t,e)=>Math.max(t,e.rect.height),0),h=o.map(t=>M.fromGlyph(-t.rect.width/2,-s,t,n));return new B(h,[],e,i)}function Y(t,e){return"glyphs"===t.type?E(t,e):I(t,e)}function j(t,e){return"glyphs"===t.type?H(t,e):T(t,e)}function I(t,e){const n=G(t,e),i=P(n,e),o=i.length?J(i):{width:0},s=new Array,h="underline"===e.decoration?"none":e.decoration,r="justify"===e.horizontalAlignment||"Justify"===e.horizontalAlignment,a=r?-1:l(e.horizontalAlignment),d=c(e.verticalAlignment),f=2===d,g=i.length?i[0].yMin:0,u=i.length?U(i[i.length-1]):0,m=u-g,p=f?i.length>1?-u:-(i[0]?.baseline??0):1===d?-g:-1===d?-u:-(g+m/2);for(let l=0;l<i.length;l++){const t=i[l],e=r&&l<i.length-1?C(n,t.start,t.end):0,h=e>0?(o.width-t.width)/e:0;let c=-1*(a+1)*((h>0?o.width:t.width)/2);const d=t.startY+p;let f=null;t.startX=c,t.startY=d;for(let i=t.start;i<=t.end;i++){const e=n[i],{glyph:o,scale:r,fontSize:a}=e,l=c;if(R(o.code)){f=q(s,f,d,t.baseline);continue}("underline"!==e.decoration||f&&f.underlineOffset!==e.underlineOffset||f&&!D(f.color,e.color))&&(f=q(s,f,d,t.baseline));const g=d+t.baseline-e.baseline;s.push(M.fromGlyph(c/r,g/r,o,r,{fontSize:a,color:e.color})),c+=e.xAdvance,"underline"===e.decoration&&(f??={startX:l,endX:c,glyphWidthEnd:o.rect.width*r,textureBinding:o.mosaicItem.textureBinding,underlineOffset:e.underlineOffset,color:e.color},f.endX=c,f.glyphWidthEnd=o.rect.width*r,f.textureBinding=f.textureBinding??o.mosaicItem.textureBinding),h>0&&S(o.code)&&(c+=h,f&&(f.endX=c))}q(s,f,d,t.baseline)}return new B(s,i,{...e,decoration:h})}function T(t,e){const n=G(t,e),i=n.reduce((t,e)=>Math.max(t,e.glyph.rect.height*e.scale),0),o=n.filter(t=>!R(t.glyph.code)).map(t=>M.fromGlyph(-t.glyph.rect.width/2,-i/t.scale,t.glyph,t.scale,{fontSize:t.fontSize,color:t.color}));return new B(o,[],e)}function G(e,n){const i=n.lineHeightRatio??1,o=[];for(const s of e.runs){const e=t(s.fontSize),n=e/s.glyphs.sdfSize,h=e*(d/24)*i,r=(s.glyphs.faceInfo?.baseline??u)*n,a=(s.glyphs.faceInfo?.midline??y)*n,l=m*n+A(s.decoration),c=1+(s.characterSpacing??0);for(const t of s.glyphs.glyphs){const i=t.shaping.xAdvance*n,d=Math.abs(t.rect.top)*n,f=d+t.rect.height*n;o.push({glyph:t,scale:n,fontSize:e,decoration:s.decoration,underlineOffset:l,color:s.color,xAdvance:R(t.code)||S(t.code)?i:i*c,top:d,bottom:f,lineHeight:h,baseline:r,midline:a})}}return o}function P(t,e){const n=[],i=e.maxLineWidth;let o=0,s=0,h=0,r=0,a=0,l=0;for(;o<t.length;){const e=t[o],{glyph:c}=e;if(R(c.code))0!==o&&n.push({width:s,start:r,end:o-1,glyphWidthEnd:t[o-1]?.glyph.rect.width*t[o-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=0,r=o+1,a=r,h=0,l=0;else if(S(c.code))a=o+1,h=0,l=e.xAdvance,s+=e.xAdvance;else if(s>i){if(a!==r){const e=a-2;s-=l,n.push({width:s-h,start:r,end:e,glyphWidthEnd:t[e]?.glyph.rect.width*t[e]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),r=a,s=h}else n.push({width:s,start:r,end:o-1,glyphWidthEnd:t[o-1]?.glyph.rect.width*t[o-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),r=o,a=o,s=0;s+=e.xAdvance,h+=e.xAdvance}else s+=e.xAdvance,h+=e.xAdvance;o++}if(r<t.length){const e=t.length-1;n.push({width:s,start:r,end:e,glyphWidthEnd:t[e]?.glyph.rect.width*t[e]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1})}return k(t,n)}function k(t,e){for(let n=0;n<e.length;n++){const i=e[n];let o=0,s=1/0,h=0,r=0;for(let e=i.start;e<=i.end;e++){const n=t[e];"underline"===n.decoration&&(r=Math.max(r,n.underlineOffset)),R(n.glyph.code)||S(n.glyph.code)||(o=Math.max(o,n.baseline),h=Math.max(h,n.lineHeight))}let a=1/0,l=-1/0;for(let e=i.start;e<=i.end;e++){const n=t[e];R(n.glyph.code)||S(n.glyph.code)||(a=Math.min(a,o-n.baseline+n.top),l=Math.max(l,o-n.baseline+n.bottom),s=Math.min(s,o-n.baseline+n.midline))}r>0&&(l=Math.max(l,o+r)),i.baseline=o,i.midline=s===1/0?o:s,i.lineHeight=Math.max(h,l),i.yMin=a===1/0?0:a,i.yMax=l===-1/0?0:l,i.startY=n>0?e[n-1].startY+e[n-1].lineHeight:0}return e}function J(t){let e=0;for(const i of t)e=Math.max(i.width+i.glyphWidthEnd,e);const n=t[0].yMin;return{x:0,y:n,height:U(t[t.length-1])-n,width:e}}function U(t){return t.startY+t.lineHeight}function C(t,e,n){let i=0;for(let o=e;o<n;o++)S(t[o].glyph.code)&&!R(t[o+1].glyph.code)&&i++;return i}function q(t,e,n,i){return e?(t.push(M.fromGlyph(e.startX,n+i+e.underlineOffset,_(e.endX-e.startX+e.glyphWidthEnd,e.textureBinding),1,{color:e.color})),null):null}function D(t,e){return t===e||!!t&&!!e&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}export{M as ShapedGlyph,B as ShapingInfo,E as shapeGlyphs,H as shapeGlyphsForMultipoint,I as shapeRichText,T as shapeRichTextForMultipoint,Y as shapeTextResource,j as shapeTextResourceForMultipoint};
2
+ import{pt2px as t}from"../../../../../../core/screenUtils.js";import{fromRotation as e,multiply as n,translate as i,rotate as o}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as s}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as h,set as r}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as l,getYAnchorDirection as c}from"../../alignmentUtils.js";import{magicLabelLineHeight as d}from"../../definitions.js";import f from"../../Rect.js";import g from"../../collisions/BoundingBox.js";const u=22,m=4,p=2,y=u-6,x=Math.PI/180,w=8,b=1.5;class M{static fromGlyph(t,e,n,i,o){const{mosaicItem:s,rect:h,shaping:r,code:a}=n,l=s.rect;return new M({width:0===a?h.width:l.width*i,height:0===a?h.height:l.height*i,x:i*(t+r.xOffset+h.left),y:i*(e+r.yOffset-h.top),textureBinding:s.textureBinding,texcoords:{topLeft:[l.x,l.y],topRight:[l.x+l.width,l.y],bottomLeft:[l.x,l.y+l.height],bottomRight:[l.x+l.width,l.y+l.height]},fontSize:o?.fontSize,color:o?.color})}constructor(t){this._rotationT=s(),this._transform=s(),this._angle=0,this._bounds=null,this.width=t.width,this.height=t.height,this.x=t.x,this.y=t.y,this.textureBinding=t.textureBinding,this.texcoords=t.texcoords,this.fontSize=t.fontSize,this.color=t.color}set angle(t){this._angle=t,e(this._rotationT,-t),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){const{x:t,y:i,width:o,height:r}=this,a=e(s(),-this.angle),l=n(s(),a,this._transform);this._offsets={topLeft:h([0,0],[t,i],l),topRight:h([0,0],[t+o,i],l),bottomLeft:h([0,0],[t,i+r],l),bottomRight:h([0,0],[t+o,i+r],l)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){const t=this.offsets;let e=1/0,n=1/0,i=-1/0,o=-1/0;for(const[l,c]of[t.topLeft,t.topRight,t.bottomLeft,t.bottomRight])e=Math.min(e,l),n=Math.min(n,c),i=Math.max(i,l),o=Math.max(o,c);const s=i-e,h=o-n,r=e+s/2,a=n+h/2;this._bounds=new g(r,a,s,h)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}}const _=(t,e)=>({code:0,mosaicItem:{rect:new f(0,0,11,8),sdf:!0,page:0,textureBinding:e},rect:{height:4,width:t,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function A(e){return"underline"===e?t(p):0}function v(t,e,n,i,o){switch(t){case"underline":return(n??o?.baseline??u)+m+A(t)/e;case"line-through":return i??o?.midline??y;default:return 0}}function B(t,e){return t.forEach(t=>h(t,t,e)),{topLeft:t[0],topRight:t[1],bottomLeft:t[2],bottomRight:t[3]}}class z{constructor(t,e,n,i){this._rotation=0,this._decorate(t,e,n,i),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=0!==n.angle,this._transform=this._createGlyphTransform(this.bounds,n),this._borderLineSizePx=n.borderLineSizePx,(n.borderLineSizePx||n.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const o of t)o.setTransform(this._transform)}setRotation(t){if(0===t&&0===this._rotation)return;this._rotation=t;const i=this._transform,o=e(s(),t);n(i,o,i);for(const e of this.glyphs)e.setTransform(this._transform)}_decorate(t,e,n,i){if(!n.decoration||"none"===n.decoration||!t.length)return;const o=n.scale,s=t[0].textureBinding;for(const h of e){const e=h.scale??o,r=v(n.decoration,e,h.baseline,h.midline,i),a=h.startX*e,l=h.startY*e,c=(h.width+h.glyphWidthEnd)*e;t.push(M.fromGlyph(a,l+r*e,_(c,s),1))}}shapeBackground(t){const e=this._borderLineSizePx||0,n=(b+e)/2,i=this._borderLineSizePx?n:0,{xmin:o,ymin:s,xmax:h,ymax:r,x:a,y:l,width:c,height:d}=this.bounds,f=[o-w,s-w],u=[h+w,s-w],m=[o-w,r+w],p=[h+w,r+w],y=B([[f[0]-n,f[1]-n],[u[0]+n,u[1]-n],[f[0]+i,f[1]+i],[u[0]-i,u[1]+i]],t),x=B([[m[0]+i,m[1]-i],[p[0]-i,p[1]-i],[m[0]-n,m[1]+n],[p[0]+n,p[1]+n]],t),M=B([[f[0]-n,f[1]-n],[f[0]+i,f[1]+i],[m[0]-n,m[1]+n],[m[0]+i,m[1]-i]],t),_=B([[u[0]-i,u[1]+i],[u[0]+n,u[1]-n],[p[0]-i,p[1]-i],[p[0]+n,p[1]+n]],t),A={main:B([f,u,m,p],t),top:y,bot:x,left:M,right:_};return[new g(a,l,c+2*n,d+2*n),A]}get boundsT(){const t=this.bounds,e=r(a(),t.x,t.y);if(h(e,e,this._transform),this._hasRotation){const n=Math.max(t.width,t.height);return new g(e[0],e[1],n,n)}return new g(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,n=1/0,i=0,o=0;for(const r of t)e=Math.min(e,r.offsets.topLeft[0]),n=Math.min(n,r.offsets.topLeft[1]),i=Math.max(i,r.offsets.bottomRight[0]),o=Math.max(o,r.offsets.bottomRight[1]);const s=i-e,h=o-n;return new g(e+s/2,n+h/2,s,h)}_createGlyphTransform(t,e){const n=x*e.angle,h=s(),l=a();return i(h,h,r(l,e.xOffset,-e.yOffset)),e.useCIMAngleBehavior?o(h,h,n):(i(h,h,r(l,t.x,t.y)),o(h,h,n),i(h,h,r(l,-t.x,-t.y))),h}}class L{constructor(t,e,n,i,o,s){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,n)),this.end=Math.max(0,Math.max(e,n)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].rect.width),this.width=i,this.yMin=o,this.yMax=s}}const R=t=>10===t,S=t=>32===t;function X(t,e,n){const i=new Array,o=1/n.scale,s=n.maxLineWidth*o,h=e?t.length-1:0,r=e?-1:t.length,a=e?-1:1;let l=h,c=0,d=0,f=l,g=f,u=0,m=1/0,p=0;for(;l!==r;){const{code:e,rect:n,shaping:o}=t[l],r=Math.abs(n.top);if(R(e)||S(e)||(m=Math.min(m,r),p=Math.max(p,r+n.height)),R(e))l!==h&&(i.push(new L(t,f,l-a,c,m===1/0?0:m,p)),m=1/0,p=0),c=0,f=l+a,g=l+a,d=0;else if(S(e))g=l+a,d=0,u=o.xAdvance,c+=o.xAdvance;else if(c>s){if(g!==f){const e=g-2*a;c-=u,i.push(new L(t,f,e,c-d,m,p)),m=1/0,p=0,f=g,c=d}else i.push(new L(t,f,l-a,c,m,p)),m=1/0,p=0,f=l,g=l,c=0;c+=o.xAdvance,d+=o.xAdvance}else c+=o.xAdvance,d+=o.xAdvance;l+=a}const y=new L(t,f,l-a,c,m,p);return y.start>=0&&y.end<t.length&&i.push(y),i}function O(t,e){let n=0;for(let s=0;s<t.length;s++){const{width:e}=t[s];n=Math.max(e,n)}const i="underline"===e.decoration?m:0,o=t[0].yMin;return{x:0,y:o,height:t[t.length-1].yMax+e.lineHeight*(t.length-1)+i-o,width:n}}function W(t,e,n){let i=0;for(let o=e;o<n;o++)S(t[o].code)&&!R(t[o+1].code)&&i++;return i}function E(t,e){const n=e.scale,i=new Array,o=t.sdfPadding,{faceInfo:s,glyphs:h,isRightToLeft:r}=t,a="justify"===e.horizontalAlignment||"Justify"===e.horizontalAlignment,d=X(h,r,e),f=d.length?O(d,e):{y:0,height:0,width:0},g=a?r?1:-1:l(e.horizontalAlignment),m=c(e.verticalAlignment),p=2===m?1:0,y=p?0:m-1,x=s?.baseline??u,w=d.length>1,b=p?w?-f.y-f.height:-x:-f.y+y*(f.height/2);for(let l=0;l<d.length;l++){const{start:s,end:r,width:c}=d[l],u=a&&l<d.length-1?W(h,s,r):0,m=u>0?(f.width-c)/u:0;let p=-1*(g+1)*((m>0?f.width:c)/2)-o;const y=(t.isRightToLeft?d.length-1-l:l)*e.lineHeight+b-o;d[l].startX=p,d[l].startY=y;for(let t=s;t<=r;t++){const e=h[t];if(R(e.code))continue;const o=M.fromGlyph(p,y,e,n);p+=e.shaping.xAdvance,m>0&&S(e.code)&&(p+=m),i.push(o)}}return new z(i,d,e,s)}function H(t,e){const n=e.scale,{faceInfo:i,glyphs:o}=t,s=o.reduce((t,e)=>Math.max(t,e.rect.height),0),h=o.filter(t=>!R(t.code)&&t.mosaicItem.textureBinding).map(t=>M.fromGlyph(-t.rect.width/2,-s,t,n));return new z(h,[],e,i)}function I(t,e){return"glyphs"===t.type?E(t,e):j(t,e)}function Y(t,e){return"glyphs"===t.type?H(t,e):T(t,e)}function j(t,e){const n=G(t,e),i=P(n,e),o=i.length?J(i):{width:0},s=new Array,h="underline"===e.decoration?"none":e.decoration,r="justify"===e.horizontalAlignment||"Justify"===e.horizontalAlignment,a=r?-1:l(e.horizontalAlignment),d=c(e.verticalAlignment),f=2===d,g=i.length?i[0].yMin:0,u=i.length?U(i[i.length-1]):0,m=u-g,p=f?i.length>1?-u:-(i[0]?.baseline??0):1===d?-g:-1===d?-u:-(g+m/2);for(let l=0;l<i.length;l++){const t=i[l],e=r&&l<i.length-1?C(n,t.start,t.end):0,h=e>0?(o.width-t.width)/e:0;let c=-1*(a+1)*((h>0?o.width:t.width)/2);const d=t.startY+p;let f=null;t.startX=c,t.startY=d;for(let i=t.start;i<=t.end;i++){const e=n[i],{glyph:o,scale:r,fontSize:a}=e,l=c;if(R(o.code)){f=q(s,f,d,t.baseline);continue}("underline"!==e.decoration||f&&f.underlineOffset!==e.underlineOffset||f&&!D(f.color,e.color))&&(f=q(s,f,d,t.baseline));const g=d+t.baseline-e.baseline;s.push(M.fromGlyph(c/r,g/r,o,r,{fontSize:a,color:e.color})),c+=e.xAdvance,"underline"===e.decoration&&(f??={startX:l,endX:c,glyphWidthEnd:o.rect.width*r,textureBinding:o.mosaicItem.textureBinding,underlineOffset:e.underlineOffset,color:e.color},f.endX=c,f.glyphWidthEnd=o.rect.width*r,f.textureBinding=f.textureBinding??o.mosaicItem.textureBinding),h>0&&S(o.code)&&(c+=h,f&&(f.endX=c))}q(s,f,d,t.baseline)}return new z(s,i,{...e,decoration:h})}function T(t,e){const n=G(t,e),i=n.reduce((t,e)=>Math.max(t,e.glyph.rect.height*e.scale),0),o=n.filter(t=>!R(t.glyph.code)&&t.glyph.mosaicItem.textureBinding).map(t=>M.fromGlyph(-t.glyph.rect.width/2,-i/t.scale,t.glyph,t.scale,{fontSize:t.fontSize,color:t.color}));return new z(o,[],e)}function G(e,n){const i=n.lineHeightRatio??1,o=[];for(const s of e.runs){const e=t(s.fontSize),n=e/s.glyphs.sdfSize,h=e*(d/24)*i,r=(s.glyphs.faceInfo?.baseline??u)*n,a=(s.glyphs.faceInfo?.midline??y)*n,l=m*n+A(s.decoration),c=1+(s.characterSpacing??0);for(const t of s.glyphs.glyphs){const i=t.shaping.xAdvance*n,d=Math.abs(t.rect.top)*n,f=d+t.rect.height*n;o.push({glyph:t,scale:n,fontSize:e,decoration:s.decoration,underlineOffset:l,color:s.color,xAdvance:R(t.code)||S(t.code)?i:i*c,top:d,bottom:f,lineHeight:h,baseline:r,midline:a})}}return o}function P(t,e){const n=[],i=e.maxLineWidth;let o=0,s=0,h=0,r=0,a=0,l=0;for(;o<t.length;){const e=t[o],{glyph:c}=e;if(R(c.code))0!==o&&n.push({width:s,start:r,end:o-1,glyphWidthEnd:t[o-1]?.glyph.rect.width*t[o-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=0,r=o+1,a=r,h=0,l=0;else if(S(c.code))a=o+1,h=0,l=e.xAdvance,s+=e.xAdvance;else if(s>i){if(a!==r){const e=a-2;s-=l,n.push({width:s-h,start:r,end:e,glyphWidthEnd:t[e]?.glyph.rect.width*t[e]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),r=a,s=h}else n.push({width:s,start:r,end:o-1,glyphWidthEnd:t[o-1]?.glyph.rect.width*t[o-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),r=o,a=o,s=0;s+=e.xAdvance,h+=e.xAdvance}else s+=e.xAdvance,h+=e.xAdvance;o++}if(r<t.length){const e=t.length-1;n.push({width:s,start:r,end:e,glyphWidthEnd:t[e]?.glyph.rect.width*t[e]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1})}return k(t,n)}function k(t,e){for(let n=0;n<e.length;n++){const i=e[n];let o=0,s=1/0,h=0,r=0;for(let e=i.start;e<=i.end;e++){const n=t[e];"underline"===n.decoration&&(r=Math.max(r,n.underlineOffset)),R(n.glyph.code)||S(n.glyph.code)||(o=Math.max(o,n.baseline),h=Math.max(h,n.lineHeight))}let a=1/0,l=-1/0;for(let e=i.start;e<=i.end;e++){const n=t[e];R(n.glyph.code)||S(n.glyph.code)||(a=Math.min(a,o-n.baseline+n.top),l=Math.max(l,o-n.baseline+n.bottom),s=Math.min(s,o-n.baseline+n.midline))}r>0&&(l=Math.max(l,o+r)),i.baseline=o,i.midline=s===1/0?o:s,i.lineHeight=Math.max(h,l),i.yMin=a===1/0?0:a,i.yMax=l===-1/0?0:l,i.startY=n>0?e[n-1].startY+e[n-1].lineHeight:0}return e}function J(t){let e=0;for(const i of t)e=Math.max(i.width+i.glyphWidthEnd,e);const n=t[0].yMin;return{x:0,y:n,height:U(t[t.length-1])-n,width:e}}function U(t){return t.startY+t.lineHeight}function C(t,e,n){let i=0;for(let o=e;o<n;o++)S(t[o].glyph.code)&&!R(t[o+1].glyph.code)&&i++;return i}function q(t,e,n,i){return e?(t.push(M.fromGlyph(e.startX,n+i+e.underlineOffset,_(e.endX-e.startX+e.glyphWidthEnd,e.textureBinding),1,{color:e.color})),null):null}function D(t,e){return t===e||!!t&&!!e&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}export{M as ShapedGlyph,z as ShapingInfo,E as shapeGlyphs,H as shapeGlyphsForMultipoint,j as shapeRichText,T as shapeRichTextForMultipoint,I as shapeTextResource,Y as shapeTextResourceForMultipoint};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{when as i,watch as o,initial as r,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a,subclass as p}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as c}from"./handlers/DoubleClickZoom.js";import{DoubleTapDragZoom as l}from"./handlers/DoubleTapDragZoom.js";import{DragPan as m}from"./handlers/DragPan.js";import{DragRotate as h}from"./handlers/DragRotate.js";import{DragZoomBox as u}from"./handlers/DragZoomBox.js";import{GamepadNavigation as w}from"./handlers/GamepadNavigation.js";import{KeyPan as d}from"./handlers/KeyPan.js";import{KeyRotate as v}from"./handlers/KeyRotate.js";import{KeyZoom as g}from"./handlers/KeyZoom.js";import{MouseWheelZoom as f}from"./handlers/MouseWheelZoom.js";import{PinchRotateAndZoom as j}from"./handlers/PinchAction.js";import{BrowserEventSource as A}from"../../input/BrowserEventSource.js";import{InputManager as P,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as D}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as M}from"../../input/handlers/support.js";import{DoubleTapDrag as I}from"../../input/recognizers/DoubleTapDrag.js";import{Drag as b}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as z}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as T}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as E}from"../../input/recognizers/SingleAndDoubleClick.js";const N={counter:"Control",precisionPan:"Alt",coarsePan:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwise:["a","A"],counterClockwise:["d","D"],reset:["n","N"]}},C=Symbol("handles");let H=class extends t{initialize(){const e=()=>this.view?.ready;this.addHandles([i(()=>!e(),()=>this._disconnect()),i(e,()=>this._connect())])}destroy(){this._disconnect()}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}_disconnect(){this.view.viewEvents.disconnect(),this.removeHandles(C),this._inputManager=n(this._inputManager)}_connect(){const e=this.view.surface,t=new A(e,this.view.input),n=[new z,new T,new E,new b(this.view.navigation),new I],i=new P({eventSource:t,recognizers:n}),a=new m(this.view,["primary"]),p=new h(this.view,["secondary"]);i.installHandlers("prevent-context-menu",[new _],y.INTERNAL),i.installHandlers("prevent-touch-text-selection-gesture",[new D(this.view)],y.INTERNAL),i.installHandlers("navigation",[new j(this.view),new w(this.view),new f(this.view),new c(this.view),new c(this.view,[N.counter]),new u(this.view),a,new d(this.view,N.pan),new d(this.view,N.pan,[N.coarsePan],4),new d(this.view,N.pan,[N.precisionPan,N.coarsePan],.25),new d(this.view,N.pan,[N.precisionPan],.25),new g(this.view,N.zoom),new v(this.view,N.rotate),p,new l(this.view,"touch")],y.INTERNAL),this.view.viewEvents.connect(i),this._source=t,this._inputManager=i,this.addHandles([o(()=>this.view?.navigation?.browserTouchPanEnabled,e=>{this._source&&(this._source.browserTouchPanningEnabled=!e)},r),o(()=>{const{actionMap:e}=this.view.navigation;return{panActions:M("pan",e),rotateActions:M("rotate",e)}},({panActions:e,rotateActions:t})=>{a.pointerActions=e,p.pointerActions=t},s)],C)}get test(){}};e([a()],H.prototype,"view",void 0),e([a({readOnly:!0})],H.prototype,"updating",null),e([a()],H.prototype,"latestPointerInfo",null),e([a()],H.prototype,"latestPenInfo",null),e([a()],H.prototype,"multiTouchActive",null),H=e([p("esri.views.2d.input.MapViewInputManager")],H);const S=H;export{S as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{when as o,watch as i,initial as r,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a,subclass as p}from"../../../core/accessorSupport/decorators.js";import{DoubleClickZoom as c}from"./handlers/DoubleClickZoom.js";import{DoubleTapDragZoom as l}from"./handlers/DoubleTapDragZoom.js";import{DragPan as m}from"./handlers/DragPan.js";import{DragRotate as u}from"./handlers/DragRotate.js";import{DragZoomBox as h}from"./handlers/DragZoomBox.js";import{GamepadNavigation as w}from"./handlers/GamepadNavigation.js";import{KeyPan as d}from"./handlers/KeyPan.js";import{KeyRotate as v}from"./handlers/KeyRotate.js";import{KeyZoom as g}from"./handlers/KeyZoom.js";import{MouseWheelZoom as f}from"./handlers/MouseWheelZoom.js";import{PinchRotateAndZoom as j}from"./handlers/PinchAction.js";import{BrowserEventSource as A}from"../../input/BrowserEventSource.js";import{InputManager as P,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{PreventTouchSelection as D}from"../../input/handlers/PreventTouchSelection.js";import{getPointerActions as M}from"../../input/handlers/support.js";import{DoubleTapDrag as I}from"../../input/recognizers/DoubleTapDrag.js";import{Drag as b}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as z}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as T}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as E}from"../../input/recognizers/SingleAndDoubleClick.js";const N={counter:"Control",precisionPan:"Alt",coarsePan:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwise:["a","A"],counterClockwise:["d","D"],reset:["n","N"]}},C=Symbol("handles");let H=class extends t{initialize(){const e=()=>this.view?.ready;this.addHandles([o(()=>!e(),()=>this._disconnect()),o(e,()=>this._connect())])}destroy(){this._disconnect()}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get latestPenInfo(){return this._inputManager?.latestPenInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}_disconnect(){this.view.viewEvents.disconnect(),this.removeHandles(C),this._inputManager=n(this._inputManager)}_connect(){const e=this.view.surface,t=new A(e,this.view.input),n=[new z,new T,new E,new b(this.view.navigation),new I],o=new P({eventSource:t,recognizers:n}),a=new m(this.view,["primary"]),p=new u(this.view,["secondary"]);o.installHandlers("prevent-context-menu",[new _],y.INTERNAL),o.installHandlers("prevent-touch-text-selection-gesture",[new D(this.view)],y.INTERNAL),o.installHandlers("navigation",[new j(this.view),new w(this.view),new f(this.view),new c(this.view),new c(this.view,[N.counter]),new h(this.view),a,new d(this.view,N.pan,{coarse:N.coarsePan,precision:N.precisionPan}),new g(this.view,N.zoom),new v(this.view,N.rotate),p,new l(this.view,"touch")],y.INTERNAL),this.view.viewEvents.connect(o),this._source=t,this._inputManager=o,this.addHandles([i(()=>this.view?.navigation?.browserTouchPanEnabled,e=>{this._source&&(this._source.browserTouchPanningEnabled=!e)},r),i(()=>{const{actionMap:e}=this.view.navigation;return{panActions:M("pan",e),rotateActions:M("rotate",e)}},({panActions:e,rotateActions:t})=>{a.pointerActions=e,p.pointerActions=t},s)],C)}get test(){}};e([a()],H.prototype,"view",void 0),e([a({readOnly:!0})],H.prototype,"updating",null),e([a()],H.prototype,"latestPointerInfo",null),e([a()],H.prototype,"latestPenInfo",null),e([a()],H.prototype,"multiTouchActive",null),H=e([p("esri.views.2d.input.MapViewInputManager")],H);const S=H;export{S as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{InputHandler as i}from"../../../input/InputHandler.js";import{onVisibilityChange as t}from"../../../input/VisibilityChange.js";class e extends i{constructor(i,e,s,o=1){super(!0),this.view=i,this.keys=e,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=i=>{const t=this._keyMap[i.data.key];if(1!==this._panFactor){if("key-up"===i.type&&this._modifiers.some(t=>t.toLowerCase()===i.data.key.toLowerCase()))return void this._stopMovement();if(!this._modifiers.every(t=>i.modifiers.has(t)||i.modifiers.has(t.toLowerCase())||i.modifiers.has(t.toUpperCase())))return}if(i.modifiers.has("Meta")||i.modifiers.has("Control"))return void this._stopMovement();if(null==t)return;i.stopPropagation(),i.preventDefault();const e="key-down"===i.type,s=this._pressedKeys.has(t);if(this._pressedKeys[e?"add":"delete"](t),e){if(s)return;this._updateDirection(),this._isSticky=!1,this._setTimeout(()=>{this._isSticky&&this._handlePopKey()})}else{const i=void 0===this._timeout,t=this._pressedKeys.size>0;i||t?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._updateDirection(),0===this._pressedKeys.size&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._panFactor=o,this._modifiers=s??[],this._keyMap={[e.left]:"left",[e.right]:"right",[e.up]:"up",[e.down]:"down"},this.registerIncoming("key-down",s,this._handleKey),this.registerIncoming("key-up",1!==o?null:s,this._handleKey),this.registerIncoming("blur",1!==o?null:s,this._stopMovement),this._visibilityHandle=t(i=>i?null:this._stopMovement())}onUninstall(){this._stopMovement(),this._visibilityHandle?.remove()}get _direction(){return this._currentDirection}set _direction(i){const t=null!=this._currentDirection;null!=i?(t||this.view.mapViewNavigation.begin(),this._currentDirection?.x===i.x&&this._currentDirection.y===i.y||this.view.mapViewNavigation.continuousPanVector(i)):t&&this.view.mapViewNavigation.stop(),this._currentDirection=i}_updateDirection(){const i=Number(this._pressedKeys.has("right"))-Number(this._pressedKeys.has("left")),t=Number(this._pressedKeys.has("up"))-Number(this._pressedKeys.has("down")),e=Math.hypot(i,t);this._direction=0===e?void 0:{x:i/e*this._panFactor,y:t/e*this._panFactor}}_setTimeout(i){clearTimeout(this._timeout),this._timeout=void 0===i?void 0:setTimeout(()=>{this._timeout=void 0,i()},this._stickyKeyDuration)}}export{e as KeyPan};
2
+ import{InputHandler as t}from"../../../input/InputHandler.js";import{onVisibilityChange as i}from"../../../input/VisibilityChange.js";class e extends t{constructor(t,e,s){super(!0),this.view=t,this.keys=e,this._modifiers=s,this._panFactor=1,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=t=>{const i=this._keyMap[t.data.key],e=this._updatePanFactor(t.modifiers);if(t.modifiers.has("Meta")||t.modifiers.has("Control"))return void this._stopMovement();if(null==i)return void(e&&this._updateDirection());t.stopPropagation(),t.preventDefault();const s="key-down"===t.type,r=this._pressedKeys.has(i);if(this._pressedKeys[s?"add":"delete"](i),s){if(r)return void(e&&this._updateDirection());this._updateDirection(),this._isSticky=!1,this._setTimeout(()=>{this._isSticky&&this._handlePopKey()})}else{const t=void 0===this._timeout,i=this._pressedKeys.size>0;t||i?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._updateDirection(),0===this._pressedKeys.size&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._keyMap={[e.left]:"left",[e.right]:"right",[e.up]:"up",[e.down]:"down"},this.registerIncoming("key-down",this._handleKey),this.registerIncoming("key-up",this._handleKey),this.registerIncoming("blur",this._stopMovement),this._visibilityHandle=i(t=>t?null:this._stopMovement())}onUninstall(){this._stopMovement(),this._visibilityHandle?.remove()}get _direction(){return this._currentDirection}set _direction(t){const i=null!=this._currentDirection,e=null!=t,s=this.view?.mapViewNavigation;null!=s?(e?(i||s.begin(),this._currentDirection?.x===t.x&&this._currentDirection.y===t.y||s.continuousPanVector(t)):i&&s.stop(),this._currentDirection=t):this._currentDirection=t}_updateDirection(){const t=Number(this._pressedKeys.has("right"))-Number(this._pressedKeys.has("left")),i=Number(this._pressedKeys.has("up"))-Number(this._pressedKeys.has("down")),e=Math.hypot(t,i);if(0===e&&this._isSticky&&null!=this._currentDirection){const t=Math.hypot(this._currentDirection.x,this._currentDirection.y);return void(this._direction={x:this._currentDirection.x/t*this._panFactor,y:this._currentDirection.y/t*this._panFactor})}this._direction=0===e?void 0:{x:t/e*this._panFactor,y:i/e*this._panFactor}}_updatePanFactor(t){if(null==this._modifiers)return!1;const{coarse:i,precision:e}=this._modifiers,s=(t.has(e)?.25:1)*(t.has(i)?4:1),r=this._panFactor!==s;return this._panFactor=s,r}_setTimeout(t){clearTimeout(this._timeout),this._timeout=void 0===t?void 0:setTimeout(()=>{this._timeout=void 0,t()},this._stickyKeyDuration)}}export{e as KeyPan};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{InputHandler as e}from"../../../input/InputHandler.js";import{onVisibilityChange as i}from"../../../input/VisibilityChange.js";class t extends e{constructor(e,t,s){super(!0),this.view=e,this.keys=t,this._keyToDirection=new Map,this._pressed=!1,this._addKeysMapping(t),this.registerIncoming("key-down",s,e=>this._handleKeyDown(e)),this.registerIncoming("key-up",s,e=>this._handleKeyUp(e)),this.registerIncoming("blur",s,()=>this._handleStop()),this._visibilityHandle=i(e=>e?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}_addKeysMapping(e){this._addKeyMapping(e.clockwise,"clockwise"),this._addKeyMapping(e.counterClockwise,"counterClockwise"),this._addKeyMapping(e.reset,"reset")}_addKeyMapping(e,i){for(const t of e)this._keyToDirection.set(t,i)}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,i){const t=e.modifiers;if(t.size>0&&!t.has("Shift")||!this.view.constraints.rotationEnabled)return;const s=this._keyToDirection.get(e.data.key);if(this._pressed=null!=s,this._pressed){if(e.preventDefault(),i)switch(this.view.mapViewNavigation.begin(),s){case"clockwise":this.view.mapViewNavigation.continuousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continuousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}}export{t as KeyRotate};
2
+ import{InputHandler as e}from"../../../input/InputHandler.js";import{onVisibilityChange as i}from"../../../input/VisibilityChange.js";class t extends e{constructor(e,t,s){super(!0),this.view=e,this.keys=t,this._keyToDirection=new Map,this._pressed=!1,this._pressedKeys=new Set,this._addKeysMapping(t),this.registerIncoming("key-down",s,e=>this._handleKeyDown(e)),this.registerIncoming("key-up",s,e=>this._handleKeyUp(e)),this.registerIncoming("blur",s,()=>this._handleStop()),this._visibilityHandle=i(e=>e?null:this._handleStop())}onUninstall(){this._handleStop(),this._visibilityHandle?.remove()}_addKeysMapping(e){this._addKeyMapping(e.clockwise,"clockwise"),this._addKeyMapping(e.counterClockwise,"counterClockwise"),this._addKeyMapping(e.reset,"reset")}_addKeyMapping(e,i){for(const t of e)this._keyToDirection.set(t,i)}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleStop(){this._pressedKeys.clear(),this._stopRotation()}_stopRotation(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,i){const t=e.modifiers;if(t.size>0&&!t.has("Shift")||!this.view.constraints.rotationEnabled)return;const s=this._keyToDirection.get(e.data.key);null!=s&&(e.stopPropagation(),e.preventDefault(),"reset"!==s?(this._pressedKeys[i?"add":"delete"](s),this._updateDirection()):i?(this._handleStop(),this.view.mapViewNavigation.begin(),this.view.mapViewNavigation.resetRotation(),this._pressed=!0):this._handleStop())}_updateDirection(){const e=this._pressedKeys.has("clockwise");e!==this._pressedKeys.has("counterClockwise")?(this._pressed||(this._pressed=!0,this.view.mapViewNavigation.begin()),e?this.view.mapViewNavigation.continuousRotateClockwise():this.view.mapViewNavigation.continuousRotateCounterclockwise()):this._stopRotation()}}export{t as KeyRotate};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../core/Error.js";let r=null;function t(){return r??=Promise.all([import("./webglDeps.js"),import("./mapViewDeps.js")]),r}const a=()=>t().then(()=>import("./layers/TileLayerView2D.js")),i={"annotation-feature":()=>t().then(()=>import("./layers/AnnotationFeatureLayerView2D.js")),"base-dynamic":()=>t().then(()=>import("./layers/BaseDynamicLayerView2D.js")),"base-tile":a,"bing-maps":a,catalog:()=>t().then(()=>import("./layers/CatalogLayerView2D.js")),"catalog-dynamic-group":()=>t().then(()=>import("./layers/CatalogDynamicGroupLayerView2D.js")),"catalog-footprint":()=>t().then(()=>import("./layers/CatalogFootprintLayerView2D.js")),csv:()=>t().then(()=>import("./layers/CSVLayerView2D.js")),"geo-rss":()=>t().then(()=>import("./layers/GeoRSSLayerView2D.js")),feature:()=>t().then(()=>import("./layers/FeatureLayerView2D.js")),"dimension-feature":()=>t().then(()=>import("./layers/DimensionFeatureLayerView2D.js")),geojson:()=>t().then(()=>import("./layers/GeoJSONLayerView2D.js")),graphics:()=>t().then(()=>import("./layers/GraphicsLayerView2D.js")),group:()=>t().then(()=>import("./layers/GroupLayerView2D.js")),imagery:()=>t().then(()=>import("./layers/ImageryLayerView2D.js")),"imagery-tile":()=>t().then(()=>import("./layers/ImageryTileLayerView2D.js")),kml:()=>t().then(()=>import("./layers/KMLLayerView2D.js")),"knowledge-graph":()=>t().then(()=>import("./layers/KnowledgeGraphLayerView2D.js")),"link-chart":()=>t().then(()=>import("./layers/KnowledgeGraphLayerView2D.js")),"knowledge-graph-sublayer":()=>t().then(()=>import("./layers/KnowledgeGraphSublayerView2D.js")),"map-image":()=>t().then(()=>import("./layers/MapImageLayerView2D.js")),"map-notes":()=>t().then(()=>import("./layers/MapNotesLayerView2D.js")),media:()=>t().then(()=>import("./layers/MediaLayerView2D.js")),"ogc-feature":()=>t().then(()=>import("./layers/OGCFeatureLayerView2D.js")),"open-street-map":a,"oriented-imagery":()=>t().then(()=>import("./layers/OrientedImageryLayerView2D.js")),parquet:()=>t().then(()=>import("./layers/ParquetLayerView2D.js")),route:()=>t().then(()=>import("./layers/RouteLayerView2D.js")),stream:()=>t().then(()=>import("./layers/StreamLayerView2D.js")),"subtype-group":()=>t().then(()=>import("./layers/SubtypeGroupLayerView2D.js")),tile:a,"vector-tile":()=>t().then(()=>import("./layers/VectorTileLayerView2D.js")),video:()=>t().then(()=>import("./layers/VideoLayerView2D.js")),wcs:()=>t().then(()=>import("./layers/ImageryTileLayerView2D.js")),"web-tile":a,wfs:()=>t().then(()=>import("./layers/WFSLayerView2D.js")),wms:()=>t().then(()=>import("./layers/WMSLayerView2D.js")),wmts:()=>t().then(()=>import("./layers/WMTSLayerView2D.js")),"base-elevation":null,"building-scene":null,dimension:null,elevation:null,"gaussian-splat":null,"integrated-mesh-3dtiles":null,"integrated-mesh":null,"line-of-sight":null,"point-cloud":null,scene:null,unknown:null,unsupported:null,viewshed:null,voxel:null};function s(r){const t=r.declaredClass?r.declaredClass.slice(r.declaredClass.lastIndexOf(".")+1):"Unknown",a=t.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new e(`${a}:view-not-supported`,`${t} is not supported in 2D`)}const n=new Map,l={hasLayerViewModule:e=>null!=i[e.type],importLayerView:e=>{const r=n.get(e.type);if(r)return r;const t=i[e.type];if(null==t)throw s(e);const a=t(e);return n.set(e.type,a),a}};export{l as layerView2DImporter};
2
+ import e from"../../core/Error.js";let r=null;function t(){return r??=Promise.all([import("./webglDeps.js"),import("./mapViewDeps.js")]),r}const a=()=>t().then(()=>import("./layers/TileLayerView2D.js")),i={"annotation-feature":()=>t().then(()=>import("./layers/AnnotationFeatureLayerView2D.js")),"base-dynamic":()=>t().then(()=>import("./layers/BaseDynamicLayerView2D.js")),"base-tile":a,"bing-maps":a,catalog:()=>t().then(()=>import("./layers/CatalogLayerView2D.js")),"catalog-dynamic-group":()=>t().then(()=>import("./layers/CatalogDynamicGroupLayerView2D.js")),"catalog-footprint":()=>t().then(()=>import("./layers/CatalogFootprintLayerView2D.js")),csv:()=>t().then(()=>import("./layers/CSVLayerView2D.js")),"geospatial-pdf":()=>t().then(()=>import("./layers/GeospatialPDFLayerView2D.js")),"geo-rss":()=>t().then(()=>import("./layers/GeoRSSLayerView2D.js")),feature:()=>t().then(()=>import("./layers/FeatureLayerView2D.js")),"dimension-feature":()=>t().then(()=>import("./layers/DimensionFeatureLayerView2D.js")),geojson:()=>t().then(()=>import("./layers/GeoJSONLayerView2D.js")),graphics:()=>t().then(()=>import("./layers/GraphicsLayerView2D.js")),group:()=>t().then(()=>import("./layers/GroupLayerView2D.js")),imagery:()=>t().then(()=>import("./layers/ImageryLayerView2D.js")),"imagery-tile":()=>t().then(()=>import("./layers/ImageryTileLayerView2D.js")),kml:()=>t().then(()=>import("./layers/KMLLayerView2D.js")),"knowledge-graph":()=>t().then(()=>import("./layers/KnowledgeGraphLayerView2D.js")),"link-chart":()=>t().then(()=>import("./layers/KnowledgeGraphLayerView2D.js")),"knowledge-graph-sublayer":()=>t().then(()=>import("./layers/KnowledgeGraphSublayerView2D.js")),"map-image":()=>t().then(()=>import("./layers/MapImageLayerView2D.js")),"map-notes":()=>t().then(()=>import("./layers/MapNotesLayerView2D.js")),media:()=>t().then(()=>import("./layers/MediaLayerView2D.js")),"ogc-feature":()=>t().then(()=>import("./layers/OGCFeatureLayerView2D.js")),"open-street-map":a,"oriented-imagery":()=>t().then(()=>import("./layers/OrientedImageryLayerView2D.js")),parquet:()=>t().then(()=>import("./layers/ParquetLayerView2D.js")),route:()=>t().then(()=>import("./layers/RouteLayerView2D.js")),stream:()=>t().then(()=>import("./layers/StreamLayerView2D.js")),"subtype-group":()=>t().then(()=>import("./layers/SubtypeGroupLayerView2D.js")),tile:a,"vector-tile":()=>t().then(()=>import("./layers/VectorTileLayerView2D.js")),video:()=>t().then(()=>import("./layers/VideoLayerView2D.js")),wcs:()=>t().then(()=>import("./layers/ImageryTileLayerView2D.js")),"web-tile":a,wfs:()=>t().then(()=>import("./layers/WFSLayerView2D.js")),wms:()=>t().then(()=>import("./layers/WMSLayerView2D.js")),wmts:()=>t().then(()=>import("./layers/WMTSLayerView2D.js")),"base-elevation":null,"building-scene":null,dimension:null,elevation:null,"gaussian-splat":null,"integrated-mesh-3dtiles":null,"integrated-mesh":null,"line-of-sight":null,"point-cloud":null,scene:null,unknown:null,unsupported:null,viewshed:null,voxel:null};function s(r){const t=r.declaredClass?r.declaredClass.slice(r.declaredClass.lastIndexOf(".")+1):"Unknown",a=t.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new e(`${a}:view-not-supported`,`${t} is not supported in 2D`)}const l=new Map,n={hasLayerViewModule:e=>null!=i[e.type],importLayerView:e=>{const r=l.get(e.type);if(r)return r;const t=i[e.type];if(null==t)throw s(e);const a=t(e);return l.set(e.type,a),a}};export{n as layerView2DImporter};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Logger.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import{watch as s}from"../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../core/accessorSupport/decorators.js";import{LayerView2D as o}from"./LayerView2D.js";import h from"./imagery/ImageryTileView2D.js";import d from"../../layers/ImageryTileLayerView.js";import{RefreshableLayerView as l}from"../../layers/RefreshableLayerView.js";let n=class extends(l(o(d))){constructor(){super(...arguments),this.subview=null}get displayParameters(){const{layer:e}=this,t=this._get("displayParameters");return e.renderer&&e.visible?{renderer:e.renderer,interpolation:e.interpolation,clipToNeatline:e.clippedToNeatline}:t}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage();const e=new h({layer:this.layer,layerView:this,scheduler:this.scheduler});e.useWebGLForProcessing=!0,e.useProgressiveUpdate=!0,this._attachSubview(e),this.subview=e,this.requestUpdate(),this.addAttachHandles([s(()=>this.layer.clippedToNeatline,()=>{const e=this.subview.redrawOrRefetch({refetch:!0,reprocess:!1}).catch(e=>{r(e)||t.getLogger(this).error(e)});this._updatingHandles.addPromise(e)})])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};e([i()],n.prototype,"subview",void 0),e([i({readOnly:!0})],n.prototype,"displayParameters",null),n=e([a("esri.views.2d.layers.GeospatialPDFLayerView2D")],n);const c=n;export{c as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{assertIsSome as s}from"../../../../core/maybe.js";import{debounce as r,isAbortError as a}from"../../../../core/promiseUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import h from"../../../../geometry/Extent.js";import c from"../../../../geometry/Point.js";import{isFunctionRaster as u}from"../../../../layers/raster/datasets/datasetUtils.js";import{update as d,unregister as p,getRasterId as y,register as m}from"../../../../layers/raster/datasets/RawBlockCache.js";import{getWorldWidth as g,computeProjectedScales as f}from"../../../../layers/raster/functions/rasterProjectionHelper.js";import{getStretchCutoff as _}from"../../../../layers/raster/functions/stretchUtils.js";import b from"../../../../layers/support/PixelBlock.js";import w from"../../../../layers/support/TileInfo.js";import R from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import P from"../../tiling/TileQueue.js";import I from"../../tiling/TileStrategy.js";import{tileSize as U}from"../../engine/webgl/definitions.js";import{readFromTiledRasterData as C}from"../../../support/rasterHitTestUtils.js";import{TaskPriority as S}from"../../../support/Scheduler.js";import{getWebGLCapabilities as x}from"../../../webgl/capabilities.js";const v=[0,0];let F=class extends t{constructor(){super(...arguments),this._updatingHandles=new l,this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=[],this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._maxIndexedColormapSize=0,this._rasterFunctionState="na",this._globalUpdateRequested=!1,this.attached=!1,this.timeExtent=null,this.refreshDRAFunctionOnce=r(async()=>{const{fullExtent:e,view:t}=this.layerView;if(e?.intersects(t.extent))try{await this._updateDRAStatistics(this._abortController?.signal)&&await this.doRefresh()}catch{}}),this.redrawOrRefetch=r(async(e={})=>{const t=this._rasterFunctionState,i=e.reprocess||"gpu"===t&&!this.canUseWebGLForProcessing||"cpu"===t&&this.canUseWebGLForProcessing;if(i&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const s=this._rasterFunctionState,{type:r}=this;return e.refetch||"raster"!==r&&!!i||"cpu"===s||"cpu"===t?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(e.signal))})}destroy(){this._updatingHandles.destroy()}get canUseWebGLForProcessing(){return!1}get canUseLocalSymbolizerParams(){return(this.canUseWebGLForProcessing||"rasterVF"===this.type)&&!this.layerView.hasTilingEffects}get hasDRAInRasterFunction(){const{rasterFunction:e}=this.layer;return!!e&&JSON.stringify(e,null,0).includes('"dra":true')}get isCPUBasedDRA(){const{renderer:e}=this.layer;return"raster-stretch"===e?.type&&e.dynamicRangeAdjustment&&(!this.canUseWebGLForProcessing||!("min-max"===e.stretchType||"standard-deviation"===e.stretchType))}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s="toJSON"in t?t:h.fromJSON(t);d(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==r.level&&(this.previousLOD=r,null!=this._symbolizerParams&&this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){(this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate)&&(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&(this.hasDRAInRasterFunction?(this._globalUpdateRequested=!1,this.refreshDRAFunctionOnce()):this.isCPUBasedDRA&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()})));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){const e=x();this._maxIndexedColormapSize=4*(e.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new R(this.layerView.tileInfo,this.layerView.fullExtent);const t=this._computeFetchConcurrency();this._fetchQueue=new P({tileInfoView:this._tileInfoView,concurrency:t,process:(e,t)=>this._fetchTile(e,t),priority:S.MAPVIEW_FETCH_QUEUE,scheduler:this.scheduler});const i=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:i,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,p(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}async hitTest(e){const t=this._locateSourceData(e);if(!t)return null;const{layer:i}=this,s="vector-field"===i.renderer?.type,r=this.canUseWebGLForProcessing&&u(this.layer.raster);return C({mapPoint:e,layer:i,sourceData:t,processRasterFunction:r,sourceIsUV:s})}acquireTile(e){const t=this.container.createTile(e);return this._updatingHandles.consumePromise(this._enqueueTileFetch(t)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",()=>{e.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.size.join(",");if(t&&null!=this._emptyTilePixelBlock)return this._emptyTilePixelBlock;e=e||this._tileInfoView.size;const[i,s]=e,r=new b({width:i,height:s,pixels:[new Uint8Array(i*s)],mask:new Uint8Array(i*s),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=r),r}_getBandIds(){if(this.container&&(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain))return this.layer.bandIds;const{bandIds:e,raster:t}=this.layer,i="rasterFunction"in t?t.rasterFunction.rawInputBandIds:null;return e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map(e=>i[Math.min(e,i.length-1)]):"rasterFunction"in t?i:e}updateRasterFunctionParameters(){}_fetchTile(e,t){const i=this._getFetchOptions(e.level,t.signal);return this.fetchTile(e,i)}_getFetchOptions(e,t){const{canUseWebGLForProcessing:i}=this,{layerView:s}=this,{tileInfo:r}=s,a=!r.isWrappable&&null!=g(s.view.spatialReference),o=i&&this.layer.raster.hasUniqueSourceStorageInfo,{layer:n}=this.layerView,l=n.serviceRasterInfo?.storageInfo.isBsqTile?n.getRawDisplayBandIds():void 0;return{allowPartialFill:!0,datumTransformation:s.datumTransformation,interpolation:i?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:o,skipRasterFunction:"raster"===this.type&&null!=this.container.rasterFunctionChain,signal:t,srcResolution:this._srcResolutions[e],timeExtent:s.timeExtent,tileInfo:r,bandIds:l,disableWrapAround:a}}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const{layerView:e}=this,t=e.view.spatialReference;if(this._canUseLayerLODs()){const{origin:i,lods:s}=this.layer.tileInfo,r=s.map(({scale:e})=>e),a=w.create({spatialReference:t,size:U,scales:r,origin:i});return e.set("tileInfo",a),void(this._srcResolutions=s.map(({resolution:e})=>({x:e,y:e})))}const{scales:i,srcResolutions:r,isCustomTilingScheme:a}=f(this.layer.serviceRasterInfo,t,{tileSize:U,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),o=w.create({spatialReference:t,size:U,scales:i}),n=0===o.origin.x;s(e.fullExtent);const{xmin:l,ymax:h}=e.fullExtent;(n||a&&o.origin.x>l)&&(o.origin=new c({x:l,y:h,spatialReference:t})),this._isCustomTilingScheme=a,e.set("tileInfo",o),this._srcResolutions=r??[]}_canUseLayerLODs(){const{layer:e,layerView:t}=this;if("Map"!==e.raster.tileType)return!1;const{lods:i}=e.tileInfo,s=t.view.constraints?.effectiveLODs;return s?.length===i.length&&s.every(({scale:e},t)=>Math.abs(e-i[t].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.serviceRasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){if(!this._fetchQueue.has(e.key.id)){try{let t=e.once("detach",()=>t=void 0);const r=await this._fetchQueue.push(e.key),o=this._getBandIds(),n=this.hasDRAInRasterFunction&&u(this.layer.raster)&&!this.layer.raster.processParameters?.stretchCutoff;let l=!this.useProgressiveUpdate||n||this.isCPUBasedDRA&&!this._globalSymbolizerParams;const h=this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length;if(h){if(l=!1,!this.hasDRAInRasterFunction)try{await this._redrawImage(this._abortController?.signal)}catch(s){a(s)&&i.getLogger(this).error(s)}this._globalUpdateRequested=!1}if(!t)return;this.canUseLocalSymbolizerParams&&null==this._symbolizerParams&&this._updateSymbolizerParams();const c=this._tileInfoView.getTileCoords(v,e.key),d=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:l,bandIds:o,coords:c,resolution:d}),t&&(e.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(e),t.remove()),h&&this.hasDRAInRasterFunction&&u(this.layer.raster)&&!this.layer.raster.processParameters?.extent?.equals(this.layerView.view.extent)&&this.refreshDRAFunctionOnce()}catch(s){a(s)||i.getLogger(this).error(s)}this.layerView.requestUpdate()}}async _updateDRAStatistics(e){if(!u(this.layer.raster))return!1;const t=await this.layer.getDynamicRangeInputRaster();if(!t)return!1;const{raster:i,functionArguments:s}=t,r=this._getFetchOptions(this.previousLOD.level,e),{extent:a,width:o,height:n}=this.layerView.view,{pixelBlock:l}=await i.fetchPixels(a,o,n,{...r,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1}),h=_(s,{rasterInfo:i.rasterInfo,pixelBlock:l});return this.layer.raster.processParameters={stretchCutoff:h,extent:a},!0}_locateSourceData(e){if(!this.layer.loaded||!this.attached)return null;const t=new Map,i=this.container.children.find(i=>{if(!i.visible)return!1;const s="bitmap"in i?i.bitmap?.rawPixelData:i.tileData?.rawPixelData;if(!s?.pixelBlock)return!1;const{key:r}=i,{level:a}=r;if(!t.has(a)){const i=this._tileInfoView.getLODInfoAt(a);if(!i)return!1;const s=Math.floor(i.getColumnForX(e.x)),r=Math.floor(i.getRowForY(e.y));t.set(a,[r,s])}const[o,n]=t.get(a);return o===r.row&&n===r.col});if(null==i)return null;if("tileData"in i){const{rawPixelData:e}=i.tileData;return e?.pixelBlock?{rawPixelData:e,tileSize:{width:i.width,height:i.height}}:null}const{rawPixelData:s,transformGrid:r,width:a,height:o}=i.bitmap;return s?.pixelBlock?{rawPixelData:s,transformGrid:r,tileSize:{width:a,height:o}}:null}async _redrawImage(e){if(!this.attached||0===this.container.children.length)return;if(await this.layer.updateRenderer(),this.isCPUBasedDRA?await this._updateGlobalSymbolizerParams(e):(this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._globalSymbolizerParams=null),!this.attached||e?.aborted)return;const t=this.container.children.map(async t=>this.updateTileSymbolizerParameters(t,{local:this._symbolizerParams,global:this._globalSymbolizerParams},e));await Promise.allSettled(t),this.attached&&!e?.aborted&&this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const{fullExtent:t,view:i}=this.layerView;if(!t?.intersects(i.extent))return;const s=this._getFetchOptions(this.previousLOD.level,e),r=await this.layer.fetchPixels(i.extent,i.width,i.height,{...s,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1});if(!r?.pixelBlock)return;const{resolution:a}=this.previousLOD,{isBsqTile:o}=this.layer.raster.rasterInfo.storageInfo,n=o?null:this._getBandIds(),l=this.layer.symbolizer.generateWebGLParameters({pixelBlock:r.pixelBlock.extractBands(n),isGCS:i.spatialReference.isGeographic,resolution:{x:a,y:a},bandIds:n});!this.canUseWebGLForProcessing&&l&&"stretch"===l.type&&"raster-stretch"===this.layer.renderer?.type&&(l.factor=l.factor.map(e=>255*e),l.minOutput=Math.round(255*l.minOutput),l.maxOutput=Math.round(255*l.maxOutput)),this._globalSymbolizerParams=l}_updateSymbolizerParams(){const{resolution:e}=this.previousLOD,t=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:e,y:e},bandIds:t})}_updateBlockCacheRegistry(e=!1){const{layer:t,layerView:i}=this,{raster:s}=t,{multidimensionalDefinition:r}=t.normalizeRasterFetchOptions({multidimensionalDefinition:t.multidimensionalDefinition,timeExtent:i.timeExtent}),a=s.rasterInfo.multidimensionalInfo?s.getSliceIndex(r):null,o=s.rasterInfo.storageInfo.isBsqTile?t.getRawDisplayBandIds():null,n=u(s)?s.primaryRasters.rasters[0]??s:s,l=y(n.rasterId,a,o);if(l!==this._blockCacheRegistryUrl){null!=this._blockCacheRegistryUrl&&p(this._blockCacheRegistryUrl,this._blockCacheRegistryId);const t=n.rawBlockRegistryIds.indexOf(this._blockCacheRegistryId);if(t>-1&&n.rawBlockRegistryIds.splice(t,1),this._blockCacheRegistryId=m(l,n.rasterInfo),n.rawBlockRegistryIds.push(this._blockCacheRegistryId),e){const{view:e}=i,t=this._tileInfoView.getClosestInfoForScale(e.scale),r=this._srcResolutions[t.level];d(l,this._blockCacheRegistryId,e.extent,e.resolution,r,s.ioConfig.sampling)}this._blockCacheRegistryUrl=l}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;await this._updatingHandles.addPromise(this.layer.updateRenderer()),this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._globalUpdateRequested=this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate,this._tileStrategy.refresh(t=>e.push(this._enqueueTileFetch(t))),await this._updatingHandles.addPromise(Promise.allSettled(e))}};e([o()],F.prototype,"_globalUpdateRequested",void 0),e([o()],F.prototype,"attached",void 0),e([o()],F.prototype,"canUseWebGLForProcessing",null),e([o()],F.prototype,"canUseLocalSymbolizerParams",null),e([o()],F.prototype,"hasDRAInRasterFunction",null),e([o()],F.prototype,"isCPUBasedDRA",null),e([o()],F.prototype,"container",void 0),e([o()],F.prototype,"layer",void 0),e([o()],F.prototype,"layerView",void 0),e([o()],F.prototype,"scheduler",void 0),e([o()],F.prototype,"type",void 0),e([o()],F.prototype,"useWebGLForProcessing",null),e([o()],F.prototype,"useProgressiveUpdate",null),e([o()],F.prototype,"timeExtent",void 0),e([o()],F.prototype,"updating",null),F=e([n("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],F);export{F as BaseImageryTileSubView2D};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{assertIsSome as s}from"../../../../core/maybe.js";import{debounce as r,isAbortError as a}from"../../../../core/promiseUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import h from"../../../../geometry/Extent.js";import c from"../../../../geometry/Point.js";import{isFunctionRaster as u}from"../../../../layers/raster/datasets/datasetUtils.js";import{update as d,unregister as p,getRasterId as y,register as m}from"../../../../layers/raster/datasets/RawBlockCache.js";import{getWorldWidth as g,computeProjectedScales as f}from"../../../../layers/raster/functions/rasterProjectionHelper.js";import{getStretchCutoff as _}from"../../../../layers/raster/functions/stretchUtils.js";import b from"../../../../layers/support/PixelBlock.js";import R from"../../../../layers/support/TileInfo.js";import w from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import P from"../../tiling/TileQueue.js";import I from"../../tiling/TileStrategy.js";import{tileSize as U}from"../../engine/webgl/definitions.js";import{readFromTiledRasterData as C}from"../../../support/rasterHitTestUtils.js";import{TaskPriority as S}from"../../../support/Scheduler.js";import{getWebGLCapabilities as x}from"../../../webgl/capabilities.js";const v=[0,0];function F(e){return"geospatial-pdf"!==e.type}let D=class extends t{constructor(){super(...arguments),this._updatingHandles=new l,this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=[],this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._maxIndexedColormapSize=0,this._rasterFunctionState="na",this._globalUpdateRequested=!1,this.attached=!1,this.timeExtent=null,this.refreshDRAFunctionOnce=r(async()=>{const{fullExtent:e,view:t}=this.layerView;if(e?.intersects(t.extent))try{await this._updateDRAStatistics(this._abortController?.signal)&&await this.doRefresh()}catch{}}),this.redrawOrRefetch=r(async(e={})=>{if(!("rasterFunction"in this.layer))return this._updatingHandles.addPromise(e.refetch?this.doRefresh():this._redrawImage(e.signal));const t=this._rasterFunctionState,i=e.reprocess||"gpu"===t&&!this.canUseWebGLForProcessing||"cpu"===t&&this.canUseWebGLForProcessing;if(i&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const s=this._rasterFunctionState,{type:r}=this;return e.refetch||"raster"!==r&&!!i||"cpu"===s||"cpu"===t?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(e.signal))})}destroy(){this._updatingHandles.destroy()}get canUseWebGLForProcessing(){return!1}get canUseLocalSymbolizerParams(){return(this.canUseWebGLForProcessing||"rasterVF"===this.type)&&!this.layerView.hasTilingEffects}get hasDRAInRasterFunction(){if(!("rasterFunction"in this.layer))return!1;const{rasterFunction:e}=this.layer;return!!e&&JSON.stringify(e,null,0).includes('"dra":true')}get isCPUBasedDRA(){const{renderer:e}=this.layer;return"raster-stretch"===e?.type&&e.dynamicRangeAdjustment&&(!this.canUseWebGLForProcessing||!("min-max"===e.stretchType||"standard-deviation"===e.stretchType))}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s="toJSON"in t?t:h.fromJSON(t);d(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==r.level&&(this.previousLOD=r,null!=this._symbolizerParams&&this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){(this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate)&&(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&(this.hasDRAInRasterFunction?(this._globalUpdateRequested=!1,this.refreshDRAFunctionOnce()):this.isCPUBasedDRA&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()})));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){const e=x();this._maxIndexedColormapSize=4*(e.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new w(this.layerView.tileInfo,this.layerView.fullExtent);const t=this._computeFetchConcurrency();this._fetchQueue=new P({tileInfoView:this._tileInfoView,concurrency:t,process:(e,t)=>this._fetchTile(e,t),priority:S.MAPVIEW_FETCH_QUEUE,scheduler:this.scheduler});const i=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:i,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,p(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}async hitTest(e){if(!F(this.layer))return null;const t=this._locateSourceData(e);if(!t)return null;const{layer:i}=this,s="vector-field"===i.renderer?.type,r=this.canUseWebGLForProcessing&&u(this.layer.raster);return C({mapPoint:e,layer:i,sourceData:t,processRasterFunction:r,sourceIsUV:s})}acquireTile(e){const t=this.container.createTile(e);return this._updatingHandles.consumePromise(this._enqueueTileFetch(t)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",()=>{e.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.size.join(",");if(t&&null!=this._emptyTilePixelBlock)return this._emptyTilePixelBlock;e=e||this._tileInfoView.size;const[i,s]=e,r=new b({width:i,height:s,pixels:[new Uint8Array(i*s)],mask:new Uint8Array(i*s),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=r),r}_getBandIds(){if(!("bandIds"in this.layer))return this.layer.getRawDisplayBandIds();if(this.container&&(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain))return this.layer.bandIds;const{bandIds:e,raster:t}=this.layer,i="rasterFunction"in t?t.rasterFunction.rawInputBandIds:null;return e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map(e=>i[Math.min(e,i.length-1)]):"rasterFunction"in t?i:e}updateRasterFunctionParameters(){}_fetchTile(e,t){const i=this._getFetchOptions(e.level,t.signal);return this.fetchTile(e,i)}_getFetchOptions(e,t){const{canUseWebGLForProcessing:i}=this,{layerView:s}=this,{tileInfo:r}=s,a=!r.isWrappable&&null!=g(s.view.spatialReference),o=i&&this.layer.raster.hasUniqueSourceStorageInfo,{layer:n}=this.layerView,l=n.serviceRasterInfo?.storageInfo.isBsqTile?n.getRawDisplayBandIds():void 0;return{allowPartialFill:!0,datumTransformation:s.datumTransformation,interpolation:i?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:o,skipRasterFunction:"raster"===this.type&&null!=this.container.rasterFunctionChain,signal:t,srcResolution:this._srcResolutions[e],timeExtent:s.timeExtent,tileInfo:r,bandIds:l,disableWrapAround:a}}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const{layerView:e}=this,t=e.view.spatialReference;if(this._canUseLayerLODs()){const{origin:i,lods:s}=this.layer.tileInfo,r=s.map(({scale:e})=>e),a=R.create({spatialReference:t,size:U,scales:r,origin:i});return e.set("tileInfo",a),void(this._srcResolutions=s.map(({resolution:e})=>({x:e,y:e})))}const{scales:i,srcResolutions:r,isCustomTilingScheme:a}=f(this.layer.serviceRasterInfo,t,{tileSize:U,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),o=R.create({spatialReference:t,size:U,scales:i}),n=0===o.origin.x;s(e.fullExtent);const{xmin:l,ymax:h}=e.fullExtent;(n||a&&o.origin.x>l)&&(o.origin=new c({x:l,y:h,spatialReference:t})),this._isCustomTilingScheme=a,e.set("tileInfo",o),this._srcResolutions=r??[]}_canUseLayerLODs(){const{layer:e,layerView:t}=this;if("Map"!==e.raster.tileType)return!1;const{lods:i}=e.tileInfo,s=t.view.constraints?.effectiveLODs;return s?.length===i.length&&s.every(({scale:e},t)=>Math.abs(e-i[t].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.serviceRasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){if(!this._fetchQueue.has(e.key.id)){try{let t=e.once("detach",()=>t=void 0);const r=await this._fetchQueue.push(e.key),o=this._getBandIds(),n=this.hasDRAInRasterFunction&&u(this.layer.raster)&&!this.layer.raster.processParameters?.stretchCutoff;let l=!this.useProgressiveUpdate||n||this.isCPUBasedDRA&&!this._globalSymbolizerParams;const h=this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length;if(h){if(l=!1,!this.hasDRAInRasterFunction)try{await this._redrawImage(this._abortController?.signal)}catch(s){a(s)&&i.getLogger(this).error(s)}this._globalUpdateRequested=!1}if(!t)return;this.canUseLocalSymbolizerParams&&null==this._symbolizerParams&&this._updateSymbolizerParams();const c=this._tileInfoView.getTileCoords(v,e.key),d=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:l,bandIds:o,coords:c,resolution:d}),t&&(e.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(e),t.remove()),h&&this.hasDRAInRasterFunction&&u(this.layer.raster)&&!this.layer.raster.processParameters?.extent?.equals(this.layerView.view.extent)&&this.refreshDRAFunctionOnce()}catch(s){a(s)||i.getLogger(this).error(s)}this.layerView.requestUpdate()}}async _updateDRAStatistics(e){if(!F(this.layer))return!1;if(!u(this.layer.raster))return!1;const t=await this.layer.getDynamicRangeInputRaster();if(!t)return!1;const{raster:i,functionArguments:s}=t,r=this._getFetchOptions(this.previousLOD.level,e),{extent:a,width:o,height:n}=this.layerView.view,{pixelBlock:l}=await i.fetchPixels(a,o,n,{...r,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1}),h=_(s,{rasterInfo:i.rasterInfo,pixelBlock:l});return this.layer.raster.processParameters={stretchCutoff:h,extent:a},!0}_locateSourceData(e){if(!this.layer.loaded||!this.attached)return null;const t=new Map,i=this.container.children.find(i=>{if(!i.visible)return!1;const s="bitmap"in i?i.bitmap?.rawPixelData:i.tileData?.rawPixelData;if(!s?.pixelBlock)return!1;const{key:r}=i,{level:a}=r;if(!t.has(a)){const i=this._tileInfoView.getLODInfoAt(a);if(!i)return!1;const s=Math.floor(i.getColumnForX(e.x)),r=Math.floor(i.getRowForY(e.y));t.set(a,[r,s])}const[o,n]=t.get(a);return o===r.row&&n===r.col});if(null==i)return null;if("tileData"in i){const{rawPixelData:e}=i.tileData;return e?.pixelBlock?{rawPixelData:e,tileSize:{width:i.width,height:i.height}}:null}const{rawPixelData:s,transformGrid:r,width:a,height:o}=i.bitmap;return s?.pixelBlock?{rawPixelData:s,transformGrid:r,tileSize:{width:a,height:o}}:null}async _redrawImage(e){if(!this.attached||0===this.container.children.length)return;if("updateRenderer"in this.layer&&await this.layer.updateRenderer(),this.isCPUBasedDRA?await this._updateGlobalSymbolizerParams(e):(this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._globalSymbolizerParams=null),!this.attached||e?.aborted)return;const t=this.container.children.map(async t=>this.updateTileSymbolizerParameters(t,{local:this._symbolizerParams,global:this._globalSymbolizerParams},e));await Promise.allSettled(t),this.attached&&!e?.aborted&&this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const{fullExtent:t,view:i}=this.layerView;if(!t?.intersects(i.extent))return;const s=this._getFetchOptions(this.previousLOD.level,e),r=await this.layer.fetchPixels(i.extent,i.width,i.height,{...s,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1});if(!r?.pixelBlock)return;const{resolution:a}=this.previousLOD,{isBsqTile:o}=this.layer.raster.rasterInfo.storageInfo,n=o?null:this._getBandIds(),l=this.layer.symbolizer.generateWebGLParameters({pixelBlock:r.pixelBlock.extractBands(n),isGCS:i.spatialReference.isGeographic,resolution:{x:a,y:a},bandIds:n});!this.canUseWebGLForProcessing&&l&&"stretch"===l.type&&"raster-stretch"===this.layer.renderer?.type&&(l.factor=l.factor.map(e=>255*e),l.minOutput=Math.round(255*l.minOutput),l.maxOutput=Math.round(255*l.maxOutput)),this._globalSymbolizerParams=l}_updateSymbolizerParams(){const{resolution:e}=this.previousLOD,t=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:e,y:e},bandIds:t})}_updateBlockCacheRegistry(e=!1){const{layer:t,layerView:i}=this,{raster:s}=t;let r=null,a=null,o=s;if("multidimensionalDefinition"in t){const{multidimensionalDefinition:e}=t.normalizeRasterFetchOptions({multidimensionalDefinition:t.multidimensionalDefinition,timeExtent:i.timeExtent});r=s.rasterInfo.multidimensionalInfo?s.getSliceIndex(e)??null:null,a=s.rasterInfo.storageInfo.isBsqTile?t.getRawDisplayBandIds():null,o=u(s)?s.primaryRasters.rasters[0]??s:s}const n=y(o.rasterId,r,a);if(n!==this._blockCacheRegistryUrl){null!=this._blockCacheRegistryUrl&&p(this._blockCacheRegistryUrl,this._blockCacheRegistryId);const t=o.rawBlockRegistryIds.indexOf(this._blockCacheRegistryId);if(t>-1&&o.rawBlockRegistryIds.splice(t,1),this._blockCacheRegistryId=m(n,o.rasterInfo),o.rawBlockRegistryIds.push(this._blockCacheRegistryId),e){const{view:e}=i,t=this._tileInfoView.getClosestInfoForScale(e.scale),r=this._srcResolutions[t.level];d(n,this._blockCacheRegistryId,e.extent,e.resolution,r,s.ioConfig.sampling)}this._blockCacheRegistryUrl=n}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;"updateRenderer"in this.layer&&await this._updatingHandles.addPromise(this.layer.updateRenderer()),this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._globalUpdateRequested=this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate,this._tileStrategy.refresh(t=>e.push(this._enqueueTileFetch(t))),await this._updatingHandles.addPromise(Promise.allSettled(e))}};e([o()],D.prototype,"_globalUpdateRequested",void 0),e([o()],D.prototype,"attached",void 0),e([o()],D.prototype,"canUseWebGLForProcessing",null),e([o()],D.prototype,"canUseLocalSymbolizerParams",null),e([o()],D.prototype,"hasDRAInRasterFunction",null),e([o()],D.prototype,"isCPUBasedDRA",null),e([o()],D.prototype,"container",void 0),e([o()],D.prototype,"layer",void 0),e([o()],D.prototype,"layerView",void 0),e([o()],D.prototype,"scheduler",void 0),e([o()],D.prototype,"type",void 0),e([o()],D.prototype,"useWebGLForProcessing",null),e([o()],D.prototype,"useProgressiveUpdate",null),e([o()],D.prototype,"timeExtent",void 0),e([o()],D.prototype,"updating",null),D=e([n("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],D);export{D as BaseImageryTileSubView2D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import has from"../../../../core/has.js";import{numberMaxFloat32 as t}from"../../../../core/mathUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{isFunctionRaster as s}from"../../../../layers/raster/datasets/datasetUtils.js";import{getBytesPerPixel as n}from"../../../../layers/raster/formats/pixelRangeUtils.js";import{convertGeometryToMask as o}from"../../../../layers/raster/functions/clipUtils.js";import{maxMapSizeGpu as a}from"../../../../layers/raster/functions/pixelUtils.js";import{RasterTileContainer as l}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as c}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as h}from"../support/util.js";import{defaultColor as d}from"../../../support/HighlightDefaults.js";import{getHighlightName as p}from"../../../support/highlightOptionsUtils.js";const u=[1024,1024];let m=class extends c{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t||this.hasDRAInRasterFunction)return!1;const r=t.lookup.colormapLut?.indexedColormap,i=r&&r.length>this._maxIndexedColormapSize,s=n(this.layer.serviceRasterInfo);return!(has("ios")&&s>4)&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!i&&!("majority"===this.layer.interpolation&&h(this.layer))}attach(){super.attach(),this.container=new l(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t)return r.rasterFunctionChain=null,r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))}),void(this._rasterFunctionState="na");const i=this._rasterFunctionState,{rasterFunction:s,primaryRasters:n}=e,o=s.supportsGPU&&(!n||n.rasters.length<=1),a=o?s.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!o||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const h=null==s?"na":r.rasterFunctionChain?"gpu":"cpu",d=i===h||"na"===i&&"cpu"===h&&0===a?.functions?.length;r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!d,t.processed=!1,t.processedTexture=null)}),this._rasterFunctionState=h}async updateTileSource(e,t){const r=this._getBandIds(),i=this._getLayerInterpolation(),{canUseWebGLForProcessing:n}=this,{source:a,globalSymbolizerParams:l,suspended:c,coords:h,resolution:d}=t,p=this.isCPUBasedDRA?l:t.symbolizerParams,{bitmap:u}=e;if([u.x,u.y]=h,u.resolution=d,null!=a?.pixelBlock){const e={extent:a.extent,pixelBlock:a.pixelBlock,srcExtent:a.srcExtent,srcPixelSize:a.srcTilePixelSize};if(u.rawPixelData=e,n)u.source=a.pixelBlock,u.isRenderedSource=!1;else{const t=await this._renderTileData(e,l);u.source=t,u.isRenderedSource=!0}u.symbolizerParameters=n?p:null,u.transformGrid=n?a.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();u.source=e,u.symbolizerParameters=n?p:null,u.transformGrid=null}const{isBsqTile:m}=this.layer.raster.rasterInfo.storageInfo;u.bandIds=n&&!m?r:null,u.width=this._tileInfoView.size[0],u.height=this._tileInfoView.size[1],u.interpolation=i,u.suspended=c;const{raster:g}=this.layer;if(s(g)){const t=g.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=g.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);r&&(u.mask=o({srcExtent:r,geometry:t,size:[u.width,u.height]}))}}u.invalidateTexture()}async updateTileSymbolizerParameters(e,t,r){const{local:i,global:s}=t,n=this._getBandIds(),o=this._getLayerInterpolation(),{canUseWebGLForProcessing:a}=this,{bitmap:l}=e,{rawPixelData:c}=l;if(a||null==c)l.isRenderedSource&&null!=c&&(l.source=c.pixelBlock),l.isRenderedSource=!1;else{const e=await this._renderTileData(c,s,r);l.source=e,l.isRenderedSource=!0}l.symbolizerParameters=a?this.layerView.hasTilingEffects?s:i:null;const{isBsqTile:h}=this.layer.raster.rasterInfo.storageInfo;l.bandIds=a&&!h?n:null,l.interpolation=o,l.suspended=!1}updateHighlightOptions(e){if(!e.length)return void(this.container.pixelHighlights=void 0);const r=[],{highlights:i}=this.layerView.view;e.sort((e,t)=>i.findIndex(({name:e})=>e===p(t.options))-i.findIndex(({name:t})=>t===p(e.options)));for(const{target:s,options:n}of e){const{pixelRanges:e}=s,l=p(n),c=(i.find(e=>e.name===l)?.color??d).toUnitRGBA();if(0===c[3]&&(c[3]=.01),Array.isArray(e)){const i=Array.from({length:2*a},()=>0);for(let t=0;t<e.length;t++)i[2*t]=e[t][0],i[2*t+1]=e[t][1];for(let r=e.length;r<a;r++)i[2*r]=t,i[2*r+1]=-t;const n=s.bandId??0;r.push({ranges:i,bandId:n,color:c,type:"single-band"})}else{const t="extent"===e.type?e:e.extent;if(!t)continue;const i=[t.xmin,t.xmax],n=[t.ymin,t.ymax],{xBandId:a,yBandId:l}=s,h={xRange:i,yRange:n,bandIds:[a,l],color:c,type:"xy-band"};"polygon"===e.type&&(h.maskSize=u,h.mask=o({srcExtent:t,geometry:e,size:u})),r.push(h)}}this.container.pixelHighlights=r,this.canUseWebGLForProcessing||this.doRefresh()}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}_convertPixelHighlights(){return this.container?.pixelHighlights?.map(e=>{const r=e.color.map(e=>Math.round(255*e));if("single-band"===e.type){const i=e.ranges.indexOf(t),s=[],n=-1===i?e.ranges.length/2:i/2;for(let t=0;t<n;t++)s.push([e.ranges[2*t],e.ranges[2*t+1]]);return{bandId:e.bandId,color:r,ranges:s}}return{color:r,xBandId:e.bandIds[0],yBandId:e.bandIds[1],xBandRange:e.xRange,yBandRange:e.yRange,width:e.maskSize?.[0],height:e.maskSize?.[1],xyMask:e.mask}})}async _renderTileData(e,t,r){if(!e.pixelBlock)return null;const i=await this.layer.applyRenderer(e,"stretch"===t?.type?t:void 0,{signal:r}),s=this._convertPixelHighlights();return i&&s&&await this.layer.highlightPixels({pixelBlock:e.pixelBlock.extractBands(this.layer.bandIds),renderedPixelBlock:i,highlightOptions:s},{signal:r}),i}};e([r()],m.prototype,"canUseWebGLForProcessing",null),e([r()],m.prototype,"container",void 0),e([r()],m.prototype,"layer",void 0),e([r()],m.prototype,"type",void 0),m=e([i("esri.views.2d.layers.imagery.ImageryTileView2D")],m);export{m as default};
2
+ import{__decorate as e}from"tslib";import has from"../../../../core/has.js";import{numberMaxFloat32 as t}from"../../../../core/mathUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{isFunctionRaster as s}from"../../../../layers/raster/datasets/datasetUtils.js";import{getBytesPerPixel as n}from"../../../../layers/raster/formats/pixelRangeUtils.js";import{convertGeometryToMask as o}from"../../../../layers/raster/functions/clipUtils.js";import{maxMapSizeGpu as a}from"../../../../layers/raster/functions/pixelUtils.js";import{RasterTileContainer as l}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as c}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as h}from"../support/util.js";import{defaultColor as d}from"../../../support/HighlightDefaults.js";import{getHighlightName as p}from"../../../support/highlightOptionsUtils.js";const u=[1024,1024];let g=class extends c{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t||this.hasDRAInRasterFunction)return!1;const r=t.lookup.colormapLut?.indexedColormap,i=r&&r.length>this._maxIndexedColormapSize,s=n(this.layer.serviceRasterInfo),o=has("ios")&&s>4,a="geospatial-pdf"!==this.layer.type&&"majority"===this.layer.interpolation&&h(this.layer);return!o&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!i&&!a}attach(){super.attach(),this.container=new l(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t||"geospatial-pdf"===t)return r.rasterFunctionChain=null,r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))}),void(this._rasterFunctionState="na");const i=this._rasterFunctionState,{rasterFunction:s,primaryRasters:n}=e,o=s.supportsGPU&&(!n||n.rasters.length<=1),a=o?s.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!o||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const h=null==s?"na":r.rasterFunctionChain?"gpu":"cpu",d=i===h||"na"===i&&"cpu"===h&&0===a?.functions?.length;r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!d,t.processed=!1,t.processedTexture=null)}),this._rasterFunctionState=h}async updateTileSource(e,t){const r=this._getBandIds(),i=this._getLayerInterpolation(),{canUseWebGLForProcessing:n}=this,{source:a,globalSymbolizerParams:l,suspended:c,coords:h,resolution:d}=t,p=this.isCPUBasedDRA?l:t.symbolizerParams,{bitmap:u}=e;if([u.x,u.y]=h,u.resolution=d,null!=a?.pixelBlock){const e={extent:a.extent,pixelBlock:a.pixelBlock,srcExtent:a.srcExtent,srcPixelSize:a.srcTilePixelSize};if(u.rawPixelData=e,n)u.source=a.pixelBlock,u.isRenderedSource=!1;else{const t=await this._renderTileData(e,l);u.source=t,u.isRenderedSource=!0}u.symbolizerParameters=n?p:null,u.transformGrid=n?a.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();u.source=e,u.symbolizerParameters=n?p:null,u.transformGrid=null}const{isBsqTile:g}=this.layer.raster.rasterInfo.storageInfo;u.bandIds=n&&!g?r:null,u.width=this._tileInfoView.size[0],u.height=this._tileInfoView.size[1],u.interpolation=i,u.suspended=c;const{raster:m}=this.layer;if(s(m)){const t=m.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=m.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);r&&(u.mask=o({srcExtent:r,geometry:t,size:[u.width,u.height]}))}}u.invalidateTexture()}async updateTileSymbolizerParameters(e,t,r){const{local:i,global:s}=t,n=this._getBandIds(),o=this._getLayerInterpolation(),{canUseWebGLForProcessing:a}=this,{bitmap:l}=e,{rawPixelData:c}=l;if(a||null==c)l.isRenderedSource&&null!=c&&(l.source=c.pixelBlock),l.isRenderedSource=!1;else{const e=await this._renderTileData(c,s,r);l.source=e,l.isRenderedSource=!0}l.symbolizerParameters=a?this.layerView.hasTilingEffects?s:i:null;const{isBsqTile:h}=this.layer.raster.rasterInfo.storageInfo;l.bandIds=a&&!h?n:null,l.interpolation=o,l.suspended=!1}updateHighlightOptions(e){if(!e.length)return void(this.container.pixelHighlights=void 0);const r=[],{highlights:i}=this.layerView.view;e.sort((e,t)=>i.findIndex(({name:e})=>e===p(t.options))-i.findIndex(({name:t})=>t===p(e.options)));for(const{target:s,options:n}of e){const{pixelRanges:e}=s,l=p(n),c=(i.find(e=>e.name===l)?.color??d).toUnitRGBA();if(0===c[3]&&(c[3]=.01),Array.isArray(e)){const i=Array.from({length:2*a},()=>0);for(let t=0;t<e.length;t++)i[2*t]=e[t][0],i[2*t+1]=e[t][1];for(let r=e.length;r<a;r++)i[2*r]=t,i[2*r+1]=-t;const n=s.bandId??0;r.push({ranges:i,bandId:n,color:c,type:"single-band"})}else{const t="extent"===e.type?e:e.extent;if(!t)continue;const i=[t.xmin,t.xmax],n=[t.ymin,t.ymax],{xBandId:a,yBandId:l}=s,h={xRange:i,yRange:n,bandIds:[a,l],color:c,type:"xy-band"};"polygon"===e.type&&(h.maskSize=u,h.mask=o({srcExtent:t,geometry:e,size:u})),r.push(h)}}this.container.pixelHighlights=r,this.canUseWebGLForProcessing||this.doRefresh()}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}_convertPixelHighlights(){return this.container?.pixelHighlights?.map(e=>{const r=e.color.map(e=>Math.round(255*e));if("single-band"===e.type){const i=e.ranges.indexOf(t),s=[],n=-1===i?e.ranges.length/2:i/2;for(let t=0;t<n;t++)s.push([e.ranges[2*t],e.ranges[2*t+1]]);return{bandId:e.bandId,color:r,ranges:s}}return{color:r,xBandId:e.bandIds[0],yBandId:e.bandIds[1],xBandRange:e.xRange,yBandRange:e.yRange,width:e.maskSize?.[0],height:e.maskSize?.[1],xyMask:e.mask}})}async _renderTileData(e,t,r){if(!e.pixelBlock)return null;if("geospatial-pdf"===this.layer.type)return e.pixelBlock;const i=await this.layer.applyRenderer(e,"stretch"===t?.type?t:void 0,{signal:r}),s=this._convertPixelHighlights();return i&&s&&await this.layer.highlightPixels({pixelBlock:e.pixelBlock.extractBands(this.layer.bandIds),renderedPixelBlock:i,highlightOptions:s},{signal:r}),i}};e([r()],g.prototype,"canUseWebGLForProcessing",null),e([r()],g.prototype,"container",void 0),e([r()],g.prototype,"layer",void 0),e([r()],g.prototype,"type",void 0),g=e([i("esri.views.2d.layers.imagery.ImageryTileView2D")],g);export{g as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{fixUnsupportedCIM as e}from"../../../../../symbols/cim/supportUtils.js";let t=0;class i{constructor(e,t,i,r){this.cimPropertyName=e,this.findTargetNode=i,this.getValue=r,this.realFieldName=`__virtual_fi_${t}`}setOnFeature(e,t){const i=this.getValue(t);e.attributes[this.realFieldName]=i}addPrimitiveOverride(e){const i=this.findTargetNode(e.symbol);let{primitiveName:r}=i;r||(t++,r=`primitive_${t}`,i.primitiveName=r);const s={type:"CIMPrimitiveOverride",primitiveName:r,propertyName:this.cimPropertyName,valueExpressionInfo:{type:"CIMExpressionInfo",expression:`return $feature.${this.realFieldName};`}};e.primitiveOverrides=e.primitiveOverrides||[],e.primitiveOverrides.push(s)}}const r=new i("TextString","text",e=>e.symbolLayers[0].markerGraphics[0],e=>e.text),s=new i("Color","color",e=>e.symbolLayers[0].markerGraphics[0].symbol.symbol.symbolLayers.find(e=>"CIMSolidFill"===e.type),t=>{const i=t.color||"#000000";if(i.startsWith("#"))return i;if(i.startsWith("rgb"))return i;const r=JSON.parse(i),s=e(r);return`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${s[3]/255})`}),n=new i("Rotation","rotation",e=>e.symbolLayers[0],e=>null!=e.textAngle?-e.textAngle:void 0),o=new i("OffsetX","offsetX",e=>e.symbolLayers[0],e=>e.xOffset),l=new i("OffsetY","offsetY",e=>e.symbolLayers[0],e=>e.yOffset);class a{constructor(e,t,i){this.cimPropertyName=e,this.findTargetNode=t,this.getValue=i}setOnSymbol(e,t){const i=this.getValue(t);if(null==i)return;this.findTargetNode(e)[this._fixCase(this.cimPropertyName)]=i}_fixCase(e){return this.cimPropertyName[0].toLocaleLowerCase()+e.slice(1)}}const m=new a("VerticalAlignment",e=>e,e=>null==e.verticalAlignment?null:["Top","Center","Baseline","Bottom"][e.verticalAlignment]),f=new a("HorizontalAlignment",e=>e,e=>null==e.horizontalAlignment?null:["Left","Right","Center","Justify"][e.horizontalAlignment]),y=new a("FontFamilyName",e=>e,e=>e.fontFamilyName),c=new a("FontStyleName",e=>e,e=>e.fontStyleName),u=new a("Height",e=>e,e=>e.size),p=new a("Underline",e=>e,e=>e.underline),h=[r,s,o,l],d=[...h,n],g=[f,m,y,c,u,p];function N(e){let t=!1;for(const i of g)t=t||null!=i.getValue(e);return t}export{d as featureFields,N as hasSymbolFields,h as nonPointFeatureFields,g as symbolFields};
2
+ import{fixUnsupportedCIM as e}from"../../../../../symbols/cim/supportUtils.js";let t=0;class i{constructor(e,t,i,r){this.cimPropertyName=e,this.findTargetNode=i,this.getValue=r,this.realFieldName=`__virtual_fi_${t}`}setOnFeature(e,t){const i=this.getValue(t);e.attributes[this.realFieldName]=i}addPrimitiveOverride(e){const i=this.findTargetNode(e.symbol);let{primitiveName:r}=i;r||(t++,r=`primitive_${t}`,i.primitiveName=r);const s={type:"CIMPrimitiveOverride",primitiveName:r,propertyName:this.cimPropertyName,valueExpressionInfo:{type:"CIMExpressionInfo",expression:`return $feature.${this.realFieldName};`}};e.primitiveOverrides=e.primitiveOverrides||[],e.primitiveOverrides.push(s)}}const r=new i("TextString","text",e=>e.symbolLayers[0].markerGraphics[0],e=>e.text),s=new i("Color","color",e=>e.symbolLayers[0].markerGraphics[0].symbol.symbol.symbolLayers.find(e=>"CIMSolidFill"===e.type),t=>{const i=t.color;if(!i)return null;if(i.startsWith("#"))return i;if(i.startsWith("rgb"))return i;const r=JSON.parse(i),s=e(r);return`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${s[3]/255})`}),n=new i("Rotation","rotation",e=>e.symbolLayers[0],e=>null!=e.textAngle?-e.textAngle:void 0),o=new i("OffsetX","offsetX",e=>e.symbolLayers[0],e=>e.xOffset),l=new i("OffsetY","offsetY",e=>e.symbolLayers[0],e=>e.yOffset);class a{constructor(e,t,i){this.cimPropertyName=e,this.findTargetNode=t,this.getValue=i}setOnSymbol(e,t){const i=this.getValue(t);if(null==i)return;this.findTargetNode(e)[this._fixCase(this.cimPropertyName)]=i}_fixCase(e){return this.cimPropertyName[0].toLocaleLowerCase()+e.slice(1)}}const m=new a("VerticalAlignment",e=>e,e=>null==e.verticalAlignment?null:["Top","Center","Baseline","Bottom"][e.verticalAlignment]),f=new a("HorizontalAlignment",e=>e,e=>null==e.horizontalAlignment?null:["Left","Right","Center","Justify"][e.horizontalAlignment]),u=new a("FontFamilyName",e=>e,e=>e.fontFamilyName),y=new a("FontStyleName",e=>e,e=>e.fontStyleName),c=new a("Height",e=>e,e=>e.size),p=new a("Underline",e=>e,e=>e.underline),h=[r,s,o,l],d=[...h,n],g=[f,m,u,y,c,p];function N(e){let t=!1;for(const i of g)t=t||null!=i.getValue(e);return t}export{d as featureFields,N as hasSymbolFields,h as nonPointFeatureFields,g as symbolFields};
@@ -42,6 +42,8 @@ export interface LayerView2DMap {
42
42
  "geo-rss": GeoRSSLayerView;
43
43
  /** @since 5.0 */
44
44
  geojson: GeoJSONLayerView;
45
+ /** @since 5.2 */
46
+ "geospatial-pdf": never;
45
47
  /** @since 5.0 */
46
48
  graphics: GraphicsLayerView;
47
49
  /** @since 5.0 */
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{EventedMixin as r}from"../../core/Evented.js";import{when as n,on as i,watch as a}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{create as l,equals as u,intersection as d}from"../../geometry/support/aaBoundingRect.js";import p from"../GroundView.js";import{ElevationRange as g}from"./support/ElevationRange.js";import{toBoundingRect as h}from"./support/extentUtils.js";import{webMercatorWorldExtent as y,geographicWorldExtent as c}from"./terrain/TerrainConst.js";let v=class extends(r(p)){initialize(){super.initialize();const e=()=>{this.emit("elevation-query-change")};this.addHandles(n(()=>this._terrainSurface,e=>e.on("elevation-change",e=>this._elevationChange(e)))),this.addHandles(i(()=>this._integratedMeshGroundLayerView?.elevationProvider,"elevation-change",e=>this._elevationChange(e))),this.addHandles([a(()=>this.memoizedElevationQueryDependencies,e)])}get memoizedElevationQueryDependencies(){return(this.ground?.allLayers??[]).filter(e=>"elevation"===e.type||"integrated-mesh-3dtiles"===e.type&&e.replacesTerrain).map(e=>e.memoizedElevationQueryDependencies)}_elevationChange(e){this.emit("elevation-change",e)}get _integratedMeshGroundLayerView(){const e=this.ground?.integratedMeshGround;if(e)return this.view.basemapView?.groundLayerViews.find(t=>t.layer===e)}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return!this._usingIntegratedMesh&&(this._terrainSurface?.enabled??!1)}get _usingIntegratedMesh(){return this.hasTerrainReplacement&&(this._integratedMeshGroundLayerView?.visible??!1)}get spatialReference(){return this._terrainSurface?.spatialReference}get userClippingExtent(){const{spatialReference:e}=this,{clippingArea:t}=this.view;if(null==t||null==e)return null;const r=l(),n=h(t,r,e)?r:null,i=this._get("userClippingExtent");return u(n,i)?i:n}get updating(){return!this.suspended&&((this._source?.updating??!1)||this.layerViews.some(({updating:e})=>e))}getElevation(e,t,r,n){return this._elevationProvider?.getElevation(e,t,r,n)}getElevations(e,t,r){const{_elevationProvider:n}=this;if(n?.getElevations)return n.getElevations(e,t,r);for(let i=0;i<t;++i)r(i,null)}intersect(e,t,r,n){if(this._usingTerrain)return void this._terrainSurface.intersect(e,t,r,n);const i=this._integratedMeshGroundLayerView;this._usingIntegratedMesh&&i&&i.intersect(e,t,r,n)}getSphereElevationRange(e,t,r){return this._elevationProvider?.getSphereElevationRange?.(e,t)}getRootElevationRange(){return this._elevationProvider?.getRootElevationRange?.()}get _elevationProvider(){return this._usingIntegratedMesh?this._integratedMeshGroundLayerView?.elevationProvider:this._terrainSurface}get elevationQueryCache(){const e=this.view?.basemapTerrain;return e?.enabled?e.elevationQueryCache:null}get elevationQueryReady(){for(const e of this.ground?.allLayers??[])if("integrated-mesh-3dtiles"===e.type&&e.replacesTerrain&&"failed"!==e.loadStatus&&null==e.queryElevationCallback)return!1;return!0}get groundExtent(){const{fullGroundExtent:e}=this;return e?this.userClippingExtent?d(e,this.userClippingExtent,l()):this.fullGroundExtent:null}get fullGroundExtent(){if(this._usingTerrain)return this._terrainSurface.fullGroundExtent;if(this._usingIntegratedMesh){const e=this.view.spatialReference;if(e.isWebMercator||e.isWGS84)return _(e);throw new t("GroundView:unsupportedSpatialReference","View spatial reference incompatible with groundLayer")}return null}get visibleElevationRange(){return this._source?.visibleElevationRange??f}get opaque(){return this._source?.opaque??!1}get invisible(){return this._source?.invisible??!1}get baseOpacity(){return this.ground?.opacity??1}get wireframe(){return!!this._usingTerrain&&(this._terrainSurface?.wireframe??!1)}get freeze(){return(this._usingTerrain?this._terrainSurface?.freeze:this._integratedMeshGroundLayerView?.freeze)??!1}set freeze(e){this._usingTerrain?this._terrainSurface.freeze=e:this._usingIntegratedMesh&&(this._integratedMeshGroundLayerView.freeze=e)}get suspended(){return this._usingIntegratedMesh?this._integratedMeshGroundLayerView?.suspended??!1:super.suspended}get ready(){return this._source?.ready??!1}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}get _source(){return this._usingTerrain?this._terrainSurface:this._usingIntegratedMesh?this._integratedMeshGroundLayerView:null}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([s()],v.prototype,"memoizedElevationQueryDependencies",null),e([s({readOnly:!0})],v.prototype,"_integratedMeshGroundLayerView",null),e([s({readOnly:!0})],v.prototype,"_terrainSurface",null),e([s({readOnly:!0})],v.prototype,"_usingTerrain",null),e([s({readOnly:!0})],v.prototype,"_usingIntegratedMesh",null),e([s({readOnly:!0})],v.prototype,"spatialReference",null),e([s({readOnly:!0})],v.prototype,"userClippingExtent",null),e([s({type:Boolean,readOnly:!0})],v.prototype,"updating",null),e([s({readOnly:!0})],v.prototype,"elevationQueryCache",null),e([s()],v.prototype,"elevationQueryReady",null),e([s({readOnly:!0})],v.prototype,"groundExtent",null),e([s({readOnly:!0})],v.prototype,"fullGroundExtent",null),e([s({readOnly:!0})],v.prototype,"visibleElevationRange",null),e([s({readOnly:!0})],v.prototype,"opaque",null),e([s({readOnly:!0})],v.prototype,"invisible",null),e([s({readOnly:!0})],v.prototype,"baseOpacity",null),e([s({readOnly:!0})],v.prototype,"wireframe",null),e([s()],v.prototype,"freeze",null),e([s({readOnly:!0})],v.prototype,"suspended",null),e([s({readOnly:!0})],v.prototype,"ready",null),e([s({readOnly:!0})],v.prototype,"_source",null),v=e([o("esri.views.3d.GroundView3D")],v);const f=new g(0,0);function _(e){return e.isWebMercator?y:c}export{v as GroundView3D};
2
+ import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../core/Evented.js";import has from"../../core/has.js";import{when as r,watch as n,syncAndInitial as i}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{create as l,equals as o,intersection as u,union as d}from"../../geometry/support/aaBoundingRect.js";import p from"../GroundView.js";import{ElevationRange as h}from"./support/ElevationRange.js";import{toBoundingRect as g}from"./support/extentUtils.js";import{webMercatorWorldExtent as y,geographicWorldExtent as c}from"./terrain/TerrainConst.js";import{isIntegratedMeshLayerView as v}from"../support/layerViewUtils.js";const f=Symbol("integrated-mesh-elevation-providers");let m=class extends(t(p)){initialize(){super.initialize();const e=()=>{this.emit("elevation-query-change")},t=()=>{this.removeHandles(f),this.addHandles(this._integratedMeshGroundLayerViews.map(({elevationProvider:e})=>e.on("elevation-change",e=>this._elevationChange(e))),f)};this.addHandles(r(()=>this._terrainSurface,e=>e.on("elevation-change",e=>this._elevationChange(e)))),n(()=>[this.view?.basemapView?.groundLayerViews.toArray(),this.layerViews.toArray()],t,i),this.addHandles([n(()=>this.memoizedElevationQueryDependencies,e)])}get memoizedElevationQueryDependencies(){return(this.ground?.allLayers??[]).filter(e=>"elevation"===e.type||"integrated-mesh-3dtiles"===e.type&&e.replacesTerrain).map(e=>e.memoizedElevationQueryDependencies)}_elevationChange(e){this.emit("elevation-change",e)}get _integratedMeshGroundLayerViews(){return has("enable-feature:im-as-ground")?[...this.view?.basemapView?.groundLayerViews.filter(v)??[],...this.layerViews.filter(v)]:[...this.view?.basemapView?.groundLayerViews.filter(v).filter(e=>e.replacesTerrain)??[]]}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return!this.hasTerrainReplacement&&(this._terrainSurface?.enabled??!1)}get spatialReference(){return this._terrainSurface?.spatialReference}get userClippingExtent(){const{spatialReference:e}=this,{clippingArea:t}=this.view;if(null==t||null==e)return null;const r=l(),n=g(t,r,e)?r:null,i=this._get("userClippingExtent");return o(n,i)?i:n}get updating(){return!this.suspended&&(this._usingTerrain&&this._terrainSurface.updating||this.layerViews.some(({updating:e})=>e))}getElevation(e,t,r,n){const i=this._usingTerrain?this._terrainSurface?.getElevation(e,t,r,n):null;return this._integratedMeshGroundLayerViews.reduce((i,a)=>{const s=a.elevationProvider.getElevation(e,t,r,n);return null==s?i:Math.max(s,i??s)},i)}getElevations(e,t,r){const n=this.view.groundSpatialReference;if(null!=n)for(let i=0;i<t;++i){const t=3*i;r(i,this.getElevation(e[t],e[t+1],e[t+2],n))}else for(let i=0;i<t;++i)r(i,null)}intersect(e,t,r,n){this._usingTerrain&&this._terrainSurface.intersect(e,t,r,n),this._integratedMeshGroundLayerViews.forEach(i=>i.intersect(e,t,r,n))}getSphereElevationRange(e,t,r){const n=this._usingTerrain?this._terrainSurface?.getSphereElevationRange?.(e,t):null;return this._integratedMeshGroundLayerViews.reduce((r,n)=>{const i=n.elevationProvider.getSphereElevationRange?.(e,t);return null==i||(r??=new h,r.expandElevationRange(i)),r},n?new h(n.minElevation,n.maxElevation):null)}getRootElevationRange(){const e=this._usingTerrain?this._terrainSurface?.getRootElevationRange?.():null;return this._integratedMeshGroundLayerViews.reduce((e,t)=>{const r=t.elevationProvider.getRootElevationRange?.();return null==r||(e??=new h,e.expandElevationRange(r)),e},e?new h(e.minElevation,e.maxElevation):null)}get elevationQueryCache(){const e=this.view?.basemapTerrain;return e?.enabled?e.elevationQueryCache:null}get elevationQueryReady(){for(const e of this.ground?.allLayers??[])if("integrated-mesh-3dtiles"===e.type&&e.replacesTerrain&&"failed"!==e.loadStatus&&null==e.queryElevationCallback)return!1;return!0}get groundExtent(){const{fullGroundExtent:e}=this;return e?this.userClippingExtent?u(e,this.userClippingExtent,l()):this.fullGroundExtent:null}get fullGroundExtent(){const e=this._usingTerrain?this._terrainSurface.fullGroundExtent:null;if(0===this._integratedMeshGroundLayerViews.length)return e;const t=this.view.spatialReference;if(!t.isWebMercator&&!t.isWGS84)return e;const r=w(t);return e?d(e,r,l()):r}get visibleElevationRange(){const e=this._usingTerrain?this._terrainSurface.visibleElevationRange:null;return this._integratedMeshGroundLayerViews.reduce((e,t)=>null==e?new h(t.visibleElevationRange.minElevation,t.visibleElevationRange.maxElevation):(e.expandElevationRange(t.visibleElevationRange),e),e?new h(e.minElevation,e.maxElevation):null)??_}get opaque(){return this._usingTerrain&&this._terrainSurface.opaque||this._integratedMeshGroundLayerViews.some(({opaque:e})=>e)}get invisible(){return(!this._usingTerrain||this._terrainSurface.invisible)&&this._integratedMeshGroundLayerViews.every(({invisible:e})=>e)}get baseOpacity(){return this.ground?.opacity??1}get wireframe(){return!!this._usingTerrain&&(this._terrainSurface?.wireframe??!1)}get freeze(){return this._usingTerrain&&(this._terrainSurface?.freeze??!1)||this._integratedMeshGroundLayerViews.some(e=>"integrated-mesh-3dtiles"===e.type&&e.freeze)}set freeze(e){this._usingTerrain&&(this._terrainSurface.freeze=e),this._integratedMeshGroundLayerViews.forEach(t=>{"integrated-mesh-3dtiles"===t.type&&(t.freeze=e)})}get suspended(){return(!this._usingTerrain||super.suspended)&&this._integratedMeshGroundLayerViews.length>0&&this._integratedMeshGroundLayerViews.every(({suspended:e})=>e)}get ready(){return!(!this._usingTerrain&&0===this._integratedMeshGroundLayerViews.length)&&((!this._usingTerrain||this._terrainSurface.ready)&&this._integratedMeshGroundLayerViews.every(({ready:e})=>e))}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([a()],m.prototype,"memoizedElevationQueryDependencies",null),e([a({readOnly:!0})],m.prototype,"_integratedMeshGroundLayerViews",null),e([a({readOnly:!0})],m.prototype,"_terrainSurface",null),e([a({readOnly:!0})],m.prototype,"_usingTerrain",null),e([a({readOnly:!0})],m.prototype,"spatialReference",null),e([a({readOnly:!0})],m.prototype,"userClippingExtent",null),e([a({type:Boolean,readOnly:!0})],m.prototype,"updating",null),e([a({readOnly:!0})],m.prototype,"elevationQueryCache",null),e([a()],m.prototype,"elevationQueryReady",null),e([a({readOnly:!0})],m.prototype,"groundExtent",null),e([a({readOnly:!0})],m.prototype,"fullGroundExtent",null),e([a({readOnly:!0})],m.prototype,"visibleElevationRange",null),e([a({readOnly:!0})],m.prototype,"opaque",null),e([a({readOnly:!0})],m.prototype,"invisible",null),e([a({readOnly:!0})],m.prototype,"baseOpacity",null),e([a({readOnly:!0})],m.prototype,"wireframe",null),e([a()],m.prototype,"freeze",null),e([a({readOnly:!0})],m.prototype,"suspended",null),e([a({readOnly:!0})],m.prototype,"ready",null),m=e([s("esri.views.3d.GroundView3D")],m);const _=new h(0,0);function w(e){return e.isWebMercator?y:c}export{m as GroundView3D};