@arcgis/core 5.0.0-next.11 → 5.0.0-next.13

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 (382) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/analysis/AreaMeasurementAnalysis.js +1 -1
  3. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +1 -1
  4. package/arcade/functions/geomasync.js +1 -1
  5. package/arcade/functions/geomsync.js +1 -1
  6. package/arcade/functions/knowledgegraph.js +1 -1
  7. package/arcade/geometry/nearestVertex.js +5 -0
  8. package/arcade/geometry/operators.js +1 -1
  9. package/arcade/geometry/operatorsWorker.js +1 -1
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/{af47272aaaef0ea57e71.js → 00ea3052170e831c6bc8.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{91dfd29e2dba200eab09.js → 0105d814fb51c366d1da.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{125e71b0e29d1d132777.js → 02a22dd6d208a925cc5a.js} +1 -1
  14. package/assets/esri/core/workers/chunks/02e7359162cf974b41b6.js +1 -0
  15. package/assets/esri/core/workers/chunks/{ead8d0cbcebd12dbfad7.js → 04211fba145d9f06b3ec.js} +1 -1
  16. package/assets/esri/core/workers/chunks/0441ea7c89266a68b6f0.js +1 -0
  17. package/assets/esri/core/workers/chunks/07f2a75431dd8fc502ef.js +1 -0
  18. package/assets/esri/core/workers/chunks/{d1e97cce5047f1791e22.js → 0ac13de43438f572f59c.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{629127877042ad784ad2.js → 0c8aeb6262e9ec7c87d0.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{d07f911d40bf05fc0306.js → 1008e3d64f5880e3dbf2.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{c29486c4eeb3e72effff.js → 110429583b28c28c36ee.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{61d970ed75c2c358b1e9.js → 14d601e0fe7a0538c7c1.js} +1 -1
  23. package/assets/esri/core/workers/chunks/18474c017ddacd1d3d2c.js +1 -0
  24. package/assets/esri/core/workers/chunks/{1257c37bf04d39c27b62.js → 1c3bee704bafb64bba70.js} +1 -1
  25. package/assets/esri/core/workers/chunks/1d07846bcaac47df0644.js +1 -0
  26. package/assets/esri/core/workers/chunks/{509392131ec473d6b988.js → 1dfca37f95f2b968aa54.js} +1 -1
  27. package/assets/esri/core/workers/chunks/2132ccc45da90f6208b2.js +1 -0
  28. package/assets/esri/core/workers/chunks/2166238a7ad63a2d43c7.js +1 -0
  29. package/assets/esri/core/workers/chunks/2214d3b1f11658a85d0f.js +1 -0
  30. package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +1 -0
  31. package/assets/esri/core/workers/chunks/22ca80f491e070b2a5e7.js +1 -0
  32. package/assets/esri/core/workers/chunks/{f80f5dbf96c343ac4df6.js → 24d8922ac9cd48621357.js} +1 -1
  33. package/assets/esri/core/workers/chunks/257f17b3836a623a9dbe.js +1 -0
  34. package/assets/esri/core/workers/chunks/2b27499fa9de22970b7a.js +1 -0
  35. package/assets/esri/core/workers/chunks/2e76fbd3c874300fc4a7.js +1 -0
  36. package/assets/esri/core/workers/chunks/31b5900119dd7cd9e7d3.js +1 -0
  37. package/assets/esri/core/workers/chunks/34bb4852ebef0f529c96.js +1 -0
  38. package/assets/esri/core/workers/chunks/{9698f36c143953a975d4.js → 353d447f3745942c88a8.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{52282f767bd0e99ddca0.js → 3545dce74bb6b0354cb7.js} +1 -1
  40. package/assets/esri/core/workers/chunks/36b1f47d70b57d79df7b.js +1 -0
  41. package/assets/esri/core/workers/chunks/38810e3f298e8a0b64a6.js +1 -0
  42. package/assets/esri/core/workers/chunks/{7290e7a819eb291b1df2.js → 38fa50336983265c73a4.js} +3 -3
  43. package/assets/esri/core/workers/chunks/{fe49321dca22dc60d105.js → 3b1982bf7b44ff897a35.js} +1 -1
  44. package/assets/esri/core/workers/chunks/3bacd904cd93c8013f6a.js +1 -0
  45. package/assets/esri/core/workers/chunks/{588533c3abe876f20f62.js → 3d5b157bd9060b07670b.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{06e60fc7715d08ede59d.js → 3edffdb0e282ed562ac7.js} +1 -1
  47. package/assets/esri/core/workers/chunks/3fa15d4ee5fab8fff76e.js +1 -0
  48. package/assets/esri/core/workers/chunks/487e1c592f1b6fd03a7d.js +1 -0
  49. package/assets/esri/core/workers/chunks/{ee5aa11750c51b220f1e.js → 4bcb83119481453dbb90.js} +1 -1
  50. package/assets/esri/core/workers/chunks/4ca5d58117e7a5f73e1e.js +1 -0
  51. package/assets/esri/core/workers/chunks/{826fa0dfb63df77bfd95.js → 4f0016111fd84c612f41.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{24cd7b84cd0f3de4bff2.js → 4f14fed0ec885c3c33d5.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{4baf6f6e7ddedb25f806.js → 5299ec59c86022ca37e2.js} +1 -1
  54. package/assets/esri/core/workers/chunks/53a9c34cb3f6ac06cd50.js +1 -0
  55. package/assets/esri/core/workers/chunks/5415fbcc7ed203fc5575.js +1 -0
  56. package/assets/esri/core/workers/chunks/54c49a768147720c3c56.js +1 -0
  57. package/assets/esri/core/workers/chunks/558822b700e8bd844052.js +1 -0
  58. package/assets/esri/core/workers/chunks/{da24ad57747714ac5eda.js → 55adbd7481f8dfb1067e.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{7803495f8862d9025bcd.js → 56e06c9c1120bea2c641.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{dc66490520f97eef15bf.js → 57806a01f33074b601e7.js} +24 -24
  61. package/assets/esri/core/workers/chunks/{67f03d042455cd0f7009.js → 57b410198d83bf0ab708.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{0a5d74414dd02a2fb8e1.js → 5bc4140333d0db904949.js} +1 -1
  63. package/assets/esri/core/workers/chunks/5e08b19e6d7202ea38d7.js +1 -0
  64. package/assets/esri/core/workers/chunks/{0d5212f59e9b62c16164.js → 5f6df4a3376b52ead53f.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{15c7c10ff9ac63f0e792.js → 5fb2edf942b1cd8d7336.js} +1 -1
  66. package/assets/esri/core/workers/chunks/600e2e6b51e2fb9c598c.js +1 -0
  67. package/assets/esri/core/workers/chunks/{dc51438b832551924a9e.js → 6238ca7541800eb2566b.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{731f7b552dde0fb325cd.js → 62c2bd082a0c669bc857.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{b8a3f1e60e24a13749c1.js → 631fb2e62e48f8be4051.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{c8e686efe344a33a0258.js → 6490bc392a4b4f9e24f9.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{e767f83f9e2de6650f80.js → 6581b94e796781c0ad4a.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{53654edd766d9b4ef750.js → 658cd45b5fb304fd840a.js} +1 -1
  73. package/assets/esri/core/workers/chunks/67f305b0c72e77a6331a.js +1 -0
  74. package/assets/esri/core/workers/chunks/6922351c001fdb4cb757.js +1 -0
  75. package/assets/esri/core/workers/chunks/{6e22b02a9715c10578d0.js → 69cca5d3f715876c6b32.js} +1 -1
  76. package/assets/esri/core/workers/chunks/6c13c01c47abc1939f96.js +1 -0
  77. package/assets/esri/core/workers/chunks/{c37f7756d48ff9af2656.js → 736035c0069ccb03bee6.js} +1 -1
  78. package/assets/esri/core/workers/chunks/7c14f99e6cfff2a8ef4a.js +1 -0
  79. package/assets/esri/core/workers/chunks/812f2ccc01f44e3cfd41.js +1 -0
  80. package/assets/esri/core/workers/chunks/82338cdd56aa1de28db3.js +1 -0
  81. package/assets/esri/core/workers/chunks/{51ab2acac4ecc1ca9c34.js → 86830fcb5475502dac65.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{11e96a312f1294d34c50.js → 881df4fd1dc594576457.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{d1ca7c3a32ce00ed8b81.js → 8be16b03caa947ac7631.js} +1 -1
  84. package/assets/esri/core/workers/chunks/8d9ccc9a43a315cb6b04.js +1 -0
  85. package/assets/esri/core/workers/chunks/{042cd64e1f4eb326c30f.js → 8fc82fe1fcbcedf35400.js} +1 -1
  86. package/assets/esri/core/workers/chunks/91afee11072471e4eefe.js +1 -0
  87. package/assets/esri/core/workers/chunks/{fbd8d2f61f8a15bcf3db.js → 9595aabbaf411eceea1e.js} +1 -1
  88. package/assets/esri/core/workers/chunks/{6cf391b5ed7351601a2a.js → 9978ec6c67e87dc08a1d.js} +1 -1
  89. package/assets/esri/core/workers/chunks/9cdd087c43a601ec331d.js +1 -0
  90. package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
  91. package/assets/esri/core/workers/chunks/{5e2ce34def5e053913b2.js → a10e533f336c035d8d40.js} +1 -1
  92. package/assets/esri/core/workers/chunks/{311b564e44ae637c960d.js → a3ade7e8b9ddadb5f800.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{18c5d79d5ee1136e0a57.js → a57751f3d78524c876cd.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{0030d68d9edf42b4af57.js → a6a87f92f453204e9bdb.js} +1 -1
  95. package/assets/esri/core/workers/chunks/a6ee40dfc471d6612f3c.js +1 -0
  96. package/assets/esri/core/workers/chunks/a8ea050090c351e3b6d6.js +1 -0
  97. package/assets/esri/core/workers/chunks/adf7ccf4ef629211c7ee.js +1 -0
  98. package/assets/esri/core/workers/chunks/ae6066ea6cb373dc6db3.js +1 -0
  99. package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +1 -0
  100. package/assets/esri/core/workers/chunks/b328635d191f5424c047.js +1 -0
  101. package/assets/esri/core/workers/chunks/b59f9c3f7a149214256f.js +1 -0
  102. package/assets/esri/core/workers/chunks/{664ae441617afe4b17ec.js → b87bc987983b31c13f64.js} +1 -1
  103. package/assets/esri/core/workers/chunks/bb56717c4e36f28d4c08.js +1 -0
  104. package/assets/esri/core/workers/chunks/bbdfa8ffcf084cbd9938.js +1 -0
  105. package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +1 -0
  106. package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +1 -0
  107. package/assets/esri/core/workers/chunks/{ddfd01bb9ba8577c3ffc.js → c3dcfe26c2c3c829762d.js} +1 -1
  108. package/assets/esri/core/workers/chunks/c3ddcf9148dd2640c402.js +1 -0
  109. package/assets/esri/core/workers/chunks/{6d9f2b113d6bde936a04.js → c4dfd897bcab20dee43b.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{0f30a9514571c7be9978.js → c5c02ace54fe4ab9214b.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{87921f3fa9001f5801ed.js → c68935ed44eb0702a6ba.js} +1 -1
  112. package/assets/esri/core/workers/chunks/{b6853c6a25eaabc9a7f6.js → c9579d607e59bae214da.js} +1 -1
  113. package/assets/esri/core/workers/chunks/d39a10155317e6f7a21c.js +1 -0
  114. package/assets/esri/core/workers/chunks/{773f2c6c9d38db76dfed.js → d42f7e48d694b2427c0d.js} +1 -1
  115. package/assets/esri/core/workers/chunks/d466f3f0d3824c77da7c.js +1 -0
  116. package/assets/esri/core/workers/chunks/d4a91f2256e48316a8f0.js +1 -0
  117. package/assets/esri/core/workers/chunks/d69265ceabfa92b40bb7.js +1 -0
  118. package/assets/esri/core/workers/chunks/d7755c4c8d1d3059efca.js +1 -0
  119. package/assets/esri/core/workers/chunks/{eb9c166db0db6fa60e95.js → d7b0fcce847f563ea255.js} +1 -1
  120. package/assets/esri/core/workers/chunks/d87f0116ee53ec5f98e9.js +1 -0
  121. package/assets/esri/core/workers/chunks/d888ae5ac1810a486919.js +1 -0
  122. package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +1 -0
  123. package/assets/esri/core/workers/chunks/dc4d29cfce12ac599888.js +1 -0
  124. package/assets/esri/core/workers/chunks/dda6ca9af35518652d0f.js +1 -0
  125. package/assets/esri/core/workers/chunks/{7005d956c990a04ee8b2.js → dec336700cfb83abbbeb.js} +1 -1
  126. package/assets/esri/core/workers/chunks/{b3613a38178cad2ebc82.js → dee9867b3379e024ae96.js} +1 -1
  127. package/assets/esri/core/workers/chunks/df130abb76713a85b4f9.js +1 -0
  128. package/assets/esri/core/workers/chunks/e0aa036c56ecdfe01503.js +1 -0
  129. package/assets/esri/core/workers/chunks/e2e4f6b58763fae51ae5.js +1 -0
  130. package/assets/esri/core/workers/chunks/e8a9c56fd0e7fd2558ef.js +1 -0
  131. package/assets/esri/core/workers/chunks/{1d06fcae4c2f02fb1c95.js → eb7eb3b3b8800fd73f3e.js} +1 -1
  132. package/assets/esri/core/workers/chunks/{37c1f155da14de91565a.js → edf58513f789856cd1db.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{f34e3fa0c5b28531e289.js → ef789e8487deab916fad.js} +1 -1
  134. package/assets/esri/core/workers/chunks/f28ffda9a95c6568503d.js +1 -0
  135. package/assets/esri/core/workers/chunks/f98689562017583f73ee.js +1 -0
  136. package/assets/esri/core/workers/chunks/{292daac70bb828e4923f.js → f9cd068d184cab66dc33.js} +1 -1
  137. package/assets/esri/core/workers/chunks/{dff2df259f140b7d97a9.js → fd88e07cba5964f80e9e.js} +1 -1
  138. package/assets/esri/core/workers/chunks/{c9b16fd41cd59d452522.js → fdbe16e3b23e01655c0c.js} +1 -1
  139. package/assets/esri/core/workers/chunks/{063905fbf9a0c6586949.js → ffdba51e7256ebf8ebd3.js} +1 -1
  140. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  141. package/assets/esri/themes/base/widgets/_Editor.scss +35 -2
  142. package/assets/esri/themes/dark/main.css +1 -1
  143. package/assets/esri/themes/light/main.css +1 -1
  144. package/assets/esri/themes/light/view.css +1 -1
  145. package/chunks/Envelope.js +1 -1
  146. package/chunks/Geometry.js +1 -1
  147. package/chunks/MultiPathImpl.js +1 -1
  148. package/chunks/Point2D.js +1 -1
  149. package/chunks/UnitFactory.js +1 -1
  150. package/chunks/containsOperator.js +1 -1
  151. package/chunks/densifyOperator.js +1 -1
  152. package/chunks/differenceOperator.js +1 -1
  153. package/chunks/intersectsOperator.js +1 -1
  154. package/chunks/persistableUrlUtils.js +1 -1
  155. package/config.js +1 -1
  156. package/core/XHRAdapter.js +1 -1
  157. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  158. package/core/quantityFormatUtils.js +1 -1
  159. package/core/unitFormatUtils.js +1 -1
  160. package/core/unitUtils.js +1 -1
  161. package/editing/fieldUtils.js +5 -0
  162. package/geometry/Extent.js +1 -1
  163. package/geometry/Geometry.js +1 -1
  164. package/geometry/Mesh.js +1 -1
  165. package/geometry/Point.js +1 -1
  166. package/geometry/SpatialReference.js +1 -1
  167. package/geometry/ellipsoidUtils.js +1 -1
  168. package/geometry/operators/support/jsonConverter.js +1 -1
  169. package/geometry/support/MeshTransform.js +1 -1
  170. package/geometry/support/axisAngleDegrees.js +1 -1
  171. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  172. package/geometry/support/meshUtils/rotate.js +1 -1
  173. package/geometry/support/meshUtils/scale.js +1 -1
  174. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  175. package/geometry/support/plane.js +1 -1
  176. package/geometry/support/polygonUtils.js +1 -1
  177. package/interfaces.d.ts +90 -7
  178. package/kernel.js +1 -1
  179. package/layers/Layer.js +1 -1
  180. package/layers/MapNotesLayer.js +1 -1
  181. package/layers/graphics/data/QueryEngine.js +1 -1
  182. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  183. package/layers/save/groupLayerUtils.js +1 -1
  184. package/layers/save/imageryUtils.js +1 -1
  185. package/layers/save/streamLayerUtils.js +1 -1
  186. package/layers/support/DateTimeFieldFormat.js +1 -1
  187. package/layers/support/FieldFormat.js +1 -1
  188. package/layers/support/LayerLoadContext.js +1 -1
  189. package/layers/support/NumberFieldFormat.js +1 -1
  190. package/layers/support/arcgisLayerUrl.js +1 -1
  191. package/layers/support/arcgisLayers.js +1 -1
  192. package/layers/support/fetchService.js +1 -1
  193. package/layers/support/fieldUtils.js +1 -1
  194. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  195. package/layers/video/VideoCameraSensorModel.js +1 -1
  196. package/networks/support/UNTraceConfiguration.js +1 -1
  197. package/package.json +1 -1
  198. package/popup/ExpressionInfo.js +1 -1
  199. package/popup/FieldInfo.js +1 -1
  200. package/popup/content/AttachmentsContent.js +1 -1
  201. package/popup/content/BarChartMediaInfo.js +1 -1
  202. package/popup/content/ColumnChartMediaInfo.js +1 -1
  203. package/popup/content/Content.js +1 -1
  204. package/popup/content/CustomContent.js +1 -1
  205. package/popup/content/ExpressionContent.js +1 -1
  206. package/popup/content/FieldsContent.js +1 -1
  207. package/popup/content/ImageMediaInfo.js +1 -1
  208. package/popup/content/LineChartMediaInfo.js +1 -1
  209. package/popup/content/MediaContent.js +1 -1
  210. package/popup/content/PieChartMediaInfo.js +1 -1
  211. package/popup/content/RelationshipContent.js +1 -1
  212. package/popup/content/TextContent.js +1 -1
  213. package/popup/content/UtilityNetworkAssociationsContent.js +1 -1
  214. package/popup/content/mixins/ChartMediaInfo.js +1 -1
  215. package/popup/content/mixins/MediaInfo.js +1 -1
  216. package/popup/content.js +1 -1
  217. package/popup/support/FieldInfoFormat.js +1 -1
  218. package/portal/support/layersLoader.js +1 -1
  219. package/request/cors.js +5 -0
  220. package/request/loadImage.js +5 -0
  221. package/request/preferredHosts.js +5 -0
  222. package/request/process.js +5 -0
  223. package/request/queue.js +5 -0
  224. package/request/serviceJSON.js +5 -0
  225. package/request.js +1 -1
  226. package/rest/geometryService/utils.js +1 -1
  227. package/rest/knowledgeGraphService.d.ts +1 -0
  228. package/support/getDefaultUnitForView.js +1 -1
  229. package/support/popupUtils.js +1 -1
  230. package/support/revision.js +1 -1
  231. package/symbols/support/symbolUtils.js +1 -1
  232. package/time/TimeExtent.js +1 -1
  233. package/views/2d/analysis/AreaMeasurement/AreaMeasurementAreaVisualization.js +5 -0
  234. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +5 -0
  235. package/views/2d/analysis/AreaMeasurement/AreaMeasurementLabelVisualization.js +5 -0
  236. package/views/2d/analysis/AreaMeasurement/AreaMeasurementManipulatorVisualization.js +5 -0
  237. package/views/2d/analysis/AreaMeasurement/AreaMeasurementSketchVisualization.js +5 -0
  238. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +5 -0
  239. package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +5 -0
  240. package/views/2d/analysis/analysisViewModuleImportUtils.js +1 -1
  241. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  242. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  243. package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
  244. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  245. package/views/3d/environment/CloudsRenderer.js +1 -1
  246. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  247. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  248. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  249. package/views/3d/layers/FlowSubView3D.js +1 -1
  250. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  251. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  252. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  253. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  254. package/views/3d/layers/i3s/I3SDataRequester.js +1 -1
  255. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  256. package/views/3d/support/StreamTextureCollection.js +1 -1
  257. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  258. package/views/3d/terrain/TerrainSurface.js +1 -1
  259. package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
  260. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  261. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  262. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  263. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  264. package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
  265. package/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer.js +1 -1
  266. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  267. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  268. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  269. package/views/View2D.js +1 -1
  270. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  271. package/views/analysis/ElevationProfile/constants.js +1 -1
  272. package/views/analysis/ElevationProfile/elevationProfileErrors.js +1 -1
  273. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  274. package/views/draw/DrawOperation.js +1 -1
  275. package/views/magnifier/resources.js +1 -1
  276. package/webdoc/support/webdocSaveUtils.js +1 -1
  277. package/widgets/BasemapLayerList.js +1 -1
  278. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  279. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  280. package/widgets/Editor/EditorViewModel.js +1 -1
  281. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  282. package/widgets/Editor/MergeFeaturesWorkflowData.js +1 -1
  283. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  284. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  285. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  286. package/widgets/Editor/UpdateWorkflow.js +1 -1
  287. package/widgets/Editor/Workflow.js +1 -1
  288. package/widgets/Editor/components/FeatureList.js +1 -1
  289. package/widgets/Editor/components/MergeFeaturesList.js +5 -0
  290. package/widgets/Editor/components/Notices.js +1 -1
  291. package/widgets/Editor/components/PanelContent.js +1 -1
  292. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  293. package/widgets/Editor/css.js +1 -1
  294. package/widgets/Editor/support/EditorItem.js +1 -1
  295. package/widgets/Editor/support/SketchController.js +1 -1
  296. package/widgets/Editor/support/errors.js +1 -1
  297. package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
  298. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  299. package/widgets/Editor/workflowUtils.js +1 -1
  300. package/widgets/Editor.js +1 -1
  301. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  302. package/widgets/FeatureForm/FieldInput.js +1 -1
  303. package/widgets/FeatureForm.js +1 -1
  304. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  305. package/widgets/FeatureTable/FieldColumn.js +1 -1
  306. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  307. package/widgets/LayerList.js +1 -1
  308. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  309. package/widgets/Legend/support/utils.js +1 -1
  310. package/widgets/PanoramicVideoViewer.js +1 -1
  311. package/widgets/support/FilterCondition.js +1 -1
  312. package/assets/esri/core/workers/chunks/0200637e0503556a3b97.js +0 -1
  313. package/assets/esri/core/workers/chunks/022c854eff2c2c2aed6b.js +0 -1
  314. package/assets/esri/core/workers/chunks/06f75c5b6b50934d72a6.js +0 -1
  315. package/assets/esri/core/workers/chunks/15f969836d63c7fe2d9d.js +0 -1
  316. package/assets/esri/core/workers/chunks/2857bcb68df874e9aa62.js +0 -1
  317. package/assets/esri/core/workers/chunks/2a9fc0301268ff909246.js +0 -1
  318. package/assets/esri/core/workers/chunks/2ddcf3cea0efe4052618.js +0 -1
  319. package/assets/esri/core/workers/chunks/2e8a4df83c43f86d7361.js +0 -1
  320. package/assets/esri/core/workers/chunks/2f2e4f81f3daa3fb8527.js +0 -1
  321. package/assets/esri/core/workers/chunks/3109f0a6914e7be088ed.js +0 -1
  322. package/assets/esri/core/workers/chunks/31bb1ee9370c2753ce9d.js +0 -1
  323. package/assets/esri/core/workers/chunks/329fccd7f5cb8401e0c3.js +0 -1
  324. package/assets/esri/core/workers/chunks/38f6b9288c82dac9a800.js +0 -1
  325. package/assets/esri/core/workers/chunks/3b1848713ee25f750242.js +0 -1
  326. package/assets/esri/core/workers/chunks/4291681d067ebdf86e73.js +0 -1
  327. package/assets/esri/core/workers/chunks/42a1e71d09e8583a7327.js +0 -1
  328. package/assets/esri/core/workers/chunks/44f27eac92c5ccc57e12.js +0 -1
  329. package/assets/esri/core/workers/chunks/4941bfd3aae7f6bdac97.js +0 -1
  330. package/assets/esri/core/workers/chunks/4bd2cc65f7db0d261543.js +0 -1
  331. package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +0 -1
  332. package/assets/esri/core/workers/chunks/4fbe2a8d742065cbaea3.js +0 -1
  333. package/assets/esri/core/workers/chunks/4fe4feeb251f2916a339.js +0 -1
  334. package/assets/esri/core/workers/chunks/55eb6a0f1e4569a65f2a.js +0 -1
  335. package/assets/esri/core/workers/chunks/591e459f9fce34f519ca.js +0 -1
  336. package/assets/esri/core/workers/chunks/59514624daf188a8030f.js +0 -1
  337. package/assets/esri/core/workers/chunks/5c09d98b41f71a036e2a.js +0 -1
  338. package/assets/esri/core/workers/chunks/605b9643b1baeff16149.js +0 -1
  339. package/assets/esri/core/workers/chunks/6293e33f304c4952f88c.js +0 -1
  340. package/assets/esri/core/workers/chunks/655beaf83e9845a02334.js +0 -1
  341. package/assets/esri/core/workers/chunks/6e25ef5ad6d6b3f88343.js +0 -1
  342. package/assets/esri/core/workers/chunks/759321045c264bc6964e.js +0 -1
  343. package/assets/esri/core/workers/chunks/7e3f27ebf366d4266350.js +0 -1
  344. package/assets/esri/core/workers/chunks/826072cfc0ac8e36f03c.js +0 -1
  345. package/assets/esri/core/workers/chunks/9b0c2f4311fe9bca370a.js +0 -1
  346. package/assets/esri/core/workers/chunks/9c48d8d17831aa57f8a4.js +0 -1
  347. package/assets/esri/core/workers/chunks/9f28b2800945903bc165.js +0 -1
  348. package/assets/esri/core/workers/chunks/a27e74117c37f3efcbca.js +0 -1
  349. package/assets/esri/core/workers/chunks/a41ba05c09a59d1eb35f.js +0 -1
  350. package/assets/esri/core/workers/chunks/a93ebd076bc55aa6eab0.js +0 -1
  351. package/assets/esri/core/workers/chunks/aaed35a6414859233678.js +0 -1
  352. package/assets/esri/core/workers/chunks/acd0564ad1544f452f3f.js +0 -1
  353. package/assets/esri/core/workers/chunks/b0f43191a431c9de16e5.js +0 -1
  354. package/assets/esri/core/workers/chunks/b320bb76c7e9998fe53b.js +0 -1
  355. package/assets/esri/core/workers/chunks/ba4571d2637a74a59552.js +0 -1
  356. package/assets/esri/core/workers/chunks/c4090a60d149a5962179.js +0 -1
  357. package/assets/esri/core/workers/chunks/c61c61dac1e8d6188749.js +0 -1
  358. package/assets/esri/core/workers/chunks/c84caf81bfaa4a8b5aa1.js +0 -1
  359. package/assets/esri/core/workers/chunks/c8c8cf43fd640d2f5cb1.js +0 -1
  360. package/assets/esri/core/workers/chunks/d28670cb11164e318e45.js +0 -1
  361. package/assets/esri/core/workers/chunks/d56ac52a5288e06365e7.js +0 -1
  362. package/assets/esri/core/workers/chunks/ddca92e18e96ea1c9d89.js +0 -1
  363. package/assets/esri/core/workers/chunks/ded9747ae04ab889d52a.js +0 -1
  364. package/assets/esri/core/workers/chunks/df5afa06c6deb6b40109.js +0 -1
  365. package/assets/esri/core/workers/chunks/df8279e1baf378faf85f.js +0 -1
  366. package/assets/esri/core/workers/chunks/e3434f91f47f551d9e02.js +0 -1
  367. package/assets/esri/core/workers/chunks/eb6c3dd440ede4adf603.js +0 -1
  368. package/assets/esri/core/workers/chunks/edc671b9b83c8e19cb42.js +0 -1
  369. package/assets/esri/core/workers/chunks/f141c9f7f0d9b2322bf6.js +0 -1
  370. package/assets/esri/core/workers/chunks/f57401a759f420596b2c.js +0 -1
  371. package/assets/esri/core/workers/chunks/f7a1f48c53422c6e2028.js +0 -1
  372. package/assets/esri/core/workers/chunks/f7f002ea5ff5fe7f6249.js +0 -1
  373. package/assets/esri/core/workers/chunks/f8e889be4b45f6f0667e.js +0 -1
  374. package/assets/esri/core/workers/chunks/fbd796c88f07bb6755dc.js +0 -1
  375. package/assets/esri/core/workers/chunks/fec3897ed7e8691387ed.js +0 -1
  376. package/processRequest.js +0 -5
  377. package/requestQueue.js +0 -5
  378. package/support/requestPresets.js +0 -5
  379. package/support/requestUtils.js +0 -5
  380. /package/{rest/support → request}/ImageWithType.js +0 -0
  381. /package/{requestConfig.js → request/config.js} +0 -0
  382. /package/{support/requestImageUtils.js → request/image.js} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{d as e,a as t,g as n,q as r,p as i,G as s,t as a}from"../../../chunks/Geometry.js";import{aJ as o,i as u,d as m,P as l,b as c,aK as d,m as _}from"../../../chunks/Point2D.js";import{q as h,b as f,p,aX as k,c as b,e as y,a as N,f as T,aY as g}from"../../../chunks/UnitFactory.js";import{a1 as v,a4 as x,P as A,E as S,$ as w,a0 as C,a5 as D,a6 as F,Y as j}from"../../../chunks/Envelope.js";import{a as O,P as z,S as I,M as E,N as P,a5 as B,a6 as R,a7 as V,a8 as M,a9 as U}from"../../../chunks/MultiPathImpl.js";import W from"../../SpatialReference.js";import"./initNoPeFactory.js";function X(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function Y(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class L{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter(t=>void 0!==e[t]),m_i:-1,m_bReturnKey:!0,next:X}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:Y}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=o()&&this.m_currentValue<=u()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;e("unrecognized json element type")}return e("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt64Value(){return n(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&t("invalid token"),this.m_currentValue}isError(){return 0}}class G{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){n(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class q{constructor(t){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==t.sz?(this.m_sz=t.sz,t.buffer?(this.m_sz<0&&r("size out of range"),this.m_buffer=t.buffer,this.m_offset=void 0!==t.offset?t.offset:0,this.m_view=void 0!==t.offset?new DataView(t.buffer,t.offset,t.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&r("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):t.move?(this.m_sz=t.move.m_sz,this.m_buffer=t.move.m_buffer,this.m_view=t.move.m_view,this.m_bOwnsBuffer=t.move.m_bOwnsBuffer,this.m_bLittleEndian=t.move.m_bLittleEndian,t.move.m_buffer=null,t.move.m_view=null,t.move.m_sz=0,void(t.move.m_bOwnsBuffer=!0)):void e("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===q.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===q.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||i("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){n(e>=0&&e<=this.m_sz),this.m_sz=e}}function K(e,r,i,a,o,u){let m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,N=!1,T=!1,g=!1,w=!1,C=!1,D=!1,F=!1,j=!1,O=!1,z=!1,I=!1,E=!1,P=!1,B=Number.NaN,R=Number.NaN,V=Number.NaN,M=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,Y=Number.NaN,L=Number.NaN,G=Number.NaN,q=Number.NaN,K=Number.NaN,J=Number.NaN,re=0,ie=0,se=!1,ae=!1,oe=null,ue=null,me=null,le=null,ce=null;for(;3!==i.nextToken();){const u=i.currentString();if(i.nextToken(),"spatialReference"===u){if(o&&!m){m=!0,1===i.currentToken()?le=Q(i):10!==i.currentToken()&&t("failed to parse spatial reference: object or null is expected");continue}}else if(a)if("hasZ"===u){if(!l){l=!0,se=11===i.currentToken();continue}}else if("hasM"===u){if(!c){c=!0,ae=11===i.currentToken();continue}}else if("rings"===u){if(!(_||h||e!==s.enumUnknown&&e!==s.enumPolygon)){_=!0,({geometry:ce,as:oe,bs:ue}=Z(!0,!1,r,i));continue}}else if("curveRings"===u){if(!h&&(e===s.enumUnknown||e===s.enumPolygon)){h=!0,({geometry:ce,as:oe,bs:ue}=Z(!0,!0,r,i));continue}}else if("paths"===u){if(!(f||p||e!==s.enumUnknown&&e!==s.enumPolyline)){f=!0,({geometry:ce,as:oe,bs:ue}=Z(!1,!1,r,i));continue}}else if("curvePaths"===u){if(!p&&(e===s.enumUnknown||e===s.enumPolyline)){p=!0,({geometry:ce,as:oe,bs:ue}=Z(!1,!0,r,i));continue}}else if("points"===u){if(!k&&(e===s.enumUnknown||e===s.enumMultiPoint)){k=!0,({geometry:ce,as:oe,bs:ue}=H(r,i));continue}}else if("ids"===u){if(!d){d=!0,me=$(r,i);continue}}else if("x"===u){if(!b&&(e===s.enumUnknown||e===s.enumPoint)){b=!0,B=ee(i);continue}}else if("y"===u){if(!y&&(e===s.enumUnknown||e===s.enumPoint)){y=!0,R=ee(i);continue}}else if("z"===u){if(!N&&(e===s.enumUnknown||e===s.enumPoint)){N=!0,V=ee(i);continue}}else if("m"===u){if(!T&&(e===s.enumUnknown||e===s.enumPoint)){T=!0,M=ee(i);continue}}else if("id"===u){if(!g&&(e===s.enumUnknown||e===s.enumPoint)){g=!0,U=te(i);continue}}else if("xmin"===u){if(!w&&(e===s.enumUnknown||e===s.enumEnvelope)){w=!0,W=ee(i);continue}}else if("ymin"===u){if(!C&&(e===s.enumUnknown||e===s.enumEnvelope)){C=!0,X=ee(i);continue}}else if("mmin"===u){if(!z&&(e===s.enumUnknown||e===s.enumEnvelope)){z=!0,K=ee(i);continue}}else if("zmin"===u){if(!j&&(e===s.enumUnknown||e===s.enumEnvelope)){j=!0,G=ee(i);continue}}else if("idmin"===u){if(!E&&(e===s.enumUnknown||e===s.enumEnvelope)){E=!0,re=te(i);continue}}else if("xmax"===u){if(!D&&(e===s.enumUnknown||e===s.enumEnvelope)){D=!0,Y=ee(i);continue}}else if("ymax"===u){if(!F&&(e===s.enumUnknown||e===s.enumEnvelope)){F=!0,L=ee(i);continue}}else if("mmax"===u){if(!I&&(e===s.enumUnknown||e===s.enumEnvelope)){I=!0,J=ee(i);continue}}else if("zmax"===u){if(!O&&(e===s.enumUnknown||e===s.enumEnvelope)){O=!0,q=ee(i);continue}}else if("idmax"===u){if(!P&&(e===s.enumUnknown||e===s.enumEnvelope)){P=!0,ie=te(i);continue}}else"materials"===u&&n(0);i.skipChildren()}if(_||h||f||p||k){let e=null,t=null;const n=ce;se&&(ce.addAttribute(1),e=oe,e||(e=v(n.getPointCount(),Number.NaN))),ae&&(ce.addAttribute(2),t=se?ue:oe),null!=me&&ce.addAttribute(3),se&&null!=e&&n.setAttributeStreamRef(1,e),ae&&null!=t&&n.setAttributeStreamRef(2,t),null!=me&&ne(n,me)}else if(b||y||T||N||g){x(B,R)||t("failed to parse point: x and y must be finite or nan"),(Number.isNaN(R)||Number.isNaN(B))&&(B=Number.NaN,R=Number.NaN);const e=new A({x:B,y:R});N&&e.setZ(V),T&&e.setM(M),g&&e.setID(U),ce=e}else if(w||C||D||F||j||O||z||I||E||P){(Number.isNaN(X)||Number.isNaN(Y)||Number.isNaN(L))&&(W=Number.NaN);const e=new S({xmin:W,ymin:X,xmax:Y,ymax:L});j&&O&&e.setInterval(1,0,G,q),z&&I&&e.setInterval(2,0,K,J),E&&P&&e.setInterval(3,0,re,ie),ce=e}return{...ce?{geom:ce}:{},...le?{sr:le}:{}}}function J(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function Q(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,_=!1,g=!1,v=!1,x=!1,A=!1,S=-1,w=-1,C=-1,D=-1,F=0,j=0,O=0,z=0,I=0,E=0,P=0,B=0,R=0,V=0,M="",U="",W=null;for(;3!==e.nextToken();){const h=e.currentString();e.nextToken(),"wkid"===h?t||(t=!0,8===e.currentToken()&&(S=e.currentInt32Value())):"latestWkid"===h?n||(n=!0,8===e.currentToken()&&(w=e.currentInt32Value())):"wkt"===h?s||(s=!0,6===e.currentToken()&&(M=e.currentString())):"wkt2"===h?s||6===e.currentToken()&&(U=e.currentString()):"vcsWkid"===h?r||(r=!0,8===e.currentToken()&&(C=e.currentInt32Value())):"latestVcsWkid"===h?i||(i=!0,8===e.currentToken()&&(D=e.currentInt32Value())):"xyTolerance"===h?o||(o=!0,a=!0,F=e.currentDoubleValue()):"zTolerance"===h?u||(u=!0,a=!0,j=e.currentDoubleValue()):"mTolerance"===h?m||(m=!0,a=!0,O=e.currentDoubleValue()):"falseX"===h?l||(l=!0,a=!0,P=e.currentDoubleValue()):"falseY"===h?c||(c=!0,a=!0,B=e.currentDoubleValue()):"falseZ"===h?d||(d=!0,a=!0,R=e.currentDoubleValue()):"falseM"===h?_||(_=!0,a=!0,V=e.currentDoubleValue()):"xyUnits"===h?g||(g=!0,a=!0,z=e.currentDoubleValue()):"zUnits"===h?v||(v=!0,a=!0,I=e.currentDoubleValue()):"mUnits"===h?x||(x=!0,a=!0,E=e.currentDoubleValue()):"unit"===h?A||(A=!0,W=J(e)):e.skipChildren()}D<=0&&C>0&&(D=C),C<=0&&D>0&&(C=D);let X=null,Y=!0;if(0!==M.length&&(Y=!1,h(M)&&(X=f(M))),X||0===U.length||(Y=!1,h(U)&&(X=f(U))),!X&&w>0&&(Y=!1,p(w)&&(D<=0||k())&&(X=b(w,D))),!X&&S>0&&(Y=!1,p(S)&&(C<=0||k())&&(X=b(S,C))),Y&&(X=y(W)),a&&X){const e=new N;X.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,F),u&&e.setTolerance(1,j),m&&e.setTolerance(2,O),g&&l&&c&&e.setGridParams(P,B,z),v&&d&&e.setZParams(R,I),x&&_&&e.setMParams(V,E),X=T(X,e)}return X}function Z(e,n,r,i){2!==i.currentToken()&&t("failed to parse multipath: array of array of vertices is expected");const s=e?new O:new z,a=s,o=w(0),u=v(2,0),_=C(0);let h=null,f=null,p=null,k=null,b=null,y=0,N=0,T=0;const g=new I,x=l.getNAN();let A=0,S=0;const F=e?1:0;for(;4!==i.nextToken();){2!==i.currentToken()&&t("failed to parse multipath: ring/path array is expected");let r=2,s=0,j=!0;const O=4;let z=0,I=0;const E=l.getNAN(),P=m(O,Number.NaN),B=m(O,Number.NaN);let R=!1;for(i.nextToken();4!==i.currentToken();){if(n&&1===i.currentToken())j&&t("failed to parse multipath: starting vertex array is expected"),p||(p=C(A-1,1),k=w(A-1,-1),b=v(0)),R=!0,r=1,({segFlag:T,toPointSz:z}=me(g,P,x,i));else{for(R=!1,2!==i.currentToken()&&t("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),z=0;4!==i.nextToken();)z===O&&t("failed to parse multipath: each vertex array has to have at most 4 elements"),P[z++]=ee(i);z<2&&t("failed to parse multipath: each vertex array has to have at least 2 elements"),D(P[0],P[1])||t("failed to parse multipath: x and y must be finite")}i.nextToken();do{if(u.size()===2*A&&u.resize(re(A)),u.writePoint2D(2*A,E.setCoords(P[0],P[1])),h&&h.size()===A&&h.resize(ie(A)),z>2?(h||(h=v(A+1,Number.NaN)),h.write(A,P[2])):h&&h.write(A,Number.NaN),f&&f.size()===A&&f.resize(ie(A)),z>3?(f||(f=v(A+1,Number.NaN)),f.write(A,P[3])):f&&f.write(A,Number.NaN),j)S++,o.add(A),_.add(F),j=!1,I=z,c(B,P,0,0,I);else if(null!==p)if(R){const e=U(T),t=b.size();b.resize(t+e),p.add(T),k.add(y),g.get().writeInBufferStream(b,y),y+=e,a.incCurveType(T,1),N++}else p.add(1),k.add(-1);A++,s++,x.setCoords(P[0],P[1])}while(s<r&&4===i.currentToken())}0!==s&&(e&&s>r&&z===I&&0===d(P,B,z)?(A--,s--):null!==p&&(p.add(1),k.add(-1)))}return A&&(o.resize(S),_.resize(S),A>0&&(o.add(A),_.add(0)),a.setAttributeStreamRef(0,u),a.setPathFlagsStreamRef(_),a.setPathStreamRef(o),null!==p&&(a.updateCurveCounter(N),a.setSegmentData(k,b,p,y)),a.notifyModifiedFlags(65535)),{geometry:s,as:h,bs:f}}function H(e,n){2!==n.currentToken()&&t("failed to parse multipoint: array of vertices is expected");let r=0;const i=new E,s=v(2,0);let a=0;const o=4,u=m(o,Number.NaN),c=new l;let d=null,_=null;for(;4!==n.nextToken();){for(2!==n.currentToken()&&t("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==n.nextToken();)a===o&&t("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=ee(n);a<2&&t("failed to parse multipoint: each vertex array has to have at least 2 elements"),D(u[0],u[1])||t("failed to parse multipoint: x and y must be finite"),s.size()===2*r&&s.resize(re(r)),s.writePoint2D(2*r,c.setCoords(u[0],u[1])),d&&d.size()===r&&d.resize(ie(r)),a>2?(d||(d=v(r+1,Number.NaN)),d.write(r,u[2])):d&&d.write(r,Number.NaN),_&&_.size()===r&&_.resize(ie(r)),a>3?(_||(_=v(r+1,Number.NaN)),_.write(r,u[3])):_&&_.write(r,Number.NaN),r++}if(r){const e=i.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(r),e.notifyModifiedFlags(65535)}return{geometry:i,as:d,bs:_}}function $(e,n){2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected");const r=F(2,0);let i=0,s=-1;for(;4!==n.nextToken();){const e=i;r.size()===i&&r.resize(ie(i)),i++;let a=0;for(-1===s?s=2===n.currentToken()?1:0:1===s&&2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected"),0===s&&(r.size()===i&&r.resize(ie(i)),r.write(i,te(n)),a++,i++);4!==n.nextToken();)r.size()===i&&r.resize(ie(i)),r.write(i,te(n)),a++,i++;if(r.write(e,a),0===s)break}return r.resize(i),r}function ee(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function te(e){return e.currentInt32Value()}function ne(t,n){if(t.isEmpty())return;const r=F(2,0),i=t.getGeometryType();let s=0;i===E.type?s=1:i===z.type||i===O.type?s=t.getPathCount():e("not implemented"),r.resize(t.getPointCount(),0);let a=0;for(let o=0;o<s;++o){const s=n.read(a);a++;const u=a+s;let m=0,l=0;i===E.type?m=t.getPointCount():i===z.type||i===O.type?(m=t.getPathSize(o),l=t.getPathStart(o)):e("not implemented");for(let e=0,t=Math.min(s,m);e<t;++e)r.write(l,n.read(a)),a++,l++;a=u}t.getImpl().setAttributeStreamRef(3,r)}function re(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function ie(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function se(e,t,n,i,s){s>=i.size()&&r("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=l.getNAN();a.x=i.readDouble(s),a.y=i.readDouble(s+8);const o=i.readInt32(s+16);if(!!(1&o))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),!1;let u=!!(64&o);const m=!!(128&o);let c=!!(32&o);const d=!!(8&o),_=!!(16&o),h=t.equals(n);return u&&!h&&(u=!1,c=!0),c&&h&&(u=!0,c=!1,a.setCoords(0,0)),u||(m?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),h&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):V(e,t,n,a,d,_)),u&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,M(e,Number.NaN,d,_),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),R(e),!0}function ae(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,M(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),R(e),!0}function oe(e,t,r,i,s){return n(s+32<=i.size()),e.m_cp=_(l,2),e.m_cp[0].x=i.readDouble(s),e.m_cp[0].y=i.readDouble(s+8),e.m_cp[1].x=i.readDouble(s+16),e.m_cp[1].y=i.readDouble(s+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=r.x,e.m_YEnd=r.y,!0}function ue(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function me(e,n,r,i,s){const a={segFlag:0,toPointSz:0};let o=i.currentToken();o=i.nextToken();const u=i.currentString(),m=u[0];for((1!==u.length||"a"!==m&&"b"!==m&&"c"!==m&&"n"!==m&&"q"!==m)&&t('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for curve parameters"),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for to point"),a.toPointSz=0;4!==i.nextToken();)4===a.toPointSz&&t("failed to parse curve: vertex array cannot have more than 4 elements"),n[a.toPointSz++]=ee(i);a.toPointSz<2&&t("failed to parse curve: vertex array must have at least 2 elements");const c=l.construct(n[0],n[1]),d=l.getNAN();let _=-1,h=-1,f=!1,p=Number.NaN,k=Number.NaN,b=Number.NaN;const y=[l.getNAN(),l.getNAN(),l.getNAN()],N=l.getNAN();if("a"===m){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for center point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for center point"),d.setCoords(e,n),o=i.nextToken(),_=i.currentInt32Value(),o=i.nextToken(),h=i.currentInt32Value(),o=i.nextToken(),4!==o?(f=!1,p=ee(i),o=i.nextToken(),k=ee(i),o=i.nextToken(),b=ee(i),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters")):f=!0,a.segFlag=4}else if("b"===m){for(let e=0;e<2;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=2}else if("n"===m){{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[0].setCoords(e,n)}o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);y[1].setCoords(e,n),y[2].setCoords(r,r),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=8}else if("q"===m){for(let e=0;e<1;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=16}else{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for interior point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for interior point"),N.setCoords(e,n),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=4}if(o=i.nextToken(),3!==o&&t("failed to parse curve: end object is expected for curve"),"a"===m)if(e.createEllipticArc(),f){const t=!0;le(e.get(),r,c,d,t,_,h)}else ce(e.get(),r,c,d,_,h,p,k,b);else if("b"===m)e.createCubicBezier(),de(e.get(),r,c,y);else if("n"===m)e.createQuadraticRationalBezier(),_e(e.get(),r,c,y[0],y[1].x,y[1].y,y[2].x);else if("q"===m)e.createQuadraticBezier(),e.get().construct(r,y[0],c);else{e.createEllipticArc();const t=!1;le(e.get(),r,c,N,t,-1,-1)}return a}function le(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new q({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,se(e,t,n,m,0)}function ce(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new q({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,ae(e,t,n,c,0)}function de(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new q({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,oe(e,t,n,a,0)}function _e(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new q({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,ue(e,t,n,m,0)}function he(e,t,n,r,i){const o=e.getGeometryType();if(o===s.enumEllipticArc)return fe(e,t,n,r,i);if(o===s.enumBezier)return pe(e,t,n,r,i);if(o===s.enumRationalBezier2)return ke(e,t,n,r,i);if(o===s.enumBezier2){const s=new P;return s.constructFromQuadraticSegment(e),pe(s,t,n,r,i)}a("")}function fe(e,t,r,i,s){n(!B(e));const a=e.getEndXY(),o=e.hasAttribute(1)&&!t,u=e.hasAttribute(2)&&!r;let m=Number.NaN,l=Number.NaN;if(o&&(m=e.getEndAttributeAsDbl(1,0)),u&&(l=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return be(o,u,a.x,a.y,m,l,i,s),!0;const c=0===e.projectionBehavior(),d=!!c&&e.isClosed();if(c&&!d)s.startObject(),s.addFieldName("c"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s),ye(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(c){s.startObject(),s.addFieldName("a"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s);const t=0,n=0;ye(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const c=e.isClockwise();s.addInt32(c?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s);const t=e;ye(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}function pe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),be(a,o,s.x,s.y,u,m,r,i),ye(e.m_cp[0].x,e.m_cp[0].y,r,i),ye(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function ke(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),be(a,o,s.x,s.y,u,m,r,i),ye(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function be(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function ye(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class Ne{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){Te(e,t,n,r)}exportSpatialReference(e,t,r,i){n(0)}exportProjectionTransformation(e,t,r,i){n(0)}exportDatumTransformation(e,t,r,i){n(0)}static geometryTypeToString(e){return n(0),""}}function Te(t,r,i,a,o){if(r||i){if(a.startObject(),null!==r){switch(r.getGeometryType()){case s.enumPolygon:ge(!0,t,r,a);break;case s.enumPolyline:ge(!1,t,r,a);break;case s.enumMultiPoint:ve(t,r,a);break;case s.enumPoint:xe(t,r,a);break;case s.enumEnvelope:Ae(t,r,a);break;case s.enumMultipatch:n(0);break;default:e("exportToJSON")}}null!==i&&(a.addFieldName("spatialReference"),we(t,i,a)),a.endObject()}}function ge(e,t,r,i){const s=r.getImpl(),o=!!(2&t),u=!!(4&t),m=!!(8&t),l=s.hasAttribute(1)&&!o,c=s.hasAttribute(2)&&!u,d=s.hasAttribute(3)&&!m,_=s.hasNonLinearSegments();l&&(i.addFieldName("hasZ"),i.addBool(!0)),c&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let h=null;const f=[];if(r.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const n=r.getPathCount();let m=0;const p=s.getAttributeStreamRef(0);let k=null,b=null,y=null;const N=new I;let T=null,g=null,v=null;_&&(T=s.getSegmentFlagsStreamRef(),g=s.getSegmentIndexStreamRef(),v=s.getSegmentDataStreamRef()),l&&(k=s.getAttributeStreamRef(1)),c&&(b=s.getAttributeStreamRef(2)),d&&(y=s.getAttributeStreamRef(3),h=j(3,0));for(let t=0;t<n;t++){i.startArray(),d&&f.push(0);const n=r.getPathEnd(t);if(m===n){i.endArray();continue}const s=r.isClosedPath(t);let _=p.read(2*m),x=p.read(2*m+1),A=l?k.read(m):Number.NaN,S=c?b.read(m):Number.NaN,w=d?y.read(m):0;Ce(l,c,_,x,A,S,e,i);let C=1;d&&(h.add(w),f[f.length-1]++);const D=_,F=x,j=A,O=S,z=w;let I=!1,E=0,P=Number.NaN,B=Number.NaN,R=0;for(let t=m+1,r=m,V=s?n+1:n;t<V;t++,r++){const s=null!==T?31&T.read(r):1;let m,V;if(t<n?(m=p.read(2*t),V=p.read(2*t+1),l&&(P=k.read(t)),c&&(B=b.read(t)),d&&(R=y.read(t))):(m=D,V=F,P=j,B=O,R=z),1!==s){I=!0,4===s?N.createEllipticArc():2===s?N.createCubicBezier():16===s?N.createQuadraticBezier():8===s?N.createQuadraticRationalBezier():a("JSON export.unsupported curve");const t=N.get(),n=g.read(r);t.setStartXYCoords(_,x),t.setEndXYCoords(m,V),l&&(t.setStartAttribute(1,0,A),t.setEndAttribute(1,0,P)),c&&(t.setStartAttribute(2,0,S),t.setEndAttribute(2,0,B)),t.readFromBufferStream(v,n);he(N.get(),o,u,e,i)&&E++}else Ce(l,c,m,V,P,B,e,i);d&&(h.add(R),f[f.length-1]++),C++,_=m,x=V,A=P,S=B,w=R}I&&0===E||(C<2&&E<1&&(Ce(l,c,_,x,A,S,e,i),C++,d&&(h.add(w),f[f.length-1]++)),s&&C<3&&E<2&&(Ce(l,c,D,F,j,O,e,i),C++,_=D,x=F,A=j,S=O,w=z,d&&(h.add(z),f[f.length-1]++))),i.endArray(),m=n}i.endArray()}if(d){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,r=f.length;t<r;++t){const r=f[t];n(0===r||null!==h&&e+r<=h.size()),i.startArray();for(let t=0;t<r;++t)i.addInt32(h.read(e)),e++;i.endArray()}i.endArray()}}function ve(e,t,r){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(r.addFieldName("hasZ"),r.addBool(!0)),a&&(r.addFieldName("hasM"),r.addBool(!0)),r.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())r.startArray(),r.endArray();else{const t=17-(31&e>>13);r.startArray();const n=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=n.read(2*e),u=n.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),Ce(s,a,i,u,l,c,t,r)}r.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),n(0===u||null!==e&&e.size()>=u),r.addFieldName("ids"),r.startArray();for(let t=0;t<u;t++)r.addInt32(e.read(t));r.endArray()}}function xe(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function Ae(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function Se(e,n,r){r.startObject();const i=n.getID();i<=0&&t("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(i),r.endObject()}function we(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),Se(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new N;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function Ce(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const De={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_r:"r".charCodeAt(0),s_t:"t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class Fe{constructor(t){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===t?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push(()=>this.accept_()),this.m_jsonString=null,this.m_bHasEscapes=!1):t.jsonString?this.resetParserFromString(t.jsonString):t.jsonStream?a("streaming json parsing not yet impl"):e("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){a("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push(()=>this.start_()),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){a("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push(()=>this.accept_()),!1):(this.m_functionStack.push(()=>this.start_()),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return n(0),""}childrenAsString(){return n(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e);return}if(2===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e);return}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}t("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===De.s_backslash&&t.charCodeAt(r+1)===De.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===De.s_backslash&&t.charCodeAt(r+1)===De.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==De.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case De.s_doubleQuote:e+='"';break;case De.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case De.s_backslash:e+="\\";break;case De.s_forwardslash:e+="/";break;case De.s_b:e+="\b";break;case De.s_f:e+="\f";break;case De.s_n:e+="\n";break;case De.s_r:e+="\r";break;case De.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&t("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),n-=2,0===n&&t("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&t("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&t("invalid token");let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),n-=2,0===n&&t("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&t("invalid token"),r}currentInt64Value(){return n(0),0n}currentBoolValue(){return n(0),!1}isError(){return 0}JSONString(){return n(0),""}pushPosition(){return n(0),!1}popPosition(){return n(0),!1}skipCStyleComments_(){n(0)}skipCppStyleComments_(){n(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e===De.s_asterisk?this.skipCStyleComments_():e===De.s_forwardslash?this.skipCppStyleComments_():t("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&t("invalid token");let n=this.m_peekChar();for(;n>=9&&n<=13||32===n;)this.m_increment(),this.m_eof()&&t("invalid token"),n=this.m_peekChar();n===De.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===De.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===De.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&t("invalid token");let e=this.m_peekChar();for(;e!==De.s_doubleQuote;){const n=e===De.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),n)if(this.m_bHasEscapes=!0,e===De.s_doubleQuote||e===De.s_backslash||e===De.s_forwardslash||e===De.s_b||e===De.s_f||e===De.s_n||e===De.s_r||e===De.s_t)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar();else if(e===De.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=De.s_zero&&e<=De.s_nine||e>=De.s_a&&e<=De.s_f||e>=De.s_A&&e<=De.s_F||t("invalid token");else t("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===De.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===De.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):t("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==De.s_doubleQuote&&t("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push(()=>this.fieldNameEnd_())}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():t("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push(()=>this.elementEnd_()),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():t("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push(()=>this.pairEnd_()),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push(()=>this.objectStart_())}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push(()=>this.arrayStart_())}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==De.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()}while(e>=De.s_zero&&e<=De.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=De.s_zero&&e<=De.s_nine||t("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e!==De.s_plus&&e!==De.s_minus||(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()),e>=De.s_zero&&e<=De.s_nine||t("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,n=this.m_peekChar();if(n===De.s_minus?(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),n=this.m_peekChar(),e=!0,n>=De.s_zero&&n<=De.s_nine||t("invalid token"),this.int_()):this.int_(),n=this.m_peekChar(),n===De.s_period)this.m_currentTokenType=7,this.frac_(),n=this.m_peekChar(),n!==De.s_e&&n!==De.s_E||this.exp_();else if(n===De.s_e||n===De.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"null"!==e&&t("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"true"!==e&&t("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:n}=this.m_get(6);n&&t("invalid token"),"false"!==e&&t("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:n}=this.m_get(4);n&&t("invalid token"),"NaN"!==e&&t("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===De.s_beginObject?this.valueStartObject_():e===De.s_beginArray?this.valueStartArray_():e===De.s_doubleQuote?this.valueString_():e===De.s_minus||e>=De.s_zero&&e<=De.s_zero+9?this.valueNumber_():e===De.s_n?this.valueNull_():e===De.s_t?this.valueTrue_():e===De.s_f?this.valueFalse_():e===De.s_N?this.valueNan_():t("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push(()=>this.accept_());const e=this.m_peekChar();e!==De.s_beginObject&&e!==De.s_beginArray&&t("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class je{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,n,r,i,s,a,o){let u;"string"==typeof r?(u=new Fe({jsonString:r}),u.nextToken()):u=r,1!==u.currentToken()&&t("failed to import map geometry: start of object is expected");const m=K(n,e,u,i,s);return new g(m)}importSpatialReference(t){const n=Q(t);return null===n&&e("failed to import spatial reference"),n}importProjectionTransformation(e,t){return n(0),{}}importDatumTransformation(e,t){return n(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||t("string_to_geometry_type"),e.endsWith("point")?s.enumPoint:e.endsWith("envelope")?s.enumEnvelope:e.endsWith("multipoint")?s.enumMultiPoint:e.endsWith("polyline")?s.enumPolyline:e.endsWith("polygon")?s.enumPolygon:void t("string_to_geometry_type")}}const Oe=new G,ze=new Ne,Ie=new je;function Ee(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function Pe(e,t){const{includeGeometry:n=!0,includeSpatialReference:r=!0}=t??{};r&&(e.spatialReference?.latestVcsWkid||e.spatialReference?.vcsWkid)&&(e={...e,spatialReference:{...e.spatialReference}},delete e.spatialReference?.latestVcsWkid,delete e.spatialReference?.vcsWkid);const i=new L(e,{strict:!1});return i.nextToken(),Ie.execute(0,s.enumUnknown,i,n,r)}function Be(e){let t=null;return[e.map(e=>{if(null==t){const n=Re(e);return t=n.getSpatialReference(),n.getGeometry()}return Ve(e)}),t]}function Re(e){return e.spatialReference instanceof W&&(e={...e,spatialReference:e.spatialReference.toJSON()}),Pe(e)}function Ve(e){return Pe(e,{includeSpatialReference:!1}).getGeometry()}function Me(e){return e instanceof W&&(e=e.toJSON()),Pe({x:0,y:0,spatialReference:e},{includeGeometry:!1}).getSpatialReference()}function Ue(e,t){return e instanceof g&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(Oe.reset(),ze.execute(0,e,t,Oe),Oe.getObject())}export{Be as fromGeometries,Re as fromGeometry,Ve as fromGeometryToGXGeometry,Me as fromSpatialReference,Ee as getSpatialReference,Ue as toGeometry};
5
+ import{d as e,a as t,g as n,q as r,p as i,G as s,t as a}from"../../../chunks/Geometry.js";import{aJ as o,i as u,d as m,P as l,b as c,aK as d,m as _}from"../../../chunks/Point2D.js";import{q as h,b as f,p,aX as k,c as b,e as y,a as N,f as T,aY as g}from"../../../chunks/UnitFactory.js";import{a1 as v,a4 as x,P as A,E as S,$ as w,a0 as C,a5 as D,a6 as F,Y as j}from"../../../chunks/Envelope.js";import{a as O,P as z,S as I,M as E,J as P,a5 as B,a6 as R,a7 as V,a8 as M,a9 as U}from"../../../chunks/MultiPathImpl.js";import W from"../../SpatialReference.js";import"./initNoPeFactory.js";function X(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function Y(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class L{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter(t=>void 0!==e[t]),m_i:-1,m_bReturnKey:!0,next:X}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:Y}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=o()&&this.m_currentValue<=u()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;e("unrecognized json element type")}return e("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&t("invalid token"),this.m_currentValue}currentInt64Value(){return n(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&t("invalid token"),this.m_currentValue}isError(){return 0}}class G{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){n(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class q{constructor(t){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==t.sz?(this.m_sz=t.sz,t.buffer?(this.m_sz<0&&r("size out of range"),this.m_buffer=t.buffer,this.m_offset=void 0!==t.offset?t.offset:0,this.m_view=void 0!==t.offset?new DataView(t.buffer,t.offset,t.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&r("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):t.move?(this.m_sz=t.move.m_sz,this.m_buffer=t.move.m_buffer,this.m_view=t.move.m_view,this.m_bOwnsBuffer=t.move.m_bOwnsBuffer,this.m_bLittleEndian=t.move.m_bLittleEndian,t.move.m_buffer=null,t.move.m_view=null,t.move.m_sz=0,void(t.move.m_bOwnsBuffer=!0)):void e("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===q.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===q.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||i("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){n(e>=0&&e<=this.m_sz),this.m_sz=e}}function K(e,r,i,a,o,u){let m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,N=!1,T=!1,g=!1,w=!1,C=!1,D=!1,F=!1,j=!1,O=!1,z=!1,I=!1,E=!1,P=!1,B=Number.NaN,R=Number.NaN,V=Number.NaN,M=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,Y=Number.NaN,L=Number.NaN,G=Number.NaN,q=Number.NaN,K=Number.NaN,J=Number.NaN,re=0,ie=0,se=!1,ae=!1,oe=null,ue=null,me=null,le=null,ce=null;for(;3!==i.nextToken();){const u=i.currentString();if(i.nextToken(),"spatialReference"===u){if(o&&!m){m=!0,1===i.currentToken()?le=Q(i):10!==i.currentToken()&&t("failed to parse spatial reference: object or null is expected");continue}}else if(a)if("hasZ"===u){if(!l){l=!0,se=11===i.currentToken();continue}}else if("hasM"===u){if(!c){c=!0,ae=11===i.currentToken();continue}}else if("rings"===u){if(!(_||h||e!==s.enumUnknown&&e!==s.enumPolygon)){_=!0,({geometry:ce,as:oe,bs:ue}=Z(!0,!1,r,i));continue}}else if("curveRings"===u){if(!h&&(e===s.enumUnknown||e===s.enumPolygon)){h=!0,({geometry:ce,as:oe,bs:ue}=Z(!0,!0,r,i));continue}}else if("paths"===u){if(!(f||p||e!==s.enumUnknown&&e!==s.enumPolyline)){f=!0,({geometry:ce,as:oe,bs:ue}=Z(!1,!1,r,i));continue}}else if("curvePaths"===u){if(!p&&(e===s.enumUnknown||e===s.enumPolyline)){p=!0,({geometry:ce,as:oe,bs:ue}=Z(!1,!0,r,i));continue}}else if("points"===u){if(!k&&(e===s.enumUnknown||e===s.enumMultiPoint)){k=!0,({geometry:ce,as:oe,bs:ue}=H(r,i));continue}}else if("ids"===u){if(!d){d=!0,me=$(r,i);continue}}else if("x"===u){if(!b&&(e===s.enumUnknown||e===s.enumPoint)){b=!0,B=ee(i);continue}}else if("y"===u){if(!y&&(e===s.enumUnknown||e===s.enumPoint)){y=!0,R=ee(i);continue}}else if("z"===u){if(!N&&(e===s.enumUnknown||e===s.enumPoint)){N=!0,V=ee(i);continue}}else if("m"===u){if(!T&&(e===s.enumUnknown||e===s.enumPoint)){T=!0,M=ee(i);continue}}else if("id"===u){if(!g&&(e===s.enumUnknown||e===s.enumPoint)){g=!0,U=te(i);continue}}else if("xmin"===u){if(!w&&(e===s.enumUnknown||e===s.enumEnvelope)){w=!0,W=ee(i);continue}}else if("ymin"===u){if(!C&&(e===s.enumUnknown||e===s.enumEnvelope)){C=!0,X=ee(i);continue}}else if("mmin"===u){if(!z&&(e===s.enumUnknown||e===s.enumEnvelope)){z=!0,K=ee(i);continue}}else if("zmin"===u){if(!j&&(e===s.enumUnknown||e===s.enumEnvelope)){j=!0,G=ee(i);continue}}else if("idmin"===u){if(!E&&(e===s.enumUnknown||e===s.enumEnvelope)){E=!0,re=te(i);continue}}else if("xmax"===u){if(!D&&(e===s.enumUnknown||e===s.enumEnvelope)){D=!0,Y=ee(i);continue}}else if("ymax"===u){if(!F&&(e===s.enumUnknown||e===s.enumEnvelope)){F=!0,L=ee(i);continue}}else if("mmax"===u){if(!I&&(e===s.enumUnknown||e===s.enumEnvelope)){I=!0,J=ee(i);continue}}else if("zmax"===u){if(!O&&(e===s.enumUnknown||e===s.enumEnvelope)){O=!0,q=ee(i);continue}}else if("idmax"===u){if(!P&&(e===s.enumUnknown||e===s.enumEnvelope)){P=!0,ie=te(i);continue}}else"materials"===u&&n(0);i.skipChildren()}if(_||h||f||p||k){let e=null,t=null;const n=ce;se&&(ce.addAttribute(1),e=oe,e||(e=v(n.getPointCount(),Number.NaN))),ae&&(ce.addAttribute(2),t=se?ue:oe),null!=me&&ce.addAttribute(3),se&&null!=e&&n.setAttributeStreamRef(1,e),ae&&null!=t&&n.setAttributeStreamRef(2,t),null!=me&&ne(n,me)}else if(b||y||T||N||g){x(B,R)||t("failed to parse point: x and y must be finite or nan"),(Number.isNaN(R)||Number.isNaN(B))&&(B=Number.NaN,R=Number.NaN);const e=new A({x:B,y:R});N&&e.setZ(V),T&&e.setM(M),g&&e.setID(U),ce=e}else if(w||C||D||F||j||O||z||I||E||P){(Number.isNaN(X)||Number.isNaN(Y)||Number.isNaN(L))&&(W=Number.NaN);const e=new S({xmin:W,ymin:X,xmax:Y,ymax:L});j&&O&&e.setInterval(1,0,G,q),z&&I&&e.setInterval(2,0,K,J),E&&P&&e.setInterval(3,0,re,ie),ce=e}return{...ce?{geom:ce}:{},...le?{sr:le}:{}}}function J(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function Q(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,_=!1,g=!1,v=!1,x=!1,A=!1,S=-1,w=-1,C=-1,D=-1,F=0,j=0,O=0,z=0,I=0,E=0,P=0,B=0,R=0,V=0,M="",U="",W=null;for(;3!==e.nextToken();){const h=e.currentString();e.nextToken(),"wkid"===h?t||(t=!0,8===e.currentToken()&&(S=e.currentInt32Value())):"latestWkid"===h?n||(n=!0,8===e.currentToken()&&(w=e.currentInt32Value())):"wkt"===h?s||(s=!0,6===e.currentToken()&&(M=e.currentString())):"wkt2"===h?s||6===e.currentToken()&&(U=e.currentString()):"vcsWkid"===h?r||(r=!0,8===e.currentToken()&&(C=e.currentInt32Value())):"latestVcsWkid"===h?i||(i=!0,8===e.currentToken()&&(D=e.currentInt32Value())):"xyTolerance"===h?o||(o=!0,a=!0,F=e.currentDoubleValue()):"zTolerance"===h?u||(u=!0,a=!0,j=e.currentDoubleValue()):"mTolerance"===h?m||(m=!0,a=!0,O=e.currentDoubleValue()):"falseX"===h?l||(l=!0,a=!0,P=e.currentDoubleValue()):"falseY"===h?c||(c=!0,a=!0,B=e.currentDoubleValue()):"falseZ"===h?d||(d=!0,a=!0,R=e.currentDoubleValue()):"falseM"===h?_||(_=!0,a=!0,V=e.currentDoubleValue()):"xyUnits"===h?g||(g=!0,a=!0,z=e.currentDoubleValue()):"zUnits"===h?v||(v=!0,a=!0,I=e.currentDoubleValue()):"mUnits"===h?x||(x=!0,a=!0,E=e.currentDoubleValue()):"unit"===h?A||(A=!0,W=J(e)):e.skipChildren()}D<=0&&C>0&&(D=C),C<=0&&D>0&&(C=D);let X=null,Y=!0;if(0!==M.length&&(Y=!1,h(M)&&(X=f(M))),X||0===U.length||(Y=!1,h(U)&&(X=f(U))),!X&&w>0&&(Y=!1,p(w)&&(D<=0||k())&&(X=b(w,D))),!X&&S>0&&(Y=!1,p(S)&&(C<=0||k())&&(X=b(S,C))),Y&&(X=y(W)),a&&X){const e=new N;X.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,F),u&&e.setTolerance(1,j),m&&e.setTolerance(2,O),g&&l&&c&&e.setGridParams(P,B,z),v&&d&&e.setZParams(R,I),x&&_&&e.setMParams(V,E),X=T(X,e)}return X}function Z(e,n,r,i){2!==i.currentToken()&&t("failed to parse multipath: array of array of vertices is expected");const s=e?new O:new z,a=s,o=w(0),u=v(2,0),_=C(0);let h=null,f=null,p=null,k=null,b=null,y=0,N=0,T=0;const g=new I,x=l.getNAN();let A=0,S=0;const F=e?1:0;for(;4!==i.nextToken();){2!==i.currentToken()&&t("failed to parse multipath: ring/path array is expected");let r=2,s=0,j=!0;const O=4;let z=0,I=0;const E=l.getNAN(),P=m(O,Number.NaN),B=m(O,Number.NaN);let R=!1;for(i.nextToken();4!==i.currentToken();){if(n&&1===i.currentToken())j&&t("failed to parse multipath: starting vertex array is expected"),p||(p=C(A-1,1),k=w(A-1,-1),b=v(0)),R=!0,r=1,({segFlag:T,toPointSz:z}=me(g,P,x,i));else{for(R=!1,2!==i.currentToken()&&t("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),z=0;4!==i.nextToken();)z===O&&t("failed to parse multipath: each vertex array has to have at most 4 elements"),P[z++]=ee(i);z<2&&t("failed to parse multipath: each vertex array has to have at least 2 elements"),D(P[0],P[1])||t("failed to parse multipath: x and y must be finite")}i.nextToken();do{if(u.size()===2*A&&u.resize(re(A)),u.writePoint2D(2*A,E.setCoords(P[0],P[1])),h&&h.size()===A&&h.resize(ie(A)),z>2?(h||(h=v(A+1,Number.NaN)),h.write(A,P[2])):h&&h.write(A,Number.NaN),f&&f.size()===A&&f.resize(ie(A)),z>3?(f||(f=v(A+1,Number.NaN)),f.write(A,P[3])):f&&f.write(A,Number.NaN),j)S++,o.add(A),_.add(F),j=!1,I=z,c(B,P,0,0,I);else if(null!==p)if(R){const e=U(T),t=b.size();b.resize(t+e),p.add(T),k.add(y),g.get().writeInBufferStream(b,y),y+=e,a.incCurveType(T,1),N++}else p.add(1),k.add(-1);A++,s++,x.setCoords(P[0],P[1])}while(s<r&&4===i.currentToken())}0!==s&&(e&&s>r&&z===I&&0===d(P,B,z)?(A--,s--):null!==p&&(p.add(1),k.add(-1)))}return A&&(o.resize(S),_.resize(S),A>0&&(o.add(A),_.add(0)),a.setAttributeStreamRef(0,u),a.setPathFlagsStreamRef(_),a.setPathStreamRef(o),null!==p&&(a.updateCurveCounter(N),a.setSegmentData(k,b,p,y)),a.notifyModifiedFlags(65535)),{geometry:s,as:h,bs:f}}function H(e,n){2!==n.currentToken()&&t("failed to parse multipoint: array of vertices is expected");let r=0;const i=new E,s=v(2,0);let a=0;const o=4,u=m(o,Number.NaN),c=new l;let d=null,_=null;for(;4!==n.nextToken();){for(2!==n.currentToken()&&t("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==n.nextToken();)a===o&&t("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=ee(n);a<2&&t("failed to parse multipoint: each vertex array has to have at least 2 elements"),D(u[0],u[1])||t("failed to parse multipoint: x and y must be finite"),s.size()===2*r&&s.resize(re(r)),s.writePoint2D(2*r,c.setCoords(u[0],u[1])),d&&d.size()===r&&d.resize(ie(r)),a>2?(d||(d=v(r+1,Number.NaN)),d.write(r,u[2])):d&&d.write(r,Number.NaN),_&&_.size()===r&&_.resize(ie(r)),a>3?(_||(_=v(r+1,Number.NaN)),_.write(r,u[3])):_&&_.write(r,Number.NaN),r++}if(r){const e=i.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(r),e.notifyModifiedFlags(65535)}return{geometry:i,as:d,bs:_}}function $(e,n){2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected");const r=F(2,0);let i=0,s=-1;for(;4!==n.nextToken();){const e=i;r.size()===i&&r.resize(ie(i)),i++;let a=0;for(-1===s?s=2===n.currentToken()?1:0:1===s&&2!==n.currentToken()&&t("failed to parse array of IDs: array of array of integers is expected"),0===s&&(r.size()===i&&r.resize(ie(i)),r.write(i,te(n)),a++,i++);4!==n.nextToken();)r.size()===i&&r.resize(ie(i)),r.write(i,te(n)),a++,i++;if(r.write(e,a),0===s)break}return r.resize(i),r}function ee(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function te(e){return e.currentInt32Value()}function ne(t,n){if(t.isEmpty())return;const r=F(2,0),i=t.getGeometryType();let s=0;i===E.type?s=1:i===z.type||i===O.type?s=t.getPathCount():e("not implemented"),r.resize(t.getPointCount(),0);let a=0;for(let o=0;o<s;++o){const s=n.read(a);a++;const u=a+s;let m=0,l=0;i===E.type?m=t.getPointCount():i===z.type||i===O.type?(m=t.getPathSize(o),l=t.getPathStart(o)):e("not implemented");for(let e=0,t=Math.min(s,m);e<t;++e)r.write(l,n.read(a)),a++,l++;a=u}t.getImpl().setAttributeStreamRef(3,r)}function re(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function ie(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function se(e,t,n,i,s){s>=i.size()&&r("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=l.getNAN();a.x=i.readDouble(s),a.y=i.readDouble(s+8);const o=i.readInt32(s+16);if(!!(1&o))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),!1;let u=!!(64&o);const m=!!(128&o);let c=!!(32&o);const d=!!(8&o),_=!!(16&o),h=t.equals(n);return u&&!h&&(u=!1,c=!0),c&&h&&(u=!0,c=!1,a.setCoords(0,0)),u||(m?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),h&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):V(e,t,n,a,d,_)),u&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,M(e,Number.NaN,d,_),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),R(e),!0}function ae(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,M(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),R(e),!0}function oe(e,t,r,i,s){return n(s+32<=i.size()),e.m_cp=_(l,2),e.m_cp[0].x=i.readDouble(s),e.m_cp[0].y=i.readDouble(s+8),e.m_cp[1].x=i.readDouble(s+16),e.m_cp[1].y=i.readDouble(s+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=r.x,e.m_YEnd=r.y,!0}function ue(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function me(e,n,r,i,s){const a={segFlag:0,toPointSz:0};let o=i.currentToken();o=i.nextToken();const u=i.currentString(),m=u[0];for((1!==u.length||"a"!==m&&"b"!==m&&"c"!==m&&"n"!==m&&"q"!==m)&&t('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for curve parameters"),o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for to point"),a.toPointSz=0;4!==i.nextToken();)4===a.toPointSz&&t("failed to parse curve: vertex array cannot have more than 4 elements"),n[a.toPointSz++]=ee(i);a.toPointSz<2&&t("failed to parse curve: vertex array must have at least 2 elements");const c=l.construct(n[0],n[1]),d=l.getNAN();let _=-1,h=-1,f=!1,p=Number.NaN,k=Number.NaN,b=Number.NaN;const y=[l.getNAN(),l.getNAN(),l.getNAN()],N=l.getNAN();if("a"===m){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for center point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for center point"),d.setCoords(e,n),o=i.nextToken(),_=i.currentInt32Value(),o=i.nextToken(),h=i.currentInt32Value(),o=i.nextToken(),4!==o?(f=!1,p=ee(i),o=i.nextToken(),k=ee(i),o=i.nextToken(),b=ee(i),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters")):f=!0,a.segFlag=4}else if("b"===m){for(let e=0;e<2;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=2}else if("n"===m){{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[0].setCoords(e,n)}o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);y[1].setCoords(e,n),y[2].setCoords(r,r),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=8}else if("q"===m){for(let e=0;e<1;e++){o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for control point"),o=i.nextToken();const n=ee(i);o=i.nextToken();const r=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for control point"),y[e].setCoords(n,r)}o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=16}else{o=i.nextToken(),2!==o&&t("failed to parse curve: start array is expected for interior point"),o=i.nextToken();const e=ee(i);o=i.nextToken();const n=ee(i);o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for interior point"),N.setCoords(e,n),o=i.nextToken(),4!==o&&t("failed to parse curve: end array is expected for curve parameters"),a.segFlag=4}if(o=i.nextToken(),3!==o&&t("failed to parse curve: end object is expected for curve"),"a"===m)if(e.createEllipticArc(),f){const t=!0;le(e.get(),r,c,d,t,_,h)}else ce(e.get(),r,c,d,_,h,p,k,b);else if("b"===m)e.createCubicBezier(),de(e.get(),r,c,y);else if("n"===m)e.createQuadraticRationalBezier(),_e(e.get(),r,c,y[0],y[1].x,y[1].y,y[2].x);else if("q"===m)e.createQuadraticBezier(),e.get().construct(r,y[0],c);else{e.createEllipticArc();const t=!1;le(e.get(),r,c,N,t,-1,-1)}return a}function le(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new q({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,se(e,t,n,m,0)}function ce(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new q({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,ae(e,t,n,c,0)}function de(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new q({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,oe(e,t,n,a,0)}function _e(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new q({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,ue(e,t,n,m,0)}function he(e,t,n,r,i){const o=e.getGeometryType();if(o===s.enumEllipticArc)return fe(e,t,n,r,i);if(o===s.enumBezier)return pe(e,t,n,r,i);if(o===s.enumRationalBezier2)return ke(e,t,n,r,i);if(o===s.enumBezier2){const s=new P;return s.constructFromQuadraticSegment(e),pe(s,t,n,r,i)}a("")}function fe(e,t,r,i,s){n(!B(e));const a=e.getEndXY(),o=e.hasAttribute(1)&&!t,u=e.hasAttribute(2)&&!r;let m=Number.NaN,l=Number.NaN;if(o&&(m=e.getEndAttributeAsDbl(1,0)),u&&(l=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return be(o,u,a.x,a.y,m,l,i,s),!0;const c=0===e.projectionBehavior(),d=!!c&&e.isClosed();if(c&&!d)s.startObject(),s.addFieldName("c"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s),ye(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(c){s.startObject(),s.addFieldName("a"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s);const t=0,n=0;ye(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const c=e.isClockwise();s.addInt32(c?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),be(o,u,a.x,a.y,m,l,i,s);const t=e;ye(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}function pe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),be(a,o,s.x,s.y,u,m,r,i),ye(e.m_cp[0].x,e.m_cp[0].y,r,i),ye(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function ke(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),be(a,o,s.x,s.y,u,m,r,i),ye(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function be(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function ye(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class Ne{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){Te(e,t,n,r)}exportSpatialReference(e,t,r,i){n(0)}exportProjectionTransformation(e,t,r,i){n(0)}exportDatumTransformation(e,t,r,i){n(0)}static geometryTypeToString(e){return n(0),""}}function Te(t,r,i,a,o){if(r||i){if(a.startObject(),null!==r){switch(r.getGeometryType()){case s.enumPolygon:ge(!0,t,r,a);break;case s.enumPolyline:ge(!1,t,r,a);break;case s.enumMultiPoint:ve(t,r,a);break;case s.enumPoint:xe(t,r,a);break;case s.enumEnvelope:Ae(t,r,a);break;case s.enumMultipatch:n(0);break;default:e("exportToJSON")}}null!==i&&(a.addFieldName("spatialReference"),we(t,i,a)),a.endObject()}}function ge(e,t,r,i){const s=r.getImpl(),o=!!(2&t),u=!!(4&t),m=!!(8&t),l=s.hasAttribute(1)&&!o,c=s.hasAttribute(2)&&!u,d=s.hasAttribute(3)&&!m,_=s.hasNonLinearSegments();l&&(i.addFieldName("hasZ"),i.addBool(!0)),c&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let h=null;const f=[];if(r.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const n=r.getPathCount();let m=0;const p=s.getAttributeStreamRef(0);let k=null,b=null,y=null;const N=new I;let T=null,g=null,v=null;_&&(T=s.getSegmentFlagsStreamRef(),g=s.getSegmentIndexStreamRef(),v=s.getSegmentDataStreamRef()),l&&(k=s.getAttributeStreamRef(1)),c&&(b=s.getAttributeStreamRef(2)),d&&(y=s.getAttributeStreamRef(3),h=j(3,0));for(let t=0;t<n;t++){i.startArray(),d&&f.push(0);const n=r.getPathEnd(t);if(m===n){i.endArray();continue}const s=r.isClosedPath(t);let _=p.read(2*m),x=p.read(2*m+1),A=l?k.read(m):Number.NaN,S=c?b.read(m):Number.NaN,w=d?y.read(m):0;Ce(l,c,_,x,A,S,e,i);let C=1;d&&(h.add(w),f[f.length-1]++);const D=_,F=x,j=A,O=S,z=w;let I=!1,E=0,P=Number.NaN,B=Number.NaN,R=0;for(let t=m+1,r=m,V=s?n+1:n;t<V;t++,r++){const s=null!==T?31&T.read(r):1;let m,V;if(t<n?(m=p.read(2*t),V=p.read(2*t+1),l&&(P=k.read(t)),c&&(B=b.read(t)),d&&(R=y.read(t))):(m=D,V=F,P=j,B=O,R=z),1!==s){I=!0,4===s?N.createEllipticArc():2===s?N.createCubicBezier():16===s?N.createQuadraticBezier():8===s?N.createQuadraticRationalBezier():a("JSON export.unsupported curve");const t=N.get(),n=g.read(r);t.setStartXYCoords(_,x),t.setEndXYCoords(m,V),l&&(t.setStartAttribute(1,0,A),t.setEndAttribute(1,0,P)),c&&(t.setStartAttribute(2,0,S),t.setEndAttribute(2,0,B)),t.readFromBufferStream(v,n);he(N.get(),o,u,e,i)&&E++}else Ce(l,c,m,V,P,B,e,i);d&&(h.add(R),f[f.length-1]++),C++,_=m,x=V,A=P,S=B,w=R}I&&0===E||(C<2&&E<1&&(Ce(l,c,_,x,A,S,e,i),C++,d&&(h.add(w),f[f.length-1]++)),s&&C<3&&E<2&&(Ce(l,c,D,F,j,O,e,i),C++,_=D,x=F,A=j,S=O,w=z,d&&(h.add(z),f[f.length-1]++))),i.endArray(),m=n}i.endArray()}if(d){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,r=f.length;t<r;++t){const r=f[t];n(0===r||null!==h&&e+r<=h.size()),i.startArray();for(let t=0;t<r;++t)i.addInt32(h.read(e)),e++;i.endArray()}i.endArray()}}function ve(e,t,r){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(r.addFieldName("hasZ"),r.addBool(!0)),a&&(r.addFieldName("hasM"),r.addBool(!0)),r.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())r.startArray(),r.endArray();else{const t=17-(31&e>>13);r.startArray();const n=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=n.read(2*e),u=n.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),Ce(s,a,i,u,l,c,t,r)}r.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),n(0===u||null!==e&&e.size()>=u),r.addFieldName("ids"),r.startArray();for(let t=0;t<u;t++)r.addInt32(e.read(t));r.endArray()}}function xe(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function Ae(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function Se(e,n,r){r.startObject();const i=n.getID();i<=0&&t("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(i),r.endObject()}function we(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),Se(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new N;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function Ce(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const De={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_r:"r".charCodeAt(0),s_t:"t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class Fe{constructor(t){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===t?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push(()=>this.accept_()),this.m_jsonString=null,this.m_bHasEscapes=!1):t.jsonString?this.resetParserFromString(t.jsonString):t.jsonStream?a("streaming json parsing not yet impl"):e("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){a("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push(()=>this.start_()),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){a("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push(()=>this.accept_()),!1):(this.m_functionStack.push(()=>this.start_()),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return n(0),""}childrenAsString(){return n(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e);return}if(2===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e);return}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}t("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===De.s_backslash&&t.charCodeAt(r+1)===De.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===De.s_backslash&&t.charCodeAt(r+1)===De.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==De.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case De.s_doubleQuote:e+='"';break;case De.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case De.s_backslash:e+="\\";break;case De.s_forwardslash:e+="/";break;case De.s_b:e+="\b";break;case De.s_f:e+="\f";break;case De.s_n:e+="\n";break;case De.s_r:e+="\r";break;case De.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&t("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),n-=2,0===n&&t("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&t("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&t("invalid token");let e=this.m_getCurrentSubstr(),n=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),n-=2,0===n&&t("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&t("invalid token"),r}currentInt64Value(){return n(0),0n}currentBoolValue(){return n(0),!1}isError(){return 0}JSONString(){return n(0),""}pushPosition(){return n(0),!1}popPosition(){return n(0),!1}skipCStyleComments_(){n(0)}skipCppStyleComments_(){n(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e===De.s_asterisk?this.skipCStyleComments_():e===De.s_forwardslash?this.skipCppStyleComments_():t("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&t("invalid token");let n=this.m_peekChar();for(;n>=9&&n<=13||32===n;)this.m_increment(),this.m_eof()&&t("invalid token"),n=this.m_peekChar();n===De.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===De.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===De.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&t("invalid token");let e=this.m_peekChar();for(;e!==De.s_doubleQuote;){const n=e===De.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),n)if(this.m_bHasEscapes=!0,e===De.s_doubleQuote||e===De.s_backslash||e===De.s_forwardslash||e===De.s_b||e===De.s_f||e===De.s_n||e===De.s_r||e===De.s_t)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar();else if(e===De.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=De.s_zero&&e<=De.s_nine||e>=De.s_a&&e<=De.s_f||e>=De.s_A&&e<=De.s_F||t("invalid token");else t("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===De.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===De.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):t("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==De.s_doubleQuote&&t("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push(()=>this.fieldNameEnd_())}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():t("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push(()=>this.elementEnd_()),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():t("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push(()=>this.pairEnd_()),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push(()=>this.objectStart_())}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push(()=>this.arrayStart_())}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==De.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()}while(e>=De.s_zero&&e<=De.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e>=De.s_zero&&e<=De.s_nine||t("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar(),e!==De.s_plus&&e!==De.s_minus||(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),e=this.m_peekChar()),e>=De.s_zero&&e<=De.s_nine||t("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,n=this.m_peekChar();if(n===De.s_minus?(this.m_stepOverChar(),this.m_eof()&&t("invalid token"),n=this.m_peekChar(),e=!0,n>=De.s_zero&&n<=De.s_nine||t("invalid token"),this.int_()):this.int_(),n=this.m_peekChar(),n===De.s_period)this.m_currentTokenType=7,this.frac_(),n=this.m_peekChar(),n!==De.s_e&&n!==De.s_E||this.exp_();else if(n===De.s_e||n===De.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"null"!==e&&t("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:n}=this.m_get(5);n&&t("invalid token"),"true"!==e&&t("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:n}=this.m_get(6);n&&t("invalid token"),"false"!==e&&t("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:n}=this.m_get(4);n&&t("invalid token"),"NaN"!==e&&t("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===De.s_beginObject?this.valueStartObject_():e===De.s_beginArray?this.valueStartArray_():e===De.s_doubleQuote?this.valueString_():e===De.s_minus||e>=De.s_zero&&e<=De.s_zero+9?this.valueNumber_():e===De.s_n?this.valueNull_():e===De.s_t?this.valueTrue_():e===De.s_f?this.valueFalse_():e===De.s_N?this.valueNan_():t("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push(()=>this.accept_());const e=this.m_peekChar();e!==De.s_beginObject&&e!==De.s_beginArray&&t("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class je{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,n,r,i,s,a,o){let u;"string"==typeof r?(u=new Fe({jsonString:r}),u.nextToken()):u=r,1!==u.currentToken()&&t("failed to import map geometry: start of object is expected");const m=K(n,e,u,i,s);return new g(m)}importSpatialReference(t){const n=Q(t);return null===n&&e("failed to import spatial reference"),n}importProjectionTransformation(e,t){return n(0),{}}importDatumTransformation(e,t){return n(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||t("string_to_geometry_type"),e.endsWith("point")?s.enumPoint:e.endsWith("envelope")?s.enumEnvelope:e.endsWith("multipoint")?s.enumMultiPoint:e.endsWith("polyline")?s.enumPolyline:e.endsWith("polygon")?s.enumPolygon:void t("string_to_geometry_type")}}const Oe=new G,ze=new Ne,Ie=new je;function Ee(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function Pe(e,t){const{includeGeometry:n=!0,includeSpatialReference:r=!0}=t??{};r&&(e.spatialReference?.latestVcsWkid||e.spatialReference?.vcsWkid)&&(e={...e,spatialReference:{...e.spatialReference}},delete e.spatialReference?.latestVcsWkid,delete e.spatialReference?.vcsWkid);const i=new L(e,{strict:!1});return i.nextToken(),Ie.execute(0,s.enumUnknown,i,n,r)}function Be(e){let t=null;return[e.map(e=>{if(null==t){const n=Re(e);return t=n.getSpatialReference(),n.getGeometry()}return Ve(e)}),t]}function Re(e){return e.spatialReference instanceof W&&(e={...e,spatialReference:e.spatialReference.toJSON()}),Pe(e)}function Ve(e){return Pe(e,{includeSpatialReference:!1}).getGeometry()}function Me(e){return e instanceof W&&(e=e.toJSON()),Pe({x:0,y:0,spatialReference:e},{includeGeometry:!1}).getSpatialReference()}function Ue(e,t){return e instanceof g&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(Oe.reset(),ze.execute(0,e,t,Oe),Oe.getObject())}export{Be as fromGeometries,Re as fromGeometry,Ve as fromGeometryToGXGeometry,Me as fromSpatialReference,Ee as getSpatialReference,Ue as toGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{ClonableMixin as o}from"../../core/Clonable.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{fromRotationTranslationScale as i,invert as a,exactEquals as l}from"../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxisAngle as p}from"../../core/libs/gl-matrix-2/math/quat.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/quatf64.js";import{create as c,fromArray as u,fromValues as f,clone as h}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{up as x,fromAxisAndAngle as g,angle as j,angleRad as b,axis as y}from"./axisAngleDegrees.js";let d=class extends(o(r)){constructor(t){super(t),this.translation=c(),this.rotationAxis=u(x),this.rotationAngle=0,this.scale=f(1,1,1)}get rotation(){return g(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=h(y(t)),this.rotationAngle=j(t)}get localMatrix(){const t=n();return p(A,y(this.rotation),b(this.rotation)),i(t,A,this.translation,this.scale),t}get localMatrixInverse(){return a(n(),this.localMatrix)}equals(t){return this===t||null!=t&&l(this.localMatrix,t.localMatrix)}};t([e({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"translation",void 0),t([e({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"rotationAxis",void 0),t([e({type:Number,nonNullable:!0,json:{write:!0}})],d.prototype,"rotationAngle",void 0),t([e({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"scale",void 0),t([e()],d.prototype,"rotation",null),t([e()],d.prototype,"localMatrix",null),t([e()],d.prototype,"localMatrixInverse",null),d=t([s("esri.geometry.support.MeshTransform")],d);const A=m();export{d as default};
5
+ import{__decorate as t}from"tslib";import{ClonableMixin as o}from"../../core/Clonable.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{fromRotationTranslationScale as i,invert as a,exactEquals as l}from"../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxisAngle as p}from"../../core/libs/gl-matrix-2/math/quat.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/quatf64.js";import{create as c,fromArray as u,fromValues as f,clone as h}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromAxisAndAngle as x,angle as g,angleRad as j,axis as b,up as y}from"./axisAngleDegrees.js";let d=class extends(o(r)){constructor(t){super(t),this.translation=c(),this.rotationAxis=u(y),this.rotationAngle=0,this.scale=f(1,1,1)}get rotation(){return x(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=h(b(t)),this.rotationAngle=g(t)}get localMatrix(){const t=n();return p(A,b(this.rotation),j(this.rotation)),i(t,A,this.translation,this.scale),t}get localMatrixInverse(){return a(n(),this.localMatrix)}equals(t){return this===t||null!=t&&l(this.localMatrix,t.localMatrix)}};t([e({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"translation",void 0),t([e({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"rotationAxis",void 0),t([e({type:Number,nonNullable:!0,json:{write:!0}})],d.prototype,"rotationAngle",void 0),t([e({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"scale",void 0),t([e()],d.prototype,"rotation",null),t([e()],d.prototype,"localMatrix",null),t([e()],d.prototype,"localMatrixInverse",null),d=t([s("esri.geometry.support.MeshTransform")],d);const A=m();export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{rad2deg as r,deg2rad as t}from"../../core/mathUtils.js";import{getRotation as n}from"../../core/libs/gl-matrix-2/math/mat4.js";import{setAxisAngle as o,multiply as i,getAxisAngle as u}from"../../core/libs/gl-matrix-2/math/quat.js";import{create as c}from"../../core/libs/gl-matrix-2/factories/quatf64.js";import{d as e,i as f,n as s,p as m}from"../../chunks/vec32.js";import{UNIT_X as a,UNIT_Y as l,UNIT_Z as p}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";function j(r=B){return[r[0],r[1],r[2],r[3]]}function x(r,t,n,o){return h(r,t,n,o,E)}function b(r,t){return h(r[0],r[1],r[2],t,E)}function g(r,t=j()){return h(r[0],r[1],r[2],r[3],t)}function h(r,t,n,o,i=j()){return i[0]=r,i[1]=t,i[2]=n,i[3]=o,i}function q(r,t,n=j()){return e(w(n),r),n[3]=t,n}function v(r,t,n){return f(n,r,t),s(n,n),n[3]=-m(r,t),n}function d(t,o=j()){const i=n(C,t);return A(o,r(u(o,i))),o}function k(t,n,c=j()){return o(C,w(t),z(t)),o(D,w(n),z(n)),i(C,D,C),A(c,r(u(w(c),C)))}function U(r,t,n,o=j()){return q(a,r,F),q(l,t,G),q(p,n,H),k(F,G,F),k(F,H,o),o}function w(r){return r}function y(r){return r[3]}function z(r){return t(r[3])}function A(r,t){return r[3]=t,r}const B=[0,0,1,0],C=c(),D=c(),E=j(),F=j(),G=j(),H=j();export{y as angle,z as angleRad,w as axis,k as compose,U as composeAxes,g as copy,j as create,q as fromAxisAndAngle,d as fromMatrix,v as fromPoints,h as fromValues,A as setAngle,B as up,x as wrap,b as wrapAxisAngle};
5
+ import{deg2rad as r,rad2deg as t}from"../../core/mathUtils.js";import{getRotation as n}from"../../core/libs/gl-matrix-2/math/mat4.js";import{setAxisAngle as o,multiply as i,getAxisAngle as u}from"../../core/libs/gl-matrix-2/math/quat.js";import{create as c}from"../../core/libs/gl-matrix-2/factories/quatf64.js";import{d as e,i as f,n as s,p as m}from"../../chunks/vec32.js";import{UNIT_X as a,UNIT_Y as l,UNIT_Z as p}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";function j(r=B){return[r[0],r[1],r[2],r[3]]}function x(r,t,n,o){return h(r,t,n,o,E)}function b(r,t){return h(r[0],r[1],r[2],t,E)}function g(r,t=j()){return h(r[0],r[1],r[2],r[3],t)}function h(r,t,n,o,i=j()){return i[0]=r,i[1]=t,i[2]=n,i[3]=o,i}function q(r,t,n=j()){return e(w(n),r),n[3]=t,n}function v(r,t,n){return f(n,r,t),s(n,n),n[3]=-m(r,t),n}function d(r,o=j()){const i=n(C,r);return A(o,t(u(o,i))),o}function k(r,n,c=j()){return o(C,w(r),z(r)),o(D,w(n),z(n)),i(C,D,C),A(c,t(u(w(c),C)))}function U(r,t,n,o=j()){return q(a,r,F),q(l,t,G),q(p,n,H),k(F,G,F),k(F,H,o),o}function w(r){return r}function y(r){return r[3]}function z(t){return r(t[3])}function A(r,t){return r[3]=t,r}const B=[0,0,1,0],C=c(),D=c(),E=j(),F=j(),G=j(),H=j();export{y as angle,z as angleRad,w as axis,k as compose,U as composeAxes,g as copy,j as create,q as fromAxisAndAngle,d as fromMatrix,v as fromPoints,h as fromValues,A as setAngle,B as up,x as wrap,b as wrapAxisAngle};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{colorGamma as e}from"../../../../../colorUtils.js";import t from"../../../../../core/Logger.js";import{getOrCreateMapValue as s}from"../../../../../core/MapUtils.js";import{deg2rad as r}from"../../../../../core/mathUtils.js";import{exactEquals as i}from"../../../../../core/libs/gl-matrix-2/math/quat.js";import{clone as o,IDENTITY as a}from"../../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{q as n}from"../../../../../chunks/vec32.js";import{clone as l,ZEROS as c,ONES as u}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"../../../MeshMaterialMetallicRoughness.js";import{convertVertexSpace as f}from"../../vertexSpaceConversion.js";import{Buffer as m}from"./buffer.js";import{smoothNormals as p}from"./geometry.js";import{imageToArrayBuffer as d,imageToDataURI as g}from"./imageutils.js";import{isEncodedMeshTexture as x}from"../../../../../views/3d/glTF/internal/resourceUtils.js";import{DataType as T}from"../../../../../views/webgl/enums.js";const b=()=>t.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class _{constructor(e,t){this.options=t,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:t.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const t=this.gltf.extras,s=2===t.output.buffer||2===t.output.image;s&&(t.binChunkBuffer=new m(this.gltf)),e.forEachScene(e=>{this._addScene(e)}),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode(e=>{t.nodes||(t.nodes=[]),t.nodes.push(...this._addNodes(e))}),this.gltf.scenes.push(t)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;n(s,c)||(t.translation=l(s));const r=e.rotation;i(r,a)||(t.rotation=o(r));const h=e.scale;n(h,u)||(t.scale=l(h));const f=this.gltf.nodes.length;if(this.gltf.nodes.push(t),e.mesh&&e.mesh.vertexAttributes.position){const s=this._createMeshes(e.mesh),r=[f];if(1===s.length)this._addMesh(t,s[0]);else for(const e of s){const t={};this._addMesh(t,e),r.push(this.gltf.nodes.length),this.gltf.nodes.push(t)}return r}return e.forEachNode(e=>{t.children||(t.children=[]),t.children.push(...this._addNodes(e))}),[f]}_addMesh(e,t){this.gltf.meshes??=[];const s=this.gltf.meshes.length;this.gltf.meshes.push(t),e.mesh=s}_createMeshes(e){const t=this.gltf.extras,s=2===t.output.buffer;let r;r=s?t.binChunkBuffer:new m(this.gltf);const i=this.options.origin,o=e.vertexSpace.clone();o.origin=[i.x,i.y,i.z??0];const a=f({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},o,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!a)return[];p(e,a),M(a);const{position:n,normal:l,tangent:c}=a,{uv:u,color:h}=e.vertexAttributes,d=r.addBufferView(T.FLOAT,"VEC3",34962);let g,x,b,_;l&&(g=r.addBufferView(T.FLOAT,"VEC3",34962)),u&&(x=r.addBufferView(T.FLOAT,"VEC2",34962)),c&&(b=r.addBufferView(T.FLOAT,"VEC4",34962)),h&&(_=r.addBufferView(T.FLOAT,"VEC4",34962)),d.startAccessor("POSITION"),g&&g.startAccessor("NORMAL"),x&&x.startAccessor("TEXCOORD_0"),b&&b.startAccessor("TANGENT"),_&&_.startAccessor("COLOR_0");const A=a.position.length/3;for(let f=0;f<A;++f)d.push(n[3*f]),d.push(n[3*f+1]),d.push(n[3*f+2]),g&&null!=l&&(g.push(l[3*f]),g.push(l[3*f+1]),g.push(l[3*f+2])),x&&null!=u&&(x.push(u[2*f]),x.push(u[2*f+1])),b&&null!=c&&(b.push(c[4*f]),b.push(c[4*f+1]),b.push(c[4*f+2]),b.push(c[4*f+3])),_&&null!=h&&(_.push(w(h[4*f]/255)),_.push(w(h[4*f+1]/255)),_.push(w(h[4*f+2]/255)),_.push(h[4*f+3]/255));const O=d.endAccessor(),v=this._addAccessor(d.index,O);let R,N,C,S,I;if(g){const e=g.endAccessor();R=this._addAccessor(g.index,e)}if(x){const e=x.endAccessor();N=this._addAccessor(x.index,e)}if(b){const e=b.endAccessor();C=this._addAccessor(b.index,e)}if(_){const e=_.endAccessor();S=this._addAccessor(_.index,e)}const y=[];return e.components&&e.components.length>0&&e.components[0].faces?(I=r.addBufferView(T.UNSIGNED_INT,"SCALAR",34963),this._addMeshVertexIndexed(I,e.components,y,v,R,N,C,S)):this._addMeshVertexNonIndexed(e.components,y,v,R,N,C,S),d.finalize(),g?.finalize(),x?.finalize(),b?.finalize(),I?.finalize(),_?.finalize(),s||r.finalize(),y}_addMaterial(e){if(null==e)return;const t=this._materialMap.indexOf(e);if(-1!==t)return t;this.gltf.materials||(this.gltf.materials=[]);const s={};switch(e.alphaMode){case"mask":s.alphaMode="MASK";break;case"auto":case"blend":s.alphaMode="BLEND"}s.alphaCutoff=e.alphaCutoff,e.doubleSided&&(s.doubleSided=e.doubleSided),s.pbrMetallicRoughness={};const r=e=>{const t=e.toRgba();return t[0]=w(t[0]/255),t[1]=w(t[1]/255),t[2]=w(t[2]/255),t};if(null!=e.color&&(s.pbrMetallicRoughness.baseColorFactor=r(e.color)),null!=e.colorTexture&&(s.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),null!=e.normalTexture&&(s.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof h){if(null!=e.emissiveTexture&&(s.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),null!=e.emissiveColor){const t=r(e.emissiveColor);s.emissiveFactor=[t[0],t[1],t[2]]}null!=e.occlusionTexture&&(s.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),null!=e.metallicRoughnessTexture&&(s.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,b().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const i=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),i}_createTextureInfo(e,t){const s={index:this._addTexture(e)};return t?(s.extensions||(s.extensions={}),s.extensions.KHR_texture_transform={scale:t.scale,offset:t.offset,rotation:r(t.rotation)},s):s}_addTexture(e){const t=this.gltf.textures??[];return this.gltf.textures=t,s(this._textureMap,e,()=>{const s={sampler:this._addSampler(e),source:this._addImage(e)},r=t.length;return t.push(s),r})}_addImage(e){const t=this._imageMap.get(e);if(null!=t)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const t=e.data;s.extras=t;for(let e=0;e<this.gltf.images.length;++e)if(t===this.gltf.images[e].extras)return e;const r=this.gltf.extras;switch(r.output.image){case 2:{const e=r.binChunkBuffer.addBufferView(T.UNSIGNED_BYTE,"SCALAR");if(x(t))null!=t.data&&e.writeOutToBuffer(t.data.buffer,0);else{const i=d(t,this.options.signal).then(({data:e,type:t})=>(s.mimeType=t,e));r.promises.push(e.writeAsync(i).then(()=>e.finalize()))}s.bufferView=e.index;break}case 1:if(x(t)){b().warnOnce("Image export for basis compressed textures not available.");break}s.uri=g(t);break;default:if(x(t)){b().warnOnce("Image export for basis compressed textures not available.");break}r.promises.push(d(t,this.options.signal).then(({data:e,type:t})=>{s.uri=e,s.mimeType=t}))}}const r=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,r),r}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=10497,s=10497;if("string"==typeof e.wrap)switch(e.wrap){case"clamp":t=33071,s=33071;break;case"mirror":t=33648,s=33648}else{switch(e.wrap.vertical){case"clamp":s=33071;break;case"mirror":s=33648}switch(e.wrap.horizontal){case"clamp":t=33071;break;case"mirror":t=33648}}const r={wrapS:t,wrapT:s};for(let o=0;o<this.gltf.samplers.length;++o)if(JSON.stringify(r)===JSON.stringify(this.gltf.samplers[o]))return o;const i=this.gltf.samplers.length;return this.gltf.samplers.push(r),i}_addAccessor(e,t){this.gltf.accessors||(this.gltf.accessors=[]);const s={bufferView:e,byteOffset:t.byteOffset,componentType:t.componentType,count:t.count,type:t.type,min:t.min,max:t.max,name:t.name};t.normalized&&(s.normalized=!0);const r=this.gltf.accessors.length;return this.gltf.accessors.push(s),r}_addMeshVertexIndexed(e,t,s,r,i,o,a,n){const l=new Map;for(const c of t){if(e.startAccessor("INDICES"),c.faces)for(let s=0;s<c.faces.length;++s)e.push(c.faces[s]);const t=e.endAccessor(),u={attributes:{POSITION:r},indices:this._addAccessor(e.index,t),material:this._addMaterial(c.material)};i&&"flat"!==c.shading&&(u.attributes.NORMAL=i),o&&(u.attributes.TEXCOORD_0=o),a&&"flat"!==c.shading&&(u.attributes.TANGENT=a),n&&(u.attributes.COLOR_0=n);const h=l.get(c.name);if(h)h.primitives.push(u);else{const e={name:c.name,primitives:[u]};l.set(c.name,e),s.push(e)}}}_addMeshVertexNonIndexed(e,t,s,r,i,o,a){const n={primitives:[]};t.push(n);const l={attributes:{POSITION:s}};r&&(l.attributes.NORMAL=r),i&&(l.attributes.TEXCOORD_0=i),o&&(l.attributes.TANGENT=o),a&&(l.attributes.COLOR_0=a),e&&(l.material=this._addMaterial(e[0].material)),n.primitives.push(l)}}function M({position:e,normal:t,tangent:s}){A(e,3),A(t,3),A(s,4)}function A(e,t){if(null!=e)for(let s=1,r=2;s<e.length;s+=t,r+=t){const t=e[s],i=e[r];e[s]=i,e[r]=-t}}function w(t){return t**e}export{_ as GLTF};
5
+ import{colorGamma as e}from"../../../../../colorUtils.js";import t from"../../../../../core/Logger.js";import{getOrCreateMapValue as s}from"../../../../../core/MapUtils.js";import{deg2rad as r}from"../../../../../core/mathUtils.js";import{exactEquals as i}from"../../../../../core/libs/gl-matrix-2/math/quat.js";import{clone as o,IDENTITY as a}from"../../../../../core/libs/gl-matrix-2/factories/quatf64.js";import{q as n}from"../../../../../chunks/vec32.js";import{ZEROS as l,clone as c,ONES as u}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"../../../MeshMaterialMetallicRoughness.js";import{convertVertexSpace as f}from"../../vertexSpaceConversion.js";import{Buffer as m}from"./buffer.js";import{smoothNormals as p}from"./geometry.js";import{imageToArrayBuffer as d,imageToDataURI as g}from"./imageutils.js";import{isEncodedMeshTexture as x}from"../../../../../views/3d/glTF/internal/resourceUtils.js";import{DataType as T}from"../../../../../views/webgl/enums.js";const b=()=>t.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class _{constructor(e,t){this.options=t,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:t.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const t=this.gltf.extras,s=2===t.output.buffer||2===t.output.image;s&&(t.binChunkBuffer=new m(this.gltf)),e.forEachScene(e=>{this._addScene(e)}),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode(e=>{t.nodes||(t.nodes=[]),t.nodes.push(...this._addNodes(e))}),this.gltf.scenes.push(t)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;n(s,l)||(t.translation=c(s));const r=e.rotation;i(r,a)||(t.rotation=o(r));const h=e.scale;n(h,u)||(t.scale=c(h));const f=this.gltf.nodes.length;if(this.gltf.nodes.push(t),e.mesh&&e.mesh.vertexAttributes.position){const s=this._createMeshes(e.mesh),r=[f];if(1===s.length)this._addMesh(t,s[0]);else for(const e of s){const t={};this._addMesh(t,e),r.push(this.gltf.nodes.length),this.gltf.nodes.push(t)}return r}return e.forEachNode(e=>{t.children||(t.children=[]),t.children.push(...this._addNodes(e))}),[f]}_addMesh(e,t){this.gltf.meshes??=[];const s=this.gltf.meshes.length;this.gltf.meshes.push(t),e.mesh=s}_createMeshes(e){const t=this.gltf.extras,s=2===t.output.buffer;let r;r=s?t.binChunkBuffer:new m(this.gltf);const i=this.options.origin,o=e.vertexSpace.clone();o.origin=[i.x,i.y,i.z??0];const a=f({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},o,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!a)return[];p(e,a),M(a);const{position:n,normal:l,tangent:c}=a,{uv:u,color:h}=e.vertexAttributes,d=r.addBufferView(T.FLOAT,"VEC3",34962);let g,x,b,_;l&&(g=r.addBufferView(T.FLOAT,"VEC3",34962)),u&&(x=r.addBufferView(T.FLOAT,"VEC2",34962)),c&&(b=r.addBufferView(T.FLOAT,"VEC4",34962)),h&&(_=r.addBufferView(T.FLOAT,"VEC4",34962)),d.startAccessor("POSITION"),g&&g.startAccessor("NORMAL"),x&&x.startAccessor("TEXCOORD_0"),b&&b.startAccessor("TANGENT"),_&&_.startAccessor("COLOR_0");const A=a.position.length/3;for(let f=0;f<A;++f)d.push(n[3*f]),d.push(n[3*f+1]),d.push(n[3*f+2]),g&&null!=l&&(g.push(l[3*f]),g.push(l[3*f+1]),g.push(l[3*f+2])),x&&null!=u&&(x.push(u[2*f]),x.push(u[2*f+1])),b&&null!=c&&(b.push(c[4*f]),b.push(c[4*f+1]),b.push(c[4*f+2]),b.push(c[4*f+3])),_&&null!=h&&(_.push(w(h[4*f]/255)),_.push(w(h[4*f+1]/255)),_.push(w(h[4*f+2]/255)),_.push(h[4*f+3]/255));const O=d.endAccessor(),v=this._addAccessor(d.index,O);let R,N,C,S,I;if(g){const e=g.endAccessor();R=this._addAccessor(g.index,e)}if(x){const e=x.endAccessor();N=this._addAccessor(x.index,e)}if(b){const e=b.endAccessor();C=this._addAccessor(b.index,e)}if(_){const e=_.endAccessor();S=this._addAccessor(_.index,e)}const y=[];return e.components&&e.components.length>0&&e.components[0].faces?(I=r.addBufferView(T.UNSIGNED_INT,"SCALAR",34963),this._addMeshVertexIndexed(I,e.components,y,v,R,N,C,S)):this._addMeshVertexNonIndexed(e.components,y,v,R,N,C,S),d.finalize(),g?.finalize(),x?.finalize(),b?.finalize(),I?.finalize(),_?.finalize(),s||r.finalize(),y}_addMaterial(e){if(null==e)return;const t=this._materialMap.indexOf(e);if(-1!==t)return t;this.gltf.materials||(this.gltf.materials=[]);const s={};switch(e.alphaMode){case"mask":s.alphaMode="MASK";break;case"auto":case"blend":s.alphaMode="BLEND"}s.alphaCutoff=e.alphaCutoff,e.doubleSided&&(s.doubleSided=e.doubleSided),s.pbrMetallicRoughness={};const r=e=>{const t=e.toRgba();return t[0]=w(t[0]/255),t[1]=w(t[1]/255),t[2]=w(t[2]/255),t};if(null!=e.color&&(s.pbrMetallicRoughness.baseColorFactor=r(e.color)),null!=e.colorTexture&&(s.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),null!=e.normalTexture&&(s.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof h){if(null!=e.emissiveTexture&&(s.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),null!=e.emissiveColor){const t=r(e.emissiveColor);s.emissiveFactor=[t[0],t[1],t[2]]}null!=e.occlusionTexture&&(s.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),null!=e.metallicRoughnessTexture&&(s.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,b().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const i=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),i}_createTextureInfo(e,t){const s={index:this._addTexture(e)};return t?(s.extensions||(s.extensions={}),s.extensions.KHR_texture_transform={scale:t.scale,offset:t.offset,rotation:r(t.rotation)},s):s}_addTexture(e){const t=this.gltf.textures??[];return this.gltf.textures=t,s(this._textureMap,e,()=>{const s={sampler:this._addSampler(e),source:this._addImage(e)},r=t.length;return t.push(s),r})}_addImage(e){const t=this._imageMap.get(e);if(null!=t)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const t=e.data;s.extras=t;for(let e=0;e<this.gltf.images.length;++e)if(t===this.gltf.images[e].extras)return e;const r=this.gltf.extras;switch(r.output.image){case 2:{const e=r.binChunkBuffer.addBufferView(T.UNSIGNED_BYTE,"SCALAR");if(x(t))null!=t.data&&e.writeOutToBuffer(t.data.buffer,0);else{const i=d(t,this.options.signal).then(({data:e,type:t})=>(s.mimeType=t,e));r.promises.push(e.writeAsync(i).then(()=>e.finalize()))}s.bufferView=e.index;break}case 1:if(x(t)){b().warnOnce("Image export for basis compressed textures not available.");break}s.uri=g(t);break;default:if(x(t)){b().warnOnce("Image export for basis compressed textures not available.");break}r.promises.push(d(t,this.options.signal).then(({data:e,type:t})=>{s.uri=e,s.mimeType=t}))}}const r=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,r),r}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=10497,s=10497;if("string"==typeof e.wrap)switch(e.wrap){case"clamp":t=33071,s=33071;break;case"mirror":t=33648,s=33648}else{switch(e.wrap.vertical){case"clamp":s=33071;break;case"mirror":s=33648}switch(e.wrap.horizontal){case"clamp":t=33071;break;case"mirror":t=33648}}const r={wrapS:t,wrapT:s};for(let o=0;o<this.gltf.samplers.length;++o)if(JSON.stringify(r)===JSON.stringify(this.gltf.samplers[o]))return o;const i=this.gltf.samplers.length;return this.gltf.samplers.push(r),i}_addAccessor(e,t){this.gltf.accessors||(this.gltf.accessors=[]);const s={bufferView:e,byteOffset:t.byteOffset,componentType:t.componentType,count:t.count,type:t.type,min:t.min,max:t.max,name:t.name};t.normalized&&(s.normalized=!0);const r=this.gltf.accessors.length;return this.gltf.accessors.push(s),r}_addMeshVertexIndexed(e,t,s,r,i,o,a,n){const l=new Map;for(const c of t){if(e.startAccessor("INDICES"),c.faces)for(let s=0;s<c.faces.length;++s)e.push(c.faces[s]);const t=e.endAccessor(),u={attributes:{POSITION:r},indices:this._addAccessor(e.index,t),material:this._addMaterial(c.material)};i&&"flat"!==c.shading&&(u.attributes.NORMAL=i),o&&(u.attributes.TEXCOORD_0=o),a&&"flat"!==c.shading&&(u.attributes.TANGENT=a),n&&(u.attributes.COLOR_0=n);const h=l.get(c.name);if(h)h.primitives.push(u);else{const e={name:c.name,primitives:[u]};l.set(c.name,e),s.push(e)}}}_addMeshVertexNonIndexed(e,t,s,r,i,o,a){const n={primitives:[]};t.push(n);const l={attributes:{POSITION:s}};r&&(l.attributes.NORMAL=r),i&&(l.attributes.TEXCOORD_0=i),o&&(l.attributes.TANGENT=o),a&&(l.attributes.COLOR_0=a),e&&(l.material=this._addMaterial(e[0].material)),n.primitives.push(l)}}function M({position:e,normal:t,tangent:s}){A(e,3),A(t,3),A(s,4)}function A(e,t){if(null!=e)for(let s=1,r=2;s<e.length;s+=t,r+=t){const t=e[s],i=e[r];e[s]=i,e[r]=-t}}function w(t){return t**e}export{_ as GLTF};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../core/Logger.js";import{fromMat4 as e}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromRotationTranslationScaleOrigin as o,multiply as i,getScale as n,scale as s,getTranslation as a,fromRotation as l}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxisAngle as m}from"../../../core/libs/gl-matrix-2/math/quat.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{j as p,r as g,o as u,t as x}from"../../../chunks/vec32.js";import{create as j,ZEROS as v,ONES as b}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import A from"../../Point.js";import{getSphericalPCPF as h}from"../../spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as R}from"../../projection/computeTranslationToOriginAndRotation.js";import{projectPointToVector as d}from"../../projection/projectPointToVector.js";import{angleRad as y,axis as w,fromMatrix as F,create as S}from"../axisAngleDegrees.js";import T from"../MeshTransform.js";import{isMeshWithRelativeVertexSpace as U}from"../meshVertexSpaceUtils.js";import{performGlobalOperation as q}from"./geographicUtils.js";import{logProjectionError as C,projectToPCPF as k,projectNormalToPCPF as z,projectTangentToPCPF as L,projectFromPCPF as M,projectNormalFromPCPF as P,projectTangentFromPCPF as V,loadProjectErrorMessage as D}from"./projection.js";import{projectPointToVertexSpace as E}from"./vertexSpaceConversion.js";const O=()=>t.getLogger("esri.geometry.support.meshUtils.rotate");function B(t,e,r){if(!t.vertexAttributes?.position||0===e[3])return;const{spatialReference:o,vertexSpace:i}=t,n=r?.origin??t.origin,s=r?.geographic,a=q(O,i,o,s);U(t)?G(t,e,n):a?H(t,e,n):I(t,e,n)}function G(t,e,r){t.transform??=new T;const{vertexSpace:l,transform:c,spatialReference:f}=t,[u,x,h]=l.origin,R=new A({x:u,y:x,z:h,spatialReference:f}),d=K;if(R.equals(r))p(d,0,0,0);else if(!E(d,r,t))return void C(O(),r.spatialReference,f,D);m(Z,w(e),y(e));const S=o(N,Z,v,b,d),{localMatrix:U}=c,q=i(N,S,U);c.scale=n(j(),q),s(q,q,g(K,c.scale));const k=c.rotationAxis;c.rotation=F(q),0===c.rotationAngle&&(c.rotationAxis=k),c.translation=a(j(),q)}function H(t,r,o){const i=t.spatialReference,n=h(i),s=Y;if(!d(o,s,n)&&(C(O(),o.spatialReference,n,"Falling back to mesh origin"),!d(t.origin,s,n)))return void C(O(),t.origin.spatialReference,n);const a=t.vertexAttributes.position,l=t.vertexAttributes.normal,c=t.vertexAttributes.tangent,m=new Float64Array(a.length),f=null!=l?new Float32Array(l.length):null,p=null!=c?new Float32Array(c.length):null;R(n,s,W,n),e(X,W);const g=Q;u(w(Q),w(r),X),g[3]=r[3],k(a,i,m,n)&&(null==l||null==f||z(l,a,i,m,n,f))&&(null==c||null==p||L(c,a,i,m,n,p))?(J(m,g,3,s),M(m,n,a,i)&&(null==l||null==f||(J(f,g,3),P(f,a,i,m,n,l)))&&(null==c||null==p||(J(p,g,4),V(p,a,i,m,n,c)))?t.vertexAttributesChanged():C(O(),n,i)):C(O(),i,n)}function I(t,e,r){const o=Y;if(!d(r,o,t.spatialReference)){const e=t.origin;return o[0]=e.x,o[1]=e.y,o[2]=e.z,void C(O(),r.spatialReference,t.spatialReference,D)}J(t.vertexAttributes.position,e,3,o),J(t.vertexAttributes.normal,e,3),J(t.vertexAttributes.tangent,e,4),t.vertexAttributesChanged()}function J(t,e,r,o=v){if(null!=t){l(W,y(e),w(e));for(let e=0;e<t.length;e+=r){for(let r=0;r<3;r++)K[r]=t[e+r]-o[r];x(K,K,W);for(let r=0;r<3;r++)t[e+r]=K[r]+o[r]}}}const K=j(),N=c(),Q=S(),W=c(),X=r(),Y=j(),Z=f();export{B as rotate};
5
+ import t from"../../../core/Logger.js";import{fromMat4 as e}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromRotationTranslationScaleOrigin as o,multiply as i,getScale as n,scale as s,getTranslation as a,fromRotation as l}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{setAxisAngle as m}from"../../../core/libs/gl-matrix-2/math/quat.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{j as p,r as g,o as u,t as x}from"../../../chunks/vec32.js";import{create as j,ZEROS as v,ONES as b}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import A from"../../Point.js";import{getSphericalPCPF as h}from"../../spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as R}from"../../projection/computeTranslationToOriginAndRotation.js";import{projectPointToVector as d}from"../../projection/projectPointToVector.js";import{angleRad as y,axis as w,fromMatrix as F,create as S}from"../axisAngleDegrees.js";import T from"../MeshTransform.js";import{isMeshWithRelativeVertexSpace as U}from"../meshVertexSpaceUtils.js";import{performGlobalOperation as q}from"./geographicUtils.js";import{logProjectionError as C,loadProjectErrorMessage as k,projectToPCPF as z,projectNormalToPCPF as L,projectTangentToPCPF as M,projectFromPCPF as P,projectNormalFromPCPF as V,projectTangentFromPCPF as D}from"./projection.js";import{projectPointToVertexSpace as E}from"./vertexSpaceConversion.js";const O=()=>t.getLogger("esri.geometry.support.meshUtils.rotate");function B(t,e,r){if(!t.vertexAttributes?.position||0===e[3])return;const{spatialReference:o,vertexSpace:i}=t,n=r?.origin??t.origin,s=r?.geographic,a=q(O,i,o,s);U(t)?G(t,e,n):a?H(t,e,n):I(t,e,n)}function G(t,e,r){t.transform??=new T;const{vertexSpace:l,transform:c,spatialReference:f}=t,[u,x,h]=l.origin,R=new A({x:u,y:x,z:h,spatialReference:f}),d=K;if(R.equals(r))p(d,0,0,0);else if(!E(d,r,t))return void C(O(),r.spatialReference,f,k);m(Z,w(e),y(e));const S=o(N,Z,v,b,d),{localMatrix:U}=c,q=i(N,S,U);c.scale=n(j(),q),s(q,q,g(K,c.scale));const z=c.rotationAxis;c.rotation=F(q),0===c.rotationAngle&&(c.rotationAxis=z),c.translation=a(j(),q)}function H(t,r,o){const i=t.spatialReference,n=h(i),s=Y;if(!d(o,s,n)&&(C(O(),o.spatialReference,n,"Falling back to mesh origin"),!d(t.origin,s,n)))return void C(O(),t.origin.spatialReference,n);const a=t.vertexAttributes.position,l=t.vertexAttributes.normal,c=t.vertexAttributes.tangent,m=new Float64Array(a.length),f=null!=l?new Float32Array(l.length):null,p=null!=c?new Float32Array(c.length):null;R(n,s,W,n),e(X,W);const g=Q;u(w(Q),w(r),X),g[3]=r[3],z(a,i,m,n)&&(null==l||null==f||L(l,a,i,m,n,f))&&(null==c||null==p||M(c,a,i,m,n,p))?(J(m,g,3,s),P(m,n,a,i)&&(null==l||null==f||(J(f,g,3),V(f,a,i,m,n,l)))&&(null==c||null==p||(J(p,g,4),D(p,a,i,m,n,c)))?t.vertexAttributesChanged():C(O(),n,i)):C(O(),i,n)}function I(t,e,r){const o=Y;if(!d(r,o,t.spatialReference)){const e=t.origin;return o[0]=e.x,o[1]=e.y,o[2]=e.z,void C(O(),r.spatialReference,t.spatialReference,k)}J(t.vertexAttributes.position,e,3,o),J(t.vertexAttributes.normal,e,3),J(t.vertexAttributes.tangent,e,4),t.vertexAttributesChanged()}function J(t,e,r,o=v){if(null!=t){l(W,y(e),w(e));for(let e=0;e<t.length;e+=r){for(let r=0;r<3;r++)K[r]=t[e+r]-o[r];x(K,K,W);for(let r=0;r<3;r++)t[e+r]=K[r]+o[r]}}}const K=j(),N=c(),Q=S(),W=c(),X=r(),Y=j(),Z=f();export{B as rotate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Logger.js";import{fromRotationTranslationScaleOrigin as t,multiply as r,getScale as o,scale as i,getTranslation as n}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{IDENTITY as a}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{j as l,r as c,h as f}from"../../../chunks/vec32.js";import{ZEROS as m,create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import g from"../../Point.js";import{getSphericalPCPF as u}from"../../spatialReferenceEllipsoidUtils.js";import{projectPointToVector as x}from"../../projection/projectPointToVector.js";import{fromMatrix as j}from"../axisAngleDegrees.js";import v from"../MeshTransform.js";import{isMeshWithRelativeVertexSpace as h}from"../meshVertexSpaceUtils.js";import{performGlobalOperation as A}from"./geographicUtils.js";import{logProjectionError as b,projectToPCPF as R,projectNormalToPCPF as d,projectTangentToPCPF as y,projectFromPCPF as w,projectNormalFromPCPF as F,projectTangentFromPCPF as S,loadProjectErrorMessage as U}from"./projection.js";import{projectPointToVertexSpace as C}from"./vertexSpaceConversion.js";const k=()=>e.getLogger("esri.geometry.support.meshUtils.scale");function q(e,t,r){if(!e.vertexAttributes?.position)return;const{vertexSpace:o,spatialReference:i}=e,n=r?.origin??e.origin,s=r?.geographic,a=A(k,o,i,s);h(e)?z(e,t,n):a?L(e,t,n):M(e,t,n)}function z(e,s,f){e.transform??=new v;const{vertexSpace:u,transform:x,spatialReference:h}=e,[A,R,d]=u.origin,y=new g({x:A,y:R,z:d,spatialReference:h}),w=T;if(y.equals(f))l(w,0,0,0);else if(!C(w,f,e))return void b(k(),f.spatialReference,h,U);const F=l(V,s,s,s),S=t(D,a,m,F,w),{localMatrix:q}=x,z=r(D,S,q);x.scale=o(p(),z),i(z,z,c(T,x.scale));const L=x.rotationAxis;x.rotation=j(z),0===x.rotationAngle&&(x.rotationAxis=L),x.translation=n(p(),z)}function L(e,t,r){const o=e.spatialReference,i=u(o),n=E;if(!x(r,n,i)&&(b(k(),r.spatialReference,i,"Falling back to mesh origin"),!x(e.origin,n,i)))return void b(k(),e.origin.spatialReference,i);const s=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,c=new Float64Array(s.length),f=null!=a?new Float32Array(a.length):null,m=null!=l?new Float32Array(l.length):null;R(s,o,c,i)&&(null==a||null==f||d(a,s,o,c,i,f))&&(null==l||null==m||y(l,s,o,c,i,m))?(P(c,t,n),w(c,i,s,o)&&(null==a||null==f||F(f,s,o,c,i,a))&&(null==l||null==m||S(m,s,o,c,i,l))?e.vertexAttributesChanged():b(k(),i,o)):b(k(),o,i)}function M(e,t,r){const o=E;if(!x(r,o,e.spatialReference)){const t=e.origin;return o[0]=t.x,o[1]=t.y,o[2]=t.z,void b(k(),r.spatialReference,e.spatialReference,U)}P(e.vertexAttributes.position,t,o),e.vertexAttributesChanged()}function P(e,t,r=m){if(e)for(let o=0;o<e.length;o+=3){for(let t=0;t<3;t++)T[t]=e[o+t]-r[t];f(T,T,t);for(let t=0;t<3;t++)e[o+t]=T[t]+r[t]}}const T=p(),V=p(),D=s(),E=p();export{q as scale};
5
+ import e from"../../../core/Logger.js";import{fromRotationTranslationScaleOrigin as t,multiply as r,getScale as o,scale as i,getTranslation as n}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{IDENTITY as a}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{j as l,r as c,h as f}from"../../../chunks/vec32.js";import{create as m,ZEROS as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import g from"../../Point.js";import{getSphericalPCPF as u}from"../../spatialReferenceEllipsoidUtils.js";import{projectPointToVector as x}from"../../projection/projectPointToVector.js";import{fromMatrix as j}from"../axisAngleDegrees.js";import v from"../MeshTransform.js";import{isMeshWithRelativeVertexSpace as h}from"../meshVertexSpaceUtils.js";import{performGlobalOperation as A}from"./geographicUtils.js";import{logProjectionError as b,loadProjectErrorMessage as R,projectToPCPF as d,projectNormalToPCPF as y,projectTangentToPCPF as w,projectFromPCPF as F,projectNormalFromPCPF as S,projectTangentFromPCPF as U}from"./projection.js";import{projectPointToVertexSpace as C}from"./vertexSpaceConversion.js";const k=()=>e.getLogger("esri.geometry.support.meshUtils.scale");function q(e,t,r){if(!e.vertexAttributes?.position)return;const{vertexSpace:o,spatialReference:i}=e,n=r?.origin??e.origin,s=r?.geographic,a=A(k,o,i,s);h(e)?z(e,t,n):a?L(e,t,n):M(e,t,n)}function z(e,s,f){e.transform??=new v;const{vertexSpace:u,transform:x,spatialReference:h}=e,[A,d,y]=u.origin,w=new g({x:A,y:d,z:y,spatialReference:h}),F=T;if(w.equals(f))l(F,0,0,0);else if(!C(F,f,e))return void b(k(),f.spatialReference,h,R);const S=l(V,s,s,s),U=t(D,a,p,S,F),{localMatrix:q}=x,z=r(D,U,q);x.scale=o(m(),z),i(z,z,c(T,x.scale));const L=x.rotationAxis;x.rotation=j(z),0===x.rotationAngle&&(x.rotationAxis=L),x.translation=n(m(),z)}function L(e,t,r){const o=e.spatialReference,i=u(o),n=E;if(!x(r,n,i)&&(b(k(),r.spatialReference,i,"Falling back to mesh origin"),!x(e.origin,n,i)))return void b(k(),e.origin.spatialReference,i);const s=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,c=new Float64Array(s.length),f=null!=a?new Float32Array(a.length):null,m=null!=l?new Float32Array(l.length):null;d(s,o,c,i)&&(null==a||null==f||y(a,s,o,c,i,f))&&(null==l||null==m||w(l,s,o,c,i,m))?(P(c,t,n),F(c,i,s,o)&&(null==a||null==f||S(f,s,o,c,i,a))&&(null==l||null==m||U(m,s,o,c,i,l))?e.vertexAttributesChanged():b(k(),i,o)):b(k(),o,i)}function M(e,t,r){const o=E;if(!x(r,o,e.spatialReference)){const t=e.origin;return o[0]=t.x,o[1]=t.y,o[2]=t.z,void b(k(),r.spatialReference,e.spatialReference,R)}P(e.vertexAttributes.position,t,o),e.vertexAttributesChanged()}function P(e,t,r=p){if(e)for(let o=0;o<e.length;o+=3){for(let t=0;t<3;t++)T[t]=e[o+t]-r[t];f(T,T,t);for(let t=0;t<3;t++)e[o+t]=T[t]+r[t]}}const T=m(),V=m(),D=s(),E=m();export{q as scale};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../core/Logger.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{getMetersPerCartesianUnitForSR as r,convertUnit as e}from"../../../core/unitUtils.js";import{normalFromMat4 as o}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{exactEquals as l,scale as a,invert as s,copy as c,multiply as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f,IDENTITY as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{u as p,e as g,t as x}from"../../../chunks/vec32.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getSphericalPCPF as v,WGS84ECEFSpatialReference as j}from"../../spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as A}from"../../projection/computeTranslationToOriginAndRotation.js";import{projectPointToVector as w}from"../../projection/projectPointToVector.js";import{isRelativeVertexSpace as y,vertexSpaceEquals as F}from"../meshVertexSpaceUtils.js";import{isEarth as b}from"../spatialReferenceUtils.js";import{a as R,t as d,b as S}from"../../../chunks/vec3.js";import{logProjectionError as U,projectToPCPF as M,projectNormalToPCPF as T,projectTangentToPCPF as k,transformNormal as B,transformTangent as E,projectFromPCPF as L,projectNormalFromPCPF as V,projectTangentFromPCPF as C}from"./projection.js";const O=()=>t.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function P(t,n,{vertexSpace:r,spatialReference:e}){if("georeferenced"===r.type){const o=t;if(!w(n,o,e))return!1;const{origin:i}=r;return g(t,o,i),!0}const o=v(e),i=t;if(!w(n,i,o))return!1;const{origin:l}=r,a=lt;if(!A(e,l,a,o))return!1;const c=s(lt,a);return null!=c&&(x(t,i,c),!0)}function q(t,n,r){const{vertexSpace:e,transform:o,vertexAttributes:i}=t,a=y(e)?o:null,s=Y(t.spatialReference,r,3);if(F(e,n)&&(!a||l(a.localMatrix,m))&&Z(s)){const{position:t,normal:n,tangent:e}=i,o=r?.allowBufferReuse;return{position:o?t:t.slice(),normal:o?n:n?.slice(),tangent:o?e:e?.slice()}}switch(t.vertexSpace.type){case"local":return"local"===n.type?J(t,t.vertexSpace,n.origin,r):G(t,t.vertexSpace,n.origin,r);case"georeferenced":return"local"===n.type?H(t,t.vertexSpace,n.origin,r):z(t,t.vertexSpace,n.origin,r)}}function z({vertexAttributes:t,transform:n,spatialReference:r},{origin:e},o,i){const l=Y(r,i,3),a=e||!Z(l)?c(rt,n?.localMatrix??m):null;a&&X(a,r,i,3);const{position:s,normal:u,tangent:f}=a?K(t,a):t,g=i?.allowBufferReuse,x=g?s:new Float64Array(s.length);let h=s;if(e&&(h=R(x,h,e)),o){const t=p(it,o);h=R(x,h,t)}return{position:h!==t.position||g?h:h.slice(),normal:u!==t.normal||g?u:u?.slice(),tangent:f!==t.tangent||g?f:f?.slice()}}function D(t,n){return n?.useEllipsoid&&b(t)?j:v(t)}function G({spatialReference:t,vertexAttributes:n,transform:r},{origin:e},o,i){const l=D(t,i);if(!A(t,e,rt,l))return U(O(),t,l),null;r&&u(rt,rt,r.localMatrix),X(rt,t,i,1);const a=new Float64Array(n.position.length),s=N(n.position,rt,t,a,l);if(!s)return null;const c=Q(s,t,a,l,n.normal,rt);if(n.normal&&!c)return null;const f=W(s,t,a,l,n.tangent,rt);if(n.tangent&&!f)return null;if(o){const t=p(it,o);R(s,s,t)}return{position:s,normal:c,tangent:f}}function H({vertexAttributes:t,spatialReference:n,transform:r},{origin:e},i,l){const c=D(n,l);if(!A(n,i,rt,c))return U(O(),n,c),null;const u=1/Y(n,l,2);a(rt,rt,[u,u,u]);const f=s(et,rt),{position:m,normal:p,tangent:g}=I(t,e,r),x=new Float64Array(m.length),h=$(m,n,f,x,c);if(!h)return null;const v=o(ot,f),j=_(p,m,n,x,c,v,p!==t.normal?p:void 0);if(!j&&p)return null;const w=tt(g,m,n,x,c,v,g!==t.tangent?g:void 0);return!w&&g?null:{position:h,normal:j,tangent:w}}function I(t,n,r){if(!n)return t;if(!r){const{position:r,normal:e,tangent:o}=t;return{position:R(new Float64Array(r.length),r,n),tangent:o,normal:e}}const e=K(t,r.localMatrix);return R(e.position,e.position,n),e}function J({vertexAttributes:t,spatialReference:n,transform:r},{origin:e},o,i){const l=D(n,i);if(!A(n,e,rt,l))return U(O(),n,l),null;if(r&&u(rt,rt,r.localMatrix),!A(n,o,et,l))return U(O(),l,n),null;s(et,et);const a=u(rt,et,rt);return X(a,n,i,3),K(t,a)}function K(t,n){const r=new Float64Array(t.position.length);d(r,t.position,n);const e=t.normal?new Float32Array(t.normal.length):null,o=t.tangent?new Float32Array(t.tangent.length):null;return e&&t.normal&&B(t.normal,e,n),o&&t.tangent&&E(t.tangent,o,n),{position:r,normal:e,tangent:o}}function N(t,n,r,e,o){d(e,t,n);const i=new Float64Array(t.length);return L(e,o,i,r)?i:(U(O(),o,r),null)}function Q(t,n,r,e,o,i){if(null==o)return null;const l=new Float32Array(o.length);return B(o,l,i),V(l,t,n,r,e,l)?l:(U(O(),e,n),null)}function W(t,n,r,e,o,i){if(null==o)return null;const l=new Float32Array(o.length);return E(o,l,i),C(l,t,n,r,e,l)?l:(U(O(),e,n),null)}function X(t,n,r,e){const o=Y(n,r,e);Z(o)||a(t,t,[o,o,o])}function Y(t,n,r){const e=!!(1&r),o=!!(2&r),i=n?.sourceUnit,l=n?.targetUnit;if(!i&&!l)return 1;let a=nt(i,t);e||!i||Z(a)||(O().warn("source unit conversion not supported"),a=1);let s=1/nt(l,t);return o||!l||Z(s)||(O().warn("target unit conversion not supported"),s=1),a*s}function Z(t){return n(t,1)}function $(t,n,r,e,o){const i=M(t,n,e,o);if(!i)return U(O(),n,o),null;const l=new Float64Array(i.length);return d(l,i,r),l}function _(t,n,r,e,o,i,l){if(null==t)return null;const a=l??new Float32Array(t.length);return T(t,n,r,e,o,a)?(S(a,a,i),a):(U(O(),r,o),null)}function tt(t,n,r,e,o,i,l){if(null==t)return null;const a=l??new Float32Array(t.length);return k(t,n,r,e,o,a)?(S(a,a,i,4),a):(U(O(),r,o),null)}function nt(t,n){if(null==t)return 1;const o=r(n);return 1/e(o,"meters",t)}const rt=f(),et=f(),ot=i(),it=h(),lt=f();export{q as convertVertexSpace,nt as getUnitToSpatialReferenceScaleConversion,P as projectPointToVertexSpace};
5
+ import t from"../../../core/Logger.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{getMetersPerCartesianUnitForSR as r,convertUnit as e}from"../../../core/unitUtils.js";import{normalFromMat4 as o}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{exactEquals as l,scale as a,invert as s,copy as c,multiply as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f,IDENTITY as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{u as p,e as g,t as x}from"../../../chunks/vec32.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{WGS84ECEFSpatialReference as v,getSphericalPCPF as j}from"../../spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as A}from"../../projection/computeTranslationToOriginAndRotation.js";import{projectPointToVector as w}from"../../projection/projectPointToVector.js";import{isRelativeVertexSpace as y,vertexSpaceEquals as F}from"../meshVertexSpaceUtils.js";import{isEarth as b}from"../spatialReferenceUtils.js";import{a as R,t as d,b as S}from"../../../chunks/vec3.js";import{logProjectionError as U,projectToPCPF as M,projectNormalToPCPF as T,projectTangentToPCPF as k,transformNormal as B,transformTangent as E,projectFromPCPF as L,projectNormalFromPCPF as V,projectTangentFromPCPF as C}from"./projection.js";const O=()=>t.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function P(t,n,{vertexSpace:r,spatialReference:e}){if("georeferenced"===r.type){const o=t;if(!w(n,o,e))return!1;const{origin:i}=r;return g(t,o,i),!0}const o=j(e),i=t;if(!w(n,i,o))return!1;const{origin:l}=r,a=lt;if(!A(e,l,a,o))return!1;const c=s(lt,a);return null!=c&&(x(t,i,c),!0)}function q(t,n,r){const{vertexSpace:e,transform:o,vertexAttributes:i}=t,a=y(e)?o:null,s=Y(t.spatialReference,r,3);if(F(e,n)&&(!a||l(a.localMatrix,m))&&Z(s)){const{position:t,normal:n,tangent:e}=i,o=r?.allowBufferReuse;return{position:o?t:t.slice(),normal:o?n:n?.slice(),tangent:o?e:e?.slice()}}switch(t.vertexSpace.type){case"local":return"local"===n.type?J(t,t.vertexSpace,n.origin,r):G(t,t.vertexSpace,n.origin,r);case"georeferenced":return"local"===n.type?H(t,t.vertexSpace,n.origin,r):z(t,t.vertexSpace,n.origin,r)}}function z({vertexAttributes:t,transform:n,spatialReference:r},{origin:e},o,i){const l=Y(r,i,3),a=e||!Z(l)?c(rt,n?.localMatrix??m):null;a&&X(a,r,i,3);const{position:s,normal:u,tangent:f}=a?K(t,a):t,g=i?.allowBufferReuse,x=g?s:new Float64Array(s.length);let h=s;if(e&&(h=R(x,h,e)),o){const t=p(it,o);h=R(x,h,t)}return{position:h!==t.position||g?h:h.slice(),normal:u!==t.normal||g?u:u?.slice(),tangent:f!==t.tangent||g?f:f?.slice()}}function D(t,n){return n?.useEllipsoid&&b(t)?v:j(t)}function G({spatialReference:t,vertexAttributes:n,transform:r},{origin:e},o,i){const l=D(t,i);if(!A(t,e,rt,l))return U(O(),t,l),null;r&&u(rt,rt,r.localMatrix),X(rt,t,i,1);const a=new Float64Array(n.position.length),s=N(n.position,rt,t,a,l);if(!s)return null;const c=Q(s,t,a,l,n.normal,rt);if(n.normal&&!c)return null;const f=W(s,t,a,l,n.tangent,rt);if(n.tangent&&!f)return null;if(o){const t=p(it,o);R(s,s,t)}return{position:s,normal:c,tangent:f}}function H({vertexAttributes:t,spatialReference:n,transform:r},{origin:e},i,l){const c=D(n,l);if(!A(n,i,rt,c))return U(O(),n,c),null;const u=1/Y(n,l,2);a(rt,rt,[u,u,u]);const f=s(et,rt),{position:m,normal:p,tangent:g}=I(t,e,r),x=new Float64Array(m.length),h=$(m,n,f,x,c);if(!h)return null;const v=o(ot,f),j=_(p,m,n,x,c,v,p!==t.normal?p:void 0);if(!j&&p)return null;const w=tt(g,m,n,x,c,v,g!==t.tangent?g:void 0);return!w&&g?null:{position:h,normal:j,tangent:w}}function I(t,n,r){if(!n)return t;if(!r){const{position:r,normal:e,tangent:o}=t;return{position:R(new Float64Array(r.length),r,n),tangent:o,normal:e}}const e=K(t,r.localMatrix);return R(e.position,e.position,n),e}function J({vertexAttributes:t,spatialReference:n,transform:r},{origin:e},o,i){const l=D(n,i);if(!A(n,e,rt,l))return U(O(),n,l),null;if(r&&u(rt,rt,r.localMatrix),!A(n,o,et,l))return U(O(),l,n),null;s(et,et);const a=u(rt,et,rt);return X(a,n,i,3),K(t,a)}function K(t,n){const r=new Float64Array(t.position.length);d(r,t.position,n);const e=t.normal?new Float32Array(t.normal.length):null,o=t.tangent?new Float32Array(t.tangent.length):null;return e&&t.normal&&B(t.normal,e,n),o&&t.tangent&&E(t.tangent,o,n),{position:r,normal:e,tangent:o}}function N(t,n,r,e,o){d(e,t,n);const i=new Float64Array(t.length);return L(e,o,i,r)?i:(U(O(),o,r),null)}function Q(t,n,r,e,o,i){if(null==o)return null;const l=new Float32Array(o.length);return B(o,l,i),V(l,t,n,r,e,l)?l:(U(O(),e,n),null)}function W(t,n,r,e,o,i){if(null==o)return null;const l=new Float32Array(o.length);return E(o,l,i),C(l,t,n,r,e,l)?l:(U(O(),e,n),null)}function X(t,n,r,e){const o=Y(n,r,e);Z(o)||a(t,t,[o,o,o])}function Y(t,n,r){const e=!!(1&r),o=!!(2&r),i=n?.sourceUnit,l=n?.targetUnit;if(!i&&!l)return 1;let a=nt(i,t);e||!i||Z(a)||(O().warn("source unit conversion not supported"),a=1);let s=1/nt(l,t);return o||!l||Z(s)||(O().warn("target unit conversion not supported"),s=1),a*s}function Z(t){return n(t,1)}function $(t,n,r,e,o){const i=M(t,n,e,o);if(!i)return U(O(),n,o),null;const l=new Float64Array(i.length);return d(l,i,r),l}function _(t,n,r,e,o,i,l){if(null==t)return null;const a=l??new Float32Array(t.length);return T(t,n,r,e,o,a)?(S(a,a,i),a):(U(O(),r,o),null)}function tt(t,n,r,e,o,i,l){if(null==t)return null;const a=l??new Float32Array(t.length);return k(t,n,r,e,o,a)?(S(a,a,i,4),a):(U(O(),r,o),null)}function nt(t,n){if(null==t)return 1;const o=r(n);return 1/e(o,"meters",t)}const rt=f(),et=f(),ot=i(),it=h(),lt=f();export{q as convertVertexSpace,nt as getUnitToSpatialReferenceScaleConversion,P as projectPointToVertexSpace};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../core/mathUtils.js";import{f as n,g as r,h as o,q as e,e as c,n as u,i,j as s,d as f}from"../../chunks/vec32.js";import{create as a}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as m,e as g}from"../../chunks/vec42.js";import{projectPointSignedLength as h}from"./vector.js";import{sv4d as l,sv3d as p}from"./vectorStacks.js";import{tangentFrame as M}from"../../views/3d/support/mathUtils.js";function j(t=$){return[t[0],t[1],t[2],t[3]]}const v=m,b=g;function d(t=$[0],n=$[1],r=$[2],o=$[3]){return q(t,n,r,o,l.get())}function y(t,n){return q(n[0],n[1],n[2],n[3],t)}function k(t){return t}function q(t,n,r,o,e=j()){return e[0]=t,e[1]=n,e[2]=r,e[3]=o,e}function x(t,n,r){return f(r,t),r[3]=n,r}function U(t,n,r){const o=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],e=Math.abs(o-1)>1e-5&&o>1e-12?1/Math.sqrt(o):1;return r[0]=n[0]*e,r[1]=n[1]*e,r[2]=n[2]*e,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2]),r}function w(t,n,r,o=j()){const e=r[0]-n[0],c=r[1]-n[1],u=r[2]-n[2],i=t[0]-n[0],s=t[1]-n[1],f=t[2]-n[2],a=c*f-u*s,m=u*i-e*f,g=e*s-c*i,h=a*a+m*m+g*g,l=Math.abs(h-1)>1e-5&&h>1e-12?1/Math.sqrt(h):1;return o[0]=a*l,o[1]=m*l,o[2]=g*l,o[3]=-(o[0]*t[0]+o[1]*t[1]+o[2]*t[2]),o}function S(t,r,o,i=0,s=Math.floor(o*(1/3)),f=Math.floor(o*(2/3))){if(o<3)return!1;r(B,i);let a=s,m=!1;for(;a<o-1&&!m;)r(C,a),a++,m=!e(B,C);if(!m)return!1;for(a=Math.max(a,f),m=!1;a<o&&!m;)r(D,a),a++,c(E,B,C),u(E,E),c(F,C,D),u(F,F),m=!e(B,D)&&!e(C,D)&&Math.abs(n(E,F))<A;return m?(w(B,C,D,t),!0):(0!==i||1!==s||2!==f)&&S(t,r,o,0,1,2)}function z(t,n,r=!0){const o=n.length/3;return S(t,(t,r)=>s(t,n[3*r+0],n[3*r+1],n[3*r+2]),r?o-1:o)}const A=.99619469809,B=a(),C=a(),D=a(),E=a(),F=a();function G(t,r,o){return r!==t&&y(t,r),t[3]=-n(k(t),o),t}function H(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}function I(t,n,r,o){return i(D,n,t),U(r,D,o)}function J(t,n,r,o){return Y(Z(t,n,c(p.get(),r,n),_,o))}function K(t,n,r){return null!=n&&Y(Z(t,n.origin,n.direction,tt,r))}function L(t,n,r){return Y(Z(t,n.origin,n.vector,0,r))}function N(t,n,r){return Y(Z(t,n.origin,n.vector,1,r))}function O(t,n){return X(t,n)>=0}function P(t,r){const o=n(k(t),r.ray.direction),e=-X(t,r.ray.origin);if(e<0&&o>=0)return!1;if(o>-1e-6&&o<1e-6)return e>0;if((e<0||o<0)&&!(e<0&&o<0))return!0;const c=e/o;return o>0?c<r.c1&&(r.c1=c):c>r.c0&&(r.c0=c),r.c0<=r.c1}function Q(t,r){const o=n(k(t),r.ray.direction),e=-X(t,r.ray.origin);if(o>-1e-6&&o<1e-6)return e>0;const c=e/o;return o>0?c<r.c1&&(r.c1=c):c>r.c0&&(r.c0=c),r.c0<=r.c1}function R(t,n,e){const u=o(p.get(),k(t),-t[3]),i=V(t,c(p.get(),n,u),p.get());return r(e,i,u),e}function T(t,n,r,o){const e=k(t),u=p.get(),i=p.get();M(e,u,i);const f=c(p.get(),r,n),a=h(u,f),m=h(i,f),g=h(e,f);return s(o,a,m,g)}function V(t,r,e){const u=o(p.get(),k(t),n(k(t),r));return c(e,r,u),e}function W(t,n){return Math.abs(X(t,n))}function X(t,r){return n(k(t),r)+t[3]}function Y(t){return 0===t||1===t}function Z(e,c,u,i,s){const f=n(k(e),u),a=X(e,c);if(0===f)return a>=0?2:3;let m=-a/f;return 1&i&&(m=t(m,0,1)),!(4&i)&&m<0||!(8&i)&&m>1?a>=0?2:3:(r(s,c,o(s,u,m)),a>=0?0:1)}const $=[0,0,1,0],_=12,tt=8;export{P as clip,Q as clipInfinite,y as copy,j as create,W as distance,b as equals,v as exactEquals,z as fromArray,S as fromManyPoints,x as fromNormalAndOffset,w as fromPoints,U as fromPositionAndNormal,q as fromValues,I as fromVectorsAndPoint,k as getNormal,J as intersectLine,Z as intersectLineOrRay,L as intersectLineSegment,N as intersectLineSegmentClamp,K as intersectRay,O as isPointInside,H as negate,R as projectPoint,T as projectPointLocal,V as projectVector,G as setOffsetFromPoint,X as signedDistance,$ as up,d as wrap};
5
+ import{clamp as t}from"../../core/mathUtils.js";import{f as n,g as r,h as o,i as e,e as c,q as u,n as i,j as s,d as f}from"../../chunks/vec32.js";import{create as a}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as m,e as g}from"../../chunks/vec42.js";import{projectPointSignedLength as h}from"./vector.js";import{sv4d as l,sv3d as p}from"./vectorStacks.js";import{tangentFrame as M}from"../../views/3d/support/mathUtils.js";function j(t=$){return[t[0],t[1],t[2],t[3]]}const v=m,b=g;function d(t=$[0],n=$[1],r=$[2],o=$[3]){return q(t,n,r,o,l.get())}function y(t,n){return q(n[0],n[1],n[2],n[3],t)}function k(t){return t}function q(t,n,r,o,e=j()){return e[0]=t,e[1]=n,e[2]=r,e[3]=o,e}function x(t,n,r){return f(r,t),r[3]=n,r}function U(t,n,r){const o=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],e=Math.abs(o-1)>1e-5&&o>1e-12?1/Math.sqrt(o):1;return r[0]=n[0]*e,r[1]=n[1]*e,r[2]=n[2]*e,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2]),r}function w(t,n,r,o=j()){const e=r[0]-n[0],c=r[1]-n[1],u=r[2]-n[2],i=t[0]-n[0],s=t[1]-n[1],f=t[2]-n[2],a=c*f-u*s,m=u*i-e*f,g=e*s-c*i,h=a*a+m*m+g*g,l=Math.abs(h-1)>1e-5&&h>1e-12?1/Math.sqrt(h):1;return o[0]=a*l,o[1]=m*l,o[2]=g*l,o[3]=-(o[0]*t[0]+o[1]*t[1]+o[2]*t[2]),o}function S(t,r,o,e=0,s=Math.floor(o*(1/3)),f=Math.floor(o*(2/3))){if(o<3)return!1;r(B,e);let a=s,m=!1;for(;a<o-1&&!m;)r(C,a),a++,m=!u(B,C);if(!m)return!1;for(a=Math.max(a,f),m=!1;a<o&&!m;)r(D,a),a++,c(E,B,C),i(E,E),c(F,C,D),i(F,F),m=!u(B,D)&&!u(C,D)&&Math.abs(n(E,F))<A;return m?(w(B,C,D,t),!0):(0!==e||1!==s||2!==f)&&S(t,r,o,0,1,2)}function z(t,n,r=!0){const o=n.length/3;return S(t,(t,r)=>s(t,n[3*r+0],n[3*r+1],n[3*r+2]),r?o-1:o)}const A=.99619469809,B=a(),C=a(),D=a(),E=a(),F=a();function G(t,r,o){return r!==t&&y(t,r),t[3]=-n(k(t),o),t}function H(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}function I(t,n,r,o){return e(D,n,t),U(r,D,o)}function J(t,n,r,o){return Y(Z(t,n,c(p.get(),r,n),_,o))}function K(t,n,r){return null!=n&&Y(Z(t,n.origin,n.direction,tt,r))}function L(t,n,r){return Y(Z(t,n.origin,n.vector,0,r))}function N(t,n,r){return Y(Z(t,n.origin,n.vector,1,r))}function O(t,n){return X(t,n)>=0}function P(t,r){const o=n(k(t),r.ray.direction),e=-X(t,r.ray.origin);if(e<0&&o>=0)return!1;if(o>-1e-6&&o<1e-6)return e>0;if((e<0||o<0)&&!(e<0&&o<0))return!0;const c=e/o;return o>0?c<r.c1&&(r.c1=c):c>r.c0&&(r.c0=c),r.c0<=r.c1}function Q(t,r){const o=n(k(t),r.ray.direction),e=-X(t,r.ray.origin);if(o>-1e-6&&o<1e-6)return e>0;const c=e/o;return o>0?c<r.c1&&(r.c1=c):c>r.c0&&(r.c0=c),r.c0<=r.c1}function R(t,n,e){const u=o(p.get(),k(t),-t[3]),i=V(t,c(p.get(),n,u),p.get());return r(e,i,u),e}function T(t,n,r,o){const e=k(t),u=p.get(),i=p.get();M(e,u,i);const f=c(p.get(),r,n),a=h(u,f),m=h(i,f),g=h(e,f);return s(o,a,m,g)}function V(t,r,e){const u=o(p.get(),k(t),n(k(t),r));return c(e,r,u),e}function W(t,n){return Math.abs(X(t,n))}function X(t,r){return n(k(t),r)+t[3]}function Y(t){return 0===t||1===t}function Z(e,c,u,i,s){const f=n(k(e),u),a=X(e,c);if(0===f)return a>=0?2:3;let m=-a/f;return 1&i&&(m=t(m,0,1)),!(4&i)&&m<0||!(8&i)&&m>1?a>=0?2:3:(r(s,c,o(s,u,m)),a>=0?0:1)}const $=[0,0,1,0],_=12,tt=8;export{P as clip,Q as clipInfinite,y as copy,j as create,W as distance,b as equals,v as exactEquals,z as fromArray,S as fromManyPoints,x as fromNormalAndOffset,w as fromPoints,U as fromPositionAndNormal,q as fromValues,I as fromVectorsAndPoint,k as getNormal,J as intersectLine,Z as intersectLineOrRay,L as intersectLineSegment,N as intersectLineSegmentClamp,K as intersectRay,O as isPointInside,H as negate,R as projectPoint,T as projectPointLocal,V as projectVector,G as setOffsetFromPoint,X as signedDistance,$ as up,d as wrap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{deg2rad as t}from"../../core/mathUtils.js";import{getMetersPerUnitForSR as r,getMetersPerVerticalUnitForSR as o}from"../../core/unitUtils.js";import{j as s}from"../../chunks/vec32.js";import{getNormal as a,fromManyPoints as n,create as c}from"./plane.js";function i(r,o,s){const n=m(e,r,o,s)?a(e):[0,0,1];return Math.abs(n[2])>Math.cos(t(80))?2:Math.abs(n[1])>Math.abs(n[0])?1:0}function m(t,a,c,i){const m=(t=>!Array.isArray(t[0]))(a)?(t,r)=>a[3*t+r]:(t,r)=>a[t][r],e=i?r(i)/o(i):1;return n(t,(t,r)=>s(t,m(r,0)*e,m(r,1)*e,m(r,2)),c)}const e=c();export{m as fitPlane,i as leastSignificantAxis};
5
+ import{deg2rad as t}from"../../core/mathUtils.js";import{getMetersPerUnitForSR as r,getMetersPerVerticalUnitForSR as o}from"../../core/unitUtils.js";import{j as s}from"../../chunks/vec32.js";import{getNormal as a,create as n,fromManyPoints as c}from"./plane.js";function i(r,o,s){const n=m(e,r,o,s)?a(e):[0,0,1];return Math.abs(n[2])>Math.cos(t(80))?2:Math.abs(n[1])>Math.abs(n[0])?1:0}function m(t,a,n,i){const m=(t=>!Array.isArray(t[0]))(a)?(t,r)=>a[3*t+r]:(t,r)=>a[t][r],e=i?r(i)/o(i):1;return c(t,(t,r)=>s(t,m(r,0)*e,m(r,1)*e,m(r,2)),n)}const e=n();export{m as fitPlane,i as leastSignificantAxis};