@agrotools1/at-components 0.2.0 → 0.2.2

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 (553) hide show
  1. package/dist/AGraphicContainer-98a4c8a4.js +109 -0
  2. package/dist/APIKeyMixin-9511e0a5.js +19 -0
  3. package/dist/Analysis-4b1d1fb5.js +31 -0
  4. package/dist/ArcGISCachedService-93e2cb27.js +47 -0
  5. package/dist/ArcGISService-3f8d89c1.js +25 -0
  6. package/dist/AreaMeasurement2D-e0bb230c.js +405 -0
  7. package/dist/AreaMeasurement3D-a9959ecf.js +488 -0
  8. package/dist/AttachmentInfo-601c56e2.js +34 -0
  9. package/dist/AttachmentQuery-3504d550.js +18 -0
  10. package/dist/AttributeStore-b90878e3.js +1707 -0
  11. package/dist/BaseDynamicLayerView2D-b2faf028.js +63 -0
  12. package/dist/BindType-5e76c8e1.js +7 -0
  13. package/dist/BingMapsLayer-5d79fe2b.js +112 -0
  14. package/dist/Bitmap-f775c851.js +128 -0
  15. package/dist/BitmapContainer-af5942b8.js +23 -0
  16. package/dist/BlendLayer-a792edf6.js +13 -0
  17. package/dist/BoundsStore-789624df.js +63 -0
  18. package/dist/BufferObject-cbd0168e.js +100 -0
  19. package/dist/BufferView-004ad517.js +683 -0
  20. package/dist/BuildingSceneLayer-25bc760b.js +535 -0
  21. package/dist/Button/Button.d.ts +24 -2
  22. package/dist/Button-70963624.js +36 -0
  23. package/dist/ByteSizeUnit-90df2840.js +7 -0
  24. package/dist/CSVLayer-fd3b6750.js +208 -0
  25. package/dist/CSVSourceWorker-eb24cd85.js +367 -0
  26. package/dist/CatalogDynamicGroupLayerView2D-dfc700a4.js +66 -0
  27. package/dist/CatalogFootprintLayerView2D-6eb16597.js +76 -0
  28. package/dist/CatalogLayer-1cc632fe.js +262 -0
  29. package/dist/CatalogLayerView2D-d143aa34.js +52 -0
  30. package/dist/Chips/index.d.ts +1 -0
  31. package/dist/CircularArray-b2bc1dfd.js +40 -0
  32. package/dist/ClassBreaksDefinition-07ba0c64.js +18 -0
  33. package/dist/ColorMaterial.glsl-e7801766.js +64 -0
  34. package/dist/ColorSet-df5696b5.js +45 -0
  35. package/dist/ColorStop-7187f368.js +29 -0
  36. package/dist/Container-ac97765a.js +521 -0
  37. package/dist/CustomParametersMixin-b3432b3e.js +12 -0
  38. package/dist/DatePicker/DatePicker.helper.d.ts +22 -0
  39. package/dist/DatePicker/DatePickerCalendar/DatePickerCalendar.helper.d.ts +18 -0
  40. package/dist/DatePicker/index.d.ts +2 -0
  41. package/dist/DefaultMaterial.glsl-3cc4efe7.js +42 -0
  42. package/dist/DefaultMaterial_COLOR_GAMMA-337c63aa.js +653 -0
  43. package/dist/DefaultTheme-12dffc66.js +130 -0
  44. package/dist/DeleteForwardEditsParameters-ae76d898.js +18 -0
  45. package/dist/DimensionLayer-9eb47c76.js +129 -0
  46. package/dist/DirectLineMeasurement3D-e9903136.js +449 -0
  47. package/dist/DistanceMeasurement2D-a4853462.js +303 -0
  48. package/dist/DoubleArray-5076283e.js +25 -0
  49. package/dist/EdgeProcessingWorker-c1783ddd.js +63 -0
  50. package/dist/EditBusLayer-e812f4c9.js +107 -0
  51. package/dist/ElevationInfo-fad03d5e.js +56 -0
  52. package/dist/ElevationLayer-397792d5.js +129 -0
  53. package/dist/ElevationQuery-beceb62f.js +598 -0
  54. package/dist/ElevationSamplerWorker-0048a204.js +62 -0
  55. package/dist/ExportImageParameters-c6c4bc61.js +66 -0
  56. package/dist/ExportStrategy-908f5b8d.js +93 -0
  57. package/dist/ExportWMSImageParameters-34da6b46.js +33 -0
  58. package/dist/External-14daf0c1.js +110 -0
  59. package/dist/FeatureCollectionSnappingSource-f97a1829.js +130 -0
  60. package/dist/FeatureCommandQueue-d4817eac.js +1244 -0
  61. package/dist/FeatureEffect-08976bbd.js +39 -0
  62. package/dist/FeatureEffectLayer-05c258f4.js +13 -0
  63. package/dist/FeatureFilter-8c5e44b1.js +27 -0
  64. package/dist/FeatureLayer-d3659466.js +693 -0
  65. package/dist/FeatureLayerBase-9b63f732.js +148 -0
  66. package/dist/FeatureLayerSource-960f1c01.js +444 -0
  67. package/dist/FeatureLayerView2D-7503e1ed.js +1967 -0
  68. package/dist/FeaturePipelineWorker-d4301d2a.js +3633 -0
  69. package/dist/FeatureReductionLayer-e6cf73ac.js +225 -0
  70. package/dist/FeatureReductionSelection-d90249a7.js +22 -0
  71. package/dist/FeatureServiceSnappingSource-9e49ca72.js +481 -0
  72. package/dist/FeatureServiceSnappingSourceWorker-39b093b3.js +747 -0
  73. package/dist/FeatureSet-d79f0e48.js +188 -0
  74. package/dist/FeatureStore-eb4b87c0.js +131 -0
  75. package/dist/FeatureTemplate-edb1b782.js +12 -0
  76. package/dist/FeatureType-bba29adb.js +25 -0
  77. package/dist/FieldsIndex-75cca4d0.js +109 -0
  78. package/dist/FormTemplate-22911c47.js +350 -0
  79. package/dist/GeoJSONLayer-b33c96b8.js +236 -0
  80. package/dist/GeoJSONSourceWorker-b04ff552.js +247 -0
  81. package/dist/GeoRSSLayer-6e5fcd0e.js +73 -0
  82. package/dist/GeoRSSLayerView2D-21b6b12e.js +140 -0
  83. package/dist/GeometryUtils-fa897cbd.js +403 -0
  84. package/dist/GraphicContainer-1fd6bfce.js +26 -0
  85. package/dist/GraphicManipulator-f3b7dc9b.js +1499 -0
  86. package/dist/GraphicsLayer-e0686779.js +38 -0
  87. package/dist/GraphicsLayerView2D-a7eba2fe.js +114 -0
  88. package/dist/GraphicsSnappingSource-594f402a.js +273 -0
  89. package/dist/GraphicsView2D-347562b8.js +620 -0
  90. package/dist/GroupLayer-7ae0a916.js +147 -0
  91. package/dist/GroupLayerView2D-ffcde606.js +98 -0
  92. package/dist/HUDMaterial.glsl-b0a3e0ce.js +65 -0
  93. package/dist/HighlightCounter-e18f0179.js +41 -0
  94. package/dist/HighlightGraphicContainer-fd774cea.js +18 -0
  95. package/dist/I3SBinaryReader-190e99de.js +310 -0
  96. package/dist/I3SLayerDefinitions-6ddaca60.js +55 -0
  97. package/dist/I3SUtil-44b83dc0.js +59 -0
  98. package/dist/IdentityManager-fbe91c13.js +899 -0
  99. package/dist/ImageHistogramParameters-d64fd9c8.js +905 -0
  100. package/dist/ImageryLayer-67878a78.js +1799 -0
  101. package/dist/ImageryLayerView2D-ae45faba.js +352 -0
  102. package/dist/ImageryTileLayer-9dca8b93.js +2157 -0
  103. package/dist/ImageryTileLayerView2D-977f66aa.js +1110 -0
  104. package/dist/ImmutableArray-fb7b7a6a.js +20 -0
  105. package/dist/Indices-e6dc3b15.js +67 -0
  106. package/dist/Input/Input.core.d.ts +37 -11
  107. package/dist/Input/index.d.ts +37 -11
  108. package/dist/IntegratedMesh3DTilesLayer-8811e7bf.js +112 -0
  109. package/dist/IntegratedMeshLayer-9162c0b5.js +141 -0
  110. package/dist/InteractiveAnalysisViewModel-b046fcb9.js +7397 -0
  111. package/dist/InterleavedLayout-32973c8a.js +163 -0
  112. package/dist/KMLLayer-80f81df7.js +162 -0
  113. package/dist/KMLLayerView2D-b6ba3b80.js +253 -0
  114. package/dist/KnowledgeGraphLayerView2D-ae91bd81.js +43 -0
  115. package/dist/LRUCache-27e8c401.js +32 -0
  116. package/dist/LabelClass-d9a476d6.js +135 -0
  117. package/dist/LabelMetric-e2728bbf.js +400 -0
  118. package/dist/LaserlinePath.glsl-60d00e61.js +64 -0
  119. package/dist/Laserlines.glsl-499a6cbf.js +65 -0
  120. package/dist/LayerFloorInfo-d05cf9dd.js +15 -0
  121. package/dist/LayerView-036988a9.js +206 -0
  122. package/dist/LercWorker-b1b4bb47.js +157 -0
  123. package/dist/LineOfSightLayer-9a9a60b7.js +147 -0
  124. package/dist/LinkChartLayer-d61803bb.js +1027 -0
  125. package/dist/Lyr3DWorker-87be14e0.js +82 -0
  126. package/dist/MD5-1b5ec1c3.js +76 -0
  127. package/dist/MagnifierPrograms-da7a27ab.js +806 -0
  128. package/dist/Map/Map.d.ts +26 -0
  129. package/dist/Map/index.d.ts +1 -0
  130. package/dist/Map/types/index.d.ts +38 -0
  131. package/dist/Map/utils/index.d.ts +24 -0
  132. package/dist/MapImageLayer-f07adf1a.js +169 -0
  133. package/dist/MapImageLayerView2D-d1b140c3.js +146 -0
  134. package/dist/MapNotesLayer-c662d147.js +283 -0
  135. package/dist/MapNotesLayerView2D-bf9ac698.js +161 -0
  136. package/dist/MapServiceLayerViewHelper-fb724de9.js +288 -0
  137. package/dist/MeasurementWidgetContent-e4888ef2.js +2642 -0
  138. package/dist/MediaLayer-36d873a3.js +523 -0
  139. package/dist/MediaLayerView2D-e58b8ec0.js +332 -0
  140. package/dist/MemCache-a9232ec2.js +227 -0
  141. package/dist/MemorySourceWorker-20ff27d6.js +222 -0
  142. package/dist/Mesh-3839826a.js +980 -0
  143. package/dist/MeshLocalVertexSpace-00151564.js +19 -0
  144. package/dist/MultiOriginJSONSupport-bb258670.js +158 -0
  145. package/dist/NestedMap-83f8e815.js +29 -0
  146. package/dist/OGCFeatureLayer-2a8b7ecc.js +211 -0
  147. package/dist/OGCFeatureLayerView2D-185f9649.js +82 -0
  148. package/dist/ObjectStack-10d91171.js +21 -0
  149. package/dist/Octree-78797046.js +495 -0
  150. package/dist/OpenStreetMapLayer-b0a17790.js +30 -0
  151. package/dist/OperationalLayer-55af27d6.js +44 -0
  152. package/dist/OptimizedFeatureSet-54e095c4.js +12 -0
  153. package/dist/OptimizedGeometry-3b808152.js +68 -0
  154. package/dist/OrderByInfo-22e3c805.js +16 -0
  155. package/dist/OrderIndependentTransparency-3eadfe42.js +214 -0
  156. package/dist/OrderedLayer-1403a591.js +26 -0
  157. package/dist/OrientedImageryLayer-8ec8d7d1.js +216 -0
  158. package/dist/OverlayCompositing.glsl-ba3bd81d.js +65 -0
  159. package/dist/OverrideHelper-82325a2c.js +242 -0
  160. package/dist/PBFDecoderWorker-f6517afc.js +213 -0
  161. package/dist/PointCloudLayer-cff43a10.js +197 -0
  162. package/dist/PointCloudUniqueValueRenderer-f337a895.js +115 -0
  163. package/dist/PointCloudWorker-cdb28dc1.js +212 -0
  164. package/dist/PooledRBush-ee4e60af.js +272 -0
  165. package/dist/Popup-c7f55588.js +3990 -0
  166. package/dist/PortalLayer-07b3c53e.js +126 -0
  167. package/dist/Program-ba2f18b2.js +694 -0
  168. package/dist/ProgramTemplate-eee4f097.js +35 -0
  169. package/dist/ProgressBar/ProgressBar.d.ts +0 -13
  170. package/dist/QueryEngine-10c97624.js +896 -0
  171. package/dist/QueryEngineCapabilities-0d8477a2.js +4 -0
  172. package/dist/QueryTask-115430b6.js +119 -0
  173. package/dist/RasterSymbolizer-fbf433fe.js +3024 -0
  174. package/dist/RasterVFDisplayObject-20b0dd86.js +581 -0
  175. package/dist/RasterWorker-44c37e20.js +78 -0
  176. package/dist/RawBlockCache-25203dbd.js +185 -0
  177. package/dist/RealisticTree.glsl-bc07c4dc.js +42 -0
  178. package/dist/Rect-894f011c.js +14 -0
  179. package/dist/RefreshableLayer-9550b85a.js +80 -0
  180. package/dist/RefreshableLayerView-601f7038.js +16 -0
  181. package/dist/Relationship-c662830e.js +64 -0
  182. package/dist/RelationshipQuery-765f068e.js +22 -0
  183. package/dist/RenderState-b244097f.js +7 -0
  184. package/dist/RenderingContext-3db74548.js +889 -0
  185. package/dist/RibbonLine.glsl-c6a715b7.js +65 -0
  186. package/dist/RouteLayer-3f5411f3.js +786 -0
  187. package/dist/RouteLayerView2D-a5fd4cbf.js +195 -0
  188. package/dist/SDFHelper-a34e90ee.js +140 -0
  189. package/dist/SSAO.glsl-5491a708.js +43 -0
  190. package/dist/SSAOBlur.glsl-f3068b8e.js +42 -0
  191. package/dist/ScaleRangeLayer-7ddf00b4.js +21 -0
  192. package/dist/SceneLayer-c594bfc3.js +542 -0
  193. package/dist/SceneLayerSnappingSource-a0504ac7.js +218 -0
  194. package/dist/SceneLayerSnappingSourceWorker-a04d6692.js +112 -0
  195. package/dist/SceneLayerWorker-1865768e.js +164 -0
  196. package/dist/SceneService-fb9f0142.js +215 -0
  197. package/dist/Scheduler-eacc84bb.js +373 -0
  198. package/dist/Select/Item/Item.d.ts +2 -1
  199. package/dist/Select/{Select.multiple.d.ts → Multiple/Select.multiple.d.ts} +26 -16
  200. package/dist/Select/Select.core.d.ts +18 -15
  201. package/dist/Select/{Select.single.d.ts → Single/Select.single.d.ts} +23 -14
  202. package/dist/Select/index.d.ts +42 -24
  203. package/dist/ShadedColorMaterial.glsl-db97956b.js +64 -0
  204. package/dist/SnappingOperation-9622a00d.js +48 -0
  205. package/dist/SourceLayerData-7016f1a5.js +116 -0
  206. package/dist/SpatialFilter-d20d4f50.js +1701 -0
  207. package/dist/Stop-68022e32.js +281 -0
  208. package/dist/StreamLayer-7c837e3d.js +188 -0
  209. package/dist/StreamLayerView2D-586f5a6a.js +164 -0
  210. package/dist/StyleDefinition-f4862d5a.js +36 -0
  211. package/dist/StyleRepository-fba75e70.js +2212 -0
  212. package/dist/SublayersOwner-3dc574cd.js +545 -0
  213. package/dist/SubtypeGroupLayer-1f9c5398.js +514 -0
  214. package/dist/SubtypeGroupLayerView2D-0f108d9d.js +84 -0
  215. package/dist/Tabs/Tab/Tab.d.ts +3 -3
  216. package/dist/TechniqueInstance-0481dbff.js +233 -0
  217. package/dist/TemporalLayer-8116b4a4.js +23 -0
  218. package/dist/Texture-22a8cca5.js +501 -0
  219. package/dist/TextureOnly.glsl-458f8148.js +65 -0
  220. package/dist/Theme-f05b8eb0.js +3426 -0
  221. package/dist/Tick-aef93b48.js +723 -0
  222. package/dist/TileContainer-0bf0ea1b.js +31 -0
  223. package/dist/TileInfoTilemapCache-d78858c0.js +38 -0
  224. package/dist/TileLayer-0edee064.js +194 -0
  225. package/dist/TileLayerView2D-78d5801b.js +187 -0
  226. package/dist/TilemapCache-79699d61.js +189 -0
  227. package/dist/TimeInfo-40c96ade.js +42 -0
  228. package/dist/TimeOnly-9ee66ca6.js +706 -0
  229. package/dist/Tooltip-e7498dc9.js +138 -0
  230. package/dist/TopFeaturesQuery-ad224e01.js +32 -0
  231. package/dist/TurboLine-6ab04aef.js +565 -0
  232. package/dist/UniqueValueRenderer-eaa5f8a6.js +1039 -0
  233. package/dist/UnknownLayer-e280ddd4.js +30 -0
  234. package/dist/UnknownTimeZone-220952b5.js +15 -0
  235. package/dist/UnsupportedLayer-447f7676.js +31 -0
  236. package/dist/UpdateTracking2D-e9adad8f.js +8566 -0
  237. package/dist/Util-002f5109.js +57 -0
  238. package/dist/VectorTileLayer-3210be81.js +544 -0
  239. package/dist/VectorTileLayerView2D-6a51e3b8.js +2108 -0
  240. package/dist/Version-3de8cbca.js +33 -0
  241. package/dist/VertexArrayObject-07998745.js +73 -0
  242. package/dist/VertexAttribute-faad30bf.js +11 -0
  243. package/dist/VertexColor.glsl-e415cf02.js +2683 -0
  244. package/dist/VertexElementDescriptor-d7c718c2.js +8 -0
  245. package/dist/VertexSnappingCandidate-b676241f.js +13 -0
  246. package/dist/VideoLayerView2D-f659dd0d.js +124 -0
  247. package/dist/VoxelLayer-003f82ff.js +631 -0
  248. package/dist/WFSLayer-3da6c5f7.js +221 -0
  249. package/dist/WFSSourceWorker-9a11693a.js +157 -0
  250. package/dist/WGLContainer-3d159b63.js +5426 -0
  251. package/dist/WMSLayer-fc0632f8.js +536 -0
  252. package/dist/WMSLayerView2D-54e80e1b.js +117 -0
  253. package/dist/WMTSLayer-9324b12b.js +531 -0
  254. package/dist/WMTSLayerView2D-3ef936db.js +142 -0
  255. package/dist/WebTileLayer-45c563ff.js +110 -0
  256. package/dist/WhereClause-7a28b740.js +2766 -0
  257. package/dist/WorkerHandle-0d54a6c7.js +47 -0
  258. package/dist/WorkerTileHandler-786c2b24.js +1539 -0
  259. package/dist/action-163397e3.js +198 -0
  260. package/dist/action-group-4859fb97.js +145 -0
  261. package/dist/action-menu-2d70b2fc.js +1759 -0
  262. package/dist/agrotools-theme.css.map +1 -1
  263. package/dist/apng-9b71d52c.js +392 -0
  264. package/dist/ar-a17f8064.js +18 -0
  265. package/dist/arcade-fa309282.js +229 -0
  266. package/dist/arcadeAsyncRuntime-738498fd.js +943 -0
  267. package/dist/arcadeUtils-f71d80fa.js +8741 -0
  268. package/dist/arcgis-knowledge-client-core-6056bcea.js +1218 -0
  269. package/dist/arcgis-knowledge-client-core-simd-9bc1f83e.js +1218 -0
  270. package/dist/arcgisLayers-b2b878bd.js +152 -0
  271. package/dist/associatedFeatureServiceUtils-df5b5187.js +92 -0
  272. package/dist/axisAngleDegrees-32643b7c.js +49 -0
  273. package/dist/basicInterfaces-fa4f5fa7.js +30 -0
  274. package/dist/basis_transcoder-3187cc92.js +1248 -0
  275. package/dist/bg_BG-9950a70b.js +18 -0
  276. package/dist/bs_BA-60482871.js +18 -0
  277. package/dist/ca_ES-a121088e.js +18 -0
  278. package/dist/calcite-action-bar-5a87c23c.js +303 -0
  279. package/dist/calcite-action-ee2ca847.js +22 -0
  280. package/dist/calcite-action-group-19aa86ee.js +28 -0
  281. package/dist/calcite-button-8e9175c0.js +228 -0
  282. package/dist/calcite-flow-57d26d2d.js +128 -0
  283. package/dist/calcite-flow-item-4a3e3fc0.js +499 -0
  284. package/dist/calcite-icon-d99e280a.js +16 -0
  285. package/dist/calcite-input-28b20785.js +24 -0
  286. package/dist/calcite-label-4f30e08d.js +79 -0
  287. package/dist/calcite-list-0cee7628.js +2135 -0
  288. package/dist/calcite-list-item-0a19efa8.js +576 -0
  289. package/dist/calcite-list-item-group-0706662f.js +71 -0
  290. package/dist/calcite-loader-865045b1.js +14 -0
  291. package/dist/calcite-modal-3e4da6fd.js +333 -0
  292. package/dist/calcite-notice-50b74ab7.js +181 -0
  293. package/dist/calcite-option-713c1d40.js +94 -0
  294. package/dist/calcite-scrim-809fbd0b.js +18 -0
  295. package/dist/calcite-select-28d8edfc.js +231 -0
  296. package/dist/capabilities-c8f838be.js +50 -0
  297. package/dist/chartCommon-13718cda.js +256 -0
  298. package/dist/chartUtilsAm5-6be145fb.js +2954 -0
  299. package/dist/clientSideDefaults-5c1f97c9.js +39 -0
  300. package/dist/colorRamps-8792655e.js +38 -0
  301. package/dist/colorUtils-54f4b662.js +164 -0
  302. package/dist/commonProperties-f9559903.js +60 -0
  303. package/dist/component-51a10bc0.js +18 -0
  304. package/dist/computeTranslationToOriginAndRotation-4876cb93.js +60 -0
  305. package/dist/conditionalSlot-87175989.js +27 -0
  306. package/dist/config-61215215.js +7 -0
  307. package/dist/constants-5bd557fe.js +5 -0
  308. package/dist/createConnection-f974a00a.js +299 -0
  309. package/dist/crsUtils-59933b10.js +7 -0
  310. package/dist/cs_CZ-1b968650.js +18 -0
  311. package/dist/da_DK-e0fe1642.js +18 -0
  312. package/dist/dataUtils-7c276b73.js +1421 -0
  313. package/dist/date-1c28c6a5.js +52 -0
  314. package/dist/de_CH-b0dbd4c8.js +6 -0
  315. package/dist/de_DE-8609ef65.js +6 -0
  316. package/dist/debounce-de27a42a.js +121 -0
  317. package/dist/deduplicate-59fb9cac.js +89 -0
  318. package/dist/defaults-2bfa4a36.js +31 -0
  319. package/dist/defaultsJSON-ba17aa15.js +10 -0
  320. package/dist/definitions-a00a3a6c.js +52 -0
  321. package/dist/deleteForwardEdits-f653b513.js +13 -0
  322. package/dist/devEnvironmentUtils-42cb97c7.js +11 -0
  323. package/dist/diffUtils-e71a6152.js +90 -0
  324. package/dist/dom-b589b728.js +358 -0
  325. package/dist/doublePrecisionUtils-46e21550.js +22 -0
  326. package/dist/drapedUtils-b42fcbc6.js +75 -0
  327. package/dist/earcut-6fa1a128.js +292 -0
  328. package/dist/edgeProcessing-2ff1f201.js +252 -0
  329. package/dist/editingSupport-68545668.js +203 -0
  330. package/dist/editsZScale-c7cdd215.js +37 -0
  331. package/dist/el_GR-5cfd1e7e.js +18 -0
  332. package/dist/elevationInfoUtils-5456a079.js +126 -0
  333. package/dist/en_CA-47f2633b.js +18 -0
  334. package/dist/en_US-47f2633b.js +18 -0
  335. package/dist/enums-25d066fc.js +13 -0
  336. package/dist/enums-2c166c09.js +99 -0
  337. package/dist/enums-fa8f05ab.js +152 -0
  338. package/dist/es_ES-489878a2.js +6 -0
  339. package/dist/et_EE-6472669a.js +18 -0
  340. package/dist/executeForIds-4ab75c0d.js +14 -0
  341. package/dist/executeForTopCount-7e095ec1.js +17 -0
  342. package/dist/executeForTopExtents-19daf9d0.js +17 -0
  343. package/dist/executeForTopIds-1ba3a4af.js +17 -0
  344. package/dist/executeQueryJSON-46168866.js +15 -0
  345. package/dist/executeQueryPBF-d8623daf.js +152 -0
  346. package/dist/executeRelationshipQuery-011dfb45.js +53 -0
  347. package/dist/executeTopFeaturesQuery-02166801.js +18 -0
  348. package/dist/featureConversionUtils-650d7601.js +479 -0
  349. package/dist/featureLayerUtils-64e09283.js +142 -0
  350. package/dist/featureLayerUtils-b07f9c11.js +250 -0
  351. package/dist/featureSetUtils-9d37d6f8.js +2530 -0
  352. package/dist/featuresetbase-62aeb079.js +707 -0
  353. package/dist/featuresetgeom-51f9fc4e.js +99 -0
  354. package/dist/featuresetstats-4db32894.js +81 -0
  355. package/dist/featuresetstring-990c3287.js +95 -0
  356. package/dist/fetchService-5198dd4a.js +33 -0
  357. package/dist/fi_FI-d7a3a525.js +18 -0
  358. package/dist/fieldProperties-edfa24cb.js +33 -0
  359. package/dist/floatRGBA-516d7961.js +20 -0
  360. package/dist/floorFilterUtils-936f7587.js +19 -0
  361. package/dist/focusTrapComponent-e849bb89.js +475 -0
  362. package/dist/form-99719d52.js +138 -0
  363. package/dist/fr_FR-a88f2596.js +7 -0
  364. package/dist/geohashUtils-2bc76440.js +85 -0
  365. package/dist/geojson-603231df.js +208 -0
  366. package/dist/geomasync-e9063b4c.js +567 -0
  367. package/dist/geometryEngine-d3bb2fd6.js +192 -0
  368. package/dist/geometryEngineAsync-55aa6170.js +217 -0
  369. package/dist/geometryEngineBase-527e8b63.js +18463 -0
  370. package/dist/geometryEngineJSON-28087174.js +46 -0
  371. package/dist/geometryEngineJSON-d54949f9.js +171 -0
  372. package/dist/geometryEngineWorker-dc2c7127.js +11 -0
  373. package/dist/geometryServiceUtils-6a3e1e93.js +28 -0
  374. package/dist/georeference-ed8b2c30.js +291 -0
  375. package/dist/gif-204e82dd.js +323 -0
  376. package/dist/glUtil-8f8bce6b.js +19 -0
  377. package/dist/gltfexport-b2566542.js +705 -0
  378. package/dist/groupLayerUtils-ea9e6359.js +39 -0
  379. package/dist/guid-5ee54248.js +17 -0
  380. package/dist/he_IL-e34cf273.js +18 -0
  381. package/dist/heatmapUtils-56758920.js +45 -0
  382. package/dist/highlightReasons-de432106.js +19 -0
  383. package/dist/hr_HR-6a124f87.js +18 -0
  384. package/dist/hu_HU-58f3feb6.js +18 -0
  385. package/dist/hydrated-0e1c7565.js +40 -0
  386. package/dist/i3s-bb0b5b67.js +809 -0
  387. package/dist/icon-c6e3bd23.js +127 -0
  388. package/dist/id_ID-18d97715.js +18 -0
  389. package/dist/imageBitmapUtils-881d8c64.js +23 -0
  390. package/dist/imageUtils-57eeedc5.js +69 -0
  391. package/dist/imageUtils-ef69c578.js +89 -0
  392. package/dist/imageryUtils-23f51cb1.js +43 -0
  393. package/dist/index-01c737ed.js +42563 -0
  394. package/dist/index.d.ts +2 -1
  395. package/dist/index.js +22 -10177
  396. package/dist/infoFor3D-bf4e6c95.js +58 -0
  397. package/dist/input-message-673a9baa.js +92 -0
  398. package/dist/input2-bbf6454e.js +575 -0
  399. package/dist/interactive-aeb2cb9f.js +80 -0
  400. package/dist/interfaces-fac3cfda.js +7 -0
  401. package/dist/it_IT-49e70bbf.js +6 -0
  402. package/dist/ja_JP-eaef2cc3.js +18 -0
  403. package/dist/json-5febf88a.js +57 -0
  404. package/dist/jsonContext-2dc288b1.js +15 -0
  405. package/dist/jsonUtils-1abd4bfc.js +59 -0
  406. package/dist/jsonUtils-913fa1bd.js +86 -0
  407. package/dist/jsonUtils-f6a5e63b.js +476 -0
  408. package/dist/kmlUtils-7c2744fe.js +112 -0
  409. package/dist/knowledgeGraphService-6a349e04.js +739 -0
  410. package/dist/knowledgegraph-c91b0bb2.js +149 -0
  411. package/dist/ko_KR-5c972fd8.js +14 -0
  412. package/dist/label2-1ab25f27.js +90 -0
  413. package/dist/labelUtils-a3634e8f.js +61 -0
  414. package/dist/labelingInfo-568c9210.js +46 -0
  415. package/dist/layerViewUtils-052e603c.js +10 -0
  416. package/dist/layersCreator-4a5366ea.js +151 -0
  417. package/dist/layersLoader-b87d4857.js +197 -0
  418. package/dist/lazyLayerLoader-8817000c.js +10 -0
  419. package/dist/lclayout-64c67b4e.js +773 -0
  420. package/dist/lengthUtils-695e744c.js +5 -0
  421. package/dist/lerc-wasm-13192bf3.js +325 -0
  422. package/dist/libtess-asm-4883179d.js +3673 -0
  423. package/dist/libtess-fc70d1ce.js +269 -0
  424. package/dist/lineSegment-3aa941f5.js +76 -0
  425. package/dist/loadGLTFMesh-db6645f5.js +181 -0
  426. package/dist/loadable-266f324b.js +24 -0
  427. package/dist/loader-d1ce1bc1.js +79 -0
  428. package/dist/lt_LT-26f13fd1.js +6 -0
  429. package/dist/lv_LV-4feafa92.js +18 -0
  430. package/dist/lyr3DWorker-dd48e619.js +2108 -0
  431. package/dist/mapViewDeps-226d9da3.js +3052 -0
  432. package/dist/mask-svg-30f64a7b.js +4 -0
  433. package/dist/mat3f64-03233387.js +19 -0
  434. package/dist/mat4f64-cce69db4.js +19 -0
  435. package/dist/mediaLayerUtils-ae485c27.js +35 -0
  436. package/dist/meshFeatureSet-8a2ad011.js +126 -0
  437. package/dist/meshVertexSpaceUtils-6efe3dcc.js +58 -0
  438. package/dist/multiOriginJSONSupportUtils-207ba4d4.js +6 -0
  439. package/dist/multidimensionalUtils-508a3f3f.js +290 -0
  440. package/dist/nb_NO-21543153.js +18 -0
  441. package/dist/nl_NL-7876d97f.js +7 -0
  442. package/dist/normalizeUtilsSync-1dae280b.js +181 -0
  443. package/dist/number-5aa3a81b.js +128 -0
  444. package/dist/objectIdUtils-93dae423.js +14 -0
  445. package/dist/objectResourceUtils-642ab03e.js +1455 -0
  446. package/dist/observers-f646a6a4.js +30 -0
  447. package/dist/ogcFeatureUtils-46ac1c44.js +206 -0
  448. package/dist/openCloseComponent-47eb52c6.js +37 -0
  449. package/dist/orientedBoundingBox-554ccdc6.js +447 -0
  450. package/dist/originUtils-87edf087.js +9 -0
  451. package/dist/overlay-svg-c3941b3b.js +4 -0
  452. package/dist/parser-0701286c.js +488 -0
  453. package/dist/pbf-5dd791f5.js +215 -0
  454. package/dist/pbfQueryUtils-a6ca7e23.js +422 -0
  455. package/dist/pe-wasm-6c16b121.js +887 -0
  456. package/dist/persistable-9eb0e8df.js +89 -0
  457. package/dist/perspectiveUtils-b194621d.js +42 -0
  458. package/dist/pieChart-b97433d0.js +555 -0
  459. package/dist/pl_PL-276c6dae.js +18 -0
  460. package/dist/plane-3398eec1.js +160 -0
  461. package/dist/popupUtils-c444b896.js +22 -0
  462. package/dist/popupUtils-d871563b.js +50 -0
  463. package/dist/portalItemUtils-4c4caad0.js +57 -0
  464. package/dist/portalLayers-cb07742f.js +312 -0
  465. package/dist/portalUtils-effd590f.js +7 -0
  466. package/dist/programUtils-65af7b7c.js +59 -0
  467. package/dist/project-ee9c2947.js +21 -0
  468. package/dist/projectPointToVector-7dc831a9.js +14 -0
  469. package/dist/projectVectorToVector-5163db7a.js +13 -0
  470. package/dist/pt_BR-4fae3055.js +6 -0
  471. package/dist/pt_PT-14d9efb1.js +6 -0
  472. package/dist/quantityUtils-5cd4cf90.js +33 -0
  473. package/dist/quantizationUtils-0a8f74c6.js +68 -0
  474. package/dist/quat-a508aed3.js +104 -0
  475. package/dist/quatf64-bec1af25.js +19 -0
  476. package/dist/query-b6e1fd14.js +89 -0
  477. package/dist/queryAttachments-7b39ebdc.js +39 -0
  478. package/dist/queryEngineUtils-cb8e309e.js +21 -0
  479. package/dist/queryTopFeatures-2e0e3941.js +50 -0
  480. package/dist/queryZScale-c5733d0a.js +12 -0
  481. package/dist/rasterProjectionHelper-213afa27.js +577 -0
  482. package/dist/rasterUtils-f2e44e8b.js +122 -0
  483. package/dist/rasterizingUtils-25cc0190.js +46 -0
  484. package/dist/request-e0c679b3.js +46 -0
  485. package/dist/requestImageUtils-37d79281.js +8 -0
  486. package/dist/resourceExtension-5f3f1c80.js +17 -0
  487. package/dist/resourceUtils-0d68cbc2.js +69 -0
  488. package/dist/resourceUtils-374db840.js +62 -0
  489. package/dist/resourceUtils-43ce192b.js +42 -0
  490. package/dist/ro_RO-8e733cf5.js +18 -0
  491. package/dist/ru_RU-f7bafc90.js +6 -0
  492. package/dist/saveAPIKeyUtils-1a3d4a8a.js +8 -0
  493. package/dist/saveUtils-43fdc547.js +24 -0
  494. package/dist/scaleUtils-bdf8b6cb.js +23 -0
  495. package/dist/scrim-44eb4dc0.js +114 -0
  496. package/dist/serviceCapabilitiesUtils-823612b8.js +64 -0
  497. package/dist/sizeVariableUtils-a1b694d8.js +27 -0
  498. package/dist/sk_SK-c279eea3.js +6 -0
  499. package/dist/sl_SL-e40950dd.js +6 -0
  500. package/dist/sourceUtils-01d115c6.js +71 -0
  501. package/dist/sphere-908cd9aa.js +199 -0
  502. package/dist/sr_RS-b1835dfa.js +18 -0
  503. package/dist/statsWorker-49f9befe.js +37 -0
  504. package/dist/streamLayerUtils-29324e05.js +31 -0
  505. package/dist/style.css +1 -1
  506. package/dist/styleUtils-82e8da52.js +75 -0
  507. package/dist/styleUtils-8541d60d.js +14 -0
  508. package/dist/sublayerUtils-eaac2486.js +37 -0
  509. package/dist/substitute-1f578d70.js +52 -0
  510. package/dist/sv_SE-15ca9e36.js +6 -0
  511. package/dist/symbolColorUtils-18fd6b3d.js +8 -0
  512. package/dist/symbolLayerUtils-4c58b291.js +31 -0
  513. package/dist/symbologySnappingCandidates-14d94b6b.js +221 -0
  514. package/dist/t9n-c1c2b6c8.js +349 -0
  515. package/dist/testSVGPremultipliedAlpha-159dac90.js +94 -0
  516. package/dist/th_TH-bf624a56.js +18 -0
  517. package/dist/tileUtils-3e0c8c1d.js +7 -0
  518. package/dist/timeSupport-3f529cdb.js +410 -0
  519. package/dist/tr_TR-ca5c315f.js +18 -0
  520. package/dist/triangle-8a3a2ba8.js +98 -0
  521. package/dist/types-adba9034.js +19 -0
  522. package/dist/uk_UA-4b3cb86d.js +6 -0
  523. package/dist/unitConversionUtils-f0ebaf75.js +17 -0
  524. package/dist/unitFormatUtils-555e2d94.js +40 -0
  525. package/dist/uploadAssetErrors-d1389781.js +70 -0
  526. package/dist/uploadAssets-5e85f09d.js +330 -0
  527. package/dist/utils-3a10b10c.js +34 -0
  528. package/dist/utils-505c54e9.js +91 -0
  529. package/dist/utils-5432e258.js +433 -0
  530. package/dist/utils-7a88ec6a.js +419 -0
  531. package/dist/utils-7fa9cdf9.js +2746 -0
  532. package/dist/utils-d252c575.js +73 -0
  533. package/dist/utils-f07e00b3.js +232 -0
  534. package/dist/utils-fda10b4b.js +79 -0
  535. package/dist/utils3-c34ab97c.js +75 -0
  536. package/dist/vec3-f79c600d.js +81 -0
  537. package/dist/vec3f32-304a6a9c.js +36 -0
  538. package/dist/vec42-36edeb73.js +125 -0
  539. package/dist/vec4f32-b2628ced.js +38 -0
  540. package/dist/vec4f64-043e974c.js +45 -0
  541. package/dist/versionUtils-6935648b.js +161 -0
  542. package/dist/vi_VN-ad09e708.js +18 -0
  543. package/dist/visualVariableUtils-c425461a.js +267 -0
  544. package/dist/webStyleSymbolUtils-4f42a29f.js +48 -0
  545. package/dist/webglDeps-5f18210d.js +23 -0
  546. package/dist/wfsUtils-6f7f1e3e.js +343 -0
  547. package/dist/workerHelper-9dc9a790.js +11 -0
  548. package/dist/xmlUtils-64cc47e1.js +24 -0
  549. package/dist/xyChart-e5648fee.js +3335 -0
  550. package/dist/zh_Hans-61faef57.js +14 -0
  551. package/dist/zh_Hant-87a9767b.js +14 -0
  552. package/dist/zipjs-wrapper-1bd67e07.js +6496 -0
  553. package/package.json +6 -1
