@arcgis/core 4.32.0-next.20250207 → 4.32.0-next.20250209

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 (75) hide show
  1. package/applications/Components/styleUtils.js +1 -1
  2. package/applications/Components/webStyleSymbolUtils.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/16a96f6b73e8fb1ede8c.js +2 -0
  5. package/assets/esri/core/workers/chunks/{4d0a6ccb8434f8898377.js → 2479be4fbc1abe5bf404.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{2a7f5d09cdc0333fa4bd.js → 2611adb4f328f95ee508.js} +1 -1
  7. package/assets/esri/core/workers/chunks/2def7db73a776e759dae.js +1 -0
  8. package/assets/esri/core/workers/chunks/{77764ca90bdd13ee2167.js → 486df1e042204b90b0dd.js} +2 -2
  9. package/assets/esri/core/workers/chunks/{354531dc2f0dea2ad96f.js → 5693d9ce4472a4c5959f.js} +2 -2
  10. package/assets/esri/core/workers/chunks/{b21b152fa15896577242.js → 5b56b271afb0fadf48b4.js} +2 -2
  11. package/assets/esri/core/workers/chunks/{32f5f00aab55ef16dcf1.js → 5b85f9da022742f602e2.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{e0de91eacf3a3b7eda55.js → 61f2a202aede3846f9a2.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{bab541feca7ab4d3f993.js → 6ea02ff25f051c08e6c3.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{8e334fa440ae542e2e34.js → 7e49ddb5a2182f2c9ca6.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{4040158835f9036967cd.js → 9f257e356bc6b8f742c6.js} +2 -2
  16. package/assets/esri/core/workers/chunks/9fdefc01f49907bb83c0.js +1 -0
  17. package/assets/esri/core/workers/chunks/{308ec51ff4a66f7fcb0d.js → b0952b81d5be214262dd.js} +2 -2
  18. package/assets/esri/core/workers/chunks/b97673755cd2cc5164e8.js +1 -0
  19. package/assets/esri/core/workers/chunks/{32d3657dcae89b740f8b.js → bb1e9c062558671de957.js} +2 -2
  20. package/assets/esri/core/workers/chunks/bb9ab85a135d211637f6.js +1 -0
  21. package/assets/esri/core/workers/chunks/d44d210e94406509e980.js +314 -0
  22. package/assets/esri/core/workers/chunks/edb580ce96da6fd66503.js +1 -0
  23. package/chunks/ImageMaterial.glsl.js +4 -4
  24. package/core/sql.js +1 -1
  25. package/geometry/Mesh.js +1 -1
  26. package/geometry/support/meshVertexSpaceUtils.js +1 -1
  27. package/interfaces.d.ts +3 -28
  28. package/package.json +2 -2
  29. package/rest/print.js +1 -1
  30. package/support/revision.js +1 -1
  31. package/symbols/WebStyleSymbol.js +1 -1
  32. package/symbols/support/previewSymbol3D.js +1 -1
  33. package/symbols/support/previewWebStyleSymbol.js +1 -1
  34. package/symbols/support/styleUtils.js +1 -1
  35. package/symbols/support/symbolUtils.js +1 -1
  36. package/symbols/support/utils.js +1 -1
  37. package/symbols/support/webStyleAcceptedFormats.js +5 -0
  38. package/symbols/support/webStyleSymbolUtils.js +1 -1
  39. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  40. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  41. package/views/2d/layers/LayerView2D.js +1 -1
  42. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  43. package/views/2d/layers/RouteLayerView2D.js +1 -1
  44. package/views/2d/layers/features/FeatureContainer.js +1 -1
  45. package/views/2d/layers/support/HighlightCounter.js +1 -1
  46. package/views/3d/glTF/internal/resourceUtils.js +1 -1
  47. package/views/3d/layers/MediaLayerView3D.js +1 -1
  48. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  49. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  50. package/views/3d/layers/graphics/Labeler.js +1 -1
  51. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandEncoder.js +1 -1
  52. package/views/3d/layers/graphics/webStyleUtils.js +1 -1
  53. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  54. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  55. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  56. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  57. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  58. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  59. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  60. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  61. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  62. package/assets/esri/core/workers/chunks/1100d9d114287b6443e2.js +0 -1
  63. package/assets/esri/core/workers/chunks/459af0c3d62c3ed11c19.js +0 -1
  64. package/assets/esri/core/workers/chunks/81efe1f47fd41b7a5cc1.js +0 -1
  65. package/assets/esri/core/workers/chunks/92871ebb339a7b6ff29c.js +0 -1
  66. package/assets/esri/core/workers/chunks/9a2d7c98fa0c4f8a9fd5.js +0 -314
  67. package/assets/esri/core/workers/chunks/b3f9d7a676076a7557f5.js +0 -1
  68. package/assets/esri/core/workers/chunks/b765670b47d209d7655a.js +0 -2
  69. /package/assets/esri/core/workers/chunks/{b765670b47d209d7655a.js.LICENSE.txt → 16a96f6b73e8fb1ede8c.js.LICENSE.txt} +0 -0
  70. /package/assets/esri/core/workers/chunks/{77764ca90bdd13ee2167.js.LICENSE.txt → 486df1e042204b90b0dd.js.LICENSE.txt} +0 -0
  71. /package/assets/esri/core/workers/chunks/{354531dc2f0dea2ad96f.js.LICENSE.txt → 5693d9ce4472a4c5959f.js.LICENSE.txt} +0 -0
  72. /package/assets/esri/core/workers/chunks/{b21b152fa15896577242.js.LICENSE.txt → 5b56b271afb0fadf48b4.js.LICENSE.txt} +0 -0
  73. /package/assets/esri/core/workers/chunks/{4040158835f9036967cd.js.LICENSE.txt → 9f257e356bc6b8f742c6.js.LICENSE.txt} +0 -0
  74. /package/assets/esri/core/workers/chunks/{308ec51ff4a66f7fcb0d.js.LICENSE.txt → b0952b81d5be214262dd.js.LICENSE.txt} +0 -0
  75. /package/assets/esri/core/workers/chunks/{32d3657dcae89b740f8b.js.LICENSE.txt → bb1e9c062558671de957.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4594],{65686:(t,n,e)=>{e.d(n,{a:()=>i,b:()=>c,l:()=>f,n:()=>u,t:()=>l});var r=e(40876),o=(e(44208),e(53966));function i(t,n,e){l(t.typedBuffer,n.typedBuffer,e,t.typedBufferStride,n.typedBufferStride)}function l(t,n,e,r=4,o=r){if(t.length/r!=n.length/o)return;const i=t.length/r,l=e[0],u=e[1],a=e[2],f=e[3],c=e[4],s=e[5],p=e[6],g=e[7],y=e[8];let d=0,A=0;for(let e=0;e<i;e++){const e=n[d],i=n[d+1],m=n[d+2],T=n[d+3];t[A]=l*e+f*i+p*m,t[A+1]=u*e+c*i+g*m,t[A+2]=a*e+s*i+y*m,t[A+3]=T,d+=o,A+=r}}function u(t,n){const e=Math.min(t.count,n.count),r=t.typedBuffer,o=t.typedBufferStride,i=n.typedBuffer,l=n.typedBufferStride;for(let t=0;t<e;t++){const n=t*o,e=t*l,u=i[e],a=i[e+1],f=i[e+2],c=u*u+a*a+f*f;if(c>0){const t=1/Math.sqrt(c);r[n]=t*u,r[n+1]=t*a,r[n+2]=t*f}}}function a(t,n,e,r=4){const o=Math.min(t.length/r,n.count),i=n.typedBuffer,l=n.typedBufferStride;let u=0,a=0;for(let n=0;n<o;n++)t[a]=e*i[u],t[a+1]=e*i[u+1],t[a+2]=e*i[u+2],t[a+3]=e*i[u+3],u+=l,a+=r}function f(t,n,e,r){c(t.typedBuffer,n,e,r,t.typedBufferStride)}function c(t,n,e,o,i=4){const l=Math.min(t.length/i,n.count),u=n.typedBuffer,a=n.typedBufferStride;let f=0,c=0;const s=1/r.Tf;for(let n=0;n<l;n++)t[c]=o*(e*u[f])**s,t[c+1]=o*(e*u[f+1])**s,t[c+2]=o*(e*u[f+2])**s,t[c+3]=o*e*u[f+3],f+=a,c+=i}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:f,normalize:u,scale:a,scaleView:function(t,n,e){a(t.typedBuffer,n,e,t.typedBufferStride)},transformMat3:l,transformMat3View:i,transformMat4:function(t,n,e,r=4,i=r){if(t.length/r!=n.length/i)return void o.A.getLogger("esri.views.3d.support.buffer.math").error("source and destination buffers need to have the same number of elements");const l=t.length/r,u=e[0],a=e[1],f=e[2],c=e[3],s=e[4],p=e[5],g=e[6],y=e[7],d=e[8],A=e[9],m=e[10],T=e[11],R=e[12],v=e[13],h=e[14],E=e[15];let N=0,C=0;for(let e=0;e<l;e++){const e=n[N],o=n[N+1],l=n[N+2],w=n[N+3];t[C]=u*e+s*o+d*l+R*w,t[C+1]=a*e+p*o+A*l+v*w,t[C+2]=f*e+g*o+m*l+h*w,t[C+3]=c*e+y*o+T*l+E*w,N+=i,C+=r}},transformMat4View:function(t,n,e){if(t.count!==n.count)return;const r=t.count,o=e[0],i=e[1],l=e[2],u=e[3],a=e[4],f=e[5],c=e[6],s=e[7],p=e[8],g=e[9],y=e[10],d=e[11],A=e[12],m=e[13],T=e[14],R=e[15],v=t.typedBuffer,h=t.typedBufferStride,E=n.typedBuffer,N=n.typedBufferStride;for(let t=0;t<r;t++){const n=t*h,e=t*N,r=E[e],C=E[e+1],w=E[e+2],S=E[e+3];v[n]=o*r+a*C+p*w+A*S,v[n+1]=i*r+f*C+g*w+m*S,v[n+2]=l*r+c*C+y*w+T*S,v[n+3]=u*r+s*C+d*w+R*S}}},Symbol.toStringTag,{value:"Module"}))},74594:(t,n,e)=>{e.d(n,{projectMeshVertexPositions:()=>u});var r=e(9762),o=e(95696),i=e(21325),l=e(72258);function u(t,n){const e=(0,l.UR)(t,o.A.absolute);if(!e)return null;let u=e.position;return(0,i.aI)(t.spatialReference,n)||(u=new Float64Array(e.position.length),(0,r.projectBuffer)(e.position,t.spatialReference,0,u,n,0))?u:null}},22141:(t,n,e)=>{e.d(n,{$5:()=>E,CN:()=>T,JP:()=>m,KM:()=>C,Mv:()=>S,X4:()=>R,gr:()=>h,qs:()=>N,si:()=>v,xA:()=>w});var r=e(34727),o=e(77690),i=e(29242),l=e(58083),u=e(9093),a=e(38954),f=e(51850),c=e(48353),s=e(9762),p=(e(79258),e(21325)),g=e(28735),y=e(13030),d=e(73354),A=e(65686);const m="Projection may be possible after calling projection.load().";function T(t,n,e,r){t.error(`Failed to project from (wkid:${n.wkid}) to (wkid:${e.wkid}).${r?" ":""}${r}`)}function R(t,n,e,r,o,i){return O(M.TO_PCPF,y.xs.fromTypedArray(t),x.NORMAL,y.Xm.fromTypedArray(n),e,y.Xm.fromTypedArray(r),o,y.xs.fromTypedArray(i))?i:null}function v(t,n,e,r,o,i){return O(M.FROM_PCPF,y.xs.fromTypedArray(t),x.NORMAL,y.Xm.fromTypedArray(n),e,y.Xm.fromTypedArray(r),o,y.xs.fromTypedArray(i))?i:null}function h(t,n,e,r){return(0,s.projectBuffer)(t,n,0,e,r,0)?e:null}function E(t,n,e,r){return(0,s.projectBuffer)(t,n,0,e,r,0)?e:null}function N(t,n,e){return(0,o.Ge)(b,e),(0,d.b)(n,t,b),(0,r.or)(b)&&(0,d.n)(n,n),n}function C(t,n,e){return(0,o.z0)(b,e),(0,A.t)(n,t,b),(0,r.or)(b)&&(0,d.n)(n,n,4),n}function w(t,n,e,r,o,i){if(!O(M.TO_PCPF,y.xs.fromTypedArray(t,4*Float32Array.BYTES_PER_ELEMENT),x.TANGENT,y.Xm.fromTypedArray(n),e,y.Xm.fromTypedArray(r),o,y.xs.fromTypedArray(i,4*Float32Array.BYTES_PER_ELEMENT)))return null;for(let n=3;n<t.length;n+=4)i[n]=t[n];return i}function S(t,n,e,r,o,i){if(!O(M.FROM_PCPF,y.xs.fromTypedArray(t,16),x.TANGENT,y.Xm.fromTypedArray(n),e,y.Xm.fromTypedArray(r),o,y.xs.fromTypedArray(i,16)))return null;for(let n=3;n<t.length;n+=4)i[n]=t[n];return i}var x,M,B;function F(t,n,e,r,i){switch((0,c.l)(r,e,G,r),t===M.FROM_PCPF&&(0,l.B8)(G,G),n){case x.NORMAL:return(0,o.Ge)(i,G);case x.TANGENT:return(0,o.z0)(i,G)}}function O(t,n,e,r,o,i,l,u){if(!n)return;const f=r.count;if(function(t){return t.isWGS84||(0,p.x1)(t)||(0,p.q8)(t)||(0,p.KQ)(t)}(o))for(let r=0;r<f;r++)i.getVec(r,_),n.getVec(r,P),(0,a.q)(P,P,F(t,e,_,l,b)),u.setVec(r,P);else for(let o=0;o<f;o++){i.getVec(o,_),n.getVec(o,P);const f=(0,g.jg)(r.get(o,1));let c=Math.cos(f);e===x.TANGENT!=(t===M.TO_PCPF)&&(c=1/c),F(t,e,_,l,b),t===M.TO_PCPF?(b[0]*=c,b[1]*=c,b[2]*=c,b[3]*=c,b[4]*=c,b[5]*=c):(b[0]*=c,b[3]*=c,b[6]*=c,b[1]*=c,b[4]*=c,b[7]*=c),(0,a.q)(P,P,b),(0,a.n)(P,P),u.setVec(o,P)}return u}(B=x||(x={}))[B.NORMAL=0]="NORMAL",B[B.TANGENT=1]="TANGENT",function(t){t[t.TO_PCPF=0]="TO_PCPF",t[t.FROM_PCPF=1]="FROM_PCPF"}(M||(M={}));const _=(0,f.vt)(),P=(0,f.vt)(),G=(0,u.vt)(),b=(0,i.vt)()},72258:(t,n,e)=>{e.d(n,{UR:()=>h,p5:()=>v,xK:()=>x});var r=e(53966),o=e(34727),i=e(83047),l=e(77690),u=e(29242),a=e(58083),f=e(9093),c=e(38954),s=e(51850),p=e(98764),g=e(48353),y=e(65806),d=e(27615),A=e(21325),m=e(73354),T=e(22141);const R=()=>r.A.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function v(t,n,{vertexSpace:e,spatialReference:r}){if("georeferenced"===e.type){const o=t;if(!(0,y.g)(n,o,r))return!1;const{origin:i}=e;return(0,c.d)(t,o,i),!0}const o=(0,p.lO)(r),i=t;if(!(0,y.g)(n,i,o))return!1;const{origin:l}=e,u=_;if(!(0,g.l)(r,l,u,o))return!1;const f=(0,a.B8)(_,u);return null!=f&&((0,c.t)(t,i,f),!0)}function h(t,n,e){const{vertexSpace:r,transform:o,vertexAttributes:i}=t,u=(0,d.Hq)(r)?o:null,s=w(t.spatialReference,e,P.SOURCE_AND_TARGET);if((0,d.yJ)(r,n)&&(!u||(0,a.t2)(u.localMatrix,f.zK))&&S(s)){const{position:t,normal:n,tangent:r}=i,o=e?.allowBufferReuse;return{position:o?t:t.slice(),normal:o?n:n?.slice(),tangent:o?r:r?.slice()}}switch(t.vertexSpace.type){case"local":return"local"===n.type?function({vertexAttributes:t,spatialReference:n,transform:e},{origin:r},o,i){const l=E(n,i);if(!(0,g.l)(n,r,M,l))return(0,T.CN)(R(),n,l),null;if(e&&(0,a.lw)(M,M,e.localMatrix),!(0,g.l)(n,o,B,l))return(0,T.CN)(R(),l,n),null;(0,a.B8)(B,B);const u=(0,a.lw)(M,B,M);return C(u,n,i,P.SOURCE_AND_TARGET),N(t,u)}(t,t.vertexSpace,n.origin,e):function({spatialReference:t,vertexAttributes:n,transform:e},{origin:r},o,i){const l=E(t,i);if(!(0,g.l)(t,r,M,l))return(0,T.CN)(R(),t,l),null;e&&(0,a.lw)(M,M,e.localMatrix),C(M,t,i,P.SOURCE);const u=new Float64Array(n.position.length),f=function(t,n,e,r,o){(0,m.t)(r,t,n);const i=new Float64Array(t.length);return(0,T.$5)(r,o,i,e)?i:((0,T.CN)(R(),o,e),null)}(n.position,M,t,u,l);if(!f)return null;const s=function(t,n,e,r,o,i){if(null==o)return null;const l=new Float32Array(o.length);return(0,T.qs)(o,l,i),(0,T.si)(l,t,n,e,r,l)?l:((0,T.CN)(R(),r,n),null)}(f,t,u,l,n.normal,M);if(n.normal&&!s)return null;const p=function(t,n,e,r,o,i){if(null==o)return null;const l=new Float32Array(o.length);return(0,T.KM)(o,l,i),(0,T.Mv)(l,t,n,e,r,l)?l:((0,T.CN)(R(),r,n),null)}(f,t,u,l,n.tangent,M);if(n.tangent&&!p)return null;if(o){const t=(0,c.v)(O,o);(0,m.a)(f,f,t)}return{position:f,normal:s,tangent:p}}(t,t.vertexSpace,n.origin,e);case"georeferenced":return"local"===n.type?function({vertexAttributes:t,spatialReference:n,transform:e},{origin:r},o,i){const u=E(n,i);if(!(0,g.l)(n,o,M,u))return(0,T.CN)(R(),n,u),null;const f=1/w(n,i,P.TARGET);(0,a.hs)(M,M,[f,f,f]);const c=(0,a.B8)(B,M),{position:s,normal:p,tangent:y}=function(t,n,e){if(!n)return t;if(!e){const{position:e,normal:r,tangent:o}=t;return{position:(0,m.a)(new Float64Array(e.length),e,n),tangent:o,normal:r}}const r=N(t,e.localMatrix);return(0,m.a)(r.position,r.position,n),r}(t,r,e),d=new Float64Array(s.length),A=function(t,n,e,r,o){const i=(0,T.gr)(t,n,r,o);if(!i)return(0,T.CN)(R(),n,o),null;const l=new Float64Array(i.length);return(0,m.t)(l,i,e),l}(s,n,c,d,u);if(!A)return null;const v=(0,l.Ge)(F,c),h=function(t,n,e,r,o,i,l){if(null==t)return null;const u=l??new Float32Array(t.length);return(0,T.X4)(t,n,e,r,o,u)?((0,m.b)(u,u,i),u):((0,T.CN)(R(),e,o),null)}(p,s,n,d,u,v,p!==t.normal?p:void 0);if(!h&&p)return null;const C=function(t,n,e,r,o,i,l){if(null==t)return null;const u=l??new Float32Array(t.length);return(0,T.xA)(t,n,e,r,o,u)?((0,m.b)(u,u,i,4),u):((0,T.CN)(R(),e,o),null)}(y,s,n,d,u,v,y!==t.tangent?y:void 0);return!C&&y?null:{position:A,normal:h,tangent:C}}(t,t.vertexSpace,n.origin,e):function({vertexAttributes:t,transform:n,spatialReference:e},{origin:r},o,i){const l=w(e,i,P.SOURCE_AND_TARGET),u=r||!S(l)?(0,a.C)(M,n?.localMatrix??f.zK):null;u&&C(u,e,i,P.SOURCE_AND_TARGET);const{position:s,normal:p,tangent:g}=u?N(t,u):t,y=i?.allowBufferReuse,d=y?s:new Float64Array(s.length);let A=s;if(r&&(A=(0,m.a)(d,A,r)),o){const t=(0,c.v)(O,o);A=(0,m.a)(d,A,t)}return{position:A!==t.position||y?A:A.slice(),normal:p!==t.normal||y?p:p?.slice(),tangent:g!==t.tangent||y?g:g?.slice()}}(t,t.vertexSpace,n.origin,e)}}function E(t,n){return n?.useEllipsoid&&(0,A.B3)(t)?p.Y0:(0,p.lO)(t)}function N(t,n){const e=new Float64Array(t.position.length);(0,m.t)(e,t.position,n);const r=t.normal?new Float32Array(t.normal.length):null,o=t.tangent?new Float32Array(t.tangent.length):null;return r&&t.normal&&(0,T.qs)(t.normal,r,n),o&&t.tangent&&(0,T.KM)(t.tangent,o,n),{position:e,normal:r,tangent:o}}function C(t,n,e,r){const o=w(n,e,r);S(o)||(0,a.hs)(t,t,[o,o,o])}function w(t,n,e){const r=!!(e&P.SOURCE),o=!!(e&P.TARGET),i=n?.sourceUnit,l=n?.targetUnit;if(!i&&!l)return 1;let u=x(i,t);r||!i||S(u)||(R().warn("source unit conversion not supported"),u=1);let a=1/x(l,t);return o||!l||S(a)||(R().warn("target unit conversion not supported"),a=1),u*a}function S(t){return(0,o.Io)(t,1)}function x(t,n){if(null==t)return 1;const e=(0,i.KX)(n);return 1/(0,i.oU)(e,"meters",t)}const M=(0,f.vt)(),B=(0,f.vt)(),F=(0,u.vt)(),O=(0,s.vt)(),_=(0,f.vt)();var P,G;(G=P||(P={}))[G.NONE=0]="NONE",G[G.SOURCE=1]="SOURCE",G[G.TARGET=2]="TARGET",G[G.SOURCE_AND_TARGET=3]="SOURCE_AND_TARGET"},27615:(t,n,e)=>{e.d(n,{CK:()=>a,Hq:()=>u,MW:()=>f,TE:()=>c,yJ:()=>s});var r=e(38954),o=e(86738),i=e(95696),l=e(18251);function u(t){return null!=t.origin}function a(t){return u(t.vertexSpace)}function f(t,n){if(!u(t))return null;const[e,r,i]=t.origin;return new o.A({x:e,y:r,z:i,spatialReference:n})}function c(t,n){const{x:e,y:r,z:o,spatialReference:u}=t,a=[e,r,o??0];return"local"===(n?.vertexSpace??function(t){return t.isGeographic||t.isWebMercator?"local":"georeferenced"}(u))?new l.A({origin:a}):new i.A({origin:a})}function s(t,n){return t.type===n.type&&(t.origin===n.origin||null!=t.origin&&null!=n.origin&&(0,r.p)(t.origin,n.origin))}}}]);
@@ -2,14 +2,14 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{ShaderOutput as e}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as r}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as i}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{ObjectAndLayerIdColor as o}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{terrainDepthTest as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ColorConversion as s}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as n}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{FloatPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as l}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as a}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{VertexAttribute as g}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{outputColorHighlightOID as p}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{ShaderBuilder as v}from"../views/webgl/ShaderBuilder.js";function c(c){const u=new v,{vertex:m,fragment:w}=u;return n(m,c),u.include(i,c),u.include(t,c),u.fragment.include(r,c),u.include(o,c),u.include(p,c),u.attributes.add(g.POSITION,"vec3"),u.attributes.add(g.UV0,"vec2"),c.perspectiveInterpolation&&u.attributes.add(g.PERSPECTIVEDIVIDE,"float"),u.varyings.add("vpos","vec3"),m.main.add(l`
5
+ import{ShaderOutput as e}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as r}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as i}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{ObjectAndLayerIdColor as o}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{terrainDepthTest as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import{ColorConversion as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as a}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{FloatPassUniform as l}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as d,If as n}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{VertexAttribute as m}from"../views/3d/webgl-engine/lib/VertexAttribute.js";import{outputColorHighlightOID as v}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js";import{NoParameters as c}from"../views/webgl/NoParameters.js";import{ShaderBuilder as p}from"../views/webgl/ShaderBuilder.js";class u extends c{}function w(c){const u=new p,{vertex:w,fragment:b}=u,{output:f,perspectiveInterpolation:h}=c;return a(w,c),u.include(i,c),u.include(s,c),u.fragment.include(r,c),u.include(o,c),u.include(v,c),u.attributes.add(m.POSITION,"vec3"),u.attributes.add(m.UV0,"vec2"),h&&u.attributes.add(m.PERSPECTIVEDIVIDE,"float"),w.main.add(d`
6
6
  vpos = position;
7
7
  forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
8
8
  vTexCoord = uv0;
9
9
  gl_Position = transformPosition(proj, view, vpos);
10
- ${c.perspectiveInterpolation?"gl_Position *= perspectiveDivide;":""}`),w.uniforms.add(new a("tex",(e=>e.texture)),new d("opacity",(e=>e.opacity))),u.varyings.add("vTexCoord","vec2"),w.include(s),w.main.add(l`
10
+ ${n(h,"gl_Position *= perspectiveDivide;")}`),u.varyings.add("vpos","vec3"),u.varyings.add("vTexCoord","vec2"),b.include(t),b.uniforms.add(new l("opacity",(e=>e.opacity)),new g("tex",(e=>e.texture))).main.add(d`
11
11
  discardBySlice(vpos);
12
12
  discardByTerrainDepth();
13
- ${c.output===e.ObjectAndLayerIdColor?"fragColor = vec4(0, 0, 0, 1);\n return;":""}
13
+ ${n(f===e.ObjectAndLayerIdColor,"fragColor = vec4(0, 0, 0, 1); return;")}
14
14
  vec4 finalColor = texture(tex, vTexCoord) * opacity;
15
- outputColorHighlightOID(finalColor, vpos);`),u}const u=Object.freeze(Object.defineProperty({__proto__:null,build:c},Symbol.toStringTag,{value:"Module"}));export{u as I,c as b};
15
+ outputColorHighlightOID(finalColor, vpos);`),u}const b=Object.freeze(Object.defineProperty({__proto__:null,ImageMaterialPassParameters:u,build:w},Symbol.toStringTag,{value:"Module"}));export{b as I,u as a,w as b};
package/core/sql.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- let n;async function e(){return null==n&&(n=import("./sql/WhereClauseCache.js").then((n=>new n.WhereClauseCache(500,500)))),n}async function t(n,t){const l=await e(),r=l.get(n,t);if(null==r)throw l.getError(n,t);return r}function l(n,e){return n||=null,e||=null,"1=1"===n?e??n:"1=1"===e?n??e:n&&e?`(${n}) AND (${e})`:n??e}function r(n,e){return n||=null,e||=null,"1=1"===n||"1=1"===e||n===e?"1=1"===n?n:e:n&&e?`(${n}) OR (${e})`:n??e}export{t as parseWhereClause,l as sqlAnd,r as sqlOr};
5
+ let n;async function t(){return null==n&&(n=import("./sql/WhereClauseCache.js").then((n=>new n.WhereClauseCache(500,500)))),n}async function e(n,e){const r=await t(),u=r.get(n,e);if(null==u)throw r.getError(n,e);return u}function r(n,t){return n||=null,t||=null,"1=1"===n?t??n:"1=1"===t?n??t:n&&t?`(${n}) AND (${t})`:n??t}function u(n,t){return n||=null,t||=null,"1=1"===n||"1=1"===t||n===t?"1=1"===n?n:t:n&&t?`(${n}) OR (${t})`:n??t}function l(n,t){return 0===t.length?null:`${n} IN (${o(t)})`}function o(n){return n.map((n=>"string"==typeof n?c(n):n)).join(",")}function c(n){return`'${n.replaceAll("'","''")}'`}export{e as parseWhereClause,r as sqlAnd,l as sqlIn,u as sqlOr};
package/geometry/Mesh.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{deprecatedFunction as t}from"../core/deprecate.js";import r from"../core/Error.js";import o from"../core/Loadable.js";import s from"../core/Logger.js";import n from"../core/Promise.js";import{throwIfAborted as i,whenOrAbort as a}from"../core/promiseUtils.js";import{watch as c}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{fromValues as m}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import h from"./Geometry.js";import u from"./Point.js";import d from"./Polygon.js";import{create as f,fromBuffer as x,zero as y}from"./support/aaBoundingBox.js";import{composeAxes as v,create as g}from"./support/axisAngleDegrees.js";import j from"./support/MeshComponent.js";import{componentNotFoundMessage as w,meshNotLoadedMessage as S,invalidLocationMessage as b,invalidPolygonMessage as M,InvalidLocationError as A}from"./support/meshErrors.js";import L from"./support/MeshGeoreferencedVertexSpace.js";import F from"./support/MeshLocalVertexSpace.js";import R from"./support/MeshTransform.js";import{MeshVertexAttributes as C}from"./support/MeshVertexAttributes.js";import{vertexSpaceOriginToPoint as _,isRelativeVertexSpace as U,selectVertexSpace as P}from"./support/meshVertexSpaceUtils.js";import{triangulate as E}from"./support/triangulationUtils.js";import{centerAt as B}from"./support/meshUtils/centerAt.js";import{computeMeshExtent as G}from"./support/meshUtils/extent.js";import{loadExternal as k}from"./support/meshUtils/loadExternal.js";import{Metadata as I}from"./support/meshUtils/Metadata.js";import{convertUnitGeometry as T,createUnitSizeBox as V,extractSingleFaceOfBox as O,createUnitSizeSphere as z,createUnitSizeCylinder as D,convertPlaneSizeParameter as N,createUnitSizePlane as W}from"./support/meshUtils/primitives.js";import{rotate as Z}from"./support/meshUtils/rotate.js";import{scale as q}from"./support/meshUtils/scale.js";var H;const K="esri.geometry.Mesh";function J(){return s.getLogger(K)}const Q={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:L,local:F}};let X=H=class extends(o.LoadableMixin(n.EsriPromiseMixin(h))){constructor(e){super(e),this.components=null,this.vertexSpace=new L,this.transform=null,this.metadata=new I,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new C,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when((()=>{this.addHandles(c((()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map((e=>e.clone()))})),(()=>this._clearSources()),{once:!0,sync:!0}))}))}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,r=this;return G({get transform(){return r.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return 0===e.length||0===t?.length?f(y):x(e)}get origin(){const e=_(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:r}=this._transformedExtent;return new u({x:t.x,y:t.y,z:r,spatialReference:this.spatialReference})}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(j.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}J().error("removeComponent()",w)}}rotate(e,t,r,o){return v(e,t,r,Y),Z(this,Y,o),this}offset(e,t,r){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:o,vertexAttributes:s}=this,n=s?.position;if(!n)return this;if(U(o)){const[s,n,i]=o.origin;o.origin=m(s+e,n+t,i+r)}else{for(let o=0;o<n.length;o+=3)n[o]+=e,n[o+1]+=t,n[o+2]+=r;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(q(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(B(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(k(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(){return this.cloneAndModifyVertexAttributes(this.vertexAttributes.clone(),this.vertexSpace.clone(),{preserveMetadata:!0})}cloneAndModifyVertexAttributes(e,t,r){let o=null;if(this.components){const e=new Map,t=new Map;o=this.components.map((r=>r.cloneWithDeduplication(e,t)))}const s={components:o,spatialReference:this.spatialReference,vertexAttributes:e,vertexSpace:t,transform:this.transform?.clone()??null,metadata:r?.preserveMetadata?this.metadata.clone():new I};return new H(s)}cloneShallow(){return new H({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([import("./support/meshUtils/exporters/gltf/gltfexport.js"),this.load(e)]);return i(e),await t(this,e)}get usedMemory(){return this.components?this.components.reduce(((e,t)=>e+t.memoryUsage),this.vertexAttributes.usedMemory):this.vertexAttributes.usedMemory}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(J().error(e,S),!1)}static createBox(e,t){if(!(e instanceof u))return J().error(".createBox()",b),null;const r=new H(T(V(),e,t));return t?.imageFace&&"all"!==t.imageFace?O(r,t.imageFace):r}static createSphere(e,t){return e instanceof u?new H(T(z(t?.densificationFactor||0),e,t)):(J().error(".createSphere()",b),null)}static createCylinder(e,t){return e instanceof u?new H(T(D(t?.densificationFactor||0),e,t)):(J().error(".createCylinder()",b),null)}static createPlane(e,t){if(!(e instanceof u))return J().error(".createPlane()",b),null;const r=t?.facing??"up",o=N(r,t?.size);return new H(T(W(r),e,{...t,size:o}))}static createFromPolygon(e,t){if(!(e instanceof d))return J().error(".createFromPolygon()",M),null;const r=E(e);return new H({vertexAttributes:new C({position:r.position}),components:[new j({faces:r.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new L})}static async createFromGLTF(e,t,r){if(!(e instanceof u)){const e=new A;throw J().error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:o}=await a(import("./support/meshUtils/loadGLTFMesh.js"),r);return new H(await o(e,t,r))}static async createFromFiles(e,o,s){t(J(),"`Mesh.createFromFiles` is deprecated in favor of 'SceneLayer.convertMesh'",{replacement:"SceneLayer.convertMesh",version:"4.29"});const n=e=>J().error(".createFromFiles()",e.message);if(!(e instanceof u)){const e=new A;throw n(e),e}if(!s?.layer)throw new r("invalid:no-layer","SceneLayer required for file to mesh conversion.");return s.layer.convertMesh(o,{location:e,...s})}static createWithExternalSource(e,t,r){const o=r?.extent??null,{spatialReference:s}=e,n=r?.transform?.clone()??new R,i=P(e,r),a=r?.unitConversionDisabled,c={source:t,extent:o,unitConversionDisabled:a},p=new I;return p.externalSources.push(c),new H({metadata:p,transform:n,vertexSpace:i,spatialReference:s})}static createIncomplete(e,t){const{spatialReference:o}=e,s=t?.transform?.clone()??new R,n=P(e,t),i=new H({transform:s,vertexSpace:n,spatialReference:o});return i.addResolvingPromise(Promise.reject(new r("mesh-incomplete","Mesh resources are not complete"))),i}};e([p({type:[j],json:{write:!0}})],X.prototype,"components",void 0),e([p({nonNullable:!0,types:Q,constructOnly:!0,json:{write:!0}})],X.prototype,"vertexSpace",void 0),e([p({type:R,json:{write:!0}})],X.prototype,"transform",void 0),e([p({constructOnly:!0})],X.prototype,"metadata",void 0),e([p()],X.prototype,"hasExtent",null),e([p()],X.prototype,"_transformedExtent",null),e([p()],X.prototype,"_untransformedBounds",null),e([p()],X.prototype,"origin",null),e([p({readOnly:!0,json:{read:!1}})],X.prototype,"extent",null),e([p({readOnly:!0,json:{read:!1,write:!0,default:!0}})],X.prototype,"hasZ",void 0),e([p({readOnly:!0,json:{read:!1,write:!0,default:!1}})],X.prototype,"hasM",void 0),e([p({type:C,nonNullable:!0,json:{write:!0}})],X.prototype,"vertexAttributes",void 0),X=H=e([l(K)],X);const Y=g(),$=X;export{$ as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import r from"../core/Loadable.js";import o from"../core/Logger.js";import s from"../core/Promise.js";import{throwIfAborted as n,whenOrAbort as i}from"../core/promiseUtils.js";import{watch as a}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{fromValues as m}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"./Geometry.js";import u from"./Point.js";import h from"./Polygon.js";import{create as d,fromBuffer as f,zero as x}from"./support/aaBoundingBox.js";import{composeAxes as y,create as v}from"./support/axisAngleDegrees.js";import g from"./support/MeshComponent.js";import{componentNotFoundMessage as j,meshNotLoadedMessage as w,invalidLocationMessage as S,invalidPolygonMessage as b,InvalidLocationError as A}from"./support/meshErrors.js";import M from"./support/MeshGeoreferencedVertexSpace.js";import L from"./support/MeshLocalVertexSpace.js";import R from"./support/MeshTransform.js";import{MeshVertexAttributes as C}from"./support/MeshVertexAttributes.js";import{vertexSpaceOriginToPoint as _,isRelativeVertexSpace as F,selectVertexSpace as U}from"./support/meshVertexSpaceUtils.js";import{triangulate as P}from"./support/triangulationUtils.js";import{centerAt as E}from"./support/meshUtils/centerAt.js";import{computeMeshExtent as B}from"./support/meshUtils/extent.js";import{loadExternal as G}from"./support/meshUtils/loadExternal.js";import{Metadata as k}from"./support/meshUtils/Metadata.js";import{convertUnitGeometry as I,createUnitSizeBox as T,extractSingleFaceOfBox as V,createUnitSizeSphere as O,createUnitSizeCylinder as z,convertPlaneSizeParameter as D,createUnitSizePlane as N}from"./support/meshUtils/primitives.js";import{rotate as W}from"./support/meshUtils/rotate.js";import{scale as Z}from"./support/meshUtils/scale.js";var H;const K="esri.geometry.Mesh";function q(){return o.getLogger(K)}const J={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:M,local:L}};let Q=H=class extends(r.LoadableMixin(s.EsriPromiseMixin(l))){constructor(e){super(e),this.components=null,this.vertexSpace=new M,this.transform=null,this.metadata=new k,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new C,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when((()=>{this.addHandles(a((()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map((e=>e.clone()))})),(()=>this._clearSources()),{once:!0,sync:!0}))}))}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,r=this;return B({get transform(){return r.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return 0===e.length||0===t?.length?d(x):f(e)}get origin(){const e=_(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:r}=this._transformedExtent;return new u({x:t.x,y:t.y,z:r,spatialReference:this.spatialReference})}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(g.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}q().error("removeComponent()",j)}}rotate(e,t,r,o){return y(e,t,r,X),W(this,X,o),this}offset(e,t,r){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:o,vertexAttributes:s}=this,n=s?.position;if(!n)return this;if(F(o)){const[s,n,i]=o.origin;o.origin=m(s+e,n+t,i+r)}else{for(let o=0;o<n.length;o+=3)n[o]+=e,n[o+1]+=t,n[o+2]+=r;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(Z(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(E(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(G(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(){return this.cloneAndModifyVertexAttributes(this.vertexAttributes.clone(),this.vertexSpace.clone(),{preserveMetadata:!0})}cloneAndModifyVertexAttributes(e,t,r){let o=null;if(this.components){const e=new Map,t=new Map;o=this.components.map((r=>r.cloneWithDeduplication(e,t)))}const s={components:o,spatialReference:this.spatialReference,vertexAttributes:e,vertexSpace:t,transform:this.transform?.clone()??null,metadata:r?.preserveMetadata?this.metadata.clone():new k};return new H(s)}cloneShallow(){return new H({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([import("./support/meshUtils/exporters/gltf/gltfexport.js"),this.load(e)]);return n(e),await t(this,e)}get usedMemory(){return this.components?this.components.reduce(((e,t)=>e+t.memoryUsage),this.vertexAttributes.usedMemory):this.vertexAttributes.usedMemory}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(q().error(e,w),!1)}static createBox(e,t){if(!(e instanceof u))return q().error(".createBox()",S),null;const r=new H(I(T(),e,t));return t?.imageFace&&"all"!==t.imageFace?V(r,t.imageFace):r}static createSphere(e,t){return e instanceof u?new H(I(O(t?.densificationFactor||0),e,t)):(q().error(".createSphere()",S),null)}static createCylinder(e,t){return e instanceof u?new H(I(z(t?.densificationFactor||0),e,t)):(q().error(".createCylinder()",S),null)}static createPlane(e,t){if(!(e instanceof u))return q().error(".createPlane()",S),null;const r=t?.facing??"up",o=D(r,t?.size);return new H(I(N(r),e,{...t,size:o}))}static createFromPolygon(e,t){if(!(e instanceof h))return q().error(".createFromPolygon()",b),null;const r=P(e);return new H({vertexAttributes:new C({position:r.position}),components:[new g({faces:r.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new M})}static async createFromGLTF(e,t,r){if(!(e instanceof u)){const e=new A;throw q().error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:o}=await i(import("./support/meshUtils/loadGLTFMesh.js"),r);return new H(await o(e,t,r))}static createWithExternalSource(e,t,r){const o=r?.extent??null,{spatialReference:s}=e,n=r?.transform?.clone()??new R,i=U(e,r),a=r?.unitConversionDisabled,c={source:t,extent:o,unitConversionDisabled:a},p=new k;return p.externalSources.push(c),new H({metadata:p,transform:n,vertexSpace:i,spatialReference:s})}static createIncomplete(e,r){const{spatialReference:o}=e,s=r?.transform?.clone()??new R,n=U(e,r),i=new H({transform:s,vertexSpace:n,spatialReference:o});return i.addResolvingPromise(Promise.reject(new t("mesh-incomplete","Mesh resources are not complete"))),i}};e([c({type:[g],json:{write:!0}})],Q.prototype,"components",void 0),e([c({nonNullable:!0,types:J,constructOnly:!0,json:{write:!0}})],Q.prototype,"vertexSpace",void 0),e([c({type:R,json:{write:!0}})],Q.prototype,"transform",void 0),e([c({constructOnly:!0})],Q.prototype,"metadata",void 0),e([c()],Q.prototype,"hasExtent",null),e([c()],Q.prototype,"_transformedExtent",null),e([c()],Q.prototype,"_untransformedBounds",null),e([c()],Q.prototype,"origin",null),e([c({readOnly:!0,json:{read:!1}})],Q.prototype,"extent",null),e([c({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Q.prototype,"hasZ",void 0),e([c({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Q.prototype,"hasM",void 0),e([c({type:C,nonNullable:!0,json:{write:!0}})],Q.prototype,"vertexAttributes",void 0),Q=H=e([p(K)],Q);const X=v(),Y=Q;export{Y 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.32/esri/copyright.txt for details.
4
4
  */
5
- import{deprecated as e}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{p as n}from"../../chunks/vec32.js";import o from"../Point.js";import i from"./MeshGeoreferencedVertexSpace.js";import t from"./MeshLocalVertexSpace.js";function c(){return r.getLogger("esri.geometry.Mesh")}function p(e){return null==e.origin}function g(e){return null!=e.origin}function a(e){return g(e.vertexSpace)}function u(e,r){if(!g(e))return null;const[n,i,t]=e.origin;return new o({x:n,y:i,z:t,spatialReference:r})}function l(r,n){const{x:o,y:p,z:g,spatialReference:a}=r,u=[o,p,g??0];void 0!==n?.geographic&&(e(c(),"option: geographic",{replacement:"Use the `vertexSpace` option instead.",version:"4.29",warnOnce:!0}),n.vertexSpace&&c().warn("Deprecated geographic flag ignored since vertexSpace option is provided."));return"local"===(n?.vertexSpace??f(n?.geographic)??s(a))?new t({origin:u}):new i({origin:u})}function s(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}function f(e){return null==e?void 0:e?"local":"georeferenced"}function m(e,r){return e.type===r.type&&(e.origin===r.origin||null!=e.origin&&null!=r.origin&&n(e.origin,r.origin))}export{p as isAbsoluteVertexSpace,a as isMeshWithRelativeVertexSpace,g as isRelativeVertexSpace,l as selectVertexSpace,m as vertexSpaceEquals,u as vertexSpaceOriginToPoint};
5
+ import{p as e}from"../../chunks/vec32.js";import n from"../Point.js";import r from"./MeshGeoreferencedVertexSpace.js";import i from"./MeshLocalVertexSpace.js";function o(e){return null==e.origin}function t(e){return null!=e.origin}function c(e){return t(e.vertexSpace)}function u(e,r){if(!t(e))return null;const[i,o,c]=e.origin;return new n({x:i,y:o,z:c,spatialReference:r})}function l(e,n){const{x:o,y:t,z:c,spatialReference:u}=e,l=[o,t,c??0];return"local"===(n?.vertexSpace??f(u))?new i({origin:l}):new r({origin:l})}function f(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}function p(n,r){return n.type===r.type&&(n.origin===r.origin||null!=n.origin&&null!=r.origin&&e(n.origin,r.origin))}export{o as isAbsoluteVertexSpace,c as isMeshWithRelativeVertexSpace,t as isRelativeVertexSpace,l as selectVertexSpace,p as vertexSpaceEquals,u as vertexSpaceOriginToPoint};
package/interfaces.d.ts CHANGED
@@ -1418,9 +1418,8 @@ declare namespace __esri {
1418
1418
  *
1419
1419
  * @param item
1420
1420
  * @param type
1421
- * @param typePriorities
1422
1421
  */
1423
- symbolUrlFromStyleItem(item: any, type: any, typePriorities: string[]): string;
1422
+ symbolUrlFromStyleItem(item: any, type: any): string | nullish;
1424
1423
  }
1425
1424
 
1426
1425
  export const styleUtils: styleUtils;
@@ -1483,10 +1482,10 @@ declare namespace __esri {
1483
1482
  * @param symbolName
1484
1483
  * @param context
1485
1484
  * @param type
1486
- * @param styleItemRead
1485
+ * @param symbolUrlFromStyleItem
1487
1486
  * @param options
1488
1487
  */
1489
- fetchSymbolFromStyle(styleResponse: any, symbolName: string, context: any, type: any, styleItemRead: Function, options?: any | null): Promise<any>;
1488
+ fetchSymbolFromStyle(styleResponse: any, symbolName: string, context: any, type: any, symbolUrlFromStyleItem: Function, options?: any | null): Promise<any>;
1490
1489
  }
1491
1490
 
1492
1491
  export const webStyleSymbolUtils: webStyleSymbolUtils;
@@ -8511,20 +8510,6 @@ declare namespace __esri {
8511
8510
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder Read more...}
8512
8511
  */
8513
8512
  static createCylinder(location: Point, parameters?: CreateCylinderParameters): Mesh;
8514
- /**
8515
- * Creates a mesh geometry from a file or list of files and which is ready to be displayed in the
8516
- * view.
8517
- *
8518
- * @param location The location of the origin of the model. If the location doesn't contain a z-value, z is assumed to be `0`.
8519
- * @param files The files from which to create the mesh.
8520
- * @param parameters Additional parameters.
8521
- * @param parameters.layer The layer to which the files are to be uploaded and which will perform any necessary conversions.
8522
- * @param parameters.signal An [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) to abort the loading process. If canceled, the promise will be rejected with an error named `AbortError`. See also [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).
8523
- * @deprecated Use {@link module:module:esri/layers/SceneLayer~convertMesh convertMesh} instead.
8524
- *
8525
- * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createFromFiles Read more...}
8526
- */
8527
- static createFromFiles(location: Point, files: File[], parameters?: MeshCreateFromFilesParameters): Promise<Mesh>;
8528
8513
  /**
8529
8514
  * Creates a new mesh geometry from a glTF model referenced by the `url` parameter.
8530
8515
  *
@@ -8602,7 +8587,6 @@ declare namespace __esri {
8602
8587
  */
8603
8588
  export interface CreateBoxParameters {
8604
8589
  size?: number | CreateBoxParametersSize;
8605
- geographic?: boolean;
8606
8590
  unit?: LengthUnit;
8607
8591
  vertexSpace?: "local" | "georeferenced";
8608
8592
  material?: MeshMaterial;
@@ -8619,7 +8603,6 @@ declare namespace __esri {
8619
8603
  width?: number;
8620
8604
  depth?: number;
8621
8605
  height?: number;
8622
- geographic?: boolean;
8623
8606
  unit?: LengthUnit;
8624
8607
  densificationFactor?: number;
8625
8608
  vertexSpace?: "local" | "georeferenced";
@@ -8632,7 +8615,6 @@ declare namespace __esri {
8632
8615
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#CreateFromGLTFParameters Read more...}
8633
8616
  */
8634
8617
  export interface CreateFromGLTFParameters {
8635
- geographic?: boolean;
8636
8618
  signal?: AbortSignal | nullish;
8637
8619
  vertexSpace?: "local" | "georeferenced";
8638
8620
  material?: MeshMaterial;
@@ -8649,7 +8631,6 @@ declare namespace __esri {
8649
8631
  depth?: number;
8650
8632
  height?: number;
8651
8633
  facing?: "east" | "west" | "north" | "south" | "up" | "down";
8652
- geographic?: boolean;
8653
8634
  unit?: LengthUnit;
8654
8635
  densificationFactor?: number;
8655
8636
  vertexSpace?: "local" | "georeferenced";
@@ -8666,7 +8647,6 @@ declare namespace __esri {
8666
8647
  width?: number;
8667
8648
  depth?: number;
8668
8649
  height?: number;
8669
- geographic?: boolean;
8670
8650
  unit?: LengthUnit;
8671
8651
  densificationFactor?: number;
8672
8652
  vertexSpace?: "local" | "georeferenced";
@@ -8678,11 +8658,6 @@ declare namespace __esri {
8678
8658
  origin?: Point;
8679
8659
  }
8680
8660
 
8681
- export interface MeshCreateFromFilesParameters {
8682
- layer?: SceneLayer;
8683
- signal?: AbortSignal | nullish;
8684
- }
8685
-
8686
8661
  export interface MeshCreateFromPolygonParameters {
8687
8662
  material?: MeshMaterialProperties;
8688
8663
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.32.0-next.20250207",
3
+ "version": "4.32.0-next.20250209",
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": [
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "@esri/arcgis-html-sanitizer": "~4.1.0",
29
29
  "@esri/calcite-components": "~3.0.0-next.132",
30
- "@vaadin/grid": "~24.6.3",
30
+ "@vaadin/grid": "~24.6.4",
31
31
  "@zip.js/zip.js": "~2.7.57",
32
32
  "luxon": "~3.5.0",
33
33
  "marked": "~15.0.6"
package/rest/print.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{id as e}from"../kernel.js";import t from"../request.js";import{JSONMap as i}from"../core/jsonMap.js";import{createScreenPoint as a,pt2px as r,px2pt as n}from"../core/screenUtils.js";import{normalize as o,dataComponents as s}from"../core/urlUtils.js";import l from"../geometry/Polygon.js";import{collectLabelingFields as c}from"../layers/support/fieldUtils.js";import{getFloorFilterClause as u}from"../layers/support/floorFilterUtils.js";import{getSizeRangeAtScale as y}from"../renderers/visualVariables/support/visualVariableUtils.js";import{asValidOptions as p,getToken as f}from"./utils.js";import{execute as d}from"./geoprocessor/execute.js";import{submitJob as m}from"./geoprocessor/submitJob.js";import{formatJsonMap as g}from"./support/fileFormat.js";import{toJSON as h}from"./support/layoutTemplate.js";import{getVisibleLayerViews as b,isScreenshotRequired as w,isBingMapsLayer as S,isBlendLayer as x,getCopyright as I,getSelectionSymbol as D,getContextBoundingBox as v,createPolygonLayer as T,createPolylineLayer as L,createPointLayer as O,createMultipointLayer as E}from"./support/printTaskUtils.js";import P from"./support/PrintTemplate.js";import{toJSON as V}from"./support/reportTemplate.js";const M={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},F=new i({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),N=new i({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),R=new Map;async function U(e,t,i){const a=await J(e,i),r=await A(t,a);if("sync"===await j(e,i)){const{results:t}=await d(e,r,void 0,i);return t?.[0]?.value}const n=await m(e,r,void 0,i);await n.waitForJobCompletion({interval:t.updateDelay});const{value:o}=await n.fetchResultData("Output_File",null,i);return o}async function J(e,i){const a=_(e),r=R.get(a)??{gpServerUrl:a,legendLayerNameMap:{},legendLayers:[]};return r.gpMetadata??=(await t(a,p({f:"json"},i))).data,r.cimVersion=r.gpMetadata.cimVersion,R.set(a,r),r}async function j(e,t){return he(await J(e,t))}async function k(e,t){return(await J(e,t)).gpMetadata.tasks}async function A(t,i){i=i||{is11xService:!1,legendLayerNameMap:{},legendLayers:[]};const a=t.template||new P;null==a.showLabels&&(a.showLabels=!0);const r=a.exportOptions;let n;const o=h(a.layout);if(r){if(n={dpi:r.dpi},"map_only"===o?.toLowerCase()||""===o){const{width:e,height:t}=r;n.outputSize=null!=e&&null!=t?[e,t]:void 0}}const s=a.layoutOptions;let l;if(s){let e,t;"Miles"===s.scalebarUnit||"Kilometers"===s.scalebarUnit?(e="Kilometers",t="Miles"):"Meters"!==s.scalebarUnit&&"Feet"!==s.scalebarUnit||(e="Meters",t="Feet"),l={titleText:s.titleText,authorText:s.authorText,copyrightText:s.copyrightText,customTextElements:s.customTextElements,elementOverrides:s.elementOverrides,scaleBarOptions:{metricUnit:F.toJSON(e),metricLabel:e?M[e]:void 0,nonMetricUnit:F.toJSON(t),nonMetricLabel:t?M[t]:void 0}}}let c=null;s?.legendLayers&&(c=s.legendLayers.map((e=>{const t=e.layerId;i.legendLayerNameMap[t]=e.title;const a={id:t};return e.subLayerIds&&(a.subLayerIds=e.subLayerIds),a})));const u=await C(t,a,i);if(u.operationalLayers){const e=new RegExp("[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]"),t=/[\u0600-\u06FF]/,i=i=>{const a=i.text,r=i.font,n=r?.family?.toLowerCase();a&&r&&("arial"===n||"arial unicode ms"===n)&&(r.family=e.test(a)?"Arial Unicode MS":"Arial","normal"!==r.style&&t.test(a)&&(r.family="Arial Unicode MS"))};for(const a of u.operationalLayers)if(a.featureCollection?.layers)for(const e of a.featureCollection.layers){if(e.layerDefinition?.drawingInfo?.renderer?.symbol){const t=e.layerDefinition.drawingInfo.renderer;"esriTS"===t.symbol.type&&i(t.symbol)}if(e.featureSet?.features)for(const t of e.featureSet.features)t.symbol&&"esriTS"===t.symbol.type&&i(t.symbol)}}t.outSpatialReference&&(u.mapOptions.spatialReference=t.outSpatialReference.toJSON()),Object.assign(u,{exportOptions:n,layoutOptions:l||{}}),Object.assign(u.layoutOptions,{legendOptions:{operationalLayers:null!=c?c:i.legendLayers.slice()}}),i.legendLayers.length=0,R.set(i.gpServerUrl,i);const y={Web_Map_as_JSON:JSON.stringify(u),Format:g.toJSON(a.format),Layout_Template:o,Layout_Item_ID:void 0,Report_Template:V(a.report),Report_Item_ID:void 0};if(a.layoutItem){delete y.Layout_Template;const t=a.layoutItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(i.gpServerUrl),y.Layout_Item_ID=JSON.stringify({id:t.id})}if(a.reportItem){delete y.Report_Template;const t=a.reportItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(i.gpServerUrl),y.Report_Item_ID=JSON.stringify({id:t.id})}return t.extraParameters&&Object.assign(y,t.extraParameters),y}async function C(e,t,i){const a=e.view;let r=a.spatialReference;const n={operationalLayers:await z(a,t,i)};t.includeTables&&(n.tables=await ne(a));let o=e.extent||i.ssExtent||a.extent;if(r?.isWrappable&&(o=o.clone()._normalize(!0),r=o.spatialReference),n.mapOptions={extent:o&&o.toJSON(),spatialReference:r&&r.toJSON(),showAttribution:t.attributionVisible},i.ssExtent=null,a.background&&(n.background=a.background.toJSON()),a.rotation&&(n.mapOptions.rotation=-a.rotation),t.scalePreserved&&(n.mapOptions.scale=t.outScale||a.scale),null!=a.timeExtent){const e=null!=a.timeExtent.start?a.timeExtent.start.getTime():null,t=null!=a.timeExtent.end?a.timeExtent.end.getTime():null;n.mapOptions.time=[e,t]}return t.reportOptions&&(n.reportOptions=t.reportOptions),n}function _(e){let t=e;const i=t.lastIndexOf("/GPServer/");return i>0&&(t=t.slice(0,i+9)),t}async function z(e,t,i){const a=[],r={layerView:null,printTemplate:t,view:e};let n=0;t.scalePreserved&&(n=t.outScale||e.scale);const o=b(e,n);for(const s of o){const e=s.layer;if(!e.loaded||"layers"in e)continue;let t;r.layerView=s,t=w(s)?await ie(e,r,i):S(e)?$(e):"csv"===e?.type?await B(e,r,i):"catalog-footprint"===e?.type?await q(e,r,i):"feature"===e?.type?await W(e,r,i):"geojson"===e?.type?await G(e,r,i):"graphics"===e?.type?await H(e,r,i):"imagery"===e?.type?Q(e,i):"imagery-tile"===e?.type?await X(e,r,i):"kml"===e?.type?await Y(e,r,i):"map-image"===e?.type?Z(e,r,i):"map-notes"===e?.type?await ee(r,i):"open-street-map"===e?.type?te():"stream"===e?.type?await ae(e,r,i):"subtype-group"===e?.type?await re(e,i):"tile"===e?.type?oe(e,i):"vector-tile"===e?.type?await se(e,r,i):"web-tile"===e?.type?le(e):"wfs"===e?.type?await ce(e,r,i):"wms"===e?.type?ue(e,i):"wmts"===e?.type?ye(e):await ie(e,r,i),t&&(Array.isArray(t)?a.push(...t):(t.id=e.id,t.title=i.legendLayerNameMap[e.id]||e.title,t.opacity=s.fullOpacity,t.minScale=e.minScale||0,t.maxScale=e.maxScale||0,x(e)&&e.blendMode&&"normal"!==e.blendMode&&(t.blendMode=e.blendMode),a.push(t)))}if(n)for(const s of a)s.minScale=0,s.maxScale=0;if(e.graphics?.length){const r=await K(null,e.graphics,t,i);r&&a.push(r)}return a}function $(e){return{culture:e.culture,key:e.key,type:"BingMaps"+("aerial"===e.style?"Aerial":"hybrid"===e.style?"Hybrid":"Road")}}async function q(e,{layerView:t,printTemplate:i},a){if(parseFloat(a.cimVersion)<3.1){return K(e,await me(t),i,a)}const r=e.parent,n={id:(o=ge(r,"web-map")).id,url:o.url,layerType:o.layerType,customParameters:o.customParameters,dynamicGroupLayer:{visibility:!1},footprintLayer:o.footprintLayer,layerDefinition:o.layerDefinition};var o;return pe(n,r),n}async function B(e,t,i){e.legendEnabled&&i.legendLayers.push({id:e.id});const a=t.layerView,r=t.printTemplate;if(!(a.filter||e.portalItem&&"public"!==e.portalItem.access)){const t=ge(e,"web-map");return t.type="CSV",delete t.popupInfo,delete t.layerType,t.showLabels=r.showLabels&&e.labelsVisible,t}return K(e,await me(a),r,i)}async function K(e,t,i,a){let r;const n=T(),o=L(),s=O(),u=E(),y=O();if(y.layerDefinition.name="textLayer",delete y.layerDefinition.drawingInfo,e){if("esri.layers.FeatureLayer"===e.declaredClass||"esri.layers.StreamLayer"===e.declaredClass?n.layerDefinition.name=o.layerDefinition.name=s.layerDefinition.name=u.layerDefinition.name=a.legendLayerNameMap[e.id]||e.arcgisProps?.title||e.title:"esri.layers.GraphicsLayer"===e.declaredClass&&(t=e.graphics.items),e.renderer){const t=e.renderer.toJSON(),i=n.layerDefinition.drawingInfo;i&&(i.renderer=t);const a=o.layerDefinition.drawingInfo;a&&(a.renderer=t);const r=s.layerDefinition.drawingInfo;r&&(r.renderer=t);const l=u.layerDefinition.drawingInfo;l&&(l.renderer=t)}if(i.showLabels&&e.labelsVisible&&"function"==typeof e.write){const t=ge(e,"web-map"),i=t.layerDefinition?.drawingInfo?.labelingInfo;if(i){r=!0;const e=n.layerDefinition.drawingInfo;e&&(e.labelingInfo=i);const t=o.layerDefinition.drawingInfo;t&&(t.labelingInfo=i);const a=s.layerDefinition.drawingInfo;a&&(a.labelingInfo=i);const l=u.layerDefinition.drawingInfo;l&&(l.labelingInfo=i)}}}let p;e?.renderer||r||(delete n.layerDefinition.drawingInfo,delete o.layerDefinition.drawingInfo,delete s.layerDefinition.drawingInfo,delete u.layerDefinition.drawingInfo);const f=e?.fieldsIndex,d=e?.renderer;if(f){const t=new Set;r&&await c(t,e),d&&"function"==typeof d.collectRequiredFields&&await d.collectRequiredFields(t,f),p=Array.from(t);const i=f.fields.map((e=>e.toJSON()));n.layerDefinition.fields=i,o.layerDefinition.fields=i,s.layerDefinition.fields=i,u.layerDefinition.fields=i}const m=t?.length;let g;for(let c=0;c<m;c++){const e=t[c]||t.at(c);if(!1!==e.visible&&e.geometry){if(g=e.toJSON(),g.hasOwnProperty("popupTemplate")&&delete g.popupTemplate,g.geometry?.z&&delete g.geometry.z,g.symbol&&(g.symbol.angle||delete g.symbol.angle,be(g.symbol)?g.symbol=await fe(g.symbol,a):g.symbol.text&&delete g.attributes),(!i||!i.forceFeatureAttributes)&&p?.length){const e={};for(const t of p)g.attributes?.hasOwnProperty(t)&&(e[t]=g.attributes[t]);g.attributes=e}"polygon"===e.geometry.type?n.featureSet.features.push(g):"polyline"===e.geometry.type?o.featureSet.features.push(g):"point"===e.geometry.type?g.symbol?.text?y.featureSet.features.push(g):s.featureSet.features.push(g):"multipoint"===e.geometry.type?u.featureSet.features.push(g):"extent"===e.geometry.type&&(g.geometry=l.fromExtent(e.geometry).toJSON(),n.featureSet.features.push(g))}}const h=[n,o,u,s,y].filter((e=>e.featureSet.features.length>0));for(const l of h){const e=l.featureSet.features.every((e=>e.symbol));if(e&&(!i||!i.forceFeatureAttributes))for(const t of l.featureSet.features)delete t.attributes;e&&delete l.layerDefinition.drawingInfo,l.layerDefinition.drawingInfo?.renderer&&await de(l.layerDefinition.drawingInfo.renderer,a)}return h.length?{featureCollection:{layers:h},showLabels:r}:null}async function W(e,t,i){let a;const r=e.renderer,n=parseFloat(i.cimVersion);if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type&&n<2.9||"pie-chart"===r?.type||"dot-density"===r?.type&&n<2.6)return ie(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const o=t.layerView,{printTemplate:s,view:l}=t,c="feature-layer"!==e.source?.type&&"ogc-feature"!==e.source?.type;if(o.filter||c||!r||"field"in r&&null!=r.field&&!e.getField(r.field)){const t=await me(o);a=await K(e,t,s,i)}else{if(a={id:(p=ge(e)).id,title:p.title,url:p.url,layerType:p.layerType,customParameters:p.customParameters,layerDefinition:p.layerDefinition,charts:s.includeCharts?p.charts:void 0},s.attributionVisible&&(a.credits=I(e)),a.showLabels=s.showLabels&&e.labelsVisible,pe(a,e),delete a.layerDefinition?.featureReduction?.disablePopup,delete a.layerDefinition?.featureReduction?.popupInfo,o.displayFilterEnabled||delete a.layerDefinition?.displayFilterInfo,a.layerDefinition?.drawingInfo?.renderer&&(delete a.layerDefinition.minScale,delete a.layerDefinition.maxScale,await de(a.layerDefinition.drawingInfo.renderer,i),"visualVariables"in r&&r.visualVariables?.[0])){const e=r.visualVariables[0];if("size"===e.type&&e.maxSize&&"number"!=typeof e.maxSize&&e.minSize&&"number"!=typeof e.minSize){const t=y(e,l.scale);a.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=t.minSize,a.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=t.maxSize}}const t=u(o);if(t&&(a.layerDefinition??={},a.layerDefinition.definitionExpression=a.layerDefinition.definitionExpression?`(${a.layerDefinition.definitionExpression}) AND (${t})`:t),e.gdbVersion&&(a.layerDefinition??={},a.layerDefinition.gdbVersion=e.gdbVersion),o.hasHighlight?.()&&"getHighlightIds"in o){const t=o;a.selectionObjectIds=t.getHighlightIds(),a.selectionSymbol=D(e.geometryType,t.highlightOptions??l.highlightOptions)}}var p;return a}async function G(e,t,i){if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type)return ie(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});return K(e,await me(t.layerView),t.printTemplate,i)}async function H(e,{printTemplate:t},i){return K(e,null,t,i)}function Q(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(a=ge(e)).layerType,customParameters:a.customParameters};var a;return i.bandIds=e.bandIds,i.compressionQuality=e.compressionQuality,i.format=e.format,i.interpolation=e.interpolation,(e.mosaicRule||e.definitionExpression)&&(i.mosaicRule=e.exportImageServiceParameters.mosaicRule.toJSON()),e.rasterFunction&&(i.renderingRule=e.rasterFunction.toJSON()),e.renderer&&(i.layerDefinition??={},i.layerDefinition.drawingInfo??={},i.layerDefinition.drawingInfo.renderer=e.renderer.toJSON()),pe(i,e),i}async function X(e,t,i){if("flow"===e.renderer?.type)return ie(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const a={bandIds:(r=ge(e)).bandIds,customParameters:r.customParameters,interpolation:r.interpolation,layerDefinition:r.layerDefinition};var r;return a.layerType="ArcGISImageServiceLayer",pe(a,e),a}async function Y(e,t,i){const a=t.printTemplate;if(!e.portalItem||"public"===e.portalItem.access){const t=ge(e,"web-map");return t.type="kml",delete t.layerType,t.url=o(e.url),t}const r=[],n=t.layerView,s="data:image/png;base64,";n.allVisibleMapImages.forEach(((t,i)=>{const a={id:`${e.id}_image${i}`,type:"image",title:e.id,minScale:e.minScale||0,maxScale:e.maxScale||0,opacity:n.fullOpacity,extent:t.extent};t.href.startsWith(s)?a.imageData=t.href.slice(s.length):a.url=t.href,r.push(a)}));const l=[...n.allVisiblePoints.items,...n.allVisiblePolylines.items,...n.allVisiblePolygons.items],c={id:e.id,...await K(null,l,a,i)};return r.push(c),r}function Z(e,{printTemplate:t,view:i},a){let r;const n={id:e.id,subLayerIds:[]};let o=[];const s=i.scale,l=e=>{const t=0===s,i=0===e.minScale||s<=e.minScale,a=0===e.maxScale||s>=e.maxScale;if(e.visible&&(t||i&&a))if(e.sublayers)e.sublayers.forEach(l);else{const t=e.toExportImageJSON(),i={id:e.id,name:e.title,layerDefinition:{definitionExpression:t.definitionExpression,drawingInfo:t.drawingInfo,orderBy:t.orderBy,source:t.source}};o.unshift(i),n.subLayerIds.push(e.id)}};var c;return e.sublayers&&e.sublayers.forEach(l),o.length&&(o=o.map((({id:e,name:t,layerDefinition:i})=>({id:e,name:t,layerDefinition:i}))),r={layerType:(c=ge(e)).layerType,customParameters:c.customParameters},r.layers=o,r.visibleLayers=e.capabilities?.exportMap?.supportsDynamicLayers?void 0:n.subLayerIds,t.attributionVisible&&(r.credits=I(e)),e.gdbVersion&&(r.gdbVersion=e.gdbVersion),pe(r,e),e.legendEnabled&&a.legendLayers.push(n)),r}async function ee({layerView:e,printTemplate:t},i){const a=[],r=e.layer;if(null!=r.featureCollections)for(const n of r.featureCollections){const e=await K(n,n.source,t,i);e&&a.push(...e.featureCollection.layers)}else if(null!=r.sublayers)for(const n of r.sublayers){const e=await K(null,n.graphics,t,i);e&&a.push(...e.featureCollection.layers)}return{featureCollection:{layers:a}}}function te(){return{type:"OpenStreetMap"}}async function ie(e,{printTemplate:t,view:i},r){const n={type:"image"},o={format:"png",ignoreBackground:!0,ignorePadding:!0,layers:[e]};0!==i.rotation&&(o.rotation=0);const l=r.ssExtent||i.state.extent.clone();let c=96,u=!0,y=!0;if(t.exportOptions){const e=t.exportOptions;null!=e.dpi&&e.dpi>0&&(c=e.dpi),null!=e.width&&e.width>0&&(u=e.width%2==i.width%2),null!=e.height&&e.height>0&&(y=e.height%2==i.height%2)}if("map-only"===t.layout&&t.scalePreserved&&(!t.outScale||t.outScale===i.scale)&&96===c&&(!u||!y)&&i.state.extent.equals(i.extent)&&(o.area={x:0,y:0,width:i.width,height:i.height},u||(o.area.width-=1),y||(o.area.height-=1),!r.ssExtent)){const e=i.toMap(a(o.area.width,o.area.height));l.ymin=e.y,l.xmax=e.x,r.ssExtent=l}n.extent=l.clone()._normalize(!0).toJSON();const p=await i.takeScreenshot(o);return n.imageData=s(p.dataUrl)?.data,n}async function ae(e,{layerView:t,printTemplate:i},a){e.legendEnabled&&a.legendLayers.push({id:e.id});return K(e,await me(t),i,a)}async function re(e,t){if(e.legendEnabled)for(const r of e.sublayers)r.legendEnabled&&t.legendLayers.push({id:r.id});const i={customParameters:(a=ge(e)).customParameters,effect:a.effect,layerDefinition:a.layerDefinition,layerType:a.layerType,layers:a.layers,url:a.url};var a;if(Array.isArray(i.layers))for(const r of i.layers)delete r.popupInfo;return pe(i,e),i}async function ne(e){const t=[],i=[];for(const r of e.map.allTables)"feature"!==r.type||r.loaded||i.push(r.load());i.length&&await Promise.allSettled(i);for(const r of e.map.allTables)if("feature"===r.type&&r.loaded&&r.isTable&&"feature-layer"===r.source?.type){const e={id:(a=ge(r)).id,title:a.title,customParameters:a.customParameters,layerDefinition:{definitionExpression:a.layerDefinition?.definitionExpression},url:a.url};pe(e,r),t.push(e)}var a;return t.length?t:void 0}function oe(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(a=ge(e)).layerType,customParameters:a.customParameters};var a;return pe(i,e),i}async function se(e,t,i){const a=t.layerView;if(e.serviceUrl&&e.styleUrl&&!a.spriteSourceChanged&&!a.styleChanged){const t=f(e.styleUrl,e.apiKey),a=f(e.serviceUrl,e.apiKey);if(!t&&!a||"2.1.0"!==i.cimVersion){const i={type:"VectorTileLayer"};return i.styleUrl=o(e.styleUrl),i.token=t,a!==t&&(i.additionalTokens=[{url:e.serviceUrl,token:a}]),i}}return ie(e,t,i)}function le(e){const t=e.urlTemplate?.replace(/\${/g,"{"),i={type:"WebTiledLayer",urlTemplate:t,credits:e.copyright};return e.subDomains&&e.subDomains.length>0&&(i.subDomains=e.subDomains),i}async function ce(e,t,i){return parseFloat(i.cimVersion)<3.5?ie(e,t,i):(e.legendEnabled&&i.legendLayers.push({id:e.id}),{layerType:(a=ge(e,"web-map")).layerType,layerDefinition:a.layerDefinition,url:a.url,wfsInfo:a.wfsInfo});var a}function ue(e,t){let i;const a=[],r=e=>{e.visible&&(e.sublayers?e.sublayers.forEach(r):e.name&&a.unshift(e.name))};return e.sublayers&&e.sublayers.forEach(r),a.length&&(e.legendEnabled&&t.legendLayers.push({id:e.id,subLayerIds:a}),i={type:"wms",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,transparentBackground:e.imageTransparency,visibleLayers:a,url:o(e.url),version:e.version}),i}function ye(e){const t=e.activeLayer;return{type:"wmts",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,format:t.imageFormat,layer:t.id,style:t.styleId,tileMatrixSet:t.tileMatrixSetId,url:o(e.url)}}function pe(e,t){t.url&&(e.url=o(e.url||t.url),e.token=f(e.url,t.apiKey))}async function fe(e,i){i.canvas||(i.canvas=document.createElement("canvas"));const a=1024;i.canvas.width=a,i.canvas.height=a;const o=i.canvas.getContext("2d");let s,l;if(e.path){const t=new Path2D(e.path);t.closePath(),o.fillStyle=Array.isArray(e.color)?`rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3]/255})`:"rgb(0,0,0)",o.fill(t);const i=v(o);if(!i)return null;o.clearRect(0,0,a,a);const n=r(e.size)/Math.max(i.width,i.height);o.scale(n,n);const c=a/n,u=c/2-i.width/2-i.x,y=c/2-i.height/2-i.y;if(o.translate(u,y),Array.isArray(e.color)&&o.fill(t),e.outline?.width&&Array.isArray(e.outline.color)){const a=e.outline;o.lineWidth=r(a.width)/n,o.lineJoin="round",o.strokeStyle=`rgba(${a.color[0]},${a.color[1]},${a.color[2]},${a.color[3]/255})`,o.stroke(t),i.width+=o.lineWidth,i.height+=o.lineWidth}i.width*=n,i.height*=n;const p=o.getImageData(a/2-i.width/2,a/2-i.height/2,Math.ceil(i.width),Math.ceil(i.height));s=p.width,l=p.height,o.canvas.width=s,o.canvas.height=l,o.putImageData(p,0,0)}else{const i="image/svg+xml"===e.contentType?"data:image/svg+xml;base64,"+e.imageData:e.url,a=(await t(i,{responseType:"image"})).data;s=r(e.width),l=r(e.height),o.canvas.width=s,o.canvas.height=l,o.drawImage(a,0,0,o.canvas.width,o.canvas.height)}return{type:"esriPMS",imageData:o.canvas.toDataURL("image/png").slice(22),angle:e.angle,contentType:"image/png",height:n(l),width:n(s),xoffset:e.xoffset,yoffset:e.yoffset}}async function de(e,t){const i=e.type;if("simple"===i&&be(e.symbol))e.symbol=await fe(e.symbol,t);else if("uniqueValue"===i||"classBreaks"===i){be(e.defaultSymbol)&&(e.defaultSymbol=await fe(e.defaultSymbol,t));const a=e["uniqueValue"===i?"uniqueValueInfos":"classBreakInfos"];if(a)for(const e of a)be(e.symbol)&&(e.symbol=await fe(e.symbol,t))}}async function me(e){return e.queryFeatures(e.createQuery()).then((e=>e.features))}function ge(e,t){return e.write({},{ignorePersistenceEnabled:!0,origin:t})??{}}function he(e){return e.gpMetadata?.executionType?N.fromJSON(e.gpMetadata.executionType):"sync"}function be(e){return e&&(e.path||"image/svg+xml"===e.contentType||e.url?.endsWith(".svg"))}export{U as execute,A as getGpPrintParams,_ as getGpServerUrl,j as getMode,k as getTasks,R as printCacheMap};
5
+ import{id as e}from"../kernel.js";import t from"../request.js";import{JSONMap as i}from"../core/jsonMap.js";import{createScreenPoint as a,pt2px as r,px2pt as n}from"../core/screenUtils.js";import{normalize as o,dataComponents as s}from"../core/urlUtils.js";import l from"../geometry/Polygon.js";import{collectLabelingFields as c}from"../layers/support/fieldUtils.js";import{getFloorFilterClause as u}from"../layers/support/floorFilterUtils.js";import{getSizeRangeAtScale as y}from"../renderers/visualVariables/support/visualVariableUtils.js";import{asValidOptions as p,getToken as f}from"./utils.js";import{execute as d}from"./geoprocessor/execute.js";import{submitJob as m}from"./geoprocessor/submitJob.js";import{formatJsonMap as g}from"./support/fileFormat.js";import{toJSON as h}from"./support/layoutTemplate.js";import{getVisibleLayerViews as b,isScreenshotRequired as w,isBingMapsLayer as S,isBlendLayer as x,getCopyright as I,getSelectionSymbol as D,getContextBoundingBox as v,createPolygonLayer as T,createPolylineLayer as L,createPointLayer as O,createMultipointLayer as E}from"./support/printTaskUtils.js";import P from"./support/PrintTemplate.js";import{toJSON as V}from"./support/reportTemplate.js";const M={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},F=new i({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),N=new i({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),R=new Map;async function U(e,t,i){const a=await J(e,i),r=await A(t,a);if("sync"===await j(e,i)){const{results:t}=await d(e,r,void 0,i);return t?.[0]?.value}const n=await m(e,r,void 0,i);await n.waitForJobCompletion({interval:t.updateDelay});const{value:o}=await n.fetchResultData("Output_File",null,i);return o}async function J(e,i){const a=_(e),r=R.get(a)??{gpServerUrl:a,legendLayerNameMap:{},legendLayers:[]};return r.gpMetadata??=(await t(a,p({f:"json"},i))).data,r.cimVersion=r.gpMetadata.cimVersion,R.set(a,r),r}async function j(e,t){return he(await J(e,t))}async function k(e,t){return(await J(e,t)).gpMetadata.tasks}async function A(t,i){i=i||{is11xService:!1,legendLayerNameMap:{},legendLayers:[]};const a=t.template||new P;null==a.showLabels&&(a.showLabels=!0);const r=a.exportOptions;let n;const o=h(a.layout);if(r){if(n={dpi:r.dpi},"map_only"===o?.toLowerCase()||""===o){const{width:e,height:t}=r;n.outputSize=null!=e&&null!=t?[e,t]:void 0}}const s=a.layoutOptions;let l;if(s){let e,t;"Miles"===s.scalebarUnit||"Kilometers"===s.scalebarUnit?(e="Kilometers",t="Miles"):"Meters"!==s.scalebarUnit&&"Feet"!==s.scalebarUnit||(e="Meters",t="Feet"),l={titleText:s.titleText,authorText:s.authorText,copyrightText:s.copyrightText,customTextElements:s.customTextElements,elementOverrides:s.elementOverrides,scaleBarOptions:{metricUnit:F.toJSON(e),metricLabel:e?M[e]:void 0,nonMetricUnit:F.toJSON(t),nonMetricLabel:t?M[t]:void 0}}}let c=null;s?.legendLayers&&(c=s.legendLayers.map((e=>{const t=e.layerId;i.legendLayerNameMap[t]=e.title;const a={id:t};return e.subLayerIds&&(a.subLayerIds=e.subLayerIds),a})));const u=await C(t,a,i);if(u.operationalLayers){const e=new RegExp("[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]"),t=/[\u0600-\u06FF]/,i=i=>{const a=i.text,r=i.font,n=r?.family?.toLowerCase();a&&r&&("arial"===n||"arial unicode ms"===n)&&(r.family=e.test(a)?"Arial Unicode MS":"Arial","normal"!==r.style&&t.test(a)&&(r.family="Arial Unicode MS"))};for(const a of u.operationalLayers)if(a.featureCollection?.layers)for(const e of a.featureCollection.layers){if(e.layerDefinition?.drawingInfo?.renderer?.symbol){const t=e.layerDefinition.drawingInfo.renderer;"esriTS"===t.symbol.type&&i(t.symbol)}if(e.featureSet?.features)for(const t of e.featureSet.features)t.symbol&&"esriTS"===t.symbol.type&&i(t.symbol)}}t.outSpatialReference&&(u.mapOptions.spatialReference=t.outSpatialReference.toJSON()),Object.assign(u,{exportOptions:n,layoutOptions:l||{}}),Object.assign(u.layoutOptions,{legendOptions:{operationalLayers:null!=c?c:i.legendLayers.slice()}}),i.legendLayers.length=0,R.set(i.gpServerUrl,i);const y={Web_Map_as_JSON:JSON.stringify(u),Format:g.toJSON(a.format),Layout_Template:o,Layout_Item_ID:void 0,Report_Template:V(a.report),Report_Item_ID:void 0};if(a.layoutItem){delete y.Layout_Template;const t=a.layoutItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(i.gpServerUrl),y.Layout_Item_ID=JSON.stringify({id:t.id})}if(a.reportItem){delete y.Report_Template;const t=a.reportItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(i.gpServerUrl),y.Report_Item_ID=JSON.stringify({id:t.id})}return t.extraParameters&&Object.assign(y,t.extraParameters),y}async function C(e,t,i){const a=e.view;let r=a.spatialReference;const n={operationalLayers:await z(a,t,i)};t.includeTables&&(n.tables=await ne(a));let o=e.extent||i.ssExtent||a.extent;if(r?.isWrappable&&(o=o.clone()._normalize(!0),r=o.spatialReference),n.mapOptions={extent:o&&o.toJSON(),spatialReference:r&&r.toJSON(),showAttribution:t.attributionVisible},i.ssExtent=null,a.background&&(n.background=a.background.toJSON()),a.rotation&&(n.mapOptions.rotation=-a.rotation),t.scalePreserved&&(n.mapOptions.scale=t.outScale||a.scale),null!=a.timeExtent){const e=null!=a.timeExtent.start?a.timeExtent.start.getTime():null,t=null!=a.timeExtent.end?a.timeExtent.end.getTime():null;n.mapOptions.time=[e,t]}return t.reportOptions&&(n.reportOptions=t.reportOptions),n}function _(e){let t=e;const i=t.lastIndexOf("/GPServer/");return i>0&&(t=t.slice(0,i+9)),t}async function z(e,t,i){const a=[],r={layerView:null,printTemplate:t,view:e};let n=0;t.scalePreserved&&(n=t.outScale||e.scale);const o=b(e,n);for(const s of o){const e=s.layer;if(!e.loaded||"layers"in e)continue;let t;r.layerView=s,t=w(s)?await ie(e,r,i):S(e)?$(e):"csv"===e?.type?await B(e,r,i):"catalog-footprint"===e?.type?await q(e,r,i):"feature"===e?.type?await W(e,r,i):"geojson"===e?.type?await G(e,r,i):"graphics"===e?.type?await Q(e,r,i):"imagery"===e?.type?H(e,i):"imagery-tile"===e?.type?await X(e,r,i):"kml"===e?.type?await Y(e,r,i):"map-image"===e?.type?Z(e,r,i):"map-notes"===e?.type?await ee(r,i):"open-street-map"===e?.type?te():"stream"===e?.type?await ae(e,r,i):"subtype-group"===e?.type?await re(e,i):"tile"===e?.type?oe(e,i):"vector-tile"===e?.type?await se(e,r,i):"web-tile"===e?.type?le(e):"wfs"===e?.type?await ce(e,r,i):"wms"===e?.type?ue(e,i):"wmts"===e?.type?ye(e):await ie(e,r,i),t&&(Array.isArray(t)?a.push(...t):(t.id=e.id,t.title=i.legendLayerNameMap[e.id]||e.title,t.opacity=s.fullOpacity,t.minScale=e.minScale||0,t.maxScale=e.maxScale||0,x(e)&&e.blendMode&&"normal"!==e.blendMode&&(t.blendMode=e.blendMode),a.push(t)))}if(n)for(const s of a)s.minScale=0,s.maxScale=0;if(e.graphics?.length){const r=await K(null,e.graphics,t,i);r&&a.push(r)}return a}function $(e){return{culture:e.culture,key:e.key,type:"BingMaps"+("aerial"===e.style?"Aerial":"hybrid"===e.style?"Hybrid":"Road")}}async function q(e,{layerView:t,printTemplate:i},a){if(parseFloat(a.cimVersion)<3.1){return K(e,await me(t),i,a)}const r=e.parent,n={id:(o=ge(r,"web-map")).id,url:o.url,layerType:o.layerType,customParameters:o.customParameters,dynamicGroupLayer:{visibility:!1},footprintLayer:o.footprintLayer,layerDefinition:o.layerDefinition};var o;return pe(n,r),n}async function B(e,t,i){e.legendEnabled&&i.legendLayers.push({id:e.id});const a=t.layerView,r=t.printTemplate;if(!(a.filter||e.portalItem&&"public"!==e.portalItem.access)){const t=ge(e,"web-map");return t.type="CSV",delete t.popupInfo,delete t.layerType,t.showLabels=r.showLabels&&e.labelsVisible,t}return K(e,await me(a),r,i)}async function K(e,t,i,a){let r;const n=T(),o=L(),s=O(),u=E(),y=O();if(y.layerDefinition.name="textLayer",delete y.layerDefinition.drawingInfo,e){if("esri.layers.FeatureLayer"===e.declaredClass||"esri.layers.StreamLayer"===e.declaredClass?n.layerDefinition.name=o.layerDefinition.name=s.layerDefinition.name=u.layerDefinition.name=a.legendLayerNameMap[e.id]||e.arcgisProps?.title||e.title:"esri.layers.GraphicsLayer"===e.declaredClass&&(t=e.graphics.items),e.renderer){const t=e.renderer.toJSON(),i=n.layerDefinition.drawingInfo;i&&(i.renderer=t);const a=o.layerDefinition.drawingInfo;a&&(a.renderer=t);const r=s.layerDefinition.drawingInfo;r&&(r.renderer=t);const l=u.layerDefinition.drawingInfo;l&&(l.renderer=t)}if(i.showLabels&&e.labelsVisible&&"function"==typeof e.write){const t=ge(e,"web-map"),i=t.layerDefinition?.drawingInfo?.labelingInfo;if(i){r=!0;const e=n.layerDefinition.drawingInfo;e&&(e.labelingInfo=i);const t=o.layerDefinition.drawingInfo;t&&(t.labelingInfo=i);const a=s.layerDefinition.drawingInfo;a&&(a.labelingInfo=i);const l=u.layerDefinition.drawingInfo;l&&(l.labelingInfo=i)}}}let p;e?.renderer||r||(delete n.layerDefinition.drawingInfo,delete o.layerDefinition.drawingInfo,delete s.layerDefinition.drawingInfo,delete u.layerDefinition.drawingInfo);const f=e?.fieldsIndex,d=e?.renderer;if(f){const t=new Set;r&&await c(t,e),d&&"function"==typeof d.collectRequiredFields&&await d.collectRequiredFields(t,f),p=Array.from(t);const i=f.fields.map((e=>e.toJSON()));n.layerDefinition.fields=i,o.layerDefinition.fields=i,s.layerDefinition.fields=i,u.layerDefinition.fields=i}const m=t?.length;let g;for(let c=0;c<m;c++){const e=t[c]||t.at(c);if(!1!==e.visible&&e.geometry){if(g=e.toJSON(),g.hasOwnProperty("popupTemplate")&&delete g.popupTemplate,g.geometry?.z&&delete g.geometry.z,g.symbol&&(g.symbol.angle||delete g.symbol.angle,be(g.symbol)?g.symbol=await fe(g.symbol,a):g.symbol.text&&delete g.attributes),(!i||!i.forceFeatureAttributes)&&p?.length){const e={};for(const t of p)g.attributes?.hasOwnProperty(t)&&(e[t]=g.attributes[t]);g.attributes=e}"polygon"===e.geometry.type?n.featureSet.features.push(g):"polyline"===e.geometry.type?o.featureSet.features.push(g):"point"===e.geometry.type?g.symbol?.text?y.featureSet.features.push(g):s.featureSet.features.push(g):"multipoint"===e.geometry.type?u.featureSet.features.push(g):"extent"===e.geometry.type&&(g.geometry=l.fromExtent(e.geometry).toJSON(),n.featureSet.features.push(g))}}const h=[n,o,u,s,y].filter((e=>e.featureSet.features.length>0));for(const l of h){const e=l.featureSet.features.every((e=>e.symbol));if(e&&(!i||!i.forceFeatureAttributes))for(const t of l.featureSet.features)delete t.attributes;e&&delete l.layerDefinition.drawingInfo,l.layerDefinition.drawingInfo?.renderer&&await de(l.layerDefinition.drawingInfo.renderer,a)}return h.length?{featureCollection:{layers:h},showLabels:r}:null}async function W(e,t,i){let a;const r=e.renderer,n=parseFloat(i.cimVersion);if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type&&n<2.9||"pie-chart"===r?.type||"dot-density"===r?.type&&n<2.6)return ie(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const o=t.layerView,{printTemplate:s,view:l}=t,c="feature-layer"!==e.source?.type&&"ogc-feature"!==e.source?.type;if(o.filter||c||!r||"field"in r&&null!=r.field&&!e.getField(r.field)){const t=await me(o);a=await K(e,t,s,i)}else{if(a={id:(p=ge(e)).id,title:p.title,url:p.url,layerType:p.layerType,customParameters:p.customParameters,layerDefinition:p.layerDefinition,charts:s.includeCharts?p.charts:void 0},s.attributionVisible&&(a.credits=I(e)),a.showLabels=s.showLabels&&e.labelsVisible,pe(a,e),delete a.layerDefinition?.featureReduction?.disablePopup,delete a.layerDefinition?.featureReduction?.popupInfo,o.displayFilterEnabled||delete a.layerDefinition?.displayFilterInfo,a.layerDefinition?.drawingInfo?.renderer&&(delete a.layerDefinition.minScale,delete a.layerDefinition.maxScale,await de(a.layerDefinition.drawingInfo.renderer,i),"visualVariables"in r&&r.visualVariables?.[0])){const e=r.visualVariables[0];if("size"===e.type&&e.maxSize&&"number"!=typeof e.maxSize&&e.minSize&&"number"!=typeof e.minSize){const t=y(e,l.scale);a.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=t.minSize,a.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=t.maxSize}}const t=u(o);if(t&&(a.layerDefinition??={},a.layerDefinition.definitionExpression=a.layerDefinition.definitionExpression?`(${a.layerDefinition.definitionExpression}) AND (${t})`:t),e.gdbVersion&&(a.layerDefinition??={},a.layerDefinition.gdbVersion=e.gdbVersion),o.hasHighlight&&"highlightIds"in o){const t=o;a.selectionObjectIds=t.highlightIds,a.selectionSymbol=D(e.geometryType,t.highlightOptions??l.highlightOptions)}}var p;return a}async function G(e,t,i){if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type)return ie(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});return K(e,await me(t.layerView),t.printTemplate,i)}async function Q(e,{printTemplate:t},i){return K(e,null,t,i)}function H(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(a=ge(e)).layerType,customParameters:a.customParameters};var a;return i.bandIds=e.bandIds,i.compressionQuality=e.compressionQuality,i.format=e.format,i.interpolation=e.interpolation,(e.mosaicRule||e.definitionExpression)&&(i.mosaicRule=e.exportImageServiceParameters.mosaicRule.toJSON()),e.rasterFunction&&(i.renderingRule=e.rasterFunction.toJSON()),e.renderer&&(i.layerDefinition??={},i.layerDefinition.drawingInfo??={},i.layerDefinition.drawingInfo.renderer=e.renderer.toJSON()),pe(i,e),i}async function X(e,t,i){if("flow"===e.renderer?.type)return ie(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const a={bandIds:(r=ge(e)).bandIds,customParameters:r.customParameters,interpolation:r.interpolation,layerDefinition:r.layerDefinition};var r;return a.layerType="ArcGISImageServiceLayer",pe(a,e),a}async function Y(e,t,i){const a=t.printTemplate;if(!e.portalItem||"public"===e.portalItem.access){const t=ge(e,"web-map");return t.type="kml",delete t.layerType,t.url=o(e.url),t}const r=[],n=t.layerView,s="data:image/png;base64,";n.allVisibleMapImages.forEach(((t,i)=>{const a={id:`${e.id}_image${i}`,type:"image",title:e.id,minScale:e.minScale||0,maxScale:e.maxScale||0,opacity:n.fullOpacity,extent:t.extent};t.href.startsWith(s)?a.imageData=t.href.slice(s.length):a.url=t.href,r.push(a)}));const l=[...n.allVisiblePoints.items,...n.allVisiblePolylines.items,...n.allVisiblePolygons.items],c={id:e.id,...await K(null,l,a,i)};return r.push(c),r}function Z(e,{printTemplate:t,view:i},a){let r;const n={id:e.id,subLayerIds:[]};let o=[];const s=i.scale,l=e=>{const t=0===s,i=0===e.minScale||s<=e.minScale,a=0===e.maxScale||s>=e.maxScale;if(e.visible&&(t||i&&a))if(e.sublayers)e.sublayers.forEach(l);else{const t=e.toExportImageJSON(),i={id:e.id,name:e.title,layerDefinition:{definitionExpression:t.definitionExpression,drawingInfo:t.drawingInfo,orderBy:t.orderBy,source:t.source}};o.unshift(i),n.subLayerIds.push(e.id)}};var c;return e.sublayers&&e.sublayers.forEach(l),o.length&&(o=o.map((({id:e,name:t,layerDefinition:i})=>({id:e,name:t,layerDefinition:i}))),r={layerType:(c=ge(e)).layerType,customParameters:c.customParameters},r.layers=o,r.visibleLayers=e.capabilities?.exportMap?.supportsDynamicLayers?void 0:n.subLayerIds,t.attributionVisible&&(r.credits=I(e)),e.gdbVersion&&(r.gdbVersion=e.gdbVersion),pe(r,e),e.legendEnabled&&a.legendLayers.push(n)),r}async function ee({layerView:e,printTemplate:t},i){const a=[],r=e.layer;if(null!=r.featureCollections)for(const n of r.featureCollections){const e=await K(n,n.source,t,i);e&&a.push(...e.featureCollection.layers)}else if(null!=r.sublayers)for(const n of r.sublayers){const e=await K(null,n.graphics,t,i);e&&a.push(...e.featureCollection.layers)}return{featureCollection:{layers:a}}}function te(){return{type:"OpenStreetMap"}}async function ie(e,{printTemplate:t,view:i},r){const n={type:"image"},o={format:"png",ignoreBackground:!0,ignorePadding:!0,layers:[e]};0!==i.rotation&&(o.rotation=0);const l=r.ssExtent||i.state.extent.clone();let c=96,u=!0,y=!0;if(t.exportOptions){const e=t.exportOptions;null!=e.dpi&&e.dpi>0&&(c=e.dpi),null!=e.width&&e.width>0&&(u=e.width%2==i.width%2),null!=e.height&&e.height>0&&(y=e.height%2==i.height%2)}if("map-only"===t.layout&&t.scalePreserved&&(!t.outScale||t.outScale===i.scale)&&96===c&&(!u||!y)&&i.state.extent.equals(i.extent)&&(o.area={x:0,y:0,width:i.width,height:i.height},u||(o.area.width-=1),y||(o.area.height-=1),!r.ssExtent)){const e=i.toMap(a(o.area.width,o.area.height));l.ymin=e.y,l.xmax=e.x,r.ssExtent=l}n.extent=l.clone()._normalize(!0).toJSON();const p=await i.takeScreenshot(o);return n.imageData=s(p.dataUrl)?.data,n}async function ae(e,{layerView:t,printTemplate:i},a){e.legendEnabled&&a.legendLayers.push({id:e.id});return K(e,await me(t),i,a)}async function re(e,t){if(e.legendEnabled)for(const r of e.sublayers)r.legendEnabled&&t.legendLayers.push({id:r.id});const i={customParameters:(a=ge(e)).customParameters,effect:a.effect,layerDefinition:a.layerDefinition,layerType:a.layerType,layers:a.layers,url:a.url};var a;if(Array.isArray(i.layers))for(const r of i.layers)delete r.popupInfo;return pe(i,e),i}async function ne(e){const t=[],i=[];for(const r of e.map.allTables)"feature"!==r.type||r.loaded||i.push(r.load());i.length&&await Promise.allSettled(i);for(const r of e.map.allTables)if("feature"===r.type&&r.loaded&&r.isTable&&"feature-layer"===r.source?.type){const e={id:(a=ge(r)).id,title:a.title,customParameters:a.customParameters,layerDefinition:{definitionExpression:a.layerDefinition?.definitionExpression},url:a.url};pe(e,r),t.push(e)}var a;return t.length?t:void 0}function oe(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(a=ge(e)).layerType,customParameters:a.customParameters};var a;return pe(i,e),i}async function se(e,t,i){const a=t.layerView;if(e.serviceUrl&&e.styleUrl&&!a.spriteSourceChanged&&!a.styleChanged){const t=f(e.styleUrl,e.apiKey),a=f(e.serviceUrl,e.apiKey);if(!t&&!a||"2.1.0"!==i.cimVersion){const i={type:"VectorTileLayer"};return i.styleUrl=o(e.styleUrl),i.token=t,a!==t&&(i.additionalTokens=[{url:e.serviceUrl,token:a}]),i}}return ie(e,t,i)}function le(e){const t=e.urlTemplate?.replace(/\${/g,"{"),i={type:"WebTiledLayer",urlTemplate:t,credits:e.copyright};return e.subDomains&&e.subDomains.length>0&&(i.subDomains=e.subDomains),i}async function ce(e,t,i){return parseFloat(i.cimVersion)<3.5?ie(e,t,i):(e.legendEnabled&&i.legendLayers.push({id:e.id}),{layerType:(a=ge(e,"web-map")).layerType,layerDefinition:a.layerDefinition,url:a.url,wfsInfo:a.wfsInfo});var a}function ue(e,t){let i;const a=[],r=e=>{e.visible&&(e.sublayers?e.sublayers.forEach(r):e.name&&a.unshift(e.name))};return e.sublayers&&e.sublayers.forEach(r),a.length&&(e.legendEnabled&&t.legendLayers.push({id:e.id,subLayerIds:a}),i={type:"wms",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,transparentBackground:e.imageTransparency,visibleLayers:a,url:o(e.url),version:e.version}),i}function ye(e){const t=e.activeLayer;return{type:"wmts",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,format:t.imageFormat,layer:t.id,style:t.styleId,tileMatrixSet:t.tileMatrixSetId,url:o(e.url)}}function pe(e,t){t.url&&(e.url=o(e.url||t.url),e.token=f(e.url,t.apiKey))}async function fe(e,i){i.canvas||(i.canvas=document.createElement("canvas"));const a=1024;i.canvas.width=a,i.canvas.height=a;const o=i.canvas.getContext("2d");let s,l;if(e.path){const t=new Path2D(e.path);t.closePath(),o.fillStyle=Array.isArray(e.color)?`rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3]/255})`:"rgb(0,0,0)",o.fill(t);const i=v(o);if(!i)return null;o.clearRect(0,0,a,a);const n=r(e.size)/Math.max(i.width,i.height);o.scale(n,n);const c=a/n,u=c/2-i.width/2-i.x,y=c/2-i.height/2-i.y;if(o.translate(u,y),Array.isArray(e.color)&&o.fill(t),e.outline?.width&&Array.isArray(e.outline.color)){const a=e.outline;o.lineWidth=r(a.width)/n,o.lineJoin="round",o.strokeStyle=`rgba(${a.color[0]},${a.color[1]},${a.color[2]},${a.color[3]/255})`,o.stroke(t),i.width+=o.lineWidth,i.height+=o.lineWidth}i.width*=n,i.height*=n;const p=o.getImageData(a/2-i.width/2,a/2-i.height/2,Math.ceil(i.width),Math.ceil(i.height));s=p.width,l=p.height,o.canvas.width=s,o.canvas.height=l,o.putImageData(p,0,0)}else{const i="image/svg+xml"===e.contentType?"data:image/svg+xml;base64,"+e.imageData:e.url,a=(await t(i,{responseType:"image"})).data;s=r(e.width),l=r(e.height),o.canvas.width=s,o.canvas.height=l,o.drawImage(a,0,0,o.canvas.width,o.canvas.height)}return{type:"esriPMS",imageData:o.canvas.toDataURL("image/png").slice(22),angle:e.angle,contentType:"image/png",height:n(l),width:n(s),xoffset:e.xoffset,yoffset:e.yoffset}}async function de(e,t){const i=e.type;if("simple"===i&&be(e.symbol))e.symbol=await fe(e.symbol,t);else if("uniqueValue"===i||"classBreaks"===i){be(e.defaultSymbol)&&(e.defaultSymbol=await fe(e.defaultSymbol,t));const a=e["uniqueValue"===i?"uniqueValueInfos":"classBreakInfos"];if(a)for(const e of a)be(e.symbol)&&(e.symbol=await fe(e.symbol,t))}}async function me(e){return e.queryFeatures(e.createQuery()).then((e=>e.features))}function ge(e,t){return e.write({},{ignorePersistenceEnabled:!0,origin:t})??{}}function he(e){return e.gpMetadata?.executionType?N.fromJSON(e.gpMetadata.executionType):"sync"}function be(e){return e&&(e.path||"image/svg+xml"===e.contentType||e.url?.endsWith(".svg"))}export{U as execute,A as getGpPrintParams,_ as getGpServerUrl,j as getMode,k as getTasks,R as printCacheMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- const a="20250207",d="cde1f1e7b0f6faa0bfad1141e544d8d9c9a62206";export{a as buildDate,d as commitHash};
5
+ const e="20250209",a="767787968faf905ed8e0971344f4dc5e51a3ea31";export{e as buildDate,a 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.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../chunks/tslib.es6.js";import e from"../core/Logger.js";import{throwIfAborted as o}from"../core/promiseUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{enumeration as s}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import i from"../portal/Portal.js";import{r as p,w as a}from"../chunks/persistableUrlUtils.js";import n from"./Symbol.js";import{Thumbnail as m}from"./support/Thumbnail.js";var c;let y=c=class extends n{constructor(t){super(t),this.color=null,this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type="web-style"}get _fetchCacheKey(){const t=null!=this.portal?this.portal:i.getDefault(),e=t.user?t.user.username:null;return`${this.styleName}:${this.styleUrl}:${this.name}:${e}:${t.url}`}read(t,e){this.portal=e?.portal,super.read(t,e)}clone(){return new c({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(t){return this._fetchSymbol("webRef",t)}fetchCIMSymbol(t){return this._fetchSymbol("cimRef",t)}async _fetchSymbol(t,r){const s=null!=r?r.cache:null,l=s?this._fetchCacheKey:null;if(null!=s){const t=l&&s.get(l);if(t)return t.clone()}const{resolveWebStyleSymbol:i}=await import("./support/webStyleSymbolUtils.js");o(r);const p=i(this,{portal:this.portal},t,r);p.catch((t=>{e.getLogger(this).error("#fetchSymbol()","Failed to create symbol from style",t)}));const a=await p;return"webRef"===t&&"point-3d"===a.type||"cimRef"===t&&"cim"===a.type?(null!=s&&s.set(l,a.clone()),a):null}};t([r({json:{write:!1}})],y.prototype,"color",void 0),t([r({type:String,json:{write:!0}})],y.prototype,"styleName",void 0),t([r({type:i,json:{write:!1}})],y.prototype,"portal",void 0),t([r({type:String,json:{read:p,write:a}})],y.prototype,"styleUrl",void 0),t([r({type:m,json:{read:!1}})],y.prototype,"thumbnail",void 0),t([r({type:String,json:{write:!0}})],y.prototype,"name",void 0),t([s({styleSymbolReference:"web-style"},{readOnly:!0})],y.prototype,"type",void 0),t([r()],y.prototype,"_fetchCacheKey",null),y=c=t([l("esri.symbols.WebStyleSymbol")],y);const h=y;export{h as default};
5
+ import{_ as t}from"../chunks/tslib.es6.js";import e from"../core/Error.js";import o from"../core/Logger.js";import{throwIfAborted 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{enumeration as l}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import a from"../portal/Portal.js";import{r as p,w as c}from"../chunks/persistableUrlUtils.js";import m from"./Symbol.js";import{Thumbnail as n}from"./support/Thumbnail.js";var y;let h=y=class extends m{constructor(t){super(t),this.color=null,this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type="web-style"}get _fetchCacheKey(){const t=null!=this.portal?this.portal:a.getDefault(),e=t.user?t.user.username:null;return`${this.styleName}:${this.styleUrl}:${this.name}:${e}:${t.url}`}read(t,e){this.portal=e?.portal,super.read(t,e)}clone(){return new y({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(t){const e=t&&"acceptedFormats"in t?t.acceptedFormats:["web"];return this._fetchSymbol({...t,acceptedFormats:e})}async fetchCIMSymbol(t){const o=await this.fetchSymbol({...t,acceptedFormats:["cim"]});if("cim"!==o?.type)throw new e("webstylesymbol:fetchCIMSymbol","Resolved web style symbol is not of type 'cim'");return o}async _fetchSymbol(t){const e=null!=t?t.cache:null,s=e?this._fetchCacheKey:null;if(null!=e){const t=s&&e.get(s);if(t)return t.clone()}const{resolveWebStyleSymbol:l}=await import("./support/webStyleSymbolUtils.js");r(t);const i=l(this,{portal:this.portal},t);i.catch((t=>{o.getLogger(this).error("#fetchSymbol()","Failed to create symbol from style",t)}));const a=await i;return null!=e&&e.set(s,a.clone()),a}};t([s({json:{write:!1}})],h.prototype,"color",void 0),t([s({type:String,json:{write:!0}})],h.prototype,"styleName",void 0),t([s({type:a,json:{write:!1}})],h.prototype,"portal",void 0),t([s({type:String,json:{read:p,write:c}})],h.prototype,"styleUrl",void 0),t([s({type:n,json:{read:!1}})],h.prototype,"thumbnail",void 0),t([s({type:String,json:{write:!0}})],h.prototype,"name",void 0),t([l({styleSymbolReference:"web-style"},{readOnly:!0})],h.prototype,"type",void 0),t([s()],h.prototype,"_fetchCacheKey",null),h=y=t([i("esri.symbols.WebStyleSymbol")],h);const u=h;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.32/esri/copyright.txt for details.
4
4
  */
5
- import{getAssetUrl as e}from"../../assets.js";import{toHSV as t,toRGB as l}from"../../core/colorUtils.js";import"../../core/has.js";import a from"../../core/Error.js";import s from"../../core/Logger.js";import{pt2px as n}from"../../core/screenUtils.js";import{defaultThematicColor as r,getPatternUrlWithColor as o,dekebabifyLineStyle as i}from"./gfxUtils.js";import{defaultPrimitive as c}from"./IconSymbol3DLayerResource.js";import{defaultPrimitive as p}from"./ObjectSymbol3DLayerResource.js";import{SymbolSizeDefaults as u,adjustColorComponentBrightness as h,getPathSymbolShapes as m,shapes as f,getExtrudeSymbolShapes as y,getTetrahedronShapes as d,getDiamondShapes as b,getCylinderShapes as k,getCubeShapes as v,getInvertedConeShapes as w,getConeShapes as g,getWaterSymbolShapes as x}from"./previewUtils.js";import{tintImageWithColor as M,renderSymbol as L}from"./renderUtils.js";import{isVolumetricSymbol as j,getIconHref as z}from"./utils.js";import{resolveWebStyleSymbol as S}from"./webStyleSymbolUtils.js";const P=u.size,D=u.maxSize,U=u.maxOutlineSize,O=u.lineWidth,R=u.tallSymbolWidth;function C(e){const t=e.outline,l=null!=e.material?e.material.color:null,a=null!=l?l.toHex():null;if(null==t||"pattern"in t&&null!=t.pattern&&"style"===t.pattern.type&&"none"===t.pattern.style)return"fill"===e.type&&"#ffffff"===a?{color:"#bdc3c7",width:.75}:null;const s=n(t.size)||0;return{color:"rgba("+(null!=t.color?t.color.toRgba():"255,255,255,1")+")",width:Math.min(s,U),style:"pattern"in t&&null!=t.pattern&&"style"===t.pattern.type?i(t.pattern.style):null,join:"butt",cap:"patternCap"in t?t.patternCap:"butt"}}async function E(t,l){if(t.thumbnail?.url)return t.thumbnail.url;if("icon"===l.type){const e=l?.resource?.href;if(e)return z(l)}const a=e("esri/images/Legend/legend3dsymboldefault.png");if(t.styleOrigin&&(t.styleOrigin.styleName||t.styleOrigin.styleUrl)){const e=await S(t.styleOrigin,{portal:t.styleOrigin.portal},"webRef").catch((()=>null));if(e&&"thumbnail"in e&&e.thumbnail?.url)return e.thumbnail.url}return a}function q(e,a=1){const s=e.a,n=t(e),r=n.h,o=n.s/a,i=100-(100-n.v)/a,{r:c,g:p,b:u}=l({h:r,s:o,v:i});return[c,p,u,s]}function I(e){return"water"===e.type?null==e.color?null:e.color:null==e.material?.color?null:e.material.color}function Z(e,t=0){const l=I(e);if(!l){if("fill"===e.type)return null;const l=r.r,a=h(l,t);return[a,a,a,100]}const a=l.toRgba();for(let s=0;s<3;s++)a[s]=h(a[s],t);return a}async function H(t,l){const a=t.style;if("none"===a)return null;return{type:"pattern",x:0,y:0,src:await o(e(`esri/symbols/patterns/${a}.png`),l.toCss(!0)),width:5,height:5}}function N(e){return e.outline?C(e):{color:"rgba(0, 0, 0, 1)",width:1.5}}function T(e,t){const l=I(e);if(!l)return null;let a="rgba(";return a+=h(l.r,t)+",",a+=h(l.g,t)+",",a+=h(l.b,t)+",",a+l.a+");"}function W(e,t){const l=T(e,t);if(!l)return{};if("pattern"in e&&null!=e.pattern&&"style"===e.pattern.type&&"none"===e.pattern.style)return null;return{color:l,width:Math.min(e.size?n(e.size):.75,U),style:"pattern"in e&&null!=e.pattern&&"style"===e.pattern.type?i(e.pattern.style):null,cap:"cap"in e?e.cap:null,join:"join"in e?"miter"===e.join?n(2):e.join:null}}function F(e,t,l){const a=null!=l?.75*l:0;return{type:"linear",x1:a?.25*a:0,y1:a?.5*a:0,x2:a||4,y2:a?.5*a:4,colors:[{color:e,offset:0},{color:t,offset:1}]}}function $(e){const t=e.depth,l=e.height,a=e.width;return 0!==a&&0!==t&&0!==l&&a===t&&null!=a&&null!=l&&a<l}function A(e,t,l){const a=[];if(!e)return a;switch(e.type){case"icon":{const l=0,s=0,n=t,r=t;switch(e.resource?.primitive??c){case"circle":a.push({shape:{type:"circle",cx:0,cy:0,r:.5*t},fill:Z(e,0),stroke:C(e)});break;case"square":a.push({shape:{type:"path",path:[{command:"M",values:[l,r]},{command:"L",values:[l,s]},{command:"L",values:[n,s]},{command:"L",values:[n,r]},{command:"Z",values:[]}]},fill:Z(e,0),stroke:C(e)});break;case"triangle":a.push({shape:{type:"path",path:[{command:"M",values:[l,r]},{command:"L",values:[.5*n,s]},{command:"L",values:[n,r]},{command:"Z",values:[]}]},fill:Z(e,0),stroke:C(e)});break;case"cross":a.push({shape:{type:"path",path:[{command:"M",values:[.5*n,s]},{command:"L",values:[.5*n,r]},{command:"M",values:[l,.5*r]},{command:"L",values:[n,.5*r]}]},stroke:N(e)});break;case"x":a.push({shape:{type:"path",path:[{command:"M",values:[l,s]},{command:"L",values:[n,r]},{command:"M",values:[n,s]},{command:"L",values:[l,r]}]},stroke:N(e)});break;case"kite":a.push({shape:{type:"path",path:[{command:"M",values:[l,.5*r]},{command:"L",values:[.5*n,s]},{command:"L",values:[n,.5*r]},{command:"L",values:[.5*n,r]},{command:"Z",values:[]}]},fill:Z(e,0),stroke:C(e)})}break}case"object":switch(e.resource?.primitive??p){case"cone":{const s=F(Z(e,0),Z(e,-.6),l?R:t),n=g(t,l);a.push({shape:n[0],fill:s},{shape:n[1],fill:s});break}case"inverted-cone":{const l=Z(e,0),s=F(l,Z(e,-.6),t),n=w(t);a.push({shape:n[0],fill:s},{shape:n[1],fill:l});break}case"cube":{const s=v(t,l);a.push({shape:s[0],fill:Z(e,0)},{shape:s[1],fill:Z(e,-.3)},{shape:s[2],fill:Z(e,-.5)});break}case"cylinder":{const s=F(Z(e,0),Z(e,-.6),l?R:t),n=k(t,l);a.push({shape:n[0],fill:s},{shape:n[1],fill:s},{shape:n[2],fill:Z(e,0)});break}case"diamond":{const l=b(t);a.push({shape:l[0],fill:Z(e,-.3)},{shape:l[1],fill:Z(e,0)},{shape:l[2],fill:Z(e,-.3)},{shape:l[3],fill:Z(e,-.7)});break}case"sphere":{const l=F(Z(e,0),Z(e,-.6));l.x1=0,l.y1=0,l.x2=.25*t,l.y2=.25*t,a.push({shape:{type:"circle",cx:0,cy:0,r:.5*t},fill:l});break}case"tetrahedron":{const l=d(t);a.push({shape:l[0],fill:Z(e,-.3)},{shape:l[1],fill:Z(e,0)},{shape:l[2],fill:Z(e,-.6)});break}}break}return a}function B(e){const t="number"==typeof e?.size?e?.size:null;return t?n(t):null}function G(e){return"icon"===e.type?"multiply":"tint"}async function J(e,t){const l=B(t),a=t?.maxSize?n(t.maxSize):null,r=t?.disableUpsampling??!1,o=e.symbolLayers,i=[],c=[];let p=!1,u=0,h=0,m=0;o.forEach((s=>{if("icon"!==s.type&&"object"!==s.type)return;s&&"icon"===s.type&&(m=Math.max(s.size&&n(s.size),m));const o="icon"===s.type?s.size&&n(s.size):0,f=l||o?Math.ceil(Math.min(l||o,a||D)):P;let y="icon"===s.type?s.angle:null;if(null!=t?.rotation&&(y=(y??0)+t.rotation),c.push(y),s?.resource?.href){const t=E(e,s).then((e=>{const t=s?.material?.color,l=G(s);return M(e,f,t,l,r)})).then((e=>{const t=e.width,l=e.height;return u=Math.max(u,t),h=Math.max(h,l),y&&(p=!0),[{shape:{type:"image",x:0,y:0,width:t,height:l,src:e.url},fill:null,stroke:null}]}));i.push(t)}else{let e=f;"icon"===s.type&&l&&(e=f*(o/m));const a="tall"===t?.symbolConfig||t?.symbolConfig?.isTall||"object"===s.type&&$(s);u=Math.max(u,a?R:e),h=Math.max(h,e),y&&s.resource?.primitive&&["square","triangle","x"].includes(s.resource?.primitive)&&(p=!0),i.push(Promise.resolve(A(s,e,a)))}}));const f=await Promise.allSettled(i),y=[];return f.forEach((e=>{"fulfilled"===e.status?y.push(e.value):e.reason&&s.getLogger("esri.symbols.support.previewSymbol3D").warn("error while building swatchInfo!",e.reason)})),L(y,[u,h],{node:t?.node,scale:!1,opacity:t?.opacity,ariaLabel:t?.ariaLabel,rotations:c,useRotationSize:p})}function K(e,t){const l=e.symbolLayers,a=[],s=j(e),r=B(t),o=(t?.maxSize?n(t.maxSize):null)||U;let i,c=0,p=0;return l.forEach(((e,t)=>{if(!e)return;if("line"!==e.type&&"path"!==e.type)return;const l=[];switch(e.type){case"line":{const a=W(e,0);if(null==a)break;const s=a?.width||0;0===t&&(i=s);const n=Math.min(r||s,o),u=0===t?n:r?n*(s/i):n,h=u>O/2?2*u:O;p=Math.max(p,u),c=Math.max(c,h),a.width=u,l.push({shape:{type:"path",path:[{command:"M",values:[0,.5*p]},{command:"L",values:[c,.5*p]}]},stroke:a});break}case"path":{const t=Math.min(r||P,o),a=Z(e,0),s=Z(e,-.2),n=T(e,-.4),i=n?{color:n,width:1}:{};if("quad"===e.profile){const t=e.width,n=e.height,r=m(t&&n?t/n:1,0===n,0===t),o={...i,join:"bevel"};l.push({shape:r[0],fill:s,stroke:o},{shape:r[1],fill:s,stroke:o},{shape:r[2],fill:a,stroke:o})}else l.push({shape:f.pathSymbol3DLayer[0],fill:s,stroke:i},{shape:f.pathSymbol3DLayer[1],fill:a,stroke:i});p=Math.max(p,t),c=p}}a.push(l)})),Promise.resolve(L(a,[c,p],{node:t?.node,scale:s,opacity:t?.opacity,ariaLabel:t?.ariaLabel}))}async function Q(e,t){const l="mesh-3d"===e.type,a=e.symbolLayers,s=B(t),r=t?.maxSize?n(t.maxSize):null,o=s||P,i=[];let c=0,p=0,u=!1;for(let n=0;n<a.length;n++){const e=a.at(n),t=[];if(!l||"fill"===e.type){switch(e.type){case"fill":{const a=Math.min(o,r||D);if(c=Math.max(c,a),p=Math.max(p,a),u=!0,l){const l=f.meshSymbol3DFill,a=T(e,-.4),s=a?{color:a,width:1,join:"round"}:{};t.push({shape:l[0],fill:Z(e,0),stroke:s},{shape:l[1],fill:Z(e,-.2),stroke:s},{shape:l[2],fill:Z(e,-.6),stroke:s})}else{let l=Z(e,0);const a="pattern"in e?e.pattern:null,s=C(e),n=I(e);null!=a&&"style"===a.type&&"solid"!==a.style&&n&&(l=await H(a,n)),t.push({shape:f.fill[0],fill:l,stroke:s})}break}case"line":{const l=W(e,0);if(null==l)break;const a={stroke:l,shape:f.fill[0]};c=Math.max(c,P),p=Math.max(p,P),t.push(a);break}case"extrude":{const l={join:"round",width:1,...W(e,-.4)},a=Z(e,0),s=Z(e,-.2),n=Math.min(o,r||D),i=y(n);l.width=1,t.push({shape:i[0],fill:s,stroke:l},{shape:i[1],fill:s,stroke:l},{shape:i[2],fill:a,stroke:l});const u=P,h=.7*P+.5*n;c=Math.max(c,u),p=Math.max(p,h);break}case"water":{const l=I(e),a=q(l),s=q(l,2),n=q(l,3),i=x();u=!0,t.push({shape:i[0],fill:a},{shape:i[1],fill:s},{shape:i[2],fill:n});const h=Math.min(o,r||D);c=Math.max(c,h),p=Math.max(p,h);break}}i.push(t)}}return L(i,[c,p],{node:t?.node,scale:u,opacity:t?.opacity,ariaLabel:t?.ariaLabel})}function V(e,t){if(0===e.symbolLayers.length)return Promise.reject(new a("symbolPreview: renderPreviewHTML3D","No symbolLayers in the symbol."));switch(e.type){case"point-3d":return J(e,t);case"line-3d":return K(e,t);case"polygon-3d":case"mesh-3d":return Q(e,t)}return Promise.reject(new a("symbolPreview: swatchInfo3D","symbol not supported."))}export{H as getPatternDescriptor,B as getSizeFromOptions,Z as getSymbolLayerFill,V as previewSymbol3D};
5
+ import{getAssetUrl as e}from"../../assets.js";import{toHSV as t,toRGB as l}from"../../core/colorUtils.js";import"../../core/has.js";import a from"../../core/Error.js";import s from"../../core/Logger.js";import{pt2px as n}from"../../core/screenUtils.js";import{defaultThematicColor as r,getPatternUrlWithColor as o,dekebabifyLineStyle as i}from"./gfxUtils.js";import{defaultPrimitive as c}from"./IconSymbol3DLayerResource.js";import{defaultPrimitive as p}from"./ObjectSymbol3DLayerResource.js";import{SymbolSizeDefaults as u,adjustColorComponentBrightness as h,getPathSymbolShapes as m,shapes as f,getExtrudeSymbolShapes as y,getTetrahedronShapes as d,getDiamondShapes as b,getCylinderShapes as k,getCubeShapes as v,getInvertedConeShapes as g,getConeShapes as w,getWaterSymbolShapes as x}from"./previewUtils.js";import{tintImageWithColor as M,renderSymbol as L}from"./renderUtils.js";import{isVolumetricSymbol as j,getIconHref as z}from"./utils.js";import{resolveWebStyleSymbol as S}from"./webStyleSymbolUtils.js";const P=u.size,D=u.maxSize,U=u.maxOutlineSize,O=u.lineWidth,C=u.tallSymbolWidth;function R(e){const t=e.outline,l=null!=e.material?e.material.color:null,a=null!=l?l.toHex():null;if(null==t||"pattern"in t&&null!=t.pattern&&"style"===t.pattern.type&&"none"===t.pattern.style)return"fill"===e.type&&"#ffffff"===a?{color:"#bdc3c7",width:.75}:null;const s=n(t.size)||0;return{color:"rgba("+(null!=t.color?t.color.toRgba():"255,255,255,1")+")",width:Math.min(s,U),style:"pattern"in t&&null!=t.pattern&&"style"===t.pattern.type?i(t.pattern.style):null,join:"butt",cap:"patternCap"in t?t.patternCap:"butt"}}async function E(t,l){if(t.thumbnail?.url)return t.thumbnail.url;if("icon"===l.type){const e=l?.resource?.href;if(e)return z(l)}const a=e("esri/images/Legend/legend3dsymboldefault.png");if(t.styleOrigin&&(t.styleOrigin.styleName||t.styleOrigin.styleUrl)){const e=await S(t.styleOrigin,{portal:t.styleOrigin.portal}).catch((()=>null));if(e&&"thumbnail"in e&&e.thumbnail?.url)return e.thumbnail.url}return a}function q(e,a=1){const s=e.a,n=t(e),r=n.h,o=n.s/a,i=100-(100-n.v)/a,{r:c,g:p,b:u}=l({h:r,s:o,v:i});return[c,p,u,s]}function I(e){return"water"===e.type?null==e.color?null:e.color:null==e.material?.color?null:e.material.color}function Z(e,t=0){const l=I(e);if(!l){if("fill"===e.type)return null;const l=r.r,a=h(l,t);return[a,a,a,100]}const a=l.toRgba();for(let s=0;s<3;s++)a[s]=h(a[s],t);return a}async function H(t,l){const a=t.style;if("none"===a)return null;return{type:"pattern",x:0,y:0,src:await o(e(`esri/symbols/patterns/${a}.png`),l.toCss(!0)),width:5,height:5}}function N(e){return e.outline?R(e):{color:"rgba(0, 0, 0, 1)",width:1.5}}function T(e,t){const l=I(e);if(!l)return null;let a="rgba(";return a+=h(l.r,t)+",",a+=h(l.g,t)+",",a+=h(l.b,t)+",",a+l.a+");"}function W(e,t){const l=T(e,t);if(!l)return{};if("pattern"in e&&null!=e.pattern&&"style"===e.pattern.type&&"none"===e.pattern.style)return null;return{color:l,width:Math.min(e.size?n(e.size):.75,U),style:"pattern"in e&&null!=e.pattern&&"style"===e.pattern.type?i(e.pattern.style):null,cap:"cap"in e?e.cap:null,join:"join"in e?"miter"===e.join?n(2):e.join:null}}function F(e,t,l){const a=null!=l?.75*l:0;return{type:"linear",x1:a?.25*a:0,y1:a?.5*a:0,x2:a||4,y2:a?.5*a:4,colors:[{color:e,offset:0},{color:t,offset:1}]}}function $(e){const t=e.depth,l=e.height,a=e.width;return 0!==a&&0!==t&&0!==l&&a===t&&null!=a&&null!=l&&a<l}function A(e,t,l){const a=[];if(!e)return a;switch(e.type){case"icon":{const l=0,s=0,n=t,r=t;switch(e.resource?.primitive??c){case"circle":a.push({shape:{type:"circle",cx:0,cy:0,r:.5*t},fill:Z(e,0),stroke:R(e)});break;case"square":a.push({shape:{type:"path",path:[{command:"M",values:[l,r]},{command:"L",values:[l,s]},{command:"L",values:[n,s]},{command:"L",values:[n,r]},{command:"Z",values:[]}]},fill:Z(e,0),stroke:R(e)});break;case"triangle":a.push({shape:{type:"path",path:[{command:"M",values:[l,r]},{command:"L",values:[.5*n,s]},{command:"L",values:[n,r]},{command:"Z",values:[]}]},fill:Z(e,0),stroke:R(e)});break;case"cross":a.push({shape:{type:"path",path:[{command:"M",values:[.5*n,s]},{command:"L",values:[.5*n,r]},{command:"M",values:[l,.5*r]},{command:"L",values:[n,.5*r]}]},stroke:N(e)});break;case"x":a.push({shape:{type:"path",path:[{command:"M",values:[l,s]},{command:"L",values:[n,r]},{command:"M",values:[n,s]},{command:"L",values:[l,r]}]},stroke:N(e)});break;case"kite":a.push({shape:{type:"path",path:[{command:"M",values:[l,.5*r]},{command:"L",values:[.5*n,s]},{command:"L",values:[n,.5*r]},{command:"L",values:[.5*n,r]},{command:"Z",values:[]}]},fill:Z(e,0),stroke:R(e)})}break}case"object":switch(e.resource?.primitive??p){case"cone":{const s=F(Z(e,0),Z(e,-.6),l?C:t),n=w(t,l);a.push({shape:n[0],fill:s},{shape:n[1],fill:s});break}case"inverted-cone":{const l=Z(e,0),s=F(l,Z(e,-.6),t),n=g(t);a.push({shape:n[0],fill:s},{shape:n[1],fill:l});break}case"cube":{const s=v(t,l);a.push({shape:s[0],fill:Z(e,0)},{shape:s[1],fill:Z(e,-.3)},{shape:s[2],fill:Z(e,-.5)});break}case"cylinder":{const s=F(Z(e,0),Z(e,-.6),l?C:t),n=k(t,l);a.push({shape:n[0],fill:s},{shape:n[1],fill:s},{shape:n[2],fill:Z(e,0)});break}case"diamond":{const l=b(t);a.push({shape:l[0],fill:Z(e,-.3)},{shape:l[1],fill:Z(e,0)},{shape:l[2],fill:Z(e,-.3)},{shape:l[3],fill:Z(e,-.7)});break}case"sphere":{const l=F(Z(e,0),Z(e,-.6));l.x1=0,l.y1=0,l.x2=.25*t,l.y2=.25*t,a.push({shape:{type:"circle",cx:0,cy:0,r:.5*t},fill:l});break}case"tetrahedron":{const l=d(t);a.push({shape:l[0],fill:Z(e,-.3)},{shape:l[1],fill:Z(e,0)},{shape:l[2],fill:Z(e,-.6)});break}}break}return a}function B(e){const t="number"==typeof e?.size?e?.size:null;return t?n(t):null}function G(e){return"icon"===e.type?"multiply":"tint"}async function J(e,t){const l=B(t),a=t?.maxSize?n(t.maxSize):null,r=t?.disableUpsampling??!1,o=e.symbolLayers,i=[],c=[];let p=!1,u=0,h=0,m=0;o.forEach((s=>{if("icon"!==s.type&&"object"!==s.type)return;s&&"icon"===s.type&&(m=Math.max(s.size&&n(s.size),m));const o="icon"===s.type?s.size&&n(s.size):0,f=l||o?Math.ceil(Math.min(l||o,a||D)):P;let y="icon"===s.type?s.angle:null;if(null!=t?.rotation&&(y=(y??0)+t.rotation),c.push(y),s?.resource?.href){const t=E(e,s).then((e=>{const t=s?.material?.color,l=G(s);return M(e,f,t,l,r)})).then((e=>{const t=e.width,l=e.height;return u=Math.max(u,t),h=Math.max(h,l),y&&(p=!0),[{shape:{type:"image",x:0,y:0,width:t,height:l,src:e.url},fill:null,stroke:null}]}));i.push(t)}else{let e=f;"icon"===s.type&&l&&(e=f*(o/m));const a="tall"===t?.symbolConfig||t?.symbolConfig?.isTall||"object"===s.type&&$(s);u=Math.max(u,a?C:e),h=Math.max(h,e),y&&s.resource?.primitive&&["square","triangle","x"].includes(s.resource?.primitive)&&(p=!0),i.push(Promise.resolve(A(s,e,a)))}}));const f=await Promise.allSettled(i),y=[];return f.forEach((e=>{"fulfilled"===e.status?y.push(e.value):e.reason&&s.getLogger("esri.symbols.support.previewSymbol3D").warn("error while building swatchInfo!",e.reason)})),L(y,[u,h],{node:t?.node,scale:!1,opacity:t?.opacity,ariaLabel:t?.ariaLabel,rotations:c,useRotationSize:p})}function K(e,t){const l=e.symbolLayers,a=[],s=j(e),r=B(t),o=(t?.maxSize?n(t.maxSize):null)||U;let i,c=0,p=0;return l.forEach(((e,t)=>{if(!e)return;if("line"!==e.type&&"path"!==e.type)return;const l=[];switch(e.type){case"line":{const a=W(e,0);if(null==a)break;const s=a?.width||0;0===t&&(i=s);const n=Math.min(r||s,o),u=0===t?n:r?n*(s/i):n,h=u>O/2?2*u:O;p=Math.max(p,u),c=Math.max(c,h),a.width=u,l.push({shape:{type:"path",path:[{command:"M",values:[0,.5*p]},{command:"L",values:[c,.5*p]}]},stroke:a});break}case"path":{const t=Math.min(r||P,o),a=Z(e,0),s=Z(e,-.2),n=T(e,-.4),i=n?{color:n,width:1}:{};if("quad"===e.profile){const t=e.width,n=e.height,r=m(t&&n?t/n:1,0===n,0===t),o={...i,join:"bevel"};l.push({shape:r[0],fill:s,stroke:o},{shape:r[1],fill:s,stroke:o},{shape:r[2],fill:a,stroke:o})}else l.push({shape:f.pathSymbol3DLayer[0],fill:s,stroke:i},{shape:f.pathSymbol3DLayer[1],fill:a,stroke:i});p=Math.max(p,t),c=p}}a.push(l)})),Promise.resolve(L(a,[c,p],{node:t?.node,scale:s,opacity:t?.opacity,ariaLabel:t?.ariaLabel}))}async function Q(e,t){const l="mesh-3d"===e.type,a=e.symbolLayers,s=B(t),r=t?.maxSize?n(t.maxSize):null,o=s||P,i=[];let c=0,p=0,u=!1;for(let n=0;n<a.length;n++){const e=a.at(n),t=[];if(!l||"fill"===e.type){switch(e.type){case"fill":{const a=Math.min(o,r||D);if(c=Math.max(c,a),p=Math.max(p,a),u=!0,l){const l=f.meshSymbol3DFill,a=T(e,-.4),s=a?{color:a,width:1,join:"round"}:{};t.push({shape:l[0],fill:Z(e,0),stroke:s},{shape:l[1],fill:Z(e,-.2),stroke:s},{shape:l[2],fill:Z(e,-.6),stroke:s})}else{let l=Z(e,0);const a="pattern"in e?e.pattern:null,s=R(e),n=I(e);null!=a&&"style"===a.type&&"solid"!==a.style&&n&&(l=await H(a,n)),t.push({shape:f.fill[0],fill:l,stroke:s})}break}case"line":{const l=W(e,0);if(null==l)break;const a={stroke:l,shape:f.fill[0]};c=Math.max(c,P),p=Math.max(p,P),t.push(a);break}case"extrude":{const l={join:"round",width:1,...W(e,-.4)},a=Z(e,0),s=Z(e,-.2),n=Math.min(o,r||D),i=y(n);l.width=1,t.push({shape:i[0],fill:s,stroke:l},{shape:i[1],fill:s,stroke:l},{shape:i[2],fill:a,stroke:l});const u=P,h=.7*P+.5*n;c=Math.max(c,u),p=Math.max(p,h);break}case"water":{const l=I(e),a=q(l),s=q(l,2),n=q(l,3),i=x();u=!0,t.push({shape:i[0],fill:a},{shape:i[1],fill:s},{shape:i[2],fill:n});const h=Math.min(o,r||D);c=Math.max(c,h),p=Math.max(p,h);break}}i.push(t)}}return L(i,[c,p],{node:t?.node,scale:u,opacity:t?.opacity,ariaLabel:t?.ariaLabel})}function V(e,t){if(0===e.symbolLayers.length)return Promise.reject(new a("symbolPreview: renderPreviewHTML3D","No symbolLayers in the symbol."));switch(e.type){case"point-3d":return J(e,t);case"line-3d":return K(e,t);case"polygon-3d":case"mesh-3d":return Q(e,t)}return Promise.reject(new a("symbolPreview: swatchInfo3D","symbol not supported."))}export{H as getPatternDescriptor,B as getSizeFromOptions,Z as getSymbolLayerFill,V as previewSymbol3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../request.js";import{pt2px as e}from"../../core/screenUtils.js";import{SymbolSizeDefaults as i}from"./previewUtils.js";import{fetchWebStyleSymbol as n}from"./utils.js";function r(e,i,r){const h=e.thumbnail?.url;return h?t(h,{responseType:"image"}).then((t=>{const e=s(t.data,r);return r?.node?(r.node.appendChild(e),r.node):e})):n(e).then((t=>t?i(t,r):null))}function s(t,n){const r=!/\\.svg$/i.test(t.src)&&n?.disableUpsampling,s=Math.max(t.width,t.height);let h=null!=n?.maxSize?e(n.maxSize):i.maxSize;r&&(h=Math.min(s,h));const o="number"==typeof n?.size?n?.size:null,m=Math.min(h,null!=o?e(o):s);if(m!==s){const e=0!==t.width&&0!==t.height?t.width/t.height:1;e>=1?(t.width=m,t.height=m/e):(t.width=m*e,t.height=m)}return t}export{r as previewWebStyleSymbol};
5
+ import t from"../../request.js";import{pt2px as e}from"../../core/screenUtils.js";import{SymbolSizeDefaults as i}from"./previewUtils.js";import{defaultAcceptedFormats as n}from"./webStyleAcceptedFormats.js";async function o(e,i,o){const r=e.thumbnail?.url;if(r){const e=s((await t(r,{responseType:"image"})).data,o);return o?.node?(o.node.appendChild(e),o.node):e}const a=await e.fetchSymbol({acceptedFormats:n});return a?i(a,o):null}function s(t,n){const o=!/\\.svg$/i.test(t.src)&&n?.disableUpsampling,s=Math.max(t.width,t.height);let r=null!=n?.maxSize?e(n.maxSize):i.maxSize;o&&(r=Math.min(s,r));const a="number"==typeof n?.size?n?.size:null,h=Math.min(r,null!=a?e(a):s);if(h!==s){const e=0!==t.width&&0!==t.height?t.width/t.height:1;e>=1?(t.width=h,t.height=h/e):(t.width=h*e,t.height=h)}return t}export{o as previewWebStyleSymbol};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../request.js";import t from"../../core/Error.js";import has from"../../core/has.js";import{throwIfAbortError as r}from"../../core/promiseUtils.js";import{normalize as o,removeFile as s}from"../../core/urlUtils.js";import n from"../../portal/Portal.js";import l from"../../portal/PortalQueryParams.js";import{cachedStyles as a}from"./styleCache.js";async function f(e,t){try{return{data:(await p(e,t)).data,baseUrl:s(e),styleUrl:e}}catch(o){return r(o),null}}function u(e,t,r){const o=null!=t.portal?t.portal:n.getDefault();let s;const l=`${o.url} - ${o.user?.username} - ${e}`,f=a.get(l);if(f)return f;const u=c(e,o,r).then((e=>(s=e,e.fetchData()))).then((t=>({data:t,baseUrl:s.itemUrl??"",styleName:e})));return a.set(l,u),u}function c(e,r,o){return r.load(o).then((()=>{const t=new l({disableExtraQuery:!0,query:`owner:${d} AND type:${b} AND typekeywords:"${e}"`});return r.queryItems(t,o)})).then((({results:r})=>{let s=null;const n=e.toLowerCase();if(r&&Array.isArray(r))for(const e of r){const t=e.typeKeywords?.some((e=>e.toLowerCase()===n));if(t&&e.type===b&&e.owner===d){s=e;break}}if(!s)throw new t("symbolstyleutils:style-not-found",`The style '${e}' could not be found`,{styleName:e});return s.load(o)}))}function i(e,r,o){return null!=e?.styleUrl?f(e.styleUrl,o):null!=e?.styleName?u(e.styleName,r,o):Promise.reject(new t("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function m(e){return null===e||"CIMSymbolReference"===e.type?e:{type:"CIMSymbolReference",symbol:e}}function y(e,t,r=["gltf"]){if("cimRef"===t)return encodeURI(e.cimRef);if(e.formatInfos&&!has("enable-feature:force-wosr"))for(const o of r){const t=e.formatInfos.find((e=>e.type===o));if(t)return t.href}return encodeURI(e.webRef)}function p(t,r){const s={responseType:"json",query:{f:"json"},...r};return e(o(t),s)}const d="esri_en",b="Style",h="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json";export{h as Style2DUrlTemplate,i as fetchStyle,m as makeCIMSymbolRef,p as requestJSON,y as symbolUrlFromStyleItem};
5
+ import e from"../../request.js";import r from"../../core/Error.js";import has from"../../core/has.js";import{throwIfAbortError as t}from"../../core/promiseUtils.js";import{normalize as o,removeFile as s}from"../../core/urlUtils.js";import n from"../../portal/Portal.js";import l from"../../portal/PortalQueryParams.js";import{cachedStyles as a}from"./styleCache.js";async function f(e,r){try{return{data:(await p(e,r)).data,baseUrl:s(e),styleUrl:e}}catch(o){return t(o),null}}function u(e,r,t){const o=null!=r.portal?r.portal:n.getDefault();let s;const l=`${o.url} - ${o.user?.username} - ${e}`,f=a.get(l);if(f)return f;const u=c(e,o,t).then((e=>(s=e,e.fetchData()))).then((r=>({data:r,baseUrl:s.itemUrl??"",styleName:e})));return a.set(l,u),u}function c(e,t,o){return t.load(o).then((()=>{const r=new l({disableExtraQuery:!0,query:`owner:${d} AND type:${w} AND typekeywords:"${e}"`});return t.queryItems(r,o)})).then((({results:t})=>{let s=null;const n=e.toLowerCase();if(t&&Array.isArray(t))for(const e of t){const r=e.typeKeywords?.some((e=>e.toLowerCase()===n));if(r&&e.type===w&&e.owner===d){s=e;break}}if(!s)throw new r("symbolstyleutils:style-not-found",`The style '${e}' could not be found`,{styleName:e});return s.load(o)}))}function i(e,t,o){return null!=e?.styleUrl?f(e.styleUrl,o):null!=e?.styleName?u(e.styleName,t,o):Promise.reject(new r("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function m(e){return null===e||"CIMSymbolReference"===e.type?e:{type:"CIMSymbolReference",symbol:e}}function y(e,r){for(const t of r)switch(t){case"cim":if(e.cimRef)return{format:t,url:encodeURI(e.cimRef)};break;case"web-gltf-basisu":{const r=b(e,"gltf_basisu");if(r)return{format:t,url:r};break}case"web-gltf":{const r=b(e,"gltf");if(r)return{format:t,url:r};break}case"web":{const r=b(e,"gltf");if(r)return{format:"web-gltf",url:r};if(e.webRef)return{format:t,url:encodeURI(e.webRef)};break}}}function b(e,r){if(!has("enable-feature:force-wosr"))return e.formatInfos?.find((e=>e.type===r))?.href}function p(r,t){const s={responseType:"json",query:{f:"json"},...t};return e(o(r),s)}const d="esri_en",w="Style",h="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json";export{h as Style2DUrlTemplate,i as fetchStyle,m as makeCIMSymbolRef,p as requestJSON,y as symbolUrlFromStyleItem};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import{loadArcade as e}from"../../support/arcadeOnDemand.js";import{getStroke as t}from"./gfxUtils.js";import{SymbolSizeDefaults as l}from"./previewUtils.js";import{renderSymbol as a,renderOnce as i}from"./renderUtils.js";import{getCSSFilterFromEffectList as s,fetchWebStyleSymbol as r,applyColorToSymbol as n,applySizesToSymbol as o,applyRotationToSymbol as c,getColorFromSymbol as u,applyOpacityToColor as f}from"./utils.js";import{renderRelationshipRamp as p}from"../../widgets/Legend/styles/support/relationshipUtils.js";import{getRelationshipRampElement as h}from"../../widgets/Legend/support/relationshipRampUtils.js";let y=null;const d=[255,255,255];function m(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function b(e,t,a){const{backgroundColor:i,outline:s,dotSize:r}=e,n=a?.swatchSize||l.size,o=.8,c=Math.round(n*n/Math.max(r,.5)**2*o),u=window.devicePixelRatio,f=document.createElement("canvas"),p=n*u;f.width=p,f.height=p,f.style.width=f.width/u+"px",f.style.height=f.height/u+"px";const h=f.getContext("2d");if(i&&(h.fillStyle=i.toCss(!0),h.fillRect(0,0,p,p),h.fill()),h.fillStyle=t?.toCss(!0)??"",y&&y.length/2===c)for(let l=0;l<2*c;l+=2){const e=y[l],t=y[l+1];h.fillRect(e,t,r*u,r*u),h.fill()}else{y=[];for(let e=0;e<2*c;e+=2){const e=m(0,p),t=m(0,p);y.push(e,t),h.fillRect(e,t,r*u,r*u),h.fill()}}s&&(s.color&&(h.strokeStyle=s.color.toCss(!0)),h.lineWidth=s.width,h.strokeRect(0,0,p,p));const d=new Image(n,n);return d.src=f.toDataURL(),d.ariaLabel=a?.ariaLabel??null,d.alt=a?.ariaLabel??"",d}function g(e,l={}){const i=l.radius||40,s=2*Math.PI*i,r=e.length,n=s/r,o=[],c=t(l.outline);null!=c?.width&&(c.width*=2),(c||l.backgroundColor)&&o.push({shape:{type:"circle",cx:i,cy:i,r:i},fill:l.backgroundColor,stroke:c,offset:[0,0]});const u=l.values,f=u&&u.length===r&&100===u.reduce(((e,t)=>e+t),0),p=[0];for(let t=0;t<r;t++){let l=null;f&&(l=u[t]*s/100,p.push(l+p[t])),o.push({shape:{type:"circle",cx:i,cy:i,r:i/2},fill:[0,0,0,0],stroke:{width:i,dashArray:`${(l??n)/2} ${s}`,dashoffset:"-"+(f?p[t]/2:t*(n/2)),color:e[t]},offset:[0,0]})}let h=null;const y=2*i+(c?.width||0),m=l.holePercentage;if(m){c&&o.push({shape:{type:"circle",cx:i,cy:i,r:i*m},fill:null,stroke:c,offset:[0,0]});const e=y/2;h=[[{shape:{type:"circle",cx:e,cy:e,r:e},fill:d,stroke:c?{...c,color:d}:null,offset:[0,0]},{shape:{type:"circle",cx:e,cy:e,r:i*m},fill:[0,0,0],stroke:null,offset:[0,0]}]]}return a([o],[y,y],{effectView:l.effectList,ignoreStrokeWidth:!0,masking:h,rotations:[-90],ariaLabel:l.ariaLabel})}function w(e,t={}){const l=e?.authoringInfo;if(!("relationship"===l?.type)||!l?.numClasses||!e.uniqueValueInfos)return null;const{focus:a,numClasses:s}=l,r=h({focus:a,numClasses:s,infos:e.uniqueValueInfos}),n=t?.node||document.createElement("div");return i(n,(()=>p(r,t.id||"relationship",{opacity:t.opacity||1,effectList:t.effectList,ariaLabel:t.ariaLabel}))),n}function v(e,t={}){const l=24,a=75,i="horizontal"===t.align,s=i?a:l,r=i?l:a,n=t.width??s,o=t.height??r,c=t.gradient??!0,u=window.devicePixelRatio,f=n*u,p=o*u,h=document.createElement("canvas");h.width=f,h.height=p,h.ariaLabel=t.ariaLabel??null,h.style.width=`${n}px`,h.style.height=`${o}px`;const y=h.getContext("2d"),d=i?f:0,m=i?0:p;if(c){const t=y.createLinearGradient(0,0,d,m),l=e.length,a=1===l?0:1/(l-1);e.forEach(((e,l)=>t.addColorStop(l*a,e.toString()))),y.fillStyle=t,y.fillRect(0,0,f,p)}else{const t=i?f/e.length:f,l=i?p:p/e.length;let a=0,s=0;for(const r of e)y.fillStyle=r.toString(),y.fillRect(a,s,t,l),a=i?a+t:0,s=i?0:s+l}const b=document.createElement("div");return b.style.width=`${n}px`,b.style.height=`${o}px`,S(b,t?.effectList),b.appendChild(h),b}function S(e,t){if(!t)return;e.style.filter=s(t);const l=t.effects;if(l)for(const a of l)if("drop-shadow"===a?.type){a.offsetX<0?e.style.marginLeft=`${Math.abs(a.offsetX)}px`:e.style.marginRight=`${a.offsetX}px`;break}}async function V(e,t){switch(e.type){case"web-style":{const{previewWebStyleSymbol:l}=await import("./previewWebStyleSymbol.js");return l(e,V,t)}case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":{const{previewSymbol3D:l}=await import("./previewSymbol3D.js");return l(e,t)}case"simple-marker":case"simple-line":case"simple-fill":case"picture-marker":case"picture-fill":case"text":{const{previewSymbol2D:l}=await import("./previewSymbol2D.js");return l(e,t)}case"cim":{const{previewCIMSymbol:l}=await import("./previewCIMSymbol.js");return l(e,t)}default:return}}function k(e){return e&&"opacity"in e?e.opacity*k(e.parent):1}async function L(t,l){if(!t)return;const a=t.sourceLayer,i=(null!=l&&l.useSourceLayer?a:t.layer)??a,s=k(i);if(null!=t.symbol&&(null==l||!0!==l.ignoreGraphicSymbol)){const e="web-style"===t.symbol.type?await r(t.symbol,{...l,cache:null!=l?l.webStyleCache:null}):t.symbol.clone();return n(e,null,s),e}const u=l?.renderer??C(i);let f=u&&"getSymbolAsync"in u?await u.getSymbolAsync(t,l):null;if(!f)return;if(f="web-style"===f.type?await f.fetchSymbol({...l,cache:null!=l?l.webStyleCache:null}):f.clone(),!u||!("visualVariables"in u)||!u.visualVariables?.length)return n(f,null,s),f;if("arcadeRequiredForVisualVariables"in u&&u.arcadeRequiredForVisualVariables&&null==l?.arcade){const t={...l};t.arcade=await e(),l=t}const{getColor:p,getOpacity:h,getAllSizes:y,getRotationAngle:d}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),m=[],b=[],g=[],w=[];for(const e of u.visualVariables)switch(e.type){case"color":m.push(e);break;case"opacity":b.push(e);break;case"rotation":w.push(e);break;case"size":e.target||g.push(e)}const v=!!m.length&&m[m.length-1],S=v?p(v,t,l):null,V=!!b.length&&b[b.length-1];let L=V?h(V,t,l):null;if(null!=s&&(L=null!=L?L*s:s),n(f,S,L),g.length){const e=y(g,t,l);await o(f,e)}for(const e of w)c(f,d(e,t,l),e.axis);return f}async function x(t,l){if(!t)return;const{layer:a,sourceLayer:i}=t,s=k(a??i);if(null!=t.symbol&&(null==l||!0!==l.ignoreGraphicSymbol)){const e="web-style"===t.symbol.type?await r(t.symbol,l):t.symbol.clone();return u(e,s)}const n=l?.renderer??C(a)??C(i);let o=n&&"getSymbolAsync"in n?await n.getSymbolAsync(t,l):void 0;if(!o)return;o="web-style"===o.type?await r(o,l):o.clone();const c=u(o,s);if(!n||!("visualVariables"in n)||"visualVariables"in n&&!n.visualVariables||"visualVariables"in n&&!n.visualVariables?.length)return c;if("arcadeRequiredForVisualVariables"in n&&n.arcadeRequiredForVisualVariables&&null==l?.arcade){const t={...l};t.arcade=await e(),l=t}const{getColor:p,getOpacity:h}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),y=[],d=[];if(n.visualVariables)for(const e of n.visualVariables)switch(e.type){case"color":y.push(e);break;case"opacity":d.push(e)}const m=y.length>0?y[y.length-1]:null,b=m?p(m,t,l):c,g=d.length>0?d[d.length-1]:null;let w=g?h(g,t,l):null;return null!=s&&(w=null!=w?w*s:s),b?f(b,w):null}function C(e){if(e)return"renderer"in e?e.renderer:void 0}async function R(e,t,l){if(!e)return;const{layer:a,sourceLayer:i}=e,s=l?.renderer??C(a)??C(i);if(!s)return null;if("visualVariables"in s&&s.visualVariables?.length){const{getRampStops:i}=await import("../../widgets/Legend/support/colorRampUtils.js"),{getRampStops:r}=await import("../../widgets/Legend/support/sizeRampUtils.js"),{getDateFormatOptions:n}=await import("../../widgets/Legend/support/utils.js");let o=null;for(const c of s.visualVariables){const u=t?n(a,c,t.timeZone):null;let f=null;switch(c.type){case"color":f=await i(c,null,u);break;case"opacity":f=await i(c);break;case"size":c.target||(f=await r(s,c,null,l?.scale||t?.scale,t,u))}if(f?.length){const t=f.find(((t,l)=>{const a=e.attributes[c.field];return 0===l?a>=t.value:l===f?.length-1?a<=t.value:t.value===a}));if(t){o=t.label;break}}}if(o)return o}switch(s.type){case"class-breaks":{const t="getClassBreakInfo"in s?await s.getClassBreakInfo(e,l):null;return t?.label??(t&&s.classBreakInfos?.length>1)?`${t.minValue} - ${t.maxValue}`:null}case"unique-value":{const t="getUniqueValueInfo"in s?await s.getUniqueValueInfo(e,l):null;return t?.label}}return null}export{x as getDisplayedColor,L as getDisplayedSymbol,R as getLegendLabel,v as renderColorRampPreviewHTML,b as renderDotDensityPreviewHTML,g as renderPieChartPreviewHTML,V as renderPreviewHTML,w as renderRelationshipRampPreviewHTML};
5
+ import"../../core/has.js";import{loadArcade as e}from"../../support/arcadeOnDemand.js";import{getStroke as t}from"./gfxUtils.js";import{SymbolSizeDefaults as l}from"./previewUtils.js";import{renderSymbol as a,renderOnce as i}from"./renderUtils.js";import{getCSSFilterFromEffectList as s,applyColorToSymbol as r,applySizesToSymbol as n,applyRotationToSymbol as o,getColorFromSymbol as c,applyOpacityToColor as u}from"./utils.js";import{defaultAcceptedFormats as f}from"./webStyleAcceptedFormats.js";import{renderRelationshipRamp as p}from"../../widgets/Legend/styles/support/relationshipUtils.js";import{getRelationshipRampElement as h}from"../../widgets/Legend/support/relationshipRampUtils.js";let y=null;const d=[255,255,255];function m(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function b(e,t,a){const{backgroundColor:i,outline:s,dotSize:r}=e,n=a?.swatchSize||l.size,o=.8,c=Math.round(n*n/Math.max(r,.5)**2*o),u=window.devicePixelRatio,f=document.createElement("canvas"),p=n*u;f.width=p,f.height=p,f.style.width=f.width/u+"px",f.style.height=f.height/u+"px";const h=f.getContext("2d");if(i&&(h.fillStyle=i.toCss(!0),h.fillRect(0,0,p,p),h.fill()),h.fillStyle=t?.toCss(!0)??"",y&&y.length/2===c)for(let l=0;l<2*c;l+=2){const e=y[l],t=y[l+1];h.fillRect(e,t,r*u,r*u),h.fill()}else{y=[];for(let e=0;e<2*c;e+=2){const e=m(0,p),t=m(0,p);y.push(e,t),h.fillRect(e,t,r*u,r*u),h.fill()}}s&&(s.color&&(h.strokeStyle=s.color.toCss(!0)),h.lineWidth=s.width,h.strokeRect(0,0,p,p));const d=new Image(n,n);return d.src=f.toDataURL(),d.ariaLabel=a?.ariaLabel??null,d.alt=a?.ariaLabel??"",d}function g(e,l={}){const i=l.radius||40,s=2*Math.PI*i,r=e.length,n=s/r,o=[],c=t(l.outline);null!=c?.width&&(c.width*=2),(c||l.backgroundColor)&&o.push({shape:{type:"circle",cx:i,cy:i,r:i},fill:l.backgroundColor,stroke:c,offset:[0,0]});const u=l.values,f=u&&u.length===r&&100===u.reduce(((e,t)=>e+t),0),p=[0];for(let t=0;t<r;t++){let l=null;f&&(l=u[t]*s/100,p.push(l+p[t])),o.push({shape:{type:"circle",cx:i,cy:i,r:i/2},fill:[0,0,0,0],stroke:{width:i,dashArray:`${(l??n)/2} ${s}`,dashoffset:"-"+(f?p[t]/2:t*(n/2)),color:e[t]},offset:[0,0]})}let h=null;const y=2*i+(c?.width||0),m=l.holePercentage;if(m){c&&o.push({shape:{type:"circle",cx:i,cy:i,r:i*m},fill:null,stroke:c,offset:[0,0]});const e=y/2;h=[[{shape:{type:"circle",cx:e,cy:e,r:e},fill:d,stroke:c?{...c,color:d}:null,offset:[0,0]},{shape:{type:"circle",cx:e,cy:e,r:i*m},fill:[0,0,0],stroke:null,offset:[0,0]}]]}return a([o],[y,y],{effectView:l.effectList,ignoreStrokeWidth:!0,masking:h,rotations:[-90],ariaLabel:l.ariaLabel})}function w(e,t={}){const l=e?.authoringInfo;if(!("relationship"===l?.type)||!l?.numClasses||!e.uniqueValueInfos)return null;const{focus:a,numClasses:s}=l,r=h({focus:a,numClasses:s,infos:e.uniqueValueInfos}),n=t?.node||document.createElement("div");return i(n,(()=>p(r,t.id||"relationship",{opacity:t.opacity||1,effectList:t.effectList,ariaLabel:t.ariaLabel}))),n}function v(e,t={}){const l=24,a=75,i="horizontal"===t.align,s=i?a:l,r=i?l:a,n=t.width??s,o=t.height??r,c=t.gradient??!0,u=window.devicePixelRatio,f=n*u,p=o*u,h=document.createElement("canvas");h.width=f,h.height=p,h.ariaLabel=t.ariaLabel??null,h.style.width=`${n}px`,h.style.height=`${o}px`;const y=h.getContext("2d"),d=i?f:0,m=i?0:p;if(c){const t=y.createLinearGradient(0,0,d,m),l=e.length,a=1===l?0:1/(l-1);e.forEach(((e,l)=>t.addColorStop(l*a,e.toString()))),y.fillStyle=t,y.fillRect(0,0,f,p)}else{const t=i?f/e.length:f,l=i?p:p/e.length;let a=0,s=0;for(const r of e)y.fillStyle=r.toString(),y.fillRect(a,s,t,l),a=i?a+t:0,s=i?0:s+l}const b=document.createElement("div");return b.style.width=`${n}px`,b.style.height=`${o}px`,S(b,t?.effectList),b.appendChild(h),b}function S(e,t){if(!t)return;e.style.filter=s(t);const l=t.effects;if(l)for(const a of l)if("drop-shadow"===a?.type){a.offsetX<0?e.style.marginLeft=`${Math.abs(a.offsetX)}px`:e.style.marginRight=`${a.offsetX}px`;break}}async function V(e,t){switch(e.type){case"web-style":{const{previewWebStyleSymbol:l}=await import("./previewWebStyleSymbol.js");return l(e,V,t)}case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":{const{previewSymbol3D:l}=await import("./previewSymbol3D.js");return l(e,t)}case"simple-marker":case"simple-line":case"simple-fill":case"picture-marker":case"picture-fill":case"text":{const{previewSymbol2D:l}=await import("./previewSymbol2D.js");return l(e,t)}case"cim":{const{previewCIMSymbol:l}=await import("./previewCIMSymbol.js");return l(e,t)}default:return}}function k(e){return e&&"opacity"in e?e.opacity*k(e.parent):1}async function L(t,l){if(!t)return;const a=t.sourceLayer,i=(null!=l&&l.useSourceLayer?a:t.layer)??a,s=k(i);if(null!=t.symbol&&(null==l||!0!==l.ignoreGraphicSymbol)){const e="web-style"===t.symbol.type?await t.symbol.fetchSymbol({...l,acceptedFormats:["web","cim"],cache:null!=l?l.webStyleCache:null}):t.symbol.clone();return r(e,null,s),e}const c=l?.renderer??C(i);let u=c&&"getSymbolAsync"in c?await c.getSymbolAsync(t,l):null;if(!u)return;if(u="web-style"===u.type?await u.fetchSymbol({...l,cache:null!=l?l.webStyleCache:null}):u.clone(),!c||!("visualVariables"in c)||!c.visualVariables?.length)return r(u,null,s),u;if("arcadeRequiredForVisualVariables"in c&&c.arcadeRequiredForVisualVariables&&null==l?.arcade){const t={...l};t.arcade=await e(),l=t}const{getColor:f,getOpacity:p,getAllSizes:h,getRotationAngle:y}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),d=[],m=[],b=[],g=[];for(const e of c.visualVariables)switch(e.type){case"color":d.push(e);break;case"opacity":m.push(e);break;case"rotation":g.push(e);break;case"size":e.target||b.push(e)}const w=!!d.length&&d[d.length-1],v=w?f(w,t,l):null,S=!!m.length&&m[m.length-1];let V=S?p(S,t,l):null;if(null!=s&&(V=null!=V?V*s:s),r(u,v,V),b.length){const e=h(b,t,l);await n(u,e)}for(const e of g)o(u,y(e,t,l),e.axis);return u}async function x(t,l){if(!t)return;const{layer:a,sourceLayer:i}=t,s=k(a??i);if(null!=t.symbol&&(null==l||!0!==l.ignoreGraphicSymbol)){const e="web-style"===t.symbol.type?await t.symbol.fetchSymbol({...l,acceptedFormats:f}):t.symbol.clone();return c(e,s)}const r=l?.renderer??C(a)??C(i);let n=r&&"getSymbolAsync"in r?await r.getSymbolAsync(t,l):void 0;if(!n)return;n="web-style"===n.type?await n.fetchSymbol({...l,acceptedFormats:f}):n.clone();const o=c(n,s);if(!r||!("visualVariables"in r)||"visualVariables"in r&&!r.visualVariables||"visualVariables"in r&&!r.visualVariables?.length)return o;if("arcadeRequiredForVisualVariables"in r&&r.arcadeRequiredForVisualVariables&&null==l?.arcade){const t={...l};t.arcade=await e(),l=t}const{getColor:p,getOpacity:h}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),y=[],d=[];if(r.visualVariables)for(const e of r.visualVariables)switch(e.type){case"color":y.push(e);break;case"opacity":d.push(e)}const m=y.length>0?y[y.length-1]:null,b=m?p(m,t,l):o,g=d.length>0?d[d.length-1]:null;let w=g?h(g,t,l):null;return null!=s&&(w=null!=w?w*s:s),b?u(b,w):null}function C(e){if(e)return"renderer"in e?e.renderer:void 0}async function R(e,t,l){if(!e)return;const{layer:a,sourceLayer:i}=e,s=l?.renderer??C(a)??C(i);if(!s)return null;if("visualVariables"in s&&s.visualVariables?.length){const{getRampStops:i}=await import("../../widgets/Legend/support/colorRampUtils.js"),{getRampStops:r}=await import("../../widgets/Legend/support/sizeRampUtils.js"),{getDateFormatOptions:n}=await import("../../widgets/Legend/support/utils.js");let o=null;for(const c of s.visualVariables){const u=t?n(a,c,t.timeZone):null;let f=null;switch(c.type){case"color":f=await i(c,null,u);break;case"opacity":f=await i(c);break;case"size":c.target||(f=await r(s,c,null,l?.scale||t?.scale,t,u))}if(f?.length){const t=f.find(((t,l)=>{const a=e.attributes[c.field];return 0===l?a>=t.value:l===f?.length-1?a<=t.value:t.value===a}));if(t){o=t.label;break}}}if(o)return o}switch(s.type){case"class-breaks":{const t="getClassBreakInfo"in s?await s.getClassBreakInfo(e,l):null;return t?.label??(t&&s.classBreakInfos?.length>1)?`${t.minValue} - ${t.maxValue}`:null}case"unique-value":{const t="getUniqueValueInfo"in s?await s.getUniqueValueInfo(e,l):null;return t?.label}}return null}export{x as getDisplayedColor,L as getDisplayedSymbol,R as getLegendLabel,v as renderColorRampPreviewHTML,b as renderDotDensityPreviewHTML,g as renderPieChartPreviewHTML,V as renderPreviewHTML,w as renderRelationshipRampPreviewHTML};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Color.js";import{forEach as t}from"../../core/asyncUtils.js";import"../../core/has.js";import{px2pt as o}from"../../core/screenUtils.js";import{ONES as r}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{effectFunctionsFromJSON as n}from"../../layers/effects/jsonUtils.js";import{getCIMSymbolColor as l}from"./cimSymbolUtils.js";import{getStroke as i}from"./gfxUtils.js";import{Symbol3DMaterial as c}from"./Symbol3DMaterial.js";import{isSymbol3D as s,isSymbol2D as u}from"./typeUtils.js";const a=new e("white");function f(e){const t=e.symbolLayers?.at(-1);if(t&&"outline"in t)return t?.outline?.size}function y(e){if(!e)return 0;if(s(e)){const t=f(e);return null!=t?t:0}return o(i(e)?.width)}function m(e){if(null==e||!("symbolLayers"in e)||null==e.symbolLayers)return!1;switch(e.type){case"point-3d":return e.symbolLayers.some((e=>"object"===e.type));case"line-3d":return e.symbolLayers.some((e=>"path"===e.type));case"polygon-3d":return e.symbolLayers.some((e=>"object"===e.type||"extrude"===e.type));default:return!1}}function p(e){return e.resource?.href??""}function h(t,o){if(!t)return null;let r=null;return s(t)?r=b(t):u(t)&&(r="cim"===t.type?l(t):t.color?new e(t.color):null),r?w(r,o):null}function b(t){const o=t.symbolLayers;if(!o)return null;let r=null;return o.forEach((e=>{"object"===e.type&&e.resource?.href||(r="water"===e.type?e.color:e.material?e.material.color:null)})),r?new e(r):null}function w(t,o){if(null==o||null==t)return t;const r=t.toRgba();return r[3]=r[3]*o,new e(r)}function d(e,t,o){const r=e.symbolLayers;if(!r)return;const n=e=>w(t=t??e??(null!=o?a:null),o);r.forEach((e=>{if("object"!==e.type||!e.resource?.href||t)if("water"===e.type)e.color=n(e.color);else{const t=null!=e.material?e.material.color:null,r=n(t);null==e.material?e.material=new c({color:r}):e.material.color=r,null!=o&&"outline"in e&&null!=e.outline?.color&&(e.outline.color=w(e.outline.color,o))}}))}function j(e,t,o){(t=t??e.color)&&(e.color=w(t,o)),null!=o&&"outline"in e&&e.outline?.color&&(e.outline.color=w(e.outline.color,o))}function g(t,o,r){t&&(o||null!=r)&&(o&&(o=new e(o)),s(t)?d(t,o,r):u(t)&&j(t,o,r))}async function k(e,o){const r=e.symbolLayers;r&&await t(r,(async e=>L(e,o)))}async function L(e,t){switch(e.type){case"extrude":x(e,t);break;case"icon":case"line":case"text":z(e,t);break;case"path":v(e,t);break;case"object":await U(e,t)}}function z(e,t){const o=S(t);null!=o&&(e.size=o)}function S(e){for(const t of e)if("number"==typeof t)return t;return null}function x(e,t){e.size="number"==typeof t[2]?t[2]:0}async function U(e,t){const{resourceSize:o,symbolSize:r}=await C(e),n=E(t,o,r);e.width=M(t[0],r[0],o[0],n),e.depth=M(t[1],r[1],o[1],n),e.height=M(t[2],r[2],o[2],n)}function v(e,t){const o=E(t,r,[e.width,void 0,e.height]);e.width=M(t[0],e.width,1,o),e.height=M(t[2],e.height,1,o)}function E(e,t,o){for(let r=0;r<3;r++){const n=e[r];switch(n){case"symbol-value":{const e=o[r];return null!=e?e/t[r]:1}case"proportional":break;default:if(n&&t[r])return n/t[r]}}return 1}async function C(e){const{computeObjectLayerResourceSize:t}=await import("./symbolLayerUtils.js"),o=await t(e,10),{width:r,height:n,depth:l}=e,i=[r,l,n];let c=1;for(let s=0;s<3;s++){const e=i[s];if(null!=e){c=e/o[s];break}}for(let s=0;s<3;s++)null==i[s]&&(i[s]=o[s]*c);return{resourceSize:o,symbolSize:i}}function M(e,t,o,r){switch(e){case"proportional":return o*r;case"symbol-value":return null!=t?t:o;default:return e}}function O(e,t){const o=S(t);if(null!=o)switch(e.type){case"simple-marker":e.size=o;break;case"picture-marker":{const t=e.width/e.height;t>1?(e.width=o,e.height=o*t):(e.width=o*t,e.height=o);break}case"simple-line":e.width=o;break;case"text":e.font.size=o}}async function R(e,t){if(e&&t)return s(e)?k(e,t):void(u(e)&&O(e,t))}function D(e,t,o){if(e&&null!=t)if(s(e)){const r=e.symbolLayers;r&&r.forEach((e=>{if("object"===e.type)switch(o){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}"icon"===e.type&&(e.angle+=t)}))}else u(e)&&("simple-marker"!==e.type&&"picture-marker"!==e.type&&"text"!==e.type||(e.angle+=t))}function I(e){if(!e)return null;const t=e.effects.filter((e=>"bloom"!==e.type)).map((e=>e.toJSON()));return n(t)}function J(e){return null!=e&&"polygon-3d"===e.type&&e.symbolLayers.some((e=>"extrude"===e.type))}async function N(e,t){const o=await e.fetchSymbol(t);return o||e.fetchCIMSymbol(t)}export{g as applyColorToSymbol,w as applyOpacityToColor,D as applyRotationToSymbol,R as applySizesToSymbol,N as fetchWebStyleSymbol,I as getCSSFilterFromEffectList,h as getColorFromSymbol,p as getIconHref,y as getSymbolOutlineSize,m as isVolumetricSymbol,J as symbolHasExtrudeSymbolLayer};
5
+ import e from"../../Color.js";import{forEach as t}from"../../core/asyncUtils.js";import"../../core/has.js";import{px2pt as o}from"../../core/screenUtils.js";import{ONES as r}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{effectFunctionsFromJSON as n}from"../../layers/effects/jsonUtils.js";import{getCIMSymbolColor as l}from"./cimSymbolUtils.js";import{getStroke as i}from"./gfxUtils.js";import{Symbol3DMaterial as c}from"./Symbol3DMaterial.js";import{isSymbol3D as s,isSymbol2D as u}from"./typeUtils.js";const a=new e("white");function f(e){const t=e.symbolLayers?.at(-1);if(t&&"outline"in t)return t?.outline?.size}function m(e){if(!e)return 0;if(s(e)){const t=f(e);return null!=t?t:0}return o(i(e)?.width)}function y(e){if(null==e||!("symbolLayers"in e)||null==e.symbolLayers)return!1;switch(e.type){case"point-3d":return e.symbolLayers.some((e=>"object"===e.type));case"line-3d":return e.symbolLayers.some((e=>"path"===e.type));case"polygon-3d":return e.symbolLayers.some((e=>"object"===e.type||"extrude"===e.type));default:return!1}}function p(e){return e.resource?.href??""}function h(t,o){if(!t)return null;let r=null;return s(t)?r=b(t):u(t)&&(r="cim"===t.type?l(t):t.color?new e(t.color):null),r?w(r,o):null}function b(t){const o=t.symbolLayers;if(!o)return null;let r=null;return o.forEach((e=>{"object"===e.type&&e.resource?.href||(r="water"===e.type?e.color:e.material?e.material.color:null)})),r?new e(r):null}function w(t,o){if(null==o||null==t)return t;const r=t.toRgba();return r[3]=r[3]*o,new e(r)}function d(e,t,o){const r=e.symbolLayers;if(!r)return;const n=e=>w(t=t??e??(null!=o?a:null),o);r.forEach((e=>{if("object"!==e.type||!e.resource?.href||t)if("water"===e.type)e.color=n(e.color);else{const t=null!=e.material?e.material.color:null,r=n(t);null==e.material?e.material=new c({color:r}):e.material.color=r,null!=o&&"outline"in e&&null!=e.outline?.color&&(e.outline.color=w(e.outline.color,o))}}))}function j(e,t,o){(t=t??e.color)&&(e.color=w(t,o)),null!=o&&"outline"in e&&e.outline?.color&&(e.outline.color=w(e.outline.color,o))}function g(t,o,r){t&&(o||null!=r)&&(o&&(o=new e(o)),s(t)?d(t,o,r):u(t)&&j(t,o,r))}async function k(e,o){const r=e.symbolLayers;r&&await t(r,(async e=>L(e,o)))}async function L(e,t){switch(e.type){case"extrude":S(e,t);break;case"icon":case"line":case"text":z(e,t);break;case"path":v(e,t);break;case"object":await U(e,t)}}function z(e,t){const o=x(t);null!=o&&(e.size=o)}function x(e){for(const t of e)if("number"==typeof t)return t;return null}function S(e,t){e.size="number"==typeof t[2]?t[2]:0}async function U(e,t){const{resourceSize:o,symbolSize:r}=await O(e),n=E(t,o,r);e.width=R(t[0],r[0],o[0],n),e.depth=R(t[1],r[1],o[1],n),e.height=R(t[2],r[2],o[2],n)}function v(e,t){const o=E(t,r,[e.width,void 0,e.height]);e.width=R(t[0],e.width,1,o),e.height=R(t[2],e.height,1,o)}function E(e,t,o){for(let r=0;r<3;r++){const n=e[r];switch(n){case"symbol-value":{const e=o[r];return null!=e?e/t[r]:1}case"proportional":break;default:if(n&&t[r])return n/t[r]}}return 1}async function O(e){const{computeObjectLayerResourceSize:t}=await import("./symbolLayerUtils.js"),o=await t(e,10),{width:r,height:n,depth:l}=e,i=[r,l,n];let c=1;for(let s=0;s<3;s++){const e=i[s];if(null!=e){c=e/o[s];break}}for(let s=0;s<3;s++)null==i[s]&&(i[s]=o[s]*c);return{resourceSize:o,symbolSize:i}}function R(e,t,o,r){switch(e){case"proportional":return o*r;case"symbol-value":return null!=t?t:o;default:return e}}function C(e,t){const o=x(t);if(null!=o)switch(e.type){case"simple-marker":e.size=o;break;case"picture-marker":{const t=e.width/e.height;t>1?(e.width=o,e.height=o*t):(e.width=o*t,e.height=o);break}case"simple-line":e.width=o;break;case"text":e.font.size=o}}async function D(e,t){if(e&&t)return s(e)?k(e,t):void(u(e)&&C(e,t))}function J(e,t,o){if(e&&null!=t)if(s(e)){const r=e.symbolLayers;r&&r.forEach((e=>{if("object"===e.type)switch(o){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}"icon"===e.type&&(e.angle+=t)}))}else u(e)&&("simple-marker"!==e.type&&"picture-marker"!==e.type&&"text"!==e.type||(e.angle+=t))}function M(e){if(!e)return null;const t=e.effects.filter((e=>"bloom"!==e.type)).map((e=>e.toJSON()));return n(t)}function N(e){return null!=e&&"polygon-3d"===e.type&&e.symbolLayers.some((e=>"extrude"===e.type))}export{g as applyColorToSymbol,w as applyOpacityToColor,J as applyRotationToSymbol,D as applySizesToSymbol,M as getCSSFilterFromEffectList,h as getColorFromSymbol,p as getIconHref,m as getSymbolOutlineSize,y as isVolumetricSymbol,N as symbolHasExtrudeSymbolLayer};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
+ */
5
+ const e=["web-gltf","web","cim"];export{e as defaultAcceptedFormats};