@arcgis/core 4.32.0-next.20241021 → 4.32.0-next.20241022

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 (95) hide show
  1. package/applications/MapViewer/templateUtils.d.ts +4 -0
  2. package/applications/MapViewer/templateUtils.js +5 -0
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{1ba1d9c867ec6a492af9.js → 0f3912bca9fe25eea75c.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{842ebde78db9bfcaf07b.js → 1678d1d0ecb9b2af69a8.js} +1 -1
  6. package/assets/esri/core/workers/chunks/1d16ca7791f64dd7c7fb.js +1 -0
  7. package/assets/esri/core/workers/chunks/{b292758308dfac4ba8ee.js → 2d8aa31dc96bbd014036.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{88bd9e023764da377aa7.js → 2ee26f77d8e8c15a51ea.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{53f648321c5fde26bfe4.js → 319e06888467f9f460ab.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{303f39b9b7bd33109df8.js → 587df97288a83721d251.js} +1 -1
  11. package/assets/esri/core/workers/chunks/5caa02a7a85d05e253b4.js +1 -0
  12. package/assets/esri/core/workers/chunks/5cfecb320e1dcd258b2e.js +1 -0
  13. package/assets/esri/core/workers/chunks/67018ef25736f0722f6e.js +1 -0
  14. package/assets/esri/core/workers/chunks/{03eba36affe6ed1f5a11.js → 757fe331381da1b7edad.js} +2 -2
  15. package/assets/esri/core/workers/chunks/772cc80923d5e2c6436d.js +1 -0
  16. package/assets/esri/core/workers/chunks/89f74819ac1b5884c149.js +1 -0
  17. package/assets/esri/core/workers/chunks/92b2d81ef16877341f97.js +1 -0
  18. package/assets/esri/core/workers/chunks/{e6e77cbdeb99d90caad1.js → 97f62fad6d416a666319.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{63719f892a7d1025c7d3.js → b42c1ab7579a3c464f72.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{c71304c88fce556340ef.js → c859f73b57a764e99b02.js} +1 -1
  21. package/assets/esri/core/workers/chunks/e71fa25ed45bae5a1adb.js +320 -0
  22. package/core/MemCache.js +1 -1
  23. package/core/MemCachePool.js +1 -1
  24. package/geometry/Mesh.js +1 -1
  25. package/geometry/support/MeshVertexAttributes.js +1 -1
  26. package/interfaces.d.ts +128 -0
  27. package/layers/LinkChartLayer.js +1 -1
  28. package/layers/SceneLayer.js +1 -1
  29. package/layers/knowledgeGraph/supportUtils.js +1 -1
  30. package/layers/support/ElevationQueryTileCache.js +1 -1
  31. package/layers/support/ElevationTileData.js +1 -1
  32. package/layers/support/mediaUtils.js +1 -1
  33. package/layers/support/rasterFunctions/ClipFunction.js +1 -1
  34. package/layers/support/rasterFunctions/clipUtils.js +1 -1
  35. package/layers/support/rasterFunctions/localUtils.js +1 -1
  36. package/linkChart/LinkChartProperties.js +1 -1
  37. package/package.json +1 -1
  38. package/smartMapping/raster/renderers/classBreaks.js +1 -1
  39. package/smartMapping/raster/renderers/rgb.js +1 -1
  40. package/smartMapping/raster/renderers/stretch.js +1 -1
  41. package/smartMapping/raster/support/adapters/ImageryTileLayerAdapter.js +1 -1
  42. package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
  43. package/smartMapping/renderers/support/rendererUtils.d.ts +4 -0
  44. package/support/revision.js +1 -1
  45. package/views/2d/engine/vectorTiles/RenderBucket.js +1 -1
  46. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  47. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  48. package/views/2d/grid/GridView2D.js +1 -1
  49. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  50. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  51. package/views/3d/glTF/loader.js +1 -1
  52. package/views/3d/layers/I3SMeshView3D.js +1 -1
  53. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  54. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  55. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  56. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  57. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  58. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  59. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  60. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  61. package/views/3d/layers/i3s/CachedMeshData.js +5 -0
  62. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  63. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  64. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  65. package/views/3d/layers/support/FeatureTile.js +1 -1
  66. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  67. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  68. package/views/3d/terrain/Tile.js +1 -1
  69. package/views/3d/terrain/TileTexture.js +1 -1
  70. package/views/3d/webgl/ManagedFBO.js +1 -1
  71. package/views/3d/webgl/ManagedFBOAttachment.js +1 -1
  72. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  73. package/views/3d/webgl-engine/core/FBOPool.js +1 -1
  74. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +1 -1
  75. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  76. package/views/3d/webgl-engine/materials/ProceduralTextureRepository.js +1 -1
  77. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  78. package/views/webgl/Texture.js +1 -1
  79. package/views/webgl/VertexArrayObject.js +1 -1
  80. package/webdoc/support/webdocSaveUtils.js +1 -1
  81. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  82. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  83. package/widgets/FeatureTable/support/columnUtils.js +1 -1
  84. package/widgets/FeatureTable/support/tableUtils.js +1 -1
  85. package/widgets/FeatureTable/support/templateUtils.js +5 -0
  86. package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
  87. package/widgets/support/GridControls.js +1 -1
  88. package/assets/esri/core/workers/chunks/0c40cac18711f79f0a7d.js +0 -1
  89. package/assets/esri/core/workers/chunks/1a97f98facfc62a9fc69.js +0 -1
  90. package/assets/esri/core/workers/chunks/1fc064e37d030e449d5e.js +0 -1
  91. package/assets/esri/core/workers/chunks/77d129134c2a66cd86d8.js +0 -1
  92. package/assets/esri/core/workers/chunks/92ce57cb12d9a7a3699e.js +0 -1
  93. package/assets/esri/core/workers/chunks/a5675c989d00b7400f98.js +0 -1
  94. package/assets/esri/core/workers/chunks/c06c5c815b5e37717fa1.js +0 -1
  95. package/assets/esri/core/workers/chunks/ce8c1208916f54af7e68.js +0 -320
@@ -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"../../geometry.js";import e from"../../Graphic.js";import t from"../../request.js";import"../../symbols.js";import r from"../../core/Error.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import n from"../GraphicsLayer.js";import{convertFromGeometry as i}from"../graphics/featureConversionUtils.js";import s from"../graphics/OptimizedGeometry.js";import{systemOidFieldName as a}from"./layerUtils.js";import l from"./SessionMemoryStorage.js";import{Direction2D as c}from"../../libs/linkchartlayout/LinkChartLayout.js";import{executeQueryStreaming as d}from"../../rest/knowledgeGraphService.js";import m from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import{ProtoOutboundRelationshipFeatureCollectionAttributionIndexes as y,ProtoInboundFeatureCollectionAttributionNames as p,ProtoOutboundEntityFeatureCollectionAttributionIndexes as f}from"../../rest/knowledgeGraph/ProtoFeatureCollection.js";import{getWasmInterface as u}from"../../rest/knowledgeGraph/wasmInterface/knowledgeWasmAccess.js";import{EsriFieldTypes as g}from"../../rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js";import{WasmQuantizeOriginPositionTypeCode as h,SqlTypeCode as _,IdArrayType as w}from"../../rest/knowledgeGraph/wasmInterface/WasmSerializedLayerData.js";import{wasmToProtoFeatureCollection as b}from"../../rest/knowledgeGraph/wasmInterface/wasmToFeatureFactories.js";import T from"../../symbols/CIMSymbol.js";import M from"../../geometry/Polyline.js";import E from"../../symbols/SimpleFillSymbol.js";import k from"../../geometry/Polygon.js";import I from"../../symbols/TextSymbol.js";import S from"../../geometry/Point.js";function C(e){if(!e.spatialReference.isWGS84)throw new r("knowledge-graph:layer-support-utils","The extentToInBoundsRings function only supports WGS84 spatial references.");return e.clone().normalize().map((e=>[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]))}function A(e,t){const r=new Map;if(t.dataModel?.relationshipTypes)for(const o of t.dataModel.relationshipTypes)o.name&&r.set(o.name,[]);for(const o of e)r.has(o.typeName)&&r.get(o.typeName)?.push(o.id);return r}async function N(e,t){const r=[],o=A(e,t),n={},i=[];for(const[c,d]of o){if(d.length<1)continue;const e=`${c}_ids`;n[e]=d,i.push(`MATCH (n)-[r:${c}]->(m) WHERE id(r) in $${e} RETURN id(n), labels(n)[0], id(m), labels(m)[0]`)}if(0===i.length)return[];const s=i.join(" UNION "),a=new m({openCypherQuery:s,bindParameters:n}),l=(await d(t,a)).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await l.read();if(e)break;for(const o of t)r.push({id:o[0],typeName:o[1]}),r.push({id:o[2],typeName:o[3]})}return r}async function G(e,t){const r=new Map,o=A(e,t),n={},i=[];for(const[c,d]of o){if(d.length<1)continue;const e=`${c}_ids`;n[e]=d,i.push(`MATCH (n)-[r:${c}]->(m) WHERE id(r) in $${e} RETURN id(r), id(n), id(m)`)}if(0===i.length)return r;const s=i.join(" UNION "),a=new m({openCypherQuery:s,bindParameters:n}),l=(await d(t,a)).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await l.read();if(e)break;for(const o of t)r.set(o[0],[o[1],o[2]])}return r}async function j(e){const t=[],r={generateAllSublayers:!1,namedTypeDefinitions:new Map};return e.entitiesUrl&&t.push(U(e.entitiesUrl).then((e=>{z(e,r)}))),e.relationshipsUrl&&t.push(U(e.relationshipsUrl).then((e=>{z(e,r)}))),e.idCollectionsUrl&&t.push(O(e.idCollectionsUrl).then((e=>{W(e,r)}))),await Promise.all(t),r}async function F(e,t){t??=!1;const r={generateAllSublayers:t,namedTypeDefinitions:new Map};return await O(e).then((e=>{W(e,r)})),r}async function R(e,t,r){const o=await u(),n=new o.FeatureCollection,i=new o.FeatureCollection;try{D(n,o,e,"entities",t,r),D(i,o,e,"relationships",t,r);const s=new o.FeatureCollectionEncoder,a=new o.FeatureCollectionEncoder,l=H(n,s),c=structuredClone(l),d=H(i,a),m={entitiesFC:c,relationshipsFC:structuredClone(d),idCollections:await x(e)};return s.delete(),a.delete(),m}finally{n.delete(),i.delete()}}async function x(e){const t=await u(),o=new t.MapOfObjectIdentifierSets;L(o,t,e);const n=new t.MapOfObjectIdentifierSetsEncoder;try{n.set_map_of_identifier_sets(o),n.encode();const e=n.get_encoding_result();if(0!==e.error.error_code)throw new r("knowledge-graph:layer-support-utils",e.error.error_message);const t=structuredClone(e.get_byte_buffer());return n.delete(),t}finally{o.delete()}}function D(e,t,r,o,n,s){e.version="";const a=new t.QueryResult,l=new t.FeatureResult,c="entities"===o?f:y;l.unique_id_field={name:c[c.ELEMENTUID],isSystemMaintained:!1},l.globalid_field_name=c[c.ELEMENTUID],l.geohash_field_name="",l.geometry_properties={shapeAreaFieldName:"",shapeLengthFieldName:"",units:""},l.spatial_reference={wkid:4326,latestWkid:4326,vcsWkid:0,latestVcsWkid:0,wkt:""},l.exceeded_transfer_limit=!1,l.has_z=!1,l.has_m=!1,l.transform={quantizeOriginPosition:{value:h.upperLeft},scale:{xScale:1e-9,yScale:1e-9,mScale:1e-4,zScale:1e-4},translate:{xTranslate:-400,yTranslate:-400,mTranslate:-1e5,zTranslate:-1e5}};for(const i of Object.keys(c).filter((e=>isNaN(Number(e))))){const e=new t.Field;if(e.name=i,e.alias=i,e.sql_type={value:_.sqlTypeBigInt},"entities"===o)switch(i){case c[c.ELEMENTUID]:case c[c.TYPENAME]:e.field_type={value:g.esriFieldTypeString}}else switch(i){case c[c.ELEMENTUID]:case c[c.TYPENAME]:case y[y.FROMUID]:case y[y.TOUID]:e.field_type={value:g.esriFieldTypeString}}e.domain="",l.add_field(e),e.delete()}const d=new Map;for(const i of n.dataModel.entityTypes)d.set(i.name,"entities");for(const i of n.dataModel.relationshipTypes)d.set(i.name,"relationships");for(const[m,p]of r.namedTypeDefinitions)if(o===d.get(m))for(const e of p.members.values()){const r=new t.Feature;for(const i of Object.keys(c).filter((e=>isNaN(Number(e)))))if("entities"===o)switch(i){case c[c.ELEMENTUID]:r.add_attribute(e.id,t.esriFieldType.esriFieldTypeString);break;case c[c.TYPENAME]:r.add_attribute(m,t.esriFieldType.esriFieldTypeString)}else switch(i){case c[c.ELEMENTUID]:r.add_attribute(e.id,t.esriFieldType.esriFieldTypeString);break;case y[y.FROMUID]:r.add_attribute(s.has(e.id)?s.get(e.id)[0]:"",t.esriFieldType.esriFieldTypeString);break;case y[y.TOUID]:r.add_attribute(s.has(e.id)?s.get(e.id)[1]:"",t.esriFieldType.esriFieldTypeString);break;case c[c.TYPENAME]:r.add_attribute(m,t.esriFieldType.esriFieldTypeString)}let n;if(e.linkChartLocation&&"x"in e.linkChartLocation?n=i(e.linkChartLocation):e.linkChartLocation&&(n=e.linkChartLocation),e.linkChartLocation&&n){const e=new t.FeatureCollectionGeometry;let i=!1;switch(o){case"entities":e.geometry_type=t.esriGeometryType.esriGeometryPoint,i=!0;break;case"relationships":e.geometry_type=t.esriGeometryType.esriGeometryPolyline}e.coords=new Float64Array(n.coords),e.lengths=new Uint32Array(i?[1]:n.lengths),r.set_compressed_geometry(e),e.delete()}l.add_feature(r),r.delete()}switch(o){case"entities":l.geometry_type=t.esriGeometryType.esriGeometryPoint;break;case"relationships":l.geometry_type=t.esriGeometryType.esriGeometryPolyline}return a.set_feature_result(l),e.set_query_result(a),l.delete(),a.delete(),e}function L(e,t,r){for(const[o,n]of r.namedTypeDefinitions){if(!n.members||n.useAllData)continue;const r=n.members.keys();let i=!1,s=!0;const a=new t.ObjectIdArray,l=new t.StringArray,c=new t.GlobalIdArray,d=new t.IdentifierArray,m=new t.ObjectIdentifierSet;for(const e of r)s&&(i=!isNaN(Number(e)),s=!1),i?a.add_objectid(Number(e)):(l.add_string(e),c.add_globalid(e)),d.add_identifier(e);m.set_oid_array(a),m.set_string_array(l),m.set_globalid_array(c),m.set_identifier_array(d),a.delete(),l.delete(),c.delete(),d.delete(),e.put_identifier_set(o,m),m.delete()}return e}async function U(e){const r=await t(e,{responseType:"array-buffer"});return P(await r.data)}async function P(e){const t=new((await u()).FeatureCollectionDecoder),o=t.decode(new Uint8Array(e));if(0!==o.error_code)throw new r("knowledge-graph:layer-support-utils",o.error_message);const n=t.get_feature_collection(),i=b(n);return t.delete(),i}async function O(e){const r=await t(e,{responseType:"array-buffer"}),o=await r.data;return v(new Uint8Array(o))}async function v(e){const t=new((await u()).MapOfObjectIdentifierSetsDecoder),o=t.decode(new Uint8Array(e)),n=new Map;if(0!==o.error_code)throw new r("knowledge-graph:layer-support-utils",o.error_message);const i=t.get_map_of_identifier_sets(),s=i.keys,a=s.size();for(let l=0;l<a;l++){const e=s.get(l),t=i.query_identifier_set(e),o=[];if(t.id_array_type.value===w.GLOBALID_ARRAY){const e=t.get_globalid_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_globalid_at(t))}else if(t.id_array_type.value===w.IDENTIFIER_ARRAY){const e=t.get_identifier_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_identifier_at(t).toString())}else if(t.id_array_type.value===w.STRING_ARRAY){const e=t.get_string_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_string_at(t))}else{if(t.id_array_type.value!==w.OID_ARRAY)throw new r("knowledge-graph:layer-support-utils","Tried to encode an unexpected ID Array type.");{const e=t.get_oid_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_objectid_at(t).toString())}}n.set(e,o)}return t.delete(),n}function z(e,t){if(!e?.queryResult?.featureResult)return t;const r=e.queryResult.featureResult.fieldNameToAttributeIndexMap;for(const n of e.queryResult.featureResult.features){const e=n.attributes[r[p.TYPENAME]],i=o(t.namedTypeDefinitions,e,(()=>({useAllData:!1,members:new Map}))),a=n.attributes[r[p.ELEMENTUID]];if(n.compressedGeometry?.coords?.length>0){let e=n.compressedGeometry.lengths;"esriGeometryPoint"===n.compressedGeometry.geometryType&&(e=[]),i.members.set(a,{id:a,linkChartLocation:new s(e,n.compressedGeometry.coords)})}else i.members.set(a,{id:a})}return t}function W(e,t){for(const[r,n]of e){const e=o(t.namedTypeDefinitions,r,(()=>({useAllData:!1,members:new Map})));for(const t of n)e.members.has(t)||e.members.set(t,{id:t})}return t}const q="ESRI__ChronologicalLayoutOverlay",Y=()=>q,$=t=>{const r=[],o={type:"CIMGeometricEffectCut",beginCut:3,endCut:3};for(const n of t.chronologicalAuxiliaryGraphics?.lines??[]){const t={type:"CIMSolidStroke",enable:!0,width:n.width,color:[n.color.r,n.color.g,n.color.b,Math.round(n.color.a/100*255)],effects:n.dashPattern.length>0?[{type:"CIMGeometricEffectDashes",dashTemplate:n.dashPattern,lineDashEnding:"NoConstraint"},o]:[o]},i={type:"CIMVectorMarker",enable:!0,size:10,frame:{xmin:-5,ymin:-5,xmax:0,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-12,-3.47],[-12,3.6],[-2.06,-.03],[-12,-3.47]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[n.color.r,n.color.g,n.color.b,Math.round(n.color.a/100*255)]}]}}],markerPlacement:{type:"CIMMarkerPlacementOnLine",angleToLine:!0,relativeTo:"LineEnd",offsetAlongLine:0}},s=new T({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:n.arrowheadSizeAtEnd?[t,i]:[t]}}});for(const o of n.elements){const t=new M({paths:[[[o.origin.x,o.origin.y],[o.destination.x,o.destination.y]]]});r.push(new e({geometry:t,symbol:s}))}}for(const n of t.chronologicalAuxiliaryGraphics?.polygons??[]){const t=new E({color:[n.color.r,n.color.g,n.color.b,n.color.a/100],style:"solid",outline:null});for(const o of n.elements){const n=new k({rings:[o.points.map((e=>[e.x,e.y]))]});r.push(new e({geometry:n,symbol:t}))}}for(const n of t.chronologicalAuxiliaryGraphics?.texts??[]){let t="middle",o="center";switch(n.direction?.value){case c.left:o="right";break;case c.right:o="left";break;case c.bottom:t="bottom"}for(const i of n.elements){const s=new I({color:[n.color.r,n.color.g,n.color.b,n.color.a/100],text:i.str,font:{size:n.height,weight:"bold"},verticalAlignment:t,horizontalAlignment:o}),a=new S({x:i.anchor.x,y:i.anchor.y});r.push(new e({geometry:a,symbol:s}))}}return new n({graphics:r,listMode:"hide",title:q,id:q})},H=(e,t)=>{t.set_feature_collection(e),t.encode();const o=t.get_encoding_result();if(0!==o.error.error_code)throw new r("knowledge-graph:layer-support-utils",o.error.error_message);return o.get_byte_buffer()},Q=(e,t)=>{const r=new Map;for(const n of[...t.entityTypes??[],...t.relationshipTypes??[]])for(const e of n.properties??[])e.geometryType&&"esriGeometryNull"!==e.geometryType&&r.set(n.name,e.name??"");const o=l.getInstance();for(const n of e)o.writeToStore([n],a,r.get(n.typeName??"")??"")};export{z as addFeatureCollectionToInclusionDefinition,W as addIdMapToInclusionDefinition,P as deserializeFeatureCollection,v as deserializeIdCollectionMap,C as extentToInBoundsRings,F as fetchAndConvertSerializedKgIdMap,j as fetchAndConvertSerializedLinkChart,U as fetchAndDeserializeFeatureCollection,O as fetchAndDeserializeIdCollectionMap,$ as getChronologicalOverlay,Y as getDefaultChronologicalOverlayLayerId,N as getRelationshipEndNodeIds,G as getRelationshipEndNodeMap,Q as loadRecordsIntoLocalCache,R as serializeInclusionDefinitionToAllPbf,x as serializeInclusionDefinitionToIdCollectionsMapPbf,D as setFeatureCollectionProperties};
5
+ import"../../geometry.js";import e from"../../Graphic.js";import t from"../../request.js";import"../../symbols.js";import r from"../../core/Error.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import n from"../GraphicsLayer.js";import{convertFromGeometry as i}from"../graphics/featureConversionUtils.js";import a from"../graphics/OptimizedGeometry.js";import{IdealEdgeLengthTypeOptions as s}from"./IdealEdgeLengthTypeOptions.js";import{systemOidFieldName as l}from"./layerUtils.js";import c from"./SessionMemoryStorage.js";import{Direction2D as d}from"../../libs/linkchartlayout/LinkChartLayout.js";import{executeQueryStreaming as m}from"../../rest/knowledgeGraphService.js";import y from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import{ProtoOutboundRelationshipFeatureCollectionAttributionIndexes as p,ProtoInboundFeatureCollectionAttributionNames as u,ProtoOutboundEntityFeatureCollectionAttributionIndexes as f}from"../../rest/knowledgeGraph/ProtoFeatureCollection.js";import{getWasmInterface as g}from"../../rest/knowledgeGraph/wasmInterface/knowledgeWasmAccess.js";import{EsriFieldTypes as h}from"../../rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js";import{WasmQuantizeOriginPositionTypeCode as _,SqlTypeCode as w,IdArrayType as b}from"../../rest/knowledgeGraph/wasmInterface/WasmSerializedLayerData.js";import{wasmToProtoFeatureCollection as T}from"../../rest/knowledgeGraph/wasmInterface/wasmToFeatureFactories.js";import E from"../../symbols/CIMSymbol.js";import I from"../../geometry/Polyline.js";import C from"../../symbols/SimpleFillSymbol.js";import M from"../../geometry/Polygon.js";import R from"../../symbols/TextSymbol.js";import A from"../../geometry/Point.js";function L(e){if(!e.spatialReference.isWGS84)throw new r("knowledge-graph:layer-support-utils","The extentToInBoundsRings function only supports WGS84 spatial references.");return e.clone().normalize().map((e=>[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]))}function S(e,t){const r=new Map;if(t.dataModel?.relationshipTypes)for(const o of t.dataModel.relationshipTypes)o.name&&r.set(o.name,[]);for(const o of e)r.has(o.typeName)&&r.get(o.typeName)?.push(o.id);return r}async function k(e,t){const r=[],o=S(e,t),n={},i=[];for(const[c,d]of o){if(d.length<1)continue;const e=`${c}_ids`;n[e]=d,i.push(`MATCH (n)-[r:${c}]->(m) WHERE id(r) in $${e} RETURN id(n), labels(n)[0], id(m), labels(m)[0]`)}if(0===i.length)return[];const a=i.join(" UNION "),s=new y({openCypherQuery:a,bindParameters:n}),l=(await m(t,s)).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await l.read();if(e)break;for(const o of t)r.push({id:o[0],typeName:o[1]}),r.push({id:o[2],typeName:o[3]})}return r}async function N(e,t){const r=new Map,o=S(e,t),n={},i=[];for(const[c,d]of o){if(d.length<1)continue;const e=`${c}_ids`;n[e]=d,i.push(`MATCH (n)-[r:${c}]->(m) WHERE id(r) in $${e} RETURN id(r), id(n), id(m)`)}if(0===i.length)return r;const a=i.join(" UNION "),s=new y({openCypherQuery:a,bindParameters:n}),l=(await m(t,s)).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await l.read();if(e)break;for(const o of t)r.set(o[0],[o[1],o[2]])}return r}async function F(e){const t=[],r={generateAllSublayers:!1,namedTypeDefinitions:new Map};return e.entitiesUrl&&t.push(P(e.entitiesUrl).then((e=>{q(e,r)}))),e.relationshipsUrl&&t.push(P(e.relationshipsUrl).then((e=>{q(e,r)}))),await Promise.all(t),r}async function G(e,t){t??=!1;const r={generateAllSublayers:t,namedTypeDefinitions:new Map};return await H(e).then((e=>{Y(e,r)})),r}async function D(e,t,r){const o=await g(),n=new o.FeatureCollection,i=new o.FeatureCollection;try{U(n,o,e,"entities",t,r),U(i,o,e,"relationships",t,r);const a=new o.FeatureCollectionEncoder,s=new o.FeatureCollectionEncoder,l=V(n,a),c=structuredClone(l),d=V(i,s),m={entitiesFC:c,relationshipsFC:structuredClone(d)};return a.delete(),s.delete(),m}finally{n.delete(),i.delete()}}async function j(e,t,r){const o=await g(),n=new o.FeatureCollection;try{U(n,o,e,"entities",t,r);const i=new o.FeatureCollectionEncoder,a=V(n,i),s=structuredClone(a);return i.delete(),s}finally{n.delete()}}async function O(e,t,r){const o=await g(),n=new o.FeatureCollection;try{U(n,o,e,"relationships",t,r);const i=new o.FeatureCollectionEncoder,a=V(n,i),s=structuredClone(a);return i.delete(),s}finally{n.delete()}}async function x(e){const t=await g(),o=new t.MapOfObjectIdentifierSets;v(o,t,e);const n=new t.MapOfObjectIdentifierSetsEncoder;try{n.set_map_of_identifier_sets(o),n.encode();const e=n.get_encoding_result();if(0!==e.error.error_code)throw new r("knowledge-graph:layer-support-utils",e.error.error_message);const t=structuredClone(e.get_byte_buffer());return n.delete(),t}finally{o.delete()}}function U(e,t,r,o,n,a){e.version="";const s=new t.QueryResult,l=new t.FeatureResult,c="entities"===o?f:p;l.unique_id_field={name:c[c.ELEMENTUID],isSystemMaintained:!1},l.globalid_field_name=c[c.ELEMENTUID],l.geohash_field_name="",l.geometry_properties={shapeAreaFieldName:"",shapeLengthFieldName:"",units:""},l.spatial_reference={wkid:4326,latestWkid:4326,vcsWkid:0,latestVcsWkid:0,wkt:""},l.exceeded_transfer_limit=!1,l.has_z=!1,l.has_m=!1,l.transform={quantizeOriginPosition:{value:_.upperLeft},scale:{xScale:1e-9,yScale:1e-9,mScale:1e-4,zScale:1e-4},translate:{xTranslate:-400,yTranslate:-400,mTranslate:-1e5,zTranslate:-1e5}};for(const i of Object.keys(c).filter((e=>isNaN(Number(e))))){const e=new t.Field;if(e.name=i,e.alias=i,e.sql_type={value:w.sqlTypeBigInt},"entities"===o)switch(i){case c[c.ELEMENTUID]:case c[c.TYPENAME]:e.field_type={value:h.esriFieldTypeString}}else switch(i){case c[c.ELEMENTUID]:case c[c.TYPENAME]:case p[p.FROMUID]:case p[p.TOUID]:e.field_type={value:h.esriFieldTypeString}}e.domain="",l.add_field(e),e.delete()}const d=new Map;for(const i of n.dataModel.entityTypes)d.set(i.name,"entities");for(const i of n.dataModel.relationshipTypes)d.set(i.name,"relationships");for(const[m,y]of r.namedTypeDefinitions)if(o===d.get(m))for(const e of y.members.values()){const r=new t.Feature;for(const i of Object.keys(c).filter((e=>isNaN(Number(e)))))if("entities"===o)switch(i){case c[c.ELEMENTUID]:r.add_attribute(e.id,t.esriFieldType.esriFieldTypeString);break;case c[c.TYPENAME]:r.add_attribute(m,t.esriFieldType.esriFieldTypeString)}else switch(i){case c[c.ELEMENTUID]:r.add_attribute(e.id,t.esriFieldType.esriFieldTypeString);break;case p[p.FROMUID]:r.add_attribute(a.has(e.id)?a.get(e.id)[0]:"",t.esriFieldType.esriFieldTypeString);break;case p[p.TOUID]:r.add_attribute(a.has(e.id)?a.get(e.id)[1]:"",t.esriFieldType.esriFieldTypeString);break;case c[c.TYPENAME]:r.add_attribute(m,t.esriFieldType.esriFieldTypeString)}let n;if(e.linkChartLocation&&"x"in e.linkChartLocation?n=i(e.linkChartLocation):e.linkChartLocation&&(n=e.linkChartLocation),e.linkChartLocation&&n){const e=new t.FeatureCollectionGeometry;let i=!1;switch(o){case"entities":e.geometry_type=t.esriGeometryType.esriGeometryPoint,i=!0;break;case"relationships":e.geometry_type=t.esriGeometryType.esriGeometryPolyline}e.coords=new Float64Array(n.coords),e.lengths=new Uint32Array(i?[1]:n.lengths),r.set_compressed_geometry(e),e.delete()}l.add_feature(r),r.delete()}switch(o){case"entities":l.geometry_type=t.esriGeometryType.esriGeometryPoint;break;case"relationships":l.geometry_type=t.esriGeometryType.esriGeometryPolyline}return s.set_feature_result(l),e.set_query_result(s),l.delete(),s.delete(),e}function v(e,t,r){for(const[o,n]of r.namedTypeDefinitions){if(!n.members||n.useAllData)continue;const r=n.members.keys();let i=!1,a=!0;const s=new t.ObjectIdArray,l=new t.StringArray,c=new t.GlobalIdArray,d=new t.IdentifierArray,m=new t.ObjectIdentifierSet;for(const e of r)a&&(i=!isNaN(Number(e)),a=!1),i?s.add_objectid(Number(e)):(l.add_string(e),c.add_globalid(e)),d.add_identifier(e);m.set_oid_array(s),m.set_string_array(l),m.set_globalid_array(c),m.set_identifier_array(d),s.delete(),l.delete(),c.delete(),d.delete(),e.put_identifier_set(o,m),m.delete()}return e}async function P(e){const r=await t(e,{responseType:"array-buffer"});return z(await r.data)}async function z(e){const t=new((await g()).FeatureCollectionDecoder),o=t.decode(new Uint8Array(e));if(0!==o.error_code)throw new r("knowledge-graph:layer-support-utils",o.error_message);const n=t.get_feature_collection(),i=T(n);return t.delete(),i}async function H(e){const r=await t(e,{responseType:"array-buffer"}),o=await r.data;return W(new Uint8Array(o))}async function W(e){const t=new((await g()).MapOfObjectIdentifierSetsDecoder),o=t.decode(new Uint8Array(e)),n=new Map;if(0!==o.error_code)throw new r("knowledge-graph:layer-support-utils",o.error_message);const i=t.get_map_of_identifier_sets(),a=i.keys,s=a.size();for(let l=0;l<s;l++){const e=a.get(l),t=i.query_identifier_set(e),o=[];if(t.id_array_type.value===b.GLOBALID_ARRAY){const e=t.get_globalid_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_globalid_at(t))}else if(t.id_array_type.value===b.IDENTIFIER_ARRAY){const e=t.get_identifier_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_identifier_at(t).toString())}else if(t.id_array_type.value===b.STRING_ARRAY){const e=t.get_string_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_string_at(t))}else{if(t.id_array_type.value!==b.OID_ARRAY)throw new r("knowledge-graph:layer-support-utils","Tried to encode an unexpected ID Array type.");{const e=t.get_oid_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_objectid_at(t).toString())}}n.set(e,o)}return t.delete(),n}function q(e,t){if(!e?.queryResult?.featureResult)return t;const r=e.queryResult.featureResult.fieldNameToAttributeIndexMap;for(const n of e.queryResult.featureResult.features){const e=n.attributes[r[u.TYPENAME]],i=o(t.namedTypeDefinitions,e,(()=>({useAllData:!1,members:new Map}))),s=n.attributes[r[u.ELEMENTUID]];if(n.compressedGeometry?.coords?.length>0){let e=n.compressedGeometry.lengths;"esriGeometryPoint"===n.compressedGeometry.geometryType&&(e=[]),i.members.set(s,{id:s,linkChartLocation:new a(e,n.compressedGeometry.coords)})}else i.members.set(s,{id:s})}return t}function Y(e,t){for(const[r,n]of e){const e=o(t.namedTypeDefinitions,r,(()=>({useAllData:!1,members:new Map})));for(const t of n)e.members.has(t)||e.members.set(t,{id:t})}return t}const $="ESRI__ChronologicalLayoutOverlay",B=()=>$,Q=t=>{const r=[],o={type:"CIMGeometricEffectCut",beginCut:3,endCut:3};for(const n of t.chronologicalAuxiliaryGraphics?.lines??[]){const t={type:"CIMSolidStroke",enable:!0,width:n.width,color:[n.color.r,n.color.g,n.color.b,Math.round(n.color.a/100*255)],effects:n.dashPattern.length>0?[{type:"CIMGeometricEffectDashes",dashTemplate:n.dashPattern,lineDashEnding:"NoConstraint"},o]:[o]},i={type:"CIMVectorMarker",enable:!0,size:10,frame:{xmin:-5,ymin:-5,xmax:0,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-12,-3.47],[-12,3.6],[-2.06,-.03],[-12,-3.47]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[n.color.r,n.color.g,n.color.b,Math.round(n.color.a/100*255)]}]}}],markerPlacement:{type:"CIMMarkerPlacementOnLine",angleToLine:!0,relativeTo:"LineEnd",offsetAlongLine:0}},a=new E({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:n.arrowheadSizeAtEnd?[t,i]:[t]}}});for(const o of n.elements){const t=new I({paths:[[[o.origin.x,o.origin.y],[o.destination.x,o.destination.y]]]});r.push(new e({geometry:t,symbol:a}))}}for(const n of t.chronologicalAuxiliaryGraphics?.polygons??[]){const t=new C({color:[n.color.r,n.color.g,n.color.b,n.color.a/100],style:"solid",outline:null});for(const o of n.elements){const n=new M({rings:[o.points.map((e=>[e.x,e.y]))]});r.push(new e({geometry:n,symbol:t}))}}for(const n of t.chronologicalAuxiliaryGraphics?.texts??[]){let t="middle",o="center";switch(n.direction?.value){case d.left:o="right";break;case d.right:o="left";break;case d.bottom:t="bottom"}for(const i of n.elements){const a=new R({color:[n.color.r,n.color.g,n.color.b,n.color.a/100],text:i.str,font:{size:n.height,weight:"bold"},verticalAlignment:t,horizontalAlignment:o}),s=new A({x:i.anchor.x,y:i.anchor.y});r.push(new e({geometry:s,symbol:a}))}}return new n({graphics:r,listMode:"hide",title:$,id:$})},V=(e,t)=>{t.set_feature_collection(e),t.encode();const o=t.get_encoding_result();if(0!==o.error.error_code)throw new r("knowledge-graph:layer-support-utils",o.error.error_message);return o.get_byte_buffer()},J=(e,t)=>{const r=new Map;for(const n of[...t.entityTypes??[],...t.relationshipTypes??[]])for(const e of n.properties??[])e.geometryType&&"esriGeometryNull"!==e.geometryType&&r.set(n.name,e.name??"");const o=c.getInstance();for(const n of e)o.writeToStore([n],l,r.get(n.typeName??"")??"")},K={"basic-grid":"SIMPLE","geographic-organic-standard":"GEOGRAPHIC","hierarchical-bottom-to-top":"HIERARCHICAL","hierarchical-top-to-bottom":"HIERARCHICAL","organic-community":"COMMUNITY","organic-fusiform":"FORCE_DIRECTED","organic-leaf-circle":"FORCE_DIRECTED","organic-standard":"FORCE_DIRECTED","radial-node-centric":"RADIAL_TREE","radial-root-centric":"RADIAL_TREE","tree-bottom-to-top":"SMART_TREE","tree-left-to-right":"SMART_TREE","tree-right-to-left":"SMART_TREE","tree-top-to-bottom":"SMART_TREE","chronological-mono-timeline":"CHRONOLOGICAL_SINGLE","chronological-multi-timeline":"CHRONOLOGICAL_MULTIPLE"},X=e=>K[e],Z=(e,t)=>{const r=e?.chronologicalLayoutSettings,o=e?.organicLayoutSettings;return{chronologicalLayoutSettings:null!==r?r:void 0,organicLayoutSettings:o?{idealEdgeLengthType:"absolute-value"===o.idealEdgeLengthType?s.ABSOLUTE:s.MULTIPLIER,repulsionRadiusMultiplier:o.autoRepulsionRadius?void 0:o.repulsionRadiusMultiplier,idealEdgeLength:null==o.idealEdgeLengthType?void 0:"absolute-value"===o.idealEdgeLengthType?o.absoluteIdealEdgeLength:o.multiplicativeIdealEdgeLength,computationBudgetTime:t}:void 0}},ee={fetchAndConvertSerializedLinkChart:e=>F(e)};export{q as addFeatureCollectionToInclusionDefinition,Y as addIdMapToInclusionDefinition,Z as convertLayoutSettingsJSON,X as convertLayoutTypeJSON,z as deserializeFeatureCollection,W as deserializeIdCollectionMap,L as extentToInBoundsRings,G as fetchAndConvertSerializedKgIdMap,F as fetchAndConvertSerializedLinkChart,P as fetchAndDeserializeFeatureCollection,H as fetchAndDeserializeIdCollectionMap,Q as getChronologicalOverlay,B as getDefaultChronologicalOverlayLayerId,k as getRelationshipEndNodeIds,N as getRelationshipEndNodeMap,ee as graphLayersSupportUtilsModuleWrapper,J as loadRecordsIntoLocalCache,D as serializeInclusionDefinitionToAllPbf,j as serializeInclusionDefinitionToEntitiesPbf,x as serializeInclusionDefinitionToIdCollectionsMapPbf,O as serializeInclusionDefinitionToRelationshipsPbf,U as setFeatureCollectionProperties};
@@ -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
- class t{constructor(t){this._store=t}destroy(){this._store.destroy()}get(t){return this._store.get(t)}put(t,s){this._store.put(t,s,s.values.byteLength+256)}}export{t as ElevationQueryTileCache};
5
+ class t{constructor(t){this._store=t}destroy(){this._store.destroy()}get(t){return this._store.get(t)}put(t,s){this._store.put(t,s)}}export{t as ElevationQueryTileCache};
@@ -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
- class a{constructor(a,t,s,e){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in a?(this.values=a.pixelData,this.width=a.width,this.height=a.height,this.noDataValue=a.noDataValue):(this.values=a,this.width=t,this.height=s,this.noDataValue=e)}get hasNoDataValues(){if(null==this._hasNoDataValues){const a=this.noDataValue;this._hasNoDataValues=this.values.includes(a)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(null!=this._minValue)return;const{noDataValue:a,values:t}=this;let s=1/0,e=-1/0,i=!0;for(const u of t)u===a?this._hasNoDataValues=!0:(s=u<s?u:s,e=u>e?u:e,i=!1);i?(this._minValue=0,this._maxValue=0):(this._minValue=s,this._maxValue=e>-3e38?e:0)}}export{a as ElevationTileData};
5
+ class a{constructor(a,t,s,e){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in a?(this.values=a.pixelData,this.width=a.width,this.height=a.height,this.noDataValue=a.noDataValue):(this.values=a,this.width=t,this.height=s,this.noDataValue=e)}get hasNoDataValues(){if(null==this._hasNoDataValues){const a=this.noDataValue;this._hasNoDataValues=this.values.includes(a)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}get cachedMemory(){return this.values.byteLength+256}_ensureBounds(){if(null!=this._minValue)return;const{noDataValue:a,values:t}=this;let s=1/0,e=-1/0,i=!0;for(const h of t)h===a?this._hasNoDataValues=!0:(s=h<s?h:s,e=h>e?h:e,i=!1);i?(this._minValue=0,this._maxValue=0):(this._minValue=s,this._maxValue=e>-3e38?e:0)}}export{a as ElevationTileData};
@@ -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"../../geometry.js";import{createScreenPoint as e}from"../../core/screenUtils.js";import{nameToId as t,OriginId as n}from"../../core/accessorSupport/PropertyOrigin.js";import{getInfo as o}from"../../geometry/support/spatialReferenceUtils.js";import r from"./ControlPointsGeoreference.js";import i from"./CornersGeoreference.js";import s from"./ExtentAndRotationGeoreference.js";import a from"./GeoreferenceBase.js";import c from"../../geometry/Extent.js";import p from"../../geometry/Point.js";const l=100,y=.5;async function m(e,t){e.loaded||await e.load();const{contentWidth:n,contentHeight:i}=e,{spatialReference:s}=t,a=o(s);let m=!1;if(a){const e=a.valid[1]-a.valid[0];t.width>e&&(t=new c({xmin:a.valid[0],ymin:t.ymin,xmax:a.valid[1],ymax:t.ymax,spatialReference:t.spatialReference}),m=!0)}const f=t.expand(y),{center:u,width:P,height:d}=f,x=m||n>i?P:n/i*d,w=m||n>i?i/n*P:d,g=u.x-x/2,h=u.x+x/2,R=u.y+w/2,j=u.y-w/2;return new r({controlPoints:[{sourcePoint:{x:l,y:i-l},mapPoint:new p({x:g,y:j,spatialReference:s})},{sourcePoint:{x:l,y:l},mapPoint:new p({x:g,y:R,spatialReference:s})},{sourcePoint:{x:n-l,y:l},mapPoint:new p({x:h,y:R,spatialReference:s})},{sourcePoint:{x:n-l,y:i-l},mapPoint:new p({x:h,y:j,spatialReference:s})}],width:n,height:i})}function f(e){const t=e.georeference;if("control-points"!==t.type)return null;const n={wkid:0},{width:o,height:i}=t,s=t.controlPoints;return new r({controlPoints:s.map((e=>{const{x:t,y:o}=e.sourcePoint;return{sourcePoint:{x:t,y:o},mapPoint:new p({x:t,y:i-o,spatialReference:n})}})),width:o,height:i})}function u(e){return"media"===e?.type}function P(e,o){const r=t(o);return u(e)&&!!e.portalItem&&null!=r&&r>n.PORTAL_ITEM}function d(t,n,o){if(!t||"control-points"===t.type)return t;const{coords:i}=t;if(5!==i?.rings[0]?.length)return null;const[s,a,c,l]=i.rings[0],{spatialReference:y}=i;return new r({controlPoints:[{mapPoint:new p({x:s[0],y:s[1],spatialReference:y}),sourcePoint:e(0,o)},{mapPoint:new p({x:a[0],y:a[1],spatialReference:y}),sourcePoint:e(0,0)},{mapPoint:new p({x:c[0],y:c[1],spatialReference:y}),sourcePoint:e(n,0)},{mapPoint:new p({x:l[0],y:l[1],spatialReference:y}),sourcePoint:e(n,o)}],width:n,height:o})}function x(e,t,n){return{enabled:!P(n?.layer,n?.origin),ignoreOrigin:!0}}const w={json:{name:"url",type:String,write:{overridePolicy:x}}},g={readOnly:!0,json:{read:!1,write:{target:"mediaType",overridePolicy:x}}},h={types:{key:"type",base:a,typeMap:{"control-points":r,corners:i,"extent-and-rotation":s}},json:{types:{key:"type",base:a,typeMap:{"control-points":r}},write:{overridePolicy:()=>({enabled:!0,ignoreOrigin:!0})}}};export{m as createDefaultControlPointsGeoreference,f as createLocalModeControlPointsGeoreference,P as isWritingLayerFromItemToWebDocument,w as mediaElementUrlProperty,h as mediaGeoreferenceProperty,g as mediaTypeProperty,d as toControlPointsGeoreference};
5
+ import"../../geometry.js";import{createScreenPoint as e}from"../../core/screenUtils.js";import{nameToId as t,OriginId as n}from"../../core/accessorSupport/PropertyOrigin.js";import{getInfo as o}from"../../geometry/support/spatialReferenceUtils.js";import r from"./ControlPointsGeoreference.js";import i from"./CornersGeoreference.js";import s from"./ExtentAndRotationGeoreference.js";import a from"./GeoreferenceBase.js";import c from"../../geometry/Extent.js";import p from"../../geometry/Point.js";const l=100,y=.5;async function m(e,t){e.loaded||await e.load();const{contentWidth:n,contentHeight:i}=e,{spatialReference:s}=t,a=o(s);let m=!1;if(a){const e=a.valid[1]-a.valid[0];t.width>e&&(t=new c({xmin:a.valid[0],ymin:t.ymin,xmax:a.valid[1],ymax:t.ymax,spatialReference:t.spatialReference}),m=!0)}const f=t.expand(y),{center:u,width:P,height:d}=f,x=n/i,w=m||x>1,g=w?l:l*x,h=w?l/x:l,R=w?P:d*x,j=w?P/x:d,v=u.x-R/2,O=u.x+R/2,b=u.y+j/2,G=u.y-j/2;return new r({controlPoints:[{sourcePoint:{x:g,y:i-h},mapPoint:new p({x:v,y:G,spatialReference:s})},{sourcePoint:{x:g,y:h},mapPoint:new p({x:v,y:b,spatialReference:s})},{sourcePoint:{x:n-g,y:h},mapPoint:new p({x:O,y:b,spatialReference:s})},{sourcePoint:{x:n-g,y:i-h},mapPoint:new p({x:O,y:G,spatialReference:s})}],width:n,height:i})}function f(e){const t=e.georeference;if("control-points"!==t.type)return null;const n={wkid:0},{width:o,height:i}=t,s=t.controlPoints;return new r({controlPoints:s.map((e=>{const{x:t,y:o}=e.sourcePoint;return{sourcePoint:{x:t,y:o},mapPoint:new p({x:t,y:i-o,spatialReference:n})}})),width:o,height:i})}function u(e){return"media"===e?.type}function P(e,o){const r=t(o);return u(e)&&!!e.portalItem&&null!=r&&r>n.PORTAL_ITEM}function d(t,n,o){if(!t||"control-points"===t.type)return t;const{coords:i}=t;if(5!==i?.rings[0]?.length)return null;const[s,a,c,l]=i.rings[0],{spatialReference:y}=i;return new r({controlPoints:[{mapPoint:new p({x:s[0],y:s[1],spatialReference:y}),sourcePoint:e(0,o)},{mapPoint:new p({x:a[0],y:a[1],spatialReference:y}),sourcePoint:e(0,0)},{mapPoint:new p({x:c[0],y:c[1],spatialReference:y}),sourcePoint:e(n,0)},{mapPoint:new p({x:l[0],y:l[1],spatialReference:y}),sourcePoint:e(n,o)}],width:n,height:o})}function x(e,t,n){return{enabled:!P(n?.layer,n?.origin),ignoreOrigin:!0}}const w={json:{name:"url",type:String,write:{overridePolicy:x}}},g={readOnly:!0,json:{read:!1,write:{target:"mediaType",overridePolicy:x}}},h={types:{key:"type",base:a,typeMap:{"control-points":r,corners:i,"extent-and-rotation":s}},json:{types:{key:"type",base:a,typeMap:{"control-points":r}},write:{overridePolicy:()=>({enabled:!0,ignoreOrigin:!0})}}};export{m as createDefaultControlPointsGeoreference,f as createLocalModeControlPointsGeoreference,P as isWritingLayerFromItemToWebDocument,w as mediaElementUrlProperty,h as mediaGeoreferenceProperty,g as mediaTypeProperty,d as toControlPointsGeoreference};
@@ -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{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import r from"./BaseRasterFunction.js";import o from"./ClipFunctionArguments.js";let i=class extends r{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this.rasterInfo=t,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}_getWebGLParameters(){const{clippingGeometry:t,clippingType:e}=this.functionArguments;return{clippingGeometry:t.toJSON(),clippingType:e}}};t([e({json:{write:!0,name:"rasterFunction"}})],i.prototype,"functionName",void 0),t([e({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],i.prototype,"functionArguments",void 0),t([e()],i.prototype,"rasterArgumentNames",void 0),t([e()],i.prototype,"isNoopProcess",void 0),i=t([s("esri.layers.support.rasterFunctions.ClipFunction")],i);const p=i;export{p as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import s from"./BaseRasterFunction.js";import o from"./ClipFunctionArguments.js";import{clipRasterInfo as i}from"./clipUtils.js";import{projectExtent as p,projectPolygon as n}from"./rasterProjectionHelper.js";let c=class extends s{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{functionArguments:e}=this,{clippingGeometry:r,clippingType:s}=e;if(!r)return{success:!1,supportsGPU:!1,error:"missing clipping geometry"};if("outside"===s)try{const{spatialReference:e}=t,s="extent"===r.type?p(r,e):n(r,e).extent;s&&i(t,s)}catch{}return{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}_getWebGLParameters(){const{clippingGeometry:t,clippingType:e}=this.functionArguments;return{clippingGeometry:t.toJSON(),clippingType:e}}};t([e({json:{write:!0,name:"rasterFunction"}})],c.prototype,"functionName",void 0),t([e({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],c.prototype,"functionArguments",void 0),t([e()],c.prototype,"rasterArgumentNames",void 0),t([e()],c.prototype,"isNoopProcess",void 0),c=t([r("esri.layers.support.rasterFunctions.ClipFunction")],c);const u=c;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{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import e from"../../../geometry/Extent.js";import i from"../PixelBlock.js";function n(e,i){if(e.spatialReference.equals(i))return e;const n=t(e.spatialReference),a=t(i);if(n===a)return e;const h=n/a;return{x:e.x*h,y:e.y*h}}async function a(t,e,n){if("extent"===n.type)return o(t,e,n);const{width:a,height:x}=t,l=new Uint8Array(a*x),{contains:m,intersects:s}=await import("../../../geometry/geometryEngine.js");return s(e,n)?"polyline"===n.type?r(t,e,n):m(n,e)?t:h(t,e,n):new i({pixelType:t.pixelType,width:a,height:x,mask:l,maskIsAlpha:!1,pixels:[...t.pixels]})}function h(t,e,n){if(!t)return t;const{width:a,height:h}=t,o=e.width/a,r=e.height/h,{xmin:x,ymax:l}=e;let m;if("extent"===n.type){const t=(n.xmin-x)/o,e=(n.xmax-x)/o,i=(l-n.ymax)/r,a=(l-n.ymin)/r;m=[[[t,i],[t,a],[e,a],[e,i],[t,i]]]}else m=n.rings.map((t=>t.map((([t,e])=>[(t-x)/o,(l-e)/r]))));const s=document.createElement("canvas");s.width=a,s.height=h;const p=s.getContext("2d");p.fillStyle="#f00",p.beginPath(),m.forEach((t=>{p.moveTo(t[0][0],t[0][1]);for(let e=0;e<t.length;e++)p.lineTo(t[e][0],t[e][1]);p.closePath()})),p.fill();const f=p.getImageData(0,0,a,h).data,y=t.mask,c=a*h,M=new Uint8Array(c);for(let i=0;i<c;i++)y&&!y[i]||(M[i]=f[4*i+3]>127?255:0);return new i({pixelType:t.pixelType,width:a,height:h,mask:M,maskIsAlpha:!1,pixels:[...t.pixels]})}function o(t,e,n){const{width:a,height:h}=t,o=new Uint8Array(a*h),r=e.width/a,x=e.height/h;if(n.width/r<.5||n.height/x<.5)return new i({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]});const{xmin:l,xmax:m,ymin:s,ymax:p}=e,{xmin:f,xmax:y,ymin:c,ymax:M}=n,u=Math.max(l,f),w=Math.min(m,y),d=Math.max(s,c),g=Math.min(p,M),T=.5*r,k=.5*x;if(w-u<T||g-d<k||w<l+T||u>m-T||d>p-k||g<s+k)return new i({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]});const A=Math.max(0,(u-l)/r),R=Math.min(a,Math.max(0,(w-l)/r)),U=Math.max(0,(p-g)/x),j=Math.min(h,Math.max(0,(p-d)/x)),E=Math.round(A),I=Math.round(R)-1,P=Math.round(U),v=Math.round(j)-1;if(E===I&&A%1>.5&&R%1<.5||P===v&&U%1>.5&&j%1<.5)return new i({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]});if(0===E&&0===P&&I===a&&v===h)return t;const b=t.mask;for(let i=P;i<=v;i++)for(let t=E;t<=I;t++){const e=i*a+t;o[e]=b?b[e]:255}return new i({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]})}function r(t,e,n){const{width:a,height:h}=t,o=new Uint8Array(a*h),r=e.width/a,x=e.height/h,{xmin:l,ymax:m}=e,{paths:s}=n,p=t.mask;for(let i=0;i<s.length;i++){const t=s[i];for(let e=0;e<t.length-1;e++){const[i,n]=t[e],[s,f]=t[e+1];let y=Math.floor((m-n)/x),c=Math.floor((m-f)/x);if(c<y){const t=y;y=c,c=t}y=Math.max(0,y),c=Math.min(h-1,c);const M=(s-i)/(f-n);for(let t=y;t<=c;t++){const e=t===y?Math.max(n,f):(h+1-t)*x,m=t===c?Math.min(n,f):e-x;let u=f===n?Math.floor((i-l)/r):Math.floor((M*(e-n)+i-l)/r),w=f===n?Math.floor((s-l)/r):Math.floor((M*(m-n)+i-l)/r);if(w<u){const t=u;u=w,w=t}const d=t*a;u=Math.max(0,u),w=Math.min(a-1,w);for(let t=d+u;t<=d+w;t++)o[t]=p?p[t]:255}}}return new i({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]})}function x(t,i,a,h=!0){const{spatialReference:o}=t,{x:r,y:x}=n(a,o);let l,m,s;const p="extent"===i.type?i:i.extent;let{xmin:f,xmax:y,ymax:c,ymin:M}=p;const{xmin:u,ymax:w}=t.extent;return h?(f=u+(f>u?r*Math.round((f-u)/r):0),c=w-(c<w?x*Math.round((w-c)/x):0),y=u+(y>u?r*Math.round((y-u)/r):0),M=w-(M<w?x*Math.round((w-M)/x):0),l=new e({xmin:f,ymax:c,xmax:y,ymin:M,spatialReference:o}),m=Math.round(l.width/r),s=Math.round(l.height/x)):(m=Math.floor((y-f)/r+.8),s=Math.floor((c-M)/x+.8),f=u+(f>u?r*Math.floor((f-u)/r+.1):0),c=w-(c<w?x*Math.floor((w-c)/x+.1):0),y=f+m*r,M=c-s*x,l=new e({xmin:f,ymax:c,xmax:y,ymin:M,spatialReference:o})),{extent:l,width:m,height:s}}export{a as clip,x as snapToRaster};
5
+ import{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import e from"../../../geometry/Extent.js";import i from"../../../geometry/Point.js";import n from"../PixelBlock.js";function a(e,i){if(e.spatialReference.equals(i))return e;const n=t(e.spatialReference),a=t(i);if(n===a)return e;const h=n/a;return{x:e.x*h,y:e.y*h}}async function h(t,e,i){if("extent"===i.type)return o(t,e,i);const{width:a,height:h}=t,m=new Uint8Array(a*h),{contains:l,intersects:s}=await import("../../../geometry/geometryEngine.js");return s(e,i)?"polyline"===i.type?r(t,e,i):l(i,e)?t:x(t,e,i):new n({pixelType:t.pixelType,width:a,height:h,mask:m,maskIsAlpha:!1,pixels:[...t.pixels]})}function x(t,e,i){if(!t)return t;const{width:a,height:h}=t,x=e.width/a,o=e.height/h,{xmin:r,ymax:m}=e;let l;if("extent"===i.type){const t=(i.xmin-r)/x,e=(i.xmax-r)/x,n=(m-i.ymax)/o,a=(m-i.ymin)/o;l=[[[t,n],[t,a],[e,a],[e,n],[t,n]]]}else l=i.rings.map((t=>t.map((([t,e])=>[(t-r)/x,(m-e)/o]))));const s=document.createElement("canvas");s.width=a,s.height=h;const p=s.getContext("2d");p.fillStyle="#f00",p.beginPath(),l.forEach((t=>{p.moveTo(t[0][0],t[0][1]);for(let e=0;e<t.length;e++)p.lineTo(t[e][0],t[e][1]);p.closePath()})),p.fill();const y=p.getImageData(0,0,a,h).data,f=t.mask,c=a*h,M=new Uint8Array(c);for(let n=0;n<c;n++)f&&!f[n]||(M[n]=y[4*n+3]>127?255:0);return new n({pixelType:t.pixelType,width:a,height:h,mask:M,maskIsAlpha:!1,pixels:[...t.pixels]})}function o(t,e,i){const{width:a,height:h}=t,x=new Uint8Array(a*h),o=e.width/a,r=e.height/h;if(i.width/o<.5||i.height/r<.5)return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]});const{xmin:m,xmax:l,ymin:s,ymax:p}=e,{xmin:y,xmax:f,ymin:c,ymax:M}=i,u=Math.max(m,y),d=Math.min(l,f),w=Math.max(s,c),g=Math.min(p,M),T=.5*o,k=.5*r;if(d-u<T||g-w<k||d<m+T||u>l-T||w>p-k||g<s+k)return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]});const R=Math.max(0,(u-m)/o),A=Math.min(a,Math.max(0,(d-m)/o)),j=Math.max(0,(p-g)/r),U=Math.min(h,Math.max(0,(p-w)/r)),E=Math.round(R),P=Math.round(A)-1,S=Math.round(j),z=Math.round(U)-1;if(E===P&&R%1>.5&&A%1<.5||S===z&&j%1>.5&&U%1<.5)return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]});if(0===E&&0===S&&P===a&&z===h)return t;const I=t.mask;for(let n=S;n<=z;n++)for(let t=E;t<=P;t++){const e=n*a+t;x[e]=I?I[e]:255}return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]})}function r(t,e,i){const{width:a,height:h}=t,x=new Uint8Array(a*h),o=e.width/a,r=e.height/h,{xmin:m,ymax:l}=e,{paths:s}=i,p=t.mask;for(let n=0;n<s.length;n++){const t=s[n];for(let e=0;e<t.length-1;e++){const[i,n]=t[e],[s,y]=t[e+1];let f=Math.floor((l-n)/r),c=Math.floor((l-y)/r);if(c<f){const t=f;f=c,c=t}f=Math.max(0,f),c=Math.min(h-1,c);const M=(s-i)/(y-n);for(let t=f;t<=c;t++){const e=t===f?Math.max(n,y):(h+1-t)*r,l=t===c?Math.min(n,y):e-r;let u=y===n?Math.floor((i-m)/o):Math.floor((M*(e-n)+i-m)/o),d=y===n?Math.floor((s-m)/o):Math.floor((M*(l-n)+i-m)/o);if(d<u){const t=u;u=d,d=t}const w=t*a;u=Math.max(0,u),d=Math.min(a-1,d);for(let t=w+u;t<=w+d;t++)x[t]=p?p[t]:255}}}return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]})}function m(t,e){const{extent:n}=l(t,e,new i({x:t.pixelSize.x,y:t.pixelSize.y,spatialReference:t.spatialReference})),{extent:a}=t.extent;if(n.xmax=Math.min(n.xmax,a.xmax),n.ymax=Math.min(n.ymax,a.ymax),n.xmin<n.xmax&&n.ymin<n.ymax){const{x:e,y:i}=t.pixelSize,a=Math.round(n.width/e),h=Math.round(n.height/i);t.extent=n,t.width=a,t.height=h}}function l(t,i,n,h=!0){const{spatialReference:x}=t,{x:o,y:r}=a(n,x);let m,l,s;const p="extent"===i.type?i:i.extent;let{xmin:y,xmax:f,ymax:c,ymin:M}=p;const{xmin:u,ymax:d}=t.extent;return h?(y=u+(y>u?o*Math.round((y-u)/o):0),c=d-(c<d?r*Math.round((d-c)/r):0),f=u+(f>u?o*Math.round((f-u)/o):0),M=d-(M<d?r*Math.round((d-M)/r):0),m=new e({xmin:y,ymax:c,xmax:f,ymin:M,spatialReference:x}),l=Math.round(m.width/o),s=Math.round(m.height/r)):(l=Math.floor((f-y)/o+.8),s=Math.floor((c-M)/r+.8),y=u+(y>u?o*Math.floor((y-u)/o+.1):0),c=d-(c<d?r*Math.floor((d-c)/r+.1):0),f=y+l*o,M=c-s*r,m=new e({xmin:y,ymax:c,xmax:f,ymin:M,spatialReference:x})),{extent:m,width:l,height:s}}export{h as clip,m as clipRasterInfo,l as snapToRaster};
@@ -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"../PixelBlock.js";import{localTrigonometricOperation as e,localLogicalOperation as n,localConditionalOperation as r}from"../rasterFunctionConstants.js";import{fixNaN as o,clipBandToPixelTypeRange as s}from"../rasterFormats/pixelRangeUtils.js";const a=new Map([[e.acos,{domain:[0,Math.PI],isInteger:!1}],[e.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[e.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[e.cos,{domain:[-1,1],isInteger:!1}],[e.sin,{domain:[-1,1],isInteger:!1}],[n.booleanAnd,{domain:[0,1],isInteger:!0}],[n.booleanNot,{domain:[0,1],isInteger:!0}],[n.booleanOr,{domain:[0,1],isInteger:!0}],[n.booleanXOr,{domain:[0,1],isInteger:!0}],[n.equalTo,{domain:[0,1],isInteger:!0}],[n.notEqual,{domain:[0,1],isInteger:!0}],[n.greaterThan,{domain:[0,1],isInteger:!0}],[n.greaterThanEqual,{domain:[0,1],isInteger:!0}],[n.lessThan,{domain:[0,1],isInteger:!0}],[n.lessThanEqual,{domain:[0,1],isInteger:!0}],[n.isNull,{domain:[0,1],isInteger:!0}]]);function l(t){return a.get(t)}const c=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function f(t,e=!1){const n=t.map((t=>t.mask)),r=n.filter((t=>null!=t)),o=t[0].pixels[0].length;if(0===r.length||e&&r.length!==n.length)return new Uint8Array(o).fill(255);const s=r[0],a=new Uint8Array(s);if(1===r.length)return a;if(!e){for(let t=1;t<r.length;t++){const e=r[t];for(let t=0;t<a.length;t++)a[t]&&(a[t]=e[t]?255:0)}return a}for(let l=1;l<r.length;l++){const t=r[l];for(let e=0;e<a.length;e++)0===a[e]&&(a[e]=t[e]?255:0)}return a}function i(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]+s[t]);return l}function u(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand("f32",s);return a.set(o),a}function h(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=o[t]*o[t]);return a}function g(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]-s[t]);return l}function p(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]*s[t]);return l}function m(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=Math.sign(o[t])*Math.floor(Math.abs(o[t])));return a}function d(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]/s[t]);return l}function y(t,e,n){return d(t,e,"f32")}function E(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=Math.floor(o[t]/s[t]));return l}function M(n,r,o,s){const a=n[0],l=a.length,c=t.createEmptyBand(o,l);if(s===e.atanh){for(let t=0;t<l;t++)if(r[t]){const e=a[t];Math.abs(e)>=1?r[t]=0:c[t]=Math.atanh(e)}return c}const f=s===e.asin?Math.asin:Math.acos;for(let t=0;t<l;t++)if(r[t]){const e=a[t];Math.abs(e)>1?r[t]=0:c[t]=f(e)}return c}function B(e,n,r,o){const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o(s[t]));return l}function I(e,n,r,o){const[s,a]=e,l=s.length,c=t.createEmptyBand(r,l);for(let t=0;t<l;t++)n&&!n[t]||(c[t]=o(s[t],a[t]));return c}function w(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]&s[t]);return l}function x(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]<<s[t]);return l}function b(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=~o[t]);return a}function A(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]|s[t]);return l}function P(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]>>s[t]);return l}function T(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]^s[t]);return l}function k(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]&&s[t]?1:0);return l}function q(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=o[t]?0:1);return a}function N(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]||s[t]?1:0);return l}function U(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=(o[t]?1:0)^(s[t]?1:0));return l}function F(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]===s[t]?1:0);return l}function j(e,n,r,o){const[s]=e,a=s.length,l=t.createEmptyBand(r,a),c=o===Math.E;for(let t=0;t<a;t++)n&&!n[t]||(l[t]=c?Math.exp(s[t]):o**s[t]);return l}function z(t,e,n){return j(t,e,n,10)}function O(t,e,n){return j(t,e,n,2)}function C(t,e,n){return j(t,e,n,Math.E)}function R(e,n,r,o){const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(s[t]<=0?n[t]=0:l[t]=o(s[t]));return l}function S(t,e,n){return R(t,e,n,Math.log10)}function X(t,e,n){return R(t,e,n,Math.log2)}function v(t,e,n){return R(t,e,n,Math.log)}function D(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]>s[t]?1:0);return l}function G(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]>=s[t]?1:0);return l}function H(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]<s[t]?1:0);return l}function J(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]<=s[t]?1:0);return l}function K(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);if(!n)return a;for(let t=0;t<s;t++)a[t]=n[t]?0:1;return a}function L(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]%s[t]);return l}function Q(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=-o[t]);return a}function V(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]===s[t]?0:1);return l}function W(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a),c=new Uint8Array(a);for(let t=0;t<a;t++)null!=n&&!n[t]||0!==o[t]||(l[t]=s[t],c[t]=255);return{band:l,mask:c}}function Y(e,n,r){const[o,s,a]=e,l=o.length,c=t.createEmptyBand(r,l);for(let t=0;t<l;t++)n&&!n[t]||(c[t]=o[t]?s[t]:a[t]);return c}function Z(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=s[t];for(let r=1;r<o;r++){const o=e[r][t];n<o&&(n=o)}l[t]=n}return l}function $(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=s[t];for(let r=1;r<o;r++){const o=e[r][t];n>o&&(n=o)}l[t]=n}return l}function _(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=s[t],r=n;for(let s=1;s<o;s++){const o=e[s][t];r<o?r=o:n>o&&(n=o)}l[t]=r-n}return l}function tt(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=0;for(let r=0;r<o;r++)n+=e[r][t];l[t]=n/o}return l}function et(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t])for(let n=0;n<o;n++){const r=e[n];l[t]+=r[t]}return l}function nt(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){const n=new Float32Array(o);let r=0;for(let a=0;a<o;a++){const o=e[a];r+=o[t],n[a]=o[t]}r/=o;let s=0;for(let t=0;t<o;t++)s+=(n[t]-r)**2;l[t]=Math.sqrt(s/o)}return l}function rt(e,n,r){const o=e.length;if(o<2)return e[0];const s=Math.floor(o/2),[a]=e,l=a.length,c=t.createEmptyBand(r,l),f=new Float32Array(o),i=o%2==1;for(let t=0;t<l;t++)if(!n||n[t]){for(let n=0;n<o;n++)f[n]=e[n][t];f.sort(),c[t]=i?f[s]:(f[s]+f[s-1])/2}return c}function ot(e,n,r){const[o,s]=e;if(null==s)return o;const a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n[t]&&(o[t]===s[t]?l[t]=o[t]:n[t]=0);return l}function st(e,n,r){const o=e.length;if(o<=2)return ot(e,n,r);const s=e[0].length,a=t.createEmptyBand(r,s),l=new Map;for(let t=0;t<s;t++)if(!n||n[t]){let n;l.clear();for(let a=0;a<o;a++)n=e[a][t],l.set(n,l.has(n)?l.get(n)+1:1);let r=0,s=0;for(const t of l.keys())r=l.get(t),r>s&&(s=r,n=t);a[t]=n}return a}function at(e,n,r){const o=e.length;if(o<=2)return ot(e,n,r);const s=e[0].length,a=t.createEmptyBand(r,s),l=new Map;for(let t=0;t<s;t++)if(!n||n[t]){let n;l.clear();for(let a=0;a<o;a++)n=e[a][t],l.set(n,l.has(n)?l.get(n)+1:1);let r=0,s=e.length;for(const t of l.keys())r=l.get(t),r<s&&(s=r,n=t);a[t]=n}return a}function lt(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a),c=new Set;for(let t=0;t<a;t++)if(!n||n[t]){let n;c.clear();for(let r=0;r<o;r++)n=e[r][t],c.add(n);l[t]=c.size}return l}const ct=new Map,ft=new Map,it=new Map,ut=new Map;function ht(){ct.size||(ct.set(4,Math.sqrt),ct.set(6,Math.acos),ct.set(7,Math.asin),ct.set(8,Math.atan),ct.set(9,Math.atanh),ct.set(10,Math.abs),ct.set(21,Math.cos),ct.set(22,Math.cosh),ct.set(48,Math.floor),ct.set(49,Math.ceil),ct.set(51,Math.sin),ct.set(52,Math.sinh),ct.set(56,Math.tan),ct.set(57,Math.tanh),ct.set(59,Math.acosh),ct.set(60,Math.asinh),ct.set(65,Math.floor),ft.set(5,Math.pow),ft.set(61,Math.atan2),it.set(1,i),it.set(2,g),it.set(3,p),it.set(11,w),it.set(12,x),it.set(13,b),it.set(14,A),it.set(15,P),it.set(16,T),it.set(17,k),it.set(18,q),it.set(19,N),it.set(20,U),it.set(23,d),it.set(24,F),it.set(25,C),it.set(26,z),it.set(27,O),it.set(28,D),it.set(29,G),it.set(30,m),it.set(31,K),it.set(32,u),it.set(33,H),it.set(34,J),it.set(35,v),it.set(36,S),it.set(37,X),it.set(44,L),it.set(45,Q),it.set(46,V),it.set(53,h),it.set(64,y),it.set(65,E),it.set(76,Y),it.set(78,Y),ut.set(38,st),ut.set(39,Z),ut.set(40,tt),ut.set(41,rt),ut.set(42,$),ut.set(43,at),ut.set(47,_),ut.set(54,nt),ut.set(55,et),ut.set(58,lt),ut.set(66,st),ut.set(67,Z),ut.set(68,tt),ut.set(69,rt),ut.set(70,$),ut.set(71,at),ut.set(72,_),ut.set(73,nt),ut.set(74,et),ut.set(75,lt))}function gt(l,c,i={}){ht();let u=f(l,c>=66&&c<=75);const{outputPixelType:h="f32"}=i,g=!ut.has(c)||i.processAsMultiband,p=g?l[0].pixels.length:1,m=[];for(let f=0;f<p;f++){const i=ut.has(c)&&!g?l.flatMap((t=>t.pixels)):l.map((t=>t.pixels[f]));let p,d=!0;if(c===r.setNull){const t=W(i,u,h);p=t.band,u=t.mask,d=!1}else if(it.has(c)){p=it.get(c)(i,u,"f64")}else if(ct.has(c))p=c===e.asin||c===e.acos||c===e.atanh?M(i,u,"f64",c):B(i,u,"f64",ct.get(c));else if(ft.has(c))p=I(i,u,"f64",ft.get(c));else if(ut.has(c)){p=ut.get(c)(i,u,"f64")}else p=i[0],d=!1;if(d&&c!==n.isNull&&!a.has(c)){const e=t.createEmptyBand(h,p.length);u||(u=new Uint8Array(p.length).fill(255)),o(p,u),s(p,u,h,e),p=e}m.push(p)}const d=l[0];return new t({width:d.width,height:d.height,pixelType:h,mask:c===n.isNull?null:u,pixels:m})}function pt(t,e,n){return gt(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:n})}export{pt as arithmetic,l as getOutputDomain,gt as local,c as operandsCount};
5
+ import t from"../PixelBlock.js";import{localTrigonometricOperation as e,localLogicalOperation as n,localConditionalOperation as r}from"../rasterFunctionConstants.js";import{fixNaN as o,clipBandToPixelTypeRange as s}from"../rasterFormats/pixelRangeUtils.js";const a=new Map([[e.acos,{domain:[0,Math.PI],isInteger:!1}],[e.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[e.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[e.cos,{domain:[-1,1],isInteger:!1}],[e.sin,{domain:[-1,1],isInteger:!1}],[n.booleanAnd,{domain:[0,1],isInteger:!0}],[n.booleanNot,{domain:[0,1],isInteger:!0}],[n.booleanOr,{domain:[0,1],isInteger:!0}],[n.booleanXOr,{domain:[0,1],isInteger:!0}],[n.equalTo,{domain:[0,1],isInteger:!0}],[n.notEqual,{domain:[0,1],isInteger:!0}],[n.greaterThan,{domain:[0,1],isInteger:!0}],[n.greaterThanEqual,{domain:[0,1],isInteger:!0}],[n.lessThan,{domain:[0,1],isInteger:!0}],[n.lessThanEqual,{domain:[0,1],isInteger:!0}],[n.isNull,{domain:[0,1],isInteger:!0}]]);function l(t){return a.get(t)}const c=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function f(t,e=!1){const n=t.map((t=>t.mask)),r=n.filter((t=>null!=t)),o=t[0].pixels[0].length;if(0===r.length||e&&r.length!==n.length)return new Uint8Array(o).fill(255);const s=r[0],a=new Uint8Array(s);if(1===r.length)return a;if(!e){for(let t=1;t<r.length;t++){const e=r[t];for(let t=0;t<a.length;t++)a[t]&&(a[t]=e[t]?255:0)}return a}for(let l=1;l<r.length;l++){const t=r[l];for(let e=0;e<a.length;e++)0===a[e]&&(a[e]=t[e]?255:0)}return a}function i(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]+s[t]);return l}function u(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand("f32",s);return a.set(o),a}function h(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=o[t]*o[t]);return a}function g(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]-s[t]);return l}function p(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]*s[t]);return l}function m(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=Math.sign(o[t])*Math.floor(Math.abs(o[t])));return a}function d(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]/s[t]);return l}function y(t,e,n){return d(t,e,"f32")}function E(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=Math.floor(o[t]/s[t]));return l}function M(n,r,o,s){const a=n[0],l=a.length,c=t.createEmptyBand(o,l);if(s===e.atanh){for(let t=0;t<l;t++)if(r[t]){const e=a[t];Math.abs(e)>=1?r[t]=0:c[t]=Math.atanh(e)}return c}const f=s===e.asin?Math.asin:Math.acos;for(let t=0;t<l;t++)if(r[t]){const e=a[t];Math.abs(e)>1?r[t]=0:c[t]=f(e)}return c}function B(e,n,r,o){const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o(s[t]));return l}function I(e,n,r,o){const[s,a]=e,l=s.length,c=t.createEmptyBand(r,l);for(let t=0;t<l;t++)n&&!n[t]||(c[t]=o(s[t],a[t]));return c}function w(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]&s[t]);return l}function x(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]<<s[t]);return l}function b(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=~o[t]);return a}function A(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]|s[t]);return l}function P(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]>>s[t]);return l}function T(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]^s[t]);return l}function k(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]&&s[t]?1:0);return l}function q(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=o[t]?0:1);return a}function N(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]||s[t]?1:0);return l}function U(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=(o[t]?1:0)^(s[t]?1:0));return l}function F(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]===s[t]?1:0);return l}function j(e,n,r,o){const[s]=e,a=s.length,l=t.createEmptyBand(r,a),c=o===Math.E;for(let t=0;t<a;t++)n&&!n[t]||(l[t]=c?Math.exp(s[t]):o**s[t]);return l}function z(t,e,n){return j(t,e,n,10)}function O(t,e,n){return j(t,e,n,2)}function C(t,e,n){return j(t,e,n,Math.E)}function R(e,n,r,o){const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(s[t]<=0?n[t]=0:l[t]=o(s[t]));return l}function S(t,e,n){return R(t,e,n,Math.log10)}function X(t,e,n){return R(t,e,n,Math.log2)}function v(t,e,n){return R(t,e,n,Math.log)}function D(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]>s[t]?1:0);return l}function G(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]>=s[t]?1:0);return l}function H(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]<s[t]?1:0);return l}function J(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]<=s[t]?1:0);return l}function K(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);if(!n)return a;for(let t=0;t<s;t++)a[t]=n[t]?0:1;return a}function L(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]%s[t]);return l}function Q(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=-o[t]);return a}function V(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]===s[t]?0:1);return l}function W(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a),c=new Uint8Array(a);for(let t=0;t<a;t++)null!=n&&!n[t]||0!==o[t]||(l[t]=s[t],c[t]=255);return{band:l,mask:c}}function Y(e,n,r){const[o,s,a]=e,l=o.length,c=t.createEmptyBand(r,l);for(let t=0;t<l;t++)n&&!n[t]||(c[t]=o[t]?s[t]:a[t]);return c}function Z(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=s[t];for(let r=1;r<o;r++){const o=e[r][t];n<o&&(n=o)}l[t]=n}return l}function $(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=s[t];for(let r=1;r<o;r++){const o=e[r][t];n>o&&(n=o)}l[t]=n}return l}function _(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=s[t],r=n;for(let s=1;s<o;s++){const o=e[s][t];r<o?r=o:n>o&&(n=o)}l[t]=r-n}return l}function tt(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=0;for(let r=0;r<o;r++)n+=e[r][t];l[t]=n/o}return l}function et(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t])for(let n=0;n<o;n++){const r=e[n];l[t]+=r[t]}return l}function nt(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){const n=new Float32Array(o);let r=0;for(let a=0;a<o;a++){const o=e[a];r+=o[t],n[a]=o[t]}r/=o;let s=0;for(let t=0;t<o;t++)s+=(n[t]-r)**2;l[t]=Math.sqrt(s/o)}return l}function rt(e,n,r){const o=e.length;if(o<2)return e[0];const s=Math.floor(o/2),[a]=e,l=a.length,c=t.createEmptyBand(r,l),f=new Float32Array(o),i=o%2==1;for(let t=0;t<l;t++)if(!n||n[t]){for(let n=0;n<o;n++)f[n]=e[n][t];f.sort(),c[t]=i?f[s]:(f[s]+f[s-1])/2}return c}function ot(e,n,r){const[o,s]=e;if(null==s)return o;const a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]<s[t]?o[t]:s[t]);return l}function st(e,n,r){const o=e.length;if(o<=2)return ot(e,n,r);const s=e[0].length,a=t.createEmptyBand(r,s),l=new Map;for(let t=0;t<s;t++)if(!n||n[t]){l.clear();for(let a=0;a<o;a++){const n=e[a][t];l.set(n,l.has(n)?l.get(n)+1:1)}let n=0,r=0;const s=[];for(const t of l.keys())n=l.get(t),n>r?(r=n,s.length=0,s.push(t)):n===r&&s.push(t);s.length>1&&s.sort(((t,e)=>t-e)),a[t]=s[0]}return a}function at(e,n,r){const o=e.length;if(o<=2)return ot(e,n,r);const s=e[0].length,a=t.createEmptyBand(r,s),l=new Map;for(let t=0;t<s;t++)if(!n||n[t]){l.clear();for(let a=0;a<o;a++){const n=e[a][t];l.set(n,l.has(n)?l.get(n)+1:1)}let n=0,r=e.length;const s=[];for(const t of l.keys())n=l.get(t),n<r?(r=n,s.length=0,s.push(t)):n===r&&s.push(t);s.length>1&&s.sort(((t,e)=>t-e)),a[t]=s[0]}return a}function lt(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a),c=new Set;for(let t=0;t<a;t++)if(!n||n[t]){let n;c.clear();for(let r=0;r<o;r++)n=e[r][t],c.add(n);l[t]=c.size}return l}const ct=new Map,ft=new Map,it=new Map,ut=new Map;function ht(){ct.size||(ct.set(4,Math.sqrt),ct.set(6,Math.acos),ct.set(7,Math.asin),ct.set(8,Math.atan),ct.set(9,Math.atanh),ct.set(10,Math.abs),ct.set(21,Math.cos),ct.set(22,Math.cosh),ct.set(48,Math.floor),ct.set(49,Math.ceil),ct.set(51,Math.sin),ct.set(52,Math.sinh),ct.set(56,Math.tan),ct.set(57,Math.tanh),ct.set(59,Math.acosh),ct.set(60,Math.asinh),ct.set(65,Math.floor),ft.set(5,Math.pow),ft.set(61,Math.atan2),it.set(1,i),it.set(2,g),it.set(3,p),it.set(11,w),it.set(12,x),it.set(13,b),it.set(14,A),it.set(15,P),it.set(16,T),it.set(17,k),it.set(18,q),it.set(19,N),it.set(20,U),it.set(23,d),it.set(24,F),it.set(25,C),it.set(26,z),it.set(27,O),it.set(28,D),it.set(29,G),it.set(30,m),it.set(31,K),it.set(32,u),it.set(33,H),it.set(34,J),it.set(35,v),it.set(36,S),it.set(37,X),it.set(44,L),it.set(45,Q),it.set(46,V),it.set(53,h),it.set(64,y),it.set(65,E),it.set(76,Y),it.set(78,Y),ut.set(38,st),ut.set(39,Z),ut.set(40,tt),ut.set(41,rt),ut.set(42,$),ut.set(43,at),ut.set(47,_),ut.set(54,nt),ut.set(55,et),ut.set(58,lt),ut.set(66,st),ut.set(67,Z),ut.set(68,tt),ut.set(69,rt),ut.set(70,$),ut.set(71,at),ut.set(72,_),ut.set(73,nt),ut.set(74,et),ut.set(75,lt))}function gt(l,c,i={}){ht();let u=f(l,c>=66&&c<=75);const{outputPixelType:h="f32"}=i,g=!ut.has(c)||i.processAsMultiband,p=g?l[0].pixels.length:1,m=[];for(let f=0;f<p;f++){const i=ut.has(c)&&!g?l.flatMap((t=>t.pixels)):l.map((t=>t.pixels[f]));let p,d=!0;if(c===r.setNull){const t=W(i,u,h);p=t.band,u=t.mask,d=!1}else if(it.has(c)){p=it.get(c)(i,u,"f64")}else if(ct.has(c))p=c===e.asin||c===e.acos||c===e.atanh?M(i,u,"f64",c):B(i,u,"f64",ct.get(c));else if(ft.has(c))p=I(i,u,"f64",ft.get(c));else if(ut.has(c)){p=ut.get(c)(i,u,"f64")}else p=i[0],d=!1;if(d&&c!==n.isNull&&!a.has(c)){const e=t.createEmptyBand(h,p.length);u||(u=new Uint8Array(p.length).fill(255)),o(p,u),s(p,u,h,e),p=e}m.push(p)}const d=l[0];return new t({width:d.width,height:d.height,pixelType:h,mask:c===n.isNull?null:u,pixels:m})}function pt(t,e,n){return gt(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:n})}export{pt as arithmetic,l as getOutputDomain,gt as local,c as operandsCount};
@@ -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{ClonableMixin as o}from"../core/Clonable.js";import{MultiOriginJSONSupport as r}from"../core/MultiOriginJSONSupport.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{layoutTypes as i}from"./enums.js";import p from"./LayoutSettings.js";import a from"./NonspatialDataDisplay.js";let l=class extends(o(r)){constructor(t){super(t),this.aggregatedEntitiesUrl=null,this.aggregatedRelationshipsUrl=null,this.autoCollapseRelationships=!0,this.centralityIsUpToDate=!0,this.entitiesUrl=null,this.layoutSettings=null,this.layoutType="organic-standard",this.nonspatialDataDisplay=null,this.relationshipsUrl=null}};t([e({type:String,json:{write:!0}})],l.prototype,"aggregatedEntitiesUrl",void 0),t([e({type:String,json:{write:!0}})],l.prototype,"aggregatedRelationshipsUrl",void 0),t([e({type:Boolean,json:{write:!0}})],l.prototype,"autoCollapseRelationships",void 0),t([e({type:Boolean,json:{write:!0}})],l.prototype,"centralityIsUpToDate",void 0),t([e({type:String,json:{write:!0}})],l.prototype,"entitiesUrl",void 0),t([e({type:p,json:{write:!0}})],l.prototype,"layoutSettings",void 0),t([e({type:i,json:{write:!0}})],l.prototype,"layoutType",void 0),t([e({type:a,json:{write:!0}})],l.prototype,"nonspatialDataDisplay",void 0),t([e({type:String,json:{write:!0}})],l.prototype,"relationshipsUrl",void 0),l=t([s("esri.linkChart.LinkChartProperties")],l);const n=l;export{n as default};
5
+ import{_ as t}from"../chunks/tslib.es6.js";import{ClonableMixin as e}from"../core/Clonable.js";import{MultiOriginJSONSupport as r}from"../core/MultiOriginJSONSupport.js";import{join as o}from"../core/urlUtils.js";import{generateUUID as i}from"../core/uuid.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as n}from"../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../core/accessorSupport/decorators/writer.js";import{nameToId as l}from"../core/accessorSupport/PropertyOrigin.js";import{getRelationshipEndNodeMap as u,serializeInclusionDefinitionToEntitiesPbf as c,serializeInclusionDefinitionToRelationshipsPbf as m}from"../layers/knowledgeGraph/supportUtils.js";import{layoutTypes as d}from"./enums.js";import h from"./LayoutSettings.js";import y from"./NonspatialDataDisplay.js";import{f as g,t as U}from"../chunks/persistableUrlUtils.js";let f=class extends(e(r)){constructor(t){super(t),this.aggregatedEntitiesUrl=null,this.aggregatedRelationshipsUrl=null,this.autoCollapseRelationships=!0,this.centralityIsUpToDate=!0,this.entitiesUrl=null,this.layoutSettings=null,this.layoutType="organic-standard",this.nonspatialDataDisplay=null,this.relationshipsUrl=null}readEntitiesUrl(t,e,r){return g(t,r)}writeEntitiesUrl(t,e,r,o){const i=o?.portalItem,s=o?.resources,n=l(o?.origin),a=o?.webmap?.activeLinkChartLayer;i&&s&&null!=n&&a&&a.membershipModified?this._saveUrlAsNewResource(e,r,s,i,a):t&&(e[r]=U(t,o))}readRelationshipsUrl(t,e,r){return g(t,r)}writeRelationshipsUrl(t,e,r,o){const i=o?.portalItem,s=o?.resources,n=l(o?.origin),a=o?.webmap?.activeLinkChartLayer;i&&s&&null!=n&&a&&a.membershipModified?this._saveUrlAsNewResource(e,r,s,i,a):t&&(e[r]=U(t,o))}_saveUrlAsNewResource(t,e,r,o,i){t[e]="<pending>";const s=(i.knowledgeGraph.dataModel.relationshipTypes??[]).map((t=>t.name)).reduce(((t,e)=>{if(!e)return t;const{members:r}=i.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e)||{members:void 0};if(!r)return t;for(const[o]of r)t.push({id:o,typeName:e});return t}),[]);r.pendingOperations.push(new Promise((n=>{u(s,i.knowledgeGraph).then((s=>{b(i.dataManager.inclusionModeDefinition,e,i.knowledgeGraph,s).then((i=>{const s=j(o,"entitiesUrl"===e?"entitiesUrl":"relationshipsUrl");t[e]=s.itemRelativeUrl,r.toAdd.push({resource:s,content:{type:"blob",blob:i},compress:!1,finish:t=>{"entitiesUrl"===e?this.entitiesUrl=t.url:this.relationshipsUrl=t.url}}),n()}))}))})))}};t([s({type:String,json:{write:!0}})],f.prototype,"aggregatedEntitiesUrl",void 0),t([s({type:String,json:{write:!0}})],f.prototype,"aggregatedRelationshipsUrl",void 0),t([s({type:Boolean,json:{write:!0}})],f.prototype,"autoCollapseRelationships",void 0),t([s({type:Boolean,json:{write:!0}})],f.prototype,"centralityIsUpToDate",void 0),t([s({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"entitiesUrl",void 0),t([n("entitiesUrl")],f.prototype,"readEntitiesUrl",null),t([p("entitiesUrl")],f.prototype,"writeEntitiesUrl",null),t([s({type:h,json:{write:!0}})],f.prototype,"layoutSettings",void 0),t([s({type:d,json:{write:!0}})],f.prototype,"layoutType",void 0),t([s({type:y,json:{write:!0}})],f.prototype,"nonspatialDataDisplay",void 0),t([s({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"relationshipsUrl",void 0),t([n("relationshipsUrl")],f.prototype,"readRelationshipsUrl",null),t([p("relationshipsUrl")],f.prototype,"writeRelationshipsUrl",null),f=t([a("esri.linkChart.LinkChartProperties")],f);const w=f;function j(t,e){const r=`${e}-${i()}.dat`,s=o("linkChart",r);return t.resourceFromPath(s)}async function b(t,e,r,o){let i;return i="entitiesUrl"===e?await c(t,r,o):await m(t,r,o),new Blob([i],{type:"application/x-protobuf"})}export{w as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.32.0-next.20241021",
3
+ "version": "4.32.0-next.20241022",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import{formatNumber as r}from"../../../intl/number.js";import{createClassBreaksRenderer as a,getVariableRasterInfo as t,getField as s}from"../../../renderers/support/rasterRendererHelper.js";import{processRasterRendererParameters as n}from"../support/utils.js";function o(e){const{rasterInfo:r,layer:a}=e,s=r.multidimensionalInfo?"imagery"===a.type?a.mosaicRule?.multidimensionalDefinition?.[0]?.variableName:a.multidimensionalDefinition?.[0]?.variableName:"";return t(r,s)}async function i(r){const a=o((r=await n(r)).layer);if(a.bandCount>1)throw new e("raster-class-breaks-renderer:not-supported","Multiband raster is not supported");const{attributeTable:t}=a;r.field||(r.field=s(t,"value")?.name??"value");const{colors:i,numClasses:l}=r;if(i&&l&&i.length!==l)throw new e("raster-class-breaks-renderer:not-supported","The size of the `colors` parameter does not match 'numClasses'");return r.classificationMethod||(r.classificationMethod="natural-breaks"),r}async function l(r){const t=o((r=await i(r)).layer).clone(),s=t.attributeTable?.fields.find((e=>e.name.toLowerCase()===r.field?.toLowerCase()));if(!s&&(await r.layer.updateRasterInfoWithEstimatedStats(t,{rasterFunction:r.rasterFunction,signal:r.signal}),null==t.histograms))throw new e("raster-class-breaks-renderer:not-supported","Histograms or raster attribute table is required on the source raster. Unable to estimate histograms");const n=a(t,r);if(null==n)throw new e("raster-class-breaks-renderer:not-supported","Class breaks renderer is not supported on this data");const l={minValue:n.minValue,maxValue:n.classBreakInfos[n.classBreakInfos.length-1].maxValue,normalizationTotal:null,classBreakInfos:n.classBreakInfos.map((e=>{const r=u(e.minValue,e.maxValue);return e.label=r,{minValue:e.minValue,maxValue:e.maxValue,label:r}}))};return{renderer:n,classBreaksResult:l}}function u(e,a){return r(e,{maximumFractionDigits:3})+" - "+r(a,{maximumFractionDigits:3})}export{l as createRenderer};
5
+ import e from"../../../core/Error.js";import{formatNumber as r}from"../../../intl/number.js";import{createClassBreaksRenderer as a,getVariableRasterInfo as t,getField as s}from"../../../renderers/support/rasterRendererHelper.js";import{processRasterRendererParameters as n}from"../support/utils.js";function o(e){const{rasterInfo:r,layer:a}=e,s=r.multidimensionalInfo?"imagery"===a.type?a.mosaicRule?.multidimensionalDefinition?.[0]?.variableName:a.multidimensionalDefinition?.[0]?.variableName:"";return t(r,s)}async function i(r){const a=o((r=await n(r)).layer);if(a.bandCount>1)throw new e("raster-class-breaks-renderer:not-supported","Multiband raster is not supported");const{attributeTable:t}=a;r.field||(r.field=s(t,"value")?.name??"value");const{colors:i,numClasses:l}=r;if(i&&l&&i.length!==l)throw new e("raster-class-breaks-renderer:not-supported","The size of the `colors` parameter does not match 'numClasses'");return r.classificationMethod||(r.classificationMethod="natural-breaks"),r}async function l(r){const t=o((r=await i(r)).layer).clone(),s=t.attributeTable?.fields.find((e=>e.name.toLowerCase()===r.field?.toLowerCase()));if(s||t.histograms||await r.layer.updateRasterInfoWithEstimatedStats(t,{rasterFunction:r.rasterFunction,signal:r.signal}),null==t.histograms)throw new e("raster-class-breaks-renderer:not-supported","Histograms or raster attribute table is required on the source raster. Unable to estimate histograms");const n=a(t,r);if(null==n)throw new e("raster-class-breaks-renderer:not-supported","Class breaks renderer is not supported on this data");const l={minValue:n.minValue,maxValue:n.classBreakInfos[n.classBreakInfos.length-1].maxValue,normalizationTotal:null,classBreakInfos:n.classBreakInfos.map((e=>{const r=u(e.minValue,e.maxValue);return e.label=r,{minValue:e.minValue,maxValue:e.maxValue,label:r}}))};return{renderer:n,classBreaksResult:l}}function u(e,a){return r(e,{maximumFractionDigits:3})+" - "+r(a,{maximumFractionDigits:3})}export{l as createRenderer};
@@ -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"../../../core/Error.js";import{createStretchRenderer as e,getDefaultBandCombination as r}from"../../../renderers/support/rasterRendererHelper.js";import{processRasterRendererParameters as n}from"../support/utils.js";async function a(e){e=await n(e);const{rasterInfo:a}=e.layer;if(1===a.bandCount)throw new t("raster-rgb-renderer:not-supported","Only multiband image is supported");const{rgbBandIds:s}=e;if(s&&3!==s.length)throw new t("raster-rgb-renderer:invalid-parameters","rgb band ids must have exactly three 0-based band indices");if(!s){const t=r(a);t&&t.length<3&&2===a.bandCount?e.rgbBandIds=[0,1,1]:e.rgbBandIds=t}return e}async function s(t){const r=(t=await a(t)).layer,{rasterInfo:n}=r,{rgbBandIds:s}=t,d={bandIds:s,stretchType:t.stretchType,includeStatisticsInStretch:t.includeStatisticsInStretch};let o=e(n,d);if(t.estimateStatistics){n.statistics?.length||(t.includeStatisticsInStretch=!0);const a=n.clone();await r.updateRasterInfoWithEstimatedStats(a,{rasterFunction:t.rasterFunction,signal:t.signal}),o=e(a,d)}return i(o,t),{renderer:o,rgbBandIds:s}}function i(t,e){const{gamma:r,useGamma:n,dynamicRangeAdjustment:a}=e;3===r?.length&&(t.gamma=r),null!=n&&(t.useGamma=n),null!=a&&(t.dynamicRangeAdjustment=a)}export{s as createRenderer};
5
+ import t from"../../../core/Error.js";import{createStretchRenderer as e,getDefaultBandCombination as r}from"../../../renderers/support/rasterRendererHelper.js";import{processRasterRendererParameters as n}from"../support/utils.js";async function a(e){e=await n(e);const{rasterInfo:a}=e.layer;if(1===a.bandCount)throw new t("raster-rgb-renderer:not-supported","Only multiband image is supported");const{rgbBandIds:s}=e;if(s&&3!==s.length)throw new t("raster-rgb-renderer:invalid-parameters","rgb band ids must have exactly three 0-based band indices");if(!s){const t=r(a);t&&t.length<3&&2===a.bandCount?e.rgbBandIds=[0,1,1]:e.rgbBandIds=t}return e}async function s(t){const r=(t=await a(t)).layer,{rasterInfo:n}=r,{rgbBandIds:s}=t,d={bandIds:s,stretchType:t.stretchType,includeStatisticsInStretch:t.includeStatisticsInStretch};let o=e(n,d);if(t.estimateStatistics){t.includeStatisticsInStretch=!0;const a=n.clone();await r.updateRasterInfoWithEstimatedStats(a,{rasterFunction:t.rasterFunction,signal:t.signal}),o=e(a,d)}return i(o,t),{renderer:o,rgbBandIds:s}}function i(t,e){const{gamma:r,useGamma:n,dynamicRangeAdjustment:a}=e;3===r?.length&&(t.gamma=r),null!=n&&(t.useGamma=n),null!=a&&(t.dynamicRangeAdjustment=a)}export{s as createRenderer};
@@ -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{createStretchRenderer as t}from"../../../renderers/support/rasterRendererHelper.js";import{processRasterRendererParameters as e}from"../support/utils.js";async function a(a){const s=[(a=await e(a)).bandId||0],r={bandIds:s,variableName:a.variableName,stretchType:a.stretchType,includeStatisticsInStretch:a.includeStatisticsInStretch},i=a.layer,{rasterInfo:c}=i;let m=t(c,r);if(a.estimateStatistics){c.statistics?.length||(a.includeStatisticsInStretch=!0);const e=c.clone();await i.updateRasterInfoWithEstimatedStats(e,{rasterFunction:a.rasterFunction,signal:a.signal}),m=t(e,r)}return n(m,a),{renderer:m,bandId:s[0]}}function n(t,e){const{gamma:a,useGamma:n,dynamicRangeAdjustment:s,colorRamp:r}=e;null!=a&&(t.gamma=[a]),null!=n&&(t.useGamma=n),null!=s&&(t.dynamicRangeAdjustment=s),void 0!==r&&(t.colorRamp=r)}export{a as createRenderer};
5
+ import{createStretchRenderer as t}from"../../../renderers/support/rasterRendererHelper.js";import{processRasterRendererParameters as e}from"../support/utils.js";async function a(a){const r=[(a=await e(a)).bandId||0],s={bandIds:r,variableName:a.variableName,stretchType:a.stretchType,includeStatisticsInStretch:a.includeStatisticsInStretch},i=a.layer,{rasterInfo:c}=i;let m=t(c,s);if(a.estimateStatistics){a.includeStatisticsInStretch=!0;const e=c.clone();await i.updateRasterInfoWithEstimatedStats(e,{rasterFunction:a.rasterFunction,signal:a.signal}),m=t(e,s)}return n(m,a),{renderer:m,bandId:r[0]}}function n(t,e){const{gamma:a,useGamma:n,dynamicRangeAdjustment:r,colorRamp:s}=e;null!=a&&(t.gamma=[a]),null!=n&&(t.useGamma=n),null!=r&&(t.dynamicRangeAdjustment=r),void 0!==s&&(t.colorRamp=s)}export{a as createRenderer};
@@ -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 r from"../../../../core/Error.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../../geometry/Extent.js";import{estimateStatisticsHistograms as o}from"../../../../layers/support/rasterFunctions/stretchUtils.js";import i from"./RasterLayerAdapter.js";let n=class extends i{async generateRasterInfo(t){const{layer:r}=this,e=t?.rasterFunction;if("imagery-tile"===r.type&&e)try{return await r.generateRasterInfo(e,{signal:t?.signal})}catch{return r.serviceRasterInfo}return this.rasterInfo}async estimateStatisticsHistograms(t){const{layer:e}=this,a=e.multidimensionalDefinition?.[0]?.variableName??"",s=`${e.rasterFunction?.functionName??"default"}${a}`,i=this._statsCache.get(s);if(i)return i;const{raster:n}=e,{extent:l,width:h,height:c}=m(n.rasterInfo),{pixelBlock:p}=await e.fetchPixels(l,h,c,t);if(null==p)throw new r("raster-layer-adapter","Unable to estimate histograms");const f=o(p);return f&&this._statsCache.put(s,f),f}supportsMultidirectionalHillshade(){return!0}load(t){return this.addResolvingPromise(this.layer.load(t).then((()=>this.rasterInfo=this.layer.raster.rasterInfo))),Promise.resolve(this)}};function m(t,r=1e3){const{pyramidScalingFactor:e,maximumPyramidLevel:a}=t.storageInfo;let{extent:o,width:i,height:n,pixelSize:m}=t,l=Math.ceil(Math.log(Math.max(i,n)/r)/Math.log(e))-1,h=0,c=0;if(l<=a){const t=e**l;i=Math.floor(i/t),n=Math.floor(n/t)}else l=0,i=Math.min(i,r),n=Math.min(n,r),h=Math.max(Math.floor(i/2-500),0),c=Math.max(Math.floor(n/2-500),0),o=new s({xmin:o.xmin+h*m.x,xmax:Math.min(o.xmax,o.xmin+h*m.x*r),ymin:o.ymin+c*m.y,ymax:Math.min(o.ymax,o.ymin+c*m.y*r)});return{extent:o,width:i,height:n,origin:{x:h,y:c}}}t([e()],n.prototype,"layer",void 0),n=t([a("esri.smartMapping.raster.support.adapters.ImageryTileLayerAdapter")],n);const l=n;export{l as default};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Error.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../../geometry/Extent.js";import{estimateStatisticsHistograms as o}from"../../../../layers/support/rasterFunctions/stretchUtils.js";import i from"./RasterLayerAdapter.js";let n=class extends i{async generateRasterInfo(t){const{layer:r}=this,e=t?.rasterFunction;if("imagery-tile"===r.type&&e)try{return await r.generateRasterInfo(e,{signal:t?.signal})}catch{return r.serviceRasterInfo}return this.rasterInfo}async estimateStatisticsHistograms(t){const{layer:e}=this,a=e.multidimensionalDefinition?.[0]?.variableName??"",s=`${e.rasterFunction?.functionName??"default"}${a}`,i=this._statsCache.get(s);if(i)return i;const{raster:n}=e,{extent:l,width:h,height:c}=m(n.rasterInfo),{pixelBlock:p}=await e.fetchPixels(l,h,c,t);if(null==p)throw new r("raster-layer-adapter","Unable to estimate histograms");const f=o(p);return f&&this._statsCache.put(s,f),f}supportsMultidirectionalHillshade(){return!0}load(t){return this.addResolvingPromise(this.layer.load(t).then((()=>this.rasterInfo=this.layer.raster.rasterInfo))),Promise.resolve(this)}};function m(t,r=1e3){const{pyramidScalingFactor:e,maximumPyramidLevel:a}=t.storageInfo;let{extent:o,width:i,height:n,pixelSize:m}=t,l=Math.max(0,Math.ceil(Math.log(Math.max(i,n)/r)/Math.log(e))-1),h=0,c=0;if(l<=a){const t=e**l;i=Math.floor(i/t),n=Math.floor(n/t)}else l=0,i=Math.min(i,r),n=Math.min(n,r),h=Math.max(Math.floor(i/2-500),0),c=Math.max(Math.floor(n/2-500),0),o=new s({xmin:o.xmin+h*m.x,xmax:Math.min(o.xmax,o.xmin+h*m.x*r),ymin:o.ymin+c*m.y,ymax:Math.min(o.ymax,o.ymin+c*m.y*r)});return{extent:o,width:i,height:n,origin:{x:h,y:c}}}t([e()],n.prototype,"layer",void 0),n=t([a("esri.smartMapping.raster.support.adapters.ImageryTileLayerAdapter")],n);const l=n;export{l 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{_ as t}from"../../../../chunks/tslib.es6.js";import s from"../../../../core/Loadable.js";import{LRUCache as r}from"../../../../core/LRUCache.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";let a=class extends s{constructor(){super(...arguments),this.type="raster-layer-adapter",this._statsCache=new r(20)}get serviceRasterInfo(){return this.rasterInfo}async updateRasterInfo(t){this.rasterInfo=await this.generateRasterInfo(t),this.rasterFunction=t?.rasterFunction}async updateRasterInfoWithEstimatedStats(t,s){if(null==t.histograms||null==t.statistics){const r=await this.estimateStatisticsHistograms(s);null!=r&&(null==t.statistics&&(t.statistics=r.statistics),null==t.histograms&&(t.histograms=r.histograms))}}};t([o()],a.prototype,"layer",void 0),t([o()],a.prototype,"serviceRasterInfo",null),t([o()],a.prototype,"rasterInfo",void 0),t([o()],a.prototype,"rasterFunction",void 0),t([o({readOnly:!0})],a.prototype,"type",void 0),t([o()],a.prototype,"version",void 0),a=t([e("esri.smartMapping.raster.support.adapters.RasterLayerAdapter")],a);const i=a;export{i as default};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import s from"../../../../core/Loadable.js";import{LRUCache as r}from"../../../../core/LRUCache.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";let a=class extends s{constructor(){super(...arguments),this.type="raster-layer-adapter",this._statsCache=new r(20)}get serviceRasterInfo(){return this.rasterInfo}async updateRasterInfo(t){this.rasterInfo=await this.generateRasterInfo(t),this.rasterFunction=t?.rasterFunction}async updateRasterInfoWithEstimatedStats(t,s){const r=await this.estimateStatisticsHistograms(s);r?.statistics&&(t.statistics=r.statistics),r?.histograms&&(t.histograms=r.histograms)}};t([o()],a.prototype,"layer",void 0),t([o()],a.prototype,"serviceRasterInfo",null),t([o()],a.prototype,"rasterInfo",void 0),t([o()],a.prototype,"rasterFunction",void 0),t([o({readOnly:!0})],a.prototype,"type",void 0),t([o()],a.prototype,"version",void 0),a=t([e("esri.smartMapping.raster.support.adapters.RasterLayerAdapter")],a);const i=a;export{i as default};
@@ -0,0 +1,4 @@
1
+ import "../../../interfaces";
2
+
3
+ import rendererUtils = __esri.rendererUtils;
4
+ export = rendererUtils;
@@ -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 e="20241021",b="db69d14e09f2dfec84794b2eb5a6cabf84821e45";export{e as buildDate,b as commitHash};
5
+ const c="20241022",e="30020f130676540a5b0d01154ce12044ce30b750";export{c as buildDate,e 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{disposeMaybe as t}from"../../../../core/maybe.js";import{estimateSize as e}from"../../../../core/typedArrayUtil.js";import"../../tiling/TileInfoView.js";import r from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{BucketType as n}from"./enums.js";import{deserializeSymbols as s}from"./decluttering/util.js";import{BufferObject as i}from"../../../webgl/BufferObject.js";import{Usage as a}from"../../../webgl/enums.js";import{VertexArrayObject as o}from"../../../webgl/VertexArrayObject.js";class h{constructor(t,e){this.layerUIDs=[],this.isDestroyed=!1,this._data=t;let r=1;const n=new Uint32Array(t);this.layerUIDs=[];const s=n[r++];for(let i=0;i<s;i++)this.layerUIDs[i]=n[r++];this.bufferDataOffset=r,e&&(this.layer=e.getStyleLayerByUID(this.layerUIDs[0]))}get isPreparedForRendering(){return null==this._data}get offset(){return this.bufferDataOffset}get data(){return this._data}destroy(){this.isDestroyed||(this.doDestroy(),this._data=null,this.isDestroyed=!0)}prepareForRendering(t){null!=this._data&&(this.doPrepareForRendering(t,this._data,this.bufferDataOffset),this._data=null)}}class l extends h{constructor(t,e){super(t,e),this.type=n.LINE,this.lineIndexStart=0,this.lineIndexCount=0;const r=new Uint32Array(t);let s=this.bufferDataOffset;this.lineIndexStart=r[s++],this.lineIndexCount=r[s++];const i=r[s++];if(i>0){this.patternMap=new Map;for(let t=0;t<i;t++){const t=r[s++],e=r[s++],n=r[s++];this.patternMap.set(t,[e,n])}}this.bufferDataOffset=s}get usedMemory(){return(this.data?.byteLength??0)+(this.vao?.usedMemory??0)}hasData(){return this.lineIndexCount>0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=t(this.vao)}doPrepareForRendering(t,e,r){const n=new Uint32Array(e),s=new Int32Array(n.buffer),h=n[r++],l=i.createVertex(t,a.STATIC_DRAW,new Int32Array(s.buffer,4*r,h));r+=h;const f=n[r++],u=i.createIndex(t,a.STATIC_DRAW,new Uint32Array(n.buffer,4*r,f));r+=f;const c=this.layer.lineMaterial;this.vao=new o(t,c.getAttributeLocations(),c.getLayoutInfo(),new Map([["geometry",l]]),u)}}class f extends h{constructor(t,e){super(t,e),this.type=n.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const r=new Uint32Array(t);let s=this.bufferDataOffset;this.fillIndexStart=r[s++],this.fillIndexCount=r[s++],this.outlineIndexStart=r[s++],this.outlineIndexCount=r[s++];const i=r[s++];if(i>0){this.patternMap=new Map;for(let t=0;t<i;t++){const t=r[s++],e=r[s++],n=r[s++];this.patternMap.set(t,[e,n])}}this.bufferDataOffset=s}get usedMemory(){return(this.data?.byteLength??0)+(this.fillVAO?.usedMemory??0)+(this.outlineVAO?.usedMemory??0)}hasData(){return this.fillIndexCount>0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=t(this.fillVAO),this.outlineVAO=t(this.outlineVAO)}doPrepareForRendering(t,e,r){const n=new Uint32Array(e),s=new Int32Array(n.buffer),h=n[r++],l=i.createVertex(t,a.STATIC_DRAW,new Int32Array(s.buffer,4*r,h));r+=h;const f=n[r++],u=i.createIndex(t,a.STATIC_DRAW,new Uint32Array(n.buffer,4*r,f));r+=f;const c=n[r++],y=i.createVertex(t,a.STATIC_DRAW,new Int32Array(s.buffer,4*r,c));r+=c;const d=n[r++],A=i.createIndex(t,a.STATIC_DRAW,new Uint32Array(n.buffer,4*r,d));r+=d;const p=this.layer,I=p.fillMaterial,g=p.outlineMaterial;this.fillVAO=new o(t,I.getAttributeLocations(),I.getLayoutInfo(),new Map([["geometry",l]]),u),this.outlineVAO=new o(t,g.getAttributeLocations(),g.getLayoutInfo(),new Map([["geometry",y]]),A)}}class u extends h{constructor(t,e,i){super(t,e),this.type=n.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const a=new Uint32Array(t),o=new Int32Array(t),h=new Float32Array(t);let l=this.bufferDataOffset;this.isIconSDF=!!a[l++];const f=a[l++],u=a[l++],c=a[l++],y=new r(f,u,c,0),d=a[l++];for(let r=0;r<d;r++){const t=a[l++],e=a[l++],r=a[l++];this.iconPerPageElementsMap.set(t,[e,r])}const A=a[l++];for(let r=0;r<A;r++){const t=a[l++],e=a[l++],r=a[l++];this.glyphPerPageElementsMap.set(t,[e,r])}const p=a[l++],I=a[l++];this.iconOpacity=new Int32Array(p),this.textOpacity=new Int32Array(I),l=s(a,o,h,l,this.symbols,i,y),this.bufferDataOffset=l}get usedMemory(){return(this.data?.byteLength??0)+(this.iconVAO?.usedMemory??0)+(this.textVAO?.usedMemory??0)+e(this.iconOpacity)+e(this.textOpacity)}hasData(){return this.iconPerPageElementsMap.size>0||this.glyphPerPageElementsMap.size>0}triangleCount(){let t=0;for(const e of this.iconPerPageElementsMap.values())t+=e[1];for(const e of this.glyphPerPageElementsMap.values())t+=e[1];return t/3}doDestroy(){this.iconVAO=t(this.iconVAO),this.textVAO=t(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const t=this.iconOpacity,e=this.iconVAO.vertexBuffers.get("opacity");t.length>0&&t.byteLength===e.usedMemory&&e.setSubData(t,0,0,t.length);const r=this.textOpacity,n=this.textVAO.vertexBuffers.get("opacity");r.length>0&&r.byteLength===n.usedMemory&&n.setSubData(r,0,0,r.length)}doPrepareForRendering(t,e,r){const n=new Uint32Array(e),s=new Int32Array(n.buffer),h=n[r++],l=i.createVertex(t,a.STATIC_DRAW,new Int32Array(s.buffer,4*r,h));r+=h;const f=n[r++],u=i.createIndex(t,a.STATIC_DRAW,new Uint32Array(n.buffer,4*r,f));r+=f;const c=n[r++],y=i.createVertex(t,a.STATIC_DRAW,new Int32Array(s.buffer,4*r,c));r+=c;const d=n[r++],A=i.createIndex(t,a.STATIC_DRAW,new Uint32Array(n.buffer,4*r,d));r+=d;const p=i.createVertex(t,a.STATIC_DRAW,this.iconOpacity.buffer),I=i.createVertex(t,a.STATIC_DRAW,this.textOpacity.buffer),g=this.layer,x=g.iconMaterial,b=g.textMaterial;this.iconVAO=new o(t,x.getAttributeLocations(),x.getLayoutInfo(),new Map([["geometry",l],["opacity",p]]),u),this.textVAO=new o(t,b.getAttributeLocations(),b.getLayoutInfo(),new Map([["geometry",y],["opacity",I]]),A)}}class c extends h{constructor(t,e){super(t,e),this.type=n.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const r=new Uint32Array(t);let s=this.bufferDataOffset;this.circleIndexStart=r[s++],this.circleIndexCount=r[s++],this.bufferDataOffset=s}get usedMemory(){return(this.data?.byteLength??0)+(this.vao?.usedMemory??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=t(this.vao)}doPrepareForRendering(t,e,r){const n=new Uint32Array(e),s=new Int32Array(n.buffer),h=n[r++],l=i.createVertex(t,a.STATIC_DRAW,new Int32Array(s.buffer,4*r,h));r+=h;const f=n[r++],u=i.createIndex(t,a.STATIC_DRAW,new Uint32Array(n.buffer,4*r,f));r+=f;const c=this.layer.circleMaterial;this.vao=new o(t,c.getAttributeLocations(),c.getLayoutInfo(),new Map([["geometry",l]]),u)}}export{c as CircleRenderBucket,f as FillRenderBucket,l as LineRenderBucket,h as RenderBucketBase,u as SymbolRenderBucket};
5
+ import{disposeMaybe as t}from"../../../../core/maybe.js";import{estimateSize as e}from"../../../../core/typedArrayUtil.js";import"../../tiling/TileInfoView.js";import r from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{BucketType as n}from"./enums.js";import{deserializeSymbols as i}from"./decluttering/util.js";import{BufferObject as s}from"../../../webgl/BufferObject.js";import{Usage as a}from"../../../webgl/enums.js";import{VertexArrayObject as o}from"../../../webgl/VertexArrayObject.js";class h{constructor(t,e){this.layerUIDs=[],this.isDestroyed=!1,this._data=t;let r=1;const n=new Uint32Array(t);this.layerUIDs=[];const i=n[r++];for(let s=0;s<i;s++)this.layerUIDs[s]=n[r++];this.bufferDataOffset=r,e&&(this.layer=e.getStyleLayerByUID(this.layerUIDs[0]))}get isPreparedForRendering(){return null==this._data}get offset(){return this.bufferDataOffset}get data(){return this._data}destroy(){this.isDestroyed||(this.doDestroy(),this._data=null,this.isDestroyed=!0)}prepareForRendering(t){null!=this._data&&(this.doPrepareForRendering(t,this._data,this.bufferDataOffset),this._data=null)}}class c extends h{constructor(t,e){super(t,e),this.type=n.LINE,this.lineIndexStart=0,this.lineIndexCount=0;const r=new Uint32Array(t);let i=this.bufferDataOffset;this.lineIndexStart=r[i++],this.lineIndexCount=r[i++];const s=r[i++];if(s>0){this.patternMap=new Map;for(let t=0;t<s;t++){const t=r[i++],e=r[i++],n=r[i++];this.patternMap.set(t,[e,n])}}this.bufferDataOffset=i}get usedMemory(){return(this.data?.byteLength??0)+(this.vao?.cachedMemory??0)}hasData(){return this.lineIndexCount>0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=t(this.vao)}doPrepareForRendering(t,e,r){const n=new Uint32Array(e),i=new Int32Array(n.buffer),h=n[r++],c=s.createVertex(t,a.STATIC_DRAW,new Int32Array(i.buffer,4*r,h));r+=h;const l=n[r++],f=s.createIndex(t,a.STATIC_DRAW,new Uint32Array(n.buffer,4*r,l));r+=l;const u=this.layer.lineMaterial;this.vao=new o(t,u.getAttributeLocations(),u.getLayoutInfo(),new Map([["geometry",c]]),f)}}class l extends h{constructor(t,e){super(t,e),this.type=n.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const r=new Uint32Array(t);let i=this.bufferDataOffset;this.fillIndexStart=r[i++],this.fillIndexCount=r[i++],this.outlineIndexStart=r[i++],this.outlineIndexCount=r[i++];const s=r[i++];if(s>0){this.patternMap=new Map;for(let t=0;t<s;t++){const t=r[i++],e=r[i++],n=r[i++];this.patternMap.set(t,[e,n])}}this.bufferDataOffset=i}get usedMemory(){return(this.data?.byteLength??0)+(this.fillVAO?.cachedMemory??0)+(this.outlineVAO?.cachedMemory??0)}hasData(){return this.fillIndexCount>0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=t(this.fillVAO),this.outlineVAO=t(this.outlineVAO)}doPrepareForRendering(t,e,r){const n=new Uint32Array(e),i=new Int32Array(n.buffer),h=n[r++],c=s.createVertex(t,a.STATIC_DRAW,new Int32Array(i.buffer,4*r,h));r+=h;const l=n[r++],f=s.createIndex(t,a.STATIC_DRAW,new Uint32Array(n.buffer,4*r,l));r+=l;const u=n[r++],y=s.createVertex(t,a.STATIC_DRAW,new Int32Array(i.buffer,4*r,u));r+=u;const d=n[r++],A=s.createIndex(t,a.STATIC_DRAW,new Uint32Array(n.buffer,4*r,d));r+=d;const p=this.layer,I=p.fillMaterial,g=p.outlineMaterial;this.fillVAO=new o(t,I.getAttributeLocations(),I.getLayoutInfo(),new Map([["geometry",c]]),f),this.outlineVAO=new o(t,g.getAttributeLocations(),g.getLayoutInfo(),new Map([["geometry",y]]),A)}}class f extends h{constructor(t,e,s){super(t,e),this.type=n.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const a=new Uint32Array(t),o=new Int32Array(t),h=new Float32Array(t);let c=this.bufferDataOffset;this.isIconSDF=!!a[c++];const l=a[c++],f=a[c++],u=a[c++],y=new r(l,f,u,0),d=a[c++];for(let r=0;r<d;r++){const t=a[c++],e=a[c++],r=a[c++];this.iconPerPageElementsMap.set(t,[e,r])}const A=a[c++];for(let r=0;r<A;r++){const t=a[c++],e=a[c++],r=a[c++];this.glyphPerPageElementsMap.set(t,[e,r])}const p=a[c++],I=a[c++];this.iconOpacity=new Int32Array(p),this.textOpacity=new Int32Array(I),c=i(a,o,h,c,this.symbols,s,y),this.bufferDataOffset=c}get usedMemory(){return(this.data?.byteLength??0)+(this.iconVAO?.cachedMemory??0)+(this.textVAO?.cachedMemory??0)+e(this.iconOpacity)+e(this.textOpacity)}hasData(){return this.iconPerPageElementsMap.size>0||this.glyphPerPageElementsMap.size>0}triangleCount(){let t=0;for(const e of this.iconPerPageElementsMap.values())t+=e[1];for(const e of this.glyphPerPageElementsMap.values())t+=e[1];return t/3}doDestroy(){this.iconVAO=t(this.iconVAO),this.textVAO=t(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const t=this.iconOpacity,e=this.iconVAO.vertexBuffers.get("opacity");t.length>0&&t.byteLength===e.usedMemory&&e.setSubData(t,0,0,t.length);const r=this.textOpacity,n=this.textVAO.vertexBuffers.get("opacity");r.length>0&&r.byteLength===n.usedMemory&&n.setSubData(r,0,0,r.length)}doPrepareForRendering(t,e,r){const n=new Uint32Array(e),i=new Int32Array(n.buffer),h=n[r++],c=s.createVertex(t,a.STATIC_DRAW,new Int32Array(i.buffer,4*r,h));r+=h;const l=n[r++],f=s.createIndex(t,a.STATIC_DRAW,new Uint32Array(n.buffer,4*r,l));r+=l;const u=n[r++],y=s.createVertex(t,a.STATIC_DRAW,new Int32Array(i.buffer,4*r,u));r+=u;const d=n[r++],A=s.createIndex(t,a.STATIC_DRAW,new Uint32Array(n.buffer,4*r,d));r+=d;const p=s.createVertex(t,a.STATIC_DRAW,this.iconOpacity.buffer),I=s.createVertex(t,a.STATIC_DRAW,this.textOpacity.buffer),g=this.layer,x=g.iconMaterial,b=g.textMaterial;this.iconVAO=new o(t,x.getAttributeLocations(),x.getLayoutInfo(),new Map([["geometry",c],["opacity",p]]),f),this.textVAO=new o(t,b.getAttributeLocations(),b.getLayoutInfo(),new Map([["geometry",y],["opacity",I]]),A)}}class u extends h{constructor(t,e){super(t,e),this.type=n.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const r=new Uint32Array(t);let i=this.bufferDataOffset;this.circleIndexStart=r[i++],this.circleIndexCount=r[i++],this.bufferDataOffset=i}get usedMemory(){return(this.data?.byteLength??0)+(this.vao?.cachedMemory??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=t(this.vao)}doPrepareForRendering(t,e,r){const n=new Uint32Array(e),i=new Int32Array(n.buffer),h=n[r++],c=s.createVertex(t,a.STATIC_DRAW,new Int32Array(i.buffer,4*r,h));r+=h;const l=n[r++],f=s.createIndex(t,a.STATIC_DRAW,new Uint32Array(n.buffer,4*r,l));r+=l;const u=this.layer.circleMaterial;this.vao=new o(t,u.getAttributeLocations(),u.getLayoutInfo(),new Map([["geometry",c]]),f)}}export{u as CircleRenderBucket,l as FillRenderBucket,c as LineRenderBucket,h as RenderBucketBase,f as SymbolRenderBucket};
@@ -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{MinPriority as e}from"../../../../core/MemCache.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{create as i}from"../../../../geometry/support/aaBoundingRect.js";import{TileHandler as s}from"./TileHandler.js";import{VectorTile as r}from"./VectorTile.js";import n from"../../tiling/TileInfoViewPOT.js";import l from"../../tiling/TileKey.js";class a extends s{constructor(e,t,o,i){super(e,t,o,e.tileInfo.lods.length-1),this._memCache=i,this._ongoingTileRequests=new Map,this._ongoingRequestToController=new Map,this._tileInfoView=new n(e.tileInfo,e.fullExtent)}destroy(){super.destroy(),this._ongoingRequestToController.forEach((e=>e.abort())),this._ongoingRequestToController.clear(),this._ongoingTileRequests.clear()}async getVectorTile(s,n){const a=new l(s[0],s[1],s[2],0);let g=this._memCache.get(a.id);if(g)return g.retain(),g;const h=await this._getVectorTileData(a);if(t(n),!this._layer)return null;if(g=this._memCache.get(a.id),g)return g.retain(),g;const m=this._layer.tileInfo.getTileBounds(i(),a),u=this._tileInfoView.getTileResolution(s[0]);return g=new r(a,u,m[0],m[3],512,512,this._styleRepository,this._memCache),g.setData(h),h&&(g.retain(),this._memCache.put(a.id,g,g.usedMemory,e)),g.neededForCoverage=!0,g.transforms.tileUnitsToPixels=o(1/8,0,0,0,1/8,0,0,0,1),g}_getVectorTileData(e){const t=e.id;if(this._ongoingTileRequests.has(t))return this._ongoingTileRequests.get(t);const o=new AbortController,i={signal:o.signal},s=this._getParsedVectorTileData(e,i).then((e=>(this._ongoingTileRequests.delete(t),this._ongoingRequestToController.delete(t),e))).catch((()=>(this._ongoingTileRequests.delete(t),this._ongoingRequestToController.delete(t),null)));return this._ongoingTileRequests.set(t,s),this._ongoingRequestToController.set(t,o),s}_getParsedVectorTileData(e,t){return this.fetchTileData(e,t).then((o=>this.parseTileData({key:e,data:o},t)))}}export{a as default};
5
+ import{MinPriority as e}from"../../../../core/MemCache.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{create as o}from"../../../../geometry/support/aaBoundingRect.js";import{TileHandler as s}from"./TileHandler.js";import{VectorTile as r}from"./VectorTile.js";import n from"../../tiling/TileInfoViewPOT.js";import l from"../../tiling/TileKey.js";class a extends s{constructor(e,t,i,o){super(e,t,i,e.tileInfo.lods.length-1),this._memCache=o,this._ongoingTileRequests=new Map,this._ongoingRequestToController=new Map,this._tileInfoView=new n(e.tileInfo,e.fullExtent)}destroy(){super.destroy(),this._ongoingRequestToController.forEach((e=>e.abort())),this._ongoingRequestToController.clear(),this._ongoingTileRequests.clear()}async getVectorTile(s,n){const a=new l(s[0],s[1],s[2],0);let g=this._memCache.get(a.id);if(g)return g.retain(),g;const h=await this._getVectorTileData(a);if(t(n),!this._layer)return null;if(g=this._memCache.get(a.id),g)return g.retain(),g;const c=this._layer.tileInfo.getTileBounds(o(),a),m=this._tileInfoView.getTileResolution(s[0]);return g=new r(a,m,c[0],c[3],512,512,this._styleRepository,this._memCache),g.setData(h),h&&(g.retain(),this._memCache.put(a.id,g,e)),g.neededForCoverage=!0,g.transforms.tileUnitsToPixels=i(1/8,0,0,0,1/8,0,0,0,1),g}_getVectorTileData(e){const t=e.id;if(this._ongoingTileRequests.has(t))return this._ongoingTileRequests.get(t);const i=new AbortController,o={signal:i.signal},s=this._getParsedVectorTileData(e,o).then((e=>(this._ongoingTileRequests.delete(t),this._ongoingRequestToController.delete(t),e))).catch((()=>(this._ongoingTileRequests.delete(t),this._ongoingRequestToController.delete(t),null)));return this._ongoingTileRequests.set(t,s),this._ongoingRequestToController.set(t,i),s}_getParsedVectorTileData(e,t){return this.fetchTileData(e,t).then((i=>this.parseTileData({key:e,data:i},t)))}}export{a 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"../../../../core/has.js";import{identity as e,translate as t,rotate as s,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{BucketType as i}from"./enums.js";import{CircleRenderBucket as o,SymbolRenderBucket as h,LineRenderBucket as n,FillRenderBucket as l}from"./RenderBucket.js";import{fadeDuration as c}from"./decluttering/config.js";import{TiledDisplayObject as d}from"../webgl/TiledDisplayObject.js";const u=null;class y extends d{constructor(e,t,s,r,a,i,o,h=null){super(e,t,s,r,a,i,4096,4096),this.styleRepository=o,this._memCache=h,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<c}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<c)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this._processed=!0}deleteLayerData(e){let t=!1;for(const s of e){const e=this.layerData.get(s);e&&(this._usedMemory-=e.usedMemory,e.type===i.SYMBOL&&this.symbols.delete(s)&&(t=!0),e.destroy(),this.layerData.delete(s))}this._memCache?.updateSize(this.key.id,this,this._usedMemory),t&&(this.featureIndex?.clear(),this.emit("symbols-changed")),this.requestRender()}processed(){return this._processed}hasData(){return this.layerData.size>0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){"unloaded"!==this.status&&(y._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){0==--this._referenced&&(this.dispose(),this.stage=null)}retain(){++this._referenced}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,a=this._createRenderBuckets(s);if(r&&r.byteLength>0){const e=new Uint32Array(r);for(const t of e)this._deleteLayerData(t)}for(const[e,o]of a)this._deleteLayerData(e),o.type===i.SYMBOL&&(this.symbols.set(e,o.symbols),t=!0),this._usedMemory+=o.usedMemory,this.layerData.set(e,o);this._memCache?.updateSize(this.key.id,this,this.usedMemory)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())s.type===i.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(e){e.processDetach()},untrashDisplayObject:()=>!1}}setTransform(a){super.setTransform(a);const i=this.resolution/(a.resolution*a.pixelRatio),o=this.width/this.rangeX*i,h=this.height/this.rangeY*i,n=[0,0];a.toScreen(n,[this.x,this.y]);const l=this.transforms.tileUnitsToPixels;e(l),t(l,l,n),s(l,l,Math.PI*a.rotation/180),r(l,l,[o,h,1])}_createTransforms(){return{displayViewScreenMat3:a(),tileMat3:a(),tileUnitsToPixels:a()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const e=this._deserializeBucket(r,s);for(const s of e.layerUIDs)t.set(s,e)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case i.FILL:s=new l(e,this.styleRepository);break;case i.LINE:s=new n(e,this.styleRepository);break;case i.SYMBOL:s=new h(e,this.styleRepository,this);break;case i.CIRCLE:s=new o(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}}export{y as VectorTile,u as tracer};
5
+ import"../../../../core/has.js";import{identity as e,translate as t,rotate as s,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{BucketType as i}from"./enums.js";import{CircleRenderBucket as o,SymbolRenderBucket as h,LineRenderBucket as n,FillRenderBucket as l}from"./RenderBucket.js";import{fadeDuration as c}from"./decluttering/config.js";import{TiledDisplayObject as d}from"../webgl/TiledDisplayObject.js";const u=null;class y extends d{constructor(e,t,s,r,a,i,o,h=null){super(e,t,s,r,a,i,4096,4096),this.styleRepository=o,this._memCache=h,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<c}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<c)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this._processed=!0}deleteLayerData(e){let t=!1;for(const s of e){const e=this.layerData.get(s);e&&(this._usedMemory-=e.usedMemory,e.type===i.SYMBOL&&this.symbols.delete(s)&&(t=!0),e.destroy(),this.layerData.delete(s))}this._memCache?.updateSize(this.key.id,this),t&&(this.featureIndex?.clear(),this.emit("symbols-changed")),this.requestRender()}processed(){return this._processed}hasData(){return this.layerData.size>0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){"unloaded"!==this.status&&(y._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){0==--this._referenced&&(this.dispose(),this.stage=null)}retain(){++this._referenced}get cachedMemory(){return this._usedMemory}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,a=this._createRenderBuckets(s);if(r&&r.byteLength>0){const e=new Uint32Array(r);for(const t of e)this._deleteLayerData(t)}for(const[e,o]of a)this._deleteLayerData(e),o.type===i.SYMBOL&&(this.symbols.set(e,o.symbols),t=!0),this._usedMemory+=o.usedMemory,this.layerData.set(e,o);this._memCache?.updateSize(this.key.id,this)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())s.type===i.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(e){e.processDetach()},untrashDisplayObject:()=>!1}}setTransform(a){super.setTransform(a);const i=this.resolution/(a.resolution*a.pixelRatio),o=this.width/this.rangeX*i,h=this.height/this.rangeY*i,n=[0,0];a.toScreen(n,[this.x,this.y]);const l=this.transforms.tileUnitsToPixels;e(l),t(l,l,n),s(l,l,Math.PI*a.rotation/180),r(l,l,[o,h,1])}_createTransforms(){return{displayViewScreenMat3:a(),tileMat3:a(),tileUnitsToPixels:a()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const e=this._deserializeBucket(r,s);for(const s of e.layerUIDs)t.set(s,e)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case i.FILL:s=new l(e,this.styleRepository);break;case i.LINE:s=new n(e,this.styleRepository);break;case i.SYMBOL:s=new h(e,this.styleRepository,this);break;case i.CIRCLE:s=new o(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}}export{y as VectorTile,u as tracer};
@@ -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"../../../core/Handles.js";import{deg2rad as r}from"../../../core/mathUtils.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,initial as o}from"../../../core/reactiveUtils.js";import{convertUnit as s,getMetersPerUnitForSR as n}from"../../../core/unitUtils.js";import{fromRotation as a,translate as m,rotate as c,scaleByVec2 as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{set as h,sub as d,scale as f,rotate as j}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as u}from"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{project as _}from"../../../geometry/projection.js";import{getClosestDenormalizedXToReference as C}from"../../../geometry/support/normalizeUtils.js";import{getResolutionInMetersForScale as y}from"../../../geometry/support/scaleUtils.js";import{equals as v}from"../../../geometry/support/spatialReferenceUtils.js";import{DisplayObject as b}from"../engine/DisplayObject.js";import{WGLDrawPhase as L}from"../engine/webgl/enums.js";import{GridTechnique as x}from"../engine/webgl/shaderGraph/techniques/grid/GridTechnique.js";import{minimumPixelsPerStrideForDisplayWhenScalingOff as w}from"./constants.js";import{getScaleFactor as M}from"./gridUtils.js";const U=g();class q extends b{constructor(){super(),this._handles=new e,this._projectedCenter=null,this._technique=new x,this._grid=null,this.visible=!0}destroy(){this._handles=t(this._handles),this._technique.shutdown()}get grid(){return this._grid}set grid(e){this._grid=e,this._handles.removeAll(),this._handles.add([i((()=>e?.center),(()=>{this._projectedCenter=null}),o),i((()=>[e?.center,e?.dynamicScaling,e?.majorLineColor,e?.majorLineInterval,e?.minorLineColor,e?.rotateWithMap,e?.rotation,e?.spacing,e?.units]),(()=>this.requestRender()),o)])}_createTransforms(){return{displayViewScreenMat3:p()}}doRender(e){if(e.drawPhase!==L.MAP||null==this.grid||!this.visible)return;const{spacing:r,units:t,majorLineInterval:i,dynamicScaling:o,majorLineColor:n,minorLineColor:a}=this.grid,{scale:m}=e.state,c=s(r,t,"meters"),l=y(m),p=c/l;if(!o&&p<w)return;const h=c*M(i,p,o);this._updateTransform(e,l,h),this._technique.render(e,{transform:{dvs:this.transforms.displayViewScreenMat3},config:{pxPerCell:h/l,minorLineColor:W(a),majorLineColor:W(n),majorLineInterval:i,halfWidth:.25,aaWidth:.5}})}_updateTransform(e,t,i){const{grid:o}=this,{center:s,rotation:p,size:g,spatialReference:y}=e.state;if(null==o)return;if(this._projectedCenter&&v(this._projectedCenter.spatialReference,y)||(v(o.center.spatialReference,y)?this._projectedCenter=o.center:this._projectedCenter=_(o.center,y)),!this._projectedCenter)return;const b=t*(g[0]/2),L=t*(g[1]/2),x=n(y)/i,w=this._projectedCenter,M=r(o.rotation),q=r(p),W=this.transforms.displayViewScreenMat3;a(W,-M);const I=y.isWrappable?C(w.x,s[0],y):w.x,S=h(U,I,w.y),T=d(U,s,S);f(T,T,x),o.rotateWithMap||j(T,T,u,-q),j(T,T,u,-M),f(T,T,1/o.majorLineInterval),R(T,T),f(T,T,o.majorLineInterval),j(T,T,u,M),m(W,W,T),o.rotateWithMap&&c(W,W,q);const A=h(U,b/i,L/i);l(W,W,A)}}function R(e,r){return e[0]=r[0]-Math.trunc(r[0]),e[1]=r[1]-Math.trunc(r[1]),e}function W(e){const[r,t,i,o]=e.toArray().map((e=>e/255));return[r*o,t*o,i*o,o]}export{q as default};
5
+ import e from"../../../core/Handles.js";import{deg2rad as r}from"../../../core/mathUtils.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,initial as o}from"../../../core/reactiveUtils.js";import{convertUnit as s,getMetersPerUnitForSR as n}from"../../../core/unitUtils.js";import{fromRotation as a,translate as m,rotate as c,scaleByVec2 as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{set as h,sub as d,scale as f,rotate as j}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as u}from"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{project as _}from"../../../geometry/projection.js";import{getClosestDenormalizedXToReference as C}from"../../../geometry/support/normalizeUtils.js";import{getResolutionInMetersForScale as y}from"../../../geometry/support/scaleUtils.js";import{equals as v}from"../../../geometry/support/spatialReferenceUtils.js";import{DisplayObject as b}from"../engine/DisplayObject.js";import{WGLDrawPhase as L}from"../engine/webgl/enums.js";import{GridTechnique as x}from"../engine/webgl/shaderGraph/techniques/grid/GridTechnique.js";import{minimumPixelsPerStrideForDisplayWhenScalingOff as w}from"./constants.js";import{getScaleFactor as M}from"./gridUtils.js";const U=g();class q extends b{constructor(){super(),this._handles=new e,this._projectedCenter=null,this._technique=new x,this._grid=null,this.visible=!0}destroy(){this._handles=t(this._handles),this._technique.shutdown()}get grid(){return this._grid}set grid(e){this._grid=e,this._handles.removeAll(),this._handles.add([i((()=>e?.center),(()=>{this._projectedCenter=null}),o),i((()=>[e?.center,e?.dynamicScaling,e?.majorLineColor,e?.majorLineInterval,e?.minorLineColor,e?.rotateWithMap,e?.rotation,e?.spacing,e?.units]),(()=>this.requestRender()),o)])}_createTransforms(){return{displayViewScreenMat3:p()}}doRender(e){if(e.drawPhase!==L.MAP||null==this.grid||!this.visible)return;const{spacing:r,units:t,majorLineInterval:i,dynamicScaling:o,majorLineColor:n,minorLineColor:a}=this.grid;if(0===r)return;const{scale:m}=e.state,c=s(r,t,"meters"),l=y(m),p=c/l;if(!o&&p<w)return;const h=c*M(i,p,o);this._updateTransform(e,l,h),this._technique.render(e,{transform:{dvs:this.transforms.displayViewScreenMat3},config:{pxPerCell:h/l,minorLineColor:W(a),majorLineColor:W(n),majorLineInterval:i,halfWidth:.25,aaWidth:.5}})}_updateTransform(e,t,i){const{grid:o}=this,{center:s,rotation:p,size:g,spatialReference:y}=e.state;if(null==o)return;if(this._projectedCenter&&v(this._projectedCenter.spatialReference,y)||(v(o.center.spatialReference,y)?this._projectedCenter=o.center:this._projectedCenter=_(o.center,y)),!this._projectedCenter)return;const b=t*(g[0]/2),L=t*(g[1]/2),x=n(y)/i,w=this._projectedCenter,M=r(o.rotation),q=r(p),W=this.transforms.displayViewScreenMat3;a(W,-M);const I=y.isWrappable?C(w.x,s[0],y):w.x,S=h(U,I,w.y),T=d(U,s,S);f(T,T,x),o.rotateWithMap||j(T,T,u,-q),j(T,T,u,-M),f(T,T,1/o.majorLineInterval),R(T,T),f(T,T,o.majorLineInterval),j(T,T,u,M),m(W,W,T),o.rotateWithMap&&c(W,W,q);const A=h(U,b/i,L/i);l(W,W,A)}}function R(e,r){return e[0]=r[0]-Math.trunc(r[0]),e[1]=r[1]-Math.trunc(r[1]),e}function W(e){const[r,t,i,o]=e.toArray().map((e=>e/255));return[r*o,t*o,i*o,o]}export{q as default};