@@ -0,0 +1,2683 @@
1
+ import { bs as ir, gZ as nr, Q as ft, bH as Jr, fj as Pt, aS as es, W as bt, s as or, S as cr, iw as ue, cK as ts, l1 as rs, l2 as ss, l3 as as, fg as H, bd as is, bf as ns, b as It, b9 as b, e as L, y as D, c as os, cv as nt, gQ as ge, ez as cs, bt as ls, L as us, bp as ee, bo as ae, l4 as ds, ej as ye, bg as qe, j4 as pt, gf as $t, hs, bn as lr, h0 as ms, dc as fs, e3 as Ft, iN as ps, fp as Ue, j6 as Ve, bJ as Dt, l5 as vs, gU as _s, gX as gs, l as Ts, bm as Te, kr as Es, gc as Ss, g7 as Se, fr as be, gn as As, ge as xs, gv as Bt, l6 as Os, l7 as Ht, gd as Rs, l8 as ur, l9 as dr } from "./index-01c737ed.js";
2
+ import { E as bs, c as le, G as Re, L as Ce, D as vt, O as we, I as Z } from "./enums-2c166c09.js";
3
+ import { c as Is, m as ze, a as $s, e as Ls } from "./Texture-22a8cca5.js";
4
+ import { s as _t } from "./vec42-36edeb73.js";
5
+ import { n as Lt, r as hr } from "./vec4f64-043e974c.js";
6
+ import { o as l, n as Me } from "./OrderIndependentTransparency-3eadfe42.js";
7
+ import { a as R } from "./BindType-5e76c8e1.js";
8
+ import { s as U } from "./Util-002f5109.js";
9
+ import { e as m } from "./VertexAttribute-faad30bf.js";
10
+ import { e as Ne } from "./mat3f64-03233387.js";
11
+ import { a as gt, t as ys, i as Cs, u as Ge, N as he } from "./basicInterfaces-fa4f5fa7.js";
12
+ import { e as Ae, o as rt, r as ws } from "./mat4f64-cce69db4.js";
13
+ import { t as Ms, l as Ns } from "./Indices-e6dc3b15.js";
14
+ import { e as xe, d as Ps, o as Fs } from "./triangle-8a3a2ba8.js";
15
+ import { o as Ds, r as Bs } from "./doublePrecisionUtils-46e21550.js";
16
+ import "./lengthUtils-695e744c.js";
17
+ import { t as Hs } from "./requestImageUtils-37d79281.js";
18
+ import { w as mr, Z as de } from "./sphere-908cd9aa.js";
19
+ import { O as Us, L as Vs } from "./orientedBoundingBox-554ccdc6.js";
20
+ import { x as fr, c as Ut, y as zs, u as Gs, q as Ws, i as Vt } from "./BufferView-004ad517.js";
21
+ function gn(t, e = !1) {
22
+ return t <= ir ? e ? new Array(t).fill(0) : new Array(t) : new Float32Array(t);
23
+ }
24
+ let yt = class {
25
+ constructor() {
26
+ this.id = nr();
27
+ }
28
+ }, ks = class {
29
+ constructor(e) {
30
+ this.channel = e, this.id = nr();
31
+ }
32
+ };
33
+ function js(t, e) {
34
+ return t == null && (t = []), t.push(e), t;
35
+ }
36
+ function qs(t, e) {
37
+ if (t == null)
38
+ return null;
39
+ const r = t.filter((s) => s !== e);
40
+ return r.length === 0 ? null : r;
41
+ }
42
+ let Sn = class {
43
+ constructor(e, r) {
44
+ this._module = e, this._loadModule = r;
45
+ }
46
+ get() {
47
+ return this._module;
48
+ }
49
+ async reload() {
50
+ return this._module = await this._loadModule(), this._module;
51
+ }
52
+ }, xn = class {
53
+ constructor(e, r, s) {
54
+ this.release = s, this.initializeConfiguration(e, r), this._configuration = r.snapshot(), this._program = this.initializeProgram(e), this._pipeline = this.initializePipeline(e);
55
+ }
56
+ destroy() {
57
+ this._program = ft(this._program), this._pipeline = this._configuration = null;
58
+ }
59
+ reload(e) {
60
+ ft(this._program), this._program = this.initializeProgram(e), this._pipeline = this.initializePipeline(e);
61
+ }
62
+ get program() {
63
+ return this._program;
64
+ }
65
+ get compiled() {
66
+ return this.program.compiled;
67
+ }
68
+ get key() {
69
+ return this._configuration.key;
70
+ }
71
+ get configuration() {
72
+ return this._configuration;
73
+ }
74
+ ensureAttributeLocations(e) {
75
+ this.program.assertCompatibleVertexAttributeLocations(e);
76
+ }
77
+ get primitiveType() {
78
+ return bs.TRIANGLES;
79
+ }
80
+ getPipeline(e, r, s) {
81
+ return this._pipeline;
82
+ }
83
+ initializeConfiguration(e, r) {
84
+ }
85
+ }, Rn = class {
86
+ constructor(e, r, s) {
87
+ this._context = e, this._locations = s, this._textures = /* @__PURE__ */ new Map(), this._freeTextureUnits = new Jr({ deallocator: null }), this._glProgram = e.programCache.acquire(r.generate("vertex"), r.generate("fragment"), s), this._glProgram.stop = () => {
88
+ throw new Error("Wrapped _glProgram used directly");
89
+ }, this.bindPass = r.generateBindPass(this), this.bindDraw = r.generateBindDraw(this), this._fragmentUniforms = Is() ? r.fragmentUniforms : null;
90
+ }
91
+ dispose() {
92
+ this._glProgram.dispose();
93
+ }
94
+ get glName() {
95
+ return this._glProgram.glName;
96
+ }
97
+ get hasTransformFeedbackVaryings() {
98
+ return this._glProgram.hasTransformFeedbackVaryings;
99
+ }
100
+ get compiled() {
101
+ return this._glProgram.compiled;
102
+ }
103
+ setUniform1b(e, r) {
104
+ this._glProgram.setUniform1i(e, r ? 1 : 0);
105
+ }
106
+ setUniform1i(e, r) {
107
+ this._glProgram.setUniform1i(e, r);
108
+ }
109
+ setUniform1f(e, r) {
110
+ this._glProgram.setUniform1f(e, r);
111
+ }
112
+ setUniform2fv(e, r) {
113
+ this._glProgram.setUniform2fv(e, r);
114
+ }
115
+ setUniform3fv(e, r) {
116
+ this._glProgram.setUniform3fv(e, r);
117
+ }
118
+ setUniform4fv(e, r) {
119
+ this._glProgram.setUniform4fv(e, r);
120
+ }
121
+ setUniformMatrix3fv(e, r) {
122
+ this._glProgram.setUniformMatrix3fv(e, r);
123
+ }
124
+ setUniformMatrix4fv(e, r) {
125
+ this._glProgram.setUniformMatrix4fv(e, r);
126
+ }
127
+ setUniform1fv(e, r) {
128
+ this._glProgram.setUniform1fv(e, r);
129
+ }
130
+ setUniform1iv(e, r) {
131
+ this._glProgram.setUniform1iv(e, r);
132
+ }
133
+ setUniform2iv(e, r) {
134
+ this._glProgram.setUniform3iv(e, r);
135
+ }
136
+ setUniform3iv(e, r) {
137
+ this._glProgram.setUniform3iv(e, r);
138
+ }
139
+ setUniform4iv(e, r) {
140
+ this._glProgram.setUniform4iv(e, r);
141
+ }
142
+ assertCompatibleVertexAttributeLocations(e) {
143
+ e.locations !== this._locations && console.error("VertexAttributeLocations are incompatible");
144
+ }
145
+ stop() {
146
+ this._textures.clear(), this._freeTextureUnits.clear();
147
+ }
148
+ bindTexture(e, r) {
149
+ if ((r == null ? void 0 : r.glName) == null) {
150
+ const a = this._textures.get(e);
151
+ return a && (this._context.bindTexture(null, a.unit), this._freeTextureUnit(a), this._textures.delete(e)), null;
152
+ }
153
+ let s = this._textures.get(e);
154
+ return s == null ? (s = this._allocTextureUnit(r), this._textures.set(e, s)) : s.texture = r, this._context.useProgram(this), this.setUniform1i(e, s.unit), this._context.bindTexture(r, s.unit), s.unit;
155
+ }
156
+ rebindTextures() {
157
+ var e;
158
+ this._context.useProgram(this), this._textures.forEach((r, s) => {
159
+ this._context.bindTexture(r.texture, r.unit), this.setUniform1i(s, r.unit);
160
+ }), (e = this._fragmentUniforms) == null || e.forEach((r) => {
161
+ r.type !== "sampler2D" && r.type !== "samplerCube" || this._textures.has(r.name) || console.error(`Texture sampler ${r.name} has no bound texture`);
162
+ });
163
+ }
164
+ _allocTextureUnit(e) {
165
+ return { texture: e, unit: this._freeTextureUnits.length === 0 ? this._textures.size : this._freeTextureUnits.pop() };
166
+ }
167
+ _freeTextureUnit(e) {
168
+ this._freeTextureUnits.push(e.unit);
169
+ }
170
+ };
171
+ function pr(t) {
172
+ t.code.add(l`const float MAX_RGBA_FLOAT =
173
+ 255.0 / 256.0 +
174
+ 255.0 / 256.0 / 256.0 +
175
+ 255.0 / 256.0 / 256.0 / 256.0 +
176
+ 255.0 / 256.0 / 256.0 / 256.0 / 256.0;
177
+ const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0);
178
+ vec4 float2rgba(const float value) {
179
+ float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT);
180
+ vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0);
181
+ const float toU8AsFloat = 1.0 / 255.0;
182
+ return fixedPointU8 * toU8AsFloat;
183
+ }
184
+ const vec4 RGBA_2_FLOAT_FACTORS = vec4(
185
+ 255.0 / (256.0),
186
+ 255.0 / (256.0 * 256.0),
187
+ 255.0 / (256.0 * 256.0 * 256.0),
188
+ 255.0 / (256.0 * 256.0 * 256.0 * 256.0)
189
+ );
190
+ float rgba2float(vec4 rgba) {
191
+ return dot(rgba, RGBA_2_FLOAT_FACTORS);
192
+ }`);
193
+ }
194
+ function Xs(t) {
195
+ t.include(pr), t.code.add(l`float linearDepthFromFloat(float depth, vec2 nearFar) {
196
+ return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);
197
+ }
198
+ float linearDepthFromRGBA(vec4 depth, vec2 nearFar) {
199
+ return linearDepthFromFloat(rgba2float(depth), nearFar);
200
+ }
201
+ float linearDepthFromTexture(sampler2D depthTexture, vec2 uv, vec2 nearFar) {
202
+ ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0)));
203
+ return linearDepthFromRGBA(texelFetch(depthTexture, iuv, 0), nearFar);
204
+ }`);
205
+ }
206
+ function In(t) {
207
+ t.code.add(l`float linearizeDepth(float depth, vec2 nearFar) {
208
+ float depthNdc = depth * 2.0 - 1.0;
209
+ return (2.0 * nearFar[0] * nearFar[1]) / (depthNdc * (nearFar[1] - nearFar[0]) - (nearFar[1] + nearFar[0]));
210
+ }
211
+ float linearDepthFromTexture(sampler2D depthTexture, vec2 uv, vec2 nearFar) {
212
+ ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0)));
213
+ float depth = texelFetch(depthTexture, iuv, 0).r;
214
+ return linearizeDepth(depth, nearFar);
215
+ }`);
216
+ }
217
+ let j = class {
218
+ constructor(e, r, s, a, i = null) {
219
+ if (this.name = e, this.type = r, this.arraySize = i, this.bind = { [R.Pass]: null, [R.Draw]: null }, a)
220
+ switch (s) {
221
+ case R.Pass:
222
+ this.bind[R.Pass] = a;
223
+ break;
224
+ case R.Draw:
225
+ this.bind[R.Draw] = a;
226
+ }
227
+ }
228
+ equals(e) {
229
+ return this.type === e.type && this.name === e.name && this.arraySize === e.arraySize;
230
+ }
231
+ }, Ct = class extends j {
232
+ constructor(e, r) {
233
+ super(e, "vec2", R.Pass, (s, a, i) => s.setUniform2fv(e, r(a, i)));
234
+ }
235
+ }, vr = class extends j {
236
+ constructor(e, r) {
237
+ super(e, "vec4", R.Pass, (s, a, i) => s.setUniform4fv(e, r(a, i)));
238
+ }
239
+ };
240
+ function Cn(t) {
241
+ t.fragment.uniforms.add(new vr("projInfo", (e, r) => Ys(r.camera))), t.fragment.uniforms.add(new Ct("zScale", (e, r) => Ks(r.camera))), t.fragment.code.add(l`vec3 reconstructPosition(vec2 fragCoord, float depth) {
242
+ return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
243
+ }`);
244
+ }
245
+ function Ys(t) {
246
+ const e = t.projectionMatrix;
247
+ return e[11] === 0 ? _t(zt, 2 / (t.fullWidth * e[0]), 2 / (t.fullHeight * e[5]), (1 + e[12]) / e[0], (1 + e[13]) / e[5]) : _t(zt, -2 / (t.fullWidth * e[0]), -2 / (t.fullHeight * e[5]), (1 - e[8]) / e[0], (1 - e[9]) / e[5]);
248
+ }
249
+ const zt = Lt();
250
+ function Ks(t) {
251
+ return t.projectionMatrix[11] === 0 ? Pt(Gt, 0, 1) : Pt(Gt, 1, 0);
252
+ }
253
+ const Gt = es();
254
+ let q = class extends j {
255
+ constructor(e, r) {
256
+ super(e, "vec3", R.Pass, (s, a, i) => s.setUniform3fv(e, r(a, i)));
257
+ }
258
+ }, Qs = class extends j {
259
+ constructor(e, r) {
260
+ super(e, "float", R.Pass, (s, a, i) => s.setUniform1f(e, r(a, i)));
261
+ }
262
+ }, We = class extends j {
263
+ constructor(e, r) {
264
+ super(e, "sampler2D", R.Pass, (s, a, i) => s.bindTexture(e, r(a, i)));
265
+ }
266
+ }, $e = class extends j {
267
+ constructor(e, r) {
268
+ super(e, "mat4", R.Pass, (s, a, i) => s.setUniformMatrix4fv(e, r(a, i)));
269
+ }
270
+ };
271
+ const _r = () => or.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");
272
+ let gr = class {
273
+ constructor() {
274
+ this._includedModules = /* @__PURE__ */ new Map();
275
+ }
276
+ include(e, r) {
277
+ if (this._includedModules.has(e)) {
278
+ const s = this._includedModules.get(e);
279
+ if (s !== r) {
280
+ _r().error("Shader module included multiple times with different configuration.");
281
+ const a = /* @__PURE__ */ new Set();
282
+ for (const i of Object.keys(s))
283
+ s[i] !== e[i] && a.add(i);
284
+ for (const i of Object.keys(e))
285
+ s[i] !== e[i] && a.add(i);
286
+ a.forEach((i) => console.error(` ${i}: current ${s[i]} new ${e[i]}`));
287
+ }
288
+ } else
289
+ this._includedModules.set(e, r), e(this.builder, r);
290
+ }
291
+ }, Dn = class extends gr {
292
+ constructor() {
293
+ super(...arguments), this.vertex = new Wt(), this.fragment = new Wt(), this.attributes = new ea(), this.varyings = new ta(), this.extensions = new Tt(), this.constants = new Tr(), this.outputs = new St();
294
+ }
295
+ get fragmentUniforms() {
296
+ return this.fragment.uniforms.entries;
297
+ }
298
+ get builder() {
299
+ return this;
300
+ }
301
+ generate(e) {
302
+ const r = this.extensions.generateSource(e), s = this.attributes.generateSource(e), a = this.varyings.generateSource(e), i = e === "vertex" ? this.vertex : this.fragment, n = i.uniforms.generateSource(), o = i.code.generateSource(), c = e === "vertex" ? sa : ra, d = this.constants.generateSource().concat(i.constants.generateSource()), u = this.outputs.generateSource(e);
303
+ return `#version 300 es
304
+ ${r.join(`
305
+ `)}
306
+
307
+ ${c}
308
+
309
+ ${d.join(`
310
+ `)}
311
+
312
+ ${n.join(`
313
+ `)}
314
+
315
+ ${s.join(`
316
+ `)}
317
+
318
+ ${a.join(`
319
+ `)}
320
+
321
+ ${u.join(`
322
+ `)}
323
+
324
+ ${o.join(`
325
+ `)}`;
326
+ }
327
+ generateBindPass(e) {
328
+ const r = /* @__PURE__ */ new Map();
329
+ this.vertex.uniforms.entries.forEach((i) => {
330
+ const n = i.bind[R.Pass];
331
+ n && r.set(i.name, n);
332
+ }), this.fragment.uniforms.entries.forEach((i) => {
333
+ const n = i.bind[R.Pass];
334
+ n && r.set(i.name, n);
335
+ });
336
+ const s = Array.from(r.values()), a = s.length;
337
+ return (i, n) => {
338
+ for (let o = 0; o < a; ++o)
339
+ s[o](e, i, n);
340
+ };
341
+ }
342
+ generateBindDraw(e) {
343
+ const r = /* @__PURE__ */ new Map();
344
+ this.vertex.uniforms.entries.forEach((i) => {
345
+ const n = i.bind[R.Draw];
346
+ n && r.set(i.name, n);
347
+ }), this.fragment.uniforms.entries.forEach((i) => {
348
+ const n = i.bind[R.Draw];
349
+ n && r.set(i.name, n);
350
+ });
351
+ const s = Array.from(r.values()), a = s.length;
352
+ return (i, n, o) => {
353
+ for (let c = 0; c < a; ++c)
354
+ s[c](e, i, n, o);
355
+ };
356
+ }
357
+ }, Zs = class {
358
+ constructor() {
359
+ this._entries = /* @__PURE__ */ new Map();
360
+ }
361
+ add(...e) {
362
+ for (const r of e)
363
+ this._add(r);
364
+ }
365
+ get(e) {
366
+ return this._entries.get(e);
367
+ }
368
+ _add(e) {
369
+ if (e != null) {
370
+ if (this._entries.has(e.name) && !this._entries.get(e.name).equals(e))
371
+ throw new bt(`Duplicate uniform name ${e.name} for different uniform type`);
372
+ this._entries.set(e.name, e);
373
+ } else
374
+ _r().error(`Trying to add null Uniform from ${new Error().stack}.`);
375
+ }
376
+ generateSource() {
377
+ return Array.from(this._entries.values()).map((e) => e.arraySize != null ? `uniform ${e.type} ${e.name}[${e.arraySize}];` : `uniform ${e.type} ${e.name};`);
378
+ }
379
+ get entries() {
380
+ return Array.from(this._entries.values());
381
+ }
382
+ }, Js = class {
383
+ constructor() {
384
+ this._entries = new Array();
385
+ }
386
+ add(e) {
387
+ this._entries.push(e);
388
+ }
389
+ generateSource() {
390
+ return this._entries;
391
+ }
392
+ }, Wt = class extends gr {
393
+ constructor() {
394
+ super(...arguments), this.uniforms = new Zs(), this.code = new Js(), this.constants = new Tr();
395
+ }
396
+ get builder() {
397
+ return this;
398
+ }
399
+ }, ea = class {
400
+ constructor() {
401
+ this._entries = new Array();
402
+ }
403
+ add(e, r) {
404
+ this._entries.push([e, r]);
405
+ }
406
+ generateSource(e) {
407
+ return e === "fragment" ? [] : this._entries.map((r) => `in ${r[1]} ${r[0]};`);
408
+ }
409
+ }, ta = class {
410
+ constructor() {
411
+ this._entries = /* @__PURE__ */ new Map();
412
+ }
413
+ add(e, r) {
414
+ this._entries.has(e) && U(this._entries.get(e) === r), this._entries.set(e, r);
415
+ }
416
+ generateSource(e) {
417
+ const r = new Array();
418
+ return this._entries.forEach((s, a) => r.push(e === "vertex" ? `out ${s} ${a};` : `in ${s} ${a};`)), r;
419
+ }
420
+ }, Tt = class Et {
421
+ constructor() {
422
+ this._entries = /* @__PURE__ */ new Set();
423
+ }
424
+ add(e) {
425
+ this._entries.add(e);
426
+ }
427
+ generateSource(e) {
428
+ const r = e === "vertex" ? Et.ALLOWLIST_VERTEX : Et.ALLOWLIST_FRAGMENT;
429
+ return Array.from(this._entries).filter((s) => r.includes(s)).map((s) => `#extension ${s} : enable`);
430
+ }
431
+ };
432
+ Tt.ALLOWLIST_FRAGMENT = ["GL_EXT_shader_texture_lod", "GL_OES_standard_derivatives"], Tt.ALLOWLIST_VERTEX = [];
433
+ let St = class At {
434
+ constructor() {
435
+ this._entries = /* @__PURE__ */ new Map();
436
+ }
437
+ add(e, r, s = 0) {
438
+ const a = this._entries.get(s);
439
+ a ? U(a.name === e && a.type === r, `Fragment shader output location ${s} occupied`) : this._entries.set(s, { name: e, type: r });
440
+ }
441
+ generateSource(e) {
442
+ if (e === "vertex")
443
+ return [];
444
+ this._entries.size === 0 && this._entries.set(0, { name: At.DEFAULT_NAME, type: At.DEFAULT_TYPE });
445
+ const r = new Array();
446
+ return this._entries.forEach((s, a) => r.push(`layout(location = ${a}) out ${s.type} ${s.name};`)), r;
447
+ }
448
+ };
449
+ St.DEFAULT_TYPE = "vec4", St.DEFAULT_NAME = "fragColor";
450
+ let Tr = class B {
451
+ constructor() {
452
+ this._entries = /* @__PURE__ */ new Set();
453
+ }
454
+ add(e, r, s) {
455
+ let a = "ERROR_CONSTRUCTOR_STRING";
456
+ switch (r) {
457
+ case "float":
458
+ a = B._numberToFloatStr(s);
459
+ break;
460
+ case "int":
461
+ a = B._numberToIntStr(s);
462
+ break;
463
+ case "bool":
464
+ a = s.toString();
465
+ break;
466
+ case "vec2":
467
+ a = `vec2(${B._numberToFloatStr(s[0])}, ${B._numberToFloatStr(s[1])})`;
468
+ break;
469
+ case "vec3":
470
+ a = `vec3(${B._numberToFloatStr(s[0])}, ${B._numberToFloatStr(s[1])}, ${B._numberToFloatStr(s[2])})`;
471
+ break;
472
+ case "vec4":
473
+ a = `vec4(${B._numberToFloatStr(s[0])}, ${B._numberToFloatStr(s[1])}, ${B._numberToFloatStr(s[2])}, ${B._numberToFloatStr(s[3])})`;
474
+ break;
475
+ case "ivec2":
476
+ a = `ivec2(${B._numberToIntStr(s[0])}, ${B._numberToIntStr(s[1])})`;
477
+ break;
478
+ case "ivec3":
479
+ a = `ivec3(${B._numberToIntStr(s[0])}, ${B._numberToIntStr(s[1])}, ${B._numberToIntStr(s[2])})`;
480
+ break;
481
+ case "ivec4":
482
+ a = `ivec4(${B._numberToIntStr(s[0])}, ${B._numberToIntStr(s[1])}, ${B._numberToIntStr(s[2])}, ${B._numberToIntStr(s[3])})`;
483
+ break;
484
+ case "mat2":
485
+ case "mat3":
486
+ case "mat4":
487
+ a = `${r}(${Array.prototype.map.call(s, (i) => B._numberToFloatStr(i)).join(", ")})`;
488
+ }
489
+ return this._entries.add(`const ${r} ${e} = ${a};`), this;
490
+ }
491
+ static _numberToIntStr(e) {
492
+ return e.toFixed(0);
493
+ }
494
+ static _numberToFloatStr(e) {
495
+ return Number.isInteger(e) ? e.toFixed(1) : e.toString();
496
+ }
497
+ generateSource() {
498
+ return Array.from(this._entries);
499
+ }
500
+ };
501
+ const ra = `#ifdef GL_FRAGMENT_PRECISION_HIGH
502
+ precision highp float;
503
+ precision highp sampler2D;
504
+ #else
505
+ precision mediump float;
506
+ precision mediump sampler2D;
507
+ #endif`, sa = `precision highp float;
508
+ precision highp sampler2D;`;
509
+ var x;
510
+ function Wn(t) {
511
+ return aa(t) || t === x.Depth || t === x.LinearDepth || t === x.Normal || t === x.ObjectAndLayerIdColor;
512
+ }
513
+ function aa(t) {
514
+ return t === x.Shadow || t === x.ShadowHighlight || t === x.ShadowExcludeHighlight;
515
+ }
516
+ function kn(t) {
517
+ return na(t) || t === x.Normal;
518
+ }
519
+ function Er(t) {
520
+ return t === x.Highlight || t === x.ObjectAndLayerIdColor;
521
+ }
522
+ function jn(t) {
523
+ return t === x.Color || Er(t);
524
+ }
525
+ function Sr(t) {
526
+ return t === x.Color || t === x.Alpha;
527
+ }
528
+ function qn(t) {
529
+ return Sr(t) || t === x.ObjectAndLayerIdColor;
530
+ }
531
+ function ia(t) {
532
+ return Sr(t) || Er(t);
533
+ }
534
+ function na(t) {
535
+ return ia(t) || t === x.LinearDepth;
536
+ }
537
+ (function(t) {
538
+ t[t.Color = 0] = "Color", t[t.LinearDepth = 1] = "LinearDepth", t[t.Depth = 2] = "Depth", t[t.Normal = 3] = "Normal", t[t.Shadow = 4] = "Shadow", t[t.ShadowHighlight = 5] = "ShadowHighlight", t[t.ShadowExcludeHighlight = 6] = "ShadowExcludeHighlight", t[t.Highlight = 7] = "Highlight", t[t.Alpha = 8] = "Alpha", t[t.ObjectAndLayerIdColor = 9] = "ObjectAndLayerIdColor", t[t.CompositeColor = 10] = "CompositeColor", t[t.COUNT = 11] = "COUNT";
539
+ })(x || (x = {}));
540
+ const oa = { required: [] }, Xn = { required: [x.LinearDepth] };
541
+ x.CompositeColor;
542
+ x.Highlight;
543
+ const Yn = { required: [x.Depth, x.Normal] };
544
+ let Ar = class extends cr {
545
+ consumes() {
546
+ return oa;
547
+ }
548
+ get usedMemory() {
549
+ return 0;
550
+ }
551
+ get isDecoration() {
552
+ return !1;
553
+ }
554
+ get running() {
555
+ return !1;
556
+ }
557
+ get materialReference() {
558
+ return null;
559
+ }
560
+ modify(e) {
561
+ }
562
+ get numGeometries() {
563
+ return 0;
564
+ }
565
+ get hasOccludees() {
566
+ return !1;
567
+ }
568
+ queryRenderOccludedState(e) {
569
+ return !1;
570
+ }
571
+ }, Qn = class extends Ar {
572
+ }, Jn = class extends Ar {
573
+ constructor() {
574
+ super(...arguments), this.drapedPriority = 0;
575
+ }
576
+ };
577
+ var kt;
578
+ (function(t) {
579
+ t[t.INTEGRATED_MESH = 0] = "INTEGRATED_MESH", t[t.OPAQUE_TERRAIN = 1] = "OPAQUE_TERRAIN", t[t.OPAQUE_MATERIAL = 2] = "OPAQUE_MATERIAL", t[t.OPAQUE_NO_SSAO_DEPTH = 3] = "OPAQUE_NO_SSAO_DEPTH", t[t.TRANSPARENT_MATERIAL = 4] = "TRANSPARENT_MATERIAL", t[t.TRANSPARENT_NO_SSAO_DEPTH = 5] = "TRANSPARENT_NO_SSAO_DEPTH", t[t.TRANSPARENT_TERRAIN = 6] = "TRANSPARENT_TERRAIN", t[t.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL = 7] = "TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL", t[t.OCCLUDED_TERRAIN = 8] = "OCCLUDED_TERRAIN", t[t.OCCLUDER_MATERIAL = 9] = "OCCLUDER_MATERIAL", t[t.TRANSPARENT_OCCLUDER_MATERIAL = 10] = "TRANSPARENT_OCCLUDER_MATERIAL", t[t.OCCLUSION_PIXELS = 11] = "OCCLUSION_PIXELS", t[t.ANTIALIASING = 12] = "ANTIALIASING", t[t.COMPOSITE = 13] = "COMPOSITE", t[t.BLIT = 14] = "BLIT", t[t.SSAO = 15] = "SSAO", t[t.HIGHLIGHT = 16] = "HIGHLIGHT", t[t.SHADOW_HIGHLIGHT = 17] = "SHADOW_HIGHLIGHT", t[t.ENVIRONMENT_OPAQUE = 18] = "ENVIRONMENT_OPAQUE", t[t.ENVIRONMENT_TRANSPARENT = 19] = "ENVIRONMENT_TRANSPARENT", t[t.LASERLINES = 20] = "LASERLINES", t[t.LASERLINES_CONTRAST_CONTROL = 21] = "LASERLINES_CONTRAST_CONTROL", t[t.HUD_MATERIAL = 22] = "HUD_MATERIAL", t[t.LABEL_MATERIAL = 23] = "LABEL_MATERIAL", t[t.LINE_CALLOUTS = 24] = "LINE_CALLOUTS", t[t.LINE_CALLOUTS_HUD_DEPTH = 25] = "LINE_CALLOUTS_HUD_DEPTH", t[t.DRAPED_MATERIAL = 26] = "DRAPED_MATERIAL", t[t.DRAPED_WATER = 27] = "DRAPED_WATER", t[t.VOXEL = 28] = "VOXEL", t[t.MAX_SLOTS = 29] = "MAX_SLOTS";
580
+ })(kt || (kt = {}));
581
+ function ca(t) {
582
+ return Math.abs(t * t * t);
583
+ }
584
+ function xr(t, e, r) {
585
+ const s = r.parameters;
586
+ return ct.scale = Math.min(s.divisor / (e - s.offset), 1), ct.factor = ca(t), ct;
587
+ }
588
+ function Or(t, e) {
589
+ return ue(t * Math.max(e.scale, e.minScaleFactor), t, e.factor);
590
+ }
591
+ function la(t, e, r) {
592
+ const s = xr(t, e, r);
593
+ return s.minScaleFactor = 0, Or(1, s);
594
+ }
595
+ function to(t, e, r, s) {
596
+ s.scale = la(t, e, r), s.factor = 0, s.minScaleFactor = r.minScaleFactor;
597
+ }
598
+ function ro(t, e, r = [0, 0]) {
599
+ const s = Math.min(Math.max(e.scale, e.minScaleFactor), 1);
600
+ return r[0] = t[0] * s, r[1] = t[1] * s, r;
601
+ }
602
+ function ua(t, e, r, s) {
603
+ return Or(t, xr(e, r, s));
604
+ }
605
+ const ct = { scale: 0, factor: 0, minScaleFactor: 0 }, Xe = ts();
606
+ function so(t, e, r, s, a, i) {
607
+ if (t.visible)
608
+ if (t.boundingInfo) {
609
+ U(t.type === xe.Mesh);
610
+ const n = e.tolerance;
611
+ Rr(t.boundingInfo, r, s, n, a, i);
612
+ } else {
613
+ const n = t.attributes.get(m.POSITION), o = n.indices;
614
+ Ir(r, s, 0, o.length / 3, o, n, void 0, a, i);
615
+ }
616
+ }
617
+ const da = b();
618
+ function Rr(t, e, r, s, a, i) {
619
+ if (t == null)
620
+ return;
621
+ const n = ma(e, r, da);
622
+ if (ss(Xe, t.bbMin), as(Xe, t.bbMax), a != null && a.applyToAabb(Xe), fa(Xe, e, n, s)) {
623
+ const { primitiveIndices: o, position: c } = t, d = o ? o.length : c.indices.length / 3;
624
+ if (d > ga) {
625
+ const u = t.getChildren();
626
+ if (u !== void 0) {
627
+ for (const h of u)
628
+ Rr(h, e, r, s, a, i);
629
+ return;
630
+ }
631
+ }
632
+ Ir(e, r, 0, d, c.indices, c, o, a, i);
633
+ }
634
+ }
635
+ const br = b();
636
+ function Ir(t, e, r, s, a, i, n, o, c) {
637
+ if (n)
638
+ return ha(t, e, r, s, a, i, n, o, c);
639
+ const { data: d, stride: u } = i, h = t[0], v = t[1], O = t[2], S = e[0] - h, V = e[1] - v, G = e[2] - O;
640
+ for (let F = r, k = 3 * r; F < s; ++F) {
641
+ let y = u * a[k++], I = d[y++], C = d[y++], w = d[y];
642
+ y = u * a[k++];
643
+ let T = d[y++], E = d[y++], A = d[y];
644
+ y = u * a[k++];
645
+ let g = d[y++], f = d[y++], p = d[y];
646
+ o != null && ([I, C, w] = o.applyToVertex(I, C, w, F), [T, E, A] = o.applyToVertex(T, E, A, F), [g, f, p] = o.applyToVertex(g, f, p, F));
647
+ const _ = T - I, $ = E - C, N = A - w, P = g - I, W = f - C, ie = p - w, me = V * ie - W * G, Pe = G * P - ie * S, Fe = S * W - P * V, J = _ * me + $ * Pe + N * Fe;
648
+ if (Math.abs(J) <= Number.EPSILON)
649
+ continue;
650
+ const X = h - I, fe = v - C, pe = O - w, se = X * me + fe * Pe + pe * Fe;
651
+ if (J > 0) {
652
+ if (se < 0 || se > J)
653
+ continue;
654
+ } else if (se > 0 || se < J)
655
+ continue;
656
+ const ne = fe * N - $ * pe, De = pe * _ - N * X, Be = X * $ - _ * fe, ve = S * ne + V * De + G * Be;
657
+ if (J > 0) {
658
+ if (ve < 0 || se + ve > J)
659
+ continue;
660
+ } else if (ve > 0 || se + ve < J)
661
+ continue;
662
+ const _e = (P * ne + W * De + ie * Be) / J;
663
+ _e >= 0 && c(_e, $r(_, $, N, P, W, ie, br), F, !1);
664
+ }
665
+ }
666
+ function ha(t, e, r, s, a, i, n, o, c) {
667
+ const { data: d, stride: u } = i, h = t[0], v = t[1], O = t[2], S = e[0] - h, V = e[1] - v, G = e[2] - O;
668
+ for (let F = r; F < s; ++F) {
669
+ const k = n[F];
670
+ let y = 3 * k, I = u * a[y++], C = d[I++], w = d[I++], T = d[I];
671
+ I = u * a[y++];
672
+ let E = d[I++], A = d[I++], g = d[I];
673
+ I = u * a[y];
674
+ let f = d[I++], p = d[I++], _ = d[I];
675
+ o != null && ([C, w, T] = o.applyToVertex(C, w, T, F), [E, A, g] = o.applyToVertex(E, A, g, F), [f, p, _] = o.applyToVertex(f, p, _, F));
676
+ const $ = E - C, N = A - w, P = g - T, W = f - C, ie = p - w, me = _ - T, Pe = V * me - ie * G, Fe = G * W - me * S, J = S * ie - W * V, X = $ * Pe + N * Fe + P * J;
677
+ if (Math.abs(X) <= Number.EPSILON)
678
+ continue;
679
+ const fe = h - C, pe = v - w, se = O - T, ne = fe * Pe + pe * Fe + se * J;
680
+ if (X > 0) {
681
+ if (ne < 0 || ne > X)
682
+ continue;
683
+ } else if (ne > 0 || ne < X)
684
+ continue;
685
+ const De = pe * P - N * se, Be = se * $ - P * fe, ve = fe * N - $ * pe, _e = S * De + V * Be + G * ve;
686
+ if (X > 0) {
687
+ if (_e < 0 || ne + _e > X)
688
+ continue;
689
+ } else if (_e > 0 || ne + _e < X)
690
+ continue;
691
+ const Nt = (W * De + ie * Be + me * ve) / X;
692
+ Nt >= 0 && c(Nt, $r($, N, P, W, ie, me, br), k, !1);
693
+ }
694
+ }
695
+ const jt = b(), qt = b();
696
+ function $r(t, e, r, s, a, i, n) {
697
+ return H(jt, t, e, r), H(qt, s, a, i), is(n, jt, qt), ns(n, n), n;
698
+ }
699
+ function ma(t, e, r) {
700
+ return H(r, 1 / (e[0] - t[0]), 1 / (e[1] - t[1]), 1 / (e[2] - t[2]));
701
+ }
702
+ function fa(t, e, r, s) {
703
+ return pa(t, e, r, s, 1 / 0);
704
+ }
705
+ function pa(t, e, r, s, a) {
706
+ const i = (t[0] - s - e[0]) * r[0], n = (t[3] + s - e[0]) * r[0];
707
+ let o = Math.min(i, n), c = Math.max(i, n);
708
+ const d = (t[1] - s - e[1]) * r[1], u = (t[4] + s - e[1]) * r[1];
709
+ if (c = Math.min(c, Math.max(d, u)), c < 0 || (o = Math.max(o, Math.min(d, u)), o > c))
710
+ return !1;
711
+ const h = (t[2] - s - e[2]) * r[2], v = (t[5] + s - e[2]) * r[2];
712
+ return c = Math.min(c, Math.max(h, v)), !(c < 0) && (o = Math.max(o, Math.min(h, v)), !(o > c) && o < a);
713
+ }
714
+ function ao(t, e, r, s, a) {
715
+ let i = (r.screenLength || 0) * t.pixelRatio;
716
+ a != null && (i = ua(i, s, e, a));
717
+ const n = i * Math.tan(0.5 * t.fovY) / (0.5 * t.fullHeight);
718
+ return It(n * e, r.minWorldLength || 0, r.maxWorldLength != null ? r.maxWorldLength : 1 / 0);
719
+ }
720
+ function Lr(t, e) {
721
+ const r = e ? Lr(e) : {};
722
+ for (const s in t) {
723
+ let a = t[s];
724
+ a != null && a.forEach && (a = _a(a)), a == null && s in r || (r[s] = a);
725
+ }
726
+ return r;
727
+ }
728
+ function va(t, e) {
729
+ let r = !1;
730
+ for (const s in e) {
731
+ const a = e[s];
732
+ a !== void 0 && (Array.isArray(a) ? t[s] === null ? (t[s] = a.slice(), r = !0) : rs(t[s], a) && (r = !0) : t[s] !== a && (r = !0, t[s] = a));
733
+ }
734
+ return r;
735
+ }
736
+ function _a(t) {
737
+ const e = [];
738
+ return t.forEach((r) => e.push(r)), e;
739
+ }
740
+ const io = { multiply: 1, ignore: 2, replace: 3, tint: 4 }, ga = 1e3;
741
+ let Ta = class extends Me {
742
+ constructor() {
743
+ super(), this._key = "", this._keyDirty = !1, this._parameterBits = this._parameterBits ? this._parameterBits.map(() => 0) : [], this._parameterNames || (this._parameterNames = []);
744
+ }
745
+ get key() {
746
+ return this._keyDirty && (this._keyDirty = !1, this._key = String.fromCharCode.apply(String, this._parameterBits)), this._key;
747
+ }
748
+ snapshot() {
749
+ const e = this._parameterNames, r = { key: this.key };
750
+ for (const s of e)
751
+ r[s] = this[s];
752
+ return r;
753
+ }
754
+ };
755
+ function ke(t = {}) {
756
+ return (e, r) => {
757
+ if (e._parameterNames = e._parameterNames ?? [], e._parameterNames.push(r), t.constValue != null)
758
+ Object.defineProperty(e, r, { get: () => t.constValue });
759
+ else {
760
+ const s = e._parameterNames.length - 1, a = t.count || 2, i = Math.ceil(Math.log2(a)), n = e._parameterBits ?? [0];
761
+ let o = 0;
762
+ for (; n[o] + i > 16; )
763
+ o++, o >= n.length && n.push(0);
764
+ e._parameterBits = n;
765
+ const c = n[o], d = (1 << i) - 1 << c;
766
+ n[o] += i, Object.defineProperty(e, r, { get() {
767
+ return this[s];
768
+ }, set(u) {
769
+ if (this[s] !== u && (this[s] = u, this._keyDirty = !0, this._parameterBits[o] = this._parameterBits[o] & ~d | +u << c & d, typeof u != "number" && typeof u != "boolean"))
770
+ throw new Error("Configuration value for " + r + " must be boolean or number, got " + typeof u);
771
+ } });
772
+ }
773
+ };
774
+ }
775
+ const Ea = /* @__PURE__ */ new Map([[m.POSITION, 0], [m.NORMAL, 1], [m.NORMALCOMPRESSED, 1], [m.UV0, 2], [m.COLOR, 3], [m.COLORFEATUREATTRIBUTE, 3], [m.SIZE, 4], [m.TANGENT, 4], [m.CENTEROFFSETANDDISTANCE, 5], [m.SYMBOLCOLOR, 5], [m.FEATUREATTRIBUTE, 6], [m.INSTANCEFEATUREATTRIBUTE, 6], [m.INSTANCECOLOR, 7], [m.OBJECTANDLAYERIDCOLOR, 7], [m.INSTANCEOBJECTANDLAYERIDCOLOR, 7], [m.INSTANCEMODEL, 8], [m.INSTANCEMODELNORMAL, 12], [m.INSTANCEMODELORIGINHI, 11], [m.INSTANCEMODELORIGINLO, 15]]);
776
+ function oo(t, e = !0) {
777
+ t.attributes.add(m.POSITION, "vec2"), e && t.varyings.add("uv", "vec2"), t.vertex.code.add(l`
778
+ void main(void) {
779
+ gl_Position = vec4(position, 0.0, 1.0);
780
+ ${e ? l`uv = position * 0.5 + vec2(0.5);` : ""}
781
+ }
782
+ `);
783
+ }
784
+ let M = class extends cr {
785
+ constructor() {
786
+ super(...arguments), this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR = !1, this.DECONFLICTOR_SHOW_VISIBLE = !1, this.DECONFLICTOR_SHOW_INVISIBLE = !1, this.DECONFLICTOR_SHOW_GRID = !1, this.LABELS_SHOW_BORDER = !1, this.TEXT_SHOW_BASELINE = !1, this.TEXT_SHOW_BORDER = !1, this.OVERLAY_DRAW_DEBUG_TEXTURE = !1, this.OVERLAY_SHOW_CENTER = !1, this.SHOW_POI = !1, this.TESTS_DISABLE_OPTIMIZATIONS = !1, this.TESTS_DISABLE_FAST_UPDATES = !1, this.DRAW_MESH_GEOMETRY_NORMALS = !1, this.FEATURE_TILE_FETCH_SHOW_TILES = !1, this.FEATURE_TILE_TREE_SHOW_TILES = !1, this.TERRAIN_TILE_TREE_SHOW_TILES = !1, this.I3S_TREE_SHOW_TILES = !1, this.I3S_SHOW_MODIFICATIONS = !1, this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES = !1, this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL = !1, this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES = !1, this.LINE_WIREFRAMES = !1;
787
+ }
788
+ };
789
+ L([D()], M.prototype, "SCENEVIEW_HITTEST_RETURN_INTERSECTOR", void 0), L([D()], M.prototype, "DECONFLICTOR_SHOW_VISIBLE", void 0), L([D()], M.prototype, "DECONFLICTOR_SHOW_INVISIBLE", void 0), L([D()], M.prototype, "DECONFLICTOR_SHOW_GRID", void 0), L([D()], M.prototype, "LABELS_SHOW_BORDER", void 0), L([D()], M.prototype, "TEXT_SHOW_BASELINE", void 0), L([D()], M.prototype, "TEXT_SHOW_BORDER", void 0), L([D()], M.prototype, "OVERLAY_DRAW_DEBUG_TEXTURE", void 0), L([D()], M.prototype, "OVERLAY_SHOW_CENTER", void 0), L([D()], M.prototype, "SHOW_POI", void 0), L([D()], M.prototype, "TESTS_DISABLE_OPTIMIZATIONS", void 0), L([D()], M.prototype, "TESTS_DISABLE_FAST_UPDATES", void 0), L([D()], M.prototype, "DRAW_MESH_GEOMETRY_NORMALS", void 0), L([D()], M.prototype, "FEATURE_TILE_FETCH_SHOW_TILES", void 0), L([D()], M.prototype, "FEATURE_TILE_TREE_SHOW_TILES", void 0), L([D()], M.prototype, "TERRAIN_TILE_TREE_SHOW_TILES", void 0), L([D()], M.prototype, "I3S_TREE_SHOW_TILES", void 0), L([D()], M.prototype, "I3S_SHOW_MODIFICATIONS", void 0), L([D()], M.prototype, "LOD_INSTANCE_RENDERER_DISABLE_UPDATES", void 0), L([D()], M.prototype, "LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL", void 0), L([D()], M.prototype, "EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES", void 0), L([D()], M.prototype, "LINE_WIREFRAMES", void 0), M = L([os("esri.views.3d.support.DebugFlags")], M);
790
+ const lo = new M();
791
+ var Xt, Yt;
792
+ (function(t) {
793
+ t[t.RED = 0] = "RED", t[t.RG = 1] = "RG", t[t.RGBA4 = 2] = "RGBA4", t[t.RGBA = 3] = "RGBA", t[t.RGBA_MIPMAP = 4] = "RGBA_MIPMAP", t[t.R16F = 5] = "R16F", t[t.RGBA16F = 6] = "RGBA16F";
794
+ })(Xt || (Xt = {})), function(t) {
795
+ t[t.DEPTH_STENCIL_TEXTURE = 0] = "DEPTH_STENCIL_TEXTURE", t[t.DEPTH16_BUFFER = 1] = "DEPTH16_BUFFER";
796
+ }(Yt || (Yt = {}));
797
+ function Sa(t, e) {
798
+ switch (e.normalType) {
799
+ case K.Compressed:
800
+ t.attributes.add(m.NORMALCOMPRESSED, "vec2"), t.vertex.code.add(l`vec3 decompressNormal(vec2 normal) {
801
+ float z = 1.0 - abs(normal.x) - abs(normal.y);
802
+ return vec3(normal + sign(normal) * min(z, 0.0), z);
803
+ }
804
+ vec3 normalModel() {
805
+ return decompressNormal(normalCompressed);
806
+ }`);
807
+ break;
808
+ case K.Attribute:
809
+ t.attributes.add(m.NORMAL, "vec3"), t.vertex.code.add(l`vec3 normalModel() {
810
+ return normal;
811
+ }`);
812
+ break;
813
+ case K.ScreenDerivative:
814
+ t.fragment.code.add(l`vec3 screenDerivativeNormal(vec3 positionView) {
815
+ return normalize(cross(dFdx(positionView), dFdy(positionView)));
816
+ }`);
817
+ break;
818
+ default:
819
+ nt(e.normalType);
820
+ case K.COUNT:
821
+ case K.Ground:
822
+ }
823
+ }
824
+ var K;
825
+ (function(t) {
826
+ t[t.Attribute = 0] = "Attribute", t[t.Compressed = 1] = "Compressed", t[t.Ground = 2] = "Ground", t[t.ScreenDerivative = 3] = "ScreenDerivative", t[t.COUNT = 4] = "COUNT";
827
+ })(K || (K = {}));
828
+ function Aa(t) {
829
+ t.attributes.add(m.POSITION, "vec3"), t.vertex.code.add(l`vec3 positionModel() { return position; }`);
830
+ }
831
+ function yr({ code: t }, e) {
832
+ e.doublePrecisionRequiresObfuscation ? t.add(l`vec3 dpPlusFrc(vec3 a, vec3 b) {
833
+ return mix(a, a + b, vec3(notEqual(b, vec3(0))));
834
+ }
835
+ vec3 dpMinusFrc(vec3 a, vec3 b) {
836
+ return mix(vec3(0), a - b, vec3(notEqual(a, b)));
837
+ }
838
+ vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
839
+ vec3 t1 = dpPlusFrc(hiA, hiB);
840
+ vec3 e = dpMinusFrc(t1, hiA);
841
+ vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB;
842
+ return t1 + t2;
843
+ }`) : t.add(l`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
844
+ vec3 t1 = hiA + hiB;
845
+ vec3 e = t1 - hiA;
846
+ vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB;
847
+ return t1 + t2;
848
+ }`);
849
+ }
850
+ let te = class extends j {
851
+ constructor(e, r) {
852
+ super(e, "vec3", R.Draw, (s, a, i, n) => s.setUniform3fv(e, r(a, i, n)));
853
+ }
854
+ }, Cr = class extends j {
855
+ constructor(e, r) {
856
+ super(e, "mat3", R.Draw, (s, a, i) => s.setUniformMatrix3fv(e, r(a, i)));
857
+ }
858
+ }, ot = class extends j {
859
+ constructor(e, r) {
860
+ super(e, "mat3", R.Pass, (s, a, i) => s.setUniformMatrix3fv(e, r(a, i)));
861
+ }
862
+ };
863
+ function wr(t, e) {
864
+ t.include(Aa);
865
+ const r = t.vertex;
866
+ r.include(yr, e), t.varyings.add("vPositionWorldCameraRelative", "vec3"), t.varyings.add("vPosition_view", "vec3"), r.uniforms.add(new q("transformWorldFromViewTH", (s) => s.transformWorldFromViewTH), new q("transformWorldFromViewTL", (s) => s.transformWorldFromViewTL), new ot("transformViewFromCameraRelativeRS", (s) => s.transformViewFromCameraRelativeRS), new $e("transformProjFromView", (s) => s.transformProjFromView), new Cr("transformWorldFromModelRS", (s) => s.transformWorldFromModelRS), new te("transformWorldFromModelTH", (s) => s.transformWorldFromModelTH), new te("transformWorldFromModelTL", (s) => s.transformWorldFromModelTL)), r.code.add(l`vec3 positionWorldCameraRelative() {
867
+ vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
868
+ vec3 transform_CameraRelativeFromModel = dpAdd(
869
+ transformWorldFromModelTL,
870
+ transformWorldFromModelTH,
871
+ -transformWorldFromViewTL,
872
+ -transformWorldFromViewTH
873
+ );
874
+ return transform_CameraRelativeFromModel + rotatedModelPosition;
875
+ }`), r.code.add(l`
876
+ void forwardPosition(float fOffset) {
877
+ vPositionWorldCameraRelative = positionWorldCameraRelative();
878
+ if (fOffset != 0.0) {
879
+ vPositionWorldCameraRelative += fOffset * ${e.spherical ? l`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)` : l`vec3(0.0, 0.0, 1.0)`};
880
+ }
881
+
882
+ vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
883
+ gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
884
+ }
885
+ `), t.fragment.uniforms.add(new q("transformWorldFromViewTL", (s) => s.transformWorldFromViewTL)), r.code.add(l`vec3 positionWorld() {
886
+ return transformWorldFromViewTL + vPositionWorldCameraRelative;
887
+ }`), t.fragment.code.add(l`vec3 positionWorld() {
888
+ return transformWorldFromViewTL + vPositionWorldCameraRelative;
889
+ }`);
890
+ }
891
+ class xa extends Me {
892
+ constructor() {
893
+ super(...arguments), this.transformWorldFromViewTH = b(), this.transformWorldFromViewTL = b(), this.transformViewFromCameraRelativeRS = Ne(), this.transformProjFromView = Ae();
894
+ }
895
+ }
896
+ let Oa = class extends Me {
897
+ constructor() {
898
+ super(...arguments), this.transformWorldFromModelRS = Ne(), this.transformWorldFromModelTH = b(), this.transformWorldFromModelTL = b();
899
+ }
900
+ };
901
+ function po(t, e) {
902
+ switch (e.normalType) {
903
+ case K.Attribute:
904
+ case K.Compressed:
905
+ t.include(Sa, e), t.varyings.add("vNormalWorld", "vec3"), t.varyings.add("vNormalView", "vec3"), t.vertex.uniforms.add(new Cr("transformNormalGlobalFromModel", (r) => r.transformNormalGlobalFromModel), new ot("transformNormalViewFromGlobal", (r) => r.transformNormalViewFromGlobal)), t.vertex.code.add(l`void forwardNormal() {
906
+ vNormalWorld = transformNormalGlobalFromModel * normalModel();
907
+ vNormalView = transformNormalViewFromGlobal * vNormalWorld;
908
+ }`);
909
+ break;
910
+ case K.Ground:
911
+ t.include(wr, e), t.varyings.add("vNormalWorld", "vec3"), t.vertex.code.add(l`
912
+ void forwardNormal() {
913
+ vNormalWorld = ${e.spherical ? l`normalize(vPositionWorldCameraRelative);` : l`vec3(0.0, 0.0, 1.0);`}
914
+ }
915
+ `);
916
+ break;
917
+ case K.ScreenDerivative:
918
+ t.vertex.code.add(l`void forwardNormal() {}`);
919
+ break;
920
+ default:
921
+ nt(e.normalType);
922
+ case K.COUNT:
923
+ }
924
+ }
925
+ let vo = class extends xa {
926
+ constructor() {
927
+ super(...arguments), this.transformNormalViewFromGlobal = Ne();
928
+ }
929
+ }, go = class extends Oa {
930
+ constructor() {
931
+ super(...arguments), this.transformNormalGlobalFromModel = Ne(), this.toMapSpace = Lt();
932
+ }
933
+ };
934
+ var Q;
935
+ function Ra(t, e) {
936
+ switch (e.textureCoordinateType) {
937
+ case Q.Default:
938
+ return t.attributes.add(m.UV0, "vec2"), t.varyings.add("vuv0", "vec2"), void t.vertex.code.add(l`void forwardTextureCoordinates() {
939
+ vuv0 = uv0;
940
+ }`);
941
+ case Q.Compressed:
942
+ return t.attributes.add(m.UV0, "vec2"), t.varyings.add("vuv0", "vec2"), void t.vertex.code.add(l`vec2 getUV0() {
943
+ return uv0 / 16384.0;
944
+ }
945
+ void forwardTextureCoordinates() {
946
+ vuv0 = getUV0();
947
+ }`);
948
+ case Q.Atlas:
949
+ return t.attributes.add(m.UV0, "vec2"), t.varyings.add("vuv0", "vec2"), t.attributes.add(m.UVREGION, "vec4"), t.varyings.add("vuvRegion", "vec4"), void t.vertex.code.add(l`void forwardTextureCoordinates() {
950
+ vuv0 = uv0;
951
+ vuvRegion = uvRegion;
952
+ }`);
953
+ default:
954
+ nt(e.textureCoordinateType);
955
+ case Q.None:
956
+ return void t.vertex.code.add(l`void forwardTextureCoordinates() {}`);
957
+ case Q.COUNT:
958
+ return;
959
+ }
960
+ }
961
+ (function(t) {
962
+ t[t.None = 0] = "None", t[t.Default = 1] = "Default", t[t.Atlas = 2] = "Atlas", t[t.Compressed = 3] = "Compressed", t[t.COUNT = 4] = "COUNT";
963
+ })(Q || (Q = {}));
964
+ function ba(t) {
965
+ t.fragment.code.add(l`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
966
+ vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
967
+ vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
968
+ float maxdUV = 0.125;
969
+ vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
970
+ vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
971
+ return textureGrad(tex, uvAtlas, dUVdx, dUVdy);
972
+ }`);
973
+ }
974
+ function Ia(t, e) {
975
+ switch (t.include(Ra, e), e.textureCoordinateType) {
976
+ case Q.Default:
977
+ case Q.Compressed:
978
+ return void t.fragment.code.add(l`vec4 textureLookup(sampler2D tex, vec2 uv) {
979
+ return texture(tex, uv);
980
+ }`);
981
+ case Q.Atlas:
982
+ return t.include(ba), void t.fragment.code.add(l`vec4 textureLookup(sampler2D tex, vec2 uv) {
983
+ return textureAtlasLookup(tex, uv, vuvRegion);
984
+ }`);
985
+ default:
986
+ nt(e.textureCoordinateType);
987
+ case Q.None:
988
+ case Q.COUNT:
989
+ return;
990
+ }
991
+ }
992
+ let lt = class extends j {
993
+ constructor(e, r) {
994
+ super(e, "sampler2D", R.Draw, (s, a, i) => s.bindTexture(e, r(a, i)));
995
+ }
996
+ }, $a = class {
997
+ constructor(e) {
998
+ this._material = e.material, this._techniqueRepository = e.techniqueRep, this._output = e.output;
999
+ }
1000
+ dispose() {
1001
+ this._techniqueRepository.release(this._technique);
1002
+ }
1003
+ get technique() {
1004
+ return this._technique;
1005
+ }
1006
+ get _stippleTextureRepository() {
1007
+ return this._techniqueRepository.constructionContext.stippleTextureRepository;
1008
+ }
1009
+ get _markerTextureRepository() {
1010
+ return this._techniqueRepository.constructionContext.markerTextureRepository;
1011
+ }
1012
+ ensureTechnique(e, r) {
1013
+ return this._technique = this._techniqueRepository.releaseAndAcquire(e, this._material.getConfiguration(this._output, r), this._technique), this._technique;
1014
+ }
1015
+ ensureResources(e) {
1016
+ return gt.LOADED;
1017
+ }
1018
+ }, Ao = class extends $a {
1019
+ constructor(e) {
1020
+ super(e), this._numLoading = 0, this._disposed = !1, this._textureRepository = e.textureRepository, this._textureId = e.textureId, this._acquire(e.textureId, (r) => this._texture = r), this._acquire(e.normalTextureId, (r) => this._textureNormal = r), this._acquire(e.emissiveTextureId, (r) => this._textureEmissive = r), this._acquire(e.occlusionTextureId, (r) => this._textureOcclusion = r), this._acquire(e.metallicRoughnessTextureId, (r) => this._textureMetallicRoughness = r);
1021
+ }
1022
+ dispose() {
1023
+ this._texture = ge(this._texture), this._textureNormal = ge(this._textureNormal), this._textureEmissive = ge(this._textureEmissive), this._textureOcclusion = ge(this._textureOcclusion), this._textureMetallicRoughness = ge(this._textureMetallicRoughness), this._disposed = !0;
1024
+ }
1025
+ ensureResources(e) {
1026
+ return this._numLoading === 0 ? gt.LOADED : gt.LOADING;
1027
+ }
1028
+ get textureBindParameters() {
1029
+ return new La(this._texture != null ? this._texture.glTexture : null, this._textureNormal != null ? this._textureNormal.glTexture : null, this._textureEmissive != null ? this._textureEmissive.glTexture : null, this._textureOcclusion != null ? this._textureOcclusion.glTexture : null, this._textureMetallicRoughness != null ? this._textureMetallicRoughness.glTexture : null);
1030
+ }
1031
+ updateTexture(e) {
1032
+ this._texture != null && e === this._texture.id || (this._texture = ge(this._texture), this._textureId = e, this._acquire(this._textureId, (r) => this._texture = r));
1033
+ }
1034
+ _acquire(e, r) {
1035
+ if (e == null)
1036
+ return void r(null);
1037
+ const s = this._textureRepository.acquire(e);
1038
+ if (cs(s))
1039
+ return ++this._numLoading, void s.then((a) => {
1040
+ if (this._disposed)
1041
+ return ge(a), void r(null);
1042
+ r(a);
1043
+ }).finally(() => --this._numLoading);
1044
+ r(s);
1045
+ }
1046
+ }, La = class extends Me {
1047
+ constructor(e = null, r = null, s = null, a = null, i = null, n, o) {
1048
+ super(), this.texture = e, this.textureNormal = r, this.textureEmissive = s, this.textureOcclusion = a, this.textureMetallicRoughness = i, this.scale = n, this.normalTextureTransformMatrix = o;
1049
+ }
1050
+ };
1051
+ var Ie;
1052
+ (function(t) {
1053
+ t[t.Disabled = 0] = "Disabled", t[t.Normal = 1] = "Normal", t[t.Schematic = 2] = "Schematic", t[t.Water = 3] = "Water", t[t.WaterOnIntegratedMesh = 4] = "WaterOnIntegratedMesh", t[t.Simplified = 5] = "Simplified", t[t.TerrainWithWater = 6] = "TerrainWithWater", t[t.COUNT = 7] = "COUNT";
1054
+ })(Ie || (Ie = {}));
1055
+ function Ro(t, e) {
1056
+ const r = t.fragment, s = e.hasMetallicRoughnessTexture || e.hasEmissionTexture || e.hasOcclusionTexture;
1057
+ if (e.pbrMode === Ie.Normal && s && t.include(Ia, e), e.pbrMode !== Ie.Schematic)
1058
+ if (e.pbrMode !== Ie.Disabled) {
1059
+ if (e.pbrMode === Ie.Normal) {
1060
+ r.code.add(l`vec3 mrr;
1061
+ vec3 emission;
1062
+ float occlusion;`);
1063
+ const a = e.pbrTextureBindType;
1064
+ e.hasMetallicRoughnessTexture && (r.uniforms.add(a === R.Pass ? new We("texMetallicRoughness", (i) => i.textureMetallicRoughness) : new lt("texMetallicRoughness", (i) => i.textureMetallicRoughness)), r.code.add(l`void applyMetallnessAndRoughness(vec2 uv) {
1065
+ vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
1066
+ mrr[0] *= metallicRoughness.b;
1067
+ mrr[1] *= metallicRoughness.g;
1068
+ }`)), e.hasEmissionTexture && (r.uniforms.add(a === R.Pass ? new We("texEmission", (i) => i.textureEmissive) : new lt("texEmission", (i) => i.textureEmissive)), r.code.add(l`void applyEmission(vec2 uv) {
1069
+ emission *= textureLookup(texEmission, uv).rgb;
1070
+ }`)), e.hasOcclusionTexture ? (r.uniforms.add(a === R.Pass ? new We("texOcclusion", (i) => i.textureOcclusion) : new lt("texOcclusion", (i) => i.textureOcclusion)), r.code.add(l`void applyOcclusion(vec2 uv) {
1071
+ occlusion *= textureLookup(texOcclusion, uv).r;
1072
+ }
1073
+ float getBakedOcclusion() {
1074
+ return occlusion;
1075
+ }`)) : r.code.add(l`float getBakedOcclusion() { return 1.0; }`), a === R.Pass ? r.uniforms.add(new q("emissionFactor", (i) => i.emissiveFactor), new q("mrrFactors", (i) => i.mrrFactors)) : r.uniforms.add(new te("emissionFactor", (i) => i.emissiveFactor), new te("mrrFactors", (i) => i.mrrFactors)), r.code.add(l`
1076
+ void applyPBRFactors() {
1077
+ mrr = mrrFactors;
1078
+ emission = emissionFactor;
1079
+ occlusion = 1.0;
1080
+
1081
+ ${e.hasMetallicRoughnessTexture ? l`applyMetallnessAndRoughness(${e.hasMetallicRoughnessTextureTransform ? l`metallicRoughnessUV` : "vuv0"});` : ""}
1082
+
1083
+ ${e.hasEmissionTexture ? l`applyEmission(${e.hasEmissiveTextureTransform ? l`emissiveUV` : "vuv0"});` : ""}
1084
+
1085
+ ${e.hasOcclusionTexture ? l`applyOcclusion(${e.hasOcclusionTextureTransform ? l`occlusionUV` : "vuv0"});` : ""}
1086
+ }
1087
+ `);
1088
+ }
1089
+ } else
1090
+ r.code.add(l`float getBakedOcclusion() { return 1.0; }`);
1091
+ else
1092
+ r.code.add(l`vec3 mrr = vec3(0.0, 0.6, 0.2);
1093
+ vec3 emission = vec3(0.0);
1094
+ float occlusion = 1.0;
1095
+ void applyPBRFactors() {}
1096
+ float getBakedOcclusion() { return 1.0; }`);
1097
+ }
1098
+ function bo(t) {
1099
+ t.vertex.code.add(l`const float PI = 3.141592653589793;`), t.fragment.code.add(l`const float PI = 3.141592653589793;
1100
+ const float LIGHT_NORMALIZATION = 1.0 / PI;
1101
+ const float INV_PI = 0.3183098861837907;
1102
+ const float HALF_PI = 1.570796326794897;`);
1103
+ }
1104
+ let Io = class extends j {
1105
+ constructor(e, r) {
1106
+ super(e, "bool", R.Pass, (s, a, i) => s.setUniform1b(e, r(a, i)));
1107
+ }
1108
+ };
1109
+ function ya(t) {
1110
+ if (t.length < ir)
1111
+ return Array.from(t);
1112
+ if (ls(t))
1113
+ return Float64Array.from(t);
1114
+ if (!("BYTES_PER_ELEMENT" in t))
1115
+ return Array.from(t);
1116
+ switch (t.BYTES_PER_ELEMENT) {
1117
+ case 1:
1118
+ return Uint8Array.from(t);
1119
+ case 2:
1120
+ return us(t) ? Uint16Array.from(t) : Int16Array.from(t);
1121
+ case 4:
1122
+ return Float32Array.from(t);
1123
+ default:
1124
+ return Float64Array.from(t);
1125
+ }
1126
+ }
1127
+ function Ca(t, e) {
1128
+ if (!t)
1129
+ return !1;
1130
+ const { size: r, data: s, indices: a } = t;
1131
+ H(e, 0, 0, 0), H(Y, 0, 0, 0);
1132
+ let i = 0, n = 0;
1133
+ for (let o = 0; o < a.length - 2; o += 3) {
1134
+ const c = a[o] * r, d = a[o + 1] * r, u = a[o + 2] * r;
1135
+ H(z, s[c], s[c + 1], s[c + 2]), H(oe, s[d], s[d + 1], s[d + 2]), H(Ye, s[u], s[u + 1], s[u + 2]);
1136
+ const h = Ps(z, oe, Ye);
1137
+ h ? (ee(z, z, oe), ee(z, z, Ye), ae(z, z, 1 / 3 * h), ee(e, e, z), i += h) : (ee(Y, Y, z), ee(Y, Y, oe), ee(Y, Y, Ye), n += 3);
1138
+ }
1139
+ return (n !== 0 || i !== 0) && (i !== 0 ? (ae(e, e, 1 / i), !0) : n !== 0 && (ae(e, Y, 1 / n), !0));
1140
+ }
1141
+ function wa(t, e) {
1142
+ if (!t)
1143
+ return !1;
1144
+ const { size: r, data: s, indices: a } = t;
1145
+ H(e, 0, 0, 0);
1146
+ let i = -1, n = 0;
1147
+ for (let o = 0; o < a.length; o++) {
1148
+ const c = a[o] * r;
1149
+ i !== c && (e[0] += s[c], e[1] += s[c + 1], e[2] += s[c + 2], n++), i = c;
1150
+ }
1151
+ return n > 1 && ae(e, e, 1 / n), n > 0;
1152
+ }
1153
+ function Ma(t, e, r) {
1154
+ if (!t)
1155
+ return !1;
1156
+ H(r, 0, 0, 0), H(Y, 0, 0, 0);
1157
+ let s = 0, a = 0;
1158
+ const { size: i, data: n, indices: o } = t, c = o.length - 1, d = c + (e ? 2 : 0);
1159
+ for (let u = 0; u < d; u += 2) {
1160
+ const h = u < c ? u + 1 : 0, v = o[u < c ? u : c] * i, O = o[h] * i;
1161
+ z[0] = n[v], z[1] = n[v + 1], z[2] = n[v + 2], oe[0] = n[O], oe[1] = n[O + 1], oe[2] = n[O + 2], ae(z, ee(z, z, oe), 0.5);
1162
+ const S = ds(z, oe);
1163
+ S > 0 ? (ee(r, r, ae(z, z, S)), s += S) : s === 0 && (ee(Y, Y, z), a++);
1164
+ }
1165
+ return s !== 0 ? (ae(r, r, 1 / s), !0) : a !== 0 && (ae(r, Y, 1 / a), !0);
1166
+ }
1167
+ const z = b(), oe = b(), Ye = b(), Y = b();
1168
+ let Lo = class Mr extends yt {
1169
+ constructor(e, r, s = null, a = xe.Mesh, i = null, n = -1) {
1170
+ super(), this.material = e, this.mapPositions = s, this.type = a, this.objectAndLayerIdColor = i, this.edgeIndicesLength = n, this.visible = !0, this._attributes = /* @__PURE__ */ new Map(), this._boundingInfo = null;
1171
+ for (const [o, c] of r)
1172
+ this._attributes.set(o, { ...c, indices: Ms(c.indices) }), o === m.POSITION && (this.edgeIndicesLength = this.edgeIndicesLength < 0 ? this._attributes.get(o).indices.length : this.edgeIndicesLength);
1173
+ }
1174
+ instantiate(e = {}) {
1175
+ const r = new Mr(e.material || this.material, [], this.mapPositions, this.type, this.objectAndLayerIdColor, this.edgeIndicesLength);
1176
+ return this._attributes.forEach((s, a) => {
1177
+ s.exclusive = !1, r._attributes.set(a, s);
1178
+ }), r._boundingInfo = this._boundingInfo, r.transformation = e.transformation || this.transformation, r;
1179
+ }
1180
+ get attributes() {
1181
+ return this._attributes;
1182
+ }
1183
+ getMutableAttribute(e) {
1184
+ let r = this._attributes.get(e);
1185
+ return r && !r.exclusive && (r = { ...r, exclusive: !0, data: ya(r.data) }, this._attributes.set(e, r)), r;
1186
+ }
1187
+ setAttributeData(e, r) {
1188
+ const s = this._attributes.get(e);
1189
+ s && this._attributes.set(e, { ...s, exclusive: !0, data: r });
1190
+ }
1191
+ get indexCount() {
1192
+ const e = this._attributes.values().next().value.indices;
1193
+ return (e == null ? void 0 : e.length) ?? 0;
1194
+ }
1195
+ get faceCount() {
1196
+ return this.indexCount / 3;
1197
+ }
1198
+ get boundingInfo() {
1199
+ return this._boundingInfo == null && (this._boundingInfo = this._calculateBoundingInfo()), this._boundingInfo;
1200
+ }
1201
+ computeAttachmentOrigin(e) {
1202
+ return !!(this.type === xe.Mesh ? this._computeAttachmentOriginTriangles(e) : this.type === xe.Line ? this._computeAttachmentOriginLines(e) : this._computeAttachmentOriginPoints(e)) && (this._transformation != null && ye(e, e, this._transformation), !0);
1203
+ }
1204
+ _computeAttachmentOriginTriangles(e) {
1205
+ const r = this.attributes.get(m.POSITION);
1206
+ return Ca(r, e);
1207
+ }
1208
+ _computeAttachmentOriginLines(e) {
1209
+ const r = this.attributes.get(m.POSITION);
1210
+ return Ma(r, Na(this.material.parameters, r), e);
1211
+ }
1212
+ _computeAttachmentOriginPoints(e) {
1213
+ const r = this.attributes.get(m.POSITION);
1214
+ return wa(r, e);
1215
+ }
1216
+ invalidateBoundingInfo() {
1217
+ this._boundingInfo = null;
1218
+ }
1219
+ _calculateBoundingInfo() {
1220
+ const e = this.attributes.get(m.POSITION);
1221
+ if (!e || e.indices.length === 0)
1222
+ return null;
1223
+ const r = this.type === xe.Mesh ? 3 : 1;
1224
+ U(e.indices.length % r == 0, "Indexing error: " + e.indices.length + " not divisible by " + r);
1225
+ const s = Ns(e.indices.length / r);
1226
+ return new Fs(s, r, e);
1227
+ }
1228
+ get transformation() {
1229
+ return this._transformation ?? rt;
1230
+ }
1231
+ set transformation(e) {
1232
+ this._transformation = e && e !== rt ? ws(e) : null;
1233
+ }
1234
+ addHighlight() {
1235
+ const e = new ks(ys.Highlight);
1236
+ return this.highlights = js(this.highlights, e), e;
1237
+ }
1238
+ removeHighlight(e) {
1239
+ this.highlights = qs(this.highlights, e);
1240
+ }
1241
+ };
1242
+ function Na(t, e) {
1243
+ return !(!("isClosed" in t) || !t.isClosed) && e.indices.length > 2;
1244
+ }
1245
+ let yo = class extends yt {
1246
+ constructor(e, r) {
1247
+ super(), this.type = xe.Material, this.supportsEdges = !1, this._visible = !0, this._renderPriority = 0, this._vertexAttributeLocations = Ea, this._pp0 = qe(0, 0, 1), this._pp1 = qe(0, 0, 0), this._parameters = Lr(e, r), this.validateParameters(this._parameters);
1248
+ }
1249
+ get parameters() {
1250
+ return this._parameters;
1251
+ }
1252
+ update(e) {
1253
+ return !1;
1254
+ }
1255
+ setParameters(e, r = !0) {
1256
+ va(this._parameters, e) && (this.validateParameters(this._parameters), r && this.parametersChanged());
1257
+ }
1258
+ validateParameters(e) {
1259
+ }
1260
+ get visible() {
1261
+ return this._visible;
1262
+ }
1263
+ set visible(e) {
1264
+ e !== this._visible && (this._visible = e, this.parametersChanged());
1265
+ }
1266
+ shouldRender(e) {
1267
+ return this.isVisible() && this.isVisibleForOutput(e.output) && (!this.parameters.isDecoration || e.bindParameters.decorations === Cs.ON) && (this.parameters.renderOccluded & e.renderOccludedMask) != 0;
1268
+ }
1269
+ isVisibleForOutput(e) {
1270
+ return !0;
1271
+ }
1272
+ get renderPriority() {
1273
+ return this._renderPriority;
1274
+ }
1275
+ set renderPriority(e) {
1276
+ e !== this._renderPriority && (this._renderPriority = e, this.parametersChanged());
1277
+ }
1278
+ get vertexAttributeLocations() {
1279
+ return this._vertexAttributeLocations;
1280
+ }
1281
+ isVisible() {
1282
+ return this._visible;
1283
+ }
1284
+ parametersChanged() {
1285
+ var e;
1286
+ (e = this.repository) == null || e.materialChanged(this);
1287
+ }
1288
+ queryRenderOccludedState(e) {
1289
+ return this.isVisible() && this.parameters.renderOccluded === e;
1290
+ }
1291
+ intersectDraped(e, r, s, a, i, n) {
1292
+ return this._pp0[0] = this._pp1[0] = a[0], this._pp0[1] = this._pp1[1] = a[1], this.intersect(e, r, s, this._pp0, this._pp1, i);
1293
+ }
1294
+ };
1295
+ var st;
1296
+ (function(t) {
1297
+ t[t.None = 0] = "None", t[t.Occlude = 1] = "Occlude", t[t.Transparent = 2] = "Transparent", t[t.OccludeAndTransparent = 4] = "OccludeAndTransparent", t[t.OccludeAndTransparentStencil = 8] = "OccludeAndTransparentStencil", t[t.Opaque = 16] = "Opaque";
1298
+ })(st || (st = {}));
1299
+ let wo = class extends Me {
1300
+ constructor() {
1301
+ super(...arguments), this.renderOccluded = st.Occlude, this.isDecoration = !1;
1302
+ }
1303
+ };
1304
+ var Kt, Qt;
1305
+ (function(t) {
1306
+ t[t.Undefined = 0] = "Undefined", t[t.DefinedSize = 1] = "DefinedSize", t[t.DefinedScale = 2] = "DefinedScale";
1307
+ })(Kt || (Kt = {})), function(t) {
1308
+ t[t.Undefined = 0] = "Undefined", t[t.DefinedAngle = 1] = "DefinedAngle";
1309
+ }(Qt || (Qt = {}));
1310
+ class Pa extends Me {
1311
+ constructor(e) {
1312
+ super(), this.vvSize = (e == null ? void 0 : e.size) ?? null, this.vvColor = (e == null ? void 0 : e.color) ?? null, this.vvOpacity = (e == null ? void 0 : e.opacity) ?? null;
1313
+ }
1314
+ }
1315
+ function No(t, e, r) {
1316
+ if (!e.vvSize)
1317
+ return H(t, 1, 1, 1), t;
1318
+ for (let s = 0; s < 3; ++s) {
1319
+ const a = e.vvSize.offset[s] + r[0] * e.vvSize.factor[s];
1320
+ t[s] = It(a, e.vvSize.minSize[s], e.vvSize.maxSize[s]);
1321
+ }
1322
+ return t;
1323
+ }
1324
+ let Po = class extends Pa {
1325
+ constructor() {
1326
+ super(...arguments), this.renderOccluded = st.Occlude, this.isDecoration = !1;
1327
+ }
1328
+ };
1329
+ const ut = 8;
1330
+ let Fa = class extends j {
1331
+ constructor(e, r) {
1332
+ super(e, "mat4", R.Draw, (s, a, i) => s.setUniformMatrix4fv(e, r(a, i)));
1333
+ }
1334
+ };
1335
+ function Da(t, e) {
1336
+ e.instancedDoublePrecision ? t.constants.add("cameraPosition", "vec3", $t) : t.uniforms.add(new te("cameraPosition", (r, s) => H(Nr, s.camera.viewInverseTransposeMatrix[3] - r.origin[0], s.camera.viewInverseTransposeMatrix[7] - r.origin[1], s.camera.viewInverseTransposeMatrix[11] - r.origin[2])));
1337
+ }
1338
+ function Bo(t, e) {
1339
+ if (!e.instancedDoublePrecision)
1340
+ return void t.uniforms.add(new $e("proj", (s, a) => a.camera.projectionMatrix), new Fa("view", (s, a) => pt(Zt, a.camera.viewMatrix, s.origin)), new te("localOrigin", (s) => s.origin));
1341
+ const r = (s) => H(Nr, s.camera.viewInverseTransposeMatrix[3], s.camera.viewInverseTransposeMatrix[7], s.camera.viewInverseTransposeMatrix[11]);
1342
+ t.uniforms.add(new $e("proj", (s, a) => a.camera.projectionMatrix), new $e("view", (s, a) => pt(Zt, a.camera.viewMatrix, r(a))), new q("localOrigin", (s, a) => r(a)));
1343
+ }
1344
+ const Zt = Ae(), Nr = b();
1345
+ function Ba(t) {
1346
+ t.uniforms.add(new $e("viewNormal", (e, r) => r.camera.viewInverseTransposeMatrix));
1347
+ }
1348
+ function Ho(t) {
1349
+ t.uniforms.add(new Qs("pixelRatio", (e, r) => r.camera.pixelRatio / r.overlayStretch));
1350
+ }
1351
+ let xt = class extends Ta {
1352
+ constructor() {
1353
+ super(...arguments), this.instancedDoublePrecision = !1, this.hasModelTransformation = !1;
1354
+ }
1355
+ };
1356
+ L([ke()], xt.prototype, "instancedDoublePrecision", void 0), L([ke()], xt.prototype, "hasModelTransformation", void 0);
1357
+ const Jt = Ne();
1358
+ function Vo(t, e) {
1359
+ const r = e.hasModelTransformation, s = e.instancedDoublePrecision;
1360
+ r && (t.vertex.uniforms.add(new $e("model", (i) => i.modelTransformation ?? rt)), t.vertex.uniforms.add(new ot("normalLocalOriginFromModel", (i) => (hs(Jt, i.modelTransformation ?? rt), Jt)))), e.instanced && s && (t.attributes.add(m.INSTANCEMODELORIGINHI, "vec3"), t.attributes.add(m.INSTANCEMODELORIGINLO, "vec3"), t.attributes.add(m.INSTANCEMODEL, "mat3"), t.attributes.add(m.INSTANCEMODELNORMAL, "mat3"));
1361
+ const a = t.vertex;
1362
+ s && (a.include(yr, e), a.uniforms.add(new te("viewOriginHi", (i, n) => Ds(H(Ke, n.camera.viewInverseTransposeMatrix[3], n.camera.viewInverseTransposeMatrix[7], n.camera.viewInverseTransposeMatrix[11]), Ke)), new te("viewOriginLo", (i, n) => Bs(H(Ke, n.camera.viewInverseTransposeMatrix[3], n.camera.viewInverseTransposeMatrix[7], n.camera.viewInverseTransposeMatrix[11]), Ke)))), a.code.add(l`
1363
+ vec3 getVertexInLocalOriginSpace() {
1364
+ return ${r ? s ? "(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz" : "(model * localPosition()).xyz" : s ? "instanceModel * localPosition().xyz" : "localPosition().xyz"};
1365
+ }
1366
+
1367
+ vec3 subtractOrigin(vec3 _pos) {
1368
+ ${s ? l`
1369
+ // Negated inputs are intentionally the first two arguments. The other way around the obfuscation in dpAdd() stopped
1370
+ // working for macOS 14+ and iOS 17+.
1371
+ // Issue: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280
1372
+ vec3 originDelta = dpAdd(-instanceModelOriginHi, -instanceModelOriginLo, viewOriginHi, viewOriginLo);
1373
+ return _pos - originDelta;` : "return vpos;"}
1374
+ }
1375
+ `), a.code.add(l`
1376
+ vec3 dpNormal(vec4 _normal) {
1377
+ return normalize(${r ? s ? "normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)" : "normalLocalOriginFromModel * _normal.xyz" : s ? "instanceModelNormal * _normal.xyz" : "_normal.xyz"});
1378
+ }
1379
+ `), e.output === x.Normal && (Ba(a), a.code.add(l`
1380
+ vec3 dpNormalView(vec4 _normal) {
1381
+ return normalize((viewNormal * ${r ? s ? "vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)" : "vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)" : s ? "vec4(instanceModelNormal * _normal.xyz, 1.0)" : "_normal"}).xyz);
1382
+ }
1383
+ `)), e.hasVertexTangents && a.code.add(l`
1384
+ vec4 dpTransformVertexTangent(vec4 _tangent) {
1385
+ ${r ? s ? "return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);" : "return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);" : s ? "return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);" : "return _tangent;"}
1386
+ }`);
1387
+ }
1388
+ const Ke = b();
1389
+ let dt = class extends xt {
1390
+ };
1391
+ L([ke({ constValue: !0 })], dt.prototype, "hasSliceHighlight", void 0), L([ke({ constValue: !1 })], dt.prototype, "hasSliceInVertexProgram", void 0), L([ke({ constValue: R.Pass })], dt.prototype, "pbrTextureBindType", void 0);
1392
+ function er(t) {
1393
+ t.varyings.add("linearDepth", "float");
1394
+ }
1395
+ function Ha(t) {
1396
+ t.vertex.uniforms.add(new Ct("nearFar", (e, r) => r.camera.nearFar));
1397
+ }
1398
+ function Pr(t) {
1399
+ t.vertex.code.add(l`float calculateLinearDepth(vec2 nearFar,float z) {
1400
+ return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
1401
+ }`);
1402
+ }
1403
+ function Go(t, e) {
1404
+ const { vertex: r } = t;
1405
+ switch (e.output) {
1406
+ case x.Color:
1407
+ if (e.receiveShadows)
1408
+ return er(t), void r.code.add(l`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);
1409
+ break;
1410
+ case x.LinearDepth:
1411
+ case x.Shadow:
1412
+ case x.ShadowHighlight:
1413
+ case x.ShadowExcludeHighlight:
1414
+ return t.include(wr, e), er(t), Ha(t), Pr(t), void r.code.add(l`void forwardLinearDepth() {
1415
+ linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
1416
+ }`);
1417
+ }
1418
+ r.code.add(l`void forwardLinearDepth() {}`);
1419
+ }
1420
+ function Wo(t, e) {
1421
+ Ua(t, e, new te("slicePlaneOrigin", (r, s) => Va(e, r, s)), new te("slicePlaneBasis1", (r, s) => {
1422
+ var a;
1423
+ return tr(e, r, s, (a = s.slicePlane) == null ? void 0 : a.basis1);
1424
+ }), new te("slicePlaneBasis2", (r, s) => {
1425
+ var a;
1426
+ return tr(e, r, s, (a = s.slicePlane) == null ? void 0 : a.basis2);
1427
+ }));
1428
+ }
1429
+ function Ua(t, e, ...r) {
1430
+ if (!e.hasSlicePlane) {
1431
+ const n = l`#define rejectBySlice(_pos_) false
1432
+ #define discardBySlice(_pos_) {}
1433
+ #define highlightSlice(_color_, _pos_) (_color_)`;
1434
+ return e.hasSliceInVertexProgram && t.vertex.code.add(n), void t.fragment.code.add(n);
1435
+ }
1436
+ e.hasSliceInVertexProgram && t.vertex.uniforms.add(...r), t.fragment.uniforms.add(...r);
1437
+ const s = l`struct SliceFactors {
1438
+ float front;
1439
+ float side0;
1440
+ float side1;
1441
+ float side2;
1442
+ float side3;
1443
+ };
1444
+ SliceFactors calculateSliceFactors(vec3 pos) {
1445
+ vec3 rel = pos - slicePlaneOrigin;
1446
+ vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2);
1447
+ float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin);
1448
+ float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1);
1449
+ float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2);
1450
+ float basis1Dot = dot(slicePlaneBasis1, rel);
1451
+ float basis2Dot = dot(slicePlaneBasis2, rel);
1452
+ return SliceFactors(
1453
+ dot(slicePlaneNormal, pos) + slicePlaneW,
1454
+ -basis1Dot - basis1Len2,
1455
+ basis1Dot - basis1Len2,
1456
+ -basis2Dot - basis2Len2,
1457
+ basis2Dot - basis2Len2
1458
+ );
1459
+ }
1460
+ bool sliceByFactors(SliceFactors factors) {
1461
+ return factors.front < 0.0
1462
+ && factors.side0 < 0.0
1463
+ && factors.side1 < 0.0
1464
+ && factors.side2 < 0.0
1465
+ && factors.side3 < 0.0;
1466
+ }
1467
+ bool sliceEnabled() {
1468
+ return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
1469
+ }
1470
+ bool sliceByPlane(vec3 pos) {
1471
+ return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
1472
+ }
1473
+ #define rejectBySlice(_pos_) sliceByPlane(_pos_)
1474
+ #define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`, a = l`vec4 applySliceHighlight(vec4 color, vec3 pos) {
1475
+ SliceFactors factors = calculateSliceFactors(pos);
1476
+ const float HIGHLIGHT_WIDTH = 1.0;
1477
+ const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3);
1478
+ factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front);
1479
+ factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0);
1480
+ factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1);
1481
+ factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2);
1482
+ factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3);
1483
+ if (sliceByFactors(factors)) {
1484
+ return color;
1485
+ }
1486
+ float highlightFactor = (1.0 - step(0.5, factors.front))
1487
+ * (1.0 - step(0.5, factors.side0))
1488
+ * (1.0 - step(0.5, factors.side1))
1489
+ * (1.0 - step(0.5, factors.side2))
1490
+ * (1.0 - step(0.5, factors.side3));
1491
+ return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a);
1492
+ }`, i = e.hasSliceHighlight ? l`
1493
+ ${a}
1494
+ #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))
1495
+ ` : l`#define highlightSlice(_color_, _pos_) (_color_)`;
1496
+ e.hasSliceInVertexProgram && t.vertex.code.add(s), t.fragment.code.add(s), t.fragment.code.add(i);
1497
+ }
1498
+ function Fr(t, e, r) {
1499
+ return t.instancedDoublePrecision ? H(za, r.camera.viewInverseTransposeMatrix[3], r.camera.viewInverseTransposeMatrix[7], r.camera.viewInverseTransposeMatrix[11]) : e.slicePlaneLocalOrigin;
1500
+ }
1501
+ function Dr(t, e) {
1502
+ return t != null ? lr(at, e.origin, t) : e.origin;
1503
+ }
1504
+ function Br(t, e, r) {
1505
+ return t.hasSliceTranslatedView ? e != null ? pt(Ga, r.camera.viewMatrix, e) : r.camera.viewMatrix : null;
1506
+ }
1507
+ function Va(t, e, r) {
1508
+ if (r.slicePlane == null)
1509
+ return $t;
1510
+ const s = Fr(t, e, r), a = Dr(s, r.slicePlane), i = Br(t, s, r);
1511
+ return i != null ? ye(at, a, i) : a;
1512
+ }
1513
+ function tr(t, e, r, s) {
1514
+ if (s == null || r.slicePlane == null)
1515
+ return $t;
1516
+ const a = Fr(t, e, r), i = Dr(a, r.slicePlane), n = Br(t, a, r);
1517
+ return n != null ? (ee(He, s, i), ye(at, i, n), ye(He, He, n), lr(He, He, at)) : s;
1518
+ }
1519
+ const za = b(), at = b(), He = b(), Ga = Ae();
1520
+ function ko(t, e) {
1521
+ const r = e.output === x.ObjectAndLayerIdColor, s = e.objectAndLayerIdColorInstanced;
1522
+ r && (t.varyings.add("objectAndLayerIdColorVarying", "vec4"), s ? t.attributes.add(m.INSTANCEOBJECTANDLAYERIDCOLOR, "vec4") : t.attributes.add(m.OBJECTANDLAYERIDCOLOR, "vec4")), t.vertex.code.add(l`
1523
+ void forwardObjectAndLayerIdColor() {
1524
+ ${r ? s ? l`objectAndLayerIdColorVarying = instanceObjectAndLayerIdColor * 0.003921568627451;` : l`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;` : l``} }`), t.fragment.code.add(l`
1525
+ void outputObjectAndLayerIdColor() {
1526
+ ${r ? l`fragColor = objectAndLayerIdColorVarying;` : l``} }`);
1527
+ }
1528
+ let Wa = class extends j {
1529
+ constructor(e, r, s) {
1530
+ super(e, "vec4", R.Pass, (a, i, n) => a.setUniform4fv(e, r(i, n)), s);
1531
+ }
1532
+ }, ka = class extends j {
1533
+ constructor(e, r, s) {
1534
+ super(e, "float", R.Pass, (a, i, n) => a.setUniform1fv(e, r(i, n)), s);
1535
+ }
1536
+ };
1537
+ function Xo(t, e) {
1538
+ const { vertex: r, attributes: s } = t;
1539
+ e.hasVvInstancing && (e.vvSize || e.vvColor) && s.add(m.INSTANCEFEATUREATTRIBUTE, "vec4"), e.vvSize ? (r.uniforms.add(new q("vvSizeMinSize", (a) => a.vvSize.minSize)), r.uniforms.add(new q("vvSizeMaxSize", (a) => a.vvSize.maxSize)), r.uniforms.add(new q("vvSizeOffset", (a) => a.vvSize.offset)), r.uniforms.add(new q("vvSizeFactor", (a) => a.vvSize.factor)), r.uniforms.add(new ot("vvSymbolRotationMatrix", (a) => a.vvSymbolRotationMatrix)), r.uniforms.add(new q("vvSymbolAnchor", (a) => a.vvSymbolAnchor)), r.code.add(l`vec3 vvScale(vec4 _featureAttribute) {
1540
+ return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);
1541
+ }
1542
+ vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
1543
+ return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);
1544
+ }`), r.code.add(l`
1545
+ const float eps = 1.192092896e-07;
1546
+ vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {
1547
+ vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize);
1548
+ return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0);
1549
+ }
1550
+
1551
+ ${e.hasVvInstancing ? l`
1552
+ vec4 vvLocalNormal(vec3 _normal) {
1553
+ return vvTransformNormal(_normal, instanceFeatureAttribute);
1554
+ }
1555
+
1556
+ vec4 localPosition() {
1557
+ return vvTransformPosition(position, instanceFeatureAttribute);
1558
+ }` : ""}
1559
+ `)) : r.code.add(l`vec4 localPosition() { return vec4(position, 1.0); }
1560
+ vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`), e.vvColor ? (r.constants.add("vvColorNumber", "int", ut), r.uniforms.add(new ka("vvColorValues", (a) => a.vvColor.values, ut), new Wa("vvColorColors", (a) => a.vvColor.colors, ut)), r.code.add(l`
1561
+ vec4 interpolateVVColor(float value) {
1562
+ if (value <= vvColorValues[0]) {
1563
+ return vvColorColors[0];
1564
+ }
1565
+
1566
+ for (int i = 1; i < vvColorNumber; ++i) {
1567
+ if (vvColorValues[i] >= value) {
1568
+ float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]);
1569
+ return mix(vvColorColors[i-1], vvColorColors[i], f);
1570
+ }
1571
+ }
1572
+ return vvColorColors[vvColorNumber - 1];
1573
+ }
1574
+
1575
+ vec4 vvGetColor(vec4 featureAttribute) {
1576
+ return interpolateVVColor(featureAttribute.y);
1577
+ }
1578
+
1579
+ ${e.hasVvInstancing ? l`
1580
+ vec4 vvColor() {
1581
+ return vvGetColor(instanceFeatureAttribute);
1582
+ }` : "vec4 vvColor() { return vec4(1.0); }"}
1583
+ `)) : r.code.add(l`vec4 vvColor() { return vec4(1.0); }`);
1584
+ }
1585
+ function ja(t) {
1586
+ t.code.add(l`const float MAX_RGBA4_FLOAT =
1587
+ 15.0 / 16.0 +
1588
+ 15.0 / 16.0 / 16.0 +
1589
+ 15.0 / 16.0 / 16.0 / 16.0 +
1590
+ 15.0 / 16.0 / 16.0 / 16.0 / 16.0;
1591
+ const vec4 FIXED_POINT_FACTORS_RGBA4 = vec4(1.0, 16.0, 16.0 * 16.0, 16.0 * 16.0 * 16.0);
1592
+ vec4 floatToRgba4(const float value) {
1593
+ float valueInValidDomain = clamp(value, 0.0, MAX_RGBA4_FLOAT);
1594
+ vec4 fixedPointU4 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS_RGBA4) * 16.0);
1595
+ const float toU4AsFloat = 1.0 / 15.0;
1596
+ return fixedPointU4 * toU4AsFloat;
1597
+ }
1598
+ const vec4 RGBA4_2_FLOAT_FACTORS = vec4(
1599
+ 15.0 / (16.0),
1600
+ 15.0 / (16.0 * 16.0),
1601
+ 15.0 / (16.0 * 16.0 * 16.0),
1602
+ 15.0 / (16.0 * 16.0 * 16.0 * 16.0)
1603
+ );
1604
+ float rgba4ToFloat(vec4 rgba) {
1605
+ return dot(rgba, RGBA4_2_FLOAT_FACTORS);
1606
+ }`);
1607
+ }
1608
+ function Yo(t, e) {
1609
+ switch (e.output) {
1610
+ case x.Shadow:
1611
+ case x.ShadowHighlight:
1612
+ case x.ShadowExcludeHighlight:
1613
+ t.fragment.include(ja), t.fragment.code.add(l`float _calculateFragDepth(const in float depth) {
1614
+ const float SLOPE_SCALE = 2.0;
1615
+ const float BIAS = 20.0 * .000015259;
1616
+ float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
1617
+ return depth + SLOPE_SCALE * m + BIAS;
1618
+ }
1619
+ void outputDepth(float _linearDepth) {
1620
+ fragColor = floatToRgba4(_calculateFragDepth(_linearDepth));
1621
+ }`);
1622
+ break;
1623
+ case x.LinearDepth:
1624
+ t.fragment.include(pr), t.fragment.code.add(l`void outputDepth(float _linearDepth) {
1625
+ fragColor = float2rgba(_linearDepth);
1626
+ }`);
1627
+ }
1628
+ }
1629
+ function qa() {
1630
+ if (ht == null) {
1631
+ const t = (e) => ms(`esri/libs/basisu/${e}`);
1632
+ ht = import("./basis_transcoder-3187cc92.js").then((e) => e.b).then(({ default: e }) => e({ locateFile: t }).then((r) => (r.initializeBasis(), delete r.then, r)));
1633
+ }
1634
+ return ht;
1635
+ }
1636
+ let ht;
1637
+ var Ee;
1638
+ (function(t) {
1639
+ t[t.ETC1_RGB = 0] = "ETC1_RGB", t[t.ETC2_RGBA = 1] = "ETC2_RGBA", t[t.BC1_RGB = 2] = "BC1_RGB", t[t.BC3_RGBA = 3] = "BC3_RGBA", t[t.BC4_R = 4] = "BC4_R", t[t.BC5_RG = 5] = "BC5_RG", t[t.BC7_M6_RGB = 6] = "BC7_M6_RGB", t[t.BC7_M5_RGBA = 7] = "BC7_M5_RGBA", t[t.PVRTC1_4_RGB = 8] = "PVRTC1_4_RGB", t[t.PVRTC1_4_RGBA = 9] = "PVRTC1_4_RGBA", t[t.ASTC_4x4_RGBA = 10] = "ASTC_4x4_RGBA", t[t.ATC_RGB = 11] = "ATC_RGB", t[t.ATC_RGBA = 12] = "ATC_RGBA", t[t.FXT1_RGB = 17] = "FXT1_RGB", t[t.PVRTC2_4_RGB = 18] = "PVRTC2_4_RGB", t[t.PVRTC2_4_RGBA = 19] = "PVRTC2_4_RGBA", t[t.ETC2_EAC_R11 = 20] = "ETC2_EAC_R11", t[t.ETC2_EAC_RG11 = 21] = "ETC2_EAC_RG11", t[t.RGBA32 = 13] = "RGBA32", t[t.RGB565 = 14] = "RGB565", t[t.BGR565 = 15] = "BGR565", t[t.RGBA4444 = 16] = "RGBA4444";
1640
+ })(Ee || (Ee = {}));
1641
+ let re = null, Qe = null;
1642
+ async function Hr() {
1643
+ return Qe == null && (Qe = qa(), re = await Qe), Qe;
1644
+ }
1645
+ function Xa(t, e) {
1646
+ if (re == null)
1647
+ return t.byteLength;
1648
+ const r = new re.BasisFile(new Uint8Array(t)), s = Vr(r) ? Ur(r.getNumLevels(0), r.getHasAlpha(), r.getImageWidth(0, 0), r.getImageHeight(0, 0), e) : 0;
1649
+ return r.close(), r.delete(), s;
1650
+ }
1651
+ function Ya(t, e) {
1652
+ if (re == null)
1653
+ return t.byteLength;
1654
+ const r = new re.KTX2File(new Uint8Array(t)), s = zr(r) ? Ur(r.getLevels(), r.getHasAlpha(), r.getWidth(), r.getHeight(), e) : 0;
1655
+ return r.close(), r.delete(), s;
1656
+ }
1657
+ function Ur(t, e, r, s, a) {
1658
+ const i = $s(e ? le.COMPRESSED_RGBA8_ETC2_EAC : le.COMPRESSED_RGB8_ETC2), n = a && t > 1 ? (4 ** t - 1) / (3 * 4 ** (t - 1)) : 1;
1659
+ return Math.ceil(r * s * i * n);
1660
+ }
1661
+ function Vr(t) {
1662
+ return t.getNumImages() >= 1 && !t.isUASTC();
1663
+ }
1664
+ function zr(t) {
1665
+ return t.getFaces() >= 1 && t.isETC1S();
1666
+ }
1667
+ async function Ka(t, e, r) {
1668
+ re == null && (re = await Hr());
1669
+ const s = new re.BasisFile(new Uint8Array(r));
1670
+ if (!Vr(s))
1671
+ return null;
1672
+ s.startTranscoding();
1673
+ const a = Gr(t, e, s.getNumLevels(0), s.getHasAlpha(), s.getImageWidth(0, 0), s.getImageHeight(0, 0), (i, n) => s.getImageTranscodedSizeInBytes(0, i, n), (i, n, o) => s.transcodeImage(o, 0, i, n, 0, 0));
1674
+ return s.close(), s.delete(), a;
1675
+ }
1676
+ async function Qa(t, e, r) {
1677
+ re == null && (re = await Hr());
1678
+ const s = new re.KTX2File(new Uint8Array(r));
1679
+ if (!zr(s))
1680
+ return null;
1681
+ s.startTranscoding();
1682
+ const a = Gr(t, e, s.getLevels(), s.getHasAlpha(), s.getWidth(), s.getHeight(), (i, n) => s.getImageTranscodedSizeInBytes(i, 0, 0, n), (i, n, o) => s.transcodeImage(o, i, 0, 0, n, 0, -1, -1));
1683
+ return s.close(), s.delete(), a;
1684
+ }
1685
+ function Gr(t, e, r, s, a, i, n, o) {
1686
+ const { compressedTextureETC: c, compressedTextureS3TC: d } = t.capabilities, [u, h] = c ? s ? [Ee.ETC2_RGBA, le.COMPRESSED_RGBA8_ETC2_EAC] : [Ee.ETC1_RGB, le.COMPRESSED_RGB8_ETC2] : d ? s ? [Ee.BC3_RGBA, le.COMPRESSED_RGBA_S3TC_DXT5_EXT] : [Ee.BC1_RGB, le.COMPRESSED_RGB_S3TC_DXT1_EXT] : [Ee.RGBA32, Re.RGBA], v = e.hasMipmap ? r : Math.min(1, r), O = [];
1687
+ for (let S = 0; S < v; S++)
1688
+ O.push(new Uint8Array(n(S, u))), o(S, u, O[S]);
1689
+ return e.internalFormat = h, e.hasMipmap = O.length > 1, e.samplingMode = e.hasMipmap ? Ce.LINEAR_MIPMAP_LINEAR : Ce.LINEAR, e.width = a, e.height = i, new ze(t, e, { type: "compressed", levels: O });
1690
+ }
1691
+ const Ze = () => or.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"), Za = 542327876, Ja = 131072, ei = 4;
1692
+ function wt(t) {
1693
+ return t.charCodeAt(0) + (t.charCodeAt(1) << 8) + (t.charCodeAt(2) << 16) + (t.charCodeAt(3) << 24);
1694
+ }
1695
+ function ti(t) {
1696
+ return String.fromCharCode(255 & t, t >> 8 & 255, t >> 16 & 255, t >> 24 & 255);
1697
+ }
1698
+ const ri = wt("DXT1"), si = wt("DXT3"), ai = wt("DXT5"), ii = 31, ni = 0, oi = 1, ci = 2, li = 3, ui = 4, di = 7, hi = 20, mi = 21;
1699
+ function fi(t, e, r) {
1700
+ const s = pi(r, e.hasMipmap ?? !1);
1701
+ if (s == null)
1702
+ throw new Error("DDS texture data is null");
1703
+ const { textureData: a, internalFormat: i, width: n, height: o } = s;
1704
+ return e.samplingMode = a.levels.length > 1 ? Ce.LINEAR_MIPMAP_LINEAR : Ce.LINEAR, e.hasMipmap = a.levels.length > 1, e.internalFormat = i, e.width = n, e.height = o, new ze(t, e, a);
1705
+ }
1706
+ function pi(t, e) {
1707
+ const r = new Int32Array(t, 0, ii);
1708
+ if (r[ni] !== Za)
1709
+ return Ze().error("Invalid magic number in DDS header"), null;
1710
+ if (!(r[hi] & ei))
1711
+ return Ze().error("Unsupported format, must contain a FourCC code"), null;
1712
+ const s = r[mi];
1713
+ let a, i;
1714
+ switch (s) {
1715
+ case ri:
1716
+ a = 8, i = le.COMPRESSED_RGB_S3TC_DXT1_EXT;
1717
+ break;
1718
+ case si:
1719
+ a = 16, i = le.COMPRESSED_RGBA_S3TC_DXT3_EXT;
1720
+ break;
1721
+ case ai:
1722
+ a = 16, i = le.COMPRESSED_RGBA_S3TC_DXT5_EXT;
1723
+ break;
1724
+ default:
1725
+ return Ze().error("Unsupported FourCC code:", ti(s)), null;
1726
+ }
1727
+ let n = 1, o = r[ui], c = r[li];
1728
+ !(3 & o) && !(3 & c) || (Ze().warn("Rounding up compressed texture size to nearest multiple of 4."), o = o + 3 & -4, c = c + 3 & -4);
1729
+ const d = o, u = c;
1730
+ let h, v;
1731
+ r[ci] & Ja && e !== !1 && (n = Math.max(1, r[di]));
1732
+ let O = r[oi] + 4;
1733
+ const S = [];
1734
+ for (let V = 0; V < n; ++V)
1735
+ v = (o + 3 >> 2) * (c + 3 >> 2) * a, h = new Uint8Array(t, O, v), S.push(h), O += v, o = Math.max(1, o >> 1), c = Math.max(1, c >> 1);
1736
+ return { textureData: { type: "compressed", levels: S }, internalFormat: i, width: d, height: u };
1737
+ }
1738
+ const it = 16;
1739
+ function Ko(t) {
1740
+ return Math.ceil(t / it) * it;
1741
+ }
1742
+ function Qo(t) {
1743
+ return Math.floor(t / it) * it;
1744
+ }
1745
+ function vi(t, e) {
1746
+ let i = t.width * t.height;
1747
+ if (i < 4096)
1748
+ return t instanceof ImageData ? Wr(t) : t;
1749
+ let n = t.width, o = t.height;
1750
+ do
1751
+ n = Math.ceil(n / 2), o = Math.ceil(o / 2), i = n * o;
1752
+ while (i > 1048576 || e != null && (n > e || o > e));
1753
+ return Mt(t, n, o);
1754
+ }
1755
+ function _i(t, e) {
1756
+ const r = Math.max(t.width, t.height);
1757
+ if (r <= e)
1758
+ return t;
1759
+ const s = e / r;
1760
+ return Mt(t, Math.round(t.width * s), Math.round(t.height * s));
1761
+ }
1762
+ function Mt(t, e, r) {
1763
+ if (t instanceof ImageData)
1764
+ return Mt(Wr(t), e, r);
1765
+ const s = document.createElement("canvas");
1766
+ return s.width = e, s.height = r, s.getContext("2d").drawImage(t, 0, 0, s.width, s.height), s;
1767
+ }
1768
+ function Wr(t) {
1769
+ const e = document.createElement("canvas");
1770
+ e.width = t.width, e.height = t.height;
1771
+ const r = e.getContext("2d");
1772
+ if (r == null)
1773
+ throw new bt("Failed to create 2d context from HTMLCanvasElement");
1774
+ return r.putImageData(t, 0, 0), e;
1775
+ }
1776
+ let Zo = class extends yt {
1777
+ get parameters() {
1778
+ return this._parameters;
1779
+ }
1780
+ constructor(e, r) {
1781
+ super(), this._data = e, this.type = xe.Texture, this._glTexture = null, this._loadingPromise = null, this._loadingController = null, this.events = new fs(), this._parameters = { ...Ti, ...r }, this._startPreload(e);
1782
+ }
1783
+ dispose() {
1784
+ this.unload(), this._data = this.frameUpdate = void 0;
1785
+ }
1786
+ _startPreload(e) {
1787
+ e != null && (e instanceof HTMLVideoElement ? (this.frameUpdate = (r) => this._frameUpdate(e, r), this._startPreloadVideoElement(e)) : e instanceof HTMLImageElement && this._startPreloadImageElement(e));
1788
+ }
1789
+ _startPreloadVideoElement(e) {
1790
+ if (!(Ft(e.src) || e.preload === "auto" && e.crossOrigin)) {
1791
+ e.preload = "auto", e.crossOrigin = "anonymous";
1792
+ const r = !e.paused;
1793
+ if (e.src = e.src, r && e.autoplay) {
1794
+ const s = () => {
1795
+ e.removeEventListener("canplay", s), e.play();
1796
+ };
1797
+ e.addEventListener("canplay", s);
1798
+ }
1799
+ }
1800
+ }
1801
+ _startPreloadImageElement(e) {
1802
+ ps(e.src) || Ft(e.src) || e.crossOrigin || (e.crossOrigin = "anonymous", e.src = e.src);
1803
+ }
1804
+ _createDescriptor(e) {
1805
+ const r = new Ls();
1806
+ return r.wrapMode = this._parameters.wrap ?? vt.REPEAT, r.flipped = !this._parameters.noUnpackFlip, r.samplingMode = this._parameters.mipmap ? Ce.LINEAR_MIPMAP_LINEAR : Ce.LINEAR, r.hasMipmap = !!this._parameters.mipmap, r.preMultiplyAlpha = !!this._parameters.preMultiplyAlpha, r.maxAnisotropy = this._parameters.maxAnisotropy ?? (this._parameters.mipmap ? e.parameters.maxMaxAnisotropy : 1), r;
1807
+ }
1808
+ get glTexture() {
1809
+ return this._glTexture;
1810
+ }
1811
+ get memoryEstimate() {
1812
+ var e;
1813
+ return ((e = this._glTexture) == null ? void 0 : e.usedMemory) || gi(this._data, this._parameters);
1814
+ }
1815
+ load(e) {
1816
+ if (this._glTexture)
1817
+ return this._glTexture;
1818
+ if (this._loadingPromise)
1819
+ return this._loadingPromise;
1820
+ const r = this._data;
1821
+ return r == null ? (this._glTexture = new ze(e, this._createDescriptor(e), null), this._glTexture) : (this._parameters.reloadable || (this._data = void 0), typeof r == "string" ? this._loadFromURL(e, r) : r instanceof Image ? this._loadFromImageElement(e, r) : r instanceof HTMLVideoElement ? this._loadFromVideoElement(e, r) : r instanceof ImageData || r instanceof HTMLCanvasElement ? this._loadFromImage(e, r) : (Ue(r) || Ve(r)) && this._parameters.encoding === Ge.DDS_ENCODING ? this._loadFromDDSData(e, r) : (Ue(r) || Ve(r)) && this._parameters.encoding === Ge.KTX2_ENCODING ? this._loadFromKTX2(e, r) : (Ue(r) || Ve(r)) && this._parameters.encoding === Ge.BASIS_ENCODING ? this._loadFromBasis(e, r) : Ve(r) ? this._loadFromPixelData(e, r) : Ue(r) ? this._loadFromPixelData(e, new Uint8Array(r)) : null);
1822
+ }
1823
+ _frameUpdate(e, r) {
1824
+ return this._glTexture == null || e.readyState < je.HAVE_CURRENT_DATA || r === e.currentTime ? r : (this._glTexture.setData(e), this._glTexture.descriptor.hasMipmap && this._glTexture.generateMipmap(), this._parameters.updateCallback && this._parameters.updateCallback(), e.currentTime);
1825
+ }
1826
+ _loadFromDDSData(e, r) {
1827
+ return this._glTexture = fi(e, this._createDescriptor(e), r), this._glTexture;
1828
+ }
1829
+ _loadFromKTX2(e, r) {
1830
+ return this._loadAsync(() => Qa(e, this._createDescriptor(e), r).then((s) => (this._glTexture = s, s)));
1831
+ }
1832
+ _loadFromBasis(e, r) {
1833
+ return this._loadAsync(() => Ka(e, this._createDescriptor(e), r).then((s) => (this._glTexture = s, s)));
1834
+ }
1835
+ _loadFromPixelData(e, r) {
1836
+ U(this._parameters.width > 0 && this._parameters.height > 0);
1837
+ const s = this._createDescriptor(e);
1838
+ return s.pixelFormat = this._parameters.components === 1 ? Re.LUMINANCE : this._parameters.components === 3 ? Re.RGB : Re.RGBA, s.width = this._parameters.width ?? 0, s.height = this._parameters.height ?? 0, this._glTexture = new ze(e, s, r), this._glTexture;
1839
+ }
1840
+ _loadFromURL(e, r) {
1841
+ return this._loadAsync(async (s) => {
1842
+ const a = await Hs(r, { signal: s });
1843
+ return Dt(s), this._loadFromImage(e, a);
1844
+ });
1845
+ }
1846
+ _loadFromImageElement(e, r) {
1847
+ return r.complete ? this._loadFromImage(e, r) : this._loadAsync(async (s) => {
1848
+ const a = await vs(r, r.src, !1, s);
1849
+ return Dt(s), this._loadFromImage(e, a);
1850
+ });
1851
+ }
1852
+ _loadFromVideoElement(e, r) {
1853
+ return r.readyState >= je.HAVE_CURRENT_DATA ? this._loadFromImage(e, r) : this._loadFromVideoElementAsync(e, r);
1854
+ }
1855
+ _loadFromVideoElementAsync(e, r) {
1856
+ return this._loadAsync((s) => new Promise((a, i) => {
1857
+ const n = () => {
1858
+ r.removeEventListener("loadeddata", o), r.removeEventListener("error", c), Ts(d);
1859
+ }, o = () => {
1860
+ r.readyState >= je.HAVE_CURRENT_DATA && (n(), a(this._loadFromImage(e, r)));
1861
+ }, c = (u) => {
1862
+ n(), i(u || new bt("Failed to load video"));
1863
+ };
1864
+ r.addEventListener("loadeddata", o), r.addEventListener("error", c);
1865
+ const d = _s(s, () => c(gs()));
1866
+ }));
1867
+ }
1868
+ _loadFromImage(e, r) {
1869
+ let s = r;
1870
+ if (!(s instanceof HTMLVideoElement)) {
1871
+ const { maxTextureSize: n } = e.parameters;
1872
+ s = this._parameters.downsampleUncompressed ? vi(s, n) : _i(s, n);
1873
+ }
1874
+ const a = kr(s);
1875
+ this._parameters.width = a.width, this._parameters.height = a.height;
1876
+ const i = this._createDescriptor(e);
1877
+ return i.pixelFormat = this._parameters.components === 3 ? Re.RGB : Re.RGBA, i.width = a.width, i.height = a.height, this._glTexture = new ze(e, i, s), this._glTexture;
1878
+ }
1879
+ _loadAsync(e) {
1880
+ const r = new AbortController();
1881
+ this._loadingController = r;
1882
+ const s = e(r.signal);
1883
+ this._loadingPromise = s;
1884
+ const a = () => {
1885
+ this._loadingController === r && (this._loadingController = null), this._loadingPromise === s && (this._loadingPromise = null);
1886
+ };
1887
+ return s.then(a, a), s;
1888
+ }
1889
+ unload() {
1890
+ if (this._glTexture = ft(this._glTexture), this._loadingController != null) {
1891
+ const e = this._loadingController;
1892
+ this._loadingController = null, this._loadingPromise = null, e.abort();
1893
+ }
1894
+ this.events.emit("unloaded");
1895
+ }
1896
+ };
1897
+ function gi(t, e) {
1898
+ if (t == null)
1899
+ return 0;
1900
+ if (Ue(t) || Ve(t))
1901
+ return e.encoding === Ge.KTX2_ENCODING ? Ya(t, !!e.mipmap) : e.encoding === Ge.BASIS_ENCODING ? Xa(t, !!e.mipmap) : t.byteLength;
1902
+ const { width: r, height: s } = t instanceof Image || t instanceof ImageData || t instanceof HTMLCanvasElement || t instanceof HTMLVideoElement ? kr(t) : e;
1903
+ return (e.mipmap ? 4 / 3 : 1) * r * s * (e.components || 4) || 0;
1904
+ }
1905
+ function kr(t) {
1906
+ return t instanceof HTMLVideoElement ? { width: t.videoWidth, height: t.videoHeight } : t;
1907
+ }
1908
+ var je;
1909
+ (function(t) {
1910
+ t[t.HAVE_NOTHING = 0] = "HAVE_NOTHING", t[t.HAVE_METADATA = 1] = "HAVE_METADATA", t[t.HAVE_CURRENT_DATA = 2] = "HAVE_CURRENT_DATA", t[t.HAVE_FUTURE_DATA = 3] = "HAVE_FUTURE_DATA", t[t.HAVE_ENOUGH_DATA = 4] = "HAVE_ENOUGH_DATA";
1911
+ })(je || (je = {}));
1912
+ const Ti = { wrap: { s: vt.REPEAT, t: vt.REPEAT }, mipmap: !0, noUnpackFlip: !1, preMultiplyAlpha: !1, downsampleUncompressed: !1 };
1913
+ function ec(t, e) {
1914
+ if (!e.multipassEnabled)
1915
+ return;
1916
+ t.fragment.include(Xs), t.fragment.uniforms.add(new We("terrainDepthTexture", (s, a) => {
1917
+ var i;
1918
+ return (i = a.multipassTerrain.linearDepth) == null ? void 0 : i.getTexture();
1919
+ }), new Ct("nearFar", (s, a) => a.camera.nearFar));
1920
+ const r = e.occlusionPass;
1921
+ t.fragment.code.add(l`
1922
+ ${r ? "bool" : "void"} terrainDepthTest(float fragmentDepth) {
1923
+ vec4 data = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0);
1924
+ float linearDepth = linearDepthFromRGBA(data, nearFar);
1925
+ ${r ? l`return fragmentDepth < linearDepth && data != vec4(0.0, 0.0, 0.0, 1.0);` : l`
1926
+ if(fragmentDepth ${e.cullAboveGround ? ">" : "<="} linearDepth){
1927
+ discard;
1928
+ }`}
1929
+ }`);
1930
+ }
1931
+ let tc = class {
1932
+ constructor() {
1933
+ this.cullAboveGround = !1;
1934
+ }
1935
+ };
1936
+ const sc = 0.1, ac = 1e-3;
1937
+ function ic(t) {
1938
+ t.code.add(l`vec4 premultiplyAlpha(vec4 v) {
1939
+ return vec4(v.rgb * v.a, v.a);
1940
+ }
1941
+ vec3 rgb2hsv(vec3 c) {
1942
+ vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
1943
+ vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
1944
+ vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
1945
+ float d = q.x - min(q.w, q.y);
1946
+ float e = 1.0e-10;
1947
+ return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);
1948
+ }
1949
+ vec3 hsv2rgb(vec3 c) {
1950
+ vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
1951
+ vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
1952
+ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
1953
+ }
1954
+ float rgb2v(vec3 c) {
1955
+ return max(c.x, max(c.y, c.z));
1956
+ }`);
1957
+ }
1958
+ const nc = { func: we.LESS }, oc = { func: we.ALWAYS }, cc = { mask: 255 }, lc = { mask: 0 }, uc = { function: { func: we.ALWAYS, ref: he.OutlineVisualElementMask, mask: he.OutlineVisualElementMask }, operation: { fail: Z.KEEP, zFail: Z.KEEP, zPass: Z.ZERO } }, dc = { function: { func: we.ALWAYS, ref: he.OutlineVisualElementMask, mask: he.OutlineVisualElementMask }, operation: { fail: Z.KEEP, zFail: Z.KEEP, zPass: Z.REPLACE } }, hc = { function: { func: we.EQUAL, ref: he.OutlineVisualElementMask, mask: he.OutlineVisualElementMask }, operation: { fail: Z.KEEP, zFail: Z.KEEP, zPass: Z.KEEP } }, mc = { function: { func: we.NOTEQUAL, ref: he.OutlineVisualElementMask, mask: he.OutlineVisualElementMask }, operation: { fail: Z.KEEP, zFail: Z.KEEP, zPass: Z.KEEP } };
1959
+ let Ei = class {
1960
+ constructor(e = b()) {
1961
+ this.intensity = e;
1962
+ }
1963
+ }, Si = class {
1964
+ constructor(e = b(), r = qe(0.57735, 0.57735, 0.57735)) {
1965
+ this.intensity = e, this.direction = r;
1966
+ }
1967
+ };
1968
+ class Ot {
1969
+ constructor(e = b(), r = qe(0.57735, 0.57735, 0.57735), s = !0, a = 1, i = 1) {
1970
+ this.intensity = e, this.direction = r, this.castShadows = s, this.specularStrength = a, this.environmentStrength = i;
1971
+ }
1972
+ }
1973
+ let jr = class {
1974
+ constructor() {
1975
+ this.r = [0], this.g = [0], this.b = [0];
1976
+ }
1977
+ };
1978
+ function Ai(t, e, r) {
1979
+ (r = r || t).length = t.length;
1980
+ for (let s = 0; s < t.length; s++)
1981
+ r[s] = t[s] * e[s];
1982
+ return r;
1983
+ }
1984
+ function mt(t, e, r) {
1985
+ (r = r || t).length = t.length;
1986
+ for (let s = 0; s < t.length; s++)
1987
+ r[s] = t[s] * e;
1988
+ return r;
1989
+ }
1990
+ function Le(t, e, r) {
1991
+ (r = r || t).length = t.length;
1992
+ for (let s = 0; s < t.length; s++)
1993
+ r[s] = t[s] + e[s];
1994
+ return r;
1995
+ }
1996
+ function qr(t) {
1997
+ return (t + 1) * (t + 1);
1998
+ }
1999
+ function xi(t) {
2000
+ return It(Math.floor(Math.sqrt(t) - 1), 0, 2);
2001
+ }
2002
+ function Xr(t, e, r) {
2003
+ const s = t[0], a = t[1], i = t[2], n = r || [];
2004
+ return n.length = qr(e), e >= 0 && (n[0] = 0.28209479177), e >= 1 && (n[1] = 0.4886025119 * s, n[2] = 0.4886025119 * i, n[3] = 0.4886025119 * a), e >= 2 && (n[4] = 1.09254843059 * s * a, n[5] = 1.09254843059 * a * i, n[6] = 0.31539156525 * (3 * i * i - 1), n[7] = 1.09254843059 * s * i, n[8] = 0.54627421529 * (s * s - a * a)), n;
2005
+ }
2006
+ function Oi(t, e) {
2007
+ const r = qr(t), s = e || { r: [], g: [], b: [] };
2008
+ s.r.length = s.g.length = s.b.length = r;
2009
+ for (let a = 0; a < r; a++)
2010
+ s.r[a] = s.g[a] = s.b[a] = 0;
2011
+ return s;
2012
+ }
2013
+ function Ri(t, e) {
2014
+ const r = xi(e.r.length);
2015
+ for (const s of t)
2016
+ Es(Rt, s.direction), Xr(Rt, r, ce), Ai(ce, tt), mt(ce, s.intensity[0], Oe), Le(e.r, Oe), mt(ce, s.intensity[1], Oe), Le(e.g, Oe), mt(ce, s.intensity[2], Oe), Le(e.b, Oe);
2017
+ return e;
2018
+ }
2019
+ function bi(t, e) {
2020
+ Xr(Rt, 0, ce);
2021
+ for (const r of t)
2022
+ e.r[0] += ce[0] * tt[0] * r.intensity[0] * 4 * Math.PI, e.g[0] += ce[0] * tt[0] * r.intensity[1] * 4 * Math.PI, e.b[0] += ce[0] * tt[0] * r.intensity[2] * 4 * Math.PI;
2023
+ return e;
2024
+ }
2025
+ function Ii(t, e, r, s) {
2026
+ Oi(e, s), H(r.intensity, 0, 0, 0);
2027
+ let a = !1;
2028
+ const i = $i, n = Li, o = yi;
2029
+ i.length = 0, n.length = 0, o.length = 0;
2030
+ for (const c of t)
2031
+ c instanceof Ot && !a ? (Te(r.direction, c.direction), Te(r.intensity, c.intensity), r.specularStrength = c.specularStrength, r.environmentStrength = c.environmentStrength, r.castShadows = c.castShadows, a = !0) : c instanceof Ot || c instanceof Si ? i.push(c) : c instanceof Ei ? n.push(c) : c instanceof jr && o.push(c);
2032
+ Ri(i, s), bi(n, s);
2033
+ for (const c of o)
2034
+ Le(s.r, c.r), Le(s.g, c.g), Le(s.b, c.b);
2035
+ }
2036
+ const $i = [], Li = [], yi = [], ce = [0], Oe = [0], Rt = b(), tt = [3.141593, 2.094395, 2.094395, 2.094395, 0.785398, 0.785398, 0.785398, 0.785398, 0.785398];
2037
+ class rr {
2038
+ constructor() {
2039
+ this.color = b(), this.intensity = 1;
2040
+ }
2041
+ }
2042
+ class Ci {
2043
+ constructor() {
2044
+ this.direction = b(), this.ambient = new rr(), this.diffuse = new rr();
2045
+ }
2046
+ }
2047
+ const wi = 0.4;
2048
+ class _c {
2049
+ constructor() {
2050
+ this._shOrder = 2, this._legacy = new Ci(), this.globalFactor = 0.5, this.noonFactor = 0.5, this._sphericalHarmonics = new jr(), this._mainLight = new Ot(b(), qe(1, 0, 0), !1);
2051
+ }
2052
+ get legacy() {
2053
+ return this._legacy;
2054
+ }
2055
+ get sh() {
2056
+ return this._sphericalHarmonics;
2057
+ }
2058
+ get mainLight() {
2059
+ return this._mainLight;
2060
+ }
2061
+ set(e) {
2062
+ Ii(e, this._shOrder, this._mainLight, this._sphericalHarmonics), Te(this._legacy.direction, this._mainLight.direction);
2063
+ const r = 1 / Math.PI;
2064
+ this._legacy.ambient.color[0] = 0.282095 * this._sphericalHarmonics.r[0] * r, this._legacy.ambient.color[1] = 0.282095 * this._sphericalHarmonics.g[0] * r, this._legacy.ambient.color[2] = 0.282095 * this._sphericalHarmonics.b[0] * r, ae(this._legacy.diffuse.color, this._mainLight.intensity, r), Te(Je, this._legacy.diffuse.color), ae(Je, Je, wi * this.globalFactor), ee(this._legacy.ambient.color, this._legacy.ambient.color, Je);
2065
+ }
2066
+ copyFrom(e) {
2067
+ this._sphericalHarmonics.r = Array.from(e.sh.r), this._sphericalHarmonics.g = Array.from(e.sh.g), this._sphericalHarmonics.b = Array.from(e.sh.b), Te(this._mainLight.direction, e.mainLight.direction), Te(this._mainLight.intensity, e.mainLight.intensity), this._mainLight.castShadows = e.mainLight.castShadows, this._mainLight.specularStrength = e.mainLight.specularStrength, this._mainLight.environmentStrength = e.mainLight.environmentStrength, this.globalFactor = e.globalFactor, this.noonFactor = e.noonFactor;
2068
+ }
2069
+ lerpLighting(e, r, s) {
2070
+ if (Ss(this._mainLight.intensity, e.mainLight.intensity, r.mainLight.intensity, s), this._mainLight.environmentStrength = ue(e.mainLight.environmentStrength, r.mainLight.environmentStrength, s), this._mainLight.specularStrength = ue(e.mainLight.specularStrength, r.mainLight.specularStrength, s), Te(this._mainLight.direction, r.mainLight.direction), this._mainLight.castShadows = r.mainLight.castShadows, this.globalFactor = ue(e.globalFactor, r.globalFactor, s), this.noonFactor = ue(e.noonFactor, r.noonFactor, s), e.sh.r.length === r.sh.r.length)
2071
+ for (let a = 0; a < r.sh.r.length; a++)
2072
+ this._sphericalHarmonics.r[a] = ue(e.sh.r[a], r.sh.r[a], s), this._sphericalHarmonics.g[a] = ue(e.sh.g[a], r.sh.g[a], s), this._sphericalHarmonics.b[a] = ue(e.sh.b[a], r.sh.b[a], s);
2073
+ else
2074
+ for (let a = 0; a < r.sh.r.length; a++)
2075
+ this._sphericalHarmonics.r[a] = r.sh.r[a], this._sphericalHarmonics.g[a] = r.sh.g[a], this._sphericalHarmonics.b[a] = r.sh.b[a];
2076
+ }
2077
+ }
2078
+ const Je = b();
2079
+ class gc {
2080
+ constructor() {
2081
+ this._transform = Ae(), this._transformInverse = new et({ value: this._transform }, xs, Ae), this._transformInverseTranspose = new et(this._transformInverse, Bt, Ae), this._transformTranspose = new et({ value: this._transform }, Bt, Ae), this._transformInverseRotation = new et({ value: this._transform }, Os, Ne);
2082
+ }
2083
+ _invalidateLazyTransforms() {
2084
+ this._transformInverse.invalidate(), this._transformInverseTranspose.invalidate(), this._transformTranspose.invalidate(), this._transformInverseRotation.invalidate();
2085
+ }
2086
+ get transform() {
2087
+ return this._transform;
2088
+ }
2089
+ get inverse() {
2090
+ return this._transformInverse.value;
2091
+ }
2092
+ get inverseTranspose() {
2093
+ return this._transformInverseTranspose.value;
2094
+ }
2095
+ get inverseRotation() {
2096
+ return this._transformInverseRotation.value;
2097
+ }
2098
+ get transpose() {
2099
+ return this._transformTranspose.value;
2100
+ }
2101
+ setTransformMatrix(e) {
2102
+ Ht(this._transform, e);
2103
+ }
2104
+ multiplyTransform(e) {
2105
+ Rs(this._transform, this._transform, e);
2106
+ }
2107
+ set(e) {
2108
+ Ht(this._transform, e), this._invalidateLazyTransforms();
2109
+ }
2110
+ setAndInvalidateLazyTransforms(e, r) {
2111
+ this.setTransformMatrix(e), this.multiplyTransform(r), this._invalidateLazyTransforms();
2112
+ }
2113
+ }
2114
+ let et = class {
2115
+ constructor(e, r, s) {
2116
+ this._original = e, this._update = r, this._dirty = !0, this._transform = s();
2117
+ }
2118
+ invalidate() {
2119
+ this._dirty = !0;
2120
+ }
2121
+ get value() {
2122
+ return this._dirty && (this._update(this._transform, this._original.value), this._dirty = !1), this._transform;
2123
+ }
2124
+ };
2125
+ class Mi {
2126
+ constructor(e = 0) {
2127
+ this.componentLocalOriginLength = 0, this._totalOffset = 0, this._offset = 0, this._tmpVertex = b(), this._tmpMbs = mr(), this._tmpObb = new Us(), this._resetOffset(e);
2128
+ }
2129
+ _resetOffset(e) {
2130
+ this._offset = e, this._totalOffset = e;
2131
+ }
2132
+ set offset(e) {
2133
+ this._resetOffset(e);
2134
+ }
2135
+ get offset() {
2136
+ return this._offset;
2137
+ }
2138
+ set componentOffset(e) {
2139
+ this._totalOffset = this._offset + e;
2140
+ }
2141
+ set localOrigin(e) {
2142
+ this.componentLocalOriginLength = Se(e);
2143
+ }
2144
+ applyToVertex(e, r, s) {
2145
+ const a = H(Yr, e, r, s), i = H(Pi, e, r, s + this.componentLocalOriginLength), n = this._totalOffset / Se(i);
2146
+ return be(this._tmpVertex, a, i, n), this._tmpVertex;
2147
+ }
2148
+ applyToAabb(e) {
2149
+ const r = this.componentLocalOriginLength, s = e[0], a = e[1], i = e[2] + r, n = e[3], o = e[4], c = e[5] + r, d = Math.abs(s), u = Math.abs(a), h = Math.abs(i), v = Math.abs(n), O = Math.abs(o), S = Math.abs(c), V = 0.5 * (1 + Math.sign(s * n)) * Math.min(d, v), G = 0.5 * (1 + Math.sign(a * o)) * Math.min(u, O), F = 0.5 * (1 + Math.sign(i * c)) * Math.min(h, S), k = Math.max(d, v), y = Math.max(u, O), I = Math.max(h, S), C = Math.sqrt(V * V + G * G + F * F), w = Math.sign(d + s), T = Math.sign(u + a), E = Math.sign(h + i), A = Math.sign(v + n), g = Math.sign(O + o), f = Math.sign(S + c), p = this._totalOffset;
2150
+ if (C < p)
2151
+ return e[0] -= (1 - w) * p, e[1] -= (1 - T) * p, e[2] -= (1 - E) * p, e[3] += A * p, e[4] += g * p, e[5] += f * p, e;
2152
+ const _ = p / Math.sqrt(k * k + y * y + I * I), $ = p / C, N = $ - _, P = -N;
2153
+ return e[0] += s * (w * P + $), e[1] += a * (T * P + $), e[2] += i * (E * P + $), e[3] += n * (A * N + _), e[4] += o * (g * N + _), e[5] += c * (f * N + _), e;
2154
+ }
2155
+ applyToMbs(e) {
2156
+ const r = Se(de(e)), s = this._totalOffset / r;
2157
+ return be(de(this._tmpMbs), de(e), de(e), s), this._tmpMbs[3] = e[3] + e[3] * this._totalOffset / r, this._tmpMbs;
2158
+ }
2159
+ applyToObb(e) {
2160
+ return Vs(e, this._totalOffset, this._totalOffset, As.Global, this._tmpObb), this._tmpObb;
2161
+ }
2162
+ }
2163
+ let Ni = class {
2164
+ constructor(e = 0) {
2165
+ this.offset = e, this.sphere = mr(), this.tmpVertex = b();
2166
+ }
2167
+ applyToVertex(e, r, s) {
2168
+ const a = this.objectTransform.transform, i = H(Yr, e, r, s), n = ye(i, i, a), o = this.offset / Se(n);
2169
+ be(n, n, n, o);
2170
+ const c = this.objectTransform.inverse;
2171
+ return ye(this.tmpVertex, n, c), this.tmpVertex;
2172
+ }
2173
+ applyToMinMax(e, r) {
2174
+ const s = this.offset / Se(e);
2175
+ be(e, e, e, s);
2176
+ const a = this.offset / Se(r);
2177
+ be(r, r, r, a);
2178
+ }
2179
+ applyToAabb(e) {
2180
+ const r = this.offset / Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2]);
2181
+ e[0] += e[0] * r, e[1] += e[1] * r, e[2] += e[2] * r;
2182
+ const s = this.offset / Math.sqrt(e[3] * e[3] + e[4] * e[4] + e[5] * e[5]);
2183
+ return e[3] += e[3] * s, e[4] += e[4] * s, e[5] += e[5] * s, e;
2184
+ }
2185
+ applyToBoundingSphere(e) {
2186
+ const r = Se(de(e)), s = this.offset / r;
2187
+ return be(de(this.sphere), de(e), de(e), s), this.sphere[3] = e[3] + e[3] * this.offset / r, this.sphere;
2188
+ }
2189
+ };
2190
+ const sr = new Ni();
2191
+ function Sc(t) {
2192
+ return t != null ? (sr.offset = t, sr) : null;
2193
+ }
2194
+ new Mi();
2195
+ const Ac = "terrain", Yr = b(), Pi = b();
2196
+ let xc = class extends j {
2197
+ constructor(e, r) {
2198
+ super(e, "int", R.Pass, (s, a, i) => s.setUniform1i(e, r(a, i)));
2199
+ }
2200
+ };
2201
+ function Fi(t) {
2202
+ t.vertex.code.add(l`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
2203
+ return absCosAngle * absCosAngle * absCosAngle;
2204
+ }`), t.vertex.code.add(l`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) {
2205
+ return vec3(
2206
+ min(params.x / (distanceToCamera - params.y), 1.0),
2207
+ screenSizePerspectiveViewAngleDependentFactor(absCosAngle),
2208
+ params.z
2209
+ );
2210
+ }`), t.vertex.code.add(l`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec3 factor) {
2211
+ return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y);
2212
+ }`), t.vertex.code.add(l`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec3 params) {
2213
+ return applyScreenSizePerspectiveScaleFactorFloat(
2214
+ size,
2215
+ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
2216
+ );
2217
+ }`), t.vertex.code.add(l`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec3 factor) {
2218
+ return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y);
2219
+ }`), t.vertex.code.add(l`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
2220
+ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
2221
+ }`);
2222
+ }
2223
+ function Rc(t) {
2224
+ t.uniforms.add(new q("screenSizePerspective", (e) => Kr(e.screenSizePerspective)));
2225
+ }
2226
+ function Di(t) {
2227
+ t.uniforms.add(new q("screenSizePerspectiveAlignment", (e) => Kr(e.screenSizePerspectiveAlignment || e.screenSizePerspective)));
2228
+ }
2229
+ function Kr(t) {
2230
+ return H(Bi, t.parameters.divisor, t.parameters.offset, t.minScaleFactor);
2231
+ }
2232
+ const Bi = b();
2233
+ function bc(t, e) {
2234
+ const r = t.vertex;
2235
+ e.hasVerticalOffset ? (Ui(r), e.hasScreenSizePerspective && (t.include(Fi), Di(r), Da(t.vertex, e)), r.code.add(l`
2236
+ vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
2237
+ float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
2238
+ ${e.spherical ? l`vec3 worldNormal = normalize(worldPos + localOrigin);` : l`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
2239
+ ${e.hasScreenSizePerspective ? l`
2240
+ float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
2241
+ float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);` : l`
2242
+ float verticalOffsetScreenHeight = verticalOffset.x;`}
2243
+ // Screen sized offset in world space, used for example for line callouts
2244
+ float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);
2245
+ return worldNormal * worldOffset;
2246
+ }
2247
+
2248
+ vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
2249
+ return worldPos + calculateVerticalOffset(worldPos, localOrigin);
2250
+ }
2251
+ `)) : r.code.add(l`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`);
2252
+ }
2253
+ const Hi = Lt();
2254
+ function Ui(t) {
2255
+ t.uniforms.add(new vr("verticalOffset", (e, r) => {
2256
+ const { minWorldLength: s, maxWorldLength: a, screenLength: i } = e.verticalOffset, n = Math.tan(0.5 * r.camera.fovY) / (0.5 * r.camera.fullViewport[3]), o = r.camera.pixelRatio || 1;
2257
+ return _t(Hi, i * o, n, s, a);
2258
+ }));
2259
+ }
2260
+ function ar(t, e, r) {
2261
+ const { data: s, indices: a } = t, i = e.typedBuffer, n = e.typedBufferStride, o = a.length;
2262
+ r *= n;
2263
+ for (let c = 0; c < o; ++c) {
2264
+ const d = 2 * a[c];
2265
+ i[r] = s[d], i[r + 1] = s[d + 1], r += n;
2266
+ }
2267
+ }
2268
+ function Qr(t, e, r, s) {
2269
+ const { data: a, indices: i } = t, n = e.typedBuffer, o = e.typedBufferStride, c = i.length;
2270
+ if (r *= o, s == null || s === 1)
2271
+ for (let d = 0; d < c; ++d) {
2272
+ const u = 3 * i[d];
2273
+ n[r] = a[u], n[r + 1] = a[u + 1], n[r + 2] = a[u + 2], r += o;
2274
+ }
2275
+ else
2276
+ for (let d = 0; d < c; ++d) {
2277
+ const u = 3 * i[d];
2278
+ for (let h = 0; h < s; ++h)
2279
+ n[r] = a[u], n[r + 1] = a[u + 1], n[r + 2] = a[u + 2], r += o;
2280
+ }
2281
+ }
2282
+ function Zr(t, e, r, s = 1) {
2283
+ const { data: a, indices: i } = t, n = e.typedBuffer, o = e.typedBufferStride, c = i.length;
2284
+ if (r *= o, s === 1)
2285
+ for (let d = 0; d < c; ++d) {
2286
+ const u = 4 * i[d];
2287
+ n[r] = a[u], n[r + 1] = a[u + 1], n[r + 2] = a[u + 2], n[r + 3] = a[u + 3], r += o;
2288
+ }
2289
+ else
2290
+ for (let d = 0; d < c; ++d) {
2291
+ const u = 4 * i[d];
2292
+ for (let h = 0; h < s; ++h)
2293
+ n[r] = a[u], n[r + 1] = a[u + 1], n[r + 2] = a[u + 2], n[r + 3] = a[u + 3], r += o;
2294
+ }
2295
+ }
2296
+ function Ic(t, e, r) {
2297
+ const s = t.typedBuffer, a = t.typedBufferStride;
2298
+ e *= a;
2299
+ for (let i = 0; i < r; ++i)
2300
+ s[e] = 0, s[e + 1] = 0, s[e + 2] = 0, s[e + 3] = 0, e += a;
2301
+ }
2302
+ function Vi(t, e, r, s, a = 1) {
2303
+ if (!e)
2304
+ return void Qr(t, r, s, a);
2305
+ const { data: i, indices: n } = t, o = r.typedBuffer, c = r.typedBufferStride, d = n.length, u = e[0], h = e[1], v = e[2], O = e[4], S = e[5], V = e[6], G = e[8], F = e[9], k = e[10], y = e[12], I = e[13], C = e[14];
2306
+ s *= c;
2307
+ let w = 0, T = 0, E = 0;
2308
+ const A = ur(e) ? (g) => {
2309
+ w = i[g] + y, T = i[g + 1] + I, E = i[g + 2] + C;
2310
+ } : (g) => {
2311
+ const f = i[g], p = i[g + 1], _ = i[g + 2];
2312
+ w = u * f + O * p + G * _ + y, T = h * f + S * p + F * _ + I, E = v * f + V * p + k * _ + C;
2313
+ };
2314
+ if (a === 1)
2315
+ for (let g = 0; g < d; ++g)
2316
+ A(3 * n[g]), o[s] = w, o[s + 1] = T, o[s + 2] = E, s += c;
2317
+ else
2318
+ for (let g = 0; g < d; ++g) {
2319
+ A(3 * n[g]);
2320
+ for (let f = 0; f < a; ++f)
2321
+ o[s] = w, o[s + 1] = T, o[s + 2] = E, s += c;
2322
+ }
2323
+ }
2324
+ function zi(t, e, r, s, a = 1) {
2325
+ if (!e)
2326
+ return void Qr(t, r, s, a);
2327
+ const { data: i, indices: n } = t, o = e, c = r.typedBuffer, d = r.typedBufferStride, u = n.length, h = o[0], v = o[1], O = o[2], S = o[4], V = o[5], G = o[6], F = o[8], k = o[9], y = o[10], I = !dr(o), C = 1e-6, w = 1 - C;
2328
+ s *= d;
2329
+ let T = 0, E = 0, A = 0;
2330
+ const g = ur(o) ? (f) => {
2331
+ T = i[f], E = i[f + 1], A = i[f + 2];
2332
+ } : (f) => {
2333
+ const p = i[f], _ = i[f + 1], $ = i[f + 2];
2334
+ T = h * p + S * _ + F * $, E = v * p + V * _ + k * $, A = O * p + G * _ + y * $;
2335
+ };
2336
+ if (a === 1)
2337
+ if (I)
2338
+ for (let f = 0; f < u; ++f) {
2339
+ g(3 * n[f]);
2340
+ const p = T * T + E * E + A * A;
2341
+ if (p < w && p > C) {
2342
+ const _ = 1 / Math.sqrt(p);
2343
+ c[s] = T * _, c[s + 1] = E * _, c[s + 2] = A * _;
2344
+ } else
2345
+ c[s] = T, c[s + 1] = E, c[s + 2] = A;
2346
+ s += d;
2347
+ }
2348
+ else
2349
+ for (let f = 0; f < u; ++f)
2350
+ g(3 * n[f]), c[s] = T, c[s + 1] = E, c[s + 2] = A, s += d;
2351
+ else
2352
+ for (let f = 0; f < u; ++f) {
2353
+ if (g(3 * n[f]), I) {
2354
+ const p = T * T + E * E + A * A;
2355
+ if (p < w && p > C) {
2356
+ const _ = 1 / Math.sqrt(p);
2357
+ T *= _, E *= _, A *= _;
2358
+ }
2359
+ }
2360
+ for (let p = 0; p < a; ++p)
2361
+ c[s] = T, c[s + 1] = E, c[s + 2] = A, s += d;
2362
+ }
2363
+ }
2364
+ function Gi(t, e, r, s, a = 1) {
2365
+ if (!e)
2366
+ return void Zr(t, r, s, a);
2367
+ const { data: i, indices: n } = t, o = e, c = r.typedBuffer, d = r.typedBufferStride, u = n.length, h = o[0], v = o[1], O = o[2], S = o[4], V = o[5], G = o[6], F = o[8], k = o[9], y = o[10], I = !dr(o), C = 1e-6, w = 1 - C;
2368
+ if (s *= d, a === 1)
2369
+ for (let T = 0; T < u; ++T) {
2370
+ const E = 4 * n[T], A = i[E], g = i[E + 1], f = i[E + 2], p = i[E + 3];
2371
+ let _ = h * A + S * g + F * f, $ = v * A + V * g + k * f, N = O * A + G * g + y * f;
2372
+ if (I) {
2373
+ const P = _ * _ + $ * $ + N * N;
2374
+ if (P < w && P > C) {
2375
+ const W = 1 / Math.sqrt(P);
2376
+ _ *= W, $ *= W, N *= W;
2377
+ }
2378
+ }
2379
+ c[s] = _, c[s + 1] = $, c[s + 2] = N, c[s + 3] = p, s += d;
2380
+ }
2381
+ else
2382
+ for (let T = 0; T < u; ++T) {
2383
+ const E = 4 * n[T], A = i[E], g = i[E + 1], f = i[E + 2], p = i[E + 3];
2384
+ let _ = h * A + S * g + F * f, $ = v * A + V * g + k * f, N = O * A + G * g + y * f;
2385
+ if (I) {
2386
+ const P = _ * _ + $ * $ + N * N;
2387
+ if (P < w && P > C) {
2388
+ const W = 1 / Math.sqrt(P);
2389
+ _ *= W, $ *= W, N *= W;
2390
+ }
2391
+ }
2392
+ for (let P = 0; P < a; ++P)
2393
+ c[s] = _, c[s + 1] = $, c[s + 2] = N, c[s + 3] = p, s += d;
2394
+ }
2395
+ }
2396
+ function Wi(t, e, r, s, a = 1) {
2397
+ const { data: i, indices: n } = t, o = r.typedBuffer, c = r.typedBufferStride, d = n.length;
2398
+ if (s *= c, e !== i.length || e !== 4)
2399
+ if (a !== 1)
2400
+ if (e !== 4)
2401
+ for (let u = 0; u < d; ++u) {
2402
+ const h = 3 * n[u];
2403
+ for (let v = 0; v < a; ++v)
2404
+ o[s] = i[h], o[s + 1] = i[h + 1], o[s + 2] = i[h + 2], o[s + 3] = 255, s += c;
2405
+ }
2406
+ else
2407
+ for (let u = 0; u < d; ++u) {
2408
+ const h = 4 * n[u];
2409
+ for (let v = 0; v < a; ++v)
2410
+ o[s] = i[h], o[s + 1] = i[h + 1], o[s + 2] = i[h + 2], o[s + 3] = i[h + 3], s += c;
2411
+ }
2412
+ else {
2413
+ if (e === 4) {
2414
+ for (let u = 0; u < d; ++u) {
2415
+ const h = 4 * n[u];
2416
+ o[s] = i[h], o[s + 1] = i[h + 1], o[s + 2] = i[h + 2], o[s + 3] = i[h + 3], s += c;
2417
+ }
2418
+ return;
2419
+ }
2420
+ for (let u = 0; u < d; ++u) {
2421
+ const h = 3 * n[u];
2422
+ o[s] = i[h], o[s + 1] = i[h + 1], o[s + 2] = i[h + 2], o[s + 3] = 255, s += c;
2423
+ }
2424
+ }
2425
+ else {
2426
+ o[s] = i[0], o[s + 1] = i[1], o[s + 2] = i[2], o[s + 3] = i[3];
2427
+ const u = new Uint32Array(r.typedBuffer.buffer, r.start), h = c / 4, v = u[s /= 4];
2428
+ s += h;
2429
+ const O = d * a;
2430
+ for (let S = 1; S < O; ++S)
2431
+ u[s] = v, s += h;
2432
+ }
2433
+ }
2434
+ function ki(t, e, r) {
2435
+ const { data: s, indices: a } = t, i = e.typedBuffer, n = e.typedBufferStride, o = a.length, c = s[0];
2436
+ r *= n;
2437
+ for (let d = 0; d < o; ++d)
2438
+ i[r] = c, r += n;
2439
+ }
2440
+ function ji(t, e, r, s, a = 1) {
2441
+ const i = e.typedBuffer, n = e.typedBufferStride;
2442
+ if (s *= n, a === 1)
2443
+ for (let o = 0; o < r; ++o)
2444
+ i[s] = t[0], i[s + 1] = t[1], i[s + 2] = t[2], i[s + 3] = t[3], s += n;
2445
+ else
2446
+ for (let o = 0; o < r; ++o)
2447
+ for (let c = 0; c < a; ++c)
2448
+ i[s] = t[0], i[s + 1] = t[1], i[s + 2] = t[2], i[s + 3] = t[3], s += n;
2449
+ }
2450
+ function qi(t, e, r, s, a, i) {
2451
+ var n;
2452
+ for (const o of e.fields.keys()) {
2453
+ const c = t.attributes.get(o), d = c == null ? void 0 : c.indices;
2454
+ if (c && d)
2455
+ Xi(o, c, r, s, a, i);
2456
+ else if (o === m.OBJECTANDLAYERIDCOLOR && t.objectAndLayerIdColor != null) {
2457
+ const u = (n = t.attributes.get(m.POSITION)) == null ? void 0 : n.indices;
2458
+ if (u) {
2459
+ const h = u.length, v = a.getField(o, fr);
2460
+ ji(t.objectAndLayerIdColor, v, h, i);
2461
+ }
2462
+ }
2463
+ }
2464
+ }
2465
+ function Xi(t, e, r, s, a, i) {
2466
+ switch (t) {
2467
+ case m.POSITION: {
2468
+ U(e.size === 3);
2469
+ const n = a.getField(t, Vt);
2470
+ U(!!n, `No buffer view for ${t}`), n && Vi(e, r, n, i);
2471
+ break;
2472
+ }
2473
+ case m.NORMAL: {
2474
+ U(e.size === 3);
2475
+ const n = a.getField(t, Vt);
2476
+ U(!!n, `No buffer view for ${t}`), n && zi(e, s, n, i);
2477
+ break;
2478
+ }
2479
+ case m.NORMALCOMPRESSED: {
2480
+ U(e.size === 2);
2481
+ const n = a.getField(t, Ws);
2482
+ U(!!n, `No buffer view for ${t}`), n && ar(e, n, i);
2483
+ break;
2484
+ }
2485
+ case m.UV0: {
2486
+ U(e.size === 2);
2487
+ const n = a.getField(t, Gs);
2488
+ U(!!n, `No buffer view for ${t}`), n && ar(e, n, i);
2489
+ break;
2490
+ }
2491
+ case m.COLOR:
2492
+ case m.SYMBOLCOLOR: {
2493
+ const n = a.getField(t, fr);
2494
+ U(!!n, `No buffer view for ${t}`), U(e.size === 3 || e.size === 4), !n || e.size !== 3 && e.size !== 4 || Wi(e, e.size, n, i);
2495
+ break;
2496
+ }
2497
+ case m.COLORFEATUREATTRIBUTE: {
2498
+ const n = a.getField(t, zs);
2499
+ U(!!n, `No buffer view for ${t}`), U(e.size === 1), n && e.size === 1 && ki(e, n, i);
2500
+ break;
2501
+ }
2502
+ case m.TANGENT: {
2503
+ U(e.size === 4);
2504
+ const n = a.getField(t, Ut);
2505
+ U(!!n, `No buffer view for ${t}`), n && Gi(e, s, n, i);
2506
+ break;
2507
+ }
2508
+ case m.PROFILERIGHT:
2509
+ case m.PROFILEUP:
2510
+ case m.PROFILEVERTEXANDNORMAL:
2511
+ case m.FEATUREVALUE: {
2512
+ U(e.size === 4);
2513
+ const n = a.getField(t, Ut);
2514
+ U(!!n, `No buffer view for ${t}`), n && Zr(e, n, i);
2515
+ }
2516
+ }
2517
+ }
2518
+ const Yi = hr(1, 1, 0, 1), Ki = hr(1, 0, 1, 1);
2519
+ function $c(t) {
2520
+ t.fragment.uniforms.add(new We("depthTexture", (e, r) => r.mainDepth)), t.fragment.constants.add("occludedHighlightFlag", "vec4", Yi).add("unoccludedHighlightFlag", "vec4", Ki), t.fragment.code.add(l`void outputHighlight() {
2521
+ float sceneDepth = float(texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x);
2522
+ if (gl_FragCoord.z > sceneDepth + 5e-7) {
2523
+ fragColor = occludedHighlightFlag;
2524
+ } else {
2525
+ fragColor = unoccludedHighlightFlag;
2526
+ }
2527
+ }`);
2528
+ }
2529
+ class Lc {
2530
+ constructor(e) {
2531
+ this.vertexBufferLayout = e;
2532
+ }
2533
+ elementCount(e) {
2534
+ return e.attributes.get(m.POSITION).indices.length;
2535
+ }
2536
+ write(e, r, s, a, i) {
2537
+ qi(s, this.vertexBufferLayout, e, r, a, i);
2538
+ }
2539
+ }
2540
+ function yc(t) {
2541
+ Pr(t), t.vertex.code.add(l`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
2542
+ vec4 eye = view * vec4(pos, 1.0);
2543
+ depth = calculateLinearDepth(nearFar,eye.z);
2544
+ return proj * eye;
2545
+ }`), t.vertex.code.add(l`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
2546
+ return proj * (view * vec4(pos, 1.0));
2547
+ }`);
2548
+ }
2549
+ function Cc(t, e) {
2550
+ e.hasVertexColors ? (t.attributes.add(m.COLOR, "vec4"), t.varyings.add("vColor", "vec4"), t.vertex.code.add(l`void forwardVertexColor() { vColor = color; }`), t.vertex.code.add(l`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)) : t.vertex.code.add(l`void forwardVertexColor() {}
2551
+ void forwardNormalizedVertexColor() {}`);
2552
+ }
2553
+ export {
2554
+ cc as $,
2555
+ oo as A,
2556
+ In as B,
2557
+ Sn as C,
2558
+ xn as D,
2559
+ io as E,
2560
+ Rn as F,
2561
+ Cn as G,
2562
+ Qn as H,
2563
+ kt as I,
2564
+ Yn as J,
2565
+ oa as K,
2566
+ vr as L,
2567
+ wi as M,
2568
+ Io as N,
2569
+ Ea as O,
2570
+ Wo as P,
2571
+ ja as Q,
2572
+ Xt as R,
2573
+ ic as S,
2574
+ Aa as T,
2575
+ Vo as U,
2576
+ bc as V,
2577
+ Da as W,
2578
+ Go as X,
2579
+ Cc as Y,
2580
+ ec as Z,
2581
+ Ro as _,
2582
+ xc as a,
2583
+ No as a$,
2584
+ dc as a0,
2585
+ uc as a1,
2586
+ vo as a2,
2587
+ sc as a3,
2588
+ st as a4,
2589
+ ke as a5,
2590
+ dt as a6,
2591
+ yo as a7,
2592
+ kn as a8,
2593
+ aa as a9,
2594
+ lc as aA,
2595
+ hc as aB,
2596
+ nc as aC,
2597
+ na as aD,
2598
+ jn as aE,
2599
+ $a as aF,
2600
+ Po as aG,
2601
+ _c as aH,
2602
+ tc as aI,
2603
+ Ko as aJ,
2604
+ Qo as aK,
2605
+ Yt as aL,
2606
+ gc as aM,
2607
+ go as aN,
2608
+ Ei as aO,
2609
+ lo as aP,
2610
+ Fi as aQ,
2611
+ Ui as aR,
2612
+ Ba as aS,
2613
+ Di as aT,
2614
+ Rc as aU,
2615
+ Yi as aV,
2616
+ Ki as aW,
2617
+ ia as aX,
2618
+ Or as aY,
2619
+ ro as aZ,
2620
+ to as a_,
2621
+ ao as aa,
2622
+ so as ab,
2623
+ Sc as ac,
2624
+ Lc as ad,
2625
+ Ao as ae,
2626
+ Zo as af,
2627
+ Lo as ag,
2628
+ gn as ah,
2629
+ yt as ai,
2630
+ ks as aj,
2631
+ js as ak,
2632
+ qs as al,
2633
+ Xs as am,
2634
+ $e as an,
2635
+ Ta as ao,
2636
+ Jn as ap,
2637
+ Xn as aq,
2638
+ va as ar,
2639
+ ka as as,
2640
+ pr as at,
2641
+ Ho as au,
2642
+ er as av,
2643
+ Pr as aw,
2644
+ Wn as ax,
2645
+ oc as ay,
2646
+ mc as az,
2647
+ ac as b,
2648
+ La as b0,
2649
+ Vi as b1,
2650
+ zi as b2,
2651
+ Wi as b3,
2652
+ Zr as b4,
2653
+ Ic as b5,
2654
+ ji as b6,
2655
+ qn as b7,
2656
+ Ac as b8,
2657
+ wo as b9,
2658
+ qi as ba,
2659
+ Ie as c,
2660
+ x as d,
2661
+ q as e,
2662
+ Bo as f,
2663
+ yc as g,
2664
+ Ra as h,
2665
+ $c as i,
2666
+ Sa as j,
2667
+ K as k,
2668
+ Xo as l,
2669
+ Yo as m,
2670
+ po as n,
2671
+ Qs as o,
2672
+ ko as p,
2673
+ Ha as q,
2674
+ Q as r,
2675
+ We as s,
2676
+ bo as t,
2677
+ Ia as u,
2678
+ lt as v,
2679
+ Ct as w,
2680
+ ot as x,
2681
+ j as y,
2682
+ Dn as z
2683
+ };