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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (766) hide show
  1. package/analysis/ElevationProfileAnalysis.js +1 -1
  2. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.js +1 -1
  3. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +5 -0
  4. package/analysis/VolumeMeasurementAnalysis.js +1 -1
  5. package/analysis/featureReferenceUtils.js +1 -1
  6. package/applications/Components/featureUtils.d.ts +1 -0
  7. package/applications/Components/featureUtils.js +1 -1
  8. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/{57c08ccb75e3135978d1.js → 0086a09441627842d34a.js} +1 -1
  11. package/assets/esri/core/workers/chunks/02bc183e30e3392bb76d.js +1 -0
  12. package/assets/esri/core/workers/chunks/{155dcbd957f8787a45c3.js → 05eee334d58a0b9f6316.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{0f37204f86d2997a2811.js → 06e60fc7715d08ede59d.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{94ddf029698991d853b9.js → 0811ac64d08454460fb1.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{6391ce002fbde9f27a77.js → 081a7082dc281ca7662a.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{3c3b1dc95f03082e4d5b.js → 083f1c2fd0b59a0bf4c3.js} +1 -1
  17. package/assets/esri/core/workers/chunks/097e5deb51ee7e25e654.js +1 -0
  18. package/assets/esri/core/workers/chunks/{c6cae8471c5d4ae40c65.js → 145c6a7cdcc9893efb27.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{0cfded1acf92f89a13cb.js → 14ace5dc4b8984212a57.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{39a5863355cccaabd2d6.js → 1762ff76350065750c75.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{a98b284b147258629947.js → 188272af9a6470ccfe31.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{ce8f56cf371812b57a46.js → 19699769deff862e29ce.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{ce2fcaa21d6efcdf4da5.js → 1b85967d1178956ee36b.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{bf9d09493fd849ea69fd.js → 1fd459234917a51b6ae1.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{0aaaf4d1c4a5d284216e.js → 22bb877b85ae250d7819.js} +1 -1
  26. package/assets/esri/core/workers/chunks/24b97ba933324aea6a07.js +1 -0
  27. package/assets/esri/core/workers/chunks/{e5d974593043d5e2b502.js → 2795a2817ebe3298c350.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{71fef0a33b7ed9456e47.js → 28a5f8978817e0471a2a.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{07a7ca89ef2ca4fc090b.js → 2a30afa043e3f88655d9.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{41f275401e1cde7eee20.js → 2a8b75d2445680571759.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{6b208f5d423da64c8559.js → 2a900a632a1231deb713.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{0e5e565df6ec71445f2e.js → 2bbe8277578b033f92d4.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{77e611724a499d36eacc.js → 2c72e185b780bbbb1c9f.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{38d874d7f815f5329420.js → 2ca8b0c1ca399fd5dc2f.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{c799f1c03cb22ef52f5f.js → 2d51e9c9b73301b6879c.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{cd0c222a36caa7f80860.js → 2f9e79a67eae746d55d3.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{0856cd281efd71bfe3c4.js → 3116b35a92cc0afd9fd3.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{e153b61560a7a869db63.js → 319c3f46f2afb8f3e5a9.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{b8f55ee77ab6ea4c289e.js → 326a76a4e80269d4029d.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{28bb6896c5fd353ca5e9.js → 3367b8565226646decec.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{8513c9282c44bb0a736e.js → 3495162f4608f5205d87.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{c38360d912f256519e06.js → 3496e025e48cf580250d.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{4753793daf0b7ff8b5ff.js → 35255e2b980f650490d8.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{d2df6e685d6cffc5f486.js → 37d05d9796917c3d4b7a.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{7b17f52019762aa21af8.js → 3815ffa13e7b439bca6e.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{de34c21d3e6913befe5a.js → 3b65d6a78fbffca37fbd.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{2698f656405876f4bd20.js → 3ccdce156b906574bd29.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{0ceb68ff73e5d39e837a.js → 3ffdf73aaecc42448f8a.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{68f5a2d2666636c3f807.js → 40b81d1c2d53cf598b8e.js} +1 -1
  50. package/assets/esri/core/workers/chunks/4239572007ecfac49dc1.js +1 -0
  51. package/assets/esri/core/workers/chunks/{f3284d4e0d41efb0b4a0.js → 441ead5bce80f639934e.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{97eb2cfc1f036feea9a9.js → 44c3b5a507814103f4b4.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{6f29951f5a2da068b257.js → 456161a323be7d640c61.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{b18887a6dc86f0c8324a.js → 48646f3d95a3f2b17e78.js} +1 -1
  55. package/assets/esri/core/workers/chunks/49571d6875de1f2e7e25.js +33 -0
  56. package/assets/esri/core/workers/chunks/{1bbc0dfad4cd72a1c42b.js → 4a2bf3c8da24abd8b9e2.js} +6 -6
  57. package/assets/esri/core/workers/chunks/4b13749b74059a7837d2.js +1 -0
  58. package/assets/esri/core/workers/chunks/{c8e4fe0e3b109eb80e8e.js → 4b83b45df0c4005d078d.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{896c7d137bfd7a8fa0bc.js → 4f01be74dd26e639330f.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{b5c829e904bc9cb5347d.js → 50a5caa96c111dda5c60.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{98381404f2d99a1f9341.js → 50e1c63d0b6196dd365e.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{899f493412acd5a5d91f.js → 5132ca68e8c7af111a47.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{d08b80583a23ba253c7e.js → 56916e56c20465428dd4.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{bbdadced49446c907361.js → 578789c040846ea3759b.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{f62717338075df626eda.js → 5a527a47285a5995cff9.js} +1 -1
  66. package/assets/esri/core/workers/chunks/5cb92abb1f0f38bd0eab.js +1 -0
  67. package/assets/esri/core/workers/chunks/{56edb55b53779e7fd31e.js → 5d2e5774768d8f290343.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{6e5175b43220d6692263.js → 5d3661d1fe46dd29aae9.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{0652d7e525d99e39c957.js → 5fb2ce028b371b3a8acb.js} +1 -1
  70. package/assets/esri/core/workers/chunks/63019a7eb5222dc5e420.js +1 -0
  71. package/assets/esri/core/workers/chunks/{71c6c0b26253c4ca1b68.js → 630efe10c871425b6a95.js} +1 -1
  72. package/assets/esri/core/workers/chunks/64629ddcf008349eaf41.js +1 -0
  73. package/assets/esri/core/workers/chunks/{61e8e159f1f336569b27.js → 65111858957f43eacd8c.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{0427f66b56ec6601deb0.js → 6ac90d88e5f931b1a003.js} +1 -1
  75. package/assets/esri/core/workers/chunks/6c842b955fdd40b39914.js +1 -0
  76. package/assets/esri/core/workers/chunks/{08b0fc6bfe9640ee2525.js → 6cd379bb66dc4cf5d2bf.js} +1 -1
  77. package/assets/esri/core/workers/chunks/6ec77a8142fbfa805b5a.js +1 -0
  78. package/assets/esri/core/workers/chunks/{541bffd61006d0e36166.js → 6f4bd0ee85e7e5a74340.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{648c91a9822bc9d6ee47.js → 701a1835684cf815bcb7.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{f71b76c9506178124fa3.js → 70af1b5b3d2f3f395441.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{d7adef4093ce19ad356d.js → 72846fb9c87c6642daf0.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{f88fe2e8fbc763bdc940.js → 73c1d43070b4fe1e5c1e.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{cab2a1382bdd32bb34d8.js → 7421f9575487cdc9e28e.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{a845c68e76382a73da5e.js → 7633537dc0c65d655baf.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{82e0d22619dc26920ca9.js → 7698f4f4471b6e1c12ef.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{9a0b9d931c1a29e81475.js → 76e444bd625cf3d35877.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{b265472ac3f949a7f40c.js → 773d76253588bcf14eaa.js} +1 -1
  88. package/assets/esri/core/workers/chunks/{77705d0c7c17bd46d81a.js → 7810f870d71f80ca4f41.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{56de25a6fe659a5b5c2b.js → 78b35a19332e58c8c279.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{e4833b718a813a8d125b.js → 79012b873d2b7786be77.js} +1 -1
  91. package/assets/esri/core/workers/chunks/7a6a96edc892d7060b7d.js +1 -0
  92. package/assets/esri/core/workers/chunks/7b3ff47cdbb6af38530d.js +1 -0
  93. package/assets/esri/core/workers/chunks/{04dbdaa63c950f32b8f0.js → 7e8f7fa884d6d41ebae2.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{48133effac2eacc2196e.js → 7fa324900c147ba51019.js} +1 -1
  95. package/assets/esri/core/workers/chunks/80c492f8fdab7698596a.js +1 -0
  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/{a6533bab3b2fbc1e2a47.js → 8b16aa50d879b92a5375.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{2b9c9a35a6e1f56920b5.js → 9027f22a04ac2076ff0e.js} +14 -14
  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/{a0fab8cd791c33d3895d.js → 98dbafa4d45fdf790fff.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{2b867cec6ada339f1c8f.js → 9958a3ed4aa787d19e00.js} +1 -1
  112. package/assets/esri/core/workers/chunks/9a723d739ac44b45432c.js +1 -0
  113. package/assets/esri/core/workers/chunks/9c6fc4fe2c46f40d63d9.js +1 -0
  114. package/assets/esri/core/workers/chunks/{9d9a639f7388a29e7c96.js → 9e4f37367d61a2e13053.js} +1 -1
  115. package/assets/esri/core/workers/chunks/a16526adc0dbffdc1ffc.js +1 -0
  116. package/assets/esri/core/workers/chunks/a19063456ce21b471b69.js +1 -0
  117. package/assets/esri/core/workers/chunks/{c4641c2c130c7b8bcdee.js → a1c4509a3865139eb570.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{e2fdc4dc1ab9decd731e.js → a4db5c9a90107e097df8.js} +1 -1
  119. package/assets/esri/core/workers/chunks/{176f56de787bf486be9f.js → a7bd294996e6c8b8354a.js} +1 -1
  120. package/assets/esri/core/workers/chunks/{80a155496deef2c02a3e.js → a878061845e594b2d72c.js} +1 -1
  121. package/assets/esri/core/workers/chunks/{8f426cb210a4250517d5.js → ad3e18c4c65aa2cd1ceb.js} +1 -1
  122. package/assets/esri/core/workers/chunks/{0328eaea66c1db98da1c.js → ae807912acc19a166264.js} +1 -1
  123. package/assets/esri/core/workers/chunks/{0a981061df08da19372c.js → ae8c387d59be87457567.js} +1 -1
  124. package/assets/esri/core/workers/chunks/{5caf49e679ed0c27e0bd.js → aea8553a2aa54cfd694b.js} +1 -1
  125. package/assets/esri/core/workers/chunks/b1f667006cba60ef4aa7.js +1 -0
  126. package/assets/esri/core/workers/chunks/{70c8f69eed14d55c5cf6.js → b2add7338258ca7c24dd.js} +1 -1
  127. package/assets/esri/core/workers/chunks/b2d9f4e057af26a538fb.js +1 -0
  128. package/assets/esri/core/workers/chunks/{26081b6486c623735657.js → b4ea675831627d9808dd.js} +1 -1
  129. package/assets/esri/core/workers/chunks/{35ca317490540fae437c.js → b54202dcab8df080e991.js} +1 -1
  130. package/assets/esri/core/workers/chunks/ba212ba895ccf573eedf.js +1 -0
  131. package/assets/esri/core/workers/chunks/{95bae3c275f1483eb7ed.js → bcff6178e9d16b1b6191.js} +1 -1
  132. package/assets/esri/core/workers/chunks/{2845a0810e9c00bf30f8.js → bf775fe489213cfc08b1.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{4823e4522bd7379d858e.js → bfc1e8aec7aace3ff30e.js} +1 -1
  134. package/assets/esri/core/workers/chunks/c0849628a7fbc6869340.js +1 -0
  135. package/assets/esri/core/workers/chunks/{20003728a679479b14dc.js → c31583229a1100b66a18.js} +1 -1
  136. package/assets/esri/core/workers/chunks/{9346437b152b20bdcf8a.js → c941d15190fc08523d0d.js} +1 -1
  137. package/assets/esri/core/workers/chunks/{5746c4861af83c1d57a8.js → cf11b1dcc2cff30229b6.js} +1 -1
  138. package/assets/esri/core/workers/chunks/{fe1dcf9f81da4adbb1fe.js → cf13625a033f9903655f.js} +1 -1
  139. package/assets/esri/core/workers/chunks/{1990162dcf73601d54f7.js → d3cd9c24edf7520d0824.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/{c5c6a32a24005478c976.js → e032f3d2ee19790f8c79.js} +1 -1
  149. package/assets/esri/core/workers/chunks/{3d7923d25734d03a4d27.js → e1dba29f5fd1ee5fc999.js} +1 -1
  150. package/assets/esri/core/workers/chunks/{352511dbc67166face40.js → e2e32e2f04cce9e932fd.js} +1 -1
  151. package/assets/esri/core/workers/chunks/e5bcc44f3dc6fc90835a.js +1 -0
  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/f09242e97196ad177c10.js +1 -0
  155. package/assets/esri/core/workers/chunks/{779ee975efebb838b5d6.js → f154336b4af011cd0c56.js} +1 -1
  156. package/assets/esri/core/workers/chunks/{3807d0b9b1894731174d.js → f1be3a177328a169128f.js} +1 -1
  157. package/assets/esri/core/workers/chunks/{0810dbbf348a927392e7.js → f59c782898d931810374.js} +1 -1
  158. package/assets/esri/core/workers/chunks/{c9159ebf930af3f336f3.js → f5d89b48f62fba78fd10.js} +1 -1
  159. package/assets/esri/core/workers/chunks/f7846523adacbfe5047e.js +1 -0
  160. package/assets/esri/core/workers/chunks/{b510c07dfd0d31683b08.js → f7a9d2da07196a0989ae.js} +1 -1
  161. package/assets/esri/core/workers/chunks/{143503f6eb270c4683f8.js → f7c99e9c8d19352af38d.js} +1 -1
  162. package/assets/esri/core/workers/chunks/{79ab06fb4c91ac8da323.js → f839b86bee15deaf84e4.js} +1 -1
  163. package/assets/esri/core/workers/chunks/{9adecee0ed2f1df3b0d2.js → f85e2b6a285fa8ad60aa.js} +1 -1
  164. package/assets/esri/core/workers/chunks/{024063fe2bbb27899094.js → fbbccca5b1bcffb31c4e.js} +1 -1
  165. package/assets/esri/core/workers/chunks/{009556f323e58271bc7a.js → fc4417d1260b717a9385.js} +1 -1
  166. package/assets/esri/core/workers/chunks/{6810ecdeccf4b7eae5e2.js → fdaf8fb5a3cc7abea44b.js} +1 -1
  167. package/assets/esri/core/workers/chunks/{05072093e0209ef5db20.js → fe3f95fda29e4844b153.js} +1 -1
  168. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  169. package/assets/esri/themes/base/widgets/_Editor.scss +4 -0
  170. package/assets/esri/themes/dark/main.css +1 -1
  171. package/assets/esri/themes/light/main.css +1 -1
  172. package/assets/esri/themes/light/view.css +1 -1
  173. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  174. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  175. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  176. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  177. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  178. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  179. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  180. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  181. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  182. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  183. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  184. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  185. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  186. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  187. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  188. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  189. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  190. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  191. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  192. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  193. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  194. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  195. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  196. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  197. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  198. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  199. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  200. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  201. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  202. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  203. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  204. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  205. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  206. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  207. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  208. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  209. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  210. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  211. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  212. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  213. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  214. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
  215. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  216. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  217. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  218. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  219. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  220. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  221. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  222. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  223. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
  224. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  225. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  226. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  227. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  228. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  229. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  230. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  231. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  232. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  233. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  234. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  235. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  236. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  237. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  238. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  239. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  240. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  241. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  242. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  243. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  244. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  245. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  246. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  247. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  248. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  249. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  250. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  251. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  252. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  253. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  254. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  255. package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
  256. package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
  257. package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
  258. package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
  259. package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
  260. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  261. package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
  262. package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
  263. package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
  264. package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
  265. package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
  266. package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
  267. package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
  268. package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
  269. package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
  270. package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
  271. package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
  272. package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
  273. package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
  274. package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
  275. package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
  276. package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
  277. package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
  278. package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
  279. package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
  280. package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
  281. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
  282. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
  283. package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
  284. package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
  285. package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
  286. package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
  287. package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
  288. package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
  289. package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
  290. package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
  291. package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
  292. package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
  293. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
  294. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
  295. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
  296. package/chunks/Envelope.js +1 -1
  297. package/chunks/Fog.glsl.js +2 -2
  298. package/chunks/Geometry.js +1 -1
  299. package/chunks/GlowBlur.glsl.js +8 -9
  300. package/chunks/GlowComposition.glsl.js +15 -16
  301. package/chunks/Laserlines.glsl.js +12 -12
  302. package/chunks/MultiPathImpl.js +1 -1
  303. package/chunks/Point2D.js +1 -1
  304. package/chunks/PointRenderer.glsl.js +1 -1
  305. package/chunks/Precipitation.glsl.js +2 -2
  306. package/chunks/Terrain.glsl.js +1 -1
  307. package/chunks/boundedPlane.js +1 -1
  308. package/chunks/bundle.js +1 -1
  309. package/chunks/cameraUtilsPlanar.js +1 -1
  310. package/chunks/cameraUtilsSpherical.js +1 -1
  311. package/chunks/sphere.js +1 -1
  312. package/chunks/vec32.js +1 -1
  313. package/config.js +1 -1
  314. package/core/accessorSupport/extensions/serializableProperty/reader.js +1 -1
  315. package/core/accessorSupport/extensions/serializableProperty/utils.js +5 -0
  316. package/core/accessorSupport/extensions/serializableProperty.js +1 -1
  317. package/core/accessorSupport/read.js +1 -1
  318. package/core/accessorSupport/write.js +1 -1
  319. package/core/dedupeResult.js +5 -0
  320. package/core/has.js +1 -1
  321. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  322. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  323. package/core/perspectiveUtils.js +1 -1
  324. package/core/workers/workerFactory.js +1 -1
  325. package/editing/geometry/lineUtils.js +1 -1
  326. package/geometry/Mesh.js +1 -1
  327. package/geometry/operators/support/jsonConverter.js +1 -1
  328. package/geometry/projection/localLinearScaleFactors.js +1 -1
  329. package/geometry/projection/projectDirection.js +1 -1
  330. package/geometry/projection/projectVec3Array.js +1 -1
  331. package/geometry/support/axisAngle.js +1 -1
  332. package/geometry/support/axisAngleDegrees.js +1 -1
  333. package/geometry/support/buffer/internals/Vec3.js +1 -1
  334. package/geometry/support/clipRay.js +1 -1
  335. package/geometry/support/coordinateSystem.js +1 -1
  336. package/geometry/support/frustum.js +1 -1
  337. package/geometry/support/lineSegment.js +1 -1
  338. package/geometry/support/meshUtils/centerAt.js +1 -1
  339. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  340. package/geometry/support/meshUtils/loadExternal.js +1 -1
  341. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  342. package/geometry/support/meshUtils/merge.js +1 -1
  343. package/geometry/support/meshUtils/rotate.js +1 -1
  344. package/geometry/support/meshUtils/scale.js +1 -1
  345. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  346. package/geometry/support/plane.js +1 -1
  347. package/geometry/support/polygonUtils.js +1 -1
  348. package/geometry/support/ray.js +1 -1
  349. package/geometry/support/sphereUtils.js +1 -1
  350. package/geometry/support/triangle.js +1 -1
  351. package/geometry/support/vector.js +1 -1
  352. package/interfaces.d.ts +256 -188
  353. package/kernel.js +1 -1
  354. package/layers/FeatureLayer.js +1 -1
  355. package/layers/KnowledgeGraphLayer.js +1 -1
  356. package/layers/LinkChartLayer.js +1 -1
  357. package/layers/VoxelWasmPerSceneView.js +1 -1
  358. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  359. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  360. package/layers/graphics/sources/ParquetSource.js +1 -1
  361. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  362. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  363. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  364. package/layers/graphics/sources/support/QueryTask.js +1 -1
  365. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  366. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  367. package/layers/knowledgeGraph/layerUtils.js +1 -1
  368. package/layers/mixins/ArcGISImageService.js +1 -1
  369. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  370. package/layers/orientedImagery/transformations/utils.js +1 -1
  371. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  372. package/layers/support/Sublayer.js +1 -1
  373. package/layers/support/capabilities.js +1 -1
  374. package/layers/support/featurePopupQueryUtils.js +1 -1
  375. package/layers/support/layerUtils.js +1 -1
  376. package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
  377. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  378. package/layers/support/tiles3DUtils.js +1 -1
  379. package/layers/video/VideoCameraSensorModel.js +1 -1
  380. package/layers/voxel/VoxelVolume.js +1 -1
  381. package/layers/voxel/voxelPlaneUtils.js +1 -1
  382. package/package.json +3 -3
  383. package/rest/knowledgeGraph/GraphApplyEdits.js +1 -1
  384. package/rest/query/executePivotQuery.js +5 -0
  385. package/rest/query/operations/query.js +1 -1
  386. package/rest/query/operations/queryPivot.js +5 -0
  387. package/rest/query/operations/queryUtils.js +5 -0
  388. package/rest/support/PivotDefinition.js +5 -0
  389. package/rest/support/PivotQuery.js +5 -0
  390. package/rest/support/UnPivotDefinition.js +5 -0
  391. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  392. package/smartMapping/support/adapters/support/utils.js +1 -1
  393. package/support/basemapDefinitions.js +1 -1
  394. package/support/revision.js +1 -1
  395. package/views/2d/GoToManager.js +1 -1
  396. package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +1 -1
  397. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  398. package/views/2d/engine/flow/dataUtils.js +1 -1
  399. package/views/2d/engine/flow/utils.js +1 -1
  400. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  401. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  402. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  403. package/views/2d/interactive/editingTools/manipulations/RotateManipulation.js +1 -1
  404. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  405. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  406. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  407. package/views/2d/layers/RouteLayerView2D.js +1 -1
  408. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  409. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  410. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  411. package/views/2d/navigation/actions/Pan.js +1 -1
  412. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  413. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  414. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  415. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  416. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  417. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  418. package/views/3d/analysis/ElevationProfile/ElevationProfileGeometryVisualization3D.js +5 -0
  419. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  420. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  421. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  422. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  423. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  424. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  425. package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
  426. package/views/3d/analysis/Slice/ShiftManipulator.js +1 -1
  427. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  428. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  429. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  430. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  431. package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
  432. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  433. package/views/3d/analysis/Viewshed/ViewshedShapeVisualElement.js +1 -1
  434. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  435. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  436. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  437. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  438. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  439. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  440. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  441. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  442. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.js +1 -1
  443. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  444. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  445. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementErrors.js +5 -0
  446. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  447. package/views/3d/analysis/support/measurementUtils.js +1 -1
  448. package/views/3d/animation/pointToPoint/Animation.js +1 -1
  449. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  450. package/views/3d/camera/constraintUtils/altitude.js +1 -1
  451. package/views/3d/camera/constraintUtils/common.js +1 -1
  452. package/views/3d/camera/constraintUtils/distance.js +1 -1
  453. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  454. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  455. package/views/3d/camera/intersectionUtils.js +1 -1
  456. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  457. package/views/3d/environment/CloudsParameters.js +1 -1
  458. package/views/3d/environment/EnvironmentManager.js +1 -1
  459. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  460. package/views/3d/environment/Fog.js +1 -1
  461. package/views/3d/environment/MarsAtmosphere.js +1 -1
  462. package/views/3d/glTF/loader.js +1 -1
  463. package/views/3d/interactive/Manipulator3D.js +1 -1
  464. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  465. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  466. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  467. package/views/3d/interactive/editingTools/lineObjectVisualElementUtils.js +1 -1
  468. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  469. package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
  470. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  471. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  472. package/views/3d/interactive/editingTools/originGeometryVisualElementUtils.js +1 -1
  473. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  474. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  475. package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
  476. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentMove.js +1 -1
  477. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
  478. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  479. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  480. package/views/3d/interactive/manipulatorUtils.js +1 -1
  481. package/views/3d/interactive/support/viewUtils.js +1 -1
  482. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  483. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  484. package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
  485. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  486. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  487. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  488. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  489. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  490. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  491. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  492. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  493. package/views/3d/interactive/visualElements/support/Segment.js +1 -1
  494. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  495. package/views/3d/layers/FlowSubView3D.js +1 -1
  496. package/views/3d/layers/I3SMeshView3D.js +1 -1
  497. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  498. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  499. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  500. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  501. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  502. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  503. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  504. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  505. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  506. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  507. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  508. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  509. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  510. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  511. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  512. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  513. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  514. package/views/3d/layers/graphics/LabelInfo.js +1 -1
  515. package/views/3d/layers/graphics/Labeler.js +1 -1
  516. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  517. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  518. package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
  519. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  520. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  521. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  522. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  523. package/views/3d/layers/i3s/LoDUtil.js +1 -1
  524. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  525. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  526. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  527. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  528. package/views/3d/layers/support/I3STreeDebugger.js +1 -1
  529. package/views/3d/layers/support/uvUtils.js +1 -1
  530. package/views/3d/state/Frustum.js +1 -1
  531. package/views/3d/state/NearFarHeuristic.js +1 -1
  532. package/views/3d/state/controllers/FovController.js +1 -1
  533. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  534. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  535. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  536. package/views/3d/state/controllers/RotateController.js +1 -1
  537. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  538. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  539. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  540. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  541. package/views/3d/state/controllers/momentum/PanPlanarMomentumController.js +1 -1
  542. package/views/3d/state/controllers/momentum/PanSphericalMomentumController.js +1 -1
  543. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  544. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  545. package/views/3d/state/utils/navigationUtils.js +1 -1
  546. package/views/3d/state/utils/viewUtils.js +1 -1
  547. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  548. package/views/3d/support/RenderCoordsHelper.js +1 -1
  549. package/views/3d/support/cameraUtils.js +1 -1
  550. package/views/3d/support/cameraUtilsInternal.js +1 -1
  551. package/views/3d/support/dito.js +1 -1
  552. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  553. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  554. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  555. package/views/3d/support/flow/constants.js +1 -1
  556. package/views/3d/support/geometryUtils/ray.js +1 -1
  557. package/views/3d/support/intersectionUtils.js +1 -1
  558. package/views/3d/support/mathUtils.js +1 -1
  559. package/views/3d/support/orientedBoundingBox.js +1 -1
  560. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  561. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  562. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  563. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  564. package/views/3d/support/sunUtils.js +1 -1
  565. package/views/3d/support/viewpointUtils.js +1 -1
  566. package/views/3d/terrain/OverlayManager.js +1 -1
  567. package/views/3d/terrain/OverlayRenderer.js +1 -1
  568. package/views/3d/terrain/PatchGeometry.js +1 -1
  569. package/views/3d/terrain/PatchRenderData.js +1 -1
  570. package/views/3d/terrain/SphericalPatch.js +1 -1
  571. package/views/3d/terrain/TerrainRenderer.js +1 -1
  572. package/views/3d/terrain/TerrainSurface.js +1 -1
  573. package/views/3d/terrain/Tile.js +1 -1
  574. package/views/3d/webgl/RenderCamera.js +1 -1
  575. package/views/3d/webgl-engine/Stage.js +1 -1
  576. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  577. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  578. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH.js +1 -1
  579. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  580. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  581. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js +1 -1
  582. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  583. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +2 -2
  584. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  585. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +1 -1
  586. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +1 -1
  587. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  588. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  589. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  590. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +7 -7
  591. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +1 -1
  592. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  593. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  594. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  595. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  596. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  597. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  598. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  599. package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
  600. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  601. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  602. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  603. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  604. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  605. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  606. package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
  607. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  608. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  609. package/views/3d/webgl-engine/lib/Path.js +1 -1
  610. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  611. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  612. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  613. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  614. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  615. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  616. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  617. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  618. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  619. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  620. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  621. package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
  622. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  623. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  624. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  625. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  626. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  627. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  628. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  629. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  630. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  631. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  632. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  633. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  634. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  635. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  636. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  637. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  638. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  639. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  640. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  641. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  642. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  643. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  644. package/views/3d/webgl.js +1 -1
  645. package/views/DOMContainer.js +1 -1
  646. package/views/SceneView.js +1 -1
  647. package/views/View.js +1 -1
  648. package/views/View2D.js +1 -1
  649. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  650. package/views/analysis/ElevationProfile/ElevationProfileError.d.ts +4 -0
  651. package/views/analysis/ElevationProfile/ElevationProfileError.js +5 -0
  652. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
  653. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  654. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  655. package/views/analysis/ElevationProfile/elevationProfileErrors.js +5 -0
  656. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  657. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  658. package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +1 -1
  659. package/views/analysis/ElevationProfile/elevationProfileLayerUtils.js +5 -0
  660. package/views/analysis/ExclusiveOperationManager.js +1 -1
  661. package/views/draw/support/Reshape.js +1 -1
  662. package/views/draw/support/createUtils.js +1 -1
  663. package/views/draw/support/helpMessageUtils3d.js +1 -1
  664. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  665. package/views/interactive/GraphicManipulator.js +1 -1
  666. package/views/interactive/coordinateHelper.js +1 -1
  667. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  668. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  669. package/views/interactive/sketch/constraintUtils.js +1 -1
  670. package/views/interactive/sketch/constraints.js +1 -1
  671. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  672. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  673. package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
  674. package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
  675. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  676. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  677. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  678. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  679. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  680. package/views/layers/FeatureLayerView.d.ts +1 -1
  681. package/views/layers/FeatureLayerView.js +1 -1
  682. package/views/layers/SceneLayerView.js +1 -1
  683. package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
  684. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  685. package/views/navigation/gamepadAndKeyboardUtils.js +1 -1
  686. package/views/popupAdapter.js +1 -1
  687. package/views/support/angularMeasurementUtils.js +1 -1
  688. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  689. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  690. package/views/support/geometry3dUtils.js +1 -1
  691. package/widgets/Daylight/DaylightViewModel.js +1 -1
  692. package/widgets/Daylight.js +1 -1
  693. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  694. package/widgets/Editor/EditorViewModel.js +1 -1
  695. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  696. package/widgets/Editor/SplitFeatureWorkflowData.js +1 -1
  697. package/widgets/Editor/UpdateWorkflow.js +1 -1
  698. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  699. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  700. package/widgets/Editor/components/UploadDetails.js +1 -1
  701. package/widgets/Editor/components/workflowAdapters/pendingFeatureList/CreateFeaturesWorkflowPendingFeatureListAdapter.ts.js +5 -0
  702. package/widgets/Editor/components/workflowAdapters/pendingFeatureList/SplitFeatureWorkflowPendingFeatureListAdapter.js +5 -0
  703. package/widgets/Editor/css.js +1 -1
  704. package/widgets/Editor/modelUploadUtils.js +1 -1
  705. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  706. package/widgets/Editor/workflowUtils.js +1 -1
  707. package/widgets/Editor.js +1 -1
  708. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  709. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  710. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  711. package/widgets/FeatureTable/FieldColumn.js +1 -1
  712. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  713. package/widgets/FeatureTable/support/tableUtils.js +1 -1
  714. package/widgets/FeatureTable/support/templateUtils.js +1 -1
  715. package/widgets/Legend/LegendViewModel.js +1 -1
  716. package/widgets/Legend.js +1 -1
  717. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  718. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  719. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  720. package/widgets/OrientedImageryViewer/dataCaptureUtils.js +1 -1
  721. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  722. package/widgets/OrientedImageryViewer.js +1 -1
  723. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  724. package/widgets/PanoramicViewer/PanoramicZoomManager.js +5 -0
  725. package/widgets/PanoramicViewer/PanoramicZoomViewModel.js +1 -1
  726. package/widgets/PanoramicViewer/constants.js +1 -1
  727. package/widgets/PanoramicViewer/support/ClosestMap.js +5 -0
  728. package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +1 -1
  729. package/widgets/PanoramicViewer/support/PanoramicMeshWorker.js +1 -1
  730. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +5 -0
  731. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +5 -0
  732. package/widgets/PanoramicViewer/support/importUtils.js +5 -0
  733. package/widgets/PanoramicViewer/utils.js +1 -1
  734. package/widgets/PanoramicViewer.js +1 -1
  735. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  736. package/widgets/support/forms/formUtils.js +1 -1
  737. package/analysis/ElevationProfile/ElevationProfileUnits.d.ts +0 -4
  738. package/assets/esri/core/workers/chunks/004b13c1db79c9e668b1.js +0 -1
  739. package/assets/esri/core/workers/chunks/06c389283ee5b60573f2.js +0 -1
  740. package/assets/esri/core/workers/chunks/0ca5060c81a1a05b8be3.js +0 -1
  741. package/assets/esri/core/workers/chunks/1214c126af0de25a4b4a.js +0 -1
  742. package/assets/esri/core/workers/chunks/147f6e7b147beaa4ed29.js +0 -1
  743. package/assets/esri/core/workers/chunks/1f2d13466c60a6b57717.js +0 -1
  744. package/assets/esri/core/workers/chunks/23e600e368ac829680b5.js +0 -1
  745. package/assets/esri/core/workers/chunks/3d800fbc449bea18b1cd.js +0 -1
  746. package/assets/esri/core/workers/chunks/3dcdbba706a8034b6ba3.js +0 -1
  747. package/assets/esri/core/workers/chunks/3e11a893271caa11a881.js +0 -1
  748. package/assets/esri/core/workers/chunks/503c81dda242e6077317.js +0 -1
  749. package/assets/esri/core/workers/chunks/52121179d4f9833008ec.js +0 -1
  750. package/assets/esri/core/workers/chunks/56b3bb68b61b77138186.js +0 -1
  751. package/assets/esri/core/workers/chunks/5aacd1c6b171c99b41f5.js +0 -1
  752. package/assets/esri/core/workers/chunks/633faa9cec8988ab06af.js +0 -33
  753. package/assets/esri/core/workers/chunks/801451fb572bc5f1f270.js +0 -1
  754. package/assets/esri/core/workers/chunks/8d63b42aea32ce2e5d09.js +0 -1
  755. package/assets/esri/core/workers/chunks/b1ccbc2fef7f7e5e04f7.js +0 -1
  756. package/assets/esri/core/workers/chunks/bec9ddd38c9ab9f2561b.js +0 -1
  757. package/assets/esri/core/workers/chunks/bf9031749d10e7d457b6.js +0 -1
  758. package/assets/esri/core/workers/chunks/c473b15d4d52f0a63d20.js +0 -1
  759. package/assets/esri/core/workers/chunks/c547692862df95d22818.js +0 -1
  760. package/assets/esri/core/workers/chunks/c84665db250b05e2829d.js +0 -1
  761. package/assets/esri/core/workers/chunks/c86ca87959f04075e834.js +0 -1
  762. package/assets/esri/core/workers/chunks/ef75cad6570b14a42b62.js +0 -1
  763. package/assets/esri/core/workers/chunks/fb456e7425e09df17d8c.js +0 -1
  764. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization3D.js +0 -5
  765. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementConfiguration.js +0 -5
  766. 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{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import r from"../../../../core/Error.js";import s from"../../../../core/Logger.js";import{findInMap as a}from"../../../../core/MapUtils.js";import{abortMaybe as n,removeMaybe as o,destroyMaybe as l}from"../../../../core/maybe.js";import{MinPriority as h}from"../../../../core/MemCache.js";import d from"../../../../core/PooledArray.js";import{throwIfAborted as p,ignoreAbortErrors as c,createResolver as y,isAbortError as u}from"../../../../core/promiseUtils.js";import g from"../../../../core/Queue.js";import{when as m,watch as b,on as _,syncAndInitial as f,whenOnce as v}from"../../../../core/reactiveUtils.js";import{schedule as C}from"../../../../core/scheduling.js";import{property as S}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as G}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as w,isEmpty as x}from"../../../../core/accessorSupport/diffUtils.js";import{i as P,f as R,g as U}from"../../../../chunks/vec32.js";import{create as D}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import I from"../../../../geometry/Extent.js";import E from"../../../../geometry/Point.js";import{canProjectWithoutEngine as L}from"../../../../geometry/projectionUtils.js";import{projectBuffer as j}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as V}from"../../../../geometry/projection/projectVectorToVector.js";import{projectXYZToVector as A}from"../../../../geometry/projection/projectXYZToVector.js";import{center as O,create as F,fromRect as T,equals as M}from"../../../../geometry/support/aaBoundingBox.js";import{create as k}from"../../../../geometry/support/aaBoundingRect.js";import{equals as z}from"../../../../geometry/support/spatialReferenceUtils.js";import{isPopupProvider as W}from"../../../../graphic/getPopupProvider.js";import H from"../../../../layers/Layer.js";import{getObjectId as B,computeAABB as q,hasGeometry as Q}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as N}from"../../../../layers/graphics/hydratedFeatures.js";import $ from"../../../../renderers/UniqueValueRenderer.js";import{isSupportedRenderer3D as Z,validateTo3D as Y}from"../../../../renderers/support/rendererConversion.js";import{RenderingInfo as X}from"../../../../renderers/support/RenderingInfo.js";import{isBasemapLayerView as J}from"../../../../support/basemapUtils.js";import{loadArcade as K}from"../../../../support/loadArcade.js";import ee from"../../../../symbols/LabelSymbol3D.js";import te from"../../../../symbols/TextSymbol.js";import ie from"../../../../symbols/WebStyleSymbol.js";import{getDefaultSymbol3D as re}from"../../../../symbols/support/defaults3D.js";import{to3D as se}from"../../../../symbols/support/symbolConversion.js";import{averageSymbolComplexities as ae,defaultSymbolComplexity as ne}from"./defaultSymbolComplexity.js";import{DisplayFeatureLimit as oe}from"./DisplayFeatureLimit.js";import{ViewElevationProvider as le}from"./ElevationQuery.js";import{extractExpressionInfo as he,createContext as de}from"./featureExpressionInfoUtils.js";import{Graphics3DFeatureStore as pe}from"./Graphics3DFeatureStore.js";import{Graphics3DGraphicCreationContext as ce}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as ye}from"./Graphics3DSymbolCreationContext.js";import{make as ue}from"./Graphics3DSymbolFactory.js";import{Graphics3DWebStyleSymbol as ge}from"./Graphics3DWebStyleSymbol.js";import{GraphicsCorePerformanceInfo as me}from"./GraphicsCorePerformanceInfo.js";import{GraphicStateTracking as be}from"./GraphicStateTracking.js";import{computeCentroid as _e}from"./graphicUtils.js";import{placePointOnGeometry as fe}from"./pointUtils.js";import{SpatialIndex2D as ve}from"./SpatialIndex2D.js";import{StageLayerElevationProvider as Ce}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as Se}from"../../support/extentUtils.js";import{GridLocalOriginFactory as Ge}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{isScreenSizePerspectiveEnabled as we}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{affectsGeometry as xe}from"../../webgl-engine/lib/VertexAttribute.js";import{WebGLLayer as Pe}from"../../webgl-engine/lib/WebGLLayer.js";import{HUDMaterial as Re}from"../../webgl-engine/materials/HUDMaterial.js";import{hasPopupTemplate as Ue}from"../../../layers/support/popupUtils.js";import{PromiseQueue as De}from"../../../support/PromiseQueue.js";import{PropertiesPool as Ie}from"../../../support/PropertiesPool.js";import{ImmediateTask as Ee,noBudget as Le,TaskPriority as je}from"../../../support/Scheduler.js";import{TextureCompressionTracker as Ve}from"../../../support/TextureCompressionTracker.js";import{Yield as Ae}from"../../../support/Yield.js";import{alphaCutoff as Oe}from"../../../../webscene/support/AlphaCutoff.js";var Fe;const Te=D(),Me=F();let ke=class extends t{static{Fe=this}static{this.tmpVec=D()}get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){return this._spatialIndex||(this._spatialIndex=new ve({objectIdField:this.owner.layer?.objectIdField,spatialReference:this._viewSpatialReference,hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get deconflictor(){return this._deconflictor}get labeler(){return this._labeler}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return null!=this.currentRenderer&&"dictionary"===this.currentRenderer.type?0:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){return!!(this.dataUpdating||this._elevationAlignment?.updating||this._scaleVisibility?.updating||this._filterVisibility?.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._frameTaskHandle.updating||this._updateQueue.updating||this.readyToRun)}get dataUpdating(){return!!(this._graphicsWaitingForSymbol.size>0||this._pendingUpdates.size>0||this._spatialIndex?.updating||this._updatingPendingLoadedGraphicsChange||this._dataUpdateQueue.updating||this._loadingSymbols>0||this.compressionTracker.compressing)}get readyToRun(){return this._pendingUpdates.size>0||!!this._spatialIndex?.updating||this._dataUpdateQueue.readyToRun||this._updateQueue.readyToRun||this._focusAreasGraphicsQueue.length>0}get suspendedOrOutsideOfView(){return this.owner.suspended||!!this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return this.updating?this._pendingUpdates.size+.1*(this._spatialIndex?.updatingRemaining||0)+.1*(this._elevationAlignment?.updatingRemaining||0):0}get displayFeatureLimit(){const e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?.graphics3D.minTotalNumberOfFeatures??0,i=e?.graphics3D.maxTotalNumberOfFeatures??0,r=e?.graphics3D.maxNumberOfDrawCalls??0,s=e?.graphics3D.maxTotalNumberOfVertices??0,a=this.averageSymbolComplexity,n=Math.max(1,a?.verticesPerFeature??1),o=a&&a.drawCallsPerFeature>0&&r>0?r/a.drawCallsPerFeature:i,l=Math.ceil(s/n),h=Math.max(t,Math.min(i,l,o)),d=this._get("displayFeatureLimit");return d&&d.maximumTotalNumberOfVertices===s&&d.averageSymbolComplexity===a&&d.maximumNumberOfFeatures===h?d:new oe(s,h,a)}get averageSymbolComplexity(){const e=ae(this._symbolComplexities),t=this._get("averageSymbolComplexity");return 0===e.numComplexities||null!=t&&(e.estimated&&(t.verticesPerFeature>=e.verticesPerFeature||t.verticesPerCoordinate>=e.verticesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.verticesPerFeature===e.verticesPerFeature&&t.verticesPerCoordinate===e.verticesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e}get usedMemory(){const e=this.labelsEnabled?(this.averageSymbolComplexity?.memory.bytesPerFeatureLabel??0)*this._numberOfGraphics:0,t=this._getSymbolComplexitiesUsed().reduce((e,t)=>e+t.memory.resourceBytes,0);if(null==this._symbolMaterials){this._symbolMaterials=[];for(const e of this._symbols.values())if(null!=e)for(const t of e.symbolLayers)if(t)for(const e of t.materials)e&&this._symbolMaterials.push(e)}const i=this.owner.view.stage.renderer,r=this.owner.view.overlayManager.renderer,s=this._symbolMaterials.reduce((e,t)=>e+((i.getMaterialRenderer(t)||r.getMaterialRenderer(t))?.usedMemory??0),0);return this._usedMemory+e+t+s}get usedMemoryPerGraphic(){if(this._usedMemory&&this._numberOfGraphics){const e=this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves));return this._usedMemory/this._numberOfGraphics*e}if(null!=this.averageSymbolComplexity){const e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}get _symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}get visible(){return this._visible}_getConvertedSymbol(e){const t=e;if("web-style"===t.type)return t.clone();const i=this._symbolConversionCache.get(t.id);if(null!=i)return i;const r=se(t,{geometryType:this.layer?.geometryType??void 0,retainId:!0,hasLabelingContext:this._hasLabelingContext(t),cimFallbackEnabled:!0}),a=r.symbol||null;return null==a&&r.error&&s.getLogger(this).error(r.error.message),this._symbolConversionCache.set(t.id,a),a}_getSymbolComplexitiesUsedOrRenderer(e){if(null==e)return[];const t=e.symbols,i="backgroundFillSymbol"in e?e.backgroundFillSymbol:null;if(!i&&!t.length)return[];const r=[],s=this._getSymbolComplexityUsedOrRenderer(i);null!=s&&r.push(s);for(const a of t){const e=this._getSymbolComplexityUsedOrRenderer(a);null!=e&&r.push(e)}return r}_getSymbolComplexityUsedOrRenderer(e){if(null==e)return null;const t=this._symbols.get(e.id);if(null!=t)return t.complexity;const i=this._getConvertedSymbol(e);return null!=i?ne(i):null}_getSymbolComplexitiesUsed(){const e=[];return this._symbols.forEach(t=>{null!=t&&e.push(t.complexity)}),e}get _objectIdField(){return this.layer.objectIdField}constructor(e){super(e),this._propertiesPool=new Ie({computedExtent:()=>new I},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this._graphicStateTracking=null,this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this._graphicsDrapedUids=new Set,this._graphicsBySymbol=new Map,this._symbolConversionCache=new Map,this._symbols=new Map,this._graphicsWithoutSymbol=new Map,this._graphicsWaitingForSymbol=new Map,this._graphicsUpdateId=0,this._frameTaskHandle=Ee,this._dataUpdateQueue=new De,this._updateQueue=new De,this._focusAreasGraphicsQueue=new g,this._suspendSymbolCleanup=!1,this._arcadeOnDemand=null,this._rendererChangeAbortController=null,this._elevationInfoChangeAbortController=null,this._initializeAbortController=null,this._elevationAlignment=null,this._scaleVisibility=null,this._filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this._featureStore=null,this._deconflictor=null,this._labeler=null,this._objectStates=null,this._viewElevationProvider=null,this._stageLayerElevationProvider=null,this._whenGraphics3DGraphicRequests={},this._pendingUpdates=new Map,this._numberOfGraphics=0,this._numberOfGraphicsProvidingElevation=0,this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this._loadingSymbols=0,this.compressionTracker=new Ve,this._symbolWarningLogged=!1,this._geometryWarningLogged=!1,this._objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new d,this.preferredUpdatePolicy=1,this._forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.setUidToIdOnAdd=!0,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=!1,this._startCreateGraphics=!1,this._unusedSymbolsCache=e.owner.view.resourceController.memoryController.newCache("graphics-3d-unused-symbols",e=>e.destroy()),this.symbolCreationContext=new ye(e.owner.view.resourceController.scheduler,(e,t)=>this._updateQueue.push(e,t),e.owner.layerViewUid,this.compressionTracker)}initialize(){this._featureStore=new pe({objectIdField:this.owner.layer?.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:e=>this.graphics3DGraphics.forEach(e)});const e=(e,t,i)=>this.spatialIndex.queryGraphicUIDsInExtent(e,t,i),{componentFactories:t}=this;this._elevationAlignment=t.elevationAlignment?.(this,e),this._scaleVisibility=t.scaleVisibility?.(this,e),this._filterVisibility=t.filterVisibility?.({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e(B(t.graphic,this._objectIdField)))),setAllFeaturesVisibility:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e)),clearFeaturesVisibility:()=>this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,4,!0))}),this._deconflictor=t.deconflictor?.(this),this._labeler=t.labeler?.(this,this._scaleVisibility),this._objectStates=t.objectStates?.(this),this._initializeAbortController=new AbortController,this.addHandles(m(()=>this.owner.view.state.highlights,()=>{const{highlightOrderMap:e}=this.owner.view.state;this.graphics3DGraphics.forEach(t=>t.updateHighlights(e))})),this._initializePromise=this._initializeAsync()}async _initializeAsync(){const e=this._initializeAbortController?.signal,t=this.owner.view;this._viewElevationProvider=new le(this._viewSpatialReference,t),this._initializeStage(t,this.owner.layerViewUid);const i=t.sharedSymbolResources;this.symbolCreationContext.sharedResources=i,null!=this.currentRenderer&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.streamDataRequester=i.streamDataRequester,this.symbolCreationContext.renderCoordsHelper=t.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new Ge(t.renderSpatialReference),this.symbolCreationContext.elevationProvider=t.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e);const r=he(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await de(r,this._viewSpatialReference,e,s.getLogger(this)),p(e),this.symbolCreationContext.screenSizePerspectiveEnabled=we(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,this.symbolCreationContext.skipHighSymbolLods=!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,"drapeSourceType"in this.owner){const{owner:e}=this;this.symbolCreationContext.drapeSourceRenderer=t.overlayManager.registerGeometryDrapeSource(e)}this.addHandles([b(()=>this.suspendedOrOutsideOfView,()=>this._updateQueue.unshift(()=>this._updateLayerVisibility(),null).catch(c)),b(()=>we(this.layer?.screenSizePerspectiveEnabled),e=>{e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,this._screenSizePerspectiveEnabledChange())}),b(()=>this.owner.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(!!e)),b(()=>this.owner.view.state?.rasterPixelRatio,()=>this._pixelRatioChange()),b(()=>!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._physicalBasedRenderingChange(e)),b(()=>!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,e=>this._skipHighSymbolLoDsChange(e)),b(()=>this.owner.view.focusAreasView?.polygons,()=>this._updateFocusedLabels()),b(()=>this.owner.view.map?.focusAreas.style,()=>this.recreateAllGraphicsAndSymbols()),m(()=>t.basemapTerrain?.tilingScheme,e=>{if(e.spatialReference.equals(this.symbolCreationContext.overlaySR)||null==t.basemapTerrain.spatialReference||(this.symbolCreationContext.overlaySR=t.basemapTerrain.spatialReference),this.hasHandles("loaded-graphics"))this.recreateAllGraphics();else{const e=()=>this.owner?.loadedGraphics;this.addHandles([_(e,"change",e=>{this._graphicsCollectionChanged(e),this._signalUpdatingDuringAsyncLoadedGraphicsChange()},{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],"loaded-graphics")}},{initial:!0}),b(()=>this.effectiveUpdatePolicy,e=>{null!=this.stageLayer&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=0===this.effectiveUpdatePolicy,1===e&&this.runTask(Le)},f)]),this._frameTaskHandle=t.resourceController.scheduler.registerTask(je.GRAPHICS_CORE,this),this.layer&&"featureReduction"in this.layer&&this.addHandles(b(()=>this.layer.featureReduction,()=>this._deconflictor?.featureReductionChange())),this.notifyChange("averageSymbolComplexity"),this.rendererChange(this.owner.renderer).catch(()=>{}),this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController=n(this._initializeAbortController)}_updateFocusedLabels(){this._focusAreasGraphicsQueue.clear(),this.forEachGraphics3DSymbol((e,t)=>{t&&e.needsUpdateFocus&&t.forEach(e=>{this._focusAreasGraphicsQueue.push(e)})})}destroy(){if(this._unusedSymbolsCache.destroy(),this._abortInitialize(),this._rendererChangeAbortController=n(this._rendererChangeAbortController),this._abortElevationInfoChange(),this._frameTaskHandle.remove(),this._frameTaskHandle=Ee,this._dataUpdateQueue.cancelAll(),this._updateQueue.cancelAll(),this._deconflictor=o(this._deconflictor),this._labeler=o(this._labeler),this._elevationAlignment=l(this._elevationAlignment),this._scaleVisibility=l(this._scaleVisibility),this._filterVisibility=l(this._filterVisibility),this._objectStates=l(this._objectStates),this.clear(),"drapeSourceType"in this.owner){const{owner:e}=this;this.stage.view.overlayManager.unregisterDrapeSource(e)}this._featureStore=l(this._featureStore),this._updatingPendingLoadedGraphicsChange=o(this._updatingPendingLoadedGraphicsChange),this._graphicStateTracking=l(this._graphicStateTracking),this.stage&&(this.stageLayer=l(this.stageLayer),this.stage=null),this._set("owner",null);for(const e in this._whenGraphics3DGraphicRequests)this._whenGraphics3DGraphicRequests[e].reject(new r("graphic:layer-destroyed","Layer has been destroyed"));this._whenGraphics3DGraphicRequests=null,this._propertiesPool=l(this._propertiesPool),this._whenSymbolRemoved.prune(),this._symbolConversionCache.clear(),this._objectIdInvisibleSet.clear(),this._spatialIndex=l(this._spatialIndex),this._symbolMaterials=null}clear(){this._objectStates?.allGraphicsDeleted(),null!=this._graphicStateTracking&&this._graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach(e=>e.destroy()),this._spatialIndex?.clear(),this.graphics3DGraphics.clear(),this._numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this._symbols.forEach(l),this._symbols.clear(),this._symbolMaterials&&(this._symbolMaterials.length=0,this._symbolMaterials=null),this._graphicsBySymbol.clear(),this._graphicsWithoutSymbol.clear(),this._graphicsWaitingForSymbol.clear(),this._pendingUpdates.clear(),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this.notifyChange("dataUpdating"),this.notifyChange("readyToRun"),this.notifyChange("updatingRemaining"),this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.()}_initializeStage(e,t){this.stage=e.stage,this.stageLayer=new Pe(this.stage,{visible:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t);const i=this.stageLayer.events;i.on("transformationChanged",e=>this.notifyGraphicGeometryChanged(e.graphicUid)),i.on("shaderTransformationChanged",e=>this.notifyGraphicGeometryChanged(e.graphicUid)),i.on("visibilityChanged",e=>this.notifyGraphicVisibilityChanged(e.graphicUid)),i.on("geometryAdded",e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),i.on("geometryRemoved",e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),i.on("attributesChanged",e=>xe(e.attribute)&&this.notifyGraphicGeometryChanged(e.object.graphicUid))}notifyGraphicGeometryChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),null==this._graphicStateTracking||null==e)return;const t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),null==this._graphicStateTracking||null==e)return;const t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){const e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this._numberOfGraphics>e*We,i=!this.suspendedOrOutsideOfView&&!t;i!==this._visible&&(this._visible=i,this._updateStageLayerVisibility())}_updateStageLayerVisibility(){const e=this._visible&&(null==this.layer.opacity||this.layer.opacity>=Oe);this.stageLayer.visible!==e&&(this.stageLayer.visible=e,e?this.updateGraphicsVisibilities():this._hideAllGraphics(),this.owner.notifyContentGeometryUpdate?.())}getGraphics3DGraphicById(e){return null!=e?this.graphics3DGraphics.get(e):void 0}getGraphics3DGraphicByObjectId(e){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer?.objectIdField){return B(e,t)}get graphics3DGraphicsByObjectID(){const e=this.owner.layer?.objectIdField;if(!e)return;const t=new Map;return this.graphics3DGraphics.forEach(i=>{if(!i)return;const r=i.graphic,s=this._getGraphicObjectID(r,e);null!=s&&t.set(s,i)}),t}get labelsEnabled(){return!!this._labeler?.layerLabelsEnabled()}async updateLabelingInfo(e){const t=this._deconflictor?.labelingInfoChange(e),i=this._labeler?.labelingInfoChange(e);await Promise.allSettled([t,i])}updateVisibilityInfo(){this._deconflictor?.labelingInfoChange(),this._labeler?.visibilityInfoChange()}get symbolUpdateType(){if(this._pendingUpdates.size>0)return"unknown";let e=!1,t=!1;for(const[i,r]of this._symbols)if(null!=r){switch(r.getFastUpdateStatus()){case 3:return"unknown";case 1:this._graphicsBySymbol.has(i)&&(t=!0);break;case 0:this._graphicsBySymbol.has(i)&&(e=!0);break;case 2:this._graphicsBySymbol.has(i)&&(t=e=!0)}}return t?e?"mixed":"fast":e?"slow":"mixed"}runTask(e){if(this._dataUpdateQueue.runTask(e),this._updateQueue.runTask(e),this._applyPendingUpdates(e),this._applyFocusAreasUpdates(e),this.notifyChange("readyToRun"),this.readyToRun||this.notifyChange("dataUpdating"),this.notifyChange("updatingRemaining"),!e.hasProgressed)return Ae}setObjectIdVisibility(e,t){t?this._objectIdInvisibleSet.delete(e):this._objectIdInvisibleSet.add(e);const i=this._findGraphics3DGraphicByObjectId(e);null!=i&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(e){return a(this.graphics3DGraphics,t=>this._getGraphicObjectID(t.graphic)===e)}_updateUserVisibility(e){if(null==e)return!1;const t=e.graphic,i=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&this.stageLayer.visible&&(null==i||!this._objectIdInvisibleSet.has(i));return e.setVisibilityFlag(1,1,r)}_whenGraphics3DGraphic(e){const t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);const i=this._whenGraphics3DGraphicRequests[e.uid];if(i)return i.promise;const r=y();return this._whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){const i=this._viewSpatialReference,r=this.owner.view.renderSpatialReference,s=this.owner.view.basemapTerrain.spatialReference,a=(e,t,s)=>j(e,r,t,e,i,t,s),n=(e,t,r)=>j(e,s,t,e,i,t,r),o=this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:null!=t&&!!t.useViewElevation,minDemResolution:null!=t?t.minDemResolution:null,minDemResolutionForPoints:this.owner.view.resolution}:null,l=await e.getProjectedBoundingBox(a,n,o,t?.signal);if(!l)return null;const h=l.boundingBox;if(l.requiresDrapedElevation){const e=this.symbolCreationContext.elevationProvider;if(e){O(h,Te);const t=e.getElevation(Te[0],Te[1],0,i,"ground")??0;h[2]=Math.min(h[2],t),h[5]=Math.max(h[5],t)}}return{boundingBox:h,screenSpaceObjects:l.screenSpaceObjects}}async whenGraphicBounds(e,t){await v(()=>this.owner?.loadedGraphics);const i=this.owner.layer?.objectIdField,s=this.owner.loadedGraphics.find(t=>t===e||null!=i&&null!=t.attributes&&e.attributes&&t.attributes[i]===e.attributes[i]);if(!s)throw new r("internal:graphic-not-part-of-view","Graphic is not part of this view");const a=await this._whenGraphics3DGraphic(s);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){const i=this.graphics3DGraphics.get(e.uid);if(!i)return null;const r=i.computeAttachmentOrigin();if(0===r.render.num&&0===r.draped.num)return null;P(He,0,0,0);let s=0;if(r.render.num>0){if(!V(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,Be,t))return null;R(He,He,Be),s++}if(r.draped.num>0){const[e,i]=r.draped.origin,a=this._viewElevationProvider.getElevation(e,i,"ground")??0;if(P(Be,e,i,a),!V(Be,this._viewElevationProvider.spatialReference,Be,t))return null;R(He,He,Be),s++}return s>1&&U(He,He,1/s),new E({x:He[0],y:He[1],z:He[2],spatialReference:t})}getSymbolLayerSize(e,t){const i=this._symbols.get(e.id);if(null==i)throw new r("internal:symbol-not-part-of-view","Symbol is not part of this view");const s=e.symbolLayers.indexOf(t);if(-1===s)throw new r("internal:missing-symbol-layer","Symbol layer is not in symbol");const a=i.getSymbolLayerSize(s);if(null==a)throw new r("internal:missing-size","Symbol layer has no valid size");return a}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){const t=e.graphic.uid,i=this.graphics3DGraphics.get(t);if(null!=i||null!=this._graphicsWithoutSymbol.get(t)){switch(e.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,e.graphic);break;case"symbol":this._graphicUpdateSymbolHandler(i,e);break;case"attributes":{const t=this.symbolCreationContext.featureExpressionInfoContext;t?.arcade&&this._graphicUpdateGeometryHandler(i,e.graphic)}break;case"popupTemplate":break;case"origin-transform":this._graphicUpdateTransformHandler(i,e)}this.owner.notifyContentGeometryUpdate?.()}}_graphicUpdateGeometryHandler(e,t){this._graphicUpdateGeometryOrTransformHandler(e,t,()=>!(null==e||!e.graphics3DSymbol.updateGeometry(e)||!(this._labeler?.updateGraphicGeometry(e)??1))&&(this._labeler?.setDirty(),!0));const i=t.geometry;null!=i&&this._expandComputedExtent(i)}_graphicUpdateTransformHandler(e,t){const i=t.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(e,t.graphic,()=>null!=t.newValue&&null!=e&&null!=i&&e.graphics3DSymbol.updateTransform(e,i.spatialReference,t.newValue,t.action))}_graphicUpdateGeometryOrTransformHandler(e,t,i){if(null!=t.geometry){if(null==e){const e=t.symbol?.id;if(e){const t=this._symbols.get(e);if(null!=t&&0===t.loadStatus)return}return void this._recreateGraphic(t)}i()||this._recreateGraphic(e.graphic)}else this._recreateGraphic(t)}_graphicUpdateSymbolHandler(e,t){const i=t.graphic,r=null!=e?e.graphics3DSymbol:null!=t.oldValue?this._symbols.get(t.oldValue.id):null;if(null==r||null==t.newValue)return void this._recreateGraphic(i);const s=r.symbol,a=this._getConvertedSymbol(t.newValue);if(null!=a&&(a.type!==s.type||"web-style"===a.type)||"web-style"===s.type)return void this._recreateGraphic(i);const n=this._graphicsBySymbol.get(s.id);if(n&&1!==n.size)return void this._recreateGraphic(i);const o=w(s,a);if(null==o)return void this._updateSymbolMapping(s.id,a);const l={diff:o,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(l),!x(l.diff))return void this._recreateGraphic(i);const h=this._getRenderingInfo(i,!1);if(null==h)return void this._recreateGraphic(i);const d=r.extentPadding;for(const p of l.symbolStatePatches)p();if(d!==r.extentPadding&&this._recomputeExtentPadding(),null!=e)for(const p of l.graphics3DGraphicPatches)p(e,h);this._updateSymbolMapping(s.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}recreateGraphics(e){this._suspendSymbolCleanup=!0,this.remove(e),this.add(e),this._suspendSymbolCleanup=!1,1===this.effectiveUpdatePolicy&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){const t=this._graphicsUpdateId;return this._graphicsUpdateId++,this._graphicsWaitingForSymbol.set(e.uid,t),1===this._graphicsWaitingForSymbol.size&&this.notifyChange("dataUpdating"),t}_endGraphicUpdate(e,t){e&&(t&&this._graphicStateTracking?.updateGraphicError(e,t),this._graphicsWaitingForSymbol.delete(e.uid),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("dataUpdating")))}_recomputeExtentPadding(){let e=0;this._symbols.forEach(t=>{null!=t&&(e=Math.max(e,t.extentPadding))}),this._set("extentPadding",e)}_expandComputedExtent(e){const t=Me,i=e.spatialReference;q(e,t);const r=this._viewSpatialReference,s=Fe.tmpVec;if(z(i,r)||A(t[0],t[1],0,i,s,r)&&(t[0]=s[0],t[1]=s[1],A(t[3],t[4],0,i,s,r),t[3]=s[0],t[4]=s[1]),!(isFinite(t[0])&&isFinite(t[3])&&isFinite(t[1])&&isFinite(t[4])))return;const a=this.computedExtent;let n=null;const o=isFinite(t[2])&&isFinite(t[5]),l=o&&(null==a?.zmin||t[2]<a.zmin),h=o&&(null==a?.zmax||t[5]>a.zmax);if(a){(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||l||h)&&(n=this._propertiesPool.get("computedExtent"),n.xmin=Math.min(t[0],a.xmin),n.ymin=Math.min(t[1],a.ymin),n.xmax=Math.max(t[3],a.xmax),n.ymax=Math.max(t[4],a.ymax),n.spatialReference=r)}else n=this._propertiesPool.get("computedExtent"),n.xmin=t[0],n.ymin=t[1],n.xmax=t[3],n.ymax=t[4],n.spatialReference=r;n&&(l&&(n.zmin=t[2]),h&&(n.zmax=t[5]),this._set("computedExtent",n))}_abortElevationInfoChange(){this._elevationInfoChangeAbortController&&(this._elevationInfoChangeAbortController.abort(),this._elevationInfoChangeAbortController=null)}async elevationInfoChange(){this._abortElevationInfoChange();const e=new AbortController;this._elevationInfoChangeAbortController=e;const t=he(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await de(t,this._viewSpatialReference,e.signal,s.getLogger(this)),p(e.signal),this._elevationInfoChangeAbortController=null,this._labeler?.elevationInfoChange(),this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("elevationInfo",t)?t?.forEach(e=>{const t=e.graphic,i=e.labelLayers;for(const r of i){r.graphics3DSymbolLayer.graphics3DGraphicLayerElevationInfoChanged(t,r)}}):this._recreateSymbol(i)}),this.updateStageLayerElevationProvider(),this._elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){this._stageLayerElevationProvider?(this.layer.elevationInfo&&"relative-to-scene"===this.layer.elevationInfo.mode||0===this._numberOfGraphicsProvidingElevation)&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=l(this._stageLayerElevationProvider)):(!this.layer.elevationInfo||this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&this._numberOfGraphicsProvidingElevation>0&&(this._stageLayerElevationProvider=new Ce({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register(2,this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear(),null!=this._filterVisibility&&this._filterVisibility.clear(),this._labeler?.reset(),this._deconflictor?.clear(),this._elevationAlignment?.clear(),this.stageLayer?.invalidateSpatialQueryAccelerator(),this._stageLayerElevationProvider&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=l(this._stageLayerElevationProvider))}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;const{loadedGraphics:t,view:i}=this.owner,r=i.basemapTerrain?.tilingScheme&&t?.length?t.toArray():null;!e&&r||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=we(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set("computedExtent",null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){const t=this._graphicsBySymbol.get(e),i=[];t&&(t.forEach((e,t)=>{const r=e.usedMemory;this._conditionalRemove(e,t),this._spatialIndex?.remove(e),i.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,r),this._updateLayerVisibility(),this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.()}),this._graphicsBySymbol.set(e,new Map));const r=this._symbols.get(e);l(r),this._symbols.delete(e),this._symbolMaterials=null,l(this._unusedSymbolsCache.pop(e)),this.add(i)}_recreateGraphicsForSymbol(e){const t=this._graphicsBySymbol.get(e);if(t){const e=[];t.forEach(t=>e.push(t.graphic)),this.recreateGraphics(e)}}_conditionalRemove(e,t){this._graphicsDrapedUids.delete(t),this._objectStates?.removeGraphic(e),this._labeler?.removeGraphic(e),this._deconflictor?.removeGraphic(e),null!=this._graphicStateTracking&&this._graphicStateTracking.removeGraphic(e)}add(e){e&&0!==e.length&&(this.owner.view.basemapTerrain?.tilingScheme?(0===this._updatePolicyForGraphics(e)?this._addDelayed(e):this._addImmediate(e),this.notifyChange("dataUpdating")):s.getLogger(this).error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(e){if(1===this.effectiveUpdatePolicy&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const t of e)if(null!=t.geometry&&"mesh"===t.geometry.type&&!t.geometry.loaded)return 0;return this.effectiveUpdatePolicy}_addImmediate(e){this._geometryWarningLogged=!1,this._symbolWarningLogged=!1;for(const t of e)this._addGraphic(t,this._getRenderingInfo(t),1);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_addDelayed(e){for(const t of e){const e=t.uid;let i=this._pendingUpdates.get(e);i?i.add?0!==i.state&&i.abortController?.abort():this._pendingAdds++:(i=new ze,this._pendingAdds++,this._pendingUpdates.set(e,i)),i.add=t}this.notifyChange("readyToRun"),this.notifyChange("updatingRemaining"),this.notifyChange("dataUpdating")}remove(e){0===this.effectiveUpdatePolicy?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange("dataUpdating")}_removeImmediate(e){for(const t of e)this._removeGraphic(t);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_removeDelayed(e){for(const t of e){const e=t.uid,i=this._pendingUpdates.get(e);if(i)i.add&&(i.remove?i.add=null:this._pendingUpdates.delete(e),1===i.state&&i.abortController?.abort(),this._pendingAdds--);else{const i=new ze;i.remove=t,this._pendingUpdates.set(e,i),this._pendingRemoves++,this._applyPendingRemovesFirst=!0}}0===this._pendingUpdates.size&&this._finishPendingUpdates(),this.notifyChange("readyToRun"),this.notifyChange("updatingRemaining"),this.notifyChange("dataUpdating")}_finishPendingUpdates(){this._cleanupSymbols(),(this._pendingAdds||this._pendingRemoves)&&s.getLogger(this).warn("pendingAdds/Removes in inconsistent state!"),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1}_applyFocusAreasUpdates(e){for(;this._focusAreasGraphicsQueue.length>0&&!e.done;){e.madeProgress();const t=this._focusAreasGraphicsQueue.pop(),i=fe(t.graphic.geometry);if(null==i)continue;const r=this.stage.view.focusAreasView?.containsGeometry(i)??!0;t.layers.forEach(e=>{if(e.stageObject){e.stageObject.geometries.some(e=>e.material instanceof Re&&e.material.parameters.isFocused!==r)&&this.recreateGraphics([t.graphic])}})}0===this._focusAreasGraphicsQueue.length&&this.notifyChange("readyToRun")}_applyPendingUpdates(e){if(this._geometryWarningLogged=!1,this._symbolWarningLogged=!1,0===this._pendingUpdates.size&&this._spatialIndex?.updating)return this._spatialIndex.update(),void e.madeProgress();if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(const[t,i]of this._pendingUpdates){if(e.done){this._applyPendingRemovesFirst=!0;break}if(i.remove&&!i.add&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,this._pendingUpdates.delete(t),0===this._pendingRemoves))break}}for(const[t,i]of this._pendingUpdates){if(e.done)break;i.add&&0===i.state&&this._processPendingUpdateNew(i);let r=this.effectiveUpdatePolicy;if(!i.remove||i.add&&2!==i.state||(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,r=1),i.add)switch(i.state){case 2:this._addGraphic(i.add,i.renderingInfo,r),i.add=null,this._pendingAdds--,e.madeProgress();break;case 3:i.add=null,this._pendingAdds--}null==i.remove&&null==i.add&&this._pendingUpdates.delete(t)}0===this._pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("readyToRun"),this.notifyChange("dataUpdating"))}_processPendingUpdateNew(e){if(!e.add)return void(e.state=2);const t=e.add.geometry;null==t||"mesh"!==t.type||t.loaded?this._processPendingUpdateNewRenderingInfo(e):this._processPendingUpdateNewMesh(e,t)}async _processPendingUpdateNewMesh(e,t){e.state=1,e.abortController=new AbortController;const i=e.abortController.signal;try{await t.load({signal:i})}catch(r){return this._processPendingUpdateNewError(e,r)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,u(t)?e.state=0:e.state=3}async _processPendingUpdateNewRenderingInfo(e){if(null==this.layer.renderer||"dictionary"!==this.layer.renderer.type)return e.renderingInfo=this._getRenderingInfo(e.add),void(e.state=2);e.state=1,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(i){return e.abortController=null,void(u(i)?e.state=0:e.state=3)}null==t?.symbol?(this._symbolWarningLogged||(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=2}_addGraphic(e,t,i){if(this._graphicsWithoutSymbol.set(e.uid,e),null==t?.symbol||!Q(e))return;const r=this.stage.renderView.olidRenderHelper;if(r&&this.setUidToIdOnAdd){const t=J(this.owner.view,this.owner.layerViewUid);r.setUidToObjectAndLayerId(e.objectId,e.uid,this.layer.id,this.owner.layerViewUid,W(this.layer)&&!!this.layer.popupEnabled&&!t&&Ue(this.layer,this.owner.view.popup?.defaultPopupTemplateEnabled))}const s=t.symbol,a=this.getOrCreateGraphics3DSymbol(s,t.renderer);if(null==a)return;this._expandComputedExtent(e.geometry);const n=this._beginGraphicUpdate(e),o=new ce(e,t,this.layer);let l=!1;const h=e=>{e===a.symbol.id&&(l=!0)};this._whenSymbolRemoved.push(h);const d=()=>{if(--this._loadingSymbols,this.destroyed)return;this._whenSymbolRemoved.removeUnordered(h);if(this._graphicsWaitingForSymbol.get(e.uid)!==n||l||a.destroyed||this.graphicSymbolSupported&&e.symbol&&e.symbol.id!==a.symbol.id)--a.referenced,this._cleanupSymbols();else{const t=this._createGraphics3DGraphic(a,o);this._spatialIndex&&null!=t&&this._spatialIndex.add(t),--a.referenced,this._endGraphicUpdate(e)}this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.(),this._labeler?.setDirty()},p=t=>{--this._loadingSymbols,this.destroyed||(this._whenSymbolRemoved.removeUnordered(h),l||(u(t)?this.add([e]):a.destroyed||this._endGraphicUpdate(e,t)))};++this._loadingSymbols,0===i?a.load(()=>this._dataUpdateQueue.push(d,null).catch(c),e=>this._dataUpdateQueue.push(()=>p(e),null).catch(c)):a.load(d,p)}_removeGraphic(e){const t=e.uid,i=this.graphics3DGraphics.get(t);if(i){i.graphics3DSymbol.onRemoveGraphic(i);const e=i.usedMemory,r=i.isElevationSource;this._conditionalRemove(i,t),this._spatialIndex?.remove(i);const s=i.graphics3DSymbol.symbol.id;this._graphicsBySymbol.get(s)?.delete(t),this._graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,e,r),i.destroy(),this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.()}else this._graphicsWithoutSymbol.delete(t),this._graphicsWaitingForSymbol.delete(t),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("dataUpdating"))}_hasLabelingContext(e){if(e instanceof ee||e instanceof te){const t=this.symbolCreationContext.layer;return!!t.labelingInfo&&t.labelingInfo.some(t=>t.symbol===e)}return!1}_hasValidSymbolCreationContext(e){return!(e instanceof ee&&!this._hasLabelingContext(e))||(s.getLogger(this).error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(e,t=!0){const i=e.geometry;if(null==i)return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!L(i.spatialReference,this._viewSpatialReference))return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&null!=e.symbol)return t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?N(e,this.layer,null):e;let a;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||null!=this.currentRenderer))a=this.owner.getRenderingInfo(r,this.currentRenderer,this._arcadeOnDemand);else{const e=r.symbol||re(r.geometry);a=new X(null,e)}return null==a?.symbol?(t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):a}_getRenderingInfoAsync(e,t){if(null==e.geometry)return this._geometryWarningLogged||(this._geometryWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&null!=e.symbol)return this._symbolWarningLogged||(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const i=this.rendererHasGeometryOperations?N(e,this.layer,null):e;return this.owner.getRenderingInfoAsync(i,this.currentRenderer,this._arcadeOnDemand,t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;const i=this._getConvertedSymbol(e);if(!i)return null;let r;if(null!=t&&"backgroundFillSymbol"in t&&t.backgroundFillSymbol){const e=se(t.backgroundFillSymbol,{ignoreDrivers:!0});null!=e.symbol&&(r=e.symbol.symbolLayers)}const s=ue(i,this.symbolCreationContext,r);return s.load(()=>{const e=s.extentPadding;e>this.extentPadding&&this._set("extentPadding",e),this.notifyChange("averageSymbolComplexity")},()=>{}),s}getOrCreateGraphics3DSymbol(e,t){let i=this._symbols.get(e.id);if(void 0===i){const r=this._unusedSymbolsCache.pop(e.id);i=null!=r?r:e instanceof ie?new ge(e,e=>this._dataUpdateQueue.push(e,null),e=>this._createGraphics3DSymbol(e,t)):this._createGraphics3DSymbol(e,t),this._symbols.set(e.id,i),this._symbolMaterials=null}return null!=i&&++i.referenced,i}trackGraphicState(e){return null==this._graphicStateTracking&&(this._graphicStateTracking=new be(this)),this._graphicStateTracking.add(e)}_addGraphics3DGraphic(e){this._usedMemory+=e.usedMemory,this.graphics3DGraphics.set(e.graphic.uid,e),this._numberOfGraphics++,e.isElevationSource&&(this._numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,i=!1){this._usedMemory-=t,this.graphics3DGraphics.delete(e),this._numberOfGraphics--,i&&(this._numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){const{graphic:i}=t;if(this._graphicsWithoutSymbol.delete(i.uid),!this._symbols.has(e.symbol.id))return this.add([i]),null;if(this.graphics3DGraphics.has(i.uid))return null;const r=e.createGraphics3DGraphic(t);if(null==r)return null;this._addGraphics3DGraphic(r);const s=e.symbol.id;this._graphicsBySymbol.has(s)||this._graphicsBySymbol.set(s,new Map),this._graphicsBySymbol.get(s).set(i.uid,r);if(r.isDraped&&this._graphicsDrapedUids.add(i.uid),r.centroid=null,null!=i.geometry&&"point"!==i.geometry.type&&(r.centroid=_e(i.geometry,this._viewSpatialReference)),this._updateUserVisibility(r),null!=this._scaleVisibility&&this._scaleVisibility.updateVisibility(r),null!=this._filterVisibility){const{defaultVisibility:e}=this._filterVisibility;r.setVisibilityFlag(1,4,e),e||this._filterVisibility.reapply()}this._deconflictor?.addGraphic(r),this._labeler?.addGraphic(r),this._objectStates?.addGraphic(r),r.initialize(this.stageLayer),null!=this._graphicStateTracking&&this._graphicStateTracking.addGraphic(r);const a=this._whenGraphics3DGraphicRequests[i.uid];return a&&(delete this._whenGraphics3DGraphicRequests[i.uid],a.resolve(r)),this._symbolMaterials=null,r}async rendererChange(e){if(this._rendererChangeAbortController=n(this._rendererChangeAbortController),e!==this.currentRenderer)if(this._validateRenderer(e),null==e&&this._currentRendererChange(null,!1),Z(e))if(e?.arcadeRequired){const t=new AbortController;this._rendererChangeAbortController=t;const{arcadeUtils:i}=await this._ensureArcade();p(t);const r=i.hasGeometryOperations(e);r&&(await i.enableGeometryOperations(),p(t)),0===this.effectiveUpdatePolicy?await this._updateQueue.push(()=>this._currentRendererChange(e,r),t.signal):this._currentRendererChange(e,r),this._rendererChangeAbortController=null}else if(0===this.effectiveUpdatePolicy){const t=new AbortController;this._rendererChangeAbortController=t,await this._updateQueue.push(()=>this._currentRendererChange(e,!1),t.signal),this._rendererChangeAbortController=null}else this._currentRendererChange(e,!1);else this._currentRendererChange(e,!1)}async _ensureArcade(){return null==this._arcadeOnDemand?(this._arcadeOnDemand=await K(),this._arcadeOnDemand):this._arcadeOnDemand}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererHasGeometryOperations=t,this.symbolCreationContext.arcade=this._arcadeOnDemand;const i=this.symbolCreationContext.renderer;if(e===i)return;if(this._symbolConversionCache.clear(),this._unusedSymbolsCache.clear(),null==e)return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const r=w(i,e);this._updateUnchangedSymbolMappings(r,e,i),this.symbolCreationContext.renderer=e,null!=r&&("complete"===r.type?this.recreateAllGraphicsAndSymbols():"partial"===r.type&&(this._applyRendererDiff(r,e,i)?this._labeler?.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(e){for(const t in e.diff)switch(t){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"uniqueValueGroups":case"authoringInfo":case"fieldDelimiter":delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,i){e=e||[],t=t||[];const r=[];for(const s of t){const t=this._graphicsBySymbol.get(s.id);t&&t.forEach((a,n)=>{const o=a.graphic,l=this.layer instanceof H?this.layer:null,h=this._arcadeOnDemand;if(s===i.defaultSymbol&&i.getSymbol(N(o,l,null),{arcade:h})===i.defaultSymbol)return;const d=a.usedMemory;e.length||i.defaultSymbol?r.push(o):this._graphicsWithoutSymbol.set(n,o);const p=this.graphics3DGraphics.get(n);this._conditionalRemove(p,n),a.destroy(),t.delete(n),this._removeGraphics3DGraphic(n,d),this._updateLayerVisibility()}),this._whenSymbolRemoved.forAll(e=>e(s.id))}(e.length||r.length)&&(this._graphicsWithoutSymbol.forEach(e=>r.push(e)),this._graphicsWithoutSymbol.clear(),this.add(r)),this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_applyUniqueValueRendererDiff(e,t,r){const s=e.diff.defaultSymbol,a=e.diff.uniqueValueInfos;if(s||a){const n=a?.changed,o=a?.unchanged;if(n&&o&&n.some(e=>o.some(t=>t.oldValue.symbol?.id===e.oldValue.symbol?.id)))return!1;const l=a?a.added.map(e=>e.symbol).filter(i):[],h=a?a.removed.map(e=>e.symbol).filter(i):[];if(n)for(let e=0;e<n.length;e++)l.push(n[e].newValue.symbol),h.push(n[e].oldValue.symbol);return s?(r.defaultSymbol&&h.push(r.defaultSymbol),t.defaultSymbol&&l.push(t.defaultSymbol)):r.defaultSymbol&&l.length&&h.push(t.defaultSymbol),this._applySymbolSetDiff(l,h,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,i){if("unique-value"!==t?.type||"unique-value"!==i?.type||null!=e&&"partial"!==e.type)return[];const r=e=>null!=e?e.id:null,s=e&&e.diff,a=s?.defaultSymbol,n=s&&s.uniqueValueInfos;let o;if(n)o=n.unchanged.map(e=>({oldId:r(e.oldValue.symbol),newId:r(e.newValue.symbol)}));else{o=[];for(const e of i.uniqueValueInfos??[]){const i=r(e.symbol),s=t.uniqueValueInfos?.find(t=>t.value===e.value);s&&i!==r(s.symbol)&&o.push({oldId:i,newId:r(s.symbol)})}}return!a&&i.defaultSymbol&&o.push({oldId:r(i.defaultSymbol),newId:r(t.defaultSymbol)}),o}_updateSymbolMapping(e,t){const i=null!=t&&t?"string"==typeof t?t:t.id:null;if(null==e||e===i)return;const r=this._graphicsBySymbol.get(e);this._graphicsBySymbol.delete(e),void 0!==r&&this._graphicsBySymbol.set(i,r);const s=this._symbols.get(e);if(void 0!==s&&(this._symbols.delete(e),this._symbols.set(i,s),this._symbolMaterials=null,null!=s)){const e="string"==typeof t?null:t;null!=e?s.symbol=e:s.symbol.id=i}}_updateUnchangedSymbolMappings(e,t,i){const r=this._calculateUnchangedSymbolMapping(e,t,i);for(const{oldId:s,newId:a}of r)this._updateSymbolMapping(s,a)}_applyRendererDiff(e,t,i){if(this._diffHasSymbolChange(e))return!1;if(t instanceof $&&i instanceof $&&this._applyUniqueValueRendererDiff(e,t,i)&&0===Object.keys(e.diff).length)return!0;for(const r of this._graphicsBySymbol.keys()){const i=this._symbols.get(r);if(null!=i)switch(i.applyRendererDiff(e,t)){case 0:this._recreateSymbol(r);break;case 1:this._recreateGraphicsForSymbol(r)}}return!0}opacityChange(){this._updateStageLayerVisibility(),this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged("opacity",t))}_screenSizePerspectiveEnabledChange(){this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged("screenSizePerspectiveEnabled",t)),this._labeler?.screenSizePerspectiveEnabledChanged(),this._deconflictor?.screenSizePerspectiveEnabledChanged()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.sliceable=e,this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged("slicePlaneEnabled",t)),this._deconflictor?.slicePlaneEnabledChange(),this._labeler?.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",t)||this._recreateSymbol(i)})}_skipHighSymbolLoDsChange(e){this.symbolCreationContext.skipHighSymbolLods=e,this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("skipHighSymbolLods",t)||this._recreateSymbol(i)})}_pixelRatioChange(){this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("pixelRatio",t)||this._recreateSymbol(i)})}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=C(()=>{this._updatingPendingLoadedGraphicsChange=null})}setClippingExtent(e,t){const i=this.symbolCreationContext.clippingExtent,r=k();return Se(e,r,t)?this.symbolCreationContext.clippingExtent=T(F(),r):this.symbolCreationContext.clippingExtent=null,!M(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(e){if(this.destroyed)return;let t=!1;this.graphics3DGraphics.forEach(i=>{e(i)&&(t=!0)}),t&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}forEachGraphics3DSymbol(e,t){for(const[i,r]of this._symbols){if(null==r)return;e(r,this._graphicsBySymbol.get(i)||qe,i)}if(!t?.excludeUnused)for(const i of this._unusedSymbolsCache)e(i,void 0,i.symbol.id)}updateGraphicsVisibilities(){null!=this._filterVisibility&&this._filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities(e=>{const t=this._updateUserVisibility(e),i=!!this._scaleVisibility?.updateVisibility(e);return t||i})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,1,!1))}_validateRenderer(e){const t=()=>`'${this.layer.title?`${this.layer.title}, `:""}id:${this.layer.id}'`,i=Y(e,{geometryType:this.layer?.geometryType,logWarning:(e,i)=>s.getLogger(this).warn(e,`Symbology conversion for layer ${t()}: ${i}`)});if(i){const e=`Renderer for layer ${t} is not supported in a SceneView`;s.getLogger(this).warn(e,i.message)}}_cleanupSymbols(){if(this._graphicsWaitingForSymbol.size>0||this._suspendSymbolCleanup)return;let e=!1;this._symbols.forEach((t,i)=>{if(null==t||t.referenced>0)return;const r=this._graphicsBySymbol.get(i);r&&0!==r.size||(this._graphicsBySymbol.delete(i),this._symbols.delete(i),this._symbolMaterials=null,this._unusedSymbolsCache.put(i,t,h),e=!0)}),e&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){}get performanceInfo(){return new me(this.graphics3DGraphics.size,Array.from(this.graphics3DGraphics.values()).reduce((e,t)=>e+(t.isVisible()?1:0),0),this._graphicsWithoutSymbol.size,this._pendingUpdates.size)}};e([S({readOnly:!0})],ke.prototype,"computedExtent",void 0),e([S()],ke.prototype,"currentRenderer",void 0),e([S()],ke.prototype,"rendererHasGeometryOperations",void 0),e([S()],ke.prototype,"_frameTaskHandle",void 0),e([S()],ke.prototype,"_dataUpdateQueue",void 0),e([S()],ke.prototype,"_updateQueue",void 0),e([S({readOnly:!0})],ke.prototype,"_viewSpatialReference",null),e([S()],ke.prototype,"_rendererChangeAbortController",void 0),e([S()],ke.prototype,"_elevationInfoChangeAbortController",void 0),e([S()],ke.prototype,"_initializeAbortController",void 0),e([S()],ke.prototype,"_elevationAlignment",void 0),e([S()],ke.prototype,"_scaleVisibility",void 0),e([S()],ke.prototype,"_filterVisibility",void 0),e([S()],ke.prototype,"_initializePromise",void 0),e([S()],ke.prototype,"_spatialIndex",void 0),e([S({readOnly:!0})],ke.prototype,"extentPadding",void 0),e([S()],ke.prototype,"_updatingPendingLoadedGraphicsChange",void 0),e([S()],ke.prototype,"_featureStore",void 0),e([S()],ke.prototype,"_objectStates",void 0),e([S()],ke.prototype,"_loadingSymbols",void 0),e([S({constructOnly:!0})],ke.prototype,"compressionTracker",void 0),e([S()],ke.prototype,"preferredUpdatePolicy",void 0),e([S()],ke.prototype,"_forcedUpdatePolicy",void 0),e([S({readOnly:!0})],ke.prototype,"effectiveUpdatePolicy",null),e([S({constructOnly:!0})],ke.prototype,"elevationFeatureExpressionEnabled",void 0),e([S({constructOnly:!0})],ke.prototype,"owner",void 0),e([S({constructOnly:!0})],ke.prototype,"layer",void 0),e([S({constructOnly:!0})],ke.prototype,"graphicSymbolSupported",void 0),e([S({constructOnly:!0})],ke.prototype,"getRenderingInfoWithoutRenderer",void 0),e([S({constructOnly:!0})],ke.prototype,"componentFactories",void 0),e([S({constructOnly:!0})],ke.prototype,"setUidToIdOnAdd",void 0),e([S()],ke.prototype,"featureStore",null),e([S()],ke.prototype,"initializePromise",null),e([S()],ke.prototype,"scaleVisibility",null),e([S()],ke.prototype,"elevationAlignment",null),e([S()],ke.prototype,"objectStates",null),e([S()],ke.prototype,"filterVisibility",null),e([S({readOnly:!0})],ke.prototype,"updating",null),e([S({readOnly:!0})],ke.prototype,"dataUpdating",null),e([S({readOnly:!0})],ke.prototype,"readyToRun",null),e([S({readOnly:!0})],ke.prototype,"suspendedOrOutsideOfView",null),e([S({readOnly:!0,dependsOn:[]})],ke.prototype,"updatingRemaining",null),e([S({readOnly:!0})],ke.prototype,"displayFeatureLimit",null),e([S({readOnly:!0,dependsOn:[]})],ke.prototype,"averageSymbolComplexity",null),e([S({constructOnly:!0})],ke.prototype,"hasZ",void 0),e([S({constructOnly:!0})],ke.prototype,"hasM",void 0),e([S()],ke.prototype,"_objectIdField",null),ke=Fe=e([G("esri.views.3d.layers.graphics.Graphics3DCore")],ke);class ze{constructor(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}}const We=10,He=D(),Be=D(),qe=new Map;export{ke as Graphics3DCore};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import r from"../../../../core/Error.js";import s from"../../../../core/Logger.js";import{findInMap as a}from"../../../../core/MapUtils.js";import{abortMaybe as n,removeMaybe as o,destroyMaybe as l}from"../../../../core/maybe.js";import{MinPriority as h}from"../../../../core/MemCache.js";import d from"../../../../core/PooledArray.js";import{throwIfAborted as p,ignoreAbortErrors as c,createResolver as y,isAbortError as u}from"../../../../core/promiseUtils.js";import g from"../../../../core/Queue.js";import{when as m,watch as b,on as _,syncAndInitial as f,whenOnce as v}from"../../../../core/reactiveUtils.js";import{schedule as C}from"../../../../core/scheduling.js";import{property as S}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as G}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as w,isEmpty as x}from"../../../../core/accessorSupport/diffUtils.js";import{j as P,g as R,h as U}from"../../../../chunks/vec32.js";import{create as D}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import I from"../../../../geometry/Extent.js";import E from"../../../../geometry/Point.js";import{canProjectWithoutEngine as L}from"../../../../geometry/projectionUtils.js";import{projectBuffer as j}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as V}from"../../../../geometry/projection/projectVectorToVector.js";import{projectXYZToVector as A}from"../../../../geometry/projection/projectXYZToVector.js";import{center as O,create as F,fromRect as T,equals as M}from"../../../../geometry/support/aaBoundingBox.js";import{create as k}from"../../../../geometry/support/aaBoundingRect.js";import{equals as z}from"../../../../geometry/support/spatialReferenceUtils.js";import{isPopupProvider as W}from"../../../../graphic/getPopupProvider.js";import H from"../../../../layers/Layer.js";import{getObjectId as B,computeAABB as q,hasGeometry as Q}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as N}from"../../../../layers/graphics/hydratedFeatures.js";import $ from"../../../../renderers/UniqueValueRenderer.js";import{isSupportedRenderer3D as Z,validateTo3D as Y}from"../../../../renderers/support/rendererConversion.js";import{RenderingInfo as X}from"../../../../renderers/support/RenderingInfo.js";import{isBasemapLayerView as J}from"../../../../support/basemapUtils.js";import{loadArcade as K}from"../../../../support/loadArcade.js";import ee from"../../../../symbols/LabelSymbol3D.js";import te from"../../../../symbols/TextSymbol.js";import ie from"../../../../symbols/WebStyleSymbol.js";import{getDefaultSymbol3D as re}from"../../../../symbols/support/defaults3D.js";import{to3D as se}from"../../../../symbols/support/symbolConversion.js";import{averageSymbolComplexities as ae,defaultSymbolComplexity as ne}from"./defaultSymbolComplexity.js";import{DisplayFeatureLimit as oe}from"./DisplayFeatureLimit.js";import{ViewElevationProvider as le}from"./ElevationQuery.js";import{extractExpressionInfo as he,createContext as de}from"./featureExpressionInfoUtils.js";import{Graphics3DFeatureStore as pe}from"./Graphics3DFeatureStore.js";import{Graphics3DGraphicCreationContext as ce}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as ye}from"./Graphics3DSymbolCreationContext.js";import{make as ue}from"./Graphics3DSymbolFactory.js";import{Graphics3DWebStyleSymbol as ge}from"./Graphics3DWebStyleSymbol.js";import{GraphicsCorePerformanceInfo as me}from"./GraphicsCorePerformanceInfo.js";import{GraphicStateTracking as be}from"./GraphicStateTracking.js";import{computeCentroid as _e}from"./graphicUtils.js";import{placePointOnGeometry as fe}from"./pointUtils.js";import{SpatialIndex2D as ve}from"./SpatialIndex2D.js";import{StageLayerElevationProvider as Ce}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as Se}from"../../support/extentUtils.js";import{GridLocalOriginFactory as Ge}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{isScreenSizePerspectiveEnabled as we}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{affectsGeometry as xe}from"../../webgl-engine/lib/VertexAttribute.js";import{WebGLLayer as Pe}from"../../webgl-engine/lib/WebGLLayer.js";import{HUDMaterial as Re}from"../../webgl-engine/materials/HUDMaterial.js";import{hasPopupTemplate as Ue}from"../../../layers/support/popupUtils.js";import{PromiseQueue as De}from"../../../support/PromiseQueue.js";import{PropertiesPool as Ie}from"../../../support/PropertiesPool.js";import{ImmediateTask as Ee,noBudget as Le,TaskPriority as je}from"../../../support/Scheduler.js";import{TextureCompressionTracker as Ve}from"../../../support/TextureCompressionTracker.js";import{Yield as Ae}from"../../../support/Yield.js";import{alphaCutoff as Oe}from"../../../../webscene/support/AlphaCutoff.js";var Fe;const Te=D(),Me=F();let ke=class extends t{static{Fe=this}static{this.tmpVec=D()}get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){return this._spatialIndex||(this._spatialIndex=new ve({objectIdField:this.owner.layer?.objectIdField,spatialReference:this._viewSpatialReference,hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get deconflictor(){return this._deconflictor}get labeler(){return this._labeler}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return null!=this.currentRenderer&&"dictionary"===this.currentRenderer.type?0:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){return!!(this.dataUpdating||this._elevationAlignment?.updating||this._scaleVisibility?.updating||this._filterVisibility?.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._frameTaskHandle.updating||this._updateQueue.updating||this.readyToRun)}get dataUpdating(){return!!(this._graphicsWaitingForSymbol.size>0||this._pendingUpdates.size>0||this._spatialIndex?.updating||this._updatingPendingLoadedGraphicsChange||this._dataUpdateQueue.updating||this._loadingSymbols>0||this.compressionTracker.compressing)}get readyToRun(){return this._pendingUpdates.size>0||!!this._spatialIndex?.updating||this._dataUpdateQueue.readyToRun||this._updateQueue.readyToRun||this._focusAreasGraphicsQueue.length>0}get suspendedOrOutsideOfView(){return this.owner.suspended||!!this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return this.updating?this._pendingUpdates.size+.1*(this._spatialIndex?.updatingRemaining||0)+.1*(this._elevationAlignment?.updatingRemaining||0):0}get displayFeatureLimit(){const e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?.graphics3D.minTotalNumberOfFeatures??0,i=e?.graphics3D.maxTotalNumberOfFeatures??0,r=e?.graphics3D.maxNumberOfDrawCalls??0,s=e?.graphics3D.maxTotalNumberOfVertices??0,a=this.averageSymbolComplexity,n=Math.max(1,a?.verticesPerFeature??1),o=a&&a.drawCallsPerFeature>0&&r>0?r/a.drawCallsPerFeature:i,l=Math.ceil(s/n),h=Math.max(t,Math.min(i,l,o)),d=this._get("displayFeatureLimit");return d&&d.maximumTotalNumberOfVertices===s&&d.averageSymbolComplexity===a&&d.maximumNumberOfFeatures===h?d:new oe(s,h,a)}get averageSymbolComplexity(){const e=ae(this._symbolComplexities),t=this._get("averageSymbolComplexity");return 0===e.numComplexities||null!=t&&(e.estimated&&(t.verticesPerFeature>=e.verticesPerFeature||t.verticesPerCoordinate>=e.verticesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.verticesPerFeature===e.verticesPerFeature&&t.verticesPerCoordinate===e.verticesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e}get usedMemory(){const e=this.labelsEnabled?(this.averageSymbolComplexity?.memory.bytesPerFeatureLabel??0)*this._numberOfGraphics:0,t=this._getSymbolComplexitiesUsed().reduce((e,t)=>e+t.memory.resourceBytes,0);if(null==this._symbolMaterials){this._symbolMaterials=[];for(const e of this._symbols.values())if(null!=e)for(const t of e.symbolLayers)if(t)for(const e of t.materials)e&&this._symbolMaterials.push(e)}const i=this.owner.view.stage.renderer,r=this.owner.view.overlayManager.renderer,s=this._symbolMaterials.reduce((e,t)=>e+((i.getMaterialRenderer(t)||r.getMaterialRenderer(t))?.usedMemory??0),0);return this._usedMemory+e+t+s}get usedMemoryPerGraphic(){if(this._usedMemory&&this._numberOfGraphics){const e=this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves));return this._usedMemory/this._numberOfGraphics*e}if(null!=this.averageSymbolComplexity){const e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}get _symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}get visible(){return this._visible}_getConvertedSymbol(e){const t=e;if("web-style"===t.type)return t.clone();const i=this._symbolConversionCache.get(t.id);if(null!=i)return i;const r=se(t,{geometryType:this.layer?.geometryType??void 0,retainId:!0,hasLabelingContext:this._hasLabelingContext(t),cimFallbackEnabled:!0}),a=r.symbol||null;return null==a&&r.error&&s.getLogger(this).error(r.error.message),this._symbolConversionCache.set(t.id,a),a}_getSymbolComplexitiesUsedOrRenderer(e){if(null==e)return[];const t=e.symbols,i="backgroundFillSymbol"in e?e.backgroundFillSymbol:null;if(!i&&!t.length)return[];const r=[],s=this._getSymbolComplexityUsedOrRenderer(i);null!=s&&r.push(s);for(const a of t){const e=this._getSymbolComplexityUsedOrRenderer(a);null!=e&&r.push(e)}return r}_getSymbolComplexityUsedOrRenderer(e){if(null==e)return null;const t=this._symbols.get(e.id);if(null!=t)return t.complexity;const i=this._getConvertedSymbol(e);return null!=i?ne(i):null}_getSymbolComplexitiesUsed(){const e=[];return this._symbols.forEach(t=>{null!=t&&e.push(t.complexity)}),e}get _objectIdField(){return this.layer.objectIdField}constructor(e){super(e),this._propertiesPool=new Ie({computedExtent:()=>new I},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this._graphicStateTracking=null,this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this._graphicsDrapedUids=new Set,this._graphicsBySymbol=new Map,this._symbolConversionCache=new Map,this._symbols=new Map,this._graphicsWithoutSymbol=new Map,this._graphicsWaitingForSymbol=new Map,this._graphicsUpdateId=0,this._frameTaskHandle=Ee,this._dataUpdateQueue=new De,this._updateQueue=new De,this._focusAreasGraphicsQueue=new g,this._suspendSymbolCleanup=!1,this._arcadeOnDemand=null,this._rendererChangeAbortController=null,this._elevationInfoChangeAbortController=null,this._initializeAbortController=null,this._elevationAlignment=null,this._scaleVisibility=null,this._filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this._featureStore=null,this._deconflictor=null,this._labeler=null,this._objectStates=null,this._viewElevationProvider=null,this._stageLayerElevationProvider=null,this._whenGraphics3DGraphicRequests={},this._pendingUpdates=new Map,this._numberOfGraphics=0,this._numberOfGraphicsProvidingElevation=0,this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this._loadingSymbols=0,this.compressionTracker=new Ve,this._symbolWarningLogged=!1,this._geometryWarningLogged=!1,this._objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new d,this.preferredUpdatePolicy=1,this._forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.setUidToIdOnAdd=!0,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=!1,this._startCreateGraphics=!1,this._unusedSymbolsCache=e.owner.view.resourceController.memoryController.newCache("graphics-3d-unused-symbols",e=>e.destroy()),this.symbolCreationContext=new ye(e.owner.view.resourceController.scheduler,(e,t)=>this._updateQueue.push(e,t),e.owner.layerViewUid,this.compressionTracker)}initialize(){this._featureStore=new pe({objectIdField:this.owner.layer?.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:e=>this.graphics3DGraphics.forEach(e)});const e=(e,t,i)=>this.spatialIndex.queryGraphicUIDsInExtent(e,t,i),{componentFactories:t}=this;this._elevationAlignment=t.elevationAlignment?.(this,e),this._scaleVisibility=t.scaleVisibility?.(this,e),this._filterVisibility=t.filterVisibility?.({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e(B(t.graphic,this._objectIdField)))),setAllFeaturesVisibility:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e)),clearFeaturesVisibility:()=>this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,4,!0))}),this._deconflictor=t.deconflictor?.(this),this._labeler=t.labeler?.(this,this._scaleVisibility),this._objectStates=t.objectStates?.(this),this._initializeAbortController=new AbortController,this.addHandles(m(()=>this.owner.view.state.highlights,()=>{const{highlightOrderMap:e}=this.owner.view.state;this.graphics3DGraphics.forEach(t=>t.updateHighlights(e))})),this._initializePromise=this._initializeAsync()}async _initializeAsync(){const e=this._initializeAbortController?.signal,t=this.owner.view;this._viewElevationProvider=new le(this._viewSpatialReference,t),this._initializeStage(t,this.owner.layerViewUid);const i=t.sharedSymbolResources;this.symbolCreationContext.sharedResources=i,null!=this.currentRenderer&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.streamDataRequester=i.streamDataRequester,this.symbolCreationContext.renderCoordsHelper=t.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new Ge(t.renderSpatialReference),this.symbolCreationContext.elevationProvider=t.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e);const r=he(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await de(r,this._viewSpatialReference,e,s.getLogger(this)),p(e),this.symbolCreationContext.screenSizePerspectiveEnabled=we(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,this.symbolCreationContext.skipHighSymbolLods=!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,"drapeSourceType"in this.owner){const{owner:e}=this;this.symbolCreationContext.drapeSourceRenderer=t.overlayManager.registerGeometryDrapeSource(e)}this.addHandles([b(()=>this.suspendedOrOutsideOfView,()=>this._updateQueue.unshift(()=>this._updateLayerVisibility(),null).catch(c)),b(()=>we(this.layer?.screenSizePerspectiveEnabled),e=>{e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,this._screenSizePerspectiveEnabledChange())}),b(()=>this.owner.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(!!e)),b(()=>this.owner.view.state?.rasterPixelRatio,()=>this._pixelRatioChange()),b(()=>!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._physicalBasedRenderingChange(e)),b(()=>!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,e=>this._skipHighSymbolLoDsChange(e)),b(()=>this.owner.view.focusAreasView?.polygons,()=>this._updateFocusedLabels()),b(()=>this.owner.view.map?.focusAreas.style,()=>this.recreateAllGraphicsAndSymbols()),m(()=>t.basemapTerrain?.tilingScheme,e=>{if(e.spatialReference.equals(this.symbolCreationContext.overlaySR)||null==t.basemapTerrain.spatialReference||(this.symbolCreationContext.overlaySR=t.basemapTerrain.spatialReference),this.hasHandles("loaded-graphics"))this.recreateAllGraphics();else{const e=()=>this.owner?.loadedGraphics;this.addHandles([_(e,"change",e=>{this._graphicsCollectionChanged(e),this._signalUpdatingDuringAsyncLoadedGraphicsChange()},{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],"loaded-graphics")}},{initial:!0}),b(()=>this.effectiveUpdatePolicy,e=>{null!=this.stageLayer&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=0===this.effectiveUpdatePolicy,1===e&&this.runTask(Le)},f)]),this._frameTaskHandle=t.resourceController.scheduler.registerTask(je.GRAPHICS_CORE,this),this.layer&&"featureReduction"in this.layer&&this.addHandles(b(()=>this.layer.featureReduction,()=>this._deconflictor?.featureReductionChange())),this.notifyChange("averageSymbolComplexity"),this.rendererChange(this.owner.renderer).catch(()=>{}),this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController=n(this._initializeAbortController)}_updateFocusedLabels(){this._focusAreasGraphicsQueue.clear(),this.forEachGraphics3DSymbol((e,t)=>{t&&e.needsUpdateFocus&&t.forEach(e=>{this._focusAreasGraphicsQueue.push(e)})})}destroy(){if(this._unusedSymbolsCache.destroy(),this._abortInitialize(),this._rendererChangeAbortController=n(this._rendererChangeAbortController),this._abortElevationInfoChange(),this._frameTaskHandle.remove(),this._frameTaskHandle=Ee,this._dataUpdateQueue.cancelAll(),this._updateQueue.cancelAll(),this._deconflictor=o(this._deconflictor),this._labeler=o(this._labeler),this._elevationAlignment=l(this._elevationAlignment),this._scaleVisibility=l(this._scaleVisibility),this._filterVisibility=l(this._filterVisibility),this._objectStates=l(this._objectStates),this.clear(),"drapeSourceType"in this.owner){const{owner:e}=this;this.stage.view.overlayManager.unregisterDrapeSource(e)}this._featureStore=l(this._featureStore),this._updatingPendingLoadedGraphicsChange=o(this._updatingPendingLoadedGraphicsChange),this._graphicStateTracking=l(this._graphicStateTracking),this.stage&&(this.stageLayer=l(this.stageLayer),this.stage=null),this._set("owner",null);for(const e in this._whenGraphics3DGraphicRequests)this._whenGraphics3DGraphicRequests[e].reject(new r("graphic:layer-destroyed","Layer has been destroyed"));this._whenGraphics3DGraphicRequests=null,this._propertiesPool=l(this._propertiesPool),this._whenSymbolRemoved.prune(),this._symbolConversionCache.clear(),this._objectIdInvisibleSet.clear(),this._spatialIndex=l(this._spatialIndex),this._symbolMaterials=null}clear(){this._objectStates?.allGraphicsDeleted(),null!=this._graphicStateTracking&&this._graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach(e=>e.destroy()),this._spatialIndex?.clear(),this.graphics3DGraphics.clear(),this._numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this._symbols.forEach(l),this._symbols.clear(),this._symbolMaterials&&(this._symbolMaterials.length=0,this._symbolMaterials=null),this._graphicsBySymbol.clear(),this._graphicsWithoutSymbol.clear(),this._graphicsWaitingForSymbol.clear(),this._pendingUpdates.clear(),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this.notifyChange("dataUpdating"),this.notifyChange("readyToRun"),this.notifyChange("updatingRemaining"),this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.()}_initializeStage(e,t){this.stage=e.stage,this.stageLayer=new Pe(this.stage,{visible:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t);const i=this.stageLayer.events;i.on("transformationChanged",e=>this.notifyGraphicGeometryChanged(e.graphicUid)),i.on("shaderTransformationChanged",e=>this.notifyGraphicGeometryChanged(e.graphicUid)),i.on("visibilityChanged",e=>this.notifyGraphicVisibilityChanged(e.graphicUid)),i.on("geometryAdded",e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),i.on("geometryRemoved",e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),i.on("attributesChanged",e=>xe(e.attribute)&&this.notifyGraphicGeometryChanged(e.object.graphicUid))}notifyGraphicGeometryChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),null==this._graphicStateTracking||null==e)return;const t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),null==this._graphicStateTracking||null==e)return;const t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){const e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this._numberOfGraphics>e*We,i=!this.suspendedOrOutsideOfView&&!t;i!==this._visible&&(this._visible=i,this._updateStageLayerVisibility())}_updateStageLayerVisibility(){const e=this._visible&&(null==this.layer.opacity||this.layer.opacity>=Oe);this.stageLayer.visible!==e&&(this.stageLayer.visible=e,e?this.updateGraphicsVisibilities():this._hideAllGraphics(),this.owner.notifyContentGeometryUpdate?.())}getGraphics3DGraphicById(e){return null!=e?this.graphics3DGraphics.get(e):void 0}getGraphics3DGraphicByObjectId(e){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer?.objectIdField){return B(e,t)}get graphics3DGraphicsByObjectID(){const e=this.owner.layer?.objectIdField;if(!e)return;const t=new Map;return this.graphics3DGraphics.forEach(i=>{if(!i)return;const r=i.graphic,s=this._getGraphicObjectID(r,e);null!=s&&t.set(s,i)}),t}get labelsEnabled(){return!!this._labeler?.layerLabelsEnabled()}async updateLabelingInfo(e){const t=this._deconflictor?.labelingInfoChange(e),i=this._labeler?.labelingInfoChange(e);await Promise.allSettled([t,i])}updateVisibilityInfo(){this._deconflictor?.labelingInfoChange(),this._labeler?.visibilityInfoChange()}get symbolUpdateType(){if(this._pendingUpdates.size>0)return"unknown";let e=!1,t=!1;for(const[i,r]of this._symbols)if(null!=r){switch(r.getFastUpdateStatus()){case 3:return"unknown";case 1:this._graphicsBySymbol.has(i)&&(t=!0);break;case 0:this._graphicsBySymbol.has(i)&&(e=!0);break;case 2:this._graphicsBySymbol.has(i)&&(t=e=!0)}}return t?e?"mixed":"fast":e?"slow":"mixed"}runTask(e){if(this._dataUpdateQueue.runTask(e),this._updateQueue.runTask(e),this._applyPendingUpdates(e),this._applyFocusAreasUpdates(e),this.notifyChange("readyToRun"),this.readyToRun||this.notifyChange("dataUpdating"),this.notifyChange("updatingRemaining"),!e.hasProgressed)return Ae}setObjectIdVisibility(e,t){t?this._objectIdInvisibleSet.delete(e):this._objectIdInvisibleSet.add(e);const i=this._findGraphics3DGraphicByObjectId(e);null!=i&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(e){return a(this.graphics3DGraphics,t=>this._getGraphicObjectID(t.graphic)===e)}_updateUserVisibility(e){if(null==e)return!1;const t=e.graphic,i=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&this.stageLayer.visible&&(null==i||!this._objectIdInvisibleSet.has(i));return e.setVisibilityFlag(1,1,r)}_whenGraphics3DGraphic(e){const t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);const i=this._whenGraphics3DGraphicRequests[e.uid];if(i)return i.promise;const r=y();return this._whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){const i=this._viewSpatialReference,r=this.owner.view.renderSpatialReference,s=this.owner.view.basemapTerrain.spatialReference,a=(e,t,s)=>j(e,r,t,e,i,t,s),n=(e,t,r)=>j(e,s,t,e,i,t,r),o=this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:null!=t&&!!t.useViewElevation,minDemResolution:null!=t?t.minDemResolution:null,minDemResolutionForPoints:this.owner.view.resolution}:null,l=await e.getProjectedBoundingBox(a,n,o,t?.signal);if(!l)return null;const h=l.boundingBox;if(l.requiresDrapedElevation){const e=this.symbolCreationContext.elevationProvider;if(e){O(h,Te);const t=e.getElevation(Te[0],Te[1],0,i,"ground")??0;h[2]=Math.min(h[2],t),h[5]=Math.max(h[5],t)}}return{boundingBox:h,screenSpaceObjects:l.screenSpaceObjects}}async whenGraphicBounds(e,t){await v(()=>this.owner?.loadedGraphics);const i=this.owner.layer?.objectIdField,s=this.owner.loadedGraphics.find(t=>t===e||null!=i&&null!=t.attributes&&e.attributes&&t.attributes[i]===e.attributes[i]);if(!s)throw new r("internal:graphic-not-part-of-view","Graphic is not part of this view");const a=await this._whenGraphics3DGraphic(s);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){const i=this.graphics3DGraphics.get(e.uid);if(!i)return null;const r=i.computeAttachmentOrigin();if(0===r.render.num&&0===r.draped.num)return null;P(He,0,0,0);let s=0;if(r.render.num>0){if(!V(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,Be,t))return null;R(He,He,Be),s++}if(r.draped.num>0){const[e,i]=r.draped.origin,a=this._viewElevationProvider.getElevation(e,i,"ground")??0;if(P(Be,e,i,a),!V(Be,this._viewElevationProvider.spatialReference,Be,t))return null;R(He,He,Be),s++}return s>1&&U(He,He,1/s),new E({x:He[0],y:He[1],z:He[2],spatialReference:t})}getSymbolLayerSize(e,t){const i=this._symbols.get(e.id);if(null==i)throw new r("internal:symbol-not-part-of-view","Symbol is not part of this view");const s=e.symbolLayers.indexOf(t);if(-1===s)throw new r("internal:missing-symbol-layer","Symbol layer is not in symbol");const a=i.getSymbolLayerSize(s);if(null==a)throw new r("internal:missing-size","Symbol layer has no valid size");return a}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){const t=e.graphic.uid,i=this.graphics3DGraphics.get(t);if(null!=i||null!=this._graphicsWithoutSymbol.get(t)){switch(e.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,e.graphic);break;case"symbol":this._graphicUpdateSymbolHandler(i,e);break;case"attributes":{const t=this.symbolCreationContext.featureExpressionInfoContext;t?.arcade&&this._graphicUpdateGeometryHandler(i,e.graphic)}break;case"popupTemplate":break;case"origin-transform":this._graphicUpdateTransformHandler(i,e)}this.owner.notifyContentGeometryUpdate?.()}}_graphicUpdateGeometryHandler(e,t){this._graphicUpdateGeometryOrTransformHandler(e,t,()=>!(null==e||!e.graphics3DSymbol.updateGeometry(e)||!(this._labeler?.updateGraphicGeometry(e)??1))&&(this._labeler?.setDirty(),!0));const i=t.geometry;null!=i&&this._expandComputedExtent(i)}_graphicUpdateTransformHandler(e,t){const i=t.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(e,t.graphic,()=>null!=t.newValue&&null!=e&&null!=i&&e.graphics3DSymbol.updateTransform(e,i.spatialReference,t.newValue,t.action))}_graphicUpdateGeometryOrTransformHandler(e,t,i){if(null!=t.geometry){if(null==e){const e=t.symbol?.id;if(e){const t=this._symbols.get(e);if(null!=t&&0===t.loadStatus)return}return void this._recreateGraphic(t)}i()||this._recreateGraphic(e.graphic)}else this._recreateGraphic(t)}_graphicUpdateSymbolHandler(e,t){const i=t.graphic,r=null!=e?e.graphics3DSymbol:null!=t.oldValue?this._symbols.get(t.oldValue.id):null;if(null==r||null==t.newValue)return void this._recreateGraphic(i);const s=r.symbol,a=this._getConvertedSymbol(t.newValue);if(null!=a&&(a.type!==s.type||"web-style"===a.type)||"web-style"===s.type)return void this._recreateGraphic(i);const n=this._graphicsBySymbol.get(s.id);if(n&&1!==n.size)return void this._recreateGraphic(i);const o=w(s,a);if(null==o)return void this._updateSymbolMapping(s.id,a);const l={diff:o,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(l),!x(l.diff))return void this._recreateGraphic(i);const h=this._getRenderingInfo(i,!1);if(null==h)return void this._recreateGraphic(i);const d=r.extentPadding;for(const p of l.symbolStatePatches)p();if(d!==r.extentPadding&&this._recomputeExtentPadding(),null!=e)for(const p of l.graphics3DGraphicPatches)p(e,h);this._updateSymbolMapping(s.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}recreateGraphics(e){this._suspendSymbolCleanup=!0,this.remove(e),this.add(e),this._suspendSymbolCleanup=!1,1===this.effectiveUpdatePolicy&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){const t=this._graphicsUpdateId;return this._graphicsUpdateId++,this._graphicsWaitingForSymbol.set(e.uid,t),1===this._graphicsWaitingForSymbol.size&&this.notifyChange("dataUpdating"),t}_endGraphicUpdate(e,t){e&&(t&&this._graphicStateTracking?.updateGraphicError(e,t),this._graphicsWaitingForSymbol.delete(e.uid),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("dataUpdating")))}_recomputeExtentPadding(){let e=0;this._symbols.forEach(t=>{null!=t&&(e=Math.max(e,t.extentPadding))}),this._set("extentPadding",e)}_expandComputedExtent(e){const t=Me,i=e.spatialReference;q(e,t);const r=this._viewSpatialReference,s=Fe.tmpVec;if(z(i,r)||A(t[0],t[1],0,i,s,r)&&(t[0]=s[0],t[1]=s[1],A(t[3],t[4],0,i,s,r),t[3]=s[0],t[4]=s[1]),!(isFinite(t[0])&&isFinite(t[3])&&isFinite(t[1])&&isFinite(t[4])))return;const a=this.computedExtent;let n=null;const o=isFinite(t[2])&&isFinite(t[5]),l=o&&(null==a?.zmin||t[2]<a.zmin),h=o&&(null==a?.zmax||t[5]>a.zmax);if(a){(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||l||h)&&(n=this._propertiesPool.get("computedExtent"),n.xmin=Math.min(t[0],a.xmin),n.ymin=Math.min(t[1],a.ymin),n.xmax=Math.max(t[3],a.xmax),n.ymax=Math.max(t[4],a.ymax),n.spatialReference=r)}else n=this._propertiesPool.get("computedExtent"),n.xmin=t[0],n.ymin=t[1],n.xmax=t[3],n.ymax=t[4],n.spatialReference=r;n&&(l&&(n.zmin=t[2]),h&&(n.zmax=t[5]),this._set("computedExtent",n))}_abortElevationInfoChange(){this._elevationInfoChangeAbortController&&(this._elevationInfoChangeAbortController.abort(),this._elevationInfoChangeAbortController=null)}async elevationInfoChange(){this._abortElevationInfoChange();const e=new AbortController;this._elevationInfoChangeAbortController=e;const t=he(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await de(t,this._viewSpatialReference,e.signal,s.getLogger(this)),p(e.signal),this._elevationInfoChangeAbortController=null,this._labeler?.elevationInfoChange(),this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("elevationInfo",t)?t?.forEach(e=>{const t=e.graphic,i=e.labelLayers;for(const r of i){r.graphics3DSymbolLayer.graphics3DGraphicLayerElevationInfoChanged(t,r)}}):this._recreateSymbol(i)}),this.updateStageLayerElevationProvider(),this._elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){this._stageLayerElevationProvider?(this.layer.elevationInfo&&"relative-to-scene"===this.layer.elevationInfo.mode||0===this._numberOfGraphicsProvidingElevation)&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=l(this._stageLayerElevationProvider)):(!this.layer.elevationInfo||this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&this._numberOfGraphicsProvidingElevation>0&&(this._stageLayerElevationProvider=new Ce({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register(2,this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear(),null!=this._filterVisibility&&this._filterVisibility.clear(),this._labeler?.reset(),this._deconflictor?.clear(),this._elevationAlignment?.clear(),this.stageLayer?.invalidateSpatialQueryAccelerator(),this._stageLayerElevationProvider&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=l(this._stageLayerElevationProvider))}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;const{loadedGraphics:t,view:i}=this.owner,r=i.basemapTerrain?.tilingScheme&&t?.length?t.toArray():null;!e&&r||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=we(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set("computedExtent",null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){const t=this._graphicsBySymbol.get(e),i=[];t&&(t.forEach((e,t)=>{const r=e.usedMemory;this._conditionalRemove(e,t),this._spatialIndex?.remove(e),i.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,r),this._updateLayerVisibility(),this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.()}),this._graphicsBySymbol.set(e,new Map));const r=this._symbols.get(e);l(r),this._symbols.delete(e),this._symbolMaterials=null,l(this._unusedSymbolsCache.pop(e)),this.add(i)}_recreateGraphicsForSymbol(e){const t=this._graphicsBySymbol.get(e);if(t){const e=[];t.forEach(t=>e.push(t.graphic)),this.recreateGraphics(e)}}_conditionalRemove(e,t){this._graphicsDrapedUids.delete(t),this._objectStates?.removeGraphic(e),this._labeler?.removeGraphic(e),this._deconflictor?.removeGraphic(e),null!=this._graphicStateTracking&&this._graphicStateTracking.removeGraphic(e)}add(e){e&&0!==e.length&&(this.owner.view.basemapTerrain?.tilingScheme?(0===this._updatePolicyForGraphics(e)?this._addDelayed(e):this._addImmediate(e),this.notifyChange("dataUpdating")):s.getLogger(this).error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(e){if(1===this.effectiveUpdatePolicy&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const t of e)if(null!=t.geometry&&"mesh"===t.geometry.type&&!t.geometry.loaded)return 0;return this.effectiveUpdatePolicy}_addImmediate(e){this._geometryWarningLogged=!1,this._symbolWarningLogged=!1;for(const t of e)this._addGraphic(t,this._getRenderingInfo(t),1);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_addDelayed(e){for(const t of e){const e=t.uid;let i=this._pendingUpdates.get(e);i?i.add?0!==i.state&&i.abortController?.abort():this._pendingAdds++:(i=new ze,this._pendingAdds++,this._pendingUpdates.set(e,i)),i.add=t}this.notifyChange("readyToRun"),this.notifyChange("updatingRemaining"),this.notifyChange("dataUpdating")}remove(e){0===this.effectiveUpdatePolicy?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange("dataUpdating")}_removeImmediate(e){for(const t of e)this._removeGraphic(t);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_removeDelayed(e){for(const t of e){const e=t.uid,i=this._pendingUpdates.get(e);if(i)i.add&&(i.remove?i.add=null:this._pendingUpdates.delete(e),1===i.state&&i.abortController?.abort(),this._pendingAdds--);else{const i=new ze;i.remove=t,this._pendingUpdates.set(e,i),this._pendingRemoves++,this._applyPendingRemovesFirst=!0}}0===this._pendingUpdates.size&&this._finishPendingUpdates(),this.notifyChange("readyToRun"),this.notifyChange("updatingRemaining"),this.notifyChange("dataUpdating")}_finishPendingUpdates(){this._cleanupSymbols(),(this._pendingAdds||this._pendingRemoves)&&s.getLogger(this).warn("pendingAdds/Removes in inconsistent state!"),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1}_applyFocusAreasUpdates(e){for(;this._focusAreasGraphicsQueue.length>0&&!e.done;){e.madeProgress();const t=this._focusAreasGraphicsQueue.pop(),i=fe(t.graphic.geometry);if(null==i)continue;const r=this.stage.view.focusAreasView?.containsGeometry(i)??!0;t.layers.forEach(e=>{if(e.stageObject){e.stageObject.geometries.some(e=>e.material instanceof Re&&e.material.parameters.isFocused!==r)&&this.recreateGraphics([t.graphic])}})}0===this._focusAreasGraphicsQueue.length&&this.notifyChange("readyToRun")}_applyPendingUpdates(e){if(this._geometryWarningLogged=!1,this._symbolWarningLogged=!1,0===this._pendingUpdates.size&&this._spatialIndex?.updating)return this._spatialIndex.update(),void e.madeProgress();if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(const[t,i]of this._pendingUpdates){if(e.done){this._applyPendingRemovesFirst=!0;break}if(i.remove&&!i.add&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,this._pendingUpdates.delete(t),0===this._pendingRemoves))break}}for(const[t,i]of this._pendingUpdates){if(e.done)break;i.add&&0===i.state&&this._processPendingUpdateNew(i);let r=this.effectiveUpdatePolicy;if(!i.remove||i.add&&2!==i.state||(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,r=1),i.add)switch(i.state){case 2:this._addGraphic(i.add,i.renderingInfo,r),i.add=null,this._pendingAdds--,e.madeProgress();break;case 3:i.add=null,this._pendingAdds--}null==i.remove&&null==i.add&&this._pendingUpdates.delete(t)}0===this._pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("readyToRun"),this.notifyChange("dataUpdating"))}_processPendingUpdateNew(e){if(!e.add)return void(e.state=2);const t=e.add.geometry;null==t||"mesh"!==t.type||t.loaded?this._processPendingUpdateNewRenderingInfo(e):this._processPendingUpdateNewMesh(e,t)}async _processPendingUpdateNewMesh(e,t){e.state=1,e.abortController=new AbortController;const i=e.abortController.signal;try{await t.load({signal:i})}catch(r){return this._processPendingUpdateNewError(e,r)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,u(t)?e.state=0:e.state=3}async _processPendingUpdateNewRenderingInfo(e){if(null==this.layer.renderer||"dictionary"!==this.layer.renderer.type)return e.renderingInfo=this._getRenderingInfo(e.add),void(e.state=2);e.state=1,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(i){return e.abortController=null,void(u(i)?e.state=0:e.state=3)}null==t?.symbol?(this._symbolWarningLogged||(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=2}_addGraphic(e,t,i){if(this._graphicsWithoutSymbol.set(e.uid,e),null==t?.symbol||!Q(e))return;const r=this.stage.renderView.olidRenderHelper;if(r&&this.setUidToIdOnAdd){const t=J(this.owner.view,this.owner.layerViewUid);r.setUidToObjectAndLayerId(e.objectId,e.uid,this.layer.id,this.owner.layerViewUid,W(this.layer)&&!!this.layer.popupEnabled&&!t&&Ue(this.layer,this.owner.view.popup?.defaultPopupTemplateEnabled))}const s=t.symbol,a=this.getOrCreateGraphics3DSymbol(s,t.renderer);if(null==a)return;this._expandComputedExtent(e.geometry);const n=this._beginGraphicUpdate(e),o=new ce(e,t,this.layer);let l=!1;const h=e=>{e===a.symbol.id&&(l=!0)};this._whenSymbolRemoved.push(h);const d=()=>{if(--this._loadingSymbols,this.destroyed)return;this._whenSymbolRemoved.removeUnordered(h);if(this._graphicsWaitingForSymbol.get(e.uid)!==n||l||a.destroyed||this.graphicSymbolSupported&&e.symbol&&e.symbol.id!==a.symbol.id)--a.referenced,this._cleanupSymbols();else{const t=this._createGraphics3DGraphic(a,o);this._spatialIndex&&null!=t&&this._spatialIndex.add(t),--a.referenced,this._endGraphicUpdate(e)}this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.(),this._labeler?.setDirty()},p=t=>{--this._loadingSymbols,this.destroyed||(this._whenSymbolRemoved.removeUnordered(h),l||(u(t)?this.add([e]):a.destroyed||this._endGraphicUpdate(e,t)))};++this._loadingSymbols,0===i?a.load(()=>this._dataUpdateQueue.push(d,null).catch(c),e=>this._dataUpdateQueue.push(()=>p(e),null).catch(c)):a.load(d,p)}_removeGraphic(e){const t=e.uid,i=this.graphics3DGraphics.get(t);if(i){i.graphics3DSymbol.onRemoveGraphic(i);const e=i.usedMemory,r=i.isElevationSource;this._conditionalRemove(i,t),this._spatialIndex?.remove(i);const s=i.graphics3DSymbol.symbol.id;this._graphicsBySymbol.get(s)?.delete(t),this._graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,e,r),i.destroy(),this._featureStore.events.emit("changed"),this.owner.notifyContentGeometryUpdate?.()}else this._graphicsWithoutSymbol.delete(t),this._graphicsWaitingForSymbol.delete(t),0===this._graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("dataUpdating"))}_hasLabelingContext(e){if(e instanceof ee||e instanceof te){const t=this.symbolCreationContext.layer;return!!t.labelingInfo&&t.labelingInfo.some(t=>t.symbol===e)}return!1}_hasValidSymbolCreationContext(e){return!(e instanceof ee&&!this._hasLabelingContext(e))||(s.getLogger(this).error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(e,t=!0){const i=e.geometry;if(null==i)return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!L(i.spatialReference,this._viewSpatialReference))return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&null!=e.symbol)return t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const r=this.rendererHasGeometryOperations?N(e,this.layer,null):e;let a;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||null!=this.currentRenderer))a=this.owner.getRenderingInfo(r,this.currentRenderer,this._arcadeOnDemand);else{const e=r.symbol||re(r.geometry);a=new X(null,e)}return null==a?.symbol?(t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):a}_getRenderingInfoAsync(e,t){if(null==e.geometry)return this._geometryWarningLogged||(this._geometryWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&null!=e.symbol)return this._symbolWarningLogged||(this._symbolWarningLogged=!0,s.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const i=this.rendererHasGeometryOperations?N(e,this.layer,null):e;return this.owner.getRenderingInfoAsync(i,this.currentRenderer,this._arcadeOnDemand,t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;const i=this._getConvertedSymbol(e);if(!i)return null;let r;if(null!=t&&"backgroundFillSymbol"in t&&t.backgroundFillSymbol){const e=se(t.backgroundFillSymbol,{ignoreDrivers:!0});null!=e.symbol&&(r=e.symbol.symbolLayers)}const s=ue(i,this.symbolCreationContext,r);return s.load(()=>{const e=s.extentPadding;e>this.extentPadding&&this._set("extentPadding",e),this.notifyChange("averageSymbolComplexity")},()=>{}),s}getOrCreateGraphics3DSymbol(e,t){let i=this._symbols.get(e.id);if(void 0===i){const r=this._unusedSymbolsCache.pop(e.id);i=null!=r?r:e instanceof ie?new ge(e,e=>this._dataUpdateQueue.push(e,null),e=>this._createGraphics3DSymbol(e,t)):this._createGraphics3DSymbol(e,t),this._symbols.set(e.id,i),this._symbolMaterials=null}return null!=i&&++i.referenced,i}trackGraphicState(e){return null==this._graphicStateTracking&&(this._graphicStateTracking=new be(this)),this._graphicStateTracking.add(e)}_addGraphics3DGraphic(e){this._usedMemory+=e.usedMemory,this.graphics3DGraphics.set(e.graphic.uid,e),this._numberOfGraphics++,e.isElevationSource&&(this._numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,i=!1){this._usedMemory-=t,this.graphics3DGraphics.delete(e),this._numberOfGraphics--,i&&(this._numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){const{graphic:i}=t;if(this._graphicsWithoutSymbol.delete(i.uid),!this._symbols.has(e.symbol.id))return this.add([i]),null;if(this.graphics3DGraphics.has(i.uid))return null;const r=e.createGraphics3DGraphic(t);if(null==r)return null;this._addGraphics3DGraphic(r);const s=e.symbol.id;this._graphicsBySymbol.has(s)||this._graphicsBySymbol.set(s,new Map),this._graphicsBySymbol.get(s).set(i.uid,r);if(r.isDraped&&this._graphicsDrapedUids.add(i.uid),r.centroid=null,null!=i.geometry&&"point"!==i.geometry.type&&(r.centroid=_e(i.geometry,this._viewSpatialReference)),this._updateUserVisibility(r),null!=this._scaleVisibility&&this._scaleVisibility.updateVisibility(r),null!=this._filterVisibility){const{defaultVisibility:e}=this._filterVisibility;r.setVisibilityFlag(1,4,e),e||this._filterVisibility.reapply()}this._deconflictor?.addGraphic(r),this._labeler?.addGraphic(r),this._objectStates?.addGraphic(r),r.initialize(this.stageLayer),null!=this._graphicStateTracking&&this._graphicStateTracking.addGraphic(r);const a=this._whenGraphics3DGraphicRequests[i.uid];return a&&(delete this._whenGraphics3DGraphicRequests[i.uid],a.resolve(r)),this._symbolMaterials=null,r}async rendererChange(e){if(this._rendererChangeAbortController=n(this._rendererChangeAbortController),e!==this.currentRenderer)if(this._validateRenderer(e),null==e&&this._currentRendererChange(null,!1),Z(e))if(e?.arcadeRequired){const t=new AbortController;this._rendererChangeAbortController=t;const{arcadeUtils:i}=await this._ensureArcade();p(t);const r=i.hasGeometryOperations(e);r&&(await i.enableGeometryOperations(),p(t)),0===this.effectiveUpdatePolicy?await this._updateQueue.push(()=>this._currentRendererChange(e,r),t.signal):this._currentRendererChange(e,r),this._rendererChangeAbortController=null}else if(0===this.effectiveUpdatePolicy){const t=new AbortController;this._rendererChangeAbortController=t,await this._updateQueue.push(()=>this._currentRendererChange(e,!1),t.signal),this._rendererChangeAbortController=null}else this._currentRendererChange(e,!1);else this._currentRendererChange(e,!1)}async _ensureArcade(){return null==this._arcadeOnDemand?(this._arcadeOnDemand=await K(),this._arcadeOnDemand):this._arcadeOnDemand}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererHasGeometryOperations=t,this.symbolCreationContext.arcade=this._arcadeOnDemand;const i=this.symbolCreationContext.renderer;if(e===i)return;if(this._symbolConversionCache.clear(),this._unusedSymbolsCache.clear(),null==e)return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const r=w(i,e);this._updateUnchangedSymbolMappings(r,e,i),this.symbolCreationContext.renderer=e,null!=r&&("complete"===r.type?this.recreateAllGraphicsAndSymbols():"partial"===r.type&&(this._applyRendererDiff(r,e,i)?this._labeler?.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(e){for(const t in e.diff)switch(t){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"uniqueValueGroups":case"authoringInfo":case"fieldDelimiter":delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,i){e=e||[],t=t||[];const r=[];for(const s of t){const t=this._graphicsBySymbol.get(s.id);t&&t.forEach((a,n)=>{const o=a.graphic,l=this.layer instanceof H?this.layer:null,h=this._arcadeOnDemand;if(s===i.defaultSymbol&&i.getSymbol(N(o,l,null),{arcade:h})===i.defaultSymbol)return;const d=a.usedMemory;e.length||i.defaultSymbol?r.push(o):this._graphicsWithoutSymbol.set(n,o);const p=this.graphics3DGraphics.get(n);this._conditionalRemove(p,n),a.destroy(),t.delete(n),this._removeGraphics3DGraphic(n,d),this._updateLayerVisibility()}),this._whenSymbolRemoved.forAll(e=>e(s.id))}(e.length||r.length)&&(this._graphicsWithoutSymbol.forEach(e=>r.push(e)),this._graphicsWithoutSymbol.clear(),this.add(r)),this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_applyUniqueValueRendererDiff(e,t,r){const s=e.diff.defaultSymbol,a=e.diff.uniqueValueInfos;if(s||a){const n=a?.changed,o=a?.unchanged;if(n&&o&&n.some(e=>o.some(t=>t.oldValue.symbol?.id===e.oldValue.symbol?.id)))return!1;const l=a?a.added.map(e=>e.symbol).filter(i):[],h=a?a.removed.map(e=>e.symbol).filter(i):[];if(n)for(let e=0;e<n.length;e++)l.push(n[e].newValue.symbol),h.push(n[e].oldValue.symbol);return s?(r.defaultSymbol&&h.push(r.defaultSymbol),t.defaultSymbol&&l.push(t.defaultSymbol)):r.defaultSymbol&&l.length&&h.push(t.defaultSymbol),this._applySymbolSetDiff(l,h,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,i){if("unique-value"!==t?.type||"unique-value"!==i?.type||null!=e&&"partial"!==e.type)return[];const r=e=>null!=e?e.id:null,s=e&&e.diff,a=s?.defaultSymbol,n=s&&s.uniqueValueInfos;let o;if(n)o=n.unchanged.map(e=>({oldId:r(e.oldValue.symbol),newId:r(e.newValue.symbol)}));else{o=[];for(const e of i.uniqueValueInfos??[]){const i=r(e.symbol),s=t.uniqueValueInfos?.find(t=>t.value===e.value);s&&i!==r(s.symbol)&&o.push({oldId:i,newId:r(s.symbol)})}}return!a&&i.defaultSymbol&&o.push({oldId:r(i.defaultSymbol),newId:r(t.defaultSymbol)}),o}_updateSymbolMapping(e,t){const i=null!=t&&t?"string"==typeof t?t:t.id:null;if(null==e||e===i)return;const r=this._graphicsBySymbol.get(e);this._graphicsBySymbol.delete(e),void 0!==r&&this._graphicsBySymbol.set(i,r);const s=this._symbols.get(e);if(void 0!==s&&(this._symbols.delete(e),this._symbols.set(i,s),this._symbolMaterials=null,null!=s)){const e="string"==typeof t?null:t;null!=e?s.symbol=e:s.symbol.id=i}}_updateUnchangedSymbolMappings(e,t,i){const r=this._calculateUnchangedSymbolMapping(e,t,i);for(const{oldId:s,newId:a}of r)this._updateSymbolMapping(s,a)}_applyRendererDiff(e,t,i){if(this._diffHasSymbolChange(e))return!1;if(t instanceof $&&i instanceof $&&this._applyUniqueValueRendererDiff(e,t,i)&&0===Object.keys(e.diff).length)return!0;for(const r of this._graphicsBySymbol.keys()){const i=this._symbols.get(r);if(null!=i)switch(i.applyRendererDiff(e,t)){case 0:this._recreateSymbol(r);break;case 1:this._recreateGraphicsForSymbol(r)}}return!0}opacityChange(){this._updateStageLayerVisibility(),this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged("opacity",t))}_screenSizePerspectiveEnabledChange(){this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged("screenSizePerspectiveEnabled",t)),this._labeler?.screenSizePerspectiveEnabledChanged(),this._deconflictor?.screenSizePerspectiveEnabledChanged()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.sliceable=e,this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged("slicePlaneEnabled",t)),this._deconflictor?.slicePlaneEnabledChange(),this._labeler?.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",t)||this._recreateSymbol(i)})}_skipHighSymbolLoDsChange(e){this.symbolCreationContext.skipHighSymbolLods=e,this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("skipHighSymbolLods",t)||this._recreateSymbol(i)})}_pixelRatioChange(){this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("pixelRatio",t)||this._recreateSymbol(i)})}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=C(()=>{this._updatingPendingLoadedGraphicsChange=null})}setClippingExtent(e,t){const i=this.symbolCreationContext.clippingExtent,r=k();return Se(e,r,t)?this.symbolCreationContext.clippingExtent=T(F(),r):this.symbolCreationContext.clippingExtent=null,!M(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(e){if(this.destroyed)return;let t=!1;this.graphics3DGraphics.forEach(i=>{e(i)&&(t=!0)}),t&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}forEachGraphics3DSymbol(e,t){for(const[i,r]of this._symbols){if(null==r)return;e(r,this._graphicsBySymbol.get(i)||qe,i)}if(!t?.excludeUnused)for(const i of this._unusedSymbolsCache)e(i,void 0,i.symbol.id)}updateGraphicsVisibilities(){null!=this._filterVisibility&&this._filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities(e=>{const t=this._updateUserVisibility(e),i=!!this._scaleVisibility?.updateVisibility(e);return t||i})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,1,!1))}_validateRenderer(e){const t=()=>`'${this.layer.title?`${this.layer.title}, `:""}id:${this.layer.id}'`,i=Y(e,{geometryType:this.layer?.geometryType,logWarning:(e,i)=>s.getLogger(this).warn(e,`Symbology conversion for layer ${t()}: ${i}`)});if(i){const e=`Renderer for layer ${t} is not supported in a SceneView`;s.getLogger(this).warn(e,i.message)}}_cleanupSymbols(){if(this._graphicsWaitingForSymbol.size>0||this._suspendSymbolCleanup)return;let e=!1;this._symbols.forEach((t,i)=>{if(null==t||t.referenced>0)return;const r=this._graphicsBySymbol.get(i);r&&0!==r.size||(this._graphicsBySymbol.delete(i),this._symbols.delete(i),this._symbolMaterials=null,this._unusedSymbolsCache.put(i,t,h),e=!0)}),e&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){}get performanceInfo(){return new me(this.graphics3DGraphics.size,Array.from(this.graphics3DGraphics.values()).reduce((e,t)=>e+(t.isVisible()?1:0),0),this._graphicsWithoutSymbol.size,this._pendingUpdates.size)}};e([S({readOnly:!0})],ke.prototype,"computedExtent",void 0),e([S()],ke.prototype,"currentRenderer",void 0),e([S()],ke.prototype,"rendererHasGeometryOperations",void 0),e([S()],ke.prototype,"_frameTaskHandle",void 0),e([S()],ke.prototype,"_dataUpdateQueue",void 0),e([S()],ke.prototype,"_updateQueue",void 0),e([S({readOnly:!0})],ke.prototype,"_viewSpatialReference",null),e([S()],ke.prototype,"_rendererChangeAbortController",void 0),e([S()],ke.prototype,"_elevationInfoChangeAbortController",void 0),e([S()],ke.prototype,"_initializeAbortController",void 0),e([S()],ke.prototype,"_elevationAlignment",void 0),e([S()],ke.prototype,"_scaleVisibility",void 0),e([S()],ke.prototype,"_filterVisibility",void 0),e([S()],ke.prototype,"_initializePromise",void 0),e([S()],ke.prototype,"_spatialIndex",void 0),e([S({readOnly:!0})],ke.prototype,"extentPadding",void 0),e([S()],ke.prototype,"_updatingPendingLoadedGraphicsChange",void 0),e([S()],ke.prototype,"_featureStore",void 0),e([S()],ke.prototype,"_objectStates",void 0),e([S()],ke.prototype,"_loadingSymbols",void 0),e([S({constructOnly:!0})],ke.prototype,"compressionTracker",void 0),e([S()],ke.prototype,"preferredUpdatePolicy",void 0),e([S()],ke.prototype,"_forcedUpdatePolicy",void 0),e([S({readOnly:!0})],ke.prototype,"effectiveUpdatePolicy",null),e([S({constructOnly:!0})],ke.prototype,"elevationFeatureExpressionEnabled",void 0),e([S({constructOnly:!0})],ke.prototype,"owner",void 0),e([S({constructOnly:!0})],ke.prototype,"layer",void 0),e([S({constructOnly:!0})],ke.prototype,"graphicSymbolSupported",void 0),e([S({constructOnly:!0})],ke.prototype,"getRenderingInfoWithoutRenderer",void 0),e([S({constructOnly:!0})],ke.prototype,"componentFactories",void 0),e([S({constructOnly:!0})],ke.prototype,"setUidToIdOnAdd",void 0),e([S()],ke.prototype,"featureStore",null),e([S()],ke.prototype,"initializePromise",null),e([S()],ke.prototype,"scaleVisibility",null),e([S()],ke.prototype,"elevationAlignment",null),e([S()],ke.prototype,"objectStates",null),e([S()],ke.prototype,"filterVisibility",null),e([S({readOnly:!0})],ke.prototype,"updating",null),e([S({readOnly:!0})],ke.prototype,"dataUpdating",null),e([S({readOnly:!0})],ke.prototype,"readyToRun",null),e([S({readOnly:!0})],ke.prototype,"suspendedOrOutsideOfView",null),e([S({readOnly:!0,dependsOn:[]})],ke.prototype,"updatingRemaining",null),e([S({readOnly:!0})],ke.prototype,"displayFeatureLimit",null),e([S({readOnly:!0,dependsOn:[]})],ke.prototype,"averageSymbolComplexity",null),e([S({constructOnly:!0})],ke.prototype,"hasZ",void 0),e([S({constructOnly:!0})],ke.prototype,"hasM",void 0),e([S()],ke.prototype,"_objectIdField",null),ke=Fe=e([G("esri.views.3d.layers.graphics.Graphics3DCore")],ke);class ze{constructor(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}}const We=10,He=D(),Be=D(),qe=new Map;export{ke as Graphics3DCore};
@@ -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{i as e}from"../../../../chunks/vec32.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as r,empty as i,expandWithRect as o,center as s,set as d,toRect as a}from"../../../../geometry/support/aaBoundingBox.js";import{create as n}from"../../../../geometry/support/aaBoundingRect.js";import{demResolutionForBoundingBox as h}from"./graphicUtils.js";class c{constructor(e,t,r,i){this.graphics3DSymbolLayer=e,this.renderGeometries=t,this.boundingBox=r,this._drapeSourceRenderer=i,this.type="draped",this._visible=!1,this._addedToStage=!1,this.isElevationSource=!1}initialize(e){this.stage=e.stage}get usedMemory(){return this.graphics3DSymbolLayer.usedMemory}setVisibility(e){if(null!=this.stage&&this._visible!==e){if(this._visible=e,e&&!this._addedToStage)return this._addedToStage=!0,void this._drapeSourceRenderer.addGeometries(this.renderGeometries,0);if(e||this._addedToStage){for(const e of this.renderGeometries)e.visible=this._visible;this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,1)}}}destroy(){this.stage&&this._addedToStage&&this._drapeSourceRenderer.removeGeometries(this.renderGeometries,2),this._addedToStage=!1,this._visible=!1,this.stage=null}getCenterObjectSpace(r=t()){return e(r,0,0,0)}getBoundingBoxObjectSpace(e=r()){return i(e)}addObjectState(e){0===e.stateType&&(this.renderGeometries.forEach(t=>{const r=t.geometry.allocateIdAndHighlight(e.highlightName);e.addRenderGeometry(t,r,this)}),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,8))}removeObjectState(e){this.renderGeometries.forEach(t=>e.removeByObject(t))}updateHighlights(e){}removeRenderGeometryObjectState(e,t){0===t.channel&&(e.geometry.removeHighlight(t),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries([e],8))}computeAttachmentOrigin(e){for(const t of this.renderGeometries)t.geometry.computeAttachmentOrigin(u)&&(e.draped.origin[0]+=u[0],e.draped.origin[1]+=u[1],e.draped.num++)}async getProjectedBoundingBox(e,t,r,d,a){i(a);for(let i=0;i<this.renderGeometries.length;i++){const t=this.renderGeometries[i];this._getRenderGeometryProjectedBoundingRect(t,e,m,r),o(a,m)}if(t){let e;s(a,u);const r=h(a,t.service.spatialReference,t);try{e=await t.service.queryElevation(u[0],u[1],d,r,"ground")}catch(n){}null!=e&&(a[2]=Math.min(a[2],e),a[5]=Math.max(a[5],e))}return a}_getRenderGeometryProjectedBoundingRect(e,t,r,i){if(this.boundingBox)d(g,this.boundingBox);else{const t=e.boundingSphere,r=t[3];g[0]=t[0]-r,g[1]=t[1]-r,g[2]=t[2]-r,g[3]=t[0]+r,g[4]=t[1]+r,g[5]=t[2]+r}return t(g,0,2),this.calculateRelativeScreenBounds&&i.push({location:s(g),screenSpaceBoundingRect:this.calculateRelativeScreenBounds()}),a(g,r)}}const m=n(),g=r(),u=t();export{c as Graphics3DDrapedGraphicLayer};
5
+ import{j as e}from"../../../../chunks/vec32.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as r,empty as i,expandWithRect as o,center as s,set as d,toRect as a}from"../../../../geometry/support/aaBoundingBox.js";import{create as n}from"../../../../geometry/support/aaBoundingRect.js";import{demResolutionForBoundingBox as h}from"./graphicUtils.js";class c{constructor(e,t,r,i){this.graphics3DSymbolLayer=e,this.renderGeometries=t,this.boundingBox=r,this._drapeSourceRenderer=i,this.type="draped",this._visible=!1,this._addedToStage=!1,this.isElevationSource=!1}initialize(e){this.stage=e.stage}get usedMemory(){return this.graphics3DSymbolLayer.usedMemory}setVisibility(e){if(null!=this.stage&&this._visible!==e){if(this._visible=e,e&&!this._addedToStage)return this._addedToStage=!0,void this._drapeSourceRenderer.addGeometries(this.renderGeometries,0);if(e||this._addedToStage){for(const e of this.renderGeometries)e.visible=this._visible;this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,1)}}}destroy(){this.stage&&this._addedToStage&&this._drapeSourceRenderer.removeGeometries(this.renderGeometries,2),this._addedToStage=!1,this._visible=!1,this.stage=null}getCenterObjectSpace(r=t()){return e(r,0,0,0)}getBoundingBoxObjectSpace(e=r()){return i(e)}addObjectState(e){0===e.stateType&&(this.renderGeometries.forEach(t=>{const r=t.geometry.allocateIdAndHighlight(e.highlightName);e.addRenderGeometry(t,r,this)}),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,8))}removeObjectState(e){this.renderGeometries.forEach(t=>e.removeByObject(t))}updateHighlights(e){}removeRenderGeometryObjectState(e,t){0===t.channel&&(e.geometry.removeHighlight(t),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries([e],8))}computeAttachmentOrigin(e){for(const t of this.renderGeometries)t.geometry.computeAttachmentOrigin(u)&&(e.draped.origin[0]+=u[0],e.draped.origin[1]+=u[1],e.draped.num++)}async getProjectedBoundingBox(e,t,r,d,a){i(a);for(let i=0;i<this.renderGeometries.length;i++){const t=this.renderGeometries[i];this._getRenderGeometryProjectedBoundingRect(t,e,m,r),o(a,m)}if(t){let e;s(a,u);const r=h(a,t.service.spatialReference,t);try{e=await t.service.queryElevation(u[0],u[1],d,r,"ground")}catch(n){}null!=e&&(a[2]=Math.min(a[2],e),a[5]=Math.max(a[5],e))}return a}_getRenderGeometryProjectedBoundingRect(e,t,r,i){if(this.boundingBox)d(g,this.boundingBox);else{const t=e.boundingSphere,r=t[3];g[0]=t[0]-r,g[1]=t[1]-r,g[2]=t[2]-r,g[3]=t[0]+r,g[4]=t[1]+r,g[5]=t[2]+r}return t(g,0,2),this.calculateRelativeScreenBounds&&i.push({location:s(g),screenSpaceBoundingRect:this.calculateRelativeScreenBounds()}),a(g,r)}}const m=n(),g=r(),u=t();export{c as Graphics3DDrapedGraphicLayer};
@@ -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"../../../../core/has.js";import{clone as t}from"../../../../core/lang.js";import{getMetersPerVerticalUnitForSR as e}from"../../../../core/unitUtils.js";import{e as r}from"../../../../chunks/earcut.js";import{normalFromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as n,invertOrIdentity as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as l,t as c,a as p,h as m,n as h,c as u,d}from"../../../../chunks/vec32.js";import{ONES as g,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as y}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as b,fromBuffer as _,intersectsClippingArea as x}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as j}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as S,getZeroIndexArray as P}from"../../../../geometry/support/Indices.js";import{t as v}from"../../../../chunks/vec3.js";import{makeVertexCandidate as C,makeEdgeCandidate as w}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as E}from"../../../../renderers/support/renderingInfoUtils.js";import{needsElevationUpdates3D as A,SampleElevationInfo as D}from"./elevationAlignmentUtils.js";import{Object3DEdgeState as I,Graphics3DObject3DGraphicLayer as U}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as L}from"./Graphics3DSymbolLayer.js";import{computeCentroid as z}from"./graphicUtils.js";import{geometryAsPolygon as M}from"./polygonUtils.js";import{createMaterial as O}from"../support/edgeUtils.js";import{encodeNaNUInt8 as G}from"../support/symbolColorUtils.js";import{debugFlags as V}from"../../support/debugFlags.js";import{SamplePosition as T}from"../../support/ElevationProvider.js";import{geometryToRenderInfo as B}from"../../support/renderInfoUtils/polygon.js";import{Attribute as R}from"../../webgl-engine/lib/Attribute.js";import{Geometry as F}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as H}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as k,compressNormal as N}from"../../webgl-engine/lib/Normals.js";import{Object3D as W}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as q}from"../../webgl-engine/materials/DefaultMaterial.js";const Z=["polygon","extent"];class J extends L{constructor(t,e,r,s){super(t,e,r,s,pt(e)),this.ensureDrapedStatus(!1)}async doLoad(){const t=this.symbolLayer,e=t?.material,r=this.symbolLayer.material?.color?.a,s=this.needsDrivenTransparentPass||null!=r&&1!==r,o=e?.emissive,n=!this._hasDrivenColorOrOpacity&&(null==r||0===r),i={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,ambient:g,diffuse:g,opacity:n?0:1,layerOpacity:this._getLayerOpacity(),drivenOpacity:s,hasSymbolColors:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:t.castShadows,emissiveStrength:o?.strength??0,emissiveSource:1,offsetTransparentBackfaces:!0,normalType:1},a=new q(i,this._context),l=new q({...i,cullFace:2},this._context);this._materials[0]=a,this._materials[1]=l,this._updateTransparentDepedentMaterialParameters()}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(t){const e=t.graphic;if(!this._validateGeometry(e.geometry,Z,this.symbolLayer.type))return null;const r=this._getDrivenUInt8ColorWithNaNSupport(t.renderingInfo,this._materialColor,!1);G(r,r);const s=this.createElevationContextForGraphic(e);return this._createAs3DShape(e,t.renderingInfo,r,s,e.uid)}layerOpacityChanged(t,e){const r=this._getLayerOpacity();this._materials[0]?.setParameters({layerOpacity:r}),this._materials[1]?.setParameters({layerOpacity:r}),this._updateTransparentDepedentMaterialParameters(),t?.forEach(t=>e(t)?.layerOpacityChanged(r,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(t,e){return this.updateGraphics3DGraphicElevationInfo(t,e,A)}slicePlaneEnabledChanged(t,e){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),t?.forEach(t=>{const r=e(t);null!=r&&r.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){const t={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[0]?.setParameters(t),this._materials[1]?.setParameters(t),!0}_getExtrusionSize(t){let e;return e=t.size&&this._drivenProperties.size?E(t.size,2)??0:this._getSymbolSize(),e/=this._context.renderCoordsHelper.unitInMeters,e}applyRendererDiff(t,e){return this._drivenPropertiesChanged(e)?0:1}async queryForSnapping(r,s,o,n){const i=this._getExtrusionSize(o)*this._context.renderCoordsHelper.unitInMeters/e(s),{objectId:a,target:l}=r,c=t(l);switch(c.z=(c.z??0)+i,r.type){case"edge":{const{start:e,end:s}=r,o=t(e),n=t(s);return o.z=(o.z??0)+i,n.z=(n.z??0)+i,[w(a,c,1/0,o,n)]}case"vertex":return[C(a,c,1/0),w(a,l,1/0,l,c)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(t,e,i,l,c){const p=M(t.geometry);if(null==p)return null;if(0===p.rings.length||!p.rings.some(t=>t.length>0))return this._logGeometryValidationWarnings(p.rings,"rings","ExtrudeSymbol3DLayer"),null;const m=B(p,this._context.elevationProvider,this._context.renderCoordsHelper,l);this._logGeometryCreationWarnings(m,p.rings,"rings","ExtrudeSymbol3DLayer");const h=z(p);if(null==h)return null;const u=new Array,d=new Array,g=b(),P=a(),C=f(),w=1===this._context.renderCoordsHelper.viewingMode;w||this._context.renderCoordsHelper.worldUpAtPosition(null,C),y(p.spatialReference,[h.x,h.y,0],P,this._context.renderCoordsHelper.spatialReference);const E=a();n(E,P);const D=o();s(D,E);const{polygons:L,mapPositions:G,position:V}=m,T=new Map,R=this._materials[0];for(const s of L){const t=s.count;if(this._context.clippingExtent&&(_(s.mapPositions,g),!x(g,this._context.clippingExtent)))continue;const o=r(s.mapPositions,s.holeIndices,3);if(0===o.length)continue;const n=o.length,a=6*t,l=S(a+n),p=S(n),m=j(3*a),h=j(3*a),f=j(3*a),y=j(a);Q(V,G,o,s,m,f,h,y,l,p,this._getExtrusionSize(e),C,w),v(m,m,E);const b=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:c,layerViewUid:this._context.layerViewUid}),A=new jt(m,f,k(h),y),D=K(R,l,l.length-p.length,A,i,b),I=t,U=t,L=2*s.count,z=new St(I,U,L,n/3);ct(D,z,P),T.set(D,z),u.push(D,K(this._materials[1],p,0,A,i,b)),d.push(A.heights)}if(0===u.length)return null;const F=new W({geometries:u,layerViewUid:this._context.layerViewUid,graphicUid:c,isElevationSource:!0});F.transformation=P;const H=O(this.symbolLayer,{opacity:this._getLayerOpacity()}),N=H?new I(this._materials[0],H,this._context.slicePlaneEnabled):null,q=new U(this,F,null,(t,e,r,s,o)=>lt(t,e,r,s,o,d,T),l,N);return q.alignedSampledElevation=m.sampledElevation,q.needsElevationUpdates=A(l.mode),q}get _materialColor(){return this.symbolLayer.material?.color}_updateTransparentDepedentMaterialParameters(){const t=this._materials[0];t&&t.setParameters({cullFace:t.transparent?0:2})}}function K(t,e,r,s,o,n){const i=P(e.length),a=[["position",new R(s.positions,e,3,!0)],["normalCompressed",new R(s.normals,e,2,!0)],["symbolColor",new R(o,i,4,!0)]];return new F(t,a,s.elevation,0,n,r)}function Q(t,e,r,s,o,n,i,a,l,c,p,m,h){const u=r.length/3;let d=2*s.count;X(t,e,s.index,s.count,r,0,u,o,n,i,a,l,c,d,p,m,h);let g=0,f=2*s.count;d=0;const y=s.pathLengths[0];tt(o,n,a,i,g,y,s.count,f,l,d,p),f+=4*y,d+=2*y,g+=y;for(let b=1;b<s.pathLengths.length;++b){const t=s.pathLengths[b];tt(o,n,a,i,g,t,s.count,f,l,d,p),f+=4*t,d+=2*t,g+=t}}function X(t,e,r,s,o,n,i,a,l,c,p,m,d,g,f,y,b){u(ht,y),l??=[],c??=[],p??=[];const _=f>0?1:-1;let x=3*r,j=0,S=3*j,P=s,v=3*P;for(let u=0;u<s;++u){const r=t[x],s=t[x+1],o=t[x+2];b&&(ht[0]=r,ht[1]=s,ht[2]=o,h(ht,ht)),a[S+0]=r,a[S+1]=s,a[S+2]=o;const n=e[x+0],i=e[x+1],m=e[x+2];l[S+0]=n,l[S+1]=i,l[S+2]=m,c[S+0]=-_*ht[0],c[S+1]=-_*ht[1],c[S+2]=-_*ht[2],p[j]=0,a[v+0]=r+f*ht[0],a[v+1]=s+f*ht[1],a[v+2]=o+f*ht[2],l[v+0]=n,l[v+1]=i,l[v+2]=m,p[P]=f,S+=3,v+=3,x+=3,j+=1,P+=1}x=3*n,S=0,v=3*g;const C=f<0?gt:dt,w=f<0?dt:gt;for(let h=0;h<i;++h)d[S]=o[x+C[0]],d[S+1]=o[x+C[1]],d[S+2]=o[x+C[2]],m[v]=o[x+w[0]]+s,m[v+1]=o[x+w[1]]+s,m[v+2]=o[x+w[2]]+s,S+=3,v+=3,x+=3}function Y(t,e,r,s,o,n,i){s[n]=s[i],i*=3,t[n*=3]=t[i],t[n+1]=t[i+1],t[n+2]=t[i+2],e[n]=e[i],e[n+1]=e[i+1],e[n+2]=e[i+2],r[n]=o[0],r[n+1]=o[1],r[n+2]=o[2]}const $=f();function tt(t,e,r,s,o,n,i,a,l,c,p){e??=[],r??=[],s??=[];let m=o,h=o+1,u=o+i,d=o+i+1,g=a,f=a+1,y=a+2*n,b=a+2*n+1;p<0&&(m=o+i+1,d=o);let _=3*c;for(let x=0;x<n;++x)x===n-1&&(h=o,p>0?d=o+i:m=o+i),it(t,m,h,u,$),Y(t,e,s,r,$,g,m),Y(t,e,s,r,$,f,h),Y(t,e,s,r,$,y,u),Y(t,e,s,r,$,b,d),l[_]=g,l[_+1]=y,l[_+2]=b,l[_+3]=g,l[_+4]=b,l[_+5]=f,_+=6,m++,h++,u++,d++,g+=2,f+=2,y+=2,b+=2}const et=f(),rt=f(),st=f(),ot=f(),nt=f();function it(t,e,r,s,o){e*=3,r*=3,s*=3,l(et,t[e++],t[e++],t[e++]),l(rt,t[r++],t[r++],t[r++]),l(st,t[s++],t[s++],t[s++]),d(ot,rt,et),d(nt,st,et),m(o,nt,ot),h(o,o)}const at=f();function lt(t,e,r,s,o,n,p){const m=t.stageObject,h=m.geometries,u=h.length,d="absolute-height"!==e.mode;let g=0;const f=m.transformation,y=i(a(),f);for(let i=0;i<u;i+=2){const t=h[i];if(!H(t))continue;const e=t.getMutableAttribute("position").data,a=n[i/2],u=new T(t.mapPositions),b=e.length/3;let _=!1,x=0;{let t=0;for(let n=0;n<b;n++){at[0]=e[t],at[1]=e[t+1],at[2]=e[t+2],s(u,ut),d&&(x+=ut.sampledElevation),V.TESTS_DISABLE_OPTIMIZATIONS?(l(mt,u.array[u.offset],u.array[u.offset+1],ut.z+a[t/3]),null!=r&&o.toRenderCoords(mt,r,mt),c(mt,mt,y)):(l(mt,e[t],e[t+1],e[t+2]),c(mt,mt,f),o.setAltitude(mt,ut.z+a[t/3]),c(mt,mt,y)),e[t]=mt[0],e[t+1]=mt[1],e[t+2]=mt[2];const n=ft/o.unitInMeters;(Math.abs(at[0]-e[t])>=n||Math.abs(at[1]-e[t+1])>=n||Math.abs(at[2]-e[t+2])>=n)&&(_=!0),u.offset+=3,t+=3}}if(_){const e=p.get(t);e&&ct(t,e,f),m.geometryVertexAttributeUpdated(h[i],"normalCompressed"),t.invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(h[i],"position"),h[i+1].invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(h[i+1],"position")}g+=x/b}return g/u}function ct(t,e,r){const s=t.getMutableAttribute("position"),o=t.getMutableAttribute("normalCompressed").data,{topVertexStart:n,topVertexCount:i,topFaceStart:a,topFaceCount:u}=e,d=s.data,g=i,f=t.attributes.get("position").indices,y=a+u,b=n+i,_=j(3*g);for(let l=0;l<g;++l){const t=3*l;_[t+0]=0,_[t+1]=0,_[t+2]=0}const x=yt,S=bt,P=_t,v=xt,C=ht;for(let j=a;j<y;++j){const t=3*j;for(let e=0;e<3;++e){const s=f[t+e];v[e]=s;const o=3*s;l(mt,d[o+0],d[o+1],d[o+2]),c(x[e],mt,r)}p(S,x[1],x[0]),p(P,x[2],x[0]),m(C,S,P),h(C,C);for(let e=0;e<3;++e){const t=3*(v[e]-n);_[t+0]+=C[0],_[t+1]+=C[1],_[t+2]+=C[2]}}for(let l=n;l<b;++l){const t=3*(l-n),e=_[t+0],r=_[t+1],s=_[t+2],i=Math.sqrt(e*e+r*r+s*s);N(o,l,e/i,r/i,s/i)}}function pt(t){return 1===(t.material?.color?.a??0)}const mt=f(),ht=f(),ut=new D,dt=[0,2,1],gt=[0,1,2],ft=.01,yt=[f(),f(),f()],bt=f(),_t=f(),xt=[0,0,0];class jt{constructor(t,e,r,s){this.positions=t,this.elevation=e,this.normals=r,this.heights=s}}class St{constructor(t,e,r,s){this.topVertexStart=t,this.topVertexCount=e,this.topFaceStart=r,this.topFaceCount=s}}export{J as Graphics3DExtrudeSymbolLayer,Q as extrudePolygon};
5
+ import"../../../../core/has.js";import{clone as t}from"../../../../core/lang.js";import{getMetersPerVerticalUnitForSR as e}from"../../../../core/unitUtils.js";import{e as r}from"../../../../chunks/earcut.js";import{normalFromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as n,invertOrIdentity as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as l,t as c,a as p,i as m,n as h,d as u,e as d}from"../../../../chunks/vec32.js";import{ONES as g,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as y}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as b,fromBuffer as _,intersectsClippingArea as x}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as j}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as S,getZeroIndexArray as P}from"../../../../geometry/support/Indices.js";import{t as v}from"../../../../chunks/vec3.js";import{makeVertexCandidate as C,makeEdgeCandidate as w}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as E}from"../../../../renderers/support/renderingInfoUtils.js";import{needsElevationUpdates3D as A,SampleElevationInfo as D}from"./elevationAlignmentUtils.js";import{Object3DEdgeState as I,Graphics3DObject3DGraphicLayer as U}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as L}from"./Graphics3DSymbolLayer.js";import{computeCentroid as z}from"./graphicUtils.js";import{geometryAsPolygon as M}from"./polygonUtils.js";import{createMaterial as O}from"../support/edgeUtils.js";import{encodeNaNUInt8 as G}from"../support/symbolColorUtils.js";import{debugFlags as V}from"../../support/debugFlags.js";import{SamplePosition as T}from"../../support/ElevationProvider.js";import{geometryToRenderInfo as B}from"../../support/renderInfoUtils/polygon.js";import{Attribute as R}from"../../webgl-engine/lib/Attribute.js";import{Geometry as F}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as H}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as k,compressNormal as N}from"../../webgl-engine/lib/Normals.js";import{Object3D as W}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as q}from"../../webgl-engine/materials/DefaultMaterial.js";const Z=["polygon","extent"];class J extends L{constructor(t,e,r,s){super(t,e,r,s,pt(e)),this.ensureDrapedStatus(!1)}async doLoad(){const t=this.symbolLayer,e=t?.material,r=this.symbolLayer.material?.color?.a,s=this.needsDrivenTransparentPass||null!=r&&1!==r,o=e?.emissive,n=!this._hasDrivenColorOrOpacity&&(null==r||0===r),i={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,ambient:g,diffuse:g,opacity:n?0:1,layerOpacity:this._getLayerOpacity(),drivenOpacity:s,hasSymbolColors:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:t.castShadows,emissiveStrength:o?.strength??0,emissiveSource:1,offsetTransparentBackfaces:!0,normalType:1},a=new q(i,this._context),l=new q({...i,cullFace:2},this._context);this._materials[0]=a,this._materials[1]=l,this._updateTransparentDepedentMaterialParameters()}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(t){const e=t.graphic;if(!this._validateGeometry(e.geometry,Z,this.symbolLayer.type))return null;const r=this._getDrivenUInt8ColorWithNaNSupport(t.renderingInfo,this._materialColor,!1);G(r,r);const s=this.createElevationContextForGraphic(e);return this._createAs3DShape(e,t.renderingInfo,r,s,e.uid)}layerOpacityChanged(t,e){const r=this._getLayerOpacity();this._materials[0]?.setParameters({layerOpacity:r}),this._materials[1]?.setParameters({layerOpacity:r}),this._updateTransparentDepedentMaterialParameters(),t?.forEach(t=>e(t)?.layerOpacityChanged(r,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(t,e){return this.updateGraphics3DGraphicElevationInfo(t,e,A)}slicePlaneEnabledChanged(t,e){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),t?.forEach(t=>{const r=e(t);null!=r&&r.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){const t={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[0]?.setParameters(t),this._materials[1]?.setParameters(t),!0}_getExtrusionSize(t){let e;return e=t.size&&this._drivenProperties.size?E(t.size,2)??0:this._getSymbolSize(),e/=this._context.renderCoordsHelper.unitInMeters,e}applyRendererDiff(t,e){return this._drivenPropertiesChanged(e)?0:1}async queryForSnapping(r,s,o,n){const i=this._getExtrusionSize(o)*this._context.renderCoordsHelper.unitInMeters/e(s),{objectId:a,target:l}=r,c=t(l);switch(c.z=(c.z??0)+i,r.type){case"edge":{const{start:e,end:s}=r,o=t(e),n=t(s);return o.z=(o.z??0)+i,n.z=(n.z??0)+i,[w(a,c,1/0,o,n)]}case"vertex":return[C(a,c,1/0),w(a,l,1/0,l,c)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(t,e,i,l,c){const p=M(t.geometry);if(null==p)return null;if(0===p.rings.length||!p.rings.some(t=>t.length>0))return this._logGeometryValidationWarnings(p.rings,"rings","ExtrudeSymbol3DLayer"),null;const m=B(p,this._context.elevationProvider,this._context.renderCoordsHelper,l);this._logGeometryCreationWarnings(m,p.rings,"rings","ExtrudeSymbol3DLayer");const h=z(p);if(null==h)return null;const u=new Array,d=new Array,g=b(),P=a(),C=f(),w=1===this._context.renderCoordsHelper.viewingMode;w||this._context.renderCoordsHelper.worldUpAtPosition(null,C),y(p.spatialReference,[h.x,h.y,0],P,this._context.renderCoordsHelper.spatialReference);const E=a();n(E,P);const D=o();s(D,E);const{polygons:L,mapPositions:G,position:V}=m,T=new Map,R=this._materials[0];for(const s of L){const t=s.count;if(this._context.clippingExtent&&(_(s.mapPositions,g),!x(g,this._context.clippingExtent)))continue;const o=r(s.mapPositions,s.holeIndices,3);if(0===o.length)continue;const n=o.length,a=6*t,l=S(a+n),p=S(n),m=j(3*a),h=j(3*a),f=j(3*a),y=j(a);Q(V,G,o,s,m,f,h,y,l,p,this._getExtrusionSize(e),C,w),v(m,m,E);const b=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:c,layerViewUid:this._context.layerViewUid}),A=new jt(m,f,k(h),y),D=K(R,l,l.length-p.length,A,i,b),I=t,U=t,L=2*s.count,z=new St(I,U,L,n/3);ct(D,z,P),T.set(D,z),u.push(D,K(this._materials[1],p,0,A,i,b)),d.push(A.heights)}if(0===u.length)return null;const F=new W({geometries:u,layerViewUid:this._context.layerViewUid,graphicUid:c,isElevationSource:!0});F.transformation=P;const H=O(this.symbolLayer,{opacity:this._getLayerOpacity()}),N=H?new I(this._materials[0],H,this._context.slicePlaneEnabled):null,q=new U(this,F,null,(t,e,r,s,o)=>lt(t,e,r,s,o,d,T),l,N);return q.alignedSampledElevation=m.sampledElevation,q.needsElevationUpdates=A(l.mode),q}get _materialColor(){return this.symbolLayer.material?.color}_updateTransparentDepedentMaterialParameters(){const t=this._materials[0];t&&t.setParameters({cullFace:t.transparent?0:2})}}function K(t,e,r,s,o,n){const i=P(e.length),a=[["position",new R(s.positions,e,3,!0)],["normalCompressed",new R(s.normals,e,2,!0)],["symbolColor",new R(o,i,4,!0)]];return new F(t,a,s.elevation,0,n,r)}function Q(t,e,r,s,o,n,i,a,l,c,p,m,h){const u=r.length/3;let d=2*s.count;X(t,e,s.index,s.count,r,0,u,o,n,i,a,l,c,d,p,m,h);let g=0,f=2*s.count;d=0;const y=s.pathLengths[0];tt(o,n,a,i,g,y,s.count,f,l,d,p),f+=4*y,d+=2*y,g+=y;for(let b=1;b<s.pathLengths.length;++b){const t=s.pathLengths[b];tt(o,n,a,i,g,t,s.count,f,l,d,p),f+=4*t,d+=2*t,g+=t}}function X(t,e,r,s,o,n,i,a,l,c,p,m,d,g,f,y,b){u(ht,y),l??=[],c??=[],p??=[];const _=f>0?1:-1;let x=3*r,j=0,S=3*j,P=s,v=3*P;for(let u=0;u<s;++u){const r=t[x],s=t[x+1],o=t[x+2];b&&(ht[0]=r,ht[1]=s,ht[2]=o,h(ht,ht)),a[S+0]=r,a[S+1]=s,a[S+2]=o;const n=e[x+0],i=e[x+1],m=e[x+2];l[S+0]=n,l[S+1]=i,l[S+2]=m,c[S+0]=-_*ht[0],c[S+1]=-_*ht[1],c[S+2]=-_*ht[2],p[j]=0,a[v+0]=r+f*ht[0],a[v+1]=s+f*ht[1],a[v+2]=o+f*ht[2],l[v+0]=n,l[v+1]=i,l[v+2]=m,p[P]=f,S+=3,v+=3,x+=3,j+=1,P+=1}x=3*n,S=0,v=3*g;const C=f<0?gt:dt,w=f<0?dt:gt;for(let h=0;h<i;++h)d[S]=o[x+C[0]],d[S+1]=o[x+C[1]],d[S+2]=o[x+C[2]],m[v]=o[x+w[0]]+s,m[v+1]=o[x+w[1]]+s,m[v+2]=o[x+w[2]]+s,S+=3,v+=3,x+=3}function Y(t,e,r,s,o,n,i){s[n]=s[i],i*=3,t[n*=3]=t[i],t[n+1]=t[i+1],t[n+2]=t[i+2],e[n]=e[i],e[n+1]=e[i+1],e[n+2]=e[i+2],r[n]=o[0],r[n+1]=o[1],r[n+2]=o[2]}const $=f();function tt(t,e,r,s,o,n,i,a,l,c,p){e??=[],r??=[],s??=[];let m=o,h=o+1,u=o+i,d=o+i+1,g=a,f=a+1,y=a+2*n,b=a+2*n+1;p<0&&(m=o+i+1,d=o);let _=3*c;for(let x=0;x<n;++x)x===n-1&&(h=o,p>0?d=o+i:m=o+i),it(t,m,h,u,$),Y(t,e,s,r,$,g,m),Y(t,e,s,r,$,f,h),Y(t,e,s,r,$,y,u),Y(t,e,s,r,$,b,d),l[_]=g,l[_+1]=y,l[_+2]=b,l[_+3]=g,l[_+4]=b,l[_+5]=f,_+=6,m++,h++,u++,d++,g+=2,f+=2,y+=2,b+=2}const et=f(),rt=f(),st=f(),ot=f(),nt=f();function it(t,e,r,s,o){e*=3,r*=3,s*=3,l(et,t[e++],t[e++],t[e++]),l(rt,t[r++],t[r++],t[r++]),l(st,t[s++],t[s++],t[s++]),d(ot,rt,et),d(nt,st,et),m(o,nt,ot),h(o,o)}const at=f();function lt(t,e,r,s,o,n,p){const m=t.stageObject,h=m.geometries,u=h.length,d="absolute-height"!==e.mode;let g=0;const f=m.transformation,y=i(a(),f);for(let i=0;i<u;i+=2){const t=h[i];if(!H(t))continue;const e=t.getMutableAttribute("position").data,a=n[i/2],u=new T(t.mapPositions),b=e.length/3;let _=!1,x=0;{let t=0;for(let n=0;n<b;n++){at[0]=e[t],at[1]=e[t+1],at[2]=e[t+2],s(u,ut),d&&(x+=ut.sampledElevation),V.TESTS_DISABLE_OPTIMIZATIONS?(l(mt,u.array[u.offset],u.array[u.offset+1],ut.z+a[t/3]),null!=r&&o.toRenderCoords(mt,r,mt),c(mt,mt,y)):(l(mt,e[t],e[t+1],e[t+2]),c(mt,mt,f),o.setAltitude(mt,ut.z+a[t/3]),c(mt,mt,y)),e[t]=mt[0],e[t+1]=mt[1],e[t+2]=mt[2];const n=ft/o.unitInMeters;(Math.abs(at[0]-e[t])>=n||Math.abs(at[1]-e[t+1])>=n||Math.abs(at[2]-e[t+2])>=n)&&(_=!0),u.offset+=3,t+=3}}if(_){const e=p.get(t);e&&ct(t,e,f),m.geometryVertexAttributeUpdated(h[i],"normalCompressed"),t.invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(h[i],"position"),h[i+1].invalidateBoundingInfo(),m.geometryVertexAttributeUpdated(h[i+1],"position")}g+=x/b}return g/u}function ct(t,e,r){const s=t.getMutableAttribute("position"),o=t.getMutableAttribute("normalCompressed").data,{topVertexStart:n,topVertexCount:i,topFaceStart:a,topFaceCount:u}=e,d=s.data,g=i,f=t.attributes.get("position").indices,y=a+u,b=n+i,_=j(3*g);for(let l=0;l<g;++l){const t=3*l;_[t+0]=0,_[t+1]=0,_[t+2]=0}const x=yt,S=bt,P=_t,v=xt,C=ht;for(let j=a;j<y;++j){const t=3*j;for(let e=0;e<3;++e){const s=f[t+e];v[e]=s;const o=3*s;l(mt,d[o+0],d[o+1],d[o+2]),c(x[e],mt,r)}p(S,x[1],x[0]),p(P,x[2],x[0]),m(C,S,P),h(C,C);for(let e=0;e<3;++e){const t=3*(v[e]-n);_[t+0]+=C[0],_[t+1]+=C[1],_[t+2]+=C[2]}}for(let l=n;l<b;++l){const t=3*(l-n),e=_[t+0],r=_[t+1],s=_[t+2],i=Math.sqrt(e*e+r*r+s*s);N(o,l,e/i,r/i,s/i)}}function pt(t){return 1===(t.material?.color?.a??0)}const mt=f(),ht=f(),ut=new D,dt=[0,2,1],gt=[0,1,2],ft=.01,yt=[f(),f(),f()],bt=f(),_t=f(),xt=[0,0,0];class jt{constructor(t,e,r,s){this.positions=t,this.elevation=e,this.normals=r,this.heights=s}}class St{constructor(t,e,r,s){this.topVertexStart=t,this.topVertexCount=e,this.topFaceStart=r,this.topFaceCount=s}}export{J as Graphics3DExtrudeSymbolLayer,Q as extrudePolygon};
@@ -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{emptyArray as e}from"../../../../core/arrayUtils.js";import{forEach as t}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{estimateAttributesMemory as i}from"../../../../core/memoryEstimations.js";import r from"../../../../core/ObjectPool.js";import{scale as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{g as o}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import n from"../../../../geometry/Polygon.js";import{projectBoundingRect as h}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as c,expandWithAABB as p,allFinite as y,toRect as m,create as u,set as d,zero as b}from"../../../../geometry/support/aaBoundingBox.js";import{create as g,allFinite as f}from"../../../../geometry/support/aaBoundingRect.js";import{equals as _}from"../../../../geometry/support/spatialReferenceUtils.js";import{computeAABR as E}from"../../../../layers/graphics/dehydratedFeatures.js";import{convertFromGeometry as L}from"../../../../layers/graphics/featureConversionUtils.js";const G=new r(()=>u(),e=>d(e,b),null,10,5),j=g();class v{get labelLayers(){return this._labelLayers||e}get extent(){return this._extent}get isElevationSource(){return this.layers.some(e=>e?.isElevationSource)}constructor(e,t,i){this.graphic=e,this.graphics3DSymbol=t,this.layers=i,this._visibleFlags=255,++t.referenced}initialize(e){this._layer=e,this._forEachSymbolLayerGraphic(t=>{t.initialize(e),t.setVisibility(this.isVisible())})}destroy(){this._forEachSymbolLayerGraphic(e=>e.destroy()),this._calloutLayer=null,--this.graphics3DSymbol.referenced,this.graphics3DSymbol=null}get destroyed(){return null==this.layers}clearLabelGraphics(){this._forEachLabelGraphic(e=>e.destroy()),this._labelLayers=null}addLabelGraphic(e,t){this._labelLayers||(this._labelLayers=new Array),this._labelLayers.push(e),e.initialize(t),e.setVisibility(this.isVisible(16))}setCalloutGraphic(e){this._calloutLayer=e,this._layer&&(e.initialize(this._layer),e.setVisibility(this.isVisible()))}get calloutLayer(){return this._calloutLayer}get isDraped(){let e=!1;return this._forEachSymbolLayerGraphic(t=>{"draped"===t.type&&(e=!0)}),e}isVisible(e=1,t){const i=t?this._visibleFlags|t|16*t:this._visibleFlags;return 1===e?!(15&~i):!(255&~i)}setVisibilityFlag(e,t,i){const r=this.isVisible(e);i?this._visibleFlags|=e*t:this._visibleFlags&=~(e*t);const s=this.isVisible(e);if(r===s)return!1;if(16===e)this._forEachLabelGraphic(e=>e.setVisibility(s));else{this._forEachSymbolLayerGraphic(e=>e.setVisibility(s));const e=this.isVisible(16);this._forEachLabelGraphic(t=>t.setVisibility(e))}return!0}getVisibilityFlag(e,t){return 0!==(this._visibleFlags&e*t)}computeExtent(e){if(!this._extent){const t=this.graphic.geometry;if(null==t)return!1;this._extent=g(),E(t,this._extent);const i=t.spatialReference;if(!_(i,e)&&!h(this._extent,i,this._extent,e))return this._extent=null,!1}return!0}getAsOptimizedGeometry(e,t){return this._optimizedGeometry||(this._optimizedGeometry=this._convertGraphicToOptimizedGeometry(this.graphic,e,t)),this._optimizedGeometry}_convertGraphicToOptimizedGeometry(e,t,i){let r=e.geometry;return"mesh"!==r.type&&"extent"!==r.type||(r=n.fromExtent("mesh"===r.type?r.extent:r)),L(r,t,i)}get usedMemory(){let e=i(this.graphic.attributes);return this._forEachSymbolLayerGraphic(t=>e+=t.usedMemory),e}computeAttachmentOrigin(){const e={render:{origin:l(),num:0},draped:{origin:a(),num:0}};for(const t of this.layers)null!=t&&t.computeAttachmentOrigin(e);return e.render.num>1&&o(e.render.origin,e.render.origin,1/e.render.num),e.draped.num>1&&s(e.draped.origin,e.draped.origin,1/e.draped.num),e}async getProjectedBoundingBox(e,i,r,s,a){return a||(a={boundingBox:null,requiresDrapedElevation:!1,screenSpaceObjects:[]}),a.boundingBox?c(a.boundingBox):a.boundingBox=c(),a.requiresDrapedElevation=!1,await t(this.layers,async t=>{if(null==t)return;const o="draped"===t.type?i:e,l=G.acquire(),n=await t.getProjectedBoundingBox(o,r,a.screenSpaceObjects,s,l);isFinite(n[2])&&isFinite(n[5])||(a.requiresDrapedElevation=!0),n&&p(a.boundingBox,l),G.release(l)}),y(a.boundingBox)||f(m(a.boundingBox,j))?a:null}needsElevationUpdates(){for(const e of this.layers)if(null!=e&&("object3d"===e.type||"lod-instance"===e.type)&&e.needsElevationUpdates)return!0;return this._labelLayers?.some(e=>e?.needsElevationUpdates??!1)??!1}alignWithElevation(e,t,i){this._forEachRenderedGraphic(r=>{"object3d"!==r.type&&"lod-instance"!==r.type||r.alignWithElevation(e,t,i)})}alignWithAbsoluteElevation(e,t,i){this._forEachRenderedGraphic(r=>{"object3d"===r.type&&r.alignWithAbsoluteElevation(e,t,i)})}addObjectStateSet(e){this._forEachSymbolLayerGraphic(t=>t.addObjectState(e))}removeObjectState(e){this._forEachSymbolLayerGraphic(t=>t.removeObjectState(e))}updateHighlights(e){this._forEachSymbolLayerGraphic(t=>t.updateHighlights(e))}_forEachGraphicList(e,t){e?.forEach(e=>e&&t(e))}_forEachSymbolLayerGraphic(e){this._forEachGraphicList(this.layers,e),this._calloutLayer&&e(this._calloutLayer)}_forEachLabelGraphic(e){this._forEachGraphicList(this.labelLayers,e)}_forEachRenderedGraphic(e){this._forEachSymbolLayerGraphic(e),this._forEachLabelGraphic(e)}get test(){}}export{v as Graphics3DGraphic};
5
+ import{emptyArray as e}from"../../../../core/arrayUtils.js";import{forEach as t}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{estimateAttributesMemory as i}from"../../../../core/memoryEstimations.js";import r from"../../../../core/ObjectPool.js";import{scale as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h as o}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import n from"../../../../geometry/Polygon.js";import{projectBoundingRect as h}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as c,expandWithAABB as p,allFinite as y,toRect as m,create as u,set as d,zero as b}from"../../../../geometry/support/aaBoundingBox.js";import{create as g,allFinite as f}from"../../../../geometry/support/aaBoundingRect.js";import{equals as _}from"../../../../geometry/support/spatialReferenceUtils.js";import{computeAABR as E}from"../../../../layers/graphics/dehydratedFeatures.js";import{convertFromGeometry as L}from"../../../../layers/graphics/featureConversionUtils.js";const G=new r(()=>u(),e=>d(e,b),null,10,5),j=g();class v{get labelLayers(){return this._labelLayers||e}get extent(){return this._extent}get isElevationSource(){return this.layers.some(e=>e?.isElevationSource)}constructor(e,t,i){this.graphic=e,this.graphics3DSymbol=t,this.layers=i,this._visibleFlags=255,++t.referenced}initialize(e){this._layer=e,this._forEachSymbolLayerGraphic(t=>{t.initialize(e),t.setVisibility(this.isVisible())})}destroy(){this._forEachSymbolLayerGraphic(e=>e.destroy()),this._calloutLayer=null,--this.graphics3DSymbol.referenced,this.graphics3DSymbol=null}get destroyed(){return null==this.layers}clearLabelGraphics(){this._forEachLabelGraphic(e=>e.destroy()),this._labelLayers=null}addLabelGraphic(e,t){this._labelLayers||(this._labelLayers=new Array),this._labelLayers.push(e),e.initialize(t),e.setVisibility(this.isVisible(16))}setCalloutGraphic(e){this._calloutLayer=e,this._layer&&(e.initialize(this._layer),e.setVisibility(this.isVisible()))}get calloutLayer(){return this._calloutLayer}get isDraped(){let e=!1;return this._forEachSymbolLayerGraphic(t=>{"draped"===t.type&&(e=!0)}),e}isVisible(e=1,t){const i=t?this._visibleFlags|t|16*t:this._visibleFlags;return 1===e?!(15&~i):!(255&~i)}setVisibilityFlag(e,t,i){const r=this.isVisible(e);i?this._visibleFlags|=e*t:this._visibleFlags&=~(e*t);const s=this.isVisible(e);if(r===s)return!1;if(16===e)this._forEachLabelGraphic(e=>e.setVisibility(s));else{this._forEachSymbolLayerGraphic(e=>e.setVisibility(s));const e=this.isVisible(16);this._forEachLabelGraphic(t=>t.setVisibility(e))}return!0}getVisibilityFlag(e,t){return 0!==(this._visibleFlags&e*t)}computeExtent(e){if(!this._extent){const t=this.graphic.geometry;if(null==t)return!1;this._extent=g(),E(t,this._extent);const i=t.spatialReference;if(!_(i,e)&&!h(this._extent,i,this._extent,e))return this._extent=null,!1}return!0}getAsOptimizedGeometry(e,t){return this._optimizedGeometry||(this._optimizedGeometry=this._convertGraphicToOptimizedGeometry(this.graphic,e,t)),this._optimizedGeometry}_convertGraphicToOptimizedGeometry(e,t,i){let r=e.geometry;return"mesh"!==r.type&&"extent"!==r.type||(r=n.fromExtent("mesh"===r.type?r.extent:r)),L(r,t,i)}get usedMemory(){let e=i(this.graphic.attributes);return this._forEachSymbolLayerGraphic(t=>e+=t.usedMemory),e}computeAttachmentOrigin(){const e={render:{origin:l(),num:0},draped:{origin:a(),num:0}};for(const t of this.layers)null!=t&&t.computeAttachmentOrigin(e);return e.render.num>1&&o(e.render.origin,e.render.origin,1/e.render.num),e.draped.num>1&&s(e.draped.origin,e.draped.origin,1/e.draped.num),e}async getProjectedBoundingBox(e,i,r,s,a){return a||(a={boundingBox:null,requiresDrapedElevation:!1,screenSpaceObjects:[]}),a.boundingBox?c(a.boundingBox):a.boundingBox=c(),a.requiresDrapedElevation=!1,await t(this.layers,async t=>{if(null==t)return;const o="draped"===t.type?i:e,l=G.acquire(),n=await t.getProjectedBoundingBox(o,r,a.screenSpaceObjects,s,l);isFinite(n[2])&&isFinite(n[5])||(a.requiresDrapedElevation=!0),n&&p(a.boundingBox,l),G.release(l)}),y(a.boundingBox)||f(m(a.boundingBox,j))?a:null}needsElevationUpdates(){for(const e of this.layers)if(null!=e&&("object3d"===e.type||"lod-instance"===e.type)&&e.needsElevationUpdates)return!0;return this._labelLayers?.some(e=>e?.needsElevationUpdates??!1)??!1}alignWithElevation(e,t,i){this._forEachRenderedGraphic(r=>{"object3d"!==r.type&&"lod-instance"!==r.type||r.alignWithElevation(e,t,i)})}alignWithAbsoluteElevation(e,t,i){this._forEachRenderedGraphic(r=>{"object3d"===r.type&&r.alignWithAbsoluteElevation(e,t,i)})}addObjectStateSet(e){this._forEachSymbolLayerGraphic(t=>t.addObjectState(e))}removeObjectState(e){this._forEachSymbolLayerGraphic(t=>t.removeObjectState(e))}updateHighlights(e){this._forEachSymbolLayerGraphic(t=>t.updateHighlights(e))}_forEachGraphicList(e,t){e?.forEach(e=>e&&t(e))}_forEachSymbolLayerGraphic(e){this._forEachGraphicList(this.layers,e),this._calloutLayer&&e(this._calloutLayer)}_forEachLabelGraphic(e){this._forEachGraphicList(this.labelLayers,e)}_forEachRenderedGraphic(e){this._forEachSymbolLayerGraphic(e),this._forEachLabelGraphic(e)}get test(){}}export{v as Graphics3DGraphic};
@@ -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{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as e,i}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as s,empty as a,expandWithVec3 as h,isPoint as r,center as l,offset as o}from"../../../../geometry/support/aaBoundingBox.js";import{evaluateElevationInfoAtPoint as g}from"./elevationAlignmentUtils.js";import{demResolutionForBoundingBox as c}from"./graphicUtils.js";import{Object3DHighlightStateID as d}from"../../webgl-engine/lib/Object3DStateID.js";class m{constructor(t,e,i,n,s){this.graphics3DSymbolLayer=t,this.instanceIndex=e,this.elevationAligner=i,this.elevationContext=n,this._highlightOrderMap=s,this.type="lod-instance",this._highlights=new Set,this.alignedSampledElevation=0,this.isElevationSource=!1,this.needsElevationUpdates=!1,this._highlightName=null}initialize(){}setVisibility(t){const{instanceData:e}=this;t!==e.getVisible(this.instanceIndex)&&e.setVisible(this.instanceIndex,t)}destroy(){null!=this.instanceIndex&&(this.instanceData.removeInstance(this.instanceIndex),this.graphics3DSymbolLayer.notifyDestroyGraphicLayer(this))}get usedMemory(){return this.graphics3DSymbolLayer.usedMemory}alignWithElevation(t,e){if(this.elevationAligner){const i=(i,n)=>g(i,t,this.elevationContext,e,n),n=this.elevationAligner(this,this.elevationContext,t.spatialReference,i,e);null!=n&&(this.alignedSampledElevation=n)}}getCenterObjectSpace(t=n()){return this.instanceData.getCombinedLocalTransform(this.instanceIndex,b),e(t,this._lodRenderer.baseBoundingSphere.center,b)}getBoundingBoxObjectSpace(t=s()){this.instanceData.getCombinedLocalTransform(this.instanceIndex,b);const n=this._lodRenderer.baseBoundingBox;a(t);for(let s=0;s<8;++s)i(u,1&s?n[3]:n[0],2&s?n[4]:n[1],4&s?n[5]:n[2]),e(u,u,b),h(t,u);return t}computeAttachmentOrigin(t){this.instanceData.getGlobalTransform(this.instanceIndex,b),t.render.origin[0]+=b[12],t.render.origin[1]+=b[13],t.render.origin[2]+=b[14],t.render.num++}async getProjectedBoundingBox(t,i,n,s,h){const g=this.getBoundingBoxObjectSpace(h),d=v,m=r(g)?1:d.length;this.instanceData.getGlobalTransform(this.instanceIndex,b);for(let a=0;a<m;a++){const t=d[a];u[0]=g[t[0]],u[1]=g[t[1]],u[2]=g[t[2]],e(u,u,b),p[3*a]=u[0],p[3*a+1]=u[1],p[3*a+2]=u[2]}if(!t(p,0,m))return null;a(g);let _=null;this.calculateRelativeScreenBounds&&(_=this.calculateRelativeScreenBounds());for(let e=0;e<3*m;e+=3){for(let t=0;t<3;t++)g[t]=Math.min(g[t],p[e+t]),g[t+3]=Math.max(g[t+3],p[e+t]);_&&n.push({location:p.slice(e,e+3),screenSpaceBoundingRect:_})}if(i&&(l(g,f),"absolute-height"!==this.elevationContext.mode)){let t;const e=c(g,i.service.spatialReference,i);try{t=await i.service.queryElevation(f[0],f[1],s,e,"ground")}catch(x){}null!=t&&o(g,0,0,-this.alignedSampledElevation+t)}return g}addObjectState(t){0===t.stateType&&this.addObjectHighlightState(t)}addObjectHighlightState(t){const e=new d(t.highlightName);this._addHighlightId(e),t.addExternal(t=>{this._removeHighlightId(t)},e)}removeObjectState(t){this._highlights.forEach(e=>t.remove(e))}updateHighlights(t){this._highlightOrderMap=t,this._updateHighlightOptions()}_calculateHighlightOptions(){let t=-1,e=null;return this._highlights.forEach(({highlightName:i})=>{const n=this._highlightOrderMap.get(i);void 0!==n&&n>t&&(t=n,e=i)}),e}_addHighlightId(t){this._highlights.add(t),this._updateHighlightOptions()}_removeHighlightId(t){this._highlights.delete(t),this._updateHighlightOptions()}_updateHighlightOptions(){const t=this._calculateHighlightOptions();t!==this._highlightName&&(this._highlightName=t,this.instanceData.setHighlight(this.instanceIndex,t))}get _lodRenderer(){return this.graphics3DSymbolLayer.lodRenderer}get instanceData(){return this._lodRenderer.instanceData}}const p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=n(),f=n(),v=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]],b=t();export{m as Graphics3DLodInstanceGraphicLayer};
5
+ import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as e,j as i}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as s,empty as a,expandWithVec3 as h,isPoint as r,center as l,offset as o}from"../../../../geometry/support/aaBoundingBox.js";import{evaluateElevationInfoAtPoint as g}from"./elevationAlignmentUtils.js";import{demResolutionForBoundingBox as c}from"./graphicUtils.js";import{Object3DHighlightStateID as d}from"../../webgl-engine/lib/Object3DStateID.js";class m{constructor(t,e,i,n,s){this.graphics3DSymbolLayer=t,this.instanceIndex=e,this.elevationAligner=i,this.elevationContext=n,this._highlightOrderMap=s,this.type="lod-instance",this._highlights=new Set,this.alignedSampledElevation=0,this.isElevationSource=!1,this.needsElevationUpdates=!1,this._highlightName=null}initialize(){}setVisibility(t){const{instanceData:e}=this;t!==e.getVisible(this.instanceIndex)&&e.setVisible(this.instanceIndex,t)}destroy(){null!=this.instanceIndex&&(this.instanceData.removeInstance(this.instanceIndex),this.graphics3DSymbolLayer.notifyDestroyGraphicLayer(this))}get usedMemory(){return this.graphics3DSymbolLayer.usedMemory}alignWithElevation(t,e){if(this.elevationAligner){const i=(i,n)=>g(i,t,this.elevationContext,e,n),n=this.elevationAligner(this,this.elevationContext,t.spatialReference,i,e);null!=n&&(this.alignedSampledElevation=n)}}getCenterObjectSpace(t=n()){return this.instanceData.getCombinedLocalTransform(this.instanceIndex,b),e(t,this._lodRenderer.baseBoundingSphere.center,b)}getBoundingBoxObjectSpace(t=s()){this.instanceData.getCombinedLocalTransform(this.instanceIndex,b);const n=this._lodRenderer.baseBoundingBox;a(t);for(let s=0;s<8;++s)i(u,1&s?n[3]:n[0],2&s?n[4]:n[1],4&s?n[5]:n[2]),e(u,u,b),h(t,u);return t}computeAttachmentOrigin(t){this.instanceData.getGlobalTransform(this.instanceIndex,b),t.render.origin[0]+=b[12],t.render.origin[1]+=b[13],t.render.origin[2]+=b[14],t.render.num++}async getProjectedBoundingBox(t,i,n,s,h){const g=this.getBoundingBoxObjectSpace(h),d=v,m=r(g)?1:d.length;this.instanceData.getGlobalTransform(this.instanceIndex,b);for(let a=0;a<m;a++){const t=d[a];u[0]=g[t[0]],u[1]=g[t[1]],u[2]=g[t[2]],e(u,u,b),p[3*a]=u[0],p[3*a+1]=u[1],p[3*a+2]=u[2]}if(!t(p,0,m))return null;a(g);let _=null;this.calculateRelativeScreenBounds&&(_=this.calculateRelativeScreenBounds());for(let e=0;e<3*m;e+=3){for(let t=0;t<3;t++)g[t]=Math.min(g[t],p[e+t]),g[t+3]=Math.max(g[t+3],p[e+t]);_&&n.push({location:p.slice(e,e+3),screenSpaceBoundingRect:_})}if(i&&(l(g,f),"absolute-height"!==this.elevationContext.mode)){let t;const e=c(g,i.service.spatialReference,i);try{t=await i.service.queryElevation(f[0],f[1],s,e,"ground")}catch(x){}null!=t&&o(g,0,0,-this.alignedSampledElevation+t)}return g}addObjectState(t){0===t.stateType&&this.addObjectHighlightState(t)}addObjectHighlightState(t){const e=new d(t.highlightName);this._addHighlightId(e),t.addExternal(t=>{this._removeHighlightId(t)},e)}removeObjectState(t){this._highlights.forEach(e=>t.remove(e))}updateHighlights(t){this._highlightOrderMap=t,this._updateHighlightOptions()}_calculateHighlightOptions(){let t=-1,e=null;return this._highlights.forEach(({highlightName:i})=>{const n=this._highlightOrderMap.get(i);void 0!==n&&n>t&&(t=n,e=i)}),e}_addHighlightId(t){this._highlights.add(t),this._updateHighlightOptions()}_removeHighlightId(t){this._highlights.delete(t),this._updateHighlightOptions()}_updateHighlightOptions(){const t=this._calculateHighlightOptions();t!==this._highlightName&&(this._highlightName=t,this.instanceData.setHighlight(this.instanceIndex,t))}get _lodRenderer(){return this.graphics3DSymbolLayer.lodRenderer}get instanceData(){return this._lodRenderer.instanceData}}const p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=n(),f=n(),v=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]],b=t();export{m as Graphics3DLodInstanceGraphicLayer};
@@ -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{linearize as t}from"../../../../colorUtils.js";import"../../../../core/has.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{releaseMaybe as o}from"../../../../core/maybe.js";import{isPromiseLike as n}from"../../../../core/promiseUtils.js";import{normalFromMat4 as a,fromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromTranslation as l,multiply as c,invert as u,getTranslation as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f,IDENTITY as p,clone as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as g,f as x,g as _,t as y,o as T,n as b,b as v,d as w,h as C,e as j}from"../../../../chunks/vec32.js";import{create as M,fromValues as A,ONES as R,ZEROS as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{canProjectWithoutEngine as I}from"../../../../geometry/projectionUtils.js";import{computeTranslationToOriginAndRotation as B}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as U}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as E}from"../../../../geometry/projection/projectVectorToVector.js";import{fromBuffer as O,create as F,intersectsClippingArea as V}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as $}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as G,getContinuousIndexArray as D}from"../../../../geometry/support/Indices.js";import L from"../../../../geometry/support/MeshComponent.js";import N from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import H from"../../../../geometry/support/MeshTextureTransform.js";import{isRelativeVertexSpace as k,isAbsoluteVertexSpace as z}from"../../../../geometry/support/meshVertexSpaceUtils.js";import{equals as q,isPlateCarree as W}from"../../../../geometry/support/spatialReferenceUtils.js";import{t as Y}from"../../../../chunks/vec3.js";import{transformNormal as J,transformVectorENUPlateCarree as K,transformVectorWMPlateCarree as Q,projectNormalToPCPF as X,transformTangent as Z,projectTangentToPCPF as ee}from"../../../../geometry/support/meshUtils/projection.js";import{projectMeshVertexPositions as te}from"../../../../geometry/support/meshUtils/projectMeshVertexPositions.js";import{getEmissiveMode as re}from"../../../../symbols/support/materialUtils.js";import{isEncodedMeshTexture as oe}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as ne}from"../../glTF/internal/TextureTransformUtils.js";import{defaultSymbolLayerMemoryComplexity as ae}from"./defaultSymbolComplexity.js";import{perObjectElevationAligner as se}from"./ElevationAligners.js";import{needsElevationUpdates3D as ie,evaluateElevationInfoAtPoint as le}from"./elevationAlignmentUtils.js";import{Graphics3DMeshObject3DGraphicLayer as ce}from"./Graphics3DMeshObject3DGraphicLayer.js";import{Object3DEdgeState as ue}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as me,nanFallbackColor as fe}from"./Graphics3DSymbolLayer.js";import{MaterialInfoCache as pe,MeshFastUpdateProcessor as he}from"./MeshFastUpdateProcessor.js";import{SymbolComplexity as de}from"./SymbolComplexity.js";import{hasEdges as ge,createMaterial as xe}from"../support/edgeUtils.js";import{debugFlags as _e}from"../../support/debugFlags.js";import{Attribute as ye}from"../../webgl-engine/lib/Attribute.js";import{Geometry as Te}from"../../webgl-engine/lib/Geometry.js";import{Object3D as be}from"../../webgl-engine/lib/Object3D.js";import{Texture as ve}from"../../webgl-engine/lib/Texture.js";import{DefaultMaterial as we}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as Ce}from"../../webgl-engine/materials/NativeLineMaterial.js";import{useSchematicPBR as je,advancedMRRFactors as Me,schematicMRRFactors as Ae}from"../../webgl-engine/materials/pbrUtils.js";const Re=["mesh"];class Pe extends me{constructor(e,t,r,o){super(e,t,r,o,We(t)),this._materialInfoCache=new pe,this._fastUpdateProcessor=new he,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){_e.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new Ce({color:[1,0,1,1]}),this._debugTangentNormalMaterial=new Ce({color:[1,.5,0,1]}),this._debugFaceNormalMaterial=new Ce({color:[0,1,1,1]})),this.updateComplexity()}destroy(){super.destroy(),this._textures.forEach(e=>e.unload()),this._context.stage.removeTextures(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy()}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,Re,"fill on mesh-3d"))return null;const r=this.createElevationContextForGraphic(t),o=e.renderingInfo;return this._createAs3DShape(t,o,r,t.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._updateMaterialParameters(e=>{e.material.setParameters({layerOpacity:r});const t=e.material.parameters;this._setMaterialTextureAlphaMode(t,e)}),e?.forEach(e=>t(e)?.layerOpacityChanged(r,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,ie)}slicePlaneEnabledChanged(e,t){return this._updateMaterialParameters(({material:e})=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),e?.forEach(e=>t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters(({material:t})=>t.setParameters({usePBR:e})),!0}updateTransform(e,t,r,o){if(!e.fastTransformUpdatesAllowed)return!1;const n=e.fastTransformUpdatesEnabled;switch(o){case 0:if(n)return!0;break;case 1:if(!n)return!0;break;default:if(!n)return!!this.updateTransform(e,t,r,0)&&(e.autoDisableFastTransformUpdates(()=>this.updateTransform(e,t,r,1)),!0)}const a=this._context.renderCoordsHelper.spatialReference,s=tt,{origin:i,transform:l}=r;if(!B(t,g(Ke,i.x,i.y,i.z??0),s,a))return!1;switch(o){case 0:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case 1:this._fastUpdateProcessor.disable(e,this._materialInfoCache);break;case 2:e.updateFastLocalOrigin(s,l,this._context.localOriginFactory)}const{elevationContext:c}=e;c.centerInElevationSR=this._getCenterInElevationSR(s);const{elevationProvider:u,renderCoordsHelper:m}=this._context,f=(e,t)=>le(e,u,c,m,t);return e.alignedSampledElevation=se(e,c,u.spatialReference,f,m,s),e.updateTransform(s,l,this._context.isAsync),e.updateAutoDisableFastTransformUpdates(()=>this.updateTransform(e,t,r,1)),!0}computeComplexity(){if(!this._textures||0===this._textures.size)return super.computeComplexity();let e=0;for(const o of this._textures.values())e+=o.usedMemory;const t={...ae(this.symbol,this.symbolLayer),resourceBytes:e},r=ge(this.symbolLayer)?2:0;return new de({drawCallsPerFeature:r,memory:t})}_requiresSymbolVertexColors(){return this._hasDrivenColorOrOpacity}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),o=!!e.vertexAttributes.color,n=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:o,hasVertexTangents:n,uid:`vc:${o},vt:${n},vct${t},svc:${r}`}}_materialProperties(e,t,r){const o=this._materialPropertiesDefault(e,r);if(!t.material)return o;const{color:n,colorTexture:a,colorTextureTransform:s,normalTexture:i,normalTextureTransform:l,doubleSided:c,alphaCutoff:u,alphaMode:m}=t.material,f=ke(n),p=ke(a),h=ze(s),d=ke(i),g=ze(l);if(o.color=n,o.colorTexture=a,o.normalTexture=i,o.uid=`${o.uid},cmuid:${f},ctmuid:${p},cttuid:${h},ntmuid:${d},nttuid:${g},ds:${c},ac:${u},am:${m}`,t.material instanceof N){const{metallic:e,roughness:r,metallicRoughnessTexture:n,metallicRoughnessTextureTransform:a,emissiveColor:i,emissiveTexture:c,emissiveTextureTransform:u,occlusionTexture:m,occlusionTextureTransform:f}=t.material,p=ke(n),h=ze(a),d=ke(i),g=ke(c),x=ze(u),_=ke(m),y=ze(f);o.uid=`${o.uid},mrm:${e},mrr:${r},mrt:${p},mrtt:${h},emuid:${d},etmuid:${g},ett:${x},otmuid:${_},ott:${y}`,o.metallic=e,o.roughness=r,o.metallicRoughnessTexture=n,o.emissiveColor=i,o.emissiveTexture=c,o.occlusionTexture=m,o.colorTextureTransform=$e(s),o.normalTextureTransform=$e(l),o.emissiveTextureTransform=$e(u),o.occlusionTextureTransform=$e(f),o.metallicRoughnessTextureTransform=$e(a)}return o}_getInternalTexture(e,t=!1,r=1){const a=He(e);if(!a)return null;const s=`${e.contentHash}/${r}`;let i=this._textures.get(s);if(i){const e=this._context.stage.renderView.textures;let t=null;const r=e.acquire(i.id);return null==r||n(r)||(i.events.on("unloaded",()=>t=o(t)),t=r),i}let l=null;const c=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,u={wrap:Ge(e.wrap),noUnpackFlip:!0,maxAnisotropy:c,mipmap:c>1};return oe(a)?(l=a.data,u.preMultiplyAlpha=!1,u.encoding=a.encoding):(l=a,u.preMultiplyAlpha=1!==r,u.compressionOptions=t?{compressionTracker:this._context.compressionTracker,compressionCallback:()=>this.updateComplexity()}:void 0),i=new ve(l,u),this._textures.set(s,i),i.events.on("loaded",()=>this.updateComplexity()),i.load(this._context.stage.renderView.renderingContext),this._context.stage.addTexture(i),i.events.on("unloaded",()=>{this._textures.delete(s)}),i}_setInternalMaterialTextureParameters(r,o){if(null!=r.colorTexture){const e=1!==o.textureAlphaMode,t=this._getInternalTexture(r.colorTexture,e,o.textureAlphaMode);t?(o.textureId=t.id,o.textureAlphaPremultiplied=!!t.parameters.preMultiplyAlpha):o.textureId=void 0}if(r.normalTexture&&(o.normalTextureId=this._getInternalTexture(r.normalTexture)?.id),r.emissiveColor){const n=e.toUnitRGB(r.emissiveColor);o.emissiveBaseColor=A(t(n[0]),t(n[1]),t(n[2]))}r.emissiveTexture&&(o.emissiveTextureId=this._getInternalTexture(r.emissiveTexture)?.id),r.occlusionTexture&&(o.occlusionTextureId=this._getInternalTexture(r.occlusionTexture,!0)?.id),r.metallicRoughnessTexture&&(o.metallicRoughnessTextureId=this._getInternalTexture(r.metallicRoughnessTexture,!0)?.id)}_setInternalMaterialParameters(e,t,r){null!=e.color&&Ne(e.color,t,r),this._setInternalMaterialTextureParameters(e,t),t.colorTextureTransformMatrix=ne(e.colorTextureTransform),t.normalTextureTransformMatrix=ne(e.normalTextureTransform);const o=null!=e.normalTextureTransform?.scale?e.normalTextureTransform?.scale:d;t.scale=[o[0],o[1]],t.occlusionTextureTransformMatrix=ne(e.occlusionTextureTransform),t.emissiveTextureTransformMatrix=ne(e.emissiveTextureTransform),t.metallicRoughnessTextureTransformMatrix=ne(e.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(t,r=this._materialColor){const o=this._drivenProperties.color,n=this._drivenProperties.opacity;if(o)t.externalColor=S;else{const o=r??null;if(o){const r=e.toUnitRGBA(o);n&&(r[3]=1),t.externalColor=r}else t.externalColor=fe}t.colorMixMode=this.symbolLayer.material?.colorMixMode??"multiply",t.castShadows=!!this.symbolLayer.castShadows,t.emissiveStrength=this.symbolLayer?.material?.emissive?.strength??1,t.emissiveSource=re(this.symbolLayer?.material?.emissive?.source??"emissive")}_getOrCreateMaterial(t,r){const o=r.material?.color,n=r.material?.colorTexture,a=r.material?.alphaMode,s="blend"===a,i=!("opaque"===a)&&(Le(t)||null!=o&&o.a<1||n?.transparent||s),l=this._materialProperties(t,r,i),c=this._materialInfoCache.byUid(l.uid);if(c)return this._setInternalMaterialTextureParameters(l,c.material.parameters),c.material;const u={uid:l.uid,material:null,isComponentTransparent:i,alphaMode:r.material?r.material.alphaMode:"opaque"},m=je({normalTexture:l.normalTexture,metallicRoughnessTexture:l.metallicRoughnessTexture,metallicFactor:l.metallic,roughnessFactor:l.roughness,emissiveTexture:l.emissiveTexture,emissiveFactor:e.toUnitRGB(l.emissiveColor),occlusionTexture:l.occlusionTexture}),f={usePBR:this._usePBR(),isSchematic:m,hasVertexColors:l.hasVertexColors,hasSymbolColors:l.hasSymbolVertexColors,hasVertexTangents:l.hasVertexTangents,ambient:P,diffuse:R,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:0,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled,drivenOpacity:this.needsDrivenTransparentPass||u.isComponentTransparent};f.mrrFactors=m?Ae:[l.metallic,l.roughness,Me[2]],r.material&&(f.doubleSided=r.material.doubleSided,f.cullFace=r.material.doubleSided?0:2,f.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(f),this._setMaterialTextureAlphaMode(f,u),this._setInternalMaterialParameters(l,f,u);const p=new we(f,this._context);return u.material=p,this._materialInfoCache.set(l.uid,u),p}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchColor(e,t)}_preparePatchColor(e,t){if(!t.material||"partial"!==t.material.type)return;const r=t.material.diff;if(!r.color||"complete"!==r.color.type||null==r.color.newValue||null==r.color.oldValue)return;const o=r.color.newValue;delete r.color,e.symbolLayerStatePatches.push(()=>{this._updateMaterialParameters(e=>{const t=e.material.parameters;this._setExternalMaterialParameters(t,o),this._setMaterialTextureAlphaMode(t,e),e.material.setParameters({externalColor:t.externalColor})})})}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTextureAlphaMode(e,t){if("auto"===t.alphaMode){const r=this.needsDrivenTransparentPass||t.isComponentTransparent||(e.layerOpacity??1)<1||(e.opacity??1)<1||(e.externalColor?.[3]??1)<1;e.textureAlphaMode=r?3:1}else e.textureAlphaMode="opaque"===t.alphaMode?1:"mask"===t.alphaMode?2:0}_createFaceDebugNormals(e,t){const r=t.length,o=e.spatialReference.isGeographic?20015077/180:1,n=.1*Math.max(e.extent.width*o,e.extent.height*o,e.extent.zmax-e.extent.zmin),s=[],l=[],c=t[0].transformation,u=a(i(),c);for(let a=0;a<r;a++){const e=t[a].attributes.get("position");if(!e)continue;const r=e.data,o=e.indices;for(let t=0;t<o.length;t+=3)Ve(r,o,t,Ze),Fe(r,o,t,Ke,Qe,Xe),x(Ke,Ke,Qe),x(Ke,Ke,Xe),_(Ke,Ke,1/3),y(Ke,Ke,c),s.push(...Ke),T(Ze,Ze,u),b(Ze,Ze),v(Ke,Ke,Ze,n),s.push(...Ke),l.push(l.length),l.push(l.length)}return s.length?new Te(this._debugFaceNormalMaterial,[["position",new ye(s,l,3,!0)]],null,2):null}_createPerVertexDebugVectors(e,t,r,o,n){const l=t.length,c=e.spatialReference.isGeographic?20015077/180:1,u=.1*n*Math.max(e.extent.width*c,e.extent.height*c,e.extent.zmax-e.extent.zmin),m=[],f=[],p=t[0].transformation,h=a(i(),p);"tangent"===r&&s(h,p);for(let a=0;a<l;a++){const e=t[a],o=e.attributes.get("position"),n=e.attributes.get(r);if(!o||!n)continue;const s=o.data,i=o.indices,l=n.data,c=n.indices;for(let t=0;t<i.length;t++){const e=3*i[t],r=c[t]*n.stride;g(Ke,s[e+0],s[e+1],s[e+2]),y(Ke,Ke,p),m.push(...Ke),g(Qe,l[r+0],l[r+1],l[r+2]),T(Qe,Qe,h),b(Qe,Qe),v(Ke,Ke,Qe,u),m.push(...Ke),f.push(f.length),f.push(f.length)}}return m.length?new Te(o,[["position",new ye(m,f,3,!0)]],null,2):null}_createAs3DShape(e,t,r,o){const n=e.geometry;if("mesh"!==n.type)return null;const a=this._createGeometryInfo(n,t,o);if(null==a)return null;const{geometries:s,objectTransformation:i}=a;if(_e.DRAW_MESH_GEOMETRY_NORMALS){const e=this._createPerVertexDebugVectors(n,s,"normal",this._debugVertexNormalMaterial,1),t=this._createPerVertexDebugVectors(n,s,"tangent",this._debugTangentNormalMaterial,.5),r=this._createFaceDebugNormals(n,s);e&&s.push(e),t&&s.push(t),r&&s.push(r)}const l=this._context.layerViewUid,c=new be({geometries:s,layerViewUid:l,graphicUid:o,isElevationSource:!0});c.transformation=i;const u=xe(this.symbolLayer,{opacity:this._getLayerOpacity()}),m=u?new ue(s[0].material,u,this._context.slicePlaneEnabled):null,f=new ce(this,c,null,se,r,m);this._fastUpdateProcessor.onAddGraphic(),f.needsElevationUpdates=ie(r.mode),f.useObjectOriginAsAttachmentOrigin=!0,f.fastTransformUpdatesAllowed=this._fastTransformUpdatesAllowed(n),r.centerInElevationSR=this._getCenterInElevationSR(c.transformation);const{elevationProvider:p,renderCoordsHelper:h}=this._context,d=(e,t)=>le(e,p,r,h,t);return f.alignedSampledElevation=se(f,r,p.spatialReference,d,h),f}_fastTransformUpdatesAllowed(e){const{vertexSpace:t,spatialReference:r}=e;if(!k(t))return!1;const{type:o}=t,{view:n}=this._context.graphicsCoreOwner,{viewingMode:a}=n.state,s=n.spatialReference;return 1===a&&"local"===o||2===a&&q(s,r)&&"georeferenced"===o&&!r.isGeographic}_getElevationSR(){return this._context.elevationProvider.spatialReference??null}_getCenterInElevationSR(e){const t=M(),r=g(nt,e[12],e[13],e[14]);return E(r,this._context.renderCoordsHelper.spatialReference,t,this._getElevationSR()),t}_passthroughReprojectionInfo(e){return 0===e.reprojection&&!!e.objectTransformation}_createPositionBuffer(e,t){const r=e.vertexAttributes.position;let o,n=r;if(0===t.reprojection)return{position:n,georeferencedPositionBuffer:o};const a=1===t.reprojection?t.transformBeforeProject:null;a&&(n=Y(new Float64Array(n.length),n,a));const{normal:s,tangent:i}=e.vertexAttributes;this._passthroughReprojectionInfo(t)||!s&&!i||(o=n);const l=n===r||n===o?new Float64Array(n.length):n;return U(n,e.spatialReference,0,l,this._context.renderCoordsHelper.spatialReference,0),{position:l,georeferencedPositionBuffer:o}}_createNormalBuffer(e,t,r,o){const n=e.vertexAttributes.normal;if(null==n)return null;let a=n;const s=1===o.reprojection?o.transformBeforeProject:null;s&&(a=J(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(0===o.reprojection)return a;if("local"===i){if(!W(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return K(a,0,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return Q(a,0,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return X(a,r,e.spatialReference,t,c,l)}_createTangentBuffer(e,t,r,o){const n=e.vertexAttributes.tangent;if(null==n)return null;let a=n;const s=1===o.reprojection?o.transformBeforeProject:null;s&&(a=Z(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(0===o.reprojection)return a;if("local"===i){if(!W(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return K(a,1,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return Q(a,1,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return ee(a,r,e.spatialReference,t,c,l)}_createSymbolColorBuffer(e){return this._requiresSymbolVertexColors()?new Uint8Array(this._getDrivenUInt8ColorWithNaNSupport(e,this._materialColor,!0)):null}_createBuffers(e,t){const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,n=e.vertexAttributes.uv,a=e.vertexAttributes.tangent;if(o&&o.length!==r.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(a&&a.length/4!=r.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(n&&n.length/2!=r.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const s=this._computeReprojectionInfo(e),{position:i,georeferencedPositionBuffer:l}=this._createPositionBuffer(e,s),c=qe(e),u=this._createSymbolColorBuffer(t),m=this._createNormalBuffer(e,i,l,s),p=this._createTangentBuffer(e,i,l,s),h=n,{transformation:d,position:g,normal:x,tangent:_}=this._passthroughReprojectionInfo(s)?{transformation:s.objectTransformation,position:i,normal:m,tangent:p}:this._transformOriginLocal(e,i,m,p);return{positionBuffer:g,normalBuffer:x,tangentBuffer:_,uvBuffer:h,colorBuffer:c,symbolColorBuffer:u,objectTransformation:d,geometryTransformation:0===s.reprojection&&s.geometryTransformation?s.geometryTransformation:f()}}_computeReprojectionInfo(e){const{vertexSpace:t}=e,r="georeferenced"===t.type?q(this._context.renderCoordsHelper.spatialReference,e.spatialReference)?0:1:0;if(z(t))return{reprojection:r};const o=t.origin,n=f(),a=e.transform?.localMatrix??p;if(0===r){B(e.spatialReference,o,n,this._context.renderCoordsHelper.spatialReference);return{reprojection:r,objectTransformation:n,geometryTransformation:h(a)}}const s=l(f(),o);return c(s,s,a),{reprojection:r,transformBeforeProject:s}}_transformOriginLocal(e,t,r,o){const n=this._context.renderCoordsHelper.spatialReference,a=e.origin;Je[0]=a.x,Je[1]=a.y,Je[2]=a.z??0;const s=f();B(e.spatialReference,Je,s,n),u(et,s);const{position:i,normal:l,tangent:c}=e.vertexAttributes,m=t===i?new Float64Array(t.length):t;Y(m,t,et);const p=r?r===l?new Float32Array(r.length):r:null,h=o?o===c?new Float32Array(o.length):o:null;return r&&p&&J(r,p,et),o&&h&&Z(o,h,et),{transformation:s,position:m,normal:p,tangent:h}}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,o=t.faces;if(o){let e=-1;for(let t=0;t<o.length;t++){const r=o[t];r>e&&(e=r)}if(r<=e)return this.logger.warn(`Vertex index ${e} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes?.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference,o=te(e,r??e.spatialReference);return!!o&&(O(o,rt),!V(rt,this._context.clippingExtent))}_createGeometryInfo(e,t,r){if(!I(e.spatialReference,this._context.renderCoordsHelper.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(!this._validateVertexSpace(e))return null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,t);if(null==o)return null;const{positionBuffer:n,uvBuffer:a,colorBuffer:s,symbolColorBuffer:i,normalBuffer:l,tangentBuffer:c,objectTransformation:u,geometryTransformation:f}=o,p=e.components??ot,h=new Array;let d=!1;const g=m(Ke,u),x=this._context.localOriginFactory.getOrigin(g);for(const m of p){if(!this._validateFaces(e,m))return null;const t=Ie(e,m);if(0===t.length)continue;const o=Be(n,l,m,t);o.didFlipNormals&&(d=!0);const u=[["position",new ye(n,t,3,!0)],["normal",new ye(o.normals,o.indices,3,!0)]];s&&u.push(["color",new ye(s,t,4,!0)]),i&&u.push(["symbolColor",new ye(i,G(t.length),4,!0)]),a&&u.push(["uv0",new ye(a,t,2,!0)]),c&&u.push(["tangent",new ye(c,t,4,!0)]);const p=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerViewUid:this._context.layerViewUid}),g=this._getOrCreateMaterial(e,m),_=new Te(g,u,null,0,p);_.transformation=f,_.localOrigin=x,h.push(_)}return d&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:h,objectTransformation:u}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial((e,t)=>{t.setParameters(e.parameters)})}_validateVertexSpace(e){const{_context:{graphicsCoreOwner:{view:{state:{viewingMode:t}}}}}=this,{vertexSpace:r}=e;return 2!==t||"local"!==r.type||(this.logger.warn("Displaying a mesh with a local vertex space in a view in local viewing mode is not supported."),!1)}test(){return{...super.test(),materials:this._materialInfoCache.materials}}get _materialColor(){return this.symbolLayer.material?.color}}class Se{constructor(e,t,r){this.normals=e,this.indices=t,this.didFlipNormals=r}}function Ie(e,t){return t.faces??D(e.vertexAttributes.position.length/3)}function Be(e,t,r,o){switch(r.shading||"flat"){default:case"source":return Ee(e,t,r,o);case"flat":return Ue(e,o);case"smooth":return Oe(e,o)}}function Ue(e,t){const r=$(t.length),o=new Array(3*t.length);for(let n=0;n<t.length;n+=3){const a=Ve(e,t,n,Ze);for(let e=0;e<3;e++)r[n+e]=a[e],o[n+e]=n/3}return new Se(r,o,!1)}function Ee(e,t,r,o){if(null==t)return Ue(e,o);let n=!1;if(!r.trustSourceNormals)for(let a=0;a<o.length;a+=3){Ve(e,o,a,Ze);for(let e=0;e<3;e++){const r=3*o[a+e];Ke[0]=t[r],Ke[1]=t[r+1],Ke[2]=t[r+2],j(Ze,Ke)<0&&(t[r]=-t[r],t[r+1]=-t[r+1],t[r+2]=-t[r+2],n=!0)}}return new Se(t,o,n)}function Oe(e,t){const r={};for(let a=0;a<t.length;a+=3){const o=Ve(e,t,a,Ze);for(let e=0;e<3;e++){const n=t[a+e];let s=r[n];s||(s={normal:M(),count:0},r[n]=s),x(s.normal,s.normal,o),s.count++}}const o=$(3*t.length),n=new Array(3*t.length);for(let a=0;a<t.length;a++){const e=r[t[a]];1!==e.count&&(b(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)o[3*a+t]=e.normal[t];n[a]=a}return new Se(o,n,!1)}function Fe(e,t,r,o,n,a){const s=3*t[r],i=3*t[r+1],l=3*t[r+2];o[0]=e[s],o[1]=e[s+1],o[2]=e[s+2],n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],a[0]=e[l],a[1]=e[l+1],a[2]=e[l+2]}function Ve(e,t,r,o){return Fe(e,t,r,Ke,Qe,Xe),w(Qe,Qe,Ke),w(Xe,Xe,Ke),C(Ke,Qe,Xe),b(o,Ke),o}function $e(e){if(!e)return null;const{scale:t,offset:o,rotation:n}=e;return{scale:t,offset:o,rotation:r(n)}}function Ge(e="repeat"){if("string"==typeof e){const t=De(e);return{s:t,t}}return{s:De(e.horizontal),t:De(e.vertical)}}function De(e){switch(e){case"clamp":return 33071;case"mirror":return 33648;default:return 10497}}function Le(e){const t=e.vertexAttributes.color;if(null==t)return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}function Ne(t,r,o){r.diffuse=e.toUnitRGB(t),r.opacity="opaque"===o.alphaMode?1:t.a}function He(e){return e.data??e.url}function ke(t){return null==t?"-":t instanceof e?t.toHex():t.contentHash}function ze(e){const{offset:t,scale:r,rotation:o}=e??Ye;return`${t[0]},${t[1]},${o},${r[0]},${r[1]}`}function qe(e){return e.vertexAttributes.color}function We(e){return 1===(e.material?.color?.a??0)}const Ye=new H,Je=M(),Ke=M(),Qe=M(),Xe=M(),Ze=M(),et=f(),tt=f(),rt=F(),ot=[new L],nt=M();export{Pe as Graphics3DMeshFillSymbolLayer};
5
+ import e from"../../../../Color.js";import{linearize as t}from"../../../../colorUtils.js";import"../../../../core/has.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{releaseMaybe as o}from"../../../../core/maybe.js";import{isPromiseLike as n}from"../../../../core/promiseUtils.js";import{normalFromMat4 as a,fromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromTranslation as l,multiply as c,invert as u,getTranslation as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f,IDENTITY as p,clone as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{j as g,g as x,h as _,t as y,o as T,n as b,c as v,e as w,i as C,f as j}from"../../../../chunks/vec32.js";import{create as M,fromValues as A,ONES as R,ZEROS as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{canProjectWithoutEngine as I}from"../../../../geometry/projectionUtils.js";import{computeTranslationToOriginAndRotation as B}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as U}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as E}from"../../../../geometry/projection/projectVectorToVector.js";import{fromBuffer as O,create as F,intersectsClippingArea as V}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as $}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as G,getContinuousIndexArray as D}from"../../../../geometry/support/Indices.js";import L from"../../../../geometry/support/MeshComponent.js";import N from"../../../../geometry/support/MeshMaterialMetallicRoughness.js";import H from"../../../../geometry/support/MeshTextureTransform.js";import{isRelativeVertexSpace as k,isAbsoluteVertexSpace as z}from"../../../../geometry/support/meshVertexSpaceUtils.js";import{equals as q,isPlateCarree as W}from"../../../../geometry/support/spatialReferenceUtils.js";import{t as Y}from"../../../../chunks/vec3.js";import{transformNormal as J,transformVectorENUPlateCarree as K,transformVectorWMPlateCarree as Q,projectNormalToPCPF as X,transformTangent as Z,projectTangentToPCPF as ee}from"../../../../geometry/support/meshUtils/projection.js";import{projectMeshVertexPositions as te}from"../../../../geometry/support/meshUtils/projectMeshVertexPositions.js";import{getEmissiveMode as re}from"../../../../symbols/support/materialUtils.js";import{isEncodedMeshTexture as oe}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as ne}from"../../glTF/internal/TextureTransformUtils.js";import{defaultSymbolLayerMemoryComplexity as ae}from"./defaultSymbolComplexity.js";import{perObjectElevationAligner as se}from"./ElevationAligners.js";import{needsElevationUpdates3D as ie,evaluateElevationInfoAtPoint as le}from"./elevationAlignmentUtils.js";import{Graphics3DMeshObject3DGraphicLayer as ce}from"./Graphics3DMeshObject3DGraphicLayer.js";import{Object3DEdgeState as ue}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as me,nanFallbackColor as fe}from"./Graphics3DSymbolLayer.js";import{MaterialInfoCache as pe,MeshFastUpdateProcessor as he}from"./MeshFastUpdateProcessor.js";import{SymbolComplexity as de}from"./SymbolComplexity.js";import{hasEdges as ge,createMaterial as xe}from"../support/edgeUtils.js";import{debugFlags as _e}from"../../support/debugFlags.js";import{Attribute as ye}from"../../webgl-engine/lib/Attribute.js";import{Geometry as Te}from"../../webgl-engine/lib/Geometry.js";import{Object3D as be}from"../../webgl-engine/lib/Object3D.js";import{Texture as ve}from"../../webgl-engine/lib/Texture.js";import{DefaultMaterial as we}from"../../webgl-engine/materials/DefaultMaterial.js";import{NativeLineMaterial as Ce}from"../../webgl-engine/materials/NativeLineMaterial.js";import{useSchematicPBR as je,advancedMRRFactors as Me,schematicMRRFactors as Ae}from"../../webgl-engine/materials/pbrUtils.js";const Re=["mesh"];class Pe extends me{constructor(e,t,r,o){super(e,t,r,o,We(t)),this._materialInfoCache=new pe,this._fastUpdateProcessor=new he,this._textures=new Map,this.ensureDrapedStatus(!1)}async doLoad(){_e.DRAW_MESH_GEOMETRY_NORMALS&&(this._debugVertexNormalMaterial=new Ce({color:[1,0,1,1]}),this._debugTangentNormalMaterial=new Ce({color:[1,.5,0,1]}),this._debugFaceNormalMaterial=new Ce({color:[0,1,1,1]})),this.updateComplexity()}destroy(){super.destroy(),this._textures.forEach(e=>e.unload()),this._context.stage.removeTextures(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy()}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,Re,"fill on mesh-3d"))return null;const r=this.createElevationContextForGraphic(t),o=e.renderingInfo;return this._createAs3DShape(t,o,r,t.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache)}layerOpacityChanged(e,t){const r=this._getLayerOpacity();this._updateMaterialParameters(e=>{e.material.setParameters({layerOpacity:r});const t=e.material.parameters;this._setMaterialTextureAlphaMode(t,e)}),e?.forEach(e=>t(e)?.layerOpacityChanged(r,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,ie)}slicePlaneEnabledChanged(e,t){return this._updateMaterialParameters(({material:e})=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),e?.forEach(e=>t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters(({material:t})=>t.setParameters({usePBR:e})),!0}updateTransform(e,t,r,o){if(!e.fastTransformUpdatesAllowed)return!1;const n=e.fastTransformUpdatesEnabled;switch(o){case 0:if(n)return!0;break;case 1:if(!n)return!0;break;default:if(!n)return!!this.updateTransform(e,t,r,0)&&(e.autoDisableFastTransformUpdates(()=>this.updateTransform(e,t,r,1)),!0)}const a=this._context.renderCoordsHelper.spatialReference,s=tt,{origin:i,transform:l}=r;if(!B(t,g(Ke,i.x,i.y,i.z??0),s,a))return!1;switch(o){case 0:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case 1:this._fastUpdateProcessor.disable(e,this._materialInfoCache);break;case 2:e.updateFastLocalOrigin(s,l,this._context.localOriginFactory)}const{elevationContext:c}=e;c.centerInElevationSR=this._getCenterInElevationSR(s);const{elevationProvider:u,renderCoordsHelper:m}=this._context,f=(e,t)=>le(e,u,c,m,t);return e.alignedSampledElevation=se(e,c,u.spatialReference,f,m,s),e.updateTransform(s,l,this._context.isAsync),e.updateAutoDisableFastTransformUpdates(()=>this.updateTransform(e,t,r,1)),!0}computeComplexity(){if(!this._textures||0===this._textures.size)return super.computeComplexity();let e=0;for(const o of this._textures.values())e+=o.usedMemory;const t={...ae(this.symbol,this.symbolLayer),resourceBytes:e},r=ge(this.symbolLayer)?2:0;return new de({drawCallsPerFeature:r,memory:t})}_requiresSymbolVertexColors(){return this._hasDrivenColorOrOpacity}_materialPropertiesDefault(e,t){const r=this._requiresSymbolVertexColors(),o=!!e.vertexAttributes.color,n=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:o,hasVertexTangents:n,uid:`vc:${o},vt:${n},vct${t},svc:${r}`}}_materialProperties(e,t,r){const o=this._materialPropertiesDefault(e,r);if(!t.material)return o;const{color:n,colorTexture:a,colorTextureTransform:s,normalTexture:i,normalTextureTransform:l,doubleSided:c,alphaCutoff:u,alphaMode:m}=t.material,f=ke(n),p=ke(a),h=ze(s),d=ke(i),g=ze(l);if(o.color=n,o.colorTexture=a,o.normalTexture=i,o.uid=`${o.uid},cmuid:${f},ctmuid:${p},cttuid:${h},ntmuid:${d},nttuid:${g},ds:${c},ac:${u},am:${m}`,t.material instanceof N){const{metallic:e,roughness:r,metallicRoughnessTexture:n,metallicRoughnessTextureTransform:a,emissiveColor:i,emissiveTexture:c,emissiveTextureTransform:u,occlusionTexture:m,occlusionTextureTransform:f}=t.material,p=ke(n),h=ze(a),d=ke(i),g=ke(c),x=ze(u),_=ke(m),y=ze(f);o.uid=`${o.uid},mrm:${e},mrr:${r},mrt:${p},mrtt:${h},emuid:${d},etmuid:${g},ett:${x},otmuid:${_},ott:${y}`,o.metallic=e,o.roughness=r,o.metallicRoughnessTexture=n,o.emissiveColor=i,o.emissiveTexture=c,o.occlusionTexture=m,o.colorTextureTransform=$e(s),o.normalTextureTransform=$e(l),o.emissiveTextureTransform=$e(u),o.occlusionTextureTransform=$e(f),o.metallicRoughnessTextureTransform=$e(a)}return o}_getInternalTexture(e,t=!1,r=1){const a=He(e);if(!a)return null;const s=`${e.contentHash}/${r}`;let i=this._textures.get(s);if(i){const e=this._context.stage.renderView.textures;let t=null;const r=e.acquire(i.id);return null==r||n(r)||(i.events.on("unloaded",()=>t=o(t)),t=r),i}let l=null;const c=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,u={wrap:Ge(e.wrap),noUnpackFlip:!0,maxAnisotropy:c,mipmap:c>1};return oe(a)?(l=a.data,u.preMultiplyAlpha=!1,u.encoding=a.encoding):(l=a,u.preMultiplyAlpha=1!==r,u.compressionOptions=t?{compressionTracker:this._context.compressionTracker,compressionCallback:()=>this.updateComplexity()}:void 0),i=new ve(l,u),this._textures.set(s,i),i.events.on("loaded",()=>this.updateComplexity()),i.load(this._context.stage.renderView.renderingContext),this._context.stage.addTexture(i),i.events.on("unloaded",()=>{this._textures.delete(s)}),i}_setInternalMaterialTextureParameters(r,o){if(null!=r.colorTexture){const e=1!==o.textureAlphaMode,t=this._getInternalTexture(r.colorTexture,e,o.textureAlphaMode);t?(o.textureId=t.id,o.textureAlphaPremultiplied=!!t.parameters.preMultiplyAlpha):o.textureId=void 0}if(r.normalTexture&&(o.normalTextureId=this._getInternalTexture(r.normalTexture)?.id),r.emissiveColor){const n=e.toUnitRGB(r.emissiveColor);o.emissiveBaseColor=A(t(n[0]),t(n[1]),t(n[2]))}r.emissiveTexture&&(o.emissiveTextureId=this._getInternalTexture(r.emissiveTexture)?.id),r.occlusionTexture&&(o.occlusionTextureId=this._getInternalTexture(r.occlusionTexture,!0)?.id),r.metallicRoughnessTexture&&(o.metallicRoughnessTextureId=this._getInternalTexture(r.metallicRoughnessTexture,!0)?.id)}_setInternalMaterialParameters(e,t,r){null!=e.color&&Ne(e.color,t,r),this._setInternalMaterialTextureParameters(e,t),t.colorTextureTransformMatrix=ne(e.colorTextureTransform),t.normalTextureTransformMatrix=ne(e.normalTextureTransform);const o=null!=e.normalTextureTransform?.scale?e.normalTextureTransform?.scale:d;t.scale=[o[0],o[1]],t.occlusionTextureTransformMatrix=ne(e.occlusionTextureTransform),t.emissiveTextureTransformMatrix=ne(e.emissiveTextureTransform),t.metallicRoughnessTextureTransformMatrix=ne(e.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(t,r=this._materialColor){const o=this._drivenProperties.color,n=this._drivenProperties.opacity;if(o)t.externalColor=S;else{const o=r??null;if(o){const r=e.toUnitRGBA(o);n&&(r[3]=1),t.externalColor=r}else t.externalColor=fe}t.colorMixMode=this.symbolLayer.material?.colorMixMode??"multiply",t.castShadows=!!this.symbolLayer.castShadows,t.emissiveStrength=this.symbolLayer?.material?.emissive?.strength??1,t.emissiveSource=re(this.symbolLayer?.material?.emissive?.source??"emissive")}_getOrCreateMaterial(t,r){const o=r.material?.color,n=r.material?.colorTexture,a=r.material?.alphaMode,s="blend"===a,i=!("opaque"===a)&&(Le(t)||null!=o&&o.a<1||n?.transparent||s),l=this._materialProperties(t,r,i),c=this._materialInfoCache.byUid(l.uid);if(c)return this._setInternalMaterialTextureParameters(l,c.material.parameters),c.material;const u={uid:l.uid,material:null,isComponentTransparent:i,alphaMode:r.material?r.material.alphaMode:"opaque"},m=je({normalTexture:l.normalTexture,metallicRoughnessTexture:l.metallicRoughnessTexture,metallicFactor:l.metallic,roughnessFactor:l.roughness,emissiveTexture:l.emissiveTexture,emissiveFactor:e.toUnitRGB(l.emissiveColor),occlusionTexture:l.occlusionTexture}),f={usePBR:this._usePBR(),isSchematic:m,hasVertexColors:l.hasVertexColors,hasSymbolColors:l.hasSymbolVertexColors,hasVertexTangents:l.hasVertexTangents,ambient:P,diffuse:R,opacity:1,doubleSided:!0,doubleSidedType:"winding-order",cullFace:0,layerOpacity:this._getLayerOpacity(),hasSlicePlane:this._context.slicePlaneEnabled,drivenOpacity:this.needsDrivenTransparentPass||u.isComponentTransparent};f.mrrFactors=m?Ae:[l.metallic,l.roughness,Me[2]],r.material&&(f.doubleSided=r.material.doubleSided,f.cullFace=r.material.doubleSided?0:2,f.textureAlphaCutoff=r.material.alphaCutoff),this._setExternalMaterialParameters(f),this._setMaterialTextureAlphaMode(f,u),this._setInternalMaterialParameters(l,f,u);const p=new we(f,this._context);return u.material=p,this._materialInfoCache.set(l.uid,u),p}prepareSymbolLayerPatch(e){if("partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchColor(e,t)}_preparePatchColor(e,t){if(!t.material||"partial"!==t.material.type)return;const r=t.material.diff;if(!r.color||"complete"!==r.color.type||null==r.color.newValue||null==r.color.oldValue)return;const o=r.color.newValue;delete r.color,e.symbolLayerStatePatches.push(()=>{this._updateMaterialParameters(e=>{const t=e.material.parameters;this._setExternalMaterialParameters(t,o),this._setMaterialTextureAlphaMode(t,e),e.material.setParameters({externalColor:t.externalColor})})})}_usePBR(){return this._context.physicalBasedRenderingEnabled}_setMaterialTextureAlphaMode(e,t){if("auto"===t.alphaMode){const r=this.needsDrivenTransparentPass||t.isComponentTransparent||(e.layerOpacity??1)<1||(e.opacity??1)<1||(e.externalColor?.[3]??1)<1;e.textureAlphaMode=r?3:1}else e.textureAlphaMode="opaque"===t.alphaMode?1:"mask"===t.alphaMode?2:0}_createFaceDebugNormals(e,t){const r=t.length,o=e.spatialReference.isGeographic?20015077/180:1,n=.1*Math.max(e.extent.width*o,e.extent.height*o,e.extent.zmax-e.extent.zmin),s=[],l=[],c=t[0].transformation,u=a(i(),c);for(let a=0;a<r;a++){const e=t[a].attributes.get("position");if(!e)continue;const r=e.data,o=e.indices;for(let t=0;t<o.length;t+=3)Ve(r,o,t,Ze),Fe(r,o,t,Ke,Qe,Xe),x(Ke,Ke,Qe),x(Ke,Ke,Xe),_(Ke,Ke,1/3),y(Ke,Ke,c),s.push(...Ke),T(Ze,Ze,u),b(Ze,Ze),v(Ke,Ke,Ze,n),s.push(...Ke),l.push(l.length),l.push(l.length)}return s.length?new Te(this._debugFaceNormalMaterial,[["position",new ye(s,l,3,!0)]],null,2):null}_createPerVertexDebugVectors(e,t,r,o,n){const l=t.length,c=e.spatialReference.isGeographic?20015077/180:1,u=.1*n*Math.max(e.extent.width*c,e.extent.height*c,e.extent.zmax-e.extent.zmin),m=[],f=[],p=t[0].transformation,h=a(i(),p);"tangent"===r&&s(h,p);for(let a=0;a<l;a++){const e=t[a],o=e.attributes.get("position"),n=e.attributes.get(r);if(!o||!n)continue;const s=o.data,i=o.indices,l=n.data,c=n.indices;for(let t=0;t<i.length;t++){const e=3*i[t],r=c[t]*n.stride;g(Ke,s[e+0],s[e+1],s[e+2]),y(Ke,Ke,p),m.push(...Ke),g(Qe,l[r+0],l[r+1],l[r+2]),T(Qe,Qe,h),b(Qe,Qe),v(Ke,Ke,Qe,u),m.push(...Ke),f.push(f.length),f.push(f.length)}}return m.length?new Te(o,[["position",new ye(m,f,3,!0)]],null,2):null}_createAs3DShape(e,t,r,o){const n=e.geometry;if("mesh"!==n.type)return null;const a=this._createGeometryInfo(n,t,o);if(null==a)return null;const{geometries:s,objectTransformation:i}=a;if(_e.DRAW_MESH_GEOMETRY_NORMALS){const e=this._createPerVertexDebugVectors(n,s,"normal",this._debugVertexNormalMaterial,1),t=this._createPerVertexDebugVectors(n,s,"tangent",this._debugTangentNormalMaterial,.5),r=this._createFaceDebugNormals(n,s);e&&s.push(e),t&&s.push(t),r&&s.push(r)}const l=this._context.layerViewUid,c=new be({geometries:s,layerViewUid:l,graphicUid:o,isElevationSource:!0});c.transformation=i;const u=xe(this.symbolLayer,{opacity:this._getLayerOpacity()}),m=u?new ue(s[0].material,u,this._context.slicePlaneEnabled):null,f=new ce(this,c,null,se,r,m);this._fastUpdateProcessor.onAddGraphic(),f.needsElevationUpdates=ie(r.mode),f.useObjectOriginAsAttachmentOrigin=!0,f.fastTransformUpdatesAllowed=this._fastTransformUpdatesAllowed(n),r.centerInElevationSR=this._getCenterInElevationSR(c.transformation);const{elevationProvider:p,renderCoordsHelper:h}=this._context,d=(e,t)=>le(e,p,r,h,t);return f.alignedSampledElevation=se(f,r,p.spatialReference,d,h),f}_fastTransformUpdatesAllowed(e){const{vertexSpace:t,spatialReference:r}=e;if(!k(t))return!1;const{type:o}=t,{view:n}=this._context.graphicsCoreOwner,{viewingMode:a}=n.state,s=n.spatialReference;return 1===a&&"local"===o||2===a&&q(s,r)&&"georeferenced"===o&&!r.isGeographic}_getElevationSR(){return this._context.elevationProvider.spatialReference??null}_getCenterInElevationSR(e){const t=M(),r=g(nt,e[12],e[13],e[14]);return E(r,this._context.renderCoordsHelper.spatialReference,t,this._getElevationSR()),t}_passthroughReprojectionInfo(e){return 0===e.reprojection&&!!e.objectTransformation}_createPositionBuffer(e,t){const r=e.vertexAttributes.position;let o,n=r;if(0===t.reprojection)return{position:n,georeferencedPositionBuffer:o};const a=1===t.reprojection?t.transformBeforeProject:null;a&&(n=Y(new Float64Array(n.length),n,a));const{normal:s,tangent:i}=e.vertexAttributes;this._passthroughReprojectionInfo(t)||!s&&!i||(o=n);const l=n===r||n===o?new Float64Array(n.length):n;return U(n,e.spatialReference,0,l,this._context.renderCoordsHelper.spatialReference,0),{position:l,georeferencedPositionBuffer:o}}_createNormalBuffer(e,t,r,o){const n=e.vertexAttributes.normal;if(null==n)return null;let a=n;const s=1===o.reprojection?o.transformBeforeProject:null;s&&(a=J(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(0===o.reprojection)return a;if("local"===i){if(!W(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return K(a,0,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return Q(a,0,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return X(a,r,e.spatialReference,t,c,l)}_createTangentBuffer(e,t,r,o){const n=e.vertexAttributes.tangent;if(null==n)return null;let a=n;const s=1===o.reprojection?o.transformBeforeProject:null;s&&(a=Z(a,new Float32Array(a.length),s));const i=this._context.graphicsCoreOwner.view.viewingMode;if(0===o.reprojection)return a;if("local"===i){if(!W(this._context.renderCoordsHelper.spatialReference))return a;if(null==r)return null;if(e.spatialReference.isGeographic){const e=a===n?new Float32Array(a.length):a;return K(a,1,r,e)}if(e.spatialReference.isWebMercator){const e=a===n?new Float32Array(a.length):a;return Q(a,1,r,e)}return a}if(null==r)return null;const l=a===n?new Float32Array(a.length):a,c=this._context.renderCoordsHelper.spatialReference;return ee(a,r,e.spatialReference,t,c,l)}_createSymbolColorBuffer(e){return this._requiresSymbolVertexColors()?new Uint8Array(this._getDrivenUInt8ColorWithNaNSupport(e,this._materialColor,!0)):null}_createBuffers(e,t){const r=e.vertexAttributes&&e.vertexAttributes.position;if(!r)return this.logger.warn("Mesh geometry must contain position vertex attributes"),null;const o=e.vertexAttributes.normal,n=e.vertexAttributes.uv,a=e.vertexAttributes.tangent;if(o&&o.length!==r.length)return this.logger.warn("Mesh normal vertex buffer must contain the same number of elements as the position buffer"),null;if(a&&a.length/4!=r.length/3)return this.logger.warn("Mesh tangent vertex buffer must contain the same number of elements as the position buffer"),null;if(n&&n.length/2!=r.length/3)return this.logger.warn("Mesh uv vertex buffer must contain the same number of elements as the position buffer"),null;const s=this._computeReprojectionInfo(e),{position:i,georeferencedPositionBuffer:l}=this._createPositionBuffer(e,s),c=qe(e),u=this._createSymbolColorBuffer(t),m=this._createNormalBuffer(e,i,l,s),p=this._createTangentBuffer(e,i,l,s),h=n,{transformation:d,position:g,normal:x,tangent:_}=this._passthroughReprojectionInfo(s)?{transformation:s.objectTransformation,position:i,normal:m,tangent:p}:this._transformOriginLocal(e,i,m,p);return{positionBuffer:g,normalBuffer:x,tangentBuffer:_,uvBuffer:h,colorBuffer:c,symbolColorBuffer:u,objectTransformation:d,geometryTransformation:0===s.reprojection&&s.geometryTransformation?s.geometryTransformation:f()}}_computeReprojectionInfo(e){const{vertexSpace:t}=e,r="georeferenced"===t.type?q(this._context.renderCoordsHelper.spatialReference,e.spatialReference)?0:1:0;if(z(t))return{reprojection:r};const o=t.origin,n=f(),a=e.transform?.localMatrix??p;if(0===r){B(e.spatialReference,o,n,this._context.renderCoordsHelper.spatialReference);return{reprojection:r,objectTransformation:n,geometryTransformation:h(a)}}const s=l(f(),o);return c(s,s,a),{reprojection:r,transformBeforeProject:s}}_transformOriginLocal(e,t,r,o){const n=this._context.renderCoordsHelper.spatialReference,a=e.origin;Je[0]=a.x,Je[1]=a.y,Je[2]=a.z??0;const s=f();B(e.spatialReference,Je,s,n),u(et,s);const{position:i,normal:l,tangent:c}=e.vertexAttributes,m=t===i?new Float64Array(t.length):t;Y(m,t,et);const p=r?r===l?new Float32Array(r.length):r:null,h=o?o===c?new Float32Array(o.length):o:null;return r&&p&&J(r,p,et),o&&h&&Z(o,h,et),{transformation:s,position:m,normal:p,tangent:h}}_validateFaces(e,t){const r=e.vertexAttributes.position.length/3,o=t.faces;if(o){let e=-1;for(let t=0;t<o.length;t++){const r=o[t];r>e&&(e=r)}if(r<=e)return this.logger.warn(`Vertex index ${e} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_isOutsideClippingArea(e){if(!this._context.clippingExtent)return!1;const t=e.vertexAttributes?.position;if(!t)return!1;const r=this._context.elevationProvider.spatialReference,o=te(e,r??e.spatialReference);return!!o&&(O(o,rt),!V(rt,this._context.clippingExtent))}_createGeometryInfo(e,t,r){if(!I(e.spatialReference,this._context.renderCoordsHelper.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(!this._validateVertexSpace(e))return null;if(this._isOutsideClippingArea(e))return null;const o=this._createBuffers(e,t);if(null==o)return null;const{positionBuffer:n,uvBuffer:a,colorBuffer:s,symbolColorBuffer:i,normalBuffer:l,tangentBuffer:c,objectTransformation:u,geometryTransformation:f}=o,p=e.components??ot,h=new Array;let d=!1;const g=m(Ke,u),x=this._context.localOriginFactory.getOrigin(g);for(const m of p){if(!this._validateFaces(e,m))return null;const t=Ie(e,m);if(0===t.length)continue;const o=Be(n,l,m,t);o.didFlipNormals&&(d=!0);const u=[["position",new ye(n,t,3,!0)],["normal",new ye(o.normals,o.indices,3,!0)]];s&&u.push(["color",new ye(s,t,4,!0)]),i&&u.push(["symbolColor",new ye(i,G(t.length),4,!0)]),a&&u.push(["uv0",new ye(a,t,2,!0)]),c&&u.push(["tangent",new ye(c,t,4,!0)]);const p=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerViewUid:this._context.layerViewUid}),g=this._getOrCreateMaterial(e,m),_=new Te(g,u,null,0,p);_.transformation=f,_.localOrigin=x,h.push(_)}return d&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:h,objectTransformation:u}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial((e,t)=>{t.setParameters(e.parameters)})}_validateVertexSpace(e){const{_context:{graphicsCoreOwner:{view:{state:{viewingMode:t}}}}}=this,{vertexSpace:r}=e;return 2!==t||"local"!==r.type||(this.logger.warn("Displaying a mesh with a local vertex space in a view in local viewing mode is not supported."),!1)}test(){return{...super.test(),materials:this._materialInfoCache.materials}}get _materialColor(){return this.symbolLayer.material?.color}}class Se{constructor(e,t,r){this.normals=e,this.indices=t,this.didFlipNormals=r}}function Ie(e,t){return t.faces??D(e.vertexAttributes.position.length/3)}function Be(e,t,r,o){switch(r.shading||"flat"){default:case"source":return Ee(e,t,r,o);case"flat":return Ue(e,o);case"smooth":return Oe(e,o)}}function Ue(e,t){const r=$(t.length),o=new Array(3*t.length);for(let n=0;n<t.length;n+=3){const a=Ve(e,t,n,Ze);for(let e=0;e<3;e++)r[n+e]=a[e],o[n+e]=n/3}return new Se(r,o,!1)}function Ee(e,t,r,o){if(null==t)return Ue(e,o);let n=!1;if(!r.trustSourceNormals)for(let a=0;a<o.length;a+=3){Ve(e,o,a,Ze);for(let e=0;e<3;e++){const r=3*o[a+e];Ke[0]=t[r],Ke[1]=t[r+1],Ke[2]=t[r+2],j(Ze,Ke)<0&&(t[r]=-t[r],t[r+1]=-t[r+1],t[r+2]=-t[r+2],n=!0)}}return new Se(t,o,n)}function Oe(e,t){const r={};for(let a=0;a<t.length;a+=3){const o=Ve(e,t,a,Ze);for(let e=0;e<3;e++){const n=t[a+e];let s=r[n];s||(s={normal:M(),count:0},r[n]=s),x(s.normal,s.normal,o),s.count++}}const o=$(3*t.length),n=new Array(3*t.length);for(let a=0;a<t.length;a++){const e=r[t[a]];1!==e.count&&(b(e.normal,e.normal),e.count=1);for(let t=0;t<3;t++)o[3*a+t]=e.normal[t];n[a]=a}return new Se(o,n,!1)}function Fe(e,t,r,o,n,a){const s=3*t[r],i=3*t[r+1],l=3*t[r+2];o[0]=e[s],o[1]=e[s+1],o[2]=e[s+2],n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],a[0]=e[l],a[1]=e[l+1],a[2]=e[l+2]}function Ve(e,t,r,o){return Fe(e,t,r,Ke,Qe,Xe),w(Qe,Qe,Ke),w(Xe,Xe,Ke),C(Ke,Qe,Xe),b(o,Ke),o}function $e(e){if(!e)return null;const{scale:t,offset:o,rotation:n}=e;return{scale:t,offset:o,rotation:r(n)}}function Ge(e="repeat"){if("string"==typeof e){const t=De(e);return{s:t,t}}return{s:De(e.horizontal),t:De(e.vertical)}}function De(e){switch(e){case"clamp":return 33071;case"mirror":return 33648;default:return 10497}}function Le(e){const t=e.vertexAttributes.color;if(null==t)return!1;for(let r=3;r<t.length;r+=4)if(255!==t[r])return!0;return!1}function Ne(t,r,o){r.diffuse=e.toUnitRGB(t),r.opacity="opaque"===o.alphaMode?1:t.a}function He(e){return e.data??e.url}function ke(t){return null==t?"-":t instanceof e?t.toHex():t.contentHash}function ze(e){const{offset:t,scale:r,rotation:o}=e??Ye;return`${t[0]},${t[1]},${o},${r[0]},${r[1]}`}function qe(e){return e.vertexAttributes.color}function We(e){return 1===(e.material?.color?.a??0)}const Ye=new H,Je=M(),Ke=M(),Qe=M(),Xe=M(),Ze=M(),et=f(),tt=f(),rt=F(),ot=[new L],nt=M();export{Pe as Graphics3DMeshFillSymbolLayer};