@arcgis/core 5.1.0-next.101 → 5.1.0-next.102

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 (104) hide show
  1. package/arcgisGlobal.d.ts +1449 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{99f726f05cf80b0330ed.js → 119b84f5349f90d1dd28.js} +1 -1
  4. package/assets/esri/core/workers/chunks/15167eeb6d7dbe7e392d.js +1 -0
  5. package/assets/esri/core/workers/chunks/{156efa014b6edd9ccce9.js → 1ba37706e5d5eaabcb8e.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{7bb17d0ab1cc2b89c035.js → 1faa8a42d5a437fc40a3.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{38b1d2ffcc318ac0119d.js → 48fcc10768d93e95a04e.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{53bf9b0c2b8da12820ea.js → 55ccb8ed7325efb62091.js} +2 -2
  9. package/assets/esri/core/workers/chunks/{17de1c251242b692cf45.js → 5663df3cd1dfd4b43c73.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{5b07f3253403fe25ce5b.js → 5bc299f7f89a07a6e6a6.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{00a25dd4b057cc9f2a7e.js → 6f96ce41c47cae82e687.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{657268b3fde6da2dd735.js → 86bff154d46f8a562887.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{22fa4aa2b76573bafe21.js → 9e7c84a3a2abec4d49df.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{40ffb1aa17cbfae17b23.js → bb5512ecb5300d45d46b.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{d8c4fb66c733ab2f66d3.js → bb81da98546c4d923e0d.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{a58662698c69190a12d8.js → de25311b6d13bf1c6089.js} +2 -2
  17. package/assets/esri/core/workers/chunks/{bafe489e54f34d1841e6.js → e86c073f0b6d395c7a38.js} +1 -1
  18. package/assets/esri/core/workers/chunks/f5bd0a4f82df5e942b70.js +1 -0
  19. package/assets/esri/core/workers/chunks/{48a0e7a32ebd44045c8f.js → fa38dc5010f8630a80fe.js} +1 -1
  20. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +125 -0
  21. package/assets/esri/themes/base/widgets/_Directions.scss +5 -1
  22. package/assets/esri/themes/dark/main.css +1 -1
  23. package/assets/esri/themes/light/main.css +1 -1
  24. package/assets/esri/themes/light/view.css +1 -1
  25. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  26. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  27. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer.json +1 -1
  28. package/config.js +1 -1
  29. package/form/elements/inputs/MultipleChoiceInput.d.ts +5 -5
  30. package/form/elements/inputs/MultipleChoiceInput.js +1 -1
  31. package/interfaces.d.ts +3 -0
  32. package/kernel.js +1 -1
  33. package/layers/FeatureLayer.d.ts +29 -39
  34. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  35. package/layers/OrientedImageryLayer.d.ts +233 -0
  36. package/layers/OrientedImageryLayer.js +1 -1
  37. package/layers/VideoLayer.d.ts +35 -9
  38. package/layers/VideoLayer.js +1 -1
  39. package/layers/catalog/CatalogFootprintLayer.d.ts +147 -0
  40. package/layers/support/FeatureReductionBinning.d.ts +87 -9
  41. package/layers/support/FeatureReductionCluster.d.ts +87 -9
  42. package/layers/support/FieldConfiguration.d.ts +1 -1
  43. package/layers/support/SubtypeSublayer.d.ts +147 -0
  44. package/layers/support/TelemetryData.d.ts +5 -0
  45. package/layers/support/TelemetryData.js +1 -1
  46. package/layers/support/TelemetryDisplay.d.ts +10 -2
  47. package/layers/support/TelemetryDisplay.js +1 -1
  48. package/layers/video/VideoController.js +1 -1
  49. package/layers/video/types.d.ts +8 -1
  50. package/layers/video/videoUtils.js +1 -1
  51. package/package.json +2 -2
  52. package/portal/jsonTypes.d.ts +7 -0
  53. package/rest/print.js +1 -1
  54. package/rest/support/PrintParameters.d.ts +8 -1
  55. package/rest/support/PrintParameters.js +1 -1
  56. package/support/revision.js +1 -1
  57. package/third-party-notices.txt +4 -0
  58. package/views/2d/engine/webgl/shaderGraph/graph/GlslGraphWriter.js +1 -1
  59. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  60. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode.js +1 -1
  61. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  62. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
  63. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +1 -1
  64. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
  65. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
  66. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
  67. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
  68. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
  69. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  70. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/surface.js +1 -1
  71. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  72. package/views/2d/layers/VideoLayerView2D.js +1 -1
  73. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  74. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  75. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  76. package/views/Viewport2DBaseMixin.js +1 -1
  77. package/widgets/Attachments/support/attachmentUtils.js +1 -1
  78. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +8 -1
  79. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  80. package/widgets/BatchAttributeForm/attachmentUtils.js +2 -0
  81. package/widgets/BatchAttributeForm/css.js +1 -1
  82. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  83. package/widgets/BatchAttributeForm/templates/RelationshipElementTemplate.js +1 -1
  84. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  85. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  86. package/widgets/BatchAttributeForm/types.d.ts +7 -0
  87. package/widgets/BatchAttributeForm.js +1 -1
  88. package/widgets/FeatureForm/RelationshipInput.d.ts +1 -1
  89. package/widgets/FeatureTable.js +1 -1
  90. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  91. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  92. package/widgets/OrientedImageryViewer/constants.js +1 -1
  93. package/widgets/OrientedImageryViewer/types.js +1 -1
  94. package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
  95. package/widgets/OrientedImageryViewer.js +1 -1
  96. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  97. package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +9 -0
  98. package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
  99. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  100. package/widgets/support/forms/formUtils.js +1 -1
  101. package/assets/esri/core/workers/chunks/43cc82373be791b7cb4c.js +0 -1
  102. package/assets/esri/core/workers/chunks/c9461568e1002ebac534.js +0 -1
  103. /package/assets/esri/core/workers/chunks/{53bf9b0c2b8da12820ea.js.LICENSE.txt → 55ccb8ed7325efb62091.js.LICENSE.txt} +0 -0
  104. /package/assets/esri/core/workers/chunks/{a58662698c69190a12d8.js.LICENSE.txt → de25311b6d13bf1c6089.js.LICENSE.txt} +0 -0
@@ -106,4 +106,11 @@ export interface LivestreamStatus {
106
106
  * @since 5.0
107
107
  */
108
108
  seekableStart?: number | null;
109
- }
109
+ }
110
+
111
+ /**
112
+ * Defines an object that represents the available coverage data of the layer.
113
+ *
114
+ * @since 5.1
115
+ */
116
+ export interface Coverage {}
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../geometry/Point.js";import t from"../../geometry/Polygon.js";import r from"../../geometry/Polyline.js";import n from"../../geometry/SpatialReference.js";import{execute as o}from"../../geometry/operators/projectOperator.js";import i from"../support/TelemetryData.js";import a from"../support/VideoTimeExtent.js";import{applyCIMSymbolColor as u}from"../../symbols/support/cimSymbolUtils.js";import{applyColorToSymbol as s}from"../../symbols/support/utils.js";const l="application/x-mpegURL",f="video/mp4",d="video/webm",g={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,FrameCenterAboveEllipsoid:10078,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function m(e,t=1e4){if(!e||!e.length)return[];let r=[],n=[];for(let i=0;i<e.length;i++){const t=e[i],n=t?.text?JSON.parse(t.text):null;"EsriVideoServer"===n?.source&&(r=[...n.data])}const o=r.find(e=>e.tagId===t);return Array.isArray(o?.value)&&(n=[...o.value]),n}function C(e){const{duration:t,end:r,start:n,timezone:o="UTC"}=e||{};return"number"!=typeof t?null:new a({duration:t||null,end:"number"==typeof r?new Date(r):null,start:"number"==typeof n?new Date(n):null,timezone:o})}function c(e,t){const r=[...t],n=r.findIndex(t=>t.equals(e));return n>-1&&r.splice(n),r.push(e),r}function L(e){if(!e?.size)return new i;const t=z(e),r=p(e),n=w(e),o=b(t,r);return new i({frameCenter:r,frameOutline:n,lineOfSight:o,sensorLocation:t})}function y(e){if(!e?.size)return null;return e.get(g.EsriGroundControlPoints)?.value??null??null}function P(e){return e?.size?e.get(g.EsriHorizonPixelPack)?.value??null:null}function p(e){return O(e)??F(e)}function E(e){if(!e)return l;const t=e.match(/\.(\w{3,4})(?:$|\?)/i);if(!t)return l;switch(t[1].toLowerCase()){case"mp4":return f;case"webm":return d;default:return l}}function S(e){const t=e?.layers;return t?.length?t.map(e=>({layerId:e.id,posterUrl:e.poster,sourceType:e.serviceType,title:e.name,type:e.type||"Video Layer"})):[]}function h(e,t,r){if(!e)return null;const n=e.clone();switch(n.type){case"simple-fill":s(n,r),n.outline.color=t;break;case"simple-line":s(n,t);break;case"simple-marker":s(n,t),n?.outline?.color&&(n.outline.color=t);break;case"cim":u(n,t)}return n}function v(e){const{cameraAzimuth:t,platformHeading:r,source:n=null,symbolOffset:o=0}=e||{};let i=0;if(!n)return i;i="platformHeading"===n?r+o:r+t+o;const a=i>360?i-360:i;return Math.round(Math.abs(a))}function x(t,r,i){if(!r||r.length<3)return null;const a=[...r].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y),u=Array.from(new Set(a.map(e=>e.x))).sort((e,t)=>e-t),s=Array.from(new Set(a.map(e=>e.y)));let l=-1;for(let e=u.length-2;e>=0;e--)if(t.x>=u[e]&&t.x<=u[e+1]){l=e;break}let f=-1;for(let e=s.length-2;e>=0;e--)if(t.y>=s[e]&&t.y<=s[e+1]){f=e;break}if(l<0||f<0||l>=u.length-1||f>=s.length-1)return null;const d=u[l],g=u[l+1],m=s[f],C=s[f+1],c=(e,t)=>{const n=r.find(r=>r.x===e&&r.y===t);if(!n)throw new Error(`Control point not found for x: ${e}, y: ${t}`);return n},L=c(d,m),y=c(g,m),P=c(d,C),p=c(g,C),E=t.x,S=t.y;let h,v;if(G(L.x,L.y,y.x,y.y,p.x,p.y,E,S)){const t=new e(L.lon,L.lat,n.WGS84),r=new e(y.lon,y.lat,n.WGS84),a=new e(p.lon,p.lat,n.WGS84);v=[L,y,p],h=[o(t,i),o(r,i),o(a,i)]}else{if(!G(L.x,L.y,p.x,p.y,P.x,P.y,E,S))return null;{const t=new e(L.lon,L.lat,n.WGS84),r=new e(p.lon,p.lat,n.WGS84),a=new e(P.lon,P.lat,n.WGS84);v=[L,p,P],h=[o(t,i),o(r,i),o(a,i)]}}const[x,O,F]=v,[w,T,A]=h,b=(O.y-F.y)*(x.x-F.x)+(F.x-O.x)*(x.y-F.y),z=((O.y-F.y)*(E-F.x)+(F.x-O.x)*(S-F.y))/b,V=((F.y-x.y)*(E-F.x)+(x.x-F.x)*(S-F.y))/b,k=1-z-V;return[z*w.x+V*T.x+k*A.x,z*w.y+V*T.y+k*A.y]}function O(t){return t&&t.has(g.EsriFrameCenterLatitude)&&t.has(g.EsriFrameCenterLongitude)?new e({x:t.get(g.EsriFrameCenterLongitude).value,y:t.get(g.EsriFrameCenterLatitude).value,z:t.get(g.FrameCenterAboveEllipsoid)?.value??t.get(g.FrameCenterElevation)?.value}):null}function F(t){return t&&t.has(g.FrameCenterLatitude)&&t.has(g.FrameCenterLongitude)?new e({x:t.get(g.FrameCenterLongitude)?.value,y:t.get(g.FrameCenterLatitude)?.value,z:t.get(g.FrameCenterElevation)?.value}):null}function w(e){if(!e)return null;const r=e.get(g.EsriFrameOutline)?.value;return r?t.fromJSON(r.geometry):T(e)??A(e)}function T(e){if(!(e.has(g.EsriCornerLatitudePt1)&&e.has(g.EsriCornerLongitudePt1)&&e.has(g.EsriCornerLatitudePt2)&&e.has(g.EsriCornerLongitudePt2)&&e.has(g.EsriCornerLatitudePt3)&&e.has(g.EsriCornerLongitudePt3)&&e.has(g.EsriCornerLatitudePt4)&&e.has(g.EsriCornerLongitudePt4)))return null;const r=[e.get(g.EsriCornerLongitudePt1)?.value,e.get(g.EsriCornerLatitudePt1)?.value],n=[e.get(g.EsriCornerLongitudePt2)?.value,e.get(g.EsriCornerLatitudePt2)?.value],o=[e.get(g.EsriCornerLongitudePt3)?.value,e.get(g.EsriCornerLatitudePt3)?.value],i=[e.get(g.EsriCornerLongitudePt4)?.value,e.get(g.EsriCornerLatitudePt4)?.value];return new t({rings:[[r,n,o,i]]})}function A(e){if(!(e.has(g.OffsetCorner1Latitude)&&e.has(g.OffsetCorner1Longitude)&&e.has(g.OffsetCorner2Latitude)&&e.has(g.OffsetCorner2Longitude)&&e.has(g.OffsetCorner3Latitude)&&e.has(g.OffsetCorner3Longitude)&&e.has(g.OffsetCorner4Latitude)&&e.has(g.OffsetCorner4Longitude)&&e.has(g.FrameCenterLatitude)&&e.has(g.FrameCenterLongitude)))return null;const r=e.get(g.FrameCenterLatitude)?.value,n=e.get(g.FrameCenterLongitude)?.value,o=r+e.get(g.OffsetCorner1Latitude)?.value,i=n+e.get(g.OffsetCorner1Longitude)?.value,a=r+e.get(g.OffsetCorner2Latitude)?.value,u=n+e.get(g.OffsetCorner2Longitude)?.value,s=r+e.get(g.OffsetCorner3Latitude)?.value,l=n+e.get(g.OffsetCorner3Longitude)?.value,f=r+e.get(g.OffsetCorner4Latitude)?.value,d=n+e.get(g.OffsetCorner4Longitude)?.value;return new t({rings:[[[i,o],[u,a],[l,s],[d,f]]]})}function b(e,t){if(!e||!t)return null;const n=[e.x,e.y,e.z??0],o=[t.x,t.y,t.z??0];return new r({paths:[[n,o]]})}function z(t){if(!t?.size)return null;if(t.has(g.EsriSensorPosition)){const r=t.get(g.EsriSensorPosition)?.value;if(r)return e.fromJSON(r.geometry)}return t.has(g.SensorLongitude)&&t.has(g.SensorLatitude)?new e({x:t.get(g.SensorLongitude)?.value,y:t.get(g.SensorLatitude)?.value,z:t.get(g.SensorTrueAltitude)?.value}):null}function G(e,t,r,n,o,i,a,u){return(o-a)*(t-u)-(e-a)*(i-u)>=0&&(e-a)*(n-u)-(r-a)*(t-u)>=0&&(r-a)*(i-u)-(o-a)*(n-u)>=0}export{x as computeVideoToMapBaricentric,p as getFrameCenter,P as getFrameHorizonPoints,y as getGroundControlPoints,c as getSensorTrailPoints,S as getServiceLayersInfo,h as getStyledTelemetrySymbol,v as getSymbolDisplayAngle,L as getTelemetryData,m as getVideoMetadataFromCueList,E as getVideoMimeType,C as readVideoTimeExtent,g as videoMetadataEntryId};
2
+ import e from"../../geometry/Point.js";import t from"../../geometry/Polygon.js";import r from"../../geometry/Polyline.js";import n from"../../geometry/SpatialReference.js";import{execute as o}from"../../geometry/operators/projectOperator.js";import i from"../support/TelemetryData.js";import a from"../support/VideoTimeExtent.js";import{applyCIMSymbolColor as u}from"../../symbols/support/cimSymbolUtils.js";import{applyColorToSymbol as s}from"../../symbols/support/utils.js";const l="application/x-mpegURL",f="video/mp4",d="video/webm",g={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,FrameCenterAboveEllipsoid:10078,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function m(e,t=1e4){if(!e||!e.length)return[];let r=[],n=[];for(let i=0;i<e.length;i++){const t=e[i],n=t?.text?JSON.parse(t.text):null;"EsriVideoServer"===n?.source&&(r=[...n.data])}const o=r.find(e=>e.tagId===t);return Array.isArray(o?.value)&&(n=[...o.value]),n}function C(e){const{duration:t,end:r,start:n,timezone:o="UTC"}=e||{};return[t,r,n].some(e=>"number"!=typeof e||e<0)?null:new a({duration:t||null,end:new Date(Number(r)),start:new Date(Number(n)),timezone:o})}function c(e,t){const r=[...t],n=r.findIndex(t=>t.equals(e));return n>-1&&r.splice(n),r.push(e),r}function L(e){if(!e?.size)return new i;const t=z(e),r=E(e),n=w(e),o=b(t,r);return new i({frameCenter:r,frameOutline:n,lineOfSight:o,sensorLocation:t})}function y(e){if(!e?.size)return null;return e.get(g.EsriGroundControlPoints)?.value??null??null}function P(e){return e?.size?e.get(g.EsriHorizonPixelPack)?.value??null:null}function E(e){return O(e)??F(e)}function p(e){if(!e)return l;const t=e.match(/\.(\w{3,4})(?:$|\?)/i);if(!t)return l;switch(t[1].toLowerCase()){case"mp4":return f;case"webm":return d;default:return l}}function S(e){const t=e?.layers;return t?.length?t.map(e=>({layerId:e.id,posterUrl:e.poster,sourceType:e.serviceType,title:e.name,type:e.type||"Video Layer"})):[]}function h(e,t,r){if(!e)return null;const n=e.clone();switch(n.type){case"simple-fill":s(n,r),n.outline.color=t;break;case"simple-line":s(n,t);break;case"simple-marker":s(n,t),n?.outline?.color&&(n.outline.color=t);break;case"cim":u(n,t)}return n}function v(e){const{cameraAzimuth:t,platformHeading:r,source:n=null,symbolOffset:o=0}=e||{};let i=0;if(!n)return i;i="platformHeading"===n?r+o:r+t+o;const a=i>360?i-360:i;return Math.round(Math.abs(a))}function x(t,r,i){if(!r||r.length<3)return null;const a=[...r].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y),u=Array.from(new Set(a.map(e=>e.x))).sort((e,t)=>e-t),s=Array.from(new Set(a.map(e=>e.y)));let l=-1;for(let e=u.length-2;e>=0;e--)if(t.x>=u[e]&&t.x<=u[e+1]){l=e;break}let f=-1;for(let e=s.length-2;e>=0;e--)if(t.y>=s[e]&&t.y<=s[e+1]){f=e;break}if(l<0||f<0||l>=u.length-1||f>=s.length-1)return null;const d=u[l],g=u[l+1],m=s[f],C=s[f+1],c=(e,t)=>{const n=r.find(r=>r.x===e&&r.y===t);if(!n)throw new Error(`Control point not found for x: ${e}, y: ${t}`);return n},L=c(d,m),y=c(g,m),P=c(d,C),E=c(g,C),p=t.x,S=t.y;let h,v;if(G(L.x,L.y,y.x,y.y,E.x,E.y,p,S)){const t=new e(L.lon,L.lat,n.WGS84),r=new e(y.lon,y.lat,n.WGS84),a=new e(E.lon,E.lat,n.WGS84);v=[L,y,E],h=[o(t,i),o(r,i),o(a,i)]}else{if(!G(L.x,L.y,E.x,E.y,P.x,P.y,p,S))return null;{const t=new e(L.lon,L.lat,n.WGS84),r=new e(E.lon,E.lat,n.WGS84),a=new e(P.lon,P.lat,n.WGS84);v=[L,E,P],h=[o(t,i),o(r,i),o(a,i)]}}const[x,O,F]=v,[w,T,A]=h,b=(O.y-F.y)*(x.x-F.x)+(F.x-O.x)*(x.y-F.y),z=((O.y-F.y)*(p-F.x)+(F.x-O.x)*(S-F.y))/b,V=((F.y-x.y)*(p-F.x)+(x.x-F.x)*(S-F.y))/b,k=1-z-V;return[z*w.x+V*T.x+k*A.x,z*w.y+V*T.y+k*A.y]}function O(t){return t&&t.has(g.EsriFrameCenterLatitude)&&t.has(g.EsriFrameCenterLongitude)?new e({x:t.get(g.EsriFrameCenterLongitude).value,y:t.get(g.EsriFrameCenterLatitude).value,z:t.get(g.FrameCenterAboveEllipsoid)?.value??t.get(g.FrameCenterElevation)?.value}):null}function F(t){return t&&t.has(g.FrameCenterLatitude)&&t.has(g.FrameCenterLongitude)?new e({x:t.get(g.FrameCenterLongitude)?.value,y:t.get(g.FrameCenterLatitude)?.value,z:t.get(g.FrameCenterElevation)?.value}):null}function w(e){if(!e)return null;const r=e.get(g.EsriFrameOutline)?.value;return r?t.fromJSON(r.geometry):T(e)??A(e)}function T(e){if(!(e.has(g.EsriCornerLatitudePt1)&&e.has(g.EsriCornerLongitudePt1)&&e.has(g.EsriCornerLatitudePt2)&&e.has(g.EsriCornerLongitudePt2)&&e.has(g.EsriCornerLatitudePt3)&&e.has(g.EsriCornerLongitudePt3)&&e.has(g.EsriCornerLatitudePt4)&&e.has(g.EsriCornerLongitudePt4)))return null;const r=[e.get(g.EsriCornerLongitudePt1)?.value,e.get(g.EsriCornerLatitudePt1)?.value],n=[e.get(g.EsriCornerLongitudePt2)?.value,e.get(g.EsriCornerLatitudePt2)?.value],o=[e.get(g.EsriCornerLongitudePt3)?.value,e.get(g.EsriCornerLatitudePt3)?.value],i=[e.get(g.EsriCornerLongitudePt4)?.value,e.get(g.EsriCornerLatitudePt4)?.value];return new t({rings:[[r,n,o,i]]})}function A(e){if(!(e.has(g.OffsetCorner1Latitude)&&e.has(g.OffsetCorner1Longitude)&&e.has(g.OffsetCorner2Latitude)&&e.has(g.OffsetCorner2Longitude)&&e.has(g.OffsetCorner3Latitude)&&e.has(g.OffsetCorner3Longitude)&&e.has(g.OffsetCorner4Latitude)&&e.has(g.OffsetCorner4Longitude)&&e.has(g.FrameCenterLatitude)&&e.has(g.FrameCenterLongitude)))return null;const r=e.get(g.FrameCenterLatitude)?.value,n=e.get(g.FrameCenterLongitude)?.value,o=r+e.get(g.OffsetCorner1Latitude)?.value,i=n+e.get(g.OffsetCorner1Longitude)?.value,a=r+e.get(g.OffsetCorner2Latitude)?.value,u=n+e.get(g.OffsetCorner2Longitude)?.value,s=r+e.get(g.OffsetCorner3Latitude)?.value,l=n+e.get(g.OffsetCorner3Longitude)?.value,f=r+e.get(g.OffsetCorner4Latitude)?.value,d=n+e.get(g.OffsetCorner4Longitude)?.value;return new t({rings:[[[i,o],[u,a],[l,s],[d,f]]]})}function b(e,t){if(!e||!t)return null;const n=[e.x,e.y,e.z??0],o=[t.x,t.y,t.z??0];return new r({hasZ:!0,hasM:!1,paths:[[n,o]]})}function z(t){if(!t?.size)return null;if(t.has(g.EsriSensorPosition)){const r=t.get(g.EsriSensorPosition)?.value;if(r)return e.fromJSON(r.geometry)}return t.has(g.SensorLongitude)&&t.has(g.SensorLatitude)?new e({x:t.get(g.SensorLongitude)?.value,y:t.get(g.SensorLatitude)?.value,z:t.get(g.SensorTrueAltitude)?.value}):null}function G(e,t,r,n,o,i,a,u){return(o-a)*(t-u)-(e-a)*(i-u)>=0&&(e-a)*(n-u)-(r-a)*(t-u)>=0&&(r-a)*(i-u)-(o-a)*(n-u)>=0}export{x as computeVideoToMapBaricentric,E as getFrameCenter,P as getFrameHorizonPoints,y as getGroundControlPoints,b as getLineOfSight,c as getSensorTrailPoints,S as getServiceLayersInfo,h as getStyledTelemetrySymbol,v as getSymbolDisplayAngle,L as getTelemetryData,m as getVideoMetadataFromCueList,p as getVideoMimeType,C as readVideoTimeExtent,g as videoMetadataEntryId};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.1.0-next.101",
3
+ "version": "5.1.0-next.102",
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": [
@@ -19,7 +19,7 @@
19
19
  "license": "SEE LICENSE IN LICENSE.md",
20
20
  "dependencies": {
21
21
  "@amcharts/amcharts5": "~5.17.2",
22
- "@arcgis/toolkit": "^5.1.0-next.102",
22
+ "@arcgis/toolkit": "^5.1.0-next.104",
23
23
  "@esri/arcgis-html-sanitizer": "~4.1.0",
24
24
  "@esri/calcite-components": "^5.1.0-next.47",
25
25
  "@vaadin/grid": "~25.1.3",
@@ -372,6 +372,13 @@ export interface VideoCameraInfo {
372
372
  tilt: number;
373
373
  }
374
374
 
375
+ /**
376
+ * Represents the telemetry elements available for display customization.
377
+ *
378
+ * @since 5.1
379
+ */
380
+ export interface TelemetryElementFilter {}
381
+
375
382
  /**
376
383
  * A JSON Feature object that can be added to a [StreamLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/StreamLayer/) on the client by calling its
377
384
  * [sendMessageToClient()](https://developers.arcgis.com/javascript/latest/references/core/layers/StreamLayer/#sendMessageToClient) method.
package/rest/print.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{id as e}from"../kernel.js";import t from"../request.js";import{JSONMap as a}from"../core/jsonMap.js";import{createScreenPoint as i,pt2px as r,px2pt as n}from"../core/screenUtils.js";import{dataComponents as o,normalize as s}from"../core/urlUtils.js";import l from"../geometry/Polygon.js";import{collectLabelingFields as u}from"../layers/support/fieldUtils.js";import{getFloorFilterClause as c}from"../layers/support/floorFilterUtils.js";import{getSizeRangeAtScale as y}from"../renderers/visualVariables/support/visualVariableUtils.js";import{asValidOptions as f,findToken as p}from"./utils.js";import{execute as d}from"./geoprocessor/execute.js";import{submitJob as m}from"./geoprocessor/submitJob.js";import{formatJsonMap as g}from"./support/fileFormat.js";import{toJSON as b}from"./support/layoutTemplate.js";import{getVisibleLayerViews as h,isScreenshotRequired as w,isBingMapsLayer as S,isBlendLayer as I,getCopyright as x,getSelectionSymbol as v,createPointLayer as D,getContextBoundingBox as L,createPolygonLayer as T,createPolylineLayer as O,createMultipointLayer as V}from"./support/printTaskUtils.js";import E from"./support/PrintTemplate.js";import{toJSON as P}from"./support/reportTemplate.js";import M from"../symbols/WebStyleSymbol.js";import F from"../views/support/HighlightOptions.js";const k={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},N=new a({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),R=new a({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),j=new Map;async function J(e,t,a){const i=await U(e,a),r=await z(t,i);if("sync"===await A(e,a)){const{results:t}=await d(e,r,void 0,a);return t?.[0]?.value}const n=await m(e,r,void 0,a);await n.waitForJobCompletion({interval:t.updateDelay});const{value:o}=await n.fetchResultData("Output_File",null,a);return o}async function U(e,a){const i=G(e),r=j.get(i)??{gpServerUrl:i,legendLayerNameMap:{},legendLayers:[],screenshotLayers:[]};return r.gpMetadata??=(await t(i,f({f:"json"},a))).data,r.cimVersion=r.gpMetadata.cimVersion,r.webStyleCache??=new Map,j.set(i,r),r}async function A(e,t){return ve(await U(e,t))}async function C(e,a){const i=await U(e,a),r=i.gpMetadata.tasks,n=i.gpServerUrl;if(i.taskInfos)return i.taskInfos;const o=(await t(e,f({f:"json"},a))).data;i.taskInfos={ExportWebMap:o};const s=r?.filter(e=>e!==o.name)??[];return await Promise.all(s.map(async e=>{const r=(await t(`${n}/${e}`,f({f:"json"},a))).data,o=r.name.startsWith("GetLayoutTemplatesInfo")?"GetLayoutTemplatesInfo":null;o&&(i.taskInfos[o]??=r)})),i.taskInfos}async function q(e,t,a){return(await C(e,a))[t]??null}async function _(e,t,a){const i=await q(e,t,a);return i?.executionType?R.fromJSON(i.executionType):"sync"}async function z(t,a){a=a||{is11xService:!1,legendLayerNameMap:{},legendLayers:[]};const i=t.template||new E;null==i.showLabels&&(i.showLabels=!0);const r=i.exportOptions;let n;const o=b(i.layout);if(r){if(n={dpi:r.dpi},"map_only"===o?.toLowerCase()||""===o){const{width:e,height:t}=r;n.outputSize=null!=e&&null!=t?[e,t]:void 0}}const s=i.layoutOptions;let l;if(s){let e,t;"Miles"===s.scalebarUnit||"Kilometers"===s.scalebarUnit?(e="Kilometers",t="Miles"):"Meters"!==s.scalebarUnit&&"Feet"!==s.scalebarUnit||(e="Meters",t="Feet"),l={titleText:s.titleText,authorText:s.authorText,copyrightText:s.copyrightText,customTextElements:s.customTextElements,elementOverrides:s.elementOverrides,scaleBarOptions:e||t?{metricUnit:N.toJSON(e)??void 0,metricLabel:e?k[e]:void 0,nonMetricUnit:N.toJSON(t)??void 0,nonMetricLabel:t?k[t]:void 0}:void 0}}const u=await $(t,i,a);if(u.operationalLayers){const e=new RegExp("[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]"),t=/[\u0600-\u06FF]/,a=a=>{const i=a.text,r=a.font,n=r?.family?.toLowerCase();i&&r&&("arial"===n||"arial unicode ms"===n)&&(r.family=e.test(i)?"Arial Unicode MS":"Arial","normal"!==r.style&&t.test(i)&&(r.family="Arial Unicode MS"))};for(const i of u.operationalLayers)if(i.featureCollection?.layers)for(const e of i.featureCollection.layers){if(e.layerDefinition?.drawingInfo?.renderer?.symbol){const t=e.layerDefinition.drawingInfo.renderer;"esriTS"===t.symbol.type&&a(t.symbol)}if(e.featureSet?.features)for(const t of e.featureSet.features)t.symbol&&"esriTS"===t.symbol.type&&a(t.symbol)}}let c=null;s?.legendLayers&&(c=s.legendLayers.filter(e=>!a.screenshotLayers.includes(e.layerId)).map(e=>{const t=e.layerId;a.legendLayerNameMap[t]=e.title;const i={id:t};if(e.subLayerIds){i.subLayerIds=e.subLayerIds;const t=e.dynamicLegend;null!=t&&(i.subLayerDynamicLegends=e.subLayerIds.map(()=>t))}return null!=e.dynamicLegend&&(i.dynamicLegend=e.dynamicLegend),i})),t.outSpatialReference&&(u.mapOptions.spatialReference=t.outSpatialReference.toJSON()),Object.assign(u,{exportOptions:n,layoutOptions:l||{}}),Object.assign(u.layoutOptions,{legendOptions:{operationalLayers:null!=c?c:a.legendLayers.slice()}}),a.legendLayers.length=0,a.screenshotLayers.length=0,j.set(a.gpServerUrl,a);const y={Web_Map_as_JSON:JSON.stringify(u),Format:g.toJSON(i.format),Layout_Template:o,Layout_Item_ID:void 0,Report_Template:P(i.report),Report_Item_ID:void 0};if(i.layoutItem){delete y.Layout_Template;const t=i.layoutItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(a.gpServerUrl),y.Layout_Item_ID=JSON.stringify({id:t.id})}if(i.reportItem){delete y.Report_Template;const t=i.reportItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(a.gpServerUrl),y.Report_Item_ID=JSON.stringify({id:t.id})}return t.extraParameters&&Object.assign(y,t.extraParameters),y}async function $(e,t,a){const i=e.view;let r=i.spatialReference;const n={operationalLayers:await W(i,t,a)};t.includeTables&&(n.tables=await ue(i));let o=e.extent||a.ssExtent||i.extent;if(r?.isWrappable&&(o=o.clone()._normalize(!0),r=o.spatialReference),n.mapOptions={extent:o&&o.toJSON(),spatialReference:r&&r.toJSON(),showAttribution:t.attributionVisible},a.ssExtent=null,i.background&&(n.background=i.background.toJSON()),i.rotation&&(n.mapOptions.rotation=-i.rotation),t.scalePreserved&&(n.mapOptions.scale=t.outScale||i.scale),null!=i.timeExtent){const e=null!=i.timeExtent.start?i.timeExtent.start.getTime():null,t=null!=i.timeExtent.end?i.timeExtent.end.getTime():null;n.mapOptions.time=[e,t]}return t.reportOptions&&(n.reportOptions=t.reportOptions),n}function G(e){let t=e;const a=t.lastIndexOf("/GPServer/");return a>0&&(t=t.slice(0,a+9)),t}async function W(e,t,a){const i=[];let r=0;t.scalePreserved&&(r=t.outScale||e.scale);const n={layerView:null,outScale:r,printTemplate:t,view:e},o=h(e,r);for(const s of o){const e=s.layer;if(!e.loaded||"layers"in e)continue;let t;n.layerView=s,t=w(s)?await oe(e,n,a):S(e)?B(e):"csv"===e?.type?await H(e,n,a):"catalog-footprint"===e?.type?await K(e,n,a):"feature"===e?.type?await X(e,n,a):"geojson"===e?.type?await Y(e,n,a):"graphics"===e?.type?await Z(e,n,a):"imagery"===e?.type?ee(e,a):"imagery-tile"===e?.type?await te(e,n,a):"kml"===e?.type?await ae(e,n,a):"map-image"===e?.type?ie(e,n,a):"map-notes"===e?.type?await re(n,a):"open-street-map"===e?.type?ne():"stream"===e?.type?await se(e,n,a):"subtype-group"===e?.type?await le(e,a):"tile"===e?.type?ce(e,a):"vector-tile"===e?.type?await ye(e,n,a):"web-tile"===e?.type?fe(e):"wfs"===e?.type?await pe(e,n,a):"wms"===e?.type?de(e,a):"wmts"===e?.type?me(e):await oe(e,n,a),t&&(Array.isArray(t)?i.push(...t):(t.id=e.id,t.title=a.legendLayerNameMap[e.id]||e.title,t.opacity=s.fullOpacity,t.minScale=e.minScale||0,t.maxScale=e.maxScale||0,I(e)&&e.blendMode&&"normal"!==e.blendMode&&(t.blendMode=e.blendMode),i.push(t)))}if(r)for(const s of i)s.minScale=0,s.maxScale=0;if(e.graphics?.length){const r=await Q(null,e.graphics,t,a);r&&i.push(r)}return i}function B(e){return{culture:e.culture,key:e.key,type:"BingMaps"+("aerial"===e.style?"Aerial":"hybrid"===e.style?"Hybrid":"Road")}}async function K(e,{layerView:t,printTemplate:a},i){if(parseFloat(i.cimVersion)<3.1){return Q(e,await Ie(t),a,i)}const r=e.parent,n={id:(o=xe(r,"web-map")).id,url:o.url,layerType:o.layerType,customParameters:o.customParameters,dynamicGroupLayer:{visibility:!1},footprintLayer:o.footprintLayer,layerDefinition:o.layerDefinition};var o;return ge(n,r),n}async function H(e,t,a){e.legendEnabled&&a.legendLayers.push({id:e.id});const i=t.layerView,r=t.printTemplate;if(!(i.filter||e.portalItem&&"public"!==e.portalItem.access)){const t=xe(e,"web-map");return t.type="CSV",delete t.popupInfo,delete t.layerType,t.showLabels=r.showLabels&&e.labelsVisible,t}return Q(e,await Ie(i),r,a)}async function Q(e,t,a,i){let r;const n=T(),o=O(),s=D(),c=V(),y=D();if(y.layerDefinition.name="textLayer",delete y.layerDefinition.drawingInfo,e){if("esri.layers.FeatureLayer"===e.declaredClass||"esri.layers.StreamLayer"===e.declaredClass?n.layerDefinition.name=o.layerDefinition.name=s.layerDefinition.name=c.layerDefinition.name=i.legendLayerNameMap[e.id]||e.arcgisProps?.title||e.title:"esri.layers.GraphicsLayer"===e.declaredClass&&(t=e.graphics.items),e.renderer){const t=e.renderer.toJSON(),a=n.layerDefinition.drawingInfo;a&&(a.renderer=t);const i=o.layerDefinition.drawingInfo;i&&(i.renderer=t);const r=s.layerDefinition.drawingInfo;r&&(r.renderer=t);const l=c.layerDefinition.drawingInfo;l&&(l.renderer=t)}if(a.showLabels&&e.labelsVisible&&"function"==typeof e.write){const t=xe(e),a=t.layerDefinition?.drawingInfo?.labelingInfo;if(a){r=!0;const e=n.layerDefinition.drawingInfo;e&&(e.labelingInfo=a);const t=o.layerDefinition.drawingInfo;t&&(t.labelingInfo=a);const i=s.layerDefinition.drawingInfo;i&&(i.labelingInfo=a);const l=c.layerDefinition.drawingInfo;l&&(l.labelingInfo=a)}}}let f;e?.renderer||r||(delete n.layerDefinition.drawingInfo,delete o.layerDefinition.drawingInfo,delete s.layerDefinition.drawingInfo,delete c.layerDefinition.drawingInfo);const p=e?.fieldsIndex,d=e?.renderer;if(p){const t=new Set;r&&await u(t,e),d&&"function"==typeof d.collectRequiredFields&&await d.collectRequiredFields(t,p),f=Array.from(t);const a=p.fields.map(e=>e.toJSON());n.layerDefinition.fields=a,o.layerDefinition.fields=a,s.layerDefinition.fields=a,c.layerDefinition.fields=a}const m=t?.length;let g;for(let u=0;u<m;u++){const e=t[u]||t.at(u);if(!1!==e.visible&&e.geometry){if(g=e.toJSON(),g.hasOwnProperty("popupTemplate")&&delete g.popupTemplate,g.geometry?.z&&delete g.geometry.z,g.symbol&&(g.symbol.angle||delete g.symbol.angle,De(g.symbol)?g.symbol=await be(g.symbol,i):g.symbol.text&&delete g.attributes),(!a||!a.forceFeatureAttributes)&&f?.length){const e={};for(const t of f)g.attributes?.hasOwnProperty(t)&&(e[t]=g.attributes[t]);g.attributes=e}"polygon"===e.geometry.type?n.featureSet.features.push(g):"polyline"===e.geometry.type?o.featureSet.features.push(g):"point"===e.geometry.type?g.symbol?.text?y.featureSet.features.push(g):s.featureSet.features.push(g):"multipoint"===e.geometry.type?c.featureSet.features.push(g):"extent"===e.geometry.type&&(g.geometry=l.fromExtent(e.geometry).toJSON(),n.featureSet.features.push(g))}}const b=[n,o,c,s,y].filter(e=>e.featureSet.features.length>0);for(const l of b){const e=l.featureSet.features.every(e=>e.symbol);if(e&&(!a||!a.forceFeatureAttributes))for(const t of l.featureSet.features)delete t.attributes;e&&delete l.layerDefinition.drawingInfo,l.layerDefinition.drawingInfo?.renderer&&(await Se(l.layerDefinition.drawingInfo.renderer,i),await he(l.layerDefinition.drawingInfo.renderer,i))}return b.length?{featureCollection:{layers:b},showLabels:r}:null}async function X(e,t,a){let i;const r=e.renderer,n=parseFloat(a.cimVersion);if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type&&(n<2.9||"pie-chart"===e.featureReduction.renderer?.type)||"pie-chart"===r?.type&&n<3.1||"dot-density"===r?.type&&n<2.6||"polygon"===e.geometryType&&r?.authoringInfo?.visualVariables?.some(e=>"spike"===e.theme))return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});const o=t.layerView,{printTemplate:s,view:l}=t,u="feature-layer"!==e.source?.type&&"ogc-feature"!==e.source?.type;if(o.filter||u||!r||"field"in r&&null!=r.field&&!e.getField(r.field)){const t=await Ie(o);i=await Q(e,t,s,a)}else{if(i={id:(f=xe(e)).id,title:f.title,url:f.url,layerType:f.layerType,customParameters:f.customParameters,layerDefinition:f.layerDefinition,charts:s.includeCharts?f.charts:void 0},s.attributionVisible&&(i.credits=x(e)),i.showLabels=s.showLabels&&e.labelsVisible&&!!e.labelingInfo&&e.labelingInfo.length>0,ge(i,e),delete i.layerDefinition?.featureReduction?.disablePopup,delete i.layerDefinition?.featureReduction?.popupInfo,o.displayFilterEnabled||delete i.layerDefinition?.displayFilterInfo,i.layerDefinition?.drawingInfo?.renderer&&(delete i.layerDefinition.minScale,delete i.layerDefinition.maxScale,await Se(i.layerDefinition.drawingInfo.renderer,a),await he(i.layerDefinition.drawingInfo.renderer,a),"visualVariables"in r&&r.visualVariables?.[0])){const e=r.visualVariables[0];if("size"===e.type&&e.maxSize&&"number"!=typeof e.maxSize&&e.minSize&&"number"!=typeof e.minSize){const t=y(e,l.scale);i.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=t.minSize,i.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=t.maxSize}}const t=c(o);if(t&&(i.layerDefinition??={},i.layerDefinition.definitionExpression=i.layerDefinition.definitionExpression?`(${i.layerDefinition.definitionExpression}) AND (${t})`:t),e.gdbVersion&&(i.layerDefinition??={},i.layerDefinition.gdbVersion=e.gdbVersion),o.hasHighlight&&"highlightIds"in o){const t=o;i.selectionObjectIds=t.highlightIds;const a=t.highlightOptions??l.defaultHighlight??new F;i.selectionSymbol=v(e.geometryType,a)}}var f;return i}async function Y(e,t,a){if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type)return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});return Q(e,await Ie(t.layerView),t.printTemplate,a)}async function Z(e,{printTemplate:t},a){return Q(e,null,t,a)}function ee(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const a={layerType:(i=xe(e)).layerType,customParameters:i.customParameters};var i;return a.bandIds=e.bandIds,a.compressionQuality=e.compressionQuality,a.format=e.format,a.interpolation=e.interpolation,(e.mosaicRule||e.definitionExpression)&&(a.mosaicRule=e.exportImageServiceParameters.mosaicRule.toJSON()),e.rasterFunction&&(a.renderingRule=e.rasterFunction.toJSON()),e.renderer&&(a.layerDefinition??={},a.layerDefinition.drawingInfo??={},a.layerDefinition.drawingInfo.renderer=e.renderer.toJSON()),ge(a,e),a}async function te(e,t,a){if("flow"===e.renderer?.type||!e.supportsWrite())return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});const i={bandIds:(r=xe(e)).bandIds,customParameters:r.customParameters,interpolation:r.interpolation,layerDefinition:r.layerDefinition};var r;return i.layerType="ArcGISImageServiceLayer",ge(i,e),i}async function ae(e,t,a){const i=t.printTemplate;if(!e.portalItem||"public"===e.portalItem.access){const t=xe(e,"web-map");return t.type="kml",delete t.layerType,t.url=s(e.url),t}const r=[],n=t.layerView,o="data:image/png;base64,";n.allVisibleMapImages.forEach((t,a)=>{const i={id:`${e.id}_image${a}`,type:"image",title:e.id,minScale:e.minScale||0,maxScale:e.maxScale||0,opacity:n.fullOpacity,extent:t.extent};t.href.startsWith(o)?i.imageData=t.href.slice(o.length):i.url=t.href,r.push(i)});const l=[...n.allVisiblePoints.items,...n.allVisiblePolylines.items,...n.allVisiblePolygons.items],u={id:e.id,...await Q(null,l,i,a)};return r.push(u),r}function ie(e,{outScale:t,printTemplate:a,view:i},r){let n;const o={id:e.id,subLayerIds:[]};let s=[];const l=t||i.scale,u=e=>{const t=0===l,a=0===e.minScale||l<=e.minScale,i=0===e.maxScale||l>=e.maxScale;if(e.visible&&(t||a&&i))if(e.sublayers)e.sublayers.forEach(u);else{const t=e.toExportImageJSON(),a={id:e.id,name:e.title,layerDefinition:{definitionExpression:t.definitionExpression,drawingInfo:t.drawingInfo,orderBy:t.orderBy,source:t.source}};s.unshift(a),o.subLayerIds.push(e.id)}};var c;return e.sublayers?.forEach(u),s.length&&(s=s.map(({id:e,name:t,layerDefinition:a})=>({id:e,name:t,layerDefinition:a})),n={layerType:(c=xe(e)).layerType,customParameters:c.customParameters},n.layers=s,n.visibleLayers=e.capabilities?.exportMap?.supportsDynamicLayers?void 0:o.subLayerIds,a.attributionVisible&&(n.credits=x(e)),e.gdbVersion&&(n.gdbVersion=e.gdbVersion),ge(n,e),e.legendEnabled&&r.legendLayers.push(o)),n}async function re({layerView:e,printTemplate:t},a){const i=[],r=e.layer;if(null!=r.featureCollections)for(const n of r.featureCollections){const e=await Q(n,n.source,t,a);e&&i.push(...e.featureCollection.layers)}else if(null!=r.sublayers)for(const n of r.sublayers){const e=await Q(null,n.graphics,t,a);e&&i.push(...e.featureCollection.layers)}return{featureCollection:{layers:i}}}function ne(){return{type:"OpenStreetMap"}}async function oe(e,{printTemplate:t,view:a},r){const n={type:"image"};r.screenshotLayers.push(e.id);const s={format:"png",ignoreBackground:!0,ignorePadding:!0,layers:[e]};0!==a.rotation&&(s.rotation=0);const l=r.ssExtent||a.state.extent.clone();let u=96,c=!0,y=!0;if(t.exportOptions){const e=t.exportOptions;null!=e.dpi&&e.dpi>0&&(u=e.dpi),null!=e.width&&e.width>0&&(c=e.width%2==a.width%2),null!=e.height&&e.height>0&&(y=e.height%2==a.height%2)}if("map-only"===t.layout&&t.scalePreserved&&(!t.outScale||t.outScale===a.scale)&&96===u&&(!c||!y)&&a.state.extent.equals(a.extent)&&(s.area={x:0,y:0,width:a.width,height:a.height},c||(s.area.width-=1),y||(s.area.height-=1),!r.ssExtent)){const e=a.toMap(i(s.area.width,s.area.height));l.ymin=e.y,l.xmax=e.x,r.ssExtent=l}n.extent=l.clone()._normalize(!0).toJSON();const f=await a.takeScreenshot(s);return n.imageData=o(f.dataUrl)?.data,n}async function se(e,{layerView:t,printTemplate:a},i){e.legendEnabled&&i.legendLayers.push({id:e.id});return Q(e,await Ie(t),a,i)}async function le(e,t){if(e.legendEnabled)for(const r of e.sublayers)r.legendEnabled&&t.legendLayers.push({id:r.id});const a={customParameters:(i=xe(e)).customParameters,effect:i.effect,layerDefinition:i.layerDefinition,layerType:i.layerType,layers:i.layers,url:i.url};var i;if(ge(a,e),Array.isArray(a.layers)){for(const e of a.layers)delete e.popupInfo;a.token&&a.layers.length>0&&(a.layers[a.layers.length-1].token=a.token,delete a.token)}return a}async function ue(e){const t=[],a=[];for(const i of e.map.allTables)"feature"!==i.type||i.loaded||a.push(i.load());a.length&&await Promise.allSettled(a);for(const i of e.map.allTables)if("feature"===i.type&&i.loaded&&i.isTable&&"feature-layer"===i.source?.type){const e=(e=>({id:e.id,title:e.title,customParameters:e.customParameters,layerDefinition:{definitionExpression:e.layerDefinition?.definitionExpression},url:e.url}))(xe(i));ge(e,i),t.push(e)}return t.length?t:void 0}function ce(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const a={layerType:(i=xe(e)).layerType,customParameters:i.customParameters};var i;return ge(a,e),a}async function ye(e,t,a){const i=t.layerView;if(e.serviceUrl&&e.styleUrl&&!i.spriteSourceChanged&&!i.styleChanged){const t=p(e.styleUrl,e.apiKey),i=p(e.serviceUrl,e.apiKey);if(!t&&!i||"2.1.0"!==a.cimVersion){const a={type:"VectorTileLayer"};return a.styleUrl=s(e.styleUrl),a.token=t,i!==t&&(a.additionalTokens=[{url:e.serviceUrl,token:i}]),a}}return oe(e,t,a)}function fe(e){const t=e.urlTemplate?.replaceAll("${","{"),a={type:"WebTiledLayer",urlTemplate:t,credits:e.copyright};return e.subDomains&&e.subDomains.length>0&&(a.subDomains=e.subDomains),a}async function pe(e,t,a){return parseFloat(a.cimVersion)<3.5?oe(e,t,a):(e.legendEnabled&&a.legendLayers.push({id:e.id}),{layerType:(i=xe(e,"web-map")).layerType,layerDefinition:i.layerDefinition,url:i.url,wfsInfo:i.wfsInfo});var i}function de(e,t){let a;const i=[],r=e=>{e.visible&&(e.sublayers?e.sublayers.forEach(r):e.name&&i.unshift(e.name))};return e.sublayers&&e.sublayers.forEach(r),i.length&&(e.legendEnabled&&t.legendLayers.push({id:e.id,subLayerIds:i}),a={type:"wms",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,transparentBackground:e.imageTransparency,visibleLayers:i,url:s(e.url),version:e.version}),a}function me(e){const t=e.activeLayer;return{type:"wmts",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,format:t.imageFormat,layer:t.id,style:t.styleId,tileMatrixSet:t.tileMatrixSetId,url:s(e.url)}}function ge(e,t){t.url&&(e.url=s(e.url||t.url),e.token=p(e.url,t.apiKey))}async function be(e,a){a.canvas||(a.canvas=document.createElement("canvas"));const i=1024;a.canvas.width=i,a.canvas.height=i;const o=a.canvas.getContext("2d");let s,l;if(e.path){const t=new Path2D(e.path);t.closePath(),o.fillStyle=Array.isArray(e.color)?`rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3]/255})`:"rgb(0,0,0)",o.fill(t);const a=L(o);if(!a)return null;o.clearRect(0,0,i,i);const n=r(e.size)/Math.max(a.width,a.height);o.scale(n,n);const u=i/n,c=u/2-a.width/2-a.x,y=u/2-a.height/2-a.y;if(o.translate(c,y),Array.isArray(e.color)&&o.fill(t),e.outline?.width&&Array.isArray(e.outline.color)){const i=e.outline;o.lineWidth=r(i.width)/n,o.lineJoin="round",o.strokeStyle=`rgba(${i.color[0]},${i.color[1]},${i.color[2]},${i.color[3]/255})`,o.stroke(t),a.width+=o.lineWidth,a.height+=o.lineWidth}a.width*=n,a.height*=n;const f=o.getImageData(i/2-a.width/2,i/2-a.height/2,Math.ceil(a.width),Math.ceil(a.height));s=f.width,l=f.height,o.canvas.width=s,o.canvas.height=l,o.putImageData(f,0,0)}else{const a="image/svg+xml"===e.contentType?"data:image/svg+xml;base64,"+e.imageData:e.url,i=(await t(a,{responseType:"image"})).data;s=r(e.width),l=r(e.height),o.canvas.width=s,o.canvas.height=l,o.drawImage(i,0,0,o.canvas.width,o.canvas.height)}return{type:"esriPMS",imageData:o.canvas.toDataURL("image/png").slice(22),angle:e.angle,contentType:"image/png",height:n(l),width:n(s),xoffset:e.xoffset,yoffset:e.yoffset}}async function he(e,t){const a=e.type;if("simple"===a&&De(e.symbol))e.symbol=await be(e.symbol,t)??{type:"esriSMS",color:[0,0,0,0],size:0,style:"esriSMSSquare"};else if("uniqueValue"===a){if(De(e.defaultSymbol)&&(e.defaultSymbol=await be(e.defaultSymbol,t)),"uniqueValueInfos"in e&&e.uniqueValueInfos)for(const a of e.uniqueValueInfos)De(a.symbol)&&(a.symbol=await be(a.symbol,t));if("uniqueValueGroups"in e&&e.uniqueValueGroups)for(const a of e.uniqueValueGroups)for(const e of a.classes)De(e.symbol)&&(e.symbol=await be(e.symbol,t))}else if("classBreaks"===a){De(e.defaultSymbol)&&(e.defaultSymbol=await be(e.defaultSymbol,t));for(const a of e.classBreakInfos)De(a.symbol)&&(a.symbol=await be(a.symbol,t))}}async function we(e,t){if("styleSymbolReference"!==e?.type)return e;try{const a=await M.fromJSON(e).fetchSymbol({cache:t.webStyleCache});return a?.toJSON()??e}catch{return e}}async function Se(e,t){if("simple"===e.type&&e.symbol)e.symbol=await we(e.symbol,t);else if("uniqueValue"===e.type){if(e.defaultSymbol=await we(e.defaultSymbol,t),"uniqueValueInfos"in e&&e.uniqueValueInfos)for(const a of e.uniqueValueInfos)a.symbol=await we(a.symbol,t);if("uniqueValueGroups"in e&&e.uniqueValueGroups)for(const a of e.uniqueValueGroups)for(const e of a.classes)e.symbol=await we(e.symbol,t)}else if("classBreaks"===e.type){e.defaultSymbol=await we(e.defaultSymbol,t);for(const a of e.classBreakInfos)a.symbol=await we(a.symbol,t)}}async function Ie(e){return e.queryFeatures(e.createQuery()).then(e=>e.features)}function xe(e,t){return e.write({},{ignorePersistenceEnabled:!0,origin:t})??{}}function ve(e){return e.gpMetadata?.executionType?R.fromJSON(e.gpMetadata.executionType):"sync"}function De(e){return e&&(e.path||"image/svg+xml"===e.contentType||e.url?.endsWith(".svg"))}export{J as execute,z as getGpPrintParams,G as getGpServerUrl,A as getMode,_ as getTaskExecutionMode,q as getTaskInfo,C as getTaskInfos,j as printCacheMap};
2
+ import{id as e}from"../kernel.js";import t from"../request.js";import{JSONMap as a}from"../core/jsonMap.js";import{createScreenPoint as i,pt2px as r,px2pt as n}from"../core/screenUtils.js";import{dataComponents as o,normalize as s}from"../core/urlUtils.js";import l from"../geometry/Polygon.js";import{collectLabelingFields as u}from"../layers/support/fieldUtils.js";import{getFloorFilterClause as c}from"../layers/support/floorFilterUtils.js";import{getSizeRangeAtScale as y}from"../renderers/visualVariables/support/visualVariableUtils.js";import{asValidOptions as f,findToken as p}from"./utils.js";import{execute as d}from"./geoprocessor/execute.js";import{submitJob as m}from"./geoprocessor/submitJob.js";import{formatJsonMap as g}from"./support/fileFormat.js";import{toJSON as b}from"./support/layoutTemplate.js";import{getVisibleLayerViews as h,isScreenshotRequired as w,isBingMapsLayer as S,isBlendLayer as I,getCopyright as x,getSelectionSymbol as v,createPointLayer as D,getContextBoundingBox as L,createPolygonLayer as T,createPolylineLayer as O,createMultipointLayer as V}from"./support/printTaskUtils.js";import E from"./support/PrintTemplate.js";import{toJSON as P}from"./support/reportTemplate.js";import M from"../symbols/WebStyleSymbol.js";import F from"../views/support/HighlightOptions.js";const k={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},N=new a({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),J=new a({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),R=new Map;async function j(e,t,a){const i=await U(e,a),r=await z(t,i);if("sync"===await A(e,a)){const{results:t}=await d(e,r,void 0,a);return t?.[0]?.value}const n=await m(e,r,void 0,a);await n.waitForJobCompletion({interval:t.updateDelay});const{value:o}=await n.fetchResultData("Output_File",null,a);return o}async function U(e,a){const i=G(e),r=R.get(i)??{gpServerUrl:i,legendLayerNameMap:{},legendLayers:[],screenshotLayers:[]};return r.gpMetadata??=(await t(i,f({f:"json"},a))).data,r.cimVersion=r.gpMetadata.cimVersion,r.webStyleCache??=new Map,R.set(i,r),r}async function A(e,t){return ve(await U(e,t))}async function C(e,a){const i=await U(e,a),r=i.gpMetadata.tasks,n=i.gpServerUrl;if(i.taskInfos)return i.taskInfos;const o=(await t(e,f({f:"json"},a))).data;i.taskInfos={ExportWebMap:o};const s=r?.filter(e=>e!==o.name)??[];return await Promise.all(s.map(async e=>{const r=(await t(`${n}/${e}`,f({f:"json"},a))).data,o=r.name.startsWith("GetLayoutTemplatesInfo")?"GetLayoutTemplatesInfo":null;o&&(i.taskInfos[o]??=r)})),i.taskInfos}async function q(e,t,a){return(await C(e,a))[t]??null}async function _(e,t,a){const i=await q(e,t,a);return i?.executionType?J.fromJSON(i.executionType):"sync"}async function z(t,a){a=a||{is11xService:!1,legendLayerNameMap:{},legendLayers:[]};const i=t.template||new E;null==i.showLabels&&(i.showLabels=!0);const r=i.exportOptions;let n;const o=b(i.layout);if(r){if(n={dpi:r.dpi},"map_only"===o?.toLowerCase()||""===o){const{width:e,height:t}=r;n.outputSize=null!=e&&null!=t?[e,t]:void 0}}const s=i.layoutOptions;let l;if(s){let e,t;"Miles"===s.scalebarUnit||"Kilometers"===s.scalebarUnit?(e="Kilometers",t="Miles"):"Meters"!==s.scalebarUnit&&"Feet"!==s.scalebarUnit||(e="Meters",t="Feet"),l={titleText:s.titleText,authorText:s.authorText,copyrightText:s.copyrightText,customTextElements:s.customTextElements,elementOverrides:s.elementOverrides,scaleBarOptions:e||t?{metricUnit:N.toJSON(e)??void 0,metricLabel:e?k[e]:void 0,nonMetricUnit:N.toJSON(t)??void 0,nonMetricLabel:t?k[t]:void 0}:void 0}}const u=await $(t,i,a);if(u.operationalLayers){const e=new RegExp("[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]"),t=/[\u0600-\u06FF]/,a=a=>{const i=a.text,r=a.font,n=r?.family?.toLowerCase();i&&r&&("arial"===n||"arial unicode ms"===n)&&(r.family=e.test(i)?"Arial Unicode MS":"Arial","normal"!==r.style&&t.test(i)&&(r.family="Arial Unicode MS"))};for(const i of u.operationalLayers)if(i.featureCollection?.layers)for(const e of i.featureCollection.layers){if(e.layerDefinition?.drawingInfo?.renderer?.symbol){const t=e.layerDefinition.drawingInfo.renderer;"esriTS"===t.symbol.type&&a(t.symbol)}if(e.featureSet?.features)for(const t of e.featureSet.features)t.symbol&&"esriTS"===t.symbol.type&&a(t.symbol)}}let c=null;s?.legendLayers&&(c=s.legendLayers.filter(e=>!a.screenshotLayers.includes(e.layerId)).map(e=>{const t=e.layerId;a.legendLayerNameMap[t]=e.title;const i={id:t};if(e.subLayerIds){i.subLayerIds=e.subLayerIds;const t=e.dynamicLegend;null!=t&&(i.subLayerDynamicLegends=e.subLayerIds.map(()=>t))}return null!=e.dynamicLegend&&(i.dynamicLegend=e.dynamicLegend),i})),t.outSpatialReference&&(u.mapOptions.spatialReference=t.outSpatialReference.toJSON()),t.datumTransformations?.length&&(u.mapOptions.datumTransformations=t.datumTransformations.map(e=>e.toJSON())),Object.assign(u,{exportOptions:n,layoutOptions:l||{}}),Object.assign(u.layoutOptions,{legendOptions:{operationalLayers:null!=c?c:a.legendLayers.slice()}}),a.legendLayers.length=0,a.screenshotLayers.length=0,R.set(a.gpServerUrl,a);const y={Web_Map_as_JSON:JSON.stringify(u),Format:g.toJSON(i.format),Layout_Template:o,Layout_Item_ID:void 0,Report_Template:P(i.report),Report_Item_ID:void 0};if(i.layoutItem){delete y.Layout_Template;const t=i.layoutItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(a.gpServerUrl),y.Layout_Item_ID=JSON.stringify({id:t.id})}if(i.reportItem){delete y.Report_Template;const t=i.reportItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(a.gpServerUrl),y.Report_Item_ID=JSON.stringify({id:t.id})}return t.extraParameters&&Object.assign(y,t.extraParameters),y}async function $(e,t,a){const i=e.view;let r=i.spatialReference;const n={operationalLayers:await W(i,t,a)};t.includeTables&&(n.tables=await ue(i));let o=e.extent||a.ssExtent||i.extent;if(r?.isWrappable&&(o=o.clone()._normalize(!0),r=o.spatialReference),n.mapOptions={extent:o&&o.toJSON(),spatialReference:r&&r.toJSON(),showAttribution:t.attributionVisible},a.ssExtent=null,i.background&&(n.background=i.background.toJSON()),i.rotation&&(n.mapOptions.rotation=-i.rotation),t.scalePreserved&&(n.mapOptions.scale=t.outScale||i.scale),null!=i.timeExtent){const e=null!=i.timeExtent.start?i.timeExtent.start.getTime():null,t=null!=i.timeExtent.end?i.timeExtent.end.getTime():null;n.mapOptions.time=[e,t]}return t.reportOptions&&(n.reportOptions=t.reportOptions),n}function G(e){let t=e;const a=t.lastIndexOf("/GPServer/");return a>0&&(t=t.slice(0,a+9)),t}async function W(e,t,a){const i=[];let r=0;t.scalePreserved&&(r=t.outScale||e.scale);const n={layerView:null,outScale:r,printTemplate:t,view:e},o=h(e,r);for(const s of o){const e=s.layer;if(!e.loaded||"layers"in e)continue;let t;n.layerView=s,t=w(s)?await oe(e,n,a):S(e)?B(e):"csv"===e?.type?await H(e,n,a):"catalog-footprint"===e?.type?await K(e,n,a):"feature"===e?.type?await X(e,n,a):"geojson"===e?.type?await Y(e,n,a):"graphics"===e?.type?await Z(e,n,a):"imagery"===e?.type?ee(e,a):"imagery-tile"===e?.type?await te(e,n,a):"kml"===e?.type?await ae(e,n,a):"map-image"===e?.type?ie(e,n,a):"map-notes"===e?.type?await re(n,a):"open-street-map"===e?.type?ne():"stream"===e?.type?await se(e,n,a):"subtype-group"===e?.type?await le(e,a):"tile"===e?.type?ce(e,a):"vector-tile"===e?.type?await ye(e,n,a):"web-tile"===e?.type?fe(e):"wfs"===e?.type?await pe(e,n,a):"wms"===e?.type?de(e,a):"wmts"===e?.type?me(e):await oe(e,n,a),t&&(Array.isArray(t)?i.push(...t):(t.id=e.id,t.title=a.legendLayerNameMap[e.id]||e.title,t.opacity=s.fullOpacity,t.minScale=e.minScale||0,t.maxScale=e.maxScale||0,I(e)&&e.blendMode&&"normal"!==e.blendMode&&(t.blendMode=e.blendMode),i.push(t)))}if(r)for(const s of i)s.minScale=0,s.maxScale=0;if(e.graphics?.length){const r=await Q(null,e.graphics,t,a);r&&i.push(r)}return i}function B(e){return{culture:e.culture,key:e.key,type:"BingMaps"+("aerial"===e.style?"Aerial":"hybrid"===e.style?"Hybrid":"Road")}}async function K(e,{layerView:t,printTemplate:a},i){if(parseFloat(i.cimVersion)<3.1){return Q(e,await Ie(t),a,i)}const r=e.parent,n={id:(o=xe(r,"web-map")).id,url:o.url,layerType:o.layerType,customParameters:o.customParameters,dynamicGroupLayer:{visibility:!1},footprintLayer:o.footprintLayer,layerDefinition:o.layerDefinition};var o;return ge(n,r),n}async function H(e,t,a){e.legendEnabled&&a.legendLayers.push({id:e.id});const i=t.layerView,r=t.printTemplate;if(!(i.filter||e.portalItem&&"public"!==e.portalItem.access)){const t=xe(e,"web-map");return t.type="CSV",delete t.popupInfo,delete t.layerType,t.showLabels=r.showLabels&&e.labelsVisible,t}return Q(e,await Ie(i),r,a)}async function Q(e,t,a,i){let r;const n=T(),o=O(),s=D(),c=V(),y=D();if(y.layerDefinition.name="textLayer",delete y.layerDefinition.drawingInfo,e){if("esri.layers.FeatureLayer"===e.declaredClass||"esri.layers.StreamLayer"===e.declaredClass?n.layerDefinition.name=o.layerDefinition.name=s.layerDefinition.name=c.layerDefinition.name=i.legendLayerNameMap[e.id]||e.arcgisProps?.title||e.title:"esri.layers.GraphicsLayer"===e.declaredClass&&(t=e.graphics.items),e.renderer){const t=e.renderer.toJSON(),a=n.layerDefinition.drawingInfo;a&&(a.renderer=t);const i=o.layerDefinition.drawingInfo;i&&(i.renderer=t);const r=s.layerDefinition.drawingInfo;r&&(r.renderer=t);const l=c.layerDefinition.drawingInfo;l&&(l.renderer=t)}if(a.showLabels&&e.labelsVisible&&"function"==typeof e.write){const t=xe(e),a=t.layerDefinition?.drawingInfo?.labelingInfo;if(a){r=!0;const e=n.layerDefinition.drawingInfo;e&&(e.labelingInfo=a);const t=o.layerDefinition.drawingInfo;t&&(t.labelingInfo=a);const i=s.layerDefinition.drawingInfo;i&&(i.labelingInfo=a);const l=c.layerDefinition.drawingInfo;l&&(l.labelingInfo=a)}}}let f;e?.renderer||r||(delete n.layerDefinition.drawingInfo,delete o.layerDefinition.drawingInfo,delete s.layerDefinition.drawingInfo,delete c.layerDefinition.drawingInfo);const p=e?.fieldsIndex,d=e?.renderer;if(p){const t=new Set;r&&await u(t,e),d&&"function"==typeof d.collectRequiredFields&&await d.collectRequiredFields(t,p),f=Array.from(t);const a=p.fields.map(e=>e.toJSON());n.layerDefinition.fields=a,o.layerDefinition.fields=a,s.layerDefinition.fields=a,c.layerDefinition.fields=a}const m=t?.length;let g;for(let u=0;u<m;u++){const e=t[u]||t.at(u);if(!1!==e.visible&&e.geometry){if(g=e.toJSON(),g.hasOwnProperty("popupTemplate")&&delete g.popupTemplate,g.geometry?.z&&delete g.geometry.z,g.symbol&&(g.symbol.angle||delete g.symbol.angle,De(g.symbol)?g.symbol=await be(g.symbol,i):g.symbol.text&&delete g.attributes),(!a||!a.forceFeatureAttributes)&&f?.length){const e={};for(const t of f)g.attributes?.hasOwnProperty(t)&&(e[t]=g.attributes[t]);g.attributes=e}"polygon"===e.geometry.type?n.featureSet.features.push(g):"polyline"===e.geometry.type?o.featureSet.features.push(g):"point"===e.geometry.type?g.symbol?.text?y.featureSet.features.push(g):s.featureSet.features.push(g):"multipoint"===e.geometry.type?c.featureSet.features.push(g):"extent"===e.geometry.type&&(g.geometry=l.fromExtent(e.geometry).toJSON(),n.featureSet.features.push(g))}}const b=[n,o,c,s,y].filter(e=>e.featureSet.features.length>0);for(const l of b){const e=l.featureSet.features.every(e=>e.symbol);if(e&&(!a||!a.forceFeatureAttributes))for(const t of l.featureSet.features)delete t.attributes;e&&delete l.layerDefinition.drawingInfo,l.layerDefinition.drawingInfo?.renderer&&(await Se(l.layerDefinition.drawingInfo.renderer,i),await he(l.layerDefinition.drawingInfo.renderer,i))}return b.length?{featureCollection:{layers:b},showLabels:r}:null}async function X(e,t,a){let i;const r=e.renderer,n=parseFloat(a.cimVersion);if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type&&(n<2.9||"pie-chart"===e.featureReduction.renderer?.type)||"pie-chart"===r?.type&&n<3.1||"dot-density"===r?.type&&n<2.6||"polygon"===e.geometryType&&r?.authoringInfo?.visualVariables?.some(e=>"spike"===e.theme))return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});const o=t.layerView,{printTemplate:s,view:l}=t,u="feature-layer"!==e.source?.type&&"ogc-feature"!==e.source?.type;if(o.filter||u||!r||"field"in r&&null!=r.field&&!e.getField(r.field)){const t=await Ie(o);i=await Q(e,t,s,a)}else{if(i={id:(f=xe(e)).id,title:f.title,url:f.url,layerType:f.layerType,customParameters:f.customParameters,layerDefinition:f.layerDefinition,charts:s.includeCharts?f.charts:void 0},s.attributionVisible&&(i.credits=x(e)),i.showLabels=s.showLabels&&e.labelsVisible&&!!e.labelingInfo&&e.labelingInfo.length>0,ge(i,e),delete i.layerDefinition?.featureReduction?.disablePopup,delete i.layerDefinition?.featureReduction?.popupInfo,o.displayFilterEnabled||delete i.layerDefinition?.displayFilterInfo,i.layerDefinition?.drawingInfo?.renderer&&(delete i.layerDefinition.minScale,delete i.layerDefinition.maxScale,await Se(i.layerDefinition.drawingInfo.renderer,a),await he(i.layerDefinition.drawingInfo.renderer,a),"visualVariables"in r&&r.visualVariables?.[0])){const e=r.visualVariables[0];if("size"===e.type&&e.maxSize&&"number"!=typeof e.maxSize&&e.minSize&&"number"!=typeof e.minSize){const t=y(e,l.scale);i.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=t.minSize,i.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=t.maxSize}}const t=c(o);if(t&&(i.layerDefinition??={},i.layerDefinition.definitionExpression=i.layerDefinition.definitionExpression?`(${i.layerDefinition.definitionExpression}) AND (${t})`:t),e.gdbVersion&&(i.layerDefinition??={},i.layerDefinition.gdbVersion=e.gdbVersion),o.hasHighlight&&"highlightIds"in o){const t=o;i.selectionObjectIds=t.highlightIds;const a=t.highlightOptions??l.defaultHighlight??new F;i.selectionSymbol=v(e.geometryType,a)}}var f;return i}async function Y(e,t,a){if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type)return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});return Q(e,await Ie(t.layerView),t.printTemplate,a)}async function Z(e,{printTemplate:t},a){return Q(e,null,t,a)}function ee(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const a={layerType:(i=xe(e)).layerType,customParameters:i.customParameters};var i;return a.bandIds=e.bandIds,a.compressionQuality=e.compressionQuality,a.format=e.format,a.interpolation=e.interpolation,(e.mosaicRule||e.definitionExpression)&&(a.mosaicRule=e.exportImageServiceParameters.mosaicRule.toJSON()),e.rasterFunction&&(a.renderingRule=e.rasterFunction.toJSON()),e.renderer&&(a.layerDefinition??={},a.layerDefinition.drawingInfo??={},a.layerDefinition.drawingInfo.renderer=e.renderer.toJSON()),ge(a,e),a}async function te(e,t,a){if("flow"===e.renderer?.type||!e.supportsWrite())return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});const i={bandIds:(r=xe(e)).bandIds,customParameters:r.customParameters,interpolation:r.interpolation,layerDefinition:r.layerDefinition};var r;return i.layerType="ArcGISImageServiceLayer",ge(i,e),i}async function ae(e,t,a){const i=t.printTemplate;if(!e.portalItem||"public"===e.portalItem.access){const t=xe(e,"web-map");return t.type="kml",delete t.layerType,t.url=s(e.url),t}const r=[],n=t.layerView,o="data:image/png;base64,";n.allVisibleMapImages.forEach((t,a)=>{const i={id:`${e.id}_image${a}`,type:"image",title:e.id,minScale:e.minScale||0,maxScale:e.maxScale||0,opacity:n.fullOpacity,extent:t.extent};t.href.startsWith(o)?i.imageData=t.href.slice(o.length):i.url=t.href,r.push(i)});const l=[...n.allVisiblePoints.items,...n.allVisiblePolylines.items,...n.allVisiblePolygons.items],u={id:e.id,...await Q(null,l,i,a)};return r.push(u),r}function ie(e,{outScale:t,printTemplate:a,view:i},r){let n;const o={id:e.id,subLayerIds:[]};let s=[];const l=t||i.scale,u=e=>{const t=0===l,a=0===e.minScale||l<=e.minScale,i=0===e.maxScale||l>=e.maxScale;if(e.visible&&(t||a&&i))if(e.sublayers)e.sublayers.forEach(u);else{const t=e.toExportImageJSON(),a={id:e.id,name:e.title,layerDefinition:{definitionExpression:t.definitionExpression,drawingInfo:t.drawingInfo,orderBy:t.orderBy,source:t.source}};s.unshift(a),o.subLayerIds.push(e.id)}};var c;return e.sublayers?.forEach(u),s.length&&(s=s.map(({id:e,name:t,layerDefinition:a})=>({id:e,name:t,layerDefinition:a})),n={layerType:(c=xe(e)).layerType,customParameters:c.customParameters},n.layers=s,n.visibleLayers=e.capabilities?.exportMap?.supportsDynamicLayers?void 0:o.subLayerIds,a.attributionVisible&&(n.credits=x(e)),e.gdbVersion&&(n.gdbVersion=e.gdbVersion),ge(n,e),e.legendEnabled&&r.legendLayers.push(o)),n}async function re({layerView:e,printTemplate:t},a){const i=[],r=e.layer;if(null!=r.featureCollections)for(const n of r.featureCollections){const e=await Q(n,n.source,t,a);e&&i.push(...e.featureCollection.layers)}else if(null!=r.sublayers)for(const n of r.sublayers){const e=await Q(null,n.graphics,t,a);e&&i.push(...e.featureCollection.layers)}return{featureCollection:{layers:i}}}function ne(){return{type:"OpenStreetMap"}}async function oe(e,{printTemplate:t,view:a},r){const n={type:"image"};r.screenshotLayers.push(e.id);const s={format:"png",ignoreBackground:!0,ignorePadding:!0,layers:[e]};0!==a.rotation&&(s.rotation=0);const l=r.ssExtent||a.state.extent.clone();let u=96,c=!0,y=!0;if(t.exportOptions){const e=t.exportOptions;null!=e.dpi&&e.dpi>0&&(u=e.dpi),null!=e.width&&e.width>0&&(c=e.width%2==a.width%2),null!=e.height&&e.height>0&&(y=e.height%2==a.height%2)}if("map-only"===t.layout&&t.scalePreserved&&(!t.outScale||t.outScale===a.scale)&&96===u&&(!c||!y)&&a.state.extent.equals(a.extent)&&(s.area={x:0,y:0,width:a.width,height:a.height},c||(s.area.width-=1),y||(s.area.height-=1),!r.ssExtent)){const e=a.toMap(i(s.area.width,s.area.height));l.ymin=e.y,l.xmax=e.x,r.ssExtent=l}n.extent=l.clone()._normalize(!0).toJSON();const f=await a.takeScreenshot(s);return n.imageData=o(f.dataUrl)?.data,n}async function se(e,{layerView:t,printTemplate:a},i){e.legendEnabled&&i.legendLayers.push({id:e.id});return Q(e,await Ie(t),a,i)}async function le(e,t){if(e.legendEnabled)for(const r of e.sublayers)r.legendEnabled&&t.legendLayers.push({id:r.id});const a={customParameters:(i=xe(e)).customParameters,effect:i.effect,layerDefinition:i.layerDefinition,layerType:i.layerType,layers:i.layers,url:i.url};var i;if(ge(a,e),Array.isArray(a.layers)){for(const e of a.layers)delete e.popupInfo;a.token&&a.layers.length>0&&(a.layers[a.layers.length-1].token=a.token,delete a.token)}return a}async function ue(e){const t=[],a=[];for(const i of e.map.allTables)"feature"!==i.type||i.loaded||a.push(i.load());a.length&&await Promise.allSettled(a);for(const i of e.map.allTables)if("feature"===i.type&&i.loaded&&i.isTable&&"feature-layer"===i.source?.type){const e=(e=>({id:e.id,title:e.title,customParameters:e.customParameters,layerDefinition:{definitionExpression:e.layerDefinition?.definitionExpression},url:e.url}))(xe(i));ge(e,i),t.push(e)}return t.length?t:void 0}function ce(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const a={layerType:(i=xe(e)).layerType,customParameters:i.customParameters};var i;return ge(a,e),a}async function ye(e,t,a){const i=t.layerView;if(e.serviceUrl&&e.styleUrl&&!i.spriteSourceChanged&&!i.styleChanged){const t=p(e.styleUrl,e.apiKey),i=p(e.serviceUrl,e.apiKey);if(!t&&!i||"2.1.0"!==a.cimVersion){const a={type:"VectorTileLayer"};return a.styleUrl=s(e.styleUrl),a.token=t,i!==t&&(a.additionalTokens=[{url:e.serviceUrl,token:i}]),a}}return oe(e,t,a)}function fe(e){const t=e.urlTemplate?.replaceAll("${","{"),a={type:"WebTiledLayer",urlTemplate:t,credits:e.copyright};return e.subDomains&&e.subDomains.length>0&&(a.subDomains=e.subDomains),a}async function pe(e,t,a){return parseFloat(a.cimVersion)<3.5?oe(e,t,a):(e.legendEnabled&&a.legendLayers.push({id:e.id}),{layerType:(i=xe(e,"web-map")).layerType,layerDefinition:i.layerDefinition,url:i.url,wfsInfo:i.wfsInfo});var i}function de(e,t){let a;const i=[],r=e=>{e.visible&&(e.sublayers?e.sublayers.forEach(r):e.name&&i.unshift(e.name))};return e.sublayers&&e.sublayers.forEach(r),i.length&&(e.legendEnabled&&t.legendLayers.push({id:e.id,subLayerIds:i}),a={type:"wms",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,transparentBackground:e.imageTransparency,visibleLayers:i,url:s(e.url),version:e.version}),a}function me(e){const t=e.activeLayer;return{type:"wmts",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,format:t.imageFormat,layer:t.id,style:t.styleId,tileMatrixSet:t.tileMatrixSetId,url:s(e.url)}}function ge(e,t){t.url&&(e.url=s(e.url||t.url),e.token=p(e.url,t.apiKey))}async function be(e,a){a.canvas||(a.canvas=document.createElement("canvas"));const i=1024;a.canvas.width=i,a.canvas.height=i;const o=a.canvas.getContext("2d");let s,l;if(e.path){const t=new Path2D(e.path);t.closePath(),o.fillStyle=Array.isArray(e.color)?`rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3]/255})`:"rgb(0,0,0)",o.fill(t);const a=L(o);if(!a)return null;o.clearRect(0,0,i,i);const n=r(e.size)/Math.max(a.width,a.height);o.scale(n,n);const u=i/n,c=u/2-a.width/2-a.x,y=u/2-a.height/2-a.y;if(o.translate(c,y),Array.isArray(e.color)&&o.fill(t),e.outline?.width&&Array.isArray(e.outline.color)){const i=e.outline;o.lineWidth=r(i.width)/n,o.lineJoin="round",o.strokeStyle=`rgba(${i.color[0]},${i.color[1]},${i.color[2]},${i.color[3]/255})`,o.stroke(t),a.width+=o.lineWidth,a.height+=o.lineWidth}a.width*=n,a.height*=n;const f=o.getImageData(i/2-a.width/2,i/2-a.height/2,Math.ceil(a.width),Math.ceil(a.height));s=f.width,l=f.height,o.canvas.width=s,o.canvas.height=l,o.putImageData(f,0,0)}else{const a="image/svg+xml"===e.contentType?"data:image/svg+xml;base64,"+e.imageData:e.url,i=(await t(a,{responseType:"image"})).data;s=r(e.width),l=r(e.height),o.canvas.width=s,o.canvas.height=l,o.drawImage(i,0,0,o.canvas.width,o.canvas.height)}return{type:"esriPMS",imageData:o.canvas.toDataURL("image/png").slice(22),angle:e.angle,contentType:"image/png",height:n(l),width:n(s),xoffset:e.xoffset,yoffset:e.yoffset}}async function he(e,t){const a=e.type;if("simple"===a&&De(e.symbol))e.symbol=await be(e.symbol,t)??{type:"esriSMS",color:[0,0,0,0],size:0,style:"esriSMSSquare"};else if("uniqueValue"===a){if(De(e.defaultSymbol)&&(e.defaultSymbol=await be(e.defaultSymbol,t)),"uniqueValueInfos"in e&&e.uniqueValueInfos)for(const a of e.uniqueValueInfos)De(a.symbol)&&(a.symbol=await be(a.symbol,t));if("uniqueValueGroups"in e&&e.uniqueValueGroups)for(const a of e.uniqueValueGroups)for(const e of a.classes)De(e.symbol)&&(e.symbol=await be(e.symbol,t))}else if("classBreaks"===a){De(e.defaultSymbol)&&(e.defaultSymbol=await be(e.defaultSymbol,t));for(const a of e.classBreakInfos)De(a.symbol)&&(a.symbol=await be(a.symbol,t))}}async function we(e,t){if("styleSymbolReference"!==e?.type)return e;try{const a=await M.fromJSON(e).fetchSymbol({cache:t.webStyleCache});return a?.toJSON()??e}catch{return e}}async function Se(e,t){if("simple"===e.type&&e.symbol)e.symbol=await we(e.symbol,t);else if("uniqueValue"===e.type){if(e.defaultSymbol=await we(e.defaultSymbol,t),"uniqueValueInfos"in e&&e.uniqueValueInfos)for(const a of e.uniqueValueInfos)a.symbol=await we(a.symbol,t);if("uniqueValueGroups"in e&&e.uniqueValueGroups)for(const a of e.uniqueValueGroups)for(const e of a.classes)e.symbol=await we(e.symbol,t)}else if("classBreaks"===e.type){e.defaultSymbol=await we(e.defaultSymbol,t);for(const a of e.classBreakInfos)a.symbol=await we(a.symbol,t)}}async function Ie(e){return e.queryFeatures(e.createQuery()).then(e=>e.features)}function xe(e,t){return e.write({},{ignorePersistenceEnabled:!0,origin:t})??{}}function ve(e){return e.gpMetadata?.executionType?J.fromJSON(e.gpMetadata.executionType):"sync"}function De(e){return e&&(e.path||"image/svg+xml"===e.contentType||e.url?.endsWith(".svg"))}export{j as execute,z as getGpPrintParams,G as getGpServerUrl,A as getMode,_ as getTaskExecutionMode,q as getTaskInfo,C as getTaskInfos,R as printCacheMap};
@@ -1,10 +1,11 @@
1
1
  import type Accessor from "../../core/Accessor.js";
2
2
  import type SpatialReference from "../../geometry/SpatialReference.js";
3
+ import type GeographicTransformation from "../../geometry/operators/support/GeographicTransformation.js";
3
4
  import type PrintTemplate from "./PrintTemplate.js";
4
5
  import type MapView from "../../views/MapView.js";
5
6
  import type { SpatialReferenceProperties } from "../../geometry/SpatialReference.js";
6
7
 
7
- export interface PrintParametersProperties extends Partial<Pick<PrintParameters, "extraParameters" | "template" | "view">> {
8
+ export interface PrintParametersProperties extends Partial<Pick<PrintParameters, "datumTransformations" | "extraParameters" | "template" | "view">> {
8
9
  /** Specify the output spatial reference for the printout. */
9
10
  outSpatialReference?: SpatialReferenceProperties | null;
10
11
  }
@@ -16,6 +17,12 @@ export interface PrintParametersProperties extends Partial<Pick<PrintParameters,
16
17
  */
17
18
  export default class PrintParameters extends Accessor {
18
19
  constructor(properties?: PrintParametersProperties);
20
+ /**
21
+ * todoc
22
+ *
23
+ * @since 5.1
24
+ */
25
+ accessor datumTransformations: GeographicTransformation[] | null | undefined;
19
26
  /**
20
27
  * Additional parameters for the print service. When an arcpy script is published as a custom
21
28
  * print service there may be additional parameters associated with the print service.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{property as o,subclass as r}from"../../core/accessorSupport/decorators.js";import p from"../../geometry/SpatialReference.js";let s=class extends t{constructor(e){super(e),this.extent=null,this.extraParameters=null,this.outSpatialReference=null,this.template=null,this.updateDelay=1e3,this.view=null}};e([o()],s.prototype,"extent",void 0),e([o()],s.prototype,"extraParameters",void 0),e([o({type:p})],s.prototype,"outSpatialReference",void 0),e([o()],s.prototype,"template",void 0),e([o()],s.prototype,"updateDelay",void 0),e([o()],s.prototype,"view",void 0),s=e([r("esri.rest.support.PrintParameters")],s);const a=s;export{a as default};
2
+ import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{property as o,subclass as r}from"../../core/accessorSupport/decorators.js";import s from"../../geometry/SpatialReference.js";let p=class extends e{constructor(t){super(t),this.datumTransformations=null,this.extent=null,this.extraParameters=null,this.outSpatialReference=null,this.template=null,this.updateDelay=1e3,this.view=null}};t([o()],p.prototype,"datumTransformations",void 0),t([o()],p.prototype,"extent",void 0),t([o()],p.prototype,"extraParameters",void 0),t([o({type:s})],p.prototype,"outSpatialReference",void 0),t([o()],p.prototype,"template",void 0),t([o()],p.prototype,"updateDelay",void 0),t([o()],p.prototype,"view",void 0),p=t([r("esri.rest.support.PrintParameters")],p);const a=p;export{a as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const f="20260514",a="e8bfa63f196d4fbec93aa83cf16f7f8d04123417";export{f as buildDate,a as commitHash};
2
+ const f="20260515",a="eb8f51dafff5d4a6751607a68784d15ba60f31cd";export{f as buildDate,a as commitHash};
@@ -1245,6 +1245,10 @@ vaadin/
1245
1245
 
1246
1246
  https://github.com/vaadin/web-components/tree/main/packages/grid
1247
1247
 
1248
+ Vaadin is a dependency for esri/widgets/FeatureTable/Grid/Grid.js
1249
+
1250
+ In development mode, Vaadin collects usage statistics unless disabled. For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
1251
+
1248
1252
  Copyright 2014-2021 Vaadin Ltd.
1249
1253
 
1250
1254
  Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const e=5;function n(e){for(const n of e.rootOutputNodes())e.shouldPruneOutputNode(n)||(n.variableName=r(e,n.node))}function t(e,n){let t="";return"boolean"!=typeof n&&"number"!=typeof n&&n.debugInfo.name&&(t=`${n.debugInfo.name}_`),`${t}v${e.varCount++}`}function r(e,n,t=!1){if("number"==typeof n)return n.toString();if("boolean"==typeof n)return n.toString();let r=e.getEmit(n);if(r)return r;switch(n.shaderType){case"scope-node":r=i(e,n);break;case"primitive-node":r=f(e,n,t);break;case"function-node":r=p(e,n);break;case"property-access-node":r=d(e,n);break;case"property-access-2d-node":r=a(e,n);break;case"text-node":r=n.text;break;case"block-node":r=u(e,n);break;case"condition-node":r=c(e,n)}return e.setEmit(n,r),r}function o(e,n,t){const r=n.split("\n");for(const o of r)if(o.trim().length){{let n="";null!=t&&(n+=`/*id:${t??"000"}*/ `),e.body+=n.padEnd(14)}e.body+=" ".repeat(e.indent)+o+"\n"}}function i(e,n){const t=new n.child.constructor;t.setDebugName(n.debugInfo.name);const i=r(e,t,!0);o(e,`{ /*ScopeStart: ${n.uid} ${n.debugInfo.name}*/`),e.indent+=2;return o(e,`${i} = ${r(e,n.child)};`),e.indent-=2,o(e,`} /*ScopeEnd: ${n.uid} ${n.debugInfo.name}*/`),i}function c(e,n){const t=r(e,new n.ifTrue.constructor,!0);o(e,`if (${r(e,n.condition)}) {`),e.indent+=2;const i=e.createSubgraphContext(),c=r(i,n.ifTrue);if(e.body+=i.body,c&&o(e,`${t} = ${c};`),e.indent-=2,o(e,"}"),n.ifFalse){o(e,"else {"),e.indent+=2;const i=e.createSubgraphContext(),c=r(i,n.ifFalse);e.body+=i.body,c&&o(e,`${t} = ${c};`),e.indent-=2,o(e,"}")}return t}function u(e,n){const{captureList:t,generator:i,returnType:c}=n,u={};for(const o in t){if(!t[o])continue;const n=r(e,t[o]);u[o]=n}const d=r(e,new c,!0);if(u.out=d,n.subgraph){const t=e.createSubgraphContext(),o=r(t,n.subgraph.child),i=t.body;u.subgraph={varName:o,body:i}}const a=i(u);return o(e,"{\n"),e.indent+=2,o(e,a),e.indent-=2,o(e,"}\n"),d}function d(e,n){const t=r(e,n.target);if("string"==typeof n.property&&n.property.includes("["))return`${t}${n.property}`;if("string"!=typeof n.property){return`${t}[${r(e,n.property)}]`}return`${t}.${n.property}`}function a(e,n){return`${r(e,n.target)}[${r(e,n.x)}][${r(e,n.y)}]`}function p(n,i){const c=i.returnType.type;if(i.isInfix){const[u,d]=i.children.map(e=>r(n,e)),a=t(n,i);return o(n,`${c.padEnd(e)} ${a} = ${u} ${i.token} ${d};`,i.uid),a}const u=i.children.map(e=>r(n,e)).join(", "),d=t(n,i);return o(n,`${c.padEnd(e)} ${d} = ${i.token}(${u});`,i.uid),d}function s(n,i,c){const u=i.elementType.type;if("array"===u||"sampler2D"===u)throw new Error(`Unable to emit local array with element type ${u}`);const d=t(n,i);if(o(n,`${u.padEnd(e)} ${d}[${i.size}];`,i.uid),n.setEmit(i,d),c)return d;for(let e=0;e<i.size;e++){o(n,`${d}[${e}] = ${r(n,i.children[e])};`,i.uid)}return d}function f(n,i,c=!1){const u=n.getInput(i);if(u)return u.isUsed=!0,u.variableName;if("array"===i.type)return s(n,i,c);const d=1===i.children.length&&i.children[0]?.type===i.type;if(!i.isMutable&&(i.isImplicit||d))return r(n,i.children[0]);const a=t(n,i);if(c)return o(n,`${i.type.padEnd(e)} ${a};`,i.uid),a;const p=!i.debugInfo.name&&!i.isMutable;if(p){if("float"===i.type&&"number"==typeof i.children[0])return Number.isInteger(i.children[0])?i.children[0].toFixed(1):i.children[0].toString();if("int"===i.type&&"number"==typeof i.children[0]&&Number.isInteger(i.children[0]))return i.children[0].toString();if("bool"===i.type&&"boolean"==typeof i.children[0])return i.children[0].toString()}const f=i.children.map(e=>r(n,e)).join(", ");return p?`${i.type}(${f})`:(o(n,`${i.type.padEnd(e)} ${a} = ${i.type}(${f});`,i.uid),a)}export{n as generateGLSL};
2
+ const e=5;function n(e){e.createArrayReadVersions();for(const n of e.rootOutputNodes())e.shouldPruneOutputNode(n)||(n.variableName=r(e,n.node))}function t(e,n){let t="";return"boolean"!=typeof n&&"number"!=typeof n&&n.debugInfo.name&&(t=`${n.debugInfo.name}_`),`${t}v${e.varCount++}`}function r(e,n,t=!1){if("number"==typeof n)return n.toString();if("boolean"==typeof n)return n.toString();let r=e.getEmit(n);if(r)return r;switch(n.shaderType){case"scope-node":r=i(e,n);break;case"primitive-node":r=y(e,n,t);break;case"function-node":r=p(e,n);break;case"property-access-node":r=d(e,n);break;case"property-access-2d-node":r=s(e,n);break;case"array-read-node":r=u(e,n);break;case"array-write-node":throw new Error("Impossible, array-write-nodes are only accessed by _writeArrayNode");case"text-node":r=n.text;break;case"block-node":r=c(e,n);break;case"condition-node":r=a(e,n)}return e.setEmit(n,r),r}function o(e,n,t){const r=n.split("\n");for(const o of r)if(o.trim().length){{let n="";null!=t&&(n+=`/*id:${t??"000"}*/ `),e.body+=n.padEnd(14)}e.body+=" ".repeat(e.indent)+o+"\n"}}function i(e,n){const t=new n.child.constructor;t.setDebugName(n.debugInfo.name);const i=r(e,t,!0);o(e,`{ /*ScopeStart: ${n.uid} ${n.debugInfo.name}*/`),e.indent+=2;return o(e,`${i} = ${r(e,n.child)};`),e.indent-=2,o(e,`} /*ScopeEnd: ${n.uid} ${n.debugInfo.name}*/`),i}function a(e,n){const t=r(e,new n.ifTrue.constructor,!0);o(e,`if (${r(e,n.condition)}) {`),e.indent+=2;const i=e.createSubgraphContext(),a=r(i,n.ifTrue);if(e.body+=i.body,a&&o(e,`${t} = ${a};`),e.indent-=2,o(e,"}"),n.ifFalse){o(e,"else {"),e.indent+=2;const i=e.createSubgraphContext(),a=r(i,n.ifFalse);e.body+=i.body,a&&o(e,`${t} = ${a};`),e.indent-=2,o(e,"}")}return t}function c(e,n){const{captureList:t,generator:i,returnType:a}=n,c={};for(const o in t){if(!t[o])continue;const n=r(e,t[o]);c[o]=n}const d=r(e,new a,!0);if(c.out=d,n.subgraph){const t=e.createSubgraphContext(),o=r(t,n.subgraph.child),i=t.body;c.subgraph={varName:o,body:i}}const s=i(c);return o(e,"{\n"),e.indent+=2,o(e,s),e.indent-=2,o(e,"}\n"),d}function d(e,n){const t=r(e,n.target);if("string"==typeof n.property&&n.property.includes("["))return`${t}${n.property}`;if("string"!=typeof n.property){return`${t}[${r(e,n.property)}]`}return`${t}.${n.property}`}function s(e,n){return`${r(e,n.target)}[${r(e,n.x)}][${r(e,n.y)}]`}function u(n,i){const a=r(n,i.version),c=n.getEmit(i);if(c)return c;const d=r(n,i.index),s=t(n,i);return o(n,`${i.returnType.type.padEnd(e)} ${s} = ${a}[${d}];`,i.uid),s}function p(n,i){const a=i.returnType.type;if(i.isInfix){const[c,d]=i.children.map(e=>r(n,e)),s=t(n,i);return o(n,`${a.padEnd(e)} ${s} = ${c} ${i.token} ${d};`,i.uid),s}const c=i.children.map(e=>r(n,e)).join(", "),d=t(n,i);return o(n,`${a.padEnd(e)} ${d} = ${i.token}(${c});`,i.uid),d}function f(n,i,a){const c=i.writeNode;if(c){const e=n.getInput(c.previousVersion);if(e)throw new Error(`Unable to write array version for shader input ${e.variableName}`);const t=r(n,c.previousVersion),a=r(n,c.index),d=r(n,c.value);o(n,`${t}[${a}] = ${d};`,c.uid),n.setEmit(i,t)}else{const c=i.elementType.type;if("array"===c||"sampler2D"===c)throw new Error(`Unable to emit local array with element type ${c}`);const d=t(n,i);if(a)return o(n,`${c.padEnd(e)} ${d}[${i.size}];`,i.uid),n.setEmit(i,d),d;const s=Array.from({length:i.size},()=>r(n,i.elementType));o(n,`${c.padEnd(e)} ${d}[${i.size}] = ${c}[](${s.join(", ")});`,i.uid),n.setEmit(i,d)}const d=n.getEmit(i);for(const e of n.arrayReadVersions.get(i.uid)??[])r(n,e);return d}function y(n,i,a=!1){const c=n.getInput(i);if(c)return c.isUsed=!0,c.variableName;if("array"===i.type)return f(n,i,a);const d=1===i.children.length&&i.children[0]?.type===i.type;if(!i.isMutable&&(i.isImplicit||d))return r(n,i.children[0]);const s=t(n,i);if(a)return o(n,`${i.type.padEnd(e)} ${s};`,i.uid),s;const u=!i.debugInfo.name&&!i.isMutable;if(u){if("float"===i.type&&"number"==typeof i.children[0])return Number.isInteger(i.children[0])?i.children[0].toFixed(1):i.children[0].toString();if("int"===i.type&&"number"==typeof i.children[0]&&Number.isInteger(i.children[0]))return i.children[0].toString();if("bool"===i.type&&"boolean"==typeof i.children[0])return i.children[0].toString()}const p=i.children.map(e=>r(n,e)).join(", ");return u?`${i.type}(${p})`:(o(n,`${i.type.padEnd(e)} ${s} = ${i.type}(${p});`,i.uid),s)}export{n as generateGLSL};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{cloneShaderNode as e}from"./ShaderGraphNode.js";class t{constructor(e,t,a,o=[]){this.variableName=e,this.variableInputType=t,this.node=a,this.qualifiers=o,this.type="shader-input",this.isUsed=!1}clone(){return new t(this.variableName,this.variableInputType,e(this.node),[...this.qualifiers])}}class a{constructor(e,t,a,o=[]){this.outVariableName=e,this.outVariableType=t,this.node=a,this.qualifiers=o,this.type="shader-output"}clone(){const t=new a(this.outVariableName,this.outVariableType,e(this.node),[...this.qualifiers]);return t.variableName=this.variableName,t}}class o{static createVertex(e,d,r,i,s,u,p){const c=[];for(const a in e){const o=e[a],n=r.get(a);n?c.push(new t(n,"builtin",o)):c.push(new t("a_"+a,"in",o))}for(const a of i){const e=a.uniformHydrated;c.push(new t(a.uniformName,"uniform",e))}for(const a of s){const e=a.textureHydrated;c.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in d){const e=d[t];if("glPosition"===t)h.push(new a("gl_Position","builtin",e));else if("glPointSize"===t)h.push(new a("gl_PointSize","builtin",e));else{const o=n(e),d=[];o&&d.push(o),h.push(new a("v_"+t,"out",e,d))}}return new o(c,h,u,p)}static createFragment(e,n,d,r,i,s,u){const p=[],c=Array.from(s.rootOutputNodes());for(const a in e){const o=e[a],n=d.get(a);if(n){p.push(new t(n,"builtin",o));continue}const r=c.find(e=>e.node===o);r&&p.push(new t(r.outVariableName,"in",o))}for(const a of r){const e=a.uniformHydrated;p.push(new t(a.uniformName,"uniform",e))}for(const a of i){const e=a.textureHydrated;p.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in n){const e=n[t],o=d.get(t);switch(t){case"discard":h.push(new a(null,"discard",e));break;case"fragData0":h.push(new a("fragData0","fragData0",e));break;case"fragData1":h.push(new a("fragData1","fragData1",e));break;case"fragData2":h.push(new a("fragData2","fragData2",e));break;case"fragData3":h.push(new a("fragData3","fragData3",e));break;default:o?h.push(new a(o,"builtin",e)):h.push(new a(t,"out",e))}}return new o(p,h,u)}constructor(e,t,a,o){this.type="shader-graph-context",this.indent=0,this.body="",this.varCount=0,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(const n of e)this._inputShaderTypesByNodeUid.set(n.node.uid,n);this._outputShaderTypes=t,this._transformFeedbackBindings=a,this._transformFeedbackNames=new Set(a.map(e=>"v_"+e.propertyKey)),this._usedInFragmentShader=o}shouldPruneOutputNode(e){return!!this._usedInFragmentShader&&("builtin"!==e.outVariableType&&(!this._transformFeedbackNames.has(e.outVariableName)&&!this._usedInFragmentShader.has(e.node.uid)))}setEmit(e,t){this._nodeEmitMap.set(e.uid,t)}getEmit(e){return this._nodeEmitMap.get(e.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}getInput(e){return this._inputShaderTypesByNodeUid.get(e.uid)}*rootOutputNodes(){for(const e of this._outputShaderTypes)yield e}*nodes(){const e=[];for(const t of this._outputShaderTypes.values())e.push(t.node);for(;e.length;){const t=e.pop();"number"!=typeof t&&"boolean"!=typeof t&&e.push(...t.children.filter(Boolean)),yield t}}*nodesOfTypeOrFunction(){for(const e of this.nodes())"number"!=typeof e&&"boolean"!=typeof e&&(yield e)}createSubgraphContext(){const e=this.clone();return e.body="",e.indent=this.indent+2,e._nodeEmitMap=new Map(this._nodeEmitMap),e}clone(){const e=new o([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader);return e._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,e.indent=this.indent,e.body=this.body,e.varCount=this.varCount,e._nodeEmitMap=this._nodeEmitMap,e}insertVertexShader(e){e.vertex.code.add(""),this._insertInputs(e,"vertex"),e.vertex.code.add(""),e.vertex.code.add("// OUTPUTS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this.rootOutputNodes()){const a="builtin"===t.outVariableType;if(!this.shouldPruneOutputNode(t))if(a)e.vertex.code.add(`// ${t.outVariableType.padEnd(7)} ${t.node.type.padEnd(9)} ${t.outVariableName};`);else if("array"===t.node.type){const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.elementType.type.padEnd(9)} ${t.outVariableName}[${t.node.size}];`)}else{const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.type.padEnd(9)} ${t.outVariableName};`)}}e.vertex.code.add(""),e.vertex.code.add("void main() {"),e.vertex.code.add(" "+this.body.split("\n").join("\n "));for(const t of this.rootOutputNodes())this.shouldPruneOutputNode(t)||e.vertex.code.add(` ${t.outVariableName} = ${t.variableName};`);e.vertex.code.add("}")}insertFragmentShader(e){this._insertInputs(e,"fragment"),e.fragment.code.add(""),e.fragment.code.add("// OUTPUTS: "),e.fragment.code.add("// --------------------------------------------------------- ");let t=0;for(const d of this.rootOutputNodes())"builtin"===d.outVariableType?e.fragment.code.add(`// ${d.outVariableType.padEnd(7)} ${d.node.type.padEnd(9)} ${d.outVariableName};`):"discard"===d.outVariableType||e.outputs.add(d.outVariableName,d.node.type,t++);e.fragment.code.add(""),e.fragment.code.add("void main() {"),e.fragment.code.add(" "+this.body.split("\n").join("\n "));const a=Array.from(this.rootOutputNodes()),o=a.find(e=>"discard"===e.outVariableType),n=a.filter(e=>"discard"!==e.outVariableType);o&&(e.fragment.code.add(` if (${o.variableName}) {`),e.fragment.code.add(" discard;"),e.fragment.code.add(" }"),e.fragment.code.add(" "));for(const d of n)e.fragment.code.add(` ${d.outVariableName} = ${d.variableName};`);e.fragment.code.add("}")}_insertInputs(e,t){e[t].code.add("// INPUTS: "),e[t].code.add("// --------------------------------------------------------- ");for(const a of this.inputs())if(a.isUsed&&"builtin"!==a.variableInputType)if("array"===a.node.type)e[t].code.add(` ${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}];`);else if("array-2d"===a.node.type)e[t].code.add(` ${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}]; // Emulated 2D Array. Not supported by ES3.0`);else{const o=[...a.qualifiers,a.variableInputType].join(" ");e[t].code.add(` ${o.padEnd(10)} ${a.node.type.padEnd(9)} ${a.variableName};`)}}}function n(e){switch(e.type){case"float":case"vec2":case"vec3":case"vec4":case"array":return null;case"int":case"ivec2":case"ivec3":case"ivec4":case"uint":case"uvec2":case"uvec3":case"uvec4":case"bool":case"bvec2":case"bvec3":case"bvec4":return"flat";case"mat2":case"mat3":case"mat4":case"sampler2D":case"array-2d":throw new Error(`InternalError: ${e.type} is not a valid output type`)}}export{o as ShaderGraphContext,t as ShaderInput,a as ShaderOutput};
2
+ import{cloneShaderNode as e}from"./ShaderGraphNode.js";class t{constructor(e,t,a,o=[]){this.variableName=e,this.variableInputType=t,this.node=a,this.qualifiers=o,this.type="shader-input",this.isUsed=!1}clone(){return new t(this.variableName,this.variableInputType,e(this.node),[...this.qualifiers])}}class a{constructor(e,t,a,o=[]){this.outVariableName=e,this.outVariableType=t,this.node=a,this.qualifiers=o,this.type="shader-output"}clone(){const t=new a(this.outVariableName,this.outVariableType,e(this.node),[...this.qualifiers]);return t.variableName=this.variableName,t}}class o{static createVertex(e,n,s,d,i,u,p){const c=[];for(const a in e){const o=e[a],r=s.get(a);r?c.push(new t(r,"builtin",o)):c.push(new t("a_"+a,"in",o))}for(const a of d){const e=a.uniformHydrated;c.push(new t(a.uniformName,"uniform",e))}for(const a of i){const e=a.textureHydrated;c.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in n){const e=n[t];if("glPosition"===t)h.push(new a("gl_Position","builtin",e));else if("glPointSize"===t)h.push(new a("gl_PointSize","builtin",e));else{const o=r(e),n=[];o&&n.push(o),h.push(new a("v_"+t,"out",e,n))}}return new o(c,h,u,p)}static createFragment(e,r,n,s,d,i,u){const p=[],c=Array.from(i.rootOutputNodes());for(const a in e){const o=e[a],r=n.get(a);if(r){p.push(new t(r,"builtin",o));continue}const s=c.find(e=>e.node===o);s&&p.push(new t(s.outVariableName,"in",o))}for(const a of s){const e=a.uniformHydrated;p.push(new t(a.uniformName,"uniform",e))}for(const a of d){const e=a.textureHydrated;p.push(new t(a.textureName,"uniform",e))}const h=[];for(const t in r){const e=r[t],o=n.get(t);switch(t){case"discard":h.push(new a(null,"discard",e));break;case"fragData0":h.push(new a("fragData0","fragData0",e));break;case"fragData1":h.push(new a("fragData1","fragData1",e));break;case"fragData2":h.push(new a("fragData2","fragData2",e));break;case"fragData3":h.push(new a("fragData3","fragData3",e));break;default:o?h.push(new a(o,"builtin",e)):h.push(new a(t,"out",e))}}return new o(p,h,u)}constructor(e,t,a,o){this.type="shader-graph-context",this.indent=0,this.body="",this.varCount=0,this._arrayReadVersions=new Map,this._inputShaderTypesByNodeUid=new Map,this._nodeEmitMap=new Map;for(const r of e)this._inputShaderTypesByNodeUid.set(r.node.uid,r);this._outputShaderTypes=t,this._transformFeedbackBindings=a,this._transformFeedbackNames=new Set(a.map(e=>"v_"+e.propertyKey)),this._usedInFragmentShader=o}shouldPruneOutputNode(e){return!!this._usedInFragmentShader&&("builtin"!==e.outVariableType&&(!this._transformFeedbackNames.has(e.outVariableName)&&!this._usedInFragmentShader.has(e.node.uid)))}setEmit(e,t){this._nodeEmitMap.set(e.uid,t)}getEmit(e){return this._nodeEmitMap.get(e.uid)}inputs(){return this._inputShaderTypesByNodeUid.values()}get arrayReadVersions(){return this._arrayReadVersions}createArrayReadVersions(){const e=[],t=[],a=new Set;this._arrayReadVersions.clear();for(const o of this.rootOutputNodes())this.shouldPruneOutputNode(o)||(t.push(o.node),a.add(o.node.uid));for(let o=0;o<t.length;o++){const r=t[o];"array-read-node"===r.shaderType&&e.push(r);for(const e of r.children)e&&"number"!=typeof e&&"boolean"!=typeof e&&!a.has(e.uid)&&(a.add(e.uid),t.push(e))}for(const o of e){let e=this._arrayReadVersions.get(o.version.uid);e||(e=[],this._arrayReadVersions.set(o.version.uid,e)),e.push(o)}}getInput(e){return this._inputShaderTypesByNodeUid.get(e.uid)}*rootOutputNodes(){for(const e of this._outputShaderTypes)yield e}*nodes(){const e=[];for(const t of this._outputShaderTypes.values())e.push(t.node);for(;e.length;){const t=e.pop();"number"!=typeof t&&"boolean"!=typeof t&&e.push(...t.children.filter(Boolean)),yield t}}*nodesOfTypeOrFunction(){for(const e of this.nodes())"number"!=typeof e&&"boolean"!=typeof e&&(yield e)}createSubgraphContext(){const e=this.clone();return e.body="",e.indent=this.indent+2,e._nodeEmitMap=new Map(this._nodeEmitMap),e}clone(){const e=new o([],this._outputShaderTypes,this._transformFeedbackBindings,this._usedInFragmentShader);return e._inputShaderTypesByNodeUid=this._inputShaderTypesByNodeUid,e.indent=this.indent,e.body=this.body,e.varCount=this.varCount,e._arrayReadVersions=this._arrayReadVersions,e._nodeEmitMap=this._nodeEmitMap,e}insertVertexShader(e){e.vertex.code.add(""),this._insertInputs(e,"vertex"),e.vertex.code.add(""),e.vertex.code.add("// OUTPUTS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this.rootOutputNodes()){const a="builtin"===t.outVariableType;if(!this.shouldPruneOutputNode(t))if(a)e.vertex.code.add(`// ${t.outVariableType.padEnd(7)} ${t.node.type.padEnd(9)} ${t.outVariableName};`);else if("array"===t.node.type){const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.elementType.type.padEnd(9)} ${t.outVariableName}[${t.node.size}];`)}else{const a=[...t.qualifiers,t.outVariableType].join(" ");e.vertex.code.add(`${a.padEnd(10)} ${t.node.type.padEnd(9)} ${t.outVariableName};`)}}e.vertex.code.add(""),e.vertex.code.add("void main() {"),e.vertex.code.add(" "+this.body.split("\n").join("\n "));for(const t of this.rootOutputNodes())this.shouldPruneOutputNode(t)||e.vertex.code.add(` ${t.outVariableName} = ${t.variableName};`);e.vertex.code.add("}")}insertFragmentShader(e){this._insertInputs(e,"fragment"),e.fragment.code.add(""),e.fragment.code.add("// OUTPUTS: "),e.fragment.code.add("// --------------------------------------------------------- ");let t=0;for(const n of this.rootOutputNodes())"builtin"===n.outVariableType?e.fragment.code.add(`// ${n.outVariableType.padEnd(7)} ${n.node.type.padEnd(9)} ${n.outVariableName};`):"discard"===n.outVariableType||e.outputs.add(n.outVariableName,n.node.type,t++);e.fragment.code.add(""),e.fragment.code.add("void main() {"),e.fragment.code.add(" "+this.body.split("\n").join("\n "));const a=Array.from(this.rootOutputNodes()),o=a.find(e=>"discard"===e.outVariableType),r=a.filter(e=>"discard"!==e.outVariableType);o&&(e.fragment.code.add(` if (${o.variableName}) {`),e.fragment.code.add(" discard;"),e.fragment.code.add(" }"),e.fragment.code.add(" "));for(const n of r)e.fragment.code.add(` ${n.outVariableName} = ${n.variableName};`);e.fragment.code.add("}")}_insertInputs(e,t){e[t].code.add("// INPUTS: "),e[t].code.add("// --------------------------------------------------------- ");for(const a of this.inputs())if(a.isUsed&&"builtin"!==a.variableInputType)if("array"===a.node.type)e[t].code.add(` ${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}];`);else if("array-2d"===a.node.type)e[t].code.add(` ${a.variableInputType.padEnd(10)} ${a.node.elementType.type.padEnd(9)} ${a.variableName}[${a.node.size}]; // Emulated 2D Array. Not supported by ES3.0`);else{const o=[...a.qualifiers,a.variableInputType].join(" ");e[t].code.add(` ${o.padEnd(10)} ${a.node.type.padEnd(9)} ${a.variableName};`)}}}function r(e){switch(e.type){case"float":case"vec2":case"vec3":case"vec4":case"array":return null;case"int":case"ivec2":case"ivec3":case"ivec4":case"uint":case"uvec2":case"uvec3":case"uvec4":case"bool":case"bvec2":case"bvec3":case"bvec4":return"flat";case"mat2":case"mat3":case"mat4":case"sampler2D":case"array-2d":throw new Error(`InternalError: ${e.type} is not a valid output type`)}}export{o as ShaderGraphContext,t as ShaderInput,a as ShaderOutput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- function t(t){return t.split(" ").map((t,e)=>e>0?t.charAt(0).toUpperCase()+t.slice(1):t).join("")}function e(t,e){const s=[];for(s.push(e);s.length;){const e=s.pop();if("object"==typeof e&&!t.has(e.uid)){t.add(e.uid);for(const t of e.children)s.push(t)}}}class s{constructor(){this.uid=s.NodeCount++,this._debugName=null,this._isMutable=!1,this.isImplicit=!1}static{this.NodeCount=0}get isMutable(){return this._isMutable}setMutable(){return this._isMutable=!0,this}setDebugName(e){return e=t(e),this._debugName=e,this.isImplicit&&this.children[0]instanceof s&&this.children[0].setDebugName(e),this}get debugInfo(){return{name:this._debugName??""}}cloneInto(t){t._debugName=this._debugName,t._isMutable=this._isMutable,t.isImplicit=this.isImplicit,t.uid=this.uid}}function i(t){return"object"==typeof t?t.clone():t}class r extends s{constructor(){super(...arguments),this.shaderType="primitive-node"}}class n extends s{constructor(t){super(),this.child=t,this.shaderType="scope-node"}get children(){return[this.child]}clone(){const t=new n(i(this.child));return this.cloneInto(t),t}}class h extends s{constructor(t){super(),this.text=t,this.shaderType="text-node"}get children(){return[]}clone(){const t=new h(this.text);return this.cloneInto(t),t}}class c extends s{constructor(t,e,s){super(),this.property=t,this.target=e,this.returnType=s,this.shaderType="property-access-node"}get children(){const t=[this.target];return"string"!=typeof this.property&&t.push(this.property),t}clone(){const t=new c(this.property,i(this.target),this.returnType);return this.cloneInto(t),t}}class o extends s{constructor(t,e,s,i){super(),this.x=t,this.y=e,this.target=s,this.returnType=i,this.shaderType="property-access-2d-node"}get children(){return[this.target,this.x,this.y]}clone(){const t=new o(this.x,this.y,i(this.target),this.returnType);return this.cloneInto(t),t}}class u extends s{constructor(t,e,s){super(),this.condition=t,this.ifTrue=e,this.ifFalse=s,this.shaderType="condition-node"}get children(){return[this.condition,this.ifTrue,this.ifFalse]}clone(){const t=i(this.ifTrue),e=this.ifFalse?i(this.ifFalse):null,s=new u(this.condition,t,e);return this.cloneInto(s),s}}class p extends s{constructor(t,e,s,i){super(),this.captureList=t,this.returnType=e,this.generator=i,this.shaderType="block-node",s&&(this.subgraph=new n(s))}get children(){return Object.keys(this.captureList).map(t=>this.captureList[t]).concat(this.subgraph??[])}clone(){const t={};for(const s in this.captureList)t[s]=i(this.captureList[s]);const e=new p(t,this.returnType,this.subgraph?i(this.subgraph.child):this.subgraph,this.generator);return this.cloneInto(e),e}}class a extends s{constructor(t,e,s,i,r,n=!1){super(),this.token=t,this._children=e,this.isInfix=s,this.isPropertyAccess=i,this.returnType=r,this.isTernary=n,this.shaderType="function-node"}get children(){return this._children}clone(){const t=new a(this.token,this._children.map(i),this.isInfix,this.isPropertyAccess,this.returnType,this.isTernary);return this.cloneInto(t),t}}export{p as ShaderBlockNode,u as ShaderConditionNode,a as ShaderFunctionNode,s as ShaderNode,r as ShaderPrimitiveNode,o as ShaderPropertyAccess2DNode,c as ShaderPropertyAccessNode,n as ShaderScopeNode,h as ShaderTextNode,i as cloneShaderNode,e as setReachableUids};
2
+ function t(t){return t.split(" ").map((t,e)=>e>0?t.charAt(0).toUpperCase()+t.slice(1):t).join("")}function e(t,e){const s=[];for(s.push(e);s.length;){const e=s.pop();if("object"==typeof e&&!t.has(e.uid)){t.add(e.uid);for(const t of e.children)s.push(t)}}}class s{constructor(){this.uid=s.NodeCount++,this._debugName=null,this._isMutable=!1,this.isImplicit=!1}static{this.NodeCount=0}get isMutable(){return this._isMutable}setMutable(){return this._isMutable=!0,this}setDebugName(e){return e=t(e),this._debugName=e,this.isImplicit&&this.children[0]instanceof s&&this.children[0].setDebugName(e),this}get debugInfo(){return{name:this._debugName??""}}cloneInto(t){t._debugName=this._debugName,t._isMutable=this._isMutable,t.isImplicit=this.isImplicit,t.uid=this.uid}}function i(t){return"object"==typeof t?t.clone():t}class r extends s{constructor(){super(...arguments),this.shaderType="primitive-node"}}class n extends s{constructor(t){super(),this.child=t,this.shaderType="scope-node"}get children(){return[this.child]}clone(){const t=new n(i(this.child));return this.cloneInto(t),t}}class h extends s{constructor(t){super(),this.text=t,this.shaderType="text-node"}get children(){return[]}clone(){const t=new h(this.text);return this.cloneInto(t),t}}class o extends s{constructor(t,e,s){super(),this.property=t,this.target=e,this.returnType=s,this.shaderType="property-access-node"}get children(){const t=[this.target];return"string"!=typeof this.property&&t.push(this.property),t}clone(){const t=new o(this.property,i(this.target),this.returnType);return this.cloneInto(t),t}}class c extends s{constructor(t,e,s,i){super(),this.x=t,this.y=e,this.target=s,this.returnType=i,this.shaderType="property-access-2d-node"}get children(){return[this.target,this.x,this.y]}clone(){const t=new c(this.x,this.y,i(this.target),this.returnType);return this.cloneInto(t),t}}class u extends s{constructor(t,e,s){super(),this.previousVersion=t,this.index=e,this.value=s,this.shaderType="array-write-node"}get children(){return[this.previousVersion,this.value,this.index]}clone(){const t=new u(i(this.previousVersion),i(this.index),i(this.value));return this.cloneInto(t),t}}class a extends s{constructor(t,e,s){super(),this.version=t,this.index=e,this.returnType=s,this.shaderType="array-read-node"}get children(){return[this.version,this.index]}clone(){const t=new a(i(this.version),i(this.index),this.returnType);return this.cloneInto(t),t}}class p extends s{constructor(t,e,s){super(),this.condition=t,this.ifTrue=e,this.ifFalse=s,this.shaderType="condition-node"}get children(){return this.ifFalse?[this.condition,this.ifTrue,this.ifFalse]:[this.condition,this.ifTrue]}clone(){const t=i(this.ifTrue),e=this.ifFalse?i(this.ifFalse):null,s=new p(this.condition,t,e);return this.cloneInto(s),s}}class d extends s{constructor(t,e,s,i){super(),this.captureList=t,this.returnType=e,this.generator=i,this.shaderType="block-node",s&&(this.subgraph=new n(s))}get children(){return Object.keys(this.captureList).map(t=>this.captureList[t]).concat(this.subgraph??[])}clone(){const t={};for(const s in this.captureList)t[s]=i(this.captureList[s]);const e=new d(t,this.returnType,this.subgraph?i(this.subgraph.child):this.subgraph,this.generator);return this.cloneInto(e),e}}class l extends s{constructor(t,e,s,i,r,n=!1){super(),this.token=t,this._children=e,this.isInfix=s,this.isPropertyAccess=i,this.returnType=r,this.isTernary=n,this.shaderType="function-node"}get children(){return this._children}clone(){const t=new l(this.token,this._children.map(i),this.isInfix,this.isPropertyAccess,this.returnType,this.isTernary);return this.cloneInto(t),t}}export{a as ShaderArrayReadNode,u as ShaderArrayWriteNode,d as ShaderBlockNode,p as ShaderConditionNode,l as ShaderFunctionNode,s as ShaderNode,r as ShaderPrimitiveNode,c as ShaderPropertyAccess2DNode,o as ShaderPropertyAccessNode,n as ShaderScopeNode,h as ShaderTextNode,i as cloneShaderNode,e as setReachableUids};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{ShaderPrimitiveNode as e,cloneShaderNode as n,ShaderConditionNode as r,ShaderPropertyAccessNode as i,ShaderFunctionNode as c,ShaderBlockNode as u,ShaderPropertyAccess2DNode as s,ShaderScopeNode as o}from"./ShaderGraphNode.js";var h,l,a,f,p,d,y,w,m,v,b,g,x,I;function E(t){switch(t.type){case"uint":return Y;case"uvec2":return _;case"uvec3":return A;case"uvec4":return G;default:throw new Error("Found unexpected type")}}function $(t){switch(t.type){case"float":return H;case"vec2":return V;case"vec3":return J;case"vec4":return K;default:throw new Error("Found unexpected type")}}function T(t){switch(t.type){case"int":return Y;case"ivec2":return _;case"ivec3":return A;case"ivec4":return G;default:throw new Error("Found unexpected type")}}function z(t){switch(t.type){case"float":return tt;case"vec2":return et;case"vec3":return nt;case"vec4":return rt;default:throw new Error("Found unexpected type")}}function N(t){switch(t.type){case"bool":case"float":case"int":case"uint":return L;case"bvec2":case"vec2":case"ivec2":case"uvec2":return O;case"bvec3":case"vec3":case"ivec3":case"uvec3":return Q;case"bvec4":case"vec4":case"ivec4":case"uvec4":return Z;default:throw new Error("Unable to handle type")}}function D(t){switch(t.type){case"bool":case"bvec2":case"bvec3":case"bvec4":return L;case"float":case"vec2":case"vec3":case"vec4":return Y;case"int":case"ivec2":case"ivec3":case"ivec4":return tt;case"uint":case"uvec2":case"uvec3":case"uvec4":return H;default:throw new Error("Unable to handle type")}}function F(t){switch(t.type){case"float":case"int":case"uint":case"bool":case"sampler2D":return 1;case"vec2":case"ivec2":case"uvec2":case"bvec2":return 2;case"vec3":case"ivec3":case"uvec3":case"bvec3":return 3;case"vec4":case"ivec4":case"uvec4":case"bvec4":case"mat2":return 4;case"mat3":return 9;case"mat4":return 16;case"array":case"array-2d":return t.size*F(t.elementType)}}function k(t){const e=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const n of e)if(n.includes(t))return n.map(t=>st[t]);throw new Error("Unable to find type family")}function M(t){return new Proxy(t,{get(e,n){if("constructor"===n)return new Proxy(e.constructor,{construct:(t,e,n)=>M(new t(...e))});if(n in e)return e[n];if("string"==typeof n){const e=k(t.type);return wt(t,n,e[n.length-1])}}})}function S(t){return new Proxy(t,{construct:(t,e,n)=>M(new t(...e))})}function R(t){return new Proxy(t,{get(e,n){if(n in e)return e[n];const r=j(n,e.size);return null!=r?wt(t,`[${r}]`,t.elementType.constructor):void 0},set(t,e,n,r){if(e in t)return Reflect.set(t,e,n,r);const i=j(e,t.size);return null!=i&&(P(t,n),t.children[i]=n,!0)}})}function j(t,e){if("string"!=typeof t||!/^(0|[1-9]\d*)$/.test(t))return null;const n=Number(t);if(!Number.isSafeInteger(n))return null;if(n<0||n>=e)throw new q;return n}function P(t,e){if("object"!=typeof e||null==e||!("type"in e))throw new TypeError(`Expected array element of type ${t.elementType.type}`);if(e.type!==t.elementType.type)throw new TypeError(`Expected array element of type ${t.elementType.type}, got ${e.type}`)}function B(t){return new Proxy(t,{construct:(t,e,n)=>R(new t(...e))})}class q extends Error{}let U=class extends e{static{h=this}static{this.type="array"}constructor(t,e){super(),this.elementType=t,this.size=e,this.type="array",this.children=Array(e).fill(t)}clone(){const t=new h(n(this.elementType),this.size);return t.children=this.children.map(n),super.cloneInto(t),t}get(t,e){const n=new tt(t),r=null!=e?new tt(e):null;if(null!=r){return mt(this,n,r,D(this.elementType.constructor))}return wt(this,n,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(t,e,n){return Tt(this,t,e,n)}glslFindIndex(t,e,n){return zt(this,t,e,n)}static ofType(t,e){const n={construct:(n,r)=>new h(new t,e)};return new Proxy(h,n)}};U=h=t([B],U);class C extends e{static{this.type="array-2d"}constructor(t,e,n,r=!1){super(),this.elementType=t,this.xSize=e,this.ySize=n,this.isRowMajor=r,this.type="array-2d",this.children=Array(e*n).fill(t)}clone(){const t=new C(n(this.elementType),this.xSize,this.ySize,this.isRowMajor);return t.children=this.children.map(n),super.cloneInto(t),t}get size(){return this.xSize*this.ySize}get(t,e){return this.isRowMajor?this._getRowMajor(t,e):this._getColumnMajor(t,e)}_getColumnMajor(t,e){const n=new tt(t);return wt(this,new tt(e).add(n.multiply(this.xSize)),this.elementType.constructor)}_getRowMajor(t,e){const n=new tt(t),r=new tt(e);return wt(this,n.add(r.multiply(this.ySize)),this.elementType.constructor)}static ofType(t,e,n,r=!1){return new Proxy(U,{construct:(i,c)=>new C(new t,e,n,r)})}}class X extends e{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}static{this.type="sampler2D"}clone(){const t=new X;return t.children=this.children.map(n),super.cloneInto(t),t}}class Y extends e{static{this.type="float"}constructor(t){super(),this.type="float",this.children=[t]}clone(){const t=new Y(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return kt(this,"number"==typeof t?W(t,Y):t)}divide(t){return Mt(this,"number"==typeof t?W(t,Y):t)}add(t){return St(this,"number"==typeof t?W(t,Y):t)}subtract(t){return Rt(this,"number"==typeof t?W(t,Y):t)}}let _=class extends e{static{l=this}static{this.type="vec2"}constructor(t,e){super(),this.type="vec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new l(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return wt(this,"[0]",Y)}get 1(){return wt(this,"[1]",Y)}get 2(){throw new q}get 3(){throw new q}multiply(t){return kt(this,"number"==typeof t?W(t,Y):t)}divide(t){return Mt(this,"number"==typeof t?W(t,Y):t)}add(t){return St(this,"number"==typeof t?W(t,Y):t)}subtract(t){return Rt(this,"number"==typeof t?W(t,Y):t)}};_=l=t([S],_);let A=class extends e{static{a=this}static{this.type="vec3"}constructor(t,e,n){super(),this.type="vec3",this.children=[t,e,n].filter(t=>null!=t)}get 0(){return wt(this,"[0]",Y)}get 1(){return wt(this,"[1]",Y)}get 2(){return wt(this,"[2]",Y)}get 3(){throw new q}clone(){const t=new a(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}multiply(t){return kt(this,"number"==typeof t?W(t,Y):t)}divide(t){return Mt(this,"number"==typeof t?W(t,Y):t)}add(t){return St(this,"number"==typeof t?W(t,Y):t)}subtract(t){return Rt(this,"number"==typeof t?W(t,Y):t)}};A=a=t([S],A);let G=class extends e{static{f=this}static{this.type="vec4"}constructor(t,e,n,r){super(),this.type="vec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new f(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return wt(this,"[0]",Y)}get 1(){return wt(this,"[1]",Y)}get 2(){return wt(this,"[2]",Y)}get 3(){return wt(this,"[3]",Y)}multiply(t){return kt(this,"number"==typeof t?W(t,Y):t)}divide(t){return Mt(this,"number"==typeof t?W(t,Y):t)}add(t){return St(this,"number"==typeof t?W(t,Y):t)}subtract(t){return Rt(this,"number"==typeof t?W(t,Y):t)}};G=f=t([S],G);let H=class extends e{static{p=this}static{this.type="uint"}constructor(t){super(),this.type="uint",this.children=[t]}clone(){const t=new p(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return kt(this,W(t,p))}add(t){return St(this,W(t,p))}subtract(t){return Rt(this,W(t,p))}divide(t){return Mt(this,W(t,p))}};H=p=t([S],H);let V=class extends e{static{d=this}static{this.type="uvec2"}constructor(t,e){super(),this.type="uvec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new d(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return wt(this,"[0]",tt)}get 1(){return wt(this,"[1]",tt)}get 2(){throw new q}get 3(){throw new q}multiply(t){return kt(this,"number"==typeof t?W(t,H):t)}divide(t){return Mt(this,"number"==typeof t?W(t,H):t)}add(t){return St(this,"number"==typeof t?W(t,H):t)}subtract(t){return Rt(this,"number"==typeof t?W(t,H):t)}};V=d=t([S],V);let J=class extends e{static{y=this}static{this.type="uvec3"}constructor(t,e,n){super(),this.type="uvec3",this.children=[t,e,n].filter(t=>null!=t)}clone(){const t=new y(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}get 0(){return wt(this,"[0]",H)}get 1(){return wt(this,"[1]",H)}get 2(){return wt(this,"[2]",H)}get 3(){throw new q}multiply(t){return kt(this,"number"==typeof t?W(t,H):t)}divide(t){return Mt(this,"number"==typeof t?W(t,H):t)}add(t){return St(this,"number"==typeof t?W(t,H):t)}subtract(t){return Rt(this,"number"==typeof t?W(t,H):t)}};J=y=t([S],J);let K=class extends e{static{w=this}static{this.type="uvec4"}constructor(t,e,n,r){super(),this.type="uvec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new w(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return wt(this,"[0]",H)}get 1(){return wt(this,"[1]",H)}get 2(){return wt(this,"[2]",H)}get 3(){return wt(this,"[3]",H)}multiply(t){return kt(this,"number"==typeof t?W(t,H):t)}divide(t){return Mt(this,"number"==typeof t?W(t,H):t)}add(t){return St(this,"number"==typeof t?W(t,H):t)}subtract(t){return Rt(this,"number"==typeof t?W(t,H):t)}};K=w=t([S],K);class L extends e{static{this.type="bool"}constructor(t){super(),this.type="bool",this.children=[t]}and(t){return Qt(this,t)}or(t){return Jt(this,t)}xor(t){return Lt(this,t)}clone(){const t=new L(n(this.children[0]));return super.cloneInto(t),t}}let O=class extends e{static{m=this}static{this.type="bvec2"}constructor(t,e){super(),this.type="bvec2",this.children=[t,e].filter(t=>null!=t)}all(){return ne(this)}any(){return re(this)}clone(){const t=new m(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};O=m=t([S],O);let Q=class extends e{static{v=this}static{this.type="bvec3"}constructor(t,e,n){super(),this.type="bvec3",this.children=[t,e,n].filter(t=>null!=t)}all(){return ne(this)}any(){return re(this)}clone(){const t=new v(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};function W(t,e){if("number"==typeof t){return new e(t)}return t}Q=v=t([S],Q);let Z=class extends e{static{b=this}static{this.type="bvec4"}constructor(t,e,n,r){super(),this.type="bvec4",this.children=[t,e,n,r].filter(t=>null!=t)}all(){return ne(this)}any(){return re(this)}clone(){const t=new b(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};Z=b=t([S],Z);class tt extends e{static{this.type="int"}constructor(t){super(),this.type="int",this.children=[t]}multiply(t){return kt(this,W(t,tt))}add(t){return St(this,W(t,tt))}subtract(t){return Rt(this,W(t,tt))}divide(t){return Mt(this,W(t,tt))}clone(){const t=new tt(n(this.children[0]));return super.cloneInto(t),t}}let et=class extends e{static{g=this}static{this.type="ivec2"}constructor(t,e){super(),this.type="ivec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new g(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return wt(this,"[0]",tt)}get 1(){return wt(this,"[1]",tt)}get 2(){throw new q}get 3(){throw new q}multiply(t){return kt(this,"number"==typeof t?W(t,tt):t)}divide(t){return Mt(this,"number"==typeof t?W(t,tt):t)}add(t){return St(this,"number"==typeof t?W(t,tt):t)}subtract(t){return Rt(this,"number"==typeof t?W(t,tt):t)}};et=g=t([S],et);let nt=class extends e{static{x=this}static{this.type="ivec3"}constructor(t,e,n){super(),this.type="ivec3",this.children=[t,e,n].filter(t=>null!=t)}clone(){const t=new x(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}get 0(){return wt(this,"[0]",tt)}get 1(){return wt(this,"[1]",tt)}get 2(){return wt(this,"[2]",tt)}get 3(){throw new q}multiply(t){return kt(this,"number"==typeof t?W(t,tt):t)}divide(t){return Mt(this,"number"==typeof t?W(t,tt):t)}add(t){return St(this,"number"==typeof t?W(t,tt):t)}subtract(t){return Rt(this,"number"==typeof t?W(t,tt):t)}};nt=x=t([S],nt);let rt=class extends e{static{I=this}static{this.type="ivec4"}constructor(t,e,n,r){super(),this.type="ivec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new I(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return wt(this,"[0]",tt)}get 1(){return wt(this,"[1]",tt)}get 2(){return wt(this,"[2]",tt)}get 3(){return wt(this,"[3]",tt)}multiply(t){return kt(this,"number"==typeof t?W(t,tt):t)}divide(t){return Mt(this,"number"==typeof t?W(t,tt):t)}add(t){return St(this,"number"==typeof t?W(t,tt):t)}subtract(t){return Rt(this,"number"==typeof t?W(t,tt):t)}};rt=I=t([S],rt);class it extends e{static{this.type="mat2"}constructor(t,e,n,r){super(),this.type="mat2",this.children=[t,e,n,r]}clone(){const t=new it(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get(t,e){return mt(this,new tt(t),new tt(e),Y)}multiply(t){return kt(this,t)}}class ct extends e{static{this.type="mat3"}static identity(){return new ct(1,0,0,0,1,0,0,0,1)}static fromRotation(t){const e=on(t),n=le(t);return new ct(n,e,0,It(e),n,0,0,0,1)}constructor(t,e,n,r,i,c,u,s,o){super(),this.type="mat3",this.children=[t,e,n,r,i,c,u,s,o]}add(t){return St(this,t)}multiply(t){return kt(this,t)}get(t,e){return mt(this,new tt(t),new tt(e),Y)}clone(){const t=new ct(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]));return super.cloneInto(t),t}}class ut extends e{static{this.type="mat4"}static identity(){return new ut(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(t,e,n,r,i,c,u,s,o,h,l,a,f,p,d,y){super(),this.type="mat4",this.children=[t,e,n,r,i,c,u,s,o,h,l,a,f,p,d,y]}static fromColumns(t,e,n,r){return new ut(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,n.x,n.y,n.z,n.w,r.x,r.y,r.z,r.w)}multiply(t){return kt(this,t)}get(t,e){return mt(this,new tt(t),new tt(e),Y)}clone(){const t=new ut(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]),n(this.children[9]),n(this.children[10]),n(this.children[11]),n(this.children[12]),n(this.children[13]),n(this.children[14]),n(this.children[15]));return super.cloneInto(t),t}}const st={float:Y,vec2:_,vec3:A,vec4:G,int:tt,ivec2:et,ivec3:nt,ivec4:rt,uint:H,uvec2:V,uvec3:J,uvec4:K,bool:L,bvec2:O,bvec3:Q,bvec4:Z},ot=(...t)=>new tt(...t),ht=(...t)=>new Y(...t),lt=(...t)=>new _(...t),at=(...t)=>new A(...t),ft=(...t)=>new G(...t),pt=(...t)=>new it(...t),dt=(...t)=>new ct(...t),yt=(...t)=>new ut(...t);function wt(t,e,n){const r=new n(new i(e,t,n));return r.isImplicit=!0,r}function mt(t,e,n,r){const i=new r(new s(e,n,t,r));return i.isImplicit=!0,i}function vt(t,e,n,r=null){if(r){const i=new r,u=new r(new c(t,[e,n],!0,!1,i));return u.isImplicit=!0,u}if("float"===e.type||"int"===e.type){const r=new n.constructor(new c(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}if(("mat2"===e.type||"mat3"===e.type||"mat4"===e.type)&&"float"!==n.type){const r=new n.constructor(new c(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}const i=new e.constructor(new c(t,[e,n],!0,!1,e.constructor));return i.isImplicit=!0,i}function bt(t,e,n=e.constructor){const r=new n(new c(t,[e],!1,!1,n));return r.isImplicit=!0,r}function gt(t,e,n,r=e.constructor){const i=new r(new c(t,[e,n],!1,!1,r));return i.isImplicit=!0,i}function xt(t,e,n,r,i=e.constructor){const u=new i(new c(t,[e,n,r],!1,!1,i));return u.isImplicit=!0,u}function It(t){return kt(t,ht(-1))}function Et(t,e,n,r){return new e(new u(t,e,n,r))}function $t(t,e){const n="function"==typeof t?t():t,r=new n.constructor(new o(n).setDebugName(e));return r.isImplicit=!0,r}function Tt(t,e,n=0,r=t.size){const i=new tt(n).setMutable().setDebugName("FindIndexIterator"),c=e(t.get(i)).setDebugName("FindIndexPredicate"),u=Et({iter:i},tt,c,({out:t,iter:e,subgraph:n})=>`\n${t} = -1;\n\nfor (; ${e} < ${r}; ${e}++) {\n\n${n.body}\n\n if (${n.varName}) {\n ${t} = ${e};\n break;\n }\n\n}\n`).setDebugName("FindIndexBlock");return u}function zt(t,e,n=0,r=t.size){const i=Et({array:t},tt,null,({out:t,array:i})=>`\n${t} = -1;\nfor (int i = ${n}; i < ${r}; i++) {\n bool condition;\n ${e({array:i,i:"i",out:"condition"})}\n if (condition) {\n ${t} = i;\n break;\n }\n}\n`).setDebugName("GlslFindIndexBlock");return i}function Nt(t,e,n){const i="function"==typeof e?e():e,c="function"==typeof n?n():n,u=new i.constructor(new r(t,i,c));return u.isImplicit=!0,u}function Dt(...t){const e=t.map(([t,e])=>"function"==typeof e?[t,e()]:[t,e]),n=e[0][1].constructor,r=e.findIndex(t=>!0===t[0]);if(-1===r)throw new Error("A cond must have a fallthrough case with `true`/; ");const i=e.slice(0,r),c=e[r][1],u=new n(i.reduceRight((t,e)=>Nt(e[0],e[1],t),c));return u.isImplicit=!0,u}function Ft(t,e){const n=new e.constructor(new r(t,e,null));return n.isImplicit=!0,n}function kt(t,e){return vt("*",t,e)}function Mt(t,e){return vt("/",t,e)}function St(t,e){return vt("+",t,e)}function Rt(t,e){return vt("-",t,e)}function jt(t,e){return vt("%",t,e)}function Pt(t,e){return vt("<<",t,e)}function Bt(t,e){return vt(">>",t,e)}function qt(t,e){return vt("&",t,e)}function Ut(t,e){return vt("|",t,e)}function Ct(t,e){return vt("^",t,e)}function Xt(t){return bt("~",t)}function Yt(t,e){return vt("==",t,e,L)}function _t(t,e){return vt("!=",t,e,L)}function At(t,e){return vt("<",t,e,L)}function Gt(t,e){return vt("<=",t,e,L)}function Ht(t,e){return vt(">",t,e,L)}function Vt(t,e){return vt(">=",t,e,L)}function Jt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Kt(t,e),t[0])}function Kt(t,e){return vt("||",t,e,L)}function Lt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Ot(t,e),t[0])}function Ot(t,e){return vt("^^",t,e,L)}function Qt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Wt(t,e),t[0])}function Wt(t,e){return vt("&&",t,e,L)}function Zt(t){return bt("abs",t)}function te(t){return bt("acos",t)}function ee(t){return bt("acosh",t)}function ne(t){return bt("all",t,L)}function re(t){return bt("any",t,L)}function ie(t){return bt("asin",t)}function ce(t){return bt("asinh",t)}function ue(t,e){return null==e?bt("atan",t):gt("atan",t,e,t.constructor)}function se(t){return bt("atanh",t)}function oe(t){return bt("ceil",t)}function he(t,e,n){return xt("clamp",t,e,n,t.constructor)}function le(t){return bt("cos",t)}function ae(t){return bt("cosh",t)}function fe(t,e){return gt("cross",t,e,t.constructor)}function pe(t){return bt("dFdX",t)}function de(t){return bt("dFdY",t)}function ye(t){return bt("degrees",t)}function we(t){return bt("determinant",t,Y)}function me(t,e){return gt("distance",t,e,Y)}function ve(t,e){return gt("dot",t,e,Y)}function be(t,e){return gt("equal",t,e,N(t))}function ge(t,e){return gt("greaterThan",t,e,N(t))}function xe(t,e){return gt("greaterThanEqual",t,e,N(t))}function Ie(t){return bt("exp",t)}function Ee(t){return bt("exp2",t)}function $e(t,e,n){return xt("faceforward",t,e,n)}function Te(t){return bt("floatBitsToInt",t,z(t))}function ze(t){return bt("floatBitsToUint",t,$(t))}function Ne(t){return bt("floor",t)}function De(t){return bt("fract",t)}function Fe(t){return bt("fwidth",t)}function ke(t){return bt("intBitsToFloat",t,T(t))}function Me(t){return bt("uintBitsToFloat",t,E(t))}function Se(t){return bt("inverse",t,Y)}function Re(t){return bt("inversesqrt",t)}function je(t){return bt("isinf",t,N(t))}function Pe(t){return bt("isnan",t,N(t))}function Be(t){return bt("length",t,Y)}function qe(t,e){return gt("lessThan",t,e,N(t))}function Ue(t,e){return gt("lessThanEqual",t,e,N(t))}function Ce(t){return bt("log",t)}function Xe(t){return bt("log2",t)}function Ye(t,e){return gt("matrixCompMult",t,e)}function _e(t,e){return gt("max",t,e)}function Ae(t,e){return gt("min",t,e)}function Ge(t,e,n){return xt("mix",t,e,n)}function He(t,e){return gt("mod",t,e)}function Ve(t,e){throw new Error("modf not implemented")}function Je(t){return bt("normalize",t)}function Ke(t){return"bool"===t.type?bt("!",t):bt("not",t)}function Le(t,e){return gt("notEqual",t,e,N(t))}function Oe(t,e){throw new Error("Impl type?")}function Qe(t){return bt("packHalf2x16",t,H)}function We(t){return bt("packUnorm2x16",t,H)}function Ze(t){return bt("packSnorm2x16",t,H)}function tn(t,e){return gt("pow",t,e)}function en(t){return bt("radians",t)}function nn(t,e){return gt("reflect",t,e)}function rn(t,e,n){return xt("refract",t,e,n)}function cn(t){return bt("round",t)}function un(t){return bt("roundEven",t)}function sn(t){return bt("sign",t)}function on(t){return bt("sin",t)}function hn(t){return bt("sinh",t)}function ln(t,e,n){return xt("smoothstep",t,e,n)}function an(t){return bt("sqrt",t)}function fn(t,e){return gt("step",t,e,e.constructor)}function pn(t){return bt("tan",t)}function dn(t){return bt("tanh",t)}function yn(t,e,n){return xt("texelFetch",t,e,n,G)}function wn(t,e,n,r){throw new Error("Impl type")}function mn(t,e,n){throw new Error("Impl type")}function vn(t,e){return gt("texture",t,e,G)}function bn(t,e,n,r){throw new Error("Impl type")}function gn(t,e,n,r,i){throw new Error("Impl type")}function xn(t,e,n){throw new Error("Impl type")}function In(t,e,n,r){throw new Error("Impl type")}function En(t,e,n,r){throw new Error("Impl type")}function $n(t,e,n){throw new Error("Impl type")}function Tn(t,e,n,r){throw new Error("Impl type")}function zn(t,e,n,r,i){throw new Error("Impl type")}function Nn(t,e,n){throw new Error("Impl type")}function Dn(t,e,n,r){throw new Error("Impl type")}function Fn(t,e,n,r){throw new Error("Impl type")}function kn(t,e){throw new Error("Impl type")}function Mn(t){return bt("transpose",t)}function Sn(t){return bt("trunc",t)}function Rn(t){return bt("unpackHalf2x16",t,_)}function jn(t){return bt("unpackUnorm2x16",t,_)}function Pn(t){return bt("unpackSnorm2x16",t,_)}function Bn(t,e){const n=tn(new Y(2),new Y(e));return[new G(He(t.x,n),Ne(t.x.divide(n)),He(t.y,n),Ne(t.y.divide(n))),new G(He(t.z,n),Ne(t.z.divide(n)),He(t.w,n),Ne(t.w.divide(n)))]}function qn(t,e){const{initialValue:n,xRange:r,yRange:i,callback:c}=e,[u,s]=r,[o,h]=i,l=new tt(0).setMutable().setDebugName("iterX"),a=new tt(0).setMutable().setDebugName("iterY"),f=n.setMutable().setDebugName("accumulator"),p=c(f,t.get(l,a),l,a).setDebugName("callback"),d=Et({iterX:l,iterY:a,accumulator:f},n.constructor,p,({out:t,iterX:e,iterY:n,accumulator:r,subgraph:i})=>`\nfor (${n} = ${o}; ${n} < ${h}; ${n}++) {\n for (${e} = ${u}; ${e} < ${s}; ${e}++) {\n\n ${i.body}\n\n ${r} = ${i.varName};\n }\n}\n${t} = ${r};\n`).setDebugName("reduce2DBody");return d}export{O as BVec2,Q as BVec3,Z as BVec4,L as Bool,U as FixedArray,C as FixedArray2D,Y as Float,et as IVec2,nt as IVec3,rt as IVec4,tt as Int,it as Mat2,ct as Mat3,ut as Mat4,X as Sampler2D,H as UInt,V as UVec2,J as UVec3,K as UVec4,_ as Vec2,A as Vec3,G as Vec4,Kt as _or,Ot as _xor,Zt as abs,te as acos,ee as acosh,St as add,ne as all,Qt as and,re as any,ie as asin,ce as asinh,ue as atan,se as atanh,qt as bitAnd,Xt as bitNot,Ut as bitOr,Bt as bitRShift,Pt as bitShift,Ct as bitXor,Et as block,oe as ceil,he as clamp,Dt as cond,le as cos,ae as cosh,fe as cross,pe as dFdx,de as dFdy,wt as definePropertyAccess,mt as definePropertyAccess2D,ye as degrees,we as determinant,me as distance,Mt as divide,ve as dot,Yt as equal,be as equalComponent,Ie as exp,Ee as exp2,$e as faceforward,Tt as findIndex,ht as float,Te as floatBitsToInt,ze as floatBitsToUint,Ne as floor,De as fract,Fe as fwidth,F as getTypeElementLengthForType,zt as glslFindIndex,Ht as greaterThan,ge as greaterThanComponent,Vt as greaterThanEqual,xe as greaterThanEqualComponent,Nt as ifElse,ot as int,ke as intBitsToFloat,jt as intMod,Se as inverse,Re as inversesqrt,je as isinf,Pe as isnan,Be as length,At as lessThan,qe as lessThanComponent,Gt as lessThanEqual,Ue as lessThanEqualComponent,Ce as log,Xe as log2,pt as mat2,dt as mat3,yt as mat4,Ye as matrixCompMult,_e as max,Ae as min,Ge as mix,He as mod,Ve as modf,kt as multiply,$t as namedScope,It as negate,Je as normalize,Ke as not,_t as notEqual,Le as notEqualComponent,Jt as or,Oe as outerProduct,Qe as packHalf2x16,Ze as packSnorm2x16,We as packUnorm2x16,tn as pow,en as radians,qn as reduce2D,nn as reflect,rn as refract,cn as round,un as roundEven,sn as sign,on as sin,hn as sinh,ln as smoothstep,an as sqrt,fn as step,Rt as subtract,pn as tan,dn as tanh,yn as texelFetch,wn as texelFetchOffset,mn as texture,vn as texture2D,bn as textureGrad,gn as textureGradOffset,xn as textureLod,In as textureLodOffset,En as textureOffset,$n as textureProj,Tn as textureProjGrad,zn as textureProjGradOffset,Nn as textureProjLod,Dn as textureProjLodOffset,Fn as textureProjOffset,kn as textureSize,z as transformFloatToInt,$ as transformFloatToUInt,T as transformIntToFloat,N as transformTypeToBooleanType,E as transformUIntToFloat,Mn as transpose,Sn as trunc,Me as uintBitsToFloat,Rn as unpackHalf2x16,Pn as unpackSnorm2x16,jn as unpackUnorm2x16,Bn as unpackVec4,lt as vec2,at as vec3,ft as vec4,Ft as when,Lt as xor};
2
+ import{__decorate as t}from"tslib";import{ShaderPrimitiveNode as e,cloneShaderNode as n,ShaderConditionNode as r,ShaderPropertyAccessNode as i,ShaderFunctionNode as c,ShaderArrayWriteNode as s,ShaderBlockNode as u,ShaderPropertyAccess2DNode as o,ShaderArrayReadNode as h,ShaderScopeNode as l}from"./ShaderGraphNode.js";var a,f,p,d,y,w,m,v,b,g,x,I,E;function $(t){switch(t.type){case"uint":return C;case"uvec2":return X;case"uvec3":return Y;case"uvec4":return _;default:throw new Error("Found unexpected type")}}function z(t){switch(t.type){case"float":return A;case"vec2":return G;case"vec3":return H;case"vec4":return V;default:throw new Error("Found unexpected type")}}function T(t){switch(t.type){case"int":return C;case"ivec2":return X;case"ivec3":return Y;case"ivec4":return _;default:throw new Error("Found unexpected type")}}function N(t){switch(t.type){case"float":return W;case"vec2":return Z;case"vec3":return tt;case"vec4":return et;default:throw new Error("Found unexpected type")}}function D(t){switch(t.type){case"bool":case"float":case"int":case"uint":return J;case"bvec2":case"vec2":case"ivec2":case"uvec2":return K;case"bvec3":case"vec3":case"ivec3":case"uvec3":return L;case"bvec4":case"vec4":case"ivec4":case"uvec4":return Q;default:throw new Error("Unable to handle type")}}function F(t){switch(t.type){case"bool":case"bvec2":case"bvec3":case"bvec4":return J;case"float":case"vec2":case"vec3":case"vec4":return C;case"int":case"ivec2":case"ivec3":case"ivec4":return W;case"uint":case"uvec2":case"uvec3":case"uvec4":return A;default:throw new Error("Unable to handle type")}}function k(t){switch(t.type){case"float":case"int":case"uint":case"bool":case"sampler2D":return 1;case"vec2":case"ivec2":case"uvec2":case"bvec2":return 2;case"vec3":case"ivec3":case"uvec3":case"bvec3":return 3;case"vec4":case"ivec4":case"uvec4":case"bvec4":case"mat2":return 4;case"mat3":return 9;case"mat4":return 16;case"array":case"array-2d":return t.size*k(t.elementType)}}function M(t){const e=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const n of e)if(n.includes(t))return n.map(t=>ct[t]);throw new Error("Unable to find type family")}function S(t){return new Proxy(t,{get(e,n){if("constructor"===n)return new Proxy(e.constructor,{construct:(t,e,n)=>S(new t(...e))});if(n in e)return e[n];if("string"==typeof n){const e=M(t.type);return dt(t,n,e[n.length-1])}}})}function R(t){return new Proxy(t,{construct:(t,e,n)=>S(new t(...e))})}function j(t,e){if(!Number.isSafeInteger(t)||t<0||t>=e)throw new B}class B extends Error{}class q extends e{static{this.type="array"}constructor(t,e,n=null){super(),this.elementType=t,this.size=e,this.writeNode=n,this.type="array"}get children(){return this.writeNode?[this.writeNode]:[this.elementType]}clone(){const t=this.writeNode?n(this.writeNode):null,e=new q(n(this.elementType),this.size,t);return super.cloneInto(e),e}set(t,e){return"number"==typeof t&&j(t,this.size),new q(n(this.elementType),this.size,new s(this,t,e))}get(t,e){"number"==typeof t&&j(t,this.size);const n=null!=e?new W(e):null;if(null!=n){const e=F(this.elementType.constructor);return yt(this,new W(t),n,e)}return wt(this,t,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(t,e,n){return $t(this,t,e,n)}glslFindIndex(t,e,n){return zt(this,t,e,n)}static ofType(t,e){const n=t;return class extends q{static{this.elementType=t}static{this.size=e}constructor(){super(new n,e)}}}}class U extends e{static{this.type="array-2d"}constructor(t,e,n,r=!1){super(),this.elementType=t,this.xSize=e,this.ySize=n,this.isRowMajor=r,this.type="array-2d",this.children=Array(e*n).fill(t)}clone(){const t=new U(n(this.elementType),this.xSize,this.ySize,this.isRowMajor);return t.children=this.children.map(n),super.cloneInto(t),t}get size(){return this.xSize*this.ySize}get(t,e){return this.isRowMajor?this._getRowMajor(t,e):this._getColumnMajor(t,e)}_getColumnMajor(t,e){const n=new W(t);return dt(this,new W(e).add(n.multiply(this.xSize)),this.elementType.constructor)}_getRowMajor(t,e){const n=new W(t),r=new W(e);return dt(this,n.add(r.multiply(this.ySize)),this.elementType.constructor)}static ofType(t,e,n,r=!1){return new Proxy(q,{construct:(i,c)=>new U(new t,e,n,r)})}}class P extends e{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}static{this.type="sampler2D"}clone(){const t=new P;return t.children=this.children.map(n),super.cloneInto(t),t}}class C extends e{static{this.type="float"}constructor(t){super(),this.type="float",this.children=[t]}clone(){const t=new C(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return Ft(this,"number"==typeof t?O(t,C):t)}divide(t){return kt(this,"number"==typeof t?O(t,C):t)}add(t){return Mt(this,"number"==typeof t?O(t,C):t)}subtract(t){return St(this,"number"==typeof t?O(t,C):t)}}let X=class extends e{static{a=this}static{this.type="vec2"}constructor(t,e){super(),this.type="vec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new a(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){throw new B}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,C):t)}divide(t){return kt(this,"number"==typeof t?O(t,C):t)}add(t){return Mt(this,"number"==typeof t?O(t,C):t)}subtract(t){return St(this,"number"==typeof t?O(t,C):t)}};X=a=t([R],X);let Y=class extends e{static{f=this}static{this.type="vec3"}constructor(t,e,n){super(),this.type="vec3",this.children=[t,e,n].filter(t=>null!=t)}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){return dt(this,"[2]",C)}get 3(){throw new B}clone(){const t=new f(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}multiply(t){return Ft(this,"number"==typeof t?O(t,C):t)}divide(t){return kt(this,"number"==typeof t?O(t,C):t)}add(t){return Mt(this,"number"==typeof t?O(t,C):t)}subtract(t){return St(this,"number"==typeof t?O(t,C):t)}};Y=f=t([R],Y);let _=class extends e{static{p=this}static{this.type="vec4"}constructor(t,e,n,r){super(),this.type="vec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new p(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){return dt(this,"[2]",C)}get 3(){return dt(this,"[3]",C)}multiply(t){return Ft(this,"number"==typeof t?O(t,C):t)}divide(t){return kt(this,"number"==typeof t?O(t,C):t)}add(t){return Mt(this,"number"==typeof t?O(t,C):t)}subtract(t){return St(this,"number"==typeof t?O(t,C):t)}};_=p=t([R],_);let A=class extends e{static{d=this}static{this.type="uint"}constructor(t){super(),this.type="uint",this.children=[t]}clone(){const t=new d(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return Ft(this,O(t,d))}add(t){return Mt(this,O(t,d))}subtract(t){return St(this,O(t,d))}divide(t){return kt(this,O(t,d))}};A=d=t([R],A);let G=class extends e{static{y=this}static{this.type="uvec2"}constructor(t,e){super(),this.type="uvec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new y(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){throw new B}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,A):t)}divide(t){return kt(this,"number"==typeof t?O(t,A):t)}add(t){return Mt(this,"number"==typeof t?O(t,A):t)}subtract(t){return St(this,"number"==typeof t?O(t,A):t)}};G=y=t([R],G);let H=class extends e{static{w=this}static{this.type="uvec3"}constructor(t,e,n){super(),this.type="uvec3",this.children=[t,e,n].filter(t=>null!=t)}clone(){const t=new w(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",A)}get 1(){return dt(this,"[1]",A)}get 2(){return dt(this,"[2]",A)}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,A):t)}divide(t){return kt(this,"number"==typeof t?O(t,A):t)}add(t){return Mt(this,"number"==typeof t?O(t,A):t)}subtract(t){return St(this,"number"==typeof t?O(t,A):t)}};H=w=t([R],H);let V=class extends e{static{m=this}static{this.type="uvec4"}constructor(t,e,n,r){super(),this.type="uvec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new m(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",A)}get 1(){return dt(this,"[1]",A)}get 2(){return dt(this,"[2]",A)}get 3(){return dt(this,"[3]",A)}multiply(t){return Ft(this,"number"==typeof t?O(t,A):t)}divide(t){return kt(this,"number"==typeof t?O(t,A):t)}add(t){return Mt(this,"number"==typeof t?O(t,A):t)}subtract(t){return St(this,"number"==typeof t?O(t,A):t)}};V=m=t([R],V);class J extends e{static{this.type="bool"}constructor(t){super(),this.type="bool",this.children=[t]}and(t){return Ot(this,t)}or(t){return Vt(this,t)}xor(t){return Kt(this,t)}clone(){const t=new J(n(this.children[0]));return super.cloneInto(t),t}}let K=class extends e{static{v=this}static{this.type="bvec2"}constructor(t,e){super(),this.type="bvec2",this.children=[t,e].filter(t=>null!=t)}all(){return ee(this)}any(){return ne(this)}clone(){const t=new v(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};K=v=t([R],K);let L=class extends e{static{b=this}static{this.type="bvec3"}constructor(t,e,n){super(),this.type="bvec3",this.children=[t,e,n].filter(t=>null!=t)}all(){return ee(this)}any(){return ne(this)}clone(){const t=new b(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};function O(t,e){if("number"==typeof t){return new e(t)}return t}L=b=t([R],L);let Q=class extends e{static{g=this}static{this.type="bvec4"}constructor(t,e,n,r){super(),this.type="bvec4",this.children=[t,e,n,r].filter(t=>null!=t)}all(){return ee(this)}any(){return ne(this)}clone(){const t=new g(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};Q=g=t([R],Q);class W extends e{static{this.type="int"}constructor(t){super(),this.type="int",this.children=[t]}multiply(t){return Ft(this,O(t,W))}add(t){return Mt(this,O(t,W))}subtract(t){return St(this,O(t,W))}divide(t){return kt(this,O(t,W))}clone(){const t=new W(n(this.children[0]));return super.cloneInto(t),t}}let Z=class extends e{static{x=this}static{this.type="ivec2"}constructor(t,e){super(),this.type="ivec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new x(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){throw new B}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,W):t)}divide(t){return kt(this,"number"==typeof t?O(t,W):t)}add(t){return Mt(this,"number"==typeof t?O(t,W):t)}subtract(t){return St(this,"number"==typeof t?O(t,W):t)}};Z=x=t([R],Z);let tt=class extends e{static{I=this}static{this.type="ivec3"}constructor(t,e,n){super(),this.type="ivec3",this.children=[t,e,n].filter(t=>null!=t)}clone(){const t=new I(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){return dt(this,"[2]",W)}get 3(){throw new B}multiply(t){return Ft(this,"number"==typeof t?O(t,W):t)}divide(t){return kt(this,"number"==typeof t?O(t,W):t)}add(t){return Mt(this,"number"==typeof t?O(t,W):t)}subtract(t){return St(this,"number"==typeof t?O(t,W):t)}};tt=I=t([R],tt);let et=class extends e{static{E=this}static{this.type="ivec4"}constructor(t,e,n,r){super(),this.type="ivec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new E(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){return dt(this,"[2]",W)}get 3(){return dt(this,"[3]",W)}multiply(t){return Ft(this,"number"==typeof t?O(t,W):t)}divide(t){return kt(this,"number"==typeof t?O(t,W):t)}add(t){return Mt(this,"number"==typeof t?O(t,W):t)}subtract(t){return St(this,"number"==typeof t?O(t,W):t)}};et=E=t([R],et);class nt extends e{static{this.type="mat2"}constructor(t,e,n,r){super(),this.type="mat2",this.children=[t,e,n,r]}clone(){const t=new nt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get(t,e){return yt(this,new W(t),new W(e),C)}multiply(t){return Ft(this,t)}}class rt extends e{static{this.type="mat3"}static identity(){return new rt(1,0,0,0,1,0,0,0,1)}static fromRotation(t){const e=un(t),n=he(t);return new rt(n,e,0,xt(e),n,0,0,0,1)}constructor(t,e,n,r,i,c,s,u,o){super(),this.type="mat3",this.children=[t,e,n,r,i,c,s,u,o]}add(t){return Mt(this,t)}multiply(t){return Ft(this,t)}get(t,e){return yt(this,new W(t),new W(e),C)}clone(){const t=new rt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]));return super.cloneInto(t),t}}class it extends e{static{this.type="mat4"}static identity(){return new it(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(t,e,n,r,i,c,s,u,o,h,l,a,f,p,d,y){super(),this.type="mat4",this.children=[t,e,n,r,i,c,s,u,o,h,l,a,f,p,d,y]}static fromColumns(t,e,n,r){return new it(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,n.x,n.y,n.z,n.w,r.x,r.y,r.z,r.w)}multiply(t){return Ft(this,t)}get(t,e){return yt(this,new W(t),new W(e),C)}clone(){const t=new it(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]),n(this.children[9]),n(this.children[10]),n(this.children[11]),n(this.children[12]),n(this.children[13]),n(this.children[14]),n(this.children[15]));return super.cloneInto(t),t}}const ct={float:C,vec2:X,vec3:Y,vec4:_,int:W,ivec2:Z,ivec3:tt,ivec4:et,uint:A,uvec2:G,uvec3:H,uvec4:V,bool:J,bvec2:K,bvec3:L,bvec4:Q},st=(...t)=>new W(...t),ut=(...t)=>new C(...t),ot=(...t)=>new X(...t),ht=(...t)=>new Y(...t),lt=(...t)=>new _(...t),at=(...t)=>new nt(...t),ft=(...t)=>new rt(...t),pt=(...t)=>new it(...t);function dt(t,e,n){const r=new n(new i(e,t,n));return r.isImplicit=!0,r}function yt(t,e,n,r){const i=new r(new o(e,n,t,r));return i.isImplicit=!0,i}function wt(t,e,n){const r=new n(new h(t,e,n));return r.isImplicit=!0,r}function mt(t,e,n,r=null){if(r){const i=new r,s=new r(new c(t,[e,n],!0,!1,i));return s.isImplicit=!0,s}if("float"===e.type||"int"===e.type){const r=new n.constructor(new c(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}if(("mat2"===e.type||"mat3"===e.type||"mat4"===e.type)&&"float"!==n.type){const r=new n.constructor(new c(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}const i=new e.constructor(new c(t,[e,n],!0,!1,e.constructor));return i.isImplicit=!0,i}function vt(t,e,n=e.constructor){const r=new n(new c(t,[e],!1,!1,n));return r.isImplicit=!0,r}function bt(t,e,n,r=e.constructor){const i=new r(new c(t,[e,n],!1,!1,r));return i.isImplicit=!0,i}function gt(t,e,n,r,i=e.constructor){const s=new i(new c(t,[e,n,r],!1,!1,i));return s.isImplicit=!0,s}function xt(t){return Ft(t,ut(-1))}function It(t,e,n,r){return new e(new u(t,e,n,r))}function Et(t,e){const n="function"==typeof t?t():t,r=new n.constructor(new l(n).setDebugName(e));return r.isImplicit=!0,r}function $t(t,e,n=0,r=t.size){const i=new W(n).setMutable().setDebugName("FindIndexIterator"),c=e(t.get(i)).setDebugName("FindIndexPredicate"),s=It({iter:i},W,c,({out:t,iter:e,subgraph:n})=>`\n${t} = -1;\n\nfor (; ${e} < ${r}; ${e}++) {\n\n${n.body}\n\n if (${n.varName}) {\n ${t} = ${e};\n break;\n }\n\n}\n`).setDebugName("FindIndexBlock");return s}function zt(t,e,n=0,r=t.size){const i=It({array:t},W,null,({out:t,array:i})=>`\n${t} = -1;\nfor (int i = ${n}; i < ${r}; i++) {\n bool condition;\n ${e({array:i,i:"i",out:"condition"})}\n if (condition) {\n ${t} = i;\n break;\n }\n}\n`).setDebugName("GlslFindIndexBlock");return i}function Tt(t,e,n){const i="function"==typeof e?e():e,c="function"==typeof n?n():n,s=new i.constructor(new r(t,i,c));return s.isImplicit=!0,s}function Nt(...t){const e=t.map(([t,e])=>"function"==typeof e?[t,e()]:[t,e]),n=e[0][1].constructor,r=e.findIndex(t=>!0===t[0]);if(-1===r)throw new Error("A cond must have a fallthrough case with `true`/; ");const i=e.slice(0,r),c=e[r][1],s=new n(i.reduceRight((t,e)=>Tt(e[0],e[1],t),c));return s.isImplicit=!0,s}function Dt(t,e){const n=new e.constructor(new r(t,e,null));return n.isImplicit=!0,n}function Ft(t,e){return mt("*",t,e)}function kt(t,e){return mt("/",t,e)}function Mt(t,e){return mt("+",t,e)}function St(t,e){return mt("-",t,e)}function Rt(t,e){return mt("%",t,e)}function jt(t,e){return mt("<<",t,e)}function Bt(t,e){return mt(">>",t,e)}function qt(t,e){return mt("&",t,e)}function Ut(t,e){return mt("|",t,e)}function Pt(t,e){return mt("^",t,e)}function Ct(t){return vt("~",t)}function Xt(t,e){return mt("==",t,e,J)}function Yt(t,e){return mt("!=",t,e,J)}function _t(t,e){return mt("<",t,e,J)}function At(t,e){return mt("<=",t,e,J)}function Gt(t,e){return mt(">",t,e,J)}function Ht(t,e){return mt(">=",t,e,J)}function Vt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Jt(t,e),t[0])}function Jt(t,e){return mt("||",t,e,J)}function Kt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Lt(t,e),t[0])}function Lt(t,e){return mt("^^",t,e,J)}function Ot(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Qt(t,e),t[0])}function Qt(t,e){return mt("&&",t,e,J)}function Wt(t){return vt("abs",t)}function Zt(t){return vt("acos",t)}function te(t){return vt("acosh",t)}function ee(t){return vt("all",t,J)}function ne(t){return vt("any",t,J)}function re(t){return vt("asin",t)}function ie(t){return vt("asinh",t)}function ce(t,e){return null==e?vt("atan",t):bt("atan",t,e,t.constructor)}function se(t){return vt("atanh",t)}function ue(t){return vt("ceil",t)}function oe(t,e,n){return gt("clamp",t,e,n,t.constructor)}function he(t){return vt("cos",t)}function le(t){return vt("cosh",t)}function ae(t,e){return bt("cross",t,e,t.constructor)}function fe(t){return vt("dFdX",t)}function pe(t){return vt("dFdY",t)}function de(t){return vt("degrees",t)}function ye(t){return vt("determinant",t,C)}function we(t,e){return bt("distance",t,e,C)}function me(t,e){return bt("dot",t,e,C)}function ve(t,e){return bt("equal",t,e,D(t))}function be(t,e){return bt("greaterThan",t,e,D(t))}function ge(t,e){return bt("greaterThanEqual",t,e,D(t))}function xe(t){return vt("exp",t)}function Ie(t){return vt("exp2",t)}function Ee(t,e,n){return gt("faceforward",t,e,n)}function $e(t){return vt("floatBitsToInt",t,N(t))}function ze(t){return vt("floatBitsToUint",t,z(t))}function Te(t){return vt("floor",t)}function Ne(t){return vt("fract",t)}function De(t){return vt("fwidth",t)}function Fe(t){return vt("intBitsToFloat",t,T(t))}function ke(t){return vt("uintBitsToFloat",t,$(t))}function Me(t){return vt("inverse",t,C)}function Se(t){return vt("inversesqrt",t)}function Re(t){return vt("isinf",t,D(t))}function je(t){return vt("isnan",t,D(t))}function Be(t){return vt("length",t,C)}function qe(t,e){return bt("lessThan",t,e,D(t))}function Ue(t,e){return bt("lessThanEqual",t,e,D(t))}function Pe(t){return vt("log",t)}function Ce(t){return vt("log2",t)}function Xe(t,e){return bt("matrixCompMult",t,e)}function Ye(t,e){return bt("max",t,e)}function _e(t,e){return bt("min",t,e)}function Ae(t,e,n){return gt("mix",t,e,n)}function Ge(t,e){return bt("mod",t,e)}function He(t,e){throw new Error("modf not implemented")}function Ve(t){return vt("normalize",t)}function Je(t){return"bool"===t.type?vt("!",t):vt("not",t)}function Ke(t,e){return bt("notEqual",t,e,D(t))}function Le(t,e){throw new Error("Impl type?")}function Oe(t){return vt("packHalf2x16",t,A)}function Qe(t){return vt("packUnorm2x16",t,A)}function We(t){return vt("packSnorm2x16",t,A)}function Ze(t,e){return bt("pow",t,e)}function tn(t){return vt("radians",t)}function en(t,e){return bt("reflect",t,e)}function nn(t,e,n){return gt("refract",t,e,n)}function rn(t){return vt("round",t)}function cn(t){return vt("roundEven",t)}function sn(t){return vt("sign",t)}function un(t){return vt("sin",t)}function on(t){return vt("sinh",t)}function hn(t,e,n){return gt("smoothstep",t,e,n)}function ln(t){return vt("sqrt",t)}function an(t,e){return bt("step",t,e,e.constructor)}function fn(t){return vt("tan",t)}function pn(t){return vt("tanh",t)}function dn(t,e,n){return gt("texelFetch",t,e,n,_)}function yn(t,e,n,r){throw new Error("Impl type")}function wn(t,e,n){throw new Error("Impl type")}function mn(t,e){return bt("texture",t,e,_)}function vn(t,e,n,r){throw new Error("Impl type")}function bn(t,e,n,r,i){throw new Error("Impl type")}function gn(t,e,n){throw new Error("Impl type")}function xn(t,e,n,r){throw new Error("Impl type")}function In(t,e,n,r){throw new Error("Impl type")}function En(t,e,n){throw new Error("Impl type")}function $n(t,e,n,r){throw new Error("Impl type")}function zn(t,e,n,r,i){throw new Error("Impl type")}function Tn(t,e,n){throw new Error("Impl type")}function Nn(t,e,n,r){throw new Error("Impl type")}function Dn(t,e,n,r){throw new Error("Impl type")}function Fn(t,e){throw new Error("Impl type")}function kn(t){return vt("transpose",t)}function Mn(t){return vt("trunc",t)}function Sn(t){return vt("unpackHalf2x16",t,X)}function Rn(t){return vt("unpackUnorm2x16",t,X)}function jn(t){return vt("unpackSnorm2x16",t,X)}function Bn(t,e){const n=Ze(new C(2),new C(e));return[new _(Ge(t.x,n),Te(t.x.divide(n)),Ge(t.y,n),Te(t.y.divide(n))),new _(Ge(t.z,n),Te(t.z.divide(n)),Ge(t.w,n),Te(t.w.divide(n)))]}function qn(t,e){const{initialValue:n,xRange:r,yRange:i,callback:c}=e,[s,u]=r,[o,h]=i,l=new W(0).setMutable().setDebugName("iterX"),a=new W(0).setMutable().setDebugName("iterY"),f=n.setMutable().setDebugName("accumulator"),p=c(f,t.get(l,a),l,a).setDebugName("callback"),d=It({iterX:l,iterY:a,accumulator:f},n.constructor,p,({out:t,iterX:e,iterY:n,accumulator:r,subgraph:i})=>`\nfor (${n} = ${o}; ${n} < ${h}; ${n}++) {\n for (${e} = ${s}; ${e} < ${u}; ${e}++) {\n\n ${i.body}\n\n ${r} = ${i.varName};\n }\n}\n${t} = ${r};\n`).setDebugName("reduce2DBody");return d}export{K as BVec2,L as BVec3,Q as BVec4,J as Bool,q as FixedArray,U as FixedArray2D,C as Float,Z as IVec2,tt as IVec3,et as IVec4,W as Int,nt as Mat2,rt as Mat3,it as Mat4,P as Sampler2D,A as UInt,G as UVec2,H as UVec3,V as UVec4,X as Vec2,Y as Vec3,_ as Vec4,Jt as _or,Lt as _xor,Wt as abs,Zt as acos,te as acosh,Mt as add,ee as all,Ot as and,ne as any,re as asin,ie as asinh,ce as atan,se as atanh,qt as bitAnd,Ct as bitNot,Ut as bitOr,Bt as bitRShift,jt as bitShift,Pt as bitXor,It as block,ue as ceil,oe as clamp,Nt as cond,he as cos,le as cosh,ae as cross,fe as dFdx,pe as dFdy,wt as defineArrayRead,dt as definePropertyAccess,yt as definePropertyAccess2D,de as degrees,ye as determinant,we as distance,kt as divide,me as dot,Xt as equal,ve as equalComponent,xe as exp,Ie as exp2,Ee as faceforward,$t as findIndex,ut as float,$e as floatBitsToInt,ze as floatBitsToUint,Te as floor,Ne as fract,De as fwidth,k as getTypeElementLengthForType,zt as glslFindIndex,Gt as greaterThan,be as greaterThanComponent,Ht as greaterThanEqual,ge as greaterThanEqualComponent,Tt as ifElse,st as int,Fe as intBitsToFloat,Rt as intMod,Me as inverse,Se as inversesqrt,Re as isinf,je as isnan,Be as length,_t as lessThan,qe as lessThanComponent,At as lessThanEqual,Ue as lessThanEqualComponent,Pe as log,Ce as log2,at as mat2,ft as mat3,pt as mat4,Xe as matrixCompMult,Ye as max,_e as min,Ae as mix,Ge as mod,He as modf,Ft as multiply,Et as namedScope,xt as negate,Ve as normalize,Je as not,Yt as notEqual,Ke as notEqualComponent,Vt as or,Le as outerProduct,Oe as packHalf2x16,We as packSnorm2x16,Qe as packUnorm2x16,Ze as pow,tn as radians,qn as reduce2D,en as reflect,nn as refract,rn as round,cn as roundEven,sn as sign,un as sin,on as sinh,hn as smoothstep,ln as sqrt,an as step,St as subtract,fn as tan,pn as tanh,dn as texelFetch,yn as texelFetchOffset,wn as texture,mn as texture2D,vn as textureGrad,bn as textureGradOffset,gn as textureLod,xn as textureLodOffset,In as textureOffset,En as textureProj,$n as textureProjGrad,zn as textureProjGradOffset,Tn as textureProjLod,Nn as textureProjLodOffset,Dn as textureProjOffset,Fn as textureSize,N as transformFloatToInt,z as transformFloatToUInt,T as transformIntToFloat,D as transformTypeToBooleanType,$ as transformUIntToFloat,kn as transpose,Mn as trunc,ke as uintBitsToFloat,Sn as unpackHalf2x16,jn as unpackSnorm2x16,Rn as unpackUnorm2x16,Bn as unpackVec4,ot as vec2,ht as vec3,lt as vec4,Dt as when,Kt as xor};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as e}from"tslib";import{tileSize as o}from"../../../definitions.js";import{FragmentOutput as s,location as i,uniform as r,texture as d,define as l,input as n,UniformGroup as a,TextureGroup as p}from"../../GraphShaderModule.js";import{Mat3 as h,Vec3 as u,Vec4 as c,texture2D as m,Mat4 as y,step as v,Float as x,dot as w,max as f,FixedArray as g,Sampler2D as T}from"../../graph/glsl.js";import{AFeatureShader as A,FeatureFragmentInput as D,FeatureVertexInput as b}from"../shaders/AFeatureShader.js";import{failHittest as C}from"../shaders/hittestUtils.js";import{max4 as j}from"../shaders/utils.js";class V extends b{}t([i(3,x)],V.prototype,"inverseArea",void 0);class F extends D{}class O extends a{}t([r(g.ofType(c,2))],O.prototype,"isActive",void 0),t([r(g.ofType(c,8))],O.prototype,"colors",void 0),t([r(x)],O.prototype,"dotValue",void 0);class R extends a{}t([r(x)],R.prototype,"tileZoomFactor",void 0),t([r(x)],R.prototype,"pixelRatio",void 0),t([r(x)],R.prototype,"tileDotsOverArea",void 0);class S extends p{}t([d(T)],S.prototype,"dotTexture0",void 0),t([d(T)],S.prototype,"dotTexture1",void 0);class _ extends A{constructor(){super(...arguments),this.type="DotDensityPolygonShader"}_dotThreshold(t,e,o){return t.divide(e).divide(o)}vertex(t){const e=new h(2/o,0,0,0,-2/o,0,-1,1,1).multiply(new u(t.pos,1)),s=this.clip(t.id),i=new c(e.xy,s,1),r=this.getVVData(t.id).multiply(this.instance.isActive.get(0)).multiply(t.inverseArea),d=this.storageTextures.getDataDrivenData0(this.getAttributeDataCoords(t.id)).multiply(this.instance.isActive.get(1)).multiply(t.inverseArea),l=this.draw.tileZoomFactor.multiply(o).divide(this.draw.pixelRatio),n=this._dotThreshold(r,this.instance.dotValue,this.draw.tileDotsOverArea),a=this._dotThreshold(d,this.instance.dotValue,this.draw.tileDotsOverArea),p=t.pos.add(.5).divide(l);return{glPosition:i,color:new c(0,0,0,0),textureCoords:p,thresholds0:n,thresholds1:a}}fragment(t){const e=new s,o=m(this.drawTextures.dotTexture0,t.textureCoords),i=m(this.drawTextures.dotTexture1,t.textureCoords),r=t.thresholds0.subtract(o),d=t.thresholds1.subtract(i);let l;const n=y.fromColumns(this.instance.colors[0],this.instance.colors[1],this.instance.colors[2],this.instance.colors[3]),a=y.fromColumns(this.instance.colors[4],this.instance.colors[5],this.instance.colors[6],this.instance.colors[7]);if(this.blending){const t=v(new x(0),r),e=v(new x(0),d),o=w(t,r).add(w(e,d)),s=v(o,new x(0)),i=new x(1).subtract(s),p=o.add(s),h=r.multiply(t).divide(p),u=d.multiply(e).divide(p),c=n.multiply(h).add(a.multiply(u));l=i.multiply(c)}else{const t=f(j(r),j(d)),e=v(t,new x(0)),o=new x(1).subtract(e),s=v(t,r),i=v(t,d),p=n.multiply(s).add(a.multiply(i));l=o.multiply(p)}return e.fragColor=l,e}hittest(t){return C(this.hittestRequest)}}t([l],_.prototype,"blending",void 0),t([r(O)],_.prototype,"instance",void 0),t([r(R)],_.prototype,"draw",void 0),t([d(S)],_.prototype,"drawTextures",void 0),t([e(0,n(V))],_.prototype,"vertex",null),t([e(0,n(D))],_.prototype,"fragment",null);export{S as DotDensityPolygonDrawTextures,R as DotDensityPolygonDrawUniforms,F as DotDensityPolygonFragmentInput,O as DotDensityPolygonInstanceUniforms,_ as DotDensityPolygonShader,V as DotDensityPolygonVertexInput};
2
+ import{__decorate as t,__param as e}from"tslib";import{tileSize as o}from"../../../definitions.js";import{FragmentOutput as s,location as i,uniform as r,texture as d,define as l,input as n,UniformGroup as a,TextureGroup as p}from"../../GraphShaderModule.js";import{Mat3 as h,Vec3 as u,Vec4 as c,texture2D as m,Mat4 as y,step as v,Float as g,dot as x,max as w,FixedArray as f,Sampler2D as T}from"../../graph/glsl.js";import{AFeatureShader as A,FeatureFragmentInput as D,FeatureVertexInput as b}from"../shaders/AFeatureShader.js";import{failHittest as C}from"../shaders/hittestUtils.js";import{max4 as j}from"../shaders/utils.js";class V extends b{}t([i(3,g)],V.prototype,"inverseArea",void 0);class F extends D{}class O extends a{}t([r(f.ofType(c,2))],O.prototype,"isActive",void 0),t([r(f.ofType(c,8))],O.prototype,"colors",void 0),t([r(g)],O.prototype,"dotValue",void 0);class R extends a{}t([r(g)],R.prototype,"tileZoomFactor",void 0),t([r(g)],R.prototype,"pixelRatio",void 0),t([r(g)],R.prototype,"tileDotsOverArea",void 0);class S extends p{}t([d(T)],S.prototype,"dotTexture0",void 0),t([d(T)],S.prototype,"dotTexture1",void 0);class _ extends A{constructor(){super(...arguments),this.type="DotDensityPolygonShader"}_dotThreshold(t,e,o){return t.divide(e).divide(o)}vertex(t){const e=new h(2/o,0,0,0,-2/o,0,-1,1,1).multiply(new u(t.pos,1)),s=this.clip(t.id),i=new c(e.xy,s,1),r=this.getVVData(t.id).multiply(this.instance.isActive.get(0)).multiply(t.inverseArea),d=this.storageTextures.getDataDrivenData0(this.getAttributeDataCoords(t.id)).multiply(this.instance.isActive.get(1)).multiply(t.inverseArea),l=this.draw.tileZoomFactor.multiply(o).divide(this.draw.pixelRatio),n=this._dotThreshold(r,this.instance.dotValue,this.draw.tileDotsOverArea),a=this._dotThreshold(d,this.instance.dotValue,this.draw.tileDotsOverArea),p=t.pos.add(.5).divide(l);return{glPosition:i,color:new c(0,0,0,0),textureCoords:p,thresholds0:n,thresholds1:a}}fragment(t){const e=new s,o=m(this.drawTextures.dotTexture0,t.textureCoords),i=m(this.drawTextures.dotTexture1,t.textureCoords),r=t.thresholds0.subtract(o),d=t.thresholds1.subtract(i);let l;const n=y.fromColumns(this.instance.colors.get(0),this.instance.colors.get(1),this.instance.colors.get(2),this.instance.colors.get(3)),a=y.fromColumns(this.instance.colors.get(4),this.instance.colors.get(5),this.instance.colors.get(6),this.instance.colors.get(7));if(this.blending){const t=v(new g(0),r),e=v(new g(0),d),o=x(t,r).add(x(e,d)),s=v(o,new g(0)),i=new g(1).subtract(s),p=o.add(s),h=r.multiply(t).divide(p),u=d.multiply(e).divide(p),c=n.multiply(h).add(a.multiply(u));l=i.multiply(c)}else{const t=w(j(r),j(d)),e=v(t,new g(0)),o=new g(1).subtract(e),s=v(t,r),i=v(t,d),p=n.multiply(s).add(a.multiply(i));l=o.multiply(p)}return e.fragColor=l,e}hittest(t){return C(this.hittestRequest)}}t([l],_.prototype,"blending",void 0),t([r(O)],_.prototype,"instance",void 0),t([r(R)],_.prototype,"draw",void 0),t([d(S)],_.prototype,"drawTextures",void 0),t([e(0,n(V))],_.prototype,"vertex",null),t([e(0,n(D))],_.prototype,"fragment",null);export{S as DotDensityPolygonDrawTextures,R as DotDensityPolygonDrawUniforms,F as DotDensityPolygonFragmentInput,O as DotDensityPolygonInstanceUniforms,_ as DotDensityPolygonShader,V as DotDensityPolygonVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as o,__param as t}from"tslib";import{FragmentOutput as e,uniform as i,texture as r,input as s,define as l,UniformGroup as p,TextureGroup as u}from"../../GraphShaderModule.js";import{clamp as m,Float as n,Vec4 as d,texture2D as y,mix as a,Vec3 as h,dot as g,smoothstep as c,Sampler2D as v,FixedArray as f}from"../../graph/glsl.js";import{PostProcessingShader as b,PostProcessingFragmentInput as x}from"./PostProcessingShader.js";class T extends p{}o([i(h)],T.prototype,"defaultColor",void 0),o([i(n)],T.prototype,"defaultOpacity",void 0),o([i(n)],T.prototype,"luminosityThreshold",void 0),o([i(n)],T.prototype,"smoothWidth",void 0);class C extends b{constructor(){super(...arguments),this.type="LuminosityHighPassShader"}fragment(o){const t=new e,i=y(this.luminosityHighPassTexture,o.uv),r=new h(.299,.587,.114),s=g(i.xyz,r),l=new d(this.luminosityHighPassConfig.defaultColor.rgb,this.luminosityHighPassConfig.defaultOpacity),p=c(this.luminosityHighPassConfig.luminosityThreshold,this.luminosityHighPassConfig.luminosityThreshold.add(this.luminosityHighPassConfig.smoothWidth),s);return t.fragColor=a(l,i,p),t}}o([i(T)],C.prototype,"luminosityHighPassConfig",void 0),o([r(v)],C.prototype,"luminosityHighPassTexture",void 0),o([t(0,s(x))],C.prototype,"fragment",null);class w extends p{}o([i(n)],w.prototype,"bloomStrength",void 0),o([i(n)],w.prototype,"bloomRadius",void 0),o([i(f.ofType(n,5))],w.prototype,"bloomFactors",void 0),o([i(h)],w.prototype,"bloomTintColor",void 0);class P extends u{}o([r(v)],P.prototype,"blurTexture1",void 0),o([r(v)],P.prototype,"blurTexture2",void 0),o([r(v)],P.prototype,"blurTexture3",void 0),o([r(v)],P.prototype,"blurTexture4",void 0),o([r(v)],P.prototype,"blurTexture5",void 0);class H extends b{constructor(){super(...arguments),this.type="CompositeShader"}fragment(o){const t=new e,{blurTexture1:i,blurTexture2:r,blurTexture3:s,blurTexture4:l,blurTexture5:p}=this.compositeTextures,{bloomStrength:u,bloomFactors:a,bloomTintColor:h,bloomRadius:g}=this.compositeConfig,c=m(g,new n(0),new n(1)),v=this._lerpBloomFactor(a[0],c).multiply(new d(h,1).multiply(y(i,o.uv))),f=this._lerpBloomFactor(a[1],c).multiply(new d(h,1).multiply(y(r,o.uv))),b=this._lerpBloomFactor(a[2],c).multiply(new d(h,1).multiply(y(s,o.uv))),x=this._lerpBloomFactor(a[3],c).multiply(new d(h,1).multiply(y(l,o.uv))),T=this._lerpBloomFactor(a[4],c).multiply(new d(h,1).multiply(y(p,o.uv))),C=u.multiply(v.add(f.add(b.add(x.add(T)))));return t.fragColor=C,t}_lerpBloomFactor(o,t){const e=new n(1.2).subtract(o);return a(o,e,t)}}o([l],H.prototype,"numMips",void 0),o([i(w)],H.prototype,"compositeConfig",void 0),o([r(P)],H.prototype,"compositeTextures",void 0),o([t(0,s(x))],H.prototype,"fragment",null);export{H as BloomCompositeShader,C as LuminosityHighPassShader};
2
+ import{__decorate as o,__param as t}from"tslib";import{FragmentOutput as e,uniform as i,texture as r,input as s,define as l,UniformGroup as p,TextureGroup as u}from"../../GraphShaderModule.js";import{clamp as m,Float as n,Vec4 as d,texture2D as y,mix as a,Vec3 as h,dot as g,smoothstep as c,Sampler2D as v,FixedArray as f}from"../../graph/glsl.js";import{PostProcessingShader as b,PostProcessingFragmentInput as x}from"./PostProcessingShader.js";class T extends p{}o([i(h)],T.prototype,"defaultColor",void 0),o([i(n)],T.prototype,"defaultOpacity",void 0),o([i(n)],T.prototype,"luminosityThreshold",void 0),o([i(n)],T.prototype,"smoothWidth",void 0);class C extends b{constructor(){super(...arguments),this.type="LuminosityHighPassShader"}fragment(o){const t=new e,i=y(this.luminosityHighPassTexture,o.uv),r=new h(.299,.587,.114),s=g(i.xyz,r),l=new d(this.luminosityHighPassConfig.defaultColor.rgb,this.luminosityHighPassConfig.defaultOpacity),p=c(this.luminosityHighPassConfig.luminosityThreshold,this.luminosityHighPassConfig.luminosityThreshold.add(this.luminosityHighPassConfig.smoothWidth),s);return t.fragColor=a(l,i,p),t}}o([i(T)],C.prototype,"luminosityHighPassConfig",void 0),o([r(v)],C.prototype,"luminosityHighPassTexture",void 0),o([t(0,s(x))],C.prototype,"fragment",null);class w extends p{}o([i(n)],w.prototype,"bloomStrength",void 0),o([i(n)],w.prototype,"bloomRadius",void 0),o([i(f.ofType(n,5))],w.prototype,"bloomFactors",void 0),o([i(h)],w.prototype,"bloomTintColor",void 0);class P extends u{}o([r(v)],P.prototype,"blurTexture1",void 0),o([r(v)],P.prototype,"blurTexture2",void 0),o([r(v)],P.prototype,"blurTexture3",void 0),o([r(v)],P.prototype,"blurTexture4",void 0),o([r(v)],P.prototype,"blurTexture5",void 0);class H extends b{constructor(){super(...arguments),this.type="CompositeShader"}fragment(o){const t=new e,{blurTexture1:i,blurTexture2:r,blurTexture3:s,blurTexture4:l,blurTexture5:p}=this.compositeTextures,{bloomStrength:u,bloomFactors:a,bloomTintColor:h,bloomRadius:g}=this.compositeConfig,c=m(g,new n(0),new n(1)),v=this._lerpBloomFactor(a.get(0),c).multiply(new d(h,1).multiply(y(i,o.uv))),f=this._lerpBloomFactor(a.get(1),c).multiply(new d(h,1).multiply(y(r,o.uv))),b=this._lerpBloomFactor(a.get(2),c).multiply(new d(h,1).multiply(y(s,o.uv))),x=this._lerpBloomFactor(a.get(3),c).multiply(new d(h,1).multiply(y(l,o.uv))),T=this._lerpBloomFactor(a.get(4),c).multiply(new d(h,1).multiply(y(p,o.uv))),C=u.multiply(v.add(f.add(b.add(x.add(T)))));return t.fragColor=C,t}_lerpBloomFactor(o,t){const e=new n(1.2).subtract(o);return a(o,e,t)}}o([l],H.prototype,"numMips",void 0),o([i(w)],H.prototype,"compositeConfig",void 0),o([r(P)],H.prototype,"compositeTextures",void 0),o([t(0,s(x))],H.prototype,"fragment",null);export{H as BloomCompositeShader,C as LuminosityHighPassShader};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{uniform as t,UniformGroup as i}from"../../../../GraphShaderModule.js";import{Vec2 as r,negate as s,sign as l,abs as o,Float as p,step as m,mod as d,atan as a,mix as c,Vec4 as u}from"../../../../graph/glsl.js";import{getSurfaceValues as n,computeDeltaZ as y}from"../surface.js";import{BaseRasterProcessorShader as f}from"./BaseRasterProcessorShader.js";class h extends i{}e([t(r)],h.prototype,"cellSize",void 0);class g extends f{constructor(){super(...arguments),this.type="AspectShader"}_process(e){const t=n(this.texture,e,this.config.srcImageSize),i=new r(1).divide(this.aspectConfig.cellSize.multiply(8)),{x:f,y:h}=y(t,i),g=s(h),w=t[9].multiply(l(o(f).add(o(g)))),S=o(l(f)),x=new p(3.14159265359),j=new p(0),v=m(j,g).multiply(.5).multiply(x).add(m(g,j).multiply(1.5).multiply(x)),z=d(new p(2.5).multiply(x).add(a(g,s(f))),new p(2).multiply(x)),C=c(v,z,S).multiply(180).divide(x);return new u(C,C,C,w)}}e([t(h)],g.prototype,"aspectConfig",void 0);export{g as AspectShader};
2
+ import{__decorate as e}from"tslib";import{uniform as t,UniformGroup as i}from"../../../../GraphShaderModule.js";import{Vec2 as r,negate as s,sign as l,abs as o,Float as p,step as m,mod as d,atan as a,mix as c,Vec4 as u}from"../../../../graph/glsl.js";import{getSurfaceValues as n,computeDeltaZ as y}from"../surface.js";import{BaseRasterProcessorShader as f}from"./BaseRasterProcessorShader.js";class h extends i{}e([t(r)],h.prototype,"cellSize",void 0);class g extends f{constructor(){super(...arguments),this.type="AspectShader"}_process(e){const t=n(this.texture,e,this.config.srcImageSize),i=new r(1).divide(this.aspectConfig.cellSize.multiply(8)),{x:f,y:h}=y(t,i),g=s(h),w=t.get(9).multiply(l(o(f).add(o(g)))),S=o(l(f)),x=new p(3.14159265359),j=new p(0),v=m(j,g).multiply(.5).multiply(x).add(m(g,j).multiply(1.5).multiply(x)),z=d(new p(2.5).multiply(x).add(a(g,s(f))),new p(2).multiply(x)),C=c(v,z,S).multiply(180).divide(x);return new u(C,C,C,w)}}e([t(h)],g.prototype,"aspectConfig",void 0);export{g as AspectShader};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{uniform as r,define as e,UniformGroup as s}from"../../../../GraphShaderModule.js";import{negate as i,dot as o,Vec3 as a,Vec4 as u,Float as d}from"../../../../graph/glsl.js";import{getSurfaceValues as p}from"../surface.js";import{BaseRasterProcessorShader as l}from"./BaseRasterProcessorShader.js";class c extends s{}t([r(d)],c.prototype,"zlFactor",void 0);class m extends l{constructor(){super(...arguments),this.type="CurvatureShader"}_process(t){const r=p(this.texture,t,this.config.srcImageSize),e=r[3].add(r[5]).multiply(.5).subtract(r[4]),s=r[1].add(r[7]).multiply(.5).subtract(r[4]),{zlFactor:d}=this.curvatureConfig,{curvatureType:l}=this;let c;if("standard"===l)c=i(d).multiply(e.add(s));else{const t=r[2].subtract(r[0]).add(r[6]).subtract(r[8]).divide(4),u=r[5].subtract(r[3]).divide(2),p=r[1].subtract(r[7]).divide(2),m=u.multiply(u),n=p.multiply(p),y=u.multiply(p),v=d.divide(m.add(n));c="profile"===l?o(new a(e,s,t),new a(m,n,y)).multiply(v):o(new a(e,s,i(t)),new a(n,m,y)).multiply(i(v))}return new u(c,c,c,r[9])}}t([e],m.prototype,"curvatureType",void 0),t([r(c)],m.prototype,"curvatureConfig",void 0);export{m as CurvatureShader};
2
+ import{__decorate as t}from"tslib";import{uniform as e,define as r,UniformGroup as s}from"../../../../GraphShaderModule.js";import{negate as i,dot as o,Vec3 as a,Vec4 as u,Float as d}from"../../../../graph/glsl.js";import{getSurfaceValues as p}from"../surface.js";import{BaseRasterProcessorShader as l}from"./BaseRasterProcessorShader.js";class c extends s{}t([e(d)],c.prototype,"zlFactor",void 0);class g extends l{constructor(){super(...arguments),this.type="CurvatureShader"}_process(t){const e=p(this.texture,t,this.config.srcImageSize),r=e.get(3).add(e.get(5)).multiply(.5).subtract(e.get(4)),s=e.get(1).add(e.get(7)).multiply(.5).subtract(e.get(4)),{zlFactor:d}=this.curvatureConfig,{curvatureType:l}=this;let c;if("standard"===l)c=i(d).multiply(r.add(s));else{const t=e.get(2).subtract(e.get(0)).add(e.get(6)).subtract(e.get(8)).divide(4),u=e.get(5).subtract(e.get(3)).divide(2),p=e.get(1).subtract(e.get(7)).divide(2),g=u.multiply(u),m=p.multiply(p),n=u.multiply(p),y=d.divide(g.add(m));c="profile"===l?o(new a(r,s,t),new a(g,m,n)).multiply(y):o(new a(r,s,i(t)),new a(m,g,n)).multiply(i(y))}return new u(c,c,c,e.get(9))}}t([r],g.prototype,"curvatureType",void 0),t([e(c)],g.prototype,"curvatureConfig",void 0);export{g as CurvatureShader};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{maxMapSizeGpu as o}from"../../../../../../../../../layers/raster/functions/pixelUtils.js";import{uniform as e,define as s,UniformGroup as r}from"../../../../GraphShaderModule.js";import{Vec3 as i,abs as a,sign as l,step as p,FixedArray as n,Float as u}from"../../../../graph/glsl.js";import{BaseRasterProcessorShader as m}from"./BaseRasterProcessorShader.js";class c extends r{}t([e(n.ofType(u,6))],c.prototype,"includedRanges",void 0),t([e(n.ofType(u,o))],c.prototype,"noDataValues",void 0);class y extends m{constructor(){super(...arguments),this.type="MaskShader",this.isMultiband=!0}_process(t){const o=this._getPixel(t),e=this._computeNoDataFactor(o.r),s=this._computeRangeFactor(o.rgb);let r;if(this.isMultiband){const t=this._computeNoDataFactor(o.g),a=this._computeNoDataFactor(o.b),l=new i(e,t,a).multiply(s);r=l.x.multiply(l.y).multiply(l.z)}else r=e.multiply(s.x);return o.multiply(r)}_computeNoDataFactor(t){const{noDataValues:e}=this.maskConfig;let s=new i(1);for(let r=0;r<o/3;r++){const o=3*r,p=new i(e[o+0],e[o+1],e[o+2]),n=a(l(p.subtract(t)));s=s.multiply(n)}return s.x.multiply(s.y).multiply(s.z)}_computeRangeFactor(t){const{includedRanges:o}=this.maskConfig,e=new i(o[0],o[2],o[4]),s=new i(o[1],o[3],o[5]);return p(e,t).multiply(p(t,s))}}t([s],y.prototype,"isMultiband",void 0),t([e(c)],y.prototype,"maskConfig",void 0);export{y as MaskShader};
2
+ import{__decorate as t}from"tslib";import{maxMapSizeGpu as e}from"../../../../../../../../../layers/raster/functions/pixelUtils.js";import{uniform as o,define as s,UniformGroup as r}from"../../../../GraphShaderModule.js";import{Vec3 as i,abs as a,sign as l,step as p,FixedArray as n,Float as u}from"../../../../graph/glsl.js";import{BaseRasterProcessorShader as m}from"./BaseRasterProcessorShader.js";class c extends r{}t([o(n.ofType(u,6))],c.prototype,"includedRanges",void 0),t([o(n.ofType(u,e))],c.prototype,"noDataValues",void 0);class g extends m{constructor(){super(...arguments),this.type="MaskShader",this.isMultiband=!0}_process(t){const e=this._getPixel(t),o=this._computeNoDataFactor(e.r),s=this._computeRangeFactor(e.rgb);let r;if(this.isMultiband){const t=this._computeNoDataFactor(e.g),a=this._computeNoDataFactor(e.b),l=new i(o,t,a).multiply(s);r=l.x.multiply(l.y).multiply(l.z)}else r=o.multiply(s.x);return e.multiply(r)}_computeNoDataFactor(t){const{noDataValues:o}=this.maskConfig;let s=new i(1);for(let r=0;r<e/3;r++){const e=3*r,p=new i(o.get(e+0),o.get(e+1),o.get(e+2)),n=a(l(p.subtract(t)));s=s.multiply(n)}return s.x.multiply(s.y).multiply(s.z)}_computeRangeFactor(t){const{includedRanges:e}=this.maskConfig,o=new i(e.get(0),e.get(2),e.get(4)),s=new i(e.get(1),e.get(3),e.get(5));return p(o,t).multiply(p(t,s))}}t([s],g.prototype,"isMultiband",void 0),t([o(c)],g.prototype,"maskConfig",void 0);export{g as MaskShader};