@arcgis/core 4.33.0-next.20250410 → 4.33.0-next.20250412

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 (81) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{1364744b15b327abd5a1.js → 37716880cef8155259f5.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{ccb289911e7445b17763.js → 3a84ee5d0434362286a6.js} +10 -10
  4. package/assets/esri/core/workers/chunks/4deeeceb784e4390441d.js +1 -0
  5. package/assets/esri/core/workers/chunks/5a991c8e0febb0cf9be1.js +1 -0
  6. package/assets/esri/core/workers/chunks/7f86c9ec45f4fae1fb49.js +1 -0
  7. package/assets/esri/core/workers/chunks/{b06e3ba73f353592c81d.js → b6361cec92003997bfe5.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{4bbe6160eda3fb5d58ec.js → d88544ac332be633e3fe.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{35ab75010817f1525e54.js → e6a97f9b6f7be8076f85.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{5fa5bfc70512994f5ec1.js → e7cb4003c45e42b48ea6.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{b308bef7ff08e0e635b5.js → fe1ad9ed0d32f557e5a3.js} +23 -23
  12. package/assets/esri/themes/base/widgets/_BuildingDisciplinesTree.scss +0 -1
  13. package/assets/esri/themes/dark/main.css +1 -1
  14. package/assets/esri/themes/light/main.css +1 -1
  15. package/assets/esri/themes/light/view.css +1 -1
  16. package/chunks/BloomBlur.glsl.js +4 -6
  17. package/chunks/BloomComposition.glsl.js +12 -12
  18. package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
  19. package/interfaces.d.ts +47 -2
  20. package/package.json +1 -1
  21. package/support/revision.js +1 -1
  22. package/symbols/cim/CurveHelper.js +1 -1
  23. package/symbols/cim/GeometryWalker.js +1 -1
  24. package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
  25. package/symbols/cim/placements/PlacementOnLine.js +1 -1
  26. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  27. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  28. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/utils.js +1 -1
  29. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  30. package/views/3d/layers/ElevationLayerView3DModifications.js +1 -1
  31. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  32. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  33. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  34. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  35. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  36. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  37. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  38. package/views/3d/layers/graphics/Labeler.js +1 -1
  39. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  40. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  41. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  42. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
  43. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  44. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
  45. package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
  46. package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
  47. package/views/3d/layers/graphics/pipeline/symbolization/UniqueValueFeatureRenderer.js +1 -1
  48. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  49. package/views/3d/support/MemoryController.js +1 -1
  50. package/views/3d/terrain/OverlayManager.js +1 -1
  51. package/views/3d/terrain/OverlayRenderer.js +1 -1
  52. package/views/3d/terrain/PatchRenderData.js +1 -1
  53. package/views/3d/terrain/TextureFader.js +1 -1
  54. package/views/3d/terrain/TileRenderer.js +1 -1
  55. package/views/3d/terrain/TileTexture.js +1 -1
  56. package/views/3d/webgl/formats.js +1 -1
  57. package/views/3d/webgl-engine/Stage.js +1 -1
  58. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  59. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  60. package/views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js +1 -1
  61. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  62. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  63. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  64. package/views/3d/webgl-engine/lib/RendererBase.js +5 -0
  65. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  66. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  67. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  68. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  69. package/views/3d/webgl-engine/materials/renderers/VaoCache.js +1 -1
  70. package/views/FocusAreas.js +1 -1
  71. package/views/webgl/VertexArrayObject.js +1 -1
  72. package/views/webgl/enums.js +1 -1
  73. package/views/webgl/textureUtils.js +1 -1
  74. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  75. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  76. package/widgets/Feature/support/featureUtils.js +1 -1
  77. package/widgets/Features.js +1 -1
  78. package/widgets/Search.js +1 -1
  79. package/assets/esri/core/workers/chunks/386ea90e87254b0282ec.js +0 -1
  80. package/assets/esri/core/workers/chunks/4046ec636723c20d3e28.js +0 -1
  81. package/assets/esri/core/workers/chunks/ec83af4fb3bf59df7759.js +0 -1
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{gauss as e}from"../core/mathUtils.js";import{ScreenSpacePass as r}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{Gamma as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{FloatPassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as s}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{blurRadiusPresets as l}from"../views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js";import{NoParameters as n}from"../views/webgl/NoParameters.js";import{ShaderBuilder as a}from"../views/webgl/ShaderBuilder.js";var c;!function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.COUNT=2]="COUNT"}(c||(c={}));class u extends n{constructor(){super(...arguments),this.blurRadius=l.sunny}}function m(l){const n=new a,u=n.fragment;n.include(r),n.include(o),u.uniforms.add(new i("colorTexture",(e=>e.color)),new t("blurRadius",(e=>e.blurRadius)));let m="";const d=15;for(let e=0;e<d;e++){m+=`locations1D[${e}] = ${(e/(d-1)*2-1).toFixed(3).toString()};`}const f=2;let v="";for(let r=0;r<d;r++){v+=`locations1DWeights[${r}] = ${e(r-Math.floor(d/2),f).toFixed(7).toString()};`}const g=l.bloomStage===c.Horizontal;return u.code.add(s`
5
+ import{gauss as e}from"../core/mathUtils.js";import{ScreenSpacePass as r}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{Gamma as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{FloatPassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as s}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{blurRadiusPresets as l}from"../views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js";import{NoParameters as a}from"../views/webgl/NoParameters.js";import{ShaderBuilder as n}from"../views/webgl/ShaderBuilder.js";var c;!function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.COUNT=2]="COUNT"}(c||(c={}));class u extends a{constructor(){super(...arguments),this.blurRadius=l.sunny}}function m(l){const a=new n,u=a.fragment;a.include(r),a.include(o),u.uniforms.add(new i("colorTexture",(e=>e.color)),new t("blurRadius",(e=>e.blurRadius)));let m="";const d=15;for(let e=0;e<d;e++){m+=`locations1D[${e}] = ${(e/(d-1)*2-1).toFixed(3).toString()};`}const f=2;let v="";for(let r=0;r<d;r++){v+=`locations1DWeights[${r}] = ${e(r-Math.floor(d/2),f).toFixed(7).toString()};`}const g=l.bloomStage===c.Horizontal;return u.code.add(s`
6
6
  float locations1D[${s.int(d)}];
7
7
  float locations1DWeights[${s.int(d)}];
8
8
 
@@ -22,11 +22,9 @@ import{gauss as e}from"../core/mathUtils.js";import{ScreenSpacePass as r}from"..
22
22
 
23
23
  vec2 uvDistorted = uv + uvOffset * blurRadius * aspectCorrection;
24
24
  vec4 sampleColor = texture(toBlur, uvDistorted);
25
- res += pow(sampleColor, vec4(GAMMA)) * locations1DWeights[i];
25
+ res += sampleColor * locations1DWeights[i];
26
26
  }
27
- res = pow(res, vec4(INV_GAMMA));
28
- res.a = 1.0;
29
-
27
+ res.a = clamp(res.a, 0.0, 1.0);
30
28
  return res;
31
29
  }
32
- `).main.add(s`fragColor = blurUniformSamples(colorTexture);`),n}const d=Object.freeze(Object.defineProperty({__proto__:null,BloomBlurPassParameters:u,get BlurDirection(){return c},build:m},Symbol.toStringTag,{value:"Module"}));export{u as B,c as a,d as b,m as c};
30
+ `).main.add(s`fragColor = blurUniformSamples(colorTexture);`),a}const d=Object.freeze(Object.defineProperty({__proto__:null,BloomBlurPassParameters:u,get BlurDirection(){return c},build:m},Symbol.toStringTag,{value:"Module"}));export{u as B,c as a,d as b,m as c};
@@ -2,16 +2,16 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ScreenSpacePass as o}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as e}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{Gamma as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{Float2BindUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js";import{FloatPassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{FloatsPassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js";import{glsl as s}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Texture2DBindUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{exposurePresets as n,lodFactorsPresets as c}from"../views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js";import{NoParameters as u}from"../views/webgl/NoParameters.js";import{ShaderBuilder as p}from"../views/webgl/ShaderBuilder.js";class f extends u{constructor(o=n.sunny,e=c.sunny.far,r=c.sunny.near){super(),this.exposure=o,this.lodFactors=e,this.lodFactorsFront=r}}const g=new f;class b extends f{constructor(){super(...arguments),this.bloomLod=-1}}function F(){const n=new p,c=n.fragment;return n.include(o),n.include(r),c.include(e),c.uniforms.add(new m("colorTexture",(o=>o.color)),new m("bloomTexture0",(o=>o.bloomTexture0)),new m("bloomTexture1",(o=>o.bloomTexture1)),new m("bloomTexture2",(o=>o.bloomTexture2)),new m("bloomTexture3",(o=>o.bloomTexture3)),new m("bloomTexture4",(o=>o.bloomTexture4)),new t("exposure",(o=>o.exposure)),new d("bloomLod",(o=>o.bloomLod)),new i("depthTexture",(o=>o.mainDepth)),new l("nearFar",(o=>o.camera.nearFar)),new a("lodFactors",(o=>o.lodFactors),5),new a("lodFactorsFront",(o=>o.lodFactorsFront),5)).code.add(s`vec3 simpleExposureTonemap(vec3 hdrColor, float exposure) {
5
+ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as o}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{Gamma as r}from"../views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js";import{Float2BindUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js";import{FloatPassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{FloatsPassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js";import{glsl as s}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Texture2DBindUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{defaultExposure as i,lodFactorsPresets as u}from"../views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js";import{NoParameters as c}from"../views/webgl/NoParameters.js";import{ShaderBuilder as p}from"../views/webgl/ShaderBuilder.js";class f extends c{constructor(e=i,o=u.sunny.far,r=u.sunny.near){super(),this.exposure=e,this.lodFactors=o,this.lodFactorsFront=r}}const g=new f;class b extends f{constructor(){super(...arguments),this.bloomLod=-1}}function w(){const i=new p,u=i.fragment;return i.include(e),i.include(r),u.include(o),u.uniforms.add(new m("colorTexture",(e=>e.color)),new m("bloomTexture0",(e=>e.bloomTexture0)),new m("bloomTexture1",(e=>e.bloomTexture1)),new m("bloomTexture2",(e=>e.bloomTexture2)),new m("bloomTexture3",(e=>e.bloomTexture3)),new m("bloomTexture4",(e=>e.bloomTexture4)),new t("exposure",(e=>e.exposure)),new d("bloomLod",(e=>e.bloomLod)),new n("depthTexture",(e=>e.mainDepth)),new l("nearFar",(e=>e.camera.nearFar)),new a("lodFactors",(e=>e.lodFactors),5),new a("lodFactorsFront",(e=>e.lodFactorsFront),5)).code.add(s`vec3 simpleExposureTonemap(vec3 hdrColor, float exposure) {
6
6
  vec3 mapped = vec3(1.0) - exp(-hdrColor * exposure);
7
7
  return mapped;
8
8
  }`).main.add(s`vec4 color = texture(colorTexture, uv);
9
9
  color = vec4(linearizeGamma(color.rgb), color.a);
10
- vec4 lod0 = pow(texture(bloomTexture0, uv), vec4(GAMMA));
11
- vec4 lod1 = pow(texture(bloomTexture1, uv), vec4(GAMMA));
12
- vec4 lod2 = pow(texture(bloomTexture2, uv), vec4(GAMMA));
13
- vec4 lod3 = pow(texture(bloomTexture3, uv), vec4(GAMMA));
14
- vec4 lod4 = pow(texture(bloomTexture4, uv), vec4(GAMMA));
10
+ vec4 lod0 = texture(bloomTexture0, uv);
11
+ vec4 lod1 = texture(bloomTexture1, uv);
12
+ vec4 lod2 = texture(bloomTexture2, uv);
13
+ vec4 lod3 = texture(bloomTexture3, uv);
14
+ vec4 lod4 = texture(bloomTexture4, uv);
15
15
  float depthSample = depthFromTexture(depthTexture, uv);
16
16
  float modifierFactors = 0.0;
17
17
  float linearDepthNorm = 0.0;
@@ -21,12 +21,12 @@ float distNearFar = (nearFar[1] - nearFar[0]);
21
21
  linearDepthNorm = 1.0 - ((linearDepth - nearFar[0]) / distNearFar);
22
22
  modifierFactors = pow(linearDepthNorm, 8.0);
23
23
  }
24
- fragColor = mix(lodFactors[0], lodFactorsFront[0], modifierFactors) * lod0;
25
- fragColor += mix(lodFactors[1], lodFactorsFront[1], modifierFactors) * lod1;
26
- fragColor += mix(lodFactors[2], lodFactorsFront[2], modifierFactors) * lod2;
27
- fragColor += mix(lodFactors[3], lodFactorsFront[3], modifierFactors) * lod3;
28
- fragColor += mix(lodFactors[4], lodFactorsFront[4], modifierFactors) * lod4;
24
+ fragColor = lodFactors[0] * lod0;
25
+ fragColor += lodFactors[1] * lod1;
26
+ fragColor += lodFactors[2] * lod2;
27
+ fragColor += lodFactors[3] * lod3;
28
+ fragColor += lodFactors[4] * lod4;
29
29
  fragColor = bloomLod == 0 ? lodFactors[0] * lod0 : bloomLod == 1 ? lodFactors[1] * lod1 : bloomLod == 2 ? lodFactors[2] * lod2 : bloomLod == 3 ? lodFactors[3] * lod3 : bloomLod == 4 ? lodFactors[4] * lod4 : fragColor;
30
30
  fragColor = vec4(simpleExposureTonemap(fragColor.rgb, exposure), fragColor.a);
31
31
  fragColor += color;
32
- fragColor = delinearizeGamma(fragColor);`),n}const w=Object.freeze(Object.defineProperty({__proto__:null,BloomCompositionPassParameters:b,build:F,defaultCompositionParameters:g},Symbol.toStringTag,{value:"Module"}));export{b as B,w as a,F as b,g as d};
32
+ fragColor = delinearizeGamma(fragColor);`),i}const x=Object.freeze(Object.defineProperty({__proto__:null,BloomCompositionPassParameters:b,build:w,defaultCompositionParameters:g},Symbol.toStringTag,{value:"Module"}));export{b as B,x as a,w as b,g as d};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../Graphic.js";import t from"../../../core/Error.js";import o from"../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../core/MapUtils.js";import{isPromiseLike as i}from"../../../core/promiseUtils.js";import{generateBracedUUID as s}from"../../../core/uuid.js";import{isLoadedSharedTemplate as a,isSharedFeatureTemplate as l,isSharedGroupTemplate as n,isSharedPresetTemplate as u}from"../../templateUtils.js";import{createFeatureServiceEdit as p}from"./support/createFeatureServiceEdit.js";import{calculateExtent as c,groupEditsByLayer as m}from"./support/executorUtils.js";import{getBuilder as d}from"./support/getBuilder.js";import{isPoint as f}from"../../../geometry/support/jsonUtils.js";import{getAssociationsTableFields as y}from"../../../networks/support/networkFieldUtils.js";import{RuleType as T}from"../../../networks/support/typeUtils.js";const g=()=>o.getLogger("esri.editing.sharedTemplates.executor.createTemplateExecutor"),h="globalid";async function w(e){if(!a(e))throw new t("template-executor:template-not-loaded","The template must be loaded before it can be executed.");if(l(e))return I(e);if(n(e))return b(e);if(u(e))return G(e);throw new t("template-executor:unsupported-template-type","The template type is not supported.")}function I(e){return t=>{const o=[],r=[];p({geometry:t,template:e,edits:o,relationships:r});const i=c(o);return{edits:m(o),relationships:r,primary:o[0]??null,featureExtent:i,rotationPoint:i?.center??null}}}async function b(e){const{definition:t}=e,o=await Promise.all(t.allParts.map(k));return(r,s)=>{const a=[],l=[],n=new Set,u=()=>{if(t.createUtilityNetworkAssociations&&"completion"===s){const{utilityNetwork:e,utilityNetworkAssociationsTable:o}=t;e&&o?S({associationGraphics:n,associationsTable:o,edits:a,relationships:l,utilityNetworkHelper:e}):g().warn("Unable to create utility network associations between group template features. The utility network or its associations table is unavailable.")}const e=c(a);return{associationGraphics:n,edits:m(a),relationships:l,primary:a[0]??null,featureExtent:e,rotationPoint:e?.center??null}};if(null==r)return g().warn("No geometry provided to group template executor. Result will be empty."),u();const p=o.map((t=>t({edits:a,mode:s,parentTemplate:e,relationships:l,shape:r}))).filter(i);return 0===p.length?u():Promise.all(p).then((()=>u()))}}async function k(e){const t=await d(e.builderType);return o=>t.execute({...o,templatePart:e})}async function G(e){const{createPresetServiceEdit:o}=await import("./support/createPresetServiceEdit.js");return(r,i,s=0)=>{if(!f(r))throw new t("template-executor:invalid-input-geometry","The input goemetry for a preset template must be a point.");const a=[],l=[],n=o({geometry:r,template:e,edits:a,relationships:l,rotation:s,mode:i});return{edits:m(a),relationships:l,primary:a[0]??null,featureExtent:c(a),rotationPoint:n}}}function S(e){const{edits:t,utilityNetworkHelper:o}=e,i=new Map;for(const s of t)""!==s.tag&&o.layerIdToSourceIdLookup.has(s.id)&&r(i,s.tag,(()=>[])).push(s);for(const r of i.values())if(!(r.length<2))for(let t=0;t<r.length;t++){const o=r[t];for(let i=t+1;i<r.length;i++){A(o,r[i],e)}}}function A(t,o,r){const{associationGraphics:i,associationsTable:a,edits:l,utilityNetworkHelper:n,relationships:u}=r,p=n.findAgat(t.graphic,t.layer),c=n.findAgat(o.graphic,o.layer);if(!p||!c)return;const m=n.findRules(p).map((e=>e.fromNetworkSource?.sourceId!==p.networkSourceId||e.fromAssetGroup?.assetGroupCode!==p.assetGroup||null!==e.fromAssetType?.assetTypeCode&&e.fromAssetType?.assetTypeCode!==p.assetType||e.toNetworkSource.sourceId!==c.networkSourceId||e.toAssetGroup?.assetGroupCode!==c.assetGroup||null!==e.toAssetType&&e.toAssetType?.assetTypeCode!==c.assetType?e.toNetworkSource.sourceId!==p.networkSourceId||e.toAssetGroup?.assetGroupCode!==p.assetGroup||null!==e.toAssetType&&e.toAssetType?.assetTypeCode!==p.assetType||e.fromNetworkSource.sourceId!==c.networkSourceId||e.fromAssetGroup?.assetGroupCode!==c.assetGroup||null!==e.fromAssetType?.assetTypeCode&&e.fromAssetType?.assetTypeCode!==c.assetType?null:{rule:e,from:{agat:c,item:o},to:{agat:p,item:t}}:{rule:e,from:{agat:p,item:t},to:{agat:c,item:o}})).filter((e=>e?.rule.ruleType===T.RTJunctionEdgeConnectivity||e?.rule.ruleType===T.RTEdgeJunctionEdgeConnectivity||e?.rule.ruleType===T.RTContainment?null:e)).filter((e=>null!==e));if(0===m.length)return;const d=y(a),f=new Set;for(const y of m){const t={};t[d.fromNetworkSourceId]=y.rule.fromNetworkSource.sourceId,t[d.fromGlobalId]=y.from.item.graphic.attributes[y.from.item.layer.globalIdField??h],t[d.fromTerminalId]=null,y.rule.fromTerminal&&(t[d.fromTerminalId]=y.rule.fromTerminal.terminalId),t[d.toNetworkSourceId]=y.rule.toNetworkSource.sourceId,t[d.toGlobalId]=y.to.item.graphic.attributes[y.to.item.layer.globalIdField??h],t[d.toTerminalId]=null,y.rule.toTerminal&&(t[d.toTerminalId]=y.rule.toTerminal.terminalId),t[d.associationType]=y.rule.ruleType,t[d.percentAlong]=null,t[d.isContentVisible]=y.rule.ruleType===T.RTContainment?1:0,t[d.status]=0,t[d.globalId]=s();const o=`${t[d.fromNetworkSourceId]}-${t[d.fromGlobalId]}-${t[d.toNetworkSourceId]}-${t[d.toGlobalId]}-${t[d.associationType]}`;if(f.has(o))continue;f.add(o);const r=new e({attributes:t,sourceLayer:a});i.add(r),l.push({id:a.layerId,graphic:r,tag:"",layer:a}),u.push({sourceGraphic:y.to.item.graphic,sourceLayerId:y.to.item.layer.layerId,destinationGraphic:r,destinationLayerId:a.layerId,sourceField:y.to.item.layer.globalIdField??h,destinationField:d.toGlobalId??h}),u.push({sourceGraphic:y.from.item.graphic,sourceLayerId:y.from.item.layer.layerId,destinationGraphic:r,destinationLayerId:a.layerId,sourceField:y.from.item.layer.globalIdField??h,destinationField:d.fromGlobalId??h})}}export{w as createTemplateExecutor};
5
+ import e from"../../../Graphic.js";import t from"../../../core/Error.js";import o from"../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../core/MapUtils.js";import{isPromiseLike as i}from"../../../core/promiseUtils.js";import{generateBracedUUID as s}from"../../../core/uuid.js";import{isLoadedSharedTemplate as a,isSharedFeatureTemplate as l,isSharedGroupTemplate as n,isSharedPresetTemplate as u}from"../../templateUtils.js";import{createFeatureServiceEdit as p}from"./support/createFeatureServiceEdit.js";import{calculateExtent as c,groupEditsByLayer as m}from"./support/executorUtils.js";import{getBuilder as d}from"./support/getBuilder.js";import{isPoint as f}from"../../../geometry/support/jsonUtils.js";import{getAssociationsTableFields as y}from"../../../networks/support/networkFieldUtils.js";import{RuleType as T}from"../../../networks/support/typeUtils.js";const g=()=>o.getLogger("esri.editing.sharedTemplates.executor.createTemplateExecutor"),h="globalid";async function w(e){if(!a(e))throw new t("template-executor:template-not-loaded","The template must be loaded before it can be executed.");if(l(e))return I(e);if(n(e))return b(e);if(u(e))return G(e);throw new t("template-executor:unsupported-template-type","The template type is not supported.")}function I(e){return t=>{const o=[],r=[];p({geometry:t,template:e,edits:o,relationships:r});const i=c(o);return{edits:m(o),relationships:r,primary:o[0]??null,featureExtent:i,rotationPoint:i?.center??null}}}async function b(e){const{definition:t}=e,o=await Promise.all(t.allParts.map(k));return(r,s)=>{const a=[],l=[],n=new Set,u=()=>{if(t.createUtilityNetworkAssociations&&"completion"===s){const{utilityNetwork:e,utilityNetworkAssociationsTable:o}=t;e&&o?S({associationGraphics:n,associationsTable:o,edits:a,relationships:l,utilityNetworkHelper:e}):g().warn("Unable to create utility network associations between group template features. The utility network or its associations table is unavailable.")}const e=c(a);return{associationGraphics:n,edits:m(a),relationships:l,primary:a[0]??null,featureExtent:e,rotationPoint:e?.center??null}};if(null==r)return g().warn("No geometry provided to group template executor. Result will be empty."),u();const p=o.map((t=>t({edits:a,mode:s,parentTemplate:e,relationships:l,shape:r}))).filter(i);return 0===p.length?u():Promise.all(p).then((()=>u()))}}async function k(e){const t=await d(e.builderType);return o=>t.execute({...o,templatePart:e})}async function G(e){const{createPresetServiceEdit:o}=await import("./support/createPresetServiceEdit.js");return(r,i,s=0)=>{if(!f(r))throw new t("template-executor:invalid-input-geometry","The input geometry for a preset template must be a point.");const a=[],l=[],n=o({geometry:r,template:e,edits:a,relationships:l,rotation:s,mode:i});return{edits:m(a),relationships:l,primary:a[0]??null,featureExtent:c(a),rotationPoint:n}}}function S(e){const{edits:t,utilityNetworkHelper:o}=e,i=new Map;for(const s of t)""!==s.tag&&o.layerIdToSourceIdLookup.has(s.id)&&r(i,s.tag,(()=>[])).push(s);for(const r of i.values())if(!(r.length<2))for(let t=0;t<r.length;t++){const o=r[t];for(let i=t+1;i<r.length;i++){A(o,r[i],e)}}}function A(t,o,r){const{associationGraphics:i,associationsTable:a,edits:l,utilityNetworkHelper:n,relationships:u}=r,p=n.findAgat(t.graphic,t.layer),c=n.findAgat(o.graphic,o.layer);if(!p||!c)return;const m=n.findRules(p).map((e=>e.fromNetworkSource?.sourceId!==p.networkSourceId||e.fromAssetGroup?.assetGroupCode!==p.assetGroup||null!==e.fromAssetType?.assetTypeCode&&e.fromAssetType?.assetTypeCode!==p.assetType||e.toNetworkSource.sourceId!==c.networkSourceId||e.toAssetGroup?.assetGroupCode!==c.assetGroup||null!==e.toAssetType&&e.toAssetType?.assetTypeCode!==c.assetType?e.toNetworkSource.sourceId!==p.networkSourceId||e.toAssetGroup?.assetGroupCode!==p.assetGroup||null!==e.toAssetType&&e.toAssetType?.assetTypeCode!==p.assetType||e.fromNetworkSource.sourceId!==c.networkSourceId||e.fromAssetGroup?.assetGroupCode!==c.assetGroup||null!==e.fromAssetType?.assetTypeCode&&e.fromAssetType?.assetTypeCode!==c.assetType?null:{rule:e,from:{agat:c,item:o},to:{agat:p,item:t}}:{rule:e,from:{agat:p,item:t},to:{agat:c,item:o}})).filter((e=>e?.rule.ruleType===T.RTJunctionEdgeConnectivity||e?.rule.ruleType===T.RTEdgeJunctionEdgeConnectivity||e?.rule.ruleType===T.RTContainment?null:e)).filter((e=>null!==e));if(0===m.length)return;const d=y(a),f=new Set;for(const y of m){const t={};t[d.fromNetworkSourceId]=y.rule.fromNetworkSource.sourceId,t[d.fromGlobalId]=y.from.item.graphic.attributes[y.from.item.layer.globalIdField??h],t[d.fromTerminalId]=null,y.rule.fromTerminal&&(t[d.fromTerminalId]=y.rule.fromTerminal.terminalId),t[d.toNetworkSourceId]=y.rule.toNetworkSource.sourceId,t[d.toGlobalId]=y.to.item.graphic.attributes[y.to.item.layer.globalIdField??h],t[d.toTerminalId]=null,y.rule.toTerminal&&(t[d.toTerminalId]=y.rule.toTerminal.terminalId),t[d.associationType]=y.rule.ruleType,t[d.percentAlong]=null,t[d.isContentVisible]=y.rule.ruleType===T.RTContainment?1:0,t[d.status]=0,t[d.globalId]=s();const o=`${t[d.fromNetworkSourceId]}-${t[d.fromGlobalId]}-${t[d.toNetworkSourceId]}-${t[d.toGlobalId]}-${t[d.associationType]}`;if(f.has(o))continue;f.add(o);const r=new e({attributes:t,sourceLayer:a});i.add(r),l.push({id:a.layerId,graphic:r,tag:"",layer:a}),u.push({sourceGraphic:y.to.item.graphic,sourceLayerId:y.to.item.layer.layerId,destinationGraphic:r,destinationLayerId:a.layerId,sourceField:y.to.item.layer.globalIdField??h,destinationField:d.toGlobalId??h}),u.push({sourceGraphic:y.from.item.graphic,sourceLayerId:y.from.item.layer.layerId,destinationGraphic:r,destinationLayerId:a.layerId,sourceField:y.from.item.layer.globalIdField??h,destinationField:d.fromGlobalId??h})}}export{w as createTemplateExecutor};
package/interfaces.d.ts CHANGED
@@ -7346,7 +7346,7 @@ declare namespace __esri {
7346
7346
  * A client-side geometry engine for testing, measuring, and analyzing the spatial relationship
7347
7347
  * between two or more 2D geometries.
7348
7348
  *
7349
- * @deprecated since version 4.32. Use [goemetry operators](../spatial-analysis/intro-geometry-operators/) instead.
7349
+ * @deprecated since version 4.32. Use [geometry operators](../spatial-analysis/intro-geometry-operators/) instead.
7350
7350
  *
7351
7351
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html Read more...}
7352
7352
  */
@@ -28009,6 +28009,12 @@ declare namespace __esri {
28009
28009
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ParquetLayer.html#blendMode Read more...}
28010
28010
  */
28011
28011
  declare blendMode: BlendLayer["blendMode"];
28012
+ /**
28013
+ * Describes the layer's supported capabilities.
28014
+ *
28015
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ParquetLayer.html#capabilities Read more...}
28016
+ */
28017
+ readonly capabilities: Capabilities | nullish;
28012
28018
  /**
28013
28019
  * Copyright information for the layer.
28014
28020
  *
@@ -79947,6 +79953,7 @@ declare namespace __esri {
79947
79953
  | SceneLayer
79948
79954
  | CSVLayer
79949
79955
  | OGCFeatureLayer
79956
+ | ParquetLayer
79950
79957
  | PointCloudLayer
79951
79958
  | GeoJSONLayer
79952
79959
  | WFSLayer
@@ -80005,6 +80012,7 @@ declare namespace __esri {
80005
80012
  | SceneLayer
80006
80013
  | CSVLayer
80007
80014
  | OGCFeatureLayer
80015
+ | ParquetLayer
80008
80016
  | PointCloudLayer
80009
80017
  | GeoJSONLayer
80010
80018
  | WFSLayer
@@ -80046,6 +80054,7 @@ declare namespace __esri {
80046
80054
  layer: | FeatureLayer
80047
80055
  | CSVLayer
80048
80056
  | GeoJSONLayer
80057
+ | ParquetLayer
80049
80058
  | WFSLayer
80050
80059
  | OGCFeatureLayer
80051
80060
  | StreamLayer
@@ -80104,6 +80113,7 @@ declare namespace __esri {
80104
80113
  layer: | FeatureLayer
80105
80114
  | CSVLayer
80106
80115
  | GeoJSONLayer
80116
+ | ParquetLayer
80107
80117
  | WFSLayer
80108
80118
  | OGCFeatureLayer
80109
80119
  | StreamLayer
@@ -80160,7 +80170,14 @@ declare namespace __esri {
80160
80170
  export const popupClusters: popupClusters;
80161
80171
 
80162
80172
  export interface clustersGetTemplatesParams {
80163
- layer: FeatureLayer | CSVLayer | GeoJSONLayer | WFSLayer | OGCFeatureLayer | StreamLayer | OrientedImageryLayer;
80173
+ layer: | FeatureLayer
80174
+ | CSVLayer
80175
+ | GeoJSONLayer
80176
+ | ParquetLayer
80177
+ | WFSLayer
80178
+ | OGCFeatureLayer
80179
+ | StreamLayer
80180
+ | OrientedImageryLayer;
80164
80181
  renderer: | SimpleRenderer
80165
80182
  | ClassBreaksRenderer
80166
80183
  | UniqueValueRenderer
@@ -80217,6 +80234,7 @@ declare namespace __esri {
80217
80234
  layer: | FeatureLayer
80218
80235
  | CSVLayer
80219
80236
  | GeoJSONLayer
80237
+ | ParquetLayer
80220
80238
  | WFSLayer
80221
80239
  | OGCFeatureLayer
80222
80240
  | StreamLayer
@@ -81089,6 +81107,7 @@ declare namespace __esri {
81089
81107
  | SceneLayer
81090
81108
  | CSVLayer
81091
81109
  | GeoJSONLayer
81110
+ | ParquetLayer
81092
81111
  | WFSLayer
81093
81112
  | OGCFeatureLayer
81094
81113
  | StreamLayer
@@ -81126,6 +81145,7 @@ declare namespace __esri {
81126
81145
  | SceneLayer
81127
81146
  | CSVLayer
81128
81147
  | GeoJSONLayer
81148
+ | ParquetLayer
81129
81149
  | WFSLayer
81130
81150
  | OGCFeatureLayer
81131
81151
  | StreamLayer
@@ -81168,6 +81188,7 @@ declare namespace __esri {
81168
81188
  | SceneLayer
81169
81189
  | CSVLayer
81170
81190
  | GeoJSONLayer
81191
+ | ParquetLayer
81171
81192
  | WFSLayer
81172
81193
  | OGCFeatureLayer
81173
81194
  | StreamLayer
@@ -81227,6 +81248,7 @@ declare namespace __esri {
81227
81248
  | SceneLayer
81228
81249
  | CSVLayer
81229
81250
  | GeoJSONLayer
81251
+ | ParquetLayer
81230
81252
  | WFSLayer
81231
81253
  | OGCFeatureLayer
81232
81254
  | StreamLayer
@@ -81345,6 +81367,7 @@ declare namespace __esri {
81345
81367
  export interface dotDensityCreateRendererParams {
81346
81368
  layer: | FeatureLayer
81347
81369
  | GeoJSONLayer
81370
+ | ParquetLayer
81348
81371
  | WFSLayer
81349
81372
  | OGCFeatureLayer
81350
81373
  | CatalogFootprintLayer
@@ -81433,6 +81456,7 @@ declare namespace __esri {
81433
81456
  layer: | FeatureLayer
81434
81457
  | CSVLayer
81435
81458
  | GeoJSONLayer
81459
+ | ParquetLayer
81436
81460
  | WFSLayer
81437
81461
  | OGCFeatureLayer
81438
81462
  | StreamLayer
@@ -81522,6 +81546,7 @@ declare namespace __esri {
81522
81546
  | SceneLayer
81523
81547
  | CSVLayer
81524
81548
  | GeoJSONLayer
81549
+ | ParquetLayer
81525
81550
  | WFSLayer
81526
81551
  | OGCFeatureLayer
81527
81552
  | StreamLayer
@@ -81594,6 +81619,7 @@ declare namespace __esri {
81594
81619
  | SceneLayer
81595
81620
  | CSVLayer
81596
81621
  | GeoJSONLayer
81622
+ | ParquetLayer
81597
81623
  | WFSLayer
81598
81624
  | OGCFeatureLayer
81599
81625
  | StreamLayer
@@ -81693,6 +81719,7 @@ declare namespace __esri {
81693
81719
  layer: | FeatureLayer
81694
81720
  | CSVLayer
81695
81721
  | GeoJSONLayer
81722
+ | ParquetLayer
81696
81723
  | WFSLayer
81697
81724
  | OGCFeatureLayer
81698
81725
  | StreamLayer
@@ -81714,6 +81741,7 @@ declare namespace __esri {
81714
81741
  layer: | FeatureLayer
81715
81742
  | CSVLayer
81716
81743
  | GeoJSONLayer
81744
+ | ParquetLayer
81717
81745
  | WFSLayer
81718
81746
  | OGCFeatureLayer
81719
81747
  | StreamLayer
@@ -81819,6 +81847,7 @@ declare namespace __esri {
81819
81847
  | SceneLayer
81820
81848
  | CSVLayer
81821
81849
  | GeoJSONLayer
81850
+ | ParquetLayer
81822
81851
  | WFSLayer
81823
81852
  | OGCFeatureLayer
81824
81853
  | StreamLayer
@@ -81969,6 +81998,7 @@ declare namespace __esri {
81969
81998
  | SceneLayer
81970
81999
  | CSVLayer
81971
82000
  | GeoJSONLayer
82001
+ | ParquetLayer
81972
82002
  | WFSLayer
81973
82003
  | OGCFeatureLayer
81974
82004
  | StreamLayer
@@ -82320,6 +82350,7 @@ declare namespace __esri {
82320
82350
  | SceneLayer
82321
82351
  | CSVLayer
82322
82352
  | GeoJSONLayer
82353
+ | ParquetLayer
82323
82354
  | WFSLayer
82324
82355
  | OGCFeatureLayer
82325
82356
  | StreamLayer
@@ -82356,6 +82387,7 @@ declare namespace __esri {
82356
82387
  | SceneLayer
82357
82388
  | CSVLayer
82358
82389
  | GeoJSONLayer
82390
+ | ParquetLayer
82359
82391
  | WFSLayer
82360
82392
  | OGCFeatureLayer
82361
82393
  | StreamLayer
@@ -82397,6 +82429,7 @@ declare namespace __esri {
82397
82429
  | SceneLayer
82398
82430
  | CSVLayer
82399
82431
  | GeoJSONLayer
82432
+ | ParquetLayer
82400
82433
  | WFSLayer
82401
82434
  | OGCFeatureLayer
82402
82435
  | StreamLayer
@@ -82442,6 +82475,7 @@ declare namespace __esri {
82442
82475
  | SceneLayer
82443
82476
  | CSVLayer
82444
82477
  | GeoJSONLayer
82478
+ | ParquetLayer
82445
82479
  | WFSLayer
82446
82480
  | OGCFeatureLayer
82447
82481
  | StreamLayer
@@ -82486,6 +82520,7 @@ declare namespace __esri {
82486
82520
  | SceneLayer
82487
82521
  | CSVLayer
82488
82522
  | GeoJSONLayer
82523
+ | ParquetLayer
82489
82524
  | WFSLayer
82490
82525
  | OGCFeatureLayer
82491
82526
  | StreamLayer
@@ -82674,6 +82709,7 @@ declare namespace __esri {
82674
82709
  | SceneLayer
82675
82710
  | CSVLayer
82676
82711
  | GeoJSONLayer
82712
+ | ParquetLayer
82677
82713
  | WFSLayer
82678
82714
  | OGCFeatureLayer
82679
82715
  | StreamLayer
@@ -82831,6 +82867,7 @@ declare namespace __esri {
82831
82867
  | SceneLayer
82832
82868
  | CSVLayer
82833
82869
  | GeoJSONLayer
82870
+ | ParquetLayer
82834
82871
  | WFSLayer
82835
82872
  | OGCFeatureLayer
82836
82873
  | StreamLayer
@@ -82901,6 +82938,7 @@ declare namespace __esri {
82901
82938
  | SceneLayer
82902
82939
  | CSVLayer
82903
82940
  | GeoJSONLayer
82941
+ | ParquetLayer
82904
82942
  | WFSLayer
82905
82943
  | OGCFeatureLayer
82906
82944
  | StreamLayer
@@ -83052,6 +83090,7 @@ declare namespace __esri {
83052
83090
  layer: | FeatureLayer
83053
83091
  | SceneLayer
83054
83092
  | CSVLayer
83093
+ | ParquetLayer
83055
83094
  | PointCloudLayer
83056
83095
  | GeoJSONLayer
83057
83096
  | WFSLayer
@@ -83122,6 +83161,7 @@ declare namespace __esri {
83122
83161
  layer: | FeatureLayer
83123
83162
  | CSVLayer
83124
83163
  | GeoJSONLayer
83164
+ | ParquetLayer
83125
83165
  | WFSLayer
83126
83166
  | OGCFeatureLayer
83127
83167
  | StreamLayer
@@ -83204,6 +83244,7 @@ declare namespace __esri {
83204
83244
  layer: | FeatureLayer
83205
83245
  | SceneLayer
83206
83246
  | CSVLayer
83247
+ | ParquetLayer
83207
83248
  | PointCloudLayer
83208
83249
  | GeoJSONLayer
83209
83250
  | WFSLayer
@@ -83266,6 +83307,7 @@ declare namespace __esri {
83266
83307
  | SceneLayer
83267
83308
  | CSVLayer
83268
83309
  | GeoJSONLayer
83310
+ | ParquetLayer
83269
83311
  | WFSLayer
83270
83312
  | OGCFeatureLayer
83271
83313
  | StreamLayer
@@ -83377,6 +83419,7 @@ declare namespace __esri {
83377
83419
  layer: | FeatureLayer
83378
83420
  | SceneLayer
83379
83421
  | CSVLayer
83422
+ | ParquetLayer
83380
83423
  | PointCloudLayer
83381
83424
  | GeoJSONLayer
83382
83425
  | WFSLayer
@@ -83443,6 +83486,7 @@ declare namespace __esri {
83443
83486
  | SceneLayer
83444
83487
  | CSVLayer
83445
83488
  | GeoJSONLayer
83489
+ | ParquetLayer
83446
83490
  | WFSLayer
83447
83491
  | OGCFeatureLayer
83448
83492
  | StreamLayer
@@ -83697,6 +83741,7 @@ declare namespace __esri {
83697
83741
  layer: | FeatureLayer
83698
83742
  | SceneLayer
83699
83743
  | CSVLayer
83744
+ | ParquetLayer
83700
83745
  | PointCloudLayer
83701
83746
  | GeoJSONLayer
83702
83747
  | WFSLayer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.33.0-next.20250410",
3
+ "version": "4.33.0-next.20250412",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const a="20250410",c="028c7a4f5cf8bd1a22848eb730441de04a3129a5";export{a as buildDate,c as commitHash};
5
+ const e="20250412",f="e6343edb3df84ef485349b2f7cbf15e3b633f6a2";export{e as buildDate,f as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{GeometryCursor as t}from"../../geometry/GeometryCursor.js";import{GeometricEffectOffsetMethod as e}from"./enums.js";const n=.03;class s{constructor(t=0,e=!1){}isEmpty(t){if(!t.nextPoint())return!0;let e,n,s,r;for(e=t.x,n=t.y;t.nextPoint();e=n,n=r)if(s=t.x,r=t.y,s!==e||r!==n)return t.seekPathStart(),!1;return t.seekPathStart(),!0}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);0!==e&&(t[0]/=e,t[1]/=e)}getLength(t,e,n,s){const r=n-t,o=s-e;return Math.sqrt(r*r+o*o)}getSegLength(t){const[[e,n],[s,r]]=t;return this.getLength(e,n,s,r)}getCoord2D(t,e,n,s,r){return[t+(n-t)*r,e+(s-e)*r]}getSegCoord2D(t,e){const[[n,s],[r,o]]=t;return this.getCoord2D(n,s,r,o,e)}getAngle(t,e,n,s,r){const o=n-t,i=s-e;return Math.atan2(i,o)}getAngleCS(t,e,n,s,r){const o=n-t,i=s-e,u=Math.sqrt(o*o+i*i);return u>0?[o/u,i/u]:[1,0]}getSegAngleCS(t,e){const[[n,s],[r,o]]=t;return this.getAngleCS(n,s,r,o,e)}cut(t,e,n,s,r,o){return[r<=0?[t,e]:this.getCoord2D(t,e,n,s,r),o>=1?[n,s]:this.getCoord2D(t,e,n,s,o)]}getSubCurve(e,n,s){const r=t.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(r,e,n,s)?r:null}appendSubCurve(t,e,n,s){t.startPath(),e.seekPathStart();let r=0,o=!0;if(!e.nextPoint())return!1;let i=e.x,u=e.y;for(;e.nextPoint();){const h=this.getLength(i,u,e.x,e.y);if(0!==h){if(o){if(r+h>n){const l=(n-r)/h;let a=1,c=!1;r+h>=s&&(a=(s-r)/h,c=!0);const f=this.cut(i,u,e.x,e.y,l,a);if(f&&t.pushPoints(f),c)break;o=!1}}else{if(r+h>s){const n=this.cut(i,u,e.x,e.y,0,(s-r)/h);n&&t.pushPoint(n[1]);break}t.pushXY(e.x,e.y)}r+=h,i=e.x,u=e.y}else i=e.x,u=e.y}return!0}getCIMPointAlong(t,e){if(!t.nextPoint())return null;let n,s,r,o,i=0;for(n=t.x,s=t.y;t.nextPoint();n=r,s=o){r=t.x,o=t.y;const u=this.getLength(n,s,r,o);if(0!==u){if(i+u>e){const t=(e-i)/u;return this.getCoord2D(n,s,r,o,t)}i+=u}}return null}offset(t,n,s,r,o){if(!t||t.length<2)return null;let i=0,u=t[i++],h=i;for(;i<t.length;){const e=t[i];e[0]===u[0]&&e[1]===u[1]||(i!==h&&(t[h]=t[i]),u=t[h++]),i++}const l=t[0][0]===t[h-1][0]&&t[0][1]===t[h-1][1];if(l&&--h,h<(l?3:2))return null;const a=[];u=l?t[h-1]:null;let c=t[0];for(let f=0;f<h;f++){const o=f===h-1?l?t[0]:null:t[f+1];if(u)if(o){const t=[o[0]-c[0],o[1]-c[1]];this.normalize(t);const i=[c[0]-u[0],c[1]-u[1]];this.normalize(i);const h=i[0]*t[1]-i[1]*t[0],l=i[0]*t[0]+i[1]*t[1];if(0===h&&1===l){c=o;continue}if(h>=0==n<=0){if(l<1){const e=[t[0]-i[0],t[1]-i[1]];this.normalize(e);const s=Math.sqrt((1+l)/2);if(s>1/r){const t=-Math.abs(n)/s;a.push([c[0]-e[0]*t,c[1]-e[1]*t])}}}else switch(s){case e.Mitered:{const e=Math.sqrt((1+l)/2);if(e>0&&1/e<r){const s=[t[0]-i[0],t[1]-i[1]];this.normalize(s);const r=Math.abs(n)/e;a.push([c[0]-s[0]*r,c[1]-s[1]*r]);break}}case e.Bevelled:a.push([c[0]+i[1]*n,c[1]-i[0]*n]),a.push([c[0]+t[1]*n,c[1]-t[0]*n]);break;case e.Rounded:if(l<1){a.push([c[0]+i[1]*n,c[1]-i[0]*n]);const e=Math.floor(2.5*(1-l));if(e>0){const s=1/e;let r=s;for(let o=1;o<e;o++,r+=s){const e=[i[1]*(1-r)+t[1]*r,-i[0]*(1-r)-t[0]*r];this.normalize(e),a.push([c[0]+e[0]*n,c[1]+e[1]*n])}}a.push([c[0]+t[1]*n,c[1]-t[0]*n])}break;case e.Square:default:if(h<0)a.push([c[0]+(i[1]+i[0])*n,c[1]+(i[1]-i[0])*n]),a.push([c[0]+(t[1]-t[0])*n,c[1]-(t[0]+t[1])*n]);else{const e=Math.sqrt((1+Math.abs(l))/2),s=[t[0]-i[0],t[1]-i[1]];this.normalize(s);const r=n/e;a.push([c[0]-s[0]*r,c[1]-s[1]*r])}}}else{const t=[c[0]-u[0],c[1]-u[1]];this.normalize(t),a.push([c[0]+t[1]*n,c[1]-t[0]*n])}else{const t=[o[0]-c[0],o[1]-c[1]];this.normalize(t),a.push([c[0]+t[1]*n,c[1]-t[0]*n])}u=c,c=o}return a.length<(l?3:2)?null:(l&&a.push([a[0][0],a[0][1]]),a)}}export{s as CurveHelper,n as pixelTolerance};
5
+ import{GeometryCursor as t}from"../../geometry/GeometryCursor.js";import{GeometricEffectOffsetMethod as e}from"./enums.js";const n=.03;class s{constructor(t=0,e=!1){}isEmpty(t){if(!t.nextPoint())return!0;let e,n,s,r;for(e=t.x,n=t.y;t.nextPoint();e=n,n=r)if(s=t.x,r=t.y,s!==e||r!==n)return t.seekPathStart(),!1;return t.seekPathStart(),!0}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);0!==e&&(t[0]/=e,t[1]/=e)}getLength(t,e,n,s){const r=n-t,o=s-e;return Math.sqrt(r*r+o*o)}getSegLength(t){const[[e,n],[s,r]]=t;return this.getLength(e,n,s,r)}getCoord2D(t,e,n,s,r){return[t+(n-t)*r,e+(s-e)*r]}getSegCoord2D(t,e){const[[n,s],[r,o]]=t;return this.getCoord2D(n,s,r,o,e)}getAngle(t,e,n,s,r){const o=n-t,i=s-e;return Math.atan2(i,o)}getAngleCS(t,e,n,s,r,o){null==t&&(t=[0,0]);const i=s-e,u=r-n,h=Math.sqrt(i*i+u*u);return 0!==h?(t[0]=i/h,t[1]=u/h,t):(t[0]=1,t[1]=0,t)}getSegAngleCS(t,e,n){const[[s,r],[o,i]]=e;return this.getAngleCS(t,s,r,o,i,n)}cut(t,e,n,s,r,o){return[r<=0?[t,e]:this.getCoord2D(t,e,n,s,r),o>=1?[n,s]:this.getCoord2D(t,e,n,s,o)]}getSubCurve(e,n,s){const r=t.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(r,e,n,s)?r:null}appendSubCurve(t,e,n,s){t.startPath(),e.seekPathStart();let r=0,o=!0;if(!e.nextPoint())return!1;let i=e.x,u=e.y;for(;e.nextPoint();){const h=this.getLength(i,u,e.x,e.y);if(0!==h){if(o){if(r+h>n){const l=(n-r)/h;let a=1,c=!1;r+h>=s&&(a=(s-r)/h,c=!0);const f=this.cut(i,u,e.x,e.y,l,a);if(f&&t.pushPoints(f),c)break;o=!1}}else{if(r+h>s){const n=this.cut(i,u,e.x,e.y,0,(s-r)/h);n&&t.pushPoint(n[1]);break}t.pushXY(e.x,e.y)}r+=h,i=e.x,u=e.y}else i=e.x,u=e.y}return!0}getCIMPointAlong(t,e){if(!t.nextPoint())return null;let n,s,r,o,i=0;for(n=t.x,s=t.y;t.nextPoint();n=r,s=o){r=t.x,o=t.y;const u=this.getLength(n,s,r,o);if(0!==u){if(i+u>e){const t=(e-i)/u;return this.getCoord2D(n,s,r,o,t)}i+=u}}return null}offset(t,n,s,r,o){if(!t||t.length<2)return null;let i=0,u=t[i++],h=i;for(;i<t.length;){const e=t[i];e[0]===u[0]&&e[1]===u[1]||(i!==h&&(t[h]=t[i]),u=t[h++]),i++}const l=t[0][0]===t[h-1][0]&&t[0][1]===t[h-1][1];if(l&&--h,h<(l?3:2))return null;const a=[];u=l?t[h-1]:null;let c=t[0];for(let f=0;f<h;f++){const o=f===h-1?l?t[0]:null:t[f+1];if(u)if(o){const t=[o[0]-c[0],o[1]-c[1]];this.normalize(t);const i=[c[0]-u[0],c[1]-u[1]];this.normalize(i);const h=i[0]*t[1]-i[1]*t[0],l=i[0]*t[0]+i[1]*t[1];if(0===h&&1===l){c=o;continue}if(h>=0==n<=0){if(l<1){const e=[t[0]-i[0],t[1]-i[1]];this.normalize(e);const s=Math.sqrt((1+l)/2);if(s>1/r){const t=-Math.abs(n)/s;a.push([c[0]-e[0]*t,c[1]-e[1]*t])}}}else switch(s){case e.Mitered:{const e=Math.sqrt((1+l)/2);if(e>0&&1/e<r){const s=[t[0]-i[0],t[1]-i[1]];this.normalize(s);const r=Math.abs(n)/e;a.push([c[0]-s[0]*r,c[1]-s[1]*r]);break}}case e.Bevelled:a.push([c[0]+i[1]*n,c[1]-i[0]*n]),a.push([c[0]+t[1]*n,c[1]-t[0]*n]);break;case e.Rounded:if(l<1){a.push([c[0]+i[1]*n,c[1]-i[0]*n]);const e=Math.floor(2.5*(1-l));if(e>0){const s=1/e;let r=s;for(let o=1;o<e;o++,r+=s){const e=[i[1]*(1-r)+t[1]*r,-i[0]*(1-r)-t[0]*r];this.normalize(e),a.push([c[0]+e[0]*n,c[1]+e[1]*n])}}a.push([c[0]+t[1]*n,c[1]-t[0]*n])}break;case e.Square:default:if(h<0)a.push([c[0]+(i[1]+i[0])*n,c[1]+(i[1]-i[0])*n]),a.push([c[0]+(t[1]-t[0])*n,c[1]-(t[0]+t[1])*n]);else{const e=Math.sqrt((1+Math.abs(l))/2),s=[t[0]-i[0],t[1]-i[1]];this.normalize(s);const r=n/e;a.push([c[0]-s[0]*r,c[1]-s[1]*r])}}}else{const t=[c[0]-u[0],c[1]-u[1]];this.normalize(t),a.push([c[0]+t[1]*n,c[1]-t[0]*n])}else{const t=[o[0]-c[0],o[1]-c[1]];this.normalize(t),a.push([c[0]+t[1]*n,c[1]-t[0]*n])}u=c,c=o}return a.length<(l?3:2)?null:(l&&a.push([a[0][0],a[0][1]]),a)}}export{s as CurveHelper,n as pixelTolerance};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{GeometryCursor as t}from"../../geometry/GeometryCursor.js";import{CurveHelper as e,pixelTolerance as s}from"./CurveHelper.js";const n=1e-7;class i{constructor(){this._values=[],this.extPtGap=0,this.ctrlPtGap=0,this._length=0,this._currentValue=0}isEmpty(){return 0===this._values.length}size(){return this._values.length}init(t,e,s=!0){if(this._setEmpty(),!t||0===t.length)return!1;for(let i=0;i<t.length;i++){let e=Math.abs(t[i]);s&&e<n&&(e=n),this._values.push(e),this._length+=e}return e&&1&t.length&&(this._length*=2),0!==this._length&&(this.ctrlPtGap=this.extPtGap=0,this._currentValue=-1,!0)}scale(t){const e=this._values?this._values.length:0;for(let s=0;s<e;++s)this._values[s]*=t;this._length*=t,this.extPtGap*=t,this.ctrlPtGap*=t}addValue(t){this._length+=t,this._values.push(t)}firstValue(){return this._values[0]}lastValue(){return this._values[this._values.length-1]}nextValue(){return this._currentValue++,this._currentValue===this._values.length&&(this._currentValue=0),this._values[this._currentValue]}reset(){this._currentValue=-1}length(){return this._length}_setEmpty(){this.extPtGap=this.ctrlPtGap=this._length=0,this._currentValue=-1,this._values.length=0}}class h{constructor(){this.pt=null,this.ca=0,this.sa=0}}var r;!function(t){t[t.FAIL=0]="FAIL",t[t.END=1]="END",t[t.CONTINUE=2]="CONTINUE"}(r||(r={}));class a{constructor(){this.reset()}reset(){this.segment=null,this.segmentLength=0,this.abscissa=0,this.isPathEnd=!1,this.isPartEnd=!1}isValid(){return null!==this.segment}copyTo(t){t.segment=this.segment,t.segmentLength=this.segmentLength,t.abscissa=this.abscissa,t.isPathEnd=this.isPathEnd,t.isPartEnd=this.isPartEnd}}class o extends e{constructor(t=0,e=!1){super(t,e),this._tolerance=s,this._currentPosition=new a}updateTolerance(t){this._tolerance=s*t}init(t,e,s=!0){return s?(this._patternLength=e.length(),this._partExtPtGap=e.extPtGap,this._partCtrlPtGap=e.ctrlPtGap):(this._patternLength=0,this._partExtPtGap=0,this._partCtrlPtGap=0),this._currentPosition.reset(),this._partSegCount=0,this._pathCursor=t,this._seg=-1,this._setPosAtNextPart()}curPositionIsValid(){return this._currentPosition.isValid()}nextPosition(t,e=r.FAIL){const s=new a;return!!this._nextPosition(t,s,null,e)&&(s.copyTo(this._currentPosition),!0)}curPointAndAngle(t){t.pt=this._getPoint(this._currentPosition);const[e,s]=this._getAngleCS(this._currentPosition);t.ca=e,t.sa=s}nextPointAndAngle(t,e,s=r.FAIL){const n=new a;if(!this._nextPosition(t,n,null,s))return!1;n.copyTo(this._currentPosition),e.pt=this._getPoint(n);const[i,h]=this._getAngleCS(n);return e.ca=i,e.sa=h,!0}nextCurve(e){if(0===e)return null;const s=t.createEmptyOptimizedCIM("esriGeometryPolyline");s.startPath(),s.nextPath();const n=new a;return this._nextPosition(e,n,s,r.END)?(n.copyTo(this._currentPosition),s):null}isPathEnd(){return this._currentPosition.isPathEnd}getPathEnd(){return this._currentPosition.segment[1]}getPt(t){return this._pathCursor.seekInPath(t),[this._pathCursor.x,this._pathCursor.y]}getSeg(t){return[this.getPt(t),this.getPt(t+1)]}_nextPosition(t,e,s,n){if(this._currentPosition.isPathEnd)return!1;let i=this._currentPosition.abscissa;for(this._currentPosition.segmentLength>0&&(i/=this._currentPosition.segmentLength),this._currentPosition.copyTo(e);e.abscissa+t*this._partLengthRatio>e.segmentLength+this._tolerance;){if(s){if(0===s.pathSize)if(0===i){const t=e.segment[0];s.pushXY(t[0],t[1])}else s.pushPoint(this.getSegCoord2D(e.segment,i));const t=e.segment[1];s.pushXY(t[0],t[1])}if(i=0,t-=(e.segmentLength-e.abscissa)/this._partLengthRatio,this._partSegCount)e.segment=this._nextSegment(),e.segmentLength=this.getSegLength(e.segment),e.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return n!==r.FAIL&&(e.segmentLength=this.getSegLength(e.segment),e.isPartEnd=!0,n===r.END?(e.abscissa=e.segmentLength,e.isPathEnd=!0):e.abscissa=e.segmentLength+t,!0);this._currentPosition.copyTo(e)}}if(e.abscissa+=t*this._partLengthRatio,s){0===s.pathSize&&(0===i?s.pushPoint(e.segment[0]):s.pushPoint(this.getSegCoord2D(e.segment,i)));const t=e.abscissa/e.segmentLength;1===t?s.pushPoint(e.segment[1]):s.pushPoint(this.getSegCoord2D(e.segment,t))}return this._partSegCount||Math.abs(e.abscissa-e.segmentLength)<this._tolerance&&(e.isPathEnd=this._partIsLast,e.isPartEnd=!0),!0}_getPoint(t){const e=t.segmentLength<=0?0:t.abscissa/t.segmentLength;return this.getSegCoord2D(this._currentPosition.segment,e)}_getAngleCS(t){const e=t.segmentLength<=0?0:t.abscissa/t.segmentLength;return this.getSegAngleCS(this._currentPosition.segment,e)}_setPosAtNextPart(){for(;this._partSegCount;)this._hasNextSegment()&&this._nextSegment(),this._partSegCount--;if(!this._hasNextSegment())return!1;for(this._partLength=0,this._partIsLast=!0,this._partSegCount=0;this._hasNextSegment();)if(this._partLength+=this.getSegLength(this._nextSegment()),this._partSegCount++,this._pathCursor.getControlPointAt(this._getEndPointIndex())){this._partIsLast=!this._hasNextSegment();break}let t=this._partSegCount;for(;t;)this._previousSegment(),--t;this._currentPosition.segment=this._nextSegment(),this._currentPosition.segmentLength=this.getSegLength(this._currentPosition.segment),this._currentPosition.abscissa=0,this._currentPosition.isPathEnd=this._currentPosition.isPartEnd=!1,--this._partSegCount;const e=this._getStartPointIndex();this._ctrlPtBegin=this._pathCursor.getControlPointAt(e);let s=e+this._partSegCount+1;if(s>=this._pathCursor.pathSize&&(s=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(s),this._patternLength>0){const t=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,e=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let s=Math.round((this._partLength-(t+e))/this._patternLength);s<=0&&(s=t+e>0?0:1),this._partLengthRatio=this._partLength/(t+e+s*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg<this._pathCursor.pathSize-2}_previousSegment(){return this.getSeg(--this._seg)}_nextSegment(){return this.getSeg(++this._seg)}_getStartPointIndex(){return this._seg}_getEndPointIndex(){return this._seg+1}}export{i as DashPattern,r as EndType,o as GeometryWalker,h as Pos};
5
+ import{GeometryCursor as t}from"../../geometry/GeometryCursor.js";import{CurveHelper as e,pixelTolerance as s}from"./CurveHelper.js";const i=1e-7;class n{constructor(){this._values=[],this.extPtGap=0,this.ctrlPtGap=0,this._length=0,this._currentValue=0}isEmpty(){return 0===this._values.length}size(){return this._values.length}init(t,e,s=!0){if(this._setEmpty(),!t||0===t.length)return!1;for(let n=0;n<t.length;n++){let e=Math.abs(t[n]);s&&e<i&&(e=i),this._values.push(e),this._length+=e}return e&&1&t.length&&(this._length*=2),0!==this._length&&(this.ctrlPtGap=this.extPtGap=0,this._currentValue=-1,!0)}scale(t){const e=this._values?this._values.length:0;for(let s=0;s<e;++s)this._values[s]*=t;this._length*=t,this.extPtGap*=t,this.ctrlPtGap*=t}addValue(t){this._length+=t,this._values.push(t)}firstValue(){return this._values[0]}lastValue(){return this._values[this._values.length-1]}nextValue(){return this._currentValue++,this._currentValue===this._values.length&&(this._currentValue=0),this._values[this._currentValue]}reset(){this._currentValue=-1}length(){return this._length}_setEmpty(){this.extPtGap=this.ctrlPtGap=this._length=0,this._currentValue=-1,this._values.length=0}}class h{constructor(){this.pt=null,this.ca=0,this.sa=0}}var r;!function(t){t[t.FAIL=0]="FAIL",t[t.END=1]="END",t[t.CONTINUE=2]="CONTINUE"}(r||(r={}));class a{constructor(){this.reset()}reset(){this.segment=null,this.segmentLength=0,this.abscissa=0,this.isPathEnd=!1,this.isPartEnd=!1}isValid(){return null!==this.segment}copyTo(t){t.segment=this.segment,t.segmentLength=this.segmentLength,t.abscissa=this.abscissa,t.isPathEnd=this.isPathEnd,t.isPartEnd=this.isPartEnd}}class o extends e{constructor(t=0,e=!1){super(t,e),this._tempPos=new a,this._tempPt=[0,0],this._tolerance=s,this._currentPosition=new a}updateTolerance(t){this._tolerance=s*t}init(t,e,s=!0){return s?(this._patternLength=e.length(),this._partExtPtGap=e.extPtGap,this._partCtrlPtGap=e.ctrlPtGap):(this._patternLength=0,this._partExtPtGap=0,this._partCtrlPtGap=0),this._currentPosition.reset(),this._partSegCount=0,this._pathCursor=t,this._seg=-1,this._setPosAtNextPart()}curPositionIsValid(){return this._currentPosition.isValid()}nextPosition(t,e=r.FAIL){const s=new a;return!!this._nextPosition(t,s,null,e)&&(s.copyTo(this._currentPosition),!0)}curPointAndAngle(t){t.pt=this._getPoint(this._currentPosition);const[e,s]=this._getAngleCS(this._tempPt,this._currentPosition);t.ca=e,t.sa=s}nextPointAndAngle(t,e,s=r.FAIL){const i=this._tempPos;if(!this._nextPosition(t,i,null,s))return!1;i.copyTo(this._currentPosition),e.pt=this._getPoint(i);const[n,h]=this._getAngleCS(this._tempPt,i);return e.ca=n,e.sa=h,!0}nextCurve(e){if(0===e)return null;const s=t.createEmptyOptimizedCIM("esriGeometryPolyline");s.startPath(),s.nextPath();const i=new a;return this._nextPosition(e,i,s,r.END)?(i.copyTo(this._currentPosition),s):null}isPathEnd(){return this._currentPosition.isPathEnd}getPathEnd(){return this._currentPosition.segment[1]}getPt(t){return this._pathCursor.seekInPath(t),[this._pathCursor.x,this._pathCursor.y]}getSeg(t){return[this.getPt(t),this.getPt(t+1)]}_nextPosition(t,e,s,i){if(this._currentPosition.isPathEnd)return!1;let n=this._currentPosition.abscissa;for(this._currentPosition.segmentLength>0&&(n/=this._currentPosition.segmentLength),this._currentPosition.copyTo(e);e.abscissa+t*this._partLengthRatio>e.segmentLength+this._tolerance;){if(s){if(0===s.pathSize)if(0===n){const t=e.segment[0];s.pushXY(t[0],t[1])}else s.pushPoint(this.getSegCoord2D(e.segment,n));const t=e.segment[1];s.pushXY(t[0],t[1])}if(n=0,t-=(e.segmentLength-e.abscissa)/this._partLengthRatio,this._partSegCount)e.segment=this._nextSegment(),e.segmentLength=this.getSegLength(e.segment),e.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return i!==r.FAIL&&(e.segmentLength=this.getSegLength(e.segment),e.isPartEnd=!0,i===r.END?(e.abscissa=e.segmentLength,e.isPathEnd=!0):e.abscissa=e.segmentLength+t,!0);this._currentPosition.copyTo(e)}}if(e.abscissa+=t*this._partLengthRatio,s){0===s.pathSize&&(0===n?s.pushPoint(e.segment[0]):s.pushPoint(this.getSegCoord2D(e.segment,n)));const t=e.abscissa/e.segmentLength;1===t?s.pushPoint(e.segment[1]):s.pushPoint(this.getSegCoord2D(e.segment,t))}return this._partSegCount||Math.abs(e.abscissa-e.segmentLength)<this._tolerance&&(e.isPathEnd=this._partIsLast,e.isPartEnd=!0),!0}_getPoint(t){const e=t.segmentLength<=0?0:t.abscissa/t.segmentLength;return this.getSegCoord2D(this._currentPosition.segment,e)}_getAngleCS(t,e){const s=e.segmentLength<=0?0:e.abscissa/e.segmentLength;return this.getSegAngleCS(t,this._currentPosition.segment,s)}_setPosAtNextPart(){for(;this._partSegCount;)this._hasNextSegment()&&this._nextSegment(),this._partSegCount--;if(!this._hasNextSegment())return!1;for(this._partLength=0,this._partIsLast=!0,this._partSegCount=0;this._hasNextSegment();)if(this._partLength+=this.getSegLength(this._nextSegment()),this._partSegCount++,this._pathCursor.getControlPointAt(this._getEndPointIndex())){this._partIsLast=!this._hasNextSegment();break}let t=this._partSegCount;for(;t;)this._previousSegment(),--t;this._currentPosition.segment=this._nextSegment(),this._currentPosition.segmentLength=this.getSegLength(this._currentPosition.segment),this._currentPosition.abscissa=0,this._currentPosition.isPathEnd=this._currentPosition.isPartEnd=!1,--this._partSegCount;const e=this._getStartPointIndex();this._ctrlPtBegin=this._pathCursor.getControlPointAt(e);let s=e+this._partSegCount+1;if(s>=this._pathCursor.pathSize&&(s=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(s),this._patternLength>0){const t=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,e=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let s=Math.round((this._partLength-(t+e))/this._patternLength);s<=0&&(s=t+e>0?0:1),this._partLengthRatio=this._partLength/(t+e+s*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg<this._pathCursor.pathSize-2}_previousSegment(){return this.getSeg(--this._seg)}_nextSegment(){return this.getSeg(++this._seg)}_getStartPointIndex(){return this._seg}_getEndPointIndex(){return this._seg+1}}export{n as DashPattern,r as EndType,o as GeometryWalker,h as Pos};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";import{ExtremityPlacement as s}from"../enums.js";class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,s,i,n){return new r(t,e,s)}}class r extends t{constructor(t,s,i){super(t,!1,!0),this._curveHelper=new e,this._placePerPart=s.placePerPart??!1,this._angleToLine=void 0===s.angleToLine||s.angleToLine,this._offset=void 0!==s.offset?s.offset*i:0,this._type=s.extremityPlacement,this._position=void 0!==s.offsetAlongLine?s.offsetAlongLine*i:0,this._beginProcessed=!1}processMultiPath(t){return this._placePerPart?super.processMultiPath(t):this.processPath(t)}processPath(t){let e;switch(this._type){case s.Both:default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case s.JustBegin:e=this._atExtremities(t,this._position,!0);break;case s.JustEnd:e=this._atExtremities(t,this._position,!1);case s.None:}return e}_atExtremities(t,e,s){if(this._placePerPart||(s?t.seekPath(0):t.seekPath(t.totalSize-1)),s||t.seekPathEnd(),s?t.nextPoint():t.prevPoint()){let i=0,[r,n]=[0,0],[a,o]=[t.x,t.y];for(;s?t.nextPoint():t.prevPoint();){r=a,n=o,a=t.x,o=t.y;const s=this._curveHelper.getLength(r,n,a,o);if(i+s>e){const t=(e-i)/s,[h,l]=this._curveHelper.getAngleCS(r,n,a,o,t),c=this._curveHelper.getCoord2D(r,n,a,o,t);return this.internalPlacement.setTranslate(c[0]-this._offset*l,c[1]+this._offset*h),this._angleToLine&&this.internalPlacement.setRotateCS(-h,-l),this.internalPlacement}i+=s}}return null}}export{i as PlacementAtExtremities};
5
+ import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";import{ExtremityPlacement as s}from"../enums.js";class i{static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,s,i,n){return new r(t,e,s)}}class r extends t{constructor(t,s,i){super(t,!1,!0),this._curveHelper=new e,this._placePerPart=s.placePerPart??!1,this._angleToLine=void 0===s.angleToLine||s.angleToLine,this._offset=void 0!==s.offset?s.offset*i:0,this._type=s.extremityPlacement,this._position=void 0!==s.offsetAlongLine?s.offsetAlongLine*i:0,this._beginProcessed=!1}processMultiPath(t){return this._placePerPart?super.processMultiPath(t):this.processPath(t)}processPath(t){let e;switch(this._type){case s.Both:default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case s.JustBegin:e=this._atExtremities(t,this._position,!0);break;case s.JustEnd:e=this._atExtremities(t,this._position,!1);case s.None:}return e}_atExtremities(t,e,s){if(this._placePerPart||(s?t.seekPath(0):t.seekPath(t.totalSize-1)),s||t.seekPathEnd(),s?t.nextPoint():t.prevPoint()){let i=0,[r,n]=[0,0],[a,o]=[t.x,t.y];const h=[0,0];for(;s?t.nextPoint():t.prevPoint();){r=a,n=o,a=t.x,o=t.y;const s=this._curveHelper.getLength(r,n,a,o);if(i+s>e){const t=(e-i)/s,[l,c]=this._curveHelper.getAngleCS(h,r,n,a,o,t),P=this._curveHelper.getCoord2D(r,n,a,o,t);return this.internalPlacement.setTranslate(P[0]-this._offset*c,P[1]+this._offset*l),this._angleToLine&&this.internalPlacement.setRotateCS(-l,-c),this.internalPlacement}i+=s}}return null}}export{i as PlacementAtExtremities};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";import{PlacementOnLineRelativeTo as n}from"../enums.js";const i=.001;class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,e,n,i,s){return new r(t,e,n)}}class r extends t{constructor(t,n,s){super(t),this._curveHelper=new e,this._angleToLine=void 0===n.angleToLine||n.angleToLine,this._offset=void 0!==n.offset?n.offset*s:0,this._relativeTo=n.relativeTo,this._position=void 0!==n.startPointOffset?n.startPointOffset*s:0,this._epsilon=i*s}processPath(t){const e=this._position;if(this._relativeTo===n.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),t.nextPoint()){let[e,n]=[t.x,t.y],[i,s]=[0,0];for(;t.nextPoint();){i=t.x,s=t.y;const r=this._curveHelper.getLength(e,n,i,s);if(r<this._epsilon){e=i,n=s;continue}const o=.5+this._position/r,[a,l]=this._curveHelper.getAngleCS(e,n,i,s,o),h=this._curveHelper.getCoord2D(e,n,i,s,o);return this.internalPlacement.setTranslate(h[0]-this._offset*l,h[1]+this._offset*a),this._angleToLine&&this.internalPlacement.setRotateCS(a,l),this.internalPlacement}}return this.iteratePath=!1,null}const i=this._relativeTo===n.LineEnd;return this.onLine(t,e,i)}onLine(t,e,i){let s,r=!1;switch(this._relativeTo){case n.LineMiddle:default:t.seekPathStart(),s=t.pathLength()/2+e;break;case n.LineBeginning:s=e;break;case n.LineEnd:s=e,r=!0}i?t.seekPathEnd():t.seekPathStart();let o=0;if(i?t.prevPoint():t.nextPoint()){let[e,n]=[t.x,t.y],[a,l]=[0,0];for(;i?t.prevPoint():t.nextPoint();){a=t.x,l=t.y;const i=this._curveHelper.getLength(e,n,a,l);if(o+i>s){const t=(s-o)/i,[h,c]=this._curveHelper.getAngleCS(e,n,a,l,t),f=this._curveHelper.getCoord2D(e,n,a,l,t),u=r?-this._offset:this._offset;return this.internalPlacement.setTranslate(f[0]-u*c,f[1]+u*h),this._angleToLine&&(r?this.internalPlacement.setRotateCS(-h,-c):this.internalPlacement.setRotateCS(h,c)),this.internalPlacement}e=a,n=l,o+=i}}return null}}export{s as PlacementOnLine};
5
+ import{PathTransformationCursor as t}from"../CIMCursor.js";import{CurveHelper as e}from"../CurveHelper.js";import{PlacementOnLineRelativeTo as n}from"../enums.js";const i=.001;class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,e,n,i,s){return new r(t,e,n)}}class r extends t{constructor(t,n,s){super(t),this._curveHelper=new e,this._angleToLine=void 0===n.angleToLine||n.angleToLine,this._offset=void 0!==n.offset?n.offset*s:0,this._relativeTo=n.relativeTo,this._position=void 0!==n.startPointOffset?n.startPointOffset*s:0,this._epsilon=i*s}processPath(t){const e=this._position;if(this._relativeTo===n.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),t.nextPoint()){let[e,n]=[t.x,t.y],[i,s]=[0,0];const r=[0,0];for(;t.nextPoint();){i=t.x,s=t.y;const o=this._curveHelper.getLength(e,n,i,s);if(o<this._epsilon){e=i,n=s;continue}const a=.5+this._position/o,[l,h]=this._curveHelper.getAngleCS(r,e,n,i,s,a),c=this._curveHelper.getCoord2D(e,n,i,s,a);return this.internalPlacement.setTranslate(c[0]-this._offset*h,c[1]+this._offset*l),this._angleToLine&&this.internalPlacement.setRotateCS(l,h),this.internalPlacement}}return this.iteratePath=!1,null}const i=this._relativeTo===n.LineEnd;return this.onLine(t,e,i)}onLine(t,e,i){let s,r=!1;switch(this._relativeTo){case n.LineMiddle:default:t.seekPathStart(),s=t.pathLength()/2+e;break;case n.LineBeginning:s=e;break;case n.LineEnd:s=e,r=!0}i?t.seekPathEnd():t.seekPathStart();let o=0;if(i?t.prevPoint():t.nextPoint()){let[e,n]=[t.x,t.y],[a,l]=[0,0];const h=[0,0];for(;i?t.prevPoint():t.nextPoint();){a=t.x,l=t.y;const i=this._curveHelper.getLength(e,n,a,l);if(o+i>s){const t=(s-o)/i,[c,f]=this._curveHelper.getAngleCS(h,e,n,a,l,t),u=this._curveHelper.getCoord2D(e,n,a,l,t),_=r?-this._offset:this._offset;return this.internalPlacement.setTranslate(u[0]-_*f,u[1]+_*c),this._angleToLine&&(r?this.internalPlacement.setRotateCS(-c,-f):this.internalPlacement.setRotateCS(c,f)),this.internalPlacement}e=a,n=l,o+=i}}return null}}export{s as PlacementOnLine};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as e}from"../../../../../../../core/mathUtils.js";import{disposeMaybe as t}from"../../../../../../../core/maybe.js";import{isSVG as i}from"../../../../../../../core/urlUtils.js";import{simplePipelineState as r}from"../../utils.js";import{Technique as s}from"../Technique.js";import{TechniqueType as o}from"../TechniqueType.js";import{MagnifierShader as a}from"../shaders/MagnifierShader.js";import{PixelFormat as n,TextureWrapMode as u,TextureSamplingMode as h}from"../../../../../../webgl/enums.js";import{Texture as p}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as c}from"../../../../../../webgl/TextureDescriptor.js";class l extends s{constructor(){super(...arguments),this.type=o.Magnifier,this._resourcePixelRatio=1,this._position=[0,0,0,0],this.shaders={magnifier:new a}}updateResources(t,i,r,s){t.pixelRatio!==this._resourcePixelRatio&&this._destroyResources(),this._readbackTexture||this._initializeResources(t,i,r,s);const{context:o,pixelRatio:a}=t,{factor:n,offset:u,position:h}=s,{size:p}=t.state,c=s.size*a,l=1/n,m=Math.ceil(l*c);this._readbackTexture.resize(m,m);const x=a*p[0],d=a*p[1],_=.5*m,T=.5*m,f=e(a*h.x,_,x-_-1),g=e(d-a*h.y,T,d-T-1),R=f-_,w=g-T,b=this._readbackTexture;o.bindTexture(b,0),o.gl.copyTexImage2D(b.descriptor.target,0,b.descriptor.pixelFormat,R,w,m,m,0);const y=(f+u.x*a)/x*2-1,M=(g-u.y*a)/d*2-1,k=c/x*2,j=c/d*2;this._position[0]=y,this._position[1]=M,this._position[2]=k,this._position[3]=j}render(e,t){const{context:i,painter:s}=e;s.setPipelineState(r);const o={readbackTexture:{texture:this._readbackTexture,unit:0},maskTexture:{texture:this._maskTexture,unit:7},overlayTexture:{texture:this._overlayTexture,unit:6},drawPos:this._position,...t};s.submitDrawMesh(i,{shader:this.shaders.magnifier,uniforms:{config:o},defines:null,optionalAttributes:null,useComputeBuffer:!1},s.quadMesh)}shutdown(){this._destroyResources()}_initializeResources(e,t,r,s){const o=e.context;this._resourcePixelRatio=e.pixelRatio;const a=Math.ceil(s.size*e.pixelRatio);r.width=a,r.height=a;const l=new c;l.internalFormat=n.RGBA,l.wrapMode=u.CLAMP_TO_EDGE,l.samplingMode=h.NEAREST,l.flipped=!0,l.preMultiplyAlpha=!i(r.src)||!e.context.driverTest.svgPremultipliesAlpha.result,this._overlayTexture=new p(o,l,r),t.width=a,t.height=a,l.pixelFormat=l.internalFormat=n.ALPHA,this._maskTexture=new p(o,l,t);const m=1/s.factor;l.pixelFormat=l.internalFormat=n.RGBA,l.width=l.height=Math.ceil(m*a),l.samplingMode=h.LINEAR,l.flipped=!1,this._readbackTexture=new p(o,l)}_destroyResources(){t(this._maskTexture),t(this._overlayTexture),t(this._readbackTexture)}}export{l as MagnifierTechnique};
5
+ import{clamp as e}from"../../../../../../../core/mathUtils.js";import{disposeMaybe as t}from"../../../../../../../core/maybe.js";import{isSVG as i}from"../../../../../../../core/urlUtils.js";import{simplePipelineState as r}from"../../utils.js";import{Technique as s}from"../Technique.js";import{TechniqueType as o}from"../TechniqueType.js";import{MagnifierShader as a}from"../shaders/MagnifierShader.js";import{PixelFormat as n,TextureWrapMode as u,TextureSamplingMode as h}from"../../../../../../webgl/enums.js";import{Texture as l}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as c}from"../../../../../../webgl/TextureDescriptor.js";class p extends s{constructor(){super(...arguments),this.type=o.Magnifier,this._resourcePixelRatio=1,this._position=[0,0,0,0],this.shaders={magnifier:new a}}updateResources(t,i,r,s){t.pixelRatio!==this._resourcePixelRatio&&this._destroyResources(),this._readbackTexture||this._initializeResources(t,i,r,s);const{context:o,pixelRatio:a}=t,{factor:n,offset:u,position:h}=s,{size:l}=t.state,c=s.size*a,p=1/n,x=Math.ceil(p*c);this._readbackTexture.resize(x,x);const m=a*l[0],d=a*l[1],_=.5*x,T=.5*x,f=e(a*h.x,_,m-_-1),g=e(d-a*h.y,T,d-T-1),R=f-_,b=g-T,w=this._readbackTexture;o.bindTexture(w,0),o.gl.copyTexImage2D(w.descriptor.target,0,w.descriptor.pixelFormat,R,b,x,x,0);const y=(f+u.x*a)/m*2-1,k=(g-u.y*a)/d*2-1,M=c/m*2,j=c/d*2;this._position[0]=y,this._position[1]=k,this._position[2]=M,this._position[3]=j}render(e,t){const{context:i,painter:s}=e;s.setPipelineState(r);const o={readbackTexture:{texture:this._readbackTexture,unit:0},maskTexture:{texture:this._maskTexture,unit:7},overlayTexture:{texture:this._overlayTexture,unit:6},drawPos:this._position,...t};s.submitDrawMesh(i,{shader:this.shaders.magnifier,uniforms:{config:o},defines:null,optionalAttributes:null,useComputeBuffer:!1},s.quadMesh)}shutdown(){this._destroyResources()}_initializeResources(e,t,r,s){const o=e.context;this._resourcePixelRatio=e.pixelRatio;const a=Math.ceil(s.size*e.pixelRatio);r.width=a,r.height=a;const p=new c;p.internalFormat=n.RGBA,p.wrapMode=u.CLAMP_TO_EDGE,p.samplingMode=h.NEAREST,p.flipped=!0,p.preMultiplyAlpha=!i(r.src)||!e.context.driverTest.svgPremultipliesAlpha.result,this._overlayTexture=new l(o,p,r),t.width=a,t.height=a,p.pixelFormat=p.internalFormat=n.ALPHA,this._maskTexture=new l(o,p,t);const x=1/s.factor;p.pixelFormat=p.internalFormat=n.RGBA,p.width=p.height=Math.ceil(x*a),p.samplingMode=h.LINEAR,p.flipped=!1,this._readbackTexture=new l(o,p)}_destroyResources(){t(this._maskTexture),t(this._overlayTexture),t(this._readbackTexture),this._maskTexture=null,this._overlayTexture=null,this._readbackTexture=null}}export{p as MagnifierTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{identity as t,translate as r,rotate as o}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as s}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as a}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{GeometryCursor as i}from"../../../../../../../geometry/GeometryCursor.js";import{clipCursorToTileExtent as n}from"../../../../../../../symbols/cim/CIMEffects.js";import{maxTileCoordValue as c}from"../../../../../../../symbols/cim/constants.js";import{Alignment as m}from"../../../../../../../symbols/cim/enums.js";import{CIMMarkerPlacementHelper as l}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{minMaxZoomPrecisionFactor as d}from"../../../definitions.js";import{getMinMaxZoom as u,processColorInput as p,packByteSqrt as h,getBitMask as f}from"../fill/meshWriterUtils.js";import{ComputedMarkerParams as y}from"./ComputedMarkerParams.js";import{MarkerConstants as x}from"./markerConstants.js";import{getGeometryEngine as M}from"../mesh/loadGeometryEngine.js";import{MeshWriter as P}from"../mesh/MeshWriter.js";import{DataType as g}from"../../../../../../webgl/enums.js";const b=3.14159265359/180,k=128/Math.PI;function v(e,t){return e%=t,Math.abs(e>=0?e:e+t)}function S(e){return v(e*k,256)}function I(e,a,i,n,c=!1){const m=s(),l=c?1:-1;return t(m),(a||i)&&r(m,m,[a,-i]),n&&o(m,m,l*b*-n),m}const _={createComputedParams:e=>y.from(e),optionalAttributes:{zoomRange:{type:g.SHORT,count:2,packPrecisionFactor:d,pack:({scaleInfo:e},{tileInfo:t})=>u(e,t)}},attributes:{pos:{type:g.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:g.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:g.UNSIGNED_BYTE,count:1,pack:({sprite:e,alignment:t,scaleSymbolsProportionally:r,overrideOutlineColor:o,colorLocked:s})=>{let a=0;return e.sdf&&(a|=f(x.bitset.isSDF)),t===m.MAP&&(a|=f(x.bitset.isMapAligned)),r&&(a|=f(x.bitset.scaleSymbolsProportionally)),o&&(a|=f(x.bitset.overrideOutlineColor)),s&&(a|=f(x.bitset.colorLocked)),a}},offset:{type:g.HALF_FLOAT,count:2,packAlternating:{count:4,pack:({angle:e,computedWidth:t,computedHeight:r,anchorX:o,anchorY:s,offsetX:i,offsetY:n,rotateClockwise:c})=>{const m=I(0,i,n,-e,c),l=-(.5+o)*t,d=-(.5-s)*r,u=[l,d],p=[l+t,d],h=[l,d+r],f=[l+t,d+r];return a(u,u,m),a(p,p,m),a(h,h,m),a(f,f,m),[u,p,h,f]}}},textureUV:{type:g.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:e,texXmin:t,texYmax:r,texYmin:o})=>[[t,o],[e,o],[t,r],[e,r]]}},color:{type:g.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>p(e)},outlineColor:{type:g.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>p(e)},sizing:{type:g.UNSIGNED_BYTE,count:4,pack:({rawWidth:e,rawHeight:t,outlineSize:r,referenceSize:o})=>{const s=Math.max(e,t);return[h(s,128),h(r,128),h(o,128),0]}},placementAngle:{type:g.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:e})=>S(e)},sdfDecodeCoeff:{type:g.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:e})=>e}}};class E extends P{constructor(){super(...arguments),this.vertexSpec=_}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(e,t,r){const o=this.evaluatedMeshParams.sprite?.textureBinding,s=t.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,o);const a=this.evaluatedMeshParams.minPixelBuffer,i=Math.max(this.evaluatedMeshParams.computedWidth,a),m=Math.max(this.evaluatedMeshParams.computedHeight,a),l=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,d=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,u=this.evaluatedMeshParams.offsetX+l,p=-this.evaluatedMeshParams.offsetY+d;if(null!=this.evaluatedMeshParams.placement){const o=n(r,100,!1);this._writePlacedMarkers(e,t,o,i,m)}else if(r?.nextPath()){r.nextPoint();const t=r.x,o=r.y;e.recordBounds(t+u,o+p,i,m),this._writeQuad(e,s,t,o)}else if("esriGeometryPolygon"===t.geometryType){const r=t.readCentroidForDisplay();if(!r)return;const[o,a]=r.coords;e.recordBounds(o+u,a+p,i,m),this._writeQuad(e,s,o,a)}else if("esriGeometryPoint"===t.geometryType){const r=t.readXForDisplay(),o=t.readYForDisplay();e.recordBounds(r+u,o+p,i,m),this._writeQuad(e,s,r,o)}else{const r=t.readGeometryForDisplay();r?.forEachVertex(((t,r)=>{e.recordBounds(t+u,r+p,i,m),Math.abs(t)>c||Math.abs(r)>c||this._writeQuad(e,s,t,r)}))}e.recordEnd()}_writePlacedMarkers(t,r,o,s,a){const n=o??i.fromFeatureSetReaderCIM(r);if(!n)return;const m=-1,d=l.getPlacement(n,m,this.evaluatedMeshParams.placement,e(1),t.id,M());if(!d)return;const u=r.getDisplayId();let p=d.next();const h=this.evaluatedMeshParams.offsetX,f=-this.evaluatedMeshParams.offsetY;for(;null!=p;){const e=p.tx,r=-p.ty;if(Math.abs(e)>c||Math.abs(r)>c){p=d.next();continue}const o=-p.getAngle();t.recordBounds(e+h,r+f,s,a),this._writeQuad(t,u,e,r,o),p=d.next()}}_writeQuad(e,t,r,o,s){const a=e.vertexCount(),i=null==s?null:{placementAngle:s};this._writeVertex(e,t,r,o,i),e.indexWrite(a+0),e.indexWrite(a+1),e.indexWrite(a+2),e.indexWrite(a+1),e.indexWrite(a+3),e.indexWrite(a+2)}}export{E as MarkerMeshWriter,_ as MarkerVertexSpec};
5
+ import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{identity as t,translate as r,rotate as o}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as s}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as a}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{GeometryCursor as i}from"../../../../../../../geometry/GeometryCursor.js";import{clipCursorToTileExtent as n}from"../../../../../../../symbols/cim/CIMEffects.js";import{maxTileCoordValue as c}from"../../../../../../../symbols/cim/constants.js";import{Alignment as m}from"../../../../../../../symbols/cim/enums.js";import{CIMMarkerPlacementHelper as l}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{minMaxZoomPrecisionFactor as u}from"../../../definitions.js";import{getMinMaxZoom as d,processColorInput as p,packByteSqrt as h,getBitMask as f}from"../fill/meshWriterUtils.js";import{ComputedMarkerParams as y}from"./ComputedMarkerParams.js";import{MarkerConstants as M}from"./markerConstants.js";import{getGeometryEngine as P}from"../mesh/loadGeometryEngine.js";import{MeshWriter as x}from"../mesh/MeshWriter.js";import{DataType as g}from"../../../../../../webgl/enums.js";const b=3.14159265359/180,k=128/Math.PI;function v(e,t){return e%=t,Math.abs(e>=0?e:e+t)}function S(e){return v(e*k,256)}function I(e,a,i,n,c=!1){const m=s(),l=c?1:-1;return t(m),(a||i)&&r(m,m,[a,-i]),n&&o(m,m,l*b*-n),m}const _={createComputedParams:e=>y.from(e),optionalAttributes:{zoomRange:{type:g.SHORT,count:2,packPrecisionFactor:u,pack:({scaleInfo:e},{tileInfo:t})=>d(e,t)}},attributes:{pos:{type:g.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:g.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:g.UNSIGNED_BYTE,count:1,pack:({sprite:e,alignment:t,scaleSymbolsProportionally:r,overrideOutlineColor:o,colorLocked:s})=>{let a=0;return e.sdf&&(a|=f(M.bitset.isSDF)),t===m.MAP&&(a|=f(M.bitset.isMapAligned)),r&&(a|=f(M.bitset.scaleSymbolsProportionally)),o&&(a|=f(M.bitset.overrideOutlineColor)),s&&(a|=f(M.bitset.colorLocked)),a}},offset:{type:g.HALF_FLOAT,count:2,packAlternating:{count:4,pack:({angle:e,computedWidth:t,computedHeight:r,anchorX:o,anchorY:s,offsetX:i,offsetY:n,rotateClockwise:c})=>{const m=I(0,i,n,-e,c),l=-(.5+o)*t,u=-(.5-s)*r,d=[l,u],p=[l+t,u],h=[l,u+r],f=[l+t,u+r];return a(d,d,m),a(p,p,m),a(h,h,m),a(f,f,m),[d,p,h,f]}}},textureUV:{type:g.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:e,texXmin:t,texYmax:r,texYmin:o})=>[[t,o],[e,o],[t,r],[e,r]]}},color:{type:g.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>p(e)},outlineColor:{type:g.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>p(e)},sizing:{type:g.UNSIGNED_BYTE,count:4,pack:({rawWidth:e,rawHeight:t,outlineSize:r,referenceSize:o})=>{const s=Math.max(e,t);return[h(s,128),h(r,128),h(o,128),0]}},placementAngle:{type:g.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:e})=>S(e)},sdfDecodeCoeff:{type:g.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:e})=>e}}};class E extends x{constructor(){super(...arguments),this.vertexSpec=_}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(e,t,r){const o=this.evaluatedMeshParams.sprite?.textureBinding,s=t.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,o);const a=this.evaluatedMeshParams.minPixelBuffer,i=Math.max(this.evaluatedMeshParams.computedWidth,a),m=Math.max(this.evaluatedMeshParams.computedHeight,a),l=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,u=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,d=this.evaluatedMeshParams.offsetX+l,p=-this.evaluatedMeshParams.offsetY+u;if(null!=this.evaluatedMeshParams.placement){let o=null;if(null!=r){const e=Math.max(this.evaluatedMeshParams.computedWidth,this.evaluatedMeshParams.computedHeight);if(o=n(r,2*e,!1),null===o)return}this._writePlacedMarkers(e,t,o,i,m)}else if(r?.nextPath()){r.nextPoint();const t=r.x,o=r.y;e.recordBounds(t+d,o+p,i,m),this._writeQuad(e,s,t,o)}else if("esriGeometryPolygon"===t.geometryType){const r=t.readCentroidForDisplay();if(!r)return;const[o,a]=r.coords;e.recordBounds(o+d,a+p,i,m),this._writeQuad(e,s,o,a)}else if("esriGeometryPoint"===t.geometryType){const r=t.readXForDisplay(),o=t.readYForDisplay();e.recordBounds(r+d,o+p,i,m),this._writeQuad(e,s,r,o)}else{const r=t.readGeometryForDisplay();r?.forEachVertex(((t,r)=>{e.recordBounds(t+d,r+p,i,m),Math.abs(t)>c||Math.abs(r)>c||this._writeQuad(e,s,t,r)}))}e.recordEnd()}_writePlacedMarkers(t,r,o,s,a){const n=o??i.fromFeatureSetReaderCIM(r);if(!n)return;const m=-1,u=l.getPlacement(n,m,this.evaluatedMeshParams.placement,e(1),t.id,P());if(!u)return;const d=r.getDisplayId();let p=u.next();const h=this.evaluatedMeshParams.offsetX,f=-this.evaluatedMeshParams.offsetY;for(;null!=p;){const e=p.tx,r=-p.ty;if(Math.abs(e)>c||Math.abs(r)>c){p=u.next();continue}const o=-p.getAngle();t.recordBounds(e+h,r+f,s,a),this._writeQuad(t,d,e,r,o),p=u.next()}}_writeQuad(e,t,r,o,s){const a=e.vertexCount(),i=null==s?null:{placementAngle:s};this._writeVertex(e,t,r,o,i),e.indexWrite(a+0),e.indexWrite(a+1),e.indexWrite(a+2),e.indexWrite(a+1),e.indexWrite(a+3),e.indexWrite(a+2)}}export{E as MarkerMeshWriter,_ as MarkerVertexSpec};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{numericHash as e}from"../../../../../../../core/string.js";function r(r){const t=r.map((({name:e,count:r,type:t})=>`${e}.${r}.${t}`)).join(",");return e(t)}function t(e,r,o,a,c,n,s){if(e.primitiveName===r){let r=a?.readWithDefault(c,n,e[o]&&s);return"text"===e.type&&(r=r.toString()),void(e[o]=r)}if("type"in e&&null!=e.type){if(e.effects)for(const i of e.effects)t(i,r,o,a,c,n,s);switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.symbolLayers)for(const i of e.symbolLayers)t(i,r,o,a,c,n,s);break;case"CIMTextSymbol":e.symbol&&t(e.symbol,r,o,a,c,n,s);break;case"CIMHatchFill":e.lineSymbol&&t(e.lineSymbol,r,o,a,c,n,s);break;case"CIMPictureMarker":case"CIMCharacterMarker":case"CIMVectorMarker":if(e.markerPlacement&&t(e.markerPlacement,r,o,a,c,n,s),"CIMVectorMarker"===e.type&&e.markerGraphics)for(const i of e.markerGraphics)t(i,r,o,a,c,n,s),t(i.symbol,r,o,a,c,n,s)}}}const o=400;function a(e){const r=e.width;return null!=e.effects?o:Math.max(1.25*r,8)}export{t as applyComputedValue,a as getLineClippingMargin,r as vertexLayoutHash};
5
+ import{numericHash as e}from"../../../../../../../core/string.js";function r(r){const t=r.map((({name:e,count:r,type:t})=>`${e}.${r}.${t}`)).join(",");return e(t)}function t(e,r,o,a,c,n,s){if(e.primitiveName===r){let r=a?.readWithDefault(c,n,e[o]&&s);return"text"===e.type&&(r=r.toString()),void(e[o]=r)}if("type"in e&&null!=e.type){if(e.effects)for(const i of e.effects)t(i,r,o,a,c,n,s);switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.symbolLayers)for(const i of e.symbolLayers)t(i,r,o,a,c,n,s);break;case"CIMTextSymbol":e.symbol&&t(e.symbol,r,o,a,c,n,s);break;case"CIMHatchFill":e.lineSymbol&&t(e.lineSymbol,r,o,a,c,n,s);break;case"CIMPictureMarker":case"CIMCharacterMarker":case"CIMVectorMarker":if(e.markerPlacement&&t(e.markerPlacement,r,o,a,c,n,s),"CIMVectorMarker"===e.type&&e.markerGraphics)for(const i of e.markerGraphics)t(i,r,o,a,c,n,s),t(i.symbol,r,o,a,c,n,s)}}}const o=400;function a(e){const r=Math.max(1.25*e.width,20);return null!=e.effects?o:r}export{t as applyComputedValue,a as getLineClippingMargin,r as vertexLayoutHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import o from"../../../core/Error.js";import i from"../../../core/Logger.js";import{releaseMaybe as t}from"../../../core/maybe.js";import{isAborted as r}from"../../../core/promiseUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{ElevationTileData as n}from"../../../layers/support/ElevationTileData.js";import{acquireDecoder as l}from"../../../layers/support/LercDecoder.js";import{ElevationLayerView3DModifications as c,ElevationLayerView3DModification as m}from"./ElevationLayerView3DModifications.js";import{LayerView3D as p}from"./LayerView3D.js";import{TiledLayerView3D as d}from"./TiledLayerView3D.js";import{elevationNoDataValue as y}from"../terrain/TerrainConst.js";import{useFetchTileForLayer as f}from"../terrain/terrainUtils.js";import h from"../../layers/LayerView.js";let g=class extends(d(p(h))){constructor(){super(...arguments),this.type="elevation-3d",this.modifications=new c,this._simplifyOperatorPromise=null}get tileInfo(){return this.layer.tileInfo}initialize(){const e=this.view,i=e.map?.allLayers,t=i&&i.includes(this.layer),r=e.map?.ground?.layers,s=r&&r.includes(this.layer);if(t&&!s){const e=new o("layerview:elevation-layer-only",`3D elevation layer '${this.layer.id}' can only be added to layers in map.ground`);this.addResolvingPromise(Promise.reject(e))}this._lercDecoder=l(e.resourceController),this._addTilingSchemeMatchPromise()}destroy(){this._lercDecoder=t(this._lercDecoder)}async fetchElevationTile(e,o){const i=await this._fetchTileData(e.lij,o);if(r(o))return;return i?await this.modifications.applyToElevation(i,e,o.signal):i}async _fetchTileData(e,o){const t=this.layer;if(f(t)){const s=await t.fetchTile(e[0],e[1],e[2],{noDataValue:y,signal:o.signal});return r(o)?void i.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."):s}const s=this.getTileUrl(e),a=await o.requester.request(s,"binary",o),l=await this._lercDecoder.decode(a,{noDataValue:y},o.signal);if(l)return new n(l);throw new Error("LERC decoding failed")}async setModifications(e){if(this.modifications.modifications.length=0,!e||0===e.length)return;this._simplifyOperatorPromise??=import("../../../geometry/operators/simplifyOperator.js");const o=await this._simplifyOperatorPromise;for(const t of e){const e=t.geometry;if("polygon"===e?.type){const r=o.execute(e);if("polygon"===r?.type){const e=new m(t.type,r);this.modifications.modifications.push(e)}else i.getLogger(this).warn("Failed to simplify modification polygon")}else i.getLogger(this).warn("Invalid modification added to elevation layer: "+(e?`non polygon geometry ${e.type}`:"no geometry"))}}};e([s()],g.prototype,"layer",void 0),e([s()],g.prototype,"tileInfo",null),e([s()],g.prototype,"modifications",void 0),g=e([a("esri.views.3d.layers.ElevationLayerView3D")],g);const u=g;export{u as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import o from"../../../core/Error.js";import i from"../../../core/Logger.js";import{releaseMaybe as t}from"../../../core/maybe.js";import{isAborted as r}from"../../../core/promiseUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{ElevationTileData as n}from"../../../layers/support/ElevationTileData.js";import{acquireDecoder as l}from"../../../layers/support/LercDecoder.js";import{ElevationLayerView3DModifications as c,ElevationLayerView3DModification as m}from"./ElevationLayerView3DModifications.js";import{LayerView3D as p}from"./LayerView3D.js";import{TiledLayerView3D as d}from"./TiledLayerView3D.js";import{elevationNoDataValue as y}from"../terrain/TerrainConst.js";import{useFetchTileForLayer as f}from"../terrain/terrainUtils.js";import h from"../../layers/LayerView.js";let g=class extends(d(p(h))){constructor(){super(...arguments),this.type="elevation-3d",this.modifications=new c}get tileInfo(){return this.layer.tileInfo}initialize(){const e=this.view,i=e.map?.allLayers,t=i&&i.includes(this.layer),r=e.map?.ground?.layers,s=r&&r.includes(this.layer);if(t&&!s){const e=new o("layerview:elevation-layer-only",`3D elevation layer '${this.layer.id}' can only be added to layers in map.ground`);this.addResolvingPromise(Promise.reject(e))}this._lercDecoder=l(e.resourceController),this._addTilingSchemeMatchPromise()}destroy(){this._lercDecoder=t(this._lercDecoder)}async fetchElevationTile(e,o){const i=await this._fetchTileData(e.lij,o);if(!r(o))return i&&await this.modifications.apply(i,e,o.signal),i}async _fetchTileData(e,o){const t=this.layer;if(f(t)){const s=await t.fetchTile(e[0],e[1],e[2],{noDataValue:y,signal:o.signal});return r(o)?void i.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."):s}const s=this.getTileUrl(e),a=await o.requester.request(s,"binary",o),l=await this._lercDecoder.decode(a,{noDataValue:y},o.signal);if(l)return new n(l);throw new Error("LERC decoding failed")}async setModifications(e){if(this.modifications.modifications.length=0,!e||0===e.length)return;this._simplifyOperatorPromise??=import("../../../geometry/operators/simplifyOperator.js");const o=await this._simplifyOperatorPromise;for(const t of e){const e=t.geometry;if("polygon"===e?.type){const r=o.execute(e);if("polygon"===r?.type){const e=new m(t.type,r);this.modifications.modifications.push(e)}else i.getLogger(this).warn("Failed to simplify modification polygon")}else i.getLogger(this).warn("Invalid modification added to elevation layer: "+(e?`non polygon geometry ${e.type}`:"no geometry"))}}};e([s()],g.prototype,"layer",void 0),e([s()],g.prototype,"tileInfo",null),e([s()],g.prototype,"modifications",void 0),g=e([a("esri.views.3d.layers.ElevationLayerView3D")],g);const u=g;export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{isAborted as e}from"../../../core/promiseUtils.js";import t from"../../../geometry/Extent.js";import{ElevationTileData as o}from"../../../layers/support/ElevationTileData.js";class r{constructor(){this.modifications=[]}async applyToElevation(t,o,r){let a=t;if(this.modifications.length>0){if(n.operatorLoadPromise??=Promise.all([import("../../../geometry/operators/containsOperator.js"),import("../../../geometry/operators/intersectsOperator.js"),import("../../../geometry/operators/intersectionOperator.js")]),n.operators=await n.operatorLoadPromise,e(r))return a;for(const e of this.modifications)a=e.applyOneModificationToElevation(a,o)}return a}}class n{constructor(e,t){this.type=e,this.polygon=t}applyOneModificationToElevation(e,r){const{polygon:s}=this,[l,c,f]=n.operators;if("replace"===this.type){l.accelerateGeometry(s),c.accelerateGeometry(s),f.accelerateGeometry(s);const[n,p,m,y]=r.extent,{spatialReference:u}=r,h=new t({xmin:n,ymin:p,xmax:m,ymax:y,spatialReference:u});if(!c.execute(s,h))return e;const{width:d,height:x,noDataValue:g}=e,w=new Float32Array(d*x),v=s.rings.reduce(((e,t)=>Math.min(e,t.reduce(((e,t)=>Math.min(e,t[2]??1/0)),1/0))),1/0),P=v===1/0?0:v;if(l.execute(s,h))w.fill(P);else{const t=a(r,s,[d,x]);if(!t)return e;if(t.rings.every((e=>0===e.length)))return e;const o=i(r,t,[d,x]),n=e.values;for(let e=x-1;e>=0;--e)for(let t=0;t<d;++t){const r=(e+1)*(d+2)+(t+1);let a=0;for(let e=-1;e<=1;++e){const t=r+e*(d+2);for(let e=-1;e<=1;++e)a=Math.max(a,o[t+e])}const i=e*d+t;w[i]=0===a?n[i]:P}}return new o(w,d,x,g)}return e}static{this.operatorLoadPromise=null}static{this.operators=null}}function a(e,o,r){const[a,i,s,l]=e.extent,{spatialReference:c}=e,[f,p]=r,m=2,y=(s-a)/(f-1),u=(l-i)/(p-1),h=new t({xmin:a-m*y,ymin:i-m*u,xmax:s+m*y,ymax:l+m*u,spatialReference:c}),d=n.operators[2].execute(o,h);return"polygon"===d?.type?d:null}function i(e,t,o){const[r,n]=o,a=new OffscreenCanvas(r+2,n+2).getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("failed to create canvas");const[i,l,c,f]=e.extent,p=c-i,m=f-l;a.fillStyle="black",a.clearRect(0,0,r,n);const y=new Path2D;for(const x of t.rings)if(x.length>0){const e=new Path2D;let t=!0;for(const[o,a]of x){const l=(o-i)/p*(r-1)+1+s,c=(f-a)/m*(n-1)+1+s;t?(t=!1,e.moveTo(l,c)):e.lineTo(l,c)}e.closePath(),y.addPath(e)}a.fillStyle="white",a.fill(y,"evenodd");const u=a.getImageData(0,0,r+2,n+2),h=(r+2)*(n+2),d=new Uint8Array(h);for(let s=0;s<h;++s)d[s]=u.data[4*s+0]>0?1:0;return d}const s=.5;export{n as ElevationLayerView3DModification,r as ElevationLayerView3DModifications};
5
+ import{isAborted as e}from"../../../core/promiseUtils.js";import t from"../../../geometry/Extent.js";import{toExtent as o}from"../../../geometry/support/aaBoundingRect.js";class r{constructor(){this.modifications=[]}async apply(t,o,r){if(0!==this.modifications.length&&(s??=Promise.all([import("../../../geometry/operators/containsOperator.js"),import("../../../geometry/operators/intersectsOperator.js"),import("../../../geometry/operators/intersectionOperator.js")]),a=await s,!e(r)))for(const e of this.modifications)e.apply(t,o)}}class n{constructor(e,t){this.type=e,this.polygon=t}apply(e,t){if("replace"!==this.type)return;const{polygon:r}=this,[n,s,l]=a,{extent:f,spatialReference:p}=t,m=o(f,p);if(s.accelerateGeometry(r),!s.execute(r,m))return;n.accelerateGeometry(r),l.accelerateGeometry(r);const{width:y,height:h,values:u}=e,g=r.hasZ?r.rings.reduce(((e,t)=>t.reduce(((e,t)=>Math.min(e,t[2]??1/0)),e)),1/0):1/0,d=g===1/0?0:g;if(n.execute(r,m))u.fill(d);else{const e=i(t,r,[y,h]);if(!e)return;if(e.rings.every((e=>0===e.length)))return;const o=c(t,e,y,h);for(let t=h-1;t>=0;--t)for(let e=0;e<y;++e){const r=(t+1)*(y+2)+(e+1);let n=0;for(let e=-1;e<=1;++e){const t=r+e*(y+2);for(let e=-1;e<=1;++e)n=Math.max(n,o[t+e])}const s=t*y+e;u[s]=0===n?u[s]:d}}}}let s,a;function i(e,o,r){const[n,s,i,c]=e.extent,{spatialReference:l}=e,[f,p]=r,m=2,y=(i-n)/(f-1),h=(c-s)/(p-1),u=new t({xmin:n-m*y,ymin:s-m*h,xmax:i+m*y,ymax:c+m*h,spatialReference:l}),g=a[2].execute(o,u);return"polygon"===g?.type?g:null}function c(e,t,o,r){const n=new OffscreenCanvas(o+2,r+2).getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas");const[s,a,i,c]=e.extent,f=i-s,p=c-a;n.fillStyle="black",n.clearRect(0,0,o,r);const m=new Path2D;for(const g of t.rings)if(g.length>0){const e=new Path2D;let t=!0;for(const[n,a]of g){const i=(n-s)/f*(o-1)+1+l,m=(c-a)/p*(r-1)+1+l;t?(t=!1,e.moveTo(i,m)):e.lineTo(i,m)}e.closePath(),m.addPath(e)}n.fillStyle="white",n.fill(m,"evenodd");const y=n.getImageData(0,0,o+2,r+2),h=(o+2)*(r+2),u=new Uint8Array(h);for(let l=0;l<h;++l)u[l]=y.data[4*l+0]>0?1:0;return u}const l=.5;export{n as ElevationLayerView3DModification,r as ElevationLayerView3DModifications};