@arcgis/core 5.1.0-next.92 → 5.1.0-next.94

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 (213) hide show
  1. package/analysis/ShadowCast/DiscreteOptions.d.ts +12 -6
  2. package/analysis/ShadowCast/MinDurationOptions.d.ts +17 -9
  3. package/analysis/ShadowCast/TotalDurationOptions.d.ts +10 -6
  4. package/analysis/ShadowCastAnalysis.d.ts +23 -17
  5. package/analysis/Viewshed.js +1 -1
  6. package/arcade/arcadeAsyncRuntime.js +1 -1
  7. package/arcade/arcadeCompiler.js +1 -1
  8. package/arcade/arcadeRuntime.js +1 -1
  9. package/arcade/compilerUtils.js +1 -1
  10. package/arcade/debug.d.ts +10 -1
  11. package/arcade.js +1 -1
  12. package/assets/components/assets/combobox/t9n/messages.fr.json +1 -1
  13. package/assets/esri/core/workers/RemoteClient.js +1 -1
  14. package/assets/esri/core/workers/chunks/01af2a0611386df64cb1.js +636 -0
  15. package/assets/esri/core/workers/chunks/031ea31bbdb7f1be791e.js +1 -0
  16. package/assets/esri/core/workers/chunks/{9c09097e390985bbac58.js → 075a1e91a075efe59cd3.js} +1 -1
  17. package/assets/esri/core/workers/chunks/0981fe06796060e50d40.js +1 -0
  18. package/assets/esri/core/workers/chunks/0ab1384282afc8731857.js +1 -0
  19. package/assets/esri/core/workers/chunks/1523883460874c352e36.js +1 -0
  20. package/assets/esri/core/workers/chunks/{de3e5d82502ee15b7eae.js → 15a070d4ac2087b79e8b.js} +1 -1
  21. package/assets/esri/core/workers/chunks/198864c107fa2b24518c.js +1 -0
  22. package/assets/esri/core/workers/chunks/1f141a007b1ef9b069c6.js +1 -0
  23. package/assets/esri/core/workers/chunks/268f203d2492a03165ac.js +1 -0
  24. package/assets/esri/core/workers/chunks/{f52443cd203e687551da.js → 2fda38219d778f0447b5.js} +1 -1
  25. package/assets/esri/core/workers/chunks/2ffffc1931b2e27c6617.js +1 -0
  26. package/assets/esri/core/workers/chunks/{394812e19b6915d560b0.js → 3a691f848152e3818a48.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{ceff78c9e31e3572a082.js → 3a6b8879702fb247328b.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{41cbde4738ae4adf973d.js → 4142d5232c99d8aa943d.js} +5 -5
  29. package/assets/esri/core/workers/chunks/4378e544687fec4b06fb.js +1 -0
  30. package/assets/esri/core/workers/chunks/{4b9b9e6136c11d5d7901.js → 460e693ad19fa77ffdc2.js} +1 -1
  31. package/assets/esri/core/workers/chunks/4df19e670b6ed76c1dea.js +2 -0
  32. package/assets/esri/core/workers/chunks/{a169d9fe66b5865911d9.js → 503439246250d9e1cbd5.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{1e3fe89970c57a883fe5.js → 53ff47c06ccfc0be885c.js} +1 -1
  34. package/assets/esri/core/workers/chunks/561d45dc9421f80feca5.js +1 -0
  35. package/assets/esri/core/workers/chunks/598271956c46e21e5c09.js +1 -0
  36. package/assets/esri/core/workers/chunks/{d82da31dc702b8fd6a07.js → 59a64d72eed8c40c63cf.js} +1 -1
  37. package/assets/esri/core/workers/chunks/5a8fd2fd8a24f9290b7f.js +1 -0
  38. package/assets/esri/core/workers/chunks/64cf18ba2869171a5a7a.js +1 -0
  39. package/assets/esri/core/workers/chunks/{fade7b878a9498382bb2.js → 700f7aa9cf7b13acaf5d.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{4c97cc922eece3a91b6b.js → 7531bbcb6613c87a344e.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{6f67c9f68101a084b683.js → 765bc49e58e9d0caa496.js} +6 -6
  42. package/assets/esri/core/workers/chunks/8042e001545e2782499c.js +1 -0
  43. package/assets/esri/core/workers/chunks/{bb8d596f15fd3a0d783a.js → 82215d7a64b8be02eff1.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{d3d9d40556c847bba1a7.js → 87f7a674957f734b1b42.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{5409369d0d637cb30257.js → 8875e53097b25655ef67.js} +1 -1
  46. package/assets/esri/core/workers/chunks/8e1140725a72038627c2.js +1 -0
  47. package/assets/esri/core/workers/chunks/8e374ce47256a567ae11.js +1 -0
  48. package/assets/esri/core/workers/chunks/{127cd8fee3717a473fc5.js → 928dac64e6ba401d391a.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{d7e7f3efd1d28617b808.js → 92e7067960549733f8e6.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{0a6df243b18acae471be.js → 992525afdf11b2fb16d4.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{f1673e723b336204ad77.js → 9b23d999db902d25ba58.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{f2c11f54255fd506655e.js → 9b869a8bda9384f25464.js} +1 -1
  53. package/assets/esri/core/workers/chunks/a76e14fe5e8b2f7ef9de.js +2 -0
  54. package/assets/esri/core/workers/chunks/{46b16501db6681dc467b.js → af074b5b4e1d6baf5219.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{75c09a2fa4c34b4844c5.js → be0eab592db0e651b023.js} +6 -6
  56. package/assets/esri/core/workers/chunks/{2dcfc4d7e76c922bcbf9.js → c7b9df9a204f6206364a.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{969f58a2de4ebe63619d.js → c88fd4f69cb2b53b48ec.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{ee057c85cdf6beb5b012.js → d1ba118ddd0390c07f35.js} +2 -2
  59. package/assets/esri/core/workers/chunks/d6f03f628ebfc28fdd23.js +2 -0
  60. package/assets/esri/core/workers/chunks/{577cbc131b21c351fae5.js → d87e504082e293640ece.js} +2 -2
  61. package/assets/esri/core/workers/chunks/{54c035cdc171998d0776.js → de99500b0fcedf2c8a5c.js} +1 -1
  62. package/assets/esri/core/workers/chunks/e54ad3683ad992682deb.js +1 -0
  63. package/assets/esri/core/workers/chunks/e6f1ed5e56f1d9862821.js +1 -0
  64. package/assets/esri/core/workers/chunks/e7e7c7cbfd8542bd7a46.js +1 -0
  65. package/assets/esri/core/workers/chunks/{27f67a3828b78d4c1413.js → e81afc8a058a8ecc9b24.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{aefeb5a17bb481c95da3.js → eeb847bfea558566adf6.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{90a8dfb03a437fe8a6e7.js → f04b49d80f422708d98c.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{d11de13537b623739e14.js → f14e3693cd644265f909.js} +1 -1
  69. package/assets/esri/core/workers/chunks/f2beb4267b8d4cddfa3e.js +1 -0
  70. package/assets/esri/core/workers/chunks/{2fd4220131bfc3f5e2dd.js → f635a8e3b0bfeda99ed5.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{aa6808146c76b2d49b64.js → f68c12e0c1eda7f73a17.js} +1 -1
  72. package/assets/esri/core/workers/chunks/f69c44479ee3fd8c831d.js +1 -0
  73. package/assets/esri/core/workers/chunks/fa3138dd8139008b430d.js +1 -0
  74. package/assets/esri/core/workers/chunks/fa4265db06e2721754a0.js +1 -0
  75. package/assets/esri/core/workers/chunks/{adfa5c136c72c1e65770.js → fb75d4bce1e86eed017a.js} +28 -22
  76. package/chunks/GlobalIllumination.glsl.js +24 -18
  77. package/chunks/GlowBlur.glsl.js +11 -11
  78. package/chunks/GlowComposition.glsl.js +4 -4
  79. package/chunks/RibbonLine.glsl.js +91 -51
  80. package/chunks/ShadowCastVisualize.glsl.js +18 -15
  81. package/config.js +1 -1
  82. package/geometry/support/geometryUtils.js +1 -1
  83. package/kernel.js +1 -1
  84. package/layers/FeatureLayer.d.ts +27 -1
  85. package/layers/FeatureLayer.js +1 -1
  86. package/layers/graphics/sources/MemorySource.js +1 -1
  87. package/layers/mixins/PortalLayer.js +1 -1
  88. package/layers/raster/datasets/ImageAuxRaster.js +1 -1
  89. package/layers/raster/datasets/InMemoryRaster.js +1 -1
  90. package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
  91. package/layers/raster/formats/RasterCodec.js +1 -1
  92. package/layers/support/RasterJobHandler.js +1 -1
  93. package/networks/support/UNTraceConfiguration.d.ts +19 -2
  94. package/networks/support/UNTraceConfiguration.js +1 -1
  95. package/networks/support/jsonTypes.d.ts +9 -1
  96. package/package.json +4 -4
  97. package/popup/Feature.d.ts +4 -4
  98. package/popup/Feature.js +1 -1
  99. package/portal/schemas/definitions.js +1 -1
  100. package/portal/support/layersLoader.js +1 -1
  101. package/rest/knowledgeGraph/GraphApplyEditsResult.d.ts +13 -1
  102. package/rest/knowledgeGraph/GraphApplyEditsResult.js +1 -1
  103. package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.d.ts +9 -1
  104. package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +1 -1
  105. package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +1 -1
  106. package/rest/knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js +1 -1
  107. package/rest/networks/support/NetworkElement.d.ts +13 -1
  108. package/rest/networks/support/NetworkElement.js +1 -1
  109. package/rest/versionManagement/gdbVersion/support/ConflictsParameters.js +1 -1
  110. package/rest/versionManagement/gdbVersion/support/DifferencesParameters.js +1 -1
  111. package/rest/versionManagement/gdbVersion/support/DifferencesResult.d.ts +25 -0
  112. package/rest/versionManagement/gdbVersion/support/InspectConflictsParameters.js +1 -1
  113. package/rest/versionManagement/gdbVersion/support/ReconcileParameters.d.ts +3 -5
  114. package/rest/versionManagement/gdbVersion/support/ReconcileParameters.js +1 -1
  115. package/support/revision.js +1 -1
  116. package/symbols/cim/types.d.ts +27 -0
  117. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  118. package/views/2d/engine/webgl/GlyphSDFCreator.js +1 -1
  119. package/views/2d/engine/webgl/definitions.js +1 -1
  120. package/views/2d/engine/webgl/shaderGraph/graph/GlslGraphWriter.js +1 -1
  121. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  122. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  123. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  124. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  125. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  126. package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +6 -5
  127. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  128. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  129. package/views/3d/support/QualityProfile.js +1 -1
  130. package/views/3d/support/QualitySettings.js +1 -1
  131. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +11 -12
  132. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +5 -5
  133. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +1 -1
  134. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
  135. package/views/3d/webgl-engine/effects/atmosphere/LocalAtmosphere.js +1 -1
  136. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  137. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  138. package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
  139. package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
  140. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  141. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  142. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  143. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  144. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  145. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
  146. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  147. package/views/3d/webgl-engine/effects/glow/GlowBlur.glsl.js +1 -1
  148. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  149. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  150. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  151. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +1 -1
  152. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  153. package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
  154. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  155. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  156. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  157. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
  158. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
  159. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  160. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  161. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  162. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  163. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  164. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +1 -1
  165. package/views/3d/webgl-engine/shaders/oitResolution.glsl.js +1 -1
  166. package/views/SceneView.d.ts +3 -3
  167. package/views/layers/FeatureLikeLayerView.js +1 -1
  168. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  169. package/widgets/FeatureTable/Grid/Column.d.ts +2 -17
  170. package/widgets/FeatureTable/Grid/Column.js +1 -1
  171. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  172. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  173. package/widgets/FeatureTable/Grid/GroupColumn.d.ts +1 -7
  174. package/widgets/FeatureTable/Grid/GroupColumn.js +1 -1
  175. package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +1 -9
  176. package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
  177. package/widgets/FeatureTable/support/types.d.ts +0 -8
  178. package/widgets/FeatureTable.js +1 -1
  179. package/widgets/Search/support/layerSearchUtils.js +1 -1
  180. package/widgets/Search/support/locatorUtils.js +1 -1
  181. package/assets/esri/core/workers/chunks/00e9e25269d5776f8645.js +0 -1
  182. package/assets/esri/core/workers/chunks/014a5fad55f97b9b5166.js +0 -1
  183. package/assets/esri/core/workers/chunks/06003996a378c45bc605.js +0 -1
  184. package/assets/esri/core/workers/chunks/0840e7dd62643c56ae9e.js +0 -1
  185. package/assets/esri/core/workers/chunks/0cc4b3100a7a453bd058.js +0 -1
  186. package/assets/esri/core/workers/chunks/1e4e7111d43f01c149b3.js +0 -1
  187. package/assets/esri/core/workers/chunks/3d9032217347dadcbe41.js +0 -1
  188. package/assets/esri/core/workers/chunks/4b79ebfb3328f9483147.js +0 -1
  189. package/assets/esri/core/workers/chunks/4dbbf59c79d9e72f20ee.js +0 -1
  190. package/assets/esri/core/workers/chunks/4e206957b28253ddc1a3.js +0 -1
  191. package/assets/esri/core/workers/chunks/53ef72edc3ed80bf558c.js +0 -1
  192. package/assets/esri/core/workers/chunks/6dac8dfcd63fc757ae2d.js +0 -1
  193. package/assets/esri/core/workers/chunks/73af4c947e8151d411c1.js +0 -2
  194. package/assets/esri/core/workers/chunks/752f4e0e2961fc315dca.js +0 -1
  195. package/assets/esri/core/workers/chunks/7ba67f1d7831a5576a5a.js +0 -1
  196. package/assets/esri/core/workers/chunks/a508104179e08f0f268c.js +0 -2
  197. package/assets/esri/core/workers/chunks/a6b75576d598ec161cc4.js +0 -1
  198. package/assets/esri/core/workers/chunks/b4bac22467e96be7a974.js +0 -1
  199. package/assets/esri/core/workers/chunks/bb5f909a2f26fc6a21b0.js +0 -2
  200. package/assets/esri/core/workers/chunks/bea2fd831d7a864e5995.js +0 -596
  201. package/assets/esri/core/workers/chunks/c8ef80a7c46d7d2c5172.js +0 -1
  202. package/assets/esri/core/workers/chunks/dd5b362bded458afa2d6.js +0 -1
  203. package/assets/esri/core/workers/chunks/dde94664110ff231a52d.js +0 -1
  204. package/assets/esri/core/workers/chunks/f1e5626a0cc1631a1efb.js +0 -1
  205. package/assets/esri/core/workers/chunks/f36345ebb9851ab92453.js +0 -1
  206. package/assets/esri/core/workers/chunks/f7531aa69a87814c60d1.js +0 -1
  207. package/assets/esri/core/workers/chunks/f971dcfd04af1fd652b4.js +0 -1
  208. package/assets/esri/themes/base/fonts/cdn.scss +0 -3
  209. /package/assets/esri/core/workers/chunks/{bb5f909a2f26fc6a21b0.js.LICENSE.txt → 4df19e670b6ed76c1dea.js.LICENSE.txt} +0 -0
  210. /package/assets/esri/core/workers/chunks/{a508104179e08f0f268c.js.LICENSE.txt → a76e14fe5e8b2f7ef9de.js.LICENSE.txt} +0 -0
  211. /package/assets/esri/core/workers/chunks/{73af4c947e8151d411c1.js.LICENSE.txt → d1ba118ddd0390c07f35.js.LICENSE.txt} +0 -0
  212. /package/assets/esri/core/workers/chunks/{ee057c85cdf6beb5b012.js.LICENSE.txt → d6f03f628ebfc28fdd23.js.LICENSE.txt} +0 -0
  213. /package/assets/esri/core/workers/chunks/{577cbc131b21c351fae5.js.LICENSE.txt → d87e504082e293640ece.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../core/Error.js";import{parse as t}from"../../layers/support/arcgisLayerUrl.js";import{fetchFeatureService as r}from"../../layers/support/fetchService.js";import{LayerLoadContext as a}from"../../layers/support/LayerLoadContext.js";import{applyPreferredHostToPortalItem as o,isPreferredUrlApplicable as n,getPreferredHost as s}from"../../layers/support/layerUtils.js";import l from"../Portal.js";import{createForItemRead as i}from"./jsonContext.js";import{instanceTypeToLayerTypes as p,getSublayersByLayerType as u,getFirstLayerOrTable as c,preprocessFSItemData as y,populateSceneServiceItemData as d,getNumLayersAndTables as f,layerTypeToLayerModuleType as m,createSublayerData as w}from"./loadUtils.js";import{hasTypeKeyword as h}from"./portalItemUtils.js";import{loadStyleRenderer as g}from"../../renderers/support/styleUtils.js";import{requestServiceJSON as I}from"../../request/serviceJSON.js";async function b(e,t){const r=e.instance.portalItem;if(r?.id)return await r.load(t),v(e),e.validateItem&&e.validateItem(r),L(e,t)}function v(t){const r=t.instance.portalItem;if(!r?.type||!t.supportedTypes.includes(r.type))throw new e("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:r?.type,expectedType:t.supportedTypes.join(", ")})}async function L(e,t){const r=e.instance,o=r.portalItem;if(!o)return;let{url:n}=o;const{title:s}=o,l=i(o,"portal-item");if("group"===r.type)return S(r,l,e);n&&"media"!==r.type&&r.read({url:n},l);const p=new a,{data:u,preferredHost:c}=await x(e,p,t);return n=o.url,"isUrlHostModified"in r&&(c?r.applyPreferredHost({preferredHost:c}):r.applyHostFromPortalItem()),u&&r.read(u,l),r.resourceReferences={portalItem:o,paths:l.readResourcePaths??[]},"subtype-group"!==r.type&&r.read({title:s},l),g(r,l)}async function S(t,r,a){const o=t.portalItem;if(!t.sourceIsPortalItem)return;const{title:n,type:s}=o;if("Group Layer"===s){if(!h(o,"Map"))throw new e("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return T(t,a)}return t.read({title:n},r),j(t,a)}async function T(t,r){const a=t.portalItem,o=await a.fetchData("json");if(!o)return;if(!r.populateGroupLayer)throw new e("portal:missing-populate-group-layer","Missing populate group layer");const n=i(a,"web-map");t.read(o,n),await r.populateGroupLayer(t,o,{context:n}),t.resourceReferences={portalItem:a,paths:n.readResourcePaths??[]}}async function j(t,r){let n;const{portalItem:s}=t;if(!s)return;const l=s.type,i=r.layerModuleTypeMap;if(!i)throw new e("portal:missing-layer-module-type-map","Layer module type map is required to construct sub layers");switch(l){case"Feature Service":case"Feature Collection":n=i.FeatureLayer;break;case"Stream Service":n=i.StreamLayer;break;case"Scene Service":n=i.SceneLayer;break;case"Video Service":n=i.VideoLayer;break;default:throw new e("portal:unsupported-item-type-as-group",`The item type '${l}' is not supported as a 'GroupLayer'`)}const p="Video Service"===l,u=new a;let[m,{data:w}]=await Promise.all([n(),p?{data:null}:x(r,u)]),h=()=>m;if(p)return H(t,h,i);if("Feature Service"===l){const e=c(w)?.customParameters;w=s.url?(await y(w,s.url,u)).data:{},h=await E(w,i)||h;const{provider:r,preferredHost:a}=await U(s.url,{customParameters:e,loadContext:u});return o(s,a),await M(t,h,h,w,i,r)}return"Scene Service"===l&&s.url&&(w=await d(s,w,u)),f(w)>0?await M(t,h,null,w,i):await F(t,h,i)}async function F(e,t,r){const{portalItem:a}=e;if(!a?.url)return;const o=await I(a.url);o&&M(e,t,null,{layers:o.layers?.map(w),tables:o.tables?.map(w)},r)}async function H(e,t,r){const{portalItem:a}=e;if(!a?.url)return;const o=await I(a.url);o&&M(e,t,null,{layers:o.layers?.map(({id:e,name:t})=>({id:e,name:t}))},r)}async function M(e,t,r,a,o,n){let s=a.layers||[];const l=a.tables||[];if("Feature Collection"===e.portalItem?.type?(s.forEach((e,t)=>{e.id=t,"Table"===e?.layerDefinition?.type&&l.push(e)}),s=s.filter(e=>"Table"!==e?.layerDefinition?.type)):(s.reverse(),l.reverse()),s.forEach(r=>{const o=n?.(r);if(o||!n){const n=P(e,t(r),a,r,o);e.add(n)}}),l.length){const t=r?null:await o.FeatureLayer();l.forEach(o=>{const s=n?.(o);if(s||!n){const n=P(e,r?r(o):t,a,o,s);e.tables.add(n)}})}}function P(e,t,r,a,o){const n=e.portalItem,s={portalItem:n.clone(),layerId:a.id};null!=a.url&&(s.url=a.url);const i=new t(s);if("sourceJSON"in i&&(i.sourceJSON=o),"subtype-group"!==i.type&&"catalog"!==i.type&&(i.sublayerTitleMode="service-name"),"Feature Collection"===n.type){const e={origin:"portal-item",portal:n.portal||l.getDefault()};i.read(a,e);const t=r.showLegend;null!=t&&i.read({showLegend:t},e)}return i}async function x(e,t,r){if(!1===e.supportsData)return{data:void 0};const a=e.instance,n=a.portalItem;if(!n)return{data:void 0};let s=null;try{s="video"===a.type?null:await n.fetchData("json",r)}catch(l){}if(C(a)){let e=null;const{count:r,preferredHost:l}=await G(n,s,t);if(o(n,l),(s?.layers||s?.tables)&&r>0){if(null==a.layerId){const e=p(a.type),t=e?.length?u(s,e)[0]:c(s);t&&(a.layerId=t.id)}e=k(s,a),"OrientedImageryLayer"===e?.layerType&&"oriented-imagery"===a.type&&a.supportedSourceTypes.add("Feature Layer"),e&&null!=s.showLegend&&(e.showLegend=s.showLegend)}return r>1&&"sublayerTitleMode"in a&&"service-name"!==a.sublayerTitleMode&&(a.sublayerTitleMode="item-title-and-service-name"),{data:e,preferredHost:l}}return{data:s}}async function G(e,r,a){if(r?.layers&&r?.tables)return{count:f(r)};const o=t(e.url);if(!o)return{count:1};const l=o.url.path,i=await a.fetchServiceMetadata(l,{customParameters:c(r)?.customParameters}).catch(()=>null);return{count:(r?.layers?.length??i?.layers?.length??0)+(r?.tables?.length??i?.tables?.length??0),preferredHost:n(e)?s():null}}function k(e,t){const{layerId:r}=t,a=e.layers?.find(e=>e.id===r)||e.tables?.find(e=>e.id===r);return a&&D(a,t)?a:null}function C(e){return"stream"!==e.type&&"layerId"in e}function D(e,t){const r="layerType"in e&&e.layerType,{type:a}=t;return!("feature"===a&&r&&"ArcGISFeatureLayer"!==e.layerType||"catalog"===a&&!r||"oriented-imagery"===a&&!r||"subtype-group"===a&&!r)}async function U(e,t){const{layersJSON:a,preferredHost:o}=await r(e,t);if(!a)return{provider:null,preferredHost:o};const n=[...a.layers,...a.tables];return{provider:e=>n.find(t=>t.id===e.id),preferredHost:o}}async function E(e,t){const{layers:r,tables:a}=e,o=[...r??[],...a??[]];if(!o.length)return;const n=new Set,s=[];for(const{layerType:p}of o){const e=p??"ArcGISFeatureLayer";if(n.has(e))continue;n.add(e);const r=t[m(e)];s.push(r())}const l=await Promise.all(s),i=new Map;return Array.from(n).forEach((e,t)=>{i.set(e,l[t])}),({layerType:e})=>{const t=e??"ArcGISFeatureLayer";return i.get(t)}}export{b as load};
2
+ import e from"../../core/Error.js";import{parse as t}from"../../layers/support/arcgisLayerUrl.js";import{fetchFeatureService as r}from"../../layers/support/fetchService.js";import{LayerLoadContext as a}from"../../layers/support/LayerLoadContext.js";import{applyPreferredHostToPortalItem as o,isPreferredUrlApplicable as n,getPreferredHost as s}from"../../layers/support/layerUtils.js";import i from"../Portal.js";import{createForItemRead as l}from"./jsonContext.js";import{instanceTypeToLayerTypes as u,getSublayersByLayerType as p,getFirstLayerOrTable as c,preprocessFSItemData as y,populateSceneServiceItemData as d,getNumLayersAndTables as f,layerTypeToLayerModuleType as m,createSublayerData as w}from"./loadUtils.js";import{hasTypeKeyword as h}from"./portalItemUtils.js";import{loadStyleRenderer as g}from"../../renderers/support/styleUtils.js";import{requestServiceJSON as I}from"../../request/serviceJSON.js";async function v(e,t){const r=e.instance.portalItem;if(r?.id)return await r.load(t),L(e),e.validateItem&&e.validateItem(r),S(e,t)}async function b(e,t){const r=e.instance.portalItem;if(!r?.id)return!1;if(!r.loaded)return!1;const a=r.modified;return await r.reload(),t?.signal?.throwIfAborted(),a?.getTime()!==r.modified?.getTime()&&(L(e),e.validateItem&&e.validateItem(r),await S(e,t),!0)}function L(t){const r=t.instance.portalItem;if(!r?.type||!t.supportedTypes.includes(r.type))throw new e("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:r?.type,expectedType:t.supportedTypes.join(", ")})}async function S(e,t){const r=e.instance,o=r.portalItem;if(!o)return;let{url:n}=o;const{title:s}=o,i=l(o,"portal-item");if("group"===r.type)return T(r,i,e);n&&"media"!==r.type&&r.read({url:n},i);const u=new a,{data:p,preferredHost:c}=await G(e,u,t);return n=o.url,"isUrlHostModified"in r&&(c?r.applyPreferredHost({preferredHost:c}):r.applyHostFromPortalItem()),p&&r.read(p,i),r.resourceReferences={portalItem:o,paths:i.readResourcePaths??[]},"subtype-group"!==r.type&&r.read({title:s},i),g(r,i)}async function T(t,r,a){const o=t.portalItem;if(!t.sourceIsPortalItem)return;const{title:n,type:s}=o;if("Group Layer"===s){if(!h(o,"Map"))throw new e("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return j(t,a)}return t.read({title:n},r),F(t,a)}async function j(t,r){const a=t.portalItem,o=await a.fetchData("json");if(!o)return;if(!r.populateGroupLayer)throw new e("portal:missing-populate-group-layer","Missing populate group layer");const n=l(a,"web-map");t.read(o,n),await r.populateGroupLayer(t,o,{context:n}),t.resourceReferences={portalItem:a,paths:n.readResourcePaths??[]}}async function F(t,r){let n;const{portalItem:s}=t;if(!s)return;const i=s.type,l=r.layerModuleTypeMap;if(!l)throw new e("portal:missing-layer-module-type-map","Layer module type map is required to construct sub layers");switch(i){case"Feature Service":case"Feature Collection":n=l.FeatureLayer;break;case"Stream Service":n=l.StreamLayer;break;case"Scene Service":n=l.SceneLayer;break;case"Video Service":n=l.VideoLayer;break;default:throw new e("portal:unsupported-item-type-as-group",`The item type '${i}' is not supported as a 'GroupLayer'`)}const u="Video Service"===i,p=new a;let[m,{data:w}]=await Promise.all([n(),u?{data:null}:G(r,p)]),h=()=>m;if(u)return M(t,h,l);if("Feature Service"===i){const e=c(w)?.customParameters;w=s.url?(await y(w,s.url,p)).data:{},h=await E(w,l)||h;const{provider:r,preferredHost:a}=await A(s.url,{customParameters:e,loadContext:p});return o(s,a),await P(t,h,h,w,l,r)}return"Scene Service"===i&&s.url&&(w=await d(s,w,p)),f(w)>0?await P(t,h,null,w,l):await H(t,h,l)}async function H(e,t,r){const{portalItem:a}=e;if(!a?.url)return;const o=await I(a.url);o&&P(e,t,null,{layers:o.layers?.map(w),tables:o.tables?.map(w)},r)}async function M(e,t,r){const{portalItem:a}=e;if(!a?.url)return;const o=await I(a.url);o&&P(e,t,null,{layers:o.layers?.map(({id:e,name:t})=>({id:e,name:t}))},r)}async function P(e,t,r,a,o,n){let s=a.layers||[];const i=a.tables||[];if("Feature Collection"===e.portalItem?.type?(s.forEach((e,t)=>{e.id=t,"Table"===e?.layerDefinition?.type&&i.push(e)}),s=s.filter(e=>"Table"!==e?.layerDefinition?.type)):(s.reverse(),i.reverse()),s.forEach(r=>{const o=n?.(r);if(o||!n){const n=x(e,t(r),a,r,o);e.add(n)}}),i.length){const t=r?null:await o.FeatureLayer();i.forEach(o=>{const s=n?.(o);if(s||!n){const n=x(e,r?r(o):t,a,o,s);e.tables.add(n)}})}}function x(e,t,r,a,o){const n=e.portalItem,s={portalItem:n.clone(),layerId:a.id};null!=a.url&&(s.url=a.url);const l=new t(s);if("sourceJSON"in l&&(l.sourceJSON=o),"subtype-group"!==l.type&&"catalog"!==l.type&&(l.sublayerTitleMode="service-name"),"Feature Collection"===n.type){const e={origin:"portal-item",portal:n.portal||i.getDefault()};l.read(a,e);const t=r.showLegend;null!=t&&l.read({showLegend:t},e)}return l}async function G(e,t,r){if(!1===e.supportsData)return{data:void 0};const a=e.instance,n=a.portalItem;if(!n)return{data:void 0};let s=null;try{s="video"===a.type?null:await n.fetchData("json",r)}catch(i){}if(D(a)){let e=null;const{count:r,preferredHost:i}=await k(n,s,t);if(o(n,i),(s?.layers||s?.tables)&&r>0){if(null==a.layerId){const e=u(a.type),t=e?.length?p(s,e)[0]:c(s);t&&(a.layerId=t.id)}e=C(s,a),"OrientedImageryLayer"===e?.layerType&&"oriented-imagery"===a.type&&a.supportedSourceTypes.add("Feature Layer"),e&&null!=s.showLegend&&(e.showLegend=s.showLegend)}return r>1&&"sublayerTitleMode"in a&&"service-name"!==a.sublayerTitleMode&&(a.sublayerTitleMode="item-title-and-service-name"),{data:e,preferredHost:i}}return{data:s}}async function k(e,r,a){if(r?.layers&&r?.tables)return{count:f(r)};const o=t(e.url);if(!o)return{count:1};const i=o.url.path,l=await a.fetchServiceMetadata(i,{customParameters:c(r)?.customParameters}).catch(()=>null);return{count:(r?.layers?.length??l?.layers?.length??0)+(r?.tables?.length??l?.tables?.length??0),preferredHost:n(e)?s():null}}function C(e,t){const{layerId:r}=t,a=e.layers?.find(e=>e.id===r)||e.tables?.find(e=>e.id===r);return a&&U(a,t)?a:null}function D(e){return"stream"!==e.type&&"layerId"in e}function U(e,t){const r="layerType"in e&&e.layerType,{type:a}=t;return!("feature"===a&&r&&"ArcGISFeatureLayer"!==e.layerType||"catalog"===a&&!r||"oriented-imagery"===a&&!r||"subtype-group"===a&&!r)}async function A(e,t){const{layersJSON:a,preferredHost:o}=await r(e,t);if(!a)return{provider:null,preferredHost:o};const n=[...a.layers,...a.tables];return{provider:e=>n.find(t=>t.id===e.id),preferredHost:o}}async function E(e,t){const{layers:r,tables:a}=e,o=[...r??[],...a??[]];if(!o.length)return;const n=new Set,s=[];for(const{layerType:u}of o){const e=u??"ArcGISFeatureLayer";if(n.has(e))continue;n.add(e);const r=t[m(e)];s.push(r())}const i=await Promise.all(s),l=new Map;return Array.from(n).forEach((e,t)=>{l.set(e,i[t])}),({layerType:e})=>{const t=e??"ArcGISFeatureLayer";return l.get(t)}}export{v as load,b as reload};
@@ -1,7 +1,7 @@
1
1
  import type Accessor from "../../core/Accessor.js";
2
2
  import type EsriError from "../../core/Error.js";
3
3
 
4
- export interface GraphApplyEditsResultProperties extends Partial<Pick<GraphApplyEditsResult, "cascadeProvenanceDeleteResults" | "cascadeRelationshipDeleteResults" | "editResults" | "error" | "hasError">> {}
4
+ export interface GraphApplyEditsResultProperties extends Partial<Pick<GraphApplyEditsResult, "cascadeProvenanceDeleteResults" | "cascadeRelationshipDeleteResults" | "editResults" | "error" | "hasError" | "timestamp" | "username">> {}
5
5
 
6
6
  /**
7
7
  * The result of an [executeApplyEdits()](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraphService/#executeApplyEdits) performed on a knowledge graph service's
@@ -183,6 +183,18 @@ export default class GraphApplyEditsResult extends Accessor {
183
183
  * @default false
184
184
  */
185
185
  accessor hasError: boolean;
186
+ /**
187
+ * The timestamp associated with the edit, when metadata is available from the service.
188
+ *
189
+ * @since 6.0
190
+ */
191
+ accessor timestamp: Date | null | undefined;
192
+ /**
193
+ * The user that made the edit, when metadata is available from the service.
194
+ *
195
+ * @since 6.0
196
+ */
197
+ accessor username: string | null | undefined;
186
198
  }
187
199
 
188
200
  /**
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{property as s,subclass as o}from"../../core/accessorSupport/decorators.js";let r=class extends t{constructor(e){super(e),this.hasError=!1,this.error=null,this.editResults=[],this.cascadeRelationshipDeleteResults=[],this.cascadeProvenanceDeleteResults=[]}};e([s()],r.prototype,"hasError",void 0),e([s()],r.prototype,"error",void 0),e([s()],r.prototype,"editResults",void 0),e([s()],r.prototype,"cascadeRelationshipDeleteResults",void 0),e([s()],r.prototype,"cascadeProvenanceDeleteResults",void 0),r=e([o("esri.rest.knowledgeGraph.GraphApplyEditsResult")],r);const p=r;export{p as default};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{property as s,subclass as o}from"../../core/accessorSupport/decorators.js";let r=class extends t{constructor(e){super(e),this.hasError=!1,this.error=null,this.username=null,this.timestamp=null,this.editResults=[],this.cascadeRelationshipDeleteResults=[],this.cascadeProvenanceDeleteResults=[]}};e([s()],r.prototype,"hasError",void 0),e([s()],r.prototype,"error",void 0),e([s()],r.prototype,"username",void 0),e([s()],r.prototype,"timestamp",void 0),e([s()],r.prototype,"editResults",void 0),e([s()],r.prototype,"cascadeRelationshipDeleteResults",void 0),e([s()],r.prototype,"cascadeProvenanceDeleteResults",void 0),r=e([o("esri.rest.knowledgeGraph.GraphApplyEditsResult")],r);const p=r;export{p as default};
@@ -1,7 +1,8 @@
1
+ import type EsriError from "../../core/Error.js";
1
2
  import type GraphDataModelOperationResult from "./GraphDataModelOperationResult.js";
2
3
  import type { GraphDataModelOperationResultProperties } from "./GraphDataModelOperationResult.js";
3
4
 
4
- export interface GraphDeleteNamedTypeResultProperties extends GraphDataModelOperationResultProperties {}
5
+ export interface GraphDeleteNamedTypeResultProperties extends GraphDataModelOperationResultProperties, Partial<Pick<GraphDeleteNamedTypeResult, "warnings">> {}
5
6
 
6
7
  /**
7
8
  * The result returned when [deleting](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraphService/#executeDeleteNamedType) an [entity type](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/EntityType/) or
@@ -12,4 +13,11 @@ export interface GraphDeleteNamedTypeResultProperties extends GraphDataModelOper
12
13
  */
13
14
  export default class GraphDeleteNamedTypeResult extends GraphDataModelOperationResult {
14
15
  constructor(properties?: GraphDeleteNamedTypeResultProperties);
16
+ /**
17
+ * Any warnings returned while processing the delete operation for this named type.
18
+ *
19
+ * @property
20
+ * @since 5.1
21
+ */
22
+ accessor warnings: EsriError[];
15
23
  }
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../core/accessorSupport/decorators.js";import t from"./GraphDataModelOperationResult.js";let o=class extends t{constructor(e){super(e)}};o=e([r("esri.rest.knowledgeGraph.GraphDeleteNamedTypeResult")],o);const s=o;export{s as default};
2
+ import{__decorate as r}from"tslib";import{property as e,subclass as t}from"../../core/accessorSupport/decorators.js";import o from"./GraphDataModelOperationResult.js";let s=class extends o{constructor(r){super(r),this.warnings=[]}};r([e()],s.prototype,"warnings",void 0),s=r([t("esri.rest.knowledgeGraph.GraphDeleteNamedTypeResult")],s);const a=s;export{a as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import r from"../GraphAddFieldIndexResult.js";import e from"../GraphAddNamedTypesResult.js";import t from"../GraphAddPropertyResult.js";import o from"../GraphDataModelSingletonOperationResult.js";import s from"../GraphDeleteFieldIndexResult.js";import n from"../GraphDeleteNamedTypeResult.js";import u from"../GraphDeletePropertyResult.js";import l from"../GraphUpdateNamedTypesResult.js";import d from"../GraphUpdatePropertyResult.js";import c from"../GraphUpdateSearchIndexResult.js";import{wasmErrorToEsriError as _}from"./wasmUtils.js";function p(r,e){const t=[];for(let o=0;o<e;o++){const e=r.get_result_at(o);t.push({name:e.get_name(),error:_(e.get_error())})}return t}function i(r){const t=r.get_results_count(),o=r.get_entity_type_add_results_count(),s=r.get_relationship_type_add_results_count(),n=new e({resultsCount:t,results:p(r,t),decoderError:_(r.error),entityAddResultsCount:o,relationshipAddResultsCount:s});for(let e=0;e<o;e++){const t=r.get_entity_type_add_results_at(e),o=t.get_name(),s=t.get_error();n.entityAddResults.push({name:o,error:_(s)})}for(let e=0;e<s;e++){const t=r.get_relationship_type_add_results_at(e),o=t.get_name(),s=t.get_error();n.relationshipAddResults.push({name:o,error:_(s)})}return n}function a(r){const e=r.get_results_count();return new l({resultsCount:e,results:p(r,e),decoderError:_(r.error)})}function m(r){const e=r.get_results_count();return new n({resultsCount:e,results:p(r,e),decoderError:_(r.error)})}function f(r){const e=r.get_results_count();return new t({resultsCount:e,results:p(r,e),decoderError:_(r.error)})}function g(r){const e=r.get_results_count();return new u({resultsCount:e,results:p(r,e),decoderError:_(r.error)})}function h(r){const e=r.get_results_count();return new d({resultsCount:e,results:p(r,e),decoderError:_(r.error)})}function y(r){const e=r.get_results_count();return new c({resultsCount:e,results:p(r,e),decoderError:_(r.error)})}function R(e){const t=e.get_results_count();return new r({resultsCount:t,results:p(e,t),decoderError:_(e.error)})}function j(r){const e=r.get_results_count();return new s({resultsCount:e,results:p(r,e),decoderError:_(r.error)})}function w(r){return new o({decoderError:_(r.error)})}export{f as decoderToAddGraphPropertiesResult,i as decoderToAddNamedTypesResult,g as decoderToDeleteGraphPropertiesResult,m as decoderToDeleteNamedTypeResult,R as decoderToGraphAddIndexResult,w as decoderToGraphDataModelSingletonOperationResult,j as decoderToGraphDeleteIndexResult,y as decoderToGraphUpdateSearchIndexResult,h as decoderToUpdateGraphPropertiesResult,a as decoderToUpdateNamedTypesResult};
2
+ import r from"../GraphAddFieldIndexResult.js";import e from"../GraphAddNamedTypesResult.js";import t from"../GraphAddPropertyResult.js";import o from"../GraphDataModelSingletonOperationResult.js";import s from"../GraphDeleteFieldIndexResult.js";import n from"../GraphDeleteNamedTypeResult.js";import u from"../GraphDeletePropertyResult.js";import l from"../GraphUpdateNamedTypesResult.js";import d from"../GraphUpdatePropertyResult.js";import _ from"../GraphUpdateSearchIndexResult.js";import{wasmErrorToEsriError as c}from"./wasmUtils.js";function p(r,e){const t=[];for(let o=0;o<e;o++){const e=r.get_result_at(o);t.push({name:e.get_name(),error:c(e.get_error())})}return t}function a(r){const t=r.get_results_count(),o=r.get_entity_type_add_results_count(),s=r.get_relationship_type_add_results_count(),n=new e({resultsCount:t,results:p(r,t),decoderError:c(r.error),entityAddResultsCount:o,relationshipAddResultsCount:s});for(let e=0;e<o;e++){const t=r.get_entity_type_add_results_at(e),o=t.get_name(),s=t.get_error();n.entityAddResults.push({name:o,error:c(s)})}for(let e=0;e<s;e++){const t=r.get_relationship_type_add_results_at(e),o=t.get_name(),s=t.get_error();n.relationshipAddResults.push({name:o,error:c(s)})}return n}function i(r){const e=r.get_results_count();return new l({resultsCount:e,results:p(r,e),decoderError:c(r.error)})}function m(r){const e=r.get_results_count(),t=[];for(let s=0;s<r.get_warnings_count();s++){const e=c(r.get_warning_at(s));null!=e&&t.push(e)}const o=p(r,e);return new n({resultsCount:e,results:o,warnings:t,decoderError:c(r.error)})}function f(r){const e=r.get_results_count();return new t({resultsCount:e,results:p(r,e),decoderError:c(r.error)})}function g(r){const e=r.get_results_count();return new u({resultsCount:e,results:p(r,e),decoderError:c(r.error)})}function h(r){const e=r.get_results_count();return new d({resultsCount:e,results:p(r,e),decoderError:c(r.error)})}function w(r){const e=r.get_results_count();return new _({resultsCount:e,results:p(r,e),decoderError:c(r.error)})}function y(e){const t=e.get_results_count();return new r({resultsCount:t,results:p(e,t),decoderError:c(e.error)})}function R(r){const e=r.get_results_count();return new s({resultsCount:e,results:p(r,e),decoderError:c(r.error)})}function j(r){return new o({decoderError:c(r.error)})}export{f as decoderToAddGraphPropertiesResult,a as decoderToAddNamedTypesResult,g as decoderToDeleteGraphPropertiesResult,m as decoderToDeleteNamedTypeResult,y as decoderToGraphAddIndexResult,j as decoderToGraphDataModelSingletonOperationResult,R as decoderToGraphDeleteIndexResult,w as decoderToGraphUpdateSearchIndexResult,h as decoderToUpdateGraphPropertiesResult,i as decoderToUpdateNamedTypesResult};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../GraphApplyEditsResult.js";import{wasmErrorToEsriError as t}from"./wasmUtils.js";function r(r){const s=r.has_error(),_=new e({hasError:s,error:s?t(r.error):null}),d=r.get_edit_results_count();for(let e=0;e<d;e++){const s=r.get_edit_results_at(e);s.deleteLater();const d=r.get_edit_results_type_name_at(e),o=[],a=[],l=[],n=s.get_add_results_count(),c=s.get_update_results_count(),u=s.get_delete_results_count();for(let e=0;e<n;e++){const r=s.get_add_result_at(e);r.deleteLater(),o.push({id:r.id,error:t(r.error)})}for(let e=0;e<c;e++){const r=s.get_update_result_at(e);r.deleteLater(),a.push({id:r.id,error:t(r.error)})}for(let e=0;e<u;e++){const r=s.get_delete_result_at(e);r.deleteLater(),l.push({id:r.id,error:t(r.error)})}_.editResults.push({typeName:d,adds:o,updates:a,deletes:l})}const o=r.get_cascaded_rel_deletes_count();for(let e=0;e<o;e++){const s=r.get_cascaded_rel_deletes_at(e);s.deleteLater();const d=r.get_cascaded_rel_deletes_type_name_at(e),o=[];for(let e=0;e<s.get_count();e++){const r=s.get_result_at(e);r.deleteLater(),o.push({id:r.id,originId:r.origin_id,destinationId:r.dest_id,error:t(r.error)})}_.cascadeRelationshipDeleteResults.push({typeName:d,cascadeRelationshipDeletes:o})}if(r.has_cascading_provenance_deletes()){const e=r.get_cascading_provenance_deletes();e.deleteLater();const s=e.get_count();for(let r=0;r<s;r++){const s=e.get_result_at(r);s.deleteLater(),_.cascadeProvenanceDeleteResults.push({id:s.id,error:t(s.error)})}}return _}export{r as decoderToApplyEditsResponse};
2
+ import e from"../GraphApplyEditsResult.js";import{wasmErrorToEsriError as t}from"./wasmUtils.js";function r(e){const t=e.get_apply_edits_metadata();t.deleteLater();const r=t.get_username(),s=t.get_timestamp();return{username:r,timestamp:null!=s?new Date(s):null}}function s(s){const a=s.has_error(),_=r(s),d=new e({hasError:a,error:a?t(s.error):null});d.username=_.username,d.timestamp=_.timestamp;const o=s.get_edit_results_count();for(let e=0;e<o;e++){const r=s.get_edit_results_at(e);r.deleteLater();const a=s.get_edit_results_type_name_at(e),_=[],o=[],l=[],n=r.get_add_results_count(),c=r.get_update_results_count(),u=r.get_delete_results_count();for(let e=0;e<n;e++){const s=r.get_add_result_at(e);s.deleteLater(),_.push({id:s.id,error:t(s.error)})}for(let e=0;e<c;e++){const s=r.get_update_result_at(e);s.deleteLater(),o.push({id:s.id,error:t(s.error)})}for(let e=0;e<u;e++){const s=r.get_delete_result_at(e);s.deleteLater(),l.push({id:s.id,error:t(s.error)})}d.editResults.push({typeName:a,adds:_,updates:o,deletes:l})}const l=s.get_cascaded_rel_deletes_count();for(let e=0;e<l;e++){const r=s.get_cascaded_rel_deletes_at(e);r.deleteLater();const a=s.get_cascaded_rel_deletes_type_name_at(e),_=[];for(let e=0;e<r.get_count();e++){const s=r.get_result_at(e);s.deleteLater(),_.push({id:s.id,originId:s.origin_id,destinationId:s.dest_id,error:t(s.error)})}d.cascadeRelationshipDeleteResults.push({typeName:a,cascadeRelationshipDeletes:_})}if(s.has_cascading_provenance_deletes()){const e=s.get_cascading_provenance_deletes();e.deleteLater();const r=e.get_count();for(let s=0;s<r;s++){const r=e.get_result_at(s);r.deleteLater(),d.cascadeProvenanceDeleteResults.push({id:r.id,error:t(r.error)})}}return d}export{s as decoderToApplyEditsResponse};
@@ -1,6 +1,6 @@
1
1
  import type { JSONSupport } from "../../../core/JSONSupport.js";
2
2
 
3
- export interface NetworkElementProperties extends Partial<Pick<NetworkElement, "assetGroupCode" | "assetTypeCode" | "globalId" | "networkSourceId" | "objectId" | "positionFrom" | "positionTo" | "terminalId">> {}
3
+ export interface NetworkElementProperties extends Partial<Pick<NetworkElement, "assetGroupCode" | "assetTypeCode" | "flowDirection" | "globalId" | "networkSourceId" | "objectId" | "positionFrom" | "positionTo" | "terminalId">> {}
4
4
 
5
5
  /**
6
6
  * The network element is a representation of how the network topology defines its graph. The network topology (or index) work with network elements and thats how the trace traverses those elements.
@@ -26,6 +26,18 @@ export default class NetworkElement extends JSONSupport {
26
26
  accessor assetGroupCode: number;
27
27
  /** The asset type code discriminator this network element represents. */
28
28
  accessor assetTypeCode: number;
29
+ /**
30
+ * The flow direction of the element.
31
+ * Only applies to network edges (line feature classes).
32
+ * Requires [includeFlowDirections](https://developers.arcgis.com/javascript/latest/references/core/networks/support/jsonTypes/#ResultType-includeFlowDirections)
33
+ * to be specified for a trace.
34
+ *
35
+ * @since 5.1
36
+ * @see [ResultType](https://developers.arcgis.com/javascript/latest/references/core/networks/support/jsonTypes/#ResultType-includeFlowDirections)
37
+ * @see [UNTraceConfiguration.allowIndeterminateFlow](https://developers.arcgis.com/javascript/latest/references/core/networks/support/UNTraceConfiguration/#allowIndeterminateFlow)
38
+ * @see [UNTraceConfiguration.useDigitizedDirection](https://developers.arcgis.com/javascript/latest/references/core/networks/support/UNTraceConfiguration/#useDigitizedDirection)
39
+ */
40
+ accessor flowDirection: "withDigitized" | "againstDigitized" | "indeterminate" | null | undefined;
29
41
  /** The globalId of the feature the network element belongs to. */
30
42
  accessor globalId: string;
31
43
  /** The network source Id of the feature the network element belongs to. Note that this is different from [Network.layerId](https://developers.arcgis.com/javascript/latest/references/core/networks/Network/#layerId) and you need to use [Network.getLayerIdBySourceId()](https://developers.arcgis.com/javascript/latest/references/core/networks/Network/#getLayerIdBySourceId) to get the `layerId`. */
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as o}from"tslib";import{JSONSupport as t}from"../../../core/JSONSupport.js";import{property as e,subclass as r}from"../../../core/accessorSupport/decorators.js";let p=class extends t{constructor(o){super(o),this.type="networkElement",this.assetGroupCode=null,this.assetTypeCode=null,this.globalId=null,this.networkSourceId=null,this.objectId=null,this.positionFrom=null,this.positionTo=null,this.terminalId=null}};o([e({json:{write:!1}})],p.prototype,"type",void 0),o([e({type:Number,json:{write:!0}})],p.prototype,"assetGroupCode",void 0),o([e({type:Number,json:{write:!0}})],p.prototype,"assetTypeCode",void 0),o([e({type:String,json:{write:!0}})],p.prototype,"globalId",void 0),o([e({type:Number,json:{write:!0}})],p.prototype,"networkSourceId",void 0),o([e({type:Number,json:{write:!0}})],p.prototype,"objectId",void 0),o([e({type:Number,json:{write:!0}})],p.prototype,"positionFrom",void 0),o([e({type:Number,json:{write:!0}})],p.prototype,"positionTo",void 0),o([e({type:Number,json:{write:!0}})],p.prototype,"terminalId",void 0),p=o([r("esri.rest.networks.support.NetworkElement")],p);export{p as default};
2
+ import{__decorate as o}from"tslib";import{JSONSupport as t}from"../../../core/JSONSupport.js";import{property as e,subclass as r}from"../../../core/accessorSupport/decorators.js";let i=class extends t{constructor(o){super(o),this.type="networkElement",this.assetGroupCode=null,this.assetTypeCode=null,this.globalId=null,this.networkSourceId=null,this.objectId=null,this.positionFrom=null,this.positionTo=null,this.terminalId=null,this.flowDirection=null}};o([e({json:{write:!1}})],i.prototype,"type",void 0),o([e({type:Number,json:{write:!0}})],i.prototype,"assetGroupCode",void 0),o([e({type:Number,json:{write:!0}})],i.prototype,"assetTypeCode",void 0),o([e({type:String,json:{write:!0}})],i.prototype,"globalId",void 0),o([e({type:Number,json:{write:!0}})],i.prototype,"networkSourceId",void 0),o([e({type:Number,json:{write:!0}})],i.prototype,"objectId",void 0),o([e({type:Number,json:{write:!0}})],i.prototype,"positionFrom",void 0),o([e({type:Number,json:{write:!0}})],i.prototype,"positionTo",void 0),o([e({type:Number,json:{write:!0}})],i.prototype,"terminalId",void 0),o([e({type:String,json:{write:!0}})],i.prototype,"flowDirection",void 0),i=o([r("esri.rest.networks.support.NetworkElement")],i);export{i as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{JSONSupport as e}from"../../../../core/JSONSupport.js";import{property as o,subclass as r}from"../../../../core/accessorSupport/decorators.js";import s from"../../../../geometry/SpatialReference.js";import{writer as i}from"../../../../core/accessorSupport/decorators/writer.js";let p=class extends e{constructor(t){super(t),this.sessionId=void 0,this.outSpatialReference=null}writeOutSR(t,e,o){if(null!=t){const{wkid:r,latestWkid:s,wkt:i,wkt2:p}=t;e[o]=JSON.stringify({wkid:r??void 0,latestWkid:s??void 0,wkt:i??void 0,wkt2:p??void 0})}}};t([o({type:String,json:{write:!0}})],p.prototype,"sessionId",void 0),t([o({type:s,json:{write:{target:"outSR"}}})],p.prototype,"outSpatialReference",void 0),t([i("outSpatialReference")],p.prototype,"writeOutSR",null),p=t([r("esri.rest.versionManagement.gdbVersion.support.ConflictsParameters")],p);const a=p;export{a as default};
2
+ import{__decorate as t}from"tslib";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as e,subclass as r}from"../../../../core/accessorSupport/decorators.js";import s from"../../../../geometry/SpatialReference.js";import{writer as i}from"../../../../core/accessorSupport/decorators/writer.js";let p=class extends o{constructor(t){super(t)}writeOutSR(t,o,e){if(null!=t){const{wkid:r,latestWkid:s,wkt:i,wkt2:p}=t;o[e]=JSON.stringify({wkid:r??void 0,latestWkid:s??void 0,wkt:i??void 0,wkt2:p??void 0})}}};t([e({type:String,json:{write:!0}})],p.prototype,"sessionId",void 0),t([e({type:s,json:{write:{target:"outSR"}}})],p.prototype,"outSpatialReference",void 0),t([i("outSpatialReference")],p.prototype,"writeOutSR",null),p=t([r("esri.rest.versionManagement.gdbVersion.support.ConflictsParameters")],p);const a=p;export{a as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{JSONMap as t}from"../../../../core/jsonMap.js";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as r,subclass as s}from"../../../../core/accessorSupport/decorators.js";import i from"../../../../geometry/SpatialReference.js";import{writer as p}from"../../../../core/accessorSupport/decorators/writer.js";const n=new t({objectIds:"object-ids",features:"features"});let a=class extends o{constructor(e){super(e),this.sessionId=null,this.resultType="object-ids",this.layers=null,this.outSpatialReference=null,this.fromMoment=null,this.moment=null}writeOutSR(e,t,o){if(null!=e){const{wkid:r,latestWkid:s,wkt:i,wkt2:p}=e;t[o]=JSON.stringify({wkid:r??void 0,latestWkid:s??void 0,wkt:i??void 0,wkt2:p??void 0})}}};e([r({type:String,json:{write:!0}})],a.prototype,"sessionId",void 0),e([r({type:n.apiValues,json:{type:n.jsonValues,read:n.read,write:n.write}})],a.prototype,"resultType",void 0),e([r({type:[Number],json:{write:!0}})],a.prototype,"layers",void 0),e([r({type:i,json:{write:{target:"outSR"}}})],a.prototype,"outSpatialReference",void 0),e([p("outSpatialReference")],a.prototype,"writeOutSR",null),e([r({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.moment=e?e.getTime():null}}}})],a.prototype,"fromMoment",void 0),e([r({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.moment=e?e.getTime():null}}}})],a.prototype,"moment",void 0),a=e([s("esri.rest.versionManagement.gdbVersion.support.DifferencesParameters")],a);const l=a;export{l as default};
2
+ import{__decorate as e}from"tslib";import{JSONMap as t}from"../../../../core/jsonMap.js";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as r,subclass as s}from"../../../../core/accessorSupport/decorators.js";import i from"../../../../geometry/SpatialReference.js";import{writer as p}from"../../../../core/accessorSupport/decorators/writer.js";const n=new t({objectIds:"object-ids",features:"features"});let a=class extends o{constructor(e){super(e)}writeOutSR(e,t,o){if(null!=e){const{wkid:r,latestWkid:s,wkt:i,wkt2:p}=e;t[o]=JSON.stringify({wkid:r??void 0,latestWkid:s??void 0,wkt:i??void 0,wkt2:p??void 0})}}};e([r({type:String,json:{write:!0}})],a.prototype,"sessionId",void 0),e([r({type:n.apiValues,json:{type:n.jsonValues,read:n.read,write:n.write}})],a.prototype,"resultType",void 0),e([r({type:[Number],json:{write:!0}})],a.prototype,"layers",void 0),e([r({type:i,json:{write:{target:"outSR"}}})],a.prototype,"outSpatialReference",void 0),e([p("outSpatialReference")],a.prototype,"writeOutSR",null),e([r({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.moment=e?e.getTime():null}}}})],a.prototype,"fromMoment",void 0),e([r({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.moment=e?e.getTime():null}}}})],a.prototype,"moment",void 0),a=e([s("esri.rest.versionManagement.gdbVersion.support.DifferencesParameters")],a);const m=a;export{m as default};
@@ -0,0 +1,25 @@
1
+ import type Graphic from "../../../../Graphic.js";
2
+
3
+ /** Represents the object IDs that were inserted, updated, or deleted to/from a layer. */
4
+ export interface DifferencesType {
5
+ /** The ID of the layer with differences. */
6
+ layerId: number;
7
+ /** The IDs of objects inserted into this layer. */
8
+ inserts: number[];
9
+ /** The IDs of objects updated in this layer. */
10
+ updates: number[];
11
+ /** The IDs of objects deleted from this layer. */
12
+ deletes: number[];
13
+ }
14
+
15
+ /** Represents the Graphic objects (features) that were inserted, updated, or deleted to/from a layer. */
16
+ export interface FeaturesType {
17
+ /** The ID of the layer with differences. */
18
+ layerId: number;
19
+ /** The Graphic objects (features) inserted into this layer. */
20
+ inserts: Graphic[];
21
+ /** The Graphic objects (features) updated in this layer. */
22
+ updates: Graphic[];
23
+ /** The Graphic objects (features) deleted from this layer. */
24
+ deletes: Graphic[];
25
+ }
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as s,subclass as e}from"../../../../core/accessorSupport/decorators.js";let r=class extends o{constructor(t){super(t),this.sessionId=void 0,this.setInspected=void 0,this.conflicts=void 0}};t([s({type:String,json:{write:!0}})],r.prototype,"sessionId",void 0),t([s({type:Boolean,json:{write:!0}})],r.prototype,"setInspected",void 0),t([s({type:[Object],json:{write:!0}})],r.prototype,"conflicts",void 0),r=t([e("esri.rest.versionManagement.gdbVersion.support.InspectConflictsParameters")],r);const i=r;export{i as default};
2
+ import{__decorate as o}from"tslib";import{JSONSupport as t}from"../../../../core/JSONSupport.js";import{property as e,subclass as r}from"../../../../core/accessorSupport/decorators.js";let s=class extends t{constructor(o){super(o)}};o([e({type:String,json:{write:!0}})],s.prototype,"sessionId",void 0),o([e({type:Boolean,json:{write:!0}})],s.prototype,"setInspected",void 0),o([e({type:Boolean,json:{write:!0}})],s.prototype,"inspectAll",void 0),o([e({type:[Object],json:{write:!0}})],s.prototype,"conflicts",void 0),s=o([r("esri.rest.versionManagement.gdbVersion.support.InspectConflictsParameters")],s);const p=s;export{p as default};
@@ -12,21 +12,19 @@ export default class ReconcileParameters extends JSONSupport {
12
12
  /**
13
13
  * Specifies whether the reconcile should be aborted if conflicts are found. The default is false
14
14
  *
15
- * @default false
16
15
  * @since 5.0
17
16
  */
18
- accessor abortIfConflicts: boolean;
17
+ accessor abortIfConflicts: boolean | null | undefined;
19
18
  /**
20
19
  * Specifies the conditions required for conflicts to occur are defined by object (row) or attribute (column).
21
20
  *
22
21
  * @since 5.0
23
22
  */
24
- accessor conflictDetection: DetectionType | null;
23
+ accessor conflictDetection: DetectionType | null | undefined;
25
24
  /**
26
25
  * Specifies if post will occur after calling reconcile. Causes post to occur immediately after reconcile, false by default.
27
26
  *
28
- * @default false
29
27
  * @since 5.0
30
28
  */
31
- accessor withPost: boolean;
29
+ accessor withPost: boolean | null | undefined;
32
30
  }
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{JSONMap as o}from"../../../../core/jsonMap.js";import{JSONSupport as e}from"../../../../core/JSONSupport.js";import{property as r,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{ensureClass as i}from"../../../../core/accessorSupport/ensureType.js";var p;const n=new o({byObject:"by-object",byAttribute:"by-attribute"});let c=p=class extends e{static from(t){return i(p,t)}constructor(t){super(t),this.sessionId=void 0,this.abortIfConflicts=!1,this.conflictDetection=null,this.withPost=!1}};t([r({type:String,json:{write:!0}})],c.prototype,"sessionId",void 0),t([r({type:Boolean,json:{write:!0}})],c.prototype,"abortIfConflicts",void 0),t([r({type:n.apiValues,json:{type:n.jsonValues,read:n.read,write:n.write}})],c.prototype,"conflictDetection",void 0),t([r({type:Boolean,json:{write:!0}})],c.prototype,"withPost",void 0),c=p=t([s("esri.rest.versionManagement.gdbVersion.support.ReconcileParameters")],c);const a=c;export{a as default};
2
+ import{__decorate as o}from"tslib";import{JSONMap as t}from"../../../../core/jsonMap.js";import{JSONSupport as e}from"../../../../core/JSONSupport.js";import{property as r,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{ensureClass as p}from"../../../../core/accessorSupport/ensureType.js";var i;const n=new t({byObject:"by-object",byAttribute:"by-attribute"});let c=i=class extends e{static from(o){return p(i,o)}constructor(o){super(o)}};o([r({type:String,json:{write:!0}})],c.prototype,"sessionId",void 0),o([r({type:Boolean,json:{write:!0}})],c.prototype,"abortIfConflicts",void 0),o([r({type:n.apiValues,json:{type:n.jsonValues,read:n.read,write:n.write}})],c.prototype,"conflictDetection",void 0),o([r({type:Boolean,json:{write:!0}})],c.prototype,"withPost",void 0),c=i=o([s("esri.rest.versionManagement.gdbVersion.support.ReconcileParameters")],c);const a=c;export{a as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const c="20260504",f="0747d4f40ffecf7d48180df3b1cb0c2c3e9ab339";export{c as buildDate,f as commitHash};
2
+ const c="20260507",b="bad9c170d2c602b5073ed83cd9096bb4ecf13659";export{c as buildDate,b as commitHash};
@@ -370,6 +370,15 @@ export interface CIMMarker extends CIMSymbolLayer {
370
370
  markerPlacement?: CIMMarkerPlacement | null;
371
371
  }
372
372
 
373
+ /**
374
+ * > [!WARNING]
375
+ * >
376
+ * > This type is not currently supported.
377
+ */
378
+ export interface CIMCharacterMarker extends CIMMarker {
379
+ type: "CIMCharacterMarker";
380
+ }
381
+
373
382
  /**
374
383
  * Represents color substitution, an ordered list of color substitutes.
375
384
  *
@@ -1916,6 +1925,24 @@ export interface CIMMarkerPlacementPolygonCenter extends CIMMarkerFillPlacement
1916
1925
  clipAtBoundary?: boolean;
1917
1926
  }
1918
1927
 
1928
+ /**
1929
+ * > [!WARNING]
1930
+ * >
1931
+ * > This type is not currently supported.
1932
+ */
1933
+ export interface CIMMaterialSymbolLayer extends CIMSymbolLayer {
1934
+ type: "CIMMaterialSymbolLayer";
1935
+ }
1936
+
1937
+ /**
1938
+ * > [!WARNING]
1939
+ * >
1940
+ * > This type is not currently supported.
1941
+ */
1942
+ export interface CIMObjectMarker3D extends CIMMarker {
1943
+ type: "CIMObjectMarker3D";
1944
+ }
1945
+
1919
1946
  /**
1920
1947
  * Represents a picture fill which fills polygonal geometry with a picture. Supported file types are .bmp, .jpg, .png, and .gif.
1921
1948
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../../../request.js";import{bidiText as e}from"../../../../core/BidiText.js";import has from"../../../../core/has.js";import{throwIfNotAbortError as s}from"../../../../core/promiseUtils.js";import{loadTextModule as i}from"../../../../libs/text/loadTextModule.js";import{sdfRadiusComplex as h,sdfBufferGlyphSDFCreator as a,sdfSizeComplex as r,sdfBufferServer as n,sdfRadiusSimple as o,sdfSizeSimple as c}from"./definitions.js";import{GlyphSDFCreator as l}from"./GlyphSDFCreator.js";import g from"./Rect.js";import p from"./RectangleBinPack.js";import{charCodes as d}from"./Utils.js";import _ from"../../../webgl/Texture.js";import{TextureDescriptor as f}from"../../../webgl/TextureDescriptor.js";const u=256,y=.25,m=t=>Math.floor(t/256);function w(t){const e=new Set;for(const s of t)e.add(m(s));return e}function x(t,e,i){return t.has(e)||t.set(e,i().then(()=>{t.delete(e)}).catch(i=>{t.delete(e),s(i)})),t.get(e)}const C=t=>({mosaicItem:{rect:new g(0,0,0,0),sdf:!0,page:0},rect:{left:0,width:0,height:0,top:0},shaping:{xAdvance:0,yAdvance:0,xOffset:0,yOffset:0},code:t});class I{constructor(t,e,s,i=!1){this._snapCoords=i,this.width=0,this.height=0,this._dirties=[],this._pageData=[],this._currentPage=0,this._glyphCache={},this._glyphCacheById={},this._textures=[],this._rangePromises=new Map,this._facePromises=new Map,this._preloadCache={},this._glyphSDFCreator=new l({sdfSizePx:r,sdfBufferPx:a,radius:h,cutoff:y}),this._faces=new Map,this.width=t,this.height=e,this._glyphSource=s,this._binPack=new p(t,e),this._pageData.push(new Uint8Array(t*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const t of this._textures)t&&t.dispose();this._textures.length=0,this._pageData.length=0}_initDecorationGlyphs(){const t=[117,149,181,207,207,181,149,117],e=[],s=[];for(let r=0;r<t.length;r++){const i=t[r];for(let t=0;t<11;t++){const h=r>=3&&r<5&&t>=3&&t<8?255:0;e.push(i),s.push(h)}}const i={width:5,height:2,left:0,top:0,advance:0},h=new Uint8Array(e),a=new Uint8Array(s);this._recordGlyph(i,h,n),this._recordGlyph(i,a,n)}getTexture(t,e){if(!this._textures[e]){const s=new f(this.width,this.height);s.pixelFormat=6406,s.wrapMode=33071,this._textures[e]=new _(t,s,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._pageData[e]),this._dirties[e]=!1),this._textures[e]}async getGlyphItems(t,s,i,l){const g=s?r:c,p=s?h:o,_=s?a:n;let f,u=[],y=!1;if(s){const s=this._getGlyphCacheById(i),h=await this.getFace(i);if(!h)return null;const a=this._glyphSDFCreator.sdfSizePx,[r,n,o]=e(t,!1);y=n;const c=new Uint32Array(Array.from(r).map((t,e)=>o.levels[o.targetToSource[e]]));f={baseline:h.baseline()/a,midline:h.midline()/a},u=h.shape(r,c,a).map(t=>this._getMosaicItemComplex(s,t,h))}else{const[s,h,a]=e(t);y=h;const r=this._getGlyphCache(i),n=d(s);try{await this._fetchRanges(i,n,l)}catch{return null}for(const t of n){const e=this._getMosaicItem(r,i,t);e&&u.push(e)}}return{type:"glyphs",isRightToLeft:y,glyphs:u,faceInfo:f,sdfSize:g,sdfRadius:p,sdfPadding:_}}async getGlyphItemsVTL(t,e){const s=this._getGlyphCache(t);await this._fetchRanges(t,e,null);const i=[];for(const h of e){const e=this._getMosaicItem(s,t,h,!0);e&&(i[h]=e)}return i}async getFace(e){if(this._faces.has(e))return this._faces.get(e);const s=this._glyphSource.woffURL(e);return await x(this._facePromises,e,async()=>{const h=await t(s,{responseType:"array-buffer"}),a=(await i()).Face.parseWoff2(new Uint8Array(h.data));this._faces.set(e,a)}),this._faces.get(e)}_getMosaicItem(t,e,s,i=!1){if(!t[s]){const h=this._glyphSource.getRange(e,s),a=h?.getRect(s),r=h?.getShaping(s),o=h?.getBitmap(s);if(i&&(!a||!r))return;if(!a||!r)return C(s);const c=o?this._recordGlyph(a,o,n):new g(0,0,0,0),l=this._currentPage;t[s]={mosaicItem:{rect:c,sdf:!0,page:l},rect:a,shaping:r,code:s},this._invalidate()}return t[s]}_getMosaicItemComplex(t,e,s){if(!t[e.glyphId]){const i=this._glyphSDFCreator.draw(s,e.glyphId),h=i??{width:0,height:0,top:0,left:0},r=i?this._recordGlyph(h,i.buffer,a):new g(0,0,0,0),n=e.isNewline?10:e.isWhitespace?32:NaN,o={rect:r,sdf:!0,page:this._currentPage};t[e.glyphId]={mosaicItem:o,rect:h,shaping:void 0,code:n}}return{...t[e.glyphId],shaping:{xOffset:e.xOffset,yOffset:e.yOffset,xAdvance:e.xAdvance,yAdvance:e.yAdvance}}}bind(t,e,s,i){const h=this.getTexture(t,s);h.setSamplingMode(e),t.bindTexture(h,i)}preloadASCIIGlyphCache(t){const e=this._preloadCache[t];if(null!=e)return e;const s=this._glyphSource.preloadASCIIRange(t).then(()=>{const e=this._getGlyphCache(t);for(let s=0;s<256;s++)this._getMosaicItem(e,t,s)});return this._preloadCache[t]=s,s}_getGlyphCache(t){return this._glyphCache[t]||(this._glyphCache[t]={}),this._glyphCache[t]}_getGlyphCacheById(t){return this._glyphCacheById[t]||(this._glyphCacheById[t]={}),this._glyphCacheById[t]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(t,e,s){const i=w(e),h=[];i.forEach(e=>{h.push(this._fetchRange(t,e,s))}),await Promise.all(h)}async _fetchRange(t,e,s){if(e>u)return;const i=t+e;return x(this._rangePromises,i,()=>this._glyphSource.fetchRange(t,e,s))}_allocNewPage(){this._dirties[this._currentPage]||(this._pageData[this._currentPage]=null),this._currentPage=this._pageData.length,this._pageData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new p(this.width,this.height)}_recordGlyph(t,e,s){let i;if(0===t.width)i=new g(0,0,0,0);else{const h=t.width+2*s,a=t.height+2*s;let r=h,n=a;if(this._snapCoords){r+=h%4?4-h%4:4,n+=a%4?4-a%4:4}i=this._binPack.allocate(r,n),i.isEmpty&&(this._allocNewPage(),i=this._binPack.allocate(r,n));const o=this._pageData[this._currentPage];for(let t=0;t<a;t++){const s=h*t,a=this.width*(i.y+t)+i.x;for(let t=0;t<h;t++)o[a+t]=e[s+t]}has("esri-glyph-debug")&&this._showDebugPage(o)}return i}_showDebugPage(t){const e=document.createElement("canvas"),s=e.getContext("2d"),i=new ImageData(this.width,this.height),h=i.data;e.width=this.width,e.height=this.height,e.style.border="1px solid black";for(let a=0;a<t.length;++a)h[4*a]=t[a],h[4*a+1]=0,h[4*a+2]=0,h[4*a+3]=255;s.putImageData(i,0,0),document.body.appendChild(e)}}export{I as default};
2
+ import t from"../../../../request.js";import{bidiText as e}from"../../../../core/BidiText.js";import has from"../../../../core/has.js";import{throwIfNotAbortError as s}from"../../../../core/promiseUtils.js";import{loadTextModule as i}from"../../../../libs/text/loadTextModule.js";import{sdfRadiusComplex as h,sdfBufferGlyphSDFCreator as a,sdfSizeComplex as r,sdfBufferServer as n,sdfRadiusSimple as o,sdfSizeSimple as c}from"./definitions.js";import{GlyphSDFCreator as l}from"./GlyphSDFCreator.js";import g from"./Rect.js";import p from"./RectangleBinPack.js";import{charCodes as d}from"./Utils.js";import _ from"../../../webgl/Texture.js";import{TextureDescriptor as f}from"../../../webgl/TextureDescriptor.js";const u=256,y=.25,m=t=>Math.floor(t/256);function w(t){const e=new Set;for(const s of t)e.add(m(s));return e}function x(t,e,i){return t.has(e)||t.set(e,i().then(()=>{t.delete(e)}).catch(i=>{t.delete(e),s(i)})),t.get(e)}const C=t=>({mosaicItem:{rect:new g(0,0,0,0),sdf:!0,page:0},rect:{left:0,width:0,height:0,top:0},shaping:{xAdvance:0,yAdvance:0,xOffset:0,yOffset:0},code:t});class I{constructor(t,e,s,i=!1){this._snapCoords=i,this.width=0,this.height=0,this._dirties=[],this._pageData=[],this._currentPage=0,this._glyphCache={},this._glyphCacheById={},this._textures=[],this._rangePromises=new Map,this._facePromises=new Map,this._preloadCache={},this._glyphSDFCreator=new l({sdfSizePx:r,sdfBufferPx:a,radius:h,cutoff:y}),this._faces=new Map,this.width=t,this.height=e,this._glyphSource=s,this._binPack=new p(t,e),this._pageData.push(new Uint8Array(t*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const t of this._textures)t&&t.dispose();this._textures.length=0,this._pageData.length=0}_initDecorationGlyphs(){const t=[117,149,181,207,207,181,149,117],e=[],s=[];for(let r=0;r<t.length;r++){const i=t[r];for(let t=0;t<11;t++){const h=r>=3&&r<5&&t>=3&&t<8?255:0;e.push(i),s.push(h)}}const i={width:5,height:2,left:0,top:0,advance:0},h=new Uint8Array(e),a=new Uint8Array(s);this._recordGlyph(i,h,n),this._recordGlyph(i,a,n)}getTexture(t,e){if(!this._textures[e]){const s=new f(this.width,this.height);s.pixelFormat=6406,s.wrapMode=33071,this._textures[e]=new _(t,s,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._pageData[e]),this._dirties[e]=!1),this._textures[e]}async getGlyphItems(t,s,i,l){const g=s?r:c,p=s?h:o,_=s?a:n;let f,u=[],y=!1;if(s){const s=this._getGlyphCacheById(i),h=await this.getFace(i);if(!h)return null;const a=this._glyphSDFCreator.sdfSizePx,[r,n,o]=e(t,!1);y=n;const c=new Uint32Array(Array.from(r).map((t,e)=>o.levels[o.targetToSource[e]]));f={baseline:h.baseline()/a,midline:h.midline()/a},u=h.shape(r,c,a).map(t=>this._getMosaicItemComplex(s,t,h))}else{const[s,h,a]=e(t);y=h;const r=this._getGlyphCache(i),n=d(s);try{await this._fetchRanges(i,n,l)}catch{return null}for(const t of n){const e=this._getMosaicItem(r,i,t);e&&u.push(e)}}return{type:"glyphs",isRightToLeft:y,glyphs:u,faceInfo:f,sdfSize:g,sdfRadius:p,sdfPadding:_}}async getGlyphItemsVTL(t,e){const s=this._getGlyphCache(t);await this._fetchRanges(t,e,null);const i=[];for(const h of e){const e=this._getMosaicItem(s,t,h,!0);e&&(i[h]=e)}return i}async getFace(e){if(this._faces.has(e))return this._faces.get(e);const s=this._glyphSource.woffURL(e);return await x(this._facePromises,e,async()=>{const h=await t(s,{responseType:"array-buffer"}),a=(await i()).Face.parseWoff2(new Uint8Array(h.data));this._faces.set(e,a)}),this._faces.get(e)}_getMosaicItem(t,e,s,i=!1){if(!t[s]){const h=this._glyphSource.getRange(e,s),a=h?.getRect(s),r=h?.getShaping(s),o=h?.getBitmap(s);if(i&&(!a||!r))return;if(!a||!r)return C(s);const c=o?this._recordGlyph(a,o,n):new g(0,0,0,0),l=this._currentPage;t[s]={mosaicItem:{rect:c,sdf:!0,page:l},rect:a,shaping:r,code:s},this._invalidate()}return t[s]}_getMosaicItemComplex(t,e,s){if(!t[e.glyphId]){const i=this._glyphSDFCreator.draw(s,e.glyphId),h=i??{width:0,height:0,top:0,left:0},r=i?this._recordGlyph(h,i.buffer,a):new g(0,0,0,0),n=e.isNewline?10:e.isWhitespace?32:NaN,o={rect:r,sdf:!0,page:this._currentPage};t[e.glyphId]={mosaicItem:o,rect:h,shaping:void 0,code:n},this._invalidate()}return{...t[e.glyphId],shaping:{xOffset:e.xOffset,yOffset:e.yOffset,xAdvance:e.xAdvance,yAdvance:e.yAdvance}}}bind(t,e,s,i){const h=this.getTexture(t,s);h.setSamplingMode(e),t.bindTexture(h,i)}preloadASCIIGlyphCache(t){const e=this._preloadCache[t];if(null!=e)return e;const s=this._glyphSource.preloadASCIIRange(t).then(()=>{const e=this._getGlyphCache(t);for(let s=0;s<256;s++)this._getMosaicItem(e,t,s)});return this._preloadCache[t]=s,s}_getGlyphCache(t){return this._glyphCache[t]||(this._glyphCache[t]={}),this._glyphCache[t]}_getGlyphCacheById(t){return this._glyphCacheById[t]||(this._glyphCacheById[t]={}),this._glyphCacheById[t]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(t,e,s){const i=w(e),h=[];i.forEach(e=>{h.push(this._fetchRange(t,e,s))}),await Promise.all(h)}async _fetchRange(t,e,s){if(e>u)return;const i=t+e;return x(this._rangePromises,i,()=>this._glyphSource.fetchRange(t,e,s))}_allocNewPage(){this._dirties[this._currentPage]||(this._pageData[this._currentPage]=null),this._currentPage=this._pageData.length,this._pageData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new p(this.width,this.height)}_recordGlyph(t,e,s){let i;if(0===t.width)i=new g(0,0,0,0);else{const h=t.width+2*s,a=t.height+2*s;let r=h,n=a;if(this._snapCoords){r+=h%4?4-h%4:4,n+=a%4?4-a%4:4}i=this._binPack.allocate(r,n),i.isEmpty&&(this._allocNewPage(),i=this._binPack.allocate(r,n));const o=this._pageData[this._currentPage];for(let t=0;t<a;t++){const s=h*t,a=this.width*(i.y+t)+i.x;for(let t=0;t<h;t++)o[a+t]=e[s+t]}has("esri-glyph-debug")&&this._showDebugPage(o)}return i}_showDebugPage(t){const e=document.createElement("canvas"),s=e.getContext("2d"),i=new ImageData(this.width,this.height),h=i.data;e.width=this.width,e.height=this.height,e.style.border="1px solid black";for(let a=0;a<t.length;++a)h[4*a]=t[a],h[4*a+1]=0,h[4*a+2]=0,h[4*a+3]=255;s.putImageData(i,0,0),document.body.appendChild(e)}}export{I as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const t=1e20;class e{constructor(t){this.sdfSizePx=t.sdfSizePx,this.sdfBufferPx=t.sdfBufferPx,this.radius=t.radius,this.cutoff=t.cutoff;const e=3*t.sdfSizePx;this.canvasSize=e;const s=this._createCanvas(e);this.context=s.getContext("2d",{willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.gridOuter=new Float64Array(e*e),this.gridInner=new Float64Array(e*e),this.gridValues=new Float64Array(e),this.parabolaBoundaries=new Float64Array(e+1),this.parabolaIndices=new Uint16Array(e)}draw(e,s){const{context:a,gridInner:i,gridOuter:r,sdfSizePx:n,sdfBufferPx:o,canvasSize:h,cutoff:l,radius:c}=this,d=n/e.units_per_em();this.context.fillStyle="black",this.context.strokeStyle="black",this.context.resetTransform(),this.context.clearRect(0,0,h,h),this.context.translate(this.sdfSizePx,this.sdfSizePx),this.context.scale(d,d);const f=e.paintCurves(s,a);if(!f)return null;const u=f.xMin*d,x=f.xMax*d,g=f.yMin*d,M=f.yMax*d;f.free();const w=Math.ceil(x-u),y=Math.ceil(M-g),S=Math.floor(n+u-o),_=Math.floor(n+g-o),m=w+2*o,p=y+2*o,P=new Uint8ClampedArray(Math.max(m*p,0)),b=a.getImageData(S,_,m,p);r.fill(t,0,P.length),i.fill(0,0,P.length);for(let v=0;v<p;v++)for(let e=0;e<m;e++){const s=p-1-v,a=b.data[4*(s*m+e)+3]/255;if(0===a)continue;const n=v*m+e;if(1===a)r[n]=0,i[n]=t;else{const t=.5-a;r[n]=t>0?t*t:0,i[n]=t<0?t*t:0}}this._edt(r,0,0,m,p,m),this._edt(i,0,0,m,p,m);for(let t=0;t<P.length;t++){const e=Math.sqrt(r[t])-Math.sqrt(i[t]);P[t]=Math.round(255-255*(e/c+l))}const z=d*e.face_height();return{buffer:P,width:w,height:y,top:Math.round(M-z+2*o),left:Math.round(u-o)}}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}_edt(t,e,s,a,i,r){for(let n=e;n<e+a;n++)this._edt1d(t,s*r+n,r,i);for(let n=s;n<s+i;n++)this._edt1d(t,n*r+e,1,a)}_edt1d(e,s,a,i){const r=this.parabolaIndices,n=this.parabolaBoundaries,o=this.gridValues;r[0]=0,n[0]=-t,n[1]=t,o[0]=e[s];let h=0;for(let l=1;l<i;l++){o[l]=e[s+l*a];const i=l*l;let c;do{const t=r[h];c=(o[l]-o[t]+i-t*t)/(l-t)/2}while(c<=n[h]&&--h>-1);h++,r[h]=l,n[h]=c,n[h+1]=t}for(let t=0,l=0;t<i;t++){for(;n[l+1]<t;)l++;const i=r[l],h=t-i;e[s+t*a]=o[i]+h*h}}}export{e as GlyphSDFCreator};
2
+ const t=1e20;class e{constructor(t){this.pxDensity=4,this.sdfSizePx=t.sdfSizePx,this.sdfBufferPx=t.sdfBufferPx,this.rasterSizePx=this.pxDensity*this.sdfSizePx,this.rasterBufferPx=this.pxDensity*this.sdfBufferPx,this.radius=t.radius,this.cutoff=t.cutoff;const e=this.pxDensity*t.sdfSizePx*3;this.canvasSize=e;const s=this._createCanvas(e);this.context=s.getContext("2d",{willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.gridOuter=new Float64Array(e*e),this.gridInner=new Float64Array(e*e),this.gridValues=new Float64Array(e),this.parabolaBoundaries=new Float64Array(e+1),this.parabolaIndices=new Uint16Array(e)}draw(e,s){const{context:i,gridInner:n,gridOuter:r,rasterSizePx:a,rasterBufferPx:h,canvasSize:o,radius:l,cutoff:c}=this,f=a/e.units_per_em();this.context.fillStyle="black",this.context.strokeStyle="black",this.context.resetTransform(),this.context.clearRect(0,0,o,o),this.context.translate(a,a),this.context.scale(f,f);const x=e.paintCurves(s,i);if(!x)return null;const d=x.xMin*f,u=x.xMax*f,y=x.yMin*f,p=x.yMax*f;x.free();const M=Math.ceil(u-d),D=Math.ceil(p-y),g=Math.floor(a+d-h),w=Math.floor(a+y-h),P=M+2*h,S=D+2*h,_=new Float32Array(Math.max(P*S,0)),m=i.getImageData(g,w,P,S);r.fill(t,0,_.length),n.fill(0,0,_.length);for(let I=0;I<S;I++)for(let e=0;e<P;e++){const s=S-1-I,i=m.data[4*(s*P+e)+3]/255;if(0===i)continue;const a=I*P+e;if(1===i)r[a]=0,n[a]=t;else{const t=.5-i;r[a]=t>0?t*t:0,n[a]=t<0?t*t:0}}this._edt(r,0,0,P,S,P),this._edt(n,0,0,P,S,P);for(let t=0;t<_.length;t++)_[t]=Math.sqrt(r[t])-Math.sqrt(n[t]);const b=Math.ceil(P/this.pxDensity),z=Math.ceil(S/this.pxDensity),A=this.pxDensity*this.pxDensity,B=new Uint8ClampedArray(Math.max(b*z,0));for(let t=0;t<z;t++)for(let e=0;e<b;e++){let s=0;for(let n=0;n<this.pxDensity;n++)for(let i=0;i<this.pxDensity;i++){if(e+i>P||t+n>S)continue;s+=_[(this.pxDensity*t+n)*P+(this.pxDensity*e+i)]}const i=s/this.pxDensity/A/l+c;B[t*b+e]=Math.round(255-255*i)}const v=f*e.face_height(),F=Math.round(p-v+2*h),C=Math.round(d-h);return{buffer:B,width:Math.ceil(M/this.pxDensity),height:Math.ceil(D/this.pxDensity),top:Math.round(F/this.pxDensity),left:Math.round(C/this.pxDensity)}}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}_edt(t,e,s,i,n,r){for(let a=e;a<e+i;a++)this._edt1d(t,s*r+a,r,n);for(let a=s;a<s+n;a++)this._edt1d(t,a*r+e,1,i)}_edt1d(e,s,i,n){const r=this.parabolaIndices,a=this.parabolaBoundaries,h=this.gridValues;r[0]=0,a[0]=-t,a[1]=t,h[0]=e[s];let o=0;for(let l=1;l<n;l++){h[l]=e[s+l*i];const n=l*l;let c;do{const t=r[o];c=(h[l]-h[t]+n-t*t)/(l-t)/2}while(c<=a[o]&&--o>-1);o++,r[o]=l,a[o]=c,a[o+1]=t}for(let t=0,l=0;t<n;t++){for(;a[l+1]<t;)l++;const n=r[l],o=t-n;e[s+t*i]=h[n]+o*o}}}export{e as GlyphSDFCreator};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const t=8,e=t-2,c=1e-30,h=64,i=4294967295,o=512,a=256,d=256/360,n=128,p=16777216,r=!1,s=128,f=8,g=10,l=29,m=1,v=16,w=16,x=o/s,b=8,j=50,k=10,q=24,u=3,y=8,z=24,A=8,B=64,C=14,D=4,E={metrics:{width:15,height:17,left:0,top:-7,advance:14}},F=1024,G=0,H=0,I=0,J=1,K=2,L=3,M=4,N=5,O=6,P=12,Q=13,R=5,S=6,T=5,U=6,V=6,W=1<<V,X=W<<1,Y=!1,Z=1.05,$=3,_=1,tt=3,et=3,ct=5,ht=6,it=1.15,ot=2,at=4,dt=128,nt=256,pt=nt-2*at,rt=2,st=128,ft=1,gt=8,lt=500,mt=4,vt=128,wt=10,xt=1024,bt=2,jt=0,kt=1,qt=4,ut=8,yt=16,zt=4,At=1,Bt=4,Ct=8,Dt=32,Et=64,Ft=128,Gt=4,Ht=1,It=1<<20,Jt=.75,Kt=10,Lt=.75,Mt=12,Nt=256,Ot=32,Pt=512,Qt=0,Rt=1;export{Ht as MAX_TILE_RESHUFFLES_PER_FRAME,Kt as RESHUFFLING_EXEMPT_DRAW_CALLS,It as RESHUFFLING_EXEMPT_MEMORY_BYTES,Lt as RESHUFFLING_TARGET_DRAW_EFFICIENCY,Jt as RESHUFFLING_TARGET_MEMORY_EFFICIENCY,d as angleFactor256,K as animationUnit,Nt as attributeStoreInitialSize,F as attributeStoreTextureSize,E as averageGlyphMosaicItem,Rt as backbufferStencilClipped,Qt as backbufferStencilVisible,Dt as bitsetFillHasPatternHeightPrecisionFactor,Et as bitsetFillHasPatternWidthPrecisionFactor,Ct as bitsetFillHasUnresolvedReplacementColor,Bt as bitsetFillRandomPatternOffset,yt as bitsetGenericConsiderAlphaOnly,bt as bitsetGenericLockColor,zt as bitsetLineScaleDash,kt as bitsetMarkerAlignmentMap,jt as bitsetMarkerAlignmentScreen,qt as bitsetMarkerOutlineAllowColorOverride,ut as bitsetMarkerScaleSymbolsProportionally,At as bitsetTypeFillOutline,vt as bufferDataMinimumSize,mt as bufferDataPoolSize,g as chartMaxFields,w as collisionBoxPadding,s as collisionBucketSize,v as collisionEarlyRejectBucketSize,m as collisionMaxZoomDelta,b as collisionPlacementPadding,x as collisionTileBoxSize,n as compressionFactorForU16,M as dataDrivenUnit0,N as dataDrivenUnit1,O as dataDrivenUnit2,r as debugLabels,dt as defaultSdfTextureSize,gt as displayRecordIntPerElement,f as dotDensityMaxFields,X as effectFlag0,Y as enableEarlyLabelDiscard,h as extrudeScale,W as filterFlag0,J as filterFlagsUnit,q as glyphSize,P as gpgpuUnit,ft as gradientTextureExternalPadding,k as heuristicGlyphsPerFeature,j as heuristicGlyphsPerLine,et as hittestSmallSymbolThreshold,_ as hittestToleranceDesktop,$ as hittestToleranceMobile,tt as hittestToleranceSmallSymbol,D as labelPlacementOffsetPadding,Q as localTimeOriginUnit,l as magicLabelLineHeight,Mt as maxGeohashLevel,ot as maxGpuUploadsPerFrame,V as maxHighlightReasons,p as maxRepresentableInt,Pt as maxTextLineWidth,wt as minMaxZoomPrecisionFactor,Ot as minTextLineWidth,c as nanMagicNumber,lt as patchPixelBufferAllocSize,rt as patternFillRasterizationScale,i as pictureFillColor,xt as randomInsidePolygonTextureSize,a as rasterTileSize,st as rasterizedVectorMarkerMinSize,y as sdfBufferGlyphSDFCreator,u as sdfBufferServer,C as sdfRadiusComplex,A as sdfRadiusSimple,B as sdfSizeComplex,z as sdfSizeSimple,at as spritePadding,pt as svgSdfTextureInnerSize,nt as svgSdfTextureSize,I as textureBindingBitmap,H as textureBindingGlyphAtlas,R as textureBindingHighlight0,S as textureBindingHighlight1,T as textureBindingRenderer0,U as textureBindingRenderer1,G as textureBindingSpriteAtlas,Gt as textureUploadManagerBudget,Ft as textureUploadManagerChunkSize,Z as thinLineHalfWidthThreshold,o as tileSize,L as visualVariableUnit,it as vtlHighResCutoff,ht as vtlTextureBindingUnitGlyphs,ct as vtlTextureBindingUnitSprites,e as webglMaxInnerStops,t as webglMaxStops};
2
+ const t=8,e=t-2,c=1e-30,h=64,i=4294967295,o=512,a=256,d=256/360,n=128,p=16777216,r=!1,s=128,f=8,g=10,l=29,m=1,v=16,w=16,x=o/s,b=8,j=50,k=10,q=24,u=3,y=24,z=8,A=3,B=24,C=8,D=4,E={metrics:{width:15,height:17,left:0,top:-7,advance:14}},F=1024,G=0,H=0,I=0,J=1,K=2,L=3,M=4,N=5,O=6,P=12,Q=13,R=5,S=6,T=5,U=6,V=6,W=1<<V,X=W<<1,Y=!1,Z=1.05,$=3,_=1,tt=3,et=3,ct=5,ht=6,it=1.15,ot=2,at=4,dt=128,nt=256,pt=nt-2*at,rt=2,st=128,ft=1,gt=8,lt=500,mt=4,vt=128,wt=10,xt=1024,bt=2,jt=0,kt=1,qt=4,ut=8,yt=16,zt=4,At=1,Bt=4,Ct=8,Dt=32,Et=64,Ft=128,Gt=4,Ht=1,It=1<<20,Jt=.75,Kt=10,Lt=.75,Mt=12,Nt=256,Ot=32,Pt=512,Qt=0,Rt=1;export{Ht as MAX_TILE_RESHUFFLES_PER_FRAME,Kt as RESHUFFLING_EXEMPT_DRAW_CALLS,It as RESHUFFLING_EXEMPT_MEMORY_BYTES,Lt as RESHUFFLING_TARGET_DRAW_EFFICIENCY,Jt as RESHUFFLING_TARGET_MEMORY_EFFICIENCY,d as angleFactor256,K as animationUnit,Nt as attributeStoreInitialSize,F as attributeStoreTextureSize,E as averageGlyphMosaicItem,Rt as backbufferStencilClipped,Qt as backbufferStencilVisible,Dt as bitsetFillHasPatternHeightPrecisionFactor,Et as bitsetFillHasPatternWidthPrecisionFactor,Ct as bitsetFillHasUnresolvedReplacementColor,Bt as bitsetFillRandomPatternOffset,yt as bitsetGenericConsiderAlphaOnly,bt as bitsetGenericLockColor,zt as bitsetLineScaleDash,kt as bitsetMarkerAlignmentMap,jt as bitsetMarkerAlignmentScreen,qt as bitsetMarkerOutlineAllowColorOverride,ut as bitsetMarkerScaleSymbolsProportionally,At as bitsetTypeFillOutline,vt as bufferDataMinimumSize,mt as bufferDataPoolSize,g as chartMaxFields,w as collisionBoxPadding,s as collisionBucketSize,v as collisionEarlyRejectBucketSize,m as collisionMaxZoomDelta,b as collisionPlacementPadding,x as collisionTileBoxSize,n as compressionFactorForU16,M as dataDrivenUnit0,N as dataDrivenUnit1,O as dataDrivenUnit2,r as debugLabels,dt as defaultSdfTextureSize,gt as displayRecordIntPerElement,f as dotDensityMaxFields,X as effectFlag0,Y as enableEarlyLabelDiscard,h as extrudeScale,W as filterFlag0,J as filterFlagsUnit,q as glyphSize,P as gpgpuUnit,ft as gradientTextureExternalPadding,k as heuristicGlyphsPerFeature,j as heuristicGlyphsPerLine,et as hittestSmallSymbolThreshold,_ as hittestToleranceDesktop,$ as hittestToleranceMobile,tt as hittestToleranceSmallSymbol,D as labelPlacementOffsetPadding,Q as localTimeOriginUnit,l as magicLabelLineHeight,Mt as maxGeohashLevel,ot as maxGpuUploadsPerFrame,V as maxHighlightReasons,p as maxRepresentableInt,Pt as maxTextLineWidth,wt as minMaxZoomPrecisionFactor,Ot as minTextLineWidth,c as nanMagicNumber,lt as patchPixelBufferAllocSize,rt as patternFillRasterizationScale,i as pictureFillColor,xt as randomInsidePolygonTextureSize,a as rasterTileSize,st as rasterizedVectorMarkerMinSize,A as sdfBufferGlyphSDFCreator,u as sdfBufferServer,C as sdfRadiusComplex,z as sdfRadiusSimple,B as sdfSizeComplex,y as sdfSizeSimple,at as spritePadding,pt as svgSdfTextureInnerSize,nt as svgSdfTextureSize,I as textureBindingBitmap,H as textureBindingGlyphAtlas,R as textureBindingHighlight0,S as textureBindingHighlight1,T as textureBindingRenderer0,U as textureBindingRenderer1,G as textureBindingSpriteAtlas,Gt as textureUploadManagerBudget,Ft as textureUploadManagerChunkSize,Z as thinLineHalfWidthThreshold,o as tileSize,L as visualVariableUnit,it as vtlHighResCutoff,ht as vtlTextureBindingUnitGlyphs,ct as vtlTextureBindingUnitSprites,e as webglMaxInnerStops,t as webglMaxStops};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const e=5;function n(e){for(const n of e.rootOutputNodes())e.shouldPruneOutputNode(n)||(n.variableName=r(e,n.node))}function t(e,n){let t="";return"boolean"!=typeof n&&"number"!=typeof n&&n.debugInfo.name&&(t=`${n.debugInfo.name}_`),`${t}v${e.varCount++}`}function r(e,n,t=!1){if("number"==typeof n)return n.toString();if("boolean"==typeof n)return n.toString();let r=e.getEmit(n);if(r)return r;switch(n.shaderType){case"scope-node":r=i(e,n);break;case"primitive-node":r=s(e,n,t);break;case"function-node":r=p(e,n);break;case"property-access-node":r=u(e,n);break;case"property-access-2d-node":r=a(e,n);break;case"text-node":r=n.text;break;case"block-node":r=d(e,n);break;case"condition-node":r=c(e,n)}return e.setEmit(n,r),r}function o(e,n,t){const r=n.split("\n");for(const o of r)if(o.trim().length){{let n="";null!=t&&(n+=`/*id:${t??"000"}*/ `),e.body+=n.padEnd(14)}e.body+=" ".repeat(e.indent)+o+"\n"}}function i(e,n){const t=new n.child.constructor;t.setDebugName(n.debugInfo.name);const i=r(e,t,!0);o(e,`{ /*ScopeStart: ${n.uid} ${n.debugInfo.name}*/`),e.indent+=2;return o(e,`${i} = ${r(e,n.child)};`),e.indent-=2,o(e,`} /*ScopeEnd: ${n.uid} ${n.debugInfo.name}*/`),i}function c(e,n){const t=r(e,new n.ifTrue.constructor,!0);o(e,`if (${r(e,n.condition)}) {`),e.indent+=2;const i=e.createSubgraphContext(),c=r(i,n.ifTrue);if(e.body+=i.body,c&&o(e,`${t} = ${c};`),e.indent-=2,o(e,"}"),n.ifFalse){o(e,"else {"),e.indent+=2;const i=e.createSubgraphContext(),c=r(i,n.ifFalse);e.body+=i.body,c&&o(e,`${t} = ${c};`),e.indent-=2,o(e,"}")}return t}function d(e,n){const{captureList:t,generator:i,returnType:c}=n,d={};for(const o in t){if(!t[o])continue;const n=r(e,t[o]);d[o]=n}const u=r(e,new c,!0);if(d.out=u,n.subgraph){const t=e.createSubgraphContext(),o=r(t,n.subgraph.child),i=t.body;d.subgraph={varName:o,body:i}}const a=i(d);return o(e,"{\n"),e.indent+=2,o(e,a),e.indent-=2,o(e,"}\n"),u}function u(e,n){const t=r(e,n.target);if("string"==typeof n.property&&n.property.includes("["))return`${t}${n.property}`;if("string"!=typeof n.property){return`${t}[${r(e,n.property)}]`}return`${t}.${n.property}`}function a(e,n){return`${r(e,n.target)}[${r(e,n.x)}][${r(e,n.y)}]`}function p(n,i){const c=i.returnType.type;if(i.isInfix){const[d,u]=i.children.map(e=>r(n,e)),a=t(n,i);return o(n,`${c.padEnd(e)} ${a} = ${d} ${i.token} ${u};`,i.uid),a}const d=i.children.map(e=>r(n,e)).join(", "),u=t(n,i);return o(n,`${c.padEnd(e)} ${u} = ${i.token}(${d});`,i.uid),u}function s(n,i,c=!1){const d=n.getInput(i);if(d)return d.isUsed=!0,d.variableName;const u=1===i.children.length&&i.children[0]?.type===i.type;if(!i.isMutable&&(i.isImplicit||u))return r(n,i.children[0]);const a=t(n,i);if(c)return o(n,`${i.type.padEnd(e)} ${a};`,i.uid),a;const p=!i.debugInfo.name&&!i.isMutable;if(p){if("float"===i.type&&"number"==typeof i.children[0])return Number.isInteger(i.children[0])?i.children[0].toFixed(1):i.children[0].toString();if("int"===i.type&&"number"==typeof i.children[0]&&Number.isInteger(i.children[0]))return i.children[0].toString();if("bool"===i.type&&"boolean"==typeof i.children[0])return i.children[0].toString()}const s=i.children.map(e=>r(n,e)).join(", ");return"array"===i.type?(o(n,`${i.type.padEnd(e)} ${a} = [${s}];`,i.uid),a):p?`${i.type}(${s})`:(o(n,`${i.type.padEnd(e)} ${a} = ${i.type}(${s});`,i.uid),a)}export{n as generateGLSL};
2
+ const e=5;function n(e){for(const n of e.rootOutputNodes())e.shouldPruneOutputNode(n)||(n.variableName=r(e,n.node))}function t(e,n){let t="";return"boolean"!=typeof n&&"number"!=typeof n&&n.debugInfo.name&&(t=`${n.debugInfo.name}_`),`${t}v${e.varCount++}`}function r(e,n,t=!1){if("number"==typeof n)return n.toString();if("boolean"==typeof n)return n.toString();let r=e.getEmit(n);if(r)return r;switch(n.shaderType){case"scope-node":r=i(e,n);break;case"primitive-node":r=f(e,n,t);break;case"function-node":r=p(e,n);break;case"property-access-node":r=d(e,n);break;case"property-access-2d-node":r=a(e,n);break;case"text-node":r=n.text;break;case"block-node":r=u(e,n);break;case"condition-node":r=c(e,n)}return e.setEmit(n,r),r}function o(e,n,t){const r=n.split("\n");for(const o of r)if(o.trim().length){{let n="";null!=t&&(n+=`/*id:${t??"000"}*/ `),e.body+=n.padEnd(14)}e.body+=" ".repeat(e.indent)+o+"\n"}}function i(e,n){const t=new n.child.constructor;t.setDebugName(n.debugInfo.name);const i=r(e,t,!0);o(e,`{ /*ScopeStart: ${n.uid} ${n.debugInfo.name}*/`),e.indent+=2;return o(e,`${i} = ${r(e,n.child)};`),e.indent-=2,o(e,`} /*ScopeEnd: ${n.uid} ${n.debugInfo.name}*/`),i}function c(e,n){const t=r(e,new n.ifTrue.constructor,!0);o(e,`if (${r(e,n.condition)}) {`),e.indent+=2;const i=e.createSubgraphContext(),c=r(i,n.ifTrue);if(e.body+=i.body,c&&o(e,`${t} = ${c};`),e.indent-=2,o(e,"}"),n.ifFalse){o(e,"else {"),e.indent+=2;const i=e.createSubgraphContext(),c=r(i,n.ifFalse);e.body+=i.body,c&&o(e,`${t} = ${c};`),e.indent-=2,o(e,"}")}return t}function u(e,n){const{captureList:t,generator:i,returnType:c}=n,u={};for(const o in t){if(!t[o])continue;const n=r(e,t[o]);u[o]=n}const d=r(e,new c,!0);if(u.out=d,n.subgraph){const t=e.createSubgraphContext(),o=r(t,n.subgraph.child),i=t.body;u.subgraph={varName:o,body:i}}const a=i(u);return o(e,"{\n"),e.indent+=2,o(e,a),e.indent-=2,o(e,"}\n"),d}function d(e,n){const t=r(e,n.target);if("string"==typeof n.property&&n.property.includes("["))return`${t}${n.property}`;if("string"!=typeof n.property){return`${t}[${r(e,n.property)}]`}return`${t}.${n.property}`}function a(e,n){return`${r(e,n.target)}[${r(e,n.x)}][${r(e,n.y)}]`}function p(n,i){const c=i.returnType.type;if(i.isInfix){const[u,d]=i.children.map(e=>r(n,e)),a=t(n,i);return o(n,`${c.padEnd(e)} ${a} = ${u} ${i.token} ${d};`,i.uid),a}const u=i.children.map(e=>r(n,e)).join(", "),d=t(n,i);return o(n,`${c.padEnd(e)} ${d} = ${i.token}(${u});`,i.uid),d}function s(n,i,c){const u=i.elementType.type;if("array"===u||"sampler2D"===u)throw new Error(`Unable to emit local array with element type ${u}`);const d=t(n,i);if(o(n,`${u.padEnd(e)} ${d}[${i.size}];`,i.uid),n.setEmit(i,d),c)return d;for(let e=0;e<i.size;e++){o(n,`${d}[${e}] = ${r(n,i.children[e])};`,i.uid)}return d}function f(n,i,c=!1){const u=n.getInput(i);if(u)return u.isUsed=!0,u.variableName;if("array"===i.type)return s(n,i,c);const d=1===i.children.length&&i.children[0]?.type===i.type;if(!i.isMutable&&(i.isImplicit||d))return r(n,i.children[0]);const a=t(n,i);if(c)return o(n,`${i.type.padEnd(e)} ${a};`,i.uid),a;const p=!i.debugInfo.name&&!i.isMutable;if(p){if("float"===i.type&&"number"==typeof i.children[0])return Number.isInteger(i.children[0])?i.children[0].toFixed(1):i.children[0].toString();if("int"===i.type&&"number"==typeof i.children[0]&&Number.isInteger(i.children[0]))return i.children[0].toString();if("bool"===i.type&&"boolean"==typeof i.children[0])return i.children[0].toString()}const f=i.children.map(e=>r(n,e)).join(", ");return p?`${i.type}(${f})`:(o(n,`${i.type.padEnd(e)} ${a} = ${i.type}(${f});`,i.uid),a)}export{n as generateGLSL};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{cloneShaderNode as e}from"./ShaderGraphNode.js";class t{constructor(e,t,a,o=[]){this.variableName=e,this.variableInputType=t,this.node=a,this.qualifiers=o,this.type="shader-input",this.isUsed=!1}clone(){return new t(this.variableName,this.variableInputType,e(this.node),[...this.qualifiers])}}class a{constructor(e,t,a,o=[]){this.outVariableName=e,this.outVariableType=t,this.node=a,this.qualifiers=o,this.type="shader-output"}clone(){const t=new a(this.outVariableName,this.outVariableType,e(this.node),[...this.qualifiers]);return t.variableName=this.variableName,t}}class o{static createVertex(e,r,s,d,i,u,c){const p=[];for(const a in e){const o=e[a],n=s.get(a);n?p.push(new t(n,"builtin",o)):p.push(new t("a_"+a,"in",o))}for(const a of d){const e=a.uniformHydrated;p.push(new t(a.uniformName,"uniform",e))}for(const a of i){const e=a.textureHydrated;p.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in r){const e=r[t];if("glPosition"===t)h.push(new a("gl_Position","builtin",e));else if("glPointSize"===t)h.push(new a("gl_PointSize","builtin",e));else{const o=n(e),r=[];o&&r.push(o),h.push(new a("v_"+t,"out",e,r))}}return new o(p,h,u,c)}static createFragment(e,n,r,s,d,i,u){const c=[],p=Array.from(i.rootOutputNodes());for(const a in e){const o=e[a],n=r.get(a);if(n){c.push(new t(n,"builtin",o));continue}const s=p.find(e=>e.node===o);s&&c.push(new t(s.outVariableName,"in",o))}for(const a of s){const e=a.uniformHydrated;c.push(new t(a.uniformName,"uniform",e))}for(const a of d){const e=a.textureHydrated;c.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in n){const e=n[t],o=r.get(t);switch(t){case"discard":h.push(new a(null,"discard",e));break;case"fragData0":h.push(new a("fragData0","fragData0",e));break;case"fragData1":h.push(new a("fragData1","fragData1",e));break;case"fragData2":h.push(new a("fragData2","fragData2",e));break;case"fragData3":h.push(new a("fragData3","fragData3",e));break;default:o?h.push(new a(o,"builtin",e)):h.push(new a(t,"out",e))}}return new o(c,h,u)}constructor(e,t,a,o){this.type="shader-graph-context",this.indent=0,this.body="",this.varCount=0,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(const n of e)this._inputShaderTypesByNodeUid.set(n.node.uid,n);this._outputShaderTypes=t,this._transformFeedbackBindings=a,this._transformFeedbackNames=new Set(a.map(e=>"v_"+e.propertyKey)),this._usedInFragmentShader=o}shouldPruneOutputNode(e){return!!this._usedInFragmentShader&&("builtin"!==e.outVariableType&&(!this._transformFeedbackNames.has(e.outVariableName)&&!this._usedInFragmentShader.has(e.node.uid)))}setEmit(e,t){this._nodeEmitMap.set(e.uid,t)}getEmit(e){return this._nodeEmitMap.get(e.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}getInput(e){return this._inputShaderTypesByNodeUid.get(e.uid)}*rootOutputNodes(){for(const e of this._outputShaderTypes)yield e}*nodes(){const e=[];for(const t of this._outputShaderTypes.values())e.push(t.node);for(;e.length;){const t=e.pop();"number"!=typeof t&&"boolean"!=typeof t&&e.push(...t.children.filter(Boolean)),yield t}}*nodesOfTypeOrFunction(){for(const e of this.nodes())"number"!=typeof e&&"boolean"!=typeof e&&(yield e)}createSubgraphContext(){const e=this.clone();return e.body="",e.indent=this.indent+2,e._nodeEmitMap=new Map(this._nodeEmitMap),e}clone(){const e=new o([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader);return e._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,e.indent=this.indent,e.body=this.body,e.varCount=this.varCount,e._nodeEmitMap=this._nodeEmitMap,e}insertVertexShader(e){e.vertex.code.add(""),this._insertInputs(e,"vertex"),e.vertex.code.add(""),e.vertex.code.add("// OUTPUTS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this.rootOutputNodes()){const a="builtin"===t.outVariableType;if(!this.shouldPruneOutputNode(t))if(a)e.vertex.code.add(`// ${t.outVariableType.padEnd(7)} ${t.node.type.padEnd(9)} ${t.outVariableName};`);else{const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.type.padEnd(9)} ${t.outVariableName};`)}}e.vertex.code.add(""),e.vertex.code.add("void main() {"),e.vertex.code.add(" "+this.body.split("\n").join("\n "));for(const t of this.rootOutputNodes())this.shouldPruneOutputNode(t)||e.vertex.code.add(` ${t.outVariableName} = ${t.variableName};`);e.vertex.code.add("}")}insertFragmentShader(e){this._insertInputs(e,"fragment"),e.fragment.code.add(""),e.fragment.code.add("// OUTPUTS: "),e.fragment.code.add("// --------------------------------------------------------- ");let t=0;for(const r of this.rootOutputNodes())"builtin"===r.outVariableType?e.fragment.code.add(`// ${r.outVariableType.padEnd(7)} ${r.node.type.padEnd(9)} ${r.outVariableName};`):"discard"===r.outVariableType||e.outputs.add(r.outVariableName,r.node.type,t++);e.fragment.code.add(""),e.fragment.code.add("void main() {"),e.fragment.code.add(" "+this.body.split("\n").join("\n "));const a=Array.from(this.rootOutputNodes()),o=a.find(e=>"discard"===e.outVariableType),n=a.filter(e=>"discard"!==e.outVariableType);o&&(e.fragment.code.add(` if (${o.variableName}) {`),e.fragment.code.add(" discard;"),e.fragment.code.add(" }"),e.fragment.code.add(" "));for(const r of n)e.fragment.code.add(` ${r.outVariableName} = ${r.variableName};`);e.fragment.code.add("}")}_insertInputs(e,t){e[t].code.add("// INPUTS: "),e[t].code.add("// --------------------------------------------------------- ");for(const a of this.inputs())if(a.isUsed&&"builtin"!==a.variableInputType)if("array"===a.node.type)e[t].code.add(`${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}];`);else if("array-2d"===a.node.type)e[t].code.add(`${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}]; // Emulated 2D Array. Not supported by ES3.0`);else{const o=[...a.qualifiers,a.variableInputType].join(" ");e[t].code.add(` ${o.padEnd(10)} ${a.node.type.padEnd(9)} ${a.variableName};`)}}}function n(e){switch(e.type){case"float":case"vec2":case"vec3":case"vec4":return null;case"int":case"ivec2":case"ivec3":case"ivec4":case"uint":case"uvec2":case"uvec3":case"uvec4":case"bool":case"bvec2":case"bvec3":case"bvec4":return"flat";case"mat2":case"mat3":case"mat4":case"array":case"sampler2D":case"array-2d":throw new Error(`InternalError: ${e.type} is not a valid output type`)}}export{o as ShaderGraphContext,t as ShaderInput,a as ShaderOutput};
2
+ import{cloneShaderNode as e}from"./ShaderGraphNode.js";class t{constructor(e,t,a,o=[]){this.variableName=e,this.variableInputType=t,this.node=a,this.qualifiers=o,this.type="shader-input",this.isUsed=!1}clone(){return new t(this.variableName,this.variableInputType,e(this.node),[...this.qualifiers])}}class a{constructor(e,t,a,o=[]){this.outVariableName=e,this.outVariableType=t,this.node=a,this.qualifiers=o,this.type="shader-output"}clone(){const t=new a(this.outVariableName,this.outVariableType,e(this.node),[...this.qualifiers]);return t.variableName=this.variableName,t}}class o{static createVertex(e,d,r,i,s,u,p){const c=[];for(const a in e){const o=e[a],n=r.get(a);n?c.push(new t(n,"builtin",o)):c.push(new t("a_"+a,"in",o))}for(const a of i){const e=a.uniformHydrated;c.push(new t(a.uniformName,"uniform",e))}for(const a of s){const e=a.textureHydrated;c.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in d){const e=d[t];if("glPosition"===t)h.push(new a("gl_Position","builtin",e));else if("glPointSize"===t)h.push(new a("gl_PointSize","builtin",e));else{const o=n(e),d=[];o&&d.push(o),h.push(new a("v_"+t,"out",e,d))}}return new o(c,h,u,p)}static createFragment(e,n,d,r,i,s,u){const p=[],c=Array.from(s.rootOutputNodes());for(const a in e){const o=e[a],n=d.get(a);if(n){p.push(new t(n,"builtin",o));continue}const r=c.find(e=>e.node===o);r&&p.push(new t(r.outVariableName,"in",o))}for(const a of r){const e=a.uniformHydrated;p.push(new t(a.uniformName,"uniform",e))}for(const a of i){const e=a.textureHydrated;p.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in n){const e=n[t],o=d.get(t);switch(t){case"discard":h.push(new a(null,"discard",e));break;case"fragData0":h.push(new a("fragData0","fragData0",e));break;case"fragData1":h.push(new a("fragData1","fragData1",e));break;case"fragData2":h.push(new a("fragData2","fragData2",e));break;case"fragData3":h.push(new a("fragData3","fragData3",e));break;default:o?h.push(new a(o,"builtin",e)):h.push(new a(t,"out",e))}}return new o(p,h,u)}constructor(e,t,a,o){this.type="shader-graph-context",this.indent=0,this.body="",this.varCount=0,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(const n of e)this._inputShaderTypesByNodeUid.set(n.node.uid,n);this._outputShaderTypes=t,this._transformFeedbackBindings=a,this._transformFeedbackNames=new Set(a.map(e=>"v_"+e.propertyKey)),this._usedInFragmentShader=o}shouldPruneOutputNode(e){return!!this._usedInFragmentShader&&("builtin"!==e.outVariableType&&(!this._transformFeedbackNames.has(e.outVariableName)&&!this._usedInFragmentShader.has(e.node.uid)))}setEmit(e,t){this._nodeEmitMap.set(e.uid,t)}getEmit(e){return this._nodeEmitMap.get(e.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}getInput(e){return this._inputShaderTypesByNodeUid.get(e.uid)}*rootOutputNodes(){for(const e of this._outputShaderTypes)yield e}*nodes(){const e=[];for(const t of this._outputShaderTypes.values())e.push(t.node);for(;e.length;){const t=e.pop();"number"!=typeof t&&"boolean"!=typeof t&&e.push(...t.children.filter(Boolean)),yield t}}*nodesOfTypeOrFunction(){for(const e of this.nodes())"number"!=typeof e&&"boolean"!=typeof e&&(yield e)}createSubgraphContext(){const e=this.clone();return e.body="",e.indent=this.indent+2,e._nodeEmitMap=new Map(this._nodeEmitMap),e}clone(){const e=new o([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader);return e._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,e.indent=this.indent,e.body=this.body,e.varCount=this.varCount,e._nodeEmitMap=this._nodeEmitMap,e}insertVertexShader(e){e.vertex.code.add(""),this._insertInputs(e,"vertex"),e.vertex.code.add(""),e.vertex.code.add("// OUTPUTS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this.rootOutputNodes()){const a="builtin"===t.outVariableType;if(!this.shouldPruneOutputNode(t))if(a)e.vertex.code.add(`// ${t.outVariableType.padEnd(7)} ${t.node.type.padEnd(9)} ${t.outVariableName};`);else if("array"===t.node.type){const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.elementType.type.padEnd(9)} ${t.outVariableName}[${t.node.size}];`)}else{const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.type.padEnd(9)} ${t.outVariableName};`)}}e.vertex.code.add(""),e.vertex.code.add("void main() {"),e.vertex.code.add(" "+this.body.split("\n").join("\n "));for(const t of this.rootOutputNodes())this.shouldPruneOutputNode(t)||e.vertex.code.add(` ${t.outVariableName} = ${t.variableName};`);e.vertex.code.add("}")}insertFragmentShader(e){this._insertInputs(e,"fragment"),e.fragment.code.add(""),e.fragment.code.add("// OUTPUTS: "),e.fragment.code.add("// --------------------------------------------------------- ");let t=0;for(const d of this.rootOutputNodes())"builtin"===d.outVariableType?e.fragment.code.add(`// ${d.outVariableType.padEnd(7)} ${d.node.type.padEnd(9)} ${d.outVariableName};`):"discard"===d.outVariableType||e.outputs.add(d.outVariableName,d.node.type,t++);e.fragment.code.add(""),e.fragment.code.add("void main() {"),e.fragment.code.add(" "+this.body.split("\n").join("\n "));const a=Array.from(this.rootOutputNodes()),o=a.find(e=>"discard"===e.outVariableType),n=a.filter(e=>"discard"!==e.outVariableType);o&&(e.fragment.code.add(` if (${o.variableName}) {`),e.fragment.code.add(" discard;"),e.fragment.code.add(" }"),e.fragment.code.add(" "));for(const d of n)e.fragment.code.add(` ${d.outVariableName} = ${d.variableName};`);e.fragment.code.add("}")}_insertInputs(e,t){e[t].code.add("// INPUTS: "),e[t].code.add("// --------------------------------------------------------- ");for(const a of this.inputs())if(a.isUsed&&"builtin"!==a.variableInputType)if("array"===a.node.type)e[t].code.add(` ${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}];`);else if("array-2d"===a.node.type)e[t].code.add(` ${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}]; // Emulated 2D Array. Not supported by ES3.0`);else{const o=[...a.qualifiers,a.variableInputType].join(" ");e[t].code.add(` ${o.padEnd(10)} ${a.node.type.padEnd(9)} ${a.variableName};`)}}}function n(e){switch(e.type){case"float":case"vec2":case"vec3":case"vec4":case"array":return null;case"int":case"ivec2":case"ivec3":case"ivec4":case"uint":case"uvec2":case"uvec3":case"uvec4":case"bool":case"bvec2":case"bvec3":case"bvec4":return"flat";case"mat2":case"mat3":case"mat4":case"sampler2D":case"array-2d":throw new Error(`InternalError: ${e.type} is not a valid output type`)}}export{o as ShaderGraphContext,t as ShaderInput,a as ShaderOutput};