@arcgis/core 5.2.0-next.95 → 5.2.0-next.96

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 (530) hide show
  1. package/applications/WebEditor/geometryUtils.d.ts +1 -1
  2. package/arcade/arcadeAsyncRuntime.js +1 -1
  3. package/arcade/arcadeCompiler.js +1 -1
  4. package/arcade/arcadeRuntime.js +1 -1
  5. package/arcade/containerUtils.js +1 -1
  6. package/arcade/functions/track.js +1 -1
  7. package/arcgisGlobal.d.ts +2 -0
  8. package/assets/components/assets/icon/aiAgent16.json +1 -0
  9. package/assets/components/assets/icon/aiAgent24.json +1 -0
  10. package/assets/components/assets/icon/aiAgent32.json +1 -0
  11. package/assets/components/assets/icon/aiAgents16.json +1 -0
  12. package/assets/components/assets/icon/aiAgents24.json +1 -0
  13. package/assets/components/assets/icon/aiAgents32.json +1 -0
  14. package/assets/components/assets/icon/explodeGeometry16.json +1 -0
  15. package/assets/components/assets/icon/explodeGeometry24.json +1 -0
  16. package/assets/components/assets/icon/explodeGeometry32.json +1 -0
  17. package/assets/components/assets/icon/integration16.json +1 -0
  18. package/assets/components/assets/icon/integration24.json +1 -0
  19. package/assets/components/assets/icon/integration32.json +1 -0
  20. package/assets/components/assets/icon/spatiotemporalCatalog16.json +1 -0
  21. package/assets/components/assets/icon/spatiotemporalCatalog24.json +1 -0
  22. package/assets/components/assets/icon/spatiotemporalCatalog32.json +1 -0
  23. package/assets/components/assets/input-time-zone/t9n/messages.de.json +1 -1
  24. package/assets/esri/core/workers/RemoteClient.js +1 -1
  25. package/assets/esri/core/workers/chunks/000f91a18c22377f8525.js +1 -0
  26. package/assets/esri/core/workers/chunks/{05662a663f761dd3dea5.js → 006146ad6d4a5cbf1a1f.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{bd1a7e95a797e1ed4a7b.js → 013c17e07756fa465845.js} +1 -1
  28. package/assets/esri/core/workers/chunks/014eaccf2c2d357981f0.js +1 -0
  29. package/assets/esri/core/workers/chunks/{f253875feb11883deb84.js → 04d4cd66485b622403d0.js} +1 -1
  30. package/assets/esri/core/workers/chunks/05eb064f9b543890ae24.js +1 -0
  31. package/assets/esri/core/workers/chunks/05fbd1f373cfa3724f0c.js +1 -0
  32. package/assets/esri/core/workers/chunks/{26737d061c7cfbbab95c.js → 0809a55a2f9be07cc5a9.js} +1 -1
  33. package/assets/esri/core/workers/chunks/0930738f43ce09b2ed2d.js +1 -0
  34. package/assets/esri/core/workers/chunks/{691434d4c6a38e63d819.js → 0a242e76bc293b0ad04b.js} +1 -1
  35. package/assets/esri/core/workers/chunks/0a4092578dc7578bcf76.js +1 -0
  36. package/assets/esri/core/workers/chunks/0e11bee9b56a7f51b012.js +1 -0
  37. package/assets/esri/core/workers/chunks/0e65869a5dd5a3917da7.js +1 -0
  38. package/assets/esri/core/workers/chunks/0ffb5a1275d07dcd9115.js +1 -0
  39. package/assets/esri/core/workers/chunks/{e370a3337b3c90240e73.js → 105da965fc90604eb6bf.js} +1 -1
  40. package/assets/esri/core/workers/chunks/1082bb0858585bd4fa21.js +2 -0
  41. package/assets/esri/core/workers/chunks/{5235b9c21ac4156c2375.js → 10f4c5533f50c3693318.js} +1 -1
  42. package/assets/esri/core/workers/chunks/1201bb22a2bfd7d7ecba.js +1 -0
  43. package/assets/esri/core/workers/chunks/16f55c5d642a23c2547e.js +1 -0
  44. package/assets/esri/core/workers/chunks/{09e01fd1c199be0c8e03.js → 16ffbe484f6cd4736f79.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{1bf967c68d0c795d3fb4.js → 19a4907fc93ae8b817e9.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{f74c7cbe4bd12f73ae90.js → 19d7339f20f3008c4893.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{a8aa8cb60b30f0983e7e.js → 1a9f17781e0a3bc5106f.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{bf7875fda48b15271a10.js → 1bef7097fe5e402539ea.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{fa377112ef3b78f6ed18.js → 1de1cc0ed0f169a58aff.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{0549e2badf511e27aa54.js → 1e3b07cf0e608431a277.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{2e51764c8aa31096cb2a.js → 20feca2fdd304b3e9664.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{4c73c2f4331351e2a50c.js → 22ff018342860249b3eb.js} +1 -1
  53. package/assets/esri/core/workers/chunks/248df6fda489a9de5852.js +1 -0
  54. package/assets/esri/core/workers/chunks/279b16727d4b515eca44.js +1 -0
  55. package/assets/esri/core/workers/chunks/2b10d6597af3eeec5396.js +1 -0
  56. package/assets/esri/core/workers/chunks/2bd4b536e329112591c4.js +1 -0
  57. package/assets/esri/core/workers/chunks/2c01477b69c38f691e19.js +1 -0
  58. package/assets/esri/core/workers/chunks/2e2349387a2b9903f13c.js +2 -0
  59. package/assets/esri/core/workers/chunks/{4d700cb028f6306b163e.js → 32aa1529e84b839d051d.js} +1 -1
  60. package/assets/esri/core/workers/chunks/33041e50ea02d99480b0.js +1 -0
  61. package/assets/esri/core/workers/chunks/{5d7a5aa608ed6192b016.js → 349982635e921e838030.js} +1 -1
  62. package/assets/esri/core/workers/chunks/35d0a7597473d46866de.js +1 -0
  63. package/assets/esri/core/workers/chunks/374d726fdd0a9848cea5.js +1 -0
  64. package/assets/esri/core/workers/chunks/379f5ca5372d834af497.js +1 -0
  65. package/assets/esri/core/workers/chunks/37ae52c71bf9c70fbb92.js +1 -0
  66. package/assets/esri/core/workers/chunks/{05393b23ab24126d4236.js → 38bc5d09ae07f486d457.js} +1 -1
  67. package/assets/esri/core/workers/chunks/3bafa01ca01a67d09432.js +1 -0
  68. package/assets/esri/core/workers/chunks/3c7901ea007c9615ba54.js +1 -0
  69. package/assets/esri/core/workers/chunks/4047208f9559e06d7102.js +1 -0
  70. package/assets/esri/core/workers/chunks/4049e9b86c8e27a7ff12.js +1 -0
  71. package/assets/esri/core/workers/chunks/411bbdecba340df11d95.js +2 -0
  72. package/assets/esri/core/workers/chunks/42b5533f94ebcdc4befe.js +1 -0
  73. package/assets/esri/core/workers/chunks/44ca13c874b5aa0ed5a0.js +1 -0
  74. package/assets/esri/core/workers/chunks/4717831effb1ac6d5f5d.js +1 -0
  75. package/assets/esri/core/workers/chunks/{5edf77618ca51819d7c4.js → 476535cfb06ced74d611.js} +2 -2
  76. package/assets/esri/core/workers/chunks/486f1277fe834c0fc4c1.js +1 -0
  77. package/assets/esri/core/workers/chunks/48ade66f1685a1aaffba.js +1 -0
  78. package/assets/esri/core/workers/chunks/4d13c1a04788e5222678.js +1 -0
  79. package/assets/esri/core/workers/chunks/{cc3186dcbbf5edff8b9e.js → 4d7f6c92041d52cc8732.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{595edbc1e9bba47d5676.js → 4f89da01b67b66a92c01.js} +1 -1
  81. package/assets/esri/core/workers/chunks/507bbcde2b39321b50a4.js +1 -0
  82. package/assets/esri/core/workers/chunks/{9b8e33985310f281f084.js → 56a5b65961e722f5cae9.js} +1 -1
  83. package/assets/esri/core/workers/chunks/5830deda121e4c95d199.js +1 -0
  84. package/assets/esri/core/workers/chunks/{b102ae764c14d8b32ace.js → 58a52adc42fbe5cd12c6.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{b0e25ccb5a1e57a82628.js → 58b93f13316196d2e97d.js} +1 -1
  86. package/assets/esri/core/workers/chunks/58f98bd89b644cfdafae.js +1 -0
  87. package/assets/esri/core/workers/chunks/5a8658e4ef5163e8ab3b.js +1 -0
  88. package/assets/esri/core/workers/chunks/5aa3e1e9c701c7fef6e4.js +1 -0
  89. package/assets/esri/core/workers/chunks/5bb8d9d887dd4211afd2.js +1 -0
  90. package/assets/esri/core/workers/chunks/5d7625eb9997cd0dff09.js +1 -0
  91. package/assets/esri/core/workers/chunks/5e56a004b4407b8066eb.js +1 -0
  92. package/assets/esri/core/workers/chunks/5efc66be4576c6f67064.js +1 -0
  93. package/assets/esri/core/workers/chunks/60b1af54e7fc20fd9588.js +1 -0
  94. package/assets/esri/core/workers/chunks/6134a2c6983792787184.js +1 -0
  95. package/assets/esri/core/workers/chunks/6319413b89e23f671487.js +1 -0
  96. package/assets/esri/core/workers/chunks/{1b311ff39dede07865df.js → 633454b27c34f9ec7940.js} +1 -1
  97. package/assets/esri/core/workers/chunks/63c43ebf46964c283b4d.js +1 -0
  98. package/assets/esri/core/workers/chunks/65d3638ded62c5606ae3.js +1 -0
  99. package/assets/esri/core/workers/chunks/{aa0ef4493a7e9bed159f.js → 662f4b39ec44c68e0733.js} +1 -1
  100. package/assets/esri/core/workers/chunks/680bef5e8237cc3bdd84.js +1 -0
  101. package/assets/esri/core/workers/chunks/6835f959952f70972fce.js +1 -0
  102. package/assets/esri/core/workers/chunks/{ddf284648a73b6993737.js → 68d823697c298122ee08.js} +1 -1
  103. package/assets/esri/core/workers/chunks/6aaefd61505027267c9b.js +1 -0
  104. package/assets/esri/core/workers/chunks/6ceb17eada151230abf7.js +1 -0
  105. package/assets/esri/core/workers/chunks/6df29716f75696434807.js +1 -0
  106. package/assets/esri/core/workers/chunks/6e804bd6bb4b0ee44fa9.js +1 -0
  107. package/assets/esri/core/workers/chunks/{ee77999df3785468b2b6.js → 6f6e8b7e6e2c856e4ed1.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{8ea28a4b1afe8bb2d313.js → 7091bbdc36f1f03f14b3.js} +1 -1
  109. package/assets/esri/core/workers/chunks/7608de0d942b4c16b2f6.js +1 -0
  110. package/assets/esri/core/workers/chunks/{4b6f433022a6822706cb.js → 762817d30474c15142b4.js} +1 -1
  111. package/assets/esri/core/workers/chunks/762e9a15b2638475a2b4.js +1 -0
  112. package/assets/esri/core/workers/chunks/79088d5c9c2e6a780929.js +1 -0
  113. package/assets/esri/core/workers/chunks/{f3d57c5b9dffd12e45b4.js → 7c3a89c12ea32a071ad4.js} +1 -1
  114. package/assets/esri/core/workers/chunks/7c67596c0792282afdfc.js +1 -0
  115. package/assets/esri/core/workers/chunks/7cef6e5f39137e74bbc3.js +1 -0
  116. package/assets/esri/core/workers/chunks/{87e0ceb1a64ab08e679a.js → 7fd54fa2f91cdab44ab3.js} +1 -1
  117. package/assets/esri/core/workers/chunks/822a5020afbca21df7f7.js +1 -0
  118. package/assets/esri/core/workers/chunks/8599d2f2eb0fbb4a8bf5.js +1 -0
  119. package/assets/esri/core/workers/chunks/862f7090ba4a56c07093.js +1 -0
  120. package/assets/esri/core/workers/chunks/{97c7dfd29ad4c2966cb4.js → 88252899a5291ad29710.js} +1 -1
  121. package/assets/esri/core/workers/chunks/8837fbcc0d484659b79c.js +1 -0
  122. package/assets/esri/core/workers/chunks/8dcc7749de3391710864.js +1 -0
  123. package/assets/esri/core/workers/chunks/900dad076347443b3ad9.js +1 -0
  124. package/assets/esri/core/workers/chunks/{f8f7b86bbd62106bc3d4.js → 925f83be3c1eb4b5c6af.js} +1 -1
  125. package/assets/esri/core/workers/chunks/{a4a22149077c7780481c.js → 9378ce457b02717304e6.js} +1 -1
  126. package/assets/esri/core/workers/chunks/93a7cf23f73b23fc7802.js +1 -0
  127. package/assets/esri/core/workers/chunks/93c1d1e7c0935242071e.js +1 -0
  128. package/assets/esri/core/workers/chunks/{fddcb8be714ad18ad0c8.js → 970b33947bf61fccd461.js} +1 -1
  129. package/assets/esri/core/workers/chunks/97aaff86e06380a68df8.js +1 -0
  130. package/assets/esri/core/workers/chunks/9bc7df2b8ae0ed443d13.js +1 -0
  131. package/assets/esri/core/workers/chunks/9cc14a41d4a90f6d626e.js +1 -0
  132. package/assets/esri/core/workers/chunks/9e514a58b1165e273202.js +1 -0
  133. package/assets/esri/core/workers/chunks/9fe1db0762ab3326eab4.js +1 -0
  134. package/assets/esri/core/workers/chunks/{a5bb19d2b7d7db22222b.js → a10188c4d1904965898a.js} +1 -1
  135. package/assets/esri/core/workers/chunks/a2288d44cba34d947613.js +1 -0
  136. package/assets/esri/core/workers/chunks/a26916de4c105859621e.js +1 -0
  137. package/assets/esri/core/workers/chunks/a322afbb48898ce35851.js +1 -0
  138. package/assets/esri/core/workers/chunks/a34cadd486e7fcc79063.js +1 -0
  139. package/assets/esri/core/workers/chunks/{cefb70d633c220cbedf9.js → a4dc1a80ed6604d71722.js} +1 -1
  140. package/assets/esri/core/workers/chunks/{6baae3e856d904fef9b1.js → a8f70cece5ce2b095cdd.js} +1 -1
  141. package/assets/esri/core/workers/chunks/ab332bd411d6c7d4190c.js +1 -0
  142. package/assets/esri/core/workers/chunks/{777f2fdf1f4b9f243893.js → ab3a6ce7bc2a27b92469.js} +1 -1
  143. package/assets/esri/core/workers/chunks/abd2f8fae6b918fbdd6d.js +1 -0
  144. package/assets/esri/core/workers/chunks/{b13d2da33ec07e9d41ff.js → b0da2b089a89d643df1e.js} +1 -1
  145. package/assets/esri/core/workers/chunks/{65f4ca7201e7267bfc81.js → b5fcf4165ac72654742d.js} +1 -1
  146. package/assets/esri/core/workers/chunks/b82b523b6837ed1f28d3.js +2 -0
  147. package/assets/esri/core/workers/chunks/{527b87fddf33bb5d519e.js → ba77a8892cb23c7a297d.js} +1 -1
  148. package/assets/esri/core/workers/chunks/bb8089929ded0613d8e7.js +1 -0
  149. package/assets/esri/core/workers/chunks/bc7ca87d3bfe8a4aec81.js +1 -0
  150. package/assets/esri/core/workers/chunks/bc9b96a539f28afcb8cb.js +1 -0
  151. package/assets/esri/core/workers/chunks/{2d07d5a9ec67c39ef10c.js → bd4f29d2681e5596591a.js} +1 -1
  152. package/assets/esri/core/workers/chunks/bf9eba555aebca2c132b.js +1 -0
  153. package/assets/esri/core/workers/chunks/{903c7bd079888f65fef1.js → c3fbd81bb5820e48038f.js} +1 -1
  154. package/assets/esri/core/workers/chunks/c9df18e9ff7367a004b6.js +1 -0
  155. package/assets/esri/core/workers/chunks/ca8061e0a6d78d646ebf.js +1 -0
  156. package/assets/esri/core/workers/chunks/cc73ac8404615dc392d2.js +1 -0
  157. package/assets/esri/core/workers/chunks/{e823c9ccb7bc348d8824.js → ccb26860518dce6d01c0.js} +1 -1
  158. package/assets/esri/core/workers/chunks/cded34b161fcc790e672.js +1 -0
  159. package/assets/esri/core/workers/chunks/{1bf5c0a4bc5a960a3fa2.js → d1d4979e9dcabe5e4619.js} +1 -1
  160. package/assets/esri/core/workers/chunks/d2865c604849ce79183f.js +1 -0
  161. package/assets/esri/core/workers/chunks/{9b81bd62a2c72f592db1.js → d826f6d32b4c5885276a.js} +1 -1
  162. package/assets/esri/core/workers/chunks/d92540d3ffc4af980dd8.js +1 -0
  163. package/assets/esri/core/workers/chunks/dc7853795439ae77ace9.js +1 -0
  164. package/assets/esri/core/workers/chunks/{1f047dd747e7c1916dc7.js → dd55737fba0a8fe68101.js} +3 -3
  165. package/assets/esri/core/workers/chunks/dd8d19eb6b8e955c8067.js +1 -0
  166. package/assets/esri/core/workers/chunks/dda269a088275c823b40.js +1 -0
  167. package/assets/esri/core/workers/chunks/{7b70d6fdfa7a19ffffb0.js → de95dee8db92cf8f796f.js} +1 -1
  168. package/assets/esri/core/workers/chunks/e1c8767143f9f9d1f049.js +1 -0
  169. package/assets/esri/core/workers/chunks/{2cf2f2842c19be84ab4d.js → e6cb31c727f799c1297c.js} +1 -1
  170. package/assets/esri/core/workers/chunks/e934ef66d130c212c05b.js +1 -0
  171. package/assets/esri/core/workers/chunks/{7c56446184abcd14678b.js → ea77654c8964cc39b9a6.js} +1 -1
  172. package/assets/esri/core/workers/chunks/eb167f9f6132a6348d2e.js +1 -0
  173. package/assets/esri/core/workers/chunks/ed5ac1efd3cba49be756.js +1 -0
  174. package/assets/esri/core/workers/chunks/ef24fd6c0322e5de9fdf.js +2 -0
  175. package/assets/esri/core/workers/chunks/f219ba010c480bb75684.js +1 -0
  176. package/assets/esri/core/workers/chunks/fbf2d90240d36f8b423f.js +1 -0
  177. package/assets/esri/core/workers/chunks/{4ee99e654dad6f09abee.js → fc042b9936686785c39e.js} +1 -1
  178. package/assets/esri/core/workers/chunks/fc1658eae7b312502fab.js +1 -0
  179. package/assets/esri/core/workers/chunks/{af6b9fd77b1792fbb66e.js → fd4d124c5bf810d9e352.js} +1 -1
  180. package/assets/esri/core/workers/chunks/ffa35ecc681ec1c4739a.js +1 -0
  181. package/assets/esri/core/workers/chunks/ffca0b2333e760b66d3a.js +1 -0
  182. package/config.js +1 -1
  183. package/editing/sharedTemplates/executor/builders/bufferLineToPolygon.js +1 -1
  184. package/editing/sharedTemplates/executor/builders/bufferPointToPolygon.js +1 -1
  185. package/editing/sharedTemplates/executor/builders/bufferPolygonToPolygon.js +1 -1
  186. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  187. package/editing/sharedTemplates/executor/builders/support/offsetUtils.js +1 -1
  188. package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +1 -1
  189. package/geometry/Polygon.js +1 -1
  190. package/geometry/geometryEngine.d.ts +36 -36
  191. package/geometry/operators/affineTransformOperator.d.ts +30 -1
  192. package/geometry/operators/affineTransformOperator.js +1 -1
  193. package/geometry/operators/alphaShapeOperator.d.ts +49 -5
  194. package/geometry/operators/alphaShapeOperator.js +1 -1
  195. package/geometry/operators/areaOperator.d.ts +28 -4
  196. package/geometry/operators/areaOperator.js +1 -1
  197. package/geometry/operators/autoCompleteOperator.d.ts +25 -2
  198. package/geometry/operators/autoCompleteOperator.js +1 -1
  199. package/geometry/operators/boundaryOperator.d.ts +40 -2
  200. package/geometry/operators/boundaryOperator.js +1 -1
  201. package/geometry/operators/bufferOperator.d.ts +51 -6
  202. package/geometry/operators/bufferOperator.js +1 -1
  203. package/geometry/operators/centroidOperator.d.ts +23 -2
  204. package/geometry/operators/centroidOperator.js +1 -1
  205. package/geometry/operators/clipOperator.d.ts +34 -2
  206. package/geometry/operators/clipOperator.js +1 -1
  207. package/geometry/operators/containsOperator.d.ts +32 -2
  208. package/geometry/operators/containsOperator.js +1 -1
  209. package/geometry/operators/convexHullOperator.d.ts +47 -4
  210. package/geometry/operators/convexHullOperator.js +1 -1
  211. package/geometry/operators/crossesOperator.d.ts +35 -2
  212. package/geometry/operators/crossesOperator.js +1 -1
  213. package/geometry/operators/cutOperator.d.ts +23 -2
  214. package/geometry/operators/cutOperator.js +1 -1
  215. package/geometry/operators/densifyOperator.d.ts +61 -6
  216. package/geometry/operators/densifyOperator.js +1 -1
  217. package/geometry/operators/differenceOperator.d.ts +34 -2
  218. package/geometry/operators/differenceOperator.js +1 -1
  219. package/geometry/operators/disjointOperator.d.ts +33 -2
  220. package/geometry/operators/disjointOperator.js +1 -1
  221. package/geometry/operators/distanceOperator.d.ts +29 -4
  222. package/geometry/operators/distanceOperator.js +1 -1
  223. package/geometry/operators/equalsOperator.d.ts +32 -2
  224. package/geometry/operators/equalsOperator.js +1 -1
  225. package/geometry/operators/extendOperator.d.ts +29 -3
  226. package/geometry/operators/extendOperator.js +1 -1
  227. package/geometry/operators/generalizeOperator.d.ts +46 -5
  228. package/geometry/operators/generalizeOperator.js +1 -1
  229. package/geometry/operators/geodesicBufferOperator.d.ts +71 -7
  230. package/geometry/operators/geodesicBufferOperator.js +1 -1
  231. package/geometry/operators/geodesicProximityOperator.d.ts +106 -14
  232. package/geometry/operators/geodesicProximityOperator.js +1 -1
  233. package/geometry/operators/geodeticAreaOperator.d.ts +51 -5
  234. package/geometry/operators/geodeticAreaOperator.js +1 -1
  235. package/geometry/operators/geodeticDensifyOperator.d.ts +65 -6
  236. package/geometry/operators/geodeticDensifyOperator.js +1 -1
  237. package/geometry/operators/geodeticDistanceOperator.d.ts +52 -5
  238. package/geometry/operators/geodeticDistanceOperator.js +1 -1
  239. package/geometry/operators/geodeticLengthOperator.d.ts +51 -5
  240. package/geometry/operators/geodeticLengthOperator.js +1 -1
  241. package/geometry/operators/geodeticUtilsOperator.d.ts +79 -9
  242. package/geometry/operators/geodeticUtilsOperator.js +1 -1
  243. package/geometry/operators/graphicBufferOperator.d.ts +47 -4
  244. package/geometry/operators/graphicBufferOperator.js +1 -1
  245. package/geometry/operators/integrateOperator.d.ts +24 -2
  246. package/geometry/operators/integrateOperator.js +1 -1
  247. package/geometry/operators/intersectionOperator.d.ts +88 -3
  248. package/geometry/operators/intersectionOperator.js +1 -1
  249. package/geometry/operators/intersectsOperator.d.ts +32 -2
  250. package/geometry/operators/intersectsOperator.js +1 -1
  251. package/geometry/operators/isNearOperator.d.ts +31 -4
  252. package/geometry/operators/isNearOperator.js +1 -1
  253. package/geometry/operators/json/bufferOperator.js +1 -1
  254. package/geometry/operators/json/containsOperator.js +1 -1
  255. package/geometry/operators/json/convexHullOperator.js +1 -1
  256. package/geometry/operators/json/crossesOperator.js +1 -1
  257. package/geometry/operators/json/disjointOperator.js +1 -1
  258. package/geometry/operators/json/generalizeOperator.js +1 -1
  259. package/geometry/operators/json/geodesicBufferOperator.js +1 -1
  260. package/geometry/operators/json/graphicBufferOperator.js +1 -1
  261. package/geometry/operators/json/intersectionOperator.js +1 -1
  262. package/geometry/operators/json/intersectsOperator.js +1 -1
  263. package/geometry/operators/json/lengthOperator.js +1 -1
  264. package/geometry/operators/json/offsetOperator.js +1 -1
  265. package/geometry/operators/json/overlapsOperator.js +1 -1
  266. package/geometry/operators/json/projectOperator.js +1 -1
  267. package/geometry/operators/json/simplifyOperator.js +1 -1
  268. package/geometry/operators/json/simplifyOperatorOGC.js +1 -1
  269. package/geometry/operators/json/touchesOperator.js +1 -1
  270. package/geometry/operators/json/unionOperator.js +1 -1
  271. package/geometry/operators/json/withinOperator.js +1 -1
  272. package/geometry/operators/labelPointOperator.d.ts +32 -2
  273. package/geometry/operators/labelPointOperator.js +1 -1
  274. package/geometry/operators/lengthOperator.d.ts +28 -4
  275. package/geometry/operators/lengthOperator.js +1 -1
  276. package/geometry/operators/linesToPolygonsOperator.d.ts +23 -2
  277. package/geometry/operators/linesToPolygonsOperator.js +1 -1
  278. package/geometry/operators/locateBetweenOperator.d.ts +28 -2
  279. package/geometry/operators/locateBetweenOperator.js +1 -1
  280. package/geometry/operators/minimumBoundingCircleOperator.d.ts +38 -4
  281. package/geometry/operators/minimumBoundingCircleOperator.js +1 -1
  282. package/geometry/operators/multiPartToSinglePartOperator.d.ts +33 -4
  283. package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
  284. package/geometry/operators/offsetOperator.d.ts +50 -5
  285. package/geometry/operators/offsetOperator.js +1 -1
  286. package/geometry/operators/overlapsOperator.d.ts +33 -2
  287. package/geometry/operators/overlapsOperator.js +1 -1
  288. package/geometry/operators/polygonOverlayOperator.d.ts +31 -5
  289. package/geometry/operators/polygonOverlayOperator.js +1 -1
  290. package/geometry/operators/polygonSlicerOperator.d.ts +72 -10
  291. package/geometry/operators/polygonSlicerOperator.js +1 -1
  292. package/geometry/operators/projectOperator.d.ts +63 -3
  293. package/geometry/operators/projectOperator.js +1 -1
  294. package/geometry/operators/proximityOperator.d.ts +71 -9
  295. package/geometry/operators/proximityOperator.js +1 -1
  296. package/geometry/operators/relateOperator.d.ts +41 -2
  297. package/geometry/operators/relateOperator.js +1 -1
  298. package/geometry/operators/reshapeOperator.d.ts +28 -2
  299. package/geometry/operators/reshapeOperator.js +1 -1
  300. package/geometry/operators/shapePreservingProjectOperator.d.ts +64 -6
  301. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  302. package/geometry/operators/simplifyOGCOperator.d.ts +72 -6
  303. package/geometry/operators/simplifyOGCOperator.js +1 -1
  304. package/geometry/operators/simplifyOperator.d.ts +72 -4
  305. package/geometry/operators/simplifyOperator.js +1 -1
  306. package/geometry/operators/singlePartToMultiPartOperator.js +1 -1
  307. package/geometry/operators/support/Transformation.d.ts +17 -11
  308. package/geometry/operators/support/jsonConverter.js +1 -1
  309. package/geometry/operators/symmetricDifferenceOperator.d.ts +33 -2
  310. package/geometry/operators/symmetricDifferenceOperator.js +1 -1
  311. package/geometry/operators/touchesOperator.d.ts +32 -2
  312. package/geometry/operators/touchesOperator.js +1 -1
  313. package/geometry/operators/types.d.ts +4 -1
  314. package/geometry/operators/unionOperator.d.ts +33 -2
  315. package/geometry/operators/unionOperator.js +1 -1
  316. package/geometry/operators/withinOperator.d.ts +32 -2
  317. package/geometry/operators/withinOperator.js +1 -1
  318. package/geometry/projectionUtils.js +1 -1
  319. package/geometry/support/geometryUtils.js +1 -1
  320. package/geometry/support/normalizeUtils.d.ts +5 -3
  321. package/geometry/support/normalizeUtils.js +1 -1
  322. package/interfaces.d.ts +202 -202
  323. package/kernel.js +1 -1
  324. package/layers/graphics/data/QueryEngineResult.js +1 -1
  325. package/layers/graphics/data/queryUtils.js +1 -1
  326. package/layers/graphics/data/spatialQuerySupport.js +1 -1
  327. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  328. package/layers/mixins/ArcGISImageService.js +1 -1
  329. package/layers/mixins/TiledImagery.js +1 -1
  330. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  331. package/layers/raster/datasets/FunctionRaster.js +1 -1
  332. package/layers/raster/datasets/pixelReader.js +1 -1
  333. package/layers/raster/functions/clipUtils.js +1 -1
  334. package/layers/raster/functions/rasterProjectionHelper.js +1 -1
  335. package/layers/support/Sublayer.js +1 -1
  336. package/layers/video/videoUtils.js +1 -1
  337. package/package.json +4 -4
  338. package/popup/FeatureContentCollection.d.ts +3 -3
  339. package/popup/FeatureContentCollection.js +1 -1
  340. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  341. package/support/revision.js +1 -1
  342. package/support/tests/serviceMockDependencies.js +1 -1
  343. package/support/tests/setupServiceMocksMesh.js +1 -1
  344. package/symbols/cim/CIMEffects.js +1 -1
  345. package/symbols/cim/effects/EffectBuffer.js +1 -1
  346. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  347. package/symbols/cim/effects/EffectDonut.js +1 -1
  348. package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
  349. package/symbols/cim/effects/EffectOffset.js +1 -1
  350. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  351. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +1 -1
  352. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementController.js +1 -1
  353. package/views/2d/engine/webgl/Overlay.js +1 -1
  354. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  355. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  356. package/views/2d/layers/TileLayerView2D.js +1 -1
  357. package/views/2d/layers/support/RouteLayerWaypointVisualization.js +1 -1
  358. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  359. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementController.js +1 -1
  360. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  361. package/views/3d/layers/ElevationLayerView3DModifications.js +1 -1
  362. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  363. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  364. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  365. package/views/MapView.d.ts +3 -3
  366. package/views/VideoView.js +1 -1
  367. package/views/View2D.d.ts +22 -22
  368. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  369. package/views/draw/DrawTool.js +1 -1
  370. package/views/draw/support/createUtils.js +1 -1
  371. package/views/layers/SceneLayerView.js +1 -1
  372. package/views/support/GeometryWorker.js +1 -1
  373. package/views/support/imageReprojection.js +1 -1
  374. package/views/video/VideoOperationalDataView.js +1 -1
  375. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  376. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  377. package/widgets/BatchAttributeForm/expressions/expressionUtils.js +1 -1
  378. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  379. package/widgets/BatchAttributeForm/templates/FieldElementTemplate.js +1 -1
  380. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  381. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  382. package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
  383. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  384. package/widgets/ElevationProfile/support/ElevationProfileView.js +1 -1
  385. package/widgets/ElevationProfile/support/InputRepresentation2D.js +1 -1
  386. package/widgets/ElevationProfile/support/InputRepresentation3D.js +1 -1
  387. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  388. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  389. package/widgets/Features/FeaturesViewModel.js +1 -1
  390. package/widgets/Features.js +1 -1
  391. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  392. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  393. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  394. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  395. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  396. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  397. package/widgets/OrientedImageryViewer/support/panConstraint.js +1 -1
  398. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  399. package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
  400. package/widgets/Print.js +1 -1
  401. package/widgets/Search/SearchViewModel.js +1 -1
  402. package/widgets/Search/support/layerSearchUtils.js +1 -1
  403. package/widgets/Search/support/locatorUtils.js +1 -1
  404. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  405. package/widgets/support/FilterBuilder/FilterBuilderViewModel.d.ts +104 -0
  406. package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
  407. package/widgets/support/FilterBuilder.js +1 -1
  408. package/widgets/support/FilterCondition/FilterConditionViewModel.d.ts +145 -0
  409. package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
  410. package/widgets/support/FilterCondition/types.d.ts +20 -0
  411. package/widgets/support/ItemList.js +1 -1
  412. package/widgets/support/SelectionList/FeatureItem.d.ts +17 -68
  413. package/widgets/support/SelectionList/FeatureItem.js +1 -1
  414. package/widgets/support/SelectionList/GroupLayerItem.d.ts +12 -50
  415. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  416. package/widgets/support/SelectionList/ItemBase.d.ts +14 -44
  417. package/widgets/support/SelectionList/ItemBase.js +1 -1
  418. package/widgets/support/SelectionList/LayerItem.d.ts +10 -56
  419. package/widgets/support/SelectionList/LayerItem.js +1 -1
  420. package/widgets/support/SelectionList/types.d.ts +4 -4
  421. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  422. package/assets/esri/core/workers/chunks/090ea7a131f8f60203ed.js +0 -1
  423. package/assets/esri/core/workers/chunks/0b4a7209b99227a842ad.js +0 -1
  424. package/assets/esri/core/workers/chunks/0be98adfef79fc5036f0.js +0 -1
  425. package/assets/esri/core/workers/chunks/0d2e2d90a4e4a28e2c0c.js +0 -1
  426. package/assets/esri/core/workers/chunks/0d7763d39a5a8586a0ae.js +0 -1
  427. package/assets/esri/core/workers/chunks/0d95f72e1c07ab867d21.js +0 -1
  428. package/assets/esri/core/workers/chunks/0dbbac7a2378728571a7.js +0 -1
  429. package/assets/esri/core/workers/chunks/0df9864ecebe6a2b973f.js +0 -1
  430. package/assets/esri/core/workers/chunks/104d74bc36c28c519396.js +0 -1
  431. package/assets/esri/core/workers/chunks/1670e9867efde4d7a6d6.js +0 -1
  432. package/assets/esri/core/workers/chunks/1c803eef9a8fdabc61e3.js +0 -2
  433. package/assets/esri/core/workers/chunks/1e192ac0533a5c0b5a7a.js +0 -1
  434. package/assets/esri/core/workers/chunks/1fe077f57a087c0e9119.js +0 -1
  435. package/assets/esri/core/workers/chunks/20f7b5fe64a217cb3d3d.js +0 -1
  436. package/assets/esri/core/workers/chunks/212222b64039d436b9a6.js +0 -1
  437. package/assets/esri/core/workers/chunks/24944b625ed8dcd904f0.js +0 -1
  438. package/assets/esri/core/workers/chunks/2b6d261fe79fe186fb22.js +0 -1
  439. package/assets/esri/core/workers/chunks/2bc3e7f394386fa75447.js +0 -1
  440. package/assets/esri/core/workers/chunks/30af0f7c4cfa541c9efd.js +0 -1
  441. package/assets/esri/core/workers/chunks/30d816bdeea00f6fa1ca.js +0 -1
  442. package/assets/esri/core/workers/chunks/35d46c2f658a8e92d913.js +0 -1
  443. package/assets/esri/core/workers/chunks/36e35a8067b18f59cc05.js +0 -1
  444. package/assets/esri/core/workers/chunks/3869dca884d7ca6488f5.js +0 -1
  445. package/assets/esri/core/workers/chunks/3f5234120d3a14186c1c.js +0 -1
  446. package/assets/esri/core/workers/chunks/45c1c90ac6c14657f3ff.js +0 -1
  447. package/assets/esri/core/workers/chunks/4a40b894ec89b0a4f9bf.js +0 -1
  448. package/assets/esri/core/workers/chunks/5165d367328ac7badf47.js +0 -1
  449. package/assets/esri/core/workers/chunks/5168bd8ab6233dc9c32a.js +0 -1
  450. package/assets/esri/core/workers/chunks/545bec045167c433af8f.js +0 -1
  451. package/assets/esri/core/workers/chunks/5782c0362a1799ceef41.js +0 -1
  452. package/assets/esri/core/workers/chunks/59598023c0aea62a6297.js +0 -1
  453. package/assets/esri/core/workers/chunks/59f0a2bd40b033ce77e4.js +0 -1
  454. package/assets/esri/core/workers/chunks/5af16937904c06fb06f6.js +0 -1
  455. package/assets/esri/core/workers/chunks/5b8591486f33627f5389.js +0 -1
  456. package/assets/esri/core/workers/chunks/6057a79c68c33ee4a193.js +0 -1
  457. package/assets/esri/core/workers/chunks/607acd9f615f87e14075.js +0 -1
  458. package/assets/esri/core/workers/chunks/62ee6c247f783acabb74.js +0 -1
  459. package/assets/esri/core/workers/chunks/63127e3b22e7eac6003d.js +0 -2
  460. package/assets/esri/core/workers/chunks/6564f17c4700dc8d9c0e.js +0 -2
  461. package/assets/esri/core/workers/chunks/678585509706755c0434.js +0 -2
  462. package/assets/esri/core/workers/chunks/691e9cc541cfaebe1776.js +0 -1
  463. package/assets/esri/core/workers/chunks/6a2d890640b2cd6c5ccb.js +0 -1
  464. package/assets/esri/core/workers/chunks/6b84982dfaf084a61b93.js +0 -1
  465. package/assets/esri/core/workers/chunks/6cbc30b31f0bb39c73ca.js +0 -1
  466. package/assets/esri/core/workers/chunks/6f01bd01b13662eb3bd7.js +0 -1
  467. package/assets/esri/core/workers/chunks/74cd9df85c4560bb8e52.js +0 -1
  468. package/assets/esri/core/workers/chunks/75bddfe2be64379db8fd.js +0 -1
  469. package/assets/esri/core/workers/chunks/7cf903db44f3647c8fd4.js +0 -1
  470. package/assets/esri/core/workers/chunks/7ddb5800777fbecee3a8.js +0 -1
  471. package/assets/esri/core/workers/chunks/7eae9053065d3d38e54e.js +0 -1
  472. package/assets/esri/core/workers/chunks/80f38ab2b7ae61e6f301.js +0 -1
  473. package/assets/esri/core/workers/chunks/854f42f16fdb40000aae.js +0 -1
  474. package/assets/esri/core/workers/chunks/87094044458b0ea5cb0f.js +0 -2
  475. package/assets/esri/core/workers/chunks/88f03352a4dc6184ea1f.js +0 -1
  476. package/assets/esri/core/workers/chunks/909ee7d2a0eec773037a.js +0 -1
  477. package/assets/esri/core/workers/chunks/91ac9328afff8a51bd96.js +0 -1
  478. package/assets/esri/core/workers/chunks/9246e2468528650bdc7c.js +0 -1
  479. package/assets/esri/core/workers/chunks/92a6559a6999b26362d7.js +0 -1
  480. package/assets/esri/core/workers/chunks/94ddfe165ac25aef8229.js +0 -1
  481. package/assets/esri/core/workers/chunks/9509bef285929c52c244.js +0 -1
  482. package/assets/esri/core/workers/chunks/99966339b061eb9945b8.js +0 -1
  483. package/assets/esri/core/workers/chunks/99f627938dbf0152fc02.js +0 -1
  484. package/assets/esri/core/workers/chunks/9df38cadebf8e6fd746c.js +0 -1
  485. package/assets/esri/core/workers/chunks/9e2b3754a76e0dd4a94a.js +0 -1
  486. package/assets/esri/core/workers/chunks/a0565137027c83108953.js +0 -1
  487. package/assets/esri/core/workers/chunks/a0eb882a5a81d25b9153.js +0 -1
  488. package/assets/esri/core/workers/chunks/a785e827f0215a73103d.js +0 -1
  489. package/assets/esri/core/workers/chunks/abe7670db06b27c0c8c8.js +0 -1
  490. package/assets/esri/core/workers/chunks/b19cff0e43fab2632660.js +0 -1
  491. package/assets/esri/core/workers/chunks/b333de4dea14c5db0a4d.js +0 -1
  492. package/assets/esri/core/workers/chunks/b6af90be328ebda26b8d.js +0 -1
  493. package/assets/esri/core/workers/chunks/b7c0da9d255d5e48320d.js +0 -1
  494. package/assets/esri/core/workers/chunks/bd7d87d175ba933ab2ce.js +0 -1
  495. package/assets/esri/core/workers/chunks/be0417df35a7d99af675.js +0 -1
  496. package/assets/esri/core/workers/chunks/c30b6bbabd05e4976fba.js +0 -1
  497. package/assets/esri/core/workers/chunks/c35553d07ad169910742.js +0 -1
  498. package/assets/esri/core/workers/chunks/c5c2fed38e0ccf84f1fa.js +0 -1
  499. package/assets/esri/core/workers/chunks/c88bfa51d2a8a024fc24.js +0 -1
  500. package/assets/esri/core/workers/chunks/ca36d85a47179d95f2fc.js +0 -1
  501. package/assets/esri/core/workers/chunks/d0cf9ff48f051adbd455.js +0 -1
  502. package/assets/esri/core/workers/chunks/d1304d414b1fa725168a.js +0 -1
  503. package/assets/esri/core/workers/chunks/d24125a791247019e2ca.js +0 -1
  504. package/assets/esri/core/workers/chunks/d26be8313526ecea9c68.js +0 -1
  505. package/assets/esri/core/workers/chunks/d2cb3d5ef0a9285afb78.js +0 -1
  506. package/assets/esri/core/workers/chunks/d4b0012ae1d3b8a9ba01.js +0 -1
  507. package/assets/esri/core/workers/chunks/e018cbd97e6e0e4ca5c4.js +0 -1
  508. package/assets/esri/core/workers/chunks/e39bccc000c768120a32.js +0 -1
  509. package/assets/esri/core/workers/chunks/e4380706b629729f2212.js +0 -1
  510. package/assets/esri/core/workers/chunks/ea1877ce00da3b585a30.js +0 -1
  511. package/assets/esri/core/workers/chunks/ea5ee1b12b43594592a0.js +0 -1
  512. package/assets/esri/core/workers/chunks/ea91c57a0b31f3f65ee5.js +0 -1
  513. package/assets/esri/core/workers/chunks/eafc591e1a98000d54ef.js +0 -1
  514. package/assets/esri/core/workers/chunks/ef851a2cff76fd211c07.js +0 -1
  515. package/assets/esri/core/workers/chunks/f3e53be08ab9dbdf17ae.js +0 -1
  516. package/assets/esri/core/workers/chunks/f53010adb70463b75bb9.js +0 -1
  517. package/assets/esri/core/workers/chunks/f5a058a0ce006bce2a2a.js +0 -1
  518. package/assets/esri/core/workers/chunks/f5f5b54cab722abe88e0.js +0 -1
  519. package/assets/esri/core/workers/chunks/f60ed579981913d44675.js +0 -1
  520. package/assets/esri/core/workers/chunks/f6f56f3e011dcef90bbb.js +0 -1
  521. package/assets/esri/core/workers/chunks/f83c3597e9332bd991eb.js +0 -1
  522. package/assets/esri/core/workers/chunks/f9a4387f850d85c44ca5.js +0 -1
  523. package/assets/esri/core/workers/chunks/fdd0e6d9927d3c43b0d3.js +0 -1
  524. package/geometry/operators/importUtils.js +0 -2
  525. /package/assets/esri/core/workers/chunks/{1c803eef9a8fdabc61e3.js.LICENSE.txt → 1082bb0858585bd4fa21.js.LICENSE.txt} +0 -0
  526. /package/assets/esri/core/workers/chunks/{87094044458b0ea5cb0f.js.LICENSE.txt → 2e2349387a2b9903f13c.js.LICENSE.txt} +0 -0
  527. /package/assets/esri/core/workers/chunks/{678585509706755c0434.js.LICENSE.txt → 411bbdecba340df11d95.js.LICENSE.txt} +0 -0
  528. /package/assets/esri/core/workers/chunks/{5edf77618ca51819d7c4.js.LICENSE.txt → 476535cfb06ced74d611.js.LICENSE.txt} +0 -0
  529. /package/assets/esri/core/workers/chunks/{6564f17c4700dc8d9c0e.js.LICENSE.txt → b82b523b6837ed1f28d3.js.LICENSE.txt} +0 -0
  530. /package/assets/esri/core/workers/chunks/{63127e3b22e7eac6003d.js.LICENSE.txt → ef24fd6c0322e5de9fdf.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import{deprecatedProperty as i}from"../core/deprecate.js";import r from"../core/Error.js";import{EventedAccessor as s}from"../core/Evented.js";import a from"../core/Logger.js";import{abortMaybe as n}from"../core/maybe.js";import{debounce as o,logOnError as l,isAbortError as u}from"../core/promiseUtils.js";import h from"../core/ReactiveSet.js";import{watch as c,when as p,sync as d}from"../core/reactiveUtils.js";import{addMany as g}from"../core/SetUtils.js";import{property as m,subclass as f}from"../core/accessorSupport/decorators.js";import y from"../geometry/Point.js";import{project as _}from"../geometry/projectionUtils.js";import F from"../geometry/SpatialReference.js";import{geographicToWebMercator as v}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as w}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as b}from"../layers/LayerConstants.js";import{ActionsCollection as I,zoomToAggregatedFeatures as C,browseAggregatedFeatures as S,zoomToFeature as A}from"./actions.js";import{getSelectedTarget as P}from"./actionUtils.js";import L from"./FeatureContent.js";import j from"./support/FeatureAbilities.js";import{getDisplayedSymbol as x}from"../symbols/support/symbolUtils.js";import{system as E}from"../time/constants.js";import{highlightsSupported as R}from"../views/support/layerViewUtils.js";import{GoTo as O}from"../widgets/support/GoTo.js";const U=()=>[A.clone()],T=()=>[C.clone(),S.clone()];let M=null;function V(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let H=class extends(O(s)){constructor(e){super(e),this._pendingPromises=new h,this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new j,this._featureStreamVersion=0,this._activeFeatureStream=null,this.actions=new I,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.streamingFeatures=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=o(async()=>{this._cancelLocationUpdate();const e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([c(()=>this.view?.scale,()=>{this.open&&l(this._debouncedLocationUpdate(),a.getLogger(this))}),c(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),c(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),c(()=>this.location,e=>this._locationChange(e)),c(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),c(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),c(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),c(()=>this.featureItems,()=>this._featureItemsChange()),c(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),p(()=>!this.waitingForResult,()=>this._waitingForResultChange(),d),p(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this._pendingPromises.clear(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new I;e.removeAll();const{actions:i,defaultActions:r,defaultPopupTemplateEnabled:s,includeDefaultActions:a,selectedFeature:n}=this,o=a?r.concat(i):i,l=n&&("function"==typeof n.getEffectivePopupTemplate&&n.getEffectivePopupTemplate(s)||n.popupTemplate),u=l?.actions,h=l?.overwriteActions?u:u?.concat(o)??o;return h?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.promises=[],this.featureStream=null,this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new I;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?T():U()),e}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get("featureStream")||null}set featureStream(e){if(this._get("featureStream")===e)return;if(this._set("featureStream",e),this._cancelFeatureStream(),!e)return;this.promises=[];const t=this._featureStreamVersion;this._activeFeatureStream=e,this._queueFeatureStreamFetching(e,t),this._consumeFeatureStream(e,t).catch(()=>{})}get initialDisplayMode(){return this._get("initialDisplayMode")||"feature"}set initialDisplayMode(e){this._set("initialDisplayMode",e),this._syncSelectedFeatureIndex(this.features)}set location(e){const t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?v(e):e;this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){const e=this._get("promises")||[];return e.length>0&&i(a.getLogger(this),"promises",{replacement:"featureStream",warnOnce:!0}),e}set promises(e){Array.isArray(e)&&e.length>0&&i(a.getLogger(this),"promises",{replacement:"featureStream",warnOnce:!0}),this._get("promises")!==e&&(this._cancelFeatureStream(),this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),e=e.slice(),g(this._pendingPromises,e),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get selectedFeature(){return-1===this.selectedFeatureIndex?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.view?this.view.ready?"ready":"disabled":this.map?"ready":"disabled"}get timeZone(){return this.view?.timeZone??E}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return(this.streamingFeatures||this.pendingPromisesCount>0)&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this.set({featureStream:null,promises:[],features:[],content:null,heading:null,location:null,activeFeature:null})}async fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new r("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screen point/screen area and view.",{screenPoint:e,view:i});const s=i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal});this.featureStream=s}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){const{pendingPromisesCount:t,promiseCount:i,selectedFeatureIndex:r}=this,s=i>0&&e.length>0,a=null!=this._activeFeatureStream&&e.length>0,n=s||a;"list"!==this.initialDisplayMode?n&&-1===r?this.selectedFeatureIndex=0:n&&-1!==r||(this.selectedFeatureIndex=e.length?0:-1):(!n||s&&t===i)&&(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=P(this);this._cancelCenterAtLocation();const i=new AbortController,{signal:s}=i;return this._centerAtLocationController=i,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:s}}).catch(e=>{u(e)||a.getLogger(this).error(e)}):Promise.reject(new r("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:r}=this;r&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){"list"!==this.initialDisplayMode&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:r,featureItems:s}=this;if(null==i)return;const a=((i-1)*r+t)%t,n=Math.min(a+r,s.length);for(let o=a;o<n;o++){const t=s[o];t&&(t.graphic??=e[o])}}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;const s=w(e)?.type;if("map-image"!==s&&"imagery"!==s&&"imagery-tile"!==s||(e.symbol=await x(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const t=await(import("../geometry/operators/labelPointOperator.js"));return void(this.location=t.execute(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&(this.promises.length>0||this.featureStream)&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,r=this.view,s=this.spatialReference,a=this.map,n=this.timeZone,o=this.location,l=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length)return void this._destroyFeatureItems();const u=[],h=new Map,c=new Set;i.forEach(e=>{const t=e?.graphic;e&&t&&h.set(t,e)}),t.forEach((t,p)=>{if(!t)return;const d=i[p];if(d&&!c.has(d)&&(null==d.graphic||d.graphic===t))return d.abilities=l,u[p]=d,void c.add(d);const g=h.get(t);if(g&&!c.has(g))return g.abilities=l,u[p]=g,void c.add(g);const m=new L({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:s,graphic:t===e?t:null,location:o,map:a,view:r,timeZone:n});u[p]=m,c.add(m)}),i.forEach(e=>{!e||c.has(e)||e.destroyed||e.destroy()}),this._set("featureItems",u)}_cancelCenterAtLocation(){this._centerAtLocationController=n(this._centerAtLocationController)}_cancelFeatureStream(){this._featureStreamVersion++,this._setStreamingFeatures(!1);const e=this._activeFeatureStream;this._activeFeatureStream=null,this._get("featureStream")===e&&this._set("featureStream",null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){const{spatialReference:t}=this,i=this.selectedFeature,r=i?.geometry?.type,s=this.location;if(r&&"mesh"!==r&&t&&s&&i){if("point"===r){const t=await(import("../geometry/operators/labelPointOperator.js"));if(e?.signal?.aborted||this.selectedFeature!==i||!i.geometry)return;return void(this.location=t.execute(i.geometry))}try{let r=i.geometry;const a=this._getHighlightLayer(i),n=i.getObjectId();if(!a||!this.view)return;if(null!=n){const i=this.view?.allLayerViews.find(e=>e.layer.uid===a.uid);if(!i||!("queryFeatures"in i))return;const s=i.createQuery();s.outSpatialReference=t,s.objectIds=[n],s.returnGeometry=!0;const{features:o}=await i.queryFeatures(s,e);if(e?.signal?.aborted)return;r=o[0]?.geometry}if(!r||"mesh"===r.type)return;r=_(r,t),M??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[o,l]=M;if(!o.execute(r,s)){const e=l.getNearestCoordinate(r,s).coordinate??s;this.selectedFeature===i&&(this.location=e)}}catch(n){u(n)||a.getLogger(this).error(n)}}}_cancelLocationUpdate(){this._locationUpdateController=n(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=w(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(V(t.type,i))return e;const r=e.getObjectId();if(null!=r)return r;const s="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||b:null,a=e.attributes;return a&&s&&a[s]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:r,view:s,open:a}=this;if(!s||!r||!a)return;const n=this._getHighlightLayer(i);if(!n)return;const o=this._getHighlightLayerView(s,n);if(!o)return;this._highlightPromises[e]=o;const l=await o;if(!(l&&R(l)&&this._highlightPromises[e]===o&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,n,s.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}async _consumeFeatureStream(e,t){try{for await(const i of e){if(t!==this._featureStreamVersion)return;this._updateFeatures([i])}}finally{this._activeFeatureStream===e&&(this._activeFeatureStream=null,this._setStreamingFeatures(!1),this._waitingForResultChange())}}_queueFeatureStreamFetching(e,t){queueMicrotask(()=>{this._activeFeatureStream===e&&t===this._featureStreamVersion&&this._setStreamingFeatures(!0)})}_setStreamingFeatures(e){this.streamingFeatures!==e&&this._set("streamingFeatures",e)}_updateFeatures(e){const{features:t}=this,i=new Set(t),r=e.filter(e=>!i.has(e));r?.length&&(this.features=t.concat(r))}};e([m({type:I})],H.prototype,"actions",void 0),e([m({readOnly:!0})],H.prototype,"active",null),e([m()],H.prototype,"activeFeature",void 0),e([m({readOnly:!0})],H.prototype,"allActions",null),e([m()],H.prototype,"aggregatedFeaturesEnabled",void 0),e([m({value:null})],H.prototype,"content",null),e([m({type:I,readOnly:!0})],H.prototype,"defaultActions",null),e([m({type:Boolean})],H.prototype,"defaultPopupTemplateEnabled",void 0),e([m({readOnly:!0})],H.prototype,"effectiveHeading",null),e([m({readOnly:!0})],H.prototype,"featureCount",null),e([m()],H.prototype,"featurePage",void 0),e([m({value:[]})],H.prototype,"features",null),e([m()],H.prototype,"featureStream",null),e([m()],H.prototype,"featuresPerPage",void 0),e([m()],H.prototype,"featureMenuOpen",void 0),e([m({type:j})],H.prototype,"featureItemAbilities",void 0),e([m({readOnly:!0})],H.prototype,"featureItems",void 0),e([m()],H.prototype,"heading",void 0),e([m()],H.prototype,"highlightEnabled",void 0),e([m()],H.prototype,"includeDefaultActions",void 0),e([m({value:"feature"})],H.prototype,"initialDisplayMode",null),e([m({type:y})],H.prototype,"location",null),e([m()],H.prototype,"map",null),e([m()],H.prototype,"open",void 0),e([m({readOnly:!0})],H.prototype,"streamingFeatures",void 0),e([m({readOnly:!0})],H.prototype,"pendingPromisesCount",null),e([m({readOnly:!0})],H.prototype,"promiseCount",null),e([m()],H.prototype,"promises",null),e([m({value:null,readOnly:!0})],H.prototype,"selectedFeature",null),e([m({value:-1})],H.prototype,"selectedFeatureIndex",null),e([m({readOnly:!0})],H.prototype,"selectedFeatureItem",null),e([m({type:F})],H.prototype,"spatialReference",null),e([m({readOnly:!0})],H.prototype,"state",null),e([m()],H.prototype,"timeZone",null),e([m()],H.prototype,"updateLocationEnabled",void 0),e([m()],H.prototype,"view",void 0),e([m({readOnly:!0})],H.prototype,"waitingForContents",null),e([m({readOnly:!0})],H.prototype,"waitingForResult",null),e([m()],H.prototype,"zoomFactor",void 0),H=e([f("esri.popup.FeatureContentCollection")],H);const D=H;export{D as default};
2
+ import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import{deprecatedProperty as i}from"../core/deprecate.js";import r from"../core/Error.js";import{EventedAccessor as s}from"../core/Evented.js";import a from"../core/Logger.js";import{abortMaybe as n}from"../core/maybe.js";import{debounce as o,logOnError as l,isAbortError as u}from"../core/promiseUtils.js";import h from"../core/ReactiveSet.js";import{watch as c,when as p,sync as d}from"../core/reactiveUtils.js";import{addMany as g}from"../core/SetUtils.js";import{property as m,subclass as f}from"../core/accessorSupport/decorators.js";import y from"../geometry/Point.js";import{project as _}from"../geometry/projectionUtils.js";import F from"../geometry/SpatialReference.js";import{geographicToWebMercator as v}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as w}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as b}from"../layers/LayerConstants.js";import{ActionsCollection as I,zoomToAggregatedFeatures as C,browseAggregatedFeatures as S,zoomToFeature as P}from"./actions.js";import{getSelectedTarget as A}from"./actionUtils.js";import L from"./FeatureContent.js";import x from"./support/FeatureAbilities.js";import{getDisplayedSymbol as j}from"../symbols/support/symbolUtils.js";import{system as E}from"../time/constants.js";import{highlightsSupported as R}from"../views/support/layerViewUtils.js";import{GoTo as O}from"../widgets/support/GoTo.js";const U=()=>[P.clone()],T=()=>[C.clone(),S.clone()];let M=null;function V(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let H=class extends(O(s)){constructor(e){super(e),this._pendingPromises=new h,this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new x,this._featureStreamVersion=0,this._activeFeatureStream=null,this.actions=new I,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.streamingFeatures=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=o(async()=>{this._cancelLocationUpdate();const e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([c(()=>this.view?.scale,()=>{this.open&&l(this._debouncedLocationUpdate(),a.getLogger(this))}),c(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),c(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),c(()=>this.location,e=>this._locationChange(e)),c(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),c(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),c(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),c(()=>this.featureItems,()=>this._featureItemsChange()),c(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),p(()=>!this.waitingForResult,()=>this._waitingForResultChange(),d),p(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this._pendingPromises.clear(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new I;e.removeAll();const{actions:i,defaultActions:r,defaultPopupTemplateEnabled:s,includeDefaultActions:a,selectedFeature:n}=this,o=a?r.concat(i):i,l=n&&("function"==typeof n.getEffectivePopupTemplate&&n.getEffectivePopupTemplate(s)||n.popupTemplate),u=l?.actions,h=l?.overwriteActions?u:u?.concat(o)??o;return h?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.promises=[],this.featureStream=null,this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new I;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?T():U()),e}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get("featureStream")||null}set featureStream(e){if(this._get("featureStream")===e)return;if(this._set("featureStream",e),this._cancelFeatureStream(),!e)return;this.promises=[];const t=this._featureStreamVersion;this._activeFeatureStream=e,this._queueFeatureStreamFetching(e,t),this._consumeFeatureStream(e,t).catch(()=>{})}get initialDisplayMode(){return this._get("initialDisplayMode")||"feature"}set initialDisplayMode(e){this._set("initialDisplayMode",e),this._syncSelectedFeatureIndex(this.features)}set location(e){const t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?v(e):e;this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){const e=this._get("promises")||[];return e.length>0&&i(a.getLogger(this),"promises",{replacement:"featureStream",warnOnce:!0}),e}set promises(e){Array.isArray(e)&&e.length>0&&i(a.getLogger(this),"promises",{replacement:"featureStream",warnOnce:!0}),this._get("promises")!==e&&(this._cancelFeatureStream(),this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),e=e.slice(),g(this._pendingPromises,e),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get selectedFeature(){return-1===this.selectedFeatureIndex?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.view?this.view.ready?"ready":"disabled":this.map?"ready":"disabled"}get timeZone(){return this.view?.timeZone??E}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return(this.streamingFeatures||this.pendingPromisesCount>0)&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this.set({featureStream:null,promises:[],features:[],content:null,heading:null,location:null,activeFeature:null})}async fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new r("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screen point/screen area and view.",{screenPoint:e,view:i});const s=i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal});this.featureStream=s}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){const{pendingPromisesCount:t,promiseCount:i,selectedFeatureIndex:r}=this,s=i>0&&e.length>0,a=null!=this._activeFeatureStream&&e.length>0,n=s||a;"list"!==this.initialDisplayMode?n&&-1===r?this.selectedFeatureIndex=0:n&&-1!==r||(this.selectedFeatureIndex=e.length?0:-1):(!n||s&&t===i)&&(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=A(this);this._cancelCenterAtLocation();const i=new AbortController,{signal:s}=i;return this._centerAtLocationController=i,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:s}}).catch(e=>{u(e)||a.getLogger(this).error(e)}):Promise.reject(new r("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:r}=this;r&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){"list"!==this.initialDisplayMode&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:r,featureItems:s}=this;if(null==i)return;const a=((i-1)*r+t)%t,n=Math.min(a+r,s.length);for(let o=a;o<n;o++){const t=s[o];t&&(t.graphic??=e[o])}}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;const s=w(e)?.type;if("map-image"!==s&&"imagery"!==s&&"imagery-tile"!==s||(e.symbol=await j(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));return void(this.location=t(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&(this.promises.length>0||this.featureStream)&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,r=this.view,s=this.spatialReference,a=this.map,n=this.timeZone,o=this.location,l=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length)return void this._destroyFeatureItems();const u=[],h=new Map,c=new Set;i.forEach(e=>{const t=e?.graphic;e&&t&&h.set(t,e)}),t.forEach((t,p)=>{if(!t)return;const d=i[p];if(d&&!c.has(d)&&(null==d.graphic||d.graphic===t))return d.abilities=l,u[p]=d,void c.add(d);const g=h.get(t);if(g&&!c.has(g))return g.abilities=l,u[p]=g,void c.add(g);const m=new L({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:s,graphic:t===e?t:null,location:o,map:a,view:r,timeZone:n});u[p]=m,c.add(m)}),i.forEach(e=>{!e||c.has(e)||e.destroyed||e.destroy()}),this._set("featureItems",u)}_cancelCenterAtLocation(){this._centerAtLocationController=n(this._centerAtLocationController)}_cancelFeatureStream(){this._featureStreamVersion++,this._setStreamingFeatures(!1);const e=this._activeFeatureStream;this._activeFeatureStream=null,this._get("featureStream")===e&&this._set("featureStream",null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){const{spatialReference:t}=this,i=this.selectedFeature,r=i?.geometry?.type,s=this.location;if(r&&"mesh"!==r&&t&&s&&i){if("point"===r){const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));if(e?.signal?.aborted||this.selectedFeature!==i||!i.geometry)return;return void(this.location=t(i.geometry))}try{let r=i.geometry;const a=this._getHighlightLayer(i),n=i.getObjectId();if(!a||!this.view)return;if(null!=n){const i=this.view?.allLayerViews.find(e=>e.layer.uid===a.uid);if(!i||!("queryFeatures"in i))return;const s=i.createQuery();s.outSpatialReference=t,s.objectIds=[n],s.returnGeometry=!0;const{features:o}=await i.queryFeatures(s,e);if(e?.signal?.aborted)return;r=o[0]?.geometry}if(!r||"mesh"===r.type)return;r=_(r,t),M??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[{intersectsExecute:o},{proximityGetNearestCoordinate:l}]=M;if(!o(r,s)){const e=l(r,s).coordinate??s;this.selectedFeature===i&&(this.location=e)}}catch(n){u(n)||a.getLogger(this).error(n)}}}_cancelLocationUpdate(){this._locationUpdateController=n(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=w(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(V(t.type,i))return e;const r=e.getObjectId();if(null!=r)return r;const s="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||b:null,a=e.attributes;return a&&s&&a[s]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:r,view:s,open:a}=this;if(!s||!r||!a)return;const n=this._getHighlightLayer(i);if(!n)return;const o=this._getHighlightLayerView(s,n);if(!o)return;this._highlightPromises[e]=o;const l=await o;if(!(l&&R(l)&&this._highlightPromises[e]===o&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,n,s.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}async _consumeFeatureStream(e,t){try{for await(const i of e){if(t!==this._featureStreamVersion)return;this._updateFeatures([i])}}finally{this._activeFeatureStream===e&&(this._activeFeatureStream=null,this._setStreamingFeatures(!1),this._waitingForResultChange())}}_queueFeatureStreamFetching(e,t){queueMicrotask(()=>{this._activeFeatureStream===e&&t===this._featureStreamVersion&&this._setStreamingFeatures(!0)})}_setStreamingFeatures(e){this.streamingFeatures!==e&&this._set("streamingFeatures",e)}_updateFeatures(e){const{features:t}=this,i=new Set(t),r=e.filter(e=>!i.has(e));r?.length&&(this.features=t.concat(r))}};e([m({type:I})],H.prototype,"actions",void 0),e([m({readOnly:!0})],H.prototype,"active",null),e([m()],H.prototype,"activeFeature",void 0),e([m({readOnly:!0})],H.prototype,"allActions",null),e([m()],H.prototype,"aggregatedFeaturesEnabled",void 0),e([m({value:null})],H.prototype,"content",null),e([m({type:I,readOnly:!0})],H.prototype,"defaultActions",null),e([m({type:Boolean})],H.prototype,"defaultPopupTemplateEnabled",void 0),e([m({readOnly:!0})],H.prototype,"effectiveHeading",null),e([m({readOnly:!0})],H.prototype,"featureCount",null),e([m()],H.prototype,"featurePage",void 0),e([m({value:[]})],H.prototype,"features",null),e([m()],H.prototype,"featureStream",null),e([m()],H.prototype,"featuresPerPage",void 0),e([m()],H.prototype,"featureMenuOpen",void 0),e([m({type:x})],H.prototype,"featureItemAbilities",void 0),e([m({readOnly:!0})],H.prototype,"featureItems",void 0),e([m()],H.prototype,"heading",void 0),e([m()],H.prototype,"highlightEnabled",void 0),e([m()],H.prototype,"includeDefaultActions",void 0),e([m({value:"feature"})],H.prototype,"initialDisplayMode",null),e([m({type:y})],H.prototype,"location",null),e([m()],H.prototype,"map",null),e([m()],H.prototype,"open",void 0),e([m({readOnly:!0})],H.prototype,"streamingFeatures",void 0),e([m({readOnly:!0})],H.prototype,"pendingPromisesCount",null),e([m({readOnly:!0})],H.prototype,"promiseCount",null),e([m()],H.prototype,"promises",null),e([m({value:null,readOnly:!0})],H.prototype,"selectedFeature",null),e([m({value:-1})],H.prototype,"selectedFeatureIndex",null),e([m({readOnly:!0})],H.prototype,"selectedFeatureItem",null),e([m({type:F})],H.prototype,"spatialReference",null),e([m({readOnly:!0})],H.prototype,"state",null),e([m()],H.prototype,"timeZone",null),e([m()],H.prototype,"updateLocationEnabled",void 0),e([m()],H.prototype,"view",void 0),e([m({readOnly:!0})],H.prototype,"waitingForContents",null),e([m({readOnly:!0})],H.prototype,"waitingForResult",null),e([m()],H.prototype,"zoomFactor",void 0),H=e([f("esri.popup.FeatureContentCollection")],H);const D=H;export{D 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{pickRandom as t}from"../../../core/arrayUtils.js";import r from"../../../core/Error.js";import a from"../../../core/Logger.js";import{assertIsSome as i}from"../../../core/maybe.js";import{timeout as s,throwIfAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{toQuantizationTransform as m}from"../../../geometry/support/quantizationUtils.js";import{kebabDict as p}from"../../../layers/support/fieldType.js";import{isTimeOnlyField as y}from"../../../layers/support/fieldUtils.js";import f from"../../../rest/support/QuantizationParameters.js";import{getArcadeForPredominantCategory as c}from"../../statistics/support/predominanceUtils.js";import{summaryStatistics as d,uniqueValues as h,histogram as w,classBreaks as g,heatmapStatistics as F}from"../../statistics/support/statsWorker.js";import{mergeWhereClauses as S}from"../../statistics/support/utils.js";import{WorkerClient as q}from"../../statistics/support/WorkerClient.js";import{getFieldsList as v,isAnyDateField as x,getFieldsFromWhereClauses as V,fieldDelimiter as _}from"../utils.js";import z from"./LayerAdapter.js";import{getHistogramAttributeDefinition as T,getAttributeBinsQuery as N,processQueryAttributeBinsResult as M}from"./support/histogramUtils.js";import{ensureFeaturesJSON as L,getSummaryStatsQuery as E,getSummaryStatisticsFromFeatureSet as C,getViewInfoParams as j,getMissingFields as b,updateQueryWithFeatureFilter as I,getUVQuery as k,getUniqueValuesFromFeatureSet as O,getBins as Q,getDomainsForFields as J,getPredominantCategoriesFromUVInfos as B}from"./support/utils.js";import{processSummaryStatisticsResult as P,createUVResult as U,resolveCBResult as A}from"../../../statistics/utils.js";import{loadArcade as $}from"../../../support/loadArcade.js";const G=5;let R,D=class extends z{constructor(){super(...arguments),this._hasLocalSource=!1,this.adapterName="in-memory-layer-adapter"}destroy(){this.workerClient?.destroy()}async _waitForLayerViewUpdate(e){if(!e)throw new r(`${this.adapterName}:insufficient-data`,"layerView is required to fetch the features");const t=new AbortController,i=n(()=>!e.updating,t.signal);await s(i,5e3,t).catch(e=>{throw a.getLogger(this).warn("LayerView is taking too long to update. Aborting fetch from layerView."),e})}async _fetchFeatureSetFromMemory(e,t,a){const i=this.layer;if(this._hasLocalSource&&"queryFeatures"in i)return i.queryFeatures(e);if(!t)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=await t.whenLayerView(this.layer);return await this._waitForLayerViewUpdate(s),s.queryFeatures(e,{signal:a})}async _fetchFeaturesFromMemory(e,t,a,i){const s=this.layer,o="json"===i;if(this._hasLocalSource&&"queryFeatures"in s){const e=await s.queryFeatures(t);return o?L(e.features):e.features}if(await this._waitForLayerViewUpdate(e),o&&"queryFeaturesJSON"in e&&e.queryFeaturesJSON){const{features:r}=await e.queryFeaturesJSON(t,{signal:a});return r}if(!("queryFeatures"in e))throw new r(`${this.adapterName}:not-supported`,"'queryFeatures' is not supported on the layerView");const n=await e.queryFeatures(t,{signal:a});return o?L(n.features):n.features}_fetchFeaturesForStats(e,t){return v({field:e.field,field2:e.field2,field3:e.field3,normalizationField:e.normalizationField,valueExpression:e.valueExpression,fields:e.fields}).then(r=>this.getSampleFeatures({sampleSize:-1,view:e.view,returnGeometry:e.returnGeometry,filter:e.filter,requiredFields:r,sqlWhere:e.sqlWhere,signal:e.signal},t))}async _summaryStatsFromClientQuery(e,t){const{view:r,signal:a}=e,i=E(this,e,t),s=await this._fetchFeatureSetFromMemory(i,r,a),o=C(s,x(t)||y(t));return P(o,e.outStatisticTypes)}async _getNormalizationTotalFromMemory(e,t,a){const{featuresJSON:i,graphics:s,layerView:o,query:n}=t,l={include:["sum"]},u=(!i&&!s&&o&&"querySummaryStatistics"in o?await o.querySummaryStatistics(n,{field:e},{signal:a}):i?await this.workerClient.summaryStatistics({field:e,outStatisticTypes:l},i):await d({attribute:{field:e,outStatisticTypes:l},features:s??[]})).sum;if(null==u)throw new r(`${this.adapterName}:invalid`,"invalid normalizationTotal");return u}async _summaryStatsFromMemory(e,t){const{view:r,field:a,valueExpression:i,normalizationType:s,signal:o}=e,n={field:a,valueExpression:i,normalizationType:s,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,outStatisticTypes:e.outStatisticTypes},{featuresJSON:l,graphics:u,layerView:m,query:y,fieldInfos:f}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"querySummaryStatistics"});return i&&r&&(l||u)&&(n.fieldType=t?.type?p.toJSON(t.type):null,n.viewInfoParams=j(r),n.timeZone=r.timeZone,n.fieldInfos=f),"percent-of-total"===s&&null==e.normalizationTotal&&(n.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:l,graphics:u,layerView:m,query:y},o)),!l&&!u&&m&&"querySummaryStatistics"in m?m.querySummaryStatistics(y,n,{signal:o}):l?this.workerClient.summaryStatistics(n,l):d({attribute:n,features:u})}async _getFilteredFeatures(e,t){let r=e;const a=t?.geometry;if("intersects"===t?.spatialRelationship&&a){const t=await(import("../../../geometry/operators/intersectionOperator.js"));r=e.filter(({geometry:e})=>!(!e||!t.execute(e,a)))}return e.length&&"declaredClass"in e[0]&&"esri.Graphic"===e[0].declaredClass?{graphics:r}:{featuresJSON:r}}async _processStatsFromMemoryParams(e){const{features:t,filter:r}=e;if(t?.length)return this._getFilteredFeatures(t,r);const{view:a,field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,sqlExpression:u,sqlWhere:m,layerViewFunc:p,signal:y}=e;let f=e.returnGeometry;if(null==f&&l){if(!R){const{arcadeUtils:e}=await $();R=e}const e=R.hasGeometryOperations(l);e&&await R.enableGeometryOperations(),f=e}let c=null,d=null,h=null,w=null,g=null;if(a)try{const e="subtype-sublayer"===this.layer.type?this.layer.parent:this.layer;c=await a.whenLayerView(e),d=null!=p&&null!=c&&p in c&&"function"==typeof c[p]}catch{d=!1}if(d)try{await this._waitForLayerViewUpdate(c);const e=await v({field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,fields:await V([u,m],this.layer.fieldsIndex)});b(this,e,c).length?d=!1:(h=this.layer.createQuery(),h.outFields=e,h.returnGeometry=!1,h.where=S(h.where,m),I(h,r)),c.suspended&&(d=!1)}catch{d=!1}return d||(w=await this._fetchFeaturesForStats({field:i,field2:s,field3:o,fields:await V([u,m],this.layer.fieldsIndex),valueExpression:l,normalizationField:n,returnGeometry:f,filter:r,sqlWhere:m,view:a,signal:y},"json"),g=(await v({valueExpression:l})).map(e=>this.getField(e)?.toJSON()).filter(Boolean)),{layerView:c,query:h,featuresJSON:w,fieldInfos:g}}async _uvFromClientQuery(e,t){const{view:r,signal:a}=e,i=k(this,e),s=await this._fetchFeatureSetFromMemory(i,r,a),o=await O(s,{layer:this,field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:_,view:e.view,signal:e.signal});return U(o,t,e.returnAllCodedValues,_)}async _uvFromMemory(e,t){const{view:r,field:a,valueExpression:i,returnAllCodedValues:s,signal:o}=e,{featuresJSON:n,graphics:l,layerView:u,query:m,fieldInfos:p}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryUniqueValues"}),y={field:a,field2:e.field2,field3:e.field3,fieldDelimiter:_,valueExpression:i,domains:t,returnAllCodedValues:s};return i&&r&&(n||l)&&(y.viewInfoParams=j(r),y.timeZone=r.timeZone,y.fieldInfos=p),!n&&!l&&u&&"queryUniqueValues"in u?u.queryUniqueValues(m,y,{signal:o}):n?this.workerClient.uniqueValues(y,n):h({attribute:y,features:l})}_histogramForField(e){let t=null;return t=null!=e.minValue&&null!=e.maxValue?Promise.resolve({min:e.minValue,max:e.maxValue}):this.summaryStatistics({...e,outStatisticTypes:{include:["min","max","count"]}}).then(e=>{if(!e.count)throw new r(`${this.adapterName}:insufficient-data`,"Either the layer has no features or none of the features have data for the field");return{min:e.min,max:e.max}}),t.then(t=>Q(this,{min:t.min,max:t.max},e.field,e.numBins??void 0,e.view,e.filter,e.signal))}async _histogramFromQueryAttributeBinsFromMemory(e){const{field:t,normalizationType:r,signal:a}=e,i=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAttributeBins"}),{featuresJSON:s,graphics:o,layerView:n,query:l}=i,u="percent-of-total"===r?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,i,a):void 0;if(!n||!("queryAttributeBins"in n)||s||o){const t=T(e,i,u);return s?this.workerClient.histogram(t,s):w({attribute:t,features:o})}const{query:m,min:p,max:y}=await N(e,this,u,l);if(!m)return{bins:[],minValue:p,maxValue:y,normalizationTotal:u};const f=await n.queryAttributeBins(m,{signal:a});return M(f,t?this.getField(t):null,{minValue:p,maxValue:y,normalizationTotal:u})}async _histogramFromMemory(e){const{field:t,signal:r}=e,a=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryHistogram"}),{featuresJSON:i,graphics:s,layerView:o,query:n}=a,l="percent-of-total"===e.normalizationType?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,a,r):void 0,u=T(e,a,l);return!i&&!s&&o&&"queryHistogram"in o?o.queryHistogram(n,u,{signal:r}):i?this.workerClient.histogram(u,i):w({attribute:u,features:s})}_classBreaksFromInterpolation(e){const{minValue:t,maxValue:r}=e,a=e.numClasses||G,i=[],s=(r-t)/a;for(let l=0;l<a;l++){const e=t+l*s;i.push({minValue:e,maxValue:e+s})}i[a-1].maxValue=r;const o={classBreaks:i,normalizationTotal:e.normalizationTotal},n=A(o,e.classificationMethod);return Promise.resolve(n)}async _classBreaksFromMemory(e){const{view:t,field:r,valueExpression:a,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryClassBreaks"}),m={field:r,valueExpression:a,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numClasses:e.numClasses};return a&&t&&(s||o)&&(m.viewInfoParams=j(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryClassBreaks"in n?n.queryClassBreaks(l,m,{signal:i}):s?this.workerClient.classBreaks(m,s):g({attribute:m,features:o})}async _heatmapStatsFromMemory(e){const{view:t,field:r,radius:a,signal:s}=e;i(t,"InMemoryLayerAdapter: must have a view");try{const r=await t.whenLayerView(this.layer);if("queryHeatmapStatistics"in r&&!r.updating&&!e.filter)return await r.queryHeatmapStatistics({field:e.field,radius:e.radius})}catch{o(s)}const{featuresJSON:n,graphics:l}=await this._processStatsFromMemoryParams({...e,returnGeometry:!0}),u=new f({extent:t.extent,tolerance:"2d"===t.type?t.state.resolution:t.pixelSizeAt?.(t.center)}),p={field:r,radius:a,transform:m(u),spatialReference:t.spatialReference?.toJSON(),size:t.size};return n?.length||l?.length?n?this.workerClient.heatmapStatistics(p,n):F({attribute:p,features:l}):{min:null,max:null}}getField(e=""){return this.layer.getField(e)}getFieldUsageInfo(e){return this.getField(e)?{supportsLabelingInfo:!0,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:!0,supportsStatistics:!0}:null}getFieldDomain(e,t){return this.layer.getFieldDomain(e,t)}createQuery(){return this.layer.createQuery()}async summaryStatistics(e){const{field:t,valueExpression:a,sqlExpression:i,features:s,view:o}=e,n=t?this.getField(t):null,l=!!a,u="3d"===o?.type;if(!a&&i&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return l||s||u?this._summaryStatsFromMemory(e,n):this._summaryStatsFromClientQuery(e,n)}async uniqueValues(e){const{valueExpression:t,sqlExpression:a,features:i,view:s}=e,o=await J(e,this),n=!!t,l="3d"===s?.type;if(!t&&a&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return n||i||l?this._uvFromMemory(e,o):this._uvFromClientQuery(e,o)}async histogram(e){const{features:t,valueExpression:a,normalizationType:i,sqlExpression:s}=e,o=t||!!a;if(!a&&s&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return o||i?this._histogramFromMemory(e):this._histogramForField(e)}async classBreaks(e){return!1!==e.analyzeData?this._classBreaksFromMemory(e):this._classBreaksFromInterpolation(e)}async queryFeatureCount(e){const{whereClause:t,view:a,signal:i}=e;if(!a)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=this.layer.createQuery();s.where=S(s.where,t);const o=await a.whenLayerView(this.layer);return await n(()=>!o.updating,i),o.queryFeatureCount(s,{signal:i})}async generateRenderer(e,t){throw new r(`${this.adapterName}:not-supported`,"Layer does not support generateRenderer operation")}async predominantCategories(e){const{fields:t,view:r,signal:a,filter:i}=e,s=c(t),o=await this._uvFromMemory({valueExpression:s,view:r,signal:a,filter:i});return B(o.uniqueValueInfos,t)}async heatmapStatistics(e){return this._heatmapStatsFromMemory(e)}async getSampleFeatures(e,a){const{view:i,sampleSize:s,requiredFields:o,returnGeometry:n,sqlWhere:l,filter:u,signal:m}=e,p=this.layer.createQuery(),y=1;if(p.outSpatialReference=i?.spatialReference,p.returnGeometry=!!n,p.outFields=o,p.where=S(p.where,l),I(p,u),!i)throw new r(`${this.adapterName}:not-supported`,"view is required to get sample features for Layer");const f=await i.whenLayerView(this.layer);if(b(this,o,f).length)throw new r(`${this.adapterName}:not-supported`,"Required fields need to be passed in the outFields for Layer");const c=await this._fetchFeaturesFromMemory(f,p,m,a),d=null!=s&&s>0&&s<=c.length?s:c.length;return t(c,d,y)}load(e){const t=this.layer.load(e).then(async t=>{this.geometryType=t.geometryType,this.objectIdField=t.objectIdField,this.supportsSQLExpression="stream"===t.type||!!t.capabilities?.query?.supportsSqlExpression,this.minScale=t.minScale,this.maxScale=t.maxScale,this.fullExtent="fullExtent"in t?t.fullExtent:t.parent?.fullExtent,this._hasLocalSource=!1,this.hasQueryEngine=!0,this.workerClient=q.getInstance(),await this.workerClient.open(e.signal)});return this.addResolvingPromise(t),Promise.resolve(this)}};e([l({readOnly:!0})],D.prototype,"adapterName",void 0),e([l({constructOnly:!0})],D.prototype,"layer",void 0),D=e([u("esri.smartMapping.support.adapters.InMemoryLayerAdapter")],D);export{D as default};
2
+ import{__decorate as e}from"tslib";import{pickRandom as t}from"../../../core/arrayUtils.js";import r from"../../../core/Error.js";import a from"../../../core/Logger.js";import{assertIsSome as i}from"../../../core/maybe.js";import{timeout as s,throwIfAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{toQuantizationTransform as m}from"../../../geometry/support/quantizationUtils.js";import{kebabDict as p}from"../../../layers/support/fieldType.js";import{isTimeOnlyField as y}from"../../../layers/support/fieldUtils.js";import c from"../../../rest/support/QuantizationParameters.js";import{getArcadeForPredominantCategory as f}from"../../statistics/support/predominanceUtils.js";import{summaryStatistics as d,uniqueValues as h,histogram as w,classBreaks as g,heatmapStatistics as F}from"../../statistics/support/statsWorker.js";import{mergeWhereClauses as S}from"../../statistics/support/utils.js";import{WorkerClient as q}from"../../statistics/support/WorkerClient.js";import{getFieldsList as v,isAnyDateField as x,getFieldsFromWhereClauses as V,fieldDelimiter as _}from"../utils.js";import z from"./LayerAdapter.js";import{getHistogramAttributeDefinition as T,getAttributeBinsQuery as N,processQueryAttributeBinsResult as M}from"./support/histogramUtils.js";import{ensureFeaturesJSON as L,getSummaryStatsQuery as E,getSummaryStatisticsFromFeatureSet as C,getViewInfoParams as j,getMissingFields as b,updateQueryWithFeatureFilter as I,getUVQuery as k,getUniqueValuesFromFeatureSet as O,getBins as Q,getDomainsForFields as J,getPredominantCategoriesFromUVInfos as B}from"./support/utils.js";import{processSummaryStatisticsResult as P,createUVResult as U,resolveCBResult as A}from"../../../statistics/utils.js";import{loadArcade as $}from"../../../support/loadArcade.js";const G=5;let R,D=class extends z{constructor(){super(...arguments),this._hasLocalSource=!1,this.adapterName="in-memory-layer-adapter"}destroy(){this.workerClient?.destroy()}async _waitForLayerViewUpdate(e){if(!e)throw new r(`${this.adapterName}:insufficient-data`,"layerView is required to fetch the features");const t=new AbortController,i=n(()=>!e.updating,t.signal);await s(i,5e3,t).catch(e=>{throw a.getLogger(this).warn("LayerView is taking too long to update. Aborting fetch from layerView."),e})}async _fetchFeatureSetFromMemory(e,t,a){const i=this.layer;if(this._hasLocalSource&&"queryFeatures"in i)return i.queryFeatures(e);if(!t)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=await t.whenLayerView(this.layer);return await this._waitForLayerViewUpdate(s),s.queryFeatures(e,{signal:a})}async _fetchFeaturesFromMemory(e,t,a,i){const s=this.layer,o="json"===i;if(this._hasLocalSource&&"queryFeatures"in s){const e=await s.queryFeatures(t);return o?L(e.features):e.features}if(await this._waitForLayerViewUpdate(e),o&&"queryFeaturesJSON"in e&&e.queryFeaturesJSON){const{features:r}=await e.queryFeaturesJSON(t,{signal:a});return r}if(!("queryFeatures"in e))throw new r(`${this.adapterName}:not-supported`,"'queryFeatures' is not supported on the layerView");const n=await e.queryFeatures(t,{signal:a});return o?L(n.features):n.features}_fetchFeaturesForStats(e,t){return v({field:e.field,field2:e.field2,field3:e.field3,normalizationField:e.normalizationField,valueExpression:e.valueExpression,fields:e.fields}).then(r=>this.getSampleFeatures({sampleSize:-1,view:e.view,returnGeometry:e.returnGeometry,filter:e.filter,requiredFields:r,sqlWhere:e.sqlWhere,signal:e.signal},t))}async _summaryStatsFromClientQuery(e,t){const{view:r,signal:a}=e,i=E(this,e,t),s=await this._fetchFeatureSetFromMemory(i,r,a),o=C(s,x(t)||y(t));return P(o,e.outStatisticTypes)}async _getNormalizationTotalFromMemory(e,t,a){const{featuresJSON:i,graphics:s,layerView:o,query:n}=t,l={include:["sum"]},u=(!i&&!s&&o&&"querySummaryStatistics"in o?await o.querySummaryStatistics(n,{field:e},{signal:a}):i?await this.workerClient.summaryStatistics({field:e,outStatisticTypes:l},i):await d({attribute:{field:e,outStatisticTypes:l},features:s??[]})).sum;if(null==u)throw new r(`${this.adapterName}:invalid`,"invalid normalizationTotal");return u}async _summaryStatsFromMemory(e,t){const{view:r,field:a,valueExpression:i,normalizationType:s,signal:o}=e,n={field:a,valueExpression:i,normalizationType:s,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,outStatisticTypes:e.outStatisticTypes},{featuresJSON:l,graphics:u,layerView:m,query:y,fieldInfos:c}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"querySummaryStatistics"});return i&&r&&(l||u)&&(n.fieldType=t?.type?p.toJSON(t.type):null,n.viewInfoParams=j(r),n.timeZone=r.timeZone,n.fieldInfos=c),"percent-of-total"===s&&null==e.normalizationTotal&&(n.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:l,graphics:u,layerView:m,query:y},o)),!l&&!u&&m&&"querySummaryStatistics"in m?m.querySummaryStatistics(y,n,{signal:o}):l?this.workerClient.summaryStatistics(n,l):d({attribute:n,features:u})}async _getFilteredFeatures(e,t){let r=e;const a=t?.geometry;if("intersects"===t?.spatialRelationship&&a){const{intersectionExecute:t}=await(import("../../../geometry/operators/intersectionOperator.js"));r=e.filter(({geometry:e})=>!(!e||!t(e,a)))}return e.length&&"declaredClass"in e[0]&&"esri.Graphic"===e[0].declaredClass?{graphics:r}:{featuresJSON:r}}async _processStatsFromMemoryParams(e){const{features:t,filter:r}=e;if(t?.length)return this._getFilteredFeatures(t,r);const{view:a,field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,sqlExpression:u,sqlWhere:m,layerViewFunc:p,signal:y}=e;let c=e.returnGeometry;if(null==c&&l){if(!R){const{arcadeUtils:e}=await $();R=e}const e=R.hasGeometryOperations(l);e&&await R.enableGeometryOperations(),c=e}let f=null,d=null,h=null,w=null,g=null;if(a)try{const e="subtype-sublayer"===this.layer.type?this.layer.parent:this.layer;f=await a.whenLayerView(e),d=null!=p&&null!=f&&p in f&&"function"==typeof f[p]}catch{d=!1}if(d)try{await this._waitForLayerViewUpdate(f);const e=await v({field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,fields:await V([u,m],this.layer.fieldsIndex)});b(this,e,f).length?d=!1:(h=this.layer.createQuery(),h.outFields=e,h.returnGeometry=!1,h.where=S(h.where,m),I(h,r)),f.suspended&&(d=!1)}catch{d=!1}return d||(w=await this._fetchFeaturesForStats({field:i,field2:s,field3:o,fields:await V([u,m],this.layer.fieldsIndex),valueExpression:l,normalizationField:n,returnGeometry:c,filter:r,sqlWhere:m,view:a,signal:y},"json"),g=(await v({valueExpression:l})).map(e=>this.getField(e)?.toJSON()).filter(Boolean)),{layerView:f,query:h,featuresJSON:w,fieldInfos:g}}async _uvFromClientQuery(e,t){const{view:r,signal:a}=e,i=k(this,e),s=await this._fetchFeatureSetFromMemory(i,r,a),o=await O(s,{layer:this,field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:_,view:e.view,signal:e.signal});return U(o,t,e.returnAllCodedValues,_)}async _uvFromMemory(e,t){const{view:r,field:a,valueExpression:i,returnAllCodedValues:s,signal:o}=e,{featuresJSON:n,graphics:l,layerView:u,query:m,fieldInfos:p}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryUniqueValues"}),y={field:a,field2:e.field2,field3:e.field3,fieldDelimiter:_,valueExpression:i,domains:t,returnAllCodedValues:s};return i&&r&&(n||l)&&(y.viewInfoParams=j(r),y.timeZone=r.timeZone,y.fieldInfos=p),!n&&!l&&u&&"queryUniqueValues"in u?u.queryUniqueValues(m,y,{signal:o}):n?this.workerClient.uniqueValues(y,n):h({attribute:y,features:l})}_histogramForField(e){let t=null;return t=null!=e.minValue&&null!=e.maxValue?Promise.resolve({min:e.minValue,max:e.maxValue}):this.summaryStatistics({...e,outStatisticTypes:{include:["min","max","count"]}}).then(e=>{if(!e.count)throw new r(`${this.adapterName}:insufficient-data`,"Either the layer has no features or none of the features have data for the field");return{min:e.min,max:e.max}}),t.then(t=>Q(this,{min:t.min,max:t.max},e.field,e.numBins??void 0,e.view,e.filter,e.signal))}async _histogramFromQueryAttributeBinsFromMemory(e){const{field:t,normalizationType:r,signal:a}=e,i=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAttributeBins"}),{featuresJSON:s,graphics:o,layerView:n,query:l}=i,u="percent-of-total"===r?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,i,a):void 0;if(!n||!("queryAttributeBins"in n)||s||o){const t=T(e,i,u);return s?this.workerClient.histogram(t,s):w({attribute:t,features:o})}const{query:m,min:p,max:y}=await N(e,this,u,l);if(!m)return{bins:[],minValue:p,maxValue:y,normalizationTotal:u};const c=await n.queryAttributeBins(m,{signal:a});return M(c,t?this.getField(t):null,{minValue:p,maxValue:y,normalizationTotal:u})}async _histogramFromMemory(e){const{field:t,signal:r}=e,a=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryHistogram"}),{featuresJSON:i,graphics:s,layerView:o,query:n}=a,l="percent-of-total"===e.normalizationType?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,a,r):void 0,u=T(e,a,l);return!i&&!s&&o&&"queryHistogram"in o?o.queryHistogram(n,u,{signal:r}):i?this.workerClient.histogram(u,i):w({attribute:u,features:s})}_classBreaksFromInterpolation(e){const{minValue:t,maxValue:r}=e,a=e.numClasses||G,i=[],s=(r-t)/a;for(let l=0;l<a;l++){const e=t+l*s;i.push({minValue:e,maxValue:e+s})}i[a-1].maxValue=r;const o={classBreaks:i,normalizationTotal:e.normalizationTotal},n=A(o,e.classificationMethod);return Promise.resolve(n)}async _classBreaksFromMemory(e){const{view:t,field:r,valueExpression:a,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryClassBreaks"}),m={field:r,valueExpression:a,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numClasses:e.numClasses};return a&&t&&(s||o)&&(m.viewInfoParams=j(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryClassBreaks"in n?n.queryClassBreaks(l,m,{signal:i}):s?this.workerClient.classBreaks(m,s):g({attribute:m,features:o})}async _heatmapStatsFromMemory(e){const{view:t,field:r,radius:a,signal:s}=e;i(t,"InMemoryLayerAdapter: must have a view");try{const r=await t.whenLayerView(this.layer);if("queryHeatmapStatistics"in r&&!r.updating&&!e.filter)return await r.queryHeatmapStatistics({field:e.field,radius:e.radius})}catch{o(s)}const{featuresJSON:n,graphics:l}=await this._processStatsFromMemoryParams({...e,returnGeometry:!0}),u=new c({extent:t.extent,tolerance:"2d"===t.type?t.state.resolution:t.pixelSizeAt?.(t.center)}),p={field:r,radius:a,transform:m(u),spatialReference:t.spatialReference?.toJSON(),size:t.size};return n?.length||l?.length?n?this.workerClient.heatmapStatistics(p,n):F({attribute:p,features:l}):{min:null,max:null}}getField(e=""){return this.layer.getField(e)}getFieldUsageInfo(e){return this.getField(e)?{supportsLabelingInfo:!0,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:!0,supportsStatistics:!0}:null}getFieldDomain(e,t){return this.layer.getFieldDomain(e,t)}createQuery(){return this.layer.createQuery()}async summaryStatistics(e){const{field:t,valueExpression:a,sqlExpression:i,features:s,view:o}=e,n=t?this.getField(t):null,l=!!a,u="3d"===o?.type;if(!a&&i&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return l||s||u?this._summaryStatsFromMemory(e,n):this._summaryStatsFromClientQuery(e,n)}async uniqueValues(e){const{valueExpression:t,sqlExpression:a,features:i,view:s}=e,o=await J(e,this),n=!!t,l="3d"===s?.type;if(!t&&a&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return n||i||l?this._uvFromMemory(e,o):this._uvFromClientQuery(e,o)}async histogram(e){const{features:t,valueExpression:a,normalizationType:i,sqlExpression:s}=e,o=t||!!a;if(!a&&s&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return o||i?this._histogramFromMemory(e):this._histogramForField(e)}async classBreaks(e){return!1!==e.analyzeData?this._classBreaksFromMemory(e):this._classBreaksFromInterpolation(e)}async queryFeatureCount(e){const{whereClause:t,view:a,signal:i}=e;if(!a)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=this.layer.createQuery();s.where=S(s.where,t);const o=await a.whenLayerView(this.layer);return await n(()=>!o.updating,i),o.queryFeatureCount(s,{signal:i})}async generateRenderer(e,t){throw new r(`${this.adapterName}:not-supported`,"Layer does not support generateRenderer operation")}async predominantCategories(e){const{fields:t,view:r,signal:a,filter:i}=e,s=f(t),o=await this._uvFromMemory({valueExpression:s,view:r,signal:a,filter:i});return B(o.uniqueValueInfos,t)}async heatmapStatistics(e){return this._heatmapStatsFromMemory(e)}async getSampleFeatures(e,a){const{view:i,sampleSize:s,requiredFields:o,returnGeometry:n,sqlWhere:l,filter:u,signal:m}=e,p=this.layer.createQuery(),y=1;if(p.outSpatialReference=i?.spatialReference,p.returnGeometry=!!n,p.outFields=o,p.where=S(p.where,l),I(p,u),!i)throw new r(`${this.adapterName}:not-supported`,"view is required to get sample features for Layer");const c=await i.whenLayerView(this.layer);if(b(this,o,c).length)throw new r(`${this.adapterName}:not-supported`,"Required fields need to be passed in the outFields for Layer");const f=await this._fetchFeaturesFromMemory(c,p,m,a),d=null!=s&&s>0&&s<=f.length?s:f.length;return t(f,d,y)}load(e){const t=this.layer.load(e).then(async t=>{this.geometryType=t.geometryType,this.objectIdField=t.objectIdField,this.supportsSQLExpression="stream"===t.type||!!t.capabilities?.query?.supportsSqlExpression,this.minScale=t.minScale,this.maxScale=t.maxScale,this.fullExtent="fullExtent"in t?t.fullExtent:t.parent?.fullExtent,this._hasLocalSource=!1,this.hasQueryEngine=!0,this.workerClient=q.getInstance(),await this.workerClient.open(e.signal)});return this.addResolvingPromise(t),Promise.resolve(this)}};e([l({readOnly:!0})],D.prototype,"adapterName",void 0),e([l({constructOnly:!0})],D.prototype,"layer",void 0),D=e([u("esri.smartMapping.support.adapters.InMemoryLayerAdapter")],D);export{D as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const e="20260902",c="c36997bd6a7ed9d9fc3e7108721d1b7c392e0e26";export{e as buildDate,c as revision};
2
+ const o="",t="";export{o as buildDate,t as revision};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{parseWhereClause as e}from"../../core/sql.js";import{load as r,project as t}from"../../geometry/projectionUtils.js";import o from"../../geometry/SpatialReference.js";import{execute as s}from"../../geometry/operators/containsOperator.js";import{execute as n}from"../../geometry/operators/crossesOperator.js";import{execute as m}from"../../geometry/operators/generalizeOperator.js";import{execute as a,accelerateGeometry as i}from"../../geometry/operators/intersectsOperator.js";import{execute as p}from"../../geometry/operators/overlapsOperator.js";import{execute as c}from"../../geometry/operators/touchesOperator.js";import{execute as u}from"../../geometry/operators/withinOperator.js";import{getGeometryExtent as y}from"../../geometry/support/extentUtils.js";import{fromJSON as f}from"../../geometry/support/jsonUtils.js";import{quantizeGeometry as g}from"../../geometry/support/quantizationUtils.js";import{isGeographic as j,equals as G}from"../../geometry/support/spatialReferenceUtils.js";import{densifyCurvedGeometry as l}from"../../geometry/support/curves/densifyCurvedGeometry.js";import x from"../../layers/support/FieldsIndex.js";function O(){const O=new WeakMap,d=new WeakMap;function v(e,r){const t=O.get(e);if(t)return t;const s=f(e);return s.spatialReference=r instanceof o?r:o.fromJSON(r),O.set(e,s),i(s),s}function b(e,r,t){return!e||G(r,t)?e:w(e,r,t)?.toJSON()}function w(e,r,s){if(!e)return;const n=d.get(e);if(n&&G(n.spatialReference,s))return n.geometry;const m=!G(r,s),a=m?t(v(e,r),o.fromJSON(s),{zConversionDisabled:!0}):v(e,r);return m&&i(a),d.set(e,{spatialReference:s,geometry:a}),a}function F(e,r,t,o){return{aGeometry:v(e,r),bGeometry:w(t,o,r)}}return{sql:{async createTestFeature(r,t){const o=await e(r,new x(t));return e=>o.testFeature(e)}},projection:{load:r,project:b},geometry:{isGeographic:j,quantize:(e,r)=>g(e,r),operations:{intersects(e,r,t,o){const{aGeometry:s,bGeometry:n}=F(e,r,t,o);return a(s,n)},contains(e,r,t,o){const{aGeometry:n,bGeometry:m}=F(e,r,t,o);return s(n,m)},overlaps(e,r,t,o){const{aGeometry:s,bGeometry:n}=F(e,r,t,o);return p(s,n)},crosses(e,r,t,o){const{aGeometry:s,bGeometry:m}=F(e,r,t,o);return n(s,m)},touches(e,r,t,o){const{aGeometry:s,bGeometry:n}=F(e,r,t,o);return c(s,n)},within(e,r,t,o){const{aGeometry:s,bGeometry:n}=F(e,r,t,o);return u(s,n)},generalize(e,r,t,o){const s=m(v(e,r),t,{removeDegenerateParts:o});return s?.toJSON()},densifyCurves:e=>l(e)},extentFromGeometry:e=>y(e),extentFromGLB:async(e,r,t,o)=>{const{extentFromGLB:s}=await(import("./setupServiceMocksMesh.js"));return s(e,r,t,o)},nodeDataFromGLB:async(e,r,t,o)=>{const{nodeDataFromGLB:s}=await(import("./setupServiceMocksMesh.js"));return s(e,r,t,o)}}}}export{O as getServiceMockDependencies};
2
+ import{parseWhereClause as e}from"../../core/sql.js";import{load as r,project as t}from"../../geometry/projectionUtils.js";import o from"../../geometry/SpatialReference.js";import{containsExecute as s}from"../../geometry/operators/containsOperator.js";import{crossesExecute as n}from"../../geometry/operators/crossesOperator.js";import{generalizeExecute as m}from"../../geometry/operators/generalizeOperator.js";import{intersectsExecute as a,intersectsAccelerateGeometry as i}from"../../geometry/operators/intersectsOperator.js";import{overlapsExecute as p}from"../../geometry/operators/overlapsOperator.js";import{touchesExecute as c}from"../../geometry/operators/touchesOperator.js";import{withinExecute as u}from"../../geometry/operators/withinOperator.js";import{getGeometryExtent as y}from"../../geometry/support/extentUtils.js";import{fromJSON as f}from"../../geometry/support/jsonUtils.js";import{quantizeGeometry as g}from"../../geometry/support/quantizationUtils.js";import{isGeographic as j,equals as G}from"../../geometry/support/spatialReferenceUtils.js";import{densifyCurvedGeometry as l}from"../../geometry/support/curves/densifyCurvedGeometry.js";import O from"../../layers/support/FieldsIndex.js";function d(){const d=new WeakMap,v=new WeakMap;function b(e,r){const t=d.get(e);if(t)return t;const s=f(e);return s.spatialReference=r instanceof o?r:o.fromJSON(r),d.set(e,s),i(s),s}function w(e,r,t){return!e||G(r,t)?e:F(e,r,t)?.toJSON()}function F(e,r,s){if(!e)return;const n=v.get(e);if(n&&G(n.spatialReference,s))return n.geometry;const m=!G(r,s),a=m?t(b(e,r),o.fromJSON(s),{zConversionDisabled:!0}):b(e,r);return m&&i(a),v.set(e,{spatialReference:s,geometry:a}),a}function h(e,r,t,o){return{aGeometry:b(e,r),bGeometry:F(t,o,r)}}return{sql:{async createTestFeature(r,t){const o=await e(r,new O(t));return e=>o.testFeature(e)}},projection:{load:r,project:w},geometry:{isGeographic:j,quantize:(e,r)=>g(e,r),operations:{intersects(e,r,t,o){const{aGeometry:s,bGeometry:n}=h(e,r,t,o);return a(s,n)},contains(e,r,t,o){const{aGeometry:n,bGeometry:m}=h(e,r,t,o);return s(n,m)},overlaps(e,r,t,o){const{aGeometry:s,bGeometry:n}=h(e,r,t,o);return p(s,n)},crosses(e,r,t,o){const{aGeometry:s,bGeometry:m}=h(e,r,t,o);return n(s,m)},touches(e,r,t,o){const{aGeometry:s,bGeometry:n}=h(e,r,t,o);return c(s,n)},within(e,r,t,o){const{aGeometry:s,bGeometry:n}=h(e,r,t,o);return u(s,n)},generalize(e,r,t,o){const s=m(b(e,r),t,{removeDegenerateParts:o});return s?.toJSON()},densifyCurves:e=>l(e)},extentFromGeometry:e=>y(e),extentFromGLB:async(e,r,t,o)=>{const{extentFromGLB:s}=await(import("./setupServiceMocksMesh.js"));return s(e,r,t,o)},nodeDataFromGLB:async(e,r,t,o)=>{const{nodeDataFromGLB:s}=await(import("./setupServiceMocksMesh.js"));return s(e,r,t,o)}}}}export{d as getServiceMockDependencies};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../geometry/Point.js";import e from"../../geometry/support/MeshMaterialMetallicRoughness.js";import o from"../../geometry/support/MeshTransform.js";import{createFromGLTF as r}from"../../geometry/support/meshUtils.js";import{loadImage as a}from"../../request/loadImage.js";import{meshMakeAbsolute as n}from"./meshUtils.js";import{isEncodedMeshTexture as i}from"../../views/3d/glTF/internal/resourceUtils.js";async function s(e,a,n,i){const s=URL.createObjectURL(new Blob([e]));try{const e=t.fromJSON(a),n=await r(e,s,{vertexSpace:e.spatialReference.isGeographic?"local":"georeferenced"}),{rotationAxis:l,rotationAngle:c,translation:u,scale:m}=i;return n.transform=new o({rotationAngle:c??0,rotationAxis:null!=l?[l[0],l[1],l[2]]:[0,0,1],translation:null!=u?[u[0],u[1],u[2]]:[0,0,0],scale:null!=m?[m[0],m[1],m[2]]:[1,1,1]}),n}finally{URL.revokeObjectURL(s)}}async function l(t,e,o,r){const a=await s(t,e,o,r),n=a.extent.toJSON();return a.destroy(),n}async function c(t,o,r,a){const i=await s(t,o,r,a),{components:l}=i;if(null==l)throw new Error("Mesh has no components");const{transform:c}=i;if(null==c)throw new Error("Mesh has no transform");const m=n(i);if(!m)throw new Error("failed to project");const d=l.map(async t=>{const{faces:o,material:r}=t,a=r instanceof e,n={pbrMetallicRoughness:{baseColorFactor:r?.color?.toUnitRGBA()??[1,1,1,1],baseColorTexture:await u(r?.colorTexture),metallicFactor:a?r.metallic:void 0,roughnessFactor:a?r.roughness:void 0,metallicRoughnessTexture:a&&null!=r.metallicRoughnessTexture?await u(r.metallicRoughnessTexture):void 0},normalTexture:null!=r?.normalTexture?await u(r.normalTexture):void 0,occlusionTexture:a&&null!=r.occlusionTexture?await u(r.occlusionTexture):void 0,emissiveTexture:a&&null!=r.emissiveTexture?await u(r.emissiveTexture):void 0,emissiveFactor:a&&r.emissiveColor?.toUnitRGB()||void 0,alphaMode:("auto"===r?.alphaMode?"blend":r?.alphaMode)??"opaque",alphaCutoff:r?.alphaCutoff??.1,doubleSided:r?.doubleSided??!0,cullFace:r?.doubleSided??1?"none":"back"};return{geometry:{position:m.vertexAttributes.position,faces:o,normal:"source"===t.shading?m.vertexAttributes.normal:void 0,uv:m.vertexAttributes.uv,color:m.vertexAttributes.color},material:n}});return Promise.all(d)}async function u(t){if(null==t)return;const{url:e,data:o}=t,r="image/png",a="string"==typeof t.wrap?"clamp"===t.wrap?"none":t.wrap:"repeat";if(null!=o){if(i(o))throw new Error("Cannot bake encoded textures");if(o instanceof HTMLVideoElement)throw new Error("Cannot bake video textures");if(o instanceof HTMLImageElement){const t=await m(await d(o),r),e=await t.arrayBuffer();return{type:r,width:o.width,wrap:a,data:e}}if(o instanceof HTMLCanvasElement){const t=await m(o,r),e=await t.arrayBuffer();return{type:r,width:o.width,wrap:a,data:e}}const t=await m(w(o),r),e=await t.arrayBuffer();return{type:r,width:o.width,wrap:a,data:e}}if(null!=e){const t=await f(e),o=await m(await d(t),r),n=await o.arrayBuffer();return{type:r,width:t.width,wrap:a,data:n}}}async function m(t,e){return new Promise((o,r)=>t.toBlob(t=>null==t?r(new Error("Failed to load image content")):o(t),e))}async function d(t){await t.decode();const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const o=e.getContext("2d");if(null==o)throw new Error("Failed to create 2d context");return o.drawImage(t,0,0),e}function w(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const o=e.getContext("2d");if(null==o)throw new Error("Failed to create 2d context");return o.putImageData(t,0,0),e}function f(t){const e=new Image;return e.src=t,a(e,e.src,!1,void 0)}export{l as extentFromGLB,c as nodeDataFromGLB};
2
+ import t from"../../geometry/Point.js";import e from"../../geometry/support/MeshMaterialMetallicRoughness.js";import o from"../../geometry/support/MeshTransform.js";import{createFromGLTF as r}from"../../geometry/support/meshUtils.js";import{loadImage as a}from"../../request/loadImage.js";import{meshMakeAbsolute as n}from"./meshUtils.js";import{isEncodedMeshTexture as i}from"../../views/3d/glTF/internal/resourceUtils.js";async function s(e,a,n,i){const s=URL.createObjectURL(new Blob([e]));try{const e=t.fromJSON(a),n=await r(e,s,{vertexSpace:e.spatialReference.isGeographic?"local":"georeferenced"}),{rotationAxis:l,rotationAngle:c,translation:u,scale:m}=i;return n.transform=new o({rotationAngle:c??0,rotationAxis:null!=l?[l[0],l[1],l[2]]:[0,0,1],translation:null!=u?[u[0],u[1],u[2]]:[0,0,0],scale:null!=m?[m[0],m[1],m[2]]:[1,1,1]}),n}finally{URL.revokeObjectURL(s)}}async function l(t,e,o,r){const a=await s(t,e,o,r),n=a.extent.toJSON();return a.destroy(),n}async function c(t,o,r,a){const i=await s(t,o,r,a),{components:l}=i;if(null==l)throw new Error("Mesh has no components");const{transform:c}=i;if(null==c)throw new Error("Mesh has no transform");const m=n(i);if(!m)throw new Error("failed to project");const d=l.map(async t=>{const{faces:o,material:r}=t,a=r instanceof e,n={pbrMetallicRoughness:{baseColorFactor:r?.color?.toUnitRGBA()??[1,1,1,1],baseColorTexture:await u(r?.colorTexture),metallicFactor:a?r.metallic:void 0,roughnessFactor:a?r.roughness:void 0,metallicRoughnessTexture:a&&null!=r.metallicRoughnessTexture?await u(r.metallicRoughnessTexture):void 0},normalTexture:null!=r?.normalTexture?await u(r.normalTexture):void 0,occlusionTexture:a&&null!=r.occlusionTexture?await u(r.occlusionTexture):void 0,emissiveTexture:a&&null!=r.emissiveTexture?await u(r.emissiveTexture):void 0,emissiveFactor:a&&r.emissiveColor?.toUnitRGB()||void 0,alphaMode:("auto"===r?.alphaMode?"blend":r?.alphaMode)??"opaque",alphaCutoff:r?.alphaCutoff??.1,doubleSided:r?.doubleSided??!0,cullFace:r?.doubleSided??!0?"none":"back"};return{geometry:{position:m.vertexAttributes.position,faces:o,normal:"source"===t.shading?m.vertexAttributes.normal:void 0,uv:m.vertexAttributes.uv,color:m.vertexAttributes.color},material:n}});return Promise.all(d)}async function u(t){if(null==t)return;const{url:e,data:o}=t,r="image/png",a="string"==typeof t.wrap?"clamp"===t.wrap?"none":t.wrap:"repeat";if(null!=o){if(i(o))throw new Error("Cannot bake encoded textures");if(o instanceof HTMLVideoElement)throw new Error("Cannot bake video textures");if(o instanceof HTMLImageElement){const t=await m(await d(o),r),e=await t.arrayBuffer();return{type:r,width:o.width,wrap:a,data:e}}if(o instanceof HTMLCanvasElement){const t=await m(o,r),e=await t.arrayBuffer();return{type:r,width:o.width,wrap:a,data:e}}const t=await m(w(o),r),e=await t.arrayBuffer();return{type:r,width:o.width,wrap:a,data:e}}if(null!=e){const t=await f(e),o=await m(await d(t),r),n=await o.arrayBuffer();return{type:r,width:t.width,wrap:a,data:n}}}async function m(t,e){return new Promise((o,r)=>t.toBlob(t=>null==t?r(new Error("Failed to load image content")):o(t),e))}async function d(t){await t.decode();const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const o=e.getContext("2d");if(null==o)throw new Error("Failed to create 2d context");return o.drawImage(t,0,0),e}function w(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const o=e.getContext("2d");if(null==o)throw new Error("Failed to create 2d context");return o.putImageData(t,0,0),e}function f(t){const e=new Image;return e.src=t,a(e,e.src,!1,void 0)}export{l as extentFromGLB,c as nodeDataFromGLB};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GeometryCursor as e}from"../../geometry/GeometryCursor.js";import{importLazily as r}from"../../geometry/operators/importUtils.js";import{TileClipper as t}from"../../geometry/support/TileClipper.js";const o=r(()=>import("../../geometry/operators/json/bufferOperator.js")),s=r(()=>import("../../geometry/operators/json/convexHullOperator.js")),m=r(()=>import("../../geometry/operators/json/lengthOperator.js")),i=r(()=>import("../../geometry/operators/json/generalizeOperator.js")),n=r(()=>import("../../geometry/operators/json/graphicBufferOperator.js")),p=r(()=>import("../../geometry/operators/json/offsetOperator.js")),a=r(()=>import("../../geometry/operators/json/simplifyOperator.js")),f=r(()=>import("../../geometry/operators/json/simplifyOperatorOGC.js")),c=r(()=>import("../../geometry/operators/support/jsonConverter.js")),g=512;let l;function y(e){switch(e.type){case"CIMGeometricEffectDonut":case"CIMGeometricEffectBuffer":return o.getImportPromise();case"CIMGeometricEffectEnclosingPolygon":return s.getImportPromise();case"CIMGeometricEffectOffset":return Promise.all([f.getImportPromise(),p.getImportPromise(),n.getImportPromise()]);case"CIMGeometricEffectControlMeasureLine":return p.getImportPromise();case"CIMGeometricEffectTaperedPolygon":return Promise.all([a.getImportPromise(),m.getImportPromise(),i.getImportPromise()]);default:return Promise.resolve()}}function u(e){return"CIMMarkerPlacementAtMeasuredUnits"===e.type?c.getImportPromise():Promise.resolve()}class P{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}}function j(r,o,s){if(!r)return null;l||(l=new t(0,0,0,1));const m=s?-1:1,i="esriGeometryPolygon"===r.geometryType,n=i?3:2,p=i?3:2;let a,f;for(l.reset(n),l.setPixelMargin(o+1),l.setExtent(g);r.nextPath();)if(!(r.pathSize<p)){for(r.nextPoint(),a=r.x,f=m*r.y,l.moveTo(a,f);r.nextPoint();)a=r.x,f=m*r.y,l.lineTo(a,f);i&&l.close()}const c=l.result(!1);if(c){const t=e.createEmptyOptimizedCIM(r.geometryType);for(const e of c){t.startPath();for(const r of e)t.pushXY(r.x,m*r.y)}return t.reset(),t}return null}export{P as SimpleEffectCursor,j as clipCursorToTileExtent,o as lazyBufferOperator,s as lazyConvexHullOperator,i as lazyGeneralizeOperator,n as lazyGraphicBufferOperator,c as lazyJsonConversion,m as lazyLengthOperator,p as lazyOffsetOperator,f as lazySimplifyOGCOperator,a as lazySimplifyOperator,y as loadGeometryOperatorsForEffect,u as loadGeometryOperatorsForPlacement};
2
+ import{importLazily as e}from"../../core/importUtils.js";import{GeometryCursor as r}from"../../geometry/GeometryCursor.js";import{TileClipper as t}from"../../geometry/support/TileClipper.js";const o=e(()=>import("../../geometry/operators/json/bufferOperator.js")),s=e(()=>import("../../geometry/operators/json/convexHullOperator.js")),m=e(()=>import("../../geometry/operators/json/lengthOperator.js")),i=e(()=>import("../../geometry/operators/json/generalizeOperator.js")),n=e(()=>import("../../geometry/operators/json/graphicBufferOperator.js")),p=e(()=>import("../../geometry/operators/json/offsetOperator.js")),a=e(()=>import("../../geometry/operators/json/simplifyOperator.js")),f=e(()=>import("../../geometry/operators/json/simplifyOperatorOGC.js")),c=e(()=>import("../../geometry/operators/support/jsonConverter.js")),l=512;let g;function u(e){switch(e.type){case"CIMGeometricEffectDonut":case"CIMGeometricEffectBuffer":return o.getImportPromise();case"CIMGeometricEffectEnclosingPolygon":return s.getImportPromise();case"CIMGeometricEffectOffset":return Promise.all([f.getImportPromise(),p.getImportPromise(),n.getImportPromise()]);case"CIMGeometricEffectControlMeasureLine":return p.getImportPromise();case"CIMGeometricEffectTaperedPolygon":return Promise.all([a.getImportPromise(),m.getImportPromise(),i.getImportPromise()]);default:return Promise.resolve()}}function y(e){return"CIMMarkerPlacementAtMeasuredUnits"===e.type?c.getImportPromise():Promise.resolve()}class P{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}}function j(e,o,s){if(!e)return null;g||(g=new t(0,0,0,1));const m=s?-1:1,i="esriGeometryPolygon"===e.geometryType,n=i?3:2,p=i?3:2;let a,f;for(g.reset(n),g.setPixelMargin(o+1),g.setExtent(l);e.nextPath();)if(!(e.pathSize<p)){for(e.nextPoint(),a=e.x,f=m*e.y,g.moveTo(a,f);e.nextPoint();)a=e.x,f=m*e.y,g.lineTo(a,f);i&&g.close()}const c=g.result(!1);if(c){const t=r.createEmptyOptimizedCIM(e.geometryType);for(const e of c){t.startPath();for(const r of e)t.pushXY(r.x,m*r.y)}return t.reset(),t}return null}export{P as SimpleEffectCursor,j as clipCursorToTileExtent,o as lazyBufferOperator,s as lazyConvexHullOperator,i as lazyGeneralizeOperator,n as lazyGraphicBufferOperator,c as lazyJsonConversion,m as lazyLengthOperator,p as lazyOffsetOperator,f as lazySimplifyOGCOperator,a as lazySimplifyOperator,u as loadGeometryOperatorsForEffect,y as loadGeometryOperatorsForPlacement};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{collectMultipath as t}from"../../../geometry/geometryCursorCollectUtils.js";import i from"../../../geometry/SpatialReference.js";import{clipCursorToTileExtent as s,lazyBufferOperator as r}from"../CIMEffects.js";import{CurveHelper as n,pixelTolerance as o}from"../CurveHelper.js";class m{static{this.instance=null}static local(){return null===m.instance&&(m.instance=new m),m.instance}execute(e,t,i){return new l(e,t,i)}}class l{constructor(e,t,i){const s=i.geomUnitsPerPoint,r=i.tileKey,m=i.maxInflateSize;this._preventClipping=i.preventClipping,this._inputGeometries=e,this._tileKey=r,this._curveHelper=new n,this._size=(void 0!==t.size?t.size:1)*s,this._maxInflateSize=m*s,this._offsetFlattenError=o*s}next(){let n;for(;n=this._inputGeometries.next();){if(0===this._size)return n;if("esriGeometryEnvelope"===n.geometryType)if(this._size>0){const i=e.createEmptyOptimizedCIM(n.geometryType),s=t(n)[0],r=this._curveHelper.offset(s,this._size,"Rounded",4,this._offsetFlattenError);if(r)return i.pushPath(r),i}else if(this._size<0){const t=n.asJSON();if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._size>0)return e.fromJSONCIM({xmin:t.xmin-this._size,xmax:t.xmax+this._size,ymin:t.ymin-this._size,ymax:t.ymax+this._size})}const o=!this._preventClipping&&this._tileKey?s(n,this._maxInflateSize,!0):n;if(!o)continue;const m=r.module,l={...o.asJSON(),spatialReference:{wkid:i.WebMercator.wkid}},a=m.execute(l,this._size);return a?e.fromJSONCIM(a):null}return null}}export{m as EffectBuffer};
2
+ import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{collectMultipath as t}from"../../../geometry/geometryCursorCollectUtils.js";import i from"../../../geometry/SpatialReference.js";import{clipCursorToTileExtent as s,lazyBufferOperator as r}from"../CIMEffects.js";import{CurveHelper as n,pixelTolerance as o}from"../CurveHelper.js";class m{static{this.instance=null}static local(){return null===m.instance&&(m.instance=new m),m.instance}execute(e,t,i){return new l(e,t,i)}}class l{constructor(e,t,i){const s=i.geomUnitsPerPoint,r=i.tileKey,m=i.maxInflateSize;this._preventClipping=i.preventClipping,this._inputGeometries=e,this._tileKey=r,this._curveHelper=new n,this._size=(void 0!==t.size?t.size:1)*s,this._maxInflateSize=m*s,this._offsetFlattenError=o*s}next(){let n;for(;n=this._inputGeometries.next();){if(0===this._size)return n;if("esriGeometryEnvelope"===n.geometryType)if(this._size>0){const i=e.createEmptyOptimizedCIM(n.geometryType),s=t(n)[0],r=this._curveHelper.offset(s,this._size,"Rounded",4,this._offsetFlattenError);if(r)return i.pushPath(r),i}else if(this._size<0){const t=n.asJSON();if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._size>0)return e.fromJSONCIM({xmin:t.xmin-this._size,xmax:t.xmax+this._size,ymin:t.ymin-this._size,ymax:t.ymax+this._size})}const o=!this._preventClipping&&this._tileKey?s(n,this._maxInflateSize,!0):n;if(!o)continue;const{bufferExecute:m}=r.module,l=m({...o.asJSON(),spatialReference:{wkid:i.WebMercator.wkid}},this._size);return l?e.fromJSONCIM(l):null}return null}}export{m as EffectBuffer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{inchesPerMeter as s}from"../../../core/units.js";import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectMultipath as i}from"../../../geometry/geometryCursorCollectUtils.js";import h from"../../../geometry/SpatialReference.js";import{getPathLength as e}from"../../../geometry/support/coordsUtils.js";import{setId as r}from"../CIMCursor.js";import{lazyOffsetOperator as _}from"../CIMEffects.js";class c{static{this.instance=null}static local(){return null===c.instance&&(c.instance=new c),c.instance}execute(s,t,i){return new o(s,t,i)}}class o{constructor(s,t,i){this._defaultPointSize=20,this._inputGeometries=s,this._geomUnitsPerPoint=i.geomUnitsPerPoint??1,this._scale=i?.scale,this._rule=t.rule??"FullGeometry",this._spatialReference=i?.spatialReference??h.WebMercator,this._width=this._computeWidth(t.width??25),this._defaultSize=this._defaultPointSize*this._geomUnitsPerPoint}next(){let s;for(;s=this._inputGeometries.next();){const h=this._processGeom(i(s));if(h?.length)return t.fromJSONCIM({paths:h})}return null}_computeWidth(t){if(!u(this._rule)||null==this._scale||!this._spatialReference.metersPerUnit)return t*this._geomUnitsPerPoint;const i=this._scale/(96*s*this._spatialReference.metersPerUnit);return t/(this._spatialReference.metersPerUnit*i)}_clone(s){return[s[0],s[1]]}_mid(s,t){return[(s[0]+t[0])/2,(s[1]+t[1])/2]}_mix(s,t,i,h){return[s[0]*t+i[0]*h,s[1]*t+i[1]*h]}_add(s,t){return[s[0]+t[0],s[1]+t[1]]}_add2(s,t,i){return[s[0]+t,s[1]+i]}_sub(s,t){return[s[0]-t[0],s[1]-t[1]]}_dist(s,t){return Math.sqrt((s[0]-t[0])*(s[0]-t[0])+(s[1]-t[1])*(s[1]-t[1]))}_norm(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}_normalize(s,t=1){const i=t/this._norm(s);s[0]*=i,s[1]*=i}_leftPerpendicular(s){const t=-s[1],i=s[0];s[0]=t,s[1]=i}_leftPerp(s){return[-s[1],s[0]]}_rightPerpendicular(s){const t=s[1],i=-s[0];s[0]=t,s[1]=i}_rightPerp(s){return[s[1],-s[0]]}_dotProduct(s,t){return s[0]*t[0]+s[1]*t[1]}_crossProduct(s,t){return s[0]*t[1]-s[1]*t[0]}_rotateDirect(s,t,i){const h=s[0]*t-s[1]*i,e=s[0]*i+s[1]*t;s[0]=h,s[1]=e}_makeCtrlPt(s){const t=[s[0],s[1]];return r(t,1),t}_addAngledTicks(s,t,i,h){const e=this._sub(i,t);this._normalize(e);const r=this._crossProduct(e,this._sub(h,t));let _;_=r>0?this._rightPerp(e):this._leftPerp(e);const c=Math.abs(r)/2,o=[];o.push([t[0]+(_[0]-e[0])*c,t[1]+(_[1]-e[1])*c]),o.push(t),o.push(i),o.push([i[0]+(_[0]+e[0])*c,i[1]+(_[1]+e[1])*c]),s.push(o)}_addBezier2(s,t,i,h,e){if(0===e--)return void s.push(h);const r=this._mid(t,i),_=this._mid(i,h),c=this._mid(r,_);this._addBezier2(s,t,r,c,e),this._addBezier2(s,c,_,h,e)}_addBezier3(s,t,i,h,e,r){if(0===r--)return void s.push(e);const _=this._mid(t,i),c=this._mid(i,h),o=this._mid(h,e),u=this._mid(_,c),a=this._mid(c,o),n=this._mid(u,a);this._addBezier3(s,t,_,u,n,r),this._addBezier3(s,n,a,o,e,r)}_add90DegArc(s,t,i,h,e){const r=e??this._crossProduct(this._sub(i,t),this._sub(h,t))>0,_=this._mid(t,i),c=this._sub(_,t);r?this._leftPerpendicular(c):this._rightPerpendicular(c),_[0]+=c[0],_[1]+=c[1],this._addBezier3(s,t,this._mix(t,.33333,_,.66667),this._mix(i,.33333,_,.66667),i,4)}_addArrow(s,t,i){const h=t[0],e=t[1],r=t[t.length-1],_=this._sub(h,e),c=this._norm(_);this._normalize(_);const o=Math.abs(this._crossProduct(_,this._sub(r,e)));let u=this._dotProduct(_,this._sub(r,e));u<.05*c?u=.05*c:u>.95*c&&(u=.95*c);const a=.5*o,n=this._leftPerp(_),p=[e[0]+_[0]*u,e[1]+_[1]*u],d=t.length-1,l=[];l.push(i?[-n[0],-n[1]]:n);let b=[-_[0],-_[1]];for(let P=1;P<d-1;P++){const s=this._sub(t[P+1],t[P]);this._normalize(s);const i=this._dotProduct(s,b),h=this._crossProduct(s,b),e=Math.sqrt((1+i)/2),r=this._sub(s,b);this._normalize(r),r[0]/=e,r[1]/=e,l.push(h<0?[-r[0],-r[1]]:r),b=s}l.push(this._rightPerp(b));for(let P=l.length-1;P>0;P--)s.push([t[P][0]+l[P][0]*a,t[P][1]+l[P][1]*a]);s.push([p[0]+l[0][0]*a,p[1]+l[0][1]*a]),s.push([p[0]+l[0][0]*o,p[1]+l[0][1]*o]),s.push(h),s.push([p[0]-l[0][0]*o,p[1]-l[0][1]*o]),s.push([p[0]-l[0][0]*a,p[1]-l[0][1]*a]);for(let P=1;P<l.length;P++)s.push([t[P][0]-l[P][0]*a,t[P][1]-l[P][1]*a])}_addDash(s,t,i){const h=this._norm(i)/7;this._normalize(i);let e=[];for(let r=0;r<=7;r++)e.push([t[0]+i[0]*r*h,t[1]+i[1]*r*h]),1&r&&(s.push(e),e=[])}_cp2(s,t,i){return s.length>=2?s[1]:this._add2(s[0],t*this._defaultSize,i*this._defaultSize)}_cp3(s,t,i,h){if(s.length>=3)return s[2];const e=this._mix(s[0],1-i,t,i),r=this._sub(t,s[0]);return this._normalize(r),this._rightPerpendicular(r),[e[0]+r[0]*h*this._defaultSize,e[1]+r[1]*h*this._defaultSize]}_arrowPath(s){if(s.length>2)return s;const t=s[0],i=this._cp2(s,-4,0),h=this._sub(t,i);this._normalize(h);const e=this._rightPerp(h);return[t,i,[t[0]+(e[0]-h[0])*this._defaultSize,t[1]+(e[1]-h[1])*this._defaultSize]]}_arrowLastSeg(s){const t=s[0],i=this._cp2(s,-4,0);let h;if(s.length>=3)h=s[s.length-1];else{const s=this._sub(t,i);this._normalize(s);const e=this._rightPerp(s);h=[t[0]+(e[0]-s[0])*this._defaultSize,t[1]+(e[1]-s[1])*this._defaultSize]}return[i,h]}_offsetPath(s,h){const e=_.module.execute({paths:[s],spatialReference:this._spatialReference.toJSON()},h,{joins:"miter",miterLimit:4}),[r]=i(t.fromJSONCIM(e));return r?.length?r:null}_processGeom(s){if(!s)return null;const t=[];for(const i of s){const s=i.length>1&&e(i)<this._defaultSize;if(!i||0===i.length||s)continue;const h=i.length;let _=i[0];switch(this._rule){case"PerpendicularFromFirstSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,4),e=[];e.push(h),e.push(this._mid(_,s)),t.push(e);break}case"ReversedFirstSegment":{const s=this._cp2(i,0,-1);t.push([s,_]);break}case"PerpendicularToSecondSegment":{if(i.length<3)return[];const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=[];e.push(this._mid(s,h)),e.push(_),t.push(e);break}case"SecondSegmentWithTicks":{if(i.length<3)return[];const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=this._sub(h,s);let r;r=this._crossProduct(e,this._sub(_,s))>0?this._rightPerp(e):this._leftPerp(e);const c=[];c.push([s[0]+(r[0]-e[0])/3,s[1]+(r[1]-e[1])/3]),c.push(s),c.push(h),c.push([h[0]+(r[0]+e[0])/3,h[1]+(r[1]+e[1])/3]),t.push(c);break}case"DoublePerpendicular":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,3),e=this._mid(_,s),r=this._sub(e,h);this._normalize(r);const c=this._crossProduct(r,this._sub(_,h));this._leftPerpendicular(r);const o=[];o.push(_),o.push([h[0]+r[0]*c,h[1]+r[1]*c]),t.push(o);const u=[];u.push([h[0]-r[0]*c,h[1]-r[1]*c]),u.push(s),t.push(u);break}case"OppositeToFirstSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,3),e=this._mid(_,s),r=this._sub(e,h);this._normalize(r);const c=this._crossProduct(r,this._sub(_,h));this._leftPerpendicular(r);const o=[];o.push([h[0]+r[0]*c,h[1]+r[1]*c]),o.push([h[0]-r[0]*c,h[1]-r[1]*c]),t.push(o);break}case"TriplePerpendicular":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,4),e=this._mid(_,s),r=this._sub(e,h);this._normalize(r);const c=this._crossProduct(r,this._sub(_,h));this._leftPerpendicular(r);const o=[];o.push([h[0]+r[0]*c*.8,h[1]+r[1]*c*.8]),o.push([e[0]+.8*(_[0]-e[0]),e[1]+.8*(_[1]-e[1])]),t.push(o),t.push([h,e]);const u=[];u.push([h[0]-r[0]*c*.8,h[1]-r[1]*c*.8]),u.push([e[0]+.8*(s[0]-e[0]),e[1]+.8*(s[1]-e[1])]),t.push(u);break}case"HalfCircleFirstSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,4),e=this._mid(_,s);let r=this._sub(s,_);const c=Math.cos(Math.PI/18),o=Math.sin(Math.PI/18),u=Math.sqrt((1+c)/2),a=Math.sqrt((1-c)/2),n=[];let p;this._crossProduct(r,this._sub(h,_))>0?(n.push(_),r=this._sub(_,e),p=s):(n.push(s),r=this._sub(s,e),p=_),this._rotateDirect(r,u,a),r[0]/=u,r[1]/=u;for(let t=1;t<=18;t++)n.push(this._add(e,r)),this._rotateDirect(r,c,o);n.push(p),t.push(n);break}case"HalfCircleSecondSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,1,-1);let e=this._sub(_,s);this._normalize(e);const r=this._crossProduct(e,this._sub(h,s))/2;this._leftPerpendicular(e);const c=[s[0]+e[0]*r,s[1]+e[1]*r];e=this._sub(s,c);const o=Math.cos(Math.PI/18);let u=Math.sin(Math.PI/18);r>0&&(u=-u);const a=[s];for(let t=1;t<=18;t++)this._rotateDirect(e,o,u),a.push(this._add(c,e));t.push(a);break}case"HalfCircleExtended":{const s=this._cp2(i,0,-2),e=this._cp3(i,s,1,-1);let r;if(h>=4)r=i[3];else{const t=this._sub(_,s);r=this._add(e,t)}const c=this._dist(s,e)/2/.75,o=this._sub(s,_);this._normalize(o,c);const u=this._sub(e,r);this._normalize(u,c);const a=[r,e];t.push(a);const n=[this._clone(e)];this._addBezier3(n,e,this._add(e,u),this._add(s,o),s,4),n.push(_),t.push(n);break}case"OpenCircle":{const s=this._cp2(i,-2,0),h=this._sub(s,_),e=Math.cos(Math.PI/18),r=-Math.sin(Math.PI/18),c=[s];for(let t=1;t<=33;t++)this._rotateDirect(h,e,r),c.push(this._add(_,h));t.push(c);break}case"CoverageEdgesWithTicks":{const s=this._cp2(i,0,-1);let e,r;if(h>=3)e=i[2];else{const t=this._sub(s,_),i=this._leftPerp(t);e=[_[0]+i[0]-.25*t[0],_[1]+i[1]-.25*t[1]]}if(h>=4)r=i[3];else{const t=this._mid(_,s),i=this._sub(_,s);this._normalize(i),this._leftPerpendicular(i);const h=this._crossProduct(i,this._sub(e,t));this._rightPerpendicular(i),r=[e[0]+i[0]*h*2,e[1]+i[1]*h*2]}const c=this._sub(s,_);let o,u;o=this._crossProduct(c,this._sub(e,_))>0?this._rightPerp(c):this._leftPerp(c),u=[],u.push(e),u.push(_),u.push([_[0]+(o[0]-c[0])/3,_[1]+(o[1]-c[1])/3]),t.push(u),o=this._crossProduct(c,this._sub(r,s))>0?this._rightPerp(c):this._leftPerp(c),u=[],u.push([s[0]+(o[0]+c[0])/3,s[1]+(o[1]+c[1])/3]),u.push(s),u.push(r),t.push(u);break}case"GapExtentWithDoubleTicks":{const s=this._cp2(i,0,2),e=this._cp3(i,s,0,1);let r;if(h>=4)r=i[3];else{const t=this._sub(s,_);r=this._add(e,t)}this._addAngledTicks(t,_,s,this._mid(e,r)),this._addAngledTicks(t,e,r,this._mid(_,s));break}case"GapExtentMidline":{const s=this._cp2(i,2,0),e=this._cp3(i,s,0,1);let r;if(h>=4)r=i[3];else{const t=this._sub(s,_);r=this._add(e,t)}const c=[];c.push(this._mid(_,e)),c.push(this._mid(s,r)),t.push(c);break}case"Chevron":{const s=this._cp2(i,-1,-1);let e;if(h>=3)e=i[2];else{const t=this._sub(s,_);this._leftPerpendicular(t),e=this._add(_,t)}t.push([s,this._makeCtrlPt(_),e]);break}case"PerpendicularWithArc":{const s=this._cp2(i,0,-2),e=this._cp3(i,s,.5,-1),r=this._sub(s,_),c=this._norm(r);r[0]/=c,r[1]/=c;const o=this._crossProduct(r,this._sub(e,_));let u=this._dotProduct(r,this._sub(e,_));u<.05*c?u=.05*c:u>.95*c&&(u=.95*c);const a=[_[0]+r[0]*u,_[1]+r[1]*u];let n=this._leftPerp(r),p=[];if(p.push([a[0]-n[0]*o,a[1]-n[1]*o]),p.push([a[0]+n[0]*o,a[1]+n[1]*o]),t.push(p),h>=4){const s=i[3];let h=this._dotProduct(r,this._sub(s,_));h<.1*c?h=.1*c:h>.9*c&&(h=.9*c);const e=[_[0]+r[0]*h,_[1]+r[1]*h],o=this._crossProduct(r,this._sub(s,_)),u=[];u.push([e[0]-n[0]*o,e[1]-n[1]*o]),u.push([e[0]+n[0]*o,e[1]+n[1]*o]),t.push(u)}const d=[s[0]+n[0]*o,s[1]+n[1]*o];n=this._sub(s,d);const l=Math.cos(Math.PI/18);let b=Math.sin(Math.PI/18);o<0&&(b=-b),p=[_,s];for(let t=1;t<=9;t++)this._rotateDirect(n,l,b),p.push(this._add(d,n));t.push(p);break}case"ClosedHalfCircle":{const s=this._cp2(i,2,0),h=this._mid(_,s),e=this._sub(s,h),r=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),o=[_,s];for(let t=1;t<=18;t++)this._rotateDirect(e,r,c),o.push(this._add(h,e));t.push(o);break}case"TripleParallelExtended":{const s=this._cp2(i,0,-2),h=this._cp3(i,s,1,-2),e=this._mid(_,s),c=this._sub(h,s);this._normalize(c);const o=Math.abs(this._crossProduct(c,this._sub(e,s)))/2,u=this._dist(s,h),a=[s,_];a.push([_[0]+c[0]*u*.5,_[1]+c[1]*u*.5]),t.push(a);const n=[];n.push([e[0]-c[0]*o,e[1]-c[1]*o]),n.push([e[0]+c[0]*u*.375,e[1]+c[1]*u*.375]),r(n[n.length-1],1),n.push([e[0]+c[0]*u*.75,e[1]+c[1]*u*.75]),t.push(n);const p=[s,h];t.push(p);break}case"ParallelWithTicks":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_)),c=this._leftPerp(e);this._addAngledTicks(t,_,s,h),this._addAngledTicks(t,this._add2(_,c[0]*r,c[1]*r),this._add2(s,c[0]*r,c[1]*r),this._mid(_,s));break}case"Parallel":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._leftPerp(e),c=this._crossProduct(e,this._sub(h,_));let o=[_,s];t.push(o),o=[],o.push([_[0]+r[0]*c,_[1]+r[1]*c]),o.push([s[0]+r[0]*c,s[1]+r[1]*c]),t.push(o);break}case"PerpendicularToFirstSegment":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._mid(_,s),r=this._sub(s,_);this._normalize(r);const c=this._crossProduct(r,this._sub(h,_));this._leftPerpendicular(r);const o=[];o.push([e[0]-r[0]*c*.25,e[1]-r[1]*c*.25]),o.push([e[0]+r[0]*c*1.25,e[1]+r[1]*c*1.25]),t.push(o);break}case"ParallelOffset":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e);const c=[];c.push([_[0]-e[0]*r,_[1]-e[1]*r]),c.push([s[0]-e[0]*r,s[1]-e[1]*r]),t.push(c);const o=[];o.push([_[0]+e[0]*r,_[1]+e[1]*r]),o.push([s[0]+e[0]*r,s[1]+e[1]*r]),t.push(o);break}case"OffsetOpposite":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e);const c=[];c.push([_[0]-e[0]*r,_[1]-e[1]*r]),c.push([s[0]-e[0]*r,s[1]-e[1]*r]),t.push(c);break}case"OffsetSame":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e);const c=[];c.push([_[0]+e[0]*r,_[1]+e[1]*r]),c.push([s[0]+e[0]*r,s[1]+e[1]*r]),t.push(c);break}case"CircleWithArc":{let s=this._cp2(i,3,0);const e=this._cp3(i,s,.5,-1);let c,o;if(h>=4)c=i[3],o=this._crossProduct(this._sub(c,s),this._sub(e,s))>0;else{c=s,o=this._crossProduct(this._sub(c,_),this._sub(e,_))>0;const t=24*this._geomUnitsPerPoint,i=this._sub(c,_);this._normalize(i,t);const h=Math.sqrt(2)/2;this._rotateDirect(i,h,o?h:-h),s=this._add(_,i)}const u=this._sub(s,_),a=Math.cos(Math.PI/18),n=Math.sin(Math.PI/18),p=[s];for(let t=1;t<=36;t++)this._rotateDirect(u,a,n),p.push(this._add(_,u));this._add90DegArc(p,s,c,e,o),r(p[p.length-8],1),t.push(p);break}case"DoubleJog":{let s,e=this._cp2(i,-3,1),r=this._cp3(i,e,-1,-.5);if(h>=4)s=i[3];else{const t=_;_=e,s=r;const i=this._dist(_,t),h=this._dist(s,t);let c=30*this._geomUnitsPerPoint;.5*i<c&&(c=.5*i),.5*h<c&&(c=.5*h),e=this._mix(_,c/i,t,(i-c)/i),r=this._mix(s,c/h,t,(h-c)/h)}const c=this._mid(_,e),o=this._mid(s,r),u=this._dist(_,e),a=this._dist(r,s);let n=Math.min(u,a)/8;n=Math.min(n,24*this._geomUnitsPerPoint);const p=Math.cos(Math.PI/4);let d=this._sub(_,e);this._normalize(d,n),this._crossProduct(d,this._sub(s,e))>0?this._rotateDirect(d,p,-p):this._rotateDirect(d,p,p);let l=[];l.push(e),l.push(this._add(c,d)),l.push(this._sub(c,d)),l.push(_),t.push(l),d=this._sub(s,r),this._normalize(d,n),this._crossProduct(d,this._sub(_,r))<0?this._rotateDirect(d,p,p):this._rotateDirect(d,p,-p),l=[],l.push(r),l.push(this._add(o,d)),l.push(this._sub(o,d)),l.push(s),t.push(l);break}case"PerpendicularOffset":{const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=this._sub(h,s);this._crossProduct(e,this._sub(_,s))>0?this._rightPerpendicular(e):this._leftPerpendicular(e);const r=[e[0]/8,e[1]/8],c=this._sub(this._mid(s,h),r);t.push([c,_]);break}case"LineExcludingLastSegment":{const s=this._arrowPath(i),h=[];let e=s.length-2;for(;e--;)h.push(s[e]);t.push(h);break}case"MultivertexArrow":{const s=this._arrowPath(i),h=[];this._addArrow(h,s,!1),t.push(h);break}case"CrossedArrow":{const s=this._arrowPath(i),h=[];this._addArrow(h,s,!0),t.push(h);break}case"ChevronArrow":{const[s,h]=this._arrowLastSeg(i),e=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);const o=this._crossProduct(r,this._sub(h,s));let u=this._dotProduct(r,this._sub(h,s));u<.05*c?u=.05*c:u>.95*c-e&&(u=.95*c-e);const a=[s[0]+r[0]*u,s[1]+r[1]*u],n=this._leftPerp(r),p=[];p.push([a[0]+n[0]*o+r[0]*e,a[1]+n[1]*o+r[1]*e]),p.push(_),p.push([a[0]-n[0]*o+r[0]*e,a[1]-n[1]*o+r[1]*e]),t.push(p);break}case"ChevronArrowOffset":{const[s,h]=this._arrowLastSeg(i),e=this._sub(_,s),r=this._norm(e);this._normalize(e);const c=this._crossProduct(e,this._sub(h,s));let o=this._dotProduct(e,this._sub(h,s));o<.05*r?o=.05*r:o>.95*r&&(o=.95*r);const u=[s[0]+e[0]*o,s[1]+e[1]*o];this._leftPerpendicular(e);const a=[];a.push([u[0]+e[0]*c*.5,u[1]+e[1]*c*.5]),a.push(this._mid(u,_)),a.push([u[0]-e[0]*c*.5,u[1]-e[1]*c*.5]),t.push(a);break}case"PartialFirstSegment":{const[s,h]=this._arrowLastSeg(i),e=this._sub(_,s),r=this._norm(e);this._normalize(e);let c=this._dotProduct(e,this._sub(h,s));c<.05*r?c=.05*r:c>.95*r&&(c=.95*r);const o=[s[0]+e[0]*c,s[1]+e[1]*c];t.push([s,o]);break}case"Arch":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,1),e=this._sub(_,s),r=this._mix(h,1,e,.55),c=this._mix(h,1,e,-.55),o=[_];this._addBezier2(o,_,r,h,4),this._addBezier2(o,h,c,s,4),t.push(o);break}case"CurvedParallelTicks":{const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=this._sub(h,s);this._crossProduct(e,this._sub(_,s))>0?this._rightPerpendicular(e):this._leftPerpendicular(e);const r=[e[0]/8,e[1]/8],c=this._sub(this._mid(s,h),r),o=this._sub(this._mix(s,.75,h,.25),r),u=this._sub(this._mix(s,.25,h,.75),r),a=[s];this._addBezier2(a,s,o,c,3),this._addBezier2(a,c,u,h,3),t.push(a);for(let i=0;i<8;i++){const s=a[2*i+1],h=[this._clone(s)];h.push(this._add(s,[e[0]/4,e[1]/4])),t.push(h)}break}case"Arc90Degrees":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,1),e=[s];this._add90DegArc(e,s,_,h),t.push(e);break}case"TipWithPerpendicularAndTicks":{const[s,h]=this._arrowLastSeg(i),e=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);let o=this._crossProduct(r,this._sub(h,s)),u=this._dotProduct(r,this._sub(h,s));u<.05*c?u=.05*c:u>.95*c-e&&(u=.95*c-e);const a=this._leftPerp(r),n=[_[0]-r[0]*e,_[1]-r[1]*e],p=.5*Math.max(c-u-e,e);o=Math.abs(o);const d=[];d.push([n[0]+a[0]*(o+p)-r[0]*p,n[1]+a[1]*(o+p)-r[1]*p]),d.push([n[0]+a[0]*o,n[1]+a[1]*o]),d.push([n[0]-a[0]*o,n[1]-a[1]*o]),d.push([n[0]-a[0]*(o+p)-r[0]*p,n[1]-a[1]*(o+p)-r[1]*p]),t.push(d),t.push([n,_]);break}case"ConcentricCircles":{const s=this._cp2(i,1,0),e=this._cp3(i,s,2,0),c=Math.cos(Math.PI/18),o=Math.sin(Math.PI/18);let u=this._dist(s,_),a=[u,0],n=[];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,o);if(t.push(n),h>=4){n=[];const s=i[3];u=this._dist(s,_),a=[u,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),0===t&&(n.push(this._add(_,a)),r(n[1],1)),this._rotateDirect(a,c,o);t.push(n)}n=[],u=this._dist(e,_),a=[u,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,o);t.push(n);break}case"DoubleJogArrow":{_=this._arrowPath(i)[0];const[s,h]=this._arrowLastSeg(i),e=this._sub(_,s),r=this._norm(e);this._normalize(e);const c=Math.abs(this._crossProduct(e,this._sub(h,_)));let o=Math.abs(this._dotProduct(e,this._sub(h,_)));o<.05*r?o=.05*r:o>.95*r&&(o=.95*r);const u=Math.max(c,o),a=this._leftPerp(e);let n=[];const p=[_[0]-e[0]*o*.5+a[0]*c*.5,_[1]-e[1]*o*.5+a[1]*c*.5];n.push([p[0],p[1]]),p[0]+=e[0]*u*.5+a[0]*u*.4,p[1]+=e[1]*u*.5+a[1]*u*.4,n.push([p[0],p[1]]),p[0]-=a[0]*u*.25,p[1]-=a[1]*u*.25,n.push([p[0],p[1]]),p[0]+=e[0]*u*.5+a[0]*u*.4,p[1]+=e[1]*u*.5+a[1]*u*.4,n.push([p[0],p[1]]),t.push(n),n=[],p[0]=_[0]-e[0]*o*.5-a[0]*c*.5,p[1]=_[1]-e[1]*o*.5-a[1]*c*.5,n.push([p[0],p[1]]),p[0]+=e[0]*u*.5-a[0]*u*.4,p[1]+=e[1]*u*.5-a[1]*u*.4,n.push([p[0],p[1]]),p[0]+=a[0]*u*.25,p[1]+=a[1]*u*.25,n.push([p[0],p[1]]),p[0]+=e[0]*u*.5-a[0]*u*.4,p[1]+=e[1]*u*.5-a[1]*u*.4,n.push([p[0],p[1]]),t.push(n);break}case"LinkedChevrons":{const s=this._cp2(i,-5,0),h=this._cp3(i,s,-.2,1),e=this._sub(_,s);this._normalize(e);const r=this._leftPerp(e),c=Math.abs(this._crossProduct(e,this._sub(h,s)));t.push([s,_]);const o=[];o.push([_[0]-e[0]*c+r[0]*c,_[1]-e[1]*c+r[1]*c]),o.push(_),o.push([_[0]-e[0]*c-r[0]*c,_[1]-e[1]*c-r[1]*c]),t.push(o),this._addDash(t,s,[-e[0]*c+r[0]*c,-e[1]*c+r[1]*c]),this._addDash(t,s,[-e[0]*c-r[0]*c,-e[1]*c-r[1]*c]);break}case"SegmentThenHalfCircle":{const s=this._cp2(i,2,0),e=this._cp3(i,s,1.5,0);let r;r=h>=4?i[3]:this._cp3(i,s,1.25,-.5);const c=this._sub(s,_);this._normalize(c);const o=.5*this._dist(s,e),u=this._crossProduct(c,this._sub(r,_))>0,a=Math.cos(Math.PI/18);let n=Math.sin(Math.PI/18);u&&(n=-n);const p=[_,s];c[0]*=o,c[1]*=o;const d=this._add(s,c);c[0]=-c[0],c[1]=-c[1];for(let t=1;t<=18;t++)this._rotateDirect(c,a,n),p.push(this._add(d,c));t.push(p);break}case"LineWithStraightTicks":{const s=this._cp2(i,-2,1),h=this._cp3(i,s,-1,-.5),e=this._sub(h,s);this._normalize(e);const r=this._dotProduct(e,this._sub(s,_)),c=this._dotProduct(e,this._sub(h,_));let o=[_];o.push([_[0]+e[0]*r,_[1]+e[1]*r]),o.push(s),t.push(o),o=[_],o.push([_[0]+e[0]*c,_[1]+e[1]*c]),o.push(h),t.push(o);break}case"DoubleCurve":{const s=this._cp2(i,-5,-1),h=this._cp3(i,s,2,0),e=Math.atan2(1,5),c=Math.cos(e),o=Math.sin(e),u=this._sub(s,_),a=this._dist(_,s);this._normalize(u),this._rotateDirect(u,c,-o);const n=[_];n.push([_[0]+u[0]*a*.5,_[1]+u[1]*a*.5]),r(n[1],1),n.push([_[0]+u[0]*a*.8,_[1]+u[1]*a*.8]),this._addBezier2(n,n[2],[_[0]+u[0]*a,_[1]+u[1]*a],s,3);const p=this._sub(h,s),d=this._dist(s,h);this._normalize(p),this._rotateDirect(p,c,-o),this._addBezier2(n,s,[h[0]-p[0]*d,h[1]-p[1]*d],[h[0]-p[0]*d*.8,h[1]-p[1]*d*.8],3),n.push(h),t.push(n);break}case"ParallelWithTicksByWidth":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,3),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e),r>0?(this._addAngledTicks(t,_,[_[0]+e[0]*r,_[1]+e[1]*r],s),this._addAngledTicks(t,s,[s[0]+e[0]*r,s[1]+e[1]*r],_)):(this._addAngledTicks(t,[_[0]+e[0]*r,_[1]+e[1]*r],_,s),this._addAngledTicks(t,[s[0]+e[0]*r,s[1]+e[1]*r],_,s));break}case"EnclosingRoundedRectangle":{const s=this._cp2(i,3,-2),t=[Math.min(_[0],s[0]),Math.max(_[1],s[1])],h=[Math.max(_[0],s[0]),Math.min(_[1],s[1])],e=h[0]-t[0],r=t[1]-h[1],c=Math.min(e,r)/10,o=[];o.push([t[0]+c+.75*(e-2*c),t[1]]),o.push([h[0]-c,t[1]]),this._add90DegArc(o,[h[0]-c,t[1]],[h[0],t[1]-c],[h[0],t[1]]),o.push([h[0],h[1]+c]),this._add90DegArc(o,[h[0],h[1]+c],[h[0]-c,h[1]],h),o.push([t[0]+c,h[1]]),this._add90DegArc(o,[t[0]+c,h[1]],[t[0],h[1]+c],[t[0],h[1]]),o.push([t[0],t[1]-c]),this._add90DegArc(o,[t[0],t[1]-c],[t[0]+c,t[1]],t),o.push([t[0]+c+.75*(e-2*c),t[1]]);break}case"ParallelOffsetByValue":{if(i.length<2||0===this._width)break;const s=this._offsetPath(i,.5*this._width);s&&t.push(s);const h=this._offsetPath(i,.5*-this._width);h&&t.push(h);break}default:t.push(i)}}return t}}function u(s){return"ParallelOffsetByValue"===s}export{c as EffectControlMeasureLine};
2
+ import{inchesPerMeter as s}from"../../../core/units.js";import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectMultipath as i}from"../../../geometry/geometryCursorCollectUtils.js";import h from"../../../geometry/SpatialReference.js";import{getPathLength as e}from"../../../geometry/support/coordsUtils.js";import{setId as r}from"../CIMCursor.js";import{lazyOffsetOperator as _}from"../CIMEffects.js";class c{static{this.instance=null}static local(){return null===c.instance&&(c.instance=new c),c.instance}execute(s,t,i){return new o(s,t,i)}}class o{constructor(s,t,i){this._defaultPointSize=20,this._inputGeometries=s,this._geomUnitsPerPoint=i.geomUnitsPerPoint??1,this._scale=i?.scale,this._rule=t.rule??"FullGeometry",this._spatialReference=i?.spatialReference??h.WebMercator,this._width=this._computeWidth(t.width??25),this._defaultSize=this._defaultPointSize*this._geomUnitsPerPoint}next(){let s;for(;s=this._inputGeometries.next();){const h=this._processGeom(i(s));if(h?.length)return t.fromJSONCIM({paths:h})}return null}_computeWidth(t){if(!u(this._rule)||null==this._scale||!this._spatialReference.metersPerUnit)return t*this._geomUnitsPerPoint;const i=this._scale/(96*s*this._spatialReference.metersPerUnit);return t/(this._spatialReference.metersPerUnit*i)}_clone(s){return[s[0],s[1]]}_mid(s,t){return[(s[0]+t[0])/2,(s[1]+t[1])/2]}_mix(s,t,i,h){return[s[0]*t+i[0]*h,s[1]*t+i[1]*h]}_add(s,t){return[s[0]+t[0],s[1]+t[1]]}_add2(s,t,i){return[s[0]+t,s[1]+i]}_sub(s,t){return[s[0]-t[0],s[1]-t[1]]}_dist(s,t){return Math.sqrt((s[0]-t[0])*(s[0]-t[0])+(s[1]-t[1])*(s[1]-t[1]))}_norm(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}_normalize(s,t=1){const i=t/this._norm(s);s[0]*=i,s[1]*=i}_leftPerpendicular(s){const t=-s[1],i=s[0];s[0]=t,s[1]=i}_leftPerp(s){return[-s[1],s[0]]}_rightPerpendicular(s){const t=s[1],i=-s[0];s[0]=t,s[1]=i}_rightPerp(s){return[s[1],-s[0]]}_dotProduct(s,t){return s[0]*t[0]+s[1]*t[1]}_crossProduct(s,t){return s[0]*t[1]-s[1]*t[0]}_rotateDirect(s,t,i){const h=s[0]*t-s[1]*i,e=s[0]*i+s[1]*t;s[0]=h,s[1]=e}_makeCtrlPt(s){const t=[s[0],s[1]];return r(t,1),t}_addAngledTicks(s,t,i,h){const e=this._sub(i,t);this._normalize(e);const r=this._crossProduct(e,this._sub(h,t));let _;_=r>0?this._rightPerp(e):this._leftPerp(e);const c=Math.abs(r)/2,o=[];o.push([t[0]+(_[0]-e[0])*c,t[1]+(_[1]-e[1])*c]),o.push(t),o.push(i),o.push([i[0]+(_[0]+e[0])*c,i[1]+(_[1]+e[1])*c]),s.push(o)}_addBezier2(s,t,i,h,e){if(0===e--)return void s.push(h);const r=this._mid(t,i),_=this._mid(i,h),c=this._mid(r,_);this._addBezier2(s,t,r,c,e),this._addBezier2(s,c,_,h,e)}_addBezier3(s,t,i,h,e,r){if(0===r--)return void s.push(e);const _=this._mid(t,i),c=this._mid(i,h),o=this._mid(h,e),u=this._mid(_,c),a=this._mid(c,o),n=this._mid(u,a);this._addBezier3(s,t,_,u,n,r),this._addBezier3(s,n,a,o,e,r)}_add90DegArc(s,t,i,h,e){const r=e??this._crossProduct(this._sub(i,t),this._sub(h,t))>0,_=this._mid(t,i),c=this._sub(_,t);r?this._leftPerpendicular(c):this._rightPerpendicular(c),_[0]+=c[0],_[1]+=c[1],this._addBezier3(s,t,this._mix(t,.33333,_,.66667),this._mix(i,.33333,_,.66667),i,4)}_addArrow(s,t,i){const h=t[0],e=t[1],r=t[t.length-1],_=this._sub(h,e),c=this._norm(_);this._normalize(_);const o=Math.abs(this._crossProduct(_,this._sub(r,e)));let u=this._dotProduct(_,this._sub(r,e));u<.05*c?u=.05*c:u>.95*c&&(u=.95*c);const a=.5*o,n=this._leftPerp(_),p=[e[0]+_[0]*u,e[1]+_[1]*u],d=t.length-1,l=[];l.push(i?[-n[0],-n[1]]:n);let b=[-_[0],-_[1]];for(let P=1;P<d-1;P++){const s=this._sub(t[P+1],t[P]);this._normalize(s);const i=this._dotProduct(s,b),h=this._crossProduct(s,b),e=Math.sqrt((1+i)/2),r=this._sub(s,b);this._normalize(r),r[0]/=e,r[1]/=e,l.push(h<0?[-r[0],-r[1]]:r),b=s}l.push(this._rightPerp(b));for(let P=l.length-1;P>0;P--)s.push([t[P][0]+l[P][0]*a,t[P][1]+l[P][1]*a]);s.push([p[0]+l[0][0]*a,p[1]+l[0][1]*a]),s.push([p[0]+l[0][0]*o,p[1]+l[0][1]*o]),s.push(h),s.push([p[0]-l[0][0]*o,p[1]-l[0][1]*o]),s.push([p[0]-l[0][0]*a,p[1]-l[0][1]*a]);for(let P=1;P<l.length;P++)s.push([t[P][0]-l[P][0]*a,t[P][1]-l[P][1]*a])}_addDash(s,t,i){const h=this._norm(i)/7;this._normalize(i);let e=[];for(let r=0;r<=7;r++)e.push([t[0]+i[0]*r*h,t[1]+i[1]*r*h]),1&r&&(s.push(e),e=[])}_cp2(s,t,i){return s.length>=2?s[1]:this._add2(s[0],t*this._defaultSize,i*this._defaultSize)}_cp3(s,t,i,h){if(s.length>=3)return s[2];const e=this._mix(s[0],1-i,t,i),r=this._sub(t,s[0]);return this._normalize(r),this._rightPerpendicular(r),[e[0]+r[0]*h*this._defaultSize,e[1]+r[1]*h*this._defaultSize]}_arrowPath(s){if(s.length>2)return s;const t=s[0],i=this._cp2(s,-4,0),h=this._sub(t,i);this._normalize(h);const e=this._rightPerp(h);return[t,i,[t[0]+(e[0]-h[0])*this._defaultSize,t[1]+(e[1]-h[1])*this._defaultSize]]}_arrowLastSeg(s){const t=s[0],i=this._cp2(s,-4,0);let h;if(s.length>=3)h=s[s.length-1];else{const s=this._sub(t,i);this._normalize(s);const e=this._rightPerp(s);h=[t[0]+(e[0]-s[0])*this._defaultSize,t[1]+(e[1]-s[1])*this._defaultSize]}return[i,h]}_offsetPath(s,h){const{offsetExecute:e}=_.module,r=e({paths:[s],spatialReference:this._spatialReference.toJSON()},h,{joins:"miter",miterLimit:4}),[c]=i(t.fromJSONCIM(r));return c?.length?c:null}_processGeom(s){if(!s)return null;const t=[];for(const i of s){const s=i.length>1&&e(i)<this._defaultSize;if(!i||0===i.length||s)continue;const h=i.length;let _=i[0];switch(this._rule){case"PerpendicularFromFirstSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,4),e=[];e.push(h),e.push(this._mid(_,s)),t.push(e);break}case"ReversedFirstSegment":{const s=this._cp2(i,0,-1);t.push([s,_]);break}case"PerpendicularToSecondSegment":{if(i.length<3)return[];const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=[];e.push(this._mid(s,h)),e.push(_),t.push(e);break}case"SecondSegmentWithTicks":{if(i.length<3)return[];const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=this._sub(h,s);let r;r=this._crossProduct(e,this._sub(_,s))>0?this._rightPerp(e):this._leftPerp(e);const c=[];c.push([s[0]+(r[0]-e[0])/3,s[1]+(r[1]-e[1])/3]),c.push(s),c.push(h),c.push([h[0]+(r[0]+e[0])/3,h[1]+(r[1]+e[1])/3]),t.push(c);break}case"DoublePerpendicular":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,3),e=this._mid(_,s),r=this._sub(e,h);this._normalize(r);const c=this._crossProduct(r,this._sub(_,h));this._leftPerpendicular(r);const o=[];o.push(_),o.push([h[0]+r[0]*c,h[1]+r[1]*c]),t.push(o);const u=[];u.push([h[0]-r[0]*c,h[1]-r[1]*c]),u.push(s),t.push(u);break}case"OppositeToFirstSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,3),e=this._mid(_,s),r=this._sub(e,h);this._normalize(r);const c=this._crossProduct(r,this._sub(_,h));this._leftPerpendicular(r);const o=[];o.push([h[0]+r[0]*c,h[1]+r[1]*c]),o.push([h[0]-r[0]*c,h[1]-r[1]*c]),t.push(o);break}case"TriplePerpendicular":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,4),e=this._mid(_,s),r=this._sub(e,h);this._normalize(r);const c=this._crossProduct(r,this._sub(_,h));this._leftPerpendicular(r);const o=[];o.push([h[0]+r[0]*c*.8,h[1]+r[1]*c*.8]),o.push([e[0]+.8*(_[0]-e[0]),e[1]+.8*(_[1]-e[1])]),t.push(o),t.push([h,e]);const u=[];u.push([h[0]-r[0]*c*.8,h[1]-r[1]*c*.8]),u.push([e[0]+.8*(s[0]-e[0]),e[1]+.8*(s[1]-e[1])]),t.push(u);break}case"HalfCircleFirstSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,4),e=this._mid(_,s);let r=this._sub(s,_);const c=Math.cos(Math.PI/18),o=Math.sin(Math.PI/18),u=Math.sqrt((1+c)/2),a=Math.sqrt((1-c)/2),n=[];let p;this._crossProduct(r,this._sub(h,_))>0?(n.push(_),r=this._sub(_,e),p=s):(n.push(s),r=this._sub(s,e),p=_),this._rotateDirect(r,u,a),r[0]/=u,r[1]/=u;for(let t=1;t<=18;t++)n.push(this._add(e,r)),this._rotateDirect(r,c,o);n.push(p),t.push(n);break}case"HalfCircleSecondSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,1,-1);let e=this._sub(_,s);this._normalize(e);const r=this._crossProduct(e,this._sub(h,s))/2;this._leftPerpendicular(e);const c=[s[0]+e[0]*r,s[1]+e[1]*r];e=this._sub(s,c);const o=Math.cos(Math.PI/18);let u=Math.sin(Math.PI/18);r>0&&(u=-u);const a=[s];for(let t=1;t<=18;t++)this._rotateDirect(e,o,u),a.push(this._add(c,e));t.push(a);break}case"HalfCircleExtended":{const s=this._cp2(i,0,-2),e=this._cp3(i,s,1,-1);let r;if(h>=4)r=i[3];else{const t=this._sub(_,s);r=this._add(e,t)}const c=this._dist(s,e)/2/.75,o=this._sub(s,_);this._normalize(o,c);const u=this._sub(e,r);this._normalize(u,c);const a=[r,e];t.push(a);const n=[this._clone(e)];this._addBezier3(n,e,this._add(e,u),this._add(s,o),s,4),n.push(_),t.push(n);break}case"OpenCircle":{const s=this._cp2(i,-2,0),h=this._sub(s,_),e=Math.cos(Math.PI/18),r=-Math.sin(Math.PI/18),c=[s];for(let t=1;t<=33;t++)this._rotateDirect(h,e,r),c.push(this._add(_,h));t.push(c);break}case"CoverageEdgesWithTicks":{const s=this._cp2(i,0,-1);let e,r;if(h>=3)e=i[2];else{const t=this._sub(s,_),i=this._leftPerp(t);e=[_[0]+i[0]-.25*t[0],_[1]+i[1]-.25*t[1]]}if(h>=4)r=i[3];else{const t=this._mid(_,s),i=this._sub(_,s);this._normalize(i),this._leftPerpendicular(i);const h=this._crossProduct(i,this._sub(e,t));this._rightPerpendicular(i),r=[e[0]+i[0]*h*2,e[1]+i[1]*h*2]}const c=this._sub(s,_);let o,u;o=this._crossProduct(c,this._sub(e,_))>0?this._rightPerp(c):this._leftPerp(c),u=[],u.push(e),u.push(_),u.push([_[0]+(o[0]-c[0])/3,_[1]+(o[1]-c[1])/3]),t.push(u),o=this._crossProduct(c,this._sub(r,s))>0?this._rightPerp(c):this._leftPerp(c),u=[],u.push([s[0]+(o[0]+c[0])/3,s[1]+(o[1]+c[1])/3]),u.push(s),u.push(r),t.push(u);break}case"GapExtentWithDoubleTicks":{const s=this._cp2(i,0,2),e=this._cp3(i,s,0,1);let r;if(h>=4)r=i[3];else{const t=this._sub(s,_);r=this._add(e,t)}this._addAngledTicks(t,_,s,this._mid(e,r)),this._addAngledTicks(t,e,r,this._mid(_,s));break}case"GapExtentMidline":{const s=this._cp2(i,2,0),e=this._cp3(i,s,0,1);let r;if(h>=4)r=i[3];else{const t=this._sub(s,_);r=this._add(e,t)}const c=[];c.push(this._mid(_,e)),c.push(this._mid(s,r)),t.push(c);break}case"Chevron":{const s=this._cp2(i,-1,-1);let e;if(h>=3)e=i[2];else{const t=this._sub(s,_);this._leftPerpendicular(t),e=this._add(_,t)}t.push([s,this._makeCtrlPt(_),e]);break}case"PerpendicularWithArc":{const s=this._cp2(i,0,-2),e=this._cp3(i,s,.5,-1),r=this._sub(s,_),c=this._norm(r);r[0]/=c,r[1]/=c;const o=this._crossProduct(r,this._sub(e,_));let u=this._dotProduct(r,this._sub(e,_));u<.05*c?u=.05*c:u>.95*c&&(u=.95*c);const a=[_[0]+r[0]*u,_[1]+r[1]*u];let n=this._leftPerp(r),p=[];if(p.push([a[0]-n[0]*o,a[1]-n[1]*o]),p.push([a[0]+n[0]*o,a[1]+n[1]*o]),t.push(p),h>=4){const s=i[3];let h=this._dotProduct(r,this._sub(s,_));h<.1*c?h=.1*c:h>.9*c&&(h=.9*c);const e=[_[0]+r[0]*h,_[1]+r[1]*h],o=this._crossProduct(r,this._sub(s,_)),u=[];u.push([e[0]-n[0]*o,e[1]-n[1]*o]),u.push([e[0]+n[0]*o,e[1]+n[1]*o]),t.push(u)}const d=[s[0]+n[0]*o,s[1]+n[1]*o];n=this._sub(s,d);const l=Math.cos(Math.PI/18);let b=Math.sin(Math.PI/18);o<0&&(b=-b),p=[_,s];for(let t=1;t<=9;t++)this._rotateDirect(n,l,b),p.push(this._add(d,n));t.push(p);break}case"ClosedHalfCircle":{const s=this._cp2(i,2,0),h=this._mid(_,s),e=this._sub(s,h),r=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),o=[_,s];for(let t=1;t<=18;t++)this._rotateDirect(e,r,c),o.push(this._add(h,e));t.push(o);break}case"TripleParallelExtended":{const s=this._cp2(i,0,-2),h=this._cp3(i,s,1,-2),e=this._mid(_,s),c=this._sub(h,s);this._normalize(c);const o=Math.abs(this._crossProduct(c,this._sub(e,s)))/2,u=this._dist(s,h),a=[s,_];a.push([_[0]+c[0]*u*.5,_[1]+c[1]*u*.5]),t.push(a);const n=[];n.push([e[0]-c[0]*o,e[1]-c[1]*o]),n.push([e[0]+c[0]*u*.375,e[1]+c[1]*u*.375]),r(n[n.length-1],1),n.push([e[0]+c[0]*u*.75,e[1]+c[1]*u*.75]),t.push(n);const p=[s,h];t.push(p);break}case"ParallelWithTicks":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_)),c=this._leftPerp(e);this._addAngledTicks(t,_,s,h),this._addAngledTicks(t,this._add2(_,c[0]*r,c[1]*r),this._add2(s,c[0]*r,c[1]*r),this._mid(_,s));break}case"Parallel":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._leftPerp(e),c=this._crossProduct(e,this._sub(h,_));let o=[_,s];t.push(o),o=[],o.push([_[0]+r[0]*c,_[1]+r[1]*c]),o.push([s[0]+r[0]*c,s[1]+r[1]*c]),t.push(o);break}case"PerpendicularToFirstSegment":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._mid(_,s),r=this._sub(s,_);this._normalize(r);const c=this._crossProduct(r,this._sub(h,_));this._leftPerpendicular(r);const o=[];o.push([e[0]-r[0]*c*.25,e[1]-r[1]*c*.25]),o.push([e[0]+r[0]*c*1.25,e[1]+r[1]*c*1.25]),t.push(o);break}case"ParallelOffset":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e);const c=[];c.push([_[0]-e[0]*r,_[1]-e[1]*r]),c.push([s[0]-e[0]*r,s[1]-e[1]*r]),t.push(c);const o=[];o.push([_[0]+e[0]*r,_[1]+e[1]*r]),o.push([s[0]+e[0]*r,s[1]+e[1]*r]),t.push(o);break}case"OffsetOpposite":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e);const c=[];c.push([_[0]-e[0]*r,_[1]-e[1]*r]),c.push([s[0]-e[0]*r,s[1]-e[1]*r]),t.push(c);break}case"OffsetSame":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e);const c=[];c.push([_[0]+e[0]*r,_[1]+e[1]*r]),c.push([s[0]+e[0]*r,s[1]+e[1]*r]),t.push(c);break}case"CircleWithArc":{let s=this._cp2(i,3,0);const e=this._cp3(i,s,.5,-1);let c,o;if(h>=4)c=i[3],o=this._crossProduct(this._sub(c,s),this._sub(e,s))>0;else{c=s,o=this._crossProduct(this._sub(c,_),this._sub(e,_))>0;const t=24*this._geomUnitsPerPoint,i=this._sub(c,_);this._normalize(i,t);const h=Math.sqrt(2)/2;this._rotateDirect(i,h,o?h:-h),s=this._add(_,i)}const u=this._sub(s,_),a=Math.cos(Math.PI/18),n=Math.sin(Math.PI/18),p=[s];for(let t=1;t<=36;t++)this._rotateDirect(u,a,n),p.push(this._add(_,u));this._add90DegArc(p,s,c,e,o),r(p[p.length-8],1),t.push(p);break}case"DoubleJog":{let s,e=this._cp2(i,-3,1),r=this._cp3(i,e,-1,-.5);if(h>=4)s=i[3];else{const t=_;_=e,s=r;const i=this._dist(_,t),h=this._dist(s,t);let c=30*this._geomUnitsPerPoint;.5*i<c&&(c=.5*i),.5*h<c&&(c=.5*h),e=this._mix(_,c/i,t,(i-c)/i),r=this._mix(s,c/h,t,(h-c)/h)}const c=this._mid(_,e),o=this._mid(s,r),u=this._dist(_,e),a=this._dist(r,s);let n=Math.min(u,a)/8;n=Math.min(n,24*this._geomUnitsPerPoint);const p=Math.cos(Math.PI/4);let d=this._sub(_,e);this._normalize(d,n),this._crossProduct(d,this._sub(s,e))>0?this._rotateDirect(d,p,-p):this._rotateDirect(d,p,p);let l=[];l.push(e),l.push(this._add(c,d)),l.push(this._sub(c,d)),l.push(_),t.push(l),d=this._sub(s,r),this._normalize(d,n),this._crossProduct(d,this._sub(_,r))<0?this._rotateDirect(d,p,p):this._rotateDirect(d,p,-p),l=[],l.push(r),l.push(this._add(o,d)),l.push(this._sub(o,d)),l.push(s),t.push(l);break}case"PerpendicularOffset":{const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=this._sub(h,s);this._crossProduct(e,this._sub(_,s))>0?this._rightPerpendicular(e):this._leftPerpendicular(e);const r=[e[0]/8,e[1]/8],c=this._sub(this._mid(s,h),r);t.push([c,_]);break}case"LineExcludingLastSegment":{const s=this._arrowPath(i),h=[];let e=s.length-2;for(;e--;)h.push(s[e]);t.push(h);break}case"MultivertexArrow":{const s=this._arrowPath(i),h=[];this._addArrow(h,s,!1),t.push(h);break}case"CrossedArrow":{const s=this._arrowPath(i),h=[];this._addArrow(h,s,!0),t.push(h);break}case"ChevronArrow":{const[s,h]=this._arrowLastSeg(i),e=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);const o=this._crossProduct(r,this._sub(h,s));let u=this._dotProduct(r,this._sub(h,s));u<.05*c?u=.05*c:u>.95*c-e&&(u=.95*c-e);const a=[s[0]+r[0]*u,s[1]+r[1]*u],n=this._leftPerp(r),p=[];p.push([a[0]+n[0]*o+r[0]*e,a[1]+n[1]*o+r[1]*e]),p.push(_),p.push([a[0]-n[0]*o+r[0]*e,a[1]-n[1]*o+r[1]*e]),t.push(p);break}case"ChevronArrowOffset":{const[s,h]=this._arrowLastSeg(i),e=this._sub(_,s),r=this._norm(e);this._normalize(e);const c=this._crossProduct(e,this._sub(h,s));let o=this._dotProduct(e,this._sub(h,s));o<.05*r?o=.05*r:o>.95*r&&(o=.95*r);const u=[s[0]+e[0]*o,s[1]+e[1]*o];this._leftPerpendicular(e);const a=[];a.push([u[0]+e[0]*c*.5,u[1]+e[1]*c*.5]),a.push(this._mid(u,_)),a.push([u[0]-e[0]*c*.5,u[1]-e[1]*c*.5]),t.push(a);break}case"PartialFirstSegment":{const[s,h]=this._arrowLastSeg(i),e=this._sub(_,s),r=this._norm(e);this._normalize(e);let c=this._dotProduct(e,this._sub(h,s));c<.05*r?c=.05*r:c>.95*r&&(c=.95*r);const o=[s[0]+e[0]*c,s[1]+e[1]*c];t.push([s,o]);break}case"Arch":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,1),e=this._sub(_,s),r=this._mix(h,1,e,.55),c=this._mix(h,1,e,-.55),o=[_];this._addBezier2(o,_,r,h,4),this._addBezier2(o,h,c,s,4),t.push(o);break}case"CurvedParallelTicks":{const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=this._sub(h,s);this._crossProduct(e,this._sub(_,s))>0?this._rightPerpendicular(e):this._leftPerpendicular(e);const r=[e[0]/8,e[1]/8],c=this._sub(this._mid(s,h),r),o=this._sub(this._mix(s,.75,h,.25),r),u=this._sub(this._mix(s,.25,h,.75),r),a=[s];this._addBezier2(a,s,o,c,3),this._addBezier2(a,c,u,h,3),t.push(a);for(let i=0;i<8;i++){const s=a[2*i+1],h=[this._clone(s)];h.push(this._add(s,[e[0]/4,e[1]/4])),t.push(h)}break}case"Arc90Degrees":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,1),e=[s];this._add90DegArc(e,s,_,h),t.push(e);break}case"TipWithPerpendicularAndTicks":{const[s,h]=this._arrowLastSeg(i),e=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);let o=this._crossProduct(r,this._sub(h,s)),u=this._dotProduct(r,this._sub(h,s));u<.05*c?u=.05*c:u>.95*c-e&&(u=.95*c-e);const a=this._leftPerp(r),n=[_[0]-r[0]*e,_[1]-r[1]*e],p=.5*Math.max(c-u-e,e);o=Math.abs(o);const d=[];d.push([n[0]+a[0]*(o+p)-r[0]*p,n[1]+a[1]*(o+p)-r[1]*p]),d.push([n[0]+a[0]*o,n[1]+a[1]*o]),d.push([n[0]-a[0]*o,n[1]-a[1]*o]),d.push([n[0]-a[0]*(o+p)-r[0]*p,n[1]-a[1]*(o+p)-r[1]*p]),t.push(d),t.push([n,_]);break}case"ConcentricCircles":{const s=this._cp2(i,1,0),e=this._cp3(i,s,2,0),c=Math.cos(Math.PI/18),o=Math.sin(Math.PI/18);let u=this._dist(s,_),a=[u,0],n=[];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,o);if(t.push(n),h>=4){n=[];const s=i[3];u=this._dist(s,_),a=[u,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),0===t&&(n.push(this._add(_,a)),r(n[1],1)),this._rotateDirect(a,c,o);t.push(n)}n=[],u=this._dist(e,_),a=[u,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,o);t.push(n);break}case"DoubleJogArrow":{_=this._arrowPath(i)[0];const[s,h]=this._arrowLastSeg(i),e=this._sub(_,s),r=this._norm(e);this._normalize(e);const c=Math.abs(this._crossProduct(e,this._sub(h,_)));let o=Math.abs(this._dotProduct(e,this._sub(h,_)));o<.05*r?o=.05*r:o>.95*r&&(o=.95*r);const u=Math.max(c,o),a=this._leftPerp(e);let n=[];const p=[_[0]-e[0]*o*.5+a[0]*c*.5,_[1]-e[1]*o*.5+a[1]*c*.5];n.push([p[0],p[1]]),p[0]+=e[0]*u*.5+a[0]*u*.4,p[1]+=e[1]*u*.5+a[1]*u*.4,n.push([p[0],p[1]]),p[0]-=a[0]*u*.25,p[1]-=a[1]*u*.25,n.push([p[0],p[1]]),p[0]+=e[0]*u*.5+a[0]*u*.4,p[1]+=e[1]*u*.5+a[1]*u*.4,n.push([p[0],p[1]]),t.push(n),n=[],p[0]=_[0]-e[0]*o*.5-a[0]*c*.5,p[1]=_[1]-e[1]*o*.5-a[1]*c*.5,n.push([p[0],p[1]]),p[0]+=e[0]*u*.5-a[0]*u*.4,p[1]+=e[1]*u*.5-a[1]*u*.4,n.push([p[0],p[1]]),p[0]+=a[0]*u*.25,p[1]+=a[1]*u*.25,n.push([p[0],p[1]]),p[0]+=e[0]*u*.5-a[0]*u*.4,p[1]+=e[1]*u*.5-a[1]*u*.4,n.push([p[0],p[1]]),t.push(n);break}case"LinkedChevrons":{const s=this._cp2(i,-5,0),h=this._cp3(i,s,-.2,1),e=this._sub(_,s);this._normalize(e);const r=this._leftPerp(e),c=Math.abs(this._crossProduct(e,this._sub(h,s)));t.push([s,_]);const o=[];o.push([_[0]-e[0]*c+r[0]*c,_[1]-e[1]*c+r[1]*c]),o.push(_),o.push([_[0]-e[0]*c-r[0]*c,_[1]-e[1]*c-r[1]*c]),t.push(o),this._addDash(t,s,[-e[0]*c+r[0]*c,-e[1]*c+r[1]*c]),this._addDash(t,s,[-e[0]*c-r[0]*c,-e[1]*c-r[1]*c]);break}case"SegmentThenHalfCircle":{const s=this._cp2(i,2,0),e=this._cp3(i,s,1.5,0);let r;r=h>=4?i[3]:this._cp3(i,s,1.25,-.5);const c=this._sub(s,_);this._normalize(c);const o=.5*this._dist(s,e),u=this._crossProduct(c,this._sub(r,_))>0,a=Math.cos(Math.PI/18);let n=Math.sin(Math.PI/18);u&&(n=-n);const p=[_,s];c[0]*=o,c[1]*=o;const d=this._add(s,c);c[0]=-c[0],c[1]=-c[1];for(let t=1;t<=18;t++)this._rotateDirect(c,a,n),p.push(this._add(d,c));t.push(p);break}case"LineWithStraightTicks":{const s=this._cp2(i,-2,1),h=this._cp3(i,s,-1,-.5),e=this._sub(h,s);this._normalize(e);const r=this._dotProduct(e,this._sub(s,_)),c=this._dotProduct(e,this._sub(h,_));let o=[_];o.push([_[0]+e[0]*r,_[1]+e[1]*r]),o.push(s),t.push(o),o=[_],o.push([_[0]+e[0]*c,_[1]+e[1]*c]),o.push(h),t.push(o);break}case"DoubleCurve":{const s=this._cp2(i,-5,-1),h=this._cp3(i,s,2,0),e=Math.atan2(1,5),c=Math.cos(e),o=Math.sin(e),u=this._sub(s,_),a=this._dist(_,s);this._normalize(u),this._rotateDirect(u,c,-o);const n=[_];n.push([_[0]+u[0]*a*.5,_[1]+u[1]*a*.5]),r(n[1],1),n.push([_[0]+u[0]*a*.8,_[1]+u[1]*a*.8]),this._addBezier2(n,n[2],[_[0]+u[0]*a,_[1]+u[1]*a],s,3);const p=this._sub(h,s),d=this._dist(s,h);this._normalize(p),this._rotateDirect(p,c,-o),this._addBezier2(n,s,[h[0]-p[0]*d,h[1]-p[1]*d],[h[0]-p[0]*d*.8,h[1]-p[1]*d*.8],3),n.push(h),t.push(n);break}case"ParallelWithTicksByWidth":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,3),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e),r>0?(this._addAngledTicks(t,_,[_[0]+e[0]*r,_[1]+e[1]*r],s),this._addAngledTicks(t,s,[s[0]+e[0]*r,s[1]+e[1]*r],_)):(this._addAngledTicks(t,[_[0]+e[0]*r,_[1]+e[1]*r],_,s),this._addAngledTicks(t,[s[0]+e[0]*r,s[1]+e[1]*r],_,s));break}case"EnclosingRoundedRectangle":{const s=this._cp2(i,3,-2),t=[Math.min(_[0],s[0]),Math.max(_[1],s[1])],h=[Math.max(_[0],s[0]),Math.min(_[1],s[1])],e=h[0]-t[0],r=t[1]-h[1],c=Math.min(e,r)/10,o=[];o.push([t[0]+c+.75*(e-2*c),t[1]]),o.push([h[0]-c,t[1]]),this._add90DegArc(o,[h[0]-c,t[1]],[h[0],t[1]-c],[h[0],t[1]]),o.push([h[0],h[1]+c]),this._add90DegArc(o,[h[0],h[1]+c],[h[0]-c,h[1]],h),o.push([t[0]+c,h[1]]),this._add90DegArc(o,[t[0]+c,h[1]],[t[0],h[1]+c],[t[0],h[1]]),o.push([t[0],t[1]-c]),this._add90DegArc(o,[t[0],t[1]-c],[t[0]+c,t[1]],t),o.push([t[0]+c+.75*(e-2*c),t[1]]);break}case"ParallelOffsetByValue":{if(i.length<2||0===this._width)break;const s=this._offsetPath(i,.5*this._width);s&&t.push(s);const h=this._offsetPath(i,.5*-this._width);h&&t.push(h);break}default:t.push(i)}}return t}}function u(s){return"ParallelOffsetByValue"===s}export{c as EffectControlMeasureLine};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import i from"../../../geometry/SpatialReference.js";import{lazyBufferOperator as e,clipCursorToTileExtent as n}from"../CIMEffects.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,i,e){return new r(t,i,e)}}class r{constructor(t,i,e){this._inputGeometries=t,this._tileKey=e.tileKey,this._maxInflateSize=e.maxInflateSize*e.geomUnitsPerPoint,this._preventClipping=e.preventClipping,this._width=(void 0!==i.width?i.width:2)*e.geomUnitsPerPoint,i.method,this._option=i.option??"Accurate"}next(){let s;for(;s=this._inputGeometries.next();){if("esriGeometryEnvelope"===s.geometryType&&this._width>0){const i=s.asJSON();return Math.min(i.xmax-i.xmin,i.ymax-i.ymin)-2*this._width<0?s:t.fromJSONCIM({paths:[[[i.xmin+this._width,i.ymin+this._width],[i.xmax-this._width,i.ymin+this._width],[i.xmax-this._width,i.ymax-this._width],[i.xmin+this._width,i.ymax-this._width],[i.xmin+this._width,i.ymin+this._width]],[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]})}if("esriGeometryPolygon"===s.geometryType){if(0===this._width)return s.clone();const t=e.module,r=!this._preventClipping&&this._tileKey?n(s,this._maxInflateSize,!0):s.clone();if(!r)continue;const o={...r.asJSON(),spatialReference:{wkid:i.WebMercator.wkid}},m=t.execute(o,-this._width);if(m)for(const i of m.rings)if(i){r.startPath();for(const t of i.reverse())r.pushXY(t[0],r.yFactor*t[1])}return r}}return null}}export{s as EffectDonut};
2
+ import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import i from"../../../geometry/SpatialReference.js";import{lazyBufferOperator as e,clipCursorToTileExtent as n}from"../CIMEffects.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,i,e){return new r(t,i,e)}}class r{constructor(t,i,e){this._inputGeometries=t,this._tileKey=e.tileKey,this._maxInflateSize=e.maxInflateSize*e.geomUnitsPerPoint,this._preventClipping=e.preventClipping,this._width=(void 0!==i.width?i.width:2)*e.geomUnitsPerPoint,i.method,this._option=i.option??"Accurate"}next(){let s;for(;s=this._inputGeometries.next();){if("esriGeometryEnvelope"===s.geometryType&&this._width>0){const i=s.asJSON();return Math.min(i.xmax-i.xmin,i.ymax-i.ymin)-2*this._width<0?s:t.fromJSONCIM({paths:[[[i.xmin+this._width,i.ymin+this._width],[i.xmax-this._width,i.ymin+this._width],[i.xmax-this._width,i.ymax-this._width],[i.xmin+this._width,i.ymax-this._width],[i.xmin+this._width,i.ymin+this._width]],[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]})}if("esriGeometryPolygon"===s.geometryType){if(0===this._width)return s.clone();const{bufferExecute:t}=e.module,r=!this._preventClipping&&this._tileKey?n(s,this._maxInflateSize,!0):s.clone();if(!r)continue;const o=t({...r.asJSON(),spatialReference:{wkid:i.WebMercator.wkid}},-this._width);if(o)for(const i of o.rings)if(i){r.startPath();for(const t of i.reverse())r.pushXY(t[0],r.yFactor*t[1])}return r}}return null}}export{s as EffectDonut};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import t from"../../../geometry/SpatialReference.js";import{getCursorBoundsXY as r}from"../../../geometry/support/boundsUtils.js";import{lazyConvexHullOperator as n}from"../CIMEffects.js";class o{static{this.instance=null}static local(){return null===o.instance&&(o.instance=new o),o.instance}execute(e,t,r){return new s(e,t,r)}}class s{constructor(e,t,r){this._inputGeometries=e,this._medhod=t.method}next(){let e=this._inputGeometries.next();const t=this._medhod;for(;null!=e;){if(e.totalSize>0)switch(t){case"RectangularBox":return i(e);case"ConvexHull":return this._constructConvexHull(e);default:return u(e)}e=this._inputGeometries.next()}return null}_constructConvexHull(r){switch(r.geometryType){case"esriGeometryPolyline":case"esriGeometryPolygon":{const o=n.module,s={...r.asJSON(),spatialReference:{wkid:t.WebMercator.wkid}},i=o.execute(s);return i?e.fromJSONCIM(i):null}case"esriGeometryEnvelope":return r;default:return null}}}function i(t){const n=r(t),o={xmin:n[0],ymin:n[1],xmax:n[2],ymax:n[3]};return e.fromJSONCIM(o)}function u(t){switch(t.geometryType){case"esriGeometryPolyline":{const r=[];for(;t.nextPath();)l(t,r);return e.fromJSONCIM({rings:r})}case"esriGeometryPolygon":case"esriGeometryEnvelope":return t;default:return null}}function l(e,t){if(e.seekPathStart(),!e.nextPoint())return;const r=e.x,n=e.y,o=[[r,n]];for(t.push(o);e.nextPoint();)o.push([e.x,e.y]);o.push([r,n])}export{o as EffectEnclosingPolygon};
2
+ import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import t from"../../../geometry/SpatialReference.js";import{getCursorBoundsXY as r}from"../../../geometry/support/boundsUtils.js";import{lazyConvexHullOperator as n}from"../CIMEffects.js";class o{static{this.instance=null}static local(){return null===o.instance&&(o.instance=new o),o.instance}execute(e,t,r){return new s(e,t,r)}}class s{constructor(e,t,r){this._inputGeometries=e,this._medhod=t.method}next(){let e=this._inputGeometries.next();const t=this._medhod;for(;null!=e;){if(e.totalSize>0)switch(t){case"RectangularBox":return i(e);case"ConvexHull":return this._constructConvexHull(e);default:return u(e)}e=this._inputGeometries.next()}return null}_constructConvexHull(r){switch(r.geometryType){case"esriGeometryPolyline":case"esriGeometryPolygon":{const{convexHullExecute:o}=n.module,s=o({...r.asJSON(),spatialReference:{wkid:t.WebMercator.wkid}});return s?e.fromJSONCIM(s):null}case"esriGeometryEnvelope":return r;default:return null}}}function i(t){const n=r(t),o={xmin:n[0],ymin:n[1],xmax:n[2],ymax:n[3]};return e.fromJSONCIM(o)}function u(t){switch(t.geometryType){case"esriGeometryPolyline":{const r=[];for(;t.nextPath();)l(t,r);return e.fromJSONCIM({rings:r})}case"esriGeometryPolygon":case"esriGeometryEnvelope":return t;default:return null}}function l(e,t){if(e.seekPathStart(),!e.nextPoint())return;const r=e.x,n=e.y,o=[[r,n]];for(t.push(o);e.nextPoint();)o.push([e.x,e.y]);o.push([r,n])}export{o as EffectEnclosingPolygon};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{collectPath as t}from"../../../geometry/geometryCursorCollectUtils.js";import r from"../../../geometry/SpatialReference.js";import{isExtent as s}from"../../../geometry/support/jsonTypeUtils.js";import{clipCursorToTileExtent as i,lazySimplifyOGCOperator as o,lazyOffsetOperator as n,lazyGraphicBufferOperator as m}from"../CIMEffects.js";import{CurveHelper as f,pixelTolerance as l}from"../CurveHelper.js";const a=10;class u{static{this.instance=null}static local(){return null===u.instance&&(u.instance=new u),u.instance}execute(e,t,r){return new c(e,t,r)}}class c{constructor(e,t,r){const s=r.geomUnitsPerPoint,i=r.maxInflateSize;this._preventClipping=r.preventClipping,this._inputGeometries=e,this._tileKey=r.tileKey,this._curveHelper=new f,this._offset=(t.offset??1)*s,this._method=t.method??"Square",this._maxInflateSize=Math.max(Math.abs(i*s),a),this._offsetFlattenError=l*s}next(){let f;for(;f=this._inputGeometries.next();){if(0===this._offset)return f.clone();if("esriGeometryEnvelope"===f.geometryType){if("Rounded"===this._method&&this._offset>0){const r=t(f),s=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(s){const t=e.createEmptyOptimizedCIM(f.geometryType);return t.pushPath(s),t}return null}const r=f.asJSON();if(s(r)&&Math.min(r.xmax-r.xmin,r.ymax-r.ymin)+2*this._offset>0)return e.fromJSONCIM({xmin:r.xmin-this._offset,xmax:r.xmax+this._offset,ymin:r.ymin-this._offset,ymax:r.ymax+this._offset})}const l=!this._preventClipping&&this._tileKey?i(f,this._maxInflateSize,!0):f.clone();if(!l)continue;const a=o.module,u=n.module,c=m.module,p=a.execute({...l.asJSON(),spatialReference:{wkid:r.WebMercator.wkid}});if(!p)continue;let _,y=h(this._method);return"esriGeometryPolygon"===f.geometryType?("square"===y&&(y="bevel"),_=c.executeMany([p],[this._offset],y,"round")[0]):_=u.execute(p,-this._offset,{joins:y,flattenError:this._offsetFlattenError,miterLimit:4}),_?e.fromJSONCIM(_):null}return null}}function h(e){switch(e){case"Rounded":return"round";case"Bevelled":return"bevel";case"Mitered":return"miter";case"Square":return"square"}}export{u as EffectOffset};
2
+ import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{collectPath as t}from"../../../geometry/geometryCursorCollectUtils.js";import r from"../../../geometry/SpatialReference.js";import{isExtent as i}from"../../../geometry/support/jsonTypeUtils.js";import{clipCursorToTileExtent as s,lazySimplifyOGCOperator as o,lazyOffsetOperator as n,lazyGraphicBufferOperator as f}from"../CIMEffects.js";import{CurveHelper as m,pixelTolerance as l}from"../CurveHelper.js";const a=10;class u{static{this.instance=null}static local(){return null===u.instance&&(u.instance=new u),u.instance}execute(e,t,r){return new c(e,t,r)}}class c{constructor(e,t,r){const i=r.geomUnitsPerPoint,s=r.maxInflateSize;this._preventClipping=r.preventClipping,this._inputGeometries=e,this._tileKey=r.tileKey,this._curveHelper=new m,this._offset=(t.offset??1)*i,this._method=t.method??"Square",this._maxInflateSize=Math.max(Math.abs(s*i),a),this._offsetFlattenError=l*i}next(){let m;for(;m=this._inputGeometries.next();){if(0===this._offset)return m.clone();if("esriGeometryEnvelope"===m.geometryType){if("Rounded"===this._method&&this._offset>0){const r=t(m),i=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(i){const t=e.createEmptyOptimizedCIM(m.geometryType);return t.pushPath(i),t}return null}const r=m.asJSON();if(i(r)&&Math.min(r.xmax-r.xmin,r.ymax-r.ymin)+2*this._offset>0)return e.fromJSONCIM({xmin:r.xmin-this._offset,xmax:r.xmax+this._offset,ymin:r.ymin-this._offset,ymax:r.ymax+this._offset})}const l=!this._preventClipping&&this._tileKey?s(m,this._maxInflateSize,!0):m.clone();if(!l)continue;const{simplifyOGCExecute:a}=o.module,{offsetExecute:u}=n.module,{graphicBufferExecuteMany:c}=f.module,p=a({...l.asJSON(),spatialReference:{wkid:r.WebMercator.wkid}});if(!p)continue;let y,_=h(this._method);return"esriGeometryPolygon"===m.geometryType?("square"===_&&(_="bevel"),y=c([p],[this._offset],_,"round")[0]):y=u(p,-this._offset,{joins:_,flattenError:this._offsetFlattenError,miterLimit:4}),y?e.fromJSONCIM(y):null}return null}}function h(e){switch(e){case"Rounded":return"round";case"Bevelled":return"bevel";case"Mitered":return"miter";case"Square":return"square"}}export{u as EffectOffset};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../core/Error.js";import t from"../../../core/Logger.js";import{GeometryCursor as s}from"../../../geometry/GeometryCursor.js";import o from"../../../geometry/SpatialReference.js";import{isPolygon as i,isPolyline as l}from"../../../geometry/support/jsonTypeUtils.js";import r from"../../../geometry/support/PolylineBuilder.js";import{Point as n}from"../../../geometry/support/TileClipper.js";import{PathEffectCursor as h}from"../CIMCursor.js";import{lazyGeneralizeOperator as a,lazyLengthOperator as c,lazySimplifyOperator as _}from"../CIMEffects.js";const p=()=>t.getLogger("esri.symbols.cim.effects.EffectTaperedPolygon");class y{static{this.instance=null}static local(){return null===y.instance&&(y.instance=new y),y.instance}execute(e,t,s){return new f(e,t,s)}}class f extends h{constructor(e,t,s){super(e,!1,!0),this._slopeS=0,this._slopeC=1,this._lastTangent1=new n(NaN,NaN),this._lastWidth=0;const o=s.geomUnitsPerPoint;this._geomUnitsPerPoint=o,this._halfFromWidth=Math.abs(void 0!==t.fromWidth?t.fromWidth:0)*o*.5,this._halfToWidth=Math.abs(void 0!==t.toWidth?t.toWidth:1)*o*.5,this._originalLength=(void 0!==t.length?t.length:0)*o,this._length=0}processPath(t){if(t.totalSize<=0)return null;if(this._halfFromWidth<=0&&this._halfToWidth<=0){const e=s.createEmptyOptimizedCIM("esriGeometryPolygon",!1,!1,t.yFactor);for(t.seekPathEnd();t.prevPoint();)e.pushXY(t.x,t.y);for(t.seekPathStart();t.nextPoint();)e.pushXY(t.x,t.y);return e}const n=t.getCurrentPath().asJSON(),h=a.module.execute(n,.25*this._geomUnitsPerPoint,{removeDegenerateParts:!0}),y=null==h?null:i(h)?h.rings:l(h)?h.paths:null;if(!y)return p().error(new e("mapview-bad-resource","Unable to process geometry")),null;const f=c.module.execute(h);if((0===this._originalLength||this._originalLength>f)&&f>0){this._length=f;const e=(this._halfToWidth-this._halfFromWidth)/this._length;if(Math.abs(e)<1){const t=e*e;this._slopeC=Math.sqrt(1/(1+t)),this._slopeS=Math.sqrt(t/(1+t)),e<0&&(this._slopeS=-this._slopeS)}else this._slopeC=this._slopeS=.7071}else this._length=this._originalLength,this._slopeC=1,this._slopeS=0;const m=[];for(const e of y){const t=new r,s=new r;let o=0;this._setFromOffset(e.slice(0,2),t,s);for(let r=0,n=3;n<=e.length;++r,++n)o=this._setOffset(e.slice(r,n),o,t,s);this._setToOffset(e.slice(-2),o,t,s);const[i]=t.getGeometry(),[l]=s.getGeometry();m.push([...i,...l.reverse()])}const x={rings:m,spatialReference:{wkid:o.WebMercator.wkid}},d=_.module.execute(x);return s.fromJSONCIM(d)}_setFromOffset([[e,t],[s,o]],i,l){const r=this._halfFromWidth,h=new n(s-e,o-t).normalize().scale(r);i.beginPath([e-h.y,t+h.x]),l.beginPath([e+h.y,t-h.x])}_setToOffset([[e,t],[s,o]],i,l,r){let h;h=(i+=Math.sqrt((s-e)**2+(o-t)**2))>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*i/this._length;const a=new n(s-e,o-t).normalize().scale(h);l.lineTo([s-a.y,o+a.x]),r.lineTo([s+a.y,o-a.x])}_setOffset([[t,s],[o,i],[l,r]],h,a,c){const _=Math.sqrt((o-t)**2+(i-s)**2);let y;y=h+_>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*(h+_)/this._length,h+=_;const f=new n(o,i),m=new n(o-t,i-s).normalize(),x=new n(l-o,r-i).normalize(),d=n.sub(x,m),g=a.getPointCount(),u=c.getPointCount();m.leftPerpendicular(),x.leftPerpendicular();const T=m.x*x.x+m.y*x.y;if(T>.99){const e=n.add(m,x).scale(y/2),t=e.clone().rotate(this._slopeC,this._slopeS);a.lineTo([f.x+t.x,f.y+t.y]);const s=e.rotateReverse(this._slopeC,this._slopeS);c.lineTo([f.x-s.x,f.y-s.y])}else{const o=m.x*x.y-m.y*x.x;if(d.scale(1/o),o<0){d.scale(-y).rotateReverse(this._slopeC,this._slopeS);const t=c.getXY(u-1);t||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=n.add(f,d).sub(n.fromArray(t));if(m.x*s.y-m.y*s.x>0){const e=m.clone().scale(-y).rotateReverse(this._slopeC,this._slopeS),t=x.clone().scale(-y).rotateReverse(this._slopeC,this._slopeS);c.lineTo([f.x+e.x,f.y+e.y]),c.lineTo([f.x,f.y]),c.lineTo([f.x+t.x,f.y+t.y])}else c.lineTo([f.x+d.x,f.y+d.y])}else{d.scale(y).rotate(this._slopeC,this._slopeS);const t=a.getXY(g-1);t||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=n.add(f,d).sub(n.fromArray(t));if(m.x*s.y-m.y*s.x>0){const e=m.clone().scale(y).rotate(this._slopeC,this._slopeS),t=x.clone().scale(y).rotate(this._slopeC,this._slopeS);a.lineTo([f.x+e.x,f.y+e.y]),a.lineTo([f.x,f.y]),a.lineTo([f.x+t.x,f.y+t.y])}else a.lineTo([f.x+d.x,f.y+d.y])}const i=Math.acos(T);let l=1;if(y>.25){const e=2*Math.acos(1-.25/y);e<i&&(l=Math.round(i/e))}const r=Math.cos(i/l),h=Math.sin(i/l),_=m.clone();if(o<0){_.rotate(this._slopeC,this._slopeS);const o=a.getXY(g-1);o||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const i=n.add(f,_.clone().scale(this._lastWidth)),l=n.sub(i,n.fromArray(o)),r=m.x*l.y-m.y*l.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&r>0){const e=new n(t,s),o=this._lastTangent1.clone().scale(this._lastWidth);o.rotate(this._slopeC,this._slopeS);const i=m.clone().scale(this._lastWidth);i.rotate(this._slopeC,this._slopeS),a.lineTo([e.x+o.x,e.y+o.y]),a.lineTo([e.x,e.y]),a.lineTo([e.x+i.x,e.y+i.y])}}else{_.scale(-1).rotateReverse(this._slopeC,this._slopeS);const o=c.getXY(u-1);o||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const i=n.add(f,_.clone().scale(this._lastWidth)),l=n.sub(i,n.fromArray(o)),r=m.x*l.y-m.y*l.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&r>0){const e=new n(t,s),o=this._lastTangent1.clone().scale(-this._lastWidth);o.rotateReverse(this._slopeC,this._slopeS);const i=m.clone().scale(-this._lastWidth);i.rotateReverse(this._slopeC,this._slopeS),c.lineTo([e.x+o.x,e.y+o.y]),c.lineTo([e.x,e.y]),c.lineTo([e.x+i.x,e.y+i.y])}}_.scale(y);for(let e=0;e<=l;e++)o<0?(a.lineTo([f.x+_.x,f.y+_.y]),_.rotateReverse(r,h)):(c.lineTo([f.x+_.x,f.y+_.y]),_.rotate(r,h))}return this._lastTangent1.setCoords(m.x,m.y),this._lastWidth=y,h}}export{y as EffectTaperedPolygon};
2
+ import e from"../../../core/Error.js";import t from"../../../core/Logger.js";import{GeometryCursor as s}from"../../../geometry/GeometryCursor.js";import o from"../../../geometry/SpatialReference.js";import{isPolygon as i,isPolyline as l}from"../../../geometry/support/jsonTypeUtils.js";import r from"../../../geometry/support/PolylineBuilder.js";import{Point as n}from"../../../geometry/support/TileClipper.js";import{PathEffectCursor as h}from"../CIMCursor.js";import{lazyGeneralizeOperator as a,lazyLengthOperator as c,lazySimplifyOperator as _}from"../CIMEffects.js";const p=()=>t.getLogger("esri.symbols.cim.effects.EffectTaperedPolygon");class y{static{this.instance=null}static local(){return null===y.instance&&(y.instance=new y),y.instance}execute(e,t,s){return new f(e,t,s)}}class f extends h{constructor(e,t,s){super(e,!1,!0),this._slopeS=0,this._slopeC=1,this._lastTangent1=new n(NaN,NaN),this._lastWidth=0;const o=s.geomUnitsPerPoint;this._geomUnitsPerPoint=o,this._halfFromWidth=Math.abs(void 0!==t.fromWidth?t.fromWidth:0)*o*.5,this._halfToWidth=Math.abs(void 0!==t.toWidth?t.toWidth:1)*o*.5,this._originalLength=(void 0!==t.length?t.length:0)*o,this._length=0}processPath(t){if(t.totalSize<=0)return null;if(this._halfFromWidth<=0&&this._halfToWidth<=0){const e=s.createEmptyOptimizedCIM("esriGeometryPolygon",!1,!1,t.yFactor);for(t.seekPathEnd();t.prevPoint();)e.pushXY(t.x,t.y);for(t.seekPathStart();t.nextPoint();)e.pushXY(t.x,t.y);return e}const n=t.getCurrentPath().asJSON(),{generalizeExecute:h}=a.module,y=h(n,.25*this._geomUnitsPerPoint,{removeDegenerateParts:!0}),f=null==y?null:i(y)?y.rings:l(y)?y.paths:null;if(!f)return p().error(new e("mapview-bad-resource","Unable to process geometry")),null;const{lengthExecute:m}=c.module,x=m(y);if((0===this._originalLength||this._originalLength>x)&&x>0){this._length=x;const e=(this._halfToWidth-this._halfFromWidth)/this._length;if(Math.abs(e)<1){const t=e*e;this._slopeC=Math.sqrt(1/(1+t)),this._slopeS=Math.sqrt(t/(1+t)),e<0&&(this._slopeS=-this._slopeS)}else this._slopeC=this._slopeS=.7071}else this._length=this._originalLength,this._slopeC=1,this._slopeS=0;const d=[];for(const e of f){const t=new r,s=new r;let o=0;this._setFromOffset(e.slice(0,2),t,s);for(let r=0,n=3;n<=e.length;++r,++n)o=this._setOffset(e.slice(r,n),o,t,s);this._setToOffset(e.slice(-2),o,t,s);const[i]=t.getGeometry(),[l]=s.getGeometry();d.push([...i,...l.reverse()])}const g={rings:d,spatialReference:{wkid:o.WebMercator.wkid}},{simplifyExecute:u}=_.module,T=u(g);return s.fromJSONCIM(T)}_setFromOffset([[e,t],[s,o]],i,l){const r=this._halfFromWidth,h=new n(s-e,o-t).normalize().scale(r);i.beginPath([e-h.y,t+h.x]),l.beginPath([e+h.y,t-h.x])}_setToOffset([[e,t],[s,o]],i,l,r){let h;h=(i+=Math.sqrt((s-e)**2+(o-t)**2))>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*i/this._length;const a=new n(s-e,o-t).normalize().scale(h);l.lineTo([s-a.y,o+a.x]),r.lineTo([s+a.y,o-a.x])}_setOffset([[t,s],[o,i],[l,r]],h,a,c){const _=Math.sqrt((o-t)**2+(i-s)**2);let y;y=h+_>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*(h+_)/this._length,h+=_;const f=new n(o,i),m=new n(o-t,i-s).normalize(),x=new n(l-o,r-i).normalize(),d=n.sub(x,m),g=a.getPointCount(),u=c.getPointCount();m.leftPerpendicular(),x.leftPerpendicular();const T=m.x*x.x+m.y*x.y;if(T>.99){const e=n.add(m,x).scale(y/2),t=e.clone().rotate(this._slopeC,this._slopeS);a.lineTo([f.x+t.x,f.y+t.y]);const s=e.rotateReverse(this._slopeC,this._slopeS);c.lineTo([f.x-s.x,f.y-s.y])}else{const o=m.x*x.y-m.y*x.x;if(d.scale(1/o),o<0){d.scale(-y).rotateReverse(this._slopeC,this._slopeS);const t=c.getXY(u-1);t||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=n.add(f,d).sub(n.fromArray(t));if(m.x*s.y-m.y*s.x>0){const e=m.clone().scale(-y).rotateReverse(this._slopeC,this._slopeS),t=x.clone().scale(-y).rotateReverse(this._slopeC,this._slopeS);c.lineTo([f.x+e.x,f.y+e.y]),c.lineTo([f.x,f.y]),c.lineTo([f.x+t.x,f.y+t.y])}else c.lineTo([f.x+d.x,f.y+d.y])}else{d.scale(y).rotate(this._slopeC,this._slopeS);const t=a.getXY(g-1);t||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=n.add(f,d).sub(n.fromArray(t));if(m.x*s.y-m.y*s.x>0){const e=m.clone().scale(y).rotate(this._slopeC,this._slopeS),t=x.clone().scale(y).rotate(this._slopeC,this._slopeS);a.lineTo([f.x+e.x,f.y+e.y]),a.lineTo([f.x,f.y]),a.lineTo([f.x+t.x,f.y+t.y])}else a.lineTo([f.x+d.x,f.y+d.y])}const i=Math.acos(T);let l=1;if(y>.25){const e=2*Math.acos(1-.25/y);e<i&&(l=Math.round(i/e))}const r=Math.cos(i/l),h=Math.sin(i/l),_=m.clone();if(o<0){_.rotate(this._slopeC,this._slopeS);const o=a.getXY(g-1);o||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const i=n.add(f,_.clone().scale(this._lastWidth)),l=n.sub(i,n.fromArray(o)),r=m.x*l.y-m.y*l.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&r>0){const e=new n(t,s),o=this._lastTangent1.clone().scale(this._lastWidth);o.rotate(this._slopeC,this._slopeS);const i=m.clone().scale(this._lastWidth);i.rotate(this._slopeC,this._slopeS),a.lineTo([e.x+o.x,e.y+o.y]),a.lineTo([e.x,e.y]),a.lineTo([e.x+i.x,e.y+i.y])}}else{_.scale(-1).rotateReverse(this._slopeC,this._slopeS);const o=c.getXY(u-1);o||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const i=n.add(f,_.clone().scale(this._lastWidth)),l=n.sub(i,n.fromArray(o)),r=m.x*l.y-m.y*l.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&r>0){const e=new n(t,s),o=this._lastTangent1.clone().scale(-this._lastWidth);o.rotateReverse(this._slopeC,this._slopeS);const i=m.clone().scale(-this._lastWidth);i.rotateReverse(this._slopeC,this._slopeS),c.lineTo([e.x+o.x,e.y+o.y]),c.lineTo([e.x,e.y]),c.lineTo([e.x+i.x,e.y+i.y])}}_.scale(y);for(let e=0;e<=l;e++)o<0?(a.lineTo([f.x+_.x,f.y+_.y]),_.rotateReverse(r,h)):(c.lineTo([f.x+_.x,f.y+_.y]),_.rotate(r,h))}return this._lastTangent1.setCoords(m.x,m.y),this._lastWidth=y,h}}export{y as EffectTaperedPolygon};
@@ -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{debounce as r,ignoreAbortErrors as s}from"../../../../core/promiseUtils.js";import{createLength as o}from"../../../../core/quantity.js";import{watch as i,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as a,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import m from"../../../../geometry/Polyline.js";import{load as p,execute as c}from"../../../../geometry/operators/geodeticDensifyOperator.js";import{load as d,execute as f}from"../../../../geometry/operators/projectOperator.js";import{execute as g}from"../../../../geometry/operators/simplifyOperator.js";import{GeometryWorkerHandle as y}from"../../../support/GeometryWorkerHandle.js";import{autoMeasurementMode as h}from"../../../support/measurementWorkerUtils.js";const j=o(1e5,"meters");async function w(e,t,r){if(!e?.rings.length||!e.rings[0].length)return null;await d();const s=f(e,t);return s?0===h(t)?_(s,r):v(s,r):null}async function _(e,t){await p();const r=g(e);if(!r)return null;const s=H(r),i=c(r,j.value,{unit:j.unit});if(!i)return null;const n=c(s,j.value,{unit:j.unit});if(!n)return null;const{area:a,length:u}=await t.geodeticArea(e,{unit:"square-meters",returnLength:!0});return{area:a,display:{fill:i,outline:n},mode:"geodesic",perimeter:u??o(0,"meters")}}async function v(e,t){const r=g(e);if(!r)return null;const s=H(r),{area:i,length:n}=await t.area2D(e,{unit:"square-meters",returnLength:!0});return{area:i,display:{fill:r,outline:s},mode:"euclidean",perimeter:n??o(0,"meters")}}function H(e){return new m({spatialReference:e.spatialReference,paths:e.rings})}let k=class extends t{constructor(e){super(e),this._result=null,this._updatingHandles=new l,this._measurementWorker=new y({preloadGeodetic:!0}),this._debouncedGetResult=r(async e=>{this._result=await w(e,this.view.spatialReference,this._measurementWorker)})}initialize(){this.addHandles(i(()=>this.measurementViewData.analysis.geometry,e=>{this._updatingHandles.consumePromise(s(this._debouncedGetResult(e)))},n))}destroy(){this._updatingHandles.destroy(),this._measurementWorker.destroy()}get result(){return this._result}get updating(){return this._updatingHandles.updating}};e([a()],k.prototype,"_result",void 0),e([a()],k.prototype,"measurementViewData",void 0),e([a()],k.prototype,"result",null),e([a()],k.prototype,"updating",null),e([a()],k.prototype,"view",void 0),k=e([u("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementController")],k);export{k as AreaMeasurementController};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{debounce as r,ignoreAbortErrors as s}from"../../../../core/promiseUtils.js";import{createLength as o}from"../../../../core/quantity.js";import{watch as i,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as a,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import m from"../../../../geometry/Polyline.js";import{geodeticDensifyLoad as p,geodeticDensifyExecute as c}from"../../../../geometry/operators/geodeticDensifyOperator.js";import{projectLoad as d,projectExecute as f}from"../../../../geometry/operators/projectOperator.js";import{simplifyExecute as g}from"../../../../geometry/operators/simplifyOperator.js";import{GeometryWorkerHandle as y}from"../../../support/GeometryWorkerHandle.js";import{autoMeasurementMode as h}from"../../../support/measurementWorkerUtils.js";const j=o(1e5,"meters");async function w(e,t,r){if(!e?.rings.length||!e.rings[0].length)return null;await d();const s=f(e,t);return s?0===h(t)?_(s,r):v(s,r):null}async function _(e,t){await p();const r=g(e);if(!r)return null;const s=H(r),i=c(r,j.value,{unit:j.unit});if(!i)return null;const n=c(s,j.value,{unit:j.unit});if(!n)return null;const{area:a,length:u}=await t.geodeticArea(e,{unit:"square-meters",returnLength:!0});return{area:a,display:{fill:i,outline:n},mode:"geodesic",perimeter:u??o(0,"meters")}}async function v(e,t){const r=g(e);if(!r)return null;const s=H(r),{area:i,length:n}=await t.area2D(e,{unit:"square-meters",returnLength:!0});return{area:i,display:{fill:r,outline:s},mode:"euclidean",perimeter:n??o(0,"meters")}}function H(e){return new m({spatialReference:e.spatialReference,paths:e.rings})}let k=class extends t{constructor(e){super(e),this._result=null,this._updatingHandles=new l,this._measurementWorker=new y({preloadGeodetic:!0}),this._debouncedGetResult=r(async e=>{this._result=await w(e,this.view.spatialReference,this._measurementWorker)})}initialize(){this.addHandles(i(()=>this.measurementViewData.analysis.geometry,e=>{this._updatingHandles.consumePromise(s(this._debouncedGetResult(e)))},n))}destroy(){this._updatingHandles.destroy(),this._measurementWorker.destroy()}get result(){return this._result}get updating(){return this._updatingHandles.updating}};e([a()],k.prototype,"_result",void 0),e([a()],k.prototype,"measurementViewData",void 0),e([a()],k.prototype,"result",null),e([a()],k.prototype,"updating",null),e([a()],k.prototype,"view",void 0),k=e([u("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementController")],k);export{k as AreaMeasurementController};
@@ -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{debounce as r,ignoreAbortErrors as s}from"../../../../core/promiseUtils.js";import{createLength as o}from"../../../../core/quantity.js";import{watch as i,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{isSupported as p,geodesicDensify as m,geodesicLengths as c}from"../../../../geometry/geodesicUtils.js";import{load as d,execute as g}from"../../../../geometry/operators/geodeticDensifyOperator.js";import{load as f,execute as y}from"../../../../geometry/operators/geodeticLengthOperator.js";import{execute as h}from"../../../../geometry/operators/lengthOperator.js";import{load as j,execute as _}from"../../../../geometry/operators/projectOperator.js";import{execute as v}from"../../../../geometry/operators/simplifyOperator.js";const w=o(1e5,"meters");async function x(e,t){if(!e?.paths.length||!e.paths[0].length)return null;await j();const r=_(e,t);return r?r.spatialReference.isGeographic?p(r.spatialReference)?R(r):H(r):r.spatialReference.isWebMercator?H(r):D(r):null}async function H(e){await Promise.all([d(),f()]);const t=v(e);if(!t)return null;const r=g(t,w.value,{unit:w.unit});if(!r)return null;const s=y(t,{unit:"meters"});return{display:{outline:r},mode:"geodesic",length:o(s,"meters")}}function R(e){const t=v(e);if(!t)return null;const r=m(t,w.value),s=c([t],"meters")[0];return{display:{outline:r},mode:"geodesic",length:o(s,"meters")}}function D(e){const t=v(e);if(!t)return null;const r=h(t,{unit:"meters"});return{display:{outline:t},mode:"euclidean",length:o(r,"meters")}}let O=class extends t{constructor(e){super(e),this._result=null,this._updatingHandles=new u,this._debouncedGetResult=r(async e=>{this._result=await x(e,this.view.spatialReference)})}initialize(){this.addHandles(i(()=>this.measurementViewData.analysis.geometry,e=>{this._updatingHandles.consumePromise(s(this._debouncedGetResult(e)))},n))}destroy(){this._updatingHandles.destroy()}get result(){return this._result}get updating(){return this._updatingHandles.updating}};e([a()],O.prototype,"_result",void 0),e([a()],O.prototype,"measurementViewData",void 0),e([a()],O.prototype,"result",null),e([a()],O.prototype,"updating",null),e([a()],O.prototype,"view",void 0),O=e([l("esri.views.2d.analysis.DistanceMeasurement.DistanceMeasurementController")],O);export{O as DistanceMeasurementController};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{debounce as r,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import{createLength as s}from"../../../../core/quantity.js";import{watch as i,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{isSupported as p,geodesicDensify as m,geodesicLengths as c}from"../../../../geometry/geodesicUtils.js";import{geodeticDensifyLoad as d,geodeticDensifyExecute as g}from"../../../../geometry/operators/geodeticDensifyOperator.js";import{geodeticLengthLoad as f,geodeticLengthExecute as y}from"../../../../geometry/operators/geodeticLengthOperator.js";import{lengthExecute as h}from"../../../../geometry/operators/lengthOperator.js";import{projectLoad as j,projectExecute as _}from"../../../../geometry/operators/projectOperator.js";import{simplifyExecute as v}from"../../../../geometry/operators/simplifyOperator.js";const w=s(1e5,"meters");async function H(e,t){if(!e?.paths.length||!e.paths[0].length)return null;await j();const r=_(e,t);return r?r.spatialReference.isGeographic?p(r.spatialReference)?D(r):R(r):r.spatialReference.isWebMercator?R(r):O(r):null}async function R(e){await Promise.all([d(),f()]);const t=v(e);if(!t)return null;const r=g(t,w.value,{unit:w.unit});if(!r)return null;const o=y(t,{unit:"meters"});return{display:{outline:r},mode:"geodesic",length:s(o,"meters")}}function D(e){const t=v(e);if(!t)return null;const r=m(t,w.value),o=c([t],"meters")[0];return{display:{outline:r},mode:"geodesic",length:s(o,"meters")}}function O(e){const t=v(e);if(!t)return null;const r=h(t,{unit:"meters"});return{display:{outline:t},mode:"euclidean",length:s(r,"meters")}}let b=class extends t{constructor(e){super(e),this._result=null,this._updatingHandles=new u,this._debouncedGetResult=r(async e=>{this._result=await H(e,this.view.spatialReference)})}initialize(){this.addHandles(i(()=>this.measurementViewData.analysis.geometry,e=>{this._updatingHandles.consumePromise(o(this._debouncedGetResult(e)))},n))}destroy(){this._updatingHandles.destroy()}get result(){return this._result}get updating(){return this._updatingHandles.updating}};e([a()],b.prototype,"_result",void 0),e([a()],b.prototype,"measurementViewData",void 0),e([a()],b.prototype,"result",null),e([a()],b.prototype,"updating",null),e([a()],b.prototype,"view",void 0),b=e([l("esri.views.2d.analysis.DistanceMeasurement.DistanceMeasurementController")],b);export{b as DistanceMeasurementController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Error.js";import{on as t}from"../../../../core/events.js";import r from"../../../../core/Handles.js";import i from"../../../../core/Logger.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{getProjectiveTransform as n}from"../../../../core/perspectiveUtils.js";import{watch as o,initial as a,when as d}from"../../../../core/reactiveUtils.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isVideoElement as p}from"../../../../support/mediaLayerUtils.js";import{DisplayObject as u}from"../DisplayObject.js";import{createPlayer as c,updateIfNeeded as f}from"./animatedFormats/utils.js";import y from"../../../webgl/Texture.js";import{TextureDescriptor as w}from"../../../webgl/TextureDescriptor.js";const x=[1,1],_=l(),v={none:"None",loop:"Loop",oscillate:"Oscillate"};function A(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?v[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}class g extends u{constructor(n){super(),this.elementView=n,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=h(),this._handles=new r,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._playAnimation=!0,this._handles.add([o(()=>this.elementView.element.opacity,e=>this.opacity=e,a),o(()=>[this.elementView.coords],()=>{this.requestRender()},a),o(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this.texture=s(this.texture),this.requestRender()},a),d(()=>this.elementView.element.loaded,()=>{const e=this.elementView.element;this.ready(),p(e)&&null!=e.content&&(this._handles.add([t(e.content,"play",()=>this.requestRender()),t(e.content,"loadeddata",()=>this.requestRender()),t(e.content,"loaded",()=>this.requestRender())]),"requestVideoFrameCallback"in e.content?e.content.requestVideoFrameCallback(()=>this.requestRender()):this._handles.add([t(e.content,"seeked",()=>this.requestRender())]),this.requestRender())},a)]),n.element.load().catch(t=>{i.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new e("element-load-error","Element cannot be displayed",{element:n,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){super.destroy(),this._handles.destroy(),this.texture=s(this.texture)}get textureSize(){return x}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(null!=r){const i=r instanceof HTMLImageElement,s=r instanceof HTMLVideoElement,n=i?r.naturalWidth:s?r.videoWidth:r.width,o=i?r.naturalHeight:s?r.videoHeight:r.height;if(this._updatePerspectiveTransform(n,o),this.texture)if(s)if(r.readyState>=r.HAVE_CURRENT_DATA)e.animationsEnabled&&this._updateTextureAndRequestRender(r);else{const e=()=>{this._updateTextureAndRequestRender(r),r.removeEventListener("canplay",e),r.removeEventListener("seeked",e)};r.addEventListener("canplay",e),r.addEventListener("seeked",e)}else"getFrame"in r&&e.animationsEnabled&&this.requestRender();else{const e=new w(n,o);if(e.wrapMode=33071,e.preMultiplyAlpha=!0,"getFrame"in r){const i=r=>{this.texture?this.texture.setData(r):this.texture=new y(t,e,r)};if("animationOptions"in this.elementView.element){const e=A(this.elementView.element.animationOptions);this._playAnimation=e.playAnimation??!1,this._player=c(r,e,null,i)}}else this.texture=new y(t,e,r);this.texture.generateMipmap(),s&&this._requestVideoFrame(r)}}super.beforeRender(e)}_updateTextureAndRequestRender(e){this.texture.setData(e),this.texture.generateMipmap(),this._requestVideoFrame(e)}_requestVideoFrame(e){"requestVideoFrameCallback"in e?e.requestVideoFrameCallback(()=>this.requestRender()):e.paused||this.requestRender()}_createTransforms(){return null}draw(e,t){this.isReady&&null!=this.texture?(this._playAnimation&&f(e,this._player),t.render(e,{config:{perspective:this.perspectiveTransform,texSize:x,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity},texture:{texture:this.texture,unit:0},position:this._vertices,tex:this._indices})):this.requestRender()}updateDrawCoords(e,t,r,i){const{coords:s,bounds:n}=this.elementView;if(null==s||null==n)return;const[o,a,d,l]=s.rings[0],m=this._vertices,{x:h,y:p}=e;m.set([a[0]-h,a[1]-p,o[0]-h,o[1]-p,d[0]-h,d[1]-p,l[0]-h,l[1]-p]);let u=t;if(i){const[e,,t]=n,{worldWidth:r,xBounds:s}=i,[o,a]=s;e<o&&t>o?u=r:t>a&&e<a&&(u=-r)}this.wrapAroundShift=u,this.isWrapAround=0!==u}_updatePerspectiveTransform(e,t){const r=this._vertices;n(_,[0,0,e,0,0,t,e,t],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),m(this.perspectiveTransform,_[6]/_[8]*e,_[7]/_[8]*t)}}export{g as default};
2
+ import e from"../../../../core/Error.js";import{on as t}from"../../../../core/events.js";import r from"../../../../core/Handles.js";import i from"../../../../core/Logger.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{getProjectiveTransform as n}from"../../../../core/perspectiveUtils.js";import{watch as o,initial as a,when as l}from"../../../../core/reactiveUtils.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{getClosestDenormalizedXToReference as h}from"../../../../geometry/support/normalizeUtils.js";import{isVideoElement as u}from"../../../../support/mediaLayerUtils.js";import{DisplayObject as c}from"../DisplayObject.js";import{createPlayer as f,updateIfNeeded as y}from"./animatedFormats/utils.js";import w from"../../../webgl/Texture.js";import{TextureDescriptor as x}from"../../../webgl/TextureDescriptor.js";const _=[1,1],v=d(),g={none:"None",loop:"Loop",oscillate:"Oscillate"};function A(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?g[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}class R extends c{constructor(n){super(),this.elementView=n,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=p(),this._handles=new r,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._playAnimation=!0,this._handles.add([o(()=>this.elementView.element.opacity,e=>this.opacity=e,a),o(()=>[this.elementView.coords],()=>{this.requestRender()},a),o(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this.texture=s(this.texture),this.requestRender()},a),l(()=>this.elementView.element.loaded,()=>{const e=this.elementView.element;this.ready(),u(e)&&null!=e.content&&(this._handles.add([t(e.content,"play",()=>this.requestRender()),t(e.content,"loadeddata",()=>this.requestRender()),t(e.content,"loaded",()=>this.requestRender())]),"requestVideoFrameCallback"in e.content?e.content.requestVideoFrameCallback(()=>this.requestRender()):this._handles.add([t(e.content,"seeked",()=>this.requestRender())]),this.requestRender())},a)]),n.element.load().catch(t=>{i.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new e("element-load-error","Element cannot be displayed",{element:n,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){super.destroy(),this._handles.destroy(),this.texture=s(this.texture)}get textureSize(){return _}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(null!=r){const i=r instanceof HTMLImageElement,s=r instanceof HTMLVideoElement,n=i?r.naturalWidth:s?r.videoWidth:r.width,o=i?r.naturalHeight:s?r.videoHeight:r.height;if(this._updatePerspectiveTransform(n,o),this.texture)if(s)if(r.readyState>=r.HAVE_CURRENT_DATA)e.animationsEnabled&&this._updateTextureAndRequestRender(r);else{const e=()=>{this._updateTextureAndRequestRender(r),r.removeEventListener("canplay",e),r.removeEventListener("seeked",e)};r.addEventListener("canplay",e),r.addEventListener("seeked",e)}else"getFrame"in r&&e.animationsEnabled&&this.requestRender();else{const e=new x(n,o);if(e.wrapMode=33071,e.preMultiplyAlpha=!0,"getFrame"in r){const i=r=>{this.texture?this.texture.setData(r):this.texture=new w(t,e,r)};if("animationOptions"in this.elementView.element){const e=A(this.elementView.element.animationOptions);this._playAnimation=e.playAnimation??!1,this._player=f(r,e,null,i)}}else this.texture=new w(t,e,r);this.texture.generateMipmap(),s&&this._requestVideoFrame(r)}}super.beforeRender(e)}_updateTextureAndRequestRender(e){this.texture.setData(e),this.texture.generateMipmap(),this._requestVideoFrame(e)}_requestVideoFrame(e){"requestVideoFrameCallback"in e?e.requestVideoFrameCallback(()=>this.requestRender()):e.paused||this.requestRender()}_createTransforms(){return null}draw(e,t){this.isReady&&null!=this.texture?(this._playAnimation&&y(e,this._player),t.render(e,{config:{perspective:this.perspectiveTransform,texSize:_,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity},texture:{texture:this.texture,unit:0},position:this._vertices,tex:this._indices})):this.requestRender()}updateDrawCoords(e,t,r,i){const{coords:s,bounds:n}=this.elementView;if(null==s||null==n)return;const[o,a,l,d]=s.rings[0],m=this._vertices,p=(n[0]+n[2])/2,u=h(e.x,p,s.spatialReference),c=e.y,f=e.x-u;m.set([a[0]-u,a[1]-c,o[0]-u,o[1]-c,l[0]-u,l[1]-c,d[0]-u,d[1]-c]);let y=t;if(i){const e=n[0]+f,t=n[2]+f,{worldWidth:r,xBounds:s}=i,[o,a]=s;e<o?y=r:t>a&&(y=-r)}this.wrapAroundShift=y,this.isWrapAround=0!==y}_updatePerspectiveTransform(e,t){const r=this._vertices;n(v,[0,0,e,0,0,t,e,t],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),m(this.perspectiveTransform,v[6]/v[8]*e,v[7]/v[8]*t)}}export{R as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{disposeMaybe as e}from"../../../../core/maybe.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import o from"../../../../geometry/Point.js";import{load as s,execute as i}from"../../../../geometry/operators/projectOperator.js";import{DisplayObject as a}from"../DisplayObject.js";import{VideoScreenTechnique as n}from"./shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js";import{ColorAttachment0 as c,SizedPixelFormat as d}from"../../../webgl/enums.js";import{DisposableFramebufferObject as h}from"../../../webgl/FramebufferObject.js";import u from"../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../webgl/TextureDescriptor.js";class m extends a{constructor(e,t){super(),this._controlPointsOwner=t,this.readbackScreenCoords=r(),this.videoTextureCoords=new Array(36),this.overlayTextureCoords=new Array(36),this._prevFBO=null,this._acquiredFBO=null,this._isBound=!1,this._hasCoordinates=!1,this._geIsLoaded=!1,this._ndcRect=[0,0,2,2],this._technique=new n,this.visible=!1,this.stage=e;for(let r=0;r<6;r++){const e=r/5;for(let t=0;t<6;t++){const o=t/5;this.videoTextureCoords[6*r+t]={u:o,v:e}}}}getMesh(e){throw new Error("Method not implemented.")}destroy(){super.destroy(),e(this._readbackTexture)}bind(e){const{context:t,pixelRatio:r,state:o}=e;if(this._update(e),!this.ready||0===this.readbackScreenCoords[2]||0===this.readbackScreenCoords[3])return this.requestRender(),!1;const{size:s}=o,i=Math.round(r*s[0]),a=Math.round(r*s[1]),n=new l(i,a);return n.samplingMode=9729,n.wrapMode=33071,this._acquiredFBO??=new h(t,n),this._acquiredFBO.resize(i,a),t.bindFramebuffer(this._acquiredFBO),this._isBound=!0,!0}unbind(e){if(!this._isBound)return;const{context:t,pixelRatio:r,state:o}=e,{size:s}=o,i=this._acquiredFBO;if(!i.getColorTexture(c))throw new Error("Failed to get color texture from FBO.");const a=this._getReadbackTexture(e),n=this.readbackScreenCoords,d=Math.round(r*n[0]),h=Math.round(r*(s[1]-n[1]))-a.descriptor.height,u=d+a.descriptor.width,l=h+a.descriptor.height,m=Math.max(d,0),_=Math.max(h,0),b=Math.min(u,i.width)-m,f=Math.min(l,i.height)-_;b>0&&f>0&&i.copyToTexture(m,_,b,f,m-d,_-h,a),t.bindFramebuffer(this._prevFBO)}_update(e){const{state:r}=e,a=this._controlPointsOwner,n=a.groundControlPoints(),c=a.getSize(),d=r.size,h=n?.length;if(!h)return;if(s().then(()=>{this._geIsLoaded=!0}),!this._geIsLoaded)return void this.requestRender();const u=c[0],l=c[1],m=d[0],_=l/d[1],b=u/m;if(_>b){const e=b/_*2,t=(2-e)/2;this._ndcRect[0]=-1+t,this._ndcRect[1]=1,this._ndcRect[2]=e,this._ndcRect[3]=2}else{const e=_/b*2,t=(2-e)/2;this._ndcRect[0]=-1,this._ndcRect[1]=1-t,this._ndcRect[2]=2,this._ndcRect[3]=e}const f=new Array(h),x=r.spatialReference;for(let t=0;t<h;t++){const{lat:e,lon:r}=n[t],s=new o(r,e);f[t]=i(s,x)}const p=[];let M=1/0,g=1/0,w=-1/0,C=-1/0;for(const o of f){const e=t();r.toScreen(e,o.x,o.y),p.push({x:e[0],y:e[1]}),M=Math.min(M,e[0]),g=Math.min(g,e[1]),w=Math.max(w,e[0]),C=Math.max(C,e[1])}const R=[M,C],k=[w,g];this.readbackScreenCoords[0]=Math.max(Math.floor(R[0]),0),this.readbackScreenCoords[1]=Math.max(Math.floor(k[1]),0),this.readbackScreenCoords[2]=Math.ceil(k[0]),this.readbackScreenCoords[3]=Math.ceil(R[1]);for(let t=0;t<p.length;t++){const e=p[t],r=(e.x-M)/(w-M),o=(C-e.y)/(C-g);this.overlayTextureCoords[t]={u:r,v:o}}this._hasCoordinates=!0}_createTransforms(){return null}doRender(e){this._readbackTexture&&this._hasCoordinates?this._technique.render(e,{texture:this._readbackTexture,textureCoords:this.overlayTextureCoords,opacity:1,ndcRect:this._ndcRect}):this.requestRender()}_getReadbackTexture(e){const{context:t,pixelRatio:r}=e,o=Math.round(r*Math.abs(this.readbackScreenCoords[2]-this.readbackScreenCoords[0])),s=Math.round(r*Math.abs(this.readbackScreenCoords[3]-this.readbackScreenCoords[1]));if(this._readbackTexture)this._readbackTexture.resize(o,s);else{const e=new l(o,s);e.wrapMode=33071,e.internalFormat=d.RGBA8,this._readbackTexture=new u(t,e)}return this._readbackTexture}}export{m as default};
2
+ import{disposeMaybe as e}from"../../../../core/maybe.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import o from"../../../../geometry/Point.js";import{projectLoad as s,projectExecute as i}from"../../../../geometry/operators/projectOperator.js";import{DisplayObject as a}from"../DisplayObject.js";import{VideoScreenTechnique as n}from"./shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js";import{ColorAttachment0 as c,SizedPixelFormat as d}from"../../../webgl/enums.js";import{DisposableFramebufferObject as h}from"../../../webgl/FramebufferObject.js";import u from"../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../webgl/TextureDescriptor.js";class m extends a{constructor(e,t){super(),this._controlPointsOwner=t,this.readbackScreenCoords=r(),this.videoTextureCoords=new Array(36),this.overlayTextureCoords=new Array(36),this._prevFBO=null,this._acquiredFBO=null,this._isBound=!1,this._hasCoordinates=!1,this._geIsLoaded=!1,this._ndcRect=[0,0,2,2],this._technique=new n,this.visible=!1,this.stage=e;for(let r=0;r<6;r++){const e=r/5;for(let t=0;t<6;t++){const o=t/5;this.videoTextureCoords[6*r+t]={u:o,v:e}}}}getMesh(e){throw new Error("Method not implemented.")}destroy(){super.destroy(),e(this._readbackTexture)}bind(e){const{context:t,pixelRatio:r,state:o}=e;if(this._update(e),!this.ready||0===this.readbackScreenCoords[2]||0===this.readbackScreenCoords[3])return this.requestRender(),!1;const{size:s}=o,i=Math.round(r*s[0]),a=Math.round(r*s[1]),n=new l(i,a);return n.samplingMode=9729,n.wrapMode=33071,this._acquiredFBO??=new h(t,n),this._acquiredFBO.resize(i,a),t.bindFramebuffer(this._acquiredFBO),this._isBound=!0,!0}unbind(e){if(!this._isBound)return;const{context:t,pixelRatio:r,state:o}=e,{size:s}=o,i=this._acquiredFBO;if(!i.getColorTexture(c))throw new Error("Failed to get color texture from FBO.");const a=this._getReadbackTexture(e),n=this.readbackScreenCoords,d=Math.round(r*n[0]),h=Math.round(r*(s[1]-n[1]))-a.descriptor.height,u=d+a.descriptor.width,l=h+a.descriptor.height,m=Math.max(d,0),_=Math.max(h,0),b=Math.min(u,i.width)-m,f=Math.min(l,i.height)-_;b>0&&f>0&&i.copyToTexture(m,_,b,f,m-d,_-h,a),t.bindFramebuffer(this._prevFBO)}_update(e){const{state:r}=e,a=this._controlPointsOwner,n=a.groundControlPoints(),c=a.getSize(),d=r.size,h=n?.length;if(!h)return;if(s().then(()=>{this._geIsLoaded=!0}),!this._geIsLoaded)return void this.requestRender();const u=c[0],l=c[1],m=d[0],_=l/d[1],b=u/m;if(_>b){const e=b/_*2,t=(2-e)/2;this._ndcRect[0]=-1+t,this._ndcRect[1]=1,this._ndcRect[2]=e,this._ndcRect[3]=2}else{const e=_/b*2,t=(2-e)/2;this._ndcRect[0]=-1,this._ndcRect[1]=1-t,this._ndcRect[2]=2,this._ndcRect[3]=e}const f=new Array(h),x=r.spatialReference;for(let t=0;t<h;t++){const{lat:e,lon:r}=n[t],s=new o(r,e);f[t]=i(s,x)}const p=[];let M=1/0,g=1/0,w=-1/0,C=-1/0;for(const o of f){const e=t();r.toScreen(e,o.x,o.y),p.push({x:e[0],y:e[1]}),M=Math.min(M,e[0]),g=Math.min(g,e[1]),w=Math.max(w,e[0]),C=Math.max(C,e[1])}const R=[M,C],k=[w,g];this.readbackScreenCoords[0]=Math.max(Math.floor(R[0]),0),this.readbackScreenCoords[1]=Math.max(Math.floor(k[1]),0),this.readbackScreenCoords[2]=Math.ceil(k[0]),this.readbackScreenCoords[3]=Math.ceil(R[1]);for(let t=0;t<p.length;t++){const e=p[t],r=(e.x-M)/(w-M),o=(C-e.y)/(C-g);this.overlayTextureCoords[t]={u:r,v:o}}this._hasCoordinates=!0}_createTransforms(){return null}doRender(e){this._readbackTexture&&this._hasCoordinates?this._technique.render(e,{texture:this._readbackTexture,textureCoords:this.overlayTextureCoords,opacity:1,ndcRect:this._ndcRect}):this.requestRender()}_getReadbackTexture(e){const{context:t,pixelRatio:r}=e,o=Math.round(r*Math.abs(this.readbackScreenCoords[2]-this.readbackScreenCoords[0])),s=Math.round(r*Math.abs(this.readbackScreenCoords[3]-this.readbackScreenCoords[1]));if(this._readbackTexture)this._readbackTexture.resize(o,s);else{const e=new l(o,s);e.wrapMode=33071,e.internalFormat=d.RGBA8,this._readbackTexture=new u(t,e)}return this._readbackTexture}}export{m as default};