@arcgis/core 4.34.0-next.94 → 4.34.0-next.95

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 (735) hide show
  1. package/analysis/ElevationProfileAnalysis.js +1 -1
  2. package/analysis/VolumeMeasurementAnalysis.js +1 -1
  3. package/analysis/featureReferenceUtils.js +1 -1
  4. package/applications/Components/featureUtils.d.ts +1 -0
  5. package/applications/Components/featureUtils.js +1 -1
  6. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/{57c08ccb75e3135978d1.js → 0086a09441627842d34a.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{35ca317490540fae437c.js → 04c30eec4387078cd38f.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{155dcbd957f8787a45c3.js → 05eee334d58a0b9f6316.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{0f37204f86d2997a2811.js → 06e60fc7715d08ede59d.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{94ddf029698991d853b9.js → 0811ac64d08454460fb1.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{6391ce002fbde9f27a77.js → 081a7082dc281ca7662a.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{3c3b1dc95f03082e4d5b.js → 083f1c2fd0b59a0bf4c3.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{9d9a639f7388a29e7c96.js → 08ee3a97d2b8adb44ea9.js} +1 -1
  16. package/assets/esri/core/workers/chunks/097e5deb51ee7e25e654.js +1 -0
  17. package/assets/esri/core/workers/chunks/{c86ca87959f04075e834.js → 0a7efed82d8e47290147.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{147f6e7b147beaa4ed29.js → 0d94a08769727875bf0e.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{e2fdc4dc1ab9decd731e.js → 135e270b4f03c4270870.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{c6cae8471c5d4ae40c65.js → 145c6a7cdcc9893efb27.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{0cfded1acf92f89a13cb.js → 14ace5dc4b8984212a57.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{39a5863355cccaabd2d6.js → 1762ff76350065750c75.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{a98b284b147258629947.js → 188272af9a6470ccfe31.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{ce8f56cf371812b57a46.js → 19699769deff862e29ce.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{bf9d09493fd849ea69fd.js → 1fd459234917a51b6ae1.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{0aaaf4d1c4a5d284216e.js → 22bb877b85ae250d7819.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{05072093e0209ef5db20.js → 24c14e4a1d2a2267097e.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{e5d974593043d5e2b502.js → 2795a2817ebe3298c350.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{71fef0a33b7ed9456e47.js → 28a5f8978817e0471a2a.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{07a7ca89ef2ca4fc090b.js → 2a30afa043e3f88655d9.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{41f275401e1cde7eee20.js → 2a8b75d2445680571759.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{6b208f5d423da64c8559.js → 2a900a632a1231deb713.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{0e5e565df6ec71445f2e.js → 2bbe8277578b033f92d4.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{48133effac2eacc2196e.js → 2bf29faeb23120dc1916.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{77e611724a499d36eacc.js → 2c72e185b780bbbb1c9f.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{38d874d7f815f5329420.js → 2ca8b0c1ca399fd5dc2f.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{c799f1c03cb22ef52f5f.js → 2d51e9c9b73301b6879c.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{cd0c222a36caa7f80860.js → 2e4dccee7ea387263f15.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{0856cd281efd71bfe3c4.js → 3116b35a92cc0afd9fd3.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{e153b61560a7a869db63.js → 319c3f46f2afb8f3e5a9.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{b8f55ee77ab6ea4c289e.js → 326a76a4e80269d4029d.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{28bb6896c5fd353ca5e9.js → 3367b8565226646decec.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{c38360d912f256519e06.js → 3496e025e48cf580250d.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{4753793daf0b7ff8b5ff.js → 35255e2b980f650490d8.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{d2df6e685d6cffc5f486.js → 37d05d9796917c3d4b7a.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{7b17f52019762aa21af8.js → 3815ffa13e7b439bca6e.js} +1 -1
  47. package/assets/esri/core/workers/chunks/3a2d4b78a48ebb181105.js +1 -0
  48. package/assets/esri/core/workers/chunks/{de34c21d3e6913befe5a.js → 3b65d6a78fbffca37fbd.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{c473b15d4d52f0a63d20.js → 3c78208a97c4cbd8d6d1.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{2698f656405876f4bd20.js → 3ccdce156b906574bd29.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{68f5a2d2666636c3f807.js → 40b81d1c2d53cf598b8e.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{f3284d4e0d41efb0b4a0.js → 441ead5bce80f639934e.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{97eb2cfc1f036feea9a9.js → 44c3b5a507814103f4b4.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{6f29951f5a2da068b257.js → 456161a323be7d640c61.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{b18887a6dc86f0c8324a.js → 48646f3d95a3f2b17e78.js} +1 -1
  56. package/assets/esri/core/workers/chunks/49571d6875de1f2e7e25.js +33 -0
  57. package/assets/esri/core/workers/chunks/{1bbc0dfad4cd72a1c42b.js → 4a2bf3c8da24abd8b9e2.js} +6 -6
  58. package/assets/esri/core/workers/chunks/4b13749b74059a7837d2.js +1 -0
  59. package/assets/esri/core/workers/chunks/{c8e4fe0e3b109eb80e8e.js → 4b83b45df0c4005d078d.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{896c7d137bfd7a8fa0bc.js → 4f01be74dd26e639330f.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{b5c829e904bc9cb5347d.js → 50a5caa96c111dda5c60.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{98381404f2d99a1f9341.js → 50e1c63d0b6196dd365e.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{899f493412acd5a5d91f.js → 5132ca68e8c7af111a47.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{d08b80583a23ba253c7e.js → 56916e56c20465428dd4.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{bbdadced49446c907361.js → 578789c040846ea3759b.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{f62717338075df626eda.js → 5a527a47285a5995cff9.js} +1 -1
  67. package/assets/esri/core/workers/chunks/5cb92abb1f0f38bd0eab.js +1 -0
  68. package/assets/esri/core/workers/chunks/{56edb55b53779e7fd31e.js → 5d2e5774768d8f290343.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{6e5175b43220d6692263.js → 5d3661d1fe46dd29aae9.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{0652d7e525d99e39c957.js → 5fb2ce028b371b3a8acb.js} +1 -1
  71. package/assets/esri/core/workers/chunks/63019a7eb5222dc5e420.js +1 -0
  72. package/assets/esri/core/workers/chunks/{71c6c0b26253c4ca1b68.js → 630efe10c871425b6a95.js} +1 -1
  73. package/assets/esri/core/workers/chunks/64629ddcf008349eaf41.js +1 -0
  74. package/assets/esri/core/workers/chunks/{61e8e159f1f336569b27.js → 65111858957f43eacd8c.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{0427f66b56ec6601deb0.js → 6ac90d88e5f931b1a003.js} +1 -1
  76. package/assets/esri/core/workers/chunks/6c842b955fdd40b39914.js +1 -0
  77. package/assets/esri/core/workers/chunks/{08b0fc6bfe9640ee2525.js → 6cd379bb66dc4cf5d2bf.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{1f2d13466c60a6b57717.js → 6e5b3bbee054d072b594.js} +1 -1
  79. package/assets/esri/core/workers/chunks/6ec77a8142fbfa805b5a.js +1 -0
  80. package/assets/esri/core/workers/chunks/{541bffd61006d0e36166.js → 6f4bd0ee85e7e5a74340.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{648c91a9822bc9d6ee47.js → 701a1835684cf815bcb7.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{f71b76c9506178124fa3.js → 70af1b5b3d2f3f395441.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{d7adef4093ce19ad356d.js → 72846fb9c87c6642daf0.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{f88fe2e8fbc763bdc940.js → 73c1d43070b4fe1e5c1e.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{cab2a1382bdd32bb34d8.js → 7421f9575487cdc9e28e.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{a845c68e76382a73da5e.js → 7633537dc0c65d655baf.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{82e0d22619dc26920ca9.js → 7698f4f4471b6e1c12ef.js} +1 -1
  88. package/assets/esri/core/workers/chunks/{9a0b9d931c1a29e81475.js → 76e444bd625cf3d35877.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{b265472ac3f949a7f40c.js → 773d76253588bcf14eaa.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{77705d0c7c17bd46d81a.js → 7810f870d71f80ca4f41.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{56de25a6fe659a5b5c2b.js → 78b35a19332e58c8c279.js} +1 -1
  92. package/assets/esri/core/workers/chunks/{e4833b718a813a8d125b.js → 79012b873d2b7786be77.js} +1 -1
  93. package/assets/esri/core/workers/chunks/7a6a96edc892d7060b7d.js +1 -0
  94. package/assets/esri/core/workers/chunks/7b3ff47cdbb6af38530d.js +1 -0
  95. package/assets/esri/core/workers/chunks/{04dbdaa63c950f32b8f0.js → 7e8f7fa884d6d41ebae2.js} +1 -1
  96. package/assets/esri/core/workers/chunks/81bbe5251ed13c0d91cc.js +1 -0
  97. package/assets/esri/core/workers/chunks/{0037abf0a82d1ed32e91.js → 8215015f11221a354273.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{cb6a9b43406f4fbe10b2.js → 82f1cd3896401c85df35.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{2bb61f80473b495163e3.js → 83ab8c8bc9e6990114a8.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{03b455e9405a8b6fec68.js → 8659abd4b46f153b6902.js} +1 -1
  101. package/assets/esri/core/workers/chunks/{19bd0b56d82446dbb7c5.js → 868ee8f429e7caddc045.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{1fc7df018c8f802565a6.js → 86b978a48b539e9fc5b8.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{4dfcd03082be83600f3a.js → 88add09190569b04e824.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{65e279516170ddbd4a65.js → 89027f6800e17fab8973.js} +1 -1
  105. package/assets/esri/core/workers/chunks/{3e11a893271caa11a881.js → 8ad8fe758c615fcf2185.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{a6533bab3b2fbc1e2a47.js → 8b16aa50d879b92a5375.js} +1 -1
  107. package/assets/esri/core/workers/chunks/{edaf059c7ea18088c3dd.js → 91df8638b8b904e6d8c5.js} +1 -1
  108. package/assets/esri/core/workers/chunks/92c306d02569e7cd9af3.js +1 -0
  109. package/assets/esri/core/workers/chunks/{fdadf11f31384c09db9f.js → 94486f3fcba48fa93aa8.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{8513c9282c44bb0a736e.js → 9834bc11586a2d8d6f35.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{a0fab8cd791c33d3895d.js → 98dbafa4d45fdf790fff.js} +1 -1
  112. package/assets/esri/core/workers/chunks/{2b867cec6ada339f1c8f.js → 9958a3ed4aa787d19e00.js} +1 -1
  113. package/assets/esri/core/workers/chunks/9a723d739ac44b45432c.js +1 -0
  114. package/assets/esri/core/workers/chunks/{2b9c9a35a6e1f56920b5.js → 9b0ea5e50aeeea615592.js} +14 -14
  115. package/assets/esri/core/workers/chunks/9c6fc4fe2c46f40d63d9.js +1 -0
  116. package/assets/esri/core/workers/chunks/{c4641c2c130c7b8bcdee.js → a1c4509a3865139eb570.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{176f56de787bf486be9f.js → a7bd294996e6c8b8354a.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{80a155496deef2c02a3e.js → a878061845e594b2d72c.js} +1 -1
  119. package/assets/esri/core/workers/chunks/{8f426cb210a4250517d5.js → ad3e18c4c65aa2cd1ceb.js} +1 -1
  120. package/assets/esri/core/workers/chunks/{0328eaea66c1db98da1c.js → ae807912acc19a166264.js} +1 -1
  121. package/assets/esri/core/workers/chunks/{0a981061df08da19372c.js → ae8c387d59be87457567.js} +1 -1
  122. package/assets/esri/core/workers/chunks/{5caf49e679ed0c27e0bd.js → aea8553a2aa54cfd694b.js} +1 -1
  123. package/assets/esri/core/workers/chunks/{0ceb68ff73e5d39e837a.js → b13ccda702b714fe6161.js} +1 -1
  124. package/assets/esri/core/workers/chunks/b1f667006cba60ef4aa7.js +1 -0
  125. package/assets/esri/core/workers/chunks/{70c8f69eed14d55c5cf6.js → b2add7338258ca7c24dd.js} +1 -1
  126. package/assets/esri/core/workers/chunks/b2d9f4e057af26a538fb.js +1 -0
  127. package/assets/esri/core/workers/chunks/{26081b6486c623735657.js → b4ea675831627d9808dd.js} +1 -1
  128. package/assets/esri/core/workers/chunks/{ce2fcaa21d6efcdf4da5.js → b8339c1d60847a9eed3e.js} +1 -1
  129. package/assets/esri/core/workers/chunks/{b1ccbc2fef7f7e5e04f7.js → bae0dfe9a2f5aabae42c.js} +1 -1
  130. package/assets/esri/core/workers/chunks/{95bae3c275f1483eb7ed.js → bcff6178e9d16b1b6191.js} +1 -1
  131. package/assets/esri/core/workers/chunks/{2845a0810e9c00bf30f8.js → bf775fe489213cfc08b1.js} +1 -1
  132. package/assets/esri/core/workers/chunks/{4823e4522bd7379d858e.js → bfc1e8aec7aace3ff30e.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{20003728a679479b14dc.js → c31583229a1100b66a18.js} +1 -1
  134. package/assets/esri/core/workers/chunks/{9346437b152b20bdcf8a.js → c941d15190fc08523d0d.js} +1 -1
  135. package/assets/esri/core/workers/chunks/{5746c4861af83c1d57a8.js → cf11b1dcc2cff30229b6.js} +1 -1
  136. package/assets/esri/core/workers/chunks/{fe1dcf9f81da4adbb1fe.js → cf13625a033f9903655f.js} +1 -1
  137. package/assets/esri/core/workers/chunks/d28ea91f7458daa67fae.js +1 -0
  138. package/assets/esri/core/workers/chunks/{1990162dcf73601d54f7.js → d3cd9c24edf7520d0824.js} +1 -1
  139. package/assets/esri/core/workers/chunks/{bec9ddd38c9ab9f2561b.js → d4f16c2b9297a479731e.js} +1 -1
  140. package/assets/esri/core/workers/chunks/{73db6c070b049fe05147.js → d57edb77c6deee36cce5.js} +1 -1
  141. package/assets/esri/core/workers/chunks/{6e4ec9fa931c69e4e4ba.js → da573ecc68e6aa8f6da9.js} +1 -1
  142. package/assets/esri/core/workers/chunks/{bdf0ab95401c6d8fbc7d.js → db559437b571462fb3db.js} +1 -1
  143. package/assets/esri/core/workers/chunks/{512dcd6e34e217029391.js → deb2854bb7d082a26f52.js} +1 -1
  144. package/assets/esri/core/workers/chunks/{5993427325d1add18ed9.js → dede989d59c4b416af68.js} +1 -1
  145. package/assets/esri/core/workers/chunks/{18e9cb71fa020e93d139.js → df5ecb3339d9301a6f5b.js} +1 -1
  146. package/assets/esri/core/workers/chunks/{e22b400636094fc7b6c0.js → dfbf2e17058aa876f96a.js} +1 -1
  147. package/assets/esri/core/workers/chunks/dfc37c2ce51e6a34fd87.js +1 -0
  148. package/assets/esri/core/workers/chunks/dff8e15958423e0212e5.js +1 -0
  149. package/assets/esri/core/workers/chunks/{c5c6a32a24005478c976.js → e032f3d2ee19790f8c79.js} +1 -1
  150. package/assets/esri/core/workers/chunks/{3d7923d25734d03a4d27.js → e1dba29f5fd1ee5fc999.js} +1 -1
  151. package/assets/esri/core/workers/chunks/{352511dbc67166face40.js → e2e32e2f04cce9e932fd.js} +1 -1
  152. package/assets/esri/core/workers/chunks/{bb0a1be03bb9d621432c.js → e7638b9ab6674bc8a18f.js} +1 -1
  153. package/assets/esri/core/workers/chunks/{edef1e2254c992459c63.js → eb1a7bb8b14e651bc241.js} +1 -1
  154. package/assets/esri/core/workers/chunks/{779ee975efebb838b5d6.js → f154336b4af011cd0c56.js} +1 -1
  155. package/assets/esri/core/workers/chunks/{3807d0b9b1894731174d.js → f1be3a177328a169128f.js} +1 -1
  156. package/assets/esri/core/workers/chunks/{0810dbbf348a927392e7.js → f59c782898d931810374.js} +1 -1
  157. package/assets/esri/core/workers/chunks/{c9159ebf930af3f336f3.js → f5d89b48f62fba78fd10.js} +1 -1
  158. package/assets/esri/core/workers/chunks/f7846523adacbfe5047e.js +1 -0
  159. package/assets/esri/core/workers/chunks/{b510c07dfd0d31683b08.js → f7a9d2da07196a0989ae.js} +1 -1
  160. package/assets/esri/core/workers/chunks/{143503f6eb270c4683f8.js → f7c99e9c8d19352af38d.js} +1 -1
  161. package/assets/esri/core/workers/chunks/{79ab06fb4c91ac8da323.js → f839b86bee15deaf84e4.js} +1 -1
  162. package/assets/esri/core/workers/chunks/{9adecee0ed2f1df3b0d2.js → f85e2b6a285fa8ad60aa.js} +1 -1
  163. package/assets/esri/core/workers/chunks/{024063fe2bbb27899094.js → fbbccca5b1bcffb31c4e.js} +1 -1
  164. package/assets/esri/core/workers/chunks/{009556f323e58271bc7a.js → fc4417d1260b717a9385.js} +1 -1
  165. package/assets/esri/core/workers/chunks/{6810ecdeccf4b7eae5e2.js → fdaf8fb5a3cc7abea44b.js} +1 -1
  166. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  167. package/assets/esri/themes/base/widgets/_Editor.scss +4 -0
  168. package/assets/esri/themes/dark/main.css +1 -1
  169. package/assets/esri/themes/light/main.css +1 -1
  170. package/assets/esri/themes/light/view.css +1 -1
  171. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  172. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  173. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  174. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  175. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  176. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  177. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  178. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  179. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  180. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  181. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  182. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  183. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  184. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  185. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  186. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  187. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  188. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  189. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  190. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  191. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  192. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  193. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  194. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  195. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  196. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  197. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  198. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  199. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  200. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  201. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  202. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  203. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  204. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  205. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  206. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  207. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  208. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  209. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  210. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  211. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  212. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  213. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  214. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  215. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  216. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  217. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  218. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  219. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  220. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  221. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  222. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  223. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  224. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  225. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  226. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  227. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  228. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  229. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  230. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  231. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  232. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  233. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  234. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  235. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  236. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  237. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  238. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  239. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  240. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  241. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  242. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  243. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  244. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  245. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  246. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  247. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  248. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  249. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  250. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  251. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  252. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  253. package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
  254. package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
  255. package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
  256. package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
  257. package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
  258. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  259. package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
  260. package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
  261. package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
  262. package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
  263. package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
  264. package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
  265. package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
  266. package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
  267. package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
  268. package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
  269. package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
  270. package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
  271. package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
  272. package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
  273. package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
  274. package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
  275. package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
  276. package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
  277. package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
  278. package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
  279. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
  280. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
  281. package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
  282. package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
  283. package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
  284. package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
  285. package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
  286. package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
  287. package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
  288. package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
  289. package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
  290. package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
  291. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
  292. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
  293. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
  294. package/chunks/Envelope.js +1 -1
  295. package/chunks/Fog.glsl.js +2 -2
  296. package/chunks/Geometry.js +1 -1
  297. package/chunks/GlowBlur.glsl.js +8 -9
  298. package/chunks/GlowComposition.glsl.js +15 -16
  299. package/chunks/Laserlines.glsl.js +12 -12
  300. package/chunks/MultiPathImpl.js +1 -1
  301. package/chunks/Point2D.js +1 -1
  302. package/chunks/PointRenderer.glsl.js +1 -1
  303. package/chunks/Precipitation.glsl.js +2 -2
  304. package/chunks/Terrain.glsl.js +1 -1
  305. package/chunks/boundedPlane.js +1 -1
  306. package/chunks/bundle.js +1 -1
  307. package/chunks/cameraUtilsPlanar.js +1 -1
  308. package/chunks/cameraUtilsSpherical.js +1 -1
  309. package/chunks/sphere.js +1 -1
  310. package/chunks/vec32.js +1 -1
  311. package/config.js +1 -1
  312. package/core/accessorSupport/extensions/serializableProperty/reader.js +1 -1
  313. package/core/accessorSupport/extensions/serializableProperty/utils.js +5 -0
  314. package/core/accessorSupport/extensions/serializableProperty.js +1 -1
  315. package/core/accessorSupport/read.js +1 -1
  316. package/core/accessorSupport/write.js +1 -1
  317. package/core/has.js +1 -1
  318. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  319. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  320. package/core/perspectiveUtils.js +1 -1
  321. package/core/workers/workerFactory.js +1 -1
  322. package/editing/geometry/lineUtils.js +1 -1
  323. package/geometry/Mesh.js +1 -1
  324. package/geometry/operators/support/jsonConverter.js +1 -1
  325. package/geometry/projection/localLinearScaleFactors.js +1 -1
  326. package/geometry/projection/projectDirection.js +1 -1
  327. package/geometry/projection/projectVec3Array.js +1 -1
  328. package/geometry/support/axisAngle.js +1 -1
  329. package/geometry/support/axisAngleDegrees.js +1 -1
  330. package/geometry/support/buffer/internals/Vec3.js +1 -1
  331. package/geometry/support/clipRay.js +1 -1
  332. package/geometry/support/coordinateSystem.js +1 -1
  333. package/geometry/support/frustum.js +1 -1
  334. package/geometry/support/lineSegment.js +1 -1
  335. package/geometry/support/meshUtils/centerAt.js +1 -1
  336. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  337. package/geometry/support/meshUtils/loadExternal.js +1 -1
  338. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  339. package/geometry/support/meshUtils/merge.js +1 -1
  340. package/geometry/support/meshUtils/rotate.js +1 -1
  341. package/geometry/support/meshUtils/scale.js +1 -1
  342. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  343. package/geometry/support/plane.js +1 -1
  344. package/geometry/support/polygonUtils.js +1 -1
  345. package/geometry/support/ray.js +1 -1
  346. package/geometry/support/sphereUtils.js +1 -1
  347. package/geometry/support/triangle.js +1 -1
  348. package/geometry/support/vector.js +1 -1
  349. package/interfaces.d.ts +269 -145
  350. package/kernel.js +1 -1
  351. package/layers/FeatureLayer.js +1 -1
  352. package/layers/VoxelWasmPerSceneView.js +1 -1
  353. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  354. package/layers/graphics/sources/ParquetSource.js +1 -1
  355. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  356. package/layers/graphics/sources/support/QueryTask.js +1 -1
  357. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  358. package/layers/knowledgeGraph/layerUtils.js +1 -1
  359. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  360. package/layers/orientedImagery/transformations/utils.js +1 -1
  361. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  362. package/layers/support/featurePopupQueryUtils.js +1 -1
  363. package/layers/support/layerUtils.js +1 -1
  364. package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
  365. package/layers/support/tiles3DUtils.js +1 -1
  366. package/layers/video/VideoCameraSensorModel.js +1 -1
  367. package/layers/voxel/VoxelVolume.js +1 -1
  368. package/layers/voxel/voxelPlaneUtils.js +1 -1
  369. package/package.json +3 -3
  370. package/rest/knowledgeGraph/GraphApplyEdits.js +1 -1
  371. package/rest/query/executePivotQuery.js +5 -0
  372. package/rest/query/operations/query.js +1 -1
  373. package/rest/query/operations/queryPivot.js +5 -0
  374. package/rest/query/operations/queryUtils.js +5 -0
  375. package/rest/support/PivotDefinition.js +5 -0
  376. package/rest/support/PivotQuery.js +5 -0
  377. package/rest/support/UnPivotDefinition.js +5 -0
  378. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  379. package/smartMapping/support/adapters/support/utils.js +1 -1
  380. package/support/revision.js +1 -1
  381. package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +1 -1
  382. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  383. package/views/2d/engine/flow/dataUtils.js +1 -1
  384. package/views/2d/engine/flow/utils.js +1 -1
  385. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  386. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  387. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  388. package/views/2d/interactive/editingTools/manipulations/RotateManipulation.js +1 -1
  389. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  390. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  391. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  392. package/views/2d/layers/RouteLayerView2D.js +1 -1
  393. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  394. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  395. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  396. package/views/2d/navigation/actions/Pan.js +1 -1
  397. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  398. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  399. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  400. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  401. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  402. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  403. package/views/3d/analysis/ElevationProfile/ElevationProfileGeometryVisualization3D.js +5 -0
  404. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  405. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  406. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  407. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  408. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  409. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  410. package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
  411. package/views/3d/analysis/Slice/ShiftManipulator.js +1 -1
  412. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  413. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  414. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  415. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  416. package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
  417. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  418. package/views/3d/analysis/Viewshed/ViewshedShapeVisualElement.js +1 -1
  419. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  420. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  421. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  422. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  423. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  424. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementConfiguration.js +1 -1
  425. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  426. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  427. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  428. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.js +1 -1
  429. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  430. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  431. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  432. package/views/3d/analysis/support/measurementUtils.js +1 -1
  433. package/views/3d/animation/pointToPoint/Animation.js +1 -1
  434. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  435. package/views/3d/camera/constraintUtils/altitude.js +1 -1
  436. package/views/3d/camera/constraintUtils/common.js +1 -1
  437. package/views/3d/camera/constraintUtils/distance.js +1 -1
  438. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  439. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  440. package/views/3d/camera/intersectionUtils.js +1 -1
  441. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  442. package/views/3d/environment/CloudsParameters.js +1 -1
  443. package/views/3d/environment/EnvironmentManager.js +1 -1
  444. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  445. package/views/3d/environment/Fog.js +1 -1
  446. package/views/3d/environment/MarsAtmosphere.js +1 -1
  447. package/views/3d/glTF/loader.js +1 -1
  448. package/views/3d/interactive/Manipulator3D.js +1 -1
  449. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  450. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  451. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  452. package/views/3d/interactive/editingTools/lineObjectVisualElementUtils.js +1 -1
  453. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  454. package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
  455. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  456. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  457. package/views/3d/interactive/editingTools/originGeometryVisualElementUtils.js +1 -1
  458. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  459. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  460. package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
  461. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentMove.js +1 -1
  462. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
  463. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  464. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  465. package/views/3d/interactive/manipulatorUtils.js +1 -1
  466. package/views/3d/interactive/support/viewUtils.js +1 -1
  467. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  468. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  469. package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
  470. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  471. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  472. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  473. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  474. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  475. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  476. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  477. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  478. package/views/3d/interactive/visualElements/support/Segment.js +1 -1
  479. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  480. package/views/3d/layers/FlowSubView3D.js +1 -1
  481. package/views/3d/layers/I3SMeshView3D.js +1 -1
  482. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  483. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  484. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  485. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  486. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  487. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  488. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  489. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  490. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  491. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  492. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  493. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  494. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  495. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  496. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  497. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  498. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  499. package/views/3d/layers/graphics/LabelInfo.js +1 -1
  500. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  501. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  502. package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
  503. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  504. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  505. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  506. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  507. package/views/3d/layers/i3s/LoDUtil.js +1 -1
  508. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  509. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  510. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  511. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  512. package/views/3d/layers/support/I3STreeDebugger.js +1 -1
  513. package/views/3d/layers/support/uvUtils.js +1 -1
  514. package/views/3d/state/Frustum.js +1 -1
  515. package/views/3d/state/NearFarHeuristic.js +1 -1
  516. package/views/3d/state/controllers/FovController.js +1 -1
  517. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  518. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  519. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  520. package/views/3d/state/controllers/RotateController.js +1 -1
  521. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  522. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  523. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  524. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  525. package/views/3d/state/controllers/momentum/PanPlanarMomentumController.js +1 -1
  526. package/views/3d/state/controllers/momentum/PanSphericalMomentumController.js +1 -1
  527. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  528. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  529. package/views/3d/state/utils/navigationUtils.js +1 -1
  530. package/views/3d/state/utils/viewUtils.js +1 -1
  531. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  532. package/views/3d/support/RenderCoordsHelper.js +1 -1
  533. package/views/3d/support/cameraUtils.js +1 -1
  534. package/views/3d/support/cameraUtilsInternal.js +1 -1
  535. package/views/3d/support/dito.js +1 -1
  536. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  537. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  538. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  539. package/views/3d/support/flow/constants.js +1 -1
  540. package/views/3d/support/geometryUtils/ray.js +1 -1
  541. package/views/3d/support/intersectionUtils.js +1 -1
  542. package/views/3d/support/mathUtils.js +1 -1
  543. package/views/3d/support/orientedBoundingBox.js +1 -1
  544. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  545. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  546. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  547. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  548. package/views/3d/support/sunUtils.js +1 -1
  549. package/views/3d/support/viewpointUtils.js +1 -1
  550. package/views/3d/terrain/OverlayManager.js +1 -1
  551. package/views/3d/terrain/OverlayRenderer.js +1 -1
  552. package/views/3d/terrain/PatchGeometry.js +1 -1
  553. package/views/3d/terrain/PatchRenderData.js +1 -1
  554. package/views/3d/terrain/SphericalPatch.js +1 -1
  555. package/views/3d/terrain/TerrainRenderer.js +1 -1
  556. package/views/3d/terrain/TerrainSurface.js +1 -1
  557. package/views/3d/terrain/Tile.js +1 -1
  558. package/views/3d/webgl/RenderCamera.js +1 -1
  559. package/views/3d/webgl-engine/Stage.js +1 -1
  560. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  561. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  562. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH.js +1 -1
  563. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  564. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  565. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js +1 -1
  566. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  567. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +2 -2
  568. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  569. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +1 -1
  570. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +1 -1
  571. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  572. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  573. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  574. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +7 -7
  575. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +1 -1
  576. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  577. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  578. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  579. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  580. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  581. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  582. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  583. package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
  584. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  585. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  586. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  587. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  588. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  589. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  590. package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
  591. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  592. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  593. package/views/3d/webgl-engine/lib/Path.js +1 -1
  594. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  595. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  596. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  597. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  598. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  599. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  600. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  601. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  602. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  603. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  604. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  605. package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
  606. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  607. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  608. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  609. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  610. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  611. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  612. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  613. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  614. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  615. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  616. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  617. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  618. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  619. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  620. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  621. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  622. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  623. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  624. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  625. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  626. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  627. package/views/3d/webgl.js +1 -1
  628. package/views/DOMContainer.js +1 -1
  629. package/views/SceneView.js +1 -1
  630. package/views/View.js +1 -1
  631. package/views/View2D.js +1 -1
  632. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  633. package/views/analysis/ElevationProfile/ElevationProfileError.d.ts +4 -0
  634. package/views/analysis/ElevationProfile/ElevationProfileError.js +5 -0
  635. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  636. package/views/analysis/ElevationProfile/elevationProfileErrors.js +5 -0
  637. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  638. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  639. package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +1 -1
  640. package/views/analysis/ExclusiveOperationManager.js +1 -1
  641. package/views/draw/support/Reshape.js +1 -1
  642. package/views/draw/support/createUtils.js +1 -1
  643. package/views/draw/support/helpMessageUtils3d.js +1 -1
  644. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  645. package/views/interactive/GraphicManipulator.js +1 -1
  646. package/views/interactive/coordinateHelper.js +1 -1
  647. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  648. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  649. package/views/interactive/sketch/constraintUtils.js +1 -1
  650. package/views/interactive/sketch/constraints.js +1 -1
  651. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  652. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  653. package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
  654. package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
  655. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  656. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  657. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  658. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  659. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  660. package/views/layers/FeatureLayerView.d.ts +1 -1
  661. package/views/layers/FeatureLayerView.js +1 -1
  662. package/views/layers/SceneLayerView.js +1 -1
  663. package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
  664. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  665. package/views/navigation/gamepadAndKeyboardUtils.js +1 -1
  666. package/views/popupAdapter.js +1 -1
  667. package/views/support/angularMeasurementUtils.js +1 -1
  668. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  669. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  670. package/views/support/geometry3dUtils.js +1 -1
  671. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  672. package/widgets/Editor/EditorViewModel.js +1 -1
  673. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  674. package/widgets/Editor/SplitFeatureWorkflowData.js +1 -1
  675. package/widgets/Editor/UpdateWorkflow.js +1 -1
  676. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  677. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  678. package/widgets/Editor/components/UploadDetails.js +1 -1
  679. package/widgets/Editor/components/workflowAdapters/pendingFeatureList/CreateFeaturesWorkflowPendingFeatureListAdapter.ts.js +5 -0
  680. package/widgets/Editor/components/workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js +5 -0
  681. package/widgets/Editor/css.js +1 -1
  682. package/widgets/Editor/modelUploadUtils.js +1 -1
  683. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  684. package/widgets/Editor/workflowUtils.js +1 -1
  685. package/widgets/Editor.js +1 -1
  686. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  687. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  688. package/widgets/FeatureTable/FieldColumn.js +1 -1
  689. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  690. package/widgets/FeatureTable/support/tableUtils.js +1 -1
  691. package/widgets/FeatureTable/support/templateUtils.js +1 -1
  692. package/widgets/Legend/LegendViewModel.js +1 -1
  693. package/widgets/Legend.js +1 -1
  694. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  695. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  696. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  697. package/widgets/OrientedImageryViewer/dataCaptureUtils.js +1 -1
  698. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  699. package/widgets/OrientedImageryViewer.js +1 -1
  700. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  701. package/widgets/PanoramicViewer/PanoramicZoomManager.js +5 -0
  702. package/widgets/PanoramicViewer/PanoramicZoomViewModel.js +1 -1
  703. package/widgets/PanoramicViewer/constants.js +1 -1
  704. package/widgets/PanoramicViewer/support/ClosestMap.js +5 -0
  705. package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +1 -1
  706. package/widgets/PanoramicViewer/support/PanoramicMeshWorker.js +1 -1
  707. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +5 -0
  708. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +5 -0
  709. package/widgets/PanoramicViewer/support/importUtils.js +5 -0
  710. package/widgets/PanoramicViewer/utils.js +1 -1
  711. package/widgets/PanoramicViewer.js +1 -1
  712. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  713. package/widgets/support/forms/formUtils.js +1 -1
  714. package/analysis/ElevationProfile/ElevationProfileUnits.d.ts +0 -4
  715. package/assets/esri/core/workers/chunks/004b13c1db79c9e668b1.js +0 -1
  716. package/assets/esri/core/workers/chunks/06c389283ee5b60573f2.js +0 -1
  717. package/assets/esri/core/workers/chunks/0ca5060c81a1a05b8be3.js +0 -1
  718. package/assets/esri/core/workers/chunks/1214c126af0de25a4b4a.js +0 -1
  719. package/assets/esri/core/workers/chunks/23e600e368ac829680b5.js +0 -1
  720. package/assets/esri/core/workers/chunks/3d800fbc449bea18b1cd.js +0 -1
  721. package/assets/esri/core/workers/chunks/3dcdbba706a8034b6ba3.js +0 -1
  722. package/assets/esri/core/workers/chunks/503c81dda242e6077317.js +0 -1
  723. package/assets/esri/core/workers/chunks/52121179d4f9833008ec.js +0 -1
  724. package/assets/esri/core/workers/chunks/56b3bb68b61b77138186.js +0 -1
  725. package/assets/esri/core/workers/chunks/5aacd1c6b171c99b41f5.js +0 -1
  726. package/assets/esri/core/workers/chunks/633faa9cec8988ab06af.js +0 -33
  727. package/assets/esri/core/workers/chunks/801451fb572bc5f1f270.js +0 -1
  728. package/assets/esri/core/workers/chunks/8d63b42aea32ce2e5d09.js +0 -1
  729. package/assets/esri/core/workers/chunks/bf9031749d10e7d457b6.js +0 -1
  730. package/assets/esri/core/workers/chunks/c547692862df95d22818.js +0 -1
  731. package/assets/esri/core/workers/chunks/c84665db250b05e2829d.js +0 -1
  732. package/assets/esri/core/workers/chunks/ef75cad6570b14a42b62.js +0 -1
  733. package/assets/esri/core/workers/chunks/fb456e7425e09df17d8c.js +0 -1
  734. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization3D.js +0 -5
  735. package/views/analysis/ElevationProfile/ElevationProfileGenerationError.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../Color.js";import{multiplyOpacity as i}from"../../../core/colorUtils.js";import"../../../core/has.js";import{destroyHandle as n}from"../../../core/handleUtils.js";import{m as t}from"../../../chunks/vec32.js";import{create as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as r}from"../../../geometry/projection/projectVectorToVector.js";import{onTheGroundElevationInfo as l,absoluteHeightElevationInfo as a}from"../../../support/elevationInfoUtils.js";import{vectorToRender as s}from"./support/viewUtils.js";import{ExtendedLineVisualElement as c}from"./visualElements/ExtendedLineVisualElement.js";import{ParallelLineVisualElement as p}from"./visualElements/ParallelLineVisualElement.js";import{PointVisualElement as d}from"./visualElements/PointVisualElement.js";import{RightAngleQuadVisualElement as u}from"./visualElements/RightAngleQuadVisualElement.js";import{toDehydratedPoint as m,isTarget as f,withSelfSnappingZ as g}from"../../interactive/sketch/normalizedPoint.js";import{defaults as v}from"../../interactive/snapping/Settings.js";import{SnappingVisualizer as h}from"../../interactive/snapping/SnappingVisualizer.js";import{LineSnappingHint as C}from"../../interactive/snapping/hints/LineSnappingHint.js";class w extends h{sortUniqueHints(e){return e.sort((e,i)=>(i instanceof C?i.length:0)-(e instanceof C?e.length:0))}visualizeIntersectionPoint(e,i){const{spatialReference:t,view:o}=i,r=j(i);return n(new d({view:o,primitive:"circle",geometry:m(e.intersectionPoint,t),elevationInfo:e.isDraped?l:a,size:20,outlineSize:2,color:r.intersectionPointColor,outlineColor:r.intersectionPointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizePoint(e,i){const{view:t,spatialReference:o}=i,r=j(i),l=E(e.point,e.domain,i);return n(new d({view:t,primitive:"circle",geometry:m(l,o),elevationInfo:x(e),size:20,outlineSize:2,color:r.pointColor,outlineColor:r.pointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizeLine(e,i){const{view:t,spatialReference:o}=i,r=j(i),l=E(e.lineStart,e.domain,i),a=E(e.lineEnd,e.domain,i);return n(D(e.type,l,a,o,x(e),t,r,e.isDraped,e.fadeLeft,e.fadeRight))}visualizeParallelSign(e,i){const{view:o,spatialReference:r}=i,l=j(i),{isDraped:a}=e,s=x(e),c=E(e.lineStart,e.domain,i),d=E(e.lineEnd,e.domain,i),u=S(c,r,s,o,a),m=S(d,r,s,o,a),f=t(m,u,m,.5),g=new p({view:o,attached:!1,offset:v.parallelLineHintOffset,length:v.parallelLineHintLength,width:v.parallelLineHintWidth,color:l.parallelSignColor,location:f,renderOccluded:a?4:16,isDraped:a,renderGroup:3,isDecoration:!0});return g.setDirectionFromPoints(u,f),g.attached=!0,n(g)}visualizeRightAngleQuad(e,i){const{view:t,spatialReference:o}=i,r=j(i),l=x(e),{isDraped:a}=e,s=E(e.previousVertex,e.domain,i),c=E(e.centerVertex,e.domain,i),p=E(e.nextVertex,e.domain,i),d=S(s,o,l,t,a),m=S(c,o,l,t,a),f=S(p,o,l,t,a);return n(new u({view:t,attached:!0,color:a?r.rightAngleColorDraped:r.rightAngleColor,renderOccluded:a?4:2,outlineRenderOccluded:a?4:16,outlineColor:r.rightAngleOutlineColor,outlineSize:v.rightAngleHintOutlineSize,size:v.rightAngleHintSize,isDraped:a,geometry:{previous:d,center:m,next:f},renderGroup:3,isDecoration:!0}))}}function j(n){const{effectiveTheme:t}=n.view,o=e.toUnitRGBA(t.accentColor),r=[0,0,0,0];return{intersectionPointColor:r,intersectionPointOutlineColor:o,pointColor:r,pointOutlineColor:o,lineColor:o,lineOutlineColor:void 0,parallelSignColor:o,rightAngleColor:o,rightAngleColorDraped:e.toUnitRGBA(i(t.accentColor,.5)),rightAngleOutlineColor:o}}function E(e,i,{selfSnappingZ:n,view:t,spatialReference:o}){return 2&i&&f(e)&&null!=n?g(e,n,t,o):e}function x(e){return e.isDraped?l:a}function D(e,i,n,t,o,r,l,a=!1,s=!0,p=!0){const d=S(i,t,o,r,a),u=S(n,t,o,r,a),m=new c({view:r,extensionType:3,start:d,end:u,isDraped:a,color:l.lineColor,renderOccluded:a?4:16,renderGroup:3,isDecoration:!0});switch(e){case 0:m.width=v.lineHintWidthTarget,m.fadedExtensions={start:0,end:v.lineHintFadedExtensions};break;case 2:m.width=v.lineHintWidthReference,m.fadedExtensions={start:0,end:0};break;case 1:m.width=v.lineHintWidthReference,m.fadedExtensions={start:s?v.lineHintFadedExtensions:0,end:p?v.lineHintFadedExtensions:0}}return m.attached=!0,m}function S(e,i,n,t,l){const a=o();if(l){const n=t.overlayManager.spatialReference;r(e,i,a,n)}else s(e,i,n,t,a);return a}export{w as SnappingVisualizer3D};
5
+ import e from"../../../Color.js";import{multiplyOpacity as i}from"../../../core/colorUtils.js";import"../../../core/has.js";import{destroyHandle as n}from"../../../core/handleUtils.js";import{l as t}from"../../../chunks/vec32.js";import{create as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as r}from"../../../geometry/projection/projectVectorToVector.js";import{onTheGroundElevationInfo as l,absoluteHeightElevationInfo as a}from"../../../support/elevationInfoUtils.js";import{vectorToRender as s}from"./support/viewUtils.js";import{ExtendedLineVisualElement as c}from"./visualElements/ExtendedLineVisualElement.js";import{ParallelLineVisualElement as p}from"./visualElements/ParallelLineVisualElement.js";import{PointVisualElement as d}from"./visualElements/PointVisualElement.js";import{RightAngleQuadVisualElement as u}from"./visualElements/RightAngleQuadVisualElement.js";import{toDehydratedPoint as m,isTarget as f,withSelfSnappingZ as g}from"../../interactive/sketch/normalizedPoint.js";import{defaults as v}from"../../interactive/snapping/Settings.js";import{SnappingVisualizer as h}from"../../interactive/snapping/SnappingVisualizer.js";import{LineSnappingHint as C}from"../../interactive/snapping/hints/LineSnappingHint.js";class w extends h{sortUniqueHints(e){return e.sort((e,i)=>(i instanceof C?i.length:0)-(e instanceof C?e.length:0))}visualizeIntersectionPoint(e,i){const{spatialReference:t,view:o}=i,r=j(i);return n(new d({view:o,primitive:"circle",geometry:m(e.intersectionPoint,t),elevationInfo:e.isDraped?l:a,size:20,outlineSize:2,color:r.intersectionPointColor,outlineColor:r.intersectionPointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizePoint(e,i){const{view:t,spatialReference:o}=i,r=j(i),l=E(e.point,e.domain,i);return n(new d({view:t,primitive:"circle",geometry:m(l,o),elevationInfo:x(e),size:20,outlineSize:2,color:r.pointColor,outlineColor:r.pointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizeLine(e,i){const{view:t,spatialReference:o}=i,r=j(i),l=E(e.lineStart,e.domain,i),a=E(e.lineEnd,e.domain,i);return n(D(e.type,l,a,o,x(e),t,r,e.isDraped,e.fadeLeft,e.fadeRight))}visualizeParallelSign(e,i){const{view:o,spatialReference:r}=i,l=j(i),{isDraped:a}=e,s=x(e),c=E(e.lineStart,e.domain,i),d=E(e.lineEnd,e.domain,i),u=S(c,r,s,o,a),m=S(d,r,s,o,a),f=t(m,u,m,.5),g=new p({view:o,attached:!1,offset:v.parallelLineHintOffset,length:v.parallelLineHintLength,width:v.parallelLineHintWidth,color:l.parallelSignColor,location:f,renderOccluded:a?4:16,isDraped:a,renderGroup:3,isDecoration:!0});return g.setDirectionFromPoints(u,f),g.attached=!0,n(g)}visualizeRightAngleQuad(e,i){const{view:t,spatialReference:o}=i,r=j(i),l=x(e),{isDraped:a}=e,s=E(e.previousVertex,e.domain,i),c=E(e.centerVertex,e.domain,i),p=E(e.nextVertex,e.domain,i),d=S(s,o,l,t,a),m=S(c,o,l,t,a),f=S(p,o,l,t,a);return n(new u({view:t,attached:!0,color:a?r.rightAngleColorDraped:r.rightAngleColor,renderOccluded:a?4:2,outlineRenderOccluded:a?4:16,outlineColor:r.rightAngleOutlineColor,outlineSize:v.rightAngleHintOutlineSize,size:v.rightAngleHintSize,isDraped:a,geometry:{previous:d,center:m,next:f},renderGroup:3,isDecoration:!0}))}}function j(n){const{effectiveTheme:t}=n.view,o=e.toUnitRGBA(t.accentColor),r=[0,0,0,0];return{intersectionPointColor:r,intersectionPointOutlineColor:o,pointColor:r,pointOutlineColor:o,lineColor:o,lineOutlineColor:void 0,parallelSignColor:o,rightAngleColor:o,rightAngleColorDraped:e.toUnitRGBA(i(t.accentColor,.5)),rightAngleOutlineColor:o}}function E(e,i,{selfSnappingZ:n,view:t,spatialReference:o}){return 2&i&&f(e)&&null!=n?g(e,n,t,o):e}function x(e){return e.isDraped?l:a}function D(e,i,n,t,o,r,l,a=!1,s=!0,p=!0){const d=S(i,t,o,r,a),u=S(n,t,o,r,a),m=new c({view:r,extensionType:3,start:d,end:u,isDraped:a,color:l.lineColor,renderOccluded:a?4:16,renderGroup:3,isDecoration:!0});switch(e){case 0:m.width=v.lineHintWidthTarget,m.fadedExtensions={start:0,end:v.lineHintFadedExtensions};break;case 2:m.width=v.lineHintWidthReference,m.fadedExtensions={start:0,end:0};break;case 1:m.width=v.lineHintWidthReference,m.fadedExtensions={start:s?v.lineHintFadedExtensions:0,end:p?v.lineHintFadedExtensions:0}}return m.attached=!0,m}function S(e,i,n,t,l){const a=o();if(l){const n=t.overlayManager.spatialReference;r(e,i,a,n)}else s(e,i,n,t,a);return a}export{w as SnappingVisualizer3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{createScreenPointArray as e,screenPointObjectToArray as n,castScreenPointArray as r}from"../../../../core/screenUtils.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h as o,d as l,l as s,c,e as a,g as i,f as u}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../../../geometry/Point.js";import{projectPoint as d}from"../../../../geometry/projectionUtils.js";import{intersectRay as f,create as g,getNormal as S,fromPositionAndNormal as y}from"../../../../geometry/support/plane.js";import{create as E,closestPoints as j}from"../../../../geometry/support/ray.js";import{projectPoint as v}from"../../../../geometry/support/vector.js";import{sv2d as x}from"../../../../geometry/support/vectorStacks.js";import{getZForElevationMode as w}from"../../../../support/elevationInfoUtils.js";import{fromScreen as b}from"../../support/geometryUtils/ray.js";import{Intersector as I}from"../../webgl-engine/lib/Intersector.js";import{terrainId as C}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{EventPipeline as H}from"../../../interactive/dragEventPipeline.js";function P(e,n){return U(e,()=>n)}function R(e){return U(e,e=>e.plane)}function U(e,t){const o=p(),l=p();let s=!1;return c=>{const a=t(c);if("start"===c.action){const t=n(c.screenStart,r(x.get())),l=b(e.state.camera,t,K);null!=l&&(s=f(a,l,o))}if(!s)return null;const i=n(c.screenEnd,r(x.get())),u=b(e.state.camera,i,K);return null==u?null:f(a,u,l)?{...c,renderStart:o,renderEnd:l,plane:a,ray:u}:null}}function h(n,r,t=0,o=null,l=null){let s=null;return c=>{if("start"===c.action&&(s=n.sceneIntersectionHelper.intersectElevationFromScreen(e(c.screenStart.x,c.screenStart.y),r,t,l),null!=s&&null!=o&&!d(s,s,o)))return null;if(null==s)return null;const a=n.sceneIntersectionHelper.intersectElevationFromScreen(e(c.screenEnd.x,c.screenEnd.y),r,t,l);return null!=a&&(null==o||d(a,a,o))?{...c,mapStart:s,mapEnd:a}:null}}function M(e,n,r,t=null,o=null){return h(e,r,w(n,e,r),t,o)}function k(e,n,r,t){const o=r.toMap(e.screenStart);return null!=o?M(n,o,r.elevationInfo,t):null}function F(e,n){const r=B,t=J,s=g();e.renderCoordsHelper.worldUpAtPosition(n,r);const c=o(S(s),r,l(t,n,e.state.camera.eye));return o(c,c,r),y(n,c,s)}function T(e,n,r){let t=null;const o=new H;return o.next(P(e,F(e,n))).next(A(e,n)).next(q(e,r)).next(e=>{e.mapEnd.x=e.mapStart.x,e.mapEnd.y=e.mapStart.y,t=e}),e=>(t=null,o.execute(e),t)}function A(e,n){const r=p(),t=s(n);e.renderCoordsHelper.worldUpAtPosition(n,r);const o=p(),m=p(),d=o=>{if(l(o,o,n),v(r,o,o),"global"===e.viewingMode){s(o)*Math.sign(a(r,o))<.001-t&&l(o,i(o,r,.001),n)}return u(o,o,n),o};return e=>(e.renderStart=d(c(o,e.renderStart)),e.renderEnd=d(c(m,e.renderEnd)),e)}function D(e,t){const o=o=>{const l=n(o,r(z)),s=b(e.state.camera,l,K);if(null==s)return null;const c=j(t,s,B,J);return c?.[0]};return e=>{const n=o(e.screenStart);if(null==n)return null;const r=o(e.screenEnd);return null==r?null:{...e,renderStart:n,renderEnd:r}}}function q(e,n){const r=e.renderCoordsHelper;return e=>{const t=r.fromRenderCoords(e.renderStart,new m({spatialReference:n})),o=r.fromRenderCoords(e.renderEnd,new m({spatialReference:n}));return null!=t&&null!=o?{...e,mapStart:t,mapEnd:o}:null}}function G(e){let n=null;return r=>{switch(r.action){case"start":n=e.disableDisplay();break;case"end":case"cancel":null!=n&&(n.remove(),n=null)}return r}}function O(r,t=null){const o=new I(r.state.viewingMode);o.options.selectionMode=!0,o.options.store=0,o.options.hud=!1;const l=e(),s={requiresGroundFeedback:!0,enableDraped:!0,exclude:new Set},c=p(),a=t??r.spatialReference,i=e=>{r.map.ground&&r.map.ground.opacity<1?s.exclude.add(C):s.exclude.delete(C),r.sceneIntersectionHelper.intersectIntersectorScreen(n(e,l),o,s);const t=o.results.min;let i;if(t.getIntersectionPoint(c))i=7===t.intersector?0:1;else{if(!o.results.ground.getIntersectionPoint(c))return null;i=0}return{location:r.renderCoordsHelper.fromRenderCoords(c,new m({spatialReference:a})),surfaceType:i}};let u;return e=>{if("start"===e.action){const n=i(e.screenStart);u=null!=n?n.location:null}if(null==u)return null;const n=i(e.screenEnd);return null!=n?.location?{...e,mapStart:u,mapEnd:n.location,surfaceType:n.surfaceType}:null}}const z=t(),B=p(),J=p(),K=E();export{q as convertToMapCoordinates,G as hideManipulatorWhileDragging,A as projectToWorldUp,O as screenToMap3D,M as screenToMapXYAtLocation,k as screenToMapXYForManipulatedObject,P as screenToRenderPlane,R as screenToRenderPlaneFromEvent,D as screenToRenderRay,T as screenToZConstrained};
5
+ import{createScreenPointArray as e,screenPointObjectToArray as n,castScreenPointArray as r}from"../../../../core/screenUtils.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as o,e as l,b as s,d as c,f as a,h as i,g as u}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../../../geometry/Point.js";import{projectPoint as d}from"../../../../geometry/projectionUtils.js";import{intersectRay as f,create as g,getNormal as S,fromPositionAndNormal as y}from"../../../../geometry/support/plane.js";import{create as E,closestPoints as j}from"../../../../geometry/support/ray.js";import{projectPoint as v}from"../../../../geometry/support/vector.js";import{sv2d as x}from"../../../../geometry/support/vectorStacks.js";import{getZForElevationMode as w}from"../../../../support/elevationInfoUtils.js";import{fromScreen as b}from"../../support/geometryUtils/ray.js";import{Intersector as I}from"../../webgl-engine/lib/Intersector.js";import{terrainId as C}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{EventPipeline as H}from"../../../interactive/dragEventPipeline.js";function P(e,n){return U(e,()=>n)}function R(e){return U(e,e=>e.plane)}function U(e,t){const o=p(),l=p();let s=!1;return c=>{const a=t(c);if("start"===c.action){const t=n(c.screenStart,r(x.get())),l=b(e.state.camera,t,K);null!=l&&(s=f(a,l,o))}if(!s)return null;const i=n(c.screenEnd,r(x.get())),u=b(e.state.camera,i,K);return null==u?null:f(a,u,l)?{...c,renderStart:o,renderEnd:l,plane:a,ray:u}:null}}function h(n,r,t=0,o=null,l=null){let s=null;return c=>{if("start"===c.action&&(s=n.sceneIntersectionHelper.intersectElevationFromScreen(e(c.screenStart.x,c.screenStart.y),r,t,l),null!=s&&null!=o&&!d(s,s,o)))return null;if(null==s)return null;const a=n.sceneIntersectionHelper.intersectElevationFromScreen(e(c.screenEnd.x,c.screenEnd.y),r,t,l);return null!=a&&(null==o||d(a,a,o))?{...c,mapStart:s,mapEnd:a}:null}}function M(e,n,r,t=null,o=null){return h(e,r,w(n,e,r),t,o)}function k(e,n,r,t){const o=r.toMap(e.screenStart);return null!=o?M(n,o,r.elevationInfo,t):null}function F(e,n){const r=B,t=J,s=g();e.renderCoordsHelper.worldUpAtPosition(n,r);const c=o(S(s),r,l(t,n,e.state.camera.eye));return o(c,c,r),y(n,c,s)}function T(e,n,r){let t=null;const o=new H;return o.next(P(e,F(e,n))).next(A(e,n)).next(q(e,r)).next(e=>{e.mapEnd.x=e.mapStart.x,e.mapEnd.y=e.mapStart.y,t=e}),e=>(t=null,o.execute(e),t)}function A(e,n){const r=p(),t=s(n);e.renderCoordsHelper.worldUpAtPosition(n,r);const o=p(),m=p(),d=o=>{if(l(o,o,n),v(r,o,o),"global"===e.viewingMode){s(o)*Math.sign(a(r,o))<.001-t&&l(o,i(o,r,.001),n)}return u(o,o,n),o};return e=>(e.renderStart=d(c(o,e.renderStart)),e.renderEnd=d(c(m,e.renderEnd)),e)}function D(e,t){const o=o=>{const l=n(o,r(z)),s=b(e.state.camera,l,K);if(null==s)return null;const c=j(t,s,B,J);return c?.[0]};return e=>{const n=o(e.screenStart);if(null==n)return null;const r=o(e.screenEnd);return null==r?null:{...e,renderStart:n,renderEnd:r}}}function q(e,n){const r=e.renderCoordsHelper;return e=>{const t=r.fromRenderCoords(e.renderStart,new m({spatialReference:n})),o=r.fromRenderCoords(e.renderEnd,new m({spatialReference:n}));return null!=t&&null!=o?{...e,mapStart:t,mapEnd:o}:null}}function G(e){let n=null;return r=>{switch(r.action){case"start":n=e.disableDisplay();break;case"end":case"cancel":null!=n&&(n.remove(),n=null)}return r}}function O(r,t=null){const o=new I(r.state.viewingMode);o.options.selectionMode=!0,o.options.store=0,o.options.hud=!1;const l=e(),s={requiresGroundFeedback:!0,enableDraped:!0,exclude:new Set},c=p(),a=t??r.spatialReference,i=e=>{r.map.ground&&r.map.ground.opacity<1?s.exclude.add(C):s.exclude.delete(C),r.sceneIntersectionHelper.intersectIntersectorScreen(n(e,l),o,s);const t=o.results.min;let i;if(t.getIntersectionPoint(c))i=7===t.intersector?0:1;else{if(!o.results.ground.getIntersectionPoint(c))return null;i=0}return{location:r.renderCoordsHelper.fromRenderCoords(c,new m({spatialReference:a})),surfaceType:i}};let u;return e=>{if("start"===e.action){const n=i(e.screenStart);u=null!=n?n.location:null}if(null==u)return null;const n=i(e.screenEnd);return null!=n?.location?{...e,mapStart:u,mapEnd:n.location,surfaceType:n.surfaceType}:null}}const z=t(),B=p(),J=p(),K=E();export{q as convertToMapCoordinates,G as hideManipulatorWhileDragging,A as projectToWorldUp,O as screenToMap3D,M as screenToMapXYAtLocation,k as screenToMapXYForManipulatedObject,P as screenToRenderPlane,R as screenToRenderPlaneFromEvent,D as screenToRenderRay,T as screenToZConstrained};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{unitRGBAFromColor as t}from"../../../../../core/colorUtils.js";import{handlesGroup as i,makeHandle as r}from"../../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as n,initial as a,when as l}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as m}from"../../../../../core/accessorSupport/decorators/subclass.js";import{i as p}from"../../../../../chunks/vec32.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEffectiveElevationInfo as u,getEffectiveElevationMode as d}from"../../../../../support/elevationInfoUtils.js";import v from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as f}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{meshTransformFastUpdateHandles as y}from"../meshFastUpdateUtils.js";import{Settings as E}from"../settings.js";import{ExtendedLineVisualElement as V}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as w}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as _}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as j}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as I}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as L}from"../../../layers/graphics/GraphicState.js";import{DrawGraphicTool as S,geometryTypeToDrawOperationGeometryType as x}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as D}from"../../../../draw/DrawOperation.js";import{ElevationDrawSurface as G,SceneDrawSurface as C}from"../../../../draw/drawSurfaces.js";import{updateMeshTransformFromTooltipInfo as O}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{autorun as T}from"../../../../../core/accessorSupport/trackingUtils.js";let b=class extends S{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new E({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t,unit:i,featureExpressionInfo:r}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new v({mode:e,offset:t,unit:i,featureExpressionInfo:r})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:u(t)}}return e}initializeGraphic(e){const{view:t}=this,r=this._createGraphicState=new L({graphic:e});return i([t.maskOccludee(e),t.trackGraphicState(r),o(()=>({element:this._outlineVisualElement,isDraped:r.isDraped}),({element:e,isDraped:t})=>{e&&(e.isDraped=t)},n),T(()=>{O(this.tooltipInfos.mesh,this.geometryToPlace)}),this._setupLoadingIndicator(r),...y(r)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new D({view:this.view,manipulators:this.manipulators,geometryType:x(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new C(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new G(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new g,segmentLabels:t?new f:null,labelOptions:this.sketchOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,this.elevationInfo),cursor:this.cursor,constraintsEnabled:!0,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils})}onActiveVertexChanged(e){const{view:n}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),r();const l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=m;const p=l.visualElements.zVerticalLine,h=new V({view:n,extensionType:p.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._verticalLineVisualElement=h;const u=i([o(()=>l.visualElements.zVerticalLine,e=>e.apply(h),a),o(()=>({selectedColor:t(l.colors.selected),outlineColor:t(l.manipulators.vertex.outlineColor)}),({selectedColor:e,outlineColor:t})=>{m.color=e,m.outlineColor=t},a),r(()=>{this._activeVertexVisualElement=s(this._activeVertexVisualElement),this._verticalLineVisualElement=s(this._verticalLineVisualElement)})]);return m.attached=!0,this._updateVerticalLineVisualElement(e),u}_updateVerticalLineVisualElement(e){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:i,elevationProvider:r}=this.view;p(U,e[0],e[1],e[2]),z.setFromElevationInfo(this.elevationInfo),U[2]=j(U,r,z,i);i.toRenderCoords(U,this.view.spatialReference,U)?(t.setStartEndFromWorldDownAtLocation(U),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,r();const t=this.internalGraphicsLayer.elevationInfo,{view:n}=this,l=this._settings,c=new w({view:n,geometry:e,elevationInfo:t,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,t),attached:!1,isDecoration:!0});this._outlineVisualElement=c;const m=i([o(()=>l.visualElements.lineObjects.outline,e=>e.apply(c),a),o(()=>l.visualElements.lineObjects.shadowStyle,e=>e.apply(c),a),r(()=>{this._outlineVisualElement=s(this._outlineVisualElement)})]);return c.attached=!0,c.laserlineEnabled=!0,m}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,r();const{view:n}=this,l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0}),p=i([o(()=>({color:t(l.manipulators.vertex.color),outlineColor:t(l.manipulators.vertex.outlineColor)}),({color:e,outlineColor:t})=>{m.color=e,m.outlineColor=t},a),r(()=>{this._verticesVisualElement=s(this._verticesVisualElement)})]);return m.attached=!0,this._verticesVisualElement=m,p}updateGraphicGeometry(e){if("mesh"===this.geometryType&&"point"===e?.type){const t=this.geometryToPlace;t?.centerAt(e),O(this.tooltipInfos.mesh,t);const i=this._graphic;return void(t&&i.geometry===t||(i.geometry=t))}super.updateGraphicGeometry(e)}_setupLoadingIndicator(e){const{drawOperation:t}=this;if(!this.geometryToPlace||e.displaying)return t.loading=!1,null;t.loading=!0;const s=r(()=>{t.loading=!1});let o;const a=()=>{o&&cancelAnimationFrame(o)};return i([l(()=>e.displaying,()=>{a(),o=requestAnimationFrame(()=>s.remove())},{...n,once:!0}),r(a),s])}};e([c({constructOnly:!0})],b.prototype,"elevationInfo",void 0),e([c({constructOnly:!0})],b.prototype,"geometryType",void 0),e([c()],b.prototype,"type",void 0),e([c({constructOnly:!0})],b.prototype,"view",void 0),b=e([m("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],b);const z=new I,U=h();export{b as DrawGraphicTool3D};
5
+ import{__decorate as e}from"tslib";import{unitRGBAFromColor as t}from"../../../../../core/colorUtils.js";import{handlesGroup as i,makeHandle as r}from"../../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as n,initial as a,when as l}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as m}from"../../../../../core/accessorSupport/decorators/subclass.js";import{j as p}from"../../../../../chunks/vec32.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEffectiveElevationInfo as u,getEffectiveElevationMode as d}from"../../../../../support/elevationInfoUtils.js";import v from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as f}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{meshTransformFastUpdateHandles as y}from"../meshFastUpdateUtils.js";import{Settings as E}from"../settings.js";import{ExtendedLineVisualElement as V}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as w}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as _}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as j}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as I}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as L}from"../../../layers/graphics/GraphicState.js";import{DrawGraphicTool as S,geometryTypeToDrawOperationGeometryType as x}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as D}from"../../../../draw/DrawOperation.js";import{ElevationDrawSurface as G,SceneDrawSurface as C}from"../../../../draw/drawSurfaces.js";import{updateMeshTransformFromTooltipInfo as O}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{autorun as T}from"../../../../../core/accessorSupport/trackingUtils.js";let b=class extends S{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new E({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t,unit:i,featureExpressionInfo:r}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new v({mode:e,offset:t,unit:i,featureExpressionInfo:r})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:u(t)}}return e}initializeGraphic(e){const{view:t}=this,r=this._createGraphicState=new L({graphic:e});return i([t.maskOccludee(e),t.trackGraphicState(r),o(()=>({element:this._outlineVisualElement,isDraped:r.isDraped}),({element:e,isDraped:t})=>{e&&(e.isDraped=t)},n),T(()=>{O(this.tooltipInfos.mesh,this.geometryToPlace)}),this._setupLoadingIndicator(r),...y(r)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new D({view:this.view,manipulators:this.manipulators,geometryType:x(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new C(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new G(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new g,segmentLabels:t?new f:null,labelOptions:this.sketchOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,this.elevationInfo),cursor:this.cursor,constraintsEnabled:!0,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils})}onActiveVertexChanged(e){const{view:n}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),r();const l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=m;const p=l.visualElements.zVerticalLine,h=new V({view:n,extensionType:p.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._verticalLineVisualElement=h;const u=i([o(()=>l.visualElements.zVerticalLine,e=>e.apply(h),a),o(()=>({selectedColor:t(l.colors.selected),outlineColor:t(l.manipulators.vertex.outlineColor)}),({selectedColor:e,outlineColor:t})=>{m.color=e,m.outlineColor=t},a),r(()=>{this._activeVertexVisualElement=s(this._activeVertexVisualElement),this._verticalLineVisualElement=s(this._verticalLineVisualElement)})]);return m.attached=!0,this._updateVerticalLineVisualElement(e),u}_updateVerticalLineVisualElement(e){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:i,elevationProvider:r}=this.view;p(U,e[0],e[1],e[2]),z.setFromElevationInfo(this.elevationInfo),U[2]=j(U,r,z,i);i.toRenderCoords(U,this.view.spatialReference,U)?(t.setStartEndFromWorldDownAtLocation(U),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,r();const t=this.internalGraphicsLayer.elevationInfo,{view:n}=this,l=this._settings,c=new w({view:n,geometry:e,elevationInfo:t,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,t),attached:!1,isDecoration:!0});this._outlineVisualElement=c;const m=i([o(()=>l.visualElements.lineObjects.outline,e=>e.apply(c),a),o(()=>l.visualElements.lineObjects.shadowStyle,e=>e.apply(c),a),r(()=>{this._outlineVisualElement=s(this._outlineVisualElement)})]);return c.attached=!0,c.laserlineEnabled=!0,m}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,r();const{view:n}=this,l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0}),p=i([o(()=>({color:t(l.manipulators.vertex.color),outlineColor:t(l.manipulators.vertex.outlineColor)}),({color:e,outlineColor:t})=>{m.color=e,m.outlineColor=t},a),r(()=>{this._verticesVisualElement=s(this._verticesVisualElement)})]);return m.attached=!0,this._verticesVisualElement=m,p}updateGraphicGeometry(e){if("mesh"===this.geometryType&&"point"===e?.type){const t=this.geometryToPlace;t?.centerAt(e),O(this.tooltipInfos.mesh,t);const i=this._graphic;return void(t&&i.geometry===t||(i.geometry=t))}super.updateGraphicGeometry(e)}_setupLoadingIndicator(e){const{drawOperation:t}=this;if(!this.geometryToPlace||e.displaying)return t.loading=!1,null;t.loading=!0;const s=r(()=>{t.loading=!1});let o;const a=()=>{o&&cancelAnimationFrame(o)};return i([l(()=>e.displaying,()=>{a(),o=requestAnimationFrame(()=>s.remove())},{...n,once:!0}),r(a),s])}};e([c({constructOnly:!0})],b.prototype,"elevationInfo",void 0),e([c({constructOnly:!0})],b.prototype,"geometryType",void 0),e([c()],b.prototype,"type",void 0),e([c({constructOnly:!0})],b.prototype,"view",void 0),b=e([m("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],b);const z=new I,U=h();export{b as DrawGraphicTool3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{removeHandles as e,handlesGroup as t,destroyHandle as n,refHandle as a}from"../../../../core/handleUtils.js";import{deg2rad as l}from"../../../../core/mathUtils.js";import{watch as i,initial as o}from"../../../../core/reactiveUtils.js";import{signal as s}from"../../../../core/signal.js";import{i as r,f as c,g as u}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as h}from"../Manipulator3D.js";import{manipulatedObjectGeometry as p}from"./manipulatedObjectUtils.js";import{ManipulatorState as d}from"./ManipulatorState.js";import{Settings as f}from"./settings.js";import{ExtendedLineVisualElement as v}from"../visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as g}from"../visualElements/LaserlineVisualElement.js";import{OutlineVisualElement as b}from"../visualElements/OutlineVisualElement.js";function E(t){const{object:n}=t,a=j(t),l=[a,w(t,a.visualElement)];return n.maskOccludee&&l.push(n.maskOccludee()),{visualElement:a.visualElement,remove:()=>e(l)}}function j(e){const{view:a,object:l}=e,s=p(l),r=new b({view:a,geometry:M(s)?s:null,elevationInfo:l.elevationInfo,attached:!1,isDecoration:!0}),c=new f({getTheme:()=>a.effectiveTheme}),u=()=>{r.attached=l.visible},m=t([i(()=>c.visualElements.lineObjects.outline,e=>e.apply(r),o),i(()=>c.visualElements.lineObjects.shadowStyle,e=>e.apply(r),o),i(()=>l.visible,u),i(()=>l.isDraped,e=>{r.isDraped=e},o),l.on("committed",()=>{const e=p(l);r.geometry=M(e)?e:null}),n(r)]);return u(),{visualElement:r,remove:()=>m.remove()}}function w(r,c){const{object:u,view:m}=r,h=[],b=u.elevationInfo,E="on-the-ground"===b.mode||!b.offset&&"absolute-height"!==b.mode,j=new d,w=new f({getTheme:()=>m.effectiveTheme}),O=w.visualElements,D=new v({view:m,extensionType:O.zVerticalLine.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0}),T=l(O.heightPlaneAngleCutoff),L=new g({view:m,attached:!1,angleCutoff:T,isDecoration:!0}),x=s(1);h.push(i(()=>({lineShadowStyle:w.visualElements.lineObjects.shadowStyle,pointShadowStyle:w.visualElements.pointObjects.shadowStyle,alpha:x.value}),({lineShadowStyle:e,pointShadowStyle:t,alpha:n})=>{e.apply(c,n),t.apply(D,n)},o));const C=s(1);h.push(i(()=>({heightPlane:w.visualElements.heightPlane,alpha:C.value}),({heightPlane:e,alpha:t})=>e.apply(L,t),o));const V=()=>{j.update(r);const e=p(u);if(!u.visible||E&&(u.isDraped||!M(e)||!e.hasZ))return c.laserlineEnabled=!1,D.attached=!1,void(L.attached=!1);c.laserlineEnabled=!0;const t=4&j.grabbingState?O.laserlineAlphaMultiplier:1;x.value=t;const n=2&j.grabbingState?O.laserlineAlphaMultiplier:1;C.value=n,y(D,j),S(r,c,L,j)};h.push(i(()=>w.visualElements.zVerticalLine,e=>e.apply(D),o)),h.push(u.on("committed",V),i(()=>u.visible,V),c.events.on("attachment-origin-changed",V),n(D),n(L));const A=[],P=()=>{e(A),A.length=0,r.forEachManipulator(e=>A.push(e.events.on("grab-changed",V))),r.forEachManipulator(e=>A.push(e.events.on("select-changed",V))),V()};return P(),h.push(r.onManipulatorsChanged(P),a(()=>t(A))),t(h)}function y(e,t){const n=1===t.numSelected?t.firstSelected:t.numSelected>1&&null!=t.firstGrabbedXY?t.firstGrabbedXY:null;null!=n?(e.setStartEndFromWorldDownAtLocation(n.renderLocation),e.attached=!0):e.attached=!1}function S(e,t,n,a){if(a.numSelected>0){r(O,0,0,0);let t=0;e.forEachManipulator((e,n)=>{1===n&&e.selected&&e instanceof h&&(c(O,O,e.renderLocation),t++)}),t>0?(n.heightManifoldTarget=u(O,O,1/t),n.attached=!0):n.attached=!1}else{const a=t.attachmentOrigin;null!=a&&e.view.renderCoordsHelper.toRenderCoords(a,O)?(n.heightManifoldTarget=O,n.attached=!0):n.attached=!1}}function M(e){return null!=e&&("polygon"===e.type||"polyline"===e.type)}const O=m();export{E as createVisualElements};
5
+ import{removeHandles as e,handlesGroup as t,destroyHandle as n,refHandle as a}from"../../../../core/handleUtils.js";import{deg2rad as l}from"../../../../core/mathUtils.js";import{watch as i,initial as o}from"../../../../core/reactiveUtils.js";import{signal as s}from"../../../../core/signal.js";import{j as r,g as c,h as u}from"../../../../chunks/vec32.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as m}from"../Manipulator3D.js";import{manipulatedObjectGeometry as p}from"./manipulatedObjectUtils.js";import{ManipulatorState as d}from"./ManipulatorState.js";import{Settings as f}from"./settings.js";import{ExtendedLineVisualElement as v}from"../visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as g}from"../visualElements/LaserlineVisualElement.js";import{OutlineVisualElement as b}from"../visualElements/OutlineVisualElement.js";function E(t){const{object:n}=t,a=j(t),l=[a,w(t,a.visualElement)];return n.maskOccludee&&l.push(n.maskOccludee()),{visualElement:a.visualElement,remove:()=>e(l)}}function j(e){const{view:a,object:l}=e,s=p(l),r=new b({view:a,geometry:M(s)?s:null,elevationInfo:l.elevationInfo,attached:!1,isDecoration:!0}),c=new f({getTheme:()=>a.effectiveTheme}),u=()=>{r.attached=l.visible},h=t([i(()=>c.visualElements.lineObjects.outline,e=>e.apply(r),o),i(()=>c.visualElements.lineObjects.shadowStyle,e=>e.apply(r),o),i(()=>l.visible,u),i(()=>l.isDraped,e=>{r.isDraped=e},o),l.on("committed",()=>{const e=p(l);r.geometry=M(e)?e:null}),n(r)]);return u(),{visualElement:r,remove:()=>h.remove()}}function w(r,c){const{object:u,view:h}=r,m=[],b=u.elevationInfo,E="on-the-ground"===b.mode||!b.offset&&"absolute-height"!==b.mode,j=new d,w=new f({getTheme:()=>h.effectiveTheme}),O=w.visualElements,D=new v({view:h,extensionType:O.zVerticalLine.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0}),T=l(O.heightPlaneAngleCutoff),L=new g({view:h,attached:!1,angleCutoff:T,isDecoration:!0}),x=s(1);m.push(i(()=>({lineShadowStyle:w.visualElements.lineObjects.shadowStyle,pointShadowStyle:w.visualElements.pointObjects.shadowStyle,alpha:x.value}),({lineShadowStyle:e,pointShadowStyle:t,alpha:n})=>{e.apply(c,n),t.apply(D,n)},o));const C=s(1);m.push(i(()=>({heightPlane:w.visualElements.heightPlane,alpha:C.value}),({heightPlane:e,alpha:t})=>e.apply(L,t),o));const V=()=>{j.update(r);const e=p(u);if(!u.visible||E&&(u.isDraped||!M(e)||!e.hasZ))return c.laserlineEnabled=!1,D.attached=!1,void(L.attached=!1);c.laserlineEnabled=!0;const t=4&j.grabbingState?O.laserlineAlphaMultiplier:1;x.value=t;const n=2&j.grabbingState?O.laserlineAlphaMultiplier:1;C.value=n,y(D,j),S(r,c,L,j)};m.push(i(()=>w.visualElements.zVerticalLine,e=>e.apply(D),o)),m.push(u.on("committed",V),i(()=>u.visible,V),c.events.on("attachment-origin-changed",V),n(D),n(L));const A=[],P=()=>{e(A),A.length=0,r.forEachManipulator(e=>A.push(e.events.on("grab-changed",V))),r.forEachManipulator(e=>A.push(e.events.on("select-changed",V))),V()};return P(),m.push(r.onManipulatorsChanged(P),a(()=>t(A))),t(m)}function y(e,t){const n=1===t.numSelected?t.firstSelected:t.numSelected>1&&null!=t.firstGrabbedXY?t.firstGrabbedXY:null;null!=n?(e.setStartEndFromWorldDownAtLocation(n.renderLocation),e.attached=!0):e.attached=!1}function S(e,t,n,a){if(a.numSelected>0){r(O,0,0,0);let t=0;e.forEachManipulator((e,n)=>{1===n&&e.selected&&e instanceof m&&(c(O,O,e.renderLocation),t++)}),t>0?(n.heightManifoldTarget=u(O,O,1/t),n.attached=!0):n.attached=!1}else{const a=t.attachmentOrigin;null!=a&&e.view.renderCoordsHelper.toRenderCoords(a,O)?(n.heightManifoldTarget=O,n.attached=!0):n.attached=!1}}function M(e){return null!=e&&("polygon"===e.type||"polyline"===e.type)}const O=h();export{E as createVisualElements};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../Color.js";import{EventEmitter as a}from"../../../../../core/Evented.js";import r from"../../../../../core/Handles.js";import{makeHandle as e,handlesGroup as i}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{watch as s,initial as n}from"../../../../../core/reactiveUtils.js";import{fromTranslation as l,fromZRotation as p,multiply as u,fromRotation as h,fromScaling as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as d}from"../../../../../chunks/vec32.js";import{fromValues as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as _,sm4d as g}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as M}from"../../Manipulator3D.js";import{RenderObject as w}from"../../RenderObject.js";import{screenToMapXYAtLocation as v}from"../dragEventPipeline3D.js";import{discRadius as j,discTranslateArrowOffset as b,discTranslateArrowSize as y,discHeight as A}from"./config.js";import{Manipulation as I}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as x}from"./moveUtils.js";import{createExtrudedTriangle as D,transformInPlace as T}from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as P}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as S,dragAtLocation as E,constrainToMapAxis as O,addScreenDelta as U}from"../../../../interactive/dragEventPipeline.js";class R extends I{constructor(t){super(),this._handles=new r,this._arrowManipulatorInfos=new Array,this._angle=0,this._scale=1,this._radius=j,this._updateAfterDrag=!1,this.events=new a,this._tool=t.tool,this._view=t.view,this._opaqueMaterial=this._createMaterial(),this._transparentMaterial=this._createMaterial(.5),null!=t.radius&&(this._radius=t.radius),this._createManipulators(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}set orthogonalAvailable(t){this._arrowManipulatorInfos.length>=3&&(this._arrowManipulatorInfos[1].manipulator.available=t,this._arrowManipulatorInfos[3].manipulator.available=t)}destroy(){this._handles=o(this._handles),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._arrowManipulatorInfos.length=0}forEachManipulator(t){for(const{manipulator:a}of this._arrowManipulatorInfos)t(a,1)}createManipulatedObjectDragPipeline(t,a,r){if(!a.operations)return e();const i=a.operations.data.spatialReference,o=a.graphic;return x(a,r,r=>this.createDragPipeline((a,e,i,o,s)=>(({steps:e,cancel:i}=t(a,e,i,o,s)),r(a,e,i)),a.elevationInfo,i,o))}createDragPipeline(t,a,r,e){return i(this._arrowManipulatorInfos.map(({manipulator:i},o)=>S(i,(i,s,n,l,p)=>{const u=s.next(t=>({...t,manipulatorType:1})).next(E(this._view,i.elevationAlignedLocation)).next(v(this._view,i.elevationAlignedLocation,a,r,e)).next(O(i.location,this.angle+(o+1)*Math.PI*.5)).next(U());t(i,u,n,l,p)})))}get angle(){return this._angle}set angle(t){this._angle=t,this.dragging?this._updateAfterDrag=!0:this._updateManipulatorTransform()}get displayScale(){return this._scale}set displayScale(t){this._scale=t,this._updateManipulatorTransform()}get radius(){return this._radius}set radius(t){this._radius!==t&&(this._radius=t,this._updateManipulators())}_updateManipulators(){for(let t=0;t<this._arrowManipulatorInfos.length;t++)this._updateArrowManipulator(this._arrowManipulatorInfos[t],t);this._updateManipulatorTransform()}_updateArrowManipulator({manipulator:t,transform:a},r){const e=this._radius/j,i=y*e,o=i*Math.sqrt(3)/2,s=D(this._opaqueMaterial,o,i/2,i/2,A);T(s,l(g.get(),d(_.get(),0,-o/3,0))),t.renderObjects=[new w(s,2),new w(s.instantiate({material:this._transparentMaterial}),1)],t.radius=o/3*2*1.2;const n=p(g.get(),r*Math.PI/2),h=l(g.get(),d(_.get(),0,b*e,0));u(a,n,h)}_createManipulators(){for(let t=0;t<4;t++){const a=this._createArrowManipulator(t);this._arrowManipulatorInfos.push(a)}this._updateManipulatorTransform()}_updateManipulatorTransform(){const t=this.angle,a=h(g.get(),t,f(0,0,1));if(null==a)return;const r=c(g.get(),d(_.get(),this.displayScale,this.displayScale,this.displayScale)),e=u(g.get(),r,a);for(const i of this._arrowManipulatorInfos){const t=u(g.get(),e,i.transform);i.manipulator.modelTransform=t}}_createArrowManipulator(t){const a=new M({view:this._view,autoScaleRenderObjects:!1,worldOriented:!0,focusMultiplier:1,touchMultiplier:1,collisionType:{type:"disc",direction:f(0,0,1)}}),r={manipulator:a,transform:m()};return this._updateArrowManipulator(r,t),this._handles.add(a.events.on("drag",t=>{this._updateAfterDrag&&"end"===t.action&&!this.dragging&&(this._updateManipulatorTransform(),this._updateAfterDrag=!1)})),r}_createMaterial(a=1){const r=new P({cullFace:2,renderOccluded:2,isDecoration:!0});return this._handles.add(s(()=>t.toUnitRGBA(this._view.effectiveTheme.accentColor),t=>{t[3]*=a,r.setParameters({color:t})},n)),r}get test(){}}export{R as MoveXYAxisManipulation};
5
+ import t from"../../../../../Color.js";import{EventEmitter as a}from"../../../../../core/Evented.js";import r from"../../../../../core/Handles.js";import{makeHandle as e,handlesGroup as i}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{watch as s,initial as n}from"../../../../../core/reactiveUtils.js";import{fromTranslation as l,fromZRotation as p,multiply as u,fromRotation as h,fromScaling as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as d}from"../../../../../chunks/vec32.js";import{fromValues as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as _,sm4d as g}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as M}from"../../Manipulator3D.js";import{RenderObject as w}from"../../RenderObject.js";import{screenToMapXYAtLocation as v}from"../dragEventPipeline3D.js";import{discRadius as j,discTranslateArrowOffset as b,discTranslateArrowSize as y,discHeight as A}from"./config.js";import{Manipulation as I}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as x}from"./moveUtils.js";import{createExtrudedTriangle as D,transformInPlace as T}from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as P}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as S,dragAtLocation as E,constrainToMapAxis as O,addScreenDelta as U}from"../../../../interactive/dragEventPipeline.js";class R extends I{constructor(t){super(),this._handles=new r,this._arrowManipulatorInfos=new Array,this._angle=0,this._scale=1,this._radius=j,this._updateAfterDrag=!1,this.events=new a,this._tool=t.tool,this._view=t.view,this._opaqueMaterial=this._createMaterial(),this._transparentMaterial=this._createMaterial(.5),null!=t.radius&&(this._radius=t.radius),this._createManipulators(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}set orthogonalAvailable(t){this._arrowManipulatorInfos.length>=3&&(this._arrowManipulatorInfos[1].manipulator.available=t,this._arrowManipulatorInfos[3].manipulator.available=t)}destroy(){this._handles=o(this._handles),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._arrowManipulatorInfos.length=0}forEachManipulator(t){for(const{manipulator:a}of this._arrowManipulatorInfos)t(a,1)}createManipulatedObjectDragPipeline(t,a,r){if(!a.operations)return e();const i=a.operations.data.spatialReference,o=a.graphic;return x(a,r,r=>this.createDragPipeline((a,e,i,o,s)=>(({steps:e,cancel:i}=t(a,e,i,o,s)),r(a,e,i)),a.elevationInfo,i,o))}createDragPipeline(t,a,r,e){return i(this._arrowManipulatorInfos.map(({manipulator:i},o)=>S(i,(i,s,n,l,p)=>{const u=s.next(t=>({...t,manipulatorType:1})).next(E(this._view,i.elevationAlignedLocation)).next(v(this._view,i.elevationAlignedLocation,a,r,e)).next(O(i.location,this.angle+(o+1)*Math.PI*.5)).next(U());t(i,u,n,l,p)})))}get angle(){return this._angle}set angle(t){this._angle=t,this.dragging?this._updateAfterDrag=!0:this._updateManipulatorTransform()}get displayScale(){return this._scale}set displayScale(t){this._scale=t,this._updateManipulatorTransform()}get radius(){return this._radius}set radius(t){this._radius!==t&&(this._radius=t,this._updateManipulators())}_updateManipulators(){for(let t=0;t<this._arrowManipulatorInfos.length;t++)this._updateArrowManipulator(this._arrowManipulatorInfos[t],t);this._updateManipulatorTransform()}_updateArrowManipulator({manipulator:t,transform:a},r){const e=this._radius/j,i=y*e,o=i*Math.sqrt(3)/2,s=D(this._opaqueMaterial,o,i/2,i/2,A);T(s,l(g.get(),d(_.get(),0,-o/3,0))),t.renderObjects=[new w(s,2),new w(s.instantiate({material:this._transparentMaterial}),1)],t.radius=o/3*2*1.2;const n=p(g.get(),r*Math.PI/2),h=l(g.get(),d(_.get(),0,b*e,0));u(a,n,h)}_createManipulators(){for(let t=0;t<4;t++){const a=this._createArrowManipulator(t);this._arrowManipulatorInfos.push(a)}this._updateManipulatorTransform()}_updateManipulatorTransform(){const t=this.angle,a=h(g.get(),t,f(0,0,1));if(null==a)return;const r=c(g.get(),d(_.get(),this.displayScale,this.displayScale,this.displayScale)),e=u(g.get(),r,a);for(const i of this._arrowManipulatorInfos){const t=u(g.get(),e,i.transform);i.manipulator.modelTransform=t}}_createArrowManipulator(t){const a=new M({view:this._view,autoScaleRenderObjects:!1,worldOriented:!0,focusMultiplier:1,touchMultiplier:1,collisionType:{type:"disc",direction:f(0,0,1)}}),r={manipulator:a,transform:m()};return this._updateArrowManipulator(r,t),this._handles.add(a.events.on("drag",t=>{this._updateAfterDrag&&"end"===t.action&&!this.dragging&&(this._updateManipulatorTransform(),this._updateAfterDrag=!1)})),r}_createMaterial(a=1){const r=new P({cullFace:2,renderOccluded:2,isDecoration:!0});return this._handles.add(s(()=>t.toUnitRGBA(this._view.effectiveTheme.accentColor),t=>{t[3]*=a,r.setParameters({color:t})},n)),r}get test(){}}export{R as MoveXYAxisManipulation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../Color.js";import e from"../../../../../core/Handles.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{fromScaling as o}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as l}from"../../../../../chunks/vec32.js";import{fromValues as p}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as c,sm4d as m}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as h}from"../../Manipulator3D.js";import{RenderObject as u}from"../../RenderObject.js";import{screenToMapXYAtLocation as d}from"../dragEventPipeline3D.js";import{discRadius as _,discCollisionRadius as f,geometrySegments as g,discHeight as j}from"./config.js";import{Manipulation as M}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as v}from"./moveUtils.js";import{SnapToScene as S}from"../snapping/SnapToScene.js";import{createCylinderGeometry as T}from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as w}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as b,dragAtLocation as y,addScreenDelta as x}from"../../../../interactive/dragEventPipeline.js";class D extends M{constructor(t){super(),this._handles=new e,this._snapToScene=new S,this._scale=1,this._radius=_,this._view=t.view,this._tool=t.tool,this._discMaterial=this._createMaterial(),this._discMaterialTransparent=this._createMaterial(.5),null!=t.snapToScene&&(this.snapToScene=t.snapToScene),null!=t.radius&&(this._radius=t.radius),this._createManipulator(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._handles=a(this._handles),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulator=null}forEachManipulator(t){t(this._manipulator,1)}get displayScale(){return this._scale}set displayScale(t){this._scale=t,this._updateManipulatorTransform()}get snapToScene(){return this._snapToScene.enabled}set snapToScene(t){this._snapToScene.enabled=t}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._updateManipulator())}get discManipulator(){return this._manipulator}createManipulatedObjectDragPipeline(t,e,a){if(!e.operations)return i();const r=e.graphic,s=e.elevationInfo,o=e.operations.data.spatialReference;return v(e,a,e=>this.createDragPipeline((i,a,r,s,o)=>(({steps:a,cancel:r}=t(i,a,r,s,o)),e(i,a,r)),s,o,r))}createDragPipeline(t,e,i,a){const r=this._view;return b(this._manipulator,(s,o,n,l,p)=>{const c=o.next(y(r,s.elevationAlignedLocation)).next(d(r,s.elevationAlignedLocation,e,i,a)).next(...this._snapToScene.createDragEventPipelineStep(r,e)).next(t=>({...t,manipulatorType:1})).next(x());t(s,c,n,l,p)})}_updateManipulatorTransform(){const t=o(m.get(),l(c.get(),this.displayScale,this.displayScale,this.displayScale));this._manipulator.modelTransform=t}_createManipulator(){const t=this._view;this._manipulator=new h({view:t,worldSized:!1,autoScaleRenderObjects:!1,focusMultiplier:1,touchMultiplier:1,collisionType:{type:"disc",direction:p(0,0,1)},worldOriented:!0}),this._updateManipulator()}_updateManipulator(){const t=T(this._discMaterial,j,1,g,p(0,0,1),p(0,0,0));t.transformation=o(n(),p(this._radius,this._radius,this._radius)),this._manipulator.renderObjects=[new u(t,2),new u(t.instantiate({material:this._discMaterialTransparent}),1)],this._manipulator.radius=f*(this._radius/_)}_createMaterial(e=1){const i=new w({cullFace:2,renderOccluded:2,isDecoration:!0});return this._handles.add(r(()=>t.toUnitRGBA(this._view.effectiveTheme.accentColor),t=>{t[3]*=e,i.setParameters({color:t})},s)),i}get test(){}}export{D as MoveXYDiscManipulation};
5
+ import t from"../../../../../Color.js";import e from"../../../../../core/Handles.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{watch as r,initial as s}from"../../../../../core/reactiveUtils.js";import{fromScaling as o}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as l}from"../../../../../chunks/vec32.js";import{fromValues as p}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{sv3d as c,sm4d as m}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as h}from"../../Manipulator3D.js";import{RenderObject as u}from"../../RenderObject.js";import{screenToMapXYAtLocation as d}from"../dragEventPipeline3D.js";import{discRadius as _,discCollisionRadius as f,geometrySegments as g,discHeight as j}from"./config.js";import{Manipulation as M}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as v}from"./moveUtils.js";import{SnapToScene as S}from"../snapping/SnapToScene.js";import{createCylinderGeometry as T}from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as w}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as b,dragAtLocation as y,addScreenDelta as x}from"../../../../interactive/dragEventPipeline.js";class D extends M{constructor(t){super(),this._handles=new e,this._snapToScene=new S,this._scale=1,this._radius=_,this._view=t.view,this._tool=t.tool,this._discMaterial=this._createMaterial(),this._discMaterialTransparent=this._createMaterial(.5),null!=t.snapToScene&&(this.snapToScene=t.snapToScene),null!=t.radius&&(this._radius=t.radius),this._createManipulator(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._handles=a(this._handles),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulator=null}forEachManipulator(t){t(this._manipulator,1)}get displayScale(){return this._scale}set displayScale(t){this._scale=t,this._updateManipulatorTransform()}get snapToScene(){return this._snapToScene.enabled}set snapToScene(t){this._snapToScene.enabled=t}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._updateManipulator())}get discManipulator(){return this._manipulator}createManipulatedObjectDragPipeline(t,e,a){if(!e.operations)return i();const r=e.graphic,s=e.elevationInfo,o=e.operations.data.spatialReference;return v(e,a,e=>this.createDragPipeline((i,a,r,s,o)=>(({steps:a,cancel:r}=t(i,a,r,s,o)),e(i,a,r)),s,o,r))}createDragPipeline(t,e,i,a){const r=this._view;return b(this._manipulator,(s,o,n,l,p)=>{const c=o.next(y(r,s.elevationAlignedLocation)).next(d(r,s.elevationAlignedLocation,e,i,a)).next(...this._snapToScene.createDragEventPipelineStep(r,e)).next(t=>({...t,manipulatorType:1})).next(x());t(s,c,n,l,p)})}_updateManipulatorTransform(){const t=o(m.get(),l(c.get(),this.displayScale,this.displayScale,this.displayScale));this._manipulator.modelTransform=t}_createManipulator(){const t=this._view;this._manipulator=new h({view:t,worldSized:!1,autoScaleRenderObjects:!1,focusMultiplier:1,touchMultiplier:1,collisionType:{type:"disc",direction:p(0,0,1)},worldOriented:!0}),this._updateManipulator()}_updateManipulator(){const t=T(this._discMaterial,j,1,g,p(0,0,1),p(0,0,0));t.transformation=o(n(),p(this._radius,this._radius,this._radius)),this._manipulator.renderObjects=[new u(t,2),new u(t.instantiate({material:this._discMaterialTransparent}),1)],this._manipulator.radius=f*(this._radius/_)}_createMaterial(e=1){const i=new w({cullFace:2,renderOccluded:2,isDecoration:!0});return this._handles.add(r(()=>t.toUnitRGBA(this._view.effectiveTheme.accentColor),t=>{t[3]*=e,i.setParameters({color:t})},s)),i}get test(){}}export{D as MoveXYDiscManipulation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../Color.js";import{darken as e}from"../../../../../core/colorUtils.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as r}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{clamp as a}from"../../../../../core/mathUtils.js";import{removeMaybe as o}from"../../../../../core/maybe.js";import{watch as s}from"../../../../../core/reactiveUtils.js";import{translate as n,rotateX 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{F as m,d,n as u,e as p,h,g as f}from"../../../../../chunks/vec32.js";import{fromValues as _,create as j}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as w}from"../../Manipulator3D.js";import{createManipulatorMaterial as v}from"../../manipulatorUtils.js";import{RenderObject as g}from"../../RenderObject.js";import{screenToZConstrained as M}from"../dragEventPipeline3D.js";import{Settings as O}from"../settings.js";import{discRadius as U}from"./config.js";import{Manipulation as b}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as P}from"./moveUtils.js";import{createTubeGeometry as y,createConeGeometry as z}from"../../../webgl-engine/lib/GeometryUtil.js";import{createManipulatorDragEventPipeline as x,addScreenDelta as T}from"../../../../interactive/dragEventPipeline.js";class F extends b{constructor(t){super(),this._radius=U,this.events=new i,this._tool=t.tool,this._view=t.view;const e=new O({getTheme:()=>this._view.effectiveTheme});this._settings=e,null!=t.radius&&(this._radius=t.radius);const r=this._view.effectiveTheme.accentColor;this._materials={materialUnfocused:v(C(r,1,.25),1),materialFocused:v(C(r,1,0),1),materialOccludedUnfocused:v(C(r,.7,0),e.zManipulator.renderOccluded),materialOccludedFocused:v(C(r,.85,0),e.zManipulator.renderOccluded)},this._themeHandle=s(()=>this._view.effectiveTheme.accentColor,t=>{const e=C(t,1,.25),i=C(t,1,0),r=C(t,.7,0),a=C(t,.85,0),{materialUnfocused:o,materialFocused:s,materialOccludedUnfocused:n,materialOccludedFocused:l}=this._materials;o.setParameters({color:e}),s.setParameters({color:i}),n.setParameters({color:r}),l.setParameters({color:a})}),this._createManipulator(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._themeHandle=o(this._themeHandle),this._manipulator.applyObjectTransform=R,this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()})}forEachManipulator(t){t(this._manipulator,0)}createManipulatedObjectDragPipeline(t,e,i){if(!e.operations)return r();const a=e.operations.data.spatialReference;return P(e,i,e=>this.createDragPipeline((i,r,a,o,s)=>(({steps:r,cancel:a}=t(i,r,a,o,s)),e(i,r,a)),a))}createDragPipeline(t,e){const i=this._view;return x(this._manipulator,(r,a,o,s,n)=>{const l=a.next(t=>({...t,manipulatorType:0})).next(M(i,r.renderLocation,e)).next(T());t(r,l,o,s,n)})}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._updateManipulator())}_updateManipulator(){const t=this._settings,e=this._radius/U,i=t.zManipulator.height*e,r=t.zManipulator.coneHeight*e,a=t.zManipulator.coneWidth*e,o=t.zManipulator.width*e,s=[_(0,0,0),_(0,0,i)],m=[_(0,0,0),_(0,0,i+r)],d=(()=>{const t=c();return n(t,t,[0,0,i]),l(t,t,Math.PI/2),t})(),{materialUnfocused:u,materialFocused:p,materialOccludedUnfocused:h,materialOccludedFocused:f}=this._materials,j=y(u,s,o/2,16,!1),w=z(u,r,a/2,16,!1);w.transformation=d,this._manipulator.renderObjects=[new g(w,1),new g(j,1),new g(w.instantiate({material:p}),2),new g(j.instantiate({material:p}),2),new g(w.instantiate({material:h}),1),new g(j.instantiate({material:h}),1),new g(w.instantiate({material:f}),2),new g(j.instantiate({material:f}),2)],this._manipulator.radius=o/2+2,this._manipulator.collisionType={type:"line",paths:[m]}}_createManipulator(){const t=this._view,e=new w({view:t,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,cursor:"ns-resize",elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});e.applyObjectTransform=e=>{const i=t.state.camera,r=D;t.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,r);const o=m(i.eye,r),s=i.computeRenderPixelSizeAtDist(o),n=d(E,r,i.eye);u(n,n);const l=H;t.renderCoordsHelper.worldUpAtPosition(D,l);const c=Math.abs(p(n,l)),_=h(E,n,l),j=h(E,_,l),w=a(c,.01,1),v=1-Math.sqrt(1-w*w)/w/i.fullWidth,g=this._settings,M=this._radius/U,O=g.zManipulator.width*M;f(j,u(j,j),(1/v-1)*o+s*O),e[12]-=E[0],e[13]-=E[1],e[14]-=E[2]},this._manipulator=e,this._updateManipulator()}get test(){}}function C(i,r,a){const o=e(i,a);return o.a*=r,t.toUnitRGBA(o)}const D=j(),E=j(),H=j(),R=()=>{};export{F as MoveZManipulation};
5
+ import t from"../../../../../Color.js";import{darken as e}from"../../../../../core/colorUtils.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import{makeHandle as r}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{clamp as a}from"../../../../../core/mathUtils.js";import{removeMaybe as o}from"../../../../../core/maybe.js";import{watch as s}from"../../../../../core/reactiveUtils.js";import{translate as n,rotateX 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{F as m,e as d,n as u,f as p,i as h,h as f}from"../../../../../chunks/vec32.js";import{fromValues as _,create as j}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Manipulator3D as w}from"../../Manipulator3D.js";import{createManipulatorMaterial as v}from"../../manipulatorUtils.js";import{RenderObject as g}from"../../RenderObject.js";import{screenToZConstrained as M}from"../dragEventPipeline3D.js";import{Settings as O}from"../settings.js";import{discRadius as U}from"./config.js";import{Manipulation as b}from"./Manipulation.js";import{createManipulatedMoveDragPipeline as P}from"./moveUtils.js";import{createTubeGeometry as y,createConeGeometry as z}from"../../../webgl-engine/lib/GeometryUtil.js";import{createManipulatorDragEventPipeline as x,addScreenDelta as T}from"../../../../interactive/dragEventPipeline.js";class F extends b{constructor(t){super(),this._radius=U,this.events=new i,this._tool=t.tool,this._view=t.view;const e=new O({getTheme:()=>this._view.effectiveTheme});this._settings=e,null!=t.radius&&(this._radius=t.radius);const r=this._view.effectiveTheme.accentColor;this._materials={materialUnfocused:v(C(r,1,.25),1),materialFocused:v(C(r,1,0),1),materialOccludedUnfocused:v(C(r,.7,0),e.zManipulator.renderOccluded),materialOccludedFocused:v(C(r,.85,0),e.zManipulator.renderOccluded)},this._themeHandle=s(()=>this._view.effectiveTheme.accentColor,t=>{const e=C(t,1,.25),i=C(t,1,0),r=C(t,.7,0),a=C(t,.85,0),{materialUnfocused:o,materialFocused:s,materialOccludedUnfocused:n,materialOccludedFocused:l}=this._materials;o.setParameters({color:e}),s.setParameters({color:i}),n.setParameters({color:r}),l.setParameters({color:a})}),this._createManipulator(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._themeHandle=o(this._themeHandle),this._manipulator.applyObjectTransform=R,this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()})}forEachManipulator(t){t(this._manipulator,0)}createManipulatedObjectDragPipeline(t,e,i){if(!e.operations)return r();const a=e.operations.data.spatialReference;return P(e,i,e=>this.createDragPipeline((i,r,a,o,s)=>(({steps:r,cancel:a}=t(i,r,a,o,s)),e(i,r,a)),a))}createDragPipeline(t,e){const i=this._view;return x(this._manipulator,(r,a,o,s,n)=>{const l=a.next(t=>({...t,manipulatorType:0})).next(M(i,r.renderLocation,e)).next(T());t(r,l,o,s,n)})}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._updateManipulator())}_updateManipulator(){const t=this._settings,e=this._radius/U,i=t.zManipulator.height*e,r=t.zManipulator.coneHeight*e,a=t.zManipulator.coneWidth*e,o=t.zManipulator.width*e,s=[_(0,0,0),_(0,0,i)],m=[_(0,0,0),_(0,0,i+r)],d=(()=>{const t=c();return n(t,t,[0,0,i]),l(t,t,Math.PI/2),t})(),{materialUnfocused:u,materialFocused:p,materialOccludedUnfocused:h,materialOccludedFocused:f}=this._materials,j=y(u,s,o/2,16,!1),w=z(u,r,a/2,16,!1);w.transformation=d,this._manipulator.renderObjects=[new g(w,1),new g(j,1),new g(w.instantiate({material:p}),2),new g(j.instantiate({material:p}),2),new g(w.instantiate({material:h}),1),new g(j.instantiate({material:h}),1),new g(w.instantiate({material:f}),2),new g(j.instantiate({material:f}),2)],this._manipulator.radius=o/2+2,this._manipulator.collisionType={type:"line",paths:[m]}}_createManipulator(){const t=this._view,e=new w({view:t,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,cursor:"ns-resize",elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});e.applyObjectTransform=e=>{const i=t.state.camera,r=D;t.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,r);const o=m(i.eye,r),s=i.computeRenderPixelSizeAtDist(o),n=d(E,r,i.eye);u(n,n);const l=H;t.renderCoordsHelper.worldUpAtPosition(D,l);const c=Math.abs(p(n,l)),_=h(E,n,l),j=h(E,_,l),w=a(c,.01,1),v=1-Math.sqrt(1-w*w)/w/i.fullWidth,g=this._settings,M=this._radius/U,O=g.zManipulator.width*M;f(j,u(j,j),(1/v-1)*o+s*O),e[12]-=E[0],e[13]-=E[1],e[14]-=E[2]},this._manipulator=e,this._updateManipulator()}get test(){}}function C(i,r,a){const o=e(i,a);return o.a*=r,t.toUnitRGBA(o)}const D=j(),E=j(),H=j(),R=()=>{};export{F as MoveZManipulation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{EventEmitter as o}from"../../../../../core/Evented.js";import{watch as r,sync as i}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{j as c}from"../../../../../chunks/vec32.js";import{create as l}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPointToVector as a}from"../../../../../geometry/projection/projectPointToVector.js";import{isMediaElementVisibleView as p}from"./mediaElementUtils.js";let m=class extends t{grabbableForEvent(){return!0}constructor(e){super(e),this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.grabbing=!1,this.dragging=!1,this.hovering=!0,this.selected=!1,this.cursor=null,this.consumesClicks=!0,this.events=new o,this.addHandles(r(()=>this.selected,e=>this.events.emit("select-changed",{action:e?"select":"deselect"}),i))}destroy(){this._set("view",null)}intersectionDistance(e){const{view:t,layer:o,element:r}=this;if(!p(t,o,r))return null;const i=t.toMap(e,{include:{layer:o,element:r}});return i&&a(i,d,t.renderSpatialReference)?c(d,t.state.camera.eye):null}onElevationChange(){}onViewChange(){}};e([s({constructOnly:!0,nonNullable:!0})],m.prototype,"element",void 0),e([s({constructOnly:!0,nonNullable:!0})],m.prototype,"layer",void 0),e([s({constructOnly:!0,nonNullable:!0})],m.prototype,"view",void 0),e([s()],m.prototype,"interactive",void 0),e([s()],m.prototype,"selectable",void 0),e([s()],m.prototype,"grabbable",void 0),e([s()],m.prototype,"grabbing",void 0),e([s()],m.prototype,"dragging",void 0),e([s()],m.prototype,"hovering",void 0),e([s()],m.prototype,"selected",void 0),e([s()],m.prototype,"cursor",void 0),m=e([n("esri.views.3d.interactive.editingTools.media.MediaElementManipulator3D")],m);const d=l();export{m as MediaElementManipulator3D};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{EventEmitter as o}from"../../../../../core/Evented.js";import{watch as r,sync as i}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{k as c}from"../../../../../chunks/vec32.js";import{create as l}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPointToVector as a}from"../../../../../geometry/projection/projectPointToVector.js";import{isMediaElementVisibleView as p}from"./mediaElementUtils.js";let m=class extends t{grabbableForEvent(){return!0}constructor(e){super(e),this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.grabbing=!1,this.dragging=!1,this.hovering=!0,this.selected=!1,this.cursor=null,this.consumesClicks=!0,this.events=new o,this.addHandles(r(()=>this.selected,e=>this.events.emit("select-changed",{action:e?"select":"deselect"}),i))}destroy(){this._set("view",null)}intersectionDistance(e){const{view:t,layer:o,element:r}=this;if(!p(t,o,r))return null;const i=t.toMap(e,{include:{layer:o,element:r}});return i&&a(i,d,t.renderSpatialReference)?c(d,t.state.camera.eye):null}onElevationChange(){}onViewChange(){}};e([s({constructOnly:!0,nonNullable:!0})],m.prototype,"element",void 0),e([s({constructOnly:!0,nonNullable:!0})],m.prototype,"layer",void 0),e([s({constructOnly:!0,nonNullable:!0})],m.prototype,"view",void 0),e([s()],m.prototype,"interactive",void 0),e([s()],m.prototype,"selectable",void 0),e([s()],m.prototype,"grabbable",void 0),e([s()],m.prototype,"grabbing",void 0),e([s()],m.prototype,"dragging",void 0),e([s()],m.prototype,"hovering",void 0),e([s()],m.prototype,"selected",void 0),e([s()],m.prototype,"cursor",void 0),m=e([n("esri.views.3d.interactive.editingTools.media.MediaElementManipulator3D")],m);const d=l();export{m as MediaElementManipulator3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{removeHandles as e,destroyHandle as t,refHandle as o}from"../../../../core/handleUtils.js";import{deg2rad as n}from"../../../../core/mathUtils.js";import{watch as i,initial as l}from"../../../../core/reactiveUtils.js";import{signal as s}from"../../../../core/signal.js";import{i as a}from"../../../../chunks/vec32.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPointToVector as c}from"../../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as p}from"../../../../geometry/projection/projectVectorToVector.js";import{empty as m,create as u,getMin as h}from"../../../../geometry/support/aaBoundingBox.js";import{containsXY as f}from"../../../../geometry/support/aaBoundingRect.js";import{featureExpressionInfoIsZero as v}from"../../../../support/elevationInfoUtils.js";import{manipulatedObjectGeometry as d}from"./manipulatedObjectUtils.js";import{ManipulatorState as g}from"./ManipulatorState.js";import{Settings as j}from"./settings.js";import{ExtendedLineVisualElement as y}from"../visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as E}from"../visualElements/LaserlineVisualElement.js";import{PointVisualElement as b}from"../visualElements/PointVisualElement.js";import{evaluateElevationAlignmentAtPoint as w}from"../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as x}from"../../layers/graphics/ElevationContext.js";function D(t){const o=[],n=T(t,o);return P(t,o,n),{visualElement:n,remove:()=>e(o)}}function P(e,o,r){const{view:c,object:u}=e,f=new j({getTheme:()=>c.effectiveTheme}),b=new y({view:c,extensionType:f.visualElements.zVerticalLine.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});o.push(i(()=>f.visualElements.zVerticalLine,e=>e.apply(b),l));const D=new E({view:c,intersectsLineInfinite:!0,attached:!1,isDecoration:!0}),P=n(f.visualElements.heightPlaneAngleCutoff),T=new E({view:c,attached:!1,angleCutoff:P,isDecoration:!0}),V=u.elevationInfo,L=x.fromElevationInfo(V),S="on-the-ground"===V.mode||!V.offset&&"absolute-height"!==V.mode,C=new g,M=s(1);o.push(i(()=>({heightPlane:f.visualElements.heightPlane,alpha:M.value}),({heightPlane:e,alpha:t})=>e.apply(T,t),l));const R=s(1);o.push(i(()=>({shadowStyle:f.visualElements.pointObjects.shadowStyle,alpha:R.value}),({shadowStyle:e,alpha:t})=>e.apply(D,t),l));const z=()=>{C.update(e);let t=I(d(u));const o=S&&(u.isDraped||null==t||!t.hasZ);let n=!0;if(o||null==t)n=!1;else{v(u.elevationInfo)&&(t=t.clone(),t.z=0);const e=w(t,c.elevationProvider,L,c.renderCoordsHelper);a(U,t.x,t.y,e),p(U,t.spatialReference,U,c.renderCoordsHelper.spatialReference),b.setStartEndFromWorldDownAtLocation(U),D.intersectsWorldUpAtLocation=U}const i=2&C.grabbingState?f.visualElements.laserlineAlphaMultiplier:1;M.value=i;const l=m(A);!o&&u.visible&&r.calculateMapBounds(l)&&p(h(l,U),c.spatialReference,U,c.renderCoordsHelper.spatialReference)?(T.heightManifoldTarget=U,T.attached=!0):T.attached=!1;const s=4&C.grabbingState?f.visualElements.laserlineAlphaMultiplier:1;R.value=s;const g=n&&u.visible&&!o;D.attached=g,b.attached=g};o.push(i(()=>[u.visible,u.isDraped],z),u.on("committed",z)),e.forEachManipulator(e=>{o.push(e.events.on("grab-changed",z))}),o.push(t(D)),o.push(t(b)),o.push(t(T)),z()}function T(e,o){const{view:n,object:i}=e,l=new b({view:n,geometry:I(d(i)),elevationInfo:i.elevationInfo,isDecoration:!0});return V(e,l,o),o.push(t(l)),l}function I(e){return null==e?null:"point"===e.type?e:"mesh"===e.type?e.origin.clone():null}function V(e,t,o){const{view:n,object:s}=e,a=()=>{t.attached=s.visible},r=new j({getTheme:()=>n.effectiveTheme});L(e,t,o),r.visualElements.pointObjects.outline.apply(t),o.push(i(()=>s.visible,a,l))}function L(e,t,n){const{view:i,object:l}=e;let s=null;const a=e=>{null!=s&&(s.remove(),s=null),l.isDraped&&null!=e&&(s=S(i,e,()=>{t.geometry=e}))},r=()=>{const e=I(d(l));null!=e&&v(l.elevationInfo)&&(e.z=0),a(e),t.geometry=e};n.push(l.on("committed",r),o(()=>s)),r()}function S(e,t,o){const n=e.elevationProvider.spatialReference;c(t,U,n);const i=U[0],l=U[1];return e.elevationProvider.on("elevation-change",e=>{f(e.extent,i,l)&&o()})}const U=r(),A=u();export{D as createVisualElements};
5
+ import{removeHandles as e,destroyHandle as t,refHandle as o}from"../../../../core/handleUtils.js";import{deg2rad as n}from"../../../../core/mathUtils.js";import{watch as i,initial as l}from"../../../../core/reactiveUtils.js";import{signal as s}from"../../../../core/signal.js";import{j as a}from"../../../../chunks/vec32.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPointToVector as c}from"../../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as p}from"../../../../geometry/projection/projectVectorToVector.js";import{empty as m,create as u,getMin as h}from"../../../../geometry/support/aaBoundingBox.js";import{containsXY as f}from"../../../../geometry/support/aaBoundingRect.js";import{featureExpressionInfoIsZero as v}from"../../../../support/elevationInfoUtils.js";import{manipulatedObjectGeometry as d}from"./manipulatedObjectUtils.js";import{ManipulatorState as g}from"./ManipulatorState.js";import{Settings as j}from"./settings.js";import{ExtendedLineVisualElement as y}from"../visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as E}from"../visualElements/LaserlineVisualElement.js";import{PointVisualElement as b}from"../visualElements/PointVisualElement.js";import{evaluateElevationAlignmentAtPoint as w}from"../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as x}from"../../layers/graphics/ElevationContext.js";function D(t){const o=[],n=T(t,o);return P(t,o,n),{visualElement:n,remove:()=>e(o)}}function P(e,o,r){const{view:c,object:u}=e,f=new j({getTheme:()=>c.effectiveTheme}),b=new y({view:c,extensionType:f.visualElements.zVerticalLine.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});o.push(i(()=>f.visualElements.zVerticalLine,e=>e.apply(b),l));const D=new E({view:c,intersectsLineInfinite:!0,attached:!1,isDecoration:!0}),P=n(f.visualElements.heightPlaneAngleCutoff),T=new E({view:c,attached:!1,angleCutoff:P,isDecoration:!0}),V=u.elevationInfo,L=x.fromElevationInfo(V),S="on-the-ground"===V.mode||!V.offset&&"absolute-height"!==V.mode,C=new g,M=s(1);o.push(i(()=>({heightPlane:f.visualElements.heightPlane,alpha:M.value}),({heightPlane:e,alpha:t})=>e.apply(T,t),l));const R=s(1);o.push(i(()=>({shadowStyle:f.visualElements.pointObjects.shadowStyle,alpha:R.value}),({shadowStyle:e,alpha:t})=>e.apply(D,t),l));const z=()=>{C.update(e);let t=I(d(u));const o=S&&(u.isDraped||null==t||!t.hasZ);let n=!0;if(o||null==t)n=!1;else{v(u.elevationInfo)&&(t=t.clone(),t.z=0);const e=w(t,c.elevationProvider,L,c.renderCoordsHelper);a(U,t.x,t.y,e),p(U,t.spatialReference,U,c.renderCoordsHelper.spatialReference),b.setStartEndFromWorldDownAtLocation(U),D.intersectsWorldUpAtLocation=U}const i=2&C.grabbingState?f.visualElements.laserlineAlphaMultiplier:1;M.value=i;const l=m(A);!o&&u.visible&&r.calculateMapBounds(l)&&p(h(l,U),c.spatialReference,U,c.renderCoordsHelper.spatialReference)?(T.heightManifoldTarget=U,T.attached=!0):T.attached=!1;const s=4&C.grabbingState?f.visualElements.laserlineAlphaMultiplier:1;R.value=s;const g=n&&u.visible&&!o;D.attached=g,b.attached=g};o.push(i(()=>[u.visible,u.isDraped],z),u.on("committed",z)),e.forEachManipulator(e=>{o.push(e.events.on("grab-changed",z))}),o.push(t(D)),o.push(t(b)),o.push(t(T)),z()}function T(e,o){const{view:n,object:i}=e,l=new b({view:n,geometry:I(d(i)),elevationInfo:i.elevationInfo,isDecoration:!0});return V(e,l,o),o.push(t(l)),l}function I(e){return null==e?null:"point"===e.type?e:"mesh"===e.type?e.origin.clone():null}function V(e,t,o){const{view:n,object:s}=e,a=()=>{t.attached=s.visible},r=new j({getTheme:()=>n.effectiveTheme});L(e,t,o),r.visualElements.pointObjects.outline.apply(t),o.push(i(()=>s.visible,a,l))}function L(e,t,n){const{view:i,object:l}=e;let s=null;const a=e=>{null!=s&&(s.remove(),s=null),l.isDraped&&null!=e&&(s=S(i,e,()=>{t.geometry=e}))},r=()=>{const e=I(d(l));null!=e&&v(l.elevationInfo)&&(e.z=0),a(e),t.geometry=e};n.push(l.on("committed",r),o(()=>s)),r()}function S(e,t,o){const n=e.elevationProvider.spatialReference;c(t,U,n);const i=U[0],l=U[1];return e.elevationProvider.on("elevation-change",e=>{f(e.extent,i,l)&&o()})}const U=r(),A=u();export{D as createVisualElements};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as i}from"../../../../../core/arrayUtils.js";import{unitRGBAFromColor as a}from"../../../../../core/colorUtils.js";import{EventEmitter as n}from"../../../../../core/Evented.js";import o from"../../../../../core/Handles.js";import{handlesGroup as s,makeHandle as r,destroyHandle as l}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as p,removeMaybe as h}from"../../../../../core/maybe.js";import{watch as d,on as u,initial as c,syncAndInitial as m,when as g,sync as f}from"../../../../../core/reactiveUtils.js";import{property as _}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as M}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as b,d as x,m as y,i as O,f as E,g as j}from"../../../../../chunks/vec32.js";import{fromValues as I,create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as w}from"../../../../../core/support/UpdatingHandles.js";import H from"../../../../../geometry/Point.js";import V from"../../../../../geometry/Polyline.js";import D from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as T}from"../../../../../layers/graphics/dehydratedPoint.js";import{isVolumetricSymbol as A}from"../../../../../symbols/support/utils.js";import{Manipulator3D as P}from"../../Manipulator3D.js";import{createManipulatorMaterial as G,createManipulatorOutlineMaterial as k,placeAtObject as C}from"../../manipulatorUtils.js";import{RenderObject as L}from"../../RenderObject.js";import{SegmentLabels3D as U}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as z}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as R,screenToRenderPlaneFromEvent as F,convertToMapCoordinates as Z}from"../dragEventPipeline3D.js";import{orientation as N}from"../geometryUtils.js";import{canMoveZOperations as q}from"../manipulatorUtils.js";import{Settings as X}from"../settings.js";import{createVisualElements as Y}from"../visualElementUtils.js";import{discRadiusSmall as B}from"../manipulations/config.js";import{MoveManipulation as W}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as K}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as J,createEdgeOffsetIntersectionPlane as Q,createEdgeOffsetOperation as $,edgeOffsetRotationMatrix as ee,screenEdgeLengthSquared as te,getDistanceInGeometrySR as ie}from"./edgeOffsetUtils.js";import{createTooltipInfos as ae,connectTooltipToManipulatedObject as ne,getUpdatedTranslateObjectTooltipInfo as oe,getUpdatedEdgeOffsetTooltipInfo as se}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as re}from"../../visualElements/OutlineVisualElement.js";import{createExtrudedTriangle as le,createSphereGeometry as pe}from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as he}from"../../../../input/IViewEvents.js";import{sceneSnappingAtLocation as de,addMapDelta as ue,createManipulatorDragEventPipeline as ce,dragAtLocation as me,addScreenDelta as ge}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as fe}from"../../../../interactive/keybindings.js";import{SnappingContext as _e}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ve}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Me,enterInputModeIfAvailable as be}from"../../../../interactive/tooltip/tooltipCommonUtils.js";const xe=Symbol();let ye=class extends t{get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new o,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new w,this._recreatingManipulators=!1,this._settings=new X({getTheme:()=>this.view.effectiveTheme}),this.events=new n,this.activeTooltipInfo=null,this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit("reshape",{type:"reshape",object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit("move",{type:"move",object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){const{view:e}=this,t=this._settings.manipulators,i=t.vertex;this.tooltipInfos=ae(this._sketchOptions,e),this._vertexManipulatorMaterial=G(a(i.color),i.renderOccluded),this._vertexManipulatorOutlineMaterial=k(a(i.outlineColor),i.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=k(a(i.hoverOutlineColor),i.renderOccluded);const n=t.edge;this._edgeManipulatorMaterial=G(a(n.color),n.renderOccluded),this._edgeManipulatorOutlineMaterial=k(a(n.outlineColor),n.renderOccluded);const o=t.edgeOffset;this._edgeOffsetManipulatorMaterial=G(a(o.color),o.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=G(a(o.hoverColor),o.renderOccluded,!1);const s=t.selected;this._selectedManipulatorMaterial=G(a(s.color),s.renderOccluded),this._selectedManipulatorOutlineMaterial=k(a(s.outlineColor),s.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=k(a(s.hoverOutlineColor),s.renderOccluded),this.tooltip=Me(()=>({view:e,options:this._sketchOptions.tooltips})),this.addHandles([d(()=>{const e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:i,selectedSettings:a})=>{e.applyColor(this._vertexManipulatorMaterial),e.applyOutline(this._vertexManipulatorOutlineMaterial),e.applyHoverOutline(this._vertexManipulatorHoverOutlineMaterial),t.applyColor(this._edgeManipulatorMaterial),t.applyOutline(this._edgeManipulatorOutlineMaterial),i.applyColor(this._edgeOffsetManipulatorMaterial),i.applyHover(this._edgeOffsetManipulatorHoverMaterial),a.applyColor(this._selectedManipulatorMaterial),a.applyOutline(this._selectedManipulatorOutlineMaterial),a.applyHoverOutline(this._selectedManipulatorHoverOutlineMaterial)}),d(()=>this.object.visible,e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e,Se(t)&&(t.edgeManipulator.available=e)}),d(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),d(()=>({labels:this._segmentLabels,enabled:this._sketchOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:i})=>{null!=e&&(e.visible=t,e.edgeDistance=i?"far":"default")},c),ne(this.tooltip,this.object,()=>this._tooltipsContext),d(()=>this.tooltip.mode,(e,t)=>{"input"===t&&"input"!==e&&this._resetTooltip()}),u(()=>this._operations,"vertex-update",e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),u(()=>this._operations?.data,"change",e=>{"undo"!==e.operation&&"redo"!==e.operation||this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=p(this._segmentLabels),this.tooltip=p(this.tooltip)}get updating(){return this._updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get automaticAreaMeasurementUtils(){return this.tool.automaticAreaMeasurementUtils}get automaticLengthMeasurementUtils(){return this.tool.automaticLengthMeasurementUtils}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _sketchOptions(){return this.tool.sketchOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return"key-down"===e.type&&e.key===fe.enterInputMode&&("reshape-edge-offset"===this.activeTooltipInfo?.type?this._enterInputModeDuringEdgeOffset(e):!!be(e,this.tooltip)&&(this.tool.endDrag(),!0))}removeSelectedVertices(){const e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&"vertex"===e.type);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit("manipulators-changed")}_removeManipulators(){this._manipulatorHandles.removeAll(),this._moveManipulation=p(this._moveManipulation),this._objectMoveManipulation=p(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(null==this._operations)return;const t=this.object.elevationInfo;for(const{vertices:i,segments:a,index:n}of this._operations.data.parts){const o=e?.byPartIndex.get(n);for(const e of i){const i=o?.has(e.index);this._createVertexOrEdgeManipulator(e,t,i)}for(const e of a)"line"===e.type&&this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}recordUndo(e){this._operations?.recordUndo(e)}get canRedo(){return this._operations?.canRedo??!1}get canUndo(){return this._operations?.canUndo??!1}redo(){return this._operations?.redo()}undo(){return this.events.emit("undo"),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=p(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){const e=this._sketchOptions.labels;this._segmentLabels=new U({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if("end"===t.action)return t;let i=0;const a=[],n=this._manipulatorInfos.some(e=>"vertex"===e.type&&e.manipulator.selected),o=1===e&&n;for(const s of this._manipulatorInfos)"vertex"===s.type&&(s.manipulator.grabbing||o&&!s.manipulator.selected||a.push(s),i++);this._moveVertices(a,t);if(a.length===i){if(this._updateEventState(1),this.destroyed)return t;this.events.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._updateEventState(2),this.destroyed)return t;this.events.emit("reshape",{type:"reshape",object:this.object})}return t}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(xe):this.tool.manipulators.forEach(({manipulator:e})=>{const t=e.disableDisplay?.();t&&this.addHandles(t,xe)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>"vertex"===t.type&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:a}=e;if(!t&&!i&&!a)return;const n=[];for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.selected&&!o.manipulator.grabbing||o===e.info)&&n.push(o);this._moveVertices(n,e,1),this.events.emit("reshape",{type:"reshape",object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(0!==this._numGrabbing||0!==this._numDragging))return!1;switch(this._reshapeEventState){case 1:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape-stop",object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape-stop",object:this.object}),this.destroyed||this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object})}break;case 2:switch(this._reshapeEventState){case 0:this.events.emit("reshape",{type:"reshape-start",object:this.object});break;case 1:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit("reshape",{type:"reshape-start",object:this.object})}}if(this.destroyed)return!1;const i=this._reshapeEventState!==e;return this._reshapeEventState=e,i}_createObjectMoveManipulation(){const{tool:e,view:t,object:i,_operations:a}=this;if(a){if(this._objectMoveManipulation=new K({tool:e,view:t,object:i}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,i,n)=>{i.next(e=>this._trackNumDragging(e)).next(t=>("start"===t.action&&(e=a.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{"end"===t.action&&(this._resetTooltip(),e=h(e))}),n.next(()=>this._onDragCancel(!0,()=>e=h(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on("immediate-click",e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){const{object:t,tool:i,view:a,_operations:n}=this;if(!n)return;this._moveManipulation=new W({tool:i,view:a,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&q(t.operations,t.elevationInfo),snapToScene:!1,radius:W.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on("immediate-click",t=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some(e=>e.manipulator.selected)||this.events.emit("immediate-click",{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));const o=e=>t=>{this.addHandles([t.events.on("focus-changed",({action:t})=>{"focus"===t?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(o(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(o(1)),this._moveManipulation.zManipulation.forEachManipulator(o(2)),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const s=n.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((a,o,s,r,l)=>{const{snappingStep:p,cancelSnapping:h}=ve({predicate:e=>!!e.info,snappingManager:i.snappingManager,snappingContext:new _e({editGeometryOperations:n,elevationInfo:e,pointer:l,excludeFeature:t.graphic,visualizer:new z}),updatingHandles:this._updatingHandles,useZ:!1});return r=r.next(e=>(this._onDragCancel(),e)).next(h),{steps:s=s.next(e=>this._trackNumDragging(e)).next(e=>{const t=this._manipulatorInfos.filter(e=>"vertex"===e.type&&e.manipulator.selected);return 1===e.manipulatorType&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(de(this.view,e,t.graphic??void 0)).next(...p).next(ue()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>(this._updateTranslateTooltip(a,e),e)),cancel:r}},e,s,t.graphic),d(()=>t.visible,()=>this._updateMoveManipulationPosition(),c),t.on("committed",()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),d(()=>t.isDraped,e=>{this._updateMoveManipulationPosition();const t="align-move-manipulation";e?this.addHandles(this.view.elevationProvider.on("elevation-change",()=>this._updateMoveManipulationPosition()),t):this.removeHandles(t)},c)])}_createVisualElements(){const{object:e,view:t}=this,i=Y({view:t,object:e,forEachManipulator:e=>{if(!this.destroyed&&!this._recreatingManipulators){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,1)}},onManipulatorsChanged:e=>this.events.on("manipulators-changed",e)});null!=i&&(this._outlineVisualElement=i.visualElement instanceof re?i.visualElement:null);const a=this._outlineVisualElement;if(null!=a){const t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(u(()=>a.events,"attachment-origin-changed",t,{onListenerAdd:t}))}this._manipulatorHandles.add(i)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){const i=this.view,a=this._operations;if(e.part.vertices.length<=2||!a)return null;const n=a.data.spatialReference,o=this._settings.manipulators.edgeOffset,r=o.size/2,l=r+o.collisionPadding,p=r/l,h=p/2,d=p*Math.sqrt(3)/2,{height:u,offset:c}=o,m=this._edgeOffsetManipulatorMaterial;if(!this._edgeOffsetManipulatorGeometryInside){const e=le(m,d,h,h,u,c);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){const e=le(m,-d,h,h,u,-c);this._edgeOffsetManipulatorGeometryOutside=e}const g=[new L(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new L(this._edgeOffsetManipulatorGeometryInside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),2),new L(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new L(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),2)],f=new P({view:i,renderObjects:g,elevationInfo:"on-the-ground"!==t.mode||A(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:l,available:this.object.visible,collisionType:{type:"disc",direction:I(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:Ie(n)}),_=new P({view:i,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?"move":"default",metadata:{deleting:!1},location:Ie(n)}),v={manipulator:f,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:_,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(v,o.minSquaredEdgeLength);const M=()=>this._updateEdgeOffsetManipulator(v);M(),v.locationUpdateHandle=s([e.leftVertex,e.rightVertex].map(e=>{const t=this._getManipulatorInfoFromHandle(e);return t?.manipulator.events.on("location-update",M)}));const b=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([v.locationUpdateHandle,this._watchAndUpdateGrabState(f,!0),this._watchAndUpdateGrabState(_,!0),ce(f,this._createEdgeOffsetPipeline(v,t,a)),ce(_,this._createEdgePipeline(v,t,a)),_.events.on("immediate-click",b),f.events.on("immediate-click",b),f.events.on("focus-changed",()=>this._resetTooltip()),f.events.on("grab-changed",({screenPoint:e,action:t})=>{v.grabMapPoint="start"===t?J(e,this.view,this.object,v):null})],f),this._manipulatorInfos.push(v),this.manipulators.addMany([f,_]),this.events.emit("manipulators-changed"),v}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,a=e.edgeManipulator,n=()=>{e.visibilityHandle=h(e.visibilityHandle);const n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),o=this._getManipulatorInfoFromHandle(e.handle.rightVertex),l=null!=n&&null!=o&&te(n.manipulator.renderLocation,o.manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!a.focused||l)&&(i.grabbable=!l,a.grabbable=!l,e.visibilityHandle=s([i.disableDisplay(),r(()=>{i.grabbable=!0,a.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([i.events.on("focus-changed",n),a.events.on("focus-changed",n),r(()=>{h(e.visibilityHandle),a.metadata.deleting=!0,this.manipulators.remove(a)})],i),n()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);const{coordinateHelper:t}=this._operations.data,i=Q(this.view,e.manipulator.elevationAlignedLocation,$(t,e.handle,e.manipulator.elevationInfo)),a=this._getManipulatorInfoFromHandle(e.handle.leftVertex),n=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==a||null==n)return;const o=a.manipulator.renderLocation,s=n.manipulator.renderLocation,r=null!=i?ee(i,o,s):M;e.manipulator.modelTransform=r,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=r;const l=b(x(He,o,s))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-l,0,0],[l,0,0]]]}}_createEdgePipeline(e,t,i){return(a,n,o,s)=>{if("touch"===s){this._createEdgeOffsetPipeline(e,t,i)(a,n,o)}else if(this.enableMoveObject){const e=this.object.graphic,s=i.data.spatialReference,{elevationAlignedLocation:r}=a;n.next(e=>this._trackNumDragging(e)).next(me(this.view,r)).next(R(this.view,r,t,s,e)).next(ge()).next(ue()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{"end"===e.action&&this._resetTooltip()}),o.next(()=>this._onDragCancel(!a.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,i){return(a,n,o)=>{const s=this._pendingEdgeOffsetInfo;if(s?.manipulatorInfo===e&&"drag"!==s.mode)return void o.execute({action:"cancel"});this._clearSelection();const{initializeStep:r,cleanup:l}=this._initializeEdgeOffset(e,t,i,o),p=this._applyEdgeOffsetStep(e);n.next(e=>this._trackNumDragging(e)).next(me(this.view,a.elevationAlignedLocation)).next(r).next(F(this.view)).next(Z(this.view,i.data.spatialReference)).next(ue()).next(Oe()).next(e=>this._pendingEdgeOffsetInfo?e:p(e)).next(e=>{"end"!==e.action||this._pendingEdgeOffsetInfo||l()}),o.next(()=>{this._exitEdgeOffsetInputMode(),a.metadata.deleting||(l(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,i,a){const{view:n,object:o}=this,r=$(i.data.coordinateHelper,e.handle,t),l=i.createUndoGroup(),p=Q(n,e.manipulator.elevationAlignedLocation,r);let d;this._splitEdgesBeforeEdgeOffset(e,r),this._selectEdgeOffsetArrow(e,r);const u=()=>{this._cleanEdgeOffsetCollapsedEdges(e,i),d=h(d)},c=this.events.on("undo",u);return d=s([this._initializeEdgeOffsetVisualElement(e,o,t,i),l,c,this._connectEdgeOffsetTooltip(e,r,i,()=>{a.execute({action:"cancel"})})]),{initializeStep:e=>null==r||null==p?(u(),null):{...e,operation:r,plane:p},cleanup:u}}_initializeEdgeOffsetVisualElement(e,t,i,n){const o=()=>new V({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:n.data.spatialReference}),r=new re({view:this.view,isDraped:t.isDraped,geometry:o(),elevationInfo:i,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),p=s([d(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{r.color=a(e),r.isDraped=t},m),t.on("committed",()=>{r.geometry=o()}),l(r)]);return r.attached=!0,p}_applyEdgeOffsetStep(e){return t=>(this.destroyed||null==t.operation||!this._operations||(this._updateEventState(2),null==t.signedDistance?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit("reshape",{type:"reshape",object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){const i=e.handle.leftVertex.leftSegment?.leftVertex,a=e.handle.leftVertex,n=e.handle.rightVertex.rightSegment?.rightVertex,o=e.handle.rightVertex,s=t.data.coordinateHelper,r=this.view.pixelSizeAt(s.vectorToDehydratedPoint(a.pos),s.spatialReference),l=[];if(i&&s.distance(i.pos,a.pos)<Ve){const e=this._getManipulatorInfoFromHandle(a);null!=e&&l.push(e)}if(s.distance(a.pos,o.pos)<r||n&&s.distance(n.pos,o.pos)<Ve){const e=this._getManipulatorInfoFromHandle(o);null!=e&&l.push(e)}l.length&&this._removeVertices(l)}_enterInputModeDuringEdgeOffset(e){const t=this._findActiveEdgeOffsetManipulatorInfo();return!!t&&(!!be(e,this.tooltip)&&(t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"drag"},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"hover"},this._connectEdgeOffsetTooltipOnHover(t),!0)))}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Se).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){const{_operations:t,object:i}=this;if(!t)return;const{elevationInfo:a}=i,n=$(t.data.coordinateHelper,e.handle,a);this._selectEdgeOffsetArrow(e,n),this.addHandles([this._initializeEdgeOffsetVisualElement(e,i,a,t),this._connectEdgeOffsetTooltip(e,n,t,()=>{this.removeHandles(n),this._exitEdgeOffsetInputMode()})],n)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){const t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);null!=t&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){const t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);null!=t&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){const i=e.grabMapPoint??J(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);i&&t.selectArrowFromStartPoint(i)}_connectEdgeOffsetTooltip(e,t,i,a){const n=()=>this.tooltipInfos.edgeOffset.distance.actual,o=n=>{a(),queueMicrotask(()=>{this.view.focus();const a=i.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,ie(n,e.manipulator.location,t,i)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,i),a.remove()})},r=()=>{const e=n();null!=e?o(e):a()};return s([g(()=>this.tooltip&&!this.tooltip.focused,()=>r(),f),this.tooltip.on("discard",a),this.tooltip.on("commit",e=>{"commit-and-exit"===e.type&&r()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,i=!1){const a=this.view,n=this._operations,o=this._settings;if(!n)return null;const r=n.data.type,l=n.data.spatialReference;if("line"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(null==this._vertexManipulatorGeometry||null==this._vertexManipulatorOutlineGeometry){const{size:e,outlineSize:t}=Ee(o.manipulators.vertex);this._vertexManipulatorGeometry=pe(this._vertexManipulatorMaterial,e,16,16),this._vertexManipulatorOutlineGeometry=pe(this._vertexManipulatorOutlineMaterial,t,16,16)}if(null==this._edgeManipulatorGeometry||null==this._edgeManipulatorOutlineGeometry){const{size:e,outlineSize:t}=Ee(o.manipulators.edge);this._edgeManipulatorGeometry=pe(this._edgeManipulatorMaterial,e,16,16),this._edgeManipulatorOutlineGeometry=pe(this._edgeManipulatorOutlineMaterial,t,16,16)}const p="point"===r||"mesh"===r?[]:[new L(this._vertexManipulatorGeometry.instantiate(),4|De),new L(this._vertexManipulatorOutlineGeometry.instantiate(),5|De),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),6|De),new L(this._vertexManipulatorGeometry.instantiate({material:this._selectedManipulatorMaterial}),8),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorOutlineMaterial}),9),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorHoverOutlineMaterial}),10)];this.enableMidpoints&&p.push(new L(this._edgeManipulatorGeometry.instantiate({material:this._vertexManipulatorMaterial}),6|Te),new L(this._edgeManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),6|Te),new L(this._edgeManipulatorGeometry.instantiate(),5|Te),new L(this._edgeManipulatorOutlineGeometry.instantiate(),5|Te));const d=new P({view:a,renderObjects:p,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:this.object.visible,metadata:{deleting:!1},location:Ie(l)});d.selected=i,this._setTypeSpecificManipulatorSettings(d,e,t);const u="vertex"===e.type?{manipulator:d,handle:e,type:"vertex",selectedIndex:0}:{manipulator:d,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0};if(this._manipulatorInfos.push(u),this.manipulators.add(d),this._updateManipulatorPosition(u),"edge"===u.type){const e=[];for(const t of[u.handle.leftVertex,u.handle.rightVertex]){const i=this._getManipulatorInfoFromHandle(t);null!=i&&e.push(i.manipulator.events.on("location-update",()=>this._updateManipulatorPosition(u)))}u.locationUpdateHandle=s(e),this._manipulatorHandles.add(u.locationUpdateHandle,d)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(d,!0),d);const c=ce(d,(e,i,o,s)=>{let r=null;const{snappingStep:p,cancelSnapping:d}=ve({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new _e({editGeometryOperations:n,elevationInfo:t,pointer:s,excludeFeature:this.object.graphic,visualizer:new z}),updatingHandles:this._updatingHandles,useZ:!1});o=o.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>r=h(r)),t)).next(d);const{elevationAlignedLocation:c}=e,m=this.object.graphic??void 0;i.next(e=>this._trackNumDragging(e)).next(e=>{if("start"===e.action&&n&&(r=n.createUndoGroup()),"edge"===u.type){const t=this._splitEdgeManipulator(u);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:u,snapOrigin:u.handle.pos}}).next(me(a,c)).next(R(a,c,t,l,m)).next(de(a,t,m)).next(...p).next(ue()).next(e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(r=h(r)),this._resetTooltip()})});return this._manipulatorHandles.add([c,d.events.on("immediate-click",e=>this._manipulatorClickCallback(e,u)),d.events.on("select-changed",()=>{u.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),d.events.on("focus-changed",()=>{this._resetTooltip()})],d),this.events.emit("manipulators-changed"),u}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._resetTooltip(),this._reshapeEventState){case 0:break;case 1:this.events.emit("move",{type:"move",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape",object:this.object})}t?.(),this.destroyed||this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,i){const a=this._settings;switch(t.type){case"vertex":{e.state=De,e.selectable=!0,e.cursor="move",e.collisionPriority=2;const{size:t,collisionPadding:n}=a.manipulators.vertex;e.radius=t/2+n,e.elevationInfo=i;const o=this._operations?.data.type;e.interactive=null!=o&&"point"!==o&&"mesh"!==o;break}case"line":{e.state=Te,e.selectable=!1,e.cursor="copy",e.collisionPriority=-1;const{size:t,collisionPadding:n}=a.manipulators.edge;e.radius=t/2+n,e.elevationInfo="on-the-ground"!==i.mode||A(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:i;break}}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",i=>{this._onGrabStateChanged(e,t,i.action,i.pointerType)})}_onGrabStateChanged(e,t,i,a="mouse"){if(!this._recreatingManipulators){if("start"===i)t&&this._updateSelection(e),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(0),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==a||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{const{manipulator:t}=e,i=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&null!=i&&"point"!==i&&"mesh"!==i,Se(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit("manipulators-changed"))}_removeManipulator(e){null!=e&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),i(this._manipulatorInfos,e),this.events.emit("manipulators-changed"),this._resetTooltip())}_getManipulatorInfoFromHandle(e){return this._manipulatorInfos.find(t=>t.handle===e)}_updateManipulatorPositions(e){for(const t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){const t=this._operations;if(null!=e&&t)if("vertex"===e.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,we),e.manipulator.grabbing&&null!=this._vertexLaserLineVisualElement&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),a=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==i||null==a)return;const n=i.manipulator,o=a.manipulator;if("on-the-ground"===e.manipulator.elevationInfo?.mode){const i=n.location,a=o.location,s=.5,r=i.x+s*(a.x-i.x),l=i.y+s*(a.y-i.y),p=i.hasZ&&a.hasZ?0:void 0;e.manipulator.location=T(r,l,p,t.data.spatialReference)}else y(He,n.renderLocation,o.renderLocation,.5),e.manipulator.renderLocation=He}}_splitEdgeManipulator(e,t=.5){const i=this._operations,a=i.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=h(e.locationUpdateHandle);const n=this.object.elevationInfo;let o;this.enableEdgeOffset?(this._removeManipulator(e),o=this._createVertexOrEdgeManipulator(a)):(o=e,o.handle=a,o.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,n)),a.leftSegment&&"line"===a.leftSegment.type&&this._createVertexOrEdgeManipulator(a.leftSegment),a.rightSegment&&"line"===a.rightSegment.type&&this._createVertexOrEdgeManipulator(a.rightSegment),this._updateManipulatorPosition(o),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);const s=this._updateEventState(2),r=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.parts.indexOf(a.part);return this.events.emit("vertex-add",{type:"vertex-add",object:this.object,vertices:[{coordinates:r,componentIndex:l,vertexIndex:a.index}],added:r}),s&&this._updateEventState(0),o}_updateMoveManipulationPosition(){const e=O(He,0,0,0);let t=0,i=!1,a=null,n=null;for(const r of this._manipulatorInfos)"vertex"===r.type&&(r.manipulator.selected?(t++,E(e,e,r.manipulator.renderLocation),null==a||r.selectedIndex>a.selectedIndex?(n=a,a=r):(null==n||r.selectedIndex>n.selectedIndex)&&(n=r)):i=!0);const o=this.object,s=this._operations?.data.geometry;if(0===t){const e=o.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&q(this._operations,o.elevationInfo),this._moveManipulation.angle=N(s),this._moveManipulation.radius=W.radiusForSymbol(o.graphic?.symbol)}else{const e=o.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&q(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t;let i=0;if(null!=a){const e=a.handle.pos,t=null!=n?n.handle.pos:a.handle.leftSegment?.leftVertex?a.handle.leftSegment.leftVertex.pos:null,o=null==n&&a.handle.rightSegment?.rightVertex?a.handle.rightSegment.rightVertex.pos:null;t&&o?this._moveManipulation.xyAxisManipulation.available=!1:t?i=je(t,e):o&&(i=je(e,o))}this._moveManipulation.angle=i,this._moveManipulation.radius=B}0!==t&&i?(j(e,e,1/t),we.spatialReference=this._operations.data.spatialReference,we.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,we),this._moveManipulation.elevationAlignedLocation=we):null==this._outlineVisualElement||this.object.isDraped||null==this._outlineVisualElement.attachmentOrigin?C(this._moveManipulation,this.object):this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin}_removeVertices(e){const t=new Array,i=this._operations;if(i){for(const a of e){const e=a.handle.part;if("vertex"===a.type&&i.canRemoveVertex(e)){t.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightSegment));const n=i.removeVertices([a.handle]),o=n.removedVertices?.[0].createdSegment;o&&"line"===o.type?this._createVertexOrEdgeManipulator(o):this.enableEdgeOffset&&e.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(e.segments[0]))}}if(t.length>0){const e=t.map(e=>{const t=i.data.parts.indexOf(e.part);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),a=this._updateEventState(2);if(this.destroyed)return;if(this.events.emit("vertex-remove",{type:"vertex-remove",object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)return;if(a&&(this._updateEventState(0),this.destroyed))return;this._updateMoveManipulationPosition()}}}_moveVertices(e,t,i=("start"===t.action?0:1)){const a=this._operations;if(a){e.length>0&&a.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);for(const t of e)this._updateManipulatorPosition(t)}}_offsetEdge(e,t,i){if(!this._operations)return;const a=t.clone();a.distance=i,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],a),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.type&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===he.Right&&this._removeVertices([t])),"edge"===t.type&&e.button===he.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){null!=this._defaultTooltipInfo?this._resetTooltip():this._updateTranslateObjectTooltip(e,t)}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=oe(e,t,this._tooltipsContext))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=se(this.object,e,this._tooltipsContext))}_resetTooltip(){const e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&"reshape-edge-offset"===e?.type)return;let t=null;t=this._pendingEdgeOffsetInfo||null!=this._findActiveEdgeOffsetManipulatorInfo()?se(this.object,null,this._tooltipsContext):this._defaultTooltipInfo,t!==e&&(null!=e&&null!=t&&"input"===this.tooltip.mode||(this.activeTooltipInfo=t))}get _defaultTooltipInfo(){const e=this._operations?.data.type;switch(e){case"polyline":case"polygon":return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case"point":case"mesh":return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){const e=this._manipulatorInfos.filter(e=>"vertex"===e.type&&e.manipulator.selected);return 1===e.length?e[0]:null}get _tooltipsContext(){const{tooltipInfos:e,activeTooltipInfo:t,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:a}=this;return{sketchOptions:this._sketchOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:a}}get test(){}};function Oe(){return e=>{const{operation:t,mapEnd:i}=e;return null==t||null==i?e:{...e,signedDistance:t.signedDistanceToPoint(i)}}}function Ee(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}function je(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function Ie(e){return new H({x:0,y:0,z:0,spatialReference:e})}function Se(e){return"edge"===e.type&&"edgeManipulator"in e}e([_()],ye.prototype,"_numGrabbing",void 0),e([_()],ye.prototype,"_numDragging",void 0),e([_()],ye.prototype,"_pendingEdgeOffsetInfo",void 0),e([_()],ye.prototype,"_operations",null),e([_()],ye.prototype,"_segmentLabels",void 0),e([_({constructOnly:!0})],ye.prototype,"tool",void 0),e([_()],ye.prototype,"tooltip",void 0),e([_()],ye.prototype,"activeTooltipInfo",void 0),e([_({readOnly:!0})],ye.prototype,"updating",null),e([_()],ye.prototype,"manipulators",null),e([_()],ye.prototype,"view",null),e([_()],ye.prototype,"automaticAreaMeasurementUtils",null),e([_()],ye.prototype,"automaticLengthMeasurementUtils",null),e([_()],ye.prototype,"object",null),e([_()],ye.prototype,"enableZShape",null),e([_()],ye.prototype,"enableDeleteVertices",null),e([_()],ye.prototype,"enableZVertex",null),e([_()],ye.prototype,"autoHideManipulators",null),e([_()],ye.prototype,"enableMoveObject",null),e([_()],ye.prototype,"enableMidpoints",null),e([_()],ye.prototype,"enableEdgeOffset",null),e([_()],ye.prototype,"_sketchOptions",null),e([_()],ye.prototype,"_accentColor",null),e([_()],ye.prototype,"_tooltipsContext",null),ye=e([v("esri.views.3d.interactive.editingTools.reshape.ReshapeOperation")],ye);const we=T(0,0,void 0,D.WGS84),He=S(),Ve=1e-6,De=16,Te=32;export{ye as ReshapeOperation};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as i}from"../../../../../core/arrayUtils.js";import{unitRGBAFromColor as a}from"../../../../../core/colorUtils.js";import{EventEmitter as n}from"../../../../../core/Evented.js";import o from"../../../../../core/Handles.js";import{handlesGroup as s,makeHandle as r,destroyHandle as l}from"../../../../../core/handleUtils.js";import"../../../../../core/has.js";import{destroyMaybe as p,removeMaybe as h}from"../../../../../core/maybe.js";import{watch as d,on as u,initial as c,syncAndInitial as m,when as g,sync as f}from"../../../../../core/reactiveUtils.js";import{property as _}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as M}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{b,e as x,l as y,j as O,g as E,h as j}from"../../../../../chunks/vec32.js";import{fromValues as I,create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as w}from"../../../../../core/support/UpdatingHandles.js";import H from"../../../../../geometry/Point.js";import V from"../../../../../geometry/Polyline.js";import D from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as T}from"../../../../../layers/graphics/dehydratedPoint.js";import{isVolumetricSymbol as A}from"../../../../../symbols/support/utils.js";import{Manipulator3D as P}from"../../Manipulator3D.js";import{createManipulatorMaterial as G,createManipulatorOutlineMaterial as k,placeAtObject as C}from"../../manipulatorUtils.js";import{RenderObject as L}from"../../RenderObject.js";import{SegmentLabels3D as U}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as z}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as R,screenToRenderPlaneFromEvent as F,convertToMapCoordinates as Z}from"../dragEventPipeline3D.js";import{orientation as N}from"../geometryUtils.js";import{canMoveZOperations as q}from"../manipulatorUtils.js";import{Settings as X}from"../settings.js";import{createVisualElements as Y}from"../visualElementUtils.js";import{discRadiusSmall as B}from"../manipulations/config.js";import{MoveManipulation as W}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as K}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as J,createEdgeOffsetIntersectionPlane as Q,createEdgeOffsetOperation as $,edgeOffsetRotationMatrix as ee,screenEdgeLengthSquared as te,getDistanceInGeometrySR as ie}from"./edgeOffsetUtils.js";import{createTooltipInfos as ae,connectTooltipToManipulatedObject as ne,getUpdatedTranslateObjectTooltipInfo as oe,getUpdatedEdgeOffsetTooltipInfo as se}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as re}from"../../visualElements/OutlineVisualElement.js";import{createExtrudedTriangle as le,createSphereGeometry as pe}from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as he}from"../../../../input/IViewEvents.js";import{sceneSnappingAtLocation as de,addMapDelta as ue,createManipulatorDragEventPipeline as ce,dragAtLocation as me,addScreenDelta as ge}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as fe}from"../../../../interactive/keybindings.js";import{SnappingContext as _e}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ve}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as Me,enterInputModeIfAvailable as be}from"../../../../interactive/tooltip/tooltipCommonUtils.js";const xe=Symbol();let ye=class extends t{get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new o,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new w,this._recreatingManipulators=!1,this._settings=new X({getTheme:()=>this.view.effectiveTheme}),this.events=new n,this.activeTooltipInfo=null,this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit("reshape",{type:"reshape",object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit("move",{type:"move",object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){const{view:e}=this,t=this._settings.manipulators,i=t.vertex;this.tooltipInfos=ae(this._sketchOptions,e),this._vertexManipulatorMaterial=G(a(i.color),i.renderOccluded),this._vertexManipulatorOutlineMaterial=k(a(i.outlineColor),i.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=k(a(i.hoverOutlineColor),i.renderOccluded);const n=t.edge;this._edgeManipulatorMaterial=G(a(n.color),n.renderOccluded),this._edgeManipulatorOutlineMaterial=k(a(n.outlineColor),n.renderOccluded);const o=t.edgeOffset;this._edgeOffsetManipulatorMaterial=G(a(o.color),o.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=G(a(o.hoverColor),o.renderOccluded,!1);const s=t.selected;this._selectedManipulatorMaterial=G(a(s.color),s.renderOccluded),this._selectedManipulatorOutlineMaterial=k(a(s.outlineColor),s.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=k(a(s.hoverOutlineColor),s.renderOccluded),this.tooltip=Me(()=>({view:e,options:this._sketchOptions.tooltips})),this.addHandles([d(()=>{const e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:i,selectedSettings:a})=>{e.applyColor(this._vertexManipulatorMaterial),e.applyOutline(this._vertexManipulatorOutlineMaterial),e.applyHoverOutline(this._vertexManipulatorHoverOutlineMaterial),t.applyColor(this._edgeManipulatorMaterial),t.applyOutline(this._edgeManipulatorOutlineMaterial),i.applyColor(this._edgeOffsetManipulatorMaterial),i.applyHover(this._edgeOffsetManipulatorHoverMaterial),a.applyColor(this._selectedManipulatorMaterial),a.applyOutline(this._selectedManipulatorOutlineMaterial),a.applyHoverOutline(this._selectedManipulatorHoverOutlineMaterial)}),d(()=>this.object.visible,e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e,Se(t)&&(t.edgeManipulator.available=e)}),d(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),d(()=>({labels:this._segmentLabels,enabled:this._sketchOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:i})=>{null!=e&&(e.visible=t,e.edgeDistance=i?"far":"default")},c),ne(this.tooltip,this.object,()=>this._tooltipsContext),d(()=>this.tooltip.mode,(e,t)=>{"input"===t&&"input"!==e&&this._resetTooltip()}),u(()=>this._operations,"vertex-update",e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),u(()=>this._operations?.data,"change",e=>{"undo"!==e.operation&&"redo"!==e.operation||this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=p(this._segmentLabels),this.tooltip=p(this.tooltip)}get updating(){return this._updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get automaticAreaMeasurementUtils(){return this.tool.automaticAreaMeasurementUtils}get automaticLengthMeasurementUtils(){return this.tool.automaticLengthMeasurementUtils}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _sketchOptions(){return this.tool.sketchOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return"key-down"===e.type&&e.key===fe.enterInputMode&&("reshape-edge-offset"===this.activeTooltipInfo?.type?this._enterInputModeDuringEdgeOffset(e):!!be(e,this.tooltip)&&(this.tool.endDrag(),!0))}removeSelectedVertices(){const e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&"vertex"===e.type);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit("manipulators-changed")}_removeManipulators(){this._manipulatorHandles.removeAll(),this._moveManipulation=p(this._moveManipulation),this._objectMoveManipulation=p(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(null==this._operations)return;const t=this.object.elevationInfo;for(const{vertices:i,segments:a,index:n}of this._operations.data.parts){const o=e?.byPartIndex.get(n);for(const e of i){const i=o?.has(e.index);this._createVertexOrEdgeManipulator(e,t,i)}for(const e of a)"line"===e.type&&this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}recordUndo(e){this._operations?.recordUndo(e)}get canRedo(){return this._operations?.canRedo??!1}get canUndo(){return this._operations?.canUndo??!1}redo(){return this._operations?.redo()}undo(){return this.events.emit("undo"),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=p(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){const e=this._sketchOptions.labels;this._segmentLabels=new U({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if("end"===t.action)return t;let i=0;const a=[],n=this._manipulatorInfos.some(e=>"vertex"===e.type&&e.manipulator.selected),o=1===e&&n;for(const s of this._manipulatorInfos)"vertex"===s.type&&(s.manipulator.grabbing||o&&!s.manipulator.selected||a.push(s),i++);this._moveVertices(a,t);if(a.length===i){if(this._updateEventState(1),this.destroyed)return t;this.events.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._updateEventState(2),this.destroyed)return t;this.events.emit("reshape",{type:"reshape",object:this.object})}return t}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(xe):this.tool.manipulators.forEach(({manipulator:e})=>{const t=e.disableDisplay?.();t&&this.addHandles(t,xe)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>"vertex"===t.type&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:a}=e;if(!t&&!i&&!a)return;const n=[];for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.selected&&!o.manipulator.grabbing||o===e.info)&&n.push(o);this._moveVertices(n,e,1),this.events.emit("reshape",{type:"reshape",object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(0!==this._numGrabbing||0!==this._numDragging))return!1;switch(this._reshapeEventState){case 1:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape-stop",object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape-stop",object:this.object}),this.destroyed||this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object})}break;case 2:switch(this._reshapeEventState){case 0:this.events.emit("reshape",{type:"reshape-start",object:this.object});break;case 1:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit("reshape",{type:"reshape-start",object:this.object})}}if(this.destroyed)return!1;const i=this._reshapeEventState!==e;return this._reshapeEventState=e,i}_createObjectMoveManipulation(){const{tool:e,view:t,object:i,_operations:a}=this;if(a){if(this._objectMoveManipulation=new K({tool:e,view:t,object:i}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,i,n)=>{i.next(e=>this._trackNumDragging(e)).next(t=>("start"===t.action&&(e=a.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{"end"===t.action&&(this._resetTooltip(),e=h(e))}),n.next(()=>this._onDragCancel(!0,()=>e=h(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on("immediate-click",e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){const{object:t,tool:i,view:a,_operations:n}=this;if(!n)return;this._moveManipulation=new W({tool:i,view:a,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&q(t.operations,t.elevationInfo),snapToScene:!1,radius:W.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on("immediate-click",t=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some(e=>e.manipulator.selected)||this.events.emit("immediate-click",{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));const o=e=>t=>{this.addHandles([t.events.on("focus-changed",({action:t})=>{"focus"===t?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(o(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(o(1)),this._moveManipulation.zManipulation.forEachManipulator(o(2)),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const s=n.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((a,o,s,r,l)=>{const{snappingStep:p,cancelSnapping:h}=ve({predicate:e=>!!e.info,snappingManager:i.snappingManager,snappingContext:new _e({editGeometryOperations:n,elevationInfo:e,pointer:l,excludeFeature:t.graphic,visualizer:new z}),updatingHandles:this._updatingHandles,useZ:!1});return r=r.next(e=>(this._onDragCancel(),e)).next(h),{steps:s=s.next(e=>this._trackNumDragging(e)).next(e=>{const t=this._manipulatorInfos.filter(e=>"vertex"===e.type&&e.manipulator.selected);return 1===e.manipulatorType&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(de(this.view,e,t.graphic??void 0)).next(...p).next(ue()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>(this._updateTranslateTooltip(a,e),e)),cancel:r}},e,s,t.graphic),d(()=>t.visible,()=>this._updateMoveManipulationPosition(),c),t.on("committed",()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),d(()=>t.isDraped,e=>{this._updateMoveManipulationPosition();const t="align-move-manipulation";e?this.addHandles(this.view.elevationProvider.on("elevation-change",()=>this._updateMoveManipulationPosition()),t):this.removeHandles(t)},c)])}_createVisualElements(){const{object:e,view:t}=this,i=Y({view:t,object:e,forEachManipulator:e=>{if(!this.destroyed&&!this._recreatingManipulators){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,1)}},onManipulatorsChanged:e=>this.events.on("manipulators-changed",e)});null!=i&&(this._outlineVisualElement=i.visualElement instanceof re?i.visualElement:null);const a=this._outlineVisualElement;if(null!=a){const t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(u(()=>a.events,"attachment-origin-changed",t,{onListenerAdd:t}))}this._manipulatorHandles.add(i)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){const i=this.view,a=this._operations;if(e.part.vertices.length<=2||!a)return null;const n=a.data.spatialReference,o=this._settings.manipulators.edgeOffset,r=o.size/2,l=r+o.collisionPadding,p=r/l,h=p/2,d=p*Math.sqrt(3)/2,{height:u,offset:c}=o,m=this._edgeOffsetManipulatorMaterial;if(!this._edgeOffsetManipulatorGeometryInside){const e=le(m,d,h,h,u,c);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){const e=le(m,-d,h,h,u,-c);this._edgeOffsetManipulatorGeometryOutside=e}const g=[new L(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new L(this._edgeOffsetManipulatorGeometryInside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),2),new L(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new L(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),2)],f=new P({view:i,renderObjects:g,elevationInfo:"on-the-ground"!==t.mode||A(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:l,available:this.object.visible,collisionType:{type:"disc",direction:I(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:Ie(n)}),_=new P({view:i,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?"move":"default",metadata:{deleting:!1},location:Ie(n)}),v={manipulator:f,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:_,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(v,o.minSquaredEdgeLength);const M=()=>this._updateEdgeOffsetManipulator(v);M(),v.locationUpdateHandle=s([e.leftVertex,e.rightVertex].map(e=>{const t=this._getManipulatorInfoFromHandle(e);return t?.manipulator.events.on("location-update",M)}));const b=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([v.locationUpdateHandle,this._watchAndUpdateGrabState(f,!0),this._watchAndUpdateGrabState(_,!0),ce(f,this._createEdgeOffsetPipeline(v,t,a)),ce(_,this._createEdgePipeline(v,t,a)),_.events.on("immediate-click",b),f.events.on("immediate-click",b),f.events.on("focus-changed",()=>this._resetTooltip()),f.events.on("grab-changed",({screenPoint:e,action:t})=>{v.grabMapPoint="start"===t?J(e,this.view,this.object,v):null})],f),this._manipulatorInfos.push(v),this.manipulators.addMany([f,_]),this.events.emit("manipulators-changed"),v}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,a=e.edgeManipulator,n=()=>{e.visibilityHandle=h(e.visibilityHandle);const n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),o=this._getManipulatorInfoFromHandle(e.handle.rightVertex),l=null!=n&&null!=o&&te(n.manipulator.renderLocation,o.manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!a.focused||l)&&(i.grabbable=!l,a.grabbable=!l,e.visibilityHandle=s([i.disableDisplay(),r(()=>{i.grabbable=!0,a.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([i.events.on("focus-changed",n),a.events.on("focus-changed",n),r(()=>{h(e.visibilityHandle),a.metadata.deleting=!0,this.manipulators.remove(a)})],i),n()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);const{coordinateHelper:t}=this._operations.data,i=Q(this.view,e.manipulator.elevationAlignedLocation,$(t,e.handle,e.manipulator.elevationInfo)),a=this._getManipulatorInfoFromHandle(e.handle.leftVertex),n=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==a||null==n)return;const o=a.manipulator.renderLocation,s=n.manipulator.renderLocation,r=null!=i?ee(i,o,s):M;e.manipulator.modelTransform=r,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=r;const l=b(x(He,o,s))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-l,0,0],[l,0,0]]]}}_createEdgePipeline(e,t,i){return(a,n,o,s)=>{if("touch"===s){this._createEdgeOffsetPipeline(e,t,i)(a,n,o)}else if(this.enableMoveObject){const e=this.object.graphic,s=i.data.spatialReference,{elevationAlignedLocation:r}=a;n.next(e=>this._trackNumDragging(e)).next(me(this.view,r)).next(R(this.view,r,t,s,e)).next(ge()).next(ue()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{"end"===e.action&&this._resetTooltip()}),o.next(()=>this._onDragCancel(!a.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,i){return(a,n,o)=>{const s=this._pendingEdgeOffsetInfo;if(s?.manipulatorInfo===e&&"drag"!==s.mode)return void o.execute({action:"cancel"});this._clearSelection();const{initializeStep:r,cleanup:l}=this._initializeEdgeOffset(e,t,i,o),p=this._applyEdgeOffsetStep(e);n.next(e=>this._trackNumDragging(e)).next(me(this.view,a.elevationAlignedLocation)).next(r).next(F(this.view)).next(Z(this.view,i.data.spatialReference)).next(ue()).next(Oe()).next(e=>this._pendingEdgeOffsetInfo?e:p(e)).next(e=>{"end"!==e.action||this._pendingEdgeOffsetInfo||l()}),o.next(()=>{this._exitEdgeOffsetInputMode(),a.metadata.deleting||(l(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,i,a){const{view:n,object:o}=this,r=$(i.data.coordinateHelper,e.handle,t),l=i.createUndoGroup(),p=Q(n,e.manipulator.elevationAlignedLocation,r);let d;this._splitEdgesBeforeEdgeOffset(e,r),this._selectEdgeOffsetArrow(e,r);const u=()=>{this._cleanEdgeOffsetCollapsedEdges(e,i),d=h(d)},c=this.events.on("undo",u);return d=s([this._initializeEdgeOffsetVisualElement(e,o,t,i),l,c,this._connectEdgeOffsetTooltip(e,r,i,()=>{a.execute({action:"cancel"})})]),{initializeStep:e=>null==r||null==p?(u(),null):{...e,operation:r,plane:p},cleanup:u}}_initializeEdgeOffsetVisualElement(e,t,i,n){const o=()=>new V({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:n.data.spatialReference}),r=new re({view:this.view,isDraped:t.isDraped,geometry:o(),elevationInfo:i,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),p=s([d(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{r.color=a(e),r.isDraped=t},m),t.on("committed",()=>{r.geometry=o()}),l(r)]);return r.attached=!0,p}_applyEdgeOffsetStep(e){return t=>(this.destroyed||null==t.operation||!this._operations||(this._updateEventState(2),null==t.signedDistance?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit("reshape",{type:"reshape",object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){const i=e.handle.leftVertex.leftSegment?.leftVertex,a=e.handle.leftVertex,n=e.handle.rightVertex.rightSegment?.rightVertex,o=e.handle.rightVertex,s=t.data.coordinateHelper,r=this.view.pixelSizeAt(s.vectorToDehydratedPoint(a.pos),s.spatialReference),l=[];if(i&&s.distance(i.pos,a.pos)<Ve){const e=this._getManipulatorInfoFromHandle(a);null!=e&&l.push(e)}if(s.distance(a.pos,o.pos)<r||n&&s.distance(n.pos,o.pos)<Ve){const e=this._getManipulatorInfoFromHandle(o);null!=e&&l.push(e)}l.length&&this._removeVertices(l)}_enterInputModeDuringEdgeOffset(e){const t=this._findActiveEdgeOffsetManipulatorInfo();return!!t&&(!!be(e,this.tooltip)&&(t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"drag"},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"hover"},this._connectEdgeOffsetTooltipOnHover(t),!0)))}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Se).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){const{_operations:t,object:i}=this;if(!t)return;const{elevationInfo:a}=i,n=$(t.data.coordinateHelper,e.handle,a);this._selectEdgeOffsetArrow(e,n),this.addHandles([this._initializeEdgeOffsetVisualElement(e,i,a,t),this._connectEdgeOffsetTooltip(e,n,t,()=>{this.removeHandles(n),this._exitEdgeOffsetInputMode()})],n)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){const t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);null!=t&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){const t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);null!=t&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){const i=e.grabMapPoint??J(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);i&&t.selectArrowFromStartPoint(i)}_connectEdgeOffsetTooltip(e,t,i,a){const n=()=>this.tooltipInfos.edgeOffset.distance.actual,o=n=>{a(),queueMicrotask(()=>{this.view.focus();const a=i.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,ie(n,e.manipulator.location,t,i)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,i),a.remove()})},r=()=>{const e=n();null!=e?o(e):a()};return s([g(()=>this.tooltip&&!this.tooltip.focused,()=>r(),f),this.tooltip.on("discard",a),this.tooltip.on("commit",e=>{"commit-and-exit"===e.type&&r()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,i=!1){const a=this.view,n=this._operations,o=this._settings;if(!n)return null;const r=n.data.type,l=n.data.spatialReference;if("line"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(null==this._vertexManipulatorGeometry||null==this._vertexManipulatorOutlineGeometry){const{size:e,outlineSize:t}=Ee(o.manipulators.vertex);this._vertexManipulatorGeometry=pe(this._vertexManipulatorMaterial,e,16,16),this._vertexManipulatorOutlineGeometry=pe(this._vertexManipulatorOutlineMaterial,t,16,16)}if(null==this._edgeManipulatorGeometry||null==this._edgeManipulatorOutlineGeometry){const{size:e,outlineSize:t}=Ee(o.manipulators.edge);this._edgeManipulatorGeometry=pe(this._edgeManipulatorMaterial,e,16,16),this._edgeManipulatorOutlineGeometry=pe(this._edgeManipulatorOutlineMaterial,t,16,16)}const p="point"===r||"mesh"===r?[]:[new L(this._vertexManipulatorGeometry.instantiate(),4|De),new L(this._vertexManipulatorOutlineGeometry.instantiate(),5|De),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),6|De),new L(this._vertexManipulatorGeometry.instantiate({material:this._selectedManipulatorMaterial}),8),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorOutlineMaterial}),9),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorHoverOutlineMaterial}),10)];this.enableMidpoints&&p.push(new L(this._edgeManipulatorGeometry.instantiate({material:this._vertexManipulatorMaterial}),6|Te),new L(this._edgeManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),6|Te),new L(this._edgeManipulatorGeometry.instantiate(),5|Te),new L(this._edgeManipulatorOutlineGeometry.instantiate(),5|Te));const d=new P({view:a,renderObjects:p,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:this.object.visible,metadata:{deleting:!1},location:Ie(l)});d.selected=i,this._setTypeSpecificManipulatorSettings(d,e,t);const u="vertex"===e.type?{manipulator:d,handle:e,type:"vertex",selectedIndex:0}:{manipulator:d,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0};if(this._manipulatorInfos.push(u),this.manipulators.add(d),this._updateManipulatorPosition(u),"edge"===u.type){const e=[];for(const t of[u.handle.leftVertex,u.handle.rightVertex]){const i=this._getManipulatorInfoFromHandle(t);null!=i&&e.push(i.manipulator.events.on("location-update",()=>this._updateManipulatorPosition(u)))}u.locationUpdateHandle=s(e),this._manipulatorHandles.add(u.locationUpdateHandle,d)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(d,!0),d);const c=ce(d,(e,i,o,s)=>{let r=null;const{snappingStep:p,cancelSnapping:d}=ve({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new _e({editGeometryOperations:n,elevationInfo:t,pointer:s,excludeFeature:this.object.graphic,visualizer:new z}),updatingHandles:this._updatingHandles,useZ:!1});o=o.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>r=h(r)),t)).next(d);const{elevationAlignedLocation:c}=e,m=this.object.graphic??void 0;i.next(e=>this._trackNumDragging(e)).next(e=>{if("start"===e.action&&n&&(r=n.createUndoGroup()),"edge"===u.type){const t=this._splitEdgeManipulator(u);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:u,snapOrigin:u.handle.pos}}).next(me(a,c)).next(R(a,c,t,l,m)).next(de(a,t,m)).next(...p).next(ue()).next(e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(r=h(r)),this._resetTooltip()})});return this._manipulatorHandles.add([c,d.events.on("immediate-click",e=>this._manipulatorClickCallback(e,u)),d.events.on("select-changed",()=>{u.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),d.events.on("focus-changed",()=>{this._resetTooltip()})],d),this.events.emit("manipulators-changed"),u}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._resetTooltip(),this._reshapeEventState){case 0:break;case 1:this.events.emit("move",{type:"move",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape",object:this.object})}t?.(),this.destroyed||this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,i){const a=this._settings;switch(t.type){case"vertex":{e.state=De,e.selectable=!0,e.cursor="move",e.collisionPriority=2;const{size:t,collisionPadding:n}=a.manipulators.vertex;e.radius=t/2+n,e.elevationInfo=i;const o=this._operations?.data.type;e.interactive=null!=o&&"point"!==o&&"mesh"!==o;break}case"line":{e.state=Te,e.selectable=!1,e.cursor="copy",e.collisionPriority=-1;const{size:t,collisionPadding:n}=a.manipulators.edge;e.radius=t/2+n,e.elevationInfo="on-the-ground"!==i.mode||A(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:i;break}}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",i=>{this._onGrabStateChanged(e,t,i.action,i.pointerType)})}_onGrabStateChanged(e,t,i,a="mouse"){if(!this._recreatingManipulators){if("start"===i)t&&this._updateSelection(e),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(0),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==a||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{const{manipulator:t}=e,i=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&null!=i&&"point"!==i&&"mesh"!==i,Se(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit("manipulators-changed"))}_removeManipulator(e){null!=e&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),i(this._manipulatorInfos,e),this.events.emit("manipulators-changed"),this._resetTooltip())}_getManipulatorInfoFromHandle(e){return this._manipulatorInfos.find(t=>t.handle===e)}_updateManipulatorPositions(e){for(const t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){const t=this._operations;if(null!=e&&t)if("vertex"===e.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,we),e.manipulator.grabbing&&null!=this._vertexLaserLineVisualElement&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),a=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==i||null==a)return;const n=i.manipulator,o=a.manipulator;if("on-the-ground"===e.manipulator.elevationInfo?.mode){const i=n.location,a=o.location,s=.5,r=i.x+s*(a.x-i.x),l=i.y+s*(a.y-i.y),p=i.hasZ&&a.hasZ?0:void 0;e.manipulator.location=T(r,l,p,t.data.spatialReference)}else y(He,n.renderLocation,o.renderLocation,.5),e.manipulator.renderLocation=He}}_splitEdgeManipulator(e,t=.5){const i=this._operations,a=i.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=h(e.locationUpdateHandle);const n=this.object.elevationInfo;let o;this.enableEdgeOffset?(this._removeManipulator(e),o=this._createVertexOrEdgeManipulator(a)):(o=e,o.handle=a,o.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,n)),a.leftSegment&&"line"===a.leftSegment.type&&this._createVertexOrEdgeManipulator(a.leftSegment),a.rightSegment&&"line"===a.rightSegment.type&&this._createVertexOrEdgeManipulator(a.rightSegment),this._updateManipulatorPosition(o),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);const s=this._updateEventState(2),r=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.parts.indexOf(a.part);return this.events.emit("vertex-add",{type:"vertex-add",object:this.object,vertices:[{coordinates:r,componentIndex:l,vertexIndex:a.index}],added:r}),s&&this._updateEventState(0),o}_updateMoveManipulationPosition(){const e=O(He,0,0,0);let t=0,i=!1,a=null,n=null;for(const r of this._manipulatorInfos)"vertex"===r.type&&(r.manipulator.selected?(t++,E(e,e,r.manipulator.renderLocation),null==a||r.selectedIndex>a.selectedIndex?(n=a,a=r):(null==n||r.selectedIndex>n.selectedIndex)&&(n=r)):i=!0);const o=this.object,s=this._operations?.data.geometry;if(0===t){const e=o.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&q(this._operations,o.elevationInfo),this._moveManipulation.angle=N(s),this._moveManipulation.radius=W.radiusForSymbol(o.graphic?.symbol)}else{const e=o.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&q(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t;let i=0;if(null!=a){const e=a.handle.pos,t=null!=n?n.handle.pos:a.handle.leftSegment?.leftVertex?a.handle.leftSegment.leftVertex.pos:null,o=null==n&&a.handle.rightSegment?.rightVertex?a.handle.rightSegment.rightVertex.pos:null;t&&o?this._moveManipulation.xyAxisManipulation.available=!1:t?i=je(t,e):o&&(i=je(e,o))}this._moveManipulation.angle=i,this._moveManipulation.radius=B}0!==t&&i?(j(e,e,1/t),we.spatialReference=this._operations.data.spatialReference,we.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,we),this._moveManipulation.elevationAlignedLocation=we):null==this._outlineVisualElement||this.object.isDraped||null==this._outlineVisualElement.attachmentOrigin?C(this._moveManipulation,this.object):this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin}_removeVertices(e){const t=new Array,i=this._operations;if(i){for(const a of e){const e=a.handle.part;if("vertex"===a.type&&i.canRemoveVertex(e)){t.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightSegment));const n=i.removeVertices([a.handle]),o=n.removedVertices?.[0].createdSegment;o&&"line"===o.type?this._createVertexOrEdgeManipulator(o):this.enableEdgeOffset&&e.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(e.segments[0]))}}if(t.length>0){const e=t.map(e=>{const t=i.data.parts.indexOf(e.part);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),a=this._updateEventState(2);if(this.destroyed)return;if(this.events.emit("vertex-remove",{type:"vertex-remove",object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)return;if(a&&(this._updateEventState(0),this.destroyed))return;this._updateMoveManipulationPosition()}}}_moveVertices(e,t,i=("start"===t.action?0:1)){const a=this._operations;if(a){e.length>0&&a.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);for(const t of e)this._updateManipulatorPosition(t)}}_offsetEdge(e,t,i){if(!this._operations)return;const a=t.clone();a.distance=i,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],a),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.type&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===he.Right&&this._removeVertices([t])),"edge"===t.type&&e.button===he.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){null!=this._defaultTooltipInfo?this._resetTooltip():this._updateTranslateObjectTooltip(e,t)}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=oe(e,t,this._tooltipsContext))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=se(this.object,e,this._tooltipsContext))}_resetTooltip(){const e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&"reshape-edge-offset"===e?.type)return;let t=null;t=this._pendingEdgeOffsetInfo||null!=this._findActiveEdgeOffsetManipulatorInfo()?se(this.object,null,this._tooltipsContext):this._defaultTooltipInfo,t!==e&&(null!=e&&null!=t&&"input"===this.tooltip.mode||(this.activeTooltipInfo=t))}get _defaultTooltipInfo(){const e=this._operations?.data.type;switch(e){case"polyline":case"polygon":return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case"point":case"mesh":return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){const e=this._manipulatorInfos.filter(e=>"vertex"===e.type&&e.manipulator.selected);return 1===e.length?e[0]:null}get _tooltipsContext(){const{tooltipInfos:e,activeTooltipInfo:t,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:a}=this;return{sketchOptions:this._sketchOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:a}}get test(){}};function Oe(){return e=>{const{operation:t,mapEnd:i}=e;return null==t||null==i?e:{...e,signedDistance:t.signedDistanceToPoint(i)}}}function Ee(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}function je(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function Ie(e){return new H({x:0,y:0,z:0,spatialReference:e})}function Se(e){return"edge"===e.type&&"edgeManipulator"in e}e([_()],ye.prototype,"_numGrabbing",void 0),e([_()],ye.prototype,"_numDragging",void 0),e([_()],ye.prototype,"_pendingEdgeOffsetInfo",void 0),e([_()],ye.prototype,"_operations",null),e([_()],ye.prototype,"_segmentLabels",void 0),e([_({constructOnly:!0})],ye.prototype,"tool",void 0),e([_()],ye.prototype,"tooltip",void 0),e([_()],ye.prototype,"activeTooltipInfo",void 0),e([_({readOnly:!0})],ye.prototype,"updating",null),e([_()],ye.prototype,"manipulators",null),e([_()],ye.prototype,"view",null),e([_()],ye.prototype,"automaticAreaMeasurementUtils",null),e([_()],ye.prototype,"automaticLengthMeasurementUtils",null),e([_()],ye.prototype,"object",null),e([_()],ye.prototype,"enableZShape",null),e([_()],ye.prototype,"enableDeleteVertices",null),e([_()],ye.prototype,"enableZVertex",null),e([_()],ye.prototype,"autoHideManipulators",null),e([_()],ye.prototype,"enableMoveObject",null),e([_()],ye.prototype,"enableMidpoints",null),e([_()],ye.prototype,"enableEdgeOffset",null),e([_()],ye.prototype,"_sketchOptions",null),e([_()],ye.prototype,"_accentColor",null),e([_()],ye.prototype,"_tooltipsContext",null),ye=e([v("esri.views.3d.interactive.editingTools.reshape.ReshapeOperation")],ye);const we=T(0,0,void 0,D.WGS84),He=S(),Ve=1e-6,De=16,Te=32;export{ye as ReshapeOperation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{valueInUnit as e}from"../../../../../core/quantityUtils.js";import{createScreenPointArray as r,createRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import{getMetersPerUnitForSR as t}from"../../../../../core/unitUtils.js";import{fromValues as n}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{h as s,E as i,k as c,d as l,b as a}from"../../../../../chunks/vec32.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPoint as m}from"../../../../../geometry/projectionUtils.js";import{projectVectorToVector as u}from"../../../../../geometry/projection/projectVectorToVector.js";import{geodesicCompatibleSpatialReference as f,inverseGeodeticSolver as d,InverseGeodeticSolverResult as j,directGeodeticSolver as g}from"../../../../../geometry/support/geodesicUtils.js";import{getNormal as y,fromPositionAndNormal as h,create as R}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as v}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as x}from"../../../../../support/elevationInfoUtils.js";import{OffsetEdgeVertex as C}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function U(e,r,o){const t="on-the-ground"===o.mode?1:0;return new C(e,t,r,0)}function H(e,r,o){const t=p();if(!e.renderCoordsHelper.toRenderCoords(r,t))return null;const n=w(e,r,y(o.plane)),i=w(e,r,o.edgeDirection);if(null==n||null==i)return null;const c=s(p(),n,i);return h(t,c,R())}function w(e,r,o){const t=v(r.x+o[0],r.y+o[1],r.z+o[2],r.spatialReference),n=p(),s=p();return e.renderCoordsHelper.toRenderCoords(r,n)&&e.renderCoordsHelper.toRenderCoords(t,s)?i(s,n,s):null}function T(e,r,o){const t=y(e),c=i(p(),r,o),l=s(p(),c,t),a=s(p(),c,l);return n(c[0],c[1],c[2],0,l[0],l[1],l[2],0,a[0],a[1],a[2],0,0,0,0,1)}function b(e,r,t){const n=t.projectToRenderScreen(e,o()),s=t.projectToRenderScreen(r,o());return null!=n&&null!=s?c(l(n,n,s)):0}function q(e,o,t,n){const{elevationInfo:s,operations:i}=t;if(!i||!e)return null;const c=n.manipulator.elevationAlignedLocation,l=x(c,o,s),a=o.sceneIntersectionHelper.intersectElevationFromScreen(r(e.x,e.y),s,l);return a&&m(a,a,i.data.spatialReference)?a:null}function A(r,o,n,{data:{coordinateHelper:s,spatialReference:i}}){const c=e(r,"meters"),l=t(i),m=Math.sign(c*n.selectedArrow),h=f(i),R=y(n.plane),v=s.pointToXYZ(o),x=p();a(x,v,R,m*(E/l));const C=c*n.selectedArrow/l;if(!h||!u(v,i,v,h)||!u(x,i,x,h))return C;const U=new j;if(d(U,v,x,h),g(x,v,U.azimuth,c,h),!u(x,h,x,i))return C;const H=x[0]-o.x,w=x[1]-o.y,T=Math.sqrt(H*H+w*w)*m,[b,q]=R,A=Math.sqrt(b*b+q*q);return 0===A?0:T/A}const E=10;export{H as createEdgeOffsetIntersectionPlane,U as createEdgeOffsetOperation,T as edgeOffsetRotationMatrix,A as getDistanceInGeometrySR,q as getMapPointAtEdgeOffsetManipulatorElevation,b as screenEdgeLengthSquared};
5
+ import{valueInUnit as e}from"../../../../../core/quantityUtils.js";import{createScreenPointArray as r,createRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import{getMetersPerUnitForSR as t}from"../../../../../core/unitUtils.js";import{fromValues as n}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as s,E as i,m as c,e as l,c as a}from"../../../../../chunks/vec32.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPoint as m}from"../../../../../geometry/projectionUtils.js";import{projectVectorToVector as u}from"../../../../../geometry/projection/projectVectorToVector.js";import{geodesicCompatibleSpatialReference as f,inverseGeodeticSolver as d,InverseGeodeticSolverResult as j,directGeodeticSolver as g}from"../../../../../geometry/support/geodesicUtils.js";import{getNormal as y,fromPositionAndNormal as h,create as R}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as v}from"../../../../../layers/graphics/dehydratedPoint.js";import{getZForElevationMode as x}from"../../../../../support/elevationInfoUtils.js";import{OffsetEdgeVertex as C}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function U(e,r,o){const t="on-the-ground"===o.mode?1:0;return new C(e,t,r,0)}function H(e,r,o){const t=p();if(!e.renderCoordsHelper.toRenderCoords(r,t))return null;const n=w(e,r,y(o.plane)),i=w(e,r,o.edgeDirection);if(null==n||null==i)return null;const c=s(p(),n,i);return h(t,c,R())}function w(e,r,o){const t=v(r.x+o[0],r.y+o[1],r.z+o[2],r.spatialReference),n=p(),s=p();return e.renderCoordsHelper.toRenderCoords(r,n)&&e.renderCoordsHelper.toRenderCoords(t,s)?i(s,n,s):null}function T(e,r,o){const t=y(e),c=i(p(),r,o),l=s(p(),c,t),a=s(p(),c,l);return n(c[0],c[1],c[2],0,l[0],l[1],l[2],0,a[0],a[1],a[2],0,0,0,0,1)}function q(e,r,t){const n=t.projectToRenderScreen(e,o()),s=t.projectToRenderScreen(r,o());return null!=n&&null!=s?c(l(n,n,s)):0}function A(e,o,t,n){const{elevationInfo:s,operations:i}=t;if(!i||!e)return null;const c=n.manipulator.elevationAlignedLocation,l=x(c,o,s),a=o.sceneIntersectionHelper.intersectElevationFromScreen(r(e.x,e.y),s,l);return a&&m(a,a,i.data.spatialReference)?a:null}function E(r,o,n,{data:{coordinateHelper:s,spatialReference:i}}){const c=e(r,"meters"),l=t(i),m=Math.sign(c*n.selectedArrow),h=f(i),R=y(n.plane),v=s.pointToXYZ(o),x=p();a(x,v,R,m*(I/l));const C=c*n.selectedArrow/l;if(!h||!u(v,i,v,h)||!u(x,i,x,h))return C;const U=new j;if(d(U,v,x,h),g(x,v,U.azimuth,c,h),!u(x,h,x,i))return C;const H=x[0]-o.x,w=x[1]-o.y,T=Math.sqrt(H*H+w*w)*m,[q,A]=R,E=Math.sqrt(q*q+A*A);return 0===E?0:T/E}const I=10;export{H as createEdgeOffsetIntersectionPlane,U as createEdgeOffsetOperation,T as edgeOffsetRotationMatrix,E as getDistanceInGeometrySR,A as getMapPointAtEdgeOffsetManipulatorElevation,q as screenEdgeLengthSquared};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import{multiplyOpacityToUnitRGBA as a}from"../../../../../core/colorUtils.js";import{cyclicalPI as o}from"../../../../../core/Cyclical.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import"../../../../../core/has.js";import{clamp as r,rad2deg as s}from"../../../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../../../core/maybe.js";import{watch as l,initial as c}from"../../../../../core/reactiveUtils.js";import{addFrameTask as d}from"../../../../../core/scheduling.js";import{createScreenPointArray as h}from"../../../../../core/screenUtils.js";import{property as p}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as g,fromScaling as m,multiply as f,scale as _,rotate as D}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as M}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as v,d as S,l as b,s as y,h as j,f as R}from"../../../../../chunks/vec32.js";import{fromValues as w,clone as A}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromPositionAndNormal as I,create as F,getNormal as k}from"../../../../../geometry/support/plane.js";import{wrap as E,distance2 as O}from"../../../../../geometry/support/ray.js";import{sm4d as P,sv3d as T}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as U}from"../../Manipulator3D.js";import{calculateInputRotationTransform as x}from"../../manipulatorUtils.js";import{RenderObject as L}from"../../RenderObject.js";import{screenToRenderPlane as C}from"../dragEventPipeline3D.js";import{ringIndicatorDelayMs as H,rotateIndicatorArrowPlacementPercentage as G,ringThickness as z,ringRadius as q,innerIndicatorRadius as B,outerIndicatorRadius as J,rotateIndicatorArrowTipRadius as K,rotateIndicatorArrowTipLength as N,scaleIndicatorOffset1 as Q,scaleIndicatorOffset2 as V,indicatorThickness as W,geometrySegments as X,rotateIndicatorArcLength as Y,scaleIndicatorArcLength as Z,rotateIndicatorDirectionBuffer as $,scaleIndicatorDirectionBuffer as tt,ringHeight as et,dragThresholdPx as at,ringResetAnimationSpeedFactor as ot}from"../manipulations/config.js";import{createPathExtrusionGeometry as it,createExtrudedTriangle as rt,transformInPlace as st}from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as nt}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as lt}from"../../../../interactive/dragEventPipeline.js";const ct={ScaleIn:32,ScaleOut:64,RotateLeft:128,RotateRight:256,Unlocked:1024,DelayedFocused:2048};let dt=class extends e{get angle(){return this.adapter.angle}get scale(){return this.adapter.scale}set location(t){this._ringManipulator.location=t}set elevationAlignedLocation(t){this._ringManipulator.elevationAlignedLocation=t}get grabbing(){return this._ringManipulator.grabbing}set interactive(t){this._ringManipulator.interactive=t}get updating(){return!!this._activeAnimation}constructor(t){super(t),this.mode=null,this._scaleRotateDragData=null,this._activeAnimation=null,this._ringIndicatorDelayMs=H,this.events=new i,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>"scale"===this._scaleRotateDragData?.mode?this.adapter.scale:1}initialize(){this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this.addHandles([l(()=>{const{adapter:t}=this;return[t.angle,t.scale]},()=>this._updateManipulatorTransform())])}destroy(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=null,this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null}startAnimation(t){this.cancelActiveAnimation(),t.start();const e=d({update:({deltaTime:e})=>{t.update(e)&&this.cancelActiveAnimation()}});this._activeAnimation={...t,frameTask:e}}cancelActiveAnimation(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=n(this._activeAnimation)}forEachManipulator(t){t(this._ringManipulator,4)}_createManipulator(){const t=this._createRingManipulator();this._ringManipulator=t,this.tool.manipulators.add(t);const e=this.tool.object,a=lt(t,(t,a,i)=>{this._scaleRotateDragData=null;const n=this.adapter.startInteraction(),l={mode:"none",origin:A(t.renderLocation),initialAngle:this.adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=l,this._updateDragState();const c=T.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(t.renderLocation,c),a.next(C(this.tool.view,I(t.renderLocation,c,F()))).next(t=>{const a=k(t.plane),i=x(t.renderStart,t.renderEnd,l.origin,a),c=o.shortestSignedDiff(l.angle,i);l.angleDir=r(l.angleDir+c,-.3,$),l.angle=i;const d=ht(l,t),h=d-this.adapter.scale;if(l.scaleDir=r(l.scaleDir+h,-.2,tt),this._onScaleChanged(),"none"===l.mode){const a=this.mode||pt(t,t.plane,l.origin,this.tool.view.state.camera);if(null!=a){switch(a){case"rotate":this.tool.events.emit("rotate-start",{object:e,angle:0}),this.tool.events.emit("record-undo",{updates:[this.adapter.createUndoRecord()]});break;case"scale":this.tool.events.emit("scale-start",{object:e,xScale:1,yScale:1}),this.tool.events.emit("record-undo",{updates:[this.adapter.createUndoRecord()]})}l.mode=a}}switch(l.mode){case"rotate":n.state.angle=l.initialAngle+i;break;case"scale":n.state.scale=d,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),t.action){case"start":case"update":switch(l.mode){case"rotate":this.tool.events.emit("rotate",{object:e,angle:s(l.angle)});break;case"scale":this.tool.events.emit("scale",{object:e,xScale:d,yScale:d})}break;case"end":switch(l.mode){case"rotate":this.tool.events.emit("rotate-stop",{object:e,angle:s(l.angle)});break;case"scale":this.tool.events.emit("scale-stop",{object:e,xScale:d,yScale:d})}}return"end"===t.action&&(this.startAnimation(gt(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState(),n.done()),t}),i.next(()=>{if(n.cancel(),null!=this._scaleRotateDragData){switch(this._scaleRotateDragData.mode){case"none":break;case"rotate":this.tool.events.emit("rotate-stop",{object:e,angle:0});break;case"scale":this.tool.events.emit("scale-stop",{object:e,xScale:1,yScale:1})}this.startAnimation(gt(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState()}})});this.addHandles([a,t.events.on("focus-changed",t=>{"focus"===t.action?this.startAnimation(mt(this,()=>this._updateDelayedFocusedState(),{delayMs:this._ringIndicatorDelayMs})):this._updateDelayedFocusedState()}),t.events.on("immediate-click",t=>{t.stopPropagation()}),l(()=>this.tool.object.visible,t=>this._ringManipulator.available=t,c)])}_onScaleChanged(){this.events.emit("scale-changed"),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(ct.DelayedFocused,this.getFocused())}_updateDragState(){if(this._ringManipulator.updateStateEnabled(ct.Unlocked,!(null!=this._scaleRotateDragData&&"none"!==this._scaleRotateDragData?.mode)),null!=this._scaleRotateDragData)switch(this._scaleRotateDragData.mode){case"rotate":this._ringManipulator.updateStateEnabled(ct.ScaleIn|ct.ScaleOut,!1),this._ringManipulator.updateStateEnabled(ct.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(ct.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case"scale":this._ringManipulator.updateStateEnabled(ct.RotateLeft|ct.RotateRight,!1),this._ringManipulator.updateStateEnabled(ct.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(ct.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(ct.ScaleIn|ct.ScaleOut|ct.RotateLeft|ct.RotateRight,!1)}_updateManipulatorTransform(){const t=g(P.get(),this.adapter.angle,w(0,0,1));if(null==t)return;const e=this.getScale(),a=m(P.get(),v(T.get(),e,e,e));this._ringManipulator.modelTransform=f(P.get(),a,t)}_createRingManipulator(){const t=(t,e,a)=>{const o=[],i=Math.ceil(X*(e-t)/(2*Math.PI));for(let r=0;r<i+1;r++){const s=t+r*(e-t)/i;o.push(w(a*Math.cos(s),a*Math.sin(s),0))}return o},e=e=>t(0,2*Math.PI,e),a=t=>[[-t/2,0],[t/2,0],[t/2,et/2],[-t/2,et/2]],o=this._createMaterial(1),i=(t,e,i=o)=>it(i,a(e),t,[],[],!1),r=e(q),s=i(r,z),n={left:new Array,right:new Array},l=[];for(let w=0;w<2;w++){const e=w*Math.PI-Math.PI/4,a=Math.PI/2-Y,r=e+a,s=e+Math.PI/2-a,c=t(r,s,B),d=i(c,W);l.push(c),l.push(t(r,s,J-z/2)),n.left.push(d),n.right.push(d.instantiate());for(let t=0;t<2;t++){const e=0===t,a=M();if(e){_(a,a,[1,-1,1]),D(a,a,-r,[0,0,1]);const t=Math.round(G*(c.length-1));a[12]=c[t][0],a[13]=c[t][1],a[14]=c[t][2]}else{D(a,a,s,[0,0,1]);const t=Math.round((1-G)*(c.length-1));a[12]=c[t][0],a[13]=c[t][1],a[14]=c[t][2]}const i=rt(o,N,0,K,et);st(i,a),(e?n.left:n.right).push(i)}}const c=[];for(let _=0;_<2;_++){const e=_*Math.PI-Math.PI/4,a=Math.PI/2-Z,o=e+a,r=e+Math.PI/2-a,s=t(o,r,J);c.push(i(s,W))}const d=this._createMaterial(.66),h=this._createMaterial(.5),p=this._createMaterial(.33),u=e(q+Q),g=e(q+V),m=i(u,W,d),f=i(g,W,p),v=e(q-Q),S=e(q-V),b=i(v,W,d),y=i(S,W,p);let j=[new L(s,ct.DelayedFocused),new L(s.instantiate({material:h}),0)];this.mode&&"scale"!==this.mode||(j=j.concat([...c.map(t=>new L(t,ct.DelayedFocused|ct.Unlocked)),new L(m,ct.DelayedFocused|ct.ScaleIn),new L(f,ct.DelayedFocused|ct.ScaleIn),new L(b,ct.DelayedFocused|ct.ScaleOut),new L(y,ct.DelayedFocused|ct.ScaleOut)])),this.mode&&"rotate"!==this.mode||(j=j.concat([...n.right.map(t=>new L(t.instantiate(),ct.DelayedFocused|ct.Unlocked)),...n.left.map(t=>new L(t,ct.DelayedFocused|ct.RotateLeft)),...n.right.map(t=>new L(t,ct.DelayedFocused|ct.RotateRight))]));const R=[r,...l];return new U({view:this.tool.view,renderObjects:j,autoScaleRenderObjects:!1,worldOriented:!0,radius:z,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:this.tool.object.elevationInfo,collisionType:{type:"ribbon",paths:R,direction:w(0,0,1)}})}_createMaterial(t){const e=new nt({cullFace:2,renderOccluded:2,isDecoration:!0});return this.addHandles(l(()=>a(this.tool.view.effectiveTheme.accentColor,t),t=>e.setParameters({color:t}),c)),e}get test(){}};function ht(t,e){const a=S(T.get(),e.renderStart,t.origin),o=S(T.get(),e.renderEnd,t.origin),i=b(a),r=b(o);return 0===i?0:r/i}function pt(t,e,a,o){const{renderStart:i,renderEnd:r}=t,s=ut(i,o,T.get()),n=ut(r,o,T.get());if(y(s,n)<at*at)return null;const l=S(T.get(),i,a),c=j(T.get(),l,k(e)),d=i,h=R(T.get(),d,c),p=ut(a,o,T.get()),u=s,g=ut(h,o,T.get()),m=S(T.get(),g,u),f=S(T.get(),s,p),_=E(u,m),D=E(p,f);return O(_,n)<O(D,n)?"rotate":"scale"}function ut(t,e,a){return e.projectToScreen(t,ft),v(a,ft[0],ft[1],0)}function gt(t,e){let a=null,o=1;const i=()=>o;return{start:()=>{o=t.getScale(),a=t.getScale,t.getScale=i,e()},update:t=>(o+=((o+1)/2-o)*Math.min(t*ot,1),e(),Math.abs(o-1)<.01?1:0),destroy:()=>{a&&(t.getScale=a),e()}}}function mt(t,e,a){let o=0,i=null;const r=()=>!1;return{start:()=>{i=t.getFocused,t.getFocused=r,o=0,e()},update:t=>(o+=t,!i?.()||o>=a.delayMs?1:0),destroy:()=>{i&&(t.getFocused=i),e()}}}t([p({constructOnly:!0})],dt.prototype,"tool",void 0),t([p({constructOnly:!0})],dt.prototype,"adapter",void 0),t([p({constructOnly:!0})],dt.prototype,"sketchOptions",void 0),t([p()],dt.prototype,"mode",void 0),t([p()],dt.prototype,"_activeAnimation",void 0),t([p()],dt.prototype,"updating",null),dt=t([u("esri.views.3d.interactive.editingTools.transform.ScaleRotateTransform")],dt);const ft=h();export{dt as ScaleRotateTransform};
5
+ import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import{multiplyOpacityToUnitRGBA as a}from"../../../../../core/colorUtils.js";import{cyclicalPI as o}from"../../../../../core/Cyclical.js";import{EventEmitter as i}from"../../../../../core/Evented.js";import"../../../../../core/has.js";import{clamp as r,rad2deg as s}from"../../../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../../../core/maybe.js";import{watch as l,initial as c}from"../../../../../core/reactiveUtils.js";import{addFrameTask as d}from"../../../../../core/scheduling.js";import{createScreenPointArray as h}from"../../../../../core/screenUtils.js";import{property as p}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as g,fromScaling as m,multiply as f,scale as _,rotate as D}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as M}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as v,e as S,b,s as y,i as j,g as R}from"../../../../../chunks/vec32.js";import{fromValues as w,clone as A}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromPositionAndNormal as I,create as F,getNormal as k}from"../../../../../geometry/support/plane.js";import{wrap as E,distance2 as O}from"../../../../../geometry/support/ray.js";import{sm4d as P,sv3d as T}from"../../../../../geometry/support/vectorStacks.js";import{Manipulator3D as U}from"../../Manipulator3D.js";import{calculateInputRotationTransform as x}from"../../manipulatorUtils.js";import{RenderObject as L}from"../../RenderObject.js";import{screenToRenderPlane as C}from"../dragEventPipeline3D.js";import{ringIndicatorDelayMs as H,rotateIndicatorArrowPlacementPercentage as G,ringThickness as z,ringRadius as q,innerIndicatorRadius as B,outerIndicatorRadius as J,rotateIndicatorArrowTipRadius as K,rotateIndicatorArrowTipLength as N,scaleIndicatorOffset1 as Q,scaleIndicatorOffset2 as V,indicatorThickness as W,geometrySegments as X,rotateIndicatorArcLength as Y,scaleIndicatorArcLength as Z,rotateIndicatorDirectionBuffer as $,scaleIndicatorDirectionBuffer as tt,ringHeight as et,dragThresholdPx as at,ringResetAnimationSpeedFactor as ot}from"../manipulations/config.js";import{createPathExtrusionGeometry as it,createExtrudedTriangle as rt,transformInPlace as st}from"../../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as nt}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as lt}from"../../../../interactive/dragEventPipeline.js";const ct={ScaleIn:32,ScaleOut:64,RotateLeft:128,RotateRight:256,Unlocked:1024,DelayedFocused:2048};let dt=class extends e{get angle(){return this.adapter.angle}get scale(){return this.adapter.scale}set location(t){this._ringManipulator.location=t}set elevationAlignedLocation(t){this._ringManipulator.elevationAlignedLocation=t}get grabbing(){return this._ringManipulator.grabbing}set interactive(t){this._ringManipulator.interactive=t}get updating(){return!!this._activeAnimation}constructor(t){super(t),this.mode=null,this._scaleRotateDragData=null,this._activeAnimation=null,this._ringIndicatorDelayMs=H,this.events=new i,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>"scale"===this._scaleRotateDragData?.mode?this.adapter.scale:1}initialize(){this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this.addHandles([l(()=>{const{adapter:t}=this;return[t.angle,t.scale]},()=>this._updateManipulatorTransform())])}destroy(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=null,this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null}startAnimation(t){this.cancelActiveAnimation(),t.start();const e=d({update:({deltaTime:e})=>{t.update(e)&&this.cancelActiveAnimation()}});this._activeAnimation={...t,frameTask:e}}cancelActiveAnimation(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=n(this._activeAnimation)}forEachManipulator(t){t(this._ringManipulator,4)}_createManipulator(){const t=this._createRingManipulator();this._ringManipulator=t,this.tool.manipulators.add(t);const e=this.tool.object,a=lt(t,(t,a,i)=>{this._scaleRotateDragData=null;const n=this.adapter.startInteraction(),l={mode:"none",origin:A(t.renderLocation),initialAngle:this.adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=l,this._updateDragState();const c=T.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(t.renderLocation,c),a.next(C(this.tool.view,I(t.renderLocation,c,F()))).next(t=>{const a=k(t.plane),i=x(t.renderStart,t.renderEnd,l.origin,a),c=o.shortestSignedDiff(l.angle,i);l.angleDir=r(l.angleDir+c,-.3,$),l.angle=i;const d=ht(l,t),h=d-this.adapter.scale;if(l.scaleDir=r(l.scaleDir+h,-.2,tt),this._onScaleChanged(),"none"===l.mode){const a=this.mode||pt(t,t.plane,l.origin,this.tool.view.state.camera);if(null!=a){switch(a){case"rotate":this.tool.events.emit("rotate-start",{object:e,angle:0}),this.tool.events.emit("record-undo",{updates:[this.adapter.createUndoRecord()]});break;case"scale":this.tool.events.emit("scale-start",{object:e,xScale:1,yScale:1}),this.tool.events.emit("record-undo",{updates:[this.adapter.createUndoRecord()]})}l.mode=a}}switch(l.mode){case"rotate":n.state.angle=l.initialAngle+i;break;case"scale":n.state.scale=d,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),t.action){case"start":case"update":switch(l.mode){case"rotate":this.tool.events.emit("rotate",{object:e,angle:s(l.angle)});break;case"scale":this.tool.events.emit("scale",{object:e,xScale:d,yScale:d})}break;case"end":switch(l.mode){case"rotate":this.tool.events.emit("rotate-stop",{object:e,angle:s(l.angle)});break;case"scale":this.tool.events.emit("scale-stop",{object:e,xScale:d,yScale:d})}}return"end"===t.action&&(this.startAnimation(gt(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState(),n.done()),t}),i.next(()=>{if(n.cancel(),null!=this._scaleRotateDragData){switch(this._scaleRotateDragData.mode){case"none":break;case"rotate":this.tool.events.emit("rotate-stop",{object:e,angle:0});break;case"scale":this.tool.events.emit("scale-stop",{object:e,xScale:1,yScale:1})}this.startAnimation(gt(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState()}})});this.addHandles([a,t.events.on("focus-changed",t=>{"focus"===t.action?this.startAnimation(mt(this,()=>this._updateDelayedFocusedState(),{delayMs:this._ringIndicatorDelayMs})):this._updateDelayedFocusedState()}),t.events.on("immediate-click",t=>{t.stopPropagation()}),l(()=>this.tool.object.visible,t=>this._ringManipulator.available=t,c)])}_onScaleChanged(){this.events.emit("scale-changed"),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(ct.DelayedFocused,this.getFocused())}_updateDragState(){if(this._ringManipulator.updateStateEnabled(ct.Unlocked,!(null!=this._scaleRotateDragData&&"none"!==this._scaleRotateDragData?.mode)),null!=this._scaleRotateDragData)switch(this._scaleRotateDragData.mode){case"rotate":this._ringManipulator.updateStateEnabled(ct.ScaleIn|ct.ScaleOut,!1),this._ringManipulator.updateStateEnabled(ct.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(ct.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case"scale":this._ringManipulator.updateStateEnabled(ct.RotateLeft|ct.RotateRight,!1),this._ringManipulator.updateStateEnabled(ct.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(ct.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(ct.ScaleIn|ct.ScaleOut|ct.RotateLeft|ct.RotateRight,!1)}_updateManipulatorTransform(){const t=g(P.get(),this.adapter.angle,w(0,0,1));if(null==t)return;const e=this.getScale(),a=m(P.get(),v(T.get(),e,e,e));this._ringManipulator.modelTransform=f(P.get(),a,t)}_createRingManipulator(){const t=(t,e,a)=>{const o=[],i=Math.ceil(X*(e-t)/(2*Math.PI));for(let r=0;r<i+1;r++){const s=t+r*(e-t)/i;o.push(w(a*Math.cos(s),a*Math.sin(s),0))}return o},e=e=>t(0,2*Math.PI,e),a=t=>[[-t/2,0],[t/2,0],[t/2,et/2],[-t/2,et/2]],o=this._createMaterial(1),i=(t,e,i=o)=>it(i,a(e),t,[],[],!1),r=e(q),s=i(r,z),n={left:new Array,right:new Array},l=[];for(let w=0;w<2;w++){const e=w*Math.PI-Math.PI/4,a=Math.PI/2-Y,r=e+a,s=e+Math.PI/2-a,c=t(r,s,B),d=i(c,W);l.push(c),l.push(t(r,s,J-z/2)),n.left.push(d),n.right.push(d.instantiate());for(let t=0;t<2;t++){const e=0===t,a=M();if(e){_(a,a,[1,-1,1]),D(a,a,-r,[0,0,1]);const t=Math.round(G*(c.length-1));a[12]=c[t][0],a[13]=c[t][1],a[14]=c[t][2]}else{D(a,a,s,[0,0,1]);const t=Math.round((1-G)*(c.length-1));a[12]=c[t][0],a[13]=c[t][1],a[14]=c[t][2]}const i=rt(o,N,0,K,et);st(i,a),(e?n.left:n.right).push(i)}}const c=[];for(let _=0;_<2;_++){const e=_*Math.PI-Math.PI/4,a=Math.PI/2-Z,o=e+a,r=e+Math.PI/2-a,s=t(o,r,J);c.push(i(s,W))}const d=this._createMaterial(.66),h=this._createMaterial(.5),p=this._createMaterial(.33),u=e(q+Q),g=e(q+V),m=i(u,W,d),f=i(g,W,p),v=e(q-Q),S=e(q-V),b=i(v,W,d),y=i(S,W,p);let j=[new L(s,ct.DelayedFocused),new L(s.instantiate({material:h}),0)];this.mode&&"scale"!==this.mode||(j=j.concat([...c.map(t=>new L(t,ct.DelayedFocused|ct.Unlocked)),new L(m,ct.DelayedFocused|ct.ScaleIn),new L(f,ct.DelayedFocused|ct.ScaleIn),new L(b,ct.DelayedFocused|ct.ScaleOut),new L(y,ct.DelayedFocused|ct.ScaleOut)])),this.mode&&"rotate"!==this.mode||(j=j.concat([...n.right.map(t=>new L(t.instantiate(),ct.DelayedFocused|ct.Unlocked)),...n.left.map(t=>new L(t,ct.DelayedFocused|ct.RotateLeft)),...n.right.map(t=>new L(t,ct.DelayedFocused|ct.RotateRight))]));const R=[r,...l];return new U({view:this.tool.view,renderObjects:j,autoScaleRenderObjects:!1,worldOriented:!0,radius:z,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:this.tool.object.elevationInfo,collisionType:{type:"ribbon",paths:R,direction:w(0,0,1)}})}_createMaterial(t){const e=new nt({cullFace:2,renderOccluded:2,isDecoration:!0});return this.addHandles(l(()=>a(this.tool.view.effectiveTheme.accentColor,t),t=>e.setParameters({color:t}),c)),e}get test(){}};function ht(t,e){const a=S(T.get(),e.renderStart,t.origin),o=S(T.get(),e.renderEnd,t.origin),i=b(a),r=b(o);return 0===i?0:r/i}function pt(t,e,a,o){const{renderStart:i,renderEnd:r}=t,s=ut(i,o,T.get()),n=ut(r,o,T.get());if(y(s,n)<at*at)return null;const l=S(T.get(),i,a),c=j(T.get(),l,k(e)),d=i,h=R(T.get(),d,c),p=ut(a,o,T.get()),u=s,g=ut(h,o,T.get()),m=S(T.get(),g,u),f=S(T.get(),s,p),_=E(u,m),D=E(p,f);return O(_,n)<O(D,n)?"rotate":"scale"}function ut(t,e,a){return e.projectToScreen(t,ft),v(a,ft[0],ft[1],0)}function gt(t,e){let a=null,o=1;const i=()=>o;return{start:()=>{o=t.getScale(),a=t.getScale,t.getScale=i,e()},update:t=>(o+=((o+1)/2-o)*Math.min(t*ot,1),e(),Math.abs(o-1)<.01?1:0),destroy:()=>{a&&(t.getScale=a),e()}}}function mt(t,e,a){let o=0,i=null;const r=()=>!1;return{start:()=>{i=t.getFocused,t.getFocused=r,o=0,e()},update:t=>(o+=t,!i?.()||o>=a.delayMs?1:0),destroy:()=>{i&&(t.getFocused=i),e()}}}t([p({constructOnly:!0})],dt.prototype,"tool",void 0),t([p({constructOnly:!0})],dt.prototype,"adapter",void 0),t([p({constructOnly:!0})],dt.prototype,"sketchOptions",void 0),t([p()],dt.prototype,"mode",void 0),t([p()],dt.prototype,"_activeAnimation",void 0),t([p()],dt.prototype,"updating",null),dt=t([u("esri.views.3d.interactive.editingTools.transform.ScaleRotateTransform")],dt);const ft=h();export{dt as ScaleRotateTransform};