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

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 (542) hide show
  1. package/WebScene.d.ts +6 -3
  2. package/WebScene.js +1 -1
  3. package/applications/WebEditor/geometryUtils.d.ts +1 -1
  4. package/arcade/arcadeAsyncRuntime.js +1 -1
  5. package/arcade/arcadeCompiler.js +1 -1
  6. package/arcade/arcadeRuntime.js +1 -1
  7. package/arcade/containerUtils.js +1 -1
  8. package/arcade/functions/track.js +1 -1
  9. package/arcgisGlobal.d.ts +2 -0
  10. package/assets/components/assets/icon/aiAgent16.json +1 -0
  11. package/assets/components/assets/icon/aiAgent24.json +1 -0
  12. package/assets/components/assets/icon/aiAgent32.json +1 -0
  13. package/assets/components/assets/icon/aiAgents16.json +1 -0
  14. package/assets/components/assets/icon/aiAgents24.json +1 -0
  15. package/assets/components/assets/icon/aiAgents32.json +1 -0
  16. package/assets/components/assets/icon/explodeGeometry16.json +1 -0
  17. package/assets/components/assets/icon/explodeGeometry24.json +1 -0
  18. package/assets/components/assets/icon/explodeGeometry32.json +1 -0
  19. package/assets/components/assets/icon/integration16.json +1 -0
  20. package/assets/components/assets/icon/integration24.json +1 -0
  21. package/assets/components/assets/icon/integration32.json +1 -0
  22. package/assets/components/assets/icon/spatiotemporalCatalog16.json +1 -0
  23. package/assets/components/assets/icon/spatiotemporalCatalog24.json +1 -0
  24. package/assets/components/assets/icon/spatiotemporalCatalog32.json +1 -0
  25. package/assets/components/assets/input-time-zone/t9n/messages.de.json +1 -1
  26. package/assets/esri/core/workers/RemoteClient.js +1 -1
  27. package/assets/esri/core/workers/chunks/000f91a18c22377f8525.js +1 -0
  28. package/assets/esri/core/workers/chunks/{05662a663f761dd3dea5.js → 006146ad6d4a5cbf1a1f.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{bd1a7e95a797e1ed4a7b.js → 013c17e07756fa465845.js} +1 -1
  30. package/assets/esri/core/workers/chunks/014eaccf2c2d357981f0.js +1 -0
  31. package/assets/esri/core/workers/chunks/{f253875feb11883deb84.js → 04d4cd66485b622403d0.js} +1 -1
  32. package/assets/esri/core/workers/chunks/05eb064f9b543890ae24.js +1 -0
  33. package/assets/esri/core/workers/chunks/{26737d061c7cfbbab95c.js → 0809a55a2f9be07cc5a9.js} +1 -1
  34. package/assets/esri/core/workers/chunks/0930738f43ce09b2ed2d.js +1 -0
  35. package/assets/esri/core/workers/chunks/{691434d4c6a38e63d819.js → 0a242e76bc293b0ad04b.js} +1 -1
  36. package/assets/esri/core/workers/chunks/0a4092578dc7578bcf76.js +1 -0
  37. package/assets/esri/core/workers/chunks/0e11bee9b56a7f51b012.js +1 -0
  38. package/assets/esri/core/workers/chunks/0e65869a5dd5a3917da7.js +1 -0
  39. package/assets/esri/core/workers/chunks/0ffb5a1275d07dcd9115.js +1 -0
  40. package/assets/esri/core/workers/chunks/{e370a3337b3c90240e73.js → 105da965fc90604eb6bf.js} +1 -1
  41. package/assets/esri/core/workers/chunks/1082bb0858585bd4fa21.js +2 -0
  42. package/assets/esri/core/workers/chunks/{5235b9c21ac4156c2375.js → 10f4c5533f50c3693318.js} +1 -1
  43. package/assets/esri/core/workers/chunks/1201bb22a2bfd7d7ecba.js +1 -0
  44. package/assets/esri/core/workers/chunks/16f55c5d642a23c2547e.js +1 -0
  45. package/assets/esri/core/workers/chunks/{09e01fd1c199be0c8e03.js → 16ffbe484f6cd4736f79.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{1bf967c68d0c795d3fb4.js → 19a4907fc93ae8b817e9.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{f74c7cbe4bd12f73ae90.js → 19d7339f20f3008c4893.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{a8aa8cb60b30f0983e7e.js → 1a9f17781e0a3bc5106f.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{bf7875fda48b15271a10.js → 1bef7097fe5e402539ea.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{fa377112ef3b78f6ed18.js → 1de1cc0ed0f169a58aff.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{0549e2badf511e27aa54.js → 1e3b07cf0e608431a277.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{2e51764c8aa31096cb2a.js → 20feca2fdd304b3e9664.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{4c73c2f4331351e2a50c.js → 22ff018342860249b3eb.js} +1 -1
  54. package/assets/esri/core/workers/chunks/248df6fda489a9de5852.js +1 -0
  55. package/assets/esri/core/workers/chunks/279b16727d4b515eca44.js +1 -0
  56. package/assets/esri/core/workers/chunks/2b10d6597af3eeec5396.js +1 -0
  57. package/assets/esri/core/workers/chunks/2bd4b536e329112591c4.js +1 -0
  58. package/assets/esri/core/workers/chunks/2c01477b69c38f691e19.js +1 -0
  59. package/assets/esri/core/workers/chunks/2e2349387a2b9903f13c.js +2 -0
  60. package/assets/esri/core/workers/chunks/{4d700cb028f6306b163e.js → 32aa1529e84b839d051d.js} +1 -1
  61. package/assets/esri/core/workers/chunks/33041e50ea02d99480b0.js +1 -0
  62. package/assets/esri/core/workers/chunks/{5d7a5aa608ed6192b016.js → 349982635e921e838030.js} +1 -1
  63. package/assets/esri/core/workers/chunks/35d0a7597473d46866de.js +1 -0
  64. package/assets/esri/core/workers/chunks/374d726fdd0a9848cea5.js +1 -0
  65. package/assets/esri/core/workers/chunks/379f5ca5372d834af497.js +1 -0
  66. package/assets/esri/core/workers/chunks/37ae52c71bf9c70fbb92.js +1 -0
  67. package/assets/esri/core/workers/chunks/{05393b23ab24126d4236.js → 38bc5d09ae07f486d457.js} +1 -1
  68. package/assets/esri/core/workers/chunks/3bafa01ca01a67d09432.js +1 -0
  69. package/assets/esri/core/workers/chunks/3c7901ea007c9615ba54.js +1 -0
  70. package/assets/esri/core/workers/chunks/4047208f9559e06d7102.js +1 -0
  71. package/assets/esri/core/workers/chunks/4049e9b86c8e27a7ff12.js +1 -0
  72. package/assets/esri/core/workers/chunks/411bbdecba340df11d95.js +2 -0
  73. package/assets/esri/core/workers/chunks/42b5533f94ebcdc4befe.js +1 -0
  74. package/assets/esri/core/workers/chunks/44ca13c874b5aa0ed5a0.js +1 -0
  75. package/assets/esri/core/workers/chunks/4717831effb1ac6d5f5d.js +1 -0
  76. package/assets/esri/core/workers/chunks/{5edf77618ca51819d7c4.js → 476535cfb06ced74d611.js} +2 -2
  77. package/assets/esri/core/workers/chunks/486f1277fe834c0fc4c1.js +1 -0
  78. package/assets/esri/core/workers/chunks/48ade66f1685a1aaffba.js +1 -0
  79. package/assets/esri/core/workers/chunks/4d13c1a04788e5222678.js +1 -0
  80. package/assets/esri/core/workers/chunks/{cc3186dcbbf5edff8b9e.js → 4d7f6c92041d52cc8732.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{595edbc1e9bba47d5676.js → 4f89da01b67b66a92c01.js} +1 -1
  82. package/assets/esri/core/workers/chunks/507bbcde2b39321b50a4.js +1 -0
  83. package/assets/esri/core/workers/chunks/{9b8e33985310f281f084.js → 56a5b65961e722f5cae9.js} +1 -1
  84. package/assets/esri/core/workers/chunks/5830deda121e4c95d199.js +1 -0
  85. package/assets/esri/core/workers/chunks/{b102ae764c14d8b32ace.js → 58a52adc42fbe5cd12c6.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{b0e25ccb5a1e57a82628.js → 58b93f13316196d2e97d.js} +1 -1
  87. package/assets/esri/core/workers/chunks/58f98bd89b644cfdafae.js +1 -0
  88. package/assets/esri/core/workers/chunks/5a8658e4ef5163e8ab3b.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/ad695de9f73b268af139.js +1 -0
  145. package/assets/esri/core/workers/chunks/{b13d2da33ec07e9d41ff.js → b0da2b089a89d643df1e.js} +1 -1
  146. package/assets/esri/core/workers/chunks/{65f4ca7201e7267bfc81.js → b5fcf4165ac72654742d.js} +1 -1
  147. package/assets/esri/core/workers/chunks/b82b523b6837ed1f28d3.js +2 -0
  148. package/assets/esri/core/workers/chunks/{527b87fddf33bb5d519e.js → ba77a8892cb23c7a297d.js} +1 -1
  149. package/assets/esri/core/workers/chunks/bb8089929ded0613d8e7.js +1 -0
  150. package/assets/esri/core/workers/chunks/bc7ca87d3bfe8a4aec81.js +1 -0
  151. package/assets/esri/core/workers/chunks/bc9b96a539f28afcb8cb.js +1 -0
  152. package/assets/esri/core/workers/chunks/{2d07d5a9ec67c39ef10c.js → bd4f29d2681e5596591a.js} +1 -1
  153. package/assets/esri/core/workers/chunks/bf9eba555aebca2c132b.js +1 -0
  154. package/assets/esri/core/workers/chunks/{903c7bd079888f65fef1.js → c3fbd81bb5820e48038f.js} +1 -1
  155. package/assets/esri/core/workers/chunks/c9df18e9ff7367a004b6.js +1 -0
  156. package/assets/esri/core/workers/chunks/ca8061e0a6d78d646ebf.js +1 -0
  157. package/assets/esri/core/workers/chunks/cc73ac8404615dc392d2.js +1 -0
  158. package/assets/esri/core/workers/chunks/{e823c9ccb7bc348d8824.js → ccb26860518dce6d01c0.js} +1 -1
  159. package/assets/esri/core/workers/chunks/cded34b161fcc790e672.js +1 -0
  160. package/assets/esri/core/workers/chunks/{1bf5c0a4bc5a960a3fa2.js → d1d4979e9dcabe5e4619.js} +1 -1
  161. package/assets/esri/core/workers/chunks/d2865c604849ce79183f.js +1 -0
  162. package/assets/esri/core/workers/chunks/{9b81bd62a2c72f592db1.js → d826f6d32b4c5885276a.js} +1 -1
  163. package/assets/esri/core/workers/chunks/d92540d3ffc4af980dd8.js +1 -0
  164. package/assets/esri/core/workers/chunks/dc7853795439ae77ace9.js +1 -0
  165. package/assets/esri/core/workers/chunks/{1f047dd747e7c1916dc7.js → dd55737fba0a8fe68101.js} +3 -3
  166. package/assets/esri/core/workers/chunks/dd8d19eb6b8e955c8067.js +1 -0
  167. package/assets/esri/core/workers/chunks/dda269a088275c823b40.js +1 -0
  168. package/assets/esri/core/workers/chunks/{7b70d6fdfa7a19ffffb0.js → de95dee8db92cf8f796f.js} +1 -1
  169. package/assets/esri/core/workers/chunks/e1c8767143f9f9d1f049.js +1 -0
  170. package/assets/esri/core/workers/chunks/{2cf2f2842c19be84ab4d.js → e6cb31c727f799c1297c.js} +1 -1
  171. package/assets/esri/core/workers/chunks/e934ef66d130c212c05b.js +1 -0
  172. package/assets/esri/core/workers/chunks/{7c56446184abcd14678b.js → ea77654c8964cc39b9a6.js} +1 -1
  173. package/assets/esri/core/workers/chunks/eb167f9f6132a6348d2e.js +1 -0
  174. package/assets/esri/core/workers/chunks/ed5ac1efd3cba49be756.js +1 -0
  175. package/assets/esri/core/workers/chunks/ef24fd6c0322e5de9fdf.js +2 -0
  176. package/assets/esri/core/workers/chunks/f219ba010c480bb75684.js +1 -0
  177. package/assets/esri/core/workers/chunks/fbf2d90240d36f8b423f.js +1 -0
  178. package/assets/esri/core/workers/chunks/{4ee99e654dad6f09abee.js → fc042b9936686785c39e.js} +1 -1
  179. package/assets/esri/core/workers/chunks/fc1658eae7b312502fab.js +1 -0
  180. package/assets/esri/core/workers/chunks/{af6b9fd77b1792fbb66e.js → fd4d124c5bf810d9e352.js} +1 -1
  181. package/assets/esri/core/workers/chunks/ffa35ecc681ec1c4739a.js +1 -0
  182. package/assets/esri/core/workers/chunks/ffca0b2333e760b66d3a.js +1 -0
  183. package/config.js +1 -1
  184. package/editing/sharedTemplates/executor/builders/bufferLineToPolygon.js +1 -1
  185. package/editing/sharedTemplates/executor/builders/bufferPointToPolygon.js +1 -1
  186. package/editing/sharedTemplates/executor/builders/bufferPolygonToPolygon.js +1 -1
  187. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  188. package/editing/sharedTemplates/executor/builders/support/offsetUtils.js +1 -1
  189. package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +1 -1
  190. package/geometry/Polygon.js +1 -1
  191. package/geometry/geometryEngine.d.ts +36 -36
  192. package/geometry/operators/affineTransformOperator.d.ts +30 -1
  193. package/geometry/operators/affineTransformOperator.js +1 -1
  194. package/geometry/operators/alphaShapeOperator.d.ts +49 -5
  195. package/geometry/operators/alphaShapeOperator.js +1 -1
  196. package/geometry/operators/areaOperator.d.ts +28 -4
  197. package/geometry/operators/areaOperator.js +1 -1
  198. package/geometry/operators/autoCompleteOperator.d.ts +25 -2
  199. package/geometry/operators/autoCompleteOperator.js +1 -1
  200. package/geometry/operators/boundaryOperator.d.ts +40 -2
  201. package/geometry/operators/boundaryOperator.js +1 -1
  202. package/geometry/operators/bufferOperator.d.ts +51 -6
  203. package/geometry/operators/bufferOperator.js +1 -1
  204. package/geometry/operators/centroidOperator.d.ts +23 -2
  205. package/geometry/operators/centroidOperator.js +1 -1
  206. package/geometry/operators/clipOperator.d.ts +34 -2
  207. package/geometry/operators/clipOperator.js +1 -1
  208. package/geometry/operators/containsOperator.d.ts +32 -2
  209. package/geometry/operators/containsOperator.js +1 -1
  210. package/geometry/operators/convexHullOperator.d.ts +47 -4
  211. package/geometry/operators/convexHullOperator.js +1 -1
  212. package/geometry/operators/crossesOperator.d.ts +35 -2
  213. package/geometry/operators/crossesOperator.js +1 -1
  214. package/geometry/operators/cutOperator.d.ts +23 -2
  215. package/geometry/operators/cutOperator.js +1 -1
  216. package/geometry/operators/densifyOperator.d.ts +61 -6
  217. package/geometry/operators/densifyOperator.js +1 -1
  218. package/geometry/operators/differenceOperator.d.ts +34 -2
  219. package/geometry/operators/differenceOperator.js +1 -1
  220. package/geometry/operators/disjointOperator.d.ts +33 -2
  221. package/geometry/operators/disjointOperator.js +1 -1
  222. package/geometry/operators/distanceOperator.d.ts +29 -4
  223. package/geometry/operators/distanceOperator.js +1 -1
  224. package/geometry/operators/equalsOperator.d.ts +32 -2
  225. package/geometry/operators/equalsOperator.js +1 -1
  226. package/geometry/operators/extendOperator.d.ts +29 -3
  227. package/geometry/operators/extendOperator.js +1 -1
  228. package/geometry/operators/generalizeOperator.d.ts +46 -5
  229. package/geometry/operators/generalizeOperator.js +1 -1
  230. package/geometry/operators/geodesicBufferOperator.d.ts +71 -7
  231. package/geometry/operators/geodesicBufferOperator.js +1 -1
  232. package/geometry/operators/geodesicProximityOperator.d.ts +106 -14
  233. package/geometry/operators/geodesicProximityOperator.js +1 -1
  234. package/geometry/operators/geodeticAreaOperator.d.ts +51 -5
  235. package/geometry/operators/geodeticAreaOperator.js +1 -1
  236. package/geometry/operators/geodeticDensifyOperator.d.ts +65 -6
  237. package/geometry/operators/geodeticDensifyOperator.js +1 -1
  238. package/geometry/operators/geodeticDistanceOperator.d.ts +52 -5
  239. package/geometry/operators/geodeticDistanceOperator.js +1 -1
  240. package/geometry/operators/geodeticLengthOperator.d.ts +51 -5
  241. package/geometry/operators/geodeticLengthOperator.js +1 -1
  242. package/geometry/operators/geodeticUtilsOperator.d.ts +79 -9
  243. package/geometry/operators/geodeticUtilsOperator.js +1 -1
  244. package/geometry/operators/graphicBufferOperator.d.ts +47 -4
  245. package/geometry/operators/graphicBufferOperator.js +1 -1
  246. package/geometry/operators/integrateOperator.d.ts +24 -2
  247. package/geometry/operators/integrateOperator.js +1 -1
  248. package/geometry/operators/intersectionOperator.d.ts +88 -3
  249. package/geometry/operators/intersectionOperator.js +1 -1
  250. package/geometry/operators/intersectsOperator.d.ts +32 -2
  251. package/geometry/operators/intersectsOperator.js +1 -1
  252. package/geometry/operators/isNearOperator.d.ts +31 -4
  253. package/geometry/operators/isNearOperator.js +1 -1
  254. package/geometry/operators/json/bufferOperator.js +1 -1
  255. package/geometry/operators/json/containsOperator.js +1 -1
  256. package/geometry/operators/json/convexHullOperator.js +1 -1
  257. package/geometry/operators/json/crossesOperator.js +1 -1
  258. package/geometry/operators/json/disjointOperator.js +1 -1
  259. package/geometry/operators/json/generalizeOperator.js +1 -1
  260. package/geometry/operators/json/geodesicBufferOperator.js +1 -1
  261. package/geometry/operators/json/graphicBufferOperator.js +1 -1
  262. package/geometry/operators/json/intersectionOperator.js +1 -1
  263. package/geometry/operators/json/intersectsOperator.js +1 -1
  264. package/geometry/operators/json/lengthOperator.js +1 -1
  265. package/geometry/operators/json/offsetOperator.js +1 -1
  266. package/geometry/operators/json/overlapsOperator.js +1 -1
  267. package/geometry/operators/json/projectOperator.js +1 -1
  268. package/geometry/operators/json/simplifyOperator.js +1 -1
  269. package/geometry/operators/json/simplifyOperatorOGC.js +1 -1
  270. package/geometry/operators/json/touchesOperator.js +1 -1
  271. package/geometry/operators/json/unionOperator.js +1 -1
  272. package/geometry/operators/json/withinOperator.js +1 -1
  273. package/geometry/operators/labelPointOperator.d.ts +32 -2
  274. package/geometry/operators/labelPointOperator.js +1 -1
  275. package/geometry/operators/lengthOperator.d.ts +28 -4
  276. package/geometry/operators/lengthOperator.js +1 -1
  277. package/geometry/operators/linesToPolygonsOperator.d.ts +23 -2
  278. package/geometry/operators/linesToPolygonsOperator.js +1 -1
  279. package/geometry/operators/locateBetweenOperator.d.ts +28 -2
  280. package/geometry/operators/locateBetweenOperator.js +1 -1
  281. package/geometry/operators/minimumBoundingCircleOperator.d.ts +38 -4
  282. package/geometry/operators/minimumBoundingCircleOperator.js +1 -1
  283. package/geometry/operators/multiPartToSinglePartOperator.d.ts +33 -4
  284. package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
  285. package/geometry/operators/offsetOperator.d.ts +50 -5
  286. package/geometry/operators/offsetOperator.js +1 -1
  287. package/geometry/operators/overlapsOperator.d.ts +33 -2
  288. package/geometry/operators/overlapsOperator.js +1 -1
  289. package/geometry/operators/polygonOverlayOperator.d.ts +31 -5
  290. package/geometry/operators/polygonOverlayOperator.js +1 -1
  291. package/geometry/operators/polygonSlicerOperator.d.ts +72 -10
  292. package/geometry/operators/polygonSlicerOperator.js +1 -1
  293. package/geometry/operators/projectOperator.d.ts +63 -3
  294. package/geometry/operators/projectOperator.js +1 -1
  295. package/geometry/operators/proximityOperator.d.ts +71 -9
  296. package/geometry/operators/proximityOperator.js +1 -1
  297. package/geometry/operators/relateOperator.d.ts +41 -2
  298. package/geometry/operators/relateOperator.js +1 -1
  299. package/geometry/operators/reshapeOperator.d.ts +28 -2
  300. package/geometry/operators/reshapeOperator.js +1 -1
  301. package/geometry/operators/shapePreservingProjectOperator.d.ts +64 -6
  302. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  303. package/geometry/operators/simplifyOGCOperator.d.ts +72 -6
  304. package/geometry/operators/simplifyOGCOperator.js +1 -1
  305. package/geometry/operators/simplifyOperator.d.ts +72 -4
  306. package/geometry/operators/simplifyOperator.js +1 -1
  307. package/geometry/operators/singlePartToMultiPartOperator.js +1 -1
  308. package/geometry/operators/support/Transformation.d.ts +17 -11
  309. package/geometry/operators/support/jsonConverter.js +1 -1
  310. package/geometry/operators/symmetricDifferenceOperator.d.ts +33 -2
  311. package/geometry/operators/symmetricDifferenceOperator.js +1 -1
  312. package/geometry/operators/touchesOperator.d.ts +32 -2
  313. package/geometry/operators/touchesOperator.js +1 -1
  314. package/geometry/operators/types.d.ts +4 -1
  315. package/geometry/operators/unionOperator.d.ts +33 -2
  316. package/geometry/operators/unionOperator.js +1 -1
  317. package/geometry/operators/withinOperator.d.ts +32 -2
  318. package/geometry/operators/withinOperator.js +1 -1
  319. package/geometry/projectionUtils.js +1 -1
  320. package/geometry/support/geometryUtils.js +1 -1
  321. package/geometry/support/normalizeUtils.d.ts +5 -3
  322. package/geometry/support/normalizeUtils.js +1 -1
  323. package/interfaces.d.ts +202 -202
  324. package/kernel.js +1 -1
  325. package/layers/graphics/data/QueryEngineResult.js +1 -1
  326. package/layers/graphics/data/queryUtils.js +1 -1
  327. package/layers/graphics/data/spatialQuerySupport.js +1 -1
  328. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  329. package/layers/list/Item.d.ts +27 -3
  330. package/layers/list/Item.js +1 -1
  331. package/layers/list/ItemPanel.d.ts +1 -1
  332. package/layers/list/LayerItemCollection.js +1 -1
  333. package/layers/mixins/ArcGISImageService.js +1 -1
  334. package/layers/mixins/TiledImagery.js +1 -1
  335. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  336. package/layers/raster/datasets/FunctionRaster.js +1 -1
  337. package/layers/raster/datasets/pixelReader.js +1 -1
  338. package/layers/raster/functions/clipUtils.js +1 -1
  339. package/layers/raster/functions/rasterProjectionHelper.js +1 -1
  340. package/layers/support/Sublayer.js +1 -1
  341. package/layers/support/trackInfoUtils.js +2 -0
  342. package/layers/video/videoUtils.js +1 -1
  343. package/package.json +5 -5
  344. package/popup/FeatureContentCollection.d.ts +3 -3
  345. package/popup/FeatureContentCollection.js +1 -1
  346. package/portal/schemas/definitions.js +1 -1
  347. package/portal/schemas/webScene.js +1 -1
  348. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  349. package/support/revision.js +1 -1
  350. package/support/tests/serviceMockDependencies.js +1 -1
  351. package/support/tests/setupServiceMocksMesh.js +1 -1
  352. package/symbols/cim/CIMEffects.js +1 -1
  353. package/symbols/cim/effects/EffectBuffer.js +1 -1
  354. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  355. package/symbols/cim/effects/EffectDonut.js +1 -1
  356. package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
  357. package/symbols/cim/effects/EffectOffset.js +1 -1
  358. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  359. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +1 -1
  360. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementController.js +1 -1
  361. package/views/2d/engine/webgl/Overlay.js +1 -1
  362. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  363. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  364. package/views/2d/layers/TileLayerView2D.js +1 -1
  365. package/views/2d/layers/support/RouteLayerWaypointVisualization.js +1 -1
  366. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  367. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementController.js +1 -1
  368. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  369. package/views/3d/layers/ElevationLayerView3DModifications.js +1 -1
  370. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  371. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  372. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  373. package/views/MapView.d.ts +3 -3
  374. package/views/SceneView.js +1 -1
  375. package/views/VideoView.js +1 -1
  376. package/views/View2D.d.ts +22 -22
  377. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  378. package/views/draw/DrawTool.js +1 -1
  379. package/views/draw/support/createUtils.js +1 -1
  380. package/views/layers/SceneLayerView.js +1 -1
  381. package/views/support/GeometryWorker.js +1 -1
  382. package/views/support/imageReprojection.js +1 -1
  383. package/views/video/VideoOperationalDataView.js +1 -1
  384. package/webscene/InitialViewProperties.d.ts +9 -1
  385. package/webscene/InitialViewProperties.js +1 -1
  386. package/webscene/Slide.d.ts +10 -1
  387. package/webscene/Slide.js +1 -1
  388. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  389. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  390. package/widgets/BatchAttributeForm/expressions/expressionUtils.js +1 -1
  391. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  392. package/widgets/BatchAttributeForm/templates/FieldElementTemplate.js +1 -1
  393. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  394. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  395. package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
  396. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  397. package/widgets/ElevationProfile/support/ElevationProfileView.js +1 -1
  398. package/widgets/ElevationProfile/support/InputRepresentation2D.js +1 -1
  399. package/widgets/ElevationProfile/support/InputRepresentation3D.js +1 -1
  400. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  401. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  402. package/widgets/Features/FeaturesViewModel.js +1 -1
  403. package/widgets/Features.js +1 -1
  404. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  405. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  406. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  407. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  408. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  409. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  410. package/widgets/OrientedImageryViewer/support/panConstraint.js +1 -1
  411. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  412. package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
  413. package/widgets/Print.js +1 -1
  414. package/widgets/Search/SearchViewModel.js +1 -1
  415. package/widgets/Search/support/layerSearchUtils.js +1 -1
  416. package/widgets/Search/support/locatorUtils.js +1 -1
  417. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  418. package/widgets/support/FilterBuilder/FilterBuilderViewModel.d.ts +104 -0
  419. package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
  420. package/widgets/support/FilterBuilder.js +1 -1
  421. package/widgets/support/FilterCondition/FilterConditionViewModel.d.ts +145 -0
  422. package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
  423. package/widgets/support/FilterCondition/types.d.ts +20 -0
  424. package/widgets/support/ItemList.js +1 -1
  425. package/widgets/support/SelectionList/FeatureItem.d.ts +17 -68
  426. package/widgets/support/SelectionList/FeatureItem.js +1 -1
  427. package/widgets/support/SelectionList/GroupLayerItem.d.ts +12 -50
  428. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  429. package/widgets/support/SelectionList/ItemBase.d.ts +14 -44
  430. package/widgets/support/SelectionList/ItemBase.js +1 -1
  431. package/widgets/support/SelectionList/LayerItem.d.ts +10 -56
  432. package/widgets/support/SelectionList/LayerItem.js +1 -1
  433. package/widgets/support/SelectionList/types.d.ts +4 -4
  434. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  435. package/assets/esri/core/workers/chunks/090ea7a131f8f60203ed.js +0 -1
  436. package/assets/esri/core/workers/chunks/0b4a7209b99227a842ad.js +0 -1
  437. package/assets/esri/core/workers/chunks/0be98adfef79fc5036f0.js +0 -1
  438. package/assets/esri/core/workers/chunks/0d2e2d90a4e4a28e2c0c.js +0 -1
  439. package/assets/esri/core/workers/chunks/0d7763d39a5a8586a0ae.js +0 -1
  440. package/assets/esri/core/workers/chunks/0d95f72e1c07ab867d21.js +0 -1
  441. package/assets/esri/core/workers/chunks/0dbbac7a2378728571a7.js +0 -1
  442. package/assets/esri/core/workers/chunks/0df9864ecebe6a2b973f.js +0 -1
  443. package/assets/esri/core/workers/chunks/104d74bc36c28c519396.js +0 -1
  444. package/assets/esri/core/workers/chunks/1670e9867efde4d7a6d6.js +0 -1
  445. package/assets/esri/core/workers/chunks/1c803eef9a8fdabc61e3.js +0 -2
  446. package/assets/esri/core/workers/chunks/1e192ac0533a5c0b5a7a.js +0 -1
  447. package/assets/esri/core/workers/chunks/1fe077f57a087c0e9119.js +0 -1
  448. package/assets/esri/core/workers/chunks/20f7b5fe64a217cb3d3d.js +0 -1
  449. package/assets/esri/core/workers/chunks/212222b64039d436b9a6.js +0 -1
  450. package/assets/esri/core/workers/chunks/24944b625ed8dcd904f0.js +0 -1
  451. package/assets/esri/core/workers/chunks/2b6d261fe79fe186fb22.js +0 -1
  452. package/assets/esri/core/workers/chunks/2bc3e7f394386fa75447.js +0 -1
  453. package/assets/esri/core/workers/chunks/30af0f7c4cfa541c9efd.js +0 -1
  454. package/assets/esri/core/workers/chunks/30d816bdeea00f6fa1ca.js +0 -1
  455. package/assets/esri/core/workers/chunks/35d46c2f658a8e92d913.js +0 -1
  456. package/assets/esri/core/workers/chunks/36e35a8067b18f59cc05.js +0 -1
  457. package/assets/esri/core/workers/chunks/3869dca884d7ca6488f5.js +0 -1
  458. package/assets/esri/core/workers/chunks/3f5234120d3a14186c1c.js +0 -1
  459. package/assets/esri/core/workers/chunks/45c1c90ac6c14657f3ff.js +0 -1
  460. package/assets/esri/core/workers/chunks/4a40b894ec89b0a4f9bf.js +0 -1
  461. package/assets/esri/core/workers/chunks/5165d367328ac7badf47.js +0 -1
  462. package/assets/esri/core/workers/chunks/5168bd8ab6233dc9c32a.js +0 -1
  463. package/assets/esri/core/workers/chunks/545bec045167c433af8f.js +0 -1
  464. package/assets/esri/core/workers/chunks/5782c0362a1799ceef41.js +0 -1
  465. package/assets/esri/core/workers/chunks/59598023c0aea62a6297.js +0 -1
  466. package/assets/esri/core/workers/chunks/59f0a2bd40b033ce77e4.js +0 -1
  467. package/assets/esri/core/workers/chunks/5af16937904c06fb06f6.js +0 -1
  468. package/assets/esri/core/workers/chunks/5b8591486f33627f5389.js +0 -1
  469. package/assets/esri/core/workers/chunks/6057a79c68c33ee4a193.js +0 -1
  470. package/assets/esri/core/workers/chunks/607acd9f615f87e14075.js +0 -1
  471. package/assets/esri/core/workers/chunks/62ee6c247f783acabb74.js +0 -1
  472. package/assets/esri/core/workers/chunks/63127e3b22e7eac6003d.js +0 -2
  473. package/assets/esri/core/workers/chunks/6564f17c4700dc8d9c0e.js +0 -2
  474. package/assets/esri/core/workers/chunks/678585509706755c0434.js +0 -2
  475. package/assets/esri/core/workers/chunks/691e9cc541cfaebe1776.js +0 -1
  476. package/assets/esri/core/workers/chunks/6a2d890640b2cd6c5ccb.js +0 -1
  477. package/assets/esri/core/workers/chunks/6b84982dfaf084a61b93.js +0 -1
  478. package/assets/esri/core/workers/chunks/6cbc30b31f0bb39c73ca.js +0 -1
  479. package/assets/esri/core/workers/chunks/6f01bd01b13662eb3bd7.js +0 -1
  480. package/assets/esri/core/workers/chunks/74cd9df85c4560bb8e52.js +0 -1
  481. package/assets/esri/core/workers/chunks/75bddfe2be64379db8fd.js +0 -1
  482. package/assets/esri/core/workers/chunks/7cf903db44f3647c8fd4.js +0 -1
  483. package/assets/esri/core/workers/chunks/7ddb5800777fbecee3a8.js +0 -1
  484. package/assets/esri/core/workers/chunks/7eae9053065d3d38e54e.js +0 -1
  485. package/assets/esri/core/workers/chunks/80f38ab2b7ae61e6f301.js +0 -1
  486. package/assets/esri/core/workers/chunks/854f42f16fdb40000aae.js +0 -1
  487. package/assets/esri/core/workers/chunks/87094044458b0ea5cb0f.js +0 -2
  488. package/assets/esri/core/workers/chunks/88f03352a4dc6184ea1f.js +0 -1
  489. package/assets/esri/core/workers/chunks/909ee7d2a0eec773037a.js +0 -1
  490. package/assets/esri/core/workers/chunks/91ac9328afff8a51bd96.js +0 -1
  491. package/assets/esri/core/workers/chunks/92a6559a6999b26362d7.js +0 -1
  492. package/assets/esri/core/workers/chunks/94ddfe165ac25aef8229.js +0 -1
  493. package/assets/esri/core/workers/chunks/9509bef285929c52c244.js +0 -1
  494. package/assets/esri/core/workers/chunks/99966339b061eb9945b8.js +0 -1
  495. package/assets/esri/core/workers/chunks/99f627938dbf0152fc02.js +0 -1
  496. package/assets/esri/core/workers/chunks/9df38cadebf8e6fd746c.js +0 -1
  497. package/assets/esri/core/workers/chunks/9e2b3754a76e0dd4a94a.js +0 -1
  498. package/assets/esri/core/workers/chunks/a0565137027c83108953.js +0 -1
  499. package/assets/esri/core/workers/chunks/a0eb882a5a81d25b9153.js +0 -1
  500. package/assets/esri/core/workers/chunks/a785e827f0215a73103d.js +0 -1
  501. package/assets/esri/core/workers/chunks/abe7670db06b27c0c8c8.js +0 -1
  502. package/assets/esri/core/workers/chunks/b19cff0e43fab2632660.js +0 -1
  503. package/assets/esri/core/workers/chunks/b333de4dea14c5db0a4d.js +0 -1
  504. package/assets/esri/core/workers/chunks/b6af90be328ebda26b8d.js +0 -1
  505. package/assets/esri/core/workers/chunks/b7c0da9d255d5e48320d.js +0 -1
  506. package/assets/esri/core/workers/chunks/bd7d87d175ba933ab2ce.js +0 -1
  507. package/assets/esri/core/workers/chunks/be0417df35a7d99af675.js +0 -1
  508. package/assets/esri/core/workers/chunks/c30b6bbabd05e4976fba.js +0 -1
  509. package/assets/esri/core/workers/chunks/c35553d07ad169910742.js +0 -1
  510. package/assets/esri/core/workers/chunks/c5c2fed38e0ccf84f1fa.js +0 -1
  511. package/assets/esri/core/workers/chunks/c88bfa51d2a8a024fc24.js +0 -1
  512. package/assets/esri/core/workers/chunks/ca36d85a47179d95f2fc.js +0 -1
  513. package/assets/esri/core/workers/chunks/d0cf9ff48f051adbd455.js +0 -1
  514. package/assets/esri/core/workers/chunks/d1304d414b1fa725168a.js +0 -1
  515. package/assets/esri/core/workers/chunks/d24125a791247019e2ca.js +0 -1
  516. package/assets/esri/core/workers/chunks/d26be8313526ecea9c68.js +0 -1
  517. package/assets/esri/core/workers/chunks/d2cb3d5ef0a9285afb78.js +0 -1
  518. package/assets/esri/core/workers/chunks/d4b0012ae1d3b8a9ba01.js +0 -1
  519. package/assets/esri/core/workers/chunks/e018cbd97e6e0e4ca5c4.js +0 -1
  520. package/assets/esri/core/workers/chunks/e39bccc000c768120a32.js +0 -1
  521. package/assets/esri/core/workers/chunks/e4380706b629729f2212.js +0 -1
  522. package/assets/esri/core/workers/chunks/ea1877ce00da3b585a30.js +0 -1
  523. package/assets/esri/core/workers/chunks/ea5ee1b12b43594592a0.js +0 -1
  524. package/assets/esri/core/workers/chunks/ea91c57a0b31f3f65ee5.js +0 -1
  525. package/assets/esri/core/workers/chunks/eafc591e1a98000d54ef.js +0 -1
  526. package/assets/esri/core/workers/chunks/ef851a2cff76fd211c07.js +0 -1
  527. package/assets/esri/core/workers/chunks/f3e53be08ab9dbdf17ae.js +0 -1
  528. package/assets/esri/core/workers/chunks/f53010adb70463b75bb9.js +0 -1
  529. package/assets/esri/core/workers/chunks/f5a058a0ce006bce2a2a.js +0 -1
  530. package/assets/esri/core/workers/chunks/f5f5b54cab722abe88e0.js +0 -1
  531. package/assets/esri/core/workers/chunks/f60ed579981913d44675.js +0 -1
  532. package/assets/esri/core/workers/chunks/f6f56f3e011dcef90bbb.js +0 -1
  533. package/assets/esri/core/workers/chunks/f83c3597e9332bd991eb.js +0 -1
  534. package/assets/esri/core/workers/chunks/f9a4387f850d85c44ca5.js +0 -1
  535. package/assets/esri/core/workers/chunks/fdd0e6d9927d3c43b0d3.js +0 -1
  536. package/geometry/operators/importUtils.js +0 -2
  537. /package/assets/esri/core/workers/chunks/{1c803eef9a8fdabc61e3.js.LICENSE.txt → 1082bb0858585bd4fa21.js.LICENSE.txt} +0 -0
  538. /package/assets/esri/core/workers/chunks/{87094044458b0ea5cb0f.js.LICENSE.txt → 2e2349387a2b9903f13c.js.LICENSE.txt} +0 -0
  539. /package/assets/esri/core/workers/chunks/{678585509706755c0434.js.LICENSE.txt → 411bbdecba340df11d95.js.LICENSE.txt} +0 -0
  540. /package/assets/esri/core/workers/chunks/{5edf77618ca51819d7c4.js.LICENSE.txt → 476535cfb06ced74d611.js.LICENSE.txt} +0 -0
  541. /package/assets/esri/core/workers/chunks/{6564f17c4700dc8d9c0e.js.LICENSE.txt → b82b523b6837ed1f28d3.js.LICENSE.txt} +0 -0
  542. /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{rad2deg as e}from"../../core/mathUtils.js";import{throwIfAborted as t}from"../../core/promiseUtils.js";import{createArea as n,createLength as r}from"../../core/quantity.js";import{formatArea as a,formatLength as o}from"../../core/quantityFormatUtils.js";import{set as i,determinant as c}from"../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{zeros as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{distance as u}from"../../core/libs/gl-matrix-2/math/vec2.js";import{set as f,cross as m}from"../../core/libs/gl-matrix-2/math/vec3.js";import{isSupported as p,geodesicLengths as y,geodesicAreas as h}from"../../geometry/geodesicUtils.js";import g from"../../geometry/Point.js";import x from"../../geometry/Polygon.js";import w from"../../geometry/Polyline.js";import{projectAsync as v,project as R}from"../../geometry/projectionUtils.js";import d from"../../geometry/SpatialReference.js";import{execute as M}from"../../geometry/operators/areaOperator.js";import{load as P,execute as z}from"../../geometry/operators/geodeticAreaOperator.js";import{load as j,execute as b}from"../../geometry/operators/geodeticDensifyOperator.js";import{load as E,execute as S}from"../../geometry/operators/geodeticLengthOperator.js";import{execute as L}from"../../geometry/operators/lengthOperator.js";import{execute as O}from"../../geometry/operators/simplifyOperator.js";import{imageToWorldPanoramic as W,imageToWorld as I}from"../../layers/orientedImagery/transformations/imageToWorld.js";import{getImageToWorldPanoramicProperties as q,getUpdateElevationProps as G,convertSphereVertexToPixelLocation as A,getImageToWorldProperties as D}from"../../layers/orientedImagery/transformations/utils.js";import{worldToImagePanoramic as U,worldToImage as k}from"../../layers/orientedImagery/transformations/worldToImage.js";const B=1e5,H="meters",F="square-meters";function T(e,t){let n=180*Math.atan2(-e.y+t.y,e.x-t.x)/Math.PI;return n<0&&(n+=180),n*Math.PI/180}function V(e,t){let n=180*Math.atan2(-e.y+t.y,e.x-t.x)/Math.PI;return n<0&&(n+=180),n*Math.PI/180}function C(e,t,n){if(!e?.length||!t?.length||!n)return;const[r,a]=e,[,o]=t,i=o-a;return[r+i*Math.cos(n),a+i*Math.sin(n)]}async function J(e,t,n){if(await j(),p(e)){const e=y([t],H)[0];return{area:h([n],F)[0],perimeter:e}}const r=d.WGS84,a=R(t,r),o=R(n,r);let i=b(o,B);if(i=i?O(i):null,!i)return null;const c=y([a],H)[0];return{area:h([i],F)[0],perimeter:c}}function K(e,t,n=1){const r=xe(e,!1);if(!r?.length)return;return 20*u([r[0].x,r[0].y],[r.at(-1).x,r.at(-1).y])*n/t}async function N(e){await E();const t=e.spatialReference;if(t.isGeographic){if(p(t))return y([e],H)[0];const n=R(e,d.WGS84);return y([n],H)[0]}return t.isWebMercator?S(e,{unit:H}):L(e,{unit:H})}function Q(e){if(!e?.length)throw new Error("Invalid deviations array");const[t,n,r]=[0,1,2].map(t=>e.map(e=>e[t]).filter(e=>null!==e)).map(e=>e.length?Pe(e):0);return[t,n,r]}function X(e,t){const n=O(t);if(!n)return null;const r=L(e,{unit:H});return{area:M(n,{unit:F}),perimeter:r}}function Y(e,t){return[(e[1][0]-e[0][0])/t,(e[1][1]-e[0][1])/t,(e[1][2]-e[0][2])/t]}async function Z(e,t){await Promise.all([P(),j(),E()]);let n=b(t,B);if(n=n?O(n):null,!n)return null;const r=S(e,{unit:H});return{area:z(n,{unit:F}),perimeter:r}}async function $(e,n,r){if(!n||!e)throw new Error("Missing required parameters");const a=await I(e,n);t(r);const o=a.clone();o.z?o.z+=20:o.z=20;const{averageElevation:i,cameraPitch:c,cameraRoll:s,farDistance:l,...u}=n;return k(o,u)}async function _(e,n,r,a){const{attributes:o}=r,{location:i}=o,{updateElevationProps:c,...s}=n;if(!e||!n)throw new Error("Missing parameters");let l=i.clone();l.spatialReference.isGeographic&&(l=await v(l,d.WebMercator));const u=await W(e,{...s,cameraLocation:l},c);t(a);const f=u.clone();return f.z?f.z+=20:f.z=20,U(f,s)}function ee(e,t,n,r,a=0,o=1,i){const{averageElevation:c,cameraPitch:s,cameraRoll:l,farDistance:f,...m}=r;if(a>=5||o<=.1){return{value:e*Ee(r.cameraLocation.spatialReference)}}const p=new g({x:t.x,y:t.y,z:t.z?t.z+e:e,spatialReference:r.cameraLocation.spatialReference}),y=k(p,m),h=u([n[0].x,n[0].y],[y.x,y.y]),x=n.at(0),w=n.at(-1);if(!x||!w)return null;const v=u([x.x,x.y],[w.x,w.y])*e/h;return ee(v,t,n,r,a+1,Math.abs(e-v))}function te(e,t,n,r,a=0,o=1,i){const{averageElevation:c,horizontalFieldOfView:s,verticalFieldOfView:l,farDistance:f,...m}=r;if(a>=5||o<=.1){return{value:e*Ee(r.cameraLocation.spatialReference)}}const p=new g({x:t.x,y:t.y,z:t.z?t.z+e:e,spatialReference:r.cameraLocation.spatialReference}),y=U(p,m),h=u([n[0].x,n[0].y],[y.x,y.y]),x=n.at(0),w=n.at(-1);if(!x||!w)return null;const v=u([x.x,x.y],[w.x,w.y])*e/h;return te(v,t,n,r,a+1,Math.abs(e-v))}async function ne(e,t,n){return e.spatialReference&&!t.spatialReference.equals(e.spatialReference)&&(t=await v(t,e.spatialReference)),new w({paths:[[[e.x,e.y,e.z??0],[t.x,t.y,t.z??0]]],spatialReference:n})}function re(e){return 1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*e/6378137)))}function ae(e,t){return Math.sqrt((Math.sqrt((e[0][0]-e[1][0])**2+(e[0][1]-e[1][1])**2)/t)**2+(e[0][2]-e[1][2])**2)}function oe(e,t){return Math.sqrt((e[0][0]-e[1][0])**2+(e[0][1]-e[1][1])**2)/t}function ie(t){return e(Math.atan((t[1][2]-t[0][2])/Math.sqrt((t[1][0]-t[0][0])**2+(t[1][1]-t[0][1])**2)))}function ce(t){let n=90-e(Math.atan2(t[1][1]-t[0][1],t[1][0]-t[0][0]));return n<0&&(n+=360),n}function se(e,t){return new g({x:(e.pointOnA[0]+e.pointOnB[0])/2,y:(e.pointOnA[1]+e.pointOnB[1])/2,z:(e.pointOnA[2]+e.pointOnB[2])/2,spatialReference:t})}async function le(e){if(2===e?.length){const t=[];let n=1;const[r,a]=e,o=r.camera.spatialReference,{measurePoints:i}=r;for(let e=0;e<i.length;e++){const i=await ne(r.camera,r.measurePoints[e],o),c=await ne(a.camera,a.measurePoints[e],o),s=await ke(i,c);if(!s)return null;const l=se(s,o);l.spatialReference.isWebMercator&&(n=re(l.y)),t.push([l.x,l.y,l.z??0])}if(t?.length>1){return{distance:ae(t,n),horizontalDistance:oe(t,n),verticalDistance:Math.abs(t[0][2]-t[1][2]),slope:ie(t),aspect:ce(t)}}}return null}async function ue(e){const t=e[0].camera.spatialReference;if(2!==e?.length)return null;const[n,r]=e,{camera:a,measurePoints:o}=n,{camera:i,measurePoints:c}=r,s=await ne(a,o[0],t),l=await ne(i,c[0],t),u=await ke(s,l);return u?se(u,t)??null:null}async function fe(e,t){if(!e?.length)return null;const n=[],r=e[0],a=e[1],o=r.camera.spatialReference,{measurePoints:i}=r;for(let u=0;u<i.length;u++){const e=await ne(r.camera,r.measurePoints[u],o),t=await ne(a.camera,a.measurePoints[u],o),i=await ke(e,t);if(!i)return null;const c=se(i,o);n.push([c.x,c.y,c.z??0])}if(n?.length<2)return null;const c=new w({paths:[n],spatialReference:t}),s=new x({rings:[n],spatialReference:t});if(t.isGeographic){const e=await J(t,c,s);return e?.area??null}if(t.isWebMercator){const e=await Z(c,s);return e?.area??null}const l=X(c,s);return l?.area??null}function me(e,t){if(!e)return null;return{camera:t.geometry.clone(),measurePoints:Array.isArray(e)?e:[e]}}async function pe(e,t){const{updateElevationProps:n,...r}=t;return await I(e,r,n)}async function ye(e,t){const{updateElevationProps:n,...r}=t;return W(e,r,n)}function he(e){navigator.clipboard.writeText(e).catch(e=>{throw e})}function ge(e){const t=e.map(e=>[e.x,e.y]),n=e[0].spatialReference;return new w({paths:[t],spatialReference:n})}function xe(e,t){return e.map(e=>({x:t?.5+e[0]:e[0],y:t?.5-e[1]:e[1]}))}function we(e,t,n,a,i){const c="measurement"===e?t:n;if(i&&c)return o(a,r(c,H),i,3)||null}function ve(e,t){const{cameraPitch:n,cameraRoll:r,cameraLocation:a}=e,{x:o,y:i,z:c,spatialReference:s}=a;if(t.every(e=>0===e)||!t||!t.length||!s)throw new Error("Invalid parameters");const[l,u,,f,m]=t,p=[-f,0,f],y=[-m,0,m],h=[-l,0,l],g=[-u,0,u],x=[];for(const w of p)for(const t of y)for(const a of h)for(const l of h)for(const u of g){const f={...e};f.cameraPitch=n+w,f.cameraRoll=r+t,f.cameraLocation={x:o+a,y:i+l,z:c?c+u:0,spatialReference:{wkid:s.wkid}},x.push(f)}return x}function Re(e,t){const{cameraHeading:n,cameraLocation:r}=e,{x:a,y:o,z:i,spatialReference:c}=r;if(!t||t.every(e=>0===e)||!t.length||!c)throw new Error("Invalid parameters");const[s,l,u]=t,f=u>0?[-u,0,u]:[],m=s>0?[-s,0,s]:[],p=l>0?[-l,0,l]:[],y=[];for(const h of f)for(const t of m)for(const r of m)for(const s of p){const l={...e};l.cameraHeading=n+h,l.cameraLocation={x:a+t,y:o+r,z:i?i+s:0,spatialReference:{wkid:c.wkid}},y.push(l)}return y}function de(e,t,n,a,i){const c="measurement"===e?t:Pe(n);if(i&&c)return o(a,r(c,H),i,3)||null}function Me(e,t,r,o,i){const c="measurement"===e?t:r;if(i&&c)return a(o,n(c,F),i,3)||null}function Pe(e){return Math.sqrt(e.reduce((e,t)=>e+t**2,0))}function ze(e,t,n){if(!e||!t)return;const{elevationSample:r,attributes:a}=e,{elevationSource:o,cameraHeight:i}=a,c=D(a,t[0],t[1]);let s=c.cameraLocation;return(s.spatialReference.isGeographic?v(s,d.WebMercator):Promise.resolve(s)).then(e=>(s=e,G(s.spatialReference,s.z??0,i,{elevationSample:r,elevationSource:o,extent:n}))).then(t=>("elevationSample"in t&&(e.elevationSample=t.elevationSample),{...c,cameraLocation:s,updateElevationProps:t}))}function je(e,t,n){if(!e||!t)return;const{elevationSample:r,attributes:a}=e,{elevationSource:o,cameraHeight:i}=a,c=q(a,t[0],t[1]);let s=c.cameraLocation;return(s.spatialReference.isGeographic?v(s,d.WebMercator):Promise.resolve(s)).then(e=>(s=e,G(s.spatialReference,s.z??0,i,{elevationSample:r,elevationSource:o,extent:n}))).then(t=>("elevationSample"in t&&(e.elevationSample=t.elevationSample),{...c,cameraLocation:s,updateElevationProps:t}))}function be(e,t,n){if("default"===t)return e;const r={x:e[0],y:e[1],z:e[2]},a=A(r,n[0],n[1]);return[a.x,a.y]}function Ee(e){return e.metersPerUnit}function Se(e,t,n,r){let a=[];return a="panoramic"===t?e.map(([e,t,a])=>{const{x:o,y:i}=A({x:e,y:t,z:a},n[0],n[1],r);return[o-.5,-.5-i]}):e.map(([e,t])=>[e-.5,-.5-t]),a}function Le(e,t,n){return e.map(e=>A({x:e[0],y:e[1],z:e[2]},t[0],t[1],n))}async function Oe(e,n,r,a=!1,o=!1,i){if(!e||!n||e.length<2)return null;const c=xe(e,a);if(!c||c.length<2)return null;const[s,l]=[c[0],c.at(-1)];if(!l)return null;const f=[s],m=await I(s,n);t(i);const p=m.clone();p.z?p.z+=20:p.z=20;const{averageElevation:y,cameraPitch:h,cameraRoll:g,farDistance:x,...w}=n,v=k(p,w),R=u([s.x,s.y],[v.x,v.y]),d=T(s,v);if(!d)return;const M=C([s.x,s.y],[l.x,l.y],d);if(!M?.length)return;f.push({x:M[0],y:M[1]});const P=20*u([f[0].x,f[0].y],[f[1].x,f[1].y])*Ee(n.cameraLocation.spatialReference)/R;if(!o)return P;const z=ee(P,m,f,n,0,1);return z?.value}async function We(e,n,r,a,o=!1,i=!1,c){const{attributes:s}=a,{location:l}=s,{updateElevationProps:f,...m}=n;if(!e||!n||e.length<2)throw new Error("Invalid parameters");const p=xe(e,o),[y,h]=[p[0],p.at(-1)],g=[y];let x=l.clone();x.spatialReference.isGeographic&&(x=await v(x,d.WebMercator));const w=await W(y,{...m,cameraLocation:x},f);t(c);const R=w.clone();R.z?R.z+=20:R.z=20;const M=U(R,m),P=u([y.x,y.y],[M.x,M.y]),z=T(y,M);if(!z)return;const j=C([y.x,y.y],[h.x,h.y],z);if(!j?.length)return;g.push({x:j[0],y:j[1]});const b=20*u([g[0].x,g[0].y],[g[1].x,g[1].y])*Ee(n.cameraLocation.spatialReference)/P;if(!i)return b;const E=te(b,w,g,n,0,1);return E?.value}async function Ie(e,t,n){const{updateElevationProps:r,...a}=t,{updateElevationProps:o,...i}=n,c=await I(e,a,r);return k(c,i)}async function qe(e,t,n){const{updateElevationProps:r,...a}=t,{updateElevationProps:o,...i}=n,c=await W(e,a,r);return U(c,i)}async function Ge(e,t,n=!1){if(e.length<3)return null;const r=xe(e,n),a=await pe(r,t),o=a.map(({x:e,y:t})=>[e,t]);e.push(e[0]),o.push(o[0]);const i=a[0].spatialReference,c=new w({paths:[o],spatialReference:i}),s=new x({rings:[o],spatialReference:i});return i.isGeographic?J(i,c,s):i.isWebMercator?Z(c,s):X(c,s)}async function Ae(e,n,r=!1,a){if(e.length<3)return null;const o=xe(e,r),i=await ye(o,n);t(a);const c=i.map(({x:e,y:t})=>[e,t]);e.push(e[0]),c.push(c[0]);const s=i[0].spatialReference,l=new w({paths:[c],spatialReference:s}),u=new x({rings:[c],spatialReference:s});return s.isGeographic?J(s,l,u):s.isWebMercator?Z(l,u):X(l,u)}async function De(e,t,n=!1){const r=xe(e,n);return N(ge(await pe(r,t)))}async function Ue(e,n,r=!1,a){const o=xe(e,r),i=await ye(o,n);t(a);return N(ge(i))}async function ke(e,t){const n=s(),r=e.paths[0][0],a=t.paths[0][0];let o,l;e.spatialReference.isWGS84||e.spatialReference.isWebMercator?(await E(),o=S(e),l=S(t)):(o=L(e),l=L(t));const u=Y(e.paths[0],o),f=Y(t.paths[0],l),m=Be(u,f),[p,y,h]=u,[g,x,w]=f.map(e=>-e),[v,R,d]=m,[M,P,z]=[a[0]-r[0],a[1]-r[1],a[2]-r[2]];i(n,p,g,v,y,x,R,h,w,d);const j=c(n);if(0===j)return null;i(n,M,g,v,P,x,R,z,w,d);const b=c(n);i(n,p,M,v,y,P,R,h,z,d);const O=c(n);i(n,p,g,M,y,x,P,h,w,z);const W=b/j,I=O/j,q=c(n)/j;return{distance:Math.abs(q/Math.sqrt(m[0]*m[0]+m[1]*m[1]+m[2]*m[2])),pointOnA:He(r,W,u),pointOnB:He(a,I,f)}}function Be(e,t){const n=l(),r=f(l(),e[0],e[1],e[2]),a=f(l(),t[0],t[1],t[2]),o=m(n,r,a);return[o[0],o[1],o[2]]}function He(e,t,n){return[e[0]+t*n[0],e[1]+t*n[1],e[2]+t*n[2]]}export{T as calculateAngle,V as calculateAnglePano,C as calculateCorrectedPixel,K as calculateHeightFromTemporaryDistance,Q as calculateLocationAccuracyFromDeviations,_ as calculateReferenceImagePointPanoramic,$ as calculateTempImagePoint,re as calculateUpdatedWmsf,ee as computeHeightIteratively,te as computeHeightIterativelyPanoramic,fe as computeTriangulatedAreaMeasurement,le as computeTriangulatedDistanceMeasurement,ue as computeTriangulatedPoint,me as computeTriangulatedVector,he as copyToClipboard,xe as formatPixels,ve as generateCombinations,Re as generateCombinationsPanoramic,Me as getConvertedArea,de as getConvertedDistance,we as getConvertedHeight,ze as getMeasurementProperties,je as getMeasurementPropertiesPanoramic,be as getModeCorrectedPoint,Se as getModeCorrectedPoints,Le as getPixelLocationFromSphereVertices,Pe as getRootOfSumOfSquaredErrors,Ee as getUnitRateFromSpatialReference,Oe as heightMeasurement2D,We as heightMeasurementPanoramic,Ie as imageToImageTransform,qe as imageToImageTransformPanoramic,Ge as pixelAreaMeasurement2D,Ae as pixelAreaMeasurementPanoramic,De as pixelDistanceMeasurement2D,Ue as pixelDistanceMeasurementPanoramic,ke as solveSkewLinesIntersection};
2
+ import{rad2deg as e}from"../../core/mathUtils.js";import{throwIfAborted as t}from"../../core/promiseUtils.js";import{createArea as n,createLength as r}from"../../core/quantity.js";import{formatArea as a,formatLength as o}from"../../core/quantityFormatUtils.js";import{set as i,determinant as c}from"../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{zeros as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{distance as u}from"../../core/libs/gl-matrix-2/math/vec2.js";import{set as f,cross as m}from"../../core/libs/gl-matrix-2/math/vec3.js";import{isSupported as p,geodesicLengths as y,geodesicAreas as h}from"../../geometry/geodesicUtils.js";import g from"../../geometry/Point.js";import w from"../../geometry/Polygon.js";import x from"../../geometry/Polyline.js";import{projectAsync as v,project as R}from"../../geometry/projectionUtils.js";import d from"../../geometry/SpatialReference.js";import{areaExecute as M}from"../../geometry/operators/areaOperator.js";import{geodeticAreaLoad as P,geodeticAreaExecute as z}from"../../geometry/operators/geodeticAreaOperator.js";import{geodeticDensifyLoad as j,geodeticDensifyExecute as b}from"../../geometry/operators/geodeticDensifyOperator.js";import{geodeticLengthLoad as E,geodeticLengthExecute as S}from"../../geometry/operators/geodeticLengthOperator.js";import{lengthExecute as L}from"../../geometry/operators/lengthOperator.js";import{simplifyExecute as O}from"../../geometry/operators/simplifyOperator.js";import{imageToWorldPanoramic as W,imageToWorld as I}from"../../layers/orientedImagery/transformations/imageToWorld.js";import{getImageToWorldPanoramicProperties as q,getUpdateElevationProps as G,convertSphereVertexToPixelLocation as A,getImageToWorldProperties as D}from"../../layers/orientedImagery/transformations/utils.js";import{worldToImagePanoramic as U,worldToImage as k}from"../../layers/orientedImagery/transformations/worldToImage.js";const B=1e5,H="meters",F="square-meters";function T(e,t){let n=180*Math.atan2(-e.y+t.y,e.x-t.x)/Math.PI;return n<0&&(n+=180),n*Math.PI/180}function V(e,t){let n=180*Math.atan2(-e.y+t.y,e.x-t.x)/Math.PI;return n<0&&(n+=180),n*Math.PI/180}function C(e,t,n){if(!e?.length||!t?.length||!n)return;const[r,a]=e,[,o]=t,i=o-a;return[r+i*Math.cos(n),a+i*Math.sin(n)]}async function J(e,t,n){if(await j(),p(e)){const e=y([t],H)[0];return{area:h([n],F)[0],perimeter:e}}const r=d.WGS84,a=R(t,r),o=R(n,r);let i=b(o,B);if(i=i?O(i):null,!i)return null;const c=y([a],H)[0];return{area:h([i],F)[0],perimeter:c}}function K(e,t,n=1){const r=we(e,!1);if(!r?.length)return;return 20*u([r[0].x,r[0].y],[r.at(-1).x,r.at(-1).y])*n/t}async function N(e){await E();const t=e.spatialReference;if(t.isGeographic){if(p(t))return y([e],H)[0];const n=R(e,d.WGS84);return y([n],H)[0]}return t.isWebMercator?S(e,{unit:H}):L(e,{unit:H})}function Q(e){if(!e?.length)throw new Error("Invalid deviations array");const[t,n,r]=[0,1,2].map(t=>e.map(e=>e[t]).filter(e=>null!==e)).map(e=>e.length?Pe(e):0);return[t,n,r]}function X(e,t){const n=O(t);if(!n)return null;const r=L(e,{unit:H});return{area:M(n,{unit:F}),perimeter:r}}function Y(e,t){return[(e[1][0]-e[0][0])/t,(e[1][1]-e[0][1])/t,(e[1][2]-e[0][2])/t]}async function Z(e,t){await Promise.all([P(),j(),E()]);let n=b(t,B);if(n=n?O(n):null,!n)return null;const r=S(e,{unit:H});return{area:z(n,{unit:F}),perimeter:r}}async function $(e,n,r){if(!n||!e)throw new Error("Missing required parameters");const a=await I(e,n);t(r);const o=a.clone();o.z?o.z+=20:o.z=20;const{averageElevation:i,cameraPitch:c,cameraRoll:s,farDistance:l,...u}=n;return k(o,u)}async function _(e,n,r,a){const{attributes:o}=r,{location:i}=o,{updateElevationProps:c,...s}=n;if(!e||!n)throw new Error("Missing parameters");let l=i.clone();l.spatialReference.isGeographic&&(l=await v(l,d.WebMercator));const u=await W(e,{...s,cameraLocation:l},c);t(a);const f=u.clone();return f.z?f.z+=20:f.z=20,U(f,s)}function ee(e,t,n,r,a=0,o=1,i){const{averageElevation:c,cameraPitch:s,cameraRoll:l,farDistance:f,...m}=r;if(a>=5||o<=.1){return{value:e*Ee(r.cameraLocation.spatialReference)}}const p=new g({x:t.x,y:t.y,z:t.z?t.z+e:e,spatialReference:r.cameraLocation.spatialReference}),y=k(p,m),h=u([n[0].x,n[0].y],[y.x,y.y]),w=n.at(0),x=n.at(-1);if(!w||!x)return null;const v=u([w.x,w.y],[x.x,x.y])*e/h;return ee(v,t,n,r,a+1,Math.abs(e-v))}function te(e,t,n,r,a=0,o=1,i){const{averageElevation:c,horizontalFieldOfView:s,verticalFieldOfView:l,farDistance:f,...m}=r;if(a>=5||o<=.1){return{value:e*Ee(r.cameraLocation.spatialReference)}}const p=new g({x:t.x,y:t.y,z:t.z?t.z+e:e,spatialReference:r.cameraLocation.spatialReference}),y=U(p,m),h=u([n[0].x,n[0].y],[y.x,y.y]),w=n.at(0),x=n.at(-1);if(!w||!x)return null;const v=u([w.x,w.y],[x.x,x.y])*e/h;return te(v,t,n,r,a+1,Math.abs(e-v))}async function ne(e,t,n){return e.spatialReference&&!t.spatialReference.equals(e.spatialReference)&&(t=await v(t,e.spatialReference)),new x({paths:[[[e.x,e.y,e.z??0],[t.x,t.y,t.z??0]]],spatialReference:n})}function re(e){return 1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*e/6378137)))}function ae(e,t){return Math.sqrt((Math.sqrt((e[0][0]-e[1][0])**2+(e[0][1]-e[1][1])**2)/t)**2+(e[0][2]-e[1][2])**2)}function oe(e,t){return Math.sqrt((e[0][0]-e[1][0])**2+(e[0][1]-e[1][1])**2)/t}function ie(t){return e(Math.atan((t[1][2]-t[0][2])/Math.sqrt((t[1][0]-t[0][0])**2+(t[1][1]-t[0][1])**2)))}function ce(t){let n=90-e(Math.atan2(t[1][1]-t[0][1],t[1][0]-t[0][0]));return n<0&&(n+=360),n}function se(e,t){return new g({x:(e.pointOnA[0]+e.pointOnB[0])/2,y:(e.pointOnA[1]+e.pointOnB[1])/2,z:(e.pointOnA[2]+e.pointOnB[2])/2,spatialReference:t})}async function le(e){if(2===e?.length){const t=[];let n=1;const[r,a]=e,o=r.camera.spatialReference,{measurePoints:i}=r;for(let e=0;e<i.length;e++){const i=await ne(r.camera,r.measurePoints[e],o),c=await ne(a.camera,a.measurePoints[e],o),s=await ke(i,c);if(!s)return null;const l=se(s,o);l.spatialReference.isWebMercator&&(n=re(l.y)),t.push([l.x,l.y,l.z??0])}if(t?.length>1){return{distance:ae(t,n),horizontalDistance:oe(t,n),verticalDistance:Math.abs(t[0][2]-t[1][2]),slope:ie(t),aspect:ce(t)}}}return null}async function ue(e){const t=e[0].camera.spatialReference;if(2!==e?.length)return null;const[n,r]=e,{camera:a,measurePoints:o}=n,{camera:i,measurePoints:c}=r,s=await ne(a,o[0],t),l=await ne(i,c[0],t),u=await ke(s,l);return u?se(u,t)??null:null}async function fe(e,t){if(!e?.length)return null;const n=[],r=e[0],a=e[1],o=r.camera.spatialReference,{measurePoints:i}=r;for(let u=0;u<i.length;u++){const e=await ne(r.camera,r.measurePoints[u],o),t=await ne(a.camera,a.measurePoints[u],o),i=await ke(e,t);if(!i)return null;const c=se(i,o);n.push([c.x,c.y,c.z??0])}if(n?.length<2)return null;const c=new x({paths:[n],spatialReference:t}),s=new w({rings:[n],spatialReference:t});if(t.isGeographic){const e=await J(t,c,s);return e?.area??null}if(t.isWebMercator){const e=await Z(c,s);return e?.area??null}const l=X(c,s);return l?.area??null}function me(e,t){if(!e)return null;return{camera:t.geometry.clone(),measurePoints:Array.isArray(e)?e:[e]}}async function pe(e,t){const{updateElevationProps:n,...r}=t;return await I(e,r,n)}async function ye(e,t){const{updateElevationProps:n,...r}=t;return W(e,r,n)}function he(e){navigator.clipboard.writeText(e).catch(e=>{throw e})}function ge(e){const t=e.map(e=>[e.x,e.y]),n=e[0].spatialReference;return new x({paths:[t],spatialReference:n})}function we(e,t){return e.map(e=>({x:t?.5+e[0]:e[0],y:t?.5-e[1]:e[1]}))}function xe(e,t,n,a,i){const c="measurement"===e?t:n;if(i&&c)return o(a,r(c,H),i,3)||null}function ve(e,t){const{cameraPitch:n,cameraRoll:r,cameraLocation:a}=e,{x:o,y:i,z:c,spatialReference:s}=a;if(t.every(e=>0===e)||!t||!t.length||!s)throw new Error("Invalid parameters");const[l,u,,f,m]=t,p=[-f,0,f],y=[-m,0,m],h=[-l,0,l],g=[-u,0,u],w=[];for(const x of p)for(const t of y)for(const a of h)for(const l of h)for(const u of g){const f={...e};f.cameraPitch=n+x,f.cameraRoll=r+t,f.cameraLocation={x:o+a,y:i+l,z:c?c+u:0,spatialReference:{wkid:s.wkid}},w.push(f)}return w}function Re(e,t){const{cameraHeading:n,cameraLocation:r}=e,{x:a,y:o,z:i,spatialReference:c}=r;if(!t||t.every(e=>0===e)||!t.length||!c)throw new Error("Invalid parameters");const[s,l,u]=t,f=u>0?[-u,0,u]:[],m=s>0?[-s,0,s]:[],p=l>0?[-l,0,l]:[],y=[];for(const h of f)for(const t of m)for(const r of m)for(const s of p){const l={...e};l.cameraHeading=n+h,l.cameraLocation={x:a+t,y:o+r,z:i?i+s:0,spatialReference:{wkid:c.wkid}},y.push(l)}return y}function de(e,t,n,a,i){const c="measurement"===e?t:Pe(n);if(i&&c)return o(a,r(c,H),i,3)||null}function Me(e,t,r,o,i){const c="measurement"===e?t:r;if(i&&c)return a(o,n(c,F),i,3)||null}function Pe(e){return Math.sqrt(e.reduce((e,t)=>e+t**2,0))}function ze(e,t,n){if(!e||!t)return;const{elevationSample:r,attributes:a}=e,{elevationSource:o,cameraHeight:i}=a,c=D(a,t[0],t[1]);let s=c.cameraLocation;return(s.spatialReference.isGeographic?v(s,d.WebMercator):Promise.resolve(s)).then(e=>(s=e,G(s.spatialReference,s.z??0,i,{elevationSample:r,elevationSource:o,extent:n}))).then(t=>("elevationSample"in t&&(e.elevationSample=t.elevationSample),{...c,cameraLocation:s,updateElevationProps:t}))}function je(e,t,n){if(!e||!t)return;const{elevationSample:r,attributes:a}=e,{elevationSource:o,cameraHeight:i}=a,c=q(a,t[0],t[1]);let s=c.cameraLocation;return(s.spatialReference.isGeographic?v(s,d.WebMercator):Promise.resolve(s)).then(e=>(s=e,G(s.spatialReference,s.z??0,i,{elevationSample:r,elevationSource:o,extent:n}))).then(t=>("elevationSample"in t&&(e.elevationSample=t.elevationSample),{...c,cameraLocation:s,updateElevationProps:t}))}function be(e,t,n){if("default"===t)return e;const r={x:e[0],y:e[1],z:e[2]},a=A(r,n[0],n[1]);return[a.x,a.y]}function Ee(e){return e.metersPerUnit}function Se(e,t,n,r){let a=[];return a="panoramic"===t?e.map(([e,t,a])=>{const{x:o,y:i}=A({x:e,y:t,z:a},n[0],n[1],r);return[o-.5,-.5-i]}):e.map(([e,t])=>[e-.5,-.5-t]),a}function Le(e,t,n){return e.map(e=>A({x:e[0],y:e[1],z:e[2]},t[0],t[1],n))}async function Oe(e,n,r,a=!1,o=!1,i){if(!e||!n||e.length<2)return null;const c=we(e,a);if(!c||c.length<2)return null;const[s,l]=[c[0],c.at(-1)];if(!l)return null;const f=[s],m=await I(s,n);t(i);const p=m.clone();p.z?p.z+=20:p.z=20;const{averageElevation:y,cameraPitch:h,cameraRoll:g,farDistance:w,...x}=n,v=k(p,x),R=u([s.x,s.y],[v.x,v.y]),d=T(s,v);if(!d)return;const M=C([s.x,s.y],[l.x,l.y],d);if(!M?.length)return;f.push({x:M[0],y:M[1]});const P=20*u([f[0].x,f[0].y],[f[1].x,f[1].y])*Ee(n.cameraLocation.spatialReference)/R;if(!o)return P;const z=ee(P,m,f,n,0,1);return z?.value}async function We(e,n,r,a,o=!1,i=!1,c){const{attributes:s}=a,{location:l}=s,{updateElevationProps:f,...m}=n;if(!e||!n||e.length<2)throw new Error("Invalid parameters");const p=we(e,o),[y,h]=[p[0],p.at(-1)],g=[y];let w=l.clone();w.spatialReference.isGeographic&&(w=await v(w,d.WebMercator));const x=await W(y,{...m,cameraLocation:w},f);t(c);const R=x.clone();R.z?R.z+=20:R.z=20;const M=U(R,m),P=u([y.x,y.y],[M.x,M.y]),z=T(y,M);if(!z)return;const j=C([y.x,y.y],[h.x,h.y],z);if(!j?.length)return;g.push({x:j[0],y:j[1]});const b=20*u([g[0].x,g[0].y],[g[1].x,g[1].y])*Ee(n.cameraLocation.spatialReference)/P;if(!i)return b;const E=te(b,x,g,n,0,1);return E?.value}async function Ie(e,t,n){const{updateElevationProps:r,...a}=t,{updateElevationProps:o,...i}=n,c=await I(e,a,r);return k(c,i)}async function qe(e,t,n){const{updateElevationProps:r,...a}=t,{updateElevationProps:o,...i}=n,c=await W(e,a,r);return U(c,i)}async function Ge(e,t,n=!1){if(e.length<3)return null;const r=we(e,n),a=await pe(r,t),o=a.map(({x:e,y:t})=>[e,t]);e.push(e[0]),o.push(o[0]);const i=a[0].spatialReference,c=new x({paths:[o],spatialReference:i}),s=new w({rings:[o],spatialReference:i});return i.isGeographic?J(i,c,s):i.isWebMercator?Z(c,s):X(c,s)}async function Ae(e,n,r=!1,a){if(e.length<3)return null;const o=we(e,r),i=await ye(o,n);t(a);const c=i.map(({x:e,y:t})=>[e,t]);e.push(e[0]),c.push(c[0]);const s=i[0].spatialReference,l=new x({paths:[c],spatialReference:s}),u=new w({rings:[c],spatialReference:s});return s.isGeographic?J(s,l,u):s.isWebMercator?Z(l,u):X(l,u)}async function De(e,t,n=!1){const r=we(e,n);return N(ge(await pe(r,t)))}async function Ue(e,n,r=!1,a){const o=we(e,r),i=await ye(o,n);t(a);return N(ge(i))}async function ke(e,t){const n=s(),r=e.paths[0][0],a=t.paths[0][0];let o,l;e.spatialReference.isWGS84||e.spatialReference.isWebMercator?(await E(),o=S(e),l=S(t)):(o=L(e),l=L(t));const u=Y(e.paths[0],o),f=Y(t.paths[0],l),m=Be(u,f),[p,y,h]=u,[g,w,x]=f.map(e=>-e),[v,R,d]=m,[M,P,z]=[a[0]-r[0],a[1]-r[1],a[2]-r[2]];i(n,p,g,v,y,w,R,h,x,d);const j=c(n);if(0===j)return null;i(n,M,g,v,P,w,R,z,x,d);const b=c(n);i(n,p,M,v,y,P,R,h,z,d);const O=c(n);i(n,p,g,M,y,w,P,h,x,z);const W=b/j,I=O/j,q=c(n)/j;return{distance:Math.abs(q/Math.sqrt(m[0]*m[0]+m[1]*m[1]+m[2]*m[2])),pointOnA:He(r,W,u),pointOnB:He(a,I,f)}}function Be(e,t){const n=l(),r=f(l(),e[0],e[1],e[2]),a=f(l(),t[0],t[1],t[2]),o=m(n,r,a);return[o[0],o[1],o[2]]}function He(e,t,n){return[e[0]+t*n[0],e[1]+t*n[1],e[2]+t*n[2]]}export{T as calculateAngle,V as calculateAnglePano,C as calculateCorrectedPixel,K as calculateHeightFromTemporaryDistance,Q as calculateLocationAccuracyFromDeviations,_ as calculateReferenceImagePointPanoramic,$ as calculateTempImagePoint,re as calculateUpdatedWmsf,ee as computeHeightIteratively,te as computeHeightIterativelyPanoramic,fe as computeTriangulatedAreaMeasurement,le as computeTriangulatedDistanceMeasurement,ue as computeTriangulatedPoint,me as computeTriangulatedVector,he as copyToClipboard,we as formatPixels,ve as generateCombinations,Re as generateCombinationsPanoramic,Me as getConvertedArea,de as getConvertedDistance,xe as getConvertedHeight,ze as getMeasurementProperties,je as getMeasurementPropertiesPanoramic,be as getModeCorrectedPoint,Se as getModeCorrectedPoints,Le as getPixelLocationFromSphereVertices,Pe as getRootOfSumOfSquaredErrors,Ee as getUnitRateFromSpatialReference,Oe as heightMeasurement2D,We as heightMeasurementPanoramic,Ie as imageToImageTransform,qe as imageToImageTransformPanoramic,Ge as pixelAreaMeasurement2D,Ae as pixelAreaMeasurementPanoramic,De as pixelDistanceMeasurement2D,Ue as pixelDistanceMeasurementPanoramic,ke as solveSkewLinesIntersection};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../../geometry/Polygon.js";import{execute as o}from"../../../geometry/operators/affineTransformOperator.js";import{execute as e}from"../../../geometry/operators/intersectionOperator.js";import{getNearestCoordinate as r}from"../../../geometry/operators/proximityOperator.js";import n from"../../../geometry/operators/support/Transformation.js";function i(o){const{viewpoint:n,containerWidth:i,containerHeight:a,rotation:s,constraints:p,imageExtent:c,viewportExtent:f}=o,{targetGeometry:x,scale:y}=n;if("point"!==x?.type)return;const g=c.center,{extent:l}=m(t.fromExtent(c),s,g.x,g.y),{width:u,height:E}=l,h=p.scaleToZoom(y);if(h<=0)return void(n.targetGeometry=g.clone());const j=1/2**h,d=i/a;let w=j*u,v=j*E;u/i>E/a?v=w/d:w=v*d;const G=l.clone();G.xmin+=w/2,G.xmax-=w/2,G.ymin+=v/2,G.ymax-=v/2;let O=e(t.fromExtent(l),t.fromExtent(G));O=O&&f.intersects(c)?e(m(O,s,g.x,g.y),t.fromExtent(c)):t.fromExtent(l),n.targetGeometry=r(O,x).coordinate}function m(t,e,r,i){const m=(new n).rotate(e,r,i);return o(t,m)}export{i as constrainViewpoint,m as rotate};
2
+ import t from"../../../geometry/Polygon.js";import{affineTransformExecute as o}from"../../../geometry/operators/affineTransformOperator.js";import{intersectionExecute as e}from"../../../geometry/operators/intersectionOperator.js";import{proximityGetNearestCoordinate as r}from"../../../geometry/operators/proximityOperator.js";import n from"../../../geometry/operators/support/Transformation.js";function i(o){const{viewpoint:n,containerWidth:i,containerHeight:a,rotation:s,constraints:p,imageExtent:c,viewportExtent:f}=o,{targetGeometry:x,scale:y}=n;if("point"!==x?.type)return;const g=c.center,{extent:l}=m(t.fromExtent(c),s,g.x,g.y),{width:E,height:u}=l,h=p.scaleToZoom(y);if(h<=0)return void(n.targetGeometry=g.clone());const j=1/2**h,d=i/a;let w=j*E,v=j*u;E/i>u/a?v=w/d:w=v*d;const G=l.clone();G.xmin+=w/2,G.xmax-=w/2,G.ymin+=v/2,G.ymax-=v/2;let O=e(t.fromExtent(l),t.fromExtent(G));O=O&&f.intersects(c)?e(m(O,s,g.x,g.y),t.fromExtent(c)):t.fromExtent(l),n.targetGeometry=r(O,x).coordinate}function m(t,e,r,i){const m=(new n).rotate(e,r,i);return o(t,m)}export{i as constrainViewpoint,m as rotate};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{throwIfAborted as t}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as a}from"../../../core/units.js";import n from"../../../geometry/Point.js";import r from"../../../geometry/Polygon.js";import i from"../../../geometry/SpatialReference.js";import{execute as e}from"../../../geometry/operators/intersectionOperator.js";import{computeFarplaneVertices as o,createRotationMatrixFromHPR as m}from"../../../layers/orientedImagery/transformations/utils.js";import{calculateUpdatedWmsf as h}from"../imageMeasurementUtils.js";const l=15,s=120,c=.9,M=1.1,x=1,f=179,u=3,y=2,g=1,p=150,d=16,w=32,I=8,b=.05,v=1,F=2,P=20,z=4096;function N(t,n){const{radiusOffset:r=0,minimumRadiusInMeters:i=0}=n;if(0===r)return;const e=a(t.spatialReference),o=e?r/e:r,{position:m}=t.vertexAttributes,h=Math.floor(m.length/3);let l=0,s=0,c=0;for(let a=0;a<h;a++)l+=m[3*a],s+=m[3*a+1],c+=m[3*a+2];l/=h,s/=h,c/=h;let M=0;for(let a=0;a<h;a++){const t=m[3*a]-l,n=m[3*a+1]-s,r=m[3*a+2]-c;M+=Math.sqrt(t*t+n*n+r*r)}M/=h;const x=e?i/e:i,f=Math.max(x,M+o),u=M>0?f/M:1;for(let a=0;a<h;a++){let t=m[3*a]-l,n=m[3*a+1]-s,r=m[3*a+2]-c;t*=u,n*=u,r*=u,m[3*a]=l+t,m[3*a+1]=s+n,m[3*a+2]=c+r}t.vertexAttributesChanged()}function R(t,a,n){const{columns:r,rows:i}=K(t,a,n),[e,o]=t,m=a?.xmin??0,h=a?.ymin??0,l=a?Math.max(1,a.xmax-a.xmin):e,s=a?Math.max(1,a.ymax-a.ymin):o,c=new Array;for(let M=0;M<=i;M+=1){const t=h+M/i*s;for(let a=0;a<=r;a+=1)c.push({x:m+a/r*l,y:t})}return c}function j(t,a,n,r){const{columns:i,rows:e}=K(a,n,r),o=i+1,m=new Float64Array(3*t.length),h=new Float32Array(2*t.length),l=new Array;t.forEach((t,a)=>{const n=3*a,r=2*a,l=a%o,s=Math.floor(a/o);m[n]=t.x,m[n+1]=t.y,m[n+2]=t.z??0,h[r]=l/i,h[r+1]=s/e});for(let s=0;s<e;s+=1)for(let t=0;t<i;t+=1){const a=s*o+t,n=a+1,r=a+o,i=r+1;l.push(a,n,i,a,i,r)}return{faces:l,position:m,uv:h}}function A(t,a,n,r=y){return{width:Math.ceil(t/r**n),height:Math.ceil(a/r**n)}}function S(t,a,n){const{width:r,height:i,storageInfo:e}=t.rasterInfo,{pyramidScalingFactor:o}=e,m=A(r,i,a,o??void 0);if(!n)return{offset:{x:0,y:0},size:m};const h=(o??y)**a,l={x:Math.max(0,Math.floor(n.xmin/h)),y:Math.max(0,Math.floor(n.ymin/h))},s=Math.min(m.width,Math.ceil(n.xmax/h)),c=Math.min(m.height,Math.ceil(n.ymax/h));return{offset:l,size:{width:Math.max(g,s-l.x),height:Math.max(g,c-l.y)}}}function L(t,a,n){const{maximumPyramidLevel:r,pyramidScalingFactor:i}=t.rasterInfo.storageInfo,e=i??y,o=Math.max(g,(n?.xmax??t.rasterInfo.width)-(n?.xmin??0)),m=Math.max(g,(n?.ymax??t.rasterInfo.height)-(n?.ymin??0)),h=Math.max(g,a.width),l=Math.max(g,a.height),s=Math.max(g,o/h,m/l),c=Math.ceil(Math.log(s)/Math.log(e));return Math.max(0,Math.min(r,Number.isFinite(c)?c:r))}function O(t,a,n){const{maximumPyramidLevel:r,pyramidScalingFactor:i}=t.rasterInfo.storageInfo,e=i??y,o=Math.max(g,(n?.xmax??t.rasterInfo.width)-(n?.xmin??0)),m=Math.max(g,(n?.ymax??t.rasterInfo.height)-(n?.ymin??0)),h=Math.max(g,a.width),l=Math.max(g,a.height);let s=r;for(let c=r;c>=0&&(s=c,!(0===c||o/e**c>h||m/e**c>l));c-=1);return s}function q(t,a,n=z){const{maximumPyramidLevel:r,pyramidScalingFactor:i}=t.rasterInfo.storageInfo,e=i??y;let o=Math.max(0,Math.min(r,a));for(;o<r;){const a=A(t.rasterInfo.width,t.rasterInfo.height,o,e);if(a.width<=n&&a.height<=n)break;o+=1}return o}function D(t){const{camera:a,width:n,height:r}=t;if(n<=0||r<=0)return{horizontal:a.fov,vertical:a.fov};const i=Math.sqrt(n*n+r*r);return{horizontal:2*Math.atan(Math.tan(a.fov*Math.PI/360)*n/i)*180/Math.PI,vertical:2*Math.atan(Math.tan(a.fov*Math.PI/360)*r/i)*180/Math.PI}}function W(t,a,n){if(null==t||null==a||!Number.isFinite(t)||!Number.isFinite(a))return{horizontal:t??null,vertical:a??null};const r=Math.sin(n*Math.PI/180),i=Math.cos(n*Math.PI/180),e=[[t,0],[t,a],[0,a]].map(([t,a])=>[i*t-r*a,r*t+i*a]),o=Math.min(0,...e.map(([t])=>t)),m=Math.max(0,...e.map(([t])=>t)),h=Math.min(0,...e.map(([,t])=>t)),l=Math.max(0,...e.map(([,t])=>t));return{horizontal:Math.min(Math.abs(m-o),p),vertical:Math.min(Math.abs(l-h),p)}}function U(t,a,n,r){const{width:i,height:e}=t,o=W(a,n,r),m=Math.sqrt(i*i+e*e);if(m<=0)return o.vertical??o.horizontal??null;if(i>=e){const t=o.vertical;return null==t||e<=0?null:2*Math.atan(Math.tan(t*Math.PI/360)*m/e)*180/Math.PI}const h=o.horizontal;return null==h||i<=0?null:2*Math.atan(Math.tan(h*Math.PI/360)*m/i)*180/Math.PI}function V(t,a,r=d,i=0){const e=t.camera.position,{horizontal:l,vertical:s}=D(t),c=e.spatialReference.isWebMercator?h(e.y):1,M=o({cameraLocation:e,farDistance:a,horizontalFieldOfView:l,rotationMatrix:m([t.camera.heading,t.camera.tilt,i]),scalingFactor:c,verticalFieldOfView:s}),x=[];for(let o=0;o<M.length;o+=1){const t=M[o],a=M[(o+1)%M.length];for(let i=0;i<r;i+=1){const o=i/r;x.push(new n({x:t[0]+(a[0]-t[0])*o,y:t[1]+(a[1]-t[1])*o,z:t[2]+(a[2]-t[2])*o,spatialReference:e.spatialReference}))}}return x}async function k(a,n,o,m,h){if("3d"!==n.type)return null;const{cameraRoll:l,farDistance:s}=a.attributes;if("number"!=typeof s||!Number.isFinite(s)||s<=0)return null;const c=V(n,s,w,l??0),M=await m(c,h);t(h);const x=M.filter(({x:t,y:a})=>Number.isFinite(t)&&Number.isFinite(a));if(x.length<4)return null;const[f,u]=o,y=new r({rings:[[[0,0],[f,0],[f,u],[0,u],[0,0]]],spatialReference:i.WebMercator}),g=new r({rings:[[...x.map(({x:t,y:a})=>[t,a]),[x[0].x,x[0].y]]],spatialReference:i.WebMercator}),p=e(g,y),d=p?p.rings.flatMap(t=>t.map(([t,a])=>({x:t,y:a}))):x;if(!d.length)return null;const I=d.map(({x:t})=>Math.max(0,Math.min(f,t))),b=d.map(({y:t})=>Math.max(0,Math.min(u,t)));return E({xmin:Math.floor(Math.max(0,Math.min(...I))),xmax:Math.ceil(Math.min(f,Math.max(...I))),ymin:Math.floor(Math.max(0,Math.min(...b))),ymax:Math.ceil(Math.min(u,Math.max(...b)))},f,u)}async function C(a,n,r,i,e){if("3d"!==n.type)return null;const{farDistance:o}=a.attributes;if("number"!=typeof o||!Number.isFinite(o)||o<=0)return null;const m=o,[h,l]=r,s=V(n,m),c=await i(s,e);t(e);const M=c.filter(({x:t,y:a})=>Number.isFinite(t)&&Number.isFinite(a));if(M.length<4)return null;const x=B(M,l);if(!x)return null;const f=H(M.map(({x:t})=>G(t,h)),h),u=h-f.gap;return u<=0?null:u>=h-v?[{xmin:0,xmax:h,ymin:x.ymin,ymax:x.ymax}]:J(f,h,x)}function E(t,a,n){const r=Math.max(g,t.xmax-t.xmin),i=Math.max(g,t.ymax-t.ymin),e=Math.max(I,Math.round(r*b)),o=Math.max(I,Math.round(i*b)),m=Math.floor(Math.max(0,t.xmin-e)),h=Math.ceil(Math.min(a,t.xmax+e)),l=Math.floor(Math.max(0,t.ymin-o)),s=Math.ceil(Math.min(n,t.ymax+o));return h>m&&s>l?{xmin:m,xmax:h,ymin:l,ymax:s}:null}function B(t,a){const n=t.map(({y:t})=>Math.max(0,Math.min(a,t))),r=Math.floor(Math.max(0,Math.min(...n))),i=Math.ceil(Math.min(a,Math.max(...n)));return i>r?{ymin:r,ymax:i}:null}function G(t,a){return(t%a+a)%a}function H(t,a){const n=t.slice().sort((t,a)=>t-a);let r=-1,i=0,e=0;for(let o=0;o<n.length;o+=1){const t=n[o],m=o===n.length-1?n[0]+a:n[o+1],h=m-t;h>r&&(r=h,i=t,e=m)}return{gap:r,start:i,end:e}}function J(t,a,n){const r=G(t.end,a),i=G(t.start,a);return r<=i?[{xmin:Math.floor(r),xmax:Math.ceil(i),...n}]:[{xmin:0,xmax:Math.ceil(i),...n},{xmin:Math.floor(r),xmax:a,...n}].filter(({xmin:t,xmax:a})=>a>t)}function K(t,a,n=P){const[r,i]=t,e=a?Math.max(g,a.xmax-a.xmin):r,o=a?Math.max(g,a.ymax-a.ymin):i;if(e<=0||o<=0)return{columns:F,rows:F};const m=e/o;return m>=1?{columns:n,rows:Math.max(F,Math.round(n/m))}:{columns:Math.max(F,Math.round(n*m)),rows:n}}export{N as applySphereMeshOffsetInMeters,q as clampRasterLevelForTextureSize,k as computeDefaultAreaOfInterest,C as computePanoramicAreasOfInterest,V as createFarplaneSamplePoints,j as createSuperimposeGridVertexAttributes,R as createSuperimposeSamplePixels,O as getBaseRasterLevel,U as getDefaultSuperimposeFov,W as getEffectiveImageFieldOfView,S as getRasterFetchParameters,A as getRasterLevelSize,D as getViewCameraFieldOfView,L as getViewDependentRasterLevel,u as panoramicSuperimposeKeyboardAngleStep,s as panoramicSuperimposeMaxFov,f as panoramicSuperimposeMaxTilt,l as panoramicSuperimposeMinFov,x as panoramicSuperimposeMinTilt,c as panoramicSuperimposeZoomInFactor,M as panoramicSuperimposeZoomOutFactor};
2
+ import{throwIfAborted as t}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as a}from"../../../core/units.js";import n from"../../../geometry/Point.js";import r from"../../../geometry/Polygon.js";import i from"../../../geometry/SpatialReference.js";import{intersectionExecute as e}from"../../../geometry/operators/intersectionOperator.js";import{computeFarplaneVertices as o,createRotationMatrixFromHPR as m}from"../../../layers/orientedImagery/transformations/utils.js";import{calculateUpdatedWmsf as h}from"../imageMeasurementUtils.js";const l=15,s=120,c=.9,M=1.1,x=1,f=179,u=3,y=2,g=1,p=150,d=16,w=32,I=8,b=.05,v=1,F=2,P=20,z=4096;function N(t,n){const{radiusOffset:r=0,minimumRadiusInMeters:i=0}=n;if(0===r)return;const e=a(t.spatialReference),o=e?r/e:r,{position:m}=t.vertexAttributes,h=Math.floor(m.length/3);let l=0,s=0,c=0;for(let a=0;a<h;a++)l+=m[3*a],s+=m[3*a+1],c+=m[3*a+2];l/=h,s/=h,c/=h;let M=0;for(let a=0;a<h;a++){const t=m[3*a]-l,n=m[3*a+1]-s,r=m[3*a+2]-c;M+=Math.sqrt(t*t+n*n+r*r)}M/=h;const x=e?i/e:i,f=Math.max(x,M+o),u=M>0?f/M:1;for(let a=0;a<h;a++){let t=m[3*a]-l,n=m[3*a+1]-s,r=m[3*a+2]-c;t*=u,n*=u,r*=u,m[3*a]=l+t,m[3*a+1]=s+n,m[3*a+2]=c+r}t.vertexAttributesChanged()}function R(t,a,n){const{columns:r,rows:i}=K(t,a,n),[e,o]=t,m=a?.xmin??0,h=a?.ymin??0,l=a?Math.max(1,a.xmax-a.xmin):e,s=a?Math.max(1,a.ymax-a.ymin):o,c=new Array;for(let M=0;M<=i;M+=1){const t=h+M/i*s;for(let a=0;a<=r;a+=1)c.push({x:m+a/r*l,y:t})}return c}function j(t,a,n,r){const{columns:i,rows:e}=K(a,n,r),o=i+1,m=new Float64Array(3*t.length),h=new Float32Array(2*t.length),l=new Array;t.forEach((t,a)=>{const n=3*a,r=2*a,l=a%o,s=Math.floor(a/o);m[n]=t.x,m[n+1]=t.y,m[n+2]=t.z??0,h[r]=l/i,h[r+1]=s/e});for(let s=0;s<e;s+=1)for(let t=0;t<i;t+=1){const a=s*o+t,n=a+1,r=a+o,i=r+1;l.push(a,n,i,a,i,r)}return{faces:l,position:m,uv:h}}function A(t,a,n,r=y){return{width:Math.ceil(t/r**n),height:Math.ceil(a/r**n)}}function S(t,a,n){const{width:r,height:i,storageInfo:e}=t.rasterInfo,{pyramidScalingFactor:o}=e,m=A(r,i,a,o??void 0);if(!n)return{offset:{x:0,y:0},size:m};const h=(o??y)**a,l={x:Math.max(0,Math.floor(n.xmin/h)),y:Math.max(0,Math.floor(n.ymin/h))},s=Math.min(m.width,Math.ceil(n.xmax/h)),c=Math.min(m.height,Math.ceil(n.ymax/h));return{offset:l,size:{width:Math.max(g,s-l.x),height:Math.max(g,c-l.y)}}}function L(t,a,n){const{maximumPyramidLevel:r,pyramidScalingFactor:i}=t.rasterInfo.storageInfo,e=i??y,o=Math.max(g,(n?.xmax??t.rasterInfo.width)-(n?.xmin??0)),m=Math.max(g,(n?.ymax??t.rasterInfo.height)-(n?.ymin??0)),h=Math.max(g,a.width),l=Math.max(g,a.height),s=Math.max(g,o/h,m/l),c=Math.ceil(Math.log(s)/Math.log(e));return Math.max(0,Math.min(r,Number.isFinite(c)?c:r))}function O(t,a,n){const{maximumPyramidLevel:r,pyramidScalingFactor:i}=t.rasterInfo.storageInfo,e=i??y,o=Math.max(g,(n?.xmax??t.rasterInfo.width)-(n?.xmin??0)),m=Math.max(g,(n?.ymax??t.rasterInfo.height)-(n?.ymin??0)),h=Math.max(g,a.width),l=Math.max(g,a.height);let s=r;for(let c=r;c>=0&&(s=c,!(0===c||o/e**c>h||m/e**c>l));c-=1);return s}function q(t,a,n=z){const{maximumPyramidLevel:r,pyramidScalingFactor:i}=t.rasterInfo.storageInfo,e=i??y;let o=Math.max(0,Math.min(r,a));for(;o<r;){const a=A(t.rasterInfo.width,t.rasterInfo.height,o,e);if(a.width<=n&&a.height<=n)break;o+=1}return o}function D(t){const{camera:a,width:n,height:r}=t;if(n<=0||r<=0)return{horizontal:a.fov,vertical:a.fov};const i=Math.sqrt(n*n+r*r);return{horizontal:2*Math.atan(Math.tan(a.fov*Math.PI/360)*n/i)*180/Math.PI,vertical:2*Math.atan(Math.tan(a.fov*Math.PI/360)*r/i)*180/Math.PI}}function W(t,a,n){if(null==t||null==a||!Number.isFinite(t)||!Number.isFinite(a))return{horizontal:t??null,vertical:a??null};const r=Math.sin(n*Math.PI/180),i=Math.cos(n*Math.PI/180),e=[[t,0],[t,a],[0,a]].map(([t,a])=>[i*t-r*a,r*t+i*a]),o=Math.min(0,...e.map(([t])=>t)),m=Math.max(0,...e.map(([t])=>t)),h=Math.min(0,...e.map(([,t])=>t)),l=Math.max(0,...e.map(([,t])=>t));return{horizontal:Math.min(Math.abs(m-o),p),vertical:Math.min(Math.abs(l-h),p)}}function U(t,a,n,r){const{width:i,height:e}=t,o=W(a,n,r),m=Math.sqrt(i*i+e*e);if(m<=0)return o.vertical??o.horizontal??null;if(i>=e){const t=o.vertical;return null==t||e<=0?null:2*Math.atan(Math.tan(t*Math.PI/360)*m/e)*180/Math.PI}const h=o.horizontal;return null==h||i<=0?null:2*Math.atan(Math.tan(h*Math.PI/360)*m/i)*180/Math.PI}function V(t,a,r=d,i=0){const e=t.camera.position,{horizontal:l,vertical:s}=D(t),c=e.spatialReference.isWebMercator?h(e.y):1,M=o({cameraLocation:e,farDistance:a,horizontalFieldOfView:l,rotationMatrix:m([t.camera.heading,t.camera.tilt,i]),scalingFactor:c,verticalFieldOfView:s}),x=[];for(let o=0;o<M.length;o+=1){const t=M[o],a=M[(o+1)%M.length];for(let i=0;i<r;i+=1){const o=i/r;x.push(new n({x:t[0]+(a[0]-t[0])*o,y:t[1]+(a[1]-t[1])*o,z:t[2]+(a[2]-t[2])*o,spatialReference:e.spatialReference}))}}return x}async function k(a,n,o,m,h){if("3d"!==n.type)return null;const{cameraRoll:l,farDistance:s}=a.attributes;if("number"!=typeof s||!Number.isFinite(s)||s<=0)return null;const c=V(n,s,w,l??0),M=await m(c,h);t(h);const x=M.filter(({x:t,y:a})=>Number.isFinite(t)&&Number.isFinite(a));if(x.length<4)return null;const[f,u]=o,y=new r({rings:[[[0,0],[f,0],[f,u],[0,u],[0,0]]],spatialReference:i.WebMercator}),g=new r({rings:[[...x.map(({x:t,y:a})=>[t,a]),[x[0].x,x[0].y]]],spatialReference:i.WebMercator}),p=e(g,y),d=p?p.rings.flatMap(t=>t.map(([t,a])=>({x:t,y:a}))):x;if(!d.length)return null;const I=d.map(({x:t})=>Math.max(0,Math.min(f,t))),b=d.map(({y:t})=>Math.max(0,Math.min(u,t)));return E({xmin:Math.floor(Math.max(0,Math.min(...I))),xmax:Math.ceil(Math.min(f,Math.max(...I))),ymin:Math.floor(Math.max(0,Math.min(...b))),ymax:Math.ceil(Math.min(u,Math.max(...b)))},f,u)}async function C(a,n,r,i,e){if("3d"!==n.type)return null;const{farDistance:o}=a.attributes;if("number"!=typeof o||!Number.isFinite(o)||o<=0)return null;const m=o,[h,l]=r,s=V(n,m),c=await i(s,e);t(e);const M=c.filter(({x:t,y:a})=>Number.isFinite(t)&&Number.isFinite(a));if(M.length<4)return null;const x=B(M,l);if(!x)return null;const f=H(M.map(({x:t})=>G(t,h)),h),u=h-f.gap;return u<=0?null:u>=h-v?[{xmin:0,xmax:h,ymin:x.ymin,ymax:x.ymax}]:J(f,h,x)}function E(t,a,n){const r=Math.max(g,t.xmax-t.xmin),i=Math.max(g,t.ymax-t.ymin),e=Math.max(I,Math.round(r*b)),o=Math.max(I,Math.round(i*b)),m=Math.floor(Math.max(0,t.xmin-e)),h=Math.ceil(Math.min(a,t.xmax+e)),l=Math.floor(Math.max(0,t.ymin-o)),s=Math.ceil(Math.min(n,t.ymax+o));return h>m&&s>l?{xmin:m,xmax:h,ymin:l,ymax:s}:null}function B(t,a){const n=t.map(({y:t})=>Math.max(0,Math.min(a,t))),r=Math.floor(Math.max(0,Math.min(...n))),i=Math.ceil(Math.min(a,Math.max(...n)));return i>r?{ymin:r,ymax:i}:null}function G(t,a){return(t%a+a)%a}function H(t,a){const n=t.slice().sort((t,a)=>t-a);let r=-1,i=0,e=0;for(let o=0;o<n.length;o+=1){const t=n[o],m=o===n.length-1?n[0]+a:n[o+1],h=m-t;h>r&&(r=h,i=t,e=m)}return{gap:r,start:i,end:e}}function J(t,a,n){const r=G(t.end,a),i=G(t.start,a);return r<=i?[{xmin:Math.floor(r),xmax:Math.ceil(i),...n}]:[{xmin:0,xmax:Math.ceil(i),...n},{xmin:Math.floor(r),xmax:a,...n}].filter(({xmin:t,xmax:a})=>a>t)}function K(t,a,n=P){const[r,i]=t,e=a?Math.max(g,a.xmax-a.xmin):r,o=a?Math.max(g,a.ymax-a.ymin):i;if(e<=0||o<=0)return{columns:F,rows:F};const m=e/o;return m>=1?{columns:n,rows:Math.max(F,Math.round(n/m))}:{columns:Math.max(F,Math.round(n*m)),rows:n}}export{N as applySphereMeshOffsetInMeters,q as clampRasterLevelForTextureSize,k as computeDefaultAreaOfInterest,C as computePanoramicAreasOfInterest,V as createFarplaneSamplePoints,j as createSuperimposeGridVertexAttributes,R as createSuperimposeSamplePixels,O as getBaseRasterLevel,U as getDefaultSuperimposeFov,W as getEffectiveImageFieldOfView,S as getRasterFetchParameters,A as getRasterLevelSize,D as getViewCameraFieldOfView,L as getViewDependentRasterLevel,u as panoramicSuperimposeKeyboardAngleStep,s as panoramicSuperimposeMaxFov,f as panoramicSuperimposeMaxTilt,l as panoramicSuperimposeMinFov,x as panoramicSuperimposeMinTilt,c as panoramicSuperimposeZoomInFactor,M as panoramicSuperimposeZoomOutFactor};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clamp as e}from"../../core/mathUtils.js";import t from"../../geometry/Extent.js";import n from"../../geometry/Multipoint.js";import r from"../../geometry/Point.js";import o from"../../geometry/Polygon.js";import a from"../../geometry/Polyline.js";import{projectAsync as s}from"../../geometry/projectionUtils.js";import{execute as i}from"../../geometry/operators/intersectionOperator.js";import{videoSpatialReference as m,sampleExtent as p}from"./constants.js";const c=1920,x=1080;function y(e){if(!e)throw new Error("Missing View");return[e.on("drag",e=>e.stopPropagation()),e.on("key-down",e=>{e.key.startsWith("Arrow")&&e.stopPropagation()})]}const l=(e,t)=>{const n=(e-p.xmin)/(p.xmax-p.xmin),r=(p.ymax-t)/(p.ymax-p.ymin);return{x:n*c,y:r*x}},f=t=>({x:e((t.x+.5)*c,0,c),y:e((.5-t.y)*x,0,x)}),u=e=>d(f(e));function g(e){switch(e.type){case"point":return u(e);case"polyline":return new a({paths:e.paths.map(e=>e.map(([e,t])=>{const n=u({x:e,y:t});return[n.x,n.y]})),spatialReference:m});case"polygon":return new o({rings:e.rings.map(e=>e.map(([e,t])=>{const n=u({x:e,y:t});return[n.x,n.y]})),spatialReference:m});case"multipoint":return new n({points:e.points.map(([e,t])=>{const n=u({x:e,y:t});return[n.x,n.y]}),spatialReference:m});case"extent":{const t=g(o.fromExtent(e));return t?.extent??null}default:return null}}const w=n=>{const r=o.fromExtent(new t(p)),a=i(r,n);return a?a.rings[0].map(([t,n])=>{const{x:r,y:o}=l(t,n);return{x:e(r,0,c),y:e(o,0,x)}}):[]},R=e=>{const n=e.width/2,r=e.height/2,o=p.xmin+n,a=p.xmax-n,s=p.ymin+r,i=p.ymax-r;return o<a&&s<i?new t({xmin:o,ymin:s,xmax:a,ymax:i,spatialReference:p.spatialReference}):null},h=e=>e.x>=0&&e.x<=c&&e.y>=0&&e.y<=x;async function j(e,t,n){switch(t?.type){case"polygon":{const r=e.spatialReference.equals(t.spatialReference)?e:await s(e,t.spatialReference,n);return t.contains(r)}case"mesh":{const r=e.spatialReference.equals(t.spatialReference)?e:await s(e,t.spatialReference,n);return t.extent.contains(r)}default:return!1}}const d=t=>{const n=e(t.x,0,c),o=e(t.y,0,x);return new r({x:p.xmin+n/c*(p.xmax-p.xmin),y:p.ymax-o/x*(p.ymax-p.ymin),spatialReference:p.spatialReference})};export{y as disableVideoZoomAndPan,l as geoToPixel,R as getUpdatedConstraints,w as getUpdatedExtentPoints,g as imageGeometryToVideoMapGeometry,u as imageMapPointToVideoMapPoint,j as isSelectedPointWithinVideoFootprint,h as isVideoPixelWithinFrame,d as pixelToVideoMapPoint,x as videoHeight,c as videoWidth};
2
+ import{clamp as e}from"../../core/mathUtils.js";import t from"../../geometry/Extent.js";import n from"../../geometry/Multipoint.js";import r from"../../geometry/Point.js";import o from"../../geometry/Polygon.js";import a from"../../geometry/Polyline.js";import{projectAsync as s}from"../../geometry/projectionUtils.js";import{intersectionExecute as i}from"../../geometry/operators/intersectionOperator.js";import{videoSpatialReference as m,sampleExtent as p}from"./constants.js";const c=1920,x=1080;function y(e){if(!e)throw new Error("Missing View");return[e.on("drag",e=>e.stopPropagation()),e.on("key-down",e=>{e.key.startsWith("Arrow")&&e.stopPropagation()})]}const l=(e,t)=>{const n=(e-p.xmin)/(p.xmax-p.xmin),r=(p.ymax-t)/(p.ymax-p.ymin);return{x:n*c,y:r*x}},f=t=>({x:e((t.x+.5)*c,0,c),y:e((.5-t.y)*x,0,x)}),u=e=>d(f(e));function g(e){switch(e.type){case"point":return u(e);case"polyline":return new a({paths:e.paths.map(e=>e.map(([e,t])=>{const n=u({x:e,y:t});return[n.x,n.y]})),spatialReference:m});case"polygon":return new o({rings:e.rings.map(e=>e.map(([e,t])=>{const n=u({x:e,y:t});return[n.x,n.y]})),spatialReference:m});case"multipoint":return new n({points:e.points.map(([e,t])=>{const n=u({x:e,y:t});return[n.x,n.y]}),spatialReference:m});case"extent":{const t=g(o.fromExtent(e));return t?.extent??null}default:return null}}const w=n=>{const r=o.fromExtent(new t(p)),a=i(r,n);return a?a.rings[0].map(([t,n])=>{const{x:r,y:o}=l(t,n);return{x:e(r,0,c),y:e(o,0,x)}}):[]},R=e=>{const n=e.width/2,r=e.height/2,o=p.xmin+n,a=p.xmax-n,s=p.ymin+r,i=p.ymax-r;return o<a&&s<i?new t({xmin:o,ymin:s,xmax:a,ymax:i,spatialReference:p.spatialReference}):null},h=e=>e.x>=0&&e.x<=c&&e.y>=0&&e.y<=x;async function j(e,t,n){switch(t?.type){case"polygon":{const r=e.spatialReference.equals(t.spatialReference)?e:await s(e,t.spatialReference,n);return t.contains(r)}case"mesh":{const r=e.spatialReference.equals(t.spatialReference)?e:await s(e,t.spatialReference,n);return t.extent.contains(r)}default:return!1}}const d=t=>{const n=e(t.x,0,c),o=e(t.y,0,x);return new r({x:p.xmin+n/c*(p.xmax-p.xmin),y:p.ymax-o/x*(p.ymax-p.ymin),spatialReference:p.spatialReference})};export{y as disableVideoZoomAndPan,l as geoToPixel,R as getUpdatedConstraints,w as getUpdatedExtentPoints,g as imageGeometryToVideoMapGeometry,u as imageMapPointToVideoMapPoint,j as isSelectedPointWithinVideoFootprint,h as isVideoPixelWithinFrame,d as pixelToVideoMapPoint,x as videoHeight,c as videoWidth};
package/widgets/Print.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{formatNumber as t}from"../intl.js";import i from"../core/Collection.js";import{deprecateWidget as a}from"../core/deprecate.js";import{JSONMap as l}from"../core/jsonMap.js";import o from"../core/Logger.js";import{watch as n,on as s,whenOnce as r}from"../core/reactiveUtils.js";import{unitName as c}from"../core/unitFormatUtils.js";import{addProxy as p,hasSameOrigin as d}from"../core/urlUtils.js";import{property as m,subclass as u}from"../core/accessorSupport/decorators.js";import{ensureInteger as h}from"../core/accessorSupport/ensureType.js";import b from"../geometry/SpatialReference.js";import{isValid as _}from"../geometry/support/spatialReferenceUtils.js";import v from"../portal/Portal.js";import{reArcGISOnlineDomain as g}from"../portal/support/urlUtils.js";import{findToken as f}from"../rest/utils.js";import{formatJsonMap as y}from"../rest/support/fileFormat.js";import T from"./Widget.js";import w from"./Print/FileLink.js";import k from"./Print/PrintViewModel.js";import x from"./Print/TemplateOptions.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{globalCss as S}from"./support/globalCss.js";import{Heading as I}from"./support/Heading.js";import{legacyIcon as O}from"./support/legacyIcon.js";import{messageBundle as L,tsx as E,isRTL as $,tsxFragment as F,isActivationKey as M}from"./support/widget.js";const P="map-only",A="esri-print",R={base:A,headerTitle:`${A}__header-title`,layoutTabList:`${A}__layout-tab-list`,layoutTab:`${A}__layout-tab`,layoutSection:`${A}__layout-section`,mapOnlySection:`${A}__map-only-section`,panelItemsCentered:`${A}__panel-items--centered`,loader:`${A}__loader`,swapButton:`${A}__swap-button`,printButton:`${A}__export-button`,printButtonSection:`${A}__export-button-section`,printButtonSectionDivider:`${A}__export-button-section--divider`,templateSelectContainer:`${A}__template-select-container`,templateSelectIcon:`${A}__template-select-icon`,templateSelectError:`${A}__template-select-error`,templateSelectArrow:`${A}__template-select-arrow`,formSectionContainer:`${A}__form-section-container`,advancedOptionsSection:`${A}__advanced-options-section`,advancedOptionsContainer:`${A}__advanced-options-container`,browseTemplateButtonContainer:`${A}__browse-template-button-container`,browseTemplateButtonContainerFilter:`${A}__browse-template-button-container-filter`,exportedFilesContainer:`${A}__export-panel-container`,exportedFilesTitle:`${A}__export-title`,exportedFile:`${A}__exported-file`,exportedFileLinkTitle:`${A}__exported-file-link-title`,exportedFileLinkDescription:`${A}__exported-file-link-description`,exportedFilesEmpty:`${A}__exported-files-empty`,printWidgetContainer:`${A}__container`,content:`${A}__content`,panelContainer:`${A}__panel-container`,scaleInfoContainer:`${A}__scale-info-container`,scaleInputContainer:`${A}__scale-input-container`,scaleInput:`${A}__scale-input`,sizeContainer:`${A}__size-container`,panelError:`${A}__panel--error`,exportedFileLoader:`${A}__exported-file--loader`,exportSection:`${A}__export-section`,exportSectionCentered:`${A}__export-section--centered`,templateButtonContainer:`${A}__template-button-container`,templateDoneButton:`${A}__template-done-button`,templateSelectFlowItemContainer:`${A}__template-select-flow-item-container`,templateSelectFlowItemContent:`${A}__template-select-flow-item-content`,templateSelectFlowItemListHeading:`${A}__template-select-flow-item-list-heading`,srLabel:`${A}__sr-label`,invalidWkidText:`${A}__invalid-wkid-text`};function D(e){return!isNaN(e)&&e>0&&Number.isFinite(e)}function B(e){return e?.toLowerCase()===P}function N(e){const{state:t,extension:i}=e;switch(t){case"pending":return"spinner";case"error":return"exclamation-mark-circle";default:return i?.toLowerCase()?.includes("pdf")?"file-pdf":"file"}}const V=new l({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),j=new Map([["a3-landscape","a3-landscape"],["a3-portrait","a3-portrait"],["a4-landscape","a4-landscape"],["a4-portrait","a4-portrait"],["letter-ansi-a-landscape","ansi-a-landscape"],["letter-ansi-a-portrait","ansi-a-portrait"],["tabloid-ansi-b-landscape","ansi-b-landscape"],["tabloid-ansi-b-portrait","ansi-b-portrait"]]);let U=class extends T{constructor(e,t){super(e,t),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._selectedTab="layoutTab",this._pendingExportScroll=!1,this._rootNode=null,this._selectedTemplate=null,this._formats=[],this._showTemplates=!1,this._isValidSpatialReference=!0,this.allowedFormatsForSaving=null,this.browseTemplateButtonOnClick=null,this.headerVisible=!0,this.headingLevel=3,this.includeOrganizationTemplates=!0,this.messagesCommon=null,this.messagesUnits=null,this.saveExportHidden=!0,this.saveAsButtonCallback=null,this.viewModel=new k,this._onInput=e=>{"layoutTab"===this._selectedTab?this.templateOptions.title=e.currentTarget.value:"mapOnlyTab"===this._selectedTab&&(this.templateOptions.fileName=e.currentTarget.value)},this._handleLinkClick=e=>{const t=e.currentTarget["data-item"];if(!t||"ready"!==t.state||!t.url)return;const i=f(this.viewModel.effectivePrintServiceUrl),a=t.url,l=document.createElement("a");if(l.target="_blank",l.href=a,l.rel="noreferrer",l.download=t.formattedName??"",!i)return l.click(),void e.stopPropagation();e.preventDefault();const o=new URL(a);o.searchParams.set("token",i),l.href=o.href,l.click(),l.href=a},a(o.getLogger(this),"Print","arcgis-print",{version:"4.33"}),this._focusOnTabChange=this._focusOnTabChange.bind(this)}initialize(){this.addHandles([n(()=>[this.templateOptions.format,this.viewModel.templatesInfo?.format],()=>{const{templatesInfo:e}=this.viewModel;if(!e)return;if(this._formats.length!==e.format.choiceList.length){const t=y.apiValues;this._formats=e.format.choiceList.map(e=>{const i=t.find(t=>new RegExp(`\\b${t}\\b`,"i").test(e))??e;return{value:i,label:e===i?e.toUpperCase():e}}).sort((e,t)=>e.label.localeCompare(t.label))}const t=this._formats.some(({value:e})=>new RegExp(`\\b${e}\\b`,"i").test(this.templateOptions.format));if(e.format.defaultValue&&!t){const t=this._formats.find(({value:t})=>new RegExp(`\\b${t}\\b`,"i").test(e.format.defaultValue))?.value;return void(t&&(this.templateOptions.format=t))}}),n(()=>[this.templateOptions.id,this.viewModel.loaded],()=>{const{layout:e}=this.templateOptions;this._selectedTab=B(e)?"mapOnlyTab":"layoutTab","layoutTab"===this._selectedTab&&this.viewModel.loaded&&(this._selectedTemplate=this.viewModel.getLayoutTemplateById(this.templateOptions.id))}),n(()=>this.templateOptions.dpi,e=>{e<=0&&(this.templateOptions.dpi=1)}),n(()=>this.viewModel.view?.scale,e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}),s(()=>this.viewModel,"submit",e=>this.emit("submit",e)),s(()=>this.viewModel,"complete",e=>this.emit("complete",e))]);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const i=setTimeout(()=>{this._awaitingServerResponse=!0,this.scheduleRender()},500);this.viewModel.load().then(()=>{clearTimeout(i),this._awaitingServerResponse=!1},()=>{})}loadDependencies(){return C({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),link:()=>import("@esri/calcite-components/dist/components/calcite-link")})}destroy(){this.viewModel.destroy()}get allowedFormats(){return this.viewModel.allowedFormats}set allowedFormats(e){this.viewModel.allowedFormats=e}get allowedLayouts(){return this.viewModel.allowedLayouts}set allowedLayouts(e){this.viewModel.allowedLayouts=e}get error(){return this.viewModel.error}get exportedLinks(){return this.viewModel.exportedLinks}set exportedLinks(e){this.viewModel.exportedLinks=e}get extraParameters(){return this.viewModel.extraParameters}set extraParameters(e){this.viewModel.extraParameters=e}get icon(){return"print"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultTemplates(){return this.viewModel.includeDefaultTemplates}set includeDefaultTemplates(e){this.viewModel.includeDefaultTemplates=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get outSpatialReference(){return this.viewModel.outSpatialReference}set outSpatialReference(e){this.viewModel.outSpatialReference=e}get portal(){return this.viewModel.portal}set portal(e){this.viewModel.portal=e}get saveExportEnabled(){return this.viewModel.saveExportEnabled}set saveExportEnabled(e){this.viewModel.saveExportEnabled=e}get showPrintAreaEnabled(){return this.viewModel.showPrintAreaEnabled}set showPrintAreaEnabled(e){this.viewModel.showPrintAreaEnabled=e}get printServiceUrl(){return this.viewModel.printServiceUrl}set printServiceUrl(e){this.viewModel.printServiceUrl=e}get templateCustomTextElements(){return this.viewModel.templateCustomTextElements}set templateCustomTextElements(e){this.viewModel.templateCustomTextElements=e}get templateOptions(){return this.viewModel.templateOptions}set templateOptions(e){this.viewModel.templateOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{messages:e,templateOptions:t,viewModel:i,view:a}=this,{attributionEnabled:l,author:o,copyright:n,dpi:s,format:r,height:c,layout:p,layoutItem:d,legendEnabled:m,northArrowEnabled:u,scaleBarEnabled:v,scaleEnabled:g,scale:f,width:y}=t,T="ready"!==i.state||this._awaitingServerResponse||!(p||d),w=this._renderTitleOrFileNameSection(),k=E("div",{class:R.formSectionContainer},E("calcite-label",null,e.fileFormatTitle,E("calcite-combobox",{clearDisabled:!0,label:e.formatDefaultOption,maxItems:6,placeholder:e.formatDefaultOption,selectionMode:"single-persist",topLayerDisabled:this.topLayerDisabled,onCalciteComboboxChange:({currentTarget:e})=>{this.templateOptions.format=e.selectedItems[0]?.value??"pdf"}},this._formats.map(({value:e,label:t},i)=>E("calcite-combobox-item",{heading:t,key:`file-format-${i}`,selected:e===this.templateOptions.format,value:e}))))),x=E("calcite-label",{layout:"inline"},E("calcite-switch",{checked:this.showPrintAreaEnabled,onCalciteSwitchChange:e=>{this.showPrintAreaEnabled=!!e.currentTarget.checked}}),e.printPreview),C=E("div",null,E("div",{class:R.formSectionContainer},E("calcite-label",null,e.template,E("calcite-block",{class:R.templateSelectContainer,collapsible:!1,description:this._getPageSizeLabel(this._selectedTemplate),heading:this._getTemplateLabel(this._selectedTemplate,!0),key:"template-select-block",label:e.template,loading:"loading"===this._selectedTemplate?.state,tabIndex:0,onclick:()=>this._showTemplates=!0,onkeydown:e=>{"Enter"!==e.key&&" "!==e.key||(this._showTemplates=!0)}},E("calcite-icon",{class:R.templateSelectIcon,icon:(this._selectedTemplate?.layout?j.get(this._selectedTemplate.layout):null)||"custom-print",key:"template-select-icon",scale:"l",slot:"content-start"}),"error"===this._selectedTemplate?.state?E("calcite-icon",{class:R.templateSelectError,icon:"exclamation-mark-circle",key:"template-select-error",scale:"s",slot:"actions-end"}):null,E("calcite-icon",{class:R.templateSelectArrow,icon:$()?"chevron-left":"chevron-right",key:"template-select-arrow",scale:"s",slot:"actions-end"})))),x),L=E("div",{class:R.formSectionContainer},E("calcite-label",null,e.dpi,E("calcite-input-number",{bind:this,"data-input-name":"dpi",min:1,value:`${s}`,onCalciteInputNumberInput:this._updateNumberInputValue}))),F=E("div",{class:R.formSectionContainer},E("calcite-label",null,E("div",{class:R.srLabel},e.outSpatialReference,E("calcite-link",{href:"https://developers.arcgis.com/rest/services-reference/enterprise/using-spatial-references/",target:"_blank"},"(WKID)")),E("calcite-input-number",{bind:this,"data-input-name":"outSpatialReference",integer:!0,numberButtonType:"none",value:i.outSpatialReference?.wkid?.toString()??"",onCalciteInputNumberInput:({currentTarget:e})=>{const t=h(e.value);i.outSpatialReference=Number.isNaN(t)||null==t?null:new b({wkid:t}),this._isValidSpatialReference=!i.outSpatialReference||_(i.outSpatialReference)}}),this._isValidSpatialReference?null:E("div",{class:R.invalidWkidText,key:`out-sr-${i.outSpatialReference?.wkid}`},e.invalidWkid))),M=E("div",{class:this.classes(R.scaleInfoContainer,R.formSectionContainer)},E("calcite-label",{layout:"inline"},E("calcite-checkbox",{bind:this,checked:g,"data-option-name":"scaleEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scale),E("div",{class:R.scaleInputContainer},E("calcite-input-number",{"aria-label":e.scaleLabel,"aria-valuenow":`${f}`,bind:this,class:R.scaleInput,"data-input-name":"scale",disabled:!g,value:`${f}`,onCalciteInputNumberInput:this._updateNumberInputValue}),E("calcite-button",{appearance:"outline","aria-label":e.reset,bind:this,disabled:!g,iconStart:"refresh",kind:"neutral",onclick:this._resetToCurrentScale}))),P=E("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:R.advancedOptionsContainer,key:"advanced-section-for-layout"},M,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?E("div",{class:R.formSectionContainer,key:"author-info"},E("calcite-label",null,e.author,E("calcite-input",{bind:this,"data-input-name":"author",value:o??"",onCalciteInputInput:this._updateInputValue}))):null,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??1?E("div",{class:R.formSectionContainer,key:"copyright-text"},E("calcite-label",null,e.copyright,E("calcite-input",{bind:this,"data-input-name":"copyright",value:n??"",onCalciteInputInput:this._updateInputValue}))):null,L,F,this._renderCustomTextElementSection(),this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend??1?E("div",{class:R.formSectionContainer,key:"legend-info"},E("calcite-label",{layout:"inline"},E("calcite-checkbox",{bind:this,checked:!!m,"data-option-name":"legendEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this._selectedTemplate?.mapSurroundInfoOptions?.northArrow.length?E("div",{class:R.formSectionContainer,key:"north-arrow"},E("calcite-label",{layout:"inline"},E("calcite-checkbox",{bind:this,checked:!!u,"data-option-name":"northArrowEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._selectedTemplate?.mapSurroundInfoOptions?.scaleBar.length?E("div",{class:R.formSectionContainer,key:"scale-bar"},E("calcite-label",{layout:"inline"},E("calcite-checkbox",{bind:this,checked:!!v,"data-option-name":"scaleBarEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scaleBar)):null),A=E("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:R.advancedOptionsContainer},M,L,F,E("div",{class:R.formSectionContainer},E("calcite-label",{layout:"inline"},E("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),D=this.exportedLinks.toArray(),B=this._renderExportedLinkItems(D),N={[R.exportSectionCentered]:!D.length},V="layoutTab"===this._selectedTab?E("section",{"aria-labelledby":`${this.id}__layoutTab`,class:R.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},E("div",{class:R.panelContainer},this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?w:null,C,"layoutTab"===this._selectedTab?k:null,E("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(R.panelContainer,R.advancedOptionsSection),collapsible:!0,disabled:!(p||d?.id),heading:e.advancedOptions,id:"advancedOptionsForLayout",key:"advanced-options-for-layout"},P))):"mapOnlyTab"===this._selectedTab?E("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:R.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},E("div",{class:R.panelContainer},w,k,E("div",null,E("div",{class:this.classes(R.sizeContainer,R.formSectionContainer)},E("calcite-label",null,e.width,E("calcite-input-number",{bind:this,"data-input-name":"width",value:`${y}`,onCalciteInputNumberInput:this._updateNumberInputValue})),E("calcite-label",null,e.height,E("calcite-input-number",{bind:this,"data-input-name":"height",value:`${c}`,onCalciteInputNumberInput:this._updateNumberInputValue})),E("button",{"aria-label":e.swap,bind:this,class:this.classes(S.widgetButton,R.swapButton,O.swap),type:"button",onclick:this._switchInput})),x),E("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(R.panelContainer,R.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly",key:"advanced-options-for-map-only"},A))):E("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(R.exportSection,N),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},E("div",{class:R.panelContainer},E("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:R.exportedFilesContainer},0===D.length?E("div",{class:R.exportedFilesEmpty},E("calcite-icon",{icon:"file",scale:"l"}),E("div",null,E(I,{class:R.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),E("div",null,e.exportHint))):B))),U="2d"!==a?.type,H=E("div",{class:R.panelError},a?U?e.sceneViewError:e.serviceError:e.noViewError),z=D.some(({state:e})=>"pending"===e),W=E("div",{class:R.content,key:"panel"},E("div",null,E("ul",{bind:this,class:R.layoutTabList,role:"tablist",onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown},E("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"layoutTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"layoutTab",id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),E("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"mapOnlyTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"mapOnlyTab",id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),E("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"exportTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"exportTab",id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},z?E("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),V),"exportTab"!==this._selectedTab?E("div",{class:this.classes(R.printButtonSection,!this.saveExportHidden&&this.portal?R.printButtonSectionDivider:null),key:"export-button-section"},!this.saveExportHidden&&this.portal?E("calcite-label",{layout:"inline"},E("calcite-checkbox",{bind:this,checked:this.saveExportEnabled,onCalciteCheckboxChange:e=>{this.saveExportEnabled=!!e.currentTarget.checked}}),e.saveExportToMyContent):null,E("calcite-button",{"aria-label":e.exportDescription,bind:this,class:this.classes(R.printButton),disabled:T||!(p||d?.id)&&!r,scale:"l",width:"full",onclick:this._handlePrintMap},e.export)):null),q=E("calcite-flow",{key:"root-flow"},E("calcite-flow-item",{bind:this,key:"root-flow-item",selected:!this._showTemplates},E("div",{class:R.printWidgetContainer},this.headerVisible?E("header",{class:R.headerTitle},e.export):null,this.error||U||!a?H:W)),this._renderChooseTemplateFlowItem()),K="initializing"===i.state,J=K?this._renderLoader():q,G={[R.panelItemsCentered]:K};return E("div",{bind:this,class:this.classes(R.base,S.widget,S.panel,G)},J)}_getPageSizeLabel(e){if(!e)return;const i=e.layoutTemplateInfo;if(!i)return;const a=V.fromJSON(i.pageUnits.toLowerCase());return`${t(i.pageSize[0])} × ${t(i.pageSize[1])} ${c(this.messagesUnits,a,"abbr")}`}_getTemplateLabel(e,t=!1){if(!e)return t?this.messages.selectTemplate:this.messages.untitled;const{label:i,layout:a,layoutItem:l}=e,o=a&&!l&&this.messages[a]?this.messages[a]:null;if(o)return o;const n=i??a??l?.id;return n?.replaceAll("_"," ")??this.messages.untitled}_getPortalTemplates(){return this.includeDefaultTemplates&&this.includeOrganizationTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:e,layoutItem:t})=>!B(e)&&!!t?.id):[]}_getDefaultTemplates(){return this.includeDefaultTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:e,layoutItem:t})=>!B(e)&&!t?.id):[]}_getPrintServiceTemplates(){return this.includeDefaultTemplates&&this._getDefaultTemplates().length?[]:this.viewModel.printServiceTemplates.toArray().filter(({layout:e})=>!B(e))}_renderLayoutTemplates(e,t=!1,i=!1){return t&&e.sort((e,t)=>(e.label??"")>(t.label??"")?1:-1),e.map(e=>E("calcite-list-item",{description:this._getPageSizeLabel(e),key:`template-${e.id}-${e.id===this.templateOptions.id}`,label:this._getTemplateLabel(e),selected:e.id===this.templateOptions.id,title:e.description??"",value:e},E("calcite-icon",{icon:(e.layout?j.get(e.layout):null)||"custom-print",slot:"content-start"}),"loading"===e.state?E("calcite-loader",{inline:!0,key:`template-loader-${e.id}`,label:"loading",scale:"s",slot:"content-end"}):null,"error"===e?.state?E("calcite-icon",{class:R.templateSelectError,icon:"exclamation-mark-circle",key:`template-error-${e.id}`,scale:"s",slot:"content-end"}):null,i?E("calcite-action",{icon:"trash",slot:"actions-end",text:"delete",onclick:()=>this.viewModel.removePortalTemplate(e)}):null))}_renderChooseTemplateFlowItem(){if(!this._showTemplates)return null;const{messages:e}=this,t=g.test(this.portal?.url),i=this.viewModel.browseTemplates.toArray(),a=this._getPortalTemplates(),l=this._getDefaultTemplates(),o=this._getPrintServiceTemplates(),n=i.length+a.length+l.length+o.length>15,s=this.browseTemplateButtonOnClick?E("calcite-button",{appearance:"outline",class:n?R.browseTemplateButtonContainerFilter:R.browseTemplateButtonContainer,iconStart:"folder",key:"browse-template-button",slot:n?"filter-actions-end":"default",onclick:this.browseTemplateButtonOnClick},n?null:e.browseTemplates):null;return E("calcite-flow-item",{bind:this,closable:!1,heading:e.chooseTemplate,key:"template-flow-item",selected:this._showTemplates,onCalciteFlowItemBack:e=>{e.preventDefault(),this._showTemplates=!1}},E("div",{class:R.templateSelectFlowItemContainer},E("div",{class:R.templateSelectFlowItemContent},n?null:s,E("calcite-list",{filterEnabled:n,filterProps:["label"],key:"template-list",label:e.templateList,selectionMode:"single-persist",onCalciteListChange:({currentTarget:e})=>this.viewModel.applyTemplate(e.selectedItems[0]?.value)},n?s:null,i.length?E("div",{key:"my-templates"},E("div",{class:R.templateSelectFlowItemListHeading},e.myTemplates,t?E("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(i,!0,!0)):null,a.length?E("div",{key:"org-templates"},E("div",{class:R.templateSelectFlowItemListHeading},e.organizationTemplates,t?E("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(a)):null,i.length||a.length?l.length?E("div",{key:"default-templates"},E("div",{class:R.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(l,!0)):null:this._renderLayoutTemplates(l,!0),i.length||a.length?o.length?E("div",{key:"service-templates"},E("div",{class:R.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(o)):null:this._renderLayoutTemplates(o))),E("div",{class:R.templateButtonContainer},E("calcite-button",{class:R.templateDoneButton,onclick:()=>this._showTemplates=!1},this.messagesCommon.done))))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?E("div",{class:R.formSectionContainer,key:"custom-text-elements"},e.map((e,t)=>{const[i,a]=Object.entries(e)[0];return"date"===i?null:E("calcite-label",{key:`custom-text-elements-${i}-${t}`},i,E("calcite-input",{bind:this,"data-input-custom":!0,"data-input-name":i,value:a??"",onCalciteInputInput:this._updateInputValue}))})):null}_renderTitleOrFileNameSection(){const{title:e,fileName:t,titlePlaceHolder:i,fileNamePlaceHolder:a}=this.messages,l="layoutTab"===this._selectedTab?e:t,o="layoutTab"===this._selectedTab?i:a,n="layoutTab"===this._selectedTab?this.templateOptions.title:this.templateOptions.fileName;return E("div",{class:R.formSectionContainer,key:l},E("calcite-label",null,l,E("calcite-input",{placeholder:o,value:n??"",onCalciteInputInput:this._onInput})))}_focusOnTabChange(e){if(!this._activeTabFocusRequested)return;const t=e.getAttribute("data-tab-id");("layoutTab"===t&&"layoutTab"===this._selectedTab||"mapOnlyTab"===t&&"mapOnlyTab"===this._selectedTab||"exportTab"===t&&"exportTab"===this._selectedTab)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[R.loader]:this._awaitingServerResponse};return E("div",{class:this.classes(e),key:"loader"})}_resetToCurrentScale(){this.templateOptions.scale=this.viewModel.view?.scale}_updateCustomTextElementValue(e,t,i){e.find(e=>{const[i]=Object.entries(e)[0];return i===t})[t]=i}_updateInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),a=!!t["data-input-custom"],{templateOptions:l}=this;a?this._updateCustomTextElementValue(l.customTextElements,i,t.value):l[i]=t.value}_updateNumberInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),{templateOptions:a}=this,l=Number(t.value);if(!D(l)){const e=a[i];return void(t.value=`${e}`)}a[i]=l}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e}=this,t="layoutTab"===this._selectedTab?e.title:e.fileName,{promise:i}=this.viewModel.export(t||this.messages.untitled);this._selectedTab="exportTab",i.then(()=>this.scheduleRender())}_switchInput(){[this.templateOptions.width,this.templateOptions.height]=[this.templateOptions.height,this.templateOptions.width]}_scrollExportIntoView(){if(!this._pendingExportScroll)return;this._pendingExportScroll=!1;const e=this._rootNode;if(!e)return;const{clientHeight:t,scrollHeight:i}=e,a=i-t;a>0&&(e.scrollTop=a)}_toggleInputValue(e){const t=e.target,i=t.getAttribute("data-option-name");this.templateOptions[i]=t.checked,"scaleEnabled"===i&&this._resetToCurrentScale()}_renderExportedLinkItemPopover(e){const t=this.messages,i=e.formattedName??"",{state:a}=e,l=this.saveAsButtonCallback&&"error"!==a&&this._isFormatAllowedForSaving(e.extension);return"pending"!==a&&l?E("calcite-popover",{autoClose:!0,key:`${i}-popover`,label:"Popover",offsetDistance:1,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:`${i}-popover-button`,scale:"s",topLayerDisabled:this.topLayerDisabled},E("calcite-list",{label:""},e.portalItem?E("calcite-list-item",{label:t.openItem,onCalciteListItemSelect:()=>{const t=e.portalItem;if(!t||!t.itemPageUrl)return;const i=document.createElement("a");i.target="_blank",i.href=t.itemPageUrl,i.rel="noreferrer",i.click()}},E("calcite-icon",{icon:"launch2",key:`${i}-launch-icon`,scale:"s",slot:"content-start"})):E("calcite-list-item",{label:t.saveAs,onCalciteListItemSelect:async()=>{this.saveAsButtonCallback&&(r(()=>e.portalItem).then(e=>{e.itemPageUrl&&this.scheduleRender()}),await this.saveAsButtonCallback(e))}},E("calcite-icon",{icon:"save",key:`${i}-save-icon`,scale:"s",slot:"content-start"})),E("calcite-list-item",{label:this.messagesCommon.delete,onCalciteListItemSelect:()=>this.exportedLinks.remove(e)},E("calcite-icon",{icon:"trash",key:`${i}-delete-icon`,scale:"s",slot:"content-start"})))):null}_renderExportedLinkItemContent(e){const t=this.messages,{url:i,state:a,error:l}=e,o=e.formattedName??"";let n=i||null;n&&(n=p(n));const s=d(n,location.href),r="error"===a?"print-task:cim-symbol-unsupported"===l?.name?t.exportWebMapCIMError:t.exportWebMapError:null;return E("div",{class:R.exportedFile,"data-item":e,slot:"content",onclick:this._handleLinkClick},E("div",null,E("div",{class:R.exportedFileLinkTitle},o),E("div",{class:R.exportedFileLinkDescription},"pending"===a?t.generatingExport:r||(s?t.ready:t.linkReady))),"ready"===a?E("calcite-icon",{"aria-label":`${o}. ${t.linkReady}`,icon:s?"download-to":"launch",key:`${o}-end-icon`,scale:"s",slot:"content-end"}):null)}_renderExportedLinkItemIcon(e){const t=e.formattedName??"";return"pending"===e.state?E("calcite-loader",{class:R.exportedFileLoader,inline:!0,key:`${t}-loader`,label:this.messages.generatingExport,scale:"m",slot:"content-start"}):E("calcite-icon",{icon:N(e),key:`${t}-start-icon`,scale:"s",slot:"content-start"})}_renderExportedLinkItemAction(e){const{state:t}=e,i=e.formattedName??"",a=this.saveAsButtonCallback&&"error"!==t&&this._isFormatAllowedForSaving(e.extension);return"pending"!==t?E("calcite-action",{icon:a?"ellipsis":"x",id:a?`${i}-popover-button`:void 0,key:a?`${i}-saveAs-action`:`${i}-action`,slot:"actions-end",text:a?this.messagesCommon.options:this.messagesCommon.remove,onclick:a?void 0:()=>{this.exportedLinks.remove(e)}}):null}_renderExportedLinkItem(e){const t=e.formattedName??"";return E(F,null,E("calcite-list-item",{key:t,label:t},this._renderExportedLinkItemContent(e),this._renderExportedLinkItemIcon(e),this._renderExportedLinkItemAction(e)),this._renderExportedLinkItemPopover(e))}_renderExportedLinkItems(e){return E("calcite-list",{filterEnabled:e?.length>10,label:this.messages.exportedLinksList,selectionMode:"none"},e.map(this._renderExportedLinkItem.bind(this)))}_isFormatAllowedForSaving(e){return!this.allowedFormatsForSaving||"all"===this.allowedFormatsForSaving||!(!e||!this.allowedFormatsForSaving.includes(e))}_toggleLayoutPanel(e){const t=e.target;this._toggleTab(t.getAttribute("data-tab-id"))}_toggleTab(e,t=!0){if(this._selectedTab=e,"mapOnlyTab"===this._selectedTab)this.viewModel.applyTemplate(P);else if("layoutTab"===this._selectedTab){const e=this._selectedTemplate??this.viewModel.defaultTemplate;this.viewModel.applyTemplate(e)}t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,i=e.target.getAttribute("data-tab-id");if(M(t))return this._toggleTab(i),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(i){case"layoutTab":this._toggleTab("ArrowLeft"===t?"exportTab":"mapOnlyTab");break;case"mapOnlyTab":this._toggleTab("ArrowLeft"===t?"layoutTab":"exportTab");break;case"exportTab":this._toggleTab("ArrowLeft"===t?"mapOnlyTab":"layoutTab")}e.preventDefault(),e.stopPropagation()}}};e([m()],U.prototype,"_showTemplates",void 0),e([m()],U.prototype,"_isValidSpatialReference",void 0),e([m()],U.prototype,"allowedFormats",null),e([m()],U.prototype,"allowedFormatsForSaving",void 0),e([m()],U.prototype,"allowedLayouts",null),e([m()],U.prototype,"browseTemplateButtonOnClick",void 0),e([m()],U.prototype,"error",null),e([m({type:i.ofType(w)})],U.prototype,"exportedLinks",null),e([m()],U.prototype,"extraParameters",null),e([m()],U.prototype,"headerVisible",void 0),e([m()],U.prototype,"headingLevel",void 0),e([m()],U.prototype,"icon",null),e([m()],U.prototype,"includeDefaultTemplates",null),e([m()],U.prototype,"includeOrganizationTemplates",void 0),e([m()],U.prototype,"label",null),e([m(),L("esri/widgets/Print/t9n/Print")],U.prototype,"messages",void 0),e([m(),L("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([m(),L("esri/core/t9n/Units")],U.prototype,"messagesUnits",void 0),e([m({type:b})],U.prototype,"outSpatialReference",null),e([m({type:v})],U.prototype,"portal",null),e([m()],U.prototype,"saveExportEnabled",null),e([m()],U.prototype,"saveExportHidden",void 0),e([m()],U.prototype,"showPrintAreaEnabled",null),e([m()],U.prototype,"printServiceUrl",null),e([m()],U.prototype,"saveAsButtonCallback",void 0),e([m()],U.prototype,"templateCustomTextElements",null),e([m({type:x})],U.prototype,"templateOptions",null),e([m()],U.prototype,"view",null),e([m({type:k})],U.prototype,"viewModel",void 0),U=e([u("esri.widgets.Print")],U);const H=U;export{H as default};
2
+ import{__decorate as e}from"tslib";import{formatNumber as t}from"../intl.js";import i from"../core/Collection.js";import{deprecateWidget as a}from"../core/deprecate.js";import{JSONMap as l}from"../core/jsonMap.js";import o from"../core/Logger.js";import{watch as n,on as s,whenOnce as r}from"../core/reactiveUtils.js";import{unitName as c}from"../core/unitFormatUtils.js";import{addProxy as p,hasSameOrigin as d}from"../core/urlUtils.js";import{property as m,subclass as u}from"../core/accessorSupport/decorators.js";import{ensureInteger as h}from"../core/accessorSupport/ensureType.js";import b from"../geometry/SpatialReference.js";import{isValid as _}from"../geometry/support/spatialReferenceUtils.js";import v from"../portal/Portal.js";import{reArcGISOnlineDomain as g}from"../portal/support/urlUtils.js";import{findToken as f}from"../rest/utils.js";import{formatJsonMap as y}from"../rest/support/fileFormat.js";import T from"./Widget.js";import w from"./Print/FileLink.js";import k from"./Print/PrintViewModel.js";import x from"./Print/TemplateOptions.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{globalCss as S}from"./support/globalCss.js";import{Heading as I}from"./support/Heading.js";import{legacyIcon as O}from"./support/legacyIcon.js";import{messageBundle as L,tsx as E,isRTL as $,tsxFragment as F,isActivationKey as M}from"./support/widget.js";const P="map-only",A="esri-print",R={base:A,headerTitle:`${A}__header-title`,layoutTabList:`${A}__layout-tab-list`,layoutTab:`${A}__layout-tab`,layoutSection:`${A}__layout-section`,mapOnlySection:`${A}__map-only-section`,panelItemsCentered:`${A}__panel-items--centered`,loader:`${A}__loader`,swapButton:`${A}__swap-button`,printButton:`${A}__export-button`,printButtonSection:`${A}__export-button-section`,printButtonSectionDivider:`${A}__export-button-section--divider`,templateSelectContainer:`${A}__template-select-container`,templateSelectIcon:`${A}__template-select-icon`,templateSelectError:`${A}__template-select-error`,templateSelectArrow:`${A}__template-select-arrow`,formSectionContainer:`${A}__form-section-container`,advancedOptionsSection:`${A}__advanced-options-section`,advancedOptionsContainer:`${A}__advanced-options-container`,browseTemplateButtonContainer:`${A}__browse-template-button-container`,browseTemplateButtonContainerFilter:`${A}__browse-template-button-container-filter`,exportedFilesContainer:`${A}__export-panel-container`,exportedFilesTitle:`${A}__export-title`,exportedFile:`${A}__exported-file`,exportedFileLinkTitle:`${A}__exported-file-link-title`,exportedFileLinkDescription:`${A}__exported-file-link-description`,exportedFilesEmpty:`${A}__exported-files-empty`,printWidgetContainer:`${A}__container`,content:`${A}__content`,panelContainer:`${A}__panel-container`,scaleInfoContainer:`${A}__scale-info-container`,scaleInputContainer:`${A}__scale-input-container`,scaleInput:`${A}__scale-input`,sizeContainer:`${A}__size-container`,panelError:`${A}__panel--error`,exportedFileLoader:`${A}__exported-file--loader`,exportSection:`${A}__export-section`,exportSectionCentered:`${A}__export-section--centered`,templateButtonContainer:`${A}__template-button-container`,templateDoneButton:`${A}__template-done-button`,templateSelectFlowItemContainer:`${A}__template-select-flow-item-container`,templateSelectFlowItemContent:`${A}__template-select-flow-item-content`,templateSelectFlowItemListHeading:`${A}__template-select-flow-item-list-heading`,srLabel:`${A}__sr-label`,invalidWkidText:`${A}__invalid-wkid-text`};function D(e){return!isNaN(e)&&e>0&&Number.isFinite(e)}function B(e){return e?.toLowerCase()===P}function N(e){const{state:t,extension:i}=e;switch(t){case"pending":return"spinner";case"error":return"exclamation-mark-circle";default:return i?.toLowerCase()?.includes("pdf")?"file-pdf":"file"}}const V=new l({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),j=new Map([["a3-landscape","a3-landscape"],["a3-portrait","a3-portrait"],["a4-landscape","a4-landscape"],["a4-portrait","a4-portrait"],["letter-ansi-a-landscape","ansi-a-landscape"],["letter-ansi-a-portrait","ansi-a-portrait"],["tabloid-ansi-b-landscape","ansi-b-landscape"],["tabloid-ansi-b-portrait","ansi-b-portrait"]]);let U=class extends T{constructor(e,t){super(e,t),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._selectedTab="layoutTab",this._pendingExportScroll=!1,this._rootNode=null,this._selectedTemplate=null,this._formats=[],this._showTemplates=!1,this._isValidSpatialReference=!0,this.allowedFormatsForSaving=null,this.browseTemplateButtonOnClick=null,this.headerVisible=!0,this.headingLevel=3,this.includeOrganizationTemplates=!0,this.messagesCommon=null,this.messagesUnits=null,this.saveExportHidden=!0,this.saveAsButtonCallback=null,this.viewModel=new k,this._onInput=e=>{"layoutTab"===this._selectedTab?this.templateOptions.title=e.currentTarget.value:"mapOnlyTab"===this._selectedTab&&(this.templateOptions.fileName=e.currentTarget.value)},this._handleLinkClick=e=>{const t=e.currentTarget["data-item"];if(!t||"ready"!==t.state||!t.url)return;const i=f(this.viewModel.effectivePrintServiceUrl),a=t.url,l=document.createElement("a");if(l.target="_blank",l.href=a,l.rel="noreferrer",l.download=t.formattedName??"",!i)return l.click(),void e.stopPropagation();e.preventDefault();const o=new URL(a);o.searchParams.set("token",i),l.href=o.href,l.click(),l.href=a},a(o.getLogger(this),"Print","arcgis-print",{version:"4.33"}),this._focusOnTabChange=this._focusOnTabChange.bind(this)}initialize(){this.addHandles([n(()=>[this.templateOptions.format,this.viewModel.templatesInfo?.format],()=>{const{templatesInfo:e}=this.viewModel;if(!e)return;if(this._formats.length!==e.format.choiceList.length){const t=y.apiValues;this._formats=e.format.choiceList.map(e=>{const i=t.find(t=>new RegExp(`\\b${t}\\b`,"i").test(e))??e;return{value:i,label:e===i?e.toUpperCase():e}}).sort((e,t)=>e.label.localeCompare(t.label))}const t=this._formats.some(({value:e})=>new RegExp(`\\b${e}\\b`,"i").test(this.templateOptions.format));if(e.format.defaultValue&&!t){const t=this._formats.find(({value:t})=>new RegExp(`\\b${t}\\b`,"i").test(e.format.defaultValue))?.value;return void(t&&(this.templateOptions.format=t))}}),n(()=>[this.templateOptions.id,this.viewModel.loaded],()=>{const{layout:e}=this.templateOptions;this._selectedTab=B(e)?"mapOnlyTab":"layoutTab","layoutTab"===this._selectedTab&&this.viewModel.loaded&&(this._selectedTemplate=this.viewModel.getLayoutTemplateById(this.templateOptions.id))}),n(()=>this.templateOptions.dpi,e=>{e<=0&&(this.templateOptions.dpi=1)}),n(()=>this.viewModel.view?.scale,e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}),s(()=>this.viewModel,"submit",e=>this.emit("submit",e)),s(()=>this.viewModel,"complete",e=>this.emit("complete",e))]);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const i=setTimeout(()=>{this._awaitingServerResponse=!0,this.scheduleRender()},500);this.viewModel.load().then(()=>{clearTimeout(i),this._awaitingServerResponse=!1},()=>{})}loadDependencies(){return C({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),link:()=>import("@esri/calcite-components/dist/components/calcite-link")})}destroy(){this.viewModel.destroy()}get allowedFormats(){return this.viewModel.allowedFormats}set allowedFormats(e){this.viewModel.allowedFormats=e}get allowedLayouts(){return this.viewModel.allowedLayouts}set allowedLayouts(e){this.viewModel.allowedLayouts=e}get error(){return this.viewModel.error}get exportedLinks(){return this.viewModel.exportedLinks}set exportedLinks(e){this.viewModel.exportedLinks=e}get extraParameters(){return this.viewModel.extraParameters}set extraParameters(e){this.viewModel.extraParameters=e}get icon(){return"print"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultTemplates(){return this.viewModel.includeDefaultTemplates}set includeDefaultTemplates(e){this.viewModel.includeDefaultTemplates=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get outSpatialReference(){return this.viewModel.outSpatialReference}set outSpatialReference(e){this.viewModel.outSpatialReference=e}get portal(){return this.viewModel.portal}set portal(e){this.viewModel.portal=e}get saveExportEnabled(){return this.viewModel.saveExportEnabled}set saveExportEnabled(e){this.viewModel.saveExportEnabled=e}get showPrintAreaEnabled(){return this.viewModel.showPrintAreaEnabled}set showPrintAreaEnabled(e){this.viewModel.showPrintAreaEnabled=e}get printServiceUrl(){return this.viewModel.printServiceUrl}set printServiceUrl(e){this.viewModel.printServiceUrl=e}get templateCustomTextElements(){return this.viewModel.templateCustomTextElements}set templateCustomTextElements(e){this.viewModel.templateCustomTextElements=e}get templateOptions(){return this.viewModel.templateOptions}set templateOptions(e){this.viewModel.templateOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{messages:e,templateOptions:t,viewModel:i,view:a}=this,{attributionEnabled:l,author:o,copyright:n,dpi:s,format:r,height:c,layout:p,layoutItem:d,legendEnabled:m,northArrowEnabled:u,scaleBarEnabled:v,scaleEnabled:g,scale:f,width:y}=t,T="ready"!==i.state||this._awaitingServerResponse||!(p||d),w=this._renderTitleOrFileNameSection(),k=E("div",{class:R.formSectionContainer},E("calcite-label",null,e.fileFormatTitle,E("calcite-combobox",{clearDisabled:!0,label:e.formatDefaultOption,maxItems:6,placeholder:e.formatDefaultOption,selectionMode:"single-persist",topLayerDisabled:this.topLayerDisabled,onCalciteComboboxChange:({currentTarget:e})=>{this.templateOptions.format=e.selectedItems[0]?.value??"pdf"}},this._formats.map(({value:e,label:t},i)=>E("calcite-combobox-item",{heading:t,key:`file-format-${i}`,selected:e===this.templateOptions.format,value:e}))))),x=E("calcite-label",{layout:"inline"},E("calcite-switch",{checked:this.showPrintAreaEnabled,onCalciteSwitchChange:e=>{this.showPrintAreaEnabled=!!e.currentTarget.checked}}),e.printPreview),C=E("div",null,E("div",{class:R.formSectionContainer},E("calcite-label",null,e.template,E("calcite-block",{class:R.templateSelectContainer,collapsible:!1,description:this._getPageSizeLabel(this._selectedTemplate),heading:this._getTemplateLabel(this._selectedTemplate,!0),key:"template-select-block",label:e.template,loading:"loading"===this._selectedTemplate?.state,tabIndex:0,onclick:()=>this._showTemplates=!0,onkeydown:e=>{"Enter"!==e.key&&" "!==e.key||(this._showTemplates=!0)}},E("calcite-icon",{class:R.templateSelectIcon,icon:(this._selectedTemplate?.layout?j.get(this._selectedTemplate.layout):null)||"custom-print",key:"template-select-icon",scale:"l",slot:"content-start"}),"error"===this._selectedTemplate?.state?E("calcite-icon",{class:R.templateSelectError,icon:"exclamation-mark-circle",key:"template-select-error",scale:"s",slot:"actions-end"}):null,E("calcite-icon",{class:R.templateSelectArrow,icon:$()?"chevron-left":"chevron-right",key:"template-select-arrow",scale:"s",slot:"actions-end"})))),x),L=E("div",{class:R.formSectionContainer},E("calcite-label",null,e.dpi,E("calcite-input-number",{bind:this,"data-input-name":"dpi",min:1,value:`${s}`,onCalciteInputNumberInput:this._updateNumberInputValue}))),F=E("div",{class:R.formSectionContainer},E("calcite-label",null,E("div",{class:R.srLabel},e.outSpatialReference,E("calcite-link",{href:"https://developers.arcgis.com/rest/services-reference/enterprise/using-spatial-references/",target:"_blank"},"(WKID)")),E("calcite-input-number",{bind:this,"data-input-name":"outSpatialReference",integer:!0,numberButtonType:"none",value:i.outSpatialReference?.wkid?.toString()??"",onCalciteInputNumberInput:({currentTarget:e})=>{const t=h(e.value);i.outSpatialReference=Number.isNaN(t)||null==t?null:new b({wkid:t}),this._isValidSpatialReference=!i.outSpatialReference||_(i.outSpatialReference)}}),this._isValidSpatialReference?null:E("div",{class:R.invalidWkidText,key:`out-sr-${i.outSpatialReference?.wkid}`},e.invalidWkid))),M=E("div",{class:this.classes(R.scaleInfoContainer,R.formSectionContainer)},E("calcite-label",{layout:"inline"},E("calcite-checkbox",{bind:this,checked:g,"data-option-name":"scaleEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scale),E("div",{class:R.scaleInputContainer},E("calcite-input-number",{"aria-label":e.scaleLabel,"aria-valuenow":`${f}`,bind:this,class:R.scaleInput,"data-input-name":"scale",disabled:!g,value:`${f}`,onCalciteInputNumberInput:this._updateNumberInputValue}),E("calcite-button",{appearance:"outline","aria-label":e.reset,bind:this,disabled:!g,iconStart:"refresh",kind:"neutral",onclick:this._resetToCurrentScale}))),P=E("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:R.advancedOptionsContainer,key:"advanced-section-for-layout"},M,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText??!0?E("div",{class:R.formSectionContainer,key:"author-info"},E("calcite-label",null,e.author,E("calcite-input",{bind:this,"data-input-name":"author",value:o??"",onCalciteInputInput:this._updateInputValue}))):null,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??!0?E("div",{class:R.formSectionContainer,key:"copyright-text"},E("calcite-label",null,e.copyright,E("calcite-input",{bind:this,"data-input-name":"copyright",value:n??"",onCalciteInputInput:this._updateInputValue}))):null,L,F,this._renderCustomTextElementSection(),this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend??!0?E("div",{class:R.formSectionContainer,key:"legend-info"},E("calcite-label",{layout:"inline"},E("calcite-checkbox",{bind:this,checked:!!m,"data-option-name":"legendEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this._selectedTemplate?.mapSurroundInfoOptions?.northArrow.length?E("div",{class:R.formSectionContainer,key:"north-arrow"},E("calcite-label",{layout:"inline"},E("calcite-checkbox",{bind:this,checked:!!u,"data-option-name":"northArrowEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._selectedTemplate?.mapSurroundInfoOptions?.scaleBar.length?E("div",{class:R.formSectionContainer,key:"scale-bar"},E("calcite-label",{layout:"inline"},E("calcite-checkbox",{bind:this,checked:!!v,"data-option-name":"scaleBarEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scaleBar)):null),A=E("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:R.advancedOptionsContainer},M,L,F,E("div",{class:R.formSectionContainer},E("calcite-label",{layout:"inline"},E("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),D=this.exportedLinks.toArray(),B=this._renderExportedLinkItems(D),N={[R.exportSectionCentered]:!D.length},V="layoutTab"===this._selectedTab?E("section",{"aria-labelledby":`${this.id}__layoutTab`,class:R.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},E("div",{class:R.panelContainer},this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasTitleText??!0?w:null,C,"layoutTab"===this._selectedTab?k:null,E("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(R.panelContainer,R.advancedOptionsSection),collapsible:!0,disabled:!(p||d?.id),heading:e.advancedOptions,id:"advancedOptionsForLayout",key:"advanced-options-for-layout"},P))):"mapOnlyTab"===this._selectedTab?E("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:R.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},E("div",{class:R.panelContainer},w,k,E("div",null,E("div",{class:this.classes(R.sizeContainer,R.formSectionContainer)},E("calcite-label",null,e.width,E("calcite-input-number",{bind:this,"data-input-name":"width",value:`${y}`,onCalciteInputNumberInput:this._updateNumberInputValue})),E("calcite-label",null,e.height,E("calcite-input-number",{bind:this,"data-input-name":"height",value:`${c}`,onCalciteInputNumberInput:this._updateNumberInputValue})),E("button",{"aria-label":e.swap,bind:this,class:this.classes(S.widgetButton,R.swapButton,O.swap),type:"button",onclick:this._switchInput})),x),E("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(R.panelContainer,R.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly",key:"advanced-options-for-map-only"},A))):E("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(R.exportSection,N),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},E("div",{class:R.panelContainer},E("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:R.exportedFilesContainer},0===D.length?E("div",{class:R.exportedFilesEmpty},E("calcite-icon",{icon:"file",scale:"l"}),E("div",null,E(I,{class:R.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),E("div",null,e.exportHint))):B))),U="2d"!==a?.type,H=E("div",{class:R.panelError},a?U?e.sceneViewError:e.serviceError:e.noViewError),z=D.some(({state:e})=>"pending"===e),W=E("div",{class:R.content,key:"panel"},E("div",null,E("ul",{bind:this,class:R.layoutTabList,role:"tablist",onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown},E("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"layoutTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"layoutTab",id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),E("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"mapOnlyTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"mapOnlyTab",id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),E("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"exportTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"exportTab",id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},z?E("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),V),"exportTab"!==this._selectedTab?E("div",{class:this.classes(R.printButtonSection,!this.saveExportHidden&&this.portal?R.printButtonSectionDivider:null),key:"export-button-section"},!this.saveExportHidden&&this.portal?E("calcite-label",{layout:"inline"},E("calcite-checkbox",{bind:this,checked:this.saveExportEnabled,onCalciteCheckboxChange:e=>{this.saveExportEnabled=!!e.currentTarget.checked}}),e.saveExportToMyContent):null,E("calcite-button",{"aria-label":e.exportDescription,bind:this,class:this.classes(R.printButton),disabled:T||!(p||d?.id)&&!r,scale:"l",width:"full",onclick:this._handlePrintMap},e.export)):null),q=E("calcite-flow",{key:"root-flow"},E("calcite-flow-item",{bind:this,key:"root-flow-item",selected:!this._showTemplates},E("div",{class:R.printWidgetContainer},this.headerVisible?E("header",{class:R.headerTitle},e.export):null,this.error||U||!a?H:W)),this._renderChooseTemplateFlowItem()),K="initializing"===i.state,J=K?this._renderLoader():q,G={[R.panelItemsCentered]:K};return E("div",{bind:this,class:this.classes(R.base,S.widget,S.panel,G)},J)}_getPageSizeLabel(e){if(!e)return;const i=e.layoutTemplateInfo;if(!i)return;const a=V.fromJSON(i.pageUnits.toLowerCase());return`${t(i.pageSize[0])} × ${t(i.pageSize[1])} ${c(this.messagesUnits,a,"abbr")}`}_getTemplateLabel(e,t=!1){if(!e)return t?this.messages.selectTemplate:this.messages.untitled;const{label:i,layout:a,layoutItem:l}=e,o=a&&!l&&this.messages[a]?this.messages[a]:null;if(o)return o;const n=i??a??l?.id;return n?.replaceAll("_"," ")??this.messages.untitled}_getPortalTemplates(){return this.includeDefaultTemplates&&this.includeOrganizationTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:e,layoutItem:t})=>!B(e)&&!!t?.id):[]}_getDefaultTemplates(){return this.includeDefaultTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:e,layoutItem:t})=>!B(e)&&!t?.id):[]}_getPrintServiceTemplates(){return this.includeDefaultTemplates&&this._getDefaultTemplates().length?[]:this.viewModel.printServiceTemplates.toArray().filter(({layout:e})=>!B(e))}_renderLayoutTemplates(e,t=!1,i=!1){return t&&e.sort((e,t)=>(e.label??"")>(t.label??"")?1:-1),e.map(e=>E("calcite-list-item",{description:this._getPageSizeLabel(e),key:`template-${e.id}-${e.id===this.templateOptions.id}`,label:this._getTemplateLabel(e),selected:e.id===this.templateOptions.id,title:e.description??"",value:e},E("calcite-icon",{icon:(e.layout?j.get(e.layout):null)||"custom-print",slot:"content-start"}),"loading"===e.state?E("calcite-loader",{inline:!0,key:`template-loader-${e.id}`,label:"loading",scale:"s",slot:"content-end"}):null,"error"===e?.state?E("calcite-icon",{class:R.templateSelectError,icon:"exclamation-mark-circle",key:`template-error-${e.id}`,scale:"s",slot:"content-end"}):null,i?E("calcite-action",{icon:"trash",slot:"actions-end",text:"delete",onclick:()=>this.viewModel.removePortalTemplate(e)}):null))}_renderChooseTemplateFlowItem(){if(!this._showTemplates)return null;const{messages:e}=this,t=g.test(this.portal?.url),i=this.viewModel.browseTemplates.toArray(),a=this._getPortalTemplates(),l=this._getDefaultTemplates(),o=this._getPrintServiceTemplates(),n=i.length+a.length+l.length+o.length>15,s=this.browseTemplateButtonOnClick?E("calcite-button",{appearance:"outline",class:n?R.browseTemplateButtonContainerFilter:R.browseTemplateButtonContainer,iconStart:"folder",key:"browse-template-button",slot:n?"filter-actions-end":"default",onclick:this.browseTemplateButtonOnClick},n?null:e.browseTemplates):null;return E("calcite-flow-item",{bind:this,closable:!1,heading:e.chooseTemplate,key:"template-flow-item",selected:this._showTemplates,onCalciteFlowItemBack:e=>{e.preventDefault(),this._showTemplates=!1}},E("div",{class:R.templateSelectFlowItemContainer},E("div",{class:R.templateSelectFlowItemContent},n?null:s,E("calcite-list",{filterEnabled:n,filterProps:["label"],key:"template-list",label:e.templateList,selectionMode:"single-persist",onCalciteListChange:({currentTarget:e})=>this.viewModel.applyTemplate(e.selectedItems[0]?.value)},n?s:null,i.length?E("div",{key:"my-templates"},E("div",{class:R.templateSelectFlowItemListHeading},e.myTemplates,t?E("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(i,!0,!0)):null,a.length?E("div",{key:"org-templates"},E("div",{class:R.templateSelectFlowItemListHeading},e.organizationTemplates,t?E("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(a)):null,i.length||a.length?l.length?E("div",{key:"default-templates"},E("div",{class:R.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(l,!0)):null:this._renderLayoutTemplates(l,!0),i.length||a.length?o.length?E("div",{key:"service-templates"},E("div",{class:R.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(o)):null:this._renderLayoutTemplates(o))),E("div",{class:R.templateButtonContainer},E("calcite-button",{class:R.templateDoneButton,onclick:()=>this._showTemplates=!1},this.messagesCommon.done))))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?E("div",{class:R.formSectionContainer,key:"custom-text-elements"},e.map((e,t)=>{const[i,a]=Object.entries(e)[0];return"date"===i?null:E("calcite-label",{key:`custom-text-elements-${i}-${t}`},i,E("calcite-input",{bind:this,"data-input-custom":!0,"data-input-name":i,value:a??"",onCalciteInputInput:this._updateInputValue}))})):null}_renderTitleOrFileNameSection(){const{title:e,fileName:t,titlePlaceHolder:i,fileNamePlaceHolder:a}=this.messages,l="layoutTab"===this._selectedTab?e:t,o="layoutTab"===this._selectedTab?i:a,n="layoutTab"===this._selectedTab?this.templateOptions.title:this.templateOptions.fileName;return E("div",{class:R.formSectionContainer,key:l},E("calcite-label",null,l,E("calcite-input",{placeholder:o,value:n??"",onCalciteInputInput:this._onInput})))}_focusOnTabChange(e){if(!this._activeTabFocusRequested)return;const t=e.getAttribute("data-tab-id");("layoutTab"===t&&"layoutTab"===this._selectedTab||"mapOnlyTab"===t&&"mapOnlyTab"===this._selectedTab||"exportTab"===t&&"exportTab"===this._selectedTab)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[R.loader]:this._awaitingServerResponse};return E("div",{class:this.classes(e),key:"loader"})}_resetToCurrentScale(){this.templateOptions.scale=this.viewModel.view?.scale}_updateCustomTextElementValue(e,t,i){e.find(e=>{const[i]=Object.entries(e)[0];return i===t})[t]=i}_updateInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),a=!!t["data-input-custom"],{templateOptions:l}=this;a?this._updateCustomTextElementValue(l.customTextElements,i,t.value):l[i]=t.value}_updateNumberInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),{templateOptions:a}=this,l=Number(t.value);if(!D(l)){const e=a[i];return void(t.value=`${e}`)}a[i]=l}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e}=this,t="layoutTab"===this._selectedTab?e.title:e.fileName,{promise:i}=this.viewModel.export(t||this.messages.untitled);this._selectedTab="exportTab",i.then(()=>this.scheduleRender())}_switchInput(){[this.templateOptions.width,this.templateOptions.height]=[this.templateOptions.height,this.templateOptions.width]}_scrollExportIntoView(){if(!this._pendingExportScroll)return;this._pendingExportScroll=!1;const e=this._rootNode;if(!e)return;const{clientHeight:t,scrollHeight:i}=e,a=i-t;a>0&&(e.scrollTop=a)}_toggleInputValue(e){const t=e.target,i=t.getAttribute("data-option-name");this.templateOptions[i]=t.checked,"scaleEnabled"===i&&this._resetToCurrentScale()}_renderExportedLinkItemPopover(e){const t=this.messages,i=e.formattedName??"",{state:a}=e,l=this.saveAsButtonCallback&&"error"!==a&&this._isFormatAllowedForSaving(e.extension);return"pending"!==a&&l?E("calcite-popover",{autoClose:!0,key:`${i}-popover`,label:"Popover",offsetDistance:1,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:`${i}-popover-button`,scale:"s",topLayerDisabled:this.topLayerDisabled},E("calcite-list",{label:""},e.portalItem?E("calcite-list-item",{label:t.openItem,onCalciteListItemSelect:()=>{const t=e.portalItem;if(!t||!t.itemPageUrl)return;const i=document.createElement("a");i.target="_blank",i.href=t.itemPageUrl,i.rel="noreferrer",i.click()}},E("calcite-icon",{icon:"launch2",key:`${i}-launch-icon`,scale:"s",slot:"content-start"})):E("calcite-list-item",{label:t.saveAs,onCalciteListItemSelect:async()=>{this.saveAsButtonCallback&&(r(()=>e.portalItem).then(e=>{e.itemPageUrl&&this.scheduleRender()}),await this.saveAsButtonCallback(e))}},E("calcite-icon",{icon:"save",key:`${i}-save-icon`,scale:"s",slot:"content-start"})),E("calcite-list-item",{label:this.messagesCommon.delete,onCalciteListItemSelect:()=>this.exportedLinks.remove(e)},E("calcite-icon",{icon:"trash",key:`${i}-delete-icon`,scale:"s",slot:"content-start"})))):null}_renderExportedLinkItemContent(e){const t=this.messages,{url:i,state:a,error:l}=e,o=e.formattedName??"";let n=i||null;n&&(n=p(n));const s=d(n,location.href),r="error"===a?"print-task:cim-symbol-unsupported"===l?.name?t.exportWebMapCIMError:t.exportWebMapError:null;return E("div",{class:R.exportedFile,"data-item":e,slot:"content",onclick:this._handleLinkClick},E("div",null,E("div",{class:R.exportedFileLinkTitle},o),E("div",{class:R.exportedFileLinkDescription},"pending"===a?t.generatingExport:r||(s?t.ready:t.linkReady))),"ready"===a?E("calcite-icon",{"aria-label":`${o}. ${t.linkReady}`,icon:s?"download-to":"launch",key:`${o}-end-icon`,scale:"s",slot:"content-end"}):null)}_renderExportedLinkItemIcon(e){const t=e.formattedName??"";return"pending"===e.state?E("calcite-loader",{class:R.exportedFileLoader,inline:!0,key:`${t}-loader`,label:this.messages.generatingExport,scale:"m",slot:"content-start"}):E("calcite-icon",{icon:N(e),key:`${t}-start-icon`,scale:"s",slot:"content-start"})}_renderExportedLinkItemAction(e){const{state:t}=e,i=e.formattedName??"",a=this.saveAsButtonCallback&&"error"!==t&&this._isFormatAllowedForSaving(e.extension);return"pending"!==t?E("calcite-action",{icon:a?"ellipsis":"x",id:a?`${i}-popover-button`:void 0,key:a?`${i}-saveAs-action`:`${i}-action`,slot:"actions-end",text:a?this.messagesCommon.options:this.messagesCommon.remove,onclick:a?void 0:()=>{this.exportedLinks.remove(e)}}):null}_renderExportedLinkItem(e){const t=e.formattedName??"";return E(F,null,E("calcite-list-item",{key:t,label:t},this._renderExportedLinkItemContent(e),this._renderExportedLinkItemIcon(e),this._renderExportedLinkItemAction(e)),this._renderExportedLinkItemPopover(e))}_renderExportedLinkItems(e){return E("calcite-list",{filterEnabled:e?.length>10,label:this.messages.exportedLinksList,selectionMode:"none"},e.map(this._renderExportedLinkItem.bind(this)))}_isFormatAllowedForSaving(e){return!this.allowedFormatsForSaving||"all"===this.allowedFormatsForSaving||!(!e||!this.allowedFormatsForSaving.includes(e))}_toggleLayoutPanel(e){const t=e.target;this._toggleTab(t.getAttribute("data-tab-id"))}_toggleTab(e,t=!0){if(this._selectedTab=e,"mapOnlyTab"===this._selectedTab)this.viewModel.applyTemplate(P);else if("layoutTab"===this._selectedTab){const e=this._selectedTemplate??this.viewModel.defaultTemplate;this.viewModel.applyTemplate(e)}t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,i=e.target.getAttribute("data-tab-id");if(M(t))return this._toggleTab(i),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(i){case"layoutTab":this._toggleTab("ArrowLeft"===t?"exportTab":"mapOnlyTab");break;case"mapOnlyTab":this._toggleTab("ArrowLeft"===t?"layoutTab":"exportTab");break;case"exportTab":this._toggleTab("ArrowLeft"===t?"mapOnlyTab":"layoutTab")}e.preventDefault(),e.stopPropagation()}}};e([m()],U.prototype,"_showTemplates",void 0),e([m()],U.prototype,"_isValidSpatialReference",void 0),e([m()],U.prototype,"allowedFormats",null),e([m()],U.prototype,"allowedFormatsForSaving",void 0),e([m()],U.prototype,"allowedLayouts",null),e([m()],U.prototype,"browseTemplateButtonOnClick",void 0),e([m()],U.prototype,"error",null),e([m({type:i.ofType(w)})],U.prototype,"exportedLinks",null),e([m()],U.prototype,"extraParameters",null),e([m()],U.prototype,"headerVisible",void 0),e([m()],U.prototype,"headingLevel",void 0),e([m()],U.prototype,"icon",null),e([m()],U.prototype,"includeDefaultTemplates",null),e([m()],U.prototype,"includeOrganizationTemplates",void 0),e([m()],U.prototype,"label",null),e([m(),L("esri/widgets/Print/t9n/Print")],U.prototype,"messages",void 0),e([m(),L("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([m(),L("esri/core/t9n/Units")],U.prototype,"messagesUnits",void 0),e([m({type:b})],U.prototype,"outSpatialReference",null),e([m({type:v})],U.prototype,"portal",null),e([m()],U.prototype,"saveExportEnabled",null),e([m()],U.prototype,"saveExportHidden",void 0),e([m()],U.prototype,"showPrintAreaEnabled",null),e([m()],U.prototype,"printServiceUrl",null),e([m()],U.prototype,"saveAsButtonCallback",void 0),e([m()],U.prototype,"templateCustomTextElements",null),e([m({type:x})],U.prototype,"templateOptions",null),e([m()],U.prototype,"view",null),e([m({type:k})],U.prototype,"viewModel",void 0),U=e([u("esri.widgets.Print")],U);const H=U;export{H 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{getAssetUrl as t}from"../../assets.js";import r from"../../Graphic.js";import s from"../../PopupTemplate.js";import{isSome as o}from"../../core/arrayUtils.js";import i from"../../core/Error.js";import{EventedAccessor as l}from"../../core/Evented.js";import a from"../../core/Logger.js";import{mappedFind as n}from"../../core/maybe.js";import{eachAlways as u,after as c}from"../../core/promiseUtils.js";import{watch as h,initial as p,whenOnce as g}from"../../core/reactiveUtils.js";import{property as d,subclass as m}from"../../core/accessorSupport/decorators.js";import y from"../../geometry/Point.js";import f from"../../geometry/SpatialReference.js";import{getPointWithElevation as S}from"../../geometry/support/geometryUtils.js";import _ from"../../portal/Portal.js";import{isApiKeyApplicable as v}from"../../support/apiKeyUtils.js";import w from"../../symbols/PictureMarkerSymbol.js";import b from"../../symbols/SimpleFillSymbol.js";import x from"../../symbols/SimpleLineSymbol.js";import L from"../../symbols/TextSymbol.js";import{highlightsSupported as I}from"../../views/support/layerViewUtils.js";import T from"./LayerSearchSource.js";import R from"./LocatorSearchSource.js";import{SourceCollection as E}from"./types.js";import{isArcGISWorldGeocoder as F,meteredArcGISLocatorUrl as P,isProxiedArcGISWorldGeocoder as j,isMeteredArcGISWorldGeocoder as O}from"./support/locatorUtils.js";import{supported as C,getCurrentPosition as G,positionToPoint as A}from"../support/geolocationUtils.js";import{GoTo as N}from"../support/GoTo.js";function D(e,t){return e.hasOwnProperty(t)&&null!=e[t]&&""!==e[t]}const M="highlight",V=f.WGS84,J="esri/images/search/search-symbol-32.png",U=/<[\s\S]*?>/g,H=-1;let k=class extends(N(l)){constructor(e){super(e),this._defaultPopupTemplate=new s({content:"{Match_addr}"}),this._gotoController=null,this._searching=null,this._updatingPromise=null,this._createdFeatureLayers=[],this.autoNavigate=!0,this.autoSelect=!0,this.defaultSources=new E,this.defaultSymbols={point:new w({url:t(J),size:24,width:24,height:24}),polyline:new x({color:[130,130,130,1],width:2}),polygon:new b({color:[235,235,235,.4],outline:{color:[130,130,130,1],width:2}})},this.includeDefaultSources=!0,this.maxInputLength=128,this.maxResults=6,this.maxSuggestions=6,this.messages=null,this.minSuggestCharacters=3,this.popupEnabled=!0,this.popupTemplate=null,this.portal=_.getDefault(),this.resultCount=null,this.resultGraphicEnabled=!0,this.resultGraphic=null,this.resultLocation=null,this.results=null,this.selectedSuggestion=null,this.searchAllEnabled=!0,this.selectedResult=null,this.sources=new E,this.suggestionDelay=350,this.suggestionCount=null,this.suggestions=null,this.suggestionsEnabled=!0,this.view=null}initialize(){this.addHandles([h(()=>[this.includeDefaultSources,this.view,this.portal],()=>this._update(),p),h(()=>this.messages,()=>{this._defaultPopupTemplate.title=this.messages?.searchResult??"",this._update()},p)])}destroy(){this._destroyFeatureLayers(),this._abortGoTo(),this.clearGraphics()}static{this.ALL_INDEX=H}get activeSource(){return this.allSources.at(this.activeSourceIndex)??null}get activeSourceIndex(){return 1===this.allSources.length||!this.searchAllEnabled?0:H}set activeSourceIndex(e){this._overrideIfSome("activeSourceIndex",e)}get allPlaceholder(){return this.messages?.allPlaceholder}set allPlaceholder(e){this._overrideIfSome("allPlaceholder",e)}get allSources(){const{sources:e,defaultSources:t,includeDefaultSources:r}=this,s="function"==typeof r?r.call(null,{sources:e,defaultSources:t}):r?t.concat(e):e,o=this._get("allSources")||new E;return o.removeAll(),o.addMany(s.filter(Boolean)),o}get defaultPopupTemplate(){return this._defaultPopupTemplate}set defaultPopupTemplate(e){this._overrideIfSome("defaultPopupTemplate",e)}get locationEnabled(){return this._get("locationEnabled")||C()}set locationEnabled(e){if(void 0===e)return void this._clearOverride("locationEnabled");const t=C();if(e&&!t){const e=new i("locationEnabled:geolocation-unsupported","Geolocation API is unsupported.",{geolocation:navigator.geolocation});a.getLogger(this).error(e)}this._override("locationEnabled",!!e&&t)}get placeholder(){const{allSources:e,activeSourceIndex:t,allPlaceholder:r}=this;if(t===H)return r??"";const s=e.at(t);return s?.placeholder??""}set searchTerm(e){this._set("searchTerm",e||""),this.clearGraphics(),this.selectedSuggestion&&this.selectedSuggestion.text!==e&&this._set("selectedSuggestion",null),""===e&&this._clear()}get searchTerm(){return this._get("searchTerm")||""}get state(){return this._searching?"searching":this.updating?"loading":0===this.allSources.length?"disabled":"ready"}get updating(){return null!=this._updatingPromise}clear(){this.searchTerm=""}clearGraphics(){this._removeHighlight();const{view:e,resultGraphic:t}=this;e&&t&&e.graphics.remove(t),this._set("resultLocation",null),this._set("resultGraphic",null)}search(e,t){this.emit("search-start"),this.clearGraphics();const r=(async()=>{try{const r=await this._createSuggestionForSearch(e);await this.when();const s=await this._getResultsFromSources(r,t);if(t?.signal?.aborted)return null;const o={activeSourceIndex:this.activeSourceIndex,searchTerm:r.text??"",numResults:0,numErrors:0,errors:[],results:[]};this._formatResponse(o,s,r);const i=this._getFirstResult(o.results),l=r.location&&i?i.name:r.text,a=l?.replaceAll(U,"");return this._set("searchTerm",a),(r.key&&"number"==typeof r.sourceIndex||r.location)&&this._set("selectedSuggestion",r),this._set("results",o.results),this._set("resultCount",o.results.reduce((e,t)=>e+(t.results?.length??0),0)),this.emit("search-complete",o),await this._selectFirstResult(i),o}finally{this._clearSearching()}})();return this._searching=r,r}async searchNearby(e){if(!this.locationEnabled){const e=new i("searchNearby:geolocation-unsupported","Geolocation API is unsupported.",{geolocation:navigator.geolocation});throw a.getLogger(this).error(e),e}const t=(async()=>{try{const t=await G(),r=await A({position:t,view:this.view},e);return await this.search(r,e)}finally{this._clearSearching()}})();return this._searching=t,t}async select(e){if(this.clearGraphics(),!e){const t=new i("select:missing-parameter","Cannot select without a searchResult.",{value:e});throw a.getLogger(this).error(t),t}const{view:t}=this,s=D(e,"sourceIndex")?e.sourceIndex:this._getSourceIndexOfResult(e),o=null!=s?this.allSources.at(s):null;if(!o){const e=new i("select:missing-source","Cannot select without a source.",{source:o});throw a.getLogger(this).error(e),e}const l=o instanceof T?this._getLayerSourcePopupTemplate(o):o.popupTemplate,n=o.resultSymbol||this._getDefaultSymbol(e),c=D(o,"resultGraphicEnabled")?!!o.resultGraphicEnabled:this.resultGraphicEnabled,h=D(o,"autoNavigate")?!!o.autoNavigate:this.autoNavigate,p=D(o,"popupEnabled")?!!o.popupEnabled:this.popupEnabled,g=p?l||this.popupTemplate||this.defaultPopupTemplate:null,{feature:d}=e;if(!d){const e=new i("select:missing-feature","Cannot select without a feature.",{feature:d});throw a.getLogger(this).error(e),e}const{attributes:m,geometry:y,layer:f,sourceLayer:_}=d,v=await(import("../../geometry/operators/labelPointOperator.js")),w=y?v.execute(y):null,b={layerViewQuery:this._getLayerView(d),elevationQuery:t&&null!=w?S(w,t):Promise.resolve(w)},x=await u(b),R=x.layerViewQuery.value,E=x.elevationQuery.value;n instanceof L&&(n.text=e.name);const F=t&&h?e.target||e.extent:null,P=null!=F?this._goToSearchResult(F):Promise.resolve();await P;const j=R?d:new r({geometry:y,symbol:n,attributes:m,layer:f,sourceLayer:_,popupTemplate:g});return R&&I(R)&&!p&&this._highlightFeature({graphic:j,layerView:R}),!R&&c&&t&&t.graphics.push(j),this._setResultFloor(e),this._set("selectedResult",e),this._set("resultGraphic",j),this._set("resultLocation",E),this.emit("select-result",{popupEnabled:p,result:e,source:o,sourceIndex:s}),e}async suggest(e,t,r){const s=e||this.searchTerm;this.emit("suggest-start",{searchTerm:s}),await this._suggestTimer(t,r);const o=await this._suggestImmediate(s,r);return this._set("suggestions",o?.results),this._set("suggestionCount",o?.results.reduce((e,t)=>e+(t.results?.length??0),0)??null),this.emit("suggest-complete",o),o}async when(){await g(()=>!this.updating)}async _update(){const{portal:e,view:t}=this;if(this.includeDefaultSources){const r=this._updatingPromise=u([e?.load(),t?.when()]);if(this.destroyed)return;if(await r,r!==this._updatingPromise)return}this.destroyed||this._updateDefaultSources(),this._updatingPromise=null}_clearSearching(){this._searching=null}_convertHelperServices(){const e=this.portal?.helperServices?.geocode;if(!e)return[];return e.map(e=>{if(!1===e.placefinding)return;const t=F(e.url)&&v(e.url)?{url:P}:null,r=R.fromJSON({...e,...t}),s=r.url;if(F(s)||j(s)||O(s)){const e=r.outFields??["Addr_type","Match_addr","StAddr","City"],t=(r.placeholder||this.messages?.placeholder)??"",s="number"==typeof r.defaultZoomScale?r.defaultZoomScale:2500;r.singleLineFieldName="SingleLine",r.outFields=e,r.placeholder=t,r.defaultZoomScale=s}return r.singleLineFieldName?r:void 0}).filter(o)}_destroyFeatureLayers(){this._createdFeatureLayers.forEach(e=>e?.destroy()),this._createdFeatureLayers=[]}_getLayerSources(e,t){const r=this.view?.map;return e.map(e=>{const s=r.findLayerById(e.id);if(!s)return;const o=this._getLayerJSON(e),i=T.fromJSON(o);return i.placeholder=t,this._getLayer(s,o).then(e=>{i.layer=e}),i}).filter(o).toArray()}_getTableSources(e,t){const r=this.view?.map;return e.map(e=>{if(!e.id)return;const s=r.findTableById(e.id);if(!s)return;const o=this._getLayerJSON(e),i=T.fromJSON(o);return i.placeholder=t,this._getLayer(s,o).then(e=>{i.layer=e}),i}).filter(o).toArray()}_convertApplicationProperties(){const e=this.view?.map,t=e?.applicationProperties?.viewing?.search;if(!t)return[];const{enabled:r,hintText:s,layers:o,tables:i}=t;if(!r)return[];return[...this._getLayerSources(o,s),...this._getTableSources(i,s)]}async _getSubLayer(e,t){if(await e.load(),!e.allSublayers)throw new Error;const r=e.allSublayers.find(e=>e.id===t.subLayer);if(!r)throw new Error;const s=await(r.createFeatureLayer?.());if(!s)throw new Error;return this._createdFeatureLayers.push(s),s}async _getBuildingSubLayer(e,t){await e.load();const r=e.allSublayers.find(e=>e.id===t.subLayer);if("building-component"!==r?.type)throw new Error;if(await r.load(),null==r.associatedLayer)throw new Error;return await r.associatedLayer.load(),r}async _getLayer(e,t){if("map-image"===e.type)try{return await this._getSubLayer(e,t)}catch(r){const t=new i("search:create-featurelayer","Could not create a FeatureLayer from the MapImageLayer",{layer:e});return a.getLogger(this).error(t),null}return"building-scene"===e.type?this._getBuildingSubLayer(e,t):(await e.load(),e.capabilities?.operations?.supportsQuery?e:null)}_getLayerJSON(e){return"function"==typeof e.toJSON?e.toJSON():e}_updateDefaultSources(){const{defaultSources:e,includeDefaultSources:t}=this;this._destroyFeatureLayers(),e.removeAll(),t&&e.addMany([...this._convertApplicationProperties(),...this._convertHelperServices()])}_abortGoTo(){this._gotoController&&this._gotoController.abort(),this._gotoController=null}_clear(){this._abortGoTo(),this._set("resultCount",null),this._set("results",null),this._set("suggestions",null),this._set("suggestionCount",null),this._set("selectedResult",null),this._set("selectedSuggestion",null),this.emit("search-clear")}_suggestTimer(e,t){const r=null!=e?e:this.suggestionDelay;return c(r,null,t?.signal)}async _createLocationForSearch(e){if(e instanceof r&&e.geometry){return(await(import("../../geometry/operators/labelPointOperator.js"))).execute(e.geometry)}return e instanceof y?e:Array.isArray(e)&&2===e.length?new y({longitude:e[0],latitude:e[1]}):null}async _createSuggestionForSearch(e){if(e&&D(e,"key")&&D(e,"text")&&D(e,"sourceIndex"))return e;const t=await this._createLocationForSearch(e),r="string"==typeof e?e:this.searchTerm,{selectedSuggestion:s,selectedResult:o}=this,i=!e&&s&&o,l=i&&s.key===o.key&&s.sourceIndex===o.sourceIndex,a=i&&s.location;return l||a?s:{location:t,text:t?"":r,sourceIndex:null,key:null}}_getFirstResult(e){return n(e,({results:e})=>e?.[0])??null}async _selectFirstResult(e){return this.autoSelect&&e?this.select(e):null}async _suggestImmediate(e,t){await this.when();const r=await this._getSuggestionsFromSources(e,t);if(t?.signal?.aborted)return null;const s={activeSourceIndex:this.activeSourceIndex,searchTerm:e??"",numResults:0,numErrors:0,errors:[],results:[]};return this._formatResponse(s,r),s}_formatSourceResponse(e,t,r){const s=t?.value||[],o=t?.error,i=this.allSources.at(r);if(o){const t={sourceIndex:r,source:i,error:o};e.errors.push(t),a.getLogger(this).error(o),e.numErrors++}else{const t={sourceIndex:r,source:i,results:s};e.results.push(t),e.numResults+=s.length}}_formatResponse(e,t,r){if(t)if(e.activeSourceIndex===H){const s=r&&D(r,"sourceIndex")&&-1!==r.sourceIndex?r.sourceIndex:void 0;t.forEach((t,r)=>{const o=void 0!==s?s:r;this._formatSourceResponse(e,t,o)})}else this._formatSourceResponse(e,t[0],e.activeSourceIndex)}async _getResultsFromSources(e,t){const{allSources:r}=this,s=!e.location&&D(e,"sourceIndex")?e.sourceIndex:this.activeSourceIndex,o=[];if(!r.length){const e=new i("search:no-sources-defined","At least one source is required.",{allSources:r});throw a.getLogger(this).error(e),e}return s===H?r.forEach((r,s)=>{o.push(this._getResultsFromSource(e,s,t))}):o.push(this._getResultsFromSource(e,s,t)),u(o)}async _getSuggestionsFromSources(e,t){const{allSources:r,activeSourceIndex:s}=this,o=[];if(!r.length){const e=new i("suggest:no-sources-defined","At least one source is required.",{allSources:r});throw a.getLogger(this).error(e),e}return s===H?r.forEach((r,s)=>{o.push(this._getSuggestionsFromSource(e,s,t))}):o.push(this._getSuggestionsFromSource(e,s,t)),u(o)}async _getResultsFromSource(e,t,r){const s=null!=t?this.allSources.at(t):null;if(!s)return null;const{location:o=null}=e,i=this.view?.spatialReference??V,l=D(s,"maxResults")?s.maxResults:this.maxResults,a=!!(s instanceof T&&D(s,"exactMatch"))&&s.exactMatch,{view:n}=this;return s.getResults?.({exactMatch:a,location:o,maxResults:l,sourceIndex:t,spatialReference:i,suggestResult:e,view:n},r)}async _getSuggestionsFromSource(e,t,r){const s=this.allSources.at(t);if(!s)return null;e??="";const o=D(s,"suggestionsEnabled")?s.suggestionsEnabled:this.suggestionsEnabled,i=e?.length,l=D(s,"minSuggestCharacters")?s.minSuggestCharacters:this.minSuggestCharacters;if(o&&e.trim()&&i>=l){const o=this.view?.spatialReference||V,i=D(s,"maxSuggestions")?s.maxSuggestions:this.maxSuggestions,{view:l}=this,a=!!(s instanceof T&&D(s,"exactMatch"))&&s.exactMatch;return s.getSuggestions?.({view:l,sourceIndex:t,suggestTerm:e,spatialReference:o,maxSuggestions:i,exactMatch:a},r)}return null}_getLayerSourcePopupTemplate(e){const{layer:t}=e;if(t)return D(e,"popupTemplate")?e.popupTemplate:t.popupTemplate}_getSourceIndexOfResult(e){return n(this.results??[],({results:t,sourceIndex:r})=>{const s=t?.includes(e);return s?r:null})??null}async _goToSearchResult(e){this._abortGoTo();const t=new AbortController;this._gotoController=t;const r={target:{target:e},options:{signal:t.signal}};e||(r.options.animate=!1),await this.callGoTo(r),this._gotoController=null}_getDefaultSymbol(e){const{defaultSymbols:t}=this,r=e.feature?.geometry;if(null==r)return null;switch(r.type){case"point":case"multipoint":return t.point;case"polyline":return t.polyline;case"extent":case"polygon":return t.polygon;default:return null}}_removeHighlight(){this.removeHandles(M)}async _getLayerView(e){const{view:t}=this;if(!e||!t)return null;const{layer:r,sourceLayer:s}=e,o=r??s;return o&&"building-component"!==o.type&&"subtype-sublayer"!==o.type?(await t.when(),t.whenLayerView(o)):null}_highlightFeature(e){const{graphic:t,layerView:r}=e,{attributes:s,layer:o,sourceLayer:i}=t,l=o??i,{objectIdField:a}=l,n=(a&&s?.[a])??null,u=r.highlight(n??t);this.addHandles(u,M)}_setResultFloor(e){const{view:t}=this,r=e.feature?.attributes,s=e.feature?.sourceLayer;if(s&&"floorInfo"in s&&s?.floorInfo?.floorField&&r){const e=r[s.floorInfo.floorField];t?.emit("select-result-floor",e)}}};e([d()],k.prototype,"_searching",void 0),e([d()],k.prototype,"_updatingPromise",void 0),e([d({readOnly:!0,value:null})],k.prototype,"activeSource",null),e([d()],k.prototype,"activeSourceIndex",null),e([d()],k.prototype,"allPlaceholder",null),e([d({readOnly:!0})],k.prototype,"allSources",null),e([d()],k.prototype,"autoNavigate",void 0),e([d()],k.prototype,"autoSelect",void 0),e([d({type:s})],k.prototype,"defaultPopupTemplate",null),e([d({readOnly:!0})],k.prototype,"defaultSources",void 0),e([d()],k.prototype,"defaultSymbols",void 0),e([d()],k.prototype,"includeDefaultSources",void 0),e([d()],k.prototype,"locationEnabled",null),e([d()],k.prototype,"maxInputLength",void 0),e([d()],k.prototype,"maxResults",void 0),e([d()],k.prototype,"maxSuggestions",void 0),e([d()],k.prototype,"messages",void 0),e([d()],k.prototype,"minSuggestCharacters",void 0),e([d({readOnly:!0})],k.prototype,"placeholder",null),e([d()],k.prototype,"popupEnabled",void 0),e([d({type:s})],k.prototype,"popupTemplate",void 0),e([d({type:_})],k.prototype,"portal",void 0),e([d()],k.prototype,"resultCount",void 0),e([d()],k.prototype,"resultGraphicEnabled",void 0),e([d({readOnly:!0})],k.prototype,"resultGraphic",void 0),e([d({readOnly:!0})],k.prototype,"resultLocation",void 0),e([d({readOnly:!0})],k.prototype,"results",void 0),e([d({readOnly:!0})],k.prototype,"selectedSuggestion",void 0),e([d()],k.prototype,"searchAllEnabled",void 0),e([d({readOnly:!0})],k.prototype,"selectedResult",void 0),e([d()],k.prototype,"searchTerm",null),e([d({type:E})],k.prototype,"sources",void 0),e([d({readOnly:!0})],k.prototype,"state",null),e([d()],k.prototype,"suggestionDelay",void 0),e([d()],k.prototype,"suggestionCount",void 0),e([d({readOnly:!0})],k.prototype,"suggestions",void 0),e([d()],k.prototype,"suggestionsEnabled",void 0),e([d({readOnly:!0})],k.prototype,"updating",null),e([d()],k.prototype,"view",void 0),e([d()],k.prototype,"clear",null),k=e([m("esri.widgets.Search.SearchViewModel")],k);const B=k;export{B as default};
2
+ import{__decorate as e}from"tslib";import{getAssetUrl as t}from"../../assets.js";import r from"../../Graphic.js";import s from"../../PopupTemplate.js";import{isSome as o}from"../../core/arrayUtils.js";import i from"../../core/Error.js";import{EventedAccessor as l}from"../../core/Evented.js";import a from"../../core/Logger.js";import{mappedFind as n}from"../../core/maybe.js";import{eachAlways as u,after as c}from"../../core/promiseUtils.js";import{watch as h,initial as p,whenOnce as g}from"../../core/reactiveUtils.js";import{property as d,subclass as m}from"../../core/accessorSupport/decorators.js";import y from"../../geometry/Point.js";import f from"../../geometry/SpatialReference.js";import{getPointWithElevation as S}from"../../geometry/support/geometryUtils.js";import _ from"../../portal/Portal.js";import{isApiKeyApplicable as v}from"../../support/apiKeyUtils.js";import w from"../../symbols/PictureMarkerSymbol.js";import b from"../../symbols/SimpleFillSymbol.js";import x from"../../symbols/SimpleLineSymbol.js";import L from"../../symbols/TextSymbol.js";import{highlightsSupported as I}from"../../views/support/layerViewUtils.js";import T from"./LayerSearchSource.js";import E from"./LocatorSearchSource.js";import{SourceCollection as R}from"./types.js";import{isArcGISWorldGeocoder as F,meteredArcGISLocatorUrl as P,isProxiedArcGISWorldGeocoder as j,isMeteredArcGISWorldGeocoder as O}from"./support/locatorUtils.js";import{supported as C,getCurrentPosition as G,positionToPoint as A}from"../support/geolocationUtils.js";import{GoTo as N}from"../support/GoTo.js";function D(e,t){return e.hasOwnProperty(t)&&null!=e[t]&&""!==e[t]}const M="highlight",V=f.WGS84,J="esri/images/search/search-symbol-32.png",U=/<[\s\S]*?>/g,H=-1;let k=class extends(N(l)){constructor(e){super(e),this._defaultPopupTemplate=new s({content:"{Match_addr}"}),this._gotoController=null,this._searching=null,this._updatingPromise=null,this._createdFeatureLayers=[],this.autoNavigate=!0,this.autoSelect=!0,this.defaultSources=new R,this.defaultSymbols={point:new w({url:t(J),size:24,width:24,height:24}),polyline:new x({color:[130,130,130,1],width:2}),polygon:new b({color:[235,235,235,.4],outline:{color:[130,130,130,1],width:2}})},this.includeDefaultSources=!0,this.maxInputLength=128,this.maxResults=6,this.maxSuggestions=6,this.messages=null,this.minSuggestCharacters=3,this.popupEnabled=!0,this.popupTemplate=null,this.portal=_.getDefault(),this.resultCount=null,this.resultGraphicEnabled=!0,this.resultGraphic=null,this.resultLocation=null,this.results=null,this.selectedSuggestion=null,this.searchAllEnabled=!0,this.selectedResult=null,this.sources=new R,this.suggestionDelay=350,this.suggestionCount=null,this.suggestions=null,this.suggestionsEnabled=!0,this.view=null}initialize(){this.addHandles([h(()=>[this.includeDefaultSources,this.view,this.portal],()=>this._update(),p),h(()=>this.messages,()=>{this._defaultPopupTemplate.title=this.messages?.searchResult??"",this._update()},p)])}destroy(){this._destroyFeatureLayers(),this._abortGoTo(),this.clearGraphics()}static{this.ALL_INDEX=H}get activeSource(){return this.allSources.at(this.activeSourceIndex)??null}get activeSourceIndex(){return 1===this.allSources.length||!this.searchAllEnabled?0:H}set activeSourceIndex(e){this._overrideIfSome("activeSourceIndex",e)}get allPlaceholder(){return this.messages?.allPlaceholder}set allPlaceholder(e){this._overrideIfSome("allPlaceholder",e)}get allSources(){const{sources:e,defaultSources:t,includeDefaultSources:r}=this,s="function"==typeof r?r.call(null,{sources:e,defaultSources:t}):r?t.concat(e):e,o=this._get("allSources")||new R;return o.removeAll(),o.addMany(s.filter(Boolean)),o}get defaultPopupTemplate(){return this._defaultPopupTemplate}set defaultPopupTemplate(e){this._overrideIfSome("defaultPopupTemplate",e)}get locationEnabled(){return this._get("locationEnabled")||C()}set locationEnabled(e){if(void 0===e)return void this._clearOverride("locationEnabled");const t=C();if(e&&!t){const e=new i("locationEnabled:geolocation-unsupported","Geolocation API is unsupported.",{geolocation:navigator.geolocation});a.getLogger(this).error(e)}this._override("locationEnabled",!!e&&t)}get placeholder(){const{allSources:e,activeSourceIndex:t,allPlaceholder:r}=this;if(t===H)return r??"";const s=e.at(t);return s?.placeholder??""}set searchTerm(e){this._set("searchTerm",e||""),this.clearGraphics(),this.selectedSuggestion&&this.selectedSuggestion.text!==e&&this._set("selectedSuggestion",null),""===e&&this._clear()}get searchTerm(){return this._get("searchTerm")||""}get state(){return this._searching?"searching":this.updating?"loading":0===this.allSources.length?"disabled":"ready"}get updating(){return null!=this._updatingPromise}clear(){this.searchTerm=""}clearGraphics(){this._removeHighlight();const{view:e,resultGraphic:t}=this;e&&t&&e.graphics.remove(t),this._set("resultLocation",null),this._set("resultGraphic",null)}search(e,t){this.emit("search-start"),this.clearGraphics();const r=(async()=>{try{const r=await this._createSuggestionForSearch(e);await this.when();const s=await this._getResultsFromSources(r,t);if(t?.signal?.aborted)return null;const o={activeSourceIndex:this.activeSourceIndex,searchTerm:r.text??"",numResults:0,numErrors:0,errors:[],results:[]};this._formatResponse(o,s,r);const i=this._getFirstResult(o.results),l=r.location&&i?i.name:r.text,a=l?.replaceAll(U,"");return this._set("searchTerm",a),(r.key&&"number"==typeof r.sourceIndex||r.location)&&this._set("selectedSuggestion",r),this._set("results",o.results),this._set("resultCount",o.results.reduce((e,t)=>e+(t.results?.length??0),0)),this.emit("search-complete",o),await this._selectFirstResult(i),o}finally{this._clearSearching()}})();return this._searching=r,r}async searchNearby(e){if(!this.locationEnabled){const e=new i("searchNearby:geolocation-unsupported","Geolocation API is unsupported.",{geolocation:navigator.geolocation});throw a.getLogger(this).error(e),e}const t=(async()=>{try{const t=await G(),r=await A({position:t,view:this.view},e);return await this.search(r,e)}finally{this._clearSearching()}})();return this._searching=t,t}async select(e){if(this.clearGraphics(),!e){const t=new i("select:missing-parameter","Cannot select without a searchResult.",{value:e});throw a.getLogger(this).error(t),t}const{view:t}=this,s=D(e,"sourceIndex")?e.sourceIndex:this._getSourceIndexOfResult(e),o=null!=s?this.allSources.at(s):null;if(!o){const e=new i("select:missing-source","Cannot select without a source.",{source:o});throw a.getLogger(this).error(e),e}const l=o instanceof T?this._getLayerSourcePopupTemplate(o):o.popupTemplate,n=o.resultSymbol||this._getDefaultSymbol(e),c=D(o,"resultGraphicEnabled")?!!o.resultGraphicEnabled:this.resultGraphicEnabled,h=D(o,"autoNavigate")?!!o.autoNavigate:this.autoNavigate,p=D(o,"popupEnabled")?!!o.popupEnabled:this.popupEnabled,g=p?l||this.popupTemplate||this.defaultPopupTemplate:null,{feature:d}=e;if(!d){const e=new i("select:missing-feature","Cannot select without a feature.",{feature:d});throw a.getLogger(this).error(e),e}const{attributes:m,geometry:y,layer:f,sourceLayer:_}=d;let v=null;if(y){const{labelPointExecute:e}=await(import("../../geometry/operators/labelPointOperator.js"));v=e(y)}const w={layerViewQuery:this._getLayerView(d),elevationQuery:t&&null!=v?S(v,t):Promise.resolve(v)},b=await u(w),x=b.layerViewQuery.value,E=b.elevationQuery.value;n instanceof L&&(n.text=e.name);const R=t&&h?e.target||e.extent:null,F=null!=R?this._goToSearchResult(R):Promise.resolve();await F;const P=x?d:new r({geometry:y,symbol:n,attributes:m,layer:f,sourceLayer:_,popupTemplate:g});return x&&I(x)&&!p&&this._highlightFeature({graphic:P,layerView:x}),!x&&c&&t&&t.graphics.push(P),this._setResultFloor(e),this._set("selectedResult",e),this._set("resultGraphic",P),this._set("resultLocation",E),this.emit("select-result",{popupEnabled:p,result:e,source:o,sourceIndex:s}),e}async suggest(e,t,r){const s=e||this.searchTerm;this.emit("suggest-start",{searchTerm:s}),await this._suggestTimer(t,r);const o=await this._suggestImmediate(s,r);return this._set("suggestions",o?.results),this._set("suggestionCount",o?.results.reduce((e,t)=>e+(t.results?.length??0),0)??null),this.emit("suggest-complete",o),o}async when(){await g(()=>!this.updating)}async _update(){const{portal:e,view:t}=this;if(this.includeDefaultSources){const r=this._updatingPromise=u([e?.load(),t?.when()]);if(this.destroyed)return;if(await r,r!==this._updatingPromise)return}this.destroyed||this._updateDefaultSources(),this._updatingPromise=null}_clearSearching(){this._searching=null}_convertHelperServices(){const e=this.portal?.helperServices?.geocode;if(!e)return[];return e.map(e=>{if(!1===e.placefinding)return;const t=F(e.url)&&v(e.url)?{url:P}:null,r=E.fromJSON({...e,...t}),s=r.url;if(F(s)||j(s)||O(s)){const e=r.outFields??["Addr_type","Match_addr","StAddr","City"],t=(r.placeholder||this.messages?.placeholder)??"",s="number"==typeof r.defaultZoomScale?r.defaultZoomScale:2500;r.singleLineFieldName="SingleLine",r.outFields=e,r.placeholder=t,r.defaultZoomScale=s}return r.singleLineFieldName?r:void 0}).filter(o)}_destroyFeatureLayers(){this._createdFeatureLayers.forEach(e=>e?.destroy()),this._createdFeatureLayers=[]}_getLayerSources(e,t){const r=this.view?.map;return e.map(e=>{const s=r.findLayerById(e.id);if(!s)return;const o=this._getLayerJSON(e),i=T.fromJSON(o);return i.placeholder=t,this._getLayer(s,o).then(e=>{i.layer=e}),i}).filter(o).toArray()}_getTableSources(e,t){const r=this.view?.map;return e.map(e=>{if(!e.id)return;const s=r.findTableById(e.id);if(!s)return;const o=this._getLayerJSON(e),i=T.fromJSON(o);return i.placeholder=t,this._getLayer(s,o).then(e=>{i.layer=e}),i}).filter(o).toArray()}_convertApplicationProperties(){const e=this.view?.map,t=e?.applicationProperties?.viewing?.search;if(!t)return[];const{enabled:r,hintText:s,layers:o,tables:i}=t;if(!r)return[];return[...this._getLayerSources(o,s),...this._getTableSources(i,s)]}async _getSubLayer(e,t){if(await e.load(),!e.allSublayers)throw new Error;const r=e.allSublayers.find(e=>e.id===t.subLayer);if(!r)throw new Error;const s=await(r.createFeatureLayer?.());if(!s)throw new Error;return this._createdFeatureLayers.push(s),s}async _getBuildingSubLayer(e,t){await e.load();const r=e.allSublayers.find(e=>e.id===t.subLayer);if("building-component"!==r?.type)throw new Error;if(await r.load(),null==r.associatedLayer)throw new Error;return await r.associatedLayer.load(),r}async _getLayer(e,t){if("map-image"===e.type)try{return await this._getSubLayer(e,t)}catch(r){const t=new i("search:create-featurelayer","Could not create a FeatureLayer from the MapImageLayer",{layer:e});return a.getLogger(this).error(t),null}return"building-scene"===e.type?this._getBuildingSubLayer(e,t):(await e.load(),e.capabilities?.operations?.supportsQuery?e:null)}_getLayerJSON(e){return"function"==typeof e.toJSON?e.toJSON():e}_updateDefaultSources(){const{defaultSources:e,includeDefaultSources:t}=this;this._destroyFeatureLayers(),e.removeAll(),t&&e.addMany([...this._convertApplicationProperties(),...this._convertHelperServices()])}_abortGoTo(){this._gotoController&&this._gotoController.abort(),this._gotoController=null}_clear(){this._abortGoTo(),this._set("resultCount",null),this._set("results",null),this._set("suggestions",null),this._set("suggestionCount",null),this._set("selectedResult",null),this._set("selectedSuggestion",null),this.emit("search-clear")}_suggestTimer(e,t){const r=null!=e?e:this.suggestionDelay;return c(r,null,t?.signal)}async _createLocationForSearch(e){if(e instanceof r&&e.geometry){const{labelPointExecute:t}=await(import("../../geometry/operators/labelPointOperator.js"));return t(e.geometry)}return e instanceof y?e:Array.isArray(e)&&2===e.length?new y({longitude:e[0],latitude:e[1]}):null}async _createSuggestionForSearch(e){if(e&&D(e,"key")&&D(e,"text")&&D(e,"sourceIndex"))return e;const t=await this._createLocationForSearch(e),r="string"==typeof e?e:this.searchTerm,{selectedSuggestion:s,selectedResult:o}=this,i=!e&&s&&o,l=i&&s.key===o.key&&s.sourceIndex===o.sourceIndex,a=i&&s.location;return l||a?s:{location:t,text:t?"":r,sourceIndex:null,key:null}}_getFirstResult(e){return n(e,({results:e})=>e?.[0])??null}async _selectFirstResult(e){return this.autoSelect&&e?this.select(e):null}async _suggestImmediate(e,t){await this.when();const r=await this._getSuggestionsFromSources(e,t);if(t?.signal?.aborted)return null;const s={activeSourceIndex:this.activeSourceIndex,searchTerm:e??"",numResults:0,numErrors:0,errors:[],results:[]};return this._formatResponse(s,r),s}_formatSourceResponse(e,t,r){const s=t?.value||[],o=t?.error,i=this.allSources.at(r);if(o){const t={sourceIndex:r,source:i,error:o};e.errors.push(t),a.getLogger(this).error(o),e.numErrors++}else{const t={sourceIndex:r,source:i,results:s};e.results.push(t),e.numResults+=s.length}}_formatResponse(e,t,r){if(t)if(e.activeSourceIndex===H){const s=r&&D(r,"sourceIndex")&&-1!==r.sourceIndex?r.sourceIndex:void 0;t.forEach((t,r)=>{const o=void 0!==s?s:r;this._formatSourceResponse(e,t,o)})}else this._formatSourceResponse(e,t[0],e.activeSourceIndex)}async _getResultsFromSources(e,t){const{allSources:r}=this,s=!e.location&&D(e,"sourceIndex")?e.sourceIndex:this.activeSourceIndex,o=[];if(!r.length){const e=new i("search:no-sources-defined","At least one source is required.",{allSources:r});throw a.getLogger(this).error(e),e}return s===H?r.forEach((r,s)=>{o.push(this._getResultsFromSource(e,s,t))}):o.push(this._getResultsFromSource(e,s,t)),u(o)}async _getSuggestionsFromSources(e,t){const{allSources:r,activeSourceIndex:s}=this,o=[];if(!r.length){const e=new i("suggest:no-sources-defined","At least one source is required.",{allSources:r});throw a.getLogger(this).error(e),e}return s===H?r.forEach((r,s)=>{o.push(this._getSuggestionsFromSource(e,s,t))}):o.push(this._getSuggestionsFromSource(e,s,t)),u(o)}async _getResultsFromSource(e,t,r){const s=null!=t?this.allSources.at(t):null;if(!s)return null;const{location:o=null}=e,i=this.view?.spatialReference??V,l=D(s,"maxResults")?s.maxResults:this.maxResults,a=!!(s instanceof T&&D(s,"exactMatch"))&&s.exactMatch,{view:n}=this;return s.getResults?.({exactMatch:a,location:o,maxResults:l,sourceIndex:t,spatialReference:i,suggestResult:e,view:n},r)}async _getSuggestionsFromSource(e,t,r){const s=this.allSources.at(t);if(!s)return null;e??="";const o=D(s,"suggestionsEnabled")?s.suggestionsEnabled:this.suggestionsEnabled,i=e?.length,l=D(s,"minSuggestCharacters")?s.minSuggestCharacters:this.minSuggestCharacters;if(o&&e.trim()&&i>=l){const o=this.view?.spatialReference||V,i=D(s,"maxSuggestions")?s.maxSuggestions:this.maxSuggestions,{view:l}=this,a=!!(s instanceof T&&D(s,"exactMatch"))&&s.exactMatch;return s.getSuggestions?.({view:l,sourceIndex:t,suggestTerm:e,spatialReference:o,maxSuggestions:i,exactMatch:a},r)}return null}_getLayerSourcePopupTemplate(e){const{layer:t}=e;if(t)return D(e,"popupTemplate")?e.popupTemplate:t.popupTemplate}_getSourceIndexOfResult(e){return n(this.results??[],({results:t,sourceIndex:r})=>{const s=t?.includes(e);return s?r:null})??null}async _goToSearchResult(e){this._abortGoTo();const t=new AbortController;this._gotoController=t;const r={target:{target:e},options:{signal:t.signal}};e||(r.options.animate=!1),await this.callGoTo(r),this._gotoController=null}_getDefaultSymbol(e){const{defaultSymbols:t}=this,r=e.feature?.geometry;if(null==r)return null;switch(r.type){case"point":case"multipoint":return t.point;case"polyline":return t.polyline;case"extent":case"polygon":return t.polygon;default:return null}}_removeHighlight(){this.removeHandles(M)}async _getLayerView(e){const{view:t}=this;if(!e||!t)return null;const{layer:r,sourceLayer:s}=e,o=r??s;return o&&"building-component"!==o.type&&"subtype-sublayer"!==o.type?(await t.when(),t.whenLayerView(o)):null}_highlightFeature(e){const{graphic:t,layerView:r}=e,{attributes:s,layer:o,sourceLayer:i}=t,l=o??i,{objectIdField:a}=l,n=(a&&s?.[a])??null,u=r.highlight(n??t);this.addHandles(u,M)}_setResultFloor(e){const{view:t}=this,r=e.feature?.attributes,s=e.feature?.sourceLayer;if(s&&"floorInfo"in s&&s?.floorInfo?.floorField&&r){const e=r[s.floorInfo.floorField];t?.emit("select-result-floor",e)}}};e([d()],k.prototype,"_searching",void 0),e([d()],k.prototype,"_updatingPromise",void 0),e([d({readOnly:!0,value:null})],k.prototype,"activeSource",null),e([d()],k.prototype,"activeSourceIndex",null),e([d()],k.prototype,"allPlaceholder",null),e([d({readOnly:!0})],k.prototype,"allSources",null),e([d()],k.prototype,"autoNavigate",void 0),e([d()],k.prototype,"autoSelect",void 0),e([d({type:s})],k.prototype,"defaultPopupTemplate",null),e([d({readOnly:!0})],k.prototype,"defaultSources",void 0),e([d()],k.prototype,"defaultSymbols",void 0),e([d()],k.prototype,"includeDefaultSources",void 0),e([d()],k.prototype,"locationEnabled",null),e([d()],k.prototype,"maxInputLength",void 0),e([d()],k.prototype,"maxResults",void 0),e([d()],k.prototype,"maxSuggestions",void 0),e([d()],k.prototype,"messages",void 0),e([d()],k.prototype,"minSuggestCharacters",void 0),e([d({readOnly:!0})],k.prototype,"placeholder",null),e([d()],k.prototype,"popupEnabled",void 0),e([d({type:s})],k.prototype,"popupTemplate",void 0),e([d({type:_})],k.prototype,"portal",void 0),e([d()],k.prototype,"resultCount",void 0),e([d()],k.prototype,"resultGraphicEnabled",void 0),e([d({readOnly:!0})],k.prototype,"resultGraphic",void 0),e([d({readOnly:!0})],k.prototype,"resultLocation",void 0),e([d({readOnly:!0})],k.prototype,"results",void 0),e([d({readOnly:!0})],k.prototype,"selectedSuggestion",void 0),e([d()],k.prototype,"searchAllEnabled",void 0),e([d({readOnly:!0})],k.prototype,"selectedResult",void 0),e([d()],k.prototype,"searchTerm",null),e([d({type:R})],k.prototype,"sources",void 0),e([d({readOnly:!0})],k.prototype,"state",null),e([d()],k.prototype,"suggestionDelay",void 0),e([d()],k.prototype,"suggestionCount",void 0),e([d({readOnly:!0})],k.prototype,"suggestions",void 0),e([d()],k.prototype,"suggestionsEnabled",void 0),e([d({readOnly:!0})],k.prototype,"updating",null),e([d()],k.prototype,"view",void 0),e([d()],k.prototype,"clear",null),k=e([m("esri.widgets.Search.SearchViewModel")],k);const B=k;export{B as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{substitute as e,formatDate as t}from"../../../intl.js";import r from"../../../core/Error.js";import{clone as i}from"../../../core/lang.js";import n from"../../../core/Logger.js";import{mappedFind as l}from"../../../core/maybe.js";import{getMetersPerUnitForSR as o}from"../../../core/units.js";import s from"../../../geometry/Polygon.js";import{getExtentFromGeometry as u,scaleExtent as a}from"../../../geometry/support/geometryUtils.js";import c from"../../../rest/support/FullTextSearch.js";const d=/https?:\/\/services.*\.arcgis\.com/i,f=/(?:\{([^}]+)\})/g,m=()=>n.getLogger("esri.widgets.Search.support.layerSearchUtils");function p(e,t){const{exactMatch:i=!1,location:n,maxResults:l,spatialReference:s,source:u,sourceIndex:a,suggestResult:c,view:d}=e,{layer:f,filter:p,zoomScale:y}=u,b=d?.scale,L=g(u,d),R=t?.signal;return x(f).then(()=>{const e=f.popupTemplate;return e?e.getRequiredFields(f.fieldsIndex):null}).then(e=>{const{objectIdField:t,returnZ:g}=f,x=S(u);if(!I(f,x))throw m().error("invalid-field: displayField is invalid."),new r("getResults():invalid-field","displayField is invalid.");const C=e?.length?e:[x],E=u.outFields||C,M=h(E);E.includes(t)||M||E.push(t),f.floorInfo?.floorField&&E.push(f.floorInfo.floorField);if(!(M||j(f,E)))throw m().error("invalid-field: outField is invalid."),new r("getResults():invalid-field","outField is invalid.");const N=f.createQuery(),{orderByFields:O}=u;if(O&&(N.orderByFields=O),s){N.outSpatialReference=s;const e=1/o(s);e&&(N.maxAllowableOffset=e)}const k="mesh"===f.geometryType||"multipatch"===f.geometryType,D=f.capabilities?.data?.supportsZ&&!k;if(N.returnZ=D&&!1!==g,N.returnGeometry=!0,N.multipatchOption=k?"xyFootprint":null,E&&(N.outFields=E),n)N.geometry=n;else if(c.key)N.objectIds=[c.key];else{const e=u.searchFields||[x];if(!j(f,e))throw m().error("invalid-field: search field is invalid."),new r("getResults():invalid-field","search field is invalid.");T(f)&&(N.num=l),L&&(N.geometry=L);const t=c.text?.trim();if(!t)return[];const n=c.text,{prefix:o="",suffix:s=""}=u,a=q(`${o}${n}${s}`);$(f)&&v(f,e)&&!i&&n&&(N.fullText=w({text:n,searchFields:e}));const d=A({searchTerm:a,layer:f,searchFields:e,filter:p,exactMatch:i,query:N,type:"search"});if(N.where=d,!F(N))return[]}return f.queryFeatures(N,{signal:R}).then(async e=>{const t=await(import("../../../geometry/operators/labelPointOperator.js"));return Z(e,d,u,a,x,b,y,t)})})}function y(e,t){const{source:i,spatialReference:n,view:l,suggestTerm:o,maxSuggestions:s,sourceIndex:u,exactMatch:a}=e,{layer:c,filter:d}=i,p=t?.signal,y=g(i,l);return x(c).then(()=>{if(!T(c))return[];const e=S(i),t=i.searchFields||[e],l=[];i.suggestionTemplate?i.suggestionTemplate.replaceAll(f,(e,t)=>(l.push(t),e)):l.push(e);const g=h(l);l.includes(c.objectIdField)||g||l.push(c.objectIdField);const x=I(c,e),b=g||j(c,l),L=j(c,t);if(!x)throw m().error("invalid-field: displayField is invalid."),new r("getSuggestions():invalid-field","displayField is invalid.");if(!b)throw m().error("invalid-field: outField is invalid."),new r("getSuggestions():invalid-field","outField is invalid.");if(!L)throw m().error("invalid-field: search field is invalid."),new r("getSuggestions():invalid-field","search field is invalid.");const R=c.createQuery(),{orderByFields:C}=i;C&&(R.orderByFields=C),R.outSpatialReference=n,R.returnGeometry=!1,R.num=s,R.outFields=l,y&&(R.geometry=y);if(!o.trim())return[];const{prefix:E="",suffix:M=""}=i,N=q(`${E}${o}${M}`);$(c)&&v(c,t)&&!a&&o&&(R.fullText=w({text:o,searchFields:t}));const O=A({searchTerm:N,layer:c,searchFields:t,filter:d,exactMatch:a,query:R,type:"suggest"});return R.where=O,F(R)?c.queryFeatures(R,{signal:p}).then(t=>B(t,i,u,e)):[]})}function g(e,t){const{filter:r,withinViewEnabled:i}=e,n=t?.extent,l=r?.geometry;return l??(i&&n?n:void 0)}function h(e){return e&&e.includes("*")}async function x(e){e&&await e.load()}function F(e){return!(!e.fullText&&!e.where)}function v(e,t){const r=e?.indexes;if(!r||!t?.length)return!1;return r.filter(e=>"FullText"===e.indexType).some(e=>{const r=e.fields?.split(",").map(e=>e.trim().toLowerCase())||[];return t.every(e=>r.includes(e.toLowerCase()))})}function w({text:e,searchFields:t}){return e.trim().split(" ").filter(e=>!!e.trim()).map(e=>new c({onFields:t,searchTerm:e,searchType:"prefix"}))}function $(e){return e?.capabilities?.query?.supportsFullTextSearch??!1}function T(e){return e?.capabilities?.query?.supportsPagination??!1}function b(e){return e?.fieldsIndex?.fields?.find(e=>"string"===e.type)?.name??""}function S(e){return e.displayField||e.layer.displayField||b(e.layer)}function j(e,t){return!(!e||!t?.length)&&t.every(t=>I(e,t))}function I(e,t){return!!e.getField(t)}function L(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return!0;return!1}function R({codedValues:e},t,r){return l(e??[],e=>{const i=e.name,n=r?i:i.toLowerCase();return(r?t:t.toLowerCase())===n?e.code.toString():null})??null}function q(e){return e.replaceAll("'","''")}function C(e,t){const r=t?.where;return r?`(${e}) AND (${r})`:e}function E({currentTerm:e,field:t,filter:r,exactMatch:i,url:n,type:l}){const o=t?.type,s=t?.name;if("string"===o||"date"===o||"global-id"===o){const t=d.test(n??""),o=t&&L(e)?"N":"";if(i&&"search"===l)return C(`${s} = ${o}'${e}'`,r);if(t){return C(`${s} LIKE ${o}${`'${e}%'`}`,r)}return C(`${`LOWER(${s})`} LIKE ${o}${`'${e.toLowerCase()}%'`}`,r)}if("oid"===o||"small-integer"===o||"integer"===o||"single"===o||"double"===o){const t=Number(e);return isNaN(t)?null:C(`${s} = ${t}`,r)}return C(`${s} = ${e}`,r)}function M(e,t){return e?` OR (${t})`:`(${t})`}function A({searchTerm:e,layer:t,searchFields:r,filter:i,exactMatch:n,query:l,type:o}){const{definitionExpression:s,url:u}=t;let a="";return!l.fullText&&e&&r&&r.forEach(r=>{const l=t.getField(r),s=t.getFieldDomain?.(r),c=("coded-value"===s?.type?R(s,e,n):null)||e||null;if(null!==c){const e=E({currentTerm:c,field:l,filter:i,exactMatch:n,url:u,type:o});e&&(a+=M(a,e))}}),s&&a?`(${s}) AND (${a})`:l.fullText&&s?s:a}function N(e,t){let r=null;const{codedValues:i}=e;return i&&i.length&&i.some(e=>e.code===t&&(r=e.name,!0)),r}function O(e,t){return e[t]??e[Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase())]}function k(r,i,n){const l=r.sourceLayer,{attributes:o}=r,s=l.getFieldDomain?.(n,{feature:r});if(i)return e(i,o);if(n&&o){const e=l.getField(n),r=O(o,n);return null==r?"":"coded-value"===s?.type?N(s,r)??"":"date"===e?.type?t(new Date(r)):"number"==typeof r?r.toString():"string"!=typeof r?"":r.trim()}return""}function D(e,t,r,i){const n=e.sourceLayer,{attributes:l}=e,{objectIdField:o}=n,s=o?l[o]:null;return{text:k(e,t.suggestionTemplate,i),key:s,sourceIndex:r}}function B(e,t,r,i){return e.features.map(e=>D(e,t,r,i))}function P(e){return null!=e&&null!=e.minScale&&null!=e.maxScale}function V(e,t,r,n,l,o,c,d){const f=e.clone();f.layer=e.layer;const m=e.sourceLayer,p=m?.objectIdField,y=p?e.attributes[p]:null,g=k(e,r.searchTemplate,l);null!=o&&P(m)&&(m.minScale&&m.minScale<o?o=m.minScale:m.maxScale&&m.maxScale>o&&(o=m.maxScale));const h=u(f.geometry,t,o,d),x="number"==typeof c&&h?a(i(h),t??void 0,c):h,F=e.clone();return F.layer=e.layer,null!=x&&(F.geometry=s.fromExtent(x)),{extent:x,target:F,feature:f,key:y,name:g,sourceIndex:n}}function Z(e,t,r,i,n,l,o,s){return e.features.map(e=>V(e,t,r,i,n,l,o,s))}export{w as createFullTextSearchInfos,p as getResults,y as getSuggestions};
2
+ import{substitute as e,formatDate as t}from"../../../intl.js";import r from"../../../core/Error.js";import{clone as i}from"../../../core/lang.js";import n from"../../../core/Logger.js";import{mappedFind as l}from"../../../core/maybe.js";import{getMetersPerUnitForSR as o}from"../../../core/units.js";import s from"../../../geometry/Polygon.js";import{getExtentFromGeometry as u,scaleExtent as a}from"../../../geometry/support/geometryUtils.js";import c from"../../../rest/support/FullTextSearch.js";const d=/https?:\/\/services.*\.arcgis\.com/i,f=/(?:\{([^}]+)\})/g,m=()=>n.getLogger("esri.widgets.Search.support.layerSearchUtils");function p(e,t){const{exactMatch:i=!1,location:n,maxResults:l,spatialReference:s,source:u,sourceIndex:a,suggestResult:c,view:d}=e,{layer:f,filter:p,zoomScale:y}=u,b=d?.scale,L=g(u,d),R=t?.signal;return x(f).then(()=>{const e=f.popupTemplate;return e?e.getRequiredFields(f.fieldsIndex):null}).then(e=>{const{objectIdField:t,returnZ:g}=f,x=S(u);if(!I(f,x))throw m().error("invalid-field: displayField is invalid."),new r("getResults():invalid-field","displayField is invalid.");const q=e?.length?e:[x],C=u.outFields||q,M=h(C);C.includes(t)||M||C.push(t),f.floorInfo?.floorField&&C.push(f.floorInfo.floorField);if(!(M||j(f,C)))throw m().error("invalid-field: outField is invalid."),new r("getResults():invalid-field","outField is invalid.");const N=f.createQuery(),{orderByFields:O}=u;if(O&&(N.orderByFields=O),s){N.outSpatialReference=s;const e=1/o(s);e&&(N.maxAllowableOffset=e)}const k="mesh"===f.geometryType||"multipatch"===f.geometryType,D=f.capabilities?.data?.supportsZ&&!k;if(N.returnZ=D&&!1!==g,N.returnGeometry=!0,N.multipatchOption=k?"xyFootprint":null,C&&(N.outFields=C),n)N.geometry=n;else if(c.key)N.objectIds=[c.key];else{const e=u.searchFields||[x];if(!j(f,e))throw m().error("invalid-field: search field is invalid."),new r("getResults():invalid-field","search field is invalid.");T(f)&&(N.num=l),L&&(N.geometry=L);const t=c.text?.trim();if(!t)return[];const n=c.text,{prefix:o="",suffix:s=""}=u,a=E(`${o}${n}${s}`);$(f)&&v(f,e)&&!i&&n&&(N.fullText=w({text:n,searchFields:e}));const d=A({searchTerm:a,layer:f,searchFields:e,filter:p,exactMatch:i,query:N,type:"search"});if(N.where=d,!F(N))return[]}return f.queryFeatures(N,{signal:R}).then(async e=>{const{labelPointExecute:t}=await(import("../../../geometry/operators/labelPointOperator.js"));return Z(e,d,u,a,x,b,y,t)})})}function y(e,t){const{source:i,spatialReference:n,view:l,suggestTerm:o,maxSuggestions:s,sourceIndex:u,exactMatch:a}=e,{layer:c,filter:d}=i,p=t?.signal,y=g(i,l);return x(c).then(()=>{if(!T(c))return[];const e=S(i),t=i.searchFields||[e],l=[];i.suggestionTemplate?i.suggestionTemplate.replaceAll(f,(e,t)=>(l.push(t),e)):l.push(e);const g=h(l);l.includes(c.objectIdField)||g||l.push(c.objectIdField);const x=I(c,e),b=g||j(c,l),L=j(c,t);if(!x)throw m().error("invalid-field: displayField is invalid."),new r("getSuggestions():invalid-field","displayField is invalid.");if(!b)throw m().error("invalid-field: outField is invalid."),new r("getSuggestions():invalid-field","outField is invalid.");if(!L)throw m().error("invalid-field: search field is invalid."),new r("getSuggestions():invalid-field","search field is invalid.");const R=c.createQuery(),{orderByFields:q}=i;q&&(R.orderByFields=q),R.outSpatialReference=n,R.returnGeometry=!1,R.num=s,R.outFields=l,y&&(R.geometry=y);if(!o.trim())return[];const{prefix:C="",suffix:M=""}=i,N=E(`${C}${o}${M}`);$(c)&&v(c,t)&&!a&&o&&(R.fullText=w({text:o,searchFields:t}));const O=A({searchTerm:N,layer:c,searchFields:t,filter:d,exactMatch:a,query:R,type:"suggest"});return R.where=O,F(R)?c.queryFeatures(R,{signal:p}).then(t=>B(t,i,u,e)):[]})}function g(e,t){const{filter:r,withinViewEnabled:i}=e,n=t?.extent,l=r?.geometry;return l??(i&&n?n:void 0)}function h(e){return e&&e.includes("*")}async function x(e){e&&await e.load()}function F(e){return!(!e.fullText&&!e.where)}function v(e,t){const r=e?.indexes;if(!r||!t?.length)return!1;return r.filter(e=>"FullText"===e.indexType).some(e=>{const r=e.fields?.split(",").map(e=>e.trim().toLowerCase())||[];return t.every(e=>r.includes(e.toLowerCase()))})}function w({text:e,searchFields:t}){return e.trim().split(" ").filter(e=>!!e.trim()).map(e=>new c({onFields:t,searchTerm:e,searchType:"prefix"}))}function $(e){return e?.capabilities?.query?.supportsFullTextSearch??!1}function T(e){return e?.capabilities?.query?.supportsPagination??!1}function b(e){return e?.fieldsIndex?.fields?.find(e=>"string"===e.type)?.name??""}function S(e){return e.displayField||e.layer.displayField||b(e.layer)}function j(e,t){return!(!e||!t?.length)&&t.every(t=>I(e,t))}function I(e,t){return!!e.getField(t)}function L(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return!0;return!1}function R({codedValues:e},t,r){return l(e??[],e=>{const i=e.name,n=r?i:i.toLowerCase();return(r?t:t.toLowerCase())===n?e.code.toString():null})??null}function E(e){return e.replaceAll("'","''")}function q(e,t){const r=t?.where;return r?`(${e}) AND (${r})`:e}function C({currentTerm:e,field:t,filter:r,exactMatch:i,url:n,type:l}){const o=t?.type,s=t?.name;if("string"===o||"date"===o||"global-id"===o){const t=d.test(n??""),o=t&&L(e)?"N":"";if(i&&"search"===l)return q(`${s} = ${o}'${e}'`,r);if(t){return q(`${s} LIKE ${o}${`'${e}%'`}`,r)}return q(`${`LOWER(${s})`} LIKE ${o}${`'${e.toLowerCase()}%'`}`,r)}if("oid"===o||"small-integer"===o||"integer"===o||"single"===o||"double"===o){const t=Number(e);return isNaN(t)?null:q(`${s} = ${t}`,r)}return q(`${s} = ${e}`,r)}function M(e,t){return e?` OR (${t})`:`(${t})`}function A({searchTerm:e,layer:t,searchFields:r,filter:i,exactMatch:n,query:l,type:o}){const{definitionExpression:s,url:u}=t;let a="";return!l.fullText&&e&&r&&r.forEach(r=>{const l=t.getField(r),s=t.getFieldDomain?.(r),c=("coded-value"===s?.type?R(s,e,n):null)||e||null;if(null!==c){const e=C({currentTerm:c,field:l,filter:i,exactMatch:n,url:u,type:o});e&&(a+=M(a,e))}}),s&&a?`(${s}) AND (${a})`:l.fullText&&s?s:a}function N(e,t){let r=null;const{codedValues:i}=e;return i&&i.length&&i.some(e=>e.code===t&&(r=e.name,!0)),r}function O(e,t){return e[t]??e[Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase())]}function k(r,i,n){const l=r.sourceLayer,{attributes:o}=r,s=l.getFieldDomain?.(n,{feature:r});if(i)return e(i,o);if(n&&o){const e=l.getField(n),r=O(o,n);return null==r?"":"coded-value"===s?.type?N(s,r)??"":"date"===e?.type?t(new Date(r)):"number"==typeof r?r.toString():"string"!=typeof r?"":r.trim()}return""}function D(e,t,r,i){const n=e.sourceLayer,{attributes:l}=e,{objectIdField:o}=n,s=o?l[o]:null;return{text:k(e,t.suggestionTemplate,i),key:s,sourceIndex:r}}function B(e,t,r,i){return e.features.map(e=>D(e,t,r,i))}function P(e){return null!=e&&null!=e.minScale&&null!=e.maxScale}function V(e,t,r,n,l,o,c,d){const f=e.clone();f.layer=e.layer;const m=e.sourceLayer,p=m?.objectIdField,y=p?e.attributes[p]:null,g=k(e,r.searchTemplate,l);null!=o&&P(m)&&(m.minScale&&m.minScale<o?o=m.minScale:m.maxScale&&m.maxScale>o&&(o=m.maxScale));const h=u(f.geometry,t,o,d),x="number"==typeof c&&h?a(i(h),t??void 0,c):h,F=e.clone();return F.layer=e.layer,null!=x&&(F.geometry=s.fromExtent(x)),{extent:x,target:F,feature:f,key:y,name:g,sourceIndex:n}}function Z(e,t,r,i,n,l,o,s){return e.features.map(e=>V(e,t,r,i,n,l,o,s))}export{w as createFullTextSearchInfos,p as getResults,y as getSuggestions};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../Graphic.js";import o from"../../../core/Error.js";import t from"../../../core/Logger.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import n from"../../../geometry/Polygon.js";import{getExtentFromGeometry as s,scaleExtent as i}from"../../../geometry/support/geometryUtils.js";import{addressToLocations as a}from"../../../rest/locator/addressToLocations.js";import{locationToAddress as c}from"../../../rest/locator/locationToAddress.js";import{suggestLocations as l}from"../../../rest/locator/suggestLocations.js";import u from"../../../rest/support/AddressToLocationsParameters.js";import m from"../../../rest/support/LocationToAddressParameters.js";import g from"../../../rest/support/SuggestLocationsParameters.js";const p="Single Line Input",f=3e5,d=()=>t.getLogger("esri.widgets.Search.support.locatorUtils");function y(e,o){return e.location?b(e,o):z(e,o)}function x(e,o){if(o.localSearchDisabled)return null;const t=e?.scale;return"number"==typeof t&&t<=f?e?.extent?.center:null}async function w(e,o){const{source:t,spatialReference:r,view:n,suggestTerm:s,maxSuggestions:i,sourceIndex:a}=e,c=new g,{apiKey:u,url:m}=t,p=L(t,n,await(import("../../../geometry/operators/labelPointOperator.js"))),f=o?.signal??void 0;if(!m)return null;u&&(c.apiKey=u),t.categories&&(c.categories=t.categories),r&&(c.outSpatialReference=r);const d=x(n,t);d&&(c.location=d);if(!s.trim())return null;const{prefix:y="",suffix:w=""}=t,v=`${y}${s}${w}`;return c.text=v,p&&(c.searchExtent=p),c.maxSuggestions=i,t.countryCode&&(c.countryCode=t.countryCode),l(m,c,{signal:f}).then(e=>$(e,a))}function v(e){return!!e&&/(?:geocode-api\.arcgis\.com\/arcgis\/rest\/services\/world\/geocodeserver).*/i.test(e)}function S(e){return!!e&&/(?:\/servers\/[\da-z.-]+\/rest\/services\/world\/geocodeserver).*/i.test(e)}function j(e){return!!e&&/(?:arcgis\.com\/arcgis\/rest\/services\/world\/geocodeserver).*/i.test(e)}const h="https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer";async function b(e,o){const{location:t,source:n,sourceIndex:s,spatialReference:i,view:a}=e,{apiKey:l,defaultZoomScale:u,language:g,url:p,zoomScale:f}=n,d=o?.signal??void 0;if(null==p)return[];const y=a?.scale,x=new m({language:g,location:t,apiKey:l,outSpatialReference:i});try{const e=await c(p,x,{signal:d}),o=await(import("../../../geometry/operators/labelPointOperator.js"));return await T([e],{defaultZoomScale:u,scale:y,signal:d,sourceIndex:s,view:a,zoomScale:f},o)}catch(w){if(r(w))throw w;return[]}}function L(e,o,t){const{filter:r,withinViewEnabled:n}=e,i=o?.scale,a=o?.extent,c=r?.geometry;return s(c,o,i,t)||(n&&a?a:void 0)}async function z(e,o){const{source:t,suggestResult:r,spatialReference:n,view:s,maxResults:i,sourceIndex:c}=e,l=t?.zoomScale,m=t?.defaultZoomScale,g=r.text?.trim();if(!g)return null;const f=!r.key&&t.prefix?t.prefix:"",d=!r.key&&t.suffix?t.suffix:"",y=`${f}${r.text}${d}`,w=new u,{apiKey:v,url:S}=t,j=s?.scale,h=await(import("../../../geometry/operators/labelPointOperator.js")),b=L(t,s,h),z=o?.signal??void 0;if(v&&(w.apiKey=v),!S)return null;t.categories&&(w.categories=t.categories),t.locationType&&(w.locationType=t.locationType),n&&(w.outSpatialReference=n);const I=x(s,t);I&&(w.location=I),w.maxLocations=i,b&&(w.searchExtent=b),t.countryCode&&(w.countryCode=t.countryCode);const{key:$}=r,K=`${$}`;return $&&(w.magicKey=K),w.address={},w.address[t.singleLineFieldName||p]=y,t.outFields&&(w.outFields=t.outFields),a(S,w,{signal:z}).then(e=>T(e,{key:K,scale:j,signal:z,sourceIndex:c,view:s,zoomScale:l,defaultZoomScale:m},h))}function I(e,o){return{text:e.text,key:e.magicKey,sourceIndex:o}}function $(e,o){return e.map(e=>I(e,o))}function K(e){return!!e&&"ground"in e}async function P(e,t,n){const{signal:s,view:i}=t,{location:a}=e,c="3d"===i?.type&&K(i.map)?i.map.ground:null;if(!a||!c)return R(e,t,n);try{const e=await c.queryElevation(a,{signal:s});a.z=e?.geometry.z??a.z}catch(l){if(r(l))throw l;d().warn(new o("search:elevation-query-error","Could not get elevation for point.",{error:l}))}return R(e,t,n)}function R(o,t,r){const{key:a,scale:c,sourceIndex:l,view:u,zoomScale:m,defaultZoomScale:g}=t,{attributes:p,extent:f,location:d,address:y}=o,x=new e({geometry:d,attributes:p}),w=f||d,v=s(w,u,c,r),S=v?"number"==typeof m?i(v,u??void 0,m):"number"==typeof g&&"point"===w?.type?i(v,u??void 0,g):v:null,j=d?`${d.x},${d.y}`:"",h=y||j,b=x.clone();return null!=S&&(b.geometry=n.fromExtent(S)),{extent:S,feature:x,target:b,key:a,name:h,sourceIndex:l}}function T(e,o,t){return Promise.all(e.filter(Boolean).map(e=>P(e,o,t)))}export{x as getLocation,y as getResults,w as getSuggestions,j as isArcGISWorldGeocoder,v as isMeteredArcGISWorldGeocoder,S as isProxiedArcGISWorldGeocoder,h as meteredArcGISLocatorUrl};
2
+ import e from"../../../Graphic.js";import t from"../../../core/Error.js";import o from"../../../core/Logger.js";import{isAbortError as r}from"../../../core/promiseUtils.js";import n from"../../../geometry/Polygon.js";import{getExtentFromGeometry as s,scaleExtent as i}from"../../../geometry/support/geometryUtils.js";import{addressToLocations as a}from"../../../rest/locator/addressToLocations.js";import{locationToAddress as c}from"../../../rest/locator/locationToAddress.js";import{suggestLocations as l}from"../../../rest/locator/suggestLocations.js";import u from"../../../rest/support/AddressToLocationsParameters.js";import m from"../../../rest/support/LocationToAddressParameters.js";import g from"../../../rest/support/SuggestLocationsParameters.js";const p="Single Line Input",f=3e5,d=()=>o.getLogger("esri.widgets.Search.support.locatorUtils");function y(e,t){return e.location?b(e,t):L(e,t)}function x(e,t){if(t.localSearchDisabled)return null;const o=e?.scale;return"number"==typeof o&&o<=f?e?.extent?.center:null}async function w(e,t){const{source:o,spatialReference:r,view:n,suggestTerm:s,maxSuggestions:i,sourceIndex:a}=e,c=new g,{apiKey:u,url:m}=o,{labelPointExecute:p}=await(import("../../../geometry/operators/labelPointOperator.js")),f=P(o,n,p),d=t?.signal??void 0;if(!m)return null;u&&(c.apiKey=u),o.categories&&(c.categories=o.categories),r&&(c.outSpatialReference=r);const y=x(n,o);y&&(c.location=y);if(!s.trim())return null;const{prefix:w="",suffix:v=""}=o,S=`${w}${s}${v}`;return c.text=S,f&&(c.searchExtent=f),c.maxSuggestions=i,o.countryCode&&(c.countryCode=o.countryCode),l(m,c,{signal:d}).then(e=>E(e,a))}function v(e){return!!e&&/(?:geocode-api\.arcgis\.com\/arcgis\/rest\/services\/world\/geocodeserver).*/i.test(e)}function S(e){return!!e&&/(?:\/servers\/[\da-z.-]+\/rest\/services\/world\/geocodeserver).*/i.test(e)}function j(e){return!!e&&/(?:arcgis\.com\/arcgis\/rest\/services\/world\/geocodeserver).*/i.test(e)}const h="https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer";async function b(e,t){const{location:o,source:n,sourceIndex:s,spatialReference:i,view:a}=e,{apiKey:l,defaultZoomScale:u,language:g,url:p,zoomScale:f}=n,d=t?.signal??void 0;if(null==p)return[];const y=a?.scale,x=new m({language:g,location:o,apiKey:l,outSpatialReference:i});try{const e=await c(p,x,{signal:d}),{labelPointExecute:t}=await(import("../../../geometry/operators/labelPointOperator.js"));return await R([e],{defaultZoomScale:u,scale:y,signal:d,sourceIndex:s,view:a,zoomScale:f},t)}catch(w){if(r(w))throw w;return[]}}function P(e,t,o){const{filter:r,withinViewEnabled:n}=e,i=t?.scale,a=t?.extent,c=r?.geometry;return s(c,t,i,o)||(n&&a?a:void 0)}async function L(e,t){const{source:o,suggestResult:r,spatialReference:n,view:s,maxResults:i,sourceIndex:c}=e,l=o?.zoomScale,m=o?.defaultZoomScale,g=r.text?.trim();if(!g)return null;const f=!r.key&&o.prefix?o.prefix:"",d=!r.key&&o.suffix?o.suffix:"",y=`${f}${r.text}${d}`,w=new u,{apiKey:v,url:S}=o,j=s?.scale,{labelPointExecute:h}=await(import("../../../geometry/operators/labelPointOperator.js")),b=P(o,s,h),L=t?.signal??void 0;if(v&&(w.apiKey=v),!S)return null;o.categories&&(w.categories=o.categories),o.locationType&&(w.locationType=o.locationType),n&&(w.outSpatialReference=n);const z=x(s,o);z&&(w.location=z),w.maxLocations=i,b&&(w.searchExtent=b),o.countryCode&&(w.countryCode=o.countryCode);const{key:E}=r,I=`${E}`;return E&&(w.magicKey=I),w.address={},w.address[o.singleLineFieldName||p]=y,o.outFields&&(w.outFields=o.outFields),a(S,w,{signal:L}).then(e=>R(e,{key:I,scale:j,signal:L,sourceIndex:c,view:s,zoomScale:l,defaultZoomScale:m},h))}function z(e,t){return{text:e.text,key:e.magicKey,sourceIndex:t}}function E(e,t){return e.map(e=>z(e,t))}function I(e){return!!e&&"ground"in e}async function $(e,o,n){const{signal:s,view:i}=o,{location:a}=e,c="3d"===i?.type&&I(i.map)?i.map.ground:null;if(!a||!c)return K(e,o,n);try{const e=await c.queryElevation(a,{signal:s});a.z=e?.geometry.z??a.z}catch(l){if(r(l))throw l;d().warn(new t("search:elevation-query-error","Could not get elevation for point.",{error:l}))}return K(e,o,n)}function K(t,o,r){const{key:a,scale:c,sourceIndex:l,view:u,zoomScale:m,defaultZoomScale:g}=o,{attributes:p,extent:f,location:d,address:y}=t,x=new e({geometry:d,attributes:p}),w=f||d,v=s(w,u,c,r),S=v?"number"==typeof m?i(v,u??void 0,m):"number"==typeof g&&"point"===w?.type?i(v,u??void 0,g):v:null,j=d?`${d.x},${d.y}`:"",h=y||j,b=x.clone();return null!=S&&(b.geometry=n.fromExtent(S)),{extent:S,feature:x,target:b,key:a,name:h,sourceIndex:l}}function R(e,t,o){return Promise.all(e.filter(Boolean).map(e=>$(e,t,o)))}export{x as getLocation,y as getResults,w as getSuggestions,j as isArcGISWorldGeocoder,v as isMeteredArcGISWorldGeocoder,S as isProxiedArcGISWorldGeocoder,h as meteredArcGISLocatorUrl};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../geometry/Polyline.js";import{load as r,project as t}from"../../../geometry/projectionUtils.js";import o from"../../../geometry/SpatialReference.js";import{execute as a}from"../../../geometry/operators/areaOperator.js";import{executeMany as s}from"../../../geometry/operators/bufferOperator.js";import{executeMany as n}from"../../../geometry/operators/convexHullOperator.js";import{execute as i}from"../../../geometry/operators/cutOperator.js";import{importLazily as p}from"../../../geometry/operators/importUtils.js";import{execute as c}from"../../../geometry/operators/lengthOperator.js";import{fromJSON as m}from"../../../geometry/support/jsonUtils.js";function l(e){return"polygon"===e?.type||"polyline"===e?.type}function u(e){return Array.isArray(e)?e.map(e=>m(e)):[m(e)]}const y=p(()=>import("../../../geometry/operators/geodesicBufferOperator.js")),f=p(()=>import("../../../geometry/operators/geodeticAreaOperator.js"));class g{async loadBuffer(){await y.getImportPromise()}async loadArea(){await f.getImportPromise()}async loadProjector(){await r()}async createBuffer(e,r,t,o){const a=u(e);if(0===a.length)return;const{spatialReference:n}=a[0];if(!(n.isWGS84||n.isWebMercator)){const n=s(a,r,{unit:t,union:o});return Array.isArray(e)?n:n[0]}const i=(await y.getImportPromise()).executeMany(a,r,{unit:t,union:o});return Array.isArray(e)?i:i[0]}createConvexHull(e){const r=u(e),t=n(r,{merge:!0}).filter(l);if(0!==t.length)return Array.isArray(e)?t:t[0]}async calculateArea(e,r){const{wkid:t}=e.spatialReference,s=new o({wkid:t});if(!(s.isWGS84||s.isWebMercator))return parseFloat(a(m(e),{unit:r}).toFixed(2));const n=await f.getImportPromise();return parseFloat(n.execute(m(e),{unit:r}).toFixed(2))}mergeAggregatedToGeometries(e){const r=[],{line:t,multipoint:o,polygon:a}=e;return t&&r.push(t),o&&r.push(o),a&&r.push(a),r}getPercentageAlong(e,r,o){const a=this._createPolyline(e.paths,o.wkid);if("point"===r.type){const e=r.x-.5,s=r.x+.5,n=[[[e,r.y-.5],[s,r.y+.5]]],p=this._createPolyline(n,r.spatialReference.wkid),m=t(p,o);if(!m)return[-1];const l=i(a,m);if(l.length>0){const e=c(a,h);let r;r=l[0].paths[0][0][0]===a.paths[0][0][0]?c(l[0],h):l.length>1?c(l[1],h):0;return[r/e]}}else{const e=t(r,o),s=i(a,e);if(s.length>0){const e=c(a,h);return[c(s[0],h)/e]}}return[-1]}async projectGeometry(e,o){return await r(),t(e,o,{zConversionDisabled:!0})}_createPolyline(r,t){return new e({hasZ:!1,hasM:!0,paths:r,spatialReference:new o({wkid:t})})}}const h={unit:"feet"};export{g as GeometryHandler};
2
+ import{importLazily as e}from"../../../core/importUtils.js";import r from"../../../geometry/Polyline.js";import{load as t,project as o}from"../../../geometry/projectionUtils.js";import a from"../../../geometry/SpatialReference.js";import{areaExecute as n}from"../../../geometry/operators/areaOperator.js";import{bufferExecuteMany as i}from"../../../geometry/operators/bufferOperator.js";import{convexHullExecuteMany as s}from"../../../geometry/operators/convexHullOperator.js";import{cutExecute as p}from"../../../geometry/operators/cutOperator.js";import{lengthExecute as c}from"../../../geometry/operators/lengthOperator.js";import{fromJSON as m}from"../../../geometry/support/jsonUtils.js";function l(e){return"polygon"===e?.type||"polyline"===e?.type}function u(e){return Array.isArray(e)?e.map(e=>m(e)):[m(e)]}const f=e(()=>import("../../../geometry/operators/geodesicBufferOperator.js").then(e=>e.geodesicBufferLoad().then(()=>e))),y=e(()=>import("../../../geometry/operators/geodeticAreaOperator.js").then(e=>e.geodeticAreaLoad().then(()=>e)));class g{async loadBuffer(){await f.getImportPromise()}async loadArea(){await y.getImportPromise()}async loadProjector(){await t()}async createBuffer(e,r,t,o){const a=u(e);if(0===a.length)return;const{spatialReference:n}=a[0];if(!(n.isWGS84||n.isWebMercator)){const n=i(a,r,{unit:t,union:o});return Array.isArray(e)?n:n[0]}const{geodesicBufferExecuteMany:s}=await f.getImportPromise(),p=s(a,r,{unit:t,union:o});return Array.isArray(e)?p:p[0]}createConvexHull(e){const r=u(e),t=s(r,{merge:!0}).filter(l);if(0!==t.length)return Array.isArray(e)?t:t[0]}async calculateArea(e,r){const{wkid:t}=e.spatialReference,o=new a({wkid:t});if(!(o.isWGS84||o.isWebMercator))return parseFloat(n(m(e),{unit:r}).toFixed(2));const{geodeticAreaExecute:i}=await y.getImportPromise();return parseFloat(i(m(e),{unit:r}).toFixed(2))}mergeAggregatedToGeometries(e){const r=[],{line:t,multipoint:o,polygon:a}=e;return t&&r.push(t),o&&r.push(o),a&&r.push(a),r}getPercentageAlong(e,r,t){const a=this._createPolyline(e.paths,t.wkid);if("point"===r.type){const e=r.x-.5,n=r.x+.5,i=[[[e,r.y-.5],[n,r.y+.5]]],s=this._createPolyline(i,r.spatialReference.wkid),m=o(s,t);if(!m)return[-1];const l=p(a,m);if(l.length>0){const e=c(a,h);let r;r=l[0].paths[0][0][0]===a.paths[0][0][0]?c(l[0],h):l.length>1?c(l[1],h):0;return[r/e]}}else{const e=o(r,t),n=p(a,e);if(n.length>0){const e=c(a,h);return[c(n[0],h)/e]}}return[-1]}async projectGeometry(e,r){return await t(),o(e,r,{zConversionDisabled:!0})}_createPolyline(e,t){return new r({hasZ:!1,hasM:!0,paths:e,spatialReference:new a({wkid:t})})}}const h={unit:"feet"};export{g as GeometryHandler};