@arcgis/core 5.2.0-next.41 → 5.2.0-next.42

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 (129) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/321dbc60f44819c2b4de.js +1 -0
  3. package/assets/esri/core/workers/chunks/399e23d777a043efa9f1.js +1 -0
  4. package/assets/esri/core/workers/chunks/5133083222588799493f.js +1 -0
  5. package/assets/esri/core/workers/chunks/{2b8909a488cf3b231eec.js → 590e977f8eeb379b86c8.js} +8 -8
  6. package/assets/esri/core/workers/chunks/{7ea65aa6d3e684e12082.js → 67468c50ecb1fbedda87.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{b45a013039bbd2614525.js → 7684f0c771d312e05bb4.js} +7 -7
  8. package/assets/esri/core/workers/chunks/{dd65c32ae55fcf1282fe.js → 934044f2ef6ce199b399.js} +1 -1
  9. package/assets/esri/core/workers/chunks/c1845682cc9a5aac8703.js +261 -0
  10. package/assets/esri/core/workers/chunks/{4056659d5c7698265129.js → d66d58ed5d66520ab1bf.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{aa0fb77c62a2d4eb20a5.js → e6b5c015205d38abe037.js} +1 -1
  12. package/assets/esri/core/workers/chunks/f4eda59ec1e816ecc827.js +1 -0
  13. package/assets/esri/core/workers/chunks/f8f0de841be17cd05c8f.js +1 -0
  14. package/assets/esri/themes/base/_core.scss +0 -6
  15. package/assets/esri/themes/dark/main.css +1 -1
  16. package/assets/esri/themes/light/main.css +1 -1
  17. package/assets/esri/themes/light/view.css +1 -1
  18. package/chunks/CutFillMinMaxDepth.glsl.js +2 -0
  19. package/chunks/CutFillTotalDepth.glsl.js +2 -0
  20. package/chunks/EdgeShader.glsl.js +9 -9
  21. package/chunks/GaussianSplat.glsl.js +1 -1
  22. package/chunks/cameraUtilsSpherical.js +1 -1
  23. package/config.js +1 -1
  24. package/editing/geometry/coordUtils.js +1 -1
  25. package/geohash/geohashUtils.js +1 -1
  26. package/geometry/support/aaBoundingRect.js +1 -1
  27. package/geometry/support/quantizationUtils.js +1 -1
  28. package/intl/date.js +1 -1
  29. package/kernel.js +1 -1
  30. package/layers/graphics/featureConversionUtils.js +1 -1
  31. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  32. package/layers/raster/formats/Lerc.js +1 -1
  33. package/layers/support/fieldUtils.js +1 -1
  34. package/package.json +1 -1
  35. package/support/revision.js +1 -1
  36. package/views/2d/engine/vectorTiles/GeometryUtils.js +1 -1
  37. package/views/2d/engine/webgl/Painter.js +1 -1
  38. package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
  39. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  40. package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
  41. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  42. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  43. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitBlitShader.js +2 -0
  44. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DebugOverlayShader.js +2 -0
  45. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HighlightShader.js +2 -0
  46. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/WorldExtentStencilShader.js +2 -0
  47. package/views/2d/engine/webgl/shaderGraph/techniques/utility/BitBlitTechnique.js +2 -0
  48. package/views/2d/engine/webgl/shaderGraph/techniques/utility/DebugOverlayTechnique.js +2 -0
  49. package/views/2d/engine/webgl/shaderGraph/techniques/utility/HighlightTechnique.js +2 -0
  50. package/views/2d/engine/webgl/shaderGraph/techniques/utility/WorldExtentClipTechnique.js +2 -0
  51. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  52. package/views/2d/layers/support/DebugOverlay.js +1 -1
  53. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  54. package/views/3d/layers/i3s/I3SNode.js +1 -1
  55. package/views/3d/layers/i3s/SphereCone.js +1 -1
  56. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  57. package/views/3d/support/cameraUtilsSpherical.js +1 -1
  58. package/views/3d/terrain/OverlayRenderer.js +1 -1
  59. package/views/3d/webgl/RenderCamera.js +1 -1
  60. package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +2 -2
  61. package/views/3d/webgl-engine/core/shaderLibrary/util/emissionFilter.glsl.js +1 -1
  62. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  63. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  64. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  65. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  66. package/views/3d/webgl-engine/lib/CutFillComputation.js +1 -1
  67. package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
  68. package/views/3d/webgl-engine/lib/IntersectorInterfaces.js +1 -1
  69. package/views/3d/webgl-engine/lib/PolygonIntersections2D.js +2 -0
  70. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  71. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  72. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  73. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/AdjustProjectedPosition.glsl.js +1 -1
  74. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/DiscardNonSilhouetteEdges.glsl.js +1 -1
  75. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  76. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
  77. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/EdgeUtil.glsl.js +1 -1
  78. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/LineAmplitude.glsl.js +1 -1
  79. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/LineOffset.glsl.js +1 -1
  80. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/UnpackAttributes.glsl.js +1 -1
  81. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  82. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  83. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  84. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  85. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  86. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  87. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  88. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  89. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  90. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  91. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  92. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  93. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  94. package/views/3d/webgl-engine/shaders/CutFillMinMaxDepth.glsl.js +2 -0
  95. package/views/3d/webgl-engine/shaders/CutFillMinMaxDepthTechnique.js +2 -0
  96. package/views/3d/webgl-engine/shaders/{CutFillDepth.glsl.js → CutFillTotalDepth.glsl.js} +1 -1
  97. package/views/3d/webgl-engine/shaders/CutFillTotalDepthTechnique.js +2 -0
  98. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
  99. package/views/input/BrowserEventSource.js +1 -1
  100. package/views/input/InputManager.js +1 -1
  101. package/views/interactive/snapping/snappingUtils.js +1 -1
  102. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  103. package/views/webgl/VertexAttributeLayouts.js +1 -1
  104. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  105. package/widgets/BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js +1 -1
  106. package/widgets/Legend/support/relationshipRampUtils.js +1 -1
  107. package/widgets/OrientedImageryViewer/utils.js +1 -1
  108. package/assets/esri/core/workers/chunks/002356e675769d20e5c0.js +0 -1
  109. package/assets/esri/core/workers/chunks/06e71d52773eb656a4bf.js +0 -261
  110. package/assets/esri/core/workers/chunks/352d144d7651da8a29c9.js +0 -1
  111. package/assets/esri/core/workers/chunks/4f2a61dfae6ca8ed1ec8.js +0 -1
  112. package/assets/esri/core/workers/chunks/ea8f224da4c5c95a3547.js +0 -1
  113. package/assets/esri/core/workers/chunks/f30578843f4faefd53b4.js +0 -1
  114. package/assets/esri/themes/base/_colorVariables.scss +0 -1
  115. package/assets/esri/themes/base/widgets/_DatePicker.scss +0 -170
  116. package/assets/esri/themes/base/widgets/_FeatureUtilityNetworkAssociationList.scss +0 -13
  117. package/assets/esri/themes/base/widgets/_TimePicker.scss +0 -15
  118. package/chunks/CutFillDepth.glsl.js +0 -2
  119. package/core/PLRUCache.js +0 -2
  120. package/views/2d/engine/webgl/BitBlitRenderer.js +0 -2
  121. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +0 -2
  122. package/views/2d/engine/webgl/effects/highlight/HighlightRenderer.js +0 -2
  123. package/views/2d/engine/webgl/shaders/BitBlitPrograms.js +0 -2
  124. package/views/2d/engine/webgl/shaders/HighlightPrograms.js +0 -2
  125. package/views/2d/engine/webgl/shaders/StencilPrograms.js +0 -2
  126. package/views/3d/webgl-engine/shaders/CutFillDepthTechnique.js +0 -2
  127. package/views/3d/webgl-engine/shaders/CutFillDepthTechniqueConfiguration.js +0 -2
  128. package/views/support/euclideanAreaMeasurementUtils.js +0 -2
  129. package/widgets/ShadowCast/ShadowVisualizationType.js +0 -2
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as r}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{Texture2DPassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{ShaderBuilder as o}from"../views/webgl/ShaderBuilder.js";function n(){const n=new o;return n.include(e),n.fragment.include(r),n.fragment.code.add("\n bool outsideFar(float depth) {\n return depth >= 1.0;\n }\n "),n.fragment.uniforms.add(new t("referenceDepth",e=>e.referenceDepth),new t("targetDepth",e=>e.targetDepth)).main.add("\n float targetDepth = depthFromTexture(targetDepth, uv);\n if (outsideFar(targetDepth)) {\n discard;\n }\n\n ivec2 texSize = textureSize(referenceDepth, 0);\n ivec2 coords = ivec2(gl_FragCoord.xy);\n float packedCoords = float(coords.x) + float(coords.y) * float(texSize.x);\n float referenceDepth = depthFromTexture(referenceDepth, uv);\n\n fragColor = vec4(referenceDepth, packedCoords, 0.0, 0.0);\n "),n}const a=Object.freeze(Object.defineProperty({__proto__:null,build:n},Symbol.toStringTag,{value:"Module"}));export{a as C,n as b};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as r}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{Texture2DPassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{NoParameters as n}from"../views/webgl/NoParameters.js";import{ShaderBuilder as a}from"../views/webgl/ShaderBuilder.js";class o extends n{}function d(){const n=new a;return n.include(e),n.fragment.include(r),n.fragment.uniforms.add(new t("referenceDepth",e=>e.referenceDepth),new t("targetDepth",e=>e.targetDepth)),n.fragment.code.add("\n bool outsideFar(float depth) {\n return depth >= 1.0;\n }\n "),n.fragment.main.add("\n float targetDepth = depthFromTexture(targetDepth, uv);\n if (outsideFar(targetDepth)) {\n discard;\n }\n\n float referenceDepth = depthFromTexture(referenceDepth, uv);\n float depth = referenceDepth - targetDepth;\n fragColor = vec4(min(0.0, depth), max(0.0, depth), 0.0, 0.0);\n "),n}const s=Object.freeze(Object.defineProperty({__proto__:null,CutFillDepthParameters:o,build:d},Symbol.toStringTag,{value:"Module"}));export{o as C,s as a,d as b};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{SliceDraw as o}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Float2BindUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js";import{Float4BindUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Float4BindUniform.js";import{FloatBindUniform as s}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as l,If as a}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{AdjustProjectedPosition as r}from"../views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js";import{DiscardNonSilhouetteEdges as c}from"../views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardNonSilhouetteEdges.glsl.js";import{EdgeUtil as p}from"../views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{LineAmplitude as P}from"../views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js";import{LineOffset as f}from"../views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js";import{UnpackAttributes as u}from"../views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js";import{ShaderBuilder as m}from"../views/webgl/ShaderBuilder.js";import{Uniform as g}from"../views/webgl/Uniform.js";function v(i){const g=new m,{vertex:v,fragment:h,varyings:L,attributes:A}=g;i.legacy&&v.uniforms.add(new w("model"),new w("localView")),g.include(r,i),g.include(p,i),g.include(P,i),g.include(u,i),g.include(f,i),h.include(o,i),g.include(c,i),L.add("vColor","vec4"),L.add("vRadius","float"),L.add("vPosition","vec3",{invariant:!0}),L.add("vWorldPosition","vec3",{invariant:!0}),L.add("vLineLengthPixels","float"),L.add("vSizeFalloffFactor","float"),v.uniforms.add(new n("pixelToNDC",({camera:i})=>e(x,2/i.fullViewport[2],2/i.fullViewport[3])),new t("viewport",e=>e.camera.fullViewport),new s("pixelRatio",e=>e.camera.pixelRatio)),A.add("position0","vec3"),A.add("position1","vec3"),A.add("variantOffset","float"),A.add("variantStroke","float"),A.add("variantExtension","float");const b=1===i.type,j=2===i.type,V=1/255,C=1;return v.uniforms.add(new d("distanceFalloffFactor",e=>e.distanceFalloffFactor)).code.add(l`
2
+ import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{SliceDraw as o}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Float2BindUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js";import{Float4BindUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Float4BindUniform.js";import{FloatBindUniform as s}from"../views/3d/webgl-engine/core/shaderModules/FloatBindUniform.js";import{FloatPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as d,If as a}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{AdjustProjectedPosition as r}from"../views/3d/webgl-engine/lib/edgeRendering/AdjustProjectedPosition.glsl.js";import{DiscardNonSilhouetteEdges as c}from"../views/3d/webgl-engine/lib/edgeRendering/DiscardNonSilhouetteEdges.glsl.js";import{EdgeUtil as p}from"../views/3d/webgl-engine/lib/edgeRendering/EdgeUtil.glsl.js";import{LineAmplitude as P}from"../views/3d/webgl-engine/lib/edgeRendering/LineAmplitude.glsl.js";import{LineOffset as f}from"../views/3d/webgl-engine/lib/edgeRendering/LineOffset.glsl.js";import{UnpackAttributes as u}from"../views/3d/webgl-engine/lib/edgeRendering/UnpackAttributes.glsl.js";import{ShaderBuilder as g}from"../views/webgl/ShaderBuilder.js";import{Uniform as m}from"../views/webgl/Uniform.js";function v(i){const m=new g,{vertex:v,fragment:h,varyings:L,attributes:A}=m;i.legacy&&v.uniforms.add(new w("model"),new w("localView")),m.include(r,i),m.include(p,i),m.include(P,i),m.include(u,i),m.include(f,i),h.include(o,i),m.include(c,i),L.add("vColor","vec4"),L.add("vRadius","float"),L.add("vPosition","vec3",{invariant:!0}),L.add("vWorldPosition","vec3",{invariant:!0}),L.add("vLineLengthPixels","float"),L.add("vSizeFalloffFactor","float"),v.uniforms.add(new n("pixelToNDC",({camera:i})=>e(x,2/i.fullViewport[2],2/i.fullViewport[3])),new t("viewport",e=>e.camera.fullViewport),new s("pixelRatio",e=>e.camera.pixelRatio)),A.add("position0","vec3"),A.add("position1","vec3"),A.add("variantOffset","float"),A.add("variantStroke","float"),A.add("variantExtension","float");const b=1===i.type,j=2===i.type,V=1/255,C=1;return v.uniforms.add(new l("distanceFalloffFactor",e=>e.distanceFalloffFactor)).code.add(d`
3
3
  float distanceBasedPerspectiveFactor(float distance) {
4
4
  return clamp(sqrt(distanceFalloffFactor / distance), 0.0, 1.0);
5
5
  }
@@ -37,8 +37,8 @@ import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}f
37
37
  float extendedLineLengthPixels = lineLengthPixels + extensionLengthPixels + extensionLengthPixels;
38
38
 
39
39
  // Line size with padding
40
- float halfAAPaddedLineWidthAndAmplitudePixels = lineWidthAndAmplitudePixels * 0.5 + ${l.float(C)};
41
- float aaPaddedRoundedCapSizePixels = lineWidthPixels * 0.5 + ${l.float(C)};
40
+ float halfAAPaddedLineWidthAndAmplitudePixels = lineWidthAndAmplitudePixels * 0.5 + ${d.float(C)};
41
+ float aaPaddedRoundedCapSizePixels = lineWidthPixels * 0.5 + ${d.float(C)};
42
42
 
43
43
  // Half line width in NDC including padding for anti aliasing
44
44
  vec2 halfAAPaddedLineWidthAndAmplitudeNDC = halfAAPaddedLineWidthAndAmplitudePixels * pixelToNDC;
@@ -73,12 +73,12 @@ import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}f
73
73
  vLineLengthPixels = extendedLineLengthPixels;
74
74
 
75
75
  // discard short edges below a certain length threshold
76
- ${a(b||j,l`if (lineLengthPixels <= 3.0 ${a(j," && unpackedAttributes.type <= 0.0")}) {
76
+ ${a(b||j,d`if (lineLengthPixels <= 3.0 ${a(j," && unpackedAttributes.type <= 0.0")}) {
77
77
  gl_Position = vec4(10.0, 10.0, 10.0, 1.0);
78
78
  return;
79
79
  }`)}
80
80
  gl_Position = projPos;
81
- }`),v.main.add(l`
81
+ }`),v.main.add(d`
82
82
  ComponentData component = readComponentData();
83
83
  UnpackedAttributes unpackedAttributes = unpackAttributes(component);
84
84
 
@@ -90,7 +90,7 @@ import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}f
90
90
  vColor = component.color;
91
91
 
92
92
  // Discard fully transparent edges
93
- if (vColor.a < ${l.float(V)}) {
93
+ if (vColor.a < ${d.float(V)}) {
94
94
  gl_Position = vec4(10.0, 10.0, 10.0, 1.0);
95
95
  return;
96
96
  }
@@ -103,7 +103,7 @@ import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as i}f
103
103
  calculateGeometricOutputs(viewPosV0, viewPosV1, worldPosV0, worldPosV1, worldNormal(component), unpackedAttributes);
104
104
 
105
105
  // Specific computation for different edge styles
106
- calculateStyleOutputs(unpackedAttributes);`),h.code.add(l`float lineWithCapsDistance(float radius, vec2 position, float lineLength) {
106
+ calculateStyleOutputs(unpackedAttributes);`),h.code.add(d`float lineWithCapsDistance(float radius, vec2 position, float lineLength) {
107
107
  float positionX = position.x - calculateLineOffset();
108
108
  if (radius < 1.0) {
109
109
  float coverageX = clamp(min(radius, positionX + 0.5) - max(-radius, positionX - 0.5), 0.0, 1.0);
@@ -114,8 +114,8 @@ else {
114
114
  float positionOnCap = position.y - clamp(position.y, 0.0, lineLength);
115
115
  return length(vec2(positionX, positionOnCap)) - radius;
116
116
  }
117
- }`),h.main.add(l`float radius = vRadius * calculateLinePressure();
117
+ }`),h.main.add(d`float radius = vRadius * calculateLinePressure();
118
118
  float distance = lineWithCapsDistance(radius, vPosition.xy, vLineLengthPixels);
119
119
  float coverage = clamp(0.5 - distance, 0.0, 1.0);
120
120
  discardBySlice(vWorldPosition);
121
- fragColor = vec4(vColor.rgb, vColor.a * coverage);`),g}const x=i();class w extends g{constructor(e){super(e,"mat4")}}const h=Object.freeze(Object.defineProperty({__proto__:null,build:v},Symbol.toStringTag,{value:"Module"}));export{h as E,v as b};
121
+ fragColor = vec4(vColor.rgb, vColor.a * coverage);`),m}const x=i();class w extends m{constructor(e){super(e,"mat4")}}const h=Object.freeze(Object.defineProperty({__proto__:null,build:v},Symbol.toStringTag,{value:"Module"}));export{h as E,v as b};
@@ -11,4 +11,4 @@ vec3 additionalLight = mainLightIntensity * additionalAmbientScale * ambientBoos
11
11
  ${B}
12
12
  float shadow = readShadow(additionalAmbientScale, fragmentPositionCameraRelative);
13
13
  shadedColor = evaluateSceneLighting(groundNormal, vColor.rgb, shadow, 0.0, additionalLight);
14
- `;return D.vertex.main.add(`\n uint gaussianIndex = fetchOrderedGaussianIndex(uint(gl_InstanceID));\n uvec4 packedGaussian = fetchPackedGaussian(gaussianIndex);\n uint pageNum = fetchGaussianPageIndex(gaussianIndex);\n\n // Unpack color first so very transparent splats can discard before fetching the page header.\n vColor = unpackColor(packedGaussian);\n\n // Apply per-page fading before the early alpha rejection.\n ${C(a.fadingEnabled,"\n uint fadingTextureWidth = uint(textureSize(splatFadingTexture, 0).x);\n uint fadeX = pageNum % fadingTextureWidth;\n uint fadeY = pageNum / fadingTextureWidth;\n uint opacityModifierByte = texelFetch(splatFadingTexture, ivec2(fadeX , fadeY), 0).r;\n float opacityModifier = float(opacityModifierByte) / 255.0;\n vColor.a *= opacityModifier;\n ")}\n\n // Set default position outside clip space for early returns.\n gl_Position = ${l};\n\n if (vColor.a < ${A}) {\n return;\n }\n\n // Delay the page header fetch until the splat survives the opacity reject.\n vec3 cameraRelativePosition = fetchGaussianCameraRelativePosition(gaussianIndex, packedGaussian);\n\n ${C(i,"\n if (cameraRelativePosition.x < clipMin.x || cameraRelativePosition.y < clipMin.y || cameraRelativePosition.z < clipMin.z ||\n cameraRelativePosition.x > clipMax.x || cameraRelativePosition.y > clipMax.y || cameraRelativePosition.z > clipMax.z) {\n return;\n }\n ")}\n\n ${C(m,"if (rejectBySlice(cameraRelativePosition)) {\n return;\n }")}\n\n vec4 viewPos = vec4(mat3(view) * cameraRelativePosition, 1);\n\n if (viewPos.z > -nearFar.x || viewPos.z < -nearFar.y) {\n return;\n }\n\n vec3 covarianceA;\n vec3 covarianceB;\n computePackedGaussianCovariance3D(packedGaussian, covarianceA, covarianceB);\n\n float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);\n\n vec3 covariance2D = computeGaussianCovariance2D(viewPos.xyz, focalLength, tanFov, covariance3D, view);\n\n // Reject degenerate covariances before inverting them into conic coefficients.\n float determinant = computeGaussianCovarianceDeterminant(covariance2D);\n if (determinant <= 0.) {\n return;\n }\n\n vec2 eigenvalues = computeGaussianCovarianceEigenvalues(covariance2D);\n\n // Fold the per-splat opacity into the log cutoff so the vertex-side ellipse\n // bound matches the fragment alpha discard after fading.\n gaussianLogAlphaCutoff = ${T} - log(vColor.a);\n float gaussianEllipseThreshold = computeGaussianEllipseThreshold(gaussianLogAlphaCutoff);\n vec2 axisLengths = computeGaussianAxisLengths(eigenvalues, gaussianEllipseThreshold);\n float maxRadius = max(axisLengths.x, axisLengths.y);\n\n // Ignore Gaussians with very small contribution, with tolerance based on the quality profile.\n if (rejectGaussianByMinimumRadius(maxRadius, vColor.a, minSplatRadius)) {\n return;\n }\n\n vec4 projPos = proj * viewPos;\n float invW = 1. / (projPos.w + 1e-7);\n vec3 ndcPos = projPos.xyz * invW;\n vec2 clipSpacePixelScale = 2.0 * inverseScreenSize;\n\n // Cull splats whose screen-space ellipse cannot touch the viewport.\n if (rejectGaussianByScreenBounds(ndcPos.xy, maxRadius, clipSpacePixelScale)) {\n return;\n }\n\n offsetFromCenter = computeGaussianQuadOffset(covariance2D, eigenvalues, axisLengths, gl_VertexID);\n\n ${C(G(a),"float viewSpacePixelScale = -viewPos.z / focalLength;\n vec3 fragmentViewOffset = vec3(offsetFromCenter * viewSpacePixelScale, 0.0);\n fragmentPositionCameraRelative = cameraRelativePosition + transpose(mat3(view)) * fragmentViewOffset;")}\n\n // Store conic coefficients with opacity for fragment-side falloff.\n vec3 conic = computeGaussianConic(covariance2D, determinant);\n conicOpacity = vec4(conic, vColor.a);\n\n // Handle environment lighting per vertex when no shadow map is active.\n // When shadows are received, defer lighting to the fragment shader for crisp shadow borders.\n ${C(L,"forwardLinearDepth(-viewPos.z);",$)}\n\n // Place this quad corner in clip space around the projected splat center.\n vec2 quadClipPosition = ndcPos.xy + offsetFromCenter * clipSpacePixelScale - inverseScreenSize;\n\n gl_Position = vec4(quadClipPosition, ndcPos.z, 1.0);\n\n `),D.fragment.include(v),D.fragment.include(g),D.fragment.include(n,a),D.fragment.main.add(`\n ${C(i,"if (fragmentPositionCameraRelative.x < clipMin.x || fragmentPositionCameraRelative.y < clipMin.y || fragmentPositionCameraRelative.z < clipMin.z ||\n fragmentPositionCameraRelative.x > clipMax.x || fragmentPositionCameraRelative.y > clipMax.y || fragmentPositionCameraRelative.z > clipMax.z) {\n discard;\n }")}\n ${C(m,"if (rejectBySlice(fragmentPositionCameraRelative)) { discard; }")}\n\n float gaussianExponent = evaluateGaussianExponent(conicOpacity.xyz, offsetFromCenter);\n\n // A positive exponent indicates alpha > 1, which should not happen.\n // We also early check the opacity-aware alpha cutoff to avoid unnecessary exp().\n if (gaussianExponent > 0.0 || gaussianExponent < gaussianLogAlphaCutoff) {\n discard;\n }\n\n float gaussianFalloff = exp(gaussianExponent);\n\n // Cap at 0.99 to avoid blending issues, such as seams between overlapping Gaussians.\n float alpha = min(.99f, conicOpacity.w * gaussianFalloff);\n\n vec3 shadedColor = vColor.rgb;\n ${C(L,E)}\n fragColor = vec4(shadedColor * alpha, alpha);\n\n // We simulate first hit based depth using 0.25 as the opacity threshold.\n // This works because we render in front-to-back order,\n // i.e. the first hit that counts completely saturates the alpha channel\n // and further splats do not contribute.\n float depthHit = step(0.25, alpha);\n float normalizedDepth = gl_FragCoord.z;\n fragDepthColor = vec4(encodeNormalizedDepthToRGB(normalizedDepth) * depthHit, depthHit);\n `),D}function G(e){const{clippingEnabled:a,hasSlicePlane:i,receiveShadows:n}=e;return n||i||a}const z=a(),D=Object.freeze(Object.defineProperty({__proto__:null,GaussianSplatPassParameters:L,build:F},Symbol.toStringTag,{value:"Module"}));export{L as G,D as a,F as b};
14
+ `;return D.vertex.main.add(`\n uint gaussianIndex = fetchOrderedGaussianIndex(uint(gl_InstanceID));\n uvec4 packedGaussian = fetchPackedGaussian(gaussianIndex);\n uint pageNum = fetchGaussianPageIndex(gaussianIndex);\n\n // Unpack color first so very transparent splats can discard before fetching the page header.\n vColor = unpackColor(packedGaussian);\n\n // Apply per-page fading before the early alpha rejection.\n ${C(a.fadingEnabled,"\n uint fadingTextureWidth = uint(textureSize(splatFadingTexture, 0).x);\n uint fadeX = pageNum % fadingTextureWidth;\n uint fadeY = pageNum / fadingTextureWidth;\n uint opacityModifierByte = texelFetch(splatFadingTexture, ivec2(fadeX , fadeY), 0).r;\n float opacityModifier = float(opacityModifierByte) / 255.0;\n vColor.a *= opacityModifier;\n ")}\n\n // Set default position outside clip space for early returns.\n gl_Position = ${l};\n\n if (vColor.a < ${A}) {\n return;\n }\n\n // Delay the page header fetch until the splat survives the opacity reject.\n vec3 cameraRelativePosition = fetchGaussianCameraRelativePosition(gaussianIndex, packedGaussian);\n\n ${C(i,"\n if (cameraRelativePosition.x < clipMin.x || cameraRelativePosition.y < clipMin.y || cameraRelativePosition.z < clipMin.z ||\n cameraRelativePosition.x > clipMax.x || cameraRelativePosition.y > clipMax.y || cameraRelativePosition.z > clipMax.z) {\n return;\n }\n ")}\n\n ${C(m,"if (rejectBySlice(cameraRelativePosition)) {\n return;\n }")}\n\n vec4 viewPos = vec4(mat3(view) * cameraRelativePosition, 1);\n\n if (viewPos.z > -nearFar.x || viewPos.z < -nearFar.y) {\n return;\n }\n\n vec3 covarianceA;\n vec3 covarianceB;\n computePackedGaussianCovariance3D(packedGaussian, covarianceA, covarianceB);\n\n float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);\n\n vec3 covariance2D = computeGaussianCovariance2D(viewPos.xyz, focalLength, tanFov, covariance3D, view);\n\n // Reject degenerate covariances before inverting them into conic coefficients.\n float determinant = computeGaussianCovarianceDeterminant(covariance2D);\n if (determinant <= 0.) {\n return;\n }\n\n vec2 eigenvalues = computeGaussianCovarianceEigenvalues(covariance2D);\n\n // Fold the per-splat opacity into the log cutoff so the vertex-side ellipse\n // bound matches the fragment alpha discard after fading.\n gaussianLogAlphaCutoff = ${T} - log(vColor.a);\n float gaussianEllipseThreshold = computeGaussianEllipseThreshold(gaussianLogAlphaCutoff);\n vec2 axisLengths = computeGaussianAxisLengths(eigenvalues, gaussianEllipseThreshold);\n float maxRadius = max(axisLengths.x, axisLengths.y);\n\n // Ignore Gaussians with very small contribution, with tolerance based on the quality profile.\n if (rejectGaussianByMinimumRadius(maxRadius, vColor.a, minSplatRadius)) {\n return;\n }\n\n vec4 projPos = proj * viewPos;\n float invW = 1. / (projPos.w + 1e-7);\n vec3 ndcPos = projPos.xyz * invW;\n vec2 clipSpacePixelScale = 2.0 * inverseScreenSize;\n\n // Cull splats whose screen-space ellipse cannot touch the viewport.\n if (rejectGaussianByScreenBounds(ndcPos.xy, maxRadius, clipSpacePixelScale)) {\n return;\n }\n\n offsetFromCenter = computeGaussianQuadOffset(covariance2D, eigenvalues, axisLengths, gl_VertexID);\n\n ${C(G(a),"float viewSpacePixelScale = -viewPos.z / focalLength;\n vec3 fragmentViewOffset = vec3(offsetFromCenter * viewSpacePixelScale, 0.0);\n fragmentPositionCameraRelative = cameraRelativePosition + transpose(mat3(view)) * fragmentViewOffset;")}\n\n // Store conic coefficients with opacity for fragment-side falloff.\n vec3 conic = computeGaussianConic(covariance2D, determinant);\n conicOpacity = vec4(conic, vColor.a);\n\n // Handle environment lighting per vertex when no shadow map is active.\n // When shadows are received, defer lighting to the fragment shader for crisp shadow borders.\n ${C(L,"forwardLinearDepth(-viewPos.z);",$)}\n\n // Place this quad corner in clip space around the projected splat center.\n vec2 quadClipPosition = ndcPos.xy + offsetFromCenter * clipSpacePixelScale - inverseScreenSize;\n\n gl_Position = vec4(quadClipPosition, ndcPos.z, 1.0);\n\n `),D.fragment.include(v),D.fragment.include(g),D.fragment.include(n,a),D.fragment.main.add(`\n ${C(i,"if (fragmentPositionCameraRelative.x < clipMin.x || fragmentPositionCameraRelative.y < clipMin.y || fragmentPositionCameraRelative.z < clipMin.z ||\n fragmentPositionCameraRelative.x > clipMax.x || fragmentPositionCameraRelative.y > clipMax.y || fragmentPositionCameraRelative.z > clipMax.z) {\n discard;\n }")}\n ${C(m,"if (rejectBySlice(fragmentPositionCameraRelative)) { discard; }")}\n\n float gaussianExponent = evaluateGaussianExponent(conicOpacity.xyz, offsetFromCenter);\n\n // A positive exponent indicates alpha > 1, which should not happen.\n // We also early check the opacity-aware alpha cutoff to avoid unnecessary exp().\n if (gaussianExponent > 0.0 || gaussianExponent < gaussianLogAlphaCutoff) {\n discard;\n }\n\n float gaussianFalloff = exp(gaussianExponent);\n\n // Cap at 0.99 to avoid blending issues, such as seams between overlapping Gaussians.\n float alpha = min(.99f, conicOpacity.w * gaussianFalloff);\n\n vec3 shadedColor = vColor.rgb;\n ${C(L,E)}\n fragColor = vec4(shadedColor * alpha, alpha);\n\n // We simulate first hit based depth using 0.25 as the opacity threshold.\n // This works because we render in front-to-back order,\n // i.e. the first hit that counts completely saturates the alpha channel\n // and further splats do not contribute.\n float depthHit = step(0.25, alpha);\n float normalizedDepth = gl_FragCoord.z;\n fragDepthColor = vec4(encodeNormalizedDepthToRGB(normalizedDepth) * depthHit, depthHit);\n `),D}function G({clippingEnabled:e,hasSlicePlane:a,receiveShadows:i}){return i||a||e}const z=a(),D=Object.freeze(Object.defineProperty({__proto__:null,GaussianSplatPassParameters:L,build:F},Symbol.toStringTag,{value:"Module"}));export{L as G,D as a,F as b};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{cyclical2PI as e}from"../core/Cyclical.js";import{deg2rad as t,rad2deg as r,asinClamped as o,lerp as s,clamp as n}from"../core/mathUtils.js";import{fromRotation as i,rotate as a}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{normalize as l,cross as m,dot as p,length as u,scale as f,transformMat4 as h,negate as g,distance as y,lerp as d,sqrDist as M,scaleAndAdd as j}from"../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as b,clone as x,create as v,fromValues as T}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as w,squaredLength as C}from"../core/libs/gl-matrix-2/math/vec4.js";import{create as R}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{getEpsilon as S}from"../core/libs/gl-matrix-2/math/common.js";import{getReferenceEllipsoid as U}from"../geometry/ellipsoidUtils.js";import P from"../geometry/Extent.js";import H from"../geometry/Polygon.js";import I from"../geometry/SpatialReference.js";import{isClockwise as q}from"../geometry/support/coordsUtils.js";import{fromPoints as A,create as E}from"../geometry/support/lineSegment.js";import{gcsCyclical as k}from"../geometry/support/normalizeUtils.js";import{fromPositionAndNormal as F,create as _,isPointInside as z,intersectLineOrRay as G,getNormal as W}from"../geometry/support/plane.js";import{wrap as O}from"../geometry/support/ray.js";import{Sphere as D}from"../geometry/support/sphere.js";import{geographicToWebMercator as L}from"../geometry/support/webMercatorUtils.js";import{Frustum as N}from"../views/3d/state/Frustum.js";import{minNearDistanceInMeters as B}from"../views/3d/state/NearFarHeuristic.js";import{directionToHeadingTilt as J,createDirectionUp as K,clampLineSegmentToPlane as Q}from"../views/3d/support/cameraUtilsInternal.js";import{getLonDeltaForDistance as V}from"../views/3d/support/earthUtils.js";import{slerp as X}from"../views/3d/support/mathUtils.js";const Y=T(0,0,1),Z=l(v(),T(1,1,1)),$=c(),ee=v(),te=v();function re(e,r,o,s=K()){m(ee,e,Y),0===p(ee,ee)&&m(ee,e,Z),i($,-t(r),e),a($,$,-t(o),ee);const{up:n,direction:c}=s;return m(n,ee,e),l(n,n),h(n,n,$),l(c,e),g(c,c),h(c,c,$),s}function oe(e,t,r,o){const s=ee,n=te;return l(s,e),m(te,s,Y),0===p(te,te)&&m(te,s,Z),m(n,te,s),J(t,r,o,s,n)}function se(e,r,s,n){const i={eye:v(),up:null,tilt:n,heading:s},a=ee;a[0]=e[0],a[1]=e[2],a[2]=-e[1];const c=r,l=t(s),m=t(n),p=Math.sin(l),h=Math.cos(l),g=Math.sin(m),y=Math.cos(m),d=u(a);let M;if(Math.abs(m)<1e-8)M=c+d;else{const e=d/g,t=o(c/e),r=Math.PI-m-t;M=e*Math.sin(r)}const j=y*c,b=c*c*(g*g),x=h*h*b,T=M-j,w=T*T,C=x*(x+w-a[1]*a[1]);if(C<0)return f(i.eye,a,M/d),i.tilt=0,ie(i,e);const R=Math.sqrt(C),S=a[1]*T,U=x+w;let P;if(P=h>0?-R+S:R+S,Math.abs(U)<1e-8)return d<1e-8?(i.eye[0]=0,i.eye[1]=0,i.eye[2]=c):f(i.eye,a,M/d),i.tilt=0,ne(i.eye),ie(i,e);i.eye[1]=P/U;const H=p*p*b,I=g*c,q=h*I*i.eye[1],A=i.eye[1]*i.eye[1],E=1-A,k=Math.sqrt(E),F=x*A+H-2*q*k*T+E*w;return Math.abs(F)<1e-8?(f(i.eye,a,M/d),i.tilt=0,ne(i.eye),ie(i,e)):(i.eye[0]=(E*(M*a[0]-j*a[0])-I*k*(a[0]*i.eye[1]*h+a[2]*p))/F,i.eye[2]=(E*(M*a[2]-j*a[2])-I*k*(a[2]*i.eye[1]*h-a[0]*p))/F,f(i.eye,i.eye,M),ne(i.eye),ie(i,e))}function ne(e){const t=e[1];e[1]=-e[2],e[2]=t}function ie(e,t){const r=re(t,e.heading,e.tilt);return e.up=r.up,e}function ae(e,t,s){const n=u(t),i=Math.sqrt(s*s+n*n-2*s*n*Math.cos(Math.PI-e)),a=o(s/(i/Math.sin(e)));return r(e-a)}function ce(e,r,s){const n=t(e),i=u(r);return o(s/(i/Math.sin(n)))+n}function le(o,s,n,i,a){let c,l,m,p;const u=s.latitude,f=U(o.spatialReference).radius,h=s.longitude,g=V(u,n,f)/2;c=h-g,l=h+g;const y=t(u),d=(1+Math.sin(y))/(1-Math.sin(y)),M=(d+1)*Math.tan(i/f/2),j=M*M;function b(t){const r=Math.PI/2;return(t=e.normalize(t,-r))>r&&(t=Math.PI-t),t}if(m=1.5*Math.PI-2*Math.atan(.5*(M+Math.sqrt(4*d+j))),p=m+i/f,m=b(m),p=b(p),p<m){const e=p;p=m,m=e}if(m=Math.max(r(m),-90),p=Math.min(r(p),90),l=k.monotonic(c,l),l-c>180){const e=(l-c-180)/2;c+=e,l-=e}const x=o.spatialReference&&o.spatialReference.isGeographic?o.spatialReference:I.WGS84;return a?(a.xmin=c,a.ymin=m,a.xmax=l,a.ymax=p,a.spatialReference=x):a=new P(c,m,l,p,x),o.spatialReference&&o.spatialReference.isWebMercator&&L(a,!1,a),a}function me(e,t){const{renderCoordsHelper:r}=e,o=e.state.camera.clone(),i=new N(r);o.near=B,i.update(o);const a=r.getAltitude(t),c=e.spatialReference,l=r.referenceEllipsoid.radius,m=o.eye,p=1+y(m,t)/(l+a),u=Math.sqrt(p*p-1),{minCurvature:f,maxCurvature:h,minSamples:g,maxSamples:j}=ge,v=he(e),T=n((u-f)/(h-f),0,1),R=Math.round(s(g,j,T)),S=o.aboveGround,U=i.planes[5],P=[],I=F(b,ye,_()),q=F(b,de,_());w(Te,0,0,0,0);const A=e=>{};for(let n=0;n<4;n++){const e=1===n&&!S||3===n&&S?1-v:0,t=1===n&&S||3===n&&!S?v:1,o=i.lines[n],c=i.lines[3===n?0:n+1];for(let i=0;i<R;i++){const l=i/R,p=0===i?0:s(e,t,1===n?1-(1-l)**2:3===n?l**2:l),u=d(je,o.origin,c.origin,p),f=X(o.direction,c.direction,p,Me);r.intersectManifoldClosestSilhouette(O(u,f),a,be),Q(be,m,be,U),P.push(x(be)),0!==P.length&&A(M(P.at(-1),be));const h=(z(I,be)?1:0)|(z(q,be)?2:0);Te[h]=1}}P.length>2&&A(M(P[0],P.at(-1)));const E=pe(C(Te)>1?ue(fe(P,I),q):[P],r,c);return new H({rings:E,spatialReference:c})}function pe(e,t,r){const o=2*S();return e.map(e=>{const s=[];let n=!1;for(const i of e)t.fromRenderCoords(i,be,r),Math.abs(i[0])<o&&Math.abs(i[1])<o?(s.push([null,be[1]]),s.push([null,be[1]]),n=!0):s.push([be[0],be[1]]);if(n)for(let t=0;t<s.length;t++){const e=s[t];if(null!=e[0])continue;const r=s[t+1],o=s.at(0===t?-1:t-1);e[0]=o[0],t++;const n=s.at(t===s.length-1?0:t+1);r[0]=n[0]}return s.push(s[0]),q(s)||s.reverse(),s})}function ue(e,t){const r=[];for(const o of e)r.push(...fe(o,t));return r}function fe(e,t){const r=[],o=[],s=S();for(let i=0;i<e.length;i++){const n=e[i],a=i===e.length-1?e[0]:e[i+1],c=A(n,a,ve),l=G(t,c.origin,c.vector,0,be);switch(l){case 2:r.push(n);break;case 3:o.push(n);break;case 0:case 1:{const[e,i,a]=0===l?[1,r,o]:[-1,o,r],c=W(t),m=j(v(),be,c,e*s),p=j(v(),be,c,e*-s);i.push(n),i.push(m),a.push(p)}}}const n=[];return r.length&&n.push(r),o.length&&n.push(o),n}function he(e){const{renderCoordsHelper:t,state:r}=e,o=Math.abs(t.getAltitude(r.camera.center));return xe.radius=t.referenceEllipsoid.radius+o,r.camera.sphereFrustumCoverage(xe,t)}const ge={minCurvature:t(5),maxCurvature:t(50),minSamples:1,maxSamples:6},ye=T(1,0,0),de=T(0,1,0),Me=v(),je=v(),be=v(),xe=new D,ve=E(),Te=R(),we=Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:oe,eyeForCenterWithHeadingTilt:se,eyeTiltToLookAtTilt:ce,headingTiltToDirectionUp:re,lookAtTiltToEyeTilt:ae,toArea:me,toExtent:le},Symbol.toStringTag,{value:"Module"}));export{ce as a,le as b,we as c,oe as d,se as e,re as h,ae as l,me as t};
2
+ import{cyclical2PI as e}from"../core/Cyclical.js";import{lerp as t,deg2rad as r,rad2deg as o,asinClamped as s,clamp as n}from"../core/mathUtils.js";import{fromRotation as i,rotate as a}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as c}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{normalize as l,cross as m,dot as u,length as p,scale as f,distance as h,transformMat4 as g,negate as d,lerp as y,sqrDist as M,scaleAndAdd as j}from"../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as b,clone as v,create as x,fromValues as T}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as C,squaredLength as w}from"../core/libs/gl-matrix-2/math/vec4.js";import{create as R}from"../core/libs/gl-matrix-2/factories/vec4f64.js";import{getEpsilon as S}from"../core/libs/gl-matrix-2/math/common.js";import{getReferenceEllipsoid as U}from"../geometry/ellipsoidUtils.js";import H from"../geometry/Extent.js";import P from"../geometry/Polygon.js";import A from"../geometry/SpatialReference.js";import{isClockwise as I}from"../geometry/support/coordsUtils.js";import{fromPoints as q,create as E}from"../geometry/support/lineSegment.js";import{gcsCyclical as k}from"../geometry/support/normalizeUtils.js";import{fromPositionAndNormal as F,create as _,isPointInside as z,intersectLineOrRay as G,getNormal as W}from"../geometry/support/plane.js";import{wrap as O}from"../geometry/support/ray.js";import{Sphere as D}from"../geometry/support/sphere.js";import{geographicToWebMercator as L}from"../geometry/support/webMercatorUtils.js";import{Frustum as N}from"../views/3d/state/Frustum.js";import{minNearDistanceInMeters as B}from"../views/3d/state/NearFarHeuristic.js";import{directionToHeadingTilt as J,createDirectionUp as K,clampLineSegmentToPlane as Q}from"../views/3d/support/cameraUtilsInternal.js";import{getLonDeltaForDistance as V}from"../views/3d/support/earthUtils.js";import{slerp as X}from"../views/3d/support/mathUtils.js";const Y=T(0,0,1),Z=l(x(),T(1,1,1)),$=c(),ee=x(),te=x();function re(e,t,o,s=K()){m(ee,e,Y),0===u(ee,ee)&&m(ee,e,Z),i($,-r(t),e),a($,$,-r(o),ee);const{up:n,direction:c}=s;return m(n,ee,e),l(n,n),g(n,n,$),l(c,e),d(c,c),g(c,c,$),s}function oe(e,t,r,o){const s=ee,n=te;return l(s,e),m(te,s,Y),0===u(te,te)&&m(te,s,Z),m(n,te,s),J(t,r,o,s,n)}function se(e,t,o,n){const i={eye:x(),up:null,tilt:n,heading:o},a=ee;a[0]=e[0],a[1]=e[2],a[2]=-e[1];const c=t,l=r(o),m=r(n),u=Math.sin(l),h=Math.cos(l),g=Math.sin(m),d=Math.cos(m),y=p(a);let M;if(Math.abs(m)<1e-8)M=c+y;else{const e=y/g,t=s(c/e),r=Math.PI-m-t;M=e*Math.sin(r)}const j=d*c,b=c*c*(g*g),v=h*h*b,T=M-j,C=T*T,w=v*(v+C-a[1]*a[1]);if(w<0)return f(i.eye,a,M/y),i.tilt=0,ie(i,e);const R=Math.sqrt(w),S=a[1]*T,U=v+C;let H;if(H=h>0?-R+S:R+S,Math.abs(U)<1e-8)return y<1e-8?(i.eye[0]=0,i.eye[1]=0,i.eye[2]=c):f(i.eye,a,M/y),i.tilt=0,ne(i.eye),ie(i,e);i.eye[1]=H/U;const P=u*u*b,A=g*c,I=h*A*i.eye[1],q=i.eye[1]*i.eye[1],E=1-q,k=Math.sqrt(E),F=v*q+P-2*I*k*T+E*C;return Math.abs(F)<1e-8?(f(i.eye,a,M/y),i.tilt=0,ne(i.eye),ie(i,e)):(i.eye[0]=(E*(M*a[0]-j*a[0])-A*k*(a[0]*i.eye[1]*h+a[2]*u))/F,i.eye[2]=(E*(M*a[2]-j*a[2])-A*k*(a[2]*i.eye[1]*h-a[0]*u))/F,f(i.eye,i.eye,M),ne(i.eye),ie(i,e))}function ne(e){const t=e[1];e[1]=-e[2],e[2]=t}function ie(e,t){const r=re(t,e.heading,e.tilt);return e.up=r.up,e}function ae(e,t,r){const n=p(t),i=Math.sqrt(r*r+n*n-2*r*n*Math.cos(Math.PI-e)),a=s(r/(i/Math.sin(e)));return o(e-a)}function ce(e,t,o){const n=r(e),i=p(t);return s(o/(i/Math.sin(n)))+n}function le(t,s,n,i,a){let c,l,m,u;const p=s.latitude,f=U(t.spatialReference).radius,h=s.longitude,g=V(p,n,f)/2;c=h-g,l=h+g;const d=r(p),y=(1+Math.sin(d))/(1-Math.sin(d)),M=(y+1)*Math.tan(i/f/2),j=M*M;function b(t){const r=Math.PI/2;return(t=e.normalize(t,-r))>r&&(t=Math.PI-t),t}if(m=1.5*Math.PI-2*Math.atan(.5*(M+Math.sqrt(4*y+j))),u=m+i/f,m=b(m),u=b(u),u<m){const e=u;u=m,m=e}if(m=Math.max(o(m),-90),u=Math.min(o(u),90),l=k.monotonic(c,l),l-c>180){const e=(l-c-180)/2;c+=e,l-=e}const v=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:A.WGS84;return a?(a.xmin=c,a.ymin=m,a.xmax=l,a.ymax=u,a.spatialReference=v):a=new H(c,m,l,u,v),t.spatialReference&&t.spatialReference.isWebMercator&&L(a,!1,a),a}function me(e,r){const{renderCoordsHelper:o}=e,s=e.state.camera.clone(),n=new N(o);s.near=B,n.update(s);const i=o.getAltitude(r),a=e.spatialReference,c=s.eye,l=ge(e),m=ue(e,r),u=s.aboveGround,p=n.planes[5],f=[],h=F(b,ye,_()),g=F(b,Me,_());C(Ce,0,0,0,0);const d=e=>{};for(let b=0;b<4;b++){const e=1===b&&!u||3===b&&u?1-l:0,r=1===b&&u||3===b&&!u?l:1,s=n.lines[b],a=n.lines[3===b?0:b+1];for(let n=0;n<m;n++){const l=n/m,u=0===n?0:t(e,r,1===b?1-(1-l)**2:3===b?l**2:l),j=y(be,s.origin,a.origin,u),x=X(s.direction,a.direction,u,je);o.intersectManifoldClosestSilhouette(O(j,x),i,ve),Q(ve,c,ve,p),f.push(v(ve)),0!==f.length&&d(M(f.at(-1),ve));const T=(z(h,ve)?1:0)|(z(g,ve)?2:0);Ce[T]=1}}f.length>2&&d(M(f[0],f.at(-1)));const j=pe(w(Ce)>1?fe(he(f,h),g):[f],o,a);return new P({rings:j,spatialReference:a})}function ue(e,r){const{renderCoordsHelper:o,state:s}=e;if(1!==s.viewingMode)return 1;const i=o.getAltitude(r),a=o.referenceEllipsoid.radius,c=1+h(s.camera.eye,r)/(a+i),l=Math.sqrt(c*c-1),{minCurvature:m,maxCurvature:u,minSamples:p,maxSamples:f}=de,g=n((l-m)/(u-m),0,1);return Math.round(t(p,f,g))}function pe(e,t,r){const o=2*S();return e.map(e=>{const s=[];let n=!1;for(const i of e)t.fromRenderCoords(i,ve,r),Math.abs(i[0])<o&&Math.abs(i[1])<o?(s.push([null,ve[1]]),s.push([null,ve[1]]),n=!0):s.push([ve[0],ve[1]]);if(n)for(let t=0;t<s.length;t++){const e=s[t];if(null!=e[0])continue;const r=s[t+1],o=s.at(0===t?-1:t-1);e[0]=o[0],t++;const n=s.at(t===s.length-1?0:t+1);r[0]=n[0]}return s.push(s[0]),I(s)||s.reverse(),s})}function fe(e,t){const r=[];for(const o of e)r.push(...he(o,t));return r}function he(e,t){const r=[],o=[],s=S();for(let i=0;i<e.length;i++){const n=e[i],a=i===e.length-1?e[0]:e[i+1],c=q(n,a,Te),l=G(t,c.origin,c.vector,0,ve);switch(l){case 2:r.push(n);break;case 3:o.push(n);break;case 0:case 1:{const[e,i,a]=0===l?[1,r,o]:[-1,o,r],c=W(t),m=j(x(),ve,c,e*s),u=j(x(),ve,c,e*-s);i.push(n),i.push(m),a.push(u)}}}const n=[];return r.length&&n.push(r),o.length&&n.push(o),n}function ge(e){const{renderCoordsHelper:t,state:r}=e,o=Math.abs(t.getAltitude(r.camera.center));return xe.radius=t.referenceEllipsoid.radius+o,r.camera.sphereFrustumCoverage(xe,t)}const de={minCurvature:r(5),maxCurvature:r(50),minSamples:1,maxSamples:6},ye=T(1,0,0),Me=T(0,1,0),je=x(),be=x(),ve=x(),xe=new D,Te=E(),Ce=R(),we=Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:oe,eyeForCenterWithHeadingTilt:se,eyeTiltToLookAtTilt:ce,getCurvatureSamples:ue,headingTiltToDirectionUp:re,lookAtTiltToEyeTilt:ae,toArea:me,toExtent:le},Symbol.toStringTag,{value:"Module"}));export{ce as a,le as b,we as c,oe as d,se as e,ue as g,re as h,ae as l,me as t};
package/config.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.2.0-next.41";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
2
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.2.0-next.42";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{getMetersPerVerticalUnitForSR as t,getMetersPerUnitForSR as n}from"../../core/units.js";function r(t,n){if(t[0]!==n[0]||t[1]!==n[1])return!1;const r=Math.max(t.length,n.length);if(r<3)return!0;for(let u=2;u<r;u++)if((t.at(u)??0)!==(n.at(u)??0))return!1;return!0}function u(r){if(r.vcsWkid||r.latestVcsWkid){return t(r)/n(r)}return 1}function e(t,n,r,u){if(null==t||null==n)return null;return t+(n-t)/r*u}export{r as equivalent,u as getHeightUnitCorrectionFactor,e as interpolateM};
2
+ import{getMetersPerVerticalUnitForSR as n,getMetersPerUnitForSR as r}from"../../core/units.js";function t(t){if(t.vcsWkid||t.latestVcsWkid){return n(t)/r(t)}return 1}function u(n,r,t,u){if(null==n||null==r)return null;return n+(r-n)/t*u}export{t as getHeightUnitCorrectionFactor,u as interpolateM};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../core/has.js";import{rad2deg as t}from"../core/mathUtils.js";import{set as o}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import n from"../geometry/Polygon.js";import e from"../geometry/SpatialReference.js";import{toExtent as s}from"../geometry/support/aaBoundingRect.js";import{earth as c}from"../geometry/support/Ellipsoid.js";import{convertFromPolygon as i}from"../layers/graphics/featureConversionUtils.js";import{project as f}from"../layers/graphics/data/projectionSupport.js";const l=16,a=8,u=4,h=2,m=1,p=r(),g=r(),x=-90,d=90,y=-180,M=180,j="0123456789bcdefghjkmnpqrstuvwxyz",S=64;function b(t,o,r,c){const l=[t.xmin,t.ymin,t.xmax,t.ymax],a=n.fromExtent(s(l,c)),u=f(a,c,e.WGS84,{extendedParams:{densificationStep:o*S}});if(!u)return null;const h=i(u,!1,!1),m=h.coords.filter((t,o)=>!(o%2)),p=h.coords.filter((t,o)=>o%2),g=Math.min(...m),x=Math.min(...p),d=Math.max(...m),y=Math.max(...p),M=v(g,x,r,e.WGS84),j=v(d,y,r,e.WGS84);return M&&j?{bounds:l,geohashBounds:{xLL:M[0],yLL:M[1],xTR:j[0],yTR:j[1]},level:r}:null}function v(o,r,n,s){if(s.isWebMercator){const e=t(o/c.radius),s=e-360*Math.floor((e+180)/360),i=[0,0];return B(i,0,t(Math.PI/2-2*Math.atan(Math.exp(-r/c.radius))),s,n),i}const i=f({x:o,y:r},s,e.WGS84);if(!i)return null;const l=[0,0];return B(l,0,i.y,i.x,n),l}function W(t){return t<=57?t-48:t<=104?t-88:t<=107?t-89:t<=110?t-90:t-91}function C(t){return j[t]}function G(t){return(t[0]+t[1])/2}function L(t,o){const r=G(t),n=o,e=!o;t[0]=e*t[0]+n*r,t[1]=e*r+n*t[1]}function R(t,o){const r=o>G(t);return L(t,r),r}function A(t,r){const n=o(p,x,d),e=o(g,y,M);for(let o=0;o<r.length;o++){const t=W(r.charCodeAt(o));o%2==0?(L(e,!!(l&t)),L(e,!!(u&t)),L(e,!!(m&t)),L(n,!!(a&t)),L(n,!!(h&t))):(L(n,!!(l&t)),L(n,!!(u&t)),L(n,!!(m&t)),L(e,!!(a&t)),L(e,!!(h&t)))}return t[0]=G(n),t[1]=G(e),t}function P(t,o){let r=0,n=0,e=30,s=30;for(let c=0;c<o.length;c++){const t=W(o.charCodeAt(c)),i=c%2==0;e-=i?3:2,s-=i?2:3,r|=U(t,i)<<e,n|=k(t,i)<<s}return{geohashX:r,geohashY:n}}function X(t,o){let r=-90,n=90,e=-180,s=180;for(let c=0;c<o;c++){const o=Math.ceil((c+1)/2),i=Math.floor((c+1)/2),f=1-c%2,l=30-(3*o+2*i),a=30-(2*o+3*i),u=3*f+2*(1-f),h=2*f+3*(1-f),m=3*f+7*(1-f)<<a,p=(7*f+3*(1-f)<<l&t.geohashX)>>l,g=(m&t.geohashY)>>a;for(let t=u-1;t>=0;t--){const o=(e+s)/2,r=p&1<<t?1:0;e=(1-r)*e+r*o,s=(1-r)*o+r*s}for(let t=h-1;t>=0;t--){const o=(r+n)/2,e=g&1<<t?1:0;r=(1-e)*r+e*o,n=(1-e)*o+e*n}}return[e,r,s,n]}function Y(t,o,r,n){n%2&&(n+=1);let e=0,s=0,c=-90,i=90,f=-180,l=180;for(let a=0;a<n/2;a++){for(let t=0;t<5;t++){const o=(f+l)/2,n=r>o?1:0;e|=n<<29-(t+5*a),f=(1-n)*f+n*o,l=(1-n)*o+n*l}for(let t=0;t<5;t++){const r=(c+i)/2,n=o>r?1:0;s|=n<<29-(t+5*a),c=(1-n)*c+n*r,i=(1-n)*r+n*i}}t.geohashX=e,t.geohashY=s}function B(t,o,r,n,e){e%2&&(e+=1);let s=0,c=0,i=-90,f=90,l=-180,a=180;for(let u=0;u<e/2;u++){for(let t=0;t<5;t++){const o=(l+a)/2,r=n>o?1:0;s|=r<<29-(t+5*u),l=(1-r)*l+r*o,a=(1-r)*o+r*a}for(let t=0;t<5;t++){const o=(i+f)/2,n=r>o?1:0;c|=n<<29-(t+5*u),i=(1-n)*i+n*o,f=(1-n)*o+n*f}}t[2*o]=s,t[2*o+1]=c}function E(t,r,n){let e="";const s=o(p,-90,90),c=o(g,-180,180);for(let o=0;o<n;o++){let n=0;!(o%2)?(n|=R(c,r)<<4,n|=R(s,t)<<3,n|=R(c,r)<<2,n|=R(s,t)<<1,n|=R(c,r)|0):(n|=R(s,t)<<4,n|=R(c,r)<<3,n|=R(s,t)<<2,n|=R(c,r)<<1,n|=R(s,t)|0),e+=C(n)}return e}function T(t,o,r){return r?t&m|(o&m)<<1|(t&h)<<1|(o&h)<<2|(t&u)<<2:o&m|(t&m)<<1|(o&h)<<1|(t&h)<<2|(o&u)<<2}function U(t,o){return o?m&t|(u&t)>>1|(l&t)>>2:(h&t)>>1|(a&t)>>2}function k(t,o){return o?(h&t)>>1|(a&t)>>2:m&t|(u&t)>>1|(l&t)>>2}function q(t,o,r){const n=!((t.length-1)%2),e=t.slice(0,-1),s=W(t.charCodeAt(t.length-1));let c=0,i=0,f=0,p=0;n?(c=8,i=4,f=m&s|(u&s)>>1|(l&s)>>2,p=(h&s)>>1|(a&s)>>2):(c=4,i=8,p=m&s|(u&s)>>1|(l&s)>>2,f=(h&s)>>1|(a&s)>>2);const g=f+o,x=p+r,d=Math.floor(g/c),y=Math.floor(x/i),M=C(T(g-d*c,x-y*i,n));return t.length>1&&(d||y)?q(e,d,y)+M:e+M}export{P as convertGeohash32ToXY,W as decodeBase32Char,A as decodeGeohash,X as decodeGeohashXY,C as encodeBase32Char,E as encodeGeohash,v as getGeohash,b as getGeohashBounds,q as getRelativeGeohash,B as setGeohashBuf,Y as setGeohashXY,U as unpackXBits,k as unpackYBits};
2
+ import"../core/has.js";import{rad2deg as t}from"../core/mathUtils.js";import{set as o}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import n from"../geometry/Polygon.js";import e from"../geometry/SpatialReference.js";import{toExtent as s}from"../geometry/support/aaBoundingRect.js";import{earth as i}from"../geometry/support/Ellipsoid.js";import{convertFromPolygon as c}from"../layers/graphics/featureConversionUtils.js";import{project as f}from"../layers/graphics/data/projectionSupport.js";const a=16,l=8,u=4,h=2,m=1,p=r(),g=r(),x="0123456789bcdefghjkmnpqrstuvwxyz",d=64;function y(t,o,r,i){const a=[t.xmin,t.ymin,t.xmax,t.ymax],l=n.fromExtent(s(a,i)),u=f(l,i,e.WGS84,{extendedParams:{densificationStep:o*d}});if(!u)return null;const h=c(u,!1,!1),m=h.coords.filter((t,o)=>!(o%2)),p=h.coords.filter((t,o)=>o%2),g=Math.min(...m),x=Math.min(...p),y=Math.max(...m),j=Math.max(...p),S=M(g,x,r,e.WGS84),b=M(y,j,r,e.WGS84);return S&&b?{bounds:a,geohashBounds:{xLL:S[0],yLL:S[1],xTR:b[0],yTR:b[1]},level:r}:null}function M(o,r,n,s){if(s.isWebMercator){const e=t(o/i.radius),s=e-360*Math.floor((e+180)/360),c=[0,0];return C(c,0,t(Math.PI/2-2*Math.atan(Math.exp(-r/i.radius))),s,n),c}const c=f({x:o,y:r},s,e.WGS84);if(!c)return null;const a=[0,0];return C(a,0,c.y,c.x,n),a}function j(t){return t<=57?t-48:t<=104?t-88:t<=107?t-89:t<=110?t-90:t-91}function S(t){return x[t]}function b(t){return(t[0]+t[1])/2}function v(t,o){const r=b(t),n=o,e=!o;t[0]=e*t[0]+n*r,t[1]=e*r+n*t[1]}function W(t,o){const r=o>b(t);return v(t,r),r}function G(t,o){let r=0,n=0,e=30,s=30;for(let i=0;i<o.length;i++){const t=j(o.charCodeAt(i)),c=i%2==0;e-=c?3:2,s-=c?2:3,r|=Y(t,c)<<e,n|=A(t,c)<<s}return{geohashX:r,geohashY:n}}function L(t,o){let r=-90,n=90,e=-180,s=180;for(let i=0;i<o;i++){const o=Math.ceil((i+1)/2),c=Math.floor((i+1)/2),f=1-i%2,a=30-(3*o+2*c),l=30-(2*o+3*c),u=3*f+2*(1-f),h=2*f+3*(1-f),m=3*f+7*(1-f)<<l,p=(7*f+3*(1-f)<<a&t.geohashX)>>a,g=(m&t.geohashY)>>l;for(let t=u-1;t>=0;t--){const o=(e+s)/2,r=p&1<<t?1:0;e=(1-r)*e+r*o,s=(1-r)*o+r*s}for(let t=h-1;t>=0;t--){const o=(r+n)/2,e=g&1<<t?1:0;r=(1-e)*r+e*o,n=(1-e)*o+e*n}}return[e,r,s,n]}function R(t,o,r,n){n%2&&(n+=1);let e=0,s=0,i=-90,c=90,f=-180,a=180;for(let l=0;l<n/2;l++){for(let t=0;t<5;t++){const o=(f+a)/2,n=r>o?1:0;e|=n<<29-(t+5*l),f=(1-n)*f+n*o,a=(1-n)*o+n*a}for(let t=0;t<5;t++){const r=(i+c)/2,n=o>r?1:0;s|=n<<29-(t+5*l),i=(1-n)*i+n*r,c=(1-n)*r+n*c}}t.geohashX=e,t.geohashY=s}function C(t,o,r,n,e){e%2&&(e+=1);let s=0,i=0,c=-90,f=90,a=-180,l=180;for(let u=0;u<e/2;u++){for(let t=0;t<5;t++){const o=(a+l)/2,r=n>o?1:0;s|=r<<29-(t+5*u),a=(1-r)*a+r*o,l=(1-r)*o+r*l}for(let t=0;t<5;t++){const o=(c+f)/2,n=r>o?1:0;i|=n<<29-(t+5*u),c=(1-n)*c+n*o,f=(1-n)*o+n*f}}t[2*o]=s,t[2*o+1]=i}function P(t,r,n){let e="";const s=o(p,-90,90),i=o(g,-180,180);for(let o=0;o<n;o++){let n=0;!(o%2)?(n|=W(i,r)<<4,n|=W(s,t)<<3,n|=W(i,r)<<2,n|=W(s,t)<<1,n|=W(i,r)|0):(n|=W(s,t)<<4,n|=W(i,r)<<3,n|=W(s,t)<<2,n|=W(i,r)<<1,n|=W(s,t)|0),e+=S(n)}return e}function X(t,o,r){return r?t&m|(o&m)<<1|(t&h)<<1|(o&h)<<2|(t&u)<<2:o&m|(t&m)<<1|(o&h)<<1|(t&h)<<2|(o&u)<<2}function Y(t,o){return o?m&t|(u&t)>>1|(a&t)>>2:(h&t)>>1|(l&t)>>2}function A(t,o){return o?(h&t)>>1|(l&t)>>2:m&t|(u&t)>>1|(a&t)>>2}function B(t,o,r){const n=!((t.length-1)%2),e=t.slice(0,-1),s=j(t.charCodeAt(t.length-1));let i=0,c=0,f=0,p=0;n?(i=8,c=4,f=m&s|(u&s)>>1|(a&s)>>2,p=(h&s)>>1|(l&s)>>2):(i=4,c=8,p=m&s|(u&s)>>1|(a&s)>>2,f=(h&s)>>1|(l&s)>>2);const g=f+o,x=p+r,d=Math.floor(g/i),y=Math.floor(x/c),M=S(X(g-d*i,x-y*c,n));return t.length>1&&(d||y)?B(e,d,y)+M:e+M}export{G as convertGeohash32ToXY,j as decodeBase32Char,L as decodeGeohashXY,S as encodeBase32Char,P as encodeGeohash,M as getGeohash,y as getGeohashBounds,B as getRelativeGeohash,C as setGeohashBuf,R as setGeohashXY,Y as unpackXBits,A as unpackYBits};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clamp as n,floatEqualUlp as t}from"../../core/mathUtils.js";import r from"../Extent.js";function i(n){return n}function u(n=X){return i([n[0],n[1],n[2],n[3]])}function a(n){return i([n[0],n[1],n[2],n[3]])}function e(n,t){return n!==t&&(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]),n}function o(n,t,r,i,a=u()){return a[0]=n,a[1]=t,a[2]=r,a[3]=i,a}function c(n,t=u()){return t[0]=n.xmin,t[1]=n.ymin,t[2]=n.xmax,t[3]=n.ymax,t}function m(n,t,i=new r){return i.xmin=n[0],i.ymin=n[1],i.xmax=n[2],i.ymax=n[3],i.spatialReference=t,i}function f(n,t){t[0]<n[0]&&(n[0]=t[0]),t[0]>n[2]&&(n[2]=t[0]),t[1]<n[1]&&(n[1]=t[1]),t[1]>n[3]&&(n[3]=t[1])}function h(n,t){t<n[0]&&(n[0]=t),t>n[2]&&(n[2]=t)}function M(n,t){t<n[1]&&(n[1]=t),t>n[3]&&(n[3]=t)}function x(n,{xmin:t,ymin:r,xmax:i,ymax:u}){n[0]=Math.min(n[0],t),n[1]=Math.min(n[1],r),n[2]=Math.max(n[2],i),n[3]=Math.max(n[3],u)}function s(n,t,r){if(null!=t)if("length"in t)P(t)?(r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.max(n[2],t[2]),r[3]=Math.max(n[3],t[3])):2!==t.length&&3!==t.length||(r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.max(n[2],t[0]),r[3]=Math.max(n[3],t[1]));else switch(t.type){case"extent":r[0]=Math.min(n[0],t.xmin),r[1]=Math.min(n[1],t.ymin),r[2]=Math.max(n[2],t.xmax),r[3]=Math.max(n[3],t.ymax);break;case"point":r[0]=Math.min(n[0],t.x),r[1]=Math.min(n[1],t.y),r[2]=Math.max(n[2],t.x),r[3]=Math.max(n[3],t.y)}else e(r,n)}function l(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.max(n[2],t[2]),n[3]=Math.max(n[3],t[3])}function y(n,t,r=n){const i=t.length;let u=n[0],a=n[1],e=n[2],o=n[3];for(let c=0;c<i;c++){const n=t[c];u=Math.min(u,n[0]),a=Math.min(a,n[1]),e=Math.max(e,n[0]),o=Math.max(o,n[1])}return r[0]=u,r[1]=a,r[2]=e,r[3]=o,r}function p(n){for(let t=0;t<4;t++)if(!isFinite(n[t]))return!1;return!0}function b(n){return null==n||n[0]>=n[2]?0:n[2]-n[0]}function g(n){return null==n||n[1]>=n[3]?0:n[3]-n[1]}function F(n){return b(n)*g(n)}function j(n){return b(n)>0&&g(n)>0}function q(n,t=[0,0]){return t[0]=(n[0]+n[2])/2,t[1]=(n[1]+n[3])/2,t}function w(n){const t=b(n),r=g(n);return Math.sqrt(t*t+r*r)}function d(n,t){return R(n,t[0],t[1])}function k(n,t){const r=t.radius,i=.5*(n[0]+n[2]),u=Math.abs(t.center[0]-i),a=.5*(n[2]-n[0]);if(u>r+a)return!1;const e=.5*(n[1]+n[3]),o=.5*(n[3]-n[1]),c=Math.abs(t.center[1]-e);if(c>r+o)return!1;if(u<a||c<o)return!0;const m=u-a,f=c-o;return m*m+f*f<=r*r}function v(n,t,r){const i=n[0],u=n[1],a=n[2],e=n[3],{x:o,y:c}=t,{x:m,y:f}=r,h=(n,t)=>(f-c)*n+(o-m)*t+(m*c-o*f)<0,M=h(i,e),x=h(a,e),s=h(a,u),l=h(i,u);return!(M===x&&x===s&&s===l&&l===M||o<i&&m<i||o>a&&m>a||c>e&&f>e||c<u&&f<u)}function E(n,t){return!!n&&R(n,t.x,t.y)}function R(n,t,r){return t>=n[0]&&r>=n[1]&&t<=n[2]&&r<=n[3]}function U(n,t,r,i){return t>=n[0]-i&&r>=n[1]-i&&t<=n[2]+i&&r<=n[3]+i}function z(n,t,r){return t[0]>=n[0]-r&&t[1]>=n[1]-r&&t[0]<=n[2]+r&&t[1]<=n[3]+r}function A(n,t){return Math.max(t[0],n[0])<=Math.min(t[2],n[2])&&Math.max(t[1],n[1])<=Math.min(t[3],n[3])}function B(n,t,r){return Math.max(t[0],n[0])-r<=Math.min(t[2],n[2])&&Math.max(t[1],n[1])-r<=Math.min(t[3],n[3])}function C(n,t){return t[0]>=n[0]&&t[2]<=n[2]&&t[1]>=n[1]&&t[3]<=n[3]}function D(n,t,r){return null==t?e(r,n):(r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.max(n[2],t[2]),r[3]=Math.max(n[3],t[3]),r)}function G(t,r,i){if(null==r)return e(i,t);const u=r[0],a=r[1],o=r[2],c=r[3];return i[0]=n(t[0],u,o),i[1]=n(t[1],a,c),i[2]=n(t[2],u,o),i[3]=n(t[3],a,c),i}function H(n,t){const r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,u=Math.max(Math.abs(t[0]-r)-b(n)/2,0),a=Math.max(Math.abs(t[1]-i)-g(n)/2,0);return Math.sqrt(u*u+a*a)}function I(n,t){t[0]=n[2]-n[0],t[1]=n[3]-n[1]}function J(n,t,r,i){return i??=n,i[0]=n[0]+t,i[1]=n[1]+r,i[2]=n[2]+t,i[3]=n[3]+r,i}function K(n,t,r=n){return r[0]=n[0]-t,r[1]=n[1]-t,r[2]=n[2]+t,r[3]=n[3]+t,r}function L(n,t,r=n){return r[0]=t[0],r[1]=t[1],r!==n&&(r[2]=n[2],r[3]=n[3]),r}function N(n,t,r=n){return r[2]=t[0],r[3]=t[1],r!==n&&(r[0]=n[0],r[1]=n[1]),n}function O(n){return n?e(n,W):u(W)}function P(n){return null!=n&&4===n.length}function Q(n){return!(0!==b(n)&&isFinite(n[0])||0!==g(n)&&isFinite(n[1]))}function S(n,t){return P(n)&&P(t)?n[0]===t[0]&&n[1]===t[1]&&n[2]===t[2]&&n[3]===t[3]:n===t}function T(n,r,i){return null!=n&&null!=r&&n.every((n,u)=>t(n,r[u],i))}const V=i([-1/0,-1/0,1/0,1/0]),W=i([1/0,1/0,-1/0,-1/0]),X=i([0,0,0,0]),Y=i([0,0,1,1]);function Z(n,t,r){return null!=t&&(r?r.contains(n[0],n[2],t[0])&&r.contains(n[0],n[2],t[2])&&t[1]>n[1]&&t[3]<n[3]:C(n,t))}function $(n,t,r){return null!=n&&(r?(r.contains(t[0],t[2],n[0])||r.contains(t[0],t[2],n[2])||r.contains(n[0],n[2],t[0]))&&!(n[1]>t[3]||n[3]<t[1]):A(n,t))}export{p as allFinite,T as almostEquals,F as area,q as center,a as clone,C as contains,d as containsPoint,E as containsPointObject,z as containsPointWithMargin,R as containsXY,U as containsXYWithMargin,e as copy,u as create,w as diagonal,H as distance,O as empty,S as equals,s as expand,x as expandExtentInPlace,f as expandPointInPlace,y as expandWithNestedArray,l as expandWithRect,h as expandXInPlace,M as expandYInPlace,c as fromExtent,o as fromValues,j as hasArea,g as height,G as intersection,A as intersects,v as intersectsSegment,k as intersectsSphere,B as intersectsWithMargin,P as is,Q as isPoint,W as negativeInfinity,J as offset,K as pad,V as positiveInfinity,Z as rectangleContainsRectangleCyclicalAware,$ as rectanglesIntersectCyclicalAware,N as setMax,L as setMin,I as size,m as toExtent,D as union,Y as unit,b as width,X as zero};
2
+ import{clamp as n,floatEqualUlp as t}from"../../core/mathUtils.js";import r from"../Extent.js";function i(n){return n}function u(n=$){return i([n[0],n[1],n[2],n[3]])}function a(n){return i([n[0],n[1],n[2],n[3]])}function e(n,t){return n!==t&&(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]),n}function o(n,t,r,i,a=u()){return a[0]=n,a[1]=t,a[2]=r,a[3]=i,a}function c(n,t=u()){return t[0]=n.xmin,t[1]=n.ymin,t[2]=n.xmax,t[3]=n.ymax,t}function f(n,t,i=new r){return i.xmin=n[0],i.ymin=n[1],i.xmax=n[2],i.ymax=n[3],i.spatialReference=t,i}function m(n,t){t[0]<n[0]&&(n[0]=t[0]),t[0]>n[2]&&(n[2]=t[0]),t[1]<n[1]&&(n[1]=t[1]),t[1]>n[3]&&(n[3]=t[1])}function h(n,t){t<n[0]&&(n[0]=t),t>n[2]&&(n[2]=t)}function M(n,t){t<n[1]&&(n[1]=t),t>n[3]&&(n[3]=t)}function x(n,{xmin:t,ymin:r,xmax:i,ymax:u}){n[0]=Math.min(n[0],t),n[1]=Math.min(n[1],r),n[2]=Math.max(n[2],i),n[3]=Math.max(n[3],u)}function l(n,t,r){if(null!=t)if("length"in t)P(t)?(r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.max(n[2],t[2]),r[3]=Math.max(n[3],t[3])):2!==t.length&&3!==t.length||(r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.max(n[2],t[0]),r[3]=Math.max(n[3],t[1]));else switch(t.type){case"extent":r[0]=Math.min(n[0],t.xmin),r[1]=Math.min(n[1],t.ymin),r[2]=Math.max(n[2],t.xmax),r[3]=Math.max(n[3],t.ymax);break;case"point":r[0]=Math.min(n[0],t.x),r[1]=Math.min(n[1],t.y),r[2]=Math.max(n[2],t.x),r[3]=Math.max(n[3],t.y)}else e(r,n)}function s(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.max(n[2],t[2]),n[3]=Math.max(n[3],t[3])}function y(n,t,r=n){const i=t.length;let u=n[0],a=n[1],e=n[2],o=n[3];for(let c=0;c<i;c++){const n=t[c];u=Math.min(u,n[0]),a=Math.min(a,n[1]),e=Math.max(e,n[0]),o=Math.max(o,n[1])}return r[0]=u,r[1]=a,r[2]=e,r[3]=o,r}function g(n){for(let t=0;t<4;t++)if(!isFinite(n[t]))return!1;return!0}function p(n){return null==n||n[0]>=n[2]?0:n[2]-n[0]}function b(n){return null==n||n[1]>=n[3]?0:n[3]-n[1]}function F(n){return p(n)*b(n)}function j(n){return p(n)>0&&b(n)>0}function q(n,t=[0,0]){return t[0]=(n[0]+n[2])/2,t[1]=(n[1]+n[3])/2,t}function w(n){const t=p(n),r=b(n);return Math.sqrt(t*t+r*r)}function d(n,t){return R(n,t[0],t[1])}function k(n,t){const r=t.radius,i=.5*(n[0]+n[2]),u=Math.abs(t.center[0]-i),a=.5*(n[2]-n[0]);if(u>r+a)return!1;const e=.5*(n[1]+n[3]),o=.5*(n[3]-n[1]),c=Math.abs(t.center[1]-e);if(c>r+o)return!1;if(u<a||c<o)return!0;const f=u-a,m=c-o;return f*f+m*m<=r*r}function v(n,t,r){const i=n[0],u=n[1],a=n[2],e=n[3],{x:o,y:c}=t,{x:f,y:m}=r,h=(n,t)=>(m-c)*n+(o-f)*t+(f*c-o*m)<0,M=h(i,e),x=h(a,e),l=h(a,u),s=h(i,u);return!(M===x&&x===l&&l===s&&s===M||o<i&&f<i||o>a&&f>a||c>e&&m>e||c<u&&m<u)}function E(n,t){return!!n&&R(n,t.x,t.y)}function R(n,t,r){return t>=n[0]&&r>=n[1]&&t<=n[2]&&r<=n[3]}function U(n,t,r,i){return t>=n[0]-i&&r>=n[1]-i&&t<=n[2]+i&&r<=n[3]+i}function z(n,t,r){return t[0]>=n[0]-r&&t[1]>=n[1]-r&&t[0]<=n[2]+r&&t[1]<=n[3]+r}function A(n,t){return Math.max(t[0],n[0])<=Math.min(t[2],n[2])&&Math.max(t[1],n[1])<=Math.min(t[3],n[3])}function B(n,t,r){return Math.max(t[0],n[0])-r<=Math.min(t[2],n[2])&&Math.max(t[1],n[1])-r<=Math.min(t[3],n[3])}function C(n,t){return t[0]>=n[0]&&t[2]<=n[2]&&t[1]>=n[1]&&t[3]<=n[3]}function D(n,t,r){return null==t?e(r,n):(r[0]=Math.min(n[0],t[0]),r[1]=Math.min(n[1],t[1]),r[2]=Math.max(n[2],t[2]),r[3]=Math.max(n[3],t[3]),r)}function G(t,r,i){if(null==r)return e(i,t);const u=r[0],a=r[1],o=r[2],c=r[3];return i[0]=n(t[0],u,o),i[1]=n(t[1],a,c),i[2]=n(t[2],u,o),i[3]=n(t[3],a,c),i}function H(n,t){const r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,u=Math.max(Math.abs(t[0]-r)-p(n)/2,0),a=Math.max(Math.abs(t[1]-i)-b(n)/2,0);return Math.sqrt(u*u+a*a)}function I(n,t){t[0]=n[2]-n[0],t[1]=n[3]-n[1]}function J(n,t,r,i){return i??=n,i[0]=n[0]+t,i[1]=n[1]+r,i[2]=n[2]+t,i[3]=n[3]+r,i}function K(n,t,r=n){return r[0]=n[0]-t,r[1]=n[1]-t,r[2]=n[2]+t,r[3]=n[3]+t,r}function L(n,t,r=n){return r[0]=t[0],r[1]=t[1],r!==n&&(r[2]=n[2],r[3]=n[3]),r}function N(n,t,r=n){return r[2]=t[0],r[3]=t[1],r!==n&&(r[0]=n[0],r[1]=n[1]),n}function O(n){return n?e(n,Z):u(Z)}function P(n){return null!=n&&4===n.length}function Q(n){return!(0!==p(n)&&isFinite(n[0])||0!==b(n)&&isFinite(n[1]))}function S(n,t){return P(n)&&P(t)?n[0]===t[0]&&n[1]===t[1]&&n[2]===t[2]&&n[3]===t[3]:n===t}function T(n,r,i){return null!=n&&null!=r&&n.every((n,u)=>t(n,r[u],i))}function V(n,t,r){return null!=t&&(r?r.contains(n[0],n[2],t[0])&&r.contains(n[0],n[2],t[2])&&t[1]>n[1]&&t[3]<n[3]:C(n,t))}function W(n,t,r){return null!=n&&(r?(r.contains(t[0],t[2],n[0])||r.contains(t[0],t[2],n[2])||r.contains(n[0],n[2],t[0]))&&!(n[1]>t[3]||n[3]<t[1]):A(n,t))}function X(n,t){if(4!==t.length||n[0]===n[2]||n[1]===n[3])return!1;for(let r=0;r<t.length;r++){const i=t[r],u=t[(r+1)%t.length];if(!!(i[0]!==n[0]&&i[0]!==n[2]||i[1]!==n[1]&&i[1]!==n[3]))return!1;const a=i[1]===u[1]&&i[0]!==u[0],e=i[0]===u[0]&&i[1]!==u[1];if(!a&&!e)return!1}return!0}const Y=i([-1/0,-1/0,1/0,1/0]),Z=i([1/0,1/0,-1/0,-1/0]),$=i([0,0,0,0]),_=i([0,0,1,1]);export{g as allFinite,T as almostEquals,F as area,q as center,a as clone,C as contains,d as containsPoint,E as containsPointObject,z as containsPointWithMargin,R as containsXY,U as containsXYWithMargin,e as copy,u as create,w as diagonal,H as distance,O as empty,S as equals,X as equalsPoints,l as expand,x as expandExtentInPlace,m as expandPointInPlace,y as expandWithNestedArray,s as expandWithRect,h as expandXInPlace,M as expandYInPlace,c as fromExtent,o as fromValues,j as hasArea,b as height,G as intersection,A as intersects,v as intersectsSegment,k as intersectsSphere,B as intersectsWithMargin,P as is,Q as isPoint,Z as negativeInfinity,J as offset,K as pad,Y as positiveInfinity,V as rectangleContainsRectangleCyclicalAware,W as rectanglesIntersectCyclicalAware,N as setMax,L as setMin,I as size,f as toExtent,D as union,_ as unit,p as width,$ as zero};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isPoint as n,isPolyline as t,isPolygon as e,isMultipoint as r,isExtent as o}from"./jsonTypeUtils.js";function s(n){if(!n)return null;return{originPosition:"upper-left"===n.originPosition?"upperLeft":"lower-left"===n.originPosition?"lowerLeft":n.originPosition,scale:n.tolerance?[n.tolerance,n.tolerance,1,1]:[1,1,1,1],translate:null!=n.extent?[n.extent.xmin,n.extent.ymax,n.extent.zmin??0,n.extent.mmin??0]:[0,0,0,0]}}function l(n){return"lowerLeft"===n.originPosition&&4===n.scale.length&&4===n.translate.length}function u(n){if(l(n))return n;const{originPosition:t,scale:e,translate:r}=n,o=e[0]??1,s=e[1]??1;return{originPosition:"lowerLeft",scale:[o,"lowerLeft"===t?s:-s,e[2]??1,e[3]??1],translate:[r[0]??0,r[1]??0,r[2]??0,r[3]??0]}}function i({scale:n,translate:t},e){return Math.round((e-t[0])/n[0])}function a({scale:n,translate:t},e){return Math.round((e-t[1])/n[1])}function c({scale:n,translate:t},e){return Math.round(((e??0)-t[2])/n[2])}function h({scale:n,translate:t},e){return e?Math.round((e-t[3])/n[3]):0}function f(n,t){return n&&t?M:n&&!t?g:!n&&t?x:m}const m=(n,t)=>{const e=[];if(!t.length)return null;const r=t[0];let o=i(n,r[0]),s=a(n,r[1]);e.push([o,s]);for(let l=1;l<t.length;l++){const[r,u]=t[l],c=i(n,r),h=a(n,u);c===o&&h===s||e.push([c-o,h-s]),o=c,s=h}return e},g=(n,t)=>{const e=[];if(!t.length)return null;const r=t[0];let o=i(n,r[0]),s=a(n,r[1]),l=c(n,r[2]);e.push([o,s,l]);for(let u=1;u<t.length;u++){const[r,h,f]=t[u],m=i(n,r),g=a(n,h),x=c(n,f);m===o&&g===s&&x===l||e.push([m-o,g-s,x]),o=m,s=g,l=x}return e},x=(n,t)=>{const e=[];if(!t.length)return null;const r=t[0];let o=i(n,r[0]),s=a(n,r[1]),l=h(n,r[2]);e.push([o,s,l]);for(let u=1;u<t.length;u++){const[r,c,f]=t[u],m=i(n,r),g=a(n,c),x=h(n,f);m===o&&g===s&&x===l||e.push([m-o,g-s,x]),o=m,s=g,l=x}return e},M=(n,t)=>{const e=[];if(!t.length)return null;const r=t[0];let o=i(n,r[0]),s=a(n,r[1]),l=c(n,r[2]),u=h(n,r[3]);e.push([o,s,l,u]);for(let f=1;f<t.length;f++){const[r,m,g,x]=t[f],M=i(n,r),I=a(n,m),p=c(n,g),N=h(n,x);M===o&&I===s&&p===l&&N===u||e.push([M-o,I-s,p,N]),o=M,s=I,l=p,u=N}return e};function I(n,t,e){const r=u(n);return t[0]=i(r,e[0]),t[3]=a(r,e[1]),t[2]=i(r,e[2]),t[1]=a(r,e[3]),t}function p(n,t,e,r){const o=[],s=f(e,r);for(let l=0;l<t.length;l++){const e=s(n,t[l]);e&&e.length>=3&&o.push(e)}return o.length?o:null}function N(n,t,e,r){const o=[],s=f(e,r);for(let l=0;l<t.length;l++){const e=s(n,t[l]);e&&e.length>=2&&o.push(e)}return o.length?o:null}function Z({scale:n,translate:t},e){return e*n[0]+t[0]}function y({scale:n,translate:t},e){return e*n[1]+t[1]}function z({scale:n,translate:t},e){return(e??0)*n[2]+t[2]}function w({scale:n,translate:t},e){return e?e*n[3]+t[3]:0}function P(n,t){return n&&t?A:n&&!t?E:!n&&t?L:T}const T=(n,t)=>{const e=new Array(t.length);if(!t.length)return e;const r=t[0];let o=Z(n,r[0]),s=y(n,r[1]);e[0]=[o,s];const{scale:l,originPosition:u}=n,i=l[0],a="lowerLeft"===u?l[1]:-l[1];for(let c=1;c<t.length;c++){const[n,r]=t[c];o+=i*n,s+=a*r,e[c]=[o,s]}return e},E=(n,t)=>{const e=new Array(t.length);if(!t.length)return e;const r=t[0];let o=Z(n,r[0]),s=y(n,r[1]);e[0]=[o,s,z(n,r[2])];const{scale:l,originPosition:u}=n,i=l[0],a="lowerLeft"===u?l[1]:-l[1];for(let c=1;c<t.length;c++){const[r,l,u]=t[c];o+=i*r,s+=a*l,e[c]=[o,s,z(n,u)]}return e},L=(n,t)=>{const e=new Array(t.length);if(!t.length)return e;const r=t[0];let o=Z(n,r[0]),s=y(n,r[1]);e[0]=[o,s,w(n,r[2])];const{scale:l,originPosition:u}=n,i=l[0],a="lowerLeft"===u?l[1]:-l[1];for(let c=1;c<t.length;c++){const[r,l,u]=t[c];o+=i*r,s+=a*l,e[c]=[o,s,w(n,u)]}return e},A=(n,t)=>{const e=new Array(t.length);if(!t.length)return e;const r=t[0];let o=Z(n,r[0]),s=y(n,r[1]);e[0]=[o,s,z(n,r[2]),w(n,r[3])];const{scale:l,originPosition:u}=n,i=l[0],a="lowerLeft"===u?l[1]:-l[1];for(let c=1;c<t.length;c++){const[r,l,u,h]=t[c];o+=i*r,s+=a*l,e[c]=[o,s,z(n,u),w(n,h)]}return e};function b(n,t,e){const r=new Array(e.length);for(let o=0;o<e.length;o++)r[o]=t(n,e[o]);return r}function F(n,t,e){const r=u(n);return e?(t[0]=Z(r,e[0]),t[1]=y(r,e[3]),t[2]=Z(r,e[2]),t[3]=y(r,e[1]),t):[Z(r,t[0]),y(r,t[3]),Z(r,t[2]),y(r,t[1])]}function V(n,t,e){let[r,o]=e[0],s=Math.min(r,t[0]),l=Math.min(o,t[1]),u=Math.max(r,t[2]),i=Math.max(o,t[3]);for(let a=1;a<e.length;a++){const[n,t]=e[a];r+=n,o+=t,n<0&&(s=Math.min(s,r)),n>0&&(u=Math.max(u,r)),t<0?l=Math.min(l,o):t>0&&(i=Math.max(i,o))}return n[0]=s,n[1]=l,n[2]=u,n[3]=i,n}function Y(n,t){if(!t.length)return null;n[0]=n[1]=Number.POSITIVE_INFINITY,n[2]=n[3]=Number.NEGATIVE_INFINITY;for(let e=0;e<t.length;e++)V(n,n,t[e]);return n}function _(n){const t=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];return V(t,t,n)}function d(n){return Y([0,0,0,0],n)}function G(n){return Y([0,0,0,0],n)}function O(n,t,e){const r=u(n);return t.xmin=i(r,e.xmin),t.ymin=a(r,e.ymin),t.xmax=i(r,e.xmax),t.ymax=a(r,e.ymax),e.hasZ&&(t.zmin=c(r,e.zmin),t.zmax=c(r,e.zmax)),e.hasM&&(t.mmin=h(r,e.mmin),t.mmax=h(r,e.mmax)),t.hasZ=e.hasZ??!1,t.hasM=e.hasM??!1,t}function S(n,t,e){const r=u(n);return t.points=f(e.hasZ,e.hasM)(r,e.points)??[],t.hasZ=e.hasZ??!1,t.hasM=e.hasM??!1,t}function j(n,t,e){const r=u(n);return t.x=i(r,e.x),t.y=a(r,e.y),null!=e.z&&(t.z=c(r,e.z)),null!=e.m&&(t.m=h(r,e.m)),t}function U(n,t,e){const r=p(u(n),e.rings,e.hasZ,e.hasM);return r?(t.rings=r,t.hasZ=e.hasZ??!1,t.hasM=e.hasM??!1,t):null}function k(n,t,e){const r=N(u(n),e.paths,e.hasZ,e.hasM);return r?(t.paths=r,t.hasZ=e.hasZ??!1,t.hasM=e.hasM??!1,t):null}function q(s,l){return s&&l?n(l)?j(s,{},l):t(l)?k(s,{},l):e(l)?U(s,{},l):r(l)?S(s,{},l):o(l)?O(s,{},l):null:null}function v(n,t,e,r=e.hasZ??!1,o=e.hasM??!1){const s=u(n);return t.xmin=Z(s,e.xmin),t.xmax=Z(s,e.xmax),t.ymin=y(s,e.ymin),t.ymax=y(s,e.ymax),r&&(t.zmin=z(s,e.zmin),t.zmax=z(s,e.zmax)),o&&(t.mmin=w(s,e.mmin),t.mmax=w(s,e.mmax)),t.hasZ=r,t.hasM=o,t}function B(n,t,e,r=e?.hasZ??!1,o=e?.hasM??!1){if(null!=e){const s=u(n);t.points=P(r,o)(s,e.points),t.hasZ=r,t.hasM=o}return t}function C(n,t,e,r=null!=e?.z,o=null!=e?.m){if(null==e)return t;const s=u(n);return t.x=Z(s,e.x),t.y=y(s,e.y),r&&(t.z=z(s,e.z)),o&&(t.m=w(s,e.m)),t}function D(n,t,e,r=e?.hasZ??!1,o=e?.hasM??!1){if(null!=e){const s=u(n);t.rings=b(s,P(r,o),e.rings),t.hasZ=r,t.hasM=o}return t}function H(n,t,e,r=e?.hasZ??!1,o=e?.hasM??!1){if(null!=e){const s=u(n);t.paths=b(s,P(r,o),e.paths),t.hasZ=r,t.hasM=o}return t}export{V as getQuantizedBoundsCoordsArray,Y as getQuantizedBoundsCoordsArrayArray,d as getQuantizedBoundsPaths,_ as getQuantizedBoundsPoints,G as getQuantizedBoundsRings,u as normalizeTransform,I as quantizeBounds,m as quantizeCoordsArrayXY,x as quantizeCoordsArrayXYM,g as quantizeCoordsArrayXYZ,M as quantizeCoordsArrayXYZM,O as quantizeExtent,q as quantizeGeometry,h as quantizeM,S as quantizeMultipoint,j as quantizePoint,U as quantizePolygon,k as quantizePolyline,i as quantizeX,a as quantizeY,c as quantizeZ,s as toQuantizationTransform,F as unquantizeBounds,b as unquantizeCoordsArrayArray,T as unquantizeCoordsArrayXY,L as unquantizeCoordsArrayXYM,E as unquantizeCoordsArrayXYZ,A as unquantizeCoordsArrayXYZM,v as unquantizeExtent,w as unquantizeM,B as unquantizeMultipoint,C as unquantizePoint,D as unquantizePolygon,H as unquantizePolyline,Z as unquantizeX,y as unquantizeY,z as unquantizeZ};
2
+ import{isPoint as n,isPolyline as t,isPolygon as e,isMultipoint as r,isExtent as s}from"./jsonTypeUtils.js";function o(n){if(!n)return null;return{originPosition:"upper-left"===n.originPosition?"upperLeft":"lower-left"===n.originPosition?"lowerLeft":n.originPosition,scale:n.tolerance?[n.tolerance,n.tolerance,1,1]:[1,1,1,1],translate:null!=n.extent?[n.extent.xmin,n.extent.ymax,n.extent.zmin??0,n.extent.mmin??0]:[0,0,0,0]}}function l(n){return"lowerLeft"===n.originPosition&&4===n.scale.length&&4===n.translate.length}function u(n){if(l(n))return n;const{originPosition:t,scale:e,translate:r}=n,s=e[0]??1,o=e[1]??1;return{originPosition:"lowerLeft",scale:[s,"lowerLeft"===t?o:-o,e[2]??1,e[3]??1],translate:[r[0]??0,r[1]??0,r[2]??0,r[3]??0]}}function i({scale:n,translate:t},e){return Math.round((e-t[0])/n[0])}function a({scale:n,translate:t},e){return Math.round((e-t[1])/n[1])}function c({scale:n,translate:t},e){return Math.round(((e??0)-t[2])/n[2])}function h({scale:n,translate:t},e){return e?Math.round((e-t[3])/n[3]):0}function f(n,t){return n&&t?x:n&&!t?m:!n&&t?p:g}const g=(n,t)=>{const e=[];if(!t.length)return null;const r=t[0];let s=i(n,r[0]),o=a(n,r[1]);e.push([s,o]);for(let l=1;l<t.length;l++){const[r,u]=t[l],c=i(n,r),h=a(n,u);c===s&&h===o||e.push([c-s,h-o]),s=c,o=h}return e},m=(n,t)=>{const e=[];if(!t.length)return null;const r=t[0];let s=i(n,r[0]),o=a(n,r[1]),l=c(n,r[2]);e.push([s,o,l]);for(let u=1;u<t.length;u++){const[r,h,f]=t[u],g=i(n,r),m=a(n,h),p=c(n,f);g===s&&m===o&&p===l||e.push([g-s,m-o,p]),s=g,o=m,l=p}return e},p=(n,t)=>{const e=[];if(!t.length)return null;const r=t[0];let s=i(n,r[0]),o=a(n,r[1]),l=h(n,r[2]);e.push([s,o,l]);for(let u=1;u<t.length;u++){const[r,c,f]=t[u],g=i(n,r),m=a(n,c),p=h(n,f);g===s&&m===o&&p===l||e.push([g-s,m-o,p]),s=g,o=m,l=p}return e},x=(n,t)=>{const e=[];if(!t.length)return null;const r=t[0];let s=i(n,r[0]),o=a(n,r[1]),l=c(n,r[2]),u=h(n,r[3]);e.push([s,o,l,u]);for(let f=1;f<t.length;f++){const[r,g,m,p]=t[f],x=i(n,r),M=a(n,g),Z=c(n,m),y=h(n,p);x===s&&M===o&&Z===l&&y===u||e.push([x-s,M-o,Z,y]),s=x,o=M,l=Z,u=y}return e};function M(n,t,e,r){const s=[],o=f(e,r);for(let l=0;l<t.length;l++){const e=o(n,t[l]);e&&e.length>=3&&s.push(e)}return s.length?s:null}function Z(n,t,e,r){const s=[],o=f(e,r);for(let l=0;l<t.length;l++){const e=o(n,t[l]);e&&e.length>=2&&s.push(e)}return s.length?s:null}function y({scale:n,translate:t},e){return e*n[0]+t[0]}function w({scale:n,translate:t},e){return e*n[1]+t[1]}function z({scale:n,translate:t},e){return(e??0)*n[2]+t[2]}function P({scale:n,translate:t},e){return e?e*n[3]+t[3]:0}function L(n,t){return n&&t?T:n&&!t?d:!n&&t?j:A}const A=(n,t)=>{const e=new Array(t.length);if(!t.length)return e;const r=t[0];let s=y(n,r[0]),o=w(n,r[1]);e[0]=[s,o];const{scale:l,originPosition:u}=n,i=l[0],a="lowerLeft"===u?l[1]:-l[1];for(let c=1;c<t.length;c++){const[n,r]=t[c];s+=i*n,o+=a*r,e[c]=[s,o]}return e},d=(n,t)=>{const e=new Array(t.length);if(!t.length)return e;const r=t[0];let s=y(n,r[0]),o=w(n,r[1]);e[0]=[s,o,z(n,r[2])];const{scale:l,originPosition:u}=n,i=l[0],a="lowerLeft"===u?l[1]:-l[1];for(let c=1;c<t.length;c++){const[r,l,u]=t[c];s+=i*r,o+=a*l,e[c]=[s,o,z(n,u)]}return e},j=(n,t)=>{const e=new Array(t.length);if(!t.length)return e;const r=t[0];let s=y(n,r[0]),o=w(n,r[1]);e[0]=[s,o,P(n,r[2])];const{scale:l,originPosition:u}=n,i=l[0],a="lowerLeft"===u?l[1]:-l[1];for(let c=1;c<t.length;c++){const[r,l,u]=t[c];s+=i*r,o+=a*l,e[c]=[s,o,P(n,u)]}return e},T=(n,t)=>{const e=new Array(t.length);if(!t.length)return e;const r=t[0];let s=y(n,r[0]),o=w(n,r[1]);e[0]=[s,o,z(n,r[2]),P(n,r[3])];const{scale:l,originPosition:u}=n,i=l[0],a="lowerLeft"===u?l[1]:-l[1];for(let c=1;c<t.length;c++){const[r,l,u,h]=t[c];s+=i*r,o+=a*l,e[c]=[s,o,z(n,u),P(n,h)]}return e};function U(n,t,e){const r=new Array(e.length);for(let s=0;s<e.length;s++)r[s]=t(n,e[s]);return r}function b(n,t,e){const r=u(n);return t.xmin=i(r,e.xmin),t.ymin=a(r,e.ymin),t.xmax=i(r,e.xmax),t.ymax=a(r,e.ymax),e.hasZ&&(t.zmin=c(r,e.zmin),t.zmax=c(r,e.zmax)),e.hasM&&(t.mmin=h(r,e.mmin),t.mmax=h(r,e.mmax)),t.hasZ=e.hasZ??!1,t.hasM=e.hasM??!1,t}function k(n,t,e){const r=u(n);return t.points=f(e.hasZ,e.hasM)(r,e.points)??[],t.hasZ=e.hasZ??!1,t.hasM=e.hasM??!1,t}function q(n,t,e){const r=u(n);return t.x=i(r,e.x),t.y=a(r,e.y),null!=e.z&&(t.z=c(r,e.z)),null!=e.m&&(t.m=h(r,e.m)),t}function v(n,t,e){const r=M(u(n),e.rings,e.hasZ,e.hasM);return r?(t.rings=r,t.hasZ=e.hasZ??!1,t.hasM=e.hasM??!1,t):null}function B(n,t,e){const r=Z(u(n),e.paths,e.hasZ,e.hasM);return r?(t.paths=r,t.hasZ=e.hasZ??!1,t.hasM=e.hasM??!1,t):null}function C(o,l){return o&&l?n(l)?q(o,{},l):t(l)?B(o,{},l):e(l)?v(o,{},l):r(l)?k(o,{},l):s(l)?b(o,{},l):null:null}function D(n,t,e,r=e?.hasZ??!1,s=e?.hasM??!1){if(null!=e){const o=u(n);t.points=L(r,s)(o,e.points),t.hasZ=r,t.hasM=s}return t}function E(n,t,e,r=null!=e?.z,s=null!=e?.m){if(null==e)return t;const o=u(n);return t.x=y(o,e.x),t.y=w(o,e.y),r&&(t.z=z(o,e.z)),s&&(t.m=P(o,e.m)),t}function F(n,t,e,r=e?.hasZ??!1,s=e?.hasM??!1){if(null!=e){const o=u(n);t.rings=U(o,L(r,s),e.rings),t.hasZ=r,t.hasM=s}return t}function G(n,t,e,r=e?.hasZ??!1,s=e?.hasM??!1){if(null!=e){const o=u(n);t.paths=U(o,L(r,s),e.paths),t.hasZ=r,t.hasM=s}return t}export{u as normalizeTransform,g as quantizeCoordsArrayXY,p as quantizeCoordsArrayXYM,m as quantizeCoordsArrayXYZ,x as quantizeCoordsArrayXYZM,b as quantizeExtent,C as quantizeGeometry,h as quantizeM,k as quantizeMultipoint,q as quantizePoint,v as quantizePolygon,B as quantizePolyline,i as quantizeX,a as quantizeY,c as quantizeZ,o as toQuantizationTransform,U as unquantizeCoordsArrayArray,A as unquantizeCoordsArrayXY,j as unquantizeCoordsArrayXYM,d as unquantizeCoordsArrayXYZ,T as unquantizeCoordsArrayXYZM,P as unquantizeM,D as unquantizeMultipoint,E as unquantizePoint,F as unquantizePolygon,G as unquantizePolyline,y as unquantizeX,w as unquantizeY,z as unquantizeZ};
package/intl/date.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{strict as t}from"../core/jsonMap.js";import{beforeLocaleChange as e,getLocaleLanguage as o,normalizeLocale as n}from"./locale.js";import{unknown as r,utc as a,system as m,systemTimeZone as h}from"../time/constants.js";import{shortTimeZoneName as i}from"../time/timeZoneUtils.js";import{DateTime as s}from"luxon";const l={dateStyle:void 0,year:void 0,month:void 0,day:void 0,weekday:void 0},y={timeStyle:void 0,hour12:void 0,hourCycle:void 0,hour:void 0,minute:void 0,second:void 0},d={timeZone:a},g={year:"numeric",month:"numeric",day:"numeric"},u={year:"numeric",month:"long",day:"numeric"},c={year:"numeric",month:"short",day:"numeric"},f={year:"numeric",month:"long",weekday:"long",day:"numeric"},D={hour:"numeric",minute:"numeric"},T={...D,second:"numeric"},S={hourCycle:"h23"},L={...D,...S},v={...T,...S},M={"short-date":g,"short-date-short-time":{...g,...D},"short-date-short-time-24":{...g,...L},"short-date-long-time":{...g,...T},"short-date-long-time-24":{...g,...v},"short-date-le":g,"short-date-le-short-time":{...g,...D},"short-date-le-short-time-24":{...g,...L},"short-date-le-long-time":{...g,...T},"short-date-le-long-time-24":{...g,...v},"long-month-day-year":u,"long-month-day-year-short-time":{...u,...D},"long-month-day-year-short-time-24":{...u,...L},"long-month-day-year-long-time":{...u,...T},"long-month-day-year-long-time-24":{...u,...v},"day-short-month-year":c,"day-short-month-year-short-time":{...c,...D},"day-short-month-year-short-time-24":{...c,...L},"day-short-month-year-long-time":{...c,...T},"day-short-month-year-long-time-24":{...c,...v},"long-date":f,"long-date-short-time":{...f,...D},"long-date-short-time-24":{...f,...L},"long-date-long-time":{...f,...T},"long-date-long-time-24":{...f,...v},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":D,"long-time":T},w=t()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),Y={ar:"ar-u-nu-latn-ca-gregory",nn:"no-NN"},Z=new Intl.DateTimeFormat("bs",{month:"long"}).formatToParts(new Date(2025,2)),p=Z.find(({type:t})=>"month"===t)?.value.toLowerCase();function j(){const t=o();return(t&&Y[t])??n()}"mart"!==p&&(Y.bs="sr-Latn-CS");let E=new WeakMap;const k=M["short-date-short-time"],C=M["short-date"];function I(t){let e=E.get(t);if(!e){const o=j(),n=J(t.timeZone??m),r={...t,timeZone:n};e=new Intl.DateTimeFormat(o,r),E.set(t,e)}return e}function N(t){return M[t]}function F(t){const{dateStyle:e,timeStyle:o,hour12:n,year:r,month:a}=t,m={};return e?m.dateStyle=e:r&&(m.year=r,m.month=a||void 0),o&&!m.year&&(m.timeStyle=o,m.hour12="auto"===n?void 0:"always"===n),m}function b(t,e=k){return I(e).format(t)}function x(t,e=k){return b(new Date(t),{...e,...d,...y})}function P(t,e=k){return b(new Date(`1970-01-01T${t}Z`),{...e,...d,...l})}function W(t,e=k){const o=s.fromISO(t,{setZone:!0});if(!o.isValid)return t;if(e.timeZone)return b(o.toJSDate(),e);const n=0===o.offset?a:e.timeZone,r={...e,timeZone:n};return o.toLocaleString(r,{locale:j()})}function J(t){switch(t){case m:return h;case r:return a;default:return t}}function O(t,e){return new Intl.DateTimeFormat(j(),e).formatToParts(t)}function U(t,e=new Date){return O(e,{timeZone:t,timeZoneName:i}).find(({type:t})=>"timeZoneName"===t)?.value}e(()=>{E=new WeakMap});export{N as convertDateFormatToIntlOptions,F as convertDateTimeFieldFormatToIntlOptions,w as dateFormatJSONMap,k as defaultFormatterOptions,C as defaultFormatterOptionsNoTime,b as formatDate,x as formatDateOnly,P as formatTimeOnly,W as formatTimestamp,I as getDateTimeFormatter,U as getShortOffsetTimeZoneSuffix,J as resolveTimeZone};
2
+ import{strict as t}from"../core/jsonMap.js";import{beforeLocaleChange as o,getLocaleLanguage as e,normalizeLocale as r}from"./locale.js";import{unknown as n,utc as a,system as m,systemTimeZone as h}from"../time/constants.js";import{DateTime as i}from"luxon";const s={dateStyle:void 0,year:void 0,month:void 0,day:void 0,weekday:void 0},l={timeStyle:void 0,hour12:void 0,hourCycle:void 0,hour:void 0,minute:void 0,second:void 0},y={timeZone:a},d={year:"numeric",month:"numeric",day:"numeric"},g={year:"numeric",month:"long",day:"numeric"},u={year:"numeric",month:"short",day:"numeric"},c={year:"numeric",month:"long",weekday:"long",day:"numeric"},D={hour:"numeric",minute:"numeric"},S={...D,second:"numeric"},T={hourCycle:"h23"},f={...D,...T},L={...S,...T},M={"short-date":d,"short-date-short-time":{...d,...D},"short-date-short-time-24":{...d,...f},"short-date-long-time":{...d,...S},"short-date-long-time-24":{...d,...L},"short-date-le":d,"short-date-le-short-time":{...d,...D},"short-date-le-short-time-24":{...d,...f},"short-date-le-long-time":{...d,...S},"short-date-le-long-time-24":{...d,...L},"long-month-day-year":g,"long-month-day-year-short-time":{...g,...D},"long-month-day-year-short-time-24":{...g,...f},"long-month-day-year-long-time":{...g,...S},"long-month-day-year-long-time-24":{...g,...L},"day-short-month-year":u,"day-short-month-year-short-time":{...u,...D},"day-short-month-year-short-time-24":{...u,...f},"day-short-month-year-long-time":{...u,...S},"day-short-month-year-long-time-24":{...u,...L},"long-date":c,"long-date-short-time":{...c,...D},"long-date-short-time-24":{...c,...f},"long-date-long-time":{...c,...S},"long-date-long-time-24":{...c,...L},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":D,"long-time":S},v=t()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),w={ar:"ar-u-nu-latn-ca-gregory",nn:"no-NN"},Y=new Intl.DateTimeFormat("bs",{month:"long"}).formatToParts(new Date(2025,2)),p=Y.find(({type:t})=>"month"===t)?.value.toLowerCase();function Z(){const t=e();return(t&&w[t])??r()}"mart"!==p&&(w.bs="sr-Latn-CS");let E=new WeakMap;const j=M["short-date-short-time"],k=M["short-date"];function C(t){let o=E.get(t);if(!o){const e=Z(),r=J(t.timeZone??m),n={...t,timeZone:r};o=new Intl.DateTimeFormat(e,n),E.set(t,o)}return o}function I(t){return M[t]}function b(t){const{dateStyle:o,timeStyle:e,hour12:r,year:n,month:a}=t,m={};return o?m.dateStyle=o:n&&(m.year=n,m.month=a||void 0),e&&!m.year&&(m.timeStyle=e,m.hour12="auto"===r?void 0:"always"===r),m}function x(t,o=j){return C(o).format(t)}function F(t,o=j){return x(new Date(t),{...o,...y,...l})}function N(t,o=j){return x(new Date(`1970-01-01T${t}Z`),{...o,...y,...s})}function W(t,o=j){const e=i.fromISO(t,{setZone:!0});if(!e.isValid)return t;if(o.timeZone)return x(e.toJSDate(),o);const r=0===e.offset?a:o.timeZone,n={...o,timeZone:r};return e.toLocaleString(n,{locale:Z()})}function J(t){switch(t){case m:return h;case n:return a;default:return t}}o(()=>{E=new WeakMap});export{I as convertDateFormatToIntlOptions,b as convertDateTimeFieldFormatToIntlOptions,v as dateFormatJSONMap,j as defaultFormatterOptions,k as defaultFormatterOptionsNoTime,x as formatDate,F as formatDateOnly,N as formatTimeOnly,W as formatTimestamp,C as getDateTimeFormatter,J as resolveTimeZone};
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.2.0-next.41",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
2
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.2.0-next.42",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../core/Error.js";import e from"../../core/Logger.js";import{assertIsSome as n}from"../../core/maybe.js";import{is as r,fromRectValues as o}from"../../geometry/support/aaBoundingBox.js";import{fromValues as s}from"../../geometry/support/aaBoundingRect.js";import{isPoint as u,isPolygon as i,isPolyline as c,isMultipoint as l,isGeometryWithZ as a,isGeometryWithM as f}from"../../geometry/support/jsonTypeUtils.js";import{OptimizedFeature as h}from"./OptimizedFeature.js";import m from"./OptimizedFeatureSet.js";import d from"./OptimizedGeometry.js";import{createFeatureId as g}from"./data/createFeatureId.js";const y=()=>e.getLogger("esri.layers.graphics.featureConversionUtils"),p={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0};function I({scale:t,translate:e},n){return Math.round((n-e[0])/t[0])}function M({scale:t,translate:e},n){return Math.round((e[1]-n)/t[1])}function b({scale:t,translate:e},n){return Math.round((n-e[0])/t[0])}function w({scale:t,translate:e},n){return Math.round((n-e[1])/t[1])}function G(t,e){return T(t,e,0)}function N(t,e){return T(t,-e,1)}function T({scale:t,translate:e},n,r){return n*t[r]+e[r]}function P(t,e,n){return e&&(t.hasZ=!0),n&&(t.hasM=!0),t}function x(t,e,n,r){if(e&&r&&t!==n)return(e,n,r,o)=>{r[o++]=e[n++],r[o++]=e[n++],t?n++:r[o++]=0,r[o++]=e[n++]??0};const o=2+(n?1:0)+(r?1:0),s=o-((!t&&n?1:0)+(!e&&r?1:0));return(t,e,n,r)=>{for(let u=0;u<o;++u)n[r++]=u<s?t[e++]??0:0}}function v(t,e,n){if(!t)return null;const{coords:r,hasZ:o,hasM:s}=t,[u,i]=r,c=o?r[2]:0,l=s?r[2+(o?1:0)]:0;return{x:u,y:i,z:e?c:void 0,m:n?l:void 0}}function Z(t,e,n,r){for(const{geometry:o,attributes:s}of e)t.push({attributes:s,geometry:v(o,n,r)});return t}function F(t,e,n,r,o){for(const s of e){const{geometry:e,attributes:u,centroid:i}=s,c=a(e),l=f(e);t.push(new h(e?E(e,n&&c,r&&l):null,u,i?E(i,!1,!1):null,g(s,o),s.displayId,s.distance,s.vertexCount))}return t}function E(t,e=a(t),n=f(t)){const{x:r,y:o,z:s,m:u}=t,i=[r,o];return e&&i.push(s??0),n&&i.push(u??0),new d([],i,e,n)}function j(t,e,n,r){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&k(o,n,r),attributes:s});return t}function k(t,e,n){if(null==t)return null;const{coords:r,stride:o,hasZ:s,hasM:u}=t,i=x(s,u,e,n),c=[];for(let l=0;l<r.length;l+=o){const t=[];i(r,l,t,0),c.push(t)}return P({points:c},e,n)}function V(t,e,n,r,o){for(const s of e){const{geometry:e,attributes:u}=s,i=a(e),c=f(e);t.push(new h(e?Y(e,n&&i,r&&c):null,u,null,g(s,o),s.displayId,s.distance,s.vertexCount))}return t}function Y(t,e=a(t),n=f(t)){const{points:r,hasZ:o,hasM:s}=t,u=new d([r.length],[],e,n),{coords:i,stride:c}=u;let l=0;const h=x(o??!1,s??!1,e,n);for(const a of r)h(a,0,i,l),l+=c;return u}function _(t,e,n,r){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&C(o,n,r),attributes:s});return t}function C(t,e,n){if(!t)return null;const{coords:r,lengths:o,stride:s,hasZ:u,hasM:i}=t;let c=0;const l=x(u,i,e,n),a=[];for(const f of o){const t=[];for(let e=0;e<f;e++){const e=[];l(r,c,e,0),c+=s,t.push(e)}a.push(t)}return P({paths:a},e,n)}function L(t,e,n,r,o){for(const s of e){const{geometry:e,attributes:u,centroid:i}=s,c=a(e),l=f(e);t.push(new h(e?O(e,n&&c,r&&l):null,u,i?E(i,!1,!1):null,g(s,o),s.displayId,s.distance,s.vertexCount))}return t}function O(t,e=a(t),n=f(t)){const{paths:r,hasZ:o,hasM:s}=t,u=x(o??!1,s??!1,e,n),i=new d([],[],e,n),{lengths:c,coords:l,stride:h}=i;let m=0;for(const a of r){for(const t of a)u(t,0,l,m),m+=h;c.push(a.length)}return i}function S(t,e,n,r){for(const{geometry:o,attributes:s,centroid:u}of e){const e=U(o,n,r),i=v(u,!1,!1);t.push(u?{geometry:e,attributes:s,centroid:i}:{geometry:e,attributes:s})}return t}function U(t,e,n){if(!t)return null;const{coords:r,lengths:o,stride:s,hasZ:u,hasM:i}=t;let c=0;const l=x(u,i,e,n),a=[];for(const f of o){const t=[];for(let e=0;e<f;e++){const e=[];l(r,c,e,0),c+=s,t.push(e)}a.push(t)}return P({rings:a},e,n)}function z(t,e,n,r,o){for(const s of e){const{geometry:e,attributes:u,centroid:i}=s,c=a(e),l=f(e);t.push(new h(e?R(e,n&&c,r&&l):null,u,i?E(i,!1,!1):null,g(s,o),s.displayId,s.distance,s.vertexCount))}return t}function R(t,e=a(t),n=f(t)){const{rings:r,hasZ:o,hasM:s}=t,u=new d([],[],e,n),{lengths:i,coords:c,stride:l}=u;let h=0;const m=x(o??!1,s??!1,e,n);for(const a of r){for(const t of a)m(t,0,c,h),h+=l;i.push(a.length)}return u}const A=[],$=[];function q(t,e,n,r,o){A[0]=t;const[s]=B($,A,e,n,r,o);return ht(A),ht($),s}function B(e,n,r,o,s,u){if(ht(e),!r){for(const t of n){const n=g(t,u);e.push(new h(null,t.attributes,null,n,void 0,t.distance,t.vertexCount))}return e}switch(r){case"esriGeometryPoint":return F(e,n,o,s,u);case"esriGeometryMultipoint":return V(e,n,o,s,u);case"esriGeometryPolyline":return L(e,n,o,s,u);case"esriGeometryPolygon":case"esriGeometryMultiPatch":return z(e,n,o,s,u);default:y().error("convertToFeatureSet:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${r}'`)),ht(e)}return e}function D(t,e,n,r){$[0]=t,Q(A,$,e,n,r);const o=A[0];return ht(A),ht($),o}function H(e,n=a(e),r=f(e)){return null==e?null:u(e)?E(e,n,r):i(e)?R(e,n,r):c(e)?O(e,n,r):l(e)?Y(e,n,r):void y().error("convertFromGeometry:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${e}'`))}function J(e,n,r,o){if(null==e)return null;const s="coords"in e?e:e.geometry;if(null==s)return null;switch(n){case"esriGeometryPoint":return v(s,r,o);case"esriGeometryMultipoint":return k(s,r,o);case"esriGeometryPolyline":return C(s,r,o);case"esriGeometryPolygon":return U(s,r,o);default:return y().error("convertToGeometry:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${n}'`)),null}}function K(t,e){for(const n of e)t.push({attributes:n.attributes});return t}function Q(e,n,r,o,s){if(ht(e),null==r)return K(e,n);switch(r){case"esriGeometryPoint":return Z(e,n,o,s);case"esriGeometryMultipoint":return j(e,n,o,s);case"esriGeometryPolyline":return _(e,n,o,s);case"esriGeometryPolygon":return S(e,n,o,s);default:y().error("convertToFeatureSet:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${r}'`))}return e}function W(t){const{spatialReference:e,transform:n,fields:r,hasM:o,hasZ:s,features:u,geometryType:i,exceededTransferLimit:c,queryGeometry:l,queryGeometryType:a}=t,f={features:Q([],u,i,s,o),fields:r,geometryType:i,spatialReference:e,queryGeometry:J(l,a,s,o)};return n&&(f.transform=n),c&&(f.exceededTransferLimit=c),o&&(f.hasM=o),s&&(f.hasZ=s),f}function X(t,e){const n=new m,{hasM:r,hasZ:o,features:s,spatialReference:u,geometryType:i,exceededTransferLimit:c,transform:l,fields:a,globalIdFieldName:f}=t;return a&&(n.fields=a),n.geometryType=i??null,n.spatialReference=u??null,s&&B(n.features,s,i,o,r,e),c&&(n.exceededTransferLimit=c),r&&(n.hasM=r),o&&(n.hasZ=o),l&&(n.transform=l),f&&(n.globalIdFieldName=f),n}function tt(t){const{transform:e,features:n}=t;if(!e)return t;for(const r of n)null!=r.geometry&&ct(r.geometry,e),null!=r.centroid&&ct(r.centroid,e);return t.transform=null,t}function et(t,e){const{geometryType:n,features:r}=e;if(!t)return e;for(let o=0;o<r.length;o++){const e=r[o],s=e.weakClone();s.geometry=nt(e.geometry,n,t),s.centroid=nt(e.centroid,"esriGeometryPoint",t),r[o]=s}return e.transform=t,e}function nt(t,e,n,r,o,s=!1){if(null==t)return null;if(!t?.coords.length)return null;const u=p[e],{coords:i,lengths:c,stride:l,hasZ:a,hasM:f}=t;r??=a,o??=f;const h=new d([],[],r,o),m=h.stride,g=x(a,f,r,o);let y=0;const G=[0,0,0,0].slice(m),N=s?b:I,T=s?w:M;function P(){g(i,y,G,0),y+=l,G[0]=N(n,G[0]),G[1]=T(n,G[1])}if(t.isPoint)return P(),h.coords.push(...G),h;let v=0;for(const d of c){if(d<u)continue;let t=1;P(),h.coords.push(...G);let[e,n]=G;for(let r=1;r<d;r++){P();const[r,o]=G;e===r&&n===o||(s||(G[0]-=e,G[1]-=n),h.coords.push(...G),e=r,n=o,t++)}t>=u?(h.lengths.push(t),v=h.coords.length):ht(h.coords,v)}return ht(h.coords,v),h.coords.length?h:null}function rt(t,e,n,r=t.hasZ,o=t.hasM){if(!t.coords.length)return null;const s=p[e],{coords:u,lengths:i,stride:c,hasZ:l,hasM:a}=t,f=new d([],[],r,o),h=f.stride,m=x(l,a,r,o);if(t.isPoint)return m(u,0,f.coords,0),f;let g=0;const y=n*n;for(const d of i){if(d<s){g+=d*c;continue}const t=f.coords.length/h,e=g,n=g+(d-1)*c;m(u,e,f.coords,f.coords.length),st(f.coords,u,c,y,m,e,n),m(u,n,f.coords,f.coords.length);const r=f.coords.length/h-t;r>=s?f.lengths.push(r):ht(f.coords,t*h),g+=d*c}return f.coords.length?f:null}function ot(t,e,n,r){const o=t[e],s=t[e+1],u=t[n],i=t[n+1],c=t[r],l=t[r+1];let a=u,f=i,h=c-a,m=l-f;if(0!==h||0!==m){const t=((o-a)*h+(s-f)*m)/(h*h+m*m);t>1?(a=c,f=l):t>0&&(a+=h*t,f+=m*t)}return h=o-a,m=s-f,h*h+m*m}function st(t,e,n,r,o,s,u){let i,c=r,l=0;for(let a=s+n;a<u;a+=n)i=ot(e,a,s,u),i>c&&(l=a,c=i);c>r&&(l-s>n&&st(t,e,n,r,o,s,l),o(e,l,t,t.length),u-l>n&&st(t,e,n,r,o,l,u))}function ut(t,e){if(!e?.coords?.length)return null;let n=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;const{coords:l,stride:a}=e;for(let r=0;r<l.length;r+=a){const t=l[r],e=l[r+1];n=Math.min(n,t),i=Math.max(i,t),u=Math.min(u,e),c=Math.max(c,e)}return r(t)?o(t,n,u,i,c):s(n,u,i,c,t),t}function it(t,e){const{lengths:n,coords:r,stride:o}=e;let s=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=0;for(const a of n){let t=r[l],e=r[l+1];s=Math.min(t,s),u=Math.min(e,u),i=Math.max(t,i),c=Math.max(e,c),l+=o;for(let n=1;n<a;n++,l+=o){const n=r[l],o=r[l+1];t+=n,e+=o,n<0&&(s=Math.min(s,t)),n>0&&(i=Math.max(i,t)),o<0?u=Math.min(u,e):o>0&&(c=Math.max(c,e))}}return t[0]=s,t[1]=u,t[2]=i,t[3]=c,t}function ct(t,e){const{coords:r,lengths:o,stride:s,hasZ:u,hasM:i}=t;if(!r.length)return void(o.length=0);n(e);const{originPosition:c,scale:l,translate:a}=e,f=mt;f.originPosition=c;const h=f.scale;h[0]=l[0]??1,h[1]=-(l[1]??1),h[2]=l[2]??1,h[3]=l[3]??1;const m=f.translate;if(m[0]=a[0]??0,m[1]=a[1]??0,m[2]=a[2]??0,m[3]=a[3]??0,i&&!u&&(h[2]=h[3],m[2]=m[3]),!o.length){for(let t=0;t<s;++t)r[t]=T(f,r[t],t);return void(o.length=0)}let d=0;for(let n=0;n<o.length;n++){const t=o[n];o[n]=t;for(let n=0;n<s;++n)r[d+n]=T(f,r[d+n],n);let e=r[d],u=r[d+1];d+=s;for(let n=1;n<t;n++,d+=s){e+=r[d]*h[0],u+=r[d+1]*h[1],r[d]=e,r[d+1]=u;for(let t=2;t<s;++t)r[d+t]=T(f,r[d+t],t)}}}function lt(t,e){if(!t?.coords?.length)return null;const n=p[e],{coords:r,lengths:o,stride:s,hasZ:u,hasM:i}=t,c=x(u,i,u,i),l=new d([],[],u,i);let a=0,f=0,h=0,m=0;for(const d of o){f=m,c(r,a,l.coords,f),a+=s,f+=s;let t=r[a],e=r[a+1];for(let n=1;n<d;n++){const o=r[a+s],u=r[a+s+1];t*u-e*o===0&&n!==d-1||(c(r,a,l.coords,f),l.coords[f]=t,l.coords[f+1]=e,f+=s,t=e=0),t+=o,e+=u,a+=s}const o=(f-m)/s;o>=n&&(l.lengths[h]=o,m=f,h++)}return l.coords.length>m&&(l.coords.length=m),l.lengths.length>h&&(l.lengths.length=h),l.coords.length&&l.lengths.length?l:null}function at(t,e,n,r){let o=0,s=t[r*e],u=t[r*(e+1)];for(let i=1;i<n;i++){const n=s+t[r*(e+i)],c=u+t[r*(e+i)+1],l=(n-s)*(c+u);s=n,u=c,o+=l}return.5*o}function ft(t,e){const{coords:n,lengths:r}=t;let o=0,s=0;for(let u=0;u<r.length;u++){const t=r[u];s+=at(n,o,t,e),o+=t}return Math.abs(s)}function ht(t,e=0){t.length!==e&&(t.length=e)}const mt={originPosition:"lowerLeft",scale:[1,1,1,1],translate:[0,0,0,0]};export{q as convertFromFeature,X as convertFromFeatureSet,B as convertFromFeatures,H as convertFromGeometry,Y as convertFromMultipoint,V as convertFromMultipointFeatures,E as convertFromPoint,F as convertFromPointFeatures,R as convertFromPolygon,O as convertFromPolyline,L as convertFromPolylineFeatures,D as convertToFeature,W as convertToFeatureSet,Q as convertToFeatures,J as convertToGeometry,k as convertToMultipoint,j as convertToMultipointFeatures,v as convertToPoint,U as convertToPolygon,C as convertToPolyline,rt as generalizeOptimizedGeometry,ut as getBoundsOptimizedGeometry,ft as getQuantizedArea,it as getQuantizedBoundsOptimizedGeometry,at as getSignedQuantizedRingArea,et as quantizeOptimizedFeatureSet,nt as quantizeOptimizedGeometry,I as quantizeX,M as quantizeY,lt as removeCollinearVertices,tt as unquantizeOptimizedFeatureSetInPlace,ct as unquantizeOptimizedGeometryInPlace,T as unquantizeValue,G as unquantizeX,N as unquantizeY};
2
+ import t from"../../core/Error.js";import e from"../../core/Logger.js";import{assertIsSome as r}from"../../core/maybe.js";import{is as n,fromRectValues as o}from"../../geometry/support/aaBoundingBox.js";import{fromValues as s}from"../../geometry/support/aaBoundingRect.js";import{isPoint as u,isPolygon as i,isPolyline as c,isMultipoint as l,isGeometryWithZ as a,isGeometryWithM as f}from"../../geometry/support/jsonTypeUtils.js";import{OptimizedFeature as h}from"./OptimizedFeature.js";import d from"./OptimizedFeatureSet.js";import m from"./OptimizedGeometry.js";import{createFeatureId as g}from"./data/createFeatureId.js";const y=()=>e.getLogger("esri.layers.graphics.featureConversionUtils"),p={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0};function M({scale:t,translate:e},r){return Math.round((r-e[0])/t[0])}function w({scale:t,translate:e},r){return Math.round((e[1]-r)/t[1])}function b({scale:t,translate:e},r){return Math.round((r-e[0])/t[0])}function G({scale:t,translate:e},r){return Math.round((r-e[1])/t[1])}function I(t,e){return T(t,e,0)}function P(t,e){return T(t,-e,1)}function T({scale:t,translate:e},r,n){return r*t[n]+e[n]}function v(t,e,r){return e&&(t.hasZ=!0),r&&(t.hasM=!0),t}function Z(t,e,r,n){if(e&&n&&t!==r)return(e,r,n,o)=>{n[o++]=e[r++],n[o++]=e[r++],t?r++:n[o++]=0,n[o++]=e[r++]??0};const o=2+(r?1:0)+(n?1:0),s=o-((!t&&r?1:0)+(!e&&n?1:0));return(t,e,r,n)=>{for(let u=0;u<o;++u)r[n++]=u<s?t[e++]??0:0}}function N(t,e,r){if(!t)return null;const{coords:n,hasZ:o,hasM:s}=t,[u,i]=n,c=o?n[2]:0,l=s?n[2+(o?1:0)]:0;return{x:u,y:i,z:e?c:void 0,m:r?l:void 0}}function x(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({attributes:s,geometry:N(o,r,n)});return t}function F(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:u,centroid:i}=s,c=a(e),l=f(e);t.push(new h(e?j(e,r&&c,n&&l):null,u,i?j(i,!1,!1):null,g(s,o),s.displayId,s.distance,s.vertexCount))}return t}function j(t,e=a(t),r=f(t)){const{x:n,y:o,z:s,m:u}=t,i=[n,o];return e&&i.push(s??0),r&&i.push(u??0),new m([],i,e,r)}function k(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&E(o,r,n),attributes:s});return t}function E(t,e,r){if(null==t)return null;const{coords:n,stride:o,hasZ:s,hasM:u}=t,i=Z(s,u,e,r),c=[];for(let l=0;l<n.length;l+=o){const t=[];i(n,l,t,0),c.push(t)}return v({points:c},e,r)}function C(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:u}=s,i=a(e),c=f(e);t.push(new h(e?L(e,r&&i,n&&c):null,u,null,g(s,o),s.displayId,s.distance,s.vertexCount))}return t}function L(t,e=a(t),r=f(t)){const{points:n,hasZ:o,hasM:s}=t,u=new m([n.length],[],e,r),{coords:i,stride:c}=u;let l=0;const h=Z(o??!1,s??!1,e,r);for(const a of n)h(a,0,i,l),l+=c;return u}function U(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&z(o,r,n),attributes:s});return t}function z(t,e,r){if(!t)return null;const{coords:n,lengths:o,stride:s,hasZ:u,hasM:i}=t;let c=0;const l=Z(u,i,e,r),a=[];for(const f of o){const t=[];for(let e=0;e<f;e++){const e=[];l(n,c,e,0),c+=s,t.push(e)}a.push(t)}return v({paths:a},e,r)}function O(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:u,centroid:i}=s,c=a(e),l=f(e);t.push(new h(e?R(e,r&&c,n&&l):null,u,i?j(i,!1,!1):null,g(s,o),s.displayId,s.distance,s.vertexCount))}return t}function R(t,e=a(t),r=f(t)){const{paths:n,hasZ:o,hasM:s}=t,u=Z(o??!1,s??!1,e,r),i=new m([],[],e,r),{lengths:c,coords:l,stride:h}=i;let d=0;for(const a of n){for(const t of a)u(t,0,l,d),d+=h;c.push(a.length)}return i}function S(t,e,r,n){for(const{geometry:o,attributes:s,centroid:u}of e){const e=V(o,r,n),i=N(u,!1,!1);t.push(u?{geometry:e,attributes:s,centroid:i}:{geometry:e,attributes:s})}return t}function V(t,e,r){if(!t)return null;const{coords:n,lengths:o,stride:s,hasZ:u,hasM:i}=t;let c=0;const l=Z(u,i,e,r),a=[];for(const f of o){const t=[];for(let e=0;e<f;e++){const e=[];l(n,c,e,0),c+=s,t.push(e)}a.push(t)}return v({rings:a},e,r)}function Y(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:u,centroid:i}=s,c=a(e),l=f(e);t.push(new h(e?$(e,r&&c,n&&l):null,u,i?j(i,!1,!1):null,g(s,o),s.displayId,s.distance,s.vertexCount))}return t}function $(t,e=a(t),r=f(t)){const{rings:n,hasZ:o,hasM:s}=t,u=new m([],[],e,r),{lengths:i,coords:c,stride:l}=u;let h=0;const d=Z(o??!1,s??!1,e,r);for(const a of n){for(const t of a)d(t,0,c,h),h+=l;i.push(a.length)}return u}const _=[],q=[];function B(t,e,r,n,o){_[0]=t;const[s]=A(q,_,e,r,n,o);return ft(_),ft(q),s}function A(e,r,n,o,s,u){if(ft(e),!n){for(const t of r){const r=g(t,u);e.push(new h(null,t.attributes,null,r,void 0,t.distance,t.vertexCount))}return e}switch(n){case"esriGeometryPoint":return F(e,r,o,s,u);case"esriGeometryMultipoint":return C(e,r,o,s,u);case"esriGeometryPolyline":return O(e,r,o,s,u);case"esriGeometryPolygon":case"esriGeometryMultiPatch":return Y(e,r,o,s,u);default:y().error("convertToFeatureSet:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${n}'`)),ft(e)}return e}function D(t,e,r,n){q[0]=t,Q(_,q,e,r,n);const o=_[0];return ft(_),ft(q),o}function H(e,r=a(e),n=f(e)){return null==e?null:u(e)?j(e,r,n):i(e)?$(e,r,n):c(e)?R(e,r,n):l(e)?L(e,r,n):void y().error("convertFromGeometry:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${e}'`))}function J(e,r,n,o){if(null==e)return null;const s="coords"in e?e:e.geometry;if(null==s)return null;switch(r){case"esriGeometryPoint":return N(s,n,o);case"esriGeometryMultipoint":return E(s,n,o);case"esriGeometryPolyline":return z(s,n,o);case"esriGeometryPolygon":return V(s,n,o);default:return y().error("convertToGeometry:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${r}'`)),null}}function K(t,e){for(const r of e)t.push({attributes:r.attributes});return t}function Q(e,r,n,o,s){if(ft(e),null==n)return K(e,r);switch(n){case"esriGeometryPoint":return x(e,r,o,s);case"esriGeometryMultipoint":return k(e,r,o,s);case"esriGeometryPolyline":return U(e,r,o,s);case"esriGeometryPolygon":return S(e,r,o,s);default:y().error("convertToFeatureSet:unknown-geometry",new t("internal:geometry",`Unable to parse unknown geometry type '${n}'`))}return e}function W(t){const{spatialReference:e,transform:r,fields:n,hasM:o,hasZ:s,features:u,geometryType:i,exceededTransferLimit:c,queryGeometry:l,queryGeometryType:a}=t,f={features:Q([],u,i,s,o),fields:n,geometryType:i,spatialReference:e,queryGeometry:J(l,a,s,o)};return r&&(f.transform=r),c&&(f.exceededTransferLimit=c),o&&(f.hasM=o),s&&(f.hasZ=s),f}function X(t,e){const r=new d,{hasM:n,hasZ:o,features:s,spatialReference:u,geometryType:i,exceededTransferLimit:c,transform:l,fields:a,globalIdFieldName:f}=t;return a&&(r.fields=a),r.geometryType=i??null,r.spatialReference=u??null,s&&A(r.features,s,i,o,n,e),c&&(r.exceededTransferLimit=c),n&&(r.hasM=n),o&&(r.hasZ=o),l&&(r.transform=l),f&&(r.globalIdFieldName=f),r}function tt(t){const{transform:e,features:r}=t;if(!e)return t;for(const n of r)null!=n.geometry&&it(n.geometry,e),null!=n.centroid&&it(n.centroid,e);return t.transform=null,t}function et(t,e){const{geometryType:r,features:n}=e;if(!t)return e;for(let o=0;o<n.length;o++){const e=n[o],s=e.weakClone();s.geometry=rt(e.geometry,r,t),s.centroid=rt(e.centroid,"esriGeometryPoint",t),n[o]=s}return e.transform=t,e}function rt(t,e,r,n,o,s=!1){if(null==t)return null;if(!t?.coords.length)return null;const u=p[e],{coords:i,lengths:c,stride:l,hasZ:a,hasM:f}=t;n??=a,o??=f;const h=new m([],[],n,o),d=h.stride,g=Z(a,f,n,o);let y=0;const I=[0,0,0,0].slice(d),P=s?b:M,T=s?G:w;function v(){g(i,y,I,0),y+=l,I[0]=P(r,I[0]),I[1]=T(r,I[1])}if(t.isPoint)return v(),h.coords.push(...I),h;let N=0;for(const m of c){if(m<u)continue;let t=1;v(),h.coords.push(...I);let[e,r]=I;for(let n=1;n<m;n++){v();const[n,o]=I;e===n&&r===o||(s||(I[0]-=e,I[1]-=r),h.coords.push(...I),e=n,r=o,t++)}t>=u?(h.lengths.push(t),N=h.coords.length):ft(h.coords,N)}return ft(h.coords,N),h.coords.length?h:null}function nt(t,e,r,n=t.hasZ,o=t.hasM){if(!t.coords.length)return null;const s=p[e],{coords:u,lengths:i,stride:c,hasZ:l,hasM:a}=t,f=new m([],[],n,o),h=f.stride,d=Z(l,a,n,o);if(t.isPoint)return d(u,0,f.coords,0),f;let g=0;const y=r*r;for(const m of i){if(m<s){g+=m*c;continue}const t=f.coords.length/h,e=g,r=g+(m-1)*c;d(u,e,f.coords,f.coords.length),st(f.coords,u,c,y,d,e,r),d(u,r,f.coords,f.coords.length);const n=f.coords.length/h-t;n>=s?f.lengths.push(n):ft(f.coords,t*h),g+=m*c}return f.coords.length?f:null}function ot(t,e,r,n){const o=t[e],s=t[e+1],u=t[r],i=t[r+1],c=t[n],l=t[n+1];let a=u,f=i,h=c-a,d=l-f;if(0!==h||0!==d){const t=((o-a)*h+(s-f)*d)/(h*h+d*d);t>1?(a=c,f=l):t>0&&(a+=h*t,f+=d*t)}return h=o-a,d=s-f,h*h+d*d}function st(t,e,r,n,o,s,u){let i,c=n,l=0;for(let a=s+r;a<u;a+=r)i=ot(e,a,s,u),i>c&&(l=a,c=i);c>n&&(l-s>r&&st(t,e,r,n,o,s,l),o(e,l,t,t.length),u-l>r&&st(t,e,r,n,o,l,u))}function ut(t,e){if(!e?.coords?.length)return null;let r=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;const{coords:l,stride:a}=e;for(let n=0;n<l.length;n+=a){const t=l[n],e=l[n+1];r=Math.min(r,t),i=Math.max(i,t),u=Math.min(u,e),c=Math.max(c,e)}return n(t)?o(t,r,u,i,c):s(r,u,i,c,t),t}function it(t,e){const{coords:n,lengths:o,stride:s,hasZ:u,hasM:i}=t;if(!n.length)return void(o.length=0);r(e);const{originPosition:c,scale:l,translate:a}=e,f=ht;f.originPosition=c;const h=f.scale;h[0]=l[0]??1,h[1]=-(l[1]??1),h[2]=l[2]??1,h[3]=l[3]??1;const d=f.translate;if(d[0]=a[0]??0,d[1]=a[1]??0,d[2]=a[2]??0,d[3]=a[3]??0,i&&!u&&(h[2]=h[3],d[2]=d[3]),!o.length){for(let t=0;t<s;++t)n[t]=T(f,n[t],t);return void(o.length=0)}let m=0;for(let r=0;r<o.length;r++){const t=o[r];o[r]=t;for(let r=0;r<s;++r)n[m+r]=T(f,n[m+r],r);let e=n[m],u=n[m+1];m+=s;for(let r=1;r<t;r++,m+=s){e+=n[m]*h[0],u+=n[m+1]*h[1],n[m]=e,n[m+1]=u;for(let t=2;t<s;++t)n[m+t]=T(f,n[m+t],t)}}}function ct(t,e){if(!t?.coords?.length)return null;const r=p[e],{coords:n,lengths:o,stride:s,hasZ:u,hasM:i}=t,c=Z(u,i,u,i),l=new m([],[],u,i);let a=0,f=0,h=0,d=0;for(const m of o){f=d,c(n,a,l.coords,f),a+=s,f+=s;let t=n[a],e=n[a+1];for(let r=1;r<m;r++){const o=n[a+s],u=n[a+s+1];t*u-e*o===0&&r!==m-1||(c(n,a,l.coords,f),l.coords[f]=t,l.coords[f+1]=e,f+=s,t=e=0),t+=o,e+=u,a+=s}const o=(f-d)/s;o>=r&&(l.lengths[h]=o,d=f,h++)}return l.coords.length>d&&(l.coords.length=d),l.lengths.length>h&&(l.lengths.length=h),l.coords.length&&l.lengths.length?l:null}function lt(t,e,r,n){let o=0,s=t[n*e],u=t[n*(e+1)];for(let i=1;i<r;i++){const r=s+t[n*(e+i)],c=u+t[n*(e+i)+1],l=(r-s)*(c+u);s=r,u=c,o+=l}return.5*o}function at(t,e){const{coords:r,lengths:n}=t;let o=0,s=0;for(let u=0;u<n.length;u++){const t=n[u];s+=lt(r,o,t,e),o+=t}return Math.abs(s)}function ft(t,e=0){t.length!==e&&(t.length=e)}const ht={originPosition:"lowerLeft",scale:[1,1,1,1],translate:[0,0,0,0]};export{B as convertFromFeature,X as convertFromFeatureSet,A as convertFromFeatures,H as convertFromGeometry,L as convertFromMultipoint,C as convertFromMultipointFeatures,j as convertFromPoint,F as convertFromPointFeatures,$ as convertFromPolygon,R as convertFromPolyline,O as convertFromPolylineFeatures,D as convertToFeature,W as convertToFeatureSet,Q as convertToFeatures,J as convertToGeometry,E as convertToMultipoint,k as convertToMultipointFeatures,N as convertToPoint,V as convertToPolygon,z as convertToPolyline,nt as generalizeOptimizedGeometry,ut as getBoundsOptimizedGeometry,at as getQuantizedArea,lt as getSignedQuantizedRingArea,et as quantizeOptimizedFeatureSet,rt as quantizeOptimizedGeometry,M as quantizeX,w as quantizeY,ct as removeCollinearVertices,tt as unquantizeOptimizedFeatureSetInPlace,it as unquantizeOptimizedGeometryInPlace,T as unquantizeValue,I as unquantizeX,P as unquantizeY};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{parseDate as t}from"../../../../core/date.js";import{isValid as e}from"../../../../geometry/support/spatialReferenceUtils.js";import{validateFieldValue as n,validationErrorToString as r,isNumericField as o,isStringField as s,isDateField as i,sanitizeNullFieldValue as u}from"../../../support/fieldUtils.js";class l{constructor(t){this.description=t,this.code=null}}class a{constructor(t){this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error=new l(t)}}function p(t){return new a(t)}class c{constructor(t){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=t}}function f(t){return new c(t)}const g=new Set;function d(t,e,o,s=!1){g.clear();for(const i in o){const u=t.get(i);if(!u)continue;const l=m(u,o[i]);if(g.add(u.name),u&&(s||u.editable)){const t=n(u,l);if(t)return p(r(t,u,l));e[u.name]=l}}for(const n of t.requiredFields??[])if(!g.has(n.name))return p(`missing required field "${n.name}"`);return null}function m(e,n){let r=n;return o(e)&&"string"==typeof n?r=parseFloat(n):s(e)&&null!=n&&"string"!=typeof n?r=String(n):i(e)&&"string"==typeof n&&(r=t(n)),u(r)}let y;function h(t,n){if(!t||!e(n))return t;if("rings"in t||"paths"in t){if(null==y)throw new TypeError("geometry engine not loaded");return y.simplify(n,t)}return t}async function I(){return null==y&&(y=await import("../../../../geometry/geometryEngineJSON.js")),y}async function E(t,n){!e(t)||"esriGeometryPolygon"!==n&&"esriGeometryPolyline"!==n||await I()}const S={supportsAutoIntervalBin:!0,supportsFixedIntervalBin:!0,supportsFixedBoundariesBin:!0,supportsDateBin:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsNormalization:!0,supportedStatisticTypes:["COUNT","SUM","AVG","VAR","STDDEV","MIN","MAX","PERCENTILE_CONT","PERCENTILE_DISC","CentroidAggregate","EnvelopeAggregate","ConvexHullAggregate"],supportedNormalizationTypes:["field","log","naturalLog","percentOfTotal","squareRoot"]};export{p as createFeatureEditErrorResult,f as createFeatureEditSuccessResult,E as loadGeometryEngineForSimplify,d as mixAttributes,S as queryBinsCapabilities,h as simplify};
2
+ import{parseDate as t}from"../../../../core/date.js";import{isValid as e}from"../../../../geometry/support/spatialReferenceUtils.js";import{validateFieldValue as n,validationErrorToString as r,isNumericField as o,sanitizedParseFloat as i,isStringField as s,isDateField as u,sanitizeNullFieldValue as l}from"../../../support/fieldUtils.js";class a{constructor(t){this.description=t,this.code=null}}class c{constructor(t){this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error=new a(t)}}function p(t){return new c(t)}class f{constructor(t){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=t}}function g(t){return new f(t)}const d=new Set;function m(t,e,o,i=!1){d.clear();for(const s in o){const u=t.get(s);if(!u)continue;const l=y(u,o[s]);if(d.add(u.name),u&&(i||u.editable)){const t=n(u,l);if(t)return p(r(t,u,l));e[u.name]=l}}for(const n of t.requiredFields??[])if(!d.has(n.name))return p(`missing required field "${n.name}"`);return null}function y(e,n){let r=n;return o(e)&&"string"==typeof n?r=i(n):s(e)&&null!=n&&"string"!=typeof n?r=String(n):u(e)&&"string"==typeof n&&(r=t(n)),l(r)}let h;function I(t,n){if(!t||!e(n))return t;if("rings"in t||"paths"in t){if(null==h)throw new TypeError("geometry engine not loaded");return h.simplify(n,t)}return t}async function E(){return null==h&&(h=await import("../../../../geometry/geometryEngineJSON.js")),h}async function S(t,n){!e(t)||"esriGeometryPolygon"!==n&&"esriGeometryPolyline"!==n||await E()}const T={supportsAutoIntervalBin:!0,supportsFixedIntervalBin:!0,supportsFixedBoundariesBin:!0,supportsDateBin:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsNormalization:!0,supportedStatisticTypes:["COUNT","SUM","AVG","VAR","STDDEV","MIN","MAX","PERCENTILE_CONT","PERCENTILE_DISC","CentroidAggregate","EnvelopeAggregate","ConvexHullAggregate"],supportedNormalizationTypes:["field","log","naturalLog","percentOfTotal","squareRoot"]};export{p as createFeatureEditErrorResult,g as createFeatureEditSuccessResult,S as loadGeometryEngineForSimplify,m as mixAttributes,T as queryBinsCapabilities,I as simplify};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{getAssetUrl as e}from"../../../assets.js";const t=[{pixelType:"S8",size:1,ctor:Int8Array,range:[-128,127]},{pixelType:"U8",size:1,ctor:Uint8Array,range:[0,255]},{pixelType:"S16",size:2,ctor:Int16Array,range:[-32768,32767]},{pixelType:"U16",size:2,ctor:Uint16Array,range:[0,65536]},{pixelType:"S32",size:4,ctor:Int32Array,range:[-2147483648,2147483647]},{pixelType:"U32",size:4,ctor:Uint32Array,range:[0,4294967296]},{pixelType:"F32",size:4,ctor:Float32Array,range:[-34028234663852886e22,34028234663852886e22]},{pixelType:"F64",size:8,ctor:Float64Array,range:[-17976931348623157e292,17976931348623157e292]}];let n=null;function r(){return n||(n=import("../../../chunks/lerc-wasm.js").then(({default:t})=>t({locateFile:t=>e(`esri/layers/raster/formats/${t}`)})).then(e=>{s(e)}),n)}const a={getBlobInfo:null,decode:null};function l(e){return 16+(e>>3<<3)}function o(e,t,n){n.set(e.slice(t,t+n.length))}function s(e){const{_malloc:n,_free:r,memory:s,_lerc_getBlobInfo:i,_lerc_getDataRanges:u,_lerc_decode_4D:c}=e;let f;const y=e=>{const t=e.map(e=>l(e)),r=t.reduce((e,t)=>e+t),a=n(r);f=new Uint8Array(s.buffer);let o=t[0];t[0]=a;for(let n=1;n<t.length;n++){const e=t[n];t[n]=t[n-1]+o,o=e}return t};a.getBlobInfo=e=>{const t=12,n=3,a=new Uint8Array(4*t),l=new Uint8Array(8*n),[c,p,h]=y([e.length,a.length,l.length]);f.set(e,c),f.set(a,p),f.set(l,h);let d=i(c,e.length,p,h,t,n);if(d)throw r(c),new Error(`lerc-getBlobInfo: error code is ${d}`);f=new Uint8Array(s.buffer),o(f,p,a),o(f,h,l);const g=new Uint32Array(a.buffer),w=new Float64Array(l.buffer),[b,A,,m,x,U,C,T,V,D,z]=g,I=0===C,k={version:b,depthCount:D,width:m,height:x,validPixelCount:C,bandCount:U,blobSize:T,maskCount:V,dataType:A,minValue:w[0],maxValue:w[1],maxZerror:w[2],statistics:[],bandCountWithNoData:z};if(z&&D>1)return r(c),k;if(1===D&&1===U){r(c);const e=I?0:w[0],t=I?0:w[1];return k.statistics.push({minValue:e,maxValue:t}),k}const F=D*U*8,_=new Uint8Array(F),v=new Uint8Array(F);let B=c,P=0,S=0,$=!1;if(f.byteLength<c+2*F?(r(c),$=!0,[B,P,S]=y([e.length,F,F]),f.set(e,B)):[P,S]=y([F,F]),f.set(_,P),f.set(v,S),d=u(B,e.length,D,U,P,S),d)throw r(B),$||r(P),new Error(`lerc-getDataRanges: error code is ${d}`);f=new Uint8Array(s.buffer),o(f,P,_),o(f,S,v);const E=new Float64Array(_.buffer),M=new Float64Array(v.buffer),O=k.statistics;for(let r=0;r<U;r++)if(D>1){const e=E.slice(r*D,(r+1)*D),t=M.slice(r*D,(r+1)*D),n=I?0:Math.min.apply(null,e),a=I?0:Math.max.apply(null,t);O.push({minValue:n,maxValue:a,depthStats:{minValues:e,maxValues:t}})}else O.push({minValue:I?0:E[r],maxValue:I?0:M[r]});return r(B),$||r(P),k},a.decode=(e,n)=>{const{maskCount:a,depthCount:l,bandCount:i,width:u,height:p,dataType:h,bandCountWithNoData:d,validPixelCount:g}=n,w=t[h],b=u*p,A=new Uint8Array(b*i),m=b*l*i*w.size,x=new Uint8Array(m),U=new Uint8Array(i),C=new Uint8Array(8*i);if(0===g)return{data:x,maskData:A,noDataValues:null};const[T,V,D,z,I]=y([e.length,A.length,x.length,U.length,C.length]);f.set(e,T),f.set(A,V),f.set(x,D),f.set(U,z),f.set(C,I);const k=c(T,e.length,a,V,l,u,p,i,h,D,z,I);if(k)throw r(T),new Error(`lerc-decode: error code is ${k}`);f=new Uint8Array(s.buffer),o(f,D,x),o(f,V,A);let F=null;if(d){o(f,z,U),o(f,I,C),F=[];const e=new Float64Array(C.buffer);for(let t=0;t<U.length;t++)F.push(U[t]?e[t]:null)}return r(T),{data:x,maskData:A,noDataValues:F}}}function i(e,t,n,r,a){if(n<2)return e;const l=new r(t*n);for(let o=0,s=0;o<t;o++)for(let r=0,a=o;r<n;r++,a+=t)l[a]=e[s++];return l}function u(e,n={}){const r=n.inputOffset??0,l=e instanceof Uint8Array?e.subarray(r):new Uint8Array(e,r),o=a.getBlobInfo(l),{data:s,maskData:u,noDataValues:c}=a.decode(l,o),{width:f,height:y,bandCount:p,depthCount:h,dataType:d,maskCount:g,statistics:w}=o,b=t[d],A=new b.ctor(s.buffer),m=[],x=[],U=f*y,C=U*h,T=t.find(e=>e.pixelType===n.outputPixelType)??b,V=T.pixelType!==b.pixelType;for(let t=0;t<p;t++){const e=t*C,r=e+C,a=A.subarray(e,r),l=V?new T.ctor(a):a;if(n.returnInterleaved)m.push(l);else{const e=i(l,U,h,T.ctor);m.push(e)}x.push(u.subarray(e,r))}const D=0===g?null:1===g?x[0]:new Uint8Array(U);if(g>1){D.set(x[0]);for(let e=1;e<x.length;e++){const t=x[e];for(let e=0;e<U;e++)D[e]=D[e]&t[e]}}const{noDataValue:z}=n,I=null!=z&&T.range[0]<=z&&T.range[1]>=z,{validPixelCount:k}=o;if(g>0&&I)for(let t=0;t<p;t++){const e=m[t];if(0===k)e.fill(z);else{const n=x[t]||D;for(let t=0;t<U;t++)0===n[t]&&(e[t]=z)}}const F=g===p&&p>1?x:null;return{width:f,height:y,bandCount:p,pixelType:T.pixelType,depthCount:h,statistics:w,pixels:m,mask:D,validPixelCount:k,bandMasks:F,noDataValues:c}}function c(e,t={}){const n=e instanceof Uint8Array?e.subarray(t.inputOffset??0):new Uint8Array(e,t.inputOffset??0);return a.getBlobInfo(n)}export{u as decode,c as getBlobInfo,r as load,t as pixelTypeInfoMap};
2
+ import{getAssetUrl as e}from"../../../assets.js";const t=[{pixelType:"S8",size:1,ctor:Int8Array,range:[-128,127]},{pixelType:"U8",size:1,ctor:Uint8Array,range:[0,255]},{pixelType:"S16",size:2,ctor:Int16Array,range:[-32768,32767]},{pixelType:"U16",size:2,ctor:Uint16Array,range:[0,65536]},{pixelType:"S32",size:4,ctor:Int32Array,range:[-2147483648,2147483647]},{pixelType:"U32",size:4,ctor:Uint32Array,range:[0,4294967296]},{pixelType:"F32",size:4,ctor:Float32Array,range:[-34028234663852886e22,34028234663852886e22]},{pixelType:"F64",size:8,ctor:Float64Array,range:[-17976931348623157e292,17976931348623157e292]}];let n=null;function r(){return n||(n=import("../../../chunks/lerc-wasm.js").then(({default:t})=>t({locateFile:t=>e(`esri/layers/raster/formats/${t}`)})).then(e=>{s(e)}),n)}const a={getBlobInfo:null,decode:null};function l(e){return 16+(e>>3<<3)}function o(e,t,n){n.set(e.slice(t,t+n.length))}function s(e){const{_malloc:n,_free:r,memory:s,_lerc_getBlobInfo:i,_lerc_getDataRanges:u,_lerc_decode_4D:c}=e;let f;const p=e=>{const t=e.map(e=>l(e)),r=t.reduce((e,t)=>e+t),a=n(r);f=new Uint8Array(s.buffer);let o=t[0];t[0]=a;for(let n=1;n<t.length;n++){const e=t[n];t[n]=t[n-1]+o,o=e}return t};a.getBlobInfo=e=>{const t=12,n=3,a=new Uint8Array(4*t),l=new Uint8Array(8*n),[c,y,h]=p([e.length,a.length,l.length]);f.set(e,c),f.set(a,y),f.set(l,h);let d=i(c,e.length,y,h,t,n);if(d)throw r(c),new Error(`lerc-getBlobInfo: error code is ${d}`);f=new Uint8Array(s.buffer),o(f,y,a),o(f,h,l);const g=new Uint32Array(a.buffer),w=new Float64Array(l.buffer),[m,b,,A,x,U,C,T,V,D,z]=g,k=0===C,F={version:m,depthCount:D,width:A,height:x,validPixelCount:C,bandCount:U,blobSize:T,maskCount:V,dataType:b,minValue:w[0],maxValue:w[1],maxZerror:w[2],statistics:[],bandCountWithNoData:z};if(z&&D>1)return r(c),F;if(1===D&&1===U){r(c);const e=k?0:w[0],t=k?0:w[1];return F.statistics.push({minValue:e,maxValue:t}),F}const I=D*U*8,_=new Uint8Array(I),v=new Uint8Array(I);let B=c,P=0,S=0,$=!1;if(f.byteLength<c+2*I?(r(c),$=!0,[B,P,S]=p([e.length,I,I]),f.set(e,B)):[P,S]=p([I,I]),f.set(_,P),f.set(v,S),d=u(B,e.length,D,U,P,S),d)throw r(B),$||r(P),new Error(`lerc-getDataRanges: error code is ${d}`);f=new Uint8Array(s.buffer),o(f,P,_),o(f,S,v);const E=new Float64Array(_.buffer),M=new Float64Array(v.buffer),j=F.statistics;for(let r=0;r<U;r++)if(D>1){const e=E.slice(r*D,(r+1)*D),t=M.slice(r*D,(r+1)*D),n=k?0:Math.min.apply(null,e),a=k?0:Math.max.apply(null,t);j.push({minValue:n,maxValue:a,depthStats:{minValues:e,maxValues:t}})}else j.push({minValue:k?0:E[r],maxValue:k?0:M[r]});return r(B),$||r(P),F},a.decode=(e,n)=>{const{maskCount:a,depthCount:l,bandCount:i,width:u,height:y,dataType:h,bandCountWithNoData:d,validPixelCount:g}=n,w=t[h],m=u*y,b=new Uint8Array(m*i),A=m*l*i*w.size,x=new Uint8Array(A),U=new Uint8Array(i),C=new Uint8Array(8*i);if(0===g)return{data:x,maskData:b,noDataValues:null};const[T,V,D,z,k]=p([e.length,b.length,x.length,U.length,C.length]);f.set(e,T),f.set(b,V),f.set(x,D),f.set(U,z),f.set(C,k);const F=c(T,e.length,a,V,l,u,y,i,h,D,z,k);if(F)throw r(T),new Error(`lerc-decode: error code is ${F}`);f=new Uint8Array(s.buffer),o(f,D,x),o(f,V,b);let I=null;if(d){o(f,z,U),o(f,k,C),I=[];const e=new Float64Array(C.buffer);for(let t=0;t<U.length;t++)I.push(U[t]?e[t]:null)}return r(T),{data:x,maskData:b,noDataValues:I}}}function i(e,t,n,r,a){if(n<2)return e;const l=new r(t*n);for(let o=0,s=0;o<t;o++)for(let r=0,a=o;r<n;r++,a+=t)l[a]=e[s++];return l}function u(e,n={}){const r=n.inputOffset??0,l=e instanceof Uint8Array?e.subarray(r):new Uint8Array(e,r),o=a.getBlobInfo(l),{data:s,maskData:u,noDataValues:c}=a.decode(l,o),{width:f,height:p,bandCount:y,depthCount:h,dataType:d,maskCount:g,statistics:w}=o,m=t[d],b=new m.ctor(s.buffer),A=[],x=[],U=f*p,C=U*h,T=t.find(e=>e.pixelType===n.outputPixelType)??m,V=T.pixelType!==m.pixelType;for(let t=0;t<y;t++){const e=t*C,r=e+C,a=b.subarray(e,r),l=V?new T.ctor(a):a;if(n.returnInterleaved)A.push(l);else{const e=i(l,U,h,T.ctor);A.push(e)}x.push(u.subarray(e,r))}const D=0===g?null:1===g?x[0]:new Uint8Array(U);if(g>1){D.set(x[0]);for(let e=1;e<x.length;e++){const t=x[e];for(let e=0;e<U;e++)D[e]=D[e]&t[e]}}const{noDataValue:z}=n,k=null!=z&&T.range[0]<=z&&T.range[1]>=z,{validPixelCount:F}=o;if(g>0&&k)for(let t=0;t<y;t++){const e=A[t];if(0===F)e.fill(z);else{const n=x[t]||D;for(let t=0;t<U;t++)0===n[t]&&(e[t]=z)}}const I=g===y&&y>1?x:null;return{width:f,height:p,bandCount:y,pixelType:T.pixelType,depthCount:h,statistics:w,pixels:A,mask:D,validPixelCount:F,bandMasks:I,noDataValues:c}}export{u as decode,r as load,t as pixelTypeInfoMap};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../core/Error.js";import{getDeepValue as n,setDeepValue as i}from"../../core/object.js";import{union as t}from"../../core/SetUtils.js";import{parseWhereClause as r}from"../../core/sql.js";import{getDomainRange as l}from"./domainUtils.js";import{getFieldNameFromSimpleExpression as o}from"../../support/arcadeExpressionUtils.js";import{isStringOrNull as s,isString as a}from"../../support/guards.js";import{loadArcade as u}from"../../support/loadArcade.js";const f=/^([0-9_])/,c=/[^a-z0-9_\u0080-\uffff]+/gi;function d(e){if(null==e)return null;return e.trim().replaceAll(c,"_").replace(f,"F$1")||null}const p=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],m=["field","normalizationField"];function y(e,n){if(null!=e&&null!=n)for(const i of Array.isArray(e)?e:[e])if(g(p,i,n),"visualVariables"in i&&i.visualVariables)for(const e of i.visualVariables)g(m,e,n)}function g(e,t,r){if(e)for(const l of e){const e=n(l,t),o=e&&"function"!=typeof e&&r.get(e);o&&i(l,o.name,t)}}function F(e,n){if(null!=e&&n?.fields?.length)if("startField"in e){const i=n.get(e.startField),t=n.get(e.endField);e.startField=i?.name??null,e.endField=t?.name??null}else{const i=n.get(e.startTimeField),t=n.get(e.endTimeField);e.startTimeField=i?.name??null,e.endTimeField=t?.name??null}}const b=new Set;function I(e,n){return e&&n?(b.clear(),w(b,e,n),Array.from(b).sort()):[]}function w(e,n,i){if(i)if(n?.fields?.length)if(i.includes("*"))for(const{name:t}of n.fields)e.add(t);else for(const t of i)x(e,n,t);else{if(i.includes("*"))return e.clear(),void e.add("*");for(const n of i)null!=n&&e.add(n)}}function x(e,n,i){if("string"==typeof i)if(n){const t=n.get(i);t&&e.add(t.name)}else e.add(i)}function T(e,n){return null==n||null==e?[]:n.includes("*")?(e.fields??[]).map(e=>e.name):n}function h(e,n,i=1){if(!n||!e)return[];if(n.includes("*"))return["*"];const t=I(e,n);return t.length/e.fields.length>=i?["*"]:t}async function v(e,n,i,t){if(!t)return;const r=o(t);if(r)x(e,n,r);else{const{arcadeUtils:r}=await u(),l=r.extractFieldNames(t,i?.partitions??n?.fields?.map(e=>e.name));for(const t of l)x(e,i?.index??n,t)}}async function S(n,i,t){if(t&&"1=1"!==t){const l=await r(t,i);if(!l.isStandardized)throw new e("fieldUtils:collectFilterFields","Where clause is not standardized",{where:t});w(n,i,l.fieldNames)}}function E({displayField:e,fields:n}){return e||(n?.length?A(n):null)}function A(e){return _(e,"name-or-title")||_(e,"unique-identifier")||_(e,"type-or-category")||$(e)}function $(e){for(const n of e){if(!n?.name)continue;const e=n.name.toLowerCase();if(e.includes("name")||e.includes("title"))return n.name}return null}function _(e,n){for(const i of e)if(i?.valueType&&i.valueType===n)return i.name;return null}async function N(e){if(!e)return[];const n=new Set;return await L(n,e),Array.from(n).sort()}async function L(e,n){if(!n)return;const i=n.elevationInfo?.featureExpressionInfo;return i?i.collectRequiredFields(e,n.fieldsIndex):void 0}function M(e,n,i){i.onStatisticExpression?v(e,n,null,i.onStatisticExpression.expression):e.add(i.onStatisticField)}async function j(e,n,i){if(!n||!i||!("fields"in i))return;const t=[],r=i.popupTemplate;t.push(O(e,n,r)),i.fields&&t.push(...i.fields.map(async i=>M(e,n.fieldsIndex,i))),await Promise.all(t)}async function D(e,n){const{fieldsIndex:i,trackInfo:t}=n;if(!n||!t||!i)return;const r=[t.latestObservations.renderer?.collectRequiredFields(e,i),t.previousObservations.renderer?.collectRequiredFields(e,i),t.trackLines.renderer?.collectRequiredFields(e,i)];t.popupTemplate&&r.push(O(e,n,t.popupTemplate));for(const l of[t.latestObservations.labelingInfo,t.previousObservations.labelingInfo,t.trackLines.labelingInfo])if(l)for(const n of l)r.push(ee(e,i,n));await Promise.all(r)}async function O(e,n,i){const t=[];i?.expressionInfos&&t.push(...i.expressionInfos.map(i=>v(e,n.fieldsIndex,null,i.expression)));const r=i?.content;if(Array.isArray(r))for(const l of r)"expression"===l.type&&l.expressionInfo&&t.push(v(e,n.fieldsIndex,null,l.expressionInfo.expression));await Promise.all(t)}async function C(e,n,i){n&&(n.timeInfo&&i?.timeExtent&&w(e,n.fieldsIndex,[n.timeInfo.startField,n.timeInfo.endField]),n.floorInfo&&w(e,n.fieldsIndex,[n.floorInfo.floorField]),null!=i?.where&&await S(e,n.fieldsIndex,i.where))}async function R(e,n,i){n&&i&&await Promise.all(i.map(i=>V(e,n,i)))}async function V(e,n,i){n&&i&&(i.valueExpression?await v(e,n.fieldsIndex,null,i.valueExpression):i.field&&x(e,n.fieldsIndex,i.field))}async function k(e){if(!e)return[];const n="timeInfo"in e&&e.timeInfo;return n?I(e.fieldsIndex,[e.trackIdField,n.startField,n.endField]):[]}function U(e){return e?I(e.fieldsIndex,J(e)):[]}function q(e){if(!e)return[];const n=e.geometryFieldsInfo;return n?I(e.fieldsIndex,[n.shapeAreaField,n.shapeLengthField]):[]}async function z(e,n,i){if(!n||!i)return;const t=n.fieldsIndex;await Promise.all(i.filters.map(n=>S(e,t,n.where)))}const X=new Set(["oid","global-id","guid"]),P=new Set(["oid","global-id"]),B=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/objectid/i,/^perimeter_/i,/_perimeter$/i,/_i$/i];function G(e){const n=new Set;W(e).forEach(e=>n.add(e)),q(e).forEach(e=>n.add(e.toLowerCase()));const i=e&&"infoFor3D"in e?e.infoFor3D:void 0;return i&&(Object.values(i.assetMapFieldRoles).forEach(e=>n.add(e.toLowerCase())),Object.values(i.transformFieldRoles).forEach(e=>n.add(e.toLowerCase()))),Array.from(n)}function J(e){if(!e)return[];const n="editFieldsInfo"in e&&e.editFieldsInfo;if(!n)return[];const{creationDateField:i,creatorField:t,editDateField:r,editorField:l}=n;return[i,t,r,l].filter(Boolean)}function W(e){return J(e).map(e=>e.toLowerCase())}function H(e){return!!e.type}function K(e,n){return!!e.editable&&H(e)&&!X.has(e.type)&&!W(n).includes(e.name?.toLowerCase()??"")}function Q(e,n){const i=e.name?.toLowerCase()??"";return!(null!=n?.objectIdField&&i===n.objectIdField.toLowerCase()||null!=n?.globalIdField&&i===n.globalIdField.toLowerCase()||G(n).includes(i)||P.has(e.type)||B.some(e=>e.test(i)))}async function Y(e){if(!e)return[];const n=new Set;return await Z(n,e),Array.from(n).sort()}async function Z(e,n){const{labelingInfo:i,fieldsIndex:t}=n;i?.length&&await Promise.all(i.map(n=>ee(e,t,n)))}async function ee(e,n,i){if(!i)return;const t=i.getLabelExpression(),r=i.where;if("arcade"===t.type)await v(e,n,null,t.expression);else{const i=t.expression.match(/{[^}]*}/g);i&&i.forEach(i=>{x(e,n,i.slice(1,-1))})}await S(e,n,r)}function ne(e){const n=e.defaultValue;return void 0!==n&&se(e,n)?n:e.nullable?null:void 0}function ie(e){const n="string"==typeof e?{type:e}:e;return be(n)?255:"esriFieldTypeDate"===n.type||"date"===n.type?8:void 0}function te(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function re(e){return null===e||te(e)}function le(e){return null===e||Number.isInteger(e)}function oe(){return!0}function se(e,n){let i;switch(e.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":i=e.nullable?le:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=e.nullable?re:te;break;case"string":case"esriFieldTypeString":i=e.nullable?s:a;break;default:i=oe}return 1===arguments.length?i:i(n)}const ae=["integer","small-integer","big-integer","long"],ue=["single","double"],fe=[...ae,...ue],ce=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeLong","esriFieldTypeBigInteger"],de=["esriFieldTypeSingle","esriFieldTypeDouble"],pe=new Set([...ae,...ce]),me=new Set([...ue,...de]),ye=t(pe,me);function ge(e){return null!=e&&pe.has(e.type)}function Fe(e){return null!=e&&ye.has(e.type)}function be(e){return null!=e&&("string"===e.type||"esriFieldTypeString"===e.type)}function Ie(e){return null!=e&&("date"===e.type||"esriFieldTypeDate"===e.type)}function we(e){return null!=e&&("date-only"===e.type||"esriFieldTypeDateOnly"===e.type)}function xe(e){return null!=e&&("timestamp-offset"===e.type||"esriFieldTypeTimestampOffset"===e.type)}function Te(e){return null!=e&&("time-only"===e.type||"esriFieldTypeTimeOnly"===e.type)}function he(e){return null!=e&&("date"===e.type||"date-only"===e.type||"time-only"===e.type||"timestamp-offset"===e.type)}function ve(e){return null!=e&&("oid"===e.type||"esriFieldTypeOID"===e.type)}function Se(e){return null!=e&&("global-id"===e.type||"esriFieldTypeGlobalID"===e.type)}function Ee(e,n){return null===$e(e,n)}function Ae(e){return null==e||"number"==typeof e&&isNaN(e)?null:e}function $e(e,n){return null==e||e.nullable&&null===n?null:se(e,n)?Fe(e)&&!_e(e.type,Number(n))?"numeric-range-validation-error::out-of-range":null:"type-validation-error::invalid-type"}function _e(e,n){const i="string"==typeof e?Le(e):e;if(!i)return!1;const t=i.min,r=i.max;return i.isInteger?Number.isInteger(n)&&n>=t&&n<=r:n>=t&&n<=r}function Ne(e,n){const i=l(e,n);return i||(Fe(e)?Le(e.type):void 0)}function Le(e){switch(e){case"esriFieldTypeSmallInteger":case"small-integer":return je;case"esriFieldTypeInteger":case"esriFieldTypeLong":case"integer":case"long":return De;case"esriFieldTypeBigInteger":case"big-integer":return Oe;case"esriFieldTypeSingle":case"single":return Re;case"esriFieldTypeDouble":case"double":return Ve}}function Me(e){if(!te(e))return null;if(Number.isInteger(e)){if(e>=je.min&&e<=je.max)return"esriFieldTypeSmallInteger";if(e>=De.min&&e<=De.max)return"esriFieldTypeInteger";if(e>=Oe.min&&e<=Oe.max)return"esriFieldTypeBigInteger"}return e>=Re.min&&e<=Re.max?"esriFieldTypeSingle":"esriFieldTypeDouble"}const je={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},De={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},Oe={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},Ce=(2-2**-23)*2**127,Re={min:-Ce,max:Ce,isInteger:!1,rawMin:-Ce,rawMax:Ce},Ve={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function ke(e,n,i){switch(e){case"domain-validation-error::invalid-coded-value":return`Value ${i} is not in the coded domain - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case"domain-validation-error::value-out-of-range":return`Value ${i} is out of the range of valid values - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case"type-validation-error::invalid-type":return`Value ${i} is not a valid value for the field type - field: ${n.name}, type: ${n.type}, nullable: ${n.nullable}`;case"numeric-range-validation-error::out-of-range":{const{min:e,max:t}=Le(n.type);return`Value ${i} is out of range for the number type - field: ${n.name}, type: ${n.type}, value range is ${e} to ${t}`}}}function Ue(e,n){return!qe(e,n,null)}function qe(e,n,i){if(!e?.attributes||!n){if(null!=i)for(const e of n??[])i.add(e);return!0}const t=new Set(Object.keys(e.attributes));let r=!1;for(const l of n)if(!t.has(l)){if(r=!0,null==i)break;i.add(l)}return r}async function ze(e,n){const i=new Set;for(const t of n)await v(i,e.fieldsIndex,null,t);return Array.from(i).sort()}function Xe(e){return!!e&&["raster.itempixelvalue","raster.servicepixelvalue"].some(n=>e.toLowerCase().startsWith(n))}async function Pe(e,n){const i=new Set;return e?.collectRequiredFields&&await e.collectRequiredFields(i,n),Array.from(i).sort()}function Be(e){const n=e?.match(/{[^}]+}/g);return n?n.map(e=>e.slice(1,-1).split(":")[0].trim()):[]}function Ge(e,n){const{statisticType:i,onStatisticField:t,onStatisticExpression:r}=e,l=n.get(t),o=Fe(l),s=r?.returnType;switch(i){case"avg":case"avg_angle":return l?o||Ie(l)?"double":null:s&&"number"===s?"double":null;case"count":return"integer";case"min":case"max":return l?o||he(l)?l?.type??null:null:s&&"number"===s?"double":null;case"sum":return l?o?l?.type??null:null:s&&"number"===s?"double":null;case"mode":return l?l?.type??null:s?"number"===s?"double":"string":null;default:return null}}function Je(e){const{fieldName:n,fieldsMap:i,normalizedFieldsMap:t}=e;if(!n)return;let r=i.get(n);return r||(r=i.get(We(n))??t.get(He(n)),r&&i.set(n,r),r)}function We(e){return e.trim().toLowerCase()}function He(e){return d(e)?.toLowerCase()??""}export{We as applyLowerCaseFieldName,Oe as bigIntegerRange,v as collectArcadeFieldNames,z as collectDisplayFilterFields,L as collectElevationFields,j as collectFeatureReductionFields,x as collectField,w as collectFields,C as collectFilterFields,Z as collectLabelingFields,R as collectOrderByInfos,O as collectPopupTemplateFields,S as collectSQLFieldNames,D as collectTrackInfoFields,Ve as doubleRange,Be as extractSubstitutionTemplatesFromString,Ue as featureHasFields,I as fixFields,y as fixRendererFields,F as fixTimeInfoFields,de as floatJSONTypes,ue as floatTypes,Ge as getAggregateFieldType,E as getDisplayFieldName,A as getDisplayFieldNameFromFields,J as getEditTrackingFields,N as getElevationFields,ze as getExpressionFields,U as getFeatureEditFields,q as getFeatureGeometryFields,ie as getFieldDefaultLength,ne as getFieldDefaultValue,Je as getFieldFromIndex,Ne as getFieldRange,Y as getLabelingFields,G as getLowerCaseDefaultHiddenFields,W as getLowerCaseEditTrackingFields,Me as getNumericTypeForValue,Pe as getRendererFields,k as getTimeFields,ce as integerJSONTypes,De as integerRange,ae as integerTypes,Ie as isDateField,we as isDateOnlyField,K as isFieldEditable,Q as isFieldVisibleByDefault,H as isFieldWithType,Se as isGlobalIDField,ge as isIntegerField,_e as isNumberInRange,Fe as isNumericField,ve as isObjectIDField,Xe as isRasterPixelValueField,be as isStringField,Te as isTimeOnlyField,xe as isTimestampOffsetField,Ee as isValidFieldValue,se as isValueMatchingFieldType,He as lowerCaseNormalizedFieldName,d as normalizeFieldName,fe as numericTypes,h as packFields,qe as populateMissingFields,p as rendererFields,Ae as sanitizeNullFieldValue,Re as singleRange,je as smallIntegerRange,T as unpackFieldNames,$e as validateFieldValue,ke as validationErrorToString,m as visualVariableFields};
2
+ import e from"../../core/Error.js";import{getDeepValue as n,setDeepValue as i}from"../../core/object.js";import{union as t}from"../../core/SetUtils.js";import{parseWhereClause as r}from"../../core/sql.js";import{getDomainRange as l}from"./domainUtils.js";import{getFieldNameFromSimpleExpression as o}from"../../support/arcadeExpressionUtils.js";import{isStringOrNull as s,isString as a}from"../../support/guards.js";import{loadArcade as u}from"../../support/loadArcade.js";const f=/^([0-9_])/,c=/[^a-z0-9_\u0080-\uffff]+/gi;function d(e){if(null==e)return null;return e.trim().replaceAll(c,"_").replace(f,"F$1")||null}const p=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],m=["field","normalizationField"];function y(e,n){if(null!=e&&null!=n)for(const i of Array.isArray(e)?e:[e])if(g(p,i,n),"visualVariables"in i&&i.visualVariables)for(const e of i.visualVariables)g(m,e,n)}function g(e,t,r){if(e)for(const l of e){const e=n(l,t),o=e&&"function"!=typeof e&&r.get(e);o&&i(l,o.name,t)}}function F(e,n){if(null!=e&&n?.fields?.length)if("startField"in e){const i=n.get(e.startField),t=n.get(e.endField);e.startField=i?.name??null,e.endField=t?.name??null}else{const i=n.get(e.startTimeField),t=n.get(e.endTimeField);e.startTimeField=i?.name??null,e.endTimeField=t?.name??null}}const b=new Set;function I(e,n){return e&&n?(b.clear(),w(b,e,n),Array.from(b).sort()):[]}function w(e,n,i){if(i)if(n?.fields?.length)if(i.includes("*"))for(const{name:t}of n.fields)e.add(t);else for(const t of i)x(e,n,t);else{if(i.includes("*"))return e.clear(),void e.add("*");for(const n of i)null!=n&&e.add(n)}}function x(e,n,i){if("string"==typeof i)if(n){const t=n.get(i);t&&e.add(t.name)}else e.add(i)}function T(e,n){return null==n||null==e?[]:n.includes("*")?(e.fields??[]).map(e=>e.name):n}function h(e,n,i=1){if(!n||!e)return[];if(n.includes("*"))return["*"];const t=I(e,n);return t.length/e.fields.length>=i?["*"]:t}async function v(e,n,i,t){if(!t)return;const r=o(t);if(r)x(e,n,r);else{const{arcadeUtils:r}=await u(),l=r.extractFieldNames(t,i?.partitions??n?.fields?.map(e=>e.name));for(const t of l)x(e,i?.index??n,t)}}async function S(n,i,t){if(t&&"1=1"!==t){const l=await r(t,i);if(!l.isStandardized)throw new e("fieldUtils:collectFilterFields","Where clause is not standardized",{where:t});w(n,i,l.fieldNames)}}function E({displayField:e,fields:n}){return e||(n?.length?A(n):null)}function A(e){return _(e,"name-or-title")||_(e,"unique-identifier")||_(e,"type-or-category")||$(e)}function $(e){for(const n of e){if(!n?.name)continue;const e=n.name.toLowerCase();if(e.includes("name")||e.includes("title"))return n.name}return null}function _(e,n){for(const i of e)if(i?.valueType&&i.valueType===n)return i.name;return null}async function N(e){if(!e)return[];const n=new Set;return await L(n,e),Array.from(n).sort()}async function L(e,n){if(!n)return;const i=n.elevationInfo?.featureExpressionInfo;return i?i.collectRequiredFields(e,n.fieldsIndex):void 0}function M(e,n,i){i.onStatisticExpression?v(e,n,null,i.onStatisticExpression.expression):e.add(i.onStatisticField)}async function j(e,n,i){if(!n||!i||!("fields"in i))return;const t=[],r=i.popupTemplate;t.push(O(e,n,r)),i.fields&&t.push(...i.fields.map(async i=>M(e,n.fieldsIndex,i))),await Promise.all(t)}async function D(e,n){const{fieldsIndex:i,trackInfo:t}=n;if(!n||!t||!i)return;const r=[t.latestObservations.renderer?.collectRequiredFields(e,i),t.previousObservations.renderer?.collectRequiredFields(e,i),t.trackLines.renderer?.collectRequiredFields(e,i)];t.popupTemplate&&r.push(O(e,n,t.popupTemplate));for(const l of[t.latestObservations.labelingInfo,t.previousObservations.labelingInfo,t.trackLines.labelingInfo])if(l)for(const n of l)r.push(ee(e,i,n));await Promise.all(r)}async function O(e,n,i){const t=[];i?.expressionInfos&&t.push(...i.expressionInfos.map(i=>v(e,n.fieldsIndex,null,i.expression)));const r=i?.content;if(Array.isArray(r))for(const l of r)"expression"===l.type&&l.expressionInfo&&t.push(v(e,n.fieldsIndex,null,l.expressionInfo.expression));await Promise.all(t)}async function C(e,n,i){n&&(n.timeInfo&&i?.timeExtent&&w(e,n.fieldsIndex,[n.timeInfo.startField,n.timeInfo.endField]),n.floorInfo&&w(e,n.fieldsIndex,[n.floorInfo.floorField]),null!=i?.where&&await S(e,n.fieldsIndex,i.where))}async function R(e,n,i){n&&i&&await Promise.all(i.map(i=>V(e,n,i)))}async function V(e,n,i){n&&i&&(i.valueExpression?await v(e,n.fieldsIndex,null,i.valueExpression):i.field&&x(e,n.fieldsIndex,i.field))}async function k(e){if(!e)return[];const n="timeInfo"in e&&e.timeInfo;return n?I(e.fieldsIndex,[e.trackIdField,n.startField,n.endField]):[]}function U(e){return e?I(e.fieldsIndex,J(e)):[]}function q(e){if(!e)return[];const n=e.geometryFieldsInfo;return n?I(e.fieldsIndex,[n.shapeAreaField,n.shapeLengthField]):[]}async function z(e,n,i){if(!n||!i)return;const t=n.fieldsIndex;await Promise.all(i.filters.map(n=>S(e,t,n.where)))}const X=new Set(["oid","global-id","guid"]),P=new Set(["oid","global-id"]),B=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/objectid/i,/^perimeter_/i,/_perimeter$/i,/_i$/i];function G(e){const n=new Set;W(e).forEach(e=>n.add(e)),q(e).forEach(e=>n.add(e.toLowerCase()));const i=e&&"infoFor3D"in e?e.infoFor3D:void 0;return i&&(Object.values(i.assetMapFieldRoles).forEach(e=>n.add(e.toLowerCase())),Object.values(i.transformFieldRoles).forEach(e=>n.add(e.toLowerCase()))),Array.from(n)}function J(e){if(!e)return[];const n="editFieldsInfo"in e&&e.editFieldsInfo;if(!n)return[];const{creationDateField:i,creatorField:t,editDateField:r,editorField:l}=n;return[i,t,r,l].filter(Boolean)}function W(e){return J(e).map(e=>e.toLowerCase())}function H(e){return!!e.type}function K(e,n){return!!e.editable&&H(e)&&!X.has(e.type)&&!W(n).includes(e.name?.toLowerCase()??"")}function Q(e,n){const i=e.name?.toLowerCase()??"";return!(null!=n?.objectIdField&&i===n.objectIdField.toLowerCase()||null!=n?.globalIdField&&i===n.globalIdField.toLowerCase()||G(n).includes(i)||P.has(e.type)||B.some(e=>e.test(i)))}async function Y(e){if(!e)return[];const n=new Set;return await Z(n,e),Array.from(n).sort()}async function Z(e,n){const{labelingInfo:i,fieldsIndex:t}=n;i?.length&&await Promise.all(i.map(n=>ee(e,t,n)))}async function ee(e,n,i){if(!i)return;const t=i.getLabelExpression(),r=i.where;if("arcade"===t.type)await v(e,n,null,t.expression);else{const i=t.expression.match(/{[^}]*}/g);i&&i.forEach(i=>{x(e,n,i.slice(1,-1))})}await S(e,n,r)}function ne(e){const n=e.defaultValue;return void 0!==n&&se(e,n)?n:e.nullable?null:void 0}function ie(e){const n="string"==typeof e?{type:e}:e;return be(n)?255:"esriFieldTypeDate"===n.type||"date"===n.type?8:void 0}function te(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function re(e){return null===e||te(e)}function le(e){return null===e||Number.isInteger(e)}function oe(){return!0}function se(e,n){let i;switch(e.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":i=e.nullable?le:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=e.nullable?re:te;break;case"string":case"esriFieldTypeString":i=e.nullable?s:a;break;default:i=oe}return 1===arguments.length?i:i(n)}const ae=["integer","small-integer","big-integer","long"],ue=["single","double"],fe=[...ae,...ue],ce=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeLong","esriFieldTypeBigInteger"],de=["esriFieldTypeSingle","esriFieldTypeDouble"],pe=new Set([...ae,...ce]),me=new Set([...ue,...de]),ye=t(pe,me);function ge(e){return null!=e&&pe.has(e.type)}function Fe(e){return null!=e&&ye.has(e.type)}function be(e){return null!=e&&("string"===e.type||"esriFieldTypeString"===e.type)}function Ie(e){return null!=e&&("date"===e.type||"esriFieldTypeDate"===e.type)}function we(e){return null!=e&&("date-only"===e.type||"esriFieldTypeDateOnly"===e.type)}function xe(e){return null!=e&&("timestamp-offset"===e.type||"esriFieldTypeTimestampOffset"===e.type)}function Te(e){return null!=e&&("time-only"===e.type||"esriFieldTypeTimeOnly"===e.type)}function he(e){return null!=e&&("date"===e.type||"date-only"===e.type||"time-only"===e.type||"timestamp-offset"===e.type)}function ve(e){return null!=e&&("oid"===e.type||"esriFieldTypeOID"===e.type)}function Se(e){return null!=e&&("global-id"===e.type||"esriFieldTypeGlobalID"===e.type)}function Ee(e,n){return null===_e(e,n)}function Ae(e){return null==e||"number"==typeof e&&isNaN(e)?null:e}function $e(e){return parseFloat(e.replaceAll("_",""))}function _e(e,n){return null==e||e.nullable&&null===n?null:se(e,n)?Fe(e)&&!Ne(e.type,Number(n))?"numeric-range-validation-error::out-of-range":null:"type-validation-error::invalid-type"}function Ne(e,n){const i="string"==typeof e?Me(e):e;if(!i)return!1;const t=i.min,r=i.max;return i.isInteger?Number.isInteger(n)&&n>=t&&n<=r:n>=t&&n<=r}function Le(e,n){const i=l(e,n);return i||(Fe(e)?Me(e.type):void 0)}function Me(e){switch(e){case"esriFieldTypeSmallInteger":case"small-integer":return De;case"esriFieldTypeInteger":case"esriFieldTypeLong":case"integer":case"long":return Oe;case"esriFieldTypeBigInteger":case"big-integer":return Ce;case"esriFieldTypeSingle":case"single":return Ve;case"esriFieldTypeDouble":case"double":return ke}}function je(e){if(!te(e))return null;if(Number.isInteger(e)){if(e>=De.min&&e<=De.max)return"esriFieldTypeSmallInteger";if(e>=Oe.min&&e<=Oe.max)return"esriFieldTypeInteger";if(e>=Ce.min&&e<=Ce.max)return"esriFieldTypeBigInteger"}return e>=Ve.min&&e<=Ve.max?"esriFieldTypeSingle":"esriFieldTypeDouble"}const De={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},Oe={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},Ce={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},Re=(2-2**-23)*2**127,Ve={min:-Re,max:Re,isInteger:!1,rawMin:-Re,rawMax:Re},ke={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function Ue(e,n,i){switch(e){case"domain-validation-error::invalid-coded-value":return`Value ${i} is not in the coded domain - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case"domain-validation-error::value-out-of-range":return`Value ${i} is out of the range of valid values - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;case"type-validation-error::invalid-type":return`Value ${i} is not a valid value for the field type - field: ${n.name}, type: ${n.type}, nullable: ${n.nullable}`;case"numeric-range-validation-error::out-of-range":{const{min:e,max:t}=Me(n.type);return`Value ${i} is out of range for the number type - field: ${n.name}, type: ${n.type}, value range is ${e} to ${t}`}}}function qe(e,n){return!ze(e,n,null)}function ze(e,n,i){if(!e?.attributes||!n){if(null!=i)for(const e of n??[])i.add(e);return!0}const t=new Set(Object.keys(e.attributes));let r=!1;for(const l of n)if(!t.has(l)){if(r=!0,null==i)break;i.add(l)}return r}async function Xe(e,n){const i=new Set;for(const t of n)await v(i,e.fieldsIndex,null,t);return Array.from(i).sort()}function Pe(e){return!!e&&["raster.itempixelvalue","raster.servicepixelvalue"].some(n=>e.toLowerCase().startsWith(n))}async function Be(e,n){const i=new Set;return e?.collectRequiredFields&&await e.collectRequiredFields(i,n),Array.from(i).sort()}function Ge(e){const n=e?.match(/{[^}]+}/g);return n?n.map(e=>e.slice(1,-1).split(":")[0].trim()):[]}function Je(e,n){const{statisticType:i,onStatisticField:t,onStatisticExpression:r}=e,l=n.get(t),o=Fe(l),s=r?.returnType;switch(i){case"avg":case"avg_angle":return l?o||Ie(l)?"double":null:s&&"number"===s?"double":null;case"count":return"integer";case"min":case"max":return l?o||he(l)?l?.type??null:null:s&&"number"===s?"double":null;case"sum":return l?o?l?.type??null:null:s&&"number"===s?"double":null;case"mode":return l?l?.type??null:s?"number"===s?"double":"string":null;default:return null}}function We(e){const{fieldName:n,fieldsMap:i,normalizedFieldsMap:t}=e;if(!n)return;let r=i.get(n);return r||(r=i.get(He(n))??t.get(Ke(n)),r&&i.set(n,r),r)}function He(e){return e.trim().toLowerCase()}function Ke(e){return d(e)?.toLowerCase()??""}export{He as applyLowerCaseFieldName,Ce as bigIntegerRange,v as collectArcadeFieldNames,z as collectDisplayFilterFields,L as collectElevationFields,j as collectFeatureReductionFields,x as collectField,w as collectFields,C as collectFilterFields,Z as collectLabelingFields,R as collectOrderByInfos,O as collectPopupTemplateFields,S as collectSQLFieldNames,D as collectTrackInfoFields,ke as doubleRange,Ge as extractSubstitutionTemplatesFromString,qe as featureHasFields,I as fixFields,y as fixRendererFields,F as fixTimeInfoFields,de as floatJSONTypes,ue as floatTypes,Je as getAggregateFieldType,E as getDisplayFieldName,A as getDisplayFieldNameFromFields,J as getEditTrackingFields,N as getElevationFields,Xe as getExpressionFields,U as getFeatureEditFields,q as getFeatureGeometryFields,ie as getFieldDefaultLength,ne as getFieldDefaultValue,We as getFieldFromIndex,Le as getFieldRange,Y as getLabelingFields,G as getLowerCaseDefaultHiddenFields,W as getLowerCaseEditTrackingFields,je as getNumericTypeForValue,Be as getRendererFields,k as getTimeFields,ce as integerJSONTypes,Oe as integerRange,ae as integerTypes,Ie as isDateField,we as isDateOnlyField,K as isFieldEditable,Q as isFieldVisibleByDefault,H as isFieldWithType,Se as isGlobalIDField,ge as isIntegerField,Ne as isNumberInRange,Fe as isNumericField,ve as isObjectIDField,Pe as isRasterPixelValueField,be as isStringField,Te as isTimeOnlyField,xe as isTimestampOffsetField,Ee as isValidFieldValue,se as isValueMatchingFieldType,Ke as lowerCaseNormalizedFieldName,d as normalizeFieldName,fe as numericTypes,h as packFields,ze as populateMissingFields,p as rendererFields,Ae as sanitizeNullFieldValue,$e as sanitizedParseFloat,Ve as singleRange,De as smallIntegerRange,T as unpackFieldNames,_e as validateFieldValue,Ue as validationErrorToString,m as visualVariableFields};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.2.0-next.41",
3
+ "version": "5.2.0-next.42",
4
4
  "type": "module",
5
5
  "homepage": "https://js.arcgis.com",
6
6
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const d="20260707",e="d85be58255895c31f500d7e0083d1540332dc9e6";export{d as buildDate,e as commitHash};
2
+ const c="20260708",e="771be63626c8b28a6673e2c519283ef27774a09c";export{c as buildDate,e as commitHash